mirror of
https://github.com/reactos/reactos.git
synced 2025-01-07 06:45:24 +00:00
[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! svn path=/trunk/; revision=72151
This commit is contained in:
parent
0644419fd1
commit
1b15193628
3 changed files with 38 additions and 1 deletions
|
@ -25,6 +25,7 @@ list(APPEND SOURCE
|
|||
misc/msi.c
|
||||
misc/shutdown.c
|
||||
misc/sysfunc.c
|
||||
misc/unicode.c
|
||||
reg/hkcr.c
|
||||
reg/reg.c
|
||||
sec/ac.c
|
||||
|
|
|
@ -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)
|
||||
|
|
36
reactos/dll/win32/advapi32/misc/unicode.c
Normal file
36
reactos/dll/win32/advapi32/misc/unicode.c
Normal file
|
@ -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 */
|
Loading…
Reference in a new issue