Jump to content
Sign in to follow this  

Create a nested structure

Recommended Posts


Hi all.

I searched the forum for an answer to this matter but didn't find anything concrete.

I need to create a structure like this one in C++:

ZeroMemory(&ea, NUM_ACES * sizeof(EXPLICIT_ACCESS));
    // Set read access for Everyone.
    ea[0].grfAccessPermissions = GENERIC_READ;
    ea[0].grfAccessMode = SET_ACCESS;
    ea[0].grfInheritance = NO_INHERITANCE;
    ea[0].Trustee.TrusteeForm = TRUSTEE_IS_SID;
    ea[0].Trustee.TrusteeType = TRUSTEE_IS_WELL_KNOWN_GROUP;
    ea[0].Trustee.ptstrName = (LPTSTR) pSIDEveryone;

As you can see, it adds an aligned structure (Trustee) inside the main structure. Setting a pointer to the trustee struct as the member doesn't work, obviously.

Does anyone know how I can align the two nested structures?

Share this post

Link to post
Share on other sites

The help file says:

To use nested structures inside a structure you must re-define the nested structure. For example, a structure containing 2 POINT structures ("long;long") would be declared as "long;long;long;long". The first two long values correspond to the first POINT structure and the second two values correspond to the second POINT structure.

Wonder how I could use this to create the structure I mentioned above...

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.