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.

357 lines
7.3 KiB

  1. #ifndef _STATE_HXX_
  2. #define _STATE_HXX_
  3. //
  4. // This file contains the prototypes for all the states used in ULW3.DLL.
  5. //
  6. class W3_STATE_HANDLE_REQUEST : public W3_STATE
  7. {
  8. public:
  9. W3_STATE_HANDLE_REQUEST();
  10. virtual ~W3_STATE_HANDLE_REQUEST();
  11. WCHAR *
  12. QueryName(
  13. VOID
  14. )
  15. {
  16. return L"StateHandleRequest";
  17. }
  18. CONTEXT_STATUS
  19. DoWork(
  20. W3_MAIN_CONTEXT * pW3Context,
  21. DWORD cbCompletion,
  22. DWORD dwCompletionStatus
  23. );
  24. };
  25. class W3_STATE_START : public W3_STATE
  26. {
  27. public:
  28. WCHAR *
  29. QueryName(
  30. VOID
  31. )
  32. {
  33. return L"StateStart";
  34. }
  35. CONTEXT_STATUS
  36. DoWork(
  37. W3_MAIN_CONTEXT * pW3Context,
  38. DWORD cbCompletion,
  39. DWORD dwCompletionStatus
  40. );
  41. };
  42. class W3_STATE_URLINFO : public W3_STATE
  43. {
  44. public:
  45. W3_STATE_URLINFO();
  46. virtual ~W3_STATE_URLINFO();
  47. WCHAR *
  48. QueryName(
  49. VOID
  50. )
  51. {
  52. return L"StateUrlInfo";
  53. }
  54. CONTEXT_STATUS
  55. DoWork(
  56. W3_MAIN_CONTEXT * pW3Context,
  57. DWORD cbCompletion,
  58. DWORD dwCompletionStatus
  59. );
  60. CONTEXT_STATUS
  61. OnCompletion(
  62. W3_MAIN_CONTEXT * pW3Context,
  63. DWORD cbCompletion,
  64. DWORD dwCompletionStatus
  65. );
  66. static
  67. HRESULT
  68. FilterMapPath(
  69. W3_CONTEXT * pW3Context,
  70. W3_URL_INFO * pUrlInfo,
  71. STRU * pstrPhysicalPath
  72. );
  73. static
  74. HRESULT
  75. MapPath(
  76. W3_CONTEXT * pW3Context,
  77. STRU & strUrl,
  78. STRU * pstrPhysicalPath,
  79. BOOL fDoFiltering,
  80. DWORD * pcchDirRoot,
  81. DWORD * pcchVRoot,
  82. DWORD * pcbAnsiDirRoot,
  83. DWORD * pcbAnsiVRoot,
  84. DWORD * pdwMask
  85. );
  86. };
  87. #define AUTH_PROVIDER_COUNT 10
  88. class W3_STATE_AUTHENTICATION : public W3_STATE
  89. {
  90. public:
  91. W3_STATE_AUTHENTICATION();
  92. virtual ~W3_STATE_AUTHENTICATION();
  93. WCHAR *
  94. QueryName(
  95. VOID
  96. )
  97. {
  98. return L"StateAuthentication";
  99. }
  100. CONTEXT_STATUS
  101. DoWork(
  102. W3_MAIN_CONTEXT * pW3Context,
  103. DWORD cbCompletion,
  104. DWORD dwCompletionStatus
  105. );
  106. CONTEXT_STATUS
  107. OnCompletion(
  108. W3_MAIN_CONTEXT * pMainContext,
  109. DWORD cbCompletion,
  110. DWORD dwCompletionStatus
  111. );
  112. HRESULT
  113. OnAccessDenied(
  114. W3_MAIN_CONTEXT * pMainContext
  115. );
  116. static
  117. HRESULT
  118. CallAllAccessDenied(
  119. W3_MAIN_CONTEXT * pMainContext
  120. )
  121. {
  122. DBG_ASSERT( sm_pAuthState != NULL );
  123. return sm_pAuthState->OnAccessDenied( pMainContext );
  124. }
  125. HRESULT
  126. GetDefaultDomainName(
  127. VOID
  128. );
  129. static
  130. WCHAR *
  131. QueryDefaultDomainName(
  132. VOID
  133. )
  134. {
  135. DBG_ASSERT( sm_pAuthState != NULL );
  136. return sm_pAuthState->_achDefaultDomainName;
  137. }
  138. static
  139. WCHAR *
  140. QueryMemberDomainName(
  141. VOID
  142. )
  143. {
  144. DBG_ASSERT( sm_pAuthState != NULL );
  145. return sm_pAuthState->_achMemberDomainName;
  146. }
  147. static
  148. HRESULT
  149. SplitUserDomain(
  150. STRU & strUserDomain,
  151. STRU * pstrUserName,
  152. STRU * pstrDomainName,
  153. WCHAR * pszDefaultDomain,
  154. BOOL * pfPossibleUPNLogon
  155. );
  156. HRESULT
  157. GetSubAuthConfiguration(
  158. VOID
  159. );
  160. HRESULT
  161. InitializeAuthenticationProviders(
  162. VOID
  163. );
  164. VOID
  165. TerminateAuthenticationProviders(
  166. VOID
  167. );
  168. static
  169. AUTH_PROVIDER *
  170. QueryAnonymousProvider(
  171. VOID
  172. )
  173. {
  174. DBG_ASSERT( sm_pAuthState != NULL );
  175. DBG_ASSERT( sm_pAuthState->_pAnonymousProvider != NULL );
  176. return sm_pAuthState->_pAnonymousProvider;
  177. }
  178. static
  179. AUTH_PROVIDER *
  180. QueryCustomProvider(
  181. VOID
  182. )
  183. {
  184. DBG_ASSERT( sm_pAuthState != NULL );
  185. DBG_ASSERT( sm_pAuthState->_pCustomProvider != NULL );
  186. return sm_pAuthState->_pCustomProvider;
  187. }
  188. static
  189. BOOL
  190. QueryIsDomainMember(
  191. VOID
  192. )
  193. {
  194. DBG_ASSERT( sm_pAuthState != NULL );
  195. return sm_pAuthState->_fIsDomainMember;
  196. }
  197. static BOOL sm_fSubAuthConfigured;
  198. static BOOL sm_fLocalSystem;
  199. static LONG sm_lSubAuthAnonEvent;
  200. static LONG sm_lSubAuthDigestEvent;
  201. static LONG sm_lLocalSystemEvent;
  202. private:
  203. static W3_STATE_AUTHENTICATION * sm_pAuthState;
  204. WCHAR _achDefaultDomainName[ 256 ];
  205. WCHAR _achMemberDomainName[ 1024 ];
  206. AUTH_PROVIDER * _rgAuthProviders[ AUTH_PROVIDER_COUNT ];
  207. AUTH_PROVIDER * _pAnonymousProvider;
  208. AUTH_PROVIDER * _pCustomProvider;
  209. BOOL _fHasAssociatedUserBefore;
  210. BOOL _fIsDomainMember;
  211. };
  212. class W3_STATE_AUTHORIZATION : public W3_STATE
  213. {
  214. public:
  215. WCHAR *
  216. QueryName(
  217. VOID
  218. )
  219. {
  220. return L"StateAuthorization";
  221. }
  222. CONTEXT_STATUS
  223. DoWork(
  224. W3_MAIN_CONTEXT *,
  225. DWORD,
  226. DWORD
  227. )
  228. {
  229. return CONTEXT_STATUS_CONTINUE;
  230. }
  231. };
  232. class W3_STATE_LOG : public W3_STATE
  233. {
  234. public:
  235. WCHAR *
  236. QueryName(
  237. VOID
  238. )
  239. {
  240. return L"StateLog";
  241. }
  242. CONTEXT_STATUS
  243. DoWork(
  244. W3_MAIN_CONTEXT * pW3Context,
  245. DWORD,
  246. DWORD
  247. );
  248. CONTEXT_STATUS
  249. OnCompletion(
  250. W3_MAIN_CONTEXT * pW3Context,
  251. DWORD,
  252. DWORD
  253. );
  254. };
  255. class W3_STATE_RESPONSE : public W3_STATE
  256. {
  257. public:
  258. WCHAR *
  259. QueryName(
  260. VOID
  261. )
  262. {
  263. return L"StateResponse";
  264. }
  265. CONTEXT_STATUS
  266. DoWork(
  267. W3_MAIN_CONTEXT * pW3Context,
  268. DWORD cbCompletion,
  269. DWORD dwCompletionStatus
  270. );
  271. CONTEXT_STATUS
  272. OnCompletion(
  273. W3_MAIN_CONTEXT * pW3Context,
  274. DWORD cbCompletion,
  275. DWORD dwCompletionStatus
  276. );
  277. };
  278. class W3_STATE_DONE : public W3_STATE
  279. {
  280. public:
  281. WCHAR *
  282. QueryName(
  283. VOID
  284. )
  285. {
  286. return L"StateDone";
  287. }
  288. CONTEXT_STATUS
  289. DoWork(
  290. W3_MAIN_CONTEXT * pW3Context,
  291. DWORD cbCompletion,
  292. DWORD dwCompletionStatus
  293. );
  294. CONTEXT_STATUS
  295. OnCompletion(
  296. W3_MAIN_CONTEXT * pW3Context,
  297. DWORD cbCompletion,
  298. DWORD dwCompletionStatus
  299. );
  300. };
  301. #endif