Commit 6b5de04a authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

Add support for NTVDMx64

Yes, you can run 16-bit DOS doors on 64-bit (x64) Windows now.

Install NTVDMx64 (http://www.columbia.edu/~em36/ntvdmx64.html, it's not as onerous as it sounds) and re-enable DOS program support in SBBS (i.e. make sure "NO_DOS" is not in your sbbs.ini [bbs] Options value) and voila: DOS doors work.

This change adds an empty init routine to sbbsexec.dll since older versions of NTVDM (which NTVDMx64 is based on) required one. Also, the sbbsexec.dll should be located in your Synchronet "exec" directory when using NTVDMx64 (in addition to or instead of your Windows/System32 directory).
parent cae1b604
Pipeline #2493 passed with stage
in 15 minutes and 22 seconds
......@@ -509,6 +509,7 @@ int main(int argc, char **argv)
int i,c,d,envnum=0;
FILE* fp;
BOOL NT=FALSE;
BOOL x64=FALSE;
BOOL success=FALSE;
WORD buf_seg;
WORD w;
......@@ -519,7 +520,7 @@ int main(int argc, char **argv)
,"%s - Copyright %s Rob Swindell\n"
,id_string, __DATE__+7);
fprintf(stderr
,"usage: dosxtrn <path/dosxtrn.env> [NT|95] [node_num] [mode]\n");
,"usage: dosxtrn <path/dosxtrn.env> [NT|95|x64] [node_num] [mode]\n");
return(1);
}
......@@ -529,8 +530,12 @@ int main(int argc, char **argv)
sprintf(dll,"%s%s",exec_dir,VDD_FILENAME);
DllName=dll;
if(argc>2 && !strcmp(argv[2],"NT"))
if(argc>2) {
if(strcmp(argv[2],"NT") == 0)
NT=TRUE;
else if(strcmp(argv[2],"x64") == 0)
NT=TRUE, x64=TRUE;
}
if(argc>3)
node_num=atoi(argv[3]);
if(argc>4)
......@@ -588,12 +593,13 @@ int main(int argc, char **argv)
mov si, DllName ; ds:si = dll name
mov di, InitFunc ; es:di = init routine
mov bx, DispFunc ; ds:bx = dispatch routine
#if 1 /* Vista work-around, apparently doesn't support an InitFunc (RegisterModule fails with AX=1) */
};
if(!x64) { // NTVDMx64 (based on an older Windows NTVDM) requires an init routine
_asm { /* Vista work-around, apparently doesn't support an InitFunc (RegisterModule fails with AX=1) */
xor di,di
mov es,di
#endif
};
}
RegisterModule();
_asm {
mov vdd, ax
......
......@@ -674,10 +674,11 @@ __declspec(dllexport) void __cdecl VDDDispatch(void)
status->outbuf_full=0;
status->outbuf_size=DEFAULT_MAX_MSG_SIZE;
} else
lprintf(LOG_DEBUG,"VDD_STATUS: MailSlot maxmsgsize=%u, nextmsgsize=%u, msgs=%u"
lprintf(LOG_DEBUG,"VDD_STATUS: MailSlot output: maxmsgsize=%u, nextmsgsize=%d, msgs=%u, input: %u"
,status->outbuf_size
,status->outbuf_full
,msgs);
,msgs
,status->inbuf_full);
if(status->outbuf_full==MAILSLOT_NO_MESSAGE)
status->outbuf_full=0;
status->outbuf_full*=msgs;
......@@ -803,3 +804,9 @@ __declspec(dllexport) void __cdecl VDDDispatch(void)
}
setAX((WORD)retval);
}
__declspec(dllexport) BOOL __cdecl VDDInitialize(IN PVOID hVDD, IN ULONG Reason,
IN PCONTEXT Context OPTIONAL)
{
return TRUE;
}
......@@ -487,8 +487,10 @@ int sbbs_t::external(const char* cmdline, long mode, const char* startup_dir)
if(mode&EX_STDOUT)
i|=SBBSEXEC_MODE_DOS_OUT;
}
sprintf(str," NT %u %u"
,cfg.node_num,i);
BOOL x64 = FALSE;
IsWow64Process(GetCurrentProcess(), &x64);
sprintf(str," %s %u %u"
,x64 ? "x64" : "NT", cfg.node_num,i);
strcat(fullcmdline,str);
sprintf(str,"sbbsexec_hungup%d",cfg.node_num);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment