kernel32: check the last parameter of K32EnumProcessModules for NULL before use (with test)

Stefan Leichter Stefan.Leichter at camline.com
Thu May 17 04:09:42 CDT 2012


Thursday 17 May 2012 Nikolay Sivov <bunglehead at gmail.com>
> On 5/17/2012 11:46, Stefan Leichter wrote:
> >       SetLastError(0xdeadbeef);
> > 
> > +    pEnumProcessModules(hpQI,&hMod, sizeof(HMODULE), NULL);
> > +    ok(GetLastError() == ERROR_ACCESS_DENIED, "expected
> > error=ERROR_ACCESS_DENIED but got %d\n", GetLastError()); +
> > +    SetLastError(0xdeadbeef);
> > +    ret = pEnumProcessModules(hpQV,&hMod, sizeof(HMODULE), NULL);
> > +    ok(!ret, "succeeded\n");
> > +    ok(GetLastError() == ERROR_NOACCESS, "expected error=ERROR_NOACCESS
> > but got %d\n", GetLastError()); +
> 
> Why don't you check return value from the first call?
Because the two calls before doesn't do it either



More information about the wine-devel mailing list