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.

80 lines
2.5 KiB

  1. #ifndef _WIN32FN_H_
  2. #define _WIN32FN_H_
  3. #include <win16def.h>
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif // __cplusplus
  7. //
  8. // Defines for 32-bit file io
  9. //
  10. //#define INVALID_HANDLE_VALUE -1
  11. #define GENERIC_READ (0x80000000L)
  12. #define GENERIC_WRITE (0x40000000L)
  13. #define GENERIC_EXECUTE (0x20000000L)
  14. #define GENERIC_ALL (0x10000000L)
  15. #define FILE_FLAG_WRITE_THROUGH 0x80000000
  16. #define FILE_FLAG_OVERLAPPED 0x40000000
  17. #define FILE_FLAG_NO_BUFFERING 0x20000000
  18. #define FILE_FLAG_RANDOM_ACCESS 0x10000000
  19. #define FILE_FLAG_SEQUENTIAL_SCAN 0x08000000
  20. #define FILE_FLAG_DELETE_ON_CLOSE 0x04000000
  21. #define FILE_FLAG_BACKUP_SEMANTICS 0x02000000
  22. #define FILE_FLAG_POSIX_SEMANTICS 0x01000000
  23. #define CREATE_NEW 1
  24. #define CREATE_ALWAYS 2
  25. #define OPEN_EXISTING 3
  26. #define OPEN_ALWAYS 4
  27. #define TRUNCATE_EXISTING 5
  28. #define FILE_SHARE_READ 0x00000001
  29. #define FILE_SHARE_WRITE 0x00000002
  30. #define FILE_SHARE_DELETE 0x00000004
  31. #define MOVEFILE_REPLACE_EXISTING 0x00000001
  32. #define MOVEFILE_COPY_ALLOWED 0x00000002
  33. #define MOVEFILE_DELAY_UNTIL_REBOOT 0x00000004
  34. #define MOVEFILE_WRITE_THROUGH 0x00000008
  35. HANDLE CreateFile(
  36. LPCTSTR lpFileName, // pointer to name of the file
  37. DWORD dwDesiredAccess, // access (read-write) mode
  38. DWORD dwShareMode, // share mode
  39. LPSECURITY_ATTRIBUTES lpSecurityAttributes, // pointer to security descriptor
  40. DWORD dwCreationDistribution, // how to create
  41. DWORD dwFlagsAndAttributes, // file attributes
  42. HANDLE hTemplateFile // handle to file with attributes to copy
  43. );
  44. BOOL WriteFile(
  45. HANDLE hFile, // handle to file to write to
  46. LPCVOID lpBuffer, // pointer to data to write to file
  47. DWORD nNumberOfBytesToWrite, // number of bytes to write
  48. LPDWORD lpNumberOfBytesWritten, // pointer to number of bytes written
  49. LPOVERLAPPED lpOverlapped // pointer to structure needed for overlapped I/O
  50. );
  51. BOOL MoveFileEx(
  52. LPCTSTR lpExistingFileName, // address of name of the existing file
  53. LPCTSTR lpNewFileName, // address of new name for the file
  54. DWORD dwFlags // flag to determine how to move file
  55. );
  56. BOOL CloseHandle(
  57. HANDLE hObject // handle to object to close
  58. );
  59. #ifdef __cplusplus
  60. }
  61. #endif // __cplusplus
  62. #endif // _WIN32FN_H_