none
Exception in INetCfgClassSetup::Install RRS feed

  • Question

  • I got a crash when installing a ndis IM driver. I just use NetCfgApi like the sample in ddk named snetcfg to do that, here is my code:

    hr = NetCfg->QueryNetCfgClass (ClassGuid, IID_INetCfgClassSetup,(void**)&NetCfgClassSetup);
    if (SUCCEEDED(hr))
    {
    hr = NetCfgClassSetup->Install(ComponentId, &OboToken, 0, 0, NULL, NULL, &NetCfgCpt);
    if (S_OK == hr)
    {
    ReleaseObj(NetCfgCpt);
    }
    ReleaseObj(NetCfgClassSetup);
    }

    But sometimes, crash happened. This is the stack:

    00000000`001cd398 000007fe`fdc41430 ntdll!NtWaitForMultipleObjects+0xa
    00000000`001cd3a0 00000000`77b21723 KERNELBASE!WaitForMultipleObjectsEx+0xe8
    00000000`001cd4a0 00000000`77b9b5e5 kernel32!WaitForMultipleObjectsExImplementation+0xb3
    00000000`001cd530 00000000`77b9b767 kernel32!WerpReportFaultInternal+0x215
    00000000`001cd5d0 00000000`77b9b7bf kernel32!WerpReportFault+0x77
    00000000`001cd600 00000000`77b9b9dc kernel32!BasepReportFault+0x1f
    00000000`001cd630 00000000`77cb3398 kernel32!UnhandledExceptionFilter+0x1fc
    00000000`001cd710 00000000`77c385c8 ntdll! ?? ::FNODOBFM::`string'+0x2365
    00000000`001cd740 00000000`77c49d2d ntdll!_C_specific_handler+0x8c
    00000000`001cd7b0 00000000`77c391cf ntdll!RtlpExecuteHandlerForException+0xd
    00000000`001cd7e0 00000000`77c71248 ntdll!RtlDispatchException+0x45a
    00000000`001cdec0 000007fe`f9c1a652 ntdll!KiUserExceptionDispatcher+0x2e
    00000000`001ce5f8 000007fe`f9c207c0 netcfgx!StringCbCopyW+0x42
    00000000`001ce600 000007fe`f9c38502 netcfgx!HrCiInstallFilterDevice+0x228
    00000000`001ce710 000007fe`f9c2ed10 netcfgx!CFilterDevices::InstallFilterDevicesIfNeeded+0x21e
    00000000`001cebd0 000007fe`f9c2d56a netcfgx!CModifyContext::ApplyChanges+0x1374
    00000000`001cef20 000007fe`f9c2d829 netcfgx!CModifyContext::HrApplyIfOkOrCancel+0x2e
    00000000`001cef50 000007fe`f9c3360c netcfgx!CModifyContext::HrPopRecursionDepth+0x25
    00000000`001cef80 000007fe`f9c31847 netcfgx!CModifyContext::HrInstallNewOrReferenceExistingComponent+0x100
    00000000`001cefb0 00000001`3f881592 netcfgx!CImplINetCfgClass::Install+0x16b

    Monday, July 14, 2014 7:17 AM

Answers

  • That can happen if your INF is missing some required NDI keys. For example, I think I've seen it happen when the INF is missing its

    HKR, Ndi\Interfaces, FilterMediaTypes,,". . ."

    key.  The problem is, it's not necessarily your INF that is the problem; this crash can happen while installing your driver, even if some other filter installed on the system has a bad INF.

    If this happens 100% of the time when installing your INF, then it's probably your INF that is missing something.  Compare your INF, line-by-line, to a known-working INF.

    Otherwise, if this is Windows 8 or later, you can pull the NetCfg log files and see if you can narrow down the faulty INF.  Enable the trace provider {41E8E8F3-7B6D-488E-B350-F696DD24AFB6} with all flags and level 5.  Then re-run the scenario, and check what the trace immediately before the crash was.  Hopefully, it's "Installing filter device for XXX over adapter YYY".  The XXX will tell you which filter driver has a deficient INF; you should uninstall that filter.

    Finally, note that in rare cases, a single machine's NetCfg database can become internally inconsistent.  If this happens, then the only supported way to recover the machine is to reinstall the OS.

    Monday, July 14, 2014 4:01 PM
  • Unfortunately, no, we don't have any great diagnostics tools for the NetCfg database.  It usually takes me several hours of manually picking through the registry before I can determine whether there are any issues.

    • Marked as answer by firtank Wednesday, July 16, 2014 11:28 AM
    Tuesday, July 15, 2014 4:10 AM

All replies

  • That can happen if your INF is missing some required NDI keys. For example, I think I've seen it happen when the INF is missing its

    HKR, Ndi\Interfaces, FilterMediaTypes,,". . ."

    key.  The problem is, it's not necessarily your INF that is the problem; this crash can happen while installing your driver, even if some other filter installed on the system has a bad INF.

    If this happens 100% of the time when installing your INF, then it's probably your INF that is missing something.  Compare your INF, line-by-line, to a known-working INF.

    Otherwise, if this is Windows 8 or later, you can pull the NetCfg log files and see if you can narrow down the faulty INF.  Enable the trace provider {41E8E8F3-7B6D-488E-B350-F696DD24AFB6} with all flags and level 5.  Then re-run the scenario, and check what the trace immediately before the crash was.  Hopefully, it's "Installing filter device for XXX over adapter YYY".  The XXX will tell you which filter driver has a deficient INF; you should uninstall that filter.

    Finally, note that in rare cases, a single machine's NetCfg database can become internally inconsistent.  If this happens, then the only supported way to recover the machine is to reinstall the OS.

    Monday, July 14, 2014 4:01 PM
  • Thank you for your answer.

    The crash is not happen every times. I found it happened sometimes in win7 64 bits and win8 64 bits. I'll continue to try this scenario as you said to find the problem filter driver.

    And sometimes crash not happened, but the call to NetCfgClassSetup->Install not return forever.

    Is there some way to check if the NetCfg database was inconsistent?

    Tuesday, July 15, 2014 4:06 AM
  • Unfortunately, no, we don't have any great diagnostics tools for the NetCfg database.  It usually takes me several hours of manually picking through the registry before I can determine whether there are any issues.

    • Marked as answer by firtank Wednesday, July 16, 2014 11:28 AM
    Tuesday, July 15, 2014 4:10 AM
  • Oh, what a pity! 

    By the way, could you give me some more information about NetCfg database?

    Thank you very much.

    Tuesday, July 15, 2014 5:56 AM
  • Sorry, the format of the database is an implementation detail, and we cannot release that information. (There are already some apps that have reverse-engineered parts of the database, and keeping those apps going makes my job a lot more difficult than it ought to be.)
    Tuesday, July 15, 2014 11:06 PM
  • Never mind. And thank you

    • Edited by firtank Wednesday, July 16, 2014 4:59 AM
    Wednesday, July 16, 2014 4:51 AM