Command line utility with cool functions for devices and drivers

Discussion in 'Operating Systems' started by mbk1969, Jan 26, 2017.

  1. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,606
    Likes Received:
    13,615
    GPU:
    GF RTX 4070
    I found the source files of MS own utility
    https://github.com/Microsoft/Windows-driver-samples/tree/master/setup/devcon

    Here is archive with binaries (32- and 64-bit)
    http://www.mediafire.com/file/7nhmi50s63ilbvl/devcon.zip

    Here is archive with modified sources and solution for VisualStudio 2013
    http://www.mediafire.com/file/xmpg8iphalnf3l1/devcon_solution.zip

    Here are functions:
    classfilter
    Add, delete, and reorder class filters.

    classes
    List all device setup classes.

    disable
    Disable devices.

    driverfiles
    List installed driver files for devices.

    drivernodes
    List driver nodes of devices.

    enable
    Enable devices.

    find
    Find devices.

    findall
    Find devices, including those that are not currently attached.

    help
    Display Devcon help.

    hwids
    List hardware IDs of devices.

    install
    Install a device manually.

    listclass
    List all devices in a setup class.

    reboot
    Reboot the local computer.

    remove
    Remove devices.

    rescan
    Scan for new hardware.

    resources
    List hardware resources for devices.

    restart
    Restart devices.

    sethwid
    Modify Hardware ID's of listed root-enumerated devices.

    stack
    List expected driver stack for devices.

    status
    List running status of devices.

    update
    Update a device manually.

    updateni
    Manually update a device (non interactive).

    dp_add
    Adds (installs) a third-party (OEM) driver package.

    dp_delete
    Deletes a third-party (OEM) driver package.

    dp_enum
    Lists the third-party (OEM) driver packages installed on this machine.

    checkinf
    Check computer for devices compatible with INF file.

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

    Some of functions even works on remote machine!

    To list all functions execute
    devcon64.exe help

    To see detailed description of a function execute
    devcon64.exe help function

    Exit codes of utility:
    0 - ok,
    1 - ok but reboot is needed,
    2 - fail,
    3 - invalid usage.

    Change log comparing to original sources from github:
    1. I added new function - checkinf.
    2. I modified old function - updateni (there were two parameters - inf-file and hwid of device, I removed hwid parameter so that user has to specify only inf-file).
     
    Last edited: Jan 26, 2017
  2. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,606
    Likes Received:
    13,615
    GPU:
    GF RTX 4070
    http://www.mediafire.com/file/7nhmi50s63ilbvl/devcon.zip
    http://www.mediafire.com/file/xmpg8iphalnf3l1/devcon_solution.zip
    Binaries and source files were updated. Just minor fix of sloppy place in function "cmdInfCheck":
    Code:
    if (className[0])
    {
          FormatToStream(stdout, MSG_INFCHECK_CLASSDEVS, className);
    }
    else
    {
          FormatToStream(stdout, MSG_INFCHECK_CLASSDEVS, [B]classGuid[/B]);
    }
    replaced with
    Code:
    if (className[0])
    {
          FormatToStream(stdout, MSG_INFCHECK_CLASSDEVS, className);
    }
    else
    {
          StringFromGUID2(classGuid, className, sizeof(className)/sizeof(className[0]));
          FormatToStream(stdout, MSG_INFCHECK_CLASSDEVS, className);
    }
    
    6 years with C# get me absolutely reckless about what I throw to output functions.
     
  3. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,606
    Likes Received:
    13,615
    GPU:
    GF RTX 4070
  4. Mufflore

    Mufflore Ancient Guru

    Messages:
    14,732
    Likes Received:
    2,701
    GPU:
    Aorus 3090 Xtreme
    Thanks for posting this and what it is about in your other thread.
    http://forums.guru3d.com/showthread.php?p=5386572
    I didnt realise its impact.

    It will be appreciated if you can make the Message based Interrupt util a live change without reboot.
    I found that AMD cards already set this (on newer motherboards at least) but NVidia dont.
    It makes for a smoother gaming experience and the util helped me detect a driver was not properly installed.

    ie my SATA transfer speed would max out at around 60MB/s at times.
    Using MSIutil I noticed SATA was not using MSI based interrupts, I hadnt installed the Intel RST drivers.
    After installing RST, MSI is enabled and everything is back to full speed.
    Cheers!
     

  5. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,606
    Likes Received:
    13,615
    GPU:
    GF RTX 4070
    -)
    You realize that full speed was back due to RST drivers and not MSI mode solely, do you? Correct test for MSI mode`s impact would be comparison with and without MSI mode on the same RST drivers.
     
  6. Mufflore

    Mufflore Ancient Guru

    Messages:
    14,732
    Likes Received:
    2,701
    GPU:
    Aorus 3090 Xtreme
    I didnt test with with only MSI enabled because it hosed Windows boot without RST installed.
    I had to do the recommended last known good boot to get it back and then installed RST.
    I didnt confirm what the speed increase was down to, I am simply happy I was alerted to the issue
     
    Last edited: Jan 30, 2017
  7. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,606
    Likes Received:
    13,615
    GPU:
    GF RTX 4070
    I don`t get it. After you installed RST drivers you switched MSI mode off and that hosed boot?
     
  8. Mufflore

    Mufflore Ancient Guru

    Messages:
    14,732
    Likes Received:
    2,701
    GPU:
    Aorus 3090 Xtreme
    Sorry, I made a minor mess of what I was trying to say, corrected now.

    When I noticed SATA was not using MSI I enabled it and Windows refused to boot.
    I used Last Known Good to get back in and then installed RST.
    At that point I didnt care what the performance increase was down to and didnt want to cause more issues so havent tested disabling MSI since.
    But I did verify MSI was now enabled.
     
    Last edited: Jan 30, 2017
  9. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,606
    Likes Received:
    13,615
    GPU:
    GF RTX 4070
    Now you can disable MSI mode to test performance impact because I am sure Intel drivers would work without it. Previously you were trying to force generic MS drivers into MSI mode which they do not support.

    (EDIT: I am curious why we discuss MSI mode here and not in original thread...)
     
  10. Mufflore

    Mufflore Ancient Guru

    Messages:
    14,732
    Likes Received:
    2,701
    GPU:
    Aorus 3090 Xtreme
    Trying to help others follow why the source code is useful for you so the thread gets traction.
     

  11. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,606
    Likes Received:
    13,615
    GPU:
    GF RTX 4070
    Good thinking. -)
     

Share This Page