It is very important to write any program dynamic debugging. Drive development is no exception.
Usually now write drive, are running on the VM, debugging means basically also local WinDbg + virtual machine.
Virtual machine configuration
I'm using a win7,
First step, look underneath. After successful execution, you will be prompted:
The entry is successfully copied to {xxxxxxxxxxxxxxxxxxx}
Step Two:
Continue to enter Bcdedit/debug {xxxxxxxxxxxxxxxx} on in cmd
{xxxxxxxxxxxxxx} is the GUID of the previous step output, which uniquely identifies the boot entry.
That's fine, you can use bcdedit/dbgsettings to see
VM Configuration
Need to configure the VM,
First, add a serial port configuration
Select Output to Namedpipe
Enter a name
WinDbg connection
From the File menu, click Kernel Debug
Click OK.
Then start the VM and select the newly added boot entry
After logging in to Windows, start the driver and you'll see that the log is visible in the WinDbg.
In the WinDbg open the source file, and then set up the PDB file, you can single-step tracking. The use of WinDbg can greatly improve the development efficiency.
Windows Minifilter Drive-mode (4)