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.

202 lines
3.6 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. NTSTATUS
  18. SpConvertWin32FileOpenOrCreateToNtFileOpenOrCreate(
  19. ULONG Win32OpenOrCreate,
  20. ULONG* NtOpenOrCreate
  21. );
  22. NTSTATUS
  23. SpConvertWin32FileAccessToNtFileAccess(
  24. ULONG Win32FileAccess,
  25. ULONG* NtFileAccess
  26. );
  27. NTSTATUS
  28. SpConvertWin32FileShareToNtFileShare(
  29. ULONG Win32FileShare,
  30. ULONG* NtFileShare
  31. );
  32. HANDLE
  33. SpNtCreateFileW(
  34. PCUNICODE_STRING ConstantPath,
  35. IN ULONG FileAccess,
  36. IN ULONG FileShare,
  37. IN LPSECURITY_ATTRIBUTES SecurityAttributes,
  38. IN ULONG Win32FileOpenOrCreate,
  39. IN ULONG FlagsAndAttributes,
  40. IN HANDLE TemplateFile
  41. );
  42. HANDLE
  43. WINAPI
  44. SpWin32CreateFileW(
  45. IN PCWSTR FileName,
  46. IN ULONG FileAccess,
  47. IN ULONG FileShare,
  48. IN LPSECURITY_ATTRIBUTES SecurityAttributes,
  49. IN ULONG FileOpenOrCreate,
  50. IN ULONG FlagsAndAttributes,
  51. IN HANDLE TemplateFile
  52. );
  53. HANDLE
  54. WINAPI
  55. SpWin32CreateFileA(
  56. IN PCSTR FileName,
  57. IN ULONG FileAccess,
  58. IN ULONG FileShare,
  59. IN LPSECURITY_ATTRIBUTES SecurityAttributes,
  60. IN ULONG FileOpenOrCreate,
  61. IN ULONG dwFlagsAndAttributes,
  62. IN HANDLE TemplateFile
  63. );
  64. BOOL
  65. WINAPI
  66. SpWin32ReadFile(
  67. HANDLE hFile,
  68. PVOID lpBuffer,
  69. ULONG nNumberOfBytesToRead,
  70. ULONG* lpNumberOfBytesRead,
  71. LPOVERLAPPED lpOverlapped
  72. );
  73. BOOL
  74. WINAPI
  75. SpWin32WriteFile(
  76. HANDLE hFile,
  77. CONST VOID* lpBuffer,
  78. ULONG nNumberOfBytesToWrite,
  79. ULONG* lpNumberOfBytesWritten,
  80. LPOVERLAPPED lpOverlapped
  81. );
  82. ULONG
  83. WINAPI
  84. SpSetFilePointer(
  85. HANDLE hFile,
  86. LONG lDistanceToMove,
  87. LONG* lpDistanceToMoveHigh,
  88. ULONG dwMoveMethod
  89. );
  90. BOOL
  91. WINAPI
  92. SpWin32DeleteFileA(
  93. PCSTR FileName
  94. );
  95. BOOL
  96. APIENTRY
  97. SpFileTimeToDosDateTime(
  98. CONST FILETIME *lpFileTime,
  99. LPWORD lpFatDate,
  100. LPWORD lpFatTime
  101. );
  102. BOOL
  103. APIENTRY
  104. SpDosDateTimeToFileTime(
  105. WORD wFatDate,
  106. WORD wFatTime,
  107. LPFILETIME lpFileTime
  108. );
  109. BOOL
  110. WINAPI
  111. SpFileTimeToLocalFileTime(
  112. CONST FILETIME *lpFileTime,
  113. LPFILETIME lpLocalFileTime
  114. );
  115. BOOL
  116. WINAPI
  117. SpLocalFileTimeToFileTime(
  118. CONST FILETIME *lpLocalFileTime,
  119. LPFILETIME lpFileTime
  120. );
  121. BOOL
  122. WINAPI
  123. SpSetFileTime(
  124. HANDLE hFile,
  125. CONST FILETIME *lpCreationTime,
  126. CONST FILETIME *lpLastAccessTime,
  127. CONST FILETIME *lpLastWriteTime
  128. );
  129. BOOL
  130. APIENTRY
  131. SpSetFileAttributesA(
  132. PCSTR lpFileName,
  133. DWORD dwFileAttributes
  134. );
  135. BOOL
  136. APIENTRY
  137. SpSetFileAttributesW(
  138. PCWSTR lpFileName,
  139. DWORD dwFileAttributes
  140. );
  141. UINT
  142. WINAPI
  143. SpWin32GetTempFileNameW(
  144. PCWSTR TempDirectory,
  145. PCWSTR Prefix,
  146. UINT IgnoredNumber,
  147. PWSTR File
  148. );
  149. BOOL
  150. APIENTRY
  151. SpGetFileAttributesExA(
  152. PCSTR lpFileName,
  153. GET_FILEEX_INFO_LEVELS fInfoLevelId,
  154. PVOID lpFileInformation
  155. );
  156. BOOL
  157. APIENTRY
  158. SpGetFileAttributesExW(
  159. LPCWSTR lpFileName,
  160. GET_FILEEX_INFO_LEVELS fInfoLevelId,
  161. LPVOID lpFileInformation
  162. );
  163. WINBASEAPI
  164. BOOL
  165. WINAPI
  166. SpWin32CreateDirectoryW(
  167. IN PCWSTR lpPathName,
  168. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes
  169. );