home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / sdktools / winnt / perfmon / fileutil.h < prev    next >
Text File  |  1994-10-13  |  3KB  |  85 lines

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