Skip to content

Update OS minimum version and remove XP runtime detection #1192

Description

Currently STL has to target Vista as minimum OS version for x86 and x64

Update filesystem.cpp

#if _STL_WIN32_WINNT < _WIN32_WINNT_VISTA
using _GetFinalPathNameByHandleW_t = decltype(&GetFinalPathNameByHandleW);
_GetFinalPathNameByHandleW_t GetFinalPathNameByHandleW_p{};
unsigned long __stdcall _Not_supported_GetFinalPathNameByHandleW(HANDLE, wchar_t*, unsigned long, unsigned long) {
SetLastError(ERROR_NOT_SUPPORTED);
return 0;
}
#define __vcrt_GetFinalPathNameByHandleW \
(_Runtime_dynamic_link(&GetFinalPathNameByHandleW_p, L"kernel32.dll", "GetFinalPathNameByHandleW", \
&_Not_supported_GetFinalPathNameByHandleW))
#else // ^^^ _STL_WIN32_WINNT < _WIN32_WINNT_VISTA ^^^ // vvv _STL_WIN32_WINNT >= _WIN32_WINNT_VISTA vvv
#define __vcrt_GetFinalPathNameByHandleW GetFinalPathNameByHandleW
#endif // _STL_WIN32_WINNT < _WIN32_WINNT_VISTA
// MACRO __vcrt_GetFileInformationByHandleEx
#if _STL_WIN32_WINNT < _WIN32_WINNT_VISTA
using _GetFileInformationByHandleEx_t = decltype(&GetFileInformationByHandleEx);
_GetFileInformationByHandleEx_t _GetFileInformationByHandleEx_p{};
BOOL __stdcall _Not_supported_GetFileInformationByHandleEx(
HANDLE, FILE_INFO_BY_HANDLE_CLASS, void*, unsigned long) {
SetLastError(ERROR_NOT_SUPPORTED);
return 0;
}
#define __vcrt_GetFileInformationByHandleEx \
(_Runtime_dynamic_link(&_GetFileInformationByHandleEx_p, L"kernel32.dll", "GetFileInformationByHandleEx", \
&_Not_supported_GetFileInformationByHandleEx))
struct _GetFileInfoByHandleEx {
const _GetFileInformationByHandleEx_t _Fn = __vcrt_GetFileInformationByHandleEx;
[[nodiscard]] bool _Supported() const noexcept {
return _Fn != _Not_supported_GetFileInformationByHandleEx;
}
[[nodiscard]] auto operator()(const HANDLE _Handle, const FILE_INFO_BY_HANDLE_CLASS _Class, void* const _Info,
const unsigned long _Size) const noexcept {
return _Fn(_Handle, _Class, _Info, _Size);
}
};
#else // ^^^ _STL_WIN32_WINNT < _WIN32_WINNT_VISTA ^^^ // vvv _STL_WIN32_WINNT >= _WIN32_WINNT_VISTA vvv

Update awint.hpp / winapisupp.cpp

Note: the ABI compatibility for XP toolset should stay. The XP toolset should build; it just doesn't need to support Windows XP anymore.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixedSomething works now, yay!performanceMust go faster

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions