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.

130 lines
2.7 KiB

  1. #ifndef _URLCONTEXT_HXX_
  2. #define _URLCONTEXT_HXX_
  3. class URL_CONTEXT
  4. {
  5. private:
  6. W3_METADATA * _pMetaData;
  7. W3_URL_INFO * _pUrlInfo;
  8. //
  9. // Physical path stored here in case of a SF_NOTIFY_URL_MAP filter
  10. //
  11. STRU _strPhysicalPath;
  12. public:
  13. URL_CONTEXT(
  14. W3_METADATA * pMetaData,
  15. W3_URL_INFO * pUrlInfo
  16. )
  17. {
  18. _pMetaData = pMetaData;
  19. _pUrlInfo = pUrlInfo;
  20. }
  21. ~URL_CONTEXT()
  22. {
  23. if( _pUrlInfo )
  24. {
  25. _pUrlInfo->DereferenceCacheEntry();
  26. _pUrlInfo = NULL;
  27. }
  28. }
  29. VOID *
  30. operator new(
  31. size_t uiSize,
  32. VOID * pPlacement
  33. )
  34. {
  35. W3_CONTEXT * pContext;
  36. pContext = (W3_CONTEXT*) pPlacement;
  37. DBG_ASSERT( pContext != NULL );
  38. DBG_ASSERT( pContext->CheckSignature() );
  39. return pContext->ContextAlloc( (UINT)uiSize );
  40. }
  41. VOID
  42. operator delete(
  43. VOID *
  44. )
  45. {
  46. }
  47. W3_METADATA *
  48. QueryMetaData(
  49. VOID
  50. ) const
  51. {
  52. return _pMetaData;
  53. }
  54. W3_URL_INFO *
  55. QueryUrlInfo(
  56. VOID
  57. ) const
  58. {
  59. return _pUrlInfo;
  60. }
  61. STRU*
  62. QueryPhysicalPath(
  63. VOID
  64. )
  65. {
  66. if ( _strPhysicalPath.QueryCCH() )
  67. {
  68. // From SF_NOTIFY_URL_MAP filter
  69. return &_strPhysicalPath;
  70. }
  71. else
  72. {
  73. // If no filter
  74. DBG_ASSERT( _pUrlInfo != NULL );
  75. return _pUrlInfo->QueryPhysicalPath();
  76. }
  77. }
  78. HRESULT
  79. OpenFile(
  80. CACHE_USER * pOpeningUser,
  81. W3_FILE_INFO ** ppOpenFile,
  82. FILE_CACHE_ASYNC_CONTEXT * pAsyncContext = NULL,
  83. BOOL * pfHandledSync = NULL,
  84. BOOL fAllowNoBuffering = FALSE,
  85. BOOL fCheckForExistenceOnly = FALSE
  86. );
  87. HRESULT
  88. SetPhysicalPath(
  89. STRU &strPath
  90. )
  91. {
  92. return _strPhysicalPath.Copy( strPath );
  93. }
  94. static
  95. HRESULT
  96. RetrieveUrlContext(
  97. W3_CONTEXT * pContext,
  98. W3_REQUEST * pRequest,
  99. OUT URL_CONTEXT ** ppUrlContext,
  100. BOOL * pfFinished,
  101. BOOL fSetInW3Context = FALSE
  102. );
  103. static
  104. HRESULT
  105. Initialize(
  106. VOID
  107. );
  108. static
  109. VOID
  110. Terminate(
  111. VOID
  112. );
  113. };
  114. #endif