[WIN32SS][NTGDI] Alignment probe change in NtGdiSetBitmapBits (#1309)
authorKatayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
Sun, 27 Jan 2019 07:11:23 +0000 (16:11 +0900)
committerGitHub <noreply@github.com>
Sun, 27 Jan 2019 07:11:23 +0000 (16:11 +0900)
Don't check WORD alignment in NtGdiSetBitmapBits to match Win2k3 behaviour. CORE-15657

win32ss/gdi/ntgdi/bitmaps.c

index e003640..c982599 100644 (file)
@@ -642,7 +642,8 @@ NtGdiSetBitmapBits(
 
     _SEH2_TRY
     {
 
     _SEH2_TRY
     {
-        ProbeForRead(pUnsafeBits, Bytes, sizeof(WORD));
+        /* NOTE: Win2k3 doesn't check WORD alignment here. */
+        ProbeForRead(pUnsafeBits, Bytes, 1);
         ret = UnsafeSetBitmapBits(psurf, Bytes, pUnsafeBits);
     }
     _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
         ret = UnsafeSetBitmapBits(psurf, Bytes, pUnsafeBits);
     }
     _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)