INFO: Windows 98: Set Power Management with _VPOWERD_Get_ModeID: Q230470
|
VxDs running under Windows 98 can use the _VPOWERD_Get_Mode service to determine the power management mode of the system. Vpowerd.h contains the following prototype for this service:
POWERRET
POWERFAR CDECL
_VPOWERD_Get_Mode(
PDWORD Mode
);
0: APM mode
1: ACPI mode
You should call _VPOWERD_Get_Version before calling _VPOWERD_Get_Mode to make sure that VPOWERD is loaded.
#define VPOWERD_IOCTL_GET_MODE 0x00000021<BR/>
HANDLE hndl;
DWORD dwPwrMode;
DWORD dwRetVal;
DWORD cbBytes_Ret;
dwPwrMode = (DWORD)&dwPwrMode;
hndl = CreateFile("\\\\.\\VPOWERD",GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
if (hndl == INVALID_HANDLE_VALUE)
{
printf("VPOWERD not loaded\n");
}
else
{
if (!DeviceIoControl(hndl, VPOWERD_IOCTL_GET_MODE, &dwPwrMode, sizeof(dwPwrMode), &dwRetVal, sizeof(dwRetVal), &cbBytes_Ret, NULL))
{
printf("DeviceIoControl to VPOWERD failed\n");
}
else
{
printf("VPOWERD_GET_MODE return status (0=success): %lx\n",dwRetVal);
printf("# of bytes returned: %lx\n",cbBytes_Ret);
printf("Power Mode (0=APM, 1=ACPI): %lx\n",dwPwrMode);
}
}
See the Windows 98 DDK for more information on VPOWERD and power management.
Additional query words:
Keywords : kbDDK kbWin32s kbWinOS98
Version : Win98:
Platform : Win98
Issue type : kbinfo
Last Reviewed: August 2, 1999