[PATCH] Cygwin: Unconditionally require win32api >= 10.0.0

Jon Turney jon.turney@dronecode.org.uk
Wed Apr 27 20:35:14 GMT 2022


Unconditionally require win32api >= 10.0.0, and check for it at
configure time.

Note that there remains a use of __MINGW64_VERSION_MAJOR in
pseudo-reloc.cc under !CYGWIN (since that file is shared with the
MinGW and MinGW64 runtimes).
---
 winsup/configure.ac       |  9 +++++++++
 winsup/cygwin/ntdll.h     |  6 ------
 winsup/cygwin/sec_auth.cc | 19 -------------------
 winsup/cygwin/winlean.h   |  5 -----
 4 files changed, 9 insertions(+), 30 deletions(-)

diff --git a/winsup/configure.ac b/winsup/configure.ac
index b8d2100db..41bf21c78 100644
--- a/winsup/configure.ac
+++ b/winsup/configure.ac
@@ -57,6 +57,15 @@ AC_CHECK_TOOL(RANLIB, ranlib, ranlib)
 AC_CHECK_TOOL(STRIP, strip, strip)
 AC_CHECK_TOOL(WINDRES, windres, windres)
 
+w32api_maj_ver_req=10
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+#include <windows.h>
+#if __MINGW64_VERSION_MAJOR < $w32api_maj_ver_req
+#error "w32api headers version doesn't meet requirements"
+#endif
+])],,
+AC_MSG_FAILURE("Version >= $w32api_maj_ver_req of w32api headers is required"))
+
 AC_ARG_ENABLE(debugging,
 [AS_HELP_STRING([--enable-debugging],[Build a cygwin DLL which has more consistency checking for debugging])],
 [case "${enableval}" in
diff --git a/winsup/cygwin/ntdll.h b/winsup/cygwin/ntdll.h
index 59c396676..f6b31a19d 100644
--- a/winsup/cygwin/ntdll.h
+++ b/winsup/cygwin/ntdll.h
@@ -1467,12 +1467,6 @@ extern "C"
   NTSTATUS NTAPI NtMapViewOfSection (HANDLE, HANDLE, PVOID *, ULONG_PTR, SIZE_T,
 				     PLARGE_INTEGER, PSIZE_T, SECTION_INHERIT,
 				     ULONG, ULONG);
-
-/* For the extended memory API. */
-#if __MINGW64_VERSION_MAJOR < 8
-#error "Version >= 8 of the w32api headers is required"
-#endif
-
   NTSTATUS NTAPI NtMapViewOfSectionEx (HANDLE, HANDLE, PVOID *, PLARGE_INTEGER,
 				       PSIZE_T, ULONG, ULONG,
 				       PMEM_EXTENDED_PARAMETER, ULONG);
diff --git a/winsup/cygwin/sec_auth.cc b/winsup/cygwin/sec_auth.cc
index 2b1ce2203..9ac476284 100644
--- a/winsup/cygwin/sec_auth.cc
+++ b/winsup/cygwin/sec_auth.cc
@@ -1232,25 +1232,6 @@ out:
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-/* In w32api prior to 10.0.0, MsV1_0S4ULogon and MSV1_0_S4U_LOGON are only
-   defined in ddk/ntifs.h, which we can't include. */
-#if (__MINGW64_VERSION_MAJOR < 10)
-
-#define MsV1_0S4ULogon ((MSV1_0_LOGON_SUBMIT_TYPE) 12)
-
-typedef struct _MSV1_0_S4U_LOGON
-{
-  MSV1_0_LOGON_SUBMIT_TYPE MessageType;
-  ULONG Flags;
-  UNICODE_STRING UserPrincipalName;
-  UNICODE_STRING DomainName;
-} MSV1_0_S4U_LOGON, *PMSV1_0_S4U_LOGON;
-
-/* Missing in Mingw-w64 */
-#define KERB_S4U_LOGON_FLAG_IDENTIFY 0x08
-
-#endif
-
 /* If logon is true we need an impersonation token.  Otherwise we just
    need an identification token, e. g. to fetch the group list. */
 HANDLE
diff --git a/winsup/cygwin/winlean.h b/winsup/cygwin/winlean.h
index de7305e26..6f9c1df24 100644
--- a/winsup/cygwin/winlean.h
+++ b/winsup/cygwin/winlean.h
@@ -99,11 +99,6 @@ details. */
 extern "C" {
 #endif
 
-/* For the extended memory API. */
-#if __MINGW64_VERSION_MAJOR < 8
-#error "Version >= 8 of the w32api headers is required"
-#endif
-
 /* IsWow64Process2 should be declared in <w32api/wow64apiset.h> but
    isn't yet. */
 BOOL WINAPI IsWow64Process2(HANDLE, USHORT *, USHORT *);
-- 
2.36.0



More information about the Cygwin-patches mailing list