oleaut32: SysStringLen code clean up.

This commit is contained in:
Jacek Caban 2012-05-01 15:06:32 +02:00 committed by Alexandre Julliard
parent 13db9a1662
commit 7fded88895
1 changed files with 1 additions and 12 deletions

View File

@ -152,18 +152,7 @@ static DWORD *alloc_bstr(size_t size)
*/ */
UINT WINAPI SysStringLen(BSTR str) UINT WINAPI SysStringLen(BSTR str)
{ {
DWORD* bufferPointer; return str ? *((DWORD*)str-1)/sizeof(WCHAR) : 0;
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));
} }
/****************************************************************************** /******************************************************************************