Hi,
I think that I must be missing a piece of understanding about how windows
(vista) inserts kernel drivers. I am hoping that someone here can fill me
in.
My problem is that I have discovered that the method I am using to update
the binary for the driver I am developing does not work. It works
according to the status messages, but after much tearing-out-of-hair, I
have learnt that the kernel is in fact still running an old version of my
driver. This is the case even after rebooting.
This is the process that I have been using to update the binary for my
driver (dante) whenever I make changes to it.
- sc stop dante [sc reports success]
- sc delete dante [sc reports success]
- copy \dante.sys \dante.sys
4. sc create dante type= kernel binpath= \dante.sys [sc reports
success]
5. sc start dante [sc reports success]
Unfortunately, despite sc’s repeated assurances that all is well, errors
that I have fixed in the current binary keep occuring in the running
version. After a while I began to suspect that the kernel was still
running an old version, and sure enough, “driverquery -v | grep dante”
reports that the link date is 48 hours ago. This is despite the fact that
the timestamp of the file path reported by driverquery is 2 minutes ago.
If I delete the binary and then try to start, I predictably get a file not
found error, but when I put the current binary back and execute start, the
kernel fires up the stale binary instead.
None of this seems to make sense, but then I guess I’m missing something.
I could use the debugger’s driver map, but that seems a bit unneccesary
when I should be able to load it directly.
Can anyone help me out of this mess?
Regards,
Joe.
> sc delete dante
Do not do that; it just changes the registry, and in-memory version of
the sc’s database stays the same (update happens after reboot).
Try this: stop (unload) the driver, replace dante.sys, sc start dante.
If your unload is clean, dante.sys goes out and a new binary is
loaded on “sc start”.
Add DbgPrint() to your DriverEntry to make sure.
> -----Original Message-----
> From: xxxxx@lists.osr.com [mailto:bounce-316116-
> xxxxx@lists.osr.com] On Behalf Of Joseph Thomas-Kerr
> Sent: Friday, February 29, 2008 6:36 AM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Trouble updating kernel driver binary
>
> Hi,
>
> I think that I must be missing a piece of understanding about how
> windows
> (vista) inserts kernel drivers. I am hoping that someone here can fill
> me
> in.
>
> My problem is that I have discovered that the method I am using to
> update
> the binary for the driver I am developing does not work. It works
> according to the status messages, but after much tearing-out-of-hair, I
> have learnt that the kernel is in fact still running an old version of
> my
> driver. This is the case even after rebooting.
>
> This is the process that I have been using to update the binary for my
> driver (dante) whenever I make changes to it.
>
> 1. sc stop dante [sc reports success]
> 2. sc delete dante [sc reports success]
> 3. copy \dante.sys \dante.sys
> 4. sc create dante type= kernel binpath= \dante.sys [sc
> reports
> success]
> 5. sc start dante [sc reports success]
>
> Unfortunately, despite sc’s repeated assurances that all is well,
> errors
> that I have fixed in the current binary keep occuring in the running
> version. After a while I began to suspect that the kernel was still
> running an old version, and sure enough, “driverquery -v | grep dante”
> reports that the link date is 48 hours ago. This is despite the fact
> that
> the timestamp of the file path reported by driverquery is 2 minutes
> ago.
>
> If I delete the binary and then try to start, I predictably get a file
> not
> found error, but when I put the current binary back and execute start,
> the
> kernel fires up the stale binary instead.
>
> None of this seems to make sense, but then I guess I’m missing
> something.
>
> I could use the debugger’s driver map, but that seems a bit unneccesary
> when I should be able to load it directly.
>
> Can anyone help me out of this mess?
>
> Regards,
> Joe.
>
> —
> 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
Actually the service control manager interface does not just change the
registry, it also changes the runtime configuration. “net stop driver” uses
the scm api.
On Fri, Feb 29, 2008 at 9:06 AM, Alex Shvedov wrote:
> > sc delete dante
> Do not do that; it just changes the registry, and in-memory version of
> the sc’s database stays the same (update happens after reboot).
>
> Try this: stop (unload) the driver, replace dante.sys, sc start dante.
>
> If your unload is clean, dante.sys goes out and a new binary is
> loaded on “sc start”.
>
> Add DbgPrint() to your DriverEntry to make sure.
>
>
>
>
>
> > -----Original Message-----
> > From: xxxxx@lists.osr.com [mailto:bounce-316116-
> > xxxxx@lists.osr.com] On Behalf Of Joseph Thomas-Kerr
> > Sent: Friday, February 29, 2008 6:36 AM
> > To: Windows System Software Devs Interest List
> > Subject: [ntdev] Trouble updating kernel driver binary
> >
> > Hi,
> >
> > I think that I must be missing a piece of understanding about how
> > windows
> > (vista) inserts kernel drivers. I am hoping that someone here can fill
> > me
> > in.
> >
> > My problem is that I have discovered that the method I am using to
> > update
> > the binary for the driver I am developing does not work. It works
> > according to the status messages, but after much tearing-out-of-hair, I
> > have learnt that the kernel is in fact still running an old version of
> > my
> > driver. This is the case even after rebooting.
> >
> > This is the process that I have been using to update the binary for my
> > driver (dante) whenever I make changes to it.
> >
> > 1. sc stop dante [sc reports success]
> > 2. sc delete dante [sc reports success]
> > 3. copy \dante.sys \dante.sys
> > 4. sc create dante type= kernel binpath= \dante.sys
> [sc
> > reports
> > success]
> > 5. sc start dante [sc reports success]
> >
> > Unfortunately, despite sc’s repeated assurances that all is well,
> > errors
> > that I have fixed in the current binary keep occuring in the running
> > version. After a while I began to suspect that the kernel was still
> > running an old version, and sure enough, “driverquery -v | grep dante”
> > reports that the link date is 48 hours ago. This is despite the fact
> > that
> > the timestamp of the file path reported by driverquery is 2 minutes
> > ago.
> >
> > If I delete the binary and then try to start, I predictably get a file
> > not
> > found error, but when I put the current binary back and execute start,
> > the
> > kernel fires up the stale binary instead.
> >
> > None of this seems to make sense, but then I guess I’m missing
> > something.
> >
> > I could use the debugger’s driver map, but that seems a bit unneccesary
> > when I should be able to load it directly.
> >
> > Can anyone help me out of this mess?
> >
> > Regards,
> > Joe.
> >
> > —
> > 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
>
>
> —
> 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
>
–
Mark Roddy
Is this a PnP driver or just a service?
sc commands don’t work on PnP drivers as you expected.
If it is a non-pnp driver, make sure the old version has been unloaded
when you do sc stop (add debug print in the unload routine)
Regards,
–PA
“Joseph Thomas-Kerr” wrote in message news:xxxxx@ntdev…
Hi,
I think that I must be missing a piece of understanding about how windows
(vista) inserts kernel drivers. I am hoping that someone here can fill me
in.
My problem is that I have discovered that the method I am using to update
the binary for the driver I am developing does not work. It works
according to the status messages, but after much tearing-out-of-hair, I
have learnt that the kernel is in fact still running an old version of my
driver. This is the case even after rebooting.
This is the process that I have been using to update the binary for my
driver (dante) whenever I make changes to it.
1. sc stop dante [sc reports success]
2. sc delete dante [sc reports success]
3. copy \dante.sys \dante.sys
4. sc create dante type= kernel binpath= \dante.sys [sc reports
success]
5. sc start dante [sc reports success]
Unfortunately, despite sc’s repeated assurances that all is well, errors
that I have fixed in the current binary keep occuring in the running
version. After a while I began to suspect that the kernel was still
running an old version, and sure enough, “driverquery -v | grep dante”
reports that the link date is 48 hours ago. This is despite the fact that
the timestamp of the file path reported by driverquery is 2 minutes ago.
If I delete the binary and then try to start, I predictably get a file not
found error, but when I put the current binary back and execute start, the
kernel fires up the stale binary instead.
None of this seems to make sense, but then I guess I’m missing something.
I could use the debugger’s driver map, but that seems a bit unneccesary
when I should be able to load it directly.
Can anyone help me out of this mess?
Regards,
Joe.
>1. sc stop dante [sc reports success]
Yes for non-PnP drivers.
For PnP drivers, this does not work, you must disable all devnodes in Device
Manager or via DEVCON instead.
- sc delete dante [sc reports success]
No need.
- copy \dante.sys \dante.sys
Yes.
>. sc create dante type= kernel binpath= \dante.sys [sc reports
>success]
No need.
>5. sc start dante [sc reports success]
Yes, or enable the devnode(s) in Device Manager.
–
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
> Actually the service control manager interface does not just change the
registry
No need to do this to replace the binary.
–
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
Hi,
Thanks Maxim & others for the responses.
I figured out my problem – the build directory that I thought I was
copying from in step 3 was different to the build directory that I was
actually copying from. The reason for this is because I am using a cygwin
environment to run my build scripts and I forgot to convert one particular
path name from posix to windows.
Thanks for all of the helpful info.
Regards,
Joe.
On Sat, 01 Mar 2008 01:25:40 +0800, Maxim S. Shatskih
wrote:
>> 1. sc stop dante [sc reports success]
>
> Yes for non-PnP drivers.
>
> For PnP drivers, this does not work, you must disable all devnodes in
> Device
> Manager or via DEVCON instead.
>
>> 2. sc delete dante [sc reports success]
>
> No need.
>
>> 3. copy \dante.sys \dante.sys
>
> Yes.
>
>> . sc create dante type= kernel binpath= \dante.sys [sc reports
>> success]
>
> No need.
>
>> 5. sc start dante [sc reports success]
>
> Yes, or enable the devnode(s) in Device Manager.
>