Author Topic: PropertyItem  (Read 418 times)

jj2007

  • Member
  • *****
  • Posts: 10468
  • Assembler is fun ;-)
    • MasmBasic
PropertyItem
« 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?

Code: [Select]
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
};

Biterider

  • Member
  • ****
  • Posts: 533
  • ObjAsm Developer
    • ObjAsm
Re: PropertyItem
« Reply #1 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, since value is a pointer, it should be aligned to 4 in 32-bit and to 8 in 64-bit.

Biterider

jj2007

  • Member
  • *****
  • Posts: 10468
  • Assembler is fun ;-)
    • MasmBasic
Re: PropertyItem
« Reply #2 on: January 29, 2020, 11:48:12 PM »
Thanks!