diff --git a/Include/dxwnd.h b/Include/dxwnd.h index 67ef3b2..7db7414 100644 --- a/Include/dxwnd.h +++ b/Include/dxwnd.h @@ -257,3 +257,9 @@ typedef enum { DXW_LIMIT_1024x768, DXW_LIMIT_1280x960 } ResolutionLimits_Types; + +typedef enum { + TIMER_TYPE_NONE = 0, + TIMER_TYPE_USER32, + TIMER_TYPE_WINMM +} Timer_Types; diff --git a/build/dxwnd.dll b/build/dxwnd.dll index c8f3fe6..f9d7c81 100644 --- a/build/dxwnd.dll +++ b/build/dxwnd.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c24abb81ba8ba231b637a91ce227ef7f0ec20bccc36f9e8bea78f3e76d5ac2a2 -size 445440 +oid sha256:03271f56101f397e9d6ffc4c966d04af5ae7a94e2dfd2df958d185363586a74a +size 446976 diff --git a/build/dxwnd.exe b/build/dxwnd.exe index d304327..61146d9 100644 --- a/build/dxwnd.exe +++ b/build/dxwnd.exe @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:663ef886bb9f08ed3fea88ec675f0f213b8c60490183f2ad44984e5c7b6ef08d +oid sha256:8621dc8cebb19d5e945aeba4932dff40115f73c88209fe39e4388bef4822f621 size 535040 diff --git a/build/dxwnd.ini b/build/dxwnd.ini index 3371bb4..5c093a9 100644 --- a/build/dxwnd.ini +++ b/build/dxwnd.ini @@ -22,6 +22,8 @@ sizx0=800 sizy0=600 maxfps0=0 initts0=0 +winver0=0 +maxres0=0 title1=101 The Airborne Invasion of Normandy path1=D:\Games\101air\101.exe module1= @@ -45,6 +47,8 @@ sizx1=800 sizy1=600 maxfps1=0 initts1=0 +winver1=0 +maxres1=0 title2=A10 Cuba path2=D:\Games\A10\A10Cuba.exe module2= @@ -68,6 +72,8 @@ sizx2=800 sizy2=600 maxfps2=0 initts2=0 +winver2=0 +maxres2=0 title3=Actua Soccer 3 path3=D:\Games\ActuaSoccer3\SOCCER3D.EXE module3= @@ -91,6 +97,8 @@ sizx3=800 sizy3=600 maxfps3=0 initts3=0 +winver3=0 +maxres3=0 title4=Age of Empires III path4=D:\Games\Age of Empires III\age3.exe module4= @@ -114,6 +122,8 @@ sizx4=800 sizy4=600 maxfps4=0 initts4=0 +winver4=0 +maxres4=0 title5=Amerzone path5=D:\Games\Amerzone\amerzone.exe module5= @@ -137,6 +147,8 @@ sizx5=800 sizy5=600 maxfps5=0 initts5=0 +winver5=0 +maxres5=0 title6=Ancient Evil (DEMO) path6=D:\Games\Ancient Evil (Demo)\aecsc-demo.exe module6= @@ -160,6 +172,8 @@ sizx6=800 sizy6=600 maxfps6=0 initts6=0 +winver6=0 +maxres6=0 title7=Army Men RTS path7=D:\Games\Army Men RTS\amrts.exe module7= @@ -183,6 +197,8 @@ sizx7=800 sizy7=600 maxfps7=0 initts7=0 +winver7=0 +maxres7=0 title8=Beavis & Butthead Do U. path8=D:\Games\B_b\BEAVIS.EXE module8= @@ -206,6 +222,8 @@ sizx8=800 sizy8=600 maxfps8=0 initts8=0 +winver8=0 +maxres8=0 title9=Black & White path9=D:\Games\Black & White\runblack.exe module9= @@ -229,6 +247,8 @@ sizx9=800 sizy9=600 maxfps9=0 initts9=0 +winver9=0 +maxres9=0 title10=Bomberbabe path10=D:\Games\Ludonic\Bomberbabe.exe module10= @@ -252,6 +272,8 @@ sizx10=800 sizy10=600 maxfps10=0 initts10=0 +winver10=0 +maxres10=0 title11=Bunnies must die path11=D:\Games\Bunnies must die\bmd.exe module11= @@ -275,6 +297,8 @@ sizx11=800 sizy11=600 maxfps11=0 initts11=0 +winver11=0 +maxres11=0 title12=Carmageddon 2 (GLIDE) path12=D:\Games\Carmageddon_2\carma2_HW.exe module12= @@ -298,6 +322,8 @@ sizx12=800 sizy12=600 maxfps12=0 initts12=0 +winver12=0 +maxres12=0 title13=Carmageddon 2 (SW) path13=D:\Games\Carmageddon_2\carma2_SW.exe module13= @@ -321,6 +347,8 @@ sizx13=800 sizy13=600 maxfps13=0 initts13=0 +winver13=0 +maxres13=0 title14=Cave Story path14=D:\Games\Cave Story\Doukutsu.exe module14= @@ -344,6 +372,8 @@ sizx14=800 sizy14=600 maxfps14=0 initts14=0 +winver14=0 +maxres14=0 title15=Crimson Skies path15=D:\Games\Crimson_Skies\crimson.exe module15= @@ -367,6 +397,8 @@ sizx15=800 sizy15=600 maxfps15=0 initts15=0 +winver15=0 +maxres15=0 title16=Daikatana path16=D:\Games\Daikatana\daikatana.exe module16= @@ -390,6 +422,8 @@ sizx16=800 sizy16=600 maxfps16=0 initts16=0 +winver16=0 +maxres16=0 title17=Devastation path17=D:\Games\Devastation\System\Devastation.exe module17= @@ -413,6 +447,8 @@ sizx17=320 sizy17=240 maxfps17=0 initts17=0 +winver17=0 +maxres17=0 title18=Doom Shareware for Windows 95 path18=D:\Games\Doom Shareware for Windows 95\Doom95.exe module18= @@ -436,17 +472,19 @@ sizx18=800 sizy18=600 maxfps18=0 initts18=0 -title19=Duckman -path19=D:\Games\Duckman\DUCKMAN.EXE +winver18=0 +maxres18=0 +title19=Dracula Twins +path19=D:\Games\Dracula Twins\DraculaTwins.exe module19= opengllib19= ver19=0 coord19=0 flag19=134217762 -flagg19=1209008128 -flagh19=33554452 +flagg19=1207959552 +flagh19=20 flagi19=4 -tflag19=3 +tflag19=0 initx19=0 inity19=0 minx19=0 @@ -459,17 +497,19 @@ sizx19=800 sizy19=600 maxfps19=0 initts19=0 -title20=Duke Nukem 3D -path20=D:\Games\Duke3d\DUKE3D.EXE +winver19=0 +maxres19=0 +title20=Duckman +path20=D:\Games\Duckman\DUCKMAN.EXE module20= opengllib20= ver20=0 coord20=0 flag20=134217762 -flagg20=1207959552 -flagh20=20 +flagg20=1209008128 +flagh20=33554452 flagi20=4 -tflag20=0 +tflag20=3 initx20=0 inity20=0 minx20=0 @@ -482,17 +522,19 @@ sizx20=800 sizy20=600 maxfps20=0 initts20=0 -title21=Dungeon Keeper 2 (GOG) -path21=D:\Games\Dungeon Keeper 2 (GOG)\DKII.EXE +winver20=0 +maxres20=0 +title21=Duke Nukem 3D +path21=D:\Games\Duke3d\DUKE3D.EXE module21= opengllib21= ver21=0 coord21=0 -flag21=136331298 -flagg21=1241513984 +flag21=134217762 +flagg21=1207959552 flagh21=20 -flagi21=0 -tflag21=258 +flagi21=4 +tflag21=0 initx21=0 inity21=0 minx21=0 @@ -505,17 +547,19 @@ sizx21=800 sizy21=600 maxfps21=0 initts21=0 -title22=Dungeon Lords MMXII -path22=D:\Games\Dungeon Lords MMXII\dlords2012.exe +winver21=0 +maxres21=0 +title22=Dungeon Keeper 2 (GOG) +path22=D:\Games\Dungeon Keeper 2 (GOG)\DKII.EXE module22= opengllib22= ver22=0 coord22=0 -flag22=134217762 -flagg22=1207959552 +flag22=136331298 +flagg22=1241513984 flagh22=20 -flagi22=4 -tflag22=0 +flagi22=0 +tflag22=258 initx22=0 inity22=0 minx22=0 @@ -528,17 +572,19 @@ sizx22=800 sizy22=600 maxfps22=0 initts22=0 -title23=Empire Earth -path23=D:\Games\Empire Earth\Empire Earth.exe +winver22=0 +maxres22=0 +title23=Dungeon Lords MMXII +path23=D:\Games\Dungeon Lords MMXII\dlords2012.exe module23= opengllib23= ver23=0 coord23=0 -flag23=-1459617632 -flagg23=201326848 -flagh23=84 -flagi23=0 -tflag23=262 +flag23=134217762 +flagg23=1207959552 +flagh23=20 +flagi23=4 +tflag23=0 initx23=0 inity23=0 minx23=0 @@ -547,21 +593,23 @@ maxx23=0 maxy23=0 posx23=50 posy23=50 -sizx23=0 -sizy23=0 +sizx23=800 +sizy23=600 maxfps23=0 initts23=0 -title24=F-16 Fighting Falcon -path24=D:\Games\F16\f1695.exe +winver23=0 +maxres23=0 +title24=Empire Earth +path24=D:\Games\Empire Earth\Empire Earth.exe module24= opengllib24= ver24=0 coord24=0 -flag24=134217826 -flagg24=1209008128 -flagh24=20 -flagi24=4 -tflag24=258 +flag24=-1459617632 +flagg24=201326848 +flagh24=84 +flagi24=0 +tflag24=262 initx24=0 inity24=0 minx24=0 @@ -570,21 +618,23 @@ maxx24=0 maxy24=0 posx24=50 posy24=50 -sizx24=800 -sizy24=600 +sizx24=0 +sizy24=0 maxfps24=0 initts24=0 -title25=Fate -path25=D:\Games\Fate\Fate.exe +winver24=0 +maxres24=0 +title25=F-16 Fighting Falcon +path25=D:\Games\F16\f1695.exe module25= opengllib25= ver25=0 coord25=0 -flag25=134217762 -flagg25=1207959552 +flag25=134217826 +flagg25=1209008128 flagh25=20 flagi25=4 -tflag25=0 +tflag25=258 initx25=0 inity25=0 minx25=0 @@ -597,17 +647,19 @@ sizx25=800 sizy25=600 maxfps25=0 initts25=0 -title26=Fighting Force -path26=D:\Games\Fighting Force\game\fforce.exe +winver25=0 +maxres25=0 +title26=Fate +path26=D:\Games\Fate\Fate.exe module26= opengllib26= ver26=0 coord26=0 -flag26=134217824 +flag26=134217762 flagg26=1207959552 flagh26=20 flagi26=4 -tflag26=6163 +tflag26=0 initx26=0 inity26=0 minx26=0 @@ -620,17 +672,19 @@ sizx26=800 sizy26=600 maxfps26=0 initts26=0 -title27=Gangsters -path27=D:\Games\Gangsters\gangsters.exe +winver26=0 +maxres26=0 +title27=Fighting Force +path27=D:\Games\Fighting Force\game\fforce.exe module27= opengllib27= ver27=0 coord27=0 -flag27=1208483874 -flagg27=1209008128 +flag27=134217824 +flagg27=1207959552 flagh27=20 flagi27=4 -tflag27=0 +tflag27=6163 initx27=0 inity27=0 minx27=0 @@ -643,14 +697,16 @@ sizx27=800 sizy27=600 maxfps27=0 initts27=0 -title28=Grand Prix Legends -path28=D:\Games\gpl\gpl.exe +winver27=0 +maxres27=0 +title28=Gangsters +path28=D:\Games\Gangsters\gangsters.exe module28= opengllib28= ver28=0 coord28=0 -flag28=679485472 -flagg28=-939524096 +flag28=1208483874 +flagg28=1209008128 flagh28=20 flagi28=4 tflag28=0 @@ -666,16 +722,18 @@ sizx28=800 sizy28=600 maxfps28=0 initts28=0 -title29=Grand Prix World -path29=D:\Games\Grand Prix World\gpwxp2.exe +winver28=0 +maxres28=0 +title29=Grand Prix Legends +path29=D:\Games\gpl\gpl.exe module29= opengllib29= ver29=0 coord29=0 -flag29=134217762 -flagg29=135266432 +flag29=679485472 +flagg29=-939524096 flagh29=20 -flagi29=0 +flagi29=4 tflag29=0 initx29=0 inity29=0 @@ -689,17 +747,19 @@ sizx29=800 sizy29=600 maxfps29=0 initts29=0 -title30=GTA 3 -path30=D:\Games\GTA3\gta3.exe +winver29=0 +maxres29=0 +title30=Grand Prix World +path30=D:\Games\Grand Prix World\gpwxp2.exe module30= opengllib30= ver30=0 coord30=0 flag30=134217762 -flagg30=1207959552 +flagg30=135266432 flagh30=20 -flagi30=4 -tflag30=258 +flagi30=0 +tflag30=0 initx30=0 inity30=0 minx30=0 @@ -712,17 +772,19 @@ sizx30=800 sizy30=600 maxfps30=0 initts30=0 -title31=Hearts of Iron 2 -path31=D:\Games\Hearts of Iron 2\HoI2.exe +winver30=0 +maxres30=0 +title31=GTA 3 +path31=D:\Games\GTA3\gta3.exe module31= opengllib31= ver31=0 -coord31=2 -flag31=939526179 -flagg31=1207959568 -flagh31=32788 -flagi31=2 -tflag31=2 +coord31=0 +flag31=134217762 +flagg31=1207959552 +flagh31=20 +flagi31=4 +tflag31=258 initx31=0 inity31=0 minx31=0 @@ -735,17 +797,19 @@ sizx31=800 sizy31=600 maxfps31=0 initts31=0 -title32=Heroes of Might and Magic IV -path32=D:\Games\Heroes of Might and Magic IV\heroes4.exe +winver31=0 +maxres31=0 +title32=Half-Life +path32=D:\Games\Half-Life\hl.exe module32= opengllib32= -ver32=0 -coord32=2 -flag32=671350818 -flagg32=1207959568 -flagh32=-2147418092 -flagi32=1 -tflag32=258 +ver32=12 +coord32=0 +flag32=1207959584 +flagg32=1209139200 +flagh32=16 +flagi32=2060 +tflag32=4097 initx32=0 inity32=0 minx32=0 @@ -758,16 +822,18 @@ sizx32=800 sizy32=600 maxfps32=0 initts32=0 -title33=Hitman - Codename 47 -path33=D:\Games\Hitman - Codename 47\Hitman.Exe +winver32=0 +maxres32=0 +title33=Hearts of Iron 2 +path33=D:\Games\Hearts of Iron 2\HoI2.exe module33= opengllib33= -ver33=1 -coord33=0 -flag33=134234144 -flagg33=1207959808 -flagh33=20 -flagi33=4 +ver33=0 +coord33=2 +flag33=939526179 +flagg33=1207959568 +flagh33=32788 +flagi33=2 tflag33=2 initx33=0 inity33=0 @@ -781,17 +847,19 @@ sizx33=800 sizy33=600 maxfps33=0 initts33=0 -title34=Hitman 2 Silent Assassin -path34=D:\Games\Hitman 2 Silent Assassin\hitman2.exe +winver33=0 +maxres33=0 +title34=Heroes of Might and Magic IV +path34=D:\Games\Heroes of Might and Magic IV\heroes4.exe module34= opengllib34= ver34=0 coord34=2 -flag34=134234150 +flag34=671350818 flagg34=1207959568 -flagh34=20 -flagi34=4 -tflag34=0 +flagh34=-2147418092 +flagi34=1 +tflag34=258 initx34=0 inity34=0 minx34=0 @@ -804,17 +872,19 @@ sizx34=800 sizy34=600 maxfps34=0 initts34=0 -title35=Homeworld 2 -path35=D:\Games\Homeworld2\Bin\Release\Homeworld2.exe +winver34=0 +maxres34=0 +title35=Hitman - Codename 47 +path35=D:\Games\Hitman - Codename 47\Hitman.Exe module35= opengllib35= -ver35=0 +ver35=1 coord35=0 -flag35=671154178 -flagg35=134217728 -flagh35=285 -flagi35=0 -tflag35=0 +flag35=134234144 +flagg35=1207959808 +flagh35=20 +flagi35=4 +tflag35=2 initx35=0 inity35=0 minx35=0 @@ -827,14 +897,16 @@ sizx35=800 sizy35=600 maxfps35=0 initts35=0 -title36=Imperialism -path36=D:\Games\Imperialism\Imperialism.exe +winver35=0 +maxres35=0 +title36=Hitman 2 Silent Assassin +path36=D:\Games\Hitman 2 Silent Assassin\hitman2.exe module36= opengllib36= ver36=0 -coord36=0 -flag36=-1467998174 -flagg36=1209008128 +coord36=2 +flag36=134234150 +flagg36=1207959568 flagh36=20 flagi36=4 tflag36=0 @@ -850,16 +922,18 @@ sizx36=800 sizy36=600 maxfps36=0 initts36=0 -title37=Imperialism II -path37=D:\Games\Imperialism 2\imperialism II.exe +winver36=0 +maxres36=0 +title37=Homeworld 2 +path37=D:\Games\Homeworld2\Bin\Release\Homeworld2.exe module37= opengllib37= ver37=0 coord37=0 -flag37=679485474 -flagg37=1209008128 -flagh37=20 -flagi37=4 +flag37=671154178 +flagg37=134217728 +flagh37=285 +flagi37=0 tflag37=0 initx37=0 inity37=0 @@ -873,17 +947,19 @@ sizx37=800 sizy37=600 maxfps37=0 initts37=0 -title38=International Football 2000 -path38=D:\Games\International Football 2000\MSIF2000.ICD +winver37=0 +maxres37=0 +title38=Imperialism +path38=D:\Games\Imperialism\Imperialism.exe module38= opengllib38= ver38=0 coord38=0 -flag38=150994976 -flagg38=1207959552 +flag38=-1467998174 +flagg38=1209008128 flagh38=20 flagi38=4 -tflag38=258 +tflag38=0 initx38=0 inity38=0 minx38=0 @@ -896,16 +972,18 @@ sizx38=800 sizy38=600 maxfps38=0 initts38=0 -title39=Jet Moto -path39=D:\Games\Jet_Moto\JETMOTO.EXE +winver38=0 +maxres38=0 +title39=Imperialism II +path39=D:\Games\Imperialism 2\imperialism II.exe module39= opengllib39= ver39=0 coord39=0 -flag39=671088674 -flagg39=1207959568 -flagh39=20 -flagi39=0 +flag39=679485474 +flagg39=1207959552 +flagh39=32788 +flagi39=4 tflag39=0 initx39=0 inity39=0 @@ -919,17 +997,19 @@ sizx39=800 sizy39=600 maxfps39=0 initts39=0 -title40=KISS Pinball -path40=D:\Games\KISS Pinball\kisspin.exe +winver39=0 +maxres39=0 +title40=International Football 2000 +path40=D:\Games\International Football 2000\MSIF2000.ICD module40= opengllib40= -ver40=1 +ver40=0 coord40=0 -flag40=679616546 +flag40=150994976 flagg40=1207959552 -flagh40=98324 +flagh40=20 flagi40=4 -tflag40=259 +tflag40=258 initx40=0 inity40=0 minx40=0 @@ -942,17 +1022,19 @@ sizx40=800 sizy40=600 maxfps40=0 initts40=0 -title41=Kiss Psycho Circus -path41=D:\Games\Kiss\client.exe +winver40=0 +maxres40=0 +title41=Jet Moto +path41=D:\Games\Jet_Moto\JETMOTO.EXE module41= opengllib41= ver41=0 coord41=0 -flag41=134234148 -flagg41=-939523840 +flag41=671088674 +flagg41=1207959568 flagh41=20 -flagi41=16 -tflag41=2 +flagi41=0 +tflag41=0 initx41=0 inity41=0 minx41=0 @@ -965,17 +1047,19 @@ sizx41=800 sizy41=600 maxfps41=0 initts41=0 -title42=Knights Of Honor -path42=D:\Games\Knights Of Honor\KoH.exe +winver41=0 +maxres41=0 +title42=KISS Pinball +path42=D:\Games\KISS Pinball\kisspin.exe module42= opengllib42= -ver42=0 +ver42=1 coord42=0 -flag42=-402382814 +flag42=679616546 flagg42=1207959552 -flagh42=65556 +flagh42=98324 flagi42=4 -tflag42=6431 +tflag42=259 initx42=0 inity42=0 minx42=0 @@ -988,17 +1072,19 @@ sizx42=800 sizy42=600 maxfps42=0 initts42=0 -title43=KnightShift -path43=D:\Games\knightshift\KnightShift.ex1 +winver42=0 +maxres42=0 +title43=Kiss Psycho Circus +path43=D:\Games\Kiss\client.exe module43= opengllib43= -ver43=8 +ver43=0 coord43=0 -flag43=134217760 -flagg43=1207959552 +flag43=134234148 +flagg43=-939523840 flagh43=20 -flagi43=4 -tflag43=3 +flagi43=16 +tflag43=2 initx43=0 inity43=0 minx43=0 @@ -1011,17 +1097,19 @@ sizx43=800 sizy43=600 maxfps43=0 initts43=0 -title44=Kohan II Kings of War -path44=D:\Games\Kohan II Kings of War\k2.exe +winver43=0 +maxres43=0 +title44=Knights Of Honor +path44=D:\Games\Knights Of Honor\KoH.exe module44= opengllib44= -ver44=9 +ver44=0 coord44=0 -flag44=134217762 +flag44=-402382814 flagg44=1207959552 -flagh44=20 -flagi44=1028 -tflag44=6163 +flagh44=65556 +flagi44=4 +tflag44=6431 initx44=0 inity44=0 minx44=0 @@ -1034,17 +1122,19 @@ sizx44=800 sizy44=600 maxfps44=0 initts44=0 -title45=L.E.D. Wars (not working) -path45=D:\Games\l.e.d._wars\LED.EXE +winver44=0 +maxres44=0 +title45=KnightShift +path45=D:\Games\knightshift\KnightShift.ex1 module45= opengllib45= -ver45=1 +ver45=8 coord45=0 -flag45=679477282 -flagg45=1744830480 -flagh45=65556 +flag45=134217760 +flagg45=1207959552 +flagh45=20 flagi45=4 -tflag45=258 +tflag45=3 initx45=0 inity45=0 minx45=0 @@ -1057,17 +1147,19 @@ sizx45=800 sizy45=600 maxfps45=0 initts45=0 -title46=Land of the Dead -path46=D:\Games\Land of the Dead\System\LOTD.exe +winver45=0 +maxres45=0 +title46=Kohan II Kings of War +path46=D:\Games\Kohan II Kings of War\k2.exe module46= opengllib46= -ver46=0 -coord46=2 -flag46=134217766 -flagg46=1207959568 +ver46=9 +coord46=0 +flag46=134217762 +flagg46=1207959552 flagh46=20 -flagi46=0 -tflag46=64 +flagi46=1028 +tflag46=6163 initx46=0 inity46=0 minx46=0 @@ -1080,17 +1172,19 @@ sizx46=800 sizy46=600 maxfps46=0 initts46=0 -title47=Last Bronx -path47=D:\Games\Last_Bronx\LB.EXE +winver46=0 +maxres46=0 +title47=L.E.D. Wars (not working) +path47=D:\Games\l.e.d._wars\LED.EXE module47= opengllib47= -ver47=0 +ver47=1 coord47=0 -flag47=134217762 -flagg47=-939520000 -flagh47=20 +flag47=679477282 +flagg47=1744830480 +flagh47=65556 flagi47=4 -tflag47=0 +tflag47=258 initx47=0 inity47=0 minx47=0 @@ -1101,19 +1195,21 @@ posx47=50 posy47=50 sizx47=800 sizy47=600 -maxfps47=20 -initts47=4 -title48=LEGOŽ Marvel Super Heroes Demo -path48=C:\Program Files (x86)\Warner Bros. Interactive Entertainment\LEGOŽ Marvel Super Heroes Demo\LEGOMarvelDemo.exe +maxfps47=0 +initts47=0 +winver47=0 +maxres47=0 +title48=Land of the Dead +path48=D:\Games\Land of the Dead\System\LOTD.exe module48= opengllib48= ver48=0 -coord48=0 -flag48=134217762 -flagg48=1207959552 +coord48=2 +flag48=134217766 +flagg48=1207959568 flagh48=20 -flagi48=4 -tflag48=0 +flagi48=0 +tflag48=64 initx48=0 inity48=0 minx48=0 @@ -1126,17 +1222,19 @@ sizx48=800 sizy48=600 maxfps48=0 initts48=0 -title49=L'Elefante a Strisce -path49=D:\Games\L'Elefante a Strisce\Pilots1I.EXE +winver48=0 +maxres48=0 +title49=Last Bronx +path49=D:\Games\Last_Bronx\LB.EXE module49= opengllib49= ver49=0 coord49=0 flag49=134217762 -flagg49=135266368 +flagg49=-939520000 flagh49=20 -flagi49=0 -tflag49=64 +flagi49=4 +tflag49=0 initx49=0 inity49=0 minx49=0 @@ -1147,19 +1245,21 @@ posx49=50 posy49=50 sizx49=800 sizy49=600 -maxfps49=0 -initts49=0 -title50=Lords of Magic Special Edition -path50=D:\Games\LoM\SIERRA\LOMSE\lomse.exe +maxfps49=20 +initts49=4 +winver49=0 +maxres49=0 +title50=LEGOŽ Marvel Super Heroes Demo +path50=C:\Program Files (x86)\Warner Bros. Interactive Entertainment\LEGOŽ Marvel Super Heroes Demo\LEGOMarvelDemo.exe module50= opengllib50= ver50=0 coord50=0 -flag50=402669603 -flagg50=1207959568 -flagh50=6291476 -flagi50=0 -tflag50=6419 +flag50=134217762 +flagg50=1207959552 +flagh50=20 +flagi50=4 +tflag50=0 initx50=0 inity50=0 minx50=0 @@ -1172,20 +1272,19 @@ sizx50=800 sizy50=600 maxfps50=0 initts50=0 -title51=Lords of the Realm 2 +winver50=0 +maxres50=0 +title51=L'Elefante a Strisce +path51=D:\Games\L'Elefante a Strisce\Pilots1I.EXE module51= opengllib51= -title52=Lost Valley -module52= -opengllib52= -path51=D:\Games\Lords of the Realm 2\LORDS2.EXE ver51=0 coord51=0 flag51=134217762 -flagg51=1209008128 -flagh51=65556 -flagi51=4 -tflag51=0 +flagg51=135266368 +flagh51=20 +flagi51=0 +tflag51=64 initx51=0 inity51=0 minx51=0 @@ -1198,14 +1297,19 @@ sizx51=800 sizy51=600 maxfps51=0 initts51=0 -path52=D:\Games\Lost Valley\lost valley\lost valley data.exe +winver51=0 +maxres51=0 +title52=Lords of Magic Special Edition +path52=D:\Games\LoM\SIERRA\LOMSE\lomse.exe +module52= +opengllib52= ver52=0 coord52=0 -flag52=679485474 -flagg52=1207959552 -flagh52=-2080374764 +flag52=402669603 +flagg52=1207959568 +flagh52=6291476 flagi52=0 -tflag52=0 +tflag52=6419 initx52=0 inity52=0 minx52=0 @@ -1218,17 +1322,19 @@ sizx52=800 sizy52=600 maxfps52=0 initts52=0 -title53=Mageslayer -path53=D:\Games\MAGE\MAGESLAY.EXE +winver52=0 +maxres52=0 +title53=Lords of the Realm 2 +path53=D:\Games\Lords of the Realm 2\LORDS2.EXE module53= opengllib53= ver53=0 coord53=0 -flag53=136314914 -flagg53=1476395008 -flagh53=20 -flagi53=1 -tflag53=83 +flag53=134217762 +flagg53=1209008128 +flagh53=65556 +flagi53=4 +tflag53=0 initx53=0 inity53=0 minx53=0 @@ -1241,16 +1347,18 @@ sizx53=800 sizy53=600 maxfps53=0 initts53=0 -title54=Magic & Mayhem -path54=D:\Games\Magic_&_Mayhem\Chaos.exe +winver53=0 +maxres53=0 +title54=Lost Valley +path54=D:\Games\Lost Valley\lost valley\lost valley data.exe module54= opengllib54= ver54=0 coord54=0 -flag54=134217762 +flag54=679485474 flagg54=1207959552 -flagh54=20 -flagi54=4 +flagh54=-2080374764 +flagi54=0 tflag54=0 initx54=0 inity54=0 @@ -1264,17 +1372,19 @@ sizx54=800 sizy54=600 maxfps54=0 initts54=0 -title55=Motocross Madness (DEMO) -path55=D:\Games\Motocross Madness Trial\mcm.exe +winver54=0 +maxres54=0 +title55=Mageslayer +path55=D:\Games\MAGE\MAGESLAY.EXE module55= opengllib55= ver55=0 coord55=0 -flag55=134217760 -flagg55=1207959552 +flag55=136314914 +flagg55=1476395008 flagh55=20 -flagi55=0 -tflag55=0 +flagi55=1 +tflag55=83 initx55=0 inity55=0 minx55=0 @@ -1287,17 +1397,19 @@ sizx55=800 sizy55=600 maxfps55=0 initts55=0 -title56=Need for Speed 2SE -path56=D:\Games\Need for Speed 2SE\NFS2SEN.EXE +winver55=0 +maxres55=0 +title56=Magic & Mayhem +path56=D:\Games\Magic_&_Mayhem\Chaos.exe module56= opengllib56= ver56=0 coord56=0 -flag56=134217826 -flagg56=1480589312 +flag56=134217762 +flagg56=1207959552 flagh56=20 flagi56=4 -tflag56=6163 +tflag56=0 initx56=0 inity56=0 minx56=0 @@ -1310,17 +1422,19 @@ sizx56=800 sizy56=600 maxfps56=0 initts56=0 -title57=Need for Speed 2SE (3dfx) -path57=D:\Games\Need for Speed 2SE\nfs2sea.exe +winver56=0 +maxres56=0 +title57=Martian Gothic Unification +path57=D:\Games\Martian Gothic\martian gothic.exe module57= opengllib57= ver57=0 coord57=0 -flag57=134217760 -flagg57=1207959552 +flag57=203423776 +flagg57=1476395008 flagh57=20 -flagi57=4 -tflag57=6147 +flagi57=5 +tflag57=6163 initx57=0 inity57=0 minx57=0 @@ -1333,16 +1447,18 @@ sizx57=800 sizy57=600 maxfps57=0 initts57=0 -title58=Need for Speed 3 -path58=D:\Games\Need for Speed 3\nfs3.exe +winver57=0 +maxres57=0 +title58=Motocross Madness (DEMO) +path58=D:\Games\Motocross Madness Trial\mcm.exe module58= opengllib58= -ver58=1 +ver58=0 coord58=0 -flag58=134217762 +flag58=134217760 flagg58=1207959552 flagh58=20 -flagi58=4 +flagi58=0 tflag58=0 initx58=0 inity58=0 @@ -1356,17 +1472,19 @@ sizx58=800 sizy58=600 maxfps58=0 initts58=0 -title59=Need For Speed Underground -path59=D:\Games\Need For Speed Underground\speed.exe +winver58=0 +maxres58=0 +title59=Nascar Racing 3 +path59=D:\Games\Nascar Racing 3\NASCAR Racing 3.exe module59= opengllib59= -ver59=9 +ver59=0 coord59=0 -flag59=134217762 +flag59=671105056 flagg59=1207959552 flagh59=20 -flagi59=1028 -tflag59=0 +flagi59=4 +tflag59=6163 initx59=0 inity59=0 minx59=0 @@ -1379,17 +1497,19 @@ sizx59=800 sizy59=600 maxfps59=0 initts59=0 -title60=Need for Speed Underground 2 -path60=D:\Games\Need for Speed Underground 2\SPEED2.EXE +winver59=0 +maxres59=0 +title60=Need for Speed 2SE +path60=D:\Games\Need for Speed 2SE\NFS2SEN.EXE module60= opengllib60= -ver60=9 +ver60=0 coord60=0 -flag60=134217762 -flagg60=1207959552 +flag60=134217826 +flagg60=1480589312 flagh60=20 flagi60=4 -tflag60=0 +tflag60=6163 initx60=0 inity60=0 minx60=0 @@ -1402,17 +1522,19 @@ sizx60=800 sizy60=600 maxfps60=0 initts60=0 -title61=Pandemonium 2 (GLIDE) -path61=D:\Games\Pandemonium 2\pandy.exe +winver60=0 +maxres60=0 +title61=Need for Speed 2SE (3dfx) +path61=D:\Games\Need for Speed 2SE\nfs2sea.exe module61= opengllib61= ver61=0 coord61=0 -flag61=134217762 +flag61=134217760 flagg61=1207959552 flagh61=20 flagi61=4 -tflag61=0 +tflag61=6147 initx61=0 inity61=0 minx61=0 @@ -1425,17 +1547,19 @@ sizx61=800 sizy61=600 maxfps61=0 initts61=0 -title62=Panzer Dragoon -path62=D:\Games\Panzer Dragoon\game\PANZERDG.EXE +winver61=0 +maxres61=0 +title62=Need for Speed 3 +path62=D:\Games\Need for Speed 3\nfs3.exe module62= opengllib62= -ver62=0 +ver62=1 coord62=0 flag62=134217762 flagg62=1207959552 flagh62=20 flagi62=4 -tflag62=67 +tflag62=0 initx62=0 inity62=0 minx62=0 @@ -1448,17 +1572,19 @@ sizx62=800 sizy62=600 maxfps62=0 initts62=0 -title63=Praetorians -path63=D:\games\Praetorians\Praetorians.exe +winver62=0 +maxres62=0 +title63=Need For Speed Underground +path63=D:\Games\Need For Speed Underground\speed.exe module63= opengllib63= -ver63=0 -coord63=2 -flag63=134217760 -flagg63=1209008144 -flagh63=22 -flagi63=4 -tflag63=2 +ver63=9 +coord63=0 +flag63=134217762 +flagg63=1207959552 +flagh63=20 +flagi63=1028 +tflag63=0 initx63=0 inity63=0 minx63=0 @@ -1471,17 +1597,19 @@ sizx63=800 sizy63=600 maxfps63=0 initts63=0 -title64=Praetorians (DEMO) -path64=D:\Games\Praetorians Demo\Praetorians.exe +winver63=0 +maxres63=0 +title64=Need for Speed Underground 2 +path64=D:\Games\Need for Speed Underground 2\SPEED2.EXE module64= opengllib64= -ver64=0 +ver64=9 coord64=0 -flag64=150994976 -flagg64=1209008128 -flagh64=65556 +flag64=134217762 +flagg64=1207959552 +flagh64=20 flagi64=4 -tflag64=6419 +tflag64=0 initx64=0 inity64=0 minx64=0 @@ -1494,16 +1622,18 @@ sizx64=800 sizy64=600 maxfps64=0 initts64=0 -title65=Premier Manager 98 -path65=D:\Games\Premier Manager 98\MANAGER.EXE +winver64=0 +maxres64=0 +title65=Neophyte Koplio's Story +path65=D:\Games\Neophyte Koplio's Story\KOPLIO.exe module65= opengllib65= -ver65=0 +ver65=1 coord65=0 -flag65=671092770 +flag65=134234146 flagg65=1207959552 -flagh65=16 -flagi65=0 +flagh65=20 +flagi65=4 tflag65=0 initx65=0 inity65=0 @@ -1517,16 +1647,18 @@ sizx65=800 sizy65=600 maxfps65=0 initts65=0 -title66=Primitive Wars -path66=D:\Games\Primitive Wars\Pw.exe +winver65=0 +maxres65=0 +title66=NetStorm - Islands at War +path66=D:\Games\NetStorm - Islands at War\Netstorm.exe module66= opengllib66= ver66=0 coord66=0 -flag66=671088674 -flagg66=134217728 +flag66=679608354 +flagg66=1209008384 flagh66=20 -flagi66=0 +flagi66=4 tflag66=0 initx66=0 inity66=0 @@ -1540,17 +1672,19 @@ sizx66=800 sizy66=600 maxfps66=0 initts66=0 -title67=Project IGI -path67=D:\Games\Project IGI\pc\IGI.exe +winver66=0 +maxres66=0 +title67=Pandemonium 2 (GLIDE) +path67=D:\Games\Pandemonium 2\pandy.exe module67= opengllib67= ver67=0 coord67=0 -flag67=671105060 -flagg67=-939524096 +flag67=134217762 +flagg67=1207959552 flagh67=20 flagi67=4 -tflag67=67 +tflag67=0 initx67=0 inity67=0 minx67=0 @@ -1563,17 +1697,19 @@ sizx67=800 sizy67=600 maxfps67=0 initts67=0 -title68=Project Nomads (DEMO) -path68=D:\Games\Project Nomads Demo\bin\win32\nomads.exe +winver67=0 +maxres67=0 +title68=Panzer Dragoon +path68=D:\Games\Panzer Dragoon\game\PANZERDG.EXE module68= opengllib68= -ver68=8 +ver68=0 coord68=0 -flag68=-1476394974 -flagg68=1207959808 -flagh68=4 -flagi68=0 -tflag68=274 +flag68=134217762 +flagg68=1207959552 +flagh68=20 +flagi68=4 +tflag68=67 initx68=0 inity68=0 minx68=0 @@ -1586,17 +1722,19 @@ sizx68=800 sizy68=600 maxfps68=0 initts68=0 -title69=Quake 2 -path69=D:\Games\QUAKE2\quake2.exe +winver68=0 +maxres68=0 +title69=Praetorians +path69=D:\games\Praetorians\Praetorians.exe module69= opengllib69= ver69=0 -coord69=0 -flag69=134234114 -flagg69=1208090624 -flagh69=20 +coord69=2 +flag69=134217760 +flagg69=1209008144 +flagh69=22 flagi69=4 -tflag69=0 +tflag69=2 initx69=0 inity69=0 minx69=0 @@ -1609,17 +1747,19 @@ sizx69=800 sizy69=600 maxfps69=0 initts69=0 -title70=Railroad Tycoon II -path70=D:\Games\Railroad.Tycoon.II\RT2.EXE +winver69=0 +maxres69=0 +title70=Praetorians (DEMO) +path70=D:\Games\Praetorians Demo\Praetorians.exe module70= opengllib70= ver70=0 coord70=0 -flag70=134217762 -flagg70=1207959552 -flagh70=20 +flag70=150994976 +flagg70=1209008128 +flagh70=65556 flagi70=4 -tflag70=0 +tflag70=6419 initx70=0 inity70=0 minx70=0 @@ -1632,17 +1772,19 @@ sizx70=800 sizy70=600 maxfps70=0 initts70=0 -title71=Rayman 2 Demo -path71=D:\Games\Rayman2Demo\Rayman2Demo.exe +winver70=0 +maxres70=0 +title71=Premier Manager 98 +path71=D:\Games\Premier Manager 98\MANAGER.EXE module71= opengllib71= -ver71=7 +ver71=0 coord71=0 -flag71=402653217 -flagg71=1208025088 -flagh71=2097172 +flag71=671092770 +flagg71=1207959552 +flagh71=16 flagi71=0 -tflag71=6419 +tflag71=0 initx71=0 inity71=0 minx71=0 @@ -1654,18 +1796,20 @@ posy71=50 sizx71=800 sizy71=600 maxfps71=0 -initts71=4 -title72=Shadows of the Empire (DEMO) -path72=D:\Games\Shadows of the Empire\shadows.exe +initts71=0 +winver71=0 +maxres71=0 +title72=Primitive Wars +path72=D:\Games\Primitive Wars\Pw.exe module72= opengllib72= ver72=0 -coord72=2 -flag72=134479906 -flagg72=1207959568 -flagh72=33554452 +coord72=0 +flag72=671088674 +flagg72=134217728 +flagh72=20 flagi72=0 -tflag72=274 +tflag72=0 initx72=0 inity72=0 minx72=0 @@ -1678,17 +1822,19 @@ sizx72=800 sizy72=600 maxfps72=0 initts72=0 -title73=Star Wars Episode I Racer -path73=D:\Games\Star Wars Episode 1 racer\SWEP1RCR.EXE +winver72=0 +maxres72=0 +title73=Project IGI +path73=D:\Games\Project IGI\pc\IGI.exe module73= opengllib73= ver73=0 coord73=0 -flag73=679493669 -flagg73=1210056720 -flagh73=8212 -flagi73=20 -tflag73=65 +flag73=671105060 +flagg73=-939524096 +flagh73=20 +flagi73=4 +tflag73=67 initx73=0 inity73=0 minx73=0 @@ -1701,17 +1847,19 @@ sizx73=800 sizy73=600 maxfps73=0 initts73=0 -title74=StarCraft -path74=D:\Games\Starcraft\StarCraft.exe +winver73=0 +maxres73=0 +title74=Project Nomads (DEMO) +path74=D:\Games\Project Nomads Demo\bin\win32\nomads.exe module74= opengllib74= -ver74=0 +ver74=8 coord74=0 -flag74=134217762 -flagg74=134283264 -flagh74=20 -flagi74=8 -tflag74=64 +flag74=-1476394974 +flagg74=1207959808 +flagh74=4 +flagi74=0 +tflag74=274 initx74=0 inity74=0 minx74=0 @@ -1724,17 +1872,19 @@ sizx74=800 sizy74=600 maxfps74=0 initts74=0 -title75=State of Emergency -path75=D:\Games\State of Emergency\KaosPC.cracked.exe +winver74=0 +maxres74=0 +title75=Quake 2 +path75=D:\Games\QUAKE2\quake2.exe module75= opengllib75= -ver75=8 +ver75=0 coord75=0 -flag75=671088676 -flagg75=1208025088 +flag75=134234114 +flagg75=1208090624 flagh75=20 -flagi75=2052 -tflag75=6163 +flagi75=4 +tflag75=0 initx75=0 inity75=0 minx75=0 @@ -1745,19 +1895,21 @@ posx75=50 posy75=50 sizx75=800 sizy75=600 -maxfps75=50 -initts75=2 -title76=Take no Prisoners +maxfps75=0 +initts75=0 +winver75=0 +maxres75=0 +title76=Railroad Tycoon II +path76=D:\Games\Railroad.Tycoon.II\RT2.EXE module76= opengllib76= -path76=D:\Games\Take no Prisoners\TNP.EXE ver76=0 coord76=0 flag76=134217762 -flagg76=134217860 +flagg76=1207959552 flagh76=20 -flagi76=512 -tflag76=259 +flagi76=4 +tflag76=0 initx76=0 inity76=0 minx76=0 @@ -1770,17 +1922,19 @@ sizx76=800 sizy76=600 maxfps76=0 initts76=0 -title77=The Bard's Tale -path77=D:\Games\The Bard's Tale\The Bard's Tale.exe +winver76=0 +maxres76=0 +title77=Rayman 2 Demo +path77=D:\Games\Rayman2Demo\Rayman2Demo.exe module77= opengllib77= -ver77=9 +ver77=7 coord77=0 -flag77=134217760 -flagg77=134217728 -flagh77=16 -flagi77=1024 -tflag77=6162 +flag77=402653217 +flagg77=1208025088 +flagh77=2097172 +flagi77=0 +tflag77=6419 initx77=0 inity77=0 minx77=0 @@ -1792,18 +1946,20 @@ posy77=50 sizx77=800 sizy77=600 maxfps77=0 -initts77=0 -title78=Tomb Raider 4 (DEMO) -path78=D:\Games\Tomb Raider - The Last Revelation (Demo)\tomb4.exe +initts77=4 +winver77=0 +maxres77=0 +title78=Serious Sam - The Second Encounter Demo +path78=D:\Games\Serious Sam - The Second Encounter Demo\Bin\SeriousSam.exe module78= opengllib78= -ver78=7 +ver78=0 coord78=0 -flag78=134217760 -flagg78=1207959552 +flag78=671088674 +flagg78=1208156160 flagh78=20 -flagi78=0 -tflag78=258 +flagi78=4 +tflag78=64 initx78=0 inity78=0 minx78=0 @@ -1815,18 +1971,20 @@ posy78=50 sizx78=800 sizy78=600 maxfps78=0 -initts78=0 -title79=Tomb Raider II -path79=D:\Games\Tomb Raider II\Tomb2.exe +initts78=4 +winver78=0 +maxres78=0 +title79=Shadows of the Empire (DEMO) +path79=D:\Games\Shadows of the Empire\shadows.exe module79= opengllib79= ver79=0 -coord79=0 -flag79=671088674 -flagg79=1207959552 -flagh79=20 +coord79=2 +flag79=134479906 +flagg79=1207959568 +flagh79=33554452 flagi79=0 -tflag79=0 +tflag79=274 initx79=0 inity79=0 minx79=0 @@ -1839,17 +1997,19 @@ sizx79=800 sizy79=600 maxfps79=0 initts79=0 -title80=Tomb Raider II Gold (DEMO) -path80=D:\Games\Tomb Raider II Gold (Demo)\Tomb2.exe -module80= +winver79=0 +maxres79=0 +title80=Sid Meier's Civilization III Complete +path80=D:\Games\Sid Meier's Civilization III Complete\Conquests\Civ3Conquests.exe +module80=jgl opengllib80= ver80=0 -coord80=2 -flag80=671088674 -flagg80=1224736784 -flagh80=20 -flagi80=0 -tflag80=258 +coord80=0 +flag80=973352994 +flagg80=136462360 +flagh80=2162708 +flagi80=4100 +tflag80=64 initx80=0 inity80=0 minx80=0 @@ -1861,18 +2021,20 @@ posy80=50 sizx80=800 sizy80=600 maxfps80=0 -initts80=0 -title81=Tomb Raider III -path81=D:\Games\Tomb Raider III\tomb3.exe +initts80=6 +winver80=0 +maxres80=5 +title81=Star Wars Episode I Racer +path81=D:\Games\Star Wars Episode 1 racer\SWEP1RCR.EXE module81= opengllib81= ver81=0 -coord81=2 -flag81=134217760 -flagg81=1241514000 -flagh81=20 -flagi81=0 -tflag81=322 +coord81=0 +flag81=679493669 +flagg81=1210056720 +flagh81=8212 +flagi81=20 +tflag81=65 initx81=0 inity81=0 minx81=0 @@ -1885,17 +2047,19 @@ sizx81=800 sizy81=600 maxfps81=0 initts81=0 -title82=Total Annihilation Kingdoms -path82=D:\Games\Total Annihilation Kingdoms\Kingdoms.exe +winver81=0 +maxres81=0 +title82=StarCraft +path82=D:\Games\Starcraft\StarCraft.exe module82= opengllib82= -ver82=7 +ver82=0 coord82=0 -flag82=671105058 -flagg82=1207959552 +flag82=134217762 +flagg82=134283264 flagh82=20 -flagi82=4 -tflag82=6163 +flagi82=8 +tflag82=64 initx82=0 inity82=0 minx82=0 @@ -1908,16 +2072,18 @@ sizx82=800 sizy82=600 maxfps82=0 initts82=0 -title83=Virtua Fighter 2 (DEMO) -path83=D:\Games\vf2_demo\VF2DEMO.EXE +winver82=0 +maxres82=0 +title83=Starsky & Hutch - GAME +path83=D:\Games\Starsky & Hutch\StarskyPC.exe module83= opengllib83= ver83=0 coord83=0 -flag83=939524131 -flagg83=1207959664 +flag83=947912739 +flagg83=1207959552 flagh83=20 -flagi83=0 +flagi83=4 tflag83=0 initx83=0 inity83=0 @@ -1931,17 +2097,19 @@ sizx83=800 sizy83=600 maxfps83=0 initts83=0 -title84=Virtua Fighter PC -path84=D:\Games\Virtua Fighter\VFPC.EXE +winver83=0 +maxres83=0 +title84=Starsky & Hutch - LAUNCHER +path84=D:\Games\Starsky & Hutch\Starsky.exe module84= opengllib84= ver84=0 coord84=0 -flag84=402653218 -flagg84=1224736784 -flagh84=33562644 -flagi84=0 -tflag84=291 +flag84=134217728 +flagg84=1207959552 +flagh84=20 +flagi84=4 +tflag84=0 initx84=0 inity84=0 minx84=0 @@ -1954,17 +2122,19 @@ sizx84=800 sizy84=600 maxfps84=0 initts84=0 -title85=Warcraft 2 Battlenet Ed -path85=D:\Games\Warcraft 2 Battlenet Ed\Warcraft II BNE.exe +winver84=0 +maxres84=0 +title85=State of Emergency +path85=D:\Games\State of Emergency\KaosPC.cracked.exe module85= opengllib85= -ver85=0 +ver85=8 coord85=0 -flag85=134217762 -flagg85=1210122240 -flagh85=148 -flagi85=12 -tflag85=0 +flag85=671088676 +flagg85=1208025088 +flagh85=20 +flagi85=2052 +tflag85=6163 initx85=0 inity85=0 minx85=0 @@ -1975,19 +2145,21 @@ posx85=50 posy85=50 sizx85=800 sizy85=600 -maxfps85=0 -initts85=0 -title86=Wargasm -path86=D:\Games\Wargasm\tank.exe +maxfps85=50 +initts85=2 +winver85=0 +maxres85=0 +title86=Still Life (GOG) +path86=D:\Games\Still Life (GOG)\StillLife.exe module86= opengllib86= ver86=0 -coord86=2 -flag86=671088672 -flagg86=1207959696 -flagh86=65556 -flagi86=0 -tflag86=6163 +coord86=0 +flag86=671105058 +flagg86=1207959568 +flagh86=20 +flagi86=4 +tflag86=1088 initx86=0 inity86=0 minx86=0 @@ -2000,40 +2172,44 @@ sizx86=800 sizy86=600 maxfps86=0 initts86=0 -title87=Warlords Battlecry II (DEMO) -path87=D:\Games\Warlords Battlecry II Demo\Battlecry II Demo.exe +winver86=0 +maxres86=-1 +title87=Syberia +path87=D:\Games\Syberia\Syberia.exe module87= opengllib87= ver87=0 -coord87=2 -flag87=134217762 -flagg87=1207959568 -flagh87=22 -flagi87=0 -tflag87=258 -initx87=0 -inity87=0 -minx87=0 -miny87=0 -maxx87=0 -maxy87=0 +coord87=0 +flag87=822116385 +flagg87=1242562576 +flagh87=20 +flagi87=4 +tflag87=6171 +initx87=150 +inity87=150 +minx87=150 +miny87=150 +maxx87=800 +maxy87=600 posx87=50 posy87=50 sizx87=800 sizy87=600 maxfps87=0 initts87=0 -title88=Whiteout -path88=D:\Games\Whiteout\Whiteout.exe +winver87=0 +maxres87=0 +title88=Take no Prisoners +path88=D:\Games\Take no Prisoners\TNP.EXE module88= opengllib88= ver88=0 coord88=0 -flag88=402653217 -flagg88=1207959552 +flag88=134217762 +flagg88=134217860 flagh88=20 -flagi88=0 -tflag88=66 +flagi88=512 +tflag88=259 initx88=0 inity88=0 minx88=0 @@ -2042,21 +2218,23 @@ maxx88=0 maxy88=0 posx88=50 posy88=50 -sizx88=640 -sizy88=480 +sizx88=800 +sizy88=600 maxfps88=0 initts88=0 -title89=Wildfire -path89=D:\Games\Wildfire\Wildfire.exe +winver88=0 +maxres88=0 +title89=The Bard's Tale +path89=D:\Games\The Bard's Tale\The Bard's Tale.exe module89= opengllib89= -ver89=0 +ver89=9 coord89=0 -flag89=-1476392958 -flagg89=1210122240 -flagh89=20 -flagi89=12 -tflag89=0 +flag89=134217760 +flagg89=134217728 +flagh89=16 +flagi89=1024 +tflag89=6162 initx89=0 inity89=0 minx89=0 @@ -2069,17 +2247,19 @@ sizx89=800 sizy89=600 maxfps89=0 initts89=0 -title90=Worms Pinball -path90=D:\Games\Worms Pinball\WPIB.exe +winver89=0 +maxres89=0 +title90=Tomb Raider 4 (DEMO) +path90=D:\Games\Tomb Raider - The Last Revelation (Demo)\tomb4.exe module90= opengllib90= -ver90=1 +ver90=7 coord90=0 -flag90=134217762 -flagg90=1207959568 +flag90=134217760 +flagg90=1207959552 flagh90=20 -flagi90=4 -tflag90=0 +flagi90=0 +tflag90=258 initx90=0 inity90=0 minx90=0 @@ -2092,13 +2272,15 @@ sizx90=800 sizy90=600 maxfps90=0 initts90=0 -title91=Zanzarah -path91=D:\Games\Zanzarah\System\zanthp.exe +winver90=0 +maxres90=0 +title91=Tomb Raider II +path91=D:\Games\Tomb Raider II\Tomb2.exe module91= opengllib91= ver91=0 coord91=0 -flag91=679477280 +flag91=671088674 flagg91=1207959552 flagh91=20 flagi91=0 @@ -2115,14 +2297,16 @@ sizx91=800 sizy91=600 maxfps91=0 initts91=0 -title92=Zax the Alien Hunter (DEMO) -path92=D:\Games\ZaxDemo\Zax.exe +winver91=0 +maxres91=0 +title92=Tomb Raider II Gold (DEMO) +path92=D:\Games\Tomb Raider II Gold (Demo)\Tomb2.exe module92= opengllib92= ver92=0 coord92=2 -flag92=-2011168734 -flagg92=1209008144 +flag92=671088674 +flagg92=1224736784 flagh92=20 flagi92=0 tflag92=258 @@ -2138,17 +2322,19 @@ sizx92=800 sizy92=600 maxfps92=0 initts92=0 -title93=ZPC Zero Population Count -path93=D:\Games\ZPC\ZPC.EXE +winver92=0 +maxres92=0 +title93=Tomb Raider III +path93=D:\Games\Tomb Raider III\tomb3.exe module93= opengllib93= ver93=0 -coord93=0 -flag93=134217762 -flagg93=1207959552 +coord93=2 +flag93=134217760 +flagg93=1241514000 flagh93=20 -flagi93=4 -tflag93=0 +flagi93=0 +tflag93=322 initx93=0 inity93=0 minx93=0 @@ -2161,16 +2347,18 @@ sizx93=800 sizy93=600 maxfps93=0 initts93=0 -title94=Martian Gothic Unification -path94=D:\Games\Martian Gothic\martian gothic.exe +winver93=0 +maxres93=0 +title94=Total Annihilation Kingdoms +path94=D:\Games\Total Annihilation Kingdoms\Kingdoms.exe module94= opengllib94= -ver94=0 +ver94=7 coord94=0 -flag94=203423776 -flagg94=1476395008 +flag94=671105058 +flagg94=1207959552 flagh94=20 -flagi94=5 +flagi94=4 tflag94=6163 initx94=0 inity94=0 @@ -2184,40 +2372,44 @@ sizx94=800 sizy94=600 maxfps94=0 initts94=0 -title95=Syberia -path95=D:\Games\Syberia\Syberia.exe +winver94=0 +maxres94=0 +title95=Unreal Tournament +path95=D:\Games\Unreal Tournament\System\UnrealTournament.exe module95= opengllib95= ver95=0 coord95=0 -flag95=822116385 -flagg95=1242562576 +flag95=-2013265886 +flagg95=1209073680 flagh95=20 -flagi95=4 -tflag95=6171 -initx95=150 -inity95=150 -minx95=150 -miny95=150 -maxx95=800 -maxy95=600 +flagi95=2052 +tflag95=4097 +initx95=0 +inity95=0 +minx95=0 +miny95=0 +maxx95=0 +maxy95=0 posx95=50 posy95=50 -sizx95=800 -sizy95=600 +sizx95=1200 +sizy95=900 maxfps95=0 initts95=0 -title96=Nascar Racing 3 -path96=D:\Games\Nascar Racing 3\NASCAR Racing 3.exe +winver95=0 +maxres95=0 +title96=Virtua Fighter 2 (DEMO) +path96=D:\Games\vf2_demo\VF2DEMO.EXE module96= opengllib96= ver96=0 coord96=0 -flag96=671105056 -flagg96=1207959552 +flag96=939524131 +flagg96=1207959664 flagh96=20 -flagi96=4 -tflag96=6163 +flagi96=0 +tflag96=0 initx96=0 inity96=0 minx96=0 @@ -2230,17 +2422,19 @@ sizx96=800 sizy96=600 maxfps96=0 initts96=0 -title97=Neophyte Koplio's Story -path97=D:\Games\Neophyte Koplio's Story\KOPLIO.exe +winver96=0 +maxres96=0 +title97=Virtua Fighter PC +path97=D:\Games\Virtua Fighter\VFPC.EXE module97= opengllib97= -ver97=1 +ver97=0 coord97=0 -flag97=134234146 -flagg97=1207959552 -flagh97=20 -flagi97=4 -tflag97=0 +flag97=402653218 +flagg97=1224736784 +flagh97=33562644 +flagi97=0 +tflag97=291 initx97=0 inity97=0 minx97=0 @@ -2253,16 +2447,18 @@ sizx97=800 sizy97=600 maxfps97=0 initts97=0 -title98=NetStorm - Islands at War -path98=D:\Games\NetStorm - Islands at War\Netstorm.exe +winver97=0 +maxres97=0 +title98=Warcraft 2 Battlenet Ed +path98=D:\Games\Warcraft 2 Battlenet Ed\Warcraft II BNE.exe module98= opengllib98= ver98=0 coord98=0 -flag98=679608354 -flagg98=1209008384 -flagh98=20 -flagi98=4 +flag98=134217762 +flagg98=1210122240 +flagh98=148 +flagi98=12 tflag98=0 initx98=0 inity98=0 @@ -2276,17 +2472,19 @@ sizx98=800 sizy98=600 maxfps98=0 initts98=0 -title99=Dracula Twins -path99=D:\Games\Dracula Twins\DraculaTwins.exe +winver98=0 +maxres98=0 +title99=Wargasm +path99=D:\Games\Wargasm\tank.exe module99= opengllib99= ver99=0 -coord99=0 -flag99=134217762 -flagg99=1207959552 -flagh99=20 -flagi99=4 -tflag99=0 +coord99=2 +flag99=671088672 +flagg99=1207959696 +flagh99=65556 +flagi99=0 +tflag99=6163 initx99=0 inity99=0 minx99=0 @@ -2299,17 +2497,19 @@ sizx99=800 sizy99=600 maxfps99=0 initts99=0 -title100=Starsky & Hutch - GAME -path100=D:\Games\Starsky & Hutch\StarskyPC.exe +winver99=0 +maxres99=0 +title100=Warlords Battlecry II (DEMO) +path100=D:\Games\Warlords Battlecry II Demo\Battlecry II Demo.exe module100= opengllib100= ver100=0 -coord100=0 -flag100=947912739 -flagg100=1207959552 -flagh100=20 -flagi100=4 -tflag100=0 +coord100=2 +flag100=134217762 +flagg100=1207959568 +flagh100=22 +flagi100=0 +tflag100=258 initx100=0 inity100=0 minx100=0 @@ -2322,17 +2522,19 @@ sizx100=800 sizy100=600 maxfps100=0 initts100=0 -title101=Starsky & Hutch - LAUNCHER -path101=D:\Games\Starsky & Hutch\Starsky.exe +winver100=0 +maxres100=0 +title101=Whiteout +path101=D:\Games\Whiteout\Whiteout.exe module101= opengllib101= ver101=0 coord101=0 -flag101=134217728 +flag101=402653217 flagg101=1207959552 flagh101=20 -flagi101=4 -tflag101=0 +flagi101=0 +tflag101=66 initx101=0 inity101=0 minx101=0 @@ -2341,21 +2543,23 @@ maxx101=0 maxy101=0 posx101=50 posy101=50 -sizx101=800 -sizy101=600 +sizx101=640 +sizy101=480 maxfps101=0 initts101=0 -title102=Unreal Tournament -path102=D:\Games\Unreal Tournament\System\UnrealTournament.exe +winver101=0 +maxres101=0 +title102=Wildfire +path102=D:\Games\Wildfire\Wildfire.exe module102= opengllib102= ver102=0 coord102=0 -flag102=-2013265886 -flagg102=1209073680 +flag102=-1476392958 +flagg102=1210122240 flagh102=20 -flagi102=2052 -tflag102=4097 +flagi102=12 +tflag102=0 initx102=0 inity102=0 minx102=0 @@ -2364,21 +2568,23 @@ maxx102=0 maxy102=0 posx102=50 posy102=50 -sizx102=1200 -sizy102=900 +sizx102=800 +sizy102=600 maxfps102=0 initts102=0 -title103=Half-Life +winver102=0 +maxres102=0 +title103=Worms Pinball +path103=D:\Games\Worms Pinball\WPIB.exe module103= opengllib103= -path103=D:\Games\Half-Life\hl.exe -ver103=12 +ver103=1 coord103=0 -flag103=1207959584 -flagg103=1209139200 -flagh103=16 -flagi103=2060 -tflag103=4097 +flag103=134217762 +flagg103=1207959568 +flagh103=20 +flagi103=4 +tflag103=0 initx103=0 inity103=0 minx103=0 @@ -2391,17 +2597,19 @@ sizx103=800 sizy103=600 maxfps103=0 initts103=0 -title104=Serious Sam - The Second Encounter Demo -path104=D:\Games\Serious Sam - The Second Encounter Demo\Bin\SeriousSam.exe +winver103=0 +maxres103=0 +title104=Zanzarah +path104=D:\Games\Zanzarah\System\zanthp.exe module104= opengllib104= ver104=0 coord104=0 -flag104=671088674 -flagg104=1208156160 +flag104=679477280 +flagg104=1207959552 flagh104=20 -flagi104=4 -tflag104=64 +flagi104=0 +tflag104=0 initx104=0 inity104=0 minx104=0 @@ -2413,9 +2621,61 @@ posy104=50 sizx104=800 sizy104=600 maxfps104=0 -initts104=4 +initts104=0 +winver104=0 +maxres104=0 +title105=Zax the Alien Hunter (DEMO) +path105=D:\Games\ZaxDemo\Zax.exe +module105= +opengllib105= +ver105=0 +coord105=2 +flag105=-2011168734 +flagg105=1209008144 +flagh105=20 +flagi105=0 +tflag105=258 +initx105=0 +inity105=0 +minx105=0 +miny105=0 +maxx105=0 +maxy105=0 +posx105=50 +posy105=50 +sizx105=800 +sizy105=600 +maxfps105=0 +initts105=0 +winver105=0 +maxres105=0 +title106=ZPC Zero Population Count +path106=D:\Games\ZPC\ZPC.EXE +module106= +opengllib106= +ver106=0 +coord106=0 +flag106=134217762 +flagg106=1207959552 +flagh106=20 +flagi106=4 +tflag106=0 +initx106=0 +inity106=0 +minx106=0 +miny106=0 +maxx106=0 +maxy106=0 +posx106=50 +posy106=50 +sizx106=800 +sizy106=600 +maxfps106=0 +initts106=0 +winver106=0 +maxres106=0 [window] -posx=995 -posy=119 +posx=840 +posy=104 sizx=868 sizy=837 diff --git a/build/exports/Dungeon Odyssey (Demo).dxw b/build/exports/Dungeon Odyssey (Demo).dxw new file mode 100644 index 0000000..76b0761 --- /dev/null +++ b/build/exports/Dungeon Odyssey (Demo).dxw @@ -0,0 +1,26 @@ +[target] +title0=Dungeon Odyssey (Demo) +path0=D:\Games\Dungeon Odyssey Demo\DungOdy.exe +module0= +opengllib0= +ver0=7 +coord0=0 +flag0=134234146 +flagg0=1207959568 +flagh0=20 +flagi0=4 +tflag0=64 +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=4 diff --git a/build/exports/Heart of Darkness.dxw b/build/exports/Heart of Darkness.dxw new file mode 100644 index 0000000..c8f8bb3 --- /dev/null +++ b/build/exports/Heart of Darkness.dxw @@ -0,0 +1,26 @@ +[target] +title0=Heart of Darkness +path0=D:\Games\Heart of Darkness\HODWin32.exe +module0= +opengllib0= +ver0=0 +coord0=0 +flag0=134217762 +flagg0=1207959552 +flagh0=2068 +flagi0=4 +tflag0=64 +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 diff --git a/build/exports/Heroes of Might and Magic 4 Complete.dxw b/build/exports/Heroes of Might and Magic 4 Complete.dxw new file mode 100644 index 0000000..2e0beb6 --- /dev/null +++ b/build/exports/Heroes of Might and Magic 4 Complete.dxw @@ -0,0 +1,26 @@ +[target] +title0=Heroes of Might and Magic 4 Complete +path0=D:\Games\Heroes of Might and Magic 4 Complete\heroes4.exe +module0= +opengllib0= +ver0=0 +coord0=0 +flag0=671350818 +flagg0=1207959552 +flagh0=65556 +flagi0=5 +tflag0=64 +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 diff --git a/build/exports/Hesperian Wars.dxw b/build/exports/Hesperian Wars.dxw new file mode 100644 index 0000000..9b5668b --- /dev/null +++ b/build/exports/Hesperian Wars.dxw @@ -0,0 +1,26 @@ +[target] +title0=Hesperian Wars +path0=D:\Games\Hesperian_Wars\HW.EXE +module0= +opengllib0= +ver0=0 +coord0=0 +flag0=136314914 +flagg0=1207959552 +flagh0=-2147483628 +flagi0=4 +tflag0=6227 +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 diff --git a/build/exports/Homeworld.dxw b/build/exports/Homeworld.dxw new file mode 100644 index 0000000..c889303 --- /dev/null +++ b/build/exports/Homeworld.dxw @@ -0,0 +1,26 @@ +[target] +title0=Homeworld +path0=D:\Games\Homeworld\Homeworld.exe +module0= +opengllib0= +ver0=0 +coord0=0 +flag0=704667680 +flagg0=1208090896 +flagh0=20 +flagi0=4 +tflag0=64 +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 diff --git a/build/exports/Horde 2 the Citadel.dxw b/build/exports/Horde 2 the Citadel.dxw new file mode 100644 index 0000000..08c8dff --- /dev/null +++ b/build/exports/Horde 2 the Citadel.dxw @@ -0,0 +1,26 @@ +[target] +title0=Horde 2 the Citadel +path0=D:\Games\Horde2\HORDE\horde2.exe +module0= +opengllib0= +ver0=0 +coord0=0 +flag0=134217766 +flagg0=134217728 +flagh0=20 +flagi0=4 +tflag0=64 +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 diff --git a/build/exports/Horde.dxw b/build/exports/Horde.dxw new file mode 100644 index 0000000..881986a --- /dev/null +++ b/build/exports/Horde.dxw @@ -0,0 +1,26 @@ +[target] +title0=Horde +path0=D:\Games\HORDE\horde.exe +module0= +opengllib0= +ver0=0 +coord0=0 +flag0=134217766 +flagg0=134217728 +flagh0=20 +flagi0=4 +tflag0=64 +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 diff --git a/build/exports/Imperialism II.dxw b/build/exports/Imperialism II.dxw index 9bbb3eb..edc1d09 100644 --- a/build/exports/Imperialism II.dxw +++ b/build/exports/Imperialism II.dxw @@ -6,8 +6,8 @@ opengllib0= ver0=0 coord0=0 flag0=679485474 -flagg0=1209008128 -flagh0=20 +flagg0=1207959552 +flagh0=32788 flagi0=4 tflag0=0 initx0=0 @@ -22,3 +22,5 @@ sizx0=800 sizy0=600 maxfps0=0 initts0=0 +winver0=0 +maxres0=0 diff --git a/build/exports/Metal Knight.dxw b/build/exports/Metal Knight.dxw new file mode 100644 index 0000000..352767f --- /dev/null +++ b/build/exports/Metal Knight.dxw @@ -0,0 +1,26 @@ +[target] +title0=Metal Knight RIP +path0=D:\Games\Metal Knight RIP\mk.exe +module0= +opengllib0= +ver0=0 +coord0=0 +flag0=134217762 +flagg0=134217728 +flagh0=20 +flagi0=4 +tflag0=64 +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 diff --git a/build/exports/Settlers 3, the.dxw b/build/exports/Settlers 3, the.dxw new file mode 100644 index 0000000..a972e51 --- /dev/null +++ b/build/exports/Settlers 3, the.dxw @@ -0,0 +1,26 @@ +[target] +title0=Settlers 3, the +path0=D:\Games\Settlers3\S3.EXE +module0= +opengllib0= +ver0=0 +coord0=0 +flag0=-1476394974 +flagg0=1207959618 +flagh0=20 +flagi0=4 +tflag0=64 +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 diff --git a/build/exports/Sid Meier's Civilization III Complete.dxw b/build/exports/Sid Meier's Civilization III Complete.dxw index e52247c..f916e7e 100644 --- a/build/exports/Sid Meier's Civilization III Complete.dxw +++ b/build/exports/Sid Meier's Civilization III Complete.dxw @@ -5,11 +5,11 @@ module0=jgl opengllib0= ver0=0 coord0=0 -flag0=-1174405087 -flagg0=1213333504 -flagh0=65556 +flag0=973352994 +flagg0=136462360 +flagh0=2162708 flagi0=4100 -tflag0=6483 +tflag0=64 initx0=0 inity0=0 minx0=0 @@ -18,8 +18,8 @@ maxx0=0 maxy0=0 posx0=50 posy0=50 -sizx0=1024 -sizy0=768 +sizx0=800 +sizy0=600 maxfps0=0 initts0=6 winver0=0 diff --git a/build/exports/Still Life (GOG).dxw b/build/exports/Still Life (GOG).dxw new file mode 100644 index 0000000..ea96616 --- /dev/null +++ b/build/exports/Still Life (GOG).dxw @@ -0,0 +1,26 @@ +[target] +title0=Still Life (GOG) +path0=D:\Games\Still Life (GOG)\StillLife.exe +module0= +opengllib0= +ver0=0 +coord0=0 +flag0=671105058 +flagg0=1207959568 +flagh0=20 +flagi0=4 +tflag0=1088 +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 diff --git a/build/exports/Warhammer 40K Chaos Gate.dxw b/build/exports/Warhammer 40K Chaos Gate.dxw new file mode 100644 index 0000000..439ffb7 --- /dev/null +++ b/build/exports/Warhammer 40K Chaos Gate.dxw @@ -0,0 +1,26 @@ +[target] +title0=Warhammer 40K Chaos Gate +path0=D:\Games\Warhammer 40K Chaos Gate\game\WH40K.exe +module0= +opengllib0= +ver0=0 +coord0=0 +flag0=679493667 +flagg0=1207959552 +flagh0=20 +flagi0=4 +tflag0=64 +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 diff --git a/build/readme-relnotes.txt b/build/readme-relnotes.txt index b8efc6f..274098b 100644 --- a/build/readme-relnotes.txt +++ b/build/readme-relnotes.txt @@ -356,3 +356,13 @@ fixed log message for TextOut parameters hooked DisableD3DSpy (invoked by The Bard's Tale) fixed extglViewport coordinate remapping when invoked with CW_USEDEFAULT values (Civ III) fixed bug in DirectDarawCreate/Ex hooking with wrong module handle + +v2.02.53 +Handling of ddraw screen color depth 15BPP - in "Hesperian Wars" +fixed IAT scanning: now function addresses for remapping are searched in possibly multiple instances of dll text segment - in "Aaron Hall's Dungeon Odissey" +hooked SystemParametersInfo call +fixed window size logic to check for window menu bar, considering also the WS_CHILD case. +fixed window move/resize when message processing is enabled: coordinates outside the child area or within ENTER/EXITSIZEMOVE must NOT be altered. +expanded timer processing to include user32 Set/KillTimer - in "Aaron Hall's Dungeon Odissey" +fixed possible recursion while hooking child window procedure identical to parent's one +fixed gdi emulation on top of ddraw surface, enough to play "Sid Meyer's Civilization III". diff --git a/d3d9proxy/proxydll.sln b/d3d9proxy/proxydll.sln new file mode 100644 index 0000000..c88932b --- /dev/null +++ b/d3d9proxy/proxydll.sln @@ -0,0 +1,19 @@ +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "proxydll", "proxydll.vcproj", "{02EB97D5-B1C5-411E-8274-83A95985DE6F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {02EB97D5-B1C5-411E-8274-83A95985DE6F}.Debug|Win32.ActiveCfg = Debug|Win32 + {02EB97D5-B1C5-411E-8274-83A95985DE6F}.Debug|Win32.Build.0 = Debug|Win32 + {02EB97D5-B1C5-411E-8274-83A95985DE6F}.Release|Win32.ActiveCfg = Release|Win32 + {02EB97D5-B1C5-411E-8274-83A95985DE6F}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/dll/Thumbs.db b/dll/Thumbs.db deleted file mode 100644 index dfd424f..0000000 Binary files a/dll/Thumbs.db and /dev/null differ diff --git a/dll/ddraw.cpp b/dll/ddraw.cpp index 6594317..55708e4 100644 --- a/dll/ddraw.cpp +++ b/dll/ddraw.cpp @@ -562,6 +562,7 @@ void FixPixelFormat(int ColorDepth, DDPIXELFORMAT *pf) pf->dwBBitMask = 0; pf->dwRGBAlphaBitMask = 0x0000; break; + case 15: // v2.02.53: Hesperian Wars - so far the only game setting color depth to 15 BPP! case 16: pf->dwRGBBitCount = 16; if (dxw.dwFlags1 & USERGB565){ @@ -571,7 +572,7 @@ void FixPixelFormat(int ColorDepth, DDPIXELFORMAT *pf) pf->dwRGBAlphaBitMask = 0x0000; } else { - if(!(dxw.dwFlags4 & NOALPHACHANNEL)) pf->dwFlags |= DDPF_ALPHAPIXELS; // v2.02.33,40 + if(!(dxw.dwFlags4 & NOALPHACHANNEL) && (ColorDepth == 16)) pf->dwFlags |= DDPF_ALPHAPIXELS; // v2.02.33,40,53 pf->dwRBitMask = 0x7c00; pf->dwGBitMask = 0x03e0; pf->dwBBitMask = 0x001f; @@ -799,6 +800,7 @@ static void SetPixFmt(LPDDSURFACEDESC2 lpdd) switch (dxw.VirtualPixelFormat.dwRGBBitCount) { case 8: + case 15: case 16: case 24: case 32: diff --git a/dll/dinput.cpp b/dll/dinput.cpp index b14e60f..278e5d2 100644 --- a/dll/dinput.cpp +++ b/dll/dinput.cpp @@ -15,6 +15,7 @@ typedef HRESULT (WINAPI *GetDeviceData_Type)(LPDIRECTINPUTDEVICE, DWORD, LPVOID, typedef HRESULT (WINAPI *GetDeviceState_Type)(LPDIRECTINPUTDEVICE, DWORD, LPDIMOUSESTATE); typedef HRESULT (WINAPI *DISetCooperativeLevel_Type)(LPDIRECTINPUTDEVICE, HWND, DWORD); typedef HRESULT (WINAPI *SetDataFormat_Type)(LPDIRECTINPUTDEVICE, LPCDIDATAFORMAT); +typedef HRESULT (WINAPI *DIEnumDevices_Type)(void *, DWORD, LPDIENUMDEVICESCALLBACK, LPVOID, DWORD); HRESULT WINAPI extDirectInputCreate(HINSTANCE, DWORD, LPDIRECTINPUT *, LPUNKNOWN); HRESULT WINAPI extDirectInputCreateEx(HINSTANCE, DWORD, REFIID, LPVOID *, LPUNKNOWN); @@ -26,6 +27,7 @@ HRESULT WINAPI extGetDeviceState(LPDIRECTINPUTDEVICE, DWORD, LPDIMOUSESTATE); HRESULT WINAPI extDISetCooperativeLevel(LPDIRECTINPUTDEVICE, HWND, DWORD); HRESULT WINAPI extSetDataFormat(LPDIRECTINPUTDEVICE, LPCDIDATAFORMAT); HRESULT WINAPI extQueryInterfaceI(void *, REFIID, LPVOID *); +HRESULT WINAPI extDIEnumDevices(void *, DWORD, LPDIENUMDEVICESCALLBACK, LPVOID, DWORD); void GetMousePosition(int *, int *); void InitPosition(int, int, int, int, int, int); @@ -38,6 +40,7 @@ GetDeviceState_Type pGetDeviceState; DISetCooperativeLevel_Type pDISetCooperativeLevel; SetDataFormat_Type pSetDataFormat; QueryInterface_Type pQueryInterfaceI; +DIEnumDevices_Type pDIEnumDevices; int iCursorX; int iCursorY; @@ -103,7 +106,7 @@ HRESULT WINAPI extDirectInputCreate(HINSTANCE hinst, if(res) return res; SetHook((void *)(**(DWORD **)lplpdi), extQueryInterfaceI, (void **)&pQueryInterfaceI, "QueryInterface(I)"); SetHook((void *)(**(DWORD **)lplpdi + 12), extDICreateDevice, (void **)&pDICreateDevice, "CreateDevice(I)"); - //SetHook((void *)(**(DWORD **)lplpdi + 16), extDIEnumDevices, (void **)&pDIEnumDevices, "EnumDevices(I)"); + SetHook((void *)(**(DWORD **)lplpdi + 16), extDIEnumDevices, (void **)&pDIEnumDevices, "EnumDevices(I)"); return 0; } @@ -118,7 +121,7 @@ HRESULT WINAPI extDirectInputCreateEx(HINSTANCE hinst, res = (*pDirectInputCreateEx)(hinst, dwversion, riidltf, ppvout, pu); if(res) return res; SetHook((void *)(**(DWORD **)ppvout + 12), extDICreateDevice, (void **)&pDICreateDevice, "CreateDevice(I)"); - //SetHook((void *)(**(DWORD **)lplpdi + 16), extDIEnumDevices, (void **)&pDIEnumDevices, "EnumDevices(I)"); + SetHook((void *)(**(DWORD **)ppvout + 16), extDIEnumDevices, (void **)&pDIEnumDevices, "EnumDevices(I)"); SetHook((void *)(**(DWORD **)ppvout + 36), extDICreateDeviceEx, (void **)pDICreateDeviceEx, "DICreateDeviceEx(I)"); return 0; } @@ -137,6 +140,7 @@ HRESULT WINAPI extQueryInterfaceI(void * lpdi, REFIID riid, LPVOID *obp) case 0x5944E662: //DirectInput2A case 0x5944E663: //DirectInput2W SetHook((void *)(**(DWORD **)obp + 12), extDICreateDevice, (void **)pDICreateDevice, "CreateDevice(I)"); + SetHook((void *)(**(DWORD **)obp + 16), extDIEnumDevices, (void **)&pDIEnumDevices, "EnumDevices(I)"); break; } return 0; @@ -317,12 +321,56 @@ void InitPosition(int x, int y, int minx, int miny, int maxx, int maxy) iCurMaxY = maxy; } -//HRESULT WINAPI extEnumDevices(void *lpdi, DWORD dwDevType, LPDIENUMDEVICESCALLBACKW lpCallback, LPVOID pvRef, DWORD dwFlags) -//{ -// HRESULT res; -// OutTraceDW("EnumDevices(I): di=%x DevType=%x CallBack=%x Ref=%x Flags=%x\n", lpdi, dwDevType, lpCallback, pvRef, dwFlags); -// res=(*pEnumDevices)( lpdi, dwDevType, lpCallback, pvRef, dwFlags); -// OutTraceDW("EnumDevices(I): res=%x\n", res); -// return res; -//} +typedef struct { + LPDIENUMDEVICESCALLBACK cb; + LPVOID arg; +} CallbackArg; + +HRESULT WINAPI extDeviceProxy(LPCDIDEVICEINSTANCE dev, LPVOID arg) +{ + HRESULT res; + char *p; + switch (dev->dwSize) { + case sizeof(DIDEVICEINSTANCEA): p="ASCII"; break; + case sizeof(DIDEVICEINSTANCEW): p="WIDECHAR"; break; + default: p="UNKNOWN"; break; + } + OutTraceDW("EnumDevices(I): CALLBACK size=%d(%s) GUID=(%x.%x.%x.%x) type=%x InstanceName=\"%s\", ProductName=\"%s\"\n", + dev->dwSize, p, dev->guidInstance.Data1, dev->guidInstance.Data2, dev->guidInstance.Data3, dev->guidInstance.Data4, + dev->dwDevType, dev->tszInstanceName, dev->tszProductName); + + if(0){ + DIDEVICEINSTANCEW fixdev; + fixdev.dwSize=sizeof(DIDEVICEINSTANCEW); + fixdev.dwDevType=dev->dwDevType; + fixdev.guidInstance=dev->guidInstance; + fixdev.guidProduct=dev->guidProduct; + mbstowcs(fixdev.tszInstanceName, dev->tszInstanceName, strlen(dev->tszInstanceName)); + mbstowcs(fixdev.tszProductName, dev->tszProductName, strlen(dev->tszProductName)); + res = ((LPDIENUMDEVICESCALLBACKW)(((CallbackArg *)arg)->cb))(&fixdev, ((CallbackArg *)arg)->arg); + OutTraceDW("EnumDevices: CALLBACK ret=%x\n", res); + return res; + } + + __try{ + res = ((((CallbackArg *)arg)->cb))(dev, ((CallbackArg *)arg)->arg); + } + __except(EXCEPTION_EXECUTE_HANDLER){ + res=TRUE; + } + OutTraceDW("EnumDevices: CALLBACK ret=%x\n", res); + return res; +} + +HRESULT WINAPI extDIEnumDevices(void *lpdi, DWORD dwDevType, LPDIENUMDEVICESCALLBACK lpCallback, LPVOID pvRef, DWORD dwFlags) +{ + HRESULT res; + CallbackArg Arg; + OutTraceDW("EnumDevices(I): di=%x DevType=%x CallBack=%x Ref=%x Flags=%x\n", lpdi, dwDevType, lpCallback, pvRef, dwFlags); + Arg.cb= lpCallback; + Arg.arg=pvRef; + res=(*pDIEnumDevices)( lpdi, dwDevType, (LPDIENUMDEVICESCALLBACK)extDeviceProxy, pvRef, dwFlags); + OutTraceDW("EnumDevices(I): res=%x\n", res); + return res; +} diff --git a/dll/dxhook.cpp b/dll/dxhook.cpp index f800f35..91be625 100644 --- a/dll/dxhook.cpp +++ b/dll/dxhook.cpp @@ -337,143 +337,9 @@ void SetHook(void *target, void *hookproc, void **hookedproc, char *hookname) *hookedproc = tmp; } -#ifdef HOOKBYIAT -PIMAGE_SECTION_HEADER ImageRVA2Section(PIMAGE_NT_HEADERS pimage_nt_headers,DWORD dwRVA) -{ - int i; - PIMAGE_SECTION_HEADER pimage_section_header=(PIMAGE_SECTION_HEADER)((PCHAR(pimage_nt_headers)) + sizeof(IMAGE_NT_HEADERS)); - for(i=0;iFileHeader.NumberOfSections;i++) - { - if((pimage_section_header->VirtualAddress) && (dwRVA<=(pimage_section_header->VirtualAddress+pimage_section_header->SizeOfRawData))) - { - return ((PIMAGE_SECTION_HEADER)pimage_section_header); - } - pimage_section_header++; - } - return(NULL); -} - -DWORD RVA2Offset(PCHAR pImageBase,DWORD dwRVA) -{ - DWORD _offset; - PIMAGE_SECTION_HEADER section; - PIMAGE_DOS_HEADER pimage_dos_header; - PIMAGE_NT_HEADERS pimage_nt_headers; - pimage_dos_header = PIMAGE_DOS_HEADER(pImageBase); - pimage_nt_headers = (PIMAGE_NT_HEADERS)(pImageBase+pimage_dos_header->e_lfanew); - section=ImageRVA2Section(pimage_nt_headers,dwRVA); - if(section==NULL) - { - return(0); - } - _offset=dwRVA+section->PointerToRawData-section->VirtualAddress; - return(_offset); -} - -void *HookAPI(HMODULE module, char *dll, void *apiproc, const char *apiname, void *hookproc) -{ - PIMAGE_NT_HEADERS pnth; - PIMAGE_IMPORT_DESCRIPTOR pidesc; - DWORD base, rva; - PSTR impmodule; - PIMAGE_THUNK_DATA ptaddr; - PIMAGE_THUNK_DATA ptname; - PIMAGE_IMPORT_BY_NAME piname; - DWORD oldprotect; - void *org; - PCHAR pThunk; - DWORD dwThunk; - PCHAR pDllName; - - OutTraceB("HookAPI: module=%x dll=%s apiproc=%x apiname=%s hookproc=%x\n", - module, dll, apiproc, apiname, hookproc); - - if(!*apiname) { // check - char *sMsg="HookAPI: NULL api name\n"; - OutTraceE(sMsg); - if (IsAssertEnabled) MessageBox(0, sMsg, "HookAPI", MB_OK | MB_ICONEXCLAMATION); - return 0; - } - - base = (DWORD)module; - __try{ - pnth = PIMAGE_NT_HEADERS(PBYTE(base) + PIMAGE_DOS_HEADER(base)->e_lfanew); - if(!pnth) { - OutTraceE("HookAPI: ERROR no PNTH at %d\n", __LINE__); - return 0; - } - rva = pnth->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IAT].VirtualAddress; - if(!rva) { - OutTraceE("HookAPI: ERROR no IAT at %d\n", __LINE__); - return 0; - } - pidesc = (PIMAGE_IMPORT_DESCRIPTOR)(base + rva); - OutTraceDW("HookAPI: pidesc=%x\n", pidesc); - - while(pidesc->Name){ - pThunk=(PCHAR)base+pidesc->FirstThunk; - dwThunk = pidesc->FirstThunk; - pDllName=(PSTR)base+pidesc->Name; - OutTraceDW("HookAPI: pDllName=%s Name=%s\n", pDllName, pidesc->Name); - //impmodule = (PSTR)(base + pidesc->Name); - //if(!lstrcmpi(dll, impmodule)) break; - pidesc ++; - } - if(!pidesc->FirstThunk) { - OutTraceB("HookAPI: PE unreferenced dll=%s\n", dll); - return 0; - } - - ptaddr = (PIMAGE_THUNK_DATA)(base + (DWORD)pidesc->FirstThunk); - ptname = (pidesc->OriginalFirstThunk) ? (PIMAGE_THUNK_DATA)(base + (DWORD)pidesc->OriginalFirstThunk) : NULL; - - if((apiproc==NULL) && (ptname==NULL)){ - if (IsDebug) OutTraceDW("HookAPI: unreacheable api=%s dll=%s\n", apiname, dll); - return 0; - } - - while(ptaddr->u1.Function){ - if (ptname){ - if(!IMAGE_SNAP_BY_ORDINAL(ptname->u1.Ordinal)){ - piname = (PIMAGE_IMPORT_BY_NAME)(base + (DWORD)ptname->u1.AddressOfData); - if(!lstrcmpi(apiname, (char *)piname->Name)) break; - } - } - if (apiproc){ - if(ptaddr->u1.Function == (DWORD)apiproc) break; - } - ptaddr ++; - if (ptname) ptname ++; - } - if(!ptaddr->u1.Function) return 0; - - org = (void *)ptaddr->u1.Function; - if(org == hookproc) return 0; // already hooked - - if(!VirtualProtect(&ptaddr->u1.Function, 4, PAGE_EXECUTE_READWRITE, &oldprotect)) { - OutTraceDW("HookAPI: VirtualProtect error %d at %d\n", GetLastError(), __LINE__); - return 0; - } - ptaddr->u1.Function = (DWORD)hookproc; - if(!VirtualProtect(&ptaddr->u1.Function, 4, oldprotect, &oldprotect)) { - OutTraceDW("HookAPI: VirtualProtect error %d at %d\n", GetLastError(), __LINE__); - return 0; - } - if (!FlushInstructionCache(GetCurrentProcess(), &ptaddr->u1.Function, 4)) { - OutTraceDW("HookAPI: FlushInstructionCache error %d at %d\n", GetLastError(), __LINE__); - return 0; - } - if(IsDebug) OutTrace("HookAPI hook=%s address=%x->%x\n", apiname, org, hookproc); - } - __except(EXCEPTION_EXECUTE_HANDLER) - { - OutTraceDW("HookAPI: EXCEPTION hook=%s:%s Hook Failed.\n", dll, apiname); - org = 0; - } - return org; -} - -#else +// v2.02.53: thorough scan - the IAT is scanned considering the possibility to have each dll module +// replicated also many times. It may depend upon the compiling environment? +// So far, it makes the difference for Dungeon Odissey void *HookAPI(HMODULE module, char *dll, void *apiproc, const char *apiname, void *hookproc) { @@ -498,6 +364,8 @@ void *HookAPI(HMODULE module, char *dll, void *apiproc, const char *apiname, voi } base = (DWORD)module; + org = 0; // by default, ret = 0 => API not found + __try{ pnth = PIMAGE_NT_HEADERS(PBYTE(base) + PIMAGE_DOS_HEADER(base)->e_lfanew); if(!pnth) { @@ -513,65 +381,71 @@ void *HookAPI(HMODULE module, char *dll, void *apiproc, const char *apiname, voi while(pidesc->FirstThunk){ impmodule = (PSTR)(base + pidesc->Name); - if(!lstrcmpi(dll, impmodule)) break; + if(!lstrcmpi(dll, impmodule)) { + //OutTraceH("HookAPI: dll=%s found at %x\n", dll, impmodule); + + ptaddr = (PIMAGE_THUNK_DATA)(base + (DWORD)pidesc->FirstThunk); + ptname = (pidesc->OriginalFirstThunk) ? (PIMAGE_THUNK_DATA)(base + (DWORD)pidesc->OriginalFirstThunk) : NULL; + + //if((apiproc==NULL) && (ptname==NULL)){ + // OutTraceH("HookAPI: unreacheable api=%s dll=%s\n", apiname, dll); + // return 0; + //} + + while(ptaddr->u1.Function){ + if (ptname){ + if(!IMAGE_SNAP_BY_ORDINAL(ptname->u1.Ordinal)){ + piname = (PIMAGE_IMPORT_BY_NAME)(base + (DWORD)ptname->u1.AddressOfData); + //OutTrace("examining by ptname name=%s\n", (char *)piname->Name); + if(!lstrcmpi(apiname, (char *)piname->Name)) break; + } + } + if (apiproc){ + // log not working !!! + //piname = (PIMAGE_IMPORT_BY_NAME)(base + (DWORD)ptaddr->u1.AddressOfData); + //OutTrace("examining by addr name=%s\n", (char *)piname->Name); + if(ptaddr->u1.Function == (DWORD)apiproc) break; + } + ptaddr ++; + if (ptname) ptname ++; + } + + if(ptaddr->u1.Function) { + org = (void *)ptaddr->u1.Function; + if(org == hookproc) return 0; // already hooked + + if(!VirtualProtect(&ptaddr->u1.Function, 4, PAGE_EXECUTE_READWRITE, &oldprotect)) { + OutTraceDW("HookAPI: VirtualProtect error %d at %d\n", GetLastError(), __LINE__); + return 0; + } + ptaddr->u1.Function = (DWORD)hookproc; + if(!VirtualProtect(&ptaddr->u1.Function, 4, oldprotect, &oldprotect)) { + OutTraceDW("HookAPI: VirtualProtect error %d at %d\n", GetLastError(), __LINE__); + return 0; + } + if (!FlushInstructionCache(GetCurrentProcess(), &ptaddr->u1.Function, 4)) { + OutTraceDW("HookAPI: FlushInstructionCache error %d at %d\n", GetLastError(), __LINE__); + return 0; + } + OutTraceH("HookAPI hook=%s address=%x->%x\n", apiname, org, hookproc); + + return org; + } + } pidesc ++; } if(!pidesc->FirstThunk) { - OutTraceH("HookAPI: PE unreferenced dll=%s\n", dll); + OutTraceH("HookAPI: PE unreferenced function %s:%s\n", dll, apiname); return 0; } - - ptaddr = (PIMAGE_THUNK_DATA)(base + (DWORD)pidesc->FirstThunk); - ptname = (pidesc->OriginalFirstThunk) ? (PIMAGE_THUNK_DATA)(base + (DWORD)pidesc->OriginalFirstThunk) : NULL; - - if((apiproc==NULL) && (ptname==NULL)){ - OutTraceH("HookAPI: unreacheable api=%s dll=%s\n", apiname, dll); - return 0; - } - - while(ptaddr->u1.Function){ - if (ptname){ - if(!IMAGE_SNAP_BY_ORDINAL(ptname->u1.Ordinal)){ - piname = (PIMAGE_IMPORT_BY_NAME)(base + (DWORD)ptname->u1.AddressOfData); - if(!lstrcmpi(apiname, (char *)piname->Name)) break; - } - } - if (apiproc){ - if(ptaddr->u1.Function == (DWORD)apiproc) break; - } - ptaddr ++; - if (ptname) ptname ++; - } - if(!ptaddr->u1.Function) return 0; - - org = (void *)ptaddr->u1.Function; - if(org == hookproc) return 0; // already hooked - - if(!VirtualProtect(&ptaddr->u1.Function, 4, PAGE_EXECUTE_READWRITE, &oldprotect)) { - OutTraceDW("HookAPI: VirtualProtect error %d at %d\n", GetLastError(), __LINE__); - return 0; - } - ptaddr->u1.Function = (DWORD)hookproc; - if(!VirtualProtect(&ptaddr->u1.Function, 4, oldprotect, &oldprotect)) { - OutTraceDW("HookAPI: VirtualProtect error %d at %d\n", GetLastError(), __LINE__); - return 0; - } - if (!FlushInstructionCache(GetCurrentProcess(), &ptaddr->u1.Function, 4)) { - OutTraceDW("HookAPI: FlushInstructionCache error %d at %d\n", GetLastError(), __LINE__); - return 0; - } - OutTraceH("HookAPI hook=%s address=%x->%x\n", apiname, org, hookproc); } __except(EXCEPTION_EXECUTE_HANDLER) { OutTraceDW("HookAPI: EXCEPTION hook=%s:%s Hook Failed.\n", dll, apiname); - org = 0; } return org; } -#endif - // v.2.1.80: unified positioning logic into CalculateWindowPos routine // now taking in account for window menus (see "Alien Cabal") @@ -596,7 +470,7 @@ void CalculateWindowPos(HWND hwnd, DWORD width, DWORD height, LPWINDOWPOS wp) rect.bottom = rect.top + MaxY; //v2.02.09 break; case DXW_DESKTOP_WORKAREA: - SystemParametersInfo(SPI_GETWORKAREA, NULL, &workarea, 0); + (*pSystemParametersInfoA)(SPI_GETWORKAREA, NULL, &workarea, 0); rect = workarea; break; case DXW_DESKTOP_FULL: @@ -620,7 +494,8 @@ void CalculateWindowPos(HWND hwnd, DWORD width, DWORD height, LPWINDOWPOS wp) UnmappedRect=rect; dwStyle=(*pGetWindowLong)(hwnd, GWL_STYLE); dwExStyle=(*pGetWindowLong)(hwnd, GWL_EXSTYLE); - hMenu = GetMenu(hwnd); + // BEWARE: from MSDN - If the window is a child window, the return value is undefined. + hMenu = (dwStyle & WS_CHILD) ? NULL : GetMenu(hwnd); AdjustWindowRectEx(&rect, dwStyle, (hMenu!=NULL), dwExStyle); if (hMenu) CloseHandle(hMenu); switch(dxw.Coordinates){ @@ -1466,18 +1341,42 @@ extern HHOOK hMouseHook; LRESULT CALLBACK MessageHook(int code, WPARAM wParam, LPARAM lParam) { + static BOOL SizeMoving = FALSE; + if(code == HC_ACTION){ if(dxw.IsFullScreen()){ MSG *msg; msg = (MSG *)lParam; - OutTraceC("MessageHook: message=%d(%s) remove=%d pt=(%d,%d)\n", - msg->message, ExplainWinMessage(msg->message), msg->wParam, msg->pt.x, msg->pt.y); - msg->pt=dxw.FixMessagePt(dxw.GethWnd(), 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); - GetHookInfo()->CursorX=(short)msg->pt.x; - GetHookInfo()->CursorY=(short)msg->pt.y; + 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); + + switch(msg->message){ + case WM_ENTERSIZEMOVE: SizeMoving = TRUE; break; + case WM_EXITSIZEMOVE: SizeMoving = FALSE; break; + } + + // do not try to fix coordinates for points outside the client area!! + // in theory, that should primarily depend on the message type, but this is the way it works ... + // do not do the fixing also when in sizemove mode + RECT client; + client=dxw.GetUnmappedScreenRect(); + if ((SizeMoving) || + (msg->pt.x < client.left) || + (msg->pt.y < client.top) || + (msg->pt.x > client.right) || + (msg->pt.y > client.bottom)){ + // do nothing + } + else { + // fix the message point coordinates + msg->pt=dxw.FixMessagePt(dxw.GethWnd(), msg->pt); + //msg->pt=dxw.FixMessagePt(msg->hwnd, 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); + GetHookInfo()->CursorX=(short)msg->pt.x; + GetHookInfo()->CursorY=(short)msg->pt.y; + } } } return CallNextHookEx(hMouseHook, code, wParam, lParam); diff --git a/dll/dxwcore.cpp b/dll/dxwcore.cpp index feb3377..fe22d18 100644 --- a/dll/dxwcore.cpp +++ b/dll/dxwcore.cpp @@ -27,7 +27,7 @@ dxwCore::dxwCore() memset(PrimSurfaces, 0, sizeof(PrimSurfaces)); ResetEmulatedDC(); MustShowOverlay=FALSE; - TimerEvent.uTimerId = 0; + TimerEvent.dwTimerType = TIMER_TYPE_NONE; } dxwCore::~dxwCore() @@ -244,6 +244,21 @@ RECT dxwCore::GetScreenRect() return Screen; } +RECT dxwCore::GetUnmappedScreenRect() +{ + static RECT Screen; + POINT upleft = {0, 0}; + memset(&Screen, 0, sizeof(RECT)); + (*pGetClientRect)(hWnd, &Screen); + (*pClientToScreen)(hWnd, &upleft); + Screen.top += upleft.x; + Screen.bottom += upleft.x; + Screen.left += upleft.y; + Screen.right += upleft.y; + return Screen; +} + + BOOL dxwCore::IsDesktop(HWND hwnd) { return ( @@ -1326,6 +1341,7 @@ BOOL dxwCore::ReleaseEmulatedDC(HWND hwnd) (*pGetClientRect)(hwnd, &client); if(!(wdc=(*pGDIGetDC)(hwnd))) OutTraceE("GetDC: ERROR err=%d at=%d\n", GetLastError(), __LINE__); + //OutTrace("StretchBlt: destdc=%x destrect=(0,0)-(%d,%d) srcdc=%x srcrect=(0,0)-(%d,%d)\n", wdc, client.right, client.bottom, VirtualHDC, dxw.GetScreenWidth(), dxw.GetScreenHeight()); if(!(*pGDIStretchBlt)(wdc, 0, 0, client.right, client.bottom, VirtualHDC, 0, 0, dxw.GetScreenWidth(), dxw.GetScreenHeight(), SRCCOPY)) OutTraceE("StretchBlt: ERROR err=%d at=%d\n", GetLastError(), __LINE__); //(*pInvalidateRect)(hwnd, NULL, 0); @@ -1349,40 +1365,91 @@ BOOL dxwCore::IsVirtual(HDC hdc) void dxwCore::PushTimer(UINT uTimerId, UINT uDelay, UINT uResolution, LPTIMECALLBACK lpTimeProc, DWORD_PTR dwUser, UINT fuEvent) { // save current timer - TimerEvent.uTimerId = uTimerId; - TimerEvent.uDelay = uDelay; - TimerEvent.uResolution = uResolution; - TimerEvent.lpTimeProc = lpTimeProc; - TimerEvent.dwUser = dwUser; - TimerEvent.fuEvent = fuEvent; + TimerEvent.dwTimerType = TIMER_TYPE_WINMM; + TimerEvent.t.uTimerId = uTimerId; + TimerEvent.t.uDelay = uDelay; + TimerEvent.t.uResolution = uResolution; + TimerEvent.t.lpTimeProc = lpTimeProc; + TimerEvent.t.dwUser = dwUser; + TimerEvent.t.fuEvent = fuEvent; +} + +void dxwCore::PushTimer(HWND hWnd, UINT_PTR nIDEvent, UINT uElapse, TIMERPROC lpTimerFunc) +{ + // save current timer + TimerEvent.dwTimerType = TIMER_TYPE_USER32; + TimerEvent.t.hWnd = hWnd; + TimerEvent.t.nIDEvent = nIDEvent; + TimerEvent.t.uElapse = uElapse; + TimerEvent.t.lpTimerFunc = lpTimerFunc; } void dxwCore::PopTimer(UINT uTimerId) { - // clear current timer - if(uTimerId != TimerEvent.uTimerId){ + // clear current timer + if(TimerEvent.dwTimerType != TIMER_TYPE_WINMM) { // this should never happen, unless there are more than 1 timer! char msg[256]; - sprintf(msg,"PopTimer: TimerId=%x last=%x\n", uTimerId, TimerEvent.uTimerId); + sprintf(msg,"PopTimer: TimerType=%x last=%x\n", TIMER_TYPE_WINMM, TimerEvent.dwTimerType); MessageBox(0, msg, "PopTimer", MB_OK | MB_ICONEXCLAMATION); return; } - TimerEvent.uTimerId = 0; - TimerEvent.uDelay = 0; - TimerEvent.uResolution = 0; - TimerEvent.lpTimeProc = NULL; - TimerEvent.dwUser = 0; - TimerEvent.fuEvent = 0; + if(uTimerId != TimerEvent.t.uTimerId){ + // this should never happen, unless there are more than 1 timer! + char msg[256]; + sprintf(msg,"PopTimer: TimerId=%x last=%x\n", uTimerId, TimerEvent.t.uTimerId); + MessageBox(0, msg, "PopTimer", MB_OK | MB_ICONEXCLAMATION); + return; + } + TimerEvent.dwTimerType = TIMER_TYPE_NONE; +} + +void dxwCore::PopTimer(HWND hWnd, UINT_PTR nIDEvent) +{ + // clear current timer + if(TimerEvent.dwTimerType != TIMER_TYPE_USER32) { + // this should never happen, unless there are more than 1 timer! + char msg[256]; + sprintf(msg,"PopTimer: TimerType=%x last=%x\n", TIMER_TYPE_WINMM, TimerEvent.dwTimerType); + MessageBox(0, msg, "PopTimer", MB_OK | MB_ICONEXCLAMATION); + return; + } + if(nIDEvent != TimerEvent.t.nIDEvent){ + // this should never happen, unless there are more than 1 timer! + char msg[256]; + sprintf(msg,"PopTimer: TimerId=%x last=%x\n", nIDEvent, TimerEvent.t.nIDEvent); + MessageBox(0, msg, "PopTimer", MB_OK | MB_ICONEXCLAMATION); + return; + } + TimerEvent.dwTimerType = TIMER_TYPE_NONE; } void dxwCore::RenewTimers() { - if(ptimeKillEvent && ptimeSetEvent && TimerEvent.uTimerId){ - UINT NewDelay; - MMRESULT res; - (*ptimeKillEvent)(TimerEvent.uTimerId); - NewDelay = dxw.StretchTime(TimerEvent.uDelay); - res=(*ptimeSetEvent)(NewDelay, TimerEvent.uResolution, TimerEvent.lpTimeProc, TimerEvent.dwUser, TimerEvent.fuEvent); - TimerEvent.uTimerId = res; + switch(TimerEvent.dwTimerType){ + case TIMER_TYPE_NONE: + break; + case TIMER_TYPE_USER32: + if(pSetTimer && pKillTimer){ + UINT uElapse; + UINT_PTR res; + (*pKillTimer)(TimerEvent.t.hWnd, TimerEvent.t.nIDEvent); + uElapse = dxw.StretchTime(TimerEvent.t.uElapse); + res=(*pSetTimer)(TimerEvent.t.hWnd, TimerEvent.t.nIDEvent, uElapse, TimerEvent.t.lpTimerFunc); + TimerEvent.t.nIDEvent = res; + OutTraceDW("DXWND: RenewTimers type=USER32 Elsapse=%d IDEvent=%x\n", uElapse, res); + } + break; + case TIMER_TYPE_WINMM: + if(ptimeKillEvent && ptimeSetEvent){ + UINT NewDelay; + MMRESULT res; + (*ptimeKillEvent)(TimerEvent.t.uTimerId); + NewDelay = dxw.StretchTime(TimerEvent.t.uDelay); + res=(*ptimeSetEvent)(NewDelay, TimerEvent.t.uResolution, TimerEvent.t.lpTimeProc, TimerEvent.t.dwUser, TimerEvent.t.fuEvent); + TimerEvent.t.uTimerId = res; + OutTraceDW("DXWND: RenewTimers type=WINMM Delay=%d TimerId=%x\n", NewDelay, res); + } + break; } } diff --git a/dll/dxwcore.hpp b/dll/dxwcore.hpp index cd7b77a..0e92324 100644 --- a/dll/dxwcore.hpp +++ b/dll/dxwcore.hpp @@ -4,12 +4,23 @@ #define DDSQLEN 0x10 typedef struct { - UINT uTimerId; - UINT uDelay; - UINT uResolution; - LPTIMECALLBACK lpTimeProc; - DWORD_PTR dwUser; - UINT fuEvent; + DWORD dwTimerType; + union{ + struct { + UINT uTimerId; + UINT uDelay; + UINT uResolution; + LPTIMECALLBACK lpTimeProc; + DWORD_PTR dwUser; + UINT fuEvent; + }; + struct { + HWND hWnd; + UINT_PTR nIDEvent; + UINT uElapse; + TIMERPROC lpTimerFunc; + }; + } t; } TimerEvent_Type; class dxwCore @@ -53,6 +64,7 @@ public: // methods void FixWorkarea(LPRECT); POINT FixMessagePt(HWND, POINT); RECT GetScreenRect(void); + RECT GetUnmappedScreenRect(); RECT GetWindowRect(RECT); RECT GetClientRect(RECT); POINT AddCoordinates(POINT, POINT); @@ -94,7 +106,9 @@ public: // methods int VirtualOffsetX, VirtualOffsetY; void DumpPalette(DWORD, LPPALETTEENTRY); void PushTimer(UINT, UINT, UINT, LPTIMECALLBACK, DWORD_PTR, UINT); + void PushTimer(HWND, UINT_PTR, UINT, TIMERPROC); void PopTimer(UINT); + void PopTimer(HWND, UINT_PTR); void RenewTimers(); public: // simple data variables diff --git a/dll/dxwnd.cpp b/dll/dxwnd.cpp index 7a8e08e..a4525f9 100644 --- a/dll/dxwnd.cpp +++ b/dll/dxwnd.cpp @@ -24,7 +24,7 @@ along with this program. If not, see . #include "dxwnd.h" #include "dxwcore.hpp" -#define VERSION "2.02.52" +#define VERSION "2.02.53" #define DDTHREADLOCK 1 diff --git a/dll/dxwnd.suo b/dll/dxwnd.suo deleted file mode 100644 index 235056e..0000000 Binary files a/dll/dxwnd.suo and /dev/null differ diff --git a/dll/dxwnd.vs2008.suo b/dll/dxwnd.vs2008.suo index 9fb5a5d..f1a1067 100644 Binary files a/dll/dxwnd.vs2008.suo and b/dll/dxwnd.vs2008.suo differ diff --git a/dll/gdi32.cpp b/dll/gdi32.cpp index 6247fee..9298cbb 100644 --- a/dll/gdi32.cpp +++ b/dll/gdi32.cpp @@ -78,11 +78,12 @@ static HookEntry_Type ScaledHooks[]={ {"Ellipse", (FARPROC)NULL, (FARPROC *)&pEllipse, (FARPROC)extEllipse}, {"Polygon", (FARPROC)NULL, (FARPROC *)&pPolygon, (FARPROC)extPolygon}, {"Arc", (FARPROC)NULL, (FARPROC *)&pArc, (FARPROC)extArc}, - {"CreateEllipticRgn", (FARPROC)NULL, (FARPROC *)&pCreateEllipticRgn, (FARPROC)extCreateEllipticRgn}, - {"CreateEllipticRgnIndirect", (FARPROC)NULL, (FARPROC *)&pCreateEllipticRgnIndirect, (FARPROC)extCreateEllipticRgnIndirect}, - {"CreateRectRgn", (FARPROC)NULL, (FARPROC *)&pCreateRectRgn, (FARPROC)extCreateRectRgn}, - {"CreateRectRgnIndirect", (FARPROC)NULL, (FARPROC *)&pCreateRectRgnIndirect, (FARPROC)extCreateRectRgnIndirect}, - {"CreatePolygonRgn", (FARPROC)NULL, (FARPROC *)&pCreatePolygonRgn, (FARPROC)extCreatePolygonRgn}, + // commented out since they alter text on screen...... (see Imperialism II difficulty level menu) + //{"CreateEllipticRgn", (FARPROC)NULL, (FARPROC *)&pCreateEllipticRgn, (FARPROC)extCreateEllipticRgn}, + //{"CreateEllipticRgnIndirect", (FARPROC)NULL, (FARPROC *)&pCreateEllipticRgnIndirect, (FARPROC)extCreateEllipticRgnIndirect}, + //{"CreateRectRgn", (FARPROC)NULL, (FARPROC *)&pCreateRectRgn, (FARPROC)extCreateRectRgn}, + //{"CreateRectRgnIndirect", (FARPROC)NULL, (FARPROC *)&pCreateRectRgnIndirect, (FARPROC)extCreateRectRgnIndirect}, + //{"CreatePolygonRgn", (FARPROC)NULL, (FARPROC *)&pCreatePolygonRgn, (FARPROC)extCreatePolygonRgn}, {"DrawTextA", (FARPROC)NULL, (FARPROC *)&pDrawText, (FARPROC)extDrawText}, {"DrawTextExA", (FARPROC)NULL, (FARPROC *)&pDrawTextEx, (FARPROC)extDrawTextEx}, @@ -123,11 +124,9 @@ static HookEntry_Type DDHooks[]={ {"CreateDCA", (FARPROC)CreateDCA, (FARPROC *)&pGDICreateDC, (FARPROC)extDDCreateDC}, {"BitBlt", (FARPROC)BitBlt, (FARPROC *)&pGDIBitBlt, (FARPROC)extDDBitBlt}, {"StretchBlt", (FARPROC)StretchBlt, (FARPROC *)&pGDIStretchBlt, (FARPROC)extDDStretchBlt}, - // {"PatBlt", (FARPROC)PatBlt, (FARPROC *)&pGDIPatBlt, (FARPROC)extDDPatBlt}, // missing one ... - // {"MaskBlt", (FARPROC)NULL, (FARPROC *)&pMaskBlt, (FARPROC)extMaskBlt}, - {"GetClipBox", (FARPROC)NULL, (FARPROC *)&pGDIGetClipBox, (FARPROC)extGetClipBox}, - + // {"PatBlt", (FARPROC)PatBlt, (FARPROC *)&pGDIPatBlt, (FARPROC)extDDPatBlt}, // missing one ... + // {"MaskBlt", (FARPROC)NULL, (FARPROC *)&pMaskBlt, (FARPROC)extDDMaskBlt}, // missing one ... {0, NULL, 0, 0} // terminator }; @@ -315,7 +314,6 @@ int WINAPI extGetDeviceCaps(HDC hdc, int nindex) } } - // if you have a bypassed setting, use it first! if(pSetDevMode){ switch(nindex){ @@ -618,18 +616,22 @@ extern HDC PrimHDC; HDC WINAPI extDDCreateCompatibleDC(HDC hdc) { - HDC RetHdc, SrcHdc; + HDC RetHdc; extern GetDC_Type pGetDC; OutTraceDW("GDI.CreateCompatibleDC: hdc=%x\n", hdc); - if(hdc==0 && pGetDC && dxw.IsFullScreen()){ + if(dxw.IsDesktop(WindowFromDC(hdc)) && dxw.IsFullScreen()) { dxw.SetPrimarySurface(); - (*pGetDC)(dxw.lpDDSPrimHDC,&SrcHdc); - OutTraceDW("GDI.CreateCompatibleDC: duplicating screen HDC lpDDSPrimHDC=%x\n", dxw.lpDDSPrimHDC); - RetHdc=(*pGDICreateCompatibleDC)(SrcHdc); - (*pReleaseDC)(dxw.lpDDSPrimHDC,SrcHdc); - } + if(!PrimHDC && dxw.lpDDSPrimHDC){ + HRESULT res; + STOPPER("null PrimHDC"); + res=(*pGetDC)(dxw.lpDDSPrimHDC, &PrimHDC); + if(res) OutTraceE("GDI.CreateCompatibleDC ERROR: GetDC lpdds=%x err=%d(%s) at %d\n", dxw.lpDDSPrimHDC, res, ExplainDDError(res), __LINE__); + } + OutTraceDW("GDI.CreateCompatibleDC: duplicating screen HDC lpDDSPrimHDC=%x SrcHdc=%x\n", dxw.lpDDSPrimHDC, PrimHDC); + RetHdc=(*pGDICreateCompatibleDC)(PrimHDC); + } else RetHdc=(*pGDICreateCompatibleDC)(hdc); @@ -774,7 +776,6 @@ HDC WINAPI extDDGetWindowDC(HWND hwnd) return ret; } -#if 1 int WINAPI extDDReleaseDC(HWND hwnd, HDC hDC) { int res; @@ -796,27 +797,6 @@ int WINAPI extDDReleaseDC(HWND hwnd, HDC hDC) } return(res); } -#else -int WINAPI extDDReleaseDC(HWND hwnd, HDC hDC) -{ - int res; - extern HRESULT WINAPI extReleaseDC(LPDIRECTDRAWSURFACE, HDC); - - OutTraceDW("GDI.ReleaseDC: hwnd=%x hdc=%x\n", hwnd, hDC); - res=0; - if (hDC == hPrimaryDC){ - OutTraceDW("GDI.ReleaseDC: refreshing primary surface lpdds=%x\n",dxw.lpDDSPrimHDC); - //extReleaseDC(dxw.lpDDSPrimHDC, hDC); - hPrimaryDC=NULL; - res=1; // 1 = OK - } - else { - res=(*pGDIReleaseDC)(hwnd, hDC); - if (!res) OutTraceE("GDI.ReleaseDC: ERROR err=%d at %d\n", GetLastError(), __LINE__); - } - return(res); -} -#endif BOOL WINAPI extDDBitBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HDC hdcSrc, int nXSrc, int nYSrc, DWORD dwRop) { @@ -829,19 +809,26 @@ BOOL WINAPI extDDBitBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHe ret=1; // OK - if(hdcDest==0) { + //if(hdcDest==0) { + if(dxw.IsDesktop(WindowFromDC(hdcDest))) { + OutTrace("hdcDest=%x PrimHDC=%x\n", hdcDest, PrimHDC); hdcDest=PrimHDC; if(hdcDest==0) { dxw.ResetPrimarySurface(); dxw.SetPrimarySurface(); - res=extGetDC(dxw.lpDDSPrimHDC, &PrimHDC); + extGetDC(dxw.lpDDSPrimHDC, &PrimHDC); hdcDest=PrimHDC; } + res=(*pGDIBitBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop); + if(!res) OutTraceE("GDI.BitBlt: ERROR err=%d at %d\n", GetLastError(), __LINE__); + dxw.ScreenRefresh(); + } res=(*pGDIBitBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop); if(!res) OutTraceE("GDI.BitBlt: ERROR err=%d at %d\n", GetLastError(), __LINE__); + //dxw.SetPrimarySurface(); //OutTraceDW("GDI.StretchBlt: refreshing primary surface lpdds=%x\n",dxw.lpDDSPrimHDC); //sBlt("GDI.BitBlt", dxw.lpDDSPrimHDC, NULL, dxw.lpDDSPrimHDC, NULL, 0, NULL, 0); @@ -857,10 +844,21 @@ BOOL WINAPI extDDStretchBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int { BOOL ret; RECT ClientRect; + extern HRESULT WINAPI extGetDC(LPDIRECTDRAWSURFACE, HDC FAR *); OutTraceDW("GDI.StretchBlt: HDC=%x nXDest=%d nYDest=%d nWidth=%d nHeight=%d hdcSrc=%x nXSrc=%d nYSrc=%d nWSrc=%x nHSrc=%x dwRop=%x\n", hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, nWSrc, nHSrc, dwRop); + //if(dxw.IsDesktop(WindowFromDC(hdcDest))) { + // hdcDest=PrimHDC; + // if(hdcDest==0) { + // dxw.ResetPrimarySurface(); + // dxw.SetPrimarySurface(); + // extGetDC(dxw.lpDDSPrimHDC, &PrimHDC); + // hdcDest=PrimHDC; + // } + //} + if(hdcDest != hdcSrc){ (*pGetClientRect)(dxw.GethWnd(),&ClientRect); ret=(*pGDIStretchBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, nWidth, nHeight, dwRop); @@ -1936,6 +1934,13 @@ DWORD WINAPI extGetObjectType(HGDIOBJ h) } #if 0 +HBITMAP WINAPI extCreateDIBitmap(HDC hdc, const BITMAPINFOHEADER *lpbmih, DWORD fdwInit, const VOID *lpbInit, const BITMAPINFO *lpbmi, UINT fuUsage) +{ + OutTrace("CreateDIBitmap: hdc=x dwInit=%x bInit=%x Usage=%x\n", hdc, fdwInit, lpbInit, fuUsage); + return NULL; +} + + int WINAPI extSetMapMode(HDC hdc, int fnMapMode) { OutTraceDW("SetMapMode: hdc=%x MapMode=%d\n", hdc, fnMapMode); diff --git a/dll/kernel32.cpp b/dll/kernel32.cpp index f42d349..c0c303c 100644 --- a/dll/kernel32.cpp +++ b/dll/kernel32.cpp @@ -6,6 +6,9 @@ #include "hddraw.h" #include "ddproxy.h" +//#undef IsTraceDW +//#define IsTraceDW TRUE + static HookEntry_Type Hooks[]={ {"IsDebuggerPresent", (FARPROC)NULL, (FARPROC *)NULL, (FARPROC)extIsDebuggerPresent}, {"GetProcAddress", (FARPROC)GetProcAddress, (FARPROC *)&pGetProcAddress, (FARPROC)extGetProcAddress}, @@ -38,7 +41,6 @@ static HookEntry_Type TimeHooks[]={ {"GetSystemTimeAsFileTime", (FARPROC)GetSystemTimeAsFileTime, (FARPROC *)&pGetSystemTimeAsFileTime, (FARPROC)extGetSystemTimeAsFileTime}, {"Sleep", (FARPROC)Sleep, (FARPROC *)&pSleep, (FARPROC)extSleep}, {"SleepEx", (FARPROC)SleepEx, (FARPROC *)&pSleepEx, (FARPROC)extSleepEx}, - {"SetTimer", (FARPROC)SetTimer, (FARPROC *)&pSetTimer, (FARPROC)extSetTimer}, {"QueryPerformanceCounter", (FARPROC)NULL, (FARPROC *)&pQueryPerformanceCounter, (FARPROC)extQueryPerformanceCounter}, {"QueryPerformanceFrequency", (FARPROC)NULL, (FARPROC *)&pQueryPerformanceFrequency, (FARPROC)extQueryPerformanceFrequency}, {0, NULL, 0, 0} // terminator @@ -46,7 +48,8 @@ static HookEntry_Type TimeHooks[]={ static HookEntry_Type VersionHooks[]={ {"GetVersion", (FARPROC)GetVersion, (FARPROC *)&pGetVersion, (FARPROC)extGetVersion}, - {"GetVersionEx", (FARPROC)GetVersionEx, (FARPROC *)&pGetVersionEx, (FARPROC)extGetVersionEx}, + {"GetVersionExA", (FARPROC)GetVersionExA, (FARPROC *)&pGetVersionExA, (FARPROC)extGetVersionExA}, + {"GetVersionExW", (FARPROC)GetVersionExW, (FARPROC *)&pGetVersionExW, (FARPROC)extGetVersionExW}, {0, NULL, 0, 0} // terminator }; @@ -199,11 +202,11 @@ static struct {char bMajor; char bMinor; char *sName;} WinVersions[9]= {6, 2, "Windows 8"} }; -BOOL WINAPI extGetVersionEx(LPOSVERSIONINFO lpVersionInfo) +BOOL WINAPI extGetVersionExA(LPOSVERSIONINFOA lpVersionInfo) { BOOL ret; - ret=(*pGetVersionEx)(lpVersionInfo); + ret=(*pGetVersionExA)(lpVersionInfo); if(!ret) { OutTraceE("GetVersionEx: ERROR err=%d\n", GetLastError()); return ret; @@ -224,6 +227,31 @@ BOOL WINAPI extGetVersionEx(LPOSVERSIONINFO lpVersionInfo) return TRUE; } +BOOL WINAPI extGetVersionExW(LPOSVERSIONINFOW lpVersionInfo) +{ + BOOL ret; + + ret=(*pGetVersionExW)(lpVersionInfo); + if(!ret) { + OutTraceE("GetVersionEx: ERROR err=%d\n", GetLastError()); + return ret; + } + + OutTraceDW("GetVersionEx: version=%d.%d build=(%d)\n", + lpVersionInfo->dwMajorVersion, lpVersionInfo->dwMinorVersion, lpVersionInfo->dwBuildNumber); + + if(dxw.dwFlags2 & FAKEVERSION) { + // fake Win XP build 0 + lpVersionInfo->dwMajorVersion = WinVersions[dxw.FakeVersionId].bMajor; + lpVersionInfo->dwMinorVersion = WinVersions[dxw.FakeVersionId].bMinor; + lpVersionInfo->dwBuildNumber = 0; + OutTraceDW("GetVersionEx: FIXED version=%d.%d build=(%d) os=\"%ls\"\n", + lpVersionInfo->dwMajorVersion, lpVersionInfo->dwMinorVersion, lpVersionInfo->dwBuildNumber, + WinVersions[dxw.FakeVersionId].sName); + } + return TRUE; +} + DWORD WINAPI extGetVersion(void) { DWORD dwVersion; @@ -284,17 +312,6 @@ void WINAPI extGetLocalTime(LPSYSTEMTIME lpLocalTime) lpLocalTime->wHour, lpLocalTime->wMinute, lpLocalTime->wSecond, lpLocalTime->wMilliseconds); } -UINT_PTR WINAPI extSetTimer(HWND hWnd, UINT_PTR nIDEvent, UINT uElapse, TIMERPROC lpTimerFunc) -{ - UINT uShiftedElapse; - // beware: the quicker the time flows, the more the time clicks are incremented, - // and the lesser the pauses must be lasting! Shift operations are reverted in - // GetSystemTime vs. Sleep or SetTimer - uShiftedElapse = dxw.StretchTime(uElapse); - if (IsDebug) OutTrace("SetTimer: elapse=%d->%d timeshift=%d\n", uElapse, uShiftedElapse, dxw.TimeShift); - return (*pSetTimer)(hWnd, nIDEvent, uShiftedElapse, lpTimerFunc); -} - VOID WINAPI extSleep(DWORD dwMilliseconds) { DWORD dwNewDelay; @@ -331,6 +348,45 @@ void WINAPI extGetSystemTimeAsFileTime(LPFILETIME lpSystemTimeAsFileTime) dxw.GetSystemTimeAsFileTime(lpSystemTimeAsFileTime); } +BOOL WINAPI extQueryPerformanceCounter(LARGE_INTEGER *lpPerformanceCount) +{ + BOOL ret; + LARGE_INTEGER myPerfCount; + if(dxw.dwFlags4 & NOPERFCOUNTER){ + ret=0; + myPerfCount.QuadPart = 0; + } + else{ + ret=(*pQueryPerformanceCounter)(&myPerfCount); + myPerfCount = dxw.StretchCounter(myPerfCount); + } + *lpPerformanceCount = myPerfCount; + OutTraceB("QueryPerformanceCounter: ret=%x Count=%x-%x\n", ret, lpPerformanceCount->HighPart, lpPerformanceCount->LowPart); + return ret; +} + +BOOL WINAPI extQueryPerformanceFrequency(LARGE_INTEGER *lpPerformanceFrequency) +{ + BOOL ret; + if(dxw.dwFlags4 & NOPERFCOUNTER){ + LARGE_INTEGER myPerfFrequency; + myPerfFrequency.LowPart = 0L; + myPerfFrequency.HighPart = 0L; + *lpPerformanceFrequency=myPerfFrequency; + ret = 0; + } + else + ret=(*pQueryPerformanceFrequency)(lpPerformanceFrequency); + OutTraceDW("QueryPerformanceFrequency: ret=%x Frequency=%x-%x\n", ret, lpPerformanceFrequency->HighPart, lpPerformanceFrequency->LowPart); + return ret; +} + +/* ------------------------------------------------------------------------------- + +LoadLibrary (hooking) related APIs + +/* ---------------------------------------------------------------------------- */ + HMODULE SysLibs[SYSLIBIDX_MAX]; HMODULE WINAPI LoadLibraryExWrapper(LPCTSTR lpFileName, HANDLE hFile, DWORD dwFlags, char *api) @@ -536,6 +592,12 @@ FARPROC WINAPI extGetProcAddress(HMODULE hModule, LPCSTR proc) return ret; } +/* ------------------------------------------------------------------------------- + +I/O related APIs + +/* ---------------------------------------------------------------------------- */ + UINT WINAPI extGetDriveType(LPCTSTR lpRootPathName) { OutTraceDW("GetDriveType: path=\"%s\"\n", lpRootPathName); @@ -543,91 +605,30 @@ UINT WINAPI extGetDriveType(LPCTSTR lpRootPathName) return (*pGetDriveType)(lpRootPathName); } -static HANDLE LastFile=NULL; -static int Where=0; -static DWORD FileLength; -static DWORD IOHeapSize; -static HANDLE IOHeap; - BOOL WINAPI extReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped) { BOOL ret; static char *IOBuffer=NULL; - DWORD BytesRead; - DWORD Cursor; - //HANDLE hFileRead; - OutTrace("ReadFile: hFile=%x Buffer=%x BytesToRead=%d\n", hFile, lpBuffer, nNumberOfBytesToRead); -#define SECTOR_SIZE 4096 -//#define LEGACY_SIZE 1024 -#define LEGACY_SIZE 1024 - - if(!IOBuffer) { // initial allocation - IOHeap=HeapCreate(0, 0, 0); - IOHeapSize = SECTOR_SIZE*200; - if(IOHeap==NULL) OutTraceE("HeapCreate ERROR: err=%d at %d\n", GetLastError(), __LINE__); - IOBuffer=(char *)HeapAlloc(IOHeap, 0, IOHeapSize); - if(IOBuffer==0) OutTraceE("HeapAlloc ERROR: err=%d at %d\n", GetLastError(), __LINE__); - OutTrace("ReadFile: Heap=%x Buffer=%x\n", IOHeap, IOBuffer); - } - - // if reading current cached file .... - if(hFile==LastFile){ - OutTrace("ReadFile: BUFFERED BEFORE BytesRequested=%d FileSize=%d where=%d\n", - nNumberOfBytesToRead, FileLength, Where); - if((Where+nNumberOfBytesToRead)<=FileLength) - *lpNumberOfBytesRead=nNumberOfBytesToRead; - else - *lpNumberOfBytesRead=FileLength-Where; - if (*lpNumberOfBytesRead < 0) *lpNumberOfBytesRead=0; - memcpy((char *)lpBuffer, IOBuffer+Where, *lpNumberOfBytesRead); - OutTrace("ReadFile: "); - for(unsigned int i=0; i<*lpNumberOfBytesRead; i++) OutTrace("%02X,", *((unsigned char *)lpBuffer+i)); + if(IsTraceDW){ + OutTrace("ReadFile: hFile=%x Buffer=%x BytesToRead=%d Overlapped=%x", hFile, lpBuffer, nNumberOfBytesToRead, lpOverlapped); + if(lpOverlapped) OutTrace("->(Offset=0x%x OffsetHigh=0x%x)", lpOverlapped->Offset, lpOverlapped->OffsetHigh); OutTrace("\n"); - OutTrace("ReadFile: BUFFERED READ BytesRequested=%d BytesRead=%d where=%d\n", - nNumberOfBytesToRead, *lpNumberOfBytesRead, Where); - Where += (*lpNumberOfBytesRead); - //Where = ((Where+(LEGACY_SIZE-1)) / LEGACY_SIZE) * LEGACY_SIZE; - return TRUE; } - - LastFile=hFile; - Where=Cursor=0; - // get the whole file - Where=(*pSetFilePointer)(hFile, 0, 0, FILE_CURRENT); - if(Where==INVALID_SET_FILE_POINTER){ - OutTraceE("SetFilePointer ERROR: err=%d at %d\n", GetLastError(), __LINE__); - return FALSE; - } - if((*pSetFilePointer)(hFile, 0, 0, FILE_BEGIN)==INVALID_SET_FILE_POINTER){ - OutTraceE("SetFilePointer ERROR: err=%d at %d\n", GetLastError(), __LINE__); - return FALSE; - } - OutTrace("SetFilePointer: current pos=%d\n", Where); - //hFileRead=ReOpenFile(hFile, 0, 0, 0); - do {// try to read it all - // when space is not enough, let's grow! - if((DWORD)(Cursor+SECTOR_SIZE) > (DWORD)IOHeapSize){ - OutTrace("HeapReAlloc: about to add another chunk... current size=%d\n", IOHeapSize); - IOHeapSize += (200*SECTOR_SIZE); - IOBuffer=(char *)HeapReAlloc(IOHeap, 0, IOBuffer, IOHeapSize); - if(IOBuffer==0) OutTraceE("HeapReAlloc ERROR: err=%d at %d\n", GetLastError(), __LINE__); - } - ret=(*pReadFile)(hFile, IOBuffer+Cursor, SECTOR_SIZE, &BytesRead, NULL); // read one block - if(!ret) - OutTrace("ReadFIle ERROR: err=%d at %d\n", GetLastError(), __LINE__); - else - OutTrace("ReadFIle: BytesRead=%d\n", BytesRead); - Cursor+=BytesRead; - if (ret && BytesRead == 0) ret=FALSE; // eof - } while(ret); - //CloseHandle(hFileRead); - OutTrace("ReadFIle: BUFFERED FileSize=%d\n", Cursor); - FileLength=Cursor; - // recurse ... - return extReadFile(hFile, lpBuffer, nNumberOfBytesToRead, lpNumberOfBytesRead, lpOverlapped); + ret = (*pReadFile)(hFile, lpBuffer, nNumberOfBytesToRead, lpNumberOfBytesRead, lpOverlapped); + if(IsTraceDW){ + if(ret){ + OutTrace("ReadFile: NumberOfBytesRead=%d\n", *lpNumberOfBytesRead); + OutTrace("ReadFile: "); + for(unsigned int i=0; i<*lpNumberOfBytesRead; i++) OutTrace("%02X,", *((unsigned char *)lpBuffer+i)); + OutTrace("\n"); + } + else + OutTrace("ReadFile: ERROR err=%d\n", GetLastError()); + } + return ret; } HANDLE WINAPI extCreateFile(LPCTSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, @@ -635,76 +636,41 @@ HANDLE WINAPI extCreateFile(LPCTSTR lpFileName, DWORD dwDesiredAccess, DWORD dwS DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) { HANDLE ret; - OutTrace("CreateFile: FileName=%s DesiredAccess=%x SharedMode=%x Disposition=%x Flags=%x\n", + OutTraceDW("CreateFile: FileName=%s DesiredAccess=%x SharedMode=%x Disposition=%x Flags=%x\n", lpFileName, dwDesiredAccess, dwShareMode, dwCreationDisposition, dwFlagsAndAttributes); - //dwFlagsAndAttributes &= ~FILE_FLAG_NO_BUFFERING; + // just proxy + if(!(dxw.dwFlags3 & BUFFEREDIOFIX)) + return (*pCreateFile)(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile); + + if((dxw.dwFlags3 & BUFFEREDIOFIX) && (dwFlagsAndAttributes & FILE_FLAG_NO_BUFFERING)){ + OutTraceDW("CreateFile: suppress FILE_FLAG_NO_BUFFERING\n"); + dwFlagsAndAttributes &= ~FILE_FLAG_NO_BUFFERING; + } ret=(*pCreateFile)(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile); - if(ret && (ret != (HANDLE)INVALID_SET_FILE_POINTER)) - OutTrace("CreateFile: ret=%x\n", ret); - else - OutTraceE("CreateFile ERROR: err=%d\n", GetLastError()); + if(IsTraceDW){ + if(ret && (ret != (HANDLE)INVALID_SET_FILE_POINTER)) + OutTrace("CreateFile: ret=%x\n", ret); + else + OutTrace("CreateFile ERROR: err=%d\n", GetLastError()); + } return ret; } BOOL WINAPI extCloseHandle(HANDLE hObject) { - if (hObject==LastFile) { - LastFile=0; // invalidate cache - OutTrace("CloseHandle: INVALIDATE CACHE hFile=%x\n", hObject); - } + OutTrace("CloseHandle: hFile=%x\n", hObject); return (*pCloseHandle)(hObject); } DWORD WINAPI extSetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod) { - DWORD ret; - OutTrace("SetFilePointer: hFile=%x DistanceToMove=%ld DistanceToMoveHigh=%x MoveMethod=%x\n", + OutTrace("SetFilePointer: hFile=%x DistanceToMove=0x%lx DistanceToMoveHigh=0x%x MoveMethod=%x\n", hFile, lDistanceToMove, lpDistanceToMoveHigh, dwMoveMethod); - // if cached file ... - if(LastFile==hFile){ - int LastPos=Where; - if(!lpDistanceToMoveHigh){ - OutTrace("SetFilePointer: buffered move\n"); - switch(dwMoveMethod){ - case FILE_BEGIN: Where=lDistanceToMove; break; - case FILE_CURRENT: Where+=lDistanceToMove; break; - case FILE_END: Where=FileLength-lDistanceToMove; break; - } - //if(Where % LEGACY_SIZE){ - // Where=LastPos; - // SetLastError(ERROR_INVALID_PARAMETER); - // OutTrace("SetFilePointer: ret=INVALID_SET_FILE_POINTER pos=%d\n", Where); - // return INVALID_SET_FILE_POINTER; - //} - - // Where = ((Where + LEGACY_SIZE-1) / LEGACY_SIZE) * LEGACY_SIZE; - - Where = (Where / LEGACY_SIZE) * LEGACY_SIZE; - - OutTrace("SetFilePointer: ret=0x%x(#%d)\n", Where, Where); - return Where; - } - } - - // proxy - ret=(*pSetFilePointer)(hFile, lDistanceToMove, lpDistanceToMoveHigh, dwMoveMethod); - if(lpDistanceToMoveHigh){ - if(ret) - OutTrace("SetFilePointer: DistanceToMoveHigh=%x\n", *lpDistanceToMoveHigh); - else - OutTraceE("SetFilePointer ERROR: err=%d\n", GetLastError()); - } - else{ - if(ret==INVALID_SET_FILE_POINTER) - OutTraceE("SetFilePointer ERROR: err=%d\n", GetLastError()); - else - OutTrace("SetFilePointer: ret=%x\n", ret); - } - return ret; + return (*pSetFilePointer)(hFile, lDistanceToMove, lpDistanceToMoveHigh, dwMoveMethod); } BOOL WINAPI extCreateProcessA( @@ -723,36 +689,3 @@ BOOL WINAPI extCreateProcessA( OutTraceDW("CreateProcess: SUPPRESS ApplicationName=%s CommandLine=\"%s\"\n", lpApplicationName, lpCommandLine); return TRUE; } - -BOOL WINAPI extQueryPerformanceCounter(LARGE_INTEGER *lpPerformanceCount) -{ - BOOL ret; - LARGE_INTEGER myPerfCount; - if(dxw.dwFlags4 & NOPERFCOUNTER){ - ret=0; - myPerfCount.QuadPart = 0; - } - else{ - ret=(*pQueryPerformanceCounter)(&myPerfCount); - myPerfCount = dxw.StretchCounter(myPerfCount); - } - *lpPerformanceCount = myPerfCount; - OutTraceB("QueryPerformanceCounter: ret=%x Count=%x-%x\n", ret, lpPerformanceCount->HighPart, lpPerformanceCount->LowPart); - return ret; -} - -BOOL WINAPI extQueryPerformanceFrequency(LARGE_INTEGER *lpPerformanceFrequency) -{ - BOOL ret; - if(dxw.dwFlags4 & NOPERFCOUNTER){ - LARGE_INTEGER myPerfFrequency; - myPerfFrequency.LowPart = 0L; - myPerfFrequency.HighPart = 0L; - *lpPerformanceFrequency=myPerfFrequency; - ret = 0; - } - else - ret=(*pQueryPerformanceFrequency)(lpPerformanceFrequency); - OutTraceDW("QueryPerformanceFrequency: ret=%x Frequency=%x-%x\n", ret, lpPerformanceFrequency->HighPart, lpPerformanceFrequency->LowPart); - return ret; -} \ No newline at end of file diff --git a/dll/ole32.bad.cpp b/dll/ole32.bad.cpp deleted file mode 100644 index c8bdc64..0000000 --- a/dll/ole32.bad.cpp +++ /dev/null @@ -1,179 +0,0 @@ -#include -#include "dxwnd.h" -#include "dxwcore.hpp" -#include "syslibs.h" -#include "dxhook.h" -#include "dxhelper.h" - -extern void HookModule(HMODULE, int); - -static HookEntry_Type Hooks[]={ - {"CoCreateInstance", NULL, (FARPROC *)&pCoCreateInstance, (FARPROC)extCoCreateInstance}, - {"CoCreateInstanceEx", NULL, (FARPROC *)&pCoCreateInstanceEx, (FARPROC)extCoCreateInstanceEx}, - {"CoInitialize", NULL, (FARPROC *)&pCoInitialize, (FARPROC)extCoInitialize}, - {0, NULL, 0, 0} // terminator -}; - -extern HRESULT WINAPI extDirectDrawCreate(GUID FAR *, LPDIRECTDRAW FAR *, IUnknown FAR *); -extern HRESULT WINAPI extDirectDrawCreateEx(GUID FAR *, LPDIRECTDRAW FAR *, REFIID, IUnknown FAR *); - -void HookOle32(HMODULE module) -{ - HookLibrary(module, Hooks, "ole32.dll"); -} - -FARPROC Remap_ole32_ProcAddress(LPCSTR proc, HMODULE hModule) -{ - FARPROC addr; - if (addr=RemapLibrary(proc, hModule, Hooks)) return addr; - return NULL; -} - -// so far, there are 4 additional libraries that could be loaded by meand of a CoCreateInstance call.... - -#define ADDITIONAL_MODULE_COUNT 4 -struct { - BOOL Hooked; - char *ModuleName; -} AddedModules[ADDITIONAL_MODULE_COUNT]= -{ - {FALSE, "quartz"}, - {FALSE, "ddrawex"}, - {FALSE, "amstream"}, - {FALSE, "dplayx"} -}; - -static void HookAdditionalModules() -{ - for(int i=0; i%x\n", *ppv, *(DWORD *)*ppv); - - if (*(DWORD *)&rclsid==*(DWORD *)&CLSID_DirectDraw){ - OutTraceDW("CoCreateInstance: CLSID_DirectDraw object\n"); - switch (*(DWORD *)&riid){ - case 0x6C14DB80: - OutTraceDW("CoCreateInstance: IID_DirectDraw RIID lpdd=%x\n", *ppv); - HookDDSession((LPDIRECTDRAW *)ppv, 1); - break; - case 0xB3A6F3E0: - OutTraceDW("CoCreateInstance: IID_DirectDraw2 RIID lpdd=%x\n", *ppv); - HookDDSession((LPDIRECTDRAW *)ppv, 2); - break; - case 0x9c59509a: - OutTraceDW("CoCreateInstance: IID_DirectDraw4 RIID lpdd=%x\n", *ppv); - HookDDSession((LPDIRECTDRAW *)ppv, 4); - case 0x15e65ec0: - OutTraceDW("CoCreateInstance: IID_DirectDraw7 RIID lpdd=%x\n", *ppv); - HookDDSession((LPDIRECTDRAW *)ppv, 7); - break; - case 0xe436ebb3: - break; - } - } - else - if (*(DWORD *)&rclsid==*(DWORD *)&CLSID_DxDiagProvider) res=HookDxDiag(riid, ppv); - - HookAdditionalModules(); - return res; -} - -HRESULT STDAPICALLTYPE extCoCreateInstanceEx(REFCLSID rclsid, IUnknown *punkOuter, DWORD dwClsCtx, COSERVERINFO *pServerInfo, DWORD dwCount, MULTI_QI *pResults) -{ - HRESULT res; - DWORD i; - - OutTraceDW("CoCreateInstanceEx: rclsid=%x UnkOuter=%x ClsContext=%x Count=%d\n", - rclsid, punkOuter, dwClsCtx, dwCount); - - res=(*pCoCreateInstanceEx)(rclsid, punkOuter, dwClsCtx, pServerInfo, dwCount, pResults); - if(res) { - OutTraceE("CoCreateInstanceEx: ERROR res=%x\n", res); - return res; - } - - for(i=0; i -#include "dxwnd.h" -#include "dxwcore.hpp" -#include "syslibs.h" -#include "dxhook.h" -#include "dxhelper.h" - -extern void HookModule(HMODULE, int); - -static HookEntry_Type Hooks[]={ - {"CoCreateInstance", NULL, (FARPROC *)&pCoCreateInstance, (FARPROC)extCoCreateInstance}, - {"CoCreateInstanceEx", NULL, (FARPROC *)&pCoCreateInstanceEx, (FARPROC)extCoCreateInstanceEx}, - {"CoInitialize", NULL, (FARPROC *)&pCoInitialize, (FARPROC)extCoInitialize}, - {0, NULL, 0, 0} // terminator -}; - -extern HRESULT WINAPI extDirectDrawCreate(GUID FAR *, LPDIRECTDRAW FAR *, IUnknown FAR *); -extern HRESULT WINAPI extDirectDrawCreateEx(GUID FAR *, LPDIRECTDRAW FAR *, REFIID, IUnknown FAR *); - -void HookOle32(HMODULE module) -{ - HookLibrary(module, Hooks, "ole32.dll"); -} - -FARPROC Remap_ole32_ProcAddress(LPCSTR proc, HMODULE hModule) -{ - FARPROC addr; - if (addr=RemapLibrary(proc, hModule, Hooks)) return addr; - return NULL; -} - -// so far, there are 4 additional libraries that could be loaded by meand of a CoCreateInstance call.... - -#define ADDITIONAL_MODULE_COUNT 4 -struct { - BOOL Hooked; - char *ModuleName; -} AddedModules[ADDITIONAL_MODULE_COUNT]= -{ - {FALSE, "quartz"}, - {FALSE, "ddrawex"}, - {FALSE, "amstream"}, - {FALSE, "dplayx"} -}; - -static void HookAdditionalModules() -{ - for(int i=0; i%x\n", *ppv, *(DWORD *)*ppv); - - if (*(DWORD *)&rclsid==*(DWORD *)&CLSID_DirectDraw){ - LPDIRECTDRAW lpOldDDraw; - OutTraceDW("CoCreateInstance: CLSID_DirectDraw object\n"); - switch (*(DWORD *)&riid){ - case 0x6C14DB80: - OutTraceDW("DirectDrawCreate: IID_DirectDraw RIID\n"); - res=extDirectDrawCreate(NULL, (LPDIRECTDRAW *)&ppv, 0); - if(res)OutTraceDW("DirectDrawCreate: res=%x(%s)\n", res, ExplainDDError(res)); - break; - case 0xB3A6F3E0: - OutTraceDW("DirectDrawCreate: IID_DirectDraw2 RIID\n"); - res=extDirectDrawCreate(NULL, &lpOldDDraw, 0); - if(res)OutTraceDW("DirectDrawCreate: res=%x(%s)\n", res, ExplainDDError(res)); - res=lpOldDDraw->QueryInterface(IID_IDirectDraw2, (LPVOID *)&ppv); - if(res)OutTraceDW("QueryInterface: res=%x(%s)\n", res, ExplainDDError(res)); - lpOldDDraw->Release(); - break; - case 0x9c59509a: - OutTraceDW("DirectDrawCreate: IID_DirectDraw4 RIID\n"); - res=extDirectDrawCreate(NULL, &lpOldDDraw, 0); - if(res)OutTraceDW("DirectDrawCreate: res=%x(%s)\n", res, ExplainDDError(res)); - res=lpOldDDraw->QueryInterface(IID_IDirectDraw4, (LPVOID *)&ppv); - if(res)OutTraceDW("QueryInterface: res=%x(%s)\n", res, ExplainDDError(res)); - lpOldDDraw->Release(); - case 0x15e65ec0: - OutTraceDW("CoCreateInstance: IID_DirectDraw7 RIID\n"); - res=extDirectDrawCreateEx(NULL, (LPDIRECTDRAW *)&ppv, IID_IDirectDraw7, 0); - if(res)OutTraceDW("DirectDrawCreateEx: res=%x(%s)\n", res, ExplainDDError(res)); - break; - case 0xe436ebb3: - break; - } - } - else - if (*(DWORD *)&rclsid==*(DWORD *)&CLSID_DxDiagProvider) res=HookDxDiag(riid, ppv); - - HookAdditionalModules(); - return res; -} - -HRESULT STDAPICALLTYPE extCoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID riid, LPVOID FAR* ppv) -{ - HRESULT res; - OutTraceDW("CoCreateInstance: rclsid=%x UnkOuter=%x ClsContext=%x refiid=%x(%s)\n", - rclsid, pUnkOuter, dwClsContext, riid.Data1, ExplainGUID((GUID *)&riid)); - - res=(*pCoCreateInstance)(rclsid, pUnkOuter, dwClsContext, riid, ppv); - if(res) - OutTraceE("CoCreateInstance: ERROR res=%x\n", res); - else - OutTraceDW("CoCreateInstance: ppv=%x->%x\n", *ppv, *(DWORD *)*ppv); - - if (*(DWORD *)&rclsid==*(DWORD *)&CLSID_DirectDraw){ - OutTraceDW("CoCreateInstance: CLSID_DirectDraw object\n"); - switch (*(DWORD *)&riid){ - case 0x6C14DB80: - OutTraceDW("CoCreateInstance: IID_DirectDraw RIID lpdd=%x\n", *ppv); - HookDDSession((LPDIRECTDRAW *)ppv, 1); - break; - case 0xB3A6F3E0: - OutTraceDW("CoCreateInstance: IID_DirectDraw2 RIID lpdd=%x\n", *ppv); - HookDDSession((LPDIRECTDRAW *)ppv, 2); - break; - case 0x9c59509a: - OutTraceDW("CoCreateInstance: IID_DirectDraw4 RIID lpdd=%x\n", *ppv); - HookDDSession((LPDIRECTDRAW *)ppv, 4); - case 0x15e65ec0: - OutTraceDW("CoCreateInstance: IID_DirectDraw7 RIID lpdd=%x\n", *ppv); - HookDDSession((LPDIRECTDRAW *)ppv, 7); - break; - case 0xe436ebb3: - break; - } - } - else - if (*(DWORD *)&rclsid==*(DWORD *)&CLSID_DxDiagProvider) res=HookDxDiag(riid, ppv); - - HookAdditionalModules(); - return res; -} - -HRESULT STDAPICALLTYPE extCoCreateInstanceEx(REFCLSID rclsid, IUnknown *punkOuter, DWORD dwClsCtx, COSERVERINFO *pServerInfo, DWORD dwCount, MULTI_QI *pResults) -{ - HRESULT res; - DWORD i; - - OutTraceDW("CoCreateInstanceEx: rclsid=%x UnkOuter=%x ClsContext=%x Count=%d\n", - rclsid, punkOuter, dwClsCtx, dwCount); - - res=(*pCoCreateInstanceEx)(rclsid, punkOuter, dwClsCtx, pServerInfo, dwCount, pResults); - if(res) { - OutTraceE("CoCreateInstanceEx: ERROR res=%x\n", res); - return res; - } - - for(i=0; ix, wp->y, wp->cx, wp->cy, wp->flags, ExplainWPFlags(wp->flags)); if (dxw.dwFlags1 & PREVENTMAXIMIZE){ int UpdFlag = 0; + WINDOWPOS MaxPos; + CalculateWindowPos(hwnd, MaxX, MaxY, &MaxPos); - if(wp->cx>MaxX) { wp->cx=MaxX; UpdFlag=1; } - if(wp->cy>MaxY) { wp->cy=MaxY; UpdFlag=1; } + if(wp->cx>MaxPos.cx) { wp->cx=MaxPos.cx; UpdFlag=1; } + if(wp->cy>MaxPos.cy) { wp->cy=MaxPos.cy; UpdFlag=1; } if (UpdFlag) OutTraceDW("%s: SET max dim=(%d,%d)\n", ApiName, wp->cx, wp->cy); } @@ -296,7 +324,6 @@ void dxwFixWindowPos(char *ApiName, HWND hwnd, LPARAM lParam) if ((wp->flags & (SWP_NOMOVE|SWP_NOSIZE))==(SWP_NOMOVE|SWP_NOSIZE)) return; //v2.02.13 if ((dxw.dwFlags1 & LOCKWINPOS) && dxw.IsFullScreen() && (hwnd==dxw.GethWnd())){ - extern void CalculateWindowPos(HWND, DWORD, DWORD, LPWINDOWPOS); CalculateWindowPos(hwnd, MaxX, MaxY, wp); OutTraceDW("%s: LOCK pos=(%d,%d) dim=(%d,%d)\n", ApiName, wp->x, wp->y, wp->cx, wp->cy); } @@ -360,9 +387,15 @@ void dxwFixMinMaxInfo(char *ApiName, HWND hwnd, LPARAM lParam) lpmmi->ptMaxSize.x = dxw.GetScreenWidth(); lpmmi->ptMaxSize.y = dxw.GetScreenHeight(); } + + // allow for initial dimensions .... + //if(lpmmi->ptMaxSize.x < dxw.iSizX) lpmmi->ptMaxSize.x = dxw.iSizX; + //if(lpmmi->ptMaxSize.y < dxw.iSizY) lpmmi->ptMaxSize.y = dxw.iSizY; + OutTraceDW("%s: SET PREVENTMAXIMIZE MaxPosition=(%d,%d) MaxSize=(%d,%d)\n", ApiName, lpmmi->ptMaxPosition.x, lpmmi->ptMaxPosition.y, lpmmi->ptMaxSize.x, lpmmi->ptMaxSize.y); } + // v2.1.75: added logic to fix win coordinates to selected ones. // fixes the problem with "Achtung Spitfire", that can't be managed through PREVENTMAXIMIZE flag. if (dxw.dwFlags1 & LOCKWINPOS){ @@ -424,37 +457,6 @@ static LRESULT WINAPI FixWindowProc(char *ApiName, HWND hwnd, UINT Msg, WPARAM w return(-1); } -static POINT 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; - if (rect.bottom) curr.y = (curr.y * dxw.GetScreenHeight()) / rect.bottom; - - return curr; -} - // -------------------------------------------------------------------------- // // user32 API hookers @@ -471,8 +473,6 @@ BOOL WINAPI extInvalidateRect(HWND hwnd, RECT *lpRect, BOOL bErase) OutTraceDW("InvalidateRect: hwnd=%x rect=NULL erase=%x\n", hwnd, bErase); - //if(dxw.dwFlags3 & GDIEMULATEDC) return TRUE; - if(dxw.IsFullScreen() && dxw.IsRealDesktop(hwnd)) { hwnd=dxw.GethWnd(); dxw.MapClient(lpRect); @@ -646,7 +646,8 @@ BOOL WINAPI extSetWindowPos(HWND hwnd, HWND hWndInsertAfter, int X, int Y, int c rect.right=cx; rect.bottom=cy; dwCurStyle=(*pGetWindowLong)(hwnd, GWL_STYLE); dwExStyle=(*pGetWindowLong)(hwnd, GWL_EXSTYLE); - hMenu = GetMenu(hwnd); + // BEWARE: from MSDN - If the window is a child window, the return value is undefined. + hMenu = (dwCurStyle & WS_CHILD) ? NULL : GetMenu(hwnd); AdjustWindowRectEx(&rect, dwCurStyle, (hMenu!=NULL), dwExStyle); if (hMenu) CloseHandle(hMenu); cx=rect.right; cy=rect.bottom; @@ -1057,8 +1058,6 @@ static HWND WINAPI extCreateWindowCommon( if (dxw.dwFlags1 & PREVENTMAXIMIZE){ OutTraceDW("%s: handling PREVENTMAXIMIZE mode\n", ApiName); dwStyle &= ~WS_MAXIMIZE; - //dwStyle &= ~(WS_MAXIMIZE | WS_POPUP); - //dwExStyle &= ~WS_EX_TOPMOST; } // v2.1.92: fixes size & position for auxiliary big window, often used @@ -1074,7 +1073,7 @@ static HWND WINAPI extCreateWindowCommon( ((x<=0)&&(y<=0)) || ((x==CW_USEDEFAULT)&&(y==CW_USEDEFAULT)) ) && - ((nWidth>=(int)dxw.GetScreenWidth())&&(nHeight>=(int)dxw.GetScreenHeight())) + ((nWidth>=(int)dxw.GetScreenWidth())&&(nHeight>=(int)dxw.GetScreenHeight())) && !(dwExStyle & WS_EX_CONTROLPARENT) // Diablo fix && @@ -1123,7 +1122,7 @@ static HWND WINAPI extCreateWindowCommon( dxw.SetFullScreen(TRUE); if(dxw.Coordinates==DXW_DESKTOP_WORKAREA){ RECT workarea; - SystemParametersInfo(SPI_GETWORKAREA, NULL, &workarea, 0); + (*pSystemParametersInfoA)(SPI_GETWORKAREA, NULL, &workarea, 0); x=0; y=0; nWidth=workarea.right; @@ -1197,10 +1196,12 @@ static HWND WINAPI extCreateWindowCommon( if ((dwStyle & WS_CHILD) && (dxw.dwFlags1 & HOOKCHILDWIN)){ long res; pWindowProc = (WNDPROC)(*pGetWindowLong)(wndh, GWL_WNDPROC); - OutTraceDW("Hooking CHILD wndh=%x WindowProc %x->%x\n", wndh, pWindowProc, extChildWindowProc); - res=(*pSetWindowLong)(wndh, GWL_WNDPROC, (LONG)extChildWindowProc); - WhndStackPush(wndh, pWindowProc); - if(!res) OutTraceE("%s: SetWindowLong ERROR %x\n", ApiName, GetLastError()); + if((pWindowProc != extWindowProc) && (pWindowProc != extChildWindowProc)){ // avoid recursions + OutTraceDW("Hooking CHILD wndh=%x WindowProc %x->%x\n", wndh, pWindowProc, extChildWindowProc); + res=(*pSetWindowLong)(wndh, GWL_WNDPROC, (LONG)extChildWindowProc); + WhndStackPush(wndh, pWindowProc); + if(!res) OutTraceE("%s: SetWindowLong ERROR %x\n", ApiName, GetLastError()); + } } OutTraceDW("%s: ret=%x\n", ApiName, wndh); @@ -1234,13 +1235,17 @@ HWND WINAPI extCreateWindowExW( LPVOID lpParam) { if(IsTraceDW){ - char xString[20], yString[20]; + char xString[20], yString[20], wString[20], hString[20]; if (x==CW_USEDEFAULT) strcpy(xString,"CW_USEDEFAULT"); else sprintf(xString,"%d", x); if (y==CW_USEDEFAULT) strcpy(yString,"CW_USEDEFAULT"); else sprintf(yString,"%d", y); - OutTrace("CreateWindowExW: class=\"%ls\" wname=\"%ls\" pos=(%s,%s) size=(%d,%d) Style=%x(%s) ExStyle=%x(%s)\n", - lpClassName, lpWindowName, xString, yString, nWidth, nHeight, + if (nWidth==CW_USEDEFAULT) strcpy(wString,"CW_USEDEFAULT"); + else sprintf(wString,"%d", nWidth); + if (nHeight==CW_USEDEFAULT) strcpy(hString,"CW_USEDEFAULT"); + else sprintf(hString,"%d", nHeight); + OutTrace("CreateWindowExW: class=\"%ls\" wname=\"%ls\" pos=(%s,%s) size=(%s,%s) Style=%x(%s) ExStyle=%x(%s)\n", + lpClassName, lpWindowName, xString, yString, wString, hString, dwStyle, ExplainStyle(dwStyle), dwExStyle, ExplainExStyle(dwExStyle)); } if(IsDebug) OutTrace("CreateWindowExW: DEBUG screen=(%d,%d)\n", dxw.GetScreenWidth(), dxw.GetScreenHeight()); @@ -1264,13 +1269,17 @@ HWND WINAPI extCreateWindowExA( LPVOID lpParam) { if(IsTraceDW){ - char xString[20], yString[20]; + char xString[20], yString[20], wString[20], hString[20]; if (x==CW_USEDEFAULT) strcpy(xString,"CW_USEDEFAULT"); else sprintf(xString,"%d", x); if (y==CW_USEDEFAULT) strcpy(yString,"CW_USEDEFAULT"); else sprintf(yString,"%d", y); - OutTrace("CreateWindowExA: class=\"%s\" wname=\"%s\" pos=(%s,%s) size=(%d,%d) Style=%x(%s) ExStyle=%x(%s)\n", - ClassToStr(lpClassName), lpWindowName, xString, yString, nWidth, nHeight, + if (nWidth==CW_USEDEFAULT) strcpy(wString,"CW_USEDEFAULT"); + else sprintf(wString,"%d", nWidth); + if (nHeight==CW_USEDEFAULT) strcpy(hString,"CW_USEDEFAULT"); + else sprintf(hString,"%d", nHeight); + OutTrace("CreateWindowExA: class=\"%s\" wname=\"%s\" pos=(%s,%s) size=(%s,%s) Style=%x(%s) ExStyle=%x(%s)\n", + ClassToStr(lpClassName), lpWindowName, xString, yString, wString, hString, dwStyle, ExplainStyle(dwStyle), dwExStyle, ExplainExStyle(dwExStyle)); } if(IsDebug) OutTrace("CreateWindowExA: DEBUG screen=(%d,%d)\n", dxw.GetScreenWidth(), dxw.GetScreenHeight()); @@ -1562,9 +1571,10 @@ HDC WINAPI extGDIGetDC(HWND hwnd) ret=(*pGDIGetDC)(lochwnd); - if((dxw.dwFlags3 & GDIEMULATEDC) && (dxw.IsDesktop(hwnd))){ + if((dxw.dwFlags3 & GDIEMULATEDC) && (dxw.IsDesktop(hwnd)) && (dxw.VirtualHDC==NULL)){ ret=dxw.AcquireEmulatedDC(lochwnd); OutTraceDW("GDI.GetDC(GDIEMULATEDC): remapping hdc=%x->%x\n", (*pGDIGetDC)(hwnd), ret); + dxw.VirtualHDC=ret; } if(ret){ @@ -1664,7 +1674,7 @@ int WINAPI extGDIReleaseDC(HWND hwnd, HDC hDC) OutTraceDW("GDI.ReleaseDC: hwnd=%x hdc=%x\n", hwnd, hDC); if (dxw.IsRealDesktop(hwnd)) hwnd=dxw.GethWnd(); - if(dxw.dwFlags3 & GDIEMULATEDC) + if((dxw.dwFlags3 & GDIEMULATEDC) && (hDC == dxw.VirtualHDC)) // v2.02.53 !!!!! res=dxw.ReleaseEmulatedDC(hwnd); else res=(*pGDIReleaseDC)(hwnd, hDC); @@ -1673,41 +1683,17 @@ int WINAPI extGDIReleaseDC(HWND hwnd, HDC hDC) return(res); } -HDC EmuHDC; - HDC WINAPI extBeginPaint(HWND hwnd, LPPAINTSTRUCT lpPaint) { HDC hdc; extern HRESULT WINAPI extGetDC(LPDIRECTDRAWSURFACE, HDC FAR *); - // proxy part ... OutTraceDW("GDI.BeginPaint: hwnd=%x lpPaint=%x FullScreen=%x\n", hwnd, lpPaint, dxw.IsFullScreen()); hdc=(*pBeginPaint)(hwnd, lpPaint); // if not in fullscreen mode, that's all! if(!dxw.IsFullScreen()) return hdc; - if((dxw.dwFlags3 & GDIEMULATEDC) && dxw.IsFullScreen() && dxw.IsDesktop(hwnd)) { - EmuHDC = dxw.AcquireEmulatedDC(hwnd); - OutTraceDW("GDI.BeginPaint(GDIEMULATEDC): hdc=%x emulated hdc=%x\n", hdc, EmuHDC); - hdc=EmuHDC; - lpPaint->hdc=EmuHDC; - dxw.MapClient(&lpPaint->rcPaint); - return hdc; - } - - // on MAPGDITOPRIMARY, return the PrimHDC handle instead of the window DC - if(dxw.dwFlags1 & MAPGDITOPRIMARY) { - if(pGetDC && dxw.lpDDSPrimHDC){ - extGetDC(dxw.lpDDSPrimHDC,&PrimHDC); - OutTraceDW("GDI.BeginPaint(MAPGDITOPRIMARY): redirect hdc=%x -> PrimHDC=%x\n", hdc, PrimHDC); - hdc=PrimHDC; - } - else { - OutTraceDW("GDI.BeginPaint(MAPGDITOPRIMARY): hdc=%x\n", hdc); - } - } - // on CLIENTREMAPPING, resize the paint area to virtual screen size if(dxw.dwFlags1 & CLIENTREMAPPING){ lpPaint->rcPaint.top=0; @@ -1716,14 +1702,76 @@ HDC WINAPI extBeginPaint(HWND hwnd, LPPAINTSTRUCT lpPaint) lpPaint->rcPaint.bottom=dxw.GetScreenHeight(); } + if(!dxw.IsDesktop(hwnd)) return hdc; + + if(dxw.dwFlags3 & GDIEMULATEDC) { + HDC EmuHDC; + EmuHDC = dxw.AcquireEmulatedDC(hwnd); + lpPaint->hdc=EmuHDC; + dxw.MapClient(&lpPaint->rcPaint); + OutTraceDW("GDI.BeginPaint(GDIEMULATEDC): hdc=%x -> %x\n", hdc, EmuHDC); + return EmuHDC; + } + OutTraceDW("GDI.BeginPaint: hdc=%x\n", hdc); return hdc; } +HDC WINAPI extDDBeginPaint(HWND hwnd, LPPAINTSTRUCT lpPaint) +{ + HDC hdc; + extern HRESULT WINAPI extGetDC(LPDIRECTDRAWSURFACE, HDC FAR *); + + OutTraceDW("GDI.BeginPaint: hwnd=%x lpPaint=%x FullScreen=%x\n", hwnd, lpPaint, dxw.IsFullScreen()); + hdc=(*pBeginPaint)(hwnd, lpPaint); + + // if not in fullscreen mode, that's all! + if(!dxw.IsFullScreen()) return hdc; + + // on CLIENTREMAPPING, resize the paint area to virtual screen size + if(dxw.dwFlags1 & CLIENTREMAPPING){ + lpPaint->rcPaint.top=0; + lpPaint->rcPaint.left=0; + lpPaint->rcPaint.right=dxw.GetScreenWidth(); + lpPaint->rcPaint.bottom=dxw.GetScreenHeight(); + } + + if(!dxw.IsDesktop(hwnd)) return hdc; + + // on MAPGDITOPRIMARY, return the PrimHDC handle instead of the window DC + // if a primary surface has not been created yet, do it + if(!pGetDC || !dxw.lpDDSPrimHDC){ + extern HRESULT WINAPI extDirectDrawCreate(GUID FAR *, LPDIRECTDRAW FAR *, IUnknown FAR *); + HRESULT res; + LPDIRECTDRAW lpDD; + LPDIRECTDRAWSURFACE lpDDS; + DDSURFACEDESC ddsd; + res=extDirectDrawCreate(0, &lpDD, NULL); + //lpDD->SetDisplayMode(dxw.GetScreenWidth(), dxw.GetScreenHeight(), NULL); + lpDD->SetCooperativeLevel(hwnd, DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE); + memset((void *)&ddsd, 0, sizeof(DDSURFACEDESC)); + ddsd.dwSize = sizeof(DDSURFACEDESC); + ddsd.dwFlags = DDSD_CAPS|DDSD_HEIGHT|DDSD_WIDTH; + ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; + ddsd.dwHeight = dxw.GetScreenHeight(); + ddsd.dwWidth = dxw.GetScreenWidth(); + res=lpDD->CreateSurface(&ddsd, &lpDDS, NULL); + dxw.lpDDSPrimHDC = lpDDS; + OutTraceDW("GDI.BeginPaint(MAPGDITOPRIMARY): dd=%x ddsPrim=%x\n", lpDD, lpDDS); + } + extGetDC(dxw.lpDDSPrimHDC,&PrimHDC); + lpPaint->hdc=PrimHDC; + //dxw.MapClient(&lpPaint->rcPaint); + OutTraceDW("GDI.BeginPaint(MAPGDITOPRIMARY): hdc=%x -> %x\n", hdc, PrimHDC); + return PrimHDC; +} + BOOL WINAPI extEndPaint(HWND hwnd, const PAINTSTRUCT *lpPaint) { BOOL ret; - HRESULT WINAPI extReleaseDC(LPDIRECTDRAWSURFACE lpdds, HDC FAR hdc); + extern HRESULT WINAPI extReleaseDC(LPDIRECTDRAWSURFACE lpdds, HDC FAR hdc); + extern HRESULT WINAPI extGetDC(LPDIRECTDRAWSURFACE, HDC FAR *); + extern HRESULT WINAPI extBlt(LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect, LPDIRECTDRAWSURFACE lpddssrc, LPRECT lpsrcrect, DWORD dwflags, LPDDBLTFX lpddbltfx); OutTraceDW("GDI.EndPaint: hwnd=%x lpPaint=%x lpPaint.hdc=%x\n", hwnd, lpPaint, lpPaint->hdc); @@ -1735,6 +1783,15 @@ BOOL WINAPI extEndPaint(HWND hwnd, const PAINTSTRUCT *lpPaint) return ret; } + // v2.02.53 ... + if((dxw.dwFlags1 & MAPGDITOPRIMARY) && dxw.IsFullScreen() && dxw.IsDesktop(hwnd)){ + ret=(*pEndPaint)(hwnd, lpPaint); + dxw.lpDDSPrimHDC->Unlock(NULL); + //dxw.ScreenRefresh(); + extBlt(dxw.lpDDSPrimHDC, NULL, dxw.lpDDSPrimHDC, NULL, 0, NULL); + return TRUE; + } + // proxy part ... ret=(*pEndPaint)(hwnd, lpPaint); OutTraceDW("GDI.EndPaint: hwnd=%x ret=%x\n", hwnd, ret); @@ -1748,6 +1805,7 @@ BOOL WINAPI extEndPaint(HWND hwnd, const PAINTSTRUCT *lpPaint) // v2.02.09: on MAPGDITOPRIMARY, release the PrimHDC handle if(dxw.dwFlags1 & MAPGDITOPRIMARY) { if(pReleaseDC && dxw.lpDDSPrimHDC){ + extGetDC(dxw.lpDDSPrimHDC,&PrimHDC); extReleaseDC(dxw.lpDDSPrimHDC, PrimHDC); OutTraceDW("GDI.EndPaint: released hdc=%x\n", PrimHDC); } @@ -1756,6 +1814,31 @@ BOOL WINAPI extEndPaint(HWND hwnd, const PAINTSTRUCT *lpPaint) return ret; } +BOOL WINAPI extDDEndPaint(HWND hwnd, const PAINTSTRUCT *lpPaint) +{ + BOOL ret; + extern HRESULT WINAPI extReleaseDC(LPDIRECTDRAWSURFACE lpdds, HDC FAR hdc); + extern HRESULT WINAPI extGetDC(LPDIRECTDRAWSURFACE, HDC FAR *); + extern HRESULT WINAPI extBlt(LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect, LPDIRECTDRAWSURFACE lpddssrc, LPRECT lpsrcrect, DWORD dwflags, LPDDBLTFX lpddbltfx); + + OutTraceDW("GDI.EndPaint: hwnd=%x lpPaint=%x lpPaint.hdc=%x\n", hwnd, lpPaint, lpPaint->hdc); + + // v2.02.53 ... + if(dxw.IsFullScreen() && dxw.IsDesktop(hwnd)){ + ret=(*pEndPaint)(hwnd, lpPaint); + dxw.lpDDSPrimHDC->Unlock(NULL); + //dxw.ScreenRefresh(); + extBlt(dxw.lpDDSPrimHDC, NULL, dxw.lpDDSPrimHDC, NULL, 0, NULL); + return TRUE; + } + + // proxy part ... + ret=(*pEndPaint)(hwnd, lpPaint); + OutTraceDW("GDI.EndPaint: hwnd=%x ret=%x\n", hwnd, ret); + if(!ret) OutTraceE("GDI.EndPaint ERROR: err=%d at %d\n", GetLastError(), __LINE__); + return ret; +} + HWND WINAPI extCreateDialogIndirectParam(HINSTANCE hInstance, LPCDLGTEMPLATE lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM lParamInit) { HWND RetHWND; @@ -2073,10 +2156,53 @@ BOOL WINAPI extIsWindowVisible(HWND hwnd) { BOOL ret; ret=(*pIsWindowVisible)(hwnd); - OutTraceDW("IsWindowVisible: hwnd=%x ret=%x\n", hwnd, ret); - if(dxw.IsDesktop(hwnd)){ + OutTraceB("IsWindowVisible: hwnd=%x ret=%x\n", hwnd, ret); + if(dxw.IsDesktop(hwnd) && !ret){ OutTraceDW("IsWindowVisible: FORCING ret=TRUE\n"); ret=TRUE; } return ret; } + +BOOL WINAPI extSystemParametersInfoA(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni) +{ + BOOL ret; + OutTraceDW("SystemParametersInfo: Action=%x Param=%x WinIni=%x\n", uiAction, uiParam, fWinIni); + ret=(*pSystemParametersInfoA)(uiAction, uiParam, pvParam, fWinIni); + if(uiAction==SPI_GETWORKAREA){ + LPRECT cli = (LPRECT)pvParam; + cli->top = 0; + cli->left = 0; + cli->bottom = dxw.GetScreenHeight(); + cli->right = dxw.GetScreenWidth(); + OutTraceDW("SystemParametersInfo: resized client workarea rect=(%d,%d)-(%d,%d)\n", cli->left, cli->top, cli->right, cli->bottom); + } + return ret; +} + +#undef OutTraceDW +#define OutTraceDW OutTrace + +UINT_PTR WINAPI extSetTimer(HWND hWnd, UINT_PTR nIDEvent, UINT uElapse, TIMERPROC lpTimerFunc) +{ + UINT uShiftedElapse; + UINT_PTR ret; + // beware: the quicker the time flows, the more the time clicks are incremented, + // and the lesser the pauses must be lasting! Shift operations are reverted in + // GetSystemTime vs. Sleep or SetTimer + uShiftedElapse = dxw.StretchTime(uElapse); + OutTraceDW("SetTimer: hwnd=%x TimerFunc=%x elapse=%d->%d timeshift=%d\n", hWnd, lpTimerFunc, uElapse, uShiftedElapse, dxw.TimeShift); + ret = (*pSetTimer)(hWnd, nIDEvent, uShiftedElapse, lpTimerFunc); + if(ret) dxw.PushTimer(hWnd, ret, uElapse, lpTimerFunc); + OutTraceDW("SetTimer: IDEvent=%x ret=%x\n", nIDEvent, ret); + return ret; +} + +BOOL WINAPI extKillTimer(HWND hWnd, UINT_PTR uIDEvent) +{ + BOOL ret; + OutTraceDW("KillTimer: hwnd=%x IDEvent=%x\n", hWnd, uIDEvent); + ret = (*pKillTimer)(hWnd, uIDEvent); + OutTraceDW("KillTimer: ret=%x\n", ret); + return ret; +} diff --git a/host/dxwndhost.vs2008.suo b/host/dxwndhost.vs2008.suo index ec505eb..81d3939 100644 Binary files a/host/dxwndhost.vs2008.suo and b/host/dxwndhost.vs2008.suo differ