[prev in list] [next in list] [prev in thread] [next in thread]
List: wine-devel
Subject: Re: kernel32/volume: Don't modify the last error in GetVolumeInformation
From: Alexandre Goujon <ale.goujon () gmail ! com>
Date: 2012-05-29 17:26:46
Message-ID: CACT2Okj2ic+xq7SQ7JfyY2e_A0rn+=mSNU34UKOWocA56WxeYA () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
On Tue, May 29, 2012 at 7:07 PM, Alexandre Julliard <julliard@winehq.org>wrote:
> Alexandre Goujon <ale.goujon@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@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)
[Attachment #5 (text/html)]
<div class="gmail_quote">On Tue, May 29, 2012 at 7:07 PM, Alexandre Julliard <span \
dir="ltr"><<a href="mailto:julliard@winehq.org" \
target="_blank">julliard@winehq.org</a>></span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">
<div class="im">Alexandre Goujon <<a \
href="mailto:ale.goujon@gmail.com">ale.goujon@gmail.com</a>> writes:<br> <br>
> @@ -729,6 +731,8 @@ BOOL WINAPI GetVolumeInformationW( LPCWSTR root, LPWSTR \
label, DWORD label_len,<br> > }<br>
> else<br>
> {<br>
> + /* At this point, last error is ERROR_NOT_SUPPORTED. Restoring the \
previous one */<br> > + SetLastError(lastError);<br>
<br>
</div>You should never need to do that sort of thing, there are no guarantees<br>
about last error on success.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Alexandre Julliard<br>
<a href="mailto:julliard@winehq.org">julliard@winehq.org</a><br>
</font></span></blockquote></div>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.<br>It troubled me when I investigated a bug and I thought the \
cost was so low that we could do it anyway.<br>
But I know you are right, so just forget about it.<br><br>PS: FYI I tested it on \
WIndows and the last error is not changed (but it doesn't matter as you said)<br>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic