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.

936 lines
17 KiB

  1. /*++
  2. Copyright (C) 1996-2001 Microsoft Corporation
  3. Module Name:
  4. Cache.H
  5. Abstract:
  6. History:
  7. --*/
  8. #ifndef _Cache_H
  9. #define _Cache_H
  10. #include <Allocator.h>
  11. #include <Algorithms.h>
  12. #include <TPQueue.h>
  13. #include <AvlTree.h>
  14. #include <lockst.h>
  15. template<typename T>
  16. class AutoLockGuard
  17. {
  18. T& m_lock;
  19. int m_lockCount;
  20. public:
  21. AutoLockGuard(T& target);
  22. ~AutoLockGuard();
  23. void Lock();
  24. void UnLock();
  25. };
  26. template<typename T>
  27. AutoLockGuard<T>::AutoLockGuard(T& target): m_lock(target), m_lockCount(0)
  28. {
  29. Lock();
  30. }
  31. template<typename T>
  32. AutoLockGuard<T>::~AutoLockGuard()
  33. {
  34. if (m_lockCount) UnLock();
  35. }
  36. template<typename T>
  37. void AutoLockGuard<T>::Lock()
  38. {
  39. _DBG_ASSERT(m_lockCount == 0);
  40. m_lock.Lock();
  41. m_lockCount++;
  42. }
  43. template<typename T>
  44. void AutoLockGuard<T>::UnLock()
  45. {
  46. _DBG_ASSERT(m_lockCount > 0);
  47. m_lock.UnLock();
  48. m_lockCount--;
  49. }
  50. /******************************************************************************
  51. *
  52. * Name:
  53. *
  54. *
  55. * Description:
  56. *
  57. *
  58. *****************************************************************************/
  59. template <class WmiKey>
  60. class WmiCacheController : public IUnknown
  61. {
  62. public:
  63. class WmiUniqueTimeout
  64. {
  65. private:
  66. ULONG m_Ticks ;
  67. LONG m_Counter ;
  68. public:
  69. WmiUniqueTimeout () : m_Ticks ( 0 ) , m_Counter ( 0 ) { ; }
  70. WmiUniqueTimeout (
  71. const ULONG &a_Ticks ,
  72. const LONG &a_Counter
  73. ) : m_Ticks ( a_Ticks ) ,
  74. m_Counter ( a_Counter )
  75. { ; }
  76. ULONG GetTicks () const { return m_Ticks ; }
  77. LONG GetCounter () const { return m_Counter ; }
  78. friend bool operator == ( const WmiUniqueTimeout &a_Arg1 , const WmiUniqueTimeout &a_Arg2 )
  79. {
  80. LONG t_Compare ;
  81. if ( ( t_Compare = a_Arg1.GetTicks () - a_Arg2.GetTicks () ) == 0 )
  82. {
  83. t_Compare = a_Arg1.GetCounter () - a_Arg2.GetCounter () ;
  84. }
  85. return t_Compare == 0 ? true : false ;
  86. }
  87. friend bool operator < ( const WmiUniqueTimeout &a_Arg1 , const WmiUniqueTimeout &a_Arg2 )
  88. {
  89. LONG t_Compare ;
  90. if ( ( t_Compare = a_Arg1.GetTicks () - a_Arg2.GetTicks () ) == 0 )
  91. {
  92. t_Compare = a_Arg1.GetCounter () - a_Arg2.GetCounter () ;
  93. }
  94. return t_Compare < 0 ? true : false ;
  95. }
  96. } ;
  97. class WmiCacheElement : public IUnknown
  98. {
  99. private:
  100. LONG m_ReferenceCount ;
  101. LONG m_InternalReferenceCount ;
  102. LONG m_NonCylicReferenceCount ;
  103. BOOL m_Decaying ;
  104. BOOL m_Cached ;
  105. BOOL m_Decayed ;
  106. ULONG m_CallBackInternalRelease ;
  107. WmiCacheController <WmiKey> *m_Controller ;
  108. WmiKey m_Key ;
  109. ULONG m_Period ;
  110. public:
  111. WmiCacheElement () :
  112. m_ReferenceCount ( 0 ) ,
  113. m_InternalReferenceCount ( 0 ) ,
  114. m_NonCylicReferenceCount ( 0 ) ,
  115. m_Controller ( NULL ) ,
  116. m_Period ( 0 ) ,
  117. m_Decaying ( FALSE ) ,
  118. m_Decayed ( FALSE ) ,
  119. m_Cached ( FALSE ) ,
  120. m_CallBackInternalRelease ( 1 )
  121. {
  122. }
  123. WmiCacheElement (
  124. WmiCacheController <WmiKey> *a_Controller ,
  125. const WmiKey &a_Key ,
  126. const ULONG &a_Period
  127. ) : m_ReferenceCount ( 0 ) ,
  128. m_InternalReferenceCount ( 0 ) ,
  129. m_NonCylicReferenceCount ( 0 ) ,
  130. m_Controller ( a_Controller ) ,
  131. m_Period ( a_Period ) ,
  132. m_Decaying ( FALSE ) ,
  133. m_Decayed ( FALSE ) ,
  134. m_Cached ( FALSE ) ,
  135. m_CallBackInternalRelease ( 1 )
  136. {
  137. m_Key = a_Key ;
  138. if ( m_Controller )
  139. {
  140. m_Controller->AddRef () ;
  141. }
  142. }
  143. virtual ~WmiCacheElement ()
  144. {
  145. #if 0
  146. wchar_t t_Buffer [ 128 ] ;
  147. wsprintf ( t_Buffer , L"\n%lx - ~WmiCacheElement ( %lx ) " , GetTickCount () , this ) ;
  148. OutputDebugString ( t_Buffer ) ;
  149. #endif
  150. #ifdef DBG
  151. if ( m_ReferenceCount != 0 )
  152. {
  153. DebugBreak () ;
  154. }
  155. if ( m_InternalReferenceCount != 0 )
  156. {
  157. DebugBreak () ;
  158. }
  159. if ( m_NonCylicReferenceCount != 0 )
  160. {
  161. DebugBreak () ;
  162. }
  163. #endif
  164. if ( m_Controller )
  165. {
  166. m_Controller->Release () ;
  167. }
  168. }
  169. virtual void CallBackRelease () {} ;
  170. virtual void CallBackInternalRelease () {} ;
  171. virtual STDMETHODIMP QueryInterface ( REFIID , LPVOID FAR * )
  172. {
  173. return E_NOINTERFACE ;
  174. }
  175. virtual STDMETHODIMP_( ULONG ) AddRef ()
  176. {
  177. if ( m_Controller )
  178. {
  179. m_Controller->Lock () ;
  180. }
  181. ULONG t_ReferenceCount = InterlockedIncrement ( & m_ReferenceCount ) ;
  182. if ( t_ReferenceCount == 1 )
  183. {
  184. InternalAddRef () ;
  185. SetDecaying ( FALSE ) ;
  186. }
  187. if ( m_Controller )
  188. {
  189. m_Controller->UnLock () ;
  190. }
  191. return t_ReferenceCount ;
  192. }
  193. virtual STDMETHODIMP_( ULONG ) Release ()
  194. {
  195. if ( m_Controller )
  196. {
  197. m_Controller->Lock () ;
  198. }
  199. LONG t_ReferenceCount = InterlockedDecrement ( & m_ReferenceCount ) ;
  200. if ( t_ReferenceCount == 0 )
  201. {
  202. CallBackRelease () ;
  203. if ( m_Controller )
  204. {
  205. if ( GetCached () )
  206. {
  207. if ( GetDecayed () == FALSE )
  208. {
  209. if ( GetDecaying () == FALSE )
  210. {
  211. WmiStatusCode t_StatusCode = m_Controller->Decay ( *this ) ;
  212. if ( t_StatusCode == e_StatusCode_Success )
  213. {
  214. SetDecaying ( TRUE ) ;
  215. }
  216. }
  217. }
  218. t_ReferenceCount = UnLockedInternalRelease () ;
  219. }
  220. else
  221. {
  222. t_ReferenceCount = UnLockedInternalRelease () ;
  223. }
  224. }
  225. else
  226. {
  227. t_ReferenceCount = UnLockedInternalRelease () ;
  228. }
  229. }
  230. else
  231. {
  232. #ifdef DBG
  233. if ( t_ReferenceCount < 0 )
  234. {
  235. DebugBreak () ;
  236. }
  237. #endif
  238. if ( m_Controller )
  239. {
  240. m_Controller->UnLock () ;
  241. }
  242. }
  243. return t_ReferenceCount ;
  244. }
  245. STDMETHODIMP_( ULONG ) InternalAddRef ()
  246. {
  247. ULONG t_ReferenceCount = InterlockedIncrement ( & m_InternalReferenceCount ) ;
  248. if ( t_ReferenceCount == 1 )
  249. {
  250. NonCyclicAddRef () ;
  251. }
  252. return t_ReferenceCount ;
  253. }
  254. STDMETHODIMP_( ULONG ) UnLockedInternalRelease ()
  255. {
  256. LONG t_ReferenceCount = InterlockedDecrement ( & m_InternalReferenceCount ) ;
  257. if ( t_ReferenceCount == 0 )
  258. {
  259. BOOL t_DoCallBack = m_CallBackInternalRelease ;
  260. m_CallBackInternalRelease = 0xbabab1ac ;
  261. if ( GetCached () )
  262. {
  263. m_Controller->Delete ( m_Key ) ;
  264. SetCached ( FALSE ) ;
  265. }
  266. if ( m_Controller )
  267. {
  268. m_Controller->UnLock () ;
  269. }
  270. if ( t_DoCallBack == 1 )
  271. {
  272. CallBackInternalRelease () ;
  273. }
  274. else
  275. {
  276. #ifdef DBG
  277. DebugBreak () ;
  278. #endif
  279. }
  280. NonCyclicRelease () ;
  281. }
  282. else
  283. {
  284. #ifdef DBG
  285. if ( t_ReferenceCount < 0 )
  286. {
  287. DebugBreak () ;
  288. }
  289. #endif
  290. if ( m_Controller )
  291. {
  292. m_Controller->UnLock () ;
  293. }
  294. }
  295. return t_ReferenceCount ;
  296. }
  297. STDMETHODIMP_( ULONG ) InternalRelease ()
  298. {
  299. if ( m_Controller )
  300. {
  301. m_Controller->Lock () ;
  302. }
  303. LONG t_ReferenceCount = InterlockedDecrement ( & m_InternalReferenceCount ) ;
  304. if ( t_ReferenceCount == 0 )
  305. {
  306. BOOL t_DoCallBack = m_CallBackInternalRelease ;
  307. m_CallBackInternalRelease = 0xbabab1ac ;
  308. BOOL t_Cached = GetCached () ;
  309. if ( t_Cached )
  310. {
  311. m_Controller->Delete ( m_Key ) ;
  312. SetCached ( FALSE ) ;
  313. }
  314. if ( m_Controller )
  315. {
  316. m_Controller->UnLock () ;
  317. }
  318. if ( t_DoCallBack == 1 )
  319. {
  320. CallBackInternalRelease () ;
  321. }
  322. else
  323. {
  324. #ifdef DBG
  325. DebugBreak () ;
  326. #endif
  327. }
  328. NonCyclicRelease () ;
  329. }
  330. else
  331. {
  332. #ifdef DBG
  333. if ( t_ReferenceCount < 0 )
  334. {
  335. DebugBreak () ;
  336. }
  337. #endif
  338. if ( m_Controller )
  339. {
  340. m_Controller->UnLock () ;
  341. }
  342. }
  343. return t_ReferenceCount ;
  344. }
  345. STDMETHODIMP_( ULONG ) NonCyclicAddRef ()
  346. {
  347. return InterlockedIncrement ( & m_NonCylicReferenceCount ) ;
  348. }
  349. STDMETHODIMP_( ULONG ) NonCyclicRelease ()
  350. {
  351. ULONG t_ReferenceCount = InterlockedDecrement ( & m_NonCylicReferenceCount ) ;
  352. if ( t_ReferenceCount == 0 )
  353. {
  354. delete this ;
  355. }
  356. return t_ReferenceCount ;
  357. }
  358. ULONG GetPeriod ()
  359. {
  360. return m_Period ;
  361. }
  362. void SetPeriod ( const ULONG &a_Period )
  363. {
  364. m_Period = a_Period ;
  365. }
  366. WmiKey &GetKey ()
  367. {
  368. return m_Key ;
  369. }
  370. void SetKey ( const WmiKey &a_Key )
  371. {
  372. m_Key = a_Key ;
  373. }
  374. BOOL GetDecaying ()
  375. {
  376. return m_Decaying ;
  377. }
  378. BOOL GetDecayed ()
  379. {
  380. return m_Decayed ;
  381. }
  382. BOOL GetCached ()
  383. {
  384. return m_Cached ;
  385. }
  386. void SetDecayed ( BOOL a_Decayed )
  387. {
  388. m_Decayed = a_Decayed ;
  389. }
  390. void SetDecaying ( BOOL a_Decay )
  391. {
  392. m_Decaying = a_Decay ;
  393. }
  394. void SetCached ( BOOL a_Cached )
  395. {
  396. m_Cached = a_Cached ;
  397. }
  398. void SetController ( WmiCacheController <WmiKey> *a_Controller )
  399. {
  400. if ( m_Controller )
  401. {
  402. m_Controller->Release () ;
  403. }
  404. m_Controller = a_Controller ;
  405. if ( m_Controller )
  406. {
  407. m_Controller->AddRef () ;
  408. }
  409. }
  410. WmiCacheController <WmiKey> *GetController ()
  411. {
  412. return m_Controller ;
  413. }
  414. } ;
  415. typedef WmiAvlTree <WmiKey,WmiCacheElement *> Cache ;
  416. typedef typename Cache :: Iterator Cache_Iterator ;
  417. private:
  418. typedef WmiTreePriorityQueue <WmiUniqueTimeout,WmiCacheElement *> CacheDecay ;
  419. typedef typename CacheDecay :: Iterator CacheDecay_Iterator ;
  420. WmiAllocator &m_Allocator ;
  421. CriticalSection m_CriticalSection ;
  422. LONG m_ReferenceCount ;
  423. Cache m_Cache ;
  424. CacheDecay m_CacheDecay ;
  425. LONG m_Counter ;
  426. protected:
  427. public:
  428. WmiCacheController ( WmiAllocator &a_Allocator ) ;
  429. virtual ~WmiCacheController () ;
  430. virtual STDMETHODIMP QueryInterface ( REFIID , LPVOID FAR * ) ;
  431. virtual STDMETHODIMP_( ULONG ) AddRef () ;
  432. virtual STDMETHODIMP_( ULONG ) Release () ;
  433. virtual WmiStatusCode Initialize () ;
  434. virtual WmiStatusCode UnInitialize () ;
  435. virtual WmiStatusCode Lock () ;
  436. virtual WmiStatusCode UnLock () ;
  437. virtual WmiStatusCode Insert (
  438. WmiCacheElement &a_Element ,
  439. Cache_Iterator &a_Iterator
  440. ) ;
  441. virtual WmiStatusCode Find ( const WmiKey &a_Key , Cache_Iterator &a_Iterator ) ;
  442. virtual WmiStatusCode Shutdown () ;
  443. virtual WmiStatusCode Shutdown ( const WmiKey &a_Key ) ;
  444. virtual WmiStatusCode StrobeBegin ( const ULONG &a_Timeout ) ;
  445. virtual WmiStatusCode Strobe ( ULONG &a_NextStrobeDelta ) ;
  446. virtual WmiStatusCode Delete ( const WmiKey &a_Key ) ;
  447. virtual WmiStatusCode Decay (
  448. WmiCacheElement &a_Element
  449. ) ;
  450. WmiStatusCode GetCache ( Cache *&a_Cache )
  451. {
  452. a_Cache = & m_Cache ;
  453. return e_StatusCode_Success ;
  454. }
  455. CriticalSection* GetCriticalSection ()
  456. {
  457. return &m_CriticalSection ;
  458. }
  459. } ;
  460. /******************************************************************************
  461. *
  462. * Name:
  463. *
  464. *
  465. * Description:
  466. *
  467. *
  468. *****************************************************************************/
  469. template <class WmiKey>
  470. class WmiContainerController : public IUnknown
  471. {
  472. public:
  473. class WmiContainerElement : public IUnknown
  474. {
  475. private:
  476. LONG m_ReferenceCount ;
  477. LONG m_InternalReferenceCount ;
  478. LONG m_NonCylicReferenceCount ;
  479. BOOL m_Cached ;
  480. WmiContainerController <WmiKey> *m_Controller ;
  481. WmiKey m_Key ;
  482. ULONG m_CallBackInternalRelease ;
  483. public:
  484. WmiContainerElement () :
  485. m_ReferenceCount ( 0 ) ,
  486. m_InternalReferenceCount ( 0 ) ,
  487. m_NonCylicReferenceCount ( 0 ) ,
  488. m_Cached ( FALSE ) ,
  489. m_Controller ( NULL ) ,
  490. m_CallBackInternalRelease ( 1 )
  491. {
  492. }
  493. WmiContainerElement (
  494. WmiContainerController <WmiKey> *a_Controller ,
  495. const WmiKey &a_Key
  496. ) : m_ReferenceCount ( 0 ) ,
  497. m_InternalReferenceCount ( 0 ) ,
  498. m_NonCylicReferenceCount ( 0 ) ,
  499. m_Cached ( FALSE ) ,
  500. m_Controller ( a_Controller ) ,
  501. m_Key ( a_Key ) ,
  502. m_CallBackInternalRelease ( 1 )
  503. {
  504. if ( m_Controller )
  505. {
  506. m_Controller->AddRef () ;
  507. }
  508. }
  509. virtual ~WmiContainerElement ()
  510. {
  511. #ifdef DBG
  512. if ( m_ReferenceCount != 0 )
  513. {
  514. DebugBreak () ;
  515. }
  516. if ( m_InternalReferenceCount != 0 )
  517. {
  518. DebugBreak () ;
  519. }
  520. if ( m_NonCylicReferenceCount != 0 )
  521. {
  522. DebugBreak () ;
  523. }
  524. #endif
  525. if ( m_Controller )
  526. {
  527. m_Controller->Release () ;
  528. }
  529. }
  530. virtual void CallBackRelease () {} ;
  531. virtual void CallBackInternalRelease () {} ;
  532. virtual STDMETHODIMP QueryInterface ( REFIID , LPVOID FAR * )
  533. {
  534. return E_NOINTERFACE ;
  535. }
  536. virtual STDMETHODIMP_( ULONG ) AddRef ()
  537. {
  538. ULONG t_ReferenceCount = InterlockedIncrement ( & m_ReferenceCount ) ;
  539. if ( t_ReferenceCount == 1 )
  540. {
  541. InternalAddRef () ;
  542. }
  543. return t_ReferenceCount ;
  544. }
  545. virtual STDMETHODIMP_( ULONG ) Release ()
  546. {
  547. if ( m_Controller )
  548. {
  549. m_Controller->Lock () ;
  550. }
  551. LONG t_ReferenceCount = InterlockedDecrement ( & m_ReferenceCount ) ;
  552. if ( t_ReferenceCount == 0 )
  553. {
  554. CallBackRelease () ;
  555. if ( GetCached () )
  556. {
  557. LONG t_ReferenceCount = InterlockedDecrement ( & m_InternalReferenceCount ) ;
  558. }
  559. UnLockedInternalRelease () ;
  560. }
  561. else
  562. {
  563. #ifdef DBG
  564. if ( t_ReferenceCount < 0 )
  565. {
  566. DebugBreak () ;
  567. }
  568. #endif
  569. if ( m_Controller )
  570. {
  571. m_Controller->UnLock () ;
  572. }
  573. }
  574. return t_ReferenceCount ;
  575. }
  576. virtual STDMETHODIMP_( ULONG ) InternalAddRef ()
  577. {
  578. ULONG t_ReferenceCount = InterlockedIncrement ( & m_InternalReferenceCount ) ;
  579. if ( t_ReferenceCount == 1 )
  580. {
  581. NonCyclicAddRef () ;
  582. }
  583. return t_ReferenceCount ;
  584. }
  585. virtual STDMETHODIMP_( ULONG ) UnLockedInternalRelease ()
  586. {
  587. LONG t_ReferenceCount = InterlockedDecrement ( & m_InternalReferenceCount ) ;
  588. if ( t_ReferenceCount == 0 )
  589. {
  590. BOOL t_DoCallBack = m_CallBackInternalRelease ;
  591. m_CallBackInternalRelease = 0xbabab1ac ;
  592. if ( m_Controller )
  593. {
  594. m_Controller->Delete ( m_Key ) ;
  595. m_Controller->UnLock () ;
  596. }
  597. if ( t_DoCallBack == 1 )
  598. {
  599. CallBackInternalRelease () ;
  600. }
  601. NonCyclicRelease () ;
  602. }
  603. else
  604. {
  605. #ifdef DBG
  606. if ( t_ReferenceCount < 0 )
  607. {
  608. DebugBreak () ;
  609. }
  610. #endif
  611. if ( m_Controller )
  612. {
  613. m_Controller->UnLock () ;
  614. }
  615. }
  616. return t_ReferenceCount ;
  617. }
  618. virtual STDMETHODIMP_( ULONG ) InternalRelease ()
  619. {
  620. if ( m_Controller )
  621. {
  622. m_Controller->Lock () ;
  623. }
  624. LONG t_ReferenceCount = InterlockedDecrement ( & m_InternalReferenceCount ) ;
  625. if ( t_ReferenceCount == 0 )
  626. {
  627. BOOL t_DoCallBack = m_CallBackInternalRelease ;
  628. m_CallBackInternalRelease = 0xbabab1ac ;
  629. if ( m_Controller )
  630. {
  631. m_Controller->Delete ( m_Key ) ;
  632. m_Controller->UnLock () ;
  633. }
  634. if ( t_DoCallBack == 1 )
  635. {
  636. CallBackInternalRelease () ;
  637. }
  638. else
  639. {
  640. #ifdef DBG
  641. DebugBreak () ;
  642. #endif
  643. }
  644. NonCyclicRelease () ;
  645. }
  646. else
  647. {
  648. #ifdef DBG
  649. if ( t_ReferenceCount < 0 )
  650. {
  651. DebugBreak () ;
  652. }
  653. #endif
  654. if ( m_Controller )
  655. {
  656. m_Controller->UnLock () ;
  657. }
  658. }
  659. return t_ReferenceCount ;
  660. }
  661. virtual STDMETHODIMP_( ULONG ) NonCyclicAddRef ()
  662. {
  663. return InterlockedIncrement ( & m_NonCylicReferenceCount ) ;
  664. }
  665. virtual STDMETHODIMP_( ULONG ) NonCyclicRelease ()
  666. {
  667. ULONG t_ReferenceCount = InterlockedDecrement ( & m_NonCylicReferenceCount ) ;
  668. if ( t_ReferenceCount == 0 )
  669. {
  670. delete this ;
  671. }
  672. return t_ReferenceCount ;
  673. }
  674. BOOL GetCached ()
  675. {
  676. return m_Cached ;
  677. }
  678. void SetCached ( BOOL a_Cached )
  679. {
  680. m_Cached = a_Cached ;
  681. }
  682. WmiKey &GetKey ()
  683. {
  684. return m_Key ;
  685. }
  686. void SetKey ( const WmiKey &a_Key )
  687. {
  688. m_Key = a_Key ;
  689. }
  690. void SetController ( WmiContainerController <WmiKey> *a_Controller )
  691. {
  692. if ( m_Controller )
  693. {
  694. m_Controller->Release () ;
  695. }
  696. m_Controller = a_Controller ;
  697. if ( m_Controller )
  698. {
  699. m_Controller->AddRef () ;
  700. }
  701. }
  702. WmiContainerController <WmiKey> *GetController ()
  703. {
  704. return m_Controller ;
  705. }
  706. } ;
  707. typedef WmiAvlTree <WmiKey,WmiContainerElement *> Container ;
  708. typedef typename Container :: Iterator Container_Iterator ;
  709. private:
  710. LONG m_ReferenceCount ;
  711. CriticalSection m_CriticalSection ;
  712. Container m_Container ;
  713. protected:
  714. public:
  715. WmiContainerController ( WmiAllocator &a_Allocator ) ;
  716. virtual ~WmiContainerController () ;
  717. virtual STDMETHODIMP QueryInterface ( REFIID , LPVOID FAR * ) ;
  718. virtual STDMETHODIMP_( ULONG ) AddRef () ;
  719. virtual STDMETHODIMP_( ULONG ) Release () ;
  720. virtual WmiStatusCode Initialize () ;
  721. virtual WmiStatusCode UnInitialize () ;
  722. virtual WmiStatusCode Lock () ;
  723. virtual WmiStatusCode UnLock () ;
  724. virtual WmiStatusCode Insert (
  725. WmiContainerElement &a_Element ,
  726. Container_Iterator &a_Iterator
  727. ) ;
  728. virtual WmiStatusCode Find ( const WmiKey &a_Key , Container_Iterator &a_Iterator ) ;
  729. virtual WmiStatusCode Shutdown () ;
  730. virtual WmiStatusCode Delete ( const WmiKey &a_Key ) ;
  731. virtual WmiStatusCode Strobe ( ULONG &a_NextStrobeDelta ) ;
  732. WmiStatusCode GetContainer ( Container *&a_Container )
  733. {
  734. a_Container = & m_Container ;
  735. return e_StatusCode_Success ;
  736. }
  737. CriticalSection* GetCriticalSection ()
  738. {
  739. return &m_CriticalSection ;
  740. }
  741. } ;
  742. #include <Cache.cpp>
  743. #endif _Cache_H