1
0
mirror of https://github.com/DxWnd/DxWnd.reloaded synced 2024-12-30 09:25:35 +01:00

v2_02_95_src

Former-commit-id: 1f95c954fdb504821a546455bf46c232ec9a8bc6
This commit is contained in:
gho tik 2014-12-10 11:39:52 -05:00 committed by Refael ACkermann
parent d722681922
commit 99db43a102
39 changed files with 437 additions and 169 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f3a3c1ff5c9ff0497a5155abf197a32ac7481a31130d4c441ece3e50b022e6eb
size 525312
oid sha256:768707a31acc1f63671cfd55c5a50d061b29db777bdf61b5439a42dea27c7c6a
size 525824

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f379180ba2b97d28926280bc4a1b02ed95f3f90cd191aa3fa94d4757bdd106b3
oid sha256:d802959c3ec0c17b5e1e7d58672c91b0223a9b3285725418cb44a73bbfe5b3d4
size 558592

View File

@ -8,7 +8,7 @@ coord0=0
flag0=134234150
flagg0=1207959552
flagh0=20
flagi0=4
flagi0=4194308
tflag0=0
initx0=0
inity0=0
@ -22,3 +22,7 @@ sizx0=800
sizy0=600
maxfps0=0
initts0=0
launchpath0=
flagj0=128
winver0=0
maxres0=0

View File

@ -6,9 +6,9 @@ opengllib0=
ver0=0
coord0=0
flag0=134234146
flagg0=134217728
flagg0=1207959552
flagh0=20
flagi0=0
flagi0=4194304
tflag0=192
initx0=0
inity0=0
@ -22,3 +22,7 @@ sizx0=800
sizy0=600
maxfps0=0
initts0=0
launchpath0=
flagj0=128
winver0=0
maxres0=0

View File

@ -25,3 +25,4 @@ initts0=0
launchpath0=
winver0=0
maxres0=0
flagj0=128

View File

@ -9,7 +9,7 @@ coord0=0
flag0=134218272
flagg0=1207959552
flagh0=20
flagi0=4
flagi0=4194308
tflag0=0
initx0=0
inity0=0
@ -25,3 +25,4 @@ maxfps0=0
initts0=0
winver0=0
maxres0=-1
flagj0=128

View File

@ -8,7 +8,7 @@ coord0=0
flag0=134217762
flagg0=1207959552
flagh0=20
flagi0=0
flagi0=4194304
tflag0=0
initx0=0
inity0=0
@ -22,3 +22,7 @@ sizx0=800
sizy0=600
maxfps0=0
initts0=0
launchpath0=
flagj0=128
winver0=0
maxres0=2

View File

@ -0,0 +1,28 @@
[target]
title0=Kingpin Life Of Crime (intro)
path0=D:\Games\Kingpin Life Of Crime\kpintro.exe
launchpath0=
module0=
opengllib0=
ver0=0
coord0=0
flag0=134217762
flagg0=1207959552
flagh0=20
flagi0=134218756
flagj0=128
tflag0=0
initx0=0
inity0=0
minx0=0
miny0=0
maxx0=0
maxy0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1

View File

@ -0,0 +1,28 @@
[target]
title0=Kingpin Life Of Crime
path0=D:\Games\Kingpin Life Of Crime\kingpin.exe
launchpath0=
module0=
opengllib0=3dfxgl.dll
ver0=9
coord0=0
flag0=134234400
flagg0=1744830464
flagh0=21
flagi0=-2009071610
flagj0=128
tflag0=6147
initx0=0
inity0=0
minx0=0
miny0=0
maxx0=0
maxy0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1

View File

@ -0,0 +1,28 @@
[target]
title0=Knights_And_Merchants (1024)
path0=D:\Games\Knights_And_Merchants_-_The_Shattered_Kingdom\KaM_1024.exe
launchpath0=
module0=
opengllib0=
ver0=0
coord0=0
flag0=134217762
flagg0=1207959552
flagh0=20
flagi0=138412036
flagj0=128
tflag0=0
initx0=0
inity0=0
minx0=0
miny0=0
maxx0=0
maxy0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1

View File

@ -0,0 +1,28 @@
[target]
title0=Knights_And_Merchants (800)
path0=D:\Games\Knights_And_Merchants_-_The_Shattered_Kingdom\KaM_800.exe
launchpath0=
module0=
opengllib0=
ver0=0
coord0=0
flag0=134217762
flagg0=1207959552
flagh0=20
flagi0=134217732
flagj0=128
tflag0=0
initx0=0
inity0=0
minx0=0
miny0=0
maxx0=0
maxy0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1

View File

@ -0,0 +1,28 @@
[target]
title0=Shadow Watch
path0=D:\Games\Shadow Watch\sw.exe
launchpath0=D:\Games\Shadow Watch\ShadowWatch.exe
module0=dx.dll
opengllib0=
ver0=1
coord0=0
flag0=-2013265869
flagg0=1241513984
flagh0=4259856
flagi0=203423748
flagj0=128
tflag0=0
initx0=200
inity0=290
minx0=0
miny0=0
maxx0=800
maxy0=600
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1

View File

@ -0,0 +1,28 @@
[target]
title0=Star Wars Episode I Racer (emulated)
path0=D:\Games\Star Wars Episode 1 racer\SWEP1RCR.EXE
launchpath0=
module0=
opengllib0=
ver0=0
coord0=0
flag0=679493671
flagg0=1210056720
flagh0=8212
flagi0=2097172
flagj0=136
tflag0=0
initx0=0
inity0=0
minx0=0
miny0=0
maxx0=0
maxy0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=0

28
build/exports/Thorgal.dxw Normal file
View File

@ -0,0 +1,28 @@
[target]
title0=Thorgal
path0=D:\Games\Thorgal\THORGAL.exe
launchpath0=
module0=
opengllib0=
ver0=0
coord0=0
flag0=136314914
flagg0=1242038528
flagh0=65552
flagi0=136314885
flagj0=136
tflag0=0
initx0=0
inity0=0
minx0=0
miny0=0
maxx0=0
maxy0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1

View File

@ -6,7 +6,7 @@ module0=
opengllib0=
ver0=0
coord0=0
flag0=134480416
flag0=134218272
flagg0=1207959552
flagh0=20
flagi0=4194308
@ -25,4 +25,4 @@ maxfps0=0
initts0=0
winver0=0
maxres0=-1
flagj0=0
flagj0=128

View File

@ -1,5 +1,5 @@
[window]
posx=1036
posy=444
sizx=320
sizy=200
posx=1347
posy=477
sizx=417
sizy=450

View File

@ -616,3 +616,10 @@ fix: debug option "highlight blit to primary" was causing game crashes when the
fix: trapped sporadic CloseHandle(hMenu) crashes in a try/catch clause.
fix: attempt to fix FIXD3DFRAME option
fix: added SetStretchBltMode(hdc,HALFTONE) to SetDIBitsToDevice hooker to improve stretching: fixes "Celtic Kings Rage of War"
v2.02.95
fix: handling of limit resolution field
fix: FPS handling to screen updated made by SetDIBitsToDevice
fix: PeekMessage implementation with "Peek all message in queue": fixes "Shadow Watch"
fix: missing hook to CreateProcess - needed for "Suppress child process creation".
fix: exception for bilinear filtering applied to certain games (e.g. "Shadow Watch")

View File

@ -33,11 +33,39 @@ FARPROC Remap_AdvApi32_ProcAddress(LPCSTR proc, HMODULE hModule)
#define HKEY_MASK 0x7FFFFF00
#define IsFake(hKey) (((DWORD)hKey & HKEY_MASK) == HKEY_MASK)
static FILE *OpenFakeRegistry();
static char *hKey2String(HKEY hKey)
{
char *skey;
static char sKey[MAX_PATH+1];
static char skeybuf[10];
if(IsFake(hKey)) return "HKEY_FAKE";
if(IsFake(hKey)) {
FILE *regf;
char RegBuf[MAX_PATH+1];
regf=OpenFakeRegistry();
if(regf!=NULL){
HKEY hLocalKey=HKEY_FAKE;
fgets(RegBuf, 256, regf);
while (!feof(regf)){
if(RegBuf[0]=='['){
if(hLocalKey == hKey){
OutTrace("building fake Key=\"%s\" hKey=%x\n", sKey, hKey);
fclose(regf);
strcpy(sKey, &RegBuf[1]);
sKey[strlen(sKey)-2]=0; // get rid of "]"
return sKey;
}
else {
hLocalKey--;
}
}
fgets(RegBuf, 256, regf);
}
fclose(regf);
}
return "HKEY_NOT_FOUND";
}
switch((ULONG)hKey){
case HKEY_CLASSES_ROOT: skey="HKEY_CLASSES_ROOT"; break;
case HKEY_CURRENT_CONFIG: skey="HKEY_CURRENT_CONFIG"; break;
@ -74,7 +102,7 @@ static LONG myRegOpenKeyEx(
char RegBuf[MAX_PATH+1];
sprintf(sKey,"%s\\%s", hKey2String(hKey), lpSubKey);
OutTraceDW("RegOpenKeyEx: searching for key=\"%s\"\n", sKey);
OutTraceR("RegOpenKeyEx: searching for key=\"%s\"\n", sKey);
regf=OpenFakeRegistry();
if(regf!=NULL){
@ -181,7 +209,7 @@ LONG WINAPI extRegQueryValueEx(
else {
if(hCurKey==hKey){
//OutTraceDW("loop: \"%s\"\n", RegBuf);
//OutTrace("loop: \"%s\"\n", RegBuf);
if((RegBuf[0]=='"') &&
!strncmp(lpValueName, &RegBuf[1], strlen(lpValueName)) &&
(RegBuf[strlen(lpValueName)+1]=='"') &&
@ -202,7 +230,7 @@ LONG WINAPI extRegQueryValueEx(
*lpb = 0; // string terminator
if(lpType) *lpType=REG_SZ;
//
OutTraceDW("RegQueryValueEx: Data=\"%s\" type=REG_SZ\n", lpData);
OutTraceR("RegQueryValueEx: Data=\"%s\" type=REG_SZ\n", lpData);
res=ERROR_SUCCESS;
}
if(!strncmp(pData,"dword:",strlen("dword:"))){ //dword value
@ -212,7 +240,7 @@ LONG WINAPI extRegQueryValueEx(
memcpy(lpData, &val, sizeof(DWORD));
if(lpType) *lpType=REG_DWORD;
*lpcbData=sizeof(DWORD);
OutTraceDW("RegQueryValueEx: Data=0x%x type=REG_DWORD\n", val);
OutTraceR("RegQueryValueEx: Data=0x%x type=REG_DWORD\n", val);
res=ERROR_SUCCESS;
}
if(!strncmp(pData,"hex:",strlen("hex:"))){ //dword value
@ -228,7 +256,7 @@ LONG WINAPI extRegQueryValueEx(
lpData++;
(*lpcbData)++;
}
OutTraceDW(" type=REG_BINARY cbData=%d\n", *lpcbData);
OutTraceR(" type=REG_BINARY cbData=%d\n", *lpcbData);
res=ERROR_SUCCESS;
}
fclose(regf);

View File

@ -744,6 +744,8 @@ int HookDirectDraw(HMODULE module, int version)
Unlock4_Type pUnlockMethod(LPDIRECTDRAWSURFACE lpdds)
{
// to do: return extUnlock for unhooked surfaces
char sMsg[81];
void * extUnlock;
__try{ // v2.02.31: catch some possible exception (i.e. Abomination in EMULATION mode)
@ -1939,6 +1941,7 @@ HRESULT WINAPI extSetDisplayMode(int version, LPDIRECTDRAW lpdd,
OutTraceDW("SetDisplayMode: fixing colordepth current=%d required=%d size=(%dx%d)\n",
ddsd.ddpfPixelFormat.dwRGBBitCount, dwbpp, dwwidth, dwheight);
}
if(dxw.dwFlags1 & EMULATESURFACE){
dwbpp = ddsd.ddpfPixelFormat.dwRGBBitCount;
}
@ -1948,8 +1951,10 @@ HRESULT WINAPI extSetDisplayMode(int version, LPDIRECTDRAW lpdd,
else
res = (*pSetDisplayMode2)(lpdd, dwwidth, dwheight, dwbpp, ddsd.dwRefreshRate, 0);
if(res) OutTraceE("SetDisplayMode: error=%x\n", res);
SetVSyncDelays(lpdd);
return 0;
return DD_OK;
}
HRESULT WINAPI extSetDisplayMode2(LPDIRECTDRAW lpdd,
@ -3012,6 +3017,15 @@ HRESULT WINAPI extGetAttachedSurface(int dxversion, GetAttachedSurface_Type pGet
OutTraceE("GetAttachedSurface(%d): ERROR res=%x(%s) at %d\n", dxversion, res, ExplainDDError(res), __LINE__);
else
OutTraceDDRAW("GetAttachedSurface(%d): attached=%x\n", dxversion, *lplpddas);
#if 0
// beware: ddraw 7 surfaces can be created with FLIP capability, hence could have a backbuffer ???
if((res==DDERR_NOTFOUND) && (dxversion==7) && (!IsPrim) && (!IsBack)){
*lplpddas = lpdds;
res = DD_OK;
}
#endif
return res;
}
@ -3161,8 +3175,6 @@ HRESULT WINAPI PrimaryBilinearBlt(LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect,
TmpRect.bottom = ddsd.dwHeight = dwHeight;
TmpRect.right = ddsd.dwWidth = dwWidth;
ddsd.dwFlags = (DDSD_HEIGHT | DDSD_WIDTH | DDSD_CAPS);
// work only on even width surfaces, or you'd have to take in account proper pitch!
// dwWidth = ddsd.dwWidth = ((dwWidth + 1) >> 1) << 1;
// capabilities must cope with primary / backbuffer surface capabilities to get speedy operations
ddsd.ddsCaps.dwCaps = bIs3DPrimarySurfaceDevice ? DDSCAPS_OFFSCREENPLAIN : (DDSCAPS_OFFSCREENPLAIN|DDSCAPS_SYSTEMMEMORY);
res=(*pCreateSurface1)(lpPrimaryDD, (LPDDSURFACEDESC)&ddsd, &lpddsTmp, NULL);
@ -3190,9 +3202,8 @@ HRESULT WINAPI PrimaryBilinearBlt(LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect,
bDestBuf, lpdestrect, DestPitch);
// fast-blit to primary
//(*pUnlockMethod(lpddssrc))(lpddssrc, NULL);
//(*pUnlockMethod(lpddsTmp))(lpddsTmp, NULL);
(*pUnlock1)(lpddssrc, NULL);
if(lpddssrc==lpDDSEmu_Back) lpddssrc->Unlock(NULL); // this surface is unhooked!!!
else (*pUnlock1)(lpddssrc, NULL);
//(*pUnlock1)(lpddsTmp, NULL);
lpddsTmp->Unlock(NULL); // this surface is unhooked!!!
res= (*pBltFast)(lpdds, lpdestrect->left, lpdestrect->top, lpddsTmp, &TmpRect, DDBLTFAST_WAIT);
@ -3374,8 +3385,9 @@ HRESULT WINAPI sBlt(char *api, LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect,
if(dxw.dwFlags5 & NOBLT) return DD_OK;
destrect=dxw.MapWindowRect(lpdestrect);
//OutTraceB("DESTRECT=(%d,%d)-(%d,%d)\n", destrect.left, destrect.top, destrect.right, destrect.bottom);
OutTraceB("DESTRECT=(%d,%d)-(%d,%d) Screen=(%dx%d)\n",
destrect.left, destrect.top, destrect.right, destrect.bottom,
dxw.GetScreenWidth(), dxw.GetScreenHeight());
// =========================
// Blit to primary direct surface
@ -4896,10 +4908,12 @@ HRESULT WINAPI extGetSurfaceDesc1(LPDIRECTDRAWSURFACE lpdds, LPDDSURFACEDESC lpd
switch(lpddsd->dwSize){
case sizeof(DDSURFACEDESC):
if (pGetSurfaceDesc1) return extGetSurfaceDesc(pGetSurfaceDesc1, lpdds, lpddsd);
/**/ if (pGetSurfaceDesc4) return extGetSurfaceDesc((GetSurfaceDesc_Type)pGetSurfaceDesc4, (LPDIRECTDRAWSURFACE)lpdds, (LPDDSURFACEDESC)lpddsd);
//else return lpdds->GetSurfaceDesc((LPDDSURFACEDESC)lpddsd);
if (pGetSurfaceDesc4) return extGetSurfaceDesc((GetSurfaceDesc_Type)pGetSurfaceDesc4, (LPDIRECTDRAWSURFACE)lpdds, (LPDDSURFACEDESC)lpddsd);
break;
case sizeof(DDSURFACEDESC2):
if (pGetSurfaceDesc4) return extGetSurfaceDesc((GetSurfaceDesc_Type)pGetSurfaceDesc4, (LPDIRECTDRAWSURFACE)lpdds, (LPDDSURFACEDESC)lpddsd);
//else return lpdds->GetSurfaceDesc((LPDDSURFACEDESC)lpddsd);
break;
default:
OutTraceDW("GetSurfaceDesc: ASSERT - bad dwSize=%d lpdds=%x at %d\n", lpddsd->dwSize, lpdds, __LINE__);
@ -4917,9 +4931,11 @@ HRESULT WINAPI extGetSurfaceDesc2(LPDIRECTDRAWSURFACE2 lpdds, LPDDSURFACEDESC2 l
switch(lpddsd->dwSize){
case sizeof(DDSURFACEDESC):
if (pGetSurfaceDesc1) return extGetSurfaceDesc(pGetSurfaceDesc1, (LPDIRECTDRAWSURFACE)lpdds, (LPDDSURFACEDESC)lpddsd);
//else return lpdds->GetSurfaceDesc((LPDDSURFACEDESC)lpddsd);
break;
case sizeof(DDSURFACEDESC2):
if (pGetSurfaceDesc4) return extGetSurfaceDesc((GetSurfaceDesc_Type)pGetSurfaceDesc4, (LPDIRECTDRAWSURFACE)lpdds, (LPDDSURFACEDESC)lpddsd);
//else return lpdds->GetSurfaceDesc((LPDDSURFACEDESC)lpddsd);
break;
default:
OutTraceDW("GetSurfaceDesc: ASSERT - bad dwSize=%d lpdds=%x at %d\n", lpddsd->dwSize, lpdds, __LINE__);

View File

@ -1406,8 +1406,7 @@ LRESULT CALLBACK MessageHook(int code, WPARAM wParam, LPARAM lParam)
}
else {
// fix the message point coordinates
msg->pt=dxw.FixMessagePt(dxw.GethWnd(), msg->pt);
//msg->pt=dxw.FixMessagePt(msg->hwnd, msg->pt);
msg->pt=dxw.FixCursorPos(msg->pt);
// beware: needs fix for mousewheel?
if((msg->message <= WM_MOUSELAST) && (msg->message >= WM_MOUSEFIRST)) msg->lParam = MAKELPARAM(msg->pt.x, msg->pt.y);
OutTraceC("MessageHook: fixed lparam/pt=(%d,%d)\n", msg->pt.x, msg->pt.y);

View File

@ -118,11 +118,17 @@ void dxwCore::InitTarget(TARGETMAP *target)
void dxwCore::SetScreenSize(void)
{
SetScreenSize(800, 600); // set to default screen resolution
//SetScreenSize(640, 480); // set to default screen resolution
if(dxw.Windowize)
SetScreenSize(800, 600); // set to default screen resolution
else{
int sizx, sizy;
sizx = GetSystemMetrics(SM_CXSCREEN);
sizy = GetSystemMetrics(SM_CYSCREEN);
SetScreenSize(sizx, sizy);
}
}
void dxwCore::SetScreenSize(int x, int y)
void dxwCore::SetScreenSize(int x, int y)
{
DXWNDSTATUS *p;
OutTraceDW("DXWND: set screen size=(%d,%d)\n", x, y);
@ -147,8 +153,9 @@ void dxwCore::SetScreenSize(int x, int y)
}
if(((DWORD)p->Width > maxw) || ((DWORD)p->Height > maxh)){
OutTraceDW("DXWND: limit device size=(%d,%d)\n", maxw, maxh);
p->Width = (short)maxw;
p->Height = (short)maxh;
// v2.02.95 setting new virtual desktop size
dwScreenWidth = p->Width = (short)maxw;
dwScreenHeight= p->Height = (short)maxh;
}
}
}
@ -461,6 +468,19 @@ POINT dxwCore::FixCursorPos(POINT prev)
if (h) curr.y = (curr.y * dxw.GetScreenHeight()) / h;
}
if(dxw.dwFlags4 & FRAMECOMPENSATION){
static int dx, dy, todo=TRUE;
if (todo){
POINT FrameOffset = dxw.GetFrameOffset();
dx=FrameOffset.x;
dy=FrameOffset.y;
OutTraceC("GetCursorPos: frame compensation=(%d,%d)\n", dx, dy);
todo=FALSE;
}
curr.x += dx;
curr.y += dy;
}
if((dxw.dwFlags1 & ENABLECLIPPING) && lpClipRegion){
// v2.1.93:
// in clipping mode, avoid the cursor position to lay outside the valid rect
@ -645,37 +665,6 @@ RECT dxwCore::MapWindowRect(LPRECT lpRect)
return RetRect;
}
POINT dxwCore::FixMessagePt(HWND hwnd, POINT point)
{
RECT rect;
static POINT curr;
curr=point;
if(!(*pScreenToClient)(hwnd, &curr)){
OutTraceE("ScreenToClient ERROR=%d hwnd=%x at %d\n", GetLastError(), hwnd, __LINE__);
curr.x = curr.y = 0;
}
if (!(*pGetClientRect)(hwnd, &rect)) {
OutTraceE("GetClientRect ERROR=%d hwnd=%x at %d\n", GetLastError(), hwnd, __LINE__);
curr.x = curr.y = 0;
}
#ifdef ISDEBUG
if(IsDebug) OutTrace("FixMessagePt point=(%d,%d) hwnd=%x win pos=(%d,%d) size=(%d,%d)\n",
point.x, point.y, hwnd, point.x-curr.x, point.y-curr.y, rect.right, rect.bottom);
#endif
if (curr.x < 0) curr.x=0;
if (curr.y < 0) curr.y=0;
if (curr.x > rect.right) curr.x=rect.right;
if (curr.y > rect.bottom) curr.y=rect.bottom;
if (rect.right) curr.x = ((curr.x * dxw.GetScreenWidth()) + (rect.right >> 1)) / rect.right;
if (rect.bottom) curr.y = ((curr.y * dxw.GetScreenHeight()) + (rect.bottom >> 1)) / rect.bottom;
return curr;
}
void dxwCore::MapClient(LPRECT rect)
{
RECT client;

View File

@ -63,7 +63,6 @@ public: // methods
void MapWindow(LPRECT);
void MapWindow(int *, int *, int *, int *);
void FixWorkarea(LPRECT);
POINT FixMessagePt(HWND, POINT);
RECT GetScreenRect(void);
RECT GetUnmappedScreenRect();
RECT GetWindowRect(RECT);

View File

@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "dxwnd.h"
#include "dxwcore.hpp"
#define VERSION "2.02.94"
#define VERSION "2.02.95"
#define DDTHREADLOCK 1

Binary file not shown.

View File

@ -326,24 +326,34 @@ int WINAPI extGetDeviceCaps(HDC hdc, int nindex)
OutTraceDW("GetDeviceCaps: fix(1) BITSPIXEL/COLORRES cap=%x\n",res);
return res;
case HORZRES:
res = pSetDevMode->dmPelsWidth;
OutTraceDW("GetDeviceCaps: fix(1) HORZRES cap=%d\n", res);
return res;
if(dxw.Windowize){
res = pSetDevMode->dmPelsWidth;
OutTraceDW("GetDeviceCaps: fix(1) HORZRES cap=%d\n", res);
return res;
}
break;
case VERTRES:
res = pSetDevMode->dmPelsHeight;
OutTraceDW("GetDeviceCaps: fix(1) VERTRES cap=%d\n", res);
return res;
if(dxw.Windowize){
res = pSetDevMode->dmPelsHeight;
OutTraceDW("GetDeviceCaps: fix(1) VERTRES cap=%d\n", res);
return res;
}
break;
}
}
switch(nindex){
case VERTRES:
res= dxw.GetScreenHeight();
OutTraceDW("GetDeviceCaps: fix(2) VERTRES cap=%d\n", res);
if(dxw.Windowize){
res= dxw.GetScreenHeight();
OutTraceDW("GetDeviceCaps: fix(2) VERTRES cap=%d\n", res);
}
break;
case HORZRES:
res= dxw.GetScreenWidth();
OutTraceDW("GetDeviceCaps: fix(2) HORZRES cap=%d\n", res);
if(dxw.Windowize){
res= dxw.GetScreenWidth();
OutTraceDW("GetDeviceCaps: fix(2) HORZRES cap=%d\n", res);
}
break;
// WARNING: in no-emu mode, the INIT8BPP and INIT16BPP flags expose capabilities that
// are NOT implemented and may cause later troubles!
@ -1313,6 +1323,7 @@ int WINAPI extSetDIBitsToDevice(HDC hdc, int XDest, int YDest, DWORD dwWidth, DW
}
//else
if (dxw.IsFullScreen() && (OBJ_DC == GetObjectType(hdc))){
// blitting toprimary surface !!!
DWORD OrigWidth, OrigHeight;
int OrigXDest, OrigYDest;
OrigWidth=dwWidth;
@ -1323,6 +1334,10 @@ int WINAPI extSetDIBitsToDevice(HDC hdc, int XDest, int YDest, DWORD dwWidth, DW
OutTraceDW("SetDIBitsToDevice: fixed dest=(%d,%d)-(%dx%d)\n", XDest, YDest, dwWidth, dwHeight);
HDC hTempDc;
HBITMAP hbmPic;
if(dxw.HandleFPS()) return DD_OK;
if(dxw.dwFlags5 & NOBLT) return DD_OK;
if(!(hTempDc=CreateCompatibleDC(hdc)))
OutTraceE("CreateCompatibleDC: ERROR err=%d at=%d\n", GetLastError(), __LINE__);
// tricky part: CreateCompatibleBitmap is needed to set the dc size, but it has to be performed
@ -1338,6 +1353,9 @@ int WINAPI extSetDIBitsToDevice(HDC hdc, int XDest, int YDest, DWORD dwWidth, DW
SetStretchBltMode(hdc,HALFTONE);
if(!(ret=(*pGDIStretchBlt)(hdc, XDest, YDest, dwWidth, dwHeight, hTempDc, 0, 0, OrigWidth, OrigHeight, SRCCOPY)))
OutTraceE("StretchBlt: ERROR err=%d at=%d\n", GetLastError(), __LINE__);
dxw.ShowOverlay(hdc);
if(!(DeleteObject(hbmPic))) // v2.02.32 - avoid resource leakage
OutTraceE("DeleteObject: ERROR err=%d at=%d\n", GetLastError(), __LINE__);
if(!(DeleteDC(hTempDc)))

View File

@ -82,6 +82,7 @@ void HookKernel32Init()
HookLibInit(LimitHooks);
HookLibInit(TimeHooks);
HookLibInit(VersionHooks);
HookLibInit(SuppressChildHooks);
}
FARPROC Remap_kernel32_ProcAddress(LPCSTR proc, HMODULE hModule)

View File

@ -54,8 +54,9 @@ static HookEntry_Type Hooks[]={
{HOOK_HOT_CANDIDATE, "SetWindowLongW", (FARPROC)SetWindowLongW, (FARPROC *)&pSetWindowLongW, (FARPROC)extSetWindowLongW},
{HOOK_HOT_CANDIDATE, "GetWindowLongW", (FARPROC)GetWindowLongW, (FARPROC *)&pGetWindowLongW, (FARPROC)extGetWindowLongW},
//{HOOK_IAT_CANDIDATE, "GetActiveWindow", (FARPROC)NULL, (FARPROC *)&pGetActiveWindow, (FARPROC)extGetActiveWindow},
//{HOOK_IAT_CANDIDATE, "GetForegroundWindow", (FARPROC)NULL, (FARPROC *)&pGetForegroundWindow, (FARPROC)extGetForegroundWindow},
//{HOOK_HOT_CANDIDATE, "GetActiveWindow", (FARPROC)NULL, (FARPROC *)&pGetActiveWindow, (FARPROC)extGetActiveWindow},
//{HOOK_HOT_CANDIDATE, "GetForegroundWindow", (FARPROC)NULL, (FARPROC *)&pGetForegroundWindow, (FARPROC)extGetForegroundWindow},
{HOOK_IAT_CANDIDATE, "IsWindowVisible", (FARPROC)NULL, (FARPROC *)&pIsWindowVisible, (FARPROC)extIsWindowVisible},
{HOOK_IAT_CANDIDATE, "SystemParametersInfoA", (FARPROC)SystemParametersInfoA, (FARPROC *)&pSystemParametersInfoA, (FARPROC)extSystemParametersInfoA},
{HOOK_IAT_CANDIDATE, "SystemParametersInfoW", (FARPROC)SystemParametersInfoW, (FARPROC *)&pSystemParametersInfoW, (FARPROC)extSystemParametersInfoW},
@ -825,6 +826,7 @@ BOOL WINAPI extGetCursorPos(LPPOINT lppoint)
*lppoint=dxw.ScreenToClient(*lppoint);
*lppoint=dxw.FixCursorPos(*lppoint);
#if 0
if(dxw.dwFlags4 & FRAMECOMPENSATION){
static int dx, dy, todo=TRUE;
if (todo){
@ -837,6 +839,7 @@ BOOL WINAPI extGetCursorPos(LPPOINT lppoint)
lppoint->x += dx;
lppoint->y += dy;
}
#endif
GetHookInfo()->CursorX=(short)lppoint->x;
GetHookInfo()->CursorY=(short)lppoint->y;
@ -909,12 +912,74 @@ BOOL WINAPI extPeekMessage(LPMSG lpMsg, HWND hwnd, UINT wMsgFilterMin, UINT wMsg
{
BOOL res;
res=(*pPeekMessage)(lpMsg, hwnd, 0, 0, (wRemoveMsg & 0x000F));
#if 0
UINT bRemoveMsg = (wRemoveMsg & 0x000F);
UINT message;
do{
res=(*pPeekMessage)(lpMsg, hwnd, 0, 0, bRemoveMsg);
if(!res) break; // no message available
OutTraceW("PeekMessage: GOT lpmsg=%x hwnd=%x filter=(%x-%x) remove=%x(%s) msg=%x(%s) wparam=%x, lparam=%x pt=(%d,%d) res=%x\n",
lpMsg, lpMsg->hwnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg, ExplainPeekRemoveMsg(wRemoveMsg),
lpMsg->message, ExplainWinMessage(lpMsg->message & 0xFFFF),
lpMsg->wParam, lpMsg->lParam, lpMsg->pt.x, lpMsg->pt.y, res);
message = lpMsg->message;
if(res &&(dxw.dwFlags3 & FILTERMESSAGES)){ // filter offending messages
switch(message){
case WM_NCMOUSEMOVE:
case WM_NCLBUTTONDOWN:
case WM_NCLBUTTONUP:
case WM_NCLBUTTONDBLCLK:
case WM_NCRBUTTONDOWN:
case WM_NCRBUTTONUP:
case WM_NCRBUTTONDBLCLK:
case WM_NCMBUTTONDOWN:
case WM_NCMBUTTONUP:
case WM_NCMBUTTONDBLCLK:
OutTraceDW("WindowProc[%x]: SUPPRESS WinMsg=[0x%x]%s(%x,%x)\n", hwnd, message, ExplainWinMessage(message), lpMsg->wParam, lpMsg->lParam);
if(!bRemoveMsg) (*pPeekMessage)(lpMsg, hwnd, message, message, TRUE);
continue;
}
}
if((wMsgFilterMin==0) && (wMsgFilterMax == 0)) break; // no filtering, everything is good
if((message < wMsgFilterMin) || (message > wMsgFilterMax)){
OutTraceDW("WindowProc[%x]: SUPPRESS WinMsg=[0x%x]%s(%x,%x)\n", hwnd, message, ExplainWinMessage(message), lpMsg->wParam, lpMsg->lParam);
if(!bRemoveMsg) (*pPeekMessage)(lpMsg, hwnd, message, message, TRUE);
continue; // skip this one ....
}
} while(FALSE);
#endif
if((wMsgFilterMin==0) && (wMsgFilterMax == 0)){
// no filtering, everything is good
res=(*pPeekMessage)(lpMsg, hwnd, wMsgFilterMin, wMsgFilterMax, (wRemoveMsg & 0x000F));
}
else {
MSG Dummy;
// better eliminate all messages before and after the selected range !!!!
//if(wMsgFilterMin)(*pPeekMessage)(&Dummy, hwnd, 0, wMsgFilterMin-1, TRUE);
if(wMsgFilterMin>0x0F)(*pPeekMessage)(&Dummy, hwnd, 0x0F, wMsgFilterMin-1, TRUE);
res=(*pPeekMessage)(lpMsg, hwnd, wMsgFilterMin, wMsgFilterMax, (wRemoveMsg & 0x000F));
if(wMsgFilterMax<WM_KEYFIRST)(*pPeekMessage)(&Dummy, hwnd, wMsgFilterMax+1, WM_KEYFIRST-1, TRUE); // don't touch above WM_KEYFIRST !!!!
}
#if 0
MSG Dummy;
(*pPeekMessage)(&Dummy, hwnd, 0x0F, 0x100, TRUE);
res=(*pPeekMessage)(lpMsg, hwnd, wMsgFilterMin, wMsgFilterMax, (wRemoveMsg & 0x000F));
#endif
if(res)
OutTraceW("PeekMessage: ANY lpmsg=%x hwnd=%x filter=(%x-%x) remove=%x(%s) msg=%x(%s) wparam=%x, lparam=%x pt=(%d,%d) res=%x\n",
lpMsg, lpMsg->hwnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg, ExplainPeekRemoveMsg(wRemoveMsg),
lpMsg->message, ExplainWinMessage(lpMsg->message & 0xFFFF),
lpMsg->wParam, lpMsg->lParam, lpMsg->pt.x, lpMsg->pt.y, res);
else
OutTraceW("PeekMessage: ANY lpmsg=%x hwnd=%x filter=(%x-%x) remove=%x(%s) res=%x\n",
lpMsg, lpMsg->hwnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg, ExplainPeekRemoveMsg(wRemoveMsg), res);
OutTraceW("PeekMessage: ANY lpmsg=%x hwnd=%x filter=(%x-%x) remove=%x(%s) msg=%x(%s) wparam=%x, lparam=%x pt=(%d,%d) res=%x\n",
lpMsg, lpMsg->hwnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg, ExplainPeekRemoveMsg(wRemoveMsg),
lpMsg->message, ExplainWinMessage(lpMsg->message & 0xFFFF),
lpMsg->wParam, lpMsg->lParam, lpMsg->pt.x, lpMsg->pt.y, res);
return res;
}
@ -1101,6 +1166,17 @@ int WINAPI extGetSystemMetrics(int nindex)
res=(*pGetSystemMetrics)(nindex);
OutTraceDW("GetSystemMetrics: index=%x(%s), res=%d\n", nindex, ExplainsSystemMetrics(nindex), res);
if(!dxw.Windowize){
// v2.02.95: if not in window mode, just implement the HIDEMULTIMONITOR flag
if( (nindex ==SM_CMONITORS) &&
(dxw.dwFlags2 & HIDEMULTIMONITOR) &&
res>1) {
res=1;
OutTraceDW("GetSystemMetrics: fix SM_CMONITORS=%d\n", res);
}
return res;
}
// if you have a bypassed setting, use it first!
if(pSetDevMode){
switch(nindex){
@ -2556,18 +2632,18 @@ HWND WINAPI extGetActiveWindow(void)
{
HWND ret;
ret=(*pGetActiveWindow)();
OutTraceDW("GetActiveWindow: ret=%x\n", ret);
STOPPER("GetActiveWindow");
return ret;
OutTraceDW("GetActiveWindow: ret=%x->%x\n", ret, dxw.GethWnd());
//STOPPER("GetActiveWindow");
return dxw.GethWnd();
}
HWND WINAPI extGetForegroundWindow(void)
{
HWND ret;
ret=(*pGetForegroundWindow)();
OutTraceDW("GetForegroundWindow: ret=%x\n", ret);
STOPPER("GetForegroundWindow");
return ret;
OutTraceDW("GetForegroundWindow: ret=%x->%x\n", ret, dxw.GethWnd());
//STOPPER("GetForegroundWindow");
return dxw.GethWnd();
}
BOOL WINAPI extIsWindowVisible(HWND hwnd)

View File

@ -121,7 +121,8 @@ MCIERROR WINAPI extmciSendCommand(MCIDEVICEID IDDevice, UINT uMsg, DWORD_PTR fdw
}
ret=(*pmciSendCommand)(IDDevice, uMsg, fdwCommand, dwParam);
if(dxw.IsFullScreen() && uMsg==MCI_PUT) pr->rc=saverect;
if (ret) OutTraceE("mciSendCommand: ERROR res=%x\n", ret);
if (ret) OutTraceE("mciSendCommand: ERROR res=%d\n", ret);
return ret;
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,10 +0,0 @@
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level='asInvoker' uiAccess='false' />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

Binary file not shown.

View File

@ -1 +0,0 @@
Manifest resource last updated at 23:39:40.80 on 05/10/2014

View File

@ -1,65 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="9.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command=""
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="USER-PC"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command=""
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="USER-PC"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.