← Back to index software-legado · meu-software

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
Dark background with a CRT monitor running an NTVDBM command and, on the right, the handler routing PE to the kernel, NE to WINBOX and MZ to NTVDBM.
NTVDBM Suite · software-legado / meu-software
01

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
02

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.

03

Architecture

Four executables, three registry keys and two state folders: that is the suite’s inventory once copied into a 32-bit XP SYSTEM32.

What each piece does and where it lives.
Path in SYSTEM32Role
hdl.exeCalled by the shell for every .exe and .com; picks the engine.
NTVDBM.EXEDOS runtime (DOSBox fork).
WINBOX.EXE16-bit runtime (DOSBox + Windows 3.1).
NTVDBM.CONFTemplate 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.dllDependency shared by both runtimes (MinGW).
Windows shell Explorer / double click HKCR\exefile|comfile\shell\open\command Handler (hdl.exe) Reads MZ and the 0x3C offset Classifies PE, NE or DOS CRC16 of the contents Copies NTVDBM.CONF Creates a shortcut to the .conf Engines ntvdbm.exe (DOS) winbox.exe (Windows 3.1) kernel32 (Win32, no emulation) State on disk SYSTEM32\CONF\<name>_<CRC>.conf SYSTEM32\WINBOX\WIN.INI SYSTEM32\GAMEICONS\<name>_<CRC>.ico
From the double click to the engine: the handler sits between the shell and both runtimes.
Flow diagram: Explorer calls hdl.exe, which classifies the executable and routes it to kernel32, WINBOX.EXE or NTVDBM.EXE.
The path of an executable: signature, decision and engine.
Install.reg ini
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\" %*"
The two keys that put the handler in the path of every executable.
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.

04

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.

05

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.

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.

autogen.sh sh
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
The flags that define the target: Pentium 2, no LTO, no console.

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)
06

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.

The tree Winbox mounts as W: (src/winbox in the winbox repository).
FileRole
KRNL386.EXEWindows 3.1 16-bit kernel
USER.EXE / USER1.EXEWindows, messages and input
GDI.EXEDrawing and fonts
PROGMAN.EXEProgram Manager; hands over to the shell= in WIN.INI
SHELL.DLLSystem dialogs and services
VGA.DRV, S3\Video drivers, S3 Trio included
MINIKBD.DLL, LMOUSE31.DRV, MSMOUS31.DRVKeyboard and mouse
WIN87EM.DLL, WINA20.386, DOSX.EXEFPU, high memory and extenders
CONFIG.SYS, AUTOEXEC.BATInherited DOS environment: FILES=40 and the SB16 driver
c c
WINBOX.EXE -exit -c "mount c 'C:\GAMES\MYST'" -c "mount w 'C:\WINDOWS\SYSTEM32\WINBOX'" -c "w:\" -c "win"
Winbox receives the game as C: and Windows 3.1 as W:.
07

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.

Icon grid with names in the name_CRC16.ico format, including the three generic system icons.
Icons addressed by name and CRC16: the same executable always produces the same file.
Icon resolution order for a shortcut created by SendToTool.
OrderSourceWhen it is used
1Icon embedded in the .exeWin32 with an icon resource
2<name>.ico in the game folderA .ico named after the executable exists
3First .ico in the folderThe folder has icons, but none with the right name
4default_dos / win16 / win32.icoNone of the above: the generic icon is copied with the CRC16
08

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.

  1. Copy hdl.exe, NTVDBM.EXE, WINBOX.EXE and libwinpthread-1.dll into C:\WINDOWS\SYSTEM32.
  2. Copy NTVDBM.CONF into SYSTEM32: it is the template for every per-game .conf.
  3. Copy the Windows 3.1 tree (src/winbox in the winbox repository) into C:\WINDOWS\SYSTEM32\WINBOX.
  4. Copy GAMEICONS into SYSTEM32 to keep the collected icons and the three generic ones.
  5. Merge Install.reg by double-clicking it: the handler starts answering .exe and .com.
  6. Open a DOS game: the handler creates the .conf, the shortcut, and launches NTVDBM.
  7. To switch everything off, merge disable handler.reg; the keys go back to "%1" %*.
disable handler.reg ini
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\exefile\shell\open\command]
@="\"%1\" %*"

[HKEY_CLASSES_ROOT\comfile\shell\open\command]
@="\"%1\" %*"
disable handler.reg gives the shell back its default behaviour.
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.

09

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.

The four cases the handler distinguishes, and what each one receives.
ExecutableDetectionRuns onArguments
.comNone: the extension is enoughNTVDBMRebuilt from the path
.exe DOS (MZ)MZ without PE or NENTVDBMRebuilt, with a per-game .conf
.exe Windows 3.x (NE)NE signatureWINBOXC: and W: mounts, shell in WIN.INI
.exe Windows 32-bit (PE)PE signatureWindows kernelOriginal 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.
10

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

  1. 2026-05-16
    First commits

    The suite and winbox appear on GitHub on the same day; ntvdbm is prepared as a separate engine.

  2. 2026-06-08
    Restructuring

    ntvdbm reorganises src/ and autogen.sh, fixing the Pentium 2 target and the compiler flags.

  3. 2026-06-30
    Suite 1.0

    Handler, shortcuts, icons and .reg files close the first complete version of the set.

  4. 2026-07-02
    Final ntvdbm fixes

    The "OGL performance fix" and an FPU fix are the last commits of the DOS engine.

  5. 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.

11

Repositories

The suite is an assembly repository: the handler and assets at the top, the two engines as submodules.

The three repositories and what each one holds.
RepositoryContentsLast commit
NTVDBM-Suitehdl.c, sendtotool.c, .reg files, system32/, Winbox/*.ini2026-06-30
ntvdbmDOSBox fork: src/, SDL-1.2/, scripts/, docs/2026-07-02
winboxDOSBox fork with src/winbox/ (Windows 3.1)2026-11-01

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.