Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timer created with hwnd = NULL do not fire #1195

Closed
chentiangemalc opened this issue Sep 1, 2022 · 0 comments
Closed

Timer created with hwnd = NULL do not fire #1195

chentiangemalc opened this issue Sep 1, 2022 · 0 comments

Comments

@chentiangemalc
Copy link

  1. When using SetTimer(NULL,NULL,,NULL) the WM_TIMER events are not being sent to the Window. I can see OTVDM passing the API Correctly onto the win32 API SetTimer, but using Spy++ to monitor windows messages cannot see any WM_TIMER messages with wParam matching the ID returned by SetTimer being sent to the Window.
    If HWND is specified the timer message is received in WndProc handler (As expected)

Expected behavior
This example code should work., as it does in Windows XP and Windows 10 with NTVDM and the line MessageBox(hwnd,"Hit Timer","Timer!!",MB_OK); should be hit.

UINT myTimer = SetTimer(NULL,NULL,10000,NULL);
               
 printf("Timer created with ID = 0x%08X\n",myTimer);              
BOOL fRetVal = TRUE;

 for(;;)
 {

    while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
    {              
       if (msg.message == WM_TIMER && msg.wParam == myTimer )
       {   
       		MessageBox(hwnd,"Hit Timer","Timer!!",MB_OK);   
       }
       
       if (msg.message == WM_QUIT)
          return TRUE;

       TranslateMessage(&msg);
       DispatchMessage(&msg);
    }

Screenshots

Under OTVDM on Windows 10 x86
image
On the same machine but using NTVDM:
image

Environment (please complete the following information):

  • Tested on Windows 11 (21H2 build 22000.739) x64 and Windows 10 (10.0.19044.1889) x86
[MsgTst.zip](https://github.com/otya128/winevdm/files/9465884/MsgTst.zip)

Traces and test program
[trace.zip](https://github.com/otya128/winevdm/files/9465879/trace.zip)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants