Jump to content

wpChangePowerState

From EDM2
Revision as of 22:09, 1 September 2025 by Martini (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This method is specific to version 2.1, or higher, of the OS/2 operating system.

This instance method performs the power management state change requests to the OS/2 Power Management Subsystem.

Syntax

_wpChangePowerState(somSelf, ulParm1, ulparm2)

Parameters

somSelf (WPPower *) - input
Pointer to the object on which the method is being invoked.
Points to an object of class WPPower.
ulParm1 (ULONG) - input
This parameter contains a complex value. The ULONG value is composed of two separate USHORT values. These values are as follows:
SubId (USHORT) The requested change power state identifier. SubId defines the type of power state transition being requested.
0x0006: Set Power State Request
Note: All other SubId values are reserved for future use.
0 (USHORT): Reserved value, must be 0.
Example of ulParm1 construction:
SubId(USHORT) = 0006h
ulParm1 = MAKEULONG(SubId,0)


ulparm2 (ULONG) - input
This parameter contains a complex value. The ULONG value is composed of two separate USHORT values.
DevId (USHORT): Requested device identifier.
0x0001: All system-managed services.
Note: All other DevId values are reserved for future use.
PwrState (USHORT): Requested power state that the devices specified in DevId are to be set to.
0x0001: Standby State Request.
0x0002: Suspend State Request.
Note: All other PwrState values are reserved for future use.
Example of ulparm2 construction:
DevId(USHORT) = 0001h
PwrState(USHORT) = 0002h
ulParm2 = MAKEULONG(DevId,PwrState)

Returns

rc (BOOL) - returns
Success indicator.
TRUE: The request was successful.
FALSE: The request was unsuccessful.

Remarks

There are no remarks for this method.

Usage

There is no usage information for this method.

How to Override

This method is generally not overridden.

Example Code

Declaration:

#define INCL_WINWORKPLACE
#include <os2.h>

WPPower      *somSelf;  /* Pointer to the object on which the method is being invoked. */
ULONG        ulParm1;   /* Parameter 1. */
ULONG        ulparm2;   /* Parameter 2. */
BOOL         rc;        /* Success indicator. */

rc = _wpChangePowerState(somSelf, ulParm1, ulparm2);

Related Methods