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.

98 lines
2.2 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2002 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // MiddleTierUtils.cpp
  7. //
  8. // Description:
  9. // MiddleTier utility functions.
  10. //
  11. // Maintained By:
  12. // Galen Barbee (GalenB) 30-APR-2002
  13. //
  14. //////////////////////////////////////////////////////////////////////////////
  15. //////////////////////////////////////////////////////////////////////////////
  16. // Include Files
  17. //////////////////////////////////////////////////////////////////////////////
  18. #include <pch.h>
  19. //////////////////////////////////////////////////////////////////////////////
  20. //++
  21. //
  22. // HrRetrieveCookiesName
  23. //
  24. // Description:
  25. // Get the name associated with the standard info for the passed in
  26. // cookie.
  27. //
  28. // Arguments:
  29. // pomIn
  30. // Pointer to the object manager.
  31. //
  32. // cookieIn
  33. // The cookie's whose name we want.
  34. //
  35. // pbstrNameOut
  36. // The name associated with the passed in cookie.
  37. //
  38. // Return Value:
  39. // S_OK
  40. // Success
  41. //
  42. // HRESULT failure.
  43. //
  44. //--
  45. //////////////////////////////////////////////////////////////////////////////
  46. HRESULT
  47. HrRetrieveCookiesName(
  48. IObjectManager * pomIn
  49. , OBJECTCOOKIE cookieIn
  50. , BSTR * pbstrNameOut
  51. )
  52. {
  53. TraceFunc( "" );
  54. Assert( pomIn != NULL );
  55. Assert( cookieIn != NULL );
  56. Assert( pbstrNameOut != NULL );
  57. HRESULT hr = S_OK;
  58. IUnknown * punk = NULL;
  59. IStandardInfo * psi = NULL;
  60. hr = THR( pomIn->GetObject( DFGUID_StandardInfo, cookieIn, &punk ) );
  61. if ( FAILED( hr ) )
  62. {
  63. goto Cleanup;
  64. } // if:
  65. hr = THR( punk->TypeSafeQI( IStandardInfo, &psi ) );
  66. if ( FAILED( hr ) )
  67. {
  68. goto Cleanup;
  69. } // if:
  70. hr = THR( psi->GetName( pbstrNameOut ) );
  71. if ( FAILED( hr ) )
  72. {
  73. goto Cleanup;
  74. } // if:
  75. TraceMemoryAddBSTR( *pbstrNameOut );
  76. Cleanup:
  77. if ( punk != NULL )
  78. {
  79. punk->Release();
  80. } // if:
  81. if ( psi != NULL )
  82. {
  83. psi->Release();
  84. } // if:
  85. HRETURN( hr );
  86. } //*** HrRetrieveCookiesName