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.

77 lines
1.6 KiB

  1. //=================================================================
  2. //
  3. // VolumeChange.h --
  4. //
  5. // Copyright (c) 2000-2001 Microsoft Corporation, All Rights Reserved
  6. //
  7. //=================================================================
  8. #pragma once
  9. #include "FactoryRouter.h"
  10. #include "EventProvider.h"
  11. #include "WinMsgEvent.h"
  12. #include <dbt.h>
  13. #define VOLUME_CHANGE_EVENT L"Win32_VolumeChangeEvent"
  14. //
  15. class CVolumeChangeFactory : public CFactoryRouter
  16. {
  17. private:
  18. protected:
  19. public:
  20. CVolumeChangeFactory( REFGUID a_rClsId, LPCWSTR a_pClassName )
  21. : CFactoryRouter( a_rClsId, a_pClassName ) {} ;
  22. ~CVolumeChangeFactory() {};
  23. // implementation of abstract CProviderClassFactory
  24. virtual IUnknown * CreateInstance (
  25. REFIID a_riid ,
  26. LPVOID FAR *a_ppvObject
  27. ) ;
  28. };
  29. //
  30. class CVolumeChangeEvent :
  31. public CEventProvider,
  32. public CWinMsgEvent
  33. {
  34. private:
  35. void HandleEvent( WPARAM wParam, DEV_BROADCAST_VOLUME *pVol );
  36. BOOL m_bRegistered;
  37. protected:
  38. public:
  39. CVolumeChangeEvent() : m_bRegistered ( FALSE ) {};
  40. ~CVolumeChangeEvent() {};
  41. // implementation of abstract CWinMsgEvent
  42. virtual void WinMsgEvent(
  43. IN HWND a_hWnd,
  44. IN UINT a_message,
  45. IN WPARAM a_wParam,
  46. IN LPARAM a_lParam,
  47. OUT E_ReturnAction &a_eRetAction,
  48. OUT LRESULT &a_lResult
  49. ) ;
  50. // implementation of abstract CWmiEventProvider
  51. virtual void ProvideEvents() ;
  52. // implementation of class name retrieval for CEventProvider
  53. virtual void OnFinalRelease() ;
  54. // implementation of class name retrieval for CWmiProviderInit
  55. virtual BSTR GetClassName() ;
  56. };