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.

858 lines
21 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name :
  4. tsunami.hxx
  5. Abstract:
  6. Declares the constants, data strutcures and function prototypes
  7. available for common use for Services from Tsunami.lib
  8. Author:
  9. Murali R. Krishnan ( MuraliK ) 2-March-1995
  10. [ Originally partly done by t-heathh]
  11. Project:
  12. Internet Services Common Functionality ( Tsunami Library)
  13. Revision History:
  14. --*/
  15. # ifndef _TSUNAMI_HXX_
  16. # define _TSUNAMI_HXX_
  17. /************************************************************
  18. * Include Headers
  19. ************************************************************/
  20. # if defined ( __cplusplus)
  21. extern "C" {
  22. # endif
  23. #include <nt.h>
  24. #include <ntrtl.h>
  25. #include <nturtl.h>
  26. #include <windows.h>
  27. #include <basetyps.h>
  28. #include <lmcons.h>
  29. # include <inetinfo.h>
  30. # include "fsconst.h" // Defines symbolic constants for FileSystems
  31. # if defined ( __cplusplus)
  32. };
  33. # endif
  34. #include <tscache.hxx>
  35. /************************************************************
  36. * Symbolic Constants
  37. ************************************************************/
  38. #define MAX_LENGTH_VIRTUAL_ROOT ( MAX_PATH + 1)
  39. #define MAX_LENGTH_ROOT_ADDR ( 50)
  40. #define INETA_MAX_OPEN_FILE TEXT("OpenFileInCache")
  41. #define INETA_DISABLE_TSUNAMI_CACHING TEXT("DisableMemoryCache")
  42. #define INETA_DISABLE_TSUNAMI_SPUD TEXT("DisableCacheOplocks")
  43. #define INETA_ALWAYS_CHECK_FOR_DUPLICATE_LOGON TEXT("AlwaysCheckForDuplicateLogon")
  44. #define INETA_USE_ADVAPI32_LOGON TEXT("UseAdvapi32Logon")
  45. #define INETA_CHECK_CERT_REVOCATION TEXT("CheckCertRevocation")
  46. //
  47. // Modifications to this name should also be made in exe\main.c
  48. //
  49. #define INETA_W3ONLY_NO_AUTH TEXT("W3OnlyNoAuth")
  50. #define INETA_MIN_DEF_FILE_HANDLE 300
  51. #define MAX_SIZE_HTTP_INFO 170
  52. #define INETA_CACHE_USE_ACCESS_CHECK TEXT("CacheSecurityDescriptor")
  53. #define INETA_DEF_CACHE_USE_ACCESS_CHECK TRUE
  54. #define SIZE_PRIVILEGE_SET 128
  55. #define SECURITY_DESC_DEFAULT_SIZE 256
  56. #define SECURITY_DESC_GRANULARITY 128
  57. #define RESERVED_DEMUX_START 0x80000000
  58. #define RESERVED_DEMUX_DIRECTORY_LISTING ( RESERVED_DEMUX_START + 1 )
  59. #define RESERVED_DEMUX_ATOMIC_DIRECTORY_GUARD ( RESERVED_DEMUX_START + 2 )
  60. #define RESERVED_DEMUX_OPEN_FILE ( RESERVED_DEMUX_START + 3 )
  61. #define RESERVED_DEMUX_URI_INFO ( RESERVED_DEMUX_START + 4 )
  62. #define RESERVED_DEMUX_PHYSICAL_OPEN_FILE ( RESERVED_DEMUX_START + 5 )
  63. // The maxium length of an ETag is 16 bytes for the last modified time plus
  64. // one byte for the colon plus 2 bytes for the quotes plus 8 bytes for the
  65. // system change notification number plus one for the trailing NULL, for a
  66. // total of 28 bytes.
  67. #define MAX_ETAG_BUFFER_LENGTH 28
  68. /************************************************************
  69. * Type Definitions
  70. ************************************************************/
  71. /************************************************************
  72. * Global Tsunami variables
  73. ************************************************************/
  74. extern GENERIC_MAPPING g_gmFile;
  75. extern BYTE g_psFile[SIZE_PRIVILEGE_SET];
  76. extern BOOL g_fCacheSecDesc;
  77. extern BOOL g_fW3OnlyNoAuth;
  78. extern BOOL g_fAlwaysCheckForDuplicateLogon;
  79. extern BOOL g_fUseAdvapi32Logon;
  80. extern BOOL g_fCertCheckForRevocation;
  81. /************************************************************
  82. * Function Prototypes
  83. ************************************************************/
  84. //
  85. // General Functions
  86. //
  87. extern
  88. BOOL Tsunami_Initialize( VOID );
  89. extern
  90. VOID Tsunami_Terminate( VOID );
  91. extern
  92. VOID TsDumpCacheToHtml(IN OUT CHAR * pchBuffer, IN OUT LPDWORD lpcbSize);
  93. # if defined( __cplusplus)
  94. extern "C" {
  95. # endif
  96. //
  97. // Blob Memory management functions : Allocate, Reallocate and Free.
  98. //
  99. typedef BOOL ( *PUSER_FREE_ROUTINE )( PVOID pvOldBlock );
  100. extern
  101. BOOL TsAllocate
  102. (
  103. IN const TSVC_CACHE &TSvcCache,
  104. IN ULONG cbSize,
  105. IN OUT PVOID * ppvNewBlock
  106. );
  107. extern
  108. BOOL TsAllocateEx
  109. (
  110. IN const TSVC_CACHE &TSvcCache,
  111. IN ULONG cbSize,
  112. IN OUT PVOID * ppvNewBlock,
  113. OPTIONAL PUSER_FREE_ROUTINE pfnFreeRoutine
  114. );
  115. extern
  116. BOOL TsReallocate
  117. (
  118. IN const TSVC_CACHE &TSvcCache,
  119. IN ULONG cbSize,
  120. IN PVOID pvOldBlock,
  121. IN OUT PVOID * ppvNewBlock
  122. );
  123. extern
  124. BOOL TsFree
  125. (
  126. IN const TSVC_CACHE &TSvcCache,
  127. IN PVOID pvOldBlock
  128. );
  129. extern
  130. BOOL TsCheckInOrFree
  131. (
  132. IN PVOID pvOldBlock
  133. );
  134. //
  135. // Cache Manager Functions: cache, decache, checkout and checkins of blobs
  136. //
  137. extern
  138. BOOL
  139. TsCacheDirectoryBlob(
  140. IN const TSVC_CACHE &TSvcCache,
  141. IN PCSTR pszDirectoryName,
  142. IN ULONG iDemultiplexor,
  143. IN PVOID pvBlob,
  144. IN BOOLEAN bKeepCheckedOut,
  145. IN PSECURITY_DESCRIPTOR pSecDesc = NULL
  146. );
  147. extern
  148. BOOL
  149. TsCheckOutCachedBlob(
  150. IN const TSVC_CACHE &TSvcCache,
  151. IN PCSTR pszDirectoryName,
  152. IN ULONG iDemultiplexor,
  153. IN PVOID * ppvBlob,
  154. IN HANDLE hAccessToken = NULL,
  155. IN BOOL fMayCacheAccessToken = FALSE,
  156. OUT PSECURITY_DESCRIPTOR* ppSecDesc = NULL
  157. );
  158. extern
  159. BOOL
  160. TsCheckInCachedBlob(
  161. IN PVOID pvBlob
  162. );
  163. extern
  164. BOOL
  165. TsExpireCachedBlob(
  166. IN const TSVC_CACHE &TSvcCache,
  167. IN PVOID pvBlob
  168. );
  169. extern
  170. BOOL
  171. TsAdjustCachedBlobSize(
  172. IN PVOID pvBlob,
  173. IN INT cbSize
  174. );
  175. extern
  176. BOOL
  177. TsCacheQueryStatistics(
  178. IN DWORD Level,
  179. IN DWORD dwServerMask,
  180. IN INETA_CACHE_STATISTICS * pCacheCtrs
  181. );
  182. extern
  183. BOOL
  184. TsCacheClearStatistics(
  185. IN DWORD dwServerMask
  186. );
  187. extern
  188. BOOL
  189. TsCacheFlushDemux(
  190. IN ULONG iDemux
  191. );
  192. extern
  193. BOOL
  194. TsCacheFlush(
  195. IN DWORD dwServerMask
  196. );
  197. extern
  198. BOOL
  199. TsCacheFlushUser(
  200. IN HANDLE hUserToken,
  201. IN BOOL fDefer
  202. );
  203. extern
  204. VOID
  205. TsFlushTimedOutCacheObjects(
  206. VOID
  207. );
  208. extern
  209. VOID
  210. TsCacheSetSize(
  211. DWORD cbMemoryCacheSize
  212. );
  213. extern
  214. DWORD
  215. TsCacheQueryMaxSize(
  216. VOID
  217. );
  218. extern
  219. DWORD
  220. TsCacheQuerySize(
  221. VOID
  222. );
  223. extern
  224. dllexp
  225. VOID
  226. TsDecreaseFileHandleCount(
  227. VOID
  228. );
  229. extern
  230. VOID
  231. TsIncreaseFileHandleCount(
  232. BOOL
  233. );
  234. extern
  235. dllexp
  236. BOOL
  237. TsDeCacheCachedBlob(
  238. PVOID
  239. );
  240. extern
  241. dllexp
  242. BOOL
  243. TsAddRefCachedBlob(
  244. PVOID
  245. );
  246. # if defined( __cplusplus)
  247. };
  248. # endif
  249. //
  250. // defines the DIRECTORY_INFO class and functions to
  251. // obtain and cache the directory information for a given directory.
  252. //
  253. //
  254. // forwards
  255. //
  256. class TS_DIRECTORY_HEADER;
  257. //
  258. // Following function compares the two given pFileInfo and returns
  259. // 0 if pFileInfo1 is == pfFileInfo2
  260. // -1 if pFileInfo1 is < pFileInfo2
  261. // +1 if pFileInfo1 is > pFileInfo2
  262. //
  263. typedef int ( __cdecl * PFN_CMP_WIN32_FIND_DATA)
  264. (IN const void * /* PWIN32_FIND_DATA * */ pvFileInfo1,
  265. IN const void * /* PWIN32_FIND_DATA * */ pvFileInfo2);
  266. //
  267. // Following function AlphaCompareFileBothDirInfo() compares the filenames,
  268. // of the two given FileInfo present in (**pvFileInfo)
  269. //
  270. dllexp
  271. int __cdecl
  272. AlphaCompareFileBothDirInfo(
  273. IN const void * /* PWIN32_FIND_DATA * */ pvFileInfo1,
  274. IN const void * /* PWIN32_FIND_DATA * */ pvFileInfo2);
  275. //
  276. // Following function is to be used by filter function for filtering
  277. // of the files requested. The criteria for matching is user supplied.
  278. // Arguments:
  279. // pFileInfo1 pointer to File Info object under consideration
  280. // pContext user supplied context for the Filter Function
  281. // Return values:
  282. // 0 indicates that there is no match of context to FileInfo ==> filter
  283. // 1 indicates that there is a match and hence dont filter
  284. //
  285. typedef int ( __cdecl * PFN_IS_MATCH_WIN32_FIND_DATA)
  286. (IN const WIN32_FIND_DATA * pFileInfo,
  287. IN LPVOID pContext);
  288. //
  289. // Following function RegExpressionMatchFileInfo() assumes that the
  290. // context passed in is a pointer to null-terminated string and
  291. // uses regular expression based comparison for matching against
  292. // file name in WIN32_FIND_DATA passed in.
  293. //
  294. dllexp
  295. int __cdecl
  296. RegExpressionMatchFileInfo(
  297. IN const WIN32_FIND_DATA * pFileInfo,
  298. IN LPVOID pContext);
  299. //
  300. // Checks to see if the given name can be generated using the
  301. // regular expression embedded in the pszExpression.
  302. //
  303. dllexp
  304. BOOL _cdecl
  305. IsNameInRegExpressionA(
  306. IN LPCSTR pszExpression,
  307. IN LPCSTR pszName,
  308. IN BOOL fIgnoreCase);
  309. /*++
  310. class TS_DIRECTORY_INFO
  311. This class provides a method to obtain directory listings.
  312. The directory listing may be optionally cached transparently.
  313. In addition this class provides methods for
  314. 1) accessing the information about files in indexed fashion
  315. 2) Sort the information about files using a generic sort function
  316. given the compare funtion
  317. 3) Filters the listing applying filters the list of files available.
  318. The strings in the File information obtained are stored as ANSI strings.
  319. --*/
  320. class TS_DIRECTORY_INFO {
  321. public:
  322. dllexp
  323. TS_DIRECTORY_INFO( const TSVC_CACHE & tsCache)
  324. : m_cFilesInDirectory ( 0),
  325. m_fValid ( FALSE),
  326. m_tsCache ( tsCache),
  327. m_pTsDirectoryHeader( NULL),
  328. m_prgFileInfo ( NULL)
  329. {
  330. // the data stored may be valid after user calls GetDirectoryListing()
  331. }
  332. dllexp
  333. ~TS_DIRECTORY_INFO( VOID)
  334. { CleanupThis(); }
  335. dllexp
  336. VOID CleanupThis( VOID);
  337. dllexp
  338. BOOL IsValid( VOID) const
  339. { return ( m_fValid); }
  340. dllexp
  341. BOOL
  342. GetDirectoryListingA(
  343. IN LPCSTR pszDirectoryName,
  344. IN HANDLE hListingUser);
  345. dllexp
  346. int QueryFilesCount( VOID) const
  347. { return ( m_cFilesInDirectory); }
  348. dllexp
  349. const WIN32_FIND_DATA *
  350. operator [] ( IN int idx) const {
  351. return ( 0 <= idx && idx < QueryFilesCount()) ?
  352. GetFileInfoPointerFromIdx( idx) : NULL;
  353. }
  354. dllexp
  355. BOOL
  356. SortFileInfoPointers( IN PFN_CMP_WIN32_FIND_DATA pfnCompare);
  357. BOOL
  358. AlphabeticallySortFileInfo( VOID) {
  359. return SortFileInfoPointers( AlphaCompareFileBothDirInfo);
  360. }
  361. //
  362. // Filter functions are used to eliminate some of the file
  363. // pointers to be used in scanning ( using operator []).
  364. //
  365. //
  366. // This function uses the pfnMatch to identify the items that dont match
  367. // and filters them away from the directory listing generated.
  368. // The filter function returns TRUE on success and FALSE if any errors.
  369. //
  370. dllexp
  371. BOOL FilterFiles(IN PFN_IS_MATCH_WIN32_FIND_DATA pfnMatch,
  372. IN LPVOID pContext);
  373. # ifdef UNICODE
  374. dllexp
  375. BOOL
  376. GetDirectoryListingW(
  377. IN LPCWSTR pwszDirectoryName,
  378. IN HANDLE hListingUser);
  379. # define GetDirectoryListing GetDirectoryListingW
  380. # else
  381. # define GetDirectoryListing GetDirectoryListingA
  382. # endif // UNICODE
  383. # if DBG
  384. dllexp
  385. VOID Print( VOID) const;
  386. #else
  387. dllexp
  388. VOID Print( VOID) const
  389. { ; }
  390. # endif // DBG
  391. private:
  392. int m_cFilesInDirectory;
  393. BOOL m_fValid;
  394. const TSVC_CACHE & m_tsCache;
  395. TS_DIRECTORY_HEADER * m_pTsDirectoryHeader; // ptr to dir listing
  396. PWIN32_FIND_DATA * m_prgFileInfo;
  397. dllexp
  398. PWIN32_FIND_DATA
  399. GetFileInfoPointerFromIdx( IN int idx) const
  400. { return ( m_prgFileInfo[idx]); }
  401. }; // class TS_DIRECTORY_INFO
  402. typedef TS_DIRECTORY_INFO * PTS_DIRECTORY_INFO;
  403. //
  404. // The structure of Physical Open File Information. This structure
  405. // is used to access a file opened by TSCreateFile or TsCreateFileFromURI.
  406. //
  407. typedef struct _PHYS_OPEN_FILE_INFO {
  408. DWORD Signature;
  409. HANDLE hOpenFile;
  410. HANDLE hOpenEvent;
  411. LIST_ENTRY OpenReferenceList;
  412. BOOL fSecurityDescriptor;
  413. BOOL fIsCached;
  414. DWORD dwLastError;
  415. DWORD cbSecDescMaxSize;
  416. PSECURITY_DESCRIPTOR abSecurityDescriptor;
  417. struct _OPLOCK_OBJECT * pOplock;
  418. } PHYS_OPEN_FILE_INFO, *PPHYS_OPEN_FILE_INFO;
  419. #define PHYS_OBJ_SIGNATURE ((DWORD)'SYHP')
  420. #define PHYS_OBJ_SIGNATURE_X ((DWORD)'yhpX')
  421. /*++
  422. Class TS_OPEN_FILE_INFO
  423. This class maintains the raw information related to open file handles
  424. that are possibly cached within user-space.
  425. In addition to the file handles themselves, the file attribute information
  426. and handle for the opening user are both cached.
  427. Presently both constructor and destructor are both dummy to keep in
  428. tune with original "C" APIs for TsCreateFile() and TsCloseFile() written
  429. by Heath.
  430. --*/
  431. class TS_OPEN_FILE_INFO {
  432. #ifndef CHICAGO
  433. private:
  434. #else
  435. public:
  436. #endif
  437. HANDLE m_hOpeningUser;
  438. PPHYS_OPEN_FILE_INFO m_PhysFileInfo;
  439. BY_HANDLE_FILE_INFORMATION m_FileInfo;
  440. __int64 m_CastratedLastWriteTime; // Reduced to 1 second granularity
  441. CHAR m_achHttpInfo[MAX_SIZE_HTTP_INFO];
  442. int m_cchHttpInfo;
  443. CHAR m_achETag[MAX_ETAG_BUFFER_LENGTH];
  444. DWORD m_cchETag;
  445. BOOL m_ETagIsWeak;
  446. BOOL m_fIsCached;
  447. public:
  448. TS_OPEN_FILE_INFO( VOID)
  449. : m_PhysFileInfo( NULL),
  450. m_hOpeningUser( INVALID_HANDLE_VALUE),
  451. m_fIsCached( FALSE ),
  452. m_cchHttpInfo( 0 ),
  453. m_ETagIsWeak(TRUE)
  454. { }
  455. ~TS_OPEN_FILE_INFO( VOID) {}
  456. dllexp PSECURITY_DESCRIPTOR GetSecurityDescriptor( VOID )
  457. { return (PSECURITY_DESCRIPTOR)m_PhysFileInfo->abSecurityDescriptor; }
  458. dllexp DWORD GetSecurityDescriptorMaxLength( VOID )
  459. { return m_PhysFileInfo->cbSecDescMaxSize; }
  460. dllexp BOOL IsSecurityDescriptorValid( VOID )
  461. { return m_PhysFileInfo->fSecurityDescriptor != 0; }
  462. dllexp VOID SetSecurityDescriptorValid( BOOL fV )
  463. { m_PhysFileInfo->fSecurityDescriptor = fV; }
  464. dllexp VOID SetCachedFlag( BOOL flag )
  465. { m_fIsCached = flag; }
  466. dllexp BOOL QueryCachedFlag( VOID )
  467. { return m_fIsCached; }
  468. BOOL
  469. SetFileInfo( IN PPHYS_OPEN_FILE_INFO lpPhysFileInfo,
  470. IN HANDLE hOpeningUser,
  471. IN BOOL fAtRoot,
  472. IN DWORD cbSecDescCacheSize = 0,
  473. IN DWORD dwAttributes = 0 );
  474. //
  475. // Returns TRUE if info was cached, FALSE if not cached
  476. //
  477. dllexp BOOL
  478. SetHttpInfo( IN PSTR pszDate, int cL );
  479. dllexp HANDLE
  480. QueryFileHandle( VOID) const
  481. { return ( m_PhysFileInfo->hOpenFile); }
  482. dllexp PPHYS_OPEN_FILE_INFO
  483. QueryPhysFileInfo( VOID) const
  484. { ASSERT( m_PhysFileInfo->Signature == PHYS_OBJ_SIGNATURE );
  485. return ( m_PhysFileInfo); }
  486. dllexp HANDLE
  487. QueryOpeningUser( VOID) const
  488. { return ( m_hOpeningUser); }
  489. dllexp BOOL
  490. IsValid( VOID) const
  491. { return ( m_PhysFileInfo->hOpenFile != INVALID_HANDLE_VALUE); }
  492. dllexp BOOL
  493. RetrieveHttpInfo( PSTR pS, int *pcHttpInfo )
  494. {
  495. if ( m_cchHttpInfo )
  496. {
  497. memcpy( pS, m_achHttpInfo, m_cchHttpInfo+1 );
  498. *pcHttpInfo = m_cchHttpInfo;
  499. return TRUE;
  500. }
  501. else
  502. return FALSE;
  503. }
  504. dllexp BOOL
  505. QuerySize( IN LARGE_INTEGER & liSize) const
  506. {
  507. if ( IsValid()) {
  508. liSize.LowPart = m_FileInfo.nFileSizeLow;
  509. liSize.HighPart= m_FileInfo.nFileSizeHigh;
  510. return (TRUE);
  511. } else {
  512. SetLastError( ERROR_INVALID_PARAMETER);
  513. return ( FALSE);
  514. }
  515. }
  516. dllexp BOOL
  517. QuerySize( IN LPDWORD lpcbFileSizeLow,
  518. IN LPDWORD lpcbFileSizeHigh = NULL) const
  519. {
  520. if ( IsValid()) {
  521. if ( lpcbFileSizeLow != NULL) {
  522. *lpcbFileSizeLow = m_FileInfo.nFileSizeLow;
  523. }
  524. if ( lpcbFileSizeHigh != NULL) {
  525. *lpcbFileSizeHigh = m_FileInfo.nFileSizeHigh;
  526. }
  527. return ( TRUE);
  528. } else {
  529. SetLastError( ERROR_INVALID_PARAMETER);
  530. return ( FALSE);
  531. }
  532. } // QuerySize()
  533. dllexp DWORD
  534. QueryAttributes( VOID) const
  535. { return ( IsValid()) ?
  536. ( m_FileInfo.dwFileAttributes) : 0xFFFFFFFF; }
  537. //
  538. // This returns the time with a one second resolution (at best)
  539. //
  540. dllexp BOOL
  541. QueryLastWriteTime( OUT LPFILETIME lpFileTime) const
  542. {
  543. if ( lpFileTime != NULL && IsValid()) {
  544. *((__int64 * UNALIGNED) lpFileTime) = m_CastratedLastWriteTime;
  545. return ( TRUE);
  546. } else {
  547. SetLastError( ERROR_INVALID_PARAMETER);
  548. return ( FALSE);
  549. }
  550. } // QueryLastWriteTime()
  551. //
  552. // This returns the time with full resolution from the file system
  553. //
  554. dllexp BOOL
  555. QueryFileSystemLastWriteTime( OUT __int64 UNALIGNED * lpNTTime) const
  556. {
  557. if ( lpNTTime != NULL && IsValid()) {
  558. *((FILETIME * UNALIGNED) lpNTTime) = m_FileInfo.ftLastWriteTime;
  559. return ( TRUE);
  560. } else {
  561. SetLastError( ERROR_INVALID_PARAMETER);
  562. return ( FALSE);
  563. }
  564. } // QueryFileSystemLastWriteTime()
  565. dllexp BOOL
  566. WeakETag( void ) const
  567. { return ( m_ETagIsWeak ); }
  568. dllexp PCHAR
  569. QueryETag( void ) const
  570. { return ( (PCHAR)m_achETag ); }
  571. dllexp DWORD
  572. QueryETagLength( void ) const
  573. { return ( m_cchETag ); }
  574. dllexp VOID
  575. MakeStrongETag( void );
  576. # if DBG
  577. VOID Print( VOID) const;
  578. # endif // DBG
  579. }; // class TS_OPEN_FILE_INFO
  580. typedef TS_OPEN_FILE_INFO * LPTS_OPEN_FILE_INFO;
  581. #define TS_CACHING_DESIRED 0x00000001
  582. #define TS_NOT_IMPERSONATED 0x00000002
  583. #define TS_NO_ACCESS_CHECK 0x00000004
  584. #define TS_DONT_CACHE_ACCESS_TOKEN 0x00000008
  585. #define TS_USE_WIN32_CANON 0x00000010
  586. //
  587. // Flags applicable to the different servers
  588. //
  589. #define TS_IIS_VALID_FLAGS (TS_CACHING_DESIRED | \
  590. TS_NO_ACCESS_CHECK | \
  591. TS_DONT_CACHE_ACCESS_TOKEN | \
  592. TS_NOT_IMPERSONATED | \
  593. TS_USE_WIN32_CANON)
  594. #define TS_PWS_VALID_FLAGS (TS_NOT_IMPERSONATED | \
  595. TS_USE_WIN32_CANON)
  596. //
  597. // The structure of URI Object information. This stucture contains
  598. // pointers to cached meta information about a URI as well as
  599. // information about the actual file to which the URI is mapped.
  600. //
  601. typedef struct _W3_URI_INFO {
  602. DWORD bFileInfoValid;
  603. BOOL bIsCached;
  604. HANDLE hFileEvent;
  605. LPTS_OPEN_FILE_INFO pOpenFileInfo;
  606. DWORD dwFileOpenError;
  607. UINT cchName;
  608. PCHAR pszName;
  609. PCHAR pszUnmappedName;
  610. class W3_METADATA *pMetaData;
  611. } W3_URI_INFO, *PW3_URI_INFO;
  612. extern
  613. dllexp
  614. LPTS_OPEN_FILE_INFO
  615. TsCreateFile(
  616. IN const TSVC_CACHE &TSvcCache,
  617. IN LPCSTR lpszName,
  618. IN HANDLE OpeningUser,
  619. IN DWORD dwOptions
  620. );
  621. extern
  622. dllexp
  623. PSECURITY_DESCRIPTOR
  624. TsGetFileSecDesc(
  625. IN LPTS_OPEN_FILE_INFO pFile
  626. );
  627. extern
  628. dllexp
  629. BOOL TsCloseHandle(
  630. IN const TSVC_CACHE &TSvcCache,
  631. IN LPTS_OPEN_FILE_INFO pOpenFile
  632. );
  633. extern
  634. dllexp
  635. LPTS_OPEN_FILE_INFO
  636. TsCreateFileFromURI(
  637. IN const TSVC_CACHE &TSvcCache,
  638. IN PW3_URI_INFO pURIInfo,
  639. IN HANDLE OpeningUser,
  640. IN DWORD dwOptions,
  641. IN DWORD *dwError
  642. );
  643. extern
  644. dllexp
  645. BOOL TsCloseURIFile(
  646. IN LPTS_OPEN_FILE_INFO pOpenFile
  647. );
  648. extern
  649. dllexp
  650. BOOL TsCreateETagFromHandle(
  651. IN HANDLE hFile,
  652. IN PCHAR ETag,
  653. IN BOOL *bWeakETag
  654. );
  655. extern
  656. dllexp
  657. BOOL TsLastWriteTimeFromHandle(
  658. IN HANDLE hFile,
  659. IN FILETIME *tm
  660. );
  661. extern
  662. dllexp
  663. VOID
  664. TsFlushURL(
  665. IN const TSVC_CACHE &TSvcCache,
  666. IN LPCSTR pszURL,
  667. IN DWORD dwURLLength,
  668. IN DWORD dwDemux
  669. );
  670. # endif // _TSUNAMI_HXX_
  671. /************************ End of File ***********************/