Calling COM+ objects from a Windows Service in .NET



I'm rewriting one of our Windows Service previously written in C++ in .NET.
The service is calling COM objects in a COM+ server application on the same
machine (no call occurs from COM+ to my service). The Service is running
under the LocalSystem account.

When running the service, the C++ code used is :

CSecurityDescriptor sd;
sd.InitializeFromThreadToken();
hr = CoInitializeSecurity(sd, -1, NULL, NULL,
RPC_C_AUTHN_LEVEL_PKT, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE,
NULL);
_ASSERTE(SUCCEEDED(hr));

hr = _Module.RegisterClassObjects(CLSCTX_LOCAL_SERVER |
CLSCTX_REMOTE_SERVER, REGCLS_MULTIPLEUSE);
_ASSERTE(SUCCEEDED(hr));


Do I have to write the same code in my new .NET service ? How do I achieve
this in .NET ?

Christian


.



Relevant Pages

  • RE: ceicw fails every time
    ... I'd like confirming CEICW steps with you to ensure there is not problem ... You have to rerun the CEICW to make sure your SBS 2003 server have right ... On the "Services Configuration" page, select all the items and then ... Calling CCertCommit::ValidatePropertyBag ...
    (microsoft.public.windows.server.sbs)
  • CEICW fails at network
    ... I have recently taken over the support of a site with SBS 2003 Premium ... had not prevously been run on the server so I ran the wizard to setup the RWW. ... Call to Reading hardware selection returned ok. ... calling CNetCommit::ValidateRouterConnectionProperties. ...
    (microsoft.public.windows.server.sbs)
  • Re: Can not access Web and FTP sites from Internet
    ... IP address to your router? ... unless you host a web site in your server. ... use the port 443 which is SSL more secure. ... > calling CNetCommit::ValidateRouterConnectionProperties. ...
    (microsoft.public.windows.server.sbs)
  • RE: CEICW Error on Email config
    ... Reboot the server. ... Install the ISA again from the SBS CD ... How to configure Internet access in Windows Small Business Server 2003 ... | calling CNetCommit::ValidateFulltimeConnectionProperties. ...
    (microsoft.public.windows.server.sbs)
  • CEICW Fails at RegisterMSBOExchangeBP
    ... Ethernet adapter Server Local Area Connection: ... Call to Reading hardware selection returned ok. ... calling CNetCommit::ValidateRouterConnectionProperties. ... Call to Reading preferred DNS server IP returned ok. ...
    (microsoft.public.windows.server.sbs)

Loading