What can prevent VS2K15 to use the generated pdb files when debugging an user-mode driver ?

Hi !
I’m new to driver development so I don’t know any kind of evidence when one
talk about how to develop a driver on windows.

I’m trying (as part of an internship in a company totally unrelated to
driver development) to make a virtual printer driver, which, if I got it
right, shouldn’t need kernel-mode (Am I mistaken ?).

I use VS2K15 windows 10 on the host, and windows 8.1 on the remote computer.
Both are physical, in the same workgroup, I can make one ping another, and
I’ve successfully provisioned remote with target (and wdk to set up the
target debugger, and then 8.1 version of windows HLK. (I have read in a
2012 conversation debuggers should be run manually, should I learn to do it
manually ?)

My problem is : when I deploy my driver, after the install I get a new tab
with written in big letters : “Frame not in module”, the current stack
frame was not found in a loaded module. etc etc.
I have read on the lists that it can mean dll are being loaded, therefore,
it’s normal.

Then I tried to put a breakpoint on the first instruction of createdevice
in device.c (my project is generated from umdf template) to locate in
disassembly where the entry point of the actual source code.

Couldn’t figure whether or not I saw the breakpoint, but there was a lot :
( http://pastebin.com/27AKkgXf ) And I am not able to figure out what they
mean, and whether or not it is one of my concerns.

And, last question, when one want to develop drivers, have you a complete
list of what tools one should install ? (I’m aiming to do a recap here)

Thank you for reading.

Since a printer driver is loaded into user mode client app, you better use local VisualStudio debugger. You don’t need to mess with a remote. In any case, remote usermode debugging is set up differently from remote kernel debug.

I don’t think you use UMDF in a printer driver.

plus, After reading a bit more osr insider, I found out using kmdf was a
better idea.

As my goal is to do a virtual printer, do you think it is possible to do a
single thing in the printer : run another program (a regular one) and give
it arguments which the printer recieved ?

2016-04-15 15:46 GMT+02:00 :

> Since a printer driver is loaded into user mode client app, you better use
> local VisualStudio debugger. You don’t need to mess with a remote. In any
> case, remote usermode debugging is set up differently from remote kernel
> debug.
>
> I don’t think you use UMDF in a printer driver.
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list online at: <
> http://www.osronline.com/showlists.cfm?list=ntdev&gt;
>
> MONTHLY seminars on crash dump analysis, WDF, Windows internals and
> software drivers!
> Details at http:
>
> To unsubscribe, visit the List Server section of OSR Online at <
> http://www.osronline.com/page.cfm?name=ListServer&gt;
></http:>

You cannot use KMDF because the printer driver is not running in kernel mode. It’s an user mode DLL.

Pierre Antoine Guillaume wrote:

As my goal is to do a virtual printer, do you think it is possible to
do a single thing in the printer : run another program (a regular one)
and give it arguments which the printer recieved ?

It’s a user-mode DLL running in a user-mode process. You can use any
essentially any Windows API that you want.

You might take a look at PDF Creator. It is an open source virtual
printer driver that creates PDF files. It calls GhostScript, but it
calls the DLL version, not the command-line version. However, it does
call some external tools (to add watermarks, or do encryption, or do
signing). The source is here. Oddly, for a project still being
maintained today, it’s actually written in Visual Basic 6 – the pre
.NET version.

https://sourceforge.net/projects/pdfcreator/files/PDFCreator/PDFCreator%201.7.2/


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.