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.

55 lines
2.1 KiB

  1. #pragma once
  2. #include "InternetGatewayDevice.h"
  3. #include "dispimpl2.h"
  4. #include "resource.h" // main symbols
  5. #include "upnphost.h"
  6. #include "hnetcfg.h"
  7. class ATL_NO_VTABLE CNATStaticPortMappingService :
  8. public CComObjectRootEx<CComMultiThreadModel>,
  9. public IDelegatingDispImpl<INATStaticPortMappingService>,
  10. public IUPnPEventSource
  11. {
  12. public:
  13. DECLARE_REGISTRY_RESOURCEID(IDR_SAMPLE_DEVICE)
  14. DECLARE_PROTECT_FINAL_CONSTRUCT()
  15. BEGIN_COM_MAP(CNATStaticPortMappingService)
  16. COM_INTERFACE_ENTRY(INATStaticPortMappingService)
  17. COM_INTERFACE_ENTRY(IDispatch)
  18. COM_INTERFACE_ENTRY(IUPnPEventSource)
  19. END_COM_MAP()
  20. CNATStaticPortMappingService();
  21. // IUPnPEventSource methods
  22. STDMETHODIMP Advise(IUPnPEventSink* pesSubscriber);
  23. STDMETHODIMP Unadvise(IUPnPEventSink* pesSubscriber);
  24. // INATStaticPortMappingService
  25. STDMETHODIMP get_StaticPortDescriptionList(BSTR* pStaticPortDescriptionList);
  26. STDMETHODIMP get_StaticPort(ULONG* pulStaticPort);
  27. STDMETHODIMP get_StaticPortProtocol(BSTR* pStaticPortProtocol);
  28. STDMETHODIMP get_StaticPortClient(BSTR* pStaticPortClient);
  29. STDMETHODIMP get_StaticPortEnable(VARIANT_BOOL* pbStaticPortEnable);
  30. STDMETHODIMP get_StaticPortDescription(BSTR* pStaticPortDescription);
  31. STDMETHODIMP GetStaticPortMappingList(BSTR* pStaticPortMappingList);
  32. STDMETHODIMP GetStaticPortMapping(BSTR StaticPortMappingDescription, ULONG* pulStaticPort, BSTR* pStaticPortClient, BSTR* pStaticPortProtocol);
  33. STDMETHODIMP SetStaticPortMappingEnabled(BSTR StaticPortMappingDescription, VARIANT_BOOL bStaticPortEnable);
  34. STDMETHODIMP CreateStaticPortMapping(BSTR StaticPortMappingDescription, ULONG ulStaticPort, BSTR StaticPortClient, BSTR StaticPortProtocol);
  35. STDMETHODIMP DeleteStaticPortMapping(BSTR StaticPortMappingDescription);
  36. STDMETHODIMP SetStaticPortMapping(BSTR StaticPortMappingDescription, ULONG ulStaticPort, BSTR StaticPortClient, BSTR StaticPortProtocol);
  37. HRESULT FinalConstruct();
  38. HRESULT FinalRelease();
  39. HRESULT Initialize(IHNetConnection* pHNetConnection);
  40. private:
  41. IUPnPEventSink* m_pEventSink;
  42. IHNetConnection* m_pHNetConnection;
  43. };