I 'm fed up trying to instantiate a remote object.
dcomcnfg used, access enabled to all, Windows 7, same workgroup PCs.
CoInitializeEx(0,COINIT_APARTMENTTHREADED);
CoInitializeSecurity(0, -1, NULL, NULL,RPC_C_AUTHN_LEVEL_DEFAULT, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE, NULL);
COAUTHINFO ca = {0};
ca.dwAuthnSvc = RPC_C_AUTHN_WINNT;
ca.dwAuthzSvc = RPC_C_AUTHZ_NONE;
ca.dwAuthnLevel = RPC_C_AUTHN_LEVEL_DEFAULT;
ca.dwImpersonationLevel = RPC_C_IMP_LEVEL_IMPERSONATE;
COAUTHIDENTITY id = {0};
ca.pAuthIdentityData = &id;
id.User = (USHORT*)<username>;
id.UserLength = length;
id.Password = (USHORT*)<password>;
id.PasswordLength = pwdlength;
id.Domain = (USHORT*)L"WORKGROUP";
id.DomainLength = 9;
id.Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE;
COSERVERINFO c = {0};
c.pwszName = L"192.168.10.3";
c.pAuthInfo = &ca;
MULTI_QI res = {0};
res.pIID = &TheIID;
HRESULT hr = CoCreateInstanceEx(TheCLSID,0,CLSCTX_REMOTE_SERVER,&c,1,&res);
Always E_ACCESSDENIED. And by the way, this sample (http://support.microsoft.com/kb/259011) works. But I can't find the source of it.
The server also calls CoInitializeSecurity() with the same levels.
When targetting a Windows XP machine, CoCreateInstanceEx() returns S_OK, but the server isn't created. When targetting Windows 7, E_ACCESSDENIED.
Any clues? Also, the working sample doesn't use U+P. Perhaps I should try an anonymous call?