diff --git a/Include/dxwnd.h b/Include/dxwnd.h index 6c84583..e2270d4 100644 --- a/Include/dxwnd.h +++ b/Include/dxwnd.h @@ -61,6 +61,10 @@ #define SHOWFPS 0x00004000 // shows FPS value to status win / log #define HIDEMULTIMONITOR 0x00008000 // hide multimonitor configurations: GetAdapterCount returns 1. #define TIMESTRETCH 0x00010000 // make system time stretchable +#define HOOKOPENGL 0x00020000 // Hook OpenGL calls +#define WALLPAPERMODE 0x00040000 // mouse events are discarded (good for screensaver-like) +#define SHOWHWCURSOR 0x00080000 // mouse events are discarded (good for screensaver-like) +#define HOOKGDI 0x00100000 // Hook GDI functions // logging Tflags DWORD: #define OUTTRACE 0x00000001 // enables tracing to dxwnd.log in general @@ -80,6 +84,7 @@ typedef struct TARGETMAP { char path[MAX_PATH]; char module[60+1]; + char OpenGLLib[20+1]; int dxversion; int flags; int flags2; @@ -95,6 +100,7 @@ typedef struct TARGETMAP short sizx; short sizy; short MaxFPS; + short InitTS; }TARGETMAP; typedef struct @@ -109,6 +115,7 @@ typedef struct DWORD dwPid; BOOL isLogging; DWORD FPSCount; + int iTimeShift; } DXWNDSTATUS; extern DXWNDSTATUS DxWndStatus; @@ -119,12 +126,13 @@ int EndHook(void); void GetDllVersion(char *); int GetHookStatus(DXWNDSTATUS *); void SetHookStatus(DXWNDSTATUS *); +int GetTimeShift(); int HookInit(TARGETMAP *, HWND); void *SetHook(void *, void *); void SetHook(void *, void *, void **, char *); void OutTrace(const char *, ...); -void *HookAPI(const char *, void *, const char *, void *); +void *HookAPI(const char *, char *, void *, const char *, void *); void AdjustWindowFrame(HWND, DWORD, DWORD); LRESULT CALLBACK extWindowProc(HWND, UINT, WPARAM, LPARAM); diff --git a/build/dxwnd.dll b/build/dxwnd.dll index 0ac9a44..1f0d515 100644 --- a/build/dxwnd.dll +++ b/build/dxwnd.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f9c184ea18b592accf84a23876799143c8e5c16761512624d25c595298e34470 -size 260608 +oid sha256:df99818897624e2426ed40251d25c8c8f8a50e5174746aed2c5c1be3dbfcd4a4 +size 262144 diff --git a/build/dxwnd.exe b/build/dxwnd.exe index dd705f6..140ea66 100644 --- a/build/dxwnd.exe +++ b/build/dxwnd.exe @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f3ff1ef480c67937ed3848ce26c7612704b0017f3c49fd597915d2273bfff76f -size 484352 +oid sha256:63d93b8775f8106a4ed846e49768c1ff2203c049656866b84a8f046d1c9864d9 +size 488448 diff --git a/build/dxwnd.ini b/build/dxwnd.ini deleted file mode 100644 index 63ad082..0000000 --- a/build/dxwnd.ini +++ /dev/null @@ -1,3402 +0,0 @@ -[target] -title0=1602 A.D. -path0=C:\Games\1602 A.D\1602.exe -module0= -ver0=0 -flag0=679608354 -flagg0=0 -tflag0=0 -initx0=0 -inity0=0 -minx0=0 -miny0=0 -maxx0=0 -maxy0=0 -posx0=50 -posy0=50 -sizx0=800 -sizy0=600 -title1=7th Legion -path1=D:\Games\7th_Legion\LEGION.EXE -module1= -ver1=0 -flag1=402669607 -flagg1=2064 -tflag1=13 -initx1=0 -inity1=0 -minx1=0 -miny1=0 -maxx1=0 -maxy1=0 -posx1=50 -posy1=50 -sizx1=800 -sizy1=600 -title2=A10 Cuba -path2=D:\Games\A10\A10Cuba.exe -module2= -ver2=0 -flag2=34 -flagg2=0 -tflag2=0 -initx2=0 -inity2=0 -minx2=0 -miny2=0 -maxx2=0 -maxy2=0 -posx2=50 -posy2=50 -sizx2=800 -sizy2=600 -title3=Achtung Spitfire -path3=C:\Games\Achtung Spitfire\ASP95.EXE -module3= -ver3=0 -flag3=536870946 -flagg3=0 -tflag3=70 -initx3=0 -inity3=0 -minx3=0 -miny3=0 -maxx3=0 -maxy3=0 -posx3=50 -posy3=50 -sizx3=800 -sizy3=600 -title4=Actua Soccer 3 -path4=C:\Games\ActuaSoccer3\ActuaSoccer3\Soccer3.exe -module4= -ver4=0 -flag4=671088928 -flagg4=256 -tflag4=0 -initx4=0 -inity4=0 -minx4=0 -miny4=0 -maxx4=0 -maxy4=0 -posx4=50 -posy4=50 -sizx4=800 -sizy4=600 -title5=AfterLife -path5=d:\Games\ALIFE\ALIFE.EXE -module5= -ver5=1 -flag5=134217762 -flagg5=32 -tflag5=3 -initx5=0 -inity5=0 -minx5=0 -miny5=0 -maxx5=0 -maxy5=0 -posx5=50 -posy5=50 -sizx5=800 -sizy5=600 -title6=Age of Empires -path6=D:\Games\Age of Empires\EMPIRES.EXE -module6= -ver6=0 -flag6=268436006 -flagg6=16 -tflag6=3 -initx6=0 -inity6=0 -minx6=0 -miny6=0 -maxx6=0 -maxy6=0 -posx6=50 -posy6=50 -sizx6=800 -sizy6=600 -title7=Airline Tycoon Evolution -path7=C:\Games\Airline.Tycoon.Evolution.UV.Carlows\AT.EXE -module7= -ver7=0 -flag7=32 -flagg7=0 -tflag7=2 -initx7=0 -inity7=0 -minx7=0 -miny7=0 -maxx7=0 -maxy7=0 -posx7=50 -posy7=50 -sizx7=800 -sizy7=600 -title8=Alien Cabal 95 -path8=C:\Games\Alien_cabal\ACabal95.exe -module8= -ver8=0 -flag8=67108896 -flagg8=0 -tflag8=2 -initx8=0 -inity8=0 -minx8=0 -miny8=0 -maxx8=0 -maxy8=0 -posx8=50 -posy8=50 -sizx8=800 -sizy8=600 -title9=Alien vs. Predator -path9=C:\Games\Alien vs Predator\AvP.exe -module9= -ver9=0 -flag9=8224 -flagg9=0 -tflag9=130 -initx9=0 -inity9=0 -minx9=0 -miny9=0 -maxx9=0 -maxy9=0 -posx9=50 -posy9=50 -sizx9=800 -sizy9=600 -title10=Aliens Nations Demo -path10=C:\Games\aademo\Bin\AA.exe -module10= -ver10=0 -flag10=134217762 -flagg10=0 -tflag10=0 -initx10=0 -inity10=0 -minx10=0 -miny10=0 -maxx10=0 -maxy10=0 -posx10=0 -posy10=0 -sizx10=800 -sizy10=600 -title11=America -path11=D:\Games\America\america.exe -module11= -ver11=0 -flag11=134234150 -flagg11=16 -tflag11=0 -initx11=0 -inity11=0 -minx11=0 -miny11=0 -maxx11=0 -maxy11=0 -posx11=50 -posy11=50 -sizx11=800 -sizy11=600 -title12=Ancient Evil -path12=C:\Games\Ancient Evil\RPG.EXE -module12=DDW16.DLL -ver12=1 -flag12=-2013249497 -flagg12=0 -tflag12=2 -initx12=0 -inity12=0 -minx12=0 -miny12=0 -maxx12=0 -maxy12=0 -posx12=50 -posy12=50 -sizx12=800 -sizy12=600 -title13=Ancient Evil Demo -path13=C:\Games\Ancient Evil Curse of the Snake Cult\aecsc-demo.exe -module13= -ver13=1 -flag13=134242336 -flagg13=0 -tflag13=0 -initx13=0 -inity13=0 -minx13=0 -miny13=0 -maxx13=0 -maxy13=0 -posx13=50 -posy13=50 -sizx13=800 -sizy13=600 -title14=Armymen -path14=C:\Games\armymen\Armymen.exe -module14= -ver14=0 -flag14=134218274 -flagg14=1 -tflag14=0 -initx14=0 -inity14=0 -minx14=0 -miny14=0 -maxx14=0 -maxy14=0 -posx14=50 -posy14=50 -sizx14=800 -sizy14=600 -title15=ArmyMen 2 -path15=C:\Games\army2\ArmyMen2.exe -module15= -ver15=0 -flag15=402653730 -flagg15=0 -tflag15=0 -initx15=0 -inity15=0 -minx15=0 -miny15=0 -maxx15=0 -maxy15=0 -posx15=50 -posy15=50 -sizx15=800 -sizy15=600 -title16=Atomic Bomberman -path16=C:\Games\Atomic Bomberman\BM95.EXE -module16= -ver16=0 -flag16=2 -flagg16=0 -tflag16=0 -initx16=0 -inity16=0 -minx16=0 -miny16=0 -maxx16=0 -maxy16=0 -posx16=50 -posy16=50 -sizx16=800 -sizy16=600 -title17=Axis & Allies Iron Blitz Edition -path17=C:\Games\Axis & Allies Iron Blitz Edition\Axis & Allies\AxisAllies.exe -module17= -ver17=0 -flag17=-2147483614 -flagg17=0 -tflag17=0 -initx17=0 -inity17=0 -minx17=0 -miny17=0 -maxx17=0 -maxy17=0 -posx17=50 -posy17=50 -sizx17=800 -sizy17=600 -title18=Baldies -path18=C:\Games\Baldies for Win95\baldies.exe -module18= -ver18=0 -flag18=537010210 -flagg18=0 -tflag18=0 -initx18=0 -inity18=0 -minx18=0 -miny18=0 -maxx18=0 -maxy18=0 -posx18=50 -posy18=50 -sizx18=800 -sizy18=600 -title19=Battle Arena Toshinden 2 (BAD!!) -path19=C:\Games\Battle Arena Toshinden 2\tsd2\T2.EXE -module19= -ver19=1 -flag19=8388640 -flagg19=0 -tflag19=258 -initx19=0 -inity19=0 -minx19=0 -miny19=0 -maxx19=0 -maxy19=0 -posx19=50 -posy19=50 -sizx19=800 -sizy19=600 -title20=Beasts & Bumpkins -path20=C:\Games\Beasts and Bumpkins\BEASTS.EXE -module20= -ver20=0 -flag20=2105890 -flagg20=0 -tflag20=2 -initx20=0 -inity20=0 -minx20=0 -miny20=0 -maxx20=0 -maxy20=0 -posx20=50 -posy20=50 -sizx20=800 -sizy20=600 -title21=Beats of Rage -path21=C:\Games\BOR\BeatsOfRage.exe -module21= -ver21=0 -flag21=537002018 -flagg21=0 -tflag21=0 -initx21=0 -inity21=0 -minx21=0 -miny21=0 -maxx21=0 -maxy21=0 -posx21=50 -posy21=50 -sizx21=800 -sizy21=600 -title22=Beyond Good & Evil Demo -path22=C:\Games\Beyond Good & Evil\BGE.exe -module22= -ver22=0 -flag22=0 -flagg22=0 -tflag22=0 -initx22=0 -inity22=0 -minx22=0 -miny22=0 -maxx22=0 -maxy22=0 -posx22=50 -posy22=50 -sizx22=800 -sizy22=600 -title23=Black Moon Lune Noire -path23=C:\Games\Black Moon\Lune noire\Engine.exe -module23= -ver23=0 -flag23=262179 -flagg23=0 -tflag23=0 -initx23=0 -inity23=0 -minx23=0 -miny23=0 -maxx23=0 -maxy23=0 -posx23=50 -posy23=50 -sizx23=800 -sizy23=600 -title24=Blood Omen Legacy of Kain -path24=C:\Games\Blood Omen\KAIN.EXE -module24= -ver24=0 -flag24=49190 -flagg24=0 -tflag24=0 -initx24=0 -inity24=0 -minx24=0 -miny24=0 -maxx24=0 -maxy24=0 -posx24=50 -posy24=50 -sizx24=800 -sizy24=600 -title25=Bonkheads -path25=C:\Games\Bonkheads\Bonkheads.exe -module25= -ver25=0 -flag25=262690 -flagg25=16 -tflag25=78 -initx25=0 -inity25=0 -minx25=0 -miny25=0 -maxx25=0 -maxy25=0 -posx25=50 -posy25=50 -sizx25=800 -sizy25=600 -title26=Bubble Bobble 2 -path26=C:\Games\bubble2\BOBO2.EXE -module26= -ver26=0 -flag26=34 -flagg26=0 -tflag26=0 -initx26=0 -inity26=0 -minx26=0 -miny26=0 -maxx26=0 -maxy26=0 -posx26=50 -posy26=50 -sizx26=800 -sizy26=600 -title27=Bug! -path27=C:\Games\Bug\BUG!.EXE -module27= -ver27=0 -flag27=134225954 -flagg27=32 -tflag27=2 -initx27=0 -inity27=0 -minx27=0 -miny27=0 -maxx27=0 -maxy27=0 -posx27=0 -posy27=0 -sizx27=800 -sizy27=600 -title28=Caesar III -path28=C:\Games\Caesar III\c3.exe -module28= -ver28=0 -flag28=-2147475422 -flagg28=0 -tflag28=0 -initx28=0 -inity28=0 -minx28=0 -miny28=0 -maxx28=0 -maxy28=0 -posx28=50 -posy28=50 -sizx28=800 -sizy28=600 -title29=Championship Manager 99-00 -path29=C:\Games\CM9900\cm9900.exe -module29= -ver29=0 -flag29=10306 -flagg29=0 -tflag29=0 -initx29=0 -inity29=0 -minx29=0 -miny29=0 -maxx29=0 -maxy29=0 -posx29=50 -posy29=50 -sizx29=800 -sizy29=600 -title30=Civilization Call to Power -path30=C:\Games\civctp\Civilization_Call_To_Power\ctp_program\ctp\civctp.exe -module30= -ver30=0 -flag30=545267746 -flagg30=0 -tflag30=0 -initx30=0 -inity30=0 -minx30=0 -miny30=0 -maxx30=0 -maxy30=0 -posx30=50 -posy30=50 -sizx30=800 -sizy30=600 -title31=Claw -path31=C:\Games\claw\clawexe.exe -module31= -ver31=0 -flag31=24610 -flagg31=0 -tflag31=0 -initx31=0 -inity31=0 -minx31=0 -miny31=0 -maxx31=0 -maxy31=0 -posx31=50 -posy31=50 -sizx31=800 -sizy31=600 -title32=Commando's Behind Enemy Lines Demo -path32=C:\Games\Commando's Behind Enemy Lines Demo\COMANDOS\Comandos.exe -module32= -ver32=0 -flag32=1744838944 -flagg32=0 -tflag32=64 -initx32=0 -inity32=0 -minx32=0 -miny32=0 -maxx32=0 -maxy32=0 -posx32=50 -posy32=50 -sizx32=800 -sizy32=600 -title33=Commandos II: Men of Courage -path33=C:\Games\Commandos II\comm2.exe -module33= -ver33=0 -flag33=-1207951008 -flagg33=0 -tflag33=0 -initx33=0 -inity33=0 -minx33=0 -miny33=0 -maxx33=0 -maxy33=0 -posx33=50 -posy33=50 -sizx33=800 -sizy33=600 -title34=Crazy Taxy -path34=C:\Games\Crazy_Taxi\Crazy Taxi PC Version\crazy_taxi_pc.exe -module34= -ver34=8 -flag34=536870945 -flagg34=0 -tflag34=0 -initx34=0 -inity34=0 -minx34=0 -miny34=0 -maxx34=0 -maxy34=0 -posx34=50 -posy34=50 -sizx34=800 -sizy34=600 -title35=Crush! Deluxe -path35=C:\Games\Crush! Deluxe\CRUSHD.EXE -module35= -ver35=0 -flag35=134492706 -flagg35=0 -tflag35=0 -initx35=0 -inity35=0 -minx35=0 -miny35=0 -maxx35=0 -maxy35=0 -posx35=50 -posy35=50 -sizx35=800 -sizy35=600 -title36=Cybermercs -path36=C:\Games\cybermercs\cybermercs.exe -module36= -ver36=0 -flag36=134234146 -flagg36=16 -tflag36=0 -initx36=0 -inity36=0 -minx36=0 -miny36=0 -maxx36=0 -maxy36=0 -posx36=50 -posy36=50 -sizx36=800 -sizy36=600 -title37=Darius Gaiden -path37=C:\Games\Darius_gaiden\DARIUS.EXE -module37= -ver37=0 -flag37=536870946 -flagg37=0 -tflag37=0 -initx37=0 -inity37=0 -minx37=0 -miny37=0 -maxx37=0 -maxy37=0 -posx37=50 -posy37=50 -sizx37=800 -sizy37=600 -title38=Dark Colony the Council Wars -path38=C:\Games\darkcolony_council\dc\DC16.EXE -module38= -ver38=0 -flag38=268435462 -flagg38=0 -tflag38=0 -initx38=0 -inity38=0 -minx38=0 -miny38=0 -maxx38=0 -maxy38=0 -posx38=50 -posy38=50 -sizx38=800 -sizy38=600 -title39=Darkstone -path39=C:\Games\darkstone\Darkstone.exe -module39= -ver39=0 -flag39=134234148 -flagg39=0 -tflag39=0 -initx39=0 -inity39=0 -minx39=0 -miny39=0 -maxx39=0 -maxy39=0 -posx39=50 -posy39=50 -sizx39=800 -sizy39=600 -title40=Dave Mirra Freestyle BMX Demo -path40=C:\Games\Dave Mirra Freestyle BMX\NgBMXDemo.exe -module40= -ver40=0 -flag40=8224 -flagg40=0 -tflag40=0 -initx40=0 -inity40=0 -minx40=0 -miny40=0 -maxx40=0 -maxy40=0 -posx40=50 -posy40=50 -sizx40=800 -sizy40=600 -title41=Daytona USA Deluxe -path41=C:\Games\Daytona USA Deluxe\DAYTONA USA Deluxe.exe -module41= -ver41=0 -flag41=402661410 -flagg41=0 -tflag41=0 -initx41=0 -inity41=0 -minx41=0 -miny41=0 -maxx41=0 -maxy41=0 -posx41=50 -posy41=50 -sizx41=800 -sizy41=600 -title42=Deadlock 2 -path42=C:\Games\deadlock2\DEADLOCK.EXE -module42= -ver42=0 -flag42=-2012995550 -flagg42=0 -tflag42=0 -initx42=0 -inity42=0 -minx42=0 -miny42=0 -maxx42=0 -maxy42=0 -posx42=50 -posy42=50 -sizx42=800 -sizy42=600 -title43=Deeper Dungeons 95 -path43=C:\Games\Keeper95\Deeper95.exe -module43= -ver43=0 -flag43=268460070 -flagg43=0 -tflag43=0 -initx43=0 -inity43=0 -minx43=0 -miny43=0 -maxx43=0 -maxy43=0 -posx43=50 -posy43=50 -sizx43=800 -sizy43=600 -title44=Delta Force -path44=C:\Games\Delta Force\Df.exe -module44= -ver44=0 -flag44=34 -flagg44=0 -tflag44=0 -initx44=0 -inity44=0 -minx44=0 -miny44=0 -maxx44=0 -maxy44=0 -posx44=50 -posy44=50 -sizx44=800 -sizy44=600 -title45=Dementia -path45=C:\Games\dementia\program\CRUX.EXE -h -module45= -ver45=0 -flag45=536887330 -flagg45=0 -tflag45=2 -initx45=0 -inity45=0 -minx45=0 -miny45=0 -maxx45=0 -maxy45=0 -posx45=50 -posy45=50 -sizx45=800 -sizy45=600 -title46=Dethkarz -path46=D:\Games\DethKarz\Dethkarz.exe -module46= -ver46=0 -flag46=0 -flagg46=0 -tflag46=0 -initx46=0 -inity46=0 -minx46=0 -miny46=0 -maxx46=0 -maxy46=0 -posx46=50 -posy46=50 -sizx46=800 -sizy46=600 -title47=Devil Inside -path47=C:\Games\Devil Inside\Devil.exe -module47= -ver47=0 -flag47=32 -flagg47=0 -tflag47=0 -initx47=0 -inity47=0 -minx47=0 -miny47=0 -maxx47=0 -maxy47=0 -posx47=50 -posy47=50 -sizx47=800 -sizy47=600 -title48=Diablo -path48=D:\Games\Diablo\Diablo.exe -module48= -ver48=1 -flag48=134234150 -flagg48=16 -tflag48=3 -initx48=0 -inity48=0 -minx48=0 -miny48=0 -maxx48=0 -maxy48=0 -posx48=50 -posy48=50 -sizx48=800 -sizy48=600 -title49=Dink Smallwood (BAD) -path49=C:\Games\Dink SmallWood\Dink.exe -module49= -ver49=0 -flag49=546 -flagg49=0 -tflag49=258 -initx49=0 -inity49=0 -minx49=0 -miny49=0 -maxx49=0 -maxy49=0 -posx49=50 -posy49=50 -sizx49=800 -sizy49=600 -title50=Drakan -path50=C:\Games\Drakan\drakan.exe -module50= -ver50=0 -flag50=536887328 -flagg50=0 -tflag50=0 -initx50=0 -inity50=0 -minx50=0 -miny50=0 -maxx50=0 -maxy50=0 -posx50=50 -posy50=50 -sizx50=800 -sizy50=600 -title51=Dungeon Keeper 95 -path51=D:\Games\Keeper95\KEEPER95.EXE -module51= -ver51=0 -flag51=24614 -flagg51=0 -tflag51=64 -initx51=0 -inity51=0 -minx51=0 -miny51=0 -maxx51=0 -maxy51=0 -posx51=50 -posy51=50 -sizx51=800 -sizy51=600 -title52=Dungeon Keeper II -path52=C:\Games\Dungeon Keeper II\DKII.exe -module52= -ver52=0 -flag52=34 -flagg52=0 -tflag52=82 -initx52=0 -inity52=0 -minx52=0 -miny52=0 -maxx52=0 -maxy52=0 -posx52=50 -posy52=50 -sizx52=800 -sizy52=600 -title53=Emergency Fighters for life -path53=D:\Games\Emergency\EMERGY.EXE -module53= -ver53=0 -flag53=134283811 -flagg53=18 -tflag53=3 -initx53=0 -inity53=0 -minx53=0 -miny53=0 -maxx53=0 -maxy53=0 -posx53=50 -posy53=50 -sizx53=800 -sizy53=600 -title54=Enemy Infestation -path54=C:\Games\Enemy Infestation (1998)\Ei.exe -module54= -ver54=0 -flag54=38 -flagg54=0 -tflag54=0 -initx54=0 -inity54=0 -minx54=0 -miny54=0 -maxx54=0 -maxy54=0 -posx54=50 -posy54=50 -sizx54=800 -sizy54=600 -title55=Evil Genius -path55=D:\Games\Evil Genius\ReleaseExe\EvilGenius_Cracked.exe -module55= -ver55=9 -flag55=2053 -flagg55=80 -tflag55=0 -initx55=0 -inity55=0 -minx55=0 -miny55=0 -maxx55=0 -maxy55=0 -posx55=50 -posy55=50 -sizx55=800 -sizy55=600 -title56=Expendable -path56=C:\Games\eXpendable\go.exe -nocputest -module56= -ver56=0 -flag56=402653280 -flagg56=1 -tflag56=2 -initx56=0 -inity56=0 -minx56=0 -miny56=0 -maxx56=0 -maxy56=0 -posx56=50 -posy56=50 -sizx56=800 -sizy56=600 -title57=Fallen Heaven (BAD) -path57=C:\Games\falhaven\Exe\FALLEN.EXE -module57= -ver57=0 -flag57=679485962 -flagg57=32 -tflag57=0 -initx57=0 -inity57=0 -minx57=0 -miny57=0 -maxx57=0 -maxy57=0 -posx57=0 -posy57=0 -sizx57=800 -sizy57=600 -title58=Fallout -path58=D:\Games\Fallout\FALLOUTW.EXE -module58= -ver58=1 -flag58=134217734 -flagg58=16 -tflag58=0 -initx58=0 -inity58=0 -minx58=0 -miny58=0 -maxx58=0 -maxy58=0 -posx58=50 -posy58=50 -sizx58=800 -sizy58=600 -title59=FreakOut -path59=C:\Games\Freak Out - Extreme Freeride\FreakOut.exe -module59= -ver59=9 -flag59=0 -flagg59=0 -tflag59=2 -initx59=0 -inity59=0 -minx59=0 -miny59=0 -maxx59=0 -maxy59=0 -posx59=50 -posy59=50 -sizx59=800 -sizy59=600 -title60=Funtracks -path60=C:\Games\Funtracks\Fun_win.exe -module60= -ver60=1 -flag60=2 -flagg60=0 -tflag60=258 -initx60=0 -inity60=0 -minx60=0 -miny60=0 -maxx60=0 -maxy60=0 -posx60=50 -posy60=50 -sizx60=800 -sizy60=600 -title61=Galapagos -path61=C:\Games\Galapagos\GALA.EXE -module61= -ver61=0 -flag61=134217760 -flagg61=0 -tflag61=0 -initx61=0 -inity61=0 -minx61=0 -miny61=0 -maxx61=0 -maxy61=0 -posx61=50 -posy61=50 -sizx61=800 -sizy61=600 -title62=Gangsters -path62=C:\Games\Gangsters\gangsters.exe -module62= -ver62=0 -flag62=134217762 -flagg62=0 -tflag62=2 -initx62=0 -inity62=0 -minx62=0 -miny62=0 -maxx62=0 -maxy62=0 -posx62=100 -posy62=100 -sizx62=800 -sizy62=600 -title63=GeneRally -path63=C:\Games\generally105\GeneRally.exe -module63= -ver63=0 -flag63=34 -flagg63=0 -tflag63=0 -initx63=0 -inity63=0 -minx63=0 -miny63=0 -maxx63=0 -maxy63=0 -posx63=50 -posy63=50 -sizx63=800 -sizy63=600 -title64=Get Medieval -path64=C:\Games\Get Medieval\MEDIEVAL.EXE -module64= -ver64=0 -flag64=34 -flagg64=2 -tflag64=0 -initx64=0 -inity64=0 -minx64=0 -miny64=0 -maxx64=0 -maxy64=0 -posx64=0 -posy64=0 -sizx64=800 -sizy64=600 -title65=Gift -path65=C:\Games\Gift\Gift.exe -module65= -ver65=0 -flag65=4196384 -flagg65=0 -tflag65=34 -initx65=0 -inity65=0 -minx65=0 -miny65=0 -maxx65=0 -maxy65=0 -posx65=0 -posy65=0 -sizx65=0 -sizy65=0 -title66=Golden Age of Racing -path66=C:\Games\Golden Age of Racing\GAOR.exe -module66= -ver66=0 -flag66=34 -flagg66=0 -tflag66=0 -initx66=0 -inity66=0 -minx66=0 -miny66=0 -maxx66=0 -maxy66=0 -posx66=50 -posy66=50 -sizx66=800 -sizy66=600 -title67=Gp500 for Win2K -path67=C:\Games\gp500\gp500_win2k.exe -module67= -ver67=1 -flag67=545677860 -flagg67=0 -tflag67=2 -initx67=0 -inity67=0 -minx67=0 -miny67=0 -maxx67=0 -maxy67=0 -posx67=50 -posy67=50 -sizx67=800 -sizy67=600 -title68=G-Police -path68=C:\Games\gpolice\GPOLICE.EXE -module68= -ver68=0 -flag68=67125286 -flagg68=0 -tflag68=2 -initx68=0 -inity68=0 -minx68=0 -miny68=0 -maxx68=0 -maxy68=0 -posx68=50 -posy68=50 -sizx68=800 -sizy68=600 -title69=Grand Prix Legends -path69=C:\Games\grand prix legends\gpl\gpl.exe -module69= -ver69=7 -flag69=134217760 -flagg69=4 -tflag69=0 -initx69=0 -inity69=0 -minx69=0 -miny69=0 -maxx69=0 -maxy69=0 -posx69=50 -posy69=50 -sizx69=0 -sizy69=0 -title70=Grim Fandango Demo -path70=C:\Games\GrimWebDemo\grimdemo.exe -module70= -ver70=0 -flag70=34 -flagg70=0 -tflag70=258 -initx70=0 -inity70=0 -minx70=0 -miny70=0 -maxx70=0 -maxy70=0 -posx70=50 -posy70=50 -sizx70=800 -sizy70=600 -title71=Heart of Darkness -path71=C:\Games\Heart_of_Darkness\HODWin32.exe -module71= -ver71=0 -flag71=8226 -flagg71=0 -tflag71=0 -initx71=0 -inity71=0 -minx71=0 -miny71=0 -maxx71=0 -maxy71=0 -posx71=50 -posy71=50 -sizx71=800 -sizy71=600 -title72=Heavy Metal FAKK 2 -path72=C:\Games\Heavy Metal - FAKK2\fakk2.exe -module72= -ver72=0 -flag72=33554464 -flagg72=64 -tflag72=2 -initx72=0 -inity72=0 -minx72=0 -miny72=0 -maxx72=0 -maxy72=0 -posx72=50 -posy72=50 -sizx72=800 -sizy72=600 -title73=HellCopter -path73=C:\Games\hellcop\HCopter.exe -module73= -ver73=0 -flag73=-2013249500 -flagg73=256 -tflag73=0 -initx73=0 -inity73=0 -minx73=0 -miny73=0 -maxx73=0 -maxy73=0 -posx73=50 -posy73=50 -sizx73=800 -sizy73=600 -title74=Heroes of Might & Magic III Demo -path74=C:\Games\Heroes III Demo\h3demo.exe -module74= -ver74=1 -flag74=134234146 -flagg74=0 -tflag74=2 -initx74=0 -inity74=0 -minx74=0 -miny74=0 -maxx74=0 -maxy74=0 -posx74=50 -posy74=50 -sizx74=800 -sizy74=600 -title75=hover -path75=C:\Games\hover\hoverX.exe -module75= -ver75=0 -flag75=8224 -flagg75=0 -tflag75=0 -initx75=0 -inity75=0 -minx75=0 -miny75=0 -maxx75=0 -maxy75=0 -posx75=50 -posy75=50 -sizx75=800 -sizy75=600 -title76=Hyperblade -path76=D:\Games\Hyperblade\HYPERX.EXE -module76= -ver76=0 -flag76=675 -flagg76=4114 -tflag76=2 -initx76=0 -inity76=0 -minx76=0 -miny76=0 -maxx76=0 -maxy76=0 -posx76=50 -posy76=50 -sizx76=800 -sizy76=600 -title77=Idinaloq -path77=C:\Games\idina101\idinaloq.exe -module77= -ver77=0 -flag77=32 -flagg77=0 -tflag77=0 -initx77=0 -inity77=0 -minx77=0 -miny77=0 -maxx77=0 -maxy77=0 -posx77=50 -posy77=50 -sizx77=800 -sizy77=600 -title78=Immanis -path78=C:\Games\Immanis CD release\immanis.exe -module78= -ver78=0 -flag78=24611 -flagg78=0 -tflag78=0 -initx78=0 -inity78=0 -minx78=0 -miny78=0 -maxx78=0 -maxy78=0 -posx78=50 -posy78=50 -sizx78=800 -sizy78=600 -title79=Immanis (v2) -path79=C:\Games\Immanis CD release\immanis_v2.exe -module79= -ver79=0 -flag79=268460067 -flagg79=0 -tflag79=0 -initx79=0 -inity79=0 -minx79=0 -miny79=0 -maxx79=0 -maxy79=0 -posx79=50 -posy79=50 -sizx79=800 -sizy79=600 -title80=In the Hunt -path80=C:\Games\In The Hunt\e8.exe -module80= -ver80=0 -flag80=2 -flagg80=0 -tflag80=0 -initx80=0 -inity80=0 -minx80=0 -miny80=0 -maxx80=0 -maxy80=0 -posx80=50 -posy80=50 -sizx80=800 -sizy80=600 -title81=International Superstar Soccer 3 -path81=C:\Games\ISS_3\iss3.exe -module81= -ver81=8 -flag81=545267715 -flagg81=0 -tflag81=0 -initx81=0 -inity81=0 -minx81=0 -miny81=0 -maxx81=0 -maxy81=0 -posx81=50 -posy81=50 -sizx81=800 -sizy81=600 -title82=Jet Moto -path82=M:\JETMOTO.EXE -module82= -ver82=0 -flag82=139298 -flagg82=0 -tflag82=0 -initx82=0 -inity82=0 -minx82=0 -miny82=0 -maxx82=0 -maxy82=0 -posx82=50 -posy82=50 -sizx82=800 -sizy82=600 -title83=Kiss Psyco Cyrcus -path83=C:\Games\Psycho\client.exe -module83=d3d.ren -ver83=7 -flag83=537018404 -flagg83=0 -tflag83=0 -initx83=0 -inity83=0 -minx83=0 -miny83=0 -maxx83=0 -maxy83=0 -posx83=50 -posy83=50 -sizx83=800 -sizy83=600 -title84=Krazy Ivan -path84=C:\Games\Krazy Ivan\KRAZY.EXE -module84= -ver84=0 -flag84=536870914 -flagg84=0 -tflag84=0 -initx84=0 -inity84=0 -minx84=0 -miny84=0 -maxx84=0 -maxy84=0 -posx84=50 -posy84=50 -sizx84=800 -sizy84=600 -title85=Last Bronx -path85=C:\Games\Last_Bronx\LB.EXE -module85= -ver85=0 -flag85=40994 -flagg85=0 -tflag85=64 -initx85=0 -inity85=0 -minx85=0 -miny85=0 -maxx85=0 -maxy85=0 -posx85=50 -posy85=50 -sizx85=800 -sizy85=600 -title86=Lionheart -path86=C:\Games\Lionheart Demo\Lionheart.exe -module86= -ver86=0 -flag86=-2147483612 -flagg86=0 -tflag86=0 -initx86=0 -inity86=0 -minx86=0 -miny86=0 -maxx86=0 -maxy86=0 -posx86=50 -posy86=50 -sizx86=800 -sizy86=600 -title87=M.A.X. 2 -path87=C:\Games\MAX 2\MAX_2\MAX2\MAX2.EXE -module87= -ver87=0 -flag87=34 -flagg87=0 -tflag87=0 -initx87=0 -inity87=0 -minx87=0 -miny87=0 -maxx87=0 -maxy87=0 -posx87=50 -posy87=50 -sizx87=800 -sizy87=600 -title88=M1 Tank Platoon 2 -path88=C:\Games\M1 Tank Platoon 2\M1TP2.exe -module88= -ver88=8 -flag88=34 -flagg88=0 -tflag88=0 -initx88=0 -inity88=0 -minx88=0 -miny88=0 -maxx88=0 -maxy88=0 -posx88=50 -posy88=50 -sizx88=800 -sizy88=600 -title89=Mario Worlds (stripped PE) -path89=C:\Games\Mario Worlds\Mario Worlds.exe -module89= -ver89=1 -flag89=2 -flagg89=1 -tflag89=386 -initx89=0 -inity89=0 -minx89=0 -miny89=0 -maxx89=0 -maxy89=0 -posx89=50 -posy89=50 -sizx89=800 -sizy89=600 -title90=Masters of Orion 2 -path90=C:\Games\Orion2\Orion95.exe -module90= -ver90=0 -flag90=34 -flagg90=0 -tflag90=0 -initx90=0 -inity90=0 -minx90=0 -miny90=0 -maxx90=0 -maxy90=0 -posx90=50 -posy90=50 -sizx90=800 -sizy90=600 -title91=Microsoft Flight Simulator 98 -path91=C:\Games\Flight Simulator 98\FLTSIM98.EXE -module91= -ver91=0 -flag91=288 -flagg91=0 -tflag91=0 -initx91=0 -inity91=0 -minx91=0 -miny91=0 -maxx91=0 -maxy91=0 -posx91=50 -posy91=50 -sizx91=800 -sizy91=600 -title92=Microsoft Midtown Madness -path92=C:\Games\Midtown Madness\midtown.exe -module92= -ver92=0 -flag92=8192 -flagg92=0 -tflag92=2 -initx92=0 -inity92=0 -minx92=0 -miny92=0 -maxx92=0 -maxy92=0 -posx92=50 -posy92=50 -sizx92=800 -sizy92=600 -title93=Microsoft Midtown Madness Trial (BAD) -path93=C:\Games\Midtown Madness Trial\midtrial.exe -module93= -ver93=0 -flag93=2 -flagg93=0 -tflag93=0 -initx93=0 -inity93=0 -minx93=0 -miny93=0 -maxx93=0 -maxy93=0 -posx93=0 -posy93=0 -sizx93=800 -sizy93=600 -title94=Microsoft Motocross Madness 2 (BAD!!) -path94=C:\Games\Motocross Madness 2\MCM2.cracked.EXE -module94= -ver94=7 -flag94=201326664 -flagg94=1 -tflag94=82 -initx94=0 -inity94=0 -minx94=0 -miny94=0 -maxx94=0 -maxy94=0 -posx94=50 -posy94=50 -sizx94=800 -sizy94=600 -title95=Microsoft Motocross Madness Trial (BAD) -path95=C:\Games\Motocross Madness Trial\mcm.exe -module95= -ver95=1 -flag95=134225952 -flagg95=0 -tflag95=130 -initx95=0 -inity95=0 -minx95=0 -miny95=0 -maxx95=0 -maxy95=0 -posx95=50 -posy95=50 -sizx95=0 -sizy95=0 -title96=Mission Force Cyberstorm (BAD ?) -path96=C:\Games\SIERRA\CSTORM\CSTORM.EXE -module96= -ver96=0 -flag96=33562658 -flagg96=0 -tflag96=0 -initx96=0 -inity96=0 -minx96=0 -miny96=0 -maxx96=0 -maxy96=0 -posx96=50 -posy96=50 -sizx96=0 -sizy96=0 -title97=Monopoly 3D -path97=C:\Games\Monopoly (Edition 3D)\Monopoly.exe -module97= -ver97=0 -flag97=134244388 -flagg97=0 -tflag97=2 -initx97=0 -inity97=0 -minx97=0 -miny97=0 -maxx97=0 -maxy97=0 -posx97=50 -posy97=50 -sizx97=800 -sizy97=600 -title98=Monster Truck Madness 2 -path98=C:\Games\Monster Truck Madness 2\Monster.EXE -module98= -ver98=1 -flag98=34 -flagg98=1 -tflag98=0 -initx98=0 -inity98=0 -minx98=0 -miny98=0 -maxx98=0 -maxy98=0 -posx98=50 -posy98=50 -sizx98=800 -sizy98=600 -title99=Necrodrome -path99=C:\Games\Necrodome\NECRO95.EXE -module99= -ver99=0 -flag99=268435495 -flagg99=256 -tflag99=0 -initx99=0 -inity99=0 -minx99=0 -miny99=0 -maxx99=0 -maxy99=0 -posx99=50 -posy99=50 -sizx99=800 -sizy99=600 -title100=Need For Speed - Porsche 2000 -path100=C:\Games\Need For Speed - Porsche 2000\Porsche.exe -module100= -ver100=7 -flag100=0 -flagg100=0 -tflag100=258 -initx100=0 -inity100=0 -minx100=0 -miny100=0 -maxx100=0 -maxy100=0 -posx100=50 -posy100=50 -sizx100=800 -sizy100=600 -title101=Netstorm Islands at War -path101=C:\Games\Netstorm\Netstorm.exe -module101= -ver101=0 -flag101=2 -flagg101=0 -tflag101=0 -initx101=0 -inity101=0 -minx101=0 -miny101=0 -maxx101=0 -maxy101=0 -posx101=50 -posy101=50 -sizx101=800 -sizy101=600 -title102=Nox -path102=C:\Games\Nox2\Game.exe -module102= -ver102=0 -flag102=939540515 -flagg102=0 -tflag102=386 -initx102=0 -inity102=0 -minx102=0 -miny102=0 -maxx102=0 -maxy102=0 -posx102=50 -posy102=50 -sizx102=800 -sizy102=600 -title103=Pacific General -path103=C:\Games\Pacific General\PACGEN.EXE -module103= -ver103=0 -flag103=8226 -flagg103=0 -tflag103=2 -initx103=0 -inity103=0 -minx103=0 -miny103=0 -maxx103=0 -maxy103=0 -posx103=50 -posy103=50 -sizx103=800 -sizy103=600 -title104=Project Nomads Demo (BAD) -path104=C:\Games\Project Nomads Demo\bin\win32\nomads.exe -module104= -ver104=8 -flag104=-1476394912 -flagg104=256 -tflag104=258 -initx104=0 -inity104=0 -minx104=0 -miny104=0 -maxx104=0 -maxy104=0 -posx104=50 -posy104=50 -sizx104=800 -sizy104=600 -title105=Puzzle Bubble -path105=C:\Games\Puzzle Bubble\PB.EXE -module105= -ver105=0 -flag105=34 -flagg105=0 -tflag105=0 -initx105=0 -inity105=0 -minx105=0 -miny105=0 -maxx105=0 -maxy105=0 -posx105=50 -posy105=50 -sizx105=800 -sizy105=600 -title106=Raiden II -path106=C:\Games\Raiden II\Raiden II\RAIDENII.EXE -module106= -ver106=0 -flag106=34 -flagg106=0 -tflag106=0 -initx106=0 -inity106=0 -minx106=0 -miny106=0 -maxx106=0 -maxy106=0 -posx106=50 -posy106=50 -sizx106=800 -sizy106=600 -title107=Railroad Tycoon II -path107=C:\Games\Railroad.Tycoon.II\RT2.EXE -module107= -ver107=1 -flag107=134225954 -flagg107=0 -tflag107=0 -initx107=0 -inity107=0 -minx107=0 -miny107=0 -maxx107=0 -maxy107=0 -posx107=50 -posy107=50 -sizx107=800 -sizy107=600 -title108=Rally Championship 2000 -path108=C:\Games\Rally Championship 2000\RAL.EXE -module108= -ver108=0 -flag108=67108864 -flagg108=0 -tflag108=2 -initx108=0 -inity108=0 -minx108=0 -miny108=0 -maxx108=0 -maxy108=0 -posx108=50 -posy108=50 -sizx108=800 -sizy108=600 -title109=Rebel Moon Rising -path109=C:\Games\Rebel Moon Rising\Rmr.exe -module109= -ver109=0 -flag109=0 -flagg109=0 -tflag109=0 -initx109=0 -inity109=0 -minx109=0 -miny109=0 -maxx109=0 -maxy109=0 -posx109=50 -posy109=50 -sizx109=800 -sizy109=600 -title110=Redline - Gang Warfare 2066 -path110=C:\Games\Redline - Gang Warfare 2066\redline.exe -module110= -ver110=0 -flag110=32 -flagg110=0 -tflag110=386 -initx110=0 -inity110=0 -minx110=0 -miny110=0 -maxx110=0 -maxy110=0 -posx110=50 -posy110=50 -sizx110=800 -sizy110=600 -title111=Resident Evil -path111=C:\Games\Resident Evil\residentevil.patched.exe -module111= -ver111=1 -flag111=134217827 -flagg111=0 -tflag111=2 -initx111=0 -inity111=0 -minx111=0 -miny111=0 -maxx111=0 -maxy111=0 -posx111=50 -posy111=50 -sizx111=800 -sizy111=600 -title112=Re-Volt -path112=C:\Games\Re-Volt\REVOLT.EXE -module112= -ver112=0 -flag112=134217792 -flagg112=0 -tflag112=0 -initx112=0 -inity112=0 -minx112=0 -miny112=0 -maxx112=0 -maxy112=0 -posx112=50 -posy112=50 -sizx112=800 -sizy112=600 -title113=Road Rash -path113=D:\Games\Road Rash\ROADRASH\ROADRASH.EXE -module113= -ver113=0 -flag113=134217730 -flagg113=0 -tflag113=387 -initx113=0 -inity113=0 -minx113=0 -miny113=0 -maxx113=0 -maxy113=0 -posx113=50 -posy113=50 -sizx113=800 -sizy113=600 -title114=Road Rash Demo -path114=D:\Games\RoadRash DEMO\DEMORASH.EXE -module114= -ver114=0 -flag114=134218242 -flagg114=0 -tflag114=259 -initx114=0 -inity114=0 -minx114=0 -miny114=0 -maxx114=0 -maxy114=0 -posx114=50 -posy114=50 -sizx114=800 -sizy114=600 -title115=RollerCoaster Tycoon 2 Mini Game -path115=C:\Games\RollerCoaster Tycoon 2 Mini Game\rct2.exe -module115= -ver115=1 -flag115=536870946 -flagg115=0 -tflag115=0 -initx115=0 -inity115=0 -minx115=0 -miny115=0 -maxx115=0 -maxy115=0 -posx115=0 -posy115=0 -sizx115=800 -sizy115=600 -title116=Sega Rally 2 Championship -path116=C:\Games\Sega Rally 2 Championship\SEGA RALLY 2.exe -module116= -ver116=1 -flag116=268435488 -flagg116=2 -tflag116=0 -initx116=0 -inity116=0 -minx116=0 -miny116=0 -maxx116=0 -maxy116=0 -posx116=0 -posy116=0 -sizx116=800 -sizy116=600 -title117=Shadow Master (TBD) -path117=C:\Games\Shadow Master\rmg.exe -module117= -ver117=1 -flag117=32 -flagg117=256 -tflag117=450 -initx117=0 -inity117=0 -minx117=0 -miny117=0 -maxx117=0 -maxy117=0 -posx117=50 -posy117=50 -sizx117=800 -sizy117=600 -title118=Sid Meier's SimGolf Demo -path118=C:\Games\Sid Meier's SimGolf Demo\golf.exe -module118=jgl.dll -ver118=0 -flag118=33554434 -flagg118=0 -tflag118=2 -initx118=0 -inity118=0 -minx118=0 -miny118=0 -maxx118=0 -maxy118=0 -posx118=50 -posy118=50 -sizx118=800 -sizy118=600 -title119=SleepWalker -path119=C:\Games\SleepWalker\Sleepy.exe -module119= -ver119=0 -flag119=301989954 -flagg119=0 -tflag119=198 -initx119=0 -inity119=0 -minx119=0 -miny119=0 -maxx119=0 -maxy119=0 -posx119=50 -posy119=50 -sizx119=800 -sizy119=600 -title120=SnowBoard Racer -path120=C:\Games\Snowboard Racer\SnowBoard.exe -module120= -ver120=0 -flag120=268443681 -flagg120=0 -tflag120=0 -initx120=0 -inity120=0 -minx120=0 -miny120=0 -maxx120=0 -maxy120=0 -posx120=50 -posy120=50 -sizx120=800 -sizy120=600 -title121=Solaris (~BAD) -path121=c:\Games\Solaris\solaris.exe -module121= -ver121=7 -flag121=973078627 -flagg121=1 -tflag121=2 -initx121=0 -inity121=0 -minx121=0 -miny121=0 -maxx121=0 -maxy121=0 -posx121=50 -posy121=50 -sizx121=800 -sizy121=600 -title122=Sonic 3 -path122=C:\Games\Sonic 3 + Sonic et Knuckles\Sonic 3\SONIC3K.EXE -module122= -ver122=1 -flag122=546 -flagg122=0 -tflag122=0 -initx122=0 -inity122=0 -minx122=0 -miny122=0 -maxx122=0 -maxy122=0 -posx122=50 -posy122=50 -sizx122=800 -sizy122=600 -title123=Sonic 3D Blast -path123=C:\Games\Sonic3D\pcsonic.exe -module123= -ver123=0 -flag123=134217762 -flagg123=0 -tflag123=0 -initx123=0 -inity123=0 -minx123=0 -miny123=0 -maxx123=0 -maxy123=0 -posx123=50 -posy123=50 -sizx123=800 -sizy123=600 -title124=Sonic R -path124=C:\Games\SonicR\sonicr.exe -module124= -ver124=0 -flag124=8288 -flagg124=0 -tflag124=0 -initx124=0 -inity124=0 -minx124=0 -miny124=0 -maxx124=0 -maxy124=0 -posx124=50 -posy124=50 -sizx124=800 -sizy124=600 -title125=Soulbringer -path125=C:\Games\SoulBringer\SoulbringeVCnoeax.exe -module125= -ver125=0 -flag125=143024174 -flagg125=0 -tflag125=0 -initx125=0 -inity125=0 -minx125=0 -miny125=0 -maxx125=0 -maxy125=0 -posx125=50 -posy125=50 -sizx125=800 -sizy125=600 -title126=Speedboat Attack (BAD) -path126=C:\Games\Speedboat Attack\SBOAT.EXE -module126= -ver126=0 -flag126=541073954 -flagg126=0 -tflag126=2 -initx126=0 -inity126=0 -minx126=0 -miny126=0 -maxx126=0 -maxy126=0 -posx126=50 -posy126=50 -sizx126=800 -sizy126=600 -title127=Star Wars Episode 1 Racer -path127=C:\Games\sw racer\SWEP1RCR.EXE -module127= -ver127=0 -flag127=142606368 -flagg127=0 -tflag127=0 -initx127=0 -inity127=0 -minx127=0 -miny127=0 -maxx127=0 -maxy127=0 -posx127=50 -posy127=50 -sizx127=800 -sizy127=600 -title128=Star Wars: Jedi Knight -path128=C:\Games\Jedi Knight\Jedi Knight\JK.EXE -module128= -ver128=0 -flag128=8226 -flagg128=0 -tflag128=0 -initx128=0 -inity128=0 -minx128=0 -miny128=0 -maxx128=0 -maxy128=0 -posx128=50 -posy128=50 -sizx128=800 -sizy128=600 -title129=Star Wars: the Gungan Frontier -path129=C:\Games\sw the gungan frontier\Gungan Frontier.exe -module129= -ver129=1 -flag129=402915362 -flagg129=512 -tflag129=0 -initx129=0 -inity129=0 -minx129=0 -miny129=0 -maxx129=0 -maxy129=0 -posx129=0 -posy129=0 -sizx129=800 -sizy129=600 -title130=Starship Troopers -path130=C:\Games\Starship Troopers - Terran Ascendancy\stta\StarshipTroopers.exe -module130= -ver130=1 -flag130=32 -flagg130=0 -tflag130=0 -initx130=0 -inity130=0 -minx130=0 -miny130=0 -maxx130=0 -maxy130=0 -posx130=50 -posy130=50 -sizx130=800 -sizy130=600 -title131=Starshot Space Circus -path131=D:\SpaceCircus.exe -module131= -ver131=0 -flag131=66 -flagg131=0 -tflag131=0 -initx131=0 -inity131=0 -minx131=0 -miny131=0 -maxx131=0 -maxy131=0 -posx131=50 -posy131=50 -sizx131=800 -sizy131=600 -title132=Stronghold Demo -path132=C:\Games\Firefly Studios' Stronghold - Demo\Stronghold Demo.exe -module132= -ver132=0 -flag132=98 -flagg132=0 -tflag132=0 -initx132=0 -inity132=0 -minx132=0 -miny132=0 -maxx132=0 -maxy132=0 -posx132=50 -posy132=50 -sizx132=800 -sizy132=600 -title133=Sub Culture -path133=C:\Games\Sub Culture\sc.exe -module133= -ver133=0 -flag133=66 -flagg133=256 -tflag133=10 -initx133=50 -inity133=50 -minx133=50 -miny133=50 -maxx133=800 -maxy133=600 -posx133=50 -posy133=50 -sizx133=800 -sizy133=600 -title134=Superbike 2001 -path134=C:\Games\Superbike 2001\Sbk2001.exe -module134= -ver134=1 -flag134=536887332 -flagg134=0 -tflag134=0 -initx134=0 -inity134=0 -minx134=0 -miny134=0 -maxx134=0 -maxy134=0 -posx134=50 -posy134=50 -sizx134=800 -sizy134=600 -title135=Syberia 2 Demo -path135=C:\Games\Syberia 2 Demo\Syberia2Demo.exe -module135= -ver135=8 -flag135=536887332 -flagg135=0 -tflag135=0 -initx135=0 -inity135=0 -minx135=0 -miny135=0 -maxx135=0 -maxy135=0 -posx135=50 -posy135=50 -sizx135=800 -sizy135=600 -title136=Syberia Demo -path136=C:\Games\SyberiaDemo\SyberiaDemo.exe -module136= -ver136=1 -flag136=536887332 -flagg136=0 -tflag136=0 -initx136=0 -inity136=0 -minx136=0 -miny136=0 -maxx136=0 -maxy136=0 -posx136=50 -posy136=50 -sizx136=800 -sizy136=600 -title137=System Shock 2 (BAD!!!) -path137=C:\Games\Sys Shock II\Shock2.exe -module137= -ver137=1 -flag137=0 -flagg137=64 -tflag137=0 -initx137=0 -inity137=0 -minx137=0 -miny137=0 -maxx137=0 -maxy137=0 -posx137=50 -posy137=50 -sizx137=800 -sizy137=600 -title138=Test Drive 4 -path138=D:\Games\Test Drive 4\td4.EXE -module138= -ver138=0 -flag138=-2013265886 -flagg138=16 -tflag138=3 -initx138=0 -inity138=0 -minx138=0 -miny138=0 -maxx138=0 -maxy138=0 -posx138=50 -posy138=50 -sizx138=800 -sizy138=600 -title139=The Nations Demo -path139=C:\Games\The Nations Demo\bin\Game.exe -module139= -ver139=1 -flag139=402661920 -flagg139=256 -tflag139=0 -initx139=0 -inity139=0 -minx139=0 -miny139=0 -maxx139=0 -maxy139=0 -posx139=50 -posy139=50 -sizx139=800 -sizy139=600 -title140=The Sims -path140=C:\Games\The Sims\Sims.exe -module140= -ver140=0 -flag140=134226976 -flagg140=0 -tflag140=2 -initx140=0 -inity140=0 -minx140=0 -miny140=0 -maxx140=0 -maxy140=0 -posx140=50 -posy140=50 -sizx140=800 -sizy140=600 -title141=Thief the Dark Project (FRE) -path141=C:\Games\thief\game\thieffixed.exe -module141= -ver141=1 -flag141=16390 -flagg141=0 -tflag141=0 -initx141=0 -inity141=0 -minx141=0 -miny141=0 -maxx141=0 -maxy141=0 -posx141=50 -posy141=50 -sizx141=800 -sizy141=600 -title142=TinTin: Prisoners of the Sun -path142=C:\Games\tintin\TINTINW.EXE -module142= -ver142=0 -flag142=34 -flagg142=0 -tflag142=2 -initx142=0 -inity142=0 -minx142=0 -miny142=0 -maxx142=0 -maxy142=0 -posx142=50 -posy142=50 -sizx142=800 -sizy142=600 -title143=Tintoy (BAD gfx) -path143=C:\Games\Tintoy\Tintoy.exe -module143= -ver143=0 -flag143=546 -flagg143=256 -tflag143=258 -initx143=0 -inity143=0 -minx143=0 -miny143=0 -maxx143=0 -maxy143=0 -posx143=50 -posy143=50 -sizx143=800 -sizy143=600 -title144=Tomb Raider - Anniversary -path144=C:\Games\Tomb Raider - Anniversary\tra.exe -module144= -ver144=9 -flag144=0 -flagg144=256 -tflag144=2 -initx144=0 -inity144=0 -minx144=0 -miny144=0 -maxx144=0 -maxy144=0 -posx144=50 -posy144=50 -sizx144=800 -sizy144=600 -title145=Tomb Raider 2 the Golden Mask -path145=D:\Games\TR2 Golden Mask\T2GOLD.EXE -module145= -ver145=0 -flag145=570688034 -flagg145=0 -tflag145=258 -initx145=0 -inity145=0 -minx145=0 -miny145=0 -maxx145=0 -maxy145=0 -posx145=50 -posy145=50 -sizx145=800 -sizy145=600 -title146=Tomb Raider 3 Demo -path146=C:\Games\Tomb Raider 3 - The Lost Artifact Demo\tr3gold.exe -module146= -ver146=1 -flag146=369098848 -flagg146=0 -tflag146=258 -initx146=0 -inity146=0 -minx146=0 -miny146=0 -maxx146=0 -maxy146=0 -posx146=50 -posy146=50 -sizx146=800 -sizy146=600 -title147=Tomb Raider 4 Demo -path147=C:\Games\Tomb Raider 4 - The Last Revelation (Demo)\tomb4.patched.exe -module147= -ver147=0 -flag147=234881056 -flagg147=16 -tflag147=258 -initx147=0 -inity147=0 -minx147=0 -miny147=0 -maxx147=0 -maxy147=0 -posx147=50 -posy147=50 -sizx147=800 -sizy147=600 -title148=Total Annihilation Kingdoms -path148=D:\Games\Total Annihilation Kingdoms\Kingdoms.exe -module148= -ver148=0 -flag148=134234146 -flagg148=0 -tflag148=0 -initx148=0 -inity148=0 -minx148=0 -miny148=0 -maxx148=0 -maxy148=0 -posx148=50 -posy148=50 -sizx148=800 -sizy148=600 -title149=Ultim@te Race Pro -path149=C:\Games\Ultim@te race pro\Ultim@te Race Pro.exe -module149= -ver149=0 -flag149=570425440 -flagg149=256 -tflag149=0 -initx149=0 -inity149=0 -minx149=0 -miny149=0 -maxx149=0 -maxy149=0 -posx149=50 -posy149=50 -sizx149=800 -sizy149=600 -title150=Uprising - Join or Die -path150=D:\Games\Uprising\uprising.exe -module150= -ver150=0 -flag150=-2013265882 -flagg150=18 -tflag150=0 -initx150=0 -inity150=0 -minx150=0 -miny150=0 -maxx150=0 -maxy150=0 -posx150=50 -posy150=50 -sizx150=800 -sizy150=600 -title151=Warcraft 2 Battlenet Edition -path151=D:\Games\Warcraft 2\Warcraft II BNE.exe -module151= -ver151=0 -flag151=24610 -flagg151=65552 -tflag151=1 -initx151=0 -inity151=0 -minx151=0 -miny151=0 -maxx151=0 -maxy151=0 -posx151=50 -posy151=50 -sizx151=800 -sizy151=600 -title152=WarHammer Rites of War -path152=C:\Games\Rites of War\RoW.exe -module152= -ver152=0 -flag152=134217760 -flagg152=128 -tflag152=0 -initx152=0 -inity152=0 -minx152=0 -miny152=0 -maxx152=0 -maxy152=0 -posx152=50 -posy152=50 -sizx152=800 -sizy152=600 -title153=Warlords 3 -path153=D:\Games\WARLORDS3\Darklord.exe -module153= -ver153=0 -flag153=134218274 -flagg153=32 -tflag153=2 -initx153=0 -inity153=0 -minx153=0 -miny153=0 -maxx153=0 -maxy153=0 -posx153=50 -posy153=50 -sizx153=640 -sizy153=480 -title154=WarTorn -path154=C:\Games\WarTorn\W.exe -module154= -ver154=0 -flag154=32 -flagg154=0 -tflag154=0 -initx154=0 -inity154=0 -minx154=0 -miny154=0 -maxx154=0 -maxy154=0 -posx154=50 -posy154=50 -sizx154=800 -sizy154=600 -title155=WarWind -path155=C:\Games\WarWind\WW.EXE -module155= -ver155=0 -flag155=16418 -flagg155=16 -tflag155=0 -initx155=0 -inity155=0 -minx155=0 -miny155=0 -maxx155=0 -maxy155=0 -posx155=50 -posy155=50 -sizx155=800 -sizy155=600 -title156=Worms Armageddon Demo (BAD!!!) -path156=C:\Games\Worms Armageddon Demo\WaDemo.exe -module156= -ver156=1 -flag156=939524099 -flagg156=8 -tflag156=2 -initx156=0 -inity156=0 -minx156=0 -miny156=0 -maxx156=0 -maxy156=0 -posx156=0 -posy156=0 -sizx156=0 -sizy156=0 -title157=Worms World Party -path157=D:\Games\Worms World Party\wwp.exe -module157= -ver157=1 -flag157=8388610 -flagg157=0 -tflag157=0 -initx157=0 -inity157=0 -minx157=0 -miny157=0 -maxx157=0 -maxy157=0 -posx157=50 -posy157=50 -sizx157=800 -sizy157=600 -title158=Worms World Party Demo (BAD) -path158=C:\Games\WWP Demo\wwp.exe -module158=MFC42.DLL ltkrn10N.dll -ver158=1 -flag158=406847491 -flagg158=8 -tflag158=2 -initx158=0 -inity158=0 -minx158=0 -miny158=0 -maxx158=0 -maxy158=0 -posx158=0 -posy158=0 -sizx158=0 -sizy158=0 -title159=X-Com Enforcer -path159=C:\Games\X-Com Enforcer\System\xcom.exe -module159= -ver159=1 -flag159=32 -flagg159=0 -tflag159=0 -initx159=0 -inity159=0 -minx159=0 -miny159=0 -maxx159=0 -maxy159=0 -posx159=0 -posy159=0 -sizx159=800 -sizy159=600 -title160=X-Com Interceptor -path160=C:\Games\X-Com_Interceptor\X-COM Interceptor\Interceptor.exe -module160= -ver160=0 -flag160=16418 -flagg160=0 -tflag160=0 -initx160=0 -inity160=0 -minx160=0 -miny160=0 -maxx160=0 -maxy160=0 -posx160=50 -posy160=50 -sizx160=800 -sizy160=600 -title161=Z Steel Soldiers -path161=C:\Games\ZSteelSoldiers\Bin\z2.exe -module161= -ver161=8 -flag161=805462020 -flagg161=0 -tflag161=0 -initx161=0 -inity161=0 -minx161=0 -miny161=0 -maxx161=0 -maxy161=0 -posx161=50 -posy161=50 -sizx161=800 -sizy161=600 -title162=Zax Alien Hunter -path162=C:\Games\ZaxDemo\Zax.exe -module162= -ver162=0 -flag162=-1476386784 -flagg162=0 -tflag162=0 -initx162=0 -inity162=0 -minx162=0 -miny162=0 -maxx162=0 -maxy162=0 -posx162=50 -posy162=50 -sizx162=800 -sizy162=600 -title163=Zero Critical (BAD) -path163=C:\Games\zero_critical_-_satin_rift\ZEROCR.EXE -module163= -ver163=0 -flag163=679477858 -flagg163=8 -tflag163=0 -initx163=0 -inity163=0 -minx163=0 -miny163=0 -maxx163=0 -maxy163=0 -posx163=0 -posy163=0 -sizx163=800 -sizy163=600 -title164=Zero Population Count -path164=C:\Games\ZPC\ZPC.EXE -module164= -ver164=0 -flag164=1073741859 -flagg164=0 -tflag164=0 -initx164=0 -inity164=0 -minx164=0 -miny164=0 -maxx164=0 -maxy164=0 -posx164=0 -posy164=0 -sizx164=800 -sizy164=600 -title165=Zero Zone -path165=D:\ZZone\ZeroZone.exe -module165= -ver165=0 -flag165=34 -flagg165=0 -tflag165=0 -initx165=0 -inity165=0 -minx165=0 -miny165=0 -maxx165=0 -maxy165=0 -posx165=50 -posy165=50 -sizx165=800 -sizy165=600 -title166=Zeus Poseidon -path166=C:\Games\Zeus-Poseidon\Zeus.exe -module166= -ver166=0 -flag166=34 -flagg166=0 -tflag166=0 -initx166=0 -inity166=0 -minx166=0 -miny166=0 -maxx166=0 -maxy166=0 -posx166=50 -posy166=50 -sizx166=800 -sizy166=600 -title167=Zoo Tycoon -path167=C:\Games\Zoo Tycoon\zoo.exe -module167= -ver167=0 -flag167=-2013265886 -flagg167=0 -tflag167=0 -initx167=0 -inity167=0 -minx167=0 -miny167=0 -maxx167=0 -maxy167=0 -posx167=50 -posy167=50 -sizx167=800 -sizy167=600 -title168=Soldiers at War -path168=D:\Games\Soldiers at War\SAW_Game.exe -module168= -ver168=0 -flag168=671359010 -flagg168=64 -tflag168=0 -initx168=0 -inity168=0 -minx168=0 -miny168=0 -maxx168=0 -maxy168=0 -posx168=50 -posy168=50 -sizx168=640 -sizy168=480 -title169=Halo Combat Evolved -path169=D:\Games\Halo Combat Evolved\halo.exe -module169= -ver169=9 -flag169=570425377 -flagg169=0 -tflag169=479 -initx169=0 -inity169=0 -minx169=0 -miny169=0 -maxx169=0 -maxy169=0 -posx169=50 -posy169=50 -sizx169=800 -sizy169=600 -title170=Jedi Knight II Jedi Outcast -path170=D:\Games\Jedi Knight II Jedi Outcast\GameData\jk2sp.exe -module170= -ver170=0 -flag170=0 -flagg170=512 -tflag170=267 -initx170=0 -inity170=0 -minx170=0 -miny170=0 -maxx170=0 -maxy170=0 -posx170=50 -posy170=50 -sizx170=800 -sizy170=600 -title171=Incoming Forces -path171=D:\Games\Incoming Forces\forces.exe -module171= -ver171=8 -flag171=134217760 -flagg171=0 -tflag171=3 -initx171=0 -inity171=0 -minx171=0 -miny171=0 -maxx171=0 -maxy171=0 -posx171=50 -posy171=50 -sizx171=800 -sizy171=600 -title172=Doom 64 Absolution -path172=D:\Games\Doom 64\Bin\Absolution.exe -module172= -ver172=8 -flag172=0 -flagg172=0 -tflag172=259 -initx172=0 -inity172=0 -minx172=0 -miny172=0 -maxx172=0 -maxy172=0 -posx172=50 -posy172=50 -sizx172=800 -sizy172=600 -title173=lithtech.exe -path173=D:\Games\NOLF Technology Demo\lithtech.exe -module173= -ver173=7 -flag173=0 -flagg173=512 -tflag173=259 -initx173=0 -inity173=0 -minx173=0 -miny173=0 -maxx173=0 -maxy173=0 -posx173=50 -posy173=50 -sizx173=800 -sizy173=600 -title174=Half-Life Uplink Demo -path174=D:\Games\Half-Life Uplink\hldemo.exe -module174= -ver174=1 -flag174=1073741826 -flagg174=512 -tflag174=3 -initx174=0 -inity174=0 -minx174=0 -miny174=0 -maxx174=0 -maxy174=0 -posx174=50 -posy174=50 -sizx174=640 -sizy174=480 -title175=Daikatana -path175=D:\Games\Daikatana\daikatana.exe -module175=OpenGL32.dll -ver175=9 -flag175=514 -flagg175=513 -tflag175=387 -initx175=0 -inity175=0 -minx175=0 -miny175=0 -maxx175=0 -maxy175=0 -posx175=50 -posy175=50 -sizx175=800 -sizy175=600 -title176=Half-Life Blue-Shift (d3d) -path176=D:\Games\Half-Life Blue-Shift\bshift.exe -module176= -ver176=10 -flag176=1073741826 -flagg176=513 -tflag176=259 -initx176=0 -inity176=0 -minx176=0 -miny176=0 -maxx176=0 -maxy176=0 -posx176=50 -posy176=50 -sizx176=640 -sizy176=480 -title177=Moto Racer Demo -path177=D:\Games\Moto Racer Demo\PlayDemo.exe -module177= -ver177=0 -flag177=167903267 -flagg177=192 -tflag177=14 -initx177=0 -inity177=0 -minx177=0 -miny177=0 -maxx177=0 -maxy177=0 -posx177=50 -posy177=50 -sizx177=800 -sizy177=600 -title178=Quake 2 -path178=D:\Games\QUAKE2\quake2.exe -module178= -ver178=10 -flag178=167772672 -flagg178=1 -tflag178=387 -initx178=0 -inity178=0 -minx178=0 -miny178=0 -maxx178=0 -maxy178=0 -posx178=50 -posy178=50 -sizx178=800 -sizy178=600 -title179=Quake 3 Arena -path179=D:\Games\Q3A\quake3.exe -module179= -ver179=10 -flag179=0 -flagg179=513 -tflag179=0 -initx179=0 -inity179=0 -minx179=0 -miny179=0 -maxx179=0 -maxy179=0 -posx179=50 -posy179=50 -sizx179=800 -sizy179=600 -title180=Sentinel Returns -path180=D:\Games\Sentinel Returns\Sentinel.exe -module180= -ver180=1 -flag180=3 -flagg180=0 -tflag180=0 -initx180=0 -inity180=0 -minx180=0 -miny180=0 -maxx180=0 -maxy180=0 -posx180=50 -posy180=50 -sizx180=800 -sizy180=600 -title181=Sin, Wages of (sw renderer) -path181=D:\Games\sin\sin.exe -module181=ref_gl.dll ref_soft.dll -ver181=10 -flag181=402670082 -flagg181=769 -tflag181=387 -initx181=0 -inity181=0 -minx181=0 -miny181=0 -maxx181=0 -maxy181=0 -posx181=50 -posy181=50 -sizx181=800 -sizy181=600 -title182=Star trek Klingon Honor Guard -path182=D:\Games\Star trek Klingon Honor Guard\System\Khg.exe -module182=OGIDrv.dll -ver182=10 -flag182=0 -flagg182=513 -tflag182=386 -initx182=0 -inity182=0 -minx182=0 -miny182=0 -maxx182=0 -maxy182=0 -posx182=50 -posy182=50 -sizx182=800 -sizy182=600 -title183=American McGee's Alice Demo -path183=D:\Games\American McGee's Alice Demo\alice.exe -module183= -ver183=10 -flag183=268435458 -flagg183=0 -tflag183=0 -initx183=0 -inity183=0 -minx183=0 -miny183=0 -maxx183=0 -maxy183=0 -posx183=50 -posy183=50 -sizx183=800 -sizy183=600 -title184=Hexen II (opengl) -path184=D:\Games\Hexen II\glh2.exe -module184= -ver184=10 -flag184=2 -flagg184=1 -tflag184=387 -initx184=0 -inity184=0 -minx184=0 -miny184=0 -maxx184=0 -maxy184=0 -posx184=50 -posy184=50 -sizx184=800 -sizy184=600 -title185=Hexen II (software) -path185=D:\Games\Hexen II\h2.exe -module185= -ver185=10 -flag185=671088642 -flagg185=4096 -tflag185=0 -initx185=0 -inity185=0 -minx185=0 -miny185=0 -maxx185=0 -maxy185=0 -posx185=50 -posy185=50 -sizx185=800 -sizy185=600 -title186=Star Wars Jedi Knight Jedi Academy -path186=D:\Games\Star_Wars_Jedi_Knight_Jedi_Academy\GameData\jasp.exe -module186= -ver186=10 -flag186=0 -flagg186=65536 -tflag186=3 -initx186=0 -inity186=0 -minx186=0 -miny186=0 -maxx186=0 -maxy186=0 -posx186=50 -posy186=50 -sizx186=800 -sizy186=600 -title187=Dungeon Keeper 2 GOG release -path187=D:\Games\Dungeon Keeper 2 GOG release\DKII.EXE -module187= -ver187=0 -flag187=134217762 -flagg187=0 -tflag187=0 -initx187=0 -inity187=0 -minx187=0 -miny187=0 -maxx187=0 -maxy187=0 -posx187=50 -posy187=50 -sizx187=800 -sizy187=600 -maxfps0=0 -maxfps1=0 -maxfps2=0 -maxfps3=0 -maxfps4=0 -maxfps5=0 -maxfps6=0 -maxfps7=0 -maxfps8=0 -maxfps9=0 -maxfps10=0 -maxfps11=0 -maxfps12=0 -maxfps13=0 -maxfps14=0 -maxfps15=0 -maxfps16=0 -maxfps17=0 -maxfps18=0 -maxfps19=0 -maxfps20=0 -maxfps21=0 -maxfps22=0 -maxfps23=0 -maxfps24=0 -maxfps25=0 -maxfps26=0 -maxfps27=0 -maxfps28=0 -maxfps29=0 -maxfps30=0 -maxfps31=0 -maxfps32=0 -maxfps33=0 -maxfps34=0 -maxfps35=0 -maxfps36=0 -maxfps37=0 -maxfps38=0 -maxfps39=0 -maxfps40=0 -maxfps41=0 -maxfps42=0 -maxfps43=0 -maxfps44=0 -maxfps45=0 -maxfps46=0 -maxfps47=0 -maxfps48=0 -maxfps49=0 -maxfps50=0 -maxfps51=0 -maxfps52=0 -maxfps53=0 -maxfps54=0 -maxfps55=0 -maxfps56=0 -maxfps57=0 -maxfps58=0 -maxfps59=0 -maxfps60=0 -maxfps61=0 -maxfps62=0 -maxfps63=0 -maxfps64=0 -maxfps65=0 -maxfps66=0 -maxfps67=0 -maxfps68=0 -maxfps69=0 -maxfps70=0 -maxfps71=0 -maxfps72=0 -maxfps73=0 -maxfps74=0 -maxfps75=0 -maxfps76=20 -maxfps77=0 -maxfps78=0 -maxfps79=0 -maxfps80=0 -maxfps81=0 -maxfps82=0 -maxfps83=0 -maxfps84=0 -maxfps85=0 -maxfps86=0 -maxfps87=0 -maxfps88=0 -maxfps89=0 -maxfps90=0 -maxfps91=0 -maxfps92=0 -maxfps93=0 -maxfps94=0 -maxfps95=0 -maxfps96=0 -maxfps97=0 -maxfps98=0 -maxfps99=0 -maxfps100=0 -maxfps101=0 -maxfps102=0 -maxfps103=0 -maxfps104=0 -maxfps105=0 -maxfps106=0 -maxfps107=0 -maxfps108=0 -maxfps109=0 -maxfps110=0 -maxfps111=0 -maxfps112=0 -maxfps113=0 -maxfps114=0 -maxfps115=0 -maxfps116=0 -maxfps117=0 -maxfps118=0 -maxfps119=0 -maxfps120=0 -maxfps121=0 -maxfps122=0 -maxfps123=0 -maxfps124=0 -maxfps125=0 -maxfps126=0 -maxfps127=0 -maxfps128=0 -maxfps129=0 -maxfps130=0 -maxfps131=0 -maxfps132=0 -maxfps133=0 -maxfps134=0 -maxfps135=0 -maxfps136=0 -maxfps137=0 -maxfps138=0 -maxfps139=0 -maxfps140=0 -maxfps141=0 -maxfps142=0 -maxfps143=0 -maxfps144=0 -maxfps145=0 -maxfps146=0 -maxfps147=0 -maxfps148=0 -maxfps149=0 -maxfps150=0 -maxfps151=0 -maxfps152=0 -maxfps153=0 -maxfps154=0 -maxfps155=0 -maxfps156=0 -maxfps157=0 -maxfps158=0 -maxfps159=0 -maxfps160=0 -maxfps161=0 -maxfps162=0 -maxfps163=0 -maxfps164=0 -maxfps165=0 -maxfps166=0 -maxfps167=0 -maxfps168=0 -maxfps169=0 -maxfps170=0 -maxfps171=0 -maxfps172=0 -maxfps173=0 -maxfps174=0 -maxfps175=0 -maxfps176=0 -maxfps177=0 -maxfps178=0 -maxfps179=0 -maxfps180=0 -maxfps181=0 -maxfps182=0 -maxfps183=0 -maxfps184=0 -maxfps185=200 -maxfps186=0 -maxfps187=0 -title188=Total Soccer 2000 -path188=D:\Games\Total Soccer 2000\Total Soccer 2000\SOCCERDX.EXE -module188= -ver188=1 -flag188=2 -flagg188=4096 -tflag188=0 -initx188=0 -inity188=0 -minx188=0 -miny188=0 -maxx188=0 -maxy188=0 -posx188=50 -posy188=50 -sizx188=800 -maxfps188=20 diff --git a/build/readme-relnotes.txt b/build/readme-relnotes.txt index d22ad0e..7a206ec 100644 --- a/build/readme-relnotes.txt +++ b/build/readme-relnotes.txt @@ -6,3 +6,10 @@ Hide Multi Monitor configuration flag - used for "Dream Acquarium" on multimonit v2.2.02 preliminary time stretching: so far applies to GetTickCount() only, and is controlled by Alt-F5 / F6 keys. Fixed bug in GDI BitBlt call: stretching must be made on screen DC only, or it's made twice. + +v2.02.03/04: +code cleanup - see syslib calls hooking +new configuration flags: Hook GDI and Hook OpenGL +OpenGL custom library field +API hooking fix with module specification +Time stratching by keyboard control (Alt F5/F6) and/or Time Slider dialog \ No newline at end of file diff --git a/dll/dxhook.cpp b/dll/dxhook.cpp index 9781c34..723f6fa 100644 --- a/dll/dxhook.cpp +++ b/dll/dxhook.cpp @@ -9,179 +9,19 @@ #include "dxwcore.hpp" #include "dxhook.h" #include "glhook.h" +#define DXWDECLARATIONS 1 #include "syslibs.h" +#undef DXWDECLARATIONS #include "dxhelper.h" dxwCore dxw; -extern BOOL MakeWindowTransparent(HWND, unsigned char); - extern void InitScreenParameters(); -int WINAPI extGetDeviceCaps(HDC, int); -BOOL WINAPI extGetCursorPos(LPPOINT); -BOOL WINAPI extSetCursorPos(int, int); -HCURSOR WINAPI extSetCursor(HCURSOR); -BOOL WINAPI extClipCursor(RECT *); -BOOL WINAPI extGetClipCursor(LPRECT); -HRESULT WINAPI extGDIGetDisplayMode(HDC, int); -//BOOL WINAPI extColorCorrectPalette(HDC, HPALETTE, DWORD, DWORD); -int WINAPI extGetSystemMetrics(int); -extern HFONT WINAPI extCreateFont(int, int, int, int, int, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, LPCTSTR); -extern HFONT WINAPI extCreateFontIndirect(const LOGFONT*); -extern int WINAPI extFillRect(HDC, const RECT *, HBRUSH); -extern int WINAPI extDrawFocusRect(HDC, const RECT *); -extern BOOL WINAPI extRectangle(HDC, int, int, int, int); -extern LONG WINAPI extSetWindowLong(HWND, int, LONG); -extern LONG WINAPI extGetWindowLong(HWND, int); -extern BOOL WINAPI extSetWindowPos(HWND, HWND, int, int, int, int, UINT); -extern HDWP WINAPI extDeferWindowPos(HDWP, HWND, HWND, int, int, int, int, UINT); -extern LRESULT WINAPI extCallWindowProc(WNDPROC, HWND, UINT, WPARAM, LPARAM); -extern BOOL WINAPI extScaleWindowExtEx(HDC, int, int, int, int, LPSIZE); -//extern HRGN WINAPI extCreateRectRgn(int, int, int, int); -extern LRESULT WINAPI extDefWindowProc(HWND, UINT, WPARAM, LPARAM); -extern LONG WINAPI extChangeDisplaySettings(DEVMODE *, DWORD); -extern LONG WINAPI extChangeDisplaySettingsEx(LPCTSTR, DEVMODE *, HWND, DWORD, LPVOID); -extern LONG WINAPI extEnumDisplaySettings(LPCTSTR, DWORD, DEVMODE *); -extern BOOL WINAPI extSetWindowPlacement(const WINDOWPLACEMENT*); -extern HDC WINAPI extGDICreateCompatibleDC(HDC); -extern HDC WINAPI extDDCreateCompatibleDC(HDC); -extern BOOL WINAPI extGDIDeleteDC(HDC); -extern BOOL WINAPI extDDDeleteDC(HDC); -extern HDC WINAPI extGDIGetDC(HWND); -extern HDC WINAPI extDDGetDC(HWND); -extern HDC WINAPI extGDIGetWindowDC(HWND); -extern HDC WINAPI extDDGetWindowDC(HWND); -extern int WINAPI extGDIReleaseDC(HWND, HDC); -extern int WINAPI extDDReleaseDC(HWND, HDC); -extern BOOL WINAPI extGDIBitBlt(HDC, int, int, int, int, HDC, int, int, DWORD); -extern BOOL WINAPI extGDIPatBlt(HDC, int, int, int, int, DWORD); -extern BOOL WINAPI extDDBitBlt(HDC, int, int, int, int, HDC, int, int, DWORD); -extern BOOL WINAPI extGDIStretchBlt(HDC, int, int, int, int, HDC, int, int, int, int, DWORD); -extern BOOL WINAPI extDDStretchBlt(HDC, int, int, int, int, HDC, int, int, int, int, DWORD); -extern HDC WINAPI extGDICreateDC(LPSTR, LPSTR, LPSTR, CONST DEVMODE *); -extern HDC WINAPI extDDCreateDC(LPSTR, LPSTR, LPSTR, CONST DEVMODE *); -extern int WINAPI extGDISaveDC(HDC); -extern BOOL WINAPI extGDIRestoreDC(HDC, int); -extern HDC WINAPI extBeginPaint(HWND, LPPAINTSTRUCT); -extern BOOL WINAPI extEndPaint(HWND, const PAINTSTRUCT *); - -extern HMODULE WINAPI extLoadLibraryA(LPCTSTR); -extern HMODULE WINAPI extLoadLibraryExA(LPCTSTR, HANDLE, DWORD); -extern BOOL WINAPI extGetClipCursor(LPRECT); -extern BOOL WINAPI extClipCursor(LPRECT); -extern BOOL WINAPI extScreenToClient(HWND, LPPOINT); -extern BOOL WINAPI extClientToScreen(HWND, LPPOINT); -extern BOOL WINAPI extGetClientRect(HWND, LPRECT); -extern BOOL WINAPI extGetWindowRect(HWND, LPRECT); -extern int WINAPI extMapWindowPoints(HWND, HWND, LPPOINT, UINT); -extern BOOL WINAPI extPeekMessage(LPMSG, HWND, UINT, UINT, UINT); -extern BOOL WINAPI extGetMessage(LPMSG, HWND, UINT, UINT); -extern LRESULT WINAPI extDispatchMessage(LPMSG); -extern FARPROC WINAPI extGetProcAddress(HMODULE, LPCSTR); -//extern BOOL WINAPI extGetUpdateRect(HWND, LPRECT, BOOL); - -// GHO: pro Diablo -HWND WINAPI extCreateWindowExA(DWORD, LPCTSTR, LPCTSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, LPVOID); -HWND WINAPI extGetDesktopWindow(void); -BOOL WINAPI extShowWindow(HWND, int); -BOOL WINAPI extTextOutA(HDC, int, int, LPCTSTR, int); -ATOM WINAPI extRegisterClassExA(WNDCLASSEXA *); - -// GHO: pro GC&C Tiberian Sun -extern HWND WINAPI extCreateDialogIndirectParam(HINSTANCE, LPCDLGTEMPLATE, HWND, DLGPROC, LPARAM); -extern HWND WINAPI extCreateDialogParam(HINSTANCE, LPCSTR, HWND, DLGPROC, LPARAM); - -extern HWND WINAPI extSetCapture(HWND); -extern BOOL WINAPI extReleaseCapture(void); -extern BOOL WINAPI extDDInvalidateRect(HWND, RECT *, BOOL); -extern BOOL WINAPI extInvalidateRect(HWND, RECT *, BOOL); -extern BOOL WINAPI extInvalidateRgn(HWND, HRGN, BOOL); - -extern HPALETTE WINAPI extGDICreatePalette(CONST LOGPALETTE *); -extern HPALETTE WINAPI extSelectPalette(HDC, HPALETTE, BOOL); -extern UINT WINAPI extRealizePalette(HDC); -extern UINT WINAPI extGetSystemPaletteEntries(HDC, UINT, UINT, LPPALETTEENTRY); -extern BOOL WINAPI extMoveWindow(HWND, int, int, int, int, BOOL); -extern LPTOP_LEVEL_EXCEPTION_FILTER WINAPI extSetUnhandledExceptionFilter(LPTOP_LEVEL_EXCEPTION_FILTER); -extern BOOL WINAPI extGetDiskFreeSpaceA(LPCSTR, LPDWORD, LPDWORD, LPDWORD, LPDWORD); -extern BOOL WINAPI extSetDeviceGammaRamp(HDC, LPVOID); -extern BOOL WINAPI extGetDeviceGammaRamp(HDC, LPVOID); -extern LRESULT WINAPI extSendMessage(HWND, UINT, WPARAM, LPARAM); -extern DWORD WINAPI extGetTickCount(void); - extern HANDLE hTraceMutex; -GetDeviceCaps_Type pGetDeviceCaps; -GetCursorPos_Type pGetCursorPos=0; -SetCursorPos_Type pSetCursorPos=0; -SetCursor_Type pSetCursor=0; -ClipCursor_Type pClipCursor=0; -GetClipCursor_Type pGetClipCursor=0; -TextOut_Type pTextOutA=0; -FillRect_Type pFillRect; -DrawFocusRect_Type pDrawFocusRect; -Rectangle_Type pRectangle; -GDIGetDisplayMode_Type pGDIGetDisplayMode; -//ColorCorrectPalette_Type pColorCorrectPalette; -GetSystemMetrics_Type pGetSystemMetrics; -// GHO: pro Diablo -CreateWindowExA_Type pCreateWindowExA; -GetDesktopWindow_Type pGetDesktopWindow; -ShowWindow_Type pShowWindow; -SetTextColor_Type pSetTextColor; -SetBkColor_Type pSetBkColor; -CreateFont_Type pCreateFont; -CreateFontIndirect_Type pCreateFontIndirect; -SetWindowLong_Type pSetWindowLong; -GetWindowLong_Type pGetWindowLong; -SetWindowPos_Type pSetWindowPos; -DeferWindowPos_Type pDeferWindowPos; -CallWindowProc_Type pCallWindowProc; -ScaleWindowExtEx_Type pScaleWindowExtEx; -//CreateRectRgn_Type pCreateRectRgn; -DefWindowProc_Type pDefWindowProc; -ChangeDisplaySettings_Type pChangeDisplaySettings; -ChangeDisplaySettingsEx_Type pChangeDisplaySettingsEx; -EnumDisplaySettings_Type pEnumDisplaySettings = NULL; -SetWindowPlacement_Type pSetWindowPlacement; -CreateCompatibleDC_Type pCreateCompatibleDC; -DeleteDC_Type pDeleteDC; -extern GDIGetDC_Type pGDIGetDC; -extern GDIGetDC_Type pGDIGetWindowDC; -extern GDIReleaseDC_Type pGDIReleaseDC; -extern CreateDC_Type pCreateDC; -BitBlt_Type pBitBlt; -PatBlt_Type pPatBlt; -StretchBlt_Type pStretchtBlt; -extern InvalidateRgn_Type pInvalidateRgn; -GetTickCount_Type pGetTickCount; - -LoadLibraryA_Type pLoadLibraryA; -LoadLibraryExA_Type pLoadLibraryExA; -//GetClipCursor_Type pGetClipCursor; -RegisterClassExA_Type pRegisterClassExA; -ScreenToClient_Type pScreenToClient = NULL; -ClientToScreen_Type pClientToScreen = NULL; -GetClientRect_Type pGetClientRect = NULL; -GetWindowRect_Type pGetWindowRect = NULL; -MapWindowPoints_Type pMapWindowPoints = NULL; - -PeekMessage_Type pPeekMessage; -GetMessage_Type pGetMessage; -DispatchMessage_Type pDispatchMessage; -GetProcAddress_Type pGetProcAddress; -SetDeviceGammaRamp_Type pSetDeviceGammaRamp; -GetDeviceGammaRamp_Type pGetDeviceGammaRamp; -SendMessage_Type pSendMessage; - CRITICAL_SECTION TraceCS; -extern COLORREF WINAPI extSetTextColor(HDC, COLORREF); -extern COLORREF WINAPI extSetBkColor(HDC, COLORREF); - -short iPosX, iPosY, iSizX, iSizY; - static char *FlagNames[32]={ "UNNOTIFY", "EMULATESURFACE", "CLIPCURSOR", "RESETPRIMARY", "HOOKDI", "MODIFYMOUSE", "HANDLEEXCEPTIONS", "SAVELOAD", @@ -197,9 +37,9 @@ static char *Flag2Names[32]={ "RECOVERSCREENMODE", "REFRESHONRESIZE", "BACKBUFATTACH", "MODALSTYLE", "KEEPASPECTRATIO", "INIT8BPP", "FORCEWINRESIZE", "INIT16BPP", "KEEPCURSORFIXED", "DISABLEGAMMARAMP", "DIFFERENTIALMOUSE", "FIXNCHITTEST", - "LIMITFPS", "SKIPFPS", "SHOWFPS", "", - "", "", "", "", - "", "", "", "", + "LIMITFPS", "SKIPFPS", "SHOWFPS", "HIDEMULTIMONITOR", + "TIMESTRETCH", "HOOKOPENGL", "WALLPAPERMODE", "SHOWHWCURSOR", + "HOOKGDI", "", "", "", "", "", "", "", "", "", "", "", }; @@ -346,180 +186,6 @@ void DumpImportTable(char *module) return; } - -void *HookAPIbyAddr(const char *module, void *apiproc, void *hookproc) -{ - DWORD base; - PIMAGE_NT_HEADERS pnth; - PIMAGE_IMPORT_DESCRIPTOR pidesc; - DWORD rva; - PSTR impmodule; - PIMAGE_THUNK_DATA ptaddr; - DWORD oldprotect; - void *org; - - if(!apiproc) { // check - char *sMsg="HookAPIbyAddr: NULL api ptr\n"; - OutTraceE(sMsg); - if (IsAssertEnabled) MessageBox(0, sMsg, "HookAPIbyAddr", MB_OK | MB_ICONEXCLAMATION); - return 0; - } - - base = (DWORD)GetModuleHandle(NULL); - if(!base) { - OutTraceD("HookAPIbyAddr: GetModuleHandle failed, error=%d\n",GetLastError()); - return 0; - } - - __try{ - pnth = PIMAGE_NT_HEADERS(PBYTE(base) + PIMAGE_DOS_HEADER(base)->e_lfanew); - if(!pnth) { - OutTraceE("HookAPIbyAddr: ERROR no pnth at %d\n", __LINE__); - return 0; - } - rva = pnth->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress; - if(!rva) { - OutTraceE("HookAPIbyAddr: ERROR no rva at %d\n", __LINE__); - return 0; - } - pidesc = (PIMAGE_IMPORT_DESCRIPTOR)(base + rva); - - while(pidesc->FirstThunk){ - impmodule = (PSTR)(base + pidesc->Name); - if(!lstrcmpi(module, impmodule)) break; - pidesc ++; - } - if(!pidesc->FirstThunk) { - OutTraceD("HookAPIbyAddr: PE unreferenced module=%s\n", module); - return 0; - } - ptaddr = (PIMAGE_THUNK_DATA)(base + (DWORD)pidesc->FirstThunk); - while(ptaddr->u1.Function){ - if(ptaddr->u1.Function == (DWORD)apiproc) break; - ptaddr ++; - } - 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)) { - OutTraceD("HookAPIbyAddr: VirtualProtect error %d at %d\n", GetLastError(), __LINE__); - return 0; - } - ptaddr->u1.Function = (DWORD)hookproc; - if(!VirtualProtect(&ptaddr->u1.Function, 4, oldprotect, &oldprotect)) { - OutTraceD("HookAPIbyAddr: VirtualProtect error %d at %d\n", GetLastError(), __LINE__); - return 0; - } - if (!FlushInstructionCache(GetCurrentProcess(), &ptaddr->u1.Function, 4)) { - OutTraceD("HookAPIbyAddr: FlushInstructionCache error %d at %d\n", GetLastError(), __LINE__); - return 0; - } - //OutTraceD("HookAPIbyAddr hook=%s.%x address=%x->%x\n", module, apiproc, org, hookproc); - } - __except(EXCEPTION_EXECUTE_HANDLER) - { - OutTraceD("HookAPIbyAddr: EXCEPTION hook=%s:%x Hook Failed.\n", module, apiproc); - org = 0; - } -#ifdef TRYBOTHMODULES - } -#endif - return org; -} - - -void *HookAPIbyName(const char *module, const char *api, void *hookproc) -{ - DWORD base; - PIMAGE_NT_HEADERS pnth; - PIMAGE_IMPORT_DESCRIPTOR pidesc; - DWORD rva; - PSTR impmodule; - PIMAGE_THUNK_DATA ptaddr; - PIMAGE_THUNK_DATA ptname; - PIMAGE_IMPORT_BY_NAME piname; - DWORD oldprotect; - void *org; - - if(!*api) { // check - char *sMsg="HookAPIbyName: NULL api name\n"; - OutTraceE(sMsg); - if (IsAssertEnabled) MessageBox(0, sMsg, "HookAPIbyName", MB_OK | MB_ICONEXCLAMATION); - return 0; - } - - base = (DWORD)GetModuleHandle(NULL); - if(!base) { - OutTraceD("HookAPIbyName: GetModuleHandle failed, error=%d\n",GetLastError()); - return 0; - } - __try{ - pnth = PIMAGE_NT_HEADERS(PBYTE(base) + PIMAGE_DOS_HEADER(base)->e_lfanew); - if(!pnth) { - OutTraceE("HookAPIbyName: ERROR no pnth at %d\n", __LINE__); - return 0; - } - rva = pnth->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress; - if(!rva) { - OutTraceE("HookAPIbyName: ERROR no rva at %d\n", __LINE__); - return 0; - } - pidesc = (PIMAGE_IMPORT_DESCRIPTOR)(base + rva); - - while(pidesc->FirstThunk){ - impmodule = (PSTR)(base + pidesc->Name); - if(!lstrcmpi(module, impmodule)) break; - pidesc ++; - } - if(!pidesc->FirstThunk) { - if (IsDebug) OutTraceD("HookAPIbyName: PE unreferenced module=%s\n", module); - return 0; - } - if(!pidesc->OriginalFirstThunk) { - OutTraceD("HookAPIbyName: no PE OFTs - stripped module=%s\n", module); - return 0; - } - ptaddr = (PIMAGE_THUNK_DATA)(base + (DWORD)pidesc->FirstThunk); - ptname = (PIMAGE_THUNK_DATA)(base + (DWORD)pidesc->OriginalFirstThunk); - - while(ptaddr->u1.Function){ - if(!IMAGE_SNAP_BY_ORDINAL(ptname->u1.Ordinal)){ - piname = (PIMAGE_IMPORT_BY_NAME)(base + (DWORD)ptname->u1.AddressOfData); - if(!lstrcmpi(api, (char *)piname->Name)) break; - } - ptaddr ++; - 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)) { - OutTraceD("HookAPIbyName: VirtualProtect error %d at %d\n", GetLastError(), __LINE__); - return 0; - } - ptaddr->u1.Function = (DWORD)hookproc; - if(!VirtualProtect(&ptaddr->u1.Function, 4, oldprotect, &oldprotect)) { - OutTraceD("HookAPIbyName: VirtualProtect error %d at %d\n", GetLastError(), __LINE__); - return 0; - } - if (!FlushInstructionCache(GetCurrentProcess(), &ptaddr->u1.Function, 4)) { - OutTraceD("HookAPIbyName: FlushInstructionCache error %d at %d\n", GetLastError(), __LINE__); - return 0; - } - //OutTraceD("HookAPIbyName hook=%s.%s address=%x->%x\n", module, api, org, hookproc); - } - __except(EXCEPTION_EXECUTE_HANDLER) - { - OutTraceD("HookAPIbyName: EXCEPTION hook=%s:%s Hook Failed.\n", module, api); - org = 0; - } - return org; -} - void SetHook(void *target, void *hookproc, void **hookedproc, char *hookname) { void *tmp; @@ -547,6 +213,103 @@ void SetHook(void *target, void *hookproc, void **hookedproc, char *hookname) *hookedproc = tmp; } +void *HookAPI(const char *module, char *dll, void *apiproc, const char *apiname, void *hookproc) +{ + DWORD base; + PIMAGE_NT_HEADERS pnth; + PIMAGE_IMPORT_DESCRIPTOR pidesc; + DWORD rva; + PSTR impmodule; + PIMAGE_THUNK_DATA ptaddr; + PIMAGE_THUNK_DATA ptname; + PIMAGE_IMPORT_BY_NAME piname; + DWORD oldprotect; + void *org; + + 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)GetModuleHandle(module); + if(!base) { + OutTraceD("HookAPI: GetModuleHandle failed, error=%d\n",GetLastError()); + return 0; + } + __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_IMPORT].VirtualAddress; + if(!rva) { + OutTraceE("HookAPI: ERROR no rva at %d\n", __LINE__); + return 0; + } + pidesc = (PIMAGE_IMPORT_DESCRIPTOR)(base + rva); + + while(pidesc->FirstThunk){ + impmodule = (PSTR)(base + pidesc->Name); + if(!lstrcmpi(dll, impmodule)) break; + pidesc ++; + } + if(!pidesc->FirstThunk) { + if (IsDebug) OutTraceD("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) OutTraceD("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)) { + OutTraceD("HookAPI: VirtualProtect error %d at %d\n", GetLastError(), __LINE__); + return 0; + } + ptaddr->u1.Function = (DWORD)hookproc; + if(!VirtualProtect(&ptaddr->u1.Function, 4, oldprotect, &oldprotect)) { + OutTraceD("HookAPI: VirtualProtect error %d at %d\n", GetLastError(), __LINE__); + return 0; + } + if (!FlushInstructionCache(GetCurrentProcess(), &ptaddr->u1.Function, 4)) { + OutTraceD("HookAPI: FlushInstructionCache error %d at %d\n", GetLastError(), __LINE__); + return 0; + } + //OutTraceD("HookAPI hook=%s.%s address=%x->%x\n", module, apiname, org, hookproc); + } + __except(EXCEPTION_EXECUTE_HANDLER) + { + OutTraceD("HookAPI: EXCEPTION hook=%s:%s Hook Failed.\n", dll, apiname); + org = 0; + } + return org; +} + // v.2.1.80: unified positioning logic into CalculateWindowPos routine // now taking in account for window menus (see "Alien Cabal") @@ -557,14 +320,14 @@ void CalculateWindowPos(HWND hwnd, DWORD width, DWORD height, LPWINDOWPOS wp) int MaxX, MaxY; HMENU hMenu; - rect.left = iPosX; - rect.top = iPosY; - MaxX = iSizX; - MaxY = iSizY; + rect.left = dxw.iPosX; + rect.top = dxw.iPosX; + MaxX = dxw.iSizX; + MaxY = dxw.iSizY; if (!MaxX) MaxX = width; if (!MaxY) MaxY = height; - rect.right = iPosX+MaxX; - rect.bottom = iPosY+MaxY; + rect.right = dxw.iPosX+MaxX; + rect.bottom = dxw.iPosX+MaxY; dwStyle=(*pGetWindowLong)(hwnd, GWL_STYLE); hMenu = GetMenu(hwnd); @@ -637,7 +400,8 @@ void AdjustWindowFrame(HWND hwnd, DWORD width, DWORD height) // fixing cursor view and clipping region - if (dxw.dwFlags1 & HIDEHWCURSOR) while (ShowCursor(0) >= 0); + if (dxw.dwFlags1 & HIDEHWCURSOR) while ((*pShowCursor)(0) >= 0); + if (dxw.dwFlags2 & SHOWHWCURSOR) while((*pShowCursor)(1) < 0); if (dxw.dwFlags1 & CLIPCURSOR) { OutTraceD("AdjustWindowFrame: setting clip region\n"); dxw.SetClipCursor(); @@ -668,7 +432,6 @@ INT_PTR CALLBACK extDialogWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPA pWindowProc=WhndGetWindowProc(hwnd); if(pWindowProc) return(*pWindowProc)(hwnd, message, wparam, lparam); - //OutTraceD("ASSERT: DialogWinMsg pWindowProc=NULL !!!\n"); char *sMsg="ASSERT: DialogWinMsg pWindowProc=NULL !!!\n"; OutTraceD(sMsg); if (IsAssertEnabled) MessageBox(0, sMsg, "WindowProc", MB_OK | MB_ICONEXCLAMATION); @@ -737,10 +500,7 @@ static void dx_TogglePositionLock(HWND hwnd) (*pClientToScreen)(hwnd,&p); dxw.dwFlags1 |= LOCKWINPOS; OutTraceD("Toggle position lock ON\n"); - iPosX=(short)p.x; - iPosY=(short)p.y; - iSizX=(short)(rect.right-rect.left); - iSizY=(short)(rect.bottom-rect.top); + dxw.InitWindowPos(p.x, p.y, rect.right-rect.left, rect.bottom-rect.top); } } @@ -758,7 +518,6 @@ void dx_ToggleDC() LRESULT LastCursorPos; - LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) { POINT prev, curr; @@ -772,6 +531,25 @@ LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp // v2.1.93: adjust clipping region OutTraceW("WindowProc: WinMsg=[0x%x]%s(%x,%x)\n", message, ExplainWinMessage(message), wparam, lparam); + +#if 0 + if(dxw.dwFlags2 & WALLPAPERMODE) { + static int t=0; + if ((*pGetTickCount)() - t > 100){ + //if (GetTopWindow(NULL)==hwnd){ + { + (*pSetWindowPos)(hwnd, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE); + t = (*pGetTickCount)(); + } + } + //if ((message >= WM_MOUSEFIRST) && (message <= WM_MOUSELAST)) return 0; + //if (message == WM_WINDOWPOSCHANGED) { + // t=0; + // return 0; + //} + } +#endif + switch(message){ case WM_NCHITTEST: if((dxw.dwFlags2 & FIXNCHITTEST) && (dxw.dwFlags1 & MODIFYMOUSE)){ // mouse processing @@ -806,12 +584,13 @@ LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp dxwFixWindowPos("WindowProc", hwnd, lparam); break; case WM_ENTERSIZEMOVE: - while(ShowCursor(1) < 0); + while((*pShowCursor)(1) < 0); if(dxw.dwFlags1 & CLIPCURSOR) dxw.EraseClipCursor(); if(dxw.dwFlags1 & ENABLECLIPPING) (*pClipCursor)(NULL); break; case WM_EXITSIZEMOVE: - if (dxw.dwFlags1 & HIDEHWCURSOR) while(ShowCursor(0) >= 0); + if (dxw.dwFlags1 & HIDEHWCURSOR) while((*pShowCursor)(0) >= 0); + if (dxw.dwFlags2 & SHOWHWCURSOR) while((*pShowCursor)(1) < 0); if(dxw.dwFlags1 & ENABLECLIPPING) extClipCursor(lpClipRegion); if(dxw.dwFlags2 & REFRESHONRESIZE) dxw.ScreenRefresh(); break; @@ -830,7 +609,7 @@ LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp // This message is posted to the window that contains the cursor. // If a window has captured the mouse, this message is not posted. // V2.1.90: on nonclient areas the cursor is always shown. - while(ShowCursor(1) < 0); + while((*pShowCursor)(1) < 0); break; case WM_MOUSEMOVE: prev.x = LOWORD(lparam); @@ -838,12 +617,12 @@ LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp if (dxw.dwFlags1 & HIDEHWCURSOR) { (*pGetClientRect)(hwnd, &rect); if(prev.x >= 0 && prev.x < rect.right && prev.y >= 0 && prev.y < rect.bottom) - while(ShowCursor(0) >= 0); + while((*pShowCursor)(0) >= 0); else - while(ShowCursor(1) < 0); + while((*pShowCursor)(1) < 0); } else { - while(ShowCursor(1) < 0); + while((*pShowCursor)(1) < 0); } if(dxw.dwFlags1 & MODIFYMOUSE){ // mouse processing // scale mouse coordinates @@ -874,7 +653,6 @@ LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp } break; case WM_SETFOCUS: - //if (dxw.dwFlags1 & CLIPCURSOR) if (ClipCursorToggleState) dxw.SetClipCursor(); if (dxw.dwFlags1 & ENABLECLIPPING) extClipCursor(lpClipRegion); break; case WM_KILLFOCUS: @@ -882,11 +660,8 @@ LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp if (dxw.dwFlags1 & ENABLECLIPPING) (*pClipCursor)(NULL); break; case WM_CLOSE: - //if (dxw.dwFlags1 & HANDLECOSEICON) { - { - OutTraceD("WindowProc: WM_CLOSE - terminating process\n"); - TerminateProcess(GetCurrentProcess(),0); - } + OutTraceD("WindowProc: WM_CLOSE - terminating process\n"); + TerminateProcess(GetCurrentProcess(),0); break; case WM_SYSKEYDOWN: OutTraceW("event WM_SYSKEYDOWN wparam=%x lparam=%x\n", wparam, lparam); @@ -916,23 +691,14 @@ LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp } break; case VK_F5: - //case '+': - if ((dxw.dwFlags2 & TIMESTRETCH) && (dxw.TimeShift < 4)) { - dxw.TimeShift++; - if(dxw.TimeShift > 0) - OutTrace("Time Stretch: speed %dx slow\n", 1 << dxw.TimeShift); - else - OutTrace("Time Stretch: speed %dx quick\n", 1 << (-dxw.TimeShift)); - } - break; case VK_F6: - //case '-': - if ((dxw.dwFlags2 & TIMESTRETCH) && (dxw.TimeShift > -4)) { - dxw.TimeShift--; - if(dxw.TimeShift > 0) - OutTrace("Time Stretch: speed %dx slow\n", 1 << dxw.TimeShift); - else - OutTrace("Time Stretch: speed %dx quick\n", 1 << (-dxw.TimeShift)); + if (dxw.dwFlags2 & TIMESTRETCH) { + char *sTSCaption[9]={"x16","x8","x4","x2","x1",":2",":4",":8",":16"}; + if (wparam == VK_F5 && (dxw.TimeShift < 4)) dxw.TimeShift++; + if (wparam == VK_F6 && (dxw.TimeShift > -4)) dxw.TimeShift--; + OutTrace("Time Stretch: shift=%d speed=%s\n", dxw.TimeShift, sTSCaption[dxw.TimeShift+4]); + DxWndStatus.iTimeShift=dxw.TimeShift; + SetHookStatus(&DxWndStatus); } break; default: @@ -981,37 +747,21 @@ LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp return (*pDefWindowProc)(hwnd, message, wparam, lparam); } -void *HookAPI(const char *module, void *apiproc, const char *apiname, void *hookproc) -{ - void *hookaddr; - //OutTraceD("Hooking %s:%s addr=%x\n", module, apiname, apiproc); - hookaddr=NULL; - if (apiproc) - hookaddr=HookAPIbyAddr(module, apiproc, hookproc); - //else - if(!hookaddr) - hookaddr=HookAPIbyName(module, apiname, hookproc); - - if (hookaddr) OutTraceD("Hooked %s:%s %x->%x\n", module, apiname, apiproc, hookproc); - return hookaddr; -} - void HookSysLibsInit() { pLoadLibraryA = LoadLibrary; pGetProcAddress = (GetProcAddress_Type)GetProcAddress; - pCreateCompatibleDC=CreateCompatibleDC; - pDeleteDC=DeleteDC; + pGDICreateCompatibleDC=CreateCompatibleDC; + pGDIDeleteDC=DeleteDC; pGDIGetDC=GetDC; pGDIGetWindowDC=GetWindowDC; pGDIReleaseDC=ReleaseDC; - pCreateDC=CreateDC; - pBitBlt=BitBlt; - pStretchBlt=StretchBlt; + pGDICreateDC=CreateDC; + pGDIBitBlt=BitBlt; + pGDIStretchBlt=StretchBlt; pBeginPaint=BeginPaint; pEndPaint=EndPaint; pInvalidateRect=InvalidateRect; - pInvalidateRgn=InvalidateRgn; pScreenToClient = ScreenToClient; pClientToScreen = ClientToScreen; pGetClientRect = GetClientRect; @@ -1023,26 +773,24 @@ void HookSysLibsInit() pFillRect = FillRect; pPeekMessage = PeekMessage; pGetMessage = GetMessage; - pDispatchMessage = (DispatchMessage_Type)DispatchMessage; pDefWindowProc = DefWindowProc; - pGetDeviceCaps = GetDeviceCaps; - pTextOutA = TextOutA; - pScaleWindowExtEx = ScaleWindowExtEx; + pGDIGetDeviceCaps = GetDeviceCaps; + pGDITextOutA = TextOutA; + pGDIScaleWindowExtEx = ScaleWindowExtEx; pCreateWindowExA = CreateWindowExA; pRegisterClassExA = (RegisterClassExA_Type)RegisterClassExA; - pRectangle = Rectangle; + pGDIRectangle = Rectangle; pSetWindowPos=SetWindowPos; - pDeferWindowPos=DeferWindowPos; + pGDIDeferWindowPos=DeferWindowPos; pSetWindowLong=SetWindowLongA; pGetWindowLong=GetWindowLongA; pCallWindowProc=CallWindowProcA; pShowWindow=ShowWindow; - pSetTextColor = SetTextColor; - pSetBkColor = SetBkColor; - pCreateFont = CreateFont; - pCreateFontIndirect = CreateFontIndirect; + pGDISetTextColor = SetTextColor; + pGDISetBkColor = SetBkColor; + pGDICreateFont = CreateFont; + pGDICreateFontIndirect = CreateFontIndirect; pGetSystemMetrics = GetSystemMetrics; - //pColorCorrectPalette = ColorCorrectPalette; pGetCursorPos = GetCursorPos; pSetCursorPos = SetCursorPos; pSetCursor = SetCursor; @@ -1050,222 +798,225 @@ void HookSysLibsInit() pCreateDialogParam=CreateDialogParamA; pMoveWindow=MoveWindow; pGetDesktopWindow=GetDesktopWindow; + pShowCursor=ShowCursor; pGetTickCount=GetTickCount; + pSleep=Sleep; + pSleepEx=SleepEx; + pGetSystemTime=GetSystemTime; + pGetLocalTime=GetLocalTime; + pSetTimer=SetTimer; +} + +void HookGDILib(char *module) +{ + void *tmp; + + if(dxw.dwFlags1 & MAPGDITOPRIMARY){ + tmp = HookAPI(module, "GDI32.dll", CreateCompatibleDC, "CreateCompatibleDC", extDDCreateCompatibleDC); + if(tmp) pGDICreateCompatibleDC = (CreateCompatibleDC_Type)tmp; + tmp = HookAPI(module, "GDI32.dll", DeleteDC, "DeleteDC", extDDDeleteDC); + if(tmp) pGDIDeleteDC = (DeleteDC_Type)tmp; + tmp = HookAPI(module, "GDI32.dll", CreateDCA, "CreateDCA", extDDCreateDC); + if(tmp) pGDICreateDC = (CreateDC_Type)tmp; + tmp = HookAPI(module, "GDI32.dll", BitBlt, "BitBlt", extDDBitBlt); + if(tmp) pGDIBitBlt = (BitBlt_Type)tmp; + tmp = HookAPI(module, "GDI32.dll", StretchBlt, "StretchBlt", extDDStretchBlt); + if(tmp) pGDIStretchBlt = (StretchBlt_Type)tmp; + } + else { + tmp = HookAPI(module, "GDI32.dll", CreateCompatibleDC, "CreateCompatibleDC", extGDICreateCompatibleDC); + if(tmp) pGDICreateCompatibleDC = (CreateCompatibleDC_Type)tmp; + tmp = HookAPI(module, "GDI32.dll", DeleteDC, "DeleteDC", extGDIDeleteDC); + if(tmp) pGDIDeleteDC = (DeleteDC_Type)tmp; + tmp = HookAPI(module, "GDI32.dll", CreateDCA, "CreateDCA", extGDICreateDC); + if(tmp) pGDICreateDC = (CreateDC_Type)tmp; + tmp = HookAPI(module, "GDI32.dll", BitBlt, "BitBlt", extGDIBitBlt); + if(tmp) pGDIBitBlt = (BitBlt_Type)tmp; + tmp = HookAPI(module, "GDI32.dll", StretchBlt, "StretchBlt", extGDIStretchBlt); + if(tmp) pGDIStretchBlt = (StretchBlt_Type)tmp; + tmp = HookAPI(module, "GDI32.dll", PatBlt, "PatBlt", extGDIPatBlt); + if(tmp) pGDIPatBlt = (PatBlt_Type)tmp; + } + tmp = HookAPI(module, "GDI32.dll", GetDeviceCaps, "GetDeviceCaps", extGetDeviceCaps); // GHO: added for caesar3 + if(tmp) pGDIGetDeviceCaps = (GetDeviceCaps_Type)tmp; + tmp = HookAPI(module, "GDI32.dll", TextOutA, "TextOutA", extTextOutA); + if(tmp) pGDITextOutA = (TextOut_Type)tmp; + tmp = HookAPI(module, "GDI32.dll", ScaleWindowExtEx, "ScaleWindowExtEx", extScaleWindowExtEx); + if(tmp) pGDIScaleWindowExtEx = (ScaleWindowExtEx_Type)tmp; + tmp = HookAPI(module, "GDI32.dll", Rectangle, "Rectangle", extRectangle); + if(tmp) pGDIRectangle = (Rectangle_Type)tmp; + tmp = HookAPI(module, "GDI32.dll", SaveDC, "SaveDC", extGDISaveDC); + if(tmp) pGDISaveDC = (SaveDC_Type)tmp; + tmp = HookAPI(module, "GDI32.dll", RestoreDC, "RestoreDC", extGDIRestoreDC); + if(tmp) pGDIRestoreDC = (RestoreDC_Type)tmp; + tmp = HookAPI(module, "GDI32.dll", CreatePalette, "CreatePalette", extGDICreatePalette); + if(tmp) pGDICreatePalette = (GDICreatePalette_Type)tmp; + tmp = HookAPI(module, "GDI32.dll", SelectPalette, "SelectPalette", extSelectPalette); + if(tmp) pGDISelectPalette = (SelectPalette_Type)tmp; + tmp = HookAPI(module, "GDI32.dll", RealizePalette, "RealizePalette", extRealizePalette); + if(tmp) pGDIRealizePalette = (RealizePalette_Type)tmp; + tmp = HookAPI(module, "GDI32.dll", GetSystemPaletteEntries, "GetSystemPaletteEntries", extGetSystemPaletteEntries); + if(tmp) pGDIGetSystemPaletteEntries = (GetSystemPaletteEntries_Type)tmp; + if ((dxw.dwFlags1 & EMULATESURFACE) && (dxw.dwFlags1 & HANDLEDC)){ + tmp = HookAPI(module, "GDI32.dll", SetTextColor, "SetTextColor", extSetTextColor); + if(tmp) pGDISetTextColor = (SetTextColor_Type)tmp; + tmp = HookAPI(module, "GDI32.dll", SetBkColor, "SetBkColor", extSetBkColor); + if(tmp) pGDISetBkColor = (SetBkColor_Type)tmp; + tmp = HookAPI(module, "GDI32.dll", CreateFont, "CreateFont", extCreateFont); + if(tmp) pGDICreateFont = (CreateFont_Type)tmp; + tmp = HookAPI(module, "GDI32.dll", CreateFontIndirectA, "CreateFontIndirectA", extCreateFontIndirect); + if(tmp) pGDICreateFontIndirect = (CreateFontIndirect_Type)tmp; + } + + if(dxw.dwFlags2 & DISABLEGAMMARAMP){ + tmp = HookAPI(module, "GDI32.dll", SetDeviceGammaRamp, "SetDeviceGammaRamp", extSetDeviceGammaRamp); + if(tmp) pGDISetDeviceGammaRamp = (SetDeviceGammaRamp_Type)tmp; + tmp = HookAPI(module, "GDI32.dll", GetDeviceGammaRamp, "GetDeviceGammaRamp", extGetDeviceGammaRamp); + if(tmp) pGDIGetDeviceGammaRamp = (GetDeviceGammaRamp_Type)tmp; + } } void HookSysLibs(char *module) { void *tmp; - tmp = HookAPI("KERNEL32.dll", GetProcAddress, "GetProcAddress", extGetProcAddress); + tmp = HookAPI(module, "kernel32.dll", GetProcAddress, "GetProcAddress", extGetProcAddress); if(tmp) pGetProcAddress = (GetProcAddress_Type)tmp; - - tmp = HookAPI("kernel32.dll", LoadLibraryA, "LoadLibraryA", extLoadLibraryA); + tmp = HookAPI(module, "kernel32.dll", LoadLibraryA, "LoadLibraryA", extLoadLibraryA); if(tmp) pLoadLibraryA = (LoadLibraryA_Type)tmp; - tmp = HookAPI("kernel32.dll", LoadLibraryExA, "LoadLibraryExA", extLoadLibraryExA); + tmp = HookAPI(module, "kernel32.dll", LoadLibraryExA, "LoadLibraryExA", extLoadLibraryExA); if(tmp) pLoadLibraryExA = (LoadLibraryExA_Type)tmp; - tmp = HookAPI("user32.dll", BeginPaint, "BeginPaint", extBeginPaint); + tmp = HookAPI(module, "user32.dll", BeginPaint, "BeginPaint", extBeginPaint); if(tmp) pBeginPaint = (BeginPaint_Type)tmp; - tmp = HookAPI("user32.dll", EndPaint, "EndPaint", extEndPaint); + tmp = HookAPI(module, "user32.dll", EndPaint, "EndPaint", extEndPaint); if(tmp) pEndPaint = (EndPaint_Type)tmp; + tmp = HookAPI(module, "user32.dll", ShowCursor, "ShowCursor", extShowCursor); + if(tmp) pShowCursor = (ShowCursor_Type)tmp; if(dxw.dwFlags1 & MAPGDITOPRIMARY){ - tmp = HookAPI("GDI32.dll", CreateCompatibleDC, "CreateCompatibleDC", extDDCreateCompatibleDC); - if(tmp) pCreateCompatibleDC = (CreateCompatibleDC_Type)tmp; - tmp = HookAPI("GDI32.dll", DeleteDC, "DeleteDC", extDDDeleteDC); - if(tmp) pDeleteDC = (DeleteDC_Type)tmp; - tmp = HookAPI("user32.dll", GetDC, "GetDC", extDDGetDC); + tmp = HookAPI(module, "user32.dll", GetDC, "GetDC", extDDGetDC); if(tmp) pGDIGetDC = (GDIGetDC_Type)tmp; - tmp = HookAPI("user32.dll", GetWindowDC, "GetWindowDC", extDDGetWindowDC); + tmp = HookAPI(module, "user32.dll", GetWindowDC, "GetWindowDC", extDDGetWindowDC); if(tmp) pGDIGetWindowDC = (GDIGetDC_Type)tmp; - tmp = HookAPI("user32.dll", ReleaseDC, "ReleaseDC", extDDReleaseDC); + tmp = HookAPI(module, "user32.dll", ReleaseDC, "ReleaseDC", extDDReleaseDC); if(tmp) pGDIReleaseDC = (GDIReleaseDC_Type)tmp; - tmp = HookAPI("GDI32.dll", CreateDCA, "CreateDCA", extDDCreateDC); - if(tmp) pCreateDC = (CreateDC_Type)tmp; - tmp = HookAPI("GDI32.dll", BitBlt, "BitBlt", extDDBitBlt); - if(tmp) pBitBlt = (BitBlt_Type)tmp; - tmp = HookAPI("GDI32.dll", StretchBlt, "StretchBlt", extDDStretchBlt); - if(tmp) pStretchBlt = (StretchBlt_Type)tmp; - tmp = HookAPI("user32.dll", InvalidateRect, "InvalidateRect", extDDInvalidateRect); + tmp = HookAPI(module, "user32.dll", InvalidateRect, "InvalidateRect", extDDInvalidateRect); if(tmp) pInvalidateRect = (InvalidateRect_Type)tmp; } else{ - tmp = HookAPI("GDI32.dll", CreateCompatibleDC, "CreateCompatibleDC", extGDICreateCompatibleDC); - if(tmp) pCreateCompatibleDC = (CreateCompatibleDC_Type)tmp; - tmp = HookAPI("GDI32.dll", DeleteDC, "DeleteDC", extGDIDeleteDC); - if(tmp) pDeleteDC = (DeleteDC_Type)tmp; - tmp = HookAPI("user32.dll", GetDC, "GetDC", extGDIGetDC); + tmp = HookAPI(module, "user32.dll", GetDC, "GetDC", extGDIGetDC); if(tmp) pGDIGetDC = (GDIGetDC_Type)tmp; - tmp = HookAPI("user32.dll", GetWindowDC, "GetWindowDC", extGDIGetWindowDC); + tmp = HookAPI(module, "user32.dll", GetWindowDC, "GetWindowDC", extGDIGetWindowDC); if(tmp) pGDIGetWindowDC = (GDIGetDC_Type)tmp; - tmp = HookAPI("user32.dll", ReleaseDC, "ReleaseDC", extGDIReleaseDC); + tmp = HookAPI(module, "user32.dll", ReleaseDC, "ReleaseDC", extGDIReleaseDC); if(tmp) pGDIReleaseDC = (GDIReleaseDC_Type)tmp; - tmp = HookAPI("GDI32.dll", CreateDCA, "CreateDCA", extGDICreateDC); - if(tmp) pCreateDC = (CreateDC_Type)tmp; - tmp = HookAPI("GDI32.dll", BitBlt, "BitBlt", extGDIBitBlt); - if(tmp) pBitBlt = (BitBlt_Type)tmp; - tmp = HookAPI("GDI32.dll", StretchBlt, "StretchBlt", extGDIStretchBlt); - if(tmp) pStretchBlt = (StretchBlt_Type)tmp; - tmp = HookAPI("GDI32.dll", PatBlt, "PatBlt", extGDIPatBlt); - if(tmp) pPatBlt = (PatBlt_Type)tmp; - tmp = HookAPI("user32.dll", InvalidateRect, "InvalidateRect", extInvalidateRect); + tmp = HookAPI(module, "user32.dll", InvalidateRect, "InvalidateRect", extInvalidateRect); if(tmp) pInvalidateRect = (InvalidateRect_Type)tmp; - //tmp = HookAPI("user32.dll", InvalidateRgn, "InvalidateRgn", extInvalidateRgn); - //if(tmp) pInvalidateRgn = (InvalidateRgn_Type)tmp; } if (dxw.dwFlags1 & CLIENTREMAPPING){ - tmp = HookAPI("user32.dll", ScreenToClient, "ScreenToClient", extScreenToClient); + tmp = HookAPI(module, "user32.dll", ScreenToClient, "ScreenToClient", extScreenToClient); if(tmp) pScreenToClient = (ScreenToClient_Type)tmp; - tmp = HookAPI("user32.dll", ClientToScreen, "ClientToScreen", extClientToScreen); + tmp = HookAPI(module, "user32.dll", ClientToScreen, "ClientToScreen", extClientToScreen); if(tmp) pClientToScreen = (ClientToScreen_Type)tmp; - tmp = HookAPI("user32.dll", GetClientRect, "GetClientRect", extGetClientRect); + tmp = HookAPI(module, "user32.dll", GetClientRect, "GetClientRect", extGetClientRect); if(tmp) pGetClientRect = (GetClientRect_Type)tmp; - tmp = HookAPI("user32.dll", GetWindowRect, "GetWindowRect", extGetWindowRect); + tmp = HookAPI(module, "user32.dll", GetWindowRect, "GetWindowRect", extGetWindowRect); if(tmp) pGetWindowRect = (GetWindowRect_Type)tmp; - tmp = HookAPI("user32.dll", MapWindowPoints, "MapWindowPoints", extMapWindowPoints); + tmp = HookAPI(module, "user32.dll", MapWindowPoints, "MapWindowPoints", extMapWindowPoints); if(tmp) pMapWindowPoints = (MapWindowPoints_Type)tmp; } // get / change display settings - tmp = HookAPI("user32.dll", ChangeDisplaySettingsA, "ChangeDisplaySettingsA", extChangeDisplaySettings); + tmp = HookAPI(module, "user32.dll", ChangeDisplaySettingsA, "ChangeDisplaySettingsA", extChangeDisplaySettings); if(tmp) pChangeDisplaySettings = (ChangeDisplaySettings_Type)tmp; - tmp = HookAPI("user32.dll", ChangeDisplaySettingsExA, "ChangeDisplaySettingsExA", extChangeDisplaySettingsEx); + tmp = HookAPI(module, "user32.dll", ChangeDisplaySettingsExA, "ChangeDisplaySettingsExA", extChangeDisplaySettingsEx); if(tmp) pChangeDisplaySettingsEx = (ChangeDisplaySettingsEx_Type)tmp; - tmp = HookAPI("user32.dll", EnumDisplaySettingsA, "EnumDisplaySettingsA", extEnumDisplaySettings); + tmp = HookAPI(module, "user32.dll", EnumDisplaySettingsA, "EnumDisplaySettingsA", extEnumDisplaySettings); if(tmp) pEnumDisplaySettings = (EnumDisplaySettings_Type)tmp; // handle cursor clipping - tmp = HookAPI("user32.dll", GetClipCursor, "GetClipCursor", extGetClipCursor); + tmp = HookAPI(module, "user32.dll", GetClipCursor, "GetClipCursor", extGetClipCursor); if(tmp) pGetClipCursor = (GetClipCursor_Type)tmp; - tmp = HookAPI("user32.dll", ClipCursor, "ClipCursor", extClipCursor); + tmp = HookAPI(module, "user32.dll", ClipCursor, "ClipCursor", extClipCursor); if(tmp) pClipCursor = (ClipCursor_Type)tmp; - tmp = HookAPI("user32.dll", FillRect, "FillRect", extFillRect); + tmp = HookAPI(module, "user32.dll", FillRect, "FillRect", extFillRect); if(tmp) pFillRect = (FillRect_Type)tmp; if (dxw.dwFlags1 & MESSAGEPROC) { - tmp = HookAPI("user32.dll", PeekMessageA, "PeekMessageA", extPeekMessage); // added for GPL + tmp = HookAPI(module, "user32.dll", PeekMessageA, "PeekMessageA", extPeekMessage); // added for GPL if(tmp) pPeekMessage = (PeekMessage_Type)tmp; - tmp = HookAPI("user32.dll", GetMessageA, "GetMessageA", extGetMessage); // added for GPL + tmp = HookAPI(module, "user32.dll", GetMessageA, "GetMessageA", extGetMessage); // added for GPL if(tmp) pGetMessage = (GetMessage_Type)tmp; - //tmp = HookAPI("user32.dll", DispatchMessageA, "DispatchMessageA", extDispatchMessage); // added for GPL - //if(tmp) pDispatchMessage = (DispatchMessage_Type)tmp; } - tmp = HookAPI("user32.dll", DefWindowProcA, "DefWindowProcA", extDefWindowProc); // added for WarWind background erase + tmp = HookAPI(module, "user32.dll", DefWindowProcA, "DefWindowProcA", extDefWindowProc); // added for WarWind background erase if(tmp) pDefWindowProc = (DefWindowProc_Type)tmp; - tmp = HookAPI("GDI32.dll", GetDeviceCaps, "GetDeviceCaps", extGetDeviceCaps); // GHO: added for caesar3 - if(tmp) pGetDeviceCaps = (GetDeviceCaps_Type)tmp; - tmp = HookAPI("GDI32.dll", TextOutA, "TextOutA", extTextOutA); - if(tmp) pTextOutA = (TextOut_Type)tmp; - tmp = HookAPI("GDI32.dll", ScaleWindowExtEx, "ScaleWindowExtEx", extScaleWindowExtEx); - if(tmp) pScaleWindowExtEx = (ScaleWindowExtEx_Type)tmp; - tmp = HookAPI("user32.dll", CreateWindowExA, "CreateWindowExA", extCreateWindowExA); + tmp = HookAPI(module, "user32.dll", CreateWindowExA, "CreateWindowExA", extCreateWindowExA); if(tmp) pCreateWindowExA = (CreateWindowExA_Type)tmp; - tmp = HookAPI("user32.dll", RegisterClassExA, "RegisterClassExA", extRegisterClassExA); + tmp = HookAPI(module, "user32.dll", RegisterClassExA, "RegisterClassExA", extRegisterClassExA); if(tmp) pRegisterClassExA = (RegisterClassExA_Type)tmp; - tmp = HookAPI("GDI32.dll", Rectangle, "Rectangle", extRectangle); - if(tmp) pRectangle = (Rectangle_Type)tmp; if (dxw.dwFlags1 & (PREVENTMAXIMIZE|FIXWINFRAME|LOCKWINPOS|LOCKWINSTYLE)){ - tmp = HookAPI("user32.dll", ShowWindow, "ShowWindow", extShowWindow); + tmp = HookAPI(module, "user32.dll", ShowWindow, "ShowWindow", extShowWindow); if(tmp) pShowWindow = (ShowWindow_Type)tmp; - tmp = HookAPI("user32.dll", SetWindowLongA, "SetWindowLongA", extSetWindowLong); + tmp = HookAPI(module, "user32.dll", SetWindowLongA, "SetWindowLongA", extSetWindowLong); if(tmp) pSetWindowLong = (SetWindowLong_Type)tmp; - tmp = HookAPI("user32.dll", GetWindowLongA, "GetWindowLongA", extGetWindowLong); + tmp = HookAPI(module, "user32.dll", GetWindowLongA, "GetWindowLongA", extGetWindowLong); if(tmp) pGetWindowLong = (GetWindowLong_Type)tmp; - tmp = HookAPI("user32.dll", SetWindowPos, "SetWindowPos", extSetWindowPos); + tmp = HookAPI(module, "user32.dll", SetWindowPos, "SetWindowPos", extSetWindowPos); if(tmp) pSetWindowPos = (SetWindowPos_Type)tmp; - tmp = HookAPI("user32.dll", DeferWindowPos, "DeferWindowPos", extDeferWindowPos); - if(tmp) pDeferWindowPos = (DeferWindowPos_Type)tmp; - tmp = HookAPI("user32.dll", CallWindowProcA, "CallWindowProcA", extCallWindowProc); + tmp = HookAPI(module, "user32.dll", DeferWindowPos, "DeferWindowPos", extDeferWindowPos); + if(tmp) pGDIDeferWindowPos = (DeferWindowPos_Type)tmp; + tmp = HookAPI(module, "user32.dll", CallWindowProcA, "CallWindowProcA", extCallWindowProc); if(tmp) pCallWindowProc = (CallWindowProc_Type)tmp; - - //tmp = HookAPI("user32.dll", SetWindowPlacement, "SetWindowPlacement", extSetWindowPlacement); - //if(tmp) pSetWindowPlacement = (SetWindowPlacement_Type)tmp; } - if ((dxw.dwFlags1 & EMULATESURFACE) && (dxw.dwFlags1 & HANDLEDC)){ - tmp = HookAPI("GDI32.dll", SetTextColor, "SetTextColor", extSetTextColor); - if(tmp) pSetTextColor = (SetTextColor_Type)tmp; - tmp = HookAPI("GDI32.dll", SetBkColor, "SetBkColor", extSetBkColor); - if(tmp) pSetBkColor = (SetBkColor_Type)tmp; - tmp = HookAPI("GDI32.dll", CreateFont, "CreateFont", extCreateFont); - if(tmp) pCreateFont = (CreateFont_Type)tmp; - tmp = HookAPI("GDI32.dll", CreateFontIndirectA, "CreateFontIndirectA", extCreateFontIndirect); - if(tmp) pCreateFontIndirect = (CreateFontIndirect_Type)tmp; - } - tmp = HookAPI("user32.dll", GetSystemMetrics, "GetSystemMetrics", extGetSystemMetrics); + tmp = HookAPI(module, "user32.dll", GetSystemMetrics, "GetSystemMetrics", extGetSystemMetrics); if(tmp) pGetSystemMetrics = (GetSystemMetrics_Type)tmp; - //tmp = HookAPI("GDI32.dll", ColorCorrectPalette, "ColorCorrectPalette", extColorCorrectPalette); - //if(tmp) pColorCorrectPalette = (ColorCorrectPalette_Type)tmp; - // ATTEMPT TO FIX WORMS SERIES PROBLEMS - tmp = HookAPI("user32.dll", GetDesktopWindow, "GetDesktopWindow", extGetDesktopWindow); + tmp = HookAPI(module, "user32.dll", GetDesktopWindow, "GetDesktopWindow", extGetDesktopWindow); if(tmp) pGetDesktopWindow = (GetDesktopWindow_Type)tmp; if(dxw.dwFlags1 & MODIFYMOUSE){ - tmp = HookAPI("user32.dll", GetCursorPos, "GetCursorPos", extGetCursorPos); + tmp = HookAPI(module, "user32.dll", GetCursorPos, "GetCursorPos", extGetCursorPos); if(tmp) pGetCursorPos = (GetCursorPos_Type)tmp; - //tmp = HookAPI("user32.dll", GetPhysicalCursorPos, "", extGetCursorPos); - tmp = HookAPI("user32.dll", SetCursor, "SetCursor", extSetCursor); + //tmp = HookAPI(module, "user32.dll", GetPhysicalCursorPos, "", extGetCursorPos); + tmp = HookAPI(module, "user32.dll", SetCursor, "SetCursor", extSetCursor); if(tmp) pSetCursor = (SetCursor_Type)tmp; - //tmp = HookAPI("user32.dll", SetPhysicalCursorPos, "", extSetCursorPos); - tmp = HookAPI("user32.dll", SendMessageA, "SendMessageA", extSendMessage); + //tmp = HookAPI(module, "user32.dll", SetPhysicalCursorPos, "", extSetCursorPos); + tmp = HookAPI(module, "user32.dll", SendMessageA, "SendMessageA", extSendMessage); if(tmp) pSendMessage = (SendMessage_Type)tmp; } + if((dxw.dwFlags1 & (MODIFYMOUSE|SLOWDOWN|KEEPCURSORWITHIN)) || (dxw.dwFlags2 & KEEPCURSORFIXED)){ - tmp = HookAPI("user32.dll", SetCursorPos, "SetCursorPos", extSetCursorPos); + tmp = HookAPI(module, "user32.dll", SetCursorPos, "SetCursorPos", extSetCursorPos); if(tmp) pSetCursorPos = (SetCursorPos_Type)tmp; } - if(1){ - tmp = HookAPI("GDI32.dll", SaveDC, "SaveDC", extGDISaveDC); - if(tmp) pGDISaveDC = (SaveDC_Type)tmp; - tmp = HookAPI("GDI32.dll", RestoreDC, "RestoreDC", extGDIRestoreDC); - if(tmp) pGDIRestoreDC = (RestoreDC_Type)tmp; - - tmp = HookAPI("user32.dll", CreateDialogIndirectParamA, "CreateDialogIndirectParamA", extCreateDialogIndirectParam); - if(tmp) pCreateDialogIndirectParam = (CreateDialogIndirectParam_Type)tmp; - tmp = HookAPI("user32.dll", CreateDialogParamA, "CreateDialogParamA", extCreateDialogParam); - if(tmp) pCreateDialogParam = (CreateDialogParam_Type)tmp; - } - - if(1){ - tmp = HookAPI("GDI32.dll", CreatePalette, "CreatePalette", extGDICreatePalette); - if(tmp) pGDICreatePalette = (GDICreatePalette_Type)tmp; - tmp = HookAPI("GDI32.dll", SelectPalette, "SelectPalette", extSelectPalette); - if(tmp) pSelectPalette = (SelectPalette_Type)tmp; - tmp = HookAPI("GDI32.dll", RealizePalette, "RealizePalette", extRealizePalette); - if(tmp) pRealizePalette = (RealizePalette_Type)tmp; - tmp = HookAPI("GDI32.dll", GetSystemPaletteEntries, "GetSystemPaletteEntries", extGetSystemPaletteEntries); - if(tmp) pGetSystemPaletteEntries = (GetSystemPaletteEntries_Type)tmp; - } - - // just in case you would have to inhibit mouse capture - if(0){ - tmp = HookAPI("user32.dll", SetCapture, "SetCapture", extSetCapture); - tmp = HookAPI("user32.dll", ReleaseCapture, "ReleaseCapture", extReleaseCapture); - } - - if(1){ - tmp = HookAPI("USER32.dll", MoveWindow, "MoveWindow", extMoveWindow); - if(tmp) pMoveWindow = (MoveWindow_Type)tmp; - } - - if(dxw.dwFlags2 & DISABLEGAMMARAMP){ - tmp = HookAPI("GDI32.dll", SetDeviceGammaRamp, "SetDeviceGammaRamp", extSetDeviceGammaRamp); - if(tmp) pSetDeviceGammaRamp = (SetDeviceGammaRamp_Type)tmp; - tmp = HookAPI("GDI32.dll", GetDeviceGammaRamp, "GetDeviceGammaRamp", extGetDeviceGammaRamp); - if(tmp) pGetDeviceGammaRamp = (GetDeviceGammaRamp_Type)tmp; - } + tmp = HookAPI(module, "user32.dll", CreateDialogIndirectParamA, "CreateDialogIndirectParamA", extCreateDialogIndirectParam); + if(tmp) pCreateDialogIndirectParam = (CreateDialogIndirectParam_Type)tmp; + tmp = HookAPI(module, "user32.dll", CreateDialogParamA, "CreateDialogParamA", extCreateDialogParam); + if(tmp) pCreateDialogParam = (CreateDialogParam_Type)tmp; + tmp = HookAPI(module, "user32.dll", MoveWindow, "MoveWindow", extMoveWindow); + if(tmp) pMoveWindow = (MoveWindow_Type)tmp; #define TRAPLOWRESOURCES 0 if(TRAPLOWRESOURCES){ - tmp = HookAPI("kernel32.dll", GetDiskFreeSpaceA, "GetDiskFreeSpaceA", extGetDiskFreeSpaceA); + tmp = HookAPI(module, "kernel32.dll", GetDiskFreeSpaceA, "GetDiskFreeSpaceA", extGetDiskFreeSpaceA); if(tmp) pGetDiskFreeSpaceA = (GetDiskFreeSpaceA_Type)tmp; } if(dxw.dwFlags2 & TIMESTRETCH){ - tmp = HookAPI("kernel32.dll", GetTickCount, "GetTickCount", extGetTickCount); + tmp = HookAPI(module, "kernel32.dll", GetTickCount, "GetTickCount", extGetTickCount); if(tmp) pGetTickCount = (GetTickCount_Type)tmp; + tmp = HookAPI(module, "kernel32.dll", GetLocalTime, "GetLocalTime", extGetLocalTime); + if(tmp) pGetLocalTime = (GetLocalTime_Type)tmp; + tmp = HookAPI(module, "kernel32.dll", GetSystemTime, "GetSystemTime", extGetSystemTime); + if(tmp) pGetSystemTime = (GetSystemTime_Type)tmp; + tmp = HookAPI(module, "kernel32.dll", Sleep, "Sleep", extSleep); + if(tmp) pSleep = (Sleep_Type)tmp; + tmp = HookAPI(module, "kernel32.dll", SleepEx, "SleepEx", extSleepEx); + if(tmp) pSleepEx = (SleepEx_Type)tmp; + tmp = HookAPI(module, "user32.dll", SetTimer, "SetTimer", extSetTimer); + if(tmp) pSetTimer = (SetTimer_Type)tmp; } return; } @@ -1335,10 +1086,10 @@ void HookExceptionHandler(void) pSetUnhandledExceptionFilter = SetUnhandledExceptionFilter; //v2.1.75 override default exception handler, if any.... LONG WINAPI myUnhandledExceptionFilter(LPEXCEPTION_POINTERS); - tmp = HookAPI("KERNEL32.dll", UnhandledExceptionFilter, "UnhandledExceptionFilter", myUnhandledExceptionFilter); + tmp = HookAPI(NULL, "KERNEL32.dll", UnhandledExceptionFilter, "UnhandledExceptionFilter", myUnhandledExceptionFilter); // so far, no need to save the previous handler. //if(tmp) pUnhandledExceptionFilter = (UnhandledExceptionFilter_Type)tmp; - tmp = HookAPI("KERNEL32.dll", SetUnhandledExceptionFilter, "SetUnhandledExceptionFilter", extSetUnhandledExceptionFilter); + tmp = HookAPI(NULL, "KERNEL32.dll", SetUnhandledExceptionFilter, "SetUnhandledExceptionFilter", extSetUnhandledExceptionFilter); //tmp = HookAPI("KERNEL32.dll", SetUnhandledExceptionFilter, "SetUnhandledExceptionFilter", myUnhandledExceptionFilter); if(tmp) pSetUnhandledExceptionFilter = (SetUnhandledExceptionFilter_Type)tmp; @@ -1350,11 +1101,12 @@ void HookExceptionHandler(void) void HookModule(char *module, int dxversion) { HookSysLibs(module); - if(dxw.dwFlags1 & HOOKDI) HookDirectInput(dxversion); - HookDirectDraw(dxversion); - HookDirect3D(dxversion); - HookOle32(dxversion); // unfinished business - HookOpenGLLibs(dxversion, module); // unfinished business + if(dxw.dwFlags2 & HOOKGDI) HookGDILib(module); + if(dxw.dwFlags1 & HOOKDI) HookDirectInput(module, dxversion); + HookDirectDraw(module, dxversion); + HookDirect3D(module, dxversion); + HookOle32(module, dxversion); // unfinished business + if(dxw.dwFlags2 & HOOKOPENGL) HookOpenGLLibs(module, dxw.CustomOpenGLLib); } int HookInit(TARGETMAP *target, HWND hwnd) @@ -1391,14 +1143,14 @@ int HookInit(TARGETMAP *target, HWND hwnd) if (dxw.dwTFlags & OUTIMPORTTABLE) DumpImportTable(NULL); if (dxw.dwTFlags & DXPROXED){ - HookDDProxy(dxw.dwTargetDDVersion); + HookDDProxy(NULL, dxw.dwTargetDDVersion); return 0; } // make InitPosition used for both DInput and DDraw InitPosition(target->initx, target->inity, target->minx, target->miny, target->maxx, target->maxy); - InitWindowPos(target->posx, target->posy, target->sizx, target->sizy); + dxw.InitWindowPos(target->posx, target->posy, target->sizx, target->sizy); HookSysLibsInit(); // this just once... @@ -1406,6 +1158,7 @@ int HookInit(TARGETMAP *target, HWND hwnd) sModule=strtok(dxw.gsModules," "); while (sModule) { OutTraceD("HookInit: hooking additional module=%s\n", sModule); + if (dxw.dwTFlags & OUTIMPORTTABLE) DumpImportTable(sModule); HookModule(sModule, dxw.dwTargetDDVersion); sModule=strtok(NULL," "); } @@ -1414,9 +1167,9 @@ int HookInit(TARGETMAP *target, HWND hwnd) InitScreenParameters(); - if (IsDebug) OutTraceD("MoveWindow: target pos=(%d,%d) size=(%d,%d)\n", iPosX, iPosY, iSizX, iSizY); + if (IsDebug) OutTraceD("MoveWindow: target pos=(%d,%d) size=(%d,%d)\n", dxw.iPosX, dxw.iPosX, dxw.iSizX, dxw.iSizY); if(dxw.dwFlags1 & FIXPARENTWIN){ - CalculateWindowPos(hwnd, iSizX, iSizY, &wp); + CalculateWindowPos(hwnd, dxw.iSizX, dxw.iSizY, &wp); if (IsDebug) OutTraceD("MoveWindow: dxw.hParentWnd=%x pos=(%d,%d) size=(%d,%d)\n", dxw.hParentWnd, wp.x, wp.y, wp.cx, wp.cy); res=(*pMoveWindow)(dxw.hParentWnd, wp.x, wp.y, wp.cx, wp.cy, FALSE); if(!res) OutTraceE("MoveWindow ERROR: dxw.hParentWnd=%x err=%d at %d\n", dxw.hParentWnd, GetLastError(), __LINE__); @@ -1425,34 +1178,6 @@ int HookInit(TARGETMAP *target, HWND hwnd) return 0; } -// Currently un-hooked - -HRESULT WINAPI extGDIGetDisplayMode(HDC dev, int mode) -{ - HRESULT res; - - //GHO: TO BE COMPLETED !!!! - - OutTraceD("GDIGetDisplayMode, mode=%x\n", mode); - - res=(*pGDIGetDisplayMode)(dev, mode); - if((dxw.dwFlags1 & EMULATESURFACE) && (dxw.VirtualPixelFormat.dwRGBBitCount == 8)){ - //lpddsd->ddpfPixelFormat.dwFlags |= DDPF_PALETTEINDEXED8; - //lpddsd->ddpfPixelFormat.dwRGBBitCount = 8; - //lpddsd->ddsCaps.dwCaps |= DDSCAPS_PALETTE; - } - else - if((dxw.dwFlags1 & EMULATESURFACE) && (dxw.VirtualPixelFormat.dwRGBBitCount == 16)){ - //lpddsd->ddpfPixelFormat.dwRGBBitCount = 16; - } - //OutTraceD("GetDisplayMode: returning WxH=(%dx%d), PixelFormat Flags=%x, RGBBitCount=%d, Caps=%x\n", - // lpddsd->dwWidth, lpddsd->dwHeight, - // lpddsd->ddpfPixelFormat.dwFlags, - // lpddsd->ddpfPixelFormat.dwRGBBitCount, - // lpddsd->ddsCaps.dwCaps); - return res; -} - HWND WINAPI extGetDesktopWindow(void) { // V2.1.73: correct ??? @@ -1470,21 +1195,6 @@ HWND WINAPI extGetDesktopWindow(void) } } -//BOOL WINAPI extColorCorrectPalette(HDC hDC, HPALETTE hPalette, DWORD dwFirstEntry, DWORD dwNumOfEntries -//) -//{ -// OutTraceD("extColorCorrectPalette: first=%d numentries=%d\n", dwFirstEntry, dwNumOfEntries); -// return(1); -//} - -void InitWindowPos(int x, int y, int w, int h) -{ - iPosX = x; - iPosY = y; - iSizX = w; - iSizY = h; -} - LPCSTR ProcToString(LPCSTR proc) { static char sBuf[24+1]; diff --git a/dll/dxhook.h b/dll/dxhook.h index 529b21d..8c3d789 100644 --- a/dll/dxhook.h +++ b/dll/dxhook.h @@ -1,8 +1,8 @@ -int HookDirectDraw(int); -int HookDDProxy(int); -int HookDirect3D(int); -int HookOle32(int); -int HookDirectInput(int); +int HookDirectDraw(char *, int); +int HookDDProxy(char *, int); +int HookDirect3D(char *, int); +int HookOle32(char *, int); +int HookDirectInput(char *, int); void InitPosition(int, int, int, int, int, int); -void InitWindowPos(int, int, int, int); +//void InitWindowPos(int, int, int, int); extern LPCSTR ProcToString(LPCSTR proc); diff --git a/dll/dxwcore.cpp b/dll/dxwcore.cpp index 88477b0..e51b646 100644 --- a/dll/dxwcore.cpp +++ b/dll/dxwcore.cpp @@ -2,8 +2,9 @@ #include "dxwcore.hpp" #include "syslibs.h" -extern GetCursorPos_Type pGetCursorPos; -extern ClientToScreen_Type pClientToScreen; +/* ------------------------------------------------------------------ */ +// Constructor, destructor, initialization.... +/* ------------------------------------------------------------------ */ dxwCore::dxwCore() { @@ -17,6 +18,11 @@ dxwCore::dxwCore() bActive = TRUE; bDInputAbs = 0; TimeShift = 0; + lpDDSPrimHDC = NULL; + //IsWithinDDraw = FALSE; + IsGDIPalette = FALSE; + + memset(PrimSurfaces, 0, sizeof(PrimSurfaces)); // preserved syslibs pointers pClientToScreen=ClientToScreen; @@ -38,10 +44,95 @@ void dxwCore::InitTarget(TARGETMAP *target) dwTFlags = target->tflags; gsModules = target->module; MaxFPS = target->MaxFPS; + CustomOpenGLLib = target->OpenGLLib; + if(!strlen(CustomOpenGLLib)) CustomOpenGLLib=NULL; // bounds control dwTargetDDVersion = target->dxversion; if(dwTargetDDVersion<0) dwTargetDDVersion=0; if(dwTargetDDVersion>10) dwTargetDDVersion=10; + TimeShift = target->InitTS; + if(TimeShift < -4) TimeShift = -4; + if(TimeShift > 4) TimeShift = 4; +} + +/* ------------------------------------------------------------------ */ +// Primary surfaces auxiliary functions +/* ------------------------------------------------------------------ */ + +void dxwCore::MarkPrimarySurface(LPDIRECTDRAWSURFACE ps) +{ + int i; + // OutTraceD("PRIMARYSURFACE add %x\n",ps); + for (i=0;iiTimeShift; + TimeShift=GetTimeShift(); if (TimeShift > 0) dwTick >>= TimeShift; if (TimeShift < 0) dwTick <<= -TimeShift; dwLastFakeTick += dwTick; dwLastRealTick = dwNextRealTick; return dwLastFakeTick; +} + +DWORD dxwCore::StretchTime(DWORD dwTimer) +{ + //extern DXWNDSTATUS *pStatus; + //TimeShift=pStatus->iTimeShift; + TimeShift=GetTimeShift(); + if (TimeShift > 0) dwTimer <<= TimeShift; + if (TimeShift < 0) dwTimer >>= -TimeShift; + return dwTimer; +} + +void dxwCore::GetSystemTime(LPSYSTEMTIME lpSystemTime) +{ + DWORD dwTick; + DWORD dwCurrentTick; + FILETIME CurrFileTime; + static DWORD dwStartTick=0; + static DWORD dwUpdateTick=0; + static FILETIME StartFileTime; + extern DXWNDSTATUS *pStatus; + + //TimeShift=pStatus->iTimeShift; + if(dwStartTick==0) { + SYSTEMTIME StartingTime; + // first time through, initialize & return true time + dwStartTick = (*pGetTickCount)(); + (*pGetSystemTime)(&StartingTime); + SystemTimeToFileTime(&StartingTime, &StartFileTime); + *lpSystemTime = StartingTime; + } + else { + dwCurrentTick=(*pGetTickCount)(); + dwTick=(dwCurrentTick-dwStartTick); + TimeShift=GetTimeShift(); + if (TimeShift > 0) dwTick >>= TimeShift; + if (TimeShift < 0) dwTick <<= -TimeShift; + // From MSDN: Contains a 64-bit value representing the number of + // 100-nanosecond intervals since January 1, 1601 (UTC). + // So, since 1mSec = 10.000 * 100nSec, you still have to multiply by 10.000. + CurrFileTime.dwHighDateTime = StartFileTime.dwHighDateTime; // wrong !!!! + CurrFileTime.dwLowDateTime = StartFileTime.dwLowDateTime + (10000 * dwTick); // wrong !!!! + FileTimeToSystemTime(&CurrFileTime, lpSystemTime); + // reset to avoid time jumps on TimeShift changes... + StartFileTime = CurrFileTime; + dwStartTick = dwCurrentTick; + } } \ No newline at end of file diff --git a/dll/dxwcore.hpp b/dll/dxwcore.hpp index c13085c..7bc7b0c 100644 --- a/dll/dxwcore.hpp +++ b/dll/dxwcore.hpp @@ -1,6 +1,8 @@ #include #include "syslibs.h" +#define DDSQLEN 0x10 + class dxwCore { // Construction/destruction @@ -12,6 +14,7 @@ public: public: // methods void InitTarget(TARGETMAP *); void SethWnd(HWND hwnd) {hWnd=hwnd;} + void InitWindowPos(int, int, int, int); HWND GethWnd(void) {return hWnd;} void SetScreenSize(void) {dwScreenWidth=800; dwScreenHeight=600;} void SetScreenSize(int x, int y) {if(x)dwScreenWidth=x; if(y)dwScreenHeight=y;} @@ -29,8 +32,17 @@ public: // methods RECT MapWindowRect(LPRECT lpRect); RECT MapWindowRect(void); void ScreenRefresh(void); - BOOL HandleFPS(); + BOOL HandleFPS(void); DWORD GetTickCount(void); + void MarkPrimarySurface(LPDIRECTDRAWSURFACE); + void UnmarkPrimarySurface(LPDIRECTDRAWSURFACE); + BOOL IsAPrimarySurface(LPDIRECTDRAWSURFACE); + LPDIRECTDRAWSURFACE GetPrimarySurface(void); + void SetPrimarySurface(void); + void ResetPrimarySurface(void); + void GetSystemTime(LPSYSTEMTIME lpSystemTime); + DWORD StretchTime(DWORD); + public: // simple data variables DDPIXELFORMAT ActualPixelFormat; @@ -50,6 +62,14 @@ public: // simple data variables DWORD MaxFPS; char *gsModules; int TimeShift; + LPDIRECTDRAWSURFACE lpDDSPrimHDC; + short iPosX; + short iPosY; + short iSizX; + short iSizY; + //BOOL IsWithinDDraw; // flag to avoid double intervention at ddraw & GDI level + BOOL IsGDIPalette; + char *CustomOpenGLLib; // Implementation protected: @@ -57,6 +77,7 @@ protected: DWORD dwScreenHeight; BOOL FullScreen; HWND hWnd; + DWORD PrimSurfaces[DDSQLEN+1]; ClientToScreen_Type pClientToScreen; ClipCursor_Type pClipCursor; GetClientRect_Type pGetClientRect; diff --git a/dll/dxwnd.cpp b/dll/dxwnd.cpp index bd15af3..b73389d 100644 --- a/dll/dxwnd.cpp +++ b/dll/dxwnd.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . #include #include "dxwnd.h" -#define VERSION "2.02.02" +#define VERSION "2.02.04" LRESULT CALLBACK HookProc(int ncode, WPARAM wparam, LPARAM lparam); @@ -125,6 +125,11 @@ void SetHookStatus(DXWNDSTATUS *s) *pStatus=*s; } +int GetTimeShift() +{ + return pStatus->iTimeShift; +} + LRESULT CALLBACK HookProc(int ncode, WPARAM wparam, LPARAM lparam) { char name[MAX_PATH]; @@ -166,6 +171,7 @@ LRESULT CALLBACK HookProc(int ncode, WPARAM wparam, LPARAM lparam) pStatus->IsFullScreen=FALSE; pStatus->hWnd=hwnd; pStatus->dwPid=GetProcessId(GetCurrentProcess()); + pStatus->iTimeShift=pMapping[i].InitTS; DxWndStatus = *pStatus; HookInit(&pMapping[i], hwnd); } diff --git a/dll/dxwnd.def b/dll/dxwnd.def index c3ea5ad..c8da73a 100644 --- a/dll/dxwnd.def +++ b/dll/dxwnd.def @@ -5,3 +5,4 @@ EXPORTS EndHook @3 GetDllVersion @4 GetHookStatus @5 + SetHookStatus @6 diff --git a/dll/dxwnd.ncb b/dll/dxwnd.ncb new file mode 100644 index 0000000..ca6a396 Binary files /dev/null and b/dll/dxwnd.ncb differ diff --git a/dll/dxwnd.vcproj b/dll/dxwnd.vcproj deleted file mode 100644 index be0ccb4..0000000 --- a/dll/dxwnd.vcproj +++ /dev/null @@ -1,389 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dll/dxwnd.ws2008.suo b/dll/dxwnd.ws2008.suo index fd81a23..3e8602a 100644 Binary files a/dll/dxwnd.ws2008.suo and b/dll/dxwnd.ws2008.suo differ diff --git a/dll/glhook.cpp b/dll/glhook.cpp index 03e7268..47dbc64 100644 --- a/dll/glhook.cpp +++ b/dll/glhook.cpp @@ -8,10 +8,6 @@ glViewport_Type pglViewport; glScissor_Type pglScissor; glGetIntegerv_Type pglGetIntegerv; -//extern GLenum WINAPI glGetError(); - -extern short iPosX, iPosY, iSizX, iSizY; - void WINAPI extglViewport(GLint x, GLint y, GLsizei width, GLsizei height) { RECT client; @@ -44,21 +40,6 @@ void WINAPI extglGetIntegerv(GLenum pname, GLint *params) { (*pglGetIntegerv)(pname, params); OutTraceD("glGetIntegerv: pname=%d\n", pname); -// if(glGetError()!=GL_NO_ERROR) OutTraceE("glGetIntegerv: ERROR %d at %d\n", glGetError(), __LINE__); -#if 0 - if (pname==GL_VIEWPORT){ - OutTraceD("glGetIntegerv: pname=GL_VIEWPORT real viewport=(%d,%d)-(%d,%d)\n", - params[0], params[1], params[2], params[3]); - //params[0]=(GLboolean)iPosX; - //params[1]=(GLboolean)iPosY; - params[0]=(GLint)0; - params[1]=(GLint)0; - params[2]=(GLint)iSizX; - params[3]=(GLint)iSizY; - OutTraceD("glGetIntegerv: pname=GL_VIEWPORT remapped viewport=(%d,%d)-(%d,%d)\n", - params[0], params[1], params[2], params[3]); - } -#endif } FARPROC Remap_gl_ProcAddress(LPCSTR proc, HMODULE hModule) @@ -82,19 +63,18 @@ FARPROC Remap_gl_ProcAddress(LPCSTR proc, HMODULE hModule) return NULL; } -void HookOpenGLLibs(int dxversion, char *module) +void HookOpenGLLibs(char *module, char *customlib) { void *tmp; char *DefOpenGLModule="OpenGL32.dll"; - if (dxversion!=10) return; - if (!module) module=DefOpenGLModule; + if (!customlib) customlib=DefOpenGLModule; - tmp = HookAPI(module, NULL, "glViewport", extglViewport); + tmp = HookAPI(module, customlib, NULL, "glViewport", extglViewport); if(tmp) pglViewport = (glViewport_Type)tmp; - tmp = HookAPI(module, NULL, "glScissor", extglScissor); + tmp = HookAPI(module, customlib, NULL, "glScissor", extglScissor); if(tmp) pglScissor = (glScissor_Type)tmp; - tmp = HookAPI(module, NULL, "glGetIntegerv", extglGetIntegerv); + tmp = HookAPI(module, customlib, NULL, "glGetIntegerv", extglGetIntegerv); if(tmp) pglGetIntegerv = (glGetIntegerv_Type)tmp; return; diff --git a/dll/glhook.h b/dll/glhook.h index 38d37d2..304a081 100644 --- a/dll/glhook.h +++ b/dll/glhook.h @@ -1,7 +1,7 @@ #include "gl.h" extern FARPROC Remap_gl_ProcAddress(LPCSTR, HMODULE); -extern void HookOpenGLLibs(int, char *); +extern void HookOpenGLLibs(char *, char *); typedef void (WINAPI *glViewport_Type)(GLint, GLint, GLsizei, GLsizei); typedef void (WINAPI *glScissor_Type)(GLint, GLint, GLsizei, GLsizei); diff --git a/dll/hd3d.cpp b/dll/hd3d.cpp index 1bf3a27..485bd9c 100644 --- a/dll/hd3d.cpp +++ b/dll/hd3d.cpp @@ -33,16 +33,16 @@ GetAdapterDisplayMode_Type pGetAdapterDisplayMode; GetDisplayMode_Type pGetDisplayMode; DWORD dwD3DVersion; -int HookDirect3D(int version){ +int HookDirect3D(char *module, int version){ HINSTANCE hinst; void *tmp; LPDIRECT3D9 lpd3d; switch(version){ case 0: - tmp = HookAPI("d3d8.dll", NULL, "Direct3DCreate8", extDirect3DCreate8); + tmp = HookAPI(module, "d3d8.dll", NULL, "Direct3DCreate8", extDirect3DCreate8); if(tmp) pDirect3DCreate8 = (Direct3DCreate8_Type)tmp; - tmp = HookAPI("d3d9.dll", NULL, "Direct3DCreate9", extDirect3DCreate9); + tmp = HookAPI(module, "d3d9.dll", NULL, "Direct3DCreate9", extDirect3DCreate9); if(tmp) pDirect3DCreate9 = (Direct3DCreate9_Type)tmp; break; case 8: @@ -126,13 +126,12 @@ HRESULT WINAPI extReset(void *pd3dd, D3DPRESENT_PARAMETERS* pPresentationParamet HRESULT WINAPI extGetDisplayMode(void *lpd3d, D3DDISPLAYMODE *pMode) { HRESULT res; - extern short iSizX, iSizY; res=(*pGetDisplayMode)(lpd3d, pMode); OutTraceD("DEBUG: GetDisplayMode: size=(%dx%d) RefreshRate=%d Format=%d\n", pMode->Width, pMode->Height, pMode->RefreshRate, pMode->Format); if(dxw.dwFlags2 & KEEPASPECTRATIO){ - pMode->Width=iSizX; - pMode->Height=iSizY; + pMode->Width=dxw.iSizX; + pMode->Height=dxw.iSizY; OutTraceD("DEBUG: GetDisplayMode: fixed size=(%dx%d)\n", pMode->Width, pMode->Height); } return res; @@ -159,13 +158,12 @@ HRESULT WINAPI extEnumAdapterModes9(void *lpd3d, UINT Adapter, D3DFORMAT Format, HRESULT WINAPI extGetAdapterDisplayMode(void *lpd3d, UINT Adapter, D3DDISPLAYMODE *pMode) { HRESULT res; - extern short iSizX, iSizY; res=(*pGetAdapterDisplayMode)(lpd3d, Adapter, pMode); OutTraceD("DEBUG: GetAdapterDisplayMode: size=(%dx%d) RefreshRate=%d Format=%d\n", pMode->Width, pMode->Height, pMode->RefreshRate, pMode->Format); if(dxw.dwFlags2 & KEEPASPECTRATIO){ - pMode->Width=iSizX; - pMode->Height=iSizY; + pMode->Width=dxw.iSizX; + pMode->Height=dxw.iSizY; OutTraceD("DEBUG: GetDisplayMode: fixed size=(%dx%d)\n", pMode->Width, pMode->Height); } return res; diff --git a/dll/hddproxy.cpp b/dll/hddproxy.cpp index 0875768..a970e45 100644 --- a/dll/hddproxy.cpp +++ b/dll/hddproxy.cpp @@ -169,11 +169,11 @@ extern GDIGetDC_Type pGDIGetDC; extern GDIGetDC_Type pGDIGetWindowDC; extern GDIReleaseDC_Type pGDIReleaseDC; extern CreateDC_Type pGDICreateDC; -extern CreateCompatibleDC_Type pCreateCompatibleDC; -extern BitBlt_Type pBitBlt; -extern PatBlt_Type pPatBlt; -extern StretchBlt_Type pStretchBlt; -extern DeleteDC_Type pDeleteDC; +extern CreateCompatibleDC_Type pGDICreateCompatibleDC; +extern BitBlt_Type pGDIBitBlt; +extern PatBlt_Type pGDIPatBlt; +extern StretchBlt_Type pGDIStretchBlt; +extern DeleteDC_Type pGDIDeleteDC; SaveDC_Type pSaveDC; RestoreDC_Type pRestoreDC; extern BeginPaint_Type pBeginPaint; @@ -273,7 +273,7 @@ FARPROC WINAPI extGetProcAddressProxy(HMODULE hModule, LPCSTR proc) // // ------------------------------------------------------------------------------------------ // -int HookDDProxy(int dxVersion) +int HookDDProxy(char *module, int dxVersion) { HINSTANCE hinst; void *tmp; @@ -283,60 +283,60 @@ int HookDDProxy(int dxVersion) dxw.dwFlags1 |= OUTDDRAWTRACE; - pCreateCompatibleDC=CreateCompatibleDC; + pGDICreateCompatibleDC=CreateCompatibleDC; pGDIGetDC=GetDC; pGDIGetWindowDC=GetWindowDC; pGDIReleaseDC=ReleaseDC; - pCreateDC=CreateDC; - pBitBlt=BitBlt; - pPatBlt=PatBlt; - pStretchBlt=StretchBlt; - pDeleteDC=DeleteDC; + pGDICreateDC=CreateDC; + pGDIBitBlt=BitBlt; + pGDIPatBlt=PatBlt; + pGDIStretchBlt=StretchBlt; + pGDIDeleteDC=DeleteDC; pSaveDC=SaveDC; pRestoreDC=RestoreDC; - pSelectPalette=SelectPalette; - tmp = HookAPI("GDI32.dll", CreateCompatibleDC, "CreateCompatibleDC", extCreateCompatibleDCProxy); - if(tmp) pCreateCompatibleDC = (CreateCompatibleDC_Type)tmp; - tmp = HookAPI("user32.dll", GetDC, "GetDC", extGDIGetDCProxy); + pGDISelectPalette=SelectPalette; + tmp = HookAPI(module, "GDI32.dll", CreateCompatibleDC, "CreateCompatibleDC", extCreateCompatibleDCProxy); + if(tmp) pGDICreateCompatibleDC = (CreateCompatibleDC_Type)tmp; + tmp = HookAPI(module, "user32.dll", GetDC, "GetDC", extGDIGetDCProxy); if(tmp) pGDIGetDC = (GDIGetDC_Type)tmp; - tmp = HookAPI("user32.dll", GetWindowDC, "GetWindowDC", extGetWindowDCProxy); + tmp = HookAPI(module, "user32.dll", GetWindowDC, "GetWindowDC", extGetWindowDCProxy); if(tmp) pGDIGetWindowDC = (GDIGetDC_Type)tmp; - tmp = HookAPI("user32.dll", ReleaseDC, "ReleaseDC", extGDIReleaseDCProxy); + tmp = HookAPI(module, "user32.dll", ReleaseDC, "ReleaseDC", extGDIReleaseDCProxy); if(tmp) pGDIReleaseDC = (GDIReleaseDC_Type)tmp; - tmp = HookAPI("GDI32.dll", CreateDCA, "CreateDCA", extCreateDCProxy); - if(tmp) pCreateDC = (CreateDC_Type)tmp; - tmp = HookAPI("GDI32.dll", BitBlt, "BitBlt", extBitBltProxy); - if(tmp) pBitBlt = (BitBlt_Type)tmp; - tmp = HookAPI("GDI32.dll", StretchBlt, "StretchBlt", extStretchBltProxy); - if(tmp) pStretchBlt = (StretchBlt_Type)tmp; - tmp = HookAPI("GDI32.dll", PatBlt, "PatBlt", extPatBltProxy); - if(tmp) pPatBlt = (PatBlt_Type)tmp; - tmp = HookAPI("GDI32.dll", DeleteDC, "DeleteDC", extDeleteDCProxy); - if(tmp) pDeleteDC = (DeleteDC_Type)tmp; - tmp = HookAPI("GDI32.dll", SaveDC, "SaveDC", extSaveDCProxy); + tmp = HookAPI(module, "GDI32.dll", CreateDCA, "CreateDCA", extCreateDCProxy); + if(tmp) pGDICreateDC = (CreateDC_Type)tmp; + tmp = HookAPI(module, "GDI32.dll", BitBlt, "BitBlt", extBitBltProxy); + if(tmp) pGDIBitBlt = (BitBlt_Type)tmp; + tmp = HookAPI(module, "GDI32.dll", StretchBlt, "StretchBlt", extStretchBltProxy); + if(tmp) pGDIStretchBlt = (StretchBlt_Type)tmp; + tmp = HookAPI(module, "GDI32.dll", PatBlt, "PatBlt", extPatBltProxy); + if(tmp) pGDIPatBlt = (PatBlt_Type)tmp; + tmp = HookAPI(module, "GDI32.dll", DeleteDC, "DeleteDC", extDeleteDCProxy); + if(tmp) pGDIDeleteDC = (DeleteDC_Type)tmp; + tmp = HookAPI(module, "GDI32.dll", SaveDC, "SaveDC", extSaveDCProxy); if(tmp) pGDISaveDC = (SaveDC_Type)tmp; - tmp = HookAPI("GDI32.dll", RestoreDC, "RestoreDC", extRestoreDCProxy); + tmp = HookAPI(module, "GDI32.dll", RestoreDC, "RestoreDC", extRestoreDCProxy); if(tmp) pGDIRestoreDC = (RestoreDC_Type)tmp; - tmp = HookAPI("GDI32.dll", SelectPalette, "SelectPalette", extSelectPaletteProxy); - if(tmp) pSelectPalette = (SelectPalette_Type)tmp; - tmp = HookAPI("GDI32.dll", RealizePalette, "RealizePalette", extRealizePaletteProxy); - if(tmp) pRealizePalette = (RealizePalette_Type)tmp; - tmp = HookAPI("GDI32.dll", GetSystemPaletteEntries, "GetSystemPaletteEntries", extGetSystemPaletteEntriesProxy); - if(tmp) pGetSystemPaletteEntries = (GetSystemPaletteEntries_Type)tmp; - tmp = HookAPI("user32.dll", BeginPaint, "BeginPaint", extBeginPaintProxy); + tmp = HookAPI(module, "GDI32.dll", SelectPalette, "SelectPalette", extSelectPaletteProxy); + if(tmp) pGDISelectPalette = (SelectPalette_Type)tmp; + tmp = HookAPI(module, "GDI32.dll", RealizePalette, "RealizePalette", extRealizePaletteProxy); + if(tmp) pGDIRealizePalette = (RealizePalette_Type)tmp; + tmp = HookAPI(module, "GDI32.dll", GetSystemPaletteEntries, "GetSystemPaletteEntries", extGetSystemPaletteEntriesProxy); + if(tmp) pGDIGetSystemPaletteEntries = (GetSystemPaletteEntries_Type)tmp; + tmp = HookAPI(module, "user32.dll", BeginPaint, "BeginPaint", extBeginPaintProxy); if(tmp) pBeginPaint = (BeginPaint_Type)tmp; pGetProcAddress = (GetProcAddress_Type)GetProcAddress; - tmp = HookAPI("KERNEL32.dll", GetProcAddress, "GetProcAddress", extGetProcAddressProxy); + tmp = HookAPI(module, "KERNEL32.dll", GetProcAddress, "GetProcAddress", extGetProcAddressProxy); if(tmp) pGetProcAddress = (GetProcAddress_Type)tmp; switch(dxVersion){ case 0: // automatic - tmp = HookAPI("ddraw.dll", NULL, "DirectDrawCreate", extDirectDrawCreateProxy); + tmp = HookAPI(module, "ddraw.dll", NULL, "DirectDrawCreate", extDirectDrawCreateProxy); if(tmp) pDirectDrawCreate = (DirectDrawCreate_Type)tmp; - tmp = HookAPI("ddraw.dll", NULL, "DirectDrawCreateEx", extDirectDrawCreateExProxy); + tmp = HookAPI(module, "ddraw.dll", NULL, "DirectDrawCreateEx", extDirectDrawCreateExProxy); if(tmp) pDirectDrawCreateEx = (DirectDrawCreateEx_Type)tmp; - tmp = HookAPI("ddraw.dll", NULL, "DirectDrawEnumerateA", extDirectDrawEnumerateProxy); + tmp = HookAPI(module, "ddraw.dll", NULL, "DirectDrawEnumerateA", extDirectDrawEnumerateProxy); if(tmp) pDirectDrawEnumerate = (DirectDrawEnumerate_Type)tmp; - tmp = HookAPI("ddraw.dll", NULL, "DirectDrawEnumerateExA", extDirectDrawEnumerateExProxy); + tmp = HookAPI(module, "ddraw.dll", NULL, "DirectDrawEnumerateExA", extDirectDrawEnumerateExProxy); if(tmp) pDirectDrawEnumerateEx = (DirectDrawEnumerateEx_Type)tmp; break; case 1: @@ -352,8 +352,8 @@ int HookDDProxy(int dxVersion) if(pDirectDrawCreate){ LPDIRECTDRAW lpdd; BOOL res; - HookAPI("ddraw.dll", pDirectDrawCreate, "DirectDrawCreate", extDirectDrawCreateProxy); - HookAPI("ddraw.dll", pDirectDrawEnumerate, "DirectDrawEnumerateA", extDirectDrawEnumerateProxy); + HookAPI(module, "ddraw.dll", pDirectDrawCreate, "DirectDrawCreate", extDirectDrawCreateProxy); + HookAPI(module, "ddraw.dll", pDirectDrawEnumerate, "DirectDrawEnumerateA", extDirectDrawEnumerateProxy); res=extDirectDrawCreateProxy(0, &lpdd, 0); if (res){ OutTraceP("DirectDrawCreate: ERROR res=%x(%s)\n", res, ExplainDDError(res)); @@ -372,9 +372,9 @@ int HookDDProxy(int dxVersion) if(pDirectDrawCreate){ LPDIRECTDRAW lpdd; BOOL res; - HookAPI("ddraw.dll", pDirectDrawCreate, "DirectDrawCreate", extDirectDrawCreateProxy); - HookAPI("ddraw.dll", pDirectDrawEnumerate, "DirectDrawEnumerateA", extDirectDrawEnumerateProxy); - HookAPI("ddraw.dll", pDirectDrawEnumerateEx, "DirectDrawEnumerateExA", extDirectDrawEnumerateExProxy); + HookAPI(module, "ddraw.dll", pDirectDrawCreate, "DirectDrawCreate", extDirectDrawCreateProxy); + HookAPI(module, "ddraw.dll", pDirectDrawEnumerate, "DirectDrawEnumerateA", extDirectDrawEnumerateProxy); + HookAPI(module, "ddraw.dll", pDirectDrawEnumerateEx, "DirectDrawEnumerateExA", extDirectDrawEnumerateExProxy); res=extDirectDrawCreateProxy(0, &lpdd, 0); if (res){ OutTraceP("DirectDrawCreate: ERROR res=%x(%s)\n", res, ExplainDDError(res)); @@ -386,7 +386,7 @@ int HookDDProxy(int dxVersion) if(pDirectDrawCreateEx){ LPDIRECTDRAW lpdd; BOOL res; - HookAPI("ddraw.dll", pDirectDrawCreateEx, "DirectDrawCreateEx", extDirectDrawCreateExProxy); + HookAPI(module, "ddraw.dll", pDirectDrawCreateEx, "DirectDrawCreateEx", extDirectDrawCreateExProxy); res=extDirectDrawCreateExProxy(0, &lpdd, dd7, 0); if (res) OutTraceP("DirectDrawCreateEx: ERROR res=%x(%s)\n", res, ExplainDDError(res)); lpdd->Release(); @@ -1868,11 +1868,11 @@ extern GDIGetDC_Type pGDIGetDC; //GDIGetDC_Type pGDIGetWinDC; extern GDIReleaseDC_Type pGDIReleaseDC; extern CreateDC_Type pGDICreateDC; -extern CreateCompatibleDC_Type pCreateCompatibleDC; -extern BitBlt_Type pBitBlt; -extern PatBlt_Type pPatBlt; -extern StretchBlt_Type pStretchBlt; -extern DeleteDC_Type pDeleteDC; +extern CreateCompatibleDC_Type pGDICreateCompatibleDC; +extern BitBlt_Type pGDIBitBlt; +extern PatBlt_Type pGDIPatBlt; +extern StretchBlt_Type pGDIStretchBlt; +extern DeleteDC_Type pGDIDeleteDC; extern SaveDC_Type pSaveDC; extern RestoreDC_Type pRestoreDC; @@ -1907,7 +1907,7 @@ HDC WINAPI extCreateDCProxy(LPSTR Driver, LPSTR Device, LPSTR Output, CONST DEVM OutTraceP("GDI.CreateDC: PROXED Driver=%s Device=%s Output=%s InitData=%x\n", Driver?Driver:"(NULL)", Device?Device:"(NULL)", Output?Output:"(NULL)", InitData); - RetHDC=(*pCreateDC)(Driver, Device, Output, InitData); + RetHDC=(*pGDICreateDC)(Driver, Device, Output, InitData); if(RetHDC) OutTraceP("GDI.CreateDC: returning HDC=%x\n", RetHDC); else @@ -1919,7 +1919,7 @@ HDC WINAPI extCreateCompatibleDCProxy(HDC hdc) { HDC RetHdc; OutTraceP("GDI.CreateCompatibleDC: PROXED hdc=%x\n", hdc); - RetHdc=(*pCreateCompatibleDC)(hdc); + RetHdc=(*pGDICreateCompatibleDC)(hdc); if(RetHdc) OutTraceP("GDI.CreateCompatibleDC: returning HDC=%x\n", RetHdc); else @@ -1934,7 +1934,7 @@ BOOL WINAPI extBitBltProxy(HDC hdcDest, int nXDest, int nYDest, int nWidth, int OutTraceP("GDI.BitBlt: PROXED HDC=%x nXDest=%d nYDest=%d nWidth=%d nHeight=%d hdcSrc=%x nXSrc=%d nYSrc=%d dwRop=%x(%s)\n", hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop, ExplainROP(dwRop)); - res=(*pBitBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop); + res=(*pGDIBitBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop); if(!res) OutTraceP("GDI.BitBlt: ERROR err=%d\n", GetLastError()); return res; } @@ -1946,7 +1946,7 @@ BOOL WINAPI extPatBltProxy(HDC hdcDest, int nXDest, int nYDest, int nWidth, int OutTraceP("GDI.PatBlt: PROXED HDC=%x nXDest=%d nYDest=%d nWidth=%d nHeight=%d dwRop=%x(%s)\n", hdcDest, nXDest, nYDest, nWidth, nHeight, dwRop, ExplainROP(dwRop)); - res=(*pPatBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, dwRop); + res=(*pGDIPatBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, dwRop); if(!res) OutTraceP("GDI.PatBlt: ERROR err=%d\n", GetLastError()); return res; } @@ -1959,7 +1959,7 @@ BOOL WINAPI extStretchBltProxy(HDC hdcDest, int nXDest, int nYDest, int nWidth, OutTraceP("GDI.StretchBlt: PROXED HDC=%x nXDest=%d nYDest=%d nWidth=%d nHeight=%d hdcSrc=%x nXSrc=%d nYSrc=%d nWSrc=%d nHSrc=%d dwRop=%x(%s)\n", hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, nWSrc, nHSrc, dwRop, ExplainROP(dwRop)); - res=(*pStretchBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, nWSrc, nHSrc, dwRop); + res=(*pGDIStretchBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, nWSrc, nHSrc, dwRop); if(!res) OutTraceP("GDI.StretchBlt: ERROR err=%d\n", GetLastError()); return res; } @@ -1969,7 +1969,7 @@ BOOL WINAPI extDeleteDCProxy(HDC hdc) BOOL res; OutTraceP("GDI.DeleteDC: PROXED hdc=%x\n", hdc); - res=(*pDeleteDC)(hdc); + res=(*pGDIDeleteDC)(hdc); if(!res) OutTraceP("GDI.DeleteDC: ERROR err=%d\n", GetLastError()); return res; } @@ -1996,7 +1996,7 @@ HPALETTE WINAPI extSelectPaletteProxy(HDC hdc, HPALETTE hpal, BOOL bForceBackgro { HPALETTE ret; - ret=(*pSelectPalette)(hdc, hpal, bForceBackground); + ret=(*pGDISelectPalette)(hdc, hpal, bForceBackground); OutTraceP("GDI.SelectPalette: PROXED hdc=%x hpal=%x ForceBackground=%x ret=%x\n", hdc, hpal, bForceBackground, ret); return ret; } @@ -2005,7 +2005,7 @@ UINT WINAPI extRealizePaletteProxy(HDC hdc) { UINT ret; - ret=(*pRealizePalette)(hdc); + ret=(*pGDIRealizePalette)(hdc); OutTraceP("GDI.RealizePalette: PROXED hdc=%x ret=%x\n", hdc, ret); return ret; } @@ -2014,7 +2014,7 @@ UINT WINAPI extGetSystemPaletteEntriesProxy(HDC hdc, UINT iStartIndex, UINT nEnt { UINT ret; - ret=(*pGetSystemPaletteEntries)(hdc, iStartIndex, nEntries, lppe); + ret=(*pGDIGetSystemPaletteEntries)(hdc, iStartIndex, nEntries, lppe); OutTrace("GDI.GetSystemPaletteEntries: PROXED hdc=%x start=%d num=%d ret=%d\n", hdc, iStartIndex, nEntries, ret); if(!ret) OutTrace("GDI.GetSystemPaletteEntries: ERROR err=%d\n", GetLastError()); return ret; diff --git a/dll/hddraw.cpp b/dll/hddraw.cpp index 3a2e390..2193ac5 100644 --- a/dll/hddraw.cpp +++ b/dll/hddraw.cpp @@ -94,14 +94,6 @@ HDC WINAPI extGDIGetDC(HWND); HDC WINAPI extGDIGetWindowDC(HWND); int WINAPI extGDIReleaseDC(HWND, HDC); -extern short iPosX, iPosY, iSizX, iSizY; - -/* ------ */ -GDIGetDC_Type pGDIGetDC; -GDIGetDC_Type pGDIGetWindowDC; -GDIReleaseDC_Type pGDIReleaseDC; -/* ------ */ - /* DirectDraw APIs */ DirectDrawCreate_Type pDirectDrawCreate; DirectDrawCreateEx_Type pDirectDrawCreateEx; @@ -215,7 +207,6 @@ SetEntries_Type pSetEntries; #define MAXBACKBUFFERS 4 -//LPDIRECTDRAWSURFACE lpDDSHDC=NULL, lpDDSEmu_Prim=NULL, lpDDSEmu_Back=NULL; LPDIRECTDRAWSURFACE lpDDSEmu_Prim=NULL, lpDDSEmu_Back=NULL; LPDIRECTDRAWSURFACE lpDDSBack=NULL; LPDIRECTDRAWCLIPPER lpDDC=NULL; @@ -479,7 +470,7 @@ void FixPixelFormat(int ColorDepth, DDPIXELFORMAT *pf) // ------------------------------------------------------------------------------------- static void HookDDSession(LPDIRECTDRAW *, int); -CoCreateInstance_Type pCoCreateInstance=NULL; +//CoCreateInstance_Type pCoCreateInstance=NULL; HRESULT STDAPICALLTYPE extCoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID riid, LPVOID FAR* ppv) { @@ -526,18 +517,18 @@ HRESULT STDAPICALLTYPE extCoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, return res; } -int HookOle32(int version) +int HookOle32(char *module, int version) { // used by Axis & Allies .... void *tmp; //return 0; OutTraceD("HookOle32 version=%d\n", version); //GHO - tmp = HookAPI("ole32.dll", NULL, "CoCreateInstance", extCoCreateInstance); + tmp = HookAPI(module, "ole32.dll", NULL, "CoCreateInstance", extCoCreateInstance); if(tmp) pCoCreateInstance = (CoCreateInstance_Type)tmp; return 0; } -int HookDirectDraw(int version) +int HookDirectDraw(char *module, int version) { HINSTANCE hinst; void *tmp; @@ -546,13 +537,13 @@ int HookDirectDraw(int version) OutTraceD("HookDirectDraw version=%d\n", version); //GHO switch(version){ case 0: // automatic - tmp = HookAPI("ddraw.dll", NULL, "DirectDrawCreate", extDirectDrawCreate); + tmp = HookAPI(module, "ddraw.dll", NULL, "DirectDrawCreate", extDirectDrawCreate); if(tmp) pDirectDrawCreate = (DirectDrawCreate_Type)tmp; - tmp = HookAPI("ddraw.dll", NULL, "DirectDrawCreateEx", extDirectDrawCreateEx); + tmp = HookAPI(module, "ddraw.dll", NULL, "DirectDrawCreateEx", extDirectDrawCreateEx); if(tmp) pDirectDrawCreateEx = (DirectDrawCreateEx_Type)tmp; - tmp = HookAPI("ddraw.dll", NULL, "DirectDrawEnumerateA", extDirectDrawEnumerateProxy); + tmp = HookAPI(module, "ddraw.dll", NULL, "DirectDrawEnumerateA", extDirectDrawEnumerateProxy); if(tmp) pDirectDrawEnumerate = (DirectDrawEnumerate_Type)tmp; - tmp = HookAPI("ddraw.dll", NULL, "DirectDrawEnumerateExA", extDirectDrawEnumerateExProxy); + tmp = HookAPI(module, "ddraw.dll", NULL, "DirectDrawEnumerateExA", extDirectDrawEnumerateExProxy); if(tmp) pDirectDrawEnumerateEx = (DirectDrawEnumerateEx_Type)tmp; break; case 1: @@ -568,8 +559,8 @@ int HookDirectDraw(int version) if(pDirectDrawCreate){ LPDIRECTDRAW lpdd; BOOL res; - HookAPI("ddraw.dll", pDirectDrawCreate, "DirectDrawCreate", extDirectDrawCreate); - HookAPI("ddraw.dll", pDirectDrawEnumerate, "DirectDrawEnumerateA", extDirectDrawEnumerateProxy); + HookAPI(module, "ddraw.dll", pDirectDrawCreate, "DirectDrawCreate", extDirectDrawCreate); + HookAPI(module, "ddraw.dll", pDirectDrawEnumerate, "DirectDrawEnumerateA", extDirectDrawEnumerateProxy); res=extDirectDrawCreate(0, &lpdd, 0); if (res){ OutTraceE("DirectDrawCreate: ERROR res=%x(%s)\n", res, ExplainDDError(res)); @@ -588,9 +579,9 @@ int HookDirectDraw(int version) if(pDirectDrawCreate){ LPDIRECTDRAW lpdd; BOOL res; - HookAPI("ddraw.dll", pDirectDrawCreate, "DirectDrawCreate", extDirectDrawCreateProxy); - HookAPI("ddraw.dll", pDirectDrawEnumerate, "DirectDrawEnumerateA", extDirectDrawEnumerateProxy); - HookAPI("ddraw.dll", pDirectDrawEnumerateEx, "DirectDrawEnumerateExA", extDirectDrawEnumerateExProxy); + HookAPI(module, "ddraw.dll", pDirectDrawCreate, "DirectDrawCreate", extDirectDrawCreateProxy); + HookAPI(module, "ddraw.dll", pDirectDrawEnumerate, "DirectDrawEnumerateA", extDirectDrawEnumerateProxy); + HookAPI(module, "ddraw.dll", pDirectDrawEnumerateEx, "DirectDrawEnumerateExA", extDirectDrawEnumerateExProxy); res=extDirectDrawCreate(0, &lpdd, 0); if (res) OutTraceE("DirectDrawCreate: ERROR res=%x(%s)\n", res, ExplainDDError(res)); lpdd->Release(); @@ -600,7 +591,7 @@ int HookDirectDraw(int version) if(pDirectDrawCreateEx){ LPDIRECTDRAW lpdd; BOOL res; - HookAPI("ddraw.dll", pDirectDrawCreateEx, "DirectDrawCreateEx", extDirectDrawCreateEx); + HookAPI(module, "ddraw.dll", pDirectDrawCreateEx, "DirectDrawCreateEx", extDirectDrawCreateEx); res=extDirectDrawCreateEx(0, &lpdd, dd7, 0); if (res) OutTraceE("DirectDrawCreateEx: ERROR res=%x(%s)\n", res, ExplainDDError(res)); lpdd->Release(); @@ -612,70 +603,6 @@ int HookDirectDraw(int version) return 0; } -/* ------------------------------------------------------------------ */ -// Primary surfaces auxiliary functions -/* ------------------------------------------------------------------ */ - -#define DDSQLEN 0x10 -static DWORD PrimSurfaces[DDSQLEN+1] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; -void MarkPrimarySurface(LPDIRECTDRAWSURFACE ps) -{ - int i; - // OutTraceD("PRIMARYSURFACE add %x\n",ps); - for (i=0;idwCaps, ExplainDDSCaps(lpddsc->dwCaps)); @@ -2314,8 +2241,8 @@ HRESULT WINAPI sBlt(char *api, LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect, BOOL ToPrim, FromPrim, ToScreen, FromScreen; //CkArg arg; - ToPrim=IsAPrimarySurface(lpdds); - FromPrim=IsAPrimarySurface(lpddssrc); + ToPrim=dxw.IsAPrimarySurface(lpdds); + FromPrim=dxw.IsAPrimarySurface(lpddssrc); ToScreen=ToPrim && !(dxw.dwFlags1 & EMULATESURFACE); FromScreen=FromPrim && !(dxw.dwFlags1 & EMULATESURFACE); @@ -2551,7 +2478,7 @@ HRESULT WINAPI extFlip(LPDIRECTDRAWSURFACE lpdds, LPDIRECTDRAWSURFACE lpddssrc, BOOL IsPrim; HRESULT res; - IsPrim=IsAPrimarySurface(lpdds); + IsPrim=dxw.IsAPrimarySurface(lpdds); OutTraceD("Flip: lpdds=%x%s, src=%x, flags=%x(%s)\n", lpdds, IsPrim?"(PRIM)":"", lpddssrc, dwflags, ExplainFlipFlags(dwflags)); @@ -2635,8 +2562,8 @@ HRESULT WINAPI extBltFast(LPDIRECTDRAWSURFACE lpdds, DWORD dwx, DWORD dwy, HRESULT ret; BOOL ToPrim, FromPrim; - ToPrim=IsAPrimarySurface(lpdds); - FromPrim=IsAPrimarySurface(lpddssrc); + ToPrim=dxw.IsAPrimarySurface(lpdds); + FromPrim=dxw.IsAPrimarySurface(lpddssrc); CleanRect(&lpsrcrect,__LINE__); @@ -2770,8 +2697,9 @@ HRESULT WINAPI extSetPalette(LPDIRECTDRAWSURFACE lpdds, LPDIRECTDRAWPALETTE lpdd PALETTEENTRY *lpentries; BOOL isPrim; HRESULT res; - - isPrim=IsAPrimarySurface(lpdds); + + dxw.IsGDIPalette=FALSE; + isPrim=dxw.IsAPrimarySurface(lpdds); OutTraceD("SetPalette: lpdds=%x%s lpddp=%x\n", lpdds, isPrim?"(PRIM)":"", lpddp); if(!(dxw.dwFlags1 & EMULATESURFACE) || !isPrim) { @@ -2782,11 +2710,11 @@ HRESULT WINAPI extSetPalette(LPDIRECTDRAWSURFACE lpdds, LPDIRECTDRAWPALETTE lpdd OutTraceD("SetPalette: DEBUG emulating palette\n"); lpDDP = lpddp; - if (lpDDSBack) { - res=(*pSetPalette)(lpDDSBack, lpddp); - if(res) OutTraceE("SetPalette: ERROR res=%x(%s) at %d\n", res, ExplainDDError(res), __LINE__); - } - // add a reference to simulate whot would happen in reality.... + //if (lpDDSBack) { GHOGHO + // res=(*pSetPalette)(lpDDSBack, lpddp); + // if(res) OutTraceE("SetPalette: ERROR res=%x(%s) at %d\n", res, ExplainDDError(res), __LINE__); + //} + // add a reference to simulate what would happen in reality.... lpdds->AddRef(); if(lpddp){ @@ -2803,14 +2731,16 @@ HRESULT WINAPI extSetEntries(LPDIRECTDRAWPALETTE lpddp, DWORD dwflags, DWORD dws { HRESULT res; + dxw.IsGDIPalette=FALSE; OutTraceD("SetEntries: dwFlags=%x, start=%d, count=%d\n", //GHO: added trace infos dwflags, dwstart, dwcount); res = (*pSetEntries)(lpddp, dwflags, dwstart, dwcount, lpentries); if(res) OutTraceE("SetEntries: ERROR res=%x(%s)\n", res, ExplainDDError(res)); - if(!(dxw.dwFlags1 & EMULATESURFACE) || lpDDP != lpddp) + if(!(dxw.dwFlags1 & EMULATESURFACE) || lpDDP != lpddp){ return res; + } if ((dwstart + dwcount > 256) || (dwstart<0)){ dwcount=256; @@ -2831,7 +2761,7 @@ HRESULT WINAPI extSetClipper(LPDIRECTDRAWSURFACE lpdds, LPDIRECTDRAWCLIPPER lpdd { HRESULT res; BOOL isPrim; - isPrim=IsAPrimarySurface(lpdds); + isPrim=dxw.IsAPrimarySurface(lpdds); OutTraceD("SetClipper: lpdds=%x%s lpddc=%x\n", lpdds, isPrim?"(PRIM)":"", lpddc); // v2.1.84: SUPPRESSCLIPPING flag - improves "Monopoly Edition 3D" where continuous @@ -2861,7 +2791,7 @@ HRESULT WINAPI extLock(LPDIRECTDRAWSURFACE lpdds, LPRECT lprect, LPDIRECTDRAWSUR HRESULT res; BOOL IsPrim; - IsPrim=IsAPrimarySurface(lpdds); + IsPrim=dxw.IsAPrimarySurface(lpdds); if(IsTraceD){ OutTrace("Lock: lpdds=%x%s flags=%x(%s) lpdds2=%x", @@ -2893,7 +2823,7 @@ HRESULT WINAPI extUnlock(int dxversion, Unlock4_Type pUnlock, LPDIRECTDRAWSURFAC RECT screen, rect; BOOL IsPrim; - IsPrim=IsAPrimarySurface(lpdds); + IsPrim=dxw.IsAPrimarySurface(lpdds); if ((dxversion == 4) && lprect) CleanRect(&lprect,__LINE__); @@ -2976,16 +2906,13 @@ ReleaseDC with Unlock, returning the surface memory ptr (???) as HDC and avoiding the consistency check performed by surface::GetDC (why should it bother if the screen is 32BPP and the surface is not??? */ -HDC PrimSurfaceHDC = 0; -LPDIRECTDRAWSURFACE lpDDSPrimHDC=NULL; - HRESULT WINAPI extGetDC(LPDIRECTDRAWSURFACE lpdds, HDC FAR *pHDC) { HRESULT res; BOOL IsPrim; RECT client; - IsPrim=IsAPrimarySurface(lpdds); + IsPrim=dxw.IsAPrimarySurface(lpdds); OutTraceD("GetDC: lpdss=%x%s\n",lpdds, IsPrim?"(PRIM)":""); res=(*pGetDC)(lpdds,pHDC); if(res){ @@ -3006,8 +2933,7 @@ HRESULT WINAPI extGetDC(LPDIRECTDRAWSURFACE lpdds, HDC FAR *pHDC) // when getting DC from primary surface, save hdc and lpdds // for later possible use in GDI BitBlt wrapper function if (IsPrim){ - if (*pHDC) PrimSurfaceHDC=*pHDC; - lpDDSPrimHDC=lpdds; + dxw.lpDDSPrimHDC=lpdds; } // tricky part to allog GDI to operate on top of a directdraw surface's HDI. @@ -3126,7 +3052,7 @@ HRESULT WINAPI extReleaseDC(LPDIRECTDRAWSURFACE lpdds, HDC FAR hdc) OutTraceE("ReleaseDC: RevBlt ERROR res=%x(%s) at %d\n",res, ExplainDDError(res), __LINE__); break; } - if(IsAPrimarySurface(lpdds)){ + if(dxw.IsAPrimarySurface(lpdds)){ res=sBlt("ReleaseDC", lpdds, NULL, lpdds, NULL, 0, NULL, FALSE); if (res) OutTraceE("ReleaseDC: Blt ERROR res=%x(%s) at %d\n",res, ExplainDDError(res), __LINE__); } @@ -3341,7 +3267,7 @@ HRESULT WINAPI extGetPixelFormat(LPDIRECTDRAWSURFACE lpdds, LPDDPIXELFORMAT p) DWORD res; BOOL IsPrim; - IsPrim=IsAPrimarySurface(lpdds); + IsPrim=dxw.IsAPrimarySurface(lpdds); OutTraceD("GetPixelFormat: lpdds=%x%s\n", lpdds, IsPrim?"(PRIM)":""); res=(*pGetPixelFormat)(lpdds, p); if(res){ @@ -3383,7 +3309,7 @@ HRESULT WINAPI extReleaseS(LPDIRECTDRAWSURFACE lpdds) BOOL IsClosed; OutTraceD("Release(S): DEBUG - lpdds=%x\n", lpdds); - IsPrim=IsAPrimarySurface(lpdds); + IsPrim=dxw.IsAPrimarySurface(lpdds); // handling of service closed surfaces IsClosed=0; @@ -3401,7 +3327,7 @@ HRESULT WINAPI extReleaseS(LPDIRECTDRAWSURFACE lpdds) // when releasing primary surface, erase clipping region if(IsPrim && (dxw.dwFlags1 & CLIPCURSOR)) dxw.EraseClipCursor(); // if primary, clean primay surface list - if(IsPrim) UnmarkPrimarySurface(lpdds); + if(IsPrim) dxw.UnmarkPrimarySurface(lpdds); // service surfaces cleanup if(lpdds==lpDDSBack) { OutTraceD("Release(S): Clearing lpDDSBack pointer\n"); @@ -3416,14 +3342,9 @@ HRESULT WINAPI extReleaseS(LPDIRECTDRAWSURFACE lpdds) OutTraceD("Release(S): Clearing lpDDSEmu_Back pointer\n"); lpDDSEmu_Back=NULL; } - //if(lpdds==lpDDSHDC) { - // OutTraceD("Release(S): Clearing lpDDSHDC pointer\n"); - // lpDDSHDC=NULL; - //} - if(lpdds==lpDDSPrimHDC) { + if(lpdds==dxw.lpDDSPrimHDC) { OutTraceD("Release(S): Clearing lpDDSPrimHDC pointer\n"); - lpDDSPrimHDC=NULL; - PrimSurfaceHDC=0; + dxw.ResetPrimarySurface(); } } } @@ -3434,7 +3355,7 @@ HRESULT WINAPI extSetColorKey(LPDIRECTDRAWSURFACE lpdds, DWORD flags, LPDDCOLORK { HRESULT res; BOOL IsPrim; - IsPrim=IsAPrimarySurface(lpdds); + IsPrim=dxw.IsAPrimarySurface(lpdds); if(IsTraceD){ OutTrace("SetColorKey: lpdds=%x%s flags=%x(%s) ", lpdds, (IsPrim ? "(PRIM)" : ""), flags, ExplainColorKeyFlag(flags)); @@ -3454,7 +3375,7 @@ HRESULT WINAPI extGetColorKey(LPDIRECTDRAWSURFACE lpdds, DWORD flags, LPDDCOLORK { HRESULT res; BOOL IsPrim; - IsPrim=IsAPrimarySurface(lpdds); + IsPrim=dxw.IsAPrimarySurface(lpdds); OutTraceD("GetColorKey(S): lpdds=%x%s flags=%x(%s)\n", lpdds, (IsPrim ? "(PRIM)" : ""), flags, ExplainColorKeyFlag(flags)); res=(*pGetColorKey)(lpdds, flags, lpDDColorKey); @@ -3471,7 +3392,7 @@ HRESULT WINAPI extEnumAttachedSurfaces(LPDIRECTDRAWSURFACE lpdds, LPVOID lpConte HRESULT res; BOOL IsPrim; - IsPrim=IsAPrimarySurface(lpdds); + IsPrim=dxw.IsAPrimarySurface(lpdds); OutTraceD("EnumAttachedSurfaces: lpdds=%x%s Context=%x Callback=%x\n", lpdds, (IsPrim ? "(PRIM)":""), lpContext, lpEnumSurfacesCallback); @@ -3517,7 +3438,7 @@ HRESULT WINAPI extAddAttachedSurface(LPDIRECTDRAWSURFACE lpdds, LPDIRECTDRAWSURF // just remember this for further handling in the Flip operation. // But beware: this holds to BACKBUFFER surfaces only, and NOT for attached ZBUFFERS or similar! - IsPrim=IsAPrimarySurface(lpdds); + IsPrim=dxw.IsAPrimarySurface(lpdds); OutTraceD("AddAttachedSurface: lpdds=%x%s lpddsadd=%x\n", lpdds, IsPrim?"(PRIM)":"", lpddsadd); res=(*pAddAttachedSurface)(lpdds, lpddsadd); if (res) { @@ -3575,7 +3496,7 @@ HRESULT WINAPI extGetCapsS(int dxInterface, GetCapsS_Type pGetCapsS, LPDIRECTDRA { HRESULT res; BOOL IsPrim; - IsPrim=IsAPrimarySurface(lpdds); + IsPrim=dxw.IsAPrimarySurface(lpdds); OutTraceD("GetCaps(S%d): lpdds=%x%s, lpcaps=%x\n", dxInterface, lpdds, IsPrim?"(PRIM)":"", caps); res=(*pGetCapsS)(lpdds, caps); if(res) @@ -3734,7 +3655,7 @@ HRESULT WINAPI extGetSurfaceDesc(GetSurfaceDesc_Type pGetSurfaceDesc, LPDIRECTDR { HRESULT res; BOOL IsPrim; - IsPrim=IsAPrimarySurface(lpdds); + IsPrim=dxw.IsAPrimarySurface(lpdds); if (!pGetSurfaceDesc) { OutTraceE("GetSurfaceDesc: ERROR no hooked function\n"); diff --git a/dll/hdinput.cpp b/dll/hdinput.cpp index 0df0472..80f0b71 100644 --- a/dll/hdinput.cpp +++ b/dll/hdinput.cpp @@ -46,7 +46,7 @@ int iCurMinY; int iCurMaxX; int iCurMaxY; -int HookDirectInput(int version) +int HookDirectInput(char *module, int version) { HINSTANCE hinst; void *tmp; @@ -54,13 +54,13 @@ int HookDirectInput(int version) const GUID di7 = {0x9A4CB684,0x236D,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE}; const GUID di8 = {0xBF798030,0x483A,0x4DA2,0xAA,0x99,0x5D,0x64,0xED,0x36,0x97,0x00}; - tmp = HookAPI("dinput.dll", NULL, "DirectInputCreateA", extDirectInputCreate); + tmp = HookAPI(module, "dinput.dll", NULL, "DirectInputCreateA", extDirectInputCreate); if(tmp) pDirectInputCreate = (DirectInputCreate_Type)tmp; - tmp = HookAPI("dinput.dll", NULL, "DirectInputCreateW", extDirectInputCreate); + tmp = HookAPI(module, "dinput.dll", NULL, "DirectInputCreateW", extDirectInputCreate); if(tmp) pDirectInputCreate = (DirectInputCreate_Type)tmp; - tmp = HookAPI("dinput.dll", NULL, "DirectInputCreateEx", extDirectInputCreateEx); + tmp = HookAPI(module, "dinput.dll", NULL, "DirectInputCreateEx", extDirectInputCreateEx); if(tmp) pDirectInputCreateEx = (DirectInputCreateEx_Type)tmp; - tmp = HookAPI("dinput8.dll", NULL, "DirectInput8Create", extDirectInput8Create); + tmp = HookAPI(module, "dinput8.dll", NULL, "DirectInput8Create", extDirectInput8Create); if(tmp) pDirectInputCreateEx = (DirectInputCreateEx_Type)tmp; if(!pDirectInputCreate && !pDirectInputCreateEx){ if(version < 8){ diff --git a/dll/syslibs.cpp b/dll/syslibs.cpp index d9a744f..4853ec9 100644 --- a/dll/syslibs.cpp +++ b/dll/syslibs.cpp @@ -15,64 +15,27 @@ #define WINDOWDC 0xFFFFFFFF -extern GDIGetDC_Type pGDIGetDC; -extern GDIGetDC_Type pGDIGetWindowDC; -extern GDIReleaseDC_Type pGDIReleaseDC; extern DWORD PaletteEntries[256]; -extern HDC PrimSurfaceHDC; -extern LPDIRECTDRAWSURFACE lpDDSPrimHDC; extern LPDIRECTDRAW lpDD; extern Unlock4_Type pUnlockMethod(LPDIRECTDRAWSURFACE); extern GetDC_Type pGetDC; extern ReleaseDC_Type pReleaseDC; -extern SetCursor_Type pSetCursor; DEVMODE SetDevMode; DEVMODE *pSetDevMode=NULL; -extern short iPosX, iPosY, iSizX, iSizY; extern void do_slow(int); -extern LPDIRECTDRAWSURFACE GetPrimarySurface(void); +//extern LPDIRECTDRAWSURFACE GetPrimarySurface(void); extern HRESULT WINAPI extBlt(LPDIRECTDRAWSURFACE, LPRECT, LPDIRECTDRAWSURFACE, LPRECT, DWORD, LPDDBLTFX); extern HRESULT WINAPI sBlt(char *, LPDIRECTDRAWSURFACE, LPRECT, LPDIRECTDRAWSURFACE, LPRECT, DWORD, LPDDBLTFX, BOOL); -static SetLayeredWindowAttributes_Type pSetLayeredWindowAttributes = NULL; -#ifndef WS_EX_LAYERED -#define WS_EX_LAYERED 0x00080000 -#define LWA_COLORKEY 0x00000001 -#define LWA_ALPHA 0x00000002 -#endif -// Diablo: end -//extern char *ExplainShowCmd(int); - extern DirectDrawEnumerate_Type pDirectDrawEnumerate; extern DirectDrawEnumerateEx_Type pDirectDrawEnumerateEx; extern LRESULT CALLBACK extChildWindowProc(HWND, UINT, WPARAM, LPARAM); extern INT_PTR CALLBACK extDialogWindowProc(HWND, UINT, WPARAM, LPARAM); -GDIChoosePixelFormat_Type pGDIChoosePixelFormat; -GDIGetPixelFormat_Type pGDIGetPixelFormat; -GDISetPixelFormat_Type pGDISetPixelFormat; -CreateDC_Type pCreateDC; -StretchBlt_Type pStretchBlt; -SaveDC_Type pGDISaveDC; -RestoreDC_Type pGDIRestoreDC; -CreateDialogParam_Type pCreateDialogParam; -CreateDialogIndirectParam_Type pCreateDialogIndirectParam; -BeginPaint_Type pBeginPaint; -EndPaint_Type pEndPaint; -InvalidateRect_Type pInvalidateRect; -InvalidateRgn_Type pInvalidateRgn; -GDICreatePalette_Type pGDICreatePalette; -SelectPalette_Type pSelectPalette; -RealizePalette_Type pRealizePalette; -GetSystemPaletteEntries_Type pGetSystemPaletteEntries; -MoveWindow_Type pMoveWindow; -SetUnhandledExceptionFilter_Type pSetUnhandledExceptionFilter; -GetDiskFreeSpaceA_Type pGetDiskFreeSpaceA; - /* ------------------------------------------------------------------ */ static POINT FixMessagePt(HWND hwnd, POINT point) @@ -254,10 +217,10 @@ HWND WINAPI extCreateWindowExA( else { // invalid parent coordinates: use initial placement, but leave the size. // should also fix the window style and compensate for borders here? - x=iPosX; - y=iPosY; - nWidth=iSizX; - nHeight=iSizY; + x=dxw.iPosX; + y=dxw.iPosY; + nWidth=dxw.iSizX; + nHeight=dxw.iSizY; OutTraceD("CreateWindowEx: renewed BIG win pos=(%d,%d) size=(%d,%d)\n", x, y, nWidth, nHeight); } dxw.SetFullScreen(TRUE); @@ -344,7 +307,7 @@ COLORREF WINAPI extSetTextColor(HDC hdc, COLORREF crColor) if ((dxw.dwFlags1 & EMULATESURFACE) && (dxw.dwFlags1 & HANDLEDC) && (dxw.VirtualPixelFormat.dwRGBBitCount==8)) crColor=GetMatchingColor(crColor); - res=(*pSetTextColor)(hdc, crColor); + res=(*pGDISetTextColor)(hdc, crColor); OutTraceD("SetTextColor: color=%x res=%x%s\n", crColor, res, (res==CLR_INVALID)?"(CLR_INVALID)":""); return res; } @@ -356,7 +319,7 @@ COLORREF WINAPI extSetBkColor(HDC hdc, COLORREF crColor) if ((dxw.dwFlags1 & EMULATESURFACE) && (dxw.dwFlags1 & HANDLEDC) && (dxw.VirtualPixelFormat.dwRGBBitCount==8)) crColor=GetMatchingColor(crColor); - res=(*pSetBkColor)(hdc, crColor); + res=(*pGDISetBkColor)(hdc, crColor); OutTraceD("SetBkColor: color=%x res=%x%s\n", crColor, res, (res==CLR_INVALID)?"(CLR_INVALID)":""); return res; } @@ -602,7 +565,7 @@ BOOL WINAPI extTextOutA(HDC hdc, int nXStart, int nYStart, LPCTSTR lpString, int nXStart=anchor.x; nYStart=anchor.y; } - return (*pTextOutA)(hdc, nXStart, nYStart, lpString, cchString); + return (*pGDITextOutA)(hdc, nXStart, nYStart, lpString, cchString); } BOOL WINAPI extRectangle(HDC hdc, int nLeftRect, int nTopRect, int nRightRect, int nBottomRect) @@ -621,7 +584,7 @@ BOOL WINAPI extRectangle(HDC hdc, int nLeftRect, int nTopRect, int nRightRect, i nRightRect=anchor.x; nBottomRect=anchor.y; } - return (*pRectangle)(hdc, nLeftRect, nTopRect, nRightRect, nBottomRect); + return (*pGDIRectangle)(hdc, nLeftRect, nTopRect, nRightRect, nBottomRect); } int WINAPI extFillRect(HDC hdc, const RECT *lprc, HBRUSH hbr) @@ -645,34 +608,13 @@ int WINAPI extFillRect(HDC hdc, const RECT *lprc, HBRUSH hbr) return (*pFillRect)(hdc, &rc, hbr); } -int WINAPI extDrawFocusRect(HDC hdc, const RECT *lprc) -{ - RECT rc; - OutTraceD("DrawFocusRect: hdc=%x xy=(%d,%d)-(%d,%d)\n", hdc, lprc->left, lprc->top, lprc->right, lprc->bottom); - memcpy(&rc, lprc, sizeof(rc)); - if (dxw.dwFlags1 & FIXTEXTOUT) { - POINT anchor; - anchor.x=rc.left; - anchor.y=rc.top; - (*pClientToScreen)(dxw.GethWnd(), &anchor); - rc.left=anchor.x; - rc.top=anchor.y; - anchor.x=rc.right; - anchor.y=rc.bottom; - (*pClientToScreen)(dxw.GethWnd(), &anchor); - rc.right=anchor.x; - rc.bottom=anchor.y; - } - return (*pDrawFocusRect)(hdc, &rc); -} - HFONT WINAPI extCreateFont(int nHeight, int nWidth, int nEscapement, int nOrientation, int fnWeight, DWORD fdwItalic, DWORD fdwUnderline, DWORD fdwStrikeOut, DWORD fdwCharSet, DWORD fdwOutputPrecision, DWORD fdwClipPrecision, DWORD fdwQuality, DWORD fdwPitchAndFamily, LPCTSTR lpszFace) { OutTraceD("CreateFont: h=%d w=%d face=\"%s\"\n", nHeight, nWidth, lpszFace); - return (*pCreateFont)(nHeight, nWidth, nEscapement, nOrientation, fnWeight, + return (*pGDICreateFont)(nHeight, nWidth, nEscapement, nOrientation, fnWeight, fdwItalic, fdwUnderline, fdwStrikeOut, fdwCharSet, fdwOutputPrecision, fdwClipPrecision, NONANTIALIASED_QUALITY, fdwPitchAndFamily, lpszFace); @@ -687,7 +629,7 @@ HFONT WINAPI extCreateFontIndirect(const LOGFONT* lplf) OutTraceD("CreateFontIndirect: h=%d w=%d face=\"%s\"\n", lplf->lfHeight, lplf->lfWidth, lplf->lfFaceName); memcpy((char *)&lf, (char *)lplf, sizeof(LOGFONT)); lf.lfQuality=NONANTIALIASED_QUALITY; - retHFont=((*pCreateFontIndirect)(&lf)); + retHFont=((*pGDICreateFontIndirect)(&lf)); if(retHFont) OutTraceD("CreateFontIndirect: hfont=%x\n", retHFont); else @@ -812,8 +754,8 @@ BOOL WINAPI extSetWindowPos(HWND hwnd, HWND hWndInsertAfter, int X, int Y, int c if (dxw.dwFlags1 & PREVENTMAXIMIZE){ int UpdFlag =0; int MaxX, MaxY; - MaxX = iSizX; - MaxY = iSizY; + MaxX = dxw.iSizX; + MaxY = dxw.iSizY; if (!MaxX) MaxX = dxw.GetScreenWidth(); if (!MaxY) MaxY = dxw.GetScreenHeight(); if(cx>MaxX) { cx=MaxX; UpdFlag=1; } @@ -847,7 +789,7 @@ HDWP WINAPI extDeferWindowPos(HDWP hWinPosInfo, HWND hwnd, HWND hWndInsertAfter, if ((hwnd != dxw.GethWnd()) || !dxw.IsFullScreen()){ // just proxy - res=(*pDeferWindowPos)(hWinPosInfo, hwnd, hWndInsertAfter, X, Y, cx, cy, uFlags); + res=(*pGDIDeferWindowPos)(hWinPosInfo, hwnd, hWndInsertAfter, X, Y, cx, cy, uFlags); if(!res)OutTraceE("SetWindowPos: ERROR err=%d at %d\n", GetLastError(), __LINE__); return res; } @@ -859,8 +801,8 @@ HDWP WINAPI extDeferWindowPos(HDWP hWinPosInfo, HWND hwnd, HWND hWndInsertAfter, if (dxw.dwFlags1 & PREVENTMAXIMIZE){ int UpdFlag =0; int MaxX, MaxY; - MaxX = iSizX; - MaxY = iSizY; + MaxX = dxw.iSizX; + MaxY = dxw.iSizY; if (!MaxX) MaxX = dxw.GetScreenWidth(); if (!MaxY) MaxY = dxw.GetScreenHeight(); if(cx>MaxX) { cx=MaxX; UpdFlag=1; } @@ -880,7 +822,7 @@ HDWP WINAPI extDeferWindowPos(HDWP hWinPosInfo, HWND hwnd, HWND hWndInsertAfter, cx=rect.right; cy=rect.bottom; OutTraceD("SetWindowPos: main form hwnd=%x fixed size=(%d,%d)\n", hwnd, cx, cy); - res=(*pDeferWindowPos)(hWinPosInfo, hwnd, hWndInsertAfter, X, Y, cx, cy, uFlags); + res=(*pGDIDeferWindowPos)(hWinPosInfo, hwnd, hWndInsertAfter, X, Y, cx, cy, uFlags); if(!res)OutTraceE("DeferWindowPos: ERROR err=%d at %d\n", GetLastError(), __LINE__); return res; } @@ -890,8 +832,8 @@ void dxwFixWindowPos(char *ApiName, HWND hwnd, LPARAM lParam) LPWINDOWPOS wp; int MaxX, MaxY; wp = (LPWINDOWPOS)lParam; - MaxX = iSizX; - MaxY = iSizY; + MaxX = dxw.iSizX; + MaxY = dxw.iSizY; if (!MaxX) MaxX = dxw.GetScreenWidth(); if (!MaxY) MaxY = dxw.GetScreenHeight(); static int iLastCX, iLastCY; @@ -986,10 +928,10 @@ void dxwFixMinMaxInfo(char *ApiName, HWND hwnd, LPARAM lParam) lpmmi=(LPMINMAXINFO)lParam; OutTraceD("%s: GOT MaxPosition=(%d,%d) MaxSize=(%d,%d)\n", ApiName, lpmmi->ptMaxPosition.x, lpmmi->ptMaxPosition.y, lpmmi->ptMaxSize.x, lpmmi->ptMaxSize.y); - lpmmi->ptMaxPosition.x=iPosX; - lpmmi->ptMaxPosition.y=iPosY; - lpmmi->ptMaxSize.x = iSizX ? iSizX : dxw.GetScreenWidth(); - lpmmi->ptMaxSize.y = iSizY ? iSizY : dxw.GetScreenHeight(); + lpmmi->ptMaxPosition.x=dxw.iPosX; + lpmmi->ptMaxPosition.y=dxw.iPosY; + lpmmi->ptMaxSize.x = dxw.iSizX ? dxw.iSizX : dxw.GetScreenWidth(); + lpmmi->ptMaxSize.y = dxw.iSizY ? dxw.iSizY : dxw.GetScreenHeight(); OutTraceD("%s: SET LOCKWINPOS MaxPosition=(%d,%d) MaxSize=(%d,%d)\n", ApiName, lpmmi->ptMaxPosition.x, lpmmi->ptMaxPosition.y, lpmmi->ptMaxSize.x, lpmmi->ptMaxSize.y); } @@ -1129,7 +1071,7 @@ int WINAPI extGetDeviceCaps(HDC hdc, int nindex) { DWORD res; - res = (*pGetDeviceCaps)(hdc, nindex); + res = (*pGDIGetDeviceCaps)(hdc, nindex); OutTraceD("GetDeviceCaps: hdc=%x index=%x(%s) res=%x\n", hdc, nindex, ExplainDeviceCaps(nindex), res); @@ -1255,65 +1197,9 @@ BOOL WINAPI extScaleWindowExtEx(HDC hdc, int Xnum, int Xdenom, int Ynum, int Yde if ((dxw.dwFlags1 & LOCKWINPOS) && dxw.IsFullScreen()) return 1; - return (*pScaleWindowExtEx)(hdc, Xnum, Xdenom, Ynum, Ydenom, lpSize); + return (*pGDIScaleWindowExtEx)(hdc, Xnum, Xdenom, Ynum, Ydenom, lpSize); } -/* ---- pixel color management ----*/ - -int WINAPI extGDIChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR *ppfd) -{ - int ret; - - OutTraceD("GDIChoosePixelFormat: hdc=%x, pfd=%x\n", hdc, ppfd); - OutTraceD("GDIChoosePixelFormat: Version=%x Flags-%x PixelType=%x ColorBits=%x RedBits=%x RedShift=%x " - "GreenBits=%x BlueBits=%x BlueShift=%x AlphaBits=%x AlphaShift=%x", - ppfd->nVersion, ppfd->dwFlags, ppfd->iPixelType, ppfd->cColorBits, ppfd->cRedBits, ppfd->cRedShift, - ppfd->cGreenBits, ppfd->cGreenShift, ppfd->cBlueBits, ppfd->cBlueShift, ppfd->cAlphaBits, ppfd->cAlphaShift); - /* - ppfd->cAccumBits, ppfd->cAccumRedBits, ppfd->cAccumGreenBits, ppfd->cAccumBlueBits, ppfd->cAccumAlphaBits, - ppfd->cDepthBits, ppfd->cStencilBits, ppfd->cAuxBuffers, ppfd->iLayerType, ppfd->bReserved, - ppfd->dwLayerMask, ppfd->dwVisibleMask, ppfd->dwDamageMask - */ - - ret= (*pGDIChoosePixelFormat)(hdc, ppfd); - OutTraceD("GDIChoosePixelFormat: ret=%d\n",ret); - return ret; -} - -int WINAPI extGDIGetPixelFormat(HDC hdc) -{ - OutTraceD("GDIGetPixelFormat: hdc=%x\n", hdc); - return (*pGDIGetPixelFormat)(hdc); -} - -BOOL WINAPI extGDISetPixelFormat(HDC hdc, int iPixelFormat, const PIXELFORMATDESCRIPTOR *ppfd) -{ - OutTraceD("GDISetPixelFormat: hdc=%x\n", hdc); - -#if 0 - if(dxw.dwFlags1 & EMULATESURFACE){ - // set VirtualScr view - VirtualScr.dwRGBBitCount=ppfd->cColorBits; - VirtualScr.dwFlags=ppfd->dwFlags; - VirtualScr.dwRBitMask=(2^ppfd->cRedBits - 1)<cRedShift; - VirtualScr.dwGBitMask=(2^ppfd->cGreenBits - 1)<cGreenShift; - VirtualScr.dwBBitMask=(2^ppfd->cBlueBits - 1)<cBlueShift; - VirtualScr.dwRGBAlphaBitMask=(2^ppfd->cAlphaBits - 1)<cAlphaShift; - OutTraceD("GDISetPixelFormat: RGBA colorbits=%d mask=(%x,%x,%x,%x)\n", - VirtualScr.dwRGBBitCount, VirtualScr.dwRBitMask, VirtualScr.dwGBitMask, VirtualScr.dwBBitMask, VirtualScr.dwRGBAlphaBitMask); - return 0; - } -#endif - - return (*pGDISetPixelFormat)(hdc, iPixelFormat, ppfd); -} - -//HRGN WINAPI extCreateRectRgn(int nLeftRect, int nTopRect, int nRightRect, int nBottomRect) -//{ -// OutTraceD("CreateRectRgn: (%d,%d)-(%d,%d)\n", nLeftRect, nTopRect, nRightRect, nBottomRect); -// return (*pCreateRectRgn)(nLeftRect, nTopRect, nRightRect, nBottomRect); -//} - LONG WINAPI MyChangeDisplaySettings(char *fname, DEVMODE *lpDevMode, DWORD dwflags) { HRESULT res; @@ -1428,7 +1314,6 @@ BOOL WINAPI extClientToScreen(HWND whnd, LPPOINT lppoint) return 1; else return (*pClientToScreen)(whnd, lppoint); -// return 1; } BOOL WINAPI extScreenToClient(HWND whnd, LPPOINT lppoint) @@ -1437,7 +1322,6 @@ BOOL WINAPI extScreenToClient(HWND whnd, LPPOINT lppoint) return 1; else return (*pScreenToClient)(whnd, lppoint); -// return 1; } BOOL WINAPI extGetClientRect(HWND hwnd, LPRECT lpRect) @@ -1587,38 +1471,6 @@ BOOL WINAPI extGetMessage(LPMSG lpMsg, HWND hwnd, UINT wMsgFilterMin, UINT wMsgF return res; } -LRESULT WINAPI extDispatchMessage(LPMSG lpMsg) -{ - BOOL res; - DWORD Message; -#if WORKONCOPY - static MSG MsgCopy; - MsgCopy=*lpMsg; - MsgCopy.pt=FixMessagePt(dxw.GethWnd(), MsgCopy.pt); - Message=MsgCopy.message & 0xFFFF; - if((Message <= WM_MOUSELAST) && (Message >= WM_MOUSEFIRST)){ - MsgCopy.lParam = MAKELPARAM(MsgCopy.pt.x, MsgCopy.pt.y); - OutTraceC("PeekMessage: fixed lparam/pt=(%d,%d)\n", MsgCopy.pt.x, MsgCopy.pt.y); - } - res=(*pDispatchMessage)(&MsgCopy); - OutTraceW("DispatchMessage: lpmsg=%x msg=%x(%s) wparam=%x, lparam=%x pt=(%d,%d) res=%x\n", - lpMsg, MsgCopy.message, ExplainWinMessage(MsgCopy.message & 0xFFFF), - MsgCopy.wParam, MsgCopy.lParam, MsgCopy.pt.x, MsgCopy.pt.y, res); -#else - lpMsg->pt=FixMessagePt(dxw.GethWnd(), lpMsg->pt); - Message=lpMsg->message & 0xFFFF; - if((Message <= WM_MOUSELAST) && (Message >= WM_MOUSEFIRST)){ - lpMsg->lParam = MAKELPARAM(lpMsg->pt.x, lpMsg->pt.y); - OutTraceC("PeekMessage: fixed lparam/pt=(%d,%d)\n", lpMsg->pt.x, lpMsg->pt.y); - } - res=(*pDispatchMessage)(lpMsg); - OutTraceW("DispatchMessage: lpmsg=%x msg=%x(%s) wparam=%x, lparam=%x pt=(%d,%d) res=%x\n", - lpMsg, lpMsg->message, ExplainWinMessage(lpMsg->message & 0xFFFF), - lpMsg->wParam, lpMsg->lParam, lpMsg->pt.x, lpMsg->pt.y, res); -#endif - return res; -} - // intercept GetProcAddress to initialize DirectDraw hook pointers. // This is necessary in "The Sims" game, that loads DirectDraw dinamically @@ -1667,6 +1519,11 @@ HMODULE WINAPI extLoadLibraryA(LPCTSTR lpFileName) break; } } + // handle custom OpenGL library + if(!lstrcmpi(lpName,dxw.CustomOpenGLLib)){ + idx=SYSLIBIDX_OPENGL; + SysLibs[idx]=ret; + } if(idx==SYSLIBIDX_MAX) { OutTraceD("LoadLibraryA: hook %s\n", lpFileName); HookModule((char *)lpFileName, 0); @@ -1702,7 +1559,7 @@ extern DirectDrawCreateEx_Type pDirectDrawCreateEx; extern HRESULT WINAPI extDirectDrawCreate(GUID FAR *, LPDIRECTDRAW FAR *, IUnknown FAR *); extern HRESULT WINAPI extDirectDrawCreateEx(GUID FAR *, LPDIRECTDRAW FAR *, REFIID, IUnknown FAR *); extern GetProcAddress_Type pGetProcAddress; -extern HRESULT STDAPICALLTYPE extCoCreateInstance(REFCLSID, LPUNKNOWN, DWORD, REFIID, LPVOID FAR*); +//extern HRESULT STDAPICALLTYPE extCoCreateInstance(REFCLSID, LPUNKNOWN, DWORD, REFIID, LPVOID FAR*); int WINAPI extIsDebuggerPresent(void) { @@ -1775,6 +1632,7 @@ FARPROC WINAPI extGetProcAddress(HMODULE hModule, LPCSTR proc) break; case SYSLIBIDX_OPENGL: //default: + if(!(dxw.dwFlags2 & HOOKOPENGL)) break; if (remap=Remap_gl_ProcAddress(proc, hModule)) return remap; } } @@ -1837,6 +1695,7 @@ HDC WINAPI extGDIGetDC(HWND hwnd) { HDC ret; HWND lochwnd; + OutTraceD("GDI.GetDC: hwnd=%x\n", hwnd); lochwnd=hwnd; if (dxw.IsFullScreen() && ((hwnd==0) || (hwnd==(*pGetDesktopWindow)()))) { @@ -1910,11 +1769,11 @@ HDC WINAPI extGDICreateDC(LPSTR Driver, LPSTR Device, LPSTR Output, CONST DEVMOD if (!Driver || !strncmp(Driver,"DISPLAY",7)) { OutTraceD("GDI.CreateDC: returning window surface DC\n"); WinHDC=(*pGDIGetDC)(dxw.GethWnd()); - RetHDC=(*pCreateCompatibleDC)(WinHDC); + RetHDC=(*pGDICreateCompatibleDC)(WinHDC); (*pGDIReleaseDC)(dxw.GethWnd(), WinHDC); } else{ - RetHDC=(*pCreateDC)(Driver, Device, Output, InitData); + RetHDC=(*pGDICreateDC)(Driver, Device, Output, InitData); } if(RetHDC) OutTraceD("GDI.CreateDC: returning HDC=%x\n", RetHDC); @@ -1926,20 +1785,24 @@ HDC WINAPI extGDICreateDC(LPSTR Driver, LPSTR Device, LPSTR Output, CONST DEVMOD HDC WINAPI extGDICreateCompatibleDC(HDC hdc) { HDC RetHdc, SrcHdc; - extern HDC PrimSurfaceHDC; - extern LPDIRECTDRAWSURFACE lpDDSHDC, lpDDSPrimHDC; + extern LPDIRECTDRAWSURFACE lpDDSHDC; extern GetDC_Type pGetDC; + DWORD LastError; OutTraceD("GDI.CreateCompatibleDC: hdc=%x\n", hdc); if(hdc==0){ SrcHdc=(*pGDIGetDC)(dxw.GethWnd()); OutTraceD("GDI.CreateCompatibleDC: duplicating win HDC hWnd=%x\n", dxw.GethWnd()); } - RetHdc=(*pCreateCompatibleDC)(hdc); - if(RetHdc) + + // eliminated error message for errorcode 0. + SetLastError(0); + RetHdc=(*pGDICreateCompatibleDC)(hdc); + LastError=GetLastError(); + if(!LastError) OutTraceD("GDI.CreateCompatibleDC: returning HDC=%x\n", RetHdc); else - OutTraceE("GDI.CreateCompatibleDC ERROR: err=%d at %d\n", GetLastError(), __LINE__); + OutTraceE("GDI.CreateCompatibleDC ERROR: err=%d at %d\n", LastError, __LINE__); return RetHdc; } @@ -1962,10 +1825,10 @@ BOOL WINAPI extGDIBitBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nH nWDest= nWidth; nHDest= nHeight; dxw.MapRect(&nXDest, &nYDest, &nWDest, &nHDest); - res=(*pStretchBlt)(hdcDest, nXDest, nYDest, nWDest, nHDest, hdcSrc, nXSrc, nYSrc, nWidth, nHeight, dwRop); + res=(*pGDIStretchBlt)(hdcDest, nXDest, nYDest, nWDest, nHDest, hdcSrc, nXSrc, nYSrc, nWidth, nHeight, dwRop); } else { - res=(*pBitBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop); + res=(*pGDIBitBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop); } if(!res) OutTraceE("GDI.BitBlt: ERROR err=%d at %d\n", GetLastError(), __LINE__); @@ -1984,10 +1847,10 @@ BOOL WINAPI extGDIPatBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nH if (dxw.IsFullScreen() && (OBJ_DC == GetObjectType(hdcDest))){ int nWDest, nHDest; dxw.MapRect(&nXDest, &nYDest, &nWDest, &nHDest); - res=(*pPatBlt)(hdcDest, nXDest, nYDest, nWDest, nHDest, dwRop); + res=(*pGDIPatBlt)(hdcDest, nXDest, nYDest, nWDest, nHDest, dwRop); } else { - res=(*pPatBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, dwRop); + res=(*pGDIPatBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, dwRop); } if(!res) OutTraceE("GDI.PatBlt: ERROR err=%d at %d\n", GetLastError(), __LINE__); @@ -2006,7 +1869,7 @@ BOOL WINAPI extGDIStretchBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, in // to do: what happend if StretchBlt is applied on screen DC ? - res=(*pStretchBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, nWSrc, nHSrc, dwRop); + res=(*pGDIStretchBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, nWSrc, nHSrc, dwRop); if(!res) OutTraceE("GDI.StretchBlt: ERROR err=%d at %d\n", GetLastError(), __LINE__); return res; } @@ -2015,7 +1878,7 @@ BOOL WINAPI extGDIDeleteDC(HDC hdc) { BOOL res; OutTraceD("GDI.DeleteDC: hdc=%x\n", hdc); - res=(*pDeleteDC)(hdc); + res=(*pGDIDeleteDC)(hdc); if(!res) OutTraceE("GDI.DeleteDC: ERROR err=%d at %d\n", GetLastError(), __LINE__); return res; } @@ -2062,20 +1925,19 @@ static HDC PrimHDC=NULL; HDC WINAPI extDDCreateCompatibleDC(HDC hdc) { HDC RetHdc, SrcHdc; - extern LPDIRECTDRAWSURFACE lpDDSPrimHDC; extern GetDC_Type pGetDC; OutTraceD("GDI.CreateCompatibleDC: hdc=%x\n", hdc); if(hdc==0 && pGetDC && dxw.IsFullScreen()){ - if(!lpDDSPrimHDC) lpDDSPrimHDC=GetPrimarySurface(); - (*pGetDC)(lpDDSPrimHDC,&SrcHdc); - OutTraceD("GDI.CreateCompatibleDC: duplicating screen HDC lpDDSPrimHDC=%x\n", lpDDSPrimHDC); - RetHdc=(*pCreateCompatibleDC)(SrcHdc); - (*pReleaseDC)(lpDDSPrimHDC,SrcHdc); + dxw.SetPrimarySurface(); + (*pGetDC)(dxw.lpDDSPrimHDC,&SrcHdc); + OutTraceD("GDI.CreateCompatibleDC: duplicating screen HDC lpDDSPrimHDC=%x\n", dxw.lpDDSPrimHDC); + RetHdc=(*pGDICreateCompatibleDC)(SrcHdc); + (*pReleaseDC)(dxw.lpDDSPrimHDC,SrcHdc); } else - RetHdc=(*pCreateCompatibleDC)(hdc); + RetHdc=(*pGDICreateCompatibleDC)(hdc); if(RetHdc) OutTraceD("GDI.CreateCompatibleDC: returning HDC=%x\n", RetHdc); @@ -2091,7 +1953,7 @@ BOOL WINAPI extDDDeleteDC(HDC hdc) OutTraceD("GDI.DeleteDC: hdc=%x\n", hdc); - res=(*pDeleteDC)(hdc); + res=(*pGDIDeleteDC)(hdc); if(!res) OutTraceE("GDI.DeleteDC: ERROR err=%d at %d\n", GetLastError(), __LINE__); return res; } @@ -2104,26 +1966,24 @@ static HDC WINAPI winDDGetDC(HWND hwnd, char *api) OutTraceD("%s: hwnd=%x\n", api, hwnd); - lpDDSPrimHDC=GetPrimarySurface(); + dxw.ResetPrimarySurface(); + dxw.SetPrimarySurface(); - if(lpDDSPrimHDC){ + if(dxw.lpDDSPrimHDC){ if (PrimHDC){ OutTraceD("%s: reusing primary hdc\n", api); - (*pUnlockMethod(lpDDSPrimHDC))(lpDDSPrimHDC, NULL); + (*pUnlockMethod(dxw.lpDDSPrimHDC))(dxw.lpDDSPrimHDC, NULL); hdc=PrimHDC; } else{ - OutTraceD("%s: get hdc from PRIMARY surface lpdds=%x\n", api, lpDDSPrimHDC); - //res=(*pGetDC)(lpDDSPrimHDC,&hdc); - //res=lpDDSPrimHDC->GetDC(&hdc); - res=extGetDC(lpDDSPrimHDC,&hdc); + OutTraceD("%s: get hdc from PRIMARY surface lpdds=%x\n", api, dxw.lpDDSPrimHDC); + res=extGetDC(dxw.lpDDSPrimHDC,&hdc); if(res) { - OutTraceE("%s: GetDC(%x) ERROR %x(%s) at %d\n", api, lpDDSPrimHDC, res, ExplainDDError(res), __LINE__); + OutTraceE("%s: GetDC(%x) ERROR %x(%s) at %d\n", api, dxw.lpDDSPrimHDC, res, ExplainDDError(res), __LINE__); if(res==DDERR_DCALREADYCREATED){ // try recovery.... - (*pReleaseDC)(lpDDSPrimHDC,NULL); - //res=(*pGetDC)(lpDDSPrimHDC,&hdc); - res=extGetDC(lpDDSPrimHDC,&hdc); + (*pReleaseDC)(dxw.lpDDSPrimHDC,NULL); + res=extGetDC(dxw.lpDDSPrimHDC,&hdc); } if(res)return 0; } @@ -2153,13 +2013,13 @@ HDC WINAPI extDDCreateDC(LPSTR Driver, LPSTR Device, LPSTR Output, CONST DEVMODE //HDC PrimHDC; LPDIRECTDRAWSURFACE lpdds; OutTraceD("GDI.CreateDC: returning primary surface DC\n"); - lpdds=GetPrimarySurface(); + lpdds=dxw.GetPrimarySurface(); (*pGetDC)(lpdds, &PrimHDC); - RetHDC=(*pCreateCompatibleDC)(PrimHDC); + RetHDC=(*pGDICreateCompatibleDC)(PrimHDC); (*pReleaseDC)(lpdds, PrimHDC); } else{ - RetHDC=(*pCreateDC)(Driver, Device, Output, InitData); + RetHDC=(*pGDICreateDC)(Driver, Device, Output, InitData); } if(RetHDC) OutTraceD("GDI.CreateDC: returning HDC=%x\n", RetHDC); @@ -2189,22 +2049,11 @@ int WINAPI extDDReleaseDC(HWND hwnd, HDC hDC) OutTraceD("GDI.ReleaseDC: hwnd=%x hdc=%x\n", hwnd, hDC); res=0; -// if (hDC == PrimHDC /* && IsAScreenHDC(hDC) */){ if ((hDC == PrimHDC) || (hwnd==0)){ - if(!lpDDSPrimHDC) lpDDSPrimHDC=GetPrimarySurface(); - OutTraceD("GDI.ReleaseDC: refreshing primary surface lpdds=%x\n",lpDDSPrimHDC); - if(!lpDDSPrimHDC) return 0; -#if 0 - //extBlt(lpDDSPrimHDC, NULL, lpDDSPrimHDC, NULL, 0, NULL); - sBlt("GDI.ReleaseDC", lpDDSPrimHDC, NULL, lpDDSPrimHDC, NULL, 0, NULL, 0); - res=(*pUnlockMethod(lpDDSPrimHDC))(lpDDSPrimHDC, NULL); - //if(res) OutTraceE("Unlock ERROR: res=%x(%s) at %d\n", res, ExplainDDError(res), __LINE__); - res=(*pReleaseDC)(lpDDSPrimHDC,hDC); - if(res) OutTraceE("GDI.ReleaseDC: ReleaseDC ERROR=%x(%s) at %d\n", res, ExplainDDError(res), __LINE__); -#else - //lpDDSPrimHDC->ReleaseDC(hDC); - extReleaseDC(lpDDSPrimHDC, hDC); -#endif + dxw.SetPrimarySurface(); + OutTraceD("GDI.ReleaseDC: refreshing primary surface lpdds=%x\n",dxw.lpDDSPrimHDC); + if(!dxw.lpDDSPrimHDC) return 0; + extReleaseDC(dxw.lpDDSPrimHDC, hDC); PrimHDC=NULL; res=1; // 1 = OK } @@ -2222,31 +2071,6 @@ BOOL WINAPI extDDBitBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHe HRESULT res; extern HRESULT WINAPI extGetDC(LPDIRECTDRAWSURFACE, HDC FAR *); -#if 0 - OutTraceD("GDI.BitBlt: HDC=%x nXDest=%d nYDest=%d nWidth=%d nHeight=%d hdcSrc=%x nXSrc=%d nYSrc=%d dwRop=%x\n", - hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop); - - ret=1; // OK - - if(hdcDest==0) extGetDC(lpDDSPrimHDC, &hdcDest); - if(hdcDest != hdcSrc){ - ret=(*pBitBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop); - if(!ret) { - OutTraceE("GDI.BitBlt: ERROR err=%d at %d\n", GetLastError(), __LINE__); - return ret; - } - } - -// if(hdcDest==PrimHDC){ - { - if(!lpDDSPrimHDC) lpDDSPrimHDC=GetPrimarySurface(); - OutTraceD("GDI.BitBlt: refreshing primary surface lpdds=%x\n",lpDDSPrimHDC); - //extBlt(lpDDSPrimHDC, NULL, lpDDSPrimHDC, NULL, 0, NULL); - sBlt("GDI.BitBlt", lpDDSPrimHDC, NULL, lpDDSPrimHDC, NULL, 0, NULL, 0); - res=(*pUnlockMethod(lpDDSPrimHDC))(lpDDSPrimHDC, NULL); - //if(res) OutTraceE("Unlock: ERROR err=%x(%s) at %d\n", res, ExplainDDError(res), __LINE__); - } -#else OutTraceD("GDI.BitBlt: HDC=%x nXDest=%d nYDest=%d nWidth=%d nHeight=%d hdcSrc=%x nXSrc=%d nYSrc=%d dwRop=%x(%s)\n", hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop, ExplainROP(dwRop)); @@ -2254,26 +2078,18 @@ BOOL WINAPI extDDBitBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHe if(hdcDest==0) hdcDest=PrimHDC; if(hdcDest==0) { - lpDDSPrimHDC=GetPrimarySurface(); - res=extGetDC(lpDDSPrimHDC, &PrimHDC); + dxw.ResetPrimarySurface(); + dxw.SetPrimarySurface(); + res=extGetDC(dxw.lpDDSPrimHDC, &PrimHDC); hdcDest=PrimHDC; } - res=(*pBitBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop); + res=(*pGDIBitBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop); if(!res) OutTraceE("GDI.BitBlt: ERROR err=%d at %d\n", GetLastError(), __LINE__); - res=(*pBitBlt)(NULL, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop); + res=(*pGDIBitBlt)(NULL, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop); - //if(hdcDest==PrimHDC){ - // OutTraceD("GDI.BitBlt: refreshing primary surface lpdds=%x\n",lpDDSPrimHDC); - // //extBlt(lpDDSPrimHDC, NULL, lpDDSPrimHDC, NULL, 0, NULL); - // res=sBlt("GDI.BitBlt", lpDDSPrimHDC, NULL, lpDDSPrimHDC, NULL, 0, NULL, 0); - // if(res) OutTraceE("GDI.BitBlt: ERROR err=%x(%s) at %d\n", res, ExplainDDError(res), __LINE__); - // res=(*pUnlockMethod(lpDDSPrimHDC))(lpDDSPrimHDC, NULL); - // if(res) OutTraceE("Unlock: ERROR err=%x(%s) at %d\n", res, ExplainDDError(res), __LINE__); - //} if(!res) ret=0; -#endif return ret; } @@ -2290,21 +2106,16 @@ BOOL WINAPI extDDStretchBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int if(hdcDest != hdcSrc){ (*pGetClientRect)(dxw.GethWnd(),&ClientRect); - ret=(*pStretchBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, nWidth, nHeight, dwRop); + ret=(*pGDIStretchBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, nWidth, nHeight, dwRop); if(!ret) { OutTraceE("GDI.StretchBlt: ERROR err=%d at %d\n", GetLastError(), __LINE__); return ret; } } -// if(hdcDest==PrimHDC){ - { - if(!lpDDSPrimHDC) lpDDSPrimHDC=GetPrimarySurface(); - OutTraceD("GDI.StretchBlt: refreshing primary surface lpdds=%x\n",lpDDSPrimHDC); - //extBlt(lpDDSPrimHDC, NULL, lpDDSPrimHDC, NULL, 0, NULL); - sBlt("GDI.StretchBlt", lpDDSPrimHDC, NULL, lpDDSPrimHDC, NULL, 0, NULL, 0); - res=(*pUnlockMethod(lpDDSPrimHDC))(lpDDSPrimHDC, NULL); - //if(res) OutTraceE("Unlock: ERROR err=%x(%s) at %d\n", res, ExplainDDError(res), __LINE__); - } + dxw.SetPrimarySurface(); + OutTraceD("GDI.StretchBlt: refreshing primary surface lpdds=%x\n",dxw.lpDDSPrimHDC); + sBlt("GDI.StretchBlt", dxw.lpDDSPrimHDC, NULL, dxw.lpDDSPrimHDC, NULL, 0, NULL, 0); + res=(*pUnlockMethod(dxw.lpDDSPrimHDC))(dxw.lpDDSPrimHDC, NULL); return ret; } @@ -2322,9 +2133,8 @@ HDC WINAPI extBeginPaint(HWND hwnd, LPPAINTSTRUCT lpPaint) // on MAPGDITOPRIMARY, return the PrimHDC handle instead of the window DC if(dxw.dwFlags1 & MAPGDITOPRIMARY) { - if(pGetDC && lpDDSPrimHDC){ - //(*pGetDC)(lpDDSPrimHDC,&PrimHDC); - extGetDC(lpDDSPrimHDC,&PrimHDC); + if(pGetDC && dxw.lpDDSPrimHDC){ + extGetDC(dxw.lpDDSPrimHDC,&PrimHDC); OutTraceD("GDI.BeginPaint: redirect hdc=%x -> PrimHDC=%x\n", hdc, PrimHDC); hdc=PrimHDC; } @@ -2392,8 +2202,6 @@ HWND WINAPI extCreateDialogIndirectParam(HINSTANCE hInstance, LPCDLGTEMPLATE lpT if(!(*pSetWindowLong)(RetHWND, DWL_DLGPROC, (LONG)extDialogWindowProc)) OutTraceE("SetWindowLong: ERROR err=%d at %d\n", GetLastError(), __LINE__); - //if(!(*pMoveWindow)(RetHWND, iPosX, iPosY, iSizX, iSizY, FALSE)) - // OutTraceE("MoveWindow: ERROR err=%d at %d\n", GetLastError(), __LINE__); OutTraceD("CreateDialogIndirectParam: hwnd=%x\n", RetHWND); isWithinDialog=FALSE; //if (IsDebug) EnumChildWindows(RetHWND, (WNDENUMPROC)TraceChildWin, (LPARAM)RetHWND); @@ -2413,26 +2221,12 @@ HWND WINAPI extCreateDialogParam(HINSTANCE hInstance, LPCTSTR lpTemplateName, HW if(!(*pSetWindowLong)(RetHWND, DWL_DLGPROC, (LONG)extDialogWindowProc)) OutTraceE("SetWindowLong: ERROR err=%d at %d\n", GetLastError(), __LINE__); - //if(!(*pMoveWindow)(RetHWND, iPosX, iPosY, iSizX, iSizY, FALSE)) - // OutTraceE("MoveWindow: ERROR err=%d at %d\n", GetLastError(), __LINE__); OutTraceD("CreateDialogParam: hwnd=%x\n", RetHWND); isWithinDialog=FALSE; //if (IsDebug) EnumChildWindows(RetHWND, (WNDENUMPROC)TraceChildWin, (LPARAM)RetHWND); return RetHWND; } -HWND WINAPI extSetCapture(HWND hwnd) -{ - OutTraceD("SetCapture: hwnd=%x\n", hwnd); - return NULL; -} - -BOOL WINAPI extReleaseCapture(void) -{ - OutTraceD("ReleaseCapture\n"); - return 1; -} - BOOL WINAPI extDDInvalidateRect(HWND hwnd, RECT *lpRect, BOOL bErase) { if(lpRect) @@ -2457,13 +2251,6 @@ BOOL WINAPI extInvalidateRect(HWND hwnd, RECT *lpRect, BOOL bErase) return (*pInvalidateRect)(hwnd, NULL, bErase); } -BOOL WINAPI extInvalidateRgn(HWND hwnd, HRGN hRgn, BOOL bErase) -{ - OutTraceD("InvalidateRgn: hwnd=%x hrgn=%x erase=%x\n", - hwnd, hRgn, bErase); - return (*pInvalidateRgn)(hwnd, hRgn, bErase); -} - /* --------------------------------------------------------------------------- */ // v2.1.75: Hooking for GDI32 CreatePalette, SelectPalette, RealizePalette: @@ -2485,6 +2272,7 @@ HPALETTE WINAPI extGDICreatePalette(CONST LOGPALETTE *plpal) HPALETTE ret; int idx; + dxw.IsGDIPalette=TRUE; OutTraceD("GDI.CreatePalette: plpal=%x version=%x NumEntries=%x\n", plpal, plpal->palVersion, plpal->palNumEntries); ret=(*pGDICreatePalette)(plpal); if(IsDebug){ @@ -2504,8 +2292,7 @@ HPALETTE WINAPI extSelectPalette(HDC hdc, HPALETTE hpal, BOOL bForceBackground) { HPALETTE ret; - ret=(*pSelectPalette)(hdc, hpal, bForceBackground); - //G_bForceBackground=bForceBackground; + ret=(*pGDISelectPalette)(hdc, hpal, bForceBackground); OutTraceD("GDI.SelectPalette: hdc=%x hpal=%x ForceBackground=%x ret=%x\n", hdc, hpal, bForceBackground, ret); return ret; } @@ -2515,13 +2302,16 @@ UINT WINAPI extRealizePalette(HDC hdc) UINT ret; extern void mySetPalette(int, int, LPPALETTEENTRY); - ret=(*pRealizePalette)(hdc); + ret=(*pGDIRealizePalette)(hdc); OutTraceD("GDI.RealizePalette: hdc=%x ret=%x\n", hdc, ret); + + if(!dxw.IsGDIPalette) return ret; + // quick & dirty implementation through a nasty global: // if the SelectPalette didn't force to the background (arg bForceBackground==FALSE) // then don't override the current palette set by the DirectDrawPalette class. // should be cleaned up a little.... - // maybe not: now both Diable & Dementia colors are working... + // maybe not: now both Diablo & Dementia colors are working... if(dxw.dwFlags1 & EMULATESURFACE) mySetPalette(0, MyPal.palNumEntries, MyPal.palPalEntry); // DEBUGGING @@ -2531,7 +2321,6 @@ UINT WINAPI extRealizePalette(HDC hdc) for(idx=0; idxwHour, lpSystemTime->wMinute, lpSystemTime->wSecond, lpSystemTime->wMilliseconds); +} + + +void WINAPI extGetLocalTime(LPSYSTEMTIME lpLocalTime) +{ + SYSTEMTIME SystemTime; + dxw.GetSystemTime(&SystemTime); + SystemTimeToTzSpecificLocalTime(NULL, &SystemTime, lpLocalTime); + OutTrace("GetLocalTime: %02d:%02d:%02d.%03d\n", + 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); + 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; + dwNewDelay=dwMilliseconds; + if (dwMilliseconds!=INFINITE && dwMilliseconds!=0){ + dwNewDelay = dxw.StretchTime(dwMilliseconds); + if (dwNewDelay==0){ // oh oh! troubles... + if (dxw.TimeShift > 0) dwNewDelay=1; // minimum allowed... + else dwNewDelay = INFINITE-1; // maximum allowed !!! + } + } + OutTrace("Sleep: msec=%d->%d timeshift=%d\n", dwMilliseconds, dwNewDelay, dxw.TimeShift); + (*pSleep)(dwNewDelay); +} + +DWORD WINAPI extSleepEx(DWORD dwMilliseconds, BOOL bAlertable) +{ + DWORD dwNewDelay; + dwNewDelay=dwMilliseconds; + if (dwMilliseconds!=INFINITE && dwMilliseconds!=0){ + dwNewDelay = dxw.StretchTime(dwMilliseconds); + if (dwNewDelay==0){ // oh oh! troubles... + if (dxw.TimeShift > 0) dwNewDelay=1; // minimum allowed... + else dwNewDelay = INFINITE-1; // maximum allowed !!! + } + } + OutTrace("SleepEx: msec=%d->%d alertable=%x, timeshift=%d\n", dwMilliseconds, dwNewDelay, bAlertable, dxw.TimeShift); + return (*pSleepEx)(dwNewDelay, bAlertable); +} + +int WINAPI extShowCursor(BOOL bShow) +{ + static int iFakeCounter; + int ret; + + OutTraceD("ShowCursor: bShow=%x\n", bShow); + if (bShow){ + if (dxw.dwFlags1 & HIDEHWCURSOR){ + iFakeCounter++; + OutTraceD("ShowCursor: HIDEHWCURSOR ret=%x\n", iFakeCounter); + return iFakeCounter; + } + } + else { + if (dxw.dwFlags2 & SHOWHWCURSOR){ + iFakeCounter--; + OutTraceD("ShowCursor: SHOWHWCURSOR ret=%x\n", iFakeCounter); + return iFakeCounter; + } + } + ret=(*pShowCursor)(bShow); + OutTraceD("ShowCursor: ret=%x\n", ret); + return ret; } \ No newline at end of file diff --git a/dll/syslibs.h b/dll/syslibs.h index 696cb8c..c178e0b 100644 --- a/dll/syslibs.h +++ b/dll/syslibs.h @@ -1,166 +1,285 @@ /* =================================================================== -u32lib.h: contains typedef definition and extern pointer declarations -for all GDI32.dll and user32.dll functions hooked by DxWnd +syslibs.h: contains typedef definition and extern pointer declarations +for all system calls hooked by DxWnd: +GDI32.dll +Kernel32.dll +ole32.dll +user32.dll.dll ====================================================================*/ -typedef BOOL (WINAPI *GetCursorPos_Type)(LPPOINT); -typedef BOOL (WINAPI *SetCursorPos_Type)(int, int); -typedef HCURSOR (WINAPI *SetCursor_Type)(HCURSOR); -typedef BOOL (WINAPI *ClipCursor_Type)(const RECT *); -typedef BOOL (WINAPI *TextOut_Type)(HDC, int, int, LPCTSTR, int); -typedef BOOL (WINAPI *Rectangle_Type)(HDC, int, int, int, int); -typedef COLORREF (WINAPI *SetBkColor_Type)(HDC, COLORREF); -typedef COLORREF (WINAPI *SetTextColor_Type)(HDC, COLORREF); -typedef HFONT (WINAPI *CreateFont_Type)(int, int, int, int, int, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, LPCTSTR); -typedef HFONT (WINAPI *CreateFontIndirect_Type)(const LOGFONT*); -typedef HDC (WINAPI *GDIGetDC_Type)(HWND); -typedef int (WINAPI *GDIReleaseDC_Type)(HWND, HDC); -typedef BOOL (WINAPI *ColorCorrectPalette_Type)(HDC, HPALETTE, DWORD, DWORD); -typedef HWND (WINAPI *CreateWindowExA_Type)(DWORD, LPCTSTR, LPCTSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, LPVOID); -typedef HWND (WINAPI *GetDesktopWindow_Type)(void); -typedef BOOL (WINAPI *ShowWindow_Type)(HWND, int); -typedef int (WINAPI *FillRect_Type)(HDC, const RECT *, HBRUSH); -typedef int (WINAPI *DrawFocusRect_Type)(HDC, const RECT *); -typedef int (WINAPI *GetSystemMetrics_Type)(int); -typedef int (WINAPI *GetDeviceCaps_Type)(HDC, int); -typedef int (WINAPI *GDIGetDisplayMode_Type)(HDC, int); -typedef BOOL (WINAPI *ShowWindow_Type)(HWND, int); -typedef LONG (WINAPI *SetWindowLong_Type)(HWND, int, LONG); -typedef LONG (WINAPI *GetWindowLong_Type)(HWND, int); -typedef BOOL (WINAPI *SetWindowPos_Type)(HWND, HWND, int, int, int, int, UINT); -typedef HDWP (WINAPI *DeferWindowPos_Type)(HDWP, HWND, HWND, int, int, int, int, UINT); -typedef LRESULT (WINAPI *CallWindowProc_Type)(WNDPROC, HWND, UINT, WPARAM, LPARAM); -typedef BOOL (WINAPI *ScaleWindowExtEx_Type)(HDC, int, int, int, int, LPSIZE); -typedef int (WINAPI *GDIChoosePixelFormat_Type)(HDC, const PIXELFORMATDESCRIPTOR *); -typedef int (WINAPI *GDIGetPixelFormat_Type)(HDC hdc); -typedef BOOL (WINAPI *GDISetPixelFormat_Type)(HDC, int, const PIXELFORMATDESCRIPTOR *); -//typedef HRGN (WINAPI *CreateRectRgn_Type)(int, int, int, int); -typedef LRESULT (WINAPI *DefWindowProc_Type)(HWND, UINT, WPARAM, LPARAM); -typedef LONG (WINAPI *ChangeDisplaySettings_Type)(DEVMODE *, DWORD); -typedef LONG (WINAPI *ChangeDisplaySettingsEx_Type)(LPCTSTR, DEVMODE *, HWND, DWORD, LPVOID); -typedef LONG (WINAPI *EnumDisplaySettings_Type)(LPCTSTR, DWORD, LPDEVMODEA); -typedef BOOL (WINAPI *SetWindowPlacement_Type)(const WINDOWPLACEMENT*); -typedef DWORD (WINAPI *SetLayeredWindowAttributes_Type)(HWND, DWORD, BYTE, DWORD); -typedef HDC (WINAPI *CreateCompatibleDC_Type)(HDC); -typedef BOOL (WINAPI *DeleteDC_Type)(HDC); -typedef BOOL (WINAPI *BitBlt_Type)(HDC, int, int, int, int, HDC, int, int, DWORD); -typedef BOOL (WINAPI *PatBlt_Type)(HDC, int, int, int, int, DWORD); -typedef BOOL (WINAPI *StretchBlt_Type)(HDC, int, int, int, int, HDC, int, int, int, int, DWORD); -typedef HDC (WINAPI *CreateDC_Type)(LPCSTR, LPCSTR, LPCSTR, const DEVMODE *); -typedef int (WINAPI *SaveDC_Type)(HDC); -typedef BOOL (WINAPI *RestoreDC_Type)(HDC, int); -typedef HDC (WINAPI *BeginPaint_Type)(HWND, LPPAINTSTRUCT); -typedef BOOL (WINAPI *EndPaint_Type)(HWND, const PAINTSTRUCT *); +/* =================================================================== +type definitions +====================================================================*/ +// GDI32.dll: +typedef BOOL (WINAPI *BitBlt_Type)(HDC, int, int, int, int, HDC, int, int, DWORD); +typedef HDC (WINAPI *CreateCompatibleDC_Type)(HDC); +typedef HDC (WINAPI *CreateDC_Type)(LPCSTR, LPCSTR, LPCSTR, const DEVMODE *); +typedef HFONT (WINAPI *CreateFont_Type)(int, int, int, int, int, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, LPCTSTR); +typedef HFONT (WINAPI *CreateFontIndirect_Type)(const LOGFONT*); +typedef HPALETTE(WINAPI *GDICreatePalette_Type)(CONST LOGPALETTE *); +typedef HDWP (WINAPI *DeferWindowPos_Type)(HDWP, HWND, HWND, int, int, int, int, UINT); +typedef BOOL (WINAPI *DeleteDC_Type)(HDC); +typedef int (WINAPI *GetDeviceCaps_Type)(HDC, int); +typedef BOOL (WINAPI *GetDeviceGammaRamp_Type)(HDC, LPVOID); +typedef BOOL (WINAPI *GetSystemPaletteEntries_Type)(HDC, UINT, UINT, LPPALETTEENTRY); +typedef BOOL (WINAPI *PatBlt_Type)(HDC, int, int, int, int, DWORD); +typedef UINT (WINAPI *RealizePalette_Type)(HDC); +typedef BOOL (WINAPI *Rectangle_Type)(HDC, int, int, int, int); +typedef BOOL (WINAPI *RestoreDC_Type)(HDC, int); +typedef int (WINAPI *SaveDC_Type)(HDC); +typedef BOOL (WINAPI *ScaleWindowExtEx_Type)(HDC, int, int, int, int, LPSIZE); +typedef HPALETTE(WINAPI *SelectPalette_Type)(HDC, HPALETTE, BOOL); +typedef COLORREF (WINAPI *SetBkColor_Type)(HDC, COLORREF); +typedef BOOL (WINAPI *SetDeviceGammaRamp_Type)(HDC, LPVOID); +typedef COLORREF(WINAPI *SetTextColor_Type)(HDC, COLORREF); +typedef BOOL (WINAPI *StretchBlt_Type)(HDC, int, int, int, int, HDC, int, int, int, int, DWORD); +typedef BOOL (WINAPI *TextOut_Type)(HDC, int, int, LPCTSTR, int); + +// Kernel32.dll: +typedef BOOL (WINAPI *GetDiskFreeSpaceA_Type)(LPCSTR, LPDWORD, LPDWORD, LPDWORD, LPDWORD); +typedef void (WINAPI *GetLocalTime_Type)(LPSYSTEMTIME); +typedef FARPROC (WINAPI *GetProcAddress_Type)(HMODULE, LPCSTR); +typedef void (WINAPI *GetSystemTime_Type)(LPSYSTEMTIME); +typedef DWORD (WINAPI *GetTickCount_Type)(void); typedef HMODULE (WINAPI *LoadLibraryA_Type)(LPCTSTR); typedef HMODULE (WINAPI *LoadLibraryExA_Type)(LPCTSTR, HANDLE, DWORD); -typedef BOOL (WINAPI *GetClipCursor_Type)(LPRECT); -typedef ATOM (WINAPI *RegisterClassExA_Type)(WNDCLASSEX *); -typedef BOOL (WINAPI *ScreenToClient_Type)(HWND, LPPOINT); -typedef BOOL (WINAPI *ClientToScreen_Type)(HWND, LPPOINT); -typedef BOOL (WINAPI *GetClientRect_Type)(HWND, LPRECT); -typedef BOOL (WINAPI *GetWindowRect_Type)(HWND, LPRECT); -typedef int (WINAPI *MapWindowPoints_Type)(HWND, HWND, LPPOINT, UINT); +typedef LPTOP_LEVEL_EXCEPTION_FILTER + (WINAPI *SetUnhandledExceptionFilter_Type)(LPTOP_LEVEL_EXCEPTION_FILTER); +typedef void (WINAPI *Sleep_Type)(DWORD); +typedef DWORD (WINAPI *SleepEx_Type)(DWORD, BOOL); -typedef BOOL (WINAPI *PeekMessage_Type)(LPMSG, HWND, UINT, UINT, UINT); -typedef BOOL (WINAPI *GetMessage_Type)(LPMSG, HWND, UINT, UINT); -typedef LRESULT (WINAPI *DispatchMessage_Type)(LPMSG); -typedef FARPROC (WINAPI *GetProcAddress_Type)(HMODULE, LPCSTR); -//typedef BOOL (WINAPI *GetUpdateRect_Type)(HWND, LPRECT, BOOL); -typedef HWND (WINAPI *CreateDialogIndirectParam_Type)(HINSTANCE, LPCDLGTEMPLATE, HWND, DLGPROC, LPARAM); -typedef HWND (WINAPI *CreateDialogParam_Type)(HINSTANCE, LPCTSTR, HWND, DLGPROC, LPARAM); -typedef BOOL (WINAPI *InvalidateRect_Type)(HWND, CONST RECT *, BOOL); -typedef BOOL (WINAPI *InvalidateRgn_Type)(HWND, HRGN, BOOL); +// ole32.dll: typedef HRESULT (STDAPICALLTYPE *CoCreateInstance_Type)(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID riid, LPVOID FAR* ppv); -typedef HPALETTE (WINAPI *SelectPalette_Type)(HDC, HPALETTE, BOOL); -typedef UINT (WINAPI *RealizePalette_Type)(HDC); -typedef HDC (WINAPI *BeginPaint_Type)(HWND, LPPAINTSTRUCT); -typedef HPALETTE (WINAPI *GDICreatePalette_Type)(CONST LOGPALETTE *); -typedef BOOL (WINAPI *GetSystemPaletteEntries_Type)(HDC, UINT, UINT, LPPALETTEENTRY); -typedef BOOL (WINAPI *MoveWindow_Type)(HWND, int, int, int, int, BOOL); - -typedef LPTOP_LEVEL_EXCEPTION_FILTER (WINAPI *SetUnhandledExceptionFilter_Type)(LPTOP_LEVEL_EXCEPTION_FILTER); - -typedef BOOL (WINAPI *GetDiskFreeSpaceA_Type)(LPCSTR, LPDWORD, LPDWORD, LPDWORD, LPDWORD); -typedef BOOL (WINAPI *SetDeviceGammaRamp_Type)(HDC, LPVOID); -typedef BOOL (WINAPI *GetDeviceGammaRamp_Type)(HDC, LPVOID); +// user32.dll: +typedef HDC (WINAPI *BeginPaint_Type)(HWND, LPPAINTSTRUCT); +typedef LRESULT (WINAPI *CallWindowProc_Type)(WNDPROC, HWND, UINT, WPARAM, LPARAM); +typedef LONG (WINAPI *ChangeDisplaySettings_Type)(DEVMODE *, DWORD); +typedef LONG (WINAPI *ChangeDisplaySettingsEx_Type)(LPCTSTR, DEVMODE *, HWND, DWORD, LPVOID); +typedef BOOL (WINAPI *ClientToScreen_Type)(HWND, LPPOINT); +typedef BOOL (WINAPI *ClipCursor_Type)(const RECT *); +typedef HWND (WINAPI *CreateDialogIndirectParam_Type)(HINSTANCE, LPCDLGTEMPLATE, HWND, DLGPROC, LPARAM); +typedef HWND (WINAPI *CreateDialogParam_Type)(HINSTANCE, LPCTSTR, HWND, DLGPROC, LPARAM); +typedef HWND (WINAPI *CreateWindowExA_Type)(DWORD, LPCTSTR, LPCTSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, LPVOID); +typedef LRESULT (WINAPI *DefWindowProc_Type)(HWND, UINT, WPARAM, LPARAM); +typedef BOOL (WINAPI *EndPaint_Type)(HWND, const PAINTSTRUCT *); +typedef LONG (WINAPI *EnumDisplaySettings_Type)(LPCTSTR, DWORD, LPDEVMODEA); +typedef int (WINAPI *FillRect_Type)(HDC, const RECT *, HBRUSH); +typedef BOOL (WINAPI *GetClientRect_Type)(HWND, LPRECT); +typedef BOOL (WINAPI *GetClipCursor_Type)(LPRECT); +typedef BOOL (WINAPI *GetCursorPos_Type)(LPPOINT); +typedef HDC (WINAPI *GDIGetDC_Type)(HWND); +typedef HWND (WINAPI *GetDesktopWindow_Type)(void); +typedef BOOL (WINAPI *GetMessage_Type)(LPMSG, HWND, UINT, UINT); +typedef int (WINAPI *GetSystemMetrics_Type)(int); +typedef LONG (WINAPI *GetWindowLong_Type)(HWND, int); +typedef BOOL (WINAPI *GetWindowRect_Type)(HWND, LPRECT); +typedef BOOL (WINAPI *InvalidateRect_Type)(HWND, CONST RECT *, BOOL); +typedef int (WINAPI *MapWindowPoints_Type)(HWND, HWND, LPPOINT, UINT); +typedef BOOL (WINAPI *MoveWindow_Type)(HWND, int, int, int, int, BOOL); +typedef BOOL (WINAPI *PeekMessage_Type)(LPMSG, HWND, UINT, UINT, UINT); +typedef ATOM (WINAPI *RegisterClassExA_Type)(WNDCLASSEX *); +typedef int (WINAPI *GDIReleaseDC_Type)(HWND, HDC); +typedef BOOL (WINAPI *ScreenToClient_Type)(HWND, LPPOINT); typedef LRESULT (WINAPI *SendMessage_Type)(HWND, UINT, WPARAM, LPARAM); -typedef DWORD (WINAPI *GetTickCount_Type)(void); +typedef HCURSOR (WINAPI *SetCursor_Type)(HCURSOR); +typedef BOOL (WINAPI *SetCursorPos_Type)(int, int); +typedef UINT_PTR(WINAPI *SetTimer_Type)(HWND, UINT_PTR, UINT, TIMERPROC); +typedef LONG (WINAPI *SetWindowLong_Type)(HWND, int, LONG); +typedef BOOL (WINAPI *SetWindowPos_Type)(HWND, HWND, int, int, int, int, UINT); +typedef int (WINAPI *ShowCursor_Type)(BOOL); +typedef BOOL (WINAPI *ShowWindow_Type)(HWND, int); -extern GetCursorPos_Type pGetCursorPos; -extern SetCursorPos_Type pSetCursorPos; -extern ClipCursor_Type pClipCursor; -extern TextOut_Type pTextOutA; -extern FillRect_Type pFillRect; -extern DrawFocusRect_Type pDrawFocusRect; -extern Rectangle_Type pRectangle; -extern SetTextColor_Type pSetTextColor; -extern GetSystemMetrics_Type pGetSystemMetrics; -extern CreateFont_Type pCreateFont; -extern CreateFontIndirect_Type pCreateFontIndirect; -extern SetBkColor_Type pSetBkColor; -extern GetDeviceCaps_Type pGetDeviceCaps; -extern GDIGetDisplayMode_Type pGDIGetDisplayMode; -extern ColorCorrectPalette_Type pColorCorrectPalette; -extern CreateWindowExA_Type pCreateWindowExA; -extern GetDesktopWindow_Type pGetDesktopWindow; -extern ShowWindow_Type pShowWindow; -extern SetWindowLong_Type pSetWindowLong; -extern GetWindowLong_Type pGetWindowLong; -extern SetWindowPos_Type pSetWindowPos; -extern DeferWindowPos_Type pDeferWindowPos; -extern CallWindowProc_Type pCallWindowProc; -extern ScaleWindowExtEx_Type pScaleWindowExtEx; -extern GDIChoosePixelFormat_Type pGDIChoosePixelFormat; -extern GDIGetPixelFormat_Type pGDIGetPixelFormat; -extern GDISetPixelFormat_Type pGDISetPixelFormat; -//extern CreateRectRgn_Type pCreateRectRgn; -extern DefWindowProc_Type pDefWindowProc; -extern ChangeDisplaySettings_Type pChangeDisplaySettings; -extern ChangeDisplaySettingsEx_Type pChangeDisplaySettingsEx; -extern EnumDisplaySettings_Type pEnumDisplaySettings; -extern SetWindowPlacement_Type pSetWindowPlacement; -extern CreateCompatibleDC_Type pCreateCompatibleDC; -extern DeleteDC_Type pDeleteDC; -extern BitBlt_Type pBitBlt; -extern PatBlt_Type pPatBlt; -extern StretchBlt_Type pStretchBlt; -extern CreateDC_Type pCreateDC; -extern SaveDC_Type pGDISaveDC; -extern RestoreDC_Type pGDIRestoreDC; -extern MapWindowPoints_Type pMapWindowPoints; +/* =================================================================== +hooked APIs real pointers +====================================================================*/ -extern LoadLibraryA_Type pLoadLibraryA; -extern LoadLibraryExA_Type pLoadLibraryExA; -extern GetClipCursor_Type pGetClipCursor; -extern RegisterClassExA_Type pRegisterClassExA; -extern ScreenToClient_Type pScreenToClient; -extern ClientToScreen_Type pClientToScreen; -extern GetClientRect_Type pGetClientRect; -extern GetWindowRect_Type pGetWindowRect; -extern PeekMessage_Type pPeekMessage; -extern GetMessage_Type pGetMessage; -extern DispatchMessage_Type pDispatchMessage; -extern GetProcAddress_Type pGetProcAddress; -//extern GetUpdateRect_Type pGetUpdateRect; -extern CreateDialogParam_Type pCreateDialogParam; -extern CreateDialogIndirectParam_Type pCreateDialogIndirectParam; -extern BeginPaint_Type pBeginPaint; -extern EndPaint_Type pEndPaint; -extern InvalidateRect_Type pInvalidateRect; -extern CoCreateInstance_Type pCoCreateInstance; -extern GDICreatePalette_Type pGDICreatePalette; -extern SelectPalette_Type pSelectPalette; -extern RealizePalette_Type pRealizePalette; -extern GetSystemPaletteEntries_Type pGetSystemPaletteEntries; -extern MoveWindow_Type pMoveWindow; -extern SetUnhandledExceptionFilter_Type pSetUnhandledExceptionFilter; -extern GetDiskFreeSpaceA_Type pGetDiskFreeSpaceA; -extern SetDeviceGammaRamp_Type pSetDeviceGammaRamp; -extern GetDeviceGammaRamp_Type pGetDeviceGammaRamp; -extern SendMessage_Type pSendMessage; -extern GetTickCount_Type pGetTickCount; +#ifdef DXWDECLARATIONS +#undef DXWEXTERN +#undef DXWINITIALIZED +#define DXWEXTERN +#define DXWINITIALIZED = NULL +#else +#undef DXWEXTERN +#undef DXWINITIALIZED +#define DXWEXTERN extern +#define DXWINITIALIZED +#endif +// GDI32.dll: +DXWEXTERN BitBlt_Type pGDIBitBlt DXWINITIALIZED; +DXWEXTERN CreateCompatibleDC_Type pGDICreateCompatibleDC DXWINITIALIZED; +DXWEXTERN CreateDC_Type pGDICreateDC DXWINITIALIZED; +DXWEXTERN CreateFont_Type pGDICreateFont DXWINITIALIZED; +DXWEXTERN CreateFontIndirect_Type pGDICreateFontIndirect DXWINITIALIZED; +DXWEXTERN GDICreatePalette_Type pGDICreatePalette DXWINITIALIZED; +DXWEXTERN DeferWindowPos_Type pGDIDeferWindowPos DXWINITIALIZED; +DXWEXTERN DeleteDC_Type pGDIDeleteDC DXWINITIALIZED; +DXWEXTERN GetDeviceCaps_Type pGDIGetDeviceCaps DXWINITIALIZED; +DXWEXTERN GetDeviceGammaRamp_Type pGDIGetDeviceGammaRamp DXWINITIALIZED; +DXWEXTERN GetSystemPaletteEntries_Type pGDIGetSystemPaletteEntries DXWINITIALIZED; +DXWEXTERN PatBlt_Type pGDIPatBlt DXWINITIALIZED; +DXWEXTERN RealizePalette_Type pGDIRealizePalette DXWINITIALIZED; +DXWEXTERN Rectangle_Type pGDIRectangle DXWINITIALIZED; +DXWEXTERN RestoreDC_Type pGDIRestoreDC DXWINITIALIZED; +DXWEXTERN SaveDC_Type pGDISaveDC DXWINITIALIZED; +DXWEXTERN ScaleWindowExtEx_Type pGDIScaleWindowExtEx DXWINITIALIZED; +DXWEXTERN SelectPalette_Type pGDISelectPalette DXWINITIALIZED; +DXWEXTERN SetBkColor_Type pGDISetBkColor DXWINITIALIZED; +DXWEXTERN SetDeviceGammaRamp_Type pGDISetDeviceGammaRamp DXWINITIALIZED; +DXWEXTERN SetTextColor_Type pGDISetTextColor DXWINITIALIZED; +DXWEXTERN StretchBlt_Type pGDIStretchBlt DXWINITIALIZED; +DXWEXTERN TextOut_Type pGDITextOutA DXWINITIALIZED; + +// Kernel32.dll: +DXWEXTERN GetDiskFreeSpaceA_Type pGetDiskFreeSpaceA DXWINITIALIZED; +DXWEXTERN GetLocalTime_Type pGetLocalTime DXWINITIALIZED; +DXWEXTERN GetProcAddress_Type pGetProcAddress DXWINITIALIZED; +DXWEXTERN GetSystemTime_Type pGetSystemTime DXWINITIALIZED; +DXWEXTERN GetTickCount_Type pGetTickCount DXWINITIALIZED; +DXWEXTERN LoadLibraryA_Type pLoadLibraryA DXWINITIALIZED; +DXWEXTERN LoadLibraryExA_Type pLoadLibraryExA DXWINITIALIZED; +DXWEXTERN SetUnhandledExceptionFilter_Type pSetUnhandledExceptionFilter DXWINITIALIZED; +DXWEXTERN Sleep_Type pSleep DXWINITIALIZED; +DXWEXTERN SleepEx_Type pSleepEx DXWINITIALIZED; + +// ole32.dll: +DXWEXTERN CoCreateInstance_Type pCoCreateInstance DXWINITIALIZED; + +// user32.dll: +DXWEXTERN BeginPaint_Type pBeginPaint DXWINITIALIZED; +DXWEXTERN CallWindowProc_Type pCallWindowProc DXWINITIALIZED; +DXWEXTERN ChangeDisplaySettings_Type pChangeDisplaySettings DXWINITIALIZED; +DXWEXTERN ChangeDisplaySettingsEx_Type pChangeDisplaySettingsEx DXWINITIALIZED; +DXWEXTERN ClientToScreen_Type pClientToScreen DXWINITIALIZED; +DXWEXTERN ClipCursor_Type pClipCursor DXWINITIALIZED; +DXWEXTERN CreateDialogIndirectParam_Type pCreateDialogIndirectParam DXWINITIALIZED; +DXWEXTERN CreateDialogParam_Type pCreateDialogParam DXWINITIALIZED; +DXWEXTERN CreateWindowExA_Type pCreateWindowExA DXWINITIALIZED; +DXWEXTERN DefWindowProc_Type pDefWindowProc DXWINITIALIZED; +DXWEXTERN EndPaint_Type pEndPaint DXWINITIALIZED; +DXWEXTERN EnumDisplaySettings_Type pEnumDisplaySettings DXWINITIALIZED; +DXWEXTERN FillRect_Type pFillRect DXWINITIALIZED; +DXWEXTERN GetClientRect_Type pGetClientRect DXWINITIALIZED; +DXWEXTERN GetClipCursor_Type pGetClipCursor DXWINITIALIZED; +DXWEXTERN GetCursorPos_Type pGetCursorPos DXWINITIALIZED; +DXWEXTERN GDIGetDC_Type pGDIGetDC DXWINITIALIZED; +DXWEXTERN GetDesktopWindow_Type pGetDesktopWindow DXWINITIALIZED; +DXWEXTERN GetMessage_Type pGetMessage DXWINITIALIZED; +DXWEXTERN GetSystemMetrics_Type pGetSystemMetrics DXWINITIALIZED; +DXWEXTERN GDIGetDC_Type pGDIGetWindowDC DXWINITIALIZED; +DXWEXTERN GetWindowLong_Type pGetWindowLong DXWINITIALIZED; +DXWEXTERN GetWindowRect_Type pGetWindowRect DXWINITIALIZED; +DXWEXTERN InvalidateRect_Type pInvalidateRect DXWINITIALIZED; +DXWEXTERN MapWindowPoints_Type pMapWindowPoints DXWINITIALIZED; +DXWEXTERN MoveWindow_Type pMoveWindow DXWINITIALIZED; +DXWEXTERN PeekMessage_Type pPeekMessage DXWINITIALIZED; +DXWEXTERN RegisterClassExA_Type pRegisterClassExA DXWINITIALIZED; +DXWEXTERN GDIReleaseDC_Type pGDIReleaseDC DXWINITIALIZED; +DXWEXTERN ScreenToClient_Type pScreenToClient DXWINITIALIZED; +DXWEXTERN SendMessage_Type pSendMessage DXWINITIALIZED; +DXWEXTERN SetCursor_Type pSetCursor DXWINITIALIZED; +DXWEXTERN SetCursorPos_Type pSetCursorPos DXWINITIALIZED; +DXWEXTERN SetTimer_Type pSetTimer DXWINITIALIZED; +DXWEXTERN SetWindowLong_Type pSetWindowLong DXWINITIALIZED; +DXWEXTERN SetWindowPos_Type pSetWindowPos DXWINITIALIZED; +DXWEXTERN ShowCursor_Type pShowCursor DXWINITIALIZED; +DXWEXTERN ShowWindow_Type pShowWindow DXWINITIALIZED; + +/* =================================================================== +hook procedures (possibly more tnan one per each API...) +====================================================================*/ + +// GDI32.dll: +extern BOOL WINAPI extGDIBitBlt(HDC, int, int, int, int, HDC, int, int, DWORD); +extern HDC WINAPI extGDICreateCompatibleDC(HDC); +extern HDC WINAPI extDDCreateCompatibleDC(HDC); +extern HDC WINAPI extGDICreateDC(LPSTR, LPSTR, LPSTR, CONST DEVMODE *); +extern HDC WINAPI extDDCreateDC(LPSTR, LPSTR, LPSTR, CONST DEVMODE *); +extern HFONT WINAPI extCreateFont(int, int, int, int, int, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, LPCTSTR); +extern HFONT WINAPI extCreateFontIndirect(const LOGFONT*); +extern HPALETTE WINAPI extGDICreatePalette(CONST LOGPALETTE *); +extern HDWP WINAPI extDeferWindowPos(HDWP, HWND, HWND, int, int, int, int, UINT); +extern BOOL WINAPI extGDIDeleteDC(HDC); +extern BOOL WINAPI extDDDeleteDC(HDC); +extern int WINAPI extGetDeviceCaps(HDC, int); +extern BOOL WINAPI extGetDeviceGammaRamp(HDC, LPVOID); +extern UINT WINAPI extGetSystemPaletteEntries(HDC, UINT, UINT, LPPALETTEENTRY); +extern BOOL WINAPI extGDIPatBlt(HDC, int, int, int, int, DWORD); +extern BOOL WINAPI extDDBitBlt(HDC, int, int, int, int, HDC, int, int, DWORD); +extern UINT WINAPI extRealizePalette(HDC); +extern BOOL WINAPI extRectangle(HDC, int, int, int, int); +extern BOOL WINAPI extGDIRestoreDC(HDC, int); +extern int WINAPI extGDISaveDC(HDC); +extern BOOL WINAPI extScaleWindowExtEx(HDC, int, int, int, int, LPSIZE); +extern HPALETTE WINAPI extSelectPalette(HDC, HPALETTE, BOOL); +extern COLORREF WINAPI extSetBkColor(HDC, COLORREF); +extern BOOL WINAPI extSetDeviceGammaRamp(HDC, LPVOID); +extern COLORREF WINAPI extSetTextColor(HDC, COLORREF); +extern BOOL WINAPI extGDIStretchBlt(HDC, int, int, int, int, HDC, int, int, int, int, DWORD); +extern BOOL WINAPI extDDStretchBlt(HDC, int, int, int, int, HDC, int, int, int, int, DWORD); +extern BOOL WINAPI extTextOutA(HDC, int, int, LPCTSTR, int); + +// Kernel32.dll: +extern BOOL WINAPI extGetDiskFreeSpaceA(LPCSTR, LPDWORD, LPDWORD, LPDWORD, LPDWORD); +extern void WINAPI extGetLocalTime(LPSYSTEMTIME); +extern FARPROC WINAPI extGetProcAddress(HMODULE, LPCSTR); +extern void WINAPI extGetSystemTime(LPSYSTEMTIME); +extern DWORD WINAPI extGetTickCount(void); +extern HMODULE WINAPI extLoadLibraryA(LPCTSTR); +extern HMODULE WINAPI extLoadLibraryExA(LPCTSTR, HANDLE, DWORD); +extern LPTOP_LEVEL_EXCEPTION_FILTER WINAPI extSetUnhandledExceptionFilter(LPTOP_LEVEL_EXCEPTION_FILTER); +extern void WINAPI extSleep(DWORD); +extern DWORD WINAPI extSleepEx(DWORD, BOOL); + +// ole32.dll: +extern HRESULT STDAPICALLTYPE extCoCreateInstance(REFCLSID, LPUNKNOWN, DWORD, REFIID, LPVOID FAR*); + +// user32.dll: +extern HDC WINAPI extBeginPaint(HWND, LPPAINTSTRUCT); +extern LRESULT WINAPI extCallWindowProc(WNDPROC, HWND, UINT, WPARAM, LPARAM); +extern LONG WINAPI extChangeDisplaySettings(DEVMODE *, DWORD); +extern LONG WINAPI extChangeDisplaySettingsEx(LPCTSTR, DEVMODE *, HWND, DWORD, LPVOID); +extern BOOL WINAPI extClientToScreen(HWND, LPPOINT); +extern BOOL WINAPI extClipCursor(LPRECT); +extern HWND WINAPI extCreateDialogIndirectParam(HINSTANCE, LPCDLGTEMPLATE, HWND, DLGPROC, LPARAM); +extern HWND WINAPI extCreateDialogParam(HINSTANCE, LPCSTR, HWND, DLGPROC, LPARAM); +extern HWND WINAPI extCreateWindowExA(DWORD, LPCTSTR, LPCTSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, LPVOID); +extern LRESULT WINAPI extDefWindowProc(HWND, UINT, WPARAM, LPARAM); +extern BOOL WINAPI extEndPaint(HWND, const PAINTSTRUCT *); +extern LONG WINAPI extEnumDisplaySettings(LPCTSTR, DWORD, DEVMODE *); +extern int WINAPI extFillRect(HDC, const RECT *, HBRUSH); +extern BOOL WINAPI extGetClientRect(HWND, LPRECT); +extern BOOL WINAPI extGetClipCursor(LPRECT); +extern BOOL WINAPI extGetCursorPos(LPPOINT); +extern HDC WINAPI extGDIGetDC(HWND); +extern HDC WINAPI extDDGetDC(HWND); +extern HWND WINAPI extGetDesktopWindow(void); +extern BOOL WINAPI extGetMessage(LPMSG, HWND, UINT, UINT); +extern int WINAPI extGetSystemMetrics(int); +extern HDC WINAPI extGDIGetWindowDC(HWND); +extern HDC WINAPI extDDGetWindowDC(HWND); +extern LONG WINAPI extGetWindowLong(HWND, int); +extern BOOL WINAPI extGetWindowRect(HWND, LPRECT); +extern BOOL WINAPI extInvalidateRect(HWND, RECT *, BOOL); +extern BOOL WINAPI extDDInvalidateRect(HWND, RECT *, BOOL); +extern int WINAPI extMapWindowPoints(HWND, HWND, LPPOINT, UINT); +extern BOOL WINAPI extMoveWindow(HWND, int, int, int, int, BOOL); +extern BOOL WINAPI extPeekMessage(LPMSG, HWND, UINT, UINT, UINT); +extern ATOM WINAPI extRegisterClassExA(WNDCLASSEXA *); +extern int WINAPI extDDReleaseDC(HWND, HDC); +extern int WINAPI extGDIReleaseDC(HWND, HDC); +extern BOOL WINAPI extScreenToClient(HWND, LPPOINT); +extern LRESULT WINAPI extSendMessage(HWND, UINT, WPARAM, LPARAM); +extern HCURSOR WINAPI extSetCursor(HCURSOR); +extern BOOL WINAPI extSetCursorPos(int, int); +extern UINT_PTR WINAPI extSetTimer(HWND, UINT_PTR, UINT, TIMERPROC); +extern LONG WINAPI extSetWindowLong(HWND, int, LONG); +extern BOOL WINAPI extSetWindowPos(HWND, HWND, int, int, int, int, UINT); +extern int WINAPI extShowCursor(BOOL); +extern BOOL WINAPI extShowWindow(HWND, int); + +/* eof */ \ No newline at end of file diff --git a/host/Resource.h b/host/Resource.h index af7cfd1..b371b00 100644 --- a/host/Resource.h +++ b/host/Resource.h @@ -24,6 +24,7 @@ #define IDI_ICON3 148 #define IDI_RUN6 148 #define IDD_STATUS 149 +#define IDD_TIMESLIDER 150 #define IDC_AUTO 300 #define IDC_DIRECTX1 301 #define IDC_DIRECTX7 302 @@ -52,12 +53,14 @@ #define IDC_MODULE 1023 #define IDC_SNOOZE 1023 #define IDC_KILL 1024 +#define IDC_OPENGLLIB 1024 #define IDC_AUTOREFRESH 1025 #define IDC_FIXWINFRAME 1026 #define IDC_HIDEHWCURSOR 1027 #define IDC_ENABLECLIPPING 1028 #define IDC_COUNTDOWN 1028 #define IDC_EDIT1 1029 +#define IDC_SHOWHWCURSOR 1029 #define IDC_VIDEOTOSYSTEMMEM 1030 #define IDC_FIXTEXTOUT 1031 #define IDC_STATUSINFO 1031 @@ -72,6 +75,7 @@ #define IDC_TITLE 1039 #define IDC_SLOW 1040 #define IDC_CLIPCURSOR 1041 +#define IDC_INITTS 1042 #define IDC_CLIENTREMAPPING 1043 #define IDC_HANDLEALTF4 1044 #define IDC_LOCKWINPOS 1045 @@ -109,7 +113,12 @@ #define IDC_SKIPFPS 1076 #define IDC_SHOWFPS 1077 #define IDC_HIDEMULTIMONITOR 1078 +#define IDC_TIMESLIDER 1078 #define IDC_TIMESTRETCH 1079 +#define IDC_TIMESPEED 1079 +#define IDC_HOOKOPENGL 1080 +#define IDC_WALLPAPERMODE 1081 +#define IDC_HOOKGDI 1082 #define ID_MODIFY 32771 #define ID_DELETE 32772 #define ID_ADD 32773 @@ -138,15 +147,16 @@ #define ID_VIEW_STATUS 32809 #define ID_DXAPP_EXIT 32810 #define ID_SAVEFILE 32810 +#define ID_VIEW_TIMESLIDER 32811 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 -#define _APS_NEXT_RESOURCE_VALUE 150 -#define _APS_NEXT_COMMAND_VALUE 32811 -#define _APS_NEXT_CONTROL_VALUE 1078 +#define _APS_NEXT_RESOURCE_VALUE 151 +#define _APS_NEXT_COMMAND_VALUE 32812 +#define _APS_NEXT_CONTROL_VALUE 1080 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/host/StatusDialog.cpp b/host/StatusDialog.cpp index eb0c810..8ed0167 100644 --- a/host/StatusDialog.cpp +++ b/host/StatusDialog.cpp @@ -38,9 +38,12 @@ void CStatusDialog::OnTimer(UINT_PTR nIDEvent) int IconId; LPCSTR Status; char sMsg[1024]; + char sMsgBuf[80+1]; char DllVersion[21]; DXWNDSTATUS DxWndStatus; extern PRIVATEMAP *pTitles; + extern TARGETMAP *pTargets; + TARGETMAP *Target; CDialog::OnTimer(nIDEvent); DxStatus=GetHookStatus(NULL); @@ -53,19 +56,32 @@ void CStatusDialog::OnTimer(UINT_PTR nIDEvent) GetDllVersion(DllVersion); DxWndStatus.Status=DxStatus; if(DxStatus==DXW_RUNNING){ + int idx; + char *sTSCaption[9]={"x16","x8","x4","x2","x1",":2",":4",":8",":16"}; GetHookStatus(&DxWndStatus); + Target=&pTargets[DxWndStatus.TaskIdx]; + sprintf_s(sMsg, 1024, "DxWnd %s\nHook status: %s\n" "Running \"%s\"\nScreen = (%dx%d) %dBPP\n" "FullScreen = %s\nDX version = %d\n" - "Logging = %s\n" - "FPS = %d", - DllVersion, Status, - pTitles[DxWndStatus.TaskIdx].title, - DxWndStatus.Width, DxWndStatus.Height, DxWndStatus.ColorDepth, - DxWndStatus.IsFullScreen ? "Yes":"No", DxWndStatus.DXVersion, - DxWndStatus.isLogging?"ON":"OFF", - DxWndStatus.FPSCount); + "Logging = %s", + DllVersion, Status, + pTitles[DxWndStatus.TaskIdx].title, + DxWndStatus.Width, DxWndStatus.Height, DxWndStatus.ColorDepth, + DxWndStatus.IsFullScreen ? "Yes":"No", DxWndStatus.DXVersion, + DxWndStatus.isLogging?"ON":"OFF"); + if(Target->flags2 & SHOWFPS){ + sprintf(sMsgBuf, "\nFPS = %d", DxWndStatus.FPSCount); + strcat(sMsg, sMsgBuf); + } + if(Target->flags2 & TIMESTRETCH){ + idx=DxWndStatus.iTimeShift+4; + if(idx>=0 && idx<=8){ + sprintf(sMsgBuf, "\nTime speed: %s", sTSCaption[DxWndStatus.iTimeShift+4]); + strcat(sMsg, sMsgBuf); + } + } } else sprintf_s(sMsg, 1024, "DxWnd %s\nHook status: %s", DllVersion, Status); diff --git a/host/StatusDialog.h b/host/StatusDialog.h index 8928d54..eddabc2 100644 --- a/host/StatusDialog.h +++ b/host/StatusDialog.h @@ -13,6 +13,7 @@ public: // Dialog Data enum { IDD = IDD_STATUS }; + int iTimeSlider; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support diff --git a/host/TargetDlg.cpp b/host/TargetDlg.cpp index 0491664..95b46f1 100644 --- a/host/TargetDlg.cpp +++ b/host/TargetDlg.cpp @@ -46,6 +46,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/) m_AutoRefresh = FALSE; m_FixWinFrame = FALSE; m_HideHwCursor = FALSE; + m_ShowHwCursor = FALSE; m_EnableClipping = FALSE; m_CursorClipping = FALSE; m_VideoToSystemMem = FALSE; @@ -63,7 +64,9 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/) m_ModalStyle = FALSE; m_KeepAspectRatio = FALSE; m_ForceWinResize = FALSE; + m_HookGDI = FALSE; m_HideMultiMonitor = FALSE; + m_WallpaperMode = FALSE; m_HookChildWin = FALSE; m_MessageProc = FALSE; m_FixNCHITTEST = FALSE; @@ -77,6 +80,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/) m_SkipFPS = FALSE; m_ShowFPS = FALSE; m_TimeStretch = FALSE; + m_HookOpenGL = FALSE; m_InitX = 0; m_InitY = 0; m_MaxX = 0; @@ -88,6 +92,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/) m_SizX = 800; m_SizY = 600; m_MaxFPS = 0; + m_InitTS = 0; //}}AFX_DATA_INIT } @@ -126,6 +131,7 @@ void CTargetDlg::DoDataExchange(CDataExchange* pDX) DDX_Check(pDX, IDC_AUTOREFRESH, m_AutoRefresh); DDX_Check(pDX, IDC_FIXWINFRAME, m_FixWinFrame); DDX_Check(pDX, IDC_HIDEHWCURSOR, m_HideHwCursor); + DDX_Check(pDX, IDC_SHOWHWCURSOR, m_ShowHwCursor); DDX_Check(pDX, IDC_ENABLECLIPPING, m_EnableClipping); DDX_Check(pDX, IDC_CLIPCURSOR, m_CursorClipping); DDX_Check(pDX, IDC_VIDEOTOSYSTEMMEM, m_VideoToSystemMem); @@ -143,7 +149,9 @@ void CTargetDlg::DoDataExchange(CDataExchange* pDX) DDX_Check(pDX, IDC_MODALSTYLE, m_ModalStyle); DDX_Check(pDX, IDC_KEEPASPECTRATIO, m_KeepAspectRatio); DDX_Check(pDX, IDC_FORCEWINRESIZE, m_ForceWinResize); + DDX_Check(pDX, IDC_HOOKGDI, m_HookGDI); DDX_Check(pDX, IDC_HIDEMULTIMONITOR, m_HideMultiMonitor); + DDX_Check(pDX, IDC_WALLPAPERMODE, m_WallpaperMode); DDX_Check(pDX, IDC_HOOKCHILDWIN, m_HookChildWin); DDX_Check(pDX, IDC_MESSAGEPROC, m_MessageProc); DDX_Check(pDX, IDC_FIXNCHITTEST, m_FixNCHITTEST); @@ -157,6 +165,7 @@ void CTargetDlg::DoDataExchange(CDataExchange* pDX) DDX_Check(pDX, IDC_SKIPFPS, m_SkipFPS); DDX_Check(pDX, IDC_SHOWFPS, m_ShowFPS); DDX_Check(pDX, IDC_TIMESTRETCH, m_TimeStretch); + DDX_Check(pDX, IDC_HOOKOPENGL, m_HookOpenGL); DDX_Text(pDX, IDC_INITX, m_InitX); DDX_Text(pDX, IDC_INITY, m_InitY); DDX_Text(pDX, IDC_MAXX, m_MaxX); @@ -168,6 +177,7 @@ void CTargetDlg::DoDataExchange(CDataExchange* pDX) DDX_Text(pDX, IDC_SIZX, m_SizX); DDX_Text(pDX, IDC_SIZY, m_SizY); DDX_Text(pDX, IDC_MAXFPS, m_MaxFPS); + DDX_Text(pDX, IDC_INITTS, m_InitTS); //}}AFX_DATA_MAP } @@ -189,7 +199,7 @@ BEGIN_MESSAGE_MAP(CTargetDlg, CDialog) //ON_BN_CLICKED(IDC_ABSOLUTECOORD, &CTargetDlg::OnBnClickedAbsolutecoord) ON_BN_CLICKED(IDC_AUTOREFRESH, &CTargetDlg::OnBnClickedAutorefresh) ON_BN_CLICKED(IDC_FIXWINFRAME, &CTargetDlg::OnBnClickedFixWinFrame) - ON_BN_CLICKED(IDC_HIDEHWCURSOR, &CTargetDlg::OnBnClickedHideHwCursor) + //ON_BN_CLICKED(IDC_HIDEHWCURSOR, &CTargetDlg::OnBnClickedHideHwCursor) ON_BN_CLICKED(IDC_ENABLECLIPPING, &CTargetDlg::OnBnClickedEnableClipping) ON_BN_CLICKED(IDC_VIDEOTOSYSTEMMEM, &CTargetDlg::OnBnClickedHandleCursorPos) ON_BN_CLICKED(IDC_FIXTEXTOUT, &CTargetDlg::OnBnClickedFixTextOut) @@ -298,10 +308,10 @@ void CTargetDlg::OnBnClickedFixWinFrame() // TODO: Add your control notification handler code here } -void CTargetDlg::OnBnClickedHideHwCursor() -{ - // TODO: Add your control notification handler code here -} +//void CTargetDlg::OnBnClickedHideHwCursor() +//{ +// // TODO: Add your control notification handler code here +//} void CTargetDlg::OnBnClickedEnableClipping() { diff --git a/host/TargetDlg.h b/host/TargetDlg.h index 08c57cb..3f07ecd 100644 --- a/host/TargetDlg.h +++ b/host/TargetDlg.h @@ -41,6 +41,7 @@ public: CString m_FilePath; CString m_Module; CString m_Title; + CString m_OpenGLLib; BOOL m_SaveLoad; BOOL m_SlowDown; BOOL m_BlitFromBackBuffer; @@ -49,6 +50,7 @@ public: BOOL m_AutoRefresh; BOOL m_FixWinFrame; BOOL m_HideHwCursor; + BOOL m_ShowHwCursor; BOOL m_EnableClipping; BOOL m_CursorClipping; BOOL m_VideoToSystemMem; @@ -66,7 +68,9 @@ public: BOOL m_ModalStyle; BOOL m_KeepAspectRatio; BOOL m_ForceWinResize; + BOOL m_HookGDI; BOOL m_HideMultiMonitor; + BOOL m_WallpaperMode; BOOL m_HookChildWin; BOOL m_MessageProc; BOOL m_FixNCHITTEST; @@ -81,6 +85,7 @@ public: BOOL m_LimitFPS; BOOL m_ShowFPS; BOOL m_TimeStretch; + BOOL m_HookOpenGL; int m_InitX; int m_InitY; int m_MaxX; @@ -92,6 +97,7 @@ public: int m_SizX; int m_SizY; int m_MaxFPS; + int m_InitTS; //}}AFX_DATA @@ -121,7 +127,7 @@ public: afx_msg void OnEnChangeFile2(); afx_msg void OnBnClickedAutorefresh(); afx_msg void OnBnClickedFixWinFrame(); - afx_msg void OnBnClickedHideHwCursor(); + //afx_msg void OnBnClickedHideHwCursor(); afx_msg void OnBnClickedEnableClipping(); afx_msg void OnBnClickedHandleCursorPos(); afx_msg void OnBnClickedFixTextOut(); diff --git a/host/TimeSliderDialog.h b/host/TimeSliderDialog.h new file mode 100644 index 0000000..b9012a1 --- /dev/null +++ b/host/TimeSliderDialog.h @@ -0,0 +1,29 @@ +#pragma once + + +// CTimeSlider dialog + +class CTimeSliderDialog : public CDialog +{ + DECLARE_DYNAMIC(CTimeSliderDialog) + +public: + CTimeSliderDialog(CWnd* pParent = NULL); // standard constructor + virtual ~CTimeSliderDialog(); + +// Dialog Data + enum { IDD = IDD_TIMESLIDER }; + //CSliderCtrl m_TimeSlider; + int i_TimeSlider; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + + DECLARE_MESSAGE_MAP() +public: + afx_msg void OnTimer(UINT_PTR nIDEvent); +public: + virtual BOOL OnInitDialog(); +protected: + virtual void OnOK(); +}; diff --git a/host/TimeSliderDlg.cpp b/host/TimeSliderDlg.cpp new file mode 100644 index 0000000..d489502 --- /dev/null +++ b/host/TimeSliderDlg.cpp @@ -0,0 +1,106 @@ +// TimeSliderDialog.cpp : implementation file +// + +#include "stdafx.h" +#include "dxwndhost.h" +#include "TimeSliderDialog.h" + +// CTimeSliderDialog dialog + +IMPLEMENT_DYNAMIC(CTimeSliderDialog, CDialog) + +CTimeSliderDialog::CTimeSliderDialog(CWnd* pParent /*=NULL*/) + : CDialog(CTimeSliderDialog::IDD, pParent) +{ + //m_TimeSlider.SetRange(-4, +4, TRUE); +} + +CTimeSliderDialog::~CTimeSliderDialog() +{ +} + +void CTimeSliderDialog::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CTargetDlg) + DDX_Slider(pDX, IDC_TIMESLIDER, i_TimeSlider); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CTimeSliderDialog, CDialog) + ON_WM_TIMER() +END_MESSAGE_MAP() + +#define IDTIMER 1 + +// CTimeSliderDialog message handlers + +void CTimeSliderDialog::OnTimer(UINT_PTR nIDEvent) +{ + DXWNDSTATUS Status; + CSliderCtrl *Slider; + CStatic *Text; + char *sTSCaption[9]={"x16","x8","x4","x2","x1",":2",":4",":8",":16"}; + char sMsg[81]; + static int iLastPos=-1; + + Slider=(CSliderCtrl *)this->GetDlgItem(IDC_TIMESLIDER); + Text=(CStatic *)this->GetDlgItem(IDC_TIMESPEED); + + CDialog::OnTimer(nIDEvent); + i_TimeSlider=Slider->GetPos(); + if(GetHookStatus(&Status)!=DXW_RUNNING) { + Slider->SetPos(0); + Text->SetWindowTextA("idle"); + return; + } + if(i_TimeSlider==iLastPos){ + // no change, check for keyboard input changes + i_TimeSlider=Status.iTimeShift; + if(i_TimeSlider != iLastPos) Slider->SetPos(i_TimeSlider); + } + else { + // slider position changed, set the new value + if (i_TimeSlider < -4) i_TimeSlider=-4; + if (i_TimeSlider > 4) i_TimeSlider=4; + Status.iTimeShift=i_TimeSlider; + SetHookStatus(&Status); + } + iLastPos = i_TimeSlider; + sprintf(sMsg, "Time speed: %s", sTSCaption[i_TimeSlider+4]); + Text->SetWindowTextA(sMsg); +} + +BOOL CTimeSliderDialog::OnInitDialog() +{ + CSliderCtrl *Slider; + CDialog::OnInitDialog(); + DXWNDSTATUS Status; + + GetHookStatus(&Status); + Slider=(CSliderCtrl *)this->GetDlgItem(IDC_TIMESLIDER); + Slider->SetRange(-4, +4, 0); + Slider->SetTicFreq(1); + Slider->SetPos(Status.iTimeShift); + SetTimer(IDTIMER, 1000, NULL); + + // TODO: Add extra initialization here + + return TRUE; // return TRUE unless you set the focus to a control +} + +void CTimeSliderDialog::OnOK() +{ + // TODO: Add your specialized code here and/or call the base class + + KillTimer(IDTIMER); + // stop timer + + DXWNDSTATUS Status; + GetHookStatus(&Status); + Status.iTimeShift=i_TimeSlider; + SetHookStatus(&Status); + + CDialog::OnOK(); +} diff --git a/host/dxwndhost.aps b/host/dxwndhost.aps index 0ab8db4..5cbe54c 100644 Binary files a/host/dxwndhost.aps and b/host/dxwndhost.aps differ diff --git a/host/dxwndhost.rc b/host/dxwndhost.rc index 07e2e87..cb07e96 100644 --- a/host/dxwndhost.rc +++ b/host/dxwndhost.rc @@ -112,6 +112,7 @@ BEGIN POPUP "View" BEGIN MENUITEM "Status", ID_VIEW_STATUS + MENUITEM "Time Slider", ID_VIEW_TIMESLIDER END END @@ -189,7 +190,7 @@ BEGIN DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP END -IDD_TARGET DIALOGEX 0, 0, 551, 225 +IDD_TARGET DIALOGEX 0, 0, 675, 225 STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Target" FONT 9, "Arial", 400, 0, 0x0 @@ -202,60 +203,60 @@ BEGIN CONTROL "DirectX8",IDC_DIRECTX8,"Button",BS_AUTORADIOBUTTON,14,114,41,10 CONTROL "DirectX9",IDC_DIRECTX9,"Button",BS_AUTORADIOBUTTON,14,124,40,10 CONTROL "None/OpenGL",IDC_NODIRECTX,"Button",BS_AUTORADIOBUTTON,14,134,61,10 - CONTROL "Do not notify on task switch",IDC_UNNOTIFY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,306,124,106,10 + CONTROL "Do not notify on task switch",IDC_UNNOTIFY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,306,134,106,10 CONTROL "None",IDC_NOEMULATESURFACE,"Button",BS_AUTORADIOBUTTON | WS_GROUP,14,158,66,10 CONTROL "Primary Surface",IDC_EMULATESURFACE,"Button",BS_AUTORADIOBUTTON,14,178,66,10 CONTROL "Primary Buffer",IDC_EMULATEBUFFER,"Button",BS_AUTORADIOBUTTON,14,168,67,10 - CONTROL "DirectInput Hooking",IDC_HOOKDI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,306,114,83,10 - CONTROL "Correct mouse position",IDC_MODIFYMOUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,306,24,97,10 + CONTROL "DirectInput Hooking",IDC_HOOKDI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,306,124,83,10 + CONTROL "Correct mouse position",IDC_MODIFYMOUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,306,34,97,10 CONTROL "DxWnd",IDC_OUTTRACE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,97,114,62,10 - CONTROL "Optimize CPU (DirectX1 - 7)",IDC_SAVELOAD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,306,134,105,10 - DEFPUSHBUTTON "OK",IDOK,505,194,40,14 - PUSHBUTTON "Cancel",IDCANCEL,460,194,40,14 + CONTROL "Optimize CPU (DirectX1 - 7)",IDC_SAVELOAD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,306,144,105,10 + DEFPUSHBUTTON "OK",IDOK,629,204,40,14 + PUSHBUTTON "Cancel",IDCANCEL,568,204,40,14 GROUPBOX "DirectX Version Hook",IDC_STATIC,7,75,77,72,WS_GROUP - LTEXT "DirectInput initial coord. and X,Y range",IDC_STATIC,306,195,125,8 - LTEXT "X",IDC_STATIC,301,208,8,8 - LTEXT "Y",IDC_STATIC,324,208,8,8 - LTEXT "(",IDC_STATIC,349,208,8,8 - LTEXT ",",IDC_STATIC,369,208,8,8 - LTEXT ")-(",IDC_STATIC,388,208,9,8 - LTEXT ",",IDC_STATIC,413,208,8,8 - LTEXT ")",IDC_STATIC,432,208,8,8 - EDITTEXT IDC_INITX,307,206,14,12,ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT - EDITTEXT IDC_INITY,329,206,14,12,ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT - EDITTEXT IDC_MINX,352,206,14,12,ES_AUTOHSCROLL,WS_EX_RIGHT - EDITTEXT IDC_MINY,373,206,14,12,ES_AUTOHSCROLL,WS_EX_RIGHT - EDITTEXT IDC_MAXX,396,206,14,12,ES_AUTOHSCROLL,WS_EX_RIGHT - EDITTEXT IDC_MAXY,417,206,14,12,ES_AUTOHSCROLL,WS_EX_RIGHT - CONTROL "Handle DC",IDC_HANDLEDC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,180,34,67,10 + LTEXT "DirectInput initial coord. and X,Y range",IDC_STATIC,430,195,125,8 + LTEXT "X",IDC_STATIC,425,208,8,8 + LTEXT "Y",IDC_STATIC,448,208,8,8 + LTEXT "(",IDC_STATIC,473,208,8,8 + LTEXT ",",IDC_STATIC,493,208,8,8 + LTEXT ")-(",IDC_STATIC,512,208,9,8 + LTEXT ",",IDC_STATIC,537,208,8,8 + LTEXT ")",IDC_STATIC,556,208,8,8 + EDITTEXT IDC_INITX,431,206,14,12,ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT + EDITTEXT IDC_INITY,453,206,14,12,ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT + EDITTEXT IDC_MINX,476,206,14,12,ES_AUTOHSCROLL,WS_EX_RIGHT + EDITTEXT IDC_MINY,497,206,14,12,ES_AUTOHSCROLL,WS_EX_RIGHT + EDITTEXT IDC_MAXX,520,206,14,12,ES_AUTOHSCROLL,WS_EX_RIGHT + EDITTEXT IDC_MAXY,541,206,14,12,ES_AUTOHSCROLL,WS_EX_RIGHT + CONTROL "Handle DC",IDC_HANDLEDC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,180,24,67,10 EDITTEXT IDC_MODULE,7,60,139,12,ES_AUTOHSCROLL - CONTROL "Auto Primary Surface Refresh",IDC_AUTOREFRESH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,180,44,108,8 + CONTROL "Auto Primary Surface Refresh",IDC_AUTOREFRESH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,180,34,108,8 CONTROL "Fix Window Frame Style",IDC_FIXWINFRAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,433,14,103,9 CONTROL "Hide Cursor",IDC_HIDEHWCURSOR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,306,14,100,9 CONTROL "Intercept GDI Cursor Clipping",IDC_ENABLECLIPPING, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,306,64,106,9 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,306,74,106,9 LTEXT "Hooked Module:",IDC_STATIC,7,51,66,8 - GROUPBOX "Cursor handling",IDC_STATIC,298,3,120,95 - GROUPBOX "Surface handling",IDC_STATIC,172,3,120,138 + GROUPBOX "Cursor handling",IDC_STATIC,298,3,120,105 + GROUPBOX "DirectDraw Surface handling",IDC_STATIC,172,3,120,138 CONTROL "VIDEO->SYSTEM surf. on fail",IDC_VIDEOTOSYSTEMMEM, - "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,180,64,108,8 - CONTROL "Fix TextOutA placement",IDC_FIXTEXTOUT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,180,24,107,9 - GROUPBOX "Generic",IDC_STATIC,299,101,120,88 - CONTROL "Keep cursor within window",IDC_KEEPCURSORWITHIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,306,44,105,9 - CONTROL "Set 16BPP RGB565 encoding",IDC_USERGB565,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,180,54,108,8 - CONTROL "Suppress DX common errors",IDC_SUPPRESSDXERRORS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,180,74,109,9 + "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,180,54,108,8 + CONTROL "Fix TextOutA placement",IDC_FIXTEXTOUT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,180,164,107,9 + GROUPBOX "Generic",IDC_STATIC,299,111,120,89 + CONTROL "Keep cursor within window",IDC_KEEPCURSORWITHIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,306,54,105,9 + CONTROL "Set 16BPP RGB565 encoding",IDC_USERGB565,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,180,44,108,8 + CONTROL "Suppress DX common errors",IDC_SUPPRESSDXERRORS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,180,64,109,9 CONTROL "Prevent Win Maximize",IDC_PREVENTMAXIMIZE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,433,24,98,9 GROUPBOX "Trace",IDC_STATIC,90,75,74,115 CONTROL "Win Events",IDC_OUTWINMESSAGES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,97,124,62,10 CONTROL "DirectX ",IDC_OUTDXTRACE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,97,134,62,10 EDITTEXT IDC_TITLE,7,12,139,12,ES_AUTOHSCROLL LTEXT "Path:",IDC_STATIC,7,27,66,8 - LTEXT "Name:",IDC_STATIC,7,1,66,8 - CONTROL "Slow down",IDC_SLOW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,306,144,88,10 - CONTROL "Force cursor clipping",IDC_CLIPCURSOR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,306,34,107,9 - CONTROL "Remap GDI Client Rect",IDC_CLIENTREMAPPING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,180,84,102,9 - CONTROL "Intercept Alt-F4 key",IDC_HANDLEALTF4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,306,154,93,10 - GROUPBOX "Windows handling",IDC_STATIC,425,3,120,156 + LTEXT "Name:",IDC_STATIC,7,3,66,8 + CONTROL "Slow down",IDC_SLOW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,306,154,88,10 + CONTROL "Force cursor clipping",IDC_CLIPCURSOR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,306,44,107,9 + CONTROL "Remap Client Rect",IDC_CLIENTREMAPPING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,180,74,102,9 + CONTROL "Intercept Alt-F4 key",IDC_HANDLEALTF4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,306,164,93,10 + GROUPBOX "Windows handling",IDC_STATIC,424,3,120,167 CONTROL "Lock win coordinates",IDC_LOCKWINPOS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,433,34,98,9 CONTROL "Hook CHILD windows",IDC_HOOKCHILDWIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,433,54,98,9 LTEXT "Window initial position && size",IDC_STATIC,12,195,98,8 @@ -267,41 +268,77 @@ BEGIN EDITTEXT IDC_POSY,40,206,16,12,ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT EDITTEXT IDC_SIZX,65,206,16,12,ES_AUTOHSCROLL,WS_EX_RIGHT EDITTEXT IDC_SIZY,90,206,16,12,ES_AUTOHSCROLL,WS_EX_RIGHT - CONTROL "Message processing",IDC_MESSAGEPROC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,306,74,98,9 + CONTROL "Message processing",IDC_MESSAGEPROC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,306,84,98,9 CONTROL "Map GDI HDC to Primary DC",IDC_MAPGDITOPRIMARY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,180,14,102,9 CONTROL "Recover screen mode",IDC_RECOVERSCREENMODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,433,64,98,9 CONTROL "Refresh on win resize",IDC_REFRESHONRESIZE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,433,74,98,9 - CONTROL "Make Backbuf attachable",IDC_BACKBUFATTACH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,180,94,102,9 + CONTROL "Make Backbuf attachable",IDC_BACKBUFATTACH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,180,84,102,9 CONTROL "ddraw Proxy",IDC_DXPROXED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,97,94,62,10 CONTROL "Assert Dialog",IDC_ASSERT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,97,104,62,10 CONTROL "Simulate 8BPP desktop",IDC_INIT8BPP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,433,84,98,9 CONTROL "Simulate 16BPP desktop",IDC_INIT16BPP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,433,94,98,9 - CONTROL "Keep cursor fixed",IDC_KEEPCURSORFIXED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,306,54,105,9 + CONTROL "Keep cursor fixed",IDC_KEEPCURSORFIXED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,306,64,105,9 CONTROL "Lock win style",IDC_LOCKWINSTYLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,433,44,98,9 CONTROL "Enable Trace",IDC_LOGENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,97,84,62,10 CONTROL "Cursor/Mouse",IDC_CURSORTRACE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,97,144,62,10 CONTROL "Import Table",IDC_IMPORTTABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,97,154,62,10 - CONTROL "Handle Exceptions",IDC_HANDLEEXCEPTIONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,306,164,93,10 + CONTROL "Handle Exceptions",IDC_HANDLEEXCEPTIONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,306,174,93,10 CONTROL "Fix Parent Window",IDC_FIXPARENTWIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,433,104,98,9 CONTROL "Debug",IDC_OUTDEBUG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,97,164,62,10 - CONTROL "Blit from BackBuffer",IDC_BLITFROMBACKBUFFER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,180,104,102,9 + CONTROL "Blit from BackBuffer",IDC_BLITFROMBACKBUFFER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,180,94,102,9 GROUPBOX "Emulation",IDC_STATIC,7,149,78,42,WS_GROUP - CONTROL "Suppress clipping",IDC_SUPPRESSCLIPPING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,180,114,102,9 + CONTROL "Suppress clipping",IDC_SUPPRESSCLIPPING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,180,104,102,9 CONTROL "Modal Style",IDC_MODALSTYLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,433,114,98,9 CONTROL "Keep aspect ratio",IDC_KEEPASPECTRATIO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,433,124,98,9 - CONTROL "Limit available resources",IDC_LIMITRESOURCES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,306,174,93,10 + CONTROL "Limit available resources",IDC_LIMITRESOURCES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,306,184,93,10 CONTROL "Force win resize",IDC_FORCEWINRESIZE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,433,134,98,9 - CONTROL "Disable setting gamma ramp",IDC_DISABLEGAMMARAMP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,180,124,102,9 - CONTROL "fix WM_NCHITTEST",IDC_FIXNCHITTEST,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,306,84,98,9 - CONTROL "Limit",IDC_LIMITFPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,180,154,28,9 - EDITTEXT IDC_MAXFPS,258,157,26,12,ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT - CONTROL "Skip",IDC_SKIPFPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,180,164,27,9 - LTEXT "delay (msec)",IDC_STATIC,214,159,43,8 - GROUPBOX "Frame per Second",IDC_STATIC,172,142,121,58 - CONTROL "Show FPS",IDC_SHOWFPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,180,176,52,9 - GROUPBOX "",IDC_STATIC,178,150,110,24 + CONTROL "fix WM_NCHITTEST",IDC_FIXNCHITTEST,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,306,94,98,9 + CONTROL "Limit",IDC_LIMITFPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,557,123,28,9 + EDITTEXT IDC_MAXFPS,635,126,26,12,ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT + CONTROL "Skip",IDC_SKIPFPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,557,133,27,9 + LTEXT "delay (msec)",IDC_STATIC,591,128,43,8 + GROUPBOX "Frame per Second",IDC_STATIC,549,111,120,58 + CONTROL "Show FPS",IDC_SHOWFPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,557,145,52,9 + GROUPBOX "",IDC_STATIC,555,119,110,24 CONTROL "Hide multi-monitor config.",IDC_HIDEMULTIMONITOR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,433,144,98,9 - CONTROL "Time Stretch",IDC_TIMESTRETCH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,180,186,52,9 + CONTROL "Time Stretch - init val:",IDC_TIMESTRETCH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,557,155,75,9 + GROUPBOX "OpenGL",IDC_STATIC,549,3,120,50 + CONTROL "Hook OpenGL",IDC_HOOKOPENGL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,557,14,98,9 + EDITTEXT IDC_OPENGLLIB,554,36,108,12,ES_AUTOHSCROLL + LTEXT "Custom OpenGL library",IDC_STATIC,566,26,94,8 + CONTROL "Show Cursor",IDC_SHOWHWCURSOR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,306,24,100,9 + CONTROL "Wallpaper mode",IDC_WALLPAPERMODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,433,154,98,9 + GROUPBOX "GDI Handling",IDC_STATIC,172,144,120,62 + CONTROL "Hook GDI",IDC_HOOKGDI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,180,154,102,9 + CONTROL "Disable setting gamma ramp",IDC_DISABLEGAMMARAMP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,180,174,102,9 + EDITTEXT IDC_INITTS,635,152,14,12,ES_AUTOHSCROLL,WS_EX_RIGHT +END + +IDD_STATUS DIALOGEX 0, 0, 186, 95 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "DxWnd Status" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + LTEXT "Wait ...",IDC_STATUSINFO,2,2,182,91,SS_SUNKEN +END + +IDD_TIMESLIDER DIALOGEX 0, 0, 168, 65 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Time Slider" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + DEFPUSHBUTTON "OK",IDOK,111,44,50,14 + CONTROL "",IDC_TIMESLIDER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TRANSPARENTBKGND | WS_TABSTOP,7,7,154,18,WS_EX_TRANSPARENT + LTEXT "Time shift:",IDC_TIMESPEED,7,43,64,15 + LTEXT "x16",IDC_STATIC,7,31,15,9 + LTEXT "x8",IDC_STATIC,30,30,15,9 + LTEXT "x4",IDC_STATIC,47,30,15,9 + LTEXT "x2",IDC_STATIC,63,30,15,9 + LTEXT "x1",IDC_STATIC,81,30,15,9 + LTEXT ":2",IDC_STATIC,99,30,15,9 + LTEXT ":4",IDC_STATIC,115,30,15,9 + LTEXT ":8",IDC_STATIC,132,30,15,9 + LTEXT ":16",IDC_STATIC,149,30,15,9 END @@ -362,11 +399,27 @@ BEGIN IDD_TARGET, DIALOG BEGIN LEFTMARGIN, 7 - RIGHTMARGIN, 545 - TOPMARGIN, 7 + RIGHTMARGIN, 669 + TOPMARGIN, 3 BOTTOMMARGIN, 218 HORZGUIDE, 91 END + + IDD_STATUS, DIALOG + BEGIN + LEFTMARGIN, 2 + RIGHTMARGIN, 184 + TOPMARGIN, 2 + BOTTOMMARGIN, 93 + END + + IDD_TIMESLIDER, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 161 + TOPMARGIN, 7 + BOTTOMMARGIN, 58 + END END #endif // APSTUDIO_INVOKED @@ -494,39 +547,6 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK #pragma code_page(1252) #endif //_WIN32 -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_STATUS DIALOGEX 0, 0, 186, 95 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "DxWnd Status" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - LTEXT "Wait ...",IDC_STATUSINFO,2,2,182,91,SS_SUNKEN -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_STATUS, DIALOG - BEGIN - LEFTMARGIN, 2 - RIGHTMARGIN, 184 - TOPMARGIN, 2 - BOTTOMMARGIN, 93 - END -END -#endif // APSTUDIO_INVOKED - - ///////////////////////////////////////////////////////////////////////////// // // Icon diff --git a/host/dxwndhost.sln b/host/dxwndhost.sln deleted file mode 100644 index 3ab2975..0000000 --- a/host/dxwndhost.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dxwndhost", "dxwndhost.vcproj", "{FD0B0234-8EC5-43C0-A384-1B881DD3D925}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {FD0B0234-8EC5-43C0-A384-1B881DD3D925}.Debug|Win32.ActiveCfg = Debug|Win32 - {FD0B0234-8EC5-43C0-A384-1B881DD3D925}.Debug|Win32.Build.0 = Debug|Win32 - {FD0B0234-8EC5-43C0-A384-1B881DD3D925}.Release|Win32.ActiveCfg = Release|Win32 - {FD0B0234-8EC5-43C0-A384-1B881DD3D925}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/host/dxwndhost.suo b/host/dxwndhost.suo deleted file mode 100644 index 8ee64fd..0000000 Binary files a/host/dxwndhost.suo and /dev/null differ diff --git a/host/dxwndhost.vs2008.suo b/host/dxwndhost.vs2008.suo index f0a55e8..e87fc66 100644 Binary files a/host/dxwndhost.vs2008.suo and b/host/dxwndhost.vs2008.suo differ diff --git a/host/dxwndhost.vs2008.vcproj b/host/dxwndhost.vs2008.vcproj index f9c70e6..0838f91 100644 --- a/host/dxwndhost.vs2008.vcproj +++ b/host/dxwndhost.vs2008.vcproj @@ -372,6 +372,10 @@ /> + + + + isUpdated=FALSE; @@ -260,6 +271,8 @@ void CDxwndhostView::OnInitialUpdate() GetPrivateProfileString("target", key, "", TitleMaps[i].title, sizeof(TitleMaps[i].title)-1, InitPath); sprintf_s(key, sizeof(key), "module%i", i); GetPrivateProfileString("target", key, "", TargetMaps[i].module, sizeof(TargetMaps[i].module)-1, InitPath); + sprintf_s(key, sizeof(key), "opengllib%i", i); + GetPrivateProfileString("target", key, "", TargetMaps[i].OpenGLLib, sizeof(TargetMaps[i].OpenGLLib)-1, InitPath); sprintf_s(key, sizeof(key), "ver%i", i); TargetMaps[i].dxversion = GetPrivateProfileInt("target", key, 0, InitPath); sprintf_s(key, sizeof(key), "flag%i", i); @@ -290,6 +303,8 @@ void CDxwndhostView::OnInitialUpdate() TargetMaps[i].sizy = GetPrivateProfileInt("target", key, 0, InitPath); sprintf_s(key, sizeof(key), "maxfps%i", i); TargetMaps[i].MaxFPS = GetPrivateProfileInt("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "initts%i", i); + TargetMaps[i].InitTS = GetPrivateProfileInt("target", key, 0, InitPath); listitem.mask = LVIF_TEXT; listitem.iItem = i; listitem.iSubItem = 0; @@ -306,6 +321,7 @@ void CDxwndhostView::OnInitialUpdate() if(m_StartToTray) this->OnGoToTrayIcon(); this->isUpdated=FALSE; pTitles = &TitleMaps[0]; + pTargets= &TargetMaps[0]; } ///////////////////////////////////////////////////////////////////////////// @@ -353,6 +369,7 @@ void CDxwndhostView::OnModify() if(dlg.m_DXVersion > 6) dlg.m_DXVersion -= 5; dlg.m_FilePath = TargetMaps[i].path; dlg.m_Module = TargetMaps[i].module; + dlg.m_OpenGLLib = TargetMaps[i].OpenGLLib; dlg.m_Title = TitleMaps[i].title; dlg.m_UnNotify = TargetMaps[i].flags & UNNOTIFY ? 1 : 0; dlg.m_EmulateSurface = TargetMaps[i].flags & EMULATESURFACE ? 1 : 0; @@ -379,6 +396,7 @@ void CDxwndhostView::OnModify() dlg.m_AutoRefresh = TargetMaps[i].flags & AUTOREFRESH ? 1 : 0; dlg.m_FixWinFrame = TargetMaps[i].flags & FIXWINFRAME ? 1 : 0; dlg.m_HideHwCursor = TargetMaps[i].flags & HIDEHWCURSOR ? 1 : 0; + dlg.m_ShowHwCursor = TargetMaps[i].flags2 & SHOWHWCURSOR ? 1 : 0; dlg.m_EnableClipping = TargetMaps[i].flags & ENABLECLIPPING ? 1 : 0; dlg.m_CursorClipping = TargetMaps[i].flags & CLIPCURSOR ? 1 : 0; dlg.m_VideoToSystemMem = TargetMaps[i].flags & SWITCHVIDEOMEMORY ? 1 : 0; @@ -396,7 +414,9 @@ void CDxwndhostView::OnModify() dlg.m_ModalStyle = TargetMaps[i].flags2 & MODALSTYLE ? 1 : 0; dlg.m_KeepAspectRatio = TargetMaps[i].flags2 & KEEPASPECTRATIO ? 1 : 0; dlg.m_ForceWinResize = TargetMaps[i].flags2 & FORCEWINRESIZE ? 1 : 0; + dlg.m_HookGDI = TargetMaps[i].flags2 & HOOKGDI ? 1 : 0; dlg.m_HideMultiMonitor = TargetMaps[i].flags2 & HIDEMULTIMONITOR ? 1 : 0; + dlg.m_WallpaperMode = TargetMaps[i].flags2 & WALLPAPERMODE ? 1 : 0; dlg.m_HookChildWin = TargetMaps[i].flags & HOOKCHILDWIN ? 1 : 0; dlg.m_MessageProc = TargetMaps[i].flags & MESSAGEPROC ? 1 : 0; dlg.m_FixNCHITTEST = TargetMaps[i].flags2 & FIXNCHITTEST ? 1 : 0; @@ -410,6 +430,7 @@ void CDxwndhostView::OnModify() dlg.m_SkipFPS = TargetMaps[i].flags2 & SKIPFPS ? 1 : 0; dlg.m_ShowFPS = TargetMaps[i].flags2 & SHOWFPS ? 1 : 0; dlg.m_TimeStretch = TargetMaps[i].flags2 & TIMESTRETCH ? 1 : 0; + dlg.m_HookOpenGL = TargetMaps[i].flags2 & HOOKOPENGL ? 1 : 0; dlg.m_InitX = TargetMaps[i].initx; dlg.m_InitY = TargetMaps[i].inity; dlg.m_MinX = TargetMaps[i].minx; @@ -421,9 +442,11 @@ void CDxwndhostView::OnModify() dlg.m_SizX = TargetMaps[i].sizx; dlg.m_SizY = TargetMaps[i].sizy; dlg.m_MaxFPS = TargetMaps[i].MaxFPS; + dlg.m_InitTS = TargetMaps[i].InitTS; if(dlg.DoModal() == IDOK && dlg.m_FilePath.GetLength()){ strcpy_s(TargetMaps[i].path, sizeof(TargetMaps[i].path), dlg.m_FilePath); strcpy_s(TargetMaps[i].module, sizeof(TargetMaps[i].module), dlg.m_Module); + strcpy_s(TargetMaps[i].OpenGLLib, sizeof(TargetMaps[i].OpenGLLib), dlg.m_OpenGLLib); strcpy_s(TitleMaps[i].title, sizeof(TitleMaps[i].title), dlg.m_Title); if(dlg.m_DXVersion > 1) dlg.m_DXVersion += 5; TargetMaps[i].dxversion = dlg.m_DXVersion; @@ -469,6 +492,7 @@ void CDxwndhostView::OnModify() if(dlg.m_AutoRefresh) TargetMaps[i].flags |= AUTOREFRESH; if(dlg.m_FixWinFrame) TargetMaps[i].flags |= FIXWINFRAME; if(dlg.m_HideHwCursor) TargetMaps[i].flags |= HIDEHWCURSOR; + if(dlg.m_ShowHwCursor) TargetMaps[i].flags2 |= SHOWHWCURSOR; if(dlg.m_EnableClipping) TargetMaps[i].flags |= ENABLECLIPPING; if(dlg.m_CursorClipping) TargetMaps[i].flags |= CLIPCURSOR; if(dlg.m_VideoToSystemMem) TargetMaps[i].flags |= SWITCHVIDEOMEMORY; @@ -486,7 +510,9 @@ void CDxwndhostView::OnModify() if(dlg.m_ModalStyle) TargetMaps[i].flags2 |= MODALSTYLE; if(dlg.m_KeepAspectRatio) TargetMaps[i].flags2 |= KEEPASPECTRATIO; if(dlg.m_ForceWinResize) TargetMaps[i].flags2 |= FORCEWINRESIZE; + if(dlg.m_HookGDI) TargetMaps[i].flags2 |= HOOKGDI; if(dlg.m_HideMultiMonitor) TargetMaps[i].flags2 |= HIDEMULTIMONITOR; + if(dlg.m_WallpaperMode) TargetMaps[i].flags2 |= WALLPAPERMODE; if(dlg.m_HookChildWin) TargetMaps[i].flags |= HOOKCHILDWIN; if(dlg.m_MessageProc) TargetMaps[i].flags |= MESSAGEPROC; if(dlg.m_FixNCHITTEST) TargetMaps[i].flags2 |= FIXNCHITTEST; @@ -500,6 +526,7 @@ void CDxwndhostView::OnModify() if(dlg.m_SkipFPS) TargetMaps[i].flags2 |= SKIPFPS; if(dlg.m_ShowFPS) TargetMaps[i].flags2 |= SHOWFPS; if(dlg.m_TimeStretch) TargetMaps[i].flags2 |= TIMESTRETCH; + if(dlg.m_HookOpenGL) TargetMaps[i].flags2 |= HOOKOPENGL; TargetMaps[i].initx = dlg.m_InitX; TargetMaps[i].inity = dlg.m_InitY; TargetMaps[i].minx = dlg.m_MinX; @@ -511,7 +538,9 @@ void CDxwndhostView::OnModify() TargetMaps[i].sizx = dlg.m_SizX; TargetMaps[i].sizy = dlg.m_SizY; TargetMaps[i].MaxFPS = dlg.m_MaxFPS; + TargetMaps[i].InitTS = dlg.m_InitTS; strcpy_s(TargetMaps[i].module, sizeof(TargetMaps[i].module), dlg.m_Module); + strcpy_s(TargetMaps[i].OpenGLLib, sizeof(TargetMaps[i].OpenGLLib), dlg.m_OpenGLLib); strcpy_s(TitleMaps[i].title, sizeof(TitleMaps[i].title), dlg.m_Title); CListCtrl& listctrl = GetListCtrl(); listitem.mask = LVIF_TEXT; @@ -706,6 +735,7 @@ void CDxwndhostView::OnAdd() if(dlg.DoModal() == IDOK && dlg.m_FilePath.GetLength()){ strcpy_s(TargetMaps[i].path,sizeof(TargetMaps[i].path),dlg.m_FilePath); strcpy_s(TargetMaps[i].module,sizeof(TargetMaps[i].module),dlg.m_Module); + strcpy_s(TargetMaps[i].OpenGLLib,sizeof(TargetMaps[i].OpenGLLib),dlg.m_OpenGLLib); strcpy_s(TitleMaps[i].title, sizeof(TitleMaps[i].title), dlg.m_Title); if(dlg.m_DXVersion > 1) dlg.m_DXVersion += 5; TargetMaps[i].dxversion = dlg.m_DXVersion; @@ -751,6 +781,7 @@ void CDxwndhostView::OnAdd() if(dlg.m_AutoRefresh) TargetMaps[i].flags |= AUTOREFRESH; if(dlg.m_FixWinFrame) TargetMaps[i].flags |= FIXWINFRAME; if(dlg.m_HideHwCursor) TargetMaps[i].flags |= HIDEHWCURSOR; + if(dlg.m_ShowHwCursor) TargetMaps[i].flags2 |= SHOWHWCURSOR; if(dlg.m_EnableClipping) TargetMaps[i].flags |= ENABLECLIPPING; if(dlg.m_CursorClipping) TargetMaps[i].flags |= CLIPCURSOR; if(dlg.m_VideoToSystemMem) TargetMaps[i].flags |= SWITCHVIDEOMEMORY; @@ -768,7 +799,9 @@ void CDxwndhostView::OnAdd() if(dlg.m_ModalStyle) TargetMaps[i].flags2 |= MODALSTYLE; if(dlg.m_KeepAspectRatio) TargetMaps[i].flags2 |= KEEPASPECTRATIO; if(dlg.m_ForceWinResize) TargetMaps[i].flags2 |= FORCEWINRESIZE; + if(dlg.m_HookGDI) TargetMaps[i].flags2 |= HOOKGDI; if(dlg.m_HideMultiMonitor) TargetMaps[i].flags2 |= HIDEMULTIMONITOR; + if(dlg.m_WallpaperMode) TargetMaps[i].flags2 |= WALLPAPERMODE; if(dlg.m_HookChildWin) TargetMaps[i].flags |= HOOKCHILDWIN; if(dlg.m_MessageProc) TargetMaps[i].flags |= MESSAGEPROC; if(dlg.m_FixNCHITTEST) TargetMaps[i].flags2 |= FIXNCHITTEST; @@ -782,6 +815,7 @@ void CDxwndhostView::OnAdd() if(dlg.m_SkipFPS) TargetMaps[i].flags2 |= SKIPFPS; if(dlg.m_ShowFPS) TargetMaps[i].flags2 |= SHOWFPS; if(dlg.m_TimeStretch) TargetMaps[i].flags2 |= TIMESTRETCH; + if(dlg.m_HookOpenGL) TargetMaps[i].flags2 |= HOOKOPENGL; TargetMaps[i].initx = dlg.m_InitX; TargetMaps[i].inity = dlg.m_InitY; TargetMaps[i].minx = dlg.m_MinX; @@ -793,6 +827,7 @@ void CDxwndhostView::OnAdd() TargetMaps[i].sizx = dlg.m_SizX; TargetMaps[i].sizy = dlg.m_SizY; TargetMaps[i].MaxFPS = dlg.m_MaxFPS; + TargetMaps[i].InitTS = dlg.m_InitTS; CListCtrl& listctrl = GetListCtrl(); listitem.mask = LVIF_TEXT; listitem.iItem = i; @@ -1018,6 +1053,13 @@ void CDxwndhostView::OnViewStatus() pDlg->ShowWindow(SW_SHOW); } +void CDxwndhostView::OnViewTimeSlider() +{ + CTimeSliderDialog *pDlg = new CTimeSliderDialog(); + BOOL ret = pDlg->Create(CTimeSliderDialog::IDD, this); + pDlg->ShowWindow(SW_SHOW); +} + void CDxwndhostView::Resize() { CListCtrl& listctrl = GetListCtrl(); diff --git a/host/dxwndhostView.h b/host/dxwndhostView.h index f1075f2..281e7d8 100644 --- a/host/dxwndhostView.h +++ b/host/dxwndhostView.h @@ -76,6 +76,7 @@ protected: afx_msg void OnHookStop(); afx_msg void OnTrayRestore(); afx_msg void OnViewStatus(); + afx_msg void OnViewTimeSlider(); afx_msg void OnExit(); //}}AFX_MSG DECLARE_MESSAGE_MAP()