I’ve been working on my pet driver project for a while now, but I still seem to run into total newbie issues, so again I’m forced to ask the patient ones among you.
I created a test project for testing the code. It is a standard user mode console application. I wanted to be able to debug and run it using shortcuts, so I set it as the startup project and possibly some more, so that F5 / ctrl + F5 worked.
The issues I’m running into:
-
If I try to run / debug, I get the error “error MSB4057: The target “Deploy” does not exist in the project.”. I’m offered a chance to continue anyway, which I do and everything works fine. I searched for the “deploy” target in all projects, but I found nothing. What do I have set wrongly here?
-
When I try to debug, I get a dialog message stating “deployment not configured”. Message : “the driver must be deployed to the target computer for debugging to work. Deployment is not currently configured. (deployment can be configured in the driver package property pages under the Driver Install -> Deployment section)”
Again, I’m offered a choice to proceed anyway, which again leads to everything working.
I suppose this is a similar if not identical issue to #1, but I can’t seem to find origin of the issue as test project is not supposed to be a driver project.
-
Since I configured all of this, the driver no longer deploys to the test computer. The build solution (F7) command simply doesn’t want to deploy any more. If I manually click on “Deploy” menu item, nothing happens. Driver / test / Configure computers works fine.
-
I also noticed that adding a new project to the solution doesn’t configure targets as configured in the solution, I have to manually add them. My original solution had targets for Win 7, Win 8 and Win 8.1, all release + debug variants. I don’t think I really need to distinguish among all these (I’m only using Win7 targets), but any new project has only the “debug” and “release” targets. How can I match these targets so that new project will automatically inherit settings from the solution? Also, the .sln file is totally polluted with these targets the “GlobalSection(ProjectConfigurationPlatforms)” contains entries for all target combinations (plus “Mixed platforms”) for each of the four projects now in the solution. Is it not possible to maintain global (solution-wide) settings for all projects?
Thanks for any help,
Jure
No love for the beginner?
Please, I’d really like to understand these things. I wouldn’t be asking if my search-fu was strong enough to find the answers on the net. I read all the relevant documentation I could find and did a full comparison of project file changes (between working and non-working versions) and saw nothing to indicate where I went wrong.
Of course I can revert everything to the way it was before it stopped working, but it’s a step I shouldn’t be doing if I knew anything about proper project setup.
I’d love to be able to comment, but (for me, at least) it’s a case of Wittgenstein: Whereof we cannot speak, thereof we must be silent.
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-582542-
xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: 12 May 2015 08:56
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Project configuration issues / questions
No love for the beginner?
Please, I’d really like to understand these things. I wouldn’t be
asking if my search-fu was strong enough to find the answers on the
net. I read all the relevant documentation I could find and did a full
comparison of project file changes (between working and non-working
versions) and saw nothing to indicate where I went wrong.
Of course I can revert everything to the way it was before it stopped
working, but it’s a step I shouldn’t be doing if I knew anything about
proper project setup.
This email message has been delivered safely and archived online by Mimecast.
For more information please visit http://www.mimecast.com
Well, I’ll try to help but I’m afraid you’re not going to like my answers much.
First, don’t ever try to use deploy, at least not in the WDK for Win8.1 or earlier. It basically takes a simple problem (“copy your .sys file to the target machine, stop the old driver version, start the new one”) into a complex problem involving lots of interaction with VS. And it doesn’t work predictably. And it’s hard to debug when you encounter problems. We don’t use this feature at OSR internally, and we teach people not to use this feature in class… life is easier that way.
Second, don’t use the debugger interface that’s integrated with Visual Studio for kernel debugging. Rather, run WinDbg separately. The reasons for this are effectively the same as they are for not using deploy: By using the integrated debugger UI you’re making a simple operation more complex… AND you’re subjected to odd semantics (you can’t edit your code while you’re debugging it… which might make sense for an app, but not so much for a driver).
In terms of this:
Hmmmm… You have to be sure you’re distinguishing between APPLICATION projects and DRIVER projects. Only driver projects have the specific OS targets associated with them. Applications don’t have this feature.
So, seriously… that is my best advice based on my personal experience as a developer and my own and my team’s experience working with new Windows driver devs in our seminars over the past few years. Like I said, probably not what you wanted to hear.
Peter
OSR
@OSRDrivers
OK…
That really wasn’t what I wanted to hear 
Until recently driver deployment worked fine for me even if it did take about a minute to perform the deployment. I did have to generate the .tmf files manually, but that was a minor thing.
So what is the suggested method of deployment?
Also, how can I get rid of the #1 and #2 warnings?
On 13-May-2015 00:26, jure.erznoznik@ wrote:
So what is the suggested method of deployment?
The suggested method was, IIRC, to NOT use deployment at all (unless,
of course, it works for you). Take the driver package and install it on
the target. By hand.
Also, how can I get rid of the #1 and #2 warnings?
Try the official WDK forum:
http://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/home?forum=wdk
Regards,
– pa
#1 and #2 should be trivially fixed by setting the solution properties to NOT to deploy. Just uncheck the box.
Oh, and you should NOT have to build your TMF by hand. No way. Your project settings don’t seem right.
Peter
OSR
@OSRDrivers
>>The suggested method was, IIRC, to NOT use deployment at all (unless, of course, it works for you). Take the driver package and install it on the target. By hand.
Yes, but that entails (manually) disabling existing driver, copying files, (manually) enabling the driver.
Much slower than could be done using a nice script that would do that automatically. Nothing like that available? Any guides if it is available?
>Oh, and you should NOT have to build your TMF by hand. No way. Your project settings don’t seem right.
But this is how it worked from the very beginning with project having been created by driver wizard.
Surely I am missing your question:
You write a script that does: Copy from a network share, disable, then enable… in a script. You run it on the target machine. You’re done. I s’pose there are some fancy ways to run a script remotely using PowerShell or something… but why bother for such an inherently simple process?
BTW, I’ve *heard* that deployment will “absolutely positively” be MUCH better in the Win10 WDK. So there is a chance this feature will be bulletproof someday.
Peter
OSR
@OSRDrivers
xxxxx@gmail.com wrote:
>> The suggested method was, IIRC, to NOT use deployment at all (unless, of course, it works for you). Take the driver package and install it on the target. By hand.
Yes, but that entails (manually) disabling existing driver, copying files, (manually) enabling the driver.
No, it doesn’t. Copy files, then “devcon restart”. Anything you can do
in Device Manager can be done with “devcon”. And, unlike user-mode
DLLs, kernel driver files are not held open while loaded, so you can
copy a new one while the driver is runinng.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
> And, unlike user-mode
DLLs, kernel driver files are not held open while loaded, so you can
copy a new one while the driver is runinng.
No longer true in w10. The driver is no longer backed by the pagefile, rather like a dll, backed u the image itself and thus held open
d
Bent from my phone
From: Tim Robertsmailto:xxxxx
Sent: ?5/?14/?2015 12:41 PM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: Re: [ntdev] Project configuration issues / questions
xxxxx@gmail.com wrote:
>>> The suggested method was, IIRC, to NOT use deployment at all (unless, of course, it works for you). Take the driver package and install it on the target. By hand.
> Yes, but that entails (manually) disabling existing driver, copying files, (manually) enabling the driver.
No, it doesn’t. Copy files, then “devcon restart”. Anything you can do
in Device Manager can be done with “devcon”. And, unlike user-mode
DLLs, kernel driver files are not held open while loaded, so you can
copy a new one while the driver is runinng.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
—
NTDEV is sponsored by OSR
Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
OSR is HIRING!! See http://www.osr.com/careers
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx>
On 14-May-2015 22:43, Doron Holan wrote:
> And, unlike user-mode
DLLs, kernel driver files are not held open while loaded, so you can
copy a new one while the driver is runinng.
No longer true in w10. The driver is no longer backed by the pagefile,
rather like a dll, backed u the image itself and thus held open
Doron, then what guidance you have for updating kernel binaries
that cannot be unloaded (or fail to unload)?
Will SetupAPI based (INF) installers fail, or attempt some
automatic recovery such as double reboot?
Thanks,
– pa
I don’t have an official answer. My gut tells me when you reinstall with devcon (devcon update) you get an attempted unload, copy, restart. If the copy fails, setupapi will request you reboot to finish
d
Bent from my phone
From: Pavel A.mailto:xxxxx
Sent: ?5/?14/?2015 1:18 PM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: Re:[ntdev] Project configuration issues / questions
On 14-May-2015 22:43, Doron Holan wrote:
> > And, unlike user-mode
> DLLs, kernel driver files are not held open while loaded, so you can
> copy a new one while the driver is runinng.
>
> No longer true in w10. The driver is no longer backed by the pagefile,
> rather like a dll, backed u the image itself and thus held open
Doron, then what guidance you have for updating kernel binaries
that cannot be unloaded (or fail to unload)?
Will SetupAPI based (INF) installers fail, or attempt some
automatic recovery such as double reboot?
Thanks,
– pa
—
NTDEV is sponsored by OSR
Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
OSR is HIRING!! See http://www.osr.com/careers
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx>
Doron Holan wrote:
No longer true in w10. The driver is no longer backed by the pagefile,
rather like a dll, backed u the image itself and thus held open
Ah, that makes me sad.
I know my personal happiness is the foremost concern of the Windows
driver team.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
>
No longer true in w10. The driver is no longer backed by the pagefile,
rather like a dll, backed u the image itself and thus held open
Everything old is new again. They did this once before, briefly, “back in the day”… and they changed it back.
This is odd after all the extreme pressure for us to ensure “no reboots, ever!”
I wonder what the motivation was?
I’m sure it’s obvious to all on this thread, but all you do is rename the .sys file to .old, copy the new file into its place, then devcon restart.
Peter
OSR
@OSRDrivers
Perf improvement
d
Bent from my phone
From: xxxxx@osr.commailto:xxxxx
Sent: ?5/?14/?2015 4:11 PM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: RE:[ntdev] Project configuration issues / questions
>
> No longer true in w10. The driver is no longer backed by the pagefile,
> rather like a dll, backed u the image itself and thus held open
Everything old is new again. They did this once before, briefly, “back in the day”… and they changed it back.
This is odd after all the extreme pressure for us to ensure “no reboots, ever!”
I wonder what the motivation was?
I’m sure it’s obvious to all on this thread, but all you do is rename the .sys file to .old, copy the new file into its place, then devcon restart.
Peter
OSR
@OSRDrivers
—
NTDEV is sponsored by OSR
Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
OSR is HIRING!! See http://www.osr.com/careers
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx>
> -----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-582787-
xxxxx@lists.osr.com] On Behalf Of xxxxx@osr.com
Sent: Thursday, May 14, 2015 5:10 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Project configuration issues / questions
>
> No longer true in w10. The driver is no longer backed by the pagefile,
> rather like a dll, backed u the image itself and thus held open
I’m sure it’s obvious to all on this thread, but all you do is rename the
.sys file to .old, copy the new file into its place, then devcon restart.
If the file can’t simply be replaced, it can’t be renamed, either. At least, not on all versions of Windows.
Phil
Not speaking for LogRhythm
Phil Barila | Senior Software Engineer
720.881.5364 (w)
LogRhythm, Inc.
The Security Intelligence Company
A LEADER in Gartner’s SIEM Magic Quadrant (2012-2014)
Reader’s Trust Award in SC Magazine (2015) | Perfect 5-Star Rating in SC Magazine (2009-2014)
Selected by SANS community as “BEST SIEM” (2014 survey)
Tim Roberts wrote:
> No longer true in w10. The driver is no longer
> backed by the pagefile, rather like a dll, backed
> u the image itself and thus held open
Ah, that makes me sad.
Don’t worry, Candy Crush Saga is coming preinstalled on Win10, so that should cheer you up.
http://news.xbox.com/2015/05/games-candy-crush-saga-is-coming-to-windows-10
On 15-May-2015 02:10, xxxxx@osr.com wrote:
I’m sure it’s obvious to all on this thread, but all you do is rename the .sys file to .old, copy the new file into its place, then devcon restart.
So this is the question… who exactly is expected to rename the file:
we or SetupAPI?
– pa
Setupapi does it
d
Bent from my phone
From: Pavel A.mailto:xxxxx
Sent: ?5/?14/?2015 8:45 PM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: Re:[ntdev] Project configuration issues / questions
On 15-May-2015 02:10, xxxxx@osr.com wrote:
>
> I’m sure it’s obvious to all on this thread, but all you do is rename the .sys file to .old, copy the new file into its place, then devcon restart.
So this is the question… who exactly is expected to rename the file:
we or SetupAPI?
– pa
—
NTDEV is sponsored by OSR
Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
OSR is HIRING!! See http://www.osr.com/careers
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx>