Skip to content

Commit

Permalink
Windows Versions above XP have a limited VDMREDIR.DLL as shown in @57…
Browse files Browse the repository at this point in the history
…6eafa, so LanManager/NetBIOS interfaces are limited. Adding some DLLs that try to re-enable missing functionality in Windows 7 and above, but this requires Windows Server 2003 sourcecode, therefore make it optional. #219
  • Loading branch information
leecher1337 committed Apr 6, 2023
1 parent 715bf0c commit 5579442
Show file tree
Hide file tree
Showing 41 changed files with 32,165 additions and 2 deletions.
34 changes: 34 additions & 0 deletions autobuild/autobuild-ccpu-chk.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ rem HAXBLD If set to -haxm then HAXM build is built, otherwise normal build
rem DBGSTP If set, pause is issued after every step, useful for testing build
rem SIZ_NTBLD [chk, fre] Checked of free build, default is checked (debug)
rem NOWIN7 Ignore missing Windows 7 ISO (i.e. build only for Win < 8 or no OLE2)
rem NOW2K3 Ignore missing Windows Server 2003 sourcecode (use std. vdmredir.dll)
rem NOPAUSE Do not pause before cleanup
rem LANG Only build this language (for a complete list, see documentation)
rem KEEPWD Keep working directory so that subsequent builds will run through
Expand Down Expand Up @@ -191,6 +192,38 @@ if not exist %PREREQ%\de_windows_7_professional_with_sp1_x86_dvd_u_677093.iso (
)
)

if not "%NOW2K3%"=="" goto w2k3chkd
:chkw2k3
set W2K3SRC=
if exist %PREREQ%\nt5src.7z set W2K3SRC=1
if exist %PREREQ%\Win2K3.7z set W2K3SRC=1
if exist %PREREQ%\3790src2.cab (
if exist %PREREQ%\3790src4.cab set W2K3SRC=1
)
if not "%W2K3SRC%"=="1" (
if not "%W2K3SRCMSG%"=="1" (
echo Windows 7 and above only ship with a crippled VDMREDIR.DLL that i.e. doesn't
echo support mounting network shares via MS-DOS calls.
echo This repository contains code that is able to partly restore Windows XP
echo Networking functions of VDMREDIR.DLL, however the leaked Windows Server 2003
echo is needed for that.
echo So it is recommended to place the leaked sourceode as a prerequisite here too.
echo It can have one of these names:
echo * nt5src.7z
echo * Win2K3.7z
echo * 3790src2.cab, 3790srv4.cab
echo.
echo Now please either download them and put it here and afterwards continue
echo or continue now to go without it (you will get the limited vdmredir.dll)
pause
set W2K3SRCMSG=1
goto chkw2k3
) else (
echo OK, Continuing without enhanced VDMREDIR.DLL then
)
)
:w2k3chkd

if exist old-src-sr687.7z ren old-src-sr687.7z old-src.trunk.r687.20150728.7z
exit /b

Expand All @@ -208,6 +241,7 @@ call :cpyprq GRMSDK_EN_DVD.iso
call :cpyprq GRMWDK_EN_7600_1.ISO
call :cpyprq old-src.trunk.r687.20150728.7z
copy /y %PREREQ%\de_windows_7_professional_with_sp1*.iso ntvdmpatch\minnt\work\
for %%I in (nt5src.7z Win2K3.7z 3790src2.cab 3790src4.cab) do if exist %PREREQ%\%%I call :cpyprq %%I
echo Build environment ready
exit /b

Expand Down
7 changes: 7 additions & 0 deletions ntvdmpatch/bld-minnt.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,17 @@ set LANGX=%LANG%
set LANG=
:nospeclang

if exist ..\public\internal\net\inc\icanon.h (
pushd ..\..\ntvdmpatch\vdmredir
call bld.cmd
popd
)

chcp 437
build -e

if not "%LANGX%"=="" set LANG=%LANGX%
if not "%LANG%"=="" for %%I in (!LNGDIRS!) do if exist %%I\dirs.lng move /y %%I\dirs.lng %%I\dirs

popd

2 changes: 1 addition & 1 deletion ntvdmpatch/doc/autobuild.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ i.e. C:\NTVDMBLD

3) Depending on your OS version and TLS-capabilities, either put supplied

dldr.exe
dwnl.exe

also there, or, if your system is old (like old Win7 version or
Win XP, download
Expand Down
5 changes: 5 additions & 0 deletions ntvdmpatch/doc/minnt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Requirements
https://winfuture.de/downloadvorschalt,3291.html
* An installed version of 7-zip file manager
https://www.7-zip.de
* Recommended: Windows Server 2003 Sourcecode
nt5src.7z


Setup MINNT build environment
Expand Down Expand Up @@ -75,13 +77,16 @@ You now have:
* https://www.microsoft.com/en-us/download/details.aspx?id=8442
* https://winfuture.de/downloadvorschalt,3291.html
* Google old-src.trunk.r687.20150728.7z or old-src-sr687.7z
* Google nt5src.7z
This one is optional. If not present, standard vdmredir.dll is used.

You now have in ntvdmpatch\minnt\work:

GRMSDK_EN_DVD.iso
GRMWDK_EN_7600_1.ISO
de_windows_7_professional_with_sp1_x86_dvd_u_677093.iso
old-src.trunk.r687.20150728.7z
nt5src.7z (optional)

3) Run ntvdmpatch\minnt\prepare.cmd
minntfix directory will now be prepared with the missing files that need to be
Expand Down
13 changes: 13 additions & 0 deletions ntvdmpatch/minnt/patch.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,27 @@ if not exist %PATCHROOT%\util\sed.exe (
)

set minntfix=minntfix
if not "%1"=="vdmredir" (
if not exist %minntfix%\minnt\public\internal\base\inc\splapip.h (
echo It seems you have not prepared %minntfix% directory yet.
echo Please run prepare.cmd first.
pause
goto fini
)
)

if exist ..\vdmredir\minntfix\minnt\public\internal\net\inc\icanon.h (
pushd ..\vdmredir
call patch.cmd batch
popd
)

echo Copying fixed files to minnt repository
xcopy /E /R /Y %minntfix% %BASEPATH%\..\..\
if "%1"=="vdmredir" (
pushd %BASEPATH%\..\
goto noxpsrc
)
echo #include "winddi_xp.h" >>%BASEPATH%\..\..\minnt\public\oak\inc\winddi.h
move %BASEPATH%\..\..\minnt\public\sdk\inc\commctrl.h %BASEPATH%\..\..\minnt\public\sdk\inc\commctrl.h_
rem Prepend include of sal.h to new header file from SDK
Expand Down Expand Up @@ -92,6 +103,8 @@ popd
echo Done, now your MINNT build environment should be in a working condition.
echo Run sizzle_minnt.cmd in Build environment directory next and do
echo buildrepoidw.cmd

if "%1"=="vdmredir" goto fini
if not "%1"=="batch" pause

:fini
15 changes: 14 additions & 1 deletion ntvdmpatch/minnt/prepare.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,11 @@ call :expandiso GRMSDK_EN_DVD.iso Setup\WinSDKDebuggingTools\dbg_x86.msi
goto redosdk

:sdkok
set WOW16=old-src\nt\private\mvdm\wow16
rem In case that WinXP/2k3 src is present, this would use original WOW16 code instead of our
rem reconstruction. However, orignal WOW16 code is incompatible with CCPU, therefore this
rem code branch will never become active. It's just here for experimental purposes, ignore it.
set WOW16=old-src\nt\private\mvdm\wow16
goto winxpok
if exist %minntfix%\minnt\base\mvdm\wow16\makefile.inc goto winxpok
if exist "%workdir%\XPSP1.7z" 7z x -y %workdir%\XPSP1.7z xpsrc1.cab -o%workdir%
if exist %workdir%\xpsrc1.cab 7z x -y %workdir%\xpsrc1.cab base\mvdm\wow16 -o%workdir%\
Expand All @@ -137,6 +138,18 @@ if exist %workdir%\base\mvdm\wow16 (
)

:winxpok
set W2K3SRC=
if exist %workdir%\nt5src.7z set W2K3SRC=1
if exist %workdir%\Win2K3.7z set W2K3SRC=1
if exist %workdir%\3790src2.cab (
if exist %workdir%\3790src4.cab set W2K3SRC=1
)
if "%W2K3SRC%"=="1" (
pushd ..\vdmredir
call prepare.cmd %1
popd
)

for %%a in (gdispool.h splapip.h) do if not exist "%minntfix%\minnt\public\internal\base\inc\%%~a" goto dooldsrc
goto oldsrcok
:dooldsrc
Expand Down
2 changes: 2 additions & 0 deletions ntvdmpatch/mkrelease-minnt.bat
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ for %%L in (!LANG!) do (
xcopy /Y !BINDIR!\%%I releases\%%L\dos\
)
)
for %%I in (NetRap.dll xactsrv.dll) do if exist !BINDIR!\%%I xcopy /Y !BINDIR!\%%I releases\%%L\dos\
if exist !BINDIR!\xactsrv.dll xcopy /Y vdmredir\release\*.* releases\%%L\
for %%I in ($disp.sys $ias.sys $prnescp.sys adddrv.exe config.us deldrv.exe disp_win.sys font_win.sys jp.bat key02.sys keyax.sys kkcfunc.sys msime.dic msime.sys msimed.sys msimei.sys msimek.sys msimekey.exe msimelst.exe msimer.dic msimergn.exe msimeset.exe ntfont.sys us.bat edit.exe edit2.hlp hbios.sys hfont.sys qbasic.com qbasic2.exe qbasic2.hlp) do if exist !LANGDIR!\%%I xcopy /Y !LANGDIR!\%%I releases\%%L\dos\
if exist !LANGDIR!\system32\msherc.com (
xcopy /Y !LANGDIR!\system32\msherc.com releases\%%L\dos\
Expand Down
2 changes: 2 additions & 0 deletions ntvdmpatch/release/install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ powershell -noprofile -command Add-MpPreference -Force -ExclusionPath "$env:DefE
:nodefender
echo [*] Installing components
rundll32.exe advpack.dll,LaunchINFSection %CD%\ntvdmx64.inf
if exist vdmredir.inf rundll32.exe advpack.dll,LaunchINFSection %CD%\vdmredir.inf
goto fini

:addappinit
Expand Down Expand Up @@ -201,6 +202,7 @@ if not "%VERSION%"=="11.0" (
if exist %windir%\inf\wow32.inf RunDll32 advpack.dll,LaunchINFSection %windir%\inf\wow32.inf,DefaultUninstall
if exist %windir%\inf\ntvdmdbg.inf RunDll32 advpack.dll,LaunchINFSection %windir%\inf\ntvdmdbg.inf,DefaultUninstall
if exist %windir%\inf\ntvdmx64-haxm.inf RUNDLL32 SETUPAPI.DLL,InstallHinfSection DefaultUninstall 132 %windir%\inf\ntvdmx64-haxm.inf
if exist %windir%\inf\vdmredir.inf RUNDLL32 SETUPAPI.DLL,InstallHinfSection DefaultUninstall 132 %windir%\inf\vdmredir.inf
goto fini

:instwow
Expand Down
57 changes: 57 additions & 0 deletions ntvdmpatch/vdmredir/bld.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
@echo off
call ..\basepath.cmd
SETLOCAL EnableDelayedExpansion
pushd %BASEPATH%\..
set BASEDIR=%CD%
set BUILD_ALLOW_ALL_WARNINGS=1
chcp 437

rem -- Build SAM lib
pushd ds\sam\client\w7
build
popd


rem -- Build NETRAP and XACTSRV
pushd ds\netapi

pushd netlib\w7
build
popd

pushd rap
build
popd

pushd dosprint
build
popd

pushd rpcxlate\rxcommon
build
popd

pushd rpcxlate\rxapi
build
popd

pushd svcdlls\srvsvc\client\w7
build
popd

pushd svcdlls\browser2\client
build
popd

pushd xactsrv
build
popd

popd

rem -- Build vdmredir.dll
pushd base\mvdm\vdmredir
build
popd

popd
79 changes: 79 additions & 0 deletions ntvdmpatch/vdmredir/minntfix/minnt/base/mvdm/vdmredir/sources.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
!IF 0

Copyright (c) 1989-1991 Microsoft Corporation

Module Name:

sources.

Abstract:

This file specifies the target component being built and the list of
sources files needed to build that component. Also specifies optional
compiler switches and libraries that are unique for the component being
built.

!ENDIF

MVDMDIR=$(PROJECT_ROOT)\mvdm

TARGETNAME=vdmredir
TARGETPATH=obj
TARGETTYPE=DYNLINK
TARGETLIBS=$(SDK_LIB_PATH)\advapi32.lib \
$(SDK_LIB_PATH)\kernel32.lib \
$(SDK_LIB_PATH)\netapi32w7.lib \
$(SDK_LIB_PATH)\rxapi.lib \
$(SDK_LIB_PATH)\rxcommon.lib \
$(SDK_LIB_PATH)\netlibw7.lib \
$(SDK_LIB_PATH)\netutils.lib \
$(SDK_LIB_PATH)\netlibold.lib \
$(SDK_LIB_PATH)\ntvdm.lib \
$(SDK_LIB_PATH)\xactsrv.lib \
$(SDK_LIB_PATH)\netrap.lib \
$(SDK_LIB_PATH)\safecrtnt.lib \
$(SDK_LIB_PATH)\rpcrt4.lib
# $(DS_LIB_PATH)\netapi32p.lib \

DLLENTRY=VrDllInitialize
DLLBASE=0x03000000

USE_MSVCRT=1

INCLUDES=\
$(MVDMDIR)\vdmredir;\
$(MVDMDIR)\inc;\
$(NET_INC_PATH);\
$(DS_INC_PATH);\
$(MVDMDIR)\softpc.new\base\inc;\
$(MVDMDIR)\softpc.new\host\inc

SOURCES=..\vdmredir.rc \
..\vrmslot.c \
..\vrnmpipe.c \
..\vrdisp.c \
..\vrinit.c \
..\vrmisc.c \
..\vrnetapi.c \
..\vrnetb.c \
..\vrputil.c \
..\vrremote.c \
..\vrdlc5c.c \
..\vrdlcpst.c \
..\vrdlcbuf.c \
..\vrdlcdbg.c \
..\vrdebug.c \
..\vrdll.c

MSC_WARNING_LEVEL=/W3 /WX

C_DEFINES=-DVDMREDIR_DLL -DUNALIGNED_VDM_POINTERS $(C_DEFINES)

NO_SAFESEH=1

#
# HACKHACK: We are forcing it to link with multiply symbols because we do not have netapi32p.lib
# at the moment.
#

LINKER_FLAGS=$(LINKER_FLAGS) /FORCE
50 changes: 50 additions & 0 deletions ntvdmpatch/vdmredir/minntfix/minnt/ds/netapi/dosprint/sources
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
!IF 0

Copyright (c) 1989-1992 Microsoft Corporation

Module Name:

sources.

Abstract:

This file specifies the target component being built and the list of
sources files needed to build that component. Also specifies optional
compiler switches and libraries that are unique for the component being
built.


Author:

Steve Wood (stevewo) 12-Apr-1990

NOTE: Commented description of this file is in \nt\bak\bin\sources.tpl

!ENDIF

MAJORCOMP=windows
MINORCOMP=dosprint

TARGETNAME=dosprint
TARGETPATH=$(SDK_LIB_DEST)
TARGETTYPE=LIBRARY

TARGETLIBS=$(SDK_LIB_PATH)\winspool.lib

INCLUDES=$(DS_INC_PATH);$(BASE_INC_PATH);$(NET_INC_PATH);..\inc

C_DEFINES=-DNO_WINSPOOLH

!IFNDEF DISABLE_NET_UNICODE
UNICODE=1
NET_C_DEFINES=-DUNICODE
!ENDIF

MSC_WARNING_LEVEL=/W3 /WX

SOURCES=\
dosspool.c \
DosPrint.c \
DosPrtP.c \
DosPrtW.c \
convprt.c

0 comments on commit 5579442

Please sign in to comment.