The boot sequence and autochk

Hello All

I have a problem with opening a file early in the boot sequence and
holding it open.

At present I know that the session manager starts chkdsk as one of the
first if not the first user mode action and that it needs exclusive
access to the disk. A registry key is used to control the start of
chkdsk early in the boot cycle i.e
\Registry\Machine\System\CurrentControlSet\Control\Session Manager\
BootExecute. Part of this key is set if the user has tried to run chkdsk
with the /f option but it has been unable to gain exclusive access to
the disk and the user has opted to run chkdsk on reboot.

Now our driver could be started in the boot sequence or dynamically by
the user. The problem is when can we open and hold the file. If the
driver was loaded dynamically the user may also have run chkdsk /f. If
we check the registry key at this point we know that chkdsk is going to
run but without knowing if we are in the boot sequence we don’t know if
we can ignore it.

From “Microsoft Windows internals, fourth edition” I also know that
Microsoft had a similar problem with boot logging which is held in the
registry until a flag is set by a function call. See page 278 second
paragraph.

Questions

Is there a published way to get hold of this flag?

Can anyone tell me if there is another way of finding out if you are in
the boot sequence and if so which part of the boot sequence you are in?

Steve Trivett

Senior Software Engineer

Computer Associates