mirror of
https://github.com/rapid7/metasploit-payloads
synced 2025-02-16 00:24:29 +01:00
Land #220, Support Hi DPI for screenshots
This commit is contained in:
commit
7ae31a76f1
@ -147,8 +147,8 @@ DWORD screenshot( int quality, DWORD dwPipeName )
|
||||
// prevent breaking functionality on <= NT 4.0
|
||||
if (os.dwMajorVersion >= 4)
|
||||
{
|
||||
sxpos = GetSystemMetrics(xposition);
|
||||
sypos = GetSystemMetrics(yposition);
|
||||
sxpos = GetSystemMetrics(SM_XVIRTUALSCREEN);
|
||||
sypos = GetSystemMetrics(SM_YVIRTUALSCREEN);
|
||||
}
|
||||
|
||||
|
||||
@ -163,8 +163,10 @@ DWORD screenshot( int quality, DWORD dwPipeName )
|
||||
|
||||
// BitBlt the screenshot of this sessions default input desktop on WinSta0 onto the memory DC we created
|
||||
// screenshot all available monitors by default
|
||||
if( !BitBlt( hmemdc, 0, 0, sx, sy, hdc, sxpos, sypos, SRCCOPY ) )
|
||||
BREAK_ON_ERROR( "[SCREENSHOT] screenshot. BitBlt failed" );
|
||||
|
||||
SetProcessDPIAware();
|
||||
if (!StretchBlt(hmemdc, 0, 0, sx, sy, hdc, sxpos, sypos, GetSystemMetrics(SM_CXVIRTUALSCREEN), GetSystemMetrics(SM_CYVIRTUALSCREEN), SRCCOPY))
|
||||
BREAK_ON_ERROR("[SCREENSHOT] screenshot. StretchBlt failed");
|
||||
|
||||
// finally convert the BMP we just made into a JPEG...
|
||||
if( bmp2jpeg( hbmp, hmemdc, quality, &pJpegBuffer, &dwJpegSize ) != 1 )
|
||||
|
Loading…
Reference in New Issue
Block a user