- simplified BasepAnsiStringToHeapUnicodeString

- fixed linking (global variable Basep8BitStringToUnicodeString was missing)
- fixed typo in the debug print in SetThreadUILanguage

svn path=/trunk/; revision=16886
This commit is contained in:
Thomas Bluemel 2005-07-29 23:03:12 +00:00
parent 4214fc67a7
commit f5bba7d9af
2 changed files with 18 additions and 15 deletions

View file

@ -13,6 +13,10 @@
#define NDEBUG
#include "../include/debug.h"
/* GLOBALS ******************************************************************/
PRTL_CONVERT_STRING Basep8BitStringToUnicodeString;
/* FUNCTIONS ****************************************************************/
/*
@ -73,8 +77,8 @@ Basep8BitStringToCachedUnicodeString(IN LPCSTR String)
return StaticString;
}
NTSTATUS
STDCALL
NTSTATUS
STDCALL
Basep8BitStringToHeapUnicodeString(OUT PUNICODE_STRING UnicodeString,
IN LPCSTR String)
{
@ -104,7 +108,7 @@ Basep8BitStringToHeapUnicodeString(OUT PUNICODE_STRING UnicodeString,
VOID
STDCALL
BasepAnsiStringToHeapUnicodeString(IN LPCSTR AnsiString,
IN LPWSTR* UnicodeString)
OUT LPWSTR* UnicodeString)
{
ANSI_STRING AnsiTemp;
UNICODE_STRING UnicodeTemp;
@ -114,17 +118,16 @@ BasepAnsiStringToHeapUnicodeString(IN LPCSTR AnsiString,
/* First create the ANSI_STRING */
RtlInitAnsiString(&AnsiTemp, AnsiString);
/* Now get the size needed */
UnicodeTemp.MaximumLength = RtlAnsiStringToUnicodeSize(&AnsiTemp);
/* Allocate space from the Heap for the string */
*UnicodeString = RtlAllocateHeap(GetProcessHeap(),
0,
UnicodeTemp.MaximumLength);
/* Save the buffer and convert */
UnicodeTemp.Buffer = *UnicodeString;
RtlAnsiStringToUnicodeString(&UnicodeTemp, &AnsiTemp, FALSE);
if (NT_SUCCESS(RtlAnsiStringToUnicodeString(&UnicodeTemp,
&AnsiTemp,
TRUE)))
{
*UnicodeString = UnicodeTemp.Buffer;
}
else
{
*UnicodeString = NULL;
}
}
/*

View file

@ -739,7 +739,7 @@ GetThreadId(HANDLE Thread)
LANGID STDCALL
SetThreadUILanguage(WORD wReserved)
{
DPRINT1("SetThreadUILanguage(0x%2x) unimplemented!\n", wReserved);
DPRINT1("SetThreadUILanguage(0x%4x) unimplemented!\n", wReserved);
return 0;
}