Fix over again.

This commit is contained in:
love-code-yeyixiao 2024-03-16 11:10:08 +08:00
parent eb9d4f2b1a
commit dd21b8cb1f
1 changed files with 91 additions and 90 deletions

View File

@ -323,74 +323,6 @@ _FX BOOL Gui_StretchBlt(
}
return ret;
}
HBITMAP bmp = NULL;
_FX HDC Gui_CreateDCA(LPCSTR pwszDriver, LPCSTR pwszDevice, LPCSTR pszPort, const void* pdm) {
HDC ret = __sys_CreateDCA(pwszDriver, pwszDevice, pszPort, pdm);
if (SbieApi_QueryConfBool(NULL, L"IsBlockCapture", FALSE)) {
if (pwszDevice == NULL && strcmp(pwszDriver, "DISPLAY") == 0) {
typedef HDC(*P_CreateCompatibleDC)(HDC hdc);
//typedef BOOL(*P_DeleteDC)(HDC hdc);
GET_WIN_API(CreateCompatibleDC, DllName_gdi32);
GET_WIN_API(DeleteDC, DllName_gdi32);
int iWidth, iHeight;
HDC ret2 = CreateCompatibleDC(ret);
iWidth = GetDeviceCaps(ret, HORZRES);
iHeight = GetDeviceCaps(ret, VERTRES);
HBITMAP hBmp;
if (bmp == NULL)
bmp = CreateCompatibleBitmap(ret2, iWidth, iHeight);
hBmp = bmp;
SelectObject(ret2, hBmp);
DeleteDC(ret);
ret = ret2;
}
}
return ret;
}
_FX HDC Gui_CreateDCW(LPCWSTR pwszDriver, LPCWSTR pwszDevice, LPCWSTR pszPort, const void* pdm) {
#ifdef _WIN64
HDC ret = __sys_CreateDCW(pwszDriver, pwszDevice, pszPort, pdm);
#else
HDC ret = Gdi_CreateDCW2(pwszDriver, pwszDevice, pszPort, pdm);
#endif // _WIN64
if (SbieApi_QueryConfBool(NULL, L"IsBlockCapture", FALSE)) {
if (pwszDevice == NULL && lstrcmp(pwszDriver, L"DISPLAY") == 0) {
typedef HDC(*P_CreateCompatibleDC)(HDC hdc);
//typedef BOOL(*P_DeleteDC)(HDC hdc);
GET_WIN_API(CreateCompatibleDC, DllName_gdi32);
GET_WIN_API(DeleteDC, DllName_gdi32);
int iWidth, iHeight;
HDC ret2 = CreateCompatibleDC(ret);
iWidth = GetDeviceCaps(ret, HORZRES);
iHeight = GetDeviceCaps(ret, VERTRES);
HBITMAP hBmp;
if (bmp == NULL)
bmp = CreateCompatibleBitmap(ret2, iWidth, iHeight);
hBmp = bmp;
SelectObject(ret2, hBmp);
DeleteDC(ret);
ret = ret2;
}
}
return ret;
}
//---------------------------------------------------------------------------
// Gdi_SplWow64
//---------------------------------------------------------------------------
_FX void Gdi_SplWow64(BOOLEAN Register)
{
//
@ -475,6 +407,75 @@ _FX HDC Gdi_CreateDCW2(
}
#endif ! _WIN64
HBITMAP bmp2 = NULL;
_FX HDC Gui_CreateDCA(LPCSTR pwszDriver, LPCSTR pwszDevice, LPCSTR pszPort, const void* pdm) {
HDC ret = __sys_CreateDCA(pwszDriver, pwszDevice, pszPort, pdm);
if (SbieApi_QueryConfBool(NULL, L"IsBlockCapture", FALSE)) {
if (pwszDevice == NULL && strcmp(pwszDriver, "DISPLAY") == 0) {
typedef HDC(*P_CreateCompatibleDC)(HDC hdc);
//typedef BOOL(*P_DeleteDC)(HDC hdc);
GET_WIN_API(CreateCompatibleDC, DllName_gdi32);
GET_WIN_API(DeleteDC, DllName_gdi32);
int iWidth, iHeight;
HDC ret2 = CreateCompatibleDC(ret);
iWidth = GetDeviceCaps(ret, HORZRES);
iHeight = GetDeviceCaps(ret, VERTRES);
HBITMAP hBmp;
if (bmp2 == NULL)
bmp2 = CreateCompatibleBitmap(ret2, iWidth, iHeight);
hBmp = bmp2;
SelectObject(ret2, hBmp);
DeleteDC(ret);
ret = ret2;
}
}
return ret;
}
_FX HDC Gui_CreateDCW(LPCWSTR pwszDriver, LPCWSTR pwszDevice, LPCWSTR pszPort, const void* pdm) {
#ifdef _WIN64
HDC ret = __sys_CreateDCW(pwszDriver, pwszDevice, pszPort, pdm);
#else
HDC ret = Gdi_CreateDCW2(pwszDriver, pwszDevice, pszPort, pdm);
#endif // _WIN64
if (SbieApi_QueryConfBool(NULL, L"IsBlockCapture", FALSE)) {
if (pwszDevice == NULL && lstrcmp(pwszDriver, L"DISPLAY") == 0) {
typedef HDC(*P_CreateCompatibleDC)(HDC hdc);
//typedef BOOL(*P_DeleteDC)(HDC hdc);
GET_WIN_API(CreateCompatibleDC, DllName_gdi32);
GET_WIN_API(DeleteDC, DllName_gdi32);
int iWidth, iHeight;
HDC ret2 = CreateCompatibleDC(ret);
iWidth = GetDeviceCaps(ret, HORZRES);
iHeight = GetDeviceCaps(ret, VERTRES);
HBITMAP hBmp;
if (bmp2 == NULL)
bmp2 = CreateCompatibleBitmap(ret2, iWidth, iHeight);
hBmp = bmp2;
SelectObject(ret2, hBmp);
DeleteDC(ret);
ret = ret2;
}
}
return ret;
}
//---------------------------------------------------------------------------
// Gdi_SplWow64
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------