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

v2_03_70_src

Former-commit-id: a516cfdde172868c23b2a62175e7a008e90a5f6f
This commit is contained in:
gho tik 2016-05-25 12:46:02 -04:00 committed by Refael ACkermann
parent 8425298274
commit fb1b339376
40 changed files with 898 additions and 3343 deletions

View File

@ -224,6 +224,10 @@
#define CPUSLOWDOWN 0x00000040 // reduces CPU time dedicated to non time critical threads
#define CPUMAXUSAGE 0x00000080 // reduces CPU time to non time critical threads that consume more than the given ratio
#define NOWINERRORS 0x00000100 // suppress some possible window errors returning OK also in case of failure
#define SUPPRESSOVERLAY 0x00000200 // Supress ddraw overlay capabilities (moto racer 2)
#define INIT24BPP 0x00000400 // simulate a 24BPP initial desktop setting (in GetDeviceCaps API)
#define INIT32BPP 0x00000800 // simulate a 24BPP initial desktop setting (in GetDeviceCaps API)
// eighth flags DWORD dxw.dwFlags8:
// logging Tflags DWORD:

3
Release/-dxwnd (2).dll Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:61559f87e638c3e804586c3a84c178771a9795a5160e46196267ba0bc551ce67
size 654848

3
Release/-dxwnd.dll Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2a37cc0d0feca74c6cad95af68a73bb1678677db3de38ed9d3dff3907ee05184
size 653824

1
Release/.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
*.{dll,exe} filter=lfs diff=lfs merge=lfs -text

3
Release/Disasm.dll Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f413a207787da88281500aaeae07fb98d7d438ecb4d67f8fcdf0aff2f988717f
size 138752

459
Release/dxwnd.ini Normal file
View File

@ -0,0 +1,459 @@
[window]
exepath=D:\Games\Imperialism II - Age of Exploration (GOG)\
posx=-893
posy=292
sizx=320
sizy=400
exportpath=D:\DxWnd\export.wip\
debug=1
[target]
title0=Tanktics
path0=D:\Games\tanktics\tanktics.exe
launchpath0=
module0=
opengllib0=
notes0=
registry0=
ver0=0
coord0=2
flag0=-1398800350
flagg0=1744830480
flagh0=20
flagi0=-2008543232
flagj0=5248
flagk0=65536
flagl0=513
flagm0=0
tflag0=-2147477245
dflag0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=3
swapeffect0=0
maxddinterface0=6
slowratio0=2
title1=Tanktics (no hook)
path1=D:\Games\tanktics\tanktics.exe
launchpath1=
module1=
opengllib1=
notes1=
registry1=
ver1=12
coord1=0
flag1=614465570
flagg1=1073774592
flagh1=4
flagi1=-2009071612
flagj1=4224
flagk1=65536
flagl1=1
flagm1=0
tflag1=-2147477245
dflag1=0
posx1=50
posy1=50
sizx1=800
sizy1=600
maxfps1=0
initts1=0
winver1=0
maxres1=-1
swapeffect1=0
maxddinterface1=6
slowratio1=2
title2=ROADRASH.EXE
path2=D:\Games\road-rash\ROADRASH.EXE
launchpath2=
module2=
opengllib2=
notes2=
registry2=
ver2=0
coord2=0
flag2=136314914
flagg2=1207959552
flagh2=20
flagi2=134217732
flagj2=4224
flagk2=65536
flagl2=0
flagm2=0
tflag2=0
dflag2=0
posx2=50
posy2=50
sizx2=800
sizy2=600
maxfps2=0
initts2=0
winver2=0
maxres2=-1
swapeffect2=0
maxddinterface2=7
slowratio2=2
title3=EMPIRES2.EXE
path3=D:\Games\Age of Empires II Trial\EMPIRES2.EXE
launchpath3=
module3=
opengllib3=
notes3=
registry3=
ver3=0
coord3=0
flag3=136314914
flagg3=1207959552
flagh3=20
flagi3=134217732
flagj3=4224
flagk3=65536
flagl3=0
flagm3=0
tflag3=0
dflag3=0
posx3=50
posy3=50
sizx3=800
sizy3=600
maxfps3=0
initts3=0
winver3=0
maxres3=-1
swapeffect3=0
maxddinterface3=7
slowratio3=2
title4=Blade of Darkness (GOG-OpenGL)
path4=D:\Games\Blade of Darkness (GOG)\Bin\Blade.exe
launchpath4=
module4=raster\rOpenGL.dll
opengllib4=
notes4=
registry4=(
ver4=0
coord4=0
flag4=681574434
flagg4=1208090624
flagh4=21
flagi4=205520902
flagj4=4224
flagk4=5308416
flagl4=0
flagm4=0
tflag4=0
dflag4=0
posx4=50
posy4=50
sizx4=800
sizy4=600
maxfps4=0
initts4=0
winver4=0
maxres4=-1
swapeffect4=0
maxddinterface4=7
slowratio4=1
title5=msgolf98
path5=D:\Games\MSGolf98\MSGOLF98\GAME.EXE
launchpath5=
module5=
opengllib5=
notes5=
registry5=
ver5=0
coord5=0
flag5=136314914
flagg5=1207959552
flagh5=20
flagi5=134217732
flagj5=4224
flagk5=327680
flagl5=0
flagm5=0
tflag5=0
dflag5=0
posx5=50
posy5=50
sizx5=880
sizy5=660
maxfps5=0
initts5=0
winver5=0
maxres5=-1
swapeffect5=0
maxddinterface5=7
slowratio5=2
title6=Vitae.exe
path6=D:\Games\Vitae\Vitae.exe
launchpath6=
module6=
opengllib6=
notes6=
registry6=
ver6=0
coord6=0
flag6=136314914
flagg6=1744830592
flagh6=20
flagi6=138412036
flagj6=4224
flagk6=3473450
flagl6=0
flagm6=0
tflag6=-2147476729
dflag6=0
posx6=50
posy6=50
sizx6=800
sizy6=600
maxfps6=0
initts6=0
winver6=0
maxres6=-1
swapeffect6=0
maxddinterface6=7
slowratio6=2
title7=moto.exe
path7=D:\Games\Moto Racer 2 (GOG)\moto.exe
launchpath7=D:\Games\Moto Racer 2 (GOG)\moto.exe -NoPowerVr -KeepAvailableVram1073741824
module7=
opengllib7=
notes7=
registry7=
ver7=0
coord7=0
flag7=681574434
flagg7=1207959680
flagh7=524308
flagi7=138412036
flagj7=33558656
flagk7=196608
flagl7=0
flagm7=0
tflag7=-1073735421
dflag7=0
posx7=50
posy7=50
sizx7=800
sizy7=600
maxfps7=0
initts7=0
winver7=0
maxres7=-1
swapeffect7=0
maxddinterface7=7
slowratio7=2
title8=Army Men RTS
path8=D:\Games\Army Men RTS\amrts.exe
launchpath8=
module8=
opengllib8=
notes8=
registry8=
ver8=0
coord8=0
flag8=671088678
flagg8=1207959552
flagh8=20
flagi8=4194304
flagj8=128
flagk8=65536
flagl8=0
flagm8=0
tflag8=0
dflag8=0
posx8=50
posy8=50
sizx8=800
sizy8=600
maxfps8=0
initts8=0
winver8=0
maxres8=0
swapeffect8=0
maxddinterface8=7
slowratio8=1
title9=Glover
path9=D:\Games\Glover\glover.exe
launchpath9=
module9=
opengllib9=
notes9=
registry9=
ver9=0
coord9=0
flag9=203423778
flagg9=1207959552
flagh9=20
flagi9=138412052
flagj9=67113088
flagk9=65536
flagl9=0
flagm9=0
tflag9=-2147477245
dflag9=0
posx9=50
posy9=50
sizx9=800
sizy9=600
maxfps9=0
initts9=0
winver9=0
maxres9=-1
swapeffect9=0
maxddinterface9=7
slowratio9=2
title10=Moonbase.exe
path10=D:\Games\MoonBase Commander\Moonbase.exe
launchpath10=
module10=
opengllib10=
notes10=
registry10=
ver10=0
coord10=0
flag10=-1465909134
flagg10=1744963584
flagh10=524308
flagi10=138412036
flagj10=-2147479424
flagk10=272957440
flagl10=0
flagm10=0
tflag10=-2147477237
dflag10=0
posx10=150
posy10=150
sizx10=800
sizy10=600
maxfps10=0
initts10=0
winver10=0
maxres10=-1
swapeffect10=0
maxddinterface10=7
slowratio10=2
title11=Lode Runner 2
path11=D:\Games\Lode Runner 2\LR2.exe
launchpath11=
module11=
opengllib11=
notes11=
registry11=
ver11=0
coord11=0
flag11=136319010
flagg11=1744830592
flagh11=20
flagi11=138416132
flagj11=4224
flagk11=327680
flagl11=4
flagm11=0
tflag11=-2147477245
dflag11=0
posx11=50
posy11=50
sizx11=800
sizy11=600
maxfps11=0
initts11=0
winver11=0
maxres11=3
swapeffect11=0
maxddinterface11=7
slowratio11=2
title12=Patrician III
path12=D:\Games\Patrician III - Impero dei Mari\Patrician3.exe
launchpath12=
module12=
opengllib12=
notes12=
registry12=
ver12=0
coord12=0
flag12=681574434
flagg12=1744830464
flagh12=20
flagi12=136314886
flagj12=4224
flagk12=65536
flagl12=0
flagm12=0
tflag12=-2147477245
dflag12=0
posx12=50
posy12=50
sizx12=800
sizy12=600
maxfps12=0
initts12=0
winver12=0
maxres12=-1
swapeffect12=0
maxddinterface12=7
slowratio12=2
title13=Need for Speed SE
path13=D:\NFSSE\NFS_WIN.EXE
launchpath13=
module13=
opengllib13=
notes13=
registry13=
ver13=0
coord13=0
flag13=136314978
flagg13=2013266048
flagh13=532
flagi13=138412036
flagj13=4224
flagk13=65536
flagl13=0
flagm13=0
tflag13=-2147477245
dflag13=0
posx13=50
posy13=50
sizx13=800
sizy13=600
maxfps13=0
initts13=0
winver13=0
maxres13=-1
swapeffect13=0
maxddinterface13=7
slowratio13=2
title14=Imperialism II.exe
path14=D:\Games\Imperialism II - Age of Exploration (GOG)\Imperialism II.exe
launchpath14=
module14=
opengllib14=
notes14=
registry14=
ver14=0
coord14=0
flag14=136314914
flagg14=1209008128
flagh14=20
flagi14=138412036
flagj14=4224
flagk14=1073807360
flagl14=0
flagm14=0
tflag14=0
dflag14=0
posx14=50
posy14=50
sizx14=800
sizy14=600
maxfps14=0
initts14=0
winver14=0
maxres14=-1
swapeffect14=0
maxddinterface14=7
slowratio14=2

3
Release/filter.dll Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d364d53ff922e8381c306d23d51c3a93a0512325824e5e0513c424e9372f9b4c
size 13312

3
Release/vcomp90.dll Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9140efe26252b6329da254201219fc2d17a3f651e1591e32ae04c86a27e35bb2
size 51024

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c7943551fe966c9338314466a778a5b8116dbf776047162959a1403ad895a167
size 652800
oid sha256:1072541e0a7edd1b828cc7f0ea4aea38f4c8bddf9afbb732b583c11d066281ad
size 655360

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1dfdcf69403a93563f73c0f77084c8c054b570c2c2681aa1323aa5d7d0c70ae0
size 568320
oid sha256:a96a88210c3088f48be0524d62bb5023d0ab66a3eff66817277a792e3ec210dd
size 568832

View File

@ -0,0 +1,31 @@
[target]
title0=American McGee's Alice
path0=D:\Games\American McGee's Alice\alice.exe
launchpath0=
module0=
opengllib0=
notes0=
registry0=
ver0=0
coord0=0
flag0=673194038
flagg0=1208090624
flagh0=21
flagi0=136314884
flagj0=4224
flagk0=65536
flagl0=0
flagm0=0
tflag0=0
dflag0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1
swapeffect0=0
maxddinterface0=7
slowratio0=2

View File

@ -0,0 +1,31 @@
[target]
title0=Cossacks II
path0=D:\Games\GSC Game World\Cossacks II\Data\engine.exe
launchpath0=
module0=
opengllib0=
notes0=
registry0=
ver0=0
coord0=0
flag0=136314914
flagg0=1744961536
flagh0=21
flagi0=138412036
flagj0=4224
flagk0=4259840
flagl0=0
flagm0=0
tflag0=0
dflag0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1
swapeffect0=0
maxddinterface0=7
slowratio0=2

View File

@ -0,0 +1,31 @@
[target]
title0=F1 Manager 2000
path0=D:\Games\F1 Manager\F1 Manager.exe
launchpath0=
module0=
opengllib0=
notes0=
registry0=
ver0=0
coord0=0
flag0=681590818
flagg0=1207959552
flagh0=20
flagi0=138420228
flagj0=4224
flagk0=65536
flagl0=0
flagm0=0
tflag0=0
dflag0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1
swapeffect0=0
maxddinterface0=7
slowratio0=2

View File

@ -0,0 +1,31 @@
[target]
title0=Lode Runner 2
path0=D:\Games\Lode Runner 2\LR2.exe
launchpath0=
module0=
opengllib0=
notes0=
registry0=
ver0=0
coord0=0
flag0=136319010
flagg0=1744830592
flagh0=20
flagi0=138416132
flagj0=4224
flagk0=327680
flagl0=4
flagm0=0
tflag0=0
dflag0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=3
swapeffect0=0
maxddinterface0=7
slowratio0=2

View File

@ -4,12 +4,12 @@ path0=D:\Games\Microsoft Golf 1999 Edition\game.exe
launchpath0=
module0=
opengllib0=
notes0=
registry0=[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft]\n[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Games]\n[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Games\Golf '98]\n[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Games\Golf '98\Version 1.0 Demo]\n"AppPath"="D:\\Games\\MSGolf98\\MSGOLF98"\n"InstallType"="1"\n"InstallPath"="D:\\Games\\MSGolf98\\MSGOLF98\\"\n"CDPath"="D:\\Games\\MSGolf98\\MSGOLF98"\n"Launched"="1"\n"PID"=""\n"Path"="D:\\Games\\MSGolf98\\MSGOLF98"\n"VersionType"="TrialVersion"\n"InstalledGroup"="1"\n"LangID"=dword:00000009\n
notes0=Install instructions for Win7:\nRun setup from the cd with Win95 compatibility\nIf the setup copies 100% files but fails the final setting phase, \nedit the virtual registry settings.\nRemember to delete / rename the odious Backfill.exe before it requires you to \nrestart the pc....\n
registry0=[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft]\n[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Games]\n[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Games\Golf '99]\n[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Games\Golf '99\Version 1.0]\n"InstalledPATH"="D:\\Games\\Microsoft Golf 1999 Edition"\n"CDPath"="E:\\"\n"InstalledGroup"="1"\n
ver0=0
coord0=0
flag0=136314914
flagg0=-671088640
flagg0=-134217728
flagh0=1302
flagi0=1212547076
flagj0=4224

View File

@ -0,0 +1,31 @@
[target]
title0=Need For Speed SE
path0=C:\NFSSE\NFS.EXE
launchpath0=
module0=
opengllib0=
notes0=Need For Speed Special Edition installation Notes:\n(tested on Win7 64-bit)\n\nYou can install the game using DOSBOX. Just make sure that the \nmounted CD drive in DOSBOX is using the same letter as your real CD\DVD drive.\ne.g. if your real CD/DVD drive letter is F:\nuse "mount f f:\ -t cdrom -ioctl"\ninstead off "mount d f:\ -t cdrom -ioctl"\n(the game will not start if it can not find the correct CD drive letter that is \nwritten to "C:\NFSSE\GAMEDATA\CONFIG\PATHS.DAT" by the installer)\n\nInstall using the Custom Install option and select all the checkboxes.\n(otherwise the game may have framerate issues streaming files from the CD)\n\nCopy NFS_WIN.EXE and IFORCE.DLL from the CD to your C:\NFSSE directory \nand rename NFS_WIN.EXE to NFS.EXE.\n\nThen you need to copy dplayx.dll to the C:\NFSSE directory from \n"C:\Windows\SysWOW64\dplayx.dll". Then rename this copy to dplay.dll.\n\nUsing Notepad make sure NFS.CFG reads:\nYESSOUND VIDEO ENGLISH NOREMOTE \n\nThe game should then run with this .dxw setup.\n
registry0=
ver0=0
coord0=1
flag0=136331362
flagg0=1543503872
flagh0=532
flagi0=138413060
flagj0=4224
flagk0=65536
flagl0=0
flagm0=0
tflag0=0
dflag0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1
swapeffect0=0
maxddinterface0=7
slowratio0=2

View File

@ -0,0 +1,31 @@
[target]
title0=Patrician III
path0=D:\Games\Patrician III - Impero dei Mari\Patrician3.exe
launchpath0=
module0=
opengllib0=
notes0=
registry0=
ver0=0
coord0=0
flag0=681574434
flagg0=1744830464
flagh0=20
flagi0=136314886
flagj0=4224
flagk0=65536
flagl0=0
flagm0=0
tflag0=0
dflag0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1
swapeffect0=0
maxddinterface0=7
slowratio0=2

View File

@ -0,0 +1,31 @@
[target]
title0=Tanktics
path0=D:\Games\tanktics\tanktics.exe
launchpath0=
module0=
opengllib0=
notes0=
registry0=
ver0=0
coord0=0
flag0=748683298
flagg0=1744830464
flagh0=20
flagi0=-2008543232
flagj0=4224
flagk0=65536
flagl0=513
flagm0=0
tflag0=0
dflag0=0
posx0=-9550
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=3
swapeffect0=0
maxddinterface0=6
slowratio0=2

View File

@ -1117,3 +1117,10 @@ fix: fixed "CPU max usage" option
fix: WindowFromPoint & WindowFromPointEx hooks
fix: recovered partilly working implementation of "shared dc" mode
add: "Suppress Win errors" option, needed to skip a blocking error and make "Migrosoft Golf '98" starting
v2.03.70
add: ddraw Overlay tracing (waiting to implement an emulation strategy)
add: SetWindowsHookExA logging, SetWindowsHookExW hooking
fix: MessageHook logging
GUI: some rearrangements / rationalizations to the interface
add: INIT24BPP and INIT32BPP flags

View File

@ -176,7 +176,8 @@ static HRESULT sBltToPrimary(int dxversion, Blt_Type pBlt, char *api, LPDIRECTDR
// any blit operation!
if(destrect.left == -32000) return DD_OK; // no blit on invisible window
if(!(lpddssrc || (dwflags & DDBLT_COLORFILL))) {
//if(!(lpddssrc || (dwflags & DDBLT_COLORFILL))) {
if((lpddssrc==0) && !(dwflags & DDBLT_COLORFILL)){
lpddssrc = dxwss.GetBackBufferSurface();
OutTraceDW("Flip: setting flip chain to lpdds=%x\n", lpddssrc);
}

View File

@ -219,6 +219,16 @@ HRESULT WINAPI extUnlockDir2(LPDIRECTDRAWSURFACE, LPVOID);
HRESULT WINAPI extUnlockDir3(LPDIRECTDRAWSURFACE, LPVOID);
HRESULT WINAPI extUnlockDir4(LPDIRECTDRAWSURFACE, LPRECT);
HRESULT WINAPI extUnlockDir7(LPDIRECTDRAWSURFACE, LPRECT);
HRESULT WINAPI extEnumOverlayZOrders1(LPDIRECTDRAWSURFACE, DWORD, LPVOID, LPDDENUMSURFACESCALLBACK);
HRESULT WINAPI extEnumOverlayZOrders2(LPDIRECTDRAWSURFACE, DWORD, LPVOID, LPDDENUMSURFACESCALLBACK);
HRESULT WINAPI extEnumOverlayZOrders3(LPDIRECTDRAWSURFACE, DWORD, LPVOID, LPDDENUMSURFACESCALLBACK);
HRESULT WINAPI extEnumOverlayZOrders4(LPDIRECTDRAWSURFACE, DWORD, LPVOID, LPDDENUMSURFACESCALLBACK);
HRESULT WINAPI extEnumOverlayZOrders7(LPDIRECTDRAWSURFACE, DWORD, LPVOID, LPDDENUMSURFACESCALLBACK);
HRESULT WINAPI extAddOverlayDirtyRect1(LPDIRECTDRAWSURFACE, LPRECT);
HRESULT WINAPI extAddOverlayDirtyRect2(LPDIRECTDRAWSURFACE, LPRECT);
HRESULT WINAPI extAddOverlayDirtyRect3(LPDIRECTDRAWSURFACE, LPRECT);
HRESULT WINAPI extAddOverlayDirtyRect4(LPDIRECTDRAWSURFACE, LPRECT);
HRESULT WINAPI extAddOverlayDirtyRect7(LPDIRECTDRAWSURFACE, LPRECT);
HRESULT WINAPI extCreateSurface(int, CreateSurface_Type, LPDIRECTDRAW, DDSURFACEDESC2 *, LPDIRECTDRAWSURFACE *, void *);
HRESULT WINAPI extSetSurfaceDesc3(LPDIRECTDRAWSURFACE, LPDDSURFACEDESC, DWORD);
@ -315,6 +325,8 @@ GetPixelFormat_Type pGetPixelFormat1, pGetPixelFormat2, pGetPixelFormat3, pGetPi
GetSurfaceDesc_Type pGetSurfaceDesc1, pGetSurfaceDesc2, pGetSurfaceDesc3;
GetSurfaceDesc2_Type pGetSurfaceDesc4, pGetSurfaceDesc7;
Lock_Type pLock1, pLock2, pLock3, pLock4, pLock7;
EnumOverlayZOrders_Type pEnumOverlayZOrders1, pEnumOverlayZOrders2, pEnumOverlayZOrders3, pEnumOverlayZOrders4, pEnumOverlayZOrders7;
AddOverlayDirtyRect_Type pAddOverlayDirtyRect1, pAddOverlayDirtyRect2, pAddOverlayDirtyRect3, pAddOverlayDirtyRect4, pAddOverlayDirtyRect7;
//Initialize
IsLost_Type pIsLost;
@ -646,6 +658,8 @@ void InitScreenParameters(int dxversion)
dxw.VirtualPixelFormat.dwRGBBitCount=CurrDevMode.dmBitsPerPel; // until set differently
if(dxw.dwFlags2 & INIT8BPP) FixPixelFormat(8, &dxw.VirtualPixelFormat);
if(dxw.dwFlags2 & INIT16BPP) FixPixelFormat(16, &dxw.VirtualPixelFormat);
if(dxw.dwFlags7 & INIT24BPP) FixPixelFormat(24, &dxw.VirtualPixelFormat);
if(dxw.dwFlags7 & INIT32BPP) FixPixelFormat(32, &dxw.VirtualPixelFormat);
OutTraceDW("InitScreenParameters: dxversion=%d RGBBitCount=%d\n", dxversion, CurrDevMode.dmBitsPerPel);
SetBltTransformations(dxversion);
@ -1220,10 +1234,12 @@ static void HookDDSurface(LPDIRECTDRAWSURFACE *lplpdds, int dxversion, BOOL isPr
SetHook((void *)(**(DWORD **)lplpdds), extQueryInterfaceS1, (void **)&pQueryInterfaceS1, "QueryInterface(S1)");
SetHook((void *)(**(DWORD **)lplpdds + 8), extReleaseS1, (void **)&pReleaseS1, "Release(S1)");
SetHook((void *)(**(DWORD **)lplpdds + 12), extAddAttachedSurface1, (void **)&pAddAttachedSurface1, "AddAttachedSurface(S1)");
SetHook((void *)(**(DWORD **)lplpdds + 16), extAddOverlayDirtyRect1, (void **)&pAddOverlayDirtyRect1, "AddOverlayDirtyRect(S1)");
SetHook((void *)(**(DWORD **)lplpdds + 28), extBltFast1, (void **)&pBltFast1, "BltFast(S1)");
SetHook((void *)(**(DWORD **)lplpdds + 20), extBlt1, (void **)&pBlt1, "Blt(S1)");
SetHook((void *)(**(DWORD **)lplpdds + 32), extDeleteAttachedSurface1, (void **)&pDeleteAttachedSurface1, "DeleteAttachedSurface(S1)");
SetHook((void *)(**(DWORD **)lplpdds + 36), extEnumAttachedSurfaces1, (void **)&pEnumAttachedSurfaces1, "EnumAttachedSurfaces(S1)");
SetHook((void *)(**(DWORD **)lplpdds + 40), extEnumOverlayZOrders1, (void **)&pEnumOverlayZOrders1, "EnumOverlayZOrders(S1)");
SetHook((void *)(**(DWORD **)lplpdds + 44), extFlip1, (void **)&pFlip1, "Flip(S1)");
SetHook((void *)(**(DWORD **)lplpdds + 48), extGetAttachedSurface1, (void **)&pGetAttachedSurface1, "GetAttachedSurface(S1)");
SetHook((void *)(**(DWORD **)lplpdds + 56), extGetCaps1S, (void **)&pGetCaps1S, "GetCaps(S1)");
@ -1241,10 +1257,12 @@ static void HookDDSurface(LPDIRECTDRAWSURFACE *lplpdds, int dxversion, BOOL isPr
SetHook((void *)(**(DWORD **)lplpdds), extQueryInterfaceS2, (void **)&pQueryInterfaceS2, "QueryInterface(S2)");
SetHook((void *)(**(DWORD **)lplpdds + 8), extReleaseS2, (void **)&pReleaseS2, "Release(S2)");
SetHook((void *)(**(DWORD **)lplpdds + 12), extAddAttachedSurface2, (void **)&pAddAttachedSurface2, "AddAttachedSurface(S2)");
SetHook((void *)(**(DWORD **)lplpdds + 16), extAddOverlayDirtyRect2, (void **)&pAddOverlayDirtyRect2, "AddOverlayDirtyRect(S2)");
SetHook((void *)(**(DWORD **)lplpdds + 28), extBltFast2, (void **)&pBltFast2, "BltFast(S2)");
SetHook((void *)(**(DWORD **)lplpdds + 20), extBlt2, (void **)&pBlt2, "Blt(S2)");
SetHook((void *)(**(DWORD **)lplpdds + 32), extDeleteAttachedSurface2, (void **)&pDeleteAttachedSurface2, "DeleteAttachedSurface(S2)");
SetHook((void *)(**(DWORD **)lplpdds + 36), extEnumAttachedSurfaces2, (void **)&pEnumAttachedSurfaces2, "EnumAttachedSurfaces(S2)");
SetHook((void *)(**(DWORD **)lplpdds + 40), extEnumOverlayZOrders2, (void **)&pEnumOverlayZOrders2, "EnumOverlayZOrders(S2)");
SetHook((void *)(**(DWORD **)lplpdds + 44), extFlip2, (void **)&pFlip2, "Flip(S2)");
SetHook((void *)(**(DWORD **)lplpdds + 48), extGetAttachedSurface2, (void **)&pGetAttachedSurface2, "GetAttachedSurface(S2)");
SetHook((void *)(**(DWORD **)lplpdds + 56), extGetCaps2S, (void **)&pGetCaps2S, "GetCaps(S2)");
@ -1262,10 +1280,12 @@ static void HookDDSurface(LPDIRECTDRAWSURFACE *lplpdds, int dxversion, BOOL isPr
SetHook((void *)(**(DWORD **)lplpdds), extQueryInterfaceS3, (void **)&pQueryInterfaceS3, "QueryInterface(S3)");
SetHook((void *)(**(DWORD **)lplpdds + 8), extReleaseS3, (void **)&pReleaseS3, "Release(S3)");
SetHook((void *)(**(DWORD **)lplpdds + 12), extAddAttachedSurface3, (void **)&pAddAttachedSurface3, "AddAttachedSurface(S3)");
SetHook((void *)(**(DWORD **)lplpdds + 16), extAddOverlayDirtyRect3, (void **)&pAddOverlayDirtyRect3, "AddOverlayDirtyRect(S3)");
SetHook((void *)(**(DWORD **)lplpdds + 28), extBltFast3, (void **)&pBltFast3, "BltFast(S3)");
SetHook((void *)(**(DWORD **)lplpdds + 20), extBlt3, (void **)&pBlt3, "Blt(S1)");
SetHook((void *)(**(DWORD **)lplpdds + 32), extDeleteAttachedSurface3, (void **)&pDeleteAttachedSurface3, "DeleteAttachedSurface(S3)");
SetHook((void *)(**(DWORD **)lplpdds + 36), extEnumAttachedSurfaces3, (void **)&pEnumAttachedSurfaces3, "EnumAttachedSurfaces(S3)");
SetHook((void *)(**(DWORD **)lplpdds + 40), extEnumOverlayZOrders3, (void **)&pEnumOverlayZOrders3, "EnumOverlayZOrders(S3)");
SetHook((void *)(**(DWORD **)lplpdds + 44), extFlip3, (void **)&pFlip3, "Flip(S3)");
SetHook((void *)(**(DWORD **)lplpdds + 48), extGetAttachedSurface3, (void **)&pGetAttachedSurface3, "GetAttachedSurface(S3)");
SetHook((void *)(**(DWORD **)lplpdds + 56), extGetCaps3S, (void **)&pGetCaps3S, "GetCaps(S3)");
@ -1285,10 +1305,12 @@ static void HookDDSurface(LPDIRECTDRAWSURFACE *lplpdds, int dxversion, BOOL isPr
SetHook((void *)(**(DWORD **)lplpdds), extQueryInterfaceS4, (void **)&pQueryInterfaceS4, "QueryInterface(S4)");
SetHook((void *)(**(DWORD **)lplpdds + 8), extReleaseS4, (void **)&pReleaseS4, "Release(S4)");
SetHook((void *)(**(DWORD **)lplpdds + 12), extAddAttachedSurface4, (void **)&pAddAttachedSurface4, "AddAttachedSurface(S4)");
SetHook((void *)(**(DWORD **)lplpdds + 16), extAddOverlayDirtyRect4, (void **)&pAddOverlayDirtyRect4, "AddOverlayDirtyRect(S4)");
SetHook((void *)(**(DWORD **)lplpdds + 28), extBltFast4, (void **)&pBltFast4, "BltFast(S4)");
SetHook((void *)(**(DWORD **)lplpdds + 20), extBlt4, (void **)&pBlt4, "Blt(S1)");
SetHook((void *)(**(DWORD **)lplpdds + 32), extDeleteAttachedSurface4, (void **)&pDeleteAttachedSurface4, "DeleteAttachedSurface(S4)");
SetHook((void *)(**(DWORD **)lplpdds + 36), extEnumAttachedSurfaces4, (void **)&pEnumAttachedSurfaces4, "EnumAttachedSurfaces(S4)");
SetHook((void *)(**(DWORD **)lplpdds + 40), extEnumOverlayZOrders4, (void **)&pEnumOverlayZOrders4, "EnumOverlayZOrders(S4)");
SetHook((void *)(**(DWORD **)lplpdds + 44), extFlip4, (void **)&pFlip4, "Flip(S4)");
SetHook((void *)(**(DWORD **)lplpdds + 48), extGetAttachedSurface4, (void **)&pGetAttachedSurface4, "GetAttachedSurface(S4)");
SetHook((void *)(**(DWORD **)lplpdds + 56), extGetCaps4S, (void **)&pGetCaps4S, "GetCaps(S4)");
@ -1308,10 +1330,12 @@ static void HookDDSurface(LPDIRECTDRAWSURFACE *lplpdds, int dxversion, BOOL isPr
SetHook((void *)(**(DWORD **)lplpdds), extQueryInterfaceS7, (void **)&pQueryInterfaceS7, "QueryInterface(S7)");
SetHook((void *)(**(DWORD **)lplpdds + 8), extReleaseS7, (void **)&pReleaseS7, "Release(S7)");
SetHook((void *)(**(DWORD **)lplpdds + 12), extAddAttachedSurface7, (void **)&pAddAttachedSurface7, "AddAttachedSurface(S7)");
SetHook((void *)(**(DWORD **)lplpdds + 16), extAddOverlayDirtyRect7, (void **)&pAddOverlayDirtyRect7, "AddOverlayDirtyRect(S7)");
SetHook((void *)(**(DWORD **)lplpdds + 28), extBltFast7, (void **)&pBltFast7, "BltFast(S7)");
SetHook((void *)(**(DWORD **)lplpdds + 20), extBlt7, (void **)&pBlt7, "Blt(S1)");
SetHook((void *)(**(DWORD **)lplpdds + 32), extDeleteAttachedSurface7, (void **)&pDeleteAttachedSurface7, "DeleteAttachedSurface(S7)");
SetHook((void *)(**(DWORD **)lplpdds + 36), extEnumAttachedSurfaces7, (void **)&pEnumAttachedSurfaces7, "EnumAttachedSurfaces(S7)");
SetHook((void *)(**(DWORD **)lplpdds + 40), extEnumOverlayZOrders7, (void **)&pEnumOverlayZOrders7, "EnumOverlayZOrders(S7)");
SetHook((void *)(**(DWORD **)lplpdds + 44), extFlip7, (void **)&pFlip7, "Flip(S7)");
SetHook((void *)(**(DWORD **)lplpdds + 48), extGetAttachedSurface7, (void **)&pGetAttachedSurface7, "GetAttachedSurface(S7)");
SetHook((void *)(**(DWORD **)lplpdds + 56), extGetCaps7S, (void **)&pGetCaps7S, "GetCaps(S7)");
@ -1465,6 +1489,8 @@ static void HandleCapsD(char *sLabel, LPDDCAPS c)
c->dwCKeyCaps, ExplainDDCKeyCaps(c->dwCKeyCaps));
OutTraceDDRAW("GetCaps(%s): VidMemTotal=%x VidMemFree=%x ZBufferBitDepths=%x(%s)\n",
sLabel, c->dwVidMemTotal, c->dwVidMemFree, c->dwZBufferBitDepths, ExplainZBufferBitDepths(c->dwZBufferBitDepths));
OutTraceDDRAW("GetCaps(%s): MaxVisibleOverlays=%x CurrVisibleOverlays=%x\n",
sLabel, c->dwMaxVisibleOverlays, c->dwCurrVisibleOverlays);
if(dxw.dwFlags2 & LIMITRESOURCES){ // check for memory value overflow
const DWORD dwMaxMem = 0x70000000;
if(c->dwVidMemTotal > dwMaxMem) c->dwVidMemTotal = dwMaxMem;
@ -1530,6 +1556,14 @@ static HRESULT WINAPI extGetCapsD(int dxversion, GetCapsD_Type pGetCapsD, LPDIRE
if(dxw.dwFlags3 & CAPMASK) MaskCapsD(c1, c2);
if(dxw.dwFlags7 & SUPPRESSOVERLAY){
#define LAYERCAPS (DDCAPS_OVERLAY|DDCAPS_OVERLAYCANTCLIP|DDCAPS_OVERLAYFOURCC|DDCAPS_OVERLAYSTRETCH)
c1->ddsCaps.dwCaps &= ~LAYERCAPS;
c2->ddsCaps.dwCaps &= ~LAYERCAPS;
c1->dwMaxVisibleOverlays = c1->dwCurrVisibleOverlays = 0;
c2->dwMaxVisibleOverlays = c2->dwCurrVisibleOverlays = 0;
}
return res;
}
@ -2080,9 +2114,11 @@ HRESULT WINAPI extGetDisplayMode(GetDisplayMode_Type pGetDisplayMode, LPDIRECTDR
lpddsd->dwHeight = dxw.GetScreenHeight();
// v2.1.96: fake screen color depth
if(dxw.dwFlags2 & (INIT8BPP|INIT16BPP)){ // v2.02.32 fix
if((dxw.dwFlags2 & (INIT8BPP|INIT16BPP)) || (dxw.dwFlags7 & (INIT24BPP|INIT32BPP))){ // v2.02.32 fix
if(dxw.dwFlags2 & INIT8BPP) FixPixelFormat(8, &lpddsd->ddpfPixelFormat);
if(dxw.dwFlags2 & INIT16BPP) FixPixelFormat(16, &lpddsd->ddpfPixelFormat);
if(dxw.dwFlags7 & INIT24BPP) FixPixelFormat(24, &lpddsd->ddpfPixelFormat);
if(dxw.dwFlags7 & INIT32BPP) FixPixelFormat(32, &lpddsd->ddpfPixelFormat);
OutTraceDW("GetDisplayMode: fix RGBBitCount=%d\n", lpddsd->ddpfPixelFormat.dwRGBBitCount);
}
}
@ -5759,3 +5795,49 @@ HRESULT WINAPI extDirectDrawCreateClipper(DWORD dwFlags, LPDIRECTDRAWCLIPPER *lp
HookDDClipper(lplpDDClipper);
return res;
}
HRESULT WINAPI extEnumOverlayZOrders(int dxversion, EnumOverlayZOrders_Type pEnumOverlayZOrders, LPDIRECTDRAWSURFACE lpdds, DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpfnCallback)
{
HRESULT res;
OutTrace("EnumOverlayZOrders(%d): lpdds=%x flags=%x(%s)\n", dxversion, lpdds, dwFlags, dwFlags?"FRONTTOBACK":"BACKTOFRONT");
res = (*pEnumOverlayZOrders)(lpdds, dwFlags, lpContext, lpfnCallback);
OutTrace("EnumOverlayZOrders: res=%x(%s)\n", res, ExplainDDError(res));
return res;
}
HRESULT WINAPI extEnumOverlayZOrders1(LPDIRECTDRAWSURFACE lpdds, DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpfnCallback)
{ return extEnumOverlayZOrders(1, pEnumOverlayZOrders1, lpdds, dwFlags, lpContext, lpfnCallback); }
HRESULT WINAPI extEnumOverlayZOrders2(LPDIRECTDRAWSURFACE lpdds, DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpfnCallback)
{ return extEnumOverlayZOrders(2, pEnumOverlayZOrders2, lpdds, dwFlags, lpContext, lpfnCallback); }
HRESULT WINAPI extEnumOverlayZOrders3(LPDIRECTDRAWSURFACE lpdds, DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpfnCallback)
{ return extEnumOverlayZOrders(3, pEnumOverlayZOrders3, lpdds, dwFlags, lpContext, lpfnCallback); }
HRESULT WINAPI extEnumOverlayZOrders4(LPDIRECTDRAWSURFACE lpdds, DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpfnCallback)
{ return extEnumOverlayZOrders(4, pEnumOverlayZOrders4, lpdds, dwFlags, lpContext, lpfnCallback); }
HRESULT WINAPI extEnumOverlayZOrders7(LPDIRECTDRAWSURFACE lpdds, DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpfnCallback)
{ return extEnumOverlayZOrders(7, pEnumOverlayZOrders7, lpdds, dwFlags, lpContext, lpfnCallback); }
HRESULT WINAPI extAddOverlayDirtyRect(int dxversion, AddOverlayDirtyRect_Type pAddOverlayDirtyRect, LPDIRECTDRAWSURFACE lpdds, LPRECT lpRect)
{
HRESULT res;
char sInfo[128];
if (lpRect)
sprintf(sInfo, "(%d,%d)-(%d,%d)", lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);
else
sprintf(sInfo, "(NULL)");
OutTrace("AddOverlayDirtyRect(%d): lpdds=%x rect=%s\n", dxversion, lpdds, sInfo);
res=(*pAddOverlayDirtyRect)(lpdds, lpRect);
OutTrace("AddOverlayDirtyRect: res=%x(%s)\n", res, ExplainDDError(res));
return res;
}
HRESULT WINAPI extAddOverlayDirtyRect1(LPDIRECTDRAWSURFACE lpdds, LPRECT lpRect)
{ return extAddOverlayDirtyRect(1, pAddOverlayDirtyRect1, lpdds, lpRect); }
HRESULT WINAPI extAddOverlayDirtyRect2(LPDIRECTDRAWSURFACE lpdds, LPRECT lpRect)
{ return extAddOverlayDirtyRect(2, pAddOverlayDirtyRect2, lpdds, lpRect); }
HRESULT WINAPI extAddOverlayDirtyRect3(LPDIRECTDRAWSURFACE lpdds, LPRECT lpRect)
{ return extAddOverlayDirtyRect(3, pAddOverlayDirtyRect3, lpdds, lpRect); }
HRESULT WINAPI extAddOverlayDirtyRect4(LPDIRECTDRAWSURFACE lpdds, LPRECT lpRect)
{ return extAddOverlayDirtyRect(4, pAddOverlayDirtyRect4, lpdds, lpRect); }
HRESULT WINAPI extAddOverlayDirtyRect7(LPDIRECTDRAWSURFACE lpdds, LPRECT lpRect)
{ return extAddOverlayDirtyRect(7, pAddOverlayDirtyRect7, lpdds, lpRect); }

View File

@ -127,7 +127,7 @@ static char *Flag6Names[32]={
static char *Flag7Names[32]={
"LIMITDDRAW", "DISABLEDISABLEALTTAB", "FIXCLIPPERAREA", "HOOKDIRECTSOUND",
"HOOKSMACKW32", "BLOCKPRIORITYCLASS", "CPUSLOWDOWN", "CPUMAXUSAGE",
"", "", "", "",
"NOWINERRORS", "SUPPRESSOVERLAY", "INIT24BPP", "INIT32BPP",
"", "", "", "",
"", "", "", "",
"", "", "", "",
@ -1312,14 +1312,6 @@ void HookInit(TARGETMAP *target, HWND hwnd)
if (dxw.dwFlags7 & CPUMAXUSAGE) OutTrace("HookInit: CPU maxusage ratio 1:%d\n", dxw.SlowRatio);
}
{
// Beware: for some strange & mysterious reason, this call makes Warcraft II and other games
// work better, avoiding something that resembles a black palette (no blit errors, but the
// whole screen black!!) and an AERO rupture.
PIXELFORMATDESCRIPTOR pfd;
DescribePixelFormat(GetDC(GetDesktopWindow()), 1, sizeof(PIXELFORMATDESCRIPTOR), &pfd);
}
if (hwnd && IsDebug){
DWORD dwStyle, dwExStyle;
char ClassName[81];
@ -1425,8 +1417,8 @@ void HookInit(TARGETMAP *target, HWND hwnd)
if (dxw.dwFlags1 & MESSAGEPROC){
extern HINSTANCE hInst;
typedef HHOOK (WINAPI *SetWindowsHookEx_Type)(int, HOOKPROC, HINSTANCE, DWORD);
extern SetWindowsHookEx_Type pSetWindowsHookEx;
hMouseHook=(*pSetWindowsHookEx)(WH_GETMESSAGE, MessageHook, hInst, GetCurrentThreadId());
extern SetWindowsHookEx_Type pSetWindowsHookExA;
hMouseHook=(*pSetWindowsHookExA)(WH_GETMESSAGE, MessageHook, hInst, GetCurrentThreadId());
if(hMouseHook==NULL) OutTraceE("SetWindowsHookEx WH_GETMESSAGE failed: error=%d\n", GetLastError());
}

View File

@ -27,7 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "TlHelp32.h"
#define VERSION "2.03.69"
#define VERSION "2.03.70"
#define DDTHREADLOCK 1
//#define LOCKTHREADS

Binary file not shown.

View File

@ -125,9 +125,14 @@ BOOL WINAPI extRoundRect(HDC, int, int, int, int, int, int);
typedef BOOL (WINAPI *PolyPolygon_Type)(HDC, const POINT *, const INT *, int);
PolyPolygon_Type pPolyPolygon = NULL;
BOOL WINAPI extPolyPolygon(HDC, const POINT *, const INT *, int);
//typedef BOOL (WINAPI *DPtoLP_Type)(HDC, LPPOINT, int);
//DPtoLP_Type pDPtoLP = NULL;
//BOOL WINAPI extDPtoLP(HDC, LPPOINT, int);
static HookEntryEx_Type Hooks[]={
//{HOOK_IAT_CANDIDATE, 0, "DPtoLP", (FARPROC)DPtoLP, (FARPROC *)&pDPtoLP, (FARPROC)extDPtoLP},
{HOOK_IAT_CANDIDATE, 0, "GetDeviceCaps", (FARPROC)GetDeviceCaps, (FARPROC *)&pGDIGetDeviceCaps, (FARPROC)extGetDeviceCaps},
{HOOK_IAT_CANDIDATE, 0, "ScaleWindowExtEx", (FARPROC)ScaleWindowExtEx, (FARPROC *)&pGDIScaleWindowExtEx, (FARPROC)extScaleWindowExtEx},
{HOOK_IAT_CANDIDATE, 0, "SaveDC", (FARPROC)SaveDC, (FARPROC *)&pGDISaveDC, (FARPROC)extGDISaveDC},
@ -426,9 +431,11 @@ int WINAPI extGetDeviceCaps(HDC hdc, int nindex)
break;
case BITSPIXEL:
case COLORRES:
if(dxw.dwFlags2 & (INIT8BPP|INIT16BPP)){ // v2.02.32 fix
if((dxw.dwFlags2 & (INIT8BPP|INIT16BPP)) || (dxw.dwFlags7 & (INIT24BPP|INIT32BPP))){ // v2.02.32 fix
if(dxw.dwFlags2 & INIT8BPP) res = 8;
if(dxw.dwFlags2 & INIT16BPP) res = 16;
if(dxw.dwFlags7 & INIT24BPP) res = 24;
if(dxw.dwFlags7 & INIT32BPP) res = 32;
OutTraceDW("GetDeviceCaps: fix(2) BITSPIXEL/COLORRES cap=%d\n", res);
}
break;
@ -452,6 +459,8 @@ int WINAPI extGetDeviceCaps(HDC hdc, int nindex)
if(dxw.VirtualPixelFormat.dwRGBBitCount!=0) res = dxw.VirtualPixelFormat.dwRGBBitCount;
if(dxw.dwFlags2 & INIT8BPP) res = 8;
if(dxw.dwFlags2 & INIT16BPP) res = 16;
if(dxw.dwFlags7 & INIT24BPP) res = 24;
if(dxw.dwFlags7 & INIT32BPP) res = 32;
if(PrevRes != res) OutTraceDW("GetDeviceCaps: fix(3) BITSPIXEL/COLORRES cap=%d\n", res);
break;
case SIZEPALETTE:
@ -3291,3 +3300,15 @@ BOOL WINAPI extPolyPolygon(HDC hdc, const POINT *lpPoints, const INT *lpPolyCoun
if(!ret) OutTraceE("PolyPolygon ERROR: err=%d\n", GetLastError());
return ret;
}
#if 0
BOOL WINAPI extDPtoLP(HDC hdc, LPPOINT lpPoints, int nCount)
{
BOOL ret;
OutTrace("DPtoLP: hdc=%x, nCount=%d\n", hdc, nCount);
for(int i=0; i<nCount; i++) OutTrace("point[%d]=(%d,%d)\n", i, lpPoints[i].x, lpPoints[i].y);
ret = (*pDPtoLP)(hdc, lpPoints, nCount);
for(int i=0; i<nCount; i++) OutTrace("point[%d]=(%d,%d)\n", i, lpPoints[i].x, lpPoints[i].y);
return ret;
}
#endif

View File

@ -11,6 +11,17 @@
extern HHOOK hMouseHook;
/*
typedef struct tagMSG {
HWND hwnd; // A handle to the window whose window procedure receives the message. This member is NULL when the message is a thread message.
UINT message; // The message identifier. Applications can only use the low word; the high word is reserved by the system.
WPARAM wParam; // Additional information about the message. The exact meaning depends on the value of the message member.
LPARAM lParam; // Additional information about the message. The exact meaning depends on the value of the message member.
DWORD time; // The time at which the message was posted.
POINT pt; // The cursor position, in screen coordinates, when the message was posted.
} MSG, *PMSG, *LPMSG;
*/
LRESULT CALLBACK MessageHook(int code, WPARAM wParam, LPARAM lParam)
{
static BOOL SizeMoving = FALSE;
@ -19,8 +30,8 @@ LRESULT CALLBACK MessageHook(int code, WPARAM wParam, LPARAM lParam)
if(dxw.IsFullScreen()){
MSG *msg;
msg = (MSG *)lParam;
OutTraceC("MessageHook: hwnd=%x message=%d(%s) remove=%d pt=(%d,%d)\n",
msg->hwnd, msg->message, ExplainWinMessage(msg->message), msg->wParam, msg->pt.x, msg->pt.y);
OutTraceC("MessageHook: hwnd=%x message=%d(%s) remove=%d params=(L:%x,R:%x) pt=(%d,%d)\n",
msg->hwnd, msg->message, ExplainWinMessage(msg->message), wParam, msg->lParam, msg->wParam, msg->pt.x, msg->pt.y);
switch(msg->message){
case WM_ENTERSIZEMOVE: SizeMoving = TRUE; break;
@ -43,8 +54,11 @@ LRESULT CALLBACK MessageHook(int code, WPARAM wParam, LPARAM lParam)
// fix the message point coordinates
POINT upleft={0,0};
POINT pt;
// v2.03.36: offset to be calculated from target window
(*pClientToScreen)(msg->hwnd, &upleft);
HWND hwnd;
// v2.03.36: offset to be calculated from target window
// v2-03.70: unless is a thread message (hwnd == NULL) !!
hwnd=(msg->hwnd)?msg->hwnd:dxw.GethWnd();
(*pClientToScreen)(hwnd, &upleft);
pt = msg->pt;
pt = dxw.SubCoordinates(pt, upleft);
pt=dxw.FixCursorPos(pt);

File diff suppressed because it is too large Load Diff

View File

@ -32,8 +32,10 @@ typedef BOOL (WINAPI *SetForegroundWindow_Type)(HWND);
SetForegroundWindow_Type pSetForegroundWindow = NULL;
BOOL WINAPI extSetForegroundWindow(HWND);
typedef HHOOK (WINAPI *SetWindowsHookEx_Type)(int, HOOKPROC, HINSTANCE, DWORD);
SetWindowsHookEx_Type pSetWindowsHookEx = NULL;
HHOOK WINAPI extSetWindowsHookEx(int, HOOKPROC, HINSTANCE, DWORD);
SetWindowsHookEx_Type pSetWindowsHookExA = NULL;
SetWindowsHookEx_Type pSetWindowsHookExW = NULL;
HHOOK WINAPI extSetWindowsHookExA(int, HOOKPROC, HINSTANCE, DWORD);
HHOOK WINAPI extSetWindowsHookExW(int, HOOKPROC, HINSTANCE, DWORD);
typedef BOOL (WINAPI *PostMessageA_Type)(HWND, UINT, WPARAM, LPARAM);
PostMessageA_Type pPostMessageA = NULL;
BOOL WINAPI extPostMessageA(HWND, UINT, WPARAM, LPARAM);
@ -167,7 +169,8 @@ static HookEntryEx_Type Hooks[]={
{HOOK_HOT_CANDIDATE, 0, "ChildWindowFromPoint", (FARPROC)ChildWindowFromPoint, (FARPROC *)&pChildWindowFromPoint, (FARPROC)extChildWindowFromPoint},
{HOOK_HOT_CANDIDATE, 0, "ChildWindowFromPointEx", (FARPROC)ChildWindowFromPointEx, (FARPROC *)&pChildWindowFromPointEx, (FARPROC)extChildWindowFromPointEx},
{HOOK_HOT_CANDIDATE, 0, "WindowFromPoint", (FARPROC)WindowFromPoint, (FARPROC *)&pWindowFromPoint, (FARPROC)extWindowFromPoint},
{HOOK_HOT_REQUIRED, 0 ,"SetWindowsHookExA", (FARPROC)SetWindowsHookExA, (FARPROC *)&pSetWindowsHookEx, (FARPROC)extSetWindowsHookEx},
{HOOK_HOT_REQUIRED, 0 ,"SetWindowsHookExA", (FARPROC)SetWindowsHookExA, (FARPROC *)&pSetWindowsHookExA, (FARPROC)extSetWindowsHookExA},
{HOOK_HOT_REQUIRED, 0 ,"SetWindowsHookExW", (FARPROC)SetWindowsHookExW, (FARPROC *)&pSetWindowsHookExW, (FARPROC)extSetWindowsHookExW},
//{HOOK_HOT_CANDIDATE, 0, "MessageBoxTimeoutA", (FARPROC)NULL, (FARPROC *)&pMessageBoxTimeoutA, (FARPROC)extMessageBoxTimeoutA},
//{HOOK_HOT_CANDIDATE, 0, "MessageBoxTimeoutW", (FARPROC)NULL, (FARPROC *)&pMessageBoxTimeoutW, (FARPROC)extMessageBoxTimeoutW},
@ -3050,6 +3053,7 @@ BOOL WINAPI extSystemParametersInfoA(UINT uiAction, UINT uiParam, PVOID pvParam,
*cli = dxw.GetScreenRect();
OutTraceDW("SystemParametersInfoA: resized client workarea rect=(%d,%d)-(%d,%d)\n", cli->left, cli->top, cli->right, cli->bottom);
}
if(!ret) OutTraceE("SystemParametersInfoA ERROR: err=%d\n", GetLastError());
return ret;
}
@ -3070,6 +3074,7 @@ BOOL WINAPI extSystemParametersInfoW(UINT uiAction, UINT uiParam, PVOID pvParam,
*cli = dxw.GetScreenRect();
OutTraceDW("SystemParametersInfoW: resized client workarea rect=(%d,%d)-(%d,%d)\n", cli->left, cli->top, cli->right, cli->bottom);
}
if(!ret) OutTraceE("SystemParametersInfoW ERROR: err=%d\n", GetLastError());
return ret;
}
@ -3396,10 +3401,14 @@ LRESULT CALLBACK extMessageHookProc(int code, WPARAM wParam, LPARAM lParam)
return ret;
}
HHOOK WINAPI extSetWindowsHookEx(int idHook, HOOKPROC lpfn, HINSTANCE hMod, DWORD dwThreadId)
static HHOOK WINAPI extSetWindowsHookEx(SetWindowsHookEx_Type pSetWindowsHookEx, int idHook, HOOKPROC lpfn, HINSTANCE hMod, DWORD dwThreadId)
{
HHOOK ret;
OutTraceDW("SetWindowsHookEx: id=%x threadid=%x\n", idHook, dwThreadId);
if(dxw.dwFlags5 & EASPORTSHACK){
OutTraceDW("SetWindowsHookEx: EASPORTSHACK bypass active\n");
if(idHook == WH_MOUSE) return NULL;
if(idHook == WH_GETMESSAGE) {
glpMessageHookProcessFunction = lpfn;
@ -3407,16 +3416,26 @@ HHOOK WINAPI extSetWindowsHookEx(int idHook, HOOKPROC lpfn, HINSTANCE hMod, DWOR
}
}
// v2.03.39: "One Must Fall Battlegrounds" keyboard fix
if((idHook == WH_KEYBOARD) && (dwThreadId == NULL)) dwThreadId = GetCurrentThreadId();
if((idHook == WH_KEYBOARD) && (dwThreadId == NULL)) {
dwThreadId = GetCurrentThreadId();
OutTraceDW("SetWindowsHookEx: fixing WH_KEYBOARD thread=0->%x\n", dwThreadId);
}
// v2.03.54: disable the disable Alt-Tab fix
if((dxw.dwFlags7 & DISABLEDISABLEALTTAB) && (idHook == WH_KEYBOARD_LL)) return NULL;
if((dxw.dwFlags7 & DISABLEDISABLEALTTAB) && (idHook == WH_KEYBOARD_LL)) {
OutTraceDW("SetWindowsHookEx: DISABLEDISABLEALTTAB bypass active\n");
return NULL;
}
ret=(*pSetWindowsHookEx)(idHook, lpfn, hMod, dwThreadId);
return ret;
}
HHOOK WINAPI extSetWindowsHookExA(int idHook, HOOKPROC lpfn, HINSTANCE hMod, DWORD dwThreadId)
{ return extSetWindowsHookEx(pSetWindowsHookExA, idHook, lpfn, hMod, dwThreadId); }
HHOOK WINAPI extSetWindowsHookExW(int idHook, HOOKPROC lpfn, HINSTANCE hMod, DWORD dwThreadId)
{ return extSetWindowsHookEx(pSetWindowsHookExW, idHook, lpfn, hMod, dwThreadId); }
HRESULT WINAPI extMessageBoxTimeoutA(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType, WORD wLanguageId, DWORD dwMilliseconds)
{

View File

@ -303,7 +303,9 @@ LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
}
break;
case WM_NCHITTEST:
// which one is good ?
if((dxw.dwFlags2 & FIXNCHITTEST) && (dxw.dwFlags1 & MODIFYMOUSE)){ // mouse processing
//if((dxw.dwFlags2 & FIXNCHITTEST) && (dxw.dwFlags1 & MODIFYMOUSE) && !(dxw.dwFlags1 & MESSAGEPROC)){ // mouse processing
POINT cursor;
LRESULT ret;
ret=(*pDefWindowProcA)(hwnd, message, wparam, lparam);
@ -312,6 +314,7 @@ LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
cursor.y=HIWORD(lparam);
dxw.FixNCHITCursorPos(&cursor);
lparam = MAKELPARAM(cursor.x, cursor.y);
OutTraceC("WindowProc[%x]: fixed WM_NCHITTEST pt=(%d,%d)\n", hwnd, cursor.x, cursor.y);
}
else
return ret;

View File

@ -46,9 +46,8 @@ void CTabCompat::DoDataExchange(CDataExchange* pDX)
DDX_Check(pDX, IDC_DISABLEDISABLEALTTAB, cTarget->m_DisableDisableAltTab);
DDX_Check(pDX, IDC_NOIMAGEHLP, cTarget->m_NoImagehlp);
DDX_Check(pDX, IDC_REPLACEPRIVOPS, cTarget->m_ReplacePrivOps);
DDX_Check(pDX, IDC_HOOKDIRECTSOUND, cTarget->m_HookDirectSound);
DDX_Check(pDX, IDC_HOOKSMACKW32, cTarget->m_HookSmackW32);
DDX_Check(pDX, IDC_BLOCKPRIORITYCLASS, cTarget->m_BlockPriorityClass);
DDX_Check(pDX, IDC_COLORFIX, cTarget->m_ColorFix);
// Registry management
DDX_Check(pDX, IDC_EMULATEREGISTRY, cTarget->m_EmulateRegistry);

View File

@ -46,6 +46,7 @@ void CTabDirect3D::DoDataExchange(CDataExchange* pDX)
DDX_Check(pDX, IDC_SETZBUFFERBITDEPTHS, cTarget->m_SetZBufferBitDepths);
DDX_Check(pDX, IDC_DEINTERLACE, cTarget->m_Deinterlace);
DDX_Check(pDX, IDC_LIMITDDRAW, cTarget->m_LimitDdraw);
DDX_Check(pDX, IDC_SUPPRESSOVERLAY, cTarget->m_SuppressOverlay);
DDX_CBIndex(pDX, IDC_DDWAWLIMITCOMBO, cTarget->m_MaxDdrawInterface);
// Texture management

View File

@ -37,6 +37,10 @@ void CTabHook::DoDataExchange(CDataExchange* pDX)
// Kernel32
DDX_Radio(pDX, IDC_SONDEFAULT, cTarget->m_SonProcessMode);
// additional hooks
DDX_Check(pDX, IDC_HOOKSMACKW32, cTarget->m_HookSmackW32);
DDX_Check(pDX, IDC_HOOKDIRECTSOUND, cTarget->m_HookDirectSound);
}
BEGIN_MESSAGE_MAP(CTabHook, CDialog)

View File

@ -50,15 +50,13 @@ void CTabWindow::DoDataExchange(CDataExchange* pDX)
DDX_Check(pDX, IDC_ACTIVATEAPP, cTarget->m_ActivateApp);
// color management
DDX_Check(pDX, IDC_INIT8BPP, cTarget->m_Init8BPP);
DDX_Check(pDX, IDC_INIT16BPP, cTarget->m_Init16BPP);
DDX_Radio(pDX, IDC_COLORCURRENT, cTarget->m_InitColorDepth);
DDX_Check(pDX, IDC_DISABLEGAMMARAMP, cTarget->m_DisableGammaRamp);
DDX_Check(pDX, IDC_FORCE16BPP, cTarget->m_Force16BPP);
DDX_Check(pDX, IDC_BLACKWHITE, cTarget->m_BlackWhite);
DDX_Check(pDX, IDC_USERGB565, cTarget->m_UseRGB565);
DDX_Check(pDX, IDC_LOCKSYSCOLORS, cTarget->m_LockSysColors);
DDX_Check(pDX, IDC_LOCKRESERVEDPALETTE, cTarget->m_LockReservedPalette);
DDX_Check(pDX, IDC_COLORFIX, cTarget->m_ColorFix);
// screen resolution management
DDX_Check(pDX, IDC_LIMITSCREENRES, cTarget->m_LimitScreenRes);

View File

@ -25,6 +25,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/)
m_MaxDdrawInterface = 6;
m_SlowRatio = 2;
m_Coordinates = 0;
m_InitColorDepth = 0; // default: current color depth
m_DxEmulationMode = 3; // default: emulated
m_DxFilterMode = 0; // default: ddraw filtering
m_DCEmulationMode = 0; // default: no emulation
@ -213,6 +214,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/)
m_CenterToWin = FALSE;
m_Deinterlace = FALSE;
m_LimitDdraw = FALSE;
m_SuppressOverlay = FALSE;
m_SurfaceWarn = FALSE;
m_CapMask = FALSE;
m_NoWindowHooks = FALSE;

View File

@ -27,6 +27,7 @@ public:
CEdit m_Launch;
int m_DXVersion;
int m_Coordinates;
int m_InitColorDepth;
int m_DxEmulationMode;
int m_DxFilterMode;
int m_DCEmulationMode;
@ -168,6 +169,7 @@ public:
BOOL m_CenterToWin;
BOOL m_Deinterlace;
BOOL m_LimitDdraw;
BOOL m_SuppressOverlay;
BOOL m_SurfaceWarn;
BOOL m_CapMask;
BOOL m_NoWindowHooks;

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -228,6 +228,14 @@ void SetTargetFromDlg(TARGETMAP *t, CTargetDlg *dlg)
break;
}
switch(dlg->m_InitColorDepth){
case 0: break;
case 1: t->flags2 |= INIT8BPP; break;
case 2: t->flags2 |= INIT16BPP; break;
case 3: t->flags7 |= INIT24BPP; break;
case 4: t->flags7 |= INIT32BPP; break;
}
switch(dlg->m_DxFilterMode){
case 0: break;
case 1: t->flags4 |= BILINEAR2XFILTER; break;
@ -403,8 +411,8 @@ void SetTargetFromDlg(TARGETMAP *t, CTargetDlg *dlg)
if(dlg->m_FixNCHITTEST) t->flags2 |= FIXNCHITTEST;
if(dlg->m_RecoverScreenMode) t->flags2 |= RECOVERSCREENMODE;
if(dlg->m_RefreshOnResize) t->flags2 |= REFRESHONRESIZE;
if(dlg->m_Init8BPP) t->flags2 |= INIT8BPP;
if(dlg->m_Init16BPP) t->flags2 |= INIT16BPP;
//if(dlg->m_Init8BPP) t->flags2 |= INIT8BPP;
//if(dlg->m_Init16BPP) t->flags2 |= INIT16BPP;
if(dlg->m_BackBufAttach) t->flags2 |= BACKBUFATTACH;
if(dlg->m_HandleAltF4) t->flags |= HANDLEALTF4;
if(dlg->m_LimitFPS) t->flags2 |= LIMITFPS;
@ -434,6 +442,7 @@ void SetTargetFromDlg(TARGETMAP *t, CTargetDlg *dlg)
if(dlg->m_CenterToWin) t->flags5 |= CENTERTOWIN;
if(dlg->m_Deinterlace) t->flags5 |= DEINTERLACE;
if(dlg->m_LimitDdraw) t->flags7 |= LIMITDDRAW;
if(dlg->m_SuppressOverlay) t->flags7 |= SUPPRESSOVERLAY;
if(dlg->m_NoPaletteUpdate) t->flags2 |= NOPALETTEUPDATE;
if(dlg->m_SurfaceWarn) t->flags3 |= SURFACEWARN;
if(dlg->m_CapMask) t->flags3 |= CAPMASK;
@ -534,6 +543,12 @@ static void SetDlgFromTarget(TARGETMAP *t, CTargetDlg *dlg)
if(t->flags5 & ENABLESONHOOK) dlg->m_SonProcessMode = 2;
if(t->flags5 & INJECTSON) dlg->m_SonProcessMode = 3;
dlg->m_InitColorDepth = 0;
if(t->flags2 & INIT8BPP) dlg->m_InitColorDepth = 1;
if(t->flags2 & INIT16BPP) dlg->m_InitColorDepth = 2;
if(t->flags7 & INIT24BPP) dlg->m_InitColorDepth = 3;
if(t->flags7 & INIT32BPP) dlg->m_InitColorDepth = 4;
dlg->m_HookDI = t->flags & HOOKDI ? 1 : 0;
dlg->m_HookDI8 = t->flags & HOOKDI8 ? 1 : 0;
dlg->m_EmulateRelMouse = t->flags6 & EMULATERELMOUSE ? 1 : 0;
@ -664,8 +679,8 @@ static void SetDlgFromTarget(TARGETMAP *t, CTargetDlg *dlg)
dlg->m_FixNCHITTEST = t->flags2 & FIXNCHITTEST ? 1 : 0;
dlg->m_RecoverScreenMode = t->flags2 & RECOVERSCREENMODE ? 1 : 0;
dlg->m_RefreshOnResize = t->flags2 & REFRESHONRESIZE ? 1 : 0;
dlg->m_Init8BPP = t->flags2 & INIT8BPP ? 1 : 0;
dlg->m_Init16BPP = t->flags2 & INIT16BPP ? 1 : 0;
//dlg->m_Init8BPP = t->flags2 & INIT8BPP ? 1 : 0;
//dlg->m_Init16BPP = t->flags2 & INIT16BPP ? 1 : 0;
dlg->m_BackBufAttach = t->flags2 & BACKBUFATTACH ? 1 : 0;
dlg->m_HandleAltF4 = t->flags & HANDLEALTF4 ? 1 : 0;
dlg->m_LimitFPS = t->flags2 & LIMITFPS ? 1 : 0;
@ -695,6 +710,7 @@ static void SetDlgFromTarget(TARGETMAP *t, CTargetDlg *dlg)
dlg->m_CenterToWin = t->flags5 & CENTERTOWIN ? 1 : 0;
dlg->m_Deinterlace = t->flags5 & DEINTERLACE ? 1 : 0;
dlg->m_LimitDdraw = t->flags7 & LIMITDDRAW ? 1 : 0;
dlg->m_SuppressOverlay = t->flags7 & SUPPRESSOVERLAY ? 1 : 0;
dlg->m_NoPaletteUpdate = t->flags2 & NOPALETTEUPDATE ? 1 : 0;
dlg->m_SurfaceWarn = t->flags3 & SURFACEWARN ? 1 : 0;
dlg->m_CapMask = t->flags3 & CAPMASK ? 1 : 0;

Binary file not shown.