Commit Graph

7753 Commits

Author SHA1 Message Date
Pali Rohár
c1533322d1 crt: ucrtbase.def.in: Remove comment about DATA for _mbcasemap
_mbcasemap is global variable, not function. So it has to be marked with
DATA, not just manually.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-19 23:14:53 +03:00
Pali Rohár
ff3837006e crt: Update comment about UCRT _HUGE in crt-aliases.def.in
Since commit 527522b8b0 _HUGE variable is provided by math/_huge.c.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-19 23:14:53 +03:00
Pali Rohár
c323fc1fac crt: Move two UCRT aliases from ucrtbase.def.in to crt-aliases.def.in
In file crt-aliases.def.in are defined all UCRT symbol aliases except two.
Move those two remaning.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-19 23:14:53 +03:00
Pali Rohár
d60d431d26 crt: ucrtbase.def.in: Fix ARM64 symbols
__intrinsic_setjmp and _set_FMA3_enable are not available, but _local_unwind is.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-19 23:14:53 +03:00
Pali Rohár
78969c62a9 crt: ucrtbase.def.in: Add missing ARM32 symbols
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-19 23:14:53 +03:00
Pali Rohár
52c98b1273 crt: ucrtbase.def.in: Fix symbols not available on I386 and X64
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-19 23:14:53 +03:00
Pali Rohár
96f33f701b crt: UCRT __dcrt_initial_narrow_environment is global variable
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-19 23:14:53 +03:00
Biswapriyo Nath
7a6c241e46 include: Add new DebugSystemObjects4 interface in dbgeng.h
Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2024-08-13 22:52:20 +08:00
Biswapriyo Nath
fc03403f74 include: Add new DebugRegisters2 interface in dbgeng.h
Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2024-08-13 22:52:20 +08:00
Biswapriyo Nath
91d3c26477 include: Add new DebugDataSpaces4 interface in dbgeng.h
Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2024-08-13 22:52:20 +08:00
Biswapriyo Nath
4a2cbfaca0 include: Add new DebugPlmClient interfaces in dbgeng.h
Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2024-08-13 22:52:20 +08:00
Biswapriyo Nath
cb910bb502 include: Add new DebugAdvanced interfaces in dbgeng.h
Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2024-08-13 22:52:20 +08:00
Pali Rohár
a20b17848e crt: Fix profil.c compile warning: cast between incompatible function types
profile/profil.c:140:36: warning: cast between incompatible function types from ‘void (__attribute__((stdcall)) *)(void *)’ to ‘DWORD (__attribute__((stdcall)) *)(void *)’ [-Wcast-function-type]

Callback thread function must return DWORD, not void.

Signed-off-by: LIU Hao <lh_mouse@126.com>
2024-08-13 22:26:03 +08:00
Rafael Kitover
5d453b075b headers: Disable conflicting OLE methods on Cygwin
On inclusion of the header `comutil.h` on Cygwin platforms errors such
as:

include/comutil.h:413:3: error: '_variant_t::_variant_t(unsigned int)' cannot be overloaded with '_variant_t::_variant_t(unsigned int)'

, are produced because on Cygwin some methods are duplicates via a type
alias.

Disable these methods under `__CYGWIN__`.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2024-08-13 22:11:01 +08:00
Martin Storsjö
167b4f97cb crt: Regenerate Makefile.in
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-12 23:15:38 +03:00
Pali Rohár
27945804fa crt: Split UCRT at_quick_exit() into separate file
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-12 23:15:33 +03:00
Pali Rohár
3d84b7e11d crt: Split UCRT _onexit() into separate file
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-12 23:15:13 +03:00
Pali Rohár
040ab170f2 crt: Split UCRT _getmainargs() and _wgetmainargs() functions into separate files
Every executable references only one of those functions. So if functions
are split into separate files, linker includes only the one which is used.

Replace magic numbers 2 and 1 for DoWildCard by the named enum values.

Remove check for NULL value of StartInfo because StartInfo cannot be NULL.
MS implementation of _(w)getmainargs() requires StartInfo to be valid
pointer and mingw-w64 startup code always calls _(w)getmainargs() with
non-NULL StartInfo.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-12 23:14:48 +03:00
Pali Rohár
9c7ff03518 headers: Declare missing UCRT corecrt_startup.h functions
These missing functions are available in MS UCRT corecrt_startup.h header file.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-12 23:14:00 +03:00
Pali Rohár
f2893d4904 headers: Fix new.h to work also in C mode
UCRT <new.h> header file exports C functions not only in C++ mode, but also
in C mode. Do same in mingw-w64 <new.h> header file.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-12 23:14:00 +03:00
Martin Storsjö
eea00c0087 headers: Fix nesting of version guards around SyntheticPointer APIs
If the user has hardcoded WINVER to a version number less than
0x0602, while _WIN32_WINNT is set to 0xA00, and NTDDI_VERSION
is larger than NTDDI_WIN10_RS3, we would earlier hide the
definition of POINTER_INPUT_TYPE, but include the declarations
of functions that take a POINTER_INPUT_TYPE parameter,
leading to errors.

Since 6cfc1fd2ca, we would set
NTDDI_VERSION to a higher version, if _WIN32_WINNT is set to 0xA00,
exposing this issue.

Change the nesting of ifdefs; include the block for checking
NTDDI_VERSION in the outer scope checking for WINVER >= 0x602.
That way, if they are set inconsistently, we'd skip the
declaration of the SyntheticPointer functions.

This matches how the ifdefs around these declarations are nested
in WinSDK.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-12 22:47:02 +03:00
Biswapriyo Nath
039ff2e4cc include: Add new DebugSymbols interfaces in dbgeng.h
Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2024-08-12 22:47:47 +08:00
Biswapriyo Nath
c37b1cd205 include: Add new DebugControl interfaces in dbgeng.h
Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2024-08-12 22:47:47 +08:00
Biswapriyo Nath
aa30600399 include: Add new DebugClient interfaces in dbgeng.h
Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2024-08-12 22:47:47 +08:00
Martin Storsjö
ce76be04c8 crt: Regenerate Makefile.in
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-12 11:12:52 +03:00
Pali Rohár
78358b77da crt: Move non-startup files out of the mingw-w64-crt/crt/ directory
mingw-w64-crt/crt/ contains mostly startup files which are part of the
libmingw32.a library or crtX.o object files. But there are also few files
which are either part of libmingwex.a or some CRT import library.

Do cleanup of these few files which are not in libmingw32.a or crtX.o and
move them from mingw-w64-crt/crt/ to mingw-w64-crt/misc/ directory.

So after this change mingw-w64-crt/crt/ will contain only source code for
startup files which are part of the libmingw32.a library or crtX.o object
files.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-12 11:11:10 +03:00
Martin Storsjö
ccffe2276e headers: Indent the preprocessor directives around setting NTDDI_VERSION
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-12 11:08:37 +03:00
Martin Storsjö
8704184f6e crt: Remove leftover DATA marking for wcsnlen in api-ms-win-crt-string-l1-1-0.def
This was missed in 6b28ca10e2.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-10 07:18:34 +03:00
Martin Storsjö
ab8816efa4 crt: Regenerate Makefile.in
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-09 14:40:36 +03:00
Pali Rohár
d2b3213753 crt: Add import library for vcruntime140d.dll
It looks like that vcruntime140d.dll has same set of symbols as vcruntime140.dll.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-09 14:40:03 +03:00
Pali Rohár
2874018356 crt: Add import library for vcruntime140.dll
List of symbols is generated from I386, X64, ARM32 and ARM64 versions
of vcruntime140.dll library by gendef and merged to one def.in file.

All versions 14.00 - 14.40 of vcruntime140.dll for specific architecture
contains same set of symbols.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-09 14:40:03 +03:00
Pali Rohár
fc8f453e67 crt: vcruntime140_app.def.in: Use F_NON_ARM64 for __intrinsic_setjmp
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-09 14:40:03 +03:00
Martin Storsjö
3fa78e9669 crt: Regenerate Makefile.in
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-09 14:21:22 +03:00
Pali Rohár
5277a007a4 crt: Access errno directly instead of _get_errno/_set_errno functions
Functions _get_errno() and _set_errno() are not available before msvcr80.
mingw-w64 provides emulations of these functions for older msvcr libraries.
But there is no reason to use emulations, just access errno directly which
is implemented as dereferncing return value of _errno() function (which is
available in all CRT libraries).

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-09 14:20:46 +03:00
Pali Rohár
f25a200297 crt: Split mingw-w64 _get_errno and _set_errno implementations into separate files
Before this change linker had to statically bundle both _get_errno and
_set_errno functions when only one of them was used. With this change
linker includes only one function if just one is used.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-09 14:20:46 +03:00
Martin Storsjö
2f63d213c4 crt: Regenerate Makefile.in
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-09 14:14:48 +03:00
Pali Rohár
6b28ca10e2 crt: Move wcsnlen from libmingwex.a to individual CRT import libraries
POSIX wcsnlen symbol is natively available since msvcr80 and also in all
ARM versions of msvcrt.dll.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-09 14:13:47 +03:00
Pali Rohár
b8e83b5bf0 headers: Fix _amblksiz definition
There is no global variable named _amblksiz. There is only __p__amblksiz()
function which returns pointer to _amblksiz variable.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-09 14:13:47 +03:00
Pali Rohár
3b1ad01406 crt: Remove relict of DATA comment in ucrtbase.def.in
DATA for symbol assert was removed in commit 713a108e4c ("crt: Use
importlib for _assert."). Remove it from comment too.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-09 14:08:12 +03:00
Pali Rohár
a08acbebd5 doc: Update msvcrt.dll info in ucrt-vs-msvcrt.txt
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-09 14:05:13 +03:00
Martin Storsjö
6cfc1fd2ca headers: Default NTDDI_VERSION to the latest version, if _WIN32_WINNT targets Windows 10
This matches what WinSDK headers do these days. We always have
_WIN32_WINNT set to a default value of our choice, and there's
no value we can set _WIN32_WINNT to, that would set NTDDI_VERSION
to include the features from newer versions of Windows 10/11,
such as e.g. NTDDI_WIN10_RS1.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-07 14:53:18 +03:00
Jacek Caban
5ccc975a43 wine-import.sh: Restore d3d8.h and d3d9.h imports.
Those were reverted by mistake in d96d77563d.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
2024-08-06 18:18:25 +02:00
Jacek Caban
d96d77563d headers: Update imported headers to current Wine version.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
2024-08-04 23:24:46 +02:00
Pali Rohár
48cf32beae headers: Fix compile warning: FACILITY_VISUALCPP redefined
Warning is:

    In file included from misc/delay-f.c:11:
    mingw-w64-headers/include/delayimp.h:64: warning: "FACILITY_VISUALCPP" redefined
     #define FACILITY_VISUALCPP ((LONG)0x6d)

    In file included from mingw-w64-headers/include/winbase.h:2817,
                     from mingw-w64-headers/include/windows.h:70,
                     from misc/delay-f.c:10:
    mingw-w64-headers/include/winerror.h:88: note: this is the location of the previous definition
     #define FACILITY_VISUALCPP 109

This same header from Visual Studio has such a definition commented out,
suggesting that it should be defined in winerror.h. We notice that delayimp.h
can't be used without including Windows SDK headers first, so don't redefine
`FACILITY_VISUALCPP` if one has already been defined.

Signed-off-by: LIU Hao <lh_mouse@126.com>
2024-07-31 11:11:36 +08:00
Pali Rohár
a0cac0b4a2 headers: Fix compile warning: FindResource redefined
Warning is:

    In file included from mingw-w64-headers/include/windows.h:70,
                     from libsrc/dxerr.c:15,
                     from libsrc/dxerr8w.c:20:
    mingw-w64-headers/include/winbase.h:2171: warning: "FindResource" redefined
     #define FindResource __MINGW_NAME_AW(FindResource)

    In file included from mingw-w64-headers/include/winbase.h:24,
                     from mingw-w64-headers/include/windows.h:70,
                     from libsrc/dxerr.c:15,
                     from libsrc/dxerr8w.c:20:
    mingw-w64-headers/include/libloaderapi.h:62: note: this is the location of the previous definition
     #define FindResource FindResourceW

Fix it by conditionally defining FindResource in winbase.h directly as
FindResourceA for non-UNICODE builds and let libloaderapi.h to define
FindResource as FindResourceW for UNICODE builds.

Signed-off-by: LIU Hao <lh_mouse@126.com>
2024-07-30 23:57:30 +08:00
Pali Rohár
715da56221 headers: Fix compile warning: EnumResourceNames redefined
Warning is:

    In file included from mingw-w64-headers/include/windows.h:70,
                     from crt/crtexewin.c:6,
                     from crt/ucrtexewin.c:14:
    mingw-w64-headers/include/winbase.h:2084: warning: "EnumResourceNames" redefined
     #define EnumResourceNames __MINGW_NAME_AW(EnumResourceNames)

    In file included from mingw-w64-headers/include/winbase.h:24,
                     from mingw-w64-headers/include/windows.h:70,
                     from crt/crtexewin.c:6,
                     from crt/ucrtexewin.c:14:
    mingw-w64-headers/include/libloaderapi.h:80: note: this is the location of the previous definition
     #define EnumResourceNames EnumResourceNamesW

Fix it by conditionally defining EnumResourceNames in winbase.h directly as
EnumResourceNamesA for non-UNICODE builds and let libloaderapi.h to define
EnumResourceNames as EnumResourceNamesW for UNICODE builds.

libloaderapi.h is automatically included in winbase.h, so caller of
winbase.h would have definition of EnumResourceNames for both UNICODE and
non-UNICODE builds.

Caller of libloaderapi.h would have only UNICODE definition of
EnumResourceNames because api-ms-win-core-libraryloader-l1-2-2.def and
kernel32_onecore.def do not provide non-UNICODE EnumResourceNamesA symbol.

Signed-off-by: LIU Hao <lh_mouse@126.com>
2024-07-30 23:57:30 +08:00
Pali Rohár
8106880ee5 headers: Fix compile warning: FACILITY_USERMODE_FILTER_MANAGER redefined
Warning is:

    In file included from mingw-w64-headers/include/winerror.h:4920,
                     from mingw-w64-headers/include/winbase.h:2817,
                     from mingw-w64-headers/include/windows.h:70,
                     from intrincs/RtlSecureZeroMemory.c:2:
    mingw-w64-headers/include/fltwinerror.h:12: warning: "FACILITY_USERMODE_FILTER_MANAGER" redefined
     #define FACILITY_USERMODE_FILTER_MANAGER 0x1f

    In file included from mingw-w64-headers/include/winbase.h:2817,
                     from mingw-w64-headers/include/windows.h:70,
                     from intrincs/RtlSecureZeroMemory.c:2:
    mingw-w64-headers/include/winerror.h:38: note: this is the location of the previous definition
     #define FACILITY_USERMODE_FILTER_MANAGER 31

WinSDK10 header file fltWinError.h contains #ifndef guard. Do same.

Signed-off-by: LIU Hao <lh_mouse@126.com>
2024-07-30 23:57:30 +08:00
Martin Storsjö
c228e5cc20 crt: Regenerate Makefile.in
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-30 14:41:54 +03:00
Pali Rohár
df61d420e1 crt: Move strnlen from libmingwex.a to individual CRT import libraries
POSIX strnlen symbol is natively available since msvcr80 and also in all
ARM versions of msvcrt.dll.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-30 14:41:20 +03:00
Pali Rohár
d127ca98d2 crt: Move wctype from libmingwex.a to individual CRT import libraries
C95 wctype symbol is natively available since msvcr120.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-30 14:41:20 +03:00