[PATCH] wbemprox: Return WBEM_E_ACCESS_DENIED from IEnumWbemClassObject::Next() if the object is empty.

Dmitry Timoshkov dmitry at baikal.ru
Mon Jul 8 04:37:03 CDT 2019


Hans Leidekker <hans at codeweavers.com> wrote:

> > > > +static void test_Win32_QuickFixEngineering( IWbemServices *services )
> > > > +{
> > > > +    static const WCHAR queryW[] =
> > > > +        {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
> > > > +         'W','i','n','3','2','_','Q','u','i','c','k','F','i','x','E','n','g','i','n','e','e','r','i','n','g',' ',
> > > > +         'W','H','E','R','E',' ','H','o','t','F','i','x','I','D','=','\"','0','x','d','e','a','d','b','e','e','f','\"',0};
> > > > +    BSTR wql = SysAllocString( wqlW ), query = SysAllocString( queryW );
> > > > +    HRESULT hr;
> > > > +    IEnumWbemClassObject *result;
> > > > +    IWbemClassObject *obj;
> > > > +    ULONG count;
> > > > +
> > > > +    hr = IWbemServices_ExecQuery( services, wql, query, 0, NULL, &result );
> > > > +    ok( hr == S_OK, "got %08x\n", hr );
> > > > +
> > > > +    count = 0xdeadbeef;
> > > > +    hr = IEnumWbemClassObject_Next( result, 1000, 1, &obj, &count );
> > > > +    ok( hr == WBEM_E_ACCESS_DENIED || broken(hr == WBEM_S_FALSE || hr == WBEM_S_TIMEDOUT) /* before Win7 SP1 */, "got %08x\n", hr );
> > > > +    ok( !count, "got %u\n", count );
> > > 
> > > I don't see this. Even up-to-date Windows 10 returns WBEM_S_FALSE here.
> > 
> > Looks like this is a result of executing from an MSI custom action.
> > Is there a way to detect such a case and return an appropriate error
> > value?
> 
> The error code suggests that the custom action is run with insufficient
> permissions. If that's the case we'd need to do the same and add a permission
> check somewhere.

Under Windows MSI custom action is executed in the context of an MSI server,
which probably runs as a restricted process, and which doesn't exist in Wine.
Could you suggest a place in Wine where a permission check could be added?

-- 
Dmitry.



More information about the wine-devel mailing list