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.

721 lines
23 KiB

  1. //+----------------------------------------------------------------------------
  2. //
  3. // Windows NT Active Directory Service Property Pages
  4. //
  5. // Microsoft Windows
  6. // Copyright (C) Microsoft Corporation, 1992 - 1999
  7. //
  8. // File: proppage.h
  9. //
  10. // Contents: DS object property pages class header
  11. //
  12. // Classes: CDsPropPagesHost, CDsPropPagesHostCF, CDsTableDrivenPage
  13. //
  14. // History: 21-March-97 EricB created
  15. //
  16. //-----------------------------------------------------------------------------
  17. #ifndef _PROPPAGE_H_
  18. #define _PROPPAGE_H_
  19. #include "adsprop.h"
  20. #include "pages.h"
  21. #include "strings.h"
  22. #include "notify.h"
  23. #define DSPROP_HELP_FILE_NAME TEXT("adprop.hlp")
  24. #define ADM_S_SKIP MAKE_HRESULT(SEVERITY_SUCCESS, 0, (PSNRET_INVALID_NOCHANGEPAGE + 2))
  25. #define DSPROP_DESCRIPTION_RANGE_UPPER 1024
  26. struct _DSPAGE; // forward declaration.
  27. class CDsPropPagesHost; // forward declaration.
  28. class CDsPropPageBase; // forward declaration.
  29. // Prototype for page creation function. The function should return S_FALSE if
  30. // the page shouldn't be created due to a non-error condition.
  31. //
  32. typedef HRESULT (*CREATE_PAGE)(struct _DSPAGE * pDsPage, LPDATAOBJECT pDataObj,
  33. PWSTR pwzObjDN, PWSTR pwszObjName,
  34. HWND hNotifyWnd, DWORD dwFlags,
  35. CDSBasePathsInfo* pBasePathsInfo,
  36. HPROPSHEETPAGE * phPage);
  37. typedef enum _DlgOp {
  38. fInit = 0,
  39. fApply,
  40. fOnCommand,
  41. fOnNotify,
  42. fOnDestroy,
  43. fOnCallbackRelease,
  44. fObjChanged,
  45. fAttrChange,
  46. fQuerySibling,
  47. fOnSetActive,
  48. fOnKillActive
  49. } DLG_OP;
  50. //+----------------------------------------------------------------------------
  51. //
  52. // Struct: ATTR_DATA
  53. //
  54. // Purpose: Per-Attribute data. The ATTR_DATA_WRITABLE bit is set if the
  55. // corresponding attribute is found in the Allowed-Attributes-
  56. // Effective list. The pAttrData struct pointer is passed to the
  57. // attr function where it can use the pVoid member for its private
  58. // storage needs.
  59. //
  60. //-----------------------------------------------------------------------------
  61. typedef struct _ATTR_DATA {
  62. DWORD dwFlags;
  63. LPARAM pVoid;
  64. } ATTR_DATA, * PATTR_DATA;
  65. #define ATTR_DATA_WRITABLE (0x00000001)
  66. #define ATTR_DATA_DIRTY (0x00000002)
  67. #define ATTR_DATA_IS_WRITABLE(ad) (ad.dwFlags & ATTR_DATA_WRITABLE)
  68. #define PATTR_DATA_IS_WRITABLE(pad) (pad->dwFlags & ATTR_DATA_WRITABLE)
  69. #define ATTR_DATA_IS_DIRTY(ad) (ad.dwFlags & ATTR_DATA_DIRTY)
  70. #define PATTR_DATA_IS_DIRTY(pad) (pad->dwFlags & ATTR_DATA_DIRTY)
  71. #define ATTR_DATA_SET_WRITABLE(ad) (ad.dwFlags |= ATTR_DATA_WRITABLE)
  72. #define PATTR_DATA_SET_WRITABLE(pad) (pad->dwFlags |= ATTR_DATA_WRITABLE)
  73. #define ATTR_DATA_CLEAR_WRITABLE(ad) (ad.dwFlags &= ~ATTR_DATA_WRITABLE)
  74. #define PATTR_DATA_CLEAR_WRITABLE(pad) (pad->dwFlags &= ~ATTR_DATA_WRITABLE)
  75. #define ATTR_DATA_SET_DIRTY(ad) (ad.dwFlags |= ATTR_DATA_DIRTY)
  76. #define PATTR_DATA_SET_DIRTY(pad) (pad->dwFlags |= ATTR_DATA_DIRTY)
  77. #define ATTR_DATA_CLEAR_DIRTY(ad) (ad.dwFlags &= ~ATTR_DATA_DIRTY)
  78. #define PATTR_DATA_CLEAR_DIRTY(pad) (pad->dwFlags &= ~ATTR_DATA_DIRTY)
  79. struct _ATTR_MAP; // forward declaration.
  80. typedef HRESULT (*PATTR_FCN)(CDsPropPageBase *, struct _ATTR_MAP *,
  81. PADS_ATTR_INFO, LPARAM, PATTR_DATA, DLG_OP);
  82. //+----------------------------------------------------------------------------
  83. //
  84. // Struct: ATTR_MAP
  85. //
  86. // Purpose: For each attribute on a property page, relates the control
  87. // ID, the attribute name and the attribute type.
  88. //
  89. // Notes: The standard table-driven processing assumes that nCtrlID is
  90. // valid unless pAttrFcn is defined, in which case the attr
  91. // function may choose to hard code the control ID.
  92. //
  93. //-----------------------------------------------------------------------------
  94. typedef struct _ATTR_MAP {
  95. int nCtrlID; // Control resource ID
  96. BOOL fIsReadOnly;
  97. BOOL fIsMultiValued; // From schema.ini: Is-Single-Valued
  98. DWORD nSizeLimit;
  99. ADS_ATTR_INFO AttrInfo;
  100. PATTR_FCN pAttrFcn; // Optional function pointer.
  101. PVOID pData;
  102. } ATTR_MAP, * PATTR_MAP;
  103. //+----------------------------------------------------------------------------
  104. //
  105. // Struct: DSPAGE
  106. //
  107. // Purpose: For each property page, lists the page title resource ID, the
  108. // page dialog templage ID, flags, the count and list of CLSIDs
  109. // for which this page should be shown, a pointer to a
  110. // page-class-specific creation function, and the count and list
  111. // of attributes. If nCLSIDs is zero, then the page should always
  112. // be shown.
  113. //
  114. //-----------------------------------------------------------------------------
  115. typedef struct _DSPAGE {
  116. int nPageTitle;
  117. int nDlgTemplate;
  118. DWORD dwFlags;
  119. DWORD nCLSIDs;
  120. const CLSID * rgCLSID;
  121. CREATE_PAGE pCreateFcn;
  122. DWORD cAttrs;
  123. PATTR_MAP * rgpAttrMap;
  124. } DSPAGE, * PDSPAGE;
  125. //+----------------------------------------------------------------------------
  126. //
  127. // Struct: DSCLASSPAGES
  128. //
  129. // Purpose: For each CLSID, lists the prog ID, the number of pages, and the
  130. // list of pages.
  131. //
  132. //-----------------------------------------------------------------------------
  133. typedef struct _DSCLASSPAGES {
  134. const CLSID * pcid;
  135. LPTSTR szProgID;
  136. DWORD cPages;
  137. PDSPAGE * rgpDsPages;
  138. } DSCLASSPAGES, * PDSCLASSPAGES;
  139. //+----------------------------------------------------------------------------
  140. //
  141. // Struct: RGDSPPCLASSES
  142. //
  143. // Purpose: Contains the count and list of classes supported by this DLL.
  144. //
  145. //-----------------------------------------------------------------------------
  146. typedef struct _RGDSPPCLASSES {
  147. int cClasses;
  148. PDSCLASSPAGES * rgpClass;
  149. } RGDSPPCLASSES, * PRGDSPPCLASSES;
  150. // Table driven page creation function.
  151. //
  152. HRESULT
  153. CreateTableDrivenPage(PDSPAGE pDsPage, LPDATAOBJECT pDataObj,
  154. PWSTR pwzADsPath, PWSTR pwzObjName,
  155. HWND hNotifyWnd, DWORD dwFlags,
  156. CDSBasePathsInfo* pBasePathsInfo, HPROPSHEETPAGE * phPage);
  157. /*
  158. HRESULT
  159. CreateScheduleObjPage(PDSPAGE pDsPage, LPDATAOBJECT pDataObj,
  160. LPWSTR pwszObjName, LPWSTR pwszClass,
  161. HWND hNotifyWnd, DWORD dwFlags, HPROPSHEETPAGE * phPage);
  162. */
  163. // Object page attribute function for object class.
  164. //
  165. HRESULT
  166. GetObjectClass(CDsPropPageBase * pPage, PATTR_MAP pAttrMap,
  167. PADS_ATTR_INFO pAttrInfo, LPARAM lParam, PATTR_DATA pAttrData,
  168. DLG_OP DlgOp);
  169. // Object page attribute function for object timestamps.
  170. //
  171. HRESULT
  172. GetObjectTimestamp(CDsPropPageBase * pPage, PATTR_MAP pAttrMap,
  173. PADS_ATTR_INFO pAttrInfo, LPARAM lParam, PATTR_DATA pAttrData,
  174. DLG_OP DlgOp);
  175. HRESULT
  176. ObjectPathField(CDsPropPageBase * pPage, PATTR_MAP pAttrMap,
  177. PADS_ATTR_INFO pAttrInfo, LPARAM lParam, PATTR_DATA pAttrData,
  178. DLG_OP DlgOp);
  179. // FPO general page attribute function for finding account name from the SID.
  180. //
  181. HRESULT
  182. GetAcctName(CDsPropPageBase * pPage, PATTR_MAP pAttrMap,
  183. PADS_ATTR_INFO pAttrInfo, LPARAM lParam, PATTR_DATA pAttrData,
  184. DLG_OP DlgOp);
  185. // General-purpose attribute function for ES_NUMBER edit controls with
  186. // associated spin button. This must always be accompanied by a "msctls_updown32"
  187. // control with the SpinButton attribute function. Set ATTR_MAP.pData to the
  188. // controlID of the associated spin button.
  189. //
  190. HRESULT
  191. EditNumber(CDsPropPageBase * pPage, PATTR_MAP pAttrMap,
  192. PADS_ATTR_INFO pAttrInfo, LPARAM lParam, PATTR_DATA pAttrData,
  193. DLG_OP DlgOp);
  194. // General-purpose READONLY attribute function for spin buttons accompaying EditNumber
  195. // edit controls. If you wish to limit the spinbutton range, set ATTR_MAP.nSizeLimit
  196. // to the high end of the range and ATTR_MAP.pData to the low end of the range.
  197. //
  198. HRESULT
  199. SpinButton(CDsPropPageBase * pPage, PATTR_MAP pAttrMap,
  200. PADS_ATTR_INFO pAttrInfo, LPARAM lParam, PATTR_DATA pAttrData,
  201. DLG_OP DlgOp);
  202. // Special-purpose attribute function for spin buttons to change accelerator
  203. // increment. Use this as READONLY for controls which already have a
  204. // SpinButton attribute function. Set ATTR_MAP.pData to the integer
  205. // multiple, e.g. 15 to move in increments of 15.
  206. //
  207. HRESULT
  208. SpinButtonExtendIncrement(CDsPropPageBase * pPage, PATTR_MAP pAttrMap,
  209. PADS_ATTR_INFO pAttrInfo, LPARAM lParam, PATTR_DATA pAttrData,
  210. DLG_OP DlgOp);
  211. // Special-purpose read-only attribute functions to pick apart a subnet mask and
  212. // fill in an IP Address Control (WC_IPADDRESS)
  213. HRESULT
  214. SubnetExtractAddress(CDsPropPageBase * pPage, PATTR_MAP pAttrMap,
  215. PADS_ATTR_INFO pAttrInfo, LPARAM lParam, PATTR_DATA pAttrData,
  216. DLG_OP DlgOp);
  217. HRESULT
  218. SubnetExtractMask(CDsPropPageBase * pPage, PATTR_MAP pAttrMap,
  219. PADS_ATTR_INFO pAttrInfo, LPARAM lParam, PATTR_DATA pAttrData,
  220. DLG_OP DlgOp);
  221. //
  222. // read-only attribute function to calculate the DNS alias of an NTDSDSA
  223. //
  224. HRESULT
  225. NTDSDSA_DNSAlias(CDsPropPageBase * pPage, PATTR_MAP pAttrMap,
  226. PADS_ATTR_INFO pAttrInfo, LPARAM lParam, PATTR_DATA pAttrData,
  227. DLG_OP DlgOp);
  228. // helper function to delete pADsValues (tablpage.cxx)
  229. void HelperDeleteADsValues( PADS_ATTR_INFO pAttrs );
  230. // global definitions
  231. extern HINSTANCE g_hInstance;
  232. extern RGDSPPCLASSES g_DsPPClasses;
  233. extern CLIPFORMAT g_cfDsObjectNames;
  234. extern CLIPFORMAT g_cfDsDispSpecOptions;
  235. extern CLIPFORMAT g_cfShellIDListArray;
  236. extern CLIPFORMAT g_cfMMCGetNodeType;
  237. extern CLIPFORMAT g_cfDsPropCfg;
  238. extern CLIPFORMAT g_cfDsSelList;
  239. extern CLIPFORMAT g_cfDsMultiSelectProppages;
  240. //extern CLIPFORMAT g_cfMMCGetCoClass;
  241. extern UINT g_uChangeMsg;
  242. extern int g_iInstance;
  243. #ifndef DSPROP_ADMIN
  244. extern CRITICAL_SECTION g_csNotifyCreate;
  245. #endif
  246. //+----------------------------------------------------------------------------
  247. //
  248. // Class: CDsPropPagesHost
  249. //
  250. // Purpose: property pages host object class
  251. //
  252. //-----------------------------------------------------------------------------
  253. class CDsPropPagesHost : public IShellExtInit, IShellPropSheetExt
  254. {
  255. public:
  256. #ifdef _DEBUG
  257. char szClass[32];
  258. #endif
  259. CDsPropPagesHost(PDSCLASSPAGES pDsPP);
  260. ~CDsPropPagesHost();
  261. //
  262. // IUnknown methods
  263. //
  264. STDMETHOD(QueryInterface)(REFIID riid, void ** ppvObject);
  265. STDMETHOD_(ULONG, AddRef)(void);
  266. STDMETHOD_(ULONG, Release)(void);
  267. //
  268. // IShellExtInit methods
  269. //
  270. STDMETHOD(Initialize)(LPCITEMIDLIST pIDFolder, LPDATAOBJECT pDataObj,
  271. HKEY hKeyID );
  272. //
  273. // IShellPropSheetExt methods
  274. //
  275. STDMETHOD(AddPages)(LPFNADDPROPSHEETPAGE pAddPageProc, LPARAM lParam);
  276. STDMETHOD(ReplacePage)(UINT uPageID, LPFNADDPROPSHEETPAGE pReplacePageFunc,
  277. LPARAM lParam);
  278. private:
  279. PDSCLASSPAGES m_pDsPPages;
  280. LPDATAOBJECT m_pDataObj;
  281. HWND m_hNotifyObj;
  282. STGMEDIUM m_ObjMedium;
  283. unsigned long m_uRefs;
  284. CDllRef m_DllRef;
  285. };
  286. typedef struct _ApplyErrorEntry
  287. {
  288. PWSTR pszPath; // Path to the object that had the error
  289. PWSTR pszClass; // Class of the object that had the error
  290. HRESULT hr; // HRESULT of the error (if 0 then pszStringError must not be NULL)
  291. PWSTR pszStringError; // User defined string error (used only if hr == NULL)
  292. } APPLY_ERROR_ENTRY, *PAPPLY_ERROR_ENTRY;
  293. //+----------------------------------------------------------------------------
  294. //
  295. // Class: CADsApplyErrors
  296. //
  297. // Purpose: contains an association between DS objects and errors that
  298. // occurred while doing an apply
  299. //
  300. //-----------------------------------------------------------------------------
  301. class CADsApplyErrors
  302. {
  303. public:
  304. CADsApplyErrors()
  305. : m_nArraySize(0),
  306. m_nCount(0),
  307. m_nIncAmount(5),
  308. m_pErrorTable(NULL),
  309. m_hWndPage(NULL),
  310. m_pszTitle(NULL)
  311. {}
  312. ~CADsApplyErrors();
  313. void SetError(PADSPROPERROR pError);
  314. HRESULT GetError(UINT nIndex);
  315. PWSTR GetStringError(UINT nIndex);
  316. PWSTR GetName(UINT nIndex);
  317. PWSTR GetClass(UINT nIndex);
  318. HWND GetPageHwnd() { return m_hWndPage; }
  319. UINT GetCount() { return m_nCount; }
  320. UINT GetErrorCount() { return m_nCount; }
  321. PWSTR GetPageTitle() { return m_pszTitle; }
  322. void Clear();
  323. private:
  324. PAPPLY_ERROR_ENTRY m_pErrorTable;
  325. UINT m_nCount;
  326. HWND m_hWndPage;
  327. PWSTR m_pszTitle;
  328. UINT m_nArraySize;
  329. UINT m_nIncAmount;
  330. };
  331. //+----------------------------------------------------------------------------
  332. //
  333. // Class: CDsPropPageBase
  334. //
  335. // Purpose: property page object base class
  336. //
  337. //-----------------------------------------------------------------------------
  338. class CDsPropPageBase : public IUnknown
  339. {
  340. public:
  341. #ifdef _DEBUG
  342. char szClass[32];
  343. #endif
  344. CDsPropPageBase(PDSPAGE pDsPage, LPDATAOBJECT pDataObj, HWND hNotifyWnd,
  345. DWORD dwFlags);
  346. virtual ~CDsPropPageBase(void);
  347. //
  348. // IUnknown methods
  349. //
  350. STDMETHOD(QueryInterface)(REFIID riid, void ** ppvObject);
  351. STDMETHOD_(ULONG, AddRef)(void);
  352. STDMETHOD_(ULONG, Release)(void);
  353. //
  354. // Static WndProc to be passed to CreateWindow
  355. //
  356. static LRESULT CALLBACK StaticDlgProc(HWND hWnd, UINT uMsg,
  357. WPARAM wParam, LPARAM lParam);
  358. //
  359. // Instance specific wind proc
  360. //
  361. virtual LRESULT DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam,
  362. LPARAM lParam) = 0;
  363. void Init(PWSTR pwzADsPath, PWSTR pwzClass, CDSBasePathsInfo* pBasePathsInfo);
  364. HRESULT CreatePage(HPROPSHEETPAGE * phPage);
  365. const LPWSTR GetObjPathName(void) {return m_pwszObjPathName;};
  366. const LPWSTR GetObjRDName(void) {return m_pwszRDName;};
  367. const LPWSTR GetObjClass(void) {return m_pwszObjClass;};
  368. HWND GetHWnd(void) {return m_hPage;};
  369. void SetDirty(BOOL fFullDirty = TRUE) {
  370. m_fPageDirty = TRUE;
  371. if (fFullDirty)
  372. {
  373. PropSheet_Changed(GetParent(m_hPage), m_hPage);
  374. EnableWindow(GetDlgItem(GetParent(m_hPage), IDCANCEL), TRUE);
  375. }
  376. };
  377. BOOL IsDirty() {return m_fPageDirty;}
  378. LRESULT OnHelp(LPHELPINFO pHelpInfo);
  379. virtual BOOL IsMultiselectPage() { return m_fMultiselectPage; }
  380. CDSBasePathsInfo* GetBasePathsInfo() { return m_pBasePathsInfo; }
  381. protected:
  382. static UINT CALLBACK PageCallback(HWND hwnd, UINT uMsg,
  383. LPPROPSHEETPAGE ppsp);
  384. //
  385. // Member functions, called by WndProc
  386. //
  387. LRESULT InitDlg(LPARAM lParam);
  388. virtual HRESULT OnInitDialog(LPARAM lParam) = 0;
  389. virtual LRESULT OnApply(void) = 0;
  390. LRESULT OnCommand(int id, HWND hwndCtl, UINT codeNotify);
  391. LRESULT OnNotify(WPARAM wParam, LPARAM lParam);
  392. LRESULT OnCancel(void);
  393. LRESULT OnSetFocus(HWND hwndLoseFocus);
  394. LRESULT OnShowWindow(void);
  395. LRESULT OnDestroy(void);
  396. LRESULT OnPSMQuerySibling(WPARAM wParam, LPARAM lParam);
  397. LRESULT OnPSNSetActive(LPARAM lParam);
  398. LRESULT OnPSNKillActive(LPARAM lParam);
  399. LRESULT OnDoInit();
  400. void CheckIfPageAttrsWritable(void);
  401. BOOL CheckIfWritable(const PWSTR & wzAttr);
  402. public:
  403. HRESULT GetObjSel(IDsObjectPicker ** ppObjSel, PBOOL pfIsInited = NULL);
  404. void ObjSelInited(void) {m_fObjSelInited = TRUE;};
  405. HRESULT SkipPrefix(PWSTR pwzObj, PWSTR * ppResult, BOOL fX500 = TRUE);
  406. HRESULT AddLDAPPrefix(PWSTR pwzObj, CStrW &pstrResult, BOOL fServer = TRUE);
  407. HRESULT GetADsPathname(CComPtr<IADsPathname>& refADsPath);
  408. HRESULT GetIDispSpec(IDsDisplaySpecifier ** ppDispSpec);
  409. BOOL IsReadOnly(void) {return m_fReadOnly;};
  410. BOOL SendErrorMessage(PADSPROPERROR pError)
  411. {
  412. return ADsPropSendErrorMessage(m_hNotifyObj, pError);
  413. }
  414. //
  415. // Data members
  416. //
  417. public:
  418. LPDATAOBJECT m_pWPTDataObj; // Wnd Proc Thread Data Obj.
  419. IDirectoryObject * m_pDsObj;
  420. protected:
  421. HWND m_hPage;
  422. BOOL m_fInInit;
  423. BOOL m_fPageDirty;
  424. BOOL m_fReadOnly;
  425. BOOL m_fMultiselectPage;
  426. LPDATAOBJECT m_pDataObj; // Marshalled to the wndproc thread.
  427. LPSTREAM m_pDataObjStrm; // Used to marshal data obj pointer.
  428. int m_nPageTitle;
  429. int m_nDlgTemplate;
  430. DWORD m_cAttrs;
  431. PATTR_MAP * m_rgpAttrMap;
  432. PWSTR m_pwszObjPathName;
  433. PWSTR m_pwszObjClass;
  434. PWSTR m_pwszRDName;
  435. CDllRef m_DllRef;
  436. CComPtr<IADsPathname> m_pADsPath;
  437. IDsObjectPicker * m_pObjSel;
  438. IDsDisplaySpecifier * m_pDispSpec;
  439. BOOL m_fObjSelInited;
  440. PATTR_DATA m_rgAttrData;
  441. unsigned long m_uRefs;
  442. HWND m_hNotifyObj;
  443. PADS_ATTR_INFO m_pWritableAttrs;
  444. HRESULT m_hrInit;
  445. CDSBasePathsInfo* m_pBasePathsInfo;
  446. };
  447. //+----------------------------------------------------------------------------
  448. //
  449. // Class: CDsTableDrivenPage
  450. //
  451. // Purpose: property page object class for table-driven attributes
  452. //
  453. //-----------------------------------------------------------------------------
  454. class CDsTableDrivenPage : public CDsPropPageBase
  455. {
  456. public:
  457. #ifdef _DEBUG
  458. char szClass[32];
  459. #endif
  460. CDsTableDrivenPage(PDSPAGE pDsPage, LPDATAOBJECT pDataObj, HWND hNotifyWnd,
  461. DWORD dwFlags);
  462. ~CDsTableDrivenPage(void);
  463. //
  464. // Instance specific wind proc
  465. //
  466. LRESULT DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  467. BOOL SetNamedAttrDirty( LPCWSTR pszAttrName );
  468. protected:
  469. void SetDirty(DWORD i) {
  470. ATTR_DATA_SET_DIRTY(m_rgAttrData[i]);
  471. CDsPropPageBase::SetDirty();
  472. }
  473. LRESULT OnDestroy(void);
  474. private:
  475. HRESULT OnInitDialog(LPARAM lParam);
  476. LRESULT OnApply(void);
  477. LRESULT OnCommand(int id, HWND hwndCtl, UINT codeNotify);
  478. LRESULT OnObjChanged(void);
  479. LRESULT OnAttrChanged(WPARAM wParam);
  480. LRESULT OnQuerySibs(WPARAM wParam, LPARAM lParam);
  481. LRESULT OnNotify(WPARAM wParam, LPARAM lParam);
  482. HRESULT ReadAttrsSetCtrls(DLG_OP DlgOp);
  483. //
  484. // Data members
  485. //
  486. public:
  487. LPARAM m_pData;
  488. };
  489. /*
  490. //+----------------------------------------------------------------------------
  491. //
  492. // Class: CDsReplSchedulePage
  493. //
  494. // Purpose: property page object class for the schedule attribute.
  495. //
  496. //-----------------------------------------------------------------------------
  497. class CDsReplSchedulePage : public CDsPropPageBase
  498. {
  499. public:
  500. #ifdef _DEBUG
  501. char szClass[32];
  502. #endif
  503. CDsReplSchedulePage(PDSPAGE pDsPage, LPDATAOBJECT pDataObj, DWORD dwFlags);
  504. ~CDsReplSchedulePage(void);
  505. //
  506. // Instance specific wind proc
  507. //
  508. LRESULT DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  509. HRESULT GetServerName(void);
  510. private:
  511. LRESULT OnInitDialog(LPARAM lParam);
  512. LRESULT OnApply(void);
  513. LRESULT OnCommand(int id, HWND hwndCtl, UINT codeNotify);
  514. LRESULT OnDestroy(void);
  515. //
  516. // Data members
  517. //
  518. LPWSTR m_pwszLdapServer;
  519. };
  520. */
  521. //+----------------------------------------------------------------------------
  522. //
  523. // Class: CDsPropPagesHostCF
  524. //
  525. // Purpose: object class factory
  526. //
  527. //-----------------------------------------------------------------------------
  528. class CDsPropPagesHostCF : public IClassFactory
  529. {
  530. public:
  531. #ifdef _DEBUG
  532. char szClass[32];
  533. #endif
  534. CDsPropPagesHostCF(PDSCLASSPAGES pDsPP);
  535. ~CDsPropPagesHostCF();
  536. // IUnknown methods
  537. STDMETHOD(QueryInterface)(REFIID riid, void ** ppvObject);
  538. STDMETHOD_(ULONG, AddRef)();
  539. STDMETHOD_(ULONG, Release)();
  540. // IClassFactory methods
  541. STDMETHOD(CreateInstance)(IUnknown * pUnkOuter, REFIID riid,
  542. void ** ppvObject);
  543. STDMETHOD(LockServer)(BOOL fLock);
  544. static IClassFactory * Create(PDSCLASSPAGES pDsPP);
  545. private:
  546. PDSCLASSPAGES m_pDsPP;
  547. unsigned long m_uRefs;
  548. CDllRef m_DllRef;
  549. };
  550. //+----------------------------------------------------------------------------
  551. //
  552. // Class: CDsPropDataObj
  553. //
  554. // Purpose: Data object for property pages.
  555. //
  556. // Notes: This is not a first class COM object since there is no class
  557. // factory.
  558. //
  559. //-----------------------------------------------------------------------------
  560. class CDsPropDataObj : public IDataObject
  561. {
  562. public:
  563. #ifdef _DEBUG
  564. char szClass[32];
  565. #endif
  566. CDsPropDataObj(HWND hwndParentPage,
  567. BOOL fReadOnly);
  568. ~CDsPropDataObj(void);
  569. HRESULT Init(LPWSTR pwszObjName, LPWSTR pwszClass);
  570. HRESULT Init(PDS_SELECTION_LIST pSelectionList);
  571. //
  572. // IUnknown methods
  573. //
  574. STDMETHOD(QueryInterface)(REFIID riid, void ** ppvObject);
  575. STDMETHOD_(ULONG, AddRef)(void);
  576. STDMETHOD_(ULONG, Release)(void);
  577. //
  578. // Standard IDataObject methods
  579. //
  580. // Implemented
  581. //
  582. STDMETHOD(GetData)(FORMATETC * pformatetcIn, STGMEDIUM * pmedium);
  583. // Not Implemented
  584. private:
  585. STDMETHOD(QueryGetData)(FORMATETC*)
  586. { return E_NOTIMPL; };
  587. STDMETHOD(GetCanonicalFormatEtc)(FORMATETC *,
  588. FORMATETC *)
  589. { return E_NOTIMPL; };
  590. STDMETHOD(EnumFormatEtc)(DWORD,
  591. LPENUMFORMATETC *)
  592. { return E_NOTIMPL; };
  593. STDMETHOD(GetDataHere)(LPFORMATETC, LPSTGMEDIUM)
  594. { return E_NOTIMPL; };
  595. STDMETHOD(SetData)(FORMATETC *, STGMEDIUM *,
  596. BOOL)
  597. { return E_NOTIMPL; };
  598. STDMETHOD(DAdvise)(FORMATETC *, DWORD,
  599. IAdviseSink *, DWORD *)
  600. { return E_NOTIMPL; };
  601. STDMETHOD(DUnadvise)(DWORD)
  602. { return E_NOTIMPL; };
  603. STDMETHOD(EnumDAdvise)(IEnumSTATDATA **)
  604. { return E_NOTIMPL; };
  605. BOOL m_fReadOnly;
  606. PWSTR m_pwszObjName;
  607. PWSTR m_pwszObjClass;
  608. HWND m_hwndParent;
  609. unsigned long m_uRefs;
  610. PDS_SELECTION_LIST m_pSelectionList;
  611. };
  612. //+----------------------------------------------------------------------------
  613. //
  614. // Function: PostPropSheet
  615. //
  616. // Synopsis: Creates a property sheet for the named object using MMC's
  617. // IPropertySheetProvider so that extension snapins can add pages.
  618. //
  619. //-----------------------------------------------------------------------------
  620. HRESULT
  621. PostPropSheet(PWSTR pwszObj, CDsPropPageBase * pParentPage,
  622. BOOL fReadOnly = FALSE);
  623. HRESULT
  624. PostADsPropSheet(PWSTR pwzObjDN, IDataObject * pParentObj, HWND hwndParent,
  625. HWND hNotifyObj, BOOL fReadOnly);
  626. #include "proputil.h"
  627. #endif // _PROPPAGE_H_