Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10733 lines
214 KiB

  1. /************************************************************************
  2. * *
  3. * winbase.h -- This module defines the 32-Bit Windows Base APIs *
  4. * *
  5. * Copyright (c) Microsoft Corp. All rights reserved. *
  6. * *
  7. ************************************************************************/
  8. #ifndef _WINBASE_
  9. #define _WINBASE_
  10. #if _MSC_VER > 1000
  11. #pragma once
  12. #endif
  13. #ifdef _MAC
  14. #include <macwin32.h>
  15. #endif //_MAC
  16. //
  17. // Define API decoration for direct importing of DLL references.
  18. //
  19. #if !defined(_ADVAPI32_)
  20. #define WINADVAPI DECLSPEC_IMPORT
  21. #else
  22. #define WINADVAPI
  23. #endif
  24. #if !defined(_KERNEL32_)
  25. #define WINBASEAPI DECLSPEC_IMPORT
  26. #else
  27. #define WINBASEAPI
  28. #endif
  29. #if !defined(_ZAWPROXY_)
  30. #define ZAWPROXYAPI DECLSPEC_IMPORT
  31. #else
  32. #define ZAWPROXYAPI
  33. #endif
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37. /*
  38. * Compatibility macros
  39. */
  40. #define DefineHandleTable(w) ((w),TRUE)
  41. #define LimitEmsPages(dw)
  42. #define SetSwapAreaSize(w) (w)
  43. #define LockSegment(w) GlobalFix((HANDLE)(w))
  44. #define UnlockSegment(w) GlobalUnfix((HANDLE)(w))
  45. #define GetCurrentTime() GetTickCount()
  46. #define Yield()
  47. #define INVALID_HANDLE_VALUE ((HANDLE)(LONG_PTR)-1)
  48. #define INVALID_FILE_SIZE ((DWORD)0xFFFFFFFF)
  49. #define INVALID_SET_FILE_POINTER ((DWORD)-1)
  50. #define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
  51. #define FILE_BEGIN 0
  52. #define FILE_CURRENT 1
  53. #define FILE_END 2
  54. #define TIME_ZONE_ID_INVALID ((DWORD)0xFFFFFFFF)
  55. #define WAIT_FAILED ((DWORD)0xFFFFFFFF)
  56. #define WAIT_OBJECT_0 ((STATUS_WAIT_0 ) + 0 )
  57. #define WAIT_ABANDONED ((STATUS_ABANDONED_WAIT_0 ) + 0 )
  58. #define WAIT_ABANDONED_0 ((STATUS_ABANDONED_WAIT_0 ) + 0 )
  59. #define WAIT_IO_COMPLETION STATUS_USER_APC
  60. #define STILL_ACTIVE STATUS_PENDING
  61. #define EXCEPTION_ACCESS_VIOLATION STATUS_ACCESS_VIOLATION
  62. #define EXCEPTION_DATATYPE_MISALIGNMENT STATUS_DATATYPE_MISALIGNMENT
  63. #define EXCEPTION_BREAKPOINT STATUS_BREAKPOINT
  64. #define EXCEPTION_SINGLE_STEP STATUS_SINGLE_STEP
  65. #define EXCEPTION_ARRAY_BOUNDS_EXCEEDED STATUS_ARRAY_BOUNDS_EXCEEDED
  66. #define EXCEPTION_FLT_DENORMAL_OPERAND STATUS_FLOAT_DENORMAL_OPERAND
  67. #define EXCEPTION_FLT_DIVIDE_BY_ZERO STATUS_FLOAT_DIVIDE_BY_ZERO
  68. #define EXCEPTION_FLT_INEXACT_RESULT STATUS_FLOAT_INEXACT_RESULT
  69. #define EXCEPTION_FLT_INVALID_OPERATION STATUS_FLOAT_INVALID_OPERATION
  70. #define EXCEPTION_FLT_OVERFLOW STATUS_FLOAT_OVERFLOW
  71. #define EXCEPTION_FLT_STACK_CHECK STATUS_FLOAT_STACK_CHECK
  72. #define EXCEPTION_FLT_UNDERFLOW STATUS_FLOAT_UNDERFLOW
  73. #define EXCEPTION_INT_DIVIDE_BY_ZERO STATUS_INTEGER_DIVIDE_BY_ZERO
  74. #define EXCEPTION_INT_OVERFLOW STATUS_INTEGER_OVERFLOW
  75. #define EXCEPTION_PRIV_INSTRUCTION STATUS_PRIVILEGED_INSTRUCTION
  76. #define EXCEPTION_IN_PAGE_ERROR STATUS_IN_PAGE_ERROR
  77. #define EXCEPTION_ILLEGAL_INSTRUCTION STATUS_ILLEGAL_INSTRUCTION
  78. #define EXCEPTION_NONCONTINUABLE_EXCEPTION STATUS_NONCONTINUABLE_EXCEPTION
  79. #define EXCEPTION_STACK_OVERFLOW STATUS_STACK_OVERFLOW
  80. #define EXCEPTION_INVALID_DISPOSITION STATUS_INVALID_DISPOSITION
  81. #define EXCEPTION_GUARD_PAGE STATUS_GUARD_PAGE_VIOLATION
  82. #define EXCEPTION_INVALID_HANDLE STATUS_INVALID_HANDLE
  83. #define EXCEPTION_POSSIBLE_DEADLOCK STATUS_POSSIBLE_DEADLOCK
  84. #define CONTROL_C_EXIT STATUS_CONTROL_C_EXIT
  85. #define MoveMemory RtlMoveMemory
  86. #define CopyMemory RtlCopyMemory
  87. #define FillMemory RtlFillMemory
  88. #define ZeroMemory RtlZeroMemory
  89. #define SecureZeroMemory RtlSecureZeroMemory
  90. //
  91. // File creation flags must start at the high end since they
  92. // are combined with the attributes
  93. //
  94. #define FILE_FLAG_WRITE_THROUGH 0x80000000
  95. #define FILE_FLAG_OVERLAPPED 0x40000000
  96. #define FILE_FLAG_NO_BUFFERING 0x20000000
  97. #define FILE_FLAG_RANDOM_ACCESS 0x10000000
  98. #define FILE_FLAG_SEQUENTIAL_SCAN 0x08000000
  99. #define FILE_FLAG_DELETE_ON_CLOSE 0x04000000
  100. #define FILE_FLAG_BACKUP_SEMANTICS 0x02000000
  101. #define FILE_FLAG_POSIX_SEMANTICS 0x01000000
  102. #define FILE_FLAG_OPEN_REPARSE_POINT 0x00200000
  103. #define FILE_FLAG_OPEN_NO_RECALL 0x00100000
  104. #define FILE_FLAG_FIRST_PIPE_INSTANCE 0x00080000
  105. #define CREATE_NEW 1
  106. #define CREATE_ALWAYS 2
  107. #define OPEN_EXISTING 3
  108. #define OPEN_ALWAYS 4
  109. #define TRUNCATE_EXISTING 5
  110. #if(_WIN32_WINNT >= 0x0400)
  111. //
  112. // Define possible return codes from the CopyFileEx callback routine
  113. //
  114. #define PROGRESS_CONTINUE 0
  115. #define PROGRESS_CANCEL 1
  116. #define PROGRESS_STOP 2
  117. #define PROGRESS_QUIET 3
  118. //
  119. // Define CopyFileEx callback routine state change values
  120. //
  121. #define CALLBACK_CHUNK_FINISHED 0x00000000
  122. #define CALLBACK_STREAM_SWITCH 0x00000001
  123. //
  124. // Define CopyFileEx option flags
  125. //
  126. #define COPY_FILE_FAIL_IF_EXISTS 0x00000001
  127. #define COPY_FILE_RESTARTABLE 0x00000002
  128. #define COPY_FILE_OPEN_SOURCE_FOR_WRITE 0x00000004
  129. #define COPY_FILE_ALLOW_DECRYPTED_DESTINATION 0x00000008
  130. #endif /* _WIN32_WINNT >= 0x0400 */
  131. #if (_WIN32_WINNT >= 0x0500)
  132. //
  133. // Define ReplaceFile option flags
  134. //
  135. #define REPLACEFILE_WRITE_THROUGH 0x00000001
  136. #define REPLACEFILE_IGNORE_MERGE_ERRORS 0x00000002
  137. #endif // #if (_WIN32_WINNT >= 0x0500)
  138. //
  139. // Define the NamedPipe definitions
  140. //
  141. //
  142. // Define the dwOpenMode values for CreateNamedPipe
  143. //
  144. #define PIPE_ACCESS_INBOUND 0x00000001
  145. #define PIPE_ACCESS_OUTBOUND 0x00000002
  146. #define PIPE_ACCESS_DUPLEX 0x00000003
  147. //
  148. // Define the Named Pipe End flags for GetNamedPipeInfo
  149. //
  150. #define PIPE_CLIENT_END 0x00000000
  151. #define PIPE_SERVER_END 0x00000001
  152. //
  153. // Define the dwPipeMode values for CreateNamedPipe
  154. //
  155. #define PIPE_WAIT 0x00000000
  156. #define PIPE_NOWAIT 0x00000001
  157. #define PIPE_READMODE_BYTE 0x00000000
  158. #define PIPE_READMODE_MESSAGE 0x00000002
  159. #define PIPE_TYPE_BYTE 0x00000000
  160. #define PIPE_TYPE_MESSAGE 0x00000004
  161. //
  162. // Define the well known values for CreateNamedPipe nMaxInstances
  163. //
  164. #define PIPE_UNLIMITED_INSTANCES 255
  165. //
  166. // Define the Security Quality of Service bits to be passed
  167. // into CreateFile
  168. //
  169. #define SECURITY_ANONYMOUS ( SecurityAnonymous << 16 )
  170. #define SECURITY_IDENTIFICATION ( SecurityIdentification << 16 )
  171. #define SECURITY_IMPERSONATION ( SecurityImpersonation << 16 )
  172. #define SECURITY_DELEGATION ( SecurityDelegation << 16 )
  173. #define SECURITY_CONTEXT_TRACKING 0x00040000
  174. #define SECURITY_EFFECTIVE_ONLY 0x00080000
  175. #define SECURITY_SQOS_PRESENT 0x00100000
  176. #define SECURITY_VALID_SQOS_FLAGS 0x001F0000
  177. //
  178. // File structures
  179. //
  180. typedef struct _OVERLAPPED {
  181. ULONG_PTR Internal;
  182. ULONG_PTR InternalHigh;
  183. union {
  184. struct {
  185. DWORD Offset;
  186. DWORD OffsetHigh;
  187. };
  188. PVOID Pointer;
  189. };
  190. HANDLE hEvent;
  191. } OVERLAPPED, *LPOVERLAPPED;
  192. typedef struct _SECURITY_ATTRIBUTES {
  193. DWORD nLength;
  194. LPVOID lpSecurityDescriptor;
  195. BOOL bInheritHandle;
  196. } SECURITY_ATTRIBUTES, *PSECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;
  197. typedef struct _PROCESS_INFORMATION {
  198. HANDLE hProcess;
  199. HANDLE hThread;
  200. DWORD dwProcessId;
  201. DWORD dwThreadId;
  202. } PROCESS_INFORMATION, *PPROCESS_INFORMATION, *LPPROCESS_INFORMATION;
  203. //
  204. // File System time stamps are represented with the following structure:
  205. //
  206. #ifndef _FILETIME_
  207. #define _FILETIME_
  208. typedef struct _FILETIME {
  209. DWORD dwLowDateTime;
  210. DWORD dwHighDateTime;
  211. } FILETIME, *PFILETIME, *LPFILETIME;
  212. #endif
  213. //
  214. // System time is represented with the following structure:
  215. //
  216. typedef struct _SYSTEMTIME {
  217. WORD wYear;
  218. WORD wMonth;
  219. WORD wDayOfWeek;
  220. WORD wDay;
  221. WORD wHour;
  222. WORD wMinute;
  223. WORD wSecond;
  224. WORD wMilliseconds;
  225. } SYSTEMTIME, *PSYSTEMTIME, *LPSYSTEMTIME;
  226. typedef DWORD (WINAPI *PTHREAD_START_ROUTINE)(
  227. LPVOID lpThreadParameter
  228. );
  229. typedef PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE;
  230. #if(_WIN32_WINNT >= 0x0400)
  231. typedef VOID (WINAPI *PFIBER_START_ROUTINE)(
  232. LPVOID lpFiberParameter
  233. );
  234. typedef PFIBER_START_ROUTINE LPFIBER_START_ROUTINE;
  235. #endif /* _WIN32_WINNT >= 0x0400 */
  236. typedef RTL_CRITICAL_SECTION CRITICAL_SECTION;
  237. typedef PRTL_CRITICAL_SECTION PCRITICAL_SECTION;
  238. typedef PRTL_CRITICAL_SECTION LPCRITICAL_SECTION;
  239. typedef RTL_CRITICAL_SECTION_DEBUG CRITICAL_SECTION_DEBUG;
  240. typedef PRTL_CRITICAL_SECTION_DEBUG PCRITICAL_SECTION_DEBUG;
  241. typedef PRTL_CRITICAL_SECTION_DEBUG LPCRITICAL_SECTION_DEBUG;
  242. #if defined(_X86_)
  243. typedef PLDT_ENTRY LPLDT_ENTRY;
  244. #else
  245. typedef LPVOID LPLDT_ENTRY;
  246. #endif
  247. #define MUTEX_MODIFY_STATE MUTANT_QUERY_STATE
  248. #define MUTEX_ALL_ACCESS MUTANT_ALL_ACCESS
  249. //
  250. // Serial provider type.
  251. //
  252. #define SP_SERIALCOMM ((DWORD)0x00000001)
  253. //
  254. // Provider SubTypes
  255. //
  256. #define PST_UNSPECIFIED ((DWORD)0x00000000)
  257. #define PST_RS232 ((DWORD)0x00000001)
  258. #define PST_PARALLELPORT ((DWORD)0x00000002)
  259. #define PST_RS422 ((DWORD)0x00000003)
  260. #define PST_RS423 ((DWORD)0x00000004)
  261. #define PST_RS449 ((DWORD)0x00000005)
  262. #define PST_MODEM ((DWORD)0x00000006)
  263. #define PST_FAX ((DWORD)0x00000021)
  264. #define PST_SCANNER ((DWORD)0x00000022)
  265. #define PST_NETWORK_BRIDGE ((DWORD)0x00000100)
  266. #define PST_LAT ((DWORD)0x00000101)
  267. #define PST_TCPIP_TELNET ((DWORD)0x00000102)
  268. #define PST_X25 ((DWORD)0x00000103)
  269. //
  270. // Provider capabilities flags.
  271. //
  272. #define PCF_DTRDSR ((DWORD)0x0001)
  273. #define PCF_RTSCTS ((DWORD)0x0002)
  274. #define PCF_RLSD ((DWORD)0x0004)
  275. #define PCF_PARITY_CHECK ((DWORD)0x0008)
  276. #define PCF_XONXOFF ((DWORD)0x0010)
  277. #define PCF_SETXCHAR ((DWORD)0x0020)
  278. #define PCF_TOTALTIMEOUTS ((DWORD)0x0040)
  279. #define PCF_INTTIMEOUTS ((DWORD)0x0080)
  280. #define PCF_SPECIALCHARS ((DWORD)0x0100)
  281. #define PCF_16BITMODE ((DWORD)0x0200)
  282. //
  283. // Comm provider settable parameters.
  284. //
  285. #define SP_PARITY ((DWORD)0x0001)
  286. #define SP_BAUD ((DWORD)0x0002)
  287. #define SP_DATABITS ((DWORD)0x0004)
  288. #define SP_STOPBITS ((DWORD)0x0008)
  289. #define SP_HANDSHAKING ((DWORD)0x0010)
  290. #define SP_PARITY_CHECK ((DWORD)0x0020)
  291. #define SP_RLSD ((DWORD)0x0040)
  292. //
  293. // Settable baud rates in the provider.
  294. //
  295. #define BAUD_075 ((DWORD)0x00000001)
  296. #define BAUD_110 ((DWORD)0x00000002)
  297. #define BAUD_134_5 ((DWORD)0x00000004)
  298. #define BAUD_150 ((DWORD)0x00000008)
  299. #define BAUD_300 ((DWORD)0x00000010)
  300. #define BAUD_600 ((DWORD)0x00000020)
  301. #define BAUD_1200 ((DWORD)0x00000040)
  302. #define BAUD_1800 ((DWORD)0x00000080)
  303. #define BAUD_2400 ((DWORD)0x00000100)
  304. #define BAUD_4800 ((DWORD)0x00000200)
  305. #define BAUD_7200 ((DWORD)0x00000400)
  306. #define BAUD_9600 ((DWORD)0x00000800)
  307. #define BAUD_14400 ((DWORD)0x00001000)
  308. #define BAUD_19200 ((DWORD)0x00002000)
  309. #define BAUD_38400 ((DWORD)0x00004000)
  310. #define BAUD_56K ((DWORD)0x00008000)
  311. #define BAUD_128K ((DWORD)0x00010000)
  312. #define BAUD_115200 ((DWORD)0x00020000)
  313. #define BAUD_57600 ((DWORD)0x00040000)
  314. #define BAUD_USER ((DWORD)0x10000000)
  315. //
  316. // Settable Data Bits
  317. //
  318. #define DATABITS_5 ((WORD)0x0001)
  319. #define DATABITS_6 ((WORD)0x0002)
  320. #define DATABITS_7 ((WORD)0x0004)
  321. #define DATABITS_8 ((WORD)0x0008)
  322. #define DATABITS_16 ((WORD)0x0010)
  323. #define DATABITS_16X ((WORD)0x0020)
  324. //
  325. // Settable Stop and Parity bits.
  326. //
  327. #define STOPBITS_10 ((WORD)0x0001)
  328. #define STOPBITS_15 ((WORD)0x0002)
  329. #define STOPBITS_20 ((WORD)0x0004)
  330. #define PARITY_NONE ((WORD)0x0100)
  331. #define PARITY_ODD ((WORD)0x0200)
  332. #define PARITY_EVEN ((WORD)0x0400)
  333. #define PARITY_MARK ((WORD)0x0800)
  334. #define PARITY_SPACE ((WORD)0x1000)
  335. typedef struct _COMMPROP {
  336. WORD wPacketLength;
  337. WORD wPacketVersion;
  338. DWORD dwServiceMask;
  339. DWORD dwReserved1;
  340. DWORD dwMaxTxQueue;
  341. DWORD dwMaxRxQueue;
  342. DWORD dwMaxBaud;
  343. DWORD dwProvSubType;
  344. DWORD dwProvCapabilities;
  345. DWORD dwSettableParams;
  346. DWORD dwSettableBaud;
  347. WORD wSettableData;
  348. WORD wSettableStopParity;
  349. DWORD dwCurrentTxQueue;
  350. DWORD dwCurrentRxQueue;
  351. DWORD dwProvSpec1;
  352. DWORD dwProvSpec2;
  353. WCHAR wcProvChar[1];
  354. } COMMPROP,*LPCOMMPROP;
  355. //
  356. // Set dwProvSpec1 to COMMPROP_INITIALIZED to indicate that wPacketLength
  357. // is valid before a call to GetCommProperties().
  358. //
  359. #define COMMPROP_INITIALIZED ((DWORD)0xE73CF52E)
  360. typedef struct _COMSTAT {
  361. DWORD fCtsHold : 1;
  362. DWORD fDsrHold : 1;
  363. DWORD fRlsdHold : 1;
  364. DWORD fXoffHold : 1;
  365. DWORD fXoffSent : 1;
  366. DWORD fEof : 1;
  367. DWORD fTxim : 1;
  368. DWORD fReserved : 25;
  369. DWORD cbInQue;
  370. DWORD cbOutQue;
  371. } COMSTAT, *LPCOMSTAT;
  372. //
  373. // DTR Control Flow Values.
  374. //
  375. #define DTR_CONTROL_DISABLE 0x00
  376. #define DTR_CONTROL_ENABLE 0x01
  377. #define DTR_CONTROL_HANDSHAKE 0x02
  378. //
  379. // RTS Control Flow Values
  380. //
  381. #define RTS_CONTROL_DISABLE 0x00
  382. #define RTS_CONTROL_ENABLE 0x01
  383. #define RTS_CONTROL_HANDSHAKE 0x02
  384. #define RTS_CONTROL_TOGGLE 0x03
  385. typedef struct _DCB {
  386. DWORD DCBlength; /* sizeof(DCB) */
  387. DWORD BaudRate; /* Baudrate at which running */
  388. DWORD fBinary: 1; /* Binary Mode (skip EOF check) */
  389. DWORD fParity: 1; /* Enable parity checking */
  390. DWORD fOutxCtsFlow:1; /* CTS handshaking on output */
  391. DWORD fOutxDsrFlow:1; /* DSR handshaking on output */
  392. DWORD fDtrControl:2; /* DTR Flow control */
  393. DWORD fDsrSensitivity:1; /* DSR Sensitivity */
  394. DWORD fTXContinueOnXoff: 1; /* Continue TX when Xoff sent */
  395. DWORD fOutX: 1; /* Enable output X-ON/X-OFF */
  396. DWORD fInX: 1; /* Enable input X-ON/X-OFF */
  397. DWORD fErrorChar: 1; /* Enable Err Replacement */
  398. DWORD fNull: 1; /* Enable Null stripping */
  399. DWORD fRtsControl:2; /* Rts Flow control */
  400. DWORD fAbortOnError:1; /* Abort all reads and writes on Error */
  401. DWORD fDummy2:17; /* Reserved */
  402. WORD wReserved; /* Not currently used */
  403. WORD XonLim; /* Transmit X-ON threshold */
  404. WORD XoffLim; /* Transmit X-OFF threshold */
  405. BYTE ByteSize; /* Number of bits/byte, 4-8 */
  406. BYTE Parity; /* 0-4=None,Odd,Even,Mark,Space */
  407. BYTE StopBits; /* 0,1,2 = 1, 1.5, 2 */
  408. char XonChar; /* Tx and Rx X-ON character */
  409. char XoffChar; /* Tx and Rx X-OFF character */
  410. char ErrorChar; /* Error replacement char */
  411. char EofChar; /* End of Input character */
  412. char EvtChar; /* Received Event character */
  413. WORD wReserved1; /* Fill for now. */
  414. } DCB, *LPDCB;
  415. typedef struct _COMMTIMEOUTS {
  416. DWORD ReadIntervalTimeout; /* Maximum time between read chars. */
  417. DWORD ReadTotalTimeoutMultiplier; /* Multiplier of characters. */
  418. DWORD ReadTotalTimeoutConstant; /* Constant in milliseconds. */
  419. DWORD WriteTotalTimeoutMultiplier; /* Multiplier of characters. */
  420. DWORD WriteTotalTimeoutConstant; /* Constant in milliseconds. */
  421. } COMMTIMEOUTS,*LPCOMMTIMEOUTS;
  422. typedef struct _COMMCONFIG {
  423. DWORD dwSize; /* Size of the entire struct */
  424. WORD wVersion; /* version of the structure */
  425. WORD wReserved; /* alignment */
  426. DCB dcb; /* device control block */
  427. DWORD dwProviderSubType; /* ordinal value for identifying
  428. provider-defined data structure format*/
  429. DWORD dwProviderOffset; /* Specifies the offset of provider specific
  430. data field in bytes from the start */
  431. DWORD dwProviderSize; /* size of the provider-specific data field */
  432. WCHAR wcProviderData[1]; /* provider-specific data */
  433. } COMMCONFIG,*LPCOMMCONFIG;
  434. typedef struct _SYSTEM_INFO {
  435. union {
  436. DWORD dwOemId; // Obsolete field...do not use
  437. struct {
  438. WORD wProcessorArchitecture;
  439. WORD wReserved;
  440. };
  441. };
  442. DWORD dwPageSize;
  443. LPVOID lpMinimumApplicationAddress;
  444. LPVOID lpMaximumApplicationAddress;
  445. DWORD_PTR dwActiveProcessorMask;
  446. DWORD dwNumberOfProcessors;
  447. DWORD dwProcessorType;
  448. DWORD dwAllocationGranularity;
  449. WORD wProcessorLevel;
  450. WORD wProcessorRevision;
  451. } SYSTEM_INFO, *LPSYSTEM_INFO;
  452. //
  453. //
  454. #define FreeModule(hLibModule) FreeLibrary((hLibModule))
  455. #define MakeProcInstance(lpProc,hInstance) (lpProc)
  456. #define FreeProcInstance(lpProc) (lpProc)
  457. /* Global Memory Flags */
  458. #define GMEM_FIXED 0x0000
  459. #define GMEM_MOVEABLE 0x0002
  460. #define GMEM_NOCOMPACT 0x0010
  461. #define GMEM_NODISCARD 0x0020
  462. #define GMEM_ZEROINIT 0x0040
  463. #define GMEM_MODIFY 0x0080
  464. #define GMEM_DISCARDABLE 0x0100
  465. #define GMEM_NOT_BANKED 0x1000
  466. #define GMEM_SHARE 0x2000
  467. #define GMEM_DDESHARE 0x2000
  468. #define GMEM_NOTIFY 0x4000
  469. #define GMEM_LOWER GMEM_NOT_BANKED
  470. #define GMEM_VALID_FLAGS 0x7F72
  471. #define GMEM_INVALID_HANDLE 0x8000
  472. #define GHND (GMEM_MOVEABLE | GMEM_ZEROINIT)
  473. #define GPTR (GMEM_FIXED | GMEM_ZEROINIT)
  474. #define GlobalLRUNewest( h ) ((HANDLE)(h))
  475. #define GlobalLRUOldest( h ) ((HANDLE)(h))
  476. #define GlobalDiscard( h ) GlobalReAlloc( (h), 0, GMEM_MOVEABLE )
  477. /* Flags returned by GlobalFlags (in addition to GMEM_DISCARDABLE) */
  478. #define GMEM_DISCARDED 0x4000
  479. #define GMEM_LOCKCOUNT 0x00FF
  480. typedef struct _MEMORYSTATUS {
  481. DWORD dwLength;
  482. DWORD dwMemoryLoad;
  483. SIZE_T dwTotalPhys;
  484. SIZE_T dwAvailPhys;
  485. SIZE_T dwTotalPageFile;
  486. SIZE_T dwAvailPageFile;
  487. SIZE_T dwTotalVirtual;
  488. SIZE_T dwAvailVirtual;
  489. } MEMORYSTATUS, *LPMEMORYSTATUS;
  490. /* Local Memory Flags */
  491. #define LMEM_FIXED 0x0000
  492. #define LMEM_MOVEABLE 0x0002
  493. #define LMEM_NOCOMPACT 0x0010
  494. #define LMEM_NODISCARD 0x0020
  495. #define LMEM_ZEROINIT 0x0040
  496. #define LMEM_MODIFY 0x0080
  497. #define LMEM_DISCARDABLE 0x0F00
  498. #define LMEM_VALID_FLAGS 0x0F72
  499. #define LMEM_INVALID_HANDLE 0x8000
  500. #define LHND (LMEM_MOVEABLE | LMEM_ZEROINIT)
  501. #define LPTR (LMEM_FIXED | LMEM_ZEROINIT)
  502. #define NONZEROLHND (LMEM_MOVEABLE)
  503. #define NONZEROLPTR (LMEM_FIXED)
  504. #define LocalDiscard( h ) LocalReAlloc( (h), 0, LMEM_MOVEABLE )
  505. /* Flags returned by LocalFlags (in addition to LMEM_DISCARDABLE) */
  506. #define LMEM_DISCARDED 0x4000
  507. #define LMEM_LOCKCOUNT 0x00FF
  508. //
  509. // dwCreationFlag values
  510. //
  511. #define DEBUG_PROCESS 0x00000001
  512. #define DEBUG_ONLY_THIS_PROCESS 0x00000002
  513. #define CREATE_SUSPENDED 0x00000004
  514. #define DETACHED_PROCESS 0x00000008
  515. #define CREATE_NEW_CONSOLE 0x00000010
  516. #define NORMAL_PRIORITY_CLASS 0x00000020
  517. #define IDLE_PRIORITY_CLASS 0x00000040
  518. #define HIGH_PRIORITY_CLASS 0x00000080
  519. #define REALTIME_PRIORITY_CLASS 0x00000100
  520. #define CREATE_NEW_PROCESS_GROUP 0x00000200
  521. #define CREATE_UNICODE_ENVIRONMENT 0x00000400
  522. #define CREATE_SEPARATE_WOW_VDM 0x00000800
  523. #define CREATE_SHARED_WOW_VDM 0x00001000
  524. #define CREATE_FORCEDOS 0x00002000
  525. #define BELOW_NORMAL_PRIORITY_CLASS 0x00004000
  526. #define ABOVE_NORMAL_PRIORITY_CLASS 0x00008000
  527. #define STACK_SIZE_PARAM_IS_A_RESERVATION 0x00010000
  528. #define CREATE_BREAKAWAY_FROM_JOB 0x01000000
  529. #define CREATE_PRESERVE_CODE_AUTHZ_LEVEL 0x02000000
  530. #define CREATE_DEFAULT_ERROR_MODE 0x04000000
  531. #define CREATE_NO_WINDOW 0x08000000
  532. #define PROFILE_USER 0x10000000
  533. #define PROFILE_KERNEL 0x20000000
  534. #define PROFILE_SERVER 0x40000000
  535. #define CREATE_IGNORE_SYSTEM_DEFAULT 0x80000000
  536. #define THREAD_PRIORITY_LOWEST THREAD_BASE_PRIORITY_MIN
  537. #define THREAD_PRIORITY_BELOW_NORMAL (THREAD_PRIORITY_LOWEST+1)
  538. #define THREAD_PRIORITY_NORMAL 0
  539. #define THREAD_PRIORITY_HIGHEST THREAD_BASE_PRIORITY_MAX
  540. #define THREAD_PRIORITY_ABOVE_NORMAL (THREAD_PRIORITY_HIGHEST-1)
  541. #define THREAD_PRIORITY_ERROR_RETURN (MAXLONG)
  542. #define THREAD_PRIORITY_TIME_CRITICAL THREAD_BASE_PRIORITY_LOWRT
  543. #define THREAD_PRIORITY_IDLE THREAD_BASE_PRIORITY_IDLE
  544. //
  545. // Debug APIs
  546. //
  547. #define EXCEPTION_DEBUG_EVENT 1
  548. #define CREATE_THREAD_DEBUG_EVENT 2
  549. #define CREATE_PROCESS_DEBUG_EVENT 3
  550. #define EXIT_THREAD_DEBUG_EVENT 4
  551. #define EXIT_PROCESS_DEBUG_EVENT 5
  552. #define LOAD_DLL_DEBUG_EVENT 6
  553. #define UNLOAD_DLL_DEBUG_EVENT 7
  554. #define OUTPUT_DEBUG_STRING_EVENT 8
  555. #define RIP_EVENT 9
  556. typedef struct _EXCEPTION_DEBUG_INFO {
  557. EXCEPTION_RECORD ExceptionRecord;
  558. DWORD dwFirstChance;
  559. } EXCEPTION_DEBUG_INFO, *LPEXCEPTION_DEBUG_INFO;
  560. typedef struct _CREATE_THREAD_DEBUG_INFO {
  561. HANDLE hThread;
  562. LPVOID lpThreadLocalBase;
  563. LPTHREAD_START_ROUTINE lpStartAddress;
  564. } CREATE_THREAD_DEBUG_INFO, *LPCREATE_THREAD_DEBUG_INFO;
  565. typedef struct _CREATE_PROCESS_DEBUG_INFO {
  566. HANDLE hFile;
  567. HANDLE hProcess;
  568. HANDLE hThread;
  569. LPVOID lpBaseOfImage;
  570. DWORD dwDebugInfoFileOffset;
  571. DWORD nDebugInfoSize;
  572. LPVOID lpThreadLocalBase;
  573. LPTHREAD_START_ROUTINE lpStartAddress;
  574. LPVOID lpImageName;
  575. WORD fUnicode;
  576. } CREATE_PROCESS_DEBUG_INFO, *LPCREATE_PROCESS_DEBUG_INFO;
  577. typedef struct _EXIT_THREAD_DEBUG_INFO {
  578. DWORD dwExitCode;
  579. } EXIT_THREAD_DEBUG_INFO, *LPEXIT_THREAD_DEBUG_INFO;
  580. typedef struct _EXIT_PROCESS_DEBUG_INFO {
  581. DWORD dwExitCode;
  582. } EXIT_PROCESS_DEBUG_INFO, *LPEXIT_PROCESS_DEBUG_INFO;
  583. typedef struct _LOAD_DLL_DEBUG_INFO {
  584. HANDLE hFile;
  585. LPVOID lpBaseOfDll;
  586. DWORD dwDebugInfoFileOffset;
  587. DWORD nDebugInfoSize;
  588. LPVOID lpImageName;
  589. WORD fUnicode;
  590. } LOAD_DLL_DEBUG_INFO, *LPLOAD_DLL_DEBUG_INFO;
  591. typedef struct _UNLOAD_DLL_DEBUG_INFO {
  592. LPVOID lpBaseOfDll;
  593. } UNLOAD_DLL_DEBUG_INFO, *LPUNLOAD_DLL_DEBUG_INFO;
  594. typedef struct _OUTPUT_DEBUG_STRING_INFO {
  595. LPSTR lpDebugStringData;
  596. WORD fUnicode;
  597. WORD nDebugStringLength;
  598. } OUTPUT_DEBUG_STRING_INFO, *LPOUTPUT_DEBUG_STRING_INFO;
  599. typedef struct _RIP_INFO {
  600. DWORD dwError;
  601. DWORD dwType;
  602. } RIP_INFO, *LPRIP_INFO;
  603. typedef struct _DEBUG_EVENT {
  604. DWORD dwDebugEventCode;
  605. DWORD dwProcessId;
  606. DWORD dwThreadId;
  607. union {
  608. EXCEPTION_DEBUG_INFO Exception;
  609. CREATE_THREAD_DEBUG_INFO CreateThread;
  610. CREATE_PROCESS_DEBUG_INFO CreateProcessInfo;
  611. EXIT_THREAD_DEBUG_INFO ExitThread;
  612. EXIT_PROCESS_DEBUG_INFO ExitProcess;
  613. LOAD_DLL_DEBUG_INFO LoadDll;
  614. UNLOAD_DLL_DEBUG_INFO UnloadDll;
  615. OUTPUT_DEBUG_STRING_INFO DebugString;
  616. RIP_INFO RipInfo;
  617. } u;
  618. } DEBUG_EVENT, *LPDEBUG_EVENT;
  619. #if !defined(MIDL_PASS)
  620. typedef PCONTEXT LPCONTEXT;
  621. typedef PEXCEPTION_RECORD LPEXCEPTION_RECORD;
  622. typedef PEXCEPTION_POINTERS LPEXCEPTION_POINTERS;
  623. #endif
  624. #define DRIVE_UNKNOWN 0
  625. #define DRIVE_NO_ROOT_DIR 1
  626. #define DRIVE_REMOVABLE 2
  627. #define DRIVE_FIXED 3
  628. #define DRIVE_REMOTE 4
  629. #define DRIVE_CDROM 5
  630. #define DRIVE_RAMDISK 6
  631. #ifndef _MAC
  632. #define GetFreeSpace(w) (0x100000L)
  633. #else
  634. WINBASEAPI DWORD WINAPI GetFreeSpace(UINT);
  635. #endif
  636. #define FILE_TYPE_UNKNOWN 0x0000
  637. #define FILE_TYPE_DISK 0x0001
  638. #define FILE_TYPE_CHAR 0x0002
  639. #define FILE_TYPE_PIPE 0x0003
  640. #define FILE_TYPE_REMOTE 0x8000
  641. #define STD_INPUT_HANDLE ((DWORD)-10)
  642. #define STD_OUTPUT_HANDLE ((DWORD)-11)
  643. #define STD_ERROR_HANDLE ((DWORD)-12)
  644. #define NOPARITY 0
  645. #define ODDPARITY 1
  646. #define EVENPARITY 2
  647. #define MARKPARITY 3
  648. #define SPACEPARITY 4
  649. #define ONESTOPBIT 0
  650. #define ONE5STOPBITS 1
  651. #define TWOSTOPBITS 2
  652. #define IGNORE 0 // Ignore signal
  653. #define INFINITE 0xFFFFFFFF // Infinite timeout
  654. //
  655. // Baud rates at which the communication device operates
  656. //
  657. #define CBR_110 110
  658. #define CBR_300 300
  659. #define CBR_600 600
  660. #define CBR_1200 1200
  661. #define CBR_2400 2400
  662. #define CBR_4800 4800
  663. #define CBR_9600 9600
  664. #define CBR_14400 14400
  665. #define CBR_19200 19200
  666. #define CBR_38400 38400
  667. #define CBR_56000 56000
  668. #define CBR_57600 57600
  669. #define CBR_115200 115200
  670. #define CBR_128000 128000
  671. #define CBR_256000 256000
  672. //
  673. // Error Flags
  674. //
  675. #define CE_RXOVER 0x0001 // Receive Queue overflow
  676. #define CE_OVERRUN 0x0002 // Receive Overrun Error
  677. #define CE_RXPARITY 0x0004 // Receive Parity Error
  678. #define CE_FRAME 0x0008 // Receive Framing error
  679. #define CE_BREAK 0x0010 // Break Detected
  680. #define CE_TXFULL 0x0100 // TX Queue is full
  681. #define CE_PTO 0x0200 // LPTx Timeout
  682. #define CE_IOE 0x0400 // LPTx I/O Error
  683. #define CE_DNS 0x0800 // LPTx Device not selected
  684. #define CE_OOP 0x1000 // LPTx Out-Of-Paper
  685. #define CE_MODE 0x8000 // Requested mode unsupported
  686. #define IE_BADID (-1) // Invalid or unsupported id
  687. #define IE_OPEN (-2) // Device Already Open
  688. #define IE_NOPEN (-3) // Device Not Open
  689. #define IE_MEMORY (-4) // Unable to allocate queues
  690. #define IE_DEFAULT (-5) // Error in default parameters
  691. #define IE_HARDWARE (-10) // Hardware Not Present
  692. #define IE_BYTESIZE (-11) // Illegal Byte Size
  693. #define IE_BAUDRATE (-12) // Unsupported BaudRate
  694. //
  695. // Events
  696. //
  697. #define EV_RXCHAR 0x0001 // Any Character received
  698. #define EV_RXFLAG 0x0002 // Received certain character
  699. #define EV_TXEMPTY 0x0004 // Transmitt Queue Empty
  700. #define EV_CTS 0x0008 // CTS changed state
  701. #define EV_DSR 0x0010 // DSR changed state
  702. #define EV_RLSD 0x0020 // RLSD changed state
  703. #define EV_BREAK 0x0040 // BREAK received
  704. #define EV_ERR 0x0080 // Line status error occurred
  705. #define EV_RING 0x0100 // Ring signal detected
  706. #define EV_PERR 0x0200 // Printer error occured
  707. #define EV_RX80FULL 0x0400 // Receive buffer is 80 percent full
  708. #define EV_EVENT1 0x0800 // Provider specific event 1
  709. #define EV_EVENT2 0x1000 // Provider specific event 2
  710. //
  711. // Escape Functions
  712. //
  713. #define SETXOFF 1 // Simulate XOFF received
  714. #define SETXON 2 // Simulate XON received
  715. #define SETRTS 3 // Set RTS high
  716. #define CLRRTS 4 // Set RTS low
  717. #define SETDTR 5 // Set DTR high
  718. #define CLRDTR 6 // Set DTR low
  719. #define RESETDEV 7 // Reset device if possible
  720. #define SETBREAK 8 // Set the device break line.
  721. #define CLRBREAK 9 // Clear the device break line.
  722. //
  723. // PURGE function flags.
  724. //
  725. #define PURGE_TXABORT 0x0001 // Kill the pending/current writes to the comm port.
  726. #define PURGE_RXABORT 0x0002 // Kill the pending/current reads to the comm port.
  727. #define PURGE_TXCLEAR 0x0004 // Kill the transmit queue if there.
  728. #define PURGE_RXCLEAR 0x0008 // Kill the typeahead buffer if there.
  729. #define LPTx 0x80 // Set if ID is for LPT device
  730. //
  731. // Modem Status Flags
  732. //
  733. #define MS_CTS_ON ((DWORD)0x0010)
  734. #define MS_DSR_ON ((DWORD)0x0020)
  735. #define MS_RING_ON ((DWORD)0x0040)
  736. #define MS_RLSD_ON ((DWORD)0x0080)
  737. //
  738. // WaitSoundState() Constants
  739. //
  740. #define S_QUEUEEMPTY 0
  741. #define S_THRESHOLD 1
  742. #define S_ALLTHRESHOLD 2
  743. //
  744. // Accent Modes
  745. //
  746. #define S_NORMAL 0
  747. #define S_LEGATO 1
  748. #define S_STACCATO 2
  749. //
  750. // SetSoundNoise() Sources
  751. //
  752. #define S_PERIOD512 0 // Freq = N/512 high pitch, less coarse hiss
  753. #define S_PERIOD1024 1 // Freq = N/1024
  754. #define S_PERIOD2048 2 // Freq = N/2048 low pitch, more coarse hiss
  755. #define S_PERIODVOICE 3 // Source is frequency from voice channel (3)
  756. #define S_WHITE512 4 // Freq = N/512 high pitch, less coarse hiss
  757. #define S_WHITE1024 5 // Freq = N/1024
  758. #define S_WHITE2048 6 // Freq = N/2048 low pitch, more coarse hiss
  759. #define S_WHITEVOICE 7 // Source is frequency from voice channel (3)
  760. #define S_SERDVNA (-1) // Device not available
  761. #define S_SEROFM (-2) // Out of memory
  762. #define S_SERMACT (-3) // Music active
  763. #define S_SERQFUL (-4) // Queue full
  764. #define S_SERBDNT (-5) // Invalid note
  765. #define S_SERDLN (-6) // Invalid note length
  766. #define S_SERDCC (-7) // Invalid note count
  767. #define S_SERDTP (-8) // Invalid tempo
  768. #define S_SERDVL (-9) // Invalid volume
  769. #define S_SERDMD (-10) // Invalid mode
  770. #define S_SERDSH (-11) // Invalid shape
  771. #define S_SERDPT (-12) // Invalid pitch
  772. #define S_SERDFQ (-13) // Invalid frequency
  773. #define S_SERDDR (-14) // Invalid duration
  774. #define S_SERDSR (-15) // Invalid source
  775. #define S_SERDST (-16) // Invalid state
  776. #define NMPWAIT_WAIT_FOREVER 0xffffffff
  777. #define NMPWAIT_NOWAIT 0x00000001
  778. #define NMPWAIT_USE_DEFAULT_WAIT 0x00000000
  779. #define FS_CASE_IS_PRESERVED FILE_CASE_PRESERVED_NAMES
  780. #define FS_CASE_SENSITIVE FILE_CASE_SENSITIVE_SEARCH
  781. #define FS_UNICODE_STORED_ON_DISK FILE_UNICODE_ON_DISK
  782. #define FS_PERSISTENT_ACLS FILE_PERSISTENT_ACLS
  783. #define FS_VOL_IS_COMPRESSED FILE_VOLUME_IS_COMPRESSED
  784. #define FS_FILE_COMPRESSION FILE_FILE_COMPRESSION
  785. #define FS_FILE_ENCRYPTION FILE_SUPPORTS_ENCRYPTION
  786. #define FILE_MAP_COPY SECTION_QUERY
  787. #define FILE_MAP_WRITE SECTION_MAP_WRITE
  788. #define FILE_MAP_READ SECTION_MAP_READ
  789. #define FILE_MAP_ALL_ACCESS SECTION_ALL_ACCESS
  790. #define OF_READ 0x00000000
  791. #define OF_WRITE 0x00000001
  792. #define OF_READWRITE 0x00000002
  793. #define OF_SHARE_COMPAT 0x00000000
  794. #define OF_SHARE_EXCLUSIVE 0x00000010
  795. #define OF_SHARE_DENY_WRITE 0x00000020
  796. #define OF_SHARE_DENY_READ 0x00000030
  797. #define OF_SHARE_DENY_NONE 0x00000040
  798. #define OF_PARSE 0x00000100
  799. #define OF_DELETE 0x00000200
  800. #define OF_VERIFY 0x00000400
  801. #define OF_CANCEL 0x00000800
  802. #define OF_CREATE 0x00001000
  803. #define OF_PROMPT 0x00002000
  804. #define OF_EXIST 0x00004000
  805. #define OF_REOPEN 0x00008000
  806. #define OFS_MAXPATHNAME 128
  807. typedef struct _OFSTRUCT {
  808. BYTE cBytes;
  809. BYTE fFixedDisk;
  810. WORD nErrCode;
  811. WORD Reserved1;
  812. WORD Reserved2;
  813. CHAR szPathName[OFS_MAXPATHNAME];
  814. } OFSTRUCT, *LPOFSTRUCT, *POFSTRUCT;
  815. #ifndef NOWINBASEINTERLOCK
  816. #ifndef _NTOS_
  817. #if defined(_M_IA64) && !defined(RC_INVOKED)
  818. #define InterlockedIncrement _InterlockedIncrement
  819. #define InterlockedIncrementAcquire _InterlockedIncrement_acq
  820. #define InterlockedIncrementRelease _InterlockedIncrement_rel
  821. #define InterlockedDecrement _InterlockedDecrement
  822. #define InterlockedDecrementAcquire _InterlockedDecrement_acq
  823. #define InterlockedDecrementRelease _InterlockedDecrement_rel
  824. #define InterlockedExchange _InterlockedExchange
  825. #define InterlockedExchangeAdd _InterlockedExchangeAdd
  826. #define InterlockedCompareExchange _InterlockedCompareExchange
  827. #define InterlockedCompareExchangeAcquire _InterlockedCompareExchange_acq
  828. #define InterlockedCompareExchangeRelease _InterlockedCompareExchange_rel
  829. #define InterlockedExchangePointer _InterlockedExchangePointer
  830. #define InterlockedCompareExchangePointer _InterlockedCompareExchangePointer
  831. #define InterlockedIncrement64 _InterlockedIncrement64
  832. #define InterlockedDecrement64 _InterlockedDecrement64
  833. #define InterlockedExchange64 _InterlockedExchange64
  834. #define InterlockedExchangeAcquire64 _InterlockedExchange64_acq
  835. #define InterlockedExchangeAdd64 _InterlockedExchangeAdd64
  836. #define InterlockedCompareExchange64 _InterlockedCompareExchange64
  837. #define InterlockedCompareExchangeAcquire64 _InterlockedCompareExchange64_acq
  838. #define InterlockedCompareExchangeRelease64 _InterlockedCompareExchange64_rel
  839. LONGLONG
  840. __cdecl
  841. InterlockedIncrement64(
  842. IN OUT LONGLONG volatile *Addend
  843. );
  844. LONGLONG
  845. __cdecl
  846. InterlockedDecrement64(
  847. IN OUT LONGLONG volatile *Addend
  848. );
  849. LONG
  850. __cdecl
  851. InterlockedIncrementAcquire(
  852. IN OUT LONG volatile *Addend
  853. );
  854. LONG
  855. __cdecl
  856. InterlockedDecrementAcquire(
  857. IN OUT LONG volatile *Addend
  858. );
  859. LONG
  860. __cdecl
  861. InterlockedIncrementRelease(
  862. IN OUT LONG volatile *Addend
  863. );
  864. LONG
  865. __cdecl
  866. InterlockedDecrementRelease(
  867. IN OUT LONG volatile *Addend
  868. );
  869. LONGLONG
  870. __cdecl
  871. InterlockedExchange64(
  872. IN OUT LONGLONG volatile *Target,
  873. IN LONGLONG Value
  874. );
  875. LONGLONG
  876. __cdecl
  877. InterlockedExchangeAcquire64(
  878. IN OUT LONGLONG volatile *Target,
  879. IN LONGLONG Value
  880. );
  881. LONGLONG
  882. __cdecl
  883. InterlockedExchangeAdd64(
  884. IN OUT LONGLONG volatile *Addend,
  885. IN LONGLONG Value
  886. );
  887. LONGLONG
  888. __cdecl
  889. InterlockedCompareExchange64 (
  890. IN OUT LONGLONG volatile *Destination,
  891. IN LONGLONG ExChange,
  892. IN LONGLONG Comperand
  893. );
  894. LONGLONG
  895. __cdecl
  896. InterlockedCompareExchangeAcquire64 (
  897. IN OUT LONGLONG volatile *Destination,
  898. IN LONGLONG ExChange,
  899. IN LONGLONG Comperand
  900. );
  901. LONGLONG
  902. __cdecl
  903. InterlockedCompareExchangeRelease64 (
  904. IN OUT LONGLONG volatile *Destination,
  905. IN LONGLONG ExChange,
  906. IN LONGLONG Comperand
  907. );
  908. LONG
  909. __cdecl
  910. InterlockedIncrement(
  911. IN OUT LONG volatile *lpAddend
  912. );
  913. LONG
  914. __cdecl
  915. InterlockedDecrement(
  916. IN OUT LONG volatile *lpAddend
  917. );
  918. LONG
  919. __cdecl
  920. InterlockedExchange(
  921. IN OUT LONG volatile *Target,
  922. IN LONG Value
  923. );
  924. LONG
  925. __cdecl
  926. InterlockedExchangeAdd(
  927. IN OUT LONG volatile *Addend,
  928. IN LONG Value
  929. );
  930. LONG
  931. __cdecl
  932. InterlockedCompareExchange (
  933. IN OUT LONG volatile *Destination,
  934. IN LONG ExChange,
  935. IN LONG Comperand
  936. );
  937. LONG
  938. __cdecl
  939. InterlockedCompareExchangeRelease (
  940. IN OUT LONG volatile *Destination,
  941. IN LONG ExChange,
  942. IN LONG Comperand
  943. );
  944. LONG
  945. __cdecl
  946. InterlockedCompareExchangeAcquire (
  947. IN OUT LONG volatile *Destination,
  948. IN LONG ExChange,
  949. IN LONG Comperand
  950. );
  951. PVOID
  952. __cdecl
  953. InterlockedExchangePointer(
  954. IN OUT PVOID volatile *Target,
  955. IN PVOID Value
  956. );
  957. PVOID
  958. __cdecl
  959. InterlockedCompareExchangePointer (
  960. IN OUT PVOID volatile *Destination,
  961. IN PVOID ExChange,
  962. IN PVOID Comperand
  963. );
  964. #if !defined(MIDL_PASS)
  965. #if !defined (InterlockedAnd64)
  966. #define InterlockedAnd64 InterlockedAnd64_Inline
  967. LONGLONG
  968. FORCEINLINE
  969. InterlockedAnd64_Inline (
  970. IN OUT LONGLONG volatile *Destination,
  971. IN LONGLONG Value
  972. )
  973. {
  974. LONGLONG Old;
  975. do {
  976. Old = *Destination;
  977. } while (InterlockedCompareExchange64(Destination,
  978. Old & Value,
  979. Old) != Old);
  980. return Old;
  981. }
  982. #endif
  983. #if !defined (InterlockedOr64)
  984. #define InterlockedOr64 InterlockedOr64_Inline
  985. LONGLONG
  986. FORCEINLINE
  987. InterlockedOr64_Inline (
  988. IN OUT LONGLONG volatile *Destination,
  989. IN LONGLONG Value
  990. )
  991. {
  992. LONGLONG Old;
  993. do {
  994. Old = *Destination;
  995. } while (InterlockedCompareExchange64(Destination,
  996. Old | Value,
  997. Old) != Old);
  998. return Old;
  999. }
  1000. #endif
  1001. #if !defined (InterlockedXor64)
  1002. #define InterlockedXor64 InterlockedXor64_Inline
  1003. LONGLONG
  1004. FORCEINLINE
  1005. InterlockedXor64_Inline (
  1006. IN OUT LONGLONG volatile *Destination,
  1007. IN LONGLONG Value
  1008. )
  1009. {
  1010. LONGLONG Old;
  1011. do {
  1012. Old = *Destination;
  1013. } while (InterlockedCompareExchange64(Destination,
  1014. Old ^ Value,
  1015. Old) != Old);
  1016. return Old;
  1017. }
  1018. #endif
  1019. #endif
  1020. #pragma intrinsic(_InterlockedIncrement)
  1021. #pragma intrinsic(_InterlockedIncrement_acq)
  1022. #pragma intrinsic(_InterlockedIncrement_rel)
  1023. #pragma intrinsic(_InterlockedDecrement)
  1024. #pragma intrinsic(_InterlockedDecrement_acq)
  1025. #pragma intrinsic(_InterlockedDecrement_rel)
  1026. #pragma intrinsic(_InterlockedExchange)
  1027. #pragma intrinsic(_InterlockedExchangeAdd)
  1028. #pragma intrinsic(_InterlockedCompareExchange)
  1029. #pragma intrinsic(_InterlockedCompareExchange_acq)
  1030. #pragma intrinsic(_InterlockedCompareExchange_rel)
  1031. #pragma intrinsic(_InterlockedExchangePointer)
  1032. #pragma intrinsic(_InterlockedCompareExchangePointer)
  1033. #pragma intrinsic(_InterlockedIncrement64)
  1034. #pragma intrinsic(_InterlockedDecrement64)
  1035. #pragma intrinsic(_InterlockedExchange64)
  1036. #pragma intrinsic(_InterlockedExchange64_acq)
  1037. #pragma intrinsic(_InterlockedCompareExchange64)
  1038. #pragma intrinsic(_InterlockedCompareExchange64_acq)
  1039. #pragma intrinsic(_InterlockedCompareExchange64_rel)
  1040. #pragma intrinsic(_InterlockedExchangeAdd64)
  1041. #elif defined(_M_AMD64) && !defined(RC_INVOKED)
  1042. #define InterlockedIncrement _InterlockedIncrement
  1043. #define InterlockedIncrementAcquire InterlockedIncrement
  1044. #define InterlockedIncrementRelease InterlockedIncrement
  1045. #define InterlockedDecrement _InterlockedDecrement
  1046. #define InterlockedDecrementAcquire InterlockedDecrement
  1047. #define InterlockedDecrementRelease InterlockedDecrement
  1048. #define InterlockedExchange _InterlockedExchange
  1049. #define InterlockedExchangeAdd _InterlockedExchangeAdd
  1050. #define InterlockedCompareExchange _InterlockedCompareExchange
  1051. #define InterlockedCompareExchangeAcquire InterlockedCompareExchange
  1052. #define InterlockedCompareExchangeRelease InterlockedCompareExchange
  1053. #define InterlockedExchangePointer _InterlockedExchangePointer
  1054. #define InterlockedCompareExchangePointer _InterlockedCompareExchangePointer
  1055. #define InterlockedAnd64 _InterlockedAnd64
  1056. #define InterlockedOr64 _InterlockedOr64
  1057. #define InterlockedXor64 _InterlockedXor64
  1058. #define InterlockedIncrement64 _InterlockedIncrement64
  1059. #define InterlockedDecrement64 _InterlockedDecrement64
  1060. #define InterlockedExchange64 _InterlockedExchange64
  1061. #define InterlockedExchangeAdd64 _InterlockedExchangeAdd64
  1062. #define InterlockedCompareExchange64 _InterlockedCompareExchange64
  1063. #define InterlockedCompareExchangeAcquire64 InterlockedCompareExchange64
  1064. #define InterlockedCompareExchangeRelease64 InterlockedCompareExchange64
  1065. LONG
  1066. InterlockedIncrement(
  1067. IN OUT LONG volatile *Addend
  1068. );
  1069. LONG
  1070. InterlockedDecrement(
  1071. IN OUT LONG volatile *Addend
  1072. );
  1073. LONG
  1074. InterlockedExchange(
  1075. IN OUT LONG volatile *Target,
  1076. IN LONG Value
  1077. );
  1078. LONG
  1079. InterlockedExchangeAdd(
  1080. IN OUT LONG volatile *Addend,
  1081. IN LONG Value
  1082. );
  1083. LONG
  1084. InterlockedCompareExchange (
  1085. IN OUT LONG volatile *Destination,
  1086. IN LONG ExChange,
  1087. IN LONG Comperand
  1088. );
  1089. PVOID
  1090. InterlockedCompareExchangePointer (
  1091. IN OUT PVOID volatile *Destination,
  1092. IN PVOID Exchange,
  1093. IN PVOID Comperand
  1094. );
  1095. PVOID
  1096. InterlockedExchangePointer(
  1097. IN OUT PVOID volatile *Target,
  1098. IN PVOID Value
  1099. );
  1100. LONG64
  1101. InterlockedAnd64 (
  1102. IN OUT LONG64 volatile *Destination,
  1103. IN LONG64 Value
  1104. );
  1105. LONG64
  1106. InterlockedOr64 (
  1107. IN OUT LONG64 volatile *Destination,
  1108. IN LONG64 Value
  1109. );
  1110. LONG64
  1111. InterlockedXor64 (
  1112. IN OUT LONG64 volatile *Destination,
  1113. IN LONG64 Value
  1114. );
  1115. LONG64
  1116. InterlockedIncrement64(
  1117. IN OUT LONG64 volatile *Addend
  1118. );
  1119. LONG64
  1120. InterlockedDecrement64(
  1121. IN OUT LONG64 volatile *Addend
  1122. );
  1123. LONG64
  1124. InterlockedExchange64(
  1125. IN OUT LONG64 volatile *Target,
  1126. IN LONG64 Value
  1127. );
  1128. LONG64
  1129. InterlockedExchangeAdd64(
  1130. IN OUT LONG64 volatile *Addend,
  1131. IN LONG64 Value
  1132. );
  1133. LONG64
  1134. InterlockedCompareExchange64 (
  1135. IN OUT LONG64 volatile *Destination,
  1136. IN LONG64 ExChange,
  1137. IN LONG64 Comperand
  1138. );
  1139. #pragma intrinsic(_InterlockedIncrement)
  1140. #pragma intrinsic(_InterlockedDecrement)
  1141. #pragma intrinsic(_InterlockedExchange)
  1142. #pragma intrinsic(_InterlockedExchangeAdd)
  1143. #pragma intrinsic(_InterlockedCompareExchange)
  1144. #pragma intrinsic(_InterlockedExchangePointer)
  1145. #pragma intrinsic(_InterlockedCompareExchangePointer)
  1146. #else // X86 interlocked definitions
  1147. WINBASEAPI
  1148. LONG
  1149. WINAPI
  1150. InterlockedIncrement(
  1151. IN OUT LONG volatile *lpAddend
  1152. );
  1153. WINBASEAPI
  1154. LONG
  1155. WINAPI
  1156. InterlockedDecrement(
  1157. IN OUT LONG volatile *lpAddend
  1158. );
  1159. WINBASEAPI
  1160. LONG
  1161. WINAPI
  1162. InterlockedExchange(
  1163. IN OUT LONG volatile *Target,
  1164. IN LONG Value
  1165. );
  1166. #define InterlockedExchangePointer(Target, Value) \
  1167. (PVOID)InterlockedExchange((PLONG)(Target), (LONG)(Value))
  1168. WINBASEAPI
  1169. LONG
  1170. WINAPI
  1171. InterlockedExchangeAdd(
  1172. IN OUT LONG volatile *Addend,
  1173. IN LONG Value
  1174. );
  1175. WINBASEAPI
  1176. LONG
  1177. WINAPI
  1178. InterlockedCompareExchange (
  1179. IN OUT LONG volatile *Destination,
  1180. IN LONG Exchange,
  1181. IN LONG Comperand
  1182. );
  1183. WINBASEAPI
  1184. LONGLONG
  1185. WINAPI
  1186. InterlockedCompareExchange64 (
  1187. IN OUT LONGLONG volatile *Destination,
  1188. IN LONGLONG Exchange,
  1189. IN LONGLONG Comperand
  1190. );
  1191. #if !defined(MIDL_PASS)
  1192. LONGLONG
  1193. FORCEINLINE
  1194. InterlockedAnd64 (
  1195. IN OUT LONGLONG volatile *Destination,
  1196. IN LONGLONG Value
  1197. )
  1198. {
  1199. LONGLONG Old;
  1200. do {
  1201. Old = *Destination;
  1202. } while (InterlockedCompareExchange64(Destination,
  1203. Old & Value,
  1204. Old) != Old);
  1205. return Old;
  1206. }
  1207. LONGLONG
  1208. FORCEINLINE
  1209. InterlockedOr64 (
  1210. IN OUT LONGLONG volatile *Destination,
  1211. IN LONGLONG Value
  1212. )
  1213. {
  1214. LONGLONG Old;
  1215. do {
  1216. Old = *Destination;
  1217. } while (InterlockedCompareExchange64(Destination,
  1218. Old | Value,
  1219. Old) != Old);
  1220. return Old;
  1221. }
  1222. LONGLONG
  1223. FORCEINLINE
  1224. InterlockedXor64 (
  1225. IN OUT LONGLONG volatile *Destination,
  1226. IN LONGLONG Value
  1227. )
  1228. {
  1229. LONGLONG Old;
  1230. do {
  1231. Old = *Destination;
  1232. } while (InterlockedCompareExchange64(Destination,
  1233. Old ^ Value,
  1234. Old) != Old);
  1235. return Old;
  1236. }
  1237. LONGLONG
  1238. FORCEINLINE
  1239. InterlockedIncrement64(
  1240. IN OUT LONGLONG volatile *Addend
  1241. )
  1242. {
  1243. LONGLONG Old;
  1244. do {
  1245. Old = *Addend;
  1246. } while (InterlockedCompareExchange64(Addend,
  1247. Old + 1,
  1248. Old) != Old);
  1249. return Old + 1;
  1250. }
  1251. LONGLONG
  1252. FORCEINLINE
  1253. InterlockedDecrement64(
  1254. IN OUT LONGLONG volatile *Addend
  1255. )
  1256. {
  1257. LONGLONG Old;
  1258. do {
  1259. Old = *Addend;
  1260. } while (InterlockedCompareExchange64(Addend,
  1261. Old - 1,
  1262. Old) != Old);
  1263. return Old - 1;
  1264. }
  1265. LONGLONG
  1266. FORCEINLINE
  1267. InterlockedExchange64(
  1268. IN OUT LONGLONG volatile *Target,
  1269. IN LONGLONG Value
  1270. )
  1271. {
  1272. LONGLONG Old;
  1273. do {
  1274. Old = *Target;
  1275. } while (InterlockedCompareExchange64(Target,
  1276. Value,
  1277. Old) != Old);
  1278. return Old;
  1279. }
  1280. LONGLONG
  1281. FORCEINLINE
  1282. InterlockedExchangeAdd64(
  1283. IN OUT LONGLONG volatile *Addend,
  1284. IN LONGLONG Value
  1285. )
  1286. {
  1287. LONGLONG Old;
  1288. do {
  1289. Old = *Addend;
  1290. } while (InterlockedCompareExchange64(Addend,
  1291. Old + Value,
  1292. Old) != Old);
  1293. return Old;
  1294. }
  1295. #endif
  1296. //
  1297. // Use a function for C++ so X86 will generate the same errors as RISC.
  1298. //
  1299. #ifdef __cplusplus
  1300. FORCEINLINE
  1301. PVOID
  1302. __cdecl
  1303. __InlineInterlockedCompareExchangePointer (
  1304. IN OUT PVOID volatile *Destination,
  1305. IN PVOID ExChange,
  1306. IN PVOID Comperand
  1307. )
  1308. {
  1309. return((PVOID)(LONG_PTR)InterlockedCompareExchange((LONG volatile *)Destination, (LONG)(LONG_PTR)ExChange, (LONG)(LONG_PTR)Comperand));
  1310. }
  1311. #define InterlockedCompareExchangePointer __InlineInterlockedCompareExchangePointer
  1312. #else
  1313. #define InterlockedCompareExchangePointer(Destination, ExChange, Comperand) \
  1314. (PVOID)(LONG_PTR)InterlockedCompareExchange((LONG volatile *)(Destination), (LONG)(LONG_PTR)(ExChange), (LONG)(LONG_PTR)(Comperand))
  1315. #endif /* __cplusplus */
  1316. #define InterlockedIncrementAcquire InterlockedIncrement
  1317. #define InterlockedIncrementRelease InterlockedIncrement
  1318. #define InterlockedDecrementAcquire InterlockedDecrement
  1319. #define InterlockedDecrementRelease InterlockedDecrement
  1320. #define InterlockedIncrementAcquire InterlockedIncrement
  1321. #define InterlockedIncrementRelease InterlockedIncrement
  1322. #define InterlockedCompareExchangeAcquire InterlockedCompareExchange
  1323. #define InterlockedCompareExchangeRelease InterlockedCompareExchange
  1324. #define InterlockedCompareExchangeAcquire64 InterlockedCompareExchange64
  1325. #define InterlockedCompareExchangeRelease64 InterlockedCompareExchange64
  1326. #endif /* X86 | IA64 */
  1327. #if defined(_SLIST_HEADER_) && !defined(_NTOSP_)
  1328. WINBASEAPI
  1329. VOID
  1330. WINAPI
  1331. InitializeSListHead (
  1332. IN PSLIST_HEADER ListHead
  1333. );
  1334. WINBASEAPI
  1335. PSLIST_ENTRY
  1336. WINAPI
  1337. InterlockedPopEntrySList (
  1338. IN PSLIST_HEADER ListHead
  1339. );
  1340. WINBASEAPI
  1341. PSLIST_ENTRY
  1342. WINAPI
  1343. InterlockedPushEntrySList (
  1344. IN PSLIST_HEADER ListHead,
  1345. IN PSLIST_ENTRY ListEntry
  1346. );
  1347. WINBASEAPI
  1348. PSLIST_ENTRY
  1349. WINAPI
  1350. InterlockedFlushSList (
  1351. IN PSLIST_HEADER ListHead
  1352. );
  1353. WINBASEAPI
  1354. USHORT
  1355. WINAPI
  1356. QueryDepthSList (
  1357. IN PSLIST_HEADER ListHead
  1358. );
  1359. #endif /* _SLIST_HEADER_ */
  1360. #endif /* _NTOS_ */
  1361. #endif /* NOWINBASEINTERLOCK */
  1362. WINBASEAPI
  1363. BOOL
  1364. WINAPI
  1365. FreeResource(
  1366. IN HGLOBAL hResData
  1367. );
  1368. WINBASEAPI
  1369. LPVOID
  1370. WINAPI
  1371. LockResource(
  1372. IN HGLOBAL hResData
  1373. );
  1374. #define UnlockResource(hResData) ((hResData), 0)
  1375. #define MAXINTATOM 0xC000
  1376. #define MAKEINTATOM(i) (LPTSTR)((ULONG_PTR)((WORD)(i)))
  1377. #define INVALID_ATOM ((ATOM)0)
  1378. #ifndef _MAC
  1379. int
  1380. WINAPI
  1381. #else
  1382. int
  1383. CALLBACK
  1384. #endif
  1385. WinMain(
  1386. IN HINSTANCE hInstance,
  1387. IN HINSTANCE hPrevInstance,
  1388. IN LPSTR lpCmdLine,
  1389. IN int nShowCmd
  1390. );
  1391. WINBASEAPI
  1392. BOOL
  1393. WINAPI
  1394. FreeLibrary(
  1395. IN OUT HMODULE hLibModule
  1396. );
  1397. WINBASEAPI
  1398. DECLSPEC_NORETURN
  1399. VOID
  1400. WINAPI
  1401. FreeLibraryAndExitThread(
  1402. IN HMODULE hLibModule,
  1403. IN DWORD dwExitCode
  1404. );
  1405. WINBASEAPI
  1406. BOOL
  1407. WINAPI
  1408. DisableThreadLibraryCalls(
  1409. IN HMODULE hLibModule
  1410. );
  1411. WINBASEAPI
  1412. FARPROC
  1413. WINAPI
  1414. GetProcAddress(
  1415. IN HMODULE hModule,
  1416. IN LPCSTR lpProcName
  1417. );
  1418. WINBASEAPI
  1419. DWORD
  1420. WINAPI
  1421. GetVersion( VOID );
  1422. WINBASEAPI
  1423. HGLOBAL
  1424. WINAPI
  1425. GlobalAlloc(
  1426. IN UINT uFlags,
  1427. IN SIZE_T dwBytes
  1428. );
  1429. WINBASEAPI
  1430. HGLOBAL
  1431. WINAPI
  1432. GlobalReAlloc(
  1433. IN HGLOBAL hMem,
  1434. IN SIZE_T dwBytes,
  1435. IN UINT uFlags
  1436. );
  1437. WINBASEAPI
  1438. SIZE_T
  1439. WINAPI
  1440. GlobalSize(
  1441. IN HGLOBAL hMem
  1442. );
  1443. WINBASEAPI
  1444. UINT
  1445. WINAPI
  1446. GlobalFlags(
  1447. IN HGLOBAL hMem
  1448. );
  1449. WINBASEAPI
  1450. LPVOID
  1451. WINAPI
  1452. GlobalLock(
  1453. IN HGLOBAL hMem
  1454. );
  1455. //!!!MWH My version win31 = DWORD WINAPI GlobalHandle(UINT)
  1456. WINBASEAPI
  1457. HGLOBAL
  1458. WINAPI
  1459. GlobalHandle(
  1460. IN LPCVOID pMem
  1461. );
  1462. WINBASEAPI
  1463. BOOL
  1464. WINAPI
  1465. GlobalUnlock(
  1466. IN HGLOBAL hMem
  1467. );
  1468. WINBASEAPI
  1469. HGLOBAL
  1470. WINAPI
  1471. GlobalFree(
  1472. IN HGLOBAL hMem
  1473. );
  1474. WINBASEAPI
  1475. SIZE_T
  1476. WINAPI
  1477. GlobalCompact(
  1478. IN DWORD dwMinFree
  1479. );
  1480. WINBASEAPI
  1481. VOID
  1482. WINAPI
  1483. GlobalFix(
  1484. IN HGLOBAL hMem
  1485. );
  1486. WINBASEAPI
  1487. VOID
  1488. WINAPI
  1489. GlobalUnfix(
  1490. IN HGLOBAL hMem
  1491. );
  1492. WINBASEAPI
  1493. LPVOID
  1494. WINAPI
  1495. GlobalWire(
  1496. IN HGLOBAL hMem
  1497. );
  1498. WINBASEAPI
  1499. BOOL
  1500. WINAPI
  1501. GlobalUnWire(
  1502. IN HGLOBAL hMem
  1503. );
  1504. WINBASEAPI
  1505. VOID
  1506. WINAPI
  1507. GlobalMemoryStatus(
  1508. IN OUT LPMEMORYSTATUS lpBuffer
  1509. );
  1510. typedef struct _MEMORYSTATUSEX {
  1511. DWORD dwLength;
  1512. DWORD dwMemoryLoad;
  1513. DWORDLONG ullTotalPhys;
  1514. DWORDLONG ullAvailPhys;
  1515. DWORDLONG ullTotalPageFile;
  1516. DWORDLONG ullAvailPageFile;
  1517. DWORDLONG ullTotalVirtual;
  1518. DWORDLONG ullAvailVirtual;
  1519. DWORDLONG ullAvailExtendedVirtual;
  1520. } MEMORYSTATUSEX, *LPMEMORYSTATUSEX;
  1521. WINBASEAPI
  1522. BOOL
  1523. WINAPI
  1524. GlobalMemoryStatusEx(
  1525. IN OUT LPMEMORYSTATUSEX lpBuffer
  1526. );
  1527. WINBASEAPI
  1528. HLOCAL
  1529. WINAPI
  1530. LocalAlloc(
  1531. IN UINT uFlags,
  1532. IN SIZE_T uBytes
  1533. );
  1534. WINBASEAPI
  1535. HLOCAL
  1536. WINAPI
  1537. LocalReAlloc(
  1538. IN HLOCAL hMem,
  1539. IN SIZE_T uBytes,
  1540. IN UINT uFlags
  1541. );
  1542. WINBASEAPI
  1543. LPVOID
  1544. WINAPI
  1545. LocalLock(
  1546. IN HLOCAL hMem
  1547. );
  1548. WINBASEAPI
  1549. HLOCAL
  1550. WINAPI
  1551. LocalHandle(
  1552. IN LPCVOID pMem
  1553. );
  1554. WINBASEAPI
  1555. BOOL
  1556. WINAPI
  1557. LocalUnlock(
  1558. IN HLOCAL hMem
  1559. );
  1560. WINBASEAPI
  1561. SIZE_T
  1562. WINAPI
  1563. LocalSize(
  1564. IN HLOCAL hMem
  1565. );
  1566. WINBASEAPI
  1567. UINT
  1568. WINAPI
  1569. LocalFlags(
  1570. IN HLOCAL hMem
  1571. );
  1572. WINBASEAPI
  1573. HLOCAL
  1574. WINAPI
  1575. LocalFree(
  1576. IN HLOCAL hMem
  1577. );
  1578. WINBASEAPI
  1579. SIZE_T
  1580. WINAPI
  1581. LocalShrink(
  1582. IN HLOCAL hMem,
  1583. IN UINT cbNewSize
  1584. );
  1585. WINBASEAPI
  1586. SIZE_T
  1587. WINAPI
  1588. LocalCompact(
  1589. IN UINT uMinFree
  1590. );
  1591. WINBASEAPI
  1592. BOOL
  1593. WINAPI
  1594. FlushInstructionCache(
  1595. IN HANDLE hProcess,
  1596. IN LPCVOID lpBaseAddress,
  1597. IN SIZE_T dwSize
  1598. );
  1599. WINBASEAPI
  1600. LPVOID
  1601. WINAPI
  1602. VirtualAlloc(
  1603. IN LPVOID lpAddress,
  1604. IN SIZE_T dwSize,
  1605. IN DWORD flAllocationType,
  1606. IN DWORD flProtect
  1607. );
  1608. WINBASEAPI
  1609. BOOL
  1610. WINAPI
  1611. VirtualFree(
  1612. IN LPVOID lpAddress,
  1613. IN SIZE_T dwSize,
  1614. IN DWORD dwFreeType
  1615. );
  1616. WINBASEAPI
  1617. BOOL
  1618. WINAPI
  1619. VirtualProtect(
  1620. IN LPVOID lpAddress,
  1621. IN SIZE_T dwSize,
  1622. IN DWORD flNewProtect,
  1623. OUT PDWORD lpflOldProtect
  1624. );
  1625. WINBASEAPI
  1626. SIZE_T
  1627. WINAPI
  1628. VirtualQuery(
  1629. IN LPCVOID lpAddress,
  1630. OUT PMEMORY_BASIC_INFORMATION lpBuffer,
  1631. IN SIZE_T dwLength
  1632. );
  1633. WINBASEAPI
  1634. LPVOID
  1635. WINAPI
  1636. VirtualAllocEx(
  1637. IN HANDLE hProcess,
  1638. IN LPVOID lpAddress,
  1639. IN SIZE_T dwSize,
  1640. IN DWORD flAllocationType,
  1641. IN DWORD flProtect
  1642. );
  1643. WINBASEAPI
  1644. UINT
  1645. WINAPI
  1646. GetWriteWatch(
  1647. IN DWORD dwFlags,
  1648. IN PVOID lpBaseAddress,
  1649. IN SIZE_T dwRegionSize,
  1650. IN OUT PVOID *lpAddresses,
  1651. IN OUT PULONG_PTR lpdwCount,
  1652. OUT PULONG lpdwGranularity
  1653. );
  1654. WINBASEAPI
  1655. UINT
  1656. WINAPI
  1657. ResetWriteWatch(
  1658. IN LPVOID lpBaseAddress,
  1659. IN SIZE_T dwRegionSize
  1660. );
  1661. WINBASEAPI
  1662. SIZE_T
  1663. WINAPI
  1664. GetLargePageMinimum(
  1665. VOID
  1666. );
  1667. WINBASEAPI
  1668. BOOL
  1669. WINAPI
  1670. VirtualFreeEx(
  1671. IN HANDLE hProcess,
  1672. IN LPVOID lpAddress,
  1673. IN SIZE_T dwSize,
  1674. IN DWORD dwFreeType
  1675. );
  1676. WINBASEAPI
  1677. BOOL
  1678. WINAPI
  1679. VirtualProtectEx(
  1680. IN HANDLE hProcess,
  1681. IN LPVOID lpAddress,
  1682. IN SIZE_T dwSize,
  1683. IN DWORD flNewProtect,
  1684. OUT PDWORD lpflOldProtect
  1685. );
  1686. WINBASEAPI
  1687. SIZE_T
  1688. WINAPI
  1689. VirtualQueryEx(
  1690. IN HANDLE hProcess,
  1691. IN LPCVOID lpAddress,
  1692. OUT PMEMORY_BASIC_INFORMATION lpBuffer,
  1693. IN SIZE_T dwLength
  1694. );
  1695. WINBASEAPI
  1696. HANDLE
  1697. WINAPI
  1698. HeapCreate(
  1699. IN DWORD flOptions,
  1700. IN SIZE_T dwInitialSize,
  1701. IN SIZE_T dwMaximumSize
  1702. );
  1703. WINBASEAPI
  1704. BOOL
  1705. WINAPI
  1706. HeapDestroy(
  1707. IN OUT HANDLE hHeap
  1708. );
  1709. WINBASEAPI
  1710. LPVOID
  1711. WINAPI
  1712. HeapAlloc(
  1713. IN HANDLE hHeap,
  1714. IN DWORD dwFlags,
  1715. IN SIZE_T dwBytes
  1716. );
  1717. WINBASEAPI
  1718. LPVOID
  1719. WINAPI
  1720. HeapReAlloc(
  1721. IN HANDLE hHeap,
  1722. IN DWORD dwFlags,
  1723. IN LPVOID lpMem,
  1724. IN SIZE_T dwBytes
  1725. );
  1726. WINBASEAPI
  1727. BOOL
  1728. WINAPI
  1729. HeapFree(
  1730. IN HANDLE hHeap,
  1731. IN DWORD dwFlags,
  1732. IN LPVOID lpMem
  1733. );
  1734. WINBASEAPI
  1735. SIZE_T
  1736. WINAPI
  1737. HeapSize(
  1738. IN HANDLE hHeap,
  1739. IN DWORD dwFlags,
  1740. IN LPCVOID lpMem
  1741. );
  1742. WINBASEAPI
  1743. BOOL
  1744. WINAPI
  1745. HeapValidate(
  1746. IN HANDLE hHeap,
  1747. IN DWORD dwFlags,
  1748. IN LPCVOID lpMem
  1749. );
  1750. WINBASEAPI
  1751. SIZE_T
  1752. WINAPI
  1753. HeapCompact(
  1754. IN HANDLE hHeap,
  1755. IN DWORD dwFlags
  1756. );
  1757. WINBASEAPI
  1758. HANDLE
  1759. WINAPI
  1760. GetProcessHeap( VOID );
  1761. WINBASEAPI
  1762. DWORD
  1763. WINAPI
  1764. GetProcessHeaps(
  1765. IN DWORD NumberOfHeaps,
  1766. OUT PHANDLE ProcessHeaps
  1767. );
  1768. typedef struct _PROCESS_HEAP_ENTRY {
  1769. PVOID lpData;
  1770. DWORD cbData;
  1771. BYTE cbOverhead;
  1772. BYTE iRegionIndex;
  1773. WORD wFlags;
  1774. union {
  1775. struct {
  1776. HANDLE hMem;
  1777. DWORD dwReserved[ 3 ];
  1778. } Block;
  1779. struct {
  1780. DWORD dwCommittedSize;
  1781. DWORD dwUnCommittedSize;
  1782. LPVOID lpFirstBlock;
  1783. LPVOID lpLastBlock;
  1784. } Region;
  1785. };
  1786. } PROCESS_HEAP_ENTRY, *LPPROCESS_HEAP_ENTRY, *PPROCESS_HEAP_ENTRY;
  1787. #define PROCESS_HEAP_REGION 0x0001
  1788. #define PROCESS_HEAP_UNCOMMITTED_RANGE 0x0002
  1789. #define PROCESS_HEAP_ENTRY_BUSY 0x0004
  1790. #define PROCESS_HEAP_ENTRY_MOVEABLE 0x0010
  1791. #define PROCESS_HEAP_ENTRY_DDESHARE 0x0020
  1792. WINBASEAPI
  1793. BOOL
  1794. WINAPI
  1795. HeapLock(
  1796. IN HANDLE hHeap
  1797. );
  1798. WINBASEAPI
  1799. BOOL
  1800. WINAPI
  1801. HeapUnlock(
  1802. IN HANDLE hHeap
  1803. );
  1804. WINBASEAPI
  1805. BOOL
  1806. WINAPI
  1807. HeapWalk(
  1808. IN HANDLE hHeap,
  1809. IN OUT LPPROCESS_HEAP_ENTRY lpEntry
  1810. );
  1811. WINBASEAPI
  1812. BOOL
  1813. WINAPI
  1814. HeapSetInformation (
  1815. IN HANDLE HeapHandle,
  1816. IN HEAP_INFORMATION_CLASS HeapInformationClass,
  1817. IN PVOID HeapInformation OPTIONAL,
  1818. IN SIZE_T HeapInformationLength OPTIONAL
  1819. );
  1820. WINBASEAPI
  1821. BOOL
  1822. WINAPI
  1823. HeapQueryInformation (
  1824. IN HANDLE HeapHandle,
  1825. IN HEAP_INFORMATION_CLASS HeapInformationClass,
  1826. OUT PVOID HeapInformation OPTIONAL,
  1827. IN SIZE_T HeapInformationLength OPTIONAL,
  1828. OUT PSIZE_T ReturnLength OPTIONAL
  1829. );
  1830. // GetBinaryType return values.
  1831. #define SCS_32BIT_BINARY 0
  1832. #define SCS_DOS_BINARY 1
  1833. #define SCS_WOW_BINARY 2
  1834. #define SCS_PIF_BINARY 3
  1835. #define SCS_POSIX_BINARY 4
  1836. #define SCS_OS216_BINARY 5
  1837. #define SCS_64BIT_BINARY 6
  1838. #if defined(_WIN64)
  1839. # define SCS_THIS_PLATFORM_BINARY SCS_64BIT_BINARY
  1840. #else
  1841. # define SCS_THIS_PLATFORM_BINARY SCS_32BIT_BINARY
  1842. #endif
  1843. WINBASEAPI
  1844. BOOL
  1845. WINAPI
  1846. GetBinaryTypeA(
  1847. IN LPCSTR lpApplicationName,
  1848. OUT LPDWORD lpBinaryType
  1849. );
  1850. WINBASEAPI
  1851. BOOL
  1852. WINAPI
  1853. GetBinaryTypeW(
  1854. IN LPCWSTR lpApplicationName,
  1855. OUT LPDWORD lpBinaryType
  1856. );
  1857. #ifdef UNICODE
  1858. #define GetBinaryType GetBinaryTypeW
  1859. #else
  1860. #define GetBinaryType GetBinaryTypeA
  1861. #endif // !UNICODE
  1862. WINBASEAPI
  1863. DWORD
  1864. WINAPI
  1865. GetShortPathNameA(
  1866. IN LPCSTR lpszLongPath,
  1867. OUT LPSTR lpszShortPath,
  1868. IN DWORD cchBuffer
  1869. );
  1870. WINBASEAPI
  1871. DWORD
  1872. WINAPI
  1873. GetShortPathNameW(
  1874. IN LPCWSTR lpszLongPath,
  1875. OUT LPWSTR lpszShortPath,
  1876. IN DWORD cchBuffer
  1877. );
  1878. #ifdef UNICODE
  1879. #define GetShortPathName GetShortPathNameW
  1880. #else
  1881. #define GetShortPathName GetShortPathNameA
  1882. #endif // !UNICODE
  1883. WINBASEAPI
  1884. DWORD
  1885. WINAPI
  1886. GetLongPathNameA(
  1887. IN LPCSTR lpszShortPath,
  1888. OUT LPSTR lpszLongPath,
  1889. IN DWORD cchBuffer
  1890. );
  1891. WINBASEAPI
  1892. DWORD
  1893. WINAPI
  1894. GetLongPathNameW(
  1895. IN LPCWSTR lpszShortPath,
  1896. OUT LPWSTR lpszLongPath,
  1897. IN DWORD cchBuffer
  1898. );
  1899. #ifdef UNICODE
  1900. #define GetLongPathName GetLongPathNameW
  1901. #else
  1902. #define GetLongPathName GetLongPathNameA
  1903. #endif // !UNICODE
  1904. WINBASEAPI
  1905. BOOL
  1906. WINAPI
  1907. GetProcessAffinityMask(
  1908. IN HANDLE hProcess,
  1909. OUT PDWORD_PTR lpProcessAffinityMask,
  1910. OUT PDWORD_PTR lpSystemAffinityMask
  1911. );
  1912. WINBASEAPI
  1913. BOOL
  1914. WINAPI
  1915. SetProcessAffinityMask(
  1916. IN HANDLE hProcess,
  1917. IN DWORD_PTR dwProcessAffinityMask
  1918. );
  1919. #if _WIN32_WINNT >= 0x0501
  1920. WINBASEAPI
  1921. BOOL
  1922. WINAPI
  1923. GetProcessHandleCount(
  1924. IN HANDLE hProcess,
  1925. OUT PDWORD pdwHandleCount
  1926. );
  1927. #endif // (_WIN32_WINNT >= 0x0501)
  1928. WINBASEAPI
  1929. BOOL
  1930. WINAPI
  1931. GetProcessTimes(
  1932. IN HANDLE hProcess,
  1933. OUT LPFILETIME lpCreationTime,
  1934. OUT LPFILETIME lpExitTime,
  1935. OUT LPFILETIME lpKernelTime,
  1936. OUT LPFILETIME lpUserTime
  1937. );
  1938. WINBASEAPI
  1939. BOOL
  1940. WINAPI
  1941. GetProcessIoCounters(
  1942. IN HANDLE hProcess,
  1943. OUT PIO_COUNTERS lpIoCounters
  1944. );
  1945. WINBASEAPI
  1946. BOOL
  1947. WINAPI
  1948. GetProcessWorkingSetSize(
  1949. IN HANDLE hProcess,
  1950. OUT PSIZE_T lpMinimumWorkingSetSize,
  1951. OUT PSIZE_T lpMaximumWorkingSetSize
  1952. );
  1953. WINBASEAPI
  1954. BOOL
  1955. WINAPI
  1956. GetProcessWorkingSetSizeEx(
  1957. IN HANDLE hProcess,
  1958. OUT PSIZE_T lpMinimumWorkingSetSize,
  1959. OUT PSIZE_T lpMaximumWorkingSetSize,
  1960. OUT PDWORD Flags
  1961. );
  1962. WINBASEAPI
  1963. BOOL
  1964. WINAPI
  1965. SetProcessWorkingSetSize(
  1966. IN HANDLE hProcess,
  1967. IN SIZE_T dwMinimumWorkingSetSize,
  1968. IN SIZE_T dwMaximumWorkingSetSize
  1969. );
  1970. WINBASEAPI
  1971. BOOL
  1972. WINAPI
  1973. SetProcessWorkingSetSizeEx(
  1974. IN HANDLE hProcess,
  1975. IN SIZE_T dwMinimumWorkingSetSize,
  1976. IN SIZE_T dwMaximumWorkingSetSize,
  1977. IN DWORD Flags
  1978. );
  1979. WINBASEAPI
  1980. HANDLE
  1981. WINAPI
  1982. OpenProcess(
  1983. IN DWORD dwDesiredAccess,
  1984. IN BOOL bInheritHandle,
  1985. IN DWORD dwProcessId
  1986. );
  1987. WINBASEAPI
  1988. HANDLE
  1989. WINAPI
  1990. GetCurrentProcess(
  1991. VOID
  1992. );
  1993. WINBASEAPI
  1994. DWORD
  1995. WINAPI
  1996. GetCurrentProcessId(
  1997. VOID
  1998. );
  1999. WINBASEAPI
  2000. DECLSPEC_NORETURN
  2001. VOID
  2002. WINAPI
  2003. ExitProcess(
  2004. IN UINT uExitCode
  2005. );
  2006. WINBASEAPI
  2007. BOOL
  2008. WINAPI
  2009. TerminateProcess(
  2010. IN HANDLE hProcess,
  2011. IN UINT uExitCode
  2012. );
  2013. WINBASEAPI
  2014. BOOL
  2015. WINAPI
  2016. GetExitCodeProcess(
  2017. IN HANDLE hProcess,
  2018. OUT LPDWORD lpExitCode
  2019. );
  2020. WINBASEAPI
  2021. VOID
  2022. WINAPI
  2023. FatalExit(
  2024. IN int ExitCode
  2025. );
  2026. WINBASEAPI
  2027. LPSTR
  2028. WINAPI
  2029. GetEnvironmentStrings(
  2030. VOID
  2031. );
  2032. WINBASEAPI
  2033. LPWSTR
  2034. WINAPI
  2035. GetEnvironmentStringsW(
  2036. VOID
  2037. );
  2038. #ifdef UNICODE
  2039. #define GetEnvironmentStrings GetEnvironmentStringsW
  2040. #else
  2041. #define GetEnvironmentStringsA GetEnvironmentStrings
  2042. #endif // !UNICODE
  2043. WINBASEAPI
  2044. BOOL
  2045. WINAPI
  2046. SetEnvironmentStringsA(
  2047. IN LPSTR NewEnvironment
  2048. );
  2049. WINBASEAPI
  2050. BOOL
  2051. WINAPI
  2052. SetEnvironmentStringsW(
  2053. IN LPWSTR NewEnvironment
  2054. );
  2055. #ifdef UNICODE
  2056. #define SetEnvironmentStrings SetEnvironmentStringsW
  2057. #else
  2058. #define SetEnvironmentStrings SetEnvironmentStringsA
  2059. #endif // !UNICODE
  2060. WINBASEAPI
  2061. BOOL
  2062. WINAPI
  2063. FreeEnvironmentStringsA(
  2064. IN LPSTR
  2065. );
  2066. WINBASEAPI
  2067. BOOL
  2068. WINAPI
  2069. FreeEnvironmentStringsW(
  2070. IN LPWSTR
  2071. );
  2072. #ifdef UNICODE
  2073. #define FreeEnvironmentStrings FreeEnvironmentStringsW
  2074. #else
  2075. #define FreeEnvironmentStrings FreeEnvironmentStringsA
  2076. #endif // !UNICODE
  2077. WINBASEAPI
  2078. VOID
  2079. WINAPI
  2080. RaiseException(
  2081. IN DWORD dwExceptionCode,
  2082. IN DWORD dwExceptionFlags,
  2083. IN DWORD nNumberOfArguments,
  2084. IN CONST ULONG_PTR *lpArguments
  2085. );
  2086. WINBASEAPI
  2087. LONG
  2088. WINAPI
  2089. UnhandledExceptionFilter(
  2090. IN struct _EXCEPTION_POINTERS *ExceptionInfo
  2091. );
  2092. typedef LONG (WINAPI *PTOP_LEVEL_EXCEPTION_FILTER)(
  2093. struct _EXCEPTION_POINTERS *ExceptionInfo
  2094. );
  2095. typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER;
  2096. WINBASEAPI
  2097. LPTOP_LEVEL_EXCEPTION_FILTER
  2098. WINAPI
  2099. SetUnhandledExceptionFilter(
  2100. IN LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter
  2101. );
  2102. #if(_WIN32_WINNT >= 0x0400)
  2103. //
  2104. // Fiber creation flags
  2105. //
  2106. #define FIBER_FLAG_FLOAT_SWITCH 0x1 // context switch floating point
  2107. WINBASEAPI
  2108. LPVOID
  2109. WINAPI
  2110. CreateFiber(
  2111. IN SIZE_T dwStackSize,
  2112. IN LPFIBER_START_ROUTINE lpStartAddress,
  2113. IN LPVOID lpParameter
  2114. );
  2115. WINBASEAPI
  2116. LPVOID
  2117. WINAPI
  2118. CreateFiberEx(
  2119. SIZE_T dwStackCommitSize,
  2120. SIZE_T dwStackReserveSize,
  2121. DWORD dwFlags,
  2122. LPFIBER_START_ROUTINE lpStartAddress,
  2123. LPVOID lpParameter
  2124. );
  2125. WINBASEAPI
  2126. VOID
  2127. WINAPI
  2128. DeleteFiber(
  2129. IN LPVOID lpFiber
  2130. );
  2131. WINBASEAPI
  2132. LPVOID
  2133. WINAPI
  2134. ConvertThreadToFiber(
  2135. IN LPVOID lpParameter
  2136. );
  2137. WINBASEAPI
  2138. LPVOID
  2139. WINAPI
  2140. ConvertThreadToFiberEx(
  2141. IN LPVOID lpParameter,
  2142. IN DWORD dwFlags
  2143. );
  2144. WINBASEAPI
  2145. BOOL
  2146. WINAPI
  2147. ConvertFiberToThread(
  2148. VOID
  2149. );
  2150. WINBASEAPI
  2151. VOID
  2152. WINAPI
  2153. SwitchToFiber(
  2154. IN LPVOID lpFiber
  2155. );
  2156. WINBASEAPI
  2157. BOOL
  2158. WINAPI
  2159. SwitchToThread(
  2160. VOID
  2161. );
  2162. #endif /* _WIN32_WINNT >= 0x0400 */
  2163. WINBASEAPI
  2164. HANDLE
  2165. WINAPI
  2166. CreateThread(
  2167. IN LPSECURITY_ATTRIBUTES lpThreadAttributes,
  2168. IN SIZE_T dwStackSize,
  2169. IN LPTHREAD_START_ROUTINE lpStartAddress,
  2170. IN LPVOID lpParameter,
  2171. IN DWORD dwCreationFlags,
  2172. OUT LPDWORD lpThreadId
  2173. );
  2174. WINBASEAPI
  2175. HANDLE
  2176. WINAPI
  2177. CreateRemoteThread(
  2178. IN HANDLE hProcess,
  2179. IN LPSECURITY_ATTRIBUTES lpThreadAttributes,
  2180. IN SIZE_T dwStackSize,
  2181. IN LPTHREAD_START_ROUTINE lpStartAddress,
  2182. IN LPVOID lpParameter,
  2183. IN DWORD dwCreationFlags,
  2184. OUT LPDWORD lpThreadId
  2185. );
  2186. WINBASEAPI
  2187. HANDLE
  2188. WINAPI
  2189. GetCurrentThread(
  2190. VOID
  2191. );
  2192. WINBASEAPI
  2193. DWORD
  2194. WINAPI
  2195. GetCurrentThreadId(
  2196. VOID
  2197. );
  2198. WINBASEAPI
  2199. DWORD
  2200. WINAPI
  2201. GetProcessIdOfThread(
  2202. HANDLE Thread
  2203. );
  2204. WINBASEAPI
  2205. DWORD
  2206. WINAPI
  2207. GetThreadId(
  2208. HANDLE Thread
  2209. );
  2210. WINBASEAPI
  2211. DWORD
  2212. WINAPI
  2213. GetProcessId(
  2214. HANDLE Process
  2215. );
  2216. WINBASEAPI
  2217. DWORD
  2218. WINAPI
  2219. GetCurrentProcessorNumber(
  2220. VOID
  2221. );
  2222. WINBASEAPI
  2223. DWORD_PTR
  2224. WINAPI
  2225. SetThreadAffinityMask(
  2226. IN HANDLE hThread,
  2227. IN DWORD_PTR dwThreadAffinityMask
  2228. );
  2229. #if(_WIN32_WINNT >= 0x0400)
  2230. WINBASEAPI
  2231. DWORD
  2232. WINAPI
  2233. SetThreadIdealProcessor(
  2234. IN HANDLE hThread,
  2235. IN DWORD dwIdealProcessor
  2236. );
  2237. #endif /* _WIN32_WINNT >= 0x0400 */
  2238. WINBASEAPI
  2239. BOOL
  2240. WINAPI
  2241. SetProcessPriorityBoost(
  2242. IN HANDLE hProcess,
  2243. IN BOOL bDisablePriorityBoost
  2244. );
  2245. WINBASEAPI
  2246. BOOL
  2247. WINAPI
  2248. GetProcessPriorityBoost(
  2249. IN HANDLE hProcess,
  2250. OUT PBOOL pDisablePriorityBoost
  2251. );
  2252. WINBASEAPI
  2253. BOOL
  2254. WINAPI
  2255. RequestWakeupLatency(
  2256. IN LATENCY_TIME latency
  2257. );
  2258. WINBASEAPI
  2259. BOOL
  2260. WINAPI
  2261. IsSystemResumeAutomatic(
  2262. VOID
  2263. );
  2264. WINBASEAPI
  2265. HANDLE
  2266. WINAPI
  2267. OpenThread(
  2268. DWORD dwDesiredAccess,
  2269. BOOL bInheritHandle,
  2270. DWORD dwThreadId
  2271. );
  2272. WINBASEAPI
  2273. BOOL
  2274. WINAPI
  2275. SetThreadPriority(
  2276. IN HANDLE hThread,
  2277. IN int nPriority
  2278. );
  2279. WINBASEAPI
  2280. BOOL
  2281. WINAPI
  2282. SetThreadPriorityBoost(
  2283. IN HANDLE hThread,
  2284. IN BOOL bDisablePriorityBoost
  2285. );
  2286. WINBASEAPI
  2287. BOOL
  2288. WINAPI
  2289. GetThreadPriorityBoost(
  2290. IN HANDLE hThread,
  2291. OUT PBOOL pDisablePriorityBoost
  2292. );
  2293. WINBASEAPI
  2294. int
  2295. WINAPI
  2296. GetThreadPriority(
  2297. IN HANDLE hThread
  2298. );
  2299. WINBASEAPI
  2300. BOOL
  2301. WINAPI
  2302. GetThreadTimes(
  2303. IN HANDLE hThread,
  2304. OUT LPFILETIME lpCreationTime,
  2305. OUT LPFILETIME lpExitTime,
  2306. OUT LPFILETIME lpKernelTime,
  2307. OUT LPFILETIME lpUserTime
  2308. );
  2309. #if _WIN32_WINNT >= 0x0501
  2310. WINBASEAPI
  2311. BOOL
  2312. WINAPI
  2313. GetThreadIOPendingFlag(
  2314. IN HANDLE hThread,
  2315. OUT PBOOL lpIOIsPending
  2316. );
  2317. #endif // (_WIN32_WINNT >= 0x0501)
  2318. WINBASEAPI
  2319. DECLSPEC_NORETURN
  2320. VOID
  2321. WINAPI
  2322. ExitThread(
  2323. IN DWORD dwExitCode
  2324. );
  2325. WINBASEAPI
  2326. BOOL
  2327. WINAPI
  2328. TerminateThread(
  2329. IN OUT HANDLE hThread,
  2330. IN DWORD dwExitCode
  2331. );
  2332. WINBASEAPI
  2333. BOOL
  2334. WINAPI
  2335. GetExitCodeThread(
  2336. IN HANDLE hThread,
  2337. OUT LPDWORD lpExitCode
  2338. );
  2339. WINBASEAPI
  2340. BOOL
  2341. WINAPI
  2342. GetThreadSelectorEntry(
  2343. IN HANDLE hThread,
  2344. IN DWORD dwSelector,
  2345. OUT LPLDT_ENTRY lpSelectorEntry
  2346. );
  2347. WINBASEAPI
  2348. EXECUTION_STATE
  2349. WINAPI
  2350. SetThreadExecutionState(
  2351. IN EXECUTION_STATE esFlags
  2352. );
  2353. WINBASEAPI
  2354. DWORD
  2355. WINAPI
  2356. GetLastError(
  2357. VOID
  2358. );
  2359. WINBASEAPI
  2360. VOID
  2361. WINAPI
  2362. SetLastError(
  2363. IN DWORD dwErrCode
  2364. );
  2365. #if !defined(RC_INVOKED) // RC warns because "WINBASE_DECLARE_RESTORE_LAST_ERROR" is a bit long.
  2366. //#if _WIN32_WINNT >= 0x0501 || defined(WINBASE_DECLARE_RESTORE_LAST_ERROR)
  2367. #if defined(WINBASE_DECLARE_RESTORE_LAST_ERROR)
  2368. WINBASEAPI
  2369. VOID
  2370. WINAPI
  2371. RestoreLastError(
  2372. IN DWORD dwErrCode
  2373. );
  2374. typedef VOID (WINAPI* PRESTORE_LAST_ERROR)(DWORD);
  2375. #define RESTORE_LAST_ERROR_NAME_A "RestoreLastError"
  2376. #define RESTORE_LAST_ERROR_NAME_W L"RestoreLastError"
  2377. #define RESTORE_LAST_ERROR_NAME TEXT("RestoreLastError")
  2378. #endif
  2379. #endif
  2380. #define HasOverlappedIoCompleted(lpOverlapped) (((DWORD)(lpOverlapped)->Internal) != STATUS_PENDING)
  2381. WINBASEAPI
  2382. BOOL
  2383. WINAPI
  2384. GetOverlappedResult(
  2385. IN HANDLE hFile,
  2386. IN LPOVERLAPPED lpOverlapped,
  2387. OUT LPDWORD lpNumberOfBytesTransferred,
  2388. IN BOOL bWait
  2389. );
  2390. WINBASEAPI
  2391. HANDLE
  2392. WINAPI
  2393. CreateIoCompletionPort(
  2394. IN HANDLE FileHandle,
  2395. IN HANDLE ExistingCompletionPort,
  2396. IN ULONG_PTR CompletionKey,
  2397. IN DWORD NumberOfConcurrentThreads
  2398. );
  2399. WINBASEAPI
  2400. BOOL
  2401. WINAPI
  2402. GetQueuedCompletionStatus(
  2403. IN HANDLE CompletionPort,
  2404. OUT LPDWORD lpNumberOfBytesTransferred,
  2405. OUT PULONG_PTR lpCompletionKey,
  2406. OUT LPOVERLAPPED *lpOverlapped,
  2407. IN DWORD dwMilliseconds
  2408. );
  2409. WINBASEAPI
  2410. BOOL
  2411. WINAPI
  2412. PostQueuedCompletionStatus(
  2413. IN HANDLE CompletionPort,
  2414. IN DWORD dwNumberOfBytesTransferred,
  2415. IN ULONG_PTR dwCompletionKey,
  2416. IN LPOVERLAPPED lpOverlapped
  2417. );
  2418. #define SEM_FAILCRITICALERRORS 0x0001
  2419. #define SEM_NOGPFAULTERRORBOX 0x0002
  2420. #define SEM_NOALIGNMENTFAULTEXCEPT 0x0004
  2421. #define SEM_NOOPENFILEERRORBOX 0x8000
  2422. WINBASEAPI
  2423. UINT
  2424. WINAPI
  2425. SetErrorMode(
  2426. IN UINT uMode
  2427. );
  2428. WINBASEAPI
  2429. BOOL
  2430. WINAPI
  2431. ReadProcessMemory(
  2432. IN HANDLE hProcess,
  2433. IN LPCVOID lpBaseAddress,
  2434. OUT LPVOID lpBuffer,
  2435. IN SIZE_T nSize,
  2436. OUT SIZE_T * lpNumberOfBytesRead
  2437. );
  2438. WINBASEAPI
  2439. BOOL
  2440. WINAPI
  2441. WriteProcessMemory(
  2442. IN HANDLE hProcess,
  2443. IN LPVOID lpBaseAddress,
  2444. IN LPCVOID lpBuffer,
  2445. IN SIZE_T nSize,
  2446. OUT SIZE_T * lpNumberOfBytesWritten
  2447. );
  2448. #if !defined(MIDL_PASS)
  2449. WINBASEAPI
  2450. BOOL
  2451. WINAPI
  2452. GetThreadContext(
  2453. IN HANDLE hThread,
  2454. IN OUT LPCONTEXT lpContext
  2455. );
  2456. WINBASEAPI
  2457. BOOL
  2458. WINAPI
  2459. SetThreadContext(
  2460. IN HANDLE hThread,
  2461. IN CONST CONTEXT *lpContext
  2462. );
  2463. #endif
  2464. WINBASEAPI
  2465. DWORD
  2466. WINAPI
  2467. SuspendThread(
  2468. IN HANDLE hThread
  2469. );
  2470. WINBASEAPI
  2471. DWORD
  2472. WINAPI
  2473. ResumeThread(
  2474. IN HANDLE hThread
  2475. );
  2476. #if(_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)
  2477. typedef
  2478. VOID
  2479. (APIENTRY *PAPCFUNC)(
  2480. ULONG_PTR dwParam
  2481. );
  2482. WINBASEAPI
  2483. DWORD
  2484. WINAPI
  2485. QueueUserAPC(
  2486. IN PAPCFUNC pfnAPC,
  2487. IN HANDLE hThread,
  2488. IN ULONG_PTR dwData
  2489. );
  2490. #endif /* _WIN32_WINNT >= 0x0400 || _WIN32_WINDOWS > 0x0400 */
  2491. #if (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)
  2492. WINBASEAPI
  2493. BOOL
  2494. WINAPI
  2495. IsDebuggerPresent(
  2496. VOID
  2497. );
  2498. #endif
  2499. #if _WIN32_WINNT >= 0x0501
  2500. WINBASEAPI
  2501. BOOL
  2502. WINAPI
  2503. CheckRemoteDebuggerPresent(
  2504. IN HANDLE hProcess,
  2505. OUT PBOOL pbDebuggerPresent
  2506. );
  2507. #endif // (_WIN32_WINNT >= 0x0501)
  2508. WINBASEAPI
  2509. VOID
  2510. WINAPI
  2511. DebugBreak(
  2512. VOID
  2513. );
  2514. WINBASEAPI
  2515. BOOL
  2516. WINAPI
  2517. WaitForDebugEvent(
  2518. IN LPDEBUG_EVENT lpDebugEvent,
  2519. IN DWORD dwMilliseconds
  2520. );
  2521. WINBASEAPI
  2522. BOOL
  2523. WINAPI
  2524. ContinueDebugEvent(
  2525. IN DWORD dwProcessId,
  2526. IN DWORD dwThreadId,
  2527. IN DWORD dwContinueStatus
  2528. );
  2529. WINBASEAPI
  2530. BOOL
  2531. WINAPI
  2532. DebugActiveProcess(
  2533. IN DWORD dwProcessId
  2534. );
  2535. WINBASEAPI
  2536. BOOL
  2537. WINAPI
  2538. DebugActiveProcessStop(
  2539. IN DWORD dwProcessId
  2540. );
  2541. WINBASEAPI
  2542. BOOL
  2543. WINAPI
  2544. DebugSetProcessKillOnExit(
  2545. IN BOOL KillOnExit
  2546. );
  2547. WINBASEAPI
  2548. BOOL
  2549. WINAPI
  2550. DebugBreakProcess (
  2551. IN HANDLE Process
  2552. );
  2553. WINBASEAPI
  2554. VOID
  2555. WINAPI
  2556. InitializeCriticalSection(
  2557. OUT LPCRITICAL_SECTION lpCriticalSection
  2558. );
  2559. WINBASEAPI
  2560. VOID
  2561. WINAPI
  2562. EnterCriticalSection(
  2563. IN OUT LPCRITICAL_SECTION lpCriticalSection
  2564. );
  2565. WINBASEAPI
  2566. VOID
  2567. WINAPI
  2568. LeaveCriticalSection(
  2569. IN OUT LPCRITICAL_SECTION lpCriticalSection
  2570. );
  2571. #if (_WIN32_WINNT >= 0x0403)
  2572. WINBASEAPI
  2573. BOOL
  2574. WINAPI
  2575. InitializeCriticalSectionAndSpinCount(
  2576. IN OUT LPCRITICAL_SECTION lpCriticalSection,
  2577. IN DWORD dwSpinCount
  2578. );
  2579. WINBASEAPI
  2580. DWORD
  2581. WINAPI
  2582. SetCriticalSectionSpinCount(
  2583. IN OUT LPCRITICAL_SECTION lpCriticalSection,
  2584. IN DWORD dwSpinCount
  2585. );
  2586. #endif
  2587. #if(_WIN32_WINNT >= 0x0400)
  2588. WINBASEAPI
  2589. BOOL
  2590. WINAPI
  2591. TryEnterCriticalSection(
  2592. IN OUT LPCRITICAL_SECTION lpCriticalSection
  2593. );
  2594. #endif /* _WIN32_WINNT >= 0x0400 */
  2595. WINBASEAPI
  2596. VOID
  2597. WINAPI
  2598. DeleteCriticalSection(
  2599. IN OUT LPCRITICAL_SECTION lpCriticalSection
  2600. );
  2601. WINBASEAPI
  2602. BOOL
  2603. WINAPI
  2604. SetEvent(
  2605. IN HANDLE hEvent
  2606. );
  2607. WINBASEAPI
  2608. BOOL
  2609. WINAPI
  2610. ResetEvent(
  2611. IN HANDLE hEvent
  2612. );
  2613. WINBASEAPI
  2614. BOOL
  2615. WINAPI
  2616. PulseEvent(
  2617. IN HANDLE hEvent
  2618. );
  2619. WINBASEAPI
  2620. BOOL
  2621. WINAPI
  2622. ReleaseSemaphore(
  2623. IN HANDLE hSemaphore,
  2624. IN LONG lReleaseCount,
  2625. OUT LPLONG lpPreviousCount
  2626. );
  2627. WINBASEAPI
  2628. BOOL
  2629. WINAPI
  2630. ReleaseMutex(
  2631. IN HANDLE hMutex
  2632. );
  2633. WINBASEAPI
  2634. DWORD
  2635. WINAPI
  2636. WaitForSingleObject(
  2637. IN HANDLE hHandle,
  2638. IN DWORD dwMilliseconds
  2639. );
  2640. WINBASEAPI
  2641. DWORD
  2642. WINAPI
  2643. WaitForMultipleObjects(
  2644. IN DWORD nCount,
  2645. IN CONST HANDLE *lpHandles,
  2646. IN BOOL bWaitAll,
  2647. IN DWORD dwMilliseconds
  2648. );
  2649. WINBASEAPI
  2650. VOID
  2651. WINAPI
  2652. Sleep(
  2653. IN DWORD dwMilliseconds
  2654. );
  2655. WINBASEAPI
  2656. HGLOBAL
  2657. WINAPI
  2658. LoadResource(
  2659. IN HMODULE hModule,
  2660. IN HRSRC hResInfo
  2661. );
  2662. WINBASEAPI
  2663. DWORD
  2664. WINAPI
  2665. SizeofResource(
  2666. IN HMODULE hModule,
  2667. IN HRSRC hResInfo
  2668. );
  2669. WINBASEAPI
  2670. ATOM
  2671. WINAPI
  2672. GlobalDeleteAtom(
  2673. IN ATOM nAtom
  2674. );
  2675. WINBASEAPI
  2676. BOOL
  2677. WINAPI
  2678. InitAtomTable(
  2679. IN DWORD nSize
  2680. );
  2681. WINBASEAPI
  2682. ATOM
  2683. WINAPI
  2684. DeleteAtom(
  2685. IN ATOM nAtom
  2686. );
  2687. WINBASEAPI
  2688. UINT
  2689. WINAPI
  2690. SetHandleCount(
  2691. IN UINT uNumber
  2692. );
  2693. WINBASEAPI
  2694. DWORD
  2695. WINAPI
  2696. GetLogicalDrives(
  2697. VOID
  2698. );
  2699. WINBASEAPI
  2700. BOOL
  2701. WINAPI
  2702. LockFile(
  2703. IN HANDLE hFile,
  2704. IN DWORD dwFileOffsetLow,
  2705. IN DWORD dwFileOffsetHigh,
  2706. IN DWORD nNumberOfBytesToLockLow,
  2707. IN DWORD nNumberOfBytesToLockHigh
  2708. );
  2709. WINBASEAPI
  2710. BOOL
  2711. WINAPI
  2712. UnlockFile(
  2713. IN HANDLE hFile,
  2714. IN DWORD dwFileOffsetLow,
  2715. IN DWORD dwFileOffsetHigh,
  2716. IN DWORD nNumberOfBytesToUnlockLow,
  2717. IN DWORD nNumberOfBytesToUnlockHigh
  2718. );
  2719. WINBASEAPI
  2720. BOOL
  2721. WINAPI
  2722. LockFileEx(
  2723. IN HANDLE hFile,
  2724. IN DWORD dwFlags,
  2725. IN DWORD dwReserved,
  2726. IN DWORD nNumberOfBytesToLockLow,
  2727. IN DWORD nNumberOfBytesToLockHigh,
  2728. IN LPOVERLAPPED lpOverlapped
  2729. );
  2730. #define LOCKFILE_FAIL_IMMEDIATELY 0x00000001
  2731. #define LOCKFILE_EXCLUSIVE_LOCK 0x00000002
  2732. WINBASEAPI
  2733. BOOL
  2734. WINAPI
  2735. UnlockFileEx(
  2736. IN HANDLE hFile,
  2737. IN DWORD dwReserved,
  2738. IN DWORD nNumberOfBytesToUnlockLow,
  2739. IN DWORD nNumberOfBytesToUnlockHigh,
  2740. IN LPOVERLAPPED lpOverlapped
  2741. );
  2742. typedef struct _BY_HANDLE_FILE_INFORMATION {
  2743. DWORD dwFileAttributes;
  2744. FILETIME ftCreationTime;
  2745. FILETIME ftLastAccessTime;
  2746. FILETIME ftLastWriteTime;
  2747. DWORD dwVolumeSerialNumber;
  2748. DWORD nFileSizeHigh;
  2749. DWORD nFileSizeLow;
  2750. DWORD nNumberOfLinks;
  2751. DWORD nFileIndexHigh;
  2752. DWORD nFileIndexLow;
  2753. } BY_HANDLE_FILE_INFORMATION, *PBY_HANDLE_FILE_INFORMATION, *LPBY_HANDLE_FILE_INFORMATION;
  2754. WINBASEAPI
  2755. BOOL
  2756. WINAPI
  2757. GetFileInformationByHandle(
  2758. IN HANDLE hFile,
  2759. OUT LPBY_HANDLE_FILE_INFORMATION lpFileInformation
  2760. );
  2761. WINBASEAPI
  2762. DWORD
  2763. WINAPI
  2764. GetFileType(
  2765. IN HANDLE hFile
  2766. );
  2767. WINBASEAPI
  2768. DWORD
  2769. WINAPI
  2770. GetFileSize(
  2771. IN HANDLE hFile,
  2772. OUT LPDWORD lpFileSizeHigh
  2773. );
  2774. WINBASEAPI
  2775. BOOL
  2776. WINAPI
  2777. GetFileSizeEx(
  2778. HANDLE hFile,
  2779. PLARGE_INTEGER lpFileSize
  2780. );
  2781. WINBASEAPI
  2782. HANDLE
  2783. WINAPI
  2784. GetStdHandle(
  2785. IN DWORD nStdHandle
  2786. );
  2787. WINBASEAPI
  2788. BOOL
  2789. WINAPI
  2790. SetStdHandle(
  2791. IN DWORD nStdHandle,
  2792. IN HANDLE hHandle
  2793. );
  2794. WINBASEAPI
  2795. BOOL
  2796. WINAPI
  2797. WriteFile(
  2798. IN HANDLE hFile,
  2799. IN LPCVOID lpBuffer,
  2800. IN DWORD nNumberOfBytesToWrite,
  2801. OUT LPDWORD lpNumberOfBytesWritten,
  2802. IN LPOVERLAPPED lpOverlapped
  2803. );
  2804. WINBASEAPI
  2805. BOOL
  2806. WINAPI
  2807. ReadFile(
  2808. IN HANDLE hFile,
  2809. OUT LPVOID lpBuffer,
  2810. IN DWORD nNumberOfBytesToRead,
  2811. OUT LPDWORD lpNumberOfBytesRead,
  2812. IN LPOVERLAPPED lpOverlapped
  2813. );
  2814. WINBASEAPI
  2815. BOOL
  2816. WINAPI
  2817. FlushFileBuffers(
  2818. IN HANDLE hFile
  2819. );
  2820. WINBASEAPI
  2821. BOOL
  2822. WINAPI
  2823. DeviceIoControl(
  2824. IN HANDLE hDevice,
  2825. IN DWORD dwIoControlCode,
  2826. IN LPVOID lpInBuffer,
  2827. IN DWORD nInBufferSize,
  2828. OUT LPVOID lpOutBuffer,
  2829. IN DWORD nOutBufferSize,
  2830. OUT LPDWORD lpBytesReturned,
  2831. IN LPOVERLAPPED lpOverlapped
  2832. );
  2833. WINBASEAPI
  2834. BOOL
  2835. WINAPI
  2836. RequestDeviceWakeup(
  2837. IN HANDLE hDevice
  2838. );
  2839. WINBASEAPI
  2840. BOOL
  2841. WINAPI
  2842. CancelDeviceWakeupRequest(
  2843. IN HANDLE hDevice
  2844. );
  2845. WINBASEAPI
  2846. BOOL
  2847. WINAPI
  2848. GetDevicePowerState(
  2849. IN HANDLE hDevice,
  2850. OUT BOOL *pfOn
  2851. );
  2852. WINBASEAPI
  2853. BOOL
  2854. WINAPI
  2855. SetMessageWaitingIndicator(
  2856. IN HANDLE hMsgIndicator,
  2857. IN ULONG ulMsgCount
  2858. );
  2859. WINBASEAPI
  2860. BOOL
  2861. WINAPI
  2862. SetEndOfFile(
  2863. IN HANDLE hFile
  2864. );
  2865. WINBASEAPI
  2866. DWORD
  2867. WINAPI
  2868. SetFilePointer(
  2869. IN HANDLE hFile,
  2870. IN LONG lDistanceToMove,
  2871. IN PLONG lpDistanceToMoveHigh,
  2872. IN DWORD dwMoveMethod
  2873. );
  2874. WINBASEAPI
  2875. BOOL
  2876. WINAPI
  2877. SetFilePointerEx(
  2878. HANDLE hFile,
  2879. LARGE_INTEGER liDistanceToMove,
  2880. PLARGE_INTEGER lpNewFilePointer,
  2881. DWORD dwMoveMethod
  2882. );
  2883. WINBASEAPI
  2884. BOOL
  2885. WINAPI
  2886. FindClose(
  2887. IN OUT HANDLE hFindFile
  2888. );
  2889. WINBASEAPI
  2890. BOOL
  2891. WINAPI
  2892. GetFileTime(
  2893. IN HANDLE hFile,
  2894. OUT LPFILETIME lpCreationTime,
  2895. OUT LPFILETIME lpLastAccessTime,
  2896. OUT LPFILETIME lpLastWriteTime
  2897. );
  2898. WINBASEAPI
  2899. BOOL
  2900. WINAPI
  2901. SetFileTime(
  2902. IN HANDLE hFile,
  2903. IN CONST FILETIME *lpCreationTime,
  2904. IN CONST FILETIME *lpLastAccessTime,
  2905. IN CONST FILETIME *lpLastWriteTime
  2906. );
  2907. WINBASEAPI
  2908. BOOL
  2909. WINAPI
  2910. SetFileValidData(
  2911. IN HANDLE hFile,
  2912. IN LONGLONG ValidDataLength
  2913. );
  2914. WINBASEAPI
  2915. BOOL
  2916. WINAPI
  2917. SetFileShortNameA(
  2918. IN HANDLE hFile,
  2919. IN LPCSTR lpShortName
  2920. );
  2921. WINBASEAPI
  2922. BOOL
  2923. WINAPI
  2924. SetFileShortNameW(
  2925. IN HANDLE hFile,
  2926. IN LPCWSTR lpShortName
  2927. );
  2928. #ifdef UNICODE
  2929. #define SetFileShortName SetFileShortNameW
  2930. #else
  2931. #define SetFileShortName SetFileShortNameA
  2932. #endif // !UNICODE
  2933. WINBASEAPI
  2934. BOOL
  2935. WINAPI
  2936. CloseHandle(
  2937. IN OUT HANDLE hObject
  2938. );
  2939. WINBASEAPI
  2940. BOOL
  2941. WINAPI
  2942. DuplicateHandle(
  2943. IN HANDLE hSourceProcessHandle,
  2944. IN HANDLE hSourceHandle,
  2945. IN HANDLE hTargetProcessHandle,
  2946. OUT LPHANDLE lpTargetHandle,
  2947. IN DWORD dwDesiredAccess,
  2948. IN BOOL bInheritHandle,
  2949. IN DWORD dwOptions
  2950. );
  2951. WINBASEAPI
  2952. BOOL
  2953. WINAPI
  2954. GetHandleInformation(
  2955. IN HANDLE hObject,
  2956. OUT LPDWORD lpdwFlags
  2957. );
  2958. WINBASEAPI
  2959. BOOL
  2960. WINAPI
  2961. SetHandleInformation(
  2962. IN HANDLE hObject,
  2963. IN DWORD dwMask,
  2964. IN DWORD dwFlags
  2965. );
  2966. #define HANDLE_FLAG_INHERIT 0x00000001
  2967. #define HANDLE_FLAG_PROTECT_FROM_CLOSE 0x00000002
  2968. #define HINSTANCE_ERROR 32
  2969. WINBASEAPI
  2970. DWORD
  2971. WINAPI
  2972. LoadModule(
  2973. IN LPCSTR lpModuleName,
  2974. IN LPVOID lpParameterBlock
  2975. );
  2976. WINBASEAPI
  2977. UINT
  2978. WINAPI
  2979. WinExec(
  2980. IN LPCSTR lpCmdLine,
  2981. IN UINT uCmdShow
  2982. );
  2983. WINBASEAPI
  2984. BOOL
  2985. WINAPI
  2986. ClearCommBreak(
  2987. IN HANDLE hFile
  2988. );
  2989. WINBASEAPI
  2990. BOOL
  2991. WINAPI
  2992. ClearCommError(
  2993. IN HANDLE hFile,
  2994. OUT LPDWORD lpErrors,
  2995. OUT LPCOMSTAT lpStat
  2996. );
  2997. WINBASEAPI
  2998. BOOL
  2999. WINAPI
  3000. SetupComm(
  3001. IN HANDLE hFile,
  3002. IN DWORD dwInQueue,
  3003. IN DWORD dwOutQueue
  3004. );
  3005. WINBASEAPI
  3006. BOOL
  3007. WINAPI
  3008. EscapeCommFunction(
  3009. IN HANDLE hFile,
  3010. IN DWORD dwFunc
  3011. );
  3012. WINBASEAPI
  3013. BOOL
  3014. WINAPI
  3015. GetCommConfig(
  3016. IN HANDLE hCommDev,
  3017. OUT LPCOMMCONFIG lpCC,
  3018. IN OUT LPDWORD lpdwSize
  3019. );
  3020. WINBASEAPI
  3021. BOOL
  3022. WINAPI
  3023. GetCommMask(
  3024. IN HANDLE hFile,
  3025. OUT LPDWORD lpEvtMask
  3026. );
  3027. WINBASEAPI
  3028. BOOL
  3029. WINAPI
  3030. GetCommProperties(
  3031. IN HANDLE hFile,
  3032. OUT LPCOMMPROP lpCommProp
  3033. );
  3034. WINBASEAPI
  3035. BOOL
  3036. WINAPI
  3037. GetCommModemStatus(
  3038. IN HANDLE hFile,
  3039. OUT LPDWORD lpModemStat
  3040. );
  3041. WINBASEAPI
  3042. BOOL
  3043. WINAPI
  3044. GetCommState(
  3045. IN HANDLE hFile,
  3046. OUT LPDCB lpDCB
  3047. );
  3048. WINBASEAPI
  3049. BOOL
  3050. WINAPI
  3051. GetCommTimeouts(
  3052. IN HANDLE hFile,
  3053. OUT LPCOMMTIMEOUTS lpCommTimeouts
  3054. );
  3055. WINBASEAPI
  3056. BOOL
  3057. WINAPI
  3058. PurgeComm(
  3059. IN HANDLE hFile,
  3060. IN DWORD dwFlags
  3061. );
  3062. WINBASEAPI
  3063. BOOL
  3064. WINAPI
  3065. SetCommBreak(
  3066. IN HANDLE hFile
  3067. );
  3068. WINBASEAPI
  3069. BOOL
  3070. WINAPI
  3071. SetCommConfig(
  3072. IN HANDLE hCommDev,
  3073. IN LPCOMMCONFIG lpCC,
  3074. IN DWORD dwSize
  3075. );
  3076. WINBASEAPI
  3077. BOOL
  3078. WINAPI
  3079. SetCommMask(
  3080. IN HANDLE hFile,
  3081. IN DWORD dwEvtMask
  3082. );
  3083. WINBASEAPI
  3084. BOOL
  3085. WINAPI
  3086. SetCommState(
  3087. IN HANDLE hFile,
  3088. IN LPDCB lpDCB
  3089. );
  3090. WINBASEAPI
  3091. BOOL
  3092. WINAPI
  3093. SetCommTimeouts(
  3094. IN HANDLE hFile,
  3095. IN LPCOMMTIMEOUTS lpCommTimeouts
  3096. );
  3097. WINBASEAPI
  3098. BOOL
  3099. WINAPI
  3100. TransmitCommChar(
  3101. IN HANDLE hFile,
  3102. IN char cChar
  3103. );
  3104. WINBASEAPI
  3105. BOOL
  3106. WINAPI
  3107. WaitCommEvent(
  3108. IN HANDLE hFile,
  3109. OUT LPDWORD lpEvtMask,
  3110. IN LPOVERLAPPED lpOverlapped
  3111. );
  3112. WINBASEAPI
  3113. DWORD
  3114. WINAPI
  3115. SetTapePosition(
  3116. IN HANDLE hDevice,
  3117. IN DWORD dwPositionMethod,
  3118. IN DWORD dwPartition,
  3119. IN DWORD dwOffsetLow,
  3120. IN DWORD dwOffsetHigh,
  3121. IN BOOL bImmediate
  3122. );
  3123. WINBASEAPI
  3124. DWORD
  3125. WINAPI
  3126. GetTapePosition(
  3127. IN HANDLE hDevice,
  3128. IN DWORD dwPositionType,
  3129. OUT LPDWORD lpdwPartition,
  3130. OUT LPDWORD lpdwOffsetLow,
  3131. OUT LPDWORD lpdwOffsetHigh
  3132. );
  3133. WINBASEAPI
  3134. DWORD
  3135. WINAPI
  3136. PrepareTape(
  3137. IN HANDLE hDevice,
  3138. IN DWORD dwOperation,
  3139. IN BOOL bImmediate
  3140. );
  3141. WINBASEAPI
  3142. DWORD
  3143. WINAPI
  3144. EraseTape(
  3145. IN HANDLE hDevice,
  3146. IN DWORD dwEraseType,
  3147. IN BOOL bImmediate
  3148. );
  3149. WINBASEAPI
  3150. DWORD
  3151. WINAPI
  3152. CreateTapePartition(
  3153. IN HANDLE hDevice,
  3154. IN DWORD dwPartitionMethod,
  3155. IN DWORD dwCount,
  3156. IN DWORD dwSize
  3157. );
  3158. WINBASEAPI
  3159. DWORD
  3160. WINAPI
  3161. WriteTapemark(
  3162. IN HANDLE hDevice,
  3163. IN DWORD dwTapemarkType,
  3164. IN DWORD dwTapemarkCount,
  3165. IN BOOL bImmediate
  3166. );
  3167. WINBASEAPI
  3168. DWORD
  3169. WINAPI
  3170. GetTapeStatus(
  3171. IN HANDLE hDevice
  3172. );
  3173. WINBASEAPI
  3174. DWORD
  3175. WINAPI
  3176. GetTapeParameters(
  3177. IN HANDLE hDevice,
  3178. IN DWORD dwOperation,
  3179. OUT LPDWORD lpdwSize,
  3180. OUT LPVOID lpTapeInformation
  3181. );
  3182. #define GET_TAPE_MEDIA_INFORMATION 0
  3183. #define GET_TAPE_DRIVE_INFORMATION 1
  3184. WINBASEAPI
  3185. DWORD
  3186. WINAPI
  3187. SetTapeParameters(
  3188. IN HANDLE hDevice,
  3189. IN DWORD dwOperation,
  3190. IN LPVOID lpTapeInformation
  3191. );
  3192. #define SET_TAPE_MEDIA_INFORMATION 0
  3193. #define SET_TAPE_DRIVE_INFORMATION 1
  3194. WINBASEAPI
  3195. BOOL
  3196. WINAPI
  3197. Beep(
  3198. IN DWORD dwFreq,
  3199. IN DWORD dwDuration
  3200. );
  3201. WINBASEAPI
  3202. int
  3203. WINAPI
  3204. MulDiv(
  3205. IN int nNumber,
  3206. IN int nNumerator,
  3207. IN int nDenominator
  3208. );
  3209. WINBASEAPI
  3210. VOID
  3211. WINAPI
  3212. GetSystemTime(
  3213. OUT LPSYSTEMTIME lpSystemTime
  3214. );
  3215. WINBASEAPI
  3216. VOID
  3217. WINAPI
  3218. GetSystemTimeAsFileTime(
  3219. OUT LPFILETIME lpSystemTimeAsFileTime
  3220. );
  3221. WINBASEAPI
  3222. BOOL
  3223. WINAPI
  3224. SetSystemTime(
  3225. IN CONST SYSTEMTIME *lpSystemTime
  3226. );
  3227. WINBASEAPI
  3228. VOID
  3229. WINAPI
  3230. GetLocalTime(
  3231. OUT LPSYSTEMTIME lpSystemTime
  3232. );
  3233. WINBASEAPI
  3234. BOOL
  3235. WINAPI
  3236. SetLocalTime(
  3237. IN CONST SYSTEMTIME *lpSystemTime
  3238. );
  3239. WINBASEAPI
  3240. VOID
  3241. WINAPI
  3242. GetSystemInfo(
  3243. OUT LPSYSTEM_INFO lpSystemInfo
  3244. );
  3245. #if _WIN32_WINNT >= 0x0501
  3246. WINBASEAPI
  3247. BOOL
  3248. WINAPI
  3249. GetSystemRegistryQuota(
  3250. OUT PDWORD pdwQuotaAllowed,
  3251. OUT PDWORD pdwQuotaUsed
  3252. );
  3253. BOOL
  3254. WINAPI
  3255. GetSystemTimes(
  3256. LPFILETIME lpIdleTime,
  3257. LPFILETIME lpKernelTime,
  3258. LPFILETIME lpUserTime
  3259. );
  3260. #endif // (_WIN32_WINNT >= 0x0501)
  3261. #if _WIN32_WINNT >= 0x0501
  3262. WINBASEAPI
  3263. VOID
  3264. WINAPI
  3265. GetNativeSystemInfo(
  3266. OUT LPSYSTEM_INFO lpSystemInfo
  3267. );
  3268. #endif
  3269. WINBASEAPI
  3270. BOOL
  3271. WINAPI
  3272. IsProcessorFeaturePresent(
  3273. IN DWORD ProcessorFeature
  3274. );
  3275. typedef struct _TIME_ZONE_INFORMATION {
  3276. LONG Bias;
  3277. WCHAR StandardName[ 32 ];
  3278. SYSTEMTIME StandardDate;
  3279. LONG StandardBias;
  3280. WCHAR DaylightName[ 32 ];
  3281. SYSTEMTIME DaylightDate;
  3282. LONG DaylightBias;
  3283. } TIME_ZONE_INFORMATION, *PTIME_ZONE_INFORMATION, *LPTIME_ZONE_INFORMATION;
  3284. WINBASEAPI
  3285. BOOL
  3286. WINAPI
  3287. SystemTimeToTzSpecificLocalTime(
  3288. IN LPTIME_ZONE_INFORMATION lpTimeZoneInformation,
  3289. IN LPSYSTEMTIME lpUniversalTime,
  3290. OUT LPSYSTEMTIME lpLocalTime
  3291. );
  3292. WINBASEAPI
  3293. BOOL
  3294. WINAPI
  3295. TzSpecificLocalTimeToSystemTime(
  3296. IN LPTIME_ZONE_INFORMATION lpTimeZoneInformation,
  3297. IN LPSYSTEMTIME lpLocalTime,
  3298. OUT LPSYSTEMTIME lpUniversalTime
  3299. );
  3300. WINBASEAPI
  3301. DWORD
  3302. WINAPI
  3303. GetTimeZoneInformation(
  3304. OUT LPTIME_ZONE_INFORMATION lpTimeZoneInformation
  3305. );
  3306. WINBASEAPI
  3307. BOOL
  3308. WINAPI
  3309. SetTimeZoneInformation(
  3310. IN CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation
  3311. );
  3312. //
  3313. // Routines to convert back and forth between system time and file time
  3314. //
  3315. WINBASEAPI
  3316. BOOL
  3317. WINAPI
  3318. SystemTimeToFileTime(
  3319. IN CONST SYSTEMTIME *lpSystemTime,
  3320. OUT LPFILETIME lpFileTime
  3321. );
  3322. WINBASEAPI
  3323. BOOL
  3324. WINAPI
  3325. FileTimeToLocalFileTime(
  3326. IN CONST FILETIME *lpFileTime,
  3327. OUT LPFILETIME lpLocalFileTime
  3328. );
  3329. WINBASEAPI
  3330. BOOL
  3331. WINAPI
  3332. LocalFileTimeToFileTime(
  3333. IN CONST FILETIME *lpLocalFileTime,
  3334. OUT LPFILETIME lpFileTime
  3335. );
  3336. WINBASEAPI
  3337. BOOL
  3338. WINAPI
  3339. FileTimeToSystemTime(
  3340. IN CONST FILETIME *lpFileTime,
  3341. OUT LPSYSTEMTIME lpSystemTime
  3342. );
  3343. WINBASEAPI
  3344. LONG
  3345. WINAPI
  3346. CompareFileTime(
  3347. IN CONST FILETIME *lpFileTime1,
  3348. IN CONST FILETIME *lpFileTime2
  3349. );
  3350. WINBASEAPI
  3351. BOOL
  3352. WINAPI
  3353. FileTimeToDosDateTime(
  3354. IN CONST FILETIME *lpFileTime,
  3355. OUT LPWORD lpFatDate,
  3356. OUT LPWORD lpFatTime
  3357. );
  3358. WINBASEAPI
  3359. BOOL
  3360. WINAPI
  3361. DosDateTimeToFileTime(
  3362. IN WORD wFatDate,
  3363. IN WORD wFatTime,
  3364. OUT LPFILETIME lpFileTime
  3365. );
  3366. WINBASEAPI
  3367. DWORD
  3368. WINAPI
  3369. GetTickCount(
  3370. VOID
  3371. );
  3372. WINBASEAPI
  3373. BOOL
  3374. WINAPI
  3375. SetSystemTimeAdjustment(
  3376. IN DWORD dwTimeAdjustment,
  3377. IN BOOL bTimeAdjustmentDisabled
  3378. );
  3379. WINBASEAPI
  3380. BOOL
  3381. WINAPI
  3382. GetSystemTimeAdjustment(
  3383. OUT PDWORD lpTimeAdjustment,
  3384. OUT PDWORD lpTimeIncrement,
  3385. OUT PBOOL lpTimeAdjustmentDisabled
  3386. );
  3387. #if !defined(MIDL_PASS)
  3388. WINBASEAPI
  3389. DWORD
  3390. WINAPI
  3391. FormatMessageA(
  3392. IN DWORD dwFlags,
  3393. IN LPCVOID lpSource,
  3394. IN DWORD dwMessageId,
  3395. IN DWORD dwLanguageId,
  3396. OUT LPSTR lpBuffer,
  3397. IN DWORD nSize,
  3398. IN va_list *Arguments
  3399. );
  3400. WINBASEAPI
  3401. DWORD
  3402. WINAPI
  3403. FormatMessageW(
  3404. IN DWORD dwFlags,
  3405. IN LPCVOID lpSource,
  3406. IN DWORD dwMessageId,
  3407. IN DWORD dwLanguageId,
  3408. OUT LPWSTR lpBuffer,
  3409. IN DWORD nSize,
  3410. IN va_list *Arguments
  3411. );
  3412. #ifdef UNICODE
  3413. #define FormatMessage FormatMessageW
  3414. #else
  3415. #define FormatMessage FormatMessageA
  3416. #endif // !UNICODE
  3417. #endif
  3418. #define FORMAT_MESSAGE_ALLOCATE_BUFFER 0x00000100
  3419. #define FORMAT_MESSAGE_IGNORE_INSERTS 0x00000200
  3420. #define FORMAT_MESSAGE_FROM_STRING 0x00000400
  3421. #define FORMAT_MESSAGE_FROM_HMODULE 0x00000800
  3422. #define FORMAT_MESSAGE_FROM_SYSTEM 0x00001000
  3423. #define FORMAT_MESSAGE_ARGUMENT_ARRAY 0x00002000
  3424. #define FORMAT_MESSAGE_MAX_WIDTH_MASK 0x000000FF
  3425. WINBASEAPI
  3426. BOOL
  3427. WINAPI
  3428. CreatePipe(
  3429. OUT PHANDLE hReadPipe,
  3430. OUT PHANDLE hWritePipe,
  3431. IN LPSECURITY_ATTRIBUTES lpPipeAttributes,
  3432. IN DWORD nSize
  3433. );
  3434. WINBASEAPI
  3435. BOOL
  3436. WINAPI
  3437. ConnectNamedPipe(
  3438. IN HANDLE hNamedPipe,
  3439. IN LPOVERLAPPED lpOverlapped
  3440. );
  3441. WINBASEAPI
  3442. BOOL
  3443. WINAPI
  3444. DisconnectNamedPipe(
  3445. IN HANDLE hNamedPipe
  3446. );
  3447. WINBASEAPI
  3448. BOOL
  3449. WINAPI
  3450. SetNamedPipeHandleState(
  3451. IN HANDLE hNamedPipe,
  3452. IN LPDWORD lpMode,
  3453. IN LPDWORD lpMaxCollectionCount,
  3454. IN LPDWORD lpCollectDataTimeout
  3455. );
  3456. WINBASEAPI
  3457. BOOL
  3458. WINAPI
  3459. GetNamedPipeInfo(
  3460. IN HANDLE hNamedPipe,
  3461. IN LPDWORD lpFlags,
  3462. OUT LPDWORD lpOutBufferSize,
  3463. OUT LPDWORD lpInBufferSize,
  3464. OUT LPDWORD lpMaxInstances
  3465. );
  3466. WINBASEAPI
  3467. BOOL
  3468. WINAPI
  3469. PeekNamedPipe(
  3470. IN HANDLE hNamedPipe,
  3471. OUT LPVOID lpBuffer,
  3472. IN DWORD nBufferSize,
  3473. OUT LPDWORD lpBytesRead,
  3474. OUT LPDWORD lpTotalBytesAvail,
  3475. OUT LPDWORD lpBytesLeftThisMessage
  3476. );
  3477. WINBASEAPI
  3478. BOOL
  3479. WINAPI
  3480. TransactNamedPipe(
  3481. IN HANDLE hNamedPipe,
  3482. IN LPVOID lpInBuffer,
  3483. IN DWORD nInBufferSize,
  3484. OUT LPVOID lpOutBuffer,
  3485. IN DWORD nOutBufferSize,
  3486. OUT LPDWORD lpBytesRead,
  3487. IN LPOVERLAPPED lpOverlapped
  3488. );
  3489. WINBASEAPI
  3490. HANDLE
  3491. WINAPI
  3492. CreateMailslotA(
  3493. IN LPCSTR lpName,
  3494. IN DWORD nMaxMessageSize,
  3495. IN DWORD lReadTimeout,
  3496. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes
  3497. );
  3498. WINBASEAPI
  3499. HANDLE
  3500. WINAPI
  3501. CreateMailslotW(
  3502. IN LPCWSTR lpName,
  3503. IN DWORD nMaxMessageSize,
  3504. IN DWORD lReadTimeout,
  3505. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes
  3506. );
  3507. #ifdef UNICODE
  3508. #define CreateMailslot CreateMailslotW
  3509. #else
  3510. #define CreateMailslot CreateMailslotA
  3511. #endif // !UNICODE
  3512. WINBASEAPI
  3513. BOOL
  3514. WINAPI
  3515. GetMailslotInfo(
  3516. IN HANDLE hMailslot,
  3517. IN LPDWORD lpMaxMessageSize,
  3518. IN LPDWORD lpNextSize,
  3519. IN LPDWORD lpMessageCount,
  3520. IN LPDWORD lpReadTimeout
  3521. );
  3522. WINBASEAPI
  3523. BOOL
  3524. WINAPI
  3525. SetMailslotInfo(
  3526. IN HANDLE hMailslot,
  3527. IN DWORD lReadTimeout
  3528. );
  3529. WINBASEAPI
  3530. LPVOID
  3531. WINAPI
  3532. MapViewOfFile(
  3533. IN HANDLE hFileMappingObject,
  3534. IN DWORD dwDesiredAccess,
  3535. IN DWORD dwFileOffsetHigh,
  3536. IN DWORD dwFileOffsetLow,
  3537. IN SIZE_T dwNumberOfBytesToMap
  3538. );
  3539. WINBASEAPI
  3540. BOOL
  3541. WINAPI
  3542. FlushViewOfFile(
  3543. IN LPCVOID lpBaseAddress,
  3544. IN SIZE_T dwNumberOfBytesToFlush
  3545. );
  3546. WINBASEAPI
  3547. BOOL
  3548. WINAPI
  3549. UnmapViewOfFile(
  3550. IN LPCVOID lpBaseAddress
  3551. );
  3552. //
  3553. // File Encryption API
  3554. //
  3555. WINADVAPI
  3556. BOOL
  3557. WINAPI
  3558. EncryptFileA(
  3559. IN LPCSTR lpFileName
  3560. );
  3561. WINADVAPI
  3562. BOOL
  3563. WINAPI
  3564. EncryptFileW(
  3565. IN LPCWSTR lpFileName
  3566. );
  3567. #ifdef UNICODE
  3568. #define EncryptFile EncryptFileW
  3569. #else
  3570. #define EncryptFile EncryptFileA
  3571. #endif // !UNICODE
  3572. WINADVAPI
  3573. BOOL
  3574. WINAPI
  3575. DecryptFileA(
  3576. IN LPCSTR lpFileName,
  3577. IN DWORD dwReserved
  3578. );
  3579. WINADVAPI
  3580. BOOL
  3581. WINAPI
  3582. DecryptFileW(
  3583. IN LPCWSTR lpFileName,
  3584. IN DWORD dwReserved
  3585. );
  3586. #ifdef UNICODE
  3587. #define DecryptFile DecryptFileW
  3588. #else
  3589. #define DecryptFile DecryptFileA
  3590. #endif // !UNICODE
  3591. //
  3592. // Encryption Status Value
  3593. //
  3594. #define FILE_ENCRYPTABLE 0
  3595. #define FILE_IS_ENCRYPTED 1
  3596. #define FILE_SYSTEM_ATTR 2
  3597. #define FILE_ROOT_DIR 3
  3598. #define FILE_SYSTEM_DIR 4
  3599. #define FILE_UNKNOWN 5
  3600. #define FILE_SYSTEM_NOT_SUPPORT 6
  3601. #define FILE_USER_DISALLOWED 7
  3602. #define FILE_READ_ONLY 8
  3603. #define FILE_DIR_DISALLOWED 9
  3604. WINADVAPI
  3605. BOOL
  3606. WINAPI
  3607. FileEncryptionStatusA(
  3608. LPCSTR lpFileName,
  3609. LPDWORD lpStatus
  3610. );
  3611. WINADVAPI
  3612. BOOL
  3613. WINAPI
  3614. FileEncryptionStatusW(
  3615. LPCWSTR lpFileName,
  3616. LPDWORD lpStatus
  3617. );
  3618. #ifdef UNICODE
  3619. #define FileEncryptionStatus FileEncryptionStatusW
  3620. #else
  3621. #define FileEncryptionStatus FileEncryptionStatusA
  3622. #endif // !UNICODE
  3623. //
  3624. // Currently defined recovery flags
  3625. //
  3626. #define EFS_USE_RECOVERY_KEYS (0x1)
  3627. typedef
  3628. DWORD
  3629. (WINAPI *PFE_EXPORT_FUNC)(
  3630. PBYTE pbData,
  3631. PVOID pvCallbackContext,
  3632. ULONG ulLength
  3633. );
  3634. typedef
  3635. DWORD
  3636. (WINAPI *PFE_IMPORT_FUNC)(
  3637. PBYTE pbData,
  3638. PVOID pvCallbackContext,
  3639. PULONG ulLength
  3640. );
  3641. //
  3642. // OpenRaw flag values
  3643. //
  3644. #define CREATE_FOR_IMPORT (1)
  3645. #define CREATE_FOR_DIR (2)
  3646. #define OVERWRITE_HIDDEN (4)
  3647. WINADVAPI
  3648. DWORD
  3649. WINAPI
  3650. OpenEncryptedFileRawA(
  3651. IN LPCSTR lpFileName,
  3652. IN ULONG ulFlags,
  3653. IN PVOID * pvContext
  3654. );
  3655. WINADVAPI
  3656. DWORD
  3657. WINAPI
  3658. OpenEncryptedFileRawW(
  3659. IN LPCWSTR lpFileName,
  3660. IN ULONG ulFlags,
  3661. IN PVOID * pvContext
  3662. );
  3663. #ifdef UNICODE
  3664. #define OpenEncryptedFileRaw OpenEncryptedFileRawW
  3665. #else
  3666. #define OpenEncryptedFileRaw OpenEncryptedFileRawA
  3667. #endif // !UNICODE
  3668. WINADVAPI
  3669. DWORD
  3670. WINAPI
  3671. ReadEncryptedFileRaw(
  3672. IN PFE_EXPORT_FUNC pfExportCallback,
  3673. IN PVOID pvCallbackContext,
  3674. IN PVOID pvContext
  3675. );
  3676. WINADVAPI
  3677. DWORD
  3678. WINAPI
  3679. WriteEncryptedFileRaw(
  3680. IN PFE_IMPORT_FUNC pfImportCallback,
  3681. IN PVOID pvCallbackContext,
  3682. IN PVOID pvContext
  3683. );
  3684. WINADVAPI
  3685. VOID
  3686. WINAPI
  3687. CloseEncryptedFileRaw(
  3688. IN PVOID pvContext
  3689. );
  3690. //
  3691. // _l Compat Functions
  3692. //
  3693. WINBASEAPI
  3694. int
  3695. WINAPI
  3696. lstrcmpA(
  3697. IN LPCSTR lpString1,
  3698. IN LPCSTR lpString2
  3699. );
  3700. WINBASEAPI
  3701. int
  3702. WINAPI
  3703. lstrcmpW(
  3704. IN LPCWSTR lpString1,
  3705. IN LPCWSTR lpString2
  3706. );
  3707. #ifdef UNICODE
  3708. #define lstrcmp lstrcmpW
  3709. #else
  3710. #define lstrcmp lstrcmpA
  3711. #endif // !UNICODE
  3712. WINBASEAPI
  3713. int
  3714. WINAPI
  3715. lstrcmpiA(
  3716. IN LPCSTR lpString1,
  3717. IN LPCSTR lpString2
  3718. );
  3719. WINBASEAPI
  3720. int
  3721. WINAPI
  3722. lstrcmpiW(
  3723. IN LPCWSTR lpString1,
  3724. IN LPCWSTR lpString2
  3725. );
  3726. #ifdef UNICODE
  3727. #define lstrcmpi lstrcmpiW
  3728. #else
  3729. #define lstrcmpi lstrcmpiA
  3730. #endif // !UNICODE
  3731. WINBASEAPI
  3732. LPSTR
  3733. WINAPI
  3734. lstrcpynA(
  3735. OUT LPSTR lpString1,
  3736. IN LPCSTR lpString2,
  3737. IN int iMaxLength
  3738. );
  3739. WINBASEAPI
  3740. LPWSTR
  3741. WINAPI
  3742. lstrcpynW(
  3743. OUT LPWSTR lpString1,
  3744. IN LPCWSTR lpString2,
  3745. IN int iMaxLength
  3746. );
  3747. #ifdef UNICODE
  3748. #define lstrcpyn lstrcpynW
  3749. #else
  3750. #define lstrcpyn lstrcpynA
  3751. #endif // !UNICODE
  3752. WINBASEAPI
  3753. LPSTR
  3754. WINAPI
  3755. lstrcpyA(
  3756. OUT LPSTR lpString1,
  3757. IN LPCSTR lpString2
  3758. );
  3759. WINBASEAPI
  3760. LPWSTR
  3761. WINAPI
  3762. lstrcpyW(
  3763. OUT LPWSTR lpString1,
  3764. IN LPCWSTR lpString2
  3765. );
  3766. #ifdef UNICODE
  3767. #define lstrcpy lstrcpyW
  3768. #else
  3769. #define lstrcpy lstrcpyA
  3770. #endif // !UNICODE
  3771. WINBASEAPI
  3772. LPSTR
  3773. WINAPI
  3774. lstrcatA(
  3775. IN OUT LPSTR lpString1,
  3776. IN LPCSTR lpString2
  3777. );
  3778. WINBASEAPI
  3779. LPWSTR
  3780. WINAPI
  3781. lstrcatW(
  3782. IN OUT LPWSTR lpString1,
  3783. IN LPCWSTR lpString2
  3784. );
  3785. #ifdef UNICODE
  3786. #define lstrcat lstrcatW
  3787. #else
  3788. #define lstrcat lstrcatA
  3789. #endif // !UNICODE
  3790. WINBASEAPI
  3791. int
  3792. WINAPI
  3793. lstrlenA(
  3794. IN LPCSTR lpString
  3795. );
  3796. WINBASEAPI
  3797. int
  3798. WINAPI
  3799. lstrlenW(
  3800. IN LPCWSTR lpString
  3801. );
  3802. #ifdef UNICODE
  3803. #define lstrlen lstrlenW
  3804. #else
  3805. #define lstrlen lstrlenA
  3806. #endif // !UNICODE
  3807. WINBASEAPI
  3808. HFILE
  3809. WINAPI
  3810. OpenFile(
  3811. IN LPCSTR lpFileName,
  3812. OUT LPOFSTRUCT lpReOpenBuff,
  3813. IN UINT uStyle
  3814. );
  3815. WINBASEAPI
  3816. HFILE
  3817. WINAPI
  3818. _lopen(
  3819. IN LPCSTR lpPathName,
  3820. IN int iReadWrite
  3821. );
  3822. WINBASEAPI
  3823. HFILE
  3824. WINAPI
  3825. _lcreat(
  3826. IN LPCSTR lpPathName,
  3827. IN int iAttribute
  3828. );
  3829. WINBASEAPI
  3830. UINT
  3831. WINAPI
  3832. _lread(
  3833. IN HFILE hFile,
  3834. OUT LPVOID lpBuffer,
  3835. IN UINT uBytes
  3836. );
  3837. WINBASEAPI
  3838. UINT
  3839. WINAPI
  3840. _lwrite(
  3841. IN HFILE hFile,
  3842. IN LPCSTR lpBuffer,
  3843. IN UINT uBytes
  3844. );
  3845. WINBASEAPI
  3846. long
  3847. WINAPI
  3848. _hread(
  3849. IN HFILE hFile,
  3850. OUT LPVOID lpBuffer,
  3851. IN long lBytes
  3852. );
  3853. WINBASEAPI
  3854. long
  3855. WINAPI
  3856. _hwrite(
  3857. IN HFILE hFile,
  3858. IN LPCSTR lpBuffer,
  3859. IN long lBytes
  3860. );
  3861. WINBASEAPI
  3862. HFILE
  3863. WINAPI
  3864. _lclose(
  3865. IN OUT HFILE hFile
  3866. );
  3867. WINBASEAPI
  3868. LONG
  3869. WINAPI
  3870. _llseek(
  3871. IN HFILE hFile,
  3872. IN LONG lOffset,
  3873. IN int iOrigin
  3874. );
  3875. WINADVAPI
  3876. BOOL
  3877. WINAPI
  3878. IsTextUnicode(
  3879. IN CONST VOID* lpBuffer,
  3880. IN int cb,
  3881. IN OUT LPINT lpi
  3882. );
  3883. typedef
  3884. VOID
  3885. (WINAPI *PFLS_CALLBACK_FUNCTION) (
  3886. IN PVOID lpFlsData
  3887. );
  3888. #define FLS_OUT_OF_INDEXES ((DWORD)0xFFFFFFFF)
  3889. WINBASEAPI
  3890. DWORD
  3891. WINAPI
  3892. FlsAlloc(
  3893. IN PFLS_CALLBACK_FUNCTION lpCallback OPTIONAL
  3894. );
  3895. WINBASEAPI
  3896. PVOID
  3897. WINAPI
  3898. FlsGetValue(
  3899. IN DWORD dwFlsIndex
  3900. );
  3901. WINBASEAPI
  3902. BOOL
  3903. WINAPI
  3904. FlsSetValue(
  3905. IN DWORD dwFlsIndex,
  3906. IN PVOID lpFlsData
  3907. );
  3908. WINBASEAPI
  3909. BOOL
  3910. WINAPI
  3911. FlsFree(
  3912. IN DWORD dwFlsIndex
  3913. );
  3914. #define TLS_OUT_OF_INDEXES ((DWORD)0xFFFFFFFF)
  3915. WINBASEAPI
  3916. DWORD
  3917. WINAPI
  3918. TlsAlloc(
  3919. VOID
  3920. );
  3921. WINBASEAPI
  3922. LPVOID
  3923. WINAPI
  3924. TlsGetValue(
  3925. IN DWORD dwTlsIndex
  3926. );
  3927. WINBASEAPI
  3928. BOOL
  3929. WINAPI
  3930. TlsSetValue(
  3931. IN DWORD dwTlsIndex,
  3932. IN LPVOID lpTlsValue
  3933. );
  3934. WINBASEAPI
  3935. BOOL
  3936. WINAPI
  3937. TlsFree(
  3938. IN DWORD dwTlsIndex
  3939. );
  3940. typedef
  3941. VOID
  3942. (WINAPI *LPOVERLAPPED_COMPLETION_ROUTINE)(
  3943. DWORD dwErrorCode,
  3944. DWORD dwNumberOfBytesTransfered,
  3945. LPOVERLAPPED lpOverlapped
  3946. );
  3947. WINBASEAPI
  3948. DWORD
  3949. WINAPI
  3950. SleepEx(
  3951. IN DWORD dwMilliseconds,
  3952. IN BOOL bAlertable
  3953. );
  3954. WINBASEAPI
  3955. DWORD
  3956. WINAPI
  3957. WaitForSingleObjectEx(
  3958. IN HANDLE hHandle,
  3959. IN DWORD dwMilliseconds,
  3960. IN BOOL bAlertable
  3961. );
  3962. WINBASEAPI
  3963. DWORD
  3964. WINAPI
  3965. WaitForMultipleObjectsEx(
  3966. IN DWORD nCount,
  3967. IN CONST HANDLE *lpHandles,
  3968. IN BOOL bWaitAll,
  3969. IN DWORD dwMilliseconds,
  3970. IN BOOL bAlertable
  3971. );
  3972. #if(_WIN32_WINNT >= 0x0400)
  3973. WINBASEAPI
  3974. DWORD
  3975. WINAPI
  3976. SignalObjectAndWait(
  3977. IN HANDLE hObjectToSignal,
  3978. IN HANDLE hObjectToWaitOn,
  3979. IN DWORD dwMilliseconds,
  3980. IN BOOL bAlertable
  3981. );
  3982. #endif /* _WIN32_WINNT >= 0x0400 */
  3983. WINBASEAPI
  3984. BOOL
  3985. WINAPI
  3986. ReadFileEx(
  3987. IN HANDLE hFile,
  3988. OUT LPVOID lpBuffer,
  3989. IN DWORD nNumberOfBytesToRead,
  3990. IN LPOVERLAPPED lpOverlapped,
  3991. IN LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
  3992. );
  3993. WINBASEAPI
  3994. BOOL
  3995. WINAPI
  3996. WriteFileEx(
  3997. IN HANDLE hFile,
  3998. IN LPCVOID lpBuffer,
  3999. IN DWORD nNumberOfBytesToWrite,
  4000. IN LPOVERLAPPED lpOverlapped,
  4001. IN LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
  4002. );
  4003. WINBASEAPI
  4004. BOOL
  4005. WINAPI
  4006. BackupRead(
  4007. IN HANDLE hFile,
  4008. OUT LPBYTE lpBuffer,
  4009. IN DWORD nNumberOfBytesToRead,
  4010. OUT LPDWORD lpNumberOfBytesRead,
  4011. IN BOOL bAbort,
  4012. IN BOOL bProcessSecurity,
  4013. OUT LPVOID *lpContext
  4014. );
  4015. WINBASEAPI
  4016. BOOL
  4017. WINAPI
  4018. BackupSeek(
  4019. IN HANDLE hFile,
  4020. IN DWORD dwLowBytesToSeek,
  4021. IN DWORD dwHighBytesToSeek,
  4022. OUT LPDWORD lpdwLowByteSeeked,
  4023. OUT LPDWORD lpdwHighByteSeeked,
  4024. IN LPVOID *lpContext
  4025. );
  4026. WINBASEAPI
  4027. BOOL
  4028. WINAPI
  4029. BackupWrite(
  4030. IN HANDLE hFile,
  4031. IN LPBYTE lpBuffer,
  4032. IN DWORD nNumberOfBytesToWrite,
  4033. OUT LPDWORD lpNumberOfBytesWritten,
  4034. IN BOOL bAbort,
  4035. IN BOOL bProcessSecurity,
  4036. OUT LPVOID *lpContext
  4037. );
  4038. //
  4039. // Stream id structure
  4040. //
  4041. typedef struct _WIN32_STREAM_ID {
  4042. DWORD dwStreamId ;
  4043. DWORD dwStreamAttributes ;
  4044. LARGE_INTEGER Size ;
  4045. DWORD dwStreamNameSize ;
  4046. WCHAR cStreamName[ ANYSIZE_ARRAY ] ;
  4047. } WIN32_STREAM_ID, *LPWIN32_STREAM_ID ;
  4048. //
  4049. // Stream Ids
  4050. //
  4051. #define BACKUP_INVALID 0x00000000
  4052. #define BACKUP_DATA 0x00000001
  4053. #define BACKUP_EA_DATA 0x00000002
  4054. #define BACKUP_SECURITY_DATA 0x00000003
  4055. #define BACKUP_ALTERNATE_DATA 0x00000004
  4056. #define BACKUP_LINK 0x00000005
  4057. #define BACKUP_PROPERTY_DATA 0x00000006
  4058. #define BACKUP_OBJECT_ID 0x00000007
  4059. #define BACKUP_REPARSE_DATA 0x00000008
  4060. #define BACKUP_SPARSE_BLOCK 0x00000009
  4061. //
  4062. // Stream Attributes
  4063. //
  4064. #define STREAM_NORMAL_ATTRIBUTE 0x00000000
  4065. #define STREAM_MODIFIED_WHEN_READ 0x00000001
  4066. #define STREAM_CONTAINS_SECURITY 0x00000002
  4067. #define STREAM_CONTAINS_PROPERTIES 0x00000004
  4068. #define STREAM_SPARSE_ATTRIBUTE 0x00000008
  4069. WINBASEAPI
  4070. BOOL
  4071. WINAPI
  4072. ReadFileScatter(
  4073. IN HANDLE hFile,
  4074. IN FILE_SEGMENT_ELEMENT aSegmentArray[],
  4075. IN DWORD nNumberOfBytesToRead,
  4076. IN LPDWORD lpReserved,
  4077. IN LPOVERLAPPED lpOverlapped
  4078. );
  4079. WINBASEAPI
  4080. BOOL
  4081. WINAPI
  4082. WriteFileGather(
  4083. IN HANDLE hFile,
  4084. OUT FILE_SEGMENT_ELEMENT aSegmentArray[],
  4085. IN DWORD nNumberOfBytesToWrite,
  4086. IN LPDWORD lpReserved,
  4087. IN LPOVERLAPPED lpOverlapped
  4088. );
  4089. //
  4090. // Dual Mode API below this line. Dual Mode Structures also included.
  4091. //
  4092. #define STARTF_USESHOWWINDOW 0x00000001
  4093. #define STARTF_USESIZE 0x00000002
  4094. #define STARTF_USEPOSITION 0x00000004
  4095. #define STARTF_USECOUNTCHARS 0x00000008
  4096. #define STARTF_USEFILLATTRIBUTE 0x00000010
  4097. #define STARTF_RUNFULLSCREEN 0x00000020 // ignored for non-x86 platforms
  4098. #define STARTF_FORCEONFEEDBACK 0x00000040
  4099. #define STARTF_FORCEOFFFEEDBACK 0x00000080
  4100. #define STARTF_USESTDHANDLES 0x00000100
  4101. #if(WINVER >= 0x0400)
  4102. #define STARTF_USEHOTKEY 0x00000200
  4103. #endif /* WINVER >= 0x0400 */
  4104. typedef struct _STARTUPINFOA {
  4105. DWORD cb;
  4106. LPSTR lpReserved;
  4107. LPSTR lpDesktop;
  4108. LPSTR lpTitle;
  4109. DWORD dwX;
  4110. DWORD dwY;
  4111. DWORD dwXSize;
  4112. DWORD dwYSize;
  4113. DWORD dwXCountChars;
  4114. DWORD dwYCountChars;
  4115. DWORD dwFillAttribute;
  4116. DWORD dwFlags;
  4117. WORD wShowWindow;
  4118. WORD cbReserved2;
  4119. LPBYTE lpReserved2;
  4120. HANDLE hStdInput;
  4121. HANDLE hStdOutput;
  4122. HANDLE hStdError;
  4123. } STARTUPINFOA, *LPSTARTUPINFOA;
  4124. typedef struct _STARTUPINFOW {
  4125. DWORD cb;
  4126. LPWSTR lpReserved;
  4127. LPWSTR lpDesktop;
  4128. LPWSTR lpTitle;
  4129. DWORD dwX;
  4130. DWORD dwY;
  4131. DWORD dwXSize;
  4132. DWORD dwYSize;
  4133. DWORD dwXCountChars;
  4134. DWORD dwYCountChars;
  4135. DWORD dwFillAttribute;
  4136. DWORD dwFlags;
  4137. WORD wShowWindow;
  4138. WORD cbReserved2;
  4139. LPBYTE lpReserved2;
  4140. HANDLE hStdInput;
  4141. HANDLE hStdOutput;
  4142. HANDLE hStdError;
  4143. } STARTUPINFOW, *LPSTARTUPINFOW;
  4144. #ifdef UNICODE
  4145. typedef STARTUPINFOW STARTUPINFO;
  4146. typedef LPSTARTUPINFOW LPSTARTUPINFO;
  4147. #else
  4148. typedef STARTUPINFOA STARTUPINFO;
  4149. typedef LPSTARTUPINFOA LPSTARTUPINFO;
  4150. #endif // UNICODE
  4151. #define SHUTDOWN_NORETRY 0x00000001
  4152. typedef struct _WIN32_FIND_DATAA {
  4153. DWORD dwFileAttributes;
  4154. FILETIME ftCreationTime;
  4155. FILETIME ftLastAccessTime;
  4156. FILETIME ftLastWriteTime;
  4157. DWORD nFileSizeHigh;
  4158. DWORD nFileSizeLow;
  4159. DWORD dwReserved0;
  4160. DWORD dwReserved1;
  4161. CHAR cFileName[ MAX_PATH ];
  4162. CHAR cAlternateFileName[ 14 ];
  4163. #ifdef _MAC
  4164. DWORD dwFileType;
  4165. DWORD dwCreatorType;
  4166. WORD wFinderFlags;
  4167. #endif
  4168. } WIN32_FIND_DATAA, *PWIN32_FIND_DATAA, *LPWIN32_FIND_DATAA;
  4169. typedef struct _WIN32_FIND_DATAW {
  4170. DWORD dwFileAttributes;
  4171. FILETIME ftCreationTime;
  4172. FILETIME ftLastAccessTime;
  4173. FILETIME ftLastWriteTime;
  4174. DWORD nFileSizeHigh;
  4175. DWORD nFileSizeLow;
  4176. DWORD dwReserved0;
  4177. DWORD dwReserved1;
  4178. WCHAR cFileName[ MAX_PATH ];
  4179. WCHAR cAlternateFileName[ 14 ];
  4180. #ifdef _MAC
  4181. DWORD dwFileType;
  4182. DWORD dwCreatorType;
  4183. WORD wFinderFlags;
  4184. #endif
  4185. } WIN32_FIND_DATAW, *PWIN32_FIND_DATAW, *LPWIN32_FIND_DATAW;
  4186. #ifdef UNICODE
  4187. typedef WIN32_FIND_DATAW WIN32_FIND_DATA;
  4188. typedef PWIN32_FIND_DATAW PWIN32_FIND_DATA;
  4189. typedef LPWIN32_FIND_DATAW LPWIN32_FIND_DATA;
  4190. #else
  4191. typedef WIN32_FIND_DATAA WIN32_FIND_DATA;
  4192. typedef PWIN32_FIND_DATAA PWIN32_FIND_DATA;
  4193. typedef LPWIN32_FIND_DATAA LPWIN32_FIND_DATA;
  4194. #endif // UNICODE
  4195. typedef struct _WIN32_FILE_ATTRIBUTE_DATA {
  4196. DWORD dwFileAttributes;
  4197. FILETIME ftCreationTime;
  4198. FILETIME ftLastAccessTime;
  4199. FILETIME ftLastWriteTime;
  4200. DWORD nFileSizeHigh;
  4201. DWORD nFileSizeLow;
  4202. } WIN32_FILE_ATTRIBUTE_DATA, *LPWIN32_FILE_ATTRIBUTE_DATA;
  4203. WINBASEAPI
  4204. HANDLE
  4205. WINAPI
  4206. CreateMutexA(
  4207. IN LPSECURITY_ATTRIBUTES lpMutexAttributes,
  4208. IN BOOL bInitialOwner,
  4209. IN LPCSTR lpName
  4210. );
  4211. WINBASEAPI
  4212. HANDLE
  4213. WINAPI
  4214. CreateMutexW(
  4215. IN LPSECURITY_ATTRIBUTES lpMutexAttributes,
  4216. IN BOOL bInitialOwner,
  4217. IN LPCWSTR lpName
  4218. );
  4219. #ifdef UNICODE
  4220. #define CreateMutex CreateMutexW
  4221. #else
  4222. #define CreateMutex CreateMutexA
  4223. #endif // !UNICODE
  4224. WINBASEAPI
  4225. HANDLE
  4226. WINAPI
  4227. OpenMutexA(
  4228. IN DWORD dwDesiredAccess,
  4229. IN BOOL bInheritHandle,
  4230. IN LPCSTR lpName
  4231. );
  4232. WINBASEAPI
  4233. HANDLE
  4234. WINAPI
  4235. OpenMutexW(
  4236. IN DWORD dwDesiredAccess,
  4237. IN BOOL bInheritHandle,
  4238. IN LPCWSTR lpName
  4239. );
  4240. #ifdef UNICODE
  4241. #define OpenMutex OpenMutexW
  4242. #else
  4243. #define OpenMutex OpenMutexA
  4244. #endif // !UNICODE
  4245. WINBASEAPI
  4246. HANDLE
  4247. WINAPI
  4248. CreateEventA(
  4249. IN LPSECURITY_ATTRIBUTES lpEventAttributes,
  4250. IN BOOL bManualReset,
  4251. IN BOOL bInitialState,
  4252. IN LPCSTR lpName
  4253. );
  4254. WINBASEAPI
  4255. HANDLE
  4256. WINAPI
  4257. CreateEventW(
  4258. IN LPSECURITY_ATTRIBUTES lpEventAttributes,
  4259. IN BOOL bManualReset,
  4260. IN BOOL bInitialState,
  4261. IN LPCWSTR lpName
  4262. );
  4263. #ifdef UNICODE
  4264. #define CreateEvent CreateEventW
  4265. #else
  4266. #define CreateEvent CreateEventA
  4267. #endif // !UNICODE
  4268. WINBASEAPI
  4269. HANDLE
  4270. WINAPI
  4271. OpenEventA(
  4272. IN DWORD dwDesiredAccess,
  4273. IN BOOL bInheritHandle,
  4274. IN LPCSTR lpName
  4275. );
  4276. WINBASEAPI
  4277. HANDLE
  4278. WINAPI
  4279. OpenEventW(
  4280. IN DWORD dwDesiredAccess,
  4281. IN BOOL bInheritHandle,
  4282. IN LPCWSTR lpName
  4283. );
  4284. #ifdef UNICODE
  4285. #define OpenEvent OpenEventW
  4286. #else
  4287. #define OpenEvent OpenEventA
  4288. #endif // !UNICODE
  4289. WINBASEAPI
  4290. HANDLE
  4291. WINAPI
  4292. CreateSemaphoreA(
  4293. IN LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
  4294. IN LONG lInitialCount,
  4295. IN LONG lMaximumCount,
  4296. IN LPCSTR lpName
  4297. );
  4298. WINBASEAPI
  4299. HANDLE
  4300. WINAPI
  4301. CreateSemaphoreW(
  4302. IN LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
  4303. IN LONG lInitialCount,
  4304. IN LONG lMaximumCount,
  4305. IN LPCWSTR lpName
  4306. );
  4307. #ifdef UNICODE
  4308. #define CreateSemaphore CreateSemaphoreW
  4309. #else
  4310. #define CreateSemaphore CreateSemaphoreA
  4311. #endif // !UNICODE
  4312. WINBASEAPI
  4313. HANDLE
  4314. WINAPI
  4315. OpenSemaphoreA(
  4316. IN DWORD dwDesiredAccess,
  4317. IN BOOL bInheritHandle,
  4318. IN LPCSTR lpName
  4319. );
  4320. WINBASEAPI
  4321. HANDLE
  4322. WINAPI
  4323. OpenSemaphoreW(
  4324. IN DWORD dwDesiredAccess,
  4325. IN BOOL bInheritHandle,
  4326. IN LPCWSTR lpName
  4327. );
  4328. #ifdef UNICODE
  4329. #define OpenSemaphore OpenSemaphoreW
  4330. #else
  4331. #define OpenSemaphore OpenSemaphoreA
  4332. #endif // !UNICODE
  4333. #if (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)
  4334. typedef
  4335. VOID
  4336. (APIENTRY *PTIMERAPCROUTINE)(
  4337. LPVOID lpArgToCompletionRoutine,
  4338. DWORD dwTimerLowValue,
  4339. DWORD dwTimerHighValue
  4340. );
  4341. WINBASEAPI
  4342. HANDLE
  4343. WINAPI
  4344. CreateWaitableTimerA(
  4345. IN LPSECURITY_ATTRIBUTES lpTimerAttributes,
  4346. IN BOOL bManualReset,
  4347. IN LPCSTR lpTimerName
  4348. );
  4349. WINBASEAPI
  4350. HANDLE
  4351. WINAPI
  4352. CreateWaitableTimerW(
  4353. IN LPSECURITY_ATTRIBUTES lpTimerAttributes,
  4354. IN BOOL bManualReset,
  4355. IN LPCWSTR lpTimerName
  4356. );
  4357. #ifdef UNICODE
  4358. #define CreateWaitableTimer CreateWaitableTimerW
  4359. #else
  4360. #define CreateWaitableTimer CreateWaitableTimerA
  4361. #endif // !UNICODE
  4362. WINBASEAPI
  4363. HANDLE
  4364. WINAPI
  4365. OpenWaitableTimerA(
  4366. IN DWORD dwDesiredAccess,
  4367. IN BOOL bInheritHandle,
  4368. IN LPCSTR lpTimerName
  4369. );
  4370. WINBASEAPI
  4371. HANDLE
  4372. WINAPI
  4373. OpenWaitableTimerW(
  4374. IN DWORD dwDesiredAccess,
  4375. IN BOOL bInheritHandle,
  4376. IN LPCWSTR lpTimerName
  4377. );
  4378. #ifdef UNICODE
  4379. #define OpenWaitableTimer OpenWaitableTimerW
  4380. #else
  4381. #define OpenWaitableTimer OpenWaitableTimerA
  4382. #endif // !UNICODE
  4383. WINBASEAPI
  4384. BOOL
  4385. WINAPI
  4386. SetWaitableTimer(
  4387. IN HANDLE hTimer,
  4388. IN const LARGE_INTEGER *lpDueTime,
  4389. IN LONG lPeriod,
  4390. IN PTIMERAPCROUTINE pfnCompletionRoutine,
  4391. IN LPVOID lpArgToCompletionRoutine,
  4392. IN BOOL fResume
  4393. );
  4394. WINBASEAPI
  4395. BOOL
  4396. WINAPI
  4397. CancelWaitableTimer(
  4398. IN HANDLE hTimer
  4399. );
  4400. #endif /* (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400) */
  4401. WINBASEAPI
  4402. HANDLE
  4403. WINAPI
  4404. CreateFileMappingA(
  4405. IN HANDLE hFile,
  4406. IN LPSECURITY_ATTRIBUTES lpFileMappingAttributes,
  4407. IN DWORD flProtect,
  4408. IN DWORD dwMaximumSizeHigh,
  4409. IN DWORD dwMaximumSizeLow,
  4410. IN LPCSTR lpName
  4411. );
  4412. WINBASEAPI
  4413. HANDLE
  4414. WINAPI
  4415. CreateFileMappingW(
  4416. IN HANDLE hFile,
  4417. IN LPSECURITY_ATTRIBUTES lpFileMappingAttributes,
  4418. IN DWORD flProtect,
  4419. IN DWORD dwMaximumSizeHigh,
  4420. IN DWORD dwMaximumSizeLow,
  4421. IN LPCWSTR lpName
  4422. );
  4423. #ifdef UNICODE
  4424. #define CreateFileMapping CreateFileMappingW
  4425. #else
  4426. #define CreateFileMapping CreateFileMappingA
  4427. #endif // !UNICODE
  4428. WINBASEAPI
  4429. HANDLE
  4430. WINAPI
  4431. OpenFileMappingA(
  4432. IN DWORD dwDesiredAccess,
  4433. IN BOOL bInheritHandle,
  4434. IN LPCSTR lpName
  4435. );
  4436. WINBASEAPI
  4437. HANDLE
  4438. WINAPI
  4439. OpenFileMappingW(
  4440. IN DWORD dwDesiredAccess,
  4441. IN BOOL bInheritHandle,
  4442. IN LPCWSTR lpName
  4443. );
  4444. #ifdef UNICODE
  4445. #define OpenFileMapping OpenFileMappingW
  4446. #else
  4447. #define OpenFileMapping OpenFileMappingA
  4448. #endif // !UNICODE
  4449. WINBASEAPI
  4450. DWORD
  4451. WINAPI
  4452. GetLogicalDriveStringsA(
  4453. IN DWORD nBufferLength,
  4454. OUT LPSTR lpBuffer
  4455. );
  4456. WINBASEAPI
  4457. DWORD
  4458. WINAPI
  4459. GetLogicalDriveStringsW(
  4460. IN DWORD nBufferLength,
  4461. OUT LPWSTR lpBuffer
  4462. );
  4463. #ifdef UNICODE
  4464. #define GetLogicalDriveStrings GetLogicalDriveStringsW
  4465. #else
  4466. #define GetLogicalDriveStrings GetLogicalDriveStringsA
  4467. #endif // !UNICODE
  4468. #if _WIN32_WINNT >= 0x0501
  4469. typedef enum _MEMORY_RESOURCE_NOTIFICATION_TYPE {
  4470. LowMemoryResourceNotification,
  4471. HighMemoryResourceNotification
  4472. } MEMORY_RESOURCE_NOTIFICATION_TYPE;
  4473. WINBASEAPI
  4474. HANDLE
  4475. WINAPI
  4476. CreateMemoryResourceNotification(
  4477. IN MEMORY_RESOURCE_NOTIFICATION_TYPE NotificationType
  4478. );
  4479. WINBASEAPI
  4480. BOOL
  4481. WINAPI
  4482. QueryMemoryResourceNotification(
  4483. IN HANDLE ResourceNotificationHandle,
  4484. OUT PBOOL ResourceState
  4485. );
  4486. #endif // _WIN32_WINNT >= 0x0501
  4487. WINBASEAPI
  4488. HMODULE
  4489. WINAPI
  4490. LoadLibraryA(
  4491. IN LPCSTR lpLibFileName
  4492. );
  4493. WINBASEAPI
  4494. HMODULE
  4495. WINAPI
  4496. LoadLibraryW(
  4497. IN LPCWSTR lpLibFileName
  4498. );
  4499. #ifdef UNICODE
  4500. #define LoadLibrary LoadLibraryW
  4501. #else
  4502. #define LoadLibrary LoadLibraryA
  4503. #endif // !UNICODE
  4504. WINBASEAPI
  4505. HMODULE
  4506. WINAPI
  4507. LoadLibraryExA(
  4508. IN LPCSTR lpLibFileName,
  4509. IN HANDLE hFile,
  4510. IN DWORD dwFlags
  4511. );
  4512. WINBASEAPI
  4513. HMODULE
  4514. WINAPI
  4515. LoadLibraryExW(
  4516. IN LPCWSTR lpLibFileName,
  4517. IN HANDLE hFile,
  4518. IN DWORD dwFlags
  4519. );
  4520. #ifdef UNICODE
  4521. #define LoadLibraryEx LoadLibraryExW
  4522. #else
  4523. #define LoadLibraryEx LoadLibraryExA
  4524. #endif // !UNICODE
  4525. #define DONT_RESOLVE_DLL_REFERENCES 0x00000001
  4526. #define LOAD_LIBRARY_AS_DATAFILE 0x00000002
  4527. #define LOAD_WITH_ALTERED_SEARCH_PATH 0x00000008
  4528. #define LOAD_IGNORE_CODE_AUTHZ_LEVEL 0x00000010
  4529. WINBASEAPI
  4530. DWORD
  4531. WINAPI
  4532. GetModuleFileNameA(
  4533. IN HMODULE hModule,
  4534. OUT LPSTR lpFilename,
  4535. IN DWORD nSize
  4536. );
  4537. WINBASEAPI
  4538. DWORD
  4539. WINAPI
  4540. GetModuleFileNameW(
  4541. IN HMODULE hModule,
  4542. OUT LPWSTR lpFilename,
  4543. IN DWORD nSize
  4544. );
  4545. #ifdef UNICODE
  4546. #define GetModuleFileName GetModuleFileNameW
  4547. #else
  4548. #define GetModuleFileName GetModuleFileNameA
  4549. #endif // !UNICODE
  4550. WINBASEAPI
  4551. HMODULE
  4552. WINAPI
  4553. GetModuleHandleA(
  4554. IN LPCSTR lpModuleName
  4555. );
  4556. WINBASEAPI
  4557. HMODULE
  4558. WINAPI
  4559. GetModuleHandleW(
  4560. IN LPCWSTR lpModuleName
  4561. );
  4562. #ifdef UNICODE
  4563. #define GetModuleHandle GetModuleHandleW
  4564. #else
  4565. #define GetModuleHandle GetModuleHandleA
  4566. #endif // !UNICODE
  4567. #if !defined(RC_INVOKED)
  4568. #if _WIN32_WINNT > 0x0500 || defined(WINBASE_DECLARE_GET_MODULE_HANDLE_EX) || ISOLATION_AWARE_ENABLED
  4569. #define GET_MODULE_HANDLE_EX_FLAG_PIN (0x00000001)
  4570. #define GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT (0x00000002)
  4571. #define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS (0x00000004)
  4572. typedef
  4573. BOOL
  4574. (WINAPI*
  4575. PGET_MODULE_HANDLE_EXA)(
  4576. IN DWORD dwFlags,
  4577. IN LPCSTR lpModuleName,
  4578. OUT HMODULE* phModule
  4579. );
  4580. typedef
  4581. BOOL
  4582. (WINAPI*
  4583. PGET_MODULE_HANDLE_EXW)(
  4584. IN DWORD dwFlags,
  4585. IN LPCWSTR lpModuleName,
  4586. OUT HMODULE* phModule
  4587. );
  4588. #ifdef UNICODE
  4589. #define PGET_MODULE_HANDLE_EX PGET_MODULE_HANDLE_EXW
  4590. #else
  4591. #define PGET_MODULE_HANDLE_EX PGET_MODULE_HANDLE_EXA
  4592. #endif // !UNICODE
  4593. WINBASEAPI
  4594. BOOL
  4595. WINAPI
  4596. GetModuleHandleExA(
  4597. IN DWORD dwFlags,
  4598. IN LPCSTR lpModuleName,
  4599. OUT HMODULE* phModule
  4600. );
  4601. WINBASEAPI
  4602. BOOL
  4603. WINAPI
  4604. GetModuleHandleExW(
  4605. IN DWORD dwFlags,
  4606. IN LPCWSTR lpModuleName,
  4607. OUT HMODULE* phModule
  4608. );
  4609. #ifdef UNICODE
  4610. #define GetModuleHandleEx GetModuleHandleExW
  4611. #else
  4612. #define GetModuleHandleEx GetModuleHandleExA
  4613. #endif // !UNICODE
  4614. #endif
  4615. #endif
  4616. #if _WIN32_WINNT >= 0x0502
  4617. WINBASEAPI
  4618. BOOL
  4619. WINAPI
  4620. NeedCurrentDirectoryForExePathA(
  4621. IN LPCSTR ExeName
  4622. );
  4623. WINBASEAPI
  4624. BOOL
  4625. WINAPI
  4626. NeedCurrentDirectoryForExePathW(
  4627. IN LPCWSTR ExeName
  4628. );
  4629. #ifdef UNICODE
  4630. #define NeedCurrentDirectoryForExePath NeedCurrentDirectoryForExePathW
  4631. #else
  4632. #define NeedCurrentDirectoryForExePath NeedCurrentDirectoryForExePathA
  4633. #endif // !UNICODE
  4634. #endif
  4635. WINBASEAPI
  4636. BOOL
  4637. WINAPI
  4638. CreateProcessA(
  4639. IN LPCSTR lpApplicationName,
  4640. IN LPSTR lpCommandLine,
  4641. IN LPSECURITY_ATTRIBUTES lpProcessAttributes,
  4642. IN LPSECURITY_ATTRIBUTES lpThreadAttributes,
  4643. IN BOOL bInheritHandles,
  4644. IN DWORD dwCreationFlags,
  4645. IN LPVOID lpEnvironment,
  4646. IN LPCSTR lpCurrentDirectory,
  4647. IN LPSTARTUPINFOA lpStartupInfo,
  4648. OUT LPPROCESS_INFORMATION lpProcessInformation
  4649. );
  4650. WINBASEAPI
  4651. BOOL
  4652. WINAPI
  4653. CreateProcessW(
  4654. IN LPCWSTR lpApplicationName,
  4655. IN LPWSTR lpCommandLine,
  4656. IN LPSECURITY_ATTRIBUTES lpProcessAttributes,
  4657. IN LPSECURITY_ATTRIBUTES lpThreadAttributes,
  4658. IN BOOL bInheritHandles,
  4659. IN DWORD dwCreationFlags,
  4660. IN LPVOID lpEnvironment,
  4661. IN LPCWSTR lpCurrentDirectory,
  4662. IN LPSTARTUPINFOW lpStartupInfo,
  4663. OUT LPPROCESS_INFORMATION lpProcessInformation
  4664. );
  4665. #ifdef UNICODE
  4666. #define CreateProcess CreateProcessW
  4667. #else
  4668. #define CreateProcess CreateProcessA
  4669. #endif // !UNICODE
  4670. WINBASEAPI
  4671. BOOL
  4672. WINAPI
  4673. SetProcessShutdownParameters(
  4674. IN DWORD dwLevel,
  4675. IN DWORD dwFlags
  4676. );
  4677. WINBASEAPI
  4678. BOOL
  4679. WINAPI
  4680. GetProcessShutdownParameters(
  4681. OUT LPDWORD lpdwLevel,
  4682. OUT LPDWORD lpdwFlags
  4683. );
  4684. WINBASEAPI
  4685. DWORD
  4686. WINAPI
  4687. GetProcessVersion(
  4688. IN DWORD ProcessId
  4689. );
  4690. WINBASEAPI
  4691. VOID
  4692. WINAPI
  4693. FatalAppExitA(
  4694. IN UINT uAction,
  4695. IN LPCSTR lpMessageText
  4696. );
  4697. WINBASEAPI
  4698. VOID
  4699. WINAPI
  4700. FatalAppExitW(
  4701. IN UINT uAction,
  4702. IN LPCWSTR lpMessageText
  4703. );
  4704. #ifdef UNICODE
  4705. #define FatalAppExit FatalAppExitW
  4706. #else
  4707. #define FatalAppExit FatalAppExitA
  4708. #endif // !UNICODE
  4709. WINBASEAPI
  4710. VOID
  4711. WINAPI
  4712. GetStartupInfoA(
  4713. OUT LPSTARTUPINFOA lpStartupInfo
  4714. );
  4715. WINBASEAPI
  4716. VOID
  4717. WINAPI
  4718. GetStartupInfoW(
  4719. OUT LPSTARTUPINFOW lpStartupInfo
  4720. );
  4721. #ifdef UNICODE
  4722. #define GetStartupInfo GetStartupInfoW
  4723. #else
  4724. #define GetStartupInfo GetStartupInfoA
  4725. #endif // !UNICODE
  4726. WINBASEAPI
  4727. LPSTR
  4728. WINAPI
  4729. GetCommandLineA(
  4730. VOID
  4731. );
  4732. WINBASEAPI
  4733. LPWSTR
  4734. WINAPI
  4735. GetCommandLineW(
  4736. VOID
  4737. );
  4738. #ifdef UNICODE
  4739. #define GetCommandLine GetCommandLineW
  4740. #else
  4741. #define GetCommandLine GetCommandLineA
  4742. #endif // !UNICODE
  4743. WINBASEAPI
  4744. DWORD
  4745. WINAPI
  4746. GetEnvironmentVariableA(
  4747. IN LPCSTR lpName,
  4748. OUT LPSTR lpBuffer,
  4749. IN DWORD nSize
  4750. );
  4751. WINBASEAPI
  4752. DWORD
  4753. WINAPI
  4754. GetEnvironmentVariableW(
  4755. IN LPCWSTR lpName,
  4756. OUT LPWSTR lpBuffer,
  4757. IN DWORD nSize
  4758. );
  4759. #ifdef UNICODE
  4760. #define GetEnvironmentVariable GetEnvironmentVariableW
  4761. #else
  4762. #define GetEnvironmentVariable GetEnvironmentVariableA
  4763. #endif // !UNICODE
  4764. WINBASEAPI
  4765. BOOL
  4766. WINAPI
  4767. SetEnvironmentVariableA(
  4768. IN LPCSTR lpName,
  4769. IN LPCSTR lpValue
  4770. );
  4771. WINBASEAPI
  4772. BOOL
  4773. WINAPI
  4774. SetEnvironmentVariableW(
  4775. IN LPCWSTR lpName,
  4776. IN LPCWSTR lpValue
  4777. );
  4778. #ifdef UNICODE
  4779. #define SetEnvironmentVariable SetEnvironmentVariableW
  4780. #else
  4781. #define SetEnvironmentVariable SetEnvironmentVariableA
  4782. #endif // !UNICODE
  4783. WINBASEAPI
  4784. DWORD
  4785. WINAPI
  4786. ExpandEnvironmentStringsA(
  4787. IN LPCSTR lpSrc,
  4788. OUT LPSTR lpDst,
  4789. IN DWORD nSize
  4790. );
  4791. WINBASEAPI
  4792. DWORD
  4793. WINAPI
  4794. ExpandEnvironmentStringsW(
  4795. IN LPCWSTR lpSrc,
  4796. OUT LPWSTR lpDst,
  4797. IN DWORD nSize
  4798. );
  4799. #ifdef UNICODE
  4800. #define ExpandEnvironmentStrings ExpandEnvironmentStringsW
  4801. #else
  4802. #define ExpandEnvironmentStrings ExpandEnvironmentStringsA
  4803. #endif // !UNICODE
  4804. WINBASEAPI
  4805. DWORD
  4806. WINAPI
  4807. GetFirmwareEnvironmentVariableA(
  4808. IN LPCSTR lpName,
  4809. IN LPCSTR lpGuid,
  4810. OUT PVOID pBuffer,
  4811. IN DWORD nSize
  4812. );
  4813. WINBASEAPI
  4814. DWORD
  4815. WINAPI
  4816. GetFirmwareEnvironmentVariableW(
  4817. IN LPCWSTR lpName,
  4818. IN LPCWSTR lpGuid,
  4819. OUT PVOID pBuffer,
  4820. IN DWORD nSize
  4821. );
  4822. #ifdef UNICODE
  4823. #define GetFirmwareEnvironmentVariable GetFirmwareEnvironmentVariableW
  4824. #else
  4825. #define GetFirmwareEnvironmentVariable GetFirmwareEnvironmentVariableA
  4826. #endif // !UNICODE
  4827. WINBASEAPI
  4828. BOOL
  4829. WINAPI
  4830. SetFirmwareEnvironmentVariableA(
  4831. IN LPCSTR lpName,
  4832. IN LPCSTR lpGuid,
  4833. IN PVOID pValue,
  4834. IN DWORD nSize
  4835. );
  4836. WINBASEAPI
  4837. BOOL
  4838. WINAPI
  4839. SetFirmwareEnvironmentVariableW(
  4840. IN LPCWSTR lpName,
  4841. IN LPCWSTR lpGuid,
  4842. IN PVOID pValue,
  4843. IN DWORD nSize
  4844. );
  4845. #ifdef UNICODE
  4846. #define SetFirmwareEnvironmentVariable SetFirmwareEnvironmentVariableW
  4847. #else
  4848. #define SetFirmwareEnvironmentVariable SetFirmwareEnvironmentVariableA
  4849. #endif // !UNICODE
  4850. WINBASEAPI
  4851. VOID
  4852. WINAPI
  4853. OutputDebugStringA(
  4854. IN LPCSTR lpOutputString
  4855. );
  4856. WINBASEAPI
  4857. VOID
  4858. WINAPI
  4859. OutputDebugStringW(
  4860. IN LPCWSTR lpOutputString
  4861. );
  4862. #ifdef UNICODE
  4863. #define OutputDebugString OutputDebugStringW
  4864. #else
  4865. #define OutputDebugString OutputDebugStringA
  4866. #endif // !UNICODE
  4867. WINBASEAPI
  4868. HRSRC
  4869. WINAPI
  4870. FindResourceA(
  4871. IN HMODULE hModule,
  4872. IN LPCSTR lpName,
  4873. IN LPCSTR lpType
  4874. );
  4875. WINBASEAPI
  4876. HRSRC
  4877. WINAPI
  4878. FindResourceW(
  4879. IN HMODULE hModule,
  4880. IN LPCWSTR lpName,
  4881. IN LPCWSTR lpType
  4882. );
  4883. #ifdef UNICODE
  4884. #define FindResource FindResourceW
  4885. #else
  4886. #define FindResource FindResourceA
  4887. #endif // !UNICODE
  4888. WINBASEAPI
  4889. HRSRC
  4890. WINAPI
  4891. FindResourceExA(
  4892. IN HMODULE hModule,
  4893. IN LPCSTR lpType,
  4894. IN LPCSTR lpName,
  4895. IN WORD wLanguage
  4896. );
  4897. WINBASEAPI
  4898. HRSRC
  4899. WINAPI
  4900. FindResourceExW(
  4901. IN HMODULE hModule,
  4902. IN LPCWSTR lpType,
  4903. IN LPCWSTR lpName,
  4904. IN WORD wLanguage
  4905. );
  4906. #ifdef UNICODE
  4907. #define FindResourceEx FindResourceExW
  4908. #else
  4909. #define FindResourceEx FindResourceExA
  4910. #endif // !UNICODE
  4911. #ifdef STRICT
  4912. typedef BOOL (CALLBACK* ENUMRESTYPEPROCA)(HMODULE hModule, LPSTR lpType,
  4913. LONG_PTR lParam);
  4914. typedef BOOL (CALLBACK* ENUMRESTYPEPROCW)(HMODULE hModule, LPWSTR lpType,
  4915. LONG_PTR lParam);
  4916. #ifdef UNICODE
  4917. #define ENUMRESTYPEPROC ENUMRESTYPEPROCW
  4918. #else
  4919. #define ENUMRESTYPEPROC ENUMRESTYPEPROCA
  4920. #endif // !UNICODE
  4921. typedef BOOL (CALLBACK* ENUMRESNAMEPROCA)(HMODULE hModule, LPCSTR lpType,
  4922. LPSTR lpName, LONG_PTR lParam);
  4923. typedef BOOL (CALLBACK* ENUMRESNAMEPROCW)(HMODULE hModule, LPCWSTR lpType,
  4924. LPWSTR lpName, LONG_PTR lParam);
  4925. #ifdef UNICODE
  4926. #define ENUMRESNAMEPROC ENUMRESNAMEPROCW
  4927. #else
  4928. #define ENUMRESNAMEPROC ENUMRESNAMEPROCA
  4929. #endif // !UNICODE
  4930. typedef BOOL (CALLBACK* ENUMRESLANGPROCA)(HMODULE hModule, LPCSTR lpType,
  4931. LPCSTR lpName, WORD wLanguage, LONG_PTR lParam);
  4932. typedef BOOL (CALLBACK* ENUMRESLANGPROCW)(HMODULE hModule, LPCWSTR lpType,
  4933. LPCWSTR lpName, WORD wLanguage, LONG_PTR lParam);
  4934. #ifdef UNICODE
  4935. #define ENUMRESLANGPROC ENUMRESLANGPROCW
  4936. #else
  4937. #define ENUMRESLANGPROC ENUMRESLANGPROCA
  4938. #endif // !UNICODE
  4939. #else
  4940. typedef FARPROC ENUMRESTYPEPROCA;
  4941. typedef FARPROC ENUMRESTYPEPROCW;
  4942. #ifdef UNICODE
  4943. typedef ENUMRESTYPEPROCW ENUMRESTYPEPROC;
  4944. #else
  4945. typedef ENUMRESTYPEPROCA ENUMRESTYPEPROC;
  4946. #endif // UNICODE
  4947. typedef FARPROC ENUMRESNAMEPROCA;
  4948. typedef FARPROC ENUMRESNAMEPROCW;
  4949. #ifdef UNICODE
  4950. typedef ENUMRESNAMEPROCW ENUMRESNAMEPROC;
  4951. #else
  4952. typedef ENUMRESNAMEPROCA ENUMRESNAMEPROC;
  4953. #endif // UNICODE
  4954. typedef FARPROC ENUMRESLANGPROCA;
  4955. typedef FARPROC ENUMRESLANGPROCW;
  4956. #ifdef UNICODE
  4957. typedef ENUMRESLANGPROCW ENUMRESLANGPROC;
  4958. #else
  4959. typedef ENUMRESLANGPROCA ENUMRESLANGPROC;
  4960. #endif // UNICODE
  4961. #endif
  4962. WINBASEAPI
  4963. BOOL
  4964. WINAPI
  4965. EnumResourceTypesA(
  4966. IN HMODULE hModule,
  4967. IN ENUMRESTYPEPROCA lpEnumFunc,
  4968. IN LONG_PTR lParam
  4969. );
  4970. WINBASEAPI
  4971. BOOL
  4972. WINAPI
  4973. EnumResourceTypesW(
  4974. IN HMODULE hModule,
  4975. IN ENUMRESTYPEPROCW lpEnumFunc,
  4976. IN LONG_PTR lParam
  4977. );
  4978. #ifdef UNICODE
  4979. #define EnumResourceTypes EnumResourceTypesW
  4980. #else
  4981. #define EnumResourceTypes EnumResourceTypesA
  4982. #endif // !UNICODE
  4983. WINBASEAPI
  4984. BOOL
  4985. WINAPI
  4986. EnumResourceNamesA(
  4987. IN HMODULE hModule,
  4988. IN LPCSTR lpType,
  4989. IN ENUMRESNAMEPROCA lpEnumFunc,
  4990. IN LONG_PTR lParam
  4991. );
  4992. WINBASEAPI
  4993. BOOL
  4994. WINAPI
  4995. EnumResourceNamesW(
  4996. IN HMODULE hModule,
  4997. IN LPCWSTR lpType,
  4998. IN ENUMRESNAMEPROCW lpEnumFunc,
  4999. IN LONG_PTR lParam
  5000. );
  5001. #ifdef UNICODE
  5002. #define EnumResourceNames EnumResourceNamesW
  5003. #else
  5004. #define EnumResourceNames EnumResourceNamesA
  5005. #endif // !UNICODE
  5006. WINBASEAPI
  5007. BOOL
  5008. WINAPI
  5009. EnumResourceLanguagesA(
  5010. IN HMODULE hModule,
  5011. IN LPCSTR lpType,
  5012. IN LPCSTR lpName,
  5013. IN ENUMRESLANGPROCA lpEnumFunc,
  5014. IN LONG_PTR lParam
  5015. );
  5016. WINBASEAPI
  5017. BOOL
  5018. WINAPI
  5019. EnumResourceLanguagesW(
  5020. IN HMODULE hModule,
  5021. IN LPCWSTR lpType,
  5022. IN LPCWSTR lpName,
  5023. IN ENUMRESLANGPROCW lpEnumFunc,
  5024. IN LONG_PTR lParam
  5025. );
  5026. #ifdef UNICODE
  5027. #define EnumResourceLanguages EnumResourceLanguagesW
  5028. #else
  5029. #define EnumResourceLanguages EnumResourceLanguagesA
  5030. #endif // !UNICODE
  5031. WINBASEAPI
  5032. HANDLE
  5033. WINAPI
  5034. BeginUpdateResourceA(
  5035. IN LPCSTR pFileName,
  5036. IN BOOL bDeleteExistingResources
  5037. );
  5038. WINBASEAPI
  5039. HANDLE
  5040. WINAPI
  5041. BeginUpdateResourceW(
  5042. IN LPCWSTR pFileName,
  5043. IN BOOL bDeleteExistingResources
  5044. );
  5045. #ifdef UNICODE
  5046. #define BeginUpdateResource BeginUpdateResourceW
  5047. #else
  5048. #define BeginUpdateResource BeginUpdateResourceA
  5049. #endif // !UNICODE
  5050. WINBASEAPI
  5051. BOOL
  5052. WINAPI
  5053. UpdateResourceA(
  5054. IN HANDLE hUpdate,
  5055. IN LPCSTR lpType,
  5056. IN LPCSTR lpName,
  5057. IN WORD wLanguage,
  5058. IN LPVOID lpData,
  5059. IN DWORD cbData
  5060. );
  5061. WINBASEAPI
  5062. BOOL
  5063. WINAPI
  5064. UpdateResourceW(
  5065. IN HANDLE hUpdate,
  5066. IN LPCWSTR lpType,
  5067. IN LPCWSTR lpName,
  5068. IN WORD wLanguage,
  5069. IN LPVOID lpData,
  5070. IN DWORD cbData
  5071. );
  5072. #ifdef UNICODE
  5073. #define UpdateResource UpdateResourceW
  5074. #else
  5075. #define UpdateResource UpdateResourceA
  5076. #endif // !UNICODE
  5077. WINBASEAPI
  5078. BOOL
  5079. WINAPI
  5080. EndUpdateResourceA(
  5081. IN HANDLE hUpdate,
  5082. IN BOOL fDiscard
  5083. );
  5084. WINBASEAPI
  5085. BOOL
  5086. WINAPI
  5087. EndUpdateResourceW(
  5088. IN HANDLE hUpdate,
  5089. IN BOOL fDiscard
  5090. );
  5091. #ifdef UNICODE
  5092. #define EndUpdateResource EndUpdateResourceW
  5093. #else
  5094. #define EndUpdateResource EndUpdateResourceA
  5095. #endif // !UNICODE
  5096. WINBASEAPI
  5097. ATOM
  5098. WINAPI
  5099. GlobalAddAtomA(
  5100. IN LPCSTR lpString
  5101. );
  5102. WINBASEAPI
  5103. ATOM
  5104. WINAPI
  5105. GlobalAddAtomW(
  5106. IN LPCWSTR lpString
  5107. );
  5108. #ifdef UNICODE
  5109. #define GlobalAddAtom GlobalAddAtomW
  5110. #else
  5111. #define GlobalAddAtom GlobalAddAtomA
  5112. #endif // !UNICODE
  5113. WINBASEAPI
  5114. ATOM
  5115. WINAPI
  5116. GlobalFindAtomA(
  5117. IN LPCSTR lpString
  5118. );
  5119. WINBASEAPI
  5120. ATOM
  5121. WINAPI
  5122. GlobalFindAtomW(
  5123. IN LPCWSTR lpString
  5124. );
  5125. #ifdef UNICODE
  5126. #define GlobalFindAtom GlobalFindAtomW
  5127. #else
  5128. #define GlobalFindAtom GlobalFindAtomA
  5129. #endif // !UNICODE
  5130. WINBASEAPI
  5131. UINT
  5132. WINAPI
  5133. GlobalGetAtomNameA(
  5134. IN ATOM nAtom,
  5135. OUT LPSTR lpBuffer,
  5136. IN int nSize
  5137. );
  5138. WINBASEAPI
  5139. UINT
  5140. WINAPI
  5141. GlobalGetAtomNameW(
  5142. IN ATOM nAtom,
  5143. OUT LPWSTR lpBuffer,
  5144. IN int nSize
  5145. );
  5146. #ifdef UNICODE
  5147. #define GlobalGetAtomName GlobalGetAtomNameW
  5148. #else
  5149. #define GlobalGetAtomName GlobalGetAtomNameA
  5150. #endif // !UNICODE
  5151. WINBASEAPI
  5152. ATOM
  5153. WINAPI
  5154. AddAtomA(
  5155. IN LPCSTR lpString
  5156. );
  5157. WINBASEAPI
  5158. ATOM
  5159. WINAPI
  5160. AddAtomW(
  5161. IN LPCWSTR lpString
  5162. );
  5163. #ifdef UNICODE
  5164. #define AddAtom AddAtomW
  5165. #else
  5166. #define AddAtom AddAtomA
  5167. #endif // !UNICODE
  5168. WINBASEAPI
  5169. ATOM
  5170. WINAPI
  5171. FindAtomA(
  5172. IN LPCSTR lpString
  5173. );
  5174. WINBASEAPI
  5175. ATOM
  5176. WINAPI
  5177. FindAtomW(
  5178. IN LPCWSTR lpString
  5179. );
  5180. #ifdef UNICODE
  5181. #define FindAtom FindAtomW
  5182. #else
  5183. #define FindAtom FindAtomA
  5184. #endif // !UNICODE
  5185. WINBASEAPI
  5186. UINT
  5187. WINAPI
  5188. GetAtomNameA(
  5189. IN ATOM nAtom,
  5190. OUT LPSTR lpBuffer,
  5191. IN int nSize
  5192. );
  5193. WINBASEAPI
  5194. UINT
  5195. WINAPI
  5196. GetAtomNameW(
  5197. IN ATOM nAtom,
  5198. OUT LPWSTR lpBuffer,
  5199. IN int nSize
  5200. );
  5201. #ifdef UNICODE
  5202. #define GetAtomName GetAtomNameW
  5203. #else
  5204. #define GetAtomName GetAtomNameA
  5205. #endif // !UNICODE
  5206. WINBASEAPI
  5207. UINT
  5208. WINAPI
  5209. GetProfileIntA(
  5210. IN LPCSTR lpAppName,
  5211. IN LPCSTR lpKeyName,
  5212. IN INT nDefault
  5213. );
  5214. WINBASEAPI
  5215. UINT
  5216. WINAPI
  5217. GetProfileIntW(
  5218. IN LPCWSTR lpAppName,
  5219. IN LPCWSTR lpKeyName,
  5220. IN INT nDefault
  5221. );
  5222. #ifdef UNICODE
  5223. #define GetProfileInt GetProfileIntW
  5224. #else
  5225. #define GetProfileInt GetProfileIntA
  5226. #endif // !UNICODE
  5227. WINBASEAPI
  5228. DWORD
  5229. WINAPI
  5230. GetProfileStringA(
  5231. IN LPCSTR lpAppName,
  5232. IN LPCSTR lpKeyName,
  5233. IN LPCSTR lpDefault,
  5234. OUT LPSTR lpReturnedString,
  5235. IN DWORD nSize
  5236. );
  5237. WINBASEAPI
  5238. DWORD
  5239. WINAPI
  5240. GetProfileStringW(
  5241. IN LPCWSTR lpAppName,
  5242. IN LPCWSTR lpKeyName,
  5243. IN LPCWSTR lpDefault,
  5244. OUT LPWSTR lpReturnedString,
  5245. IN DWORD nSize
  5246. );
  5247. #ifdef UNICODE
  5248. #define GetProfileString GetProfileStringW
  5249. #else
  5250. #define GetProfileString GetProfileStringA
  5251. #endif // !UNICODE
  5252. WINBASEAPI
  5253. BOOL
  5254. WINAPI
  5255. WriteProfileStringA(
  5256. IN LPCSTR lpAppName,
  5257. IN LPCSTR lpKeyName,
  5258. IN LPCSTR lpString
  5259. );
  5260. WINBASEAPI
  5261. BOOL
  5262. WINAPI
  5263. WriteProfileStringW(
  5264. IN LPCWSTR lpAppName,
  5265. IN LPCWSTR lpKeyName,
  5266. IN LPCWSTR lpString
  5267. );
  5268. #ifdef UNICODE
  5269. #define WriteProfileString WriteProfileStringW
  5270. #else
  5271. #define WriteProfileString WriteProfileStringA
  5272. #endif // !UNICODE
  5273. WINBASEAPI
  5274. DWORD
  5275. WINAPI
  5276. GetProfileSectionA(
  5277. IN LPCSTR lpAppName,
  5278. OUT LPSTR lpReturnedString,
  5279. IN DWORD nSize
  5280. );
  5281. WINBASEAPI
  5282. DWORD
  5283. WINAPI
  5284. GetProfileSectionW(
  5285. IN LPCWSTR lpAppName,
  5286. OUT LPWSTR lpReturnedString,
  5287. IN DWORD nSize
  5288. );
  5289. #ifdef UNICODE
  5290. #define GetProfileSection GetProfileSectionW
  5291. #else
  5292. #define GetProfileSection GetProfileSectionA
  5293. #endif // !UNICODE
  5294. WINBASEAPI
  5295. BOOL
  5296. WINAPI
  5297. WriteProfileSectionA(
  5298. IN LPCSTR lpAppName,
  5299. IN LPCSTR lpString
  5300. );
  5301. WINBASEAPI
  5302. BOOL
  5303. WINAPI
  5304. WriteProfileSectionW(
  5305. IN LPCWSTR lpAppName,
  5306. IN LPCWSTR lpString
  5307. );
  5308. #ifdef UNICODE
  5309. #define WriteProfileSection WriteProfileSectionW
  5310. #else
  5311. #define WriteProfileSection WriteProfileSectionA
  5312. #endif // !UNICODE
  5313. WINBASEAPI
  5314. UINT
  5315. WINAPI
  5316. GetPrivateProfileIntA(
  5317. IN LPCSTR lpAppName,
  5318. IN LPCSTR lpKeyName,
  5319. IN INT nDefault,
  5320. IN LPCSTR lpFileName
  5321. );
  5322. WINBASEAPI
  5323. UINT
  5324. WINAPI
  5325. GetPrivateProfileIntW(
  5326. IN LPCWSTR lpAppName,
  5327. IN LPCWSTR lpKeyName,
  5328. IN INT nDefault,
  5329. IN LPCWSTR lpFileName
  5330. );
  5331. #ifdef UNICODE
  5332. #define GetPrivateProfileInt GetPrivateProfileIntW
  5333. #else
  5334. #define GetPrivateProfileInt GetPrivateProfileIntA
  5335. #endif // !UNICODE
  5336. WINBASEAPI
  5337. DWORD
  5338. WINAPI
  5339. GetPrivateProfileStringA(
  5340. IN LPCSTR lpAppName,
  5341. IN LPCSTR lpKeyName,
  5342. IN LPCSTR lpDefault,
  5343. OUT LPSTR lpReturnedString,
  5344. IN DWORD nSize,
  5345. IN LPCSTR lpFileName
  5346. );
  5347. WINBASEAPI
  5348. DWORD
  5349. WINAPI
  5350. GetPrivateProfileStringW(
  5351. IN LPCWSTR lpAppName,
  5352. IN LPCWSTR lpKeyName,
  5353. IN LPCWSTR lpDefault,
  5354. OUT LPWSTR lpReturnedString,
  5355. IN DWORD nSize,
  5356. IN LPCWSTR lpFileName
  5357. );
  5358. #ifdef UNICODE
  5359. #define GetPrivateProfileString GetPrivateProfileStringW
  5360. #else
  5361. #define GetPrivateProfileString GetPrivateProfileStringA
  5362. #endif // !UNICODE
  5363. WINBASEAPI
  5364. BOOL
  5365. WINAPI
  5366. WritePrivateProfileStringA(
  5367. IN LPCSTR lpAppName,
  5368. IN LPCSTR lpKeyName,
  5369. IN LPCSTR lpString,
  5370. IN LPCSTR lpFileName
  5371. );
  5372. WINBASEAPI
  5373. BOOL
  5374. WINAPI
  5375. WritePrivateProfileStringW(
  5376. IN LPCWSTR lpAppName,
  5377. IN LPCWSTR lpKeyName,
  5378. IN LPCWSTR lpString,
  5379. IN LPCWSTR lpFileName
  5380. );
  5381. #ifdef UNICODE
  5382. #define WritePrivateProfileString WritePrivateProfileStringW
  5383. #else
  5384. #define WritePrivateProfileString WritePrivateProfileStringA
  5385. #endif // !UNICODE
  5386. WINBASEAPI
  5387. DWORD
  5388. WINAPI
  5389. GetPrivateProfileSectionA(
  5390. IN LPCSTR lpAppName,
  5391. OUT LPSTR lpReturnedString,
  5392. IN DWORD nSize,
  5393. IN LPCSTR lpFileName
  5394. );
  5395. WINBASEAPI
  5396. DWORD
  5397. WINAPI
  5398. GetPrivateProfileSectionW(
  5399. IN LPCWSTR lpAppName,
  5400. OUT LPWSTR lpReturnedString,
  5401. IN DWORD nSize,
  5402. IN LPCWSTR lpFileName
  5403. );
  5404. #ifdef UNICODE
  5405. #define GetPrivateProfileSection GetPrivateProfileSectionW
  5406. #else
  5407. #define GetPrivateProfileSection GetPrivateProfileSectionA
  5408. #endif // !UNICODE
  5409. WINBASEAPI
  5410. BOOL
  5411. WINAPI
  5412. WritePrivateProfileSectionA(
  5413. IN LPCSTR lpAppName,
  5414. IN LPCSTR lpString,
  5415. IN LPCSTR lpFileName
  5416. );
  5417. WINBASEAPI
  5418. BOOL
  5419. WINAPI
  5420. WritePrivateProfileSectionW(
  5421. IN LPCWSTR lpAppName,
  5422. IN LPCWSTR lpString,
  5423. IN LPCWSTR lpFileName
  5424. );
  5425. #ifdef UNICODE
  5426. #define WritePrivateProfileSection WritePrivateProfileSectionW
  5427. #else
  5428. #define WritePrivateProfileSection WritePrivateProfileSectionA
  5429. #endif // !UNICODE
  5430. WINBASEAPI
  5431. DWORD
  5432. WINAPI
  5433. GetPrivateProfileSectionNamesA(
  5434. OUT LPSTR lpszReturnBuffer,
  5435. IN DWORD nSize,
  5436. IN LPCSTR lpFileName
  5437. );
  5438. WINBASEAPI
  5439. DWORD
  5440. WINAPI
  5441. GetPrivateProfileSectionNamesW(
  5442. OUT LPWSTR lpszReturnBuffer,
  5443. IN DWORD nSize,
  5444. IN LPCWSTR lpFileName
  5445. );
  5446. #ifdef UNICODE
  5447. #define GetPrivateProfileSectionNames GetPrivateProfileSectionNamesW
  5448. #else
  5449. #define GetPrivateProfileSectionNames GetPrivateProfileSectionNamesA
  5450. #endif // !UNICODE
  5451. WINBASEAPI
  5452. BOOL
  5453. WINAPI
  5454. GetPrivateProfileStructA(
  5455. IN LPCSTR lpszSection,
  5456. IN LPCSTR lpszKey,
  5457. OUT LPVOID lpStruct,
  5458. IN UINT uSizeStruct,
  5459. IN LPCSTR szFile
  5460. );
  5461. WINBASEAPI
  5462. BOOL
  5463. WINAPI
  5464. GetPrivateProfileStructW(
  5465. IN LPCWSTR lpszSection,
  5466. IN LPCWSTR lpszKey,
  5467. OUT LPVOID lpStruct,
  5468. IN UINT uSizeStruct,
  5469. IN LPCWSTR szFile
  5470. );
  5471. #ifdef UNICODE
  5472. #define GetPrivateProfileStruct GetPrivateProfileStructW
  5473. #else
  5474. #define GetPrivateProfileStruct GetPrivateProfileStructA
  5475. #endif // !UNICODE
  5476. WINBASEAPI
  5477. BOOL
  5478. WINAPI
  5479. WritePrivateProfileStructA(
  5480. IN LPCSTR lpszSection,
  5481. IN LPCSTR lpszKey,
  5482. IN LPVOID lpStruct,
  5483. IN UINT uSizeStruct,
  5484. IN LPCSTR szFile
  5485. );
  5486. WINBASEAPI
  5487. BOOL
  5488. WINAPI
  5489. WritePrivateProfileStructW(
  5490. IN LPCWSTR lpszSection,
  5491. IN LPCWSTR lpszKey,
  5492. IN LPVOID lpStruct,
  5493. IN UINT uSizeStruct,
  5494. IN LPCWSTR szFile
  5495. );
  5496. #ifdef UNICODE
  5497. #define WritePrivateProfileStruct WritePrivateProfileStructW
  5498. #else
  5499. #define WritePrivateProfileStruct WritePrivateProfileStructA
  5500. #endif // !UNICODE
  5501. WINBASEAPI
  5502. UINT
  5503. WINAPI
  5504. GetDriveTypeA(
  5505. IN LPCSTR lpRootPathName
  5506. );
  5507. WINBASEAPI
  5508. UINT
  5509. WINAPI
  5510. GetDriveTypeW(
  5511. IN LPCWSTR lpRootPathName
  5512. );
  5513. #ifdef UNICODE
  5514. #define GetDriveType GetDriveTypeW
  5515. #else
  5516. #define GetDriveType GetDriveTypeA
  5517. #endif // !UNICODE
  5518. WINBASEAPI
  5519. UINT
  5520. WINAPI
  5521. GetSystemDirectoryA(
  5522. OUT LPSTR lpBuffer,
  5523. IN UINT uSize
  5524. );
  5525. WINBASEAPI
  5526. UINT
  5527. WINAPI
  5528. GetSystemDirectoryW(
  5529. OUT LPWSTR lpBuffer,
  5530. IN UINT uSize
  5531. );
  5532. #ifdef UNICODE
  5533. #define GetSystemDirectory GetSystemDirectoryW
  5534. #else
  5535. #define GetSystemDirectory GetSystemDirectoryA
  5536. #endif // !UNICODE
  5537. WINBASEAPI
  5538. DWORD
  5539. WINAPI
  5540. GetTempPathA(
  5541. IN DWORD nBufferLength,
  5542. OUT LPSTR lpBuffer
  5543. );
  5544. WINBASEAPI
  5545. DWORD
  5546. WINAPI
  5547. GetTempPathW(
  5548. IN DWORD nBufferLength,
  5549. OUT LPWSTR lpBuffer
  5550. );
  5551. #ifdef UNICODE
  5552. #define GetTempPath GetTempPathW
  5553. #else
  5554. #define GetTempPath GetTempPathA
  5555. #endif // !UNICODE
  5556. WINBASEAPI
  5557. UINT
  5558. WINAPI
  5559. GetTempFileNameA(
  5560. IN LPCSTR lpPathName,
  5561. IN LPCSTR lpPrefixString,
  5562. IN UINT uUnique,
  5563. OUT LPSTR lpTempFileName
  5564. );
  5565. WINBASEAPI
  5566. UINT
  5567. WINAPI
  5568. GetTempFileNameW(
  5569. IN LPCWSTR lpPathName,
  5570. IN LPCWSTR lpPrefixString,
  5571. IN UINT uUnique,
  5572. OUT LPWSTR lpTempFileName
  5573. );
  5574. #ifdef UNICODE
  5575. #define GetTempFileName GetTempFileNameW
  5576. #else
  5577. #define GetTempFileName GetTempFileNameA
  5578. #endif // !UNICODE
  5579. WINBASEAPI
  5580. UINT
  5581. WINAPI
  5582. GetWindowsDirectoryA(
  5583. OUT LPSTR lpBuffer,
  5584. IN UINT uSize
  5585. );
  5586. WINBASEAPI
  5587. UINT
  5588. WINAPI
  5589. GetWindowsDirectoryW(
  5590. OUT LPWSTR lpBuffer,
  5591. IN UINT uSize
  5592. );
  5593. #ifdef UNICODE
  5594. #define GetWindowsDirectory GetWindowsDirectoryW
  5595. #else
  5596. #define GetWindowsDirectory GetWindowsDirectoryA
  5597. #endif // !UNICODE
  5598. WINBASEAPI
  5599. UINT
  5600. WINAPI
  5601. GetSystemWindowsDirectoryA(
  5602. OUT LPSTR lpBuffer,
  5603. IN UINT uSize
  5604. );
  5605. WINBASEAPI
  5606. UINT
  5607. WINAPI
  5608. GetSystemWindowsDirectoryW(
  5609. OUT LPWSTR lpBuffer,
  5610. IN UINT uSize
  5611. );
  5612. #ifdef UNICODE
  5613. #define GetSystemWindowsDirectory GetSystemWindowsDirectoryW
  5614. #else
  5615. #define GetSystemWindowsDirectory GetSystemWindowsDirectoryA
  5616. #endif // !UNICODE
  5617. #if !defined(RC_INVOKED) // RC warns because "WINBASE_DECLARE_GET_SYSTEM_WOW64_DIRECTORY" is a bit long.
  5618. #if _WIN32_WINNT >= 0x0501 || defined(WINBASE_DECLARE_GET_SYSTEM_WOW64_DIRECTORY)
  5619. WINBASEAPI
  5620. UINT
  5621. WINAPI
  5622. GetSystemWow64DirectoryA(
  5623. OUT LPSTR lpBuffer,
  5624. IN UINT uSize
  5625. );
  5626. WINBASEAPI
  5627. UINT
  5628. WINAPI
  5629. GetSystemWow64DirectoryW(
  5630. OUT LPWSTR lpBuffer,
  5631. IN UINT uSize
  5632. );
  5633. #ifdef UNICODE
  5634. #define GetSystemWow64Directory GetSystemWow64DirectoryW
  5635. #else
  5636. #define GetSystemWow64Directory GetSystemWow64DirectoryA
  5637. #endif // !UNICODE
  5638. WINBASEAPI
  5639. BOOLEAN
  5640. WINAPI
  5641. Wow64EnableWow64FsRedirection (
  5642. IN BOOLEAN Wow64FsEnableRedirection
  5643. );
  5644. //
  5645. // for GetProcAddress
  5646. //
  5647. typedef UINT (WINAPI* PGET_SYSTEM_WOW64_DIRECTORY_A)(OUT LPSTR lpBuffer, UINT uSize);
  5648. typedef UINT (WINAPI* PGET_SYSTEM_WOW64_DIRECTORY_W)(OUT LPWSTR lpBuffer, UINT uSize);
  5649. //
  5650. // GetProcAddress only accepts GET_SYSTEM_WOW64_DIRECTORY_NAME_A_A,
  5651. // GET_SYSTEM_WOW64_DIRECTORY_NAME_W_A, GET_SYSTEM_WOW64_DIRECTORY_NAME_T_A.
  5652. // The others are if you want to use the strings in some other way.
  5653. //
  5654. #define GET_SYSTEM_WOW64_DIRECTORY_NAME_A_A "GetSystemWow64DirectoryA"
  5655. #define GET_SYSTEM_WOW64_DIRECTORY_NAME_A_W L"GetSystemWow64DirectoryA"
  5656. #define GET_SYSTEM_WOW64_DIRECTORY_NAME_A_T TEXT("GetSystemWow64DirectoryA")
  5657. #define GET_SYSTEM_WOW64_DIRECTORY_NAME_W_A "GetSystemWow64DirectoryW"
  5658. #define GET_SYSTEM_WOW64_DIRECTORY_NAME_W_W L"GetSystemWow64DirectoryW"
  5659. #define GET_SYSTEM_WOW64_DIRECTORY_NAME_W_T TEXT("GetSystemWow64DirectoryW")
  5660. #ifdef UNICODE
  5661. #define GET_SYSTEM_WOW64_DIRECTORY_NAME_T_A GET_SYSTEM_WOW64_DIRECTORY_NAME_W_A
  5662. #define GET_SYSTEM_WOW64_DIRECTORY_NAME_T_W GET_SYSTEM_WOW64_DIRECTORY_NAME_W_W
  5663. #define GET_SYSTEM_WOW64_DIRECTORY_NAME_T_T GET_SYSTEM_WOW64_DIRECTORY_NAME_W_T
  5664. #else
  5665. #define GET_SYSTEM_WOW64_DIRECTORY_NAME_T_A GET_SYSTEM_WOW64_DIRECTORY_NAME_A_A
  5666. #define GET_SYSTEM_WOW64_DIRECTORY_NAME_T_W GET_SYSTEM_WOW64_DIRECTORY_NAME_A_W
  5667. #define GET_SYSTEM_WOW64_DIRECTORY_NAME_T_T GET_SYSTEM_WOW64_DIRECTORY_NAME_A_T
  5668. #endif
  5669. #endif // _WIN32_WINNT >= 0x0501
  5670. #endif
  5671. WINBASEAPI
  5672. BOOL
  5673. WINAPI
  5674. SetCurrentDirectoryA(
  5675. IN LPCSTR lpPathName
  5676. );
  5677. WINBASEAPI
  5678. BOOL
  5679. WINAPI
  5680. SetCurrentDirectoryW(
  5681. IN LPCWSTR lpPathName
  5682. );
  5683. #ifdef UNICODE
  5684. #define SetCurrentDirectory SetCurrentDirectoryW
  5685. #else
  5686. #define SetCurrentDirectory SetCurrentDirectoryA
  5687. #endif // !UNICODE
  5688. WINBASEAPI
  5689. DWORD
  5690. WINAPI
  5691. GetCurrentDirectoryA(
  5692. IN DWORD nBufferLength,
  5693. OUT LPSTR lpBuffer
  5694. );
  5695. WINBASEAPI
  5696. DWORD
  5697. WINAPI
  5698. GetCurrentDirectoryW(
  5699. IN DWORD nBufferLength,
  5700. OUT LPWSTR lpBuffer
  5701. );
  5702. #ifdef UNICODE
  5703. #define GetCurrentDirectory GetCurrentDirectoryW
  5704. #else
  5705. #define GetCurrentDirectory GetCurrentDirectoryA
  5706. #endif // !UNICODE
  5707. #if _WIN32_WINNT >= 0x0502
  5708. WINBASEAPI
  5709. BOOL
  5710. WINAPI
  5711. SetDllDirectoryA(
  5712. IN LPCSTR lpPathName
  5713. );
  5714. WINBASEAPI
  5715. BOOL
  5716. WINAPI
  5717. SetDllDirectoryW(
  5718. IN LPCWSTR lpPathName
  5719. );
  5720. #ifdef UNICODE
  5721. #define SetDllDirectory SetDllDirectoryW
  5722. #else
  5723. #define SetDllDirectory SetDllDirectoryA
  5724. #endif // !UNICODE
  5725. WINBASEAPI
  5726. DWORD
  5727. WINAPI
  5728. GetDllDirectoryA(
  5729. IN DWORD nBufferLength,
  5730. OUT LPSTR lpBuffer
  5731. );
  5732. WINBASEAPI
  5733. DWORD
  5734. WINAPI
  5735. GetDllDirectoryW(
  5736. IN DWORD nBufferLength,
  5737. OUT LPWSTR lpBuffer
  5738. );
  5739. #ifdef UNICODE
  5740. #define GetDllDirectory GetDllDirectoryW
  5741. #else
  5742. #define GetDllDirectory GetDllDirectoryA
  5743. #endif // !UNICODE
  5744. #endif // _WIN32_WINNT >= 0x0502
  5745. WINBASEAPI
  5746. BOOL
  5747. WINAPI
  5748. GetDiskFreeSpaceA(
  5749. IN LPCSTR lpRootPathName,
  5750. OUT LPDWORD lpSectorsPerCluster,
  5751. OUT LPDWORD lpBytesPerSector,
  5752. OUT LPDWORD lpNumberOfFreeClusters,
  5753. OUT LPDWORD lpTotalNumberOfClusters
  5754. );
  5755. WINBASEAPI
  5756. BOOL
  5757. WINAPI
  5758. GetDiskFreeSpaceW(
  5759. IN LPCWSTR lpRootPathName,
  5760. OUT LPDWORD lpSectorsPerCluster,
  5761. OUT LPDWORD lpBytesPerSector,
  5762. OUT LPDWORD lpNumberOfFreeClusters,
  5763. OUT LPDWORD lpTotalNumberOfClusters
  5764. );
  5765. #ifdef UNICODE
  5766. #define GetDiskFreeSpace GetDiskFreeSpaceW
  5767. #else
  5768. #define GetDiskFreeSpace GetDiskFreeSpaceA
  5769. #endif // !UNICODE
  5770. WINBASEAPI
  5771. BOOL
  5772. WINAPI
  5773. GetDiskFreeSpaceExA(
  5774. IN LPCSTR lpDirectoryName,
  5775. OUT PULARGE_INTEGER lpFreeBytesAvailableToCaller,
  5776. OUT PULARGE_INTEGER lpTotalNumberOfBytes,
  5777. OUT PULARGE_INTEGER lpTotalNumberOfFreeBytes
  5778. );
  5779. WINBASEAPI
  5780. BOOL
  5781. WINAPI
  5782. GetDiskFreeSpaceExW(
  5783. IN LPCWSTR lpDirectoryName,
  5784. OUT PULARGE_INTEGER lpFreeBytesAvailableToCaller,
  5785. OUT PULARGE_INTEGER lpTotalNumberOfBytes,
  5786. OUT PULARGE_INTEGER lpTotalNumberOfFreeBytes
  5787. );
  5788. #ifdef UNICODE
  5789. #define GetDiskFreeSpaceEx GetDiskFreeSpaceExW
  5790. #else
  5791. #define GetDiskFreeSpaceEx GetDiskFreeSpaceExA
  5792. #endif // !UNICODE
  5793. WINBASEAPI
  5794. BOOL
  5795. WINAPI
  5796. CreateDirectoryA(
  5797. IN LPCSTR lpPathName,
  5798. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes
  5799. );
  5800. WINBASEAPI
  5801. BOOL
  5802. WINAPI
  5803. CreateDirectoryW(
  5804. IN LPCWSTR lpPathName,
  5805. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes
  5806. );
  5807. #ifdef UNICODE
  5808. #define CreateDirectory CreateDirectoryW
  5809. #else
  5810. #define CreateDirectory CreateDirectoryA
  5811. #endif // !UNICODE
  5812. WINBASEAPI
  5813. BOOL
  5814. WINAPI
  5815. CreateDirectoryExA(
  5816. IN LPCSTR lpTemplateDirectory,
  5817. IN LPCSTR lpNewDirectory,
  5818. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes
  5819. );
  5820. WINBASEAPI
  5821. BOOL
  5822. WINAPI
  5823. CreateDirectoryExW(
  5824. IN LPCWSTR lpTemplateDirectory,
  5825. IN LPCWSTR lpNewDirectory,
  5826. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes
  5827. );
  5828. #ifdef UNICODE
  5829. #define CreateDirectoryEx CreateDirectoryExW
  5830. #else
  5831. #define CreateDirectoryEx CreateDirectoryExA
  5832. #endif // !UNICODE
  5833. WINBASEAPI
  5834. BOOL
  5835. WINAPI
  5836. RemoveDirectoryA(
  5837. IN LPCSTR lpPathName
  5838. );
  5839. WINBASEAPI
  5840. BOOL
  5841. WINAPI
  5842. RemoveDirectoryW(
  5843. IN LPCWSTR lpPathName
  5844. );
  5845. #ifdef UNICODE
  5846. #define RemoveDirectory RemoveDirectoryW
  5847. #else
  5848. #define RemoveDirectory RemoveDirectoryA
  5849. #endif // !UNICODE
  5850. WINBASEAPI
  5851. DWORD
  5852. WINAPI
  5853. GetFullPathNameA(
  5854. IN LPCSTR lpFileName,
  5855. IN DWORD nBufferLength,
  5856. OUT LPSTR lpBuffer,
  5857. OUT LPSTR *lpFilePart
  5858. );
  5859. WINBASEAPI
  5860. DWORD
  5861. WINAPI
  5862. GetFullPathNameW(
  5863. IN LPCWSTR lpFileName,
  5864. IN DWORD nBufferLength,
  5865. OUT LPWSTR lpBuffer,
  5866. OUT LPWSTR *lpFilePart
  5867. );
  5868. #ifdef UNICODE
  5869. #define GetFullPathName GetFullPathNameW
  5870. #else
  5871. #define GetFullPathName GetFullPathNameA
  5872. #endif // !UNICODE
  5873. #define DDD_RAW_TARGET_PATH 0x00000001
  5874. #define DDD_REMOVE_DEFINITION 0x00000002
  5875. #define DDD_EXACT_MATCH_ON_REMOVE 0x00000004
  5876. #define DDD_NO_BROADCAST_SYSTEM 0x00000008
  5877. #define DDD_LUID_BROADCAST_DRIVE 0x00000010
  5878. WINBASEAPI
  5879. BOOL
  5880. WINAPI
  5881. DefineDosDeviceA(
  5882. IN DWORD dwFlags,
  5883. IN LPCSTR lpDeviceName,
  5884. IN LPCSTR lpTargetPath
  5885. );
  5886. WINBASEAPI
  5887. BOOL
  5888. WINAPI
  5889. DefineDosDeviceW(
  5890. IN DWORD dwFlags,
  5891. IN LPCWSTR lpDeviceName,
  5892. IN LPCWSTR lpTargetPath
  5893. );
  5894. #ifdef UNICODE
  5895. #define DefineDosDevice DefineDosDeviceW
  5896. #else
  5897. #define DefineDosDevice DefineDosDeviceA
  5898. #endif // !UNICODE
  5899. WINBASEAPI
  5900. DWORD
  5901. WINAPI
  5902. QueryDosDeviceA(
  5903. IN LPCSTR lpDeviceName,
  5904. OUT LPSTR lpTargetPath,
  5905. IN DWORD ucchMax
  5906. );
  5907. WINBASEAPI
  5908. DWORD
  5909. WINAPI
  5910. QueryDosDeviceW(
  5911. IN LPCWSTR lpDeviceName,
  5912. OUT LPWSTR lpTargetPath,
  5913. IN DWORD ucchMax
  5914. );
  5915. #ifdef UNICODE
  5916. #define QueryDosDevice QueryDosDeviceW
  5917. #else
  5918. #define QueryDosDevice QueryDosDeviceA
  5919. #endif // !UNICODE
  5920. #define EXPAND_LOCAL_DRIVES
  5921. WINBASEAPI
  5922. HANDLE
  5923. WINAPI
  5924. CreateFileA(
  5925. IN LPCSTR lpFileName,
  5926. IN DWORD dwDesiredAccess,
  5927. IN DWORD dwShareMode,
  5928. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  5929. IN DWORD dwCreationDisposition,
  5930. IN DWORD dwFlagsAndAttributes,
  5931. IN HANDLE hTemplateFile
  5932. );
  5933. WINBASEAPI
  5934. HANDLE
  5935. WINAPI
  5936. CreateFileW(
  5937. IN LPCWSTR lpFileName,
  5938. IN DWORD dwDesiredAccess,
  5939. IN DWORD dwShareMode,
  5940. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  5941. IN DWORD dwCreationDisposition,
  5942. IN DWORD dwFlagsAndAttributes,
  5943. IN HANDLE hTemplateFile
  5944. );
  5945. #ifdef UNICODE
  5946. #define CreateFile CreateFileW
  5947. #else
  5948. #define CreateFile CreateFileA
  5949. #endif // !UNICODE
  5950. #if _WIN32_WINNT >= 0x0502
  5951. WINBASEAPI
  5952. HANDLE
  5953. WINAPI
  5954. ReOpenFile(
  5955. HANDLE hOriginalFile,
  5956. DWORD dwDesiredAccess,
  5957. DWORD dwShareMode,
  5958. DWORD dwFlagsAndAttributes
  5959. );
  5960. #endif // _WIN32_WINNT >= 0x0502
  5961. WINBASEAPI
  5962. BOOL
  5963. WINAPI
  5964. SetFileAttributesA(
  5965. IN LPCSTR lpFileName,
  5966. IN DWORD dwFileAttributes
  5967. );
  5968. WINBASEAPI
  5969. BOOL
  5970. WINAPI
  5971. SetFileAttributesW(
  5972. IN LPCWSTR lpFileName,
  5973. IN DWORD dwFileAttributes
  5974. );
  5975. #ifdef UNICODE
  5976. #define SetFileAttributes SetFileAttributesW
  5977. #else
  5978. #define SetFileAttributes SetFileAttributesA
  5979. #endif // !UNICODE
  5980. WINBASEAPI
  5981. DWORD
  5982. WINAPI
  5983. GetFileAttributesA(
  5984. IN LPCSTR lpFileName
  5985. );
  5986. WINBASEAPI
  5987. DWORD
  5988. WINAPI
  5989. GetFileAttributesW(
  5990. IN LPCWSTR lpFileName
  5991. );
  5992. #ifdef UNICODE
  5993. #define GetFileAttributes GetFileAttributesW
  5994. #else
  5995. #define GetFileAttributes GetFileAttributesA
  5996. #endif // !UNICODE
  5997. typedef enum _GET_FILEEX_INFO_LEVELS {
  5998. GetFileExInfoStandard,
  5999. GetFileExMaxInfoLevel
  6000. } GET_FILEEX_INFO_LEVELS;
  6001. WINBASEAPI
  6002. BOOL
  6003. WINAPI
  6004. GetFileAttributesExA(
  6005. IN LPCSTR lpFileName,
  6006. IN GET_FILEEX_INFO_LEVELS fInfoLevelId,
  6007. OUT LPVOID lpFileInformation
  6008. );
  6009. WINBASEAPI
  6010. BOOL
  6011. WINAPI
  6012. GetFileAttributesExW(
  6013. IN LPCWSTR lpFileName,
  6014. IN GET_FILEEX_INFO_LEVELS fInfoLevelId,
  6015. OUT LPVOID lpFileInformation
  6016. );
  6017. #ifdef UNICODE
  6018. #define GetFileAttributesEx GetFileAttributesExW
  6019. #else
  6020. #define GetFileAttributesEx GetFileAttributesExA
  6021. #endif // !UNICODE
  6022. WINBASEAPI
  6023. DWORD
  6024. WINAPI
  6025. GetCompressedFileSizeA(
  6026. IN LPCSTR lpFileName,
  6027. OUT LPDWORD lpFileSizeHigh
  6028. );
  6029. WINBASEAPI
  6030. DWORD
  6031. WINAPI
  6032. GetCompressedFileSizeW(
  6033. IN LPCWSTR lpFileName,
  6034. OUT LPDWORD lpFileSizeHigh
  6035. );
  6036. #ifdef UNICODE
  6037. #define GetCompressedFileSize GetCompressedFileSizeW
  6038. #else
  6039. #define GetCompressedFileSize GetCompressedFileSizeA
  6040. #endif // !UNICODE
  6041. WINBASEAPI
  6042. BOOL
  6043. WINAPI
  6044. DeleteFileA(
  6045. IN LPCSTR lpFileName
  6046. );
  6047. WINBASEAPI
  6048. BOOL
  6049. WINAPI
  6050. DeleteFileW(
  6051. IN LPCWSTR lpFileName
  6052. );
  6053. #ifdef UNICODE
  6054. #define DeleteFile DeleteFileW
  6055. #else
  6056. #define DeleteFile DeleteFileA
  6057. #endif // !UNICODE
  6058. #if _WIN32_WINNT >= 0x0501
  6059. WINBASEAPI
  6060. BOOL
  6061. WINAPI
  6062. CheckNameLegalDOS8Dot3A(
  6063. IN LPCSTR lpName,
  6064. OUT LPSTR lpOemName OPTIONAL,
  6065. IN DWORD OemNameSize OPTIONAL,
  6066. OUT PBOOL pbNameContainsSpaces OPTIONAL,
  6067. OUT PBOOL pbNameLegal
  6068. );
  6069. WINBASEAPI
  6070. BOOL
  6071. WINAPI
  6072. CheckNameLegalDOS8Dot3W(
  6073. IN LPCWSTR lpName,
  6074. OUT LPSTR lpOemName OPTIONAL,
  6075. IN DWORD OemNameSize OPTIONAL,
  6076. OUT PBOOL pbNameContainsSpaces OPTIONAL,
  6077. OUT PBOOL pbNameLegal
  6078. );
  6079. #ifdef UNICODE
  6080. #define CheckNameLegalDOS8Dot3 CheckNameLegalDOS8Dot3W
  6081. #else
  6082. #define CheckNameLegalDOS8Dot3 CheckNameLegalDOS8Dot3A
  6083. #endif // !UNICODE
  6084. #endif // (_WIN32_WINNT >= 0x0501)
  6085. #if(_WIN32_WINNT >= 0x0400)
  6086. typedef enum _FINDEX_INFO_LEVELS {
  6087. FindExInfoStandard,
  6088. FindExInfoMaxInfoLevel
  6089. } FINDEX_INFO_LEVELS;
  6090. typedef enum _FINDEX_SEARCH_OPS {
  6091. FindExSearchNameMatch,
  6092. FindExSearchLimitToDirectories,
  6093. FindExSearchLimitToDevices,
  6094. FindExSearchMaxSearchOp
  6095. } FINDEX_SEARCH_OPS;
  6096. #define FIND_FIRST_EX_CASE_SENSITIVE 0x00000001
  6097. WINBASEAPI
  6098. HANDLE
  6099. WINAPI
  6100. FindFirstFileExA(
  6101. IN LPCSTR lpFileName,
  6102. IN FINDEX_INFO_LEVELS fInfoLevelId,
  6103. OUT LPVOID lpFindFileData,
  6104. IN FINDEX_SEARCH_OPS fSearchOp,
  6105. IN LPVOID lpSearchFilter,
  6106. IN DWORD dwAdditionalFlags
  6107. );
  6108. WINBASEAPI
  6109. HANDLE
  6110. WINAPI
  6111. FindFirstFileExW(
  6112. IN LPCWSTR lpFileName,
  6113. IN FINDEX_INFO_LEVELS fInfoLevelId,
  6114. OUT LPVOID lpFindFileData,
  6115. IN FINDEX_SEARCH_OPS fSearchOp,
  6116. IN LPVOID lpSearchFilter,
  6117. IN DWORD dwAdditionalFlags
  6118. );
  6119. #ifdef UNICODE
  6120. #define FindFirstFileEx FindFirstFileExW
  6121. #else
  6122. #define FindFirstFileEx FindFirstFileExA
  6123. #endif // !UNICODE
  6124. #endif /* _WIN32_WINNT >= 0x0400 */
  6125. WINBASEAPI
  6126. HANDLE
  6127. WINAPI
  6128. FindFirstFileA(
  6129. IN LPCSTR lpFileName,
  6130. OUT LPWIN32_FIND_DATAA lpFindFileData
  6131. );
  6132. WINBASEAPI
  6133. HANDLE
  6134. WINAPI
  6135. FindFirstFileW(
  6136. IN LPCWSTR lpFileName,
  6137. OUT LPWIN32_FIND_DATAW lpFindFileData
  6138. );
  6139. #ifdef UNICODE
  6140. #define FindFirstFile FindFirstFileW
  6141. #else
  6142. #define FindFirstFile FindFirstFileA
  6143. #endif // !UNICODE
  6144. WINBASEAPI
  6145. BOOL
  6146. WINAPI
  6147. FindNextFileA(
  6148. IN HANDLE hFindFile,
  6149. OUT LPWIN32_FIND_DATAA lpFindFileData
  6150. );
  6151. WINBASEAPI
  6152. BOOL
  6153. WINAPI
  6154. FindNextFileW(
  6155. IN HANDLE hFindFile,
  6156. OUT LPWIN32_FIND_DATAW lpFindFileData
  6157. );
  6158. #ifdef UNICODE
  6159. #define FindNextFile FindNextFileW
  6160. #else
  6161. #define FindNextFile FindNextFileA
  6162. #endif // !UNICODE
  6163. WINBASEAPI
  6164. DWORD
  6165. WINAPI
  6166. SearchPathA(
  6167. IN LPCSTR lpPath,
  6168. IN LPCSTR lpFileName,
  6169. IN LPCSTR lpExtension,
  6170. IN DWORD nBufferLength,
  6171. OUT LPSTR lpBuffer,
  6172. OUT LPSTR *lpFilePart
  6173. );
  6174. WINBASEAPI
  6175. DWORD
  6176. WINAPI
  6177. SearchPathW(
  6178. IN LPCWSTR lpPath,
  6179. IN LPCWSTR lpFileName,
  6180. IN LPCWSTR lpExtension,
  6181. IN DWORD nBufferLength,
  6182. OUT LPWSTR lpBuffer,
  6183. OUT LPWSTR *lpFilePart
  6184. );
  6185. #ifdef UNICODE
  6186. #define SearchPath SearchPathW
  6187. #else
  6188. #define SearchPath SearchPathA
  6189. #endif // !UNICODE
  6190. WINBASEAPI
  6191. BOOL
  6192. WINAPI
  6193. CopyFileA(
  6194. IN LPCSTR lpExistingFileName,
  6195. IN LPCSTR lpNewFileName,
  6196. IN BOOL bFailIfExists
  6197. );
  6198. WINBASEAPI
  6199. BOOL
  6200. WINAPI
  6201. CopyFileW(
  6202. IN LPCWSTR lpExistingFileName,
  6203. IN LPCWSTR lpNewFileName,
  6204. IN BOOL bFailIfExists
  6205. );
  6206. #ifdef UNICODE
  6207. #define CopyFile CopyFileW
  6208. #else
  6209. #define CopyFile CopyFileA
  6210. #endif // !UNICODE
  6211. #if(_WIN32_WINNT >= 0x0400)
  6212. typedef
  6213. DWORD
  6214. (WINAPI *LPPROGRESS_ROUTINE)(
  6215. LARGE_INTEGER TotalFileSize,
  6216. LARGE_INTEGER TotalBytesTransferred,
  6217. LARGE_INTEGER StreamSize,
  6218. LARGE_INTEGER StreamBytesTransferred,
  6219. DWORD dwStreamNumber,
  6220. DWORD dwCallbackReason,
  6221. HANDLE hSourceFile,
  6222. HANDLE hDestinationFile,
  6223. LPVOID lpData OPTIONAL
  6224. );
  6225. WINBASEAPI
  6226. BOOL
  6227. WINAPI
  6228. CopyFileExA(
  6229. IN LPCSTR lpExistingFileName,
  6230. IN LPCSTR lpNewFileName,
  6231. IN LPPROGRESS_ROUTINE lpProgressRoutine OPTIONAL,
  6232. IN LPVOID lpData OPTIONAL,
  6233. IN LPBOOL pbCancel OPTIONAL,
  6234. IN DWORD dwCopyFlags
  6235. );
  6236. WINBASEAPI
  6237. BOOL
  6238. WINAPI
  6239. CopyFileExW(
  6240. IN LPCWSTR lpExistingFileName,
  6241. IN LPCWSTR lpNewFileName,
  6242. IN LPPROGRESS_ROUTINE lpProgressRoutine OPTIONAL,
  6243. IN LPVOID lpData OPTIONAL,
  6244. IN LPBOOL pbCancel OPTIONAL,
  6245. IN DWORD dwCopyFlags
  6246. );
  6247. #ifdef UNICODE
  6248. #define CopyFileEx CopyFileExW
  6249. #else
  6250. #define CopyFileEx CopyFileExA
  6251. #endif // !UNICODE
  6252. #endif /* _WIN32_WINNT >= 0x0400 */
  6253. WINBASEAPI
  6254. BOOL
  6255. WINAPI
  6256. MoveFileA(
  6257. IN LPCSTR lpExistingFileName,
  6258. IN LPCSTR lpNewFileName
  6259. );
  6260. WINBASEAPI
  6261. BOOL
  6262. WINAPI
  6263. MoveFileW(
  6264. IN LPCWSTR lpExistingFileName,
  6265. IN LPCWSTR lpNewFileName
  6266. );
  6267. #ifdef UNICODE
  6268. #define MoveFile MoveFileW
  6269. #else
  6270. #define MoveFile MoveFileA
  6271. #endif // !UNICODE
  6272. WINBASEAPI
  6273. BOOL
  6274. WINAPI
  6275. MoveFileExA(
  6276. IN LPCSTR lpExistingFileName,
  6277. IN LPCSTR lpNewFileName,
  6278. IN DWORD dwFlags
  6279. );
  6280. WINBASEAPI
  6281. BOOL
  6282. WINAPI
  6283. MoveFileExW(
  6284. IN LPCWSTR lpExistingFileName,
  6285. IN LPCWSTR lpNewFileName,
  6286. IN DWORD dwFlags
  6287. );
  6288. #ifdef UNICODE
  6289. #define MoveFileEx MoveFileExW
  6290. #else
  6291. #define MoveFileEx MoveFileExA
  6292. #endif // !UNICODE
  6293. #if (_WIN32_WINNT >= 0x0500)
  6294. WINBASEAPI
  6295. BOOL
  6296. WINAPI
  6297. MoveFileWithProgressA(
  6298. IN LPCSTR lpExistingFileName,
  6299. IN LPCSTR lpNewFileName,
  6300. IN LPPROGRESS_ROUTINE lpProgressRoutine OPTIONAL,
  6301. IN LPVOID lpData OPTIONAL,
  6302. IN DWORD dwFlags
  6303. );
  6304. WINBASEAPI
  6305. BOOL
  6306. WINAPI
  6307. MoveFileWithProgressW(
  6308. IN LPCWSTR lpExistingFileName,
  6309. IN LPCWSTR lpNewFileName,
  6310. IN LPPROGRESS_ROUTINE lpProgressRoutine OPTIONAL,
  6311. IN LPVOID lpData OPTIONAL,
  6312. IN DWORD dwFlags
  6313. );
  6314. #ifdef UNICODE
  6315. #define MoveFileWithProgress MoveFileWithProgressW
  6316. #else
  6317. #define MoveFileWithProgress MoveFileWithProgressA
  6318. #endif // !UNICODE
  6319. #endif // (_WIN32_WINNT >= 0x0500)
  6320. #define MOVEFILE_REPLACE_EXISTING 0x00000001
  6321. #define MOVEFILE_COPY_ALLOWED 0x00000002
  6322. #define MOVEFILE_DELAY_UNTIL_REBOOT 0x00000004
  6323. #define MOVEFILE_WRITE_THROUGH 0x00000008
  6324. #if (_WIN32_WINNT >= 0x0500)
  6325. #define MOVEFILE_CREATE_HARDLINK 0x00000010
  6326. #define MOVEFILE_FAIL_IF_NOT_TRACKABLE 0x00000020
  6327. #endif // (_WIN32_WINNT >= 0x0500)
  6328. #if (_WIN32_WINNT >= 0x0500)
  6329. WINBASEAPI
  6330. BOOL
  6331. WINAPI
  6332. ReplaceFileA(
  6333. LPCSTR lpReplacedFileName,
  6334. LPCSTR lpReplacementFileName,
  6335. LPCSTR lpBackupFileName,
  6336. DWORD dwReplaceFlags,
  6337. LPVOID lpExclude,
  6338. LPVOID lpReserved
  6339. );
  6340. WINBASEAPI
  6341. BOOL
  6342. WINAPI
  6343. ReplaceFileW(
  6344. LPCWSTR lpReplacedFileName,
  6345. LPCWSTR lpReplacementFileName,
  6346. LPCWSTR lpBackupFileName,
  6347. DWORD dwReplaceFlags,
  6348. LPVOID lpExclude,
  6349. LPVOID lpReserved
  6350. );
  6351. #ifdef UNICODE
  6352. #define ReplaceFile ReplaceFileW
  6353. #else
  6354. #define ReplaceFile ReplaceFileA
  6355. #endif // !UNICODE
  6356. #endif // (_WIN32_WINNT >= 0x0500)
  6357. #if (_WIN32_WINNT >= 0x0500)
  6358. //
  6359. // API call to create hard links.
  6360. //
  6361. WINBASEAPI
  6362. BOOL
  6363. WINAPI
  6364. CreateHardLinkA(
  6365. IN LPCSTR lpFileName,
  6366. IN LPCSTR lpExistingFileName,
  6367. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes
  6368. );
  6369. WINBASEAPI
  6370. BOOL
  6371. WINAPI
  6372. CreateHardLinkW(
  6373. IN LPCWSTR lpFileName,
  6374. IN LPCWSTR lpExistingFileName,
  6375. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes
  6376. );
  6377. #ifdef UNICODE
  6378. #define CreateHardLink CreateHardLinkW
  6379. #else
  6380. #define CreateHardLink CreateHardLinkA
  6381. #endif // !UNICODE
  6382. #endif // (_WIN32_WINNT >= 0x0500)
  6383. #if (_WIN32_WINNT >= 0x0501)
  6384. //
  6385. // API call to enumerate for streams within a file
  6386. //
  6387. typedef enum _STREAM_INFO_LEVELS {
  6388. FindStreamInfoStandard,
  6389. FindStreamInfoMaxInfoLevel
  6390. } STREAM_INFO_LEVELS;
  6391. typedef struct _WIN32_FIND_STREAM_DATA {
  6392. LARGE_INTEGER StreamSize;
  6393. WCHAR cStreamName[ MAX_PATH + 36 ];
  6394. } WIN32_FIND_STREAM_DATA, *PWIN32_FIND_STREAM_DATA;
  6395. HANDLE
  6396. WINAPI
  6397. FindFirstStreamW(
  6398. LPCWSTR lpFileName,
  6399. STREAM_INFO_LEVELS InfoLevel,
  6400. LPVOID lpFindStreamData,
  6401. DWORD dwFlags
  6402. );
  6403. BOOL
  6404. APIENTRY
  6405. FindNextStreamW(
  6406. HANDLE hFindStream,
  6407. LPVOID lpFindStreamData
  6408. );
  6409. #endif // (_WIN32_WINNT >= 0x0500)
  6410. WINBASEAPI
  6411. HANDLE
  6412. WINAPI
  6413. CreateNamedPipeA(
  6414. IN LPCSTR lpName,
  6415. IN DWORD dwOpenMode,
  6416. IN DWORD dwPipeMode,
  6417. IN DWORD nMaxInstances,
  6418. IN DWORD nOutBufferSize,
  6419. IN DWORD nInBufferSize,
  6420. IN DWORD nDefaultTimeOut,
  6421. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes
  6422. );
  6423. WINBASEAPI
  6424. HANDLE
  6425. WINAPI
  6426. CreateNamedPipeW(
  6427. IN LPCWSTR lpName,
  6428. IN DWORD dwOpenMode,
  6429. IN DWORD dwPipeMode,
  6430. IN DWORD nMaxInstances,
  6431. IN DWORD nOutBufferSize,
  6432. IN DWORD nInBufferSize,
  6433. IN DWORD nDefaultTimeOut,
  6434. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes
  6435. );
  6436. #ifdef UNICODE
  6437. #define CreateNamedPipe CreateNamedPipeW
  6438. #else
  6439. #define CreateNamedPipe CreateNamedPipeA
  6440. #endif // !UNICODE
  6441. WINBASEAPI
  6442. BOOL
  6443. WINAPI
  6444. GetNamedPipeHandleStateA(
  6445. IN HANDLE hNamedPipe,
  6446. OUT LPDWORD lpState,
  6447. OUT LPDWORD lpCurInstances,
  6448. OUT LPDWORD lpMaxCollectionCount,
  6449. OUT LPDWORD lpCollectDataTimeout,
  6450. OUT LPSTR lpUserName,
  6451. IN DWORD nMaxUserNameSize
  6452. );
  6453. WINBASEAPI
  6454. BOOL
  6455. WINAPI
  6456. GetNamedPipeHandleStateW(
  6457. IN HANDLE hNamedPipe,
  6458. OUT LPDWORD lpState,
  6459. OUT LPDWORD lpCurInstances,
  6460. OUT LPDWORD lpMaxCollectionCount,
  6461. OUT LPDWORD lpCollectDataTimeout,
  6462. OUT LPWSTR lpUserName,
  6463. IN DWORD nMaxUserNameSize
  6464. );
  6465. #ifdef UNICODE
  6466. #define GetNamedPipeHandleState GetNamedPipeHandleStateW
  6467. #else
  6468. #define GetNamedPipeHandleState GetNamedPipeHandleStateA
  6469. #endif // !UNICODE
  6470. WINBASEAPI
  6471. BOOL
  6472. WINAPI
  6473. CallNamedPipeA(
  6474. IN LPCSTR lpNamedPipeName,
  6475. IN LPVOID lpInBuffer,
  6476. IN DWORD nInBufferSize,
  6477. OUT LPVOID lpOutBuffer,
  6478. IN DWORD nOutBufferSize,
  6479. OUT LPDWORD lpBytesRead,
  6480. IN DWORD nTimeOut
  6481. );
  6482. WINBASEAPI
  6483. BOOL
  6484. WINAPI
  6485. CallNamedPipeW(
  6486. IN LPCWSTR lpNamedPipeName,
  6487. IN LPVOID lpInBuffer,
  6488. IN DWORD nInBufferSize,
  6489. OUT LPVOID lpOutBuffer,
  6490. IN DWORD nOutBufferSize,
  6491. OUT LPDWORD lpBytesRead,
  6492. IN DWORD nTimeOut
  6493. );
  6494. #ifdef UNICODE
  6495. #define CallNamedPipe CallNamedPipeW
  6496. #else
  6497. #define CallNamedPipe CallNamedPipeA
  6498. #endif // !UNICODE
  6499. WINBASEAPI
  6500. BOOL
  6501. WINAPI
  6502. WaitNamedPipeA(
  6503. IN LPCSTR lpNamedPipeName,
  6504. IN DWORD nTimeOut
  6505. );
  6506. WINBASEAPI
  6507. BOOL
  6508. WINAPI
  6509. WaitNamedPipeW(
  6510. IN LPCWSTR lpNamedPipeName,
  6511. IN DWORD nTimeOut
  6512. );
  6513. #ifdef UNICODE
  6514. #define WaitNamedPipe WaitNamedPipeW
  6515. #else
  6516. #define WaitNamedPipe WaitNamedPipeA
  6517. #endif // !UNICODE
  6518. WINBASEAPI
  6519. BOOL
  6520. WINAPI
  6521. SetVolumeLabelA(
  6522. IN LPCSTR lpRootPathName,
  6523. IN LPCSTR lpVolumeName
  6524. );
  6525. WINBASEAPI
  6526. BOOL
  6527. WINAPI
  6528. SetVolumeLabelW(
  6529. IN LPCWSTR lpRootPathName,
  6530. IN LPCWSTR lpVolumeName
  6531. );
  6532. #ifdef UNICODE
  6533. #define SetVolumeLabel SetVolumeLabelW
  6534. #else
  6535. #define SetVolumeLabel SetVolumeLabelA
  6536. #endif // !UNICODE
  6537. WINBASEAPI
  6538. VOID
  6539. WINAPI
  6540. SetFileApisToOEM( VOID );
  6541. WINBASEAPI
  6542. VOID
  6543. WINAPI
  6544. SetFileApisToANSI( VOID );
  6545. WINBASEAPI
  6546. BOOL
  6547. WINAPI
  6548. AreFileApisANSI( VOID );
  6549. WINBASEAPI
  6550. BOOL
  6551. WINAPI
  6552. GetVolumeInformationA(
  6553. IN LPCSTR lpRootPathName,
  6554. OUT LPSTR lpVolumeNameBuffer,
  6555. IN DWORD nVolumeNameSize,
  6556. OUT LPDWORD lpVolumeSerialNumber,
  6557. OUT LPDWORD lpMaximumComponentLength,
  6558. OUT LPDWORD lpFileSystemFlags,
  6559. OUT LPSTR lpFileSystemNameBuffer,
  6560. IN DWORD nFileSystemNameSize
  6561. );
  6562. WINBASEAPI
  6563. BOOL
  6564. WINAPI
  6565. GetVolumeInformationW(
  6566. IN LPCWSTR lpRootPathName,
  6567. OUT LPWSTR lpVolumeNameBuffer,
  6568. IN DWORD nVolumeNameSize,
  6569. OUT LPDWORD lpVolumeSerialNumber,
  6570. OUT LPDWORD lpMaximumComponentLength,
  6571. OUT LPDWORD lpFileSystemFlags,
  6572. OUT LPWSTR lpFileSystemNameBuffer,
  6573. IN DWORD nFileSystemNameSize
  6574. );
  6575. #ifdef UNICODE
  6576. #define GetVolumeInformation GetVolumeInformationW
  6577. #else
  6578. #define GetVolumeInformation GetVolumeInformationA
  6579. #endif // !UNICODE
  6580. WINBASEAPI
  6581. BOOL
  6582. WINAPI
  6583. CancelIo(
  6584. IN HANDLE hFile
  6585. );
  6586. //
  6587. // Event logging APIs
  6588. //
  6589. WINADVAPI
  6590. BOOL
  6591. WINAPI
  6592. ClearEventLogA (
  6593. IN HANDLE hEventLog,
  6594. IN LPCSTR lpBackupFileName
  6595. );
  6596. WINADVAPI
  6597. BOOL
  6598. WINAPI
  6599. ClearEventLogW (
  6600. IN HANDLE hEventLog,
  6601. IN LPCWSTR lpBackupFileName
  6602. );
  6603. #ifdef UNICODE
  6604. #define ClearEventLog ClearEventLogW
  6605. #else
  6606. #define ClearEventLog ClearEventLogA
  6607. #endif // !UNICODE
  6608. WINADVAPI
  6609. BOOL
  6610. WINAPI
  6611. BackupEventLogA (
  6612. IN HANDLE hEventLog,
  6613. IN LPCSTR lpBackupFileName
  6614. );
  6615. WINADVAPI
  6616. BOOL
  6617. WINAPI
  6618. BackupEventLogW (
  6619. IN HANDLE hEventLog,
  6620. IN LPCWSTR lpBackupFileName
  6621. );
  6622. #ifdef UNICODE
  6623. #define BackupEventLog BackupEventLogW
  6624. #else
  6625. #define BackupEventLog BackupEventLogA
  6626. #endif // !UNICODE
  6627. WINADVAPI
  6628. BOOL
  6629. WINAPI
  6630. CloseEventLog (
  6631. IN OUT HANDLE hEventLog
  6632. );
  6633. WINADVAPI
  6634. BOOL
  6635. WINAPI
  6636. DeregisterEventSource (
  6637. IN OUT HANDLE hEventLog
  6638. );
  6639. WINADVAPI
  6640. BOOL
  6641. WINAPI
  6642. NotifyChangeEventLog(
  6643. IN HANDLE hEventLog,
  6644. IN HANDLE hEvent
  6645. );
  6646. WINADVAPI
  6647. BOOL
  6648. WINAPI
  6649. GetNumberOfEventLogRecords (
  6650. IN HANDLE hEventLog,
  6651. OUT PDWORD NumberOfRecords
  6652. );
  6653. WINADVAPI
  6654. BOOL
  6655. WINAPI
  6656. GetOldestEventLogRecord (
  6657. IN HANDLE hEventLog,
  6658. OUT PDWORD OldestRecord
  6659. );
  6660. WINADVAPI
  6661. HANDLE
  6662. WINAPI
  6663. OpenEventLogA (
  6664. IN LPCSTR lpUNCServerName,
  6665. IN LPCSTR lpSourceName
  6666. );
  6667. WINADVAPI
  6668. HANDLE
  6669. WINAPI
  6670. OpenEventLogW (
  6671. IN LPCWSTR lpUNCServerName,
  6672. IN LPCWSTR lpSourceName
  6673. );
  6674. #ifdef UNICODE
  6675. #define OpenEventLog OpenEventLogW
  6676. #else
  6677. #define OpenEventLog OpenEventLogA
  6678. #endif // !UNICODE
  6679. WINADVAPI
  6680. HANDLE
  6681. WINAPI
  6682. RegisterEventSourceA (
  6683. IN LPCSTR lpUNCServerName,
  6684. IN LPCSTR lpSourceName
  6685. );
  6686. WINADVAPI
  6687. HANDLE
  6688. WINAPI
  6689. RegisterEventSourceW (
  6690. IN LPCWSTR lpUNCServerName,
  6691. IN LPCWSTR lpSourceName
  6692. );
  6693. #ifdef UNICODE
  6694. #define RegisterEventSource RegisterEventSourceW
  6695. #else
  6696. #define RegisterEventSource RegisterEventSourceA
  6697. #endif // !UNICODE
  6698. WINADVAPI
  6699. HANDLE
  6700. WINAPI
  6701. OpenBackupEventLogA (
  6702. IN LPCSTR lpUNCServerName,
  6703. IN LPCSTR lpFileName
  6704. );
  6705. WINADVAPI
  6706. HANDLE
  6707. WINAPI
  6708. OpenBackupEventLogW (
  6709. IN LPCWSTR lpUNCServerName,
  6710. IN LPCWSTR lpFileName
  6711. );
  6712. #ifdef UNICODE
  6713. #define OpenBackupEventLog OpenBackupEventLogW
  6714. #else
  6715. #define OpenBackupEventLog OpenBackupEventLogA
  6716. #endif // !UNICODE
  6717. WINADVAPI
  6718. BOOL
  6719. WINAPI
  6720. ReadEventLogA (
  6721. IN HANDLE hEventLog,
  6722. IN DWORD dwReadFlags,
  6723. IN DWORD dwRecordOffset,
  6724. OUT LPVOID lpBuffer,
  6725. IN DWORD nNumberOfBytesToRead,
  6726. OUT DWORD *pnBytesRead,
  6727. OUT DWORD *pnMinNumberOfBytesNeeded
  6728. );
  6729. WINADVAPI
  6730. BOOL
  6731. WINAPI
  6732. ReadEventLogW (
  6733. IN HANDLE hEventLog,
  6734. IN DWORD dwReadFlags,
  6735. IN DWORD dwRecordOffset,
  6736. OUT LPVOID lpBuffer,
  6737. IN DWORD nNumberOfBytesToRead,
  6738. OUT DWORD *pnBytesRead,
  6739. OUT DWORD *pnMinNumberOfBytesNeeded
  6740. );
  6741. #ifdef UNICODE
  6742. #define ReadEventLog ReadEventLogW
  6743. #else
  6744. #define ReadEventLog ReadEventLogA
  6745. #endif // !UNICODE
  6746. WINADVAPI
  6747. BOOL
  6748. WINAPI
  6749. ReportEventA (
  6750. IN HANDLE hEventLog,
  6751. IN WORD wType,
  6752. IN WORD wCategory,
  6753. IN DWORD dwEventID,
  6754. IN PSID lpUserSid,
  6755. IN WORD wNumStrings,
  6756. IN DWORD dwDataSize,
  6757. IN LPCSTR *lpStrings,
  6758. IN LPVOID lpRawData
  6759. );
  6760. WINADVAPI
  6761. BOOL
  6762. WINAPI
  6763. ReportEventW (
  6764. IN HANDLE hEventLog,
  6765. IN WORD wType,
  6766. IN WORD wCategory,
  6767. IN DWORD dwEventID,
  6768. IN PSID lpUserSid,
  6769. IN WORD wNumStrings,
  6770. IN DWORD dwDataSize,
  6771. IN LPCWSTR *lpStrings,
  6772. IN LPVOID lpRawData
  6773. );
  6774. #ifdef UNICODE
  6775. #define ReportEvent ReportEventW
  6776. #else
  6777. #define ReportEvent ReportEventA
  6778. #endif // !UNICODE
  6779. #define EVENTLOG_FULL_INFO 0
  6780. typedef struct _EVENTLOG_FULL_INFORMATION
  6781. {
  6782. DWORD dwFull;
  6783. }
  6784. EVENTLOG_FULL_INFORMATION, *LPEVENTLOG_FULL_INFORMATION;
  6785. WINADVAPI
  6786. BOOL
  6787. WINAPI
  6788. GetEventLogInformation (
  6789. IN HANDLE hEventLog,
  6790. IN DWORD dwInfoLevel,
  6791. OUT LPVOID lpBuffer,
  6792. IN DWORD cbBufSize,
  6793. OUT LPDWORD pcbBytesNeeded
  6794. );
  6795. //
  6796. //
  6797. // Security APIs
  6798. //
  6799. WINADVAPI
  6800. BOOL
  6801. WINAPI
  6802. DuplicateToken(
  6803. IN HANDLE ExistingTokenHandle,
  6804. IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
  6805. OUT PHANDLE DuplicateTokenHandle
  6806. );
  6807. WINADVAPI
  6808. BOOL
  6809. WINAPI
  6810. GetKernelObjectSecurity (
  6811. IN HANDLE Handle,
  6812. IN SECURITY_INFORMATION RequestedInformation,
  6813. OUT PSECURITY_DESCRIPTOR pSecurityDescriptor,
  6814. IN DWORD nLength,
  6815. OUT LPDWORD lpnLengthNeeded
  6816. );
  6817. WINADVAPI
  6818. BOOL
  6819. WINAPI
  6820. ImpersonateNamedPipeClient(
  6821. IN HANDLE hNamedPipe
  6822. );
  6823. WINADVAPI
  6824. BOOL
  6825. WINAPI
  6826. ImpersonateSelf(
  6827. IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
  6828. );
  6829. WINADVAPI
  6830. BOOL
  6831. WINAPI
  6832. RevertToSelf (
  6833. VOID
  6834. );
  6835. WINADVAPI
  6836. BOOL
  6837. APIENTRY
  6838. SetThreadToken (
  6839. IN PHANDLE Thread,
  6840. IN HANDLE Token
  6841. );
  6842. WINADVAPI
  6843. BOOL
  6844. WINAPI
  6845. AccessCheck (
  6846. IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
  6847. IN HANDLE ClientToken,
  6848. IN DWORD DesiredAccess,
  6849. IN PGENERIC_MAPPING GenericMapping,
  6850. OUT PPRIVILEGE_SET PrivilegeSet,
  6851. IN LPDWORD PrivilegeSetLength,
  6852. OUT LPDWORD GrantedAccess,
  6853. OUT LPBOOL AccessStatus
  6854. );
  6855. #if(_WIN32_WINNT >= 0x0500)
  6856. WINADVAPI
  6857. BOOL
  6858. WINAPI
  6859. AccessCheckByType (
  6860. IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
  6861. IN PSID PrincipalSelfSid,
  6862. IN HANDLE ClientToken,
  6863. IN DWORD DesiredAccess,
  6864. OUT POBJECT_TYPE_LIST ObjectTypeList,
  6865. IN DWORD ObjectTypeListLength,
  6866. OUT PGENERIC_MAPPING GenericMapping,
  6867. OUT PPRIVILEGE_SET PrivilegeSet,
  6868. OUT LPDWORD PrivilegeSetLength,
  6869. OUT LPDWORD GrantedAccess,
  6870. OUT LPBOOL AccessStatus
  6871. );
  6872. WINADVAPI
  6873. BOOL
  6874. WINAPI
  6875. AccessCheckByTypeResultList (
  6876. IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
  6877. IN PSID PrincipalSelfSid,
  6878. IN HANDLE ClientToken,
  6879. IN DWORD DesiredAccess,
  6880. OUT POBJECT_TYPE_LIST ObjectTypeList,
  6881. IN DWORD ObjectTypeListLength,
  6882. OUT PGENERIC_MAPPING GenericMapping,
  6883. OUT PPRIVILEGE_SET PrivilegeSet,
  6884. OUT LPDWORD PrivilegeSetLength,
  6885. OUT LPDWORD GrantedAccessList,
  6886. OUT LPDWORD AccessStatusList
  6887. );
  6888. #endif /* _WIN32_WINNT >= 0x0500 */
  6889. WINADVAPI
  6890. BOOL
  6891. WINAPI
  6892. OpenProcessToken (
  6893. IN HANDLE ProcessHandle,
  6894. IN DWORD DesiredAccess,
  6895. OUT PHANDLE TokenHandle
  6896. );
  6897. WINADVAPI
  6898. BOOL
  6899. WINAPI
  6900. OpenThreadToken (
  6901. IN HANDLE ThreadHandle,
  6902. IN DWORD DesiredAccess,
  6903. IN BOOL OpenAsSelf,
  6904. OUT PHANDLE TokenHandle
  6905. );
  6906. WINADVAPI
  6907. BOOL
  6908. WINAPI
  6909. GetTokenInformation (
  6910. IN HANDLE TokenHandle,
  6911. IN TOKEN_INFORMATION_CLASS TokenInformationClass,
  6912. OUT LPVOID TokenInformation,
  6913. IN DWORD TokenInformationLength,
  6914. OUT PDWORD ReturnLength
  6915. );
  6916. WINADVAPI
  6917. BOOL
  6918. WINAPI
  6919. SetTokenInformation (
  6920. IN HANDLE TokenHandle,
  6921. IN TOKEN_INFORMATION_CLASS TokenInformationClass,
  6922. IN LPVOID TokenInformation,
  6923. IN DWORD TokenInformationLength
  6924. );
  6925. WINADVAPI
  6926. BOOL
  6927. WINAPI
  6928. AdjustTokenPrivileges (
  6929. IN HANDLE TokenHandle,
  6930. IN BOOL DisableAllPrivileges,
  6931. IN PTOKEN_PRIVILEGES NewState,
  6932. IN DWORD BufferLength,
  6933. OUT PTOKEN_PRIVILEGES PreviousState,
  6934. OUT PDWORD ReturnLength
  6935. );
  6936. WINADVAPI
  6937. BOOL
  6938. WINAPI
  6939. AdjustTokenGroups (
  6940. IN HANDLE TokenHandle,
  6941. IN BOOL ResetToDefault,
  6942. IN PTOKEN_GROUPS NewState,
  6943. IN DWORD BufferLength,
  6944. OUT PTOKEN_GROUPS PreviousState,
  6945. OUT PDWORD ReturnLength
  6946. );
  6947. WINADVAPI
  6948. BOOL
  6949. WINAPI
  6950. PrivilegeCheck (
  6951. IN HANDLE ClientToken,
  6952. IN PPRIVILEGE_SET RequiredPrivileges,
  6953. OUT LPBOOL pfResult
  6954. );
  6955. WINADVAPI
  6956. BOOL
  6957. WINAPI
  6958. AccessCheckAndAuditAlarmA (
  6959. IN LPCSTR SubsystemName,
  6960. IN LPVOID HandleId,
  6961. IN LPSTR ObjectTypeName,
  6962. IN LPSTR ObjectName,
  6963. IN PSECURITY_DESCRIPTOR SecurityDescriptor,
  6964. IN DWORD DesiredAccess,
  6965. IN PGENERIC_MAPPING GenericMapping,
  6966. IN BOOL ObjectCreation,
  6967. OUT LPDWORD GrantedAccess,
  6968. OUT LPBOOL AccessStatus,
  6969. OUT LPBOOL pfGenerateOnClose
  6970. );
  6971. WINADVAPI
  6972. BOOL
  6973. WINAPI
  6974. AccessCheckAndAuditAlarmW (
  6975. IN LPCWSTR SubsystemName,
  6976. IN LPVOID HandleId,
  6977. IN LPWSTR ObjectTypeName,
  6978. IN LPWSTR ObjectName,
  6979. IN PSECURITY_DESCRIPTOR SecurityDescriptor,
  6980. IN DWORD DesiredAccess,
  6981. IN PGENERIC_MAPPING GenericMapping,
  6982. IN BOOL ObjectCreation,
  6983. OUT LPDWORD GrantedAccess,
  6984. OUT LPBOOL AccessStatus,
  6985. OUT LPBOOL pfGenerateOnClose
  6986. );
  6987. #ifdef UNICODE
  6988. #define AccessCheckAndAuditAlarm AccessCheckAndAuditAlarmW
  6989. #else
  6990. #define AccessCheckAndAuditAlarm AccessCheckAndAuditAlarmA
  6991. #endif // !UNICODE
  6992. #if(_WIN32_WINNT >= 0x0500)
  6993. WINADVAPI
  6994. BOOL
  6995. WINAPI
  6996. AccessCheckByTypeAndAuditAlarmA (
  6997. IN LPCSTR SubsystemName,
  6998. IN LPVOID HandleId,
  6999. IN LPCSTR ObjectTypeName,
  7000. IN LPCSTR ObjectName,
  7001. IN PSECURITY_DESCRIPTOR SecurityDescriptor,
  7002. IN PSID PrincipalSelfSid,
  7003. IN DWORD DesiredAccess,
  7004. IN AUDIT_EVENT_TYPE AuditType,
  7005. IN DWORD Flags,
  7006. IN POBJECT_TYPE_LIST ObjectTypeList,
  7007. IN DWORD ObjectTypeListLength,
  7008. IN PGENERIC_MAPPING GenericMapping,
  7009. IN BOOL ObjectCreation,
  7010. OUT LPDWORD GrantedAccess,
  7011. OUT LPBOOL AccessStatus,
  7012. OUT LPBOOL pfGenerateOnClose
  7013. );
  7014. WINADVAPI
  7015. BOOL
  7016. WINAPI
  7017. AccessCheckByTypeAndAuditAlarmW (
  7018. IN LPCWSTR SubsystemName,
  7019. IN LPVOID HandleId,
  7020. IN LPCWSTR ObjectTypeName,
  7021. IN LPCWSTR ObjectName,
  7022. IN PSECURITY_DESCRIPTOR SecurityDescriptor,
  7023. IN PSID PrincipalSelfSid,
  7024. IN DWORD DesiredAccess,
  7025. IN AUDIT_EVENT_TYPE AuditType,
  7026. IN DWORD Flags,
  7027. IN POBJECT_TYPE_LIST ObjectTypeList,
  7028. IN DWORD ObjectTypeListLength,
  7029. IN PGENERIC_MAPPING GenericMapping,
  7030. IN BOOL ObjectCreation,
  7031. OUT LPDWORD GrantedAccess,
  7032. OUT LPBOOL AccessStatus,
  7033. OUT LPBOOL pfGenerateOnClose
  7034. );
  7035. #ifdef UNICODE
  7036. #define AccessCheckByTypeAndAuditAlarm AccessCheckByTypeAndAuditAlarmW
  7037. #else
  7038. #define AccessCheckByTypeAndAuditAlarm AccessCheckByTypeAndAuditAlarmA
  7039. #endif // !UNICODE
  7040. WINADVAPI
  7041. BOOL
  7042. WINAPI
  7043. AccessCheckByTypeResultListAndAuditAlarmA (
  7044. IN LPCSTR SubsystemName,
  7045. IN LPVOID HandleId,
  7046. IN LPCSTR ObjectTypeName,
  7047. IN LPCSTR ObjectName,
  7048. IN PSECURITY_DESCRIPTOR SecurityDescriptor,
  7049. IN PSID PrincipalSelfSid,
  7050. IN DWORD DesiredAccess,
  7051. IN AUDIT_EVENT_TYPE AuditType,
  7052. IN DWORD Flags,
  7053. IN POBJECT_TYPE_LIST ObjectTypeList,
  7054. IN DWORD ObjectTypeListLength,
  7055. IN PGENERIC_MAPPING GenericMapping,
  7056. IN BOOL ObjectCreation,
  7057. OUT LPDWORD GrantedAccess,
  7058. OUT LPDWORD AccessStatusList,
  7059. OUT LPBOOL pfGenerateOnClose
  7060. );
  7061. WINADVAPI
  7062. BOOL
  7063. WINAPI
  7064. AccessCheckByTypeResultListAndAuditAlarmW (
  7065. IN LPCWSTR SubsystemName,
  7066. IN LPVOID HandleId,
  7067. IN LPCWSTR ObjectTypeName,
  7068. IN LPCWSTR ObjectName,
  7069. IN PSECURITY_DESCRIPTOR SecurityDescriptor,
  7070. IN PSID PrincipalSelfSid,
  7071. IN DWORD DesiredAccess,
  7072. IN AUDIT_EVENT_TYPE AuditType,
  7073. IN DWORD Flags,
  7074. IN POBJECT_TYPE_LIST ObjectTypeList,
  7075. IN DWORD ObjectTypeListLength,
  7076. IN PGENERIC_MAPPING GenericMapping,
  7077. IN BOOL ObjectCreation,
  7078. OUT LPDWORD GrantedAccess,
  7079. OUT LPDWORD AccessStatusList,
  7080. OUT LPBOOL pfGenerateOnClose
  7081. );
  7082. #ifdef UNICODE
  7083. #define AccessCheckByTypeResultListAndAuditAlarm AccessCheckByTypeResultListAndAuditAlarmW
  7084. #else
  7085. #define AccessCheckByTypeResultListAndAuditAlarm AccessCheckByTypeResultListAndAuditAlarmA
  7086. #endif // !UNICODE
  7087. WINADVAPI
  7088. BOOL
  7089. WINAPI
  7090. AccessCheckByTypeResultListAndAuditAlarmByHandleA (
  7091. IN LPCSTR SubsystemName,
  7092. IN LPVOID HandleId,
  7093. IN HANDLE ClientToken,
  7094. IN LPCSTR ObjectTypeName,
  7095. IN LPCSTR ObjectName,
  7096. IN PSECURITY_DESCRIPTOR SecurityDescriptor,
  7097. IN PSID PrincipalSelfSid,
  7098. IN DWORD DesiredAccess,
  7099. IN AUDIT_EVENT_TYPE AuditType,
  7100. IN DWORD Flags,
  7101. IN POBJECT_TYPE_LIST ObjectTypeList,
  7102. IN DWORD ObjectTypeListLength,
  7103. IN PGENERIC_MAPPING GenericMapping,
  7104. IN BOOL ObjectCreation,
  7105. OUT LPDWORD GrantedAccess,
  7106. OUT LPDWORD AccessStatusList,
  7107. OUT LPBOOL pfGenerateOnClose
  7108. );
  7109. WINADVAPI
  7110. BOOL
  7111. WINAPI
  7112. AccessCheckByTypeResultListAndAuditAlarmByHandleW (
  7113. IN LPCWSTR SubsystemName,
  7114. IN LPVOID HandleId,
  7115. IN HANDLE ClientToken,
  7116. IN LPCWSTR ObjectTypeName,
  7117. IN LPCWSTR ObjectName,
  7118. IN PSECURITY_DESCRIPTOR SecurityDescriptor,
  7119. IN PSID PrincipalSelfSid,
  7120. IN DWORD DesiredAccess,
  7121. IN AUDIT_EVENT_TYPE AuditType,
  7122. IN DWORD Flags,
  7123. IN POBJECT_TYPE_LIST ObjectTypeList,
  7124. IN DWORD ObjectTypeListLength,
  7125. IN PGENERIC_MAPPING GenericMapping,
  7126. IN BOOL ObjectCreation,
  7127. OUT LPDWORD GrantedAccess,
  7128. OUT LPDWORD AccessStatusList,
  7129. OUT LPBOOL pfGenerateOnClose
  7130. );
  7131. #ifdef UNICODE
  7132. #define AccessCheckByTypeResultListAndAuditAlarmByHandle AccessCheckByTypeResultListAndAuditAlarmByHandleW
  7133. #else
  7134. #define AccessCheckByTypeResultListAndAuditAlarmByHandle AccessCheckByTypeResultListAndAuditAlarmByHandleA
  7135. #endif // !UNICODE
  7136. #endif //(_WIN32_WINNT >= 0x0500)
  7137. WINADVAPI
  7138. BOOL
  7139. WINAPI
  7140. ObjectOpenAuditAlarmA (
  7141. IN LPCSTR SubsystemName,
  7142. IN LPVOID HandleId,
  7143. IN LPSTR ObjectTypeName,
  7144. IN LPSTR ObjectName,
  7145. IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
  7146. IN HANDLE ClientToken,
  7147. IN DWORD DesiredAccess,
  7148. IN DWORD GrantedAccess,
  7149. IN PPRIVILEGE_SET Privileges,
  7150. IN BOOL ObjectCreation,
  7151. IN BOOL AccessGranted,
  7152. OUT LPBOOL GenerateOnClose
  7153. );
  7154. WINADVAPI
  7155. BOOL
  7156. WINAPI
  7157. ObjectOpenAuditAlarmW (
  7158. IN LPCWSTR SubsystemName,
  7159. IN LPVOID HandleId,
  7160. IN LPWSTR ObjectTypeName,
  7161. IN LPWSTR ObjectName,
  7162. IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
  7163. IN HANDLE ClientToken,
  7164. IN DWORD DesiredAccess,
  7165. IN DWORD GrantedAccess,
  7166. IN PPRIVILEGE_SET Privileges,
  7167. IN BOOL ObjectCreation,
  7168. IN BOOL AccessGranted,
  7169. OUT LPBOOL GenerateOnClose
  7170. );
  7171. #ifdef UNICODE
  7172. #define ObjectOpenAuditAlarm ObjectOpenAuditAlarmW
  7173. #else
  7174. #define ObjectOpenAuditAlarm ObjectOpenAuditAlarmA
  7175. #endif // !UNICODE
  7176. WINADVAPI
  7177. BOOL
  7178. WINAPI
  7179. ObjectPrivilegeAuditAlarmA (
  7180. IN LPCSTR SubsystemName,
  7181. IN LPVOID HandleId,
  7182. IN HANDLE ClientToken,
  7183. IN DWORD DesiredAccess,
  7184. IN PPRIVILEGE_SET Privileges,
  7185. IN BOOL AccessGranted
  7186. );
  7187. WINADVAPI
  7188. BOOL
  7189. WINAPI
  7190. ObjectPrivilegeAuditAlarmW (
  7191. IN LPCWSTR SubsystemName,
  7192. IN LPVOID HandleId,
  7193. IN HANDLE ClientToken,
  7194. IN DWORD DesiredAccess,
  7195. IN PPRIVILEGE_SET Privileges,
  7196. IN BOOL AccessGranted
  7197. );
  7198. #ifdef UNICODE
  7199. #define ObjectPrivilegeAuditAlarm ObjectPrivilegeAuditAlarmW
  7200. #else
  7201. #define ObjectPrivilegeAuditAlarm ObjectPrivilegeAuditAlarmA
  7202. #endif // !UNICODE
  7203. WINADVAPI
  7204. BOOL
  7205. WINAPI
  7206. ObjectCloseAuditAlarmA (
  7207. IN LPCSTR SubsystemName,
  7208. IN LPVOID HandleId,
  7209. IN BOOL GenerateOnClose
  7210. );
  7211. WINADVAPI
  7212. BOOL
  7213. WINAPI
  7214. ObjectCloseAuditAlarmW (
  7215. IN LPCWSTR SubsystemName,
  7216. IN LPVOID HandleId,
  7217. IN BOOL GenerateOnClose
  7218. );
  7219. #ifdef UNICODE
  7220. #define ObjectCloseAuditAlarm ObjectCloseAuditAlarmW
  7221. #else
  7222. #define ObjectCloseAuditAlarm ObjectCloseAuditAlarmA
  7223. #endif // !UNICODE
  7224. WINADVAPI
  7225. BOOL
  7226. WINAPI
  7227. ObjectDeleteAuditAlarmA (
  7228. IN LPCSTR SubsystemName,
  7229. IN LPVOID HandleId,
  7230. IN BOOL GenerateOnClose
  7231. );
  7232. WINADVAPI
  7233. BOOL
  7234. WINAPI
  7235. ObjectDeleteAuditAlarmW (
  7236. IN LPCWSTR SubsystemName,
  7237. IN LPVOID HandleId,
  7238. IN BOOL GenerateOnClose
  7239. );
  7240. #ifdef UNICODE
  7241. #define ObjectDeleteAuditAlarm ObjectDeleteAuditAlarmW
  7242. #else
  7243. #define ObjectDeleteAuditAlarm ObjectDeleteAuditAlarmA
  7244. #endif // !UNICODE
  7245. WINADVAPI
  7246. BOOL
  7247. WINAPI
  7248. PrivilegedServiceAuditAlarmA (
  7249. IN LPCSTR SubsystemName,
  7250. IN LPCSTR ServiceName,
  7251. IN HANDLE ClientToken,
  7252. IN PPRIVILEGE_SET Privileges,
  7253. IN BOOL AccessGranted
  7254. );
  7255. WINADVAPI
  7256. BOOL
  7257. WINAPI
  7258. PrivilegedServiceAuditAlarmW (
  7259. IN LPCWSTR SubsystemName,
  7260. IN LPCWSTR ServiceName,
  7261. IN HANDLE ClientToken,
  7262. IN PPRIVILEGE_SET Privileges,
  7263. IN BOOL AccessGranted
  7264. );
  7265. #ifdef UNICODE
  7266. #define PrivilegedServiceAuditAlarm PrivilegedServiceAuditAlarmW
  7267. #else
  7268. #define PrivilegedServiceAuditAlarm PrivilegedServiceAuditAlarmA
  7269. #endif // !UNICODE
  7270. #if(_WIN32_WINNT >= 0x0501)
  7271. WINADVAPI
  7272. BOOL
  7273. WINAPI
  7274. IsWellKnownSid (
  7275. IN PSID pSid,
  7276. IN WELL_KNOWN_SID_TYPE WellKnownSidType
  7277. );
  7278. WINADVAPI
  7279. BOOL
  7280. WINAPI
  7281. CreateWellKnownSid(
  7282. IN WELL_KNOWN_SID_TYPE WellKnownSidType,
  7283. IN PSID DomainSid OPTIONAL,
  7284. OUT PSID pSid,
  7285. IN OUT DWORD *cbSid
  7286. );
  7287. WINADVAPI
  7288. BOOL
  7289. WINAPI
  7290. EqualDomainSid(
  7291. IN PSID pSid1,
  7292. IN PSID pSid2,
  7293. OUT BOOL *pfEqual
  7294. );
  7295. WINADVAPI
  7296. BOOL
  7297. WINAPI
  7298. GetWindowsAccountDomainSid(
  7299. IN PSID pSid,
  7300. OUT PSID ppDomainSid OPTIONAL,
  7301. IN OUT DWORD *cbSid
  7302. );
  7303. #endif //(_WIN32_WINNT >= 0x0501)
  7304. WINADVAPI
  7305. BOOL
  7306. WINAPI
  7307. IsValidSid (
  7308. IN PSID pSid
  7309. );
  7310. WINADVAPI
  7311. BOOL
  7312. WINAPI
  7313. EqualSid (
  7314. IN PSID pSid1,
  7315. IN PSID pSid2
  7316. );
  7317. WINADVAPI
  7318. BOOL
  7319. WINAPI
  7320. EqualPrefixSid (
  7321. PSID pSid1,
  7322. PSID pSid2
  7323. );
  7324. WINADVAPI
  7325. DWORD
  7326. WINAPI
  7327. GetSidLengthRequired (
  7328. IN UCHAR nSubAuthorityCount
  7329. );
  7330. WINADVAPI
  7331. BOOL
  7332. WINAPI
  7333. AllocateAndInitializeSid (
  7334. IN PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
  7335. IN BYTE nSubAuthorityCount,
  7336. IN DWORD nSubAuthority0,
  7337. IN DWORD nSubAuthority1,
  7338. IN DWORD nSubAuthority2,
  7339. IN DWORD nSubAuthority3,
  7340. IN DWORD nSubAuthority4,
  7341. IN DWORD nSubAuthority5,
  7342. IN DWORD nSubAuthority6,
  7343. IN DWORD nSubAuthority7,
  7344. OUT PSID *pSid
  7345. );
  7346. WINADVAPI
  7347. PVOID
  7348. WINAPI
  7349. FreeSid(
  7350. IN PSID pSid
  7351. );
  7352. WINADVAPI
  7353. BOOL
  7354. WINAPI
  7355. InitializeSid (
  7356. OUT PSID Sid,
  7357. IN PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
  7358. IN BYTE nSubAuthorityCount
  7359. );
  7360. WINADVAPI
  7361. PSID_IDENTIFIER_AUTHORITY
  7362. WINAPI
  7363. GetSidIdentifierAuthority (
  7364. IN PSID pSid
  7365. );
  7366. WINADVAPI
  7367. PDWORD
  7368. WINAPI
  7369. GetSidSubAuthority (
  7370. IN PSID pSid,
  7371. IN DWORD nSubAuthority
  7372. );
  7373. WINADVAPI
  7374. PUCHAR
  7375. WINAPI
  7376. GetSidSubAuthorityCount (
  7377. IN PSID pSid
  7378. );
  7379. WINADVAPI
  7380. DWORD
  7381. WINAPI
  7382. GetLengthSid (
  7383. IN PSID pSid
  7384. );
  7385. WINADVAPI
  7386. BOOL
  7387. WINAPI
  7388. CopySid (
  7389. IN DWORD nDestinationSidLength,
  7390. OUT PSID pDestinationSid,
  7391. IN PSID pSourceSid
  7392. );
  7393. WINADVAPI
  7394. BOOL
  7395. WINAPI
  7396. AreAllAccessesGranted (
  7397. IN DWORD GrantedAccess,
  7398. IN DWORD DesiredAccess
  7399. );
  7400. WINADVAPI
  7401. BOOL
  7402. WINAPI
  7403. AreAnyAccessesGranted (
  7404. IN DWORD GrantedAccess,
  7405. IN DWORD DesiredAccess
  7406. );
  7407. WINADVAPI
  7408. VOID
  7409. WINAPI
  7410. MapGenericMask (
  7411. OUT PDWORD AccessMask,
  7412. IN PGENERIC_MAPPING GenericMapping
  7413. );
  7414. WINADVAPI
  7415. BOOL
  7416. WINAPI
  7417. IsValidAcl (
  7418. IN PACL pAcl
  7419. );
  7420. WINADVAPI
  7421. BOOL
  7422. WINAPI
  7423. InitializeAcl (
  7424. OUT PACL pAcl,
  7425. IN DWORD nAclLength,
  7426. IN DWORD dwAclRevision
  7427. );
  7428. WINADVAPI
  7429. BOOL
  7430. WINAPI
  7431. GetAclInformation (
  7432. IN PACL pAcl,
  7433. OUT LPVOID pAclInformation,
  7434. IN DWORD nAclInformationLength,
  7435. IN ACL_INFORMATION_CLASS dwAclInformationClass
  7436. );
  7437. WINADVAPI
  7438. BOOL
  7439. WINAPI
  7440. SetAclInformation (
  7441. IN PACL pAcl,
  7442. IN LPVOID pAclInformation,
  7443. IN DWORD nAclInformationLength,
  7444. IN ACL_INFORMATION_CLASS dwAclInformationClass
  7445. );
  7446. WINADVAPI
  7447. BOOL
  7448. WINAPI
  7449. AddAce (
  7450. IN OUT PACL pAcl,
  7451. IN DWORD dwAceRevision,
  7452. IN DWORD dwStartingAceIndex,
  7453. IN LPVOID pAceList,
  7454. IN DWORD nAceListLength
  7455. );
  7456. WINADVAPI
  7457. BOOL
  7458. WINAPI
  7459. DeleteAce (
  7460. IN OUT PACL pAcl,
  7461. IN DWORD dwAceIndex
  7462. );
  7463. WINADVAPI
  7464. BOOL
  7465. WINAPI
  7466. GetAce (
  7467. IN PACL pAcl,
  7468. IN DWORD dwAceIndex,
  7469. OUT LPVOID *pAce
  7470. );
  7471. WINADVAPI
  7472. BOOL
  7473. WINAPI
  7474. AddAccessAllowedAce (
  7475. IN OUT PACL pAcl,
  7476. IN DWORD dwAceRevision,
  7477. IN DWORD AccessMask,
  7478. IN PSID pSid
  7479. );
  7480. #if(_WIN32_WINNT >= 0x0500)
  7481. WINADVAPI
  7482. BOOL
  7483. WINAPI
  7484. AddAccessAllowedAceEx (
  7485. IN OUT PACL pAcl,
  7486. IN DWORD dwAceRevision,
  7487. IN DWORD AceFlags,
  7488. IN DWORD AccessMask,
  7489. IN PSID pSid
  7490. );
  7491. #endif /* _WIN32_WINNT >= 0x0500 */
  7492. WINADVAPI
  7493. BOOL
  7494. WINAPI
  7495. AddAccessDeniedAce (
  7496. IN OUT PACL pAcl,
  7497. IN DWORD dwAceRevision,
  7498. IN DWORD AccessMask,
  7499. IN PSID pSid
  7500. );
  7501. #if(_WIN32_WINNT >= 0x0500)
  7502. WINADVAPI
  7503. BOOL
  7504. WINAPI
  7505. AddAccessDeniedAceEx (
  7506. IN OUT PACL pAcl,
  7507. IN DWORD dwAceRevision,
  7508. IN DWORD AceFlags,
  7509. IN DWORD AccessMask,
  7510. IN PSID pSid
  7511. );
  7512. #endif /* _WIN32_WINNT >= 0x0500 */
  7513. WINADVAPI
  7514. BOOL
  7515. WINAPI
  7516. AddAuditAccessAce(
  7517. IN OUT PACL pAcl,
  7518. IN DWORD dwAceRevision,
  7519. IN DWORD dwAccessMask,
  7520. IN PSID pSid,
  7521. IN BOOL bAuditSuccess,
  7522. IN BOOL bAuditFailure
  7523. );
  7524. #if(_WIN32_WINNT >= 0x0500)
  7525. WINADVAPI
  7526. BOOL
  7527. WINAPI
  7528. AddAuditAccessAceEx(
  7529. IN OUT PACL pAcl,
  7530. IN DWORD dwAceRevision,
  7531. IN DWORD AceFlags,
  7532. IN DWORD dwAccessMask,
  7533. IN PSID pSid,
  7534. IN BOOL bAuditSuccess,
  7535. IN BOOL bAuditFailure
  7536. );
  7537. WINADVAPI
  7538. BOOL
  7539. WINAPI
  7540. AddAccessAllowedObjectAce (
  7541. IN OUT PACL pAcl,
  7542. IN DWORD dwAceRevision,
  7543. IN DWORD AceFlags,
  7544. IN DWORD AccessMask,
  7545. IN GUID *ObjectTypeGuid,
  7546. IN GUID *InheritedObjectTypeGuid,
  7547. IN PSID pSid
  7548. );
  7549. WINADVAPI
  7550. BOOL
  7551. WINAPI
  7552. AddAccessDeniedObjectAce (
  7553. IN OUT PACL pAcl,
  7554. IN DWORD dwAceRevision,
  7555. IN DWORD AceFlags,
  7556. IN DWORD AccessMask,
  7557. IN GUID *ObjectTypeGuid,
  7558. IN GUID *InheritedObjectTypeGuid,
  7559. IN PSID pSid
  7560. );
  7561. WINADVAPI
  7562. BOOL
  7563. WINAPI
  7564. AddAuditAccessObjectAce (
  7565. IN OUT PACL pAcl,
  7566. IN DWORD dwAceRevision,
  7567. IN DWORD AceFlags,
  7568. IN DWORD AccessMask,
  7569. IN GUID *ObjectTypeGuid,
  7570. IN GUID *InheritedObjectTypeGuid,
  7571. IN PSID pSid,
  7572. IN BOOL bAuditSuccess,
  7573. IN BOOL bAuditFailure
  7574. );
  7575. #endif /* _WIN32_WINNT >= 0x0500 */
  7576. WINADVAPI
  7577. BOOL
  7578. WINAPI
  7579. FindFirstFreeAce (
  7580. IN PACL pAcl,
  7581. OUT LPVOID *pAce
  7582. );
  7583. WINADVAPI
  7584. BOOL
  7585. WINAPI
  7586. InitializeSecurityDescriptor (
  7587. OUT PSECURITY_DESCRIPTOR pSecurityDescriptor,
  7588. IN DWORD dwRevision
  7589. );
  7590. WINADVAPI
  7591. BOOL
  7592. WINAPI
  7593. IsValidSecurityDescriptor (
  7594. IN PSECURITY_DESCRIPTOR pSecurityDescriptor
  7595. );
  7596. WINADVAPI
  7597. DWORD
  7598. WINAPI
  7599. GetSecurityDescriptorLength (
  7600. IN PSECURITY_DESCRIPTOR pSecurityDescriptor
  7601. );
  7602. WINADVAPI
  7603. BOOL
  7604. WINAPI
  7605. GetSecurityDescriptorControl (
  7606. IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
  7607. OUT PSECURITY_DESCRIPTOR_CONTROL pControl,
  7608. OUT LPDWORD lpdwRevision
  7609. );
  7610. #if(_WIN32_WINNT >= 0x0500)
  7611. WINADVAPI
  7612. BOOL
  7613. WINAPI
  7614. SetSecurityDescriptorControl (
  7615. IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
  7616. IN SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest,
  7617. IN SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet
  7618. );
  7619. #endif /* _WIN32_WINNT >= 0x0500 */
  7620. WINADVAPI
  7621. BOOL
  7622. WINAPI
  7623. SetSecurityDescriptorDacl (
  7624. IN OUT PSECURITY_DESCRIPTOR pSecurityDescriptor,
  7625. IN BOOL bDaclPresent,
  7626. IN PACL pDacl,
  7627. IN BOOL bDaclDefaulted
  7628. );
  7629. WINADVAPI
  7630. BOOL
  7631. WINAPI
  7632. GetSecurityDescriptorDacl (
  7633. IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
  7634. OUT LPBOOL lpbDaclPresent,
  7635. OUT PACL *pDacl,
  7636. OUT LPBOOL lpbDaclDefaulted
  7637. );
  7638. WINADVAPI
  7639. BOOL
  7640. WINAPI
  7641. SetSecurityDescriptorSacl (
  7642. IN OUT PSECURITY_DESCRIPTOR pSecurityDescriptor,
  7643. IN BOOL bSaclPresent,
  7644. IN PACL pSacl,
  7645. IN BOOL bSaclDefaulted
  7646. );
  7647. WINADVAPI
  7648. BOOL
  7649. WINAPI
  7650. GetSecurityDescriptorSacl (
  7651. IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
  7652. OUT LPBOOL lpbSaclPresent,
  7653. OUT PACL *pSacl,
  7654. OUT LPBOOL lpbSaclDefaulted
  7655. );
  7656. WINADVAPI
  7657. BOOL
  7658. WINAPI
  7659. SetSecurityDescriptorOwner (
  7660. IN OUT PSECURITY_DESCRIPTOR pSecurityDescriptor,
  7661. IN PSID pOwner,
  7662. IN BOOL bOwnerDefaulted
  7663. );
  7664. WINADVAPI
  7665. BOOL
  7666. WINAPI
  7667. GetSecurityDescriptorOwner (
  7668. IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
  7669. OUT PSID *pOwner,
  7670. OUT LPBOOL lpbOwnerDefaulted
  7671. );
  7672. WINADVAPI
  7673. BOOL
  7674. WINAPI
  7675. SetSecurityDescriptorGroup (
  7676. IN OUT PSECURITY_DESCRIPTOR pSecurityDescriptor,
  7677. IN PSID pGroup,
  7678. IN BOOL bGroupDefaulted
  7679. );
  7680. WINADVAPI
  7681. BOOL
  7682. WINAPI
  7683. GetSecurityDescriptorGroup (
  7684. IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
  7685. OUT PSID *pGroup,
  7686. OUT LPBOOL lpbGroupDefaulted
  7687. );
  7688. WINADVAPI
  7689. DWORD
  7690. WINAPI
  7691. SetSecurityDescriptorRMControl(
  7692. IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor,
  7693. IN PUCHAR RMControl OPTIONAL
  7694. );
  7695. WINADVAPI
  7696. DWORD
  7697. WINAPI
  7698. GetSecurityDescriptorRMControl(
  7699. IN PSECURITY_DESCRIPTOR SecurityDescriptor,
  7700. OUT PUCHAR RMControl
  7701. );
  7702. WINADVAPI
  7703. BOOL
  7704. WINAPI
  7705. CreatePrivateObjectSecurity (
  7706. IN PSECURITY_DESCRIPTOR ParentDescriptor,
  7707. IN PSECURITY_DESCRIPTOR CreatorDescriptor,
  7708. OUT PSECURITY_DESCRIPTOR * NewDescriptor,
  7709. IN BOOL IsDirectoryObject,
  7710. IN HANDLE Token,
  7711. IN PGENERIC_MAPPING GenericMapping
  7712. );
  7713. #if(_WIN32_WINNT >= 0x0500)
  7714. WINADVAPI
  7715. BOOL
  7716. WINAPI
  7717. ConvertToAutoInheritPrivateObjectSecurity(
  7718. IN PSECURITY_DESCRIPTOR ParentDescriptor,
  7719. IN PSECURITY_DESCRIPTOR CurrentSecurityDescriptor,
  7720. OUT PSECURITY_DESCRIPTOR *NewSecurityDescriptor,
  7721. IN GUID *ObjectType,
  7722. IN BOOLEAN IsDirectoryObject,
  7723. IN PGENERIC_MAPPING GenericMapping
  7724. );
  7725. WINADVAPI
  7726. BOOL
  7727. WINAPI
  7728. CreatePrivateObjectSecurityEx (
  7729. IN PSECURITY_DESCRIPTOR ParentDescriptor,
  7730. IN PSECURITY_DESCRIPTOR CreatorDescriptor,
  7731. OUT PSECURITY_DESCRIPTOR * NewDescriptor,
  7732. IN GUID *ObjectType OPTIONAL,
  7733. IN BOOL IsContainerObject,
  7734. IN ULONG AutoInheritFlags,
  7735. IN HANDLE Token,
  7736. IN PGENERIC_MAPPING GenericMapping
  7737. );
  7738. WINADVAPI
  7739. BOOL
  7740. WINAPI
  7741. CreatePrivateObjectSecurityWithMultipleInheritance (
  7742. IN PSECURITY_DESCRIPTOR ParentDescriptor,
  7743. IN PSECURITY_DESCRIPTOR CreatorDescriptor,
  7744. OUT PSECURITY_DESCRIPTOR * NewDescriptor,
  7745. IN GUID **ObjectTypes OPTIONAL,
  7746. IN ULONG GuidCount,
  7747. IN BOOL IsContainerObject,
  7748. IN ULONG AutoInheritFlags,
  7749. IN HANDLE Token,
  7750. IN PGENERIC_MAPPING GenericMapping
  7751. );
  7752. #endif /* _WIN32_WINNT >= 0x0500 */
  7753. WINADVAPI
  7754. BOOL
  7755. WINAPI
  7756. SetPrivateObjectSecurity (
  7757. IN SECURITY_INFORMATION SecurityInformation,
  7758. IN PSECURITY_DESCRIPTOR ModificationDescriptor,
  7759. OUT PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor,
  7760. IN PGENERIC_MAPPING GenericMapping,
  7761. IN HANDLE Token
  7762. );
  7763. #if(_WIN32_WINNT >= 0x0500)
  7764. WINADVAPI
  7765. BOOL
  7766. WINAPI
  7767. SetPrivateObjectSecurityEx (
  7768. IN SECURITY_INFORMATION SecurityInformation,
  7769. IN PSECURITY_DESCRIPTOR ModificationDescriptor,
  7770. OUT PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor,
  7771. IN ULONG AutoInheritFlags,
  7772. IN PGENERIC_MAPPING GenericMapping,
  7773. IN HANDLE Token OPTIONAL
  7774. );
  7775. #endif /* _WIN32_WINNT >= 0x0500 */
  7776. WINADVAPI
  7777. BOOL
  7778. WINAPI
  7779. GetPrivateObjectSecurity (
  7780. IN PSECURITY_DESCRIPTOR ObjectDescriptor,
  7781. IN SECURITY_INFORMATION SecurityInformation,
  7782. OUT PSECURITY_DESCRIPTOR ResultantDescriptor,
  7783. IN DWORD DescriptorLength,
  7784. OUT PDWORD ReturnLength
  7785. );
  7786. WINADVAPI
  7787. BOOL
  7788. WINAPI
  7789. DestroyPrivateObjectSecurity (
  7790. IN OUT PSECURITY_DESCRIPTOR * ObjectDescriptor
  7791. );
  7792. WINADVAPI
  7793. BOOL
  7794. WINAPI
  7795. MakeSelfRelativeSD (
  7796. IN PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor,
  7797. OUT PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor,
  7798. OUT LPDWORD lpdwBufferLength
  7799. );
  7800. WINADVAPI
  7801. BOOL
  7802. WINAPI
  7803. MakeAbsoluteSD (
  7804. IN PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor,
  7805. OUT PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor,
  7806. OUT LPDWORD lpdwAbsoluteSecurityDescriptorSize,
  7807. OUT PACL pDacl,
  7808. OUT LPDWORD lpdwDaclSize,
  7809. OUT PACL pSacl,
  7810. OUT LPDWORD lpdwSaclSize,
  7811. OUT PSID pOwner,
  7812. OUT LPDWORD lpdwOwnerSize,
  7813. OUT PSID pPrimaryGroup,
  7814. OUT LPDWORD lpdwPrimaryGroupSize
  7815. );
  7816. WINADVAPI
  7817. BOOL
  7818. WINAPI
  7819. MakeAbsoluteSD2 (
  7820. IN PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor,
  7821. OUT LPDWORD lpdwBufferSize
  7822. );
  7823. WINADVAPI
  7824. BOOL
  7825. WINAPI
  7826. SetFileSecurityA (
  7827. IN LPCSTR lpFileName,
  7828. IN SECURITY_INFORMATION SecurityInformation,
  7829. IN PSECURITY_DESCRIPTOR pSecurityDescriptor
  7830. );
  7831. WINADVAPI
  7832. BOOL
  7833. WINAPI
  7834. SetFileSecurityW (
  7835. IN LPCWSTR lpFileName,
  7836. IN SECURITY_INFORMATION SecurityInformation,
  7837. IN PSECURITY_DESCRIPTOR pSecurityDescriptor
  7838. );
  7839. #ifdef UNICODE
  7840. #define SetFileSecurity SetFileSecurityW
  7841. #else
  7842. #define SetFileSecurity SetFileSecurityA
  7843. #endif // !UNICODE
  7844. WINADVAPI
  7845. BOOL
  7846. WINAPI
  7847. GetFileSecurityA (
  7848. IN LPCSTR lpFileName,
  7849. IN SECURITY_INFORMATION RequestedInformation,
  7850. OUT PSECURITY_DESCRIPTOR pSecurityDescriptor,
  7851. IN DWORD nLength,
  7852. OUT LPDWORD lpnLengthNeeded
  7853. );
  7854. WINADVAPI
  7855. BOOL
  7856. WINAPI
  7857. GetFileSecurityW (
  7858. IN LPCWSTR lpFileName,
  7859. IN SECURITY_INFORMATION RequestedInformation,
  7860. OUT PSECURITY_DESCRIPTOR pSecurityDescriptor,
  7861. IN DWORD nLength,
  7862. OUT LPDWORD lpnLengthNeeded
  7863. );
  7864. #ifdef UNICODE
  7865. #define GetFileSecurity GetFileSecurityW
  7866. #else
  7867. #define GetFileSecurity GetFileSecurityA
  7868. #endif // !UNICODE
  7869. WINADVAPI
  7870. BOOL
  7871. WINAPI
  7872. SetKernelObjectSecurity (
  7873. IN HANDLE Handle,
  7874. IN SECURITY_INFORMATION SecurityInformation,
  7875. IN PSECURITY_DESCRIPTOR SecurityDescriptor
  7876. );
  7877. WINBASEAPI
  7878. HANDLE
  7879. WINAPI
  7880. FindFirstChangeNotificationA(
  7881. IN LPCSTR lpPathName,
  7882. IN BOOL bWatchSubtree,
  7883. IN DWORD dwNotifyFilter
  7884. );
  7885. WINBASEAPI
  7886. HANDLE
  7887. WINAPI
  7888. FindFirstChangeNotificationW(
  7889. IN LPCWSTR lpPathName,
  7890. IN BOOL bWatchSubtree,
  7891. IN DWORD dwNotifyFilter
  7892. );
  7893. #ifdef UNICODE
  7894. #define FindFirstChangeNotification FindFirstChangeNotificationW
  7895. #else
  7896. #define FindFirstChangeNotification FindFirstChangeNotificationA
  7897. #endif // !UNICODE
  7898. WINBASEAPI
  7899. BOOL
  7900. WINAPI
  7901. FindNextChangeNotification(
  7902. IN HANDLE hChangeHandle
  7903. );
  7904. WINBASEAPI
  7905. BOOL
  7906. WINAPI
  7907. FindCloseChangeNotification(
  7908. IN HANDLE hChangeHandle
  7909. );
  7910. #if(_WIN32_WINNT >= 0x0400)
  7911. WINBASEAPI
  7912. BOOL
  7913. WINAPI
  7914. ReadDirectoryChangesW(
  7915. IN HANDLE hDirectory,
  7916. IN OUT LPVOID lpBuffer,
  7917. IN DWORD nBufferLength,
  7918. IN BOOL bWatchSubtree,
  7919. IN DWORD dwNotifyFilter,
  7920. OUT LPDWORD lpBytesReturned,
  7921. IN LPOVERLAPPED lpOverlapped,
  7922. IN LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
  7923. );
  7924. #endif /* _WIN32_WINNT >= 0x0400 */
  7925. WINBASEAPI
  7926. BOOL
  7927. WINAPI
  7928. VirtualLock(
  7929. IN LPVOID lpAddress,
  7930. IN SIZE_T dwSize
  7931. );
  7932. WINBASEAPI
  7933. BOOL
  7934. WINAPI
  7935. VirtualUnlock(
  7936. IN LPVOID lpAddress,
  7937. IN SIZE_T dwSize
  7938. );
  7939. WINBASEAPI
  7940. LPVOID
  7941. WINAPI
  7942. MapViewOfFileEx(
  7943. IN HANDLE hFileMappingObject,
  7944. IN DWORD dwDesiredAccess,
  7945. IN DWORD dwFileOffsetHigh,
  7946. IN DWORD dwFileOffsetLow,
  7947. IN SIZE_T dwNumberOfBytesToMap,
  7948. IN LPVOID lpBaseAddress
  7949. );
  7950. WINBASEAPI
  7951. BOOL
  7952. WINAPI
  7953. SetPriorityClass(
  7954. IN HANDLE hProcess,
  7955. IN DWORD dwPriorityClass
  7956. );
  7957. WINBASEAPI
  7958. DWORD
  7959. WINAPI
  7960. GetPriorityClass(
  7961. IN HANDLE hProcess
  7962. );
  7963. WINBASEAPI
  7964. BOOL
  7965. WINAPI
  7966. IsBadReadPtr(
  7967. IN CONST VOID *lp,
  7968. IN UINT_PTR ucb
  7969. );
  7970. WINBASEAPI
  7971. BOOL
  7972. WINAPI
  7973. IsBadWritePtr(
  7974. IN LPVOID lp,
  7975. IN UINT_PTR ucb
  7976. );
  7977. WINBASEAPI
  7978. BOOL
  7979. WINAPI
  7980. IsBadHugeReadPtr(
  7981. IN CONST VOID *lp,
  7982. IN UINT_PTR ucb
  7983. );
  7984. WINBASEAPI
  7985. BOOL
  7986. WINAPI
  7987. IsBadHugeWritePtr(
  7988. IN LPVOID lp,
  7989. IN UINT_PTR ucb
  7990. );
  7991. WINBASEAPI
  7992. BOOL
  7993. WINAPI
  7994. IsBadCodePtr(
  7995. IN FARPROC lpfn
  7996. );
  7997. WINBASEAPI
  7998. BOOL
  7999. WINAPI
  8000. IsBadStringPtrA(
  8001. IN LPCSTR lpsz,
  8002. IN UINT_PTR ucchMax
  8003. );
  8004. WINBASEAPI
  8005. BOOL
  8006. WINAPI
  8007. IsBadStringPtrW(
  8008. IN LPCWSTR lpsz,
  8009. IN UINT_PTR ucchMax
  8010. );
  8011. #ifdef UNICODE
  8012. #define IsBadStringPtr IsBadStringPtrW
  8013. #else
  8014. #define IsBadStringPtr IsBadStringPtrA
  8015. #endif // !UNICODE
  8016. WINADVAPI
  8017. BOOL
  8018. WINAPI
  8019. LookupAccountSidA(
  8020. IN LPCSTR lpSystemName,
  8021. IN PSID Sid,
  8022. OUT LPSTR Name,
  8023. IN OUT LPDWORD cchName,
  8024. OUT LPSTR ReferencedDomainName,
  8025. IN OUT LPDWORD cchReferencedDomainName,
  8026. OUT PSID_NAME_USE peUse
  8027. );
  8028. WINADVAPI
  8029. BOOL
  8030. WINAPI
  8031. LookupAccountSidW(
  8032. IN LPCWSTR lpSystemName,
  8033. IN PSID Sid,
  8034. OUT LPWSTR Name,
  8035. IN OUT LPDWORD cchName,
  8036. OUT LPWSTR ReferencedDomainName,
  8037. IN OUT LPDWORD cchReferencedDomainName,
  8038. OUT PSID_NAME_USE peUse
  8039. );
  8040. #ifdef UNICODE
  8041. #define LookupAccountSid LookupAccountSidW
  8042. #else
  8043. #define LookupAccountSid LookupAccountSidA
  8044. #endif // !UNICODE
  8045. WINADVAPI
  8046. BOOL
  8047. WINAPI
  8048. LookupAccountNameA(
  8049. IN LPCSTR lpSystemName,
  8050. IN LPCSTR lpAccountName,
  8051. OUT PSID Sid,
  8052. IN OUT LPDWORD cbSid,
  8053. OUT LPSTR ReferencedDomainName,
  8054. IN OUT LPDWORD cchReferencedDomainName,
  8055. OUT PSID_NAME_USE peUse
  8056. );
  8057. WINADVAPI
  8058. BOOL
  8059. WINAPI
  8060. LookupAccountNameW(
  8061. IN LPCWSTR lpSystemName,
  8062. IN LPCWSTR lpAccountName,
  8063. OUT PSID Sid,
  8064. IN OUT LPDWORD cbSid,
  8065. OUT LPWSTR ReferencedDomainName,
  8066. IN OUT LPDWORD cchReferencedDomainName,
  8067. OUT PSID_NAME_USE peUse
  8068. );
  8069. #ifdef UNICODE
  8070. #define LookupAccountName LookupAccountNameW
  8071. #else
  8072. #define LookupAccountName LookupAccountNameA
  8073. #endif // !UNICODE
  8074. WINADVAPI
  8075. BOOL
  8076. WINAPI
  8077. LookupPrivilegeValueA(
  8078. IN LPCSTR lpSystemName,
  8079. IN LPCSTR lpName,
  8080. OUT PLUID lpLuid
  8081. );
  8082. WINADVAPI
  8083. BOOL
  8084. WINAPI
  8085. LookupPrivilegeValueW(
  8086. IN LPCWSTR lpSystemName,
  8087. IN LPCWSTR lpName,
  8088. OUT PLUID lpLuid
  8089. );
  8090. #ifdef UNICODE
  8091. #define LookupPrivilegeValue LookupPrivilegeValueW
  8092. #else
  8093. #define LookupPrivilegeValue LookupPrivilegeValueA
  8094. #endif // !UNICODE
  8095. WINADVAPI
  8096. BOOL
  8097. WINAPI
  8098. LookupPrivilegeNameA(
  8099. IN LPCSTR lpSystemName,
  8100. IN PLUID lpLuid,
  8101. OUT LPSTR lpName,
  8102. IN OUT LPDWORD cbName
  8103. );
  8104. WINADVAPI
  8105. BOOL
  8106. WINAPI
  8107. LookupPrivilegeNameW(
  8108. IN LPCWSTR lpSystemName,
  8109. IN PLUID lpLuid,
  8110. OUT LPWSTR lpName,
  8111. IN OUT LPDWORD cbName
  8112. );
  8113. #ifdef UNICODE
  8114. #define LookupPrivilegeName LookupPrivilegeNameW
  8115. #else
  8116. #define LookupPrivilegeName LookupPrivilegeNameA
  8117. #endif // !UNICODE
  8118. WINADVAPI
  8119. BOOL
  8120. WINAPI
  8121. LookupPrivilegeDisplayNameA(
  8122. IN LPCSTR lpSystemName,
  8123. IN LPCSTR lpName,
  8124. OUT LPSTR lpDisplayName,
  8125. IN OUT LPDWORD cbDisplayName,
  8126. OUT LPDWORD lpLanguageId
  8127. );
  8128. WINADVAPI
  8129. BOOL
  8130. WINAPI
  8131. LookupPrivilegeDisplayNameW(
  8132. IN LPCWSTR lpSystemName,
  8133. IN LPCWSTR lpName,
  8134. OUT LPWSTR lpDisplayName,
  8135. IN OUT LPDWORD cbDisplayName,
  8136. OUT LPDWORD lpLanguageId
  8137. );
  8138. #ifdef UNICODE
  8139. #define LookupPrivilegeDisplayName LookupPrivilegeDisplayNameW
  8140. #else
  8141. #define LookupPrivilegeDisplayName LookupPrivilegeDisplayNameA
  8142. #endif // !UNICODE
  8143. WINADVAPI
  8144. BOOL
  8145. WINAPI
  8146. AllocateLocallyUniqueId(
  8147. OUT PLUID Luid
  8148. );
  8149. WINBASEAPI
  8150. BOOL
  8151. WINAPI
  8152. BuildCommDCBA(
  8153. IN LPCSTR lpDef,
  8154. OUT LPDCB lpDCB
  8155. );
  8156. WINBASEAPI
  8157. BOOL
  8158. WINAPI
  8159. BuildCommDCBW(
  8160. IN LPCWSTR lpDef,
  8161. OUT LPDCB lpDCB
  8162. );
  8163. #ifdef UNICODE
  8164. #define BuildCommDCB BuildCommDCBW
  8165. #else
  8166. #define BuildCommDCB BuildCommDCBA
  8167. #endif // !UNICODE
  8168. WINBASEAPI
  8169. BOOL
  8170. WINAPI
  8171. BuildCommDCBAndTimeoutsA(
  8172. IN LPCSTR lpDef,
  8173. OUT LPDCB lpDCB,
  8174. IN LPCOMMTIMEOUTS lpCommTimeouts
  8175. );
  8176. WINBASEAPI
  8177. BOOL
  8178. WINAPI
  8179. BuildCommDCBAndTimeoutsW(
  8180. IN LPCWSTR lpDef,
  8181. OUT LPDCB lpDCB,
  8182. IN LPCOMMTIMEOUTS lpCommTimeouts
  8183. );
  8184. #ifdef UNICODE
  8185. #define BuildCommDCBAndTimeouts BuildCommDCBAndTimeoutsW
  8186. #else
  8187. #define BuildCommDCBAndTimeouts BuildCommDCBAndTimeoutsA
  8188. #endif // !UNICODE
  8189. WINBASEAPI
  8190. BOOL
  8191. WINAPI
  8192. CommConfigDialogA(
  8193. IN LPCSTR lpszName,
  8194. IN HWND hWnd,
  8195. IN OUT LPCOMMCONFIG lpCC
  8196. );
  8197. WINBASEAPI
  8198. BOOL
  8199. WINAPI
  8200. CommConfigDialogW(
  8201. IN LPCWSTR lpszName,
  8202. IN HWND hWnd,
  8203. IN OUT LPCOMMCONFIG lpCC
  8204. );
  8205. #ifdef UNICODE
  8206. #define CommConfigDialog CommConfigDialogW
  8207. #else
  8208. #define CommConfigDialog CommConfigDialogA
  8209. #endif // !UNICODE
  8210. WINBASEAPI
  8211. BOOL
  8212. WINAPI
  8213. GetDefaultCommConfigA(
  8214. IN LPCSTR lpszName,
  8215. OUT LPCOMMCONFIG lpCC,
  8216. IN OUT LPDWORD lpdwSize
  8217. );
  8218. WINBASEAPI
  8219. BOOL
  8220. WINAPI
  8221. GetDefaultCommConfigW(
  8222. IN LPCWSTR lpszName,
  8223. OUT LPCOMMCONFIG lpCC,
  8224. IN OUT LPDWORD lpdwSize
  8225. );
  8226. #ifdef UNICODE
  8227. #define GetDefaultCommConfig GetDefaultCommConfigW
  8228. #else
  8229. #define GetDefaultCommConfig GetDefaultCommConfigA
  8230. #endif // !UNICODE
  8231. WINBASEAPI
  8232. BOOL
  8233. WINAPI
  8234. SetDefaultCommConfigA(
  8235. IN LPCSTR lpszName,
  8236. IN LPCOMMCONFIG lpCC,
  8237. IN DWORD dwSize
  8238. );
  8239. WINBASEAPI
  8240. BOOL
  8241. WINAPI
  8242. SetDefaultCommConfigW(
  8243. IN LPCWSTR lpszName,
  8244. IN LPCOMMCONFIG lpCC,
  8245. IN DWORD dwSize
  8246. );
  8247. #ifdef UNICODE
  8248. #define SetDefaultCommConfig SetDefaultCommConfigW
  8249. #else
  8250. #define SetDefaultCommConfig SetDefaultCommConfigA
  8251. #endif // !UNICODE
  8252. #ifndef _MAC
  8253. #define MAX_COMPUTERNAME_LENGTH 15
  8254. #else
  8255. #define MAX_COMPUTERNAME_LENGTH 31
  8256. #endif
  8257. WINBASEAPI
  8258. BOOL
  8259. WINAPI
  8260. GetComputerNameA (
  8261. OUT LPSTR lpBuffer,
  8262. IN OUT LPDWORD nSize
  8263. );
  8264. WINBASEAPI
  8265. BOOL
  8266. WINAPI
  8267. GetComputerNameW (
  8268. OUT LPWSTR lpBuffer,
  8269. IN OUT LPDWORD nSize
  8270. );
  8271. #ifdef UNICODE
  8272. #define GetComputerName GetComputerNameW
  8273. #else
  8274. #define GetComputerName GetComputerNameA
  8275. #endif // !UNICODE
  8276. WINBASEAPI
  8277. BOOL
  8278. WINAPI
  8279. SetComputerNameA (
  8280. IN LPCSTR lpComputerName
  8281. );
  8282. WINBASEAPI
  8283. BOOL
  8284. WINAPI
  8285. SetComputerNameW (
  8286. IN LPCWSTR lpComputerName
  8287. );
  8288. #ifdef UNICODE
  8289. #define SetComputerName SetComputerNameW
  8290. #else
  8291. #define SetComputerName SetComputerNameA
  8292. #endif // !UNICODE
  8293. #if (_WIN32_WINNT >= 0x0500)
  8294. typedef enum _COMPUTER_NAME_FORMAT {
  8295. ComputerNameNetBIOS,
  8296. ComputerNameDnsHostname,
  8297. ComputerNameDnsDomain,
  8298. ComputerNameDnsFullyQualified,
  8299. ComputerNamePhysicalNetBIOS,
  8300. ComputerNamePhysicalDnsHostname,
  8301. ComputerNamePhysicalDnsDomain,
  8302. ComputerNamePhysicalDnsFullyQualified,
  8303. ComputerNameMax
  8304. } COMPUTER_NAME_FORMAT ;
  8305. WINBASEAPI
  8306. BOOL
  8307. WINAPI
  8308. GetComputerNameExA (
  8309. IN COMPUTER_NAME_FORMAT NameType,
  8310. OUT LPSTR lpBuffer,
  8311. IN OUT LPDWORD nSize
  8312. );
  8313. WINBASEAPI
  8314. BOOL
  8315. WINAPI
  8316. GetComputerNameExW (
  8317. IN COMPUTER_NAME_FORMAT NameType,
  8318. OUT LPWSTR lpBuffer,
  8319. IN OUT LPDWORD nSize
  8320. );
  8321. #ifdef UNICODE
  8322. #define GetComputerNameEx GetComputerNameExW
  8323. #else
  8324. #define GetComputerNameEx GetComputerNameExA
  8325. #endif // !UNICODE
  8326. WINBASEAPI
  8327. BOOL
  8328. WINAPI
  8329. SetComputerNameExA (
  8330. IN COMPUTER_NAME_FORMAT NameType,
  8331. IN LPCSTR lpBuffer
  8332. );
  8333. WINBASEAPI
  8334. BOOL
  8335. WINAPI
  8336. SetComputerNameExW (
  8337. IN COMPUTER_NAME_FORMAT NameType,
  8338. IN LPCWSTR lpBuffer
  8339. );
  8340. #ifdef UNICODE
  8341. #define SetComputerNameEx SetComputerNameExW
  8342. #else
  8343. #define SetComputerNameEx SetComputerNameExA
  8344. #endif // !UNICODE
  8345. WINBASEAPI
  8346. BOOL
  8347. WINAPI
  8348. DnsHostnameToComputerNameA (
  8349. IN LPCSTR Hostname,
  8350. OUT LPSTR ComputerName,
  8351. IN OUT LPDWORD nSize
  8352. );
  8353. WINBASEAPI
  8354. BOOL
  8355. WINAPI
  8356. DnsHostnameToComputerNameW (
  8357. IN LPCWSTR Hostname,
  8358. OUT LPWSTR ComputerName,
  8359. IN OUT LPDWORD nSize
  8360. );
  8361. #ifdef UNICODE
  8362. #define DnsHostnameToComputerName DnsHostnameToComputerNameW
  8363. #else
  8364. #define DnsHostnameToComputerName DnsHostnameToComputerNameA
  8365. #endif // !UNICODE
  8366. #endif // _WIN32_WINNT
  8367. WINADVAPI
  8368. BOOL
  8369. WINAPI
  8370. GetUserNameA (
  8371. OUT LPSTR lpBuffer,
  8372. IN OUT LPDWORD nSize
  8373. );
  8374. WINADVAPI
  8375. BOOL
  8376. WINAPI
  8377. GetUserNameW (
  8378. OUT LPWSTR lpBuffer,
  8379. IN OUT LPDWORD nSize
  8380. );
  8381. #ifdef UNICODE
  8382. #define GetUserName GetUserNameW
  8383. #else
  8384. #define GetUserName GetUserNameA
  8385. #endif // !UNICODE
  8386. //
  8387. // Logon Support APIs
  8388. //
  8389. #define LOGON32_LOGON_INTERACTIVE 2
  8390. #define LOGON32_LOGON_NETWORK 3
  8391. #define LOGON32_LOGON_BATCH 4
  8392. #define LOGON32_LOGON_SERVICE 5
  8393. #define LOGON32_LOGON_UNLOCK 7
  8394. #if(_WIN32_WINNT >= 0x0500)
  8395. #define LOGON32_LOGON_NETWORK_CLEARTEXT 8
  8396. #define LOGON32_LOGON_NEW_CREDENTIALS 9
  8397. #endif // (_WIN32_WINNT >= 0x0500)
  8398. #define LOGON32_PROVIDER_DEFAULT 0
  8399. #define LOGON32_PROVIDER_WINNT35 1
  8400. #if(_WIN32_WINNT >= 0x0400)
  8401. #define LOGON32_PROVIDER_WINNT40 2
  8402. #endif /* _WIN32_WINNT >= 0x0400 */
  8403. #if(_WIN32_WINNT >= 0x0500)
  8404. #define LOGON32_PROVIDER_WINNT50 3
  8405. #endif // (_WIN32_WINNT >= 0x0500)
  8406. WINADVAPI
  8407. BOOL
  8408. WINAPI
  8409. LogonUserA (
  8410. IN LPCSTR lpszUsername,
  8411. IN LPCSTR lpszDomain,
  8412. IN LPCSTR lpszPassword,
  8413. IN DWORD dwLogonType,
  8414. IN DWORD dwLogonProvider,
  8415. OUT PHANDLE phToken
  8416. );
  8417. WINADVAPI
  8418. BOOL
  8419. WINAPI
  8420. LogonUserW (
  8421. IN LPCWSTR lpszUsername,
  8422. IN LPCWSTR lpszDomain,
  8423. IN LPCWSTR lpszPassword,
  8424. IN DWORD dwLogonType,
  8425. IN DWORD dwLogonProvider,
  8426. OUT PHANDLE phToken
  8427. );
  8428. #ifdef UNICODE
  8429. #define LogonUser LogonUserW
  8430. #else
  8431. #define LogonUser LogonUserA
  8432. #endif // !UNICODE
  8433. WINADVAPI
  8434. BOOL
  8435. WINAPI
  8436. LogonUserExA (
  8437. IN LPCSTR lpszUsername,
  8438. IN LPCSTR lpszDomain,
  8439. IN LPCSTR lpszPassword,
  8440. IN DWORD dwLogonType,
  8441. IN DWORD dwLogonProvider,
  8442. OUT PHANDLE phToken OPTIONAL,
  8443. OUT PSID *ppLogonSid OPTIONAL,
  8444. OUT PVOID *ppProfileBuffer OPTIONAL,
  8445. OUT LPDWORD pdwProfileLength OPTIONAL,
  8446. OUT PQUOTA_LIMITS pQuotaLimits OPTIONAL
  8447. );
  8448. WINADVAPI
  8449. BOOL
  8450. WINAPI
  8451. LogonUserExW (
  8452. IN LPCWSTR lpszUsername,
  8453. IN LPCWSTR lpszDomain,
  8454. IN LPCWSTR lpszPassword,
  8455. IN DWORD dwLogonType,
  8456. IN DWORD dwLogonProvider,
  8457. OUT PHANDLE phToken OPTIONAL,
  8458. OUT PSID *ppLogonSid OPTIONAL,
  8459. OUT PVOID *ppProfileBuffer OPTIONAL,
  8460. OUT LPDWORD pdwProfileLength OPTIONAL,
  8461. OUT PQUOTA_LIMITS pQuotaLimits OPTIONAL
  8462. );
  8463. #ifdef UNICODE
  8464. #define LogonUserEx LogonUserExW
  8465. #else
  8466. #define LogonUserEx LogonUserExA
  8467. #endif // !UNICODE
  8468. WINADVAPI
  8469. BOOL
  8470. WINAPI
  8471. ImpersonateLoggedOnUser(
  8472. IN HANDLE hToken
  8473. );
  8474. WINADVAPI
  8475. BOOL
  8476. WINAPI
  8477. CreateProcessAsUserA (
  8478. IN HANDLE hToken,
  8479. IN LPCSTR lpApplicationName,
  8480. IN LPSTR lpCommandLine,
  8481. IN LPSECURITY_ATTRIBUTES lpProcessAttributes,
  8482. IN LPSECURITY_ATTRIBUTES lpThreadAttributes,
  8483. IN BOOL bInheritHandles,
  8484. IN DWORD dwCreationFlags,
  8485. IN LPVOID lpEnvironment,
  8486. IN LPCSTR lpCurrentDirectory,
  8487. IN LPSTARTUPINFOA lpStartupInfo,
  8488. OUT LPPROCESS_INFORMATION lpProcessInformation
  8489. );
  8490. WINADVAPI
  8491. BOOL
  8492. WINAPI
  8493. CreateProcessAsUserW (
  8494. IN HANDLE hToken,
  8495. IN LPCWSTR lpApplicationName,
  8496. IN LPWSTR lpCommandLine,
  8497. IN LPSECURITY_ATTRIBUTES lpProcessAttributes,
  8498. IN LPSECURITY_ATTRIBUTES lpThreadAttributes,
  8499. IN BOOL bInheritHandles,
  8500. IN DWORD dwCreationFlags,
  8501. IN LPVOID lpEnvironment,
  8502. IN LPCWSTR lpCurrentDirectory,
  8503. IN LPSTARTUPINFOW lpStartupInfo,
  8504. OUT LPPROCESS_INFORMATION lpProcessInformation
  8505. );
  8506. #ifdef UNICODE
  8507. #define CreateProcessAsUser CreateProcessAsUserW
  8508. #else
  8509. #define CreateProcessAsUser CreateProcessAsUserA
  8510. #endif // !UNICODE
  8511. #if(_WIN32_WINNT >= 0x0500)
  8512. //
  8513. // LogonFlags
  8514. //
  8515. #define LOGON_WITH_PROFILE 0x00000001
  8516. #define LOGON_NETCREDENTIALS_ONLY 0x00000002
  8517. #define LOGON_ZERO_PASSWORD_BUFFER 0x80000000
  8518. WINADVAPI
  8519. BOOL
  8520. WINAPI
  8521. CreateProcessWithLogonW(
  8522. LPCWSTR lpUsername,
  8523. LPCWSTR lpDomain,
  8524. LPCWSTR lpPassword,
  8525. DWORD dwLogonFlags,
  8526. LPCWSTR lpApplicationName,
  8527. LPWSTR lpCommandLine,
  8528. DWORD dwCreationFlags,
  8529. LPVOID lpEnvironment,
  8530. LPCWSTR lpCurrentDirectory,
  8531. LPSTARTUPINFOW lpStartupInfo,
  8532. LPPROCESS_INFORMATION lpProcessInformation
  8533. );
  8534. WINADVAPI
  8535. BOOL
  8536. WINAPI
  8537. CreateProcessWithTokenW(
  8538. HANDLE hToken,
  8539. DWORD dwLogonFlags,
  8540. LPCWSTR lpApplicationName,
  8541. LPWSTR lpCommandLine,
  8542. DWORD dwCreationFlags,
  8543. LPVOID lpEnvironment,
  8544. LPCWSTR lpCurrentDirectory,
  8545. LPSTARTUPINFOW lpStartupInfo,
  8546. LPPROCESS_INFORMATION lpProcessInformation
  8547. );
  8548. #endif // (_WIN32_WINNT >= 0x0500)
  8549. WINADVAPI
  8550. BOOL
  8551. APIENTRY
  8552. ImpersonateAnonymousToken(
  8553. IN HANDLE ThreadHandle
  8554. );
  8555. WINADVAPI
  8556. BOOL
  8557. WINAPI
  8558. DuplicateTokenEx(
  8559. IN HANDLE hExistingToken,
  8560. IN DWORD dwDesiredAccess,
  8561. IN LPSECURITY_ATTRIBUTES lpTokenAttributes,
  8562. IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
  8563. IN TOKEN_TYPE TokenType,
  8564. OUT PHANDLE phNewToken);
  8565. WINADVAPI
  8566. BOOL
  8567. APIENTRY
  8568. CreateRestrictedToken(
  8569. IN HANDLE ExistingTokenHandle,
  8570. IN DWORD Flags,
  8571. IN DWORD DisableSidCount,
  8572. IN PSID_AND_ATTRIBUTES SidsToDisable OPTIONAL,
  8573. IN DWORD DeletePrivilegeCount,
  8574. IN PLUID_AND_ATTRIBUTES PrivilegesToDelete OPTIONAL,
  8575. IN DWORD RestrictedSidCount,
  8576. IN PSID_AND_ATTRIBUTES SidsToRestrict OPTIONAL,
  8577. OUT PHANDLE NewTokenHandle
  8578. );
  8579. WINADVAPI
  8580. BOOL
  8581. WINAPI
  8582. IsTokenRestricted(
  8583. IN HANDLE TokenHandle
  8584. );
  8585. WINADVAPI
  8586. BOOL
  8587. WINAPI
  8588. IsTokenUntrusted(
  8589. IN HANDLE TokenHandle
  8590. );
  8591. BOOL
  8592. APIENTRY
  8593. CheckTokenMembership(
  8594. IN HANDLE TokenHandle OPTIONAL,
  8595. IN PSID SidToCheck,
  8596. OUT PBOOL IsMember
  8597. );
  8598. //
  8599. // Thread pool API's
  8600. //
  8601. #if (_WIN32_WINNT >= 0x0500)
  8602. typedef WAITORTIMERCALLBACKFUNC WAITORTIMERCALLBACK ;
  8603. WINBASEAPI
  8604. BOOL
  8605. WINAPI
  8606. RegisterWaitForSingleObject(
  8607. PHANDLE phNewWaitObject,
  8608. HANDLE hObject,
  8609. WAITORTIMERCALLBACK Callback,
  8610. PVOID Context,
  8611. ULONG dwMilliseconds,
  8612. ULONG dwFlags
  8613. );
  8614. WINBASEAPI
  8615. HANDLE
  8616. WINAPI
  8617. RegisterWaitForSingleObjectEx(
  8618. HANDLE hObject,
  8619. WAITORTIMERCALLBACK Callback,
  8620. PVOID Context,
  8621. ULONG dwMilliseconds,
  8622. ULONG dwFlags
  8623. );
  8624. WINBASEAPI
  8625. BOOL
  8626. WINAPI
  8627. UnregisterWait(
  8628. HANDLE WaitHandle
  8629. );
  8630. WINBASEAPI
  8631. BOOL
  8632. WINAPI
  8633. UnregisterWaitEx(
  8634. HANDLE WaitHandle,
  8635. HANDLE CompletionEvent
  8636. );
  8637. WINBASEAPI
  8638. BOOL
  8639. WINAPI
  8640. QueueUserWorkItem(
  8641. LPTHREAD_START_ROUTINE Function,
  8642. PVOID Context,
  8643. ULONG Flags
  8644. );
  8645. WINBASEAPI
  8646. BOOL
  8647. WINAPI
  8648. BindIoCompletionCallback (
  8649. HANDLE FileHandle,
  8650. LPOVERLAPPED_COMPLETION_ROUTINE Function,
  8651. ULONG Flags
  8652. );
  8653. WINBASEAPI
  8654. HANDLE
  8655. WINAPI
  8656. CreateTimerQueue(
  8657. VOID
  8658. );
  8659. WINBASEAPI
  8660. BOOL
  8661. WINAPI
  8662. CreateTimerQueueTimer(
  8663. PHANDLE phNewTimer,
  8664. HANDLE TimerQueue,
  8665. WAITORTIMERCALLBACK Callback,
  8666. PVOID Parameter,
  8667. DWORD DueTime,
  8668. DWORD Period,
  8669. ULONG Flags
  8670. ) ;
  8671. WINBASEAPI
  8672. BOOL
  8673. WINAPI
  8674. ChangeTimerQueueTimer(
  8675. HANDLE TimerQueue,
  8676. HANDLE Timer,
  8677. ULONG DueTime,
  8678. ULONG Period
  8679. );
  8680. WINBASEAPI
  8681. BOOL
  8682. WINAPI
  8683. DeleteTimerQueueTimer(
  8684. HANDLE TimerQueue,
  8685. HANDLE Timer,
  8686. HANDLE CompletionEvent
  8687. );
  8688. WINBASEAPI
  8689. BOOL
  8690. WINAPI
  8691. DeleteTimerQueueEx(
  8692. HANDLE TimerQueue,
  8693. HANDLE CompletionEvent
  8694. );
  8695. WINBASEAPI
  8696. HANDLE
  8697. WINAPI
  8698. SetTimerQueueTimer(
  8699. HANDLE TimerQueue,
  8700. WAITORTIMERCALLBACK Callback,
  8701. PVOID Parameter,
  8702. DWORD DueTime,
  8703. DWORD Period,
  8704. BOOL PreferIo
  8705. );
  8706. WINBASEAPI
  8707. BOOL
  8708. WINAPI
  8709. CancelTimerQueueTimer(
  8710. HANDLE TimerQueue,
  8711. HANDLE Timer
  8712. );
  8713. WINBASEAPI
  8714. BOOL
  8715. WINAPI
  8716. DeleteTimerQueue(
  8717. HANDLE TimerQueue
  8718. );
  8719. #endif // _WIN32_WINNT
  8720. #if(_WIN32_WINNT >= 0x0400)
  8721. //
  8722. // Plug-and-Play API's
  8723. //
  8724. #define HW_PROFILE_GUIDLEN 39 // 36-characters plus NULL terminator
  8725. #define MAX_PROFILE_LEN 80
  8726. #define DOCKINFO_UNDOCKED (0x1)
  8727. #define DOCKINFO_DOCKED (0x2)
  8728. #define DOCKINFO_USER_SUPPLIED (0x4)
  8729. #define DOCKINFO_USER_UNDOCKED (DOCKINFO_USER_SUPPLIED | DOCKINFO_UNDOCKED)
  8730. #define DOCKINFO_USER_DOCKED (DOCKINFO_USER_SUPPLIED | DOCKINFO_DOCKED)
  8731. typedef struct tagHW_PROFILE_INFOA {
  8732. DWORD dwDockInfo;
  8733. CHAR szHwProfileGuid[HW_PROFILE_GUIDLEN];
  8734. CHAR szHwProfileName[MAX_PROFILE_LEN];
  8735. } HW_PROFILE_INFOA, *LPHW_PROFILE_INFOA;
  8736. typedef struct tagHW_PROFILE_INFOW {
  8737. DWORD dwDockInfo;
  8738. WCHAR szHwProfileGuid[HW_PROFILE_GUIDLEN];
  8739. WCHAR szHwProfileName[MAX_PROFILE_LEN];
  8740. } HW_PROFILE_INFOW, *LPHW_PROFILE_INFOW;
  8741. #ifdef UNICODE
  8742. typedef HW_PROFILE_INFOW HW_PROFILE_INFO;
  8743. typedef LPHW_PROFILE_INFOW LPHW_PROFILE_INFO;
  8744. #else
  8745. typedef HW_PROFILE_INFOA HW_PROFILE_INFO;
  8746. typedef LPHW_PROFILE_INFOA LPHW_PROFILE_INFO;
  8747. #endif // UNICODE
  8748. WINADVAPI
  8749. BOOL
  8750. WINAPI
  8751. GetCurrentHwProfileA (
  8752. OUT LPHW_PROFILE_INFOA lpHwProfileInfo
  8753. );
  8754. WINADVAPI
  8755. BOOL
  8756. WINAPI
  8757. GetCurrentHwProfileW (
  8758. OUT LPHW_PROFILE_INFOW lpHwProfileInfo
  8759. );
  8760. #ifdef UNICODE
  8761. #define GetCurrentHwProfile GetCurrentHwProfileW
  8762. #else
  8763. #define GetCurrentHwProfile GetCurrentHwProfileA
  8764. #endif // !UNICODE
  8765. #endif /* _WIN32_WINNT >= 0x0400 */
  8766. //
  8767. // Performance counter API's
  8768. //
  8769. WINBASEAPI
  8770. BOOL
  8771. WINAPI
  8772. QueryPerformanceCounter(
  8773. OUT LARGE_INTEGER *lpPerformanceCount
  8774. );
  8775. WINBASEAPI
  8776. BOOL
  8777. WINAPI
  8778. QueryPerformanceFrequency(
  8779. OUT LARGE_INTEGER *lpFrequency
  8780. );
  8781. WINBASEAPI
  8782. BOOL
  8783. WINAPI
  8784. GetVersionExA(
  8785. IN OUT LPOSVERSIONINFOA lpVersionInformation
  8786. );
  8787. WINBASEAPI
  8788. BOOL
  8789. WINAPI
  8790. GetVersionExW(
  8791. IN OUT LPOSVERSIONINFOW lpVersionInformation
  8792. );
  8793. #ifdef UNICODE
  8794. #define GetVersionEx GetVersionExW
  8795. #else
  8796. #define GetVersionEx GetVersionExA
  8797. #endif // !UNICODE
  8798. WINBASEAPI
  8799. BOOL
  8800. WINAPI
  8801. VerifyVersionInfoA(
  8802. IN LPOSVERSIONINFOEXA lpVersionInformation,
  8803. IN DWORD dwTypeMask,
  8804. IN DWORDLONG dwlConditionMask
  8805. );
  8806. WINBASEAPI
  8807. BOOL
  8808. WINAPI
  8809. VerifyVersionInfoW(
  8810. IN LPOSVERSIONINFOEXW lpVersionInformation,
  8811. IN DWORD dwTypeMask,
  8812. IN DWORDLONG dwlConditionMask
  8813. );
  8814. #ifdef UNICODE
  8815. #define VerifyVersionInfo VerifyVersionInfoW
  8816. #else
  8817. #define VerifyVersionInfo VerifyVersionInfoA
  8818. #endif // !UNICODE
  8819. // DOS and OS/2 Compatible Error Code definitions returned by the Win32 Base
  8820. // API functions.
  8821. //
  8822. #include <winerror.h>
  8823. /* Abnormal termination codes */
  8824. #define TC_NORMAL 0
  8825. #define TC_HARDERR 1
  8826. #define TC_GP_TRAP 2
  8827. #define TC_SIGNAL 3
  8828. #if(WINVER >= 0x0400)
  8829. //
  8830. // Power Management APIs
  8831. //
  8832. #define AC_LINE_OFFLINE 0x00
  8833. #define AC_LINE_ONLINE 0x01
  8834. #define AC_LINE_BACKUP_POWER 0x02
  8835. #define AC_LINE_UNKNOWN 0xFF
  8836. #define BATTERY_FLAG_HIGH 0x01
  8837. #define BATTERY_FLAG_LOW 0x02
  8838. #define BATTERY_FLAG_CRITICAL 0x04
  8839. #define BATTERY_FLAG_CHARGING 0x08
  8840. #define BATTERY_FLAG_NO_BATTERY 0x80
  8841. #define BATTERY_FLAG_UNKNOWN 0xFF
  8842. #define BATTERY_PERCENTAGE_UNKNOWN 0xFF
  8843. #define BATTERY_LIFE_UNKNOWN 0xFFFFFFFF
  8844. typedef struct _SYSTEM_POWER_STATUS {
  8845. BYTE ACLineStatus;
  8846. BYTE BatteryFlag;
  8847. BYTE BatteryLifePercent;
  8848. BYTE Reserved1;
  8849. DWORD BatteryLifeTime;
  8850. DWORD BatteryFullLifeTime;
  8851. } SYSTEM_POWER_STATUS, *LPSYSTEM_POWER_STATUS;
  8852. BOOL
  8853. WINAPI
  8854. GetSystemPowerStatus(
  8855. OUT LPSYSTEM_POWER_STATUS lpSystemPowerStatus
  8856. );
  8857. BOOL
  8858. WINAPI
  8859. SetSystemPowerState(
  8860. IN BOOL fSuspend,
  8861. IN BOOL fForce
  8862. );
  8863. #endif /* WINVER >= 0x0400 */
  8864. #if (_WIN32_WINNT >= 0x0500)
  8865. //
  8866. // Very Large Memory API Subset
  8867. //
  8868. WINBASEAPI
  8869. BOOL
  8870. WINAPI
  8871. AllocateUserPhysicalPages(
  8872. IN HANDLE hProcess,
  8873. IN OUT PULONG_PTR NumberOfPages,
  8874. OUT PULONG_PTR PageArray
  8875. );
  8876. WINBASEAPI
  8877. BOOL
  8878. WINAPI
  8879. FreeUserPhysicalPages(
  8880. IN HANDLE hProcess,
  8881. IN OUT PULONG_PTR NumberOfPages,
  8882. IN PULONG_PTR PageArray
  8883. );
  8884. WINBASEAPI
  8885. BOOL
  8886. WINAPI
  8887. MapUserPhysicalPages(
  8888. IN PVOID VirtualAddress,
  8889. IN ULONG_PTR NumberOfPages,
  8890. IN PULONG_PTR PageArray OPTIONAL
  8891. );
  8892. WINBASEAPI
  8893. BOOL
  8894. WINAPI
  8895. MapUserPhysicalPagesScatter(
  8896. IN PVOID *VirtualAddresses,
  8897. IN ULONG_PTR NumberOfPages,
  8898. IN PULONG_PTR PageArray OPTIONAL
  8899. );
  8900. WINBASEAPI
  8901. HANDLE
  8902. WINAPI
  8903. CreateJobObjectA(
  8904. IN LPSECURITY_ATTRIBUTES lpJobAttributes,
  8905. IN LPCSTR lpName
  8906. );
  8907. WINBASEAPI
  8908. HANDLE
  8909. WINAPI
  8910. CreateJobObjectW(
  8911. IN LPSECURITY_ATTRIBUTES lpJobAttributes,
  8912. IN LPCWSTR lpName
  8913. );
  8914. #ifdef UNICODE
  8915. #define CreateJobObject CreateJobObjectW
  8916. #else
  8917. #define CreateJobObject CreateJobObjectA
  8918. #endif // !UNICODE
  8919. WINBASEAPI
  8920. HANDLE
  8921. WINAPI
  8922. OpenJobObjectA(
  8923. IN DWORD dwDesiredAccess,
  8924. IN BOOL bInheritHandle,
  8925. IN LPCSTR lpName
  8926. );
  8927. WINBASEAPI
  8928. HANDLE
  8929. WINAPI
  8930. OpenJobObjectW(
  8931. IN DWORD dwDesiredAccess,
  8932. IN BOOL bInheritHandle,
  8933. IN LPCWSTR lpName
  8934. );
  8935. #ifdef UNICODE
  8936. #define OpenJobObject OpenJobObjectW
  8937. #else
  8938. #define OpenJobObject OpenJobObjectA
  8939. #endif // !UNICODE
  8940. WINBASEAPI
  8941. BOOL
  8942. WINAPI
  8943. AssignProcessToJobObject(
  8944. IN HANDLE hJob,
  8945. IN HANDLE hProcess
  8946. );
  8947. WINBASEAPI
  8948. BOOL
  8949. WINAPI
  8950. TerminateJobObject(
  8951. IN HANDLE hJob,
  8952. IN UINT uExitCode
  8953. );
  8954. WINBASEAPI
  8955. BOOL
  8956. WINAPI
  8957. QueryInformationJobObject(
  8958. IN HANDLE hJob,
  8959. IN JOBOBJECTINFOCLASS JobObjectInformationClass,
  8960. OUT LPVOID lpJobObjectInformation,
  8961. IN DWORD cbJobObjectInformationLength,
  8962. OUT LPDWORD lpReturnLength
  8963. );
  8964. WINBASEAPI
  8965. BOOL
  8966. WINAPI
  8967. SetInformationJobObject(
  8968. IN HANDLE hJob,
  8969. IN JOBOBJECTINFOCLASS JobObjectInformationClass,
  8970. IN LPVOID lpJobObjectInformation,
  8971. IN DWORD cbJobObjectInformationLength
  8972. );
  8973. WINBASEAPI
  8974. BOOL
  8975. WINAPI
  8976. IsProcessInJob (
  8977. IN HANDLE ProcessHandle,
  8978. IN HANDLE JobHandle,
  8979. OUT PBOOL Result
  8980. );
  8981. WINBASEAPI
  8982. BOOL
  8983. WINAPI
  8984. CreateJobSet (
  8985. IN ULONG NumJob,
  8986. IN PJOB_SET_ARRAY UserJobSet,
  8987. IN ULONG Flags);
  8988. WINBASEAPI
  8989. PVOID
  8990. WINAPI
  8991. AddVectoredExceptionHandler(
  8992. IN ULONG FirstHandler,
  8993. IN PVECTORED_EXCEPTION_HANDLER VectoredHandler
  8994. );
  8995. WINBASEAPI
  8996. ULONG
  8997. WINAPI
  8998. RemoveVectoredExceptionHandler(
  8999. IN PVOID VectoredHandlerHandle
  9000. );
  9001. //
  9002. // New Volume Mount Point API.
  9003. //
  9004. WINBASEAPI
  9005. HANDLE
  9006. WINAPI
  9007. FindFirstVolumeA(
  9008. LPSTR lpszVolumeName,
  9009. DWORD cchBufferLength
  9010. );
  9011. WINBASEAPI
  9012. HANDLE
  9013. WINAPI
  9014. FindFirstVolumeW(
  9015. LPWSTR lpszVolumeName,
  9016. DWORD cchBufferLength
  9017. );
  9018. #ifdef UNICODE
  9019. #define FindFirstVolume FindFirstVolumeW
  9020. #else
  9021. #define FindFirstVolume FindFirstVolumeA
  9022. #endif // !UNICODE
  9023. WINBASEAPI
  9024. BOOL
  9025. WINAPI
  9026. FindNextVolumeA(
  9027. HANDLE hFindVolume,
  9028. LPSTR lpszVolumeName,
  9029. DWORD cchBufferLength
  9030. );
  9031. WINBASEAPI
  9032. BOOL
  9033. WINAPI
  9034. FindNextVolumeW(
  9035. HANDLE hFindVolume,
  9036. LPWSTR lpszVolumeName,
  9037. DWORD cchBufferLength
  9038. );
  9039. #ifdef UNICODE
  9040. #define FindNextVolume FindNextVolumeW
  9041. #else
  9042. #define FindNextVolume FindNextVolumeA
  9043. #endif // !UNICODE
  9044. WINBASEAPI
  9045. BOOL
  9046. WINAPI
  9047. FindVolumeClose(
  9048. HANDLE hFindVolume
  9049. );
  9050. WINBASEAPI
  9051. HANDLE
  9052. WINAPI
  9053. FindFirstVolumeMountPointA(
  9054. LPCSTR lpszRootPathName,
  9055. LPSTR lpszVolumeMountPoint,
  9056. DWORD cchBufferLength
  9057. );
  9058. WINBASEAPI
  9059. HANDLE
  9060. WINAPI
  9061. FindFirstVolumeMountPointW(
  9062. LPCWSTR lpszRootPathName,
  9063. LPWSTR lpszVolumeMountPoint,
  9064. DWORD cchBufferLength
  9065. );
  9066. #ifdef UNICODE
  9067. #define FindFirstVolumeMountPoint FindFirstVolumeMountPointW
  9068. #else
  9069. #define FindFirstVolumeMountPoint FindFirstVolumeMountPointA
  9070. #endif // !UNICODE
  9071. WINBASEAPI
  9072. BOOL
  9073. WINAPI
  9074. FindNextVolumeMountPointA(
  9075. HANDLE hFindVolumeMountPoint,
  9076. LPSTR lpszVolumeMountPoint,
  9077. DWORD cchBufferLength
  9078. );
  9079. WINBASEAPI
  9080. BOOL
  9081. WINAPI
  9082. FindNextVolumeMountPointW(
  9083. HANDLE hFindVolumeMountPoint,
  9084. LPWSTR lpszVolumeMountPoint,
  9085. DWORD cchBufferLength
  9086. );
  9087. #ifdef UNICODE
  9088. #define FindNextVolumeMountPoint FindNextVolumeMountPointW
  9089. #else
  9090. #define FindNextVolumeMountPoint FindNextVolumeMountPointA
  9091. #endif // !UNICODE
  9092. WINBASEAPI
  9093. BOOL
  9094. WINAPI
  9095. FindVolumeMountPointClose(
  9096. HANDLE hFindVolumeMountPoint
  9097. );
  9098. WINBASEAPI
  9099. BOOL
  9100. WINAPI
  9101. SetVolumeMountPointA(
  9102. LPCSTR lpszVolumeMountPoint,
  9103. LPCSTR lpszVolumeName
  9104. );
  9105. WINBASEAPI
  9106. BOOL
  9107. WINAPI
  9108. SetVolumeMountPointW(
  9109. LPCWSTR lpszVolumeMountPoint,
  9110. LPCWSTR lpszVolumeName
  9111. );
  9112. #ifdef UNICODE
  9113. #define SetVolumeMountPoint SetVolumeMountPointW
  9114. #else
  9115. #define SetVolumeMountPoint SetVolumeMountPointA
  9116. #endif // !UNICODE
  9117. WINBASEAPI
  9118. BOOL
  9119. WINAPI
  9120. DeleteVolumeMountPointA(
  9121. LPCSTR lpszVolumeMountPoint
  9122. );
  9123. WINBASEAPI
  9124. BOOL
  9125. WINAPI
  9126. DeleteVolumeMountPointW(
  9127. LPCWSTR lpszVolumeMountPoint
  9128. );
  9129. #ifdef UNICODE
  9130. #define DeleteVolumeMountPoint DeleteVolumeMountPointW
  9131. #else
  9132. #define DeleteVolumeMountPoint DeleteVolumeMountPointA
  9133. #endif // !UNICODE
  9134. WINBASEAPI
  9135. BOOL
  9136. WINAPI
  9137. GetVolumeNameForVolumeMountPointA(
  9138. LPCSTR lpszVolumeMountPoint,
  9139. LPSTR lpszVolumeName,
  9140. DWORD cchBufferLength
  9141. );
  9142. WINBASEAPI
  9143. BOOL
  9144. WINAPI
  9145. GetVolumeNameForVolumeMountPointW(
  9146. LPCWSTR lpszVolumeMountPoint,
  9147. LPWSTR lpszVolumeName,
  9148. DWORD cchBufferLength
  9149. );
  9150. #ifdef UNICODE
  9151. #define GetVolumeNameForVolumeMountPoint GetVolumeNameForVolumeMountPointW
  9152. #else
  9153. #define GetVolumeNameForVolumeMountPoint GetVolumeNameForVolumeMountPointA
  9154. #endif // !UNICODE
  9155. WINBASEAPI
  9156. BOOL
  9157. WINAPI
  9158. GetVolumePathNameA(
  9159. LPCSTR lpszFileName,
  9160. LPSTR lpszVolumePathName,
  9161. DWORD cchBufferLength
  9162. );
  9163. WINBASEAPI
  9164. BOOL
  9165. WINAPI
  9166. GetVolumePathNameW(
  9167. LPCWSTR lpszFileName,
  9168. LPWSTR lpszVolumePathName,
  9169. DWORD cchBufferLength
  9170. );
  9171. #ifdef UNICODE
  9172. #define GetVolumePathName GetVolumePathNameW
  9173. #else
  9174. #define GetVolumePathName GetVolumePathNameA
  9175. #endif // !UNICODE
  9176. WINBASEAPI
  9177. BOOL
  9178. WINAPI
  9179. GetVolumePathNamesForVolumeNameA(
  9180. LPCSTR lpszVolumeName,
  9181. LPSTR lpszVolumePathNames,
  9182. DWORD cchBufferLength,
  9183. PDWORD lpcchReturnLength
  9184. );
  9185. WINBASEAPI
  9186. BOOL
  9187. WINAPI
  9188. GetVolumePathNamesForVolumeNameW(
  9189. LPCWSTR lpszVolumeName,
  9190. LPWSTR lpszVolumePathNames,
  9191. DWORD cchBufferLength,
  9192. PDWORD lpcchReturnLength
  9193. );
  9194. #ifdef UNICODE
  9195. #define GetVolumePathNamesForVolumeName GetVolumePathNamesForVolumeNameW
  9196. #else
  9197. #define GetVolumePathNamesForVolumeName GetVolumePathNamesForVolumeNameA
  9198. #endif // !UNICODE
  9199. #endif
  9200. #if (_WIN32_WINNT >= 0x0500) || (_WIN32_FUSION >= 0x0100) || ISOLATION_AWARE_ENABLED
  9201. #define ACTCTX_FLAG_PROCESSOR_ARCHITECTURE_VALID (0x00000001)
  9202. #define ACTCTX_FLAG_LANGID_VALID (0x00000002)
  9203. #define ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID (0x00000004)
  9204. #define ACTCTX_FLAG_RESOURCE_NAME_VALID (0x00000008)
  9205. #define ACTCTX_FLAG_SET_PROCESS_DEFAULT (0x00000010)
  9206. #define ACTCTX_FLAG_APPLICATION_NAME_VALID (0x00000020)
  9207. #define ACTCTX_FLAG_SOURCE_IS_ASSEMBLYREF (0x00000040)
  9208. #define ACTCTX_FLAG_HMODULE_VALID (0x00000080)
  9209. typedef struct tagACTCTXA {
  9210. ULONG cbSize;
  9211. DWORD dwFlags;
  9212. LPCSTR lpSource;
  9213. USHORT wProcessorArchitecture;
  9214. LANGID wLangId;
  9215. LPCSTR lpAssemblyDirectory;
  9216. LPCSTR lpResourceName;
  9217. LPCSTR lpApplicationName;
  9218. HMODULE hModule;
  9219. } ACTCTXA, *PACTCTXA;
  9220. typedef struct tagACTCTXW {
  9221. ULONG cbSize;
  9222. DWORD dwFlags;
  9223. LPCWSTR lpSource;
  9224. USHORT wProcessorArchitecture;
  9225. LANGID wLangId;
  9226. LPCWSTR lpAssemblyDirectory;
  9227. LPCWSTR lpResourceName;
  9228. LPCWSTR lpApplicationName;
  9229. HMODULE hModule;
  9230. } ACTCTXW, *PACTCTXW;
  9231. #ifdef UNICODE
  9232. typedef ACTCTXW ACTCTX;
  9233. typedef PACTCTXW PACTCTX;
  9234. #else
  9235. typedef ACTCTXA ACTCTX;
  9236. typedef PACTCTXA PACTCTX;
  9237. #endif // UNICODE
  9238. typedef const ACTCTXA *PCACTCTXA;
  9239. typedef const ACTCTXW *PCACTCTXW;
  9240. #ifdef UNICODE
  9241. typedef ACTCTXW ACTCTX;
  9242. typedef PCACTCTXW PCACTCTX;
  9243. #else
  9244. typedef ACTCTXA ACTCTX;
  9245. typedef PCACTCTXA PCACTCTX;
  9246. #endif // UNICODE
  9247. #endif
  9248. #if (_WIN32_WINNT >= 0x0500) || (_WIN32_FUSION >= 0x0100)
  9249. WINBASEAPI
  9250. HANDLE
  9251. WINAPI
  9252. CreateActCtxA(
  9253. PCACTCTXA pActCtx
  9254. );
  9255. WINBASEAPI
  9256. HANDLE
  9257. WINAPI
  9258. CreateActCtxW(
  9259. PCACTCTXW pActCtx
  9260. );
  9261. #ifdef UNICODE
  9262. #define CreateActCtx CreateActCtxW
  9263. #else
  9264. #define CreateActCtx CreateActCtxA
  9265. #endif // !UNICODE
  9266. WINBASEAPI
  9267. VOID
  9268. WINAPI
  9269. AddRefActCtx(
  9270. HANDLE hActCtx
  9271. );
  9272. WINBASEAPI
  9273. VOID
  9274. WINAPI
  9275. ReleaseActCtx(
  9276. HANDLE hActCtx
  9277. );
  9278. WINBASEAPI
  9279. BOOL
  9280. WINAPI
  9281. ZombifyActCtx(
  9282. HANDLE hActCtx
  9283. );
  9284. WINBASEAPI
  9285. BOOL
  9286. WINAPI
  9287. ActivateActCtx(
  9288. HANDLE hActCtx,
  9289. ULONG_PTR *lpCookie
  9290. );
  9291. #define DEACTIVATE_ACTCTX_FLAG_FORCE_EARLY_DEACTIVATION (0x00000001)
  9292. WINBASEAPI
  9293. BOOL
  9294. WINAPI
  9295. DeactivateActCtx(
  9296. DWORD dwFlags,
  9297. ULONG_PTR ulCookie
  9298. );
  9299. WINBASEAPI
  9300. BOOL
  9301. WINAPI
  9302. GetCurrentActCtx(
  9303. HANDLE *lphActCtx);
  9304. #endif
  9305. #if (_WIN32_WINNT >= 0x0500) || (_WIN32_FUSION >= 0x0100) || ISOLATION_AWARE_ENABLED
  9306. typedef struct tagACTCTX_SECTION_KEYED_DATA_2600 {
  9307. ULONG cbSize;
  9308. ULONG ulDataFormatVersion;
  9309. PVOID lpData;
  9310. ULONG ulLength;
  9311. PVOID lpSectionGlobalData;
  9312. ULONG ulSectionGlobalDataLength;
  9313. PVOID lpSectionBase;
  9314. ULONG ulSectionTotalLength;
  9315. HANDLE hActCtx;
  9316. ULONG ulAssemblyRosterIndex;
  9317. } ACTCTX_SECTION_KEYED_DATA_2600, *PACTCTX_SECTION_KEYED_DATA_2600;
  9318. typedef const ACTCTX_SECTION_KEYED_DATA_2600 * PCACTCTX_SECTION_KEYED_DATA_2600;
  9319. typedef struct tagACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA {
  9320. PVOID lpInformation;
  9321. PVOID lpSectionBase;
  9322. ULONG ulSectionLength;
  9323. PVOID lpSectionGlobalDataBase;
  9324. ULONG ulSectionGlobalDataLength;
  9325. } ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, *PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA;
  9326. typedef const ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA *PCACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA;
  9327. typedef struct tagACTCTX_SECTION_KEYED_DATA {
  9328. ULONG cbSize;
  9329. ULONG ulDataFormatVersion;
  9330. PVOID lpData;
  9331. ULONG ulLength;
  9332. PVOID lpSectionGlobalData;
  9333. ULONG ulSectionGlobalDataLength;
  9334. PVOID lpSectionBase;
  9335. ULONG ulSectionTotalLength;
  9336. HANDLE hActCtx;
  9337. ULONG ulAssemblyRosterIndex;
  9338. // 2600 stops here
  9339. ULONG ulFlags;
  9340. ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA AssemblyMetadata;
  9341. } ACTCTX_SECTION_KEYED_DATA, *PACTCTX_SECTION_KEYED_DATA;
  9342. typedef const ACTCTX_SECTION_KEYED_DATA * PCACTCTX_SECTION_KEYED_DATA;
  9343. #define FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX (0x00000001)
  9344. #define FIND_ACTCTX_SECTION_KEY_RETURN_FLAGS (0x00000002)
  9345. #define FIND_ACTCTX_SECTION_KEY_RETURN_ASSEMBLY_METADATA (0x00000004)
  9346. #endif
  9347. #if (_WIN32_WINNT >= 0x0500) || (_WIN32_FUSION >= 0x0100)
  9348. WINBASEAPI
  9349. BOOL
  9350. WINAPI
  9351. FindActCtxSectionStringA(
  9352. DWORD dwFlags,
  9353. const GUID *lpExtensionGuid,
  9354. ULONG ulSectionId,
  9355. LPCSTR lpStringToFind,
  9356. PACTCTX_SECTION_KEYED_DATA ReturnedData
  9357. );
  9358. WINBASEAPI
  9359. BOOL
  9360. WINAPI
  9361. FindActCtxSectionStringW(
  9362. DWORD dwFlags,
  9363. const GUID *lpExtensionGuid,
  9364. ULONG ulSectionId,
  9365. LPCWSTR lpStringToFind,
  9366. PACTCTX_SECTION_KEYED_DATA ReturnedData
  9367. );
  9368. #ifdef UNICODE
  9369. #define FindActCtxSectionString FindActCtxSectionStringW
  9370. #else
  9371. #define FindActCtxSectionString FindActCtxSectionStringA
  9372. #endif // !UNICODE
  9373. WINBASEAPI
  9374. BOOL
  9375. WINAPI
  9376. FindActCtxSectionGuid(
  9377. DWORD dwFlags,
  9378. const GUID *lpExtensionGuid,
  9379. ULONG ulSectionId,
  9380. const GUID *lpGuidToFind,
  9381. PACTCTX_SECTION_KEYED_DATA ReturnedData
  9382. );
  9383. #endif
  9384. #if (_WIN32_WINNT >= 0x0500) || (_WIN32_FUSION >= 0x0100) || ISOLATION_AWARE_ENABLED
  9385. #if !defined(RC_INVOKED) /* RC complains about long symbols in #ifs */
  9386. #if !defined(ACTIVATION_CONTEXT_BASIC_INFORMATION_DEFINED)
  9387. typedef struct _ACTIVATION_CONTEXT_BASIC_INFORMATION {
  9388. HANDLE hActCtx;
  9389. DWORD dwFlags;
  9390. } ACTIVATION_CONTEXT_BASIC_INFORMATION, *PACTIVATION_CONTEXT_BASIC_INFORMATION;
  9391. typedef const struct _ACTIVATION_CONTEXT_BASIC_INFORMATION *PCACTIVATION_CONTEXT_BASIC_INFORMATION;
  9392. #define ACTIVATION_CONTEXT_BASIC_INFORMATION_DEFINED 1
  9393. #endif // !defined(ACTIVATION_CONTEXT_BASIC_INFORMATION_DEFINED)
  9394. #endif
  9395. #define QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX (0x00000004)
  9396. #define QUERY_ACTCTX_FLAG_ACTCTX_IS_HMODULE (0x00000008)
  9397. #define QUERY_ACTCTX_FLAG_ACTCTX_IS_ADDRESS (0x00000010)
  9398. #define QUERY_ACTCTX_FLAG_NO_ADDREF (0x80000000)
  9399. #endif
  9400. #if (_WIN32_WINNT >= 0x0500) || (_WIN32_FUSION >= 0x0100)
  9401. //
  9402. // switch (ulInfoClass)
  9403. //
  9404. // case ActivationContextBasicInformation:
  9405. // pvSubInstance == NULL
  9406. // pvBuffer is of type PACTIVATION_CONTEXT_BASIC_INFORMATION
  9407. //
  9408. // case ActivationContextDetailedInformation:
  9409. // pvSubInstance == NULL
  9410. // pvBuffer is of type PACTIVATION_CONTEXT_DETAILED_INFORMATION
  9411. //
  9412. // case AssemblyDetailedInformationInActivationContext:
  9413. // pvSubInstance is of type PULONG
  9414. // *pvSubInstance < ACTIVATION_CONTEXT_DETAILED_INFORMATION::ulAssemblyCount
  9415. // pvBuffer is of type PACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION
  9416. //
  9417. // case FileInformationInAssemblyOfAssemblyInActivationContext:
  9418. // pvSubInstance is of type PACTIVATION_CONTEXT_QUERY_INDEX
  9419. // pvSubInstance->ulAssemblyIndex < ACTIVATION_CONTEXT_DETAILED_INFORMATION::ulAssemblyCount
  9420. // pvSubInstance->ulFileIndexInAssembly < ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION::ulFileCount
  9421. // pvBuffer is of type PASSEMBLY_FILE_DETAILED_INFORMATION
  9422. //
  9423. // String are placed after the structs.
  9424. //
  9425. WINBASEAPI
  9426. BOOL
  9427. WINAPI
  9428. QueryActCtxW(
  9429. IN DWORD dwFlags,
  9430. IN HANDLE hActCtx,
  9431. IN PVOID pvSubInstance,
  9432. IN ULONG ulInfoClass,
  9433. OUT PVOID pvBuffer,
  9434. IN SIZE_T cbBuffer OPTIONAL,
  9435. OUT SIZE_T *pcbWrittenOrRequired OPTIONAL
  9436. );
  9437. typedef BOOL (WINAPI * PQUERYACTCTXW_FUNC)(
  9438. IN DWORD dwFlags,
  9439. IN HANDLE hActCtx,
  9440. IN PVOID pvSubInstance,
  9441. IN ULONG ulInfoClass,
  9442. OUT PVOID pvBuffer,
  9443. IN SIZE_T cbBuffer OPTIONAL,
  9444. OUT SIZE_T *pcbWrittenOrRequired OPTIONAL
  9445. );
  9446. #endif // (_WIN32_WINNT > 0x0500) || (_WIN32_FUSION >= 0x0100)
  9447. WINBASEAPI
  9448. BOOL
  9449. WINAPI
  9450. ProcessIdToSessionId(
  9451. IN DWORD dwProcessId,
  9452. OUT DWORD *pSessionId
  9453. );
  9454. #if _WIN32_WINNT >= 0x0501
  9455. WINBASEAPI
  9456. DWORD
  9457. WINAPI
  9458. WTSGetActiveConsoleSessionId();
  9459. WINBASEAPI
  9460. BOOL
  9461. WINAPI
  9462. IsWow64Process(
  9463. HANDLE hProcess,
  9464. PBOOL Wow64Process
  9465. );
  9466. #endif // (_WIN32_WINNT >= 0x0501)
  9467. WINBASEAPI
  9468. BOOL
  9469. WINAPI
  9470. GetLogicalProcessorInformation(
  9471. PSYSTEM_LOGICAL_PROCESSOR_INFORMATION Buffer,
  9472. PDWORD ReturnedLength
  9473. );
  9474. //
  9475. // NUMA Information routines.
  9476. //
  9477. WINBASEAPI
  9478. BOOL
  9479. WINAPI
  9480. GetNumaHighestNodeNumber(
  9481. PULONG HighestNodeNumber
  9482. );
  9483. WINBASEAPI
  9484. BOOL
  9485. WINAPI
  9486. GetNumaProcessorNode(
  9487. UCHAR Processor,
  9488. PUCHAR NodeNumber
  9489. );
  9490. WINBASEAPI
  9491. BOOL
  9492. WINAPI
  9493. GetNumaNodeProcessorMask(
  9494. UCHAR Node,
  9495. PULONGLONG ProcessorMask
  9496. );
  9497. WINBASEAPI
  9498. BOOL
  9499. WINAPI
  9500. GetNumaAvailableMemoryNode(
  9501. UCHAR Node,
  9502. PULONGLONG AvailableBytes
  9503. );
  9504. #if !defined(RC_INVOKED) /* RC complains about long symbols in #ifs */
  9505. #if defined(ISOLATION_AWARE_ENABLED) && (ISOLATION_AWARE_ENABLED != 0)
  9506. #include "winbase.inl"
  9507. #endif /* ISOLATION_AWARE_ENABLED */
  9508. #endif /* RC */
  9509. #ifdef __cplusplus
  9510. }
  9511. #endif
  9512. #endif // _WINBASE_