- 3


(ucMode & SUSPEND) ? "SUSPEND" :

(ucMode & OFF) ? "OFF" :

(ucMode & REDUCED) ? "REDUCED" : ""

);


printf("\n\n "

" ( STANDBY)"

"\n " );


//

getch();


//

uiResult = SetPowerState(STANDBY);

printf("\n SetPowerState(STANDBY) "

" %d", uiResult );


//

getch();


//

uiResult = SetPowerState( ON );

printf("\n SetPowerState( ON ) "

" %d", uiResult );


return;

}


//===========================================================

// SetPowerState

//

//===========================================================

int

SetPowerState( unsigned char ucMode )

{

union REGS regs;

int iResult;


regs.h.ah = 0x4f;

regs.h.al = 0x10;

regs.h.bl = 0x01;

regs.h.bh = ucMode;

int86(0x10, &regs, &regs);


iResult = AnalyseResult(regs);


return iResult;

}


//===========================================================

// GetPowerState

//

//===========================================================

int

GetPowerState( unsigned char *ucMode )

{

union REGS regs;

int iResult;


regs.h.ah = 0x4f;

regs.h.al = 0x10;

regs.h.bl = 0x02;


int86(0x10, &regs, &regs);


*ucMode = regs.h.bh;


iResult = AnalyseResult(regs);


return iResult;

}


//===========================================================