Author: ion
Date: Sun Nov 6 01:47:49 2011
New Revision: 54308
URL:
http://svn.reactos.org/svn/reactos?rev=54308&view=rev
Log:
[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.
Modified:
trunk/reactos/dll/win32/kernel32/client/file/file.c
trunk/reactos/dll/win32/kernel32/client/utils.c
trunk/reactos/dll/win32/kernel32/include/kernel32.h
Modified: trunk/reactos/dll/win32/kernel32/client/file/file.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/file/file.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/file/file.c [iso-8859-1] Sun Nov 6 01:47:49
2011
@@ -175,6 +175,33 @@
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
@@ -185,6 +212,9 @@
{
/* Set the correct Base Api */
Basep8BitStringToUnicodeString = (PRTL_CONVERT_STRING)RtlOemStringToUnicodeString;
+ BasepUnicodeStringTo8BitString = RtlUnicodeStringToOemString;
+ BasepUnicodeStringTo8BitSize = BasepUnicodeStringToOemSize;
+ Basep8BitStringToUnicodeSize = BasepOemStringToUnicodeSize;
/* FIXME: Old, deprecated way */
bIsFileApiAnsi = FALSE;
@@ -200,7 +230,10 @@
{
/* Set the correct Base Api */
Basep8BitStringToUnicodeString = RtlAnsiStringToUnicodeString;
-
+ BasepUnicodeStringTo8BitString = RtlUnicodeStringToAnsiString;
+ BasepUnicodeStringTo8BitSize = BasepUnicodeStringToAnsiSize;
+ Basep8BitStringToUnicodeSize = BasepAnsiStringToUnicodeSize;
+
/* FIXME: Old, deprecated way */
bIsFileApiAnsi = TRUE;
}
Modified: trunk/reactos/dll/win32/kernel32/client/utils.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/utils.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/utils.c [iso-8859-1] Sun Nov 6 01:47:49 2011
@@ -22,6 +22,10 @@
/* GLOBALS ********************************************************************/
PRTL_CONVERT_STRING Basep8BitStringToUnicodeString;
+PRTL_CONVERT_STRINGA BasepUnicodeStringTo8BitString;
+PRTL_COUNT_STRING BasepUnicodeStringTo8BitSize;
+PRTL_COUNT_STRINGA Basep8BitStringToUnicodeSize;
+
UNICODE_STRING Restricted = RTL_CONSTANT_STRING(L"Restricted");
/* FUNCTIONS ******************************************************************/
Modified: trunk/reactos/dll/win32/kernel32/include/kernel32.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/include…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/include/kernel32.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/include/kernel32.h [iso-8859-1] Sun Nov 6 01:47:49
2011
@@ -25,9 +25,9 @@
SetLastError(ERROR_CALL_NOT_IMPLEMENTED); \
DPRINT1("%s() is UNIMPLEMENTED!\n", __FUNCTION__)
-#define debugstr_a
+#define debugstr_a
#define debugstr_w
-#define wine_dbgstr_w
+#define wine_dbgstr_w
#define debugstr_guid
#include "wine/unicode.h"
@@ -70,7 +70,7 @@
/* Undocumented CreateProcess flag */
#define STARTF_SHELLPRIVATE 0x400
-
+
typedef struct _CODEPAGE_ENTRY
{
LIST_ENTRY Entry;
@@ -169,14 +169,14 @@
BaseFormatObjectAttributes(OUT POBJECT_ATTRIBUTES ObjectAttributes,
IN PSECURITY_ATTRIBUTES SecurityAttributes OPTIONAL,
IN PUNICODE_STRING ObjectName);
-
+
NTSTATUS
WINAPI
BaseCreateStack(HANDLE hProcess,
SIZE_T StackReserve,
SIZE_T StackCommit,
PINITIAL_TEB InitialTeb);
-
+
VOID
WINAPI
BaseInitializeContext(IN PCONTEXT Context,
@@ -184,7 +184,7 @@
IN PVOID StartAddress,
IN PVOID StackAddress,
IN ULONG ContextType);
-
+
VOID
WINAPI
BaseThreadStartupThunk(VOID);
@@ -192,13 +192,13 @@
VOID
WINAPI
BaseProcessStartThunk(VOID);
-
+
__declspec(noreturn)
VOID
WINAPI
BaseThreadStartup(LPTHREAD_START_ROUTINE lpStartAddress,
LPVOID lpParameter);
-
+
VOID
WINAPI
BaseFreeThreadStack(IN HANDLE hProcess,
@@ -214,7 +214,7 @@
VOID
WINAPI
BaseProcessStartup(PPROCESS_START_ROUTINE lpStartAddress);
-
+
PVOID
WINAPI
BasepIsRealtimeAllowed(IN BOOLEAN Keep);
@@ -223,7 +223,7 @@
WINAPI
BasepAnsiStringToHeapUnicodeString(IN LPCSTR AnsiString,
OUT LPWSTR* UnicodeString);
-
+
PUNICODE_STRING
WINAPI
Basep8BitStringToStaticUnicodeString(IN LPCSTR AnsiString);
@@ -232,14 +232,25 @@
WINAPI
Basep8BitStringToDynamicUnicodeString(OUT PUNICODE_STRING UnicodeString,
IN LPCSTR String);
-
-#define BasepUnicodeStringTo8BitString RtlUnicodeStringToAnsiString
typedef NTSTATUS (NTAPI *PRTL_CONVERT_STRING)(IN PUNICODE_STRING UnicodeString,
IN PANSI_STRING AnsiString,
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_STRINGA BasepUnicodeStringTo8BitString;
+extern PRTL_COUNT_STRING BasepUnicodeStringTo8BitSize;
+extern PRTL_COUNT_STRINGA Basep8BitStringToUnicodeSize;
+
extern HANDLE BaseNamedObjectDirectory;
HANDLE