Issues with provisioning a computer for driver deployment and testing (WDK 10) using visual studio

philosopherthread 15 Reputation points
2023-04-22T12:20:12.01+00:00

Hello,

I am following the tutorial to "Write a Hello World Windows Driver (KMDF)" at https://learn.microsoft.com/en-us/windows-hardware/drivers/gettingstarted/writing-a-very-small-kmdf--driver. I also want to have a full remote debugging session of the driver on the target machine using Visual Studio, following this tutorial: https://learn.microsoft.com/en-us/windows-hardware/drivers/gettingstarted/provision-a-target-computer-wdk-8-1. However, I faced several issues/bugs in this context:

  • The port cannot be changed to any value other than 50005. This port will always be used.
  • The connection between Visual Studio and the debuggee cannot be established, resulting in the error message: "No connection could be made because the target machine actively refused it 192.168.199.225:50005."

I tried to debug the target machine using the Windbg command-line interface, and it worked. Everything related to firewalls, ports, IP addresses, etc. should be configured correctly. It looks like an issue with the Visual Studio integration.

Best regards, Rami

Windows for business | Windows Client for IT Pros | Storage high availability | Virtualization and Hyper-V
Windows for business | Windows Client for IT Pros | Devices and deployment | Other
Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. Nandan Desai 20 Reputation points
    2023-09-04T01:13:22.99+00:00

    Hi,

    • First make sure you can actually ping the target from host.
    • Next, check the dbgsettings and the port using "bcdedit /dbgsettings" on the target. Make sure you've used the correct key on the host.
    • Lastly, Make sure you have WDK installed on your target (test) machine as well (WDK needs to be installed on both host and target machine if you want to provision the target machine for Driver deployment. However, Kernel Debugging works without WDK on the target). You need to install WDK on target and then run "WDK Test Target Setup x64-x64_en-us.msi" file on the target. After that you will be able to setup the target machine for provisioning from Visual Studio on your host machine. "WDK Test Target Setup x64-x64_en-us.msi" file will be located somewhere around "C:\Program Files (x86)\Windows Kits\10\Remote\x64" path on your target machine after WDK is installed.

    I was having the same errors as you but I hadn't followed the 3rd step (in this answer) correctly.

    Here are the detailed steps: https://learn.microsoft.com/en-us/windows-hardware/drivers/gettingstarted/provision-a-target-computer-wdk-8-1

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.