With this series it's now possible to run and pass `user32:monitor` and `user32:sysparams` tests with nulldrv, and so most `user32` tests (except for a few desktop cursor position tests). This still requires some prefix configuration to enable the nulldrv driver, or a change like https://gitlab.winehq.org/rbernon/wine/-/commit/753368ad0ec52f03f8d6e78ca79… to enable it when `DISPLAY` environment variable is unset.
This then shows that some of the user32 tests are failing with winex11 but passing with nulldrv, as in https://gitlab.winehq.org/rbernon/wine/-/commit/6d5f4109a514a0dc266899fcacf….
--
v5: win32u: Read mode from the registry if GetCurrentDisplaySettings fails.
win32u: Write display settings to the registry in apply_display_settings.
win32u: Lock display devices while applying display settings.
win32u: Force update display cache after NtUserChangeDisplaySettingsEx.
win32u: Introduce a new VirtualScreenRectChanged display driver callback.
win32u: Add a BOOL force parameter to update_display_cache.
https://gitlab.winehq.org/wine/wine/-/merge_requests/551
--
v3: ntdll: Combine the "if (alerted)" blocks in sock_transmit().
ntdll: Fill the IOSB in sock_transmit() only inside the "if (alerted)" block.
ntdll: Combine the "if (alerted)" blocks in sock_send().
ntdll: Fill the IOSB in sock_send() only inside the "if (alerted)" block.
ntdll: Combine the "if (alerted)" blocks in sock_recv().
ntdll: Fill the IOSB in sock_recv() only inside the "if (alerted)" block.
ntdll: The async handle passed to set_async_direct_result() cannot be NULL.
ws2_32/tests: Add more tests for iosb contents while a recv is pending.
https://gitlab.winehq.org/wine/wine/-/merge_requests/871
@julliard, did you intend merge this despite the failing conformance tests (see thread above from Marvin)?
I still think the fix is "correct", i.e. this *should* workand windows is just buggy too - but the conformance tests certainly showed my fix is not really justified (since this doesn't work on windows either) and our use that led me to make this change was just getting lucky in a weird way and needs to be changed.
I hadn't just closed it because I was going to eventually salvage the tests into a fix for the memleak they revealed. But I wasn't expecting you'd to accept it after Marvin shot me down...
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/897#note_9337
On Mon Sep 26 19:51:22 2022 +0000, **** wrote:
> Zebediah Figura replied on the mailing list:
> ```
> Hello Joel,
> I haven't looked at these patches in detail, largely because there's
> still outstanding test failures, but I do have one high-level comment,
> which is that I'd recommend starting with the basic implementation (i.e.
> just the first four patches), and leave the rest for separate merge
> requests. Since merge requests can only be applied as a whole I think it
> makes sense to narrow this down to a more minimal set, and try to get
> one thing done at a time.
> ```
Hi Zebediah - thanks for taking a look.
I don't mind narrowinging the commit series down.
This patch set is mainly trying to get these attribute flags working:
* `FILE_ATTRIBUTE_HIDDEN`
* `FILE_ATTRIBUTE_SYSTEM`
* `FILE_ATTRIBUTE_READONLY` (to a lesser extent - because this is already quite well represented by UNIX access permissions)
The trouble is that while we want to seamlessly integrate with the underlying filesystems, the availability of different methods varies between operating systems and filesystems. This version of the patch set offers three strategies, and I found a two more possible methods that should be added today ([1](https://man7.org/linux/man-pages/man2/ioctl_iflags.2.html) [2](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/… ).
The code attempts to store the flags by all available methods at once for a given file, and ORs the flags together from any available source, in the hopes we can deliver the most complete coverage to the user.
However, because there is no fallback method, it is currenly not possible to guaruantee that the attributes will always be stored and retrieved correctly in all scenaries.
If we only include the first four patches, the patch set will only support storage in Samba-formatted Extended File Attributes. If we unmark the associated test cases as `todo_wine`, the test will break on certain operating systems or certain mount flag choices. There is no support for Extended Attributes on FreeBSD or NetBSD, for example, and the MacOS Extended Atrribute APIs differ from the Linux ones.
One approach is to fall back to using a `.dosattributes` directory when no other storage method is available, and store the attributes in files inside there. However, I didn't want to implement this functionality before having a conversation with the Wine project developers.
I have been in conversation with @ehoover in the last couple of days concerning his work on Junction Points, which is a related topic to DOS attributes, and also causes issues for Msys2 in its own right. His strategy is to store the required metadata in a [`.REPARSE_POINT` hidden directory](https://github.com/wine-staging/wine-staging/blob/master/patches….
There is also the storage of [NT extended-attribute (EA)](https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/n…) values to consider, when we move toward a non-stub implementation of this feature.
Perhaps it would be preferable to produce a design that can be encompass all these issues.
Do we need to resolve this design question here and now? Or can we just proceed with Linux-only Extended Attributes in the short term?
I think it would be good if we could get some feedback from the project maintainers on these questions. Do you have any thoughts?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/924#note_9292
On Mon Sep 26 21:52:01 2022 +0000, Joel Holdsworth wrote:
> That sounds like an nice easy path forward.
> One practical question. How do I make the test case `todo_wine` in some
> cases, an not in others? Do I just have to comment out the test? Or is
> there a trick to indicate that inconsistency between plaforms is expected?
Like this:
```
todo_wine_if (my_todo_flag)
ok (returned_value == expected_value, "expected %x, got %x\n", expected_value, returned_value);
```
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/924#note_9331
On Mon Sep 26 21:41:12 2022 +0000, Erich Hoover wrote:
> @jhol I believe that @zfigura's suggestion to just merge the first four
> patches is in-line with what AJ has previously said. If I had to
> summarize his comments, I would say that they are to:
> 1. move the code out of ports and into file (already done)
> 2. submit the initial request for the support of one key platform
> (Linux, first four patches)
> 3. make sure the "key platform" support is extensible (already done)
> 4. submit additional requests for each additional platform, one at a time
> If you want to add a "fallback" behavior (which I think is reasonable),
> then I would suggest that that be treated as an "additional platform"
> after you have the initial support in place. Others might have a
> different opinion.
That sounds like an nice easy path forward.
One practical question. How do I make the test case `todo_wine` in some cases, an not in others? Do I just have to comment out the test? Or is there a trick to indicate that inconsistency between plaforms is expected?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/924#note_9330
On Mon Sep 26 20:25:30 2022 +0000, Joel Holdsworth wrote:
> Hi Zebediah - thanks for taking a look.
> I don't mind narrowinging the commit series down.
> This patch set is mainly trying to get these attribute flags working:
> * `FILE_ATTRIBUTE_HIDDEN`
> * `FILE_ATTRIBUTE_SYSTEM`
> * `FILE_ATTRIBUTE_READONLY` (to a lesser extent - because this is
> already quite well represented by UNIX access permissions)
> The trouble is that while we want to seamlessly integrate with the
> underlying filesystems, the availability of different methods varies
> between operating systems and filesystems. This version of the patch set
> offers three strategies, and I found a two more possible methods that
> should be added today
> ([1](https://man7.org/linux/man-pages/man2/ioctl_iflags.2.html)
> [2](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/…
> ).
> The code attempts to store the flags by all available methods at once
> for a given file, and ORs the flags together from any available source,
> in the hopes we can deliver the most complete coverage to the user.
> However, because there is no fallback method, it is currenly not
> possible to guaruantee that the attributes will always be stored and
> retrieved correctly in all scenaries.
> If we only include the first four patches, the patch set will only
> support storage in Samba-formatted Extended File Attributes. If we
> unmark the associated test cases as `todo_wine`, the test will break on
> certain operating systems or certain mount flag choices. There is no
> support for Extended Attributes on FreeBSD or NetBSD, for example, and
> the MacOS Extended Atrribute APIs differ from the Linux ones.
> One approach is to fall back to using a `.dosattributes` directory when
> no other storage method is available, and store the attributes in files
> inside there. However, I didn't want to implement this functionality
> before having a conversation with the Wine project developers.
> I have been in conversation with @ehoover in the last couple of days
> concerning his work on Junction Points, which is a related topic to DOS
> attributes, and also causes issues for Msys2 in its own right. His
> strategy is to store the required metadata in a [`.REPARSE_POINT` hidden directory](https://github.com/wine-staging/wine-staging/blob/master/patches….
> There is also the storage of [NT extended-attribute
> (EA)](https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/n…)
> values to consider, when we move toward a non-stub implementation of
> this feature.
> Perhaps it would be preferable to produce a design that can be encompass
> all these issues.
> Do we need to resolve this design question here and now? Or can we just
> proceed with Linux-only Extended Attributes in the short term?
> I think it would be good if we could get some feedback from the project
> maintainers on these questions. Do you have any thoughts?
@jhol I believe that @zfigura's suggestion to just merge the first four patches is in-line with what AJ has previously said. If I had to summarize his comments, I would say that they are to:
1. move the code out of ports and into file (already done)
2. submit the initial request for the support of one key platform (Linux, first four patches)
3. make sure the "key platform" support is extensible (already done)
4. submit additional requests for each additional platform, one at a time
If you want to add a "fallback" behavior (which I think is reasonable), then I would suggest that that be treated as an "additional platform" after you have the initial support in place. Others might have a different opinion.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/924#note_9327
This patch set is based upon [patches from Wine Staging](https://github.com/wine-staging/wine-staging/tree/master/patches/n…, and implements support for the `SYSTEM`, `HIDDEN` and `READONLY` DOS file attributes. These have been implemented in various ways depending upon the capabilities of the operating system and the file system.
# Storage Methods
## FAT MSDOS file attributes
* Linux: [`ioctl_fat(2)`](https://www.man7.org/linux/man-pages/man2/ioctl_fat.2.html)
On Linux, the FAT filesystem implementation allows DOS file attributes to be applied to files and
queried through a family of ioctls. Note that these ioctls are not yet supported by the NTFS or CIFS
drivers.
## Extended File Attributes
* Linux: [`xattr(7)`](https://www.man7.org/linux/man-pages/man7/xattr.7.html)
* MacOS: [`getxattr(2)`](https://www.unix.com/man-page/osx/2/getxattr/), [`setxattr(2)`](https://www.unix.com/man-page/osx/2/setxattr/), [`removexattr(2)`](https://www.unix.com/man-page/osx/2/removexattr/)
* FreeBSD, NetBSD: [`extattr(2)`](https://nixdoc.net/man-pages/FreeBSD/man2/extattr.2.html)
Modern filesystems generally support Extended File Attributes - auxiliary blobs of binary data that can be attached to a file. Samba uses the `user.DOSATTRIB` attribute to store DOS attribute information in the form of a hexadecimal value.
Note that although FreeBSD and NetBSD support the extended attribute system calls, these are not currently implemented in the operating system, or supported in any of their filesystem drivers.
## BSD File Flags
* MacOS: [`fchflags(2)`](https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/fchflags.2.html)
* FreeBSD, NetBSD: [`fchflags(2)`](https://nixdoc.net/man-pages/FreeBSD/man2/fchflags.2.html)
On some BSD-like operating systems including MacOS, FreeBSD and NetBSD, the `struct stat` structure contains the `st_flags` member can carry flags of which the following can be used to represent DOS attributes:
* `UF_IMMUTABLE` can represent `FILE_ATTRIBUTE_READONLY`
* `UF_HIDDEN` can reprent `FILE_ATTRIBUTE_HIDDEN` (not available on NetBSD)
# Design
The implementation is takes an opportunistic approach. It will attempt to store flags by any of the above mentioned methods, and will retrieve flags using any available method and will combine flags from multiple sources together.
# See Also
* https://bugs.winehq.org/show_bug.cgi?id=9158
* https://bugs.winehq.org/show_bug.cgi?id=15679
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/924
Many code sections still use fixed-size arrays on stack - or even worse - `strcat` in combination with strings of unknown length. This MR/PR provides general purpose Wine-internal functions for safer string handling. The functions are currently header-only to not pollute msvcrt exports.
The API was written for an upcoming shell32/shlexec patch (WIP) to properly fix
possible stack corruptions due to out-of-bounds writes for unexpected long paths or URLs.
This is a dynamic container inspired by C++ std::string / std::vector with
wide/narrow conversion and formatted text. Growth factor = 2 for simplicity.
Differences to `STRING`/`UNICODE_STRING` (`RtlCreateUnicodeString` and similar):
* No USHORT length limitation
* Actual dynamic resizable container
* String formatting and conversion support
* Short and consistent API naming
New test added to msvcrt: `winestring`
--
v2: Various improvements and fixes
https://gitlab.winehq.org/wine/wine/-/merge_requests/910
Change strategy for resetting local scope when unloading a module.
Old strategy was keeping the local scoped symbol alive on some code path when
unloading a module.
This caused some bad behavior as we kept a pointer to a deleted object.
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/931
With this series it's now possible to run and pass `user32:monitor` and `user32:sysparams` tests with nulldrv, and so most `user32` tests (except for a few desktop cursor position tests). This still requires some prefix configuration to enable the nulldrv driver, or a change like https://gitlab.winehq.org/rbernon/wine/-/commit/753368ad0ec52f03f8d6e78ca79… to enable it when `DISPLAY` environment variable is unset.
This then shows that some of the user32 tests are failing with winex11 but passing with nulldrv, as in https://gitlab.winehq.org/rbernon/wine/-/commit/6d5f4109a514a0dc266899fcacf….
--
v4: win32u: Read mode from the registry if GetCurrentDisplaySettings fails.
win32u: Write display settings to the registry in apply_display_settings.
win32u: Lock display devices while applying display settings.
win32u: Force update display cache after NtUserChangeDisplaySettingsEx.
win32u: Introduce a new VirtualScreenRectChanged display driver callback.
win32u: Add a BOOL force parameter to update_display_cache.
https://gitlab.winehq.org/wine/wine/-/merge_requests/551
This shows that media session samples are correctly oriented, but that mfmediaengine renders them upside down.
--
v2: mfmediaengine: Remove vertical flipping of video frames.
mfmediaengine/tests: Check IMFMediaEngine_TransferVideoFrames output orientation.
mfmediaengine/tests: Pass a device and output format to create_media_engine.
mf: Avoid clearing media session command list while it is running.
mf/tests: Check sample grabber RGB / NV12 orientation.
mf/tests: Factor test grabber callback implementations.
https://gitlab.winehq.org/wine/wine/-/merge_requests/874
Fix invisible disabled menu item text in Subtitle Workshop Classic 6.1.4. The application happens to
use 0xF0F0F0 as the menu background and the inactive caption color to draw disabled menu item text.
In Light theme, the inactive caption color is very close to 0xF0F0F0, thus causing the invisible
text. So use a darker color for inactive captions to avoid this issue. The inactive caption text
color is also adjusted accordingly.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53575
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/925
mrac tries to get function pointers for these functions using MmGetSystemRoutineAddress, I haven't seen them being used by it, but might as well implement it since they are very easy to implement.
--
v4: ntoskrnl.exe: Implement various KeQuery* functions
https://gitlab.winehq.org/wine/wine/-/merge_requests/914
This patch set is based upon [patches from Wine Staging](https://github.com/wine-staging/wine-staging/tree/master/patches/n…, and implements support for the `SYSTEM`, `HIDDEN` and `READONLY` DOS file attributes. These have been implemented in various ways depending upon the capabilities of the operating system and the file system.
# Storage Methods
## FAT MSDOS file attributes
* Linux: [`ioctl_fat(2)`](https://www.man7.org/linux/man-pages/man2/ioctl_fat.2.html)
On Linux, the FAT filesystem implementation allows DOS file attributes to be applied to files and
queried through a family of ioctls. Note that these ioctls are not yet supported by the NTFS or CIFS
drivers.
## Extended File Attributes
* Linux: [`xattr(7)`](https://www.man7.org/linux/man-pages/man7/xattr.7.html)
* MacOS: [`getxattr(2)`](https://www.unix.com/man-page/osx/2/getxattr/), [`setxattr(2)`](https://www.unix.com/man-page/osx/2/setxattr/), [`removexattr(2)`](https://www.unix.com/man-page/osx/2/removexattr/)
* FreeBSD, NetBSD: [`extattr(2)`](https://nixdoc.net/man-pages/FreeBSD/man2/extattr.2.html)
Modern filesystems generally support Extended File Attributes - auxiliary blobs of binary data that can be attached to a file. Samba uses the `user.DOSATTRIB` attribute to store DOS attribute information in the form of a hexadecimal value.
Note that although FreeBSD and NetBSD support the extended attribute system calls, these are not currently implemented in the operating system, or supported in any of their filesystem drivers.
## BSD File Flags
* MacOS: [`fchflags(2)`](https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/fchflags.2.html)
* FreeBSD, NetBSD: [`fchflags(2)`](https://nixdoc.net/man-pages/FreeBSD/man2/fchflags.2.html)
On some BSD-like operating systems including MacOS, FreeBSD and NetBSD, the `struct stat` structure contains the `st_flags` member can carry flags of which the following can be used to represent DOS attributes:
* `UF_IMMUTABLE` can represent `FILE_ATTRIBUTE_READONLY`
* `UF_HIDDEN` can reprent `FILE_ATTRIBUTE_HIDDEN` (not available on NetBSD)
# Design
The implementation is takes a permissive approach. It will attempt to store flags by any of the above mentioned methods, and will retrieve flags using any available method and will combine flags from multiple sources together.
# See Also
* https://bugs.winehq.org/show_bug.cgi?id=9158
* https://bugs.winehq.org/show_bug.cgi?id=15679
--
v4: ntdll: Added integration with MacOS/BSD st_flags
ntdll: Add integration with Linux FAT file attributes
ntdll: Add support for FreeBSD style extended attributes.
ntdll: Add support for MacOS X style extended attributes.
ntdll: Implement storing DOS attributes in NtCreateFile.
https://gitlab.winehq.org/wine/wine/-/merge_requests/916
Map known HRESULT values into their FACILITY_VBS counterparts
Unless the callee provided its own Description (e.g. via SetErrorInfo)
VBscript maps certain well-known HRESULT values into its own error facility
and messages, changing Err.Number and also setting Err.Source to itself
(unless already provided, in which case it is left alone)
e.g. if the invoked method returns E_NOINTERFACE,
The VBScript Err object should show
Err.Number: 0x1AE
Err.Source: Microsoft VBScript runtime error
Err.Description: Class doesn't support Automation
Rather than the original HRESULT
Err.Number: 0x80004002
--
v3: vbscript: do HRESULT->VBSERROR mapping for the whole EXCEPINFO at once.
vbscript/tests: test throwException with Description but *not* Source.
vbscript: only set EXCEPINFO strings for cases that map_hres translated.
vbscript: Fix handling missing description in EXCEPINFO.
https://gitlab.winehq.org/wine/wine/-/merge_requests/899
Many code sections still use fixed-size arrays on stack - or even worse - `strcat` in combination with strings of unknown length. This MR/PR provides general purpose Wine-internal functions for safer string handling. The functions are currently header-only to not pollute msvcrt exports.
The API was written for an upcoming shell32/shlexec patch (WIP) to properly fix
possible stack corruptions due to out-of-bounds writes for unexpected long paths or URLs.
This is a dynamic container inspired by C++ std::string / std::vector with
wide/narrow conversion and formatted text. Growth factor = 2 for simplicity.
Differences to `STRING`/`UNICODE_STRING` (`RtlCreateUnicodeString` and similar):
* No USHORT length limitation
* Actual dynamic resizable container
* String formatting and conversion support
* Short and consistent API naming
New test added to msvcrt: `winestring`
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/910
Fixes a regression introduced by commit
6aa437de6aa3549abd885c387ea79d18eb0eba56.
logical_proc_info_add_by_id() updates the mask for cores belonging to package for already added RelationProcessorPackage. But now it updates it only for logical_proc_info and not logical_proc_info_ex structure by returning early when the package is found.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/919
Some Wine tests are multi-threaded or start child processes which can
result in traces and failure messages being garbled which prevents them
from being recognized by continuous integration tools.
So printing the tests messages is now serialized. Note that if a process
crashes while holding the mutex, that mutex will be abandonned and not
cause a deadlock.
--
v9: tests: Make sure only one thread prints traces at a time.
https://gitlab.winehq.org/wine/wine/-/merge_requests/734
VariantCopyInd allows pvargDest == pvargSrc in order to dereference in place
To avoid confusing the source values and a partially-written destination,
wine's implementation makes a shallow copy and uses that as pSrc.
However, the call to VARIANT_CopyIRecordInfo did not use this,
leading to it copying from the zeroed-out memory it just allocated.
--
v2: oleaut32: dereference VT_RECORD|VT_BYREF in place.
oleaut32/tests: get_test_recordinfo shouldn't point into a specific VARIANT.
https://gitlab.winehq.org/wine/wine/-/merge_requests/897
This patch set is based upon [patches from Wine Staging](https://github.com/wine-staging/wine-staging/tree/master/patches/n…, and implements support for the `SYSTEM`, `HIDDEN` and `READONLY` DOS file attributes. These have been implemented in various ways depending upon the capabilities of the operating system and the file system.
# Storage Methods
## FAT MSDOS file attributes
* Linux: [`ioctl_fat(2)`](https://www.man7.org/linux/man-pages/man2/ioctl_fat.2.html)
On Linux, the FAT filesystem implementation allows DOS file attributes to be applied to files and
queried through a family of ioctls. Note that these ioctls are not yet supported by the NTFS or CIFS
drivers.
## Extended File Attributes
* Linux: [`xattr(7)`](https://www.man7.org/linux/man-pages/man7/xattr.7.html)
* MacOS: [`getxattr(2)`](https://www.unix.com/man-page/osx/2/getxattr/), [`setxattr(2)`](https://www.unix.com/man-page/osx/2/setxattr/), [`removexattr(2)`](https://www.unix.com/man-page/osx/2/removexattr/)
* FreeBSD, NetBSD: [`extattr(2)`](https://nixdoc.net/man-pages/FreeBSD/man2/extattr.2.html)
Modern filesystems generally support Extended File Attributes - auxiliary blobs of binary data that can be attached to a file. Samba uses the `user.DOSATTRIB` attribute to store DOS attribute information in the form of a hexadecimal value.
Note that although FreeBSD and NetBSD support the extended attribute system calls, these are not currently implemented in the operating system, or supported in any of their filesystem drivers.
## BSD File Flags
* MacOS: [`fchflags(2)`](https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/fchflags.2.html)
* FreeBSD, NetBSD: [`fchflags(2)`](https://nixdoc.net/man-pages/FreeBSD/man2/fchflags.2.html)
On some BSD-like operating systems including MacOS, FreeBSD and NetBSD, the `struct stat` structure contains the `st_flags` member can carry flags of which the following can be used to represent DOS attributes:
* `UF_IMMUTABLE` can represent `FILE_ATTRIBUTE_READONLY`
* `UF_HIDDEN` can reprent `FILE_ATTRIBUTE_HIDDEN` (not available on NetBSD)
# Design
The implementation is takes a permissive approach. It will attempt to store flags by any of the above mentioned methods, and will retrieve flags using any available method and will combine flags from multiple sources together.
# See Also
* https://bugs.winehq.org/show_bug.cgi?id=9158
* https://bugs.winehq.org/show_bug.cgi?id=15679
--
v3: ntdll: Added integration with MacOS/BSD st_flags
ntdll: Add integration with Linux FAT file attributes
ntdll: Add support for FreeBSD style extended attributes.
ntdll: Add support for MacOS X style extended attributes.
ntdll: Implement storing DOS attributes in NtCreateFile.
https://gitlab.winehq.org/wine/wine/-/merge_requests/916
This patch set is based upon patches from Wine Staging, and implements support for the `SYSTEM`, `HIDDEN` and `READONLY` DOS file attributes. These have been implemented in various ways depending upon the capabilities of the operating system and the file system.
# Storage Methods
## FAT MSDOS file attributes
* Linux: [`ioctl_fat(2)`](https://www.man7.org/linux/man-pages/man2/ioctl_fat.2.html)
On Linux, the FAT filesystem implementation allows DOS file attributes to be applied to files and
queried through a family of ioctls. Note that these ioctls are not yet supported by the NTFS or CIFS
drivers.
## Extended File Attributes
* Linux: [`xattr(7)`](https://www.man7.org/linux/man-pages/man7/xattr.7.html)
* MacOS: [`getxattr(2)`](https://www.unix.com/man-page/osx/2/getxattr/), [`setxattr(2)`](https://www.unix.com/man-page/osx/2/setxattr/), [`removexattr(2)`](https://www.unix.com/man-page/osx/2/removexattr/)
* FreeBSD, NetBSD: [`extattr(2)`](https://nixdoc.net/man-pages/FreeBSD/man2/extattr.2.html)
Modern filesystems generally support Extended File Attributes - auxiliary blobs of binary data that can be attached to a file. Samba uses the `user.DOSATTRIB` attribute to store DOS attribute information in the form of a hexadecimal value.
Note that although FreeBSD and NetBSD support the extended attribute system calls, these are not currently implemented in the operating system, or supported in any of their filesystem drivers.
## BSD File Flags
* MacOS: [`fchflags(2)`](https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/fchflags.2.html)
* FreeBSD, NetBSD: [`fchflags(2)`](https://nixdoc.net/man-pages/FreeBSD/man2/fchflags.2.html)
On some BSD-like operating systems including MacOS, FreeBSD and NetBSD, the `struct stat` structure contains the `st_flags` member can carry flags of which the following can be used to represent DOS attributes:
* `UF_IMMUTABLE` can represent `FILE_ATTRIBUTE_READONLY`
* `UF_HIDDEN` can reprent `FILE_ATTRIBUTE_HIDDEN` (not available on NetBSD)
# Design
The implementation is takes a permissive approach. It will attempt to store flags by any of the above mentioned methods, and will retrieve flags using any available method and will combine flags from multiple sources together.
# See Also
* https://bugs.winehq.org/show_bug.cgi?id=9158
* https://bugs.winehq.org/show_bug.cgi?id=15679
--
v2: ntdll: Added integration with MacOS/BSD st_flags
https://gitlab.winehq.org/wine/wine/-/merge_requests/916
Map known HRESULT values into their FACILITY_VBS counterparts
Unless the callee provided its own Description (e.g. via SetErrorInfo)
VBscript maps certain well-known HRESULT values into its own error facility
and messages, changing Err.Number and also setting Err.Source to itself
(unless already provided, in which case it is left alone)
e.g. if the invoked method returns E_NOINTERFACE,
The VBScript Err object should show
Err.Number: 0x1AE
Err.Source: Microsoft VBScript runtime error
Err.Description: Class doesn't support Automation
Rather than the original HRESULT
Err.Number: 0x80004002
--
v2: vbscript: Map known HRESULT values into their FACILITY_VBS counterparts.
https://gitlab.winehq.org/wine/wine/-/merge_requests/899
This patch set is based upon patches from Wine Staging, and implements support for the `SYSTEM`, `HIDDEN` and `READONLY` DOS file attributes. These have been implemented in various ways depending upon the capabilities of the operating system and the file system.
# Storage Methods
## FAT MSDOS file attributes
* Linux: [`ioctl_fat(2)`](https://www.man7.org/linux/man-pages/man2/ioctl_fat.2.html)
On Linux, the FAT filesystem implementation allows DOS file attributes to be applied to files and
queried through a family of ioctls. Note that these ioctls are not yet supported by the NTFS or CIFS
drivers.
## Extended File Attributes
* Linux: [`xattr(7)`](https://www.man7.org/linux/man-pages/man7/xattr.7.html)
* MacOS: [`getxattr(2)`](https://www.unix.com/man-page/osx/2/getxattr/), [`setxattr(2)`](https://www.unix.com/man-page/osx/2/setxattr/), [`removexattr(2)`](https://www.unix.com/man-page/osx/2/removexattr/)
* FreeBSD, NetBSD: [`extattr(2)`](https://nixdoc.net/man-pages/FreeBSD/man2/extattr.2.html)
Modern filesystems generally support Extended File Attributes - auxiliary blobs of binary data that can be attached to a file. Samba uses the `user.DOSATTRIB` attribute to store DOS attribute information in the form of a hexadecimal value.
Note that although FreeBSD and NetBSD support the extended attribute system calls, these are not currently implemented in the operating system, or supported in any of their filesystem drivers.
## BSD File Flags
* MacOS: [`fchflags(2)`](https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/fchflags.2.html)
* FreeBSD, NetBSD: [`fchflags(2)`](https://nixdoc.net/man-pages/FreeBSD/man2/fchflags.2.html)
On some BSD-like operating systems including MacOS, FreeBSD and NetBSD, the `struct stat` structure contains the `st_flags` member can carry flags of which the following can be used to represent DOS attributes:
* `UF_HIDDEN` can reprent `FILE_ATTRIBUTE_HIDDEN`
* `UF_IMMUTABLE` can represent `FILE_ATTRIBUTE_READONLY` (not available on NetBSD)
# Design
The implementation is takes a permissive approach. It will attempt to store flags by any of the above mentioned methods, and will retrieve flags using any available method and will combine flags from multiple sources together.
# See Also
* https://bugs.winehq.org/show_bug.cgi?id=9158
* https://bugs.winehq.org/show_bug.cgi?id=15679
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/916
Split from https://gitlab.winehq.org/wine/wine/-/merge_requests/551.
--
v3: win32u: Broadcast WM_DISPLAYCHANGE message on display settings change.
win32u: Lock display devices mutex in find_adapter.
win32u: Use find_adapter_device_by_(name|id) helpers in find_adapter.
win32u: Factor out display_device lookup in separate helpers.
winemac.drv: Stop using the cached_modes_mutex for get_default_bpp.
win32u: Move enumeration of available modes out of graphics drivers.
user32/tests: Cleanup sysparams WM_DISPLAYCHANGE tests.
https://gitlab.winehq.org/wine/wine/-/merge_requests/844
Split from https://gitlab.winehq.org/wine/wine/-/merge_requests/551.
--
v2: win32u: Broadcast WM_DISPLAYCHANGE message on display settings change.
win32u: Lock display devices mutex in find_adapter.
win32u: Use find_adapter_device_by_(name|id) helpers in find_adapter.
win32u: Factor out display_device lookup in separate helpers.
winemac.drv: Move and lock cache static variables within get_default_bpp.
win32u: Move enumeration of available modes out of graphics drivers.
user32/tests: Cleanup sysparams WM_DISPLAYCHANGE tests.
https://gitlab.winehq.org/wine/wine/-/merge_requests/844
Fix bugs in FileSystemObject text-file handling
OpenTextFile(...,ForWriting,True) should either create a new file,
or open and truncate an existing one
OpenTextFile(...,ForAppending,?,True) should write a BOM
if appending to an existing-but-empty file
--
v5: scrrun: Fix FileSystemObject.OpenTextFile when writing to existing files.
scrrun/tests: Introduce a test_file_contents helper.
https://gitlab.winehq.org/wine/wine/-/merge_requests/898
Fix bugs in FileSystemObject text-file handling
OpenTextFile(...,ForWriting,True) should either create a new file,
or open and truncate an existing one
OpenTextFile(...,ForAppending,?,True) should write a BOM
if appending to an existing-but-empty file
--
v3: scrrun: Fix bugs in FileSystemObject text-file handling
scrrun/tests: Introduce a test_file_contents helper
https://gitlab.winehq.org/wine/wine/-/merge_requests/898
--
v3: mshtml: Silence a FIXME when parameter is missing.
mshtml: Create non-gecko events properly from type string.
mshtml: Use actual event type to create the event instead of the event id.
mshtml: Expand event_info to include a special entry for EVENTID_LAST.
mshtml: Use actual Gecko event type for MessageEvent and StorageEvent.
mshtml: Implement url prop for StorageEvent.
include/mshtml: Move some forward interface declarations to match Windows SDK.
mshtml: Override document.URL's name when adding it from the mshtml typelib.
https://gitlab.winehq.org/wine/wine/-/merge_requests/856
mrac tries to get function pointers for these functions using MmGetSystemRoutineAddress, I haven't seen them being used by it, but might as well implement it since they are very easy to implement.
--
v2: ntoskrnl.exe: Implement various KeQuery* functions
https://gitlab.winehq.org/wine/wine/-/merge_requests/914
This can happen with asynchronous decoding, such as with the VA-API
decodebin plugin for H264.
This fixes the mf transform tests crashing when VA-API plugins are used.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/913
mrac tries to get function pointers for these functions using MmGetSystemRoutineAddress, I haven't seen them being used by it, but might as well implement it since they are very easy to implement.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/914
--
v5: mf/tests: Dump image samples with a BMP header and RGB data.
mf/tests: Rename transform frame dumps to BMP.
mf/tests: Check all produced output IMFSample at the same time.
mf/tests: Factor IMFSample attributes checks in check_mf_sample.
mf/tests: Factor IMFSample checks in a check_mf_sample helper.
mf/tests: Introduce a new dump_mf_sample helper.
mf/tests: Introduce a new load_resource helper.
mf/tests: Factor IMFTransform_ProcessOutput checks together.
mf/tests: Use separate variables for input / output samples.
https://gitlab.winehq.org/wine/wine/-/merge_requests/887
Fix bugs in FileSystemObject text-file handling
OpenTextFile(...,ForWriting,True) should either create a new file,
or open and truncate an existing one
OpenTextFile(...,ForAppending,?,True) should write a BOM
if appending to an existing-but-empty file
--
v2: scrrun: Fix bugs in FileSystemObject text-file handling
https://gitlab.winehq.org/wine/wine/-/merge_requests/898
This basic implementation is sufficient to fix .NET applications that use System.Security.Principal.WindowsIdentity.AuthenticationType.
--
v5: secur32: Implement basic functionality for LsaGetLogonSessionData.
https://gitlab.winehq.org/wine/wine/-/merge_requests/907
This basic implementation is sufficient to fix .NET applications that use System.Security.Principal.WindowsIdentity.AuthenticationType.
--
v4: secur32: Implement basic functionality for LsaGetLogonSessionData.
secur32/tests: Add tests for LsaGetLogonSessionData.
https://gitlab.winehq.org/wine/wine/-/merge_requests/907
This basic implementation is sufficient to fix .NET applications that use System.Security.Principal.WindowsIdentity.AuthenticationType.
--
v3: secur32: Implement basic functionality for LsaGetLogonSessionData.
secur32/tests: Add tests for LsaGetLogonSessionData.
https://gitlab.winehq.org/wine/wine/-/merge_requests/907