Mail Archives: djgpp/2008/07/24/08:00:45
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 -