From f51736cb0c738835e5c954ff599b4e025883e7aa Mon Sep 17 00:00:00 2001 From: Troy Rollo Date: Tue, 29 Mar 2005 11:34:03 +0000 Subject: [PATCH] Implement SetCPGlobal (an undocumented Win32 API). --- dlls/kernel/kernel32.spec | 1 + dlls/kernel/locale.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/dlls/kernel/kernel32.spec b/dlls/kernel/kernel32.spec index 000984fb2cf..ebf4597012c 100644 --- a/dlls/kernel/kernel32.spec +++ b/dlls/kernel/kernel32.spec @@ -737,6 +737,7 @@ @ stdcall ScrollConsoleScreenBufferW(long ptr ptr ptr ptr) @ stdcall SearchPathA(str str str long ptr ptr) @ stdcall SearchPathW(wstr wstr wstr long ptr ptr) +@ stdcall SetCPGlobal(long) @ stdcall SetCommBreak(long) @ stdcall SetCommConfig(long ptr long) @ stdcall SetCommMask(long ptr) diff --git a/dlls/kernel/locale.c b/dlls/kernel/locale.c index c7559840036..7aa71278dbe 100644 --- a/dlls/kernel/locale.c +++ b/dlls/kernel/locale.c @@ -1205,6 +1205,27 @@ UINT WINAPI GetACP(void) } +/****************************************************************************** + * SetCPGlobal (KERNEL32.@) + * + * Set the current Ansi code page Id for the system. + * + * PARAMS + * acp [I] code page ID to be the new ACP. + * + * RETURNS + * The previous ACP. + */ +UINT WINAPI SetCPGlobal( UINT acp ) +{ + UINT ret = GetACP(); + const union cptable *new_cptable = wine_cp_get_table( acp ); + + if (new_cptable) ansi_cptable = new_cptable; + return ret; +} + + /*********************************************************************** * GetOEMCP (KERNEL32.@) *