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.

106 lines
2.2 KiB

  1. //____________________________________________________________________________
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1995 - 1996.
  5. //
  6. // File: security.cxx
  7. //
  8. // Contents:
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // History: 3/5/1996 RaviR Created
  15. //
  16. //____________________________________________________________________________
  17. #include "..\pch\headers.hxx"
  18. #pragma hdrstop
  19. #include <mstask.h>
  20. #include "..\folderui\dbg.h"
  21. #include "..\folderui\macros.h"
  22. #include "defines.h"
  23. #include "schedui.hxx"
  24. // {1F2E5C40-9550-11CE-99D2-00AA006E086C}
  25. CLSID CLSID_RShellExt = {
  26. 0x1F2E5C40,
  27. 0x9550,
  28. 0x11CE,
  29. { 0x99, 0xD2, 0x00, 0xAA, 0x00, 0x6E, 0x08, 0x6C }
  30. };
  31. //
  32. // This function is a callback function from property sheet page extensions.
  33. //
  34. BOOL CALLBACK
  35. I_AddPropSheetPage(
  36. HPROPSHEETPAGE hpage,
  37. LPARAM lParam)
  38. {
  39. PROPSHEETHEADER * ppsh = (PROPSHEETHEADER *)lParam;
  40. if (ppsh->nPages < MAX_PROP_PAGES)
  41. {
  42. ppsh->phpage[ppsh->nPages++] = hpage;
  43. return TRUE;
  44. }
  45. return FALSE;
  46. }
  47. HRESULT
  48. AddSecurityPage(
  49. PROPSHEETHEADER &psh,
  50. LPDATAOBJECT pdtobj)
  51. {
  52. TRACE_FUNCTION(AddSecurityPage);
  53. HRESULT hr = S_OK;
  54. IShellPropSheetExt * pShellPropSheetExt = NULL;
  55. do
  56. {
  57. hr = CoCreateInstance(CLSID_RShellExt, NULL, CLSCTX_ALL,
  58. IID_IShellPropSheetExt, (void **)&pShellPropSheetExt);
  59. CHECK_HRESULT(hr);
  60. BREAK_ON_FAIL(hr);
  61. IShellExtInit * pShExtInit = NULL;
  62. hr = pShellPropSheetExt->QueryInterface(IID_IShellExtInit,
  63. (void **)&pShExtInit);
  64. if (SUCCEEDED(hr))
  65. {
  66. hr = pShExtInit->Initialize(NULL, pdtobj, NULL);
  67. CHECK_HRESULT(hr);
  68. pShExtInit->Release();
  69. if (SUCCEEDED(hr))
  70. {
  71. hr = pShellPropSheetExt->AddPages(I_AddPropSheetPage,
  72. (LPARAM)&psh);
  73. CHECK_HRESULT(hr);
  74. }
  75. }
  76. } while (0);
  77. if (pShellPropSheetExt)
  78. {
  79. pShellPropSheetExt->Release();
  80. }
  81. return hr;
  82. }