1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4 // All files in the project carrying such notice may not be copied, modified, or distributed
5 // except according to those terms.
6 //! This module defines the 32-Bit Windows Base APIs
7 use ctypes
::{c_char, c_int, c_long, c_void}
;
9 DWORD64
, DWORD_PTR
, LONG_PTR
, PDWORD64
, PDWORD_PTR
, PSIZE_T
, PULONG_PTR
, SIZE_T
, UINT_PTR
,
12 use shared
::guiddef
::GUID
;
13 use shared
::minwindef
::{
14 ATOM
, BOOL
, BYTE
, DWORD
, FARPROC
, FILETIME
, HFILE
, HGLOBAL
, HLOCAL
, HMODULE
, HRSRC
, LPBOOL
,
15 LPBYTE
, LPCVOID
, LPDWORD
, LPFILETIME
, LPVOID
, LPWORD
, PBOOL
, PDWORD
, PUCHAR
, PULONG
, PUSHORT
,
16 UCHAR
, UINT
, ULONG
, USHORT
, WORD
,
18 use shared
::windef
::HWND
;
19 use um
::cfgmgr32
::MAX_PROFILE_LEN
;
20 use um
::fileapi
::STREAM_INFO_LEVELS
;
21 use um
::libloaderapi
::{
22 ENUMRESLANGPROCA
, ENUMRESLANGPROCW
, ENUMRESNAMEPROCA
, ENUMRESTYPEPROCA
, ENUMRESTYPEPROCW
,
25 FILE_INFO_BY_HANDLE_CLASS
, FINDEX_INFO_LEVELS
, FINDEX_SEARCH_OPS
, GET_FILEEX_INFO_LEVELS
,
26 LPOVERLAPPED
, LPOVERLAPPED_COMPLETION_ROUTINE
, LPSECURITY_ATTRIBUTES
, PREASON_CONTEXT
,
28 use um
::processthreadsapi
::{
29 LPPROC_THREAD_ATTRIBUTE_LIST
, LPSTARTUPINFOA
, STARTUPINFOA
, STARTUPINFOW
,
32 BOOLEAN
, CHAR
, DWORDLONG
, EXECUTION_STATE
, FILE_ID_128
, HANDLE
, HRESULT
, INT
, LANGID
,
33 LARGE_INTEGER
, LATENCY_TIME
, LONG
, LPCCH
, LPCH
, LPCSTR
, LPCWSTR
, LPOSVERSIONINFOEXA
,
34 LPOSVERSIONINFOEXW
, LPSTR
, LPWSTR
, MAXLONG
, PBOOLEAN
, PCONTEXT
, PCWSTR
, PFIRMWARE_TYPE
,
35 PHANDLE
, PIO_COUNTERS
, PJOB_SET_ARRAY
, PLUID
, POWER_REQUEST_TYPE
, PPERFORMANCE_DATA
,
36 PPROCESSOR_NUMBER
, PQUOTA_LIMITS
, PRTL_UMS_SCHEDULER_ENTRY_POINT
,
37 PSECURE_MEMORY_CACHE_CALLBACK
, PSID
, PSID_NAME_USE
, PULONGLONG
, PVOID
, PWOW64_CONTEXT
,
38 PWOW64_LDT_ENTRY
, PWSTR
, RTL_UMS_THREAD_INFO_CLASS
, STATUS_ABANDONED_WAIT_0
, STATUS_USER_APC
,
39 STATUS_WAIT_0
, SecurityAnonymous
, SecurityDelegation
, SecurityIdentification
,
40 SecurityImpersonation
, THREAD_BASE_PRIORITY_IDLE
, THREAD_BASE_PRIORITY_LOWRT
,
41 THREAD_BASE_PRIORITY_MAX
, THREAD_BASE_PRIORITY_MIN
, ULARGE_INTEGER
, VOID
, WAITORTIMERCALLBACK
,
44 #[cfg(target_arch = "x86")]
45 use um
::winnt
::PLDT_ENTRY
;
46 use vc
::vadefs
::va_list
;
47 pub const FILE_BEGIN
: DWORD
= 0;
48 pub const FILE_CURRENT
: DWORD
= 1;
49 pub const FILE_END
: DWORD
= 2;
50 pub const WAIT_FAILED
: DWORD
= 0xFFFFFFFF;
51 pub const WAIT_OBJECT_0
: DWORD
= STATUS_WAIT_0
as u32;
52 pub const WAIT_ABANDONED
: DWORD
= STATUS_ABANDONED_WAIT_0
as u32;
53 pub const WAIT_ABANDONED_0
: DWORD
= STATUS_ABANDONED_WAIT_0
as u32;
54 pub const WAIT_IO_COMPLETION
: DWORD
= STATUS_USER_APC
as u32;
55 pub const FILE_FLAG_WRITE_THROUGH
: DWORD
= 0x80000000;
56 pub const FILE_FLAG_OVERLAPPED
: DWORD
= 0x40000000;
57 pub const FILE_FLAG_NO_BUFFERING
: DWORD
= 0x20000000;
58 pub const FILE_FLAG_RANDOM_ACCESS
: DWORD
= 0x10000000;
59 pub const FILE_FLAG_SEQUENTIAL_SCAN
: DWORD
= 0x08000000;
60 pub const FILE_FLAG_DELETE_ON_CLOSE
: DWORD
= 0x04000000;
61 pub const FILE_FLAG_BACKUP_SEMANTICS
: DWORD
= 0x02000000;
62 pub const FILE_FLAG_POSIX_SEMANTICS
: DWORD
= 0x01000000;
63 pub const FILE_FLAG_SESSION_AWARE
: DWORD
= 0x00800000;
64 pub const FILE_FLAG_OPEN_REPARSE_POINT
: DWORD
= 0x00200000;
65 pub const FILE_FLAG_OPEN_NO_RECALL
: DWORD
= 0x00100000;
66 pub const FILE_FLAG_FIRST_PIPE_INSTANCE
: DWORD
= 0x00080000;
67 pub const FILE_FLAG_OPEN_REQUIRING_OPLOCK
: DWORD
= 0x00040000;
68 pub const PROGRESS_CONTINUE
: DWORD
= 0;
69 pub const PROGRESS_CANCEL
: DWORD
= 1;
70 pub const PROGRESS_STOP
: DWORD
= 2;
71 pub const PROGRESS_QUIET
: DWORD
= 3;
72 pub const CALLBACK_CHUNK_FINISHED
: DWORD
= 0x00000000;
73 pub const CALLBACK_STREAM_SWITCH
: DWORD
= 0x00000001;
74 pub const COPY_FILE_FAIL_IF_EXISTS
: DWORD
= 0x00000001;
75 pub const COPY_FILE_RESTARTABLE
: DWORD
= 0x00000002;
76 pub const COPY_FILE_OPEN_SOURCE_FOR_WRITE
: DWORD
= 0x00000004;
77 pub const COPY_FILE_ALLOW_DECRYPTED_DESTINATION
: DWORD
= 0x00000008;
78 pub const COPY_FILE_COPY_SYMLINK
: DWORD
= 0x00000800;
79 pub const COPY_FILE_NO_BUFFERING
: DWORD
= 0x00001000;
80 pub const COPY_FILE_REQUEST_SECURITY_PRIVILEGES
: DWORD
= 0x00002000;
81 pub const COPY_FILE_RESUME_FROM_PAUSE
: DWORD
= 0x00004000;
82 pub const COPY_FILE_NO_OFFLOAD
: DWORD
= 0x00040000;
83 pub const COPY_FILE_IGNORE_EDP_BLOCK
: DWORD
= 0x00400000;
84 pub const COPY_FILE_IGNORE_SOURCE_ENCRYPTION
: DWORD
= 0x00800000;
85 pub const REPLACEFILE_WRITE_THROUGH
: DWORD
= 0x00000001;
86 pub const REPLACEFILE_IGNORE_MERGE_ERRORS
: DWORD
= 0x00000002;
87 pub const REPLACEFILE_IGNORE_ACL_ERRORS
: DWORD
= 0x00000004;
88 pub const PIPE_ACCESS_INBOUND
: DWORD
= 0x00000001;
89 pub const PIPE_ACCESS_OUTBOUND
: DWORD
= 0x00000002;
90 pub const PIPE_ACCESS_DUPLEX
: DWORD
= 0x00000003;
91 pub const PIPE_CLIENT_END
: DWORD
= 0x00000000;
92 pub const PIPE_SERVER_END
: DWORD
= 0x00000001;
93 pub const PIPE_WAIT
: DWORD
= 0x00000000;
94 pub const PIPE_NOWAIT
: DWORD
= 0x00000001;
95 pub const PIPE_READMODE_BYTE
: DWORD
= 0x00000000;
96 pub const PIPE_READMODE_MESSAGE
: DWORD
= 0x00000002;
97 pub const PIPE_TYPE_BYTE
: DWORD
= 0x00000000;
98 pub const PIPE_TYPE_MESSAGE
: DWORD
= 0x00000004;
99 pub const PIPE_ACCEPT_REMOTE_CLIENTS
: DWORD
= 0x00000000;
100 pub const PIPE_REJECT_REMOTE_CLIENTS
: DWORD
= 0x00000008;
101 pub const PIPE_UNLIMITED_INSTANCES
: DWORD
= 255;
102 pub const SECURITY_ANONYMOUS
: DWORD
= SecurityAnonymous
<< 16;
103 pub const SECURITY_IDENTIFICATION
: DWORD
= SecurityIdentification
<< 16;
104 pub const SECURITY_IMPERSONATION
: DWORD
= SecurityImpersonation
<< 16;
105 pub const SECURITY_DELEGATION
: DWORD
= SecurityDelegation
<< 16;
106 pub const SECURITY_CONTEXT_TRACKING
: DWORD
= 0x00040000;
107 pub const SECURITY_EFFECTIVE_ONLY
: DWORD
= 0x00080000;
108 pub const SECURITY_SQOS_PRESENT
: DWORD
= 0x00100000;
109 pub const SECURITY_VALID_SQOS_FLAGS
: DWORD
= 0x001F0000;
110 FN
!{stdcall
PFIBER_START_ROUTINE(
111 lpFiberParameter
: LPVOID
,
113 pub type LPFIBER_START_ROUTINE
= PFIBER_START_ROUTINE
;
114 FN
!{stdcall
PFIBER_CALLOUT_ROUTINE(
118 #[cfg(target_arch = "x86")]
119 pub type LPLDT_ENTRY
= PLDT_ENTRY
;
120 #[cfg(not(target_arch = "x86"))]
121 pub type LPLDT_ENTRY
= LPVOID
; // TODO - fix this for 32-bit
130 STRUCT
!{struct COMMPROP
{
132 wPacketVersion
: WORD
,
133 dwServiceMask
: DWORD
,
138 dwProvSubType
: DWORD
,
139 dwProvCapabilities
: DWORD
,
140 dwSettableParams
: DWORD
,
141 dwSettableBaud
: DWORD
,
143 wSettableStopParity
: WORD
,
144 dwCurrentTxQueue
: DWORD
,
145 dwCurrentRxQueue
: DWORD
,
148 wcProvChar
: [WCHAR
; 1],
150 pub type LPCOMMPROP
= *mut COMMPROP
;
151 STRUCT
!{struct COMSTAT
{
156 BITFIELD
!{COMSTAT BitFields
: DWORD
[
157 fCtsHold set_fCtsHold
[0..1],
158 fDsrHold set_fDsrHold
[1..2],
159 fRlsdHold set_fRlsdHold
[2..3],
160 fXoffHold set_fXoffHold
[3..4],
161 fXoffSent set_fXoffSent
[4..5],
163 fTxim set_fTxim
[6..7],
164 fReserved set_fReserved
[7..32],
166 pub type LPCOMSTAT
= *mut COMSTAT
;
167 pub const DTR_CONTROL_DISABLE
: DWORD
= 0x00;
168 pub const DTR_CONTROL_ENABLE
: DWORD
= 0x01;
169 pub const DTR_CONTROL_HANDSHAKE
: DWORD
= 0x02;
170 pub const RTS_CONTROL_DISABLE
: DWORD
= 0x00;
171 pub const RTS_CONTROL_ENABLE
: DWORD
= 0x01;
172 pub const RTS_CONTROL_HANDSHAKE
: DWORD
= 0x02;
173 pub const RTS_CONTROL_TOGGLE
: DWORD
= 0x03;
191 BITFIELD
!{DCB BitFields
: DWORD
[
192 fBinary set_fBinary
[0..1],
193 fParity set_fParity
[1..2],
194 fOutxCtsFlow set_fOutxCtsFlow
[2..3],
195 fOutxDsrFlow set_fOutxDsrFlow
[3..4],
196 fDtrControl set_fDtrControl
[4..6],
197 fDsrSensitivity set_fDsrSensitivity
[6..7],
198 fTXContinueOnXoff set_fTXContinueOnXoff
[7..8],
199 fOutX set_fOutX
[8..9],
200 fInX set_fInX
[9..10],
201 fErrorChar set_fErrorChar
[10..11],
202 fNull set_fNull
[11..12],
203 fRtsControl set_fRtsControl
[12..14],
204 fAbortOnError set_fAbortOnError
[14..15],
205 fDummy2 set_fDummy2
[15..32],
207 pub type LPDCB
= *mut DCB
;
208 STRUCT
!{struct COMMTIMEOUTS
{
209 ReadIntervalTimeout
: DWORD
,
210 ReadTotalTimeoutMultiplier
: DWORD
,
211 ReadTotalTimeoutConstant
: DWORD
,
212 WriteTotalTimeoutMultiplier
: DWORD
,
213 WriteTotalTimeoutConstant
: DWORD
,
215 pub type LPCOMMTIMEOUTS
= *mut COMMTIMEOUTS
;
216 STRUCT
!{struct COMMCONFIG
{
221 dwProviderSubType
: DWORD
,
222 dwProviderOffset
: DWORD
,
223 dwProviderSize
: DWORD
,
224 wcProviderData
: [WCHAR
; 1],
226 pub type LPCOMMCONFIG
= *mut COMMCONFIG
;
227 pub const GMEM_FIXED
: UINT
= 0x0000;
228 pub const GMEM_MOVEABLE
: UINT
= 0x0002;
229 pub const GMEM_NOCOMPACT
: UINT
= 0x0010;
230 pub const GMEM_NODISCARD
: UINT
= 0x0020;
231 pub const GMEM_ZEROINIT
: UINT
= 0x0040;
232 pub const GMEM_MODIFY
: UINT
= 0x0080;
233 pub const GMEM_DISCARDABLE
: UINT
= 0x0100;
234 pub const GMEM_NOT_BANKED
: UINT
= 0x1000;
235 pub const GMEM_SHARE
: UINT
= 0x2000;
236 pub const GMEM_DDESHARE
: UINT
= 0x2000;
237 pub const GMEM_NOTIFY
: UINT
= 0x4000;
238 pub const GMEM_LOWER
: UINT
= GMEM_NOT_BANKED
;
239 pub const GMEM_VALID_FLAGS
: UINT
= 0x7F72;
240 pub const GMEM_INVALID_HANDLE
: UINT
= 0x8000;
241 pub const GHND
: UINT
= GMEM_MOVEABLE
| GMEM_ZEROINIT
;
242 pub const GPTR
: UINT
= GMEM_FIXED
| GMEM_ZEROINIT
;
243 pub const GMEM_DISCARDED
: UINT
= 0x4000;
244 pub const GMEM_LOCKCOUNT
: UINT
= 0x00FF;
245 STRUCT
!{struct MEMORYSTATUS
{
250 dwTotalPageFile
: SIZE_T
,
251 dwAvailPageFile
: SIZE_T
,
252 dwTotalVirtual
: SIZE_T
,
253 dwAvailVirtual
: SIZE_T
,
255 pub type LPMEMORYSTATUS
= *mut MEMORYSTATUS
;
256 // NUMA_NO_PREFERRED_NODE
257 pub const DEBUG_PROCESS
: DWORD
= 0x00000001;
258 pub const DEBUG_ONLY_THIS_PROCESS
: DWORD
= 0x00000002;
259 pub const CREATE_SUSPENDED
: DWORD
= 0x00000004;
260 pub const DETACHED_PROCESS
: DWORD
= 0x00000008;
261 pub const CREATE_NEW_CONSOLE
: DWORD
= 0x00000010;
262 pub const NORMAL_PRIORITY_CLASS
: DWORD
= 0x00000020;
263 pub const IDLE_PRIORITY_CLASS
: DWORD
= 0x00000040;
264 pub const HIGH_PRIORITY_CLASS
: DWORD
= 0x00000080;
265 pub const REALTIME_PRIORITY_CLASS
: DWORD
= 0x00000100;
266 pub const CREATE_NEW_PROCESS_GROUP
: DWORD
= 0x00000200;
267 pub const CREATE_UNICODE_ENVIRONMENT
: DWORD
= 0x00000400;
268 pub const CREATE_SEPARATE_WOW_VDM
: DWORD
= 0x00000800;
269 pub const CREATE_SHARED_WOW_VDM
: DWORD
= 0x00001000;
270 pub const CREATE_FORCEDOS
: DWORD
= 0x00002000;
271 pub const BELOW_NORMAL_PRIORITY_CLASS
: DWORD
= 0x00004000;
272 pub const ABOVE_NORMAL_PRIORITY_CLASS
: DWORD
= 0x00008000;
273 pub const INHERIT_PARENT_AFFINITY
: DWORD
= 0x00010000;
274 pub const INHERIT_CALLER_PRIORITY
: DWORD
= 0x00020000;
275 pub const CREATE_PROTECTED_PROCESS
: DWORD
= 0x00040000;
276 pub const EXTENDED_STARTUPINFO_PRESENT
: DWORD
= 0x00080000;
277 pub const PROCESS_MODE_BACKGROUND_BEGIN
: DWORD
= 0x00100000;
278 pub const PROCESS_MODE_BACKGROUND_END
: DWORD
= 0x00200000;
279 pub const CREATE_BREAKAWAY_FROM_JOB
: DWORD
= 0x01000000;
280 pub const CREATE_PRESERVE_CODE_AUTHZ_LEVEL
: DWORD
= 0x02000000;
281 pub const CREATE_DEFAULT_ERROR_MODE
: DWORD
= 0x04000000;
282 pub const CREATE_NO_WINDOW
: DWORD
= 0x08000000;
283 pub const PROFILE_USER
: DWORD
= 0x10000000;
284 pub const PROFILE_KERNEL
: DWORD
= 0x20000000;
285 pub const PROFILE_SERVER
: DWORD
= 0x40000000;
286 pub const CREATE_IGNORE_SYSTEM_DEFAULT
: DWORD
= 0x80000000;
287 // STACK_SIZE_PARAM_IS_A_RESERVATION
288 pub const THREAD_PRIORITY_LOWEST
: DWORD
= THREAD_BASE_PRIORITY_MIN
;
289 pub const THREAD_PRIORITY_BELOW_NORMAL
: DWORD
= THREAD_PRIORITY_LOWEST
+ 1;
290 pub const THREAD_PRIORITY_NORMAL
: DWORD
= 0;
291 pub const THREAD_PRIORITY_HIGHEST
: DWORD
= THREAD_BASE_PRIORITY_MAX
;
292 pub const THREAD_PRIORITY_ABOVE_NORMAL
: DWORD
= THREAD_PRIORITY_HIGHEST
- 1;
293 pub const THREAD_PRIORITY_ERROR_RETURN
: DWORD
= MAXLONG
as u32;
294 pub const THREAD_PRIORITY_TIME_CRITICAL
: DWORD
= THREAD_BASE_PRIORITY_LOWRT
;
295 pub const THREAD_PRIORITY_IDLE
: DWORD
= THREAD_BASE_PRIORITY_IDLE
;
296 pub const THREAD_MODE_BACKGROUND_BEGIN
: DWORD
= 0x00010000;
297 pub const THREAD_MODE_BACKGROUND_END
: DWORD
= 0x00020000;
298 pub const VOLUME_NAME_DOS
: DWORD
= 0x0;
302 pub const DRIVE_UNKNOWN
: DWORD
= 0;
303 pub const DRIVE_NO_ROOT_DIR
: DWORD
= 1;
304 pub const DRIVE_REMOVABLE
: DWORD
= 2;
305 pub const DRIVE_FIXED
: DWORD
= 3;
306 pub const DRIVE_REMOTE
: DWORD
= 4;
307 pub const DRIVE_CDROM
: DWORD
= 5;
308 pub const DRIVE_RAMDISK
: DWORD
= 6;
309 // pub fn GetFreeSpace();
310 pub const FILE_TYPE_UNKNOWN
: DWORD
= 0x0000;
311 pub const FILE_TYPE_DISK
: DWORD
= 0x0001;
312 pub const FILE_TYPE_CHAR
: DWORD
= 0x0002;
313 pub const FILE_TYPE_PIPE
: DWORD
= 0x0003;
314 pub const FILE_TYPE_REMOTE
: DWORD
= 0x8000;
315 pub const STD_INPUT_HANDLE
: DWORD
= -10i32 as u32;
316 pub const STD_OUTPUT_HANDLE
: DWORD
= -11i32 as u32;
317 pub const STD_ERROR_HANDLE
: DWORD
= -12i32 as u32;
318 pub const NOPARITY
: BYTE
= 0;
319 pub const ODDPARITY
: BYTE
= 1;
320 pub const EVENPARITY
: BYTE
= 2;
321 pub const MARKPARITY
: BYTE
= 3;
322 pub const SPACEPARITY
: BYTE
= 4;
323 pub const ONESTOPBIT
: BYTE
= 0;
324 pub const ONE5STOPBITS
: BYTE
= 1;
325 pub const TWOSTOPBITS
: BYTE
= 2;
326 pub const IGNORE
: DWORD
= 0;
327 pub const INFINITE
: DWORD
= 0xFFFFFFFF;
328 pub const CBR_110
: DWORD
= 110;
329 pub const CBR_300
: DWORD
= 300;
330 pub const CBR_600
: DWORD
= 600;
331 pub const CBR_1200
: DWORD
= 1200;
332 pub const CBR_2400
: DWORD
= 2400;
333 pub const CBR_4800
: DWORD
= 4800;
334 pub const CBR_9600
: DWORD
= 9600;
335 pub const CBR_14400
: DWORD
= 14400;
336 pub const CBR_19200
: DWORD
= 19200;
337 pub const CBR_38400
: DWORD
= 38400;
338 pub const CBR_56000
: DWORD
= 56000;
339 pub const CBR_57600
: DWORD
= 57600;
340 pub const CBR_115200
: DWORD
= 115200;
341 pub const CBR_128000
: DWORD
= 128000;
342 pub const CBR_256000
: DWORD
= 256000;
346 pub const SETXOFF
: DWORD
= 1;
347 pub const SETXON
: DWORD
= 2;
348 pub const SETRTS
: DWORD
= 3;
349 pub const CLRRTS
: DWORD
= 4;
350 pub const SETDTR
: DWORD
= 5;
351 pub const CLRDTR
: DWORD
= 6;
352 pub const RESETDEV
: DWORD
= 7;
353 pub const SETBREAK
: DWORD
= 8;
354 pub const CLRBREAK
: DWORD
= 9;
355 pub const PURGE_TXABORT
: DWORD
= 0x0001;
356 pub const PURGE_RXABORT
: DWORD
= 0x0002;
357 pub const PURGE_TXCLEAR
: DWORD
= 0x0004;
358 pub const PURGE_RXCLEAR
: DWORD
= 0x0008;
359 pub const MS_CTS_ON
: DWORD
= 0x0010;
360 pub const MS_DSR_ON
: DWORD
= 0x0020;
361 pub const MS_RING_ON
: DWORD
= 0x0040;
362 pub const MS_RLSD_ON
: DWORD
= 0x0080;
367 pub const OFS_MAXPATHNAME
: usize = 128;
368 STRUCT
!{struct OFSTRUCT
{
374 szPathName
: [CHAR
; OFS_MAXPATHNAME
],
376 pub type POFSTRUCT
= *mut OFSTRUCT
;
377 pub type LPOFSTRUCT
= *mut OFSTRUCT
;
383 pub fn GlobalReAlloc(
406 pub fn GlobalCompact(
421 pub fn GlobalMemoryStatus(
422 lpBuffer
: LPMEMORYSTATUS
,
461 pub fn GetBinaryTypeA(
462 lpApplicationName
: LPCSTR
,
463 lpBinaryType
: LPDWORD
,
465 pub fn GetBinaryTypeW(
466 lpApplicationName
: LPCWSTR
,
467 lpBinaryType
: LPDWORD
,
469 pub fn GetShortPathNameA(
470 lpszLongPath
: LPCSTR
,
471 lpszShortPath
: LPSTR
,
474 pub fn GetLongPathNameTransactedA(
475 lpszShortPath
: LPCSTR
,
478 hTransaction
: HANDLE
,
480 pub fn GetLongPathNameTransactedW(
481 lpszShortPath
: LPCWSTR
,
482 lpszLongPath
: LPWSTR
,
484 hTransaction
: HANDLE
,
486 pub fn GetProcessAffinityMask(
488 lpProcessAffinityMask
: PDWORD_PTR
,
489 lpSystemAffinityMask
: PDWORD_PTR
,
491 pub fn SetProcessAffinityMask(
493 dwProcessAffinityMask
: DWORD
,
495 pub fn GetProcessIoCounters(
497 lpIoCounters
: PIO_COUNTERS
,
499 pub fn GetProcessWorkingSetSize(
501 lpMinimumWorkingSetSize
: PSIZE_T
,
502 lpMaximumWorkingSetSize
: PSIZE_T
,
504 pub fn SetProcessWorkingSetSize(
506 dwMinimumWorkingSetSize
: SIZE_T
,
507 dwMaximumWorkingSetSize
: SIZE_T
,
512 pub fn SetEnvironmentStringsA(
513 NewEnvironment
: LPCH
,
515 pub fn SwitchToFiber(
521 pub fn ConvertFiberToThread() -> BOOL
;
522 pub fn CreateFiberEx(
523 dwStackCommitSize
: SIZE_T
,
524 dwStackReserveSize
: SIZE_T
,
526 lpStartAddress
: LPFIBER_START_ROUTINE
,
529 pub fn ConvertThreadToFiberEx(
535 lpStartAddress
: LPFIBER_START_ROUTINE
,
538 pub fn ConvertThreadToFiber(
542 pub type PUMS_CONTEXT
= *mut c_void
;
543 pub type PUMS_COMPLETION_LIST
= *mut c_void
;
544 pub type UMS_THREAD_INFO_CLASS
= RTL_UMS_THREAD_INFO_CLASS
;
545 pub type PUMS_THREAD_INFO_CLASS
= *mut UMS_THREAD_INFO_CLASS
;
546 pub type PUMS_SCHEDULER_ENTRY_POINT
= PRTL_UMS_SCHEDULER_ENTRY_POINT
;
547 STRUCT
!{struct UMS_SCHEDULER_STARTUP_INFO
{
549 CompletionList
: PUMS_COMPLETION_LIST
,
550 SchedulerProc
: PUMS_SCHEDULER_ENTRY_POINT
,
551 SchedulerParam
: PVOID
,
553 pub type PUMS_SCHEDULER_STARTUP_INFO
= *mut UMS_SCHEDULER_STARTUP_INFO
;
554 STRUCT
!{struct UMS_SYSTEM_THREAD_INFORMATION
{
556 ThreadUmsFlags
: ULONG
,
558 BITFIELD
!{UMS_SYSTEM_THREAD_INFORMATION ThreadUmsFlags
: ULONG
[
559 IsUmsSchedulerThread set_IsUmsSchedulerThread
[0..1],
560 IsUmsWorkerThread set_IsUmsWorkerThread
[1..2],
562 pub type PUMS_SYSTEM_THREAD_INFORMATION
= *mut UMS_SYSTEM_THREAD_INFORMATION
;
564 #[cfg(target_pointer_width = "64")]
565 pub fn CreateUmsCompletionList(
566 UmsCompletionList
: *mut PUMS_COMPLETION_LIST
,
568 #[cfg(target_pointer_width = "64")]
569 pub fn DequeueUmsCompletionListItems(
570 UmsCompletionList
: PUMS_COMPLETION_LIST
,
572 UmsThreadList
: *mut PUMS_CONTEXT
,
574 #[cfg(target_pointer_width = "64")]
575 pub fn GetUmsCompletionListEvent(
576 UmsCompletionList
: PUMS_COMPLETION_LIST
,
577 UmsCompletionEvent
: PHANDLE
,
579 #[cfg(target_pointer_width = "64")]
580 pub fn ExecuteUmsThread(
581 UmsThread
: PUMS_CONTEXT
,
583 #[cfg(target_pointer_width = "64")]
584 pub fn UmsThreadYield(
585 SchedulerParam
: PVOID
,
587 #[cfg(target_pointer_width = "64")]
588 pub fn DeleteUmsCompletionList(
589 UmsCompletionList
: PUMS_COMPLETION_LIST
,
591 #[cfg(target_pointer_width = "64")]
592 pub fn GetCurrentUmsThread() -> PUMS_CONTEXT
;
593 #[cfg(target_pointer_width = "64")]
594 pub fn GetNextUmsListItem(
595 UmsContext
: PUMS_CONTEXT
,
597 #[cfg(target_pointer_width = "64")]
598 pub fn QueryUmsThreadInformation(
599 UmsThread
: PUMS_CONTEXT
,
600 UmsThreadInfoClass
: UMS_THREAD_INFO_CLASS
,
601 UmsThreadInformation
: PVOID
,
602 UmsThreadInformationLength
: ULONG
,
603 ReturnLength
: PULONG
,
605 #[cfg(target_pointer_width = "64")]
606 pub fn SetUmsThreadInformation(
607 UmsThread
: PUMS_CONTEXT
,
608 UmsThreadInfoClass
: UMS_THREAD_INFO_CLASS
,
609 UmsThreadInformation
: PVOID
,
610 UmsThreadInformationLength
: ULONG
,
612 #[cfg(target_pointer_width = "64")]
613 pub fn DeleteUmsThreadContext(
614 UmsThread
: PUMS_CONTEXT
,
616 #[cfg(target_pointer_width = "64")]
617 pub fn CreateUmsThreadContext(
618 lpUmsThread
: *mut PUMS_CONTEXT
,
620 #[cfg(target_pointer_width = "64")]
621 pub fn EnterUmsSchedulingMode(
622 SchedulerStartupInfo
: PUMS_SCHEDULER_STARTUP_INFO
,
624 #[cfg(target_pointer_width = "64")]
625 pub fn GetUmsSystemThreadInformation(
626 ThreadHandle
: HANDLE
,
627 SystemThreadInfo
: PUMS_SYSTEM_THREAD_INFORMATION
,
629 pub fn SetThreadAffinityMask(
631 dwThreadAffinityMask
: DWORD_PTR
,
633 pub fn SetProcessDEPPolicy(
636 pub fn GetProcessDEPPolicy(
641 pub fn RequestWakeupLatency(
642 latency
: LATENCY_TIME
,
644 pub fn IsSystemResumeAutomatic() -> BOOL
;
645 pub fn GetThreadSelectorEntry(
648 lpSelectorEntry
: LPLDT_ENTRY
,
650 pub fn SetThreadExecutionState(
651 esFlags
: EXECUTION_STATE
,
652 ) -> EXECUTION_STATE
;
653 pub fn PowerCreateRequest(
654 Context
: PREASON_CONTEXT
,
656 pub fn PowerSetRequest(
657 PowerRequest
: HANDLE
,
658 RequestType
: POWER_REQUEST_TYPE
,
660 pub fn PowerClearRequest(
661 PowerRequest
: HANDLE
,
662 RequestType
: POWER_REQUEST_TYPE
,
664 pub fn RestoreLastError(
668 pub const FILE_SKIP_COMPLETION_PORT_ON_SUCCESS
: UCHAR
= 0x1;
669 pub const FILE_SKIP_SET_EVENT_ON_HANDLE
: UCHAR
= 0x2;
671 pub fn SetFileCompletionNotificationModes(
676 pub const SEM_FAILCRITICALERRORS
: UINT
= 0x0001;
677 pub const SEM_NOGPFAULTERRORBOX
: UINT
= 0x0002;
678 pub const SEM_NOALIGNMENTFAULTEXCEPT
: UINT
= 0x0004;
679 pub const SEM_NOOPENFILEERRORBOX
: UINT
= 0x8000;
681 pub fn Wow64GetThreadContext(
683 lpContext
: PWOW64_CONTEXT
,
685 pub fn Wow64SetThreadContext(
687 lpContext
: *const WOW64_CONTEXT
,
689 pub fn Wow64GetThreadSelectorEntry(
692 lpSelectorEntry
: PWOW64_LDT_ENTRY
,
694 pub fn Wow64SuspendThread(
697 pub fn DebugSetProcessKillOnExit(
700 pub fn DebugBreakProcess(
706 pub fn GlobalDeleteAtom(
709 pub fn InitAtomTable(
715 pub fn SetHandleCount(
718 pub fn RequestDeviceWakeup(
721 pub fn CancelDeviceWakeupRequest(
724 pub fn GetDevicePowerState(
728 pub fn SetMessageWaitingIndicator(
729 hMsgIndicator
: HANDLE
,
732 pub fn SetFileShortNameA(
736 pub fn SetFileShortNameW(
738 lpShortName
: LPCWSTR
,
741 pub const HANDLE_FLAG_INHERIT
: DWORD
= 0x00000001;
742 pub const HANDLE_FLAG_PROTECT_FROM_CLOSE
: DWORD
= 0x00000002;
745 lpModuleName
: LPCSTR
,
746 lpParameterBlock
: LPVOID
,
755 // EscapeCommFunction
759 // GetCommModemStatus
770 pub fn SetTapePosition(
772 dwPositionMethod
: DWORD
,
778 pub fn GetTapePosition(
780 dwPositionType
: DWORD
,
781 lpdwPartition
: LPDWORD
,
782 lpdwOffsetLow
: LPDWORD
,
783 lpdwOffsetHigh
: LPDWORD
,
795 pub fn CreateTapePartition(
797 dwPartitionMethod
: DWORD
,
801 pub fn WriteTapemark(
803 dwTapemarkType
: DWORD
,
804 dwTapemarkCount
: DWORD
,
807 pub fn GetTapeStatus(
810 pub fn GetTapeParameters(
814 lpTapeInformation
: LPVOID
,
816 pub fn SetTapeParameters(
819 lpTapeInformation
: LPVOID
,
827 ENUM
!{enum DEP_SYSTEM_POLICY_TYPE
{
828 DEPPolicyAlwaysOff
= 0,
835 pub fn GetSystemDEPPolicy() -> DEP_SYSTEM_POLICY_TYPE
;
836 pub fn GetSystemRegistryQuota(
837 pdwQuotaAllowed
: PDWORD
,
838 pdwQuotaUsed
: PDWORD
,
840 pub fn FileTimeToDosDateTime(
841 lpFileTime
: *const FILETIME
,
845 pub fn DosDateTimeToFileTime(
848 lpFileTime
: LPFILETIME
,
850 pub fn FormatMessageA(
857 Arguments
: *mut va_list
,
859 pub fn FormatMessageW(
866 Arguments
: *mut va_list
,
869 pub const FORMAT_MESSAGE_IGNORE_INSERTS
: DWORD
= 0x00000200;
870 pub const FORMAT_MESSAGE_FROM_STRING
: DWORD
= 0x00000400;
871 pub const FORMAT_MESSAGE_FROM_HMODULE
: DWORD
= 0x00000800;
872 pub const FORMAT_MESSAGE_FROM_SYSTEM
: DWORD
= 0x00001000;
873 pub const FORMAT_MESSAGE_ARGUMENT_ARRAY
: DWORD
= 0x00002000;
874 pub const FORMAT_MESSAGE_MAX_WIDTH_MASK
: DWORD
= 0x000000FF;
875 pub const FORMAT_MESSAGE_ALLOCATE_BUFFER
: DWORD
= 0x00000100;
877 pub fn CreateMailslotA(
879 nMaxMessageSize
: DWORD
,
881 lpSecurityAttributes
: LPSECURITY_ATTRIBUTES
,
883 pub fn CreateMailslotW(
885 nMaxMessageSize
: DWORD
,
887 lpSecurityAttributes
: LPSECURITY_ATTRIBUTES
,
889 pub fn GetMailslotInfo(
891 lpMaxMessageSize
: LPDWORD
,
893 lpMessageCount
: LPDWORD
,
894 lpReadTimeout
: LPDWORD
,
896 pub fn SetMailslotInfo(
900 // pub fn EncryptFileA();
901 // pub fn EncryptFileW();
902 // pub fn DecryptFileA();
903 // pub fn DecryptFileW();
904 // pub fn FileEncryptionStatusA();
905 // pub fn FileEncryptionStatusW();
906 // pub fn OpenEncryptedFileRawA();
907 // pub fn OpenEncryptedFileRawW();
908 // pub fn ReadEncryptedFileRaw();
909 // pub fn WriteEncryptedFileRaw();
910 // pub fn CloseEncryptedFileRaw();
961 lpReOpenBuff
: LPOFSTRUCT
,
1000 // pub fn IsTextUnicode();
1001 // pub fn SignalObjectAndWait();
1005 nNumberOfBytesToRead
: DWORD
,
1006 lpNumberOfBytesRead
: LPDWORD
,
1008 bProcessSecurity
: BOOL
,
1009 lpContext
: *mut LPVOID
,
1013 dwLowBytesToSeek
: DWORD
,
1014 dwHighBytesToSeek
: DWORD
,
1015 lpdwLowByteSeeked
: LPDWORD
,
1016 lpdwHighByteSeeked
: LPDWORD
,
1017 lpContext
: *mut LPVOID
,
1022 nNumberOfBytesToWrite
: DWORD
,
1023 lpNumberOfBytesWritten
: LPDWORD
,
1025 bProcessSecurity
: BOOL
,
1026 lpContext
: *mut LPVOID
,
1030 pub const STARTF_USESHOWWINDOW
: DWORD
= 0x00000001;
1031 pub const STARTF_USESIZE
: DWORD
= 0x00000002;
1032 pub const STARTF_USEPOSITION
: DWORD
= 0x00000004;
1033 pub const STARTF_USECOUNTCHARS
: DWORD
= 0x00000008;
1034 pub const STARTF_USEFILLATTRIBUTE
: DWORD
= 0x00000010;
1035 pub const STARTF_RUNFULLSCREEN
: DWORD
= 0x00000020;
1036 pub const STARTF_FORCEONFEEDBACK
: DWORD
= 0x00000040;
1037 pub const STARTF_FORCEOFFFEEDBACK
: DWORD
= 0x00000080;
1038 pub const STARTF_USESTDHANDLES
: DWORD
= 0x00000100;
1039 pub const STARTF_USEHOTKEY
: DWORD
= 0x00000200;
1040 pub const STARTF_TITLEISLINKNAME
: DWORD
= 0x00000800;
1041 pub const STARTF_TITLEISAPPID
: DWORD
= 0x00001000;
1042 pub const STARTF_PREVENTPINNING
: DWORD
= 0x00002000;
1043 pub const STARTF_UNTRUSTEDSOURCE
: DWORD
= 0x00008000;
1044 STRUCT
!{struct STARTUPINFOEXA
{
1045 StartupInfo
: STARTUPINFOA
,
1046 lpAttributeList
: LPPROC_THREAD_ATTRIBUTE_LIST
,
1048 pub type LPSTARTUPINFOEXA
= *mut STARTUPINFOEXA
;
1049 STRUCT
!{struct STARTUPINFOEXW
{
1050 StartupInfo
: STARTUPINFOW
,
1051 lpAttributeList
: LPPROC_THREAD_ATTRIBUTE_LIST
,
1053 pub type LPSTARTUPINFOEXW
= *mut STARTUPINFOEXW
;
1056 dwDesiredAccess
: DWORD
,
1057 bInheritHandle
: BOOL
,
1060 pub fn CreateSemaphoreA(
1061 lpSemaphoreAttributes
: LPSECURITY_ATTRIBUTES
,
1062 lInitialCount
: LONG
,
1063 lMaximumCount
: LONG
,
1066 pub fn OpenSemaphoreA(
1067 dwDesiredAccess
: DWORD
,
1068 bInheritHandle
: BOOL
,
1071 pub fn CreateWaitableTimerA(
1072 lpTimerAttributes
: LPSECURITY_ATTRIBUTES
,
1074 lpTimerName
: LPCSTR
,
1076 pub fn OpenWaitableTimerA(
1077 dwDesiredAccess
: DWORD
,
1078 bInheritHandle
: BOOL
,
1079 lpTimerName
: LPCSTR
,
1081 pub fn CreateSemaphoreExA(
1082 lpSemaphoreAttributes
: LPSECURITY_ATTRIBUTES
,
1083 lInitialCount
: LONG
,
1084 lMaximumCount
: LONG
,
1087 dwDesiredAccess
: DWORD
,
1089 pub fn CreateWaitableTimerExA(
1090 lpTimerAttributes
: LPSECURITY_ATTRIBUTES
,
1091 lpTimerName
: LPCSTR
,
1093 dwDesiredAccess
: DWORD
,
1095 pub fn CreateFileMappingA(
1097 lpAttributes
: LPSECURITY_ATTRIBUTES
,
1099 dwMaximumSizeHigh
: DWORD
,
1100 dwMaximumSizeLow
: DWORD
,
1103 pub fn CreateFileMappingNumaA(
1105 lpFileMappingAttributes
: LPSECURITY_ATTRIBUTES
,
1107 dwMaximumSizeHigh
: DWORD
,
1108 dwMaximumSizeLow
: DWORD
,
1110 nndPreferred
: DWORD
,
1112 pub fn OpenFileMappingA(
1113 dwDesiredAccess
: DWORD
,
1114 bInheritHandle
: BOOL
,
1117 pub fn GetLogicalDriveStringsA(
1118 nBufferLength
: DWORD
,
1121 pub fn LoadPackagedLibrary(
1122 lpwLibFileName
: LPCWSTR
,
1125 pub fn QueryFullProcessImageNameA(
1131 pub fn QueryFullProcessImageNameW(
1140 pub fn GetStartupInfoA(
1141 lpStartupInfo
: LPSTARTUPINFOA
,
1143 pub fn GetFirmwareEnvironmentVariableA(
1149 pub fn GetFirmwareEnvironmentVariableW(
1155 pub fn GetFirmwareEnvironmentVariableExA(
1160 pdwAttribubutes
: PDWORD
,
1162 pub fn GetFirmwareEnvironmentVariableExW(
1167 pdwAttribubutes
: PDWORD
,
1169 pub fn SetFirmwareEnvironmentVariableA(
1175 pub fn SetFirmwareEnvironmentVariableW(
1181 pub fn SetFirmwareEnvironmentVariableExA(
1186 dwAttributes
: DWORD
,
1188 pub fn SetFirmwareEnvironmentVariableExW(
1193 dwAttributes
: DWORD
,
1195 pub fn GetFirmwareType(
1196 FirmwareType
: PFIRMWARE_TYPE
,
1198 pub fn IsNativeVhdBoot(
1199 NativeVhdBoot
: PBOOL
,
1201 pub fn FindResourceA(
1206 pub fn FindResourceExA(
1212 pub fn EnumResourceTypesA(
1214 lpEnumFunc
: ENUMRESTYPEPROCA
,
1217 pub fn EnumResourceTypesW(
1219 lpEnumFunc
: ENUMRESTYPEPROCW
,
1222 pub fn EnumResourceNamesA(
1225 lpEnumFunc
: ENUMRESNAMEPROCA
,
1228 pub fn EnumResourceLanguagesA(
1232 lpEnumFunc
: ENUMRESLANGPROCA
,
1235 pub fn EnumResourceLanguagesW(
1239 lpEnumFunc
: ENUMRESLANGPROCW
,
1242 pub fn BeginUpdateResourceA(
1244 bDeleteExistingResources
: BOOL
,
1246 pub fn BeginUpdateResourceW(
1248 bDeleteExistingResources
: BOOL
,
1250 pub fn UpdateResourceA(
1258 pub fn UpdateResourceW(
1266 pub fn EndUpdateResourceA(
1270 pub fn EndUpdateResourceW(
1274 pub fn GlobalAddAtomA(
1277 pub fn GlobalAddAtomW(
1280 pub fn GlobalAddAtomExA(
1284 pub fn GlobalAddAtomExW(
1288 pub fn GlobalFindAtomA(
1291 pub fn GlobalFindAtomW(
1294 pub fn GlobalGetAtomNameA(
1299 pub fn GlobalGetAtomNameW(
1316 pub fn GetAtomNameA(
1321 pub fn GetAtomNameW(
1326 pub fn GetProfileIntA(
1331 pub fn GetProfileIntW(
1336 pub fn GetProfileStringA(
1340 lpReturnedString
: LPSTR
,
1343 pub fn GetProfileStringW(
1347 lpReturnedString
: LPWSTR
,
1350 pub fn WriteProfileStringA(
1355 pub fn WriteProfileStringW(
1360 pub fn GetProfileSectionA(
1362 lpReturnedString
: LPSTR
,
1365 pub fn GetProfileSectionW(
1367 lpReturnedString
: LPWSTR
,
1370 pub fn WriteProfileSectionA(
1374 pub fn WriteProfileSectionW(
1378 pub fn GetPrivateProfileIntA(
1384 pub fn GetPrivateProfileIntW(
1388 lpFileName
: LPCWSTR
,
1390 pub fn GetPrivateProfileStringA(
1394 lpReturnedString
: LPSTR
,
1398 pub fn GetPrivateProfileStringW(
1402 lpReturnedString
: LPWSTR
,
1404 lpFileName
: LPCWSTR
,
1406 pub fn WritePrivateProfileStringA(
1412 pub fn WritePrivateProfileStringW(
1416 lpFileName
: LPCWSTR
,
1418 pub fn GetPrivateProfileSectionA(
1420 lpReturnedString
: LPSTR
,
1424 pub fn GetPrivateProfileSectionW(
1426 lpReturnedString
: LPWSTR
,
1428 lpFileName
: LPCWSTR
,
1430 pub fn WritePrivateProfileSectionA(
1435 pub fn WritePrivateProfileSectionW(
1438 lpFileName
: LPCWSTR
,
1440 pub fn GetPrivateProfileSectionNamesA(
1441 lpszReturnBuffer
: LPSTR
,
1445 pub fn GetPrivateProfileSectionNamesW(
1446 lpszReturnBuffer
: LPWSTR
,
1448 lpFileName
: LPCWSTR
,
1450 pub fn GetPrivateProfileStructA(
1451 lpszSection
: LPCSTR
,
1457 pub fn GetPrivateProfileStructW(
1458 lpszSection
: LPCWSTR
,
1464 pub fn WritePrivateProfileStructA(
1465 lpszSection
: LPCSTR
,
1471 pub fn WritePrivateProfileStructW(
1472 lpszSection
: LPCWSTR
,
1478 pub fn Wow64EnableWow64FsRedirection(
1479 Wow64FsEnableRedirection
: BOOLEAN
,
1481 pub fn SetDllDirectoryA(
1484 pub fn SetDllDirectoryW(
1485 lpPathName
: LPCWSTR
,
1487 pub fn GetDllDirectoryA(
1488 nBufferLength
: DWORD
,
1491 pub fn GetDllDirectoryW(
1492 nBufferLength
: DWORD
,
1495 pub fn SetSearchPathMode(
1498 pub fn CreateDirectoryExA(
1499 lpTemplateDirectory
: LPCSTR
,
1500 lpNewDirectory
: LPCSTR
,
1501 lpSecurityAttributes
: LPSECURITY_ATTRIBUTES
,
1503 pub fn CreateDirectoryExW(
1504 lpTemplateDirectory
: LPCWSTR
,
1505 lpNewDirectory
: LPCWSTR
,
1506 lpSecurityAttributes
: LPSECURITY_ATTRIBUTES
,
1508 pub fn CreateDirectoryTransactedA(
1509 lpTemplateDirectory
: LPCSTR
,
1510 lpNewDirectory
: LPCSTR
,
1511 lpSecurityAttributes
: LPSECURITY_ATTRIBUTES
,
1512 hTransaction
: HANDLE
,
1514 pub fn CreateDirectoryTransactedW(
1515 lpTemplateDirectory
: LPCWSTR
,
1516 lpNewDirectory
: LPCWSTR
,
1517 lpSecurityAttributes
: LPSECURITY_ATTRIBUTES
,
1518 hTransaction
: HANDLE
,
1520 pub fn RemoveDirectoryTransactedA(
1522 hTransaction
: HANDLE
,
1524 pub fn RemoveDirectoryTransactedW(
1525 lpPathName
: LPCWSTR
,
1526 hTransaction
: HANDLE
,
1528 pub fn GetFullPathNameTransactedA(
1530 nBufferLength
: DWORD
,
1532 lpFilePart
: *mut LPSTR
,
1533 hTransaction
: HANDLE
,
1535 pub fn GetFullPathNameTransactedW(
1536 lpFileName
: LPCWSTR
,
1537 nBufferLength
: DWORD
,
1539 lpFilePart
: *mut LPWSTR
,
1540 hTransaction
: HANDLE
,
1542 pub fn DefineDosDeviceA(
1544 lpDeviceName
: LPCSTR
,
1545 lpTargetPath
: LPCSTR
,
1547 pub fn QueryDosDeviceA(
1548 lpDeviceName
: LPCSTR
,
1549 lpTargetPath
: LPSTR
,
1552 pub fn CreateFileTransactedA(
1554 dwDesiredAccess
: DWORD
,
1556 lpSecurityAttributes
: LPSECURITY_ATTRIBUTES
,
1557 dwCreationDisposition
: DWORD
,
1558 dwFlagsAndAttributes
: DWORD
,
1559 hTemplateFile
: HANDLE
,
1560 hTransaction
: HANDLE
,
1561 pusMiniVersion
: PUSHORT
,
1562 lpExtendedParameter
: PVOID
,
1564 pub fn CreateFileTransactedW(
1565 lpFileName
: LPCWSTR
,
1566 dwDesiredAccess
: DWORD
,
1568 lpSecurityAttributes
: LPSECURITY_ATTRIBUTES
,
1569 dwCreationDisposition
: DWORD
,
1570 dwFlagsAndAttributes
: DWORD
,
1571 hTemplateFile
: HANDLE
,
1572 hTransaction
: HANDLE
,
1573 pusMiniVersion
: PUSHORT
,
1574 lpExtendedParameter
: PVOID
,
1577 hOriginalFile
: HANDLE
,
1578 dwDesiredAccess
: DWORD
,
1582 pub fn SetFileAttributesTransactedA(
1584 dwFileAttributes
: DWORD
,
1585 hTransaction
: HANDLE
,
1587 pub fn SetFileAttributesTransactedW(
1588 lpFileName
: LPCWSTR
,
1589 dwFileAttributes
: DWORD
,
1590 hTransaction
: HANDLE
,
1592 pub fn GetFileAttributesTransactedA(
1594 fInfoLevelId
: GET_FILEEX_INFO_LEVELS
,
1595 lpFileInformation
: LPVOID
,
1596 hTransaction
: HANDLE
,
1598 pub fn GetFileAttributesTransactedW(
1599 lpFileName
: LPCWSTR
,
1600 fInfoLevelId
: GET_FILEEX_INFO_LEVELS
,
1601 lpFileInformation
: LPVOID
,
1602 hTransaction
: HANDLE
,
1604 pub fn GetCompressedFileSizeTransactedA(
1606 lpFileSizeHigh
: LPDWORD
,
1607 hTransaction
: HANDLE
,
1609 pub fn GetCompressedFileSizeTransactedW(
1610 lpFileName
: LPCWSTR
,
1611 lpFileSizeHigh
: LPDWORD
,
1612 hTransaction
: HANDLE
,
1614 pub fn DeleteFileTransactedA(
1616 hTransaction
: HANDLE
,
1618 pub fn DeleteFileTransactedW(
1619 lpFileName
: LPCWSTR
,
1620 hTransaction
: HANDLE
,
1622 pub fn CheckNameLegalDOS8Dot3A(
1626 pbNameContainsSpaces
: PBOOL
,
1629 pub fn CheckNameLegalDOS8Dot3W(
1633 pbNameContainsSpaces
: PBOOL
,
1636 pub fn FindFirstFileTransactedA(
1638 fInfoLevelId
: FINDEX_INFO_LEVELS
,
1639 lpFindFileData
: LPVOID
,
1640 fSearchOp
: FINDEX_SEARCH_OPS
,
1641 lpSearchFilter
: LPVOID
,
1642 dwAdditionalFlags
: DWORD
,
1643 hTransaction
: HANDLE
,
1645 pub fn FindFirstFileTransactedW(
1646 lpFileName
: LPCWSTR
,
1647 fInfoLevelId
: FINDEX_INFO_LEVELS
,
1648 lpFindFileData
: LPVOID
,
1649 fSearchOp
: FINDEX_SEARCH_OPS
,
1650 lpSearchFilter
: LPVOID
,
1651 dwAdditionalFlags
: DWORD
,
1652 hTransaction
: HANDLE
,
1655 lpExistingFileName
: LPCSTR
,
1656 lpNewFileName
: LPCSTR
,
1657 bFailIfExists
: BOOL
,
1660 lpExistingFileName
: LPCWSTR
,
1661 lpNewFileName
: LPCWSTR
,
1662 bFailIfExists
: BOOL
,
1665 FN
!{stdcall
LPPROGRESS_ROUTINE(
1666 TotalFileSize
: LARGE_INTEGER
,
1667 TotalBytesTransferred
: LARGE_INTEGER
,
1668 StreamSize
: LARGE_INTEGER
,
1669 StreamBytesTransferred
: LARGE_INTEGER
,
1670 dwStreamNumber
: DWORD
,
1671 dwCallbackReason
: DWORD
,
1672 hSourceFile
: HANDLE
,
1673 hDestinationFile
: HANDLE
,
1678 lpExistingFileName
: LPCSTR
,
1679 lpNewFileName
: LPCSTR
,
1680 lpProgressRoutine
: LPPROGRESS_ROUTINE
,
1686 lpExistingFileName
: LPCWSTR
,
1687 lpNewFileName
: LPCWSTR
,
1688 lpProgressRoutine
: LPPROGRESS_ROUTINE
,
1693 pub fn CopyFileTransactedA(
1694 lpExistingFileName
: LPCWSTR
,
1695 lpNewFileName
: LPCWSTR
,
1696 lpProgressRoutine
: LPPROGRESS_ROUTINE
,
1700 hTransaction
: HANDLE
,
1702 pub fn CopyFileTransactedW(
1703 lpExistingFileName
: LPCWSTR
,
1704 lpNewFileName
: LPCWSTR
,
1705 lpProgressRoutine
: LPPROGRESS_ROUTINE
,
1709 hTransaction
: HANDLE
,
1712 ENUM
!{enum COPYFILE2_MESSAGE_TYPE
{
1713 COPYFILE2_CALLBACK_NONE
= 0,
1714 COPYFILE2_CALLBACK_CHUNK_STARTED
,
1715 COPYFILE2_CALLBACK_CHUNK_FINISHED
,
1716 COPYFILE2_CALLBACK_STREAM_STARTED
,
1717 COPYFILE2_CALLBACK_STREAM_FINISHED
,
1718 COPYFILE2_CALLBACK_POLL_CONTINUE
,
1719 COPYFILE2_CALLBACK_ERROR
,
1720 COPYFILE2_CALLBACK_MAX
,
1722 ENUM
!{enum COPYFILE2_MESSAGE_ACTION
{
1723 COPYFILE2_PROGRESS_CONTINUE
= 0,
1724 COPYFILE2_PROGRESS_CANCEL
,
1725 COPYFILE2_PROGRESS_STOP
,
1726 COPYFILE2_PROGRESS_QUIET
,
1727 COPYFILE2_PROGRESS_PAUSE
,
1729 ENUM
!{enum COPYFILE2_COPY_PHASE
{
1730 COPYFILE2_PHASE_NONE
= 0,
1731 COPYFILE2_PHASE_PREPARE_SOURCE
,
1732 COPYFILE2_PHASE_PREPARE_DEST
,
1733 COPYFILE2_PHASE_READ_SOURCE
,
1734 COPYFILE2_PHASE_WRITE_DESTINATION
,
1735 COPYFILE2_PHASE_SERVER_COPY
,
1736 COPYFILE2_PHASE_NAMEGRAFT_COPY
,
1737 COPYFILE2_PHASE_MAX
,
1739 STRUCT
!{struct COPYFILE2_MESSAGE_ChunkStarted
{
1740 dwStreamNumber
: DWORD
,
1742 hSourceFile
: HANDLE
,
1743 hDestinationFile
: HANDLE
,
1744 uliChunkNumber
: ULARGE_INTEGER
,
1745 uliChunkSize
: ULARGE_INTEGER
,
1746 uliStreamSize
: ULARGE_INTEGER
,
1747 uliTotalFileSize
: ULARGE_INTEGER
,
1749 STRUCT
!{struct COPYFILE2_MESSAGE_ChunkFinished
{
1750 dwStreamNumber
: DWORD
,
1752 hSourceFile
: HANDLE
,
1753 hDestinationFile
: HANDLE
,
1754 uliChunkNumber
: ULARGE_INTEGER
,
1755 uliChunkSize
: ULARGE_INTEGER
,
1756 uliStreamSize
: ULARGE_INTEGER
,
1757 uliStreamBytesTransferred
: ULARGE_INTEGER
,
1758 uliTotalFileSize
: ULARGE_INTEGER
,
1759 uliTotalBytesTransferred
: ULARGE_INTEGER
,
1761 STRUCT
!{struct COPYFILE2_MESSAGE_StreamStarted
{
1762 dwStreamNumber
: DWORD
,
1764 hSourceFile
: HANDLE
,
1765 hDestinationFile
: HANDLE
,
1766 uliStreamSize
: ULARGE_INTEGER
,
1767 uliTotalFileSize
: ULARGE_INTEGER
,
1769 STRUCT
!{struct COPYFILE2_MESSAGE_StreamFinished
{
1770 dwStreamNumber
: DWORD
,
1772 hSourceFile
: HANDLE
,
1773 hDestinationFile
: HANDLE
,
1774 uliStreamSize
: ULARGE_INTEGER
,
1775 uliStreamBytesTransferred
: ULARGE_INTEGER
,
1776 uliTotalFileSize
: ULARGE_INTEGER
,
1777 uliTotalBytesTransferred
: ULARGE_INTEGER
,
1779 STRUCT
!{struct COPYFILE2_MESSAGE_PollContinue
{
1782 STRUCT
!{struct COPYFILE2_MESSAGE_Error
{
1783 CopyPhase
: COPYFILE2_COPY_PHASE
,
1784 dwStreamNumber
: DWORD
,
1787 uliChunkNumber
: ULARGE_INTEGER
,
1788 uliStreamSize
: ULARGE_INTEGER
,
1789 uliStreamBytesTransferred
: ULARGE_INTEGER
,
1790 uliTotalFileSize
: ULARGE_INTEGER
,
1791 uliTotalBytesTransferred
: ULARGE_INTEGER
,
1793 UNION
!{union COPYFILE2_MESSAGE_Info
{
1795 ChunkStarted ChunkStarted_mut
: COPYFILE2_MESSAGE_ChunkStarted
,
1796 ChunkFinished ChunkFinished_mut
: COPYFILE2_MESSAGE_ChunkFinished
,
1797 StreamStarted StreamStarted_mut
: COPYFILE2_MESSAGE_StreamStarted
,
1798 StreamFinished StreamFinished_mut
: COPYFILE2_MESSAGE_StreamFinished
,
1799 PollContinue PollContinue_mut
: COPYFILE2_MESSAGE_PollContinue
,
1800 Error Error_mut
: COPYFILE2_MESSAGE_Error
,
1802 STRUCT
!{struct COPYFILE2_MESSAGE
{
1803 Type
: COPYFILE2_MESSAGE_TYPE
,
1805 Info
: COPYFILE2_MESSAGE_Info
,
1807 FN
!{stdcall
PCOPYFILE2_PROGRESS_ROUTINE(
1808 pMessage
: *const COPYFILE2_MESSAGE
,
1809 pvCallbackContext
: PVOID
,
1810 ) -> COPYFILE2_MESSAGE_ACTION
}
1811 STRUCT
!{struct COPYFILE2_EXTENDED_PARAMETERS
{
1814 pfCancel
: *mut BOOL
,
1815 pProgressRoutine
: PCOPYFILE2_PROGRESS_ROUTINE
,
1816 pvCallbackContext
: PVOID
,
1820 pwszExistingFileName
: PCWSTR
,
1821 pwszNewFileName
: PCWSTR
,
1822 pExtendedParameters
: *mut COPYFILE2_EXTENDED_PARAMETERS
,
1825 lpExistingFileName
: LPCSTR
,
1826 lpNewFileName
: LPCSTR
,
1829 lpExistingFileName
: LPCWSTR
,
1830 lpNewFileName
: LPCWSTR
,
1833 lpExistingFileName
: LPCSTR
,
1834 lpNewFileName
: LPCSTR
,
1838 lpExistingFileName
: LPCWSTR
,
1839 lpNewFileName
: LPCWSTR
,
1842 pub fn MoveFileWithProgressA(
1843 lpExistingFileName
: LPCSTR
,
1844 lpNewFileName
: LPCSTR
,
1845 lpProgressRoutine
: LPPROGRESS_ROUTINE
,
1849 pub fn MoveFileWithProgressW(
1850 lpExistingFileName
: LPCWSTR
,
1851 lpNewFileName
: LPCWSTR
,
1852 lpProgressRoutine
: LPPROGRESS_ROUTINE
,
1856 pub fn MoveFileTransactedA(
1857 lpExistingFileName
: LPCSTR
,
1858 lpNewFileName
: LPCSTR
,
1859 lpProgressRoutine
: LPPROGRESS_ROUTINE
,
1862 hTransaction
: HANDLE
,
1864 pub fn MoveFileTransactedW(
1865 lpExistingFileName
: LPCWSTR
,
1866 lpNewFileName
: LPCWSTR
,
1867 lpProgressRoutine
: LPPROGRESS_ROUTINE
,
1870 hTransaction
: HANDLE
,
1873 pub const MOVEFILE_REPLACE_EXISTING
: DWORD
= 0x00000001;
1874 pub const MOVEFILE_COPY_ALLOWED
: DWORD
= 0x00000002;
1875 pub const MOVEFILE_DELAY_UNTIL_REBOOT
: DWORD
= 0x00000004;
1876 pub const MOVEFILE_WRITE_THROUGH
: DWORD
= 0x00000008;
1877 pub const MOVEFILE_CREATE_HARDLINK
: DWORD
= 0x00000010;
1878 pub const MOVEFILE_FAIL_IF_NOT_TRACKABLE
: DWORD
= 0x00000020;
1880 pub fn ReplaceFileA(
1881 lpReplacedFileName
: LPCSTR
,
1882 lpReplacementFileName
: LPCSTR
,
1883 lpBackupFileName
: LPCSTR
,
1884 dwReplaceFlags
: DWORD
,
1888 pub fn ReplaceFileW(
1889 lpReplacedFileName
: LPCWSTR
,
1890 lpReplacementFileName
: LPCWSTR
,
1891 lpBackupFileName
: LPCWSTR
,
1892 dwReplaceFlags
: DWORD
,
1896 pub fn CreateHardLinkA(
1898 lpExistingFileName
: LPCSTR
,
1899 lpSecurityAttributes
: LPSECURITY_ATTRIBUTES
,
1901 pub fn CreateHardLinkW(
1902 lpFileName
: LPCWSTR
,
1903 lpExistingFileName
: LPCWSTR
,
1904 lpSecurityAttributes
: LPSECURITY_ATTRIBUTES
,
1906 pub fn CreateHardLinkTransactedA(
1908 lpExistingFileName
: LPCSTR
,
1909 lpSecurityAttributes
: LPSECURITY_ATTRIBUTES
,
1910 hTransaction
: HANDLE
,
1912 pub fn CreateHardLinkTransactedW(
1913 lpFileName
: LPCWSTR
,
1914 lpExistingFileName
: LPCWSTR
,
1915 lpSecurityAttributes
: LPSECURITY_ATTRIBUTES
,
1916 hTransaction
: HANDLE
,
1918 pub fn FindFirstStreamTransactedW(
1919 lpFileName
: LPCWSTR
,
1920 InfoLevel
: STREAM_INFO_LEVELS
,
1921 lpFindStreamData
: LPVOID
,
1923 hTransaction
: HANDLE
,
1925 pub fn FindFirstFileNameTransactedW(
1926 lpFileName
: LPCWSTR
,
1928 StringLength
: LPDWORD
,
1930 hTransaction
: HANDLE
,
1932 pub fn CreateNamedPipeA(
1936 nMaxInstances
: DWORD
,
1937 nOutBufferSize
: DWORD
,
1938 nInBufferSize
: DWORD
,
1939 nDefaultTimeOut
: DWORD
,
1940 lpSecurityAttributes
: LPSECURITY_ATTRIBUTES
,
1942 pub fn GetNamedPipeHandleStateA(
1945 lpCurInstances
: LPDWORD
,
1946 lpMaxCollectionCount
: LPDWORD
,
1947 lpCollectDataTimeout
: LPDWORD
,
1949 nMaxUserNameSize
: DWORD
,
1951 pub fn CallNamedPipeA(
1952 lpNamedPipeName
: LPCSTR
,
1954 nInBufferSize
: DWORD
,
1955 lpOutBuffer
: LPVOID
,
1956 nOutBufferSize
: DWORD
,
1957 lpBytesRead
: LPDWORD
,
1960 pub fn WaitNamedPipeA(
1961 lpNamedPipeName
: LPCSTR
,
1964 pub fn GetNamedPipeClientComputerNameA(
1966 ClientComputerName
: LPSTR
,
1967 ClientComputerNameLength
: ULONG
,
1969 pub fn GetNamedPipeClientProcessId(
1971 ClientProcessId
: PULONG
,
1973 pub fn GetNamedPipeClientSessionId(
1975 ClientSessionId
: PULONG
,
1977 pub fn GetNamedPipeServerProcessId(
1979 ServerProcessId
: PULONG
,
1981 pub fn GetNamedPipeServerSessionId(
1983 ServerSessionId
: PULONG
,
1985 pub fn SetVolumeLabelA(
1986 lpRootPathName
: LPCSTR
,
1987 lpVolumeName
: LPCSTR
,
1989 pub fn SetVolumeLabelW(
1990 lpRootPathName
: LPCWSTR
,
1991 lpVolumeName
: LPCWSTR
,
1993 pub fn SetFileBandwidthReservation(
1995 nPeriodMilliseconds
: DWORD
,
1996 nBytesPerPeriod
: DWORD
,
1998 lpTransferSize
: LPDWORD
,
1999 lpNumOutstandingRequests
: LPDWORD
,
2001 pub fn GetFileBandwidthReservation(
2003 lpPeriodMilliseconds
: LPDWORD
,
2004 lpBytesPerPeriod
: LPDWORD
,
2005 pDiscardable
: LPBOOL
,
2006 lpTransferSize
: LPDWORD
,
2007 lpNumOutstandingRequests
: LPDWORD
,
2009 // pub fn ClearEventLogA();
2010 // pub fn ClearEventLogW();
2011 // pub fn BackupEventLogA();
2012 // pub fn BackupEventLogW();
2013 // pub fn CloseEventLog();
2014 pub fn DeregisterEventSource(
2017 // pub fn NotifyChangeEventLog();
2018 // pub fn GetNumberOfEventLogRecords();
2019 // pub fn GetOldestEventLogRecord();
2020 // pub fn OpenEventLogA();
2021 // pub fn OpenEventLogW();
2022 pub fn RegisterEventSourceA(
2023 lpUNCServerName
: LPCSTR
,
2024 lpSourceName
: LPCSTR
,
2026 pub fn RegisterEventSourceW(
2027 lpUNCServerName
: LPCWSTR
,
2028 lpSourceName
: LPCWSTR
,
2030 // pub fn OpenBackupEventLogA();
2031 // pub fn OpenBackupEventLogW();
2032 // pub fn ReadEventLogA();
2033 // pub fn ReadEventLogW();
2034 pub fn ReportEventA(
2042 lpStrings
: *mut LPCSTR
,
2045 pub fn ReportEventW(
2053 lpStrings
: *mut LPCWSTR
,
2056 // pub fn GetEventLogInformation();
2057 // pub fn OperationStart();
2058 // pub fn OperationEnd();
2059 // pub fn AccessCheckAndAuditAlarmA();
2060 // pub fn AccessCheckByTypeAndAuditAlarmA();
2061 // pub fn AccessCheckByTypeResultListAndAuditAlarmA();
2062 // pub fn AccessCheckByTypeResultListAndAuditAlarmByHandleA();
2063 // pub fn ObjectOpenAuditAlarmA();
2064 // pub fn ObjectPrivilegeAuditAlarmA();
2065 // pub fn ObjectCloseAuditAlarmA();
2066 // pub fn ObjectDeleteAuditAlarmA();
2067 // pub fn PrivilegedServiceAuditAlarmA();
2068 // pub fn AddConditionalAce();
2069 // pub fn SetFileSecurityA();
2070 // pub fn GetFileSecurityA();
2071 pub fn ReadDirectoryChangesW(
2074 nBufferLength
: DWORD
,
2075 bWatchSubtree
: BOOL
,
2076 dwNotifyFilter
: DWORD
,
2077 lpBytesReturned
: LPDWORD
,
2078 lpOverlapped
: LPOVERLAPPED
,
2079 lpCompletionRoutine
: LPOVERLAPPED_COMPLETION_ROUTINE
,
2081 pub fn MapViewOfFileExNuma(
2082 hFileMappingObject
: HANDLE
,
2083 dwDesiredAccess
: DWORD
,
2084 dwFileOffsetHigh
: DWORD
,
2085 dwFileOffsetLow
: DWORD
,
2086 dwNumberOfBytesToMap
: SIZE_T
,
2087 lpBaseAddress
: LPVOID
,
2088 nndPreferred
: DWORD
,
2090 pub fn IsBadReadPtr(
2094 pub fn IsBadWritePtr(
2098 pub fn IsBadHugeReadPtr(
2102 pub fn IsBadHugeWritePtr(
2106 pub fn IsBadCodePtr(
2109 pub fn IsBadStringPtrA(
2113 pub fn IsBadStringPtrW(
2117 pub fn LookupAccountSidA(
2118 lpSystemName
: LPCSTR
,
2122 ReferencedDomainName
: LPSTR
,
2123 cchReferencedDomainName
: LPDWORD
,
2124 peUse
: PSID_NAME_USE
,
2126 pub fn LookupAccountSidW(
2127 lpSystemName
: LPCWSTR
,
2131 ReferencedDomainName
: LPWSTR
,
2132 cchReferencedDomainName
: LPDWORD
,
2133 peUse
: PSID_NAME_USE
,
2135 pub fn LookupAccountNameA(
2136 lpSystemName
: LPCSTR
,
2137 lpAccountName
: LPCSTR
,
2140 ReferencedDomainName
: LPCSTR
,
2141 cchReferencedDomainName
: LPDWORD
,
2142 peUse
: PSID_NAME_USE
,
2144 pub fn LookupAccountNameW(
2145 lpSystemName
: LPCWSTR
,
2146 lpAccountName
: LPCWSTR
,
2149 ReferencedDomainName
: LPCWSTR
,
2150 cchReferencedDomainName
: LPDWORD
,
2151 peUse
: PSID_NAME_USE
,
2153 // pub fn LookupAccountNameLocalA();
2154 // pub fn LookupAccountNameLocalW();
2155 // pub fn LookupAccountSidLocalA();
2156 // pub fn LookupAccountSidLocalW();
2157 pub fn LookupPrivilegeValueA(
2158 lpSystemName
: LPCSTR
,
2162 pub fn LookupPrivilegeValueW(
2163 lpSystemName
: LPCWSTR
,
2167 pub fn LookupPrivilegeNameA(
2168 lpSystemName
: LPCSTR
,
2173 pub fn LookupPrivilegeNameW(
2174 lpSystemName
: LPCWSTR
,
2179 // pub fn LookupPrivilegeDisplayNameA();
2180 // pub fn LookupPrivilegeDisplayNameW();
2181 pub fn BuildCommDCBA(
2185 pub fn BuildCommDCBW(
2189 pub fn BuildCommDCBAndTimeoutsA(
2192 lpCommTimeouts
: LPCOMMTIMEOUTS
,
2194 pub fn BuildCommDCBAndTimeoutsW(
2197 lpCommTimeouts
: LPCOMMTIMEOUTS
,
2199 pub fn CommConfigDialogA(
2204 pub fn CommConfigDialogW(
2209 pub fn GetDefaultCommConfigA(
2214 pub fn GetDefaultCommConfigW(
2219 pub fn SetDefaultCommConfigA(
2224 pub fn SetDefaultCommConfigW(
2229 pub fn GetComputerNameA(
2233 pub fn GetComputerNameW(
2237 pub fn DnsHostnameToComputerNameA(
2239 ComputerName
: LPCSTR
,
2242 pub fn DnsHostnameToComputerNameW(
2244 ComputerName
: LPWSTR
,
2247 pub fn GetUserNameA(
2251 pub fn GetUserNameW(
2256 pub const LOGON32_LOGON_INTERACTIVE
: DWORD
= 2;
2257 pub const LOGON32_LOGON_NETWORK
: DWORD
= 3;
2258 pub const LOGON32_LOGON_BATCH
: DWORD
= 4;
2259 pub const LOGON32_LOGON_SERVICE
: DWORD
= 5;
2260 pub const LOGON32_LOGON_UNLOCK
: DWORD
= 7;
2261 pub const LOGON32_LOGON_NETWORK_CLEARTEXT
: DWORD
= 8;
2262 pub const LOGON32_LOGON_NEW_CREDENTIALS
: DWORD
= 9;
2263 pub const LOGON32_PROVIDER_DEFAULT
: DWORD
= 0;
2264 pub const LOGON32_PROVIDER_WINNT35
: DWORD
= 1;
2265 pub const LOGON32_PROVIDER_WINNT40
: DWORD
= 2;
2266 pub const LOGON32_PROVIDER_WINNT50
: DWORD
= 3;
2267 pub const LOGON32_PROVIDER_VIRTUAL
: DWORD
= 4;
2274 dwLogonProvider
: DWORD
,
2278 lpUsername
: LPCWSTR
,
2280 lpPassword
: LPCWSTR
,
2282 dwLogonProvider
: DWORD
,
2285 pub fn LogonUserExA(
2290 dwLogonProvider
: DWORD
,
2292 ppLogonSid
: *mut PSID
,
2293 ppProfileBuffer
: *mut PVOID
,
2294 pdwProfileLength
: LPDWORD
,
2295 pQuotaLimits
: PQUOTA_LIMITS
,
2297 pub fn LogonUserExW(
2298 lpUsername
: LPCWSTR
,
2300 lpPassword
: LPCWSTR
,
2302 dwLogonProvider
: DWORD
,
2304 ppLogonSid
: *mut PSID
,
2305 ppProfileBuffer
: *mut PVOID
,
2306 pdwProfileLength
: LPDWORD
,
2307 pQuotaLimits
: PQUOTA_LIMITS
,
2309 // pub fn CreateProcessWithLogonW();
2310 // pub fn CreateProcessWithTokenW();
2311 // pub fn IsTokenUntrusted();
2312 pub fn RegisterWaitForSingleObject(
2313 phNewWaitObject
: PHANDLE
,
2315 Callback
: WAITORTIMERCALLBACK
,
2317 dwMilliseconds
: ULONG
,
2320 pub fn UnregisterWait(
2323 pub fn BindIoCompletionCallback(
2325 Function
: LPOVERLAPPED_COMPLETION_ROUTINE
,
2328 pub fn SetTimerQueueTimer(
2330 Callback
: WAITORTIMERCALLBACK
,
2336 pub fn CancelTimerQueueTimer(
2340 pub fn DeleteTimerQueue(
2343 // pub fn InitializeThreadpoolEnvironment();
2344 // pub fn SetThreadpoolCallbackPool();
2345 // pub fn SetThreadpoolCallbackCleanupGroup();
2346 // pub fn SetThreadpoolCallbackRunsLong();
2347 // pub fn SetThreadpoolCallbackLibrary();
2348 // pub fn SetThreadpoolCallbackPriority();
2349 // pub fn DestroyThreadpoolEnvironment();
2350 // pub fn SetThreadpoolCallbackPersistent();
2351 pub fn CreatePrivateNamespaceA(
2352 lpPrivateNamespaceAttributes
: LPSECURITY_ATTRIBUTES
,
2353 lpBoundaryDescriptor
: LPVOID
,
2354 lpAliasPrefix
: LPCSTR
,
2356 pub fn OpenPrivateNamespaceA(
2357 lpBoundaryDescriptor
: LPVOID
,
2358 lpAliasPrefix
: LPCSTR
,
2360 pub fn CreateBoundaryDescriptorA(
2364 pub fn AddIntegrityLabelToBoundaryDescriptor(
2365 BoundaryDescriptor
: *mut HANDLE
,
2366 IntegrityLabel
: PSID
,
2369 pub const HW_PROFILE_GUIDLEN
: usize = 39;
2371 pub const DOCKINFO_UNDOCKED
: DWORD
= 0x1;
2372 pub const DOCKINFO_DOCKED
: DWORD
= 0x2;
2373 pub const DOCKINFO_USER_SUPPLIED
: DWORD
= 0x4;
2374 pub const DOCKINFO_USER_UNDOCKED
: DWORD
= DOCKINFO_USER_SUPPLIED
| DOCKINFO_UNDOCKED
;
2375 pub const DOCKINFO_USER_DOCKED
: DWORD
= DOCKINFO_USER_SUPPLIED
| DOCKINFO_DOCKED
;
2376 STRUCT
!{struct HW_PROFILE_INFOA
{
2378 szHwProfileGuid
: [CHAR
; HW_PROFILE_GUIDLEN
],
2379 szHwProfileName
: [CHAR
; MAX_PROFILE_LEN
],
2381 pub type LPHW_PROFILE_INFOA
= *mut HW_PROFILE_INFOA
;
2382 STRUCT
!{struct HW_PROFILE_INFOW
{
2384 szHwProfileGuid
: [WCHAR
; HW_PROFILE_GUIDLEN
],
2385 szHwProfileName
: [WCHAR
; MAX_PROFILE_LEN
],
2387 pub type LPHW_PROFILE_INFOW
= *mut HW_PROFILE_INFOW
;
2389 pub fn GetCurrentHwProfileA(
2390 lpHwProfileInfo
: LPHW_PROFILE_INFOA
,
2392 pub fn GetCurrentHwProfileW(
2393 lpHwProfileInfo
: LPHW_PROFILE_INFOW
,
2395 pub fn VerifyVersionInfoA(
2396 lpVersionInformation
: LPOSVERSIONINFOEXA
,
2398 dwlConditionMask
: DWORDLONG
,
2400 pub fn VerifyVersionInfoW(
2401 lpVersionInformation
: LPOSVERSIONINFOEXW
,
2403 dwlConditionMask
: DWORDLONG
,
2406 STRUCT
!{struct SYSTEM_POWER_STATUS
{
2409 BatteryLifePercent
: BYTE
,
2411 BatteryLifeTime
: DWORD
,
2412 BatteryFullLifeTime
: DWORD
,
2414 pub type LPSYSTEM_POWER_STATUS
= *mut SYSTEM_POWER_STATUS
;
2416 pub fn GetSystemPowerStatus(
2417 lpSystemPowerStatus
: LPSYSTEM_POWER_STATUS
,
2419 pub fn SetSystemPowerState(
2423 pub fn MapUserPhysicalPagesScatter(
2424 VirtualAddresses
: *mut PVOID
,
2425 NumberOfPages
: ULONG_PTR
,
2426 PageArray
: PULONG_PTR
,
2428 pub fn CreateJobObjectA(
2429 lpJobAttributes
: LPSECURITY_ATTRIBUTES
,
2432 pub fn OpenJobObjectA(
2433 dwDesiredAccess
: DWORD
,
2434 bInheritHandle
: BOOL
,
2437 pub fn CreateJobSet(
2439 UserJobSet
: PJOB_SET_ARRAY
,
2442 pub fn FindFirstVolumeA(
2443 lpszVolumeName
: LPSTR
,
2444 cchBufferLength
: DWORD
,
2446 pub fn FindNextVolumeA(
2447 hFindVolume
: HANDLE
,
2448 lpszVolumeName
: LPSTR
,
2449 cchBufferLength
: DWORD
,
2451 pub fn FindFirstVolumeMountPointA(
2452 lpszRootPathName
: LPCSTR
,
2453 lpszVolumeMountPoint
: LPSTR
,
2454 cchBufferLength
: DWORD
,
2456 pub fn FindFirstVolumeMountPointW(
2457 lpszRootPathName
: LPCWSTR
,
2458 lpszVolumeMountPoint
: LPWSTR
,
2459 cchBufferLength
: DWORD
,
2461 pub fn FindNextVolumeMountPointA(
2462 hFindVolumeMountPoint
: HANDLE
,
2463 lpszVolumeMountPoint
: LPSTR
,
2464 cchBufferLength
: DWORD
,
2466 pub fn FindNextVolumeMountPointW(
2467 hFindVolumeMountPoint
: HANDLE
,
2468 lpszVolumeMountPoint
: LPWSTR
,
2469 cchBufferLength
: DWORD
,
2471 pub fn FindVolumeMountPointClose(
2472 hFindVolumeMountPoint
: HANDLE
,
2474 pub fn SetVolumeMountPointA(
2475 lpszVolumeMountPoint
: LPCSTR
,
2476 lpszVolumeName
: LPCSTR
,
2478 pub fn SetVolumeMountPointW(
2479 lpszVolumeMountPoint
: LPCWSTR
,
2480 lpszVolumeName
: LPCWSTR
,
2482 pub fn DeleteVolumeMountPointA(
2483 lpszVolumeMountPoint
: LPCSTR
,
2485 pub fn GetVolumeNameForVolumeMountPointA(
2486 lpszVolumeMountPoint
: LPCSTR
,
2487 lpszVolumeName
: LPSTR
,
2488 cchBufferLength
: DWORD
,
2490 pub fn GetVolumePathNameA(
2491 lpszFileName
: LPCSTR
,
2492 lpszVolumePathName
: LPSTR
,
2493 cchBufferLength
: DWORD
,
2495 pub fn GetVolumePathNamesForVolumeNameA(
2496 lpszVolumeName
: LPCSTR
,
2497 lpszVolumePathNames
: LPCH
,
2498 cchBufferLength
: DWORD
,
2499 lpcchReturnLength
: PDWORD
,
2503 STRUCT
!{struct ACTCTXA
{
2507 wProcessorArchitecture
: USHORT
,
2509 lpAssemblyDirectory
: LPCSTR
,
2510 lpResourceName
: LPCSTR
,
2511 lpApplicationName
: LPCSTR
,
2514 pub type PACTCTXA
= *mut ACTCTXA
;
2515 STRUCT
!{struct ACTCTXW
{
2519 wProcessorArchitecture
: USHORT
,
2521 lpAssemblyDirectory
: LPCWSTR
,
2522 lpResourceName
: LPCWSTR
,
2523 lpApplicationName
: LPCWSTR
,
2526 pub type PACTCTXW
= *mut ACTCTXW
;
2527 pub type PCACTCTXA
= *const ACTCTXA
;
2528 pub type PCACTCTXW
= *const ACTCTXW
;
2530 pub fn CreateActCtxA(
2533 pub fn CreateActCtxW(
2536 pub fn AddRefActCtx(
2539 pub fn ReleaseActCtx(
2542 pub fn ZombifyActCtx(
2545 pub fn ActivateActCtx(
2547 lpCookie
: *mut ULONG_PTR
,
2549 pub fn DeactivateActCtx(
2551 ulCookie
: ULONG_PTR
,
2553 pub fn GetCurrentActCtx(
2554 lphActCtx
: *mut HANDLE
,
2557 STRUCT
!{struct ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA
{
2558 lpInformation
: PVOID
,
2559 lpSectionBase
: PVOID
,
2560 ulSectionLength
: ULONG
,
2561 lpSectionGlobalDataBase
: PVOID
,
2562 ulSectionGlobalDataLength
: ULONG
,
2564 pub type PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA
=
2565 *mut ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA
;
2566 pub type PCACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA
=
2567 *const ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA
;
2568 STRUCT
!{struct ACTCTX_SECTION_KEYED_DATA
{
2570 ulDataFormatVersion
: ULONG
,
2573 lpSectionGlobalData
: PVOID
,
2574 ulSectionGlobalDataLength
: ULONG
,
2575 lpSectionBase
: PVOID
,
2576 ulSectionTotalLength
: ULONG
,
2578 ulAssemblyRosterIndex
: ULONG
,
2580 AssemblyMetadata
: ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA
,
2582 pub type PACTCTX_SECTION_KEYED_DATA
= *mut ACTCTX_SECTION_KEYED_DATA
;
2583 pub type PCACTCTX_SECTION_KEYED_DATA
= *const ACTCTX_SECTION_KEYED_DATA
;
2585 pub fn FindActCtxSectionStringA(
2587 lpExtensionGuid
: *const GUID
,
2589 lpStringToFind
: LPCSTR
,
2590 ReturnedData
: PACTCTX_SECTION_KEYED_DATA
,
2592 pub fn FindActCtxSectionStringW(
2594 lpExtensionGuid
: *const GUID
,
2596 lpStringToFind
: LPCWSTR
,
2597 ReturnedData
: PACTCTX_SECTION_KEYED_DATA
,
2599 pub fn FindActCtxSectionGuid(
2601 lpExtensionGuid
: *const GUID
,
2603 lpGuidToFind
: *const GUID
,
2604 ReturnedData
: PACTCTX_SECTION_KEYED_DATA
,
2606 pub fn QueryActCtxW(
2609 pvSubInstance
: PVOID
,
2613 pcbWrittenOrRequired
: *mut SIZE_T
,
2615 pub fn WTSGetActiveConsoleSessionId() -> DWORD
;
2616 // pub fn WTSGetServiceSessionId();
2617 // pub fn WTSIsServerContainer();
2618 pub fn GetActiveProcessorGroupCount() -> WORD
;
2619 pub fn GetMaximumProcessorGroupCount() -> WORD
;
2620 pub fn GetActiveProcessorCount(
2623 pub fn GetMaximumProcessorCount(
2626 pub fn GetNumaProcessorNode(
2630 pub fn GetNumaNodeNumberFromHandle(
2632 NodeNumber
: PUSHORT
,
2634 pub fn GetNumaProcessorNodeEx(
2635 Processor
: PPROCESSOR_NUMBER
,
2636 NodeNumber
: PUSHORT
,
2638 pub fn GetNumaNodeProcessorMask(
2640 ProcessorMask
: PULONGLONG
,
2642 pub fn GetNumaAvailableMemoryNode(
2644 AvailableBytes
: PULONGLONG
,
2646 pub fn GetNumaAvailableMemoryNodeEx(
2648 AvailableBytes
: PULONGLONG
,
2650 pub fn GetNumaProximityNode(
2655 FN
!{stdcall
APPLICATION_RECOVERY_CALLBACK(
2661 pub fn RegisterApplicationRecoveryCallback(
2662 pRecoveyCallback
: APPLICATION_RECOVERY_CALLBACK
,
2664 dwPingInterval
: DWORD
,
2667 pub fn UnregisterApplicationRecoveryCallback() -> HRESULT
;
2668 pub fn RegisterApplicationRestart(
2669 pwzCommandline
: PCWSTR
,
2672 pub fn UnregisterApplicationRestart() -> HRESULT
;
2673 pub fn GetApplicationRecoveryCallback(
2675 pRecoveryCallback
: *mut APPLICATION_RECOVERY_CALLBACK
,
2676 ppvParameter
: *mut PVOID
,
2677 pdwPingInterval
: PDWORD
,
2680 pub fn GetApplicationRestartSettings(
2682 pwzCommandline
: PWSTR
,
2686 pub fn ApplicationRecoveryInProgress(
2689 pub fn ApplicationRecoveryFinished(
2693 // FILE_BASIC_INFO, etc.
2695 pub fn GetFileInformationByHandleEx(
2697 FileInformationClass
: FILE_INFO_BY_HANDLE_CLASS
,
2698 lpFileInformation
: LPVOID
,
2699 dwBufferSize
: DWORD
,
2702 ENUM
!{enum FILE_ID_TYPE
{
2708 UNION
!{union FILE_ID_DESCRIPTOR_u
{
2710 FileId FileId_mut
: LARGE_INTEGER
,
2711 ObjectId ObjectId_mut
: GUID
,
2712 ExtendedFileId ExtendedFileId_mut
: FILE_ID_128
,
2714 STRUCT
!{struct FILE_ID_DESCRIPTOR
{
2717 u
: FILE_ID_DESCRIPTOR_u
,
2719 pub type LPFILE_ID_DESCRIPTOR
= *mut FILE_ID_DESCRIPTOR
;
2721 pub fn OpenFileById(
2722 hVolumeHint
: HANDLE
,
2723 lpFileId
: LPFILE_ID_DESCRIPTOR
,
2724 dwDesiredAccess
: DWORD
,
2726 lpSecurityAttributes
: LPSECURITY_ATTRIBUTES
,
2727 dwFlagsAndAttributes
: DWORD
,
2729 pub fn CreateSymbolicLinkA(
2730 lpSymlinkFileName
: LPCSTR
,
2731 lpTargetFileName
: LPCSTR
,
2734 pub fn CreateSymbolicLinkW(
2735 lpSymlinkFileName
: LPCWSTR
,
2736 lpTargetFileName
: LPCWSTR
,
2739 pub fn QueryActCtxSettingsW(
2742 settingsNameSpace
: PCWSTR
,
2743 settingName
: PCWSTR
,
2746 pdwWrittenOrRequired
: *mut SIZE_T
,
2748 pub fn CreateSymbolicLinkTransactedA(
2749 lpSymlinkFileName
: LPCSTR
,
2750 lpTargetFileName
: LPCSTR
,
2752 hTransaction
: HANDLE
,
2754 pub fn CreateSymbolicLinkTransactedW(
2755 lpSymlinkFileName
: LPCWSTR
,
2756 lpTargetFileName
: LPCWSTR
,
2758 hTransaction
: HANDLE
,
2760 pub fn ReplacePartitionUnit(
2761 TargetPartition
: PWSTR
,
2762 SparePartition
: PWSTR
,
2765 pub fn AddSecureMemoryCacheCallback(
2766 pfnCallBack
: PSECURE_MEMORY_CACHE_CALLBACK
,
2768 pub fn RemoveSecureMemoryCacheCallback(
2769 pfnCallBack
: PSECURE_MEMORY_CACHE_CALLBACK
,
2772 Destination
: PCONTEXT
,
2773 ContextFlags
: DWORD
,
2776 pub fn InitializeContext(
2778 ContextFlags
: DWORD
,
2779 Context
: *mut PCONTEXT
,
2780 ContextLength
: PDWORD
,
2782 pub fn GetEnabledXStateFeatures() -> DWORD64
;
2783 pub fn GetXStateFeaturesMask(
2785 FeatureMask
: PDWORD64
,
2787 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
2788 pub fn LocateXStateFeature(
2793 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
2794 pub fn SetXStateFeaturesMask(
2796 FeatureMask
: DWORD64
,
2798 pub fn EnableThreadProfiling(
2799 ThreadHandle
: HANDLE
,
2801 HardwareCounters
: DWORD64
,
2802 PerformanceDataHandle
: *mut HANDLE
,
2804 pub fn DisableThreadProfiling(
2805 PerformanceDataHandle
: HANDLE
,
2807 pub fn QueryThreadProfiling(
2808 ThreadHandle
: HANDLE
,
2811 pub fn ReadThreadProfilingData(
2812 PerformanceDataHandle
: HANDLE
,
2814 PerformanceData
: PPERFORMANCE_DATA
,
2816 // intrinsic InterlockedIncrement
2817 // intrinsic InterlockedDecrement
2818 // intrinsic InterlockedExchange
2819 // intrinsic InterlockedExchangeAdd
2820 // intrinsic InterlockedExchangeSubtract
2821 // intrinsic InterlockedCompareExchange
2822 // intrinsic InterlockedAnd
2823 // intrinsic InterlockedOr
2824 // intrinsic InterlockedXor