Author: hbelusca
Date: Sun Aug 7 19:02:07 2016
New Revision: 72151
URL:
http://svn.reactos.org/svn/reactos?rev=72151&view=rev
Log:
[ADVAPI32]: Don't directly redirect IsTextUnicode to RtlIsTextUnicode, but use a
helper function, so that the return value is correctly set to TRUE or FALSE. Indeed the
former function returns a BOOL (long) while the latter returns a BOOLEAN (byte), and the
high bytes in the return value could not be correctly set otherwise.
Adapted from a patch by 'andy-123'.
CORE-11803 #resolve #comment Fixesd, thanks!
Added:
trunk/reactos/dll/win32/advapi32/misc/unicode.c (with props)
Modified:
trunk/reactos/dll/win32/advapi32/CMakeLists.txt
trunk/reactos/dll/win32/advapi32/advapi32.spec
Modified: trunk/reactos/dll/win32/advapi32/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/CMakeLi…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/CMakeLists.txt [iso-8859-1] Sun Aug 7 19:02:07 2016
@@ -25,6 +25,7 @@
misc/msi.c
misc/shutdown.c
misc/sysfunc.c
+ misc/unicode.c
reg/hkcr.c
reg/reg.c
sec/ac.c
Modified: trunk/reactos/dll/win32/advapi32/advapi32.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/advapi3…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/advapi32.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/advapi32.spec [iso-8859-1] Sun Aug 7 19:02:07 2016
@@ -313,7 +313,7 @@
313 stdcall InitiateSystemShutdownExW(wstr wstr long long long long)
314 stdcall InitiateSystemShutdownW(str str long long long)
315 stub InstallApplication
-316 stdcall IsTextUnicode(ptr long ptr) ntdll.RtlIsTextUnicode
+316 stdcall IsTextUnicode(ptr long ptr)
317 stdcall IsTokenRestricted(long)
318 stub IsTokenUntrusted
319 stdcall IsValidAcl(ptr)
Added: trunk/reactos/dll/win32/advapi32/misc/unicode.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/misc/un…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/misc/unicode.c (added)
+++ trunk/reactos/dll/win32/advapi32/misc/unicode.c [iso-8859-1] Sun Aug 7 19:02:07 2016
@@ -0,0 +1,36 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS system libraries
+ * FILE: dll/win32/advapi32/misc/unicode.c
+ * PURPOSE: Unicode helper. Needed because RtlIsTextUnicode returns a
+ * BOOLEAN (byte) while IsTextUnicode returns a BOOL (long).
+ * The high bytes of the return value should be correctly set,
+ * hence a direct redirection cannot be done.
+ */
+
+#include <advapi32.h>
+
+WINE_DEFAULT_DEBUG_CHANNEL(advapi);
+
+/**************************************************************************
+ * IsTextUnicode (ADVAPI32.@)
+ *
+ * Attempt to guess whether a text buffer is Unicode.
+ *
+ * PARAMS
+ * lpv [I] Text buffer to test
+ * iSize [I] Length of lpv
+ * lpiResult [O] Destination for test results
+ *
+ * RETURNS
+ * TRUE if the buffer is likely Unicode, FALSE otherwise.
+ */
+BOOL WINAPI
+IsTextUnicode(IN CONST VOID* lpv,
+ IN INT iSize,
+ IN OUT LPINT lpiResult OPTIONAL)
+{
+ return (RtlIsTextUnicode(lpv, iSize, lpiResult) == TRUE);
+}
+
+/* EOF */
Propchange: trunk/reactos/dll/win32/advapi32/misc/unicode.c
------------------------------------------------------------------------------
svn:eol-style = native