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.

110 lines
1.8 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 * pW3Context
  41. )
  42. {
  43. return NO_ERROR;
  44. }
  45. virtual
  46. CONTEXT_STATUS
  47. DoWork(
  48. VOID
  49. ) = 0;
  50. virtual
  51. CONTEXT_STATUS
  52. OnCompletion(
  53. DWORD cbCompletion,
  54. DWORD dwCompletionStatus
  55. )
  56. {
  57. return CONTEXT_STATUS_CONTINUE;
  58. }
  59. //
  60. // Non-virtual member functions
  61. //
  62. CONTEXT_STATUS
  63. MainDoWork(
  64. VOID
  65. );
  66. CONTEXT_STATUS
  67. MainOnCompletion(
  68. DWORD cbCompletion,
  69. DWORD dwCompletionStatus
  70. );
  71. W3_CONTEXT *
  72. QueryW3Context(
  73. VOID
  74. ) const
  75. {
  76. return _pW3Context;
  77. }
  78. META_SCRIPT_MAP_ENTRY *
  79. QueryScriptMapEntry(
  80. VOID
  81. ) const
  82. {
  83. return _pScriptMapEntry;
  84. }
  85. private:
  86. W3_CONTEXT * _pW3Context;
  87. META_SCRIPT_MAP_ENTRY * _pScriptMapEntry;
  88. };
  89. #define IS_ACCESS_ALLOWED(pRequest, dwFilePerms, op) \
  90. ((dwFilePerms & VROOT_MASK_## op) && \
  91. ((!(dwFilePerms & VROOT_MASK_NO_REMOTE_## op)) || \
  92. pRequest->IsLocalRequest()))
  93. #endif