Hi,

On 3/14/2019 4:17 PM, Liu Hao wrote:
在 2019/3/14 17:26, Steve Lhomme 写道:
---
  mingw-w64-headers/include/processthreadsapi.h | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mingw-w64-headers/include/processthreadsapi.h 
b/mingw-w64-headers/include/processthreadsapi.h
index 87f7a0b5..717513e6 100644
--- a/mingw-w64-headers/include/processthreadsapi.h
+++ b/mingw-w64-headers/include/processthreadsapi.h
@@ -23,6 +23,9 @@ extern "C" {
  #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || 
defined(WINSTORECOMPAT)
  WINBASEAPI WINBOOL WINAPI TerminateProcess (HANDLE hProcess, UINT uExitCode);
  #endif
+#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || _WIN32_WINNT >= 
_WIN32_WINNT_WIN10
+  WINBASEAPI HANDLE WINAPI OpenProcess (DWORD dwDesiredAccess, WINBOOL 
bInheritHandle, DWORD dwProcessId);
+#endif
  #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
This function is described as being available in 'Windows XP [desktop
apps | UWP apps]' [1] so I presume it should better belong in the same
block with `TerminateProcess()`?

UWP refers to Windows 10 in this case. It's not available in WinRT/8.1. I'm not sure if it's possible to know just looking at

https://docs.microsoft.com/en-us/windows/desktop/api/processthreadsapi/nf-processthreadsapi-openprocess

As for TerminateProcess() it's allowed when WINSTORECOMPAT is defined. But I 
assume that means it's implemented in the winstorecompat lib. This is not what 
I propose. It should be possible to link directly to the proper Windows DLL 
when it's available, not through winstorecompat. I'm also unsure it can 
actually be implemented in winstorecompat for WinRT/8.1.




BTW, the `OpenProcessToken()`, `OpenThread()` and `OpenThreadToken()`
functions are also available in UWP [2] [3] [4]. Maybe they should also
been moved as well?

I only checked OpenProcessToken, it's only available to use since the 17723 version of Windows. So unless we have a way to target specific Windows builds, it's not possible to make it more usable than it is now.


[1]
https://docs.microsoft.com/en-us/windows/desktop/api/processthreadsapi/nf-processthreadsapi-openprocess
[2]
https://docs.microsoft.com/en-us/windows/desktop/api/processthreadsapi/nf-processthreadsapi-openprocesstoken
[3]
https://docs.microsoft.com/en-us/windows/desktop/api/processthreadsapi/nf-processthreadsapi-openthread
[4]
https://docs.microsoft.com/en-us/windows/desktop/api/processthreadsapi/nf-processthreadsapi-openthreadtoken



--
Best regards,
LH_Mouse




_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to