Hi Alexandre,
From: ext Alexandre Julliard [mailto:julliard@winehq.org]
For the standard registry files you'd have to do it in load_init_registry_from_file() and save_branch(). It still won't prevent one server from overwriting changes made by others of course.
thanks, you are correct: the load_registry() and save_registry() aren't called in my case at all - I was modifying wrong functions. Here I've added few fprintf's:
salsim04:afarber {528} wine perl -v load_init_registry_from_file(/disks/ouusers/afarber/.wine/system.reg, key) load_init_registry_from_file(/disks/ouusers/afarber/.wine/userdef.reg, key) load_init_registry_from_file(/disks/ouusers/afarber/.wine/user.reg, key) save_branch(key, /disks/ouusers/afarber/.wine/system.reg) save_branch, renaming /disks/ouusers/afarber/.wine/reg205b0000.tmp -> /disks/ouusers/afarber/.wine/system.reg save_branch(key, /disks/ouusers/afarber/.wine/userdef.reg) save_branch, renaming /disks/ouusers/afarber/.wine/reg205b0000.tmp -> /disks/ouusers/afarber/.wine/userdef.reg save_branch(key, /disks/ouusers/afarber/.wine/user.reg) save_branch, renaming /disks/ouusers/afarber/.wine/reg205b0000.tmp -> /disks/ouusers/afarber/.wine/user.reg
This is perl, v5.6.1 built for MSWin32-x86-multi-thread (with 1 registered patch, see perl -V for more detail)
Copyright 1987-2001, Larry Wall
Binary build 635 provided by ActiveState Corp. http://www.ActiveState.com Built 15:34:21 Feb 4 2003
Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on this system using `man perl' or `perldoc perl'. If you have access to the Internet, point your browser at http://www.perl.com/, the Perl Home Page.
salsim04:afarber {529} save_branch(key, /disks/ouusers/afarber/.wine/system.reg) save_branch, renaming /disks/ouusers/afarber/.wine/reg205b0000.tmp -> /disks/ouusers/afarber/.wine/system.reg save_branch(key, /disks/ouusers/afarber/.wine/userdef.reg) save_branch(key, /disks/ouusers/afarber/.wine/user.reg) save_branch, renaming /disks/ouusers/afarber/.wine/reg205b0000.tmp -> /disks/ouusers/afarber/.wine/user.reg
However now I'm really lost, because I don't understand where does the file corruption occur. In my case the ~/.wine/system.reg is a regular file stored in my NFS- mounted home dir. That is why a tmp file is used and later renamed. Shouldn't that operation be atomic and if not, how could I protect it (locking a dummy file?)
Regards Alex
PS: BTW I've noticed a bug - the variable "count" in the save_branch() is probably meant to be static. But it is not and that's why the tmp file's name (the "reg205b0000.tmp" above) never changes.