The driver should do whatever the hardware needs, then whatever kernel-side
functionality is required, then whatever the application requires. And even
when we must look at the hypothetical “user”, it’s more often than not that
we’re not addressing a user, but a market: most of the situations I have
faced were determined not by users, but by market requirements and
application specs.
Some drivers require to be vertically integrated with the application. Some
applications take over the whole machine and are the only reason why the
user is using the computer. Some applications cannot afford themselves the
luxury of allowing the OS to barge in as if it owned the machine. Computers
are there to do what their owners need and want!
The OS must be flexible enough that the “policy”, whatever it is, can be
localized from application to application and from system to system. For
example, some system administrator may require the system to reboot the
moment the chip times out. Some admins may want to let this decision to be
taken by a user-side driver, or from a service. Some admins may want to
place this responsibility in the aplication layer. Some may want policy
administration to emanate from a user-side library.
Bottom line is, I don’t believe it’s an OS call to define policy. That’s a
system administrator responsibility!
Alberto.
----- Original Message -----
From: “Jake Oshins”
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”
Sent: Tuesday, December 25, 2007 4:24 PM
Subject: Re:[ntdev] Re:How to prevent Visra from entering Sleep or
Hibernation mode
> One of the reasons that we changed this behavior in Vista is that, after
> playing with this behavior for ten years or so, it has become completely
> clear that the driver is the wrong place to apply this policy. A driver,
> specifically because it doesn’t have a clear path to interaction with the
> user, is the wrong place for policy.
>
> Applications which interact with the user are the right places for dealing
> with policy. Drivers should just implement whatever the user wants. If
> your application has already cancelled sleep timeouts while it is
> acquiring data, the only reason the system will go do sleep is because the
> user requested it. And, if the user requested it, then you should do your
> best to help the user get what she asked for. If this is impossible for
> some reason, your application can interact with the user.
>
> - Jake Oshins
>
>
>
>
> “Doron Holan” wrote in message
> news:xxxxx@ntdev…
>> Use PoRegisterSystemState in the driver, something like this
>>
>> 1 PVOID hPower = PoRegisterSystemState(NULL, ES_SYSTEM_REQUIRED |
>> ES_CONTINUOUS);
>> 2 …do your work (probably asynchronously)…
>> 3 when done, call PoUnregisterSystemState(hPower);
>>
>> d
>>
>>
>> -----Original Message-----
>> From: xxxxx@lists.osr.com
>> [mailto:xxxxx@lists.osr.com] On Behalf Of Quang Vu
>> Sent: Wednesday, December 19, 2007 12:25 PM
>> To: Windows System Software Devs Interest List
>> Subject: Re:[ntdev] How to prevent Visra from entering Sleep or
>> Hibernation mode
>>
>> Thanks you for all responses
>>
>> I know what I should do.
>>
>> The reason that I want to prevent sleep or hibernation in Vista is that
>> our
>> PCI card is a data acquisition card with a huge onboard memory (upto
>> 4GB). A
>> data acqusition may take very long depending on the sampling rate and how
>> much data. If the system goes down into hibernation right in the middle
>> of
>> acquisiton, this will result in data lost or corrupted.
>>
>> How should I handle this case in driver? At least can I delay hibernation
>> until the end of data acquisition ? Will 2 functions that Peter mentioned
>> do
>> the job ?
>>
>> Thanks
>>
>> QUANG
>>
>>
>> wrote in message news:xxxxx@ntdev…
>>> The previous answers you received are certainly correct.
>>>
>>> First, it sounds like you have a drive that is, effectively, working
>>> incorrectly. You should fix it to handle power state transitions
>>> properly.
>>>
>>> OTOH, if you have a requirement that the system NOT idle for a period of
>>> time, you can indicate this to the OS using PoRegisterSystemState or
>>> PoSetSystemState. IIRC, these still work on Vista.
>>>
>>> Peter
>>> OSR
>>>
>>>
>>
>>
>>
>> —
>> 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