I mostly commented the first patch for the tests...
we need I'm afraid more tests to discriminate whether the scan mask is bound to directory handle or to the directory itself
reading MSDN doc [1] suggests that it's likely the former; but I never trust MSDN doc, hence the need to more tests, esp with two handles opened to the same directory and test the mixing of calls
if it's the case, then it means that tweaking the fd cache is wrong (as you in your second patch), and we likely need another layer for storing the mask
[1] https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/nf-nti…
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6904#note_89400
eric pouech (@epo) commented about dlls/ntdll/tests/directory.c:
> + InitializeObjectAttributes(&attr, &ntdirname, OBJ_CASE_INSENSITIVE, 0, NULL);
> +
> + /* Open a handle for our test directory */
> + status = pNtOpenFile(&dirh, SYNCHRONIZE | FILE_LIST_DIRECTORY, &attr, &io, FILE_SHARE_READ,
> + FILE_SYNCHRONOUS_IO_NONALERT | FILE_OPEN_FOR_BACKUP_INTENT | FILE_DIRECTORY_FILE);
> + ok( status == STATUS_SUCCESS, "failed to open dir '%s', ret 0x%lx, error %ld\n", testdir, status, GetLastError() );
> + if (status != STATUS_SUCCESS)
> + {
> + skip("can't test if we can't open the directory\n");
> + goto done;
> + }
> +
> + /* Verify that updated windows 8 and higher behaviour is supported */
> + if (!winetest_platform_is_wine && !test_NtQueryDirectoryFile_mask(dirh, TRUE, atestfile, TRUE, TRUE))
> + run_updated_tests = FALSE;
> + if (!winetest_platform_is_wine && !test_NtQueryDirectoryFile_mask(dirh, TRUE, notatestfile, FALSE, TRUE))
question: do you need both calls to test_NtQueryDirectoryFile_mask to invalidate a platform?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6904#note_89399
On Sun Dec 1 21:39:49 2024 +0000, Robbert van der Helm wrote:
> Thanks for the detailed write up! I only ran into this commit after
> bisecting the changes between Wine 9.21 and 9.22, so I'm almost
> certainly missing some context!
> The problem I'm facing seems to be that as soon as `SWP_STATECHANGED` is
> set and `window_set_wm_state()` gets called, `data->wm_state_serial`
> gets stuck on a nonzero value since it's set to the X11 connection's
> next sequence number and is then never cleared again. That causes
> `window_update_client_config()` to always bail before it does anything,
> which in turn causes the `NtUserPostMessage( hwnd,
> WM_WINE_WINDOW_STATE_CHANGED, 0, 0 )` called from
> `X11DRV_ConfigureNotify()` to not do anything anymore.
> This doesn't seem to cause any problems under normal use cases, since
> normally once a window is mapped, its coordinates relative to the root
> window will never suddenly change (not sure if there's a spicy
> interaction with multiple monitors though). But in yabridge I have to
> reparent a Wine window to another window, and to make that work I've
> always had to send these `ConfigureNotify` events to inform Wine about
> the window's actual position on screen. Otherwise it thinks it's located
> in the top left corner of the screen, and all mouse events will be at an offset.
> I can open a regression bug report on bugs.winehq.org, but since what
> yabridge is doing is almost certainly not the ended way to interact with
> Wine, I thought I'd check here first.
`wm_state_serial` should be cleared when the window state actually changes and the `WM_STATE` PropertyNotify event is received, calling `window_wm_state_notify` which clears it.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6569#note_89396