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

516 lines
11 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. WINBASEAPI
  181. DWORD
  182. WINAPI
  183. AddLocalAlternateComputerNameA (
  184. IN LPCSTR lpDnsFQHostname,
  185. IN ULONG ulFlags
  186. );
  187. WINBASEAPI
  188. DWORD
  189. WINAPI
  190. AddLocalAlternateComputerNameW (
  191. IN LPCWSTR lpDnsFQHostname,
  192. IN ULONG ulFlags
  193. );
  194. #ifdef UNICODE
  195. #define AddLocalAlternateComputerName AddLocalAlternateComputerNameW
  196. #else
  197. #define AddLocalAlternateComputerName AddLocalAlternateComputerNameA
  198. #endif // !UNICODE
  199. WINBASEAPI
  200. DWORD
  201. WINAPI
  202. RemoveLocalAlternateComputerNameA (
  203. IN LPCSTR lpAltDnsFQHostname,
  204. IN ULONG ulFlags
  205. );
  206. WINBASEAPI
  207. DWORD
  208. WINAPI
  209. RemoveLocalAlternateComputerNameW (
  210. IN LPCWSTR lpAltDnsFQHostname,
  211. IN ULONG ulFlags
  212. );
  213. #ifdef UNICODE
  214. #define RemoveLocalAlternateComputerName RemoveLocalAlternateComputerNameW
  215. #else
  216. #define RemoveLocalAlternateComputerName RemoveLocalAlternateComputerNameA
  217. #endif // !UNICODE
  218. WINBASEAPI
  219. DWORD
  220. WINAPI
  221. SetLocalPrimaryComputerNameA (
  222. IN LPCSTR lpAltDnsFQHostname,
  223. IN ULONG ulFlags
  224. );
  225. WINBASEAPI
  226. DWORD
  227. WINAPI
  228. SetLocalPrimaryComputerNameW (
  229. IN LPCWSTR lpAltDnsFQHostname,
  230. IN ULONG ulFlags
  231. );
  232. #ifdef UNICODE
  233. #define SetLocalPrimaryComputerName SetLocalPrimaryComputerNameW
  234. #else
  235. #define SetLocalPrimaryComputerName SetLocalPrimaryComputerNameA
  236. #endif // !UNICODE
  237. typedef enum _COMPUTER_NAME_TYPE {
  238. PrimaryComputerName,
  239. AlternateComputerNames,
  240. AllComputerNames,
  241. ComputerNameTypeMax
  242. } COMPUTER_NAME_TYPE ;
  243. WINBASEAPI
  244. DWORD
  245. WINAPI
  246. EnumerateLocalComputerNamesA (
  247. IN COMPUTER_NAME_TYPE NameType,
  248. IN ULONG ulFlags,
  249. IN OUT LPSTR lpDnsFQHostname,
  250. IN OUT LPDWORD nSize
  251. );
  252. WINBASEAPI
  253. DWORD
  254. WINAPI
  255. EnumerateLocalComputerNamesW (
  256. IN COMPUTER_NAME_TYPE NameType,
  257. IN ULONG ulFlags,
  258. IN OUT LPWSTR lpDnsFQHostname,
  259. IN OUT LPDWORD nSize
  260. );
  261. #ifdef UNICODE
  262. #define EnumerateLocalComputerNames EnumerateLocalComputerNamesW
  263. #else
  264. #define EnumerateLocalComputerNames EnumerateLocalComputerNamesA
  265. #endif // !UNICODE
  266. BOOL
  267. WINAPI
  268. CloseProfileUserMapping( VOID );
  269. BOOL
  270. WINAPI
  271. OpenProfileUserMapping( VOID );
  272. typedef struct _VIRTUAL_BUFFER {
  273. PVOID Base;
  274. PVOID CommitLimit;
  275. PVOID ReserveLimit;
  276. } VIRTUAL_BUFFER, *PVIRTUAL_BUFFER;
  277. BOOLEAN
  278. WINAPI
  279. CreateVirtualBuffer(
  280. OUT PVIRTUAL_BUFFER Buffer,
  281. IN ULONG CommitSize OPTIONAL,
  282. IN ULONG ReserveSize OPTIONAL
  283. );
  284. int
  285. WINAPI
  286. VirtualBufferExceptionHandler(
  287. IN ULONG ExceptionCode,
  288. IN PEXCEPTION_POINTERS ExceptionInfo,
  289. IN OUT PVIRTUAL_BUFFER Buffer
  290. );
  291. BOOLEAN
  292. WINAPI
  293. ExtendVirtualBuffer(
  294. IN PVIRTUAL_BUFFER Buffer,
  295. IN PVOID Address
  296. );
  297. BOOLEAN
  298. WINAPI
  299. TrimVirtualBuffer(
  300. IN PVIRTUAL_BUFFER Buffer
  301. );
  302. BOOLEAN
  303. WINAPI
  304. FreeVirtualBuffer(
  305. IN PVIRTUAL_BUFFER Buffer
  306. );
  307. //
  308. // filefind stucture shared with ntvdm, jonle
  309. // see mvdm\dos\dem\demsrch.c
  310. //
  311. typedef struct _FINDFILE_HANDLE {
  312. HANDLE DirectoryHandle;
  313. PVOID FindBufferBase;
  314. PVOID FindBufferNext;
  315. ULONG FindBufferLength;
  316. ULONG FindBufferValidLength;
  317. RTL_CRITICAL_SECTION FindBufferLock;
  318. } FINDFILE_HANDLE, *PFINDFILE_HANDLE;
  319. #define BASE_FIND_FIRST_DEVICE_HANDLE (HANDLE)1
  320. WINBASEAPI
  321. BOOL
  322. WINAPI
  323. GetDaylightFlag(VOID);
  324. WINBASEAPI
  325. BOOL
  326. WINAPI
  327. SetDaylightFlag(
  328. BOOL fDaylight
  329. );
  330. WINBASEAPI
  331. BOOL
  332. WINAPI
  333. FreeLibrary16(
  334. HINSTANCE hLibModule
  335. );
  336. WINBASEAPI
  337. FARPROC
  338. WINAPI
  339. GetProcAddress16(
  340. HINSTANCE hModule,
  341. LPCSTR lpProcName
  342. );
  343. WINBASEAPI
  344. HINSTANCE
  345. WINAPI
  346. LoadLibrary16(
  347. LPCSTR lpLibFileName
  348. );
  349. WINBASEAPI
  350. BOOL
  351. APIENTRY
  352. NukeProcess(
  353. DWORD ppdb,
  354. UINT uExitCode,
  355. DWORD ulFlags);
  356. WINBASEAPI
  357. HGLOBAL
  358. WINAPI
  359. GlobalAlloc16(
  360. UINT uFlags,
  361. DWORD dwBytes
  362. );
  363. WINBASEAPI
  364. LPVOID
  365. WINAPI
  366. GlobalLock16(
  367. HGLOBAL hMem
  368. );
  369. WINBASEAPI
  370. BOOL
  371. WINAPI
  372. GlobalUnlock16(
  373. HGLOBAL hMem
  374. );
  375. WINBASEAPI
  376. HGLOBAL
  377. WINAPI
  378. GlobalFree16(
  379. HGLOBAL hMem
  380. );
  381. WINBASEAPI
  382. DWORD
  383. WINAPI
  384. GlobalSize16(
  385. HGLOBAL hMem
  386. );
  387. WINBASEAPI
  388. DWORD
  389. WINAPI
  390. RegisterServiceProcess(
  391. IN DWORD dwProcessId,
  392. IN DWORD dwServiceType
  393. );
  394. #define RSP_UNREGISTER_SERVICE 0x00000000
  395. #define RSP_SIMPLE_SERVICE 0x00000001
  396. WINBASEAPI
  397. VOID
  398. WINAPI
  399. ReinitializeCriticalSection(
  400. IN LPCRITICAL_SECTION lpCriticalSection
  401. );
  402. //
  403. // New Multi-User specific routines to support per session
  404. // network driver mappings. Related to Wksvc changes
  405. //
  406. WINBASEAPI
  407. BOOL
  408. WINAPI
  409. DosPathToSessionPathA(
  410. IN DWORD SessionId,
  411. IN LPCSTR pInPath,
  412. OUT LPSTR *ppOutPath
  413. );
  414. WINBASEAPI
  415. BOOL
  416. WINAPI
  417. DosPathToSessionPathW(
  418. IN DWORD SessionId,
  419. IN LPCWSTR pInPath,
  420. OUT LPWSTR *ppOutPath
  421. );
  422. //terminal server time zone support
  423. BOOL
  424. WINAPI
  425. SetClientTimeZoneInformation(
  426. IN CONST TIME_ZONE_INFORMATION *ptzi
  427. );
  428. #ifdef UNICODE
  429. #define DosPathToSessionPath DosPathToSessionPathW
  430. #else
  431. #define DosPathToSessionPath DosPathToSessionPathA
  432. #endif // !UNICODE
  433. #define COMPLUS_ENABLE_64BIT 0x00000001
  434. #define COMPLUS_INSTALL_FLAGS_INVALID (~(COMPLUS_ENABLE_64BIT))
  435. ULONG
  436. WINAPI
  437. GetComPlusPackageInstallStatus(
  438. VOID
  439. );
  440. BOOL
  441. WINAPI
  442. SetComPlusPackageInstallStatus(
  443. ULONG ComPlusPackage
  444. );
  445. #ifdef __cplusplus
  446. }
  447. #endif
  448. #endif // ndef _WINBASEP_