Skip to content
Snippets Groups Projects
Commit 8c02b477 authored by rswindell's avatar rswindell
Browse files

Work-arounds for Windows Vista:

If the sbbsexec.dll (VDD) load from the exec dir fails, load without a path
specified (e.g .from \windows\System32\).
Do not specify an init function, apparently not supported by Vista -
RegisterModule() fails with AX=1 when an InitFunc is specified.
parent db8b5a23
No related branches found
No related tags found
No related merge requests found
...@@ -46,6 +46,8 @@ ...@@ -46,6 +46,8 @@
#include "isvbop.h" /* ddk\inc */ #include "isvbop.h" /* ddk\inc */
#include "fossdefs.h" #include "fossdefs.h"
#define VDD_FILENAME "sbbsexec.dll"
/****************************************************************************/ /****************************************************************************/
/* Truncates white-space chars off end of 'str' and terminates at first tab */ /* Truncates white-space chars off end of 'str' and terminates at first tab */
/****************************************************************************/ /****************************************************************************/
...@@ -459,7 +461,7 @@ char* getfname(const char* path) ...@@ -459,7 +461,7 @@ char* getfname(const char* path)
return((char*)fname); return((char*)fname);
} }
char * DllName ="SBBSEXEC.DLL"; char * DllName =VDD_FILENAME;
char * InitFunc ="VDDInitialize"; char * InitFunc ="VDDInitialize";
char * DispFunc ="VDDDispatch"; char * DispFunc ="VDDDispatch";
...@@ -493,7 +495,7 @@ int main(int argc, char **argv) ...@@ -493,7 +495,7 @@ int main(int argc, char **argv)
sprintf(exec_dir,"%.*s",sizeof(exec_dir)-1,argv[0]); sprintf(exec_dir,"%.*s",sizeof(exec_dir)-1,argv[0]);
p=getfname(exec_dir); p=getfname(exec_dir);
*p=0; *p=0;
sprintf(dll,"%ssbbsexec.dll",exec_dir); sprintf(dll,"%s%s",exec_dir,VDD_FILENAME);
DllName=dll; DllName=dll;
if(argc>2 && !strcmp(argv[2],"NT")) if(argc>2 && !strcmp(argv[2],"NT"))
...@@ -545,22 +547,33 @@ int main(int argc, char **argv) ...@@ -545,22 +547,33 @@ int main(int argc, char **argv)
if(NT) { /* Windows NT/2000 */ if(NT) { /* Windows NT/2000 */
/* Register VDD */ for(i=0;i<2;i++) {
_asm {
push es /* Register VDD */
push ds _asm {
pop es push es
mov si, DllName ; ds:si = dll name push ds
mov di, InitFunc ; es:di = init routine pop es
mov bx, DispFunc ; ds:bx = dispatch routine mov si, DllName ; ds:si = dll name
}; mov di, InitFunc ; es:di = init routine
RegisterModule(); mov bx, DispFunc ; ds:bx = dispatch routine
_asm { #if 1 /* Vista work-around, apparently doesn't support an InitFunc (RegisterModule fails with AX=1) */
mov vdd, ax xor di,di
jc err mov es,di
mov success, TRUE #endif
err:
pop es };
RegisterModule();
_asm {
mov vdd, ax
jc err
mov success, TRUE
err:
pop es
}
if(success)
break;
DllName=VDD_FILENAME; /* try again with no path (for Windows Vista) */
} }
if(!success) { if(!success) {
fprintf(stderr,"Error %d loading %s\n",vdd,DllName); fprintf(stderr,"Error %d loading %s\n",vdd,DllName);
...@@ -655,5 +668,6 @@ int main(int argc, char **argv) ...@@ -655,5 +668,6 @@ int main(int argc, char **argv)
UnRegisterModule(); UnRegisterModule();
} }
return(i); return(i);
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment