On Thu, 15 Feb 2024 09:25:26 GMT, Alexey Ivanov <aiva...@openjdk.org> wrote:
>> Christoph Langer has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Add comments > > 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? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17614#discussion_r1491754945