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.

164 lines
5.1 KiB

  1. /*=========================================================================*\
  2. Module: Dfsumr.h
  3. Copyright Microsoft Corporation 2001, All Rights Reserved.
  4. Author: Rohan Phillips - Rohanp
  5. Description: User mode reflector header file
  6. \*=========================================================================*/
  7. #ifndef __DFSUMRSTRCT_H__
  8. #define __DFSUMRSTRCT_H__
  9. // This should be bumped whenever there are changes made to these structures
  10. //
  11. #define UMR_VERSION 1
  12. #define MAX_USERMODE_REFLECTION_BUFFER 16384
  13. #define UMRX_USERMODE_WORKITEM_CORRELATOR_SIZE 4
  14. #define UMR_WORKITEM_HEADER_FLAG_RETURN_IMMEDIATE 0x00000001
  15. #define UMR_WORKITEM_HEADER_ASYNC_COMPLETE 0x00000002
  16. #define DFSUMRSIGNATURE 'DFSU'
  17. //
  18. // enum definitions.
  19. //
  20. typedef enum _USERMODE_WORKITEMS_TYPES {
  21. opUmrIsDfsLink = 1, // 0 is an invalid type
  22. opUmrGetDfsReplicas,
  23. opUmrMax
  24. } USERMODE_WORKITEMS_TYPES;
  25. //
  26. // DFSFILTER_ATTACH/DETACH support
  27. // VOlume and share file names are passed in the PathNameBuffer.
  28. // Both strings are not null terminated, with the source name starting at
  29. // the beginning of FileNameBuffer, and the destination name immediately
  30. // following.
  31. //
  32. typedef struct _DFS_ATTACH_PATH_BUFFER_ {
  33. ULONG VolumeNameLength;
  34. ULONG ShareNameLength;
  35. ULONG Flags;
  36. WCHAR PathNameBuffer[1];
  37. } DFS_ATTACH_PATH_BUFFER, *PDFS_ATTACH_PATH_BUFFER;
  38. #define UMRX_STATIC_REQUEST_LENGTH(__requesttypefield,__lastfieldofrequest) \
  39. (FIELD_OFFSET(UMRX_USERMODE_WORKITEM,__requesttypefield.__lastfieldofrequest) \
  40. + sizeof(((PUMRX_USERMODE_WORKITEM)NULL)->__requesttypefield.__lastfieldofrequest))
  41. #define UMR_ALIGN(x) ( ((x) % sizeof(double) == 0) ? \
  42. ( (x) ) : \
  43. ( (x) + sizeof(double) - (x) % sizeof(double) ) )
  44. typedef struct _VarData
  45. {
  46. ULONG cbData;
  47. ULONG cbOffset; // offset from location of this structure
  48. } VAR_DATA, *PVAR_DATA;
  49. // opUmrIsDfsLink
  50. //
  51. typedef struct _UmrIsDfsLinkReq_
  52. {
  53. ULONG Length;
  54. BYTE Buffer[1]; // start of vardata
  55. } UMR_ISDFSLINK_REQ, *PUMR_ISDFSLINK_REQ;
  56. typedef struct _UmrIsDfsLinkResp_
  57. {
  58. BOOL IsADfsLink;
  59. } UMR_ISDFSLINK_RESP, *PUMR_ISDFSLINK_RESP;
  60. // opUmrGetDfsreplicas
  61. //
  62. typedef struct _UmrGetDfsReplicasReq_
  63. {
  64. REPLICA_DATA_INFO RepInfo;
  65. } UMR_GETDFSREPLICAS_REQ, *PUMR_GETDFSREPLICAS_REQ;
  66. typedef struct _UmrGetDfsReplicasResp
  67. {
  68. ULONG Length;
  69. BYTE Buffer[1]; // start of vardata
  70. } UMR_GETDFSREPLICAS_RESP, *PUMR_GETDFSREPLICAS_RESP;
  71. // union for all request structs
  72. //
  73. typedef union _UMRX_USERMODE_WORK_REQUEST
  74. {
  75. UMR_ISDFSLINK_REQ IsDfsLinkRequest;
  76. UMR_GETDFSREPLICAS_REQ GetDfsReplicasRequest;
  77. } UMRX_USERMODE_WORK_REQUEST, *PUMRX_USERMODE_WORK_REQUEST;
  78. // union for all response structs
  79. //
  80. typedef union _UMRX_USERMODE_WORK_RESPONSE
  81. {
  82. UMR_ISDFSLINK_RESP IsDfsLinkResponse;
  83. UMR_GETDFSREPLICAS_RESP GetDfsReplicasResponse;
  84. } UMRX_USERMODE_WORK_RESPONSE, *PUMRX_USERMODE_WORK_RESPONSE;
  85. // header that's common to all requests and responses
  86. //
  87. typedef struct _UMRX_USERMODE_WORKITEM_HEADER {
  88. union {
  89. ULONG_PTR CorrelatorAsUInt[UMRX_USERMODE_WORKITEM_CORRELATOR_SIZE];
  90. double forcealignment;
  91. };
  92. IO_STATUS_BLOCK IoStatus;
  93. USERMODE_WORKITEMS_TYPES WorkItemType;
  94. DWORD dwDebugSig;
  95. ULONG ulHeaderVersion;
  96. ULONG ulFlags;
  97. } UMRX_USERMODE_WORKITEM_HEADER, *PUMRX_USERMODE_WORKITEM_HEADER;
  98. // The top level structure.
  99. //
  100. typedef struct _UMRX_USERMODE_WORKITEM {
  101. UMRX_USERMODE_WORKITEM_HEADER Header;
  102. union {
  103. UMRX_USERMODE_WORK_REQUEST WorkRequest;
  104. UMRX_USERMODE_WORK_RESPONSE WorkResponse;
  105. };
  106. CHAR Pad[1];
  107. } UMRX_USERMODE_WORKITEM, *PUMRX_USERMODE_WORKITEM;
  108. typedef struct _DFS_FILTER_STARTUP_INFO {
  109. BOOLEAN IsDC;
  110. DWORD Flags;
  111. } DFS_FILTER_STARTUP_INFO, *PDFS_FILTER_STARTUP_INFO;
  112. #define DFSFILTER_PROCESS_TERMINATION_FILEPATH L"\\ProcessTermination\\FilePath"
  113. #define DFSFILTER_W32_DEVICE_NAME L"\\\\.\\DfsFilter"
  114. #define DFSFILTER_DEVICE_TYPE 0x1235
  115. //
  116. // 545483: ioctls need to have write access
  117. //
  118. #define DFSFILTER_START_UMRX (ULONG) CTL_CODE( DFSFILTER_DEVICE_TYPE, 100, METHOD_BUFFERED, FILE_WRITE_ACCESS )
  119. #define DFSFILTER_STOP_UMRX (ULONG) CTL_CODE( DFSFILTER_DEVICE_TYPE, 101, METHOD_BUFFERED, FILE_WRITE_ACCESS )
  120. #define DFSFILTER_PROCESS_UMRXPACKET (ULONG) CTL_CODE( DFSFILTER_DEVICE_TYPE, 102, METHOD_BUFFERED, FILE_WRITE_ACCESS )
  121. #define DFSFILTER_GETREPLICA_INFO (ULONG) CTL_CODE( DFSFILTER_DEVICE_TYPE, 103, METHOD_BUFFERED, FILE_WRITE_ACCESS )
  122. #define DFSFILTER_ATTACH_FILESYSTEM (ULONG) CTL_CODE( DFSFILTER_DEVICE_TYPE, 104, METHOD_BUFFERED, FILE_WRITE_ACCESS )
  123. #define DFSFILTER_DETACH_FILESYSTEM (ULONG) CTL_CODE( DFSFILTER_DEVICE_TYPE, 105, METHOD_BUFFERED, FILE_WRITE_ACCESS )
  124. #define DFSFILTER_PURGE_SHARELIST (ULONG) CTL_CODE( DFSFILTER_DEVICE_TYPE, 106, METHOD_BUFFERED, FILE_WRITE_ACCESS )
  125. #endif