From: Boris on
Hi,

I'm thinking about writing custom Native EXE that will be executed early
during Windows boot process. I'll put pathname of my Native EXE into
BootExecute value in
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager key. But
I need to tell "cold" boot from "warm" boot: if hardware was powered on or
just Windows restarted.
Is there a way of doing this?

Thanks,
Boris

From: Boris on
The operating systems in question are: XP SP3 (or XP Embedded Standard),
Win7 (or Win 7 Embedded).

Thanks,
Boris

"Boris" <somewhere(a)nowhere.net> wrote in message
news:4c38f6cf$0$22105$742ec2ed(a)news.sonic.net...
> Hi,
>
> I'm thinking about writing custom Native EXE that will be executed early
> during Windows boot process. I'll put pathname of my Native EXE into
> BootExecute value in
> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager key.
> But I need to tell "cold" boot from "warm" boot: if hardware was powered
> on or just Windows restarted.
> Is there a way of doing this?
>
> Thanks,
> Boris

From: a on
"Boris" <somewhere(a)nowhere.net> wrote in message news:4c38f980$0$22093$742ec2ed(a)news.sonic.net...
> The operating systems in question are: XP SP3 (or XP Embedded Standard), Win7 (or Win 7 Embedded).
>
> Thanks,
> Boris
>
> "Boris" <somewhere(a)nowhere.net> wrote in message news:4c38f6cf$0$22105$742ec2ed(a)news.sonic.net...
>> Hi,
>>
>> I'm thinking about writing custom Native EXE that will be executed early during Windows boot process. I'll put pathname of my
>> Native EXE into BootExecute value in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager key. But I need to tell
>> "cold" boot from "warm" boot: if hardware was powered on or just Windows restarted.
>> Is there a way of doing this?

I was going to say just check the value of GetTickCount(), but that's no
good if the user has rebooted the PC. Maybe check that once, and store a
flag value somewhere (with the date) so that subsequent checks on the same
day know that the PC has already been previously started that day? That
should work fine.


From: Boris on


"a" <b(a)invalid.com> wrote in message news:4c39fc6b$1(a)dnews.tpgi.com.au...
> "Boris" <somewhere(a)nowhere.net> wrote in message
> news:4c38f980$0$22093$742ec2ed(a)news.sonic.net...
>> The operating systems in question are: XP SP3 (or XP Embedded Standard),
>> Win7 (or Win 7 Embedded).
>>
>> Thanks,
>> Boris
>>
>> "Boris" <somewhere(a)nowhere.net> wrote in message
>> news:4c38f6cf$0$22105$742ec2ed(a)news.sonic.net...
>>> Hi,
>>>
>>> I'm thinking about writing custom Native EXE that will be executed early
>>> during Windows boot process. I'll put pathname of my Native EXE into
>>> BootExecute value in
>>> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager key.
>>> But I need to tell "cold" boot from "warm" boot: if hardware was powered
>>> on or just Windows restarted.
>>> Is there a way of doing this?
>
> I was going to say just check the value of GetTickCount(), but that's no
> good if the user has rebooted the PC. Maybe check that once, and store a
> flag value somewhere (with the date) so that subsequent checks on the same
> day know that the PC has already been previously started that day? That
> should work fine.
Thanks for the response - but I don't think so. GetTickCount() counter is
reset to 0 each time OS boots - you cannot tell cold boot from warm boot
that way. It's possible, some HAL lib functions can extract that info from
system BIOS - but I couldn't find anything relevant.

Boris

From: Don Burn on
You can find out in a driver from the power state transitions what the
user intended to do at shutdown, but this does not ensure that you will
get the result. For instance, the person who chooses reboot then pulls
the power. If you can live with that restriction, there are approaches,
otherwise the comments so far are probably about all you can do.


Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr



> -----Original Message-----
> From: Boris [mailto:somewhere(a)nowhere.net]
> Posted At: Saturday, July 10, 2010 6:41 PM
> Posted To: microsoft.public.development.device.drivers
> Conversation: Is it possible to determine (programmatically) if system
was
> just powered up or rebooted
> Subject: Is it possible to determine (programmatically) if system was
just
> powered up or rebooted
>
> Hi,
>
> I'm thinking about writing custom Native EXE that will be executed
early
> during Windows boot process. I'll put pathname of my Native EXE into
> BootExecute value in
> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager
key. But I
> need to tell "cold" boot from "warm" boot: if hardware was powered on
or just
> Windows restarted.
> Is there a way of doing this?
>
> Thanks,
> Boris
>
>
> __________ Information from ESET Smart Security, version of virus
signature
> database 5268 (20100710) __________
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>