- Implement large ansi unicode string support. Not sure if we need to add it in win32k.

svn path=/trunk/; revision=38543
This commit is contained in:
James Tabor 2009-01-04 05:06:14 +00:00
parent 831afe52e7
commit e5a50d7176
4 changed files with 101 additions and 3 deletions

View file

@ -0,0 +1,65 @@
/*
* PROJECT: ReactOS user32.dll
* FILE: lib/user32/misc/rtlstr.c
* PURPOSE: Large Strings
* PROGRAMMER:
* UPDATE HISTORY:
*
*/
/* INCLUDES ******************************************************************/
#include <user32.h>
#include <wine/debug.h>
WINE_DEFAULT_DEBUG_CHANNEL(user32);
/* FUNCTIONS *****************************************************************/
VOID
NTAPI
RtlInitLargeAnsiString(IN OUT PLARGE_ANSI_STRING DestinationString,
IN PCSZ SourceString,
IN INT Unknown)
{
ULONG DestSize;
if (SourceString)
{
DestSize = strlen(SourceString);
DestinationString->Length = DestSize;
DestinationString->MaximumLength = DestSize + sizeof(CHAR);
}
else
{
DestinationString->Length = 0;
DestinationString->MaximumLength = 0;
}
DestinationString->Buffer = (PCHAR)SourceString;
DestinationString->bAnsi = TRUE;
}
VOID
NTAPI
RtlInitLargeUnicodeString(IN OUT PLARGE_UNICODE_STRING DestinationString,
IN PCWSTR SourceString,
IN INT Unknown)
{
ULONG DestSize;
if (SourceString)
{
DestSize = wcslen(SourceString) * sizeof(WCHAR);
DestinationString->Length = DestSize;
DestinationString->MaximumLength = DestSize + sizeof(WCHAR);
}
else
{
DestinationString->Length = 0;
DestinationString->MaximumLength = 0;
}
DestinationString->Buffer = (PWSTR)SourceString;
DestinationString->bAnsi = FALSE;
}

View file

@ -40,6 +40,7 @@
<file>misc.c</file>
<file>object.c</file>
<file>resources.c</file>
<file>rtlstr.c</file>
<file>stubs.c</file>
<file>timer.c</file>
<file>winhelp.c</file>

View file

@ -48,6 +48,7 @@ VOID NTAPI W32kRaiseStatus(NTSTATUS Status);
#define ProbeForWriteLargeInteger(Ptr) ProbeForWriteGenericType(&((PLARGE_INTEGER)Ptr)->QuadPart, LONGLONG)
#define ProbeForWriteUlargeInteger(Ptr) ProbeForWriteGenericType(&((PULARGE_INTEGER)Ptr)->QuadPart, ULONGLONG)
#define ProbeForWriteUnicodeString(Ptr) ProbeForWriteGenericType((PUNICODE_STRING)Ptr, UNICODE_STRING)
#define ProbeForWriteLargeString(Ptr) ProbeForWriteGenericType((PLARGE_STRING)Ptr, LARGE_STRING)
#define ProbeForWriteIoStatusBlock(Ptr) ProbeForWriteGenericType((PIO_STATUS_BLOCK)Ptr, IO_STATUS_BLOCK)
#define ProbeForReadGenericType(Ptr, Type, Default) \
@ -74,6 +75,7 @@ VOID NTAPI W32kRaiseStatus(NTSTATUS Status);
#define ProbeForReadLargeInteger(Ptr) ProbeForReadGenericType((const LARGE_INTEGER *)(Ptr), LARGE_INTEGER, __emptyLargeInteger)
#define ProbeForReadUlargeInteger(Ptr) ProbeForReadGenericType((const ULARGE_INTEGER *)(Ptr), ULARGE_INTEGER, __emptyULargeInteger)
#define ProbeForReadUnicodeString(Ptr) ProbeForReadGenericType((const UNICODE_STRING *)(Ptr), UNICODE_STRING, __emptyUnicodeString)
#define ProbeForReadLargeString(Ptr) ProbeForReadGenericType((const LARGE_STRING *)(Ptr), LARGE_STRING, __emptyLargeString)
#define ProbeForReadIoStatusBlock(Ptr) ProbeForReadGenericType((const IO_STATUS_BLOCK *)(Ptr), IO_STATUS_BLOCK, __emptyIoStatusBlock)
#define ProbeAndZeroHandle(Ptr) \

View file

@ -5,6 +5,36 @@ struct _W32PROCESSINFO;
struct _W32THREADINFO;
struct _WINDOW;
typedef struct _LARGE_UNICODE_STRING
{
ULONG Length;
ULONG MaximumLength:31;
ULONG bAnsi:1;
PWSTR Buffer;
} LARGE_UNICODE_STRING, *PLARGE_UNICODE_STRING;
typedef struct _LARGE_STRING
{
ULONG Length;
ULONG MaximumLength:31;
ULONG bAnsi:1;
PVOID Buffer;
} LARGE_STRING, *PLARGE_STRING;
//
// Based on ANSI_STRING
//
typedef struct _LARGE_ANSI_STRING
{
ULONG Length;
ULONG MaximumLength:31;
ULONG bAnsi:1;
PCHAR Buffer;
} LARGE_ANSI_STRING, *PLARGE_ANSI_STRING;
VOID NTAPI RtlInitLargeAnsiString(IN OUT PLARGE_ANSI_STRING,IN PCSZ,IN INT);
VOID NTAPI RtlInitLargeUnicodeString(IN OUT PLARGE_UNICODE_STRING,IN PCWSTR,IN INT);
/* FIXME: UserHMGetHandle needs to be updated once the new handle manager is implemented */
#define UserHMGetHandle(obj) ((obj)->hdr.Handle)
@ -1086,9 +1116,9 @@ HWND
NTAPI
NtUserCreateWindowEx(
DWORD dwExStyle,
PLARGE_UNICODE_STRING plustrClassName,
PLARGE_UNICODE_STRING plustrClsVesrion,
PLARGE_UNICODE_STRING plustrWindowName,
PLARGE_STRING plstrClassName,
PLARGE_STRING plstrClsVesrion,
PLARGE_STRING plstrWindowName,
DWORD dwStyle,
int x,
int y,