none
NDIS driver deploy problem with visual studio 2012 RRS feed

  • Question

  • Hello Everybody,

    Some of the problems encountered when I am trying to deploy the template Nids project  (networking->Filter driver :NDIS).

    The project was set to deploy on the test server. "enable deployment, fill hardware id with ms_ndislwf1"

    Then press F5 to begin debug. Failure when Run process “ DevCon  c:\DriverTest\Drivers\msndislwf1.inf  ms_ndislwf1” with return value 2.

    How can I deploy the sample project with visual studio 2012 correctly?

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

    Dev Environment:

    Host :   Win 7(x86)  + Visual Studio 2012 Ultimate 11.0.50727.1  + WDK 8.59.25584

    Test:    Windows Server 2012(x64) RC Datacenter build 8400

       The test server was already provisioned by Host.

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

    Wednesday, October 31, 2012 9:24 AM

Answers

  • Don't use devcon.exe to install NDIS filter drivers or NDIS protocol drivers.  Instead, you can use the built-in netcfg.exe tool to install these types of drivers.

    There is something wrong with the deployment configuration -- it looks like it's trying to deploy a hardware (PNP) driver, when NDIS filter drivers are not really PNP drivers.  For example, NDIS filters don't actually have a HWID.

    • Marked as answer by Zhou yutian Monday, November 5, 2012 7:50 AM
    Friday, November 2, 2012 10:39 PM
  • you can use VS to deploy, just don't choose the devcon option. you can run a custom command instead.

    to uninstall

    netcfg -u MyFilter

    to install

    netcfg -c s -i MyFilter -l c:\path\to\MyFilter.inf


    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    • Marked as answer by Zhou yutian Monday, November 5, 2012 7:50 AM
    Monday, November 5, 2012 3:58 AM

All replies

  • did you update the INF to match the hw ID?

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Wednesday, October 31, 2012 2:59 PM
  • Yes , the hw ID in the INF as follows.

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

    [Manufacturer]
    %Msft%=MSFT,NTx86,NTia64,NTamd64,NTarm

    [MSFT.NTx86]
    %ndislwf1_Desc%=Install, MS_ndislwf1

    [MSFT.NTia64]
    %ndislwf1_Desc%=Install, MS_ndislwf1

    [MSFT.NTamd64]
    %ndislwf1_Desc%=Install, MS_ndislwf1

    [MSFT.NTarm]
    %ndislwf1_Desc%=Install, MS_ndislwf1

    Thursday, November 1, 2012 1:05 AM
  • what does %windir%\inf\setupapi.log.dev say?

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.


    Thursday, November 1, 2012 5:37 AM
  • The log in setupapi.dev.log

    >>>  [Device Install (UpdateDriverForPlugAndPlayDevices) - MS_ndislwf1]
    >>>  Section start 2012/11/02 11:18:20.394
          cmd: "C:\DriverTest\devcon.exe" -f install C:\DriverTest\Drivers\ndislwf1.inf MS_ndislwf1
    <<<  Section end 2012/11/02 11:18:20.394
    <<<  [Exit status: SUCCESS]

    But the command line on the test server show :

         Executing command line: "C:\DriverTest\devcon.exe" -f install C:\DriverTest\Drivers\ndislwf1.inf MS_ndislwf1

         Process exit code:2

         Exit code does NOT math a valid passing exit code.

         System can not find the specified file.

         Failed: Process failed to complete successfully

         EndGroup: DriverTestTasks::_RunProcess [Failed]

    The complete contents of the log file:

    [Device Install Log]
         OS Version = 6.2.8400
         Service Pack = 0.0
         Suite = 0x0090
         ProductType = 3
         Architecture = amd64
    [BeginLog]
    [Boot Session: 2012/11/02 10:40:40.493]
    >>>  [SetupCopyOEMInf - C:\DriverTest\Drivers\ndislwf1.inf]
    >>>  Section start 2012/11/02 11:18:14.363
          cmd: c:\program files (x86)\windows kits\8.0\testing\runtimes\taef\te.processhost.exe  /ThreadingModel="None" /DefaultAppDomain="false" /RunAs="Elevated" /wexcommunication_connectionid=7022afc8-0715-4c7a-979c-11d5cd48caf7 /wexcommunication_protocol=ncalrpc /wexlogger_connectiondata={wexcommunication_connectionid=cb6a35b0-9261-49dd-b791-c3daba7e8f2b,wexcommunication_connecttimeout=60000,wexcommunication_protocol=ncalrpc,wexlogger_parent_thread_id=5836} /stackframecount=50 /parentprocessid=6012
         sto: {Import Driver Package: C:\DriverTest\Drivers\ndislwf1.inf} 11:18:14.363
         sto:      Driver Store   = C:\Windows\System32\DriverStore [Online] (6.2.8400)
         sto:      Driver Package = C:\DriverTest\Drivers\ndislwf1.inf
         sto:      Architecture   = amd64
         sto:      Flags          = 0x00000000
         inf:      Provider       = Microsoft
         inf:      Class GUID     = {4d36e974-e325-11ce-bfc1-08002be10318}
         inf:      Driver Version = 11/02/2012,11.16.57.242
         inf:      Catalog File   = ndislwf1.cat
         inf:      Version Flags  = 0x00000001
         flq:      Copying 'C:\DriverTest\Drivers\ndislwf1.cat' to 'C:\Users\WDKREM~1.010\AppData\Local\Temp\{5b086186-76ad-5d4b-9a35-dd729f81fb36}\ndislwf1.cat'.
         flq:      Copying 'C:\DriverTest\Drivers\ndislwf1.inf' to 'C:\Users\WDKREM~1.010\AppData\Local\Temp\{5b086186-76ad-5d4b-9a35-dd729f81fb36}\ndislwf1.inf'.
         flq:      Copying 'C:\DriverTest\Drivers\ndislwf1.sys' to 'C:\Users\WDKREM~1.010\AppData\Local\Temp\{5b086186-76ad-5d4b-9a35-dd729f81fb36}\ndislwf1.sys'.
         pol:      {Driver package policy check} 11:18:14.394
         pol:      {Driver package policy check - exit(0x00000000)} 11:18:14.394
         sto:      {Stage Driver Package: C:\Users\WDKREM~1.010\AppData\Local\Temp\{5b086186-76ad-5d4b-9a35-dd729f81fb36}\ndislwf1.inf} 11:18:14.394
         inf:           {Query Configurability: C:\Users\WDKREM~1.010\AppData\Local\Temp\{5b086186-76ad-5d4b-9a35-dd729f81fb36}\ndislwf1.inf} 11:18:14.394
         inf:                Driver package 'ndislwf1.inf' is configurable.
         inf:           {Query Configurability: exit(0x00000000)} 11:18:14.394
         flq:           Copying 'C:\Users\WDKREM~1.010\AppData\Local\Temp\{5b086186-76ad-5d4b-9a35-dd729f81fb36}\ndislwf1.cat' to 'C:\Windows\System32\DriverStore\Temp\{2ac8fe51-de79-0f46-a670-c2241214546a}\ndislwf1.cat'.
         flq:           Copying 'C:\Users\WDKREM~1.010\AppData\Local\Temp\{5b086186-76ad-5d4b-9a35-dd729f81fb36}\ndislwf1.inf' to 'C:\Windows\System32\DriverStore\Temp\{2ac8fe51-de79-0f46-a670-c2241214546a}\ndislwf1.inf'.
         flq:           Copying 'C:\Users\WDKREM~1.010\AppData\Local\Temp\{5b086186-76ad-5d4b-9a35-dd729f81fb36}\ndislwf1.sys' to 'C:\Windows\System32\DriverStore\Temp\{2ac8fe51-de79-0f46-a670-c2241214546a}\ndislwf1.sys'.
         sto:           {DRIVERSTORE IMPORT VALIDATE} 11:18:14.410
         sig:                {_VERIFY_FILE_SIGNATURE} 11:18:14.410
         sig:                     Key      = ndislwf1.inf
         sig:                     FilePath = C:\Windows\System32\DriverStore\Temp\{2ac8fe51-de79-0f46-a670-c2241214546a}\ndislwf1.inf
         sig:                     Catalog  = C:\Windows\System32\DriverStore\Temp\{2ac8fe51-de79-0f46-a670-c2241214546a}\ndislwf1.cat
    !    sig:                     Verifying file against specific (valid) catalog failed! (0x800b0109)
    !    sig:                     Error 0x800b0109: A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.
         sig:                {_VERIFY_FILE_SIGNATURE exit(0x800b0109)} 11:18:14.441
         sig:                {_VERIFY_FILE_SIGNATURE} 11:18:14.441
         sig:                     Key      = ndislwf1.inf
         sig:                     FilePath = C:\Windows\System32\DriverStore\Temp\{2ac8fe51-de79-0f46-a670-c2241214546a}\ndislwf1.inf
         sig:                     Catalog  = C:\Windows\System32\DriverStore\Temp\{2ac8fe51-de79-0f46-a670-c2241214546a}\ndislwf1.cat
         sig:                     Success: File is signed in Authenticode(tm) catalog.
         sig:                     Error 0xe0000241: The INF was signed with an Authenticode(tm) catalog from a trusted publisher.
         sig:                {_VERIFY_FILE_SIGNATURE exit(0xe0000241)} 11:18:14.441
         sto:           {DRIVERSTORE IMPORT VALIDATE: exit(0x00000000)} 11:18:14.456
         sig:           Signer Score = 0x0F000000
         sig:           Signer Name  = WDKTestCert z00211320,129932175568294875
         sto:           {DRIVERSTORE IMPORT BEGIN} 11:18:14.456
         sto:           {DRIVERSTORE IMPORT BEGIN: exit(0x00000000)} 11:18:14.456
         cpy:           {Copy Directory: C:\Windows\System32\DriverStore\Temp\{2ac8fe51-de79-0f46-a670-c2241214546a}} 11:18:14.456
         cpy:                Target Path = C:\Windows\System32\DriverStore\FileRepository\ndislwf1.inf_amd64_c3096d720ab338a7
         cpy:           {Copy Directory: exit(0x00000000)} 11:18:14.456
         idb:           {Register Driver Package: C:\Windows\System32\DriverStore\FileRepository\ndislwf1.inf_amd64_c3096d720ab338a7\ndislwf1.inf} 11:18:14.456
         idb:                Created driver package object 'ndislwf1.inf_amd64_c3096d720ab338a7' in DRIVERS database node.
         idb:                Created driver INF file object 'oem11.inf' in DRIVERS database node.
         idb:                Registered driver package 'ndislwf1.inf_amd64_c3096d720ab338a7' with 'oem11.inf'.
         idb:           {Register Driver Package: exit(0x00000000)} 11:18:14.456
         idb:           {Publish Driver Package: C:\Windows\System32\DriverStore\FileRepository\ndislwf1.inf_amd64_c3096d720ab338a7\ndislwf1.inf} 11:18:14.456
         idb:                Activating driver package 'ndislwf1.inf_amd64_c3096d720ab338a7'.
         cpy:                Published 'ndislwf1.inf_amd64_c3096d720ab338a7\ndislwf1.inf' to 'oem11.inf'.
         idb:                Indexed 2 device IDs for 'ndislwf1.inf_amd64_c3096d720ab338a7'.
         idb:           {Publish Driver Package: exit(0x00000000)} 11:18:14.456
         sto:           {DRIVERSTORE IMPORT END} 11:18:14.456
         sig:                Installed catalog 'ndislwf1.cat' as 'oem11.cat'.
         sto:           {DRIVERSTORE IMPORT END: exit(0x00000000)} 11:18:14.503
         sto:      {Stage Driver Package: exit(0x00000000)} 11:18:14.503
         sto:      Driver Store Filename = C:\Windows\System32\DriverStore\FileRepository\ndislwf1.inf_amd64_c3096d720ab338a7\ndislwf1.inf
         sto: {Import Driver Package: exit(0x00000000)} 11:18:14.519
         inf: Driver Store Path: C:\Windows\System32\DriverStore\FileRepository\ndislwf1.inf_amd64_c3096d720ab338a7\ndislwf1.inf
         inf: Published Inf Path: C:\Windows\INF\oem11.inf
    <<<  Section end 2012/11/02 11:18:14.519
    <<<  [Exit status: SUCCESS]
    >>>  [Device Install (UpdateDriverForPlugAndPlayDevices) - MS_ndislwf1]
    >>>  Section start 2012/11/02 11:18:20.394
          cmd: "C:\DriverTest\devcon.exe" -f install C:\DriverTest\Drivers\ndislwf1.inf MS_ndislwf1
    <<<  Section end 2012/11/02 11:18:20.394
    <<<  [Exit status: SUCCESS]

    Friday, November 2, 2012 3:37 AM
  • Don't use devcon.exe to install NDIS filter drivers or NDIS protocol drivers.  Instead, you can use the built-in netcfg.exe tool to install these types of drivers.

    There is something wrong with the deployment configuration -- it looks like it's trying to deploy a hardware (PNP) driver, when NDIS filter drivers are not really PNP drivers.  For example, NDIS filters don't actually have a HWID.

    • Marked as answer by Zhou yutian Monday, November 5, 2012 7:50 AM
    Friday, November 2, 2012 10:39 PM
  • Does it mean the visual studio 2012 kernel debug model could not be used for ndis driver debugging? I am trying to deploy the Hyper-V sample extension: http://code.msdn.microsoft.com/Hyper-V-Extensible-Virtual-e4b31fbb The install.cmd contains netcfg command can install the sample correctly。 I tried to attach the kernel process in test server, It stay on the status ”Waiting to connect to target“。 How can I debug the project? Thanks.
    Monday, November 5, 2012 3:23 AM
  • you can use VS to deploy, just don't choose the devcon option. you can run a custom command instead.

    to uninstall

    netcfg -u MyFilter

    to install

    netcfg -c s -i MyFilter -l c:\path\to\MyFilter.inf


    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    • Marked as answer by Zhou yutian Monday, November 5, 2012 7:50 AM
    Monday, November 5, 2012 3:58 AM
  • It can be deployed, thanks.

    Monday, November 5, 2012 7:50 AM