Stable
NTVDBM Suite
An NTVDM replacement for Windows XP: a registry handler, NTVDBM for DOS and Winbox for Windows 3.1.
- Latest release
- No published release
- Updated
- Nov 30, 2026
- Languages
- EN · PT
- Connections
- 0
Overview
NT Virtual DosBox Machine Suite
The NTVDBM Suite gives Windows XP back the ability to open MS-DOS and Windows 3.1 programs with a double click, without NTVDM and without PIFs. In place of Microsoft’s subsystem there is a registry handler, a DOSBox fork for DOS and a 16-bit layer for Windows 3.1.
The NTVDBM-Suite repository is the assembly point: the C handler and the shortcut builder live at the top, the two engines arrive as Git submodules, and system32/ carries the icons and the MinGW DLL the binaries depend on.
Three paths, one signature
When a .exe or .com is opened, Windows consults HKCR\exefile\shell\open\command (and the equivalent key for .com) and calls hdl.exe with the file path. The handler reads the MZ header, follows the offset stored at 0x3C and looks for a PE or NE signature. Win32 goes to the kernel with its command line untouched; Win16 starts Winbox with WIN.INI pointing at the program; everything else — .com included — goes to NTVDBM with a per-game .conf.
The result is a thin, predictable layer: the handler decides, the engines execute, and the state lives in three SYSTEM32 folders.
- No PIF: Windows no longer demands a configuration file that itself depends on NTVDM to create 16-bit shortcuts.
- Per-game configuration: the .conf is named after the executable and a CRC16 of its contents, so two versions of the same game never share options.
- Shareable icons: the same hash produces the same icon name on any machine, which makes a ready-made icon library distributable.
The four pieces
- Active Handler (hdl.exe)
Classifies PE, NE and DOS, computes the CRC16, copies the template .conf and starts the right engine.
- Active NTVDBM
A DOSBox 0.74-3 fork tuned for Pentium M: no console, waveOut audio, simplified OpenGL.
- Active Winbox
The same DOSBox with a minimal Windows 3.1 mounted as W: to run 16-bit programs.
- Active Shortcuts and icons
sendtotool.c creates desktop shortcuts and resolves the icon by name, folder or generic file.
Project sheet
| Project | |
|---|---|
| License | GPL-2.0 |
| Version | 1.0 — last suite commit on 2026-06-30 |
| Status | Stable: handler and shortcuts complete; reported compatibility from 1987 to 1999 |
| Runtime | |
| Base | DOSBox 0.74-3 with DOSBox ECE and parts of DOSBox-X low-end |
| Platform | 32-bit Windows XP (Win32), SDL 1.2.x |
| Hardware target | 1 GHz Pentium M, 256 MB of RAM (first-generation Apple TV) |
| Build | |
| Toolchain | MinGW-w64/MSYS2 with gcc 7; autogen.sh and configure; console-free binaries |
| External dependency | libwinpthread-1.dll, shipped in system32 |
| Repositories | |
| Code | NTVDBM-Suite + ntvdbm and winbox submodules |
The problem
NTVDM presented a virtual DOS PC to a 32-bit process. When that path disappears, a shortcut to a 1993 game stops opening — and Windows answers with a PIF that also depends on NTVDM.
The suite was born when that path stopped being available — the author cites XP installs on UEFI machines and a first-generation Apple TV with no BIOS — and when the PIF, the format Windows uses for 16-bit program shortcuts, stopped serving. The declared test case is Doom.
What is lost without NTVDM
- Double click: a shortcut to a DOS .exe will not open; Windows turns it into a PIF, which in turn depends on NTVDM.
- Arguments: the PIF stores system options, not DOSBox ones; cycles, mounts and sound stay out of the user’s reach.
- Diagnosis: there is no error output. A black screen is all the information available.
- Per-game configuration: every program needs a .conf with its drive mounted, and writing it by hand is the step nobody takes.
The suite does not answer by emulating better: it uses the DOSBox that already exists, gives it an automatic .conf, and hides all of it behind the simplest Windows gesture.
Architecture
Four executables, three registry keys and two state folders: that is the suite’s inventory once copied into a 32-bit XP SYSTEM32.
| Path in SYSTEM32 | Role |
|---|---|
| hdl.exe | Called by the shell for every .exe and .com; picks the engine. |
| NTVDBM.EXE | DOS runtime (DOSBox fork). |
| WINBOX.EXE | 16-bit runtime (DOSBox + Windows 3.1). |
| NTVDBM.CONF | Template configuration copied for every new game. |
| CONF\ | One .conf per executable, named <name>_<CRC16>.conf. |
| WINBOX\ | Windows 3.1 tree, mounted as W: by Winbox. |
| GAMEICONS\ | <name>_<CRC16>.ico icons, including the three generic ones. |
| libwinpthread-1.dll | Dependency shared by both runtimes (MinGW). |
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\exefile\shell\open\command]
@="\"C:\WINDOWS\SYSTEM32\hdl.exe\" \"%1\" %*"
[HKEY_CLASSES_ROOT\comfile\shell\open\command]
@="\"C:\WINDOWS\SYSTEM32\hdl.exe\" \"%1\" %*" Why the registry and not a service?
A handler in HKCR is called in the context of the user who opened the file. It needs no service, no elevation and no driver, and it can be switched off by double-clicking disable handler.reg.
What about arguments?
For Win32 the handler passes the whole command line, exactly as the shell received it, quotes and all. For DOS and Win16 it rebuilds it from scratch: DOSBox is the one running, and the program only receives its executable name.
What is left on disk after a run?
A .conf in SYSTEM32\CONF, a .lnk next to the game (DOS path only) and a line in HDL_DEBUG.LOG. Nothing is written into the game folder besides the shortcut to the .conf.
The handler
hdl.c is the brain of the suite and fits in one file: it receives the executable path, reads 64 bytes, decides and launches.
Before reading anything, the handler compares the received path with its own module path and exits if they match. It is the guard against the loop where the handler calls itself once the registry points at it.
Then it classifies the file, and all the remaining work is assembling the right command line.
The handler opens the file and reads the first two bytes: without MZ it is DOS. With MZ it reads the offset stored at 0x3C and validates it — at least 0x40 and inside the file. Only then does it look for a PE or NE signature.
.com files are never read: they are always DOS, even if their contents carry another signature.
/* abridged from exe_type(): MZ + e_lfanew is only followed when plausible */
if (mz[0] != 'M' || mz[1] != 'Z') return TYPE_DOS;
if (fread(&ofs, 4, 1, f) != 1 || ofs < 0x40 || (long)ofs + 2 > fsize) return TYPE_DOS;
fseek(f, ofs, SEEK_SET);
if (fread(sig, 1, 2, f) != 2) return TYPE_DOS;
if (sig[0] == 'P' && sig[1] == 'E') return TYPE_WIN32;
if (sig[0] == 'N' && sig[1] == 'E') return TYPE_WIN16;
return TYPE_DOS; /* includes LE (OS/2, VxD) */Abridged from src/hdl.c; the original comments are in Portuguese.
LE — the linear format of OS/2 and VxD drivers — deliberately falls back to DOS. The handler only distinguishes the three formats the suite knows how to launch.
A PE is not emulated. The handler reads the full process command line, calls CreateProcessA with it without touching quotes or arguments, and returns 0 immediately — the process runs independently of the handler.
That is the decision that avoids most problems: a 32-bit program keeps access to files, registry and network, and the user sees exactly what they would see without the suite.
- Keeps the working directory the shell set.
- Preserves every argument, including paths with spaces.
- Does not wait for the process: the handler exits as soon as it launches.
For NE files, the handler writes shell=<executable path> into the [boot] section of WIN.INI inside SYSTEM32\WINBOX, then starts Winbox with C: mounted on the game folder and W: on the Windows 3.1 tree.
Program Manager never appears: by the time Winbox reads WIN.INI, the shell is already the requested program. The same mount serves to install the game, because C: is the host drive.
WINBOX.EXE -exit -c "mount c 'C:\GAMES\SIMCITY'" -c "mount w 'C:\WINDOWS\SYSTEM32\WINBOX'" -c "w:\" -c "win"For DOS, the handler computes a CRC16 over the file contents — reflected polynomial 0xA001, initial value 0xFFFF, the same CRC-16/MODBUS the icons use — and turns it into the game’s identity.
The .conf lives at SYSTEM32\CONF\<name>_<CRC>.conf. If it does not exist it is copied from NTVDBM.CONF; if it does, it is preserved. A shortcut to that .conf is created in the game folder so the options can be edited without touching the executable.
Launching disables stdio redirection (SDL_STDIO_REDIRECT=0) — without it every run would leave stdout.txt and stderr.txt beside the game — and asks NTVDBM to exit when the program ends.
NTVDBM.EXE -conf "C:\WINDOWS\SYSTEM32\CONF\DOOM_4A2F.conf" -exit -c "mount c 'C:\GAMES\DOOM'" -c "c:\" -c "DOOM.EXE" -c "exit"NTVDBM
The DOS engine
NTVDBM is the DOSBox the suite uses for DOS: the same engine, no console, audio rewritten on waveOut and a more conservative dynamic core.
The repository README calls it a highly modified fork of dosbox-ece, DOSBox 0.74-3 and part of DOSBox-X low-end. The goal is explicit: run well on the 1 GHz Pentium M and 256 MB of RAM of a first-generation Apple TV.
Everything that is not Win32 was dropped. The binary links with -mwindows, the console disappears and logging is disabled — two costs a 1993 game does not justify.
What was cut
- MT-32 and FluidSynth emulation.
- Tandy and PCJr.
- Complex shaders and scalers.
- The splash screen.
- Video recording and the codecs it dragged along.
- Support for anything other than Win32.
mixer.cpp was rewritten on top of waveOut: four WAVEHDR buffers in a loop, 16-bit stereo PCM at the configured rate, blocks between 128 and 1024 samples. The mixer opens with WAVE_MAPPER and, on failure, tries every enumerated device before switching to nosound mode.
The README gives the reason: SDL added overhead, and DirectX waveOut leaves CPU headroom for the game.
The OpenGL renderer draws a rectangle with the screen texture instead of DOSBox’s giant triangle. The author describes the change as a way to accommodate old drivers, with the GeForce Go 7300M as the reference.
There are no shaders or scalers: the output is the plain SDL window, and OpenGL is only the blit path.
The dynamic compiler and much of the CPU were rewritten with the DOSBox-X low-end improvements. Cache blocks stay at 16 or 32 KB, and the compiler’s internal cache was reduced to conservative levels — the Pentium M is happy with small chunks, and RAM is scarce.
The build assumes Pentium 2 as the floor (-march=pentium2 -mtune=pentium2, -O1, no LTO), trading peak speed for compatibility.
Deliberate cuts
- Deprecated MT-32 and FluidSynth
Software MIDI synthesis: heavy and rarely used by the games the suite targets.
- Deprecated Tandy and PCJr
Niche graphics and sound modes; removed to save code and RAM.
- Deprecated Shaders and scalers
Image filters the target hardware cannot afford.
- Deprecated Splash screen
The DOSBox splash delayed every game launch.
- Deprecated Audio and video recording
Codecs and buffers that only exist to capture sessions.
- Deprecated Portability
Win32 only: SDL 1.2 is the only backend and the rest of the code is untested.
export CFLAGS="-D_WIN32_WINNT=0x0501 -march=pentium2 -mtune=pentium2 -O1 -pipe \
-fomit-frame-pointer -fno-strict-aliasing -fno-unwind-tables \
-mpreferred-stack-boundary=4 -ffunction-sections -frename-registers -fno-lto"
export LDFLAGS="-static-libgcc -static-libstdc++ -mwindows -Wl,--gc-sections,-s"
./configure --disable-debug --disable-dynrec --disable-sdltest --disable-alsatest --enable-core-inline
make
mv ./src/dosbox.exe ./src/ntvdbm.exe DOS runtime sheet
| Origin | |
|---|---|
| Base | DOSBox 0.74-3 + dosbox-ece + parts of DOSBox-X low-end |
| Binary | ntvdbm.exe (autogen.sh renames src/dosbox.exe) |
| Target | |
| Platform | 32-bit Windows, SDL 1.2.x |
| Hardware | 1 GHz Pentium M, 256 MB (first-generation Apple TV) |
| Audio | |
| Backend | waveOut, 16-bit stereo, 4 buffers, 128–1024 blocks |
| Video | |
| OpenGL | Textured rectangle, no shaders |
| Build | |
| Toolchain | MinGW-w64/MSYS2 with gcc 7; SDL 1.2.15 recommended |
| Dependency | libwinpthread-1.dll (not linked statically) |
Winbox
The 16-bit layer
Winbox is the same DOSBox with a Windows 3.1 inside: it mounts the 3.1 tree as W:, hands over the host C: and lets the 16-bit program run as if it were on its own system.
The handler performs no magic: it writes shell=<program> into WIN.INI and launches Winbox with two mounts. Winbox is what boots Windows 3.1 and lets PROGMAN hand over to the configured shell.
The winbox repository is a separate fork with its own autogen.sh. The difference is not cosmetic: the binary is built with -march=pentium-m -msse2 -O2 -flto, giving the 16-bit code room without leaving the low-end hardware target.
The winbox README defines it as a 16-bit layer for running legacy software on Windows without NTVDM, and notes that without arguments Winbox opens Program Manager — that is how Windows 3.1 is used normally.
| File | Role |
|---|---|
| KRNL386.EXE | Windows 3.1 16-bit kernel |
| USER.EXE / USER1.EXE | Windows, messages and input |
| GDI.EXE | Drawing and fonts |
| PROGMAN.EXE | Program Manager; hands over to the shell= in WIN.INI |
| SHELL.DLL | System dialogs and services |
| VGA.DRV, S3\ | Video drivers, S3 Trio included |
| MINIKBD.DLL, LMOUSE31.DRV, MSMOUS31.DRV | Keyboard and mouse |
| WIN87EM.DLL, WINA20.386, DOSX.EXE | FPU, high memory and extenders |
| CONFIG.SYS, AUTOEXEC.BAT | Inherited DOS environment: FILES=40 and the SB16 driver |
WINBOX.EXE -exit -c "mount c 'C:\GAMES\MYST'" -c "mount w 'C:\WINDOWS\SYSTEM32\WINBOX'" -c "w:\" -c "win" Shortcuts and icons
Without NTVDM there is no PIF, and without a PIF Windows will not create shortcuts to DOS programs. The suite solves it with a context-menu utility that repeats the handler’s logic.
The README states the limitation: any shortcut to a 16-bit executable turns into a PIF, and a PIF depends on NTVDM. Hence sendtotool.c, which builds the .lnk by hand with IShellLink and the same arguments the handler would use.
The shortcut goes to the user’s desktop (CSIDL_DESKTOPDIRECTORY). If one with the same name already exists, the utility appends a suffix — DOOM (2).lnk, DOOM (3).lnk — up to a thousand, so nothing is ever overwritten.
For DOS and Win16 the shortcut points at the runtime, with the mounts already written. For Win32 it points directly at the executable, with no arguments, because the registry handler already takes care of it.
How the icon is chosen
The icon embedded in the executable wins (ExtractIconEx). Then comes a .ico with the same name in the game folder, then the first .ico found in that folder and, as a last resort, the generic icon for the type — default_dos.ico, default_win16.ico or default_win32.ico — copied to GAMEICONS\<name>_<CRC>.ico.
Because the name includes the content CRC16, two users with the same doom.exe arrive at the same icon name. That is what makes a ready-made icon library distributable.
| Order | Source | When it is used |
|---|---|---|
| 1 | Icon embedded in the .exe | Win32 with an icon resource |
| 2 | <name>.ico in the game folder | A .ico named after the executable exists |
| 3 | First .ico in the folder | The folder has icons, but none with the right name |
| 4 | default_dos / win16 / win32.ico | None of the above: the generic icon is copied with the CRC16 |
Installation
Installation is a copy into SYSTEM32 plus merging one .reg. There is no installer: what exists is the tree, ready for a 32-bit XP.
- Copy hdl.exe, NTVDBM.EXE, WINBOX.EXE and libwinpthread-1.dll into C:\WINDOWS\SYSTEM32.
- Copy NTVDBM.CONF into SYSTEM32: it is the template for every per-game .conf.
- Copy the Windows 3.1 tree (src/winbox in the winbox repository) into C:\WINDOWS\SYSTEM32\WINBOX.
- Copy GAMEICONS into SYSTEM32 to keep the collected icons and the three generic ones.
- Merge Install.reg by double-clicking it: the handler starts answering .exe and .com.
- Open a DOS game: the handler creates the .conf, the shortcut, and launches NTVDBM.
- To switch everything off, merge disable handler.reg; the keys go back to "%1" %*.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\exefile\shell\open\command]
@="\"%1\" %*"
[HKEY_CLASSES_ROOT\comfile\shell\open\command]
@="\"%1\" %*" Do I need a full Windows 3.1?
For DOS, no. For 16-bit programs, yes: Winbox mounts W: from SYSTEM32\WINBOX, and that tree must hold a working 3.1. The winbox repository ships a copy in src/winbox.
Why do enable and disable handler.reg exist?
They are a global switch. The README notes that some programs do not behave with the handler in the middle; switching off is faster than uninstalling, and the handler comes back with another merge.
And if the icon does not match?
The icon name includes the executable’s CRC16: different versions of the same game produce different hashes. Find the generic <name>_<CRC>.ico and copy the desired icon over it. The handler will not regenerate it.
Why are there two SendToTool files?
src/SendToTool.c and src/sendtotool.c differ only in case. On a case-insensitive filesystem only one is checked out; on a case-sensitive one both appear. Confirm which one is being compiled before editing either.
Compatibility and limits
The suite is not a new emulator: it is a way to reach DOSBox and Windows 3.1 without going through NTVDM. Compatibility is therefore DOSBox’s — within the limits of a 2005-era build.
| Executable | Detection | Runs on | Arguments |
|---|---|---|---|
| .com | None: the extension is enough | NTVDBM | Rebuilt from the path |
| .exe DOS (MZ) | MZ without PE or NE | NTVDBM | Rebuilt, with a per-game .conf |
| .exe Windows 3.x (NE) | NE signature | WINBOX | C: and W: mounts, shell in WIN.INI |
| .exe Windows 32-bit (PE) | PE signature | Windows kernel | Original command line, complete |
The author reports that every game tested, released between 1987 and 1999, ran without problems through the handler, and believes compatibility is complete for anything DOSBox can run. That is a statement about the handler, not about DOSBox: a game DOSBox cannot run still cannot run.
For 16-bit programs, compatibility is that of whichever Windows 3.1 sits on W:, plus Winbox itself. FMV games depend on WinG, Video for Windows and QuickTime installed in that tree.
- Win32 only: there is no x64 or ARM build, and the target is XP on old hardware.
- SDL 1.2 only: there is no modern backend, and the README recommends rebuilding SDL 1.2.15 without console redirection.
- Windows 3.1 is separate: the suite does not ship it, and Winbox depends on an already installed tree.
- State in SYSTEM32: .conf files, WIN.INI and icons live in the system folder; accounts without write access there cannot use the handler.
- HDL_DEBUG.LOG grows on every run; nothing rotates it.
- Paths are absolute (C:\WINDOWS\SYSTEM32): installs on another drive letter or folder require editing the code and the .reg files.
Timeline
The history is short and readable: three repositories, one author, and commit messages that say the essentials.
From the first commit to 1.0
- 2026-05-16 First commits
The suite and winbox appear on GitHub on the same day; ntvdbm is prepared as a separate engine.
- 2026-06-08 Restructuring
ntvdbm reorganises src/ and autogen.sh, fixing the Pentium 2 target and the compiler flags.
- 2026-06-30 Suite 1.0
Handler, shortcuts, icons and .reg files close the first complete version of the set.
- 2026-07-02 Final ntvdbm fixes
The "OGL performance fix" and an FPU fix are the last commits of the DOS engine.
- 2026-11-01 Winbox update
The 16-bit layer receives the most recent change in the whole suite.
The suite’s documentation lives in three READMEs, each with its own audience: the suite one explains installation and use, the ntvdbm one explains the build and the optimisations, the winbox one explains the 16-bit layer. This project brings the three together into a single narrative.
Repositories
The suite is an assembly repository: the handler and assets at the top, the two engines as submodules.
| Repository | Contents | Last commit |
|---|---|---|
| NTVDBM-Suite | hdl.c, sendtotool.c, .reg files, system32/, Winbox/*.ini | 2026-06-30 |
| ntvdbm | DOSBox fork: src/, SDL-1.2/, scripts/, docs/ | 2026-07-02 |
| winbox | DOSBox fork with src/winbox/ (Windows 3.1) | 2026-11-01 |
Open on GitHub
Authorship
- Ricardo Ramos Author and maintainer ↗
The suite is GPL-2.0, like the DOSBox it derives from. The Windows 3.1 Winbox mounts is not: it is Microsoft software, and the suite README is explicit that it cannot be distributed.