Re: Issue on calling CoRegisterClassObject in service application on Windows Server 2003

From: Harry Li (Hongjiangl_at_hotmail.com)
Date: 10/30/03

  • Next message: Randall: "Tracking User connections"
    Date: Thu, 30 Oct 2003 12:24:52 -0500
    
    

    Hi Dmitrii,

    Thanks for your reply, sorry I didn't explain the situation clearly the
    first time.

    Basically, what I try to do here is to run multiple COM server instances as
    NT services( I don't care it is the same sevice name or not). Since it is a
    EXE COM server so that I have to call CoRegisterClassObject to register the
    COM factory, and because I run it as multiple instances, I am using the
    moniker to register each COM instances with runnning object table with
    different string name ( profile names) so that base on different cleint
    requests( contain profile name information), I will be able to find the
    right COM server to forward the request.

    The problem is that for win2003, if you configure the COM EXE server as
    service using the "localSystem" account, you have to have an "localService"
    key entry in the HKey_class_root\AppID\MyComClassId and the key value has to
    be the service name otherwise you will get 0x80004015 error for
    CoRegisterClassObject(). This will not work for the same COM EXE server with
    different service names. I don't think you can add two the same services
    either(even with different pass in arguments) from the control panel.

    If you remove the "LocalService" entry from
    HKey_class_root\AppID\MyComClassId, CoRegisterClassObject() will work for
    all my COM service instance, however, when it tries to register with the
    Running object table, it gets the same error.

    So, given a sumary on this, my questions really are ( if you know): 1. what
    has been changed in terms of the security for COM method:
    CoRegisterClassObject and IRunningObjectTable::Register(). I tried to run
    all COM my servces with machine Administrator identity, I got the same
    problem. I would think that if the service process identity is machine
    administrator and COM object is configured runas administrator, I should not
    get any security error when calling both CoRegisterClassObject and
    IrunningObjectTable::Register().
    2. Is there any work around for my case?

    Thank you very much and I really appreciate your help on this matter.

    -Harry.

    "Dmitrii Zakharov [MSFT]" <dmitriiz@microsoft.com> wrote in message
    news:OdWtYpbnDHA.3612@TK2MSFTNGP11.phx.gbl...
    >
    >
    > Hi, Harry,
    >
    > I know of only one case when you will see 0x80004015 returned from
    > CoRegisterClassObject( ). This happens when you try to register a CLSID
    that
    > has an APPID with RunAs account different from your server's identity. I
    > don't know whether this is what happens in your case, but it's only
    > explanation I have.
    >
    > Now, however, I can explain why you had success in Win2000 and you
    regressed
    > in Win2003:
    >
    > In Win2000: any process can register ANY CLSID for a server if it is 1.
    > service 2. running now. COM doesn't block the registration in this case.
    > This is inherently a bug.
    >
    > In Win2003: the bug is fixed. COM blocks incorrect registration ALWAYS and
    > you see the error.
    >
    > Hope this helps,
    > Dmitrii
    >
    >
    > "Harry Li" <Hongjiangl@hotmail.com> wrote in message
    > news:Oi0RgWBmDHA.2436@TK2MSFTNGP09.phx.gbl...
    > > Hi Everyone,
    > >
    > > I got a problem when running an COM service application on windows
    Server
    > > 2003 machine. It is working fine on windows 2000. Basically, I have this
    > COM
    > > application can be running as local server or services. It is working
    > great
    > > when running as local server on Windows Server 2003, but not when
    running
    > as
    > > services. It fails when calling CoRegisterClassObject and the return
    error
    > > is 0x80004015, which means "The class is configured to run as a security
    > id
    > > different from the caller ". I did find some topics on help to get
    around
    > it
    > > in the debug mode ( remove the LocalService name value pair from
    > > "HKey_class_root\appid\your applicatoin" registry). Even I did this in
    the
    > > release mode, I will get the same error code when registering my COM
    > object
    > > in the system running table ( Call: IRunningObjectTable::Register()) I
    am
    > > really blocked by this. I really appreciate if any expert can help me on
    > > this.
    > >
    > > Thanks.
    > >
    > > -Harry.
    > >
    > >
    >
    >


  • Next message: Randall: "Tracking User connections"

    Relevant Pages

    • Re: Altering default submit button when user presses Enter
      ... The URL I provided did not require you to register a domain. ... insert multiple file upload elements into the contact form itself. ... If you just want to do this client-side, java script would be the way to ... How the server responds to an error concerning form data validating ...
      (alt.html)
    • Re: COM activation models
      ... that calls CoRegisterClassObject - STA or MTA? ... > SERVER PROCESS FOR THE DESIGNATED CLASS. ... > Server processes can register class objects for more than one class. ...
      (microsoft.public.vc.atl)
    • Re: Issue on calling CoRegisterClassObject in service application on Windows Server 2003
      ... any process can register ANY CLSID for a server if it is 1. ... It fails when calling CoRegisterClassObject and the return error ...
      (microsoft.public.windows.server.security)
    • Re: computer browser service wont start
      ... I've noticed that dnsApi is sometimes one of the things that starts early before everything it needs is actually working, e.g. the TCP/IP and network stack. ... In the situations I've seen the Event Log entry from dnsApi that you report, the computer did successfully register itself later. ... This assumes that the targetted DNS server can accept Dynamic registrations and the computer doing the dynamic registration is permitted to do so. ...
      (microsoft.public.windows.server.general)
    • ASP: Get user login ID
      ... But when we register the dll on our web ... server, and call it from our ASP code, it generates an error. ... Dim lngCharsReturned As Long ...
      (microsoft.public.inetserver.iis.security)