Replacing a driver.

Hi,

When I used to debug on Windows XP and wanted to change a driver, I just copied the new driver into Windows\system32\drivers, replacing the old driver. And restarted the machine.

When I try to do this with Windows 7, the operating system replaces the new driver with a copy of the old one. I see a copy of the old driver in Windows\system32\DriverStore\FileRepository<drivername>. When I try to copy my new driver into the \FileRepository directory, the system does not allow me to do this, even though I am logged in as administrator.

Does anyone know how to replace the old driver?

Thanks,

Kevin.

What’s the name of your driver? In particular, are you trying to replace an
in box driver?

mm

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@gmail.com
Sent: Thursday, October 21, 2010 4:24 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Replacing a driver.

Hi,

When I used to debug on Windows XP and wanted to change a driver, I just
copied the new driver into Windows\system32\drivers, replacing the old
driver. And restarted the machine.

When I try to do this with Windows 7, the operating system replaces the new
driver with a copy of the old one. I see a copy of the old driver in
Windows\system32\DriverStore\FileRepository<drivername>. When I try to copy
my new driver into the \FileRepository directory, the system does not allow
me to do this, even though I am logged in as administrator.

Does anyone know how to replace the old driver?

Thanks,

Kevin.


NTDEV is sponsored by OSR

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

It’s a driver I developed. I need to replace it, after making changes, to test the changes.

It doesn’t share the same name as a system driver?

What kind of driver is it - kmdf, wdm, legacy, file system, file system
filter, ndis, et. c.?

mm

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@gmail.com
Sent: Thursday, October 21, 2010 4:37 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Replacing a driver.

It’s a driver I developed. I need to replace it, after making changes, to
test the changes.


NTDEV is sponsored by OSR

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

xxxxx@gmail.com wrote:

It’s a driver I developed. I need to replace it, after making changes, to test the changes.

If it is in the driver store, then you must have used an installer of
some kind. You should uninstall it, and then re-install the new one.


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

It’s a kmdf driver named utusbport.sys (written by me).

Tim, that’s what I don’t want to do. Since it involves rebuilding the installer (this take a long time, and is involved). And also uninstalling/reinstalling. On XP, I just replaced the driver in ‘drivers’ and that was that.

You can use the pnputil system command to remove your old driver from the driver store before you use the new one. It’s not perfect (e.g., you have to know what oem* name got used when your driver installed before, and if you’re installed several times you have to remove them one at a time), but it works. Pnputil -? For the usual short form help.

Sketch
Pnputil -e <== gives you a list of all the third party drivers installed and their oem inf names
Pnputil -d oem19.inf <== deletes oem19.inf package from the store.

You might be able to wrest ownership of the file eventually, since you are an administrator.

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Thursday, October 21, 2010 1:24 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Replacing a driver.

Hi,

When I used to debug on Windows XP and wanted to change a driver, I just copied the new driver into Windows\system32\drivers, replacing the old driver. And restarted the machine.

When I try to do this with Windows 7, the operating system replaces the new driver with a copy of the old one. I see a copy of the old driver in Windows\system32\DriverStore\FileRepository<drivername>. When I try to copy my new driver into the \FileRepository directory, the system does not allow me to do this, even though I am logged in as administrator.

Does anyone know how to replace the old driver?

Thanks,

Kevin.

For testing purposes I just attach windbg and use .kdfiles to
overwrite the old with the new. Works great, plus it is sticky.

of course it doesn’t work at all for boot drivers, as far as I can
tell, others swear it does, but they have awesomer hacking powers than
I do.

Mark Roddy

On Thu, Oct 21, 2010 at 4:51 PM, wrote:
> Tim, that’s what I don’t want to do. Since it involves rebuilding the installer (this take a long time, and is involved). And also uninstalling/reinstalling. On XP, I just replaced the driver in ‘drivers’ and that was that.
>
> —
> NTDEV is sponsored by OSR
>
> 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
>

Thanks!

Just what I was looking for.

Kevin.

> Does anyone know how to replace the old driver?

Re-run the whole install process using an INF file.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

> If it is in the driver store, then you must have used an installer of

some kind. You should uninstall it, and then re-install the new one.

Installing just on top of the old one worked fine for me (well, with some subtle details).


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

>You can use the pnputil system command

DEVCON is even better (not shipped with the OS though).


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com