Commit 18b5366c authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

setupapi: Implement StringTableLookUpStringEx.

parent 8a976a7d
......@@ -446,35 +446,40 @@ StringTableGetExtraData(HSTRING_TABLE hStringTable,
/**************************************************************************
* StringTableLookUpString [SETUPAPI.@]
* StringTableLookUpStringEx [SETUPAPI.@]
*
* Searches a string table for a given string.
* Searches a string table and extra data for a given string.
*
* PARAMS
* hStringTable [I] Handle to the string table
* lpString [I] String to be searched for
* dwFlags [I] Flags
* 1: case sensitive compare
* lpExtraData [O] Pointer to the buffer that receives the extra data
* lpReserved [I/O] Unused
*
* RETURNS
* Success: String ID
* Failure: -1
*/
DWORD WINAPI
StringTableLookUpString(HSTRING_TABLE hStringTable,
LPWSTR lpString,
DWORD dwFlags)
StringTableLookUpStringEx(HSTRING_TABLE hStringTable,
LPWSTR lpString,
DWORD dwFlags,
LPVOID lpExtraData,
LPDWORD lpReserved)
{
PSTRING_TABLE pStringTable;
DWORD i;
TRACE("%p %s %x\n", hStringTable, debugstr_w(lpString), dwFlags);
TRACE("%p %s %x %p, %p\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 */
......@@ -485,46 +490,48 @@ StringTableLookUpString(HSTRING_TABLE hStringTable,
if (dwFlags & 1)
{
if (!lstrcmpW(pStringTable->pSlots[i].pString, lpString))
{
if (lpExtraData)
memcpy(lpExtraData, pStringTable->pSlots[i].pData, pStringTable->pSlots[i].dwSize);
return i + 1;
}
}
else
{
if (!lstrcmpiW(pStringTable->pSlots[i].pString, lpString))
{
if (lpExtraData)
memcpy(lpExtraData, pStringTable->pSlots[i].pData, pStringTable->pSlots[i].dwSize);
return i + 1;
}
}
}
}
return (DWORD)-1;
return ~0u;
}
/**************************************************************************
* StringTableLookUpStringEx [SETUPAPI.@]
* StringTableLookUpString [SETUPAPI.@]
*
* Searches a string table and extra data for a given string.
* Searches a string table for a given string.
*
* PARAMS
* hStringTable [I] Handle to the string table
* lpString [I] String to be searched for
* dwFlags [I] Flags
* 1: case sensitive compare
* lpExtraData [O] Pointer to the buffer that receives the extra data
* lpReserved [I/O] Unused
*
* RETURNS
* Success: String ID
* Failure: -1
* Failure: ~0u
*/
DWORD WINAPI
StringTableLookUpStringEx(HSTRING_TABLE hStringTable,
LPWSTR lpString,
DWORD dwFlags,
LPVOID lpExtraData,
LPDWORD lpReserved)
StringTableLookUpString(HSTRING_TABLE hStringTable,
LPWSTR lpString,
DWORD dwFlags)
{
FIXME("\n");
return (DWORD)-1;
return StringTableLookUpStringEx(hStringTable, lpString, dwFlags, NULL, NULL);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment