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.

79 lines
1.9 KiB

  1. /*++
  2. Copyright (C) 1996-2001 Microsoft Corporation
  3. Module Name:
  4. UNLOAD.H
  5. Abstract:
  6. Unloading helper.
  7. History:
  8. --*/
  9. #ifndef _WBEM_UNLOAD__H_
  10. #define _WBEM_UNLOAD__H_
  11. #include <tss.h>
  12. #include <wstring.h>
  13. #include <wbemidl.h>
  14. class POLARITY CBasicUnloadInstruction : public CTimerInstruction
  15. {
  16. protected:
  17. long m_lRef;
  18. BOOL m_bTerminate;
  19. CWbemInterval m_Interval;
  20. CCritSec m_cs;
  21. protected:
  22. CBasicUnloadInstruction() : m_lRef(0), m_bTerminate(FALSE){}
  23. public:
  24. CBasicUnloadInstruction(CWbemInterval Interval);
  25. virtual ~CBasicUnloadInstruction(){}
  26. void AddRef(){InterlockedIncrement(&m_lRef);}
  27. void Release(){LONG lRef = InterlockedDecrement(&m_lRef); if(0 == lRef) delete this;}
  28. int GetInstructionType() {return INSTTYPE_UNLOAD;}
  29. void SetInterval(CWbemInterval & Interval){m_Interval = Interval;};
  30. static CWbemInterval staticRead(IWbemServices* pRoot,
  31. IWbemContext* pContext, LPCWSTR wszPath);
  32. virtual HRESULT Fire(long lNumTimes, CWbemTime NextFiringTime) = 0;
  33. CWbemTime GetNextFiringTime(CWbemTime LastFiringTime,
  34. OUT long* plFiringCount) const;
  35. CWbemTime GetFirstFiringTime() const;
  36. void Terminate();
  37. };
  38. class POLARITY CUnloadInstruction : public CBasicUnloadInstruction
  39. {
  40. protected:
  41. BSTR m_strPath;
  42. IWbemContext* m_pFirstContext;
  43. IWbemServices* m_pNamespace;
  44. public:
  45. CUnloadInstruction(LPCWSTR wszPath, IWbemContext* pFirstContext);
  46. virtual ~CUnloadInstruction();
  47. const BSTR GetPath(){return m_strPath;};
  48. virtual void Reread(IWbemContext* pContext = NULL);
  49. virtual HRESULT Fire(long lNumTimes, CWbemTime NextFiringTime) = 0;
  50. CWbemTime GetFirstFiringTime() const;
  51. static void Clear();
  52. void SetToDefault();
  53. };
  54. #endif