wbemprox: Handle escaped backslashes in LIKE queries.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50256
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit d4032d69f6)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
This commit is contained in:
Hans Leidekker 2021-01-21 12:36:41 +01:00 committed by Michael Stefaniuc
parent 11b0d87c17
commit feed1f0efb
2 changed files with 11 additions and 0 deletions

View File

@ -93,6 +93,7 @@ static BOOL eval_like( const WCHAR *lstr, const WCHAR *rstr )
while (*p && *q)
{
if (q[0] == '\\' && q[1] == '\\') q++;
if (*q == '%')
{
while (*q == '%') q++;

View File

@ -1171,6 +1171,16 @@ static void test_Win32_NetworkAdapter( IWbemServices *services )
IEnumWbemClassObject_Release( result );
SysFreeString( query );
query = SysAllocString( L"SELECT * FROM Win32_NetworkAdapter WHERE PNPDeviceID LIKE \"PCI\\\\%\"" );
hr = IWbemServices_ExecQuery( services, wql, query, 0, NULL, &result );
ok( hr == S_OK, "got %08x\n", hr );
SysFreeString( query );
query = SysAllocString( L"SELECT * FROM Win32_NetworkAdapter WHERE PNPDeviceID LIKE \"PCI\\%\"" );
hr = IWbemServices_ExecQuery( services, wql, query, 0, NULL, &result );
todo_wine ok( hr == WBEM_E_INVALID_QUERY, "got %08x\n", hr );
SysFreeString( query );
SysFreeString( wql );
}