locked
How to re-initialize the security parameter of DCOM ? RRS feed

  • Question

  •  

    Hi, everyone. I'm in troble about DCOM security in Vista.

    When the client called CoInitializeSecurity twice with calling CoUninitinialize & CoInitialize, it failed by error "RPC_E_TOO_LATE". (*like following code sample)

    This error occurs only in Vista OS. The program  works correctly in Xp and 2003ServerR2.

     ------------------------------------------------------------------------------------------------------

    CoInitalize(NULL);

    CoInitializeSecurity( ...some settings for authentication.. );

    HRESULT hr = CreateInstanceEx( ..some parameters... );

    if(FAILED(hr)) {

        CoUninitialize();

        CoInitialize(NULL);

        CoInitializeSecurity( ..another settings for authentication.. ); -----------> Failed!!

        CreateInstanceEx( ..some parameters.. );

    }

    -----------------------------------------------------------------------------------------------------

    if anybody know why this happend or if you have some good way to change security setting of DCOM(I just want to know how to change authentic info ),please tell me.

     

    Kohei

     

    Thursday, December 14, 2006 5:10 AM

All replies

  • Same thing happened for me.

    I have the code working in Vista as a client, but when I port the logic to the OCX version, it keeps failing with the same error. Someone please help!

    Thanks in advance!

    Will

    Friday, February 2, 2007 8:05 AM