https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4860aa645ce956fcf8494c151fab6648cef785f2

commit 4860aa645ce956fcf8494c151fab6648cef785f2
Author:     Timo Kreuzer <[email protected]>
AuthorDate: Sat Mar 14 18:45:51 2020 +0100
Commit:     Timo Kreuzer <[email protected]>
CommitDate: Sun Mar 22 12:05:05 2020 +0100

    [WINSRV] Use DIB section for frame buffer bitmap
---
 win32ss/user/winsrv/consrv/frontends/gui/conwnd.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c 
b/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c
index f79ad141b2c..8770eca88ab 100644
--- a/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c
+++ b/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c
@@ -250,7 +250,7 @@ CreateSysMenu(HWND hWnd)
     if (ptrTab)
     {
         *ptrTab = L'\0';
-        mii.cch = wcslen(szMenuStringBack);
+        mii.cch = (UINT)wcslen(szMenuStringBack);
 
         SetMenuItemInfoW(hMenu, SC_CLOSE, FALSE, &mii);
     }
@@ -2164,6 +2164,20 @@ GuiConsoleHandleScrollbarMenu(VOID)
 }
 */
 
+HBITMAP
+CreateFrameBufferBitmap(HDC hDC, int width, int height)
+{
+    BITMAPINFO bmi;
+    ZeroMemory(&bmi, sizeof(BITMAPINFO));
+    bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+    bmi.bmiHeader.biWidth = width;
+    bmi.bmiHeader.biHeight = height;
+    bmi.bmiHeader.biPlanes = 1;
+    bmi.bmiHeader.biBitCount = GetDeviceCaps(hDC, BITSPIXEL);
+    bmi.bmiHeader.biCompression = BI_RGB;
+    return CreateDIBSection(NULL, &bmi, DIB_RGB_COLORS, NULL, NULL, 0);
+}
+
 static LRESULT CALLBACK
 ConWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 {
@@ -2505,7 +2519,7 @@ ConWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM 
lParam)
 
             /* Recreate the framebuffer */
             hDC  = GetDC(GuiData->hWindow);
-            hnew = CreateCompatibleBitmap(hDC, Width, Height);
+            hnew = CreateFrameBufferBitmap(hDC, Width, Height);
             ReleaseDC(GuiData->hWindow, hDC);
             hold = SelectObject(GuiData->hMemDC, hnew);
             if (GuiData->hBitmap)

Reply via email to