Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
February 2021
- 81 participants
- 1707 messages
[PATCH 5/5] include: Add more DISPID constants to wmpids.h.
by Rémi Bernon
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
include/wmpids.h | 51 ++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 49 insertions(+), 2 deletions(-)
diff --git a/include/wmpids.h b/include/wmpids.h
index a8500409ac4..2ae1d5c8bdd 100644
--- a/include/wmpids.h
+++ b/include/wmpids.h
@@ -19,6 +19,53 @@
#define DISPID_WMPCOREEVENT_STATUSCHANGE 5002
#define DISPID_WMPCOREEVENT_PLAYSTATECHANGE 5101
+#define DISPID_WMPCOREEVENT_AUDIOLANGUAGECHANGE 5102
-#define DISPID_WMPCOREEVENT_MEDIACHANGE 5802
-#define DISPID_WMPCOREEVENT_CURRENTITEMCHANGE 5806
+#define DISPID_WMPCOREEVENT_ENDOFSTREAM 5201
+#define DISPID_WMPCOREEVENT_POSITIONCHANGE 5202
+#define DISPID_WMPCOREEVENT_MARKERHIT 5203
+#define DISPID_WMPCOREEVENT_DURATIONUNITCHANGE 5204
+
+#define DISPID_WMPCOREEVENT_SCRIPTCOMMAND 5301
+
+#define DISPID_WMPCOREEVENT_DISCONNECT 5401
+#define DISPID_WMPCOREEVENT_BUFFERING 5402
+#define DISPID_WMPCOREEVENT_NEWSTREAM 5403
+
+#define DISPID_WMPCOREEVENT_ERROR 5501
+
+#define DISPID_WMPCOREEVENT_WARNING 5601
+
+#define DISPID_WMPCOREEVENT_CDROMMEDIACHANGE 5701
+
+#define DISPID_WMPCOREEVENT_PLAYLISTCHANGE 5801
+#define DISPID_WMPCOREEVENT_MEDIACHANGE 5802
+#define DISPID_WMPCOREEVENT_CURRENTMEDIAITEMAVAILABLE 5803
+#define DISPID_WMPCOREEVENT_CURRENTPLAYLISTCHANGE 5804
+#define DISPID_WMPCOREEVENT_CURRENTPLAYLISTITEMAVAILABLE 5805
+#define DISPID_WMPCOREEVENT_CURRENTITEMCHANGE 5806
+#define DISPID_WMPCOREEVENT_MEDIACOLLECTIONCHANGE 5807
+#define DISPID_WMPCOREEVENT_MEDIACOLLECTIONATTRIBUTESTRINGADDED 5808
+#define DISPID_WMPCOREEVENT_MEDIACOLLECTIONATTRIBUTESTRINGREMOVED 5809
+#define DISPID_WMPCOREEVENT_PLAYLISTCOLLECTIONCHANGE 5810
+#define DISPID_WMPCOREEVENT_PLAYLISTCOLLECTIONPLAYLISTADDED 5811
+#define DISPID_WMPCOREEVENT_PLAYLISTCOLLECTIONPLAYLISTREMOVED 5812
+#define DISPID_WMPCOREEVENT_PLAYLISTCOLLECTIONPLAYLISTSETASDELETED 5818
+#define DISPID_WMPCOREEVENT_MODECHANGE 5819
+#define DISPID_WMPCOREEVENT_MEDIACOLLECTIONATTRIBUTESTRINGCHANGED 5820
+#define DISPID_WMPCOREEVENT_MEDIAERROR 5821
+#define DISPID_WMPCOREEVENT_DOMAINCHANGE 5822
+#define DISPID_WMPCOREEVENT_OPENPLAYLISTSWITCH 5823
+
+#define DISPID_WMPOCXEVENT_SWITCHEDTOPLAYERAPPLICATION 6501
+#define DISPID_WMPOCXEVENT_SWITCHEDTOCONTROL 6502
+#define DISPID_WMPOCXEVENT_PLAYERDOCKEDSTATECHANGE 6503
+#define DISPID_WMPOCXEVENT_PLAYERRECONNECT 6504
+#define DISPID_WMPOCXEVENT_CLICK 6505
+#define DISPID_WMPOCXEVENT_DOUBLECLICK 6506
+#define DISPID_WMPOCXEVENT_KEYDOWN 6507
+#define DISPID_WMPOCXEVENT_KEYPRESS 6508
+#define DISPID_WMPOCXEVENT_KEYUP 6509
+#define DISPID_WMPOCXEVENT_MOUSEDOWN 6510
+#define DISPID_WMPOCXEVENT_MOUSEMOVE 6511
+#define DISPID_WMPOCXEVENT_MOUSEUP 6512
--
2.30.0
Feb. 1, 2021
[PATCH 4/5] include: Add WMPGC_FLAGS_SUPPRESS_DIALOGS constant to wmpservices.idl.
by Rémi Bernon
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
include/wmpservices.idl | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/wmpservices.idl b/include/wmpservices.idl
index 86f2fc1da72..3c3ac47333a 100644
--- a/include/wmpservices.idl
+++ b/include/wmpservices.idl
@@ -19,6 +19,8 @@
import "oaidl.idl";
import "ocidl.idl";
+cpp_quote("#define WMPGC_FLAGS_SUPPRESS_DIALOGS 0x00000002")
+
[
odl,
uuid(bfb377e5-c594-4369-a970-de896d5ece74),
--
2.30.0
Feb. 1, 2021
[PATCH 3/5] include: Add IWMPGraphCreation interface to wmpservice.idl.
by Rémi Bernon
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
include/Makefile.in | 1 +
include/wmpservices.idl | 32 ++++++++++++++++++++++++++++++++
2 files changed, 33 insertions(+)
create mode 100644 include/wmpservices.idl
diff --git a/include/Makefile.in b/include/Makefile.in
index b03c2e8c602..5de2a0e3a4f 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -798,6 +798,7 @@ SOURCES = \
wmp.idl \
wmpids.h \
wmprealestate.idl \
+ wmpservices.idl \
wmsbuffer.idl \
wmsdk.h \
wmsdkidl.idl \
diff --git a/include/wmpservices.idl b/include/wmpservices.idl
new file mode 100644
index 00000000000..86f2fc1da72
--- /dev/null
+++ b/include/wmpservices.idl
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2021 Rémi Bernon for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+import "oaidl.idl";
+import "ocidl.idl";
+
+[
+ odl,
+ uuid(bfb377e5-c594-4369-a970-de896d5ece74),
+ oleautomation
+]
+interface IWMPGraphCreation : IUnknown
+{
+ HRESULT GraphCreationPreRender([in] IUnknown *filter_graph, [in] IUnknown *reserved);
+ HRESULT GraphCreationPostRender([in] IUnknown *filter_graph);
+ HRESULT GetGraphCreationFlags([out, retval] DWORD *flags);
+}
--
2.30.0
Feb. 1, 2021
[PATCH 2/5] include: Add IWMPRenderConfig interface to wmprealestate.idl.
by Rémi Bernon
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
include/wmprealestate.idl | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/include/wmprealestate.idl b/include/wmprealestate.idl
index cb9d6b417fb..5a4cb84716b 100644
--- a/include/wmprealestate.idl
+++ b/include/wmprealestate.idl
@@ -29,3 +29,15 @@ interface IWMPVideoRenderConfig : IUnknown
{
[propput] HRESULT presenterActivate([in] IMFActivate *activate);
}
+
+[
+ odl,
+ uuid(959506c1-0314-4ec5-9e61-8528db5e5478),
+ oleautomation
+]
+interface IWMPRenderConfig : IUnknown
+{
+ [propput] HRESULT inProcOnly([in] BOOL fInProc);
+
+ [propget] HRESULT inProcOnly([out, retval] BOOL *pfInProc);
+}
--
2.30.0
Feb. 1, 2021
[PATCH 1/5] include: Add IWMPVideoRenderConfig interface to wmprealestate.idl.
by Rémi Bernon
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
include/Makefile.in | 1 +
include/wmprealestate.idl | 31 +++++++++++++++++++++++++++++++
2 files changed, 32 insertions(+)
create mode 100644 include/wmprealestate.idl
diff --git a/include/Makefile.in b/include/Makefile.in
index fc5ffbbc721..b03c2e8c602 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -797,6 +797,7 @@ SOURCES = \
wmiutils.idl \
wmp.idl \
wmpids.h \
+ wmprealestate.idl \
wmsbuffer.idl \
wmsdk.h \
wmsdkidl.idl \
diff --git a/include/wmprealestate.idl b/include/wmprealestate.idl
new file mode 100644
index 00000000000..cb9d6b417fb
--- /dev/null
+++ b/include/wmprealestate.idl
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2021 Rémi Bernon for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+import "oaidl.idl";
+import "ocidl.idl";
+import "mfidl.idl";
+
+[
+ odl,
+ uuid(6d6cf803-1ec0-4c8d-b3ca-f18e27282074),
+ oleautomation
+]
+interface IWMPVideoRenderConfig : IUnknown
+{
+ [propput] HRESULT presenterActivate([in] IMFActivate *activate);
+}
--
2.30.0
Feb. 1, 2021
Re: [PATCH 16/23] kernel32: Add support for PPC64
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=84802
Your paranoid android.
=== w10pro64 (32 bit report) ===
kernel32:
loader.c:722: Test failed: 1193: wrong status c0000131/c000011b
loader.c:722: Test failed: 1193: wrong status c0000131/c000011b
loader.c:722: Test failed: 1193: wrong status c0000131/c0000130
loader.c:722: Test failed: 1193: wrong status c0000131/c000011b
loader.c:722: Test failed: 1193: wrong status c0000131/c000011b
loader.c:722: Test failed: 1193: wrong status c0000131/c000011b
loader.c:722: Test failed: 1193: wrong status c0000131/c000011b
loader.c:722: Test failed: 1193: wrong status c0000131/c000011b
loader.c:722: Test failed: 1193: wrong status c0000131/c000011b
loader.c:722: Test failed: 1193: wrong status c0000131/c000011b
loader.c:722: Test failed: 1193: wrong status c0000131/c000011b
loader.c:722: Test failed: 1193: wrong status c0000131/c000011b
loader.c:722: Test failed: 1193: wrong status c0000131/c000011b
loader.c:722: Test failed: 1210: wrong status c0000131/c0000130
loader.c:722: Test failed: 1215: wrong status c0000131/c0000130
loader.c:722: Test failed: 1220: wrong status c0000131/c000007b
loader.c:722: Test failed: 1225: wrong status c0000131/c000007b
loader.c:722: Test failed: 1230: wrong status c0000131/c000007b
loader.c:722: Test failed: 1235: wrong status c0000131/c000007b
loader.c:722: Test failed: 1240: wrong status c0000131/c000007b
loader.c:722: Test failed: 1256: wrong status c0000131/0
loader.c:722: Test failed: 1260: wrong status c0000131/0
loader.c:722: Test failed: 1265: wrong status c0000131/0
loader.c:722: Test failed: 1269: wrong status c0000131/0
loader.c:722: Test failed: 1273: wrong status c0000131/0
loader.c:722: Test failed: 1312: wrong status c0000131/c000007b
loader.c:722: Test failed: 1321: wrong status c0000131/c000007b
=== w10pro64 (64 bit report) ===
kernel32:
loader.c:722: Test failed: 1193: wrong status c000011b/c0000130
loader.c:722: Test failed: 1210: wrong status c000011b/c0000130
loader.c:722: Test failed: 1215: wrong status c000011b/c0000130
loader.c:722: Test failed: 1220: wrong status c000011b/c000007b
loader.c:722: Test failed: 1225: wrong status c000011b/c000007b
loader.c:722: Test failed: 1230: wrong status c000011b/c000007b
loader.c:722: Test failed: 1235: wrong status c000011b/c000007b
loader.c:722: Test failed: 1240: wrong status c000011b/c000007b
loader.c:722: Test failed: 1256: wrong status c000011b/0
loader.c:722: Test failed: 1260: wrong status c000011b/0
loader.c:722: Test failed: 1265: wrong status c000011b/0
loader.c:722: Test failed: 1269: wrong status c000011b/0
loader.c:722: Test failed: 1273: wrong status c000011b/0
Feb. 1, 2021
Re: [PATCH] kernelbase: Add rudimentary mui resource support to loader.c
by Zebediah Figura (she/her)
Hello Craig, thanks for the patch, and sorry for the lack of review thus
far.
I have a few high-level comments:
(1) It seems to me it should be possible to write some tests for this
behaviour, both to prove the implementation is correct and to prevent
further regressions. I think the easiest way to do this would be to add
a simple empty test DLL (for an example, see fce26e60cc2 and references
to "coinst"), to which you can add resources using UpdateResource().
When writing tests, I would recommend to keep in mind my other comments
below.
(2) Should this really happen in LoadResource()? Should it instead
happen in FindResource(), or even in LdrFindResource_U()?
(3) If yes, how does this interact with the LCID parameter to
FindResource()?
On 1/18/21 11:12 AM, Craig Schulstad wrote:
> 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 );
>
> +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 */
This comment, like some others below, feel redundant; the next line
tells me as much.
> +
> + 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;
This is also a good thing to test. It seems at least a little surprising
that this would be true.
> +
> + /* 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;
> +
> + }
This is not thread safe (it doesn't guarantee ordering); you would need
atomics.
I'm wondering if a better solution to this might be to use an internal
API in LCIDToLocaleName() [or RtlLcidToLocaleName()], and skip the MUI
logic in that case.
> +
> + /* 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;
> + }
> + }
Note that you can use (some) CRT string functions within kernelbase [and
ntdll], which may help avoid some of this logic. It's rather difficult
to read as-is.
> +
> + /* 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);
Here and below, "module" is effectively leaked. I guess this is
necessarily true, but is that module really never unloaded?
> +
> + 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;
> +
This is very confusing. Why would the value of "rsrc" matter?
> if (!set_ntstatus( LdrAccessResource( module, (IMAGE_RESOURCE_DATA_ENTRY *)rsrc, &ret, NULL )))
> return 0;
> return ret;
>
Feb. 1, 2021