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.

87 lines
1.9 KiB

  1. //=================================================================
  2. //
  3. // PowerManagement.h --
  4. //
  5. // Copyright (c) 1999-2001 Microsoft Corporation, All Rights Reserved
  6. //
  7. // Revisions: 03/31/99 a-peterc Created
  8. //
  9. //=================================================================
  10. #ifndef _WMI_SHUTDOWN_EVENT_PROVIDER_H
  11. #define _WMI_SHUTDOWN_EVENT_PROVIDER_H
  12. #include "FactoryRouter.h"
  13. #include "EventProvider.h"
  14. #include "WinMsgEvent.h"
  15. #define SHUTDOWN_EVENT_CLASS L"Win32_ComputerShutdownEvent"
  16. //
  17. class CShutdownEventFactory : public CFactoryRouter
  18. {
  19. private:
  20. protected:
  21. public:
  22. CShutdownEventFactory( REFGUID a_rClsId, LPCWSTR a_pClassName )
  23. : CFactoryRouter( a_rClsId, a_pClassName ) {} ;
  24. ~CShutdownEventFactory() {};
  25. // implementation of abstract CProviderClassFactory
  26. virtual IUnknown * CreateInstance (
  27. REFIID a_riid ,
  28. LPVOID FAR *a_ppvObject
  29. ) ;
  30. };
  31. //
  32. class CShutdownEvent :
  33. public CEventProvider,
  34. public CWinMsgEvent
  35. {
  36. private:
  37. void HandleEvent(
  38. UINT a_message,
  39. WPARAM a_wParam,
  40. LPARAM a_lParam ) ;
  41. BOOL m_bRegistered;
  42. protected:
  43. public:
  44. CShutdownEvent() : m_bRegistered( FALSE ) {};
  45. ~CShutdownEvent() {};
  46. // implementation of abstract CWinMsgEvent
  47. virtual void WinMsgEvent(
  48. IN HWND a_hWnd,
  49. IN UINT a_message,
  50. IN WPARAM a_wParam,
  51. IN LPARAM a_lParam,
  52. OUT E_ReturnAction &a_eRetAction,
  53. OUT LRESULT &a_lResult
  54. ) ;
  55. // implementation of abstract CEventProvider
  56. virtual void ProvideEvents() ;
  57. // implementation of abstract CEventProvider
  58. void OnFinalRelease();
  59. // implementation of class name retrieval for CEventProvider
  60. virtual BSTR GetClassName() ;
  61. BOOL fGetComputerName( LPWSTR lpwcsBuffer, LPDWORD nSize ) ;
  62. };
  63. #endif // _WMI_SHUTDOWN_EVENT_PROVIDER_H