Huw Davies (@huw) commented about dlls/winspool.drv/info.c:
#undef F_SIZE }; int i;
const DWORD offFields = FIELD_OFFSET(DEVMODEW, dmFields) + sizeof(dm->dmFields);
if (!dm) return FALSE;
- if (size < FIELD_OFFSET(DEVMODEW, dmFields) + sizeof(dm->dmFields)) return FALSE;
- if (size < offFields) return FALSE;
- if (dm->dmSize < offFields || size < dm->dmSize + dm->dmDriverExtra) return FALSE;
- if (((dm->dmSize - offFields) % 4) && dm->dmDriverExtra) return FALSE;
This last check doesn't make a huge amount of sense - it may be what Windows ends up doing, but no sane app is going to depend on this. Could we remove that check and trim the tests so they don't probe this behaviour?