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.

51 lines
1.4 KiB

  1. #pragma once
  2. #include "InternetGatewayDevice.h"
  3. #include "dispimpl2.h"
  4. #include "resource.h" // main symbols
  5. #include "upnphost.h"
  6. /////////////////////////////////////////////////////////////////////////////
  7. // COSInfoService
  8. class ATL_NO_VTABLE COSInfoService :
  9. public CComObjectRootEx<CComMultiThreadModel>,
  10. public IDelegatingDispImpl<IOSInfoService>,
  11. public IUPnPEventSource
  12. {
  13. public:
  14. DECLARE_REGISTRY_RESOURCEID(IDR_SAMPLE_DEVICE)
  15. DECLARE_PROTECT_FINAL_CONSTRUCT()
  16. BEGIN_COM_MAP(COSInfoService)
  17. COM_INTERFACE_ENTRY(IOSInfoService)
  18. COM_INTERFACE_ENTRY(IDispatch)
  19. COM_INTERFACE_ENTRY(IUPnPEventSource)
  20. END_COM_MAP()
  21. public:
  22. COSInfoService();
  23. // IUPnPEventSource methods
  24. STDMETHODIMP Advise(IUPnPEventSink *pesSubscriber);
  25. STDMETHODIMP Unadvise(IUPnPEventSink *pesSubscriber);
  26. // IOSInfo methods
  27. STDMETHODIMP get_OSMajorVersion(LONG *pOSMajorVersion);
  28. STDMETHODIMP get_OSMinorVersion(LONG *pOSMinorVersion);
  29. STDMETHODIMP get_OSBuildNumber(LONG *pOSBuildNumber);
  30. STDMETHODIMP get_OSMachineName(BSTR* pOSMachineName);
  31. STDMETHODIMP MagicOn( void);
  32. HRESULT FinalConstruct(void);
  33. HRESULT FinalRelease(void);
  34. private:
  35. IUPnPEventSink* m_pEventSink;
  36. VARIANT_BOOL m_vbMagic;
  37. OSVERSIONINFOEX m_OSVersionInfo;
  38. BSTR m_MachineName;
  39. };