executing custome code from INF file

Hi

I want to execute a custom code from INF file. My INF file installs a boot
driver and ask for reboot. But, I want to execute my custom code before
system getting shut down.
Can we do this from INF file ?

Thanks in advance

-James

No, not really. You can potentially use a coinstaller that will run during the installation of the device. What do you want to do in this chunk code that you want to run?

d

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of James Thompson
Sent: Wednesday, February 06, 2008 9:41 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] executing custome code from INF file

Hi

I want to execute a custom code from INF file. My INF file installs a boot driver and ask for reboot. But, I want to execute my custom code before system getting shut down.
Can we do this from INF file ?

Thanks in advance

-James
— 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

I am not clear what you mean by coinstaller. Does coninstaller will launch
INF and my custom code OR INF will lanch coinstaller which will launch the
custom code ?

On Feb 7, 2008 11:38 AM, Doron Holan wrote:

> No, not really. You can potentially use a coinstaller that will run
> during the installation of the device. What do you want to do in this chunk
> code that you want to run?
>
>
>
> d
>
>
>
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] *On Behalf Of *James Thompson
> Sent: Wednesday, February 06, 2008 9:41 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] executing custome code from INF file
>
>
>
> Hi
>
> I want to execute a custom code from INF file. My INF file installs a boot
> driver and ask for reboot. But, I want to execute my custom code before
> system getting shut down.
> Can we do this from INF file ?
>
> Thanks in advance
>
> -James
> — 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
>

Assuming this is a pnp device installation then the INF refers to a device coinstaller. The coinstaller is then invoked (potentially in a system context vs the current user depending on if your INF is signed) during the installation of the device.

d

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of James Thompson
Sent: Wednesday, February 06, 2008 10:51 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] executing custome code from INF file

I am not clear what you mean by coinstaller. Does coninstaller will launch INF and my custom code OR INF will lanch coinstaller which will launch the custom code ?
On Feb 7, 2008 11:38 AM, Doron Holan > wrote:

No, not really. You can potentially use a coinstaller that will run during the installation of the device. What do you want to do in this chunk code that you want to run?

d

From: xxxxx@lists.osr.commailto:xxxxx [mailto:xxxxx@lists.osr.commailto:xxxxx] On Behalf Of James Thompson
Sent: Wednesday, February 06, 2008 9:41 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] executing custome code from INF file

Hi

I want to execute a custom code from INF file. My INF file installs a boot driver and ask for reboot. But, I want to execute my custom code before system getting shut down.
Can we do this from INF file ?

Thanks in advance

-James
— 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

— 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</mailto:xxxxx></mailto:xxxxx>

Thanks Doron

On Feb 7, 2008 12:24 PM, Doron Holan wrote:

> Assuming this is a pnp device installation then the INF refers to a
> device coinstaller. The coinstaller is then invoked (potentially in a system
> context vs the current user depending on if your INF is signed) during the
> installation of the device.
>
>
>
> d
>
>
>
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] *On Behalf Of *James Thompson
> Sent: Wednesday, February 06, 2008 10:51 PM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] executing custome code from INF file
>
>
>
> I am not clear what you mean by coinstaller. Does coninstaller will launch
> INF and my custom code OR INF will lanch coinstaller which will launch the
> custom code ?
>
> On Feb 7, 2008 11:38 AM, Doron Holan wrote:
>
> No, not really. You can potentially use a coinstaller that will run
> during the installation of the device. What do you want to do in this chunk
> code that you want to run?
>
>
>
> d
>
>
>
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] *On Behalf Of *James Thompson
> Sent: Wednesday, February 06, 2008 9:41 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] executing custome code from INF file
>
>
>
> Hi
>
> I want to execute a custom code from INF file. My INF file installs a boot
> driver and ask for reboot. But, I want to execute my custom code before
> system getting shut down.
> Can we do this from INF file ?
>
> Thanks in advance
>
> -James
>
> — 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
>
>
> — 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
>

I think coinstaller DLL is exactly for this.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

“James Thompson” wrote in message news:xxxxx@ntdev…
> Hi
>
> I want to execute a custom code from INF file. My INF file installs a boot
> driver and ask for reboot. But, I want to execute my custom code before
> system getting shut down.
> Can we do this from INF file ?
>
> Thanks in advance
>
> -James
>

> INF and my custom code OR INF will lanch coinstaller which will launch the

custom code ?

The INF interpreter within PnP will load your coinstaller (if it is
registered in the registry) together with the class installer, and call them
several times on several phases of PnP devnode creation after CopyFiles and
AddReg actions of the INF.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

I didnt get you.Can you elaborate more ?

I have successfully written the co-installer DLL. How can I debug it ?

On Feb 8, 2008 12:48 PM, James Thompson wrote:

> I didnt get you.Can you elaborate more ?
>

Using virtual machine’s snapshots and rollback after each attempt.

A unit test command-line EXE which calls the thing’s entry points is also a
good idea.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

“James Thompson” wrote in message news:xxxxx@ntdev…
> I have successfully written the co-installer DLL. How can I debug it ?
>
> On Feb 8, 2008 12:48 PM, James Thompson wrote:
>
> > I didnt get you.Can you elaborate more ?
> >
>

That, and writing a program that calls UpdateDriverForPlugAndPlayDevices
and using it as the executable for your DLL. This will only cover the
user desktop portion of the install on Vista, though… to debug the
server-side install part is is trickier… haven’t found anything better
than debug emits for that (and even those can be tricky to capture
sometimes).

Maxim S. Shatskih wrote:

Using virtual machine’s snapshots and rollback after each attempt.

A unit test command-line EXE which calls the thing’s entry points is also a
good idea.


Ray
(If you want to reply to me off list, please remove “spamblock.” from my
email address)

The OS-interface code of the coinstaller is better to be written very
carefully to avoid the very need of debugging.

As about the “meat”, the functionality - it can be tested on unit test EXE
before ever trying to run the real PnP install with this DLL.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

“Ray Trent” wrote in message news:xxxxx@ntdev…
> That, and writing a program that calls UpdateDriverForPlugAndPlayDevices
> and using it as the executable for your DLL. This will only cover the
> user desktop portion of the install on Vista, though… to debug the
> server-side install part is is trickier… haven’t found anything better
> than debug emits for that (and even those can be tricky to capture
> sometimes).
>
> Maxim S. Shatskih wrote:
> > Using virtual machine’s snapshots and rollback after each attempt.
> >
> > A unit test command-line EXE which calls the thing’s entry points is
also a
> > good idea.
> >
>
> –
> Ray
> (If you want to reply to me off list, please remove “spamblock.” from my
> email address)
>
>