Ignore:
Timestamp:
Jun 9, 2001, 4:50:26 PM (24 years ago)
Author:
sandervl
Message:

reference count (window + class objects) rewrite

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/timer.cpp

    r3101 r5935  
    1 /* $Id: timer.cpp,v 1.12 2000-03-13 13:10:48 sandervl Exp $ */
     1/* $Id: timer.cpp,v 1.13 2001-06-09 14:50:20 sandervl Exp $ */
    22
    33/*
     
    113113    int i;
    114114    TIMER *pTimer;
     115    HWND hwndOS2;
    115116    Win32BaseWindow *wnd = Win32BaseWindow::GetWindowFromHandle(hwnd);
    116117
    117     if (hwnd && !wnd) return 0;
     118    if (hwnd && !wnd) {
     119        dprintf(("TIMER_SetTimer invalid window handle %x", hwnd));
     120        SetLastError(ERROR_INVALID_WINDOW_HANDLE_W);
     121        return 0;
     122    }
     123
     124    hwndOS2 = hwnd ? wnd->getOS2WindowHandle() : 0;
     125    if(wnd) RELEASE_WNDOBJ(wnd);
     126    wnd = NULL;
    118127
    119128    EnterCriticalSection ();
     
    147156        pTimer->id      = id;
    148157        pTimer->proc    = proc;
    149         pTimer->PMhwnd  = hwnd ? wnd->getOS2WindowHandle() : NULLHANDLE;
     158        pTimer->PMhwnd  = hwnd ? hwndOS2 : NULLHANDLE;
    150159        pTimer->PMid    = WinStartTimer (GetThreadHAB(), pTimer->PMhwnd,
    151160                                         i + 1, timeout);
     
    199208VOID TIMER_KillTimerFromWindow(HWND hwnd)
    200209{
    201     Win32BaseWindow *wnd = Win32BaseWindow::GetWindowFromHandle(hwnd);
    202210    int i;
    203211    TIMER * pTimer;
    204212
    205     if (hwnd && !wnd) return;
     213    if (!IsWindow(hwnd)) return;
    206214
    207215    EnterCriticalSection();
Note: See TracChangeset for help on using the changeset viewer.