Author |
Topic: Control HDD power ON/OFF from BB4W? (Read 1116 times) |
|
19Grumpah42
Junior Member
member is offline


Gender: 
Posts: 57
|
 |
Re: Control HDD power ON/OFF from BB4W?
« Reply #3 on: Jul 9th, 2011, 12:00am » |
|
Thanks dynamic tiger, that sounds promising.
I am very ignorant about sys calls, so if I cannot find it in WinAPI I am stuck. Where can I learn about the 3 parameters you are sending in {SYS `SetSuspendState`, 0, 1, 0}.
Can I use some variation of this to suspend only specified drives (including a RAID 0 pair)?
--G
|
|
Logged
|
C-2-Q 3GB, C-2-Duo 2GB, both GeForce 9500 GT, WinXP sp3. Two Linux Ubuntu boxes (rock solid, lean and mean, but they won't run BB4W!).
|
|
|
dynamic35
New Member
member is offline


Gender: 
Posts: 34
|
 |
Re: Control HDD power ON/OFF from BB4W?
« Reply #4 on: Jul 9th, 2011, 4:32pm » |
|
on Jul 9th, 2011, 12:00am, 19Grumpah42 wrote:Thanks dynamic tiger, that sounds promising.
I am very ignorant about sys calls, ... --G |
|
(like most of us!) ) but we may study msdn.microsoft.com: BOOLEAN WINAPI SetSuspendState( __in BOOLEAN Hibernate, __in BOOLEAN ForceCritical, __in BOOLEAN DisableWakeEvent );
Parameters Hibernate [in] If this parameter is TRUE, the system hibernates. If the parameter is FALSE, the system is suspended.
ForceCritical [in] This parameter has no effect.
Windows Server 2003, Windows XP, and Windows 2000: If this parameter is TRUE, the system suspends operation immediately; if it is FALSE, the system broadcasts a PBT_APMQUERYSUSPEND event to each application to request permission to suspend operation. DisableWakeEvent [in] If this parameter is TRUE, the system disables all wake events. If the parameter is FALSE, any system wake events remain enabled.
Return Value If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks The calling process must have the SE_SHUTDOWN_NAME privilege. To enable the SE_SHUTDOWN_NAME privilege, use the AdjustTokenPrivileges function. For more information, see Changing Privileges in a Token.
An application may use SetSuspendState to transition the system from the working state to the standby (sleep), or optionally, hibernate (S4) state. This function is similar to the SetSystemPowerState function.
For more information on using PowrProf.h, see Power Schemes. For information about events that can wake the system, see System Wake-up Events.
{SYS `SetSuspendState`, 1, 0, 0}.
saves maximal amount of kilowatts (hibernites)
|
|
Logged
|
|
|
|
19Grumpah42
Junior Member
member is offline


Gender: 
Posts: 57
|
 |
Re: Control HDD power ON/OFF from BB4W?
« Reply #5 on: Jul 10th, 2011, 02:09am » |
|
Thanks for the above, that was encouraging, perhaps I am getting the idea about how to read msdn descriptions. Lots more to embrace, obviously. --G
|
|
Logged
|
C-2-Q 3GB, C-2-Duo 2GB, both GeForce 9500 GT, WinXP sp3. Two Linux Ubuntu boxes (rock solid, lean and mean, but they won't run BB4W!).
|
|
|
Richard Russell
Guest
|
 |
Re: Control HDD power ON/OFF from BB4W?
« Reply #6 on: Jul 14th, 2011, 09:10am » |
|
Don't forget that API Viewer will provide the BB4W translations of many API calls. It's not simply a tool for finding the values of Windows Constants (in which respect it has been superseded by the Windows Constants add-in utility).
If you haven't already done so, download and install API Viewer and its BB4W plug-in, then checkout the translation it gives of the API(s) you are interested in.
Tools are there to be used!!!!
Richard.
|
|
Logged
|
|
|
|
|