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.

84 lines
1.6 KiB

  1. #ifndef _GENERALHANDLER_HXX_
  2. #define _GENERALHANDLER_HXX_
  3. class W3_GENERAL_HANDLER : public W3_HANDLER
  4. {
  5. public:
  6. W3_GENERAL_HANDLER( W3_CONTEXT * pW3Context,
  7. HTTP_STATUS httpStatus,
  8. HTTP_SUB_ERROR httpSubError = HttpNoSubError )
  9. : W3_HANDLER( pW3Context )
  10. {
  11. _httpStatus = httpStatus;
  12. _httpSubError = httpSubError;
  13. }
  14. ~W3_GENERAL_HANDLER()
  15. {
  16. }
  17. WCHAR *
  18. QueryName(
  19. VOID
  20. )
  21. {
  22. return L"GeneralHandler";
  23. }
  24. CONTEXT_STATUS
  25. DoWork(
  26. VOID
  27. );
  28. CONTEXT_STATUS
  29. OnCompletion(
  30. DWORD cbCompletion,
  31. DWORD dwCompletionStatus
  32. )
  33. {
  34. return CONTEXT_STATUS_CONTINUE;
  35. }
  36. static
  37. HRESULT
  38. Initialize(
  39. VOID
  40. );
  41. static
  42. VOID
  43. Terminate(
  44. VOID
  45. );
  46. VOID *
  47. operator new(
  48. size_t size
  49. )
  50. {
  51. DBG_ASSERT( size == sizeof( W3_GENERAL_HANDLER ) );
  52. DBG_ASSERT( sm_pachGeneralHandlers != NULL );
  53. return sm_pachGeneralHandlers->Alloc();
  54. }
  55. VOID
  56. operator delete(
  57. VOID * pGeneralHandler
  58. )
  59. {
  60. DBG_ASSERT( pGeneralHandler != NULL );
  61. DBG_ASSERT( sm_pachGeneralHandlers != NULL );
  62. DBG_REQUIRE( sm_pachGeneralHandlers->Free( pGeneralHandler ) );
  63. }
  64. private:
  65. HTTP_STATUS _httpStatus;
  66. HTTP_SUB_ERROR _httpSubError;
  67. static ALLOC_CACHE_HANDLER* sm_pachGeneralHandlers;
  68. };
  69. #endif