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.

79 lines
1.6 KiB

  1. /*
  2. * fcache.h - File cache ADT description.
  3. */
  4. /* Types
  5. ********/
  6. /* return code */
  7. typedef enum _fcresult
  8. {
  9. FCR_SUCCESS,
  10. FCR_OUT_OF_MEMORY,
  11. FCR_OPEN_FAILED,
  12. FCR_CREATE_FAILED,
  13. FCR_WRITE_FAILED,
  14. FCR_FILE_LOCKED
  15. }
  16. FCRESULT;
  17. DECLARE_STANDARD_TYPES(FCRESULT);
  18. /* handles */
  19. #ifdef NOFCACHE
  20. typedef HANDLE HCACHEDFILE;
  21. #else
  22. DECLARE_HANDLE(HCACHEDFILE);
  23. #endif
  24. DECLARE_STANDARD_TYPES(HCACHEDFILE);
  25. /* cached file description */
  26. typedef struct _cachedfile
  27. {
  28. LPCTSTR pcszPath;
  29. DWORD dwcbDefaultCacheSize;
  30. DWORD dwOpenMode;
  31. DWORD dwSharingMode;
  32. PSECURITY_ATTRIBUTES psa;
  33. DWORD dwCreateMode;
  34. DWORD dwAttrsAndFlags;
  35. HANDLE hTemplateFile;
  36. }
  37. CACHEDFILE;
  38. DECLARE_STANDARD_TYPES(CACHEDFILE);
  39. /* Prototypes
  40. *************/
  41. /* fcache.c */
  42. extern FCRESULT CreateCachedFile(PCCACHEDFILE, PHCACHEDFILE);
  43. extern FCRESULT SetCachedFileCacheSize(HCACHEDFILE, DWORD);
  44. extern DWORD SeekInCachedFile(HCACHEDFILE, DWORD, DWORD);
  45. extern BOOL SetEndOfCachedFile(HCACHEDFILE);
  46. extern DWORD GetCachedFilePointerPosition(HCACHEDFILE);
  47. extern DWORD GetCachedFileSize(HCACHEDFILE);
  48. extern BOOL ReadFromCachedFile(HCACHEDFILE, PVOID, DWORD, PDWORD);
  49. extern BOOL WriteToCachedFile(HCACHEDFILE, PCVOID, DWORD, PDWORD);
  50. extern BOOL CommitCachedFile(HCACHEDFILE);
  51. extern HANDLE GetFileHandle(HCACHEDFILE);
  52. extern BOOL CloseCachedFile(HCACHEDFILE);
  53. extern HANDLE GetFileHandle(HCACHEDFILE);
  54. #if defined(DEBUG) || defined(VSTF)
  55. extern BOOL IsValidHCACHEDFILE(HCACHEDFILE);
  56. #endif