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.

82 lines
2.3 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1996 - 1999
  5. //
  6. // File: module.cpp
  7. //
  8. // Contents: Cert Server Policy Module implementation
  9. //
  10. //---------------------------------------------------------------------------
  11. #include "pch.cpp"
  12. #pragma hdrstop
  13. #include "celib.h"
  14. #include "module.h"
  15. #include "policy.h"
  16. STDMETHODIMP
  17. CCertManagePolicyModuleSample::GetProperty(
  18. /* [in] */ const BSTR strConfig,
  19. /* [in] */ BSTR strStorageLocation,
  20. /* [in] */ BSTR strPropertyName,
  21. /* [in] */ LONG Flags,
  22. /* [retval][out] */ VARIANT __RPC_FAR *pvarProperty)
  23. {
  24. LPWSTR szStr = NULL;
  25. if (NULL == pvarProperty)
  26. {
  27. return E_POINTER;
  28. }
  29. VariantInit(pvarProperty);
  30. if (strPropertyName == NULL)
  31. return S_FALSE;
  32. if (0 == _wcsicmp(strPropertyName, wszCMM_PROP_NAME))
  33. szStr = wsz_SAMPLE_NAME;
  34. else if (0 == _wcsicmp(strPropertyName, wszCMM_PROP_DESCRIPTION))
  35. szStr = wsz_SAMPLE_DESCRIPTION;
  36. else if (0 == _wcsicmp(strPropertyName, wszCMM_PROP_COPYRIGHT))
  37. szStr = wsz_SAMPLE_COPYRIGHT;
  38. else if (0 == _wcsicmp(strPropertyName, wszCMM_PROP_FILEVER))
  39. szStr = wsz_SAMPLE_FILEVER;
  40. else if (0 == _wcsicmp(strPropertyName, wszCMM_PROP_PRODUCTVER))
  41. szStr = wsz_SAMPLE_PRODUCTVER;
  42. else
  43. return S_FALSE;
  44. pvarProperty->bstrVal = SysAllocString(szStr);
  45. if (NULL == pvarProperty->bstrVal)
  46. return E_OUTOFMEMORY;
  47. pvarProperty->vt = VT_BSTR;
  48. return S_OK;
  49. }
  50. STDMETHODIMP
  51. CCertManagePolicyModuleSample::SetProperty(
  52. /* [in] */ const BSTR strConfig,
  53. /* [in] */ BSTR strStorageLocation,
  54. /* [in] */ BSTR strPropertyName,
  55. /* [in] */ LONG Flags,
  56. /* [in] */ VARIANT const __RPC_FAR *pvarProperty)
  57. {
  58. // no settable properties supported
  59. return S_FALSE;
  60. }
  61. STDMETHODIMP
  62. CCertManagePolicyModuleSample::Configure(
  63. /* [in] */ const BSTR strConfig,
  64. /* [in] */ BSTR strStorageLocation,
  65. /* [in] */ LONG Flags)
  66. {
  67. MessageBox(NULL, L"No Configurable Options", NULL, MB_OK|MB_ICONINFORMATION);
  68. return S_OK;
  69. }