IoRegisterDriverReinitialization Query

Folks,

Recently I read about “IoRegisterDriverReinitialization” function exported
by kernel.

It’s documentation says “Any driver that needs to initialize itself in
stages can contain a
*Reinitialize*http:
routine”.

What are these stages and how/who define them?
What makes kernel to decide whether to call ReInitialize routine of a
driver.

Regards
Deepak</http:>

These are the different stages of boot (phase 0 and 1 IIRC). This function is only usefull if you are a boot start driver.

What problem are you trying to solve?

d

Sent from my phone with no t9, all spilling mistakes are not intentional.

-----Original Message-----
From: Deepak Gupta
Sent: Monday, November 16, 2009 7:40 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] IoRegisterDriverReinitialization Query

Folks,

Recently I read about “IoRegisterDriverReinitialization” function exported by kernel.

It’s documentation says “Any driver that needs to initialize itself in stages can contain a?Reinitialize?routine”.

What are these stages and how/who define them?
What makes kernel to decide whether to call ReInitialize routine of a driver.

Regards
Deepak— 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

As such I don’t have any problem yet because of it.
But I have a Filter driver with me (Volume class for tracking the changes to
volume) and I was just going through it.
I registers a ReInitialize routine.
I see that it does some initialization work inside AddDevice routine and
some more init work MN_START_DEVICE handler.

I saw in ReInitialize routine it iterated through all the device list and
did some more initialization stuff.

So basically I am wondering that what is so special that it is doing in
ReInitialize routine that it could not have done in MN_START_DEVICE handler
or in AddDevice. Though I could not figure out anything special there :frowning:

Also what would make kernel to call it’s ReInitialize routine and how many
times.

Regards
Deepak

On Mon, Nov 16, 2009 at 9:15 PM, Doron Holan wrote:

> These are the different stages of boot (phase 0 and 1 IIRC). This function
> is only usefull if you are a boot start driver.
>
> What problem are you trying to solve?
>
> d
>
> Sent from my phone with no t9, all spilling mistakes are not intentional.
>
> -----Original Message-----
> From: Deepak Gupta
> Sent: Monday, November 16, 2009 7:40 AM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] IoRegisterDriverReinitialization Query
>
> Folks,
>
> Recently I read about “IoRegisterDriverReinitialization” function exported
> by kernel.
>
> It’s documentation says “Any driver that needs to initialize itself in
> stages can contain a Reinitialize routine”.
>
>
> What are these stages and how/who define them?
> What makes kernel to decide whether to call ReInitialize routine of a
> driver.
>
>
> Regards
> Deepak— 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
>

What is the driver doing in the reinit routine?

d

Sent from my phone with no t9, all spilling mistakes are not intentional.


From: Deepak Gupta
Sent: Monday, November 16, 2009 8:07 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] IoRegisterDriverReinitialization Query

As such I don’t have any problem yet because of it.
But I have a Filter driver with me (Volume class for tracking the changes to volume) and I was just going through it.
I registers a ReInitialize routine.
I see that it does some initialization work inside AddDevice routine and some more init work MN_START_DEVICE handler.

I saw in ReInitialize routine it iterated through all the device list and did some more initialization stuff.

So basically I am wondering that what is so special that it is doing in ReInitialize routine that it could not have done in MN_START_DEVICE handler or in AddDevice. Though I could not figure out anything special there :frowning:

Also what would make kernel to call it’s ReInitialize routine and how many times.

Regards
Deepak

On Mon, Nov 16, 2009 at 9:15 PM, Doron Holan > wrote:
These are the different stages of boot (phase 0 and 1 IIRC). This function is only usefull if you are a boot start driver.

What problem are you trying to solve?

d

Sent from my phone with no t9, all spilling mistakes are not intentional.

-----Original Message-----
From: Deepak Gupta >
Sent: Monday, November 16, 2009 7:40 AM
To: Windows System Software Devs Interest List >
Subject: [ntdev] IoRegisterDriverReinitialization Query

Folks,

Recently I read about “IoRegisterDriverReinitialization” function exported by kernel.

It’s documentation says “Any driver that needs to initialize itself in stages can contain a Reinitialize routine”.

What are these stages and how/who define them?
What makes kernel to decide whether to call ReInitialize routine of a driver.

Regards
Deepak— 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

It is iterating through all the devices (volumes) it is attached to and
starting the change tracking (basically recording the changed blocks on the
volume in file) on them.

Regards
Deepak

On Mon, Nov 16, 2009 at 10:08 PM, Doron Holan wrote:

> What is the driver doing in the reinit routine?
>
>
> d
>
> Sent from my phone with no t9, all spilling mistakes are not intentional.
>
> ------------------------------
> From: Deepak Gupta
> Sent: Monday, November 16, 2009 8:07 AM
>
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] IoRegisterDriverReinitialization Query
>
> As such I don’t have any problem yet because of it.
> But I have a Filter driver with me (Volume class for tracking the changes
> to volume) and I was just going through it.
> I registers a ReInitialize routine.
> I see that it does some initialization work inside AddDevice routine and
> some more init work MN_START_DEVICE handler.
>
> I saw in ReInitialize routine it iterated through all the device list and
> did some more initialization stuff.
>
> So basically I am wondering that what is so special that it is doing in
> ReInitialize routine that it could not have done in MN_START_DEVICE handler
> or in AddDevice. Though I could not figure out anything special there :frowning:
>
> Also what would make kernel to call it’s ReInitialize routine and how
> many times.
>
> Regards
> Deepak
>
> On Mon, Nov 16, 2009 at 9:15 PM, Doron Holan wrote:
>
>> These are the different stages of boot (phase 0 and 1 IIRC). This function
>> is only usefull if you are a boot start driver.
>>
>> What problem are you trying to solve?
>>
>> d
>>
>> Sent from my phone with no t9, all spilling mistakes are not intentional.
>>
>> -----Original Message-----
>> From: Deepak Gupta
>> Sent: Monday, November 16, 2009 7:40 AM
>> To: Windows System Software Devs Interest List
>> Subject: [ntdev] IoRegisterDriverReinitialization Query
>>
>> Folks,
>>
>> Recently I read about “IoRegisterDriverReinitialization” function exported
>> by kernel.
>>
>> It’s documentation says “Any driver that needs to initialize itself in
>> stages can contain a Reinitialize routine”.
>>
>>
>> What are these stages and how/who define them?
>> What makes kernel to decide whether to call ReInitialize routine of a
>> driver.
>>
>>
>> Regards
>> Deepak— 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
>

hmm it looks to me that person who wrote this basic prototype driver was
under the impression that ReInitialize routine will be called when system
will be ready for file I/Os (which I don’t think is defined as a stage in
windows kernel, correct me if i m wrong).

One more thing is waiting for file system to get up for recording the
changes will defeat the purpose of tracking the changes on volume as file
system drivers might do some writes while in the mount path.

Well this driver is still under development and yet to be released, So it
made me to make this assumption as I see from the sources.

Regards
Deepak

On Mon, Nov 16, 2009 at 9:29 PM, Deepak Gupta wrote:

> As such I don’t have any problem yet because of it.
> But I have a Filter driver with me (Volume class for tracking the changes
> to volume) and I was just going through it.
> I registers a ReInitialize routine.
> I see that it does some initialization work inside AddDevice routine and
> some more init work MN_START_DEVICE handler.
>
> I saw in ReInitialize routine it iterated through all the device list and
> did some more initialization stuff.
>
> So basically I am wondering that what is so special that it is doing in
> ReInitialize routine that it could not have done in MN_START_DEVICE handler
> or in AddDevice. Though I could not figure out anything special there :frowning:
>
> Also what would make kernel to call it’s ReInitialize routine and how many
> times.
>
> Regards
> Deepak
>
>
> On Mon, Nov 16, 2009 at 9:15 PM, Doron Holan wrote:
>
>> These are the different stages of boot (phase 0 and 1 IIRC). This function
>> is only usefull if you are a boot start driver.
>>
>> What problem are you trying to solve?
>>
>> d
>>
>> Sent from my phone with no t9, all spilling mistakes are not intentional.
>>
>> -----Original Message-----
>> From: Deepak Gupta
>> Sent: Monday, November 16, 2009 7:40 AM
>> To: Windows System Software Devs Interest List
>> Subject: [ntdev] IoRegisterDriverReinitialization Query
>>
>> Folks,
>>
>> Recently I read about “IoRegisterDriverReinitialization” function exported
>> by kernel.
>>
>> It’s documentation says “Any driver that needs to initialize itself in
>> stages can contain a Reinitialize routine”.
>>
>>
>> What are these stages and how/who define them?
>> What makes kernel to decide whether to call ReInitialize routine of a
>> driver.
>>
>>
>> Regards
>> Deepak— 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 am pretty sure the assumptions are wrong. As soon as the start irp completes above your driver, io can start flowing.

d

Sent from my phone with no t9, all spilling mistakes are not intentional.


From: Deepak Gupta
Sent: Monday, November 16, 2009 10:05 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] IoRegisterDriverReinitialization Query

hmm it looks to me that person who wrote this basic prototype driver was under the impression that ReInitialize routine will be called when system will be ready for file I/Os (which I don’t think is defined as a stage in windows kernel, correct me if i m wrong).

One more thing is waiting for file system to get up for recording the changes will defeat the purpose of tracking the changes on volume as file system drivers might do some writes while in the mount path.

Well this driver is still under development and yet to be released, So it made me to make this assumption as I see from the sources.

Regards
Deepak

On Mon, Nov 16, 2009 at 9:29 PM, Deepak Gupta > wrote:
As such I don’t have any problem yet because of it.
But I have a Filter driver with me (Volume class for tracking the changes to volume) and I was just going through it.
I registers a ReInitialize routine.
I see that it does some initialization work inside AddDevice routine and some more init work MN_START_DEVICE handler.

I saw in ReInitialize routine it iterated through all the device list and did some more initialization stuff.

So basically I am wondering that what is so special that it is doing in ReInitialize routine that it could not have done in MN_START_DEVICE handler or in AddDevice. Though I could not figure out anything special there :frowning:

Also what would make kernel to call it’s ReInitialize routine and how many times.

Regards
Deepak

On Mon, Nov 16, 2009 at 9:15 PM, Doron Holan > wrote:
These are the different stages of boot (phase 0 and 1 IIRC). This function is only usefull if you are a boot start driver.

What problem are you trying to solve?

d

Sent from my phone with no t9, all spilling mistakes are not intentional.

-----Original Message-----
From: Deepak Gupta >
Sent: Monday, November 16, 2009 7:40 AM
To: Windows System Software Devs Interest List >
Subject: [ntdev] IoRegisterDriverReinitialization Query

Folks,

Recently I read about “IoRegisterDriverReinitialization” function exported by kernel.

It’s documentation says “Any driver that needs to initialize itself in stages can contain a Reinitialize routine”.

What are these stages and how/who define them?
What makes kernel to decide whether to call ReInitialize routine of a driver.

Regards
Deepak— 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

Yeah looks like same to me.

Thanks Doron.

Regards
Deepak

On Tue, Nov 17, 2009 at 6:45 AM, Doron Holan wrote:

> I am pretty sure the assumptions are wrong. As soon as the start irp
> completes above your driver, io can start flowing.
>
>
> d
>
> Sent from my phone with no t9, all spilling mistakes are not intentional.
>
> ------------------------------
> From: Deepak Gupta
> Sent: Monday, November 16, 2009 10:05 AM
>
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] IoRegisterDriverReinitialization Query
>
> hmm it looks to me that person who wrote this basic prototype driver was
> under the impression that ReInitialize routine will be called when system
> will be ready for file I/Os (which I don’t think is defined as a stage in
> windows kernel, correct me if i m wrong).
>
> One more thing is waiting for file system to get up for recording the
> changes will defeat the purpose of tracking the changes on volume as file
> system drivers might do some writes while in the mount path.
>
> Well this driver is still under development and yet to be released, So it
> made me to make this assumption as I see from the sources.
>
> Regards
> Deepak
>
>
> On Mon, Nov 16, 2009 at 9:29 PM, Deepak Gupta wrote:
>
>> As such I don’t have any problem yet because of it.
>> But I have a Filter driver with me (Volume class for tracking the changes
>> to volume) and I was just going through it.
>> I registers a ReInitialize routine.
>> I see that it does some initialization work inside AddDevice routine and
>> some more init work MN_START_DEVICE handler.
>>
>> I saw in ReInitialize routine it iterated through all the device list
>> and did some more initialization stuff.
>>
>> So basically I am wondering that what is so special that it is doing in
>> ReInitialize routine that it could not have done in MN_START_DEVICE handler
>> or in AddDevice. Though I could not figure out anything special there :frowning:
>>
>> Also what would make kernel to call it’s ReInitialize routine and how
>> many times.
>>
>> Regards
>> Deepak
>>
>>
>> On Mon, Nov 16, 2009 at 9:15 PM, Doron Holan wrote:
>>
>>> These are the different stages of boot (phase 0 and 1 IIRC). This
>>> function is only usefull if you are a boot start driver.
>>>
>>> What problem are you trying to solve?
>>>
>>> d
>>>
>>> Sent from my phone with no t9, all spilling mistakes are not intentional.
>>>
>>> -----Original Message-----
>>> From: Deepak Gupta
>>> Sent: Monday, November 16, 2009 7:40 AM
>>> To: Windows System Software Devs Interest List
>>> Subject: [ntdev] IoRegisterDriverReinitialization Query
>>>
>>> Folks,
>>>
>>> Recently I read about “IoRegisterDriverReinitialization” function
>>> exported by kernel.
>>>
>>> It’s documentation says “Any driver that needs to initialize itself in
>>> stages can contain a Reinitialize routine”.
>>>
>>>
>>> What are these stages and how/who define them?
>>> What makes kernel to decide whether to call ReInitialize routine of a
>>> driver.
>>>
>>>
>>> Regards
>>> Deepak— 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
>