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.

170 lines
4.8 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992-1999.
  5. //
  6. // File: gluon.h
  7. //
  8. // Contents: Gluon data structure definitions
  9. //
  10. // History: 16-Mar-94 MikeSe Created
  11. //
  12. // Description:
  13. //
  14. // This file contains all the structure definitions related to
  15. // gluons. It is constructed in such a way that it can be #included
  16. // in an IDL file and that the resultant MIDL-generated H file will
  17. // not interfere when both are included, regardless of order.
  18. //
  19. //----------------------------------------------------------------------------
  20. #ifndef __GLUON_H__
  21. #define __GLUON_H__
  22. #if _MSC_VER > 1000
  23. #pragma once
  24. #endif
  25. // Handy macro for decoration with MIDL attributes
  26. #if defined(MIDL_PASS)
  27. # define MIDL_DECL(x) x
  28. # define MIDL_QUOTE(x) cpp_quote(x)
  29. #else
  30. # define MIDL_DECL(x)
  31. # define MIDL_QUOTE(x)
  32. #endif
  33. MIDL_QUOTE("#ifndef __GLUON_H__")
  34. MIDL_QUOTE("#define __GLUON_H__")
  35. // TDI transport address structure. We do not define this if tdi.h has
  36. // already been included.
  37. MIDL_QUOTE("#if !defined(_TDI_USER_)")
  38. #if !defined(_TDI_USER_)
  39. typedef struct _TA_ADDRESS {
  40. USHORT AddressLength; // length in bytes of Address[] in this
  41. USHORT AddressType; // type of this address
  42. # if defined(MIDL_PASS)
  43. [size_is(AddressLength)] UCHAR Address[];
  44. # else
  45. UCHAR Address[1]; // actually AddressLength bytes long
  46. # endif
  47. } TA_ADDRESS;
  48. #endif
  49. MIDL_QUOTE("#endif")
  50. // Note that you must include tdi.h (first) if you need the AddressType
  51. // constant definitions.
  52. // DS_TRANSPORT, with RPC and File protocol modifiers
  53. typedef struct _DS_TRANSPORT
  54. {
  55. USHORT usFileProtocol;
  56. USHORT iPrincipal;
  57. USHORT grfModifiers;
  58. TA_ADDRESS taddr;
  59. } DS_TRANSPORT, *PDS_TRANSPORT;
  60. // The real size of a DS_TRANSPORT where AddressLength == 0. Need to
  61. // subtract off 2 UCHARs to take into account padding.
  62. #define DS_TRANSPORT_SIZE (sizeof(DS_TRANSPORT) - 2*sizeof(UCHAR))
  63. MIDL_QUOTE("#define DS_TRANSPORT_SIZE (sizeof(DS_TRANSPORT) - 2*sizeof(UCHAR))")
  64. // File protocol identifiers
  65. #if defined(MIDL_PASS)
  66. const USHORT FSP_NONE = 0; // file access not supported
  67. const USHORT FSP_SMB = 1; // SMB (ie: LanMan redirector)
  68. const USHORT FSP_NCP = 2; // Netware Core Protocol (Netware requestor)
  69. const USHORT FSP_NFS = 3; // Sun NFS protocol
  70. const USHORT FSP_VINES = 4; // Banyan Vines
  71. const USHORT FSP_AFS = 5; // Andrews File System
  72. const USHORT FSP_DCE = 6; // DCE Andrews File System
  73. #else
  74. #define FSP_NONE 0
  75. #define FSP_SMB 1
  76. #define FSP_NCP 2
  77. #define FSP_NFS 3
  78. #define FSP_VINES 4
  79. #define FSP_AFS 5
  80. #define FSP_DCE 6
  81. #endif
  82. // RPC modifiers
  83. #if defined(MIDL_PASS)
  84. const USHORT DST_RPC_CN = 0x0001; // supports a connection-oriented (ncacn_...)
  85. // RPC protocol for this transport.
  86. const USHORT DST_RPC_DG = 0x0002; // supports a connectionless (ncadg_...)
  87. // RPC protocol for this transport.
  88. const USHORT DST_RPC_NB_XNS = 0x0004; // ncacn_nb_xns protocol is supported
  89. const USHORT DST_RPC_NB_NB = 0x0008; // ncacn_nb_nb protocol is supported
  90. const USHORT DST_RPC_NB_IPX = 0x0010; // ncacn_nb_ipx protocol is supported
  91. const USHORT DST_RPC_NB_TCP = 0x0020; // ncacn_nb_tcp protocol is supported
  92. #else
  93. #define DST_RPC_CN 0x0001
  94. #define DST_RPC_DG 0x0002
  95. #define DST_RPC_NB_XNS 0x0004
  96. #define DST_RPC_NB_NB 0x0008
  97. #define DST_RPC_NB_IPX 0x0010
  98. #define DST_RPC_NB_TCP 0x0020
  99. #endif
  100. // DS_MACHINE
  101. typedef MIDL_DECL([string]) WCHAR * PNAME;
  102. typedef struct _DS_MACHINE
  103. {
  104. GUID guidSite;
  105. GUID guidMachine;
  106. ULONG grfFlags;
  107. MIDL_DECL([string]) LPWSTR pwszShareName;
  108. ULONG cPrincipals;
  109. MIDL_DECL([size_is(cPrincipals)]) PNAME *prgpwszPrincipals;
  110. ULONG cTransports;
  111. # if defined(MIDL_PASS)
  112. [size_is(cTransports)] PDS_TRANSPORT rpTrans[];
  113. # else
  114. PDS_TRANSPORT rpTrans[1];
  115. # endif
  116. } DS_MACHINE, *PDS_MACHINE;
  117. // The real size of a DS_MACHINE in which cTransports == 0
  118. #define DS_MACHINE_SIZE (sizeof(DS_MACHINE) - sizeof(PDS_TRANSPORT))
  119. MIDL_QUOTE("#define DS_MACHINE_SIZE (sizeof(DS_MACHINE) - sizeof(PDS_TRANSPORT))")
  120. // DS_GLUON
  121. typedef struct _DS_GLUON
  122. {
  123. GUID guidThis;
  124. MIDL_DECL([string]) LPWSTR pwszName;
  125. ULONG grfFlags;
  126. ULONG cMachines;
  127. # if defined(MIDL_PASS)
  128. [size_is(cMachines)] PDS_MACHINE rpMachines[];
  129. # else
  130. PDS_MACHINE rpMachines[1];
  131. # endif
  132. } DS_GLUON, *PDS_GLUON;
  133. // The real size of a DS_GLUON in which cMachines == 0
  134. #define DS_GLUON_SIZE (sizeof(DS_GLUON) - sizeof(PDS_MACHINE))
  135. MIDL_QUOTE("#define DS_GLUON_SIZE (sizeof(DS_GLUON) - sizeof(PDS_MACHINE))")
  136. MIDL_QUOTE("#endif")
  137. #endif // of ifndef __GLUON_H__