locked
InvokeHelper() throws Access is denied exception RRS feed

  • Question

  • Community, I have quite interesting and in the same time heavy problem. I have VB .NET application + Service + C++ application. C++ application generates some data and makes callbacks using InvokeHelper() method:

    InvokeHelper(0x60030000, DISPATCH_METHOD, VT_EMPTY, NULL, parms,
         eventType, eventValue);

    The first parameter is the dispid of method which should be called. Strange approach, but this is not my code and I can not change this way.

    In service I have method marked by dispid attribute to get this callback from C++ application.

    <DispId(&H60030000)>
    Public Sub ServerEvent(ByVal vEventType As Integer, ByVal vEventValue As Object)
        RaiseEvent ControlPanelStateChange(vEventType, vEventValue)
    End Sub

    This code works correctly if I logged on as admin. But if windows user has not administrator permissions, right after calling InvokeHelper() method the next exception occurs:

    First-chance exception at 0x75B7C42D (KernelBase.dll) in application.exe: 0x80070005: Access is denied

    Do you have any ideas? I have played with DCOM permissions, but result is the same.

    Any help would be fantastic!

    Wednesday, July 22, 2015 11:28 AM

Answers

  • The solution of the problem is:

    DCOMCNFG, right click on the My Computer and select properties -> COM Securities tab -> Access Permissions -> click Edit Defaults and add Network Service to it and give it Allow local access permission. Do the same for < Machine_name >\Users.

    Then -> Launch and Activation Permissions, click Edit Defaults and add Network Service to it and give it Local launch and Local Activation permission. Do the same for < Machine_name >\Users.

    Thursday, July 30, 2015 9:07 AM

All replies

  • Hi,

    Thanks for posting here.

    According to your description, the project can work well with administrator users but not normal users. How did you do with DCOM permissions? Do you use DCOMCNFG.exe to do that? Please make sure you set permissions, including both launch and access permissions.

    About how to use DCOMCNFG to enable COM Security, please refer to the link below.

    Enabling COM Security Using DCOMCNFG

    If the permissions on the service account that is used to start the service does not have permissions to the Windows registry keys used by the service.

    In order to provide better support, it will be better for you to provide reproducing sample here. Otherwise it is a little hard to find the root cause.

    May


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, July 23, 2015 10:01 AM
  • The solution of the problem is:

    DCOMCNFG, right click on the My Computer and select properties -> COM Securities tab -> Access Permissions -> click Edit Defaults and add Network Service to it and give it Allow local access permission. Do the same for < Machine_name >\Users.

    Then -> Launch and Activation Permissions, click Edit Defaults and add Network Service to it and give it Local launch and Local Activation permission. Do the same for < Machine_name >\Users.

    Thursday, July 30, 2015 9:07 AM