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.

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