ReactOS  0.4.14-dev-384-g5b37caa
string_lib.cpp File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define STRING_BUFFER_ALIGNMENT   (32)
 
#define STRING_BUFFER_ALIGN(sz)   (((sz)+STRING_BUFFER_ALIGNMENT)&(~((ULONG)(STRING_BUFFER_ALIGNMENT-1))))
 

Functions

ULONG MyRtlCompareMemory (PVOID s1, PVOID s2, ULONG len)
 
ULONG RtlCompareUnicodeString (PUNICODE_STRING s1, PUNICODE_STRING s2, BOOLEAN UpCase)
 
NTSTATUS RtlUpcaseUnicodeString (PUNICODE_STRING dst, PUNICODE_STRING src, BOOLEAN Alloc)
 
NTSTATUS RtlAppendUnicodeToString (IN PUNICODE_STRING Str1, IN PWSTR Str2)
 

Macro Definition Documentation

◆ STRING_BUFFER_ALIGN

#define STRING_BUFFER_ALIGN (   sz)    (((sz)+STRING_BUFFER_ALIGNMENT)&(~((ULONG)(STRING_BUFFER_ALIGNMENT-1))))

Definition at line 25 of file string_lib.cpp.

◆ STRING_BUFFER_ALIGNMENT

#define STRING_BUFFER_ALIGNMENT   (32)

Definition at line 24 of file string_lib.cpp.

Function Documentation

◆ MyRtlCompareMemory()

ULONG MyRtlCompareMemory ( PVOID  s1,
PVOID  s2,
ULONG  len 
)

Definition at line 9 of file string_lib.cpp.

14 {
15  ULONG i;
16 
17  for(i=0; i<len; i++) {
18  if( ((char*)s1)[i] != ((char*)s2)[i] )
19  break;
20  }
21  return i;
22 }
struct S2 s2
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
struct S1 s1
GLenum GLsizei len
Definition: glext.h:6722
unsigned int ULONG
Definition: retypes.h:1

◆ RtlAppendUnicodeToString()

NTSTATUS RtlAppendUnicodeToString ( IN PUNICODE_STRING  Str1,
IN PWSTR  Str2 
)

Definition at line 62 of file string_lib.cpp.

66 {
67  PWCHAR tmp;
68  USHORT i;
69 
70 #ifdef _X86_
71 
72  __asm push ebx
73  __asm push esi
74  __asm xor ebx,ebx
75  __asm mov esi,Str2
76 Scan_1:
77  __asm cmp [word ptr esi+ebx],0
78  __asm je EO_Scan
79  __asm add ebx,2
80  __asm jmp Scan_1
81 EO_Scan:
82  __asm mov i,bx
83  __asm pop esi
84  __asm pop ebx
85 
86 #else // NO X86 optimization, use generic C/C++
87 
88  i=0;
89  while(Str2[i]) {
90  i++;
91  }
92  i *= sizeof(WCHAR);
93 
94 #endif // _X86_
95 
96  tmp = Str1->Buffer;
97  ASSERT(Str1->MaximumLength);
98  if((Str1->Length+i+sizeof(WCHAR)) > Str1->MaximumLength) {
99  PWCHAR tmp2 = (PWCHAR)ExAllocatePoolWithTag(NonPagedPool, STRING_BUFFER_ALIGN(i + Str1->Length + sizeof(WCHAR))*2, 'ilTS');
100  if(!tmp2)
102  memcpy(tmp2, tmp, Str1->MaximumLength);
103  ExFreePool(tmp);
104  tmp = tmp2;
105  Str1->MaximumLength = STRING_BUFFER_ALIGN(i + sizeof(WCHAR))*2;
106  Str1->Buffer = tmp;
107  }
108  RtlCopyMemory(((PCHAR)tmp)+Str1->Length, Str2, i);
109  i+=Str1->Length;
110  tmp[(i / sizeof(WCHAR))] = 0;
111  Str1->Length = i;
112 
113  return STATUS_SUCCESS;
114 
115 #undef UDF_UNC_STR_TAG
116 
117 } // end RtlAppendUnicodeToString()
signed char * PCHAR
Definition: retypes.h:7
int add
Definition: i386-dis.c:3122
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
static void xor(unsigned char *dst, const unsigned char *a, const unsigned char *b, const int count)
Definition: crypt_des.c:251
ecx edi ebx edx edi decl ecx esi eax jecxz decl eax andl eax esi movl edx movl TEMP incl eax andl eax ecx incl ebx eax jnz xchgl ecx incl TEMP esi
Definition: synth_sse3d.h:103
uint16_t * PWCHAR
Definition: typedefs.h:54
#define cmp(status, error)
Definition: error.c:114
static calc_node_t * pop(void)
Definition: rpn_ieee.c:90
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static PVOID ptr
Definition: dispmode.c:27
__wchar_t WCHAR
Definition: xmlstorage.h:180
ecx edi ebx edx edi decl ecx esi eax jecxz decl eax andl ebx
Definition: synth_sse3d.h:83
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned short USHORT
Definition: pedump.c:61
const WCHAR * word
Definition: lex.c:36
#define STRING_BUFFER_ALIGN(sz)
Definition: string_lib.cpp:25
static void push(calc_node_t *op)
Definition: rpn_ieee.c:113
return STATUS_SUCCESS
Definition: btrfs.c:2938
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
jmp_buf jmp
Definition: mach.c:35

Referenced by _Success_(), _test_key_name(), AddKbLayoutsToRegistry(), AppendUserEnvironmentVariable(), AtapiRegCheckParameterValue(), AVrfpLoadAndInitializeProvider(), BaseInitApphelp(), BuildSubSysCommandLine(), CdRomCheckRegistryForMediaChangeValue(), CmpAddDriverToList(), CmpFindDrivers(), CreateClassDeviceObject(), CreateProcessInternalW(), CsrApiPortInitialize(), CsrpConnectToServer(), CsrSbApiPortInitialize(), DriverEntry(), EngLoadImageEx(), ExpandSymbolicLink(), ExpLoadInitialProcess(), Ext2QueryRegistrySettings(), ExtractFont(), FFSQueryParameters(), FltpOpenFilterServicesKey(), GetComputerNameExW(), InitFunctionPtrs(), InitializeProvider(), InitTestData(), InsertAudioDevice(), IntCreateNewRegistryPath(), IntCreateRegistryPath(), IntGdiAddFontResourceEx(), IntGdiLoadFontsFromMemory(), IoOpenDeviceRegistryKey(), IopActionConfigureChildServices(), IopCreateDeviceInstancePath(), IopInitializeDriverModule(), IopOpenInterfaceKey(), IopQueryBusDescription(), IopQueryDeviceDescription(), IoQueryDeviceDescription(), IoRegisterDeviceInterface(), KsCacheMedium(), KsCreateBusEnumObject(), KspCreateObjectType(), LdrpInitializeProcess(), LogMessage(), NdisOpenProtocolConfiguration(), ReadRegistryEntries(), RegOpenUserClassesRoot(), RfsdQueryParameters(), RtlFormatCurrentUserKeyPath(), RtlpGetRegistryHandle(), SdbpMatchExe(), SdbpOpenKey(), SdbUnregisterDatabase(), SearchForLegacyDrivers(), SeiInitPaths(), SmpInvokeAutoChk(), SmpParseCommandLine(), START_TEST(), UDFRegCheckParameterValue(), UserpFormatMessages(), vfatGetFCBForFile(), vfatMakeFullName(), ViCreateDriveLetter(), ViLoadImagesFromRegistry(), W32kDosPathNameToNtPathName(), and WinLdrAddDriverToList().

◆ RtlCompareUnicodeString()

ULONG RtlCompareUnicodeString ( PUNICODE_STRING  s1,
PUNICODE_STRING  s2,
BOOLEAN  UpCase 
)

Definition at line 31 of file string_lib.cpp.

36 {
37  ULONG i;
38 
39  if(s1->Length != s2->Length) return (-1);
40  i = memcmp(s1->Buffer, s2->Buffer, (s1->Length) ? (s1->Length) : (s2->Length));
41  return i;
42 }
struct S2 s2
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
struct S1 s1
unsigned int ULONG
Definition: retypes.h:1

Referenced by _test_key_name(), ApphelpShimCacheCompareRoutine(), CheckForDeviceDesc(), CmpDoCompareKeyName(), CmpFindNameInList(), CmpFindValueByNameFromCache(), CmpIsHiveAlreadyLoaded(), CompareFileName(), CompareTreeKeys(), DeleteSymbolicLinkNameFromMemory(), Ext2FillEntry(), Ext2ParseRegistryVolumeParams(), Ext2QueryDirectory(), Ext2SearchMcbWithoutLock(), FFSQueryDirectory(), FFSSearchMcb(), FFSv1ScanDir(), FFSv2ScanDir(), FindMatchingCreateItem(), FltpAttachToFileSystemDevice(), FsRtlCompareNodeAndKey(), has_nfs_prefix(), InitFunctionPtrs(), IntFindAliasHeader(), IntFindWindow(), IntGetAliasEntry(), IntInsertAliasEntry(), IntInsertAliasHeader(), IopEnumerateDetectedDevices(), IopNotifyPlugPlayNotification(), IsBatteryAlreadyOnList(), KernelModeTest(), LocateAdapterBindingByName(), map_sec_flavor(), MatchFontName(), MiniLocateDevice(), MountMgrMountedDeviceRemoval(), MountMgrNextDriveLetterWorker(), MountMgrNotifyNameChange(), MsfsCreate(), MsfsCreateMailslot(), NdisCompareUnicodeString(), nfs41_SetFileInformation(), NtUserFindExistingCursorIcon(), NtUserFindWindowEx(), RemoveBatteryFromList(), RfsdDirectoryCallback(), RfsdScanDirCallback(), RfsdSearchMcb(), RtlSetEnvironmentVariable(), SmpFindRegistryValue(), SmpSaveRegistryValue(), START_TEST(), Test_KeyNameInformation(), TestFltRegisterFilter(), TestFsRtlAddToTunnelCache(), TestIoCreateFile(), TestIrpHandler(), TestSymlinks(), UDFBuildHashEntry(), UDFCompareFileInfo(), UDFCompareVcb(), UDFFindFile(), UDFIsNameInExpression(), VfatVerify(), and wmain().

◆ RtlUpcaseUnicodeString()

NTSTATUS RtlUpcaseUnicodeString ( PUNICODE_STRING  dst,
PUNICODE_STRING  src,
BOOLEAN  Alloc 
)