From: Piotr Caban piotr@codeweavers.com
--- dlls/vccorlib140/Makefile.in | 1 + dlls/vccorlib140/except.c | 105 +++++++++++++++++++++++++++++++++++ dlls/vccorlib140/vccorlib.c | 82 --------------------------- 3 files changed, 106 insertions(+), 82 deletions(-) create mode 100644 dlls/vccorlib140/except.c
diff --git a/dlls/vccorlib140/Makefile.in b/dlls/vccorlib140/Makefile.in index 13d54aa369e..988d761efda 100644 --- a/dlls/vccorlib140/Makefile.in +++ b/dlls/vccorlib140/Makefile.in @@ -2,4 +2,5 @@ MODULE = vccorlib140.dll IMPORTS = combase
SOURCES = \ + except.c \ vccorlib.c diff --git a/dlls/vccorlib140/except.c b/dlls/vccorlib140/except.c new file mode 100644 index 00000000000..3a65cbebbf7 --- /dev/null +++ b/dlls/vccorlib140/except.c @@ -0,0 +1,105 @@ +/* + * Copyright 2025 Vibhav Pant + * + * 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 + */ + +#include "roapi.h" +#include "winstring.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(vccorlib); + +void *__cdecl CreateExceptionWithMessage(HRESULT hr, HSTRING msg) +{ + FIXME("(%#lx, %s): stub!\n", hr, debugstr_hstring(msg)); + return NULL; +} + +void *__cdecl CreateException(HRESULT hr) +{ + FIXME("(%#lx): stub!\n", hr); + return NULL; +} + +void WINAPI __abi_WinRTraiseCOMException(HRESULT hr) +{ + FIXME("(%#lx): stub!\n", hr); +} + +#define WINRT_EXCEPTIONS \ + WINRT_EXCEPTION(AccessDenied, E_ACCESSDENIED) \ + WINRT_EXCEPTION(ChangedState, E_CHANGED_STATE) \ + WINRT_EXCEPTION(ClassNotRegistered, REGDB_E_CLASSNOTREG) \ + WINRT_EXCEPTION(Disconnected, RPC_E_DISCONNECTED) \ + WINRT_EXCEPTION(Failure, E_FAIL) \ + WINRT_EXCEPTION(InvalidArgument, E_INVALIDARG) \ + WINRT_EXCEPTION(InvalidCast, E_NOINTERFACE) \ + WINRT_EXCEPTION(NotImplemented, E_NOTIMPL) \ + WINRT_EXCEPTION(NullReference, E_POINTER) \ + WINRT_EXCEPTION(ObjectDisposed, RO_E_CLOSED) \ + WINRT_EXCEPTION(OperationCanceled, E_ABORT) \ + WINRT_EXCEPTION(OutOfBounds, E_BOUNDS) \ + WINRT_EXCEPTION(OutOfMemory, E_OUTOFMEMORY) \ + WINRT_EXCEPTION(WrongThread, RPC_E_WRONG_THREAD) + +#define WINRT_EXCEPTION(name, hr) \ + void WINAPI __abi_WinRTraise##name##Exception(void) \ + { \ + FIXME("(): stub!\n"); \ + } \ + void *__cdecl platform_##name##Exception_ctor(void *this) \ + { \ + FIXME("(%p): stub!\n", this); \ + return this; \ + } \ + void *__cdecl platform_##name##Exception_hstring_ctor(void *this, HSTRING msg) \ + { \ + FIXME("(%p, %s): stub!\n", this, debugstr_hstring(msg)); \ + return this; \ + } + +WINRT_EXCEPTIONS +#undef WINRT_EXCEPTION + +void *__cdecl platform_Exception_ctor(void *this, HRESULT hr) +{ + FIXME("(%p, %#lx): stub!\n", this, hr); + return this; +} + +void *__cdecl platform_Exception_hstring_ctor(void *this, HRESULT hr, HSTRING msg) +{ + FIXME("(%p, %#lx, %s): stub!\n", this, hr, debugstr_hstring(msg)); + return this; +} + +void *__cdecl platform_COMException_ctor(void *this, HRESULT hr) +{ + FIXME("(%p, %#lx): stub!\n", this, hr); + return this; +} + +void *__cdecl platform_COMException_hstring_ctor(void *this, HRESULT hr, HSTRING msg) +{ + FIXME("(%p, %#lx, %s): stub!\n", this, hr, debugstr_hstring(msg)); + return this; +} + +HSTRING __cdecl platform_exception_get_Message(void *excp) +{ + FIXME("(%p): stub!\n", excp); + return NULL; +} diff --git a/dlls/vccorlib140/vccorlib.c b/dlls/vccorlib140/vccorlib.c index 68100ac7291..869d40aea10 100644 --- a/dlls/vccorlib140/vccorlib.c +++ b/dlls/vccorlib140/vccorlib.c @@ -611,88 +611,6 @@ void *WINAPI CreateValue(int typecode, const void *val) return obj; }
-void *__cdecl CreateExceptionWithMessage(HRESULT hr, HSTRING msg) -{ - FIXME("(%#lx, %s): stub!\n", hr, debugstr_hstring(msg)); - return NULL; -} - -void *__cdecl CreateException(HRESULT hr) -{ - FIXME("(%#lx): stub!\n", hr); - return NULL; -} - -void WINAPI __abi_WinRTraiseCOMException(HRESULT hr) -{ - FIXME("(%#lx): stub!\n", hr); -} - -#define WINRT_EXCEPTIONS \ - WINRT_EXCEPTION(AccessDenied, E_ACCESSDENIED) \ - WINRT_EXCEPTION(ChangedState, E_CHANGED_STATE) \ - WINRT_EXCEPTION(ClassNotRegistered, REGDB_E_CLASSNOTREG) \ - WINRT_EXCEPTION(Disconnected, RPC_E_DISCONNECTED) \ - WINRT_EXCEPTION(Failure, E_FAIL) \ - WINRT_EXCEPTION(InvalidArgument, E_INVALIDARG) \ - WINRT_EXCEPTION(InvalidCast, E_NOINTERFACE) \ - WINRT_EXCEPTION(NotImplemented, E_NOTIMPL) \ - WINRT_EXCEPTION(NullReference, E_POINTER) \ - WINRT_EXCEPTION(ObjectDisposed, RO_E_CLOSED) \ - WINRT_EXCEPTION(OperationCanceled, E_ABORT) \ - WINRT_EXCEPTION(OutOfBounds, E_BOUNDS) \ - WINRT_EXCEPTION(OutOfMemory, E_OUTOFMEMORY) \ - WINRT_EXCEPTION(WrongThread, RPC_E_WRONG_THREAD) - -#define WINRT_EXCEPTION(name, hr) \ - void WINAPI __abi_WinRTraise##name##Exception(void) \ - { \ - FIXME("(): stub!\n"); \ - } \ - void *__cdecl platform_##name##Exception_ctor(void *this) \ - { \ - FIXME("(%p): stub!\n", this); \ - return this; \ - } \ - void *__cdecl platform_##name##Exception_hstring_ctor(void *this, HSTRING msg) \ - { \ - FIXME("(%p, %s): stub!\n", this, debugstr_hstring(msg)); \ - return this; \ - } - -WINRT_EXCEPTIONS -#undef WINRT_EXCEPTION - -void *__cdecl platform_Exception_ctor(void *this, HRESULT hr) -{ - FIXME("(%p, %#lx): stub!\n", this, hr); - return this; -} - -void *__cdecl platform_Exception_hstring_ctor(void *this, HRESULT hr, HSTRING msg) -{ - FIXME("(%p, %#lx, %s): stub!\n", this, hr, debugstr_hstring(msg)); - return this; -} - -void *__cdecl platform_COMException_ctor(void *this, HRESULT hr) -{ - FIXME("(%p, %#lx): stub!\n", this, hr); - return this; -} - -void *__cdecl platform_COMException_hstring_ctor(void *this, HRESULT hr, HSTRING msg) -{ - FIXME("(%p, %#lx, %s): stub!\n", this, hr, debugstr_hstring(msg)); - return this; -} - -HSTRING __cdecl platform_exception_get_Message(void *excp) -{ - FIXME("(%p): stub!\n", excp); - return NULL; -} - BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, void *reserved) { if (reason == DLL_PROCESS_ATTACH)