DWM and 50% CPU Usage

T

Tumanov Sergey

Hyper-V virtual machine with Windows Server 2012R2 (last updates are installed)

My test application just call (every 10 milisecs) (for video recording):


sWidth := GetSystemMetrics(SM_CXSCREEN);
sHeight := GetSystemMetrics(SM_CYSCREEN);

hDeskWin := GetDesktopWindow;
hScrDC := GetDC(hDeskWin);
with bitmap_info.bmiHeader do
begin
biSize := sizeof(BITMAPINFOHEADER);
biWidth := sWidth;
//Use negative height to scan top-down.
biHeight := -sHeight;
biPlanes := 1;
biBitCount := GetDeviceCaps(hScrDC, BITSPIXEL);
biCompression := BI_RGB;
end;
pBits := nil;
hBmp := CreateDIBSection(hScrDC, bitmap_info, DIB_RGB_COLORS, pBits, 0, 0)

hMemDC := CreateCompatibleDC(hScrDC);
hOld := SelectObject(hMemDC, hBmp);
mResult := BitBlt(hMemDC, 0, 0, sWidth, sHeight, hScrDC, 0, 0, SRCCOPY);

if hMemDC <> 0 then
DeleteObject(hMemDC);
if hBmp <> 0 then
DeleteObject(hBmp);
ReleaseDC(hDeskWin, hScrDC);



and i got ... dmw.exe 50% CPU Usage


on host machine with Windows Server 2012R2 (last updates are installed) it works fine...

Continue reading...
 
Back
Top Bottom