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.

49 lines
1.6 KiB

  1. // Copyright (c) 1997-1999 Microsoft Corporation
  2. #include "precomp.h"
  3. #include "DepPage.h"
  4. #include "ServDeps.h"
  5. #include "SDSnapin.h"
  6. #include "..\common\ConnectThread.h"
  7. #include "autoptr.h"
  8. /////////////////////////////////////////////////////////////////////////////
  9. // CSDSnapinComponentData
  10. static const GUID CSDSnapinExtGUID_NODETYPE =
  11. { 0x4e410f16, 0xabc1, 0x11d0, { 0xb9, 0x44, 0x0, 0xc0, 0x4f, 0xd8, 0xd5, 0xb0 } };
  12. const GUID* CSDSnapinExtData::m_NODETYPE = &CSDSnapinExtGUID_NODETYPE;
  13. const OLECHAR* CSDSnapinExtData::m_SZNODETYPE = OLESTR("4e410f16-abc1-11d0-b944-00c04fd8d5b0");
  14. const OLECHAR* CSDSnapinExtData::m_SZDISPLAY_NAME = OLESTR("SDSnapin");
  15. const CLSID* CSDSnapinExtData::m_SNAPIN_CLASSID = &CLSID_SDSnapin;
  16. WbemConnectThread *g_connectThread = NULL;
  17. HRESULT CSDSnapinExtData::CreatePropertyPages(LPPROPERTYSHEETCALLBACK lpProvider,
  18. LONG_PTR handle,
  19. IUnknown* pUnk,
  20. DATA_OBJECT_TYPES type)
  21. {
  22. wmilib::auto_ptr<WbemConnectThread> pConnectThread(new WbemConnectThread);
  23. if( NULL == pConnectThread.get())
  24. return E_FAIL;
  25. pConnectThread->Connect(m_pDataObject);
  26. wmilib::auto_ptr<DependencyPage> pPage(new DependencyPage(pConnectThread.get(),
  27. m_pDataObject,
  28. handle,
  29. true));
  30. if(pPage.get() ) {
  31. lpProvider->AddPage(pPage->Create());
  32. }
  33. pPage.release();
  34. // The second parameter to the property page class constructor
  35. // should be true for only one page.
  36. // TODO : Add code here to add additional pages
  37. pConnectThread->Release();
  38. pConnectThread.release();
  39. return S_OK;
  40. }