diff --git a/dlls/oleaut32/oleaut.c b/dlls/oleaut32/oleaut.c index 8cbc819a0ce..0d4a07c9e16 100644 --- a/dlls/oleaut32/oleaut.c +++ b/dlls/oleaut32/oleaut.c @@ -152,18 +152,7 @@ static DWORD *alloc_bstr(size_t size) */ UINT WINAPI SysStringLen(BSTR str) { - DWORD* bufferPointer; - - if (!str) return 0; - /* - * The length of the string (in bytes) is contained in a DWORD placed - * just before the BSTR pointer - */ - bufferPointer = (DWORD*)str; - - bufferPointer--; - - return (int)(*bufferPointer/sizeof(WCHAR)); + return str ? *((DWORD*)str-1)/sizeof(WCHAR) : 0; } /******************************************************************************