Commits (3)
......@@ -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"))
NT=TRUE;
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) */
xor di,di
mov es,di
#endif
};
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
};
}
RegisterModule();
_asm {
mov vdd, ax
......
REM Build SBBSEXEC.DLL (Synchronet Virtual UART/FOSSIL Device Driver)
cl /Di386 /Gz /O2 ntvdm.lib netapi32.lib /DRINGBUF_SEM /DRINGBUF_MUTEX /DNO_SOCKET_SUPPORT /I../xpdev /LD sbbsexec.c ringbuf.c ../xpdev/ini_file.c ../xpdev/dirwrap.c ../xpdev/str_list.c ../xpdev/xpdatetime.c ../xpdev/genwrap.c ../xpdev/semwrap.c ../xpdev/datewrap.c ../xpdev/xpprintf.c ../xpdev/threadwrap.c
/* ringbuf.h */
/* Synchronet ring buffer routines */
/* $Id: ringbuf.h,v 1.14 2018/07/24 01:11:07 rswindell Exp $ */
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
......@@ -61,12 +57,6 @@
#define RINGBUF_USE_STD_RTL
#if defined(_WIN32) && !defined(__GNUC__)
#define RINGBUFCALL _cdecl
#else
#define RINGBUFCALL
#endif
/************/
/* Typedefs */
/************/
......@@ -100,23 +90,23 @@ extern "C" {
/* Function Prototypes */
/***********************/
int RINGBUFCALL RingBufInit( RingBuf* rb, DWORD size
int RingBufInit( RingBuf* rb, DWORD size
#ifndef RINGBUF_USE_STD_RTL
,void *(os_malloc)(size_t)
,void (os_free)(void *)
,void *(os_memcpy)(void *, const void *, size_t)
#endif
);
void RINGBUFCALL RingBufDispose( RingBuf* rb );
DWORD RINGBUFCALL RingBufFull( RingBuf* rb );
DWORD RINGBUFCALL RingBufFree( RingBuf* rb );
DWORD RINGBUFCALL RingBufWrite( RingBuf* rb, const BYTE *src, DWORD cnt );
DWORD RINGBUFCALL RingBufRead( RingBuf* rb, BYTE *dst, DWORD cnt );
DWORD RINGBUFCALL RingBufPeek( RingBuf* rb, BYTE *dst, DWORD cnt );
void RINGBUFCALL RingBufReInit( RingBuf* rb );
void RingBufDispose( RingBuf* rb );
DWORD RingBufFull( RingBuf* rb );
DWORD RingBufFree( RingBuf* rb );
DWORD RingBufWrite( RingBuf* rb, const BYTE *src, DWORD cnt );
DWORD RingBufRead( RingBuf* rb, BYTE *dst, DWORD cnt );
DWORD RingBufPeek( RingBuf* rb, BYTE *dst, DWORD cnt );
void RingBufReInit( RingBuf* rb );
#ifdef __cplusplus
}
#endif
#endif /* Don't add anything afterthis endif */
#endif /* Don't add anything after this line */
......@@ -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);
......