mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 21:23:00 +00:00
[KERNEL32]: Actually properly support ANSI vs OEM SetFileAPI instead of assuming Unicode->ANSI for most things. Note this just adds support, there's still many wine-synched APIs that are using the FileNameA2W hacks and similar, which force ANSI. But it's a step in the right direction.
svn path=/trunk/; revision=54308
This commit is contained in:
parent
ec9698366a
commit
f0199db57b
3 changed files with 62 additions and 14 deletions
|
@ -175,6 +175,33 @@ FilenameW2A_N(
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ULONG
|
||||||
|
NTAPI
|
||||||
|
BasepUnicodeStringToOemSize(IN PUNICODE_STRING String)
|
||||||
|
{
|
||||||
|
return RtlUnicodeStringToOemSize(String);
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG
|
||||||
|
NTAPI
|
||||||
|
BasepOemStringToUnicodeSize(IN PANSI_STRING String)
|
||||||
|
{
|
||||||
|
return RtlOemStringToUnicodeSize(String);
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG
|
||||||
|
NTAPI
|
||||||
|
BasepUnicodeStringToAnsiSize(IN PUNICODE_STRING String)
|
||||||
|
{
|
||||||
|
return RtlUnicodeStringToAnsiSize(String);
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG
|
||||||
|
NTAPI
|
||||||
|
BasepAnsiStringToUnicodeSize(IN PANSI_STRING String)
|
||||||
|
{
|
||||||
|
return RtlAnsiStringToUnicodeSize(String);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
|
@ -185,6 +212,9 @@ SetFileApisToOEM(VOID)
|
||||||
{
|
{
|
||||||
/* Set the correct Base Api */
|
/* Set the correct Base Api */
|
||||||
Basep8BitStringToUnicodeString = (PRTL_CONVERT_STRING)RtlOemStringToUnicodeString;
|
Basep8BitStringToUnicodeString = (PRTL_CONVERT_STRING)RtlOemStringToUnicodeString;
|
||||||
|
BasepUnicodeStringTo8BitString = RtlUnicodeStringToOemString;
|
||||||
|
BasepUnicodeStringTo8BitSize = BasepUnicodeStringToOemSize;
|
||||||
|
Basep8BitStringToUnicodeSize = BasepOemStringToUnicodeSize;
|
||||||
|
|
||||||
/* FIXME: Old, deprecated way */
|
/* FIXME: Old, deprecated way */
|
||||||
bIsFileApiAnsi = FALSE;
|
bIsFileApiAnsi = FALSE;
|
||||||
|
@ -200,7 +230,10 @@ SetFileApisToANSI(VOID)
|
||||||
{
|
{
|
||||||
/* Set the correct Base Api */
|
/* Set the correct Base Api */
|
||||||
Basep8BitStringToUnicodeString = RtlAnsiStringToUnicodeString;
|
Basep8BitStringToUnicodeString = RtlAnsiStringToUnicodeString;
|
||||||
|
BasepUnicodeStringTo8BitString = RtlUnicodeStringToAnsiString;
|
||||||
|
BasepUnicodeStringTo8BitSize = BasepUnicodeStringToAnsiSize;
|
||||||
|
Basep8BitStringToUnicodeSize = BasepAnsiStringToUnicodeSize;
|
||||||
|
|
||||||
/* FIXME: Old, deprecated way */
|
/* FIXME: Old, deprecated way */
|
||||||
bIsFileApiAnsi = TRUE;
|
bIsFileApiAnsi = TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,10 @@
|
||||||
/* GLOBALS ********************************************************************/
|
/* GLOBALS ********************************************************************/
|
||||||
|
|
||||||
PRTL_CONVERT_STRING Basep8BitStringToUnicodeString;
|
PRTL_CONVERT_STRING Basep8BitStringToUnicodeString;
|
||||||
|
PRTL_CONVERT_STRINGA BasepUnicodeStringTo8BitString;
|
||||||
|
PRTL_COUNT_STRING BasepUnicodeStringTo8BitSize;
|
||||||
|
PRTL_COUNT_STRINGA Basep8BitStringToUnicodeSize;
|
||||||
|
|
||||||
UNICODE_STRING Restricted = RTL_CONSTANT_STRING(L"Restricted");
|
UNICODE_STRING Restricted = RTL_CONSTANT_STRING(L"Restricted");
|
||||||
|
|
||||||
/* FUNCTIONS ******************************************************************/
|
/* FUNCTIONS ******************************************************************/
|
||||||
|
|
|
@ -25,9 +25,9 @@
|
||||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED); \
|
SetLastError(ERROR_CALL_NOT_IMPLEMENTED); \
|
||||||
DPRINT1("%s() is UNIMPLEMENTED!\n", __FUNCTION__)
|
DPRINT1("%s() is UNIMPLEMENTED!\n", __FUNCTION__)
|
||||||
|
|
||||||
#define debugstr_a
|
#define debugstr_a
|
||||||
#define debugstr_w
|
#define debugstr_w
|
||||||
#define wine_dbgstr_w
|
#define wine_dbgstr_w
|
||||||
#define debugstr_guid
|
#define debugstr_guid
|
||||||
|
|
||||||
#include "wine/unicode.h"
|
#include "wine/unicode.h"
|
||||||
|
@ -70,7 +70,7 @@
|
||||||
|
|
||||||
/* Undocumented CreateProcess flag */
|
/* Undocumented CreateProcess flag */
|
||||||
#define STARTF_SHELLPRIVATE 0x400
|
#define STARTF_SHELLPRIVATE 0x400
|
||||||
|
|
||||||
typedef struct _CODEPAGE_ENTRY
|
typedef struct _CODEPAGE_ENTRY
|
||||||
{
|
{
|
||||||
LIST_ENTRY Entry;
|
LIST_ENTRY Entry;
|
||||||
|
@ -169,14 +169,14 @@ WINAPI
|
||||||
BaseFormatObjectAttributes(OUT POBJECT_ATTRIBUTES ObjectAttributes,
|
BaseFormatObjectAttributes(OUT POBJECT_ATTRIBUTES ObjectAttributes,
|
||||||
IN PSECURITY_ATTRIBUTES SecurityAttributes OPTIONAL,
|
IN PSECURITY_ATTRIBUTES SecurityAttributes OPTIONAL,
|
||||||
IN PUNICODE_STRING ObjectName);
|
IN PUNICODE_STRING ObjectName);
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
WINAPI
|
WINAPI
|
||||||
BaseCreateStack(HANDLE hProcess,
|
BaseCreateStack(HANDLE hProcess,
|
||||||
SIZE_T StackReserve,
|
SIZE_T StackReserve,
|
||||||
SIZE_T StackCommit,
|
SIZE_T StackCommit,
|
||||||
PINITIAL_TEB InitialTeb);
|
PINITIAL_TEB InitialTeb);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
WINAPI
|
WINAPI
|
||||||
BaseInitializeContext(IN PCONTEXT Context,
|
BaseInitializeContext(IN PCONTEXT Context,
|
||||||
|
@ -184,7 +184,7 @@ BaseInitializeContext(IN PCONTEXT Context,
|
||||||
IN PVOID StartAddress,
|
IN PVOID StartAddress,
|
||||||
IN PVOID StackAddress,
|
IN PVOID StackAddress,
|
||||||
IN ULONG ContextType);
|
IN ULONG ContextType);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
WINAPI
|
WINAPI
|
||||||
BaseThreadStartupThunk(VOID);
|
BaseThreadStartupThunk(VOID);
|
||||||
|
@ -192,13 +192,13 @@ BaseThreadStartupThunk(VOID);
|
||||||
VOID
|
VOID
|
||||||
WINAPI
|
WINAPI
|
||||||
BaseProcessStartThunk(VOID);
|
BaseProcessStartThunk(VOID);
|
||||||
|
|
||||||
__declspec(noreturn)
|
__declspec(noreturn)
|
||||||
VOID
|
VOID
|
||||||
WINAPI
|
WINAPI
|
||||||
BaseThreadStartup(LPTHREAD_START_ROUTINE lpStartAddress,
|
BaseThreadStartup(LPTHREAD_START_ROUTINE lpStartAddress,
|
||||||
LPVOID lpParameter);
|
LPVOID lpParameter);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
WINAPI
|
WINAPI
|
||||||
BaseFreeThreadStack(IN HANDLE hProcess,
|
BaseFreeThreadStack(IN HANDLE hProcess,
|
||||||
|
@ -214,7 +214,7 @@ typedef UINT (WINAPI *PPROCESS_START_ROUTINE)(VOID);
|
||||||
VOID
|
VOID
|
||||||
WINAPI
|
WINAPI
|
||||||
BaseProcessStartup(PPROCESS_START_ROUTINE lpStartAddress);
|
BaseProcessStartup(PPROCESS_START_ROUTINE lpStartAddress);
|
||||||
|
|
||||||
PVOID
|
PVOID
|
||||||
WINAPI
|
WINAPI
|
||||||
BasepIsRealtimeAllowed(IN BOOLEAN Keep);
|
BasepIsRealtimeAllowed(IN BOOLEAN Keep);
|
||||||
|
@ -223,7 +223,7 @@ VOID
|
||||||
WINAPI
|
WINAPI
|
||||||
BasepAnsiStringToHeapUnicodeString(IN LPCSTR AnsiString,
|
BasepAnsiStringToHeapUnicodeString(IN LPCSTR AnsiString,
|
||||||
OUT LPWSTR* UnicodeString);
|
OUT LPWSTR* UnicodeString);
|
||||||
|
|
||||||
PUNICODE_STRING
|
PUNICODE_STRING
|
||||||
WINAPI
|
WINAPI
|
||||||
Basep8BitStringToStaticUnicodeString(IN LPCSTR AnsiString);
|
Basep8BitStringToStaticUnicodeString(IN LPCSTR AnsiString);
|
||||||
|
@ -232,14 +232,25 @@ BOOLEAN
|
||||||
WINAPI
|
WINAPI
|
||||||
Basep8BitStringToDynamicUnicodeString(OUT PUNICODE_STRING UnicodeString,
|
Basep8BitStringToDynamicUnicodeString(OUT PUNICODE_STRING UnicodeString,
|
||||||
IN LPCSTR String);
|
IN LPCSTR String);
|
||||||
|
|
||||||
#define BasepUnicodeStringTo8BitString RtlUnicodeStringToAnsiString
|
|
||||||
|
|
||||||
typedef NTSTATUS (NTAPI *PRTL_CONVERT_STRING)(IN PUNICODE_STRING UnicodeString,
|
typedef NTSTATUS (NTAPI *PRTL_CONVERT_STRING)(IN PUNICODE_STRING UnicodeString,
|
||||||
IN PANSI_STRING AnsiString,
|
IN PANSI_STRING AnsiString,
|
||||||
IN BOOLEAN AllocateMemory);
|
IN BOOLEAN AllocateMemory);
|
||||||
|
|
||||||
|
typedef ULONG (NTAPI *PRTL_COUNT_STRING)(IN PUNICODE_STRING UnicodeString);
|
||||||
|
|
||||||
|
typedef NTSTATUS (NTAPI *PRTL_CONVERT_STRINGA)(IN PANSI_STRING AnsiString,
|
||||||
|
IN PCUNICODE_STRING UnicodeString,
|
||||||
|
IN BOOLEAN AllocateMemory);
|
||||||
|
|
||||||
|
typedef ULONG (NTAPI *PRTL_COUNT_STRINGA)(IN PANSI_STRING UnicodeString);
|
||||||
|
|
||||||
|
|
||||||
extern PRTL_CONVERT_STRING Basep8BitStringToUnicodeString;
|
extern PRTL_CONVERT_STRING Basep8BitStringToUnicodeString;
|
||||||
|
extern PRTL_CONVERT_STRINGA BasepUnicodeStringTo8BitString;
|
||||||
|
extern PRTL_COUNT_STRING BasepUnicodeStringTo8BitSize;
|
||||||
|
extern PRTL_COUNT_STRINGA Basep8BitStringToUnicodeSize;
|
||||||
|
|
||||||
extern HANDLE BaseNamedObjectDirectory;
|
extern HANDLE BaseNamedObjectDirectory;
|
||||||
|
|
||||||
HANDLE
|
HANDLE
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue