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.

55 lines
1.2 KiB

  1. // PermPage.cpp : Implementation of data object classes
  2. #include "stdafx.h"
  3. #include "PermPage.h"
  4. #ifdef _DEBUG
  5. #define new DEBUG_NEW
  6. #undef THIS_FILE
  7. static char THIS_FILE[] = __FILE__;
  8. #endif
  9. static HINSTANCE g_hDll = NULL;
  10. static PFNDSCREATESECPAGE g_hProc = NULL;
  11. HRESULT
  12. CreateDfsSecurityPage(
  13. IN LPPROPERTYSHEETCALLBACK pCallBack,
  14. IN LPCTSTR pszObjectPath,
  15. IN LPCTSTR pszObjectClass,
  16. IN DWORD dwFlags
  17. )
  18. {
  19. _ASSERT( pCallBack );
  20. HRESULT hr = S_OK;
  21. HPROPSHEETPAGE hPage = NULL;
  22. if (!g_hDll)
  23. {
  24. if ( !(g_hDll = LoadLibrary(_T("dssec.dll"))) ||
  25. !(g_hProc = (PFNDSCREATESECPAGE)GetProcAddress(g_hDll, "DSCreateSecurityPage")) )
  26. {
  27. DWORD dwErr = GetLastError();
  28. if (g_hDll)
  29. {
  30. FreeLibrary(g_hDll);
  31. g_hDll = NULL;
  32. }
  33. return HRESULT_FROM_WIN32(dwErr);
  34. }
  35. }
  36. hr = (*g_hProc)(pszObjectPath,
  37. pszObjectClass,
  38. dwFlags,
  39. &hPage,
  40. NULL,
  41. NULL,
  42. 0);
  43. if (SUCCEEDED(hr) && hPage)
  44. pCallBack->AddPage(hPage);
  45. return hr;
  46. }