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

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2016-01-21 10:29:50 +00:00 committed by Alexandre Julliard
parent 13bc86c034
commit 36f454cda0
2 changed files with 6 additions and 0 deletions

View File

@ -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 };
typedef struct {
#ifdef _WIN64
DWORD pad;
#endif
DWORD size;
union {
char ptr[1];

View File

@ -5398,9 +5398,12 @@ static void test_SysAllocString(void)
if (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 (!lstrcmpW(bstr->szString, szTest), "String different\n");
ok ((p & ~(align-1)) == p, "Not aligned to %d\n", align);
SysFreeString(str);
}
}