>Maybe a stupid question but still....
>Thanks for your time guys !
An LPSTR is 4 bytes long - it's a 32 bit pointer. The string it points to is of variable size; it's read from the first byte pointed to by the LPSTR pointer to the first null (CHR(0)) encountered after that.
The address pointed to by the LPSTR does not need to be (and in all probability, will not be) adjacent to the structure containing the LPSTR.
Take a look at the source in NETRSC.ZIP for the BuildNETRESOURCE method to get a feel for how the NETRESOURCE structure is constructed and allocated using my Heap class. The NETRESOURCE strucutre has a number of LPTSTRs (for all intents and purposes, they're the same thing a an LPSTR) embedded in the NETRESOURCE; you'll see that there are two distinct memory allocations associated with the NETRESOURCE, the structure itself, which is a fixed 32 bytes, and the string space pointed to by the structure, which can be virtually any size, and need not be a part of the same physical or virtual memory allocation.