DCOM Server Configuration and Remote Acces - Part 2
I have already asked this question, and fixed a few problems since then and
now I am ready to formulate the question more clear and hope for some more
help.
I have a COM server which is implemented in ATL and registered as a service.
I have a client that is MMC snap-in implemented in C++.
MMC snap-in uses COM object(s) from the service in the following manner (See
code below).
It works correct on local computer.
It does not work when I try to connect to remote computer.
I have tested connection from XP to 2000 and from XP to 2003 with different
DCOM configurations including giving full permissions to everyone.
I would like it to work in a way similar to Microsoft Snap-Ins, for example
event log and I would like to be able to explain to users (administrators at
customer's site) how to configure access and meanwhile I do not understand
how to configure it myself.
[CODE]
MULTI_QI mqi = {&IID_IUnknown, NULL, S_OK};
COSERVERINFO serverInfo = {NULL, m_host, NULL, NULL};
if (m_asDifferentUser)
{
serverInfo.pAuthInfo = &coAuthInfo;
}
else
{
serverInfo.pAuthInfo = NULL;//Default negotiation.
}
hResult = CoCreateInstanceEx(__uuidof(ConfigurationProviderLib::Provider),
NULL, CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER, &serverInfo, 1, &mqi);
if (FAILED(hResult)) _com_issue_error(hResult);
[/CODE]
Comments to code above.
m_host is a name of the computer user wants to connect to. NULL if user
wants to connect to local computer.
m_asDifferentUser - is a flag that is set to true when user wants to
specify user name and password.
coAuthInfo - contains all parameters set to default as follows and
authidentity data set to user name, password and domain. My test computers
are not in the domain and I specify IP of the computer where the COM server
is running as a server name.
dwAuthnSvc = RPC_C_AUTHN_DEFAULT;
dwAuthzSvc = RPC_C_AUTHZ_DEFAULT;
pwszServerPrincName = NULL;
dwAuthnLevel = RPC_C_AUTHN_LEVEL_DEFAULT;
dwImpersonationLevel = RPC_C_IMP_LEVEL_DEFAULT;
dwCapabilities = RPC_C_QOS_CAPABILITIES_DEFAULT;
As a result of this code I get m_hResult==E_ACCESSDENIED.
Whaft else can I check, both in configuration and in code to make things
work.
I can open the remote computer's administrative shares, so, theoretically,
it is possible to connect to them.