diff --git a/dlls/kernel32/kernel_private.h b/dlls/kernel32/kernel_private.h index 9cd4d74b40a..9ec20d6836c 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 834d5b9b648..d6a8492b92f 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; }