On Thu, 18 Jul 2002 22:17:19 -0500, you wrote: > > Log message: > Mike McCormack <mikem@codeweavers.com> > First go at reading directories on public SMB shares. > > Patch: http://cvs.winehq.com/patch.py?id=1027048639509081130455346 This breaks Forte Agent, looping endlessly around a FindNextFileA(). It is caused by the SetLastError(ERROR_NO_MORE_FILES) that is lost in the final HeapUnlock call. A quick fix is attached. files/ : dos_fs.c Repair SetLastError in FindNextFileA. Rein. -- Rein Klazes rklazes@xs4all.nl
--- wine/files/dos_fs.c Fri Jul 19 14:15:26 2002 +++ mywine/files/dos_fs.c Fri Jul 19 15:26:17 2002 @@ -1802,6 +1802,7 @@ { FIND_FIRST_INFO *info; BOOL ret = FALSE; + DWORD gle = ERROR_NO_MORE_FILES; if ((handle == INVALID_HANDLE_VALUE) || !(info = (FIND_FIRST_INFO *)GlobalLock( handle ))) @@ -1816,25 +1817,24 @@ { SMB_CloseDir( info->u.smb_dir ); HeapFree( GetProcessHeap(), 0, info->path ); - SetLastError( ERROR_NO_MORE_FILES ); } goto done; } else if (!info->path || !info->u.dos_dir) { - SetLastError( ERROR_NO_MORE_FILES ); + goto done; } else if (!DOSFS_FindNextEx( info, data )) { DOSFS_CloseDir( info->u.dos_dir ); info->u.dos_dir = NULL; HeapFree( GetProcessHeap(), 0, info->path ); info->path = info->long_mask = NULL; - SetLastError( ERROR_NO_MORE_FILES ); } else ret = TRUE; done: GlobalUnlock( handle ); + if( !ret ) SetLastError( gle ); return ret; }