OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: Henk de Koning (henkk_at_COMPLEXIT.COM)
Date: Thu Dec 05 2002 - 02:18:02 CST

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    I'd try two things:

    1) use RPC__C_IMP_LEVEL_IDENTIFY
    2) give the service access to the desktop.

    The way clients in winsta0 interact with services was pretty much busted in
    Win2k, so I'm not surprised you find differences. But I'm currently too far
    away from good old DCOM to give you something more concrete than this.
    Sorry.

    -- Henkk

    ----- Original Message -----
    From: "Shweta Shintre" <shwetshriYAHOO.COM>
    To: <DCOMDISCUSS.MICROSOFT.COM>
    Sent: Thursday, December 05, 2002 5:44 AM
    Subject: DCOM on .Net

    > Hi,
    >
    > I have written a service through which I register my component as. The
    registration is done using CoRegisterClassObject(). This API returns with
    success.
    > Then I try to get an interface from this component using
    CoCreateInstance() API. This API fails with return value as
    REGDB_E_CLASSNOTREG. I checked the registry entries and the CLSID and
    interface entries are perfectly alright.
    >
    > This whole code is built on (compiled on) Win2K with VC++ 6.0. The code
    works fine on Win2K hosts but it fails on .Net.
    >
    > I am providing the code snippet for the same.
    > Please help me.
    >
    > Thanks and regards,
    > -Shweta.
    >
    > /* Registration of my component.*/
    > hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
    > /* SECURITY_DESCRIPTOR g_sd is set properly. */
    > if (!CoInitializeSecurity(&g_sd, -1, NULL, NULL,
    RPC_C_AUTHN_LEVEL_CONNECT,
    > RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE,
    NULL))
    > {
    > hr = CoRegisterClassObject(CLSID_SimpleObject, &classFactory,
    > CLSCTX_SERVER, REGCLS_MULTIPLEUSE,
    &dwRegister);
    > if (FAILED(hr))
    > {
    > g_isDCOMSupported = FALSE;
    > CoUninitialize();
    > return;
    > }
    > else
    > {
    > g_isDCOMSupported = TRUE;
    > }
    > }
    >
    > /*Using the component.*/
    > hr = CoInitialize(NULL);
    > if (FAILED(hr))
    > return;
    > hr = CoCreateInstance(CLSID_SimpleObject, NULL, CLSCTX_SERVER,
    > IID_IUnknown, (void **)&ptrIunkn);
    > if (FAILED(hr))
    > // log error;
    > ......
    >
    >
    >
    >
    >
    > ---------------------------------
    > Do you Yahoo!?
    >
    > ----------------------------------------------------------------
    > Users Guide http://discuss.microsoft.com/archives/mailfaq.asp
    > contains important info. Save time, search the archives at
    > http://discuss.microsoft.com/archives/index.html .
    > To unsubscribe, mailto:DCOM-signoff-requestDISCUSS.MICROSOFT.COM
    > Yahoo! Mail Plus - Powerful. Affordable. Sign up now
    >

    ----------------------------------------------------------------
    Users Guide http://discuss.microsoft.com/archives/mailfaq.asp
    contains important info. Save time, search the archives at
    http://discuss.microsoft.com/archives/index.html .
    To unsubscribe, mailto:DCOM-signoff-requestDISCUSS.MICROSOFT.COM