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

v2_02_41_src

Former-commit-id: b88af301f91d73b0bff4ac73b1073e4075d9353b
This commit is contained in:
gho tik 2013-11-16 11:38:27 -05:00 committed by Refael ACkermann
parent e8b01bcd28
commit c4fdc9331d
35 changed files with 7456 additions and 337 deletions

View File

@ -114,6 +114,8 @@
// fourth flags DWORD dxw.dwFlags4:
#define NOALPHACHANNEL 0x00000001 // By default, create surfaces with no DDPF_ALPHAPIXELS capability
#define SUPPRESSCHILD 0x00000002 // suppress child process generation (CreateProcessA, ...?)
#define FIXREFCOUNTER 0x00000004 // fixes the reference counter for the main directdraw session (the one connected to primary surfaces)
// logging Tflags DWORD:
#define OUTTRACE 0x00000001 // enables tracing to dxwnd.log in general

5848
build/dxwnd.1.ini Normal file

File diff suppressed because it is too large Load Diff

1133
build/dxwnd.2.ini Normal file

File diff suppressed because it is too large Load Diff

167
build/dxwnd.3.ini Normal file
View File

@ -0,0 +1,167 @@
[window]
posx=1452
posy=365
sizx=320
sizy=514
[target]
title0=Rayman 2 Demo
path0=D:\Games\Rayman2Demo\Rayman2Demo.exe
module0=
opengllib0=
ver0=1
coord0=0
flag0=402653217
flagg0=1210056704
flagh0=2097172
flagi0=0
tflag0=64
initx0=0
inity0=0
minx0=0
miny0=0
maxx0=0
maxy0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
title1=Mirror's Edge
path1=D:\Games\Mirror's Edge\Binaries\MirrorsEdge.exe
module1=
opengllib1=
ver1=0
coord1=0
flag1=-2013265882
flagg1=1207959552
flagh1=2097172
flagi1=0
tflag1=5
initx1=0
inity1=0
minx1=0
miny1=0
maxx1=0
maxy1=0
posx1=50
posy1=50
sizx1=800
sizy1=600
maxfps1=0
initts1=6
title2=LastHalfWin.exe
path2=D:\Games\Last Half Of Darkness\LastHalfWin.exe
module2=
opengllib2=
ver2=1
coord2=0
flag2=134217760
flagg2=1207959552
flagh2=4
flagi2=0
tflag2=512
initx2=0
inity2=0
minx2=0
miny2=0
maxx2=0
maxy2=0
posx2=50
posy2=50
sizx2=800
sizy2=600
maxfps2=0
initts2=0
title3=DOOM95.EXE
path3=D:\Games\Doom95i\DOOM95.EXE
module3=
opengllib3=
ver3=0
coord3=0
flag3=134217762
flagg3=1207959552
flagh3=20
flagi3=0
tflag3=512
initx3=0
inity3=0
minx3=0
miny3=0
maxx3=0
maxy3=0
posx3=50
posy3=50
sizx3=800
sizy3=600
maxfps3=0
initts3=0
title4=CNC3.exe
path4=D:\Games\Command & Conquer 3\CNC3.exe
module4=
opengllib4=
ver4=9
coord4=0
flag4=134217762
flagg4=1207959552
flagh4=20
flagi4=0
tflag4=512
initx4=0
inity4=0
minx4=0
miny4=0
maxx4=0
maxy4=0
posx4=50
posy4=50
sizx4=800
sizy4=600
maxfps4=0
initts4=0
title5=Div.exe
path5=D:\Games\Beyond Divinity\Div.exe
module5=
opengllib5=
ver5=0
coord5=0
flag5=134217762
flagg5=1207959552
flagh5=20
flagi5=0
tflag5=512
initx5=0
inity5=0
minx5=0
miny5=0
maxx5=0
maxy5=0
posx5=50
posy5=50
sizx5=800
sizy5=600
maxfps5=0
initts5=0
title6=martian gothic.exe
path6=D:\Games\Martian Gothic\martian gothic.exe
module6=
opengllib6=
ver6=7
coord6=0
flag6=201326626
flagg6=1208090624
flagh6=276
flagi6=0
tflag6=263
initx6=0
inity6=0
minx6=0
miny6=0
maxx6=0
maxy6=0
posx6=50
posy6=50
sizx6=800
sizy6=600
maxfps6=0
initts6=0

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f72014ec45098420011258296358843eced6ce66d98dd791d8997884a624db18
size 422400
oid sha256:d1a209c794208ebc34f31a6cd07230ea4410cb8ec6cdeedff15725bd32ae783a
size 425472

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:645d3eb20a6c06832fd937ba3847de75e82273c684ccfac31dbfface9881df50
oid sha256:3d50219a90b39093171656814a8cf5e4b1782366c91e18f16a8972cee2075727
size 532480

View File

@ -272,3 +272,13 @@ code reorganization
GUI:
removed useless flags and moved debug options in a hidden tab
v2.02.38-40
Fixed coordinate calculation for blit operations when keeping aspect ratio.
Fixed window coordinate placement in desktop / client area mode for programs with a visible menu bar.
Changed "Lock win coordinates" flag: now it allows window movement / resizing when driven by mouse input.
Fixed a bug in GDI "Map DC to primary surface"mode.
Added palette display window to GUI
v2.02.41
Added "suppress child process creation" flag. This flag is introduced to manage games such as "Heart of Iron 2" and "Chariots of War" that start intro movie by means of a separate process. Both games are starting the binkplay.exe program in the game's avi subfolder. This way you don't get a windowed movie, but completely suppress it.
Added "fix ddraw ref counter" flag, to have primary directdraw object addref & release ref counters identical to those without dxwnd. Some games check for the value and show error messages, i.e. "Grand Prix World"!

View File

@ -18,7 +18,7 @@
#include "syslibs.h"
#include "dxhelper.h"
#include "hddraw.h"
#include "hddproxy.h"
#include "ddproxy.h"
static void HookDDSessionProxy(LPDIRECTDRAW *, int);
static void HookDDSurfaceProxy(LPDIRECTDRAWSURFACE *, int);
@ -193,6 +193,7 @@ HPALETTE WINAPI extSelectPaletteProxy(HDC, HPALETTE, BOOL);
UINT WINAPI extRealizePaletteProxy(HDC);
HDC WINAPI extBeginPaintProxy(HWND, LPPAINTSTRUCT);
UINT WINAPI extGetSystemPaletteEntriesProxy(HDC, UINT, UINT, LPPALETTEENTRY);
int WINAPI extGetDeviceCapsProxy(HDC, int);
// ------------------------------------------------------------------------------------------ //
//
@ -323,6 +324,8 @@ int HookDDProxy(HMODULE module, int dxVersion)
if(tmp) pGDIRealizePalette = (RealizePalette_Type)tmp;
tmp = HookAPI(module, "GDI32.dll", GetSystemPaletteEntries, "GetSystemPaletteEntries", extGetSystemPaletteEntriesProxy);
if(tmp) pGDIGetSystemPaletteEntries = (GetSystemPaletteEntries_Type)tmp;
tmp = HookAPI(module, "GDI32.dll", GetDeviceCaps, "GetDeviceCaps", extGetDeviceCapsProxy);
if(tmp) pGDIGetDeviceCaps = (GetDeviceCaps_Type)tmp;
tmp = HookAPI(module, "user32.dll", BeginPaint, "BeginPaint", extBeginPaintProxy);
if(tmp) pBeginPaint = (BeginPaint_Type)tmp;
pGetProcAddress = (GetProcAddress_Type)GetProcAddress;
@ -877,6 +880,9 @@ HRESULT WINAPI extCreateSurfaceProxy(int dxVersion, CreateSurface_Type pCreateSu
OutTraceP("CreateSurface(D): ERROR res=%x(%s)\n", res, ExplainDDError(res));
return res;
}
if(IsDebug){
OutTrace("CreateSurface(D): built Caps=%x(%s)\n", lpddsd->ddsCaps.dwCaps, ExplainDDSCaps(lpddsd->ddsCaps.dwCaps));
}
OutTraceP("CreateSurface(D): lpdds=%x\n", *lplpdds);
#ifdef HOOKSURFACE
HookDDSurfaceProxy(lplpdds, dxVersion);
@ -2071,4 +2077,26 @@ HDC WINAPI extBeginPaintProxy(HWND hwnd, LPPAINTSTRUCT lpPaint)
return ret;
}
int WINAPI extGetDeviceCapsProxy(HDC hdc, int nindex)
{
DWORD res;
res = (*pGDIGetDeviceCaps)(hdc, nindex);
OutTraceD("GetDeviceCaps: hdc=%x index=%x(%s) res=%x\n",
hdc, nindex, ExplainDeviceCaps(nindex), res);
switch(nindex){
case VERTRES:
OutTraceD("GetDeviceCaps: VERTRES=%d\n", res);
break;
case HORZRES:
OutTraceD("GetDeviceCaps: HORZRES=%d\n", res);
break;
case RASTERCAPS:
OutTraceD("GetDeviceCaps: RASTERCAPS=%x(%s)\n",res, ExplainRasterCaps(res));
break;
}
return res;
}

View File

@ -12,7 +12,7 @@
#include "dxwcore.hpp"
#include "stdio.h"
#include "hddraw.h"
#include "hddproxy.h"
#include "ddproxy.h"
#include "dxhelper.h"
#include "syslibs.h"
@ -237,7 +237,6 @@ LPDIRECTDRAWSURFACE lpDDTexture=NULL;
LPDIRECTDRAW lpPrimaryDD=NULL;
LPDIRECTDRAW lpBackBufferDD=NULL;
int iBakBufferVersion;
LPDIRECTDRAWCLIPPER lpDDC=NULL;
LPDIRECTDRAWPALETTE lpDDP=NULL;
// v2.02.37: globals to store requested main surface capabilities
@ -257,8 +256,10 @@ static void GetPixFmt(LPDDSURFACEDESC2);
static HookEntry_Type ddHooks[]={
{"DirectDrawCreate", (FARPROC)NULL, (FARPROC *)&pDirectDrawCreate, (FARPROC)extDirectDrawCreate},
{"DirectDrawCreateEx", (FARPROC)NULL, (FARPROC *)&pDirectDrawCreateEx, (FARPROC)extDirectDrawCreateEx},
{"DirectDrawCreate", (FARPROC)NULL, (FARPROC *)&pDirectDrawCreate, (FARPROC)extDirectDrawCreate},
{"DirectDrawCreate", (FARPROC)NULL, (FARPROC *)&pDirectDrawCreate, (FARPROC)extDirectDrawCreate},
{"DirectDrawEnumerateA", (FARPROC)NULL, (FARPROC *)&pDirectDrawEnumerate, (FARPROC)extDirectDrawEnumerate},
{"DirectDrawEnumerateExA", (FARPROC)NULL, (FARPROC *)&pDirectDrawEnumerateEx, (FARPROC)extDirectDrawEnumerateEx},
//{"DirectDrawEnumerateW", (FARPROC)NULL, (FARPROC *)&pDirectDrawEnumerateW, (FARPROC)extDirectDrawCreate},
//{"DirectDrawEnumerateExW", (FARPROC)NULL, (FARPROC *)&pDirectDrawEnumerateExW, (FARPROC)extDirectDrawCreate},
{0, NULL, 0, 0} // terminator
};
@ -273,12 +274,6 @@ FARPROC Remap_ddraw_ProcAddress(LPCSTR proc, HMODULE hModule)
// auxiliary (static) functions
/* ------------------------------------------------------------------------------ */
static void RefProbe(INTERFACE *obj, char *op, int line)
{
obj->AddRef();
OutTrace("### COM obj=%x op=%s refcount=%d at %d ###\n", obj, op, (*pReleaseS)((LPDIRECTDRAWSURFACE)obj), line);
}
static void Stopper(char *s, int line)
{
char sMsg[81];
@ -286,13 +281,6 @@ static void Stopper(char *s, int line)
MessageBox(0, sMsg, "break", MB_OK | MB_ICONEXCLAMATION);
}
//#define REFPROBE_TEST // comment out to eliminate
#ifdef REFPROBE_TEST
#define REFPROBE(obj, op) RefProbe((INTERFACE *)(obj), op, __LINE__)
#else
#define REFPROBE(obj, op)
#endif
//#define STOPPER_TEST // comment out to eliminate
#ifdef STOPPER_TEST
#define STOPPER(s) Stopper(s, __LINE__)
@ -886,24 +874,6 @@ static void GetPixFmt(LPDDSURFACEDESC2 lpdd)
OutTraceD("GetPixFmt: %s\n", DumpPixelFormat(lpdd));
}
static void RenewClipper(LPDIRECTDRAW lpdd, LPDIRECTDRAWSURFACE lpdds)
{
HRESULT res;
return;
if (lpDDC) lpDDC->Release();
res=lpdd->CreateClipper(0, &lpDDC, NULL);
if(res) OutTraceE("CreateSurface: CreateClipper ERROR: lpdd=%x res=%x(%s) at %d\n", lpdd, res, ExplainDDError(res), __LINE__);
//HookDDClipper(&lpDDC);
res=lpDDC->SetHWnd(0, dxw.GethWnd());
if(res) OutTraceE("CreateSurface: SetHWnd ERROR: hWnd=%x res=%x(%s) at %d\n", dxw.GethWnd(), res, ExplainDDError(res), __LINE__);
res=lpdds->SetClipper(lpDDC);
//res=(*pSetClipper)(lpdds, lpDDC);
if(res) OutTraceE("CreateSurface: SetClipper ERROR: lpdds=%x res=%x(%s) at %d\n", lpdds, res, ExplainDDError(res), __LINE__);
return;
}
/* ------------------------------------------------------------------ */
// hook query functions that determines the object versioning ....
/* ------------------------------------------------------------------ */
@ -1500,6 +1470,7 @@ HRESULT WINAPI extDirectDrawCreate(GUID FAR *lpguid, LPDIRECTDRAW FAR *lplpdd, I
(LPDIRECTDRAW)(*lplpdd)->GetCaps(&DriverCaps, &EmulCaps);
//OutTrace("DirectDrawCreate: drivercaps=%x(%s) emulcaps=%x(%s)\n", DriverCaps.ddsCaps, "???", EmulCaps.ddsCaps, "???");
}
return 0;
}
@ -1780,7 +1751,7 @@ HRESULT WINAPI extQueryInterfaceS(void *lpdds, REFIID riid, LPVOID *obp)
if((lpdds == lpDDSBack) && dwLocalDDVersion) {
// assume that you always use the newer interface version, if available.
if(dwLocalDDVersion > (UINT)iBakBufferVersion){
OutTrace("QueryInterface(S): switching backbuffer %x -> %x\n", lpDDSBack, *obp);
OutTraceD("QueryInterface(S): switching backbuffer %x -> %x\n", lpDDSBack, *obp);
lpDDSBack = (LPDIRECTDRAWSURFACE)*obp;
iBakBufferVersion = dwLocalDDVersion;
}
@ -1810,6 +1781,8 @@ HRESULT WINAPI extSetDisplayMode(int version, LPDIRECTDRAW lpdd,
if(dxw.dwFlags1 & EMULATESURFACE){
// in EMULATESURFACE mode, let SetPixFmt decide upon the PixelFormat
dxw.VirtualPixelFormat.dwRGBBitCount = dwbpp;
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize=sizeof(ddsd);
SetPixFmt(&ddsd);
SetBltTransformations();
OutTraceD("SetDisplayMode: mode=EMULATE %s ret=OK\n", DumpPixelFormat(&ddsd));
@ -2132,8 +2105,12 @@ void FixSurfaceCapsAnalytic(LPDDSURFACEDESC2 lpddsd, int dxversion)
break;
case DDSCAPS_OFFSCREENPLAIN|DDSCAPS_VIDEOMEMORY:
// Dungeon Keeper II GOG release (intro screen): doesn't like calling GetPixFmt!!!
// it requests a DDPF_FOURCC surface with fourcc="YYYY" that should not be overridden?
//
// need not to be configurable until we get a different case.
// it works both on VIDEOMEMORY or SYSTEMMEMORY. The latter should be more stable.
// v2.02.41: don't alter FOURCC pixel formats
if(lpddsd->ddpfPixelFormat.dwFlags & DDPF_FOURCC) return;
lpddsd->ddsCaps.dwCaps = (DDSCAPS_SYSTEMMEMORY|DDSCAPS_OFFSCREENPLAIN);
return;
break;
@ -2268,9 +2245,14 @@ static void FixSurfaceCaps(LPDDSURFACEDESC2 lpddsd, int dxversion)
// no further changes...
return;
}
if(lpddsd->dwFlags & DDSD_ZBUFFERBITDEPTH){
lpddsd->dwFlags &= ~DDSD_PIXELFORMAT;
}
// v2.02.41: don't alter FOURCC pixel formats
if((lpddsd->dwFlags & DDSD_PIXELFORMAT) && (lpddsd->ddpfPixelFormat.dwFlags & DDPF_FOURCC)) return;
#if 0
// HoM&M3/4 fix....
if(((lpddsd->dwFlags & (DDSD_CAPS|DDSD_WIDTH|DDSD_HEIGHT)) == (DDSD_CAPS|DDSD_HEIGHT|DDSD_WIDTH)) &&
@ -2349,7 +2331,6 @@ static HRESULT BuildPrimaryEmu(LPDIRECTDRAW lpdd, CreateSurface_Type pCreateSurf
ClearSurfaceDesc((void *)&ddsd, dxversion);
ddsd.dwFlags = DDSD_CAPS;
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
GetPixFmt(&ddsd);
DumpSurfaceAttributes((LPDDSURFACEDESC)&ddsd, "[EmuPrim]" , __LINE__);
res=(*pCreateSurface)(lpdd, &ddsd, &lpDDSEmu_Prim, 0);
@ -2430,7 +2411,6 @@ static HRESULT BuildPrimaryDir(LPDIRECTDRAW lpdd, CreateSurface_Type pCreateSurf
if(dxw.dwFlags1 & EMULATEBUFFER){
lpDDSEmu_Prim = *lplpdds;
dxw.MarkRegularSurface(lpDDSEmu_Prim);
RenewClipper(lpdd, lpDDSEmu_Prim);
ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS;
// warning: can't create zero sized backbuffer surface !!!!
@ -2552,7 +2532,7 @@ static HRESULT BuildGenericEmu(LPDIRECTDRAW lpdd, CreateSurface_Type pCreateSurf
OutTraceE("CreateSurface: ERROR on Emu_Generic res=%x(%s) at %d\n", res, ExplainDDError(res), __LINE__);
return res;
}
OutTraceD("CreateSurface: created Emu_Generic dds=%x\n", *lplpdds);
if(IsDebug) DescribeSurface(*lplpdds, dxversion, "DDSEmu_Generic", __LINE__);
// diagnostic hooks ....
@ -2646,7 +2626,7 @@ static HRESULT WINAPI extCreateSurface(int dxversion, CreateSurface_Type pCreate
if((dxversion == 1) && (ddsd.dwFlags == 0)){ // Star Force Deluxe
ddsd.dwFlags = DDSD_CAPS|DDSD_HEIGHT|DDSD_WIDTH;
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
if(dxw.VirtualPixelFormat.dwRGBBitCount == 8) ddsd.ddsCaps.dwCaps |= DDSCAPS_PALETTE;
//if(dxw.VirtualPixelFormat.dwRGBBitCount == 8) ddsd.ddsCaps.dwCaps |= DDSCAPS_PALETTE;
}
// creation of the primary surface....
@ -2660,7 +2640,6 @@ static HRESULT WINAPI extCreateSurface(int dxversion, CreateSurface_Type pCreate
// beware of the different behaviour between older and newer directdraw releases...
if(dxversion >= 4){
if (lpDDC) while(lpDDC->Release());
if (lpDDSEmu_Back) while(lpDDSEmu_Back->Release());
if (lpDDSEmu_Prim) while(lpDDSEmu_Prim->Release());
if (ddsd.dwFlags & DDSD_BACKBUFFERCOUNT) { // Praetorians !!!!
@ -2668,7 +2647,6 @@ static HRESULT WINAPI extCreateSurface(int dxversion, CreateSurface_Type pCreate
lpBackBufferDD = NULL;
}
}
lpDDC=NULL;
lpDDSEmu_Back=NULL;
lpDDSEmu_Prim=NULL;
@ -2718,9 +2696,7 @@ static HRESULT WINAPI extCreateSurface(int dxversion, CreateSurface_Type pCreate
}
// rebuild the clipper area
if (lpDDC==NULL) RenewClipper(lpdd, lpDDSEmu_Prim);
if(dxw.dwFlags1 & CLIPCURSOR) dxw.SetClipCursor();
REFPROBE(*lplpdds, "CREATED");
return DD_OK;
}
@ -2729,14 +2705,12 @@ static HRESULT WINAPI extCreateSurface(int dxversion, CreateSurface_Type pCreate
if (lpDDSBack) {
OutTraceD("CreateSurface: returning current DDSBack=%x\n", lpDDSBack);
*lplpdds = lpDDSBack;
REFPROBE(lpDDSBack, "CREATED");
return DD_OK;
}
res=BuildBackBuffer(lpdd, pCreateSurface, lpddsd, dxversion, lplpdds, NULL);
lpDDSBack = *lplpdds;
dxw.MarkBackBufferSurface(lpDDSBack);
REFPROBE(*lplpdds, "CREATED");
return res;
}
@ -2751,7 +2725,6 @@ static HRESULT WINAPI extCreateSurface(int dxversion, CreateSurface_Type pCreate
res=BuildGeneric(lpdd, pCreateSurface, lpddsd, dxversion, lplpdds, pu);
if(!res) dxw.MarkRegularSurface(*lplpdds);
REFPROBE(*lplpdds, "CREATED");
return res;
}
@ -2973,7 +2946,7 @@ HRESULT WINAPI sBlt(char *api, LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect,
}
else {
if(dxw.dwFlags3 & NODDRAWBLT) return DD_OK;
}
}
}
#ifdef ONEPIXELFIX
@ -3048,8 +3021,10 @@ HRESULT WINAPI sBlt(char *api, LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect,
break;
}
if (res) BlitError(res, &srcrect, lpdestrect, __LINE__);
DescribeSurface(lpdds, 0, "[DST]" , __LINE__);
if (lpddssrc) DescribeSurface(lpddssrc, 0, "[SRC]" , __LINE__); // lpddssrc could be NULL!!!
if(IsDebug) {
DescribeSurface(lpdds, 0, "[DST]" , __LINE__);
if (lpddssrc) DescribeSurface(lpddssrc, 0, "[SRC]" , __LINE__); // lpddssrc could be NULL!!!
}
if(dxw.dwFlags1 & SUPPRESSDXERRORS) res=0;
return res;
}
@ -3059,6 +3034,7 @@ HRESULT WINAPI sBlt(char *api, LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect,
if(dxw.HandleFPS()) return DD_OK;
destrect=dxw.MapWindowRect(lpdestrect);
//OutTrace("DESTRECT=(%d,%d)-(%d,%d)\n", destrect.left, destrect.top, destrect.right, destrect.bottom);
if(!(dxw.dwFlags1 & (EMULATESURFACE|EMULATEBUFFER))){
res=0;
@ -3165,11 +3141,6 @@ HRESULT WINAPI sBlt(char *api, LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect,
if (dxw.dwFlags2 & SHOWFPSOVERLAY) dxw.ShowFPS(lpDDSSource);
if (IsDebug) BlitTrace("BACK2PRIM", &emurect, &destrect, __LINE__);
res=(*pBlt)(lpDDSEmu_Prim, &destrect, lpDDSSource, &emurect, DDBLT_WAIT, 0);
if (res==DDERR_NOCLIPLIST){
RenewClipper(lpPrimaryDD, lpDDSEmu_Prim);
if (IsDebug) BlitTrace("NOCLIP", &emurect, &destrect, __LINE__);
res=(*pBlt)(lpDDSEmu_Prim, &destrect, lpDDSSource, &emurect, DDBLT_WAIT, 0);
}
if (res) BlitError(res, &emurect, &destrect, __LINE__);
if(dxw.dwFlags1 & SUPPRESSDXERRORS) res=0;
@ -3274,7 +3245,6 @@ HRESULT WINAPI extBltFast(LPDIRECTDRAWSURFACE lpdds, DWORD dwx, DWORD dwy,
HRESULT ret;
BOOL ToPrim, FromPrim;
REFPROBE(lpdds, "BLTFAST");
ToPrim=dxw.IsAPrimarySurface(lpdds);
FromPrim=dxw.IsAPrimarySurface(lpddssrc);
@ -3374,7 +3344,7 @@ HRESULT WINAPI extCreatePalette(LPDIRECTDRAW lpdd, DWORD dwflags, LPPALETTEENTRY
OutTraceE("CreatePalette: ERROR res=%x(%s)\n", res, ExplainDDError(res));
return res;
}
else OutTrace("CreatePalette: OK lpddp=%x\n", *lplpddp);
else OutTraceD("CreatePalette: OK lpddp=%x\n", *lplpddp);
HookDDPalette(lplpddp);
return 0;
@ -3388,7 +3358,7 @@ HRESULT WINAPI extGetPalette(LPDIRECTDRAWSURFACE lpdds, LPDIRECTDRAWPALETTE *lpl
res=(*pGetPalette)(lpdds, lplpddp);
if (res) OutTraceE("GetPalette: ERROR res=%x(%s)\n", res, ExplainDDError(res));
else OutTrace("GetPalette: OK\n");
else OutTraceD("GetPalette: OK\n");
return res;
}
@ -3404,7 +3374,7 @@ HRESULT WINAPI extSetPalette(LPDIRECTDRAWSURFACE lpdds, LPDIRECTDRAWPALETTE lpdd
res=(*pSetPalette)(lpdds, lpddp);
res=DD_OK;
if(res)OutTraceE("SetPalette: ERROR res=%x(%s) at %d\n", res, ExplainDDError(res), __LINE__);
else OutTrace("SetPalette: OK\n");
else OutTraceD("SetPalette: OK\n");
if((dxw.dwFlags1 & EMULATESURFACE) && isPrim){
OutTraceD("SetPalette: register PRIMARY palette lpDDP=%x\n", lpddp);
@ -3431,7 +3401,7 @@ HRESULT WINAPI extSetEntries(LPDIRECTDRAWPALETTE lpddp, DWORD dwflags, DWORD dws
res = (*pSetEntries)(lpddp, dwflags, dwstart, dwcount, lpentries);
if(res) OutTraceE("SetEntries: ERROR res=%x(%s)\n", res, ExplainDDError(res));
else OutTrace("SetEntries: OK\n");
else OutTraceD("SetEntries: OK\n");
if((dxw.dwFlags1 & EMULATESURFACE) && (lpDDP == lpddp)){
OutTraceD("SetEntries: update PRIMARY palette lpDDP=%x\n", lpddp);
@ -3824,7 +3794,7 @@ HRESULT WINAPI myEnumModesFilter(LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpConte
HRESULT WINAPI extEnumDisplayModes(EnumDisplayModes1_Type pEnumDisplayModes, LPDIRECTDRAW lpdd, DWORD dwflags, LPDDSURFACEDESC lpddsd, LPVOID lpContext, LPDDENUMMODESCALLBACK cb)
{
HRESULT res;
OutTraceP("EnumDisplayModes(D): lpdd=%x flags=%x lpddsd=%x callback=%x\n", lpdd, dwflags, lpddsd, cb);
OutTraceD("EnumDisplayModes(D): lpdd=%x flags=%x lpddsd=%x callback=%x\n", lpdd, dwflags, lpddsd, cb);
// note: extEnumDisplayModes serves both the EnumDisplayModes and EnumDisplayModes2 interfaces:
// they differ for the lpddsd argument that should point to either DDSURFACEDESC or DDSURFACEDESC2
@ -3976,7 +3946,6 @@ HRESULT WINAPI extReleaseS(LPDIRECTDRAWSURFACE lpdds)
IsPrim=dxw.IsAPrimarySurface(lpdds);
IsBack=dxw.IsABackBufferSurface(lpdds);
REFPROBE(lpdds, "RELEASE");
res = (*pReleaseS)(lpdds);
@ -4222,24 +4191,55 @@ HRESULT WINAPI extGetCaps7S(LPDIRECTDRAWSURFACE lpdds, LPDDSCAPS2 caps)
return extGetCapsS(7, (GetCapsS_Type)pGetCaps7S, lpdds, (LPDDSCAPS)caps);
}
#define FIXREFCOUNTERS 1
#define ZEROREFCOUNTERS 0
HRESULT WINAPI DumpHandle(LPDIRECTDRAWSURFACE lpDDSurface, LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpContext)
{
OutTrace("lpdds=%x flags=%x(%s) caps=%x(%s); ",
lpDDSurface,
lpDDSurfaceDesc->dwFlags, ExplainFlags(lpDDSurfaceDesc->dwFlags),
lpDDSurfaceDesc->ddsCaps.dwCaps, ExplainDDSCaps(lpDDSurfaceDesc->ddsCaps.dwCaps));
lpDDSurface->Release();
return DDENUMRET_OK;
}
ULONG WINAPI extReleaseD(LPDIRECTDRAW lpdd)
{
ULONG ref;
ULONG ActualRef;
LONG VirtualRef;
int dxversion;
dxversion=lpddHookedVersion(lpdd); // must be called BEFORE releasing the session!!
OutTraceD("Release(D): lpdd=%x dxversion=%d\n", lpdd, dxversion);
ref=(*pReleaseD)(lpdd);
ActualRef=(*pReleaseD)(lpdd);
VirtualRef=(LONG)ActualRef;
OutTraceD("Release(D): lpdd=%x service_lpdd=%x ref=%d\n", lpdd, lpPrimaryDD, ActualRef);
if(IsDebug && ActualRef){
OutTrace("Release(D): surfaces ");
//(*pEnumSurfaces)(lpdd, DDENUMSURFACES_DOESEXIST|DDENUMSURFACES_ALL, NULL, NULL, DumpHandle);
lpdd->EnumSurfaces(DDENUMSURFACES_DOESEXIST|DDENUMSURFACES_ALL, NULL, NULL, DumpHandle);
OutTrace("\n");
}
if (lpdd == lpPrimaryDD) { // v2.1.87: fix for Dungeon Keeper II
OutTraceD("Release(D): service lpdd=%x version=%d\n", lpdd, dxversion);
if((dxversion<4) && (ref==0)){
if(FIXREFCOUNTERS){
// v2.02.41: fix the ref counter to sumulate the unwindowed original situation
--VirtualRef; // why ????
if(lpDDSBack) --VirtualRef;
if(dxw.dwFlags1 & EMULATESURFACE){
if(lpDDSEmu_Prim) --VirtualRef;
if(lpDDSEmu_Back) --VirtualRef;
}
if(VirtualRef<0) VirtualRef=0;
OutTraceD("Release(D): fixed ref counter %d->%d\n", ActualRef, VirtualRef);
}
if((dxversion<4) && (ActualRef==0)){
// directdraw old versions automatically free all linked objects when the parent session is closed.
OutTraceD("Release(D): RefCount=0 - service object RESET condition\n");
lpDDSEmu_Prim=NULL;
lpDDSEmu_Back=NULL;
lpDDC=NULL;
lpDDP=NULL;
lpPrimaryDD=NULL; // v2.02.31
if(lpBackBufferDD==lpdd){
@ -4247,10 +4247,13 @@ ULONG WINAPI extReleaseD(LPDIRECTDRAW lpdd)
lpDDSBack=NULL; // beware: Silent Hunter II seems to require the backbuffer ....
}
}
if(ZEROREFCOUNTERS){
VirtualRef=0;
}
}
OutTraceD("Release(D): lpdd=%x ref=%x\n", lpdd, ref);
return ref;
OutTraceD("Release(D): lpdd=%x ref=%x\n", lpdd, VirtualRef);
return (ULONG)VirtualRef;
}
HRESULT WINAPI extCreateClipper(LPDIRECTDRAW lpdd, DWORD dwflags,
@ -4274,10 +4277,6 @@ HRESULT WINAPI extReleaseC(LPDIRECTDRAWCLIPPER lpddClip)
ref = (*pReleaseC)(lpddClip);
OutTraceD("Release(C): PROXED lpddClip=%x ref=%x\n", lpddClip, ref);
if (lpddClip==lpDDC && ref==0) {
OutTraceD("Release(C): Clearing lpDDC pointer\n");
lpDDC=NULL;
}
return ref;
}
@ -4435,7 +4434,7 @@ BOOL WINAPI DDEnumerateCallbackExFilter(GUID *lpGuid, LPSTR lpDriverDescription,
BOOL res;
typedef struct {LPDDENUMCALLBACKEX lpCallback; LPVOID lpContext;} Context_Type;
Context_Type *p=(Context_Type *)lpContext;
OutTrace("DDEnumerateCallbackEx: guid=%x DriverDescription=\"%s\" DriverName=\"%s\" Context=%x hm=%x\n",
OutTraceD("DDEnumerateCallbackEx: guid=%x DriverDescription=\"%s\" DriverName=\"%s\" Context=%x hm=%x\n",
lpGuid, lpDriverDescription, lpDriverName, lpContext, hm);
res=TRUE;
if((lpGuid==NULL) || !(dxw.dwFlags2 & HIDEMULTIMONITOR)) res=(*p->lpCallback)(lpGuid, lpDriverDescription, lpDriverName, p->lpContext, hm);
@ -4447,7 +4446,7 @@ BOOL WINAPI DDEnumerateCallbackExFilter(GUID *lpGuid, LPSTR lpDriverDescription,
HRESULT WINAPI extDirectDrawEnumerate(LPDDENUMCALLBACK lpCallback, LPVOID lpContext)
{
HRESULT ret;
OutTraceP("DirectDrawEnumerate: lpCallback=%x lpContext=%x\n", lpCallback, lpContext);
OutTraceD("DirectDrawEnumerate: lpCallback=%x lpContext=%x\n", lpCallback, lpContext);
if((dxw.dwFlags2 & HIDEMULTIMONITOR) || (dxw.dwTFlags & OUTDEBUG)){
struct {LPDDENUMCALLBACK lpCallback; LPVOID lpContext;} myContext;
myContext.lpCallback=lpCallback;
@ -4456,7 +4455,7 @@ HRESULT WINAPI extDirectDrawEnumerate(LPDDENUMCALLBACK lpCallback, LPVOID lpCont
}
else
ret=(*pDirectDrawEnumerate)(lpCallback, lpContext);
if(ret) OutTraceP("DirectDrawEnumerate: ERROR res=%x(%s)\n", ret, ExplainDDError(ret));
if(ret) OutTraceE("DirectDrawEnumerate: ERROR res=%x(%s)\n", ret, ExplainDDError(ret));
return ret;
}
@ -4473,7 +4472,7 @@ HRESULT WINAPI extDirectDrawEnumerateEx(LPDDENUMCALLBACKEX lpCallback, LPVOID lp
}
else
ret=(*pDirectDrawEnumerateEx)(lpCallback, lpContext, dwFlags);
if(ret) OutTraceP("DirectDrawEnumerateEx: ERROR res=%x(%s)\n", ret, ExplainDDError(ret));
if(ret) OutTraceD("DirectDrawEnumerateEx: ERROR res=%x(%s)\n", ret, ExplainDDError(ret));
return ret;
}

View File

@ -1545,5 +1545,31 @@ char *ExplainPaletteUse(UINT uUsage)
return eb;
}
char *ExplainRasterCaps(DWORD c)
{
static char eb[128];
unsigned int l;
strcpy(eb,"RC_");
if(c & RC_BITBLT) strcat(eb, "BITBLT+");
if(c & RC_BANDING) strcat(eb, "BANDING+");
if(c & RC_SCALING) strcat(eb, "SCALING+");
if(c & RC_BITMAP64) strcat(eb, "BITMAP64+");
if(c & RC_GDI20_OUTPUT) strcat(eb, "GDI20_OUTPUT+");
if(c & RC_GDI20_STATE) strcat(eb, "GDI20_STATE+");
if(c & RC_SAVEBITMAP) strcat(eb, "SAVEBITMAP+");
if(c & RC_DI_BITMAP) strcat(eb, "DI_BITMAP+");
if(c & RC_PALETTE) strcat(eb, "PALETTE+");
if(c & RC_DIBTODEV) strcat(eb, "DIBTODEV+");
if(c & RC_BIGFONT) strcat(eb, "BIGFONT+");
if(c & RC_STRETCHBLT) strcat(eb, "STRETCHBLT+");
if(c & RC_FLOODFILL) strcat(eb, "FLOODFILL+");
if(c & RC_STRETCHDIB) strcat(eb, "STRETCHDIB+");
if(c & RC_OP_DX_OUTPUT) strcat(eb, "OP_DX_OUTPUT+");
if(c & RC_DEVBITS) strcat(eb, "DEVBITS+");
l=strlen(eb);
if (l>strlen("RC_")) eb[l-1]=0; // delete last '+' if any
else strcpy(eb,"NULL");
return(eb);
}

View File

@ -45,3 +45,4 @@ extern char *ExplainDCType(DWORD);
extern char *ExplainPeekRemoveMsg(DWORD);
extern char *ExplainGetDCExFlags(DWORD);
extern char *ExplainPaletteUse(UINT);
extern char *ExplainRasterCaps(DWORD);

View File

@ -65,7 +65,7 @@ static char *Flag3Names[32]={
};
static char *Flag4Names[32]={
"", "", "", "",
"NOALPHACHANNEL", "SUPPRESSCHILD", "", "",
"", "", "", "",
"", "", "", "",
"", "", "", "",
@ -605,9 +605,23 @@ void CalculateWindowPos(HWND hwnd, DWORD width, DWORD height, LPWINDOWPOS wp)
break;
}
RECT UnmappedRect;
UnmappedRect=rect;
dwStyle=(*pGetWindowLong)(hwnd, GWL_STYLE);
hMenu = GetMenu(hwnd);
AdjustWindowRect(&rect, dwStyle, (hMenu!=NULL));
if (hMenu) CloseHandle(hMenu);
switch(dxw.Coordinates){
case DXW_DESKTOP_WORKAREA:
case DXW_DESKTOP_FULL:
// if there's a menu, reduce height to fit area
if(rect.top != UnmappedRect.top){
rect.bottom = rect.bottom - UnmappedRect.top + rect.top;
}
break;
default:
break;
}
// shift down-right so that the border is visible
// and also update the iPosX,iPosY upper-left coordinates of the client area

View File

@ -433,6 +433,7 @@ RECT dxwCore::MapWindowRect(LPRECT lpRect)
ClientRect.right=iRatioX;
ClientRect.bottom=iRatioY;
}
RetRect=ClientRect;
bx = by = 0;
if (dwFlags2 & KEEPASPECTRATIO){
@ -444,14 +445,16 @@ RECT dxwCore::MapWindowRect(LPRECT lpRect)
else {
by = (h - (w * iRatioY / iRatioX))/2;
}
OutTraceB("bx=%d by=%d\n", bx, by);
}
if(lpRect){
RetRect.left = (lpRect->left * ClientRect.right / dwScreenWidth) + bx;
RetRect.right = (lpRect->right * ClientRect.right / dwScreenWidth) - bx;
RetRect.top = (lpRect->top * ClientRect.bottom / dwScreenHeight) + by;
RetRect.bottom = (lpRect->bottom * ClientRect.bottom / dwScreenHeight) - by;
if(lpRect){ // v2.02.41 - fixed coordinates for KEEPASPECTRATIO option
LONG Width, Height;
Width = ClientRect.right - (2*bx);
Height = ClientRect.bottom - (2*by);
RetRect.left = bx + (lpRect->left * Width / dwScreenWidth);
RetRect.right = bx + (lpRect->right * Width / dwScreenWidth);
RetRect.top = by + (lpRect->top * Height / dwScreenHeight);
RetRect.bottom = by + (lpRect->bottom * Height / dwScreenHeight);
}
else{
RetRect.left = ClientRect.left + bx;

Binary file not shown.

View File

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

Binary file not shown.

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Version="9.00"
Name="dxwnd"
ProjectGUID="{579E7FE7-2745-4100-A802-23511711FCDE}"
RootNamespace="dxwnd"
@ -220,6 +220,10 @@
RelativePath=".\advapi.cpp"
>
</File>
<File
RelativePath=".\ddproxy.cpp"
>
</File>
<File
RelativePath=".\ddraw.cpp"
>
@ -352,10 +356,6 @@
RelativePath=".\hd3d7.cpp"
>
</File>
<File
RelativePath=".\hddproxy.cpp"
>
</File>
<File
RelativePath=".\imelib.cpp"
>
@ -401,6 +401,10 @@
Name="Header Files"
Filter="h;hpp;hxx;hm;inl"
>
<File
RelativePath=".\ddproxy.h"
>
</File>
<File
RelativePath=".\dxhelper.h"
>
@ -421,10 +425,6 @@
RelativePath=".\glhook.h"
>
</File>
<File
RelativePath=".\hddproxy.h"
>
</File>
<File
RelativePath=".\hddraw.h"
>

View File

@ -317,22 +317,22 @@ int WINAPI extGetDeviceCaps(HDC hdc, int nindex)
DWORD res;
res = (*pGDIGetDeviceCaps)(hdc, nindex);
OutTraceD("GetDeviceCaps: hdc=%x index=%x(%s) res=%x\n",
hdc, nindex, ExplainDeviceCaps(nindex), res);
#ifdef GDIEMULATIONONLY
switch(nindex){
case VERTRES:
res= dxw.GetScreenHeight();
OutTraceD("GetDeviceCaps: fix(0) VERTRES cap=%d\n", res);
break;
case HORZRES:
res= dxw.GetScreenWidth();
OutTraceD("GetDeviceCaps: fix(0) HORZRES cap=%d\n", res);
break;
if(IsTraceD){
OutTrace("GetDeviceCaps: hdc=%x index=%x(%s)", hdc, nindex, ExplainDeviceCaps(nindex));
switch(nindex){
case RASTERCAPS:
OutTrace(" res=0x%04x(%s)\n",res, ExplainRasterCaps(res)); break;
case BITSPIXEL:
case COLORRES:
case VERTRES:
case SIZEPALETTE:
case NUMRESERVED:
OutTrace(" res=%d\n",res); break;
default:
OutTrace(" res=0x%04x\n",res); break;
}
}
return res;
#endif
// if you have a bypassed setting, use it first!
if(pSetDevMode){
@ -387,8 +387,8 @@ int WINAPI extGetDeviceCaps(HDC hdc, int nindex)
switch(nindex){
case RASTERCAPS:
if((dxw.VirtualPixelFormat.dwRGBBitCount==8) || (dxw.dwFlags2 & INIT8BPP)){
res = RC_PALETTE;
OutTraceD("GetDeviceCaps: fix(3) RASTERCAPS setting RC_PALETTE cap=%x\n",res);
res |= RC_PALETTE;
OutTraceD("GetDeviceCaps: fix(3) RASTERCAPS setting RC_PALETTE cap=%x(%s)\n", res, ExplainRasterCaps(res));
}
break;
case BITSPIXEL:

View File

@ -9,8 +9,8 @@
// exported API
DWORD gD3DVersion; // quick & dirty ....
#undef OutTraceD
#define OutTraceD OutTrace
//#undef OutTraceD
//#define OutTraceD OutTrace
typedef HRESULT (WINAPI *Direct3DCreateDevice_Type)(GUID FAR *, LPDIRECT3D, LPDIRECTDRAWSURFACE, LPDIRECT3D *, LPUNKNOWN);
typedef HRESULT (WINAPI *Direct3DCreate_Type)(UINT, LPDIRECT3D *, LPUNKNOWN);
@ -297,19 +297,21 @@ typedef struct {
static void DumpD3DDevideDesc(LPD3DDEVICEDESC d3, char *label)
{
OutTraceD("EnumDevices: CALLBACK dev=%s Size=%d Flags=%x ", label, d3->dwSize, d3->dwFlags);
if(d3->dwFlags & D3DDD_COLORMODEL) OutTraceD("ColorModel=%x ", d3->dcmColorModel);
if(d3->dwFlags & D3DDD_DEVCAPS) OutTraceD("DevCaps=%x ", d3->dwDevCaps);
if(d3->dwFlags & D3DDD_TRANSFORMCAPS) OutTraceD("TransformCaps=%x ", d3->dtcTransformCaps.dwCaps);
if(d3->dwFlags & D3DDD_LIGHTINGCAPS) OutTraceD("LightingCaps=%x ", d3->dlcLightingCaps);
if(d3->dwFlags & D3DDD_BCLIPPING) OutTraceD("Clipping=%x ", d3->bClipping);
if(d3->dwFlags & D3DDD_LINECAPS) OutTraceD("LineCaps=%x ", d3->dpcLineCaps);
if(d3->dwFlags & D3DDD_TRICAPS) OutTraceD("TriCaps=%x ", d3->dpcTriCaps);
if(d3->dwFlags & D3DDD_DEVICERENDERBITDEPTH) OutTraceD("DeviceRenderBitDepth=%d ", d3->dwDeviceRenderBitDepth);
if(d3->dwFlags & D3DDD_DEVICEZBUFFERBITDEPTH) OutTraceD("DeviceZBufferBitDepth=%d ", d3->dwDeviceZBufferBitDepth);
if(d3->dwFlags & D3DDD_MAXBUFFERSIZE) OutTraceD("MaxBufferSize=%d ", d3->dwMaxBufferSize);
if(d3->dwFlags & D3DDD_MAXVERTEXCOUNT) OutTraceD("MaxVertexCount=%d ", d3->dwMaxVertexCount);
OutTraceD("\n");
if(IsTraceD){
OutTrace("EnumDevices: CALLBACK dev=%s Size=%d Flags=%x ", label, d3->dwSize, d3->dwFlags);
if(d3->dwFlags & D3DDD_COLORMODEL) OutTrace("ColorModel=%x ", d3->dcmColorModel);
if(d3->dwFlags & D3DDD_DEVCAPS) OutTrace("DevCaps=%x ", d3->dwDevCaps);
if(d3->dwFlags & D3DDD_TRANSFORMCAPS) OutTrace("TransformCaps=%x ", d3->dtcTransformCaps.dwCaps);
if(d3->dwFlags & D3DDD_LIGHTINGCAPS) OutTrace("LightingCaps=%x ", d3->dlcLightingCaps);
if(d3->dwFlags & D3DDD_BCLIPPING) OutTrace("Clipping=%x ", d3->bClipping);
if(d3->dwFlags & D3DDD_LINECAPS) OutTrace("LineCaps=%x ", d3->dpcLineCaps);
if(d3->dwFlags & D3DDD_TRICAPS) OutTrace("TriCaps=%x ", d3->dpcTriCaps);
if(d3->dwFlags & D3DDD_DEVICERENDERBITDEPTH) OutTrace("DeviceRenderBitDepth=%d ", d3->dwDeviceRenderBitDepth);
if(d3->dwFlags & D3DDD_DEVICEZBUFFERBITDEPTH) OutTrace("DeviceZBufferBitDepth=%d ", d3->dwDeviceZBufferBitDepth);
if(d3->dwFlags & D3DDD_MAXBUFFERSIZE) OutTrace("MaxBufferSize=%d ", d3->dwMaxBufferSize);
if(d3->dwFlags & D3DDD_MAXVERTEXCOUNT) OutTrace("MaxVertexCount=%d ", d3->dwMaxVertexCount);
OutTrace("\n");
}
}
HRESULT WINAPI extDeviceProxy(GUID FAR *lpGuid, LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPD3DDEVICEDESC lpd3ddd1, LPD3DDEVICEDESC lpd3ddd2, LPVOID arg)

View File

@ -4,7 +4,7 @@
#include "dxhook.h"
#include "dxhelper.h"
#include "hddraw.h"
#include "hddproxy.h"
#include "ddproxy.h"
static HookEntry_Type Hooks[]={
{"IsDebuggerPresent", (FARPROC)NULL, (FARPROC *)NULL, (FARPROC)extIsDebuggerPresent},
@ -48,6 +48,11 @@ static HookEntry_Type VersionHooks[]={
{0, NULL, 0, 0} // terminator
};
static HookEntry_Type SuppressChildHooks[]={
{"CreateProcessA", (FARPROC)NULL, (FARPROC *)NULL, (FARPROC)extCreateProcessA},
{0, NULL, 0, 0} // terminator
};
static char *libname = "kernel32.dll";
void HookKernel32(HMODULE module)
@ -57,6 +62,7 @@ void HookKernel32(HMODULE module)
if(dxw.dwFlags2 & LIMITRESOURCES) HookLibrary(module, LimitHooks, libname);
if(dxw.dwFlags2 & TIMESTRETCH) HookLibrary(module, TimeHooks, libname);
if(dxw.dwFlags2 & FAKEVERSION) HookLibrary(module, VersionHooks, libname);
if(dxw.dwFlags4 & SUPPRESSCHILD) HookLibrary(module, SuppressChildHooks, libname);
}
void HookKernel32Init()
@ -85,6 +91,9 @@ FARPROC Remap_kernel32_ProcAddress(LPCSTR proc, HMODULE hModule)
if(dxw.dwFlags2 & FAKEVERSION)
if (addr=RemapLibrary(proc, hModule, VersionHooks)) return addr;
if(dxw.dwFlags4 & SUPPRESSCHILD)
if (addr=RemapLibrary(proc, hModule, SuppressChildHooks)) return addr;
return NULL;
}
@ -675,3 +684,20 @@ DWORD WINAPI extSetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDista
}
return ret;
}
BOOL WINAPI extCreateProcessA(
LPCTSTR lpApplicationName,
LPTSTR lpCommandLine,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
DWORD dwCreationFlags,
LPVOID lpEnvironment,
LPCTSTR lpCurrentDirectory,
LPSTARTUPINFO lpStartupInfo,
LPPROCESS_INFORMATION lpProcessInformation
)
{
OutTraceD("CreateProcess: SUPPRESS ApplicationName=%s CommandLine=\"%s\"\n", lpApplicationName, lpCommandLine);
return TRUE;
}

View File

@ -473,6 +473,7 @@ extern DWORD WINAPI extSleepEx(DWORD, BOOL);
extern HANDLE WINAPI extCreateFile(LPCTSTR, DWORD, DWORD, LPSECURITY_ATTRIBUTES, DWORD, DWORD, HANDLE);
extern DWORD WINAPI extSetFilePointer(HANDLE, LONG, PLONG, DWORD);
extern BOOL WINAPI extCloseHandle(HANDLE);
extern BOOL WINAPI extCreateProcessA(LPCTSTR, LPTSTR, LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, BOOL, DWORD, LPVOID, LPCTSTR, LPSTARTUPINFO, LPPROCESS_INFORMATION);
// ole32.dll:
extern HRESULT STDAPICALLTYPE extCoCreateInstance(REFCLSID, LPUNKNOWN, DWORD, REFIID, LPVOID FAR*);

View File

@ -6,8 +6,8 @@
#include "MMSystem.h"
#undef OutTraceD
#define OutTraceD OutTrace
//#undef OutTraceD
//#define OutTraceD OutTrace
static HookEntry_Type Hooks[]={
{"mciSendCommandA", NULL, (FARPROC *)&pmciSendCommand, (FARPROC)extmciSendCommand},

View File

@ -1,139 +0,0 @@
// StatusDialog.cpp : implementation file
//
#include "stdafx.h"
#include "dxwndhost.h"
#include "PaletteDialog.h"
#include "bmpext.h"
// CPaletteDialog dialog
IMPLEMENT_DYNAMIC(CPaletteDialog, CDialog)
CPaletteDialog::CPaletteDialog(CWnd* pParent /*=NULL*/)
: CDialog(CPaletteDialog::IDD, pParent)
{
}
CPaletteDialog::~CPaletteDialog()
{
}
void CPaletteDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CPaletteDialog, CDialog)
ON_WM_TIMER()
END_MESSAGE_MAP()
#define IDPaletteTIMER 2
// CPaletteDialog message handlers
#if 0
void CPaletteDialog::OnTimer(UINT_PTR nIDEvent)
{
DXWNDSTATUS DxWndStatus;
int DxStatus;
TARGETMAP *Target;
CBitmap *cPal, *cMiniPal;
extern PRIVATEMAP *pTitles;
extern TARGETMAP *pTargets;
RECT Rect;
int h, w;
//CBitmap cMiniPal;
//cMiniPal.CreateCompatibleBitmap(this->GetDC(), 16, 16);
CWnd *Pix;
DxStatus=GetHookStatus(&DxWndStatus);
this->GetDC()->GetWindow()->GetWindowRect(&Rect);
h=Rect.bottom - Rect.top;
w=Rect.right - Rect.left;
cPal=(CBitmap *)this->GetDlgItem(IDC_PALETTECOLORS);
Pix=(CWnd *)this->GetDlgItem(IDC_PALETTEMAP);
if(DxStatus==DXW_RUNNING){
for(int row=0; row<16; row++)
for(int col=0; col<16; col++){
COLORREF color;
PALETTEENTRY *pe = &DxWndStatus.Palette[16*row+col];
//color=pe->peRed | (pe->peGreen << 8) | (pe->peBlue << 16);
color=RGB(pe->peRed, pe->peGreen, pe->peBlue);
//Pix->GetDC()->SetPixel(row, col, color);
//this->GetDC()->StretchBlt(0, 0, w, h, Pix->GetDC(), 0, 0, 16, 16, SRCCOPY);
this->GetDC()->SetPixel(row, col, color);
}
}
else
this->GetDC()->StretchBlt(0, 0, w, h, NULL, 0, 0, 0, 0, WHITENESS);
}
#else
void CPaletteDialog::OnTimer(UINT_PTR nIDEvent)
{
DXWNDSTATUS DxWndStatus;
int DxStatus;
extern PRIVATEMAP *pTitles;
extern TARGETMAP *pTargets;
RECT Rect;
int h, w;
CBitmap cBmp;
CBitmap* pBitmap;
CDC cMemDC;
cMemDC.CreateCompatibleDC(this->GetDC()); // Create the memory DC.
CBitmap* pOld = cMemDC.SelectObject(&cBmp);
pBitmap = cMemDC.SelectObject(pOld);
DxStatus=GetHookStatus(&DxWndStatus);
this->GetDC()->GetWindow()->GetWindowRect(&Rect);
h=Rect.bottom - Rect.top;
w=Rect.right - Rect.left;
CDib dib;
dib.ReadFromResource(IDB_PALETTE);
if(DxStatus==DXW_RUNNING){
for(int row=0; row<dib.Height(); row++){
for(int col=0; col<dib.Width(); col++){
PALETTEENTRY *pe = &DxWndStatus.Palette[16*row+col];
RGBQUAD rgbq;
rgbq.rgbBlue=pe->peBlue;
rgbq.rgbGreen=pe->peGreen;
rgbq.rgbRed=pe->peRed;
rgbq.rgbReserved=0;
dib.SetPixel(col, row, rgbq);
}
}
}
dib.Draw(this->GetDC(), CRect(0, 0, w, h), CRect(0, 0, 16, 16));
}
#endif
BOOL CPaletteDialog::OnInitDialog()
{
CDialog::OnInitDialog();
SetTimer(IDPaletteTIMER, 1000, NULL);
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CPaletteDialog::OnOK()
{
// TODO: Add your specialized code here and/or call the base class
KillTimer(IDPaletteTIMER);
// stop timer
CDialog::OnOK();
}

View File

@ -67,7 +67,6 @@
#define IDC_MAXX 1020
#define IDC_MAXY 1021
#define IDC_MAXFPS 1022
#define IDC_MODULE 1023
#define IDC_OPENGLLIB 1024
#define IDC_AUTOREFRESH 1025
#define IDC_FIXWINFRAME 1026
@ -188,6 +187,8 @@
#define IDC_NOGDIBLT 1141
#define IDC_NOPIXELFORMAT 1142
#define IDC_NOALPHACHANNEL 1143
#define IDC_SUPPRESSCHILD 1144
#define IDC_FIXREFCOUNTER 1145
#define ID_MODIFY 32771
#define ID_DELETE 32772
#define ID_ADD 32773

View File

@ -46,8 +46,6 @@ void CStatusDialog::OnTimer(UINT_PTR nIDEvent)
extern TARGETMAP *pTargets;
TARGETMAP *Target;
extern char *GetTSCaption(int);
int iPixelFormat;
PIXELFORMATDESCRIPTOR pfd;
CDialog::OnTimer(nIDEvent);
GetDllVersion(DllVersion);
@ -59,33 +57,21 @@ void CStatusDialog::OnTimer(UINT_PTR nIDEvent)
default: IconId=IDI_DXIDLE; Status="???"; break;
}
// get the current pixel format index
//HDC myDC = this->GetDC()->m_hDC;
//iPixelFormat = GetPixelFormat(myDC);
iPixelFormat = 1;
HDC myDC = ::GetDC(::GetForegroundWindow());
//iPixelFormat = ::GetPixelFormat(myDC);
// obtain a detailed description of that pixel format
memset((void *)&pfd, 0, sizeof(PIXELFORMATDESCRIPTOR));
pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);
DescribePixelFormat(myDC, iPixelFormat, sizeof(PIXELFORMATDESCRIPTOR), &pfd);
sprintf_s(sMsg, 1024,
"DxWnd %s\n"
"PixelFormat=%d DEPTH=%d RGBA=(%d,%d,%d,%d)\n"
"Hook status: %s",
DllVersion, iPixelFormat, pfd.cColorBits, pfd.cRedBits, pfd.cGreenBits, pfd.cBlueBits, pfd.cAlphaBits, Status);
DllVersion, Status);
if(DxStatus==DXW_RUNNING){
Target=&pTargets[DxWndStatus.TaskIdx];
sprintf_s(sMsg2, 1024,
"\nTask=%s\n"
"Screen = (%dx%d) Color BPP=%d\n"
"FullScreen = %s\nDX version = %d\n"
"Logging = %s\n"
"Cursor = (%d,%d)",
DllVersion, Status,
pTitles[DxWndStatus.TaskIdx].title,
DxWndStatus.Width, DxWndStatus.Height, DxWndStatus.ColorDepth,
DxWndStatus.IsFullScreen ? "Yes":"No", DxWndStatus.DXVersion,

View File

@ -42,6 +42,7 @@ void CTabDirectX::DoDataExchange(CDataExchange* pDX)
DDX_Check(pDX, IDC_COLORFIX, cTarget->m_ColorFix);
DDX_Check(pDX, IDC_NOPIXELFORMAT, cTarget->m_NoPixelFormat);
DDX_Check(pDX, IDC_NOALPHACHANNEL, cTarget->m_NoAlphaChannel);
DDX_Check(pDX, IDC_FIXREFCOUNTER, cTarget->m_FixRefCounter);
//DDX_Check(pDX, IDC_SAVECAPS, cTarget->m_SaveCaps);
// DirectInput
DDX_Check(pDX, IDC_HOOKDI, cTarget->m_HookDI);

View File

@ -29,7 +29,6 @@ void CTabProgram::DoDataExchange(CDataExchange* pDX)
DDX_Radio(pDX, IDC_COORDINATES, cTarget->m_Coordinates);
DDX_Control(pDX, IDC_FILE, cTarget->m_File);
DDX_Text(pDX, IDC_FILE, cTarget->m_FilePath);
DDX_Text(pDX, IDC_MODULE, cTarget->m_Module);
DDX_Text(pDX, IDC_TITLE, cTarget->m_Title);
DDX_Check(pDX, IDC_UNNOTIFY, cTarget->m_UnNotify);
DDX_Check(pDX, IDC_WINDOWIZE, cTarget->m_Windowize);
@ -45,6 +44,7 @@ void CTabProgram::DoDataExchange(CDataExchange* pDX)
DDX_Check(pDX, IDC_CLIENTREMAPPING, cTarget->m_ClientRemapping);
DDX_Check(pDX, IDC_SAVELOAD, cTarget->m_SaveLoad);
DDX_Check(pDX, IDC_HANDLEALTF4, cTarget->m_HandleAltF4);
DDX_Check(pDX, IDC_KEEPASPECTRATIO, cTarget->m_KeepAspectRatio);
DDX_Text(pDX, IDC_POSX, cTarget->m_PosX);
DDX_Text(pDX, IDC_POSY, cTarget->m_PosY);
DDX_Text(pDX, IDC_SIZX, cTarget->m_SizX);

View File

@ -34,7 +34,6 @@ void CTabWindow::DoDataExchange(CDataExchange* pDX)
DDX_Check(pDX, IDC_LOCKWINSTYLE, cTarget->m_LockWinStyle);
DDX_Check(pDX, IDC_FIXPARENTWIN, cTarget->m_FixParentWin);
DDX_Check(pDX, IDC_MODALSTYLE, cTarget->m_ModalStyle);
DDX_Check(pDX, IDC_KEEPASPECTRATIO, cTarget->m_KeepAspectRatio);
DDX_Check(pDX, IDC_FORCEWINRESIZE, cTarget->m_ForceWinResize);
DDX_Check(pDX, IDC_HIDEMULTIMONITOR, cTarget->m_HideMultiMonitor);
DDX_Check(pDX, IDC_WALLPAPERMODE, cTarget->m_WallpaperMode);
@ -42,6 +41,7 @@ void CTabWindow::DoDataExchange(CDataExchange* pDX)
DDX_Check(pDX, IDC_REFRESHONRESIZE, cTarget->m_RefreshOnResize);
DDX_Check(pDX, IDC_FIXD3DFRAME, cTarget->m_FixD3DFrame);
DDX_Check(pDX, IDC_NOWINDOWMOVE, cTarget->m_NoWindowMove);
DDX_Check(pDX, IDC_SUPPRESSCHILD, cTarget->m_SuppressChild);
}
BOOL CTabWindow::OnInitDialog()

View File

@ -42,6 +42,8 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/)
m_ColorFix = FALSE;
m_NoPixelFormat = FALSE;
m_NoAlphaChannel = FALSE;
m_FixRefCounter = TRUE;
m_SuppressChild = FALSE;
m_LockSysColors = FALSE;
m_ForceYUVtoRGB = FALSE;
m_ForceRGBtoYUV = FALSE;

View File

@ -122,6 +122,8 @@ public:
BOOL m_ColorFix;
BOOL m_NoPixelFormat;
BOOL m_NoAlphaChannel;
BOOL m_FixRefCounter;
BOOL m_SuppressChild;
BOOL m_LockSysColors;
BOOL m_SaveCaps;
BOOL m_SingleProcAffinity;

Binary file not shown.

View File

@ -244,13 +244,11 @@ IDD_TAB_PROGRAM DIALOGEX 0, 0, 300, 240
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
EDITTEXT IDC_TITLE,7,22,162,14,ES_AUTOHSCROLL
LTEXT "Name:",IDC_STATIC,7,9,77,9
EDITTEXT IDC_FILE,7,54,162,14,ES_AUTOHSCROLL
EDITTEXT IDC_MODULE,188,23,105,14,ES_AUTOHSCROLL | NOT WS_VISIBLE
LTEXT "Additional Hooked Modules:",IDC_STATIC,168,7,125,9,NOT WS_VISIBLE
LTEXT "Path:",IDC_STATIC,7,42,77,9
PUSHBUTTON "...",IDC_OPEN,176,53,13,16
EDITTEXT IDC_TITLE,39,13,162,14,ES_AUTOHSCROLL
LTEXT "Name:",IDC_STATIC,11,15,25,9
EDITTEXT IDC_FILE,39,31,162,14,ES_AUTOHSCROLL
LTEXT "Path:",IDC_STATIC,11,33,22,9
PUSHBUTTON "...",IDC_OPEN,207,31,12,14
LTEXT "Window initial position && size",IDC_STATIC,18,198,115,9
LTEXT "X",IDC_STATIC,18,214,9,9
LTEXT "Y",IDC_STATIC,49,214,9,9
@ -260,25 +258,27 @@ BEGIN
EDITTEXT IDC_POSY,55,210,19,14,ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT
EDITTEXT IDC_SIZX,85,210,19,14,ES_AUTOHSCROLL,WS_EX_RIGHT
EDITTEXT IDC_SIZY,113,210,19,14,ES_AUTOHSCROLL,WS_EX_RIGHT
CONTROL "Do not notify on task switch",IDC_UNNOTIFY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,102,124,10
CONTROL "Optimize CPU (DirectX1 - 7)",IDC_SAVELOAD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,138,109,10
CONTROL "Intercept Alt-F4 key",IDC_HANDLEALTF4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,114,109,10
CONTROL "Run in Window",IDC_WINDOWIZE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,126,124,10
GROUPBOX "Generic",IDC_STATIC,7,77,286,106
CONTROL "No banner",IDC_NOBANNER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,102,108,10
CONTROL "use DLL Injection",IDC_STARTDEBUG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,114,100,10
CONTROL "Remap Client Rect",IDC_CLIENTREMAPPING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,90,115,10
CONTROL "Hook all DLLs",IDC_HOOKDLLS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,138,124,10
CONTROL "Hook enabled",IDC_HOOKENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,90,124,10
CONTROL "Do not notify on task switch",IDC_UNNOTIFY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,81,124,10
CONTROL "Optimize CPU (DirectX1 - 7)",IDC_SAVELOAD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,117,109,10
CONTROL "Intercept Alt-F4 key",IDC_HANDLEALTF4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,93,109,10
CONTROL "Run in Window",IDC_WINDOWIZE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,105,124,10
GROUPBOX "Generic",IDC_STATIC,7,56,286,106
CONTROL "No banner",IDC_NOBANNER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,81,108,10
CONTROL "use DLL Injection",IDC_STARTDEBUG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,93,100,10
CONTROL "Remap Client Rect",IDC_CLIENTREMAPPING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,69,115,10
CONTROL "Hook all DLLs",IDC_HOOKDLLS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,117,124,10
CONTROL "Hook enabled",IDC_HOOKENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,69,124,10
CONTROL "X,Y coordinates",IDC_COORDINATES,"Button",BS_AUTORADIOBUTTON | WS_GROUP,170,190,95,10
CONTROL "Desktop center",IDC_DESKTOPCENTER,"Button",BS_AUTORADIOBUTTON,170,200,95,10
CONTROL "Desktop work area",IDC_DESKTOPWORKAREA,"Button",BS_AUTORADIOBUTTON,170,210,95,10
CONTROL "Desktop",IDC_DESKTOPFULL,"Button",BS_AUTORADIOBUTTON,170,220,95,10
CONTROL "Hook child WindowProc",IDC_HOOKCHILDWIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,126,104,10
CONTROL "Emulate Registry",IDC_EMULATEREGISTRY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,150,124,10
CONTROL "Fullscreen only",IDC_FULLSCREENONLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,150,114,10
CONTROL "Filter offending messages",IDC_FILTERMESSAGES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,162,114,10
CONTROL "Peek all messages in queue",IDC_PEEKALLMESSAGES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,162,114,10
CONTROL "Hook child WindowProc",IDC_HOOKCHILDWIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,105,104,10
CONTROL "Emulate Registry",IDC_EMULATEREGISTRY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,129,124,10
CONTROL "Fullscreen only",IDC_FULLSCREENONLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,129,114,10
CONTROL "Filter offending messages",IDC_FILTERMESSAGES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,141,114,10
CONTROL "Peek all messages in queue",IDC_PEEKALLMESSAGES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,141,114,10
GROUPBOX "Position",IDC_STATIC,7,168,286,66
CONTROL "Keep aspect ratio",IDC_KEEPASPECTRATIO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,179,115,10
END
IDD_TAB_LOG DIALOGEX 0, 0, 300, 240
@ -314,9 +314,9 @@ BEGIN
CONTROL "Locked Surface",IDC_LOCKEDSURFACE,"Button",BS_AUTORADIOBUTTON,14,144,67,12
CONTROL "Primary Surface",IDC_EMULATESURFACE,"Button",BS_AUTORADIOBUTTON,14,156,77,12
GROUPBOX "DirectX Version Hook",IDC_STATIC,6,3,98,103,WS_GROUP
GROUPBOX "Emulation",IDC_STATIC,7,109,98,66,WS_GROUP
GROUPBOX "Emulation",IDC_STATIC,7,109,98,80,WS_GROUP
CONTROL "Auto Primary Surface Refresh",IDC_AUTOREFRESH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,16,126,9
GROUPBOX "DirectDraw Surface handling",IDC_STATIC,112,3,181,173
GROUPBOX "DirectDraw Surface handling",IDC_STATIC,112,3,181,186
CONTROL "switch VIDEO to SYSTEM on fail",IDC_VIDEOTOSYSTEMMEM,
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,118,28,126,9
CONTROL "Suppress DX common errors",IDC_SUPPRESSDXERRORS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,40,127,10
@ -324,22 +324,22 @@ BEGIN
CONTROL "Blit from BackBuffer",IDC_BLITFROMBACKBUFFER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,64,119,10
CONTROL "Suppress clipping",IDC_SUPPRESSCLIPPING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,76,119,10
CONTROL "Palette update don't Blit",IDC_NOPALETTEUPDATE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,88,119,10
LTEXT "DirectInput initial coord. and X,Y range",IDC_STATIC,19,197,146,9
LTEXT "X",IDC_STATIC,13,212,9,9
LTEXT "Y",IDC_STATIC,40,212,9,9
LTEXT "(",IDC_STATIC,69,212,9,9
LTEXT ",",IDC_STATIC,92,212,9,9
LTEXT ")-(",IDC_STATIC,114,212,11,9
LTEXT ",",IDC_STATIC,144,212,9,9
LTEXT ")",IDC_STATIC,166,212,9,9
EDITTEXT IDC_INITX,20,209,17,14,ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT
EDITTEXT IDC_INITY,46,209,17,14,ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT
EDITTEXT IDC_MINX,72,209,17,14,ES_AUTOHSCROLL,WS_EX_RIGHT
EDITTEXT IDC_MINY,97,209,17,14,ES_AUTOHSCROLL,WS_EX_RIGHT
EDITTEXT IDC_MAXX,124,209,17,14,ES_AUTOHSCROLL,WS_EX_RIGHT
EDITTEXT IDC_MAXY,148,209,17,14,ES_AUTOHSCROLL,WS_EX_RIGHT
CONTROL "DirectInput Hooking",IDC_HOOKDI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,183,210,97,12
GROUPBOX "DirectInput",IDC_STATIC,7,176,286,57
LTEXT "DirectInput initial coord. and X,Y range",IDC_STATIC,19,201,146,9
LTEXT "X",IDC_STATIC,13,216,9,9
LTEXT "Y",IDC_STATIC,40,216,9,9
LTEXT "(",IDC_STATIC,69,216,9,9
LTEXT ",",IDC_STATIC,92,216,9,9
LTEXT ")-(",IDC_STATIC,114,216,11,9
LTEXT ",",IDC_STATIC,144,216,9,9
LTEXT ")",IDC_STATIC,166,216,9,9
EDITTEXT IDC_INITX,20,213,17,14,ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT
EDITTEXT IDC_INITY,46,213,17,14,ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT
EDITTEXT IDC_MINX,72,213,17,14,ES_AUTOHSCROLL,WS_EX_RIGHT
EDITTEXT IDC_MINY,97,213,17,14,ES_AUTOHSCROLL,WS_EX_RIGHT
EDITTEXT IDC_MAXX,124,213,17,14,ES_AUTOHSCROLL,WS_EX_RIGHT
EDITTEXT IDC_MAXY,148,213,17,14,ES_AUTOHSCROLL,WS_EX_RIGHT
CONTROL "DirectInput Hooking",IDC_HOOKDI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,183,214,97,12
GROUPBOX "DirectInput",IDC_STATIC,7,189,286,44
CONTROL "Set AERO compatible mode",IDC_SETCOMPATIBILITY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,100,109,12
CONTROL "Disable HAL support",IDC_DISABLEHAL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,112,109,12
CONTROL "Forces HEL ",IDC_FORCESHEL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,124,109,12
@ -347,6 +347,7 @@ BEGIN
CONTROL "Don't fix the Pixel Format",IDC_NOPIXELFORMAT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,148,109,12
CONTROL "by default set no ALPHACHANNEL",IDC_NOALPHACHANNEL,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,160,123,12
CONTROL "Fix ddraw ref counter",IDC_FIXREFCOUNTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,172,123,12
END
IDD_TAB_MOUSE DIALOGEX 0, 0, 300, 240
@ -396,12 +397,13 @@ BEGIN
CONTROL "Lock win style",IDC_LOCKWINSTYLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,52,115,10
CONTROL "Fix Parent Window",IDC_FIXPARENTWIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,88,115,10
CONTROL "Modal Style",IDC_MODALSTYLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,100,115,10
CONTROL "Keep aspect ratio",IDC_KEEPASPECTRATIO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,112,115,10
CONTROL "Force win resize",IDC_FORCEWINRESIZE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,124,115,10
CONTROL "Hide multi-monitor config.",IDC_HIDEMULTIMONITOR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,136,115,10
CONTROL "Wallpaper mode",IDC_WALLPAPERMODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,148,115,10
CONTROL "Fix Windows Frame in D3D",IDC_FIXD3DFRAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,160,115,10
CONTROL "Force win resize",IDC_FORCEWINRESIZE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,112,115,10
CONTROL "Hide multi-monitor config.",IDC_HIDEMULTIMONITOR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,124,115,10
CONTROL "Wallpaper mode",IDC_WALLPAPERMODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,136,115,10
CONTROL "Fix Windows Frame in D3D",IDC_FIXD3DFRAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,148,115,10
CONTROL "Don't move D3D rendering window",IDC_NOWINDOWMOVE,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,160,125,10
CONTROL "Suppress child process creation",IDC_SUPPRESSCHILD,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,172,125,10
END

Binary file not shown.

View File

@ -162,6 +162,8 @@ static void SetTargetFromDlg(TARGETMAP *t, CTargetDlg *dlg)
if(dlg->m_ColorFix) t->flags3 |= COLORFIX;
if(dlg->m_NoPixelFormat) t->flags3 |= NOPIXELFORMAT;
if(dlg->m_NoAlphaChannel) t->flags4 |= NOALPHACHANNEL;
if(dlg->m_FixRefCounter) t->flags4 |= FIXREFCOUNTER;
if(dlg->m_SuppressChild) t->flags4 |= SUPPRESSCHILD;
if(dlg->m_LockSysColors) t->flags3 |= LOCKSYSCOLORS;
if(dlg->m_ForceYUVtoRGB) t->flags3 |= YUV2RGB;
if(dlg->m_ForceRGBtoYUV) t->flags3 |= RGB2YUV;
@ -294,6 +296,8 @@ static void SetDlgFromTarget(TARGETMAP *t, CTargetDlg *dlg)
dlg->m_ColorFix = t->flags3 & COLORFIX ? 1 : 0;
dlg->m_NoPixelFormat = t->flags3 & NOPIXELFORMAT ? 1 : 0;
dlg->m_NoAlphaChannel = t->flags4 & NOALPHACHANNEL ? 1 : 0;
dlg->m_FixRefCounter = t->flags4 & FIXREFCOUNTER ? 1 : 0;
dlg->m_SuppressChild = t->flags4 & SUPPRESSCHILD ? 1 : 0;
dlg->m_LockSysColors = t->flags3 & LOCKSYSCOLORS ? 1 : 0;
dlg->m_ForceRGBtoYUV = t->flags3 & RGB2YUV ? 1 : 0;
dlg->m_ForceYUVtoRGB = t->flags3 & YUV2RGB ? 1 : 0;