Source code of Windows XP (NT5)
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.

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