Visual Studio 2019 kernel driver successfuly deployed and installed but debugging doesnt work

laurh 6 Reputation points
2021-06-22T07:19:30.393+00:00

I have made a simple project following this tutorial https://learn.microsoft.com/en-us/windows-hardware/drivers/gettingstarted/writing-a-very-small-kmdf--driver

I managed to setup my laptop as my target device for testing, when I start debugging, visual studio successfully copies my driver on the target machine and installs it, but breakpoints are ignored in my DriverEntry function... the machines can both ping each other, I disabled firewalls in both the host and the target and I also made an inbound rule to accept everything from each other in the firewall advanced settings.

Here are the logs from the Immediate Window. I'm not sure what to do because I don't get any feedback whatsoever and no I don't wanna use WinDbg to debug my driver, I don't like it

Microsoft (R) Windows Debugger Version 10.0.20348.1 AMD64  
Copyright (c) Microsoft Corporation. All rights reserved.  
  
DESKTOP-HS3JVV9\laurh (npipe WinIDE_01D767352520435C) connected at Tue Jun 22 10:06:38 2021  
  
Microsoft (R) Windows Debugger Version 10.0.20348.1 AMD64  
Copyright (c) Microsoft Corporation. All rights reserved.  
  
Using NET for debugging  
Opened WinSock 2.0  
Waiting to reconnect...  
[10:06:39:461]: Remove Existing Remote Package  
[10:06:39:627]: Task "Remove Existing Remote Package" completed successfully  
[10:06:39:642]: Copy Driver Package  
[10:06:39:675]: Task "Copy Driver Package" completed successfully  
[10:06:39:683]: Driver Removal  
[10:06:39:685]: Removing any existing files from test execution folder.  
[10:06:39:700]: Copying required files for "Driver Removal".  
  
$KitRoot$\Testing\Runtimes\TAEF\te.exe "%SystemDrive%\DriverTest\Run\DriverTestTasks.dll" /select:"@Name='DriverTestTasks::_DriverRemoval'" /p:"InfFile=VariantKernel.inf" /p:"ImportDriver=1" /p:"CertificateFile=VariantKernel.cer" /p:"PackageGuid=x64" /p:"HardwareId=Root\VariantKernel" /rebootStateFile:%SystemDrive%\DriverTest\Run\DriverTestReboot.xml /enableWttLogging /wttDeviceString:$LogFile:file="%SystemDrive%\DriverTest\Run\Driver_Removal_00028.wtl",writemode=append,encoding=unicode,nofscache=true,EnableLvl="WexStartTest|WexEndTest|WexXml|WexProperty|WexCreateContext|WexCloseContext|*" /runas:Elevated  
[10:06:41:778]: Result Summary: Total=1, Passed=1, Failed=0, Blocked=0, Warned=0, Skipped=0  
[10:06:41:780]: Task "Driver Removal" completed successfully  
[10:06:42:216]: Driver Preparation  
[10:06:42:217]: Removing any existing files from test execution folder.  
[10:06:42:230]: Copying required files for "Driver Preparation".  
  
$KitRoot$\Testing\Runtimes\TAEF\te.exe "%SystemDrive%\DriverTest\Run\DriverTestTasks.dll" /select:"@Name='DriverTestTasks::_DriverPreparation'" /p:"InfFile=VariantKernel.inf" /p:"ImportDriver=1" /p:"CertificateFile=VariantKernel.cer" /p:"PackageGuid=x64" /p:"HardwareId=Root\VariantKernel" /rebootStateFile:%SystemDrive%\DriverTest\Run\DriverTestReboot.xml /enableWttLogging /wttDeviceString:$LogFile:file="%SystemDrive%\DriverTest\Run\Driver_Preparation_00028.wtl",writemode=append,encoding=unicode,nofscache=true,EnableLvl="WexStartTest|WexEndTest|WexXml|WexProperty|WexCreateContext|WexCloseContext|*" /runas:Elevated  
[10:06:46:309]: Result Summary: Total=1, Passed=1, Failed=0, Blocked=0, Warned=0, Skipped=0  
[10:06:46:311]: Task "Driver Preparation" completed successfully  
[10:06:46:770]: Driver Install  
[10:06:46:771]: Removing any existing files from test execution folder.  
[10:06:46:785]: Copying required files for "Driver Install".  
  
$KitRoot$\Testing\Runtimes\TAEF\te.exe "%SystemDrive%\DriverTest\Run\DriverTestTasks.dll" /select:"@Name='DriverTestTasks::_RunProcess'" /p:"BinaryPath=%SystemDrive%\DriverTest\devcon.exe" /p:"Arguments=-f install %SystemDrive%\DriverTest\Drivers\VariantKernel.inf Root\VariantKernel" /p:"WorkingFolder=%SystemDrive%\DriverTest\Drivers" /rebootStateFile:%SystemDrive%\DriverTest\Run\DriverTestReboot.xml /enableWttLogging /wttDeviceString:$LogFile:file="%SystemDrive%\DriverTest\Run\Driver_Install_00017.wtl",writemode=append,encoding=unicode,nofscache=true,EnableLvl="WexStartTest|WexEndTest|WexXml|WexProperty|WexCreateContext|WexCloseContext|*" /runas:Elevated  
[10:06:54:221]: Result Summary: Total=1, Passed=1, Failed=0, Blocked=0, Warned=0, Skipped=0  
[10:06:54:223]: Task "Driver Install" completed successfully  
[10:06:54:680]: Driver Post Install Actions  
[10:06:54:681]: Removing any existing files from test execution folder.  
[10:06:54:696]: Copying required files for "Driver Post Install Actions".  
  
$KitRoot$\Testing\Runtimes\TAEF\te.exe "%SystemDrive%\DriverTest\Run\DriverTestTasks.dll" /select:"@Name='DriverTestTasks::_DriverPostInstall'" /rebootStateFile:%SystemDrive%\DriverTest\Run\DriverTestReboot.xml /enableWttLogging /wttDeviceString:$LogFile:file="%SystemDrive%\DriverTest\Run\Driver_Post_Install_Actions_00028.wtl",writemode=append,encoding=unicode,nofscache=true,EnableLvl="WexStartTest|WexEndTest|WexXml|WexProperty|WexCreateContext|WexCloseContext|*" /runas:Elevated  
[10:06:56:817]: Result Summary: Total=1, Passed=1, Failed=0, Blocked=0, Warned=0, Skipped=0  
[10:06:56:819]: Task "Driver Post Install Actions" completed successfully  
  
Windows development | Windows API - Win32
Developer technologies | C++
0 comments No comments
{count} vote

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.