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