diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index c21c62c10b0..2a6b8467812 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -3968,7 +3968,6 @@ static NTSTATUS process_init(void) is_wow64 = !!NtCurrentTeb64(); #endif - init_unix_codepage(); init_user_process_params(); params = peb->ProcessParameters; diff --git a/dlls/ntdll/locale.c b/dlls/ntdll/locale.c index 892f3fe9e70..758789a533c 100644 --- a/dlls/ntdll/locale.c +++ b/dlls/ntdll/locale.c @@ -104,7 +104,6 @@ LCID user_lcid = 0, system_lcid = 0; static NLSTABLEINFO nls_info; static HMODULE kernel32_handle; -static CPTABLEINFO unix_table; static struct norm_table *norm_tables[16]; @@ -534,13 +533,6 @@ static unsigned int compose_string( const struct norm_table *info, WCHAR *str, u } -void init_unix_codepage(void) -{ - USHORT *data = unix_funcs->get_unix_codepage_data(); - if (data) RtlInitCodePageTable( data, &unix_table ); -} - - static LCID locale_to_lcid( WCHAR *win_name ) { WCHAR *p; @@ -586,72 +578,6 @@ void init_locale( HMODULE module ) } -/****************************************************************** - * ntdll_umbstowcs - */ -DWORD ntdll_umbstowcs( const char *src, DWORD srclen, WCHAR *dst, DWORD dstlen ) -{ - DWORD reslen; - - if (unix_table.CodePage) - RtlCustomCPToUnicodeN( &unix_table, dst, dstlen * sizeof(WCHAR), &reslen, src, srclen ); - else - RtlUTF8ToUnicodeN( dst, dstlen * sizeof(WCHAR), &reslen, src, srclen ); - return reslen / sizeof(WCHAR); -} - - -/****************************************************************** - * ntdll_wcstoumbs - */ -int ntdll_wcstoumbs( const WCHAR *src, DWORD srclen, char *dst, DWORD dstlen, BOOL strict ) -{ - DWORD i, reslen; - - if (!unix_table.CodePage) - RtlUnicodeToUTF8N( dst, dstlen, &reslen, src, srclen * sizeof(WCHAR) ); - else if (!strict) - RtlUnicodeToCustomCPN( &unix_table, dst, dstlen, &reslen, src, srclen * sizeof(WCHAR) ); - else /* do it by hand to make sure every character roundtrips correctly */ - { - if (unix_table.DBCSOffsets) - { - const unsigned short *uni2cp = unix_table.WideCharTable; - for (i = dstlen; srclen && i; i--, srclen--, src++) - { - unsigned short ch = uni2cp[*src]; - if (ch >> 8) - { - if (unix_table.DBCSOffsets[unix_table.DBCSOffsets[ch >> 8] + (ch & 0xff)] != *src) - return -1; - if (i == 1) break; /* do not output a partial char */ - i--; - *dst++ = ch >> 8; - } - else - { - if (unix_table.MultiByteTable[ch] != *src) return -1; - *dst++ = (char)ch; - } - } - reslen = dstlen - i; - } - else - { - const unsigned char *uni2cp = unix_table.WideCharTable; - reslen = min( srclen, dstlen ); - for (i = 0; i < reslen; i++) - { - unsigned char ch = uni2cp[src[i]]; - if (unix_table.MultiByteTable[ch] != src[i]) return -1; - dst[i] = ch; - } - } - } - return reslen; -} - - static NTSTATUS get_dummy_preferred_ui_language( DWORD flags, LANGID lang, ULONG *count, WCHAR *buffer, ULONG *size ) { diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index aebea12e6ba..72340a171c9 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -61,7 +61,6 @@ extern void version_init(void) DECLSPEC_HIDDEN; extern void debug_init(void) DECLSPEC_HIDDEN; extern void actctx_init(void) DECLSPEC_HIDDEN; extern void heap_set_debug_flags( HANDLE handle ) DECLSPEC_HIDDEN; -extern void init_unix_codepage(void) DECLSPEC_HIDDEN; extern void init_locale( HMODULE module ) DECLSPEC_HIDDEN; extern void init_user_process_params(void) DECLSPEC_HIDDEN; extern void CDECL DECLSPEC_NORETURN signal_start_thread( CONTEXT *ctx ) DECLSPEC_HIDDEN; @@ -88,8 +87,6 @@ extern struct _KUSER_SHARED_DATA *user_shared_data DECLSPEC_HIDDEN; /* locale */ extern LCID user_lcid, system_lcid; -extern DWORD ntdll_umbstowcs( const char* src, DWORD srclen, WCHAR* dst, DWORD dstlen ) DECLSPEC_HIDDEN; -extern int ntdll_wcstoumbs( const WCHAR* src, DWORD srclen, char* dst, DWORD dstlen, BOOL strict ) DECLSPEC_HIDDEN; extern int CDECL NTDLL__vsnprintf( char *str, SIZE_T len, const char *format, __ms_va_list args ) DECLSPEC_HIDDEN; extern int CDECL NTDLL__vsnwprintf( WCHAR *str, SIZE_T len, const WCHAR *format, __ms_va_list args ) DECLSPEC_HIDDEN; diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c index a8f490e8740..84d5ab298a4 100644 --- a/dlls/ntdll/unix/env.c +++ b/dlls/ntdll/unix/env.c @@ -1355,17 +1355,6 @@ static void get_initial_directory( UNICODE_STRING *dir ) } -/************************************************************************* - * get_unix_codepage_data - * - * Return the Unix codepage data. - */ -USHORT * CDECL get_unix_codepage_data(void) -{ - return unix_cp.data; -} - - /************************************************************************* * get_locales * diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index df8d99ce489..21e1e1893c0 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -1715,7 +1715,6 @@ static struct unix_funcs unix_funcs = ntdll_sin, ntdll_sqrt, ntdll_tan, - get_unix_codepage_data, get_locales, virtual_release_address_space, load_so_dll, diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 529cb6edb69..d56fc9b0f19 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -100,7 +100,6 @@ extern LONGLONG CDECL fast_RtlGetSystemTimePrecise(void) DECLSPEC_HIDDEN; extern NTSTATUS CDECL fast_wait_cv( RTL_CONDITION_VARIABLE *variable, const void *value, const LARGE_INTEGER *timeout ) DECLSPEC_HIDDEN; -extern USHORT * CDECL get_unix_codepage_data(void) DECLSPEC_HIDDEN; extern void CDECL get_locales( WCHAR *sys, WCHAR *user ) DECLSPEC_HIDDEN; extern void CDECL virtual_release_address_space(void) DECLSPEC_HIDDEN; diff --git a/dlls/ntdll/unixlib.h b/dlls/ntdll/unixlib.h index bd2512030c2..6a7f008ed9c 100644 --- a/dlls/ntdll/unixlib.h +++ b/dlls/ntdll/unixlib.h @@ -26,7 +26,7 @@ struct _DISPATCHER_CONTEXT; /* increment this when you change the function table */ -#define NTDLL_UNIXLIB_VERSION 113 +#define NTDLL_UNIXLIB_VERSION 114 struct unix_funcs { @@ -70,7 +70,6 @@ struct unix_funcs double (CDECL *tan)( double d ); /* environment functions */ - USHORT * (CDECL *get_unix_codepage_data)(void); void (CDECL *get_locales)( WCHAR *sys, WCHAR *user ); /* virtual memory functions */