Alexandre Julliard : kernel32: Don' t store the current codepage in the thread data.
Alexandre Julliard
julliard at winehq.org
Tue Dec 29 09:06:44 CST 2009
Module: wine
Branch: master
Commit: 9ff8da5499130b8fe0abc74b23736f3e4ee5d3d7
URL: http://source.winehq.org/git/wine.git/?a=commit;h=9ff8da5499130b8fe0abc74b23736f3e4ee5d3d7
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Dec 28 17:24:50 2009 +0100
kernel32: Don't store the current codepage in the thread data.
---
dlls/kernel32/kernel_private.h | 3 +--
dlls/kernel32/locale.c | 4 ++--
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/dlls/kernel32/kernel_private.h b/dlls/kernel32/kernel_private.h
index 9cd4d74..9ec20d6 100644
--- a/dlls/kernel32/kernel_private.h
+++ b/dlls/kernel32/kernel_private.h
@@ -27,12 +27,11 @@ struct tagSYSLEVEL;
struct kernel_thread_data
{
- UINT code_page; /* thread code page */
WORD stack_sel; /* 16-bit stack selector */
WORD htask16; /* Win16 task handle */
DWORD sys_count[4]; /* syslevel mutex entry counters */
struct tagSYSLEVEL *sys_mutex[4]; /* syslevel mutex pointers */
- void *pad[44]; /* change this if you add fields! */
+ void *pad[45]; /* change this if you add fields! */
};
static inline struct kernel_thread_data *kernel_get_thread_data(void)
diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c
index 834d5b9..d6a8492 100644
--- a/dlls/kernel32/locale.c
+++ b/dlls/kernel32/locale.c
@@ -222,7 +222,8 @@ static const union cptable *get_codepage_table( unsigned int codepage )
case CP_UTF8:
break;
case CP_THREAD_ACP:
- if (!(codepage = kernel_get_thread_data()->code_page)) return ansi_cptable;
+ if (NtCurrentTeb()->CurrentLocale == GetUserDefaultLCID()) return ansi_cptable;
+ codepage = get_lcid_codepage( NtCurrentTeb()->CurrentLocale );
/* fall through */
default:
if (codepage == ansi_cptable->info.codepage) return ansi_cptable;
@@ -2057,7 +2058,6 @@ BOOL WINAPI SetThreadLocale( LCID lcid )
}
NtCurrentTeb()->CurrentLocale = lcid;
- kernel_get_thread_data()->code_page = get_lcid_codepage( lcid );
}
return TRUE;
}
More information about the wine-cvs
mailing list