🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Pointer Stew...

#7903
From: Nathan T. Wild
Date: Tue, 06 Feb 1996 03:33
53 lines
2498 bytes
I am implimenting a system, but which executable code modules are loaded
from disk files into allocated blocks.

This is working very well.  I allocated a big enough block, load the
"driver" in and aim a function pointer ar it.  

What I would like to do is have the code that I load in contain near
pointers to it's own groups of functions.  I have placed a header on the
driver module I wish to load that contains the offset from the current
segment for two functions contained within the driver block.

This time I want to calculate the segment and read in the offset and set
both function pointers accordingly.

I am having difficulty dereferencing things???



Say, for example that my code block is allocated at XXXX:0004.  The first 2
bytes are the pointer (within the block) to the first function and the next
2 bytes are the pointer to the second function.

I want to set my function pointer to the segment XXXX and the offset stored
at XXXX:0004 & 0005.  No matter how I reference this, I get my function
pointing to XXXX:0004!


I have tried (where driverPtr == XXXX:0004 and is a void far *):
	func1ptr = (void far **)driverPtr
	func2ptr = (void far **)(driverPtr+2)
	
But I get XXXX:0004 every time?  I can set the function pointers to what I
want if I use MK_FP(), FP_SEG() and peek(), but there has got to be a
better way than this?




In short, how, given the address of a stored pointer, set a function to
point to the address stored, no to the location it is stored in???

This is driving me nuts as I am sure it is fairly simple...

Please respond via Email, I cannot access this group "live"...

Thanks in advance...

|--------------------------------------------------------------------|
| ooooO (``)   (``) Ooooo | Nathan T. Wild                           | 
| (   ) )  (   )  ( (   ) | natewild@mbnet.mb.ca                     |
| )  (  (   ) (   ) )  (  | ftp://ftp.mbnet.mb.ca/pub/natewild       |
| (__)  ooooO Ooooo (__)  | http://www.mbnet.mb.ca/~natewild         |
|--------------------------------------------------------------------|
Technical Details
Message-ID: <svsFxc9nXUNB083yn@mbnet.mb.ca>
Path: arc1-ca.pugleaf.net!canopus.cc.umanitoba.ca!natewild

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!canopus.cc.umanitoba.ca!natewild
From: natewild@mbnet.mb.ca (Nathan T. Wild)
Newsgroups: comp.os.msdos.programmer,comp.lang.c
Subject: Pointer Stew...
Date: Mon, 05 Feb 1996 22:33:00 -0500
Organization: WankerNET - Digital TimeWasters Inc.
Message-ID: <svsFxc9nXUNB083yn@mbnet.mb.ca>
NNTP-Posting-Host: access.mbnet.mb.ca
Originator: natewild@access.mbnet.mb.ca