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.

201 lines
6.4 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corporation **/
  4. /**********************************************************************/
  5. /*
  6. dialin.h
  7. Class CRASDialin definition. This class implements COM interfaces:
  8. IUnknown
  9. IShellExtInit, IShellPropSheetExt
  10. -- to extend User object's property sheet,
  11. IRasDialin -- currently, no method is implemented, it'll be useful
  12. when part of the UI need to be reused
  13. FILE HISTORY:
  14. 12/15/97 Modified WeiJiang -- localsec snapin in User node extension
  15. */
  16. #ifndef __RASDIALIN_H_
  17. #define __RASDIALIN_H_
  18. #include <rtutils.h>
  19. #include "resource.h" // main symbols
  20. #include "helper.h"
  21. #include "iastrace.h"
  22. EXTERN_C const CLSID CLSID_RasDialin;
  23. class CDlgRASDialin;
  24. class CDlgRASDialinMerge;
  25. #ifdef SINGLE_SDO_CONNECTION // for share the same sdo connection for multiple users
  26. extern LONG g_lComponentDataSessions;
  27. #endif
  28. #define ByteOffset(base, offset) (((LPBYTE)base)+offset)
  29. class CDoNothingComponent :
  30. public CComObjectRoot,
  31. public IComponent
  32. {
  33. public:
  34. BEGIN_COM_MAP(CDoNothingComponent)
  35. COM_INTERFACE_ENTRY(IComponent)
  36. END_COM_MAP()
  37. // IComponent
  38. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Initialize(
  39. /* [in] */ LPCONSOLE lpConsole) SAYOK;
  40. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Notify(
  41. /* [in] */ LPDATAOBJECT lpDataObject,
  42. /* [in] */ MMC_NOTIFY_TYPE event,
  43. /* [in] */ LPARAM arg,
  44. /* [in] */ LPARAM param) SAYOK;
  45. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Destroy(
  46. /* [in] */ MMC_COOKIE cookie) SAYOK;
  47. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE QueryDataObject(
  48. /* [in] */ MMC_COOKIE cookie,
  49. /* [in] */ DATA_OBJECT_TYPES type,
  50. /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject) NOIMP;
  51. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetResultViewType(
  52. /* [in] */ MMC_COOKIE cookie,
  53. /* [out] */ LPOLESTR __RPC_FAR *ppViewType,
  54. /* [out] */ long __RPC_FAR *pViewOptions) NOIMP;
  55. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDisplayInfo(
  56. /* [out][in] */ RESULTDATAITEM __RPC_FAR *pResultDataItem) NOIMP;
  57. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CompareObjects(
  58. /* [in] */ LPDATAOBJECT lpDataObjectA,
  59. /* [in] */ LPDATAOBJECT lpDataObjectB) SAYOK;
  60. };
  61. /////////////////////////////////////////////////////////////////////////////
  62. // CRasDialin
  63. //class ATL_NO_VTABLE CRasDialin :
  64. class CRasDialin :
  65. public CComObjectRoot,
  66. public CComCoClass<CRasDialin, &CLSID_RasDialin>,
  67. public IShellExtInit, // shell property page extension -- DS user
  68. public IShellPropSheetExt, // shell property page extension -- DS user
  69. #ifdef SINGLE_SDO_CONNECTION // for share the same sdo connection for multiple users
  70. public IComponentData,
  71. #endif
  72. public IExtendPropertySheet, // Snapin node property page extension
  73. private IASTraceInitializer
  74. {
  75. public:
  76. CRasDialin();
  77. virtual ~CRasDialin();
  78. BEGIN_COM_MAP(CRasDialin)
  79. COM_INTERFACE_ENTRY(IShellExtInit)
  80. COM_INTERFACE_ENTRY(IShellPropSheetExt)
  81. COM_INTERFACE_ENTRY(IExtendPropertySheet)
  82. #ifdef SINGLE_SDO_CONNECTION // for share the same sdo connection for multiple users
  83. COM_INTERFACE_ENTRY(IComponentData)
  84. #endif
  85. END_COM_MAP()
  86. // IRasDialin
  87. public:
  88. //IShellExtInit methods
  89. STDMETHODIMP Initialize(LPCITEMIDLIST pIDFolder, LPDATAOBJECT pDataObj, HKEY hKeyID);
  90. //IShellPropSheetExt methods
  91. STDMETHODIMP AddPages(LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam);
  92. STDMETHODIMP ReplacePage(UINT uPageID, LPFNADDPROPSHEETPAGE lpfnReplaceWith, LPARAM lParam);
  93. // IExtendPropertySheet :: added by WeiJiang 12/15/97 to support local sec extension
  94. STDMETHOD(CreatePropertyPages)(LPPROPERTYSHEETCALLBACK lpProvider,
  95. LONG_PTR handle, LPDATAOBJECT lpIDataObject);
  96. STDMETHOD(QueryPagesFor)(LPDATAOBJECT lpDataObject);
  97. DECLARE_REGISTRY(CRasDialin, _T("RasDialin.UserAdminExt.1"), _T("RasDialin.UserAdminExt"), 0, THREADFLAGS_APARTMENT)
  98. virtual const CLSID & GetCoClassID(){ return CLSID_RasDialin; };
  99. #ifdef SINGLE_SDO_CONNECTION // for share the same sdo connection for multiple users
  100. // IComponentData
  101. STDMETHOD(Initialize)(/* [in] */ LPUNKNOWN pUnknown)
  102. {
  103. InterlockedIncrement(&g_lComponentDataSessions);
  104. return S_OK;
  105. };
  106. STDMETHOD(CreateComponent)(/* [out] */ LPCOMPONENT __RPC_FAR *ppComponent)
  107. {
  108. CComObject<CDoNothingComponent>* pComp = NULL;
  109. HRESULT hr = S_OK;
  110. hr = CComObject<CDoNothingComponent>::CreateInstance(&pComp);
  111. if(hr == S_OK && pComp)
  112. {
  113. hr = pComp->QueryInterface(IID_IComponent, (void**)ppComponent);
  114. }
  115. return hr;
  116. };
  117. STDMETHOD(Notify)(
  118. /* [in] */ LPDATAOBJECT lpDataObject,
  119. /* [in] */ MMC_NOTIFY_TYPE event,
  120. /* [in] */ LPARAM arg,
  121. /* [in] */ LPARAM param) SAYOK;
  122. STDMETHOD(Destroy)( void)
  123. {
  124. LONG l = InterlockedDecrement(&g_lComponentDataSessions);
  125. if (l == 0)
  126. {
  127. delete g_pSdoServerPool;
  128. g_pSdoServerPool = NULL;
  129. }
  130. ASSERT(l >= 0);
  131. return S_OK;
  132. };
  133. STDMETHOD(QueryDataObject)(
  134. /* [in] */ MMC_COOKIE cookie,
  135. /* [in] */ DATA_OBJECT_TYPES type,
  136. /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject) NOIMP;
  137. STDMETHOD(GetDisplayInfo)(
  138. /* [out][in] */ SCOPEDATAITEM __RPC_FAR *pScopeDataItem) NOIMP;
  139. STDMETHOD(CompareObjects)(
  140. /* [in] */ LPDATAOBJECT lpDataObjectA,
  141. /* [in] */ LPDATAOBJECT lpDataObjectB) NOIMP;
  142. #endif
  143. #ifdef _REGDS
  144. // registration of user object extension
  145. // only for testing purpose, retail version will have these information
  146. // register by setup program
  147. static HRESULT RegisterAdminPropertyPage(bool bRegister);
  148. #endif
  149. LPWSTR m_pwszObjName;
  150. LPWSTR m_pwszClass;
  151. CDlgRASDialin* m_pPage;
  152. CDlgRASDialinMerge* m_pMergedPage;
  153. STGMEDIUM m_ObjMedium;
  154. BOOL m_bShowPage;
  155. };
  156. #endif //__RASDIALIN_H_