1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 //! C definitions used by libnative that don't belong in liblibc
14 #![cfg_attr(test, allow(dead_code))]
15 #![unstable(issue = "0", feature = "windows_c")]
17 use os
::raw
::{c_int, c_uint, c_ulong, c_long, c_longlong, c_ushort, c_char}
;
18 #[cfg(target_arch = "x86_64")]
19 use os
::raw
::c_ulonglong
;
20 use libc
::{wchar_t, size_t, c_void}
;
25 #[cfg(target_arch = "x86_64")]
26 struct u64x2(u64, u64);
28 pub use self::FILE_INFO_BY_HANDLE_CLASS
::*;
29 pub use self::EXCEPTION_DISPOSITION
::*;
31 pub type DWORD
= c_ulong
;
32 pub type HANDLE
= LPVOID
;
33 pub type HINSTANCE
= HANDLE
;
34 pub type HMODULE
= HINSTANCE
;
35 pub type BOOL
= c_int
;
37 pub type BOOLEAN
= BYTE
;
38 pub type GROUP
= c_uint
;
39 pub type LONG_PTR
= isize;
40 pub type LARGE_INTEGER
= c_longlong
;
41 pub type LONG
= c_long
;
42 pub type UINT
= c_uint
;
44 pub type USHORT
= c_ushort
;
45 pub type SIZE_T
= usize;
47 pub type CHAR
= c_char
;
48 pub type HCRYPTPROV
= LONG_PTR
;
49 pub type ULONG_PTR
= usize;
50 pub type ULONG
= c_ulong
;
51 #[cfg(target_arch = "x86_64")]
52 pub type ULONGLONG
= u64;
53 #[cfg(target_arch = "x86_64")]
54 pub type DWORDLONG
= ULONGLONG
;
56 pub type LPBOOL
= *mut BOOL
;
57 pub type LPBYTE
= *mut BYTE
;
58 pub type LPBY_HANDLE_FILE_INFORMATION
= *mut BY_HANDLE_FILE_INFORMATION
;
59 pub type LPCSTR
= *const CHAR
;
60 pub type LPCVOID
= *const c_void
;
61 pub type LPCWSTR
= *const WCHAR
;
62 pub type LPDWORD
= *mut DWORD
;
63 pub type LPHANDLE
= *mut HANDLE
;
64 pub type LPOVERLAPPED
= *mut OVERLAPPED
;
65 pub type LPPROCESS_INFORMATION
= *mut PROCESS_INFORMATION
;
66 pub type LPSECURITY_ATTRIBUTES
= *mut SECURITY_ATTRIBUTES
;
67 pub type LPSTARTUPINFO
= *mut STARTUPINFO
;
68 pub type LPVOID
= *mut c_void
;
69 pub type LPWCH
= *mut WCHAR
;
70 pub type LPWIN32_FIND_DATAW
= *mut WIN32_FIND_DATAW
;
71 pub type LPWSADATA
= *mut WSADATA
;
72 pub type LPWSAPROTOCOL_INFO
= *mut WSAPROTOCOL_INFO
;
73 pub type LPSTR
= *mut CHAR
;
74 pub type LPWSTR
= *mut WCHAR
;
75 pub type LPFILETIME
= *mut FILETIME
;
77 pub type PCONDITION_VARIABLE
= *mut CONDITION_VARIABLE
;
78 pub type PLARGE_INTEGER
= *mut c_longlong
;
79 pub type PSRWLOCK
= *mut SRWLOCK
;
81 pub type SOCKET
= ::os
::windows
::raw
::SOCKET
;
82 pub type socklen_t
= c_int
;
83 pub type ADDRESS_FAMILY
= USHORT
;
85 pub const TRUE
: BOOL
= 1;
86 pub const FALSE
: BOOL
= 0;
88 pub const FILE_ATTRIBUTE_READONLY
: DWORD
= 0x1;
89 pub const FILE_ATTRIBUTE_DIRECTORY
: DWORD
= 0x10;
90 pub const FILE_ATTRIBUTE_REPARSE_POINT
: DWORD
= 0x400;
92 pub const FILE_SHARE_DELETE
: DWORD
= 0x4;
93 pub const FILE_SHARE_READ
: DWORD
= 0x1;
94 pub const FILE_SHARE_WRITE
: DWORD
= 0x2;
96 pub const CREATE_ALWAYS
: DWORD
= 2;
97 pub const CREATE_NEW
: DWORD
= 1;
98 pub const OPEN_ALWAYS
: DWORD
= 4;
99 pub const OPEN_EXISTING
: DWORD
= 3;
100 pub const TRUNCATE_EXISTING
: DWORD
= 5;
102 pub const FILE_WRITE_DATA
: DWORD
= 0x00000002;
103 pub const FILE_APPEND_DATA
: DWORD
= 0x00000004;
104 pub const FILE_WRITE_EA
: DWORD
= 0x00000010;
105 pub const FILE_WRITE_ATTRIBUTES
: DWORD
= 0x00000100;
106 pub const READ_CONTROL
: DWORD
= 0x00020000;
107 pub const SYNCHRONIZE
: DWORD
= 0x00100000;
108 pub const GENERIC_READ
: DWORD
= 0x80000000;
109 pub const GENERIC_WRITE
: DWORD
= 0x40000000;
110 pub const STANDARD_RIGHTS_WRITE
: DWORD
= READ_CONTROL
;
111 pub const FILE_GENERIC_WRITE
: DWORD
= STANDARD_RIGHTS_WRITE
| FILE_WRITE_DATA
|
112 FILE_WRITE_ATTRIBUTES
|
117 pub const FILE_FLAG_OPEN_REPARSE_POINT
: DWORD
= 0x00200000;
118 pub const FILE_FLAG_BACKUP_SEMANTICS
: DWORD
= 0x02000000;
119 pub const SECURITY_SQOS_PRESENT
: DWORD
= 0x00100000;
121 pub const FIONBIO
: c_ulong
= 0x8004667e;
125 pub struct WIN32_FIND_DATAW
{
126 pub dwFileAttributes
: DWORD
,
127 pub ftCreationTime
: FILETIME
,
128 pub ftLastAccessTime
: FILETIME
,
129 pub ftLastWriteTime
: FILETIME
,
130 pub nFileSizeHigh
: DWORD
,
131 pub nFileSizeLow
: DWORD
,
132 pub dwReserved0
: DWORD
,
133 pub dwReserved1
: DWORD
,
134 pub cFileName
: [wchar_t
; 260], // #define MAX_PATH 260
135 pub cAlternateFileName
: [wchar_t
; 14],
137 impl Clone
for WIN32_FIND_DATAW
{
138 fn clone(&self) -> Self { *self }
141 pub const WSA_FLAG_OVERLAPPED
: DWORD
= 0x01;
143 pub const WSADESCRIPTION_LEN
: usize = 256;
144 pub const WSASYS_STATUS_LEN
: usize = 128;
145 pub const WSAPROTOCOL_LEN
: DWORD
= 255;
146 pub const INVALID_SOCKET
: SOCKET
= !0;
148 pub const WSAEACCES
: c_int
= 10013;
149 pub const WSAEINVAL
: c_int
= 10022;
150 pub const WSAEWOULDBLOCK
: c_int
= 10035;
151 pub const WSAEADDRINUSE
: c_int
= 10048;
152 pub const WSAEADDRNOTAVAIL
: c_int
= 10049;
153 pub const WSAECONNABORTED
: c_int
= 10053;
154 pub const WSAECONNRESET
: c_int
= 10054;
155 pub const WSAENOTCONN
: c_int
= 10057;
156 pub const WSAESHUTDOWN
: c_int
= 10058;
157 pub const WSAETIMEDOUT
: c_int
= 10060;
158 pub const WSAECONNREFUSED
: c_int
= 10061;
160 pub const MAX_PROTOCOL_CHAIN
: DWORD
= 7;
162 pub const TOKEN_READ
: DWORD
= 0x20008;
163 pub const MAXIMUM_REPARSE_DATA_BUFFER_SIZE
: usize = 16 * 1024;
164 pub const FSCTL_GET_REPARSE_POINT
: DWORD
= 0x900a8;
165 pub const IO_REPARSE_TAG_SYMLINK
: DWORD
= 0xa000000c;
166 pub const IO_REPARSE_TAG_MOUNT_POINT
: DWORD
= 0xa0000003;
167 pub const SYMLINK_FLAG_RELATIVE
: DWORD
= 0x00000001;
168 pub const FSCTL_SET_REPARSE_POINT
: DWORD
= 0x900a4;
170 pub const SYMBOLIC_LINK_FLAG_DIRECTORY
: DWORD
= 0x1;
171 pub const SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE
: DWORD
= 0x2;
173 // Note that these are not actually HANDLEs, just values to pass to GetStdHandle
174 pub const STD_INPUT_HANDLE
: DWORD
= -10i32 as DWORD
;
175 pub const STD_OUTPUT_HANDLE
: DWORD
= -11i32 as DWORD
;
176 pub const STD_ERROR_HANDLE
: DWORD
= -12i32 as DWORD
;
178 pub const HANDLE_FLAG_INHERIT
: DWORD
= 0x00000001;
180 pub const PROGRESS_CONTINUE
: DWORD
= 0;
182 pub const ERROR_FILE_NOT_FOUND
: DWORD
= 2;
183 pub const ERROR_PATH_NOT_FOUND
: DWORD
= 3;
184 pub const ERROR_ACCESS_DENIED
: DWORD
= 5;
185 pub const ERROR_INVALID_HANDLE
: DWORD
= 6;
186 pub const ERROR_NO_MORE_FILES
: DWORD
= 18;
187 pub const ERROR_HANDLE_EOF
: DWORD
= 38;
188 pub const ERROR_FILE_EXISTS
: DWORD
= 80;
189 pub const ERROR_INVALID_PARAMETER
: DWORD
= 87;
190 pub const ERROR_BROKEN_PIPE
: DWORD
= 109;
191 pub const ERROR_CALL_NOT_IMPLEMENTED
: DWORD
= 120;
192 pub const ERROR_INSUFFICIENT_BUFFER
: DWORD
= 122;
193 pub const ERROR_ALREADY_EXISTS
: DWORD
= 183;
194 pub const ERROR_NO_DATA
: DWORD
= 232;
195 pub const ERROR_ENVVAR_NOT_FOUND
: DWORD
= 203;
196 pub const ERROR_OPERATION_ABORTED
: DWORD
= 995;
197 pub const ERROR_IO_PENDING
: DWORD
= 997;
198 pub const ERROR_TIMEOUT
: DWORD
= 0x5B4;
200 pub const INVALID_HANDLE_VALUE
: HANDLE
= !0 as HANDLE
;
202 pub const FACILITY_NT_BIT
: DWORD
= 0x1000_0000;
204 pub const FORMAT_MESSAGE_FROM_SYSTEM
: DWORD
= 0x00001000;
205 pub const FORMAT_MESSAGE_FROM_HMODULE
: DWORD
= 0x00000800;
206 pub const FORMAT_MESSAGE_IGNORE_INSERTS
: DWORD
= 0x00000200;
208 pub const TLS_OUT_OF_INDEXES
: DWORD
= 0xFFFFFFFF;
210 pub const DLL_THREAD_DETACH
: DWORD
= 3;
211 pub const DLL_PROCESS_DETACH
: DWORD
= 0;
213 pub const INFINITE
: DWORD
= !0;
215 pub const DUPLICATE_SAME_ACCESS
: DWORD
= 0x00000002;
217 pub const CONDITION_VARIABLE_INIT
: CONDITION_VARIABLE
= CONDITION_VARIABLE
{
218 ptr
: ptr
::null_mut(),
220 pub const SRWLOCK_INIT
: SRWLOCK
= SRWLOCK { ptr: ptr::null_mut() }
;
222 pub const DETACHED_PROCESS
: DWORD
= 0x00000008;
223 pub const CREATE_NEW_PROCESS_GROUP
: DWORD
= 0x00000200;
224 pub const CREATE_UNICODE_ENVIRONMENT
: DWORD
= 0x00000400;
225 pub const STARTF_USESTDHANDLES
: DWORD
= 0x00000100;
227 pub const AF_INET
: c_int
= 2;
228 pub const AF_INET6
: c_int
= 23;
229 pub const SD_BOTH
: c_int
= 2;
230 pub const SD_RECEIVE
: c_int
= 0;
231 pub const SD_SEND
: c_int
= 1;
232 pub const SOCK_DGRAM
: c_int
= 2;
233 pub const SOCK_STREAM
: c_int
= 1;
234 pub const SOL_SOCKET
: c_int
= 0xffff;
235 pub const SO_RCVTIMEO
: c_int
= 0x1006;
236 pub const SO_SNDTIMEO
: c_int
= 0x1005;
237 pub const SO_REUSEADDR
: c_int
= 0x0004;
238 pub const IPPROTO_IP
: c_int
= 0;
239 pub const IPPROTO_TCP
: c_int
= 6;
240 pub const IPPROTO_IPV6
: c_int
= 41;
241 pub const TCP_NODELAY
: c_int
= 0x0001;
242 pub const IP_TTL
: c_int
= 4;
243 pub const IPV6_V6ONLY
: c_int
= 27;
244 pub const SO_ERROR
: c_int
= 0x1007;
245 pub const SO_BROADCAST
: c_int
= 0x0020;
246 pub const IP_MULTICAST_LOOP
: c_int
= 11;
247 pub const IPV6_MULTICAST_LOOP
: c_int
= 11;
248 pub const IP_MULTICAST_TTL
: c_int
= 10;
249 pub const IP_ADD_MEMBERSHIP
: c_int
= 12;
250 pub const IP_DROP_MEMBERSHIP
: c_int
= 13;
251 pub const IPV6_ADD_MEMBERSHIP
: c_int
= 12;
252 pub const IPV6_DROP_MEMBERSHIP
: c_int
= 13;
253 pub const MSG_PEEK
: c_int
= 0x2;
257 pub imr_multiaddr
: in_addr
,
258 pub imr_interface
: in_addr
,
262 pub struct ipv6_mreq
{
263 pub ipv6mr_multiaddr
: in6_addr
,
264 pub ipv6mr_interface
: c_uint
,
267 pub const VOLUME_NAME_DOS
: DWORD
= 0x0;
268 pub const MOVEFILE_REPLACE_EXISTING
: DWORD
= 1;
270 pub const FILE_BEGIN
: DWORD
= 0;
271 pub const FILE_CURRENT
: DWORD
= 1;
272 pub const FILE_END
: DWORD
= 2;
274 pub const WAIT_OBJECT_0
: DWORD
= 0x00000000;
275 pub const WAIT_TIMEOUT
: DWORD
= 258;
276 pub const WAIT_FAILED
: DWORD
= 0xFFFFFFFF;
278 #[cfg(target_env = "msvc")]
279 pub const MAX_SYM_NAME
: usize = 2000;
280 #[cfg(target_arch = "x86")]
281 pub const IMAGE_FILE_MACHINE_I386
: DWORD
= 0x014c;
282 #[cfg(target_arch = "x86_64")]
283 pub const IMAGE_FILE_MACHINE_AMD64
: DWORD
= 0x8664;
285 pub const PROV_RSA_FULL
: DWORD
= 1;
286 pub const CRYPT_SILENT
: DWORD
= 64;
287 pub const CRYPT_VERIFYCONTEXT
: DWORD
= 0xF0000000;
289 pub const EXCEPTION_CONTINUE_SEARCH
: LONG
= 0;
290 pub const EXCEPTION_STACK_OVERFLOW
: DWORD
= 0xc00000fd;
291 pub const EXCEPTION_MAXIMUM_PARAMETERS
: usize = 15;
293 pub const PIPE_ACCESS_INBOUND
: DWORD
= 0x00000001;
294 pub const PIPE_ACCESS_OUTBOUND
: DWORD
= 0x00000002;
295 pub const FILE_FLAG_FIRST_PIPE_INSTANCE
: DWORD
= 0x00080000;
296 pub const FILE_FLAG_OVERLAPPED
: DWORD
= 0x40000000;
297 pub const PIPE_WAIT
: DWORD
= 0x00000000;
298 pub const PIPE_TYPE_BYTE
: DWORD
= 0x00000000;
299 pub const PIPE_REJECT_REMOTE_CLIENTS
: DWORD
= 0x00000008;
300 pub const PIPE_READMODE_BYTE
: DWORD
= 0x00000000;
302 pub const FD_SETSIZE
: usize = 64;
305 #[cfg(not(target_pointer_width = "64"))]
308 pub wHighVersion
: WORD
,
309 pub szDescription
: [u8; WSADESCRIPTION_LEN
+ 1],
310 pub szSystemStatus
: [u8; WSASYS_STATUS_LEN
+ 1],
311 pub iMaxSockets
: u16,
313 pub lpVendorInfo
: *mut u8,
316 #[cfg(target_pointer_width = "64")]
319 pub wHighVersion
: WORD
,
320 pub iMaxSockets
: u16,
322 pub lpVendorInfo
: *mut u8,
323 pub szDescription
: [u8; WSADESCRIPTION_LEN
+ 1],
324 pub szSystemStatus
: [u8; WSASYS_STATUS_LEN
+ 1],
328 pub struct WSAPROTOCOL_INFO
{
329 pub dwServiceFlags1
: DWORD
,
330 pub dwServiceFlags2
: DWORD
,
331 pub dwServiceFlags3
: DWORD
,
332 pub dwServiceFlags4
: DWORD
,
333 pub dwProviderFlags
: DWORD
,
334 pub ProviderId
: GUID
,
335 pub dwCatalogEntryId
: DWORD
,
336 pub ProtocolChain
: WSAPROTOCOLCHAIN
,
338 pub iAddressFamily
: c_int
,
339 pub iMaxSockAddr
: c_int
,
340 pub iMinSockAddr
: c_int
,
341 pub iSocketType
: c_int
,
342 pub iProtocol
: c_int
,
343 pub iProtocolMaxOffset
: c_int
,
344 pub iNetworkByteOrder
: c_int
,
345 pub iSecurityScheme
: c_int
,
346 pub dwMessageSize
: DWORD
,
347 pub dwProviderReserved
: DWORD
,
348 pub szProtocol
: [u16; (WSAPROTOCOL_LEN
as usize) + 1],
352 #[derive(Copy, Clone)]
353 pub struct WIN32_FILE_ATTRIBUTE_DATA
{
354 pub dwFileAttributes
: DWORD
,
355 pub ftCreationTime
: FILETIME
,
356 pub ftLastAccessTime
: FILETIME
,
357 pub ftLastWriteTime
: FILETIME
,
358 pub nFileSizeHigh
: DWORD
,
359 pub nFileSizeLow
: DWORD
,
363 pub struct BY_HANDLE_FILE_INFORMATION
{
364 pub dwFileAttributes
: DWORD
,
365 pub ftCreationTime
: FILETIME
,
366 pub ftLastAccessTime
: FILETIME
,
367 pub ftLastWriteTime
: FILETIME
,
368 pub dwVolumeSerialNumber
: DWORD
,
369 pub nFileSizeHigh
: DWORD
,
370 pub nFileSizeLow
: DWORD
,
371 pub nNumberOfLinks
: DWORD
,
372 pub nFileIndexHigh
: DWORD
,
373 pub nFileIndexLow
: DWORD
,
377 #[allow(dead_code)] // we only use some variants
378 pub enum FILE_INFO_BY_HANDLE_CLASS
{
380 FileStandardInfo
= 1,
383 FileDispositionInfo
= 4,
384 FileAllocationInfo
= 5,
385 FileEndOfFileInfo
= 6,
387 FileCompressionInfo
= 8,
388 FileAttributeTagInfo
= 9,
389 FileIdBothDirectoryInfo
= 10, // 0xA
390 FileIdBothDirectoryRestartInfo
= 11, // 0xB
391 FileIoPriorityHintInfo
= 12, // 0xC
392 FileRemoteProtocolInfo
= 13, // 0xD
393 FileFullDirectoryInfo
= 14, // 0xE
394 FileFullDirectoryRestartInfo
= 15, // 0xF
395 FileStorageInfo
= 16, // 0x10
396 FileAlignmentInfo
= 17, // 0x11
397 FileIdInfo
= 18, // 0x12
398 FileIdExtdDirectoryInfo
= 19, // 0x13
399 FileIdExtdDirectoryRestartInfo
= 20, // 0x14
400 MaximumFileInfoByHandlesClass
404 pub struct FILE_BASIC_INFO
{
405 pub CreationTime
: LARGE_INTEGER
,
406 pub LastAccessTime
: LARGE_INTEGER
,
407 pub LastWriteTime
: LARGE_INTEGER
,
408 pub ChangeTime
: LARGE_INTEGER
,
409 pub FileAttributes
: DWORD
,
413 pub struct FILE_END_OF_FILE_INFO
{
414 pub EndOfFile
: LARGE_INTEGER
,
418 pub struct REPARSE_DATA_BUFFER
{
419 pub ReparseTag
: c_uint
,
420 pub ReparseDataLength
: c_ushort
,
421 pub Reserved
: c_ushort
,
426 pub struct SYMBOLIC_LINK_REPARSE_BUFFER
{
427 pub SubstituteNameOffset
: c_ushort
,
428 pub SubstituteNameLength
: c_ushort
,
429 pub PrintNameOffset
: c_ushort
,
430 pub PrintNameLength
: c_ushort
,
432 pub PathBuffer
: WCHAR
,
436 pub struct MOUNT_POINT_REPARSE_BUFFER
{
437 pub SubstituteNameOffset
: c_ushort
,
438 pub SubstituteNameLength
: c_ushort
,
439 pub PrintNameOffset
: c_ushort
,
440 pub PrintNameLength
: c_ushort
,
441 pub PathBuffer
: WCHAR
,
444 pub type LPPROGRESS_ROUTINE
= ::option
::Option
<unsafe extern "system" fn(
445 TotalFileSize
: LARGE_INTEGER
,
446 TotalBytesTransferred
: LARGE_INTEGER
,
447 StreamSize
: LARGE_INTEGER
,
448 StreamBytesTransferred
: LARGE_INTEGER
,
449 dwStreamNumber
: DWORD
,
450 dwCallbackReason
: DWORD
,
452 hDestinationFile
: HANDLE
,
457 pub struct CONDITION_VARIABLE { pub ptr: LPVOID }
459 pub struct SRWLOCK { pub ptr: LPVOID }
461 pub struct CRITICAL_SECTION
{
462 CriticalSectionDebug
: LPVOID
,
464 RecursionCount
: LONG
,
465 OwningThread
: HANDLE
,
466 LockSemaphore
: HANDLE
,
471 pub struct REPARSE_MOUNTPOINT_DATA_BUFFER
{
472 pub ReparseTag
: DWORD
,
473 pub ReparseDataLength
: DWORD
,
475 pub ReparseTargetLength
: WORD
,
476 pub ReparseTargetMaximumLength
: WORD
,
478 pub ReparseTarget
: WCHAR
,
482 pub struct EXCEPTION_RECORD
{
483 pub ExceptionCode
: DWORD
,
484 pub ExceptionFlags
: DWORD
,
485 pub ExceptionRecord
: *mut EXCEPTION_RECORD
,
486 pub ExceptionAddress
: LPVOID
,
487 pub NumberParameters
: DWORD
,
488 pub ExceptionInformation
: [LPVOID
; EXCEPTION_MAXIMUM_PARAMETERS
]
492 pub struct EXCEPTION_POINTERS
{
493 pub ExceptionRecord
: *mut EXCEPTION_RECORD
,
494 pub ContextRecord
: *mut CONTEXT
,
497 pub type PVECTORED_EXCEPTION_HANDLER
= extern "system"
498 fn(ExceptionInfo
: *mut EXCEPTION_POINTERS
) -> LONG
;
505 pub Data4
: [BYTE
; 8],
509 pub struct WSAPROTOCOLCHAIN
{
511 pub ChainEntries
: [DWORD
; MAX_PROTOCOL_CHAIN
as usize],
515 pub struct SECURITY_ATTRIBUTES
{
517 pub lpSecurityDescriptor
: LPVOID
,
518 pub bInheritHandle
: BOOL
,
522 pub struct PROCESS_INFORMATION
{
523 pub hProcess
: HANDLE
,
525 pub dwProcessId
: DWORD
,
526 pub dwThreadId
: DWORD
,
530 pub struct STARTUPINFO
{
532 pub lpReserved
: LPWSTR
,
533 pub lpDesktop
: LPWSTR
,
539 pub dwXCountChars
: DWORD
,
540 pub dwYCountCharts
: DWORD
,
541 pub dwFillAttribute
: DWORD
,
543 pub wShowWindow
: WORD
,
544 pub cbReserved2
: WORD
,
545 pub lpReserved2
: LPBYTE
,
546 pub hStdInput
: HANDLE
,
547 pub hStdOutput
: HANDLE
,
548 pub hStdError
: HANDLE
,
552 pub struct SOCKADDR
{
553 pub sa_family
: ADDRESS_FAMILY
,
554 pub sa_data
: [CHAR
; 14],
558 #[derive(Copy, Clone)]
559 pub struct FILETIME
{
560 pub dwLowDateTime
: DWORD
,
561 pub dwHighDateTime
: DWORD
,
565 pub struct OVERLAPPED
{
566 pub Internal
: *mut c_ulong
,
567 pub InternalHigh
: *mut c_ulong
,
569 pub OffsetHigh
: DWORD
,
574 #[cfg(target_env = "msvc")]
575 pub struct SYMBOL_INFO
{
576 pub SizeOfStruct
: c_ulong
,
577 pub TypeIndex
: c_ulong
,
578 pub Reserved
: [u64; 2],
585 pub Register
: c_ulong
,
588 pub NameLen
: c_ulong
,
589 pub MaxNameLen
: c_ulong
,
590 // note that windows has this as 1, but it basically just means that
591 // the name is inline at the end of the struct. For us, we just bump
592 // the struct size up to MAX_SYM_NAME.
593 pub Name
: [c_char
; MAX_SYM_NAME
],
597 #[cfg(target_env = "msvc")]
598 pub struct IMAGEHLP_LINE64
{
599 pub SizeOfStruct
: u32,
600 pub Key
: *const c_void
,
602 pub Filename
: *const c_char
,
607 #[allow(dead_code)] // we only use some variants
608 pub enum ADDRESS_MODE
{
616 pub struct ADDRESS64
{
619 pub Mode
: ADDRESS_MODE
,
623 pub struct STACKFRAME64
{
624 pub AddrPC
: ADDRESS64
,
625 pub AddrReturn
: ADDRESS64
,
626 pub AddrFrame
: ADDRESS64
,
627 pub AddrStack
: ADDRESS64
,
628 pub AddrBStore
: ADDRESS64
,
629 pub FuncTableEntry
: *mut c_void
,
630 pub Params
: [u64; 4],
633 pub Reserved
: [u64; 3],
634 pub KdHelp
: KDHELP64
,
638 pub struct KDHELP64
{
640 pub ThCallbackStack
: DWORD
,
641 pub ThCallbackBStore
: DWORD
,
642 pub NextCallback
: DWORD
,
643 pub FramePointer
: DWORD
,
644 pub KiCallUserMode
: u64,
645 pub KeUserCallbackDispatcher
: u64,
646 pub SystemRangeStart
: u64,
647 pub KiUserExceptionDispatcher
: u64,
650 pub Reserved
: [u64; 5],
653 #[cfg(target_arch = "x86")]
656 pub ContextFlags
: DWORD
,
663 pub FloatSave
: FLOATING_SAVE_AREA
,
680 pub ExtendedRegisters
: [u8; 512],
683 #[cfg(target_arch = "x86")]
685 pub struct FLOATING_SAVE_AREA
{
686 pub ControlWord
: DWORD
,
687 pub StatusWord
: DWORD
,
689 pub ErrorOffset
: DWORD
,
690 pub ErrorSelector
: DWORD
,
691 pub DataOffset
: DWORD
,
692 pub DataSelector
: DWORD
,
693 pub RegisterArea
: [u8; 80],
694 pub Cr0NpxState
: DWORD
,
697 #[cfg(target_arch = "x86_64")]
700 _align_hack
: [u64x2
; 0], // FIXME align on 16-byte
701 pub P1Home
: DWORDLONG
,
702 pub P2Home
: DWORDLONG
,
703 pub P3Home
: DWORDLONG
,
704 pub P4Home
: DWORDLONG
,
705 pub P5Home
: DWORDLONG
,
706 pub P6Home
: DWORDLONG
,
708 pub ContextFlags
: DWORD
,
745 pub FltSave
: FLOATING_SAVE_AREA
,
747 pub VectorRegister
: [M128A
; 26],
748 pub VectorControl
: DWORDLONG
,
750 pub DebugControl
: DWORDLONG
,
751 pub LastBranchToRip
: DWORDLONG
,
752 pub LastBranchFromRip
: DWORDLONG
,
753 pub LastExceptionToRip
: DWORDLONG
,
754 pub LastExceptionFromRip
: DWORDLONG
,
757 #[cfg(target_arch = "x86_64")]
760 _align_hack
: [u64x2
; 0], // FIXME align on 16-byte
761 pub Low
: c_ulonglong
,
765 #[cfg(target_arch = "x86_64")]
767 pub struct FLOATING_SAVE_AREA
{
768 _align_hack
: [u64x2
; 0], // FIXME align on 16-byte
769 _Dummy
: [u8; 512] // FIXME: Fill this out
772 // FIXME(#43348): This structure is used for backtrace only, and a fake
773 // definition is provided here only to allow rustdoc to pass type-check. This
774 // will not appear in the final documentation. This should be also defined for
775 // other architectures supported by Windows such as ARM, and for historical
776 // interest, maybe MIPS and PowerPC as well.
777 #[cfg(all(dox, not(any(target_arch = "x86_64", target_arch = "x86"))))]
781 pub struct SOCKADDR_STORAGE_LH
{
782 pub ss_family
: ADDRESS_FAMILY
,
783 pub __ss_pad1
: [CHAR
; 6],
785 pub __ss_pad2
: [CHAR
; 112],
789 pub struct ADDRINFOA
{
791 pub ai_family
: c_int
,
792 pub ai_socktype
: c_int
,
793 pub ai_protocol
: c_int
,
794 pub ai_addrlen
: size_t
,
795 pub ai_canonname
: *mut c_char
,
796 pub ai_addr
: *mut SOCKADDR
,
797 pub ai_next
: *mut ADDRINFOA
,
801 #[derive(Copy, Clone)]
802 pub struct sockaddr_in
{
803 pub sin_family
: ADDRESS_FAMILY
,
804 pub sin_port
: USHORT
,
805 pub sin_addr
: in_addr
,
806 pub sin_zero
: [CHAR
; 8],
810 #[derive(Copy, Clone)]
811 pub struct sockaddr_in6
{
812 pub sin6_family
: ADDRESS_FAMILY
,
813 pub sin6_port
: USHORT
,
814 pub sin6_flowinfo
: c_ulong
,
815 pub sin6_addr
: in6_addr
,
816 pub sin6_scope_id
: c_ulong
,
820 #[derive(Copy, Clone)]
826 #[derive(Copy, Clone)]
827 pub struct in6_addr
{
828 pub s6_addr
: [u8; 16],
832 #[derive(Copy, Clone)]
833 #[allow(dead_code)] // we only use some variants
834 pub enum EXCEPTION_DISPOSITION
{
835 ExceptionContinueExecution
,
836 ExceptionContinueSearch
,
837 ExceptionNestedException
,
838 ExceptionCollidedUnwind
842 #[derive(Copy, Clone)]
843 pub struct CONSOLE_READCONSOLE_CONTROL
{
845 pub nInitialChars
: ULONG
,
846 pub dwCtrlWakeupMask
: ULONG
,
847 pub dwControlKeyState
: ULONG
,
849 pub type PCONSOLE_READCONSOLE_CONTROL
= *mut CONSOLE_READCONSOLE_CONTROL
;
854 pub fd_count
: c_uint
,
855 pub fd_array
: [SOCKET
; FD_SETSIZE
],
858 impl Clone
for fd_set
{
859 fn clone(&self) -> fd_set
{
865 #[derive(Copy, Clone)]
872 pub fn WSAStartup(wVersionRequested
: WORD
,
873 lpWSAData
: LPWSADATA
) -> c_int
;
874 pub fn WSACleanup() -> c_int
;
875 pub fn WSAGetLastError() -> c_int
;
876 pub fn WSADuplicateSocketW(s
: SOCKET
,
878 lpProtocolInfo
: LPWSAPROTOCOL_INFO
)
880 pub fn GetCurrentProcessId() -> DWORD
;
881 pub fn WSASocketW(af
: c_int
,
884 lpProtocolInfo
: LPWSAPROTOCOL_INFO
,
886 dwFlags
: DWORD
) -> SOCKET
;
887 pub fn ioctlsocket(s
: SOCKET
, cmd
: c_long
, argp
: *mut c_ulong
) -> c_int
;
888 pub fn InitializeCriticalSection(CriticalSection
: *mut CRITICAL_SECTION
);
889 pub fn EnterCriticalSection(CriticalSection
: *mut CRITICAL_SECTION
);
890 pub fn TryEnterCriticalSection(CriticalSection
: *mut CRITICAL_SECTION
) -> BOOLEAN
;
891 pub fn LeaveCriticalSection(CriticalSection
: *mut CRITICAL_SECTION
);
892 pub fn DeleteCriticalSection(CriticalSection
: *mut CRITICAL_SECTION
);
894 pub fn ReadConsoleW(hConsoleInput
: HANDLE
,
896 nNumberOfCharsToRead
: DWORD
,
897 lpNumberOfCharsRead
: LPDWORD
,
898 pInputControl
: PCONSOLE_READCONSOLE_CONTROL
) -> BOOL
;
900 pub fn WriteConsoleW(hConsoleOutput
: HANDLE
,
902 nNumberOfCharsToWrite
: DWORD
,
903 lpNumberOfCharsWritten
: LPDWORD
,
904 lpReserved
: LPVOID
) -> BOOL
;
906 pub fn GetConsoleMode(hConsoleHandle
: HANDLE
,
907 lpMode
: LPDWORD
) -> BOOL
;
908 pub fn RemoveDirectoryW(lpPathName
: LPCWSTR
) -> BOOL
;
909 pub fn SetFileAttributesW(lpFileName
: LPCWSTR
,
910 dwFileAttributes
: DWORD
) -> BOOL
;
911 pub fn GetFileInformationByHandle(hFile
: HANDLE
,
912 lpFileInformation
: LPBY_HANDLE_FILE_INFORMATION
)
915 pub fn SetLastError(dwErrCode
: DWORD
);
916 pub fn GetCommandLineW() -> *mut LPCWSTR
;
917 pub fn LocalFree(ptr
: *mut c_void
);
918 pub fn CommandLineToArgvW(lpCmdLine
: *mut LPCWSTR
,
919 pNumArgs
: *mut c_int
) -> *mut *mut u16;
920 pub fn GetTempPathW(nBufferLength
: DWORD
,
921 lpBuffer
: LPCWSTR
) -> DWORD
;
922 pub fn OpenProcessToken(ProcessHandle
: HANDLE
,
923 DesiredAccess
: DWORD
,
924 TokenHandle
: *mut HANDLE
) -> BOOL
;
925 pub fn GetCurrentProcess() -> HANDLE
;
926 pub fn GetCurrentThread() -> HANDLE
;
927 pub fn GetStdHandle(which
: DWORD
) -> HANDLE
;
928 pub fn ExitProcess(uExitCode
: c_uint
) -> !;
929 pub fn DeviceIoControl(hDevice
: HANDLE
,
930 dwIoControlCode
: DWORD
,
932 nInBufferSize
: DWORD
,
934 nOutBufferSize
: DWORD
,
935 lpBytesReturned
: LPDWORD
,
936 lpOverlapped
: LPOVERLAPPED
) -> BOOL
;
937 pub fn CreateThread(lpThreadAttributes
: LPSECURITY_ATTRIBUTES
,
939 lpStartAddress
: extern "system" fn(*mut c_void
)
942 dwCreationFlags
: DWORD
,
943 lpThreadId
: LPDWORD
) -> HANDLE
;
944 pub fn WaitForSingleObject(hHandle
: HANDLE
,
945 dwMilliseconds
: DWORD
) -> DWORD
;
946 pub fn SwitchToThread() -> BOOL
;
947 pub fn Sleep(dwMilliseconds
: DWORD
);
948 pub fn GetProcessId(handle
: HANDLE
) -> DWORD
;
949 pub fn GetUserProfileDirectoryW(hToken
: HANDLE
,
950 lpProfileDir
: LPWSTR
,
951 lpcchSize
: *mut DWORD
) -> BOOL
;
952 pub fn SetHandleInformation(hObject
: HANDLE
,
954 dwFlags
: DWORD
) -> BOOL
;
955 pub fn CopyFileExW(lpExistingFileName
: LPCWSTR
,
956 lpNewFileName
: LPCWSTR
,
957 lpProgressRoutine
: LPPROGRESS_ROUTINE
,
960 dwCopyFlags
: DWORD
) -> BOOL
;
961 pub fn AddVectoredExceptionHandler(FirstHandler
: ULONG
,
962 VectoredHandler
: PVECTORED_EXCEPTION_HANDLER
)
964 pub fn FormatMessageW(flags
: DWORD
,
972 pub fn TlsAlloc() -> DWORD
;
973 pub fn TlsGetValue(dwTlsIndex
: DWORD
) -> LPVOID
;
974 pub fn TlsSetValue(dwTlsIndex
: DWORD
, lpTlsvalue
: LPVOID
) -> BOOL
;
975 pub fn GetLastError() -> DWORD
;
976 pub fn QueryPerformanceFrequency(lpFrequency
: *mut LARGE_INTEGER
) -> BOOL
;
977 pub fn QueryPerformanceCounter(lpPerformanceCount
: *mut LARGE_INTEGER
)
979 pub fn GetExitCodeProcess(hProcess
: HANDLE
, lpExitCode
: LPDWORD
) -> BOOL
;
980 pub fn TerminateProcess(hProcess
: HANDLE
, uExitCode
: UINT
) -> BOOL
;
981 pub fn CreateProcessW(lpApplicationName
: LPCWSTR
,
982 lpCommandLine
: LPWSTR
,
983 lpProcessAttributes
: LPSECURITY_ATTRIBUTES
,
984 lpThreadAttributes
: LPSECURITY_ATTRIBUTES
,
985 bInheritHandles
: BOOL
,
986 dwCreationFlags
: DWORD
,
987 lpEnvironment
: LPVOID
,
988 lpCurrentDirectory
: LPCWSTR
,
989 lpStartupInfo
: LPSTARTUPINFO
,
990 lpProcessInformation
: LPPROCESS_INFORMATION
)
992 pub fn GetEnvironmentVariableW(n
: LPCWSTR
, v
: LPWSTR
, nsize
: DWORD
) -> DWORD
;
993 pub fn SetEnvironmentVariableW(n
: LPCWSTR
, v
: LPCWSTR
) -> BOOL
;
994 pub fn GetEnvironmentStringsW() -> LPWCH
;
995 pub fn FreeEnvironmentStringsW(env_ptr
: LPWCH
) -> BOOL
;
996 pub fn GetModuleFileNameW(hModule
: HMODULE
,
1000 pub fn CreateDirectoryW(lpPathName
: LPCWSTR
,
1001 lpSecurityAttributes
: LPSECURITY_ATTRIBUTES
)
1003 pub fn DeleteFileW(lpPathName
: LPCWSTR
) -> BOOL
;
1004 pub fn GetCurrentDirectoryW(nBufferLength
: DWORD
, lpBuffer
: LPWSTR
) -> DWORD
;
1005 pub fn SetCurrentDirectoryW(lpPathName
: LPCWSTR
) -> BOOL
;
1006 pub fn WideCharToMultiByte(CodePage
: UINT
,
1008 lpWideCharStr
: LPCWSTR
,
1010 lpMultiByteStr
: LPSTR
,
1012 lpDefaultChar
: LPCSTR
,
1013 lpUsedDefaultChar
: LPBOOL
) -> c_int
;
1015 pub fn closesocket(socket
: SOCKET
) -> c_int
;
1016 pub fn recv(socket
: SOCKET
, buf
: *mut c_void
, len
: c_int
,
1017 flags
: c_int
) -> c_int
;
1018 pub fn send(socket
: SOCKET
, buf
: *const c_void
, len
: c_int
,
1019 flags
: c_int
) -> c_int
;
1020 pub fn recvfrom(socket
: SOCKET
,
1024 addr
: *mut SOCKADDR
,
1025 addrlen
: *mut c_int
)
1027 pub fn sendto(socket
: SOCKET
,
1031 addr
: *const SOCKADDR
,
1034 pub fn shutdown(socket
: SOCKET
, how
: c_int
) -> c_int
;
1035 pub fn accept(socket
: SOCKET
,
1036 address
: *mut SOCKADDR
,
1037 address_len
: *mut c_int
)
1039 pub fn DuplicateHandle(hSourceProcessHandle
: HANDLE
,
1040 hSourceHandle
: HANDLE
,
1041 hTargetProcessHandle
: HANDLE
,
1042 lpTargetHandle
: LPHANDLE
,
1043 dwDesiredAccess
: DWORD
,
1044 bInheritHandle
: BOOL
,
1047 pub fn ReadFile(hFile
: HANDLE
,
1049 nNumberOfBytesToRead
: DWORD
,
1050 lpNumberOfBytesRead
: LPDWORD
,
1051 lpOverlapped
: LPOVERLAPPED
)
1053 pub fn WriteFile(hFile
: HANDLE
,
1055 nNumberOfBytesToWrite
: DWORD
,
1056 lpNumberOfBytesWritten
: LPDWORD
,
1057 lpOverlapped
: LPOVERLAPPED
)
1059 pub fn CloseHandle(hObject
: HANDLE
) -> BOOL
;
1060 pub fn CreateHardLinkW(lpSymlinkFileName
: LPCWSTR
,
1061 lpTargetFileName
: LPCWSTR
,
1062 lpSecurityAttributes
: LPSECURITY_ATTRIBUTES
)
1064 pub fn MoveFileExW(lpExistingFileName
: LPCWSTR
,
1065 lpNewFileName
: LPCWSTR
,
1068 pub fn SetFilePointerEx(hFile
: HANDLE
,
1069 liDistanceToMove
: LARGE_INTEGER
,
1070 lpNewFilePointer
: PLARGE_INTEGER
,
1071 dwMoveMethod
: DWORD
)
1073 pub fn FlushFileBuffers(hFile
: HANDLE
) -> BOOL
;
1074 pub fn CreateFileW(lpFileName
: LPCWSTR
,
1075 dwDesiredAccess
: DWORD
,
1077 lpSecurityAttributes
: LPSECURITY_ATTRIBUTES
,
1078 dwCreationDisposition
: DWORD
,
1079 dwFlagsAndAttributes
: DWORD
,
1080 hTemplateFile
: HANDLE
)
1083 pub fn FindFirstFileW(fileName
: LPCWSTR
,
1084 findFileData
: LPWIN32_FIND_DATAW
)
1086 pub fn FindNextFileW(findFile
: HANDLE
, findFileData
: LPWIN32_FIND_DATAW
)
1088 pub fn FindClose(findFile
: HANDLE
) -> BOOL
;
1089 pub fn RtlCaptureContext(ctx
: *mut CONTEXT
);
1090 pub fn getsockopt(s
: SOCKET
,
1093 optval
: *mut c_char
,
1096 pub fn setsockopt(s
: SOCKET
,
1099 optval
: *const c_void
,
1102 pub fn getsockname(socket
: SOCKET
,
1103 address
: *mut SOCKADDR
,
1104 address_len
: *mut c_int
)
1106 pub fn getpeername(socket
: SOCKET
,
1107 address
: *mut SOCKADDR
,
1108 address_len
: *mut c_int
)
1110 pub fn bind(socket
: SOCKET
, address
: *const SOCKADDR
,
1111 address_len
: socklen_t
) -> c_int
;
1112 pub fn listen(socket
: SOCKET
, backlog
: c_int
) -> c_int
;
1113 pub fn connect(socket
: SOCKET
, address
: *const SOCKADDR
, len
: c_int
)
1115 pub fn getaddrinfo(node
: *const c_char
, service
: *const c_char
,
1116 hints
: *const ADDRINFOA
,
1117 res
: *mut *mut ADDRINFOA
) -> c_int
;
1118 pub fn freeaddrinfo(res
: *mut ADDRINFOA
);
1120 pub fn LoadLibraryW(name
: LPCWSTR
) -> HMODULE
;
1121 pub fn FreeLibrary(handle
: HMODULE
) -> BOOL
;
1122 pub fn GetProcAddress(handle
: HMODULE
,
1123 name
: LPCSTR
) -> *mut c_void
;
1124 pub fn GetModuleHandleW(lpModuleName
: LPCWSTR
) -> HMODULE
;
1125 pub fn CryptAcquireContextA(phProv
: *mut HCRYPTPROV
,
1126 pszContainer
: LPCSTR
,
1127 pszProvider
: LPCSTR
,
1129 dwFlags
: DWORD
) -> BOOL
;
1130 pub fn CryptGenRandom(hProv
: HCRYPTPROV
,
1132 pbBuffer
: *mut BYTE
) -> BOOL
;
1133 pub fn CryptReleaseContext(hProv
: HCRYPTPROV
, dwFlags
: DWORD
) -> BOOL
;
1135 pub fn GetSystemTimeAsFileTime(lpSystemTimeAsFileTime
: LPFILETIME
);
1137 pub fn CreateEventW(lpEventAttributes
: LPSECURITY_ATTRIBUTES
,
1139 bInitialState
: BOOL
,
1140 lpName
: LPCWSTR
) -> HANDLE
;
1141 pub fn WaitForMultipleObjects(nCount
: DWORD
,
1142 lpHandles
: *const HANDLE
,
1144 dwMilliseconds
: DWORD
) -> DWORD
;
1145 pub fn CreateNamedPipeW(lpName
: LPCWSTR
,
1148 nMaxInstances
: DWORD
,
1149 nOutBufferSize
: DWORD
,
1150 nInBufferSize
: DWORD
,
1151 nDefaultTimeOut
: DWORD
,
1152 lpSecurityAttributes
: LPSECURITY_ATTRIBUTES
)
1154 pub fn CancelIo(handle
: HANDLE
) -> BOOL
;
1155 pub fn GetOverlappedResult(hFile
: HANDLE
,
1156 lpOverlapped
: LPOVERLAPPED
,
1157 lpNumberOfBytesTransferred
: LPDWORD
,
1158 bWait
: BOOL
) -> BOOL
;
1159 pub fn select(nfds
: c_int
,
1160 readfds
: *mut fd_set
,
1161 writefds
: *mut fd_set
,
1162 exceptfds
: *mut fd_set
,
1163 timeout
: *const timeval
) -> c_int
;
1166 // Functions that aren't available on Windows XP, but we still use them and just
1167 // provide some form of a fallback implementation.
1171 pub fn CreateSymbolicLinkW(_lpSymlinkFileName
: LPCWSTR
,
1172 _lpTargetFileName
: LPCWSTR
,
1173 _dwFlags
: DWORD
) -> BOOLEAN
{
1174 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
as DWORD
); 0
1176 pub fn GetFinalPathNameByHandleW(_hFile
: HANDLE
,
1177 _lpszFilePath
: LPCWSTR
,
1178 _cchFilePath
: DWORD
,
1179 _dwFlags
: DWORD
) -> DWORD
{
1180 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
as DWORD
); 0
1182 pub fn SetThreadStackGuarantee(_size
: *mut c_ulong
) -> BOOL
{
1183 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
as DWORD
); 0
1185 pub fn SetFileInformationByHandle(_hFile
: HANDLE
,
1186 _FileInformationClass
: FILE_INFO_BY_HANDLE_CLASS
,
1187 _lpFileInformation
: LPVOID
,
1188 _dwBufferSize
: DWORD
) -> BOOL
{
1189 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
as DWORD
); 0
1191 pub fn SleepConditionVariableSRW(ConditionVariable
: PCONDITION_VARIABLE
,
1193 dwMilliseconds
: DWORD
,
1194 Flags
: ULONG
) -> BOOL
{
1195 panic
!("condition variables not available")
1197 pub fn WakeConditionVariable(ConditionVariable
: PCONDITION_VARIABLE
)
1199 panic
!("condition variables not available")
1201 pub fn WakeAllConditionVariable(ConditionVariable
: PCONDITION_VARIABLE
)
1203 panic
!("condition variables not available")
1205 pub fn AcquireSRWLockExclusive(SRWLock
: PSRWLOCK
) -> () {
1206 panic
!("rwlocks not available")
1208 pub fn AcquireSRWLockShared(SRWLock
: PSRWLOCK
) -> () {
1209 panic
!("rwlocks not available")
1211 pub fn ReleaseSRWLockExclusive(SRWLock
: PSRWLOCK
) -> () {
1212 panic
!("rwlocks not available")
1214 pub fn ReleaseSRWLockShared(SRWLock
: PSRWLOCK
) -> () {
1215 panic
!("rwlocks not available")
1217 pub fn TryAcquireSRWLockExclusive(SRWLock
: PSRWLOCK
) -> BOOLEAN
{
1218 panic
!("rwlocks not available")
1220 pub fn TryAcquireSRWLockShared(SRWLock
: PSRWLOCK
) -> BOOLEAN
{
1221 panic
!("rwlocks not available")
1225 #[cfg(target_env = "gnu")]
1229 pub const PROCESS_QUERY_INFORMATION
: DWORD
= 0x0400;
1231 pub const CP_ACP
: UINT
= 0;
1233 pub const WC_NO_BEST_FIT_CHARS
: DWORD
= 0x00000400;
1236 pub fn OpenProcess(dwDesiredAccess
: DWORD
,
1237 bInheritHandle
: BOOL
,
1238 dwProcessId
: DWORD
) -> HANDLE
;
1244 pub fn QueryFullProcessImageNameW(_hProcess
: HANDLE
,
1247 _lpdwSize
: LPDWORD
) -> BOOL
{
1248 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
as DWORD
); 0
1253 #[cfg(target_env = "gnu")]
1254 pub use self::gnu
::*;