Source code of Windows XP (NT5)
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.

37 lines
871 B

  1. ///////////////////////////////////////////////////////////////////////////
  2. //
  3. // Microsoft WMIOLE DB Provider
  4. //
  5. // (C) Copyright 1999 Microsoft Corporation. All Rights Reserved.
  6. //
  7. // IGetSess.CPP IGetSession interface implementation
  8. //
  9. ///////////////////////////////////////////////////////////////////////////
  10. #include "headers.h"
  11. STDMETHODIMP CImpIGetSession::GetSession(REFIID riid,IUnknown ** ppSession)
  12. {
  13. HRESULT hr = E_FAIL;
  14. CSetStructuredExceptionHandler seh;
  15. TRY_BLOCK;
  16. // Seriliaze the object
  17. CAutoBlock cab(m_pObj->GetCriticalSection());
  18. // Clear Error information
  19. g_pCError->ClearErrorInfo();
  20. if( m_pObj->m_pCreator != NULL)
  21. {
  22. hr = m_pObj->m_pCreator->QueryInterface(riid,(void **)ppSession);
  23. }
  24. hr = hr == S_OK ? hr :g_pCError->PostHResult(hr,&IID_IGetSession);
  25. CATCH_BLOCK_HRESULT(hr,L"IGetSession::GetSession");
  26. return hr;
  27. }