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.

84 lines
2.5 KiB

  1. //==========================================================================//
  2. // Exported Functions //
  3. //==========================================================================//
  4. #define FILE_ERROR_MESSAGE_SIZE 256
  5. VOID FileErrorMessageBox(HWND hWnd,
  6. LPTSTR lpszFileName,
  7. DWORD ErrorCode) ;
  8. BOOL FileRead (HANDLE hFile,
  9. LPMEMORY lpMemory,
  10. DWORD nAmtToRead) ;
  11. BOOL FileWrite (HANDLE hFile,
  12. LPMEMORY lpMemory,
  13. DWORD nAmtToWrite) ;
  14. #define FileSeekBegin(hFile, lAmtToMove) \
  15. SetFilePointer (hFile, lAmtToMove, NULL, FILE_BEGIN)
  16. #define FileSeekEnd(hFile, lAmtToMove) \
  17. SetFilePointer (hFile, lAmtToMove, NULL, FILE_END)
  18. #define FileSeekCurrent(hFile, lAmtToMove) \
  19. SetFilePointer (hFile, lAmtToMove, NULL, FILE_CURRENT)
  20. #define FileTell(hFile) \
  21. SetFilePointer (hFile, 0, NULL, FILE_CURRENT)
  22. #define FileHandleOpen(lpszFilePath) \
  23. (HANDLE) CreateFile (lpszFilePath, \
  24. GENERIC_READ | GENERIC_WRITE, \
  25. FILE_SHARE_READ, \
  26. NULL, OPEN_EXISTING, \
  27. FILE_ATTRIBUTE_NORMAL, NULL)
  28. #define FileHandleReadOnly(lpszFilePath) \
  29. (HANDLE) CreateFile (lpszFilePath, \
  30. GENERIC_READ , \
  31. FILE_SHARE_READ | FILE_SHARE_WRITE, \
  32. NULL, OPEN_EXISTING, \
  33. FILE_ATTRIBUTE_NORMAL, NULL)
  34. #define FileHandleCreate(lpszFilePath) \
  35. (HANDLE) CreateFile (lpszFilePath, \
  36. GENERIC_READ | GENERIC_WRITE, \
  37. FILE_SHARE_READ, \
  38. NULL, CREATE_ALWAYS, \
  39. FILE_ATTRIBUTE_NORMAL, NULL)
  40. int FileHandleSeekCurrent (HANDLE hFile,
  41. int iAmtToMove,
  42. LPTSTR lpszFilePath) ;
  43. int FileHandleSeekStart (HANDLE hFile,
  44. int iAmtToMove,
  45. LPTSTR lpszFilePath) ;
  46. BOOL FileHandleWrite (HANDLE hFile,
  47. LPMEMORY lpBuffer,
  48. int cbWrite,
  49. LPTSTR lpszFilePath) ;
  50. LPMEMORY FileMap (HANDLE hFile, HANDLE *phMapHandle) ;
  51. BOOL FileUnMap (LPVOID pBase, HANDLE hMapHandle) ;
  52. void FileDriveDirectory (LPTSTR lpszFileSpec,
  53. LPTSTR lpszDirectory) ;
  54. void FileNameExtension (LPTSTR lpszSpec,
  55. LPTSTR lpszFileNameExtension) ;
  56. 
  57.