Thread View: comp.windows.ms.programmer
5 messages
5 total messages
Started by Indridi Bjornsson
Thu, 09 Apr 1992 12:25
Trouble using INT's from Windows-program
Author: Indridi Bjornsson
Date: Thu, 09 Apr 1992 12:25
Date: Thu, 09 Apr 1992 12:25
61 lines
2395 bytes
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, ®s, ®s, &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. |
----------------------------------------------------------------------------
Re: Trouble using INT's from Windows-program
Author: Steven Arthur Nelson
Date: Fri, 10 Apr 1992 01:24
Date: Fri, 10 Apr 1992 01:24
18 lines
1068 bytes
1068 bytes
> 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: Tell your friend to try using DPMI service 0x300 to simulate a real mode interrupt. All memory addresses passed between real and protected modes should be allocated using GlobalDosAlloc. Steven Nelson
Re: Trouble using INT's from Windows-program
Author: Richard Hancock
Date: Tue, 14 Apr 1992 16:27
Date: Tue, 14 Apr 1992 16:27
8 lines
903 bytes
903 bytes
/ hpopd:comp.windows.ms.programmer / san@cup.portal.com (Steven Arthur Nelson) / 2:24 am Apr 10, 1992 / >Tell your friend to try using DPMI service 0x300 to simulate a >real mode interrupt. All memory addresses passed between real >and protected modes should be allocated using GlobalDosAlloc. Isn't it sufficient to use GlobalDosAlloc? Surely Windows will reflect the interrupt to real mode (via DPMI)?
Re: Trouble using INT's from Windows-program
Author: Richard Hancock
Date: Wed, 15 Apr 1992 10:20
Date: Wed, 15 Apr 1992 10:20
12 lines
1050 bytes
1050 bytes
/ hpopd:comp.windows.ms.programmer / richardh@hpopd.pwd.hp.com (Richard Hancock) / 5:27 pm Apr 14, 1992 / / hpopd:comp.windows.ms.programmer / san@cup.portal.com (Steven Arthur Nelson) / 2:24 am Apr 10, 1992 / >>Tell your friend to try using DPMI service 0x300 to simulate a >>real mode interrupt. All memory addresses passed between real >>and protected modes should be allocated using GlobalDosAlloc. > >Isn't it sufficient to use GlobalDosAlloc? Surely Windows will >reflect the interrupt to real mode (via DPMI)? Please ignore my stupidity - I'd forgotten the additional complication of needing to pass a segment address in DS.
Re: Trouble using INT's from Windows-program
Author: Jim Beveridge
Date: Wed, 15 Apr 1992 19:29
Date: Wed, 15 Apr 1992 19:29
26 lines
1370 bytes
1370 bytes
In article <4764@krafla.rhi.hi.is>, indridi@rhi.hi.is (Indridi Bjornsson) writes: > 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 problem is that the string is stored in extended memory, which a real mode program (which int86x calls) is unable to look at. You have to have this string copied to an area of memory that is located below 640k. Windows does this automatically for you for interrupts that it understands. Obviously, it doesn't understand this interrupt. There are functions in the SDK for getting and using memory below 640k, I just don't remember them off the top of my head. Hope this helps. Jim
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads