Commit 36f454cd authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

oleaut32: BSTRs should have 8 byte alignment on 64 bits.

parent 13bc86c0
...@@ -84,6 +84,9 @@ static CRITICAL_SECTION_DEBUG cs_bstr_cache_dbg = ...@@ -84,6 +84,9 @@ static CRITICAL_SECTION_DEBUG cs_bstr_cache_dbg =
static CRITICAL_SECTION cs_bstr_cache = { &cs_bstr_cache_dbg, -1, 0, 0, 0, 0 }; static CRITICAL_SECTION cs_bstr_cache = { &cs_bstr_cache_dbg, -1, 0, 0, 0, 0 };
typedef struct { typedef struct {
#ifdef _WIN64
DWORD pad;
#endif
DWORD size; DWORD size;
union { union {
char ptr[1]; char ptr[1];
......
...@@ -5398,9 +5398,12 @@ static void test_SysAllocString(void) ...@@ -5398,9 +5398,12 @@ static void test_SysAllocString(void)
if (str) if (str)
{ {
LPINTERNAL_BSTR bstr = Get(str); LPINTERNAL_BSTR bstr = Get(str);
DWORD_PTR p = (DWORD_PTR)str;
int align = sizeof(void *);
ok (bstr->dwLen == 8, "Expected 8, got %d\n", bstr->dwLen); ok (bstr->dwLen == 8, "Expected 8, got %d\n", bstr->dwLen);
ok (!lstrcmpW(bstr->szString, szTest), "String different\n"); ok (!lstrcmpW(bstr->szString, szTest), "String different\n");
ok ((p & ~(align-1)) == p, "Not aligned to %d\n", align);
SysFreeString(str); SysFreeString(str);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment