mirror of
https://github.com/reactos/reactos.git
synced 2025-06-01 23:48:12 +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;
|
||||
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;
|
||||
if (pStringTable == NULL)
|
||||
{
|
||||
ERR("Invalid hStringTable!\n");
|
||||
return (DWORD)-1;
|
||||
return ~0u;
|
||||
}
|
||||
|
||||
/* Search for existing string in the string table */
|
||||
|
@ -625,10 +626,12 @@ StringTableLookUpStringEx(HSTRING_TABLE hStringTable,
|
|||
{
|
||||
if (!lstrcmpW(pStringTable->pSlots[i].pString, lpString))
|
||||
{
|
||||
memcpy(lpExtraData,
|
||||
pStringTable->pSlots[i].pData,
|
||||
pStringTable->pSlots[i].dwSize);
|
||||
*lpReserved = 0;
|
||||
if (lpExtraData)
|
||||
{
|
||||
memcpy(lpExtraData,
|
||||
pStringTable->pSlots[i].pData,
|
||||
pStringTable->pSlots[i].dwSize);
|
||||
}
|
||||
return i + 1;
|
||||
}
|
||||
}
|
||||
|
@ -636,10 +639,12 @@ StringTableLookUpStringEx(HSTRING_TABLE hStringTable,
|
|||
{
|
||||
if (!lstrcmpiW(pStringTable->pSlots[i].pString, lpString))
|
||||
{
|
||||
memcpy(lpExtraData,
|
||||
pStringTable->pSlots[i].pData,
|
||||
pStringTable->pSlots[i].dwSize);
|
||||
*lpReserved = 0;
|
||||
if (lpExtraData)
|
||||
{
|
||||
memcpy(lpExtraData,
|
||||
pStringTable->pSlots[i].pData,
|
||||
pStringTable->pSlots[i].dwSize);
|
||||
}
|
||||
return i + 1;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue