CoGetClassObject hanhs up
Hi all, I've already posted it in other groups - no success!!
I'm facing with something really hard.
It worked fine on XP and stop working when porting to Vista!!!!!
One LocalService which export an interface via simple COM - ( marshal sample
of sdk )
In the ServiceMain()
//load COM librararies, initialize interface and classfactory
CoInitializeEx(NULL, COINIT_MULTITHREADED);
CoInitializeSecurity( 0, -1, 0, 0,
RPC_C_AUTHN_LEVEL_CONNECT,
RPC_C_IMP_LEVEL_IDENTIFY,
0, 0, 0 );
m_pCFBwbDev = new CFBwbDev(NULL);
if (NULL != m_pCFBwbDev)
{
// AddRef this cached pointer to the Class Factory.
m_pCFBwbDev->AddRef();
// Now register this class factory with COM.
hr = CoRegisterClassObject(
CLSID_DevIOCtrl,
m_pCFBwbDev,
CLSCTX_SERVER,
REGCLS_MULTIPLEUSE,
&m_dwCFBwbDev);
On the client side:
In the InitInstance of an exe:
// Init COM Libraries
HRESULT hr = CoInitializeEx( NULL, COINIT_MULTITHREADED );
hr = CoInitializeSecurity( NULL, -1, NULL, NULL,
RPC_C_AUTHN_LEVEL_CONNECT,
RPC_C_IMP_LEVEL_IDENTIFY,
NULL, 0, NULL );
then it laods a DLL which load the interface on the Service, within such DLL:
if( FAILED(CoGetClassObject( CLSID_DevIOCtrl,
CLSCTX_LOCAL_SERVER, NULL,
IID_IClassFactory,
(void**) &m_pClf )) )
{
return FALSE;
}
this function hangs up!!!!
I've walk down many roads, disabling UAC, grante access to COM via DCOMCNFG,
changed the AUTHLEVEL for CoInitializeSecurity...
Two days spent wihout any solution...
Please, help...
Thx
Ale
date: Thu, 26 Jun 2008 06:13:00 -0700
author: Ale