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.

179 lines
5.2 KiB

  1. /*++
  2. Copyright (c) 1989-1999 Microsoft Corporation
  3. Module Name:
  4. smbmrx.h
  5. Abstract:
  6. This module includes all SMB smaple mini redirector definitions shared
  7. between the control utility, network provider DLL and the mini redirector
  8. Notes:
  9. This module has been built and tested only in UNICODE environment
  10. --*/
  11. #ifndef _SMBMRX_H_
  12. #define _SMBMRX_H_
  13. // This file contains all the definitions that are shared across the multiple
  14. // components that constitute the mini rdr -- the mini redirector driver,
  15. // the net provider dll and the utility.
  16. // The sample net provider id. This needs to be unique and
  17. // should not be the same as any other network provider id.
  18. #ifndef WNNC_NET_RDR2_SAMPLE
  19. #define WNNC_NET_RDR2_SAMPLE 0x00250000
  20. #endif
  21. #define SMBMRX_DEVICE_NAME_U L"SmbSampleMiniRedirector"
  22. #define SMBMRX_DEVICE_NAME_A "SmbSampleMiniRedirector"
  23. #ifdef UNICODE
  24. #define SMBMRX_DEVICE_NAME SMBMRX_DEVICE_NAME_U
  25. #else
  26. #define SMBMRX_DEVICE_NAME SMBMRX_DEVICE_NAME_A
  27. #endif
  28. // The following constant defines the length of the above name.
  29. #define SMBMRX_DEVICE_NAME_A_LENGTH (24)
  30. #define SMBMRX_PROVIDER_NAME_U L"SMB Sample Redirector Network"
  31. #define SMBMRX_PROVIDER_NAME_A "SMB Sample Redirector Network"
  32. #ifdef UNICODE
  33. #define SMBMRX_PROVIDER_NAME SMBMRX_PROVIDER_NAME_U
  34. #else
  35. #define SMBMRX_PROVIDER_NAME SMBMRX_PROVIDER_NAME_A
  36. #endif
  37. // The following constant defines the length of the above name.
  38. #define DD_SMBMRX_FS_DEVICE_NAME_U L"\\Device\\SmbSampleMiniRedirector"
  39. #define DD_SMBMRX_FS_DEVICE_NAME_A "\\Device\\SmbSampleMiniRedirector"
  40. #ifdef UNICODE
  41. #define DD_SMBMRX_FS_DEVICE_NAME DD_SMBMRX_FS_DEVICE_NAME_U
  42. #else
  43. #define DD_SMBMRX_FS_DEVICE_NAME DD_SMBMRX_FS_DEVICE_NAME_A
  44. #endif
  45. #define SMBMRX_MINIRDR_PARAMETERS \
  46. L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\SmbMRx\\Parameters"
  47. //
  48. // The Devicename string required to access the mini-redirector device from
  49. // User Mode
  50. //
  51. // WARNING The next two strings must be kept in sync. Change one and you must change the
  52. // other. These strings have been chosen such that they are unlikely to
  53. // coincide with names of other drivers.
  54. //
  55. #define DD_SMBMRX_USERMODE_SHADOW_DEV_NAME_U L"\\??\\SmbMiniRdrDCN"
  56. #define DD_SMBMRX_USERMODE_DEV_NAME_U L"\\\\.\\SmbMiniRdrDCN"
  57. #define DD_SMBMRX_USERMODE_DEV_NAME_A "\\\\.\\SmbMiniRdrDCN"
  58. #ifdef UNICODE
  59. #define DD_SMBMRX_USERMODE_DEV_NAME DD_SMBMRX_USERMODE_DEV_NAME_U
  60. #else
  61. #define DD_SMBMRX_USERMODE_DEV_NAME DD_SMBMRX_USERMODE_DEV_NAME_A
  62. #endif
  63. // UM code use devioclt.h
  64. // BEGIN WARNING WARNING WARNING WARNING
  65. // The following are from the ddk include files and cannot be changed
  66. //#define FILE_DEVICE_NETWORK_FILE_SYSTEM 0x00000014 // from ddk\inc\ntddk.h
  67. //#define METHOD_BUFFERED 0
  68. //#define FILE_ANY_ACCESS 0
  69. // END WARNING WARNING WARNING WARNING
  70. #define IOCTL_RDR_BASE FILE_DEVICE_NETWORK_FILE_SYSTEM
  71. #define _RDR_CONTROL_CODE(request, method, access) \
  72. CTL_CODE(IOCTL_RDR_BASE, request, method, access)
  73. #define IOCTL_SMBMRX_START _RDR_CONTROL_CODE(100, METHOD_NEITHER, FILE_ANY_ACCESS)
  74. #define IOCTL_SMBMRX_STOP _RDR_CONTROL_CODE(101, METHOD_NEITHER, FILE_ANY_ACCESS)
  75. #define IOCTL_SMBMRX_GETSTATE _RDR_CONTROL_CODE(102, METHOD_BUFFERED, FILE_ANY_ACCESS)
  76. #define IOCTL_SMBMRX_ADDCONN _RDR_CONTROL_CODE(125, METHOD_BUFFERED, FILE_ANY_ACCESS)
  77. #define IOCTL_SMBMRX_DELCONN _RDR_CONTROL_CODE(126, METHOD_BUFFERED, FILE_ANY_ACCESS)
  78. #define SMBMRXNP_MAX_DEVICES (26)
  79. typedef struct _SMBMRX_CONNECTINFO_
  80. {
  81. DWORD ConnectionNameOffset;
  82. DWORD ConnectionNameLength;
  83. DWORD EaDataOffset;
  84. DWORD EaDataLength;
  85. BYTE InfoArea[1];
  86. } SMBMRX_CONNECTINFO, *PSMBMRX_CONNECTINFO;
  87. // The NP Dll updates a shared memory data structure to reflect the various
  88. // drive mappings established from the various process. This shared memory
  89. // is used in maintaining the data structures required for enumeration as
  90. // well.
  91. typedef struct _SMBMRXNP_NETRESOURCE_
  92. {
  93. BOOL InUse;
  94. USHORT LocalNameLength;
  95. USHORT RemoteNameLength;
  96. USHORT ConnectionNameLength;
  97. DWORD dwScope;
  98. DWORD dwType;
  99. DWORD dwDisplayType;
  100. DWORD dwUsage;
  101. WCHAR LocalName[MAX_PATH];
  102. WCHAR RemoteName[MAX_PATH];
  103. WCHAR ConnectionName[MAX_PATH];
  104. WCHAR UserName[MAX_PATH];
  105. WCHAR Password[MAX_PATH];
  106. } SMBMRXNP_NETRESOURCE, *PSMBMRXNP_NETRESOURCE;
  107. typedef struct _SMBMRXNP_SHARED_MEMORY_
  108. {
  109. INT HighestIndexInUse;
  110. INT NumberOfResourcesInUse;
  111. SMBMRXNP_NETRESOURCE NetResources[SMBMRXNP_MAX_DEVICES];
  112. } SMBMRXNP_SHARED_MEMORY, *PSMBMRXNP_SHARED_MEMORY;
  113. #define SMBMRXNP_SHARED_MEMORY_NAME L"SMBMRXNPMEMORY"
  114. #define SMBMRXNP_MUTEX_NAME L"SMBMRXNPMUTEX"
  115. #define RDR_NULL_STATE 0
  116. #define RDR_UNLOADED 1
  117. #define RDR_UNLOADING 2
  118. #define RDR_LOADING 3
  119. #define RDR_LOADED 4
  120. #define RDR_STOPPED 5
  121. #define RDR_STOPPING 6
  122. #define RDR_STARTING 7
  123. #define RDR_STARTED 8
  124. #ifndef min
  125. #define min(a, b) ((a) > (b) ? (b) : (a))
  126. #endif
  127. #endif // _SMBMRX_H_