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.

117 lines
4.0 KiB

  1. #ifndef __NmSysInfo_h__
  2. #define __NmSysInfo_h__
  3. #include "SDKInternal.h"
  4. #include "resource.h"
  5. /////////////////////////////////////////////////////////////////////////////
  6. // CNmSysInfoObj
  7. class ATL_NO_VTABLE CNmSysInfoObj :
  8. public CComObjectRootEx<CComSingleThreadModel>,
  9. public CComCoClass<CNmSysInfoObj, &CLSID_NmSysInfo>,
  10. public IConnectionPointContainerImpl<CNmSysInfoObj>,
  11. public IConnectionPointImpl<CNmSysInfoObj, &IID_INmSysInfoNotify, CComDynamicUnkArray>,
  12. public INmSysInfo2,
  13. public IMarshal
  14. {
  15. CComPtr<IInternalConfExe> m_spConfHook;
  16. public:
  17. DECLARE_REGISTRY_RESOURCEID(IDR_NMSYSINFO)
  18. DECLARE_NOT_AGGREGATABLE(CNmSysInfoObj)
  19. DECLARE_PROTECT_FINAL_CONSTRUCT()
  20. BEGIN_COM_MAP(CNmSysInfoObj)
  21. COM_INTERFACE_ENTRY(INmSysInfo)
  22. COM_INTERFACE_ENTRY(INmSysInfo2)
  23. COM_INTERFACE_ENTRY(IConnectionPointContainer)
  24. COM_INTERFACE_ENTRY(IMarshal)
  25. END_COM_MAP()
  26. BEGIN_CONNECTION_POINT_MAP(CNmSysInfoObj)
  27. CONNECTION_POINT_ENTRY(IID_INmSysInfoNotify)
  28. END_CONNECTION_POINT_MAP()
  29. HRESULT FinalConstruct();
  30. void FinalRelease();
  31. ///////////////////////////////////////////////
  32. // INmSysInfo methods
  33. STDMETHOD(IsInstalled)(void);
  34. STDMETHOD(GetProperty)(NM_SYSPROP uProp, BSTR *pbstrProp);
  35. STDMETHOD(SetProperty)(NM_SYSPROP uProp, BSTR bstrName);
  36. STDMETHOD(GetUserData)(REFGUID rguid, BYTE **ppb, ULONG *pcb);
  37. STDMETHOD(SetUserData)(REFGUID rguid, BYTE *pb, ULONG cb);
  38. STDMETHOD(GetNmApp)(REFGUID rguid,BSTR *pbstrApplication, BSTR *pbstrCommandLine, BSTR *pbstrDirectory);
  39. STDMETHOD(SetNmApp)(REFGUID rguid,BSTR bstrApplication, BSTR bstrCommandLine, BSTR bstrDirectory);
  40. STDMETHOD(GetNmchCaps)(ULONG *pchCaps);
  41. STDMETHOD(GetLaunchInfo)(INmConference **ppConference, INmMember **ppMember);
  42. ///////////////////////////////////////////////
  43. // INmSysInfo2 methods
  44. STDMETHOD(GetOption)(NM_SYSOPT uOption, ULONG * plValue);
  45. STDMETHOD(SetOption)(NM_SYSOPT uOption, ULONG lValue);
  46. STDMETHOD(ProcessSecurityData)(DWORD dwTaskCode, DWORD dwParam1, DWORD dwParam2, DWORD * pdwResult);
  47. STDMETHOD(GkLogon)(BSTR bstrAddr, BSTR bstrName, NM_ADDR_TYPE addrType);
  48. STDMETHOD(GkLogoff)();
  49. STDMETHOD(GkState)(NM_GK_STATE* plState);
  50. /////////////////////////////////////////////////////////////////////////////////
  51. // IMarshal methods
  52. STDMETHOD(GetUnmarshalClass)(
  53. /* [in] */ REFIID riid,
  54. /* [unique][in] */ void *pv,
  55. /* [in] */ DWORD dwDestContext,
  56. /* [unique][in] */ void *pvDestContext,
  57. /* [in] */ DWORD mshlflags,
  58. /* [out] */ CLSID *pCid) { *pCid = CLSID_NmSysInfo; return S_OK; };
  59. STDMETHOD(GetMarshalSizeMax)(
  60. /* [in] */ REFIID riid,
  61. /* [unique][in] */ void *pv,
  62. /* [in] */ DWORD dwDestContext,
  63. /* [unique][in] */ void *pvDestContext,
  64. /* [in] */ DWORD mshlflags,
  65. /* [out] */ DWORD *pSize) { *pSize = 0; return S_OK; }
  66. STDMETHOD(MarshalInterface)(
  67. /* [unique][in] */ IStream *pStm,
  68. /* [in] */ REFIID riid,
  69. /* [unique][in] */ void *pv,
  70. /* [in] */ DWORD dwDestContext,
  71. /* [unique][in] */ void *pvDestContext,
  72. /* [in] */ DWORD mshlflags) { return S_OK; }
  73. STDMETHOD(UnmarshalInterface)(
  74. /* [unique][in] */ IStream *pStm,
  75. /* [in] */ REFIID riid,
  76. /* [out] */ void **ppv);
  77. STDMETHOD(ReleaseMarshalData)(
  78. /* [unique][in] */ IStream *pStm) { return S_OK; }
  79. STDMETHOD(DisconnectObject)(
  80. /* [in] */ DWORD dwReserved) { return S_OK; }
  81. ///////////////////////////////////////////////
  82. // Notifications and callbacks
  83. public:
  84. ///////////////////////////////////////////////
  85. // Helper Fns
  86. HRESULT _EnsureConfHook(void);
  87. private:
  88. static bool _GetKeyDataForProp(NM_SYSPROP uProp, HKEY * phkey, LPTSTR * ppszSubKey, LPTSTR * ppszValue, bool *pfString);
  89. static void _GetSzKeyForGuid(LPTSTR psz, REFGUID rguid);
  90. };
  91. #endif // __NmSysInfo_h__