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.

85 lines
2.1 KiB

  1. //+----------------------------------------------------------------------------
  2. //
  3. // Copyright (C) 2000, Microsoft Corporation
  4. //
  5. // File: DfsReparse.hxx
  6. //
  7. // Contents: the Root Reparse Point support
  8. //
  9. //
  10. // History: May, 2002 Author: SupW
  11. //
  12. //-----------------------------------------------------------------------------
  13. #ifndef __DFS_REPARSE__
  14. #define __DFS_REPARSE__
  15. #define REPARSE_INDEX_PATH_LEN 64
  16. #define REPARSE_INDEX_PATH L"$Extend\\$Reparse:$R:$INDEX_ALLOCATION"
  17. // CchLength of \??\ is 4
  18. #define WHACKWHACKQQ L"\\??\\"
  19. #define WHACKWHACKQQ_SIZE (4 * sizeof(WCHAR))
  20. //
  21. // Files store timestamp in LARGE_INTEGERs, but we work with FILETIMEs
  22. //
  23. #define LARGE_INTEGER_TO_FILETIME( dest, src ) {\
  24. (dest)->dwLowDateTime = (src)->LowPart; \
  25. (dest)->dwHighDateTime = (src)->HighPart; \
  26. }
  27. //
  28. // List of volumes that have dfs reparse points in them.
  29. //
  30. typedef struct _DFS_REPARSE_VOLUME_INFO {
  31. UNICODE_STRING VolumeName;
  32. LIST_ENTRY ListEntry;
  33. } DFS_REPARSE_VOLUME_INFO, *PDFS_REPARSE_VOLUME_INFO;
  34. VOID
  35. DfsRemoveOrphanedReparsePoints(
  36. IN FILETIME ServiceStartupTime);
  37. NTSTATUS
  38. DfsDeleteLinkReparsePoint(
  39. PUNICODE_STRING pLinkName,
  40. HANDLE RelativeHandle,
  41. BOOLEAN bRemoveParentDirs);
  42. NTSTATUS
  43. DfsOpenDirectory(
  44. PUNICODE_STRING pDirectoryName,
  45. ULONG ShareMode,
  46. HANDLE RelativeHandle,
  47. PHANDLE pOpenedHandle,
  48. PBOOLEAN pIsNewlyCreated );
  49. VOID
  50. DfsCloseDirectory(
  51. HANDLE DirHandle );
  52. //
  53. // The TRUE flag in the third arg indicates that entire linkname
  54. // needs to be deleted including any empty parent directories
  55. // that may not necessarily be dfs reparse directories.
  56. //
  57. inline DFSSTATUS
  58. DfsDeleteLinkReparsePointAndParents(
  59. PUNICODE_STRING pLink,
  60. HANDLE DirHandle )
  61. {
  62. return DfsDeleteLinkReparsePoint( pLink, DirHandle, TRUE );
  63. }
  64. inline DFSSTATUS
  65. DfsDeleteLinkReparsePointDir(
  66. PUNICODE_STRING pLink,
  67. HANDLE DirHandle )
  68. {
  69. return DfsDeleteLinkReparsePoint( pLink, DirHandle, FALSE );
  70. }
  71. #endif