diff --git a/build/dxwnd.dll b/build/dxwnd.dll index 51a40a3..8538e43 100644 --- a/build/dxwnd.dll +++ b/build/dxwnd.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7fd28d3540f74ceab1034bff9cd6fd4059e759568c2c207393d61fe20f0367da +oid sha256:3a374cec9f980973164610e2661704aa5658ea7e19901b5e61aa72207c7624b3 size 660480 diff --git a/build/dxwnd.exe b/build/dxwnd.exe index 5b71e95..90384f5 100644 --- a/build/dxwnd.exe +++ b/build/dxwnd.exe @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b4833fd88b00f606494df68b4af21d27e5f419a90686cb407e0539166dea762e -size 642560 +oid sha256:d041afd6e18a75dc3b7316a913318827696603e87d9f8e6a06da4da57ccdbf53 +size 643072 diff --git a/build/dxwnd.ini b/build/dxwnd.ini new file mode 100644 index 0000000..999b7b8 --- /dev/null +++ b/build/dxwnd.ini @@ -0,0 +1,41 @@ +[target] +title0=Mechwarrior 3 (high res) +path0=D:\Games\Mechwarrior 3 - RIP\Mech3.exe +launchpath0= +module0= +opengllib0= +notes0= +registry0=\n[HKEY_LOCAL_MACHINE\Software]\n[HKEY_LOCAL_MACHINE\Software\MicroProse]\n[HKEY_LOCAL_MACHINE\Software\MicroProse\MechWarrior 3 EP1]\n[HKEY_LOCAL_MACHINE\Software\MicroProse\MechWarrior 3 EP1\1.0]\n"Program"="..\\"\n"Version"="1.0"\n"InstallOptions"=dword:00050707\n\n[HKEY_LOCAL_MACHINE\Software\Microsoft]\n[HKEY_LOCAL_MACHINE\Software\Microsoft\DirectPlay]\n[HKEY_LOCAL_MACHINE\Software\Microsoft\DirectPlay\Applications]\n[HKEY_LOCAL_MACHINE\Software\Microsoft\DirectPlay\Applications\MechWarrior 3 EP1]\n"Guid"="{FA96C421-18DD-11D3-95AF-0060089877F0}"\n"File"="Mech3.exe"\n"CommandLine"="\n"Path"=".\\"\n"CurrentDirectory"=".\\"\n\n[HKEY_CURRENT_USER\Software]\n[HKEY_CURRENT_USER\Software\MicroProse]\n[HKEY_CURRENT_USER\Software\MicroProse\MechWarrior 3]\n[HKEY_CURRENT_USER\Software\MicroProse\MechWarrior 3\1.0]\n"InGameVMode"=dword:0000000a +ver0=0 +coord0=0 +flag0=136331398 +flagg0=1207959552 +flagh0=9236 +flagi0=1277165574 +flagj0=4224 +flagk0=65600 +flagl0=0 +flagm0=0 +tflag0=0 +dflag0=0 +posx0=50 +posy0=50 +sizx0=800 +sizy0=600 +maxfps0=0 +initts0=0 +winver0=0 +maxres0=-1 +swapeffect0=0 +maxddinterface0=7 +slowratio0=1 +title1=Mechwarrior 3 (high res) +module1= +opengllib1= +dflag1=0 +[window] +posx=915 +posy=519 +sizx=320 +sizy=200 +exportpath=D:\DxWnd\exports.ok\ diff --git a/build/exports/Mechwarrior 3 (high res).dxw b/build/exports/Mechwarrior 3 (high res).dxw new file mode 100644 index 0000000..2d33530 --- /dev/null +++ b/build/exports/Mechwarrior 3 (high res).dxw @@ -0,0 +1,31 @@ +[target] +title0=Mechwarrior 3 (high res) +path0=D:\Games\Mechwarrior 3 - RIP\Mech3.exe +launchpath0= +module0= +opengllib0= +notes0= +registry0=\n[HKEY_LOCAL_MACHINE\Software]\n[HKEY_LOCAL_MACHINE\Software\MicroProse]\n[HKEY_LOCAL_MACHINE\Software\MicroProse\MechWarrior 3 EP1]\n[HKEY_LOCAL_MACHINE\Software\MicroProse\MechWarrior 3 EP1\1.0]\n"Program"="..\\"\n"Version"="1.0"\n"InstallOptions"=dword:00050707\n\n[HKEY_LOCAL_MACHINE\Software\Microsoft]\n[HKEY_LOCAL_MACHINE\Software\Microsoft\DirectPlay]\n[HKEY_LOCAL_MACHINE\Software\Microsoft\DirectPlay\Applications]\n[HKEY_LOCAL_MACHINE\Software\Microsoft\DirectPlay\Applications\MechWarrior 3 EP1]\n"Guid"="{FA96C421-18DD-11D3-95AF-0060089877F0}"\n"File"="Mech3.exe"\n"CommandLine"="\n"Path"=".\\"\n"CurrentDirectory"=".\\"\n\n[HKEY_CURRENT_USER\Software]\n[HKEY_CURRENT_USER\Software\MicroProse]\n[HKEY_CURRENT_USER\Software\MicroProse\MechWarrior 3]\n[HKEY_CURRENT_USER\Software\MicroProse\MechWarrior 3\1.0]\n"InGameVMode"=dword:0000000a\n +ver0=0 +coord0=0 +flag0=136331398 +flagg0=1207959552 +flagh0=9236 +flagi0=1277165574 +flagj0=4224 +flagk0=65600 +flagl0=0 +flagm0=0 +tflag0=0 +dflag0=0 +posx0=50 +posy0=50 +sizx0=800 +sizy0=600 +maxfps0=0 +initts0=0 +winver0=0 +maxres0=-1 +swapeffect0=0 +maxddinterface0=7 +slowratio0=1 diff --git a/build/readme-relnotes.txt b/build/readme-relnotes.txt index a2a517c..77974b2 100644 --- a/build/readme-relnotes.txt +++ b/build/readme-relnotes.txt @@ -1148,11 +1148,14 @@ fix: logging of dwFOURCC field text value fix: Injection routine: avoid closing a few handles that should not be closed, simplified logic. add: GUI global configuration panel -v2.03.75 +v2.03.75/fix1 fix: handling of restore previous screen mode when a primary fullscreen window is terminated. Fixes "Dethkarz" initialization error after 8BPP intro movie termination. fix: SystemParameterInfo for SPI_SETSCREENSAVERRUNNING does not return an error fix: added default pixel format specification to backbuffer: improves the possibility of ZBUFFER attach fix: recovery of DDERR_SURFACELOST error on primary surface in PrimaryStretchBlt routine. fix: possible palette handle leakage fix: DC leakage caused by CreateCompatibleDC. Fix "Mechwarrior 3" repeated play sessions. -add: GUI drag & drop of game executables \ No newline at end of file +add: GUI drag & drop of game executables +fix: RegQueryValueEx bad retcode when Data ptr is NULL +fix: recovered support for Windows XP +fix: fake registry did not read last registry line! Fixed. \ No newline at end of file diff --git a/dll/advapi.cpp b/dll/advapi.cpp index 645289b..a0ab6f2 100644 --- a/dll/advapi.cpp +++ b/dll/advapi.cpp @@ -160,6 +160,7 @@ static FILE *OpenFakeRegistry() strcpy(p, "dxwnd.reg"); freg = fopen(sSourcePath,"w"); fwrite(FileBuf, 1, strlen(FileBuf), freg); + fputs("\n", freg); fclose(freg); free(FileBuf); } @@ -256,7 +257,7 @@ static DWORD GetKeyValue( char RegBuf[MAX_PATH+1]; DWORD cbData=0; - OutTrace("GetKeyValue: ValueName=%s", lpValueName); + //OutTrace("GetKeyValue: ValueName=%s\n", lpValueName); fgets(RegBuf, 256, regf); pData=&RegBuf[strlen(lpValueName)+3]; lpb = lpData; @@ -294,6 +295,8 @@ static DWORD GetKeyValue( else res=ERROR_MORE_DATA; } + else + res=ERROR_SUCCESS; // data not needed if (lpcbData) *lpcbData=sizeof(DWORD); OutTraceR("%s: type=REG_DWORD cbData=%x Data=0x%x\n", ApiName, lpcbData ? *lpcbData : 0, val); @@ -448,11 +451,20 @@ LONG WINAPI extRegQueryValueEx( } regf=OpenFakeRegistry(); - if(regf==NULL) return ERROR_FILE_NOT_FOUND; + if(regf==NULL) { + OutTraceR("RegQueryValueEx: error in OpenFakeRegistry err=%s\n", GetLastError()); + return ERROR_FILE_NOT_FOUND; + } res = SeekFakeKey(regf, hKey); - if(res != ERROR_SUCCESS) return res; + if(res != ERROR_SUCCESS) { + OutTraceR("RegQueryValueEx: error in SeekFakeKey res=%x hKey=%x\n", res, hKey); + return res; + } res = SeekValueName(regf, lpValueName); - if(res != ERROR_SUCCESS) return res; + if(res != ERROR_SUCCESS) { + OutTraceR("RegQueryValueEx: error in SeekValueName res=%x ValueName=%s\n", res, lpValueName); + return res; + } res = GetKeyValue(regf, "RegQueryValueEx", lpValueName, lpType, lpData, lpcbData); if(IsTraceR) LogKeyValue("RegQueryValueEx", res, lpType, lpData, lpcbData); fclose(regf); diff --git a/dll/dxwnd.cpp b/dll/dxwnd.cpp index ace19f4..0e8435e 100644 --- a/dll/dxwnd.cpp +++ b/dll/dxwnd.cpp @@ -27,7 +27,7 @@ along with this program. If not, see . #include "TlHelp32.h" -#define VERSION "2.03.75" +#define VERSION "2.03.75.fix1" #define DDTHREADLOCK 1 //#define LOCKTHREADS diff --git a/dll/dxwnd.vs2008.suo b/dll/dxwnd.vs2008.suo index fe92775..e5024e0 100644 Binary files a/dll/dxwnd.vs2008.suo and b/dll/dxwnd.vs2008.suo differ diff --git a/host/TabProgram.cpp b/host/TabProgram.cpp index 8582597..a6ccd8c 100644 --- a/host/TabProgram.cpp +++ b/host/TabProgram.cpp @@ -177,9 +177,6 @@ BOOL CTabProgram::OnInitDialog() CStatic *IconBox; IFormat *m_pRelIntegerFormat = new(RelIntegerFormat); - //ChangeWindowMessageFilter(WM_DROPFILES, MSGFLT_ADD); - //ChangeWindowMessageFilter(WM_COPYDATA, MSGFLT_ADD); - //ChangeWindowMessageFilter(0x0049, MSGFLT_ADD); DragAcceptFiles(); CDragEdit *pEditFile; pEditFile = (CDragEdit *)this->GetDlgItem(IDC_FILE); diff --git a/host/dxwndhost.aps b/host/dxwndhost.aps index b86bcd5..e25e84b 100644 Binary files a/host/dxwndhost.aps and b/host/dxwndhost.aps differ diff --git a/host/dxwndhost.vs2008.suo b/host/dxwndhost.vs2008.suo index 88714c8..d8defb2 100644 Binary files a/host/dxwndhost.vs2008.suo and b/host/dxwndhost.vs2008.suo differ diff --git a/host/dxwndhostView.cpp b/host/dxwndhostView.cpp index 801ba76..db1d033 100644 --- a/host/dxwndhostView.cpp +++ b/host/dxwndhostView.cpp @@ -1154,11 +1154,19 @@ void CDxwndhostView::OnInitialUpdate() LV_COLUMN listcol; LV_ITEM listitem; int i; + typedef BOOL (WINAPI *ChangeWindowMessageFilter_Type)(UINT, DWORD); + ChangeWindowMessageFilter_Type pChangeWindowMessageFilter; DragAcceptFiles(); - ChangeWindowMessageFilter(WM_DROPFILES, MSGFLT_ADD); - ChangeWindowMessageFilter(WM_COPYDATA, MSGFLT_ADD); - ChangeWindowMessageFilter(0x0049, MSGFLT_ADD); + // the ChangeWindowMessageFilter is not available, nor necessary, on XP + HMODULE hUser32; + hUser32 = GetModuleHandle("user32.dll"); + pChangeWindowMessageFilter = (ChangeWindowMessageFilter_Type)GetProcAddress(hUser32, "ChangeWindowMessageFilter"); + if(pChangeWindowMessageFilter){ + (*pChangeWindowMessageFilter)(WM_DROPFILES, MSGFLT_ADD); + (*pChangeWindowMessageFilter)(WM_COPYDATA, MSGFLT_ADD); + (*pChangeWindowMessageFilter)(0x0049, MSGFLT_ADD); + } // Create 256 color image lists HIMAGELIST hList = ImageList_Create(32,32, ILC_COLOR8 |ILC_MASK , 4, 1); @@ -1595,6 +1603,7 @@ void CDxwndhostView::OnSetRegistry() } fwrite(Registry, strlen(Registry), 1, regfp); + fputs("\n", regfp); fclose(regfp); } @@ -2641,6 +2650,7 @@ void CDxwndhostView::OnRun() regfp=fopen("dxwnd.reg", "w"); if(regfp==NULL)MessageBox("Error writing virtual registry file", "Error", MB_ICONERROR|MB_OK); fwrite(Registry, strlen(Registry), 1, regfp); + fputs("\n", regfp); fclose(regfp); }