Skip to content
Snippets Groups Projects
Commit 5d83a657 authored by Huw D. M. Davies's avatar Huw D. M. Davies Committed by Alexandre Julliard
Browse files

Fix SysStringByteLen to really return the length in bytes.

parent 9b6082f0
No related merge requests found
......@@ -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);
}
/******************************************************************************
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment