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.

469 lines
9.7 KiB

  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. winbasep.h
  5. Abstract:
  6. Private
  7. Procedure declarations, constant definitions and macros for the Base
  8. component.
  9. --*/
  10. #ifndef _WINBASEP_
  11. #define _WINBASEP_
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. #define FILE_FLAG_GLOBAL_HANDLE 0x00800000
  16. #define FILE_FLAG_MM_CACHED_FILE_HANDLE 0x00400000
  17. WINBASEAPI
  18. DWORD
  19. WINAPI
  20. HeapCreateTagsW(
  21. IN HANDLE hHeap,
  22. IN DWORD dwFlags,
  23. IN LPCWSTR lpTagPrefix,
  24. IN LPCWSTR lpTagNames
  25. );
  26. typedef struct _HEAP_TAG_INFO {
  27. DWORD dwNumberOfAllocations;
  28. DWORD dwNumberOfFrees;
  29. DWORD dwBytesAllocated;
  30. } HEAP_TAG_INFO, *PHEAP_TAG_INFO;
  31. typedef PHEAP_TAG_INFO LPHEAP_TAG_INFO;
  32. WINBASEAPI
  33. LPCWSTR
  34. WINAPI
  35. HeapQueryTagW(
  36. IN HANDLE hHeap,
  37. IN DWORD dwFlags,
  38. IN WORD wTagIndex,
  39. IN BOOL bResetCounters,
  40. OUT LPHEAP_TAG_INFO TagInfo
  41. );
  42. typedef struct _HEAP_SUMMARY {
  43. DWORD cb;
  44. SIZE_T cbAllocated;
  45. SIZE_T cbCommitted;
  46. SIZE_T cbReserved;
  47. SIZE_T cbMaxReserve;
  48. } HEAP_SUMMARY, *PHEAP_SUMMARY;
  49. typedef PHEAP_SUMMARY LPHEAP_SUMMARY;
  50. BOOL
  51. WINAPI
  52. HeapSummary(
  53. IN HANDLE hHeap,
  54. IN DWORD dwFlags,
  55. OUT LPHEAP_SUMMARY lpSummary
  56. );
  57. BOOL
  58. WINAPI
  59. HeapExtend(
  60. IN HANDLE hHeap,
  61. IN DWORD dwFlags,
  62. IN LPVOID lpBase,
  63. IN DWORD dwBytes
  64. );
  65. typedef struct _HEAP_USAGE_ENTRY {
  66. struct _HEAP_USAGE_ENTRY *lpNext;
  67. PVOID lpAddress;
  68. DWORD dwBytes;
  69. DWORD dwReserved;
  70. } HEAP_USAGE_ENTRY, *PHEAP_USAGE_ENTRY;
  71. typedef struct _HEAP_USAGE {
  72. DWORD cb;
  73. SIZE_T cbAllocated;
  74. SIZE_T cbCommitted;
  75. SIZE_T cbReserved;
  76. SIZE_T cbMaxReserve;
  77. PHEAP_USAGE_ENTRY lpEntries;
  78. PHEAP_USAGE_ENTRY lpAddedEntries;
  79. PHEAP_USAGE_ENTRY lpRemovedEntries;
  80. DWORD Reserved[ 8 ];
  81. } HEAP_USAGE, *PHEAP_USAGE;
  82. BOOL
  83. WINAPI
  84. HeapUsage(
  85. IN HANDLE hHeap,
  86. IN DWORD dwFlags,
  87. IN BOOL bFirstCall,
  88. IN BOOL bLastCall,
  89. OUT PHEAP_USAGE lpUsage
  90. );
  91. #define HFINDFILE HANDLE //
  92. #define INVALID_HFINDFILE ((HFINDFILE)-1) //
  93. typedef DWORD (*PFNWAITFORINPUTIDLE)(HANDLE hProcess, DWORD dwMilliseconds);
  94. VOID RegisterWaitForInputIdle(PFNWAITFORINPUTIDLE);
  95. #define STARTF_HASSHELLDATA 0x00000400
  96. #define STARTF_TITLEISLINKNAME 0x00000800
  97. WINBASEAPI
  98. BOOL
  99. WINAPI
  100. CreateProcessInternalA(
  101. IN HANDLE hUserToken,
  102. IN LPCSTR lpApplicationName,
  103. IN LPSTR lpCommandLine,
  104. IN LPSECURITY_ATTRIBUTES lpProcessAttributes,
  105. IN LPSECURITY_ATTRIBUTES lpThreadAttributes,
  106. IN BOOL bInheritHandles,
  107. IN DWORD dwCreationFlags,
  108. IN LPVOID lpEnvironment,
  109. IN LPCSTR lpCurrentDirectory,
  110. IN LPSTARTUPINFOA lpStartupInfo,
  111. OUT LPPROCESS_INFORMATION lpProcessInformation,
  112. OUT PHANDLE hRestrictedUserToken
  113. );
  114. WINBASEAPI
  115. BOOL
  116. WINAPI
  117. CreateProcessInternalW(
  118. IN HANDLE hUserToken,
  119. IN LPCWSTR lpApplicationName,
  120. IN LPWSTR lpCommandLine,
  121. IN LPSECURITY_ATTRIBUTES lpProcessAttributes,
  122. IN LPSECURITY_ATTRIBUTES lpThreadAttributes,
  123. IN BOOL bInheritHandles,
  124. IN DWORD dwCreationFlags,
  125. IN LPVOID lpEnvironment,
  126. IN LPCWSTR lpCurrentDirectory,
  127. IN LPSTARTUPINFOW lpStartupInfo,
  128. OUT LPPROCESS_INFORMATION lpProcessInformation,
  129. OUT PHANDLE hRestrictedUserToken
  130. );
  131. #ifdef UNICODE
  132. #define CreateProcessInternal CreateProcessInternalW
  133. #else
  134. #define CreateProcessInternal CreateProcessInternalA
  135. #endif // !UNICODE
  136. #if (_WIN32_WINNT >= 0x0500)
  137. #define PRIVCOPY_FILE_METADATA 0x010 // Copy compression, DACL, (encryption)
  138. #define PRIVCOPY_FILE_SACL 0x020 // Copy SACL
  139. #define PRIVCOPY_FILE_OWNER_GROUP 0x040 // Copy owner & group
  140. #define PRIVCOPY_FILE_DIRECTORY 0x080 // Copy directory file like a file
  141. #define PRIVCOPY_FILE_BACKUP_SEMANTICS 0x100 // Use FILE_FLAG_BACKUP_SEMANTICS on open/creates.
  142. #define PRIVCOPY_FILE_SUPERSEDE 0x200 // Replace original dest with source
  143. #define PRIVCOPY_FILE_SKIP_DACL 0x400 // Workaround for csc/roamprofs
  144. #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)
  145. #define PRIVPROGRESS_REASON_NOT_HANDLED 4
  146. #define PRIVCALLBACK_STREAMS_NOT_SUPPORTED 2
  147. #define PRIVCALLBACK_COMPRESSION_NOT_SUPPORTED 5
  148. #define PRIVCALLBACK_COMPRESSION_FAILED 6
  149. #define PRIVCALLBACK_ENCRYPTION_NOT_SUPPORTED 8
  150. #define PRIVCALLBACK_ENCRYPTION_FAILED 9
  151. #define PRIVCALLBACK_EAS_NOT_SUPPORTED 10
  152. #define PRIVCALLBACK_SPARSE_NOT_SUPPORTED 11
  153. #define PRIVCALLBACK_SPARSE_FAILED 12
  154. #define PRIVCALLBACK_DACL_ACCESS_DENIED 13
  155. #define PRIVCALLBACK_OWNER_GROUP_ACCESS_DENIED 14
  156. #define PRIVCALLBACK_OWNER_GROUP_FAILED 19
  157. #define PRIVCALLBACK_SACL_ACCESS_DENIED 15
  158. #define PRIVCALLBACK_SECURITY_INFORMATION_NOT_SUPPORTED 16
  159. #define PRIVCALLBACK_CANT_ENCRYPT_SYSTEM_FILE 17
  160. #define PRIVMOVE_FILEID_DELETE_OLD_FILE 0x01
  161. #define PRIVMOVE_FILEID_IGNORE_ID_ERRORS 0x02
  162. BOOL
  163. APIENTRY
  164. PrivMoveFileIdentityW(
  165. LPCWSTR lpOldFileName,
  166. LPCWSTR lpNewFileName,
  167. DWORD dwFlags
  168. );
  169. BOOL
  170. APIENTRY
  171. PrivCopyFileExW(
  172. LPCWSTR lpExistingFileName,
  173. LPCWSTR lpNewFileName,
  174. LPPROGRESS_ROUTINE lpProgressRoutine OPTIONAL,
  175. LPVOID lpData OPTIONAL,
  176. LPBOOL pbCancel OPTIONAL,
  177. DWORD dwCopyFlags
  178. );
  179. #endif // (_WIN32_WINNT >= 0x0500)
  180. //#define ACTCTX_FLAG_LIKE_CREATEPROCESS (0x00000100)
  181. BOOL
  182. WINAPI
  183. CloseProfileUserMapping( VOID );
  184. BOOL
  185. WINAPI
  186. OpenProfileUserMapping( VOID );
  187. BOOL
  188. WINAPI
  189. QueryWin31IniFilesMappedToRegistry(
  190. IN DWORD Flags,
  191. OUT PWSTR Buffer,
  192. IN DWORD cchBuffer,
  193. OUT LPDWORD cchUsed
  194. );
  195. #define WIN31_INIFILES_MAPPED_TO_SYSTEM 0x00000001
  196. #define WIN31_INIFILES_MAPPED_TO_USER 0x00000002
  197. typedef BOOL (WINAPI *PWIN31IO_STATUS_CALLBACK)(
  198. IN PWSTR Status,
  199. IN PVOID CallbackParameter
  200. );
  201. typedef enum _WIN31IO_EVENT {
  202. Win31SystemStartEvent,
  203. Win31LogonEvent,
  204. Win31LogoffEvent
  205. } WIN31IO_EVENT;
  206. #define WIN31_MIGRATE_INIFILES 0x00000001
  207. #define WIN31_MIGRATE_GROUPS 0x00000002
  208. #define WIN31_MIGRATE_REGDAT 0x00000004
  209. #define WIN31_MIGRATE_ALL (WIN31_MIGRATE_INIFILES | WIN31_MIGRATE_GROUPS | WIN31_MIGRATE_REGDAT)
  210. DWORD
  211. WINAPI
  212. QueryWindows31FilesMigration(
  213. IN WIN31IO_EVENT EventType
  214. );
  215. BOOL
  216. WINAPI
  217. SynchronizeWindows31FilesAndWindowsNTRegistry(
  218. IN WIN31IO_EVENT EventType,
  219. IN DWORD Flags,
  220. IN PWIN31IO_STATUS_CALLBACK StatusCallBack,
  221. IN PVOID CallbackParameter
  222. );
  223. typedef struct _VIRTUAL_BUFFER {
  224. PVOID Base;
  225. PVOID CommitLimit;
  226. PVOID ReserveLimit;
  227. } VIRTUAL_BUFFER, *PVIRTUAL_BUFFER;
  228. BOOLEAN
  229. WINAPI
  230. CreateVirtualBuffer(
  231. OUT PVIRTUAL_BUFFER Buffer,
  232. IN ULONG CommitSize OPTIONAL,
  233. IN ULONG ReserveSize OPTIONAL
  234. );
  235. int
  236. WINAPI
  237. VirtualBufferExceptionHandler(
  238. IN ULONG ExceptionCode,
  239. IN PEXCEPTION_POINTERS ExceptionInfo,
  240. IN OUT PVIRTUAL_BUFFER Buffer
  241. );
  242. BOOLEAN
  243. WINAPI
  244. ExtendVirtualBuffer(
  245. IN PVIRTUAL_BUFFER Buffer,
  246. IN PVOID Address
  247. );
  248. BOOLEAN
  249. WINAPI
  250. TrimVirtualBuffer(
  251. IN PVIRTUAL_BUFFER Buffer
  252. );
  253. BOOLEAN
  254. WINAPI
  255. FreeVirtualBuffer(
  256. IN PVIRTUAL_BUFFER Buffer
  257. );
  258. //
  259. // filefind stucture shared with ntvdm, jonle
  260. // see mvdm\dos\dem\demsrch.c
  261. //
  262. typedef struct _FINDFILE_HANDLE {
  263. HANDLE DirectoryHandle;
  264. PVOID FindBufferBase;
  265. PVOID FindBufferNext;
  266. ULONG FindBufferLength;
  267. ULONG FindBufferValidLength;
  268. RTL_CRITICAL_SECTION FindBufferLock;
  269. } FINDFILE_HANDLE, *PFINDFILE_HANDLE;
  270. #define BASE_FIND_FIRST_DEVICE_HANDLE (HANDLE)1
  271. WINBASEAPI
  272. BOOL
  273. WINAPI
  274. GetDaylightFlag(VOID);
  275. WINBASEAPI
  276. BOOL
  277. WINAPI
  278. SetDaylightFlag(
  279. BOOL fDaylight
  280. );
  281. WINBASEAPI
  282. BOOL
  283. WINAPI
  284. FreeLibrary16(
  285. HINSTANCE hLibModule
  286. );
  287. WINBASEAPI
  288. FARPROC
  289. WINAPI
  290. GetProcAddress16(
  291. HINSTANCE hModule,
  292. LPCSTR lpProcName
  293. );
  294. WINBASEAPI
  295. HINSTANCE
  296. WINAPI
  297. LoadLibrary16(
  298. LPCSTR lpLibFileName
  299. );
  300. WINBASEAPI
  301. BOOL
  302. APIENTRY
  303. NukeProcess(
  304. DWORD ppdb,
  305. UINT uExitCode,
  306. DWORD ulFlags);
  307. WINBASEAPI
  308. HGLOBAL
  309. WINAPI
  310. GlobalAlloc16(
  311. UINT uFlags,
  312. DWORD dwBytes
  313. );
  314. WINBASEAPI
  315. LPVOID
  316. WINAPI
  317. GlobalLock16(
  318. HGLOBAL hMem
  319. );
  320. WINBASEAPI
  321. BOOL
  322. WINAPI
  323. GlobalUnlock16(
  324. HGLOBAL hMem
  325. );
  326. WINBASEAPI
  327. HGLOBAL
  328. WINAPI
  329. GlobalFree16(
  330. HGLOBAL hMem
  331. );
  332. WINBASEAPI
  333. DWORD
  334. WINAPI
  335. GlobalSize16(
  336. HGLOBAL hMem
  337. );
  338. WINBASEAPI
  339. DWORD
  340. WINAPI
  341. RegisterServiceProcess(
  342. IN DWORD dwProcessId,
  343. IN DWORD dwServiceType
  344. );
  345. #define RSP_UNREGISTER_SERVICE 0x00000000
  346. #define RSP_SIMPLE_SERVICE 0x00000001
  347. WINBASEAPI
  348. VOID
  349. WINAPI
  350. ReinitializeCriticalSection(
  351. IN LPCRITICAL_SECTION lpCriticalSection
  352. );
  353. //
  354. // New Multi-User specific routines to support per session
  355. // network driver mappings. Related to Wksvc changes
  356. //
  357. WINBASEAPI
  358. BOOL
  359. WINAPI
  360. DosPathToSessionPathA(
  361. IN DWORD SessionId,
  362. IN LPCSTR pInPath,
  363. OUT LPSTR *ppOutPath
  364. );
  365. WINBASEAPI
  366. BOOL
  367. WINAPI
  368. DosPathToSessionPathW(
  369. IN DWORD SessionId,
  370. IN LPCWSTR pInPath,
  371. OUT LPWSTR *ppOutPath
  372. );
  373. //terminal server time zone support
  374. BOOL
  375. WINAPI
  376. SetClientTimeZoneInformation(
  377. IN CONST TIME_ZONE_INFORMATION *ptzi
  378. );
  379. #ifdef UNICODE
  380. #define DosPathToSessionPath DosPathToSessionPathW
  381. #else
  382. #define DosPathToSessionPath DosPathToSessionPathA
  383. #endif // !UNICODE
  384. #define COMPLUS_ENABLE_64BIT 0x00000001
  385. #define COMPLUS_INSTALL_FLAGS_INVALID (~(COMPLUS_ENABLE_64BIT))
  386. ULONG
  387. WINAPI
  388. GetComPlusPackageInstallStatus(
  389. VOID
  390. );
  391. BOOL
  392. WINAPI
  393. SetComPlusPackageInstallStatus(
  394. ULONG ComPlusPackage
  395. );
  396. #ifdef __cplusplus
  397. }
  398. #endif
  399. #endif // ndef _WINBASEP_