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.2 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1996 - 1999
  5. //
  6. // File: config.cpp
  7. //
  8. // Contents: Cert Server client implementation
  9. //
  10. // History: 24-Aug-96 vich created
  11. //
  12. //---------------------------------------------------------------------------
  13. #include "pch.cpp"
  14. #pragma hdrstop
  15. #include "csdisp.h"
  16. #include "configp.h"
  17. #include "getconf.h"
  18. //+--------------------------------------------------------------------------
  19. // CCertGetConfig::~CCertGetConfig -- destructor
  20. //
  21. // free memory associated with this instance
  22. //+--------------------------------------------------------------------------
  23. CCertGetConfig::~CCertGetConfig()
  24. {
  25. }
  26. //+--------------------------------------------------------------------------
  27. // CCertGetConfig::GetConfig -- select a certificate issuer, return config data.
  28. //
  29. // pstrOut points to a BSTR string filled in by this routine. If *pstrOut is
  30. // non-NULL and this method is successful, the old string is freed. If any
  31. // value other than S_OK is returned, the string pointer will not be modified.
  32. //
  33. // Flags must be set to 0.
  34. //
  35. // Upon successful completion, *pstrOut will point to a string that contains
  36. // the server name and Certification Authority name.
  37. //
  38. // When the caller no longer needs the string, it must be freed by calling
  39. // SysFreeString().
  40. //
  41. // Returns S_OK on success.
  42. //+--------------------------------------------------------------------------
  43. STDMETHODIMP
  44. CCertGetConfig::GetConfig(
  45. /* [in] */ LONG Flags,
  46. /* [retval][out] */ BSTR __RPC_FAR *pstrOut)
  47. {
  48. HRESULT hr;
  49. hr = CCertConfigPrivate::GetConfig(Flags, pstrOut);
  50. return(_SetErrorInfo(hr, L"CCertGetConfig::GetConfig"));
  51. }
  52. HRESULT
  53. CCertGetConfig::_SetErrorInfo(
  54. IN HRESULT hrError,
  55. IN WCHAR const *pwszDescription)
  56. {
  57. CSASSERT(FAILED(hrError) || S_OK == hrError || S_FALSE == hrError);
  58. if (FAILED(hrError))
  59. {
  60. HRESULT hr;
  61. hr = DispatchSetErrorInfo(
  62. hrError,
  63. pwszDescription,
  64. wszCLASS_CERTGETCONFIG,
  65. &IID_ICertGetConfig);
  66. CSASSERT(hr == hrError);
  67. }
  68. return(hrError);
  69. }