Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: Sun, 27 Jan 2008 14:50:29 +0200,    group: microsoft.public.platformsdk.com_ole        back       


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.
date: Sun, 27 Jan 2008 14:50:29 +0200   author:   Max please@newsgroup

Re: DCOM Server Configuration and Remote Acces - Part 2   
I have already figured out one problem in my code. I have to allow In-proc 
handlers. That's how it is going to work with DCOM.

CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER | CLSCTX_INPROC_HANDLER

"Max" <please@newsgroup> wrote in message 
news:ulWoTMOYIHA.5472@TK2MSFTNGP06.phx.gbl...
>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.
>
date: Sun, 27 Jan 2008 16:18:45 +0200   author:   Max please@newsgroup

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us