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.

412 lines
5.7 KiB

  1. /*++
  2. Copyright (c) 1990 Microsoft Corporation
  3. Module Name:
  4. Abstract:
  5. Author:
  6. Revision History:
  7. --*/
  8. #include "basedll.h"
  9. #include "mountmgr.h"
  10. #include "aclapi.h"
  11. #include "winefs.h"
  12. #define InterlockedIncrement _InterlockedIncrement
  13. #define InterlockedDecrement _InterlockedDecrement
  14. #define InterlockedExchange _InterlockedExchange
  15. #define InterlockedExchangeAdd _InterlockedExchangeAdd
  16. #define InterlockedCompareExchange _InterlockedCompareExchange
  17. #define InterlockedCompareExchange _InterlockedCompareExchange
  18. NTSTATUS
  19. WmipUuidCreate(
  20. OUT UUID *Uuid
  21. );
  22. NTSTATUS
  23. WmipRegOpenKey(
  24. IN LPWSTR lpKeyName,
  25. OUT PHANDLE KeyHandle
  26. );
  27. DWORD
  28. WmipGetLastError(
  29. VOID
  30. );
  31. VOID
  32. WmipSetLastError(
  33. DWORD
  34. dwErrCode
  35. );
  36. DWORD
  37. WINAPI
  38. WmipGetTimeZoneInformation(
  39. LPTIME_ZONE_INFORMATION lpTimeZoneInformation
  40. );
  41. BOOL
  42. WINAPI
  43. WmipGetVersionExW(
  44. LPOSVERSIONINFOW lpVersionInformation
  45. );
  46. BOOL
  47. WINAPI
  48. WmipGetVersionExA(
  49. LPOSVERSIONINFOA lpVersionInformation
  50. );
  51. PUNICODE_STRING
  52. WmipBaseIsThisAConsoleName(
  53. PCUNICODE_STRING FileNameString,
  54. DWORD dwDesiredAccess
  55. );
  56. ULONG
  57. WmipBaseSetLastNTError(
  58. IN NTSTATUS Status
  59. );
  60. PUNICODE_STRING
  61. WmipBasep8BitStringToStaticUnicodeString(
  62. IN LPCSTR lpSourceString
  63. );
  64. HANDLE
  65. WINAPI
  66. WmipCreateFileW(
  67. LPCWSTR lpFileName,
  68. DWORD dwDesiredAccess,
  69. DWORD dwShareMode,
  70. LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  71. DWORD dwCreationDisposition,
  72. DWORD dwFlagsAndAttributes,
  73. HANDLE hTemplateFile
  74. );
  75. HANDLE
  76. WmipBaseGetNamedObjectDirectory(
  77. VOID
  78. );
  79. POBJECT_ATTRIBUTES
  80. WmipBaseFormatObjectAttributes(
  81. OUT POBJECT_ATTRIBUTES ObjectAttributes,
  82. IN PSECURITY_ATTRIBUTES SecurityAttributes,
  83. IN PUNICODE_STRING ObjectName
  84. );
  85. HANDLE
  86. WINAPI
  87. WmipCreateFileA(
  88. LPCSTR lpFileName,
  89. DWORD dwDesiredAccess,
  90. DWORD dwShareMode,
  91. LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  92. DWORD dwCreationDisposition,
  93. DWORD dwFlagsAndAttributes,
  94. HANDLE hTemplateFile
  95. );
  96. HANDLE
  97. APIENTRY
  98. WmipCreateEventW(
  99. LPSECURITY_ATTRIBUTES lpEventAttributes,
  100. BOOL bManualReset,
  101. BOOL bInitialState,
  102. LPCWSTR lpName
  103. );
  104. HANDLE
  105. APIENTRY
  106. WmipCreateEventA(
  107. LPSECURITY_ATTRIBUTES lpEventAttributes,
  108. BOOL bManualReset,
  109. BOOL bInitialState,
  110. LPCSTR lpName
  111. );
  112. DWORD
  113. WINAPI
  114. WmipSetFilePointer(
  115. HANDLE hFile,
  116. LONG lDistanceToMove,
  117. PLONG lpDistanceToMoveHigh,
  118. DWORD dwMoveMethod
  119. );
  120. BOOL
  121. WINAPI
  122. WmipReadFile(
  123. HANDLE hFile,
  124. LPVOID lpBuffer,
  125. DWORD nNumberOfBytesToRead,
  126. LPDWORD lpNumberOfBytesRead,
  127. LPOVERLAPPED lpOverlapped
  128. );
  129. BOOL
  130. WmipCloseHandle(
  131. HANDLE hObject
  132. );
  133. DWORD
  134. APIENTRY
  135. WmipWaitForSingleObjectEx(
  136. HANDLE hHandle,
  137. DWORD dwMilliseconds,
  138. BOOL bAlertable
  139. );
  140. BOOL
  141. WINAPI
  142. WmipGetOverlappedResult(
  143. HANDLE hFile,
  144. LPOVERLAPPED lpOverlapped,
  145. LPDWORD lpNumberOfBytesTransferred,
  146. BOOL bWait
  147. );
  148. PLARGE_INTEGER
  149. WmipBaseFormatTimeOut(
  150. OUT PLARGE_INTEGER TimeOut,
  151. IN DWORD Milliseconds
  152. );
  153. DWORD
  154. WmipWaitForSingleObject(
  155. HANDLE hHandle,
  156. DWORD dwMilliseconds
  157. );
  158. BOOL
  159. WINAPI
  160. WmipDeviceIoControl(
  161. HANDLE hDevice,
  162. DWORD dwIoControlCode,
  163. LPVOID lpInBuffer,
  164. DWORD nInBufferSize,
  165. LPVOID lpOutBuffer,
  166. DWORD nOutBufferSize,
  167. LPDWORD lpBytesReturned,
  168. LPOVERLAPPED lpOverlapped
  169. );
  170. BOOL
  171. WINAPI
  172. WmipCancelIo(
  173. HANDLE hFile
  174. );
  175. VOID
  176. APIENTRY
  177. WmipExitThread(
  178. DWORD dwExitCode
  179. );
  180. DWORD
  181. WINAPI
  182. WmipGetCurrentProcessId(
  183. VOID
  184. );
  185. DWORD
  186. APIENTRY
  187. WmipGetCurrentThreadId(
  188. VOID
  189. );
  190. HANDLE
  191. WINAPI
  192. WmipGetCurrentProcess(
  193. VOID
  194. );
  195. BOOL
  196. WmipSetEvent(
  197. HANDLE hEvent
  198. );
  199. VOID
  200. WINAPI
  201. WmipGetSystemInfo(
  202. LPSYSTEM_INFO lpSystemInfo
  203. );
  204. VOID
  205. WINAPI
  206. WmipGlobalMemoryStatus(
  207. LPMEMORYSTATUS lpBuffer
  208. );
  209. DWORD
  210. APIENTRY
  211. WmipWaitForMultipleObjectsEx(
  212. DWORD nCount,
  213. CONST HANDLE *lpHandles,
  214. BOOL bWaitAll,
  215. DWORD dwMilliseconds,
  216. BOOL bAlertable
  217. );
  218. VOID
  219. BaseProcessStart(
  220. PPROCESS_START_ROUTINE lpStartAddress
  221. );
  222. VOID
  223. BaseThreadStart(
  224. IN LPTHREAD_START_ROUTINE lpStartAddress,
  225. IN LPVOID lpParameter
  226. );
  227. HANDLE
  228. APIENTRY
  229. WmipCreateThread(
  230. LPSECURITY_ATTRIBUTES lpThreadAttributes,
  231. DWORD dwStackSize,
  232. LPTHREAD_START_ROUTINE lpStartAddress,
  233. LPVOID lpParameter,
  234. DWORD dwCreationFlags,
  235. LPDWORD lpThreadId
  236. );
  237. DWORD
  238. APIENTRY
  239. WmipSleepEx(
  240. DWORD dwMilliseconds,
  241. BOOL bAlertable
  242. );
  243. VOID
  244. WmipSleep(
  245. DWORD dwMilliseconds
  246. );
  247. BOOL
  248. APIENTRY
  249. WmipSetThreadPriority(
  250. HANDLE hThread,
  251. int nPriority
  252. );
  253. BOOL
  254. WmipDuplicateHandle(
  255. HANDLE hSourceProcessHandle,
  256. HANDLE hSourceHandle,
  257. HANDLE hTargetProcessHandle,
  258. LPHANDLE lpTargetHandle,
  259. DWORD dwDesiredAccess,
  260. BOOL bInheritHandle,
  261. DWORD dwOptions
  262. );
  263. UINT
  264. WmipSetErrorMode(
  265. UINT uMode
  266. );
  267. UINT
  268. WmipGetErrorMode();
  269. ULONG WmipUnicodeToAnsi(
  270. LPCWSTR pszW,
  271. LPSTR * ppszA,
  272. ULONG *AnsiSizeInBytes OPTIONAL
  273. );
  274. ULONG WmipAnsiToUnicode(
  275. LPCSTR pszA,
  276. LPWSTR * ppszW
  277. );
  278. HANDLE
  279. APIENTRY
  280. WmipDuplicateConsoleHandle(
  281. IN HANDLE hSourceHandle,
  282. IN DWORD dwDesiredAccess,
  283. IN BOOL bInheritHandle,
  284. IN DWORD dwOptions
  285. );
  286. USHORT
  287. WmipGetCurrentExeName(
  288. OUT LPWSTR Buffer,
  289. IN ULONG BufferLength
  290. );
  291. DWORD
  292. WmipTlsAlloc(VOID);
  293. LPVOID
  294. WmipTlsGetValue(DWORD dwTlsIndex);
  295. BOOL
  296. WmipTlsSetValue(DWORD dwTlsIndex,LPVOID lpTlsValue);
  297. BOOL
  298. WmipTlsFree(DWORD dwTlsIndex);
  299. /*
  300. __int64
  301. WmipGetCycleCount();*/
  302. DWORD
  303. APIENTRY
  304. WmipGetFullPathNameA(
  305. LPCSTR lpFileName,
  306. DWORD nBufferLength,
  307. LPSTR lpBuffer,
  308. LPSTR *lpFilePart
  309. );
  310. ULONG
  311. WmipSetNtStatus(
  312. IN NTSTATUS Status
  313. );
  314. __inline
  315. ULONG
  316. WmipSetDosError(
  317. IN ULONG DosError
  318. )
  319. {
  320. WmipSetLastError(DosError);
  321. return DosError;
  322. }