mirror of
https://github.com/DxWnd/DxWnd.reloaded
synced 2024-12-30 09:25:35 +01:00
v2_04_08_src_fx1
Former-commit-id: eca03ce516319410cb1425bcca860a897f859006
This commit is contained in:
parent
4ebc06ad71
commit
a8a8f52868
@ -270,6 +270,8 @@
|
||||
#define MARKGDI32 0x00040000 // Marks (highlights with colored frames) the main GDI32 operations
|
||||
#define DUMPDIBSECTION 0x00080000 // dumps DIBs to BMP files for debugging purposes
|
||||
#define DUMPDEVCONTEXT 0x00100000 // dumps source HDC to BMP files for debugging purposes
|
||||
#define QUALITYFONTS 0x00200000 // Forces adoption of high quality fonts (CLEARTYPE_NATURAL_QUALITY)
|
||||
#define ALLOWSYSMEMON3DDEV 0x00400000 // Suppress DDSCAPS_SYSTEMMEMORY option when DDSCAPS_3DDEVICE is set
|
||||
|
||||
// logging Tflags DWORD:
|
||||
#define OUTTRACE 0x00000001 // enables tracing to dxwnd.log in general
|
||||
|
1
Release/.gitattributes
vendored
Normal file
1
Release/.gitattributes
vendored
Normal file
@ -0,0 +1 @@
|
||||
*.{dll,exe} filter=lfs diff=lfs merge=lfs -text
|
3
Release/dxwnd.dll
Normal file
3
Release/dxwnd.dll
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:941f77bf133938a99ebdcbea0c35f2f33248ac7c1d4e7d5fe9d799ce470b433d
|
||||
size 782336
|
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:03d7a189e3b95c69545b045eeef01fffafe7178f6c0892f1fa1d61eb810faa5c
|
||||
size 780800
|
||||
oid sha256:941f77bf133938a99ebdcbea0c35f2f33248ac7c1d4e7d5fe9d799ce470b433d
|
||||
size 782336
|
||||
|
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fdef6f8a6645074858924bffbe81e345ebafda4269521681fcad76f50d14a589
|
||||
size 673280
|
||||
oid sha256:743ed4e87aa9d02d8b85936799f99eb83bab948207f13d1a98497644ddd27b20
|
||||
size 673792
|
||||
|
@ -9,7 +9,7 @@ ver0=1
|
||||
coord0=0
|
||||
flag0=685899810
|
||||
flagg0=1207959680
|
||||
flagh0=20
|
||||
flagh0=8212
|
||||
flagi0=138412036
|
||||
flagj0=4224
|
||||
flagk0=131072
|
||||
@ -29,3 +29,14 @@ initts0=0
|
||||
winver0=0
|
||||
maxres0=-1
|
||||
swapeffect0=0
|
||||
startfolder0=
|
||||
registry0=
|
||||
monitorid0=0
|
||||
flagl0=0
|
||||
flagm0=0
|
||||
dflag0=0
|
||||
maxddinterface0=7
|
||||
slowratio0=1
|
||||
scanline0=1
|
||||
initresw0=0
|
||||
initresh0=0
|
||||
|
@ -4,14 +4,14 @@ path0=D:\Games\Tomb Raider III\tomb3.exe
|
||||
launchpath0=
|
||||
module0=
|
||||
opengllib0=
|
||||
notes0=
|
||||
notes0=Working either with or without flip emulation\nDeinterlace movies increases the movie quality
|
||||
ver0=0
|
||||
coord0=0
|
||||
flag0=134217762
|
||||
flagg0=1241513984
|
||||
flagh0=20
|
||||
flagi0=4194304
|
||||
flagj0=128
|
||||
flagj0=268435584
|
||||
flagk0=0
|
||||
tflag0=0
|
||||
initx0=0
|
||||
@ -29,3 +29,14 @@ initts0=0
|
||||
winver0=0
|
||||
maxres0=0
|
||||
swapeffect0=0
|
||||
startfolder0=
|
||||
registry0=
|
||||
monitorid0=0
|
||||
flagl0=0
|
||||
flagm0=0
|
||||
dflag0=0
|
||||
maxddinterface0=7
|
||||
slowratio0=1
|
||||
scanline0=1
|
||||
initresw0=0
|
||||
initresh0=0
|
||||
|
36
build/exports/Warhammer - Shadow of the Horned Rat (x2).dxw
Normal file
36
build/exports/Warhammer - Shadow of the Horned Rat (x2).dxw
Normal file
@ -0,0 +1,36 @@
|
||||
[target]
|
||||
title0=Warhammer - Shadow of the Horned Rat (x2)
|
||||
path0=D:\Games\Warhammer - Shadow of the Horned Rat\WHSHR.EXE
|
||||
startfolder0=
|
||||
launchpath0=
|
||||
module0=GAMEF.DLL
|
||||
opengllib0=
|
||||
notes0=Game setup:\n\n1) unzip packed game RIP\n2) copy RLDDF.DLL from SYSTEM32 subfolder to game dir\n3) copy DxWnd wing32.dll to game dir\n4) turn digital audio OFF or add sound WAV file (it is hardcoded in virtual registry!)\nor copy wav files in \Remote\Binary\GLUE\SPEECH folder\n
|
||||
registry0=\n[HKEY_LOCAL_MACHINE\SOFTWARE]\n\n[HKEY_LOCAL_MACHINE\SOFTWARE\Mindscape]\n\n[HKEY_LOCAL_MACHINE\SOFTWARE\Mindscape\WarHammerFB]\n;"Options"="3,1,1,2,1,1,0,0" // High Quality, digital audio off\n"Options"="3,1,1,2,1,1,1,1" // High Quality, digital audio on\n\n[HKEY_LOCAL_MACHINE\SOFTWARE\Mindscape\WarHammerFB\InstallDir]\n@="\{path}"\n\n[HKEY_LOCAL_MACHINE\SOFTWARE\Mindscape\WarHammerFB\InstallOption]\n@="Maximum"\n\n[HKEY_LOCAL_MACHINE\SOFTWARE\Mindscape\WarHammerFB\Language]\n@="ENG"\n\n[HKEY_LOCAL_MACHINE\SOFTWARE\Mindscape\WarHammerFB\LocalDir]\n@="\{path}\\FILE"\n\n[HKEY_LOCAL_MACHINE\SOFTWARE\Mindscape\WarHammerFB\RemoteDir]\n@="\{path}\\REMOTE"\n\n[HKEY_LOCAL_MACHINE\SOFTWARE\Mindscape\WarHammerFB\SaveDir]\n@="\{path}\\TEMP"\n\n[HKEY_LOCAL_MACHINE\SOFTWARE\Mindscape\WarHammerFB\UpdateDir]\n@="C:\\GAMES\\WARFB\\Update"\n\n[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\SharedDLLs]\n"C:\\WINDOWS\\SYSTEM32\\WING.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\WING32.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\WINGDE.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\WINGDIB.DRV"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\WINGPAL.WND"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\RLDDF.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\RLDDI.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\RL\\SOFTF.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\RL\\SOFTI.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLFRG16M.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLFRG256.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLFRG64K.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLFRM16M.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLFRM256.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLFRM64K.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLIRG16M.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLIRG256.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLIRG64K.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLIRM16M.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLIRM256.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLIRM64K.DLL"=hex:01,00,00,00
|
||||
ver0=0
|
||||
monitorid0=-1
|
||||
coord0=1
|
||||
flag0=-1473609686
|
||||
flagg0=1209270312
|
||||
flagh0=2163732
|
||||
flagi0=1212153860
|
||||
flagj0=5248
|
||||
flagk0=2195456
|
||||
flagl0=67141648
|
||||
flagm0=2105344
|
||||
tflag0=0
|
||||
dflag0=0
|
||||
posx0=50
|
||||
posy0=50
|
||||
sizx0=1280
|
||||
sizy0=960
|
||||
maxfps0=0
|
||||
initts0=0
|
||||
winver0=0
|
||||
maxres0=0
|
||||
swapeffect0=0
|
||||
maxddinterface0=7
|
||||
slowratio0=2
|
||||
scanline0=0
|
||||
initresw0=800
|
||||
initresh0=600
|
36
build/exports/Warhammer - Shadow of the Horned Rat.dxw
Normal file
36
build/exports/Warhammer - Shadow of the Horned Rat.dxw
Normal file
@ -0,0 +1,36 @@
|
||||
[target]
|
||||
title0=Warhammer - Shadow of the Horned Rat
|
||||
path0=D:\Games\Warhammer - Shadow of the Horned Rat\WHSHR.EXE
|
||||
startfolder0=
|
||||
launchpath0=
|
||||
module0=GAMEF.DLL
|
||||
opengllib0=
|
||||
notes0=Game setup:\n\n1) unzip packed game RIP\n2) copy RLDDF.DLL from SYSTEM32 subfolder to game dir\n3) copy DxWnd wing32.dll to game dir\n4) turn digital audio OFF or add sound WAV file (it is hardcoded in virtual registry!)\nor copy wav files in \Remote\Binary\GLUE\SPEECH folder\n
|
||||
registry0=\n[HKEY_LOCAL_MACHINE\SOFTWARE]\n\n[HKEY_LOCAL_MACHINE\SOFTWARE\Mindscape]\n\n[HKEY_LOCAL_MACHINE\SOFTWARE\Mindscape\WarHammerFB]\n;"Options"="3,1,1,2,1,1,0,0" // High Quality, digital audio off\n"Options"="3,1,1,2,1,1,1,1" // High Quality, digital audio on\n\n[HKEY_LOCAL_MACHINE\SOFTWARE\Mindscape\WarHammerFB\InstallDir]\n@="\{path}"\n\n[HKEY_LOCAL_MACHINE\SOFTWARE\Mindscape\WarHammerFB\InstallOption]\n@="Maximum"\n\n[HKEY_LOCAL_MACHINE\SOFTWARE\Mindscape\WarHammerFB\Language]\n@="ENG"\n\n[HKEY_LOCAL_MACHINE\SOFTWARE\Mindscape\WarHammerFB\LocalDir]\n@="\{path}\\FILE"\n\n[HKEY_LOCAL_MACHINE\SOFTWARE\Mindscape\WarHammerFB\RemoteDir]\n@="\{path}\\REMOTE"\n\n[HKEY_LOCAL_MACHINE\SOFTWARE\Mindscape\WarHammerFB\SaveDir]\n@="\{path}\\TEMP"\n\n[HKEY_LOCAL_MACHINE\SOFTWARE\Mindscape\WarHammerFB\UpdateDir]\n@="C:\\GAMES\\WARFB\\Update"\n\n[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\SharedDLLs]\n"C:\\WINDOWS\\SYSTEM32\\WING.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\WING32.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\WINGDE.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\WINGDIB.DRV"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\WINGPAL.WND"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\RLDDF.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\RLDDI.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\RL\\SOFTF.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\RL\\SOFTI.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLFRG16M.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLFRG256.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLFRG64K.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLFRM16M.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLFRM256.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLFRM64K.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLIRG16M.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLIRG256.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLIRG64K.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLIRM16M.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLIRM256.DLL"=hex:01,00,00,00\n"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLIRM64K.DLL"=hex:01,00,00,00
|
||||
ver0=0
|
||||
monitorid0=-1
|
||||
coord0=0
|
||||
flag0=-1473609686
|
||||
flagg0=1209270312
|
||||
flagh0=2163732
|
||||
flagi0=1212153860
|
||||
flagj0=4224
|
||||
flagk0=2195456
|
||||
flagl0=67141648
|
||||
flagm0=2105344
|
||||
tflag0=0
|
||||
dflag0=0
|
||||
posx0=50
|
||||
posy0=50
|
||||
sizx0=800
|
||||
sizy0=600
|
||||
maxfps0=0
|
||||
initts0=0
|
||||
winver0=0
|
||||
maxres0=0
|
||||
swapeffect0=0
|
||||
maxddinterface0=7
|
||||
slowratio0=2
|
||||
scanline0=0
|
||||
initresw0=800
|
||||
initresh0=600
|
52
build/exports/dxwnd.reg
Normal file
52
build/exports/dxwnd.reg
Normal file
@ -0,0 +1,52 @@
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE]
|
||||
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Mindscape]
|
||||
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Mindscape\WarHammerFB]
|
||||
;"Options"="1,1,1,1,1,2,1,1" // digital audio on
|
||||
"Options"="1,1,1,1,1,2,0,0" // digital audio off
|
||||
;"Options"="0,0,0,0,0,0,0,0" //all off
|
||||
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Mindscape\WarHammerFB\InstallDir]
|
||||
@="\{path}"
|
||||
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Mindscape\WarHammerFB\InstallOption]
|
||||
@="Maximum"
|
||||
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Mindscape\WarHammerFB\Language]
|
||||
@="ENG"
|
||||
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Mindscape\WarHammerFB\LocalDir]
|
||||
@="\{path}\\FILE"
|
||||
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Mindscape\WarHammerFB\RemoteDir]
|
||||
@="\{path}\\REMOTE"
|
||||
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Mindscape\WarHammerFB\SaveDir]
|
||||
@="\{path}\\TEMP"
|
||||
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Mindscape\WarHammerFB\UpdateDir]
|
||||
@="C:\\GAMES\\WARFB\\Update"
|
||||
|
||||
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\SharedDLLs]
|
||||
"C:\\WINDOWS\\SYSTEM32\\WING.DLL"=hex:01,00,00,00
|
||||
"C:\\WINDOWS\\SYSTEM32\\WING32.DLL"=hex:01,00,00,00
|
||||
"C:\\WINDOWS\\SYSTEM32\\WINGDE.DLL"=hex:01,00,00,00
|
||||
"C:\\WINDOWS\\SYSTEM32\\WINGDIB.DRV"=hex:01,00,00,00
|
||||
"C:\\WINDOWS\\SYSTEM32\\WINGPAL.WND"=hex:01,00,00,00
|
||||
"C:\\WINDOWS\\SYSTEM32\\RLDDF.DLL"=hex:01,00,00,00
|
||||
"C:\\WINDOWS\\SYSTEM32\\RLDDI.DLL"=hex:01,00,00,00
|
||||
"C:\\WINDOWS\\SYSTEM32\\RL\\SOFTF.DLL"=hex:01,00,00,00
|
||||
"C:\\WINDOWS\\SYSTEM32\\RL\\SOFTI.DLL"=hex:01,00,00,00
|
||||
"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLFRG16M.DLL"=hex:01,00,00,00
|
||||
"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLFRG256.DLL"=hex:01,00,00,00
|
||||
"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLFRG64K.DLL"=hex:01,00,00,00
|
||||
"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLFRM16M.DLL"=hex:01,00,00,00
|
||||
"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLFRM256.DLL"=hex:01,00,00,00
|
||||
"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLFRM64K.DLL"=hex:01,00,00,00
|
||||
"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLIRG16M.DLL"=hex:01,00,00,00
|
||||
"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLIRG256.DLL"=hex:01,00,00,00
|
||||
"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLIRG64K.DLL"=hex:01,00,00,00
|
||||
"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLIRM16M.DLL"=hex:01,00,00,00
|
||||
"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLIRM256.DLL"=hex:01,00,00,00
|
||||
"C:\\WINDOWS\\SYSTEM32\\RL\\SOFT\\RLIRM64K.DLL"=hex:01,00,00,00
|
@ -1473,4 +1473,16 @@ fix: DialogBoxParamA wrapper
|
||||
v2.04.07
|
||||
fix: QueryInterface wrapper for ddraw classes unified in a single procedure.
|
||||
fix: D3D2 SwapTextureHandles hook fix - fixes "Wizardry Chronicle" texture problems
|
||||
fix: string overflow in TextureHack procedure for D3D1-7 textures
|
||||
fix: string overflow in TextureHack procedure for D3D1-7 textures
|
||||
|
||||
v2.04.08/fx1
|
||||
fix: improved DIB dumping & logging: fixed BMP header with negative size, dump only when DIB has attached image
|
||||
fix: safe CreateWindow mode, preserves original size & position within win creation. Fixes "Warhammer SotHR"
|
||||
blitting problems
|
||||
fix: virtual registry file created by GUI and not extracted by the dll. Ths avoids getting the first matching entry.
|
||||
fix: "Scale font parameters" fully revised, also renamed to "Scale font size"
|
||||
add: "High quality fonts" flag to force antialiasing font style
|
||||
fix: ddraw surface capability regression for emulated backbuffer: fixes "Dominant Species" textures in SW mode
|
||||
fix: ddraw surface capability regression for direct primary/backbuffer: should fix "Tomb raider 3" in HW mode
|
||||
fix: ddraw surface capability regression for zbuffer: fixes "Toca Touring Car" in SW mode
|
||||
fix: in fx1, bug crashing app when querying unknown interfaces!
|
||||
|
@ -182,48 +182,10 @@ static FILE *OpenFakeRegistry()
|
||||
DWORD dwAttrib;
|
||||
char sSourcePath[MAX_PATH+1];
|
||||
char *p;
|
||||
static BOOL LoadFromConfig = TRUE;
|
||||
dwAttrib = GetFileAttributes("dxwnd.dll");
|
||||
if (dwAttrib != INVALID_FILE_ATTRIBUTES && !(dwAttrib & FILE_ATTRIBUTE_DIRECTORY)) return NULL;
|
||||
GetModuleFileName(GetModuleHandle("dxwnd"), sSourcePath, MAX_PATH);
|
||||
p=&sSourcePath[strlen(sSourcePath)-strlen("dxwnd.dll")];
|
||||
if(LoadFromConfig){
|
||||
int Index;
|
||||
char key[81];
|
||||
char name[MAX_PATH+1];
|
||||
char exepath[MAX_PATH+1];
|
||||
strcpy(p, "dxwnd.ini");
|
||||
GetModuleFileName(0, name, MAX_PATH);
|
||||
//for(int i = 0; name[i]; i ++) name[i] = tolower(name[i]);
|
||||
for(Index=0; Index<MAXTARGETS; Index++){
|
||||
DWORD flags3;
|
||||
sprintf_s(key, sizeof(key), "path%i", Index);
|
||||
GetPrivateProfileString("target", key, "", exepath, MAX_PATH, sSourcePath);
|
||||
sprintf_s(key, sizeof(key), "flagh%i", Index);
|
||||
flags3 = GetPrivateProfileInt("target", key, 0, sSourcePath);
|
||||
if(!_stricmp(exepath, name) && (flags3 & HOOKENABLED)) break; // got it!
|
||||
}
|
||||
if(Index < MAXTARGETS){
|
||||
FILE *freg;
|
||||
char *RegBuf;
|
||||
RegBuf = (char *)malloc(1000000+1); // 1MB!!
|
||||
OutTrace("Fake registry: build virtual registry from dxwnd.ini entry #%d\n", Index);
|
||||
sprintf_s(key, sizeof(key), "registry%i", Index);
|
||||
GetPrivateProfileString("target", key, "", RegBuf, 1000000, sSourcePath);
|
||||
if(strlen(RegBuf)>0){
|
||||
char *FileBuf = NULL;
|
||||
Unescape(RegBuf, &FileBuf);
|
||||
strcpy(p, "dxwnd.reg");
|
||||
freg = fopen(sSourcePath,"w");
|
||||
fwrite(FileBuf, 1, strlen(FileBuf), freg);
|
||||
fputs("\n", freg);
|
||||
fclose(freg);
|
||||
free(FileBuf);
|
||||
}
|
||||
free(RegBuf);
|
||||
}
|
||||
LoadFromConfig = FALSE;
|
||||
}
|
||||
strcpy(p, "dxwnd.reg");
|
||||
return fopen(sSourcePath,"r");
|
||||
}
|
||||
|
@ -397,7 +397,12 @@ static HRESULT BuildPrimaryDir(LPDIRECTDRAW lpdd, CreateSurface_Type pCreateSurf
|
||||
ddsd.ddsCaps.dwCaps &= ~(DDSCAPS_FLIP|DDSCAPS_COMPLEX);
|
||||
// v2.02.93: don't move primary / backbuf surfaces on systemmemory when 3DDEVICE is requested
|
||||
// this impact also on capabilities for temporary surfaces for AERO optimized handling
|
||||
if ((lpddsd->dwFlags & DDSD_CAPS) && (lpddsd->ddsCaps.dwCaps & DDSCAPS_3DDEVICE)) ddsd.ddsCaps.dwCaps &= ~DDSCAPS_SYSTEMMEMORY;
|
||||
// v2.04.08: this seems not always true, so it can be bypassed by ALLOWSYSMEMON3DDEV, just in case.
|
||||
// should be tested with "Tomb Raider 3" in no emulation mode
|
||||
if(!(dxw.dwFlags8 & ALLOWSYSMEMON3DDEV)){
|
||||
if ((lpddsd->dwFlags & DDSD_CAPS) && (lpddsd->ddsCaps.dwCaps & DDSCAPS_3DDEVICE))
|
||||
ddsd.ddsCaps.dwCaps &= ~DDSCAPS_SYSTEMMEMORY;
|
||||
}
|
||||
|
||||
// create Primary surface
|
||||
OutTraceDW("BuildPrimaryDir: %s\n", LogSurfaceAttributes((LPDDSURFACEDESC)&ddsd, "[Primary]", __LINE__));
|
||||
@ -474,7 +479,13 @@ static HRESULT BuildBackBufferEmu(LPDIRECTDRAW lpdd, CreateSurface_Type pCreateS
|
||||
|
||||
// DDSCAPS_OFFSCREENPLAIN seems required to support the palette in memory surfaces
|
||||
ddsd.ddsCaps.dwCaps |= (DDSCAPS_SYSTEMMEMORY|DDSCAPS_OFFSCREENPLAIN);
|
||||
if(ddsd.ddsCaps.dwCaps & DDSCAPS_3DDEVICE) ddsd.ddsCaps.dwCaps &= ~DDSCAPS_SYSTEMMEMORY; // necessary: Martian Gotic crashes otherwise
|
||||
// necessary: Martian Gotic crashes otherwise
|
||||
// v2.04.08: this seems no longer true in some cases, so ALLOWSYSMEMON3DDEV will bypass it.
|
||||
// Should be tested with "Martian Gotic" and "Dominant Species" SW mode in emulation modes
|
||||
if(!(dxw.dwFlags8 & ALLOWSYSMEMON3DDEV)){
|
||||
if((ddsd.dwFlags & DDSD_CAPS) && (ddsd.ddsCaps.dwCaps & DDSCAPS_3DDEVICE))
|
||||
ddsd.ddsCaps.dwCaps &= ~DDSCAPS_SYSTEMMEMORY;
|
||||
}
|
||||
// on WinXP Fifa 99 doesn't like DDSCAPS_SYSTEMMEMORY cap, so better to leave a way to unset it....
|
||||
if(dxw.dwFlags6 & NOSYSMEMBACKBUF) ddsd.ddsCaps.dwCaps &= ~DDSCAPS_SYSTEMMEMORY;
|
||||
ddsd.dwWidth = dxw.GetScreenWidth();
|
||||
@ -632,14 +643,22 @@ static HRESULT BuildBackBufferDir(LPDIRECTDRAW lpdd, CreateSurface_Type pCreateS
|
||||
ddsd.dwFlags |= (DDSD_CAPS|DDSD_HEIGHT|DDSD_WIDTH);
|
||||
ddsd.ddsCaps.dwCaps &= ~(DDSCAPS_PRIMARYSURFACE|DDSCAPS_FLIP|DDSCAPS_COMPLEX);
|
||||
// v2.02.93: don't move primary / backbuf surfaces on systemmemory when 3DDEVICE is requested
|
||||
if(lpddsd->ddsCaps.dwCaps & DDSCAPS_3DDEVICE) {
|
||||
ddsd.ddsCaps.dwCaps &= ~DDSCAPS_SYSTEMMEMORY;
|
||||
}
|
||||
else {
|
||||
// v2.04.08: possibly no longer true ... to test with "Tomb Raider 3" non emulated modes
|
||||
if(dxw.dwFlags8 & ALLOWSYSMEMON3DDEV){
|
||||
ddsd.ddsCaps.dwCaps |= DDSCAPS_SYSTEMMEMORY;
|
||||
if (dxversion >= 4) ddsd.ddsCaps.dwCaps |= DDSCAPS_OFFSCREENPLAIN;
|
||||
ddsd.ddsCaps.dwCaps &= ~(DDSCAPS_VIDEOMEMORY|DDSCAPS_LOCALVIDMEM);
|
||||
}
|
||||
else {
|
||||
if(lpddsd->ddsCaps.dwCaps & DDSCAPS_3DDEVICE) {
|
||||
ddsd.ddsCaps.dwCaps &= ~DDSCAPS_SYSTEMMEMORY;
|
||||
}
|
||||
else {
|
||||
ddsd.ddsCaps.dwCaps |= DDSCAPS_SYSTEMMEMORY;
|
||||
if (dxversion >= 4) ddsd.ddsCaps.dwCaps |= DDSCAPS_OFFSCREENPLAIN;
|
||||
ddsd.ddsCaps.dwCaps &= ~(DDSCAPS_VIDEOMEMORY|DDSCAPS_LOCALVIDMEM);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(dxw.dwFlags6 & NOSYSMEMBACKBUF) ddsd.ddsCaps.dwCaps &= ~DDSCAPS_SYSTEMMEMORY;
|
||||
ddsd.dwWidth = dxw.GetScreenWidth();
|
||||
|
@ -2307,6 +2307,7 @@ void FixSurfaceCaps(LPDDSURFACEDESC2 lpddsd, int dxversion)
|
||||
|
||||
if((lpddsd->dwFlags & DDSD_CAPS) && (lpddsd->ddsCaps.dwCaps & DDSCAPS_ZBUFFER)) { // z-buffer surface - set to memory
|
||||
lpddsd->ddsCaps.dwCaps = DDSCAPS_ZBUFFER;
|
||||
if(dxw.dwFlags8 & ALLOWSYSMEMON3DDEV) lpddsd->ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY|DDSCAPS_ZBUFFER;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@ void DumpDibSection(const BITMAPINFO *pbmi, UINT iUsage, VOID *pvBits)
|
||||
BITMAPFILEHEADER hdr; // bitmap file-header
|
||||
BITMAPV4HEADER pbi; // bitmap info-header
|
||||
int iScanLineSize;
|
||||
LONG bV4SizeImage;
|
||||
|
||||
if(iUsage != DIB_RGB_COLORS) return;
|
||||
if(prog==0) CreateDirectory(".\\bmp.out", NULL);
|
||||
@ -29,7 +30,9 @@ void DumpDibSection(const BITMAPINFO *pbmi, UINT iUsage, VOID *pvBits)
|
||||
pbi.bV4Width = pbmi->bmiHeader.biWidth;
|
||||
pbi.bV4Height = pbmi->bmiHeader.biHeight;
|
||||
pbi.bV4BitCount = pbmi->bmiHeader.biBitCount;
|
||||
pbi.bV4SizeImage = ((pbi.bV4Width * pbi.bV4BitCount + 0x1F) & ~0x1F)/8 * pbi.bV4Height;
|
||||
bV4SizeImage = ((pbi.bV4Width * pbi.bV4BitCount + 0x1F) & ~0x1F)/8 * pbi.bV4Height;
|
||||
if(bV4SizeImage < 0) bV4SizeImage = -bV4SizeImage;
|
||||
pbi.bV4SizeImage = bV4SizeImage;
|
||||
pbi.bV4Height = - pbi.bV4Height;
|
||||
pbi.bV4Planes = pbmi->bmiHeader.biPlanes;
|
||||
pbi.bV4V4Compression = pbmi->bmiHeader.biCompression;
|
||||
@ -45,7 +48,7 @@ void DumpDibSection(const BITMAPINFO *pbmi, UINT iUsage, VOID *pvBits)
|
||||
pbi.bV4AlphaMask = 0;
|
||||
pbi.bV4CSType = LCS_CALIBRATED_RGB;
|
||||
iScanLineSize = ((pbi.bV4Width * pbi.bV4BitCount + 0x1F) & ~0x1F)/8;
|
||||
OutTrace("DumpDibSection: prog=%d size=%d wxh=(%dx%d) bc=%d sizeimg=%d planes=%d comp=%x ppm=(%dx%d) colors=%d imp=%d\n",
|
||||
OutTrace("DumpDibSection: prog=%08.8d size=%d wxh=(%dx%d) bc=%d sizeimg=%d planes=%d comp=%x ppm=(%dx%d) colors=%d imp=%d\n",
|
||||
prog,
|
||||
pbi.bV4Size, pbi.bV4Width, pbi.bV4Height, pbi.bV4BitCount, pbi.bV4SizeImage,
|
||||
pbi.bV4Planes, pbi.bV4V4Compression, pbi.bV4XPelsPerMeter, pbi.bV4YPelsPerMeter,
|
||||
|
@ -31,6 +31,7 @@ dxwSStack dxwss;
|
||||
dxwWStack dxwws;
|
||||
dxwCapsDB dxwcdb;
|
||||
dxwSDC sdc;
|
||||
dxwFStack fontdb;
|
||||
GetWindowLong_Type pGetWindowLong;
|
||||
SetWindowLong_Type pSetWindowLong;
|
||||
HWND hTrayWnd;
|
||||
@ -153,8 +154,8 @@ static char *Flag8Names[32]={
|
||||
"VSYNCSCANLINES", "TRIMTEXTUREFORMATS", "NOHALDEVICE", "CLIPLOCK",
|
||||
"PRETENDVISIBLE", "RAWFORMAT", "WININSULATION", "FIXMOUSEHOOK",
|
||||
"DDSFORMAT", "HOOKWING32", "SEQUENCEDIAT", "D3D8BACK16",
|
||||
"MARKWING32", "DYNAMICZCLEAN", "", "",
|
||||
"", "", "", "",
|
||||
"MARKWING32", "DYNAMICZCLEAN", "MARKGDI32", "DUMPDIBSECTION",
|
||||
"DUMPDEVCONTEXT", "QUALITYFONTS", "ALLOWSYSMEMON3DDEV", "",
|
||||
"", "", "", "",
|
||||
"", "", "", "",
|
||||
};
|
||||
@ -163,11 +164,11 @@ static char *TFlagNames[32]={
|
||||
"OUTTRACE", "OUTDDRAWTRACE", "OUTWINMESSAGES", "OUTCURSORTRACE",
|
||||
"OUTSEPARATED", "**", "ASSERTDIALOG", "OUTIMPORTTABLE",
|
||||
"OUTDEBUG", "OUTREGISTRY", "TRACEHOOKS", "OUTD3DTRACE",
|
||||
"OUTDXWINTRACE", "ADDTIMESTAMP", "OUTDEBUGSTRING", "ERASELOGFILE",
|
||||
"", "", "", "",
|
||||
"", "", "", "",
|
||||
"OUTDXWINTRACE", "OUTWINGTRACE", "OUTOGLTRACE", "",
|
||||
"", "", "", "",
|
||||
"", "", "", "",
|
||||
"", "", "", "ADDRELATIVETIME",
|
||||
"**", "ADDTIMESTAMP", "OUTDEBUGSTRING", "ERASELOGFILE",
|
||||
};
|
||||
|
||||
char *GetDxWndPath()
|
||||
|
@ -1062,7 +1062,7 @@ void dxwCore::ShowBanner(HWND hwnd)
|
||||
|
||||
g_hbmBall = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_BANNER));
|
||||
HDC hdcMem = CreateCompatibleDC(hClientDC);
|
||||
HBITMAP hbmOld = (HBITMAP)SelectObject(hdcMem, g_hbmBall);
|
||||
HBITMAP hbmOld = (HBITMAP)(*pSelectObject)(hdcMem, g_hbmBall);
|
||||
GetObject(g_hbmBall, sizeof(bm), &bm);
|
||||
|
||||
(*pGetWindowRect)(hwnd, &win);
|
||||
@ -1090,7 +1090,7 @@ void dxwCore::ShowBanner(HWND hwnd)
|
||||
}
|
||||
SetStretchBltMode(hClientDC, StretchMode);
|
||||
(*pSetViewportOrgEx)(hClientDC, PrevViewPort.x, PrevViewPort.y, NULL);
|
||||
SelectObject(hdcMem, hbmOld);
|
||||
(*pSelectObject)(hdcMem, hbmOld);
|
||||
DeleteDC(hdcMem);
|
||||
(*pGDIReleaseDC)(hwnd, hClientDC);
|
||||
Sleep(200);
|
||||
|
@ -2,6 +2,7 @@
|
||||
#include "syslibs.h"
|
||||
|
||||
#define DDSQLEN 0x20
|
||||
#define MAXFONTS 0x40
|
||||
|
||||
typedef struct {
|
||||
DWORD dwTimerType;
|
||||
@ -40,6 +41,11 @@ typedef enum {
|
||||
SURFACE_ROLE_BACKBUFFER
|
||||
} Enum_Surface_Role_Type;
|
||||
|
||||
typedef struct {
|
||||
HFONT font;
|
||||
HFONT scaled;
|
||||
} FontDB_Type;
|
||||
|
||||
class dxwCore
|
||||
{
|
||||
// Construction/destruction
|
||||
@ -296,10 +302,26 @@ private:
|
||||
int WhndSize;
|
||||
};
|
||||
|
||||
class dxwFStack
|
||||
{
|
||||
public:
|
||||
dxwFStack();
|
||||
virtual ~dxwFStack();
|
||||
|
||||
public:
|
||||
void Push(HFONT, HFONT);
|
||||
HFONT GetScaledFont(HFONT);
|
||||
HFONT DeleteFont(HFONT);
|
||||
|
||||
protected:
|
||||
FontDB_Type *FontDB;
|
||||
};
|
||||
|
||||
extern dxwCore dxw;
|
||||
extern dxwSStack dxwss;
|
||||
extern dxwWStack dxwws;
|
||||
extern dxwCapsDB dxwcdb;
|
||||
extern dxwFStack fontdb;
|
||||
|
||||
typedef enum {
|
||||
SYSLIBIDX_KERNEL32 = 0,
|
||||
|
@ -27,7 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#include "TlHelp32.h"
|
||||
|
||||
#define VERSION "2.04.07.fx1"
|
||||
#define VERSION "2.04.08.fx1"
|
||||
|
||||
#define DDTHREADLOCK 1
|
||||
|
||||
|
Binary file not shown.
@ -409,6 +409,10 @@
|
||||
RelativePath=".\emulateddc.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\fontstack.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\gdi32.cpp"
|
||||
>
|
||||
|
@ -77,7 +77,7 @@ HDC dxwCore::AcquireEmulatedDC(HWND hwnd)
|
||||
if(!(VirtualPic=CreateCompatibleBitmap(wdc, dxw.GetScreenWidth(), dxw.GetScreenHeight())))
|
||||
OutTraceE("AcquireEmulatedDC: CreateCompatibleBitmap ERROR err=%d at=%d\n", GetLastError(), __LINE__);
|
||||
|
||||
if(!(PrevSelection=SelectObject(VirtualHDC, VirtualPic)))
|
||||
if(!(PrevSelection=(*pSelectObject)(VirtualHDC, VirtualPic)))
|
||||
OutTraceE("AcquireEmulatedDC: SelectObject ERROR err=%d at=%d\n", GetLastError(), __LINE__);
|
||||
else {
|
||||
if(!DeleteObject(PrevSelection))
|
||||
|
69
dll/fontstack.cpp
Normal file
69
dll/fontstack.cpp
Normal file
@ -0,0 +1,69 @@
|
||||
/* ------------------------------------------------------------------ */
|
||||
// Font Stack implementation
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
|
||||
#include <stdio.h>
|
||||
#include "dxwnd.h"
|
||||
#include "dxwcore.hpp"
|
||||
|
||||
dxwFStack::dxwFStack()
|
||||
{
|
||||
FontDB = (FontDB_Type *)malloc(sizeof(FontDB_Type)*(MAXFONTS+1));
|
||||
memset(FontDB, 0, sizeof(FontDB));
|
||||
}
|
||||
|
||||
dxwFStack::~dxwFStack()
|
||||
{
|
||||
free(FontDB);
|
||||
}
|
||||
|
||||
void dxwFStack::Push(HFONT font, HFONT scaled)
|
||||
{
|
||||
int i;
|
||||
FontDB_Type *e;
|
||||
for (i=0;i<MAXFONTS;i++) {
|
||||
e=&FontDB[i];
|
||||
if (e->font == 0) break; // got matching entry or end of the list
|
||||
}
|
||||
if(i == DDSQLEN) {
|
||||
MessageBox(0, "Font stack is full", "DxWnd", MB_OK | MB_ICONEXCLAMATION);
|
||||
return;
|
||||
}
|
||||
e->font=font;
|
||||
e->scaled=scaled;
|
||||
}
|
||||
|
||||
HFONT dxwFStack::GetScaledFont(HFONT font)
|
||||
{
|
||||
int i;
|
||||
FontDB_Type *e;
|
||||
for (i=0;i<MAXFONTS;i++) {
|
||||
e=&FontDB[i];
|
||||
if (e->font == font) return e->scaled; // got matching entry
|
||||
if (e->font == 0) return 0; // got end of the list
|
||||
}
|
||||
return 0; // got max entries
|
||||
}
|
||||
|
||||
HFONT dxwFStack::DeleteFont(HFONT font)
|
||||
{
|
||||
int i;
|
||||
HFONT scaled;
|
||||
FontDB_Type *e;
|
||||
for (i=0;i<MAXFONTS;i++) {
|
||||
e=&FontDB[i];
|
||||
if (e->font == font) {
|
||||
scaled = e->scaled;
|
||||
break; // got matching entry
|
||||
}
|
||||
}
|
||||
if(i==MAXFONTS) return NULL;
|
||||
for (; i<MAXFONTS-1; i++) {
|
||||
FontDB[i]=FontDB[i+1];
|
||||
}
|
||||
FontDB[i].font = 0;
|
||||
FontDB[i].scaled = 0;
|
||||
return scaled;
|
||||
}
|
138
dll/gdi32.cpp
138
dll/gdi32.cpp
@ -1,5 +1,8 @@
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
|
||||
//#define BEST_QUALITY ANTIALIASED_QUALITY
|
||||
#define BEST_QUALITY CLEARTYPE_NATURAL_QUALITY
|
||||
|
||||
#include "dxwnd.h"
|
||||
#include "dxwcore.hpp"
|
||||
#include "syslibs.h"
|
||||
@ -49,18 +52,8 @@ COLORREF WINAPI extSetBkColor(HDC, COLORREF);
|
||||
COLORREF WINAPI extSetTextColor(HDC hdc, COLORREF crColor);
|
||||
int WINAPI extSetBkMode(HDC, int);
|
||||
*/
|
||||
typedef int (WINAPI *EnumFontsA_Type)(HDC, LPCSTR, FONTENUMPROC, LPARAM);
|
||||
EnumFontsA_Type pEnumFontsA;
|
||||
int WINAPI extEnumFontsA(HDC, LPCSTR, FONTENUMPROC, LPARAM);
|
||||
typedef BOOL (WINAPI *GetTextExtentPointA_Type)(HDC, LPCTSTR, int, LPSIZE);
|
||||
GetTextExtentPointA_Type pGetTextExtentPointA;
|
||||
BOOL WINAPI extGetTextExtentPointA(HDC, LPCTSTR, int, LPSIZE);
|
||||
typedef BOOL (WINAPI *GetTextExtentPoint32A_Type)(HDC, LPCTSTR, int, LPSIZE);
|
||||
GetTextExtentPoint32A_Type pGetTextExtentPoint32A;
|
||||
BOOL WINAPI extGetTextExtentPoint32A(HDC, LPCTSTR, int, LPSIZE);
|
||||
|
||||
static HookEntryEx_Type Hooks[]={
|
||||
|
||||
//{HOOK_IAT_CANDIDATE, 0, "DPtoLP", (FARPROC)DPtoLP, (FARPROC *)&pDPtoLP, (FARPROC)extDPtoLP},
|
||||
|
||||
{HOOK_IAT_CANDIDATE, 0, "GetDeviceCaps", (FARPROC)GetDeviceCaps, (FARPROC *)&pGDIGetDeviceCaps, (FARPROC)extGetDeviceCaps},
|
||||
@ -85,7 +78,6 @@ static HookEntryEx_Type Hooks[]={
|
||||
#ifdef TRACEPALETTE
|
||||
{HOOK_IAT_CANDIDATE, 0, "ResizePalette", (FARPROC)ResizePalette, (FARPROC *)&pResizePalette, (FARPROC)extResizePalette},
|
||||
#endif
|
||||
{HOOK_HOT_CANDIDATE, 0, "EnumFontsA", (FARPROC)EnumFontsA, (FARPROC *)&pEnumFontsA, (FARPROC)extEnumFontsA}, // Titanic
|
||||
{HOOK_IAT_CANDIDATE, 0, 0, NULL, 0, 0} // terminator
|
||||
};
|
||||
|
||||
@ -162,8 +154,6 @@ static HookEntryEx_Type SyscallHooks[]={
|
||||
{HOOK_IAT_CANDIDATE, 0, "CreateDCW", (FARPROC)CreateDCW, (FARPROC *)&pGDICreateDCW, (FARPROC)extGDICreateDCW},
|
||||
|
||||
{HOOK_IAT_CANDIDATE, 0, "PlayEnhMetaFile", (FARPROC)PlayEnhMetaFile, (FARPROC *)&pPlayEnhMetaFile, (FARPROC)extPlayEnhMetaFile},
|
||||
{HOOK_IAT_CANDIDATE, 0, "GetTextExtentPointA", (FARPROC)NULL, (FARPROC *)&pGetTextExtentPointA, (FARPROC)extGetTextExtentPointA},
|
||||
{HOOK_IAT_CANDIDATE, 0, "GetTextExtentPoint32A", (FARPROC)NULL, (FARPROC *)&pGetTextExtentPoint32A, (FARPROC)extGetTextExtentPoint32A},
|
||||
|
||||
// CreateDCW .....
|
||||
{HOOK_IAT_CANDIDATE, 0, 0, NULL, 0, 0} // terminator
|
||||
@ -190,8 +180,13 @@ static HookEntryEx_Type EmulateHooks[]={
|
||||
};
|
||||
|
||||
static HookEntryEx_Type TextHooks[]={
|
||||
{HOOK_IAT_CANDIDATE, 0, "CreateFontA", (FARPROC)CreateFont, (FARPROC *)&pGDICreateFont, (FARPROC)extCreateFont},
|
||||
{HOOK_IAT_CANDIDATE, 0, "CreateFontIndirectA", (FARPROC)CreateFontIndirectA, (FARPROC *)&pGDICreateFontIndirect, (FARPROC)extCreateFontIndirect},
|
||||
{HOOK_HOT_CANDIDATE, 0, "CreateFontA", (FARPROC)CreateFont, (FARPROC *)&pGDICreateFont, (FARPROC)extCreateFont},
|
||||
{HOOK_HOT_CANDIDATE, 0, "CreateFontIndirectA", (FARPROC)CreateFontIndirectA, (FARPROC *)&pGDICreateFontIndirect, (FARPROC)extCreateFontIndirect},
|
||||
{HOOK_IAT_CANDIDATE, 0, "GetTextExtentPointA", (FARPROC)NULL, (FARPROC *)&pGetTextExtentPointA, (FARPROC)extGetTextExtentPointA},
|
||||
{HOOK_IAT_CANDIDATE, 0, "GetTextExtentPoint32A", (FARPROC)NULL, (FARPROC *)&pGetTextExtentPoint32A, (FARPROC)extGetTextExtentPoint32A},
|
||||
{HOOK_HOT_CANDIDATE, 0, "EnumFontsA", (FARPROC)EnumFontsA, (FARPROC *)&pEnumFontsA, (FARPROC)extEnumFontsA}, // Titanic
|
||||
{HOOK_HOT_CANDIDATE, 0, "SelectObject", (FARPROC)SelectObject, (FARPROC *)&pSelectObject, (FARPROC)extSelectObject}, // font scaling ....
|
||||
{HOOK_HOT_CANDIDATE, 0, "DeleteObject", (FARPROC)DeleteObject, (FARPROC *)&pDeleteObject, (FARPROC)extDeleteObject}, // font scaling ....
|
||||
{HOOK_IAT_CANDIDATE, 0, 0, NULL, 0, 0} // terminator
|
||||
};
|
||||
|
||||
@ -1215,44 +1210,83 @@ HFONT WINAPI extCreateFont(int nHeight, int nWidth, int nEscapement, int nOrient
|
||||
DWORD fdwOutputPrecision, DWORD fdwClipPrecision, DWORD fdwQuality,
|
||||
DWORD fdwPitchAndFamily, LPCTSTR lpszFace)
|
||||
{
|
||||
HFONT HFont, HScaled;
|
||||
|
||||
OutTraceDW("CreateFont: h=%d w=%d face=\"%s\"\n", nHeight, nWidth, lpszFace);
|
||||
if(dxw.dwFlags1 & FIXTEXTOUT) {
|
||||
|
||||
if(dxw.dwFlags8 & QUALITYFONTS) fdwQuality = BEST_QUALITY;
|
||||
|
||||
HFont = (*pGDICreateFont)(nHeight, nWidth, nEscapement, nOrientation, fnWeight,
|
||||
fdwItalic, fdwUnderline, fdwStrikeOut, fdwCharSet,
|
||||
fdwOutputPrecision, fdwClipPrecision, fdwQuality,
|
||||
fdwPitchAndFamily, lpszFace);
|
||||
|
||||
if((dxw.dwFlags1 & FIXTEXTOUT) && HFont) {
|
||||
if(nHeight > 0) dxw.MapClient(&nWidth, &nHeight);
|
||||
else {
|
||||
nHeight= -nHeight;
|
||||
dxw.MapClient(&nWidth, &nHeight);
|
||||
nHeight= -nHeight;
|
||||
}
|
||||
HScaled = (*pGDICreateFont)(nHeight, nWidth, nEscapement, nOrientation, fnWeight,
|
||||
fdwItalic, fdwUnderline, fdwStrikeOut, fdwCharSet,
|
||||
fdwOutputPrecision, fdwClipPrecision, fdwQuality,
|
||||
fdwPitchAndFamily, lpszFace);
|
||||
|
||||
if(HScaled){
|
||||
OutTraceDW("CreateFontIndirect: associate font=%x scaled=%x\n", HFont, HScaled);
|
||||
fontdb.Push(HFont, HScaled);
|
||||
}
|
||||
else{
|
||||
OutTraceE("CreateFontIndirect ERROR: scaled font err=%d\n", GetLastError());
|
||||
}
|
||||
}
|
||||
return (*pGDICreateFont)(nHeight, nWidth, nEscapement, nOrientation, fnWeight,
|
||||
fdwItalic, fdwUnderline, fdwStrikeOut, fdwCharSet,
|
||||
fdwOutputPrecision, fdwClipPrecision, NONANTIALIASED_QUALITY,
|
||||
fdwPitchAndFamily, lpszFace);
|
||||
|
||||
if(HFont)
|
||||
OutTraceDW("CreateFont: hfont=%x\n", HFont);
|
||||
else
|
||||
OutTraceDW("CreateFont ERROR: err=%d\n", GetLastError());
|
||||
return HFont;
|
||||
}
|
||||
|
||||
// CreateFontIndirect hook routine to avoid font aliasing that prevents reverse blitting working on palettized surfaces
|
||||
// NONANTIALIASED_QUALITY no longer necessary, since reverse blitting is no longer used
|
||||
|
||||
HFONT WINAPI extCreateFontIndirect(const LOGFONT* lplf)
|
||||
{
|
||||
HFONT HFont, HScaled;
|
||||
LOGFONT lf;
|
||||
HFONT retHFont;
|
||||
OutTraceDW("CreateFontIndirect: h=%d w=%d face=\"%s\"\n", lplf->lfHeight, lplf->lfWidth, lplf->lfFaceName);
|
||||
|
||||
memcpy((char *)&lf, (char *)lplf, sizeof(LOGFONT));
|
||||
lf.lfQuality=NONANTIALIASED_QUALITY;
|
||||
if(dxw.dwFlags8 & QUALITYFONTS) lf.lfQuality = BEST_QUALITY;
|
||||
HFont=(*pGDICreateFontIndirect)(&lf);
|
||||
|
||||
if(dxw.dwFlags1 & FIXTEXTOUT) {
|
||||
memcpy((char *)&lf, (char *)lplf, sizeof(LOGFONT));
|
||||
if(dxw.dwFlags8 & QUALITYFONTS) lf.lfQuality = BEST_QUALITY;
|
||||
if(lf.lfHeight > 0) dxw.MapClient((int *)&lf.lfWidth, (int *)&lf.lfHeight);
|
||||
else {
|
||||
lf.lfHeight= -lf.lfHeight;
|
||||
dxw.MapClient((int *)&lf.lfWidth, (int *)&lf.lfHeight);
|
||||
lf.lfHeight= -lf.lfHeight;
|
||||
}
|
||||
HScaled=((*pGDICreateFontIndirect)(&lf));
|
||||
|
||||
if(HScaled){
|
||||
OutTraceDW("CreateFontIndirect: associate font=%x scaled=%x\n", HFont, HScaled);
|
||||
fontdb.Push(HFont, HScaled);
|
||||
}
|
||||
else{
|
||||
OutTraceE("CreateFontIndirect ERROR: scaled font err=%d\n", GetLastError());
|
||||
}
|
||||
}
|
||||
retHFont=((*pGDICreateFontIndirect)(&lf));
|
||||
if(retHFont)
|
||||
OutTraceDW("CreateFontIndirect: hfont=%x\n", retHFont);
|
||||
|
||||
if(HFont)
|
||||
OutTraceDW("CreateFontIndirect: hfont=%x\n", HFont);
|
||||
else
|
||||
OutTraceDW("CreateFontIndirect: error=%d at %d\n", GetLastError(), __LINE__);
|
||||
return retHFont;
|
||||
OutTraceE("CreateFontIndirect ERROR: err=%d\n", GetLastError());
|
||||
return HFont;
|
||||
}
|
||||
|
||||
BOOL WINAPI extSetDeviceGammaRamp(HDC hDC, LPVOID lpRamp)
|
||||
@ -1873,7 +1907,7 @@ int WINAPI extSetDIBitsToDevice(HDC hdc, int XDest, int YDest, DWORD dwWidth, DW
|
||||
// dc to assign the needed size and color space to the temporary dc.
|
||||
if(!(hbmPic=CreateCompatibleBitmap(hdc, OrigWidth, OrigHeight)))
|
||||
OutTraceE("CreateCompatibleBitmap: ERROR err=%d at=%d\n", GetLastError(), __LINE__);
|
||||
if(!SelectObject(hTempDc, hbmPic))
|
||||
if(!(*pSelectObject)(hTempDc, hbmPic))
|
||||
OutTraceE("SelectObject: ERROR err=%d at=%d\n", GetLastError(), __LINE__);
|
||||
if(!(ret=(*pSetDIBitsToDevice)(hTempDc, 0, 0, OrigWidth, OrigHeight, XSrc, YSrc, uStartScan, cScanLines, lpvBits, lpbmi, fuColorUse)))
|
||||
OutTraceE("SetDIBitsToDevice: ERROR err=%d at=%d\n", GetLastError(), __LINE__);
|
||||
@ -3020,7 +3054,9 @@ HBITMAP WINAPI extCreateDIBSection(HDC hdc, const BITMAPINFO *pbmi, UINT iUsage,
|
||||
}
|
||||
else {
|
||||
OutTraceDW("CreateDIBSection: ret=%x\n", ret);
|
||||
if(dxw.dwFlags8 & DUMPDIBSECTION) DumpDibSection(pbmi, iUsage, *ppvBits);
|
||||
// beware: it is worth dumping the DIB section only when hSection is not NULL
|
||||
// which means the bitmap is connected to a shared memory file
|
||||
if((dxw.dwFlags8 & DUMPDIBSECTION) && hSection) DumpDibSection(pbmi, iUsage, *ppvBits);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@ -3569,8 +3605,8 @@ BOOL WINAPI extGetTextExtentPointA(HDC hdc, LPCTSTR lpString, int cbString, LPSI
|
||||
// beware: size scaling is appropriate only when referred to video DC
|
||||
switch(dxw.GDIEmulationMode){
|
||||
case GDIMODE_STRETCHED:
|
||||
if(dxw.Windowize && dxw.IsToRemap(hdc)){
|
||||
dxw.UnmapClient((LPRECT)lpSize);
|
||||
if(dxw.Windowize && (OBJ_DC == (*pGetObjectType)(hdc))){
|
||||
dxw.UnmapClient((LPPOINT)lpSize);
|
||||
OutTraceDW("GetTextExtentPointA: remapped size=(%dx%d)\n", lpSize->cx, lpSize->cy);
|
||||
}
|
||||
break;
|
||||
@ -3584,7 +3620,7 @@ BOOL WINAPI extGetTextExtentPointA(HDC hdc, LPCTSTR lpString, int cbString, LPSI
|
||||
BOOL WINAPI extGetTextExtentPoint32A(HDC hdc, LPCTSTR lpString, int cbString, LPSIZE lpSize)
|
||||
{
|
||||
BOOL ret;
|
||||
OutTraceDW("GetTextExtentPoint32A: hdc=%x string=\"%s\"(%d)\n", hdc, lpString, cbString);
|
||||
OutTraceDW("GetTextExtentPoint32A: hdc=%x(%s) string=\"%s\"(%d)\n", hdc, GetObjectTypeStr(hdc), lpString, cbString);
|
||||
|
||||
ret = (*pGetTextExtentPoint32A)(hdc, lpString, cbString, lpSize);
|
||||
if(!ret){
|
||||
@ -3596,8 +3632,8 @@ BOOL WINAPI extGetTextExtentPoint32A(HDC hdc, LPCTSTR lpString, int cbString, LP
|
||||
// beware: size scaling is appropriate only when referred to video DC
|
||||
switch(dxw.GDIEmulationMode){
|
||||
case GDIMODE_STRETCHED:
|
||||
if(dxw.Windowize && dxw.IsToRemap(hdc)){
|
||||
dxw.UnmapClient((LPRECT)lpSize);
|
||||
if(dxw.Windowize && (OBJ_DC == (*pGetObjectType)(hdc))){
|
||||
dxw.UnmapClient((LPPOINT)lpSize);
|
||||
OutTraceDW("GetTextExtentPoint32A: remapped size=(%dx%d)\n", lpSize->cx, lpSize->cy);
|
||||
}
|
||||
break;
|
||||
@ -3638,3 +3674,37 @@ LONG WINAPI extSetBitmapBits(HBITMAP hbmp, DWORD cBytes, VOID *lpBits)
|
||||
}
|
||||
#endif
|
||||
|
||||
HGDIOBJ WINAPI extSelectObject(HDC hdc, HGDIOBJ hgdiobj)
|
||||
{
|
||||
HGDIOBJ ret;
|
||||
OutTraceDW("SelectObject: hdc=%x(%s) obj=%x(%s)\n", hdc, GetObjectTypeStr(hdc), hgdiobj, GetObjectTypeStr((HDC)hgdiobj));
|
||||
if(GetObjectType(hgdiobj)==OBJ_FONT){
|
||||
if(GetObjectType(hdc)==OBJ_DC) {
|
||||
HGDIOBJ scaled;
|
||||
scaled = fontdb.GetScaledFont((HFONT)hgdiobj);
|
||||
if(scaled) {
|
||||
hgdiobj=scaled;
|
||||
OutTraceDW("SelectObject: replaced font obj=%x\n", hgdiobj);
|
||||
}
|
||||
else{
|
||||
OutTraceE("SelectObject: unmatched font obj=%x\n", hgdiobj);
|
||||
}
|
||||
}
|
||||
}
|
||||
ret = (*pSelectObject)(hdc, hgdiobj);
|
||||
return ret;
|
||||
}
|
||||
|
||||
BOOL WINAPI extDeleteObject(HGDIOBJ hgdiobj)
|
||||
{
|
||||
BOOL ret;
|
||||
HGDIOBJ scaledobj;
|
||||
OutTraceDW("DeleteObject: obj=%x(%s)\n", hgdiobj, GetObjectTypeStr((HDC)hgdiobj));
|
||||
if(GetObjectType(hgdiobj)==OBJ_FONT){
|
||||
scaledobj=fontdb.DeleteFont((HFONT)hgdiobj);
|
||||
OutTraceDW("DeleteObject: deleted font obj=%x scaled=%x\n", hgdiobj, scaledobj);
|
||||
}
|
||||
if(scaledobj) (*pDeleteObject)(scaledobj);
|
||||
ret = (*pDeleteObject)(hgdiobj);
|
||||
return ret;
|
||||
}
|
@ -49,6 +49,7 @@ HRESULT WINAPI extQueryInterfaceDX(int dxversion, QueryInterface_Type pQueryInte
|
||||
dxversion, lpdds, dxwss.ExplainSurfaceRole((LPDIRECTDRAWSURFACE)lpdds), riid.Data1, ExplainGUID((GUID *)&riid));
|
||||
|
||||
iObjectVersion = 0;
|
||||
iObjectType = TYPE_OBJECT_UNKNOWN;
|
||||
switch(riid.Data1){
|
||||
// DirectDraw
|
||||
case 0x6C14DB80: // IID_IDirectDraw
|
||||
|
@ -131,7 +131,7 @@ HDC dxwSDC::GetPrimaryDC(HDC hdc)
|
||||
_Warn("CreateCompatibleBitmap ERROR");
|
||||
}
|
||||
|
||||
if(!SelectObject(VirtualHDC, VirtualPic)){
|
||||
if(!(*pSelectObject)(VirtualHDC, VirtualPic)){
|
||||
OutTraceE("dxwSDC::GetPrimaryDC: SelectObject ERROR err=%d at=%d\n", GetLastError(), __LINE__);
|
||||
_Warn("SelectObject ERROR");
|
||||
}
|
||||
@ -311,9 +311,9 @@ BOOL dxwSDC::PutPrimaryDC(HDC hdc, BOOL UpdateScreen)
|
||||
|
||||
void dxwSDC::copyDcAttributes(HDC destDC, HDC origDc, POINT origin)
|
||||
{
|
||||
origFont = SelectObject(destDC, GetCurrentObject(origDc, OBJ_FONT));
|
||||
origBrush = SelectObject(destDC, GetCurrentObject(origDc, OBJ_BRUSH));
|
||||
origPen = SelectObject(destDC, GetCurrentObject(origDc, OBJ_PEN));
|
||||
origFont = (*pSelectObject)(destDC, GetCurrentObject(origDc, OBJ_FONT));
|
||||
origBrush = (*pSelectObject)(destDC, GetCurrentObject(origDc, OBJ_BRUSH));
|
||||
origPen = (*pSelectObject)(destDC, GetCurrentObject(origDc, OBJ_PEN));
|
||||
|
||||
if (GM_ADVANCED == GetGraphicsMode(origDc)){
|
||||
SetGraphicsMode(destDC, GM_ADVANCED);
|
||||
|
149
dll/syslibs.h
149
dll/syslibs.h
@ -5,7 +5,7 @@ for all system calls hooked by DxWnd:
|
||||
GDI32.dll
|
||||
Kernel32.dll
|
||||
ole32.dll
|
||||
user32.dll.dll
|
||||
user32.dll
|
||||
|
||||
====================================================================*/
|
||||
|
||||
@ -139,6 +139,11 @@ typedef BOOL (WINAPI *PolyPolygon_Type)(HDC, const POINT *, const INT *, int);
|
||||
typedef BOOL (WINAPI *PlayEnhMetaFile_Type)(HDC, HENHMETAFILE, const RECT *);
|
||||
typedef UINT (WINAPI *SetPaletteEntries_Type)(HPALETTE, UINT, UINT, const PALETTEENTRY *);
|
||||
typedef int (WINAPI *SetROP2_Type)(HDC, int);
|
||||
typedef int (WINAPI *EnumFontsA_Type)(HDC, LPCSTR, FONTENUMPROC, LPARAM);
|
||||
typedef BOOL (WINAPI *GetTextExtentPointA_Type)(HDC, LPCTSTR, int, LPSIZE);
|
||||
typedef BOOL (WINAPI *GetTextExtentPoint32A_Type)(HDC, LPCTSTR, int, LPSIZE);
|
||||
typedef HGDIOBJ (WINAPI *SelectObject_Type)(HDC, HGDIOBJ);
|
||||
typedef BOOL (WINAPI *DeleteObject_Type)(HGDIOBJ);
|
||||
|
||||
// Kernel32.dll:
|
||||
typedef BOOL (WINAPI *GetDiskFreeSpaceA_Type)(LPCSTR, LPDWORD, LPDWORD, LPDWORD, LPDWORD);
|
||||
@ -255,6 +260,45 @@ typedef HWND (WINAPI *WindowFromPoint_Type)(POINT);
|
||||
typedef HWND (WINAPI *ChildWindowFromPoint_Type)(HWND, POINT);
|
||||
typedef HWND (WINAPI *ChildWindowFromPointEx_Type)(HWND, POINT, UINT);
|
||||
typedef int (WINAPI *GetWindowTextA_Type)(HWND, LPTSTR, int);
|
||||
typedef BOOL (WINAPI *BringWindowToTop_Type)(HWND);
|
||||
typedef BOOL (WINAPI *SetForegroundWindow_Type)(HWND);
|
||||
typedef HHOOK (WINAPI *SetWindowsHookEx_Type)(int, HOOKPROC, HINSTANCE, DWORD);
|
||||
typedef HRESULT (WINAPI *MessageBoxTimeoutA_Type)(HWND, LPCSTR, LPCSTR, UINT, WORD, DWORD);
|
||||
typedef HRESULT (WINAPI *MessageBoxTimeoutW_Type)(HWND, LPCWSTR, LPCWSTR, UINT, WORD, DWORD);
|
||||
typedef BOOL (WINAPI *IsIconic_Type)(HWND);
|
||||
typedef BOOL (WINAPI *IsZoomed_Type)(HWND);
|
||||
typedef HDESK (WINAPI *CreateDesktop_Type)(LPCTSTR, LPCTSTR, DEVMODE *, DWORD, ACCESS_MASK, LPSECURITY_ATTRIBUTES);
|
||||
typedef BOOL (WINAPI *SwitchDesktop_Type)(HDESK);
|
||||
typedef HDESK (WINAPI *OpenDesktop_Type)(LPTSTR, DWORD, BOOL, ACCESS_MASK);
|
||||
typedef BOOL (WINAPI *CloseDesktop_Type)(HDESK);
|
||||
typedef int (WINAPI *ValidateRect_Type)(HWND, const RECT *);
|
||||
typedef BOOL (WINAPI *ScrollWindow_Type)(HWND, int, int, const RECT *, const RECT *);
|
||||
typedef INT_PTR (WINAPI *DialogBoxParamA_Type)(HINSTANCE, LPCTSTR, HWND, DLGPROC, LPARAM);
|
||||
typedef HWND (WINAPI *GetParent_Type)(HWND);
|
||||
typedef BOOL (WINAPI *InvalidateRgn_Type)(HWND, HRGN, BOOL);
|
||||
typedef BOOL (WINAPI *InvertRect_Type)(HDC, const RECT *);
|
||||
typedef BOOL (WINAPI *ScrollDC_Type)(HDC, int, int, const RECT *, const RECT *, HRGN, LPRECT);
|
||||
typedef BOOL (WINAPI *DrawIcon_Type)(HDC hDC, int X, int Y, HICON hIcon);
|
||||
typedef BOOL (WINAPI *DrawIconEx_Type)(HDC, int, int, HICON, int, int, UINT, HBRUSH, UINT);
|
||||
typedef BOOL (WINAPI *DrawCaption_Type)(HWND, HDC, LPCRECT, UINT);
|
||||
typedef BOOL (WINAPI *PaintDesktop_Type)(HDC);
|
||||
typedef VOID (WINAPI *mouse_event_Type)(DWORD, DWORD, DWORD, DWORD, ULONG_PTR);
|
||||
typedef BOOL (WINAPI *ShowScrollBar_Type)(HWND, int, BOOL);
|
||||
typedef BOOL (WINAPI *DrawMenuBar_Type)(HWND);
|
||||
//typedef BOOL (WINAPI *TranslateMessage_Type)(MSG *);
|
||||
typedef BOOL (WINAPI *EnumDisplayDevicesA_Type)(LPCSTR, DWORD, PDISPLAY_DEVICE, DWORD);
|
||||
typedef BOOL (WINAPI *EnumDisplayDevicesW_Type)(LPCWSTR, DWORD, PDISPLAY_DEVICEW, DWORD);
|
||||
typedef INT_PTR (WINAPI *DialogBoxIndirectParamA_Type)(HINSTANCE, LPCDLGTEMPLATE, HWND, DLGPROC, LPARAM);
|
||||
typedef HWND (WINAPI *GetFocus_Type)(void);
|
||||
//typedef HWND (WINAPI *GetTopWindow_Type)(HWND);
|
||||
typedef DWORD (WINAPI *GetWindowThreadProcessId_Type)(HWND, LPDWORD);
|
||||
typedef HWND (WINAPI *GetWindow_Type)(HWND, UINT);
|
||||
typedef BOOL (WINAPI *IsWindow_Type)(HWND);
|
||||
typedef HWND (WINAPI *SetFocus_Type)(HWND);
|
||||
typedef HBITMAP (WINAPI *LoadBitmapA_Type)(HINSTANCE, LPCSTR);
|
||||
typedef BOOL (WINAPI *EnumWindows_Type)(WNDENUMPROC, LPARAM);
|
||||
typedef BOOL (WINAPI *GetMessage_Type)(LPMSG, HWND, UINT, UINT);
|
||||
typedef BOOL (WINAPI *PostMessage_Type)(HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
// Winmm.dll:
|
||||
typedef MCIERROR(WINAPI *mciSendCommand_Type)(MCIDEVICEID, UINT, DWORD_PTR, DWORD_PTR);
|
||||
@ -272,7 +316,8 @@ hooked APIs real pointers
|
||||
#undef DXWEXTERN
|
||||
#undef DXWINITIALIZED
|
||||
#define DXWEXTERN
|
||||
#define DXWINITIALIZED = NULL
|
||||
//#define DXWINITIALIZED = NULL
|
||||
#define DXWINITIALIZED
|
||||
#else
|
||||
#undef DXWEXTERN
|
||||
#undef DXWINITIALIZED
|
||||
@ -410,6 +455,12 @@ DXWEXTERN PolyPolygon_Type pPolyPolygon DXWINITIALIZED;
|
||||
DXWEXTERN PlayEnhMetaFile_Type pPlayEnhMetaFile DXWINITIALIZED;
|
||||
DXWEXTERN SetPaletteEntries_Type pSetPaletteEntries DXWINITIALIZED;
|
||||
DXWEXTERN SetROP2_Type pSetROP2 DXWINITIALIZED;
|
||||
DXWEXTERN EnumFontsA_Type pEnumFontsA DXWINITIALIZED;
|
||||
DXWEXTERN GetTextExtentPointA_Type pGetTextExtentPointA DXWINITIALIZED;
|
||||
DXWEXTERN GetTextExtentPoint32A_Type pGetTextExtentPoint32A DXWINITIALIZED;
|
||||
DXWEXTERN SelectObject_Type pSelectObject DXWINITIALIZED;
|
||||
DXWEXTERN DeleteObject_Type pDeleteObject DXWINITIALIZED;
|
||||
|
||||
|
||||
// Kernel32.dll:
|
||||
DXWEXTERN GetDiskFreeSpaceA_Type pGetDiskFreeSpaceA DXWINITIALIZED;
|
||||
@ -529,6 +580,46 @@ DXWEXTERN WindowFromPoint_Type pWindowFromPoint DXWINITIALIZED;
|
||||
DXWEXTERN ChildWindowFromPoint_Type pChildWindowFromPoint DXWINITIALIZED;
|
||||
DXWEXTERN ChildWindowFromPointEx_Type pChildWindowFromPointEx DXWINITIALIZED;
|
||||
DXWEXTERN GetWindowTextA_Type pGetWindowTextA DXWINITIALIZED;
|
||||
DXWEXTERN BringWindowToTop_Type pBringWindowToTop DXWINITIALIZED;
|
||||
DXWEXTERN SetForegroundWindow_Type pSetForegroundWindow DXWINITIALIZED;
|
||||
DXWEXTERN SetWindowsHookEx_Type pSetWindowsHookExA DXWINITIALIZED;
|
||||
DXWEXTERN SetWindowsHookEx_Type pSetWindowsHookExW DXWINITIALIZED;
|
||||
DXWEXTERN MessageBoxTimeoutA_Type pMessageBoxTimeoutA DXWINITIALIZED;
|
||||
DXWEXTERN MessageBoxTimeoutW_Type pMessageBoxTimeoutW DXWINITIALIZED;
|
||||
DXWEXTERN IsIconic_Type pIsIconic DXWINITIALIZED;
|
||||
DXWEXTERN IsZoomed_Type pIsZoomed DXWINITIALIZED;
|
||||
DXWEXTERN CreateDesktop_Type pCreateDesktop DXWINITIALIZED;
|
||||
DXWEXTERN SwitchDesktop_Type pSwitchDesktop DXWINITIALIZED;
|
||||
DXWEXTERN OpenDesktop_Type pOpenDesktop DXWINITIALIZED;
|
||||
DXWEXTERN CloseDesktop_Type pCloseDesktop DXWINITIALIZED;
|
||||
DXWEXTERN ValidateRect_Type pValidateRect DXWINITIALIZED;
|
||||
DXWEXTERN ScrollWindow_Type pScrollWindow DXWINITIALIZED;
|
||||
DXWEXTERN DialogBoxParamA_Type pDialogBoxParamA DXWINITIALIZED;
|
||||
DXWEXTERN GetParent_Type pGetParent DXWINITIALIZED;
|
||||
DXWEXTERN InvalidateRgn_Type pInvalidateRgn DXWINITIALIZED;
|
||||
DXWEXTERN InvertRect_Type pInvertRect DXWINITIALIZED;
|
||||
DXWEXTERN ScrollDC_Type pScrollDC DXWINITIALIZED;
|
||||
DXWEXTERN DrawIcon_Type pDrawIcon DXWINITIALIZED;
|
||||
DXWEXTERN DrawIconEx_Type pDrawIconEx DXWINITIALIZED;
|
||||
DXWEXTERN DrawCaption_Type pDrawCaption DXWINITIALIZED;
|
||||
DXWEXTERN PaintDesktop_Type pPaintDesktop DXWINITIALIZED;
|
||||
DXWEXTERN mouse_event_Type pmouse_event DXWINITIALIZED;
|
||||
DXWEXTERN ShowScrollBar_Type pShowScrollBar DXWINITIALIZED;
|
||||
DXWEXTERN DrawMenuBar_Type pDrawMenuBar DXWINITIALIZED;
|
||||
//TranslateMessage_Type pTranslateMessage DXWINITIALIZED;
|
||||
DXWEXTERN EnumDisplayDevicesA_Type pEnumDisplayDevicesA DXWINITIALIZED;
|
||||
DXWEXTERN EnumDisplayDevicesW_Type pEnumDisplayDevicesW DXWINITIALIZED;
|
||||
DXWEXTERN DialogBoxIndirectParamA_Type pDialogBoxIndirectParamA DXWINITIALIZED;
|
||||
DXWEXTERN GetFocus_Type pGetFocus DXWINITIALIZED;
|
||||
//GetTopWindow_Type pGetTopWindow DXWINITIALIZED;
|
||||
DXWEXTERN GetWindowThreadProcessId_Type pGetWindowThreadProcessId DXWINITIALIZED;
|
||||
DXWEXTERN GetWindow_Type pGetWindow DXWINITIALIZED;
|
||||
DXWEXTERN IsWindow_Type pIsWindow DXWINITIALIZED;
|
||||
DXWEXTERN SetFocus_Type pSetFocus DXWINITIALIZED;
|
||||
DXWEXTERN LoadBitmapA_Type pLoadBitmapA DXWINITIALIZED;
|
||||
DXWEXTERN EnumWindows_Type pEnumWindows DXWINITIALIZED;
|
||||
DXWEXTERN GetMessage_Type pGetMessageA, pGetMessageW DXWINITIALIZED;
|
||||
DXWEXTERN PostMessage_Type pPostMessageA, pPostMessageW DXWINITIALIZED;
|
||||
|
||||
// Winmm.dll:
|
||||
DXWEXTERN mciSendCommand_Type pmciSendCommandA DXWINITIALIZED;
|
||||
@ -671,6 +762,11 @@ extern BOOL WINAPI extPolyPolygon(HDC, const POINT *, const INT *, int);
|
||||
extern BOOL WINAPI extPlayEnhMetaFile(HDC, HENHMETAFILE, const RECT *);
|
||||
extern UINT WINAPI extSetPaletteEntries(HPALETTE, UINT, UINT, const PALETTEENTRY *);
|
||||
extern int WINAPI extSetROP2(HDC, int);
|
||||
extern int WINAPI extEnumFontsA(HDC, LPCSTR, FONTENUMPROC, LPARAM);
|
||||
extern BOOL WINAPI extGetTextExtentPointA(HDC, LPCTSTR, int, LPSIZE);
|
||||
extern BOOL WINAPI extGetTextExtentPoint32A(HDC, LPCTSTR, int, LPSIZE);
|
||||
extern HGDIOBJ WINAPI extSelectObject(HDC, HGDIOBJ);
|
||||
extern BOOL WINAPI extDeleteObject(HGDIOBJ);
|
||||
|
||||
// Kernel32.dll:
|
||||
extern BOOL WINAPI extGetDiskFreeSpaceA(LPCSTR, LPDWORD, LPDWORD, LPDWORD, LPDWORD);
|
||||
@ -792,6 +888,48 @@ extern HWND WINAPI extWindowFromPoint(POINT);
|
||||
extern HWND WINAPI extChildWindowFromPoint(HWND, POINT);
|
||||
extern HWND WINAPI extChildWindowFromPointEx(HWND, POINT, UINT);
|
||||
//extern int WINAPI extGetWindowTextA(HWND, LPTSTR, int);
|
||||
extern BOOL WINAPI extBringWindowToTop(HWND);
|
||||
extern BOOL WINAPI extSetForegroundWindow(HWND);
|
||||
extern HHOOK WINAPI extSetWindowsHookExA(int, HOOKPROC, HINSTANCE, DWORD);
|
||||
extern HHOOK WINAPI extSetWindowsHookExW(int, HOOKPROC, HINSTANCE, DWORD);
|
||||
extern HRESULT WINAPI extMessageBoxTimeoutA(HWND, LPCSTR, LPCSTR, UINT, WORD, DWORD);
|
||||
extern HRESULT WINAPI extMessageBoxTimeoutW(HWND, LPCWSTR, LPCWSTR, UINT, WORD, DWORD);
|
||||
extern BOOL WINAPI extIsIconic(HWND);
|
||||
extern BOOL WINAPI extIsZoomed(HWND);
|
||||
extern HDESK WINAPI extCreateDesktop(LPCTSTR, LPCTSTR, DEVMODE *, DWORD, ACCESS_MASK, LPSECURITY_ATTRIBUTES);
|
||||
extern BOOL WINAPI extSwitchDesktop(HDESK);
|
||||
extern HDESK WINAPI extOpenDesktop(LPTSTR, DWORD, BOOL, ACCESS_MASK);
|
||||
extern BOOL WINAPI extCloseDesktop(HDESK);
|
||||
extern int WINAPI extValidateRect(HWND, const RECT *);
|
||||
extern BOOL extScrollWindow(HWND, int, int, const RECT *, const RECT *);
|
||||
extern INT_PTR WINAPI extDialogBoxParamA(HINSTANCE, LPCTSTR, HWND, DLGPROC, LPARAM);
|
||||
extern HWND WINAPI extGetParent(HWND);
|
||||
extern BOOL WINAPI extInvalidateRgn(HWND, HRGN, BOOL);
|
||||
extern BOOL WINAPI extInvertRect(HDC, const RECT *);
|
||||
extern BOOL WINAPI extScrollDC(HDC, int, int, const RECT *, const RECT *, HRGN, LPRECT);
|
||||
extern BOOL WINAPI extDrawIcon(HDC hDC, int X, int Y, HICON hIcon);
|
||||
extern BOOL WINAPI extDrawIconEx(HDC, int, int, HICON, int, int, UINT, HBRUSH, UINT);
|
||||
extern BOOL WINAPI extDrawCaption(HWND, HDC, LPCRECT, UINT);
|
||||
extern BOOL WINAPI extPaintDesktop(HDC);
|
||||
extern VOID WINAPI extmouse_event(DWORD, DWORD, DWORD, DWORD, ULONG_PTR);
|
||||
extern BOOL WINAPI extShowScrollBar(HWND, int, BOOL);
|
||||
extern BOOL WINAPI extDrawMenuBar(HWND);
|
||||
//extern BOOL WINAPI extTranslateMessage(MSG *);
|
||||
extern BOOL WINAPI extEnumDisplayDevicesA(LPCSTR, DWORD, PDISPLAY_DEVICE, DWORD);
|
||||
extern BOOL WINAPI extEnumDisplayDevicesW(LPCWSTR, DWORD, PDISPLAY_DEVICEW, DWORD);
|
||||
extern INT_PTR WINAPI extDialogBoxIndirectParamA(HINSTANCE, LPCDLGTEMPLATE, HWND, DLGPROC, LPARAM);
|
||||
extern HWND WINAPI extGetFocus(void);
|
||||
//extern HWND WINAPI extGetTopWindow(HWND);
|
||||
extern DWORD WINAPI extGetWindowThreadProcessId(HWND, LPDWORD);
|
||||
extern HWND WINAPI extGetWindow(HWND, UINT);
|
||||
extern BOOL WINAPI extIsWindow(HWND);
|
||||
extern HWND WINAPI extSetFocus(HWND);
|
||||
extern HBITMAP WINAPI extLoadBitmapA(HINSTANCE, LPCSTR);
|
||||
extern BOOL WINAPI extEnumWindows(WNDENUMPROC, LPARAM);
|
||||
extern BOOL WINAPI extGetMessageA(LPMSG, HWND, UINT, UINT);
|
||||
extern BOOL WINAPI extGetMessageW(LPMSG, HWND, UINT, UINT);
|
||||
extern BOOL WINAPI extPostMessageA(HWND, UINT, WPARAM, LPARAM);
|
||||
extern BOOL WINAPI extPostMessageW(HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
// Winmm.dll:
|
||||
extern MCIERROR WINAPI extmciSendCommandA(MCIDEVICEID, UINT, DWORD_PTR, DWORD_PTR);
|
||||
@ -812,3 +950,10 @@ extern void HookImagehlpInit();
|
||||
|
||||
/* eof */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
201
dll/user32.cpp
201
dll/user32.cpp
@ -29,128 +29,6 @@ extern HDC hFlippedDC;
|
||||
//EnumDisplayMonitors_Type pEnumDisplayMonitors = NULL;
|
||||
//BOOL WINAPI extEnumDisplayMonitors(HDC, LPCRECT, MONITORENUMPROC, LPARAM);
|
||||
|
||||
typedef BOOL (WINAPI *BringWindowToTop_Type)(HWND);
|
||||
BringWindowToTop_Type pBringWindowToTop = NULL;
|
||||
BOOL WINAPI extBringWindowToTop(HWND);
|
||||
typedef BOOL (WINAPI *SetForegroundWindow_Type)(HWND);
|
||||
SetForegroundWindow_Type pSetForegroundWindow = NULL;
|
||||
BOOL WINAPI extSetForegroundWindow(HWND);
|
||||
typedef HHOOK (WINAPI *SetWindowsHookEx_Type)(int, HOOKPROC, HINSTANCE, DWORD);
|
||||
SetWindowsHookEx_Type pSetWindowsHookExA = NULL;
|
||||
SetWindowsHookEx_Type pSetWindowsHookExW = NULL;
|
||||
HHOOK WINAPI extSetWindowsHookExA(int, HOOKPROC, HINSTANCE, DWORD);
|
||||
HHOOK WINAPI extSetWindowsHookExW(int, HOOKPROC, HINSTANCE, DWORD);
|
||||
typedef HRESULT (WINAPI *MessageBoxTimeoutA_Type)(HWND, LPCSTR, LPCSTR, UINT, WORD, DWORD);
|
||||
MessageBoxTimeoutA_Type pMessageBoxTimeoutA = NULL;
|
||||
HRESULT WINAPI extMessageBoxTimeoutA(HWND, LPCSTR, LPCSTR, UINT, WORD, DWORD);
|
||||
typedef HRESULT (WINAPI *MessageBoxTimeoutW_Type)(HWND, LPCWSTR, LPCWSTR, UINT, WORD, DWORD);
|
||||
MessageBoxTimeoutW_Type pMessageBoxTimeoutW = NULL;
|
||||
HRESULT WINAPI extMessageBoxTimeoutW(HWND, LPCWSTR, LPCWSTR, UINT, WORD, DWORD);
|
||||
typedef BOOL (WINAPI *IsIconic_Type)(HWND);
|
||||
IsIconic_Type pIsIconic = NULL;
|
||||
BOOL WINAPI extIsIconic(HWND);
|
||||
typedef BOOL (WINAPI *IsZoomed_Type)(HWND);
|
||||
IsZoomed_Type pIsZoomed = NULL;
|
||||
BOOL WINAPI extIsZoomed(HWND);
|
||||
typedef HDESK (WINAPI *CreateDesktop_Type)(LPCTSTR, LPCTSTR, DEVMODE *, DWORD, ACCESS_MASK, LPSECURITY_ATTRIBUTES);
|
||||
CreateDesktop_Type pCreateDesktop = NULL;
|
||||
HDESK WINAPI extCreateDesktop(LPCTSTR, LPCTSTR, DEVMODE *, DWORD, ACCESS_MASK, LPSECURITY_ATTRIBUTES);
|
||||
typedef BOOL (WINAPI *SwitchDesktop_Type)(HDESK);
|
||||
SwitchDesktop_Type pSwitchDesktop = NULL;
|
||||
BOOL WINAPI extSwitchDesktop(HDESK);
|
||||
typedef HDESK (WINAPI *OpenDesktop_Type)(LPTSTR, DWORD, BOOL, ACCESS_MASK);
|
||||
OpenDesktop_Type pOpenDesktop = NULL;
|
||||
HDESK WINAPI extOpenDesktop(LPTSTR, DWORD, BOOL, ACCESS_MASK);
|
||||
typedef BOOL (WINAPI *CloseDesktop_Type)(HDESK);
|
||||
CloseDesktop_Type pCloseDesktop = NULL;
|
||||
BOOL WINAPI extCloseDesktop(HDESK);
|
||||
typedef int (WINAPI *ValidateRect_Type)(HWND, const RECT *);
|
||||
ValidateRect_Type pValidateRect = NULL;
|
||||
int WINAPI extValidateRect(HWND, const RECT *);
|
||||
typedef BOOL (WINAPI *ScrollWindow_Type)(HWND, int, int, const RECT *, const RECT *);
|
||||
ScrollWindow_Type pScrollWindow = NULL;
|
||||
BOOL extScrollWindow(HWND, int, int, const RECT *, const RECT *);
|
||||
typedef INT_PTR (WINAPI *DialogBoxParamA_Type)(HINSTANCE, LPCTSTR, HWND, DLGPROC, LPARAM);
|
||||
DialogBoxParamA_Type pDialogBoxParamA = NULL;
|
||||
INT_PTR WINAPI extDialogBoxParamA(HINSTANCE, LPCTSTR, HWND, DLGPROC, LPARAM);
|
||||
typedef HWND (WINAPI *GetParent_Type)(HWND);
|
||||
GetParent_Type pGetParent = NULL;
|
||||
HWND WINAPI extGetParent(HWND);
|
||||
typedef BOOL (WINAPI *InvalidateRgn_Type)(HWND, HRGN, BOOL);
|
||||
InvalidateRgn_Type pInvalidateRgn = NULL;
|
||||
BOOL WINAPI extInvalidateRgn(HWND, HRGN, BOOL);
|
||||
typedef BOOL (WINAPI *InvertRect_Type)(HDC, const RECT *);
|
||||
InvertRect_Type pInvertRect = NULL;
|
||||
BOOL WINAPI extInvertRect(HDC, const RECT *);
|
||||
typedef BOOL (WINAPI *ScrollDC_Type)(HDC, int, int, const RECT *, const RECT *, HRGN, LPRECT);
|
||||
ScrollDC_Type pScrollDC = NULL;
|
||||
BOOL WINAPI extScrollDC(HDC, int, int, const RECT *, const RECT *, HRGN, LPRECT);
|
||||
typedef BOOL (WINAPI *DrawIcon_Type)(HDC hDC, int X, int Y, HICON hIcon);
|
||||
DrawIcon_Type pDrawIcon = NULL;
|
||||
BOOL WINAPI extDrawIcon(HDC hDC, int X, int Y, HICON hIcon);
|
||||
typedef BOOL (WINAPI *DrawIconEx_Type)(HDC, int, int, HICON, int, int, UINT, HBRUSH, UINT);
|
||||
DrawIconEx_Type pDrawIconEx = NULL;
|
||||
BOOL WINAPI extDrawIconEx(HDC, int, int, HICON, int, int, UINT, HBRUSH, UINT);
|
||||
typedef BOOL (WINAPI *DrawCaption_Type)(HWND, HDC, LPCRECT, UINT);
|
||||
DrawCaption_Type pDrawCaption = NULL;
|
||||
BOOL WINAPI extDrawCaption(HWND, HDC, LPCRECT, UINT);
|
||||
typedef BOOL (WINAPI *PaintDesktop_Type)(HDC);
|
||||
PaintDesktop_Type pPaintDesktop = NULL;
|
||||
BOOL WINAPI extPaintDesktop(HDC);
|
||||
typedef VOID (WINAPI *mouse_event_Type)(DWORD, DWORD, DWORD, DWORD, ULONG_PTR);
|
||||
mouse_event_Type pmouse_event = NULL;
|
||||
VOID WINAPI extmouse_event(DWORD, DWORD, DWORD, DWORD, ULONG_PTR);
|
||||
typedef BOOL (WINAPI *ShowScrollBar_Type)(HWND, int, BOOL);
|
||||
ShowScrollBar_Type pShowScrollBar = NULL;
|
||||
BOOL WINAPI extShowScrollBar(HWND, int, BOOL);
|
||||
typedef BOOL (WINAPI *DrawMenuBar_Type)(HWND);
|
||||
DrawMenuBar_Type pDrawMenuBar = NULL;
|
||||
BOOL WINAPI extDrawMenuBar(HWND);
|
||||
//typedef BOOL (WINAPI *TranslateMessage_Type)(MSG *);
|
||||
//TranslateMessage_Type pTranslateMessage = NULL;
|
||||
//BOOL WINAPI extTranslateMessage(MSG *);
|
||||
typedef BOOL (WINAPI *EnumDisplayDevicesA_Type)(LPCSTR, DWORD, PDISPLAY_DEVICE, DWORD);
|
||||
EnumDisplayDevicesA_Type pEnumDisplayDevicesA = NULL;
|
||||
BOOL WINAPI extEnumDisplayDevicesA(LPCSTR, DWORD, PDISPLAY_DEVICE, DWORD);
|
||||
typedef BOOL (WINAPI *EnumDisplayDevicesW_Type)(LPCWSTR, DWORD, PDISPLAY_DEVICEW, DWORD);
|
||||
EnumDisplayDevicesW_Type pEnumDisplayDevicesW = NULL;
|
||||
BOOL WINAPI extEnumDisplayDevicesW(LPCWSTR, DWORD, PDISPLAY_DEVICEW, DWORD);
|
||||
typedef INT_PTR (WINAPI *DialogBoxIndirectParamA_Type)(HINSTANCE, LPCDLGTEMPLATE, HWND, DLGPROC, LPARAM);
|
||||
DialogBoxIndirectParamA_Type pDialogBoxIndirectParamA = NULL;
|
||||
INT_PTR WINAPI extDialogBoxIndirectParamA(HINSTANCE, LPCDLGTEMPLATE, HWND, DLGPROC, LPARAM);
|
||||
typedef HWND (WINAPI *GetFocus_Type)(void);
|
||||
GetFocus_Type pGetFocus;
|
||||
HWND WINAPI extGetFocus(void);
|
||||
//typedef HWND (WINAPI *GetTopWindow_Type)(HWND);
|
||||
//GetTopWindow_Type pGetTopWindow;
|
||||
//HWND WINAPI extGetTopWindow(HWND);
|
||||
typedef DWORD (WINAPI *GetWindowThreadProcessId_Type)(HWND, LPDWORD);
|
||||
GetWindowThreadProcessId_Type pGetWindowThreadProcessId;
|
||||
DWORD WINAPI extGetWindowThreadProcessId(HWND, LPDWORD);
|
||||
typedef HWND (WINAPI *GetWindow_Type)(HWND, UINT);
|
||||
GetWindow_Type pGetWindow;
|
||||
HWND WINAPI extGetWindow(HWND, UINT);
|
||||
typedef BOOL (WINAPI *IsWindow_Type)(HWND);
|
||||
IsWindow_Type pIsWindow;
|
||||
BOOL WINAPI extIsWindow(HWND);
|
||||
typedef HWND (WINAPI *SetFocus_Type)(HWND);
|
||||
SetFocus_Type pSetFocus;
|
||||
HWND WINAPI extSetFocus(HWND);
|
||||
typedef HBITMAP (WINAPI *LoadBitmapA_Type)(HINSTANCE, LPCSTR);
|
||||
LoadBitmapA_Type pLoadBitmapA;
|
||||
HBITMAP WINAPI extLoadBitmapA(HINSTANCE, LPCSTR);
|
||||
typedef BOOL (WINAPI *EnumWindows_Type)(WNDENUMPROC, LPARAM);
|
||||
EnumWindows_Type pEnumWindows;
|
||||
BOOL WINAPI extEnumWindows(WNDENUMPROC, LPARAM);
|
||||
|
||||
typedef BOOL (WINAPI *GetMessage_Type)(LPMSG, HWND, UINT, UINT);
|
||||
GetMessage_Type pGetMessageA, pGetMessageW;
|
||||
BOOL WINAPI extGetMessageA(LPMSG, HWND, UINT, UINT);
|
||||
BOOL WINAPI extGetMessageW(LPMSG, HWND, UINT, UINT);
|
||||
typedef BOOL (WINAPI *PostMessage_Type)(HWND, UINT, WPARAM, LPARAM);
|
||||
PostMessage_Type pPostMessageA, pPostMessageW;
|
||||
BOOL WINAPI extPostMessageA(HWND, UINT, WPARAM, LPARAM);
|
||||
BOOL WINAPI extPostMessageW(HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
#ifdef TRACEPALETTE
|
||||
typedef UINT (WINAPI *GetDIBColorTable_Type)(HDC, UINT, UINT, RGBQUAD *);
|
||||
@ -1026,14 +904,6 @@ BOOL WINAPI extSetWindowPos(HWND hwnd, HWND hWndInsertAfter, int X, int Y, int c
|
||||
|
||||
res=(*pSetWindowPos)(hwnd, hWndInsertAfter, X, Y, cx, cy, uFlags);
|
||||
if(!res)OutTraceE("SetWindowPos: ERROR err=%d at %d\n", GetLastError(), __LINE__);
|
||||
|
||||
//HFONT hFont;
|
||||
//hFont=CreateFont (
|
||||
// 30, 0, 0, 0, FW_DONTCARE, FALSE, FALSE,
|
||||
// FALSE, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
|
||||
// DEFAULT_PITCH | FF_SWISS, NULL); // "Arial");
|
||||
//SendMessage (hwnd, WM_SETFONT, WPARAM (hFont), TRUE);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -1135,13 +1005,10 @@ LRESULT WINAPI extSendMessage(char *apiname, SendMessage_Type pSendMessage, HWND
|
||||
lParam = MAKELPARAM(curr.x, curr.y);
|
||||
OutTraceC("%s: hwnd=%x pos XY=(%d,%d)->(%d,%d)\n", apiname, hwnd, prev.x, prev.y, curr.x, curr.y);
|
||||
break;
|
||||
#if 1
|
||||
// unnecessaty: set "Bypass font unsupported api" ??
|
||||
case WM_FONTCHANGE:
|
||||
// suppress WM_FONTCHANGE avoids "Warhammer: Shadow of the Horned Rat" crash when entering battle
|
||||
return 0;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1704,10 +1571,13 @@ static BOOL IsFullscreenWindow(
|
||||
|
||||
static HWND hLastFullScrWin = 0;
|
||||
static DDPIXELFORMAT ddpLastPixelFormat;
|
||||
#define SAFEWINDOWCREATION TRUE
|
||||
|
||||
typedef HWND (WINAPI *CreateWindow_Type)(DWORD, LPVOID, LPVOID, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, LPVOID);
|
||||
|
||||
static HWND WINAPI CreateWindowCommon(
|
||||
LPCTSTR ApiName,
|
||||
BOOL WideChar,
|
||||
CreateWindow_Type pCreateWindow,
|
||||
DWORD dwExStyle,
|
||||
void *lpClassName,
|
||||
void *lpWindowName,
|
||||
@ -1726,15 +1596,19 @@ static HWND WINAPI CreateWindowCommon(
|
||||
BOOL isNewDesktop;
|
||||
int iOrigW, iOrigH;
|
||||
extern void GetMonitorWorkarea(int, LPRECT, BOOL);
|
||||
int origx, origy, origw, origh;
|
||||
DWORD origstyle, origexstyle;
|
||||
origx = x;
|
||||
origy = y;
|
||||
origw = nWidth;
|
||||
origh = nHeight;
|
||||
origstyle = dwStyle;
|
||||
origexstyle = dwExStyle;
|
||||
|
||||
iOrigW=nWidth;
|
||||
iOrigH=nHeight;
|
||||
if(!dxw.Windowize || (hWndParent == HWND_MESSAGE)){ // v2.02.87: don't process message windows (hWndParent == HWND_MESSAGE)
|
||||
if(WideChar)
|
||||
hwnd= (*pCreateWindowExW)(dwExStyle, (LPCWSTR)lpClassName, (LPCWSTR)lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
|
||||
else
|
||||
hwnd= (*pCreateWindowExA)(dwExStyle, (LPCSTR)lpClassName, (LPCSTR)lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
|
||||
|
||||
hwnd= (*pCreateWindow)(dwExStyle, lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
|
||||
if ((dxw.dwFlags1 & HOOKCHILDWIN) && (dwStyle & (WS_CHILD|WS_DLGFRAME)))
|
||||
HookChildWndProc(hwnd, dwStyle, ApiName);
|
||||
|
||||
@ -1789,10 +1663,7 @@ static HWND WINAPI CreateWindowCommon(
|
||||
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);
|
||||
else
|
||||
hwnd= (*pCreateWindowExA)(dwExStyle, (LPCSTR)lpClassName, (LPCSTR)lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
|
||||
hwnd= (*pCreateWindow)(dwExStyle, lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
|
||||
OutTraceDW("%s: windowed mode ret=%x\n", ApiName, hwnd);
|
||||
return hwnd;
|
||||
}
|
||||
@ -1826,10 +1697,24 @@ static HWND WINAPI CreateWindowCommon(
|
||||
// v2.04.05: the semaphore must be a counter, since within the CreateWin callback there could be other CreateWin calls.
|
||||
// happens in "Warhammer: Shadow of the Horned Rat" !
|
||||
InMainWinCreation++;
|
||||
if(WideChar)
|
||||
hwnd= (*pCreateWindowExW)(dwExStyle, (LPCWSTR)lpClassName, (LPCWSTR)lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
|
||||
else
|
||||
hwnd= (*pCreateWindowExA)(dwExStyle, (LPCSTR)lpClassName, (LPCSTR)lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
|
||||
#if 1
|
||||
// SAFEWINDOWCREATION mode: fixes problems of "Warhammer shadow of the Horned rat", but also allows "Diablo" to run in fake fullscreen high-res mode.
|
||||
// this way, any creation callback routine invoked within the window creation will receive only the original call parameters, while the new scaled
|
||||
// values and adjusted styles will be applied only after the creation.
|
||||
hwnd= (*pCreateWindow)(origexstyle, lpClassName, lpWindowName, origstyle, origx, origy, origw, origh, hWndParent, hMenu, hInstance, lpParam);
|
||||
if (hwnd) {
|
||||
(*pSetWindowLong)(hwnd, GWL_STYLE, dwStyle);
|
||||
(*pSetWindowLong)(hwnd, GWL_EXSTYLE, dwExStyle);
|
||||
(*pMoveWindow)(hwnd, x, y, nWidth, nHeight, FALSE);
|
||||
}
|
||||
#endif
|
||||
#if 0
|
||||
hwnd= (*pCreateWindow)(dwExStyle, lpClassName, lpWindowName, dwStyle, origx, origy, origw, origh, hWndParent, hMenu, hInstance, lpParam);
|
||||
if (hwnd)(*pMoveWindow)(hwnd, x, y, nWidth, nHeight, FALSE);
|
||||
#endif
|
||||
#if 0
|
||||
hwnd= (*pCreateWindow)(dwExStyle, lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
|
||||
#endif
|
||||
InMainWinCreation--;
|
||||
|
||||
if (hwnd==(HWND)NULL){
|
||||
@ -1921,10 +1806,10 @@ HWND WINAPI extCreateWindowExW(
|
||||
else sprintf(wString,"%d", nWidth);
|
||||
if (nHeight==CW_USEDEFAULT) strcpy(hString,"CW_USEDEFAULT");
|
||||
else sprintf(hString,"%d", nHeight);
|
||||
OutTrace("CreateWindowExW: class=\"%ls\" wname=\"%ls\" pos=(%s,%s) size=(%s,%s) Style=%x(%s) ExStyle=%x(%s) hWndParent=%x%s hMenu=%x\n",
|
||||
OutTrace("CreateWindowExW: class=\"%ls\" wname=\"%ls\" pos=(%s,%s) size=(%s,%s) Style=%x(%s) ExStyle=%x(%s) hWndParent=%x%s hMenu=%x depth=%d\n",
|
||||
ClassToWStr(lpClassName), lpWindowName, xString, yString, wString, hString,
|
||||
dwStyle, ExplainStyle(dwStyle), dwExStyle, ExplainExStyle(dwExStyle),
|
||||
hWndParent, hWndParent==HWND_MESSAGE?"(HWND_MESSAGE)":"", hMenu);
|
||||
hWndParent, hWndParent==HWND_MESSAGE?"(HWND_MESSAGE)":"", hMenu, InMainWinCreation);
|
||||
}
|
||||
OutTraceB("CreateWindowExW: DEBUG fullscreen=%x mainwin=%x screen=(%d,%d)\n",
|
||||
dxw.IsFullScreen(), dxw.GethWnd(), dxw.GetScreenWidth(), dxw.GetScreenHeight());
|
||||
@ -1936,7 +1821,7 @@ HWND WINAPI extCreateWindowExW(
|
||||
nHeight = MainWin.bottom;
|
||||
}
|
||||
|
||||
return CreateWindowCommon("CreateWindowExW", TRUE, dwExStyle, (void *)lpClassName, (void *)lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
|
||||
return CreateWindowCommon("CreateWindowExW", (CreateWindow_Type)pCreateWindowExW, dwExStyle, (void *)lpClassName, (void *)lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
|
||||
}
|
||||
|
||||
// GHO: pro Diablo
|
||||
@ -1964,10 +1849,10 @@ HWND WINAPI extCreateWindowExA(
|
||||
else sprintf(wString,"%d", nWidth);
|
||||
if (nHeight==CW_USEDEFAULT) strcpy(hString,"CW_USEDEFAULT");
|
||||
else sprintf(hString,"%d", nHeight);
|
||||
OutTrace("CreateWindowExA: class=\"%s\" wname=\"%s\" pos=(%s,%s) size=(%s,%s) Style=%x(%s) ExStyle=%x(%s) hWndParent=%x%s hMenu=%x\n",
|
||||
OutTrace("CreateWindowExA: class=\"%s\" wname=\"%s\" pos=(%s,%s) size=(%s,%s) Style=%x(%s) ExStyle=%x(%s) hWndParent=%x%s hMenu=%x depth=%d\n",
|
||||
ClassToStr(lpClassName), lpWindowName, xString, yString, wString, hString,
|
||||
dwStyle, ExplainStyle(dwStyle), dwExStyle, ExplainExStyle(dwExStyle),
|
||||
hWndParent, hWndParent==HWND_MESSAGE?"(HWND_MESSAGE)":"", hMenu);
|
||||
hWndParent, hWndParent==HWND_MESSAGE?"(HWND_MESSAGE)":"", hMenu, InMainWinCreation);
|
||||
}
|
||||
OutTraceB("CreateWindowExA: DEBUG fullscreen=%x mainwin=%x screen=(%d,%d)\n",
|
||||
dxw.IsFullScreen(), dxw.GethWnd(), dxw.GetScreenWidth(), dxw.GetScreenHeight());
|
||||
@ -1979,7 +1864,7 @@ HWND WINAPI extCreateWindowExA(
|
||||
nHeight = MainWin.bottom;
|
||||
}
|
||||
|
||||
return CreateWindowCommon("CreateWindowExA", FALSE, dwExStyle, (void *)lpClassName, (void *)lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
|
||||
return CreateWindowCommon("CreateWindowExA", (CreateWindow_Type)CreateWindowExA, dwExStyle, (void *)lpClassName, (void *)lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
|
||||
}
|
||||
|
||||
extern void ExplainMsg(char *, HWND, UINT, WPARAM, LPARAM);
|
||||
@ -1993,6 +1878,11 @@ LRESULT WINAPI extCallWindowProcA(WNDPROC lpPrevWndFunc, HWND hwnd, UINT Msg, WP
|
||||
res = -1;
|
||||
if(hwnd == dxw.GethWnd()) res=FixWindowProc("CallWindowProcA", hwnd, Msg, wParam, &lParam);
|
||||
|
||||
if((dxw.dwFlags1 & FIXTEXTOUT) && (Msg == WM_SETFONT)){
|
||||
wParam = (WPARAM)fontdb.GetScaledFont((HFONT)wParam);
|
||||
OutTraceDW("CallWindowProcA: replaced scaled font hfnt=%x\n", wParam);
|
||||
}
|
||||
|
||||
if (res==(HRESULT)-1)
|
||||
return (*pCallWindowProcA)(lpPrevWndFunc, hwnd, Msg, wParam, lParam);
|
||||
else
|
||||
@ -2008,6 +1898,11 @@ LRESULT WINAPI extCallWindowProcW(WNDPROC lpPrevWndFunc, HWND hwnd, UINT Msg, WP
|
||||
res = -1;
|
||||
if(hwnd == dxw.GethWnd()) res=FixWindowProc("CallWindowProcW", hwnd, Msg, wParam, &lParam);
|
||||
|
||||
if((dxw.dwFlags1 & FIXTEXTOUT) && (Msg == WM_SETFONT)){
|
||||
wParam = (WPARAM)fontdb.GetScaledFont((HFONT)wParam);
|
||||
OutTraceDW("CallWindowProcA: replaced scaled font hfnt=%x\n", wParam);
|
||||
}
|
||||
|
||||
if (res==(HRESULT)-1)
|
||||
return (*pCallWindowProcW)(lpPrevWndFunc, hwnd, Msg, wParam, lParam);
|
||||
else
|
||||
|
@ -672,7 +672,7 @@ static void ShowJoystick(LONG x, LONG y, DWORD dwButtons)
|
||||
|
||||
if(g_hbmJoy == NULL) return; // show nothing ...
|
||||
|
||||
HBITMAP hbmOld = (HBITMAP)SelectObject(hdcMem, g_hbmJoy);
|
||||
HBITMAP hbmOld = (HBITMAP)(*pSelectObject)(hdcMem, g_hbmJoy);
|
||||
GetObject(g_hbmJoy, sizeof(bm), &bm);
|
||||
|
||||
(*pGetWindowRect)(dxw.GethWnd(), &win);
|
||||
@ -684,7 +684,7 @@ static void ShowJoystick(LONG x, LONG y, DWORD dwButtons)
|
||||
(*pGDIBitBlt)(hClientDC, x-(w>>1), y-(h>>1), w, h, hdcMem, 0, 0, SRCPAINT);
|
||||
|
||||
(*pSetViewportOrgEx)(hClientDC, PrevViewPort.x, PrevViewPort.y, NULL);
|
||||
SelectObject(hdcMem, hbmOld);
|
||||
(*pSelectObject)(hdcMem, hbmOld);
|
||||
DeleteDC(hdcMem);
|
||||
}
|
||||
|
||||
|
@ -48,6 +48,7 @@ void CTabDirectX2::DoDataExchange(CDataExchange* pDX)
|
||||
DDX_Check(pDX, IDC_CLEARTEXTUREFOURCC, cTarget->m_ClearTextureFourCC);
|
||||
DDX_Check(pDX, IDC_NODDEXCLUSIVEMODE, cTarget->m_NoDDExclusiveMode);
|
||||
DDX_Check(pDX, IDC_CREATEDESKTOP, cTarget->m_CreateDesktop);
|
||||
DDX_Check(pDX, IDC_ALLOWSYSMEMON3DDEV, cTarget->m_AllowSysmemOn3DDev);
|
||||
|
||||
// Vsync
|
||||
//DDX_Check(pDX, IDC_SAVELOAD, cTarget->m_SaveLoad);
|
||||
|
@ -31,6 +31,7 @@ void CTabSysLibs::DoDataExchange(CDataExchange* pDX)
|
||||
DDX_Check(pDX, IDC_CLIENTREMAPPING, cTarget->m_ClientRemapping);
|
||||
DDX_Radio(pDX, IDC_GDINONE, cTarget->m_DCEmulationMode);
|
||||
DDX_Check(pDX, IDC_FIXTEXTOUT, cTarget->m_FixTextOut);
|
||||
DDX_Check(pDX, IDC_QUALITYFONTS, cTarget->m_QualityFonts);
|
||||
DDX_Check(pDX, IDC_NOFILLRECT, cTarget->m_NoFillRect);
|
||||
DDX_Check(pDX, IDC_FIXCLIPPERAREA, cTarget->m_FixClipperArea);
|
||||
DDX_Check(pDX, IDC_SYNCPALETTE, cTarget->m_SyncPalette);
|
||||
|
@ -211,6 +211,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/)
|
||||
m_ClearTextureFourCC = FALSE;
|
||||
m_NoDDExclusiveMode = FALSE;
|
||||
m_CreateDesktop = FALSE;
|
||||
m_AllowSysmemOn3DDev = FALSE;
|
||||
m_VSyncMode = 0;
|
||||
m_VSyncImpl = 0;
|
||||
m_WaitMode = 0;
|
||||
@ -254,6 +255,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/)
|
||||
m_NoWinErrors = FALSE;
|
||||
m_PretendVisible = FALSE;
|
||||
m_WinInsulation = FALSE;
|
||||
m_QualityFonts = FALSE;
|
||||
m_AnalyticMode = FALSE;
|
||||
m_NoPaletteUpdate = FALSE;
|
||||
m_WireFrame = FALSE;
|
||||
|
@ -165,6 +165,7 @@ public:
|
||||
BOOL m_ClearTextureFourCC;
|
||||
BOOL m_NoDDExclusiveMode;
|
||||
BOOL m_CreateDesktop;
|
||||
BOOL m_AllowSysmemOn3DDev;
|
||||
//BOOL m_ForceVSync;
|
||||
//BOOL m_ForceNoVSync;
|
||||
//BOOL m_ForceWait;
|
||||
@ -210,6 +211,7 @@ public:
|
||||
BOOL m_NoWinErrors;
|
||||
BOOL m_PretendVisible;
|
||||
BOOL m_WinInsulation;
|
||||
BOOL m_QualityFonts;
|
||||
BOOL m_AnalyticMode;
|
||||
BOOL m_NoPaletteUpdate;
|
||||
BOOL m_LimitResources;
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -485,6 +485,7 @@ void SetTargetFromDlg(TARGETMAP *t, CTargetDlg *dlg)
|
||||
if(dlg->m_ClearTextureFourCC) t->flags7 |= CLEARTEXTUREFOURCC;
|
||||
if(dlg->m_NoDDExclusiveMode) t->flags7 |= NODDEXCLUSIVEMODE;
|
||||
if(dlg->m_CreateDesktop) t->flags6 |= CREATEDESKTOP;
|
||||
if(dlg->m_AllowSysmemOn3DDev) t->flags8 |= ALLOWSYSMEMON3DDEV;
|
||||
if(dlg->m_HandleAltF4) t->flags |= HANDLEALTF4;
|
||||
if(dlg->m_LimitFPS) t->flags2 |= LIMITFPS;
|
||||
if(dlg->m_SkipFPS) t->flags2 |= SKIPFPS;
|
||||
@ -529,6 +530,7 @@ void SetTargetFromDlg(TARGETMAP *t, CTargetDlg *dlg)
|
||||
if(dlg->m_NoWinErrors) t->flags7 |= NOWINERRORS;
|
||||
if(dlg->m_PretendVisible) t->flags8 |= PRETENDVISIBLE;
|
||||
if(dlg->m_WinInsulation) t->flags8 |= WININSULATION;
|
||||
if(dlg->m_QualityFonts) t->flags8 |= QUALITYFONTS;
|
||||
if(dlg->m_AnalyticMode) t->flags3 |= ANALYTICMODE;
|
||||
if(dlg->m_ReplacePrivOps) t->flags5 |= REPLACEPRIVOPS;
|
||||
if(dlg->m_InitialRes) t->flags7 |= INITIALRES;
|
||||
@ -809,6 +811,7 @@ static void SetDlgFromTarget(TARGETMAP *t, CTargetDlg *dlg)
|
||||
dlg->m_ClearTextureFourCC = t->flags7 & CLEARTEXTUREFOURCC ? 1 : 0;
|
||||
dlg->m_NoDDExclusiveMode = t->flags7 & NODDEXCLUSIVEMODE ? 1 : 0;
|
||||
dlg->m_CreateDesktop = t->flags6 & CREATEDESKTOP ? 1 : 0;
|
||||
dlg->m_AllowSysmemOn3DDev = t->flags8 & ALLOWSYSMEMON3DDEV ? 1 : 0;
|
||||
dlg->m_HandleAltF4 = t->flags & HANDLEALTF4 ? 1 : 0;
|
||||
dlg->m_LimitFPS = t->flags2 & LIMITFPS ? 1 : 0;
|
||||
dlg->m_SkipFPS = t->flags2 & SKIPFPS ? 1 : 0;
|
||||
@ -853,6 +856,7 @@ static void SetDlgFromTarget(TARGETMAP *t, CTargetDlg *dlg)
|
||||
dlg->m_NoWinErrors = t->flags7 & NOWINERRORS ? 1 : 0;
|
||||
dlg->m_PretendVisible = t->flags8 & PRETENDVISIBLE ? 1 : 0;
|
||||
dlg->m_WinInsulation = t->flags8 & WININSULATION ? 1 : 0;
|
||||
dlg->m_QualityFonts = t->flags8 & QUALITYFONTS ? 1 : 0;
|
||||
dlg->m_AnalyticMode = t->flags3 & ANALYTICMODE ? 1 : 0;
|
||||
dlg->m_ReplacePrivOps = t->flags5 & REPLACEPRIVOPS ? 1 : 0;
|
||||
dlg->m_InitialRes = t->flags7 & INITIALRES ? 1 : 0;
|
||||
@ -3350,7 +3354,7 @@ void CDxwndhostView::OnRun(BOOL bForceNoHook)
|
||||
if(MessageBoxLang(DXW_STRING_VREG_UPDATE,DXW_STRING_WARNING, MB_OKCANCEL|MB_ICONINFORMATION)==IDOK)
|
||||
this->SaveConfigFile();
|
||||
}
|
||||
OutTrace("export virtual registry\n");
|
||||
OutTrace("export virtual registry entry[%d]\n");
|
||||
FILE *regfp;
|
||||
char *Registry;
|
||||
Registry = PrivateMaps[i].registry;
|
||||
|
BIN
host/resource
BIN
host/resource
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user