c_dll_harness - proof harness for C_DLL_integration.md
=========================================================

cdlltest.c / .def   stdcall C DLL with one export per data passing case (30 exports)
cdlltest.dll        prebuilt x86 copy (CRT-free build, see C_DLL_integration.md section 1)
build.bat           normal rebuild: finds Visual Studio with vswhere, cl /MT /LD, x86
modDllTest.bas      VB6 console harness (Sub Main) - every output line is one measured fact
dlltest.vbp         project; [VBCompiler] LinkSwitches=/SUBSYSTEM:CONSOLE so it prints to stdout
run_all.ps1         compiles the harness with ..\tools\vbmake.ps1, runs all modes,
                    writes expected_output.txt

Run (elevated PowerShell if VB6.EXE needs elevation on this box):

    powershell -ExecutionPolicy Bypass -File run_all.ps1

Modes:
    dlltest.exe          numbers, BOOL vs Boolean, C bool vs Boolean, Currency as int64, LastDllError,
                         Declare string conversion, StrPtr / VarPtr / ownership,
                         Variants, arrays (pointer, SAFEARRAY, returned Byte(), fixed vs
                         dynamic, string arrays), AddressOf callback, UDT packing,
                         error 453 and 53
    dlltest.exe leaks    200,000 calls per technique, private bytes growth, with a
                         deliberately leaking control (LeakOne)
    dlltest.exe cdecl    what a compiled exe does with a __cdecl export
    dlltest.exe crash    access violation inside the DLL (measured: process dies at the
                         call, On Error never fires, exit code is still 0)

STATUS: verified 2026-12-02 (Windows 10, elevated shell). expected_output.txt is the
recorded run; ..\C_DLL_integration.md quotes it in its "(measured)" notes.

Note for the crash mode: the process dies at the call and still returns exit code 0. That is why the
main and leaks modes end with a DONE line - check for it instead of the exit code.

The harness writes nothing outside this folder.
