X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Cesar Rabak 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: References: <002f1dec-45b2-4304-96fe-8c44371cc026 AT d45g2000hsc DOT googlegroups DOT com> NNTP-Posting-Host: AA51DbWPgc0wqw52Z/DRVw.user.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 #include 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