if(!gTimeOutList && theApp.m_pMainWnd && theApp.m_pMainWnd->m_hWnd)    {
else if(!gTimeOutList)    {
void SyncTimeoutPeriod(DWORD dwTickCount){    //  May want us to set tick count ourselves.    if(dwTickCount == 0)    {        if(dwSyncHack == 0) {            dwTickCount = GetTickCount();        }        else    {            dwTickCount = dwSyncHack;        }    }    ASSERT(!uTimeoutTimer || (uTimeoutTimer && !(theApp.m_pMainWnd == NULL || theApp.m_pMainWnd->m_hWnd == NULL)));    //  If there's no list, we should clear the timer.    if(!gTimeOutList && theApp.m_pMainWnd && theApp.m_pMainWnd->m_hWnd)    {        if(uTimeoutTimer)   {            VERIFY(::KillTimer(theApp.m_pMainWnd->m_hWnd, 777));            uTimeoutTimer = 0;            dwNextFire = (DWORD)-1;        }        //  Explicitly clear the idle binding if set previously.        theApp.m_bIdleProcessTimeouts = FALSE;    }    else if(theApp.m_pMainWnd && theApp.m_pMainWnd->m_hWnd)   {        //  See if we need to clear the current timer.        //  Curcumstances are that if the timer will not        //      fire on time for the next timeout.        BOOL bSetTimer = FALSE;        WinTime *pTimeout = gTimeOutList;        if(uTimeoutTimer)   {            if(pTimeout->dwFireTime != dwNextFire)   {                //  There is no need to kill the timer if we are just going to set it again.                //  Windows will simply respect the new time interval passed in.                //  VERIFY(::KillTimer(theApp.m_pMainWnd->m_hWnd, 777));                uTimeoutTimer = 0;                dwNextFire = (DWORD)-1;                //  Set the timer.                bSetTimer = TRUE;            }        }        else    {            //  No timer set, attempt.            bSetTimer = TRUE;        }        if(bSetTimer)   {            DWORD dwFireWhen = pTimeout->dwFireTime > dwTickCount ?                pTimeout->dwFireTime - dwTickCount : 0;            if(dwFireWhen > UINT_MAX)   {                dwFireWhen = UINT_MAX;            }            UINT uFireWhen = CASTUINT(dwFireWhen);            ASSERT(uTimeoutTimer == 0);            uTimeoutTimer = ::SetTimer(                theApp.m_pMainWnd->m_hWnd,                 777,                 uFireWhen,                 FireTimeout);            if(uTimeoutTimer)   {                //  Set the fire time.                dwNextFire = pTimeout->dwFireTime;            }        }        //  See if the app should attempt to bind idle processing to the        //      timer code (in the event no timers could be allocated).        if(uTimeoutTimer)   {            theApp.m_bIdleProcessTimeouts = FALSE;        }        else    {            ASSERT(0);            theApp.m_bIdleProcessTimeouts = TRUE;        }    }}