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.

8362 lines
158 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. /*#!perl MapHeaderToDll("winbase.h", "kernel32.dll"); */
  11. ;begin_internal
  12. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  13. Copyright (c) Microsoft Corporation. All rights reserved.
  14. Module Name:
  15. winbasep.h
  16. Abstract:
  17. Private
  18. Procedure declarations, constant definitions and macros for the Base
  19. component.
  20. --*/
  21. #ifndef _WINBASEP_
  22. #define _WINBASEP_
  23. ;end_internal
  24. ;begin_userk_only
  25. /************************************************************************
  26. * *
  27. * wbasek.h -- This header is included by ntuser\kernel\userk.h *
  28. * *
  29. * Copyright (c) Microsoft Corp. All rights reserved. *
  30. * *
  31. ************************************************************************/
  32. #ifndef _WBASEK_
  33. #define _WBASEK_
  34. ;end_userk_only
  35. #if _MSC_VER > 1000
  36. #pragma once
  37. #endif
  38. #ifdef _MAC
  39. #include <macwin32.h>
  40. #endif //_MAC
  41. //
  42. // Define API decoration for direct importing of DLL references.
  43. //
  44. #if !defined(_ADVAPI32_)
  45. #define WINADVAPI DECLSPEC_IMPORT
  46. #else
  47. #define WINADVAPI
  48. #endif
  49. #if !defined(_KERNEL32_)
  50. #define WINBASEAPI DECLSPEC_IMPORT ; userk
  51. #else
  52. #define WINBASEAPI
  53. #endif
  54. #if !defined(_ZAWPROXY_)
  55. #define ZAWPROXYAPI DECLSPEC_IMPORT
  56. #else
  57. #define ZAWPROXYAPI
  58. #endif
  59. ;begin_both
  60. #ifdef __cplusplus
  61. extern "C" {
  62. #endif
  63. ;end_both
  64. /*
  65. * Compatibility macros
  66. */
  67. #define DefineHandleTable(w) ((w),TRUE)
  68. #define LimitEmsPages(dw)
  69. #define SetSwapAreaSize(w) (w)
  70. #define LockSegment(w) GlobalFix((HANDLE)(w))
  71. #define UnlockSegment(w) GlobalUnfix((HANDLE)(w))
  72. #define GetCurrentTime() GetTickCount()
  73. #define Yield()
  74. #define INVALID_HANDLE_VALUE ((HANDLE)(LONG_PTR)-1)
  75. #define INVALID_FILE_SIZE ((DWORD)0xFFFFFFFF)
  76. #define INVALID_SET_FILE_POINTER ((DWORD)-1)
  77. #define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
  78. #define FILE_BEGIN 0
  79. #define FILE_CURRENT 1
  80. #define FILE_END 2
  81. #define TIME_ZONE_ID_INVALID ((DWORD)0xFFFFFFFF)
  82. #define WAIT_FAILED ((DWORD)0xFFFFFFFF) ; userk
  83. #define WAIT_OBJECT_0 ((STATUS_WAIT_0 ) + 0 ) ; userk
  84. #define WAIT_ABANDONED ((STATUS_ABANDONED_WAIT_0 ) + 0 ) ; userk
  85. #define WAIT_ABANDONED_0 ((STATUS_ABANDONED_WAIT_0 ) + 0 ) ; userk
  86. #define WAIT_IO_COMPLETION STATUS_USER_APC ; userk
  87. #define STILL_ACTIVE STATUS_PENDING
  88. #define EXCEPTION_ACCESS_VIOLATION STATUS_ACCESS_VIOLATION
  89. #define EXCEPTION_DATATYPE_MISALIGNMENT STATUS_DATATYPE_MISALIGNMENT
  90. #define EXCEPTION_BREAKPOINT STATUS_BREAKPOINT
  91. #define EXCEPTION_SINGLE_STEP STATUS_SINGLE_STEP
  92. #define EXCEPTION_ARRAY_BOUNDS_EXCEEDED STATUS_ARRAY_BOUNDS_EXCEEDED
  93. #define EXCEPTION_FLT_DENORMAL_OPERAND STATUS_FLOAT_DENORMAL_OPERAND
  94. #define EXCEPTION_FLT_DIVIDE_BY_ZERO STATUS_FLOAT_DIVIDE_BY_ZERO
  95. #define EXCEPTION_FLT_INEXACT_RESULT STATUS_FLOAT_INEXACT_RESULT
  96. #define EXCEPTION_FLT_INVALID_OPERATION STATUS_FLOAT_INVALID_OPERATION
  97. #define EXCEPTION_FLT_OVERFLOW STATUS_FLOAT_OVERFLOW
  98. #define EXCEPTION_FLT_STACK_CHECK STATUS_FLOAT_STACK_CHECK
  99. #define EXCEPTION_FLT_UNDERFLOW STATUS_FLOAT_UNDERFLOW
  100. #define EXCEPTION_INT_DIVIDE_BY_ZERO STATUS_INTEGER_DIVIDE_BY_ZERO
  101. #define EXCEPTION_INT_OVERFLOW STATUS_INTEGER_OVERFLOW
  102. #define EXCEPTION_PRIV_INSTRUCTION STATUS_PRIVILEGED_INSTRUCTION
  103. #define EXCEPTION_IN_PAGE_ERROR STATUS_IN_PAGE_ERROR
  104. #define EXCEPTION_ILLEGAL_INSTRUCTION STATUS_ILLEGAL_INSTRUCTION
  105. #define EXCEPTION_NONCONTINUABLE_EXCEPTION STATUS_NONCONTINUABLE_EXCEPTION
  106. #define EXCEPTION_STACK_OVERFLOW STATUS_STACK_OVERFLOW
  107. #define EXCEPTION_INVALID_DISPOSITION STATUS_INVALID_DISPOSITION
  108. #define EXCEPTION_GUARD_PAGE STATUS_GUARD_PAGE_VIOLATION
  109. #define EXCEPTION_INVALID_HANDLE STATUS_INVALID_HANDLE
  110. #define CONTROL_C_EXIT STATUS_CONTROL_C_EXIT
  111. #define MoveMemory RtlMoveMemory
  112. #define CopyMemory RtlCopyMemory
  113. #define FillMemory RtlFillMemory
  114. #define ZeroMemory RtlZeroMemory
  115. #define SecureZeroMemory RtlSecureZeroMemory
  116. //
  117. // File creation flags must start at the high end since they
  118. // are combined with the attributes
  119. //
  120. #define FILE_FLAG_WRITE_THROUGH 0x80000000
  121. #define FILE_FLAG_OVERLAPPED 0x40000000
  122. #define FILE_FLAG_NO_BUFFERING 0x20000000
  123. #define FILE_FLAG_RANDOM_ACCESS 0x10000000
  124. #define FILE_FLAG_SEQUENTIAL_SCAN 0x08000000
  125. #define FILE_FLAG_DELETE_ON_CLOSE 0x04000000
  126. #define FILE_FLAG_BACKUP_SEMANTICS 0x02000000
  127. #define FILE_FLAG_POSIX_SEMANTICS 0x01000000
  128. #define FILE_FLAG_GLOBAL_HANDLE 0x00800000 ;internal
  129. #define FILE_FLAG_MM_CACHED_FILE_HANDLE 0x00400000 ;internal
  130. #define FILE_FLAG_OPEN_REPARSE_POINT 0x00200000
  131. #define FILE_FLAG_OPEN_NO_RECALL 0x00100000
  132. #define FILE_FLAG_FIRST_PIPE_INSTANCE 0x00080000
  133. #define CREATE_NEW 1
  134. #define CREATE_ALWAYS 2
  135. #define OPEN_EXISTING 3
  136. #define OPEN_ALWAYS 4
  137. #define TRUNCATE_EXISTING 5
  138. ;begin_sur
  139. //
  140. // Define possible return codes from the CopyFileEx callback routine
  141. //
  142. #define PROGRESS_CONTINUE 0
  143. #define PROGRESS_CANCEL 1
  144. #define PROGRESS_STOP 2
  145. #define PROGRESS_QUIET 3
  146. //
  147. // Define CopyFileEx callback routine state change values
  148. //
  149. #define CALLBACK_CHUNK_FINISHED 0x00000000
  150. #define CALLBACK_STREAM_SWITCH 0x00000001
  151. //
  152. // Define CopyFileEx option flags
  153. //
  154. #define COPY_FILE_FAIL_IF_EXISTS 0x00000001
  155. #define COPY_FILE_RESTARTABLE 0x00000002
  156. #define COPY_FILE_OPEN_SOURCE_FOR_WRITE 0x00000004
  157. #define COPY_FILE_ALLOW_DECRYPTED_DESTINATION 0x00000008
  158. ;end_sur
  159. #if (_WIN32_WINNT >= 0x0500)
  160. //
  161. // Define ReplaceFile option flags
  162. //
  163. #define REPLACEFILE_WRITE_THROUGH 0x00000001
  164. #define REPLACEFILE_IGNORE_MERGE_ERRORS 0x00000002
  165. #endif // #if (_WIN32_WINNT >= 0x0500)
  166. //
  167. // Define the NamedPipe definitions
  168. //
  169. //
  170. // Define the dwOpenMode values for CreateNamedPipe
  171. //
  172. #define PIPE_ACCESS_INBOUND 0x00000001
  173. #define PIPE_ACCESS_OUTBOUND 0x00000002
  174. #define PIPE_ACCESS_DUPLEX 0x00000003
  175. //
  176. // Define the Named Pipe End flags for GetNamedPipeInfo
  177. //
  178. #define PIPE_CLIENT_END 0x00000000
  179. #define PIPE_SERVER_END 0x00000001
  180. //
  181. // Define the dwPipeMode values for CreateNamedPipe
  182. //
  183. #define PIPE_WAIT 0x00000000
  184. #define PIPE_NOWAIT 0x00000001
  185. #define PIPE_READMODE_BYTE 0x00000000
  186. #define PIPE_READMODE_MESSAGE 0x00000002
  187. #define PIPE_TYPE_BYTE 0x00000000
  188. #define PIPE_TYPE_MESSAGE 0x00000004
  189. //
  190. // Define the well known values for CreateNamedPipe nMaxInstances
  191. //
  192. #define PIPE_UNLIMITED_INSTANCES 255
  193. //
  194. // Define the Security Quality of Service bits to be passed
  195. // into CreateFile
  196. //
  197. #define SECURITY_ANONYMOUS ( SecurityAnonymous << 16 )
  198. #define SECURITY_IDENTIFICATION ( SecurityIdentification << 16 )
  199. #define SECURITY_IMPERSONATION ( SecurityImpersonation << 16 )
  200. #define SECURITY_DELEGATION ( SecurityDelegation << 16 )
  201. #define SECURITY_CONTEXT_TRACKING 0x00040000
  202. #define SECURITY_EFFECTIVE_ONLY 0x00080000
  203. #define SECURITY_SQOS_PRESENT 0x00100000
  204. #define SECURITY_VALID_SQOS_FLAGS 0x001F0000
  205. //
  206. // File structures
  207. //
  208. typedef struct _OVERLAPPED {
  209. ULONG_PTR Internal;
  210. ULONG_PTR InternalHigh;
  211. union {
  212. struct {
  213. DWORD Offset;
  214. DWORD OffsetHigh;
  215. };
  216. PVOID Pointer;
  217. };
  218. HANDLE hEvent;
  219. } OVERLAPPED, *LPOVERLAPPED;
  220. ;begin_userk
  221. typedef struct _SECURITY_ATTRIBUTES {
  222. DWORD nLength;
  223. LPVOID lpSecurityDescriptor;
  224. BOOL bInheritHandle;
  225. } SECURITY_ATTRIBUTES, *PSECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;
  226. ;end_userk
  227. typedef struct _PROCESS_INFORMATION {
  228. HANDLE hProcess;
  229. HANDLE hThread;
  230. DWORD dwProcessId;
  231. DWORD dwThreadId;
  232. } PROCESS_INFORMATION, *PPROCESS_INFORMATION, *LPPROCESS_INFORMATION;
  233. //
  234. // File System time stamps are represented with the following structure:
  235. //
  236. ;begin_userk
  237. typedef struct _FILETIME {
  238. DWORD dwLowDateTime;
  239. DWORD dwHighDateTime;
  240. } FILETIME, *PFILETIME, *LPFILETIME;
  241. //
  242. // System time is represented with the following structure:
  243. //
  244. typedef struct _SYSTEMTIME {
  245. WORD wYear;
  246. WORD wMonth;
  247. WORD wDayOfWeek;
  248. WORD wDay;
  249. WORD wHour;
  250. WORD wMinute;
  251. WORD wSecond;
  252. WORD wMilliseconds;
  253. } SYSTEMTIME, *PSYSTEMTIME, *LPSYSTEMTIME;
  254. ;end_userk
  255. typedef DWORD (WINAPI *PTHREAD_START_ROUTINE)(
  256. LPVOID lpThreadParameter
  257. );
  258. typedef PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE;
  259. ;begin_sur
  260. typedef VOID (WINAPI *PFIBER_START_ROUTINE)(
  261. LPVOID lpFiberParameter
  262. );
  263. typedef PFIBER_START_ROUTINE LPFIBER_START_ROUTINE;
  264. ;end_sur
  265. typedef RTL_CRITICAL_SECTION CRITICAL_SECTION;
  266. typedef PRTL_CRITICAL_SECTION PCRITICAL_SECTION;
  267. typedef PRTL_CRITICAL_SECTION LPCRITICAL_SECTION;
  268. typedef RTL_CRITICAL_SECTION_DEBUG CRITICAL_SECTION_DEBUG;
  269. typedef PRTL_CRITICAL_SECTION_DEBUG PCRITICAL_SECTION_DEBUG;
  270. typedef PRTL_CRITICAL_SECTION_DEBUG LPCRITICAL_SECTION_DEBUG;
  271. #if defined(_X86_)
  272. typedef PLDT_ENTRY LPLDT_ENTRY;
  273. #else
  274. typedef LPVOID LPLDT_ENTRY;
  275. #endif
  276. #define MUTEX_MODIFY_STATE MUTANT_QUERY_STATE
  277. #define MUTEX_ALL_ACCESS MUTANT_ALL_ACCESS
  278. //
  279. // Serial provider type.
  280. //
  281. #define SP_SERIALCOMM ((DWORD)0x00000001)
  282. //
  283. // Provider SubTypes
  284. //
  285. #define PST_UNSPECIFIED ((DWORD)0x00000000)
  286. #define PST_RS232 ((DWORD)0x00000001)
  287. #define PST_PARALLELPORT ((DWORD)0x00000002)
  288. #define PST_RS422 ((DWORD)0x00000003)
  289. #define PST_RS423 ((DWORD)0x00000004)
  290. #define PST_RS449 ((DWORD)0x00000005)
  291. #define PST_MODEM ((DWORD)0x00000006)
  292. #define PST_FAX ((DWORD)0x00000021)
  293. #define PST_SCANNER ((DWORD)0x00000022)
  294. #define PST_NETWORK_BRIDGE ((DWORD)0x00000100)
  295. #define PST_LAT ((DWORD)0x00000101)
  296. #define PST_TCPIP_TELNET ((DWORD)0x00000102)
  297. #define PST_X25 ((DWORD)0x00000103)
  298. //
  299. // Provider capabilities flags.
  300. //
  301. #define PCF_DTRDSR ((DWORD)0x0001)
  302. #define PCF_RTSCTS ((DWORD)0x0002)
  303. #define PCF_RLSD ((DWORD)0x0004)
  304. #define PCF_PARITY_CHECK ((DWORD)0x0008)
  305. #define PCF_XONXOFF ((DWORD)0x0010)
  306. #define PCF_SETXCHAR ((DWORD)0x0020)
  307. #define PCF_TOTALTIMEOUTS ((DWORD)0x0040)
  308. #define PCF_INTTIMEOUTS ((DWORD)0x0080)
  309. #define PCF_SPECIALCHARS ((DWORD)0x0100)
  310. #define PCF_16BITMODE ((DWORD)0x0200)
  311. //
  312. // Comm provider settable parameters.
  313. //
  314. #define SP_PARITY ((DWORD)0x0001)
  315. #define SP_BAUD ((DWORD)0x0002)
  316. #define SP_DATABITS ((DWORD)0x0004)
  317. #define SP_STOPBITS ((DWORD)0x0008)
  318. #define SP_HANDSHAKING ((DWORD)0x0010)
  319. #define SP_PARITY_CHECK ((DWORD)0x0020)
  320. #define SP_RLSD ((DWORD)0x0040)
  321. //
  322. // Settable baud rates in the provider.
  323. //
  324. #define BAUD_075 ((DWORD)0x00000001)
  325. #define BAUD_110 ((DWORD)0x00000002)
  326. #define BAUD_134_5 ((DWORD)0x00000004)
  327. #define BAUD_150 ((DWORD)0x00000008)
  328. #define BAUD_300 ((DWORD)0x00000010)
  329. #define BAUD_600 ((DWORD)0x00000020)
  330. #define BAUD_1200 ((DWORD)0x00000040)
  331. #define BAUD_1800 ((DWORD)0x00000080)
  332. #define BAUD_2400 ((DWORD)0x00000100)
  333. #define BAUD_4800 ((DWORD)0x00000200)
  334. #define BAUD_7200 ((DWORD)0x00000400)
  335. #define BAUD_9600 ((DWORD)0x00000800)
  336. #define BAUD_14400 ((DWORD)0x00001000)
  337. #define BAUD_19200 ((DWORD)0x00002000)
  338. #define BAUD_38400 ((DWORD)0x00004000)
  339. #define BAUD_56K ((DWORD)0x00008000)
  340. #define BAUD_128K ((DWORD)0x00010000)
  341. #define BAUD_115200 ((DWORD)0x00020000)
  342. #define BAUD_57600 ((DWORD)0x00040000)
  343. #define BAUD_USER ((DWORD)0x10000000)
  344. //
  345. // Settable Data Bits
  346. //
  347. #define DATABITS_5 ((WORD)0x0001)
  348. #define DATABITS_6 ((WORD)0x0002)
  349. #define DATABITS_7 ((WORD)0x0004)
  350. #define DATABITS_8 ((WORD)0x0008)
  351. #define DATABITS_16 ((WORD)0x0010)
  352. #define DATABITS_16X ((WORD)0x0020)
  353. //
  354. // Settable Stop and Parity bits.
  355. //
  356. #define STOPBITS_10 ((WORD)0x0001)
  357. #define STOPBITS_15 ((WORD)0x0002)
  358. #define STOPBITS_20 ((WORD)0x0004)
  359. #define PARITY_NONE ((WORD)0x0100)
  360. #define PARITY_ODD ((WORD)0x0200)
  361. #define PARITY_EVEN ((WORD)0x0400)
  362. #define PARITY_MARK ((WORD)0x0800)
  363. #define PARITY_SPACE ((WORD)0x1000)
  364. typedef struct _COMMPROP {
  365. WORD wPacketLength;
  366. WORD wPacketVersion;
  367. DWORD dwServiceMask;
  368. DWORD dwReserved1;
  369. DWORD dwMaxTxQueue;
  370. DWORD dwMaxRxQueue;
  371. DWORD dwMaxBaud;
  372. DWORD dwProvSubType;
  373. DWORD dwProvCapabilities;
  374. DWORD dwSettableParams;
  375. DWORD dwSettableBaud;
  376. WORD wSettableData;
  377. WORD wSettableStopParity;
  378. DWORD dwCurrentTxQueue;
  379. DWORD dwCurrentRxQueue;
  380. DWORD dwProvSpec1;
  381. DWORD dwProvSpec2;
  382. WCHAR wcProvChar[1];
  383. } COMMPROP,*LPCOMMPROP;
  384. //
  385. // Set dwProvSpec1 to COMMPROP_INITIALIZED to indicate that wPacketLength
  386. // is valid before a call to GetCommProperties().
  387. //
  388. #define COMMPROP_INITIALIZED ((DWORD)0xE73CF52E)
  389. typedef struct _COMSTAT {
  390. DWORD fCtsHold : 1;
  391. DWORD fDsrHold : 1;
  392. DWORD fRlsdHold : 1;
  393. DWORD fXoffHold : 1;
  394. DWORD fXoffSent : 1;
  395. DWORD fEof : 1;
  396. DWORD fTxim : 1;
  397. DWORD fReserved : 25;
  398. DWORD cbInQue;
  399. DWORD cbOutQue;
  400. } COMSTAT, *LPCOMSTAT;
  401. //
  402. // DTR Control Flow Values.
  403. //
  404. #define DTR_CONTROL_DISABLE 0x00
  405. #define DTR_CONTROL_ENABLE 0x01
  406. #define DTR_CONTROL_HANDSHAKE 0x02
  407. //
  408. // RTS Control Flow Values
  409. //
  410. #define RTS_CONTROL_DISABLE 0x00
  411. #define RTS_CONTROL_ENABLE 0x01
  412. #define RTS_CONTROL_HANDSHAKE 0x02
  413. #define RTS_CONTROL_TOGGLE 0x03
  414. typedef struct _DCB {
  415. DWORD DCBlength; /* sizeof(DCB) */
  416. DWORD BaudRate; /* Baudrate at which running */
  417. DWORD fBinary: 1; /* Binary Mode (skip EOF check) */
  418. DWORD fParity: 1; /* Enable parity checking */
  419. DWORD fOutxCtsFlow:1; /* CTS handshaking on output */
  420. DWORD fOutxDsrFlow:1; /* DSR handshaking on output */
  421. DWORD fDtrControl:2; /* DTR Flow control */
  422. DWORD fDsrSensitivity:1; /* DSR Sensitivity */
  423. DWORD fTXContinueOnXoff: 1; /* Continue TX when Xoff sent */
  424. DWORD fOutX: 1; /* Enable output X-ON/X-OFF */
  425. DWORD fInX: 1; /* Enable input X-ON/X-OFF */
  426. DWORD fErrorChar: 1; /* Enable Err Replacement */
  427. DWORD fNull: 1; /* Enable Null stripping */
  428. DWORD fRtsControl:2; /* Rts Flow control */
  429. DWORD fAbortOnError:1; /* Abort all reads and writes on Error */
  430. DWORD fDummy2:17; /* Reserved */
  431. WORD wReserved; /* Not currently used */
  432. WORD XonLim; /* Transmit X-ON threshold */
  433. WORD XoffLim; /* Transmit X-OFF threshold */
  434. BYTE ByteSize; /* Number of bits/byte, 4-8 */
  435. BYTE Parity; /* 0-4=None,Odd,Even,Mark,Space */
  436. BYTE StopBits; /* 0,1,2 = 1, 1.5, 2 */
  437. char XonChar; /* Tx and Rx X-ON character */
  438. char XoffChar; /* Tx and Rx X-OFF character */
  439. char ErrorChar; /* Error replacement char */
  440. char EofChar; /* End of Input character */
  441. char EvtChar; /* Received Event character */
  442. WORD wReserved1; /* Fill for now. */
  443. } DCB, *LPDCB;
  444. typedef struct _COMMTIMEOUTS {
  445. DWORD ReadIntervalTimeout; /* Maximum time between read chars. */
  446. DWORD ReadTotalTimeoutMultiplier; /* Multiplier of characters. */
  447. DWORD ReadTotalTimeoutConstant; /* Constant in milliseconds. */
  448. DWORD WriteTotalTimeoutMultiplier; /* Multiplier of characters. */
  449. DWORD WriteTotalTimeoutConstant; /* Constant in milliseconds. */
  450. } COMMTIMEOUTS,*LPCOMMTIMEOUTS;
  451. typedef struct _COMMCONFIG {
  452. DWORD dwSize; /* Size of the entire struct */
  453. WORD wVersion; /* version of the structure */
  454. WORD wReserved; /* alignment */
  455. DCB dcb; /* device control block */
  456. DWORD dwProviderSubType; /* ordinal value for identifying
  457. provider-defined data structure format*/
  458. DWORD dwProviderOffset; /* Specifies the offset of provider specific
  459. data field in bytes from the start */
  460. DWORD dwProviderSize; /* size of the provider-specific data field */
  461. WCHAR wcProviderData[1]; /* provider-specific data */
  462. } COMMCONFIG,*LPCOMMCONFIG;
  463. typedef struct _SYSTEM_INFO {
  464. union {
  465. DWORD dwOemId; // Obsolete field...do not use
  466. struct {
  467. WORD wProcessorArchitecture;
  468. WORD wReserved;
  469. };
  470. };
  471. DWORD dwPageSize;
  472. LPVOID lpMinimumApplicationAddress;
  473. LPVOID lpMaximumApplicationAddress;
  474. DWORD_PTR dwActiveProcessorMask;
  475. DWORD dwNumberOfProcessors;
  476. DWORD dwProcessorType;
  477. DWORD dwAllocationGranularity;
  478. WORD wProcessorLevel;
  479. WORD wProcessorRevision;
  480. } SYSTEM_INFO, *LPSYSTEM_INFO;
  481. //
  482. //
  483. #define FreeModule(hLibModule) FreeLibrary((hLibModule))
  484. #define MakeProcInstance(lpProc,hInstance) (lpProc)
  485. #define FreeProcInstance(lpProc) (lpProc)
  486. /* Global Memory Flags */
  487. #define GMEM_FIXED 0x0000
  488. #define GMEM_MOVEABLE 0x0002
  489. #define GMEM_NOCOMPACT 0x0010
  490. #define GMEM_NODISCARD 0x0020
  491. #define GMEM_ZEROINIT 0x0040
  492. #define GMEM_MODIFY 0x0080
  493. #define GMEM_DISCARDABLE 0x0100
  494. #define GMEM_NOT_BANKED 0x1000
  495. #define GMEM_SHARE 0x2000
  496. #define GMEM_DDESHARE 0x2000
  497. #define GMEM_NOTIFY 0x4000
  498. #define GMEM_LOWER GMEM_NOT_BANKED
  499. #define GMEM_VALID_FLAGS 0x7F72
  500. #define GMEM_INVALID_HANDLE 0x8000
  501. #define GHND (GMEM_MOVEABLE | GMEM_ZEROINIT)
  502. #define GPTR (GMEM_FIXED | GMEM_ZEROINIT)
  503. #define GlobalLRUNewest( h ) ((HANDLE)(h))
  504. #define GlobalLRUOldest( h ) ((HANDLE)(h))
  505. #define GlobalDiscard( h ) GlobalReAlloc( (h), 0, GMEM_MOVEABLE )
  506. /* Flags returned by GlobalFlags (in addition to GMEM_DISCARDABLE) */
  507. #define GMEM_DISCARDED 0x4000
  508. #define GMEM_LOCKCOUNT 0x00FF
  509. typedef struct _MEMORYSTATUS {
  510. DWORD dwLength;
  511. DWORD dwMemoryLoad;
  512. SIZE_T dwTotalPhys;
  513. SIZE_T dwAvailPhys;
  514. SIZE_T dwTotalPageFile;
  515. SIZE_T dwAvailPageFile;
  516. SIZE_T dwTotalVirtual;
  517. SIZE_T dwAvailVirtual;
  518. } MEMORYSTATUS, *LPMEMORYSTATUS;
  519. /* Local Memory Flags */
  520. #define LMEM_FIXED 0x0000
  521. #define LMEM_MOVEABLE 0x0002
  522. #define LMEM_NOCOMPACT 0x0010
  523. #define LMEM_NODISCARD 0x0020
  524. #define LMEM_ZEROINIT 0x0040
  525. #define LMEM_MODIFY 0x0080
  526. #define LMEM_DISCARDABLE 0x0F00
  527. #define LMEM_VALID_FLAGS 0x0F72
  528. #define LMEM_INVALID_HANDLE 0x8000
  529. #define LHND (LMEM_MOVEABLE | LMEM_ZEROINIT)
  530. #define LPTR (LMEM_FIXED | LMEM_ZEROINIT)
  531. #define NONZEROLHND (LMEM_MOVEABLE)
  532. #define NONZEROLPTR (LMEM_FIXED)
  533. #define LocalDiscard( h ) LocalReAlloc( (h), 0, LMEM_MOVEABLE )
  534. /* Flags returned by LocalFlags (in addition to LMEM_DISCARDABLE) */
  535. #define LMEM_DISCARDED 0x4000
  536. #define LMEM_LOCKCOUNT 0x00FF
  537. //
  538. // dwCreationFlag values
  539. //
  540. #define DEBUG_PROCESS 0x00000001
  541. #define DEBUG_ONLY_THIS_PROCESS 0x00000002
  542. #define CREATE_SUSPENDED 0x00000004
  543. #define DETACHED_PROCESS 0x00000008
  544. #define CREATE_NEW_CONSOLE 0x00000010
  545. #define NORMAL_PRIORITY_CLASS 0x00000020
  546. #define IDLE_PRIORITY_CLASS 0x00000040
  547. #define HIGH_PRIORITY_CLASS 0x00000080
  548. #define REALTIME_PRIORITY_CLASS 0x00000100
  549. #define CREATE_NEW_PROCESS_GROUP 0x00000200
  550. #define CREATE_UNICODE_ENVIRONMENT 0x00000400
  551. #define CREATE_SEPARATE_WOW_VDM 0x00000800
  552. #define CREATE_SHARED_WOW_VDM 0x00001000
  553. #define CREATE_FORCEDOS 0x00002000
  554. #define BELOW_NORMAL_PRIORITY_CLASS 0x00004000
  555. #define ABOVE_NORMAL_PRIORITY_CLASS 0x00008000
  556. #define STACK_SIZE_PARAM_IS_A_RESERVATION 0x00010000
  557. #define CREATE_BREAKAWAY_FROM_JOB 0x01000000
  558. #define CREATE_PRESERVE_CODE_AUTHZ_LEVEL 0x02000000
  559. #define CREATE_DEFAULT_ERROR_MODE 0x04000000
  560. #define CREATE_NO_WINDOW 0x08000000
  561. #define PROFILE_USER 0x10000000
  562. #define PROFILE_KERNEL 0x20000000
  563. #define PROFILE_SERVER 0x40000000
  564. #define CREATE_IGNORE_SYSTEM_DEFAULT 0x80000000
  565. #define THREAD_PRIORITY_LOWEST THREAD_BASE_PRIORITY_MIN
  566. #define THREAD_PRIORITY_BELOW_NORMAL (THREAD_PRIORITY_LOWEST+1)
  567. #define THREAD_PRIORITY_NORMAL 0
  568. #define THREAD_PRIORITY_HIGHEST THREAD_BASE_PRIORITY_MAX
  569. #define THREAD_PRIORITY_ABOVE_NORMAL (THREAD_PRIORITY_HIGHEST-1)
  570. #define THREAD_PRIORITY_ERROR_RETURN (MAXLONG)
  571. #define THREAD_PRIORITY_TIME_CRITICAL THREAD_BASE_PRIORITY_LOWRT
  572. #define THREAD_PRIORITY_IDLE THREAD_BASE_PRIORITY_IDLE
  573. //
  574. // Debug APIs
  575. //
  576. #define EXCEPTION_DEBUG_EVENT 1
  577. #define CREATE_THREAD_DEBUG_EVENT 2
  578. #define CREATE_PROCESS_DEBUG_EVENT 3
  579. #define EXIT_THREAD_DEBUG_EVENT 4
  580. #define EXIT_PROCESS_DEBUG_EVENT 5
  581. #define LOAD_DLL_DEBUG_EVENT 6
  582. #define UNLOAD_DLL_DEBUG_EVENT 7
  583. #define OUTPUT_DEBUG_STRING_EVENT 8
  584. #define RIP_EVENT 9
  585. typedef struct _EXCEPTION_DEBUG_INFO {
  586. EXCEPTION_RECORD ExceptionRecord;
  587. DWORD dwFirstChance;
  588. } EXCEPTION_DEBUG_INFO, *LPEXCEPTION_DEBUG_INFO;
  589. typedef struct _CREATE_THREAD_DEBUG_INFO {
  590. HANDLE hThread;
  591. LPVOID lpThreadLocalBase;
  592. LPTHREAD_START_ROUTINE lpStartAddress;
  593. } CREATE_THREAD_DEBUG_INFO, *LPCREATE_THREAD_DEBUG_INFO;
  594. typedef struct _CREATE_PROCESS_DEBUG_INFO {
  595. HANDLE hFile;
  596. HANDLE hProcess;
  597. HANDLE hThread;
  598. LPVOID lpBaseOfImage;
  599. DWORD dwDebugInfoFileOffset;
  600. DWORD nDebugInfoSize;
  601. LPVOID lpThreadLocalBase;
  602. LPTHREAD_START_ROUTINE lpStartAddress;
  603. LPVOID lpImageName;
  604. WORD fUnicode;
  605. } CREATE_PROCESS_DEBUG_INFO, *LPCREATE_PROCESS_DEBUG_INFO;
  606. typedef struct _EXIT_THREAD_DEBUG_INFO {
  607. DWORD dwExitCode;
  608. } EXIT_THREAD_DEBUG_INFO, *LPEXIT_THREAD_DEBUG_INFO;
  609. typedef struct _EXIT_PROCESS_DEBUG_INFO {
  610. DWORD dwExitCode;
  611. } EXIT_PROCESS_DEBUG_INFO, *LPEXIT_PROCESS_DEBUG_INFO;
  612. typedef struct _LOAD_DLL_DEBUG_INFO {
  613. HANDLE hFile;
  614. LPVOID lpBaseOfDll;
  615. DWORD dwDebugInfoFileOffset;
  616. DWORD nDebugInfoSize;
  617. LPVOID lpImageName;
  618. WORD fUnicode;
  619. } LOAD_DLL_DEBUG_INFO, *LPLOAD_DLL_DEBUG_INFO;
  620. typedef struct _UNLOAD_DLL_DEBUG_INFO {
  621. LPVOID lpBaseOfDll;
  622. } UNLOAD_DLL_DEBUG_INFO, *LPUNLOAD_DLL_DEBUG_INFO;
  623. typedef struct _OUTPUT_DEBUG_STRING_INFO {
  624. LPSTR lpDebugStringData;
  625. WORD fUnicode;
  626. WORD nDebugStringLength;
  627. } OUTPUT_DEBUG_STRING_INFO, *LPOUTPUT_DEBUG_STRING_INFO;
  628. typedef struct _RIP_INFO {
  629. DWORD dwError;
  630. DWORD dwType;
  631. } RIP_INFO, *LPRIP_INFO;
  632. typedef struct _DEBUG_EVENT {
  633. DWORD dwDebugEventCode;
  634. DWORD dwProcessId;
  635. DWORD dwThreadId;
  636. union {
  637. EXCEPTION_DEBUG_INFO Exception;
  638. CREATE_THREAD_DEBUG_INFO CreateThread;
  639. CREATE_PROCESS_DEBUG_INFO CreateProcessInfo;
  640. EXIT_THREAD_DEBUG_INFO ExitThread;
  641. EXIT_PROCESS_DEBUG_INFO ExitProcess;
  642. LOAD_DLL_DEBUG_INFO LoadDll;
  643. UNLOAD_DLL_DEBUG_INFO UnloadDll;
  644. OUTPUT_DEBUG_STRING_INFO DebugString;
  645. RIP_INFO RipInfo;
  646. } u;
  647. } DEBUG_EVENT, *LPDEBUG_EVENT;
  648. #if !defined(MIDL_PASS)
  649. typedef PCONTEXT LPCONTEXT;
  650. typedef PEXCEPTION_RECORD LPEXCEPTION_RECORD;
  651. typedef PEXCEPTION_POINTERS LPEXCEPTION_POINTERS;
  652. #endif
  653. #define DRIVE_UNKNOWN 0
  654. #define DRIVE_NO_ROOT_DIR 1
  655. #define DRIVE_REMOVABLE 2
  656. #define DRIVE_FIXED 3
  657. #define DRIVE_REMOTE 4
  658. #define DRIVE_CDROM 5
  659. #define DRIVE_RAMDISK 6
  660. #ifndef _MAC
  661. #define GetFreeSpace(w) (0x100000L)
  662. #else
  663. WINBASEAPI DWORD WINAPI GetFreeSpace(UINT);
  664. #endif
  665. #define FILE_TYPE_UNKNOWN 0x0000
  666. #define FILE_TYPE_DISK 0x0001
  667. #define FILE_TYPE_CHAR 0x0002
  668. #define FILE_TYPE_PIPE 0x0003
  669. #define FILE_TYPE_REMOTE 0x8000
  670. #define STD_INPUT_HANDLE ((DWORD)-10)
  671. #define STD_OUTPUT_HANDLE ((DWORD)-11)
  672. #define STD_ERROR_HANDLE ((DWORD)-12)
  673. #define NOPARITY 0
  674. #define ODDPARITY 1
  675. #define EVENPARITY 2
  676. #define MARKPARITY 3
  677. #define SPACEPARITY 4
  678. #define ONESTOPBIT 0
  679. #define ONE5STOPBITS 1
  680. #define TWOSTOPBITS 2
  681. #define IGNORE 0 // Ignore signal
  682. #define INFINITE 0xFFFFFFFF // Infinite timeout ; userk
  683. //
  684. // Baud rates at which the communication device operates
  685. //
  686. #define CBR_110 110
  687. #define CBR_300 300
  688. #define CBR_600 600
  689. #define CBR_1200 1200
  690. #define CBR_2400 2400
  691. #define CBR_4800 4800
  692. #define CBR_9600 9600
  693. #define CBR_14400 14400
  694. #define CBR_19200 19200
  695. #define CBR_38400 38400
  696. #define CBR_56000 56000
  697. #define CBR_57600 57600
  698. #define CBR_115200 115200
  699. #define CBR_128000 128000
  700. #define CBR_256000 256000
  701. //
  702. // Error Flags
  703. //
  704. #define CE_RXOVER 0x0001 // Receive Queue overflow
  705. #define CE_OVERRUN 0x0002 // Receive Overrun Error
  706. #define CE_RXPARITY 0x0004 // Receive Parity Error
  707. #define CE_FRAME 0x0008 // Receive Framing error
  708. #define CE_BREAK 0x0010 // Break Detected
  709. #define CE_TXFULL 0x0100 // TX Queue is full
  710. #define CE_PTO 0x0200 // LPTx Timeout
  711. #define CE_IOE 0x0400 // LPTx I/O Error
  712. #define CE_DNS 0x0800 // LPTx Device not selected
  713. #define CE_OOP 0x1000 // LPTx Out-Of-Paper
  714. #define CE_MODE 0x8000 // Requested mode unsupported
  715. #define IE_BADID (-1) // Invalid or unsupported id
  716. #define IE_OPEN (-2) // Device Already Open
  717. #define IE_NOPEN (-3) // Device Not Open
  718. #define IE_MEMORY (-4) // Unable to allocate queues
  719. #define IE_DEFAULT (-5) // Error in default parameters
  720. #define IE_HARDWARE (-10) // Hardware Not Present
  721. #define IE_BYTESIZE (-11) // Illegal Byte Size
  722. #define IE_BAUDRATE (-12) // Unsupported BaudRate
  723. //
  724. // Events
  725. //
  726. #define EV_RXCHAR 0x0001 // Any Character received
  727. #define EV_RXFLAG 0x0002 // Received certain character
  728. #define EV_TXEMPTY 0x0004 // Transmitt Queue Empty
  729. #define EV_CTS 0x0008 // CTS changed state
  730. #define EV_DSR 0x0010 // DSR changed state
  731. #define EV_RLSD 0x0020 // RLSD changed state
  732. #define EV_BREAK 0x0040 // BREAK received
  733. #define EV_ERR 0x0080 // Line status error occurred
  734. #define EV_RING 0x0100 // Ring signal detected
  735. #define EV_PERR 0x0200 // Printer error occured
  736. #define EV_RX80FULL 0x0400 // Receive buffer is 80 percent full
  737. #define EV_EVENT1 0x0800 // Provider specific event 1
  738. #define EV_EVENT2 0x1000 // Provider specific event 2
  739. //
  740. // Escape Functions
  741. //
  742. #define SETXOFF 1 // Simulate XOFF received
  743. #define SETXON 2 // Simulate XON received
  744. #define SETRTS 3 // Set RTS high
  745. #define CLRRTS 4 // Set RTS low
  746. #define SETDTR 5 // Set DTR high
  747. #define CLRDTR 6 // Set DTR low
  748. #define RESETDEV 7 // Reset device if possible
  749. #define SETBREAK 8 // Set the device break line.
  750. #define CLRBREAK 9 // Clear the device break line.
  751. //
  752. // PURGE function flags.
  753. //
  754. #define PURGE_TXABORT 0x0001 // Kill the pending/current writes to the comm port.
  755. #define PURGE_RXABORT 0x0002 // Kill the pending/current reads to the comm port.
  756. #define PURGE_TXCLEAR 0x0004 // Kill the transmit queue if there.
  757. #define PURGE_RXCLEAR 0x0008 // Kill the typeahead buffer if there.
  758. #define LPTx 0x80 // Set if ID is for LPT device
  759. //
  760. // Modem Status Flags
  761. //
  762. #define MS_CTS_ON ((DWORD)0x0010)
  763. #define MS_DSR_ON ((DWORD)0x0020)
  764. #define MS_RING_ON ((DWORD)0x0040)
  765. #define MS_RLSD_ON ((DWORD)0x0080)
  766. //
  767. // WaitSoundState() Constants
  768. //
  769. #define S_QUEUEEMPTY 0
  770. #define S_THRESHOLD 1
  771. #define S_ALLTHRESHOLD 2
  772. //
  773. // Accent Modes
  774. //
  775. #define S_NORMAL 0
  776. #define S_LEGATO 1
  777. #define S_STACCATO 2
  778. //
  779. // SetSoundNoise() Sources
  780. //
  781. #define S_PERIOD512 0 // Freq = N/512 high pitch, less coarse hiss
  782. #define S_PERIOD1024 1 // Freq = N/1024
  783. #define S_PERIOD2048 2 // Freq = N/2048 low pitch, more coarse hiss
  784. #define S_PERIODVOICE 3 // Source is frequency from voice channel (3)
  785. #define S_WHITE512 4 // Freq = N/512 high pitch, less coarse hiss
  786. #define S_WHITE1024 5 // Freq = N/1024
  787. #define S_WHITE2048 6 // Freq = N/2048 low pitch, more coarse hiss
  788. #define S_WHITEVOICE 7 // Source is frequency from voice channel (3)
  789. #define S_SERDVNA (-1) // Device not available
  790. #define S_SEROFM (-2) // Out of memory
  791. #define S_SERMACT (-3) // Music active
  792. #define S_SERQFUL (-4) // Queue full
  793. #define S_SERBDNT (-5) // Invalid note
  794. #define S_SERDLN (-6) // Invalid note length
  795. #define S_SERDCC (-7) // Invalid note count
  796. #define S_SERDTP (-8) // Invalid tempo
  797. #define S_SERDVL (-9) // Invalid volume
  798. #define S_SERDMD (-10) // Invalid mode
  799. #define S_SERDSH (-11) // Invalid shape
  800. #define S_SERDPT (-12) // Invalid pitch
  801. #define S_SERDFQ (-13) // Invalid frequency
  802. #define S_SERDDR (-14) // Invalid duration
  803. #define S_SERDSR (-15) // Invalid source
  804. #define S_SERDST (-16) // Invalid state
  805. #define NMPWAIT_WAIT_FOREVER 0xffffffff
  806. #define NMPWAIT_NOWAIT 0x00000001
  807. #define NMPWAIT_USE_DEFAULT_WAIT 0x00000000
  808. #define FS_CASE_IS_PRESERVED FILE_CASE_PRESERVED_NAMES
  809. #define FS_CASE_SENSITIVE FILE_CASE_SENSITIVE_SEARCH
  810. #define FS_UNICODE_STORED_ON_DISK FILE_UNICODE_ON_DISK
  811. #define FS_PERSISTENT_ACLS FILE_PERSISTENT_ACLS
  812. #define FS_VOL_IS_COMPRESSED FILE_VOLUME_IS_COMPRESSED
  813. #define FS_FILE_COMPRESSION FILE_FILE_COMPRESSION
  814. #define FS_FILE_ENCRYPTION FILE_SUPPORTS_ENCRYPTION
  815. #define FILE_MAP_COPY SECTION_QUERY
  816. #define FILE_MAP_WRITE SECTION_MAP_WRITE
  817. #define FILE_MAP_READ SECTION_MAP_READ
  818. #define FILE_MAP_ALL_ACCESS SECTION_ALL_ACCESS
  819. #define OF_READ 0x00000000
  820. #define OF_WRITE 0x00000001
  821. #define OF_READWRITE 0x00000002
  822. #define OF_SHARE_COMPAT 0x00000000
  823. #define OF_SHARE_EXCLUSIVE 0x00000010
  824. #define OF_SHARE_DENY_WRITE 0x00000020
  825. #define OF_SHARE_DENY_READ 0x00000030
  826. #define OF_SHARE_DENY_NONE 0x00000040
  827. #define OF_PARSE 0x00000100
  828. #define OF_DELETE 0x00000200
  829. #define OF_VERIFY 0x00000400
  830. #define OF_CANCEL 0x00000800
  831. #define OF_CREATE 0x00001000
  832. #define OF_PROMPT 0x00002000
  833. #define OF_EXIST 0x00004000
  834. #define OF_REOPEN 0x00008000
  835. #define OFS_MAXPATHNAME 128
  836. typedef struct _OFSTRUCT {
  837. BYTE cBytes;
  838. BYTE fFixedDisk;
  839. WORD nErrCode;
  840. WORD Reserved1;
  841. WORD Reserved2;
  842. CHAR szPathName[OFS_MAXPATHNAME];
  843. } OFSTRUCT, *LPOFSTRUCT, *POFSTRUCT;
  844. //
  845. // The Risc compilers support intrinsic functions for interlocked
  846. // increment, decrement, and exchange.
  847. //
  848. #ifndef NOWINBASEINTERLOCK
  849. #ifndef _NTOS_
  850. #if defined(_M_IA64) && !defined(RC_INVOKED)
  851. #define InterlockedIncrement _InterlockedIncrement
  852. #define InterlockedDecrement _InterlockedDecrement
  853. #define InterlockedExchange _InterlockedExchange
  854. #define InterlockedExchangeAdd _InterlockedExchangeAdd
  855. #define InterlockedCompareExchange _InterlockedCompareExchange
  856. #define InterlockedExchangePointer _InterlockedExchangePointer
  857. #define InterlockedCompareExchangePointer _InterlockedCompareExchangePointer
  858. LONG
  859. __cdecl
  860. InterlockedIncrement(
  861. IN OUT LONG volatile *lpAddend
  862. );
  863. LONG
  864. __cdecl
  865. InterlockedDecrement(
  866. IN OUT LONG volatile *lpAddend
  867. );
  868. LONG
  869. __cdecl
  870. InterlockedExchange(
  871. IN OUT LONG volatile *Target,
  872. IN LONG Value
  873. );
  874. LONG
  875. __cdecl
  876. InterlockedExchangeAdd(
  877. IN OUT LONG volatile *Addend,
  878. IN LONG Value
  879. );
  880. LONG
  881. __cdecl
  882. InterlockedCompareExchange (
  883. IN OUT LONG volatile *Destination,
  884. IN LONG ExChange,
  885. IN LONG Comperand
  886. );
  887. PVOID
  888. __cdecl
  889. InterlockedExchangePointer(
  890. IN OUT PVOID volatile *Target,
  891. IN PVOID Value
  892. );
  893. PVOID
  894. __cdecl
  895. InterlockedCompareExchangePointer (
  896. IN OUT PVOID volatile *Destination,
  897. IN PVOID ExChange,
  898. IN PVOID Comperand
  899. );
  900. #pragma intrinsic(_InterlockedIncrement)
  901. #pragma intrinsic(_InterlockedDecrement)
  902. #pragma intrinsic(_InterlockedExchange)
  903. #pragma intrinsic(_InterlockedExchangeAdd)
  904. #pragma intrinsic(_InterlockedCompareExchange)
  905. #pragma intrinsic(_InterlockedExchangePointer)
  906. #pragma intrinsic(_InterlockedCompareExchangePointer)
  907. #elif defined(_M_AMD64) && !defined(RC_INVOKED)
  908. #define InterlockedIncrement _InterlockedIncrement
  909. #define InterlockedDecrement _InterlockedDecrement
  910. #define InterlockedExchange _InterlockedExchange
  911. #define InterlockedExchangeAdd _InterlockedExchangeAdd
  912. #define InterlockedCompareExchange _InterlockedCompareExchange
  913. #define InterlockedExchangePointer _InterlockedExchangePointer
  914. #define InterlockedCompareExchangePointer _InterlockedCompareExchangePointer
  915. LONG
  916. InterlockedIncrement(
  917. IN OUT LONG volatile *Addend
  918. );
  919. LONG
  920. InterlockedDecrement(
  921. IN OUT LONG volatile *Addend
  922. );
  923. LONG
  924. InterlockedExchange(
  925. IN OUT LONG volatile *Target,
  926. IN LONG Value
  927. );
  928. LONG
  929. InterlockedExchangeAdd(
  930. IN OUT LONG volatile *Addend,
  931. IN LONG Value
  932. );
  933. LONG
  934. InterlockedCompareExchange (
  935. IN OUT LONG volatile *Destination,
  936. IN LONG ExChange,
  937. IN LONG Comperand
  938. );
  939. PVOID
  940. InterlockedCompareExchangePointer (
  941. IN OUT PVOID volatile *Destination,
  942. IN PVOID Exchange,
  943. IN PVOID Comperand
  944. );
  945. PVOID
  946. InterlockedExchangePointer(
  947. IN OUT PVOID volatile *Target,
  948. IN PVOID Value
  949. );
  950. #pragma intrinsic(_InterlockedIncrement)
  951. #pragma intrinsic(_InterlockedDecrement)
  952. #pragma intrinsic(_InterlockedExchange)
  953. #pragma intrinsic(_InterlockedExchangeAdd)
  954. #pragma intrinsic(_InterlockedCompareExchange)
  955. #pragma intrinsic(_InterlockedExchangePointer)
  956. #pragma intrinsic(_InterlockedCompareExchangePointer)
  957. #else // X86 interlocked definitions
  958. WINBASEAPI
  959. LONG
  960. WINAPI
  961. InterlockedIncrement(
  962. IN OUT LONG volatile *lpAddend
  963. );
  964. WINBASEAPI
  965. LONG
  966. WINAPI
  967. InterlockedDecrement(
  968. IN OUT LONG volatile *lpAddend
  969. );
  970. WINBASEAPI
  971. LONG
  972. WINAPI
  973. InterlockedExchange(
  974. IN OUT LONG volatile *Target,
  975. IN LONG Value
  976. );
  977. #define InterlockedExchangePointer(Target, Value) \
  978. (PVOID)InterlockedExchange((PLONG)(Target), (LONG)(Value))
  979. WINBASEAPI
  980. LONG
  981. WINAPI
  982. InterlockedExchangeAdd(
  983. IN OUT LONG volatile *Addend,
  984. IN LONG Value
  985. );
  986. WINBASEAPI
  987. LONG
  988. WINAPI
  989. InterlockedCompareExchange (
  990. IN OUT LONG volatile *Destination,
  991. IN LONG Exchange,
  992. IN LONG Comperand
  993. );
  994. //
  995. // Use a function for C++ so X86 will generate the same errors as RISC.
  996. //
  997. #ifdef __cplusplus
  998. FORCEINLINE
  999. PVOID
  1000. __cdecl
  1001. __InlineInterlockedCompareExchangePointer (
  1002. IN OUT PVOID volatile *Destination,
  1003. IN PVOID ExChange,
  1004. IN PVOID Comperand
  1005. )
  1006. {
  1007. return((PVOID)(LONG_PTR)InterlockedCompareExchange((LONG volatile *)Destination, (LONG)(LONG_PTR)ExChange, (LONG)(LONG_PTR)Comperand));
  1008. }
  1009. #define InterlockedCompareExchangePointer __InlineInterlockedCompareExchangePointer
  1010. #else
  1011. #define InterlockedCompareExchangePointer(Destination, ExChange, Comperand) \
  1012. (PVOID)(LONG_PTR)InterlockedCompareExchange((LONG volatile *)(Destination), (LONG)(LONG_PTR)(ExChange), (LONG)(LONG_PTR)(Comperand))
  1013. #endif /* __cplusplus */
  1014. #endif /* X86 | IA64 */
  1015. #if defined(_SLIST_HEADER_) && !defined(_NTOSP_)
  1016. WINBASEAPI
  1017. VOID
  1018. WINAPI
  1019. InitializeSListHead (
  1020. IN PSLIST_HEADER ListHead
  1021. );
  1022. WINBASEAPI
  1023. PSINGLE_LIST_ENTRY
  1024. WINAPI
  1025. InterlockedPopEntrySList (
  1026. IN PSLIST_HEADER ListHead
  1027. );
  1028. WINBASEAPI
  1029. PSINGLE_LIST_ENTRY
  1030. WINAPI
  1031. InterlockedPushEntrySList (
  1032. IN PSLIST_HEADER ListHead,
  1033. IN PSINGLE_LIST_ENTRY ListEntry
  1034. );
  1035. WINBASEAPI
  1036. PSINGLE_LIST_ENTRY
  1037. WINAPI
  1038. InterlockedFlushSList (
  1039. IN PSLIST_HEADER ListHead
  1040. );
  1041. WINBASEAPI
  1042. USHORT
  1043. WINAPI
  1044. QueryDepthSList (
  1045. IN PSLIST_HEADER ListHead
  1046. );
  1047. #endif /* _SLIST_HEADER_ */
  1048. #endif /* _NTOS_ */
  1049. #endif /* NOWINBASEINTERLOCK */
  1050. WINBASEAPI
  1051. BOOL
  1052. WINAPI
  1053. FreeResource(
  1054. IN HGLOBAL hResData
  1055. );
  1056. WINBASEAPI
  1057. LPVOID
  1058. WINAPI
  1059. LockResource(
  1060. IN HGLOBAL hResData
  1061. );
  1062. #define UnlockResource(hResData) ((hResData), 0)
  1063. #define MAXINTATOM 0xC000 ; userk
  1064. #define MAKEINTATOM(i) (LPTSTR)((ULONG_PTR)((WORD)(i))) ; userk
  1065. #define INVALID_ATOM ((ATOM)0) ; userk
  1066. #ifndef _MAC
  1067. int
  1068. WINAPI
  1069. #else
  1070. int
  1071. CALLBACK
  1072. #endif
  1073. WinMain(
  1074. IN HINSTANCE hInstance,
  1075. IN HINSTANCE hPrevInstance,
  1076. IN LPSTR lpCmdLine,
  1077. IN int nShowCmd
  1078. );
  1079. WINBASEAPI
  1080. BOOL
  1081. WINAPI
  1082. FreeLibrary(
  1083. IN OUT HMODULE hLibModule ;public_NT
  1084. IN OUT HINSTANCE hLibModule ;public_chicago
  1085. );
  1086. WINBASEAPI
  1087. DECLSPEC_NORETURN
  1088. VOID
  1089. WINAPI
  1090. FreeLibraryAndExitThread(
  1091. IN HMODULE hLibModule,
  1092. IN DWORD dwExitCode
  1093. );
  1094. WINBASEAPI
  1095. BOOL
  1096. WINAPI
  1097. DisableThreadLibraryCalls(
  1098. IN HMODULE hLibModule
  1099. );
  1100. WINBASEAPI
  1101. FARPROC
  1102. WINAPI
  1103. GetProcAddress(
  1104. IN HMODULE hModule, ;public_NT
  1105. IN HINSTANCE hModule, ;public_chicago
  1106. IN LPCSTR lpProcName
  1107. );
  1108. WINBASEAPI
  1109. DWORD
  1110. WINAPI
  1111. GetVersion( VOID );
  1112. WINBASEAPI
  1113. HGLOBAL
  1114. WINAPI
  1115. GlobalAlloc(
  1116. IN UINT uFlags,
  1117. IN SIZE_T dwBytes
  1118. );
  1119. WINBASEAPI
  1120. HGLOBAL
  1121. WINAPI
  1122. GlobalReAlloc(
  1123. IN HGLOBAL hMem,
  1124. IN SIZE_T dwBytes,
  1125. IN UINT uFlags
  1126. );
  1127. WINBASEAPI
  1128. SIZE_T
  1129. WINAPI
  1130. GlobalSize(
  1131. IN HGLOBAL hMem
  1132. );
  1133. WINBASEAPI
  1134. UINT
  1135. WINAPI
  1136. GlobalFlags(
  1137. IN HGLOBAL hMem
  1138. );
  1139. WINBASEAPI
  1140. LPVOID
  1141. WINAPI
  1142. GlobalLock(
  1143. IN HGLOBAL hMem
  1144. );
  1145. //!!!MWH My version win31 = DWORD WINAPI GlobalHandle(UINT)
  1146. WINBASEAPI
  1147. HGLOBAL
  1148. WINAPI
  1149. GlobalHandle(
  1150. IN LPCVOID pMem
  1151. );
  1152. WINBASEAPI
  1153. BOOL
  1154. WINAPI
  1155. GlobalUnlock(
  1156. IN HGLOBAL hMem
  1157. );
  1158. WINBASEAPI
  1159. HGLOBAL
  1160. WINAPI
  1161. GlobalFree(
  1162. IN HGLOBAL hMem
  1163. );
  1164. WINBASEAPI
  1165. SIZE_T
  1166. WINAPI
  1167. GlobalCompact(
  1168. IN DWORD dwMinFree
  1169. );
  1170. WINBASEAPI
  1171. VOID
  1172. WINAPI
  1173. GlobalFix(
  1174. IN HGLOBAL hMem
  1175. );
  1176. WINBASEAPI
  1177. VOID
  1178. WINAPI
  1179. GlobalUnfix(
  1180. IN HGLOBAL hMem
  1181. );
  1182. WINBASEAPI
  1183. LPVOID
  1184. WINAPI
  1185. GlobalWire(
  1186. IN HGLOBAL hMem
  1187. );
  1188. WINBASEAPI
  1189. BOOL
  1190. WINAPI
  1191. GlobalUnWire(
  1192. IN HGLOBAL hMem
  1193. );
  1194. WINBASEAPI
  1195. VOID
  1196. WINAPI
  1197. GlobalMemoryStatus(
  1198. IN OUT LPMEMORYSTATUS lpBuffer
  1199. );
  1200. typedef struct _MEMORYSTATUSEX {
  1201. DWORD dwLength;
  1202. DWORD dwMemoryLoad;
  1203. DWORDLONG ullTotalPhys;
  1204. DWORDLONG ullAvailPhys;
  1205. DWORDLONG ullTotalPageFile;
  1206. DWORDLONG ullAvailPageFile;
  1207. DWORDLONG ullTotalVirtual;
  1208. DWORDLONG ullAvailVirtual;
  1209. DWORDLONG ullAvailExtendedVirtual;
  1210. } MEMORYSTATUSEX, *LPMEMORYSTATUSEX;
  1211. WINBASEAPI
  1212. BOOL
  1213. WINAPI
  1214. GlobalMemoryStatusEx(
  1215. IN OUT LPMEMORYSTATUSEX lpBuffer
  1216. );
  1217. WINBASEAPI
  1218. HLOCAL
  1219. WINAPI
  1220. LocalAlloc(
  1221. IN UINT uFlags,
  1222. IN SIZE_T uBytes
  1223. );
  1224. WINBASEAPI
  1225. HLOCAL
  1226. WINAPI
  1227. LocalReAlloc(
  1228. IN HLOCAL hMem,
  1229. IN SIZE_T uBytes,
  1230. IN UINT uFlags
  1231. );
  1232. WINBASEAPI
  1233. LPVOID
  1234. WINAPI
  1235. LocalLock(
  1236. IN HLOCAL hMem
  1237. );
  1238. WINBASEAPI
  1239. HLOCAL
  1240. WINAPI
  1241. LocalHandle(
  1242. IN LPCVOID pMem
  1243. );
  1244. WINBASEAPI
  1245. BOOL
  1246. WINAPI
  1247. LocalUnlock(
  1248. IN HLOCAL hMem
  1249. );
  1250. WINBASEAPI
  1251. SIZE_T
  1252. WINAPI
  1253. LocalSize(
  1254. IN HLOCAL hMem
  1255. );
  1256. WINBASEAPI
  1257. UINT
  1258. WINAPI
  1259. LocalFlags(
  1260. IN HLOCAL hMem
  1261. );
  1262. WINBASEAPI
  1263. HLOCAL
  1264. WINAPI
  1265. LocalFree(
  1266. IN HLOCAL hMem
  1267. );
  1268. WINBASEAPI
  1269. SIZE_T
  1270. WINAPI
  1271. LocalShrink(
  1272. IN HLOCAL hMem,
  1273. IN UINT cbNewSize
  1274. );
  1275. WINBASEAPI
  1276. SIZE_T
  1277. WINAPI
  1278. LocalCompact(
  1279. IN UINT uMinFree
  1280. );
  1281. WINBASEAPI
  1282. BOOL
  1283. WINAPI
  1284. FlushInstructionCache(
  1285. IN HANDLE hProcess,
  1286. IN LPCVOID lpBaseAddress,
  1287. IN SIZE_T dwSize
  1288. );
  1289. WINBASEAPI
  1290. LPVOID
  1291. WINAPI
  1292. VirtualAlloc(
  1293. IN LPVOID lpAddress,
  1294. IN SIZE_T dwSize,
  1295. IN DWORD flAllocationType,
  1296. IN DWORD flProtect
  1297. );
  1298. WINBASEAPI
  1299. BOOL
  1300. WINAPI
  1301. VirtualFree(
  1302. IN LPVOID lpAddress,
  1303. IN SIZE_T dwSize,
  1304. IN DWORD dwFreeType
  1305. );
  1306. WINBASEAPI
  1307. BOOL
  1308. WINAPI
  1309. VirtualProtect(
  1310. IN LPVOID lpAddress,
  1311. IN SIZE_T dwSize,
  1312. IN DWORD flNewProtect,
  1313. OUT PDWORD lpflOldProtect
  1314. );
  1315. WINBASEAPI
  1316. SIZE_T
  1317. WINAPI
  1318. VirtualQuery(
  1319. IN LPCVOID lpAddress,
  1320. OUT PMEMORY_BASIC_INFORMATION lpBuffer,
  1321. IN SIZE_T dwLength
  1322. );
  1323. WINBASEAPI
  1324. LPVOID
  1325. WINAPI
  1326. VirtualAllocEx(
  1327. IN HANDLE hProcess,
  1328. IN LPVOID lpAddress,
  1329. IN SIZE_T dwSize,
  1330. IN DWORD flAllocationType,
  1331. IN DWORD flProtect
  1332. );
  1333. WINBASEAPI
  1334. UINT
  1335. WINAPI
  1336. GetWriteWatch(
  1337. IN DWORD dwFlags,
  1338. IN PVOID lpBaseAddress,
  1339. IN SIZE_T dwRegionSize,
  1340. IN OUT PVOID *lpAddresses,
  1341. IN OUT PULONG_PTR lpdwCount,
  1342. OUT PULONG lpdwGranularity
  1343. );
  1344. WINBASEAPI
  1345. UINT
  1346. WINAPI
  1347. ResetWriteWatch(
  1348. IN LPVOID lpBaseAddress,
  1349. IN SIZE_T dwRegionSize
  1350. );
  1351. WINBASEAPI
  1352. BOOL
  1353. WINAPI
  1354. VirtualFreeEx(
  1355. IN HANDLE hProcess,
  1356. IN LPVOID lpAddress,
  1357. IN SIZE_T dwSize,
  1358. IN DWORD dwFreeType
  1359. );
  1360. WINBASEAPI
  1361. BOOL
  1362. WINAPI
  1363. VirtualProtectEx(
  1364. IN HANDLE hProcess,
  1365. IN LPVOID lpAddress,
  1366. IN SIZE_T dwSize,
  1367. IN DWORD flNewProtect,
  1368. OUT PDWORD lpflOldProtect
  1369. );
  1370. WINBASEAPI
  1371. SIZE_T
  1372. WINAPI
  1373. VirtualQueryEx(
  1374. IN HANDLE hProcess,
  1375. IN LPCVOID lpAddress,
  1376. OUT PMEMORY_BASIC_INFORMATION lpBuffer,
  1377. IN SIZE_T dwLength
  1378. );
  1379. WINBASEAPI
  1380. HANDLE
  1381. WINAPI
  1382. HeapCreate(
  1383. IN DWORD flOptions,
  1384. IN SIZE_T dwInitialSize,
  1385. IN SIZE_T dwMaximumSize
  1386. );
  1387. WINBASEAPI
  1388. BOOL
  1389. WINAPI
  1390. HeapDestroy(
  1391. IN OUT HANDLE hHeap
  1392. );
  1393. ;begin_internal
  1394. WINBASEAPI
  1395. DWORD
  1396. WINAPI
  1397. HeapCreateTagsW(
  1398. IN HANDLE hHeap,
  1399. IN DWORD dwFlags,
  1400. IN LPCWSTR lpTagPrefix,
  1401. IN LPCWSTR lpTagNames
  1402. );
  1403. typedef struct _HEAP_TAG_INFO {
  1404. DWORD dwNumberOfAllocations;
  1405. DWORD dwNumberOfFrees;
  1406. DWORD dwBytesAllocated;
  1407. } HEAP_TAG_INFO, *PHEAP_TAG_INFO;
  1408. typedef PHEAP_TAG_INFO LPHEAP_TAG_INFO;
  1409. WINBASEAPI
  1410. LPCWSTR
  1411. WINAPI
  1412. HeapQueryTagW(
  1413. IN HANDLE hHeap,
  1414. IN DWORD dwFlags,
  1415. IN WORD wTagIndex,
  1416. IN BOOL bResetCounters,
  1417. OUT LPHEAP_TAG_INFO TagInfo
  1418. );
  1419. ;end_internal
  1420. WINBASEAPI
  1421. LPVOID
  1422. WINAPI
  1423. HeapAlloc(
  1424. IN HANDLE hHeap,
  1425. IN DWORD dwFlags,
  1426. IN SIZE_T dwBytes
  1427. );
  1428. WINBASEAPI
  1429. LPVOID
  1430. WINAPI
  1431. HeapReAlloc(
  1432. IN HANDLE hHeap,
  1433. IN DWORD dwFlags,
  1434. IN LPVOID lpMem,
  1435. IN SIZE_T dwBytes
  1436. );
  1437. WINBASEAPI
  1438. BOOL
  1439. WINAPI
  1440. HeapFree(
  1441. IN HANDLE hHeap,
  1442. IN DWORD dwFlags,
  1443. IN LPVOID lpMem
  1444. );
  1445. WINBASEAPI
  1446. SIZE_T
  1447. WINAPI
  1448. HeapSize(
  1449. IN HANDLE hHeap,
  1450. IN DWORD dwFlags,
  1451. IN LPCVOID lpMem
  1452. );
  1453. WINBASEAPI
  1454. BOOL
  1455. WINAPI
  1456. HeapValidate(
  1457. IN HANDLE hHeap,
  1458. IN DWORD dwFlags,
  1459. IN LPCVOID lpMem
  1460. );
  1461. WINBASEAPI
  1462. SIZE_T
  1463. WINAPI
  1464. HeapCompact(
  1465. IN HANDLE hHeap,
  1466. IN DWORD dwFlags
  1467. );
  1468. WINBASEAPI
  1469. HANDLE
  1470. WINAPI
  1471. GetProcessHeap( VOID );
  1472. WINBASEAPI
  1473. DWORD
  1474. WINAPI
  1475. GetProcessHeaps(
  1476. IN DWORD NumberOfHeaps,
  1477. OUT PHANDLE ProcessHeaps
  1478. );
  1479. typedef struct _PROCESS_HEAP_ENTRY {
  1480. PVOID lpData;
  1481. DWORD cbData;
  1482. BYTE cbOverhead;
  1483. BYTE iRegionIndex;
  1484. WORD wFlags;
  1485. union {
  1486. struct {
  1487. HANDLE hMem;
  1488. DWORD dwReserved[ 3 ];
  1489. } Block;
  1490. struct {
  1491. DWORD dwCommittedSize;
  1492. DWORD dwUnCommittedSize;
  1493. LPVOID lpFirstBlock;
  1494. LPVOID lpLastBlock;
  1495. } Region;
  1496. };
  1497. } PROCESS_HEAP_ENTRY, *LPPROCESS_HEAP_ENTRY, *PPROCESS_HEAP_ENTRY;
  1498. #define PROCESS_HEAP_REGION 0x0001
  1499. #define PROCESS_HEAP_UNCOMMITTED_RANGE 0x0002
  1500. #define PROCESS_HEAP_ENTRY_BUSY 0x0004
  1501. #define PROCESS_HEAP_ENTRY_MOVEABLE 0x0010
  1502. #define PROCESS_HEAP_ENTRY_DDESHARE 0x0020
  1503. WINBASEAPI
  1504. BOOL
  1505. WINAPI
  1506. HeapLock(
  1507. IN HANDLE hHeap
  1508. );
  1509. WINBASEAPI
  1510. BOOL
  1511. WINAPI
  1512. HeapUnlock(
  1513. IN HANDLE hHeap
  1514. );
  1515. ;begin_internal
  1516. typedef struct _HEAP_SUMMARY {
  1517. DWORD cb;
  1518. SIZE_T cbAllocated;
  1519. SIZE_T cbCommitted;
  1520. SIZE_T cbReserved;
  1521. SIZE_T cbMaxReserve;
  1522. } HEAP_SUMMARY, *PHEAP_SUMMARY;
  1523. typedef PHEAP_SUMMARY LPHEAP_SUMMARY;
  1524. BOOL
  1525. WINAPI
  1526. HeapSummary(
  1527. IN HANDLE hHeap,
  1528. IN DWORD dwFlags,
  1529. OUT LPHEAP_SUMMARY lpSummary
  1530. );
  1531. BOOL
  1532. WINAPI
  1533. HeapExtend(
  1534. IN HANDLE hHeap,
  1535. IN DWORD dwFlags,
  1536. IN LPVOID lpBase,
  1537. IN DWORD dwBytes
  1538. );
  1539. typedef struct _HEAP_USAGE_ENTRY {
  1540. struct _HEAP_USAGE_ENTRY *lpNext;
  1541. PVOID lpAddress;
  1542. DWORD dwBytes;
  1543. DWORD dwReserved;
  1544. } HEAP_USAGE_ENTRY, *PHEAP_USAGE_ENTRY;
  1545. typedef struct _HEAP_USAGE {
  1546. DWORD cb;
  1547. SIZE_T cbAllocated;
  1548. SIZE_T cbCommitted;
  1549. SIZE_T cbReserved;
  1550. SIZE_T cbMaxReserve;
  1551. PHEAP_USAGE_ENTRY lpEntries;
  1552. PHEAP_USAGE_ENTRY lpAddedEntries;
  1553. PHEAP_USAGE_ENTRY lpRemovedEntries;
  1554. DWORD Reserved[ 8 ];
  1555. } HEAP_USAGE, *PHEAP_USAGE;
  1556. BOOL
  1557. WINAPI
  1558. HeapUsage(
  1559. IN HANDLE hHeap,
  1560. IN DWORD dwFlags,
  1561. IN BOOL bFirstCall,
  1562. IN BOOL bLastCall,
  1563. OUT PHEAP_USAGE lpUsage
  1564. );
  1565. ;end_internal
  1566. WINBASEAPI
  1567. BOOL
  1568. WINAPI
  1569. HeapWalk(
  1570. IN HANDLE hHeap,
  1571. IN OUT LPPROCESS_HEAP_ENTRY lpEntry
  1572. );
  1573. WINBASEAPI
  1574. BOOL
  1575. WINAPI
  1576. HeapSetInformation (
  1577. IN PVOID HeapHandle,
  1578. IN HEAP_INFORMATION_CLASS HeapInformationClass,
  1579. IN PVOID HeapInformation OPTIONAL,
  1580. IN SIZE_T HeapInformationLength OPTIONAL
  1581. );
  1582. WINBASEAPI
  1583. BOOL
  1584. WINAPI
  1585. HeapQueryInformation (
  1586. IN PVOID HeapHandle,
  1587. IN HEAP_INFORMATION_CLASS HeapInformationClass,
  1588. OUT PVOID HeapInformation OPTIONAL,
  1589. IN SIZE_T HeapInformationLength OPTIONAL,
  1590. OUT PSIZE_T ReturnLength OPTIONAL
  1591. );
  1592. // GetBinaryType return values.
  1593. #define SCS_32BIT_BINARY 0
  1594. #define SCS_DOS_BINARY 1
  1595. #define SCS_WOW_BINARY 2
  1596. #define SCS_PIF_BINARY 3
  1597. #define SCS_POSIX_BINARY 4
  1598. #define SCS_OS216_BINARY 5
  1599. #define SCS_64BIT_BINARY 6
  1600. #if defined(_WIN64)
  1601. # define SCS_THIS_PLATFORM_BINARY SCS_64BIT_BINARY
  1602. #else
  1603. # define SCS_THIS_PLATFORM_BINARY SCS_32BIT_BINARY
  1604. #endif
  1605. WINBASEAPI
  1606. BOOL
  1607. WINAPI
  1608. GetBinaryType%(
  1609. IN LPCTSTR% lpApplicationName,
  1610. OUT LPDWORD lpBinaryType
  1611. );
  1612. WINBASEAPI
  1613. DWORD
  1614. WINAPI
  1615. GetShortPathName%(
  1616. IN LPCTSTR% lpszLongPath,
  1617. OUT LPTSTR% lpszShortPath,
  1618. IN DWORD cchBuffer
  1619. );
  1620. WINBASEAPI
  1621. DWORD
  1622. WINAPI
  1623. GetLongPathName%(
  1624. IN LPCTSTR% lpszShortPath,
  1625. OUT LPTSTR% lpszLongPath,
  1626. IN DWORD cchBuffer
  1627. );
  1628. WINBASEAPI
  1629. BOOL
  1630. WINAPI
  1631. GetProcessAffinityMask(
  1632. IN HANDLE hProcess,
  1633. OUT PDWORD_PTR lpProcessAffinityMask,
  1634. OUT PDWORD_PTR lpSystemAffinityMask
  1635. );
  1636. WINBASEAPI
  1637. BOOL
  1638. WINAPI
  1639. SetProcessAffinityMask(
  1640. IN HANDLE hProcess,
  1641. IN DWORD_PTR dwProcessAffinityMask
  1642. );
  1643. #if _WIN32_WINNT >= 0x0501
  1644. WINBASEAPI
  1645. BOOL
  1646. WINAPI
  1647. GetProcessHandleCount(
  1648. IN HANDLE hProcess,
  1649. OUT PDWORD pdwHandleCount
  1650. );
  1651. #endif // (_WIN32_WINNT >= 0x0501)
  1652. WINBASEAPI
  1653. BOOL
  1654. WINAPI
  1655. GetProcessTimes(
  1656. IN HANDLE hProcess,
  1657. OUT LPFILETIME lpCreationTime,
  1658. OUT LPFILETIME lpExitTime,
  1659. OUT LPFILETIME lpKernelTime,
  1660. OUT LPFILETIME lpUserTime
  1661. );
  1662. WINBASEAPI
  1663. BOOL
  1664. WINAPI
  1665. GetProcessIoCounters(
  1666. IN HANDLE hProcess,
  1667. OUT PIO_COUNTERS lpIoCounters
  1668. );
  1669. WINBASEAPI
  1670. BOOL
  1671. WINAPI
  1672. GetProcessWorkingSetSize(
  1673. IN HANDLE hProcess,
  1674. OUT PSIZE_T lpMinimumWorkingSetSize,
  1675. OUT PSIZE_T lpMaximumWorkingSetSize
  1676. );
  1677. WINBASEAPI
  1678. BOOL
  1679. WINAPI
  1680. SetProcessWorkingSetSize(
  1681. IN HANDLE hProcess,
  1682. IN SIZE_T dwMinimumWorkingSetSize,
  1683. IN SIZE_T dwMaximumWorkingSetSize
  1684. );
  1685. WINBASEAPI
  1686. HANDLE
  1687. WINAPI
  1688. OpenProcess(
  1689. IN DWORD dwDesiredAccess,
  1690. IN BOOL bInheritHandle,
  1691. IN DWORD dwProcessId
  1692. );
  1693. WINBASEAPI
  1694. HANDLE
  1695. WINAPI
  1696. GetCurrentProcess(
  1697. VOID
  1698. );
  1699. WINBASEAPI
  1700. DWORD
  1701. WINAPI
  1702. GetCurrentProcessId(
  1703. VOID
  1704. );
  1705. #if _WIN32_WINNT >= 0x0501
  1706. WINBASEAPI
  1707. DWORD
  1708. WINAPI
  1709. GetProcessId(
  1710. HANDLE Process
  1711. );
  1712. #endif // (_WIN32_WINNT >= 0x0501)
  1713. WINBASEAPI
  1714. DECLSPEC_NORETURN
  1715. VOID
  1716. WINAPI
  1717. ExitProcess(
  1718. IN UINT uExitCode
  1719. );
  1720. WINBASEAPI
  1721. BOOL
  1722. WINAPI
  1723. TerminateProcess(
  1724. IN HANDLE hProcess,
  1725. IN UINT uExitCode
  1726. );
  1727. WINBASEAPI
  1728. BOOL
  1729. WINAPI
  1730. GetExitCodeProcess(
  1731. IN HANDLE hProcess,
  1732. OUT LPDWORD lpExitCode
  1733. );
  1734. WINBASEAPI
  1735. VOID
  1736. WINAPI
  1737. FatalExit(
  1738. IN int ExitCode
  1739. );
  1740. WINBASEAPI
  1741. LPSTR
  1742. WINAPI
  1743. GetEnvironmentStrings(
  1744. VOID
  1745. );
  1746. WINBASEAPI
  1747. LPWSTR
  1748. WINAPI
  1749. GetEnvironmentStringsW(
  1750. VOID
  1751. );
  1752. #ifdef UNICODE
  1753. #define GetEnvironmentStrings GetEnvironmentStringsW
  1754. #else
  1755. #define GetEnvironmentStringsA GetEnvironmentStrings
  1756. #endif // !UNICODE
  1757. WINBASEAPI
  1758. BOOL
  1759. WINAPI
  1760. FreeEnvironmentStrings%(
  1761. IN LPTSTR%
  1762. );
  1763. WINBASEAPI
  1764. VOID
  1765. WINAPI
  1766. RaiseException(
  1767. IN DWORD dwExceptionCode,
  1768. IN DWORD dwExceptionFlags,
  1769. IN DWORD nNumberOfArguments,
  1770. IN CONST ULONG_PTR *lpArguments
  1771. );
  1772. WINBASEAPI
  1773. LONG
  1774. WINAPI
  1775. UnhandledExceptionFilter(
  1776. IN struct _EXCEPTION_POINTERS *ExceptionInfo
  1777. );
  1778. typedef LONG (WINAPI *PTOP_LEVEL_EXCEPTION_FILTER)(
  1779. struct _EXCEPTION_POINTERS *ExceptionInfo
  1780. );
  1781. typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER;
  1782. WINBASEAPI
  1783. LPTOP_LEVEL_EXCEPTION_FILTER
  1784. WINAPI
  1785. SetUnhandledExceptionFilter(
  1786. IN LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter
  1787. );
  1788. ;begin_sur
  1789. WINBASEAPI
  1790. LPVOID
  1791. WINAPI
  1792. CreateFiber(
  1793. IN SIZE_T dwStackSize,
  1794. IN LPFIBER_START_ROUTINE lpStartAddress,
  1795. IN LPVOID lpParameter
  1796. );
  1797. WINBASEAPI
  1798. LPVOID
  1799. WINAPI
  1800. CreateFiberEx(
  1801. SIZE_T dwStackCommitSize,
  1802. SIZE_T dwStackReserveSize,
  1803. DWORD dwFlags,
  1804. LPFIBER_START_ROUTINE lpStartAddress,
  1805. LPVOID lpParameter
  1806. );
  1807. WINBASEAPI
  1808. VOID
  1809. WINAPI
  1810. DeleteFiber(
  1811. IN LPVOID lpFiber
  1812. );
  1813. WINBASEAPI
  1814. LPVOID
  1815. WINAPI
  1816. ConvertThreadToFiber(
  1817. IN LPVOID lpParameter
  1818. );
  1819. WINBASEAPI
  1820. BOOL
  1821. WINAPI
  1822. ConvertFiberToThread(
  1823. VOID
  1824. );
  1825. WINBASEAPI
  1826. VOID
  1827. WINAPI
  1828. SwitchToFiber(
  1829. IN LPVOID lpFiber
  1830. );
  1831. WINBASEAPI
  1832. BOOL
  1833. WINAPI
  1834. SwitchToThread(
  1835. VOID
  1836. );
  1837. ;end_sur
  1838. WINBASEAPI
  1839. HANDLE
  1840. WINAPI
  1841. CreateThread(
  1842. IN LPSECURITY_ATTRIBUTES lpThreadAttributes,
  1843. IN SIZE_T dwStackSize,
  1844. IN LPTHREAD_START_ROUTINE lpStartAddress,
  1845. IN LPVOID lpParameter,
  1846. IN DWORD dwCreationFlags,
  1847. OUT LPDWORD lpThreadId
  1848. );
  1849. WINBASEAPI
  1850. HANDLE
  1851. WINAPI
  1852. CreateRemoteThread(
  1853. IN HANDLE hProcess,
  1854. IN LPSECURITY_ATTRIBUTES lpThreadAttributes,
  1855. IN SIZE_T dwStackSize,
  1856. IN LPTHREAD_START_ROUTINE lpStartAddress,
  1857. IN LPVOID lpParameter,
  1858. IN DWORD dwCreationFlags,
  1859. OUT LPDWORD lpThreadId
  1860. );
  1861. WINBASEAPI
  1862. HANDLE
  1863. WINAPI
  1864. GetCurrentThread(
  1865. VOID
  1866. );
  1867. WINBASEAPI
  1868. DWORD
  1869. WINAPI
  1870. GetCurrentThreadId(
  1871. VOID
  1872. );
  1873. WINBASEAPI
  1874. DWORD_PTR
  1875. WINAPI
  1876. SetThreadAffinityMask(
  1877. IN HANDLE hThread,
  1878. IN DWORD_PTR dwThreadAffinityMask
  1879. );
  1880. ;begin_sur
  1881. WINBASEAPI
  1882. DWORD
  1883. WINAPI
  1884. SetThreadIdealProcessor(
  1885. IN HANDLE hThread,
  1886. IN DWORD dwIdealProcessor
  1887. );
  1888. ;end_sur
  1889. WINBASEAPI
  1890. BOOL
  1891. WINAPI
  1892. SetProcessPriorityBoost(
  1893. IN HANDLE hProcess,
  1894. IN BOOL bDisablePriorityBoost
  1895. );
  1896. WINBASEAPI
  1897. BOOL
  1898. WINAPI
  1899. GetProcessPriorityBoost(
  1900. IN HANDLE hProcess,
  1901. OUT PBOOL pDisablePriorityBoost
  1902. );
  1903. WINBASEAPI
  1904. BOOL
  1905. WINAPI
  1906. RequestWakeupLatency(
  1907. IN LATENCY_TIME latency
  1908. );
  1909. WINBASEAPI
  1910. BOOL
  1911. WINAPI
  1912. IsSystemResumeAutomatic(
  1913. VOID
  1914. );
  1915. WINBASEAPI
  1916. HANDLE
  1917. WINAPI
  1918. OpenThread(
  1919. DWORD dwDesiredAccess,
  1920. BOOL bInheritHandle,
  1921. DWORD dwThreadId
  1922. );
  1923. WINBASEAPI
  1924. BOOL
  1925. WINAPI
  1926. SetThreadPriority(
  1927. IN HANDLE hThread,
  1928. IN int nPriority
  1929. );
  1930. WINBASEAPI
  1931. BOOL
  1932. WINAPI
  1933. SetThreadPriorityBoost(
  1934. IN HANDLE hThread,
  1935. IN BOOL bDisablePriorityBoost
  1936. );
  1937. WINBASEAPI
  1938. BOOL
  1939. WINAPI
  1940. GetThreadPriorityBoost(
  1941. IN HANDLE hThread,
  1942. OUT PBOOL pDisablePriorityBoost
  1943. );
  1944. WINBASEAPI
  1945. int
  1946. WINAPI
  1947. GetThreadPriority(
  1948. IN HANDLE hThread
  1949. );
  1950. WINBASEAPI
  1951. BOOL
  1952. WINAPI
  1953. GetThreadTimes(
  1954. IN HANDLE hThread,
  1955. OUT LPFILETIME lpCreationTime,
  1956. OUT LPFILETIME lpExitTime,
  1957. OUT LPFILETIME lpKernelTime,
  1958. OUT LPFILETIME lpUserTime
  1959. );
  1960. #if _WIN32_WINNT >= 0x0501
  1961. WINBASEAPI
  1962. BOOL
  1963. WINAPI
  1964. GetThreadIOPendingFlag(
  1965. IN HANDLE hThread,
  1966. OUT PBOOL lpIOIsPending
  1967. );
  1968. #endif // (_WIN32_WINNT >= 0x0501)
  1969. WINBASEAPI
  1970. DECLSPEC_NORETURN
  1971. VOID
  1972. WINAPI
  1973. ExitThread(
  1974. IN DWORD dwExitCode
  1975. );
  1976. WINBASEAPI
  1977. BOOL
  1978. WINAPI
  1979. TerminateThread(
  1980. IN OUT HANDLE hThread,
  1981. IN DWORD dwExitCode
  1982. );
  1983. WINBASEAPI
  1984. BOOL
  1985. WINAPI
  1986. GetExitCodeThread(
  1987. IN HANDLE hThread,
  1988. OUT LPDWORD lpExitCode
  1989. );
  1990. WINBASEAPI
  1991. BOOL
  1992. WINAPI
  1993. GetThreadSelectorEntry(
  1994. IN HANDLE hThread,
  1995. IN DWORD dwSelector,
  1996. OUT LPLDT_ENTRY lpSelectorEntry
  1997. );
  1998. WINBASEAPI
  1999. EXECUTION_STATE
  2000. WINAPI
  2001. SetThreadExecutionState(
  2002. IN EXECUTION_STATE esFlags
  2003. );
  2004. WINBASEAPI
  2005. DWORD
  2006. WINAPI
  2007. GetLastError(
  2008. VOID
  2009. );
  2010. WINBASEAPI
  2011. VOID
  2012. WINAPI
  2013. SetLastError(
  2014. IN DWORD dwErrCode
  2015. );
  2016. #if !defined(RC_INVOKED) // RC warns because "WINBASE_DECLARE_RESTORE_LAST_ERROR" is a bit long.
  2017. //#if _WIN32_WINNT >= 0x0501 || defined(WINBASE_DECLARE_RESTORE_LAST_ERROR)
  2018. #if defined(WINBASE_DECLARE_RESTORE_LAST_ERROR)
  2019. WINBASEAPI
  2020. VOID
  2021. WINAPI
  2022. RestoreLastError(
  2023. IN DWORD dwErrCode
  2024. );
  2025. typedef VOID (WINAPI* PRESTORE_LAST_ERROR)(DWORD);
  2026. #define RESTORE_LAST_ERROR_NAME_A "RestoreLastError"
  2027. #define RESTORE_LAST_ERROR_NAME_W L"RestoreLastError"
  2028. #define RESTORE_LAST_ERROR_NAME TEXT("RestoreLastError")
  2029. #endif
  2030. #endif
  2031. #define HasOverlappedIoCompleted(lpOverlapped) ((lpOverlapped)->Internal != STATUS_PENDING)
  2032. WINBASEAPI
  2033. BOOL
  2034. WINAPI
  2035. GetOverlappedResult(
  2036. IN HANDLE hFile,
  2037. IN LPOVERLAPPED lpOverlapped,
  2038. OUT LPDWORD lpNumberOfBytesTransferred,
  2039. IN BOOL bWait
  2040. );
  2041. WINBASEAPI
  2042. HANDLE
  2043. WINAPI
  2044. CreateIoCompletionPort(
  2045. IN HANDLE FileHandle,
  2046. IN HANDLE ExistingCompletionPort,
  2047. IN ULONG_PTR CompletionKey,
  2048. IN DWORD NumberOfConcurrentThreads
  2049. );
  2050. WINBASEAPI
  2051. BOOL
  2052. WINAPI
  2053. GetQueuedCompletionStatus(
  2054. IN HANDLE CompletionPort,
  2055. OUT LPDWORD lpNumberOfBytesTransferred,
  2056. OUT PULONG_PTR lpCompletionKey,
  2057. OUT LPOVERLAPPED *lpOverlapped,
  2058. IN DWORD dwMilliseconds
  2059. );
  2060. WINBASEAPI
  2061. BOOL
  2062. WINAPI
  2063. PostQueuedCompletionStatus(
  2064. IN HANDLE CompletionPort,
  2065. IN DWORD dwNumberOfBytesTransferred,
  2066. IN ULONG_PTR dwCompletionKey,
  2067. IN LPOVERLAPPED lpOverlapped
  2068. );
  2069. #define SEM_FAILCRITICALERRORS 0x0001
  2070. #define SEM_NOGPFAULTERRORBOX 0x0002
  2071. #define SEM_NOALIGNMENTFAULTEXCEPT 0x0004
  2072. #define SEM_NOOPENFILEERRORBOX 0x8000
  2073. WINBASEAPI
  2074. UINT
  2075. WINAPI
  2076. SetErrorMode(
  2077. IN UINT uMode
  2078. );
  2079. WINBASEAPI
  2080. BOOL
  2081. WINAPI
  2082. ReadProcessMemory(
  2083. IN HANDLE hProcess,
  2084. IN LPCVOID lpBaseAddress,
  2085. OUT LPVOID lpBuffer,
  2086. IN SIZE_T nSize,
  2087. OUT SIZE_T * lpNumberOfBytesRead
  2088. );
  2089. WINBASEAPI
  2090. BOOL
  2091. WINAPI
  2092. WriteProcessMemory(
  2093. IN HANDLE hProcess,
  2094. IN LPVOID lpBaseAddress,
  2095. IN LPCVOID lpBuffer,
  2096. IN SIZE_T nSize,
  2097. OUT SIZE_T * lpNumberOfBytesWritten
  2098. );
  2099. #if !defined(MIDL_PASS)
  2100. WINBASEAPI
  2101. BOOL
  2102. WINAPI
  2103. GetThreadContext(
  2104. IN HANDLE hThread,
  2105. IN OUT LPCONTEXT lpContext
  2106. );
  2107. WINBASEAPI
  2108. BOOL
  2109. WINAPI
  2110. SetThreadContext(
  2111. IN HANDLE hThread,
  2112. IN CONST CONTEXT *lpContext
  2113. );
  2114. #endif
  2115. WINBASEAPI
  2116. DWORD
  2117. WINAPI
  2118. SuspendThread(
  2119. IN HANDLE hThread
  2120. );
  2121. WINBASEAPI
  2122. DWORD
  2123. WINAPI
  2124. ResumeThread(
  2125. IN HANDLE hThread
  2126. );
  2127. ;begin_public
  2128. #if(_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)
  2129. ;end_public
  2130. typedef
  2131. VOID
  2132. (APIENTRY *PAPCFUNC)(
  2133. ULONG_PTR dwParam
  2134. );
  2135. WINBASEAPI
  2136. DWORD
  2137. WINAPI
  2138. QueueUserAPC(
  2139. IN PAPCFUNC pfnAPC,
  2140. IN HANDLE hThread,
  2141. IN ULONG_PTR dwData
  2142. );
  2143. ;begin_public
  2144. #endif /* _WIN32_WINNT >= 0x0400 || _WIN32_WINDOWS > 0x0400 */
  2145. ;end_public
  2146. #if (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)
  2147. WINBASEAPI
  2148. BOOL
  2149. WINAPI
  2150. IsDebuggerPresent(
  2151. VOID
  2152. );
  2153. #endif
  2154. #if _WIN32_WINNT >= 0x0501
  2155. WINBASEAPI
  2156. BOOL
  2157. WINAPI
  2158. CheckRemoteDebuggerPresent(
  2159. IN HANDLE hProcess,
  2160. OUT PBOOL pbDebuggerPresent
  2161. );
  2162. #endif // (_WIN32_WINNT >= 0x0501)
  2163. WINBASEAPI
  2164. VOID
  2165. WINAPI
  2166. DebugBreak(
  2167. VOID
  2168. );
  2169. WINBASEAPI
  2170. BOOL
  2171. WINAPI
  2172. WaitForDebugEvent(
  2173. IN LPDEBUG_EVENT lpDebugEvent,
  2174. IN DWORD dwMilliseconds
  2175. );
  2176. WINBASEAPI
  2177. BOOL
  2178. WINAPI
  2179. ContinueDebugEvent(
  2180. IN DWORD dwProcessId,
  2181. IN DWORD dwThreadId,
  2182. IN DWORD dwContinueStatus
  2183. );
  2184. WINBASEAPI
  2185. BOOL
  2186. WINAPI
  2187. DebugActiveProcess(
  2188. IN DWORD dwProcessId
  2189. );
  2190. WINBASEAPI
  2191. BOOL
  2192. WINAPI
  2193. DebugActiveProcessStop(
  2194. IN DWORD dwProcessId
  2195. );
  2196. WINBASEAPI
  2197. BOOL
  2198. WINAPI
  2199. DebugSetProcessKillOnExit(
  2200. IN BOOL KillOnExit
  2201. );
  2202. WINBASEAPI
  2203. BOOL
  2204. WINAPI
  2205. DebugBreakProcess (
  2206. IN HANDLE Process
  2207. );
  2208. WINBASEAPI
  2209. VOID
  2210. WINAPI
  2211. InitializeCriticalSection(
  2212. OUT LPCRITICAL_SECTION lpCriticalSection
  2213. );
  2214. WINBASEAPI
  2215. VOID
  2216. WINAPI
  2217. EnterCriticalSection(
  2218. IN OUT LPCRITICAL_SECTION lpCriticalSection
  2219. );
  2220. WINBASEAPI
  2221. VOID
  2222. WINAPI
  2223. LeaveCriticalSection(
  2224. IN OUT LPCRITICAL_SECTION lpCriticalSection
  2225. );
  2226. #if (_WIN32_WINNT >= 0x0403)
  2227. WINBASEAPI
  2228. BOOL
  2229. WINAPI
  2230. InitializeCriticalSectionAndSpinCount(
  2231. IN OUT LPCRITICAL_SECTION lpCriticalSection,
  2232. IN DWORD dwSpinCount
  2233. );
  2234. WINBASEAPI
  2235. DWORD
  2236. WINAPI
  2237. SetCriticalSectionSpinCount(
  2238. IN OUT LPCRITICAL_SECTION lpCriticalSection,
  2239. IN DWORD dwSpinCount
  2240. );
  2241. #endif
  2242. ;begin_sur
  2243. WINBASEAPI
  2244. BOOL
  2245. WINAPI
  2246. TryEnterCriticalSection(
  2247. IN OUT LPCRITICAL_SECTION lpCriticalSection
  2248. );
  2249. ;end_sur
  2250. WINBASEAPI
  2251. VOID
  2252. WINAPI
  2253. DeleteCriticalSection(
  2254. IN OUT LPCRITICAL_SECTION lpCriticalSection
  2255. );
  2256. WINBASEAPI
  2257. BOOL
  2258. WINAPI
  2259. SetEvent(
  2260. IN HANDLE hEvent
  2261. );
  2262. WINBASEAPI
  2263. BOOL
  2264. WINAPI
  2265. ResetEvent(
  2266. IN HANDLE hEvent
  2267. );
  2268. WINBASEAPI
  2269. BOOL
  2270. WINAPI
  2271. PulseEvent(
  2272. IN HANDLE hEvent
  2273. );
  2274. WINBASEAPI
  2275. BOOL
  2276. WINAPI
  2277. ReleaseSemaphore(
  2278. IN HANDLE hSemaphore,
  2279. IN LONG lReleaseCount,
  2280. OUT LPLONG lpPreviousCount
  2281. );
  2282. WINBASEAPI
  2283. BOOL
  2284. WINAPI
  2285. ReleaseMutex(
  2286. IN HANDLE hMutex
  2287. );
  2288. WINBASEAPI
  2289. DWORD
  2290. WINAPI
  2291. WaitForSingleObject(
  2292. IN HANDLE hHandle,
  2293. IN DWORD dwMilliseconds
  2294. );
  2295. WINBASEAPI
  2296. DWORD
  2297. WINAPI
  2298. WaitForMultipleObjects(
  2299. IN DWORD nCount,
  2300. IN CONST HANDLE *lpHandles,
  2301. IN BOOL bWaitAll,
  2302. IN DWORD dwMilliseconds
  2303. );
  2304. WINBASEAPI
  2305. VOID
  2306. WINAPI
  2307. Sleep(
  2308. IN DWORD dwMilliseconds
  2309. );
  2310. WINBASEAPI
  2311. HGLOBAL
  2312. WINAPI
  2313. LoadResource(
  2314. IN HMODULE hModule, ;public_NT
  2315. IN HINSTANCE hModule, ;public_chicago
  2316. IN HRSRC hResInfo
  2317. );
  2318. WINBASEAPI
  2319. DWORD
  2320. WINAPI
  2321. SizeofResource(
  2322. IN HMODULE hModule, ;public_NT
  2323. IN HINSTANCE hModule, ;public_chicago
  2324. IN HRSRC hResInfo
  2325. );
  2326. WINBASEAPI
  2327. ATOM
  2328. WINAPI
  2329. GlobalDeleteAtom(
  2330. IN ATOM nAtom
  2331. );
  2332. WINBASEAPI
  2333. BOOL
  2334. WINAPI
  2335. InitAtomTable(
  2336. IN DWORD nSize
  2337. );
  2338. WINBASEAPI
  2339. ATOM
  2340. WINAPI
  2341. DeleteAtom(
  2342. IN ATOM nAtom
  2343. );
  2344. WINBASEAPI
  2345. UINT
  2346. WINAPI
  2347. SetHandleCount(
  2348. IN UINT uNumber
  2349. );
  2350. WINBASEAPI
  2351. DWORD
  2352. WINAPI
  2353. GetLogicalDrives(
  2354. VOID
  2355. );
  2356. WINBASEAPI
  2357. BOOL
  2358. WINAPI
  2359. LockFile(
  2360. IN HANDLE hFile,
  2361. IN DWORD dwFileOffsetLow,
  2362. IN DWORD dwFileOffsetHigh,
  2363. IN DWORD nNumberOfBytesToLockLow,
  2364. IN DWORD nNumberOfBytesToLockHigh
  2365. );
  2366. WINBASEAPI
  2367. BOOL
  2368. WINAPI
  2369. UnlockFile(
  2370. IN HANDLE hFile,
  2371. IN DWORD dwFileOffsetLow,
  2372. IN DWORD dwFileOffsetHigh,
  2373. IN DWORD nNumberOfBytesToUnlockLow,
  2374. IN DWORD nNumberOfBytesToUnlockHigh
  2375. );
  2376. WINBASEAPI
  2377. BOOL
  2378. WINAPI
  2379. LockFileEx(
  2380. IN HANDLE hFile,
  2381. IN DWORD dwFlags,
  2382. IN DWORD dwReserved,
  2383. IN DWORD nNumberOfBytesToLockLow,
  2384. IN DWORD nNumberOfBytesToLockHigh,
  2385. IN LPOVERLAPPED lpOverlapped
  2386. );
  2387. #define LOCKFILE_FAIL_IMMEDIATELY 0x00000001
  2388. #define LOCKFILE_EXCLUSIVE_LOCK 0x00000002
  2389. WINBASEAPI
  2390. BOOL
  2391. WINAPI
  2392. UnlockFileEx(
  2393. IN HANDLE hFile,
  2394. IN DWORD dwReserved,
  2395. IN DWORD nNumberOfBytesToUnlockLow,
  2396. IN DWORD nNumberOfBytesToUnlockHigh,
  2397. IN LPOVERLAPPED lpOverlapped
  2398. );
  2399. typedef struct _BY_HANDLE_FILE_INFORMATION {
  2400. DWORD dwFileAttributes;
  2401. FILETIME ftCreationTime;
  2402. FILETIME ftLastAccessTime;
  2403. FILETIME ftLastWriteTime;
  2404. DWORD dwVolumeSerialNumber;
  2405. DWORD nFileSizeHigh;
  2406. DWORD nFileSizeLow;
  2407. DWORD nNumberOfLinks;
  2408. DWORD nFileIndexHigh;
  2409. DWORD nFileIndexLow;
  2410. } BY_HANDLE_FILE_INFORMATION, *PBY_HANDLE_FILE_INFORMATION, *LPBY_HANDLE_FILE_INFORMATION;
  2411. WINBASEAPI
  2412. BOOL
  2413. WINAPI
  2414. GetFileInformationByHandle(
  2415. IN HANDLE hFile,
  2416. OUT LPBY_HANDLE_FILE_INFORMATION lpFileInformation
  2417. );
  2418. WINBASEAPI
  2419. DWORD
  2420. WINAPI
  2421. GetFileType(
  2422. IN HANDLE hFile
  2423. );
  2424. WINBASEAPI
  2425. DWORD
  2426. WINAPI
  2427. GetFileSize(
  2428. IN HANDLE hFile,
  2429. OUT LPDWORD lpFileSizeHigh
  2430. );
  2431. WINBASEAPI
  2432. BOOL
  2433. WINAPI
  2434. GetFileSizeEx(
  2435. HANDLE hFile,
  2436. PLARGE_INTEGER lpFileSize
  2437. );
  2438. WINBASEAPI
  2439. HANDLE
  2440. WINAPI
  2441. GetStdHandle(
  2442. IN DWORD nStdHandle
  2443. );
  2444. WINBASEAPI
  2445. BOOL
  2446. WINAPI
  2447. SetStdHandle(
  2448. IN DWORD nStdHandle,
  2449. IN HANDLE hHandle
  2450. );
  2451. WINBASEAPI
  2452. BOOL
  2453. WINAPI
  2454. WriteFile(
  2455. IN HANDLE hFile,
  2456. IN LPCVOID lpBuffer,
  2457. IN DWORD nNumberOfBytesToWrite,
  2458. OUT LPDWORD lpNumberOfBytesWritten,
  2459. IN LPOVERLAPPED lpOverlapped
  2460. );
  2461. WINBASEAPI
  2462. BOOL
  2463. WINAPI
  2464. ReadFile(
  2465. IN HANDLE hFile,
  2466. OUT LPVOID lpBuffer,
  2467. IN DWORD nNumberOfBytesToRead,
  2468. OUT LPDWORD lpNumberOfBytesRead,
  2469. IN LPOVERLAPPED lpOverlapped
  2470. );
  2471. WINBASEAPI
  2472. BOOL
  2473. WINAPI
  2474. FlushFileBuffers(
  2475. IN HANDLE hFile
  2476. );
  2477. WINBASEAPI
  2478. BOOL
  2479. WINAPI
  2480. DeviceIoControl(
  2481. IN HANDLE hDevice,
  2482. IN DWORD dwIoControlCode,
  2483. IN LPVOID lpInBuffer,
  2484. IN DWORD nInBufferSize,
  2485. OUT LPVOID lpOutBuffer,
  2486. IN DWORD nOutBufferSize,
  2487. OUT LPDWORD lpBytesReturned,
  2488. IN LPOVERLAPPED lpOverlapped
  2489. );
  2490. WINBASEAPI
  2491. BOOL
  2492. WINAPI
  2493. RequestDeviceWakeup(
  2494. IN HANDLE hDevice
  2495. );
  2496. WINBASEAPI
  2497. BOOL
  2498. WINAPI
  2499. CancelDeviceWakeupRequest(
  2500. IN HANDLE hDevice
  2501. );
  2502. WINBASEAPI
  2503. BOOL
  2504. WINAPI
  2505. GetDevicePowerState(
  2506. IN HANDLE hDevice,
  2507. OUT BOOL *pfOn
  2508. );
  2509. WINBASEAPI
  2510. BOOL
  2511. WINAPI
  2512. SetMessageWaitingIndicator(
  2513. IN HANDLE hMsgIndicator,
  2514. IN ULONG ulMsgCount
  2515. );
  2516. WINBASEAPI
  2517. BOOL
  2518. WINAPI
  2519. SetEndOfFile(
  2520. IN HANDLE hFile
  2521. );
  2522. WINBASEAPI
  2523. DWORD
  2524. WINAPI
  2525. SetFilePointer(
  2526. IN HANDLE hFile,
  2527. IN LONG lDistanceToMove,
  2528. IN PLONG lpDistanceToMoveHigh,
  2529. IN DWORD dwMoveMethod
  2530. );
  2531. WINBASEAPI
  2532. BOOL
  2533. WINAPI
  2534. SetFilePointerEx(
  2535. HANDLE hFile,
  2536. LARGE_INTEGER liDistanceToMove,
  2537. PLARGE_INTEGER lpNewFilePointer,
  2538. DWORD dwMoveMethod
  2539. );
  2540. #define HFINDFILE HANDLE // ;Internal
  2541. #define INVALID_HFINDFILE ((HFINDFILE)-1) // ;Internal
  2542. WINBASEAPI
  2543. BOOL
  2544. WINAPI
  2545. FindClose(
  2546. IN OUT HANDLE hFindFile
  2547. );
  2548. WINBASEAPI
  2549. BOOL
  2550. WINAPI
  2551. GetFileTime(
  2552. IN HANDLE hFile,
  2553. OUT LPFILETIME lpCreationTime,
  2554. OUT LPFILETIME lpLastAccessTime,
  2555. OUT LPFILETIME lpLastWriteTime
  2556. );
  2557. WINBASEAPI
  2558. BOOL
  2559. WINAPI
  2560. SetFileTime(
  2561. IN HANDLE hFile,
  2562. IN CONST FILETIME *lpCreationTime,
  2563. IN CONST FILETIME *lpLastAccessTime,
  2564. IN CONST FILETIME *lpLastWriteTime
  2565. );
  2566. WINBASEAPI
  2567. BOOL
  2568. WINAPI
  2569. SetFileValidData(
  2570. IN HANDLE hFile,
  2571. IN LONGLONG ValidDataLength
  2572. );
  2573. WINBASEAPI
  2574. BOOL
  2575. WINAPI
  2576. SetFileShortName%(
  2577. IN HANDLE hFile,
  2578. IN LPCTSTR% lpShortName
  2579. );
  2580. WINBASEAPI
  2581. BOOL
  2582. WINAPI
  2583. CloseHandle(
  2584. IN OUT HANDLE hObject
  2585. );
  2586. WINBASEAPI
  2587. BOOL
  2588. WINAPI
  2589. DuplicateHandle(
  2590. IN HANDLE hSourceProcessHandle,
  2591. IN HANDLE hSourceHandle,
  2592. IN HANDLE hTargetProcessHandle,
  2593. OUT LPHANDLE lpTargetHandle,
  2594. IN DWORD dwDesiredAccess,
  2595. IN BOOL bInheritHandle,
  2596. IN DWORD dwOptions
  2597. );
  2598. WINBASEAPI
  2599. BOOL
  2600. WINAPI
  2601. GetHandleInformation(
  2602. IN HANDLE hObject,
  2603. OUT LPDWORD lpdwFlags
  2604. );
  2605. WINBASEAPI
  2606. BOOL
  2607. WINAPI
  2608. SetHandleInformation(
  2609. IN HANDLE hObject,
  2610. IN DWORD dwMask,
  2611. IN DWORD dwFlags
  2612. );
  2613. #define HANDLE_FLAG_INHERIT 0x00000001
  2614. #define HANDLE_FLAG_PROTECT_FROM_CLOSE 0x00000002
  2615. #define HINSTANCE_ERROR 32
  2616. WINBASEAPI
  2617. DWORD
  2618. WINAPI
  2619. LoadModule(
  2620. IN LPCSTR lpModuleName,
  2621. IN LPVOID lpParameterBlock
  2622. );
  2623. WINBASEAPI
  2624. UINT
  2625. WINAPI
  2626. WinExec(
  2627. IN LPCSTR lpCmdLine,
  2628. IN UINT uCmdShow
  2629. );
  2630. typedef DWORD (*PFNWAITFORINPUTIDLE)(HANDLE hProcess, DWORD dwMilliseconds); ;internal
  2631. VOID RegisterWaitForInputIdle(PFNWAITFORINPUTIDLE); ;internal
  2632. ;internal
  2633. WINBASEAPI
  2634. BOOL
  2635. WINAPI
  2636. ClearCommBreak(
  2637. IN HANDLE hFile
  2638. );
  2639. WINBASEAPI
  2640. BOOL
  2641. WINAPI
  2642. ClearCommError(
  2643. IN HANDLE hFile,
  2644. OUT LPDWORD lpErrors,
  2645. OUT LPCOMSTAT lpStat
  2646. );
  2647. WINBASEAPI
  2648. BOOL
  2649. WINAPI
  2650. SetupComm(
  2651. IN HANDLE hFile,
  2652. IN DWORD dwInQueue,
  2653. IN DWORD dwOutQueue
  2654. );
  2655. WINBASEAPI
  2656. BOOL
  2657. WINAPI
  2658. EscapeCommFunction(
  2659. IN HANDLE hFile,
  2660. IN DWORD dwFunc
  2661. );
  2662. WINBASEAPI
  2663. BOOL
  2664. WINAPI
  2665. GetCommConfig(
  2666. IN HANDLE hCommDev,
  2667. OUT LPCOMMCONFIG lpCC,
  2668. IN OUT LPDWORD lpdwSize
  2669. );
  2670. WINBASEAPI
  2671. BOOL
  2672. WINAPI
  2673. GetCommMask(
  2674. IN HANDLE hFile,
  2675. OUT LPDWORD lpEvtMask
  2676. );
  2677. WINBASEAPI
  2678. BOOL
  2679. WINAPI
  2680. GetCommProperties(
  2681. IN HANDLE hFile,
  2682. OUT LPCOMMPROP lpCommProp
  2683. );
  2684. WINBASEAPI
  2685. BOOL
  2686. WINAPI
  2687. GetCommModemStatus(
  2688. IN HANDLE hFile,
  2689. OUT LPDWORD lpModemStat
  2690. );
  2691. WINBASEAPI
  2692. BOOL
  2693. WINAPI
  2694. GetCommState(
  2695. IN HANDLE hFile,
  2696. OUT LPDCB lpDCB
  2697. );
  2698. WINBASEAPI
  2699. BOOL
  2700. WINAPI
  2701. GetCommTimeouts(
  2702. IN HANDLE hFile,
  2703. OUT LPCOMMTIMEOUTS lpCommTimeouts
  2704. );
  2705. WINBASEAPI
  2706. BOOL
  2707. WINAPI
  2708. PurgeComm(
  2709. IN HANDLE hFile,
  2710. IN DWORD dwFlags
  2711. );
  2712. WINBASEAPI
  2713. BOOL
  2714. WINAPI
  2715. SetCommBreak(
  2716. IN HANDLE hFile
  2717. );
  2718. WINBASEAPI
  2719. BOOL
  2720. WINAPI
  2721. SetCommConfig(
  2722. IN HANDLE hCommDev,
  2723. IN LPCOMMCONFIG lpCC,
  2724. IN DWORD dwSize
  2725. );
  2726. WINBASEAPI
  2727. BOOL
  2728. WINAPI
  2729. SetCommMask(
  2730. IN HANDLE hFile,
  2731. IN DWORD dwEvtMask
  2732. );
  2733. WINBASEAPI
  2734. BOOL
  2735. WINAPI
  2736. SetCommState(
  2737. IN HANDLE hFile,
  2738. IN LPDCB lpDCB
  2739. );
  2740. WINBASEAPI
  2741. BOOL
  2742. WINAPI
  2743. SetCommTimeouts(
  2744. IN HANDLE hFile,
  2745. IN LPCOMMTIMEOUTS lpCommTimeouts
  2746. );
  2747. WINBASEAPI
  2748. BOOL
  2749. WINAPI
  2750. TransmitCommChar(
  2751. IN HANDLE hFile,
  2752. IN char cChar
  2753. );
  2754. WINBASEAPI
  2755. BOOL
  2756. WINAPI
  2757. WaitCommEvent(
  2758. IN HANDLE hFile,
  2759. OUT LPDWORD lpEvtMask,
  2760. IN LPOVERLAPPED lpOverlapped
  2761. );
  2762. WINBASEAPI
  2763. DWORD
  2764. WINAPI
  2765. SetTapePosition(
  2766. IN HANDLE hDevice,
  2767. IN DWORD dwPositionMethod,
  2768. IN DWORD dwPartition,
  2769. IN DWORD dwOffsetLow,
  2770. IN DWORD dwOffsetHigh,
  2771. IN BOOL bImmediate
  2772. );
  2773. WINBASEAPI
  2774. DWORD
  2775. WINAPI
  2776. GetTapePosition(
  2777. IN HANDLE hDevice,
  2778. IN DWORD dwPositionType,
  2779. OUT LPDWORD lpdwPartition,
  2780. OUT LPDWORD lpdwOffsetLow,
  2781. OUT LPDWORD lpdwOffsetHigh
  2782. );
  2783. WINBASEAPI
  2784. DWORD
  2785. WINAPI
  2786. PrepareTape(
  2787. IN HANDLE hDevice,
  2788. IN DWORD dwOperation,
  2789. IN BOOL bImmediate
  2790. );
  2791. WINBASEAPI
  2792. DWORD
  2793. WINAPI
  2794. EraseTape(
  2795. IN HANDLE hDevice,
  2796. IN DWORD dwEraseType,
  2797. IN BOOL bImmediate
  2798. );
  2799. WINBASEAPI
  2800. DWORD
  2801. WINAPI
  2802. CreateTapePartition(
  2803. IN HANDLE hDevice,
  2804. IN DWORD dwPartitionMethod,
  2805. IN DWORD dwCount,
  2806. IN DWORD dwSize
  2807. );
  2808. WINBASEAPI
  2809. DWORD
  2810. WINAPI
  2811. WriteTapemark(
  2812. IN HANDLE hDevice,
  2813. IN DWORD dwTapemarkType,
  2814. IN DWORD dwTapemarkCount,
  2815. IN BOOL bImmediate
  2816. );
  2817. WINBASEAPI
  2818. DWORD
  2819. WINAPI
  2820. GetTapeStatus(
  2821. IN HANDLE hDevice
  2822. );
  2823. WINBASEAPI
  2824. DWORD
  2825. WINAPI
  2826. GetTapeParameters(
  2827. IN HANDLE hDevice,
  2828. IN DWORD dwOperation,
  2829. OUT LPDWORD lpdwSize,
  2830. OUT LPVOID lpTapeInformation
  2831. );
  2832. #define GET_TAPE_MEDIA_INFORMATION 0
  2833. #define GET_TAPE_DRIVE_INFORMATION 1
  2834. WINBASEAPI
  2835. DWORD
  2836. WINAPI
  2837. SetTapeParameters(
  2838. IN HANDLE hDevice,
  2839. IN DWORD dwOperation,
  2840. IN LPVOID lpTapeInformation
  2841. );
  2842. #define SET_TAPE_MEDIA_INFORMATION 0
  2843. #define SET_TAPE_DRIVE_INFORMATION 1
  2844. WINBASEAPI
  2845. BOOL
  2846. WINAPI
  2847. Beep(
  2848. IN DWORD dwFreq,
  2849. IN DWORD dwDuration
  2850. );
  2851. WINBASEAPI
  2852. int
  2853. WINAPI
  2854. MulDiv(
  2855. IN int nNumber,
  2856. IN int nNumerator,
  2857. IN int nDenominator
  2858. );
  2859. WINBASEAPI
  2860. VOID
  2861. WINAPI
  2862. GetSystemTime(
  2863. OUT LPSYSTEMTIME lpSystemTime
  2864. );
  2865. WINBASEAPI
  2866. VOID
  2867. WINAPI
  2868. GetSystemTimeAsFileTime(
  2869. OUT LPFILETIME lpSystemTimeAsFileTime
  2870. );
  2871. WINBASEAPI
  2872. BOOL
  2873. WINAPI
  2874. SetSystemTime(
  2875. IN CONST SYSTEMTIME *lpSystemTime
  2876. );
  2877. WINBASEAPI
  2878. VOID
  2879. WINAPI
  2880. GetLocalTime(
  2881. OUT LPSYSTEMTIME lpSystemTime
  2882. );
  2883. WINBASEAPI
  2884. BOOL
  2885. WINAPI
  2886. SetLocalTime(
  2887. IN CONST SYSTEMTIME *lpSystemTime
  2888. );
  2889. WINBASEAPI
  2890. VOID
  2891. WINAPI
  2892. GetSystemInfo(
  2893. OUT LPSYSTEM_INFO lpSystemInfo
  2894. );
  2895. #if _WIN32_WINNT >= 0x0501
  2896. WINBASEAPI
  2897. BOOL
  2898. WINAPI
  2899. GetSystemRegistryQuota(
  2900. OUT PDWORD pdwQuotaAllowed,
  2901. OUT PDWORD pdwQuotaUsed
  2902. );
  2903. BOOL
  2904. WINAPI
  2905. GetSystemTimes(
  2906. LPFILETIME lpIdleTime,
  2907. LPFILETIME lpKernelTime,
  2908. LPFILETIME lpUserTime
  2909. );
  2910. #endif // (_WIN32_WINNT >= 0x0501)
  2911. #if _WIN32_WINNT >= 0x0501
  2912. WINBASEAPI
  2913. VOID
  2914. WINAPI
  2915. GetNativeSystemInfo(
  2916. OUT LPSYSTEM_INFO lpSystemInfo
  2917. );
  2918. #endif
  2919. WINBASEAPI
  2920. BOOL
  2921. WINAPI
  2922. IsProcessorFeaturePresent(
  2923. IN DWORD ProcessorFeature
  2924. );
  2925. typedef struct _TIME_ZONE_INFORMATION {
  2926. LONG Bias;
  2927. WCHAR StandardName[ 32 ];
  2928. SYSTEMTIME StandardDate;
  2929. LONG StandardBias;
  2930. WCHAR DaylightName[ 32 ];
  2931. SYSTEMTIME DaylightDate;
  2932. LONG DaylightBias;
  2933. } TIME_ZONE_INFORMATION, *PTIME_ZONE_INFORMATION, *LPTIME_ZONE_INFORMATION;
  2934. WINBASEAPI
  2935. BOOL
  2936. WINAPI
  2937. SystemTimeToTzSpecificLocalTime(
  2938. IN LPTIME_ZONE_INFORMATION lpTimeZoneInformation,
  2939. IN LPSYSTEMTIME lpUniversalTime,
  2940. OUT LPSYSTEMTIME lpLocalTime
  2941. );
  2942. WINBASEAPI
  2943. BOOL
  2944. WINAPI
  2945. TzSpecificLocalTimeToSystemTime(
  2946. IN LPTIME_ZONE_INFORMATION lpTimeZoneInformation,
  2947. IN LPSYSTEMTIME lpLocalTime,
  2948. OUT LPSYSTEMTIME lpUniversalTime
  2949. );
  2950. WINBASEAPI
  2951. DWORD
  2952. WINAPI
  2953. GetTimeZoneInformation(
  2954. OUT LPTIME_ZONE_INFORMATION lpTimeZoneInformation
  2955. );
  2956. WINBASEAPI
  2957. BOOL
  2958. WINAPI
  2959. SetTimeZoneInformation(
  2960. IN CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation
  2961. );
  2962. //
  2963. // Routines to convert back and forth between system time and file time
  2964. //
  2965. WINBASEAPI
  2966. BOOL
  2967. WINAPI
  2968. SystemTimeToFileTime(
  2969. IN CONST SYSTEMTIME *lpSystemTime,
  2970. OUT LPFILETIME lpFileTime
  2971. );
  2972. WINBASEAPI
  2973. BOOL
  2974. WINAPI
  2975. FileTimeToLocalFileTime(
  2976. IN CONST FILETIME *lpFileTime,
  2977. OUT LPFILETIME lpLocalFileTime
  2978. );
  2979. WINBASEAPI
  2980. BOOL
  2981. WINAPI
  2982. LocalFileTimeToFileTime(
  2983. IN CONST FILETIME *lpLocalFileTime,
  2984. OUT LPFILETIME lpFileTime
  2985. );
  2986. WINBASEAPI
  2987. BOOL
  2988. WINAPI
  2989. FileTimeToSystemTime(
  2990. IN CONST FILETIME *lpFileTime,
  2991. OUT LPSYSTEMTIME lpSystemTime
  2992. );
  2993. WINBASEAPI
  2994. LONG
  2995. WINAPI
  2996. CompareFileTime(
  2997. IN CONST FILETIME *lpFileTime1,
  2998. IN CONST FILETIME *lpFileTime2
  2999. );
  3000. WINBASEAPI
  3001. BOOL
  3002. WINAPI
  3003. FileTimeToDosDateTime(
  3004. IN CONST FILETIME *lpFileTime,
  3005. OUT LPWORD lpFatDate,
  3006. OUT LPWORD lpFatTime
  3007. );
  3008. WINBASEAPI
  3009. BOOL
  3010. WINAPI
  3011. DosDateTimeToFileTime(
  3012. IN WORD wFatDate,
  3013. IN WORD wFatTime,
  3014. OUT LPFILETIME lpFileTime
  3015. );
  3016. WINBASEAPI
  3017. DWORD
  3018. WINAPI
  3019. GetTickCount(
  3020. VOID
  3021. );
  3022. WINBASEAPI
  3023. BOOL
  3024. WINAPI
  3025. SetSystemTimeAdjustment(
  3026. IN DWORD dwTimeAdjustment,
  3027. IN BOOL bTimeAdjustmentDisabled
  3028. );
  3029. WINBASEAPI
  3030. BOOL
  3031. WINAPI
  3032. GetSystemTimeAdjustment(
  3033. OUT PDWORD lpTimeAdjustment,
  3034. OUT PDWORD lpTimeIncrement,
  3035. OUT PBOOL lpTimeAdjustmentDisabled
  3036. );
  3037. #if !defined(MIDL_PASS)
  3038. WINBASEAPI
  3039. DWORD
  3040. WINAPI
  3041. FormatMessage%(
  3042. IN DWORD dwFlags,
  3043. IN LPCVOID lpSource,
  3044. IN DWORD dwMessageId,
  3045. IN DWORD dwLanguageId,
  3046. OUT LPTSTR% lpBuffer,
  3047. IN DWORD nSize,
  3048. IN va_list *Arguments
  3049. );
  3050. #endif
  3051. #define FORMAT_MESSAGE_ALLOCATE_BUFFER 0x00000100
  3052. #define FORMAT_MESSAGE_IGNORE_INSERTS 0x00000200
  3053. #define FORMAT_MESSAGE_FROM_STRING 0x00000400
  3054. #define FORMAT_MESSAGE_FROM_HMODULE 0x00000800
  3055. #define FORMAT_MESSAGE_FROM_SYSTEM 0x00001000
  3056. #define FORMAT_MESSAGE_ARGUMENT_ARRAY 0x00002000
  3057. #define FORMAT_MESSAGE_MAX_WIDTH_MASK 0x000000FF
  3058. WINBASEAPI
  3059. BOOL
  3060. WINAPI
  3061. CreatePipe(
  3062. OUT PHANDLE hReadPipe,
  3063. OUT PHANDLE hWritePipe,
  3064. IN LPSECURITY_ATTRIBUTES lpPipeAttributes,
  3065. IN DWORD nSize
  3066. );
  3067. WINBASEAPI
  3068. BOOL
  3069. WINAPI
  3070. ConnectNamedPipe(
  3071. IN HANDLE hNamedPipe,
  3072. IN LPOVERLAPPED lpOverlapped
  3073. );
  3074. WINBASEAPI
  3075. BOOL
  3076. WINAPI
  3077. DisconnectNamedPipe(
  3078. IN HANDLE hNamedPipe
  3079. );
  3080. WINBASEAPI
  3081. BOOL
  3082. WINAPI
  3083. SetNamedPipeHandleState(
  3084. IN HANDLE hNamedPipe,
  3085. IN LPDWORD lpMode,
  3086. IN LPDWORD lpMaxCollectionCount,
  3087. IN LPDWORD lpCollectDataTimeout
  3088. );
  3089. WINBASEAPI
  3090. BOOL
  3091. WINAPI
  3092. GetNamedPipeInfo(
  3093. IN HANDLE hNamedPipe,
  3094. IN LPDWORD lpFlags,
  3095. OUT LPDWORD lpOutBufferSize,
  3096. OUT LPDWORD lpInBufferSize,
  3097. OUT LPDWORD lpMaxInstances
  3098. );
  3099. WINBASEAPI
  3100. BOOL
  3101. WINAPI
  3102. PeekNamedPipe(
  3103. IN HANDLE hNamedPipe,
  3104. OUT LPVOID lpBuffer,
  3105. IN DWORD nBufferSize,
  3106. OUT LPDWORD lpBytesRead,
  3107. OUT LPDWORD lpTotalBytesAvail,
  3108. OUT LPDWORD lpBytesLeftThisMessage
  3109. );
  3110. WINBASEAPI
  3111. BOOL
  3112. WINAPI
  3113. TransactNamedPipe(
  3114. IN HANDLE hNamedPipe,
  3115. IN LPVOID lpInBuffer,
  3116. IN DWORD nInBufferSize,
  3117. OUT LPVOID lpOutBuffer,
  3118. IN DWORD nOutBufferSize,
  3119. OUT LPDWORD lpBytesRead,
  3120. IN LPOVERLAPPED lpOverlapped
  3121. );
  3122. WINBASEAPI
  3123. HANDLE
  3124. WINAPI
  3125. CreateMailslot%(
  3126. IN LPCTSTR% lpName,
  3127. IN DWORD nMaxMessageSize,
  3128. IN DWORD lReadTimeout,
  3129. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes
  3130. );
  3131. WINBASEAPI
  3132. BOOL
  3133. WINAPI
  3134. GetMailslotInfo(
  3135. IN HANDLE hMailslot,
  3136. IN LPDWORD lpMaxMessageSize,
  3137. IN LPDWORD lpNextSize,
  3138. IN LPDWORD lpMessageCount,
  3139. IN LPDWORD lpReadTimeout
  3140. );
  3141. WINBASEAPI
  3142. BOOL
  3143. WINAPI
  3144. SetMailslotInfo(
  3145. IN HANDLE hMailslot,
  3146. IN DWORD lReadTimeout
  3147. );
  3148. WINBASEAPI
  3149. LPVOID
  3150. WINAPI
  3151. MapViewOfFile(
  3152. IN HANDLE hFileMappingObject,
  3153. IN DWORD dwDesiredAccess,
  3154. IN DWORD dwFileOffsetHigh,
  3155. IN DWORD dwFileOffsetLow,
  3156. IN SIZE_T dwNumberOfBytesToMap
  3157. );
  3158. WINBASEAPI
  3159. BOOL
  3160. WINAPI
  3161. FlushViewOfFile(
  3162. IN LPCVOID lpBaseAddress,
  3163. IN SIZE_T dwNumberOfBytesToFlush
  3164. );
  3165. WINBASEAPI
  3166. BOOL
  3167. WINAPI
  3168. UnmapViewOfFile(
  3169. IN LPCVOID lpBaseAddress
  3170. );
  3171. //
  3172. // File Encryption API
  3173. //
  3174. WINADVAPI
  3175. BOOL
  3176. WINAPI
  3177. EncryptFile%(
  3178. IN LPCTSTR% lpFileName
  3179. );
  3180. WINADVAPI
  3181. BOOL
  3182. WINAPI
  3183. DecryptFile%(
  3184. IN LPCTSTR% lpFileName,
  3185. IN DWORD dwReserved
  3186. );
  3187. //
  3188. // Encryption Status Value
  3189. //
  3190. #define FILE_ENCRYPTABLE 0
  3191. #define FILE_IS_ENCRYPTED 1
  3192. #define FILE_SYSTEM_ATTR 2
  3193. #define FILE_ROOT_DIR 3
  3194. #define FILE_SYSTEM_DIR 4
  3195. #define FILE_UNKNOWN 5
  3196. #define FILE_SYSTEM_NOT_SUPPORT 6
  3197. #define FILE_USER_DISALLOWED 7
  3198. #define FILE_READ_ONLY 8
  3199. #define FILE_DIR_DISALLOWED 9
  3200. WINADVAPI
  3201. BOOL
  3202. WINAPI
  3203. FileEncryptionStatus%(
  3204. LPCTSTR% lpFileName,
  3205. LPDWORD lpStatus
  3206. );
  3207. //
  3208. // Currently defined recovery flags
  3209. //
  3210. #define EFS_USE_RECOVERY_KEYS (0x1)
  3211. typedef
  3212. DWORD
  3213. (WINAPI *PFE_EXPORT_FUNC)(
  3214. PBYTE pbData,
  3215. PVOID pvCallbackContext,
  3216. ULONG ulLength
  3217. );
  3218. typedef
  3219. DWORD
  3220. (WINAPI *PFE_IMPORT_FUNC)(
  3221. PBYTE pbData,
  3222. PVOID pvCallbackContext,
  3223. PULONG ulLength
  3224. );
  3225. //
  3226. // OpenRaw flag values
  3227. //
  3228. #define CREATE_FOR_IMPORT (1)
  3229. #define CREATE_FOR_DIR (2)
  3230. #define OVERWRITE_HIDDEN (4)
  3231. WINADVAPI
  3232. DWORD
  3233. WINAPI
  3234. OpenEncryptedFileRaw%(
  3235. IN LPCTSTR% lpFileName,
  3236. IN ULONG ulFlags,
  3237. IN PVOID * pvContext
  3238. );
  3239. WINADVAPI
  3240. DWORD
  3241. WINAPI
  3242. ReadEncryptedFileRaw(
  3243. IN PFE_EXPORT_FUNC pfExportCallback,
  3244. IN PVOID pvCallbackContext,
  3245. IN PVOID pvContext
  3246. );
  3247. WINADVAPI
  3248. DWORD
  3249. WINAPI
  3250. WriteEncryptedFileRaw(
  3251. IN PFE_IMPORT_FUNC pfImportCallback,
  3252. IN PVOID pvCallbackContext,
  3253. IN PVOID pvContext
  3254. );
  3255. WINADVAPI
  3256. VOID
  3257. WINAPI
  3258. CloseEncryptedFileRaw(
  3259. IN PVOID pvContext
  3260. );
  3261. //
  3262. // _l Compat Functions
  3263. //
  3264. WINBASEAPI
  3265. int
  3266. WINAPI
  3267. lstrcmp%(
  3268. IN LPCTSTR% lpString1,
  3269. IN LPCTSTR% lpString2
  3270. );
  3271. WINBASEAPI
  3272. int
  3273. WINAPI
  3274. lstrcmpi%(
  3275. IN LPCTSTR% lpString1,
  3276. IN LPCTSTR% lpString2
  3277. );
  3278. WINBASEAPI
  3279. LPTSTR%
  3280. WINAPI
  3281. lstrcpyn%(
  3282. OUT LPTSTR% lpString1,
  3283. IN LPCTSTR% lpString2,
  3284. IN int iMaxLength
  3285. );
  3286. WINBASEAPI
  3287. LPTSTR%
  3288. WINAPI
  3289. lstrcpy%(
  3290. OUT LPTSTR% lpString1,
  3291. IN LPCTSTR% lpString2
  3292. );
  3293. WINBASEAPI
  3294. LPTSTR%
  3295. WINAPI
  3296. lstrcat%(
  3297. IN OUT LPTSTR% lpString1,
  3298. IN LPCTSTR% lpString2
  3299. );
  3300. WINBASEAPI
  3301. int
  3302. WINAPI
  3303. lstrlen%(
  3304. IN LPCTSTR% lpString
  3305. );
  3306. WINBASEAPI
  3307. HFILE
  3308. WINAPI
  3309. OpenFile(
  3310. IN LPCSTR lpFileName,
  3311. OUT LPOFSTRUCT lpReOpenBuff,
  3312. IN UINT uStyle
  3313. );
  3314. WINBASEAPI
  3315. HFILE
  3316. WINAPI
  3317. _lopen(
  3318. IN LPCSTR lpPathName,
  3319. IN int iReadWrite
  3320. );
  3321. WINBASEAPI
  3322. HFILE
  3323. WINAPI
  3324. _lcreat(
  3325. IN LPCSTR lpPathName,
  3326. IN int iAttribute
  3327. );
  3328. WINBASEAPI
  3329. UINT
  3330. WINAPI
  3331. _lread(
  3332. IN HFILE hFile,
  3333. OUT LPVOID lpBuffer,
  3334. IN UINT uBytes
  3335. );
  3336. WINBASEAPI
  3337. UINT
  3338. WINAPI
  3339. _lwrite(
  3340. IN HFILE hFile,
  3341. IN LPCSTR lpBuffer,
  3342. IN UINT uBytes
  3343. );
  3344. WINBASEAPI
  3345. long
  3346. WINAPI
  3347. _hread(
  3348. IN HFILE hFile,
  3349. OUT LPVOID lpBuffer,
  3350. IN long lBytes
  3351. );
  3352. WINBASEAPI
  3353. long
  3354. WINAPI
  3355. _hwrite(
  3356. IN HFILE hFile,
  3357. IN LPCSTR lpBuffer,
  3358. IN long lBytes
  3359. );
  3360. WINBASEAPI
  3361. HFILE
  3362. WINAPI
  3363. _lclose(
  3364. IN OUT HFILE hFile
  3365. );
  3366. WINBASEAPI
  3367. LONG
  3368. WINAPI
  3369. _llseek(
  3370. IN HFILE hFile,
  3371. IN LONG lOffset,
  3372. IN int iOrigin
  3373. );
  3374. WINADVAPI
  3375. BOOL
  3376. WINAPI
  3377. IsTextUnicode(
  3378. IN CONST VOID* lpBuffer,
  3379. IN int cb,
  3380. IN OUT LPINT lpi
  3381. );
  3382. WINBASEAPI
  3383. DWORD
  3384. WINAPI
  3385. TlsAlloc(
  3386. VOID
  3387. );
  3388. #define TLS_OUT_OF_INDEXES ((DWORD)0xFFFFFFFF)
  3389. WINBASEAPI
  3390. LPVOID
  3391. WINAPI
  3392. TlsGetValue(
  3393. IN DWORD dwTlsIndex
  3394. );
  3395. WINBASEAPI
  3396. BOOL
  3397. WINAPI
  3398. TlsSetValue(
  3399. IN DWORD dwTlsIndex,
  3400. IN LPVOID lpTlsValue
  3401. );
  3402. WINBASEAPI
  3403. BOOL
  3404. WINAPI
  3405. TlsFree(
  3406. IN DWORD dwTlsIndex
  3407. );
  3408. typedef
  3409. VOID
  3410. (WINAPI *LPOVERLAPPED_COMPLETION_ROUTINE)(
  3411. DWORD dwErrorCode,
  3412. DWORD dwNumberOfBytesTransfered,
  3413. LPOVERLAPPED lpOverlapped
  3414. );
  3415. WINBASEAPI
  3416. DWORD
  3417. WINAPI
  3418. SleepEx(
  3419. IN DWORD dwMilliseconds,
  3420. IN BOOL bAlertable
  3421. );
  3422. WINBASEAPI
  3423. DWORD
  3424. WINAPI
  3425. WaitForSingleObjectEx(
  3426. IN HANDLE hHandle,
  3427. IN DWORD dwMilliseconds,
  3428. IN BOOL bAlertable
  3429. );
  3430. WINBASEAPI
  3431. DWORD
  3432. WINAPI
  3433. WaitForMultipleObjectsEx(
  3434. IN DWORD nCount,
  3435. IN CONST HANDLE *lpHandles,
  3436. IN BOOL bWaitAll,
  3437. IN DWORD dwMilliseconds,
  3438. IN BOOL bAlertable
  3439. );
  3440. ;begin_sur
  3441. WINBASEAPI
  3442. DWORD
  3443. WINAPI
  3444. SignalObjectAndWait(
  3445. IN HANDLE hObjectToSignal,
  3446. IN HANDLE hObjectToWaitOn,
  3447. IN DWORD dwMilliseconds,
  3448. IN BOOL bAlertable
  3449. );
  3450. ;end_sur
  3451. WINBASEAPI
  3452. BOOL
  3453. WINAPI
  3454. ReadFileEx(
  3455. IN HANDLE hFile,
  3456. OUT LPVOID lpBuffer,
  3457. IN DWORD nNumberOfBytesToRead,
  3458. IN LPOVERLAPPED lpOverlapped,
  3459. IN LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
  3460. );
  3461. WINBASEAPI
  3462. BOOL
  3463. WINAPI
  3464. WriteFileEx(
  3465. IN HANDLE hFile,
  3466. IN LPCVOID lpBuffer,
  3467. IN DWORD nNumberOfBytesToWrite,
  3468. IN LPOVERLAPPED lpOverlapped,
  3469. IN LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
  3470. );
  3471. WINBASEAPI
  3472. BOOL
  3473. WINAPI
  3474. BackupRead(
  3475. IN HANDLE hFile,
  3476. OUT LPBYTE lpBuffer,
  3477. IN DWORD nNumberOfBytesToRead,
  3478. OUT LPDWORD lpNumberOfBytesRead,
  3479. IN BOOL bAbort,
  3480. IN BOOL bProcessSecurity,
  3481. OUT LPVOID *lpContext
  3482. );
  3483. WINBASEAPI
  3484. BOOL
  3485. WINAPI
  3486. BackupSeek(
  3487. IN HANDLE hFile,
  3488. IN DWORD dwLowBytesToSeek,
  3489. IN DWORD dwHighBytesToSeek,
  3490. OUT LPDWORD lpdwLowByteSeeked,
  3491. OUT LPDWORD lpdwHighByteSeeked,
  3492. IN LPVOID *lpContext
  3493. );
  3494. WINBASEAPI
  3495. BOOL
  3496. WINAPI
  3497. BackupWrite(
  3498. IN HANDLE hFile,
  3499. IN LPBYTE lpBuffer,
  3500. IN DWORD nNumberOfBytesToWrite,
  3501. OUT LPDWORD lpNumberOfBytesWritten,
  3502. IN BOOL bAbort,
  3503. IN BOOL bProcessSecurity,
  3504. OUT LPVOID *lpContext
  3505. );
  3506. //
  3507. // Stream id structure
  3508. //
  3509. typedef struct _WIN32_STREAM_ID {
  3510. DWORD dwStreamId ;
  3511. DWORD dwStreamAttributes ;
  3512. LARGE_INTEGER Size ;
  3513. DWORD dwStreamNameSize ;
  3514. WCHAR cStreamName[ ANYSIZE_ARRAY ] ;
  3515. } WIN32_STREAM_ID, *LPWIN32_STREAM_ID ;
  3516. //
  3517. // Stream Ids
  3518. //
  3519. #define BACKUP_INVALID 0x00000000
  3520. #define BACKUP_DATA 0x00000001
  3521. #define BACKUP_EA_DATA 0x00000002
  3522. #define BACKUP_SECURITY_DATA 0x00000003
  3523. #define BACKUP_ALTERNATE_DATA 0x00000004
  3524. #define BACKUP_LINK 0x00000005
  3525. #define BACKUP_PROPERTY_DATA 0x00000006
  3526. #define BACKUP_OBJECT_ID 0x00000007
  3527. #define BACKUP_REPARSE_DATA 0x00000008
  3528. #define BACKUP_SPARSE_BLOCK 0x00000009
  3529. //
  3530. // Stream Attributes
  3531. //
  3532. #define STREAM_NORMAL_ATTRIBUTE 0x00000000
  3533. #define STREAM_MODIFIED_WHEN_READ 0x00000001
  3534. #define STREAM_CONTAINS_SECURITY 0x00000002
  3535. #define STREAM_CONTAINS_PROPERTIES 0x00000004
  3536. #define STREAM_SPARSE_ATTRIBUTE 0x00000008
  3537. WINBASEAPI
  3538. BOOL
  3539. WINAPI
  3540. ReadFileScatter(
  3541. IN HANDLE hFile,
  3542. IN FILE_SEGMENT_ELEMENT aSegmentArray[],
  3543. IN DWORD nNumberOfBytesToRead,
  3544. IN LPDWORD lpReserved,
  3545. IN LPOVERLAPPED lpOverlapped
  3546. );
  3547. WINBASEAPI
  3548. BOOL
  3549. WINAPI
  3550. WriteFileGather(
  3551. IN HANDLE hFile,
  3552. OUT FILE_SEGMENT_ELEMENT aSegmentArray[],
  3553. IN DWORD nNumberOfBytesToWrite,
  3554. IN LPDWORD lpReserved,
  3555. IN LPOVERLAPPED lpOverlapped
  3556. );
  3557. //
  3558. // Dual Mode API below this line. Dual Mode Structures also included.
  3559. //
  3560. ;begin_userk
  3561. #define STARTF_USESHOWWINDOW 0x00000001
  3562. #define STARTF_USESIZE 0x00000002
  3563. #define STARTF_USEPOSITION 0x00000004
  3564. #define STARTF_USECOUNTCHARS 0x00000008
  3565. #define STARTF_USEFILLATTRIBUTE 0x00000010
  3566. #define STARTF_RUNFULLSCREEN 0x00000020 // ignored for non-x86 platforms
  3567. #define STARTF_FORCEONFEEDBACK 0x00000040
  3568. #define STARTF_FORCEOFFFEEDBACK 0x00000080
  3569. #define STARTF_USESTDHANDLES 0x00000100
  3570. ;end_userk
  3571. ;begin_winver_400
  3572. #define STARTF_USEHOTKEY 0x00000200 ;userk
  3573. #define STARTF_HASSHELLDATA 0x00000400 ;userk_only
  3574. #define STARTF_HASSHELLDATA 0x00000400 ;internal
  3575. #define STARTF_TITLEISLINKNAME 0x00000800 ;internal
  3576. ;end_winver_400
  3577. typedef struct _STARTUPINFO% {
  3578. DWORD cb;
  3579. LPTSTR% lpReserved;
  3580. LPTSTR% lpDesktop;
  3581. LPTSTR% lpTitle;
  3582. DWORD dwX;
  3583. DWORD dwY;
  3584. DWORD dwXSize;
  3585. DWORD dwYSize;
  3586. DWORD dwXCountChars;
  3587. DWORD dwYCountChars;
  3588. DWORD dwFillAttribute;
  3589. DWORD dwFlags;
  3590. WORD wShowWindow;
  3591. WORD cbReserved2;
  3592. LPBYTE lpReserved2;
  3593. HANDLE hStdInput;
  3594. HANDLE hStdOutput;
  3595. HANDLE hStdError;
  3596. } STARTUPINFO%, *LPSTARTUPINFO%;
  3597. #define SHUTDOWN_NORETRY 0x00000001
  3598. typedef struct _WIN32_FIND_DATA% {
  3599. DWORD dwFileAttributes;
  3600. FILETIME ftCreationTime;
  3601. FILETIME ftLastAccessTime;
  3602. FILETIME ftLastWriteTime;
  3603. DWORD nFileSizeHigh;
  3604. DWORD nFileSizeLow;
  3605. DWORD dwReserved0;
  3606. DWORD dwReserved1;
  3607. TCHAR% cFileName[ MAX_PATH ];
  3608. TCHAR% cAlternateFileName[ 14 ];
  3609. #ifdef _MAC
  3610. DWORD dwFileType;
  3611. DWORD dwCreatorType;
  3612. WORD wFinderFlags;
  3613. #endif
  3614. } WIN32_FIND_DATA%, *PWIN32_FIND_DATA%, *LPWIN32_FIND_DATA%;
  3615. typedef struct _WIN32_FILE_ATTRIBUTE_DATA {
  3616. DWORD dwFileAttributes;
  3617. FILETIME ftCreationTime;
  3618. FILETIME ftLastAccessTime;
  3619. FILETIME ftLastWriteTime;
  3620. DWORD nFileSizeHigh;
  3621. DWORD nFileSizeLow;
  3622. } WIN32_FILE_ATTRIBUTE_DATA, *LPWIN32_FILE_ATTRIBUTE_DATA;
  3623. WINBASEAPI
  3624. HANDLE
  3625. WINAPI
  3626. CreateMutex%(
  3627. IN LPSECURITY_ATTRIBUTES lpMutexAttributes,
  3628. IN BOOL bInitialOwner,
  3629. IN LPCTSTR% lpName
  3630. );
  3631. WINBASEAPI
  3632. HANDLE
  3633. WINAPI
  3634. OpenMutex%(
  3635. IN DWORD dwDesiredAccess,
  3636. IN BOOL bInheritHandle,
  3637. IN LPCTSTR% lpName
  3638. );
  3639. WINBASEAPI
  3640. HANDLE
  3641. WINAPI
  3642. CreateEvent%(
  3643. IN LPSECURITY_ATTRIBUTES lpEventAttributes,
  3644. IN BOOL bManualReset,
  3645. IN BOOL bInitialState,
  3646. IN LPCTSTR% lpName
  3647. );
  3648. WINBASEAPI
  3649. HANDLE
  3650. WINAPI
  3651. OpenEvent%(
  3652. IN DWORD dwDesiredAccess,
  3653. IN BOOL bInheritHandle,
  3654. IN LPCTSTR% lpName
  3655. );
  3656. WINBASEAPI
  3657. HANDLE
  3658. WINAPI
  3659. CreateSemaphore%(
  3660. IN LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
  3661. IN LONG lInitialCount,
  3662. IN LONG lMaximumCount,
  3663. IN LPCTSTR% lpName
  3664. );
  3665. WINBASEAPI
  3666. HANDLE
  3667. WINAPI
  3668. OpenSemaphore%(
  3669. IN DWORD dwDesiredAccess,
  3670. IN BOOL bInheritHandle,
  3671. IN LPCTSTR% lpName
  3672. );
  3673. #if (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)
  3674. typedef
  3675. VOID
  3676. (APIENTRY *PTIMERAPCROUTINE)(
  3677. LPVOID lpArgToCompletionRoutine,
  3678. DWORD dwTimerLowValue,
  3679. DWORD dwTimerHighValue
  3680. );
  3681. WINBASEAPI
  3682. HANDLE
  3683. WINAPI
  3684. CreateWaitableTimer%(
  3685. IN LPSECURITY_ATTRIBUTES lpTimerAttributes,
  3686. IN BOOL bManualReset,
  3687. IN LPCTSTR% lpTimerName
  3688. );
  3689. WINBASEAPI
  3690. HANDLE
  3691. WINAPI
  3692. OpenWaitableTimer%(
  3693. IN DWORD dwDesiredAccess,
  3694. IN BOOL bInheritHandle,
  3695. IN LPCTSTR% lpTimerName
  3696. );
  3697. WINBASEAPI
  3698. BOOL
  3699. WINAPI
  3700. SetWaitableTimer(
  3701. IN HANDLE hTimer,
  3702. IN const LARGE_INTEGER *lpDueTime,
  3703. IN LONG lPeriod,
  3704. IN PTIMERAPCROUTINE pfnCompletionRoutine,
  3705. IN LPVOID lpArgToCompletionRoutine,
  3706. IN BOOL fResume
  3707. );
  3708. WINBASEAPI
  3709. BOOL
  3710. WINAPI
  3711. CancelWaitableTimer(
  3712. IN HANDLE hTimer
  3713. );
  3714. #endif /* (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400) */
  3715. WINBASEAPI
  3716. HANDLE
  3717. WINAPI
  3718. CreateFileMapping%(
  3719. IN HANDLE hFile,
  3720. IN LPSECURITY_ATTRIBUTES lpFileMappingAttributes,
  3721. IN DWORD flProtect,
  3722. IN DWORD dwMaximumSizeHigh,
  3723. IN DWORD dwMaximumSizeLow,
  3724. IN LPCTSTR% lpName
  3725. );
  3726. WINBASEAPI
  3727. HANDLE
  3728. WINAPI
  3729. OpenFileMapping%(
  3730. IN DWORD dwDesiredAccess,
  3731. IN BOOL bInheritHandle,
  3732. IN LPCTSTR% lpName
  3733. );
  3734. WINBASEAPI
  3735. DWORD
  3736. WINAPI
  3737. GetLogicalDriveStrings%(
  3738. IN DWORD nBufferLength,
  3739. OUT LPTSTR% lpBuffer
  3740. );
  3741. #if _WIN32_WINNT >= 0x0501
  3742. typedef enum _MEMORY_RESOURCE_NOTIFICATION_TYPE {
  3743. LowMemoryResourceNotification,
  3744. HighMemoryResourceNotification
  3745. } MEMORY_RESOURCE_NOTIFICATION_TYPE;
  3746. WINBASEAPI
  3747. HANDLE
  3748. WINAPI
  3749. CreateMemoryResourceNotification(
  3750. IN MEMORY_RESOURCE_NOTIFICATION_TYPE NotificationType
  3751. );
  3752. WINBASEAPI
  3753. BOOL
  3754. WINAPI
  3755. QueryMemoryResourceNotification(
  3756. IN HANDLE ResourceNotificationHandle,
  3757. OUT PBOOL ResourceState
  3758. );
  3759. #endif // _WIN32_WINNT >= 0x0501
  3760. /*#!perl
  3761. ActivateAroundFunctionCall("LoadLibraryA");
  3762. ActivateAroundFunctionCall("LoadLibraryW");
  3763. ActivateAroundFunctionCall("LoadLibraryExA");
  3764. ActivateAroundFunctionCall("LoadLibraryExW");
  3765. DeclareFunctionErrorValue("LoadLibraryA", "NULL");
  3766. DeclareFunctionErrorValue("LoadLibraryW", "NULL");
  3767. DeclareFunctionErrorValue("LoadLibraryExA", "NULL");
  3768. DeclareFunctionErrorValue("LoadLibraryExW", "NULL");
  3769. */
  3770. WINBASEAPI
  3771. HMODULE ;public_NT
  3772. HINSTANCE ;public_chicago
  3773. WINAPI
  3774. LoadLibrary%(
  3775. IN LPCTSTR% lpLibFileName
  3776. );
  3777. WINBASEAPI
  3778. HMODULE ;public_NT
  3779. HINSTANCE ;public_chicago
  3780. WINAPI
  3781. LoadLibraryEx%(
  3782. IN LPCTSTR% lpLibFileName,
  3783. IN HANDLE hFile,
  3784. IN DWORD dwFlags
  3785. );
  3786. #define DONT_RESOLVE_DLL_REFERENCES 0x00000001
  3787. #define LOAD_LIBRARY_AS_DATAFILE 0x00000002
  3788. #define LOAD_WITH_ALTERED_SEARCH_PATH 0x00000008
  3789. #define LOAD_IGNORE_CODE_AUTHZ_LEVEL 0x00000010
  3790. WINBASEAPI
  3791. DWORD
  3792. WINAPI
  3793. GetModuleFileName%(
  3794. IN HMODULE hModule, ;public_NT
  3795. IN HINSTANCE hModule, ;public_chicago
  3796. OUT LPTSTR% lpFilename,
  3797. IN DWORD nSize
  3798. );
  3799. WINBASEAPI
  3800. HMODULE
  3801. WINAPI
  3802. GetModuleHandle%(
  3803. IN LPCTSTR% lpModuleName
  3804. );
  3805. #if !defined(RC_INVOKED)
  3806. #if _WIN32_WINNT > 0x0500 || defined(WINBASE_DECLARE_GET_MODULE_HANDLE_EX) || ISOLATION_AWARE_ENABLED
  3807. #define GET_MODULE_HANDLE_EX_FLAG_PIN (0x00000001)
  3808. #define GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT (0x00000002)
  3809. #define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS (0x00000004)
  3810. typedef
  3811. BOOL
  3812. (WINAPI*
  3813. PGET_MODULE_HANDLE_EX%)(
  3814. IN DWORD dwFlags,
  3815. IN LPCTSTR% lpModuleName,
  3816. OUT HMODULE* phModule
  3817. );
  3818. WINBASEAPI
  3819. BOOL
  3820. WINAPI
  3821. GetModuleHandleEx%(
  3822. IN DWORD dwFlags,
  3823. IN LPCTSTR% lpModuleName,
  3824. OUT HMODULE* phModule
  3825. );
  3826. #endif
  3827. #endif
  3828. WINBASEAPI
  3829. BOOL
  3830. WINAPI
  3831. CreateProcess%(
  3832. IN LPCTSTR% lpApplicationName,
  3833. IN LPTSTR% lpCommandLine,
  3834. IN LPSECURITY_ATTRIBUTES lpProcessAttributes,
  3835. IN LPSECURITY_ATTRIBUTES lpThreadAttributes,
  3836. IN BOOL bInheritHandles,
  3837. IN DWORD dwCreationFlags,
  3838. IN LPVOID lpEnvironment,
  3839. IN LPCTSTR% lpCurrentDirectory,
  3840. IN LPSTARTUPINFO% lpStartupInfo,
  3841. OUT LPPROCESS_INFORMATION lpProcessInformation
  3842. );
  3843. ;begin_internal
  3844. WINBASEAPI
  3845. BOOL
  3846. WINAPI
  3847. CreateProcessInternal%(
  3848. IN HANDLE hUserToken,
  3849. IN LPCTSTR% lpApplicationName,
  3850. IN LPTSTR% lpCommandLine,
  3851. IN LPSECURITY_ATTRIBUTES lpProcessAttributes,
  3852. IN LPSECURITY_ATTRIBUTES lpThreadAttributes,
  3853. IN BOOL bInheritHandles,
  3854. IN DWORD dwCreationFlags,
  3855. IN LPVOID lpEnvironment,
  3856. IN LPCTSTR% lpCurrentDirectory,
  3857. IN LPSTARTUPINFO% lpStartupInfo,
  3858. OUT LPPROCESS_INFORMATION lpProcessInformation,
  3859. OUT PHANDLE hRestrictedUserToken
  3860. );
  3861. ;end_internal
  3862. WINBASEAPI
  3863. BOOL
  3864. WINAPI
  3865. SetProcessShutdownParameters(
  3866. IN DWORD dwLevel,
  3867. IN DWORD dwFlags
  3868. );
  3869. WINBASEAPI
  3870. BOOL
  3871. WINAPI
  3872. GetProcessShutdownParameters(
  3873. OUT LPDWORD lpdwLevel,
  3874. OUT LPDWORD lpdwFlags
  3875. );
  3876. WINBASEAPI
  3877. DWORD
  3878. WINAPI
  3879. GetProcessVersion(
  3880. IN DWORD ProcessId
  3881. );
  3882. WINBASEAPI
  3883. VOID
  3884. WINAPI
  3885. FatalAppExit%(
  3886. IN UINT uAction,
  3887. IN LPCTSTR% lpMessageText
  3888. );
  3889. WINBASEAPI
  3890. VOID
  3891. WINAPI
  3892. GetStartupInfo%(
  3893. OUT LPSTARTUPINFO% lpStartupInfo
  3894. );
  3895. WINBASEAPI
  3896. LPTSTR%
  3897. WINAPI
  3898. GetCommandLine%(
  3899. VOID
  3900. );
  3901. WINBASEAPI
  3902. DWORD
  3903. WINAPI
  3904. GetEnvironmentVariable%(
  3905. IN LPCTSTR% lpName,
  3906. OUT LPTSTR% lpBuffer,
  3907. IN DWORD nSize
  3908. );
  3909. WINBASEAPI
  3910. BOOL
  3911. WINAPI
  3912. SetEnvironmentVariable%(
  3913. IN LPCTSTR% lpName,
  3914. IN LPCTSTR% lpValue
  3915. );
  3916. WINBASEAPI
  3917. DWORD
  3918. WINAPI
  3919. ExpandEnvironmentStrings%(
  3920. IN LPCTSTR% lpSrc,
  3921. OUT LPTSTR% lpDst,
  3922. IN DWORD nSize
  3923. );
  3924. WINBASEAPI
  3925. DWORD
  3926. WINAPI
  3927. GetFirmwareEnvironmentVariable%(
  3928. IN LPCTSTR% lpName,
  3929. IN LPCTSTR% lpGuid,
  3930. OUT PVOID pBuffer,
  3931. IN DWORD nSize
  3932. );
  3933. WINBASEAPI
  3934. BOOL
  3935. WINAPI
  3936. SetFirmwareEnvironmentVariable%(
  3937. IN LPCTSTR% lpName,
  3938. IN LPCTSTR% lpGuid,
  3939. IN PVOID pValue,
  3940. IN DWORD nSize
  3941. );
  3942. WINBASEAPI
  3943. VOID
  3944. WINAPI
  3945. OutputDebugString%(
  3946. IN LPCTSTR% lpOutputString
  3947. );
  3948. WINBASEAPI
  3949. HRSRC
  3950. WINAPI
  3951. FindResource%(
  3952. IN HMODULE hModule, ;public_NT
  3953. IN HINSTANCE hModule, ;public_chicago
  3954. IN LPCTSTR% lpName,
  3955. IN LPCTSTR% lpType
  3956. );
  3957. WINBASEAPI
  3958. HRSRC
  3959. WINAPI
  3960. FindResourceEx%(
  3961. IN HMODULE hModule, ;public_NT
  3962. IN HINSTANCE hModule, ;public_chicago
  3963. IN LPCTSTR% lpType,
  3964. IN LPCTSTR% lpName,
  3965. IN WORD wLanguage
  3966. );
  3967. #ifdef STRICT
  3968. typedef BOOL (CALLBACK* ENUMRESTYPEPROC%)(HMODULE hModule, LPTSTR% lpType, ;public_NT
  3969. typedef BOOL (CALLBACK* ENUMRESTYPEPROC)(HINSTANCE hModule, LPTSTR% lpType, ;public_chicago
  3970. LONG_PTR lParam);
  3971. typedef BOOL (CALLBACK* ENUMRESNAMEPROC%)(HMODULE hModule, LPCTSTR% lpType, ;public_NT
  3972. typedef BOOL (CALLBACK* ENUMRESNAMEPROC)(HINSTANCE hModule, LPCTSTR% lpType, ;public_chicago
  3973. LPTSTR% lpName, LONG_PTR lParam);
  3974. typedef BOOL (CALLBACK* ENUMRESLANGPROC%)(HMODULE hModule, LPCTSTR% lpType, ;public_NT
  3975. typedef BOOL (CALLBACK* ENUMRESLANGPROC)(HINSTANCE hModule, LPCTSTR% lpType, ;public_chicago
  3976. LPCTSTR% lpName, WORD wLanguage, LONG_PTR lParam);
  3977. #else
  3978. typedef FARPROC ENUMRESTYPEPROC%;
  3979. typedef FARPROC ENUMRESNAMEPROC%;
  3980. typedef FARPROC ENUMRESLANGPROC%;
  3981. #endif
  3982. WINBASEAPI
  3983. BOOL
  3984. WINAPI
  3985. EnumResourceTypes%(
  3986. IN HMODULE hModule, ;public_NT
  3987. IN HINSTANCE hModule, ;public_chicago
  3988. IN ENUMRESTYPEPROC% lpEnumFunc,
  3989. IN LONG_PTR lParam
  3990. );
  3991. WINBASEAPI
  3992. BOOL
  3993. WINAPI
  3994. EnumResourceNames%(
  3995. IN HMODULE hModule, ;public_NT
  3996. IN HINSTANCE hModule, ;public_chicago
  3997. IN LPCTSTR% lpType,
  3998. IN ENUMRESNAMEPROC% lpEnumFunc,
  3999. IN LONG_PTR lParam
  4000. );
  4001. WINBASEAPI
  4002. BOOL
  4003. WINAPI
  4004. EnumResourceLanguages%(
  4005. IN HMODULE hModule, ;public_NT
  4006. IN HINSTANCE hModule, ;public_chicago
  4007. IN LPCTSTR% lpType,
  4008. IN LPCTSTR% lpName,
  4009. IN ENUMRESLANGPROC% lpEnumFunc,
  4010. IN LONG_PTR lParam
  4011. );
  4012. WINBASEAPI
  4013. HANDLE
  4014. WINAPI
  4015. BeginUpdateResource%(
  4016. IN LPCTSTR% pFileName,
  4017. IN BOOL bDeleteExistingResources
  4018. );
  4019. WINBASEAPI
  4020. BOOL
  4021. WINAPI
  4022. UpdateResource%(
  4023. IN HANDLE hUpdate,
  4024. IN LPCTSTR% lpType,
  4025. IN LPCTSTR% lpName,
  4026. IN WORD wLanguage,
  4027. IN LPVOID lpData,
  4028. IN DWORD cbData
  4029. );
  4030. WINBASEAPI
  4031. BOOL
  4032. WINAPI
  4033. EndUpdateResource%(
  4034. IN HANDLE hUpdate,
  4035. IN BOOL fDiscard
  4036. );
  4037. WINBASEAPI
  4038. ATOM
  4039. WINAPI
  4040. GlobalAddAtom%(
  4041. IN LPCTSTR% lpString
  4042. );
  4043. WINBASEAPI
  4044. ATOM
  4045. WINAPI
  4046. GlobalFindAtom%(
  4047. IN LPCTSTR% lpString
  4048. );
  4049. WINBASEAPI
  4050. UINT
  4051. WINAPI
  4052. GlobalGetAtomName%(
  4053. IN ATOM nAtom,
  4054. OUT LPTSTR% lpBuffer,
  4055. IN int nSize
  4056. );
  4057. WINBASEAPI
  4058. ATOM
  4059. WINAPI
  4060. AddAtom%(
  4061. IN LPCTSTR% lpString
  4062. );
  4063. WINBASEAPI
  4064. ATOM
  4065. WINAPI
  4066. FindAtom%(
  4067. IN LPCTSTR% lpString
  4068. );
  4069. WINBASEAPI
  4070. UINT
  4071. WINAPI
  4072. GetAtomName%(
  4073. IN ATOM nAtom,
  4074. OUT LPTSTR% lpBuffer,
  4075. IN int nSize
  4076. );
  4077. WINBASEAPI
  4078. UINT
  4079. WINAPI
  4080. GetProfileInt%(
  4081. IN LPCTSTR% lpAppName,
  4082. IN LPCTSTR% lpKeyName,
  4083. IN INT nDefault
  4084. );
  4085. WINBASEAPI
  4086. DWORD
  4087. WINAPI
  4088. GetProfileString%(
  4089. IN LPCTSTR% lpAppName,
  4090. IN LPCTSTR% lpKeyName,
  4091. IN LPCTSTR% lpDefault,
  4092. OUT LPTSTR% lpReturnedString,
  4093. IN DWORD nSize
  4094. );
  4095. WINBASEAPI
  4096. BOOL
  4097. WINAPI
  4098. WriteProfileString%(
  4099. IN LPCTSTR% lpAppName,
  4100. IN LPCTSTR% lpKeyName,
  4101. IN LPCTSTR% lpString
  4102. );
  4103. WINBASEAPI
  4104. DWORD
  4105. WINAPI
  4106. GetProfileSection%(
  4107. IN LPCTSTR% lpAppName,
  4108. OUT LPTSTR% lpReturnedString,
  4109. IN DWORD nSize
  4110. );
  4111. WINBASEAPI
  4112. BOOL
  4113. WINAPI
  4114. WriteProfileSection%(
  4115. IN LPCTSTR% lpAppName,
  4116. IN LPCTSTR% lpString
  4117. );
  4118. WINBASEAPI
  4119. UINT
  4120. WINAPI
  4121. GetPrivateProfileInt%(
  4122. IN LPCTSTR% lpAppName,
  4123. IN LPCTSTR% lpKeyName,
  4124. IN INT nDefault,
  4125. IN LPCTSTR% lpFileName
  4126. );
  4127. WINBASEAPI
  4128. DWORD
  4129. WINAPI
  4130. GetPrivateProfileString%(
  4131. IN LPCTSTR% lpAppName,
  4132. IN LPCTSTR% lpKeyName,
  4133. IN LPCTSTR% lpDefault,
  4134. OUT LPTSTR% lpReturnedString,
  4135. IN DWORD nSize,
  4136. IN LPCTSTR% lpFileName
  4137. );
  4138. WINBASEAPI
  4139. BOOL
  4140. WINAPI
  4141. WritePrivateProfileString%(
  4142. IN LPCTSTR% lpAppName,
  4143. IN LPCTSTR% lpKeyName,
  4144. IN LPCTSTR% lpString,
  4145. IN LPCTSTR% lpFileName
  4146. );
  4147. WINBASEAPI
  4148. DWORD
  4149. WINAPI
  4150. GetPrivateProfileSection%(
  4151. IN LPCTSTR% lpAppName,
  4152. OUT LPTSTR% lpReturnedString,
  4153. IN DWORD nSize,
  4154. IN LPCTSTR% lpFileName
  4155. );
  4156. WINBASEAPI
  4157. BOOL
  4158. WINAPI
  4159. WritePrivateProfileSection%(
  4160. IN LPCTSTR% lpAppName,
  4161. IN LPCTSTR% lpString,
  4162. IN LPCTSTR% lpFileName
  4163. );
  4164. WINBASEAPI
  4165. DWORD
  4166. WINAPI
  4167. GetPrivateProfileSectionNames%(
  4168. OUT LPTSTR% lpszReturnBuffer,
  4169. IN DWORD nSize,
  4170. IN LPCTSTR% lpFileName
  4171. );
  4172. WINBASEAPI
  4173. BOOL
  4174. WINAPI
  4175. GetPrivateProfileStruct%(
  4176. IN LPCTSTR% lpszSection,
  4177. IN LPCTSTR% lpszKey,
  4178. OUT LPVOID lpStruct,
  4179. IN UINT uSizeStruct,
  4180. IN LPCTSTR% szFile
  4181. );
  4182. WINBASEAPI
  4183. BOOL
  4184. WINAPI
  4185. WritePrivateProfileStruct%(
  4186. IN LPCTSTR% lpszSection,
  4187. IN LPCTSTR% lpszKey,
  4188. IN LPVOID lpStruct,
  4189. IN UINT uSizeStruct,
  4190. IN LPCTSTR% szFile
  4191. );
  4192. WINBASEAPI
  4193. UINT
  4194. WINAPI
  4195. GetDriveType%(
  4196. IN LPCTSTR% lpRootPathName
  4197. );
  4198. WINBASEAPI
  4199. UINT
  4200. WINAPI
  4201. GetSystemDirectory%(
  4202. OUT LPTSTR% lpBuffer,
  4203. IN UINT uSize
  4204. );
  4205. WINBASEAPI
  4206. DWORD
  4207. WINAPI
  4208. GetTempPath%(
  4209. IN DWORD nBufferLength,
  4210. OUT LPTSTR% lpBuffer
  4211. );
  4212. WINBASEAPI
  4213. UINT
  4214. WINAPI
  4215. GetTempFileName%(
  4216. IN LPCTSTR% lpPathName,
  4217. IN LPCTSTR% lpPrefixString,
  4218. IN UINT uUnique,
  4219. OUT LPTSTR% lpTempFileName
  4220. );
  4221. WINBASEAPI
  4222. UINT
  4223. WINAPI
  4224. GetWindowsDirectory%(
  4225. OUT LPTSTR% lpBuffer,
  4226. IN UINT uSize
  4227. );
  4228. WINBASEAPI
  4229. UINT
  4230. WINAPI
  4231. GetSystemWindowsDirectory%(
  4232. OUT LPTSTR% lpBuffer,
  4233. IN UINT uSize
  4234. );
  4235. #if !defined(RC_INVOKED) // RC warns because "WINBASE_DECLARE_GET_SYSTEM_WOW64_DIRECTORY" is a bit long.
  4236. #if _WIN32_WINNT >= 0x0501 || defined(WINBASE_DECLARE_GET_SYSTEM_WOW64_DIRECTORY)
  4237. WINBASEAPI
  4238. UINT
  4239. WINAPI
  4240. GetSystemWow64Directory%(
  4241. OUT LPTSTR% lpBuffer,
  4242. IN UINT uSize
  4243. );
  4244. //
  4245. // for GetProcAddress
  4246. //
  4247. typedef UINT (WINAPI* PGET_SYSTEM_WOW64_DIRECTORY_A)(OUT LPSTR lpBuffer, UINT uSize);
  4248. typedef UINT (WINAPI* PGET_SYSTEM_WOW64_DIRECTORY_W)(OUT LPWSTR lpBuffer, UINT uSize);
  4249. //
  4250. // GetProcAddress only accepts GET_SYSTEM_WOW64_DIRECTORY_NAME_A_A,
  4251. // GET_SYSTEM_WOW64_DIRECTORY_NAME_W_A, GET_SYSTEM_WOW64_DIRECTORY_NAME_T_A.
  4252. // The others are if you want to use the strings in some other way.
  4253. //
  4254. #define GET_SYSTEM_WOW64_DIRECTORY_NAME_A_A "GetSystemWow64DirectoryA"
  4255. #define GET_SYSTEM_WOW64_DIRECTORY_NAME_A_W L"GetSystemWow64DirectoryA"
  4256. #define GET_SYSTEM_WOW64_DIRECTORY_NAME_A_T TEXT("GetSystemWow64DirectoryA")
  4257. #define GET_SYSTEM_WOW64_DIRECTORY_NAME_W_A "GetSystemWow64DirectoryW"
  4258. #define GET_SYSTEM_WOW64_DIRECTORY_NAME_W_W L"GetSystemWow64DirectoryW"
  4259. #define GET_SYSTEM_WOW64_DIRECTORY_NAME_W_T TEXT("GetSystemWow64DirectoryW")
  4260. #ifdef UNICODE
  4261. #define GET_SYSTEM_WOW64_DIRECTORY_NAME_T_A GET_SYSTEM_WOW64_DIRECTORY_NAME_W_A
  4262. #define GET_SYSTEM_WOW64_DIRECTORY_NAME_T_W GET_SYSTEM_WOW64_DIRECTORY_NAME_W_W
  4263. #define GET_SYSTEM_WOW64_DIRECTORY_NAME_T_T GET_SYSTEM_WOW64_DIRECTORY_NAME_W_T
  4264. #else
  4265. #define GET_SYSTEM_WOW64_DIRECTORY_NAME_T_A GET_SYSTEM_WOW64_DIRECTORY_NAME_A_A
  4266. #define GET_SYSTEM_WOW64_DIRECTORY_NAME_T_W GET_SYSTEM_WOW64_DIRECTORY_NAME_A_W
  4267. #define GET_SYSTEM_WOW64_DIRECTORY_NAME_T_T GET_SYSTEM_WOW64_DIRECTORY_NAME_A_T
  4268. #endif
  4269. #endif // _WIN32_WINNT >= 0x0501
  4270. #endif
  4271. WINBASEAPI
  4272. BOOL
  4273. WINAPI
  4274. SetCurrentDirectory%(
  4275. IN LPCTSTR% lpPathName
  4276. );
  4277. WINBASEAPI
  4278. DWORD
  4279. WINAPI
  4280. GetCurrentDirectory%(
  4281. IN DWORD nBufferLength,
  4282. OUT LPTSTR% lpBuffer
  4283. );
  4284. WINBASEAPI
  4285. BOOL
  4286. WINAPI
  4287. GetDiskFreeSpace%(
  4288. IN LPCTSTR% lpRootPathName,
  4289. OUT LPDWORD lpSectorsPerCluster,
  4290. OUT LPDWORD lpBytesPerSector,
  4291. OUT LPDWORD lpNumberOfFreeClusters,
  4292. OUT LPDWORD lpTotalNumberOfClusters
  4293. );
  4294. WINBASEAPI
  4295. BOOL
  4296. WINAPI
  4297. GetDiskFreeSpaceEx%(
  4298. IN LPCTSTR% lpDirectoryName,
  4299. OUT PULARGE_INTEGER lpFreeBytesAvailableToCaller,
  4300. OUT PULARGE_INTEGER lpTotalNumberOfBytes,
  4301. OUT PULARGE_INTEGER lpTotalNumberOfFreeBytes
  4302. );
  4303. WINBASEAPI
  4304. BOOL
  4305. WINAPI
  4306. CreateDirectory%(
  4307. IN LPCTSTR% lpPathName,
  4308. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes
  4309. );
  4310. WINBASEAPI
  4311. BOOL
  4312. WINAPI
  4313. CreateDirectoryEx%(
  4314. IN LPCTSTR% lpTemplateDirectory,
  4315. IN LPCTSTR% lpNewDirectory,
  4316. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes
  4317. );
  4318. WINBASEAPI
  4319. BOOL
  4320. WINAPI
  4321. RemoveDirectory%(
  4322. IN LPCTSTR% lpPathName
  4323. );
  4324. WINBASEAPI
  4325. DWORD
  4326. WINAPI
  4327. GetFullPathName%(
  4328. IN LPCTSTR% lpFileName,
  4329. IN DWORD nBufferLength,
  4330. OUT LPTSTR% lpBuffer,
  4331. OUT LPTSTR% *lpFilePart
  4332. );
  4333. #define DDD_RAW_TARGET_PATH 0x00000001
  4334. #define DDD_REMOVE_DEFINITION 0x00000002
  4335. #define DDD_EXACT_MATCH_ON_REMOVE 0x00000004
  4336. #define DDD_NO_BROADCAST_SYSTEM 0x00000008
  4337. #define DDD_LUID_BROADCAST_DRIVE 0x00000010
  4338. WINBASEAPI
  4339. BOOL
  4340. WINAPI
  4341. DefineDosDevice%(
  4342. IN DWORD dwFlags,
  4343. IN LPCTSTR% lpDeviceName,
  4344. IN LPCTSTR% lpTargetPath
  4345. );
  4346. WINBASEAPI
  4347. DWORD
  4348. WINAPI
  4349. QueryDosDevice%(
  4350. IN LPCTSTR% lpDeviceName,
  4351. OUT LPTSTR% lpTargetPath,
  4352. IN DWORD ucchMax
  4353. );
  4354. #define EXPAND_LOCAL_DRIVES
  4355. WINBASEAPI
  4356. HANDLE
  4357. WINAPI
  4358. CreateFile%(
  4359. IN LPCTSTR% lpFileName,
  4360. IN DWORD dwDesiredAccess,
  4361. IN DWORD dwShareMode,
  4362. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  4363. IN DWORD dwCreationDisposition,
  4364. IN DWORD dwFlagsAndAttributes,
  4365. IN HANDLE hTemplateFile
  4366. );
  4367. WINBASEAPI
  4368. BOOL
  4369. WINAPI
  4370. SetFileAttributes%(
  4371. IN LPCTSTR% lpFileName,
  4372. IN DWORD dwFileAttributes
  4373. );
  4374. WINBASEAPI
  4375. DWORD
  4376. WINAPI
  4377. GetFileAttributes%(
  4378. IN LPCTSTR% lpFileName
  4379. );
  4380. typedef enum _GET_FILEEX_INFO_LEVELS {
  4381. GetFileExInfoStandard,
  4382. GetFileExMaxInfoLevel
  4383. } GET_FILEEX_INFO_LEVELS;
  4384. WINBASEAPI
  4385. BOOL
  4386. WINAPI
  4387. GetFileAttributesEx%(
  4388. IN LPCTSTR% lpFileName,
  4389. IN GET_FILEEX_INFO_LEVELS fInfoLevelId,
  4390. OUT LPVOID lpFileInformation
  4391. );
  4392. WINBASEAPI
  4393. DWORD
  4394. WINAPI
  4395. GetCompressedFileSize%(
  4396. IN LPCTSTR% lpFileName,
  4397. OUT LPDWORD lpFileSizeHigh
  4398. );
  4399. WINBASEAPI
  4400. BOOL
  4401. WINAPI
  4402. DeleteFile%(
  4403. IN LPCTSTR% lpFileName
  4404. );
  4405. #if _WIN32_WINNT >= 0x0501
  4406. WINBASEAPI
  4407. BOOL
  4408. WINAPI
  4409. CheckNameLegalDOS8Dot3%(
  4410. IN LPCTSTR% lpName,
  4411. OUT LPSTR lpOemName OPTIONAL,
  4412. IN DWORD OemNameSize OPTIONAL,
  4413. OUT PBOOL pbNameContainsSpaces OPTIONAL,
  4414. OUT PBOOL pbNameLegal
  4415. );
  4416. #endif // (_WIN32_WINNT >= 0x0501)
  4417. ;begin_sur
  4418. typedef enum _FINDEX_INFO_LEVELS {
  4419. FindExInfoStandard,
  4420. FindExInfoMaxInfoLevel
  4421. } FINDEX_INFO_LEVELS;
  4422. typedef enum _FINDEX_SEARCH_OPS {
  4423. FindExSearchNameMatch,
  4424. FindExSearchLimitToDirectories,
  4425. FindExSearchLimitToDevices,
  4426. FindExSearchMaxSearchOp
  4427. } FINDEX_SEARCH_OPS;
  4428. #define FIND_FIRST_EX_CASE_SENSITIVE 0x00000001
  4429. WINBASEAPI
  4430. HANDLE
  4431. WINAPI
  4432. FindFirstFileEx%(
  4433. IN LPCTSTR% lpFileName,
  4434. IN FINDEX_INFO_LEVELS fInfoLevelId,
  4435. OUT LPVOID lpFindFileData,
  4436. IN FINDEX_SEARCH_OPS fSearchOp,
  4437. IN LPVOID lpSearchFilter,
  4438. IN DWORD dwAdditionalFlags
  4439. );
  4440. ;end_sur
  4441. WINBASEAPI
  4442. HANDLE
  4443. WINAPI
  4444. FindFirstFile%(
  4445. IN LPCTSTR% lpFileName,
  4446. OUT LPWIN32_FIND_DATA% lpFindFileData
  4447. );
  4448. WINBASEAPI
  4449. BOOL
  4450. WINAPI
  4451. FindNextFile%(
  4452. IN HANDLE hFindFile,
  4453. OUT LPWIN32_FIND_DATA% lpFindFileData
  4454. );
  4455. /*#!perl
  4456. ActivateAroundFunction("SearchPathA");
  4457. ActivateAroundFunction("SearchPathW");
  4458. DeclareFunctionErrorValue("SearchPathA", "0");
  4459. DeclareFunctionErrorValue("SearchPathW", "0");
  4460. */
  4461. WINBASEAPI
  4462. DWORD
  4463. WINAPI
  4464. SearchPath%(
  4465. IN LPCTSTR% lpPath,
  4466. IN LPCTSTR% lpFileName,
  4467. IN LPCTSTR% lpExtension,
  4468. IN DWORD nBufferLength,
  4469. OUT LPTSTR% lpBuffer,
  4470. OUT LPTSTR% *lpFilePart
  4471. );
  4472. WINBASEAPI
  4473. BOOL
  4474. WINAPI
  4475. CopyFile%(
  4476. IN LPCTSTR% lpExistingFileName,
  4477. IN LPCTSTR% lpNewFileName,
  4478. IN BOOL bFailIfExists
  4479. );
  4480. ;begin_sur
  4481. typedef
  4482. DWORD
  4483. (WINAPI *LPPROGRESS_ROUTINE)(
  4484. LARGE_INTEGER TotalFileSize,
  4485. LARGE_INTEGER TotalBytesTransferred,
  4486. LARGE_INTEGER StreamSize,
  4487. LARGE_INTEGER StreamBytesTransferred,
  4488. DWORD dwStreamNumber,
  4489. DWORD dwCallbackReason,
  4490. HANDLE hSourceFile,
  4491. HANDLE hDestinationFile,
  4492. LPVOID lpData OPTIONAL
  4493. );
  4494. WINBASEAPI
  4495. BOOL
  4496. WINAPI
  4497. CopyFileEx%(
  4498. IN LPCTSTR% lpExistingFileName,
  4499. IN LPCTSTR% lpNewFileName,
  4500. IN LPPROGRESS_ROUTINE lpProgressRoutine OPTIONAL,
  4501. IN LPVOID lpData OPTIONAL,
  4502. IN LPBOOL pbCancel OPTIONAL,
  4503. IN DWORD dwCopyFlags
  4504. );
  4505. ;end_sur
  4506. WINBASEAPI
  4507. BOOL
  4508. WINAPI
  4509. MoveFile%(
  4510. IN LPCTSTR% lpExistingFileName,
  4511. IN LPCTSTR% lpNewFileName
  4512. );
  4513. WINBASEAPI
  4514. BOOL
  4515. WINAPI
  4516. MoveFileEx%(
  4517. IN LPCTSTR% lpExistingFileName,
  4518. IN LPCTSTR% lpNewFileName,
  4519. IN DWORD dwFlags
  4520. );
  4521. #if (_WIN32_WINNT >= 0x0500)
  4522. WINBASEAPI
  4523. BOOL
  4524. WINAPI
  4525. MoveFileWithProgress%(
  4526. IN LPCTSTR% lpExistingFileName,
  4527. IN LPCTSTR% lpNewFileName,
  4528. IN LPPROGRESS_ROUTINE lpProgressRoutine OPTIONAL,
  4529. IN LPVOID lpData OPTIONAL,
  4530. IN DWORD dwFlags
  4531. );
  4532. #endif // (_WIN32_WINNT >= 0x0500)
  4533. #define MOVEFILE_REPLACE_EXISTING 0x00000001
  4534. #define MOVEFILE_COPY_ALLOWED 0x00000002
  4535. #define MOVEFILE_DELAY_UNTIL_REBOOT 0x00000004
  4536. #define MOVEFILE_WRITE_THROUGH 0x00000008
  4537. #if (_WIN32_WINNT >= 0x0500)
  4538. #define MOVEFILE_CREATE_HARDLINK 0x00000010
  4539. #define MOVEFILE_FAIL_IF_NOT_TRACKABLE 0x00000020
  4540. #endif // (_WIN32_WINNT >= 0x0500)
  4541. ;begin_internal
  4542. #if (_WIN32_WINNT >= 0x0500)
  4543. #define PRIVCOPY_FILE_METADATA 0x010 // Copy compression, DACL, (encryption)
  4544. #define PRIVCOPY_FILE_SACL 0x020 // Copy SACL
  4545. #define PRIVCOPY_FILE_OWNER_GROUP 0x040 // Copy owner & group
  4546. #define PRIVCOPY_FILE_DIRECTORY 0x080 // Copy directory file like a file
  4547. #define PRIVCOPY_FILE_BACKUP_SEMANTICS 0x100 // Use FILE_FLAG_BACKUP_SEMANTICS on open/creates.
  4548. #define PRIVCOPY_FILE_SUPERSEDE 0x200 // Replace original dest with source
  4549. #define PRIVCOPY_FILE_SKIP_DACL 0x400 // Workaround for csc/roamprofs
  4550. #define PRIVCOPY_FILE_VALID_FLAGS (PRIVCOPY_FILE_METADATA|PRIVCOPY_FILE_SACL|PRIVCOPY_FILE_OWNER_GROUP|PRIVCOPY_FILE_DIRECTORY|PRIVCOPY_FILE_SUPERSEDE|PRIVCOPY_FILE_BACKUP_SEMANTICS|PRIVCOPY_FILE_SKIP_DACL)
  4551. #define PRIVPROGRESS_REASON_NOT_HANDLED 4
  4552. #define PRIVCALLBACK_STREAMS_NOT_SUPPORTED 2
  4553. #define PRIVCALLBACK_COMPRESSION_NOT_SUPPORTED 5
  4554. #define PRIVCALLBACK_COMPRESSION_FAILED 6
  4555. #define PRIVCALLBACK_ENCRYPTION_NOT_SUPPORTED 8
  4556. #define PRIVCALLBACK_ENCRYPTION_FAILED 9
  4557. #define PRIVCALLBACK_EAS_NOT_SUPPORTED 10
  4558. #define PRIVCALLBACK_SPARSE_NOT_SUPPORTED 11
  4559. #define PRIVCALLBACK_SPARSE_FAILED 12
  4560. #define PRIVCALLBACK_DACL_ACCESS_DENIED 13
  4561. #define PRIVCALLBACK_OWNER_GROUP_ACCESS_DENIED 14
  4562. #define PRIVCALLBACK_OWNER_GROUP_FAILED 19
  4563. #define PRIVCALLBACK_SACL_ACCESS_DENIED 15
  4564. #define PRIVCALLBACK_SECURITY_INFORMATION_NOT_SUPPORTED 16
  4565. #define PRIVCALLBACK_CANT_ENCRYPT_SYSTEM_FILE 17
  4566. #define PRIVMOVE_FILEID_DELETE_OLD_FILE 0x01
  4567. #define PRIVMOVE_FILEID_IGNORE_ID_ERRORS 0x02
  4568. BOOL
  4569. APIENTRY
  4570. PrivMoveFileIdentityW(
  4571. LPCWSTR lpOldFileName,
  4572. LPCWSTR lpNewFileName,
  4573. DWORD dwFlags
  4574. );
  4575. BOOL
  4576. APIENTRY
  4577. PrivCopyFileExW(
  4578. LPCWSTR lpExistingFileName,
  4579. LPCWSTR lpNewFileName,
  4580. LPPROGRESS_ROUTINE lpProgressRoutine OPTIONAL,
  4581. LPVOID lpData OPTIONAL,
  4582. LPBOOL pbCancel OPTIONAL,
  4583. DWORD dwCopyFlags
  4584. );
  4585. #endif // (_WIN32_WINNT >= 0x0500)
  4586. ;end_internal
  4587. #if (_WIN32_WINNT >= 0x0500)
  4588. WINBASEAPI
  4589. BOOL
  4590. WINAPI
  4591. ReplaceFileA(
  4592. LPCSTR lpReplacedFileName,
  4593. LPCSTR lpReplacementFileName,
  4594. LPCSTR lpBackupFileName,
  4595. DWORD dwReplaceFlags,
  4596. LPVOID lpExclude,
  4597. LPVOID lpReserved
  4598. );
  4599. WINBASEAPI
  4600. BOOL
  4601. WINAPI
  4602. ReplaceFileW(
  4603. LPCWSTR lpReplacedFileName,
  4604. LPCWSTR lpReplacementFileName,
  4605. LPCWSTR lpBackupFileName,
  4606. DWORD dwReplaceFlags,
  4607. LPVOID lpExclude,
  4608. LPVOID lpReserved
  4609. );
  4610. #ifdef UNICODE
  4611. #define ReplaceFile ReplaceFileW
  4612. #else
  4613. #define ReplaceFile ReplaceFileA
  4614. #endif // !UNICODE
  4615. #endif // (_WIN32_WINNT >= 0x0500)
  4616. #if (_WIN32_WINNT >= 0x0500)
  4617. //
  4618. // API call to create hard links.
  4619. //
  4620. WINBASEAPI
  4621. BOOL
  4622. WINAPI
  4623. CreateHardLink%(
  4624. IN LPCTSTR% lpFileName,
  4625. IN LPCTSTR% lpExistingFileName,
  4626. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes
  4627. );
  4628. #endif // (_WIN32_WINNT >= 0x0500)
  4629. WINBASEAPI
  4630. HANDLE
  4631. WINAPI
  4632. CreateNamedPipe%(
  4633. IN LPCTSTR% lpName,
  4634. IN DWORD dwOpenMode,
  4635. IN DWORD dwPipeMode,
  4636. IN DWORD nMaxInstances,
  4637. IN DWORD nOutBufferSize,
  4638. IN DWORD nInBufferSize,
  4639. IN DWORD nDefaultTimeOut,
  4640. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes
  4641. );
  4642. WINBASEAPI
  4643. BOOL
  4644. WINAPI
  4645. GetNamedPipeHandleState%(
  4646. IN HANDLE hNamedPipe,
  4647. OUT LPDWORD lpState,
  4648. OUT LPDWORD lpCurInstances,
  4649. OUT LPDWORD lpMaxCollectionCount,
  4650. OUT LPDWORD lpCollectDataTimeout,
  4651. OUT LPTSTR% lpUserName,
  4652. IN DWORD nMaxUserNameSize
  4653. );
  4654. WINBASEAPI
  4655. BOOL
  4656. WINAPI
  4657. CallNamedPipe%(
  4658. IN LPCTSTR% lpNamedPipeName,
  4659. IN LPVOID lpInBuffer,
  4660. IN DWORD nInBufferSize,
  4661. OUT LPVOID lpOutBuffer,
  4662. IN DWORD nOutBufferSize,
  4663. OUT LPDWORD lpBytesRead,
  4664. IN DWORD nTimeOut
  4665. );
  4666. WINBASEAPI
  4667. BOOL
  4668. WINAPI
  4669. WaitNamedPipe%(
  4670. IN LPCTSTR% lpNamedPipeName,
  4671. IN DWORD nTimeOut
  4672. );
  4673. WINBASEAPI
  4674. BOOL
  4675. WINAPI
  4676. SetVolumeLabel%(
  4677. IN LPCTSTR% lpRootPathName,
  4678. IN LPCTSTR% lpVolumeName
  4679. );
  4680. WINBASEAPI
  4681. VOID
  4682. WINAPI
  4683. SetFileApisToOEM( VOID );
  4684. WINBASEAPI
  4685. VOID
  4686. WINAPI
  4687. SetFileApisToANSI( VOID );
  4688. WINBASEAPI
  4689. BOOL
  4690. WINAPI
  4691. AreFileApisANSI( VOID );
  4692. WINBASEAPI
  4693. BOOL
  4694. WINAPI
  4695. GetVolumeInformation%(
  4696. IN LPCTSTR% lpRootPathName,
  4697. OUT LPTSTR% lpVolumeNameBuffer,
  4698. IN DWORD nVolumeNameSize,
  4699. OUT LPDWORD lpVolumeSerialNumber,
  4700. OUT LPDWORD lpMaximumComponentLength,
  4701. OUT LPDWORD lpFileSystemFlags,
  4702. OUT LPTSTR% lpFileSystemNameBuffer,
  4703. IN DWORD nFileSystemNameSize
  4704. );
  4705. WINBASEAPI
  4706. BOOL
  4707. WINAPI
  4708. CancelIo(
  4709. IN HANDLE hFile
  4710. );
  4711. //
  4712. // Event logging APIs
  4713. //
  4714. WINADVAPI
  4715. BOOL
  4716. WINAPI
  4717. ClearEventLog% (
  4718. IN HANDLE hEventLog,
  4719. IN LPCTSTR% lpBackupFileName
  4720. );
  4721. WINADVAPI
  4722. BOOL
  4723. WINAPI
  4724. BackupEventLog% (
  4725. IN HANDLE hEventLog,
  4726. IN LPCTSTR% lpBackupFileName
  4727. );
  4728. WINADVAPI
  4729. BOOL
  4730. WINAPI
  4731. CloseEventLog (
  4732. IN OUT HANDLE hEventLog
  4733. );
  4734. WINADVAPI
  4735. BOOL
  4736. WINAPI
  4737. DeregisterEventSource (
  4738. IN OUT HANDLE hEventLog
  4739. );
  4740. WINADVAPI
  4741. BOOL
  4742. WINAPI
  4743. NotifyChangeEventLog(
  4744. IN HANDLE hEventLog,
  4745. IN HANDLE hEvent
  4746. );
  4747. WINADVAPI
  4748. BOOL
  4749. WINAPI
  4750. GetNumberOfEventLogRecords (
  4751. IN HANDLE hEventLog,
  4752. OUT PDWORD NumberOfRecords
  4753. );
  4754. WINADVAPI
  4755. BOOL
  4756. WINAPI
  4757. GetOldestEventLogRecord (
  4758. IN HANDLE hEventLog,
  4759. OUT PDWORD OldestRecord
  4760. );
  4761. WINADVAPI
  4762. HANDLE
  4763. WINAPI
  4764. OpenEventLog% (
  4765. IN LPCTSTR% lpUNCServerName,
  4766. IN LPCTSTR% lpSourceName
  4767. );
  4768. WINADVAPI
  4769. HANDLE
  4770. WINAPI
  4771. RegisterEventSource% (
  4772. IN LPCTSTR% lpUNCServerName,
  4773. IN LPCTSTR% lpSourceName
  4774. );
  4775. WINADVAPI
  4776. HANDLE
  4777. WINAPI
  4778. OpenBackupEventLog% (
  4779. IN LPCTSTR% lpUNCServerName,
  4780. IN LPCTSTR% lpFileName
  4781. );
  4782. WINADVAPI
  4783. BOOL
  4784. WINAPI
  4785. ReadEventLog% (
  4786. IN HANDLE hEventLog,
  4787. IN DWORD dwReadFlags,
  4788. IN DWORD dwRecordOffset,
  4789. OUT LPVOID lpBuffer,
  4790. IN DWORD nNumberOfBytesToRead,
  4791. OUT DWORD *pnBytesRead,
  4792. OUT DWORD *pnMinNumberOfBytesNeeded
  4793. );
  4794. WINADVAPI
  4795. BOOL
  4796. WINAPI
  4797. ReportEvent% (
  4798. IN HANDLE hEventLog,
  4799. IN WORD wType,
  4800. IN WORD wCategory,
  4801. IN DWORD dwEventID,
  4802. IN PSID lpUserSid,
  4803. IN WORD wNumStrings,
  4804. IN DWORD dwDataSize,
  4805. IN LPCTSTR% *lpStrings,
  4806. IN LPVOID lpRawData
  4807. );
  4808. #define EVENTLOG_FULL_INFO 0
  4809. typedef struct _EVENTLOG_FULL_INFORMATION
  4810. {
  4811. DWORD dwFull;
  4812. }
  4813. EVENTLOG_FULL_INFORMATION, *LPEVENTLOG_FULL_INFORMATION;
  4814. WINADVAPI
  4815. BOOL
  4816. WINAPI
  4817. GetEventLogInformation (
  4818. IN HANDLE hEventLog,
  4819. IN DWORD dwInfoLevel,
  4820. OUT LPVOID lpBuffer,
  4821. IN DWORD cbBufSize,
  4822. OUT LPDWORD pcbBytesNeeded
  4823. );
  4824. //
  4825. //
  4826. // Security APIs
  4827. //
  4828. WINADVAPI
  4829. BOOL
  4830. WINAPI
  4831. DuplicateToken(
  4832. IN HANDLE ExistingTokenHandle,
  4833. IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
  4834. OUT PHANDLE DuplicateTokenHandle
  4835. );
  4836. WINADVAPI
  4837. BOOL
  4838. WINAPI
  4839. GetKernelObjectSecurity (
  4840. IN HANDLE Handle,
  4841. IN SECURITY_INFORMATION RequestedInformation,
  4842. OUT PSECURITY_DESCRIPTOR pSecurityDescriptor,
  4843. IN DWORD nLength,
  4844. OUT LPDWORD lpnLengthNeeded
  4845. );
  4846. WINADVAPI
  4847. BOOL
  4848. WINAPI
  4849. ImpersonateNamedPipeClient(
  4850. IN HANDLE hNamedPipe
  4851. );
  4852. WINADVAPI
  4853. BOOL
  4854. WINAPI
  4855. ImpersonateSelf(
  4856. IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
  4857. );
  4858. WINADVAPI
  4859. BOOL
  4860. WINAPI
  4861. RevertToSelf (
  4862. VOID
  4863. );
  4864. WINADVAPI
  4865. BOOL
  4866. APIENTRY
  4867. SetThreadToken (
  4868. IN PHANDLE Thread,
  4869. IN HANDLE Token
  4870. );
  4871. WINADVAPI
  4872. BOOL
  4873. WINAPI
  4874. AccessCheck (
  4875. IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
  4876. IN HANDLE ClientToken,
  4877. IN DWORD DesiredAccess,
  4878. IN PGENERIC_MAPPING GenericMapping,
  4879. OUT PPRIVILEGE_SET PrivilegeSet,
  4880. IN LPDWORD PrivilegeSetLength,
  4881. OUT LPDWORD GrantedAccess,
  4882. OUT LPBOOL AccessStatus
  4883. );
  4884. #if(_WIN32_WINNT >= 0x0500)
  4885. WINADVAPI
  4886. BOOL
  4887. WINAPI
  4888. AccessCheckByType (
  4889. IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
  4890. IN PSID PrincipalSelfSid,
  4891. IN HANDLE ClientToken,
  4892. IN DWORD DesiredAccess,
  4893. OUT POBJECT_TYPE_LIST ObjectTypeList,
  4894. IN DWORD ObjectTypeListLength,
  4895. OUT PGENERIC_MAPPING GenericMapping,
  4896. OUT PPRIVILEGE_SET PrivilegeSet,
  4897. OUT LPDWORD PrivilegeSetLength,
  4898. OUT LPDWORD GrantedAccess,
  4899. OUT LPBOOL AccessStatus
  4900. );
  4901. WINADVAPI
  4902. BOOL
  4903. WINAPI
  4904. AccessCheckByTypeResultList (
  4905. IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
  4906. IN PSID PrincipalSelfSid,
  4907. IN HANDLE ClientToken,
  4908. IN DWORD DesiredAccess,
  4909. OUT POBJECT_TYPE_LIST ObjectTypeList,
  4910. IN DWORD ObjectTypeListLength,
  4911. OUT PGENERIC_MAPPING GenericMapping,
  4912. OUT PPRIVILEGE_SET PrivilegeSet,
  4913. OUT LPDWORD PrivilegeSetLength,
  4914. OUT LPDWORD GrantedAccessList,
  4915. OUT LPDWORD AccessStatusList
  4916. );
  4917. #endif /* _WIN32_WINNT >= 0x0500 */
  4918. WINADVAPI
  4919. BOOL
  4920. WINAPI
  4921. OpenProcessToken (
  4922. IN HANDLE ProcessHandle,
  4923. IN DWORD DesiredAccess,
  4924. OUT PHANDLE TokenHandle
  4925. );
  4926. WINADVAPI
  4927. BOOL
  4928. WINAPI
  4929. OpenThreadToken (
  4930. IN HANDLE ThreadHandle,
  4931. IN DWORD DesiredAccess,
  4932. IN BOOL OpenAsSelf,
  4933. OUT PHANDLE TokenHandle
  4934. );
  4935. WINADVAPI
  4936. BOOL
  4937. WINAPI
  4938. GetTokenInformation (
  4939. IN HANDLE TokenHandle,
  4940. IN TOKEN_INFORMATION_CLASS TokenInformationClass,
  4941. OUT LPVOID TokenInformation,
  4942. IN DWORD TokenInformationLength,
  4943. OUT PDWORD ReturnLength
  4944. );
  4945. WINADVAPI
  4946. BOOL
  4947. WINAPI
  4948. SetTokenInformation (
  4949. IN HANDLE TokenHandle,
  4950. IN TOKEN_INFORMATION_CLASS TokenInformationClass,
  4951. IN LPVOID TokenInformation,
  4952. IN DWORD TokenInformationLength
  4953. );
  4954. WINADVAPI
  4955. BOOL
  4956. WINAPI
  4957. AdjustTokenPrivileges (
  4958. IN HANDLE TokenHandle,
  4959. IN BOOL DisableAllPrivileges,
  4960. IN PTOKEN_PRIVILEGES NewState,
  4961. IN DWORD BufferLength,
  4962. OUT PTOKEN_PRIVILEGES PreviousState,
  4963. OUT PDWORD ReturnLength
  4964. );
  4965. WINADVAPI
  4966. BOOL
  4967. WINAPI
  4968. AdjustTokenGroups (
  4969. IN HANDLE TokenHandle,
  4970. IN BOOL ResetToDefault,
  4971. IN PTOKEN_GROUPS NewState,
  4972. IN DWORD BufferLength,
  4973. OUT PTOKEN_GROUPS PreviousState,
  4974. OUT PDWORD ReturnLength
  4975. );
  4976. WINADVAPI
  4977. BOOL
  4978. WINAPI
  4979. PrivilegeCheck (
  4980. IN HANDLE ClientToken,
  4981. IN PPRIVILEGE_SET RequiredPrivileges,
  4982. OUT LPBOOL pfResult
  4983. );
  4984. WINADVAPI
  4985. BOOL
  4986. WINAPI
  4987. AccessCheckAndAuditAlarm% (
  4988. IN LPCTSTR% SubsystemName,
  4989. IN LPVOID HandleId,
  4990. IN LPTSTR% ObjectTypeName,
  4991. IN LPTSTR% ObjectName,
  4992. IN PSECURITY_DESCRIPTOR SecurityDescriptor,
  4993. IN DWORD DesiredAccess,
  4994. IN PGENERIC_MAPPING GenericMapping,
  4995. IN BOOL ObjectCreation,
  4996. OUT LPDWORD GrantedAccess,
  4997. OUT LPBOOL AccessStatus,
  4998. OUT LPBOOL pfGenerateOnClose
  4999. );
  5000. #if(_WIN32_WINNT >= 0x0500)
  5001. WINADVAPI
  5002. BOOL
  5003. WINAPI
  5004. AccessCheckByTypeAndAuditAlarm% (
  5005. IN LPCTSTR% SubsystemName,
  5006. IN LPVOID HandleId,
  5007. IN LPCTSTR% ObjectTypeName,
  5008. IN LPCTSTR% ObjectName,
  5009. IN PSECURITY_DESCRIPTOR SecurityDescriptor,
  5010. IN PSID PrincipalSelfSid,
  5011. IN DWORD DesiredAccess,
  5012. IN AUDIT_EVENT_TYPE AuditType,
  5013. IN DWORD Flags,
  5014. IN POBJECT_TYPE_LIST ObjectTypeList,
  5015. IN DWORD ObjectTypeListLength,
  5016. IN PGENERIC_MAPPING GenericMapping,
  5017. IN BOOL ObjectCreation,
  5018. OUT LPDWORD GrantedAccess,
  5019. OUT LPBOOL AccessStatus,
  5020. OUT LPBOOL pfGenerateOnClose
  5021. );
  5022. WINADVAPI
  5023. BOOL
  5024. WINAPI
  5025. AccessCheckByTypeResultListAndAuditAlarm% (
  5026. IN LPCTSTR% SubsystemName,
  5027. IN LPVOID HandleId,
  5028. IN LPCTSTR% ObjectTypeName,
  5029. IN LPCTSTR% ObjectName,
  5030. IN PSECURITY_DESCRIPTOR SecurityDescriptor,
  5031. IN PSID PrincipalSelfSid,
  5032. IN DWORD DesiredAccess,
  5033. IN AUDIT_EVENT_TYPE AuditType,
  5034. IN DWORD Flags,
  5035. IN POBJECT_TYPE_LIST ObjectTypeList,
  5036. IN DWORD ObjectTypeListLength,
  5037. IN PGENERIC_MAPPING GenericMapping,
  5038. IN BOOL ObjectCreation,
  5039. OUT LPDWORD GrantedAccess,
  5040. OUT LPDWORD AccessStatusList,
  5041. OUT LPBOOL pfGenerateOnClose
  5042. );
  5043. WINADVAPI
  5044. BOOL
  5045. WINAPI
  5046. AccessCheckByTypeResultListAndAuditAlarmByHandle% (
  5047. IN LPCTSTR% SubsystemName,
  5048. IN LPVOID HandleId,
  5049. IN HANDLE ClientToken,
  5050. IN LPCTSTR% ObjectTypeName,
  5051. IN LPCTSTR% ObjectName,
  5052. IN PSECURITY_DESCRIPTOR SecurityDescriptor,
  5053. IN PSID PrincipalSelfSid,
  5054. IN DWORD DesiredAccess,
  5055. IN AUDIT_EVENT_TYPE AuditType,
  5056. IN DWORD Flags,
  5057. IN POBJECT_TYPE_LIST ObjectTypeList,
  5058. IN DWORD ObjectTypeListLength,
  5059. IN PGENERIC_MAPPING GenericMapping,
  5060. IN BOOL ObjectCreation,
  5061. OUT LPDWORD GrantedAccess,
  5062. OUT LPDWORD AccessStatusList,
  5063. OUT LPBOOL pfGenerateOnClose
  5064. );
  5065. #endif //(_WIN32_WINNT >= 0x0500)
  5066. WINADVAPI
  5067. BOOL
  5068. WINAPI
  5069. ObjectOpenAuditAlarm% (
  5070. IN LPCTSTR% SubsystemName,
  5071. IN LPVOID HandleId,
  5072. IN LPTSTR% ObjectTypeName,
  5073. IN LPTSTR% ObjectName,
  5074. IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
  5075. IN HANDLE ClientToken,
  5076. IN DWORD DesiredAccess,
  5077. IN DWORD GrantedAccess,
  5078. IN PPRIVILEGE_SET Privileges,
  5079. IN BOOL ObjectCreation,
  5080. IN BOOL AccessGranted,
  5081. OUT LPBOOL GenerateOnClose
  5082. );
  5083. WINADVAPI
  5084. BOOL
  5085. WINAPI
  5086. ObjectPrivilegeAuditAlarm% (
  5087. IN LPCTSTR% SubsystemName,
  5088. IN LPVOID HandleId,
  5089. IN HANDLE ClientToken,
  5090. IN DWORD DesiredAccess,
  5091. IN PPRIVILEGE_SET Privileges,
  5092. IN BOOL AccessGranted
  5093. );
  5094. WINADVAPI
  5095. BOOL
  5096. WINAPI
  5097. ObjectCloseAuditAlarm% (
  5098. IN LPCTSTR% SubsystemName,
  5099. IN LPVOID HandleId,
  5100. IN BOOL GenerateOnClose
  5101. );
  5102. WINADVAPI
  5103. BOOL
  5104. WINAPI
  5105. ObjectDeleteAuditAlarm% (
  5106. IN LPCTSTR% SubsystemName,
  5107. IN LPVOID HandleId,
  5108. IN BOOL GenerateOnClose
  5109. );
  5110. WINADVAPI
  5111. BOOL
  5112. WINAPI
  5113. PrivilegedServiceAuditAlarm% (
  5114. IN LPCTSTR% SubsystemName,
  5115. IN LPCTSTR% ServiceName,
  5116. IN HANDLE ClientToken,
  5117. IN PPRIVILEGE_SET Privileges,
  5118. IN BOOL AccessGranted
  5119. );
  5120. #if(_WIN32_WINNT >= 0x0501)
  5121. typedef enum {
  5122. WinNullSid = 0,
  5123. WinWorldSid = 1,
  5124. WinLocalSid = 2,
  5125. WinCreatorOwnerSid = 3,
  5126. WinCreatorGroupSid = 4,
  5127. WinCreatorOwnerServerSid = 5,
  5128. WinCreatorGroupServerSid = 6,
  5129. WinNtAuthoritySid = 7,
  5130. WinDialupSid = 8,
  5131. WinNetworkSid = 9,
  5132. WinBatchSid = 10,
  5133. WinInteractiveSid = 11,
  5134. WinServiceSid = 12,
  5135. WinAnonymousSid = 13,
  5136. WinProxySid = 14,
  5137. WinEnterpriseControllersSid = 15,
  5138. WinSelfSid = 16,
  5139. WinAuthenticatedUserSid = 17,
  5140. WinRestrictedCodeSid = 18,
  5141. WinTerminalServerSid = 19,
  5142. WinRemoteLogonIdSid = 20,
  5143. WinLogonIdsSid = 21,
  5144. WinLocalSystemSid = 22,
  5145. WinLocalServiceSid = 23,
  5146. WinNetworkServiceSid = 24,
  5147. WinBuiltinDomainSid = 25,
  5148. WinBuiltinAdministratorsSid = 26,
  5149. WinBuiltinUsersSid = 27,
  5150. WinBuiltinGuestsSid = 28,
  5151. WinBuiltinPowerUsersSid = 29,
  5152. WinBuiltinAccountOperatorsSid = 30,
  5153. WinBuiltinSystemOperatorsSid = 31,
  5154. WinBuiltinPrintOperatorsSid = 32,
  5155. WinBuiltinBackupOperatorsSid = 33,
  5156. WinBuiltinReplicatorSid = 34,
  5157. WinBuiltinPreWindows2000CompatibleAccessSid = 35,
  5158. WinBuiltinRemoteDesktopUsersSid = 36,
  5159. WinBuiltinNetworkConfigurationOperatorsSid = 37,
  5160. WinAccountAdministratorSid = 38,
  5161. WinAccountGuestSid = 39,
  5162. WinAccountKrbtgtSid = 40,
  5163. WinAccountDomainAdminsSid = 41,
  5164. WinAccountDomainUsersSid = 42,
  5165. WinAccountDomainGuestsSid = 43,
  5166. WinAccountComputersSid = 44,
  5167. WinAccountControllersSid = 45,
  5168. WinAccountCertAdminsSid = 46,
  5169. WinAccountSchemaAdminsSid = 47,
  5170. WinAccountEnterpriseAdminsSid = 48,
  5171. WinAccountPolicyAdminsSid = 49,
  5172. WinAccountRasAndIasServersSid = 50,
  5173. } WELL_KNOWN_SID_TYPE;
  5174. WINADVAPI
  5175. BOOL
  5176. WINAPI
  5177. IsWellKnownSid (
  5178. IN PSID pSid,
  5179. IN WELL_KNOWN_SID_TYPE WellKnownSidType
  5180. );
  5181. WINADVAPI
  5182. BOOL
  5183. WINAPI
  5184. CreateWellKnownSid(
  5185. IN WELL_KNOWN_SID_TYPE WellKnownSidType,
  5186. IN PSID DomainSid OPTIONAL,
  5187. OUT PSID pSid,
  5188. IN OUT DWORD *cbSid
  5189. );
  5190. WINADVAPI
  5191. BOOL
  5192. WINAPI
  5193. EqualDomainSid(
  5194. IN PSID pSid1,
  5195. IN PSID pSid2,
  5196. OUT BOOL *pfEqual
  5197. );
  5198. WINADVAPI
  5199. BOOL
  5200. WINAPI
  5201. GetWindowsAccountDomainSid(
  5202. IN PSID pSid,
  5203. OUT PSID ppDomainSid OPTIONAL,
  5204. IN OUT DWORD *cbSid
  5205. );
  5206. #endif //(_WIN32_WINNT >= 0x0501)
  5207. WINADVAPI
  5208. BOOL
  5209. WINAPI
  5210. IsValidSid (
  5211. IN PSID pSid
  5212. );
  5213. WINADVAPI
  5214. BOOL
  5215. WINAPI
  5216. EqualSid (
  5217. IN PSID pSid1,
  5218. IN PSID pSid2
  5219. );
  5220. WINADVAPI
  5221. BOOL
  5222. WINAPI
  5223. EqualPrefixSid (
  5224. PSID pSid1,
  5225. PSID pSid2
  5226. );
  5227. WINADVAPI
  5228. DWORD
  5229. WINAPI
  5230. GetSidLengthRequired (
  5231. IN UCHAR nSubAuthorityCount
  5232. );
  5233. WINADVAPI
  5234. BOOL
  5235. WINAPI
  5236. AllocateAndInitializeSid (
  5237. IN PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
  5238. IN BYTE nSubAuthorityCount,
  5239. IN DWORD nSubAuthority0,
  5240. IN DWORD nSubAuthority1,
  5241. IN DWORD nSubAuthority2,
  5242. IN DWORD nSubAuthority3,
  5243. IN DWORD nSubAuthority4,
  5244. IN DWORD nSubAuthority5,
  5245. IN DWORD nSubAuthority6,
  5246. IN DWORD nSubAuthority7,
  5247. OUT PSID *pSid
  5248. );
  5249. WINADVAPI
  5250. PVOID
  5251. WINAPI
  5252. FreeSid(
  5253. IN PSID pSid
  5254. );
  5255. WINADVAPI
  5256. BOOL
  5257. WINAPI
  5258. InitializeSid (
  5259. OUT PSID Sid,
  5260. IN PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
  5261. IN BYTE nSubAuthorityCount
  5262. );
  5263. WINADVAPI
  5264. PSID_IDENTIFIER_AUTHORITY
  5265. WINAPI
  5266. GetSidIdentifierAuthority (
  5267. IN PSID pSid
  5268. );
  5269. WINADVAPI
  5270. PDWORD
  5271. WINAPI
  5272. GetSidSubAuthority (
  5273. IN PSID pSid,
  5274. IN DWORD nSubAuthority
  5275. );
  5276. WINADVAPI
  5277. PUCHAR
  5278. WINAPI
  5279. GetSidSubAuthorityCount (
  5280. IN PSID pSid
  5281. );
  5282. WINADVAPI
  5283. DWORD
  5284. WINAPI
  5285. GetLengthSid (
  5286. IN PSID pSid
  5287. );
  5288. WINADVAPI
  5289. BOOL
  5290. WINAPI
  5291. CopySid (
  5292. IN DWORD nDestinationSidLength,
  5293. OUT PSID pDestinationSid,
  5294. IN PSID pSourceSid
  5295. );
  5296. WINADVAPI
  5297. BOOL
  5298. WINAPI
  5299. AreAllAccessesGranted (
  5300. IN DWORD GrantedAccess,
  5301. IN DWORD DesiredAccess
  5302. );
  5303. WINADVAPI
  5304. BOOL
  5305. WINAPI
  5306. AreAnyAccessesGranted (
  5307. IN DWORD GrantedAccess,
  5308. IN DWORD DesiredAccess
  5309. );
  5310. WINADVAPI
  5311. VOID
  5312. WINAPI
  5313. MapGenericMask (
  5314. OUT PDWORD AccessMask,
  5315. IN PGENERIC_MAPPING GenericMapping
  5316. );
  5317. WINADVAPI
  5318. BOOL
  5319. WINAPI
  5320. IsValidAcl (
  5321. IN PACL pAcl
  5322. );
  5323. WINADVAPI
  5324. BOOL
  5325. WINAPI
  5326. InitializeAcl (
  5327. OUT PACL pAcl,
  5328. IN DWORD nAclLength,
  5329. IN DWORD dwAclRevision
  5330. );
  5331. WINADVAPI
  5332. BOOL
  5333. WINAPI
  5334. GetAclInformation (
  5335. IN PACL pAcl,
  5336. OUT LPVOID pAclInformation,
  5337. IN DWORD nAclInformationLength,
  5338. IN ACL_INFORMATION_CLASS dwAclInformationClass
  5339. );
  5340. WINADVAPI
  5341. BOOL
  5342. WINAPI
  5343. SetAclInformation (
  5344. IN PACL pAcl,
  5345. IN LPVOID pAclInformation,
  5346. IN DWORD nAclInformationLength,
  5347. IN ACL_INFORMATION_CLASS dwAclInformationClass
  5348. );
  5349. WINADVAPI
  5350. BOOL
  5351. WINAPI
  5352. AddAce (
  5353. IN OUT PACL pAcl,
  5354. IN DWORD dwAceRevision,
  5355. IN DWORD dwStartingAceIndex,
  5356. IN LPVOID pAceList,
  5357. IN DWORD nAceListLength
  5358. );
  5359. WINADVAPI
  5360. BOOL
  5361. WINAPI
  5362. DeleteAce (
  5363. IN OUT PACL pAcl,
  5364. IN DWORD dwAceIndex
  5365. );
  5366. WINADVAPI
  5367. BOOL
  5368. WINAPI
  5369. GetAce (
  5370. IN PACL pAcl,
  5371. IN DWORD dwAceIndex,
  5372. OUT LPVOID *pAce
  5373. );
  5374. WINADVAPI
  5375. BOOL
  5376. WINAPI
  5377. AddAccessAllowedAce (
  5378. IN OUT PACL pAcl,
  5379. IN DWORD dwAceRevision,
  5380. IN DWORD AccessMask,
  5381. IN PSID pSid
  5382. );
  5383. #if(_WIN32_WINNT >= 0x0500)
  5384. WINADVAPI
  5385. BOOL
  5386. WINAPI
  5387. AddAccessAllowedAceEx (
  5388. IN OUT PACL pAcl,
  5389. IN DWORD dwAceRevision,
  5390. IN DWORD AceFlags,
  5391. IN DWORD AccessMask,
  5392. IN PSID pSid
  5393. );
  5394. #endif /* _WIN32_WINNT >= 0x0500 */
  5395. WINADVAPI
  5396. BOOL
  5397. WINAPI
  5398. AddAccessDeniedAce (
  5399. IN OUT PACL pAcl,
  5400. IN DWORD dwAceRevision,
  5401. IN DWORD AccessMask,
  5402. IN PSID pSid
  5403. );
  5404. #if(_WIN32_WINNT >= 0x0500)
  5405. WINADVAPI
  5406. BOOL
  5407. WINAPI
  5408. AddAccessDeniedAceEx (
  5409. IN OUT PACL pAcl,
  5410. IN DWORD dwAceRevision,
  5411. IN DWORD AceFlags,
  5412. IN DWORD AccessMask,
  5413. IN PSID pSid
  5414. );
  5415. #endif /* _WIN32_WINNT >= 0x0500 */
  5416. WINADVAPI
  5417. BOOL
  5418. WINAPI
  5419. AddAuditAccessAce(
  5420. IN OUT PACL pAcl,
  5421. IN DWORD dwAceRevision,
  5422. IN DWORD dwAccessMask,
  5423. IN PSID pSid,
  5424. IN BOOL bAuditSuccess,
  5425. IN BOOL bAuditFailure
  5426. );
  5427. #if(_WIN32_WINNT >= 0x0500)
  5428. WINADVAPI
  5429. BOOL
  5430. WINAPI
  5431. AddAuditAccessAceEx(
  5432. IN OUT PACL pAcl,
  5433. IN DWORD dwAceRevision,
  5434. IN DWORD AceFlags,
  5435. IN DWORD dwAccessMask,
  5436. IN PSID pSid,
  5437. IN BOOL bAuditSuccess,
  5438. IN BOOL bAuditFailure
  5439. );
  5440. WINADVAPI
  5441. BOOL
  5442. WINAPI
  5443. AddAccessAllowedObjectAce (
  5444. IN OUT PACL pAcl,
  5445. IN DWORD dwAceRevision,
  5446. IN DWORD AceFlags,
  5447. IN DWORD AccessMask,
  5448. IN GUID *ObjectTypeGuid,
  5449. IN GUID *InheritedObjectTypeGuid,
  5450. IN PSID pSid
  5451. );
  5452. WINADVAPI
  5453. BOOL
  5454. WINAPI
  5455. AddAccessDeniedObjectAce (
  5456. IN OUT PACL pAcl,
  5457. IN DWORD dwAceRevision,
  5458. IN DWORD AceFlags,
  5459. IN DWORD AccessMask,
  5460. IN GUID *ObjectTypeGuid,
  5461. IN GUID *InheritedObjectTypeGuid,
  5462. IN PSID pSid
  5463. );
  5464. WINADVAPI
  5465. BOOL
  5466. WINAPI
  5467. AddAuditAccessObjectAce (
  5468. IN OUT PACL pAcl,
  5469. IN DWORD dwAceRevision,
  5470. IN DWORD AceFlags,
  5471. IN DWORD AccessMask,
  5472. IN GUID *ObjectTypeGuid,
  5473. IN GUID *InheritedObjectTypeGuid,
  5474. IN PSID pSid,
  5475. IN BOOL bAuditSuccess,
  5476. IN BOOL bAuditFailure
  5477. );
  5478. #endif /* _WIN32_WINNT >= 0x0500 */
  5479. WINADVAPI
  5480. BOOL
  5481. WINAPI
  5482. FindFirstFreeAce (
  5483. IN PACL pAcl,
  5484. OUT LPVOID *pAce
  5485. );
  5486. WINADVAPI
  5487. BOOL
  5488. WINAPI
  5489. InitializeSecurityDescriptor (
  5490. OUT PSECURITY_DESCRIPTOR pSecurityDescriptor,
  5491. IN DWORD dwRevision
  5492. );
  5493. WINADVAPI
  5494. BOOL
  5495. WINAPI
  5496. IsValidSecurityDescriptor (
  5497. IN PSECURITY_DESCRIPTOR pSecurityDescriptor
  5498. );
  5499. WINADVAPI
  5500. DWORD
  5501. WINAPI
  5502. GetSecurityDescriptorLength (
  5503. IN PSECURITY_DESCRIPTOR pSecurityDescriptor
  5504. );
  5505. WINADVAPI
  5506. BOOL
  5507. WINAPI
  5508. GetSecurityDescriptorControl (
  5509. IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
  5510. OUT PSECURITY_DESCRIPTOR_CONTROL pControl,
  5511. OUT LPDWORD lpdwRevision
  5512. );
  5513. #if(_WIN32_WINNT >= 0x0500)
  5514. WINADVAPI
  5515. BOOL
  5516. WINAPI
  5517. SetSecurityDescriptorControl (
  5518. IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
  5519. IN SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest,
  5520. IN SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet
  5521. );
  5522. #endif /* _WIN32_WINNT >= 0x0500 */
  5523. WINADVAPI
  5524. BOOL
  5525. WINAPI
  5526. SetSecurityDescriptorDacl (
  5527. IN OUT PSECURITY_DESCRIPTOR pSecurityDescriptor,
  5528. IN BOOL bDaclPresent,
  5529. IN PACL pDacl,
  5530. IN BOOL bDaclDefaulted
  5531. );
  5532. WINADVAPI
  5533. BOOL
  5534. WINAPI
  5535. GetSecurityDescriptorDacl (
  5536. IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
  5537. OUT LPBOOL lpbDaclPresent,
  5538. OUT PACL *pDacl,
  5539. OUT LPBOOL lpbDaclDefaulted
  5540. );
  5541. WINADVAPI
  5542. BOOL
  5543. WINAPI
  5544. SetSecurityDescriptorSacl (
  5545. IN OUT PSECURITY_DESCRIPTOR pSecurityDescriptor,
  5546. IN BOOL bSaclPresent,
  5547. IN PACL pSacl,
  5548. IN BOOL bSaclDefaulted
  5549. );
  5550. WINADVAPI
  5551. BOOL
  5552. WINAPI
  5553. GetSecurityDescriptorSacl (
  5554. IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
  5555. OUT LPBOOL lpbSaclPresent,
  5556. OUT PACL *pSacl,
  5557. OUT LPBOOL lpbSaclDefaulted
  5558. );
  5559. WINADVAPI
  5560. BOOL
  5561. WINAPI
  5562. SetSecurityDescriptorOwner (
  5563. IN OUT PSECURITY_DESCRIPTOR pSecurityDescriptor,
  5564. IN PSID pOwner,
  5565. IN BOOL bOwnerDefaulted
  5566. );
  5567. WINADVAPI
  5568. BOOL
  5569. WINAPI
  5570. GetSecurityDescriptorOwner (
  5571. IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
  5572. OUT PSID *pOwner,
  5573. OUT LPBOOL lpbOwnerDefaulted
  5574. );
  5575. WINADVAPI
  5576. BOOL
  5577. WINAPI
  5578. SetSecurityDescriptorGroup (
  5579. IN OUT PSECURITY_DESCRIPTOR pSecurityDescriptor,
  5580. IN PSID pGroup,
  5581. IN BOOL bGroupDefaulted
  5582. );
  5583. WINADVAPI
  5584. BOOL
  5585. WINAPI
  5586. GetSecurityDescriptorGroup (
  5587. IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
  5588. OUT PSID *pGroup,
  5589. OUT LPBOOL lpbGroupDefaulted
  5590. );
  5591. WINADVAPI
  5592. DWORD
  5593. WINAPI
  5594. SetSecurityDescriptorRMControl(
  5595. IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor,
  5596. IN PUCHAR RMControl OPTIONAL
  5597. );
  5598. WINADVAPI
  5599. DWORD
  5600. WINAPI
  5601. GetSecurityDescriptorRMControl(
  5602. IN PSECURITY_DESCRIPTOR SecurityDescriptor,
  5603. OUT PUCHAR RMControl
  5604. );
  5605. WINADVAPI
  5606. BOOL
  5607. WINAPI
  5608. CreatePrivateObjectSecurity (
  5609. IN PSECURITY_DESCRIPTOR ParentDescriptor,
  5610. IN PSECURITY_DESCRIPTOR CreatorDescriptor,
  5611. OUT PSECURITY_DESCRIPTOR * NewDescriptor,
  5612. IN BOOL IsDirectoryObject,
  5613. IN HANDLE Token,
  5614. IN PGENERIC_MAPPING GenericMapping
  5615. );
  5616. #if(_WIN32_WINNT >= 0x0500)
  5617. WINADVAPI
  5618. BOOL
  5619. WINAPI
  5620. ConvertToAutoInheritPrivateObjectSecurity(
  5621. IN PSECURITY_DESCRIPTOR ParentDescriptor,
  5622. IN PSECURITY_DESCRIPTOR CurrentSecurityDescriptor,
  5623. OUT PSECURITY_DESCRIPTOR *NewSecurityDescriptor,
  5624. IN GUID *ObjectType,
  5625. IN BOOLEAN IsDirectoryObject,
  5626. IN PGENERIC_MAPPING GenericMapping
  5627. );
  5628. WINADVAPI
  5629. BOOL
  5630. WINAPI
  5631. CreatePrivateObjectSecurityEx (
  5632. IN PSECURITY_DESCRIPTOR ParentDescriptor,
  5633. IN PSECURITY_DESCRIPTOR CreatorDescriptor,
  5634. OUT PSECURITY_DESCRIPTOR * NewDescriptor,
  5635. IN GUID *ObjectType OPTIONAL,
  5636. IN BOOL IsContainerObject,
  5637. IN ULONG AutoInheritFlags,
  5638. IN HANDLE Token,
  5639. IN PGENERIC_MAPPING GenericMapping
  5640. );
  5641. WINADVAPI
  5642. BOOL
  5643. WINAPI
  5644. CreatePrivateObjectSecurityWithMultipleInheritance (
  5645. IN PSECURITY_DESCRIPTOR ParentDescriptor,
  5646. IN PSECURITY_DESCRIPTOR CreatorDescriptor,
  5647. OUT PSECURITY_DESCRIPTOR * NewDescriptor,
  5648. IN GUID **ObjectTypes OPTIONAL,
  5649. IN ULONG GuidCount,
  5650. IN BOOL IsContainerObject,
  5651. IN ULONG AutoInheritFlags,
  5652. IN HANDLE Token,
  5653. IN PGENERIC_MAPPING GenericMapping
  5654. );
  5655. #endif /* _WIN32_WINNT >= 0x0500 */
  5656. WINADVAPI
  5657. BOOL
  5658. WINAPI
  5659. SetPrivateObjectSecurity (
  5660. IN SECURITY_INFORMATION SecurityInformation,
  5661. IN PSECURITY_DESCRIPTOR ModificationDescriptor,
  5662. OUT PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor,
  5663. IN PGENERIC_MAPPING GenericMapping,
  5664. IN HANDLE Token
  5665. );
  5666. #if(_WIN32_WINNT >= 0x0500)
  5667. WINADVAPI
  5668. BOOL
  5669. WINAPI
  5670. SetPrivateObjectSecurityEx (
  5671. IN SECURITY_INFORMATION SecurityInformation,
  5672. IN PSECURITY_DESCRIPTOR ModificationDescriptor,
  5673. OUT PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor,
  5674. IN ULONG AutoInheritFlags,
  5675. IN PGENERIC_MAPPING GenericMapping,
  5676. IN HANDLE Token OPTIONAL
  5677. );
  5678. #endif /* _WIN32_WINNT >= 0x0500 */
  5679. WINADVAPI
  5680. BOOL
  5681. WINAPI
  5682. GetPrivateObjectSecurity (
  5683. IN PSECURITY_DESCRIPTOR ObjectDescriptor,
  5684. IN SECURITY_INFORMATION SecurityInformation,
  5685. OUT PSECURITY_DESCRIPTOR ResultantDescriptor,
  5686. IN DWORD DescriptorLength,
  5687. OUT PDWORD ReturnLength
  5688. );
  5689. WINADVAPI
  5690. BOOL
  5691. WINAPI
  5692. DestroyPrivateObjectSecurity (
  5693. IN OUT PSECURITY_DESCRIPTOR * ObjectDescriptor
  5694. );
  5695. WINADVAPI
  5696. BOOL
  5697. WINAPI
  5698. MakeSelfRelativeSD (
  5699. IN PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor,
  5700. OUT PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor,
  5701. OUT LPDWORD lpdwBufferLength
  5702. );
  5703. WINADVAPI
  5704. BOOL
  5705. WINAPI
  5706. MakeAbsoluteSD (
  5707. IN PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor,
  5708. OUT PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor,
  5709. OUT LPDWORD lpdwAbsoluteSecurityDescriptorSize,
  5710. OUT PACL pDacl,
  5711. OUT LPDWORD lpdwDaclSize,
  5712. OUT PACL pSacl,
  5713. OUT LPDWORD lpdwSaclSize,
  5714. OUT PSID pOwner,
  5715. OUT LPDWORD lpdwOwnerSize,
  5716. OUT PSID pPrimaryGroup,
  5717. OUT LPDWORD lpdwPrimaryGroupSize
  5718. );
  5719. WINADVAPI
  5720. BOOL
  5721. WINAPI
  5722. MakeAbsoluteSD2 (
  5723. IN PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor,
  5724. OUT LPDWORD lpdwBufferSize
  5725. );
  5726. WINADVAPI
  5727. BOOL
  5728. WINAPI
  5729. SetFileSecurity% (
  5730. IN LPCTSTR% lpFileName,
  5731. IN SECURITY_INFORMATION SecurityInformation,
  5732. IN PSECURITY_DESCRIPTOR pSecurityDescriptor
  5733. );
  5734. WINADVAPI
  5735. BOOL
  5736. WINAPI
  5737. GetFileSecurity% (
  5738. IN LPCTSTR% lpFileName,
  5739. IN SECURITY_INFORMATION RequestedInformation,
  5740. OUT PSECURITY_DESCRIPTOR pSecurityDescriptor,
  5741. IN DWORD nLength,
  5742. OUT LPDWORD lpnLengthNeeded
  5743. );
  5744. WINADVAPI
  5745. BOOL
  5746. WINAPI
  5747. SetKernelObjectSecurity (
  5748. IN HANDLE Handle,
  5749. IN SECURITY_INFORMATION SecurityInformation,
  5750. IN PSECURITY_DESCRIPTOR SecurityDescriptor
  5751. );
  5752. WINBASEAPI
  5753. HANDLE
  5754. WINAPI
  5755. FindFirstChangeNotification%(
  5756. IN LPCTSTR% lpPathName,
  5757. IN BOOL bWatchSubtree,
  5758. IN DWORD dwNotifyFilter
  5759. );
  5760. WINBASEAPI
  5761. BOOL
  5762. WINAPI
  5763. FindNextChangeNotification(
  5764. IN HANDLE hChangeHandle
  5765. );
  5766. WINBASEAPI
  5767. BOOL
  5768. WINAPI
  5769. FindCloseChangeNotification(
  5770. IN HANDLE hChangeHandle
  5771. );
  5772. ;begin_sur
  5773. WINBASEAPI
  5774. BOOL
  5775. WINAPI
  5776. ReadDirectoryChangesW(
  5777. IN HANDLE hDirectory,
  5778. IN OUT LPVOID lpBuffer,
  5779. IN DWORD nBufferLength,
  5780. IN BOOL bWatchSubtree,
  5781. IN DWORD dwNotifyFilter,
  5782. OUT LPDWORD lpBytesReturned,
  5783. IN LPOVERLAPPED lpOverlapped,
  5784. IN LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
  5785. );
  5786. ;end_sur
  5787. WINBASEAPI
  5788. BOOL
  5789. WINAPI
  5790. VirtualLock(
  5791. IN LPVOID lpAddress,
  5792. IN SIZE_T dwSize
  5793. );
  5794. WINBASEAPI
  5795. BOOL
  5796. WINAPI
  5797. VirtualUnlock(
  5798. IN LPVOID lpAddress,
  5799. IN SIZE_T dwSize
  5800. );
  5801. WINBASEAPI
  5802. LPVOID
  5803. WINAPI
  5804. MapViewOfFileEx(
  5805. IN HANDLE hFileMappingObject,
  5806. IN DWORD dwDesiredAccess,
  5807. IN DWORD dwFileOffsetHigh,
  5808. IN DWORD dwFileOffsetLow,
  5809. IN SIZE_T dwNumberOfBytesToMap,
  5810. IN LPVOID lpBaseAddress
  5811. );
  5812. WINBASEAPI
  5813. BOOL
  5814. WINAPI
  5815. SetPriorityClass(
  5816. IN HANDLE hProcess,
  5817. IN DWORD dwPriorityClass
  5818. );
  5819. WINBASEAPI
  5820. DWORD
  5821. WINAPI
  5822. GetPriorityClass(
  5823. IN HANDLE hProcess
  5824. );
  5825. WINBASEAPI
  5826. BOOL
  5827. WINAPI
  5828. IsBadReadPtr(
  5829. IN CONST VOID *lp,
  5830. IN UINT_PTR ucb
  5831. );
  5832. WINBASEAPI
  5833. BOOL
  5834. WINAPI
  5835. IsBadWritePtr(
  5836. IN LPVOID lp,
  5837. IN UINT_PTR ucb
  5838. );
  5839. WINBASEAPI
  5840. BOOL
  5841. WINAPI
  5842. IsBadHugeReadPtr(
  5843. IN CONST VOID *lp,
  5844. IN UINT_PTR ucb
  5845. );
  5846. WINBASEAPI
  5847. BOOL
  5848. WINAPI
  5849. IsBadHugeWritePtr(
  5850. IN LPVOID lp,
  5851. IN UINT_PTR ucb
  5852. );
  5853. WINBASEAPI
  5854. BOOL
  5855. WINAPI
  5856. IsBadCodePtr(
  5857. IN FARPROC lpfn
  5858. );
  5859. WINBASEAPI
  5860. BOOL
  5861. WINAPI
  5862. IsBadStringPtr%(
  5863. IN LPCTSTR% lpsz,
  5864. IN UINT_PTR ucchMax
  5865. );
  5866. WINADVAPI
  5867. BOOL
  5868. WINAPI
  5869. LookupAccountSid%(
  5870. IN LPCTSTR% lpSystemName,
  5871. IN PSID Sid,
  5872. OUT LPTSTR% Name,
  5873. IN OUT LPDWORD cbName,
  5874. OUT LPTSTR% ReferencedDomainName,
  5875. IN OUT LPDWORD cbReferencedDomainName,
  5876. OUT PSID_NAME_USE peUse
  5877. );
  5878. WINADVAPI
  5879. BOOL
  5880. WINAPI
  5881. LookupAccountName%(
  5882. IN LPCTSTR% lpSystemName,
  5883. IN LPCTSTR% lpAccountName,
  5884. OUT PSID Sid,
  5885. IN OUT LPDWORD cbSid,
  5886. OUT LPTSTR% ReferencedDomainName,
  5887. IN OUT LPDWORD cbReferencedDomainName,
  5888. OUT PSID_NAME_USE peUse
  5889. );
  5890. WINADVAPI
  5891. BOOL
  5892. WINAPI
  5893. LookupPrivilegeValue%(
  5894. IN LPCTSTR% lpSystemName,
  5895. IN LPCTSTR% lpName,
  5896. OUT PLUID lpLuid
  5897. );
  5898. WINADVAPI
  5899. BOOL
  5900. WINAPI
  5901. LookupPrivilegeName%(
  5902. IN LPCTSTR% lpSystemName,
  5903. IN PLUID lpLuid,
  5904. OUT LPTSTR% lpName,
  5905. IN OUT LPDWORD cbName
  5906. );
  5907. WINADVAPI
  5908. BOOL
  5909. WINAPI
  5910. LookupPrivilegeDisplayName%(
  5911. IN LPCTSTR% lpSystemName,
  5912. IN LPCTSTR% lpName,
  5913. OUT LPTSTR% lpDisplayName,
  5914. IN OUT LPDWORD cbDisplayName,
  5915. OUT LPDWORD lpLanguageId
  5916. );
  5917. WINADVAPI
  5918. BOOL
  5919. WINAPI
  5920. AllocateLocallyUniqueId(
  5921. OUT PLUID Luid
  5922. );
  5923. WINBASEAPI
  5924. BOOL
  5925. WINAPI
  5926. BuildCommDCB%(
  5927. IN LPCTSTR% lpDef,
  5928. OUT LPDCB lpDCB
  5929. );
  5930. WINBASEAPI
  5931. BOOL
  5932. WINAPI
  5933. BuildCommDCBAndTimeouts%(
  5934. IN LPCTSTR% lpDef,
  5935. OUT LPDCB lpDCB,
  5936. IN LPCOMMTIMEOUTS lpCommTimeouts
  5937. );
  5938. WINBASEAPI
  5939. BOOL
  5940. WINAPI
  5941. CommConfigDialog%(
  5942. IN LPCTSTR% lpszName,
  5943. IN HWND hWnd,
  5944. IN OUT LPCOMMCONFIG lpCC
  5945. );
  5946. WINBASEAPI
  5947. BOOL
  5948. WINAPI
  5949. GetDefaultCommConfig%(
  5950. IN LPCTSTR% lpszName,
  5951. OUT LPCOMMCONFIG lpCC,
  5952. IN OUT LPDWORD lpdwSize
  5953. );
  5954. WINBASEAPI
  5955. BOOL
  5956. WINAPI
  5957. SetDefaultCommConfig%(
  5958. IN LPCTSTR% lpszName,
  5959. IN LPCOMMCONFIG lpCC,
  5960. IN DWORD dwSize
  5961. );
  5962. #ifndef _MAC
  5963. #define MAX_COMPUTERNAME_LENGTH 15
  5964. #else
  5965. #define MAX_COMPUTERNAME_LENGTH 31
  5966. #endif
  5967. WINBASEAPI
  5968. BOOL
  5969. WINAPI
  5970. GetComputerName% (
  5971. OUT LPTSTR% lpBuffer,
  5972. IN OUT LPDWORD nSize
  5973. );
  5974. WINBASEAPI
  5975. BOOL
  5976. WINAPI
  5977. SetComputerName% (
  5978. IN LPCTSTR% lpComputerName
  5979. );
  5980. #if (_WIN32_WINNT >= 0x0500)
  5981. typedef enum _COMPUTER_NAME_FORMAT {
  5982. ComputerNameNetBIOS,
  5983. ComputerNameDnsHostname,
  5984. ComputerNameDnsDomain,
  5985. ComputerNameDnsFullyQualified,
  5986. ComputerNamePhysicalNetBIOS,
  5987. ComputerNamePhysicalDnsHostname,
  5988. ComputerNamePhysicalDnsDomain,
  5989. ComputerNamePhysicalDnsFullyQualified,
  5990. ComputerNameMax
  5991. } COMPUTER_NAME_FORMAT ;
  5992. WINBASEAPI
  5993. BOOL
  5994. WINAPI
  5995. GetComputerNameEx% (
  5996. IN COMPUTER_NAME_FORMAT NameType,
  5997. OUT LPTSTR% lpBuffer,
  5998. IN OUT LPDWORD nSize
  5999. );
  6000. WINBASEAPI
  6001. BOOL
  6002. WINAPI
  6003. SetComputerNameEx% (
  6004. IN COMPUTER_NAME_FORMAT NameType,
  6005. IN LPCTSTR% lpBuffer
  6006. );
  6007. WINBASEAPI
  6008. DWORD
  6009. WINAPI
  6010. AddLocalAlternateComputerName% (
  6011. IN LPCTSTR% lpDnsFQHostname,
  6012. IN ULONG ulFlags
  6013. );
  6014. WINBASEAPI
  6015. DWORD
  6016. WINAPI
  6017. RemoveLocalAlternateComputerName% (
  6018. IN LPCTSTR% lpAltDnsFQHostname,
  6019. IN ULONG ulFlags
  6020. );
  6021. WINBASEAPI
  6022. DWORD
  6023. WINAPI
  6024. SetLocalPrimaryComputerName% (
  6025. IN LPCTSTR% lpAltDnsFQHostname,
  6026. IN ULONG ulFlags
  6027. );
  6028. typedef enum _COMPUTER_NAME_TYPE {
  6029. PrimaryComputerName,
  6030. AlternateComputerNames,
  6031. AllComputerNames,
  6032. ComputerNameTypeMax
  6033. } COMPUTER_NAME_TYPE ;
  6034. WINBASEAPI
  6035. DWORD
  6036. WINAPI
  6037. EnumerateLocalComputerNames% (
  6038. IN COMPUTER_NAME_TYPE NameType,
  6039. IN ULONG ulFlags,
  6040. IN OUT LPTSTR% lpDnsFQHostname,
  6041. IN OUT LPDWORD nSize
  6042. );
  6043. WINBASEAPI
  6044. BOOL
  6045. WINAPI
  6046. DnsHostnameToComputerName% (
  6047. IN LPCTSTR% Hostname,
  6048. OUT LPTSTR% ComputerName,
  6049. IN OUT LPDWORD nSize
  6050. );
  6051. #endif // _WIN32_WINNT
  6052. WINADVAPI
  6053. BOOL
  6054. WINAPI
  6055. GetUserName% (
  6056. OUT LPTSTR% lpBuffer,
  6057. IN OUT LPDWORD nSize
  6058. );
  6059. //
  6060. // Logon Support APIs
  6061. //
  6062. #define LOGON32_LOGON_INTERACTIVE 2
  6063. #define LOGON32_LOGON_NETWORK 3
  6064. #define LOGON32_LOGON_BATCH 4
  6065. #define LOGON32_LOGON_SERVICE 5
  6066. #define LOGON32_LOGON_UNLOCK 7
  6067. #if(_WIN32_WINNT >= 0x0500)
  6068. #define LOGON32_LOGON_NETWORK_CLEARTEXT 8
  6069. #define LOGON32_LOGON_NEW_CREDENTIALS 9
  6070. #endif // (_WIN32_WINNT >= 0x0500)
  6071. #define LOGON32_PROVIDER_DEFAULT 0
  6072. #define LOGON32_PROVIDER_WINNT35 1
  6073. ;begin_sur
  6074. #define LOGON32_PROVIDER_WINNT40 2
  6075. ;end_sur
  6076. #if(_WIN32_WINNT >= 0x0500)
  6077. #define LOGON32_PROVIDER_WINNT50 3
  6078. #endif // (_WIN32_WINNT >= 0x0500)
  6079. WINADVAPI
  6080. BOOL
  6081. WINAPI
  6082. LogonUser% (
  6083. IN LPTSTR% lpszUsername,
  6084. IN LPTSTR% lpszDomain,
  6085. IN LPTSTR% lpszPassword,
  6086. IN DWORD dwLogonType,
  6087. IN DWORD dwLogonProvider,
  6088. OUT PHANDLE phToken
  6089. );
  6090. WINADVAPI
  6091. BOOL
  6092. WINAPI
  6093. LogonUserEx% (
  6094. IN LPTSTR% lpszUsername,
  6095. IN LPTSTR% lpszDomain,
  6096. IN LPTSTR% lpszPassword,
  6097. IN DWORD dwLogonType,
  6098. IN DWORD dwLogonProvider,
  6099. OUT PHANDLE phToken OPTIONAL,
  6100. OUT PSID *ppLogonSid OPTIONAL,
  6101. OUT PVOID *ppProfileBuffer OPTIONAL,
  6102. OUT LPDWORD pdwProfileLength OPTIONAL,
  6103. OUT PQUOTA_LIMITS pQuotaLimits OPTIONAL
  6104. );
  6105. WINADVAPI
  6106. BOOL
  6107. WINAPI
  6108. ImpersonateLoggedOnUser(
  6109. IN HANDLE hToken
  6110. );
  6111. WINADVAPI
  6112. BOOL
  6113. WINAPI
  6114. CreateProcessAsUser% (
  6115. IN HANDLE hToken,
  6116. IN LPCTSTR% lpApplicationName,
  6117. IN LPTSTR% lpCommandLine,
  6118. IN LPSECURITY_ATTRIBUTES lpProcessAttributes,
  6119. IN LPSECURITY_ATTRIBUTES lpThreadAttributes,
  6120. IN BOOL bInheritHandles,
  6121. IN DWORD dwCreationFlags,
  6122. IN LPVOID lpEnvironment,
  6123. IN LPCTSTR% lpCurrentDirectory,
  6124. IN LPSTARTUPINFO% lpStartupInfo,
  6125. OUT LPPROCESS_INFORMATION lpProcessInformation
  6126. );
  6127. #if(_WIN32_WINNT >= 0x0500)
  6128. //
  6129. // LogonFlags
  6130. //
  6131. #define LOGON_WITH_PROFILE 0x00000001
  6132. #define LOGON_NETCREDENTIALS_ONLY 0x00000002
  6133. WINADVAPI
  6134. BOOL
  6135. WINAPI
  6136. CreateProcessWithLogonW(
  6137. LPCWSTR lpUsername,
  6138. LPCWSTR lpDomain,
  6139. LPCWSTR lpPassword,
  6140. DWORD dwLogonFlags,
  6141. LPCWSTR lpApplicationName,
  6142. LPWSTR lpCommandLine,
  6143. DWORD dwCreationFlags,
  6144. LPVOID lpEnvironment,
  6145. LPCWSTR lpCurrentDirectory,
  6146. LPSTARTUPINFOW lpStartupInfo,
  6147. LPPROCESS_INFORMATION lpProcessInformation
  6148. );
  6149. #endif // (_WIN32_WINNT >= 0x0500)
  6150. WINADVAPI
  6151. BOOL
  6152. APIENTRY
  6153. ImpersonateAnonymousToken(
  6154. IN HANDLE ThreadHandle
  6155. );
  6156. WINADVAPI
  6157. BOOL
  6158. WINAPI
  6159. DuplicateTokenEx(
  6160. IN HANDLE hExistingToken,
  6161. IN DWORD dwDesiredAccess,
  6162. IN LPSECURITY_ATTRIBUTES lpTokenAttributes,
  6163. IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
  6164. IN TOKEN_TYPE TokenType,
  6165. OUT PHANDLE phNewToken);
  6166. WINADVAPI
  6167. BOOL
  6168. APIENTRY
  6169. CreateRestrictedToken(
  6170. IN HANDLE ExistingTokenHandle,
  6171. IN DWORD Flags,
  6172. IN DWORD DisableSidCount,
  6173. IN PSID_AND_ATTRIBUTES SidsToDisable OPTIONAL,
  6174. IN DWORD DeletePrivilegeCount,
  6175. IN PLUID_AND_ATTRIBUTES PrivilegesToDelete OPTIONAL,
  6176. IN DWORD RestrictedSidCount,
  6177. IN PSID_AND_ATTRIBUTES SidsToRestrict OPTIONAL,
  6178. OUT PHANDLE NewTokenHandle
  6179. );
  6180. WINADVAPI
  6181. BOOL
  6182. WINAPI
  6183. IsTokenRestricted(
  6184. IN HANDLE TokenHandle
  6185. );
  6186. WINADVAPI
  6187. BOOL
  6188. WINAPI
  6189. IsTokenUntrusted(
  6190. IN HANDLE TokenHandle
  6191. );
  6192. BOOL
  6193. APIENTRY
  6194. CheckTokenMembership(
  6195. IN HANDLE TokenHandle OPTIONAL,
  6196. IN PSID SidToCheck,
  6197. OUT PBOOL IsMember
  6198. );
  6199. //
  6200. // Thread pool API's
  6201. //
  6202. #if (_WIN32_WINNT >= 0x0500)
  6203. typedef WAITORTIMERCALLBACKFUNC WAITORTIMERCALLBACK ;
  6204. WINBASEAPI
  6205. BOOL
  6206. WINAPI
  6207. RegisterWaitForSingleObject(
  6208. PHANDLE phNewWaitObject,
  6209. HANDLE hObject,
  6210. WAITORTIMERCALLBACK Callback,
  6211. PVOID Context,
  6212. ULONG dwMilliseconds,
  6213. ULONG dwFlags
  6214. );
  6215. WINBASEAPI
  6216. HANDLE
  6217. WINAPI
  6218. RegisterWaitForSingleObjectEx(
  6219. HANDLE hObject,
  6220. WAITORTIMERCALLBACK Callback,
  6221. PVOID Context,
  6222. ULONG dwMilliseconds,
  6223. ULONG dwFlags
  6224. );
  6225. WINBASEAPI
  6226. BOOL
  6227. WINAPI
  6228. UnregisterWait(
  6229. HANDLE WaitHandle
  6230. );
  6231. WINBASEAPI
  6232. BOOL
  6233. WINAPI
  6234. UnregisterWaitEx(
  6235. HANDLE WaitHandle,
  6236. HANDLE CompletionEvent
  6237. );
  6238. WINBASEAPI
  6239. BOOL
  6240. WINAPI
  6241. QueueUserWorkItem(
  6242. LPTHREAD_START_ROUTINE Function,
  6243. PVOID Context,
  6244. ULONG Flags
  6245. );
  6246. WINBASEAPI
  6247. BOOL
  6248. WINAPI
  6249. BindIoCompletionCallback (
  6250. HANDLE FileHandle,
  6251. LPOVERLAPPED_COMPLETION_ROUTINE Function,
  6252. ULONG Flags
  6253. );
  6254. WINBASEAPI
  6255. HANDLE
  6256. WINAPI
  6257. CreateTimerQueue(
  6258. VOID
  6259. );
  6260. WINBASEAPI
  6261. BOOL
  6262. WINAPI
  6263. CreateTimerQueueTimer(
  6264. PHANDLE phNewTimer,
  6265. HANDLE TimerQueue,
  6266. WAITORTIMERCALLBACK Callback,
  6267. PVOID Parameter,
  6268. DWORD DueTime,
  6269. DWORD Period,
  6270. ULONG Flags
  6271. ) ;
  6272. WINBASEAPI
  6273. BOOL
  6274. WINAPI
  6275. ChangeTimerQueueTimer(
  6276. HANDLE TimerQueue,
  6277. HANDLE Timer,
  6278. ULONG DueTime,
  6279. ULONG Period
  6280. );
  6281. WINBASEAPI
  6282. BOOL
  6283. WINAPI
  6284. DeleteTimerQueueTimer(
  6285. HANDLE TimerQueue,
  6286. HANDLE Timer,
  6287. HANDLE CompletionEvent
  6288. );
  6289. WINBASEAPI
  6290. BOOL
  6291. WINAPI
  6292. DeleteTimerQueueEx(
  6293. HANDLE TimerQueue,
  6294. HANDLE CompletionEvent
  6295. );
  6296. WINBASEAPI
  6297. HANDLE
  6298. WINAPI
  6299. SetTimerQueueTimer(
  6300. HANDLE TimerQueue,
  6301. WAITORTIMERCALLBACK Callback,
  6302. PVOID Parameter,
  6303. DWORD DueTime,
  6304. DWORD Period,
  6305. BOOL PreferIo
  6306. );
  6307. WINBASEAPI
  6308. BOOL
  6309. WINAPI
  6310. CancelTimerQueueTimer(
  6311. HANDLE TimerQueue,
  6312. HANDLE Timer
  6313. );
  6314. WINBASEAPI
  6315. BOOL
  6316. WINAPI
  6317. DeleteTimerQueue(
  6318. HANDLE TimerQueue
  6319. );
  6320. #endif // _WIN32_WINNT
  6321. ;begin_sur
  6322. //
  6323. // Plug-and-Play API's
  6324. //
  6325. #define HW_PROFILE_GUIDLEN 39 // 36-characters plus NULL terminator
  6326. #define MAX_PROFILE_LEN 80
  6327. #define DOCKINFO_UNDOCKED (0x1)
  6328. #define DOCKINFO_DOCKED (0x2)
  6329. #define DOCKINFO_USER_SUPPLIED (0x4)
  6330. #define DOCKINFO_USER_UNDOCKED (DOCKINFO_USER_SUPPLIED | DOCKINFO_UNDOCKED)
  6331. #define DOCKINFO_USER_DOCKED (DOCKINFO_USER_SUPPLIED | DOCKINFO_DOCKED)
  6332. typedef struct tagHW_PROFILE_INFO% {
  6333. DWORD dwDockInfo;
  6334. TCHAR% szHwProfileGuid[HW_PROFILE_GUIDLEN];
  6335. TCHAR% szHwProfileName[MAX_PROFILE_LEN];
  6336. } HW_PROFILE_INFO%, *LPHW_PROFILE_INFO%;
  6337. WINADVAPI
  6338. BOOL
  6339. WINAPI
  6340. GetCurrentHwProfile% (
  6341. OUT LPHW_PROFILE_INFO% lpHwProfileInfo
  6342. );
  6343. ;end_sur
  6344. //
  6345. // Performance counter API's
  6346. //
  6347. WINBASEAPI
  6348. BOOL
  6349. WINAPI
  6350. QueryPerformanceCounter(
  6351. OUT LARGE_INTEGER *lpPerformanceCount
  6352. );
  6353. WINBASEAPI
  6354. BOOL
  6355. WINAPI
  6356. QueryPerformanceFrequency(
  6357. OUT LARGE_INTEGER *lpFrequency
  6358. );
  6359. WINBASEAPI
  6360. BOOL
  6361. WINAPI
  6362. GetVersionEx%(
  6363. IN OUT LPOSVERSIONINFO% lpVersionInformation
  6364. );
  6365. WINBASEAPI
  6366. BOOL
  6367. WINAPI
  6368. VerifyVersionInfo%(
  6369. IN LPOSVERSIONINFOEX% lpVersionInformation,
  6370. IN DWORD dwTypeMask,
  6371. IN DWORDLONG dwlConditionMask
  6372. );
  6373. // DOS and OS/2 Compatible Error Code definitions returned by the Win32 Base
  6374. // API functions.
  6375. //
  6376. #include <winerror.h>
  6377. /* Abnormal termination codes */
  6378. #define TC_NORMAL 0
  6379. #define TC_HARDERR 1
  6380. #define TC_GP_TRAP 2
  6381. #define TC_SIGNAL 3
  6382. ;begin_winver_400
  6383. //
  6384. // Power Management APIs
  6385. //
  6386. #define AC_LINE_OFFLINE 0x00
  6387. #define AC_LINE_ONLINE 0x01
  6388. #define AC_LINE_BACKUP_POWER 0x02
  6389. #define AC_LINE_UNKNOWN 0xFF
  6390. #define BATTERY_FLAG_HIGH 0x01
  6391. #define BATTERY_FLAG_LOW 0x02
  6392. #define BATTERY_FLAG_CRITICAL 0x04
  6393. #define BATTERY_FLAG_CHARGING 0x08
  6394. #define BATTERY_FLAG_NO_BATTERY 0x80
  6395. #define BATTERY_FLAG_UNKNOWN 0xFF
  6396. #define BATTERY_PERCENTAGE_UNKNOWN 0xFF
  6397. #define BATTERY_LIFE_UNKNOWN 0xFFFFFFFF
  6398. typedef struct _SYSTEM_POWER_STATUS {
  6399. BYTE ACLineStatus;
  6400. BYTE BatteryFlag;
  6401. BYTE BatteryLifePercent;
  6402. BYTE Reserved1;
  6403. DWORD BatteryLifeTime;
  6404. DWORD BatteryFullLifeTime;
  6405. } SYSTEM_POWER_STATUS, *LPSYSTEM_POWER_STATUS;
  6406. BOOL
  6407. WINAPI
  6408. GetSystemPowerStatus(
  6409. OUT LPSYSTEM_POWER_STATUS lpSystemPowerStatus
  6410. );
  6411. BOOL
  6412. WINAPI
  6413. SetSystemPowerState(
  6414. IN BOOL fSuspend,
  6415. IN BOOL fForce
  6416. );
  6417. ;end_winver_400
  6418. #if (_WIN32_WINNT >= 0x0500)
  6419. //
  6420. // Very Large Memory API Subset
  6421. //
  6422. WINBASEAPI
  6423. BOOL
  6424. WINAPI
  6425. AllocateUserPhysicalPages(
  6426. IN HANDLE hProcess,
  6427. IN OUT PULONG_PTR NumberOfPages,
  6428. OUT PULONG_PTR PageArray
  6429. );
  6430. WINBASEAPI
  6431. BOOL
  6432. WINAPI
  6433. FreeUserPhysicalPages(
  6434. IN HANDLE hProcess,
  6435. IN OUT PULONG_PTR NumberOfPages,
  6436. IN PULONG_PTR PageArray
  6437. );
  6438. WINBASEAPI
  6439. BOOL
  6440. WINAPI
  6441. MapUserPhysicalPages(
  6442. IN PVOID VirtualAddress,
  6443. IN ULONG_PTR NumberOfPages,
  6444. IN PULONG_PTR PageArray OPTIONAL
  6445. );
  6446. WINBASEAPI
  6447. BOOL
  6448. WINAPI
  6449. MapUserPhysicalPagesScatter(
  6450. IN PVOID *VirtualAddresses,
  6451. IN ULONG_PTR NumberOfPages,
  6452. IN PULONG_PTR PageArray OPTIONAL
  6453. );
  6454. WINBASEAPI
  6455. HANDLE
  6456. WINAPI
  6457. CreateJobObject%(
  6458. IN LPSECURITY_ATTRIBUTES lpJobAttributes,
  6459. IN LPCTSTR% lpName
  6460. );
  6461. WINBASEAPI
  6462. HANDLE
  6463. WINAPI
  6464. OpenJobObject%(
  6465. IN DWORD dwDesiredAccess,
  6466. IN BOOL bInheritHandle,
  6467. IN LPCTSTR% lpName
  6468. );
  6469. WINBASEAPI
  6470. BOOL
  6471. WINAPI
  6472. AssignProcessToJobObject(
  6473. IN HANDLE hJob,
  6474. IN HANDLE hProcess
  6475. );
  6476. WINBASEAPI
  6477. BOOL
  6478. WINAPI
  6479. TerminateJobObject(
  6480. IN HANDLE hJob,
  6481. IN UINT uExitCode
  6482. );
  6483. WINBASEAPI
  6484. BOOL
  6485. WINAPI
  6486. QueryInformationJobObject(
  6487. IN HANDLE hJob,
  6488. IN JOBOBJECTINFOCLASS JobObjectInformationClass,
  6489. OUT LPVOID lpJobObjectInformation,
  6490. IN DWORD cbJobObjectInformationLength,
  6491. OUT LPDWORD lpReturnLength
  6492. );
  6493. WINBASEAPI
  6494. BOOL
  6495. WINAPI
  6496. SetInformationJobObject(
  6497. IN HANDLE hJob,
  6498. IN JOBOBJECTINFOCLASS JobObjectInformationClass,
  6499. IN LPVOID lpJobObjectInformation,
  6500. IN DWORD cbJobObjectInformationLength
  6501. );
  6502. WINBASEAPI
  6503. BOOL
  6504. WINAPI
  6505. IsProcessInJob (
  6506. IN HANDLE ProcessHandle,
  6507. IN HANDLE JobHandle,
  6508. OUT PBOOL Result
  6509. );
  6510. WINBASEAPI
  6511. BOOL
  6512. WINAPI
  6513. CreateJobSet (
  6514. IN ULONG NumJob,
  6515. IN PJOB_SET_ARRAY UserJobSet,
  6516. IN ULONG Flags);
  6517. WINBASEAPI
  6518. PVOID
  6519. WINAPI
  6520. AddVectoredExceptionHandler(
  6521. IN ULONG FirstHandler,
  6522. IN PVECTORED_EXCEPTION_HANDLER VectoredHandler
  6523. );
  6524. WINBASEAPI
  6525. ULONG
  6526. WINAPI
  6527. RemoveVectoredExceptionHandler(
  6528. IN PVOID VectoredHandlerHandle
  6529. );
  6530. //
  6531. // New Volume Mount Point API.
  6532. //
  6533. WINBASEAPI
  6534. HANDLE
  6535. WINAPI
  6536. FindFirstVolumeA(
  6537. LPSTR lpszVolumeName,
  6538. DWORD cchBufferLength
  6539. );
  6540. WINBASEAPI
  6541. HANDLE
  6542. WINAPI
  6543. FindFirstVolumeW(
  6544. LPWSTR lpszVolumeName,
  6545. DWORD cchBufferLength
  6546. );
  6547. #ifdef UNICODE
  6548. #define FindFirstVolume FindFirstVolumeW
  6549. #else
  6550. #define FindFirstVolume FindFirstVolumeA
  6551. #endif // !UNICODE
  6552. WINBASEAPI
  6553. BOOL
  6554. WINAPI
  6555. FindNextVolumeA(
  6556. HANDLE hFindVolume,
  6557. LPSTR lpszVolumeName,
  6558. DWORD cchBufferLength
  6559. );
  6560. WINBASEAPI
  6561. BOOL
  6562. WINAPI
  6563. FindNextVolumeW(
  6564. HANDLE hFindVolume,
  6565. LPWSTR lpszVolumeName,
  6566. DWORD cchBufferLength
  6567. );
  6568. #ifdef UNICODE
  6569. #define FindNextVolume FindNextVolumeW
  6570. #else
  6571. #define FindNextVolume FindNextVolumeA
  6572. #endif // !UNICODE
  6573. WINBASEAPI
  6574. BOOL
  6575. WINAPI
  6576. FindVolumeClose(
  6577. HANDLE hFindVolume
  6578. );
  6579. WINBASEAPI
  6580. HANDLE
  6581. WINAPI
  6582. FindFirstVolumeMountPointA(
  6583. LPCSTR lpszRootPathName,
  6584. LPSTR lpszVolumeMountPoint,
  6585. DWORD cchBufferLength
  6586. );
  6587. WINBASEAPI
  6588. HANDLE
  6589. WINAPI
  6590. FindFirstVolumeMountPointW(
  6591. LPCWSTR lpszRootPathName,
  6592. LPWSTR lpszVolumeMountPoint,
  6593. DWORD cchBufferLength
  6594. );
  6595. #ifdef UNICODE
  6596. #define FindFirstVolumeMountPoint FindFirstVolumeMountPointW
  6597. #else
  6598. #define FindFirstVolumeMountPoint FindFirstVolumeMountPointA
  6599. #endif // !UNICODE
  6600. WINBASEAPI
  6601. BOOL
  6602. WINAPI
  6603. FindNextVolumeMountPointA(
  6604. HANDLE hFindVolumeMountPoint,
  6605. LPSTR lpszVolumeMountPoint,
  6606. DWORD cchBufferLength
  6607. );
  6608. WINBASEAPI
  6609. BOOL
  6610. WINAPI
  6611. FindNextVolumeMountPointW(
  6612. HANDLE hFindVolumeMountPoint,
  6613. LPWSTR lpszVolumeMountPoint,
  6614. DWORD cchBufferLength
  6615. );
  6616. #ifdef UNICODE
  6617. #define FindNextVolumeMountPoint FindNextVolumeMountPointW
  6618. #else
  6619. #define FindNextVolumeMountPoint FindNextVolumeMountPointA
  6620. #endif // !UNICODE
  6621. WINBASEAPI
  6622. BOOL
  6623. WINAPI
  6624. FindVolumeMountPointClose(
  6625. HANDLE hFindVolumeMountPoint
  6626. );
  6627. WINBASEAPI
  6628. BOOL
  6629. WINAPI
  6630. SetVolumeMountPoint%(
  6631. LPCTSTR% lpszVolumeMountPoint,
  6632. LPCTSTR% lpszVolumeName
  6633. );
  6634. WINBASEAPI
  6635. BOOL
  6636. WINAPI
  6637. DeleteVolumeMountPoint%(
  6638. LPCTSTR% lpszVolumeMountPoint
  6639. );
  6640. WINBASEAPI
  6641. BOOL
  6642. WINAPI
  6643. GetVolumeNameForVolumeMountPoint%(
  6644. LPCTSTR% lpszVolumeMountPoint,
  6645. LPTSTR% lpszVolumeName,
  6646. DWORD cchBufferLength
  6647. );
  6648. WINBASEAPI
  6649. BOOL
  6650. WINAPI
  6651. GetVolumePathName%(
  6652. LPCTSTR% lpszFileName,
  6653. LPTSTR% lpszVolumePathName,
  6654. DWORD cchBufferLength
  6655. );
  6656. WINBASEAPI
  6657. BOOL
  6658. WINAPI
  6659. GetVolumePathNamesForVolumeName%(
  6660. LPCTSTR% lpszVolumeName,
  6661. LPTSTR% lpszVolumePathNames,
  6662. DWORD cchBufferLength,
  6663. PDWORD lpcchReturnLength
  6664. );
  6665. #endif
  6666. #if (_WIN32_WINNT >= 0x0500) || (_WIN32_FUSION >= 0x0100) || ISOLATION_AWARE_ENABLED
  6667. #define ACTCTX_FLAG_PROCESSOR_ARCHITECTURE_VALID (0x00000001)
  6668. #define ACTCTX_FLAG_LANGID_VALID (0x00000002)
  6669. #define ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID (0x00000004)
  6670. #define ACTCTX_FLAG_RESOURCE_NAME_VALID (0x00000008)
  6671. #define ACTCTX_FLAG_SET_PROCESS_DEFAULT (0x00000010)
  6672. #define ACTCTX_FLAG_APPLICATION_NAME_VALID (0x00000020)
  6673. #define ACTCTX_FLAG_SOURCE_IS_ASSEMBLYREF (0x00000040)
  6674. #define ACTCTX_FLAG_HMODULE_VALID (0x00000080)
  6675. //#define ACTCTX_FLAG_LIKE_CREATEPROCESS (0x00000100) ;internal
  6676. typedef struct tagACTCTX% {
  6677. ULONG cbSize;
  6678. DWORD dwFlags;
  6679. LPCTSTR% lpSource;
  6680. USHORT wProcessorArchitecture;
  6681. LANGID wLangId;
  6682. LPCTSTR% lpAssemblyDirectory;
  6683. LPCTSTR% lpResourceName;
  6684. LPCTSTR% lpApplicationName;
  6685. HMODULE hModule;
  6686. } ACTCTX%, *PACTCTX%;
  6687. typedef const ACTCTX% *PCACTCTX%;
  6688. #endif
  6689. #if (_WIN32_WINNT >= 0x0500) || (_WIN32_FUSION >= 0x0100)
  6690. /*#!perl
  6691. DelayLoad("CreateActCtxW");
  6692. DeclareFunctionErrorValue('CreateActCtxW', 'INVALID_HANDLE_VALUE');
  6693. */
  6694. WINBASEAPI
  6695. HANDLE
  6696. WINAPI
  6697. CreateActCtx%(
  6698. PCACTCTX% pActCtx
  6699. );
  6700. WINBASEAPI
  6701. VOID
  6702. WINAPI
  6703. AddRefActCtx(
  6704. HANDLE hActCtx
  6705. );
  6706. /*#!perl DelayLoad("ReleaseActCtx"); */
  6707. WINBASEAPI
  6708. VOID
  6709. WINAPI
  6710. ReleaseActCtx(
  6711. HANDLE hActCtx
  6712. );
  6713. WINBASEAPI
  6714. BOOL
  6715. WINAPI
  6716. ZombifyActCtx(
  6717. HANDLE hActCtx
  6718. );
  6719. /*#!perl DelayLoad("ActivateActCtx"); */
  6720. WINBASEAPI
  6721. BOOL
  6722. WINAPI
  6723. ActivateActCtx(
  6724. HANDLE hActCtx,
  6725. ULONG_PTR *lpCookie
  6726. );
  6727. /*#!perl DelayLoad("DeactivateActCtx"); */
  6728. #define DEACTIVATE_ACTCTX_FLAG_FORCE_EARLY_DEACTIVATION (0x00000001)
  6729. WINBASEAPI
  6730. BOOL
  6731. WINAPI
  6732. DeactivateActCtx(
  6733. DWORD dwFlags,
  6734. ULONG_PTR ulCookie
  6735. );
  6736. WINBASEAPI
  6737. BOOL
  6738. WINAPI
  6739. GetCurrentActCtx(
  6740. HANDLE *lphActCtx);
  6741. #endif
  6742. #if (_WIN32_WINNT >= 0x0500) || (_WIN32_FUSION >= 0x0100) || ISOLATION_AWARE_ENABLED
  6743. typedef struct tagACTCTX_SECTION_KEYED_DATA_2600 {
  6744. ULONG cbSize;
  6745. ULONG ulDataFormatVersion;
  6746. PVOID lpData;
  6747. ULONG ulLength;
  6748. PVOID lpSectionGlobalData;
  6749. ULONG ulSectionGlobalDataLength;
  6750. PVOID lpSectionBase;
  6751. ULONG ulSectionTotalLength;
  6752. HANDLE hActCtx;
  6753. ULONG ulAssemblyRosterIndex;
  6754. } ACTCTX_SECTION_KEYED_DATA_2600, *PACTCTX_SECTION_KEYED_DATA_2600;
  6755. typedef const ACTCTX_SECTION_KEYED_DATA_2600 * PCACTCTX_SECTION_KEYED_DATA_2600;
  6756. typedef struct tagACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA {
  6757. PVOID lpInformation;
  6758. PVOID lpSectionBase;
  6759. ULONG ulSectionLength;
  6760. PVOID lpSectionGlobalDataBase;
  6761. ULONG ulSectionGlobalDataLength;
  6762. } ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, *PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA;
  6763. typedef const ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA *PCACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA;
  6764. typedef struct tagACTCTX_SECTION_KEYED_DATA {
  6765. ULONG cbSize;
  6766. ULONG ulDataFormatVersion;
  6767. PVOID lpData;
  6768. ULONG ulLength;
  6769. PVOID lpSectionGlobalData;
  6770. ULONG ulSectionGlobalDataLength;
  6771. PVOID lpSectionBase;
  6772. ULONG ulSectionTotalLength;
  6773. HANDLE hActCtx;
  6774. ULONG ulAssemblyRosterIndex;
  6775. // 2600 stops here
  6776. ULONG ulFlags;
  6777. ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA AssemblyMetadata;
  6778. } ACTCTX_SECTION_KEYED_DATA, *PACTCTX_SECTION_KEYED_DATA;
  6779. typedef const ACTCTX_SECTION_KEYED_DATA * PCACTCTX_SECTION_KEYED_DATA;
  6780. #define FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX (0x00000001)
  6781. #define FIND_ACTCTX_SECTION_KEY_RETURN_FLAGS (0x00000002)
  6782. #define FIND_ACTCTX_SECTION_KEY_RETURN_ASSEMBLY_METADATA (0x00000004)
  6783. #endif
  6784. #if (_WIN32_WINNT >= 0x0500) || (_WIN32_FUSION >= 0x0100)
  6785. /*#!perl
  6786. DelayLoad("FindActCtxSectionStringW");
  6787. */
  6788. WINBASEAPI
  6789. BOOL
  6790. WINAPI
  6791. FindActCtxSectionString%(
  6792. DWORD dwFlags,
  6793. const GUID *lpExtensionGuid,
  6794. ULONG ulSectionId,
  6795. LPCTSTR% lpStringToFind,
  6796. PACTCTX_SECTION_KEYED_DATA ReturnedData
  6797. );
  6798. WINBASEAPI
  6799. BOOL
  6800. WINAPI
  6801. FindActCtxSectionGuid(
  6802. DWORD dwFlags,
  6803. const GUID *lpExtensionGuid,
  6804. ULONG ulSectionId,
  6805. const GUID *lpGuidToFind,
  6806. PACTCTX_SECTION_KEYED_DATA ReturnedData
  6807. );
  6808. #endif
  6809. #if (_WIN32_WINNT >= 0x0500) || (_WIN32_FUSION >= 0x0100) || ISOLATION_AWARE_ENABLED
  6810. #if !defined(RC_INVOKED) /* RC complains about long symbols in #ifs */
  6811. #if !defined(ACTIVATION_CONTEXT_BASIC_INFORMATION_DEFINED)
  6812. typedef struct _ACTIVATION_CONTEXT_BASIC_INFORMATION {
  6813. HANDLE hActCtx;
  6814. DWORD dwFlags;
  6815. } ACTIVATION_CONTEXT_BASIC_INFORMATION, *PACTIVATION_CONTEXT_BASIC_INFORMATION;
  6816. typedef const struct _ACTIVATION_CONTEXT_BASIC_INFORMATION *PCACTIVATION_CONTEXT_BASIC_INFORMATION;
  6817. #define ACTIVATION_CONTEXT_BASIC_INFORMATION_DEFINED 1
  6818. #endif // !defined(ACTIVATION_CONTEXT_BASIC_INFORMATION_DEFINED)
  6819. #endif
  6820. #define QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX (0x00000004)
  6821. #define QUERY_ACTCTX_FLAG_ACTCTX_IS_HMODULE (0x00000008)
  6822. #define QUERY_ACTCTX_FLAG_ACTCTX_IS_ADDRESS (0x00000010)
  6823. #define QUERY_ACTCTX_FLAG_NO_ADDREF (0x80000000)
  6824. #endif
  6825. #if (_WIN32_WINNT >= 0x0500) || (_WIN32_FUSION >= 0x0100)
  6826. /*#!perl DelayLoad("QueryActCtxW"); */
  6827. //
  6828. // switch (ulInfoClass)
  6829. //
  6830. // case ActivationContextBasicInformation:
  6831. // pvSubInstance == NULL
  6832. // pvBuffer is of type PACTIVATION_CONTEXT_BASIC_INFORMATION
  6833. //
  6834. // case ActivationContextDetailedInformation:
  6835. // pvSubInstance == NULL
  6836. // pvBuffer is of type PACTIVATION_CONTEXT_DETAILED_INFORMATION
  6837. //
  6838. // case AssemblyDetailedInformationInActivationContext:
  6839. // pvSubInstance is of type PULONG
  6840. // *pvSubInstance < ACTIVATION_CONTEXT_DETAILED_INFORMATION::ulAssemblyCount
  6841. // pvBuffer is of type PACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION
  6842. //
  6843. // case FileInformationInAssemblyOfAssemblyInActivationContext:
  6844. // pvSubInstance is of type PACTIVATION_CONTEXT_QUERY_INDEX
  6845. // pvSubInstance->ulAssemblyIndex < ACTIVATION_CONTEXT_DETAILED_INFORMATION::ulAssemblyCount
  6846. // pvSubInstance->ulFileIndexInAssembly < ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION::ulFileCount
  6847. // pvBuffer is of type PASSEMBLY_FILE_DETAILED_INFORMATION
  6848. //
  6849. // String are placed after the structs.
  6850. //
  6851. WINBASEAPI
  6852. BOOL
  6853. WINAPI
  6854. QueryActCtxW(
  6855. IN DWORD dwFlags,
  6856. IN HANDLE hActCtx,
  6857. IN PVOID pvSubInstance,
  6858. IN ULONG ulInfoClass,
  6859. OUT PVOID pvBuffer,
  6860. IN SIZE_T cbBuffer OPTIONAL,
  6861. OUT SIZE_T *pcbWrittenOrRequired OPTIONAL
  6862. );
  6863. typedef BOOL (WINAPI * PQUERYACTCTXW_FUNC)(
  6864. IN DWORD dwFlags,
  6865. IN HANDLE hActCtx,
  6866. IN PVOID pvSubInstance,
  6867. IN ULONG ulInfoClass,
  6868. OUT PVOID pvBuffer,
  6869. IN SIZE_T cbBuffer OPTIONAL,
  6870. OUT SIZE_T *pcbWrittenOrRequired OPTIONAL
  6871. );
  6872. #endif // (_WIN32_WINNT > 0x0500) || (_WIN32_FUSION >= 0x0100)
  6873. ;begin_internal
  6874. BOOL
  6875. WINAPI
  6876. CloseProfileUserMapping( VOID );
  6877. BOOL
  6878. WINAPI
  6879. OpenProfileUserMapping( VOID );
  6880. BOOL
  6881. WINAPI
  6882. QueryWin31IniFilesMappedToRegistry(
  6883. IN DWORD Flags,
  6884. OUT PWSTR Buffer,
  6885. IN DWORD cchBuffer,
  6886. OUT LPDWORD cchUsed
  6887. );
  6888. #define WIN31_INIFILES_MAPPED_TO_SYSTEM 0x00000001
  6889. #define WIN31_INIFILES_MAPPED_TO_USER 0x00000002
  6890. typedef BOOL (WINAPI *PWIN31IO_STATUS_CALLBACK)(
  6891. IN PWSTR Status,
  6892. IN PVOID CallbackParameter
  6893. );
  6894. typedef enum _WIN31IO_EVENT {
  6895. Win31SystemStartEvent,
  6896. Win31LogonEvent,
  6897. Win31LogoffEvent
  6898. } WIN31IO_EVENT;
  6899. #define WIN31_MIGRATE_INIFILES 0x00000001
  6900. #define WIN31_MIGRATE_GROUPS 0x00000002
  6901. #define WIN31_MIGRATE_REGDAT 0x00000004
  6902. #define WIN31_MIGRATE_ALL (WIN31_MIGRATE_INIFILES | WIN31_MIGRATE_GROUPS | WIN31_MIGRATE_REGDAT)
  6903. DWORD
  6904. WINAPI
  6905. QueryWindows31FilesMigration(
  6906. IN WIN31IO_EVENT EventType
  6907. );
  6908. BOOL
  6909. WINAPI
  6910. SynchronizeWindows31FilesAndWindowsNTRegistry(
  6911. IN WIN31IO_EVENT EventType,
  6912. IN DWORD Flags,
  6913. IN PWIN31IO_STATUS_CALLBACK StatusCallBack,
  6914. IN PVOID CallbackParameter
  6915. );
  6916. typedef struct _VIRTUAL_BUFFER {
  6917. PVOID Base;
  6918. PVOID CommitLimit;
  6919. PVOID ReserveLimit;
  6920. } VIRTUAL_BUFFER, *PVIRTUAL_BUFFER;
  6921. BOOLEAN
  6922. WINAPI
  6923. CreateVirtualBuffer(
  6924. OUT PVIRTUAL_BUFFER Buffer,
  6925. IN ULONG CommitSize OPTIONAL,
  6926. IN ULONG ReserveSize OPTIONAL
  6927. );
  6928. int
  6929. WINAPI
  6930. VirtualBufferExceptionHandler(
  6931. IN ULONG ExceptionCode,
  6932. IN PEXCEPTION_POINTERS ExceptionInfo,
  6933. IN OUT PVIRTUAL_BUFFER Buffer
  6934. );
  6935. BOOLEAN
  6936. WINAPI
  6937. ExtendVirtualBuffer(
  6938. IN PVIRTUAL_BUFFER Buffer,
  6939. IN PVOID Address
  6940. );
  6941. BOOLEAN
  6942. WINAPI
  6943. TrimVirtualBuffer(
  6944. IN PVIRTUAL_BUFFER Buffer
  6945. );
  6946. BOOLEAN
  6947. WINAPI
  6948. FreeVirtualBuffer(
  6949. IN PVIRTUAL_BUFFER Buffer
  6950. );
  6951. //
  6952. // filefind stucture shared with ntvdm, jonle
  6953. // see mvdm\dos\dem\demsrch.c
  6954. //
  6955. typedef struct _FINDFILE_HANDLE {
  6956. HANDLE DirectoryHandle;
  6957. PVOID FindBufferBase;
  6958. PVOID FindBufferNext;
  6959. ULONG FindBufferLength;
  6960. ULONG FindBufferValidLength;
  6961. RTL_CRITICAL_SECTION FindBufferLock;
  6962. } FINDFILE_HANDLE, *PFINDFILE_HANDLE;
  6963. #define BASE_FIND_FIRST_DEVICE_HANDLE (HANDLE)1
  6964. WINBASEAPI
  6965. BOOL
  6966. WINAPI
  6967. GetDaylightFlag(VOID);
  6968. WINBASEAPI
  6969. BOOL
  6970. WINAPI
  6971. SetDaylightFlag(
  6972. BOOL fDaylight
  6973. );
  6974. WINBASEAPI
  6975. BOOL
  6976. WINAPI
  6977. FreeLibrary16(
  6978. HINSTANCE hLibModule
  6979. );
  6980. WINBASEAPI
  6981. FARPROC
  6982. WINAPI
  6983. GetProcAddress16(
  6984. HINSTANCE hModule,
  6985. LPCSTR lpProcName
  6986. );
  6987. WINBASEAPI
  6988. HINSTANCE
  6989. WINAPI
  6990. LoadLibrary16(
  6991. LPCSTR lpLibFileName
  6992. );
  6993. WINBASEAPI
  6994. BOOL
  6995. APIENTRY
  6996. NukeProcess(
  6997. DWORD ppdb,
  6998. UINT uExitCode,
  6999. DWORD ulFlags);
  7000. WINBASEAPI
  7001. HGLOBAL
  7002. WINAPI
  7003. GlobalAlloc16(
  7004. UINT uFlags,
  7005. DWORD dwBytes
  7006. );
  7007. WINBASEAPI
  7008. LPVOID
  7009. WINAPI
  7010. GlobalLock16(
  7011. HGLOBAL hMem
  7012. );
  7013. WINBASEAPI
  7014. BOOL
  7015. WINAPI
  7016. GlobalUnlock16(
  7017. HGLOBAL hMem
  7018. );
  7019. WINBASEAPI
  7020. HGLOBAL
  7021. WINAPI
  7022. GlobalFree16(
  7023. HGLOBAL hMem
  7024. );
  7025. WINBASEAPI
  7026. DWORD
  7027. WINAPI
  7028. GlobalSize16(
  7029. HGLOBAL hMem
  7030. );
  7031. WINBASEAPI
  7032. DWORD
  7033. WINAPI
  7034. RegisterServiceProcess(
  7035. IN DWORD dwProcessId,
  7036. IN DWORD dwServiceType
  7037. );
  7038. #define RSP_UNREGISTER_SERVICE 0x00000000
  7039. #define RSP_SIMPLE_SERVICE 0x00000001
  7040. WINBASEAPI
  7041. VOID
  7042. WINAPI
  7043. ReinitializeCriticalSection(
  7044. IN LPCRITICAL_SECTION lpCriticalSection
  7045. );
  7046. //
  7047. // New Multi-User specific routines to support per session
  7048. // network driver mappings. Related to Wksvc changes
  7049. //
  7050. WINBASEAPI
  7051. BOOL
  7052. WINAPI
  7053. DosPathToSessionPathA(
  7054. IN DWORD SessionId,
  7055. IN LPCSTR pInPath,
  7056. OUT LPSTR *ppOutPath
  7057. );
  7058. WINBASEAPI
  7059. BOOL
  7060. WINAPI
  7061. DosPathToSessionPathW(
  7062. IN DWORD SessionId,
  7063. IN LPCWSTR pInPath,
  7064. OUT LPWSTR *ppOutPath
  7065. );
  7066. //terminal server time zone support
  7067. BOOL
  7068. WINAPI
  7069. SetClientTimeZoneInformation(
  7070. IN CONST TIME_ZONE_INFORMATION *ptzi
  7071. );
  7072. #ifdef UNICODE
  7073. #define DosPathToSessionPath DosPathToSessionPathW
  7074. #else
  7075. #define DosPathToSessionPath DosPathToSessionPathA
  7076. #endif // !UNICODE
  7077. ;end_internal
  7078. ;begin_internal
  7079. #define COMPLUS_ENABLE_64BIT 0x00000001
  7080. #define COMPLUS_INSTALL_FLAGS_INVALID (~(COMPLUS_ENABLE_64BIT))
  7081. ULONG
  7082. WINAPI
  7083. GetComPlusPackageInstallStatus(
  7084. VOID
  7085. );
  7086. BOOL
  7087. WINAPI
  7088. SetComPlusPackageInstallStatus(
  7089. ULONG ComPlusPackage
  7090. );
  7091. ;end_internal
  7092. WINBASEAPI
  7093. BOOL
  7094. WINAPI
  7095. ProcessIdToSessionId(
  7096. IN DWORD dwProcessId,
  7097. OUT DWORD *pSessionId
  7098. );
  7099. #if _WIN32_WINNT >= 0x0501
  7100. WINBASEAPI
  7101. DWORD
  7102. WINAPI
  7103. WTSGetActiveConsoleSessionId();
  7104. WINBASEAPI
  7105. BOOL
  7106. WINAPI
  7107. IsWow64Process(
  7108. HANDLE hProcess,
  7109. PBOOL Wow64Process
  7110. );
  7111. #endif // (_WIN32_WINNT >= 0x0501)
  7112. //
  7113. // NUMA Information routines.
  7114. //
  7115. WINBASEAPI
  7116. BOOL
  7117. WINAPI
  7118. GetNumaHighestNodeNumber(
  7119. PULONG HighestNodeNumber
  7120. );
  7121. WINBASEAPI
  7122. BOOL
  7123. WINAPI
  7124. GetNumaProcessorNode(
  7125. UCHAR Processor,
  7126. PUCHAR NodeNumber
  7127. );
  7128. WINBASEAPI
  7129. BOOL
  7130. WINAPI
  7131. GetNumaNodeProcessorMask(
  7132. UCHAR Node,
  7133. PULONGLONG ProcessorMask
  7134. );
  7135. WINBASEAPI
  7136. BOOL
  7137. WINAPI
  7138. GetNumaProcessorMap(
  7139. PSYSTEM_NUMA_INFORMATION Map,
  7140. ULONG Length,
  7141. PULONG ReturnedLength
  7142. );
  7143. WINBASEAPI
  7144. BOOL
  7145. WINAPI
  7146. GetNumaAvailableMemory(
  7147. PSYSTEM_NUMA_INFORMATION Memory,
  7148. ULONG Length,
  7149. PULONG ReturnedLength
  7150. );
  7151. WINBASEAPI
  7152. BOOL
  7153. WINAPI
  7154. GetNumaAvailableMemoryNode(
  7155. UCHAR Node,
  7156. PULONGLONG AvailableBytes
  7157. );
  7158. WINBASEAPI
  7159. ULONGLONG
  7160. WINAPI
  7161. NumaVirtualQueryNode(
  7162. IN ULONG NumberOfRanges,
  7163. IN PULONG_PTR RangeList,
  7164. OUT PULONG_PTR VirtualPageAndNode,
  7165. IN SIZE_T MaximumOutputLength
  7166. );
  7167. #ifdef __cplusplus ;both
  7168. } ;both
  7169. #endif ;both
  7170. #endif // ndef _WINBASEP_ ;internal
  7171. ;begin_userk_only
  7172. #endif // _WBASEK_
  7173. ;end_userk_only
  7174. #endif // _WINBASE_