mirror of
https://github.com/DxWnd/DxWnd.reloaded
synced 2024-12-30 09:25:35 +01:00
v2_02_30_src
Former-commit-id: 5769977f0e9616d3d69752ed853e8fc2d8aa1550
This commit is contained in:
parent
3ac3a3dfa3
commit
884ef0807b
@ -89,6 +89,9 @@
|
||||
#define BLACKWHITE 0x00000080 // Simulate a B&W screen monitor mapping colors to grayscales
|
||||
#define SAVECAPS 0x00000100 // Saves and restores original surface flags & capabilities
|
||||
#define SINGLEPROCAFFINITY 0x00000200 // Set Process Affinity to a single core
|
||||
#define EMULATEREGISTRY 0x00000400 // Emulate registry api to read extra keys
|
||||
#define CDROMDRIVETYPE 0x00000800 // Pretends that GetDriveType() always returns DRIVE_CDROM
|
||||
#define NOWINDOWMOVE 0x00001000 // Do not try to update window position & size on D3D rendering
|
||||
|
||||
// logging Tflags DWORD:
|
||||
#define OUTTRACE 0x00000001 // enables tracing to dxwnd.log in general
|
||||
@ -100,6 +103,7 @@
|
||||
#define ASSERTDIALOG 0x00000040 // show assert messages in Dialog Box
|
||||
#define OUTIMPORTTABLE 0x00000080 // dump import table contents
|
||||
#define OUTDEBUG 0x00000100 // detailed debugging indormation
|
||||
#define OUTREGISTRY 0x00000200 // log registry operations
|
||||
|
||||
#define EMULATEFLAGS (EMULATEBUFFER | EMULATESURFACE | LOCKEDSURFACE)
|
||||
#define HANDLEFPS (SHOWFPS | SHOWFPSOVERLAY | LIMITFPS | SKIPFPS)
|
||||
@ -172,6 +176,7 @@ LRESULT CALLBACK extWindowProc(HWND, UINT, WPARAM, LPARAM);
|
||||
#define OutTraceD if(dxw.dwTFlags & OUTDDRAWTRACE) OutTrace
|
||||
#define OutTraceC if(dxw.dwTFlags & OUTCURSORTRACE) OutTrace
|
||||
#define OutTraceB if(dxw.dwTFlags & OUTDEBUG) OutTrace
|
||||
#define OutTraceR if(dxw.dwTFlags & OUTREGISTRY) OutTrace
|
||||
#define OutTraceP OutTrace
|
||||
#define OutTraceE OutTrace
|
||||
|
||||
@ -179,6 +184,7 @@ LRESULT CALLBACK extWindowProc(HWND, UINT, WPARAM, LPARAM);
|
||||
#define IsTraceX (dxw.dwTFlags & OUTPROXYTRACE)
|
||||
#define IsTraceD (dxw.dwTFlags & OUTDDRAWTRACE)
|
||||
#define IsTraceC (dxw.dwTFlags & OUTCURSORTRACE)
|
||||
#define IsTraceR (dxw.dwTFlags & OUTREGISTRY)
|
||||
#define IsTraceP (TRUE)
|
||||
#define IsTraceE (TRUE)
|
||||
#define IsDebug (dxw.dwTFlags & OUTDEBUG)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c374369324c6043bc75325e062677c9dc8755d0f27d6a013d54eb2065883ea0a
|
||||
size 352768
|
||||
oid sha256:0df4a17760b4266a73aaf34565be1febb6bcf0d2fc0d776ca6aeb7fb6c861e28
|
||||
size 365568
|
||||
|
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e240953c0bad229baff47ef4265a34e717615da2a784cff305e2983a3bc4467d
|
||||
size 523264
|
||||
oid sha256:2f9e10ed36d2163eb58084363d6e218f827109487beda4962fd48c59fed8b1e8
|
||||
size 524288
|
||||
|
5651
build/dxwnd.ini
5651
build/dxwnd.ini
File diff suppressed because it is too large
Load Diff
@ -182,8 +182,16 @@ fixed d3d8/9 hook to Get/SetGammaRamp. This should make a great number of recent
|
||||
v2.02.29
|
||||
CORE:
|
||||
hooked DirectDrawSurface::Lock method to center primary surface memory updates centered into the window (in no emulated mode)
|
||||
added "Locked surface" emulation type to enable scaled blitting to primary surface to stretch to the correct area.
|
||||
Fixed BltFast handling to fix "Duckman" rendering problems.
|
||||
GUI:
|
||||
added support for "Locked surface" emulation type
|
||||
|
||||
v2.02.30
|
||||
CORE:
|
||||
Some ddraw::GetDC log message fixes
|
||||
added preliminary registry emulation - tested ok with "duckman"
|
||||
added separate flag for preliminary registry operation trace
|
||||
added CDROM drive type emulation - tested ok with "Fighting Forces" RIP
|
||||
fixed FixCursorPos routine: cursor x,y compensation must always use pseudo-fullscreen window parameters - fixes Imperialism II mouse problems
|
||||
fixed Desktop Workarea position mode for ddraw games
|
||||
added CoCreateInstanceEx hook - "Final Fighter" seems to be using it, but who knows why...?
|
||||
added "Don't move D3D Rendering Window" window option to make "Fable Lost Chapters" working
|
||||
GUI:
|
||||
updated default values on new entry creation to map most-likely-to-work parameters
|
||||
|
248
dll/advapi.cpp
Normal file
248
dll/advapi.cpp
Normal file
@ -0,0 +1,248 @@
|
||||
#include <stdio.h>
|
||||
#include "dxwnd.h"
|
||||
#include "dxwcore.hpp"
|
||||
#include "syslibs.h"
|
||||
#include "dxhook.h"
|
||||
#include "dxhelper.h"
|
||||
|
||||
static HookEntry_Type Hooks[]={
|
||||
{"RegOpenKeyExA", NULL, (FARPROC *)&pRegOpenKeyEx, (FARPROC)extRegOpenKeyEx},
|
||||
{"RegCloseKey", NULL, (FARPROC *)&pRegCloseKey, (FARPROC)extRegCloseKey},
|
||||
{"RegQueryValueExA", NULL, (FARPROC *)&pRegQueryValueEx, (FARPROC)extRegQueryValueEx},
|
||||
{"RegCreateKeyExA", NULL, (FARPROC *)&pRegCreateKeyEx, (FARPROC)extRegCreateKeyEx},
|
||||
{"RegSetValueExA", NULL, (FARPROC *)&pRegSetValueEx, (FARPROC)extRegSetValueEx},
|
||||
{0, NULL, 0, 0} // terminator
|
||||
};
|
||||
|
||||
void HookAdvApi32(HMODULE module)
|
||||
{
|
||||
HookLibrary(module, Hooks, "ADVAPI32.dll");
|
||||
}
|
||||
|
||||
FARPROC Remap_AdvApi32_ProcAddress(LPCSTR proc, HMODULE hModule)
|
||||
{
|
||||
FARPROC addr;
|
||||
if (addr=RemapLibrary(proc, hModule, Hooks)) return addr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#define HKEY_FAKE ((HKEY)0x7FFFFFFF)
|
||||
#define HKEY_MASK 0x7FFFFF00
|
||||
#define IsFake(hKey) (((DWORD)hKey & HKEY_MASK) == HKEY_MASK)
|
||||
|
||||
static char *hKey2String(HKEY hKey)
|
||||
{
|
||||
char *skey;
|
||||
static char skeybuf[10];
|
||||
if(IsFake(hKey)) return "HKEY_FAKE";
|
||||
switch((ULONG)hKey){
|
||||
case HKEY_CLASSES_ROOT: skey="HKEY_CLASSES_ROOT"; break;
|
||||
case HKEY_CURRENT_CONFIG: skey="HKEY_CURRENT_CONFIG"; break;
|
||||
case HKEY_CURRENT_USER: skey="HKEY_CURRENT_USER"; break;
|
||||
case HKEY_LOCAL_MACHINE: skey="HKEY_LOCAL_MACHINE"; break;
|
||||
case HKEY_USERS: skey="HKEY_USERS"; break;
|
||||
default: sprintf(skeybuf, "0x%x", hKey); skey=skeybuf; break;
|
||||
}
|
||||
return skey;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------
|
||||
|
||||
LONG WINAPI extRegOpenKeyEx(
|
||||
HKEY hKey,
|
||||
LPCTSTR lpSubKey,
|
||||
DWORD ulOptions,
|
||||
REGSAM samDesired,
|
||||
PHKEY phkResult)
|
||||
{
|
||||
LONG res;
|
||||
char RegBuf[256+1];
|
||||
|
||||
OutTraceR("RegOpenKeyEx: hKey=%x(%s) SubKey=\"%s\" Options=%x\n",
|
||||
hKey, hKey2String(hKey), lpSubKey, ulOptions);
|
||||
res=(*pRegOpenKeyEx)(hKey, lpSubKey, ulOptions, samDesired, phkResult);
|
||||
OutTraceR("RegOpenKeyEx: res=%x\n", res);
|
||||
|
||||
if((res==ERROR_SUCCESS) || !(dxw.dwFlags3 & EMULATEREGISTRY)) return res;
|
||||
|
||||
*phkResult=HKEY_FAKE;
|
||||
FILE *regf;
|
||||
char sKey[256+1];
|
||||
sprintf(sKey,"%s\\%s", hKey2String(hKey), lpSubKey);
|
||||
OutTraceD("RegOpenKeyEx: searching for key=\"%s\"\n", sKey);
|
||||
regf=fopen("dxwnd.reg","r");
|
||||
if(regf==NULL) return ERROR_FILE_NOT_FOUND;
|
||||
fgets(RegBuf, 256, regf);
|
||||
while (!feof(regf)){
|
||||
if(RegBuf[0]=='['){
|
||||
if(!strncmp(&RegBuf[1],sKey,strlen(sKey)) && RegBuf[strlen(sKey)+1]==']'){
|
||||
OutTraceD("RegOpenKeyEx: found fake Key=\"%s\" hkResult=%x\n", sKey, *phkResult);
|
||||
fclose(regf);
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
else (*phkResult)--;
|
||||
}
|
||||
fgets(RegBuf, 256, regf);
|
||||
}
|
||||
fclose(regf);
|
||||
return ERROR_FILE_NOT_FOUND;
|
||||
}
|
||||
|
||||
LONG WINAPI extRegQueryValueEx(
|
||||
HKEY hKey,
|
||||
LPCTSTR lpValueName,
|
||||
LPDWORD lpReserved,
|
||||
LPDWORD lpType,
|
||||
LPBYTE lpData,
|
||||
LPDWORD lpcbData)
|
||||
{
|
||||
LONG res;
|
||||
|
||||
OutTraceR("RegQueryValueEx: hKey=%x(%s) ValueName=\"%s\" Reserved=%x\n", hKey, hKey2String(hKey), lpValueName, lpReserved);
|
||||
if (!IsFake(hKey)){
|
||||
res=(*pRegQueryValueEx)(hKey, lpValueName, lpReserved, lpType, lpData, lpcbData);
|
||||
if(IsTraceR){
|
||||
if (res==ERROR_SUCCESS){
|
||||
OutTrace("RegQueryValueEx: size=%d type=%x(%s) ",
|
||||
lpcbData?*lpcbData:0, lpType?*lpType:0, lpType?ExplainRegType(*lpType):"none");
|
||||
if(lpType) switch(*lpType){
|
||||
case REG_SZ: OutTrace("Data=\"%s\"\n", lpData); break;
|
||||
case REG_DWORD: OutTrace("Data=0x%x\n", *(DWORD *)lpData); break;
|
||||
case REG_BINARY:
|
||||
{
|
||||
int i;
|
||||
unsigned char *p;
|
||||
p = lpData;
|
||||
OutTrace("Data=");
|
||||
for(i=0; i<*lpcbData; i++) OutTrace("%02.2X,", *p++);
|
||||
OutTrace("\n");
|
||||
}
|
||||
break;
|
||||
default: OutTrace("Data=???\n"); break;
|
||||
}
|
||||
else
|
||||
OutTrace("\n");
|
||||
}
|
||||
else
|
||||
OutTrace("res=%x\n", res);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
// going through here means we're in EMULATEREGISTRY mode
|
||||
//if(!(dxw.dwFlags3 & EMULATEREGISTRY)) return res;
|
||||
|
||||
// try emulated registry
|
||||
FILE *regf;
|
||||
char RegBuf[256+1];
|
||||
char *pData;
|
||||
HKEY hCurKey=HKEY_FAKE+1;
|
||||
regf=fopen("dxwnd.reg","r");
|
||||
if(regf==NULL) return ERROR_FILE_NOT_FOUND;
|
||||
if(!lpValueName)lpValueName="";
|
||||
fgets(RegBuf, 256, regf);
|
||||
while (!feof(regf)){
|
||||
if(RegBuf[0]=='['){
|
||||
hCurKey--;
|
||||
}
|
||||
else {
|
||||
if(hCurKey==hKey){
|
||||
|
||||
//OutTraceD("loop: \"%s\"\n", RegBuf);
|
||||
if((RegBuf[0]=='"') &&
|
||||
!strncmp(lpValueName, &RegBuf[1], strlen(lpValueName)) &&
|
||||
(RegBuf[strlen(lpValueName)+1]=='"') &&
|
||||
(RegBuf[strlen(lpValueName)+2]=='='))
|
||||
{
|
||||
res=ERROR_FILE_NOT_FOUND;
|
||||
pData=&RegBuf[strlen(lpValueName)+3];
|
||||
if(*pData=='"'){ // string value
|
||||
//strcpy((char *)lpData, &RegBuf[strlen(lpValueName)+4]);
|
||||
//lpData[strlen((char *)lpData)-2]=0; // eliminates " and \n
|
||||
//if(lpType) *lpType=REG_SZ;
|
||||
//*lpcbData=strlen((char *)lpData)+1;
|
||||
*lpcbData=0;
|
||||
pData++;
|
||||
while(*pData && (*pData != '"')){
|
||||
if(*pData=='\\') pData++;
|
||||
*lpData++=*pData++;
|
||||
*lpcbData++;
|
||||
}
|
||||
if(lpType) *lpType=REG_SZ;
|
||||
//
|
||||
OutTraceD("RegQueryValueEx: Data=\"%s\" type=REG_SZ\n", lpData);
|
||||
res=ERROR_SUCCESS;
|
||||
}
|
||||
if(!strncmp(pData,"dword:",strlen("dword:"))){ //dword value
|
||||
DWORD val;
|
||||
pData+=strlen("dword:");
|
||||
sscanf(pData, "%x", &val);
|
||||
memcpy(lpData, &val, sizeof(DWORD));
|
||||
if(lpType) *lpType=REG_DWORD;
|
||||
*lpcbData=sizeof(DWORD);
|
||||
OutTraceD("RegQueryValueEx: Data=0x%x type=REG_DWORD\n", val);
|
||||
res=ERROR_SUCCESS;
|
||||
}
|
||||
if(!strncmp(pData,"hex:",strlen("hex:"))){ //dword value
|
||||
pData+=strlen("hex:");
|
||||
lpData[strlen((char *)lpData)-1]=0; // eliminates \n
|
||||
if(lpType) *lpType=REG_BINARY;
|
||||
*lpcbData=0;
|
||||
OutTraceD("RegQueryValueEx: Data=");
|
||||
while(strlen(pData)>1){
|
||||
sscanf(pData, "%x,", (char *)lpData);
|
||||
OutTraceD("%02.2x,", *(unsigned char *)lpData);
|
||||
pData+=3;
|
||||
lpData++;
|
||||
(*lpcbData)++;
|
||||
}
|
||||
OutTraceD(" type=REG_BINARY cbData=%d\n", *lpcbData);
|
||||
res=ERROR_SUCCESS;
|
||||
}
|
||||
fclose(regf);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
fgets(RegBuf, 256, regf);
|
||||
}
|
||||
fclose(regf);
|
||||
return ERROR_FILE_NOT_FOUND;
|
||||
}
|
||||
|
||||
LONG WINAPI extRegCloseKey(HKEY hKey)
|
||||
{
|
||||
OutTraceR("RegCloseKey: hKey=%x\n", hKey);
|
||||
if (IsFake(hKey)) return ERROR_SUCCESS;
|
||||
return (*pRegCloseKey)(hKey);
|
||||
}
|
||||
|
||||
|
||||
LONG WINAPI extRegSetValueEx(HKEY hKey, LPCTSTR lpValueName, DWORD Reserved, DWORD dwType, const BYTE *lpData, DWORD cbData)
|
||||
{
|
||||
if (IsTraceR){
|
||||
OutTrace("RegSetValueEx: hKey=%x Type=%x(%s) cbData=%d\n", hKey, lpValueName, dwType, ExplainRegType(dwType), cbData);
|
||||
switch(dwType){
|
||||
case REG_DWORD: OutTrace("Data=%x\n", *(DWORD *)lpData); break;
|
||||
case REG_NONE: OutTrace("ValueName=\"%s\"\n", lpData); break;
|
||||
default: OutTrace("\n");
|
||||
}
|
||||
}
|
||||
if(IsFake(hKey) && (dxw.dwFlags3 & EMULATEREGISTRY)) return ERROR_SUCCESS;
|
||||
return (*pRegSetValueEx)(hKey, lpValueName, Reserved, dwType, lpData, cbData);
|
||||
}
|
||||
|
||||
LONG WINAPI extRegCreateKeyEx(HKEY hKey, LPCTSTR lpSubKey, DWORD Reserved, LPTSTR lpClass, DWORD dwOptions, REGSAM samDesired,
|
||||
LPSECURITY_ATTRIBUTES lpSecurityAttributes, PHKEY phkResult, LPDWORD lpdwDisposition)
|
||||
{
|
||||
OutTraceR("RegCreateKeyEx: hKey=%x(%s) SubKey=\"%s\" Class=%x\n", hKey, hKey2String(hKey), lpSubKey, lpClass);
|
||||
if (dxw.dwFlags3 && EMULATEREGISTRY){
|
||||
*phkResult = HKEY_FAKE;
|
||||
if(lpdwDisposition) *lpdwDisposition=REG_OPENED_EXISTING_KEY;
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
else
|
||||
return (*pRegCreateKeyEx)(hKey, lpSubKey, Reserved, lpClass, dwOptions, samDesired,
|
||||
lpSecurityAttributes, phkResult, lpdwDisposition);
|
||||
}
|
||||
|
@ -2384,8 +2384,10 @@ static void BlitError(HRESULT res, LPRECT lps, LPRECT lpd, int line)
|
||||
return;
|
||||
}
|
||||
|
||||
static void BlitTrace(char *label, LPRECT lps, LPRECT lpd, DWORD flags, int line)
|
||||
static void BlitTrace(char *label, LPRECT lps, LPRECT lpd, int line)
|
||||
{
|
||||
extern HANDLE hTraceMutex;
|
||||
WaitForSingleObject(hTraceMutex, INFINITE);
|
||||
OutTrace("Blt: %s", label);
|
||||
if (lps)
|
||||
OutTrace(" src=(%d,%d)-(%d,%d)",lps->left, lps->top, lps->right, lps->bottom);
|
||||
@ -2395,7 +2397,8 @@ static void BlitTrace(char *label, LPRECT lps, LPRECT lpd, DWORD flags, int line
|
||||
OutTrace(" dest=(%d,%d)-(%d,%d)",lpd->left, lpd->top, lpd->right, lpd->bottom);
|
||||
else
|
||||
OutTrace(" dest=(NULL)");
|
||||
OutTrace(" flags=%x(%s) at %d\n", flags, ExplainBltFlags(flags), line);
|
||||
OutTrace(" at %d\n", __LINE__);
|
||||
ReleaseMutex(hTraceMutex);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2511,21 +2514,21 @@ HRESULT WINAPI sBlt(char *api, LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect,
|
||||
}
|
||||
}
|
||||
|
||||
if (IsDebug) BlitTrace("NOPRIM", lpsrcrect, lpdestrect, dwflags, __LINE__);
|
||||
if (IsDebug) BlitTrace("NOPRIM", lpsrcrect, lpdestrect, __LINE__);
|
||||
res= (*pBlt)(lpdds, lpdestrect, lpddssrc, lpsrcrect ? &srcrect : NULL, dwflags, lpddbltfx);
|
||||
// Blitting compressed data may work to screen surfaces only. In this case, it may be worth
|
||||
// trying blitting directly to lpDDSEmu_Prim: it makes DK2 intro movies working.
|
||||
switch(res){
|
||||
case DDERR_UNSUPPORTED:
|
||||
if (dxw.dwFlags1 & EMULATESURFACE){
|
||||
if (IsDebug) BlitTrace("UNSUPP", lpsrcrect ? &srcrect : NULL, lpdestrect, dwflags, __LINE__);
|
||||
if (IsDebug) BlitTrace("UNSUPP", lpsrcrect ? &srcrect : NULL, lpdestrect, __LINE__);
|
||||
res=(*pBlt)(lpDDSEmu_Prim, lpdestrect, lpddssrc, lpsrcrect ? &srcrect : NULL, dwflags, lpddbltfx);
|
||||
}
|
||||
break;
|
||||
case DDERR_SURFACEBUSY:
|
||||
(*pUnlockMethod(lpdds))(lpdds, NULL);
|
||||
if (lpddssrc) (*pUnlockMethod(lpddssrc))(lpddssrc, NULL);
|
||||
if (IsDebug) BlitTrace("BUSY", lpsrcrect ? &srcrect : NULL, lpdestrect, dwflags, __LINE__);
|
||||
if (IsDebug) BlitTrace("BUSY", lpsrcrect ? &srcrect : NULL, lpdestrect, __LINE__);
|
||||
res=(*pBlt)(lpdds, lpdestrect, lpddssrc, lpsrcrect ? &srcrect : NULL, dwflags|DDBLT_WAIT, lpddbltfx);
|
||||
break;
|
||||
default:
|
||||
@ -2547,7 +2550,7 @@ HRESULT WINAPI sBlt(char *api, LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect,
|
||||
// blit only when source and dest surface are different. Should make ScreenRefresh faster.
|
||||
if (lpdds != lpddssrc) {
|
||||
if (dxw.dwFlags2 & SHOWFPSOVERLAY) dxw.ShowFPS(lpddssrc);
|
||||
if (IsDebug) BlitTrace("PRIM-NOEMU", lpsrcrect, &destrect, dwflags, __LINE__);
|
||||
if (IsDebug) BlitTrace("PRIM-NOEMU", lpsrcrect, &destrect, __LINE__);
|
||||
res= (*pBlt)(lpdds, &destrect, lpddssrc, lpsrcrect, dwflags, lpddbltfx);
|
||||
}
|
||||
if(res){
|
||||
@ -2555,7 +2558,7 @@ HRESULT WINAPI sBlt(char *api, LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect,
|
||||
// Try to handle HDC lock concurrency....
|
||||
if(res==DDERR_SURFACEBUSY){
|
||||
(*pUnlockMethod(lpdds))(lpdds, NULL);
|
||||
if (IsDebug) BlitTrace("BUSY", lpsrcrect, &destrect, dwflags, __LINE__);
|
||||
if (IsDebug) BlitTrace("BUSY", lpsrcrect, &destrect, __LINE__);
|
||||
res= (*pBlt)(lpdds, &destrect, lpddssrc, lpsrcrect, dwflags, lpddbltfx);
|
||||
if (res) BlitError(res, lpsrcrect, &destrect, __LINE__);
|
||||
}
|
||||
@ -2591,7 +2594,7 @@ HRESULT WINAPI sBlt(char *api, LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect,
|
||||
res=0;
|
||||
// blit only when source and dest surface are different. Should make ScreenRefresh faster.
|
||||
if (lpdds != lpddssrc){
|
||||
if (IsDebug) BlitTrace("SRC2EMU", &emurect, &destrect, dwflags, __LINE__);
|
||||
if (IsDebug) BlitTrace("SRC2EMU", &emurect, &destrect, __LINE__);
|
||||
res=(*pBlt)(lpdds, &emurect, lpddssrc, lpsrcrect, dwflags, lpddbltfx);
|
||||
}
|
||||
|
||||
@ -2605,7 +2608,7 @@ HRESULT WINAPI sBlt(char *api, LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect,
|
||||
*/
|
||||
if(res==DDERR_UNSUPPORTED){
|
||||
if (dxw.dwFlags2 & SHOWFPSOVERLAY) dxw.ShowFPS(lpddssrc);
|
||||
if (IsDebug) BlitTrace("UNSUPP", &emurect, &destrect, dwflags, __LINE__);
|
||||
if (IsDebug) BlitTrace("UNSUPP", &emurect, &destrect, __LINE__);
|
||||
res=(*pBlt)(lpDDSEmu_Prim, &destrect, lpddssrc, lpsrcrect, dwflags, lpddbltfx);
|
||||
if (res) BlitError(res, lpsrcrect, &destrect, __LINE__);
|
||||
}
|
||||
@ -2614,7 +2617,7 @@ HRESULT WINAPI sBlt(char *api, LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect,
|
||||
if(res==DDERR_SURFACEBUSY){
|
||||
res=(*pUnlockMethod(lpddssrc))(lpddssrc, NULL);
|
||||
if(res) OutTraceE("Unlock ERROR: err=%x(%s)\n", res, ExplainDDError(res));
|
||||
if (IsDebug) BlitTrace("BUSY", &emurect, &destrect, dwflags, __LINE__);
|
||||
if (IsDebug) BlitTrace("BUSY", &emurect, &destrect, __LINE__);
|
||||
res=(*pBlt)(lpdds, &emurect, lpddssrc, lpsrcrect, dwflags, lpddbltfx);
|
||||
if (res) BlitError(res, lpsrcrect, &destrect, __LINE__);
|
||||
}
|
||||
@ -2643,11 +2646,11 @@ HRESULT WINAPI sBlt(char *api, LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect,
|
||||
}
|
||||
|
||||
if (dxw.dwFlags2 & SHOWFPSOVERLAY) dxw.ShowFPS(lpDDSSource);
|
||||
if (IsDebug) BlitTrace("BACK2PRIM", &emurect, &destrect, dwflags, __LINE__);
|
||||
if (IsDebug) BlitTrace("BACK2PRIM", &emurect, &destrect, __LINE__);
|
||||
res=(*pBlt)(lpDDSEmu_Prim, &destrect, lpDDSSource, &emurect, DDBLT_WAIT, 0);
|
||||
if (res==DDERR_NOCLIPLIST){
|
||||
RenewClipper(lpDD, lpDDSEmu_Prim);
|
||||
if (IsDebug) BlitTrace("NOCLIP", &emurect, &destrect, dwflags, __LINE__);
|
||||
if (IsDebug) BlitTrace("NOCLIP", &emurect, &destrect, __LINE__);
|
||||
res=(*pBlt)(lpDDSEmu_Prim, &destrect, lpDDSSource, &emurect, DDBLT_WAIT, 0);
|
||||
}
|
||||
|
||||
@ -3194,13 +3197,13 @@ HRESULT WINAPI extGetDC(LPDIRECTDRAWSURFACE lpdds, HDC FAR *pHDC)
|
||||
dxw.palNumEntries=256;
|
||||
res=(*pCreatePalette)(lpDD, DDPCAPS_ALLOW256|DDPCAPS_8BIT|DDPCAPS_INITIALIZE, dxw.palPalEntry, &lpDDP, NULL);
|
||||
if (res) {
|
||||
OutTraceE("CreateSurface: CreatePalette ERROR res=%x(%s) at %d\n", res, ExplainDDError(res), __LINE__);
|
||||
OutTraceE("GetDC: CreatePalette ERROR res=%x(%s) at %d\n", res, ExplainDDError(res), __LINE__);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
res=(*pSetPalette)(lpdds, lpDDP);
|
||||
if (res) {
|
||||
OutTraceE("CreateSurface: SetPalette ERROR res=%x(%s) at %d\n", res, ExplainDDError(res), __LINE__);
|
||||
OutTraceE("GetDC: SetPalette ERROR res=%x(%s) at %d\n", res, ExplainDDError(res), __LINE__);
|
||||
return res;
|
||||
}
|
||||
// retry ....
|
||||
|
@ -1199,5 +1199,15 @@ char *ExplainMCIFlags(DWORD cmd, DWORD c)
|
||||
return(eb);
|
||||
}
|
||||
|
||||
char *ExplainRegType(DWORD c)
|
||||
{
|
||||
char *Captions[12]={
|
||||
"REG_NONE", "REG_SZ", "REG_EXPAND_SZ", "REG_BINARY",
|
||||
"REG_DWORD", "REG_DWORD_BIG_ENDIAN", "REG_LINK", "REG_MULTI_SZ",
|
||||
"REG_RESOURCE_LIST", "REG_FULL_RESOURCE_DESCRIPTOR",
|
||||
"REG_RESOURCE_REQUIREMENTS_LIST", "REG_QWORD"};
|
||||
|
||||
if (c>=0 && c<12) return Captions[c];
|
||||
return "???";
|
||||
}
|
||||
|
||||
|
@ -32,3 +32,4 @@ extern char *ExplainLoadLibFlags(DWORD);
|
||||
extern char *ExplainDevModeFields(DWORD);
|
||||
extern char *ExplainMCICommands(DWORD);
|
||||
extern char *ExplainMCIFlags(DWORD, DWORD);
|
||||
extern char *ExplainRegType(DWORD);
|
||||
|
@ -56,7 +56,7 @@ static char *Flag2Names[32]={
|
||||
static char *Flag3Names[32]={
|
||||
"FORCEHOOKOPENGL", "MARKBLIT", "HOOKDLLS", "SUPPRESSD3DEXT",
|
||||
"HOOKENABLED", "FIXD3DFRAME", "FORCE16BPP", "BLACKWHITE",
|
||||
"SAVECAPS", "SINGLEPROCAFFINITY", "Flag3:11", "Flag3:12",
|
||||
"SAVECAPS", "SINGLEPROCAFFINITY", "EMULATEREGISTRY", "CDROMDRIVETYPE",
|
||||
"Flag3:13", "Flag3:14", "Flag3:15", "Flag3:16",
|
||||
"", "", "", "",
|
||||
"", "", "", "",
|
||||
@ -78,7 +78,7 @@ static char *Flag4Names[32]={
|
||||
static char *TFlagNames[32]={
|
||||
"OUTTRACE", "OUTDDRAWTRACE", "OUTWINMESSAGES", "OUTCURSORTRACE",
|
||||
"OUTPROXYTRACE", "DXPROXED", "ASSERTDIALOG", "OUTIMPORTTABLE",
|
||||
"OUTDEBUG", "", "", "",
|
||||
"OUTDEBUG", "OUTREGISTRY", "", "",
|
||||
"", "", "", "",
|
||||
"", "", "", "",
|
||||
"", "", "", "",
|
||||
@ -625,6 +625,9 @@ void AdjustWindowPos(HWND hwnd, DWORD width, DWORD height)
|
||||
OutTraceD("AdjustWindowPos: hwnd=%x, size=(%d,%d)\n", hwnd, width, height);
|
||||
CalculateWindowPos(hwnd, width, height, &wp);
|
||||
OutTraceD("AdjustWindowPos: fixed pos=(%d,%d) size=(%d,%d)\n", wp.x, wp.y, wp.cx, wp.cy);
|
||||
//if(!pSetWindowPos) pSetWindowPos=SetWindowPos;
|
||||
//OutTraceD("pSetWindowPos=%x\n", pSetWindowPos);
|
||||
OutTraceD("hwnd=%x pos=(%d,%d) size=(%d,%d)\n", pSetWindowPos, wp.x, wp.y, wp.cx, wp.cy);
|
||||
if(!(*pSetWindowPos)(hwnd, 0, wp.x, wp.y, wp.cx, wp.cy, 0)){
|
||||
OutTraceE("AdjustWindowPos: ERROR err=%d at %d\n", GetLastError(), __LINE__);
|
||||
}
|
||||
@ -815,7 +818,7 @@ LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
|
||||
|
||||
// v2.1.93: adjust clipping region
|
||||
|
||||
OutTraceW("WindowProc: WinMsg=[0x%x]%s(%x,%x)\n", message, ExplainWinMessage(message), wparam, lparam);
|
||||
OutTraceW("WindowProc[%x]: WinMsg=[0x%x]%s(%x,%x)\n", hwnd, message, ExplainWinMessage(message), wparam, lparam);
|
||||
|
||||
#if 0
|
||||
if(dxw.dwFlags2 & WALLPAPERMODE) {
|
||||
@ -837,6 +840,8 @@ LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
|
||||
|
||||
switch(message){
|
||||
// v2.02.13: added WM_GETMINMAXINFO/WM_NCCALCSIZE interception - (see Actua Soccer 3 problems...)
|
||||
//case WM_NCDESTROY:
|
||||
// return 0;
|
||||
case WM_GETMINMAXINFO:
|
||||
if(dxw.dwFlags1 & LOCKWINPOS){
|
||||
extern void dxwFixMinMaxInfo(char *, HWND, LPARAM);
|
||||
@ -845,7 +850,7 @@ LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
|
||||
}
|
||||
break;
|
||||
case WM_NCCALCSIZE:
|
||||
if(dxw.dwFlags1 & LOCKWINPOS){
|
||||
if((dxw.dwFlags1 & LOCKWINPOS) && (hwnd == dxw.GethWnd())){ // v2.02.30: don't alter child and other windows....
|
||||
OutTraceD("WindowProc: WS_NCCALCSIZE wparam=%x\n", wparam);
|
||||
if(wparam){
|
||||
// nothing so far ....
|
||||
@ -978,7 +983,7 @@ LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
|
||||
}
|
||||
if(dxw.dwFlags1 & MODIFYMOUSE){ // mouse processing
|
||||
// scale mouse coordinates
|
||||
curr=dxw.FixCursorPos(hwnd, prev);
|
||||
curr=dxw.FixCursorPos(prev); //v2.02.30
|
||||
lparam = MAKELPARAM(curr.x, curr.y);
|
||||
OutTraceC("WindowProc: hwnd=%x pos XY=(%d,%d)->(%d,%d)\n", hwnd, prev.x, prev.y, curr.x, curr.y);
|
||||
}
|
||||
@ -1001,7 +1006,7 @@ LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
|
||||
// scale mouse coordinates
|
||||
prev.x = LOWORD(lparam);
|
||||
prev.y = HIWORD(lparam);
|
||||
curr=dxw.FixCursorPos(hwnd, prev);
|
||||
curr=dxw.FixCursorPos(prev); //v2.02.30
|
||||
lparam = MAKELPARAM(curr.x, curr.y);
|
||||
OutTraceC("WindowProc: hwnd=%x pos XY=(%d,%d)->(%d,%d)\n", hwnd, prev.x, prev.y, curr.x, curr.y);
|
||||
}
|
||||
@ -1243,6 +1248,7 @@ void HookModule(HMODULE base, int dxversion)
|
||||
HookDirectDraw(base, dxversion);
|
||||
HookDirect3D(base, dxversion);
|
||||
if(dxw.dwFlags2 & HOOKOPENGL) HookOpenGLLibs(base, dxw.CustomOpenGLLib);
|
||||
if((dxw.dwFlags3 & EMULATEREGISTRY) || (dxw.dwTFlags & OUTREGISTRY)) HookAdvApi32(base);
|
||||
HookMSV4WLibs(base); // -- used by Aliens & Amazons demo: what for?
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,7 @@ extern void HookImeLib(HMODULE);
|
||||
extern void HookKernel32(HMODULE);
|
||||
extern void HookUser32(HMODULE);
|
||||
extern void HookWinMM(HMODULE);
|
||||
extern void HookAdvApi32(HMODULE);
|
||||
|
||||
extern void InitPosition(int, int, int, int, int, int);
|
||||
//void InitWindowPos(int, int, int, int);
|
||||
@ -29,6 +30,7 @@ extern FARPROC Remap_trust_ProcAddress(LPCSTR, HMODULE);
|
||||
extern FARPROC Remap_WinMM_ProcAddress(LPCSTR, HMODULE);
|
||||
extern FARPROC Remap_ImeLib_ProcAddress(LPCSTR, HMODULE);
|
||||
extern FARPROC Remap_vfw_ProcAddress(LPCSTR, HMODULE);
|
||||
extern FARPROC Remap_AdvApi32_ProcAddress(LPCSTR, HMODULE);
|
||||
|
||||
typedef struct {
|
||||
char *APIName;
|
||||
|
@ -160,11 +160,6 @@ BOOL dxwCore::IsDesktop(HWND hwnd)
|
||||
#define CLIP_TOLERANCE 4
|
||||
|
||||
POINT dxwCore::FixCursorPos(POINT prev)
|
||||
{
|
||||
return FixCursorPos(hWnd, prev);
|
||||
}
|
||||
|
||||
POINT dxwCore::FixCursorPos(HWND hwnd, POINT prev)
|
||||
{
|
||||
POINT curr;
|
||||
RECT rect;
|
||||
@ -175,18 +170,34 @@ POINT dxwCore::FixCursorPos(HWND hwnd, POINT prev)
|
||||
// scale mouse coordinates
|
||||
// remember: rect from GetClientRect always start at 0,0!
|
||||
if(dxw.dwFlags1 & MODIFYMOUSE){
|
||||
if (!(*pGetClientRect)(hwnd, &rect)) {
|
||||
int w, h, b; // width, height and border
|
||||
if (!(*pGetClientRect)(hWnd, &rect)) { // v2.02.30: always use desktop win
|
||||
OutTraceD("GetClientRect ERROR %d at %d\n", GetLastError(),__LINE__);
|
||||
curr.x = curr.y = 0;
|
||||
}
|
||||
w = rect.right - rect.left;
|
||||
h = rect.bottom - rect.top;
|
||||
|
||||
if ((dxw.Coordinates == DXW_DESKTOP_WORKAREA) && (dxw.dwFlags2 & KEEPASPECTRATIO)) {
|
||||
if ((w * 600) > (h * 800)){
|
||||
b = (w - (h * 800 / 600))/2;
|
||||
curr.x -= b;
|
||||
w -= 2*b;
|
||||
}
|
||||
else {
|
||||
b = (h - (w * 600 / 800))/2;
|
||||
curr.y -= b;
|
||||
h -= 2*b;
|
||||
}
|
||||
}
|
||||
|
||||
if (curr.x < 0) curr.x = 0;
|
||||
if (curr.y < 0) curr.y = 0;
|
||||
if (curr.x > rect.right) curr.x = rect.right;
|
||||
if (curr.y > rect.bottom) curr.y = rect.bottom;
|
||||
if (curr.x > w) curr.x = w;
|
||||
if (curr.y > h) curr.y = h;
|
||||
|
||||
if (rect.right) curr.x = (curr.x * dxw.GetScreenWidth()) / rect.right;
|
||||
if (rect.bottom) curr.y = (curr.y * dxw.GetScreenHeight()) / rect.bottom;
|
||||
if (w) curr.x = (curr.x * dxw.GetScreenWidth()) / w;
|
||||
if (h) curr.y = (curr.y * dxw.GetScreenHeight()) / h;
|
||||
}
|
||||
|
||||
if((dxw.dwFlags1 & ENABLECLIPPING) && lpClipRegion){
|
||||
@ -282,33 +293,37 @@ RECT dxwCore::MapWindowRect(LPRECT lpRect)
|
||||
POINT UpLeft={0,0};
|
||||
RECT RetRect;
|
||||
RECT ClientRect;
|
||||
int w, h, bx, by; // width, height and x,y borders
|
||||
if (!(*pGetClientRect)(hWnd, &ClientRect)){
|
||||
OutTraceE("GetClientRect ERROR: err=%d hwnd=%x at %d\n", GetLastError(), hWnd, __LINE__);
|
||||
}
|
||||
if(lpRect){
|
||||
RetRect.left = lpRect->left * ClientRect.right / dwScreenWidth;
|
||||
RetRect.right = lpRect->right * ClientRect.right / dwScreenWidth;
|
||||
RetRect.top = lpRect->top * ClientRect.bottom / dwScreenHeight;
|
||||
RetRect.bottom = lpRect->bottom * ClientRect.bottom / dwScreenHeight;
|
||||
}
|
||||
else {
|
||||
RetRect=ClientRect;
|
||||
if ((dxw.Coordinates == DXW_DESKTOP_WORKAREA) && (dwFlags2 & KEEPASPECTRATIO)){
|
||||
int w, h, b; // width, height and border
|
||||
w = RetRect.right - RetRect.left;
|
||||
h = RetRect.bottom - RetRect.top;
|
||||
if ((w * 600) > (h * 800)){
|
||||
b = (w - (h * 800 / 600))/2;
|
||||
RetRect.left = ClientRect.left + b;
|
||||
RetRect.right = ClientRect.right - b;
|
||||
}
|
||||
else {
|
||||
b = (h - (w * 600 / 800))/2;
|
||||
RetRect.top = ClientRect.top + b;
|
||||
RetRect.bottom = ClientRect.bottom - b;
|
||||
}
|
||||
RetRect=ClientRect;
|
||||
bx = by = 0;
|
||||
if ((dxw.Coordinates == DXW_DESKTOP_WORKAREA) && (dwFlags2 & KEEPASPECTRATIO)){
|
||||
w = RetRect.right - RetRect.left;
|
||||
h = RetRect.bottom - RetRect.top;
|
||||
if ((w * 600) > (h * 800)){
|
||||
bx = (w - (h * 800 / 600))/2;
|
||||
}
|
||||
else {
|
||||
by = (h - (w * 600 / 800))/2;
|
||||
}
|
||||
OutTraceD("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;
|
||||
}
|
||||
else{
|
||||
RetRect.left = ClientRect.left + bx;
|
||||
RetRect.right = ClientRect.right - bx;
|
||||
RetRect.top = ClientRect.top + by;
|
||||
RetRect.bottom = ClientRect.bottom - by;
|
||||
}
|
||||
|
||||
if(!(*pClientToScreen)(hWnd, &UpLeft)){
|
||||
OutTraceE("ClientToScreen ERROR: err=%d hwnd=%x at %d\n", GetLastError(), hWnd, __LINE__);
|
||||
}
|
||||
@ -828,6 +843,7 @@ int dxwCore::GetDLLIndex(char *lpFileName)
|
||||
"tapi32",
|
||||
"netapi32",
|
||||
"wintrust",
|
||||
"advapi32",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
@ -25,7 +25,6 @@ public: // methods
|
||||
BOOL IsFullScreen() {return FullScreen;}
|
||||
BOOL IsDesktop(HWND);
|
||||
POINT FixCursorPos(POINT);
|
||||
POINT FixCursorPos(HWND, POINT);
|
||||
void FixNCHITCursorPos(LPPOINT);
|
||||
void SetClipCursor(void);
|
||||
void EraseClipCursor(void);
|
||||
|
@ -26,6 +26,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#define VERSION "2.02.29"
|
||||
|
||||
#define DDTHREADLOCK 1
|
||||
|
||||
LRESULT CALLBACK HookProc(int ncode, WPARAM wparam, LPARAM lparam);
|
||||
|
||||
HINSTANCE hInst;
|
||||
@ -36,6 +38,7 @@ DXWNDSTATUS *pStatus;
|
||||
HANDLE hMutex;
|
||||
HANDLE hTraceMutex;
|
||||
HANDLE hLockMutex;
|
||||
HANDLE hDDLockMutex;
|
||||
HANDLE hKillMutex;
|
||||
int HookStatus=DXW_IDLE;
|
||||
static int TaskIndex=-1;
|
||||
@ -68,6 +71,10 @@ BOOL APIENTRY DllMain( HANDLE hmodule,
|
||||
if(!hTraceMutex) hTraceMutex = CreateMutex(0, FALSE, "Trace_Mutex");
|
||||
hLockMutex = OpenMutex(MUTEX_ALL_ACCESS, FALSE, "Lock_Mutex");
|
||||
if(!hLockMutex) hLockMutex = CreateMutex(0, FALSE, "Lock_Mutex");
|
||||
if(DDTHREADLOCK){
|
||||
hDDLockMutex = OpenMutex(MUTEX_ALL_ACCESS, FALSE, "DDLock_Mutex");
|
||||
if(!hDDLockMutex) hDDLockMutex = CreateMutex(0, FALSE, "DDLock_Mutex");
|
||||
}
|
||||
InjectHook();
|
||||
return true;
|
||||
}
|
||||
|
Binary file not shown.
@ -216,6 +216,10 @@
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\advapi.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ddraw.cpp"
|
||||
>
|
||||
|
@ -473,7 +473,7 @@ HRESULT WINAPI extGetAdapterIdentifier(void *pd3dd, UINT Adapter, DWORD Flags, D
|
||||
{
|
||||
HRESULT res;
|
||||
OutTraceD("GetAdapterIdentifier: Adapter=%d flags=%x\n", Adapter, Flags);
|
||||
res=(*pGetAdapterIdentifier)(pd3dd, Adapter, Flags, pIdentifier);
|
||||
res=pGetAdapterIdentifier(pd3dd, Adapter, Flags, pIdentifier);
|
||||
OutTraceD("GetAdapterIdentifier: ret=%x\n", res);
|
||||
return res;
|
||||
}
|
||||
@ -572,10 +572,13 @@ HRESULT WINAPI extCreateDevice(void *lpd3d, UINT adapter, D3DDEVTYPE devicetype,
|
||||
D3DDISPLAYMODE mode;
|
||||
int Windowed;
|
||||
|
||||
OutTraceD("CreateDevice: D3DVersion=%d lpd3d=%x adapter=%x hFocusWnd=%x behavior=%x, size=(%d,%d)\n",
|
||||
dwD3DVersion, lpd3d, adapter, hfocuswindow, behaviorflags, ppresentparam->BackBufferWidth, ppresentparam->BackBufferHeight);
|
||||
|
||||
memcpy(param, ppresentparam, (dwD3DVersion == 9)?56:52);
|
||||
dxw.SethWnd(hfocuswindow);
|
||||
dxw.SetScreenSize(param[0], param[1]);
|
||||
AdjustWindowFrame(dxw.GethWnd(), dxw.GetScreenWidth(), dxw.GetScreenHeight());
|
||||
if(!(dxw.dwFlags3 & NOWINDOWMOVE)) AdjustWindowFrame(dxw.GethWnd(), dxw.GetScreenWidth(), dxw.GetScreenHeight());
|
||||
|
||||
if(dxw.dwFlags3 & FIXD3DFRAME){
|
||||
char ClassName[81];
|
||||
@ -1098,7 +1101,7 @@ HRESULT WINAPI extQueryInterfaceDev9(void *obj, REFIID riid, void** ppvObj)
|
||||
|
||||
HRESULT WINAPI extGetDirect3D(void *lpdd3dd, IDirect3D9 **ppD3D9)
|
||||
{
|
||||
OutTraceD("Device::GetDirect3D\n");
|
||||
OutTraceB("Device::GetDirect3D\n");
|
||||
return (*pGetDirect3D)(lpdd3dd, ppD3D9);
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,7 @@ static HookEntry_Type Hooks[]={
|
||||
{"LoadLibraryExA", (FARPROC)LoadLibraryExA, (FARPROC *)&pLoadLibraryExA, (FARPROC)extLoadLibraryExA},
|
||||
{"LoadLibraryW", (FARPROC)LoadLibraryW, (FARPROC *)&pLoadLibraryW, (FARPROC)extLoadLibraryW},
|
||||
{"LoadLibraryExW", (FARPROC)LoadLibraryExW, (FARPROC *)&pLoadLibraryExW, (FARPROC)extLoadLibraryExW},
|
||||
{"GetDriveTypeA", (FARPROC)NULL, (FARPROC *)&pGetDriveType, (FARPROC)extGetDriveType},
|
||||
{0, NULL, 0, 0} // terminator
|
||||
};
|
||||
|
||||
@ -426,6 +427,9 @@ FARPROC WINAPI extGetProcAddress(HMODULE hModule, LPCSTR proc)
|
||||
case SYSLIBIDX_WINTRUST:
|
||||
if (remap=Remap_trust_ProcAddress(proc, hModule)) return remap;
|
||||
break;
|
||||
case SYSLIBIDX_ADVAPI32:
|
||||
if (remap=Remap_AdvApi32_ProcAddress(proc, hModule)) return remap;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -484,3 +488,10 @@ FARPROC WINAPI extGetProcAddress(HMODULE hModule, LPCSTR proc)
|
||||
OutTraceD("GetProcAddress: ret=%x\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
UINT WINAPI extGetDriveType(LPCTSTR lpRootPathName)
|
||||
{
|
||||
OutTraceD("GetDriveType: path=\"%s\"\n", lpRootPathName);
|
||||
if (dxw.dwFlags3 & CDROMDRIVETYPE) return DRIVE_CDROM;
|
||||
return (*pGetDriveType)(lpRootPathName);
|
||||
}
|
@ -7,7 +7,7 @@
|
||||
|
||||
static HookEntry_Type Hooks[]={
|
||||
{"CoCreateInstance", NULL, (FARPROC *)&pCoCreateInstance, (FARPROC)extCoCreateInstance},
|
||||
// {"CoCreateInstanceEx", NULL, (FARPROC *)&pCoCreateInstanceEx, (FARPROC)extCoCreateInstanceEx}, remote object creation....
|
||||
{"CoCreateInstanceEx", NULL, (FARPROC *)&pCoCreateInstanceEx, (FARPROC)extCoCreateInstanceEx},
|
||||
{0, NULL, 0, 0} // terminator
|
||||
};
|
||||
|
||||
@ -95,3 +95,78 @@ HRESULT STDAPICALLTYPE extCoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter,
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
HRESULT STDAPICALLTYPE extCoCreateInstanceEx(REFCLSID rclsid, IUnknown *punkOuter, DWORD dwClsCtx, COSERVERINFO *pServerInfo, DWORD dwCount, MULTI_QI *pResults)
|
||||
{
|
||||
HRESULT res;
|
||||
DWORD i;
|
||||
|
||||
OutTraceD("CoCreateInstanceEx: rclsid=%x UnkOuter=%x ClsContext=%x Count=%d\n",
|
||||
rclsid, punkOuter, dwClsCtx, dwCount);
|
||||
|
||||
res=(*pCoCreateInstanceEx)(rclsid, punkOuter, dwClsCtx, pServerInfo, dwCount, pResults);
|
||||
if(res) {
|
||||
OutTraceE("CoCreateInstanceEx: ERROR res=%x\n", res);
|
||||
return res;
|
||||
}
|
||||
|
||||
for(i=0; i<dwCount; i++){
|
||||
LPVOID FAR* ppv;
|
||||
IID riid;
|
||||
|
||||
if(pResults[i].hr) continue;
|
||||
|
||||
riid=*pResults[i].pIID;
|
||||
ppv=(LPVOID *)pResults[i].pItf;
|
||||
|
||||
// CLSID e436ebb3 implies loading quartz.dll to play movies through dshow:
|
||||
// quartz.dll must be hooked.
|
||||
if (*(DWORD *)&rclsid==0xe436ebb3){
|
||||
HMODULE qlib;
|
||||
OutTraceD("CoCreateInstanceEx: CLSID_FilterGraph RIID=%x\n", *(DWORD *)&riid);
|
||||
qlib=(*pLoadLibraryA)("quartz.dll");
|
||||
OutTraceD("CoCreateInstanceEx: quartz lib handle=%x\n", qlib);
|
||||
HookKernel32(qlib);
|
||||
HookUser32(qlib);
|
||||
HookWinMM(qlib);
|
||||
}
|
||||
|
||||
if (*(DWORD *)&rclsid==*(DWORD *)&CLSID_DirectDraw){
|
||||
LPDIRECTDRAW lpOldDDraw;
|
||||
OutTraceD("CoCreateInstanceEx: CLSID_DirectDraw object\n");
|
||||
switch (*(DWORD *)&riid){
|
||||
case 0x6C14DB80:
|
||||
OutTraceD("DirectDrawCreateEx: IID_DirectDraw RIID\n");
|
||||
res=extDirectDrawCreate(NULL, (LPDIRECTDRAW *)&ppv, 0);
|
||||
if(res)OutTraceD("DirectDrawCreateEx: res=%x(%s)\n", res, ExplainDDError(res));
|
||||
break;
|
||||
case 0xB3A6F3E0:
|
||||
OutTraceD("DirectDrawCreateEx: IID_DirectDraw2 RIID\n");
|
||||
res=extDirectDrawCreate(NULL, &lpOldDDraw, 0);
|
||||
if(res)OutTraceD("DirectDrawCreateEx: res=%x(%s)\n", res, ExplainDDError(res));
|
||||
res=lpOldDDraw->QueryInterface(IID_IDirectDraw2, (LPVOID *)&ppv);
|
||||
if(res)OutTraceD("QueryInterfaceEx: res=%x(%s)\n", res, ExplainDDError(res));
|
||||
lpOldDDraw->Release();
|
||||
break;
|
||||
case 0x9c59509a:
|
||||
OutTraceD("DirectDrawCreateEx: IID_DirectDraw4 RIID\n");
|
||||
res=extDirectDrawCreate(NULL, &lpOldDDraw, 0);
|
||||
if(res)OutTraceD("DirectDrawCreateEx: res=%x(%s)\n", res, ExplainDDError(res));
|
||||
res=lpOldDDraw->QueryInterface(IID_IDirectDraw4, (LPVOID *)&ppv);
|
||||
if(res)OutTraceD("QueryInterfaceEx: res=%x(%s)\n", res, ExplainDDError(res));
|
||||
lpOldDDraw->Release();
|
||||
case 0x15e65ec0:
|
||||
OutTraceD("CoCreateInstanceEx: IID_DirectDraw7 RIID\n");
|
||||
res=extDirectDrawCreateEx(NULL, (LPDIRECTDRAW *)&ppv, IID_IDirectDraw7, 0);
|
||||
if(res)OutTraceD("DirectDrawCreateEx: res=%x(%s)\n", res, ExplainDDError(res));
|
||||
break;
|
||||
case 0xe436ebb3:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (*(DWORD *)&rclsid==*(DWORD *)&CLSID_DxDiagProvider) res=HookDxDiag(riid, ppv);
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
@ -15,6 +15,16 @@ user32.dll.dll
|
||||
type definitions
|
||||
====================================================================*/
|
||||
|
||||
// advapi32.dll
|
||||
|
||||
typedef LONG (WINAPI *RegCloseKey_Type)(HKEY);
|
||||
typedef LONG (WINAPI *RegCreateKeyEx_Type)(HKEY, LPCTSTR, DWORD, LPTSTR, DWORD, REGSAM, LPSECURITY_ATTRIBUTES, PHKEY, LPDWORD);
|
||||
typedef LONG (WINAPI *RegOpenKeyEx_Type)(HKEY, LPCTSTR, DWORD, REGSAM, PHKEY);
|
||||
typedef LONG (WINAPI *RegQueryValueEx_Type)(HKEY, LPCTSTR, LPDWORD, LPDWORD, LPBYTE, LPDWORD);
|
||||
typedef LONG (WINAPI *RegSetValueEx_Type)(HKEY, LPCTSTR, DWORD, DWORD, const BYTE *, DWORD);
|
||||
|
||||
// ImmLib.dll:
|
||||
|
||||
typedef BOOL (WINAPI *ImmNotifyIME_Type)(HIMC, DWORD, DWORD, DWORD);
|
||||
typedef HIMC (WINAPI *ImmCreateContext_Type)(void);
|
||||
typedef BOOL (WINAPI *ImmDestroyContext_Type)(HIMC);
|
||||
@ -52,6 +62,7 @@ typedef BOOL (WINAPI *TextOut_Type)(HDC, int, int, LPCTSTR, int);
|
||||
|
||||
// Kernel32.dll:
|
||||
typedef BOOL (WINAPI *GetDiskFreeSpaceA_Type)(LPCSTR, LPDWORD, LPDWORD, LPDWORD, LPDWORD);
|
||||
typedef UINT (WINAPI *GetDriveType_Type)(LPCSTR);
|
||||
typedef void (WINAPI *GetLocalTime_Type)(LPSYSTEMTIME);
|
||||
typedef FARPROC (WINAPI *GetProcAddress_Type)(HMODULE, LPCSTR);
|
||||
typedef void (WINAPI *GetSystemTime_Type)(LPSYSTEMTIME);
|
||||
@ -70,7 +81,8 @@ typedef void (WINAPI *Sleep_Type)(DWORD);
|
||||
typedef DWORD (WINAPI *SleepEx_Type)(DWORD, BOOL);
|
||||
|
||||
// ole32.dll:
|
||||
typedef HRESULT (STDAPICALLTYPE *CoCreateInstance_Type)(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID riid, LPVOID FAR* ppv);
|
||||
typedef HRESULT (STDAPICALLTYPE *CoCreateInstance_Type)(REFCLSID, LPUNKNOWN, DWORD, REFIID, LPVOID FAR*);
|
||||
typedef HRESULT (STDAPICALLTYPE *CoCreateInstanceEx_Type)(REFCLSID, IUnknown *, DWORD, COSERVERINFO *, DWORD, MULTI_QI *);
|
||||
|
||||
// user32.dll:
|
||||
typedef HDC (WINAPI *BeginPaint_Type)(HWND, LPPAINTSTRUCT);
|
||||
@ -82,6 +94,7 @@ typedef BOOL (WINAPI *ClipCursor_Type)(const RECT *);
|
||||
typedef HWND (WINAPI *CreateDialogIndirectParam_Type)(HINSTANCE, LPCDLGTEMPLATE, HWND, DLGPROC, LPARAM);
|
||||
typedef HWND (WINAPI *CreateDialogParam_Type)(HINSTANCE, LPCTSTR, HWND, DLGPROC, LPARAM);
|
||||
typedef HWND (WINAPI *CreateWindowExA_Type)(DWORD, LPCTSTR, LPCTSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, LPVOID);
|
||||
typedef HWND (WINAPI *CreateWindowExW_Type)(DWORD, LPCWSTR, LPCWSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, LPVOID);
|
||||
typedef LRESULT (WINAPI *DefWindowProc_Type)(HWND, UINT, WPARAM, LPARAM);
|
||||
typedef BOOL (WINAPI *EndPaint_Type)(HWND, const PAINTSTRUCT *);
|
||||
typedef LONG (WINAPI *EnumDisplaySettings_Type)(LPCTSTR, DWORD, LPDEVMODEA);
|
||||
@ -93,6 +106,7 @@ typedef HDC (WINAPI *GDIGetDC_Type)(HWND);
|
||||
typedef HWND (WINAPI *GetDesktopWindow_Type)(void);
|
||||
typedef BOOL (WINAPI *GetMessage_Type)(LPMSG, HWND, UINT, UINT);
|
||||
typedef int (WINAPI *GetSystemMetrics_Type)(int);
|
||||
typedef HWND (WINAPI *GetTopWindow_Type)(HWND);
|
||||
typedef LONG (WINAPI *GetWindowLong_Type)(HWND, int);
|
||||
typedef BOOL (WINAPI *GetWindowRect_Type)(HWND, LPRECT);
|
||||
typedef BOOL (WINAPI *InvalidateRect_Type)(HWND, CONST RECT *, BOOL);
|
||||
@ -131,6 +145,16 @@ hooked APIs real pointers
|
||||
#define DXWINITIALIZED
|
||||
#endif
|
||||
|
||||
// advapi32.dll
|
||||
|
||||
DXWEXTERN RegCloseKey_Type pRegCloseKey DXWINITIALIZED;
|
||||
DXWEXTERN RegCreateKeyEx_Type pRegCreateKeyEx DXWINITIALIZED;
|
||||
DXWEXTERN RegOpenKeyEx_Type pRegOpenKeyEx DXWINITIALIZED;
|
||||
DXWEXTERN RegQueryValueEx_Type pRegQueryValueEx DXWINITIALIZED;
|
||||
DXWEXTERN RegSetValueEx_Type pRegSetValueEx DXWINITIALIZED;
|
||||
|
||||
// ImmLib.dll
|
||||
|
||||
DXWEXTERN ImmNotifyIME_Type pImmNotifyIME DXWINITIALIZED;
|
||||
DXWEXTERN ImmCreateContext_Type pImmCreateContext DXWINITIALIZED;
|
||||
DXWEXTERN ImmDestroyContext_Type pImmDestroyContext DXWINITIALIZED;
|
||||
@ -168,6 +192,7 @@ DXWEXTERN TextOut_Type pGDITextOutA DXWINITIALIZED;
|
||||
|
||||
// Kernel32.dll:
|
||||
DXWEXTERN GetDiskFreeSpaceA_Type pGetDiskFreeSpaceA DXWINITIALIZED;
|
||||
DXWEXTERN GetDriveType_Type pGetDriveType DXWINITIALIZED;
|
||||
DXWEXTERN GetLocalTime_Type pGetLocalTime DXWINITIALIZED;
|
||||
DXWEXTERN GetProcAddress_Type pGetProcAddress DXWINITIALIZED;
|
||||
DXWEXTERN GetSystemTime_Type pGetSystemTime DXWINITIALIZED;
|
||||
@ -186,6 +211,7 @@ DXWEXTERN SleepEx_Type pSleepEx DXWINITIALIZED;
|
||||
|
||||
// ole32.dll:
|
||||
DXWEXTERN CoCreateInstance_Type pCoCreateInstance DXWINITIALIZED;
|
||||
DXWEXTERN CoCreateInstanceEx_Type pCoCreateInstanceEx DXWINITIALIZED;
|
||||
|
||||
// user32.dll:
|
||||
DXWEXTERN BeginPaint_Type pBeginPaint DXWINITIALIZED;
|
||||
@ -197,6 +223,7 @@ DXWEXTERN ClipCursor_Type pClipCursor DXWINITIALIZED;
|
||||
DXWEXTERN CreateDialogIndirectParam_Type pCreateDialogIndirectParam DXWINITIALIZED;
|
||||
DXWEXTERN CreateDialogParam_Type pCreateDialogParam DXWINITIALIZED;
|
||||
DXWEXTERN CreateWindowExA_Type pCreateWindowExA DXWINITIALIZED;
|
||||
DXWEXTERN CreateWindowExW_Type pCreateWindowExW DXWINITIALIZED;
|
||||
DXWEXTERN DefWindowProc_Type pDefWindowProc DXWINITIALIZED;
|
||||
DXWEXTERN EndPaint_Type pEndPaint DXWINITIALIZED;
|
||||
DXWEXTERN EnumDisplaySettings_Type pEnumDisplaySettings DXWINITIALIZED;
|
||||
@ -208,6 +235,7 @@ DXWEXTERN GDIGetDC_Type pGDIGetDC DXWINITIALIZED;
|
||||
DXWEXTERN GetDesktopWindow_Type pGetDesktopWindow DXWINITIALIZED;
|
||||
DXWEXTERN GetMessage_Type pGetMessage DXWINITIALIZED;
|
||||
DXWEXTERN GetSystemMetrics_Type pGetSystemMetrics DXWINITIALIZED;
|
||||
DXWEXTERN GetTopWindow_Type pGetTopWindow DXWINITIALIZED;
|
||||
DXWEXTERN GDIGetDC_Type pGDIGetWindowDC DXWINITIALIZED;
|
||||
DXWEXTERN GetWindowLong_Type pGetWindowLong DXWINITIALIZED;
|
||||
DXWEXTERN GetWindowRect_Type pGetWindowRect DXWINITIALIZED;
|
||||
@ -235,6 +263,16 @@ DXWEXTERN timeGetTime_Type ptimeGetTime DXWINITIALIZED;
|
||||
hook procedures (possibly more tnan one per each API...)
|
||||
====================================================================*/
|
||||
|
||||
// advapi32.dll
|
||||
|
||||
extern LONG WINAPI extRegCloseKey(HKEY);
|
||||
extern LONG WINAPI extRegCreateKeyEx(HKEY, LPCTSTR, DWORD, LPTSTR, DWORD, REGSAM, LPSECURITY_ATTRIBUTES, PHKEY, LPDWORD);
|
||||
extern LONG WINAPI extRegOpenKeyEx(HKEY, LPCTSTR, DWORD, REGSAM, PHKEY);
|
||||
extern LONG WINAPI extRegQueryValueEx(HKEY, LPCTSTR, LPDWORD, LPDWORD, LPBYTE, LPDWORD);
|
||||
extern LONG WINAPI extRegSetValueEx(HKEY, LPCTSTR, DWORD, DWORD, const BYTE *, DWORD);
|
||||
|
||||
// ImmLib.dll
|
||||
|
||||
extern BOOL WINAPI extImmNotifyIME(HIMC, DWORD, DWORD, DWORD);
|
||||
extern HIMC WINAPI extImmCreateContext(void);
|
||||
extern BOOL WINAPI extImmDestroyContext(HIMC);
|
||||
@ -277,6 +315,7 @@ extern BOOL WINAPI extTextOutA(HDC, int, int, LPCTSTR, int);
|
||||
|
||||
// Kernel32.dll:
|
||||
extern BOOL WINAPI extGetDiskFreeSpaceA(LPCSTR, LPDWORD, LPDWORD, LPDWORD, LPDWORD);
|
||||
extern UINT WINAPI extGetDriveType(LPCSTR);
|
||||
extern void WINAPI extGetLocalTime(LPSYSTEMTIME);
|
||||
extern FARPROC WINAPI extGetProcAddress(HMODULE, LPCSTR);
|
||||
extern void WINAPI extGetSystemTime(LPSYSTEMTIME);
|
||||
@ -296,6 +335,7 @@ extern DWORD WINAPI extSleepEx(DWORD, BOOL);
|
||||
|
||||
// ole32.dll:
|
||||
extern HRESULT STDAPICALLTYPE extCoCreateInstance(REFCLSID, LPUNKNOWN, DWORD, REFIID, LPVOID FAR*);
|
||||
extern HRESULT STDAPICALLTYPE extCoCreateInstanceEx(REFCLSID, IUnknown *, DWORD, COSERVERINFO *, DWORD, MULTI_QI *);
|
||||
|
||||
// user32.dll:
|
||||
extern HDC WINAPI extBeginPaint(HWND, LPPAINTSTRUCT);
|
||||
@ -307,6 +347,7 @@ extern BOOL WINAPI extClipCursor(LPRECT);
|
||||
extern HWND WINAPI extCreateDialogIndirectParam(HINSTANCE, LPCDLGTEMPLATE, HWND, DLGPROC, LPARAM);
|
||||
extern HWND WINAPI extCreateDialogParam(HINSTANCE, LPCSTR, HWND, DLGPROC, LPARAM);
|
||||
extern HWND WINAPI extCreateWindowExA(DWORD, LPCTSTR, LPCTSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, LPVOID);
|
||||
extern HWND WINAPI extCreateWindowExW(DWORD, LPCWSTR, LPCWSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, LPVOID);
|
||||
extern LRESULT WINAPI extDefWindowProc(HWND, UINT, WPARAM, LPARAM);
|
||||
extern BOOL WINAPI extEndPaint(HWND, const PAINTSTRUCT *);
|
||||
extern LONG WINAPI extEnumDisplaySettings(LPCTSTR, DWORD, DEVMODE *);
|
||||
@ -319,6 +360,7 @@ extern HDC WINAPI extDDGetDC(HWND);
|
||||
extern HWND WINAPI extGetDesktopWindow(void);
|
||||
extern BOOL WINAPI extGetMessage(LPMSG, HWND, UINT, UINT);
|
||||
extern int WINAPI extGetSystemMetrics(int);
|
||||
extern HWND WINAPI extGetTopWindow(HWND);
|
||||
extern HDC WINAPI extGDIGetWindowDC(HWND);
|
||||
extern HDC WINAPI extDDGetWindowDC(HWND);
|
||||
extern LONG WINAPI extGetWindowLong(HWND, int);
|
||||
|
130
dll/user32.cpp
130
dll/user32.cpp
@ -22,6 +22,7 @@ static HookEntry_Type Hooks[]={
|
||||
{"FillRect", (FARPROC)FillRect, (FARPROC *)&pFillRect, (FARPROC)extFillRect},
|
||||
{"DefWindowProcA", (FARPROC)DefWindowProcA, (FARPROC *)&pDefWindowProc, (FARPROC)extDefWindowProc},
|
||||
{"CreateWindowExA", (FARPROC)CreateWindowExA, (FARPROC *)&pCreateWindowExA, (FARPROC)extCreateWindowExA},
|
||||
{"CreateWindowExW", (FARPROC)CreateWindowExW, (FARPROC *)&pCreateWindowExW, (FARPROC)extCreateWindowExW},
|
||||
{"RegisterClassExA", (FARPROC)RegisterClassExA, (FARPROC *)&pRegisterClassExA, (FARPROC)extRegisterClassExA},
|
||||
{"GetSystemMetrics", (FARPROC)GetSystemMetrics, (FARPROC *)&pGetSystemMetrics, (FARPROC)extGetSystemMetrics},
|
||||
{"GetDesktopWindow", (FARPROC)GetDesktopWindow, (FARPROC *)&pGetDesktopWindow, (FARPROC)extGetDesktopWindow},
|
||||
@ -400,8 +401,6 @@ BOOL WINAPI extDDInvalidateRect(HWND hwnd, RECT *lpRect, BOOL bErase)
|
||||
OutTraceD("InvalidateRect: hwnd=%x rect=NULL erase=%x\n",
|
||||
hwnd, bErase);
|
||||
|
||||
if(dxw.IsFullScreen() && dxw.IsDesktop(hwnd)) hwnd=dxw.GethWnd();
|
||||
|
||||
return (*pInvalidateRect)(hwnd, NULL, bErase);
|
||||
}
|
||||
|
||||
@ -414,8 +413,6 @@ BOOL WINAPI extInvalidateRect(HWND hwnd, RECT *lpRect, BOOL bErase)
|
||||
OutTraceD("InvalidateRect: hwnd=%x rect=NULL erase=%x\n",
|
||||
hwnd, bErase);
|
||||
|
||||
if(dxw.IsFullScreen() && dxw.IsDesktop(hwnd)) hwnd=dxw.GethWnd();
|
||||
|
||||
return (*pInvalidateRect)(hwnd, NULL, bErase);
|
||||
}
|
||||
|
||||
@ -497,17 +494,21 @@ LONG WINAPI extSetWindowLong(HWND hwnd, int nIndex, LONG dwNewLong)
|
||||
}
|
||||
|
||||
if (nIndex==GWL_WNDPROC){
|
||||
long lres;
|
||||
WNDPROC lres;
|
||||
WNDPROC OldProc;
|
||||
// GPL fix
|
||||
if(hwnd==0) {
|
||||
if(dxw.IsDesktop(hwnd)) {
|
||||
hwnd=dxw.GethWnd();
|
||||
OutTrace("SetWindowLong: NULL hwnd, FIXING hwnd=%x\n",hwnd);
|
||||
OutTraceD("SetWindowLong: DESKTOP hwnd, FIXING hwnd=%x\n",hwnd);
|
||||
}
|
||||
// end of GPL fix
|
||||
res=(LONG)WhndGetWindowProc(hwnd);
|
||||
|
||||
OldProc = (WNDPROC)(*pGetWindowLong)(hwnd, GWL_WNDPROC);
|
||||
if(OldProc==extWindowProc) OldProc=WhndGetWindowProc(hwnd);
|
||||
WhndStackPush(hwnd, (WNDPROC)dwNewLong);
|
||||
res=(LONG)OldProc;
|
||||
SetLastError(0);
|
||||
lres=(*pSetWindowLong)(hwnd, GWL_WNDPROC, (LONG)extWindowProc);
|
||||
lres=(WNDPROC)(*pSetWindowLong)(hwnd, GWL_WNDPROC, (LONG)extWindowProc);
|
||||
if(!lres && GetLastError())OutTraceE("SetWindowLong: ERROR err=%d at %d\n", GetLastError(), __LINE__);
|
||||
}
|
||||
else {
|
||||
@ -575,7 +576,8 @@ HDWP WINAPI extDeferWindowPos(HDWP hWinPosInfo, HWND hwnd, HWND hWndInsertAfter,
|
||||
OutTraceD("DeferWindowPos: hwnd=%x%s pos=(%d,%d) dim=(%d,%d) Flags=%x\n",
|
||||
hwnd, dxw.IsFullScreen()?"(FULLSCREEN)":"", X, Y, cx, cy, uFlags);
|
||||
|
||||
if ((hwnd != dxw.GethWnd()) || !dxw.IsFullScreen()){
|
||||
//if ((hwnd != dxw.GethWnd()) || !dxw.IsFullScreen()){
|
||||
{
|
||||
// just proxy
|
||||
res=(*pGDIDeferWindowPos)(hWinPosInfo, hwnd, hWndInsertAfter, X, Y, cx, cy, uFlags);
|
||||
if(!res)OutTraceE("SetWindowPos: ERROR err=%d at %d\n", GetLastError(), __LINE__);
|
||||
@ -620,6 +622,9 @@ LRESULT WINAPI extSendMessage(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||
LRESULT ret;
|
||||
OutTraceW("SendMessage: hwnd=%x WinMsg=[0x%x]%s(%x,%x)\n",
|
||||
hwnd, Msg, ExplainWinMessage(Msg), wParam, lParam);
|
||||
|
||||
//if(Msg==WM_NCDESTROY) return 1;
|
||||
|
||||
if(dxw.dwFlags1 & MODIFYMOUSE){
|
||||
switch (Msg){
|
||||
case WM_MOUSEMOVE:
|
||||
@ -803,6 +808,7 @@ BOOL WINAPI extGetMessage(LPMSG lpMsg, HWND hwnd, UINT wMsgFilterMin, UINT wMsgF
|
||||
Message=lpMsg->message & 0xFFFF;
|
||||
if((Message <= WM_MOUSELAST) && (Message >= WM_MOUSEFIRST)){
|
||||
FixedHwnd=(hwnd)?hwnd:dxw.GethWnd();
|
||||
if(dxw.IsDesktop(FixedHwnd)) FixedHwnd=dxw.GethWnd(); // GPL fix...
|
||||
lpMsg->pt=FixMessagePt(FixedHwnd, lpMsg->pt);
|
||||
lpMsg->lParam = MAKELPARAM(lpMsg->pt.x, lpMsg->pt.y);
|
||||
OutTraceC("PeekMessage: fixed lparam/pt=(%d,%d)\n", lpMsg->pt.x, lpMsg->pt.y);
|
||||
@ -1008,6 +1014,33 @@ ATOM WINAPI extRegisterClassExA(WNDCLASSEX *lpwcx)
|
||||
return (*pRegisterClassExA)(lpwcx);
|
||||
}
|
||||
|
||||
HWND WINAPI extCreateWindowExW(
|
||||
DWORD dwExStyle,
|
||||
LPCWSTR lpClassName,
|
||||
LPCWSTR lpWindowName,
|
||||
DWORD dwStyle,
|
||||
int x,
|
||||
int y,
|
||||
int nWidth,
|
||||
int nHeight,
|
||||
HWND hWndParent,
|
||||
HMENU hMenu,
|
||||
HINSTANCE hInstance,
|
||||
LPVOID lpParam)
|
||||
{
|
||||
char sClassName[256+1];
|
||||
char sWindowName[256+1];
|
||||
wcstombs_s(NULL, sClassName, lpClassName, 80);
|
||||
wcstombs_s(NULL, sWindowName, lpWindowName, 80);
|
||||
|
||||
OutTraceD("CreateWindowExW: class=\"%ls\" wname=\"%ls\" pos=(%d,%d) size=(%d,%d) Style=%x(%s) ExStyle=%x(%s)\n",
|
||||
lpClassName, lpWindowName, x, y, nWidth, nHeight,
|
||||
dwStyle, ExplainStyle(dwStyle), dwExStyle, ExplainExStyle(dwExStyle));
|
||||
if(IsDebug) OutTrace("CreateWindowExW: DEBUG screen=(%d,%d)\n", dxw.GetScreenWidth(), dxw.GetScreenHeight());
|
||||
|
||||
return extCreateWindowExA(dwExStyle, sClassName, sWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
|
||||
}
|
||||
|
||||
// GHO: pro Diablo
|
||||
HWND WINAPI extCreateWindowExA(
|
||||
DWORD dwExStyle,
|
||||
@ -1027,14 +1060,14 @@ HWND WINAPI extCreateWindowExA(
|
||||
WNDPROC pWindowProc;
|
||||
BOOL isValidHandle=TRUE;
|
||||
|
||||
OutTraceD("CreateWindowEx: class=\"%s\" wname=\"%s\" pos=(%d,%d) size=(%d,%d) Style=%x(%s) ExStyle=%x(%s)\n",
|
||||
OutTraceD("CreateWindowExA: class=\"%s\" wname=\"%s\" pos=(%d,%d) size=(%d,%d) Style=%x(%s) ExStyle=%x(%s)\n",
|
||||
lpClassName, lpWindowName, x, y, nWidth, nHeight,
|
||||
dwStyle, ExplainStyle(dwStyle), dwExStyle, ExplainExStyle(dwExStyle));
|
||||
if(IsDebug) OutTrace("CreateWindowEx: DEBUG screen=(%d,%d)\n", dxw.GetScreenWidth(), dxw.GetScreenHeight());
|
||||
if(IsDebug) OutTrace("CreateWindowExA: DEBUG screen=(%d,%d)\n", dxw.GetScreenWidth(), dxw.GetScreenHeight());
|
||||
|
||||
// no maximized windows in any case
|
||||
if (dxw.dwFlags1 & PREVENTMAXIMIZE){
|
||||
OutTraceD("CreateWindowEx: handling PREVENTMAXIMIZE mode\n");
|
||||
OutTraceD("CreateWindowExA: handling PREVENTMAXIMIZE mode\n");
|
||||
dwStyle &= ~(WS_MAXIMIZE | WS_POPUP);
|
||||
dwExStyle &= ~WS_EX_TOPMOST;
|
||||
}
|
||||
@ -1046,9 +1079,10 @@ HWND WINAPI extCreateWindowExA(
|
||||
// rendering using CW_USEDEFAULT placement and 800x600 size while the previous
|
||||
// main win was 640x480 only!
|
||||
// v2.02.13: if it's a WS_CHILD window, don't reposition the x,y, placement for BIG win.
|
||||
// v2.02.30: fix (Fable - lost chapters) Fable creates a bigger win with negative x,y coordinates.
|
||||
if (
|
||||
(
|
||||
((x==0)&&(y==0)) || ((x==CW_USEDEFAULT)&&(y==CW_USEDEFAULT))
|
||||
((x<=0)&&(y<=0)) || ((x==CW_USEDEFAULT)&&(y==CW_USEDEFAULT))
|
||||
)
|
||||
&&
|
||||
(((DWORD)nWidth>=dxw.GetScreenWidth())&&((DWORD)nHeight>=dxw.GetScreenHeight()))
|
||||
@ -1059,6 +1093,11 @@ HWND WINAPI extCreateWindowExA(
|
||||
){
|
||||
RECT screen;
|
||||
POINT upleft = {0,0};
|
||||
|
||||
// v2.02.30: fix (Fable - lost chapters)
|
||||
if(nWidth==CW_USEDEFAULT) nWidth=dxw.GetScreenWidth();
|
||||
if(nHeight==CW_USEDEFAULT) nHeight=dxw.GetScreenHeight();
|
||||
|
||||
// update virtual screen size if it has grown
|
||||
dxw.SetScreenSize(nWidth, nHeight);
|
||||
// inserted some checks here, since the main window could be destroyed
|
||||
@ -1071,33 +1110,43 @@ HWND WINAPI extCreateWindowExA(
|
||||
if (screen.right==0 || screen.bottom==0) break;
|
||||
isValidHandle = TRUE;
|
||||
} while(FALSE);
|
||||
if (isValidHandle){
|
||||
if (isValidHandle){ // use parent's coordinates
|
||||
if (!(dwStyle & WS_CHILD)){
|
||||
x=upleft.x;
|
||||
y=upleft.y;
|
||||
}
|
||||
nWidth=screen.right;
|
||||
nHeight=screen.bottom;
|
||||
OutTraceD("CreateWindowEx: fixed BIG win pos=(%d,%d) size=(%d,%d)\n", x, y, nWidth, nHeight);
|
||||
OutTraceD("CreateWindowExA: fixed BIG win pos=(%d,%d) size=(%d,%d)\n", x, y, nWidth, nHeight);
|
||||
}
|
||||
else {
|
||||
// invalid parent coordinates: use initial placement, but leave the size.
|
||||
// should also fix the window style and compensate for borders here?
|
||||
if (!(dwStyle & WS_CHILD)){
|
||||
// if (!(dwStyle & WS_CHILD)){ // commented out: can't be! see if condition
|
||||
x=dxw.iPosX;
|
||||
y=dxw.iPosY;
|
||||
}
|
||||
//}
|
||||
nWidth=dxw.iSizX;
|
||||
nHeight=dxw.iSizY;
|
||||
OutTraceD("CreateWindowEx: renewed BIG win pos=(%d,%d) size=(%d,%d)\n", x, y, nWidth, nHeight);
|
||||
OutTraceD("CreateWindowExA: renewed BIG win pos=(%d,%d) size=(%d,%d)\n", x, y, nWidth, nHeight);
|
||||
}
|
||||
dxw.SetFullScreen(TRUE);
|
||||
if(dxw.Coordinates==DXW_DESKTOP_WORKAREA){
|
||||
RECT workarea;
|
||||
SystemParametersInfo(SPI_GETWORKAREA, NULL, &workarea, 0);
|
||||
x=0;
|
||||
y=0;
|
||||
nWidth=workarea.right;
|
||||
nHeight=workarea.bottom;
|
||||
dwStyle=(dxw.dwFlags2 & MODALSTYLE) ? 0 : WS_OVERLAPPEDWINDOW;
|
||||
OutTraceD("CreateWindowExA: WORKAREA win pos=(%d,%d) size=(%d,%d)\n", x, y, nWidth, nHeight);
|
||||
}
|
||||
}
|
||||
|
||||
if(!dxw.IsFullScreen()){ // v2.1.63: needed for "Monster Truck Madness"
|
||||
wndh= (*pCreateWindowExA)(dwExStyle, lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight,
|
||||
hWndParent, hMenu, hInstance, lpParam);
|
||||
OutTraceD("CreateWindowEx: windowed mode ret=%x\n", wndh);
|
||||
OutTraceD("CreateWindowExA: windowed mode ret=%x\n", wndh);
|
||||
return wndh;
|
||||
}
|
||||
|
||||
@ -1105,24 +1154,24 @@ HWND WINAPI extCreateWindowExA(
|
||||
// Age of Empires....
|
||||
if (dwStyle & WS_CHILD){
|
||||
dxw.MapClient(&x, &y, &nWidth, &nHeight);
|
||||
OutTraceD("CreateWindowEx: fixed WS_CHILD pos=(%d,%d) size=(%d,%d)\n",
|
||||
OutTraceD("CreateWindowExA: fixed WS_CHILD pos=(%d,%d) size=(%d,%d)\n",
|
||||
x, y, nWidth, nHeight);
|
||||
}
|
||||
// needed for Diablo, that creates a new control parent window that must be
|
||||
// overlapped to the directdraw surface.
|
||||
else if (dwExStyle & WS_EX_CONTROLPARENT){
|
||||
dxw.MapWindow(&x, &y, &nWidth, &nHeight);
|
||||
OutTraceD("CreateWindowEx: fixed WS_EX_CONTROLPARENT pos=(%d,%d) size=(%d,%d)\n",
|
||||
OutTraceD("CreateWindowExA: fixed WS_EX_CONTROLPARENT pos=(%d,%d) size=(%d,%d)\n",
|
||||
x, y, nWidth, nHeight);
|
||||
}
|
||||
|
||||
OutTraceB("CreateWindowEx: fixed pos=(%d,%d) size=(%d,%d) Style=%x(%s) ExStyle=%x(%s)\n",
|
||||
OutTraceB("CreateWindowExA: fixed pos=(%d,%d) size=(%d,%d) Style=%x(%s) ExStyle=%x(%s)\n",
|
||||
x, y, nWidth, nHeight, dwStyle, ExplainStyle(dwStyle), dwExStyle, ExplainExStyle(dwExStyle));
|
||||
|
||||
wndh= (*pCreateWindowExA)(dwExStyle, lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight,
|
||||
hWndParent, hMenu, hInstance, lpParam);
|
||||
if (wndh==(HWND)NULL){
|
||||
OutTraceE("CreateWindowEx: ERROR err=%d Style=%x(%s) ExStyle=%x\n",
|
||||
OutTraceE("CreateWindowExA: ERROR err=%d Style=%x(%s) ExStyle=%x\n",
|
||||
GetLastError(), dwStyle, ExplainStyle(dwStyle), dwExStyle);
|
||||
return wndh;
|
||||
}
|
||||
@ -1132,7 +1181,7 @@ HWND WINAPI extCreateWindowExA(
|
||||
extern void AdjustWindowPos(HWND, DWORD, DWORD);
|
||||
(*pSetWindowLong)(wndh, GWL_STYLE, (dxw.dwFlags2 & MODALSTYLE) ? 0 : WS_OVERLAPPEDWINDOW);
|
||||
(*pSetWindowLong)(wndh, GWL_EXSTYLE, 0);
|
||||
OutTraceD("CreateWindow: hwnd=%x, set style=WS_OVERLAPPEDWINDOW extstyle=0\n", wndh);
|
||||
OutTraceD("CreateWindowExA: hwnd=%x, set style=WS_OVERLAPPEDWINDOW extstyle=0\n", wndh);
|
||||
AdjustWindowPos(wndh, nWidth, nHeight);
|
||||
(*pShowWindow)(wndh, SW_SHOWNORMAL);
|
||||
}
|
||||
@ -1150,15 +1199,17 @@ HWND WINAPI extCreateWindowExA(
|
||||
if(!res) OutTraceE("CreateWindowExA: SetWindowLong ERROR %x\n", GetLastError());
|
||||
}
|
||||
|
||||
OutTraceD("CreateWindowEx: ret=%x\n", wndh);
|
||||
OutTraceD("CreateWindowExA: ret=%x\n", wndh);
|
||||
return wndh;
|
||||
}
|
||||
|
||||
LRESULT WINAPI extCallWindowProc(WNDPROC lpPrevWndFunc, HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
// v2.02.30: fix (Imperialism II): apply to main window only !!!
|
||||
HRESULT res;
|
||||
|
||||
res=FixWindowProc("CallWindowProc", hwnd, Msg, wParam, &lParam);
|
||||
res = -1;
|
||||
if(hwnd == dxw.GethWnd()) res=FixWindowProc("CallWindowProc", hwnd, Msg, wParam, &lParam);
|
||||
|
||||
if (res==(HRESULT)-1)
|
||||
return (*pCallWindowProc)(lpPrevWndFunc, hwnd, Msg, wParam, lParam);
|
||||
@ -1168,9 +1219,11 @@ LRESULT WINAPI extCallWindowProc(WNDPROC lpPrevWndFunc, HWND hwnd, UINT Msg, WPA
|
||||
|
||||
LRESULT WINAPI extDefWindowProc(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
// v2.02.30: fix (Imperialism II): apply to main window only !!!
|
||||
HRESULT res;
|
||||
|
||||
res=FixWindowProc("DefWindowProc", hwnd, Msg, wParam, &lParam);
|
||||
res = -1;
|
||||
if(hwnd == dxw.GethWnd()) res=FixWindowProc("DefWindowProc", hwnd, Msg, wParam, &lParam);
|
||||
|
||||
if (res==(HRESULT)-1)
|
||||
return (*pDefWindowProc)(hwnd, Msg, wParam, lParam);
|
||||
@ -1444,7 +1497,7 @@ HDC WINAPI extBeginPaint(HWND hwnd, LPPAINTSTRUCT lpPaint)
|
||||
OutTraceD("GDI.BeginPaint: hwnd=%x lpPaint=%x FullScreen=%x\n", hwnd, lpPaint, dxw.IsFullScreen());
|
||||
hdc=(*pBeginPaint)(hwnd, lpPaint);
|
||||
|
||||
return hdc;
|
||||
//return hdc;
|
||||
|
||||
// if not in fullscreen mode, that's all!
|
||||
if(!dxw.IsFullScreen()) return hdc;
|
||||
@ -1483,7 +1536,7 @@ BOOL WINAPI extEndPaint(HWND hwnd, const PAINTSTRUCT *lpPaint)
|
||||
OutTraceD("GDI.EndPaint: hwnd=%x ret=%x\n", hwnd, ret);
|
||||
if(!ret) OutTraceE("GDI.EndPaint ERROR: err=%d at %d\n", GetLastError(), __LINE__);
|
||||
|
||||
return ret;
|
||||
//return ret;
|
||||
|
||||
// if not in fullscreen mode, that's all!
|
||||
if(!dxw.IsFullScreen()) return ret;
|
||||
@ -1628,22 +1681,31 @@ int WINAPI extShowCursor(BOOL bShow)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int extDrawTextA(HDC hDC, LPCTSTR lpchText, int nCount, LPRECT lpRect, UINT uFormat)
|
||||
int WINAPI extDrawTextA(HDC hDC, LPCTSTR lpchText, int nCount, LPRECT lpRect, UINT uFormat)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int extDrawTextExA(HDC hDC, LPCTSTR lpchText, int cchText, LPRECT lprc, UINT dwDTFormat, LPDRAWTEXTPARAMS lpDTParams)
|
||||
int WINAPI extDrawTextExA(HDC hDC, LPCTSTR lpchText, int cchText, LPRECT lprc, UINT dwDTFormat, LPDRAWTEXTPARAMS lpDTParams)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
BOOL extDrawFocusRect(HDC hDC, const RECT *lprc)
|
||||
BOOL WINAPI extDrawFocusRect(HDC hDC, const RECT *lprc)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL extScrollDC(HDC hDC, int dx, int dy, const RECT *lprcScroll, const RECT *lprcClip, HRGN hrgnUpdate, LPRECT lprcUpdate)
|
||||
BOOL WINAPI extScrollDC(HDC hDC, int dx, int dy, const RECT *lprcScroll, const RECT *lprcClip, HRGN hrgnUpdate, LPRECT lprcUpdate)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
HWND WINAPI extGetTopWindow(HWND hwnd)
|
||||
{
|
||||
HWND ret;
|
||||
OutTraceD("GetTopWindow: hwnd=%x fullscreen=%x\n", hwnd, dxw.IsFullScreen());
|
||||
// a fullscreen program is supposed to be always top Z-order on the desktop!
|
||||
ret = (dxw.IsFullScreen() && dxw.IsDesktop(hwnd)) ? dxw.GethWnd() : (*pGetTopWindow)(hwnd);
|
||||
OutTraceD("GetTopWindow: ret=%x\n", ret);
|
||||
return ret;
|
||||
}
|
@ -36,7 +36,6 @@
|
||||
#define IDD_TAB_COMPAT 160
|
||||
#define IDD_TAB_GDI 161
|
||||
#define IDD_TAB_COLOR 162
|
||||
|
||||
#define IDC_AUTO 300
|
||||
#define IDC_DIRECTX1 301
|
||||
#define IDC_DIRECTX7 302
|
||||
@ -45,18 +44,15 @@
|
||||
#define IDC_NODIRECTX 305
|
||||
#define IDC_DIRECTX10 306
|
||||
#define IDC_DIRECTX11 307
|
||||
|
||||
#define IDC_FILE 1000
|
||||
#define IDC_OPEN 1001
|
||||
#define IDC_STATUSINFO 1005
|
||||
#define IDC_VERSION 1006
|
||||
#define IDC_UNNOTIFY 1007
|
||||
|
||||
#define IDC_NOEMULATESURFACE 1008
|
||||
#define IDC_EMULATEBUFFER 1009
|
||||
#define IDC_LOCKEDSURFACE 1010
|
||||
#define IDC_EMULATESURFACE 1011
|
||||
|
||||
#define IDC_MODIFYMOUSE 1012
|
||||
#define IDC_OUTTRACE 1013
|
||||
#define IDC_HANDLEDC 1014
|
||||
@ -111,6 +107,7 @@
|
||||
#define IDC_CURSORTRACE 1063
|
||||
#define IDC_IMPORTTABLE 1064
|
||||
#define IDC_HANDLEEXCEPTIONS 1065
|
||||
#define IDC_IMPORTTABLE2 1065
|
||||
#define IDC_BLITFROMBACKBUFFER 1066
|
||||
#define IDC_OUTDEBUG 1067
|
||||
#define IDC_SUPPRESSCLIPPING 1068
|
||||
@ -158,6 +155,10 @@
|
||||
#define IDC_SAVECAPS 1110
|
||||
#define IDC_SINGLEPROCAFFINITY 1111
|
||||
#define IDC_HOOKDI 1112
|
||||
#define IDC_EMULATEREGISTRY 1113
|
||||
#define IDC_CDROMDRIVETYPE 1114
|
||||
#define IDC_OUTREGISTRY 1115
|
||||
#define IDC_NOWINDOWMOVE 1116
|
||||
#define ID_MODIFY 32771
|
||||
#define ID_DELETE 32772
|
||||
#define ID_ADD 32773
|
||||
|
@ -34,6 +34,7 @@ void CTabCompat::DoDataExchange(CDataExchange* pDX)
|
||||
DDX_Check(pDX, IDC_LIMITRESOURCES, cTarget->m_LimitResources);
|
||||
DDX_Check(pDX, IDC_SUPPRESSIME, cTarget->m_SuppressIME);
|
||||
DDX_Check(pDX, IDC_SUPPRESSD3DEXT, cTarget->m_SuppressD3DExt);
|
||||
DDX_Check(pDX, IDC_CDROMDRIVETYPE, cTarget->m_CDROMDriveType);
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(CTabCompat, CDialog)
|
||||
|
@ -43,6 +43,7 @@ void CTabLogs::DoDataExchange(CDataExchange* pDX)
|
||||
DDX_Check(pDX, IDC_OUTWINMESSAGES, cTarget->m_OutWinMessages);
|
||||
DDX_Check(pDX, IDC_OUTDXTRACE, cTarget->m_OutDXTrace);
|
||||
DDX_Check(pDX, IDC_IMPORTTABLE, cTarget->m_ImportTable);
|
||||
DDX_Check(pDX, IDC_OUTREGISTRY, cTarget->m_RegistryOp);
|
||||
if(gbDebug){
|
||||
DDX_Check(pDX, IDC_DXPROXED, cTarget->m_DXProxed);
|
||||
DDX_Check(pDX, IDC_ASSERT, cTarget->m_AssertDialog);
|
||||
|
@ -34,6 +34,7 @@ void CTabProgram::DoDataExchange(CDataExchange* pDX)
|
||||
DDX_Check(pDX, IDC_UNNOTIFY, cTarget->m_UnNotify);
|
||||
DDX_Check(pDX, IDC_WINDOWIZE, cTarget->m_Windowize);
|
||||
DDX_Check(pDX, IDC_HOOKDLLS, cTarget->m_HookDLLs);
|
||||
DDX_Check(pDX, IDC_EMULATEREGISTRY, cTarget->m_EmulateRegistry);
|
||||
DDX_Check(pDX, IDC_HOOKCHILDWIN, cTarget->m_HookChildWin);
|
||||
DDX_Check(pDX, IDC_HOOKENABLED, cTarget->m_HookEnabled);
|
||||
DDX_Check(pDX, IDC_NOBANNER, cTarget->m_NoBanner);
|
||||
|
@ -41,6 +41,7 @@ void CTabWindow::DoDataExchange(CDataExchange* pDX)
|
||||
DDX_Check(pDX, IDC_RECOVERSCREENMODE, cTarget->m_RecoverScreenMode);
|
||||
DDX_Check(pDX, IDC_REFRESHONRESIZE, cTarget->m_RefreshOnResize);
|
||||
DDX_Check(pDX, IDC_FIXD3DFRAME, cTarget->m_FixD3DFrame);
|
||||
DDX_Check(pDX, IDC_NOWINDOWMOVE, cTarget->m_NoWindowMove);
|
||||
}
|
||||
|
||||
BOOL CTabWindow::OnInitDialog()
|
||||
|
@ -24,7 +24,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/)
|
||||
m_Coordinates = 0;
|
||||
m_DxEmulationMode = 0; // default: no emulation
|
||||
m_HookDI = FALSE;
|
||||
m_ModifyMouse = FALSE;
|
||||
m_ModifyMouse = TRUE; // default true !!
|
||||
m_OutTrace = FALSE;
|
||||
m_OutDebug = FALSE;
|
||||
m_CursorTrace = FALSE;
|
||||
@ -39,10 +39,12 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/)
|
||||
m_SaveCaps = FALSE;
|
||||
m_SingleProcAffinity = FALSE;
|
||||
m_LimitResources = FALSE;
|
||||
m_CDROMDriveType = FALSE;
|
||||
m_UnNotify = FALSE;
|
||||
m_Windowize = TRUE; // default true !!
|
||||
m_HookDLLs = FALSE;
|
||||
m_HookDLLs = TRUE; // default true !!
|
||||
m_HookEnabled = TRUE; // default true !!
|
||||
m_EmulateRegistry = FALSE; // default true !!
|
||||
m_NoBanner = FALSE;
|
||||
m_StartDebug = FALSE;
|
||||
m_FilePath = _T("");
|
||||
@ -66,7 +68,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/)
|
||||
m_SuppressDXErrors = FALSE;
|
||||
m_MarkBlit = FALSE;
|
||||
m_PreventMaximize = FALSE;
|
||||
m_ClientRemapping = FALSE;
|
||||
m_ClientRemapping = TRUE; // default true !!
|
||||
m_MapGDIToPrimary = FALSE;
|
||||
m_LockWinPos = FALSE;
|
||||
m_LockWinStyle = FALSE;
|
||||
@ -78,6 +80,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/)
|
||||
m_HideMultiMonitor = FALSE;
|
||||
m_WallpaperMode = FALSE;
|
||||
m_FixD3DFrame = FALSE;
|
||||
m_NoWindowMove = FALSE;
|
||||
m_Force16BPP = FALSE;
|
||||
m_HookChildWin = FALSE;
|
||||
m_MessageProc = FALSE;
|
||||
|
@ -37,10 +37,12 @@ public:
|
||||
BOOL m_DXProxed;
|
||||
BOOL m_AssertDialog;
|
||||
BOOL m_ImportTable;
|
||||
BOOL m_RegistryOp;
|
||||
BOOL m_HandleDC;
|
||||
BOOL m_UnNotify;
|
||||
BOOL m_Windowize;
|
||||
BOOL m_HookDLLs;
|
||||
BOOL m_EmulateRegistry;
|
||||
BOOL m_NoBanner;
|
||||
BOOL m_StartDebug;
|
||||
BOOL m_HookEnabled;
|
||||
@ -79,6 +81,7 @@ public:
|
||||
BOOL m_HideMultiMonitor;
|
||||
BOOL m_WallpaperMode;
|
||||
BOOL m_FixD3DFrame;
|
||||
BOOL m_NoWindowMove;
|
||||
BOOL m_HookChildWin;
|
||||
BOOL m_MessageProc;
|
||||
BOOL m_FixNCHITTEST;
|
||||
@ -100,6 +103,7 @@ public:
|
||||
BOOL m_FullRectBlt;
|
||||
BOOL m_NoPaletteUpdate;
|
||||
BOOL m_LimitResources;
|
||||
BOOL m_CDROMDriveType;
|
||||
BOOL m_SuppressIME;
|
||||
BOOL m_SetCompatibility;
|
||||
BOOL m_SaveCaps;
|
||||
|
Binary file not shown.
@ -273,6 +273,7 @@ BEGIN
|
||||
CONTROL "Desktop work area",IDC_DESKTOPWORKAREA,"Button",BS_AUTORADIOBUTTON,170,208,95,10
|
||||
CONTROL "Desktop center",IDC_DESKTOPCENTER,"Button",BS_AUTORADIOBUTTON,170,218,95,10
|
||||
CONTROL "Hook child WindowProc",IDC_HOOKCHILDWIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,142,124,10
|
||||
CONTROL "Emulate Registry",IDC_EMULATEREGISTRY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,162,124,10
|
||||
END
|
||||
|
||||
IDD_TAB_LOG DIALOGEX 0, 0, 300, 240
|
||||
@ -280,16 +281,17 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
|
||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||
BEGIN
|
||||
GROUPBOX "dxwnd.log logs",IDC_STATIC,7,3,129,131
|
||||
CONTROL "Win Events",IDC_OUTWINMESSAGES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,70,73,12
|
||||
CONTROL "DirectX trace",IDC_OUTDXTRACE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,58,73,12
|
||||
CONTROL "Enable Trace",IDC_LOGENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,25,73,12
|
||||
CONTROL "DxWnd",IDC_OUTTRACE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,46,73,12
|
||||
CONTROL "Assert Dialog",IDC_ASSERT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,152,73,12
|
||||
CONTROL "ddraw Proxy",IDC_DXPROXED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,164,73,12
|
||||
CONTROL "DirectX trace",IDC_OUTDXTRACE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,58,73,12
|
||||
CONTROL "Win Events",IDC_OUTWINMESSAGES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,70,73,12
|
||||
CONTROL "Cursor/Mouse",IDC_CURSORTRACE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,82,73,12
|
||||
CONTROL "Import Table",IDC_IMPORTTABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,94,73,12
|
||||
CONTROL "Debug",IDC_OUTDEBUG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,106,73,12
|
||||
CONTROL "Enable Trace",IDC_LOGENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,25,73,12
|
||||
GROUPBOX "debug mode only",IDC_STATIC,7,139,130,94
|
||||
CONTROL "Assert Dialog",IDC_ASSERT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,152,73,12
|
||||
CONTROL "ddraw Proxy",IDC_DXPROXED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,164,73,12
|
||||
CONTROL "Debug",IDC_OUTDEBUG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,106,73,12
|
||||
CONTROL "Registry op.",IDC_OUTREGISTRY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,118,73,12
|
||||
END
|
||||
|
||||
IDD_TAB_DIRECTX DIALOGEX 0, 0, 300, 240
|
||||
@ -394,6 +396,8 @@ BEGIN
|
||||
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 "Don't move D3D rendering window",IDC_NOWINDOWMOVE,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,172,125,10
|
||||
END
|
||||
|
||||
IDD_TAB_EMPTY DIALOGEX 0, 0, 300, 240
|
||||
@ -426,6 +430,7 @@ BEGIN
|
||||
CONTROL "Suppress d3d9 extensions",IDC_SUPPRESSD3DEXT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,176,109,12
|
||||
CONTROL "Set single core process affinity",IDC_SINGLEPROCAFFINITY,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,164,109,12
|
||||
CONTROL "Set CDROM Drive Type",IDC_CDROMDRIVETYPE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,152,109,12
|
||||
END
|
||||
|
||||
IDD_TAB_GDI DIALOGEX 0, 0, 300, 240
|
||||
|
Binary file not shown.
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9,00"
|
||||
Version="9.00"
|
||||
Name="dxwndhost"
|
||||
ProjectGUID="{FD0B0234-8EC5-43C0-A384-1B881DD3D925}"
|
||||
RootNamespace="dxwndhost"
|
||||
@ -365,10 +365,6 @@
|
||||
RelativePath=".\SystemTray.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\SystemTray.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\TabColor.cpp"
|
||||
>
|
||||
@ -474,6 +470,10 @@
|
||||
RelativePath="StdAfx.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\SystemTray.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\TabColor.h"
|
||||
>
|
||||
|
@ -111,6 +111,7 @@ static void SetTargetFromDlg(TARGETMAP *t, CTargetDlg *dlg)
|
||||
if(dlg->m_UnNotify) t->flags |= UNNOTIFY;
|
||||
if(dlg->m_Windowize) t->flags2 |= WINDOWIZE;
|
||||
if(dlg->m_HookDLLs) t->flags3 |= HOOKDLLS;
|
||||
if(dlg->m_EmulateRegistry) t->flags3 |= EMULATEREGISTRY;
|
||||
if(dlg->m_HookEnabled) t->flags3 |= HOOKENABLED;
|
||||
if(dlg->m_NoBanner) t->flags2 |= NOBANNER;
|
||||
if(dlg->m_StartDebug) t->flags2 |= STARTDEBUG;
|
||||
@ -133,9 +134,11 @@ static void SetTargetFromDlg(TARGETMAP *t, CTargetDlg *dlg)
|
||||
if(dlg->m_DXProxed) t->tflags |= DXPROXED;
|
||||
if(dlg->m_AssertDialog) t->tflags |= ASSERTDIALOG;
|
||||
if(dlg->m_ImportTable) t->tflags |= OUTIMPORTTABLE;
|
||||
if(dlg->m_RegistryOp) t->tflags |= OUTREGISTRY;
|
||||
if(dlg->m_HandleDC) t->flags |= HANDLEDC;
|
||||
if(dlg->m_HandleExceptions) t->flags |= HANDLEEXCEPTIONS;
|
||||
if(dlg->m_LimitResources) t->flags2 |= LIMITRESOURCES;
|
||||
if(dlg->m_CDROMDriveType) t->flags3 |= CDROMDRIVETYPE;
|
||||
if(dlg->m_SuppressIME) t->flags2 |= SUPPRESSIME;
|
||||
if(dlg->m_SuppressD3DExt) t->flags3 |= SUPPRESSD3DEXT;
|
||||
if(dlg->m_SetCompatibility) t->flags2 |= SETCOMPATIBILITY;
|
||||
@ -172,6 +175,7 @@ static void SetTargetFromDlg(TARGETMAP *t, CTargetDlg *dlg)
|
||||
if(dlg->m_HideMultiMonitor) t->flags2 |= HIDEMULTIMONITOR;
|
||||
if(dlg->m_WallpaperMode) t->flags2 |= WALLPAPERMODE;
|
||||
if(dlg->m_FixD3DFrame) t->flags3 |= FIXD3DFRAME;
|
||||
if(dlg->m_NoWindowMove) t->flags3 |= NOWINDOWMOVE;
|
||||
if(dlg->m_Force16BPP) t->flags3 |= FORCE16BPP;
|
||||
if(dlg->m_HookChildWin) t->flags |= HOOKCHILDWIN;
|
||||
if(dlg->m_MessageProc) t->flags |= MESSAGEPROC;
|
||||
@ -222,6 +226,7 @@ static void SetDlgFromTarget(TARGETMAP *t, CTargetDlg *dlg)
|
||||
dlg->m_UnNotify = t->flags & UNNOTIFY ? 1 : 0;
|
||||
dlg->m_Windowize = t->flags2 & WINDOWIZE ? 1 : 0;
|
||||
dlg->m_HookDLLs = t->flags3 & HOOKDLLS ? 1 : 0;
|
||||
dlg->m_EmulateRegistry = t->flags3 & EMULATEREGISTRY ? 1 : 0;
|
||||
dlg->m_HookEnabled = t->flags3 & HOOKENABLED ? 1 : 0;
|
||||
dlg->m_NoBanner = t->flags2 & NOBANNER ? 1 : 0;
|
||||
dlg->m_StartDebug = t->flags2 & STARTDEBUG ? 1 : 0;
|
||||
@ -242,6 +247,7 @@ static void SetDlgFromTarget(TARGETMAP *t, CTargetDlg *dlg)
|
||||
dlg->m_DXProxed = t->tflags & DXPROXED ? 1 : 0;
|
||||
dlg->m_AssertDialog = t->tflags & ASSERTDIALOG ? 1 : 0;
|
||||
dlg->m_ImportTable = t->tflags & OUTIMPORTTABLE ? 1 : 0;
|
||||
dlg->m_RegistryOp = t->tflags & OUTREGISTRY ? 1 : 0;
|
||||
dlg->m_HandleDC = t->flags & HANDLEDC ? 1 : 0;
|
||||
dlg->m_HandleExceptions = t->flags & HANDLEEXCEPTIONS ? 1 : 0;
|
||||
dlg->m_SuppressIME = t->flags2 & SUPPRESSIME ? 1 : 0;
|
||||
@ -250,6 +256,7 @@ static void SetDlgFromTarget(TARGETMAP *t, CTargetDlg *dlg)
|
||||
dlg->m_SaveCaps = t->flags3 & SAVECAPS ? 1 : 0;
|
||||
dlg->m_SingleProcAffinity = t->flags3 & SINGLEPROCAFFINITY ? 1 : 0;
|
||||
dlg->m_LimitResources = t->flags2 & LIMITRESOURCES ? 1 : 0;
|
||||
dlg->m_CDROMDriveType = t->flags3 & CDROMDRIVETYPE ? 1 : 0;
|
||||
dlg->m_SaveLoad = t->flags & SAVELOAD ? 1 : 0;
|
||||
dlg->m_SlowDown = t->flags & SLOWDOWN ? 1 : 0;
|
||||
dlg->m_BlitFromBackBuffer = t->flags & BLITFROMBACKBUFFER ? 1 : 0;
|
||||
@ -281,6 +288,7 @@ static void SetDlgFromTarget(TARGETMAP *t, CTargetDlg *dlg)
|
||||
dlg->m_HideMultiMonitor = t->flags2 & HIDEMULTIMONITOR ? 1 : 0;
|
||||
dlg->m_WallpaperMode = t->flags2 & WALLPAPERMODE ? 1 : 0;
|
||||
dlg->m_FixD3DFrame = t->flags3 & FIXD3DFRAME ? 1 : 0;
|
||||
dlg->m_NoWindowMove = t->flags3 & NOWINDOWMOVE ? 1 : 0;
|
||||
dlg->m_Force16BPP = t->flags3 & FORCE16BPP ? 1 : 0;
|
||||
dlg->m_HookChildWin = t->flags & HOOKCHILDWIN ? 1 : 0;
|
||||
dlg->m_MessageProc = t->flags & MESSAGEPROC ? 1 : 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user