crt: Update processenvironment libraries and headers As per https://docs.microsoft.com/en-us/uwp/win32-and-com/win32-apis#apis-from-api-ms-win-core-processenvironment-l1-1-0dll Signed-off-by: Liu Hao <lh_mouse@126.com>
diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am index 3afd57c..f97b9fc 100644 --- a/mingw-w64-crt/Makefile.am +++ b/mingw-w64-crt/Makefile.am
@@ -1681,6 +1681,7 @@ %/libapi-ms-win-core-localization-l2-1-0.a \ %/libapi-ms-win-core-memory-l1-1-2.a \ %/libapi-ms-win-core-memory-l1-1-3.a \ + %/libapi-ms-win-core-processenvironment-l1-1-0.a \ %/libapi-ms-win-core-processenvironment-l1-2-0.a \ %/libapi-ms-win-core-processthreads-l1-1-0.a \ %/libapi-ms-win-core-processthreads-l1-1-1.a \ @@ -1772,6 +1773,7 @@ %/libapi-ms-win-core-memory-l1-1-2.a \ %/libapi-ms-win-core-memory-l1-1-3.a \ %/libapi-ms-win-core-normalization-l1-1-0.a \ + %/libapi-ms-win-core-processenvironment-l1-1-0.a \ %/libapi-ms-win-core-processenvironment-l1-2-0.a \ %/libapi-ms-win-core-processthreads-l1-1-0.a \ %/libapi-ms-win-core-processthreads-l1-1-1.a \
diff --git a/mingw-w64-crt/lib-common/api-ms-win-core-processenvironment-l1-1-0.def b/mingw-w64-crt/lib-common/api-ms-win-core-processenvironment-l1-1-0.def new file mode 100644 index 0000000..a2bf16e --- /dev/null +++ b/mingw-w64-crt/lib-common/api-ms-win-core-processenvironment-l1-1-0.def
@@ -0,0 +1,17 @@ +LIBRARY api-ms-win-core-processenvironment-l1-1-0 + +EXPORTS + +ExpandEnvironmentStringsA +ExpandEnvironmentStringsW +FreeEnvironmentStringsA +FreeEnvironmentStringsW +GetEnvironmentStrings +GetEnvironmentStringsW +GetEnvironmentVariableA +GetEnvironmentVariableW +GetStdHandle +SetEnvironmentVariableA +SetEnvironmentVariableW +SetStdHandle +SetStdHandleEx
diff --git a/mingw-w64-crt/lib-common/mincore.mri b/mingw-w64-crt/lib-common/mincore.mri index 5747194..99cf86c 100644 --- a/mingw-w64-crt/lib-common/mincore.mri +++ b/mingw-w64-crt/lib-common/mincore.mri
@@ -57,7 +57,7 @@ ; FIXME libapi-ms-win-core-namedpipe-l1-2-2.a ; FIXME libapi-ms-win-core-namespace-l1-1-0.a ; FIXME libapi-ms-win-core-path-l1-1-0.a -; FIXME libapi-ms-win-core-processenvironment-l1-1-0.a +ADDLIB libapi-ms-win-core-processenvironment-l1-1-0.a ADDLIB libapi-ms-win-core-processenvironment-l1-2-0.a ; FIXME libapi-ms-win-core-processsnapshot-l1-1-0.a ADDLIB libapi-ms-win-core-processthreads-l1-1-0.a
diff --git a/mingw-w64-crt/lib-common/windowsapp.mri b/mingw-w64-crt/lib-common/windowsapp.mri index cf956d3..d9da0d6 100644 --- a/mingw-w64-crt/lib-common/windowsapp.mri +++ b/mingw-w64-crt/lib-common/windowsapp.mri
@@ -29,6 +29,7 @@ ADDLIB libapi-ms-win-core-memory-l1-1-2.a ADDLIB libapi-ms-win-core-memory-l1-1-3.a ADDLIB libapi-ms-win-core-normalization-l1-1-0.a +ADDLIB libapi-ms-win-core-processenvironment-l1-1-0.a ADDLIB libapi-ms-win-core-processenvironment-l1-2-0.a ADDLIB libapi-ms-win-core-processthreads-l1-1-0.a ADDLIB libapi-ms-win-core-processthreads-l1-1-1.a
diff --git a/mingw-w64-crt/lib32/api-ms-win-core-processenvironment-l1-1-0.def b/mingw-w64-crt/lib32/api-ms-win-core-processenvironment-l1-1-0.def new file mode 100644 index 0000000..1d617fe --- /dev/null +++ b/mingw-w64-crt/lib32/api-ms-win-core-processenvironment-l1-1-0.def
@@ -0,0 +1,17 @@ +LIBRARY api-ms-win-core-processenvironment-l1-1-0 + +EXPORTS + +ExpandEnvironmentStringsA@12 +ExpandEnvironmentStringsW@12 +FreeEnvironmentStringsA@4 +FreeEnvironmentStringsW@4 +GetEnvironmentStrings@0 +GetEnvironmentStringsW@0 +GetEnvironmentVariableA@12 +GetEnvironmentVariableW@12 +GetStdHandle@4 +SetEnvironmentVariableA@8 +SetEnvironmentVariableW@8 +SetStdHandle@8 +SetStdHandleEx@12
diff --git a/mingw-w64-headers/include/processenv.h b/mingw-w64-headers/include/processenv.h index 7fb0b01..81c5436 100644 --- a/mingw-w64-headers/include/processenv.h +++ b/mingw-w64-headers/include/processenv.h
@@ -15,32 +15,14 @@ #endif #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) - WINBASEAPI LPCH WINAPI GetEnvironmentStrings (VOID); - WINBASEAPI LPWCH WINAPI GetEnvironmentStringsW (VOID); WINBASEAPI WINBOOL WINAPI SetEnvironmentStringsW (LPWCH NewEnvironment); #ifdef UNICODE -#define GetEnvironmentStrings GetEnvironmentStringsW #define SetEnvironmentStrings SetEnvironmentStringsW -#else -#define GetEnvironmentStringsA GetEnvironmentStrings #endif - WINBASEAPI WINBOOL WINAPI FreeEnvironmentStringsA (LPCH penv); - WINBASEAPI WINBOOL WINAPI FreeEnvironmentStringsW (LPWCH penv); - WINBASEAPI HANDLE WINAPI GetStdHandle (DWORD nStdHandle); - WINBASEAPI WINBOOL WINAPI SetStdHandle (DWORD nStdHandle, HANDLE hHandle); -#if _WIN32_WINNT >= 0x0600 - WINBASEAPI WINBOOL WINAPI SetStdHandleEx (DWORD nStdHandle, HANDLE hHandle, PHANDLE phPrevValue); -#endif WINBASEAPI LPSTR WINAPI GetCommandLineA (VOID); WINBASEAPI LPWSTR WINAPI GetCommandLineW (VOID); - WINBASEAPI DWORD WINAPI GetEnvironmentVariableA (LPCSTR lpName, LPSTR lpBuffer, DWORD nSize); - WINBASEAPI DWORD WINAPI GetEnvironmentVariableW (LPCWSTR lpName, LPWSTR lpBuffer, DWORD nSize); - WINBASEAPI WINBOOL WINAPI SetEnvironmentVariableA (LPCSTR lpName, LPCSTR lpValue); - WINBASEAPI WINBOOL WINAPI SetEnvironmentVariableW (LPCWSTR lpName, LPCWSTR lpValue); - WINBASEAPI DWORD WINAPI ExpandEnvironmentStringsA (LPCSTR lpSrc, LPSTR lpDst, DWORD nSize); - WINBASEAPI DWORD WINAPI ExpandEnvironmentStringsW (LPCWSTR lpSrc, LPWSTR lpDst, DWORD nSize); WINBASEAPI WINBOOL WINAPI SetCurrentDirectoryA (LPCSTR lpPathName); WINBASEAPI WINBOOL WINAPI SetCurrentDirectoryW (LPCWSTR lpPathName); WINBASEAPI DWORD WINAPI GetCurrentDirectoryA (DWORD nBufferLength, LPSTR lpBuffer); @@ -50,14 +32,42 @@ WINBASEAPI WINBOOL WINAPI NeedCurrentDirectoryForExePathA (LPCSTR ExeName); WINBASEAPI WINBOOL WINAPI NeedCurrentDirectoryForExePathW (LPCWSTR ExeName); -#define ExpandEnvironmentStrings __MINGW_NAME_AW(ExpandEnvironmentStrings) -#define FreeEnvironmentStrings __MINGW_NAME_AW(FreeEnvironmentStrings) #define GetCommandLine __MINGW_NAME_AW(GetCommandLine) #define GetCurrentDirectory __MINGW_NAME_AW(GetCurrentDirectory) -#define GetEnvironmentVariable __MINGW_NAME_AW(GetEnvironmentVariable) #define NeedCurrentDirectoryForExePath __MINGW_NAME_AW(NeedCurrentDirectoryForExePath) #define SearchPath __MINGW_NAME_AW(SearchPath) #define SetCurrentDirectory __MINGW_NAME_AW(SetCurrentDirectory) + +#endif + +#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || _WIN32_WINNT >= _WIN32_WINNT_WIN10 + + WINBASEAPI LPCH WINAPI GetEnvironmentStrings (VOID); + WINBASEAPI LPWCH WINAPI GetEnvironmentStringsW (VOID); + +#ifdef UNICODE +#define GetEnvironmentStrings GetEnvironmentStringsW +#else +#define GetEnvironmentStringsA GetEnvironmentStrings +#endif + + WINBASEAPI HANDLE WINAPI GetStdHandle (DWORD nStdHandle); + WINBASEAPI DWORD WINAPI ExpandEnvironmentStringsA (LPCSTR lpSrc, LPSTR lpDst, DWORD nSize); + WINBASEAPI DWORD WINAPI ExpandEnvironmentStringsW (LPCWSTR lpSrc, LPWSTR lpDst, DWORD nSize); + WINBASEAPI WINBOOL WINAPI FreeEnvironmentStringsA (LPCH penv); + WINBASEAPI WINBOOL WINAPI FreeEnvironmentStringsW (LPWCH penv); + WINBASEAPI DWORD WINAPI GetEnvironmentVariableA (LPCSTR lpName, LPSTR lpBuffer, DWORD nSize); + WINBASEAPI DWORD WINAPI GetEnvironmentVariableW (LPCWSTR lpName, LPWSTR lpBuffer, DWORD nSize); + WINBASEAPI WINBOOL WINAPI SetEnvironmentVariableA (LPCSTR lpName, LPCSTR lpValue); + WINBASEAPI WINBOOL WINAPI SetEnvironmentVariableW (LPCWSTR lpName, LPCWSTR lpValue); + WINBASEAPI WINBOOL WINAPI SetStdHandle (DWORD nStdHandle, HANDLE hHandle); +#if _WIN32_WINNT >= 0x0600 + WINBASEAPI WINBOOL WINAPI SetStdHandleEx (DWORD nStdHandle, HANDLE hHandle, PHANDLE phPrevValue); +#endif + +#define ExpandEnvironmentStrings __MINGW_NAME_AW(ExpandEnvironmentStrings) +#define FreeEnvironmentStrings __MINGW_NAME_AW(FreeEnvironmentStrings) +#define GetEnvironmentVariable __MINGW_NAME_AW(GetEnvironmentVariable) #define SetEnvironmentVariable __MINGW_NAME_AW(SetEnvironmentVariable) #endif