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.

1115 lines
21 KiB

  1. #ifndef _W3METADATA_HXX_
  2. #define _W3METADATA_HXX_
  3. #include "customerror.hxx"
  4. #include "usercache.hxx"
  5. // forward declaration
  6. class W3_CONTEXT;
  7. enum GATEWAY_TYPE
  8. {
  9. GATEWAY_UNKNOWN,
  10. GATEWAY_STATIC_FILE,
  11. GATEWAY_CGI,
  12. GATEWAY_ISAPI,
  13. GATEWAY_MAP
  14. };
  15. class META_SCRIPT_MAP_ENTRY
  16. {
  17. //
  18. // CODEWORK
  19. // 1. Add missing members and accsessors
  20. // 2. Handle initialization errors
  21. //
  22. friend class META_SCRIPT_MAP;
  23. public:
  24. META_SCRIPT_MAP_ENTRY()
  25. : m_fIsStarScriptMapEntry (FALSE)
  26. {
  27. InitializeListHead( &m_ListEntry );
  28. }
  29. ~META_SCRIPT_MAP_ENTRY()
  30. {
  31. }
  32. // actual ctor
  33. HRESULT
  34. Create(
  35. IN const WCHAR * szExtension,
  36. IN const WCHAR * szExecutable,
  37. IN DWORD Flags,
  38. IN const WCHAR * szVerbs,
  39. IN DWORD cbVerbs
  40. );
  41. BOOL
  42. IsVerbAllowed(
  43. IN const STRA & strVerb
  44. )
  45. {
  46. return m_Verbs.IsEmpty() || m_Verbs.FindString( strVerb.QueryStr() );
  47. }
  48. STRU *
  49. QueryExecutable()
  50. {
  51. return &m_strExecutable;
  52. }
  53. GATEWAY_TYPE
  54. QueryGateway()
  55. {
  56. return m_Gateway;
  57. }
  58. BOOL
  59. QueryIsStarScriptMap()
  60. {
  61. return m_fIsStarScriptMapEntry;
  62. }
  63. MULTISZA *
  64. QueryAllowedVerbs()
  65. {
  66. return &m_Verbs;
  67. }
  68. BOOL
  69. QueryCheckPathInfoExists()
  70. {
  71. return !!( m_Flags & MD_SCRIPTMAPFLAG_CHECK_PATH_INFO );
  72. }
  73. BOOL
  74. QueryAllowScriptAccess()
  75. {
  76. return !!( m_Flags & MD_SCRIPTMAPFLAG_SCRIPT );
  77. }
  78. private:
  79. //
  80. // Avoid c++ errors
  81. //
  82. META_SCRIPT_MAP_ENTRY( const META_SCRIPT_MAP_ENTRY & )
  83. {}
  84. META_SCRIPT_MAP_ENTRY & operator = ( const META_SCRIPT_MAP_ENTRY & )
  85. { return *this; }
  86. //
  87. // Data Members
  88. //
  89. //
  90. // META_SCRIPT_MAP maintains a list of us
  91. //
  92. LIST_ENTRY m_ListEntry;
  93. //
  94. // Data from the script map stored in the metabase
  95. //
  96. STRU m_strExtension;
  97. STRU m_strExecutable;
  98. DWORD m_Flags;
  99. MULTISZA m_Verbs;
  100. GATEWAY_TYPE m_Gateway;
  101. BOOL m_fIsStarScriptMapEntry;
  102. };
  103. class META_SCRIPT_MAP
  104. {
  105. public:
  106. META_SCRIPT_MAP()
  107. {
  108. InitializeListHead( &m_ListHead );
  109. InitializeListHead( &m_StarScriptMapListHead );
  110. }
  111. ~META_SCRIPT_MAP()
  112. {
  113. Terminate();
  114. }
  115. HRESULT
  116. Initialize(
  117. IN WCHAR * szScriptMapData
  118. );
  119. VOID
  120. Terminate( VOID );
  121. BOOL
  122. FindEntry(
  123. IN const STRU & strExtension,
  124. OUT META_SCRIPT_MAP_ENTRY * * ppScriptMapEntry
  125. );
  126. META_SCRIPT_MAP_ENTRY *
  127. QueryStarScriptMap(DWORD index)
  128. {
  129. LIST_ENTRY *pEntry = m_StarScriptMapListHead.Flink;
  130. DWORD i = 0;
  131. while (pEntry != &m_StarScriptMapListHead)
  132. {
  133. if (i == index)
  134. {
  135. return CONTAINING_RECORD(pEntry,
  136. META_SCRIPT_MAP_ENTRY,
  137. m_ListEntry);
  138. }
  139. i++;
  140. pEntry = pEntry->Flink;
  141. }
  142. return NULL;
  143. }
  144. private:
  145. //
  146. // Avoid c++ errors
  147. //
  148. META_SCRIPT_MAP( const META_SCRIPT_MAP & )
  149. {}
  150. META_SCRIPT_MAP & operator = ( const META_SCRIPT_MAP & )
  151. { return *this; }
  152. private:
  153. //
  154. // List of META_SCRIPT_MAP_ENTRY
  155. //
  156. LIST_ENTRY m_ListHead;
  157. //
  158. // List of *-ScriptMap entries
  159. //
  160. LIST_ENTRY m_StarScriptMapListHead;
  161. };
  162. class REDIRECTION_BLOB;
  163. #define EXPIRE_MODE_NONE 0
  164. #define EXPIRE_MODE_STATIC 1
  165. #define EXPIRE_MODE_DYNAMIC 2
  166. #define EXPIRE_MODE_OFF 3
  167. //
  168. // This is the maximum we allow the global expires value to be set to.
  169. // This is 1 year in seconds
  170. //
  171. #define MAX_GLOBAL_EXPIRE 0x1e13380
  172. #define W3MD_CREATE_PROCESS_AS_USER 0x00000001
  173. #define W3MD_CREATE_PROCESS_NEW_CONSOLE 0x00000002
  174. #define DEFAULT_SCRIPT_TIMEOUT (15 * 60)
  175. #define DEFAULT_ENTITY_READ_AHEAD (48 * 1024)
  176. #define DEFAULT_MAX_REQUEST_ENTITY_ALLOWED 0xffffffff
  177. //
  178. // W3_METADATA elements are stored in the metadata cache
  179. //
  180. class W3_METADATA_KEY : public CACHE_KEY
  181. {
  182. public:
  183. W3_METADATA_KEY()
  184. {
  185. _dwDataSetNumber = 0;
  186. }
  187. VOID
  188. SetDataSetNumber(
  189. DWORD dwDataSet
  190. )
  191. {
  192. DBG_ASSERT( dwDataSet != 0 );
  193. _dwDataSetNumber = dwDataSet;
  194. }
  195. DWORD
  196. QueryKeyHash(
  197. VOID
  198. ) const
  199. {
  200. return _dwDataSetNumber;
  201. }
  202. BOOL
  203. QueryIsEqual(
  204. const CACHE_KEY * pCacheCompareKey
  205. ) const
  206. {
  207. W3_METADATA_KEY * pMetaKey = (W3_METADATA_KEY*) pCacheCompareKey;
  208. return pMetaKey->_dwDataSetNumber == _dwDataSetNumber;
  209. }
  210. private:
  211. DWORD _dwDataSetNumber;
  212. };
  213. class W3_METADATA : public CACHE_ENTRY
  214. {
  215. public:
  216. W3_METADATA( OBJECT_CACHE * pObjectCache );
  217. virtual
  218. ~W3_METADATA();
  219. CACHE_KEY *
  220. QueryCacheKey(
  221. VOID
  222. ) const
  223. {
  224. return (CACHE_KEY*) &_cacheKey;
  225. }
  226. STRU *
  227. QueryMetadataPath(
  228. VOID
  229. )
  230. {
  231. return &_strFullMetadataPath;
  232. }
  233. BOOL
  234. QueryIsOkToFlushDirmon(
  235. WCHAR *,
  236. DWORD
  237. )
  238. {
  239. DBG_ASSERT( FALSE );
  240. return FALSE;
  241. }
  242. VOID *
  243. operator new(
  244. #if DBG
  245. size_t size
  246. #else
  247. size_t
  248. #endif
  249. )
  250. {
  251. DBG_ASSERT( size == sizeof( W3_METADATA ) );
  252. DBG_ASSERT( sm_pachW3MetaData != NULL );
  253. return sm_pachW3MetaData->Alloc();
  254. }
  255. VOID
  256. operator delete(
  257. VOID * pW3MetaData
  258. )
  259. {
  260. DBG_ASSERT( pW3MetaData != NULL );
  261. DBG_ASSERT( sm_pachW3MetaData != NULL );
  262. DBG_REQUIRE( sm_pachW3MetaData->Free( pW3MetaData ) );
  263. }
  264. HRESULT
  265. ReadMetaData(
  266. const STRU & strMetabasePath,
  267. const STRU & strURL
  268. );
  269. HRESULT
  270. BuildPhysicalPath(
  271. STRU & strUrl,
  272. STRU * pstrPhysicalPath
  273. );
  274. HRESULT
  275. BuildProviderList(
  276. IN WCHAR * pszProviders
  277. );
  278. HRESULT
  279. BuildDefaultProviderList(
  280. VOID
  281. );
  282. BOOL
  283. CheckAuthProvider(
  284. IN const CHAR * pszPkgName
  285. );
  286. HRESULT
  287. CreateUNCVrToken(
  288. IN LPWSTR pszUserName,
  289. IN LPWSTR pszPasswd
  290. );
  291. HRESULT
  292. CreateAnonymousToken(
  293. IN LPWSTR pszUserName,
  294. IN LPWSTR pszPasswd
  295. );
  296. HRESULT
  297. ReadCustomFooter(
  298. WCHAR * pszFooter
  299. );
  300. HRESULT
  301. GetMetadataProperty(
  302. IN W3_CONTEXT * pW3Context,
  303. IN DWORD dwPropertyId,
  304. OUT BYTE * pbBuffer,
  305. IN DWORD cbBuffer,
  306. OUT DWORD * pcbBufferRequired
  307. );
  308. //
  309. // Query Methods
  310. //
  311. STRU *
  312. QueryWamClsId(
  313. VOID
  314. )
  315. {
  316. return &_strWamClsId;
  317. }
  318. DWORD
  319. QueryAppIsolated(
  320. VOID
  321. ) const
  322. {
  323. return _dwAppIsolated;
  324. }
  325. BOOL
  326. QueryNoCache(
  327. VOID
  328. ) const
  329. {
  330. return _fNoCache;
  331. }
  332. DWORD QueryVrLen(
  333. VOID
  334. ) const
  335. {
  336. return _dwVrLen;
  337. }
  338. HRESULT
  339. GetAndRefVrAccessToken(
  340. OUT TOKEN_CACHE_ENTRY ** ppCachedToken
  341. );
  342. HRESULT
  343. GetAndRefAnonymousToken(
  344. OUT TOKEN_CACHE_ENTRY ** ppCachedToken
  345. );
  346. DWORD
  347. QueryAccessPerms(
  348. VOID
  349. ) const
  350. {
  351. return _dwAccessPerm | _dwSslAccessPerm;
  352. }
  353. DWORD
  354. QueryRequireMapping(
  355. VOID
  356. ) const
  357. {
  358. return _dwRequireMapping;
  359. }
  360. DWORD
  361. QuerySslAccessPerms(
  362. VOID
  363. ) const
  364. {
  365. return _dwSslAccessPerm;
  366. }
  367. BOOL
  368. QueryAppPoolMatches(
  369. VOID
  370. ) const
  371. {
  372. return _fAppPoolMatches;
  373. }
  374. DWORD
  375. QueryDirBrowseFlags(
  376. VOID
  377. ) const
  378. {
  379. return _dwDirBrowseFlags;
  380. }
  381. WCHAR *
  382. QueryDomainName(
  383. VOID
  384. )
  385. {
  386. return _strDomainName.QueryStr();
  387. }
  388. STRA *
  389. QueryCustomHeaders(
  390. VOID
  391. )
  392. {
  393. return &_strCustomHeaders;
  394. }
  395. HRESULT
  396. GetTrueRedirectionSource(
  397. LPWSTR pszURL,
  398. LPCWSTR pszMetabasePath,
  399. OUT STRU * pstrTrueSource
  400. );
  401. STRU *
  402. QueryDefaultLoadFiles(
  403. VOID
  404. )
  405. {
  406. return &_strDefaultLoad;
  407. }
  408. STRU *
  409. QueryVrPath(
  410. VOID
  411. )
  412. {
  413. return &_strVrPath;
  414. }
  415. HRESULT
  416. FindCustomError(
  417. USHORT StatusCode,
  418. USHORT SubError,
  419. BOOL * pfIsFile,
  420. STRU * pstrFile
  421. )
  422. {
  423. return _customErrorTable.FindCustomError( StatusCode,
  424. SubError,
  425. pfIsFile,
  426. pstrFile );
  427. }
  428. DIRMON_CONFIG *
  429. QueryDirmonConfig(
  430. VOID
  431. )
  432. {
  433. return &_dirmonConfig;
  434. }
  435. STRA *
  436. QueryRedirectHeaders(
  437. VOID
  438. )
  439. {
  440. return &_strRedirectHeaders;
  441. }
  442. REDIRECTION_BLOB *
  443. QueryRedirectionBlob()
  444. {
  445. return _pRedirectBlob;
  446. }
  447. DWORD
  448. QueryAuthentication(
  449. VOID
  450. )
  451. {
  452. return _dwAuthentication;
  453. }
  454. BOOL
  455. QueryAuthTypeSupported(
  456. DWORD dwType
  457. )
  458. {
  459. if ( _dwAuthentication & dwType )
  460. {
  461. return TRUE;
  462. }
  463. else
  464. {
  465. if ( dwType == MD_ACCESS_MAP_CERT )
  466. {
  467. return !!( _dwSslAccessPerm & MD_ACCESS_MAP_CERT );
  468. }
  469. }
  470. return FALSE;
  471. }
  472. BOOL
  473. IsOnlyAnonymousAuthSupported(
  474. VOID
  475. )
  476. {
  477. return ( ( _dwAuthentication == MD_AUTH_ANONYMOUS ) &&
  478. ( ( _dwSslAccessPerm & MD_ACCESS_MAP_CERT ) == 0 ) );
  479. }
  480. META_SCRIPT_MAP *
  481. QueryScriptMap( VOID )
  482. {
  483. return &_ScriptMap;
  484. }
  485. DWORD
  486. QueryAuthPersistence(
  487. VOID
  488. )
  489. {
  490. return _dwAuthPersistence;
  491. }
  492. DWORD
  493. QueryLogonMethod(
  494. VOID
  495. )
  496. {
  497. return _dwLogonMethod;
  498. }
  499. BOOL
  500. QueryUNCUserInvalid(
  501. VOID
  502. ) const
  503. {
  504. return _fUNCUserInvalid;
  505. }
  506. WCHAR *
  507. QueryRealm(
  508. VOID
  509. )
  510. {
  511. return _strRealm.IsEmpty() ? NULL : _strRealm.QueryStr();
  512. }
  513. MULTISZA *
  514. QueryAuthProviders(
  515. VOID
  516. )
  517. {
  518. return &_mstrAuthProviders;
  519. }
  520. BYTE *
  521. QueryIpAccessCheckBuffer(
  522. VOID
  523. ) const
  524. {
  525. if ( _cbIpAccessCheck != 0 )
  526. {
  527. return (BYTE*) _buffIpAccessCheck.QueryPtr();
  528. }
  529. else
  530. {
  531. return NULL;
  532. }
  533. }
  534. DWORD
  535. QueryIpAccessCheckSize(
  536. VOID
  537. ) const
  538. {
  539. return _cbIpAccessCheck;
  540. }
  541. BOOL
  542. QueryCreateProcessAsUser(
  543. VOID
  544. ) const
  545. {
  546. return _fCreateProcessAsUser;
  547. }
  548. BOOL
  549. QueryCreateProcessNewConsole(
  550. VOID
  551. ) const
  552. {
  553. return _fCreateProcessNewConsole;
  554. }
  555. DWORD
  556. QueryScriptTimeout(
  557. VOID
  558. ) const
  559. {
  560. return _dwCGIScriptTimeout;
  561. }
  562. MIME_MAP *
  563. QueryMimeMap(
  564. VOID
  565. ) const
  566. {
  567. return _pMimeMap;
  568. }
  569. BOOL
  570. QueryDoStaticCompression(
  571. VOID
  572. ) const
  573. {
  574. return _fDoStaticCompression;
  575. }
  576. BOOL
  577. QueryDoDynamicCompression(
  578. VOID
  579. ) const
  580. {
  581. return _fDoDynamicCompression;
  582. }
  583. STRU *
  584. QueryAppMetaPath(
  585. VOID
  586. )
  587. {
  588. return &_strAppMetaPath;
  589. }
  590. BOOL
  591. QuerySSIExecDisabled(
  592. VOID
  593. ) const
  594. {
  595. return _fSSIExecDisabled;
  596. }
  597. BOOL
  598. QueryDoReverseDNS(
  599. VOID
  600. ) const
  601. {
  602. return _fDoReverseDNS;
  603. }
  604. BOOL
  605. QueryDontLog(
  606. VOID
  607. )
  608. {
  609. return _fDontLog;
  610. }
  611. BOOL
  612. QueryIsFooterEnabled(
  613. VOID
  614. )
  615. {
  616. return _fFooterEnabled;
  617. }
  618. STRA *
  619. QueryFooterString(
  620. VOID
  621. )
  622. {
  623. return &_strFooterString;
  624. }
  625. STRU *
  626. QueryFooterDocument(
  627. VOID
  628. )
  629. {
  630. return &_strFooterDocument;
  631. }
  632. DWORD
  633. QueryExpireMode(
  634. VOID
  635. ) const
  636. {
  637. return _dwExpireMode;
  638. }
  639. STRA *
  640. QueryCacheControlHeader(
  641. VOID
  642. )
  643. {
  644. return &_strCacheControlHeader;
  645. }
  646. STRA *
  647. QueryExpireHeader(
  648. VOID
  649. )
  650. {
  651. return &_strExpireHeader;
  652. }
  653. DWORD
  654. QueryEntityReadAhead(
  655. VOID
  656. ) const
  657. {
  658. return _cbEntityReadAhead;
  659. }
  660. BOOL
  661. QueryKeepAliveEnabled(
  662. VOID
  663. ) const
  664. {
  665. return _fKeepAliveEnabled;
  666. }
  667. DWORD
  668. QueryMaxRequestEntityAllowed(
  669. VOID
  670. ) const
  671. {
  672. return _dwMaxRequestEntityAllowed;
  673. }
  674. STRA *
  675. QueryMatchingUrlA(
  676. VOID
  677. )
  678. {
  679. return &_strMatchingUrlA;
  680. }
  681. STRA *
  682. QueryMatchingPathA(
  683. VOID
  684. )
  685. {
  686. return &_strMatchingPathA;
  687. }
  688. DWORD
  689. QueryCBMatchingUrlA(
  690. VOID
  691. )
  692. {
  693. return _cbMatchingUrlA;
  694. }
  695. DWORD
  696. QueryCBMatchingPathA(
  697. VOID
  698. )
  699. {
  700. return _cbMatchingPathA;
  701. }
  702. static
  703. HRESULT
  704. Initialize(
  705. VOID
  706. );
  707. static
  708. VOID
  709. Terminate(
  710. VOID
  711. );
  712. private:
  713. HRESULT
  714. EncryptMemoryPassword(
  715. IN OUT STRU * strPassword
  716. );
  717. HRESULT
  718. DecryptMemoryPassword(
  719. IN STRU * strProtectedPassword,
  720. OUT BUFFER * bufDecryptedPassword
  721. );
  722. //
  723. // Set methods
  724. //
  725. HRESULT
  726. SetRedirectionBlob(
  727. STRU & strSource,
  728. STRU & strDestination
  729. );
  730. HRESULT
  731. SetExpire(
  732. WCHAR * pszExpire
  733. );
  734. HRESULT
  735. SetCacheControlHeader(
  736. VOID
  737. );
  738. HRESULT
  739. SetIpAccessCheck(
  740. LPVOID pMDData,
  741. DWORD dwDataLen
  742. );
  743. W3_METADATA_KEY _cacheKey;
  744. STRU _strVrPath;
  745. WCHAR _rgVrUserName[ UNLEN + 1 ];
  746. STRU _strVrUserName;
  747. WCHAR _rgVrPasswd[ PWLEN ];
  748. STRU _strVrPasswd;
  749. DWORD _dwAccessPerm;
  750. DWORD _dwSslAccessPerm;
  751. DWORD _dwVrLevel;
  752. DWORD _dwVrLen;
  753. REDIRECTION_BLOB * _pRedirectBlob;
  754. DWORD _dwDirBrowseFlags;
  755. STRU _strDefaultLoad;
  756. DWORD _dwAuthentication;
  757. DWORD _dwAuthPersistence;
  758. WCHAR _rgUserName[ UNLEN + 1 ];
  759. STRU _strUserName;
  760. WCHAR _rgPasswd[ PWLEN ];
  761. STRU _strPasswd;
  762. WCHAR _rgDomainName[ DNLEN + 1 ];
  763. STRU _strDomainName;
  764. STRA _strCustomHeaders;
  765. STRA _strRedirectHeaders;
  766. DWORD _dwLogonMethod;
  767. WCHAR _rgRealm[ DNLEN + 1 ];
  768. STRU _strRealm;
  769. MULTISZA _mstrAuthProviders;
  770. BOOL _fCreateProcessAsUser;
  771. BOOL _fCreateProcessNewConsole;
  772. BOOL _fDoStaticCompression;
  773. BOOL _fDoDynamicCompression;
  774. DWORD _dwCGIScriptTimeout;
  775. BOOL _fDontLog;
  776. BOOL _fFooterEnabled;
  777. STRA _strFooterString;
  778. STRU _strFooterDocument;
  779. DWORD _dwExpireMode;
  780. STRA _strExpireHeader;
  781. LARGE_INTEGER _liExpireTime;
  782. DWORD _dwExpireDelta;
  783. BOOL _fHaveNoCache;
  784. DWORD _dwMaxAge;
  785. BOOL _fHaveMaxAge;
  786. STRA _strCacheControlHeader;
  787. BOOL _fKeepAliveEnabled;
  788. DWORD _dwRequireMapping;
  789. //
  790. // Script mappings defined for this metadata entry
  791. //
  792. META_SCRIPT_MAP _ScriptMap;
  793. //
  794. // The metabase path for the application that controls this url.
  795. // Corresponds to MD_APP_ROOT
  796. //
  797. STRU _strAppMetaPath;
  798. //
  799. // IP address restriction info
  800. //
  801. BUFFER _buffIpAccessCheck;
  802. DWORD _cbIpAccessCheck;
  803. //
  804. // Use IIS subauthenticator to logon the anonymous use
  805. //
  806. BOOL _fUseAnonSubAuth;
  807. //
  808. // Access token for UNC case
  809. //
  810. TOKEN_CACHE_ENTRY * _pctVrToken;
  811. //
  812. // Anonymous user token (if account valid)
  813. //
  814. TOKEN_CACHE_ENTRY * _pctAnonymousToken;
  815. //
  816. // Lock for managing associated tokens
  817. //
  818. CReaderWriterLock3 _TokenLock;
  819. //
  820. // Custom Error Table
  821. //
  822. CUSTOM_ERROR_TABLE _customErrorTable;
  823. //
  824. // Mime Map lookup table
  825. //
  826. MIME_MAP *_pMimeMap;
  827. //
  828. // SSI execution disable flag
  829. //
  830. BOOL _fSSIExecDisabled;
  831. //
  832. // Do a DNS lookup (for logging/server-variable purposes)
  833. //
  834. BOOL _fDoReverseDNS;
  835. //
  836. // Entity read ahead size
  837. //
  838. DWORD _cbEntityReadAhead;
  839. DWORD _dwMaxRequestEntityAllowed;
  840. //
  841. // Dir monitor configuration
  842. //
  843. DIRMON_CONFIG _dirmonConfig;
  844. //
  845. // Does the AppPoolId match the current process
  846. //
  847. BOOL _fAppPoolMatches;
  848. //
  849. // Should we disable caching for this path
  850. //
  851. BOOL _fNoCache;
  852. //
  853. // Cached WAM app info stuff
  854. //
  855. DWORD _dwAppIsolated;
  856. DWORD _dwAppOopRecoverLimit;
  857. STRU _strWamClsId;
  858. //
  859. // Full metadata path for flushing purposes
  860. //
  861. STRU _strFullMetadataPath;
  862. //
  863. // GETALL structure used for retrieving metabase properties thru GSV
  864. //
  865. BUFFER * _pGetAllBuffer;
  866. DWORD _cGetAllRecords;
  867. //
  868. // Is the UNC user invalid
  869. //
  870. BOOL _fUNCUserInvalid;
  871. //
  872. // Matching URL and path info for HTTP_FILTER_URL_MAP_EX and
  873. // HSE_URL_MAPEX_INFO
  874. //
  875. STRA _strMatchingUrlA;
  876. STRA _strMatchingPathA;
  877. DWORD _cbMatchingUrlA;
  878. DWORD _cbMatchingPathA;
  879. //
  880. // Allocation cache for W3_URL_INFO's
  881. //
  882. static ALLOC_CACHE_HANDLER * sm_pachW3MetaData;
  883. };
  884. //
  885. // W3_METADATA cache
  886. //
  887. #define DEFAULT_W3_METADATA_CACHE_TTL (5*60)
  888. class W3_METADATA_CACHE : public OBJECT_CACHE
  889. {
  890. public:
  891. W3_METADATA_CACHE()
  892. {
  893. }
  894. HRESULT
  895. GetMetaData(
  896. W3_CONTEXT * pW3Context,
  897. STRU & strUrl,
  898. W3_METADATA ** ppMetaData
  899. );
  900. WCHAR *
  901. QueryName(
  902. VOID
  903. ) const
  904. {
  905. return L"W3_METADATA_CACHE";
  906. }
  907. HRESULT
  908. Initialize(
  909. VOID
  910. );
  911. VOID
  912. Terminate(
  913. VOID
  914. )
  915. {
  916. return W3_METADATA::Terminate();
  917. }
  918. private:
  919. W3_METADATA_CACHE(const W3_METADATA_CACHE &);
  920. void operator=(const W3_METADATA_CACHE &);
  921. HRESULT
  922. GetFullMetadataPath(
  923. W3_CONTEXT * pW3Context,
  924. STRU & strUrl,
  925. STRU * pstrFullPath
  926. );
  927. HRESULT
  928. CreateNewMetaData(
  929. W3_CONTEXT * pW3Context,
  930. STRU & strUrl,
  931. STRU & strFullMetadataPath,
  932. W3_METADATA ** ppMetaData
  933. );
  934. };
  935. #endif