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

View file

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