Commit 79d850f2 authored by Juergen Schmied's avatar Juergen Schmied Committed by Alexandre Julliard

- implemented Get/SetThreadLocale

- added comment about OleErrorInfo field in TEB
parent 45bd6123
......@@ -3,6 +3,9 @@
*
* Copyright 2000 Patrik Stridvall
*
*
* The errorinfo is a per-thread object. The reference is stored in the
* TEB at offset 0xf80
*/
#include "debugtools.h"
......
......@@ -75,7 +75,7 @@ typedef struct _TEB
WORD thunk_ss; /* --n 84 Yet another 16-bit stack selector */
WORD pad3; /* --n 86 */
DWORD pad4[15]; /* --n 88 */
ULONG CurrentLocale; /* -2n C4 */
ULONG CurrentLocale; /* -2- C4 */
DWORD pad5[48]; /* --n C8 */
DWORD delta_priority; /* 1-n 188 Priority delta */
DWORD unknown4[7]; /* d-n 18c Unknown */
......@@ -107,7 +107,7 @@ typedef struct _TEB
DWORD pad8[3]; /* --n f10 */
PVOID ReservedForNtRpc; /* -2- f1c used by rpcrt4 */
DWORD pad9[24]; /* --n f20 */
PVOID ReservedForOle; /* -2- f80 used by ole32 */
PVOID ReservedForOle; /* -2- f80 used by ole32 (IErrorInfo*) */
} TEB;
/* Thread exception flags */
......
......@@ -1007,15 +1007,6 @@ DWORD WINAPI MapProcessHandle( HANDLE handle )
}
/***********************************************************************
* GetThreadLocale (KERNEL32.295)
*/
LCID WINAPI GetThreadLocale(void)
{
return PROCESS_Current()->locale;
}
/***********************************************************************
* SetPriorityClass (KERNEL32.503)
*/
BOOL WINAPI SetPriorityClass( HANDLE hprocess, DWORD priorityclass )
......
......@@ -30,6 +30,7 @@
#include "debugtools.h"
#include "queue.h"
#include "hook.h"
#include "winnls.h"
DEFAULT_DEBUG_CHANNEL(thread);
......@@ -296,6 +297,7 @@ HANDLE WINAPI CreateThread( SECURITY_ATTRIBUTES *sa, DWORD stack,
teb->entry_arg = param;
teb->startup = THREAD_Start;
teb->htask16 = GetCurrentTask();
teb->CurrentLocale = GetUserDefaultLCID(); /* for threads in user context */
if (id) *id = (DWORD)tid;
if (SYSDEPS_SpawnThread( teb ) == -1)
{
......@@ -810,6 +812,16 @@ VOID WINAPI VWin32_BoostThreadStatic( DWORD threadId, INT boost )
FIXME("(0x%08lx,%d): stub\n", threadId, boost);
}
/***********************************************************************
* GetThreadLocale (KERNEL32.295)
*/
LCID WINAPI GetThreadLocale(void)
{
return NtCurrentTeb()->CurrentLocale;
}
/**********************************************************************
* SetThreadLocale [KERNEL32.671] Sets the calling threads current locale.
*
......@@ -817,14 +829,24 @@ VOID WINAPI VWin32_BoostThreadStatic( DWORD threadId, INT boost )
* Success: TRUE
* Failure: FALSE
*
* NOTES
* Implemented in NT only (3.1 and above according to MS
* FIXME
* check if lcid is a valid cp
*/
BOOL WINAPI SetThreadLocale(
LCID lcid) /* [in] Locale identifier */
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
switch (lcid)
{
case LOCALE_SYSTEM_DEFAULT:
lcid = GetSystemDefaultLCID();
break;
case LOCALE_USER_DEFAULT:
case LOCALE_NEUTRAL:
lcid = GetUserDefaultLCID();
break;
}
NtCurrentTeb()->CurrentLocale = lcid;
return TRUE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment