I have a user defined type called struct _tservice which is type defined as a TService type.
<code> typedef struct _tservice TService;
struct _tservice{
int id; //The service ID.
int fkey; //The invoice ID.
char *description; //A description.
char *date; //The date of service.
char *starttime; //The start time.
char *endtime; //The end time.
int reserved; //A reserved variable.
float amount; //The cost.
};
</code>
<code> typedef struct _tservice TService;
struct _tservice{
int id; //The service ID.
int fkey; //The invoice ID.
char *description; //A description.
char *date; //The date of service.
char *starttime; //The start time.
char *endtime; //The end time.
int reserved; //A reserved variable.
float amount; //The cost.
};
</code>
typedef struct _tservice TService;
struct _tservice{
int id; //The service ID.
int fkey; //The invoice ID.
char *description; //A description.
char *date; //The date of service.
char *starttime; //The start time.
char *endtime; //The end time.
int reserved; //A reserved variable.
float amount; //The cost.
};
When I build a dynamic linked library or DLL file using an object of the structure, the ‘reserved’ member gets referenced as [edx+10h]. When I build a test program using an object of the structure, the ‘reserved’ member gets referenced as [edx+18h]. The DLL offset is wrong, but the test program offset is correct.