--
v8: mshtml: Return proper string from functional constructors' toString in
mshtml: Define "create" from XMLHttpRequest constructor as a jscript prop
mshtml: Define the constructor's prototype on mshtml side.
mshtml: Consolidate the functional constructors into a common struct
mshtml: Rename struct constructor to stub_constructor.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7779
On Thu Apr 24 21:00:45 2025 +0000, Nikolay Sivov wrote:
> Yes, if you resume from same position it will be assumed that source
> produces sane time mark in the event. But there are a lot of assumptions
> already, and it's relatively fragile on Windows in other aspects once
> you start to go off default behavior.
> Regarding multiple sources, as I recall it works in general, e.g. you
> can have two completely separate video rendering branches (topoedit
> could be used for testing), and it works reliably. Which one is correct
> we can only test manually, if you return time+10 for one source and
> time+20 another source and see which one reaches the sink clock state
> method. What I haven't tried is using two separate source branches and
> checking if same clock instance is used for both sinks. If it's doing
> something mad and creates one clock per branch, next question would be
> what happens to the junction nodes, like transforms with multiple inputs
> where streams converging (there is an optional IMFClockConsumer thing
> where you can obviously use only one clock).
FYI - I just edited my comment above:
https://gitlab.winehq.org/wine/wine/-/merge_requests/7833#note_101671
as I had missed a step. It calls `IMFMediaSource::Stop` before flushing the MFT.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7833#note_101828
On Thu Apr 24 20:50:29 2025 +0000, Brendan McGrath wrote:
> I think Windows' approach has merit if we are requesting a new start
> time, but for resumption I don't think it does. They don't perform any
> of the flushing in this scenario. So if the source changes the position
> significantly, then all the sinks and MFTs will have stale data. I guess
> they just rely on the source not doing that on resumption.
> But the other issue is, as you say, there will now be multiple sources
> of truth. If we get different values from all the different streams,
> which one is correct?
Yes, if you resume from same position it will be assumed that source produces sane time mark in the event. But there are a lot of assumptions already, and it's relatively fragile on Windows in other aspects once you start to go off default behavior.
Regarding multiple sources, as I recall it works in general, e.g. you can have two completely separate video rendering branches (topoedit could be used for testing), and it works reliably. Which one is correct we can only test manually, if you return time+10 for one source and time+20 another source and see which one reaches the sink clock state method. What I haven't tried is using two separate source branches and checking if same clock instance is used for both sinks. If it's doing something mad and creates one clock per branch, next question would be what happens to the junction nodes, like transforms with multiple inputs where streams converging (there is an optional IMFClockConsumer thing where you can obviously use only one clock).
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7833#note_101827
On Thu Apr 24 11:02:43 2025 +0000, Nikolay Sivov wrote:
> > It was calling `OnClockStart`, but it turns out that was because I had
> hard-coded the value in my `MESourceStarted` and `MEStreamStarted`
> events. After changing these events to instead use `pvarStartPosition`
> passed in `IMFMediaSource::Start`, I get:
> >
> > ```
> > 1330.024952|10088|source_mock_Start: format:
> {00000000-0000-0000-0000-000000000000} (GUID_NULL) position: <EMPTY>
> > 1330.025598|10088|clock_sink_OnClockRestart: system time 13300255028
> > ```
> >
> > So sending those events with a hard-coded `VT_I8` value of zero caused
> `OnClockStart` to be called, but now those events have a value of
> `VT_EMPTY` and `OnClockRestart` is called.
> I see, this is something we do differently. We are using original
> session Start() timestamp when restarting the clock, and Windows
> apparently is using whatever source reports. I think there is a value in
> doing the same - the idea here I'm guessing is to adjust to the source
> time, which could deviate both ways from the time client asked for. What
> we'll need to figure out is which stamp we should actually be using for
> the new clock position. You can have multiple sources with multiple
> streams, so number of events with timestamps is potentially number of
> streams across all sources + number of sources.
I think Windows' approach has merit if we are requesting a new start time, but for resumption I don't think it does. They don't perform any of the flushing in this scenario. So if the source changes the position significantly, then all the sinks and MFTs will have stale data. I guess they just rely on the source not doing that on resumption.
But the other issue is, as you say, there will now be multiple sources of truth. If we get different values from all the different streams, which one is correct?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7833#note_101826
--
v7: mshtml: Define "create" from XMLHttpRequest constructor as a jscript prop
mshtml: Define the constructor's prototype on mshtml side.
mshtml: Consolidate the functional constructors into a common struct
mshtml: Rename struct constructor to stub_constructor.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7779
This fixes "out of realized font handles" errors seen with Valve games like Half-Life 2 (which uses more than 1000 font handles).
The new limit of 5000 is roughly inspired by the Windows limit, although there are differences. On Windows 11 I can call `CreateFont()` (and then `SetMapMode()`, `SelectObject()`, `SetTextAlign()` to realize the font) exactly 5000 times before it hits the handle limit.
Under Wine, child fonts use handles as well, so the limit is usually hit before 5000 `CreateFont()` calls. But, there is caching so that `CreateFont()` calls with identical arguments do not count towards the limit. Ultimately the old limit of 256 was sufficient for almost all applications, and 5000 should be enough for all but the worst-behaved apps.
--
v4: win32u: Raise realized font handle limit to 5000.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7771
Follow-up of !2786, which appears to have been abandoned.
--
v22: ws2_32/tests: Add test for AF_UNIX sockets
server: Fix getsockname() and accept() on AF_UNIX sockets.
server: Introduce error when attempting to create a SOCK_DGRAM AF_UNIX socket.
server: Allow for deletion of socket files.
ws2_32: Add support for AF_UNIX sockets.
ws2_32: Add afunix.h header.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7650
Since the role objects in the wayland_surface struct are part of a union, we
first need to check whether the surface has the right role before checking
the role objects themselves. Otherwise we risk using a subsurface as a toplevel
or vice-versa.
The second commit introduces a helper to deduplicate the toplevel checks.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7892
> It was calling `OnClockStart`, but it turns out that was because I had hard-coded the value in my `MESourceStarted` and `MEStreamStarted` events. After changing these events to instead use `pvarStartPosition` passed in `IMFMediaSource::Start`, I get:
>
> ```
> 1330.024952|10088|source_mock_Start: format: {00000000-0000-0000-0000-000000000000} (GUID_NULL) position: <EMPTY>
> 1330.025598|10088|clock_sink_OnClockRestart: system time 13300255028
> ```
>
> So sending those events with a hard-coded `VT_I8` value of zero caused `OnClockStart` to be called, but now those events have a value of `VT_EMPTY` and `OnClockRestart` is called.
I see, this is something we do differently. We are using original session Start() timestamp when restarting the clock, and Windows apparently is using whatever source reports. I think there is a value in doing the same - the idea here I'm guessing is to adjust to the source time, which could deviate both ways from the time client asked for. What we'll need to figure out is which stamp we should actually be using for the new clock position. You can have multiple sources with multiple streams, so number of events with timestamps is potentially number of streams across all sources + number of sources.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7833#note_101791
This fixes "out of realized font handles" errors seen with Valve games like Half-Life 2 (which uses more than 1000 font handles).
The new limit of 5000 is roughly inspired by the Windows limit, although there are differences. On Windows 11 I can call `CreateFont()` (and then `SetMapMode()`, `SelectObject()`, `SetTextAlign()` to realize the font) exactly 5000 times before it hits the handle limit.
Under Wine, child fonts use handles as well, so the limit is usually hit before 5000 `CreateFont()` calls. But, there is caching so that `CreateFont()` calls with identical arguments do not count towards the limit. Ultimately the old limit of 256 was sufficient for almost all applications, and 5000 should be enough for all but the worst-behaved apps.
--
v3: win32u: Make font handle table dynamically growable.
win32u: Track free font handles through indices instead of pointers.
win32u: Enter font_lock in NtGdiMakeFontDir.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7771
This MR adds tests that examine the values of the samples output by the byte stream handlers.
It is marked as draft as it is dependent on the fixes included within MR !7569.
I've also renamed the tests as they previously exclusively tested the sample output timestamps. The tests now also look at the number of buffers included in a sample and total size of the buffers within a sample.
--
v5: mfplat/tests: Add tests for MP3 Byte Stream Output.
mfplat/tests: Add tests for Byte Stream Output.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7672
On Wed Apr 23 23:51:29 2025 +0000, Brendan McGrath wrote:
> > Just so I understand, SAR clock jumps to pts + \<time it actually took
> to play this sample/time it would take according to sample rate\> or it
> jumps blindly to pts + mf sample duration, ignoring actual playback
> time? I don't know how well sample duration is validated against actual
> buffer sizes.
> It will jump to PTS and then progress from there at the playback rate. I
> don't think it uses the duration value, just buffer size to determine
> duration (which is easy to calculate based on frame size and sample rate).
I should add that the clock stops once playback of the provided sample(s) are complete. It won't start again until it receives another sample. But if that happens, it seems to add an implicit discontinuity.
And after a discontinuity (either implicit as described above, or explicit via a sample attribute) it doesn't just jump forward anymore. It will instead insert a period of silence, so the clock will progress at the playback rate until the next PTS, and at that point it'll start playing the next sample.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7833#note_101769
> Just so I understand, SAR clock jumps to pts + \<time it actually took to play this sample/time it would take according to sample rate\> or it jumps blindly to pts + mf sample duration, ignoring actual playback time? I don't know how well sample duration is validated against actual buffer sizes.
It will jump to PTS and then progress from there at the playback rate. I don't think it uses the duration value, just buffer size to determine duration (which is easy to calculate based on frame size and sample rate).
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7833#note_101767
> Is this an artifact of your tracing or OnClockRestart() is actually never used?
It was calling `OnClockStart`, but it turns out that was because I had hard-coded the value in my `MESourceStarted` and `MEStreamStarted` events. After changing these events to instead use `pvarStartPosition` passed in `IMFMediaSource::Start`, I get:
```
1330.024952|10088|source_mock_Start: format: {00000000-0000-0000-0000-000000000000} (GUID_NULL) position: <EMPTY>
1330.025598|10088|clock_sink_OnClockRestart: system time 13300255028
```
So sending those events with a hard-coded `VT_I8` value of zero caused `OnClockStart` to be called, but now those events have a value of `VT_EMPTY` and `OnClockRestart` is called.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7833#note_101766
--
v6: mshtml: Validate builtin host functions in IE9+ using prototype_id rather
mshtml: Store the object_id of the last object in the prototype chain that
mshtml: Define "create" from XMLHttpRequest constructor as a jscript prop
mshtml: Consolidate the functional constructors into a common struct
mshtml: Rename struct constructor to stub_constructor.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7779
This fixes "out of realized font handles" errors seen with Valve games like Half-Life 2 (which uses more than 1000 font handles).
The new limit of 5000 is roughly inspired by the Windows limit, although there are differences. On Windows 11 I can call `CreateFont()` (and then `SetMapMode()`, `SelectObject()`, `SetTextAlign()` to realize the font) exactly 5000 times before it hits the handle limit.
Under Wine, child fonts use handles as well, so the limit is usually hit before 5000 `CreateFont()` calls. But, there is caching so that `CreateFont()` calls with identical arguments do not count towards the limit. Ultimately the old limit of 256 was sufficient for almost all applications, and 5000 should be enough for all but the worst-behaved apps.
--
v2: win32u: Make font handle table dynamically growable.
win32u: Track free font handles through indices instead of pointers.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7771
Add `IOCTL_WINEBTH_RADIO_START_AUTH`, which gets used to implement `BluetoothAuthenticateDeviceEx`.
--
v3: bluetoothapis/tests: Add tests for BluetoothAuthenticateDeviceEx.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7885
Add `IOCTL_WINEBTH_RADIO_START_AUTH`, which gets used to implement `BluetoothAuthenticateDeviceEx`.
--
v2: bluetoothapis/tests: Add tests for BluetoothAuthenticateDeviceEx.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7885
WMSyncReader starts a background read thread that reads from the IStream
passed to IWMSyncReader::OpenStream. This means it could use the IStream in the
background even when no IWMSyncReader methods are being called.
For well-behaved applications, this is probably OK. However, AQUARIUM
(Steam 2515070) frees the IStream it passes to WMSyncReader _before_
it calls IWMSyncReader::Close, which stops the read thread. This causes
the read thread to access freed memory. This is improper, but not
unreasonable, as IWMSyncReader is supposed to be a synchronous
interface, so one might assume when they weren't calling into
IWMSyncReader methods, the IStream won't be used.
This commit adds a `wg_parser_dont_read` function, which can be used to
stop wg_parser from issuing read requests. This is used by IWMSyncReader
to make sure read requests are only issued when IWMSyncReader methods
are being called.
--
v6: DONT MERGE: winedebug in CI, only run qasf:asfreader
https://gitlab.winehq.org/wine/wine/-/merge_requests/7676
WMSyncReader starts a background read thread that reads from the IStream
passed to IWMSyncReader::OpenStream. This means it could use the IStream in the
background even when no IWMSyncReader methods are being called.
For well-behaved applications, this is probably OK. However, AQUARIUM
(Steam 2515070) frees the IStream it passes to WMSyncReader _before_
it calls IWMSyncReader::Close, which stops the read thread. This causes
the read thread to access freed memory. This is improper, but not
unreasonable, as IWMSyncReader is supposed to be a synchronous
interface, so one might assume when they weren't calling into
IWMSyncReader methods, the IStream won't be used.
This commit adds a `wg_parser_dont_read` function, which can be used to
stop wg_parser from issuing read requests. This is used by IWMSyncReader
to make sure read requests are only issued when IWMSyncReader methods
are being called.
--
v5: DONT MERGE: winedebug in CI
winegstreamer: Make sure WMSyncReader never reads in the background.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7676
WMSyncReader starts a background read thread that reads from the IStream
passed to IWMSyncReader::OpenStream. This means it could use the IStream in the
background even when no IWMSyncReader methods are being called.
For well-behaved applications, this is probably OK. However, AQUARIUM
(Steam 2515070) frees the IStream it passes to WMSyncReader _before_
it calls IWMSyncReader::Close, which stops the read thread. This causes
the read thread to access freed memory. This is improper, but not
unreasonable, as IWMSyncReader is supposed to be a synchronous
interface, so one might assume when they weren't calling into
IWMSyncReader methods, the IStream won't be used.
This commit adds a `wg_parser_dont_read` function, which can be used to
stop wg_parser from issuing read requests. This is used by IWMSyncReader
to make sure read requests are only issued when IWMSyncReader methods
are being called.
--
v4: winegstreamer: Make sure WMSyncReader never reads in the background.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7676
These patches make a test case attached to the bug https://bugs.winehq.org/show_bug.cgi?id=33190 work.
--
v3: win32u: NtGdiExtTextOutW() should translate x,y from logical to device units at the last step.
win32u: Fix device<->world width/height converters.
gdi32/tests: Add some tests for rotated font metrics.
win32u: Use slightly more readable names for DP/LP converters.
win32u: Use correct helper for converting width to device units.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5068
This fixes a test failure/crash on Windows 8.1 introduced by dd1d82728811c15716eefa0917eb3ecac4b9a85a.
--
v4: mfplat/tests: Don't assume video processor MFT can provide samples.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7838
This is serie #11 about PDB rewrite.
It finishes the migration of the types management to
the new PDB reader (also disabling remaining type
handling in old PDB reader when using new PDB reader).
It starts the handling in new PDB reader of functions
and symbols:
- it implements line information support in new PDB
reader for inlined functions,
- it uses (for all debug info backend) the opaque
symref_t to refer to symbol's container
(so that we can let backend decide how to store it).
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7883
If ClipCursor is called while the seat doesn't have a pointer and the
call qualifies for locking the pointer, it would have tried to lock a
null wl_pointer.
For example, I'm launching a fullscreen application (which causes ClipCursor calls on startup) in a headless compositor before I launch my virtual keyboard/pointer client. While the pointer is deinitialized and there cannot be a focused hwnd, the cursor wl_surface will not be set, making it qualify for pointer locking.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7857
Over the past several weeks I've been working on and off on this. I didn't track the hours but I'm sure that I've spent 80+ hours on the feature. I've tested and retested all known scenarios and it seems to be working as expected.
--
v14: cmd: Implement tab completion for command line entry.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7843
Demonstrate a refcount leak on the class factory when a class with
ThreadingModel=Apartment is instantiated in the MTA. CoGetClassObject
ends up using apartment_hostobject to launch an STA thread in which to
host the object, but the process of marshaling this class factory back
into the MTA leaks a reference on it.
This leak is usually minor (class factory implementations are usually
singletons, so it's a one-of rather than a cumulative leak), but it will
generally lock that COM server and e.g. prevent CoFreeUnusedLibraries
from being able to clean up properly.
When CoMarshalInterface succeeds, it added an *additional* refcount
represented by the marshaling data written to the stream. The original
refcount returned from apartment_getclassobject needs to be released
regardless of marshaling success or failure.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7880
This is a regression from 405eb2a386df0135174c5d04a24cb3b1adc1c710.
Now with two kinds of handlers we need to check for nulls in both loops.
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7874
Over the past several weeks I've been working on and off on this. I didn't track the hours but I'm sure that I've spent 80+ hours on the feature. I've tested and retested all known scenarios and it seems to be working as expected.
--
v12: cmd: Implement tab completion for command line entry.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7843
This implements setting `ThreadPriorityBoost`, `ProcessPriorityBoost`, `ProcessBasePriority` and getting `ThreadPriorityBoost`, `ProcessPriorityBoost` NT info classes and adds tests where appropriate.
The actual boosting mechanism will be in part 2 to keep the size of this MR manageable.
--
v2: kernel32/tests: Add tests for GetProcessPriorityBoost/SetProcessPriorityBoost.
kernelbase: Implement SetProcessPriorityBoost.
kernelbase: Implement GetProcessPriorityBoost.
ntdll: Implement ProcessPriorityBoost class in NtSetInformationProcess.
ntdll: Implement ProcessPriorityBoost class in NtQueryInformationProcess.
ntdll: Implement ThreadPriorityBoost class in NtSetInformationThread.
ntdll: Properly implement ThreadPriorityBoost class in NtQueryInformationThread.
ntdll/tests: Add tests for setting process base priority.
ntdll: Implement ProcessBasePriority class in NtSetInformationProcess.
server: Use process base priority in set_thread_base_priority.
server: Store process base priority separately.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7869
--
v13: server: Handle hardlinks and casefolding when renaming the same file.
server: Handle renames to destinations containing trailing slashes.
kernel32/tests: Test renaming a file into a hardlink of itself.
kernel32/tests: Use FindClose instead of CloseHandle when closing
https://gitlab.winehq.org/wine/wine/-/merge_requests/6855