mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 23:22:59 +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,6 +230,9 @@ 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 ******************************************************************/
|
||||||
|
|
|
@ -233,13 +233,24 @@ 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