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.

70 lines
1.8 KiB

  1. /****************************************************************************************
  2. * NAME: NapUtil.cpp
  3. *
  4. * OVERVIEW
  5. *
  6. * Internet Authentication Server: utility functions
  7. *
  8. * Copyright (C) Microsoft Corporation, 1998 - 1999 . All Rights Reserved.
  9. *
  10. * History:
  11. * 2/12/98 Created by Byao
  12. *****************************************************************************************/
  13. #include "Precompiled.h"
  14. #include "mmcUtility.h"
  15. #include "NapUtil.h"
  16. //+---------------------------------------------------------------------------
  17. //
  18. // Function: GetSdoInterfaceProperty
  19. //
  20. // Synopsis: Get an interface property from a SDO through its ISdo interface
  21. //
  22. // Arguments: ISdo *pISdo - Pointer to ISdo
  23. // LONG lPropId - property id
  24. // REFIID riid - ref iid
  25. // void ** ppvObject - pointer to the requested interface property
  26. //
  27. // Returns: HRESULT -
  28. //
  29. // History: Created Header byao 2/12/98 11:12:55 PM
  30. //
  31. //+---------------------------------------------------------------------------
  32. HRESULT GetSdoInterfaceProperty(ISdo *pISdo,
  33. LONG lPropId,
  34. REFIID riid,
  35. void ** ppvInterface)
  36. {
  37. CComVariant spVariant;
  38. CComBSTR bstr;
  39. HRESULT hr = S_OK;
  40. spVariant.vt = VT_DISPATCH;
  41. spVariant.pdispVal = NULL;
  42. hr = pISdo->GetProperty(lPropId, &spVariant);
  43. if ( FAILED(hr) )
  44. {
  45. ShowErrorDialog(NULL, IDS_ERROR_SDO_ERROR, NULL, hr );
  46. return hr;
  47. }
  48. _ASSERTE( spVariant.vt == VT_DISPATCH );
  49. // query the dispatch pointer for interface
  50. hr = spVariant.pdispVal->QueryInterface( riid, ppvInterface);
  51. if ( FAILED(hr) )
  52. {
  53. ShowErrorDialog(NULL,
  54. IDS_ERROR_SDO_ERROR_QUERYINTERFACE,
  55. NULL,
  56. hr
  57. );
  58. return hr;
  59. }
  60. spVariant.Clear();
  61. return S_OK;
  62. }