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.

333 lines
6.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. DWORD * pcchDirRoot,
  80. DWORD * pcchVRoot,
  81. DWORD * pdwMask
  82. );
  83. };
  84. #define AUTH_PROVIDER_COUNT 10
  85. class W3_STATE_AUTHENTICATION : public W3_STATE
  86. {
  87. public:
  88. W3_STATE_AUTHENTICATION();
  89. virtual ~W3_STATE_AUTHENTICATION();
  90. WCHAR *
  91. QueryName(
  92. VOID
  93. )
  94. {
  95. return L"StateAuthentication";
  96. }
  97. CONTEXT_STATUS
  98. DoWork(
  99. W3_MAIN_CONTEXT * pW3Context,
  100. DWORD cbCompletion,
  101. DWORD dwCompletionStatus
  102. );
  103. HRESULT
  104. OnAccessDenied(
  105. W3_MAIN_CONTEXT * pMainContext
  106. );
  107. static
  108. HRESULT
  109. CallAllAccessDenied(
  110. W3_MAIN_CONTEXT * pMainContext
  111. )
  112. {
  113. DBG_ASSERT( sm_pAuthState != NULL );
  114. return sm_pAuthState->OnAccessDenied( pMainContext );
  115. }
  116. HRESULT
  117. GetDefaultDomainName(
  118. VOID
  119. );
  120. static
  121. WCHAR *
  122. QueryDefaultDomainName(
  123. VOID
  124. )
  125. {
  126. DBG_ASSERT( sm_pAuthState != NULL );
  127. return sm_pAuthState->_achDefaultDomainName;
  128. }
  129. static
  130. HRESULT
  131. SplitUserDomain(
  132. STRU & strUserDomain,
  133. STRU * pstrUserName,
  134. STRU * pstrDomainName,
  135. WCHAR * pszDefaultDomain,
  136. BOOL * pfPossibleUPNLogon
  137. );
  138. VOID
  139. GetSSPTokenPrivilege(
  140. VOID
  141. );
  142. HRESULT
  143. InitializeAuthenticationProviders(
  144. VOID
  145. );
  146. VOID
  147. TerminateAuthenticationProviders(
  148. VOID
  149. );
  150. static
  151. AUTH_PROVIDER *
  152. QueryAnonymousProvider(
  153. VOID
  154. )
  155. {
  156. DBG_ASSERT( sm_pAuthState != NULL );
  157. DBG_ASSERT( sm_pAuthState->_pAnonymousProvider != NULL );
  158. return sm_pAuthState->_pAnonymousProvider;
  159. }
  160. static
  161. AUTH_PROVIDER *
  162. QueryCustomProvider(
  163. VOID
  164. )
  165. {
  166. DBG_ASSERT( sm_pAuthState != NULL );
  167. DBG_ASSERT( sm_pAuthState->_pCustomProvider != NULL );
  168. return sm_pAuthState->_pCustomProvider;
  169. }
  170. static
  171. BOOL
  172. QueryIsDomainMember(
  173. VOID
  174. )
  175. {
  176. DBG_ASSERT( sm_pAuthState != NULL );
  177. return sm_pAuthState->_fIsDomainMember;
  178. }
  179. static PTOKEN_PRIVILEGES sm_pTokenPrivilege;
  180. private:
  181. static W3_STATE_AUTHENTICATION * sm_pAuthState;
  182. static LUID sm_BackupPrivilegeTcbValue;
  183. WCHAR _achDefaultDomainName[ 256 ];
  184. AUTH_PROVIDER * _rgAuthProviders[ AUTH_PROVIDER_COUNT ];
  185. AUTH_PROVIDER * _pAnonymousProvider;
  186. AUTH_PROVIDER * _pCustomProvider;
  187. BOOL _fHasAssociatedUserBefore;
  188. BOOL _fIsDomainMember;
  189. };
  190. class W3_STATE_AUTHORIZATION : public W3_STATE
  191. {
  192. public:
  193. WCHAR *
  194. QueryName(
  195. VOID
  196. )
  197. {
  198. return L"StateAuthorization";
  199. }
  200. CONTEXT_STATUS
  201. DoWork(
  202. W3_MAIN_CONTEXT * pW3Context,
  203. DWORD cbCompletion,
  204. DWORD dwCompletionStatus
  205. )
  206. {
  207. return CONTEXT_STATUS_CONTINUE;
  208. }
  209. };
  210. class W3_STATE_LOG : public W3_STATE
  211. {
  212. public:
  213. WCHAR *
  214. QueryName(
  215. VOID
  216. )
  217. {
  218. return L"StateLog";
  219. }
  220. CONTEXT_STATUS
  221. DoWork(
  222. W3_MAIN_CONTEXT * pW3Context,
  223. DWORD,
  224. DWORD
  225. );
  226. CONTEXT_STATUS
  227. OnCompletion(
  228. W3_MAIN_CONTEXT * pW3Context,
  229. DWORD,
  230. DWORD
  231. );
  232. };
  233. class W3_STATE_RESPONSE : public W3_STATE
  234. {
  235. public:
  236. WCHAR *
  237. QueryName(
  238. VOID
  239. )
  240. {
  241. return L"StateResponse";
  242. }
  243. CONTEXT_STATUS
  244. DoWork(
  245. W3_MAIN_CONTEXT * pW3Context,
  246. DWORD cbCompletion,
  247. DWORD dwCompletionStatus
  248. );
  249. CONTEXT_STATUS
  250. OnCompletion(
  251. W3_MAIN_CONTEXT * pW3Context,
  252. DWORD cbCompletion,
  253. DWORD dwCompletionStatus
  254. );
  255. };
  256. class W3_STATE_DONE : public W3_STATE
  257. {
  258. public:
  259. WCHAR *
  260. QueryName(
  261. VOID
  262. )
  263. {
  264. return L"StateDone";
  265. }
  266. CONTEXT_STATUS
  267. DoWork(
  268. W3_MAIN_CONTEXT * pW3Context,
  269. DWORD cbCompletion,
  270. DWORD dwCompletionStatus
  271. );
  272. CONTEXT_STATUS
  273. OnCompletion(
  274. W3_MAIN_CONTEXT * pW3Context,
  275. DWORD cbCompletion,
  276. DWORD dwCompletionStatus
  277. );
  278. };
  279. #endif