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.

81 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 Exit Module implementation
  9. //
  10. //---------------------------------------------------------------------------
  11. #include "pch.cpp"
  12. #pragma hdrstop
  13. #include "celib.h"
  14. #include "module.h"
  15. #include "exit.h"
  16. STDMETHODIMP
  17. CCertManageExitModuleSample::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 (pvarProperty == NULL)
  26. return E_POINTER;
  27. VariantInit(pvarProperty);
  28. if (strPropertyName == NULL)
  29. return S_FALSE;
  30. if (0 == _wcsicmp(strPropertyName, wszCMM_PROP_NAME))
  31. szStr = wsz_SAMPLE_NAME;
  32. else if (0 == _wcsicmp(strPropertyName, wszCMM_PROP_DESCRIPTION))
  33. szStr = wsz_SAMPLE_DESCRIPTION;
  34. else if (0 == _wcsicmp(strPropertyName, wszCMM_PROP_COPYRIGHT))
  35. szStr = wsz_SAMPLE_COPYRIGHT;
  36. else if (0 == _wcsicmp(strPropertyName, wszCMM_PROP_FILEVER))
  37. szStr = wsz_SAMPLE_FILEVER;
  38. else if (0 == _wcsicmp(strPropertyName, wszCMM_PROP_PRODUCTVER))
  39. szStr = wsz_SAMPLE_PRODUCTVER;
  40. else
  41. return S_FALSE;
  42. pvarProperty->bstrVal = SysAllocString(szStr);
  43. if (NULL == pvarProperty->bstrVal)
  44. return E_OUTOFMEMORY;
  45. pvarProperty->vt = VT_BSTR;
  46. return S_OK;
  47. }
  48. STDMETHODIMP
  49. CCertManageExitModuleSample::SetProperty(
  50. /* [in] */ const BSTR strConfig,
  51. /* [in] */ BSTR strStorageLocation,
  52. /* [in] */ BSTR strPropertyName,
  53. /* [in] */ LONG Flags,
  54. /* [in] */ VARIANT const __RPC_FAR *pvarProperty)
  55. {
  56. // no settable properties supported
  57. return S_FALSE;
  58. }
  59. STDMETHODIMP
  60. CCertManageExitModuleSample::Configure(
  61. /* [in] */ const BSTR strConfig,
  62. /* [in] */ BSTR strStorageLocation,
  63. /* [in] */ LONG Flags)
  64. {
  65. MessageBox(NULL, L"No Configurable Options", NULL, MB_OK|MB_ICONINFORMATION);
  66. return S_OK;
  67. }