#include "pch.hpp"
//===========================================================================//
// File:	 DirectX.cpp													 //
// Project:  GameOS					                                         //
// Contents: General Interfaces to DirectX									 //
//---------------------------------------------------------------------------//
// Date      Who    Modification                                             //
// 01/22/98  AG     Created													 //
//---------------------------------------------------------------------------//
// Copyright (C) 1999 Microsoft Corp.						                 //
// All Rights reserved worldwide                                             //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL               //
//===========================================================================//
#include "ErrorHandler.hpp"
#include "DirectXDebugging.hpp"
 


HRESULT wCoCreateInstance(REFCLSID rclsid,LPUNKNOWN pUnkOuter,DWORD dwClsContext,REFIID riid,LPVOID * ppv)
{
	SPEW(( GROUP_DIRECTX, "CoCreateInstance(%s)+",GetReturnInterface(riid)));

	HRESULT result=CoCreateInstance(rclsid,pUnkOuter,dwClsContext,riid,ppv);

	SPEW(( GROUP_DIRECTX, " -0x%x",(int)*ppv));

	if( FAILED(result) )
		PAUSE(( "FAILED (0x%x - %s) - CoCreateInstance(%s)\nTry ",result,ErrorNumberToMessage(result),GetReturnInterface(riid)));

	return result;
}


HRESULT wQueryInterface( IUnknown *iun, REFIID riid, LPVOID* obp )
{
	SPEW(( GROUP_DIRECTX, "QueryInterface(%s from 0x%x)+",GetReturnInterface(riid),(int)iun));

	HRESULT result=iun->QueryInterface( riid, obp );

	SPEW(( GROUP_DIRECTX, " -0x%x",(int)*obp));

	if( FAILED(result) )
		PAUSE(( "FAILED (0x%x - %s) - QueryInterface(%s from 0x%x)",result,ErrorNumberToMessage(result),GetReturnInterface(riid),(int)iun));

	return result;
}


ULONG wRelease( IUnknown *iun )
{
	SPEW(( GROUP_DIRECTX, "Release(0x%x)+",iun));

	ULONG result=iun->Release();

	SPEW(( GROUP_DIRECTX, " - %d",result));

	return result;
}

ULONG wAddRef( IUnknown *iun )
{
	SPEW(( GROUP_DIRECTX, "AddRef(0x%x)+",iun));

	ULONG result=iun->AddRef();

	SPEW(( GROUP_DIRECTX, " - %d",result));

	return result;
}


