mirror of
https://github.com/reactos/reactos.git
synced 2025-06-10 20:34:59 +00:00
don't crash on setupapi stringtable winetest
svn path=/trunk/; revision=40561
This commit is contained in:
parent
f8cbb14378
commit
c116c45760
1 changed files with 15 additions and 10 deletions
|
@ -607,13 +607,14 @@ StringTableLookUpStringEx(HSTRING_TABLE hStringTable,
|
||||||
PSTRING_TABLE pStringTable;
|
PSTRING_TABLE pStringTable;
|
||||||
DWORD i;
|
DWORD i;
|
||||||
|
|
||||||
TRACE("%p %s %lx\n", (PVOID)hStringTable, debugstr_w(lpString), dwFlags);
|
TRACE("%p %s %x %p, %x\n", hStringTable, debugstr_w(lpString), dwFlags,
|
||||||
|
lpExtraData, lpReserved);
|
||||||
|
|
||||||
pStringTable = (PSTRING_TABLE)hStringTable;
|
pStringTable = (PSTRING_TABLE)hStringTable;
|
||||||
if (pStringTable == NULL)
|
if (pStringTable == NULL)
|
||||||
{
|
{
|
||||||
ERR("Invalid hStringTable!\n");
|
ERR("Invalid hStringTable!\n");
|
||||||
return (DWORD)-1;
|
return ~0u;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Search for existing string in the string table */
|
/* Search for existing string in the string table */
|
||||||
|
@ -624,22 +625,26 @@ StringTableLookUpStringEx(HSTRING_TABLE hStringTable,
|
||||||
if (dwFlags & 1)
|
if (dwFlags & 1)
|
||||||
{
|
{
|
||||||
if (!lstrcmpW(pStringTable->pSlots[i].pString, lpString))
|
if (!lstrcmpW(pStringTable->pSlots[i].pString, lpString))
|
||||||
|
{
|
||||||
|
if (lpExtraData)
|
||||||
{
|
{
|
||||||
memcpy(lpExtraData,
|
memcpy(lpExtraData,
|
||||||
pStringTable->pSlots[i].pData,
|
pStringTable->pSlots[i].pData,
|
||||||
pStringTable->pSlots[i].dwSize);
|
pStringTable->pSlots[i].dwSize);
|
||||||
*lpReserved = 0;
|
}
|
||||||
return i + 1;
|
return i + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!lstrcmpiW(pStringTable->pSlots[i].pString, lpString))
|
if (!lstrcmpiW(pStringTable->pSlots[i].pString, lpString))
|
||||||
|
{
|
||||||
|
if (lpExtraData)
|
||||||
{
|
{
|
||||||
memcpy(lpExtraData,
|
memcpy(lpExtraData,
|
||||||
pStringTable->pSlots[i].pData,
|
pStringTable->pSlots[i].pData,
|
||||||
pStringTable->pSlots[i].dwSize);
|
pStringTable->pSlots[i].dwSize);
|
||||||
*lpReserved = 0;
|
}
|
||||||
return i + 1;
|
return i + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue