ReactOS  0.4.12-dev-919-gfc3b8d5
rtlstr.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS win32k.sys
3  * FILE: win32ss/user/ntuser/misc/rtlstr.c
4  * PURPOSE: Large Strings
5  * PROGRAMMER:
6  *
7  */
8 
9 /* INCLUDES ******************************************************************/
10 
11 #include <win32k.h>
12 
13 /* FUNCTIONS *****************************************************************/
14 
15 VOID
16 NTAPI
20  IN INT Unknown)
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 }
39 
40 VOID
41 NTAPI
45  IN INT Unknown)
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 }
64 
65 BOOL
66 NTAPI
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 }
92 
CONST char * PCSZ
Definition: umtypes.h:125
const uint16_t * PCWSTR
Definition: typedefs.h:55
#define IN
Definition: typedefs.h:38
static CHAR(WINAPI *pRtlUpperChar)(CHAR)
#define TRUE
Definition: types.h:120
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
uint16_t * PWSTR
Definition: typedefs.h:54
unsigned short Length
Definition: sprintf.c:451
char * LPSTR
Definition: xmlstorage.h:182
int32_t INT
Definition: typedefs.h:56
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
void * Buffer
Definition: sprintf.c:453
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
unsigned int BOOL
Definition: ntddk_ex.h:94
_Out_ _Inout_ POEM_STRING DestinationString
Definition: rtlfuncs.h:1869
smooth NULL
Definition: ftsmooth.c:416
VOID NTAPI RtlInitLargeAnsiString(IN OUT PLARGE_ANSI_STRING DestinationString, IN PCSZ SourceString, IN INT Unknown)
Definition: rtlstr.c:17
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
_Out_ _Inout_ POEM_STRING _In_ PCUNICODE_STRING SourceString
Definition: rtlfuncs.h:1869
static int *static WCHAR(WINAPI *pRtlUpcaseUnicodeChar)(WCHAR)
unsigned short USHORT
Definition: pedump.c:61
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
BOOL NTAPI RtlLargeStringToUnicodeString(PUNICODE_STRING DestinationString, PLARGE_STRING SourceString)
Definition: rtlstr.c:67
VOID NTAPI RtlInitLargeUnicodeString(IN OUT PLARGE_UNICODE_STRING DestinationString, IN PCWSTR SourceString, IN INT Unknown)
Definition: rtlstr.c:42
#define OUT
Definition: typedefs.h:39
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
unsigned short MaximumLength
Definition: sprintf.c:452
static PCHAR
Definition: rtlstr.c:59
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)