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

Home NTDEV

Before Posting...

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

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/


Create umdf firmware update

abdouabdou Member Posts: 8
hello everyone,
I read your comments about umdf, you are very expert in the field,
for that I decided to register in this site to learn from you, I am a beginner in WDF, I would like create a driver that sends specific commands to the device, for example a command that retrieves the firmware version, if someone could help me with a project as template, I would be very grateful. thank you in advance

Comments

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 14,405

    What device? What bus? Does it already have a driver? Are you sure it has a command to fetch the firmware version?

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

  • abdouabdou Member Posts: 8
    to be sincere, for the device I don't know what it is, but I know that it is based on USB HID, I have the commands to enter, for example to retrieve the version of the device, but for create method that use this command in UMDF i don't know manipulated the wdf , i read in forums i had to use filewrite and fileread .
    Also I found this page https://learn.microsoft.com/en-us/windows-hardware/drivers/install/updating-device-firmware-using-windows-update , it contains what I want to do, but there is no code. My main problem is that the documentation is almost nowhere to be found, for what I hope found solution here.
    Thnks for your concern 😅.
  • Tim_RobertsTim_Roberts Member - All Emails Posts: 14,405

    You don't know what it is??? I don't understand what environment you would be in where you need to access a devices firmware version and not know what it is. Are you hacking something here?

    The page you linked just shows how you get hooked in to the standard Windows Update mechanism. There's no general advice on how to update firmware because every device is different.

    If you don't know what the device is, then you are clearly not the manufacturer of the device. It already has a driver, so you can't just insert your own. You said you already have "commands" to fetch the version. What do they look like? If they are HID commands, then you can open the device using the HID libraries and talk to it normally, with no driver involved.

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

  • abdouabdou Member Posts: 8
    edited October 2
    Hello Tim,
    I've already the source of an application that open the device and get version from it then put the firmware in device,But now i need to do this from a driver.
    My command to get version look like 0x000000A6 , from the source i send it via the function Write file of fileapi.h
    My question is : is there any way to do the same thing in UMDF?, Is there a function in UMDF that do the same thing as write file and how to use it?
    as i said i am new in this domain, and i searched in web without result.
  • Tim_RobertsTim_Roberts Member - All Emails Posts: 14,405

    Never do anything in a driver that can be done just as well in an application. It just adds unnecessary complexity and endangers system stability. Why do you want this in UMDF? Where are you going to load the driver?

    How did you open the file? Are you opening it as a HID device? You're really making it very hard to help you, because we have to pull each piece of information one bit at a time.

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

  • abdouabdou Member Posts: 8
    edited October 3
    okay,i will try to be more clear, the device is attached as an hid compliant device, and i need to verify and update the firmware if necessary each time it will be connected.
    as you said it will be more complicated when putting the update process into driver. so I've 2 solution,i hope you can validate them to me if you don't mind.
    1- creating a simple hid driver that will detect the device and notify service,then from this service i will update the device.

    2- Microsoft propose another method ,its about creating a CFU driver ,but its difficult to learn it ( https://github.com/microsoft/CFU/blob/master/Documentation/CFU-Driver/cfu-driver.md).

    for the first solution, can i create and install this service during installing the driver, and is there anything to do to communicate between them?.
  • Tim_RobertsTim_Roberts Member - All Emails Posts: 14,405

    You do not need a driver AT ALL. The device already HAS a driver. You can't supply your own without replacing that one, which would of course make it non-functional, especially if you don't know what it does. Yes, the smarter way is to install a service, and use RegisterDeviceNotification or CM_Register_Notification to get a callback when your device arrives or departs. Handle it all from user-mode.

    How are you going to install firmware for a device when you don't know what it does? This whole thing is very fishy.

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

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!
Kernel Debugging 30 January 2023 Live, Online
Developing Minifilters 20 March 2023 Live, Online
Writing WDF Drivers TBD 2023 Live, Online
Internals & Software Drivers 17 April 2023 Live, Online