Source code of Windows XP (NT5)
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.

59 lines
2.1 KiB

  1. #pragma once
  2. #include "nmbase.h"
  3. #include "upnpp.h"
  4. class ATL_NO_VTABLE CSharedAccessDeviceFinderCallback :
  5. public CComObjectRootEx <CComMultiThreadModel>,
  6. public IUPnPDeviceFinderCallback,
  7. public IUPnPDeviceFinderAddCallbackWithInterface
  8. {
  9. public:
  10. BEGIN_COM_MAP(CSharedAccessDeviceFinderCallback)
  11. COM_INTERFACE_ENTRY(IUPnPDeviceFinderCallback)
  12. COM_INTERFACE_ENTRY(IUPnPDeviceFinderAddCallbackWithInterface)
  13. END_COM_MAP()
  14. CSharedAccessDeviceFinderCallback();
  15. // IUPnPDeviceFinderCallback
  16. STDMETHOD (DeviceAdded)(LONG lFindData, IUPnPDevice* pDevice);
  17. STDMETHOD (DeviceRemoved)(LONG lFindData, BSTR bstrUDN);
  18. STDMETHOD (SearchComplete)(LONG lFindData);
  19. // IUPnPDeviceFinderCallbackWithInterface
  20. STDMETHODIMP DeviceAddedWithInterface(LONG lFindData, IUPnPDevice* pDevice, GUID* pguidInterface);
  21. HRESULT GetSharedAccessBeacon(BSTR DeviceId, ISharedAccessBeacon** ppSharedAccessBeacon);
  22. HRESULT FinalRelease();
  23. private:
  24. HRESULT FindService(IUPnPDevice* pDevice, LPWSTR pszServiceName, IUPnPService** ppICSService);
  25. HRESULT FindDevice(IUPnPDevices* pDevices, LPWSTR pszDeviceType, IUPnPDevice** ppChildDevice);
  26. HRESULT FindChildDevice(IUPnPDevice* pDevice, LPWSTR pszDeviceType, IUPnPDevice** ppChildDevice);
  27. HRESULT GetServices(IUPnPDevice* pDevice, GUID* pInterfaceGUID, ISharedAccessBeacon** ppSharedAccessBeacon);
  28. HRESULT IsServiceMatch(IUPnPService* pService, BSTR SearchCriteria, BOOL* pbMatch);
  29. HRESULT GetStringStateVariable(IUPnPService* pService, LPWSTR pszVariableName, BSTR* pString);
  30. ISharedAccessBeacon* m_pSharedAccessBeacon;
  31. };
  32. class ATL_NO_VTABLE CSharedAccessConnectionEventSink :
  33. public CComObjectRootEx <CComMultiThreadModel>,
  34. public IUPnPServiceCallback
  35. {
  36. public:
  37. BEGIN_COM_MAP(CSharedAccessConnectionEventSink)
  38. COM_INTERFACE_ENTRY(IUPnPServiceCallback)
  39. END_COM_MAP()
  40. STDMETHODIMP StateVariableChanged(IUPnPService *pus, LPCWSTR pcwszStateVarName, VARIANT vaValue);
  41. STDMETHODIMP ServiceInstanceDied(IUPnPService *pus);
  42. private:
  43. IUPnPServiceCallback* m_pSink;
  44. };