Skip to content

Commit

Permalink
Finally enable WOW32 (Windows 16bit support). You need latest NTOSBE …
Browse files Browse the repository at this point in the history
…to build.
  • Loading branch information
leecher1337 committed May 28, 2020
1 parent 7f12eff commit f5696f4
Show file tree
Hide file tree
Showing 39 changed files with 3,505 additions and 411 deletions.
7 changes: 5 additions & 2 deletions ntvdmpatch/doc/patches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ w10_emm.patch - x64 systems cannot allocate with 4k page granularity as
allocation functions on these Windows versions.
(Also see makefile-patches so that correct EMS-manager
code is used)
wow32.patch - Crude hack to disable WOW32, we do not currently support
it, this is just for DOS
wow16.patch - Updates the old WOW16 code that we have to a version that
works together with our WOW32 code. Lots of changes missing,
but basically works as long as we don't have newer code.
wow32.patch - Hack WOW32 to be runnable on x64 Windows Versions without
proper scheduler support.
yoda.patch - Fixes a few compilation problems of Yoda on i386 with CCPU
77 changes: 72 additions & 5 deletions ntvdmpatch/minnt/be.patch
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
--- NTOSBE-master\src\sdktools\build\buildutl.c
+++ NTOSBE-master\src\sdktools\build\buildutl.c
16a17,19
> #ifndef INVALID_FILE_ATTRIBUTES
> #define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
> #endif
294,295c297,298
294,295c294,295
< pmh->pmhNext->pmhPrev = pmh->pmhPrev;
< pmh->pmhPrev->pmhNext = pmh->pmhNext;
---
Expand All @@ -14,3 +10,74 @@
+++ NTOSBE-master\src\sdktools\build\sources
32a33
> NO_SAFESEH=1
--- NTOSBE-master\src\placefil.txt
+++ NTOSBE-master\src\placefil.txt
66a67
> qgrep.exe idw
70a72
> upd.exe idw
--- NTOSBE-master\src\sdktools\dirs
+++ NTOSBE-master\src\sdktools\dirs
17a18,19
> qgrep \
> upd \
--- NTOSBE-master\buildlocaltools.cmd
+++ NTOSBE-master\buildlocaltools.cmd
128a129,134
> call buildlocaltool.cmd qgrep sdktools\qgrep idw\qgrep.exe idw\qgrep.exe
> if errorlevel 1 goto Error
>
> call buildlocaltool.cmd upd sdktools\upd idw\upd.exe idw\upd.exe
> if errorlevel 1 goto Error
>
--- NTOSBE-master\src\sdktools\upd\upd.c
+++ NTOSBE-master\src\sdktools\upd\upd.c
136c136
< else
---
> //else
177a178
> return TRUE;
--- NTOSBE-master\src\sdktools\upd\sources
+++ NTOSBE-master\src\sdktools\upd\sources
39,40c39,42
< UMLIBS=..\ztools\src\obj\*\ztools.lib \
< $(BASEDIR)\public\sdk\lib\*\user32.lib
---
> UMLIBS=$(PROJECT_ROOT)\ztools\src\$(O)\ztools.lib \
> $(SDK_LIB_PATH)\user32.lib
>
> USE_MSVCRT=1
--- NTOSBE-master\src\sdktools\qgrep\sources
+++ NTOSBE-master\src\sdktools\qgrep\sources
39,40c39,42
< UMLIBS=$(BASEDIR)\public\sdk\lib\*\setargv.obj \
< $(BASEDIR)\public\sdk\lib\*\user32.lib
---
> UMLIBS=$(SDK_LIB_PATH)\setargv.obj \
> $(SDK_LIB_PATH)\user32.lib
>
> USE_MSVCRT=1
--- NTOSBE-master\src\public\sdk\inc\crt\ctype.h
+++ NTOSBE-master\src\public\sdk\inc\crt\ctype.h
30a31,50
> /* Define _CRTAPI1 (for compatibility with the NT SDK) */
>
> #ifndef _CRTAPI1
> #if _MSC_VER >= 800 && _M_IX86 >= 300
> #define _CRTAPI1 __cdecl
> #else
> #define _CRTAPI1
> #endif
> #endif
>
>
> /* Define _CRTAPI2 (for compatibility with the NT SDK) */
>
> #ifndef _CRTAPI2
> #if _MSC_VER >= 800 && _M_IX86 >= 300
> #define _CRTAPI2 __cdecl
> #else
> #define _CRTAPI2
> #endif
> #endif
12 changes: 0 additions & 12 deletions ntvdmpatch/minnt/minntfix/NTOSBE-master/buildrepoidw.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -113,22 +113,10 @@ if errorlevel 1 goto Error
call :Build zwapi sdktools\zwapi bldtools\zwapi.exe zwapi.exe
if errorlevel 1 goto Error

call :Build zwapi sdktools\zwapi bldtools\zwapi.exe zwapi.exe
if errorlevel 1 goto Error


REM //
REM // leecher1337: Build mvdm tools necessary for build
REM // Also update broken build.exe
REM //
cd %BEROOT%\src\sdktools\build
build -c
if errorlevel 1 (
echo Build command failed for build.
goto Error
)
copy /y "%NTTREE%\idw\build.exe" "%NATIVEBEREPOIDW%\build.exe"

md %BEROOT%\tools\x86\tools16 2>nul
for /D %%I in (%NTROOT%\base\mvdm\dos\v86\tools\src\*.*) do (
pushd %%I
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@echo off
rem Work around a MDOS-player bug that doesn't allow DOS executables to
rem be started from within another DOS executable, if the executable is
rem an executable that got converterted by MSDOS-player

msdos32 rc16dos %1 %2 %3 %4 %5 %6 %7 %8 %9
27 changes: 27 additions & 0 deletions ntvdmpatch/minnt/minntfix/minnt/base/mvdm/wow16/dirs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
DIRS = kernel31\
lib \
user \
gdi \
system \
shell \
drivers \
winspool\
test \
mmsystem\
mciole \
winsock \
toolhelp\
timer \
wowdeb \
commdlg \
sherlock\
rasapi16\
wfwnet \
ddeml \
winoldap\
ole \
regedit \
killwow \
wifeman \
winnls

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include <windows.h>

CONNECTDLG DIALOG FIXED IMPURE 76, 55, 155, 76
STYLE DS_MODALFRAME | WS_POPUPWINDOW | WS_DLGFRAME
CAPTION "Connect Network Drive"
BEGIN
CONTROL "D&rive:", -1, "STATIC", SS_RIGHT | WS_CHILD | WS_VISIBLE | WS_GROUP, 9, 7, 40, 9
CONTROL "", 500, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_GROUP | WS_TABSTOP, 53, 3, 20, 40
CONTROL "&Network Path:", -1, "STATIC", SS_RIGHT | WS_CHILD | WS_VISIBLE | WS_GROUP, 3, 21, 46, 8
CONTROL "", 502, "EDIT", ES_LEFT | ES_AUTOHSCROLL | ES_OEMCONVERT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_GROUP | WS_TABSTOP, 53, 20, 96, 12
CONTROL "Pass&word:", -1, "STATIC", SS_RIGHT | WS_CHILD | WS_VISIBLE | WS_GROUP, 13, 37, 36, 10
CONTROL "", 501, "EDIT", ES_LEFT | ES_PASSWORD | ES_AUTOHSCROLL | ES_OEMCONVERT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_GROUP | WS_TABSTOP, 53, 35, 60, 12
CONTROL "&Connect", IDOK, "BUTTON", BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 23, 54, 42, 14
CONTROL "C&ancel", IDCANCEL, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 91, 55, 43, 14
END

STRINGTABLE
BEGIN
600, "Network Error"
601, "Unable to connect to network drive."
END
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/********************************************************************/
/* OLECLI.RCV */
/********************************************************************/
#include <version.h>

#define VER_FILETYPE VFT_DLL
#define VER_FILESUBTYPE VFT2_UNKNOWN
#define VER_FILEDESCRIPTION_STR "Microsoft Object Linking and Embedding Libraries for Windows"
#define VER_INTERNALNAME_STR "olecli"
#define VER_ORIGINALFILENAME_STR "olecli.dll"

#include <common.ver>
3 changes: 3 additions & 0 deletions ntvdmpatch/minnt/minntfix/minnt/base/mvdm/wow32/tsappcmp.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
typedef void (WINAPI TERMSRVCORINIFILE)(PUNICODE_STRING UniFile);
typedef TERMSRVCORINIFILE* PTERMSRVCORINIFILE;
BOOL IsTerminalServer();
5 changes: 5 additions & 0 deletions ntvdmpatch/minnt/patch.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,15 @@ popd
echo Patching broken utilities
pushd %BASEPATH%\..\
%PATCHROOT%\util\patch -N -p0 -i %~dp0\tools.patch

find "W10" public\internal\windows\inc\wowuserp.h >nul
if errorlevel 1 %PATCHROOT%\util\patch -N -p0 -i %~dp0\w10.patch
cd ..
%PATCHROOT%\util\patch -N -p0 -i %~dp0\be.patch
rem Also ensure .mc file has CRLF line endings
%PATCHROOT%\util\sed -i "s/\r$/\n$/" NTOSBE-master\src\sdktools\rcdll\rcmsgs.mc
rem Work around broken rc16
del NTOSBE-master\tools\x86\tools16\rc16.exe
popd


Expand Down
12 changes: 11 additions & 1 deletion ntvdmpatch/minnt/prepare.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ echo.
if exist "%ProgramFiles%\7-Zip" set PATH=%PATH%;"%ProgramFiles%\7-Zip"
7z >nul 2>&1
if errorlevel 255 (
for /F "skip=2 tokens=3*" %%r in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\7-zip" /v Path') do echo set PATH=%PATH%;%%r
7z >nul 2>&1
if errorlevel 255 (
echo Please install 7zip first, then run again
start http://www.7-zip.de
pause
goto fini
)
)

rem Directory that contains the fixes to be applied to minnt
set minntfix=minntfix
Expand Down Expand Up @@ -115,7 +119,7 @@ echo You have to find this yourself on the Internet
pause
goto fini
)
7z x -y %workdir%\%OLDSRC% old-src\nt\private\windows\inc\gdispool.h old-src\nt\private\windows\spooler\inc\splapip.h old-src\nt\public\oak\inc\winddiui.h old-src\nt\private\sdktools\jetadmin\inc\winioctl.h old-src\nt\private\sdktools\jetadmin\inc\dsound.h old-src\nt\public\oak\inc\compstui.h old-src\nt\private\mvdm\wow16 old-src\nt\private\mvdm\softpc.new\host\inc\alpha old-src\nt\private\mvdm\softpc.new\host\inc\mips old-src\nt\private\mvdm\softpc.new\host\inc\ppc old-src\nt\private\mvdm\dpmi old-src\nt\private\mvdm\dpmi32 old-src\nt\private\mvdm\inc\intmac.inc old-src\nt\private\mvdm\inc\dpmi.h -o%workdir%
7z x -y %workdir%\%OLDSRC% old-src\nt\private\windows\inc\gdispool.h old-src\nt\private\windows\spooler\inc\splapip.h old-src\nt\public\oak\inc\winddiui.h old-src\nt\private\sdktools\jetadmin\inc\winioctl.h old-src\nt\private\sdktools\jetadmin\inc\dsound.h old-src\nt\public\oak\inc\compstui.h old-src\nt\private\mvdm\wow16 old-src\nt\private\mvdm\softpc.new\host\inc\alpha old-src\nt\private\mvdm\softpc.new\host\inc\mips old-src\nt\private\mvdm\softpc.new\host\inc\ppc old-src\nt\private\mvdm\dpmi old-src\nt\private\mvdm\dpmi32 old-src\nt\private\mvdm\inc\intmac.inc old-src\nt\private\mvdm\inc\dpmi.h old-src\nt\private\mvdm\tools16\implib.exe old-src\nt\private\mvdm\tools16\rc16.exe old-src\nt\private\mvdm\tools16\rcpp.exe old-src\tools\x86\idw\sednew.exe old-src\nt\private\sdktools\upd old-src\nt\private\sdktools\qgrep -o%workdir%
if not exist %workdir%\old-src\nt\private\windows\inc\gdispool.h (
echo Cannot expand %workdir%\old-src\nt\private\windows\inc\gdispool.h from %workdir%\%OLDSRC%
echo Cannot continue.
Expand All @@ -142,6 +146,12 @@ xcopy /e /y %workdir%\old-src\nt\private\mvdm\dpmi32 %minntfix%\minnt\base\mvdm\
xcopy /Y %workdir%\old-src\nt\private\mvdm\inc\intmac.inc %minntfix%\minnt\base\mvdm\dpmi.old\
md %minntfix%\minnt\base\mvdm\inc
copy /Y %workdir%\old-src\nt\private\mvdm\inc\dpmi.h %minntfix%\minnt\base\mvdm\inc\dpmi.h.old
xcopy /e /y %workdir%\old-src\nt\private\mvdm\tools16\implib.exe %minntfix%\NTOSBE-master\tools\x86\tools16\
xcopy /e /y %workdir%\old-src\nt\private\mvdm\tools16\rcpp.exe %minntfix%\NTOSBE-master\tools\x86\tools16\
copy /y %workdir%\old-src\nt\private\mvdm\tools16\rc16.exe %minntfix%\NTOSBE-master\tools\x86\tools16\rc16dos.exe
copy /Y %workdir%\old-src\tools\x86\idw\sednew.exe %minntfix%\NTOSBE-master\tools\x86\idw\sed.exe
xcopy /e /y %workdir%\old-src\nt\private\sdktools\upd %minntfix%\NTOSBE-master\src\sdktools\upd\
xcopy /e /y %workdir%\old-src\nt\private\sdktools\qgrep %minntfix%\NTOSBE-master\src\sdktools\qgrep\
xcopy /Y %minntfix%\minnt\base\mvdm\dos\v86\cmd\append\dirs %minntfix%\minnt\base\mvdm\dpmi.old\

for %%I in (command debug edlin exe2bin graphics keyb loadfix mem nlsfunc setver) do (
Expand Down
6 changes: 5 additions & 1 deletion ntvdmpatch/minnt/release/JPN/ntvdmx64-32.inf
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ redir.exe=3
remline.bas=3
setver.exe=3
share.exe=3
vdmdbg.dll=3
vdmredir.dll=3
v7vga.rom=3
$disp.sys=3
$ias.sys=3
Expand Down Expand Up @@ -97,7 +99,7 @@ symsrv.dll=5
symsrv.yes=5

[Ntvdmx64.amd64.System.Files]
ldntvdm.dll,,,0x4022
ldntvdm.dll,,,0x14022
_default.pif,,,0x41
ansi.sys,,,0x41
append.exe,,,0x41
Expand Down Expand Up @@ -149,6 +151,8 @@ redir.exe,,,0x41
remline.bas,,,0x41
setver.exe,,,0x41
share.exe,,,0x41
vdmdbg.dll,,,0x4022
vdmredir.dll,,,0x4022
v7vga.rom,,,0x4022
$disp.sys,,,0x41
$ias.sys,,,0x41
Expand Down
Loading

0 comments on commit f5696f4

Please sign in to comment.