Zhiyi Zhang (@zhiyi) commented about dlls/winex11.drv/display.c:
return FALSE; }
- memcpy(devmode, (BYTE *)cached_modes + (sizeof(*cached_modes) + cached_modes[0].dmDriverExtra) * n, sizeof(*devmode));
- mode = *(DEVMODEW *)((BYTE *)cached_modes + (sizeof(*cached_modes) + cached_modes[0].dmDriverExtra) * n); pthread_mutex_unlock( &settings_mutex );
-done:
- /* Set generic fields */
- devmode->dmSize = FIELD_OFFSET(DEVMODEW, dmICMMethod);
- devmode->dmDriverExtra = 0;
- devmode->dmSpecVersion = DM_SPECVERSION;
- devmode->dmDriverVersion = DM_SPECVERSION;
- lstrcpyW(devmode->dmDeviceName, dev_name);
- memcpy( &devmode->dmFields, &mode.dmFields, devmode->dmSize - offsetof(DEVMODEW, dmFields) ); return TRUE;
You should move this memcpy() before pthread_mutex_unlock().