Send MinGW-Notify mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.osdn.me/mailman/listinfo/mingw-notify
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of MinGW-Notify digest..."
Please do not reply to this notification; the sender address is unable to
accept incoming e-mail. If you wish to unsubscribe you can do so at
https://lists.osdn.me/mailman/listinfo/mingw-notify.
Today's Topics:
1. [mingw] #41567: Some new Win32 APIs are missing from w32api
(MinGW Notification List)
2. [mingw] #41567: Some new Win32 APIs are missing from w32api
(MinGW Notification List)
----------------------------------------------------------------------
Message: 1
Date: Thu, 20 May 2021 09:38:08 +0300
From: MinGW Notification List <[email protected]>
To: OSDN Ticket System <[email protected]>
Subject: [MinGW-Notify] [mingw] #41567: Some new Win32 APIs are
missing from w32api
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8
#41567: Some new Win32 APIs are missing from w32api
Open Date: 2021-02-12 16:20
Last Update: 2021-05-20 09:38
URL for this Ticket:
https://osdn.net//projects/mingw/ticket/41567
RSS feed for this Ticket:
https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=41567
---------------------------------------------------------------------
Last Changes/Comment on this Ticket:
2021-05-20 09:38 Updated by: eliz
Comment:
Reply To keith
Reply To eliz
Fundamentally, the caveat is that, once the header files have been updated, and
the import library thunks have been added, any code which is compiled with an
appropriate NTDDI_VERSION definition may call the new functions directly, and,
in the absence of coding errors, the program will compile, and link
successfully. However, it will not load, much less run, on any legacy version
of Windows, (which, in the case of the pseudo-console support, is anything
pre-dating Win10-RS5); it will crash, at load time, with a "kernel32.dll entry
point not found" exception, before the main() function even starts to run, and
thus before it has any chance to offer a hint that it requires a newer version
of Windows!
Now, I'm sure that you, Eli, are already aware of this limitation, and there is
already precedent for such pitfalls, in MinGW import libraries, but I thought
it worthy of mention, for the benefit of (possibly) less enlightened users.
The defensive way, to manage this caveat, is to always call potentially
unsupported functions via a pointer retrieved by GetProcAddress(), and never
call them directly; in this way, the application can ensure that
GetProcAddress() returns a valid pointer, or can provide a graceful fallback
action, if NULL is returned. I've written quite a few such "legacy capable"
functions, in the past year or so; they all look very similar, and I'm
seriously considering factoring out the commonality, into generic helper
functions, (perhaps in libkernel32.a), to make the task less repetitive, but
that's probably a subject for another feature request ticket.
Yes, indeed. Any program that wants to use APIs only available on some modern
versions of Windows must use GetProcAddress to test for the availability, and
then call the API through a pointer populated by it. For example, GNU Emacs,
when built for MS-Windows, uses this technique all over the place, because
(when compiled by MinGW -- NOT MinGW64, not even their 32-bit variant!) it
still supports every Windows version from Windows 98 onwards.
---------------------------------------------------------------------
Ticket Status:
Reporter: eliz
Owner: (None)
Type: Feature Request
Status: Open
Priority: 5 - Medium
MileStone: (None)
Component: WSL
Severity: 5 - Medium
Resolution: None
---------------------------------------------------------------------
Ticket details:
To compile programs that use the Pseudo Console feature introduced recently
with Windows 10, there's a need in several additions to the MinGW w32api
headers and import libraries.
First, we need a value for _WIN32_WINNT that specifies Windows 10, in
sdkddkver.h:
#define _WIN32_WINNT_WIN10 0x0A00
Second, we need functions, data structures, and macros to create and update
lists of attributes for process and thread creation. These are:
InitializeProcThreadAttributeList function
UpdateProcThreadAttribute function
DeleteProcThreadAttributeList function
PROC_THREAD_ATTRIBUTE_LIST structure
STARTUPINFOEX structure
PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE macro
Other PROC_THREAD_ATTRIBUTE_* macros
These seem to be supported since Windows 7, with the exception of
PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE, which is only supported since Windows 10,
and STARTUPINFOEX, which is supported since Vista. I think the proper place
for them is in the winbase.h header file.
We also need the EXTENDED_STARTUPINFO_PRESENT flag for the CreateProcess
function (this flag is supported since Vista and should be in winbase.h).
And finally, we need the functions, data types, and macros to manipulate
pseudo-consoles, available only since Windows 10:
CreatePseudoConsole function
ClosePseudoConsole function
ResizePseudoConsole function
HPCON data type
Thanks in advance for providing these.
--
Ticket information of MinGW - Minimalist GNU for Windows project
MinGW - Minimalist GNU for Windows Project is hosted on OSDN
Project URL: https://osdn.net/projects/mingw/
OSDN: https://osdn.net
URL for this Ticket:
https://osdn.net/projects/mingw/ticket/41567
RSS feed for this Ticket:
https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=41567
------------------------------
Message: 2
Date: Thu, 20 May 2021 12:09:28 +0100
From: MinGW Notification List <[email protected]>
To: OSDN Ticket System <[email protected]>
Subject: [MinGW-Notify] [mingw] #41567: Some new Win32 APIs are
missing from w32api
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8
#41567: Some new Win32 APIs are missing from w32api
Open Date: 2021-02-12 14:20
Last Update: 2021-05-20 12:09
URL for this Ticket:
https://osdn.net//projects/mingw/ticket/41567
RSS feed for this Ticket:
https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=41567
---------------------------------------------------------------------
Last Changes/Comment on this Ticket:
2021-05-20 12:09 Updated by: keith
Comment:
I've attached my current W32API patch, to address this issue; please check if
it meets your requirements.
Note that, to expose the pseudo-console API, you will need to #define
NTDDI_VERSION NTDDI_WIN10_RS5, (which, with our <sdkddkver.h> should also
implicitly #define _WIN32_WINNT _WIN32_WINNT_WIN10; if not, you will also need
to define this explicitly).
Further note that, while I've also added a significant swathe of ancillary
manifest constant definitions, gleaned from Microsoft's
UpdateProcThreadAttribute() documentation, I've omitted some information which
may be found there; I found that page to be confusing, w.r.t. which version of
Windows was required to support each attribute, and I've omitted those about
which I was uncertain.
---------------------------------------------------------------------
Ticket Status:
Reporter: eliz
Owner: (None)
Type: Feature Request
Status: Open
Priority: 5 - Medium
MileStone: (None)
Component: WSL
Severity: 5 - Medium
Resolution: None
---------------------------------------------------------------------
Ticket details:
To compile programs that use the Pseudo Console feature introduced recently
with Windows 10, there's a need in several additions to the MinGW w32api
headers and import libraries.
First, we need a value for _WIN32_WINNT that specifies Windows 10, in
sdkddkver.h:
#define _WIN32_WINNT_WIN10 0x0A00
Second, we need functions, data structures, and macros to create and update
lists of attributes for process and thread creation. These are:
InitializeProcThreadAttributeList function
UpdateProcThreadAttribute function
DeleteProcThreadAttributeList function
PROC_THREAD_ATTRIBUTE_LIST structure
STARTUPINFOEX structure
PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE macro
Other PROC_THREAD_ATTRIBUTE_* macros
These seem to be supported since Windows 7, with the exception of
PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE, which is only supported since Windows 10,
and STARTUPINFOEX, which is supported since Vista. I think the proper place
for them is in the winbase.h header file.
We also need the EXTENDED_STARTUPINFO_PRESENT flag for the CreateProcess
function (this flag is supported since Vista and should be in winbase.h).
And finally, we need the functions, data types, and macros to manipulate
pseudo-consoles, available only since Windows 10:
CreatePseudoConsole function
ClosePseudoConsole function
ResizePseudoConsole function
HPCON data type
Thanks in advance for providing these.
--
Ticket information of MinGW - Minimalist GNU for Windows project
MinGW - Minimalist GNU for Windows Project is hosted on OSDN
Project URL: https://osdn.net/projects/mingw/
OSDN: https://osdn.net
URL for this Ticket:
https://osdn.net/projects/mingw/ticket/41567
RSS feed for this Ticket:
https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=41567
------------------------------
Subject: Digest Footer
_______________________________________________
MinGW-Notify mailing list
[email protected]
https://lists.osdn.me/mailman/listinfo/mingw-notify
------------------------------
End of MinGW-Notify Digest, Vol 44, Issue 8
*******************************************