For React Native. These help detect errors for React Native applications.
-- v3: combase: Add an error message when class is not found. combase: Add RoReportUnhandledError() stub. combase: Add RoGetErrorReportingFlags() stub. combase: Add RoFailFastWithErrorContextInternal2() stub. include: Add errhandlingapi.h.
From: Zhiyi Zhang zzhang@codeweavers.com
--- include/errhandlingapi.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 include/errhandlingapi.h
diff --git a/include/errhandlingapi.h b/include/errhandlingapi.h new file mode 100644 index 00000000000..1353da5d0df --- /dev/null +++ b/include/errhandlingapi.h @@ -0,0 +1,32 @@ +/* + * Copyright 2025 Zhiyi Zhang 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 + */ + +#ifndef _ERRHANDLING_H_ +#define _ERRHANDLING_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +WINBASEAPI VOID WINAPI RaiseFailFastException(EXCEPTION_RECORD *record, CONTEXT *context, DWORD flags); + +#ifdef __cplusplus +} +#endif + +#endif /* _ERRHANDLING_H_ */
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/combase/combase.spec | 2 +- dlls/combase/roapi.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/dlls/combase/combase.spec b/dlls/combase/combase.spec index 80d0ee167e9..fb5d673db47 100644 --- a/dlls/combase/combase.spec +++ b/dlls/combase/combase.spec @@ -59,7 +59,7 @@ @ stub NdrProxyForwardingFunction31 @ stub NdrProxyForwardingFunction32 @ stub NdrOleInitializeExtension -@ stub RoFailFastWithErrorContextInternal2 +@ stdcall RoFailFastWithErrorContextInternal2(long long ptr) @ stub RoFailFastWithErrorContextInternal @ stub UpdateProcessTracing @ stdcall CLIPFORMAT_UserFree(ptr ptr) diff --git a/dlls/combase/roapi.c b/dlls/combase/roapi.c index 0a7129c6c58..4e52612d08e 100644 --- a/dlls/combase/roapi.c +++ b/dlls/combase/roapi.c @@ -23,6 +23,7 @@ #include "roparameterizediid.h" #include "roerrorapi.h" #include "winstring.h" +#include "errhandlingapi.h"
#include "combase_private.h"
@@ -415,6 +416,15 @@ HRESULT WINAPI RoGetAgileReference(enum AgileReferenceOptions option, REFIID rii return S_OK; }
+/*********************************************************************** + * RoFailFastWithErrorContextInternal2 (combase.@) + */ +void WINAPI RoFailFastWithErrorContextInternal2(HRESULT error, ULONG exception_count, /* PSTOWED_EXCEPTION_INFORMATION_V2 */void *information) +{ + FIXME("%#lx, %lu, %p stub.\n", error, exception_count, information); + RaiseFailFastException(NULL, NULL, 0); +} + /*********************************************************************** * RoGetApartmentIdentifier (combase.@) */
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/combase/combase.spec | 2 +- dlls/combase/roapi.c | 15 +++++++++++++++ dlls/combase/tests/roapi.c | 15 +++++++++++++++ include/roerrorapi.h | 1 + 4 files changed, 32 insertions(+), 1 deletion(-)
diff --git a/dlls/combase/combase.spec b/dlls/combase/combase.spec index fb5d673db47..73c3e7ec8ef 100644 --- a/dlls/combase/combase.spec +++ b/dlls/combase/combase.spec @@ -294,7 +294,7 @@ @ stdcall RoGetActivationFactory(ptr ptr ptr) @ stdcall RoGetAgileReference(long ptr ptr ptr) @ stdcall RoGetApartmentIdentifier(ptr) -@ stub RoGetErrorReportingFlags +@ stdcall RoGetErrorReportingFlags(ptr) @ stub RoGetMatchingRestrictedErrorInfo @ stdcall RoGetParameterizedTypeInstanceIID(long ptr ptr ptr ptr) @ stdcall RoGetServerActivatableClasses(ptr ptr ptr) diff --git a/dlls/combase/roapi.c b/dlls/combase/roapi.c index 4e52612d08e..f40eb55cd2f 100644 --- a/dlls/combase/roapi.c +++ b/dlls/combase/roapi.c @@ -535,6 +535,21 @@ HRESULT WINAPI RoSetErrorReportingFlags(UINT32 flags) return S_OK; }
+/*********************************************************************** + * RoGetErrorReportingFlags (combase.@) + */ +HRESULT WINAPI RoGetErrorReportingFlags(UINT32 *flags) +{ + FIXME("(%p): stub\n", flags); + + if (!flags) + return E_POINTER; + + *flags = RO_ERROR_REPORTING_USESETERRORINFO; + return S_OK; +} + + /*********************************************************************** * CleanupTlsOleState (combase.@) */ diff --git a/dlls/combase/tests/roapi.c b/dlls/combase/tests/roapi.c index 7606c61c165..ab5dbff6017 100644 --- a/dlls/combase/tests/roapi.c +++ b/dlls/combase/tests/roapi.c @@ -25,6 +25,7 @@
#include "initguid.h" #include "roapi.h" +#include "roerrorapi.h"
#include "wine/test.h"
@@ -537,6 +538,19 @@ static void test_RoGetAgileReference(void) } }
+static void test_RoGetErrorReportingFlags(void) +{ + UINT32 flags; + HRESULT hr; + + hr = RoGetErrorReportingFlags(NULL); + ok(hr == E_POINTER, "Got unexpected hr %#lx.\n", hr); + + hr = RoGetErrorReportingFlags(&flags); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(flags == RO_ERROR_REPORTING_USESETERRORINFO, "Got unexpected flag %#x.\n", flags); +} + START_TEST(roapi) { BOOL ret; @@ -546,6 +560,7 @@ START_TEST(roapi) test_implicit_mta(); test_ActivationFactories(); test_RoGetAgileReference(); + test_RoGetErrorReportingFlags();
SetLastError(0xdeadbeef); ret = DeleteFileW(L"wine.combase.test.dll"); diff --git a/include/roerrorapi.h b/include/roerrorapi.h index 4831e3afe40..ec02448e496 100644 --- a/include/roerrorapi.h +++ b/include/roerrorapi.h @@ -33,6 +33,7 @@ typedef enum } RO_ERROR_REPORTING_FLAGS;
HRESULT WINAPI GetRestrictedErrorInfo(IRestrictedErrorInfo **info); +HRESULT WINAPI RoGetErrorReportingFlags(UINT32 *flags); BOOL WINAPI RoOriginateError(HRESULT error, HSTRING message); BOOL WINAPI RoOriginateErrorW(HRESULT error, UINT max_len, const WCHAR *message); BOOL WINAPI RoOriginateLanguageException(HRESULT error, HSTRING message, IUnknown *language_exception);
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/combase/combase.spec | 2 +- dlls/combase/roapi.c | 9 +++++++++ include/roerrorapi.h | 1 + 3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/dlls/combase/combase.spec b/dlls/combase/combase.spec index 73c3e7ec8ef..7e2d34447a3 100644 --- a/dlls/combase/combase.spec +++ b/dlls/combase/combase.spec @@ -309,7 +309,7 @@ @ stdcall RoRegisterForApartmentShutdown(ptr ptr ptr) @ stub RoReportCapabilityCheckFailure @ stub RoReportFailedDelegate -@ stub RoReportUnhandledError +@ stdcall RoReportUnhandledError(ptr) @ stub RoResolveRestrictedErrorInfoReference @ stub RoRevokeActivationFactories @ stdcall RoSetErrorReportingFlags(long) diff --git a/dlls/combase/roapi.c b/dlls/combase/roapi.c index f40eb55cd2f..d8c3705e9e2 100644 --- a/dlls/combase/roapi.c +++ b/dlls/combase/roapi.c @@ -526,6 +526,15 @@ BOOL WINAPI RoOriginateErrorW(HRESULT error, UINT max_len, const WCHAR *message) return FALSE; }
+/*********************************************************************** + * RoReportUnhandledError (combase.@) + */ +HRESULT WINAPI RoReportUnhandledError(IRestrictedErrorInfo *info) +{ + FIXME("(%p): stub\n", info); + return S_OK; +} + /*********************************************************************** * RoSetErrorReportingFlags (combase.@) */ diff --git a/include/roerrorapi.h b/include/roerrorapi.h index ec02448e496..8f3200c559d 100644 --- a/include/roerrorapi.h +++ b/include/roerrorapi.h @@ -37,6 +37,7 @@ HRESULT WINAPI RoGetErrorReportingFlags(UINT32 *flags); BOOL WINAPI RoOriginateError(HRESULT error, HSTRING message); BOOL WINAPI RoOriginateErrorW(HRESULT error, UINT max_len, const WCHAR *message); BOOL WINAPI RoOriginateLanguageException(HRESULT error, HSTRING message, IUnknown *language_exception); +HRESULT WINAPI RoReportUnhandledError(IRestrictedErrorInfo *info); HRESULT WINAPI RoSetErrorReportingFlags(UINT32 flags); HRESULT WINAPI SetRestrictedErrorInfo(IRestrictedErrorInfo *info);
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/combase/roapi.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/dlls/combase/roapi.c b/dlls/combase/roapi.c index d8c3705e9e2..df3a3c5c176 100644 --- a/dlls/combase/roapi.c +++ b/dlls/combase/roapi.c @@ -194,6 +194,10 @@ HRESULT WINAPI DECLSPEC_HOTPATCH RoGetActivationFactory(HSTRING classid, REFIID } IActivationFactory_Release(factory); } + else + { + ERR("Class %s not found in %s, hr %#lx.\n", wine_dbgstr_hstring(classid), debugstr_w(library), hr); + }
done: free(library);
v3: Use `RaiseFailFastException` in `RoFailFastWithErrorContextInternal2`
This merge request was approved by Jinoh Kang.
Missing `errhandlingapi.h` in `include/Makefile.in`?
On Tue Jun 10 18:00:10 2025 +0000, Zebra2711 wrote:
Missing `errhandlingapi.h` in `include/Makefile.in`?
Makefile.in SOURCES generation is done automatically by `make_makefiles`. Auto-generated changes should not be a part of a patch proposed for upstream.[^1] [^2]
[^1]: [Wineserver § Help to create a server request](https://wiki.winehq.org/Wineserver#Help_to_create_a_server_request), WineHQ wiki: "As with all generated files, the files generated by make_requests shouldn't be included in your patch. [^2]: [Re: [PATCH] server: Allow skipping debug handle retrieval in get_process_debug_info.](https://www.winehq.org/mailman3/hyperkitty/list/wine-devel@winehq.org/messag...), wine-devel Mailing List Archives: "Also, we do not include automatically generated changes (make_requests) in the patches, they are generated during upstream commit."
On Tue Jun 10 18:24:16 2025 +0000, Jinoh Kang wrote:
Makefile.in SOURCES generation is done automatically by `make_makefiles`. Auto-generated changes should not be a part of a patch proposed for upstream.[^1] [^2] [^1]: [Wineserver § Help to create a server request](https://wiki.winehq.org/Wineserver#Help_to_create_a_server_request), WineHQ wiki: "As with all generated files, the files generated by make_requests shouldn't be included in your patch. [^2]: [Re: [PATCH] server: Allow skipping debug handle retrieval in get_process_debug_info.](https://www.winehq.org/mailman3/hyperkitty/list/wine-devel@winehq.org/messag...), wine-devel Mailing List Archives: "Also, we do not include automatically generated changes (make_requests) in the patches, they are generated during upstream commit."
Where did this advice come from exactly? I've never heard Alexandre request that people not include generated files, only that it's not necessary, and I've seen plenty of patches accepted with generated changes. As far as I can tell "it's not necessary" got somehow warped into "you shouldn't" and then spread as common knowledge.