On Thu, 15 Feb 2024 22:46:54 GMT, Christoph Langer <clan...@openjdk.org> wrote:

>> src/java.desktop/windows/native/libawt/windows/Devices.cpp line 102:
>> 
>>> 100:     memset((void*)(&mieInfo), 0, sizeof(MONITORINFOEX));
>>> 101:     mieInfo.cbSize = sizeof(MONITORINFOEX);
>>> 102:     if (TRUE == ::GetMonitorInfo(hMon, (LPMONITORINFOEX)(&mieInfo))) {
>> 
>> The documentation for 
>> [`GetMonitorInfo`](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getmonitorinfow)
>>  says, _<q 
>> cite="https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getmonitorinfow#return-value";>If
>>  the function succeeds, the return value is nonzero. If the function fails, 
>> the return value is zero.</q>_
>> 
>> Whereas `TRUE == 1`; therefore the condition should be != 0 or rather simply 
>> `if (::GetMonitorInfo(/*params*/))`.
>
> Right, that's what's written. But (in the documentation,) the function is 
> declared as `BOOL GetMonitorInfoW...`. So I could epxect return values of 
> TRUE/FALSE, no?

Addressed.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/17614#discussion_r1492136065

Reply via email to