Pretty simple thing, I want to use GetThreadInformation() from the windows API. Usage seems pretty simple from its documentation, but it fails. Code:
THREAD_POWER_THROTTLING_STATE state{};
const bool return_value = GetThreadInformation(
GetCurrentThread(),
ThreadPowerThrottling,
&state,
sizeof(THREAD_POWER_THROTTLING_STATE)
);
Return value is always false, which indicates an error. GetLastError() indicates a wrong parameter. The documentation does talk about that the thread needs to have the proper rights. But GetCurrentThread() documentation clearly states that it returns a handle with THREAD_ALL_ACCESS rights. So what's wrong? This is on Win10.