[PATCH] user32: LoadImage should search image in PE directory, not the working directory

Erich E. Hoover erich.e.hoover at gmail.com
Mon Nov 26 14:31:05 CST 2018


On Mon, Nov 26, 2018 at 1:15 PM Dmitry Timoshkov <dmitry at baikal.ru> wrote:
> Fabian Maurer <dark.shadow4 at web.de> wrote:
> > > This would need more tests, but it's pretty unlikely that it would
> > > search only the exe directory. Probably it should be using something
> > > like SearchPathW.
> >
> > Thanks, sounds sensible.
> >
> > Apart from current working directory and PE directory, which paths
> > should I best write tests for?
>
> Create temp path with an image, add it to %PATH%, call LoadImage, and
> see what happens?

The behavior may also be dependent upon the setting of
NeedCurrentDirectoryForExePath (
https://msdn.microsoft.com/en-us/library/windows/desktop/ms684269(v=vs.85).aspx
).  I have a staging patch for CreateProcess that checks this, but
it's possible that the behavior is implemented at a lower level.

Best,
Erich



More information about the wine-devel mailing list