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.

57 lines
1.7 KiB

  1. #pragma once
  2. #include "nmbase.h"
  3. #include "nmres.h"
  4. #include "upnp.h"
  5. #include "upnpp.h"
  6. #include "cmsaclbk.h"
  7. #include "hnetbcon.h"
  8. #include "winsock2.h"
  9. class ATL_NO_VTABLE CSharedAccessConnectionManager :
  10. public CComObjectRootEx <CComMultiThreadModel>,
  11. public CComCoClass <CSharedAccessConnectionManager,
  12. &CLSID_SharedAccessConnectionManager>,
  13. public IConnectionPointContainerImpl <CSharedAccessConnectionManager>,
  14. public INetConnectionManager,
  15. public ISharedAccessBeaconFinder
  16. {
  17. public:
  18. CSharedAccessConnectionManager();
  19. DECLARE_CLASSFACTORY_DEFERRED_SINGLETON(CSharedAccessConnectionManager)
  20. DECLARE_REGISTRY_RESOURCEID(IDR_SA_CONMAN)
  21. BEGIN_COM_MAP(CSharedAccessConnectionManager)
  22. COM_INTERFACE_ENTRY(INetConnectionManager)
  23. COM_INTERFACE_ENTRY_IMPL(IConnectionPointContainer)
  24. COM_INTERFACE_ENTRY(ISharedAccessBeaconFinder)
  25. END_COM_MAP()
  26. BEGIN_CONNECTION_POINT_MAP(CSharedAccessConnectionManager)
  27. END_CONNECTION_POINT_MAP()
  28. // INetConnectionManager
  29. STDMETHODIMP EnumConnections(NETCONMGR_ENUM_FLAGS Flags, IEnumNetConnection** ppEnum);
  30. // IBeaconFinder
  31. STDMETHODIMP GetSharedAccessBeacon(BSTR DeviceId, ISharedAccessBeacon** ppSharedAccessBeacon);
  32. HRESULT FinalConstruct(void);
  33. HRESULT FinalRelease(void);
  34. private:
  35. VOID static CALLBACK AsyncStartSearching(PVOID lpParameter, BOOLEAN TimerOrWaitFired);
  36. HRESULT StartSearch(void);
  37. LONG m_lSearchCookie;
  38. IUPnPDeviceFinder* m_pDeviceFinder;
  39. CComObject<CSharedAccessDeviceFinderCallback>* m_pDeviceFinderCallback;
  40. WSAEVENT m_SocketEvent;
  41. HANDLE m_hSocketNotificationWait;
  42. SOCKET m_DummySocket;
  43. };