delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2008/07/24/08:00:45

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Cesar Rabak <csrabak AT yahoo DOT com DOT br>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: calling a RM function which is placed below 1 MB
Date: Thu, 24 Jul 2008 08:58:22 -0300
Organization: Aioe.org NNTP Server
Lines: 44
Message-ID: <g69qgh$d9v$1@aioe.org>
References: <ca0df607-1be3-4358-b84f-f0ccddde3197 AT d77g2000hsb DOT googlegroups DOT com> <g67uat$di0$1 AT aioe DOT org> <f78b8a9f-b3ff-4ab6-b95b-151c822873f7 AT b1g2000hsg DOT googlegroups DOT com> <002f1dec-45b2-4304-96fe-8c44371cc026 AT d45g2000hsc DOT googlegroups DOT com>
NNTP-Posting-Host: AA51DbWPgc0wqw52Z/DRVw.user.aioe.org
Mime-Version: 1.0
X-Complaints-To: abuse AT aioe DOT org
In-Reply-To:
User-Agent: Thunderbird 2.0.0.16 (Windows/20080708)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Eph escreveu:
[snipped]

> The Stack configuration is ok? I'm not sure about the struct and the
> order I must place the params. But the comments say how it should be.
> param1 must be at bp[14] and must be a DWORD PTR.
> param2 must be at bp[10] and must be a DWORD PTR.
> param3 must be at bp[06] and must be a DWORD PTR.
> 
> param1 - 3 are allocated like this:
> 
> typedef struct MEM_INFO {
> 	void *data;
> 	int selector;
> 	int segment;
> 	unsigned long base;
> 	int size;
> };
> 
To ascertain it for yourself, compile and run the following snippet:

#include <stdio.h>
#include <stddef.h>

typedef struct MEM_INFO {
	void *data;
	int selector;
	int segment;
	unsigned long base;
	int size;
};

int
main(void)
{
     printf("Offset of data: %u\nselector: %u\nsegment: %u\nbase: 
%u\nsize: %u\n", offsetof(struct MEM_INFO,data), offsetof(struct 
MEM_INFO,selector), offsetof(struct MEM_INFO,segment), offsetof(struct 
MEM_INFO,base), offsetof(struct MEM_INFO,size));

     return 0;
}

HTH

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019