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.

229 lines
3.7 KiB

  1. /*++
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. spwin.h
  5. Abstract:
  6. Win32 portability layer
  7. file i/o
  8. Get/SetLastError
  9. slight wrappers around such for porting windows\winstate\...\cablib.c
  10. Author:
  11. Jay Krell (a-JayK) November 2000
  12. Revision History:
  13. --*/
  14. #pragma once
  15. #include "windows.h"
  16. #define PATHS_ALWAYS_NATIVE 1
  17. VOID
  18. SpSetLastWin32ErrorAndNtStatusFromNtStatus(
  19. NTSTATUS Status
  20. );
  21. NTSTATUS
  22. SpGetLastNtStatus(
  23. VOID
  24. );
  25. NTSTATUS
  26. SpConvertWin32FileOpenOrCreateToNtFileOpenOrCreate(
  27. ULONG Win32OpenOrCreate,
  28. ULONG* NtOpenOrCreate
  29. );
  30. NTSTATUS
  31. SpConvertWin32FileAccessToNtFileAccess(
  32. ULONG Win32FileAccess,
  33. ULONG* NtFileAccess
  34. );
  35. NTSTATUS
  36. SpConvertWin32FileShareToNtFileShare(
  37. ULONG Win32FileShare,
  38. ULONG* NtFileShare
  39. );
  40. NTSTATUS
  41. SpGetLastNtStatus(
  42. VOID
  43. );
  44. ULONG
  45. WINAPI
  46. SpGetLastWin32Error(
  47. VOID
  48. );
  49. VOID
  50. WINAPI
  51. SpSetLastWin32Error(
  52. ULONG Error
  53. );
  54. HANDLE
  55. SpNtCreateFileW(
  56. PCUNICODE_STRING ConstantPath,
  57. IN ULONG FileAccess,
  58. IN ULONG FileShare,
  59. IN LPSECURITY_ATTRIBUTES SecurityAttributes,
  60. IN ULONG Win32FileOpenOrCreate,
  61. IN ULONG FlagsAndAttributes,
  62. IN HANDLE TemplateFile
  63. );
  64. HANDLE
  65. WINAPI
  66. SpWin32CreateFileW(
  67. IN PCWSTR FileName,
  68. IN ULONG FileAccess,
  69. IN ULONG FileShare,
  70. IN LPSECURITY_ATTRIBUTES SecurityAttributes,
  71. IN ULONG FileOpenOrCreate,
  72. IN ULONG FlagsAndAttributes,
  73. IN HANDLE TemplateFile
  74. );
  75. HANDLE
  76. WINAPI
  77. SpWin32CreateFileA(
  78. IN PCSTR FileName,
  79. IN ULONG FileAccess,
  80. IN ULONG FileShare,
  81. IN LPSECURITY_ATTRIBUTES SecurityAttributes,
  82. IN ULONG FileOpenOrCreate,
  83. IN ULONG dwFlagsAndAttributes,
  84. IN HANDLE TemplateFile
  85. );
  86. BOOL
  87. WINAPI
  88. SpWin32ReadFile(
  89. HANDLE hFile,
  90. PVOID lpBuffer,
  91. ULONG nNumberOfBytesToRead,
  92. ULONG* lpNumberOfBytesRead,
  93. LPOVERLAPPED lpOverlapped
  94. );
  95. BOOL
  96. WINAPI
  97. SpWin32WriteFile(
  98. HANDLE hFile,
  99. CONST VOID* lpBuffer,
  100. ULONG nNumberOfBytesToWrite,
  101. ULONG* lpNumberOfBytesWritten,
  102. LPOVERLAPPED lpOverlapped
  103. );
  104. ULONG
  105. WINAPI
  106. SpSetFilePointer(
  107. HANDLE hFile,
  108. LONG lDistanceToMove,
  109. LONG* lpDistanceToMoveHigh,
  110. ULONG dwMoveMethod
  111. );
  112. BOOL
  113. WINAPI
  114. SpWin32DeleteFileA(
  115. PCSTR FileName
  116. );
  117. BOOL
  118. APIENTRY
  119. SpFileTimeToDosDateTime(
  120. CONST FILETIME *lpFileTime,
  121. LPWORD lpFatDate,
  122. LPWORD lpFatTime
  123. );
  124. BOOL
  125. APIENTRY
  126. SpDosDateTimeToFileTime(
  127. WORD wFatDate,
  128. WORD wFatTime,
  129. LPFILETIME lpFileTime
  130. );
  131. BOOL
  132. WINAPI
  133. SpFileTimeToLocalFileTime(
  134. CONST FILETIME *lpFileTime,
  135. LPFILETIME lpLocalFileTime
  136. );
  137. BOOL
  138. WINAPI
  139. SpLocalFileTimeToFileTime(
  140. CONST FILETIME *lpLocalFileTime,
  141. LPFILETIME lpFileTime
  142. );
  143. BOOL
  144. WINAPI
  145. SpSetFileTime(
  146. HANDLE hFile,
  147. CONST FILETIME *lpCreationTime,
  148. CONST FILETIME *lpLastAccessTime,
  149. CONST FILETIME *lpLastWriteTime
  150. );
  151. BOOL
  152. APIENTRY
  153. SpSetFileAttributesA(
  154. PCSTR lpFileName,
  155. DWORD dwFileAttributes
  156. );
  157. BOOL
  158. APIENTRY
  159. SpSetFileAttributesW(
  160. PCWSTR lpFileName,
  161. DWORD dwFileAttributes
  162. );
  163. UINT
  164. WINAPI
  165. SpWin32GetTempFileNameW(
  166. PCWSTR TempDirectory,
  167. PCWSTR Prefix,
  168. UINT IgnoredNumber,
  169. PWSTR File
  170. );
  171. BOOL
  172. APIENTRY
  173. SpGetFileAttributesExA(
  174. PCSTR lpFileName,
  175. GET_FILEEX_INFO_LEVELS fInfoLevelId,
  176. PVOID lpFileInformation
  177. );
  178. BOOL
  179. APIENTRY
  180. SpGetFileAttributesExW(
  181. LPCWSTR lpFileName,
  182. GET_FILEEX_INFO_LEVELS fInfoLevelId,
  183. LPVOID lpFileInformation
  184. );
  185. WINBASEAPI
  186. BOOL
  187. WINAPI
  188. SpWin32CreateDirectoryW(
  189. IN PCWSTR lpPathName,
  190. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes
  191. );