Fix SysStringByteLen to really return the length in bytes.

This commit is contained in:
Huw D M Davies 2000-07-08 11:47:38 +00:00 committed by Alexandre Julliard
parent 9b6082f0a3
commit 5d83a6576e
1 changed files with 12 additions and 1 deletions

View File

@ -303,7 +303,18 @@ int WINAPI SysStringLen(BSTR str)
*/
int WINAPI SysStringByteLen(BSTR str)
{
return SysStringLen(str)*sizeof(WCHAR);
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);
}
/******************************************************************************