https://bugs.winehq.org/show_bug.cgi?id=52121
Bug ID: 52121 Summary: Smaller fixes to resource editing functions Product: Wine Version: 6.22 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: minor Priority: P2 Component: kernel32 Assignee: wine-bugs@winehq.org Reporter: info@daniel-marschall.de Distribution: ---
I have two more improvement suggestions the the resource editing functions:
(1) There are a few arguments of CreateFileA not correct. It might work on Wine, but if the code runs on older versions of Windows, it raises errors in some circumstances.
(1a) In function `create_mapping`:
// Fix by Daniel Marschall: Changed "0" to "FILE_SHARE_READ | (rw ? FILE_SHARE_WRITE : 0)" mi->file = CreateFileA(filename, GENERIC_READ | (rw ? GENERIC_WRITE : 0), FILE_SHARE_READ | (rw ? FILE_SHARE_WRITE : 0), NULL, OPEN_EXISTING, 0, 0);
(1b) In function `BeginUpdateResource`:
// Fix by Daniel Marschall: Changed "GENERIC_READ | GENERIC_WRITE, 0" to "GENERIC_READ, FILE_SHARE_READ" file = CreateFileA(pFileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0);
(2) Function `get_res_nameW` contains `RtlUpcaseUnicodeString(str,str)`. The same should be added to `get_res_nameA`.