// get pointers to APIs for shutting down the system -- this is only necessary if
// we are concerned that somebody might sysgen a version of the OS that doesn't
// contain the appropriate APIs.
gpfnSetSystemPowerState = NULL;
hmCore = (HMODULE) LoadLibrary(_T("coredll.dll"));
if(hmCore == NULL)
return NULL;
gpfnSetSystemPowerState = (PFN_SetSystemPowerState) GetProcAddress(hmCore, _T("SetSystemPowerState"));
FreeLibrary(hmCore);
//////////////////////////////////////....added by me.......................
if (!(InterruptInitialize(SYSINTR_TIMER2, g_hHLTimerEvent, NULL, 0)))
{
RETAILMSG(1, (TEXT("SYSINTR_TIMER2 INTR INIT Failed\r\n")));
}
////////////////////////////////////................end..................
if (g_oalSysInfo.pwrbtnInfo.bCloseWmpOnSleep)
{
if (NULL == g_hCloseWmpEvent)
{
g_hCloseWmpEvent = CreateEvent(NULL,FALSE,FALSE,PM_POWERBTN_CLOSE_WMPLAYER_EVENT);
}
if (NULL == g_hCloseWmpThread)
{
g_hCloseWmpThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) CloseWmpThread, NULL, 0, NULL);
}
if (NULL == g_hCloseWmpEvent || NULL == g_hCloseWmpThread)
{
DEBUGMSG(DBG_ATLAS_ZONE_INIT | DBG_ATLAS_ZONE_ERROR, (TEXT("Fatal Error! Failed to create CloseWmpThread! r\n")));
goto InitFailed;
}
}
//create _T("SHARE_POWER_NOTIFY_EVENT") event, if sleep event come from extern force, will skip this time pwr
ghevNotifyEvent = CreateEvent(NULL, FALSE, FALSE, PM_POWER_NOTIFY_EVENT);
if(ghevNotifyEvent == NULL)
{
RETAILMSG(1,(TEXT("PWR_Init:: create ghevNotifyEvent failure\r\n")));
}