#include "stdafx.h"
#include "drotdll.h"

//extern "C" const CLSID CLSID_RemoteROT ;
//extern "C" const IID IID_IRemoteROT ;
/*

extern "C" __declspec(dllexport) HRESULT WINAPI GetRemoteRunningObjectTable (LPOLESTR pServerName, IRunningObjectTable **ppRot)
{
	HRESULT hr ;
	COSERVERINFO si ;

	si.dwReserved1 = 0 ;
	si.pwszName = pServerName ;
	si.pAuthInfo = NULL ;
	si.dwReserved2 = 0 ;

	MULTI_QI mqi [1] ;

	mqi [0].pIID = &IID_IRemoteROT ;
	mqi [0].pItf = NULL ;
	mqi [0].hr = 0 ;

	hr = CoCreateInstanceEx (
		CLSID_RemoteROT,
		NULL, 
		CLSCTX_REMOTE_SERVER,
	//	CLSCTX_LOCAL_SERVER,
		&si,
		1,
		mqi) ;

	if (hr != S_OK)
	{
		char out [256] ;
		wsprintf (out, "Couldn't launch remote server, hr == 0x%x", hr) ;
		MessageBox (NULL, out, "RemoteROT", 0) ;
	}

	IRemoteROT *pGet = (IRemoteROT *) mqi [0].pItf ;

	hr = pGet->GetRemoteRunningObjectTable (ppRot) ;

	pGet->Release ( ) ;

	return hr ;
}

*/