Jacek Caban : oleaut32: SysStringLen code clean up.

Alexandre Julliard julliard at winehq.org
Tue May 1 13:12:14 CDT 2012


Module: wine
Branch: master
Commit: 7fded8889577385d6595a18b3dd00c73dba23bf3
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7fded8889577385d6595a18b3dd00c73dba23bf3

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Tue May  1 15:06:32 2012 +0200

oleaut32: SysStringLen code clean up.

---

 dlls/oleaut32/oleaut.c |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)

diff --git a/dlls/oleaut32/oleaut.c b/dlls/oleaut32/oleaut.c
index 8cbc819..0d4a07c 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;
 }
 
 /******************************************************************************




More information about the wine-cvs mailing list