Hello, if the Wine headers are used to compile tests on Windows using gcc, GetLastError() returns wrong values due to differencies in the TEB layout between Wine and Windows. Changelog: Use inline versions of APIs only internally in Wine. --- cvs/hq/wine/include/winbase.h Wed Jul 9 16:12:05 2003 +++ wine/include/winbase.h Wed Jul 9 22:29:32 2003 @@ -1856,6 +1856,7 @@ BOOL WINAPI wine_get_unix_file_na /* a few optimizations for i386/gcc */ +#ifdef __WINESRC__ #if defined(__i386__) && defined(__GNUC__) extern inline LONG WINAPI InterlockedCompareExchange( PLONG dest, LONG xchg, LONG compare ); @@ -2005,7 +2006,8 @@ DWORD WINAPI GetCurrentProcessId(v DWORD WINAPI GetCurrentThreadId(void); void WINAPI SetLastError( DWORD err ); HANDLE WINAPI GetProcessHeap(void); -#else /* __i386__ && __GNUC__ */ +#endif /* __i386__ && __GNUC__ */ +#else /* __WINESRC__ */ DWORD WINAPI GetCurrentProcessId(void); DWORD WINAPI GetCurrentThreadId(void); DWORD WINAPI GetLastError(void); @@ -2016,7 +2018,7 @@ LONG WINAPI InterlockedExchange(P LONG WINAPI InterlockedExchangeAdd(PLONG,LONG); LONG WINAPI InterlockedIncrement(PLONG); VOID WINAPI SetLastError(DWORD); -#endif /* __i386__ && __GNUC__ */ +#endif /* __WINESRC__ */ /* FIXME: should handle platforms where sizeof(void*) != sizeof(long) */ static inline PVOID WINAPI InterlockedCompareExchangePointer( PVOID *dest, PVOID xchg, PVOID compare )