mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 11:33:35 +00:00
- 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:
parent
831afe52e7
commit
e5a50d7176
4 changed files with 101 additions and 3 deletions
65
reactos/dll/win32/user32/misc/rtlstr.c
Normal file
65
reactos/dll/win32/user32/misc/rtlstr.c
Normal 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;
|
||||||
|
}
|
|
@ -40,6 +40,7 @@
|
||||||
<file>misc.c</file>
|
<file>misc.c</file>
|
||||||
<file>object.c</file>
|
<file>object.c</file>
|
||||||
<file>resources.c</file>
|
<file>resources.c</file>
|
||||||
|
<file>rtlstr.c</file>
|
||||||
<file>stubs.c</file>
|
<file>stubs.c</file>
|
||||||
<file>timer.c</file>
|
<file>timer.c</file>
|
||||||
<file>winhelp.c</file>
|
<file>winhelp.c</file>
|
||||||
|
|
|
@ -48,6 +48,7 @@ VOID NTAPI W32kRaiseStatus(NTSTATUS Status);
|
||||||
#define ProbeForWriteLargeInteger(Ptr) ProbeForWriteGenericType(&((PLARGE_INTEGER)Ptr)->QuadPart, LONGLONG)
|
#define ProbeForWriteLargeInteger(Ptr) ProbeForWriteGenericType(&((PLARGE_INTEGER)Ptr)->QuadPart, LONGLONG)
|
||||||
#define ProbeForWriteUlargeInteger(Ptr) ProbeForWriteGenericType(&((PULARGE_INTEGER)Ptr)->QuadPart, ULONGLONG)
|
#define ProbeForWriteUlargeInteger(Ptr) ProbeForWriteGenericType(&((PULARGE_INTEGER)Ptr)->QuadPart, ULONGLONG)
|
||||||
#define ProbeForWriteUnicodeString(Ptr) ProbeForWriteGenericType((PUNICODE_STRING)Ptr, UNICODE_STRING)
|
#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 ProbeForWriteIoStatusBlock(Ptr) ProbeForWriteGenericType((PIO_STATUS_BLOCK)Ptr, IO_STATUS_BLOCK)
|
||||||
|
|
||||||
#define ProbeForReadGenericType(Ptr, Type, Default) \
|
#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 ProbeForReadLargeInteger(Ptr) ProbeForReadGenericType((const LARGE_INTEGER *)(Ptr), LARGE_INTEGER, __emptyLargeInteger)
|
||||||
#define ProbeForReadUlargeInteger(Ptr) ProbeForReadGenericType((const ULARGE_INTEGER *)(Ptr), ULARGE_INTEGER, __emptyULargeInteger)
|
#define ProbeForReadUlargeInteger(Ptr) ProbeForReadGenericType((const ULARGE_INTEGER *)(Ptr), ULARGE_INTEGER, __emptyULargeInteger)
|
||||||
#define ProbeForReadUnicodeString(Ptr) ProbeForReadGenericType((const UNICODE_STRING *)(Ptr), UNICODE_STRING, __emptyUnicodeString)
|
#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 ProbeForReadIoStatusBlock(Ptr) ProbeForReadGenericType((const IO_STATUS_BLOCK *)(Ptr), IO_STATUS_BLOCK, __emptyIoStatusBlock)
|
||||||
|
|
||||||
#define ProbeAndZeroHandle(Ptr) \
|
#define ProbeAndZeroHandle(Ptr) \
|
||||||
|
|
|
@ -5,6 +5,36 @@ struct _W32PROCESSINFO;
|
||||||
struct _W32THREADINFO;
|
struct _W32THREADINFO;
|
||||||
struct _WINDOW;
|
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 */
|
/* FIXME: UserHMGetHandle needs to be updated once the new handle manager is implemented */
|
||||||
#define UserHMGetHandle(obj) ((obj)->hdr.Handle)
|
#define UserHMGetHandle(obj) ((obj)->hdr.Handle)
|
||||||
|
|
||||||
|
@ -1086,9 +1116,9 @@ HWND
|
||||||
NTAPI
|
NTAPI
|
||||||
NtUserCreateWindowEx(
|
NtUserCreateWindowEx(
|
||||||
DWORD dwExStyle,
|
DWORD dwExStyle,
|
||||||
PLARGE_UNICODE_STRING plustrClassName,
|
PLARGE_STRING plstrClassName,
|
||||||
PLARGE_UNICODE_STRING plustrClsVesrion,
|
PLARGE_STRING plstrClsVesrion,
|
||||||
PLARGE_UNICODE_STRING plustrWindowName,
|
PLARGE_STRING plstrWindowName,
|
||||||
DWORD dwStyle,
|
DWORD dwStyle,
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue