The MASM Forum

Specialised Projects => Compiler Based Assembler => Assembler With Microsoft Visual C => Topic started by: jj2007 on January 29, 2020, 08:44:38 PM

Title: PropertyItem
Post by: jj2007 on January 29, 2020, 08:44:38 PM
Question to the C experts: is value assumed to be dword-aligned? I.e. is there a fillword after WORD type?

class PropertyItem
{
public:
    PROPID  id;                 // ID of this property
    ULONG   length;             // Length of the property value, in bytes
    WORD    type;               // Type of the value, as one of TAG_TYPE_XXX
                                // defined above
    VOID*   value;              // property value
};
Title: Re: PropertyItem
Post by: Biterider on January 29, 2020, 10:21:07 PM
Hi JJ
According to this https://docs.microsoft.com/en-us/cpp/cpp/alignment-cpp-declarations?view=vs-2019 (https://docs.microsoft.com/en-us/cpp/cpp/alignment-cpp-declarations?view=vs-2019), since value is a pointer, it should be aligned to 4 in 32-bit and to 8 in 64-bit.

Biterider
Title: Re: PropertyItem
Post by: jj2007 on January 29, 2020, 11:48:12 PM
Thanks!