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.

62 lines
2.1 KiB

  1. /*
  2. * file.h - File routines module description.
  3. */
  4. /* Constants
  5. ************/
  6. /*
  7. * maximum length of unique name created by MakeUniqueName(), including null
  8. * terminator
  9. */
  10. #define MAX_UNIQUE_NAME_LEN (8 + 1 + 3 + 1)
  11. /* file-related flag combinations */
  12. #define ALL_FILE_ACCESS_FLAGS (GENERIC_READ |\
  13. GENERIC_WRITE)
  14. #define ALL_FILE_SHARING_FLAGS (FILE_SHARE_READ |\
  15. FILE_SHARE_WRITE)
  16. #define ALL_FILE_ATTRIBUTES (FILE_ATTRIBUTE_READONLY |\
  17. FILE_ATTRIBUTE_HIDDEN |\
  18. FILE_ATTRIBUTE_SYSTEM |\
  19. FILE_ATTRIBUTE_DIRECTORY |\
  20. FILE_ATTRIBUTE_ARCHIVE |\
  21. FILE_ATTRIBUTE_NORMAL |\
  22. FILE_ATTRIBUTE_TEMPORARY)
  23. #define ALL_FILE_FLAGS (FILE_FLAG_WRITE_THROUGH |\
  24. FILE_FLAG_OVERLAPPED |\
  25. FILE_FLAG_NO_BUFFERING |\
  26. FILE_FLAG_RANDOM_ACCESS |\
  27. FILE_FLAG_SEQUENTIAL_SCAN |\
  28. FILE_FLAG_DELETE_ON_CLOSE |\
  29. FILE_FLAG_BACKUP_SEMANTICS |\
  30. FILE_FLAG_POSIX_SEMANTICS)
  31. #define ALL_FILE_ATTRIBUTES_AND_FLAGS (ALL_FILE_ATTRIBUTES |\
  32. ALL_FILE_FLAGS)
  33. /* Macros
  34. *********/
  35. /* file attribute manipulation */
  36. #define IS_ATTR_DIR(attr) (IS_FLAG_SET((attr), FILE_ATTRIBUTE_DIRECTORY))
  37. #define IS_ATTR_VOLUME(attr) (IS_FLAG_SET((attr), FILE_ATTRIBUTE_VOLUME))
  38. /* Prototypes
  39. *************/
  40. PUBLIC_CODE void BeginComp(void);
  41. PUBLIC_CODE void EndComp(void);
  42. PUBLIC_CODE TWINRESULT CompareFilesByHandle(HANDLE, HANDLE, PBOOL);
  43. PUBLIC_CODE TWINRESULT CompareFilesByName(HPATH, HPATH, PBOOL);