I ran my test case on 98, and that produced a return value of 2 as well (same as XP), so unless my test case is stuffed up, I think this patch is correct. The test is attached, it's extremely simple.
On Tue, 2003-04-01 at 16:37, Mike Hearn wrote: > > That sounds awfully much like the already pretty well-known Win9x vs. NT > > incompatibility in file not found GetLastError values. > > Awwww suckage. I thought that fix was too easy. File not found > differences are new to me. Well I have a little test case for this, I'll > email it home and find out what it returns on Win98. > > If so, then, how do you find out what version of windows we're supposed > to be emulating, so I can adjust the return value accordingly? > > > Please make sure this is indeed what we should do; I really think > > you'd break some Win9x programs when simply doing such a general replacement. > > Hmm, well, the old value appeared to break some NT programs. > > > As such, I suspect you did not "Correct" the error code returned; > > instead, you only fixed it "to please the other half" of Windows programs. > > ;-) > > Right. So we need to change the return value depending on the setting of > winver? -- Mike Hearn <[EMAIL PROTECTED]> QinetiQ - Malvern Technology Center
#include <windows.h> #include <stdio.h> int WINAPI WinMain( HINSTANCE hinst , HINSTANCE prev , LPSTR cmdline , INT s ) { WIN32_FIND_DATA fd; HANDLE h; printf("hello world\n"); h = FindFirstFile("foo", &fd); printf("errno=%d\n", GetLastError()); }