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.

111 lines
1.9 KiB

  1. #ifndef _W3HANDLER_HXX_
  2. #define _W3HANDLER_HXX_
  3. class W3_HANDLER
  4. {
  5. public:
  6. W3_HANDLER( W3_CONTEXT * pW3Context,
  7. META_SCRIPT_MAP_ENTRY * pScriptMapEntry = NULL )
  8. {
  9. DBG_ASSERT( pW3Context != NULL );
  10. _pW3Context = pW3Context;
  11. _pScriptMapEntry = pScriptMapEntry;
  12. }
  13. virtual ~W3_HANDLER()
  14. {
  15. }
  16. virtual
  17. WCHAR *
  18. QueryName(
  19. VOID
  20. ) = 0;
  21. virtual
  22. BOOL
  23. QueryIsUlCacheable(
  24. VOID
  25. )
  26. {
  27. return FALSE;
  28. }
  29. virtual
  30. BOOL
  31. QueryManagesOwnHead(
  32. VOID
  33. )
  34. {
  35. return FALSE;
  36. }
  37. virtual
  38. HRESULT
  39. SetupUlCachedResponse(
  40. W3_CONTEXT *,
  41. HTTP_CACHE_POLICY *
  42. )
  43. {
  44. return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
  45. }
  46. virtual
  47. CONTEXT_STATUS
  48. DoWork(
  49. VOID
  50. ) = 0;
  51. virtual
  52. CONTEXT_STATUS
  53. OnCompletion(
  54. DWORD,
  55. DWORD
  56. )
  57. {
  58. return CONTEXT_STATUS_CONTINUE;
  59. }
  60. //
  61. // Non-virtual member functions
  62. //
  63. CONTEXT_STATUS
  64. MainDoWork(
  65. VOID
  66. );
  67. CONTEXT_STATUS
  68. MainOnCompletion(
  69. DWORD cbCompletion,
  70. DWORD dwCompletionStatus
  71. );
  72. W3_CONTEXT *
  73. QueryW3Context(
  74. VOID
  75. ) const
  76. {
  77. return _pW3Context;
  78. }
  79. META_SCRIPT_MAP_ENTRY *
  80. QueryScriptMapEntry(
  81. VOID
  82. ) const
  83. {
  84. return _pScriptMapEntry;
  85. }
  86. private:
  87. W3_CONTEXT * _pW3Context;
  88. META_SCRIPT_MAP_ENTRY * _pScriptMapEntry;
  89. };
  90. #define IS_ACCESS_ALLOWED(pRequest, dwFilePerms, op) \
  91. ((dwFilePerms & VROOT_MASK_## op) && \
  92. ((!(dwFilePerms & VROOT_MASK_NO_REMOTE_## op)) || \
  93. pRequest->IsLocalRequest()))
  94. #endif