Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTDEV

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

Automate HLK testing driver

ksupallksupall Member Posts: 27

Hello, NTDEV!
I'm developing project to automate HLK test. So I have a question how to choose tests for my driver. I have:

$Project = $manager.CreateProject("My project")
$ProductInstance = $Project.CreateProductInstance("My Product Instance", $Pool, $OSPlatform)

So what is next? What target should I choose and how? When I signed drivers manually I checked my driver in the list on software device tab.

Comments

  • CaptainFlintCaptainFlint Member Posts: 70

    You can use Machine.GetTestTargets() for obtaining all the available targets on the machine from your pool, enumerate them, and identify the one you need by the driver name (for non-PNP devices) or device identifier (for PNP). At least, this is what AutoHCK does. :)

  • ksupallksupall Member Posts: 27

    @CaptainFlint said:
    You can use Machine.GetTestTargets() for obtaining all the available targets on the machine from your pool, enumerate them, and identify the one you need by the driver name (for non-PNP devices) or device identifier (for PNP). At least, this is what AutoHCK does. :)

    Thank you a lot! And now I have another question... I want to add folders with my .sys driver files and also folder with symbols. I tried this way:

    $Package = new-object -typename Microsoft.Windows.Kits.Hardware.ObjectModel.Submission.PackageWriter -args $Project
    $Package.AddDriver("C:\Users\ksenya\Documents\win10\x64\driver", "C:\Users\ksenya\Documents\win10\x64\driver\pdb", $Target, "English", $errors, $warnings)

    But I got a mistake Cannot find an overload for "AddDriver" and the argument count: "6". What am I doing wrong?(

  • CaptainFlintCaptainFlint Member Posts: 70

    I call it like that:

    $localeList = ([Microsoft.Windows.Kits.Hardware.ObjectModel.ProjectManager]::GetLocaleList())
    $PackageWriter.AddDriver($drivers, $symbols, $targets.AsReadOnly(), $localeList, [ref] $errorMessages, [ref] $warningMessages)
    

    Not 100% sure what exactly is wrong in your variant, and right now I don't have time to experiment, but a) maybe locale is not just a string, but an object; b) errors and warnings are output, so they need to be passed as ref; c) not sure if AsReadOnly() makes any difference for the targets, but I'd try that too, it was like that in the early version of toolsHCK I've adopted.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Internals & Software Drivers 15 November 2021 Live, Online
Writing WDF Drivers 24 January 2022 Live, Online
Developing Minifilters 7 February 2022 Live, Online
Kernel Debugging 21 March 2022 Live, Online