Source code of Windows XP (NT5)
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.

257 lines
5.7 KiB

  1. //---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1995
  5. //
  6. // File: globals.hxx
  7. //
  8. // Contents:
  9. //
  10. // History:
  11. //----------------------------------------------------------------------------
  12. extern TCHAR *szProviderName;
  13. extern TCHAR *szLDAPNamespaceName;
  14. extern TCHAR *szGCNamespaceName;
  15. //
  16. // List of interface properties for Generic Objects
  17. //
  18. extern INTF_PROP_DATA IntfPropsGeneric[];
  19. extern INTF_PROP_DATA IntfPropsSchema[];
  20. extern INTF_PROP_DATA IntfPropsConnection[];
  21. extern INTF_PROP_DATA IntfPropsCursor[];
  22. extern INTF_PROP_DATA IntfPropsQuery[];
  23. //
  24. // Helper routine to split relative url to class and RDN.
  25. //
  26. HRESULT
  27. UrlToClassAndDn(
  28. IN IUmiURL *pUrl,
  29. OUT LPWSTR *ppszDN,
  30. OUT LPWSTR *ppszClass
  31. );
  32. //
  33. // Helper routine to conver the url to the ldap path.
  34. //
  35. HRESULT
  36. UrlToLDAPPath(
  37. IN IUmiURL *pURL,
  38. OUT LPWSTR *ppszLDAPPath,
  39. OPTIONAL OUT LPWSTR *ppszDn = NULL,
  40. OPTIONAL OUT LPWSTR *ppszServer = NULL
  41. );
  42. //
  43. // Helper routine to convert ADsPath to url text in umi format.
  44. //
  45. HRESULT
  46. ADsPathToUmiURL(
  47. IN LPWSTR ADsPath,
  48. OUT LPWSTR *ppszUrlTxt
  49. );
  50. //
  51. // Converts the given hr to the umi hr.
  52. //
  53. HRESULT
  54. MapHrToUmiError(
  55. IN HRESULT hr
  56. );
  57. //
  58. // These routine are exported by the router (activeds.dll) and convert
  59. // binary format security descriptors to IADsSecurityDescriptor and
  60. // IADsSecurityDescriptor to binary format.
  61. //
  62. #ifdef __cplusplus
  63. extern "C"
  64. #else
  65. extern
  66. #endif
  67. HRESULT
  68. ConvertSecDescriptorToVariant(
  69. LPWSTR pszServerName,
  70. CCredentials& Credentials,
  71. PSECURITY_DESCRIPTOR pSecurityDescriptor,
  72. VARIANT * pVarSec,
  73. BOOL fNTDS
  74. );
  75. #ifdef __cplusplus
  76. extern "C"
  77. #else
  78. extern
  79. #endif
  80. HRESULT
  81. ConvertSecurityDescriptorToSecDes(
  82. LPWSTR pszServerName,
  83. CCredentials& Credentials,
  84. IADsSecurityDescriptor FAR * pSecDes,
  85. PSECURITY_DESCRIPTOR * ppSecurityDescriptor,
  86. PDWORD pdwSDLength,
  87. BOOL fNTDSType
  88. );
  89. //
  90. // The remaining definitions are support routines to enable
  91. // dynamic loading of libraries.
  92. //
  93. extern CRITICAL_SECTION g_csLoadLibsCritSect;
  94. #define ENTER_LOADLIBS_CRITSECT() EnterCriticalSection(&g_csLoadLibsCritSect)
  95. #define LEAVE_LOADLIBS_CRITSECT() LeaveCriticalSection(&g_csLoadLibsCritSect)
  96. extern HANDLE g_hDllSecur32;
  97. extern HANDLE g_hDllNtdsapi;
  98. #define DSUNQUOTERDN_API "DsUnquoteRdnValueW"
  99. #define DSCRACK_NAMES_API "DsCrackNamesW"
  100. #define DSBIND_API "DsBindW"
  101. #define DSUNBIND_API "DsUnBindW"
  102. #define DSMAKEPASSWD_CRED_API "DsMakePasswordCredentialsW"
  103. #define DSFREEPASSWD_CRED_API "DsFreePasswordCredentials"
  104. #define DSBINDWITHCRED_API "DsBindWithCredW"
  105. #define DSFREENAME_RESULT_API "DsFreeNameResultW"
  106. #define QUERYCONTEXT_ATTR_API "QueryContextAttributesW"
  107. //
  108. // DsUnquoteRdnValue definition
  109. //
  110. typedef DWORD (*PF_DsUnquoteRdnValueW) (
  111. IN DWORD cQuotedRdnValueLength,
  112. IN LPCWSTR psQuotedRdnValue,
  113. IN OUT DWORD *pcUnquotedRdnValueLength,
  114. OUT LPWSTR psUnquotedRdnValue
  115. );
  116. DWORD DsUnquoteRdnValueWrapper(
  117. IN DWORD cQuotedRdnValueLength,
  118. IN LPCWSTR psQuotedRdnValue,
  119. IN OUT DWORD *pcUnquotedRdnValueLength,
  120. OUT LPTCH psUnquotedRdnValue
  121. );
  122. //
  123. // DsMakePasswordCredentialsW
  124. //
  125. typedef DWORD (*PF_DsMakePasswordCredentialsW) (
  126. LPCWSTR User,
  127. LPCWSTR Domain,
  128. LPCWSTR Password,
  129. RPC_AUTH_IDENTITY_HANDLE *pAuthIdentity
  130. );
  131. DWORD DsMakePasswordCredentialsWrapper(
  132. LPCWSTR User,
  133. LPCWSTR Domain,
  134. LPCWSTR Password,
  135. RPC_AUTH_IDENTITY_HANDLE *pAuthIdentity
  136. );
  137. //
  138. // DsFreePasswordCredentials definition
  139. //
  140. typedef DWORD (*PF_DsFreePasswordCredentials) (
  141. RPC_AUTH_IDENTITY_HANDLE AuthIdentity
  142. );
  143. DWORD DsFreePasswordCredentialsWrapper(
  144. RPC_AUTH_IDENTITY_HANDLE AuthIdentity
  145. );
  146. //
  147. // DsBindW
  148. //
  149. typedef DWORD (*PF_DsBindW) (
  150. LPCWSTR DomainControllerName,
  151. LPCWSTR DnsDomainName,
  152. HANDLE *phDS
  153. );
  154. DWORD DsBindWrapper(
  155. LPCWSTR DomainControllerName,
  156. LPCWSTR DnsDomainName,
  157. HANDLE *phDS
  158. );
  159. //
  160. // DsUnbindW
  161. //
  162. typedef DWORD (*PF_DsUnbindW) (
  163. HANDLE *phDS
  164. );
  165. DWORD DsUnBindWrapper(
  166. HANDLE *phDS
  167. );
  168. //
  169. // DsCrackNamesW
  170. //
  171. typedef DWORD(*PF_DsCrackNamesW) (
  172. HANDLE hDS,
  173. DS_NAME_FLAGS flags,
  174. DS_NAME_FORMAT formatOffered,
  175. DS_NAME_FORMAT formatDesired,
  176. DWORD cNames,
  177. const LPCWSTR *rpNames,
  178. PDS_NAME_RESULTW *ppResult
  179. );
  180. DWORD DsCrackNamesWrapper(
  181. HANDLE hDS,
  182. DS_NAME_FLAGS flags,
  183. DS_NAME_FORMAT formatOffered,
  184. DS_NAME_FORMAT formatDesired,
  185. DWORD cNames,
  186. const LPCWSTR *rpNames,
  187. PDS_NAME_RESULTW *ppResult
  188. );
  189. //
  190. // DsBindWithCredW.
  191. //
  192. typedef DWORD (*PF_DsBindWithCredW) (
  193. LPCWSTR DomainControllerName,
  194. LPCWSTR DnsDomainName,
  195. RPC_AUTH_IDENTITY_HANDLE AuthIdentity,
  196. HANDLE *phDS
  197. );
  198. DWORD DsBindWithCredWrapper(
  199. LPCWSTR DomainControllerName,
  200. LPCWSTR DnsDomainName,
  201. RPC_AUTH_IDENTITY_HANDLE AuthIdentity,
  202. HANDLE *phDS
  203. );
  204. //
  205. // DsFreeNameResultW
  206. //
  207. typedef DWORD (*PF_DsFreeNameResultW) (
  208. DS_NAME_RESULTW *pResult
  209. );
  210. DWORD DsFreeNameResultWrapper(
  211. DS_NAME_RESULTW *pResult
  212. );
  213. //
  214. // QueryContextAttributes
  215. //
  216. typedef DWORD (*PF_QueryContextAttributes) (
  217. PCtxtHandle phContext,
  218. unsigned long ulAttribute,
  219. void SEC_FAR * pBuffer
  220. );
  221. DWORD QueryContextAttributesWrapper(
  222. PCtxtHandle phContext,
  223. unsigned long ulAttribute,
  224. void SEC_FAR * pBuffer
  225. );