krnl386.exe16: Don't use strncasecmp.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2019-04-02 16:52:01 +02:00 committed by Alexandre Julliard
parent cef4d3465b
commit ea4d756cbd
4 changed files with 9 additions and 9 deletions

View File

@ -108,7 +108,7 @@ static WORD ATOM_Hash(
TRACE("%x, %s, %x\n", entries, str, len); TRACE("%x, %s, %x\n", entries, str, len);
for (i = 0; i < len; i++) hash ^= toupper(str[i]) + i; for (i = 0; i < len; i++) hash ^= RtlUpperChar(str[i]) + i;
return hash % entries; return hash % entries;
} }
@ -223,7 +223,7 @@ ATOM WINAPI AddAtom16( LPCSTR str )
{ {
entryPtr = ATOM_MakePtr( entry ); entryPtr = ATOM_MakePtr( entry );
if ((entryPtr->length == len) && if ((entryPtr->length == len) &&
(!strncasecmp( entryPtr->str, buffer, len ))) (!_strnicmp( entryPtr->str, buffer, len )))
{ {
entryPtr->refCount++; entryPtr->refCount++;
TRACE("-- existing 0x%x\n", entry); TRACE("-- existing 0x%x\n", entry);
@ -310,7 +310,7 @@ ATOM WINAPI FindAtom16( LPCSTR str )
{ {
ATOMENTRY * entryPtr = ATOM_MakePtr( entry ); ATOMENTRY * entryPtr = ATOM_MakePtr( entry );
if ((entryPtr->length == len) && if ((entryPtr->length == len) &&
(!strncasecmp( entryPtr->str, str, len ))) (!_strnicmp( entryPtr->str, str, len )))
{ {
TRACE("-- found %x\n", entry); TRACE("-- found %x\n", entry);
return HANDLETOATOM( entry ); return HANDLETOATOM( entry );

View File

@ -1455,7 +1455,7 @@ HMODULE16 WINAPI GetModuleHandle16( LPCSTR name )
if (pModule->ne_flags & NE_FFLAGS_WIN32) continue; if (pModule->ne_flags & NE_FFLAGS_WIN32) continue;
name_table = (BYTE *)pModule + pModule->ne_restab; name_table = (BYTE *)pModule + pModule->ne_restab;
/* FIXME: the strncasecmp is WRONG. It should not be case insensitive, /* FIXME: the _strnicmp is WRONG. It should not be case insensitive,
* but case sensitive! (Unfortunately Winword 6 and subdlls have * but case sensitive! (Unfortunately Winword 6 and subdlls have
* lowercased module names, but try to load uppercase DLLs, so this * lowercased module names, but try to load uppercase DLLs, so this
* 'i' compare is just a quickfix until the loader handles that * 'i' compare is just a quickfix until the loader handles that

View File

@ -213,7 +213,7 @@ static DWORD NE_FindNameTableId( NE_MODULE *pModule, LPCSTR typeId, LPCSTR resId
if (p[1] & 0x8000) if (p[1] & 0x8000)
{ {
if (!HIWORD(typeId)) continue; if (!HIWORD(typeId)) continue;
if (strcasecmp( typeId, (char *)(p + 3) )) continue; if (_strnicmp( typeId, (char *)(p + 3), -1 )) continue;
} }
else if (HIWORD(typeId) || (((DWORD)typeId & ~0x8000)!= p[1])) else if (HIWORD(typeId) || (((DWORD)typeId & ~0x8000)!= p[1]))
continue; continue;
@ -223,7 +223,7 @@ static DWORD NE_FindNameTableId( NE_MODULE *pModule, LPCSTR typeId, LPCSTR resId
if (p[2] & 0x8000) if (p[2] & 0x8000)
{ {
if (!HIWORD(resId)) continue; if (!HIWORD(resId)) continue;
if (strcasecmp( resId, (char*)(p+3)+strlen((char*)(p+3))+1 )) continue; if (_strnicmp( resId, (char*)(p+3)+strlen((char*)(p+3))+1, -1 )) continue;
} }
else if (HIWORD(resId) || ((LOWORD(resId) & ~0x8000) != p[2])) else if (HIWORD(resId) || ((LOWORD(resId) & ~0x8000) != p[2]))
@ -261,7 +261,7 @@ static NE_TYPEINFO *NE_FindTypeSection( LPBYTE pResTab, NE_TYPEINFO *pTypeInfo,
if (!(pTypeInfo->type_id & 0x8000)) if (!(pTypeInfo->type_id & 0x8000))
{ {
BYTE *p = pResTab + pTypeInfo->type_id; BYTE *p = pResTab + pTypeInfo->type_id;
if ((*p == len) && !strncasecmp( (char*)p+1, str, len )) if ((*p == len) && !_strnicmp( (char*)p+1, str, len ))
{ {
TRACE(" Found type '%s'\n", str ); TRACE(" Found type '%s'\n", str );
return pTypeInfo; return pTypeInfo;
@ -308,7 +308,7 @@ static NE_NAMEINFO *NE_FindResourceFromType( LPBYTE pResTab, NE_TYPEINFO *pTypeI
{ {
if (pNameInfo->id & 0x8000) continue; if (pNameInfo->id & 0x8000) continue;
p = pResTab + pNameInfo->id; p = pResTab + pNameInfo->id;
if ((*p == len) && !strncasecmp( (char*)p+1, str, len )) if ((*p == len) && !_strnicmp( (char*)p+1, str, len ))
return pNameInfo; return pNameInfo;
} }
} }

View File

@ -224,7 +224,7 @@ SNOOP16_GetProcAddress16(HMODULE16 hmod,DWORD ordinal,FARPROC16 origfun) {
if (strchr(fun->name,'_')) { if (strchr(fun->name,'_')) {
char *s=strchr(fun->name,'_'); char *s=strchr(fun->name,'_');
if (!strncasecmp(s,"_thunkdata",10)) { if (!_strnicmp(s,"_thunkdata",10)) {
HeapFree(GetProcessHeap(),0,fun->name); HeapFree(GetProcessHeap(),0,fun->name);
fun->name = NULL; fun->name = NULL;
return origfun; return origfun;