🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #252

Trouble using INT's from Windows-program

#252
From: Indridi Bjornsson
Date: Thu, 09 Apr 1992 12:25
61 lines
2395 bytes
       Greatings fellow netters :)

   A friend of mine is writing some kind of communication
program in windows. The driver is called TES and is 
located at INT 14. The services TES provides are A0 through A8.
He is using Borland C++ 3.0. 

   Most of the services work, just by using int86x() inside
the program, but when he tries to send a string, TES doesn't
seem to get the right one, just some garbage. 

   The string is supposed to be pointed by DS:SI. I.e. to do a
connect:

-------------------------------------------------------------
   AH = A3h Connect a New Session with <NAME>

Call with:
   DS:SI points to a (null-terminated) string within the user 
   data space, naming a known server.

Returns with:
   AH = 0 if successful, and AL = session number activated, or
   AH = FF if unsuccessful, and AL = error code.
-------------------------------------------------------------
   
   So he though of doing something like:

void connect()
{
   union REGS regs;
   struct SREGS sregs;
   static char *Name = "Server";

   regs.x.ax = 0xA300;
   regs.x.dx = 0x00;
   regs.x.si = FP_OFF( Name );
   sregs.ds = FP_SEG( Name );

   int86x( INT, &regs, &regs, &sregs );
}


   But this doesn't seem to work, TES always get send some 
garbaged string. That is if an UAE doesn't creep up at his
display.


   So what is the catch here? It doesn't seem to matter wether 
he declares all segments FIXED or not?

Thanks,
Indridi.

----------------------------------------------------------------------------
Indridi Bjornsson       | No rights reserved. All part of this publication  |
Taeknigardur, Dunhaga 5 | may be reproduced, in any form or by any means,   |
107 Reykjavik           | except intended or intensive sexual harassment    |
ICELAND                 | against elderly animals and children.             |
----------------------------------------------------------------------------
Technical Details
Message-ID: <4764@krafla.rhi.hi.is>
Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!wupost!micro-heart-of-gold.mit.edu!bloom-beacon!eru.mt.luth.se!lunic!sunic!isgate!krafla!indridi

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!wupost!micro-heart-of-gold.mit.edu!bloom-beacon!eru.mt.luth.se!lunic!sunic!isgate!krafla!indridi
From: indridi@rhi.hi.is (Indridi Bjornsson)
Newsgroups: comp.windows.ms.programmer
Subject: Trouble using INT's from Windows-program
Message-ID: <4764@krafla.rhi.hi.is>
Date: 9 Apr 92 12:25:31 GMT
Reply-To: indridi@krafla (Indridi Bjornsson)
Organization: University of Iceland (RHI)
Lines: 61