Signed-off-by: Craig Schulstad <craigaschulstad(a)gmail.com>
---
dlls/kernelbase/loader.c | 169 +++++++++++++++++++++++++++++++++++++--
1 file changed, 164 insertions(+), 5 deletions(-)
diff --git a/dlls/kernelbase/loader.c b/dlls/kernelbase/loader.c
index fc9b0ce0083..0fbe9bcd9e8 100644
--- a/dlls/kernelbase/loader.c
+++ b/dlls/kernelbase/loader.c
@@ -48,6 +48,9 @@ struct exclusive_datafile
};
static struct list exclusive_datafile_list = LIST_INIT( exclusive_datafile_list );
+…
[View More]static WCHAR mui_locale[LOCALE_NAME_MAX_LENGTH];
+static BOOL locale_found = 0;
+static BOOL recursion_flag = 0;
/***********************************************************************
* Modules
@@ -1011,11 +1014,122 @@ BOOL WINAPI DECLSPEC_HOTPATCH EnumResourceTypesExW( HMODULE module, ENUMRESTYPEP
return ret;
}
+/***********************************************************************/
+/* get_mui - Acquire an MUI module for the associated resource */
+/***********************************************************************/
+
+HMODULE get_mui(HMODULE module)
+
+{
+
+ HMODULE mui_module = NULL;
+
+ WCHAR module_name[MAX_PATH], mui_name[MAX_PATH];
+
+ INT i, j, k, l;
+
+ /* Initialize the work strings */
+
+ for (i = 0; i < MAX_PATH; i++) {
+ module_name[i] = 0;
+ mui_name[i] = 0;
+ }
+
+ /* Note - the reference to the Windows file name for an "MUI" file has a structure such as */
+ /* "C:\Program Files\Application Directory\xx-XX\Application.exe.mui"; however, in testing */
+ /* out the usage of the "GetModuleFileNameW" function, it was determined that it works with */
+ /* a relative Linux file structure such as "xx-XX/Application.exe.mui". */
+
+ /* Acquire the base resource file name */
+
+ if (!(GetModuleFileNameW(module, module_name, MAX_PATH))) return module;
+
+ /* Stay with the original module reference if this file is not an executable file. */
+
+ if (!(wcsstr(module_name, L".exe"))) return module;
+
+ /* Acquire the locale name using LCIDToLocaleName. Since this function utilizes the FindResourceExW function, this */
+ /* sets up a recursive call to this function. In order to avoid a stack overflow condition that would be caused by */
+ /* repeated calls, a flag will be set on to return back to the FindResourceExW function without again calling the */
+ /* locale acquisition function. */
+
+ if (!(locale_found)) {
+
+ if (recursion_flag) return module;
+
+ recursion_flag = 1;
+
+ LCIDToLocaleName( GetUserDefaultLCID(), mui_locale, LOCALE_NAME_MAX_LENGTH, 0 );
+
+ recursion_flag = 0;
+
+ locale_found = 1;
+
+ }
+
+ /* Locate the position of the final backslash in the retrieved executable file. */
+
+ j = 0;
+
+ for (i = 0; i < MAX_PATH; i++) {
+
+ if (module_name[i] == 0) break;
+
+ if (module_name[i] == '\\') j = i;
+ }
+
+ /* Set up the work index that will be used to extract just the executable file from the fully qualified file name. */
+
+ k = 0;
+
+ for (i = 0; i < MAX_PATH; i++) {
+
+ if (module_name[i] == 0) break;
+
+ /* If work index "j" has been set to -1, then the file portion of the qualified name has been reached and will */
+ /* be copied to the "MUI" file reference. */
+
+ if (j < 0) {
+ mui_name[k] = module_name[i];
+ k++;
+ }
+
+ /* When the position of the final backslash has been reached, add the locale name as the folder/directory */
+ /* containing the "MUI" file and reset work index "j" to -1. */
+
+ if (i >= j && j > 0) {
+ for (l = 0; l < 5; l++) {
+ mui_name[k] = mui_locale[l];
+ k++;
+ }
+ mui_name[k] = '/';
+ k++;
+ j = -1;
+ }
+ }
+
+ /* Finally, append the literal ".mui" onto the file reference. */
+
+ wcscat(mui_name, L".mui");
+
+ /* Now, see if there is an associated "MUI" file and if so use its handle for the module handle. */
+
+ mui_module = LoadLibraryExW(mui_name, 0, 0);
+
+ if (mui_module) {
+ return mui_module;
+ } else {
+ return module;
+ }
+
+}
+
+/***********************************************************************/
+/* get_res_handle - Isolated call of the LdrFindResource function */
+/***********************************************************************/
+
+HRSRC get_res_handle(HMODULE module, LPCWSTR type, LPCWSTR name, WORD lang)
-/**********************************************************************
- * FindResourceExW (kernelbase.@)
- */
-HRSRC WINAPI DECLSPEC_HOTPATCH FindResourceExW( HMODULE module, LPCWSTR type, LPCWSTR name, WORD lang )
{
NTSTATUS status;
UNICODE_STRING nameW, typeW;
@@ -1024,7 +1138,6 @@ HRSRC WINAPI DECLSPEC_HOTPATCH FindResourceExW( HMODULE module, LPCWSTR type, LP
TRACE( "%p %s %s %04x\n", module, debugstr_w(type), debugstr_w(name), lang );
- if (!module) module = GetModuleHandleW( 0 );
nameW.Buffer = typeW.Buffer = NULL;
__TRY
@@ -1046,7 +1159,41 @@ HRSRC WINAPI DECLSPEC_HOTPATCH FindResourceExW( HMODULE module, LPCWSTR type, LP
if (!IS_INTRESOURCE(nameW.Buffer)) HeapFree( GetProcessHeap(), 0, nameW.Buffer );
if (!IS_INTRESOURCE(typeW.Buffer)) HeapFree( GetProcessHeap(), 0, typeW.Buffer );
+
return (HRSRC)entry;
+
+}
+
+/**********************************************************************
+ * FindResourceExW (kernelbase.@)
+ */
+HRSRC WINAPI DECLSPEC_HOTPATCH FindResourceExW( HMODULE module, LPCWSTR type, LPCWSTR name, WORD lang )
+{
+
+ HRSRC rsrc;
+
+ TRACE( "%p %s %s %04x\n", module, debugstr_w(type), debugstr_w(name), lang );
+
+ if (!module) module = GetModuleHandleW( 0 );
+
+ rsrc = get_res_handle(module, type, name, lang);
+
+ if (rsrc) {
+
+ return rsrc;
+
+ } else {
+
+ /* If a resource retrieval failed using the initial module value, attempt to */
+ /* locate an associated MUI file and retry the resource retrieval. */
+
+ module = get_mui(module);
+
+ rsrc = get_res_handle(module, type, name, lang);
+
+ return rsrc;
+
+ }
}
@@ -1074,11 +1221,23 @@ BOOL WINAPI DECLSPEC_HOTPATCH FreeResource( HGLOBAL handle )
HGLOBAL WINAPI DECLSPEC_HOTPATCH LoadResource( HINSTANCE module, HRSRC rsrc )
{
void *ret;
+ HMODULE mui_module = NULL;
TRACE( "%p %p\n", module, rsrc );
if (!rsrc) return 0;
if (!module) module = GetModuleHandleW( 0 );
+
+
+ /* Only check for an MUI reference if the resource handle value is less than the module value, */
+ /* or if an MUI reference was found and the MUI reference and handle value are larger than the */
+ /* module value for the executable file. That is a signal that the resource handle is to be */
+ /* associated with the MUI file instead of the executable file. */
+
+ mui_module = get_mui(module);
+
+ if (((HMODULE)rsrc < module) || ((mui_module > module) && ((HMODULE)rsrc > mui_module))) module = mui_module;
+
if (!set_ntstatus( LdrAccessResource( module, (IMAGE_RESOURCE_DATA_ENTRY *)rsrc, &ret, NULL )))
return 0;
return ret;
--
2.17.1
[View Less]
Binary packages for various distributions will be available from:
https://www.winehq.org/download
Summary since last release
* Rebased to current wine 6.1 (780 patches are applied to wine vanilla)
Upstreamed (Either directly from staging or fixed with a similar patch).
* dsound: IDirectSoundBuffer8 GetStatus return DSBSTATUS_LOCSOFTWARE for
deferred buffers
* winegstreamer: Correct mistaken enum value in ProcessMessage.
* include: Add windows.media.speechsynthesis.idl draft.
* widl: Support …
[View More]WinRT marshaling_behavior attribute parsing.
* kernel32: Implement SetProcessDEPPolicy().
* kernel32: Implement GetSystemDEPPolicy().
* kernel32: Make system DEP policy affect GetProcessDEPPolicy().
Added:
* [42695] Path of Exile fails - CoCreateInstance() called in
uninitialized apartment.
* [50546] xactengine3_7: Send Notification after the Wavebank is created.
Updated:
* mfplat-streaming-support
* ntdll-NtAlertThreadByThreadId
* msxml3-FreeThreadedXMLHTTP60
* dsound-EAX
* widl-winrt-support
Where can you help
* Run Steam/Battle.net/GOG/UPlay/Epic
* Test your favorite game.
* Test your favorite applications.
* Improve staging patches and get them accepted upstream.
As always, if you find a bug, please report it via
https://bugs.winehq.org
Best Regards
Alistair.
[View Less]
Signed-off-by: Floris Renaud <jkfloris(a)dds.nl>
---
po/nl.po | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
diff --git a/po/nl.po b/po/nl.po
index c4012a6cb0b..27ef0b5aaba 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -5,7 +5,7 @@ msgstr ""
"Project-Id-Version: Wine\n"
"Report-Msgid-Bugs-To: https://bugs.winehq.org\n"
"POT-Creation-Date: N/A\n"
-"PO-Revision-Date: 2021-01-26 12:00+0100\n"
+"PO-Revision-Date: 2021-01-30 22:00+0100\n"
"Last-Translator: …
[View More]Floris Renaud <jkfloris(a)dds.nl>\n"
"Language-Team: Dutch\n"
"Language: nl\n"
@@ -37,7 +37,7 @@ msgid ""
msgstr ""
"De volgende software kan automatisch verwijderd worden. Om een programma te "
"verwijderen of de geïnstalleerde onderdelen te wijzigen, selecteer het in de "
-"lijst en druk op Wijzigen/Verwijderen."
+"lijst en druk op Wijzigen of Verwijderen."
#: dlls/appwiz.cpl/appwiz.rc:67
msgid "&Support Information"
@@ -7018,7 +7018,7 @@ msgstr "De sink is niet voltooid.\n"
#: dlls/mferror/mferror.mc:732
msgid "Clock was stopped\n"
-msgstr "Klok is gestopt.\n"
+msgstr "Klok is gestopt\n"
#: dlls/mferror/mferror.mc:32
msgid "Media Foundation platform is not initialized.\n"
@@ -7844,7 +7844,7 @@ msgstr "Dienst: [1]"
#: dlls/msi/msi.rc:167 dlls/msi/msi.rc:170 dlls/msi/msi.rc:174
msgid "File: [1], Directory: [9], Size: [6]"
-msgstr "Bestand: [1], Map: [9], Grootte: [6]"
+msgstr "Bestand: [1], Map: [9], Grootte: [6]"
#: dlls/msi/msi.rc:168
msgid "Found application: [1]"
@@ -7860,7 +7860,7 @@ msgstr "Dienst: [2]"
#: dlls/msi/msi.rc:172
msgid "File: [1], Dependencies: [2]"
-msgstr "Bestand: [1], Afhankelijkheden: [2]"
+msgstr "Bestand: [1], Afhankelijkheden: [2]"
#: dlls/msi/msi.rc:173
msgid "Application: [1]"
@@ -7872,7 +7872,7 @@ msgstr "Toepassingscontext:[1], Assemblynaam:[2]"
#: dlls/msi/msi.rc:177
msgid "File: [1], Directory: [2], Size: [3]"
-msgstr "Bestand: [1], Map: [2], Grootte: [3]"
+msgstr "Bestand: [1], Map: [2], Grootte: [3]"
#: dlls/msi/msi.rc:178 dlls/msi/msi.rc:199
msgid "Component ID: [1], Qualifier: [2]"
@@ -7924,7 +7924,7 @@ msgstr "Programma: [1], Opdrachtregel: [2]"
#: dlls/msi/msi.rc:192 dlls/msi/msi.rc:209
msgid "File: [1], Section: [2], Key: [3], Value: [4]"
-msgstr "Bestand: [1], Selectie: [2], Sleutel: [3], Waarde; [4]"
+msgstr "Bestand: [1], Selectie: [2], Sleutel: [3], Waarde; [4]"
#: dlls/msi/msi.rc:193
msgid "Key: [1], Name: [2]"
@@ -9336,7 +9336,7 @@ msgstr "Ja op &alles"
#: dlls/shell32/shell32.rc:319
msgid "About %s"
-msgstr "Info %s"
+msgstr "Over %s"
#: dlls/shell32/shell32.rc:323
msgid "Wine &license"
@@ -9794,6 +9794,7 @@ msgstr ""
"binnen de voorwaarden van de GNU Lesser General Public License zoals "
"gepubliceerd door de Free Software Foundation; versie 2.1 van de licentie, "
"of (naar keuze) een latere versie.\n"
+"\n"
"Wine is gemaakt in de hoop dat het nuttig is, maar komt met GEEN ENKELE "
"GARANTIE; zelfs zonder de impliciete garantie van VERKOOPBAARHEID of "
"GESCHIKTHEID VOOR EEN BEPAALD DOEL. Lees de GNU Lesser General Public "
@@ -12307,8 +12308,7 @@ msgid ""
"It is mainly useful in batch files to allow the user to read the output of\n"
"a previous command before it scrolls off the screen.\n"
msgstr ""
-"PAUSE toont een bericht op het scherm waarin de gebruiker word gevraagd een\n"
-"toets in te drukken.\n"
+"PAUSE toont een bericht waarin wordt gevraagd een toets in te drukken.\n"
"\n"
"Dit is vooral handig in batchbestanden om de gebruiker in staat te stellen\n"
"om de uitvoer van een voorafgaande opdracht te bekijken, voordat het van\n"
@@ -15040,7 +15040,8 @@ msgid ""
msgstr ""
"Wine DLL Registratie Hulpprogramma\n"
"\n"
-"Biedt DLL-registratiediensten\n"
+"Biedt DLL-registratiediensten.\n"
+"\n"
#: programs/regsvr32/regsvr32.rc:40
msgid ""
@@ -16778,7 +16779,7 @@ msgstr "&Naam wijzigen..."
#: programs/winefile/winefile.rc:34
msgid "Propert&ies\tAlt+Enter"
-msgstr "&Eigenschappent\tAlt+Enter"
+msgstr "&Eigenschappen\tAlt+Enter"
#: programs/winefile/winefile.rc:38
msgid "Cr&eate Directory..."
--
2.30.0
[View Less]