Re: [Mingw-w64-public] [PATCH 0/5] Update windowsapp to match the one in 20H1

2023-06-26 Thread Steve Lhomme
Also, VLC (and all its contribs) builds with the 19H1 patch (ie without 
the 20H1) as well. Our current minimum for UWP is 19H1 which brought 
enough allowed API's to replace what we used in winstorecompat.


On 2023-06-26 15:44, Steve Lhomme wrote:
BTW I tested this on VLC build and it all links fine (once the Rtl 
functions are added).


On 2023-06-26 15:31, Steve Lhomme wrote:

windowsapp.lib and the target DLL for each API entry keeps evolving.
So far the files and entries were mostly added manually when needed.
This patchset creates the actual equivalent to what is found in 
windowsapp.lib.


The previous mass edits were generated from a WACK to .def tool. This 
time
instead of the WACK that is permitting more functions to define 
multiple times

it's exactly the same DLL that windowsapp.lib uses and not multiple ones.

A few Rtl function not found in windowsapp.lib were added because they 
are
needed by libunwind. They are allowed by the WACK and found in that 
DLL on my

system. But for some reason they are not in windowsapp.lib...

There are a lot of inconsistencies between the WACK, windowsapp.lib, the
windowsapp documentation [1] and the function documentation. The most 
restrictive
is the windowsapp.lib. If a function is not in there, it should not 
link when
building for UWP (we are lacking onecore.lib and onecoreuap.lib). So 
we should

not allow the linking either in mingw-w64.

[1] https://learn.microsoft.com/en-us/uwp/win32-and-com/win32-apis

Steve Lhomme (5):
   crt: don't generate libgamemode.a for windowsapp
   crt: order libs alphabetically in windowsapp
   crt: move some Rtl functions to rtlsupport-l1-1-0
   crt: update windowsapp to the 18362/19H1 SDK
   crt: update windowsapp to the 19041/20H1 SDK

  mingw-w64-crt/Makefile.am | 168 +++---
  .../api-ms-win-appmodel-runtime-l1-1-1.def    |  20 ---
  .../api-ms-win-appmodel-runtime-l1-1-2.def    |  12 ++
  .../api-ms-win-appmodel-runtime-l1-1-3.def    |   9 +
  .../api-ms-win-core-atoms-l1-1-0.def  |  11 ++
  .../lib-common/api-ms-win-core-com-l1-1-1.def |  53 --
  .../api-ms-win-core-comm-l1-1-1.def   |  18 --
  .../api-ms-win-core-comm-l1-1-2.def   |  19 --
  .../api-ms-win-core-console-l1-1-0.def    |   1 -
  .../api-ms-win-core-console-l1-2-0.def    |  13 --
  .../api-ms-win-core-console-l2-1-0.def    |   5 -
  .../api-ms-win-core-console-l2-2-0.def    |  33 
  .../api-ms-win-core-datetime-l1-1-1.def   |   4 -
  .../api-ms-win-core-datetime-l1-1-2.def   |   6 -
  .../api-ms-win-core-debug-l1-1-1.def  |   4 -
  .../api-ms-win-core-delayload-l1-1-0.def  |   5 +
  .../api-ms-win-core-delayload-l1-1-1.def  |   1 -
  .../api-ms-win-core-errorhandling-l1-1-1.def  |   7 -
  .../api-ms-win-core-errorhandling-l1-1-2.def  |   5 +
  .../api-ms-win-core-errorhandling-l1-1-3.def  |  10 --
  .../api-ms-win-core-featurestaging-l1-1-1.def |   5 -
  .../api-ms-win-core-fibers-l1-1-0.def |   8 +
  .../api-ms-win-core-fibers-l1-1-1.def |   4 -
  .../api-ms-win-core-fibers-l2-1-0.def |   7 +
  .../api-ms-win-core-fibers-l2-1-1.def |   3 -
  .../api-ms-win-core-file-l1-1-0.def   |   1 -
  .../api-ms-win-core-file-l1-2-0.def   |  73 
  .../api-ms-win-core-file-l1-2-1.def   |  81 -
  .../api-ms-win-core-file-l1-2-2.def   |  77 
  .../api-ms-win-core-file-l2-1-1.def   |  15 --
  .../api-ms-win-core-file-l2-1-2.def   |  11 --
  .../api-ms-win-core-heap-l1-1-0.def   |   1 -
  .../api-ms-win-core-heap-l1-2-0.def   |  19 --
  .../api-ms-win-core-heap-obsolete-l1-1-0.def  |   5 -
  .../api-ms-win-core-interlocked-l1-1-0.def    |   6 +
  .../api-ms-win-core-interlocked-l1-2-0.def    |   5 -
  .../lib-common/api-ms-win-core-io-l1-1-1.def  |   7 -
  .../lib-common/api-ms-win-core-job-l2-1-0.def |   7 +
  ...api-ms-win-core-kernel32-legacy-l1-1-0.def |  15 --
  ...api-ms-win-core-kernel32-legacy-l1-1-1.def |  35 
  ...api-ms-win-core-kernel32-legacy-l1-1-2.def |   8 +
  ...api-ms-win-core-kernel32-legacy-l1-1-5.def |   5 +
  .../api-ms-win-core-libraryloader-l1-2-1.def  |  23 ---
  .../api-ms-win-core-libraryloader-l1-2-2.def  |   5 +
  .../api-ms-win-core-localization-l1-2-1.def   |  58 --
  .../api-ms-win-core-localization-l1-2-2.def   |  59 --
  ...-win-core-localization-obsolete-l1-2-0.def |   2 -
  .../api-ms-win-core-memory-l1-1-1.def |  16 --
  .../api-ms-win-core-memory-l1-1-2.def |  26 ---
  .../api-ms-win-core-memory-l1-1-3.def |  29 ---
  .../api-ms-win-core-memory-l1-1-5.def |  33 
  .../api-ms-win-core-memory-l1-1-6.def |  35 
  .../api-ms-win-core-memory-l1-1-7.def |  37 
  .../api-ms-win-core-namedpipe-ansi-l1-1-1.def |   3 -
  .../api-ms-win-core-namedpipe-l1-2-1.def  |  10 --
  .../api-ms-win-core-namedpipe-l1-2-2.def  |  12 --
  

Re: [Mingw-w64-public] [PATCH] crt: define L_tmpnam correctly for UCRT

2023-06-26 Thread LIU Hao

在 2023/6/26 19:43, Kacper Michajłow 写道:

UCRT version of tmpnam() returns absolute path and L_tmpnam has to be
defined to accomodate that.

Fixes buffer overflow in various software when building with UCRT.

Fixes: https://sourceforge.net/p/mingw-w64/bugs/915/
Signed-off-by: Kacper Michajłow 
---
  mingw-w64-headers/crt/stdio.h | 4 
  1 file changed, 4 insertions(+)


Thanks for the patches. These match UCRT, so pushed to master now.


--
Best regards,
LIU Hao



OpenPGP_signature
Description: OpenPGP digital signature
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH 0/5] Update windowsapp to match the one in 20H1

2023-06-26 Thread Steve Lhomme
BTW I tested this on VLC build and it all links fine (once the Rtl 
functions are added).


On 2023-06-26 15:31, Steve Lhomme wrote:

windowsapp.lib and the target DLL for each API entry keeps evolving.
So far the files and entries were mostly added manually when needed.
This patchset creates the actual equivalent to what is found in windowsapp.lib.

The previous mass edits were generated from a WACK to .def tool. This time
instead of the WACK that is permitting more functions to define multiple times
it's exactly the same DLL that windowsapp.lib uses and not multiple ones.

A few Rtl function not found in windowsapp.lib were added because they are
needed by libunwind. They are allowed by the WACK and found in that DLL on my
system. But for some reason they are not in windowsapp.lib...

There are a lot of inconsistencies between the WACK, windowsapp.lib, the
windowsapp documentation [1] and the function documentation. The most 
restrictive
is the windowsapp.lib. If a function is not in there, it should not link when
building for UWP (we are lacking onecore.lib and onecoreuap.lib). So we should
not allow the linking either in mingw-w64.

[1] https://learn.microsoft.com/en-us/uwp/win32-and-com/win32-apis

Steve Lhomme (5):
   crt: don't generate libgamemode.a for windowsapp
   crt: order libs alphabetically in windowsapp
   crt: move some Rtl functions to rtlsupport-l1-1-0
   crt: update windowsapp to the 18362/19H1 SDK
   crt: update windowsapp to the 19041/20H1 SDK

  mingw-w64-crt/Makefile.am | 168 +++---
  .../api-ms-win-appmodel-runtime-l1-1-1.def|  20 ---
  .../api-ms-win-appmodel-runtime-l1-1-2.def|  12 ++
  .../api-ms-win-appmodel-runtime-l1-1-3.def|   9 +
  .../api-ms-win-core-atoms-l1-1-0.def  |  11 ++
  .../lib-common/api-ms-win-core-com-l1-1-1.def |  53 --
  .../api-ms-win-core-comm-l1-1-1.def   |  18 --
  .../api-ms-win-core-comm-l1-1-2.def   |  19 --
  .../api-ms-win-core-console-l1-1-0.def|   1 -
  .../api-ms-win-core-console-l1-2-0.def|  13 --
  .../api-ms-win-core-console-l2-1-0.def|   5 -
  .../api-ms-win-core-console-l2-2-0.def|  33 
  .../api-ms-win-core-datetime-l1-1-1.def   |   4 -
  .../api-ms-win-core-datetime-l1-1-2.def   |   6 -
  .../api-ms-win-core-debug-l1-1-1.def  |   4 -
  .../api-ms-win-core-delayload-l1-1-0.def  |   5 +
  .../api-ms-win-core-delayload-l1-1-1.def  |   1 -
  .../api-ms-win-core-errorhandling-l1-1-1.def  |   7 -
  .../api-ms-win-core-errorhandling-l1-1-2.def  |   5 +
  .../api-ms-win-core-errorhandling-l1-1-3.def  |  10 --
  .../api-ms-win-core-featurestaging-l1-1-1.def |   5 -
  .../api-ms-win-core-fibers-l1-1-0.def |   8 +
  .../api-ms-win-core-fibers-l1-1-1.def |   4 -
  .../api-ms-win-core-fibers-l2-1-0.def |   7 +
  .../api-ms-win-core-fibers-l2-1-1.def |   3 -
  .../api-ms-win-core-file-l1-1-0.def   |   1 -
  .../api-ms-win-core-file-l1-2-0.def   |  73 
  .../api-ms-win-core-file-l1-2-1.def   |  81 -
  .../api-ms-win-core-file-l1-2-2.def   |  77 
  .../api-ms-win-core-file-l2-1-1.def   |  15 --
  .../api-ms-win-core-file-l2-1-2.def   |  11 --
  .../api-ms-win-core-heap-l1-1-0.def   |   1 -
  .../api-ms-win-core-heap-l1-2-0.def   |  19 --
  .../api-ms-win-core-heap-obsolete-l1-1-0.def  |   5 -
  .../api-ms-win-core-interlocked-l1-1-0.def|   6 +
  .../api-ms-win-core-interlocked-l1-2-0.def|   5 -
  .../lib-common/api-ms-win-core-io-l1-1-1.def  |   7 -
  .../lib-common/api-ms-win-core-job-l2-1-0.def |   7 +
  ...api-ms-win-core-kernel32-legacy-l1-1-0.def |  15 --
  ...api-ms-win-core-kernel32-legacy-l1-1-1.def |  35 
  ...api-ms-win-core-kernel32-legacy-l1-1-2.def |   8 +
  ...api-ms-win-core-kernel32-legacy-l1-1-5.def |   5 +
  .../api-ms-win-core-libraryloader-l1-2-1.def  |  23 ---
  .../api-ms-win-core-libraryloader-l1-2-2.def  |   5 +
  .../api-ms-win-core-localization-l1-2-1.def   |  58 --
  .../api-ms-win-core-localization-l1-2-2.def   |  59 --
  ...-win-core-localization-obsolete-l1-2-0.def |   2 -
  .../api-ms-win-core-memory-l1-1-1.def |  16 --
  .../api-ms-win-core-memory-l1-1-2.def |  26 ---
  .../api-ms-win-core-memory-l1-1-3.def |  29 ---
  .../api-ms-win-core-memory-l1-1-5.def |  33 
  .../api-ms-win-core-memory-l1-1-6.def |  35 
  .../api-ms-win-core-memory-l1-1-7.def |  37 
  .../api-ms-win-core-namedpipe-ansi-l1-1-1.def |   3 -
  .../api-ms-win-core-namedpipe-l1-2-1.def  |  10 --
  .../api-ms-win-core-namedpipe-l1-2-2.def  |  12 --
  .../api-ms-win-core-privateprofile-l1-1-0.def |   9 +
  .../api-ms-win-core-privateprofile-l1-1-1.def |   5 +
  ...in-core-processenvironment-ansi-l1-1-0.def |   5 +
  ...-ms-win-core-processenvironment-l1-2-0.def |  21 ---
  ...api-ms-win-core-processsnapshot-l1-1-0.def |  14 

[Mingw-w64-public] [PATCH 5/5] crt: update windowsapp to the 19041/20H1 SDK

2023-06-26 Thread Steve Lhomme
This includes the API's made available for UWP 20H1.

A lot of the added functions need to be enabled in UWP for NTDDI_WIN10_VB.
For now they can be linked accurately when WINAPI_FAMILY_DESKTOP_APP is
forced during compilation.

Some functions were exported twice
api-ms-win-core-version-l1-1-1:
- GetFileVersionInfoExW
- GetFileVersionInfoSizeExW
- VerQueryValueW
---
 mingw-w64-crt/Makefile.am | 10 ++
 .../api-ms-win-appmodel-runtime-l1-1-0.def| 12 
 .../api-ms-win-appmodel-runtime-l1-1-1.def|  8 
 .../api-ms-win-appmodel-runtime-l1-1-2.def| 12 
 .../api-ms-win-appmodel-runtime-l1-1-3.def|  9 +
 .../api-ms-win-core-errorhandling-l1-1-0.def  |  1 +
 .../api-ms-win-core-file-ansi-l1-1-0.def  |  3 +++
 .../api-ms-win-core-file-ansi-l2-1-0.def  |  2 ++
 .../api-ms-win-core-file-l1-1-0.def   | 13 +
 .../api-ms-win-core-file-l1-2-0.def   |  1 +
 .../api-ms-win-core-file-l2-1-0.def   |  3 +++
 .../api-ms-win-core-heap-l1-1-0.def   |  3 +++
 .../api-ms-win-core-libraryloader-l1-2-0.def  |  5 +
 ...i-ms-win-core-localization-ansi-l1-1-0.def |  3 +++
 .../api-ms-win-core-localization-l1-2-0.def   | 19 +++
 .../api-ms-win-core-memory-l1-1-0.def |  2 ++
 ...in-core-processenvironment-ansi-l1-1-0.def |  5 +
 ...-ms-win-core-processenvironment-l1-1-0.def |  1 +
 ...api-ms-win-core-processsnapshot-l1-1-0.def | 14 ++
 .../api-ms-win-core-processthreads-l1-1-0.def | 10 ++
 .../api-ms-win-core-processthreads-l1-1-1.def |  1 +
 ...api-ms-win-core-processtopology-l1-1-0.def |  6 ++
 .../api-ms-win-core-rtlsupport-l1-2-0.def |  1 +
 .../api-ms-win-core-synch-l1-2-0.def  |  3 +++
 .../api-ms-win-core-sysinfo-l1-1-0.def|  2 ++
 .../api-ms-win-core-sysinfo-l1-2-6.def|  5 +
 .../api-ms-win-core-timezone-l1-1-0.def   |  2 ++
 .../api-ms-win-core-util-l1-1-0.def   |  2 ++
 .../api-ms-win-core-version-l1-1-1.def|  5 +
 .../api-ms-win-core-versionansi-l1-1-1.def|  5 +
 .../api-ms-win-eventlog-legacy-l1-1-0.def |  7 +++
 .../api-ms-win-security-cpwl-l1-1-0.def   |  5 +
 mingw-w64-crt/lib-common/windowsapp.mri   | 10 ++
 .../api-ms-win-appmodel-runtime-l1-1-0.def| 12 
 .../api-ms-win-appmodel-runtime-l1-1-1.def|  8 
 .../api-ms-win-appmodel-runtime-l1-1-2.def| 12 
 .../api-ms-win-appmodel-runtime-l1-1-3.def|  9 +
 .../api-ms-win-core-errorhandling-l1-1-0.def  |  1 +
 .../api-ms-win-core-file-ansi-l1-1-0.def  |  3 +++
 .../api-ms-win-core-file-ansi-l2-1-0.def  |  2 ++
 .../lib32/api-ms-win-core-file-l1-1-0.def | 13 +
 .../lib32/api-ms-win-core-file-l1-2-0.def |  1 +
 .../lib32/api-ms-win-core-file-l2-1-0.def |  3 +++
 .../lib32/api-ms-win-core-heap-l1-1-0.def |  3 +++
 .../api-ms-win-core-libraryloader-l1-2-0.def  |  5 +
 ...i-ms-win-core-localization-ansi-l1-1-0.def |  3 +++
 .../api-ms-win-core-localization-l1-2-0.def   | 19 +++
 .../lib32/api-ms-win-core-memory-l1-1-0.def   |  2 ++
 ...in-core-processenvironment-ansi-l1-1-0.def |  5 +
 ...-ms-win-core-processenvironment-l1-1-0.def |  1 +
 ...api-ms-win-core-processsnapshot-l1-1-0.def | 14 ++
 .../api-ms-win-core-processthreads-l1-1-0.def | 10 ++
 .../api-ms-win-core-processthreads-l1-1-1.def |  1 +
 ...api-ms-win-core-processtopology-l1-1-0.def |  6 ++
 .../api-ms-win-core-rtlsupport-l1-2-0.def |  1 +
 .../lib32/api-ms-win-core-synch-l1-2-0.def|  3 +++
 .../lib32/api-ms-win-core-sysinfo-l1-1-0.def  |  2 ++
 .../lib32/api-ms-win-core-sysinfo-l1-2-6.def  |  5 +
 .../lib32/api-ms-win-core-timezone-l1-1-0.def |  2 ++
 .../lib32/api-ms-win-core-util-l1-1-0.def |  2 ++
 .../lib32/api-ms-win-core-version-l1-1-1.def  |  5 +
 .../api-ms-win-core-versionansi-l1-1-1.def|  5 +
 .../api-ms-win-eventlog-legacy-l1-1-0.def |  7 +++
 .../lib32/api-ms-win-security-cpwl-l1-1-0.def |  5 +
 64 files changed, 360 insertions(+)
 create mode 100644 
mingw-w64-crt/lib-common/api-ms-win-appmodel-runtime-l1-1-2.def
 create mode 100644 
mingw-w64-crt/lib-common/api-ms-win-appmodel-runtime-l1-1-3.def
 create mode 100644 
mingw-w64-crt/lib-common/api-ms-win-core-processenvironment-ansi-l1-1-0.def
 create mode 100644 
mingw-w64-crt/lib-common/api-ms-win-core-processsnapshot-l1-1-0.def
 create mode 100644 
mingw-w64-crt/lib-common/api-ms-win-core-processtopology-l1-1-0.def
 create mode 100644 mingw-w64-crt/lib-common/api-ms-win-core-sysinfo-l1-2-6.def
 create mode 100644 mingw-w64-crt/lib-common/api-ms-win-core-version-l1-1-1.def
 create mode 100644 
mingw-w64-crt/lib-common/api-ms-win-core-versionansi-l1-1-1.def
 create mode 100644 
mingw-w64-crt/lib-common/api-ms-win-eventlog-legacy-l1-1-0.def
 create mode 100644 

[Mingw-w64-public] [PATCH 2/5] crt: order libs alphabetically in windowsapp

2023-06-26 Thread Steve Lhomme
This is also the order reported by dumpbin and nm.

Using sort -o windowsapp.mri windowsapp.mri and placing back the mri
commands in their place.

No functional changes.
---
 mingw-w64-crt/Makefile.am   | 118 
 mingw-w64-crt/lib-common/windowsapp.mri | 114 +++
 2 files changed, 117 insertions(+), 115 deletions(-)

diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index e00ebb945..efe62903b 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -2186,150 +2186,151 @@ endif
$(RANLIB) $@
 
 %/libwindowsapp.a: lib-common/windowsapp.mri \
+   %/libapi-ms-win-appmodel-runtime-l1-1-0.a \
+   %/libapi-ms-win-appmodel-runtime-l1-1-1.a \
+   %/libapi-ms-win-core-com-l1-1-0.a \
%/libapi-ms-win-core-com-l1-1-1.a \
%/libapi-ms-win-core-com-l2-1-1.a \
%/libapi-ms-win-core-com-midlproxystub-l1-1-0.a \
%/libapi-ms-win-core-comm-l1-1-0.a \
+   %/libapi-ms-win-core-comm-l1-1-1.a \
+   %/libapi-ms-win-core-comm-l1-1-2.a \
%/libapi-ms-win-core-console-l1-1-0.a \
+   %/libapi-ms-win-core-console-l1-2-0.a \
+   %/libapi-ms-win-core-console-l2-1-0.a \
+   %/libapi-ms-win-core-console-l2-2-0.a \
+   %/libapi-ms-win-core-console-l3-2-0.a \
%/libapi-ms-win-core-datetime-l1-1-0.a \
%/libapi-ms-win-core-datetime-l1-1-1.a \
%/libapi-ms-win-core-datetime-l1-1-2.a \
+   %/libapi-ms-win-core-debug-l1-1-0.a \
%/libapi-ms-win-core-debug-l1-1-1.a \
%/libapi-ms-win-core-delayload-l1-1-1.a \
+   %/libapi-ms-win-core-enclave-l1-1-0.a \
+   %/libapi-ms-win-core-errorhandling-l1-1-0.a \
%/libapi-ms-win-core-errorhandling-l1-1-1.a \
%/libapi-ms-win-core-errorhandling-l1-1-3.a \
+   %/libapi-ms-win-core-featurestaging-l1-1-0.a \
+   %/libapi-ms-win-core-featurestaging-l1-1-1.a \
%/libapi-ms-win-core-fibers-l1-1-1.a \
%/libapi-ms-win-core-fibers-l2-1-1.a \
+   %/libapi-ms-win-core-file-ansi-l1-1-0.a \
%/libapi-ms-win-core-file-ansi-l2-1-0.a \
+   %/libapi-ms-win-core-file-fromapp-l1-1-0.a \
+   %/libapi-ms-win-core-file-l1-1-0.a \
%/libapi-ms-win-core-file-l1-2-0.a \
%/libapi-ms-win-core-file-l1-2-1.a \
%/libapi-ms-win-core-file-l1-2-2.a \
%/libapi-ms-win-core-file-l2-1-0.a \
%/libapi-ms-win-core-file-l2-1-1.a \
+   %/libapi-ms-win-core-file-l2-1-2.a \
+   %/libapi-ms-win-core-firmware-l1-1-0.a \
%/libapi-ms-win-core-handle-l1-1-0.a \
%/libapi-ms-win-core-heap-l1-1-0.a \
%/libapi-ms-win-core-heap-l1-2-0.a \
+   %/libapi-ms-win-core-heap-l2-1-0.a \
+   %/libapi-ms-win-core-heap-obsolete-l1-1-0.a \
+   %/libapi-ms-win-core-interlocked-l1-1-0.a \
%/libapi-ms-win-core-interlocked-l1-2-0.a \
%/libapi-ms-win-core-io-l1-1-0.a \
%/libapi-ms-win-core-io-l1-1-1.a \
+   %/libapi-ms-win-core-kernel32-legacy-ansi-l1-1-0.a \
%/libapi-ms-win-core-kernel32-legacy-l1-1-0.a \
%/libapi-ms-win-core-kernel32-legacy-l1-1-1.a \
%/libapi-ms-win-core-largeinteger-l1-1-0.a \
%/libapi-ms-win-core-libraryloader-l1-2-0.a \
+   %/libapi-ms-win-core-libraryloader-l1-2-1.a \
%/libapi-ms-win-core-libraryloader-l2-1-0.a \
%/libapi-ms-win-core-localization-ansi-l1-1-0.a \
+   %/libapi-ms-win-core-localization-l1-2-0.a \
%/libapi-ms-win-core-localization-l1-2-1.a \
%/libapi-ms-win-core-localization-l1-2-2.a \
%/libapi-ms-win-core-localization-l2-1-0.a \
+   %/libapi-ms-win-core-localization-obsolete-l1-2-0.a \
+   %/libapi-ms-win-core-memory-l1-1-0.a \
+   %/libapi-ms-win-core-memory-l1-1-1.a \
%/libapi-ms-win-core-memory-l1-1-2.a \
%/libapi-ms-win-core-memory-l1-1-3.a \
+   %/libapi-ms-win-core-memory-l1-1-5.a \
+   %/libapi-ms-win-core-memory-l1-1-6.a \
+   %/libapi-ms-win-core-memory-l1-1-7.a \
%/libapi-ms-win-core-namedpipe-ansi-l1-1-0.a \
%/libapi-ms-win-core-namedpipe-ansi-l1-1-1.a \
%/libapi-ms-win-core-namedpipe-l1-1-0.a \
%/libapi-ms-win-core-namedpipe-l1-2-1.a \
%/libapi-ms-win-core-namedpipe-l1-2-2.a \
+   %/libapi-ms-win-core-namespace-ansi-l1-1-0.a \
+   %/libapi-ms-win-core-namespace-l1-1-0.a \

[Mingw-w64-public] [PATCH 1/5] crt: don't generate libgamemode.a for windowsapp

2023-06-26 Thread Steve Lhomme
Followup to e7e9894ef641960480355489635a81e21a1406a4
---
 mingw-w64-crt/Makefile.am | 1 -
 1 file changed, 1 deletion(-)

diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index 963df274e..e00ebb945 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -2186,7 +2186,6 @@ endif
$(RANLIB) $@
 
 %/libwindowsapp.a: lib-common/windowsapp.mri \
-   %/libgamemode.a \
%/libapi-ms-win-core-com-l1-1-1.a \
%/libapi-ms-win-core-com-l2-1-1.a \
%/libapi-ms-win-core-com-midlproxystub-l1-1-0.a \
-- 
2.39.2



___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH 0/5] Update windowsapp to match the one in 20H1

2023-06-26 Thread Steve Lhomme
windowsapp.lib and the target DLL for each API entry keeps evolving.
So far the files and entries were mostly added manually when needed.
This patchset creates the actual equivalent to what is found in windowsapp.lib.

The previous mass edits were generated from a WACK to .def tool. This time
instead of the WACK that is permitting more functions to define multiple times
it's exactly the same DLL that windowsapp.lib uses and not multiple ones.

A few Rtl function not found in windowsapp.lib were added because they are
needed by libunwind. They are allowed by the WACK and found in that DLL on my
system. But for some reason they are not in windowsapp.lib...

There are a lot of inconsistencies between the WACK, windowsapp.lib, the
windowsapp documentation [1] and the function documentation. The most 
restrictive
is the windowsapp.lib. If a function is not in there, it should not link when
building for UWP (we are lacking onecore.lib and onecoreuap.lib). So we should
not allow the linking either in mingw-w64.

[1] https://learn.microsoft.com/en-us/uwp/win32-and-com/win32-apis

Steve Lhomme (5):
  crt: don't generate libgamemode.a for windowsapp
  crt: order libs alphabetically in windowsapp
  crt: move some Rtl functions to rtlsupport-l1-1-0
  crt: update windowsapp to the 18362/19H1 SDK
  crt: update windowsapp to the 19041/20H1 SDK

 mingw-w64-crt/Makefile.am | 168 +++---
 .../api-ms-win-appmodel-runtime-l1-1-1.def|  20 ---
 .../api-ms-win-appmodel-runtime-l1-1-2.def|  12 ++
 .../api-ms-win-appmodel-runtime-l1-1-3.def|   9 +
 .../api-ms-win-core-atoms-l1-1-0.def  |  11 ++
 .../lib-common/api-ms-win-core-com-l1-1-1.def |  53 --
 .../api-ms-win-core-comm-l1-1-1.def   |  18 --
 .../api-ms-win-core-comm-l1-1-2.def   |  19 --
 .../api-ms-win-core-console-l1-1-0.def|   1 -
 .../api-ms-win-core-console-l1-2-0.def|  13 --
 .../api-ms-win-core-console-l2-1-0.def|   5 -
 .../api-ms-win-core-console-l2-2-0.def|  33 
 .../api-ms-win-core-datetime-l1-1-1.def   |   4 -
 .../api-ms-win-core-datetime-l1-1-2.def   |   6 -
 .../api-ms-win-core-debug-l1-1-1.def  |   4 -
 .../api-ms-win-core-delayload-l1-1-0.def  |   5 +
 .../api-ms-win-core-delayload-l1-1-1.def  |   1 -
 .../api-ms-win-core-errorhandling-l1-1-1.def  |   7 -
 .../api-ms-win-core-errorhandling-l1-1-2.def  |   5 +
 .../api-ms-win-core-errorhandling-l1-1-3.def  |  10 --
 .../api-ms-win-core-featurestaging-l1-1-1.def |   5 -
 .../api-ms-win-core-fibers-l1-1-0.def |   8 +
 .../api-ms-win-core-fibers-l1-1-1.def |   4 -
 .../api-ms-win-core-fibers-l2-1-0.def |   7 +
 .../api-ms-win-core-fibers-l2-1-1.def |   3 -
 .../api-ms-win-core-file-l1-1-0.def   |   1 -
 .../api-ms-win-core-file-l1-2-0.def   |  73 
 .../api-ms-win-core-file-l1-2-1.def   |  81 -
 .../api-ms-win-core-file-l1-2-2.def   |  77 
 .../api-ms-win-core-file-l2-1-1.def   |  15 --
 .../api-ms-win-core-file-l2-1-2.def   |  11 --
 .../api-ms-win-core-heap-l1-1-0.def   |   1 -
 .../api-ms-win-core-heap-l1-2-0.def   |  19 --
 .../api-ms-win-core-heap-obsolete-l1-1-0.def  |   5 -
 .../api-ms-win-core-interlocked-l1-1-0.def|   6 +
 .../api-ms-win-core-interlocked-l1-2-0.def|   5 -
 .../lib-common/api-ms-win-core-io-l1-1-1.def  |   7 -
 .../lib-common/api-ms-win-core-job-l2-1-0.def |   7 +
 ...api-ms-win-core-kernel32-legacy-l1-1-0.def |  15 --
 ...api-ms-win-core-kernel32-legacy-l1-1-1.def |  35 
 ...api-ms-win-core-kernel32-legacy-l1-1-2.def |   8 +
 ...api-ms-win-core-kernel32-legacy-l1-1-5.def |   5 +
 .../api-ms-win-core-libraryloader-l1-2-1.def  |  23 ---
 .../api-ms-win-core-libraryloader-l1-2-2.def  |   5 +
 .../api-ms-win-core-localization-l1-2-1.def   |  58 --
 .../api-ms-win-core-localization-l1-2-2.def   |  59 --
 ...-win-core-localization-obsolete-l1-2-0.def |   2 -
 .../api-ms-win-core-memory-l1-1-1.def |  16 --
 .../api-ms-win-core-memory-l1-1-2.def |  26 ---
 .../api-ms-win-core-memory-l1-1-3.def |  29 ---
 .../api-ms-win-core-memory-l1-1-5.def |  33 
 .../api-ms-win-core-memory-l1-1-6.def |  35 
 .../api-ms-win-core-memory-l1-1-7.def |  37 
 .../api-ms-win-core-namedpipe-ansi-l1-1-1.def |   3 -
 .../api-ms-win-core-namedpipe-l1-2-1.def  |  10 --
 .../api-ms-win-core-namedpipe-l1-2-2.def  |  12 --
 .../api-ms-win-core-privateprofile-l1-1-0.def |   9 +
 .../api-ms-win-core-privateprofile-l1-1-1.def |   5 +
 ...in-core-processenvironment-ansi-l1-1-0.def |   5 +
 ...-ms-win-core-processenvironment-l1-2-0.def |  21 ---
 ...api-ms-win-core-processsnapshot-l1-1-0.def |  14 ++
 .../api-ms-win-core-processthreads-l1-1-1.def |  49 -
 .../api-ms-win-core-processthreads-l1-1-2.def |  63 ---
 .../api-ms-win-core-processthreads-l1-1-3.def |  67 ---
 

[Mingw-w64-public] [PATCH 3/5] crt: move some Rtl functions to rtlsupport-l1-1-0

2023-06-26 Thread Steve Lhomme
They have moved there in 16299 [1]. Some functions were removed but
they are still allowed by the WACK.

Some function were never in windowsapp.lib:
* RtlAddFunctionTable
* RtlDeleteFunctionTable
* RtlInstallFunctionTableCallback
* RtlVirtualUnwind

[1] 
https://learn.microsoft.com/en-us/uwp/win32-and-com/win32-apis#apis-from-api-ms-win-core-rtlsupport-l1-2-0dll
---
 mingw-w64-crt/Makefile.am |  1 +
 .../lib-common/api-ms-win-core-rtlsupport-l1-1-0.def  | 10 ++
 .../lib-common/api-ms-win-core-rtlsupport-l1-2-0.def  | 11 ---
 mingw-w64-crt/lib-common/windowsapp.mri   |  1 +
 .../lib32/api-ms-win-core-rtlsupport-l1-1-0.def   | 10 ++
 .../lib32/api-ms-win-core-rtlsupport-l1-2-0.def   |  7 ---
 6 files changed, 22 insertions(+), 18 deletions(-)
 create mode 100644 
mingw-w64-crt/lib-common/api-ms-win-core-rtlsupport-l1-1-0.def
 create mode 100644 mingw-w64-crt/lib32/api-ms-win-core-rtlsupport-l1-1-0.def

diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index efe62903b..181bd46a5 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -2279,6 +2279,7 @@ endif
%/libapi-ms-win-core-realtime-l1-1-2.a \
%/libapi-ms-win-core-registry-l1-1-0.a \
%/libapi-ms-win-core-registry-l2-1-0.a \
+   %/libapi-ms-win-core-rtlsupport-l1-1-0.a \
%/libapi-ms-win-core-rtlsupport-l1-2-0.a \
%/libapi-ms-win-core-slapi-l1-1-0.a \
%/libapi-ms-win-core-string-l1-1-0.a \
diff --git a/mingw-w64-crt/lib-common/api-ms-win-core-rtlsupport-l1-1-0.def 
b/mingw-w64-crt/lib-common/api-ms-win-core-rtlsupport-l1-1-0.def
new file mode 100644
index 0..e1d7002b4
--- /dev/null
+++ b/mingw-w64-crt/lib-common/api-ms-win-core-rtlsupport-l1-1-0.def
@@ -0,0 +1,10 @@
+LIBRARY api-ms-win-core-rtlsupport-l1-1-0
+
+EXPORTS
+
+RtlCaptureContext
+RtlCaptureStackBackTrace
+RtlUnwind
+RtlRestoreContext
+RtlUnwindEx
+RtlLookupFunctionEntry
diff --git a/mingw-w64-crt/lib-common/api-ms-win-core-rtlsupport-l1-2-0.def 
b/mingw-w64-crt/lib-common/api-ms-win-core-rtlsupport-l1-2-0.def
index 89e8d2de1..d070d60d8 100644
--- a/mingw-w64-crt/lib-common/api-ms-win-core-rtlsupport-l1-2-0.def
+++ b/mingw-w64-crt/lib-common/api-ms-win-core-rtlsupport-l1-2-0.def
@@ -2,16 +2,5 @@ LIBRARY api-ms-win-core-rtlsupport-l1-2-0
 
 EXPORTS
 
-RtlAddFunctionTable
-RtlCaptureContext
-RtlCaptureStackBackTrace
-RtlCompareMemory
-RtlDeleteFunctionTable
-RtlInstallFunctionTableCallback
-RtlLookupFunctionEntry
 RtlPcToFileHeader
 RtlRaiseException
-RtlRestoreContext
-RtlUnwind
-RtlUnwindEx
-RtlVirtualUnwind
diff --git a/mingw-w64-crt/lib-common/windowsapp.mri 
b/mingw-w64-crt/lib-common/windowsapp.mri
index 73e8ab470..64a6e745d 100644
--- a/mingw-w64-crt/lib-common/windowsapp.mri
+++ b/mingw-w64-crt/lib-common/windowsapp.mri
@@ -92,6 +92,7 @@ ADDLIB libapi-ms-win-core-realtime-l1-1-1.a
 ADDLIB libapi-ms-win-core-realtime-l1-1-2.a
 ADDLIB libapi-ms-win-core-registry-l1-1-0.a
 ADDLIB libapi-ms-win-core-registry-l2-1-0.a
+ADDLIB libapi-ms-win-core-rtlsupport-l1-1-0.a
 ADDLIB libapi-ms-win-core-rtlsupport-l1-2-0.a
 ADDLIB libapi-ms-win-core-slapi-l1-1-0.a
 ADDLIB libapi-ms-win-core-string-l1-1-0.a
diff --git a/mingw-w64-crt/lib32/api-ms-win-core-rtlsupport-l1-1-0.def 
b/mingw-w64-crt/lib32/api-ms-win-core-rtlsupport-l1-1-0.def
new file mode 100644
index 0..29e0bb7b7
--- /dev/null
+++ b/mingw-w64-crt/lib32/api-ms-win-core-rtlsupport-l1-1-0.def
@@ -0,0 +1,10 @@
+LIBRARY api-ms-win-core-rtlsupport-l1-1-0
+
+EXPORTS
+
+RtlCaptureContext@4
+RtlCaptureStackBackTrace@16
+RtlUnwind@16
+RtlRestoreContext@8
+RtlUnwindEx@24
+RtlLookupFunctionEntry@16
diff --git a/mingw-w64-crt/lib32/api-ms-win-core-rtlsupport-l1-2-0.def 
b/mingw-w64-crt/lib32/api-ms-win-core-rtlsupport-l1-2-0.def
index c3d634df6..6846475aa 100644
--- a/mingw-w64-crt/lib32/api-ms-win-core-rtlsupport-l1-2-0.def
+++ b/mingw-w64-crt/lib32/api-ms-win-core-rtlsupport-l1-2-0.def
@@ -2,12 +2,5 @@ LIBRARY api-ms-win-core-rtlsupport-l1-2-0
 
 EXPORTS
 
-RtlCaptureContext@4
-RtlCaptureStackBackTrace@16
-RtlCompareMemory@12
-RtlLookupFunctionEntry
 RtlPcToFileHeader@8
 RtlRaiseException@4
-RtlUnwind@16
-RtlUnwindEx
-RtlVirtualUnwind
-- 
2.39.2



___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH] crt: bump TMP_MAX for UCRT version

2023-06-26 Thread Kacper Michajłow
Signed-off-by: Kacper Michajłow 
---
 mingw-w64-headers/crt/stdio.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/mingw-w64-headers/crt/stdio.h b/mingw-w64-headers/crt/stdio.h
index 5a121bb0f..b8b446686 100644
--- a/mingw-w64-headers/crt/stdio.h
+++ b/mingw-w64-headers/crt/stdio.h
@@ -74,7 +74,11 @@ extern "C" {
 #define FILENAME_MAX 260
 #define FOPEN_MAX 20
 #define _SYS_OPEN 20
+#ifdef _UCRT
+#define TMP_MAX 2147483647
+#else
 #define TMP_MAX 32767
+#endif
 
 #ifndef NULL
 #ifdef __cplusplus
-- 
2.34.1



___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH] crt: define L_tmpnam correctly for UCRT

2023-06-26 Thread Kacper Michajłow
UCRT version of tmpnam() returns absolute path and L_tmpnam has to be
defined to accomodate that.

Fixes buffer overflow in various software when building with UCRT.

Fixes: https://sourceforge.net/p/mingw-w64/bugs/915/
Signed-off-by: Kacper Michajłow 
---
 mingw-w64-headers/crt/stdio.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/mingw-w64-headers/crt/stdio.h b/mingw-w64-headers/crt/stdio.h
index 5a121bb0f..1458addc7 100644
--- a/mingw-w64-headers/crt/stdio.h
+++ b/mingw-w64-headers/crt/stdio.h
@@ -56,7 +56,11 @@ extern "C" {
 #define _wP_tmpdir L"\\"
 #endif
 
+#ifdef _UCRT
+#define L_tmpnam 260
+#else
 #define L_tmpnam (sizeof(_P_tmpdir) + 12)
+#endif
 
 #ifdef _POSIX_
 #define L_ctermid 9
-- 
2.34.1



___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public