test: ntapm.h Source File

Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

# ntapm.h

Go to the documentation of this file.

    00001 /*++
    00002 ;
    00003 ; Copyright (c) 1998  Microsoft Corporation
    00004 ;
    00005 ; Module Name:
    00006 ;
    00007 ;   ntapm.h
    00008 ;
    00009 ; Abstract:
    00010 ;
    00011 ;   This module contains definitions specific to legacy APM support
    00012 ;   in NT5, including special HAL interfaces
    00013 ;
    00014 ; Author:
    00015 ;
    00016 ;   Bryan Willman (bryanwi) 13 Feb 1998
    00017 ;
    00018 ; Revision History:
    00019 ;
    00020 ;
    00021 --*/
    00022
    00023
    00024 //
    00025 // Arguments to HalInitPowerManagment
    00026 //
    00027 #define HAL_APM_SIGNATURE   0x004D5041      // APM
    00028 #define HAL_APM_VERSION     500             // 5.00
    00029
    00030 #define HAL_APM_TABLE_SIZE  (sizeof(PM_DISPATCH_TABLE)+sizeof(PVOID))
    00031
    00032 #define HAL_APM_SLEEP_VECTOR    0
    00033 #define HAL_APM_OFF_VECTOR      1
    00034
    00035
    00036 //
    00037 // Values used in the Parameters.Other part of an IO_STACK_LOCATION
    00038 // to set up a link between a battery and ntapm.sys
    00039 //
    00040 typedef struct _NTAPM_LINK {
    00041     ULONG   Signature;      // overlay Argument1
    00042     ULONG   Version;        // overlay Argument2
    00043     ULONG   BattLevelPtr;   // overlay Argument3, pointer to pointer to a pvoid void function
    00044     ULONG   ChangeNotify;   // overlay Argument4, address of notify function
    00045 } NTAPM_LINK, *PNTAPM_LINK;
    00046
    00047 #define NTAPM_LINK_SIGNATURE    0x736d7061  // apms  = Argument1
    00048 #define NTAPM_LINK_VERSION      500         // 5.00  = Argument2
    00049
    00050 //
    00051 // Major code is IRP_MJ_INTERNAL_DEVICE_CONTROL
    00052 // Minor code is 0.
    00053 //
    00054
    00055 //
    00056 // BattLevelPtr gets the address of a routine with prototype:
    00057 //
    00058 //ULONG BatteryLevel();
    00059 //
    00060
    00061 //
    00062 // Data returned by NtApmGetBatteryLevel in NTAPM
    00063 // is a ULONG, cracked with these defines.
    00064 //
    00065 #define     NTAPM_ACON                  0x1000
    00066 #define     NTAPM_NO_BATT               0x2000
    00067 #define     NTAPM_NO_SYS_BATT           0x4000
    00068 #define     NTAPM_BATTERY_STATE         0x0f00
    00069 #define     NTAPM_BATTERY_STATE_SHIFT   8
    00070 #define     NTAPM_POWER_PERCENT         0x00ff
    00071
    00072
    00073
    00074 //
    00075 // ChangeNotify provides the address of a routine with prototype
    00076 //
    00077 //VOID ChangeNotify();
    00078 //
    00079
    00080
    00081
    00082
    00083