🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #7476

Problem in TopSpeed DOS Extender

#7476
From: Alex Yakovlev
Date: Wed, 06 Jan 1993 11:47
47 lines
1941 bytes
 Dear colleagues, we have the TopSpeed C/C++ System Ver 3.02
 with TopSpeed DOS Extender - legal copy, don't worry. I use
 dynamic link libraries (DLL), created by TopSpeed in extended
 memory model (by the way, i've had to correct the system file
 TSPRJ.TXT before i could create DLL's in this model - it's
 obvious JPI's mistake!). When i attempted to use *MANUAL*
 loading/unloading DLL's, i met serious problem. I've reduced
 my program to the following pair of texts:

 My main text looks like as:

   #include <stdio.h>
   #include <conio.h>
   #include <tsxlib.h>
   typedef unsigned (* Function) (void);
   static Function func;
   static unsigned handle, res;
   void main (void)
   {
     while (getch() != 033)
     {
       handle = LOADMODULE("Drv");
       func = (Function) GETPROCADDR("_Proc", handle);
       res += func();
       UNLOADMODULE(handle);
       printf("%d\n", res);
     }
   }

 And DLL-text, named "Drv.c", is very simple:

   unsigned Proc(void) {return 1;}

 The main program results in General Protection Fault on the
 15'th pass through the loop. I think, it is connected with an
 incorrect behaviour of UNLOADMODULE. May be, it is necessary
 to pass some other parameter, not a handle, into this
 function?

 I'm sure, there are experienced people, who use TopSpeed DOS
 Extender's DLL's in such a way. Help me, please!
 --
 Alex Yakovlev
 Computing Center of Russian Academy of Sciences
 Moscow, Russia
 Internet: yak@sms.ccas.msk.su
Technical Details
Message-ID: <Pn6RiIh4OX@sms.ccas.msk.su>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!fuug!kiae!demos!newsserv

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!fuug!kiae!demos!newsserv
From: Alex Yakovlev <yak@sms.ccas.msk.su>
Newsgroups: comp.os.msdos.programmer
Subject: Problem in TopSpeed DOS Extender
Date: Wed, 06 Jan 93 14:47:18 +0300
Distribution: world
Organization: Computing Center of Russian Academy of Sciences
Message-ID: <Pn6RiIh4OX@sms.ccas.msk.su>
Sender: news-service@newcom.kiae.su
Reply-To: yak@sms.ccas.msk.su
Lines: 48