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

v2_03_98_src

Former-commit-id: 0ccae4566e2686b634ad5e56617ca947993f1d28
This commit is contained in:
gho tik 2016-11-26 11:48:21 -05:00 committed by Refael ACkermann
parent fa59792b6d
commit 0e0ef465dc
61 changed files with 2018 additions and 1606 deletions

1
Debug/.gitattributes vendored Normal file
View File

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

3
Debug/ddraw.dll Normal file
View File

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

BIN
Debug/ddraw.ilk Normal file

Binary file not shown.

View File

@ -41,7 +41,7 @@
#define CLIENTREMAPPING 0x08000000 // hooks ClientToRect, RectToClient, GetClientRect, GetWinRect
#define HANDLEALTF4 0x10000000 // forces quitting the program when receiving Alt-F4 key
#define LOCKWINPOS 0x20000000 // prevent the program to change its own windows properties
#define HOOKCHILDWIN 0x40000000 // hook CHILD windows to alter placement coordinates (UNUSED)
#define HOOKCHILDWIN 0x40000000 // hook CHILD windows to alter placement coordinates
#define MESSAGEPROC 0x80000000 // process peek/get messages
// second flags DWORD dxw.dwFlags2:
@ -246,8 +246,14 @@
#define ANCHORED 0x10000000 // Anchored position & size, mo stretching or sliding is allowed
#define CLEARTEXTUREFOURCC 0x20000000 // Clear DDSCAPS2_FOURCC bit and makes texture load without codec
#define NODDEXCLUSIVEMODE 0x40000000 // Do not allow ddraw EXCLUSIVE mode also in non windowed mode
#define COPYNOSHIMS 0x80000000 // Create a hiden and temporary copy of the target exe so that shims are not applied
// eighth flags DWORD dxw.dwFlags8:
#define FORCEWAIT 0x00000001 // Forces DDBLT/DDFLIP WAIT flags
#define FORCENOWAIT 0x00000002 // Forces DDBLT/DDFLIP NOWAIT flags
#define FORCEVSYNC 0x00000004 // Forces hardware VSync
#define FORCENOVSYNC 0x00000008 // Forces NO hardware VSync
#define VSYNCSCANLINE 0x00000010 // Activates WaitForVerticalBlank algorythm based on reaching a given scan line
// logging Tflags DWORD:
#define OUTTRACE 0x00000001 // enables tracing to dxwnd.log in general
@ -258,7 +264,7 @@
//#define DXPROXED 0x00000020 // hook DX proxy methods to log each call in original behaviour
#define ASSERTDIALOG 0x00000040 // show assert messages in Dialog Box
#define OUTIMPORTTABLE 0x00000080 // dump import table contents
#define OUTDEBUG 0x00000100 // detailed debugging indormation
#define OUTDEBUG 0x00000100 // detailed debugging information
#define OUTREGISTRY 0x00000200 // log registry operations
#define TRACEHOOKS 0x00000400 // log hook operations
#define OUTD3DTRACE 0x00000800 // traces DxWnd direct3d screen handling
@ -306,6 +312,7 @@ typedef struct TARGETMAP
short SwapEffect;
short MaxDdrawInterface;
short SlowRatio;
short ScanLine;
}TARGETMAP;
typedef struct

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4af08fde73eb963389ed3ef80c024a9aaf6a711bfc70f8b2c2091c9c75dfbbad
size 700928
oid sha256:d7f4c6f63e720e5a4a2275522d0d414d00fba3b80e28751a6db8e1f0613483f0
size 706560

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2e87504512135e86893727a9d1fec372ce4ad78e50f6b897ddf819bc6fd3d9db
size 665600
oid sha256:4c369251987e49585a3cb5776a808fafe262ccf2d6b0ef0265275ba2080189ac
size 667136

View File

@ -1,349 +0,0 @@
[window]
exportpath=D:\DxWnd.develop\v2_03_97_beta\build\exports\
posx=-592
posy=438
sizx=436
sizy=417
exepath=D:\Games\Warhammer 40.000 Dark Omen\PRG_ENG\
debug=1
autohide=0
checkadmin=0
namefromfolder=0
multiprocesshook=0
updatepaths=1
defaultcoord=0
defaultposx=50
defaultposy=50
defaultsizx=800
defaultsizy=600
[target]
title0=Warhammer 40K Rites of War
path0=D:\Games\Warhammer 40.000 Rites of War\RoWDemo.exe
startfolder0=
launchpath0=
module0=
opengllib0=
notes0=After installing the game copy the "Map" -folder from the CD to the \nRites of War\ directory on your hard drive.\n\nThis will fix the issue where the game crashes when starting a campaign.
registry0=
ver0=0
monitorid0=0
coord0=0
flag0=685772838
flagg0=1207959680
flagh0=20
flagi0=138412036
flagj0=4224
flagk0=65536
flagl0=0
flagm0=0
tflag0=0
dflag0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1
swapeffect0=0
maxddinterface0=7
slowratio0=2
initresw0=0
initresh0=0
title1=Adrenix mod
path1=D:\Games\Adrenix\Adrenix.exe
startfolder1=
launchpath1=
module1=
opengllib1=
notes1=
registry1=
ver1=0
monitorid1=-1
coord1=0
flag1=136314915
flagg1=1207959552
flagh1=8212
flagi1=138412036
flagj1=4224
flagk1=2424840
flagl1=0
flagm1=0
tflag1=-2147483647
dflag1=0
posx1=50
posy1=50
sizx1=0
sizy1=0
maxfps1=0
initts1=0
winver1=0
maxres1=-1
swapeffect1=0
maxddinterface1=7
slowratio1=2
initresw1=800
initresh1=600
title2=Adrenix 3D
path2=D:\Games\Adrenix\AdrenixD.exe
startfolder2=
launchpath2=
module2=
opengllib2=
notes2=
registry2=
ver2=0
monitorid2=0
coord2=0
flag2=134234150
flagg2=1208025088
flagh2=20
flagi2=138412036
flagj2=5248
flagk2=65536
flagl2=0
flagm2=0
tflag2=-2147477245
dflag2=0
posx2=50
posy2=50
sizx2=800
sizy2=600
maxfps2=0
initts2=0
winver2=0
maxres2=-1
swapeffect2=0
maxddinterface2=7
slowratio2=1
initresw2=0
initresh2=0
title3=Minigolf master miniverse demo
path3=D:\Games\MiniGolf Master Demo\mvdemo.exe
startfolder3=
launchpath3=
module3=
opengllib3=
notes3=
registry3=
ver3=0
monitorid3=-1
coord3=0
flag3=136314914
flagg3=1207959552
flagh3=20
flagi3=138412036
flagj3=4224
flagk3=33882112
flagl3=32768
flagm3=0
tflag3=0
dflag3=0
posx3=50
posy3=50
sizx3=800
sizy3=600
maxfps3=0
initts3=0
winver3=0
maxres3=-1
swapeffect3=0
maxddinterface3=7
slowratio3=2
initresw3=640
initresh3=480
title4=Galapagos
module4=
opengllib4=
monitorid4=-1
dflag4=0
initresw4=640
initresh4=480
path4=D:\Games\Galapagos\GALA.EXE
startfolder4=
launchpath4=
notes4=
registry4=
ver4=7
coord4=0
flag4=137379894
flagg4=1207959552
flagh4=33300
flagi4=138412036
flagj4=469766272
flagk4=67584
flagl4=92340240
flagm4=0
tflag4=-2147477245
posx4=150
posy4=150
sizx4=800
sizy4=600
maxfps4=0
initts4=0
winver4=0
maxres4=-1
swapeffect4=0
maxddinterface4=7
slowratio4=2
title5=Incubation.exe
module5=
opengllib5=
monitorid5=-1
dflag5=0
initresw5=800
initresh5=600
path5=D:\Games\Incubation\Incubation.exe
startfolder5=
launchpath5=
notes5=
registry5=
ver5=0
coord5=0
flag5=681574434
flagg5=1208221696
flagh5=20
flagi5=138412036
flagj5=4224
flagk5=65536
flagl5=0
flagm5=0
tflag5=0
posx5=50
posy5=50
sizx5=800
sizy5=600
maxfps5=0
initts5=0
winver5=0
maxres5=-1
swapeffect5=0
maxddinterface5=7
slowratio5=2
title6=Autorun.exe
path6=D:\Games\Incubation\Autorun.exe
startfolder6=
launchpath6=
module6=
opengllib6=
notes6=
registry6=
ver6=0
monitorid6=-1
coord6=0
flag6=136314914
flagg6=1207959552
flagh6=20
flagi6=134217732
flagj6=4224
flagk6=65536
flagl6=0
flagm6=0
tflag6=0
dflag6=0
posx6=50
posy6=50
sizx6=800
sizy6=600
maxfps6=0
initts6=0
winver6=0
maxres6=-1
swapeffect6=0
maxddinterface6=7
slowratio6=2
initresw6=800
initresh6=600
title7=Warhammer 40.000 Dark Omen
path7=D:\Games\Warhammer 40.000 Dark Omen\PRG_ENG\ENGREL.EXE
startfolder7=
launchpath7=
module7=
opengllib7=
notes7=
registry7=
ver7=0
monitorid7=-1
coord7=0
flag7=136314922
flagg7=1207959552
flagh7=4
flagi7=138412036
flagj7=4224
flagk7=65536
flagl7=0
flagm7=0
tflag7=-2147477245
dflag7=0
posx7=50
posy7=50
sizx7=800
sizy7=600
maxfps7=0
initts7=0
winver7=0
maxres7=-1
swapeffect7=0
maxddinterface7=7
slowratio7=2
initresw7=800
initresh7=600
title8=Warhammer Dark Omen
path8=D:\Games\Warhammer 40.000 Dark Omen\PRG_ENG\ENGREL.EXE
startfolder8=
launchpath8=
module8=
opengllib8=
notes8=Dark Omen needs a d3drm.dll file to run:\n- This file can be located in the CD's \DIRECTX -folder.\n- Copy the file into the "Dark Omen\PRG_ENG" directory.\n\nSound issues:\nDark Omen can sometimes produce a burst of white noise from the speakers.\nUsing the Timing option "CPU slow down" may fix this issue.
registry8=[HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts\Dark Omen\1.0\Options\Options]\n"Selected"="4"\n"HardwareSelected"="252"\n"SoftwareSelected"="228"\n"MMXSelected"="256"\n"ToolTips"="1"\n"MusicVolume"="408"\n"SFXVolume"="816"\n"SoftwareSoundQuality"="2"\n"SoftwareParticleQuality"="2"\n"MMXSoundQuality"="2"\n"MMXParticaleQuality"="1"\n"HardwareSoundQuality"="2"\n"HardwareParticleQuality"="2"\n"InformationNum"="11"\n
ver8=0
monitorid8=-1
coord8=0
flag8=136314922
flagg8=1207959552
flagh8=9236
flagi8=1212153860
flagj8=4224
flagk8=67584
flagl8=0
flagm8=0
tflag8=0
dflag8=0
posx8=50
posy8=50
sizx8=800
sizy8=600
maxfps8=0
initts8=0
winver8=0
maxres8=-1
swapeffect8=0
maxddinterface8=7
slowratio8=2
initresw8=800
initresh8=600
[texture]
MinTexX=0
MinTexY=0
MaxTexX=0
MaxTexY=0
[keymapping]
timetoggle=
timefast=
timeslow=
altf4=
cliptoggle=
refresh=
logtoggle=
plogtoggle=
fpstoggle=
printscreen=
corner=
freezetime=
fullscreen=
workarea=
desktop=
minimize=
restore=
kill=

View File

@ -1,32 +0,0 @@
OnRun idx=8 prog="D:\Games\Warhammer 40.000 Dark Omen\PRG_ENG\ENGREL.EXE"
self elevation
export virtual registry
setwindowshook mode
OnRun idx=8 prog="D:\Games\Warhammer 40.000 Dark Omen\PRG_ENG\ENGREL.EXE"
self elevation
export virtual registry
setwindowshook mode
OnRun idx=8 prog="D:\Games\Warhammer 40.000 Dark Omen\PRG_ENG\ENGREL.EXE"
self elevation
export virtual registry
setwindowshook mode
OnRun idx=8 prog="D:\Games\Warhammer 40.000 Dark Omen\PRG_ENG\ENGREL.EXE"
self elevation
export virtual registry
setwindowshook mode
OnRun idx=9 prog="D:\Games\If-18 Carrier Strike Fighter\if18.exe"
setwindowshook mode
OnRun idx=9 prog="D:\Games\If-18 Carrier Strike Fighter\if18.exe"
setwindowshook mode
OnRun idx=9 prog="D:\Games\If-18 Carrier Strike Fighter\if18.exe"
setwindowshook mode
OnRun idx=9 prog="D:\Games\If-18 Carrier Strike Fighter\if18.exe"
setwindowshook mode
OnRun idx=9 prog="D:\Games\If-18 Carrier Strike Fighter\if18.exe"
setwindowshook mode
OnRun idx=9 prog="D:\Games\If-18 Carrier Strike Fighter\if19.exe"
setwindowshook mode
OnRun idx=9 prog="D:\Games\If-18 Carrier Strike Fighter\if19.exe"
setwindowshook mode
OnRun idx=9 prog="D:\Games\If-18 Carrier Strike Fighter\if19.exe"
setwindowshook mode

View File

@ -1,16 +0,0 @@
[HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts\Dark Omen\1.0\Options\Options]
"Selected"="4"
"HardwareSelected"="252"
"SoftwareSelected"="228"
"MMXSelected"="256"
"ToolTips"="1"
"MusicVolume"="408"
"SFXVolume"="816"
"SoftwareSoundQuality"="2"
"SoftwareParticleQuality"="2"
"MMXSoundQuality"="2"
"MMXParticaleQuality"="1"
"HardwareSoundQuality"="2"
"HardwareParticleQuality"="2"
"InformationNum"="11"

View File

@ -1,11 +1,11 @@
[target]
title0=Crimson Skies
path0=D:\Games\Crimson_Skies\crimson.exe
path0=F:\Games\Crimson Skies\crimson.exe
module0=
opengllib0=
ver0=7
coord0=0
flag0=140525606
flag0=677396518
flagg0=1207959568
flagh0=20
flagi0=4194596
@ -30,3 +30,13 @@ notes0=
flagk0=65536
swapeffect0=0
registry0=
startfolder0=
monitorid0=0
flagl0=512
flagm0=0
dflag0=0
maxddinterface0=7
slowratio0=1
scanline0=1
initresw0=0
initresh0=0

View File

@ -0,0 +1,36 @@
[target]
title0=DOSBox-0.74
path0=C:\Program Files (x86)\DOSBox-0.74\DOSBox.exe
startfolder0=
launchpath0=
module0=sdl.dll
opengllib0=
notes0=
registry0=
ver0=0
monitorid0=-1
coord0=0
flag0=136314914
flagg0=1208090624
flagh0=20
flagi0=138412036
flagj0=4224
flagk0=4259840
flagl0=4489216
flagm0=0
tflag0=0
dflag0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1
swapeffect0=0
maxddinterface0=7
slowratio0=2
scanline0=0
initresw0=800
initresh0=600

View File

@ -0,0 +1,35 @@
[target]
title0=Dinosaur Resurrection
path0=F:\Games\Dinosaur Resurrection\FALCOM\DIN\DIN_Win.EXE
startfolder0=
launchpath0=
module0=
opengllib0=
notes0=
registry0=
ver0=0
monitorid0=-1
coord0=0
flag0=673185826
flagg0=1207959552
flagh0=20
flagi0=138412036
flagj0=4224
flagk0=65536
flagl0=8388608
flagm0=0
tflag0=0
dflag0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1
swapeffect0=0
maxddinterface0=7
slowratio0=2
initresw0=640
initresh0=480

View File

@ -0,0 +1,35 @@
[target]
title0=Need for Speed 5 Porsche Unleashed
path0=F:\Games\Need for Speed 5\Porsche.exe
startfolder0=
launchpath0=
module0=
opengllib0=
notes0=
registry0=
ver0=0
monitorid0=-1
coord0=0
flag0=136314914
flagg0=1207959552
flagh0=20
flagi0=138412036
flagj0=4224
flagk0=65536
flagl0=32768
flagm0=0
tflag0=0
dflag0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1
swapeffect0=0
maxddinterface0=7
slowratio0=2
initresw0=800
initresh0=600

View File

@ -0,0 +1,36 @@
[target]
title0=Ultimate Spiderman
path0=F:\Games\Ultimate Spiderman\USM.exe
startfolder0=
launchpath0=
module0=
opengllib0=
notes0=
registry0=
ver0=0
monitorid0=-1
coord0=0
flag0=673202214
flagg0=1207959552
flagh0=20
flagi0=138412036
flagj0=1073746048
flagk0=65536
flagl0=1048576
flagm0=0
tflag0=0
dflag0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1
swapeffect0=0
maxddinterface0=7
slowratio0=2
scanline0=0
initresw0=800
initresh0=600

View File

@ -1,6 +1,12 @@
OnRun idx=7 prog="F:\Games\Warhammer 40K Rites Of War\RoW.exe"
OnRun idx=23 prog="D:\Games\Crimson_Skies\crimson.exe"
setwindowshook mode
OnRun idx=7 prog="F:\Games\Warhammer 40K Rites Of War\RoW.exe"
setwindowshook mode
OnRun idx=7 prog="F:\Games\Warhammer 40K Rites Of War\RoW.exe"
OnRun idx=23 prog="D:\Games\Crimson_Skies\crimson.exe"
setwindowshook mode
OnRun idx=23 prog="D:\Games\Crimson_Skies\crimson.exe"
injectsuspended mode
InjectSuspended: exe=D:\Games\Crimson_Skies\crimson.exe dir=D:\Games\Crimson_Skies
Target handle=844
NT Header offset=F8
AddressOfEntryPoint=1F7056 ImageBase=400000
Thread start address=5f7056
wait cycle 0 eip=5f7056

View File

@ -51,7 +51,7 @@
<a href="Initialvirtualcolorsetting.html"><img src="img/arrow_left.png" alt="Previous"/></a>
<a href="Screenresolution.html"><img src="img/arrow_right.png" alt="Next"/></a>
<a href="Windowsizeposition.html"><img src="img/arrow_right.png" alt="Next"/></a>
</div>
<div class="clear"></div>

View File

@ -86,6 +86,18 @@
<td width="1380" style="border-color: #000000; border-style: solid; padding: 1px;"><p class="rvps2"><span class="rvts6">Enables debug features. Not recommended!</span></p>
</td>
</tr>
<tr valign="top">
<td width="163" style="border-color: #000000; border-style: solid; padding: 1px;"><p class="rvps2"><span class="rvts17">/R:n</span></p>
</td>
<td width="1380" style="border-color: #000000; border-style: solid; padding: 1px;"><p class="rvps2"><span class="rvts6">Automatically starts DxWnd iconized to the system tray, runs the </span><span class="rvts19">n</span><span class="rvts6">th program in the configuration file, and exits DxWnd.</span></p>
</td>
</tr>
<tr valign="top">
<td width="163" style="border-color: #000000; border-style: solid; padding: 1px;"><p class="rvps2"><span class="rvts17">/q</span></p>
</td>
<td width="1380" style="border-color: #000000; border-style: solid; padding: 1px;"><p class="rvps2"><span class="rvts6">Quiet mode. DxWnd will not produce message dialogs.</span></p>
</td>
</tr>
</table>
</div>
<p></p>

View File

@ -89,7 +89,7 @@
</td>
<td width="133" style="border-color: #000000; border-style: solid; padding: 1px;"><p class="rvps2"><span class="rvts17">SAVELOAD</span></p>
</td>
<td width="1160" style="border-color: #000000; border-style: solid; padding: 1px;"><p class="rvps2"><span class="rvts6">Optimizes the CPU load, but only for DirectDraw operations (DirectX1 to DirectX7).</span></p>
<td width="1160" style="border-color: #000000; border-style: solid; padding: 1px;"><p class="rvps2"><span class="rvts6">Optimizes the CPU load, but only for DirectDraw operations (DirectX1 to DirectX9).</span></p>
</td>
</tr>
<tr valign="top">

View File

@ -49,7 +49,7 @@
<div id="topic_header_nav">
<a href="Video.html"><img src="img/arrow_up.png" alt="Parent"/></a>
<a href="Colormanagement.html"><img src="img/arrow_left.png" alt="Previous"/></a>
<a href="Windowsizeposition.html"><img src="img/arrow_left.png" alt="Previous"/></a>
<a href="Input.html"><img src="img/arrow_right.png" alt="Next"/></a>

View File

@ -0,0 +1,100 @@
<html>
<head>
<title>Window size &amp; position</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="generator" content="HelpNDoc Personal Edition 4.6.2.573">
<meta name="keywords" content="">
<link type="text/css" rel="stylesheet" media="all" href="css/reset.css" />
<link type="text/css" rel="stylesheet" media="all" href="css/base.css" />
<link type="text/css" rel="stylesheet" media="all" href="css/hnd.css" />
<!--[if lte IE 8]>
<link type="text/css" rel="stylesheet" media="all" href="css/ielte8.css" />
<![endif]-->
<style type="text/css">
#topic_header
{
background-color: #EFEFEF;
}
</style>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/hnd.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
if (top.frames.length == 0)
{
var sTopicUrl = top.location.href.substring(top.location.href.lastIndexOf("/") + 1, top.location.href.length);
top.location.href = "DxWnd.html?" + sTopicUrl;
}
else if (top && top.FrameTOC && top.FrameTOC.SelectTocItem)
{
top.FrameTOC.SelectTocItem("Windowsizeposition");
}
});
</script>
</head>
<body>
<div id="topic_header">
<div id="topic_header_content">
<h1 id="topic_header_text">Window size &amp; position</h1>
<div id="topic_breadcrumb">
<a href="Theconfigurationpanel.html">The configuration panel</a> &rsaquo;&rsaquo; <a href="Video.html">Video</a> &rsaquo;&rsaquo; </div>
</div>
<div id="topic_header_nav">
<a href="Video.html"><img src="img/arrow_up.png" alt="Parent"/></a>
<a href="Colormanagement.html"><img src="img/arrow_left.png" alt="Previous"/></a>
<a href="Screenresolution.html"><img src="img/arrow_right.png" alt="Next"/></a>
</div>
<div class="clear"></div>
</div>
<div id="topic_content">
<p></p>
<div class="rvps2"><table width="100%" border="1" cellpadding="1" cellspacing="2" style="border-color: #000000; border-style: solid; border-spacing: 2px;">
<tr valign="top">
<td width="84" style="border-color: #000000; border-style: solid; padding: 1px;"><p class="rvps2"><span class="rvts6">Free</span></p>
</td>
<td width="1459" style="border-color: #000000; border-style: solid; padding: 1px;"><p class="rvps2"><span class="rvts6">Allows you to move and resize the window freely, with commands from inside the application (through system calls) or from external user commands (such as grabbing the window border to stretch or move the window).</span></p>
</td>
</tr>
<tr valign="top">
<td width="84" style="border-color: #000000; border-style: solid; padding: 1px;"><p class="rvps2"><span class="rvts6">Floating</span></p>
</td>
<td width="1459" style="border-color: #000000; border-style: solid; padding: 1px;"><p class="rvps2"><span class="rvts6">Move and resize operations are allowed only from user commands, but internal operations are intercepted and neutralized.</span></p>
</td>
</tr>
<tr valign="top">
<td width="84" style="border-color: #000000; border-style: solid; padding: 1px;"><p class="rvps2"><span class="rvts6">Locked size</span></p>
</td>
<td width="1459" style="border-color: #000000; border-style: solid; padding: 1px;"><p class="rvps2"><span class="rvts6">It is only possible to move the window from user external commands, and the window can't be stretched or altered from internal operations.</span></p>
</td>
</tr>
<tr valign="top">
<td width="84" style="border-color: #000000; border-style: solid; padding: 1px;"><p class="rvps2"><span class="rvts6">Anchored</span></p>
</td>
<td width="1459" style="border-color: #000000; border-style: solid; padding: 1px;"><p class="rvps2"><span class="rvts6">The window will remain fixed in its original position.</span></p>
</td>
</tr>
</table>
</div>
<p></p>
</div>
<div id="topic_footer">
<div id="topic_footer_content">
Copyright &copy; 2016 by GHO. All Rights Reserved.</div>
</div>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@ -456,6 +456,12 @@
target="FrameMain">
Color management</a>
</li><li class="" id="Windowsizeposition" data="">
<a
href="Windowsizeposition.html"
target="FrameMain">
Window size &amp; position</a>
</li><li class="" id="Screenresolution" data="">
<a
href="Screenresolution.html"

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:37885dbe85ab16b1b2cf2c3b076fabcab8e7b4449805b687e6bf407f3d16fcf2
oid sha256:3ed113b19339a8f63d6ae25dfb0ed2e78b90369c80c3ddf16e507230f34a15da
size 54784

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1cdc266999665fbf022cd1853a03180d854014a4be9436b0b9faeaa6b8244aea
oid sha256:6ef0610692cc6fdcc6f1b8260e118c5974cd93e9fb41dd5070e1e30fb40956d3
size 55808

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:aa3872f2e46abbb3f7eba695aeee5e2b93a454be8d56f8beaf63c06921910730
oid sha256:eb3a493b93714ec278186cdf8e71228e843b8681df6278f5da5cedb419f70e14
size 56320

View File

@ -1349,11 +1349,24 @@ fix: CreateDIBSection wrapper log messages
fix: PREVENTMAXIMIZE window size checks: should avoid size bigger than initial size, bugged coding inhibited any growth.
fix: GUI setting of execution folder when running "Launcher" task.
v2.03.97.rc1/fx1-4:
v2.03.97.rc1/fx1-3:
fix: emulation of proper ddraw surface capabilities in GetSurfaceDesc() and GetCaps() methods. Seems to cope with needs of most (all?) games.
fix: recovered handling of WM_ERASEBKGND message. Fixes missing backgrounds in "Adrenix" and "Adrenix 3D" games.
fix: cleaned up and unified capability handling in DirectDrawSurface GetCaps and GetSurfaceDesc methods
add: warning message and update when running a program with non updated virtual registry settings.
fix: LoadLibrary wrappers failed to clear the recursion flag, stopping the hook of new modules after a recursion case.
add: warning message and update when running a program with non updated virtual registry settings.fix: LoadLibrary wrappers failed to clear the recursion flag, stopping the hook of new modules after a recursion case.
add: warning messages when closing DxWnd and possibility to cancel the operation
add: "Warn on exit" global flag to always force the warning message on exit
v2.03.98
add: fine tuning for vsync options: three modes (default: game native, force on, force off) three algorythms (ddraw WaitForVerticalBlank, loop controlled by GetScanLine, loop controlled by time delay)
add: fine tuning for WAIT options in ddraw Flip() and Blt() methods: three modes (default: game native, force on, force off)
fix: better support for non windowed + no emulation mode, surfaces and blit operations are left (almost) in original state, surface capabilities are left inaltered
fix: added missing recovery on surface lost
fix: some missing or wrong logs
fix: suppression of WS_EX_TOPMOST flag in all conditions for UNLOCKZORDER mode
fix: SUPPRESSOVERLAY flag applied also to D3D capabilities from D3D GetDeviceCaps() method
add: added more API hookers in IMAGEHLP.DLL bypass
fix: fixed logic to hook WindowProc routines for main window, childs and dialogs.
fix: more frequent updates of window coordinates to avoid scaling errors
fix: fixed CreateDialogIndirectParam and CreateDialogParam wrappers to make inner windows properly scaled (fixes red Alert 2)
fix: recovered DEFAULTMESSAGES option
fix: normalized output for ddraw GetScanLine() method

View File

@ -9,6 +9,7 @@
#include "dxhelper.h"
extern LPDIRECTDRAWSURFACE lpDDSEmu_Prim;
extern BOOL bVSyncDone;
extern LPDIRECTDRAW lpPrimaryDD;
extern Blt_Type pBlt;
extern ReleaseS_Type pReleaseSMethod(int);
@ -40,8 +41,6 @@ static HRESULT sBltNoPrimary(int dxversion, Blt_Type pBlt, char *api, LPDIRECTDR
RECT srcrect;
HRESULT res;
BOOL FromScreen;
//extern PrimaryBlt_Type pPrimaryBlt;
//CkArg arg;
FromScreen=dxwss.IsAPrimarySurface(lpddssrc);
@ -194,7 +193,7 @@ static HRESULT sBltToPrimary(int dxversion, Blt_Type pBlt, char *api, LPDIRECTDR
else
if(dxw.HandleFPS()) return DD_OK;
if(dxw.dwFlags5 & NOBLT) return DD_OK;
destrect=dxw.MapWindowRect(lpdestrect);
OutTraceB("DESTRECT=(%d,%d)-(%d,%d) Screen=(%dx%d)\n",
destrect.left, destrect.top, destrect.right, destrect.bottom,
@ -207,20 +206,32 @@ static HRESULT sBltToPrimary(int dxversion, Blt_Type pBlt, char *api, LPDIRECTDR
}
// =========================
// Blit to primary direct surface
// Blit to primary direct or fullscreen surface
// =========================
if(!(dxw.dwFlags1 & (EMULATESURFACE|EMULATEBUFFER))){
if(!dxw.IsEmulated){
res=DD_OK;
if((dxw.dwFlags1 & SAVELOAD) || (dxw.dwFlags8 & FORCEVSYNC)) {
HRESULT res2;
if(!bVSyncDone){
if(res2=lpPrimaryDD->WaitForVerticalBlank(DDWAITVB_BLOCKBEGIN , 0))
OutTraceE("WaitForVerticalBlank ERROR: res=%x\n", res2);
}
bVSyncDone = FALSE;
}
if(dxw.Windowize) lpdestrect = &destrect;
// blit only when source and dest surface are different. Should make ScreenRefresh faster.
if (lpdds != lpddssrc) {
dxw.ShowOverlay(lpddssrc);
if (IsDebug) BlitTrace("PRIM-NOEMU", lpsrcrect, &destrect, __LINE__);
res=(*pPrimaryBlt)(dxversion, pBlt, lpdds, &destrect, lpddssrc, lpsrcrect);
if (IsDebug) BlitTrace("PRIM-NOEMU", lpsrcrect, lpdestrect, __LINE__);
res=(*pPrimaryBlt)(dxversion, pBlt, lpdds, lpdestrect, lpddssrc, lpsrcrect, lpddbltfx);
//res=(*pBlt)(lpdds, lpdestrect, lpddssrc, lpsrcrect, dwflags, lpddbltfx);
}
if(res){
BlitError(res, lpsrcrect, &destrect, __LINE__);
BlitError(res, lpsrcrect, lpdestrect, __LINE__);
if(IsDebug) {
DescribeSurface(lpdds, 0, "[DST]" , __LINE__);
if (lpddssrc) DescribeSurface(lpddssrc, 0, "[SRC]" , __LINE__); // lpddssrc could be NULL!!!
@ -229,9 +240,9 @@ static HRESULT sBltToPrimary(int dxversion, Blt_Type pBlt, char *api, LPDIRECTDR
if(res==DDERR_SURFACEBUSY){
(*pUnlockMethod(dxversion))(lpdds, NULL);
if(lpddssrc) (*pUnlockMethod(dxversion))(lpdds, NULL);
if (IsDebug) BlitTrace("BUSY", lpsrcrect, &destrect, __LINE__);
res= (*pBlt)(lpdds, &destrect, lpddssrc, lpsrcrect, dwflags, lpddbltfx);
if (res) BlitError(res, lpsrcrect, &destrect, __LINE__);
if (IsDebug) BlitTrace("BUSY", lpsrcrect, lpdestrect, __LINE__);
res= (*pBlt)(lpdds, lpdestrect, lpddssrc, lpsrcrect, dwflags, lpddbltfx);
if (res) BlitError(res, lpsrcrect, lpdestrect, __LINE__);
}
// Try to handle DDBLT_KEYSRC on primary surface
if((res==DDERR_INVALIDPARAMS) && (dwflags & DDBLT_KEYSRC)){
@ -239,22 +250,22 @@ static HRESULT sBltToPrimary(int dxversion, Blt_Type pBlt, char *api, LPDIRECTDR
DDSURFACEDESC2 ddsd;
LPDIRECTDRAWSURFACE2 lpddsTmp;
extern CreateSurface2_Type pCreateSurfaceMethod(int);
if (IsDebug) BlitTrace("KEYSRC", lpsrcrect, &destrect, __LINE__);
if (IsDebug) BlitTrace("KEYSRC", lpsrcrect, lpdestrect, __LINE__);
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = (dxversion < 4) ? sizeof(DDSURFACEDESC) : sizeof(DDSURFACEDESC2);
(*pGetSurfaceDescMethod())((LPDIRECTDRAWSURFACE2)lpddssrc, &ddsd);
res=(*pCreateSurfaceMethod(dxversion))(lpPrimaryDD, &ddsd, (LPDIRECTDRAWSURFACE *)&lpddsTmp, NULL);
if(res) OutTraceE("CreateSurface: ERROR %x(%s) at %d", res, ExplainDDError(res), __LINE__);
// copy background
res= (*pBlt)((LPDIRECTDRAWSURFACE)lpddsTmp, lpsrcrect, lpdds, &destrect, DDBLT_WAIT, NULL);
res= (*pBlt)((LPDIRECTDRAWSURFACE)lpddsTmp, lpsrcrect, lpdds, lpdestrect, DDBLT_WAIT, NULL);
if(res) OutTraceE("Blt: ERROR %x(%s) at %d", res, ExplainDDError(res), __LINE__);
// overlay texture
res= (*pBlt)((LPDIRECTDRAWSURFACE)lpddsTmp, lpsrcrect, lpddssrc, lpsrcrect, dwflags, lpddbltfx);
if(res) OutTraceE("Blt: ERROR %x(%s) at %d", res, ExplainDDError(res), __LINE__);
// copy back to destination
res= (*pBlt)(lpdds, &destrect, (LPDIRECTDRAWSURFACE)lpddsTmp, lpsrcrect, DDBLT_WAIT, lpddbltfx);
res= (*pBlt)(lpdds, lpdestrect, (LPDIRECTDRAWSURFACE)lpddsTmp, lpsrcrect, DDBLT_WAIT, lpddbltfx);
if(res) OutTraceE("Blt: ERROR %x(%s) at %d", res, ExplainDDError(res), __LINE__);
if (res) BlitError(res, lpsrcrect, &destrect, __LINE__);
if (res) BlitError(res, lpsrcrect, lpdestrect, __LINE__);
(*pReleaseSMethod(dxversion))((LPDIRECTDRAWSURFACE)lpddsTmp);
}
if(dxw.dwFlags1 & SUPPRESSDXERRORS) res=DD_OK;
@ -271,8 +282,15 @@ static HRESULT sBltToPrimary(int dxversion, Blt_Type pBlt, char *api, LPDIRECTDR
if(dxw.dwFlags5 & GDIMODE){
extern void BlitToWindow(HWND, LPDIRECTDRAWSURFACE);
//if (lpdds != lpddssrc)
if((dxw.dwFlags1 & SAVELOAD) || (dxw.dwFlags8 & FORCEVSYNC)){
HRESULT res2;
if(!bVSyncDone){
if(res2=lpPrimaryDD->WaitForVerticalBlank(DDWAITVB_BLOCKBEGIN , 0))
OutTraceE("WaitForVerticalBlank ERROR: res=%x\n", res2);
}
bVSyncDone = FALSE;
BlitToWindow(dxw.GethWnd(), lpddssrc);
}
return DD_OK;
}
@ -363,8 +381,18 @@ static HRESULT sBltToPrimary(int dxversion, Blt_Type pBlt, char *api, LPDIRECTDR
emurect.right <<= 1;
emurect.bottom <<= 1;
}
if((dxw.dwFlags1 & SAVELOAD) || (dxw.dwFlags8 & FORCEVSYNC)) {
HRESULT res2;
if(!bVSyncDone){
if(res2=lpPrimaryDD->WaitForVerticalBlank(DDWAITVB_BLOCKBEGIN , 0))
OutTraceE("WaitForVerticalBlank ERROR: res=%x\n", res2);
}
bVSyncDone = FALSE;
}
if (IsDebug) BlitTrace("BACK2PRIM", &emurect, &destrect, __LINE__);
res=(*pPrimaryBlt)(dxversion, pBlt, lpDDSEmu_Prim, &destrect, lpDDSSource, &emurect);
res=(*pPrimaryBlt)(dxversion, pBlt, lpDDSEmu_Prim, &destrect, lpDDSSource, &emurect, NULL);
if (res) BlitError(res, &emurect, &destrect, __LINE__);
if(dxw.dwFlags1 & SUPPRESSDXERRORS) res=DD_OK;
@ -428,6 +456,15 @@ HRESULT WINAPI sBlt(int dxversion, Blt_Type pBlt, char *api, LPDIRECTDRAWSURFACE
OutTrace(sLog);
}
if(dxw.dwFlags8 & FORCEWAIT){
dwflags |= DDBLT_WAIT;
dwflags &= ~(DDBLT_ASYNC|DDBLT_DONOTWAIT);
}
if(dxw.dwFlags8 & FORCENOWAIT){
dwflags &= ~DDBLT_WAIT;
dwflags |= (DDBLT_ASYNC|DDBLT_DONOTWAIT);
}
if(ToPrim)
res = sBltToPrimary(dxversion, pBlt, api, lpdds, lpdestrect, lpddssrc, lpsrcrect, dwflags, lpddbltfx, isFlipping);
else

1046
dll/ddcreates.cpp Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -136,12 +136,12 @@ static char *Flag7Names[32]={
"SSUPPRESSDIERRORS", "HOOKNORUN", "FIXBINDTEXTURE", "ENUM16BITMODES",
"SHAREDKEYBOARD", "HOOKNOUPDATE", "HOOKGLUT32", "INITIALRES",
"MAXIMUMRES", "LOCKCOLORDEPTH", "FIXSMACKLOOP", "FIXFREELIBRARY",
"ANCHORED", "", "", "",
"ANCHORED", "CLEARTEXTUREFOURCC", "NODDEXCLUSIVEMODE", "COPYNOSHIMS",
};
static char *Flag8Names[32]={
"", "", "", "",
"", "", "", "",
"FORCEWAIT", "FORCENOWAIT", "FORCEVSYNC", "FORCENOVSYNC",
"VSYNCSCANLINES", "", "", "",
"", "", "", "",
"", "", "", "",
"", "", "", "",
@ -1398,9 +1398,9 @@ void HookInit(TARGETMAP *target, HWND hwnd)
OSVERSIONINFO osinfo;
strcpy(sInfo, "");
if(hwnd) sprintf(sInfo, " hWnd=%x ParentWnd=%x desktop=%x", hwnd, dxw.hParentWnd, GetDesktopWindow());
OutTrace("HookInit: path=\"%s\" module=\"%s\" dxversion=%s pos=(%d,%d) size=(%d,%d) monitor=%d%s\n",
OutTrace("HookInit: path=\"%s\" module=\"%s\" dxversion=%s pos=(%d,%d) size=(%d,%d) init-max=(%d,%d) monitor=%d%s\n",
target->path, target->module, dxversions[dxw.dwTargetDDVersion],
target->posx, target->posy, target->sizx, target->sizy, target->monitorid, sInfo);
target->posx, target->posy, target->sizx, target->sizy, target->resw, target->resh, target->monitorid, sInfo);
osinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
if(GetVersionEx(&osinfo)){
OutTrace("OS=(%d.%d) build=%d platform=%d service pack=%s\n",
@ -1411,6 +1411,7 @@ void HookInit(TARGETMAP *target, HWND hwnd)
if (dxw.dwFlags7 & LIMITDDRAW) OutTrace("HookInit: max supported IDidrectDrawInterface=%d\n", dxw.MaxDdrawInterface);
if (dxw.dwFlags7 & CPUSLOWDOWN) OutTrace("HookInit: CPU slowdown ratio 1:%d\n", dxw.SlowRatio);
if (dxw.dwFlags7 & CPUMAXUSAGE) OutTrace("HookInit: CPU maxusage ratio 1:%d\n", dxw.SlowRatio);
if (dxw.dwFlags8 & VSYNCSCANLINE) OutTrace("HookInit: VSync Scanline=%d\n", dxw.ScanLine);
}
if (hwnd && IsDebug){

View File

@ -94,6 +94,7 @@ void dxwCore::InitTarget(TARGETMAP *target)
dwFlags8 = target->flags8;
dwTFlags = target->tflags;
Windowize = (dwFlags2 & WINDOWIZE) ? TRUE : FALSE;
IsEmulated = (dwFlags1 & (EMULATESURFACE|EMULATEBUFFER)) ? TRUE : FALSE;
IsVisible = TRUE;
if(dwFlags3 & FULLSCREENONLY) FullScreen=TRUE;
gsModules = target->module;
@ -143,6 +144,7 @@ void dxwCore::InitTarget(TARGETMAP *target)
dwScreenHeight = 600;
SlowRatio = target->SlowRatio;
ScanLine = target->ScanLine;
GDIEmulationMode = GDIMODE_NONE; // default
if (dwFlags2 & GDISTRETCHED) GDIEmulationMode = GDIMODE_STRETCHED;
@ -693,6 +695,27 @@ void dxwCore::VSyncWait()
if(step >= iRefreshDelayCount) step=0;
}
void dxwCore::VSyncWaitLine(DWORD ScanLine)
{
extern LPDIRECTDRAW lpPrimaryDD;
static DWORD iLastScanLine = 0;
DWORD iCurrentScanLine;
if (!lpPrimaryDD) return;
while(1){
HRESULT res;
if(res=lpPrimaryDD->GetScanLine(&iCurrentScanLine)) {
OutTraceE("VSyncWaitLine: GetScanLine ERROR res=%x\n", res);
iLastScanLine = 0;
break; // error
}
if((iLastScanLine <= ScanLine) && (iCurrentScanLine > ScanLine)) {
OutTraceB("VSyncWaitLine: line=%d last=%d\n", iCurrentScanLine, iLastScanLine);
break;
}
iLastScanLine = iCurrentScanLine;
(*pSleep)(1);
}
}
static float fMul[17]={2.14F, 1.95F, 1.77F, 1.61F, 1.46F, 1.33F, 1.21F, 1.10F, 1.00F, 0.91F, 0.83F, 0.75F, 0.68F, 0.62F, 0.56F, 0.51F, 0.46F};
@ -1194,12 +1217,12 @@ void dxwCore::FixStyle(char *ApiName, HWND hwnd, WPARAM wParam, LPARAM lParam)
if (dxw.dwFlags1 & LOCKWINSTYLE){ // set to current value
lpSS->styleNew= (*pGetWindowLong)(hwnd, GWL_EXSTYLE);
}
if ((dxw.dwFlags1 & PREVENTMAXIMIZE) && (hwnd==hWnd)){ // disable maximize settings
if ((dxw.dwFlags5 & UNLOCKZORDER) && (hwnd==hWnd)){ // disable maximize settings
if (lpSS->styleNew & WS_EX_TOPMOST){
OutTraceDW("%s: prevent EXSTYLE topmost style\n", ApiName);
lpSS->styleNew &= ~WS_EX_TOPMOST;
}
}
}
break;
default:
break;

View File

@ -140,6 +140,7 @@ public: // methods
void MapKeysInit();
void SetVSyncDelays(UINT);
void VSyncWait();
void VSyncWaitLine(DWORD);
void DumpDesktopStatus();
void ToggleFreezedTime();
void GetMonitorWorkarea(LPRECT, BOOL);
@ -150,6 +151,7 @@ public: // simple data variables
int MonitorId;
BOOL Windowize;
BOOL IsVisible;
BOOL IsEmulated;
DDPIXELFORMAT ActualPixelFormat;
DDPIXELFORMAT VirtualPixelFormat;
DWORD dwDDVersion;
@ -191,6 +193,7 @@ public: // simple data variables
short Coordinates;
short MaxScreenRes;
short SlowRatio;
short ScanLine;
HDC RealHDC;
HDC VirtualHDC;
int GDIEmulationMode;
@ -198,6 +201,8 @@ public: // simple data variables
RECT VirtualDesktop;
BOOL bHintActive;
BOOL bAutoScale;
DWORD dwRealScreenWidth;
DWORD dwRealScreenHeight;
// Implementation
protected:

View File

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

Binary file not shown.

View File

@ -257,6 +257,10 @@
RelativePath=".\ddblit.cpp"
>
</File>
<File
RelativePath=".\ddcreates.cpp"
>
</File>
<File
RelativePath=".\ddraw.cpp"
>

View File

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

View File

@ -2101,6 +2101,12 @@ HRESULT WINAPI extD3DGetDeviceCaps(void *lpd3d, UINT Adapter, D3DDEVTYPE DeviceT
pCaps->MaxPixelShader30InstructionSlots);
}
}
if(dxw.dwFlags7 & SUPPRESSOVERLAY){
if(pCaps->Caps & D3DCAPS_OVERLAY) OutTraceDW("GetDeviceCaps(%d): SUPPRESS OVERLAY CAP\n");
pCaps->Caps &= ~D3DCAPS_OVERLAY;
}
return res;
}

View File

@ -51,6 +51,7 @@ typedef HRESULT (WINAPI *GetSurfaceFromDC_Type)(LPDIRECTDRAW, HDC, LPDIRECTDRAWS
typedef HRESULT (WINAPI *RestoreAllSurfaces_Type)(LPDIRECTDRAW);
typedef HRESULT (WINAPI *TestCooperativeLevel_Type)(LPDIRECTDRAW);
typedef HRESULT (WINAPI *GetDeviceIdentifier_Type)(LPDIRECTDRAW, LPDDDEVICEIDENTIFIER, DWORD);
typedef HRESULT (WINAPI *GetScanLine_Type)(LPDIRECTDRAW, LPDWORD);
// STDMETHOD(StartModeTest)(THIS_ LPSIZE, DWORD, DWORD ) PURE;
// STDMETHOD(EvaluateMode)(THIS_ DWORD, DWORD * ) PURE;
@ -125,15 +126,15 @@ extern void HookTexture(LPVOID *, int);
extern int Set_dwSize_From_Surface();
extern void SetBltTransformations(int);
extern HRESULT WINAPI PrimaryBlt(int, Blt_Type, LPDIRECTDRAWSURFACE, LPRECT, LPDIRECTDRAWSURFACE, LPRECT);
extern HRESULT WINAPI PrimaryNoBlt(int, Blt_Type, LPDIRECTDRAWSURFACE, LPRECT, LPDIRECTDRAWSURFACE, LPRECT);
extern HRESULT WINAPI PrimaryStretchBlt(int, Blt_Type, LPDIRECTDRAWSURFACE, LPRECT, LPDIRECTDRAWSURFACE, LPRECT);
extern HRESULT WINAPI PrimaryFastBlt(int, Blt_Type, LPDIRECTDRAWSURFACE, LPRECT, LPDIRECTDRAWSURFACE, LPRECT);
extern HRESULT WINAPI PrimaryBilinearBlt(int, Blt_Type, LPDIRECTDRAWSURFACE, LPRECT, LPDIRECTDRAWSURFACE, LPRECT);
extern HRESULT WINAPI PrimaryBlt(int, Blt_Type, LPDIRECTDRAWSURFACE, LPRECT, LPDIRECTDRAWSURFACE, LPRECT, LPDDBLTFX);
extern HRESULT WINAPI PrimaryNoBlt(int, Blt_Type, LPDIRECTDRAWSURFACE, LPRECT, LPDIRECTDRAWSURFACE, LPRECT, LPDDBLTFX);
extern HRESULT WINAPI PrimaryStretchBlt(int, Blt_Type, LPDIRECTDRAWSURFACE, LPRECT, LPDIRECTDRAWSURFACE, LPRECT, LPDDBLTFX);
extern HRESULT WINAPI PrimaryFastBlt(int, Blt_Type, LPDIRECTDRAWSURFACE, LPRECT, LPDIRECTDRAWSURFACE, LPRECT, LPDDBLTFX);
extern HRESULT WINAPI PrimaryBilinearBlt(int, Blt_Type, LPDIRECTDRAWSURFACE, LPRECT, LPDIRECTDRAWSURFACE, LPRECT, LPDDBLTFX);
typedef HRESULT (WINAPI *EmuBlt_Type)(int, Blt_Type, LPDIRECTDRAWSURFACE, LPRECT, LPDIRECTDRAWSURFACE, LPRECT, DWORD, LPVOID);
typedef HRESULT (WINAPI *RevBlt_Type)(int, Blt_Type, LPDIRECTDRAWSURFACE, LPRECT, LPDIRECTDRAWSURFACE, LPRECT);
typedef HRESULT (WINAPI *PrimaryBlt_Type)(int, Blt_Type, LPDIRECTDRAWSURFACE, LPRECT, LPDIRECTDRAWSURFACE, LPRECT);
typedef HRESULT (WINAPI *PrimaryBlt_Type)(int, Blt_Type, LPDIRECTDRAWSURFACE, LPRECT, LPDIRECTDRAWSURFACE, LPRECT, LPDDBLTFX);
extern EmuBlt_Type pEmuBlt;
extern RevBlt_Type pRevBlt;

View File

@ -9,14 +9,40 @@
typedef PIMAGE_DEBUG_INFORMATION (WINAPI *MapDebugInformation_Type)(HANDLE, PCSTR, PCSTR, ULONG);
typedef BOOL (WINAPI *UnmapDebugInformation_Type)(PIMAGE_DEBUG_INFORMATION);
typedef BOOL (WINAPI *SymInitialize_Type)(HANDLE, PCTSTR, BOOL);
typedef BOOL (WINAPI *SymCleanup_Type)(HANDLE);
typedef BOOL (WINAPI *StackWalk_Type)(DWORD, HANDLE, HANDLE, LPSTACKFRAME, LPVOID, PREAD_PROCESS_MEMORY_ROUTINE, PFUNCTION_TABLE_ACCESS_ROUTINE, PGET_MODULE_BASE_ROUTINE, PTRANSLATE_ADDRESS_ROUTINE);
typedef LPVOID (WINAPI *SymFunctionTableAccess_Type)(HANDLE, DWORD);
typedef LPVOID (WINAPI *SymGetModuleBase_Type)(HANDLE, DWORD);
typedef BOOL (WINAPI *SymGetSymFromAddr_Type)(HANDLE, DWORD, LPDWORD, PIMAGEHLP_SYMBOL);
PIMAGE_DEBUG_INFORMATION WINAPI extMapDebugInformation(HANDLE, PCSTR, PCSTR, ULONG);
BOOL WINAPI extUnmapDebugInformation(PIMAGE_DEBUG_INFORMATION);
BOOL WINAPI extSymInitialize(HANDLE, PCTSTR, BOOL);
BOOL WINAPI extSymCleanup(HANDLE);
BOOL WINAPI extStackWalk(DWORD, HANDLE, HANDLE, LPSTACKFRAME, LPVOID, PREAD_PROCESS_MEMORY_ROUTINE, PFUNCTION_TABLE_ACCESS_ROUTINE, PGET_MODULE_BASE_ROUTINE, PTRANSLATE_ADDRESS_ROUTINE);
LPVOID WINAPI extSymFunctionTableAccess(HANDLE, DWORD);
LPVOID WINAPI extSymGetModuleBase(HANDLE, DWORD);
BOOL WINAPI extSymGetSymFromAddr(HANDLE, DWORD, LPDWORD, PIMAGEHLP_SYMBOL);
MapDebugInformation_Type pMapDebugInformation = NULL;
UnmapDebugInformation_Type pUnmapDebugInformation = NULL;
SymInitialize_Type pSymInitialize;
SymCleanup_Type pSymCleanup;
StackWalk_Type pStackWalk;
SymFunctionTableAccess_Type pSymFunctionTableAccess;
SymGetModuleBase_Type pSymGetModuleBase;
SymGetSymFromAddr_Type pSymGetSymFromAddr;
static HookEntryEx_Type Hooks[]={
{HOOK_IAT_CANDIDATE, 0, "MapDebugInformation", (FARPROC)NULL, (FARPROC *)&pMapDebugInformation, (FARPROC)extMapDebugInformation},
{HOOK_IAT_CANDIDATE, 0, "UnmapDebugInformation", (FARPROC)NULL, (FARPROC *)&pUnmapDebugInformation, (FARPROC)extUnmapDebugInformation},
{HOOK_IAT_CANDIDATE, 0, "SymInitialize", (FARPROC)NULL, (FARPROC *)&pSymInitialize, (FARPROC)extSymInitialize},
{HOOK_IAT_CANDIDATE, 0, "SymCleanup", (FARPROC)NULL, (FARPROC *)&pSymCleanup, (FARPROC)extSymCleanup},
{HOOK_IAT_CANDIDATE, 0, "StackWalk", (FARPROC)NULL, (FARPROC *)&pStackWalk, (FARPROC)extStackWalk},
{HOOK_IAT_CANDIDATE, 0, "SymFunctionTableAccess", (FARPROC)NULL, (FARPROC *)&pSymFunctionTableAccess, (FARPROC)extSymFunctionTableAccess},
{HOOK_IAT_CANDIDATE, 0, "SymGetModuleBase", (FARPROC)NULL, (FARPROC *)&pSymGetModuleBase, (FARPROC)extSymGetModuleBase},
{HOOK_IAT_CANDIDATE, 0, "SymGetSymFromAddr", (FARPROC)NULL, (FARPROC *)&pSymGetSymFromAddr, (FARPROC)extSymGetSymFromAddr},
{HOOK_IAT_CANDIDATE, 0, 0, NULL, 0, 0} // terminator
};
@ -60,3 +86,44 @@ BOOL WINAPI extUnmapDebugInformation(PIMAGE_DEBUG_INFORMATION DebugInfo)
return TRUE;
}
BOOL WINAPI extSymInitialize(HANDLE hProcess, PCTSTR UserSearchPath, BOOL fInvadeProcess)
{
OutTrace("SymInitialize: hprocess=%x usrsearchpath=\"%s\" invadeproc=%x\n", hProcess, UserSearchPath, fInvadeProcess);
return TRUE;
}
BOOL WINAPI extSymCleanup(HANDLE hProcess)
{
OutTrace("SymCleanup: hprocess=%x\n", hProcess);
return TRUE;
}
BOOL WINAPI extStackWalk(DWORD MachineType, HANDLE hProcess, HANDLE hThread, LPSTACKFRAME StackFrame, LPVOID ContextRecord,
PREAD_PROCESS_MEMORY_ROUTINE ReadMemoryRoutine, PFUNCTION_TABLE_ACCESS_ROUTINE FunctionTableAccessRoutine,
PGET_MODULE_BASE_ROUTINE GetModuleBaseRoutine, PTRANSLATE_ADDRESS_ROUTINE TranslateAddress)
{
OutTrace("SymCleanup: hprocess=%x\n", hProcess);
// too complex, pretend we have an error
return FALSE;
}
LPVOID WINAPI extSymFunctionTableAccess(HANDLE hProcess, DWORD AddrBase)
{
OutTrace("SymFunctionTableAccess: hprocess=%x addrbase=%x\n", hProcess, AddrBase);
// too dangerous, pretend we have an error
return NULL;
}
LPVOID WINAPI extSymGetModuleBase(HANDLE hProcess, DWORD AddrBase)
{
OutTrace("SymGetModuleBase: hprocess=%x addrbase=%x\n", hProcess, AddrBase);
// too dangerous, pretend we have an error
return NULL;
}
BOOL WINAPI extSymGetSymFromAddr(HANDLE hProcess, DWORD Address, LPDWORD Displacement, PIMAGEHLP_SYMBOL Symbol)
{
OutTrace("SymGetSymFromAddr: hprocess=%x address=%x\n", hProcess, Address);
// too dangerous, pretend we have an error
return NULL;
}

View File

@ -238,7 +238,6 @@ static HookEntryEx_Type Hooks[]={
//{HOOK_IAT_CANDIDATE, 0, "IsZoomed", (FARPROC)NULL, (FARPROC *)&pIsZoomed, (FARPROC)extIsZoomed},
//{HOOK_HOT_CANDIDATE, 0, "IsIconic", (FARPROC)IsIconic, (FARPROC *)&pIsIconic, (FARPROC)extIsIconic},
{HOOK_HOT_CANDIDATE, 0, "ScrollDC", (FARPROC)NULL, (FARPROC *)&pScrollDC, (FARPROC)extScrollDC},
//{HOOK_IAT_CANDIDATE, 0, "mouse_event", (FARPROC)NULL, (FARPROC *)&pmouse_event, (FARPROC)extmouse_event},
// both added to fix the Galapagos menu bar, but with no success !!!!
{HOOK_HOT_CANDIDATE, 0, "ShowScrollBar", (FARPROC)ShowScrollBar, (FARPROC *)&pShowScrollBar, (FARPROC)extShowScrollBar},
@ -874,8 +873,10 @@ LONG WINAPI extSetWindowLong(HWND hwnd, int nIndex, LONG dwNewLong, SetWindowLon
}
// v2.02.32: disable topmost for main window only
if(dxw.IsDesktop(hwnd) && (nIndex==GWL_EXSTYLE)){
OutTraceDW("SetWindowLong: GWL_EXSTYLE %x suppress TOPMOST\n", dwNewLong);
dwNewLong = dwNewLong & ~(WS_EX_TOPMOST);
if(dxw.dwFlags5 & UNLOCKZORDER) {
OutTraceDW("SetWindowLong: GWL_EXSTYLE %x suppress TOPMOST\n", dwNewLong);
dwNewLong = dwNewLong & ~(WS_EX_TOPMOST);
}
}
}
@ -891,12 +892,11 @@ LONG WINAPI extSetWindowLong(HWND hwnd, int nIndex, LONG dwNewLong, SetWindowLon
// v2.03.94.fx2: removed dxw.IsFullScreen() check here ... WinProc routine must be verified in all conditions
// fixes "Nascar Racing 3" that was setting the WinProc while still in non fullscreen mode!
if (((nIndex==GWL_WNDPROC)||(nIndex==DWL_DLGPROC)) &&
dxw.Windowize && // v2.03.95 - replaced dxw.IsFullScreen() check
// dxw.IsFullScreen() && // v2.02.51 - see A10 Cuba....
!(dxw.dwFlags6 & NOWINDOWHOOKS)){ // v2.03.41 - debug flag
if ((nIndex==GWL_WNDPROC)||(nIndex==DWL_DLGPROC)) {
WNDPROC lres;
WNDPROC OldProc;
DWORD WinStyle;
BOOL bHooked = FALSE;
// fix ....
extern LRESULT CALLBACK dw_Hider_Message_Handler(HWND, UINT, WPARAM, LPARAM);
@ -913,18 +913,47 @@ LONG WINAPI extSetWindowLong(HWND hwnd, int nIndex, LONG dwNewLong, SetWindowLon
// end of GPL fix
OldProc = (WNDPROC)(*pGetWindowLong)(hwnd, nIndex);
// v2.02.70 fix
if((OldProc==extWindowProc) ||
(OldProc==extChildWindowProc)||
(OldProc==extDialogWindowProc))
OldProc=dxwws.GetProc(hwnd);
dxwws.PutProc(hwnd, (WNDPROC)dwNewLong);
res=(LONG)OldProc;
SetLastError(0);
lres=(WNDPROC)(*pSetWindowLong)(hwnd, nIndex, (LONG)extWindowProc);
WinStyle = (*pGetWindowLong)(hwnd, GWL_STYLE);
// hook extWindowProc to main win ....
if(dxw.IsDesktop(hwnd) && !(dxw.dwFlags6 & NOWINDOWHOOKS)){
if(OldProc==extWindowProc) OldProc=dxwws.GetProc(hwnd);
dxwws.PutProc(hwnd, (WNDPROC)dwNewLong);
res=(LONG)OldProc;
SetLastError(0);
lres=(WNDPROC)(*pSetWindowLong)(hwnd, nIndex, (LONG)extWindowProc);
OutTraceDW("SetWindowLong: DESKTOP hooked %x->%x\n", dwNewLong, extWindowProc);
bHooked = TRUE;
}
// hook extChildWindowProc to child win ....
if((WinStyle & WS_CHILD) && (dxw.dwFlags1 & HOOKCHILDWIN) && !(dxw.dwFlags6 & NOWINDOWHOOKS)){
if(OldProc==extChildWindowProc) OldProc=dxwws.GetProc(hwnd);
dxwws.PutProc(hwnd, (WNDPROC)dwNewLong);
res=(LONG)OldProc;
SetLastError(0);
lres=(WNDPROC)(*pSetWindowLong)(hwnd, nIndex, (LONG)extChildWindowProc);
OutTraceDW("SetWindowLong: CHILD hooked %x->%x\n", dwNewLong, extChildWindowProc);
bHooked = TRUE;
}
// hook extDlgWindowProc to dialog win ....
if((WinStyle & DWL_DLGPROC) && (dxw.dwFlags1 & HOOKCHILDWIN) && !(dxw.dwFlags6 & NOWINDOWHOOKS)){
if(OldProc==extDialogWindowProc) OldProc=dxwws.GetProc(hwnd);
dxwws.PutProc(hwnd, (WNDPROC)dwNewLong);
res=(LONG)OldProc;
SetLastError(0);
lres=(WNDPROC)(*pSetWindowLong)(hwnd, nIndex, (LONG)extDialogWindowProc);
OutTraceDW("SetWindowLong: DIALOG hooked %x->%x\n", dwNewLong, extDialogWindowProc);
bHooked = TRUE;
}
// hook dwNewLong if not done otherwise
if(!bHooked) res=(*pSetWindowLong)(hwnd, nIndex, dwNewLong);
if(!lres && GetLastError())OutTraceE("SetWindowLong: ERROR err=%d at %d\n", GetLastError(), __LINE__);
}
else {
else{
// through here for any message different from GWL_WNDPROC or DWL_DLGPROC
res=(*pSetWindowLong)(hwnd, nIndex, dwNewLong);
}
@ -1125,13 +1154,19 @@ BOOL WINAPI extGetCursorPos(LPPOINT lppoint)
res=1;
}
prev=*lppoint;
*lppoint=dxw.ScreenToClient(*lppoint);
*lppoint=dxw.FixCursorPos(*lppoint);
if(dxw.dwFlags1 & MODIFYMOUSE){
dxw.UpdateDesktopCoordinates();
prev=*lppoint;
*lppoint=dxw.ScreenToClient(*lppoint);
//OutTraceC("GetCursorPos: REMAPPED pos=(%d,%d)->(%d,%d)\n", prev.x, prev.y, lppoint->x, lppoint->y);
*lppoint=dxw.FixCursorPos(*lppoint);
OutTraceC("GetCursorPos: FIXED pos=(%d,%d)->(%d,%d)\n", prev.x, prev.y, lppoint->x, lppoint->y);
}
else {
OutTraceC("GetCursorPos: pos=(%d,%d)\n", lppoint->x, lppoint->y);
}
GetHookInfo()->CursorX=(short)lppoint->x;
GetHookInfo()->CursorY=(short)lppoint->y;
OutTraceC("GetCursorPos: FIXED pos=(%d,%d)->(%d,%d)\n", prev.x, prev.y, lppoint->x, lppoint->y);
if((dxw.dwFlags1 & HIDEHWCURSOR) && dxw.IsFullScreen()) while((*pShowCursor)(0) >= 0);
if(dxw.dwFlags2 & SHOWHWCURSOR) while((*pShowCursor)(1) < 0);
@ -1164,6 +1199,7 @@ BOOL WINAPI extSetCursorPos(int x, int y)
if(dxw.dwFlags1 & MODIFYMOUSE){
// v2.03.41
POINT cur;
dxw.UpdateDesktopCoordinates();
cur.x = x;
cur.y = y;
dxw.MapWindow(&cur);
@ -1673,6 +1709,8 @@ static HWND WINAPI CreateWindowCommon(
dxw.SetFullScreen(TRUE);
}
if(dxw.dwFlags5 & UNLOCKZORDER) dwExStyle &= ~WS_EX_TOPMOST ;
if(!dxw.IsFullScreen()){ // v2.1.63: needed for "Monster Truck Madness"
if(WideChar)
hwnd= (*pCreateWindowExW)(dwExStyle, (LPCWSTR)lpClassName, (LPCWSTR)lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
@ -2498,9 +2536,10 @@ HWND WINAPI extCreateDialogIndirectParam(HINSTANCE hInstance, LPCDLGTEMPLATE lpT
lpTemplate->style, lpTemplate->dwExtendedStyle, lpTemplate->cdit, lpTemplate->x, lpTemplate->y, lpTemplate->cx, lpTemplate->cy,
hWndParent, lpDialogFunc, lParamInit);
if(dxw.IsFullScreen() && hWndParent==NULL) hWndParent=dxw.GethWnd();
dxw.SetFullScreen(FALSE);
// v2.03.98: commented out the temporary return to windowed mode to make Red Alert 2 dialog work again!
//dxw.SetFullScreen(FALSE);
RetHWND=(*pCreateDialogIndirectParam)(hInstance, lpTemplate, hWndParent, lpDialogFunc, lParamInit);
dxw.SetFullScreen(FullScreen);
//dxw.SetFullScreen(FullScreen);
// v2.02.73: redirect lpDialogFunc only when it is nor NULL
if( lpDialogFunc &&
@ -2522,9 +2561,9 @@ HWND WINAPI extCreateDialogParam(HINSTANCE hInstance, LPCTSTR lpTemplateName, HW
OutTraceDW("CreateDialogParam: hInstance=%x lpTemplateName=%s hWndParent=%x lpDialogFunc=%x lParamInit=%x\n",
hInstance, sTemplateName(lpTemplateName), hWndParent, lpDialogFunc, lParamInit);
if(hWndParent==NULL) hWndParent=dxw.GethWnd();
dxw.SetFullScreen(FALSE);
//dxw.SetFullScreen(FALSE);
RetHWND=(*pCreateDialogParam)(hInstance, lpTemplateName, hWndParent, lpDialogFunc, lParamInit);
dxw.SetFullScreen(FullScreen);
//dxw.SetFullScreen(FullScreen);
// v2.02.73: redirect lpDialogFunc only when it is nor NULL: fix for "LEGO Stunt Rally"
if( lpDialogFunc &&
@ -3922,9 +3961,17 @@ VOID WINAPI extmouse_event(DWORD dwFlags, DWORD dx, DWORD dy, DWORD dwData, ULON
return;
}
if(dxw.Windowize){
dxw.MapClient((int *)&dx, (int *)&dy);
if((dwFlags & MOUSEEVENTF_ABSOLUTE) && dxw.Windowize && (dxw.dwFlags1 & MODIFYMOUSE)){
// ???? untested ......
//dxw.MapClient((int *)&dx, (int *)&dy);
POINT cursor;
cursor.x = dx;
cursor.y = dy;
cursor = dxw.FixCursorPos(cursor);
dx = cursor.x;
dy = cursor.y;
}
return (*pmouse_event)(dwFlags, dx, dy, dwData, dwExtraInfo);
}

View File

@ -495,8 +495,14 @@ static void ShowJoystick(LONG, LONG, DWORD);
MMRESULT WINAPI extjoyGetDevCapsA(DWORD uJoyID, LPJOYCAPS pjc, UINT cbjc)
{
OutTraceDW("joyGetDevCaps: joyid=%d size=%d\n", uJoyID, cbjc);
if((uJoyID != -1) && (uJoyID != 0)) return MMSYSERR_NODRIVER;
if(cbjc != sizeof(JOYCAPS)) return MMSYSERR_INVALPARAM;
if((uJoyID != -1) && (uJoyID != 0)) {
OutTraceDW("joyGetDevCaps: ERROR joyid=%d ret=MMSYSERR_NODRIVER\n", uJoyID, cbjc);
return MMSYSERR_NODRIVER;
}
if(cbjc != sizeof(JOYCAPS)) {
OutTraceDW("joyGetDevCaps: ERROR joyid=%d size=%d ret=MMSYSERR_INVALPARAM\n", uJoyID, cbjc);
return MMSYSERR_INVALPARAM;
}
uJoyID = 0; // always first (unique) one ...
// set Joystick capability structure

View File

@ -245,7 +245,7 @@ LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
if(IsTraceW) ExplainMsg("WindowProc", hwnd, message, wparam, lparam);
if(dxw.dwFlags3 & FILTERMESSAGES){
if(dxw.dwFlags3 & (FILTERMESSAGES|DEFAULTMESSAGES)){
switch(message){
case WM_NCMOUSEMOVE:
case WM_NCLBUTTONDOWN:
@ -257,8 +257,16 @@ LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
case WM_NCMBUTTONDOWN:
case WM_NCMBUTTONUP:
case WM_NCMBUTTONDBLCLK:
OutTraceDW("WindowProc[%x]: SUPPRESS WinMsg=[0x%x]%s(%x,%x)\n", hwnd, message, ExplainWinMessage(message), wparam, lparam);
return 0;
case WM_MOVE:
case WM_MOVING:
if(dxw.dwFlags3 & FILTERMESSAGES){
OutTraceDW("WindowProc[%x]: SUPPRESS WinMsg=[0x%x]%s(%x,%x)\n", hwnd, message, ExplainWinMessage(message), wparam, lparam);
return 0;
}
else {
OutTraceDW("WindowProc[%x]: DEFAULT WinMsg=[0x%x]%s(%x,%x)\n", hwnd, message, ExplainWinMessage(message), wparam, lparam);
return (*pDefWindowProcA)(hwnd, message, wparam, lparam);
}
}
}

View File

@ -178,9 +178,9 @@ void CMainFrame::OnClose()
}
if(gWarnOnExit){
if(MessageBoxLang(DXW_STRING_EXIT_OK, DXW_STRING_WARNING, MB_OKCANCEL)==IDOK)
CFrameWnd::OnClose();
}
if(MessageBoxLang(DXW_STRING_EXIT_OK, DXW_STRING_WARNING, MB_OKCANCEL)==IDOK)
CFrameWnd::OnClose();
}
else
CFrameWnd::OnClose();
}

View File

@ -29,8 +29,6 @@ void CTabDirectX::DoDataExchange(CDataExchange* pDX)
DDX_Radio(pDX, IDC_AUTO, cTarget->m_DXVersion);
DDX_Radio(pDX, IDC_NOEMULATESURFACE, cTarget->m_DxEmulationMode);
DDX_Radio(pDX, IDC_DDRAWFILTER, cTarget->m_DxFilterMode);
DDX_Check(pDX, IDC_SUPPRESSCLIPPING, cTarget->m_SuppressClipping);
DDX_Check(pDX, IDC_FORCECLIPPER, cTarget->m_ForceClipper);
DDX_Check(pDX, IDC_BLITFROMBACKBUFFER, cTarget->m_BlitFromBackBuffer);
DDX_Check(pDX, IDC_AUTOREFRESH, cTarget->m_AutoRefresh);
DDX_Check(pDX, IDC_INDEPENDENTREFRESH, cTarget->m_IndependentRefresh);

View File

@ -46,6 +46,23 @@ void CTabDirectX2::DoDataExchange(CDataExchange* pDX)
DDX_Check(pDX, IDC_BACKBUFATTACH, cTarget->m_BackBufAttach);
DDX_Check(pDX, IDC_CLEARTEXTUREFOURCC, cTarget->m_ClearTextureFourCC);
DDX_Check(pDX, IDC_NODDEXCLUSIVEMODE, cTarget->m_NoDDExclusiveMode);
// Vsync
//DDX_Check(pDX, IDC_SAVELOAD, cTarget->m_SaveLoad);
//DDX_Check(pDX, IDC_FORCEVSYNC, cTarget->m_ForceVSync);
//DDX_Check(pDX, IDC_FORCENOVSYNC, cTarget->m_ForceNoVSync);
//DDX_Check(pDX, IDC_FORCEWAIT, cTarget->m_ForceWait);
//DDX_Check(pDX, IDC_FORCENOWAIT, cTarget->m_ForceNoWait);
DDX_Radio(pDX, IDC_VSYNCDEFAULT, cTarget->m_VSyncMode);
DDX_Radio(pDX, IDC_WAITDEFAULT, cTarget->m_WaitMode);
DDX_Radio(pDX, IDC_VSYNCHW, cTarget->m_VSyncImpl);
DDX_Text(pDX, IDC_SCANLINE, cTarget->m_ScanLine);
// Clipper
//DDX_Check(pDX, IDC_SUPPRESSCLIPPING, cTarget->m_SuppressClipping);
//DDX_Check(pDX, IDC_FORCECLIPPER, cTarget->m_ForceClipper);
DDX_Radio(pDX, IDC_CLIPPERNONE, cTarget->m_ClipperMode);
}
BEGIN_MESSAGE_MAP(CTabDirectX2, CDialog)

View File

@ -35,6 +35,7 @@ void CTabHook::DoDataExchange(CDataExchange* pDX)
DDX_Check(pDX, IDC_HOOKDLLS, cTarget->m_HookDLLs);
DDX_Check(pDX, IDC_ANSIWIDE, cTarget->m_AnsiWide);
DDX_Check(pDX, IDC_HOOKNORUN, cTarget->m_HookNoRun);
DDX_Check(pDX, IDC_COPYNOSHIMS, cTarget->m_CopyNoShims);
DDX_Check(pDX, IDC_HOOKNOUPDATE, cTarget->m_HookNoUpdate);
DDX_Check(pDX, IDC_HOOKCHILDWIN, cTarget->m_HookChildWin);

View File

@ -106,7 +106,6 @@ void CTabProgram::DoDataExchange(CDataExchange* pDX)
DDX_Check(pDX, IDC_TERMINATEONCLOSE, cTarget->m_TerminateOnClose);
DDX_Check(pDX, IDC_FULLSCREENONLY, cTarget->m_FullScreenOnly);
DDX_Check(pDX, IDC_SHOWHINTS, cTarget->m_ShowHints);
DDX_Check(pDX, IDC_SAVELOAD, cTarget->m_SaveLoad);
DDX_Check(pDX, IDC_KEEPASPECTRATIO, cTarget->m_KeepAspectRatio);
DDX_Check(pDX, IDC_NOBANNER, cTarget->m_NoBanner);
DDX_Check(pDX, IDC_HIDEDESKTOP, cTarget->m_HideDesktop);

View File

@ -117,6 +117,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/)
m_HookDLLs = TRUE; // default true !!
m_AnsiWide = FALSE;
m_HookNoRun = FALSE;
m_CopyNoShims = FALSE;
m_HookNoUpdate = FALSE;
m_TerminateOnClose = FALSE;
m_ConfirmOnClose = FALSE;
@ -135,13 +136,13 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/)
m_NoBanner = FALSE;
m_FilePath = _T("");
m_Module = _T("");
m_SaveLoad = FALSE;
//m_SaveLoad = FALSE;
m_SlowDown = FALSE;
m_BlitFromBackBuffer = FALSE;
m_NoFlipEmulation = FALSE;
m_LockColorDepth = FALSE;
m_SuppressClipping = FALSE;
m_ForceClipper = FALSE;
//m_SuppressClipping = FALSE;
//m_ForceClipper = FALSE;
m_DisableGammaRamp = FALSE;
m_AutoRefresh = FALSE;
m_IndependentRefresh = FALSE;
@ -194,6 +195,13 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/)
m_BackBufAttach = FALSE;
m_ClearTextureFourCC = FALSE;
m_NoDDExclusiveMode = FALSE;
//m_ForceVSync = FALSE;
//m_ForceNoVSync = FALSE;
//m_ForceWait = FALSE;
//m_ForceNoWait = FALSE;
m_VSyncMode = 0;
m_VSyncImpl = 0;
m_WaitMode = 0;
m_HandleAltF4 = FALSE;
m_LimitFPS = FALSE;
m_SkipFPS = FALSE;
@ -240,6 +248,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/)
m_AssertDialog = FALSE;
m_InitialRes = FALSE;
m_MaximumRes = FALSE;
m_ClipperMode = 0;
m_PosX = 50;
m_PosY = 50;
m_SizX = 800;
@ -250,7 +259,8 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/)
m_InitTS = 8;
m_SwapEffect = 0;
m_InjectionMode = 0;
m_WinMovementType = 0;
m_WinMovementType = 1; // "Floating" position mode, better than "Free"!
m_ScanLine = 0;
//}}AFX_DATA_INIT
}
@ -413,4 +423,4 @@ void CTargetDlg::OnBnClickedKill()
else{
MessageBoxLang(DXW_STRING_NOKILLTASK, DXW_STRING_INFO, MB_ICONEXCLAMATION);
}
}
}

View File

@ -71,6 +71,7 @@ public:
BOOL m_HookDLLs;
BOOL m_AnsiWide;
BOOL m_HookNoRun;
BOOL m_CopyNoShims;
BOOL m_HookNoUpdate;
BOOL m_TerminateOnClose;
BOOL m_ConfirmOnClose;
@ -97,13 +98,13 @@ public:
CString m_OpenGLLib;
CString m_Notes;
CString m_Registry;
BOOL m_SaveLoad;
//BOOL m_SaveLoad;
BOOL m_SlowDown;
BOOL m_BlitFromBackBuffer;
BOOL m_NoFlipEmulation;
BOOL m_LockColorDepth;
BOOL m_SuppressClipping;
BOOL m_ForceClipper;
//BOOL m_SuppressClipping;
//BOOL m_ForceClipper;
BOOL m_DisableGammaRamp;
BOOL m_AutoRefresh;
BOOL m_IndependentRefresh;
@ -155,6 +156,10 @@ public:
BOOL m_BackBufAttach;
BOOL m_ClearTextureFourCC;
BOOL m_NoDDExclusiveMode;
//BOOL m_ForceVSync;
//BOOL m_ForceNoVSync;
//BOOL m_ForceWait;
//BOOL m_ForceNoWait;
BOOL m_HandleAltF4;
BOOL m_HandleExceptions;
BOOL m_SkipFPS;
@ -258,6 +263,9 @@ public:
BOOL m_LimitScreenRes;
BOOL m_InitialRes;
BOOL m_MaximumRes;
int m_VSyncMode;
int m_VSyncImpl;
int m_WaitMode;
int m_PosX;
int m_PosY;
int m_SizX;
@ -270,6 +278,8 @@ public:
int m_MaxScreenRes;
int m_ResTypes;
int m_SwapEffect;
int m_ClipperMode;
int m_ScanLine;
//}}AFX_DATA

View File

@ -45,7 +45,6 @@ static char THIS_FILE[] = __FILE__;
#endif
extern BOOL gbDebug;
extern BOOL gWarnOnExit;
/////////////////////////////////////////////////////////////////////////////
// CDXTabCtrl

Binary file not shown.

View File

@ -38,6 +38,7 @@ typedef struct PRIVATEMAP
typedef struct {
TARGETMAP *TM;
PRIVATEMAP *PM;
char *ExePath;
} ThreadInfo_Type;
ThreadInfo_Type;

Binary file not shown.

Binary file not shown.

View File

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

View File

@ -207,6 +207,7 @@ void SetTargetFromDlg(TARGETMAP *t, CTargetDlg *dlg)
if(dlg->m_HookDLLs) t->flags3 |= HOOKDLLS;
if(dlg->m_AnsiWide) t->flags5 |= ANSIWIDE;
if(dlg->m_HookNoRun) t->flags7 |= HOOKNORUN;
if(dlg->m_CopyNoShims) t->flags7 |= COPYNOSHIMS;
if(dlg->m_HookNoUpdate) t->flags7 |= HOOKNOUPDATE;
if(dlg->m_TerminateOnClose) t->flags6 |= TERMINATEONCLOSE;
if(dlg->m_ConfirmOnClose) t->flags6 |= CONFIRMONCLOSE;
@ -309,6 +310,29 @@ void SetTargetFromDlg(TARGETMAP *t, CTargetDlg *dlg)
case 3: t->flags |= LOCKWINPOS; t->flags7 |= ANCHORED; break;
}
switch(dlg->m_VSyncMode){
case 0: break;
case 1: t->flags8 |= FORCEVSYNC; break;
case 2: t->flags8 |= FORCENOVSYNC; break;
}
switch(dlg->m_VSyncImpl){
case 0: break;
case 1: t->flags8 |= VSYNCSCANLINE; break;
case 2: t->flags |= SAVELOAD; break;
}
switch(dlg->m_WaitMode){
case 0: break;
case 1: t->flags8 |= FORCEWAIT; break;
case 2: t->flags8 |= FORCENOWAIT; break;
}
switch(dlg->m_ClipperMode){
case 0: break;
case 1: t->flags3 |= FORCECLIPPER; break;
case 2: t->flags |= SUPPRESSCLIPPING; break;
}
if(dlg->m_HookDI) t->flags |= HOOKDI;
if(dlg->m_HookDI8) t->flags |= HOOKDI8;
if(dlg->m_EmulateRelMouse) t->flags6 |= EMULATERELMOUSE;
@ -389,13 +413,13 @@ void SetTargetFromDlg(TARGETMAP *t, CTargetDlg *dlg)
if(dlg->m_LimitScreenRes) t->flags4 |= LIMITSCREENRES;
if(dlg->m_SingleProcAffinity) t->flags3 |= SINGLEPROCAFFINITY;
if(dlg->m_UseLastCore) t->flags5 |= USELASTCORE;
if(dlg->m_SaveLoad) t->flags |= SAVELOAD;
//if(dlg->m_SaveLoad) t->flags |= SAVELOAD;
if(dlg->m_SlowDown) t->flags |= SLOWDOWN;
if(dlg->m_BlitFromBackBuffer) t->flags |= BLITFROMBACKBUFFER;
if(dlg->m_NoFlipEmulation) t->flags4 |= NOFLIPEMULATION;
if(dlg->m_LockColorDepth) t->flags7 |= LOCKCOLORDEPTH;
if(dlg->m_SuppressClipping) t->flags |= SUPPRESSCLIPPING;
if(dlg->m_ForceClipper) t->flags3 |= FORCECLIPPER;
//if(dlg->m_SuppressClipping) t->flags |= SUPPRESSCLIPPING;
//if(dlg->m_ForceClipper) t->flags3 |= FORCECLIPPER;
if(dlg->m_DisableGammaRamp) t->flags2 |= DISABLEGAMMARAMP;
if(dlg->m_AutoRefresh) t->flags |= AUTOREFRESH;
if(dlg->m_IndependentRefresh) t->flags2 |= INDEPENDENTREFRESH;
@ -492,10 +516,15 @@ void SetTargetFromDlg(TARGETMAP *t, CTargetDlg *dlg)
if(dlg->m_ReplacePrivOps) t->flags5 |= REPLACEPRIVOPS;
if(dlg->m_InitialRes) t->flags7 |= INITIALRES;
if(dlg->m_MaximumRes) t->flags7 |= MAXIMUMRES;
//if(dlg->m_ForceVSync) t->flags8 |= FORCEVSYNC;
//if(dlg->m_ForceNoVSync) t->flags8 |= FORCENOVSYNC;
//if(dlg->m_ForceWait) t->flags8 |= FORCEWAIT;
//if(dlg->m_ForceNoWait) t->flags8 |= FORCENOWAIT;
t->posx = dlg->m_PosX;
t->posy = dlg->m_PosY;
t->sizx = dlg->m_SizX;
t->sizy = dlg->m_SizY;
t->ScanLine = dlg->m_ScanLine;
t->MaxFPS = dlg->m_MaxFPS;
t->InitTS = dlg->m_InitTS-8;
t->FakeVersionId = dlg->m_FakeVersionId;
@ -524,6 +553,7 @@ static void SetDlgFromTarget(TARGETMAP *t, CTargetDlg *dlg)
dlg->m_HookDLLs = t->flags3 & HOOKDLLS ? 1 : 0;
dlg->m_AnsiWide = t->flags5 & ANSIWIDE ? 1 : 0;
dlg->m_HookNoRun = t->flags7 & HOOKNORUN ? 1 : 0;
dlg->m_CopyNoShims = t->flags7 & COPYNOSHIMS ? 1 : 0;
dlg->m_HookNoUpdate = t->flags7 & HOOKNOUPDATE ? 1 : 0;
dlg->m_TerminateOnClose = t->flags6 & TERMINATEONCLOSE ? 1 : 0;
dlg->m_ConfirmOnClose = t->flags6 & CONFIRMONCLOSE ? 1 : 0;
@ -601,6 +631,22 @@ static void SetDlgFromTarget(TARGETMAP *t, CTargetDlg *dlg)
if(t->flags2 & LOCKEDSIZE) dlg->m_WinMovementType = 2;
if(t->flags7 & ANCHORED) dlg->m_WinMovementType = 3;
dlg->m_VSyncMode = 0;
if(t->flags8 & FORCEVSYNC) dlg->m_VSyncMode = 1;
if(t->flags8 & FORCENOVSYNC) dlg->m_VSyncMode = 2;
dlg->m_VSyncImpl = 0;
if(t->flags8 & VSYNCSCANLINE) dlg->m_VSyncImpl = 1;
if(t->flags & SAVELOAD) dlg->m_VSyncImpl = 2;
dlg->m_WaitMode = 0;
if(t->flags8 & FORCEWAIT) dlg->m_WaitMode = 1;
if(t->flags8 & FORCENOWAIT) dlg->m_WaitMode = 2;
dlg->m_ClipperMode = 0;
if (t->flags3 & FORCECLIPPER) dlg->m_ClipperMode = 1;
if (t->flags & SUPPRESSCLIPPING) dlg->m_ClipperMode = 2;
dlg->m_HookDI = t->flags & HOOKDI ? 1 : 0;
dlg->m_HookDI8 = t->flags & HOOKDI8 ? 1 : 0;
dlg->m_EmulateRelMouse = t->flags6 & EMULATERELMOUSE ? 1 : 0;
@ -680,13 +726,13 @@ static void SetDlgFromTarget(TARGETMAP *t, CTargetDlg *dlg)
dlg->m_ClearTarget = t->flags5 & CLEARTARGET ? 1 : 0;
dlg->m_FixPitch = t->flags6 & FIXPITCH ? 1 : 0;
dlg->m_Power2Width = t->flags6 & POWER2WIDTH ? 1 : 0;
dlg->m_SaveLoad = t->flags & SAVELOAD ? 1 : 0;
//dlg->m_SaveLoad = t->flags & SAVELOAD ? 1 : 0;
dlg->m_SlowDown = t->flags & SLOWDOWN ? 1 : 0;
dlg->m_BlitFromBackBuffer = t->flags & BLITFROMBACKBUFFER ? 1 : 0;
dlg->m_NoFlipEmulation = t->flags4 & NOFLIPEMULATION ? 1 : 0;
dlg->m_LockColorDepth = t->flags7 & LOCKCOLORDEPTH ? 1 : 0;
dlg->m_SuppressClipping = t->flags & SUPPRESSCLIPPING ? 1 : 0;
dlg->m_ForceClipper = t->flags3 & FORCECLIPPER ? 1 : 0;
// dlg->m_SuppressClipping = t->flags & SUPPRESSCLIPPING ? 1 : 0;
// dlg->m_ForceClipper = t->flags3 & FORCECLIPPER ? 1 : 0;
dlg->m_DisableGammaRamp = t->flags2 & DISABLEGAMMARAMP ? 1 : 0;
dlg->m_AutoRefresh = t->flags & AUTOREFRESH ? 1 : 0;
dlg->m_IndependentRefresh = t->flags2 & INDEPENDENTREFRESH ? 1 : 0;
@ -781,10 +827,15 @@ static void SetDlgFromTarget(TARGETMAP *t, CTargetDlg *dlg)
dlg->m_ReplacePrivOps = t->flags5 & REPLACEPRIVOPS ? 1 : 0;
dlg->m_InitialRes = t->flags7 & INITIALRES ? 1 : 0;
dlg->m_MaximumRes = t->flags7 & MAXIMUMRES ? 1 : 0;
//dlg->m_ForceVSync = t->flags8 & FORCEVSYNC ? 1 : 0;
//dlg->m_ForceNoVSync = t->flags8 & FORCENOVSYNC ? 1 : 0;
//dlg->m_ForceWait = t->flags8 & FORCEWAIT ? 1 : 0;
//dlg->m_ForceNoWait = t->flags8 & FORCENOWAIT ? 1 : 0;
dlg->m_PosX = t->posx;
dlg->m_PosY = t->posy;
dlg->m_SizX = t->sizx;
dlg->m_SizY = t->sizy;
dlg->m_ScanLine = t->ScanLine;
dlg->m_MaxFPS = t->MaxFPS;
dlg->m_InitTS = t->InitTS+8;
dlg->m_FakeVersionId = t->FakeVersionId;
@ -866,14 +917,6 @@ static void SaveConfigItem(TARGETMAP *TargetMap, PRIVATEMAP *PrivateMap, int i,
sprintf_s(val, sizeof(val), "%i", TargetMap->flags8);
WritePrivateProfileString("target", key, val, InitPath);
// -------
sprintf_s(key, sizeof(key), "flagl%i", i);
sprintf_s(val, sizeof(val), "%i", TargetMap->flags7);
WritePrivateProfileString("target", key, val, InitPath);
// -------
sprintf_s(key, sizeof(key), "flagm%i", i);
sprintf_s(val, sizeof(val), "%i", TargetMap->flags8);
WritePrivateProfileString("target", key, val, InitPath);
// -------
sprintf_s(key, sizeof(key), "tflag%i", i);
sprintf_s(val, sizeof(val), "%i", TargetMap->tflags);
WritePrivateProfileString("target", key, val, InitPath);
@ -926,6 +969,10 @@ static void SaveConfigItem(TARGETMAP *TargetMap, PRIVATEMAP *PrivateMap, int i,
sprintf_s(val, sizeof(val), "%i", TargetMap->SlowRatio);
WritePrivateProfileString("target", key, val, InitPath);
// -------
sprintf_s(key, sizeof(key), "scanline%i", i);
sprintf_s(val, sizeof(val), "%i", TargetMap->ScanLine);
WritePrivateProfileString("target", key, val, InitPath);
// -------
sprintf_s(key, sizeof(key), "initresw%i", i);
sprintf_s(val, sizeof(val), "%i", TargetMap->resw);
WritePrivateProfileString("target", key, val, InitPath);
@ -1122,6 +1169,9 @@ static int LoadConfigItem(TARGETMAP *TargetMap, PRIVATEMAP *PrivateMap, int i, c
sprintf_s(key, sizeof(key), "slowratio%i", i);
TargetMap->SlowRatio = GetPrivateProfileInt("target", key, 1, InitPath);
// -------
sprintf_s(key, sizeof(key), "scanline%i", i);
TargetMap->ScanLine = GetPrivateProfileInt("target", key, 1, InitPath);
// -------
sprintf_s(key, sizeof(key), "initresw%i", i);
TargetMap->resw = GetPrivateProfileInt("target", key, 0, InitPath);
// -------
@ -1940,6 +1990,10 @@ void CDxwndhostView::OnProcessKill()
lpProcName=FilePath;
while (lpNext=strchr(lpProcName,'\\')) lpProcName=lpNext+1;
if(TargetMaps[i].flags7 & COPYNOSHIMS){
strcat(lpProcName, ".noshim");
}
if(!KillProcByName(lpProcName, FALSE)){
wchar_t *wcstring = new wchar_t[48+1];
mbstowcs_s(NULL, wcstring, 48, PrivateMaps[i].title, _TRUNCATE);
@ -2666,7 +2720,7 @@ DWORD WINAPI StartDebug(void *p)
ThInfo = (ThreadInfo_Type *)p;
ZeroMemory(&sinfo, sizeof(sinfo));
sinfo.cb = sizeof(sinfo);
sRunTargetPath = (strlen(ThInfo->PM->launchpath)>0) ? ThInfo->PM->launchpath : ThInfo->TM->path;
sRunTargetPath = ThInfo->ExePath;
strcpy_s(path, sizeof(path), sRunTargetPath);
PathRemoveFileSpec(path);
if(!CreateProcess(NULL,
@ -3061,6 +3115,77 @@ static void CheckSafeDiscVersion(char *path)
fclose(exe);
}
#define FILECOPYBUFSIZE 1024
static void MakeHiddenFile(char *sTargetPath)
{
HANDLE hFile = INVALID_HANDLE_VALUE;
HANDLE hTempFile = INVALID_HANDLE_VALUE;
BOOL fSuccess = FALSE;
DWORD dwRetVal = 0;
UINT uRetVal = 0;
DWORD dwBytesRead = 0;
DWORD dwBytesWritten = 0;
char chBuffer[FILECOPYBUFSIZE];
hFile = CreateFile(sTargetPath, // file name
GENERIC_READ, // open for reading
0, // do not share
NULL, // default security
OPEN_EXISTING, // existing file only
FILE_ATTRIBUTE_NORMAL, // normal file
NULL); // no template
if (hFile == INVALID_HANDLE_VALUE) {
//PrintError(TEXT("First CreateFile failed"));
return;
}
strcat(sTargetPath, ".noshim");
// Deletes last copy of the file, just in case it was updated (patched?)
// DeleteFile(sTargetPath);
// Creates the new file to write to for the upper-case version.
hTempFile = CreateFile((LPTSTR) sTargetPath, // file name
GENERIC_WRITE, // open for write
0, // do not share
NULL, // default security
CREATE_ALWAYS, // overwrite existing
//FILE_ATTRIBUTE_HIDDEN, // hidden file
FILE_ATTRIBUTE_NORMAL, // normal file
NULL); // no template
if (hTempFile == INVALID_HANDLE_VALUE) {
char msg[120];
sprintf(msg, "Creation of hidden copy of target file with no SHIMs failed\nError=%d", GetLastError());
MessageBox(0, msg, "Warning", 0);
//PrintError(TEXT("Second CreateFile failed"));
if (!CloseHandle(hFile)){
sprintf(msg, "CloseHandle failed\nError=%d", GetLastError());
MessageBox(0, msg, "Error", 0);
}
return;
}
// Reads BUFSIZE blocks to the buffer and copy to the temporary
// file.
do {
if (ReadFile(hFile, chBuffer, FILECOPYBUFSIZE, &dwBytesRead, NULL)) {
fSuccess = WriteFile(hTempFile, chBuffer, dwBytesRead, &dwBytesWritten, NULL);
if (!fSuccess) {
//PrintError(TEXT("WriteFile failed"));
break;
}
}
else {
//PrintError(TEXT("ReadFile failed"));
break;
}
// Continues until the whole file is processed.
} while (dwBytesRead == FILECOPYBUFSIZE);
CloseHandle(hFile);
CloseHandle(hTempFile);
}
void CDxwndhostView::OnRun()
{
CListCtrl& listctrl = GetListCtrl();
@ -3068,7 +3193,8 @@ void CDxwndhostView::OnRun()
int i;
STARTUPINFO sinfo;
PROCESS_INFORMATION pinfo;
char path[MAX_PATH];
char folderpath[MAX_PATH+20]; // max + space for ".noshim"
char exepath[MAX_PATH+20]; // max + space for ".noshim"
TARGETMAP RestrictedMaps[2];
char *sRunTargetPath;
@ -3088,10 +3214,16 @@ void CDxwndhostView::OnRun()
memcpy(&RestrictedMaps[0], &TargetMaps[i], sizeof(TARGETMAP));
memset(&RestrictedMaps[1], 0, sizeof(TARGETMAP));
if(!(PrivateMaps[i].startfolder[0])){
strcpy_s(path, sizeof(path), sRunTargetPath);
PathRemoveFileSpec(path);
strcpy_s(folderpath, sizeof(folderpath), sRunTargetPath);
strcpy_s(exepath, sizeof(exepath), sRunTargetPath);
PathRemoveFileSpec(folderpath);
}else{
strcpy_s(path, sizeof(path), PrivateMaps[i].startfolder);
strcpy_s(folderpath, sizeof(folderpath), PrivateMaps[i].startfolder);
strcpy_s(exepath, sizeof(exepath), sRunTargetPath);
}
if(TargetMaps[i].flags7 & COPYNOSHIMS){
MakeHiddenFile(exepath);
strncpy(RestrictedMaps[0].path, exepath, MAX_PATH);
}
SetTarget(RestrictedMaps);
OutTrace("OnRun idx=%d prog=\"%s\"\n", i, TargetMaps[i].path);
@ -3137,24 +3269,31 @@ void CDxwndhostView::OnRun()
ThreadInfo_Type ThreadInfo;
ThreadInfo.TM=&TargetMaps[i];
ThreadInfo.PM=&PrivateMaps[i];
ThreadInfo.ExePath=exepath;
CloseHandle(CreateThread( NULL, 0, StartDebug, &ThreadInfo, 0, NULL));
}
else
if(TargetMaps[i].flags7 & INJECTSUSPENDED){
OutTrace("injectsuspended mode\n");
InjectSuspended(sRunTargetPath, path);
InjectSuspended(exepath, folderpath);
}
else{
OutTrace("setwindowshook mode\n");
CreateProcess(NULL,
sRunTargetPath,
0, 0, false, CREATE_DEFAULT_ERROR_MODE, NULL, path, &sinfo, &pinfo);
exepath,
0, 0, false, CREATE_DEFAULT_ERROR_MODE, NULL, folderpath, &sinfo, &pinfo);
CloseHandle(pinfo.hProcess); // no longer needed, avoid handle leakage
CloseHandle(pinfo.hThread); // no longer needed, avoid handle leakage
}
// wait & recover
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)RecoverTargetMaps, (LPVOID)TargetMaps, 0, NULL);
if(gAutoHideMode) this->OnGoToTrayIcon();
// not working: the file is opened, can't be deleted
//if(TargetMaps[i].flags7 & COPYNOSHIMS){
// DeleteFile(exepath);
//}
}
void SwitchToColorDepth(int bpp)

Binary file not shown.

Binary file not shown.

BIN
proxy/d3d8.suo Normal file

Binary file not shown.

BIN
proxy/d3d9.suo Normal file

Binary file not shown.

BIN
proxy/ddraw.suo Normal file

Binary file not shown.