ReactOS 0.4.15-dev-7942-gd23573b
rtlstr.c File Reference
#include <win32k.h>
Include dependency graph for rtlstr.c:

Go to the source code of this file.

Functions

VOID NTAPI RtlInitLargeAnsiString (IN OUT PLARGE_ANSI_STRING DestinationString, IN PCSZ SourceString, IN INT Unknown)
 
VOID NTAPI RtlInitLargeUnicodeString (IN OUT PLARGE_UNICODE_STRING DestinationString, IN PCWSTR SourceString, IN INT Unknown)
 
BOOL NTAPI RtlLargeStringToUnicodeString (PUNICODE_STRING DestinationString, PLARGE_STRING SourceString)
 

Function Documentation

◆ RtlInitLargeAnsiString()

VOID NTAPI RtlInitLargeAnsiString ( IN OUT PLARGE_ANSI_STRING  DestinationString,
IN PCSZ  SourceString,
IN INT  Unknown 
)

Definition at line 17 of file rtlstr.c.

21{
22 USHORT DestSize;
23
24 if (SourceString)
25 {
26 DestSize = (USHORT)strlen(SourceString);
27 DestinationString->Length = DestSize;
28 DestinationString->MaximumLength = DestSize + sizeof(CHAR);
29 }
30 else
31 {
34 }
35
37 DestinationString->bAnsi = TRUE;
38}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define CHAR(Char)
#define TRUE
Definition: types.h:120
#define PCHAR
Definition: match.c:90
_Out_ _Inout_ POEM_STRING _In_ PCUNICODE_STRING SourceString
Definition: rtlfuncs.h:1910
_Out_ _Inout_ POEM_STRING DestinationString
Definition: rtlfuncs.h:1909
unsigned short USHORT
Definition: pedump.c:61
unsigned short Length
Definition: sprintf.c:451
void * Buffer
Definition: sprintf.c:453
unsigned short MaximumLength
Definition: sprintf.c:452

Referenced by DefSetText(), and RtlInitLargeString().

◆ RtlInitLargeUnicodeString()

VOID NTAPI RtlInitLargeUnicodeString ( IN OUT PLARGE_UNICODE_STRING  DestinationString,
IN PCWSTR  SourceString,
IN INT  Unknown 
)

Definition at line 42 of file rtlstr.c.

46{
47 USHORT DestSize;
48
49 if (SourceString)
50 {
51 DestSize = (USHORT)wcslen(SourceString) * sizeof(WCHAR);
52 DestinationString->Length = DestSize;
53 DestinationString->MaximumLength = DestSize + sizeof(WCHAR);
54 }
55 else
56 {
59 }
60
62 DestinationString->bAnsi = FALSE;
63}
#define FALSE
Definition: types.h:117
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
uint16_t * PWSTR
Definition: typedefs.h:56
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by co_IntCreateDefaultImeWindow(), DefSetText(), and RtlInitLargeString().

◆ RtlLargeStringToUnicodeString()

BOOL NTAPI RtlLargeStringToUnicodeString ( PUNICODE_STRING  DestinationString,
PLARGE_STRING  SourceString 
)

Definition at line 67 of file rtlstr.c.

70{
72
73 /* Check parameters */
74 if (!DestinationString || !SourceString) return FALSE;
75
76 /* Check if size if ok */
77 // We can't do this atm and truncate the string instead.
78 //if (SourceString->Length > 0xffff) return FALSE;
79
81
82 if (SourceString->bAnsi)
83 {
86 }
87 else
88 {
90 }
91}
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
@ AnsiString
Definition: dnslib.h:19
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
char * LPSTR
Definition: xmlstorage.h:182