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.

301 lines
6.2 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. lonsi.hxx
  5. Abstract:
  6. This file declares lonsi related stuff
  7. Author:
  8. Johnson Apacible (johnsona) 13-Nov-1996
  9. --*/
  10. #ifndef _LONSI_HXX_
  11. #define _LONSI_HXX_
  12. extern "C" {
  13. #include <ntlsa.h>
  14. }
  15. typedef
  16. BOOL
  17. (*LOGON32_INITIALIZE_FN)(
  18. IN PVOID hMod,
  19. IN ULONG Reason,
  20. IN PCONTEXT Context
  21. );
  22. typedef
  23. BOOL
  24. (WINAPI *LOGON_NET_USER_W_FN)(
  25. PWSTR lpszUsername,
  26. PWSTR lpszDomain,
  27. PSTR lpszPassword,
  28. PWSTR lpszWorkstation,
  29. DWORD dwSubAuth,
  30. DWORD dwLogonType,
  31. DWORD dwLogonProvider,
  32. HANDLE * phToken,
  33. LARGE_INTEGER * pExpiry
  34. );
  35. typedef
  36. BOOL
  37. (WINAPI *LOGON_NET_USER_A_FN)(
  38. PSTR lpszUsername,
  39. PSTR lpszDomain,
  40. PSTR lpszPassword,
  41. PSTR lpszWorkstation,
  42. DWORD dwSubAuth,
  43. DWORD dwLogonType,
  44. DWORD dwLogonProvider,
  45. HANDLE * phToken,
  46. LARGE_INTEGER * pExpiry
  47. );
  48. typedef
  49. BOOL
  50. (WINAPI *NET_USER_COOKIE_A_FN)(
  51. LPSTR lpszUsername,
  52. DWORD dwSeed,
  53. LPSTR lpszCookieBuff,
  54. DWORD dwBuffSize
  55. );
  56. typedef struct _DIGEST_LOGON_INFO
  57. {
  58. LPSTR pszNtUser;
  59. LPSTR pszDomain;
  60. LPSTR pszUser;
  61. LPSTR pszRealm;
  62. LPSTR pszURI;
  63. LPSTR pszMethod;
  64. LPSTR pszNonce;
  65. LPSTR pszCurrentNonce;
  66. LPSTR pszCNonce;
  67. LPSTR pszQOP;
  68. LPSTR pszNC;
  69. LPSTR pszResponse;
  70. }
  71. DIGEST_LOGON_INFO, *PDIGEST_LOGON_INFO;
  72. typedef
  73. BOOL
  74. (WINAPI *LOGON_DIGEST_USER_A_FN)(
  75. PDIGEST_LOGON_INFO pDigestLogonInfo,
  76. DWORD dwAlgo,
  77. HANDLE * phToken
  78. );
  79. typedef
  80. BOOL
  81. (*GET_DEFAULT_DOMAIN_NAME_FN)(PCHAR,DWORD);
  82. typedef
  83. NTSTATUS
  84. (NTAPI *LSA_OPEN_POLICY_FN)(
  85. IN PLSA_UNICODE_STRING SystemName OPTIONAL,
  86. IN PLSA_OBJECT_ATTRIBUTES ObjectAttributes,
  87. IN ACCESS_MASK DesiredAccess,
  88. IN OUT PLSA_HANDLE PolicyHandle
  89. );
  90. typedef
  91. NTSTATUS
  92. (NTAPI *LSA_RETRIEVE_PRIVATE_DATA_FN)(
  93. IN LSA_HANDLE PolicyHandle,
  94. IN PLSA_UNICODE_STRING KeyName,
  95. OUT PLSA_UNICODE_STRING * PrivateData
  96. );
  97. typedef
  98. NTSTATUS
  99. (NTAPI *LSA_STORE_PRIVATE_DATA_FN)(
  100. IN LSA_HANDLE PolicyHandle,
  101. IN PLSA_UNICODE_STRING KeyName,
  102. IN PLSA_UNICODE_STRING PrivateData
  103. );
  104. typedef
  105. ULONG
  106. (NTAPI *LSA_NT_STATUS_TO_WIN_ERROR_FN)(
  107. NTSTATUS Status
  108. );
  109. typedef
  110. NTSTATUS
  111. (NTAPI *LSA_FREE_MEMORY_FN)(
  112. IN PVOID Buffer
  113. );
  114. typedef
  115. NTSTATUS
  116. (NTAPI *LSA_CLOSE_FN)(
  117. IN LSA_HANDLE ObjectHandle
  118. );
  119. //
  120. // advapi32.dll
  121. //
  122. typedef
  123. BOOL
  124. (WINAPI *DUPLICATE_TOKEN_EX_FN)(
  125. HANDLE hExistingToken,
  126. DWORD dwDesiredAccess,
  127. LPSECURITY_ATTRIBUTES lpTokenAttributes,
  128. SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
  129. TOKEN_TYPE TokenType,
  130. PHANDLE phNewToken
  131. );
  132. BOOL
  133. GetDynamicEntryPoints(
  134. VOID
  135. );
  136. VOID
  137. FreeDynamicLibraries(
  138. VOID
  139. );
  140. dllexp
  141. BOOL
  142. IISDuplicateTokenEx(
  143. IN HANDLE hExistingToken,
  144. IN DWORD dwDesiredAccess,
  145. IN LPSECURITY_ATTRIBUTES lpTokenAttributes,
  146. IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
  147. IN TOKEN_TYPE TokenType,
  148. OUT PHANDLE phNewToken
  149. );
  150. //
  151. // netapi32 entry points
  152. //
  153. typedef
  154. NET_API_STATUS
  155. (NET_API_FUNCTION *NET_USER_MODALS_GET_FN)(
  156. IN LPCWSTR servername OPTIONAL,
  157. IN DWORD level,
  158. OUT LPBYTE *bufptr
  159. );
  160. typedef
  161. NET_API_STATUS
  162. (NET_API_FUNCTION *NET_API_BUFFER_FREE_FN)(
  163. IN LPVOID Buffer
  164. );
  165. //
  166. // kernel32
  167. //
  168. typedef
  169. LONG
  170. (WINAPI *INTERLOCKED_EXCHANGE_ADD_FN)(
  171. LPLONG Addend,
  172. LONG Value
  173. );
  174. typedef
  175. PVOID
  176. (WINAPI *INTERLOCKED_COMPARE_EXCHANGE_FN)(
  177. PVOID *Destination,
  178. PVOID Exchange,
  179. PVOID Comperand
  180. );
  181. typedef
  182. BOOL
  183. (WINAPI *READ_DIR_CHANGES_W_FN)(
  184. HANDLE hDirectory,
  185. LPVOID lpBuffer,
  186. DWORD nBufferLength,
  187. BOOL bWatchSubtree,
  188. DWORD dwNotifyFilter,
  189. LPDWORD lpBytesReturned,
  190. LPOVERLAPPED lpOverlapped,
  191. LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
  192. );
  193. typedef
  194. LONG
  195. (WINAPI *INTERLOCKED_INCREMENT_FN)(
  196. LPLONG Addend
  197. );
  198. typedef
  199. LONG
  200. (WINAPI *INTERLOCKED_DECREMENT_FN)(
  201. LPLONG Addend
  202. );
  203. extern READ_DIR_CHANGES_W_FN pfnReadDirChangesW;
  204. extern INTERLOCKED_COMPARE_EXCHANGE_FN pfnInterlockedCompareExchange;
  205. extern INTERLOCKED_EXCHANGE_ADD_FN pfnInterlockedExchangeAdd;
  206. extern INTERLOCKED_INCREMENT_FN pfnInterlockedIncrement;
  207. extern INTERLOCKED_DECREMENT_FN pfnInterlockedDecrement;
  208. BOOL
  209. IISGetDefaultDomainName(
  210. CHAR * pszDomainName,
  211. DWORD cchDomainName
  212. );
  213. BOOL
  214. WINAPI
  215. IISNetUserCookieA(
  216. LPSTR pszUsername,
  217. DWORD dwSeed,
  218. LPSTR pszCookieBuff,
  219. DWORD dwBuffSize
  220. );
  221. BOOL
  222. WINAPI
  223. IISLogonNetUserA(
  224. PSTR pszUsername,
  225. PSTR pszDomain,
  226. PSTR pszPassword,
  227. PSTR pszWorkstation,
  228. DWORD dwSubAuth,
  229. DWORD dwLogonType,
  230. DWORD dwLogonProvider,
  231. HANDLE * phToken,
  232. LARGE_INTEGER * pExpiry
  233. );
  234. BOOL
  235. WINAPI
  236. IISLogonDigestUserA(
  237. PDIGEST_LOGON_INFO pDigestLogonInfo,
  238. DWORD dwAlgo,
  239. HANDLE * phToken
  240. );
  241. BOOL
  242. WINAPI
  243. IISLogonDigestUser(
  244. WCHAR * pszUserName,
  245. WCHAR * pszDomainName,
  246. WCHAR * pszPassword,
  247. HANDLE * phToken
  248. );
  249. BOOL
  250. WINAPI
  251. IISLogonPassportUserW(
  252. WCHAR * pszUserName,
  253. WCHAR * pszDomainName,
  254. HANDLE * phToken
  255. );
  256. #endif // _LONSI_HXX_