On Tue, 23 Oct 2001, Alexandre Julliard wrote:
Modified files: memory : virtual.c
Log message: Try to use read instead of mmap for files on removable media, so that we don't need to keep the mapping handle open.
OK, I see that you did this part too, which I hadn't submitted yet... but there's still one thing missing; the .exe file is still open inside the wineserver, still having two outstanding references:
- main_exe_file in scheduler/process.c - process->exe.file in server/process.c
Since main_exe_file is apparently never used again anyway after init_process_done, I've simply used the following hack to close the .exe file on the wineserver side, assuming the server file object only needs to exist to detect sharing violations, not for actually ever accessing the file again:
--- server/process.c 2001/03/05 22:55:56 1.1.1.9 +++ server/process.c 2001/10/19 16:40:52 1.4 @@ -802,6 +802,8 @@ { if (process->exe.file) release_object( process->exe.file ); process->exe.file = file; + /* close the unix file, so the media the file was on can be changed */ + remove_select_user( (struct object *)file ); } generate_startup_debug_events( current->process, req->entry ); set_event( process->init_event );
Maybe you have a better way to do it?