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.

62 lines
1.5 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 2000.
  5. //
  6. // File: C O N T A I N E R . H
  7. //
  8. // Contents: Serves as container for device host objects.
  9. //
  10. // Notes:
  11. //
  12. // Author: mbend 6 Sep 2000
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #include "ucres.h" // main symbols
  17. #include "hostp.h"
  18. // Typedefs
  19. /////////////////////////////////////////////////////////////////////////////
  20. // TestObject
  21. class ATL_NO_VTABLE CContainer :
  22. public CComObjectRootEx<CComMultiThreadModel>,
  23. public CComCoClass<CContainer, &CLSID_UPnPContainer>,
  24. public IUPnPContainer
  25. {
  26. public:
  27. CContainer();
  28. ~CContainer();
  29. DECLARE_REGISTRY_RESOURCEID(IDR_CONTAINER)
  30. DECLARE_NOT_AGGREGATABLE(CContainer)
  31. BEGIN_COM_MAP(CContainer)
  32. COM_INTERFACE_ENTRY(IUPnPContainer)
  33. END_COM_MAP()
  34. public:
  35. // IUPnPContainer methods
  36. STDMETHOD(CreateInstance)(
  37. /*[in]*/ REFCLSID clsid,
  38. /*[in]*/ REFIID riid,
  39. /*[out, iid_is(riid)]*/ void ** ppv);
  40. STDMETHOD(Shutdown)();
  41. STDMETHOD(SetParent)(
  42. /*[in]*/ DWORD pid);
  43. static void DoNormalShutdown();
  44. private:
  45. static HANDLE s_hThreadShutdown;
  46. static HANDLE s_hEventShutdown;
  47. static HANDLE s_hProcessDiedWait;
  48. static HANDLE s_hParentProc;
  49. static DWORD WINAPI ShutdownThread(void*);
  50. static VOID WINAPI KillThread(void*, BOOLEAN);
  51. };