[PATCH v3] vcruntime140: Add the new MSVC 2015 compiler specific DLL.

Martin Storsjo martin at martin.st
Wed Oct 28 04:48:25 CDT 2015


Since MSVC 2015/Windows 10, the C runtime has now been split into two
parts, ucrtbase, which is the generic C runtime which is now considered
a system component, and vcruntimeX which is specific to the compiler
version.

Forward all matching functions to ucrtbase for now; if a differing
behaviour is required, a local version can be added instead.

The telemetry stub functions are necessary, a plain empty executable
built with MSVC 2015 call these on startup.

Signed-off-by: Martin Storsjo <martin at martin.st>
---
Changed to not duplicate any functionality from other DLLs, but
only forward calls for now.
---
 configure.ac                        |  1 +
 dlls/vcruntime140/Makefile.in       |  5 +++
 dlls/vcruntime140/misc.c            | 39 +++++++++++++++++
 dlls/vcruntime140/vcruntime140.spec | 87 +++++++++++++++++++++++++++++++++++++
 tools/make_specfiles                |  1 +
 5 files changed, 133 insertions(+)
 create mode 100644 dlls/vcruntime140/Makefile.in
 create mode 100644 dlls/vcruntime140/misc.c
 create mode 100644 dlls/vcruntime140/vcruntime140.spec

diff --git a/configure.ac b/configure.ac
index 3180407..40dbbd2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3377,6 +3377,7 @@ WINE_CONFIG_DLL(vcomp100)
 WINE_CONFIG_DLL(vcomp110)
 WINE_CONFIG_DLL(vcomp120)
 WINE_CONFIG_DLL(vcomp90)
+WINE_CONFIG_DLL(vcruntime140)
 WINE_CONFIG_DLL(vdhcp.vxd,enable_win16)
 WINE_CONFIG_DLL(vdmdbg,,[implib])
 WINE_CONFIG_DLL(ver.dll16,enable_win16)
diff --git a/dlls/vcruntime140/Makefile.in b/dlls/vcruntime140/Makefile.in
new file mode 100644
index 0000000..6a99ed0
--- /dev/null
+++ b/dlls/vcruntime140/Makefile.in
@@ -0,0 +1,5 @@
+EXTRADEFS = -D_MT -D_MSVCR_VER=140
+MODULE    = vcruntime140.dll
+
+C_SRCS = \
+	misc.c
diff --git a/dlls/vcruntime140/misc.c b/dlls/vcruntime140/misc.c
new file mode 100644
index 0000000..2e60b66
--- /dev/null
+++ b/dlls/vcruntime140/misc.c
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2015 Martin Storsjo
+ *
+ * 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 "windows.h"
+
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(vcruntime);
+
+/*********************************************************************
+ *              __telemetry_main_invoke_trigger
+ */
+void CDECL __telemetry_main_invoke_trigger(const HINSTANCE hinst)
+{
+    TRACE("(%p)\n", hinst);
+}
+
+/*********************************************************************
+ *              __telemetry_main_return_trigger
+ */
+void CDECL __telemetry_main_return_trigger(const HINSTANCE hinst)
+{
+    TRACE("(%p)\n", hinst);
+}
diff --git a/dlls/vcruntime140/vcruntime140.spec b/dlls/vcruntime140/vcruntime140.spec
new file mode 100644
index 0000000..0c5ecc9
--- /dev/null
+++ b/dlls/vcruntime140/vcruntime140.spec
@@ -0,0 +1,87 @@
+@ stub _CreateFrameInfo
+@ stdcall _CxxThrowException(long long) ucrtbase._CxxThrowException
+@ cdecl -arch=i386 -norelay _EH_prolog() ucrtbase._EH_prolog
+@ stub _FindAndUnlinkFrame
+@ stub _IsExceptionObjectToBeDestroyed
+@ stub _NLG_Dispatch2
+@ stub _NLG_Return
+@ stub _NLG_Return2
+@ stub _SetWinRTOutOfMemoryExceptionCallback
+@ cdecl __AdjustPointer(ptr ptr) ucrtbase.__AdjustPointer
+@ stub __BuildCatchObject
+@ stub __BuildCatchObjectHelper
+@ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) ucrtbase.__C_specific_handler
+@ stub __C_specific_handler_noexcept
+@ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) ucrtbase.__CxxDetectRethrow
+@ cdecl -arch=i386,x86_64,arm __CxxExceptionFilter(ptr ptr long ptr) ucrtbase.__CxxExceptionFilter
+@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) ucrtbase.__CxxFrameHandler
+@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler2(ptr ptr ptr ptr) ucrtbase.__CxxFrameHandler2
+@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler3(ptr ptr ptr ptr) ucrtbase.__CxxFrameHandler3
+@ stdcall -arch=i386 __CxxLongjmpUnwind(ptr) ucrtbase.__CxxLongjmpUnwind
+@ cdecl -arch=i386,x86_64,arm __CxxQueryExceptionSize() ucrtbase.__CxxQueryExceptionSize
+@ stub __CxxRegisterExceptionObject
+@ stub __CxxUnregisterExceptionObject
+@ stub __DestructExceptionObject
+@ stub __FrameUnwindFilter
+@ stub __GetPlatformExceptionInfo
+@ stub __NLG_Dispatch2
+@ stub __NLG_Return2
+@ cdecl __RTCastToVoid(ptr) ucrtbase.__RTCastToVoid
+@ cdecl __RTDynamicCast(ptr long ptr ptr long) ucrtbase.__RTDynamicCast
+@ cdecl __RTtypeid(ptr) ucrtbase.__RTtypeid
+@ stub __TypeMatch
+@ stub __current_exception
+@ stub __current_exception_context
+@ stub __intrinsic_setjmp
+@ stub __intrinsic_setjmpex
+@ stub __processing_throw
+@ stub __report_gsfailure
+@ stub __std_exception_copy
+@ stub __std_exception_destroy
+@ stub __std_terminate
+@ stub __std_type_info_compare
+@ stub __std_type_info_destroy_list
+@ stub __std_type_info_hash
+@ stub __std_type_info_name
+@ cdecl __telemetry_main_invoke_trigger(ptr)
+@ cdecl __telemetry_main_return_trigger(ptr)
+@ cdecl __unDName(ptr str long ptr ptr long) ucrtbase.__unDName
+@ cdecl __unDNameEx(ptr str long ptr ptr ptr long) ucrtbase.__unDNameEx
+@ cdecl __uncaught_exception() ucrtbase.__uncaught_exception
+@ stub __uncaught_exceptions
+@ stub __vcrt_GetModuleFileNameW
+@ stub __vcrt_GetModuleHandleW
+@ stub __vcrt_InitializeCriticalSectionEx
+@ stub __vcrt_LoadLibraryExW
+@ cdecl -arch=i386 -norelay _chkesp() ucrtbase._chkesp
+@ cdecl -arch=i386 _except_handler2(ptr ptr ptr ptr) ucrtbase._except_handler2
+@ cdecl -arch=i386 _except_handler3(ptr ptr ptr ptr) ucrtbase._except_handler3
+@ cdecl -arch=i386 _except_handler4_common(ptr ptr ptr ptr ptr ptr) ucrtbase._except_handler4_common
+@ stub _get_purecall_handler
+@ cdecl _get_unexpected() ucrtbase._get_unexpected
+@ cdecl -arch=i386 _global_unwind2(ptr) ucrtbase._global_unwind2
+@ stub _is_exception_typeof
+@ cdecl -arch=i386 _local_unwind2(ptr long) ucrtbase._local_unwind2
+@ cdecl -arch=i386 _local_unwind4(ptr ptr long) ucrtbase._local_unwind4
+@ cdecl -arch=i386 _longjmpex(ptr long) ucrtbase._longjmpex
+@ cdecl -arch=x86_64 _local_unwind(ptr ptr) ucrtbase._local_unwind
+@ cdecl _purecall() ucrtbase._purecall
+@ stdcall -arch=i386 _seh_longjmp_unwind4(ptr) ucrtbase._seh_longjmp_unwind4
+@ stdcall -arch=i386 _seh_longjmp_unwind(ptr) ucrtbase._seh_longjmp_unwind
+@ cdecl _set_purecall_handler(ptr) ucrtbase._set_purecall_handler
+@ stub _set_se_translator
+@ cdecl -arch=i386 -norelay _setjmp3(ptr long) ucrtbase._setjmp3
+@ cdecl -arch=i386,x86_64,arm longjmp(ptr long) ucrtbase.longjmp
+@ cdecl memchr(ptr long long) ucrtbase.memchr
+@ cdecl memcmp(ptr ptr long) ucrtbase.memcmp
+@ cdecl memcpy(ptr ptr long) ucrtbase.memcpy
+@ cdecl memmove(ptr ptr long) ucrtbase.memmove
+@ cdecl memset(ptr long long) ucrtbase.memset
+@ stub set_unexpected
+@ cdecl strchr(str long) ucrtbase.strchr
+@ cdecl strrchr(str long) ucrtbase.strrchr
+@ cdecl strstr(str str) ucrtbase.strstr
+@ stub unexpected
+@ cdecl wcschr(wstr long) ucrtbase.wcschr
+@ cdecl wcsrchr(wstr long) ucrtbase.wcsrchr
+@ cdecl wcsstr(wstr wstr) ucrtbase.wcsstr
diff --git a/tools/make_specfiles b/tools/make_specfiles
index 7511ab7..986070f 100755
--- a/tools/make_specfiles
+++ b/tools/make_specfiles
@@ -66,6 +66,7 @@ my @dll_groups =
   "api-ms-win-crt-string-l1-1-0",
   "api-ms-win-crt-time-l1-1-0",
   "api-ms-win-crt-utility-l1-1-0",
+  "vcruntime140",
  ],
  [
   "msvcp120",
-- 
1.8.1.2




More information about the wine-patches mailing list