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.

51 lines
2.0 KiB

  1. /************************** Module Header ***********************************
  2. * fileio.h
  3. * Function Prototypes for File I/O in Kernel mode.
  4. *
  5. * NOTE: these functions perform File read, seek operations.
  6. *
  7. * Copyright (C) 1991 - 1999 Microsoft Corporation
  8. *
  9. ****************************************************************************/
  10. #define CURRENTFILEPTR(pFile) (LPVOID)((LPBYTE)(pFile->pvFilePointer)\
  11. + pFile->dwCurrentByteOffset)
  12. #define ENDOFFILEPTR(pFile) ( pFile->pvFilePointer + \
  13. pFile->dwTotalSize )
  14. #define STARTFILEPTR(pFile) ( pFile->pvFilePointer )
  15. #define STARTFILEOFFSETPTR(pFile,offset) ( pFile->pvFilePointer + \
  16. offset )
  17. #define NUMBYTESREMAINING(pFile) ( pFile->dwTotalSize - \
  18. pFile->dwCurrentByteOffset )
  19. #define UPDATECURROFFSET(pFile,offset) (pFile->dwCurrentByteOffset +=\
  20. offset )
  21. #define DRV_FILE_BEGIN 0
  22. #define DRV_FILE_CURRENT 1
  23. #define INVALID_HANDLE_VALUE (HANDLE)-1
  24. typedef struct _MAPFILE
  25. {
  26. HANDLE hHandle; /* Handle to the file, returned by EngLoadModule */
  27. DWORD dwTotalSize; /* Total Size of the file, as returned by
  28. * EngMapModule.
  29. */
  30. DWORD dwCurrentByteOffset; /* Current Byte Offset in the file.
  31. * Updated after each read and DrvSetFile-
  32. * Pointer.
  33. */
  34. PVOID pvFilePointer; /* Start of the file pointer, as returned
  35. * EngMapModule
  36. */
  37. struct _MAPFILE *pNext; /* Next File Pointer.*/
  38. }MAPFILE, * PMAPFILE;