No subject


Tue Aug 30 17:20:58 CDT 2005


version of windows you're using doesn't seem to do this.  I would consider
this a bug in windows, not a bug in Wine.  If a programmer relies on this
behavior, it's their fault, not MS's or Wine's fault that their code does
not work.

----- Original Message ----- 
From: "Alex Pasadyn" <ajp at mail.utexas.edu>
To: <wine-devel at winehq.org>
Sent: Saturday, August 16, 2003 11:55 AM
Subject: GetLastError strangeness with FindClose


> Hi all,
> I observed a program that was bailing out with an absolutely baffling
> error message.  I have traced it to its cause, but now I'm stuck.
> Basically, it was telling me that it had an error in FindNextFile of
> "success".  I did a relay trace and found out that it was calling
> FindFirstFile, FindNextFile a bunch of times, FindClose, and then
> GetLastError.
>
> So, I put together a little test:
>
> #include <windows.h>
> #include <stdio.h>
>
> WIN32_FIND_DATA fd;
> HANDLE h;
>
> int main(int argc, char *argv[])
> {
>
>      h = FindFirstFile("*", &fd);
>      if (h == INVALID_HANDLE_VALUE)
>      {
>          printf("Error finding first file: %d\n", GetLastError());
>          return 1;
>      }
>      printf("found file: %s\n", fd.cFileName);
>      while (FindNextFile(h, &fd))
>      {
>          printf("found file: %s\n", fd.cFileName);
>      }
>      FindClose(h);
>      switch (GetLastError())
>      {
>      case ERROR_NO_MORE_FILES:
>          printf("all done!\n");
>          return 0;
>      default:
>          printf("Error finding next file: %d\n", GetLastError());
>          return 1;
>      }
>      return 1;
> }
>
>
> Now, on Windows, the output is:
> G:\testfnf>testfnf
> found file: .
> found file: ..
> found file: testfnf.cpp
> found file: testfnf.exe
> all done!
>
> And with Wine the output is:
> [ajp at toaster testfnf]$ ~/wine/wine testfnf.exe
> found file: .
> found file: ..
> found file: testfnf.cpp
> found file: testfnf.exe
> Error finding next file: 0
>
> So, it looks like somewhere in FindClose Wine is resetting the last
> error.  I started digging through there and the functions it calls but I
> was unable to find where it was getting reset.  Can anyone shed some
> light on this?  Is there any way to break on that value changing?
>
> Thanks,
> -ajp
>
>




More information about the wine-devel mailing list