ReactOS 0.4.15-dev-7924-g5949c20
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}
GLenum GLsizei len
Definition: glext.h:6722
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
struct S2 s2
uint32_t ULONG
Definition: typedefs.h:59

◆ 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
76Scan_1:
77 __asm cmp [word ptr esi+ebx],0
78 __asm je EO_Scan
79 __asm add ebx,2
80 __asm jmp Scan_1
81EO_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()
static void xor(unsigned char *dst, const unsigned char *a, const unsigned char *b, const int count)
Definition: crypt_des.c:251
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
#define NonPagedPool
Definition: env_spec_w32.h:307
const WCHAR * word
Definition: lex.c:36
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define ASSERT(a)
Definition: mode.c:44
static PVOID ptr
Definition: dispmode.c:27
#define cmp(status, error)
Definition: error.c:114
unsigned short USHORT
Definition: pedump.c:61
static calc_node_t * pop(void)
Definition: rpn_ieee.c:90
static void push(calc_node_t *op)
Definition: rpn_ieee.c:113
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STRING_BUFFER_ALIGN(sz)
Definition: string_lib.cpp:25
ecx edi movl ebx edx edi decl ecx esi eax jecxz decl eax andl ebx
Definition: synth_sse3d.h:83
ecx edi movl ebx edx edi decl ecx esi eax jecxz decl eax andl eax esi movl edx movl TEMP incl eax andl eax ecx incl ebx testl eax jnz xchgl ecx incl TEMP esi
Definition: synth_sse3d.h:103
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
uint16_t * PWCHAR
Definition: typedefs.h:56
char * PCHAR
Definition: typedefs.h:51
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
__wchar_t WCHAR
Definition: xmlstorage.h:180

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

◆ 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}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112

Referenced by _test_key_name(), ApphelpShimCacheCompareRoutine(), CheckForDeviceDesc(), CmpCompareSubkeys(), CmpDoCompareKeyName(), CmpFindNameInList(), CmpFindValueByNameFromCache(), CmpIsHiveAlreadyLoaded(), CmpValidateLexicalOrder(), CompareFileName(), CNtObjectFolder::CompareIDs(), CompareTreeKeys(), DeleteSymbolicLinkNameFromMemory(), Ext2FillEntry(), Ext2ParseRegistryVolumeParams(), Ext2QueryDirectory(), Ext2SearchMcbWithoutLock(), FindMatchingCreateItem(), FltpAttachToFileSystemDevice(), FsRtlCompareNodeAndKey(), FxVerifyAllocateDebugInfo(), has_nfs_prefix(), InitFunctionPtrs(), IntFindAliasHeader(), IntFindWindow(), IntGetAliasEntry(), IntInsertAliasEntry(), IntInsertAliasHeader(), IopMapDetectedDeviceId(), IopMapPeripheralId(), IsBatteryAlreadyOnList(), KernelModeTest(), LocateAdapterBindingByName(), map_sec_flavor(), MatchFontName(), MiniLocateDevice(), MountMgrMountedDeviceRemoval(), MountMgrNextDriveLetterWorker(), MountMgrNotifyNameChange(), MsfsCreate(), MsfsCreateMailslot(), NdisCompareUnicodeString(), nfs41_SetFileInformation(), NtUserFindExistingCursorIcon(), NtUserFindWindowEx(), RemoveBatteryFromList(), RtlGetNtProductType(), RtlSetEnvironmentVariable(), SmpFindRegistryValue(), SmpSaveRegistryValue(), START_TEST(), Test_KeyNameInformation(), TestFltRegisterFilter(), TestFsRtlAddToTunnelCache(), TestIoCreateFile(), TestIrpHandler(), TestSymlinks(), UDFBuildHashEntry(), UDFCompareFileInfo(), UDFCompareVcb(), UDFFindFile(), UDFIsNameInExpression(), VfatVerify(), WinLdrLoadNLSData(), and wmain().

◆ RtlUpcaseUnicodeString()