[PATCH 0/1] MR10860: atl: Take AtlAxWin window name from CREATESTRUCT.
In AtlAxWin_wndproc, the handler for WM_CREATE duplicates the existing hWnd's window text and passes that on as the window name for AtlAxCreateControlEx. At the time of WM_CREATE, the window text is always empty. It should instead be taken from the lpszName member of the CREATESTRUCTW struct pointed to by lParam. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10860
From: Steven Don <gitlab@shdon.com> In AtlAxWin_wndproc, the handler for WM_CREATE duplicates the existing hWnd's window text and passes that on as the window name for AtlAxCreateControlEx. At the time of WM_CREATE, the window text is always empty. It should instead be taken from the lpszName member of the CREATESTRUCTW struct pointed to by lParam. --- dlls/atl/atl_ax.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/dlls/atl/atl_ax.c b/dlls/atl/atl_ax.c index 4ff0a796d3b..33936a0d982 100644 --- a/dlls/atl/atl_ax.c +++ b/dlls/atl/atl_ax.c @@ -62,13 +62,10 @@ static LRESULT CALLBACK AtlAxWin_wndproc( HWND hWnd, UINT wMsg, WPARAM wParam, L { if ( wMsg == WM_CREATE ) { - DWORD len = GetWindowTextLengthW( hWnd ) + 1; - WCHAR *ptr = malloc( len*sizeof(WCHAR) ); - if (!ptr) + LPCREATESTRUCTW pcs = (LPCREATESTRUCTW)lParam; + if (!pcs) return 1; - GetWindowTextW( hWnd, ptr, len ); - AtlAxCreateControlEx( ptr, hWnd, NULL, NULL, NULL, NULL, NULL ); - free( ptr ); + AtlAxCreateControlEx( pcs->lpszName, hWnd, NULL, NULL, NULL, NULL, NULL ); return 0; } return DefWindowProcW( hWnd, wMsg, wParam, lParam ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10860
Is this testable? Could you explain why this change is necessary? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10860#note_139397
I am currently trying to figure out why certain ATL stuff isn't working properly, and comparing the same programme running on Windows and Wine. While I've not yet been able to figure out the actual bug keeping the components from responding correctly, this difference in behaviour stood out immediately, and it could conceivably be a problem if a programme uses the `FindWindow` call to look for the AtlAxWin window by name (and that is what I did in my minimal testcase). With this minor change (which also matches the normal `WM_CREATE` idiom in Win32), Wine matches the behaviour I've observed on Windows 10. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10860#note_139455
This merge request was closed by Steven Don. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10860
Actually, never mind. I can no longer reproduce this. Must have been a mistake in my test programme. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10860#note_139506
participants (3)
-
Nikolay Sivov (@nsivov) -
Steven Don -
Steven Don (@shdon)