From: Kerem Gümrükcü on
Hi Javier,

what exactly is it you want to do and why not
leaving that to the hands of the OS? What is
the purpose behind that,...?

All the Power Stuff IRP's have the IRP_MJ_POWER Major Code
and then the Minor Codes:

IRP_MN_POWER_SEQUENCE
IRP_MN_QUERY_POWER
IRP_MN_SET_POWER
IRP_MN_WAIT_WAKE

Then you have PoSetPowerState(...) and all
the Power States.

But i would not change anything and leave
that to the OS and Kernel,...

Regards

Kerem

--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Latest Project: http://www.pro-it-education.de/software/deviceremover
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------

"Javier Càceres" <JavierCceres(a)discussions.microsoft.com> schrieb im
Newsbeitrag news:01A8AA48-F266-4C82-AE83-90C890A569E1(a)microsoft.com...
> Hello Kerem, Pavel and Tom,
>
> When one goes to Control Panel>Power Option there is an option to set the
> time Windows will wait to shut down hard discs.
> I want to achieve the same functionality, I don't know what exactly that
> power option means (if it ejectes discs or it enables/disables discs), but
> I
> supose there is a way to do it by using a Win23 method or somethig else.
>
> Thank you so much.
>
> "Tom Handal" wrote:
>
>> On Dec 4, 12:41 pm, Javier Càceres
>> <JavierCce...(a)discussions.microsoft.com> wrote:
>> > Hi there.
>> >
>> > I know how to shut down the whole computer or only the display by
>> > programming.
>> > But, how to shut down a hard disc by code?
>> >
>> > Thanks.
>>
>> You can take a gander here:
>> http://www.osronline.com/ShowThread.cfm?link=140841
>>
>> Not sure if that is what you are trying to do, but maybe it will point
>> you in the right direction?
>>
>> Tom
>> .
>>
From: Robert on

"Kerem Gümrükcü" <kareem114(a)hotmail.com> wrote in message
news:e6BCjEYeKHA.4980(a)TK2MSFTNGP05.phx.gbl...
> Hi Javier,
>
> what exactly is it you want to do and why not
> leaving that to the hands of the OS? What is
> the purpose behind that,...?

I had a situation where something similar was needed. I was working with a
large data set stored in binary files. Lots of structs. While in the
prototyping stage I wanted perf measurements. So I mucked around with IOCTL
a bit to unmount the scratch drive. This blows away the disk cache. And
lets you do a fast format to clear any intermediate data. That way I could
get reproducible benchmarks.



From: Pavel A. on
But this is something different. Cache flush or dismount are usual,
understandable requirements.
If I remember correctly, the policy to shut down the disks is implemented as
idle timeout
in the disk driver stack.
When the timeout occurs, the disk class driver (or whatever is the power
policy owner of the
disk stack) shifts the physical disk to its appropriate low power state
(usualy D3).
There is no way to command the disk "stop now!".
So maybe what the OP wants can be done by setting a very short timeout.
Another way is disabling the disk device by SetupDi API.

Regards,
--pa


"Robert" <robert(a)nospam.com> wrote in message
news:#sqQjxkeKHA.4952(a)TK2MSFTNGP06.phx.gbl...
>
> "Kerem Gümrükcü" <kareem114(a)hotmail.com> wrote in message
> news:e6BCjEYeKHA.4980(a)TK2MSFTNGP05.phx.gbl...
>> Hi Javier,
>>
>> what exactly is it you want to do and why not
>> leaving that to the hands of the OS? What is
>> the purpose behind that,...?
>
> I had a situation where something similar was needed. I was working with
> a large data set stored in binary files. Lots of structs. While in the
> prototyping stage I wanted perf measurements. So I mucked around with
> IOCTL a bit to unmount the scratch drive. This blows away the disk cache.
> And lets you do a fast format to clear any intermediate data. That way I
> could get reproducible benchmarks.
>
>
>