kernel32/volume: Don't modify the last error in GetVolumeInformation

Alexandre Goujon ale.goujon at gmail.com
Tue May 29 12:26:46 CDT 2012


On Tue, May 29, 2012 at 7:07 PM, Alexandre Julliard <julliard at winehq.org>wrote:

> Alexandre Goujon <ale.goujon at gmail.com> writes:
>
> > @@ -729,6 +731,8 @@ BOOL WINAPI GetVolumeInformationW( LPCWSTR root,
> LPWSTR label, DWORD label_len,
> >          }
> >          else
> >          {
> > +            /* At this point, last error is ERROR_NOT_SUPPORTED.
> Restoring the previous one */
> > +            SetLastError(lastError);
>
> You should never need to do that sort of thing, there are no guarantees
> about last error on success.
>
> --
> Alexandre Julliard
> julliard at winehq.org
>
I know but The Sims 3 calls GetLastError very often (in the top 10), nearly
between each call, maybe to check if a specific error does (or doesn't)
occur.
It troubled me when I investigated a bug and I thought the cost was so low
that we could do it anyway.
But I know you are right, so just forget about it.

PS: FYI I tested it on WIndows and the last error is not changed (but it
doesn't matter as you said)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20120529/3d4a3249/attachment.html>


More information about the wine-devel mailing list