Zhiyi Zhang (@zhiyi) commented about dlls/win32u/sysparams.c:
b_height = b->dmPelsWidth; }
- if (!(a->dmFields & DM_DISPLAYFLAGS)) a_interlaced = FALSE;
- else a_interlaced = !!(a->dmDisplayFlags & DM_INTERLACED);
- if (!(b->dmFields & DM_DISPLAYFLAGS)) b_interlaced = FALSE;
- else b_interlaced = !!(b->dmDisplayFlags & DM_INTERLACED);
- if (!(a->dmFields & DM_DISPLAYFIXEDOUTPUT)) a_stretched = FALSE;
- else a_stretched = a->dmDisplayFixedOutput == DMDFO_STRETCH;
- if (!(b->dmFields & DM_DISPLAYFIXEDOUTPUT)) b_stretched = FALSE;
- else b_stretched = b->dmDisplayFixedOutput == DMDFO_STRETCH;
So a/b_stretched will either be TRUE or FALSE. But there are DMDFO_DEFAULT, DMDFO_CENTER, and DMDFO_STRETCH. That doesn't seem right.
Also, you did verify on Windows that interlaced and dmDisplayFixedOutput are in ascending order, right?
I prefer these codes to be moved right before their use so we can save a few CPU cycles if the check can return early. The same can be said for width and height. It probably doesn't matter with modern compiler optimization, but still...