winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
July
June
May
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
July 2009
----- 2025 -----
July 2025
June 2025
May 2025
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
4 participants
1067 discussions
Start a n
N
ew thread
Alexandre Julliard : mountmgr: Return a copy of the strings in query_dos_device.
by Alexandre Julliard
23 Jul '09
23 Jul '09
Module: wine Branch: master Commit: 134feaab05ae382aabc14aeb9268a6e68f035a38 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=134feaab05ae382aabc14aeb9…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jul 22 21:02:47 2009 +0200 mountmgr: Return a copy of the strings in query_dos_device. --- dlls/mountmgr.sys/device.c | 7 +++---- dlls/mountmgr.sys/mountmgr.c | 10 +++++++--- dlls/mountmgr.sys/mountmgr.h | 3 +-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c index 20a7826..bdade97 100644 --- a/dlls/mountmgr.sys/device.c +++ b/dlls/mountmgr.sys/device.c @@ -807,8 +807,7 @@ NTSTATUS remove_dos_device( int letter, const char *udi ) } /* query information about an existing dos drive, by letter or udi */ -NTSTATUS query_dos_device( int letter, enum device_type *type, - const char **device, const char **mount_point ) +NTSTATUS query_dos_device( int letter, enum device_type *type, char **device, char **mount_point ) { struct dos_drive *drive; struct disk_device *disk_device; @@ -818,8 +817,8 @@ NTSTATUS query_dos_device( int letter, enum device_type *type, if (drive->drive != letter) continue; disk_device = drive->volume->device; if (type) *type = disk_device->type; - if (device) *device = disk_device->unix_device; - if (mount_point) *mount_point = disk_device->unix_mount; + if (device) *device = strdupA( disk_device->unix_device ); + if (mount_point) *mount_point = strdupA( disk_device->unix_mount ); return STATUS_SUCCESS; } return STATUS_NO_SUCH_DEVICE; diff --git a/dlls/mountmgr.sys/mountmgr.c b/dlls/mountmgr.sys/mountmgr.c index bbf5d64..a80d492 100644 --- a/dlls/mountmgr.sys/mountmgr.c +++ b/dlls/mountmgr.sys/mountmgr.c @@ -276,7 +276,7 @@ static NTSTATUS query_unix_drive( const void *in_buff, SIZE_T insize, { const struct mountmgr_unix_drive *input = in_buff; struct mountmgr_unix_drive *output = out_buff; - const char *device, *mount_point; + char *device, *mount_point; int letter = tolowerW( input->letter ); NTSTATUS status; DWORD size, type = DEVICE_UNKNOWN; @@ -314,7 +314,8 @@ static NTSTATUS query_unix_drive( const void *in_buff, SIZE_T insize, output->type = type; iosb->Information = FIELD_OFFSET( struct mountmgr_unix_drive, type ) + sizeof(output->type); } - return STATUS_MORE_ENTRIES; + status = STATUS_MORE_ENTRIES; + goto done; } output->size = size; output->letter = letter; @@ -341,7 +342,10 @@ static NTSTATUS query_unix_drive( const void *in_buff, SIZE_T insize, letter, debugstr_a(device), debugstr_a(mount_point), type ); iosb->Information = ptr - (char *)output; - return STATUS_SUCCESS; +done: + RtlFreeHeap( GetProcessHeap(), 0, device ); + RtlFreeHeap( GetProcessHeap(), 0, mount_point ); + return status; } /* handler for ioctls on the mount manager device */ diff --git a/dlls/mountmgr.sys/mountmgr.h b/dlls/mountmgr.sys/mountmgr.h index 0ba1086..3d57ba1 100644 --- a/dlls/mountmgr.sys/mountmgr.h +++ b/dlls/mountmgr.sys/mountmgr.h @@ -57,8 +57,7 @@ extern NTSTATUS remove_volume( const char *udi ); extern NTSTATUS add_dos_device( int letter, const char *udi, const char *device, const char *mount_point, enum device_type type, const GUID *guid ); extern NTSTATUS remove_dos_device( int letter, const char *udi ); -extern NTSTATUS query_dos_device( int letter, enum device_type *type, - const char **device, const char **mount_point ); +extern NTSTATUS query_dos_device( int letter, enum device_type *type, char **device, char **mount_point ); extern NTSTATUS WINAPI harddisk_driver_entry( DRIVER_OBJECT *driver, UNICODE_STRING *path ); /* mount point functions */
1
0
0
0
Alexandre Julliard : mountmgr: Try to match and reuse volumes when creating /updating a drive.
by Alexandre Julliard
23 Jul '09
23 Jul '09
Module: wine Branch: master Commit: 15acd35fa27d09af01698083af21ef3772edcae1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=15acd35fa27d09af01698083a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jul 22 20:56:04 2009 +0200 mountmgr: Try to match and reuse volumes when creating/updating a drive. --- dlls/mountmgr.sys/device.c | 104 +++++++++++++++++++++++++++++++++----------- 1 files changed, 78 insertions(+), 26 deletions(-) diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c index 35797e4..20a7826 100644 --- a/dlls/mountmgr.sys/device.c +++ b/dlls/mountmgr.sys/device.c @@ -361,8 +361,8 @@ static NTSTATUS create_volume( const char *udi, enum device_type type, struct vo } /* create the disk device for a given volume */ -static NTSTATUS create_dos_device( const char *udi, int letter, enum device_type type, - struct dos_drive **drive_ret ) +static NTSTATUS create_dos_device( struct volume *volume, const char *udi, int letter, + enum device_type type, struct dos_drive **drive_ret ) { struct dos_drive *drive; NTSTATUS status; @@ -371,7 +371,15 @@ static NTSTATUS create_dos_device( const char *udi, int letter, enum device_type drive->drive = letter; drive->mount = NULL; - if (!(status = create_volume( udi, type, &drive->volume ))) + if (volume) + { + if (udi) set_volume_udi( volume, udi ); + drive->volume = volume; + status = STATUS_SUCCESS; + } + else status = create_volume( udi, type, &drive->volume ); + + if (status == STATUS_SUCCESS) { grab_volume( drive->volume ); list_add_tail( &drives_list, &drive->entry ); @@ -391,6 +399,31 @@ static void delete_dos_device( struct dos_drive *drive ) RtlFreeHeap( GetProcessHeap(), 0, drive ); } +/* find a volume that matches the parameters */ +static struct volume *find_matching_volume( const char *udi, const char *device, + const char *mount_point, enum device_type type ) +{ + struct volume *volume; + struct disk_device *disk_device; + + LIST_FOR_EACH_ENTRY( volume, &volumes_list, struct volume, entry ) + { + /* when we have a udi we only match drives added manually */ + if (udi && volume->udi) continue; + /* and when we don't have a udi we only match dynamic drives */ + if (!udi && !volume->udi) continue; + + disk_device = volume->device; + if (disk_device->type != type) continue; + if (device && disk_device->unix_device && strcmp( device, disk_device->unix_device )) continue; + if (mount_point && disk_device->unix_mount && strcmp( mount_point, disk_device->unix_mount )) continue; + TRACE( "found matching volume %s for device %s mount %s type %u\n", + debugstr_guid(&volume->guid), debugstr_a(device), debugstr_a(mount_point), type ); + return volume; + } + return NULL; +} + /* change the information for an existing volume */ static NTSTATUS set_volume_info( struct volume *volume, struct dos_drive *drive, const char *device, const char *mount_point, enum device_type type, const GUID *guid ) @@ -424,7 +457,7 @@ static NTSTATUS set_volume_info( struct volume *volume, struct dos_drive *drive, disk_device->unix_device = strdupA( device ); disk_device->unix_mount = strdupA( mount_point ); - if (memcmp( &volume->guid, guid, sizeof(volume->guid) )) + if (guid && memcmp( &volume->guid, guid, sizeof(volume->guid) )) { volume->guid = *guid; if (volume->mount) @@ -450,17 +483,23 @@ static NTSTATUS set_volume_info( struct volume *volume, struct dos_drive *drive, return STATUS_SUCCESS; } -/* set or change the drive letter for an existing drive */ -static void set_drive_letter( struct dos_drive *drive, int letter ) +/* change the drive letter or volume for an existing drive */ +static void set_drive_info( struct dos_drive *drive, int letter, struct volume *volume ) { - struct volume *volume = drive->volume; - - if (drive->drive == letter) return; - if (drive->mount) delete_mount_point( drive->mount ); - if (volume->mount) delete_mount_point( volume->mount ); - drive->drive = letter; - drive->mount = NULL; - volume->mount = NULL; + if (drive->drive != letter) + { + if (drive->mount) delete_mount_point( drive->mount ); + drive->mount = NULL; + drive->drive = letter; + } + if (drive->volume != volume) + { + if (drive->mount) delete_mount_point( drive->mount ); + drive->mount = NULL; + grab_volume( volume ); + release_volume( drive->volume ); + drive->volume = volume; + } } static inline int is_valid_device( struct stat *st ) @@ -552,6 +591,7 @@ static void create_drive_devices(void) { char *path, *p, *link, *device; struct dos_drive *drive; + struct volume *volume; unsigned int i; HKEY drives_key; enum device_type drive_type; @@ -588,9 +628,12 @@ static void create_drive_devices(void) } } - if (!create_dos_device( NULL, i, drive_type, &drive )) + volume = find_matching_volume( NULL, device, link, drive_type ); + if (!create_dos_device( volume, NULL, i, drive_type, &drive )) { - set_volume_info( drive->volume, drive, device, link, drive_type, get_default_uuid(i) ); + /* don't reset uuid if we used an existing volume */ + const GUID *guid = volume ? NULL : get_default_uuid(i); + set_volume_info( drive->volume, drive, device, link, drive_type, guid ); } else { @@ -615,7 +658,12 @@ NTSTATUS add_volume( const char *udi, const char *device, const char *mount_poin LIST_FOR_EACH_ENTRY( volume, &volumes_list, struct volume, entry ) if (volume->udi && !strcmp( udi, volume->udi )) goto found; - if ((status = create_volume( udi, type, &volume ))) return status; + /* udi not found, search for a non-dynamic volume */ + if ((volume = find_matching_volume( udi, device, mount_point, type ))) + { + set_volume_udi( volume, udi ); + } + else if ((status = create_volume( udi, type, &volume ))) return status; found: return set_volume_info( volume, NULL, device, mount_point, type, guid ); @@ -644,6 +692,7 @@ NTSTATUS add_dos_device( int letter, const char *udi, const char *device, HKEY hkey; NTSTATUS status = STATUS_SUCCESS; struct dos_drive *drive, *next; + struct volume *volume = find_matching_volume( udi, device, mount_point, type ); if (!(path = get_dosdevices_path( &p ))) return STATUS_NO_MEMORY; @@ -664,25 +713,28 @@ NTSTATUS add_dos_device( int letter, const char *udi, const char *device, } else /* simply reset the device symlink */ { - *p = 'a' + letter; LIST_FOR_EACH_ENTRY( drive, &drives_list, struct dos_drive, entry ) + if (drive->drive == letter) break; + + *p = 'a' + letter; + if (&drive->entry == &drives_list) update_symlink( path, device, NULL ); + else { - if (drive->drive != letter) continue; update_symlink( path, device, drive->volume->device->unix_device ); - goto found; + delete_dos_device( drive ); } - update_symlink( path, device, NULL ); } - if ((status = create_dos_device( udi, letter, type, &drive ))) goto done; + if ((status = create_dos_device( volume, udi, letter, type, &drive ))) goto done; found: - if (!guid) guid = get_default_uuid( letter ); + if (!guid && !volume) guid = get_default_uuid( letter ); + if (!volume) volume = drive->volume; + set_drive_info( drive, letter, volume ); p[0] = 'a' + drive->drive; p[2] = 0; - update_symlink( path, mount_point, drive->volume->device->unix_mount ); - set_drive_letter( drive, letter ); - set_volume_info( drive->volume, drive, device, mount_point, type, guid ); + update_symlink( path, mount_point, volume->device->unix_mount ); + set_volume_info( volume, drive, device, mount_point, type, guid ); TRACE( "added device %c: udi %s for %s on %s type %u\n", 'a' + drive->drive, wine_dbgstr_a(udi), wine_dbgstr_a(device),
1
0
0
0
Alexandre Julliard : mountmgr: Add ref counting for volume objects.
by Alexandre Julliard
23 Jul '09
23 Jul '09
Module: wine Branch: master Commit: 0da2e46eaf37049dea45133c904d37475a704193 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0da2e46eaf37049dea45133c9…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jul 22 20:55:24 2009 +0200 mountmgr: Add ref counting for volume objects. --- dlls/mountmgr.sys/device.c | 70 ++++++++++++++++++++++++++++++-------------- 1 files changed, 48 insertions(+), 22 deletions(-) diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c index 3753c96..35797e4 100644 --- a/dlls/mountmgr.sys/device.c +++ b/dlls/mountmgr.sys/device.c @@ -71,6 +71,7 @@ struct volume struct list entry; /* entry in volumes list */ struct disk_device *device; /* disk device */ char *udi; /* unique identifier for dynamic volumes */ + unsigned int ref; /* ref count */ GUID guid; /* volume uuid */ struct mount_point *mount; /* Volume{xxx} mount point */ }; @@ -299,6 +300,46 @@ static void delete_disk_device( struct disk_device *device ) IoDeleteDevice( device->dev_obj ); } +/* grab another reference to a volume */ +static unsigned int grab_volume( struct volume *volume ) +{ + return ++volume->ref; +} + +/* release a volume and delete the corresponding disk device when refcount is 0 */ +static unsigned int release_volume( struct volume *volume ) +{ + unsigned int ret = --volume->ref; + + TRACE( "%s udi %s count now %u\n", debugstr_guid(&volume->guid), debugstr_a(volume->udi), ret ); + if (!ret) + { + assert( !volume->udi ); + list_remove( &volume->entry ); + if (volume->mount) delete_mount_point( volume->mount ); + delete_disk_device( volume->device ); + RtlFreeHeap( GetProcessHeap(), 0, volume ); + } + return ret; +} + +/* set the volume udi */ +static void set_volume_udi( struct volume *volume, const char *udi ) +{ + if (udi) + { + assert( !volume->udi ); + /* having a udi means the HAL side holds an extra reference */ + if ((volume->udi = strdupA( udi ))) grab_volume( volume ); + } + else if (volume->udi) + { + RtlFreeHeap( GetProcessHeap(), 0, volume->udi ); + volume->udi = NULL; + release_volume( volume ); + } +} + /* create a disk volume */ static NTSTATUS create_volume( const char *udi, enum device_type type, struct volume **volume_ret ) { @@ -308,32 +349,15 @@ static NTSTATUS create_volume( const char *udi, enum device_type type, struct vo if (!(volume = RtlAllocateHeap( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*volume) ))) return STATUS_NO_MEMORY; - if (udi && !(volume->udi = strdupA( udi ))) - { - RtlFreeHeap( GetProcessHeap(), 0, volume ); - return STATUS_NO_MEMORY; - } if (!(status = create_disk_device( type, &volume->device ))) { + if (udi) set_volume_udi( volume, udi ); list_add_tail( &volumes_list, &volume->entry ); *volume_ret = volume; } - else - { - RtlFreeHeap( GetProcessHeap(), 0, volume->udi ); - RtlFreeHeap( GetProcessHeap(), 0, volume ); - } - return status; -} + else RtlFreeHeap( GetProcessHeap(), 0, volume ); -/* delete a volume and the corresponding disk device */ -static void delete_volume( struct volume *volume ) -{ - list_remove( &volume->entry ); - if (volume->mount) delete_mount_point( volume->mount ); - delete_disk_device( volume->device ); - RtlFreeHeap( GetProcessHeap(), 0, volume->udi ); - RtlFreeHeap( GetProcessHeap(), 0, volume ); + return status; } /* create the disk device for a given volume */ @@ -349,6 +373,7 @@ static NTSTATUS create_dos_device( const char *udi, int letter, enum device_type if (!(status = create_volume( udi, type, &drive->volume ))) { + grab_volume( drive->volume ); list_add_tail( &drives_list, &drive->entry ); *drive_ret = drive; } @@ -362,7 +387,7 @@ static void delete_dos_device( struct dos_drive *drive ) { list_remove( &drive->entry ); if (drive->mount) delete_mount_point( drive->mount ); - delete_volume( drive->volume ); + release_volume( drive->volume ); RtlFreeHeap( GetProcessHeap(), 0, drive ); } @@ -604,7 +629,7 @@ NTSTATUS remove_volume( const char *udi ) LIST_FOR_EACH_ENTRY( volume, &volumes_list, struct volume, entry ) { if (!volume->udi || strcmp( udi, volume->udi )) continue; - delete_volume( volume ); + set_volume_udi( volume, NULL ); return STATUS_SUCCESS; } return STATUS_NO_SUCH_DEVICE; @@ -699,6 +724,7 @@ NTSTATUS remove_dos_device( int letter, const char *udi ) { if (!drive->volume->udi) continue; if (strcmp( udi, drive->volume->udi )) continue; + set_volume_udi( drive->volume, NULL ); } else if (drive->drive != letter) continue;
1
0
0
0
Alexandre Julliard : mountmgr: Better reuse of existing devices.
by Alexandre Julliard
23 Jul '09
23 Jul '09
Module: wine Branch: master Commit: 7b7ac02e1516effc47e1839299792b81ca3ffbd0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7b7ac02e1516effc47e183929…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jul 22 19:21:22 2009 +0200 mountmgr: Better reuse of existing devices. --- dlls/mountmgr.sys/device.c | 21 +++++++++++---------- 1 files changed, 11 insertions(+), 10 deletions(-) diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c index 42eb0cd..3753c96 100644 --- a/dlls/mountmgr.sys/device.c +++ b/dlls/mountmgr.sys/device.c @@ -630,22 +630,23 @@ NTSTATUS add_dos_device( int letter, const char *udi, const char *device, status = STATUS_OBJECT_NAME_COLLISION; goto done; } + + LIST_FOR_EACH_ENTRY_SAFE( drive, next, &drives_list, struct dos_drive, entry ) + { + if (drive->volume->udi && !strcmp( udi, drive->volume->udi )) goto found; + if (drive->drive == letter) delete_dos_device( drive ); + } } else /* simply reset the device symlink */ { *p = 'a' + letter; - update_symlink( path, device, NULL ); - } - - LIST_FOR_EACH_ENTRY_SAFE( drive, next, &drives_list, struct dos_drive, entry ) - { - if (udi && drive->volume->udi && !strcmp( udi, drive->volume->udi )) + LIST_FOR_EACH_ENTRY( drive, &drives_list, struct dos_drive, entry ) { - if (type == drive->volume->device->type) goto found; - delete_dos_device( drive ); - continue; + if (drive->drive != letter) continue; + update_symlink( path, device, drive->volume->device->unix_device ); + goto found; } - if (drive->drive == letter) delete_dos_device( drive ); + update_symlink( path, device, NULL ); } if ((status = create_dos_device( udi, letter, type, &drive ))) goto done;
1
0
0
0
Alexandre Julliard : mountmgr: Set the drive letter at creation time.
by Alexandre Julliard
23 Jul '09
23 Jul '09
Module: wine Branch: master Commit: 968161e106a511e797400a6adfbed7dda8094d58 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=968161e106a511e797400a6ad…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jul 22 18:25:38 2009 +0200 mountmgr: Set the drive letter at creation time. --- dlls/mountmgr.sys/device.c | 53 ++++++++++++++++++++----------------------- 1 files changed, 25 insertions(+), 28 deletions(-) diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c index 672ef72..42eb0cd 100644 --- a/dlls/mountmgr.sys/device.c +++ b/dlls/mountmgr.sys/device.c @@ -337,13 +337,14 @@ static void delete_volume( struct volume *volume ) } /* create the disk device for a given volume */ -static NTSTATUS create_dos_device( const char *udi, enum device_type type, struct dos_drive **drive_ret ) +static NTSTATUS create_dos_device( const char *udi, int letter, enum device_type type, + struct dos_drive **drive_ret ) { struct dos_drive *drive; NTSTATUS status; if (!(drive = RtlAllocateHeap( GetProcessHeap(), 0, sizeof(*drive) ))) return STATUS_NO_MEMORY; - drive->drive = -1; + drive->drive = letter; drive->mount = NULL; if (!(status = create_volume( udi, type, &drive->volume ))) @@ -562,9 +563,8 @@ static void create_drive_devices(void) } } - if (!create_dos_device( NULL, drive_type, &drive )) + if (!create_dos_device( NULL, i, drive_type, &drive )) { - drive->drive = i; set_volume_info( drive->volume, drive, device, link, drive_type, get_default_uuid(i) ); } else @@ -616,6 +616,7 @@ NTSTATUS add_dos_device( int letter, const char *udi, const char *device, const char *mount_point, enum device_type type, const GUID *guid ) { char *path, *p; + HKEY hkey; NTSTATUS status = STATUS_SUCCESS; struct dos_drive *drive, *next; @@ -647,7 +648,7 @@ NTSTATUS add_dos_device( int letter, const char *udi, const char *device, if (drive->drive == letter) delete_dos_device( drive ); } - if ((status = create_dos_device( udi, type, &drive ))) goto done; + if ((status = create_dos_device( udi, letter, type, &drive ))) goto done; found: if (!guid) guid = get_default_uuid( letter ); @@ -657,32 +658,28 @@ found: set_drive_letter( drive, letter ); set_volume_info( drive->volume, drive, device, mount_point, type, guid ); - if (drive->drive != -1) - { - HKEY hkey; - - TRACE( "added device %c: udi %s for %s on %s type %u\n", - 'a' + drive->drive, wine_dbgstr_a(udi), wine_dbgstr_a(device), - wine_dbgstr_a(mount_point), type ); + TRACE( "added device %c: udi %s for %s on %s type %u\n", + 'a' + drive->drive, wine_dbgstr_a(udi), wine_dbgstr_a(device), + wine_dbgstr_a(mount_point), type ); - /* hack: force the drive type in the registry */ - if (!RegCreateKeyW( HKEY_LOCAL_MACHINE, drives_keyW, &hkey )) - { - const WCHAR *type_name = drive_types[type]; - WCHAR name[3] = {'a',':',0}; + /* hack: force the drive type in the registry */ + if (!RegCreateKeyW( HKEY_LOCAL_MACHINE, drives_keyW, &hkey )) + { + const WCHAR *type_name = drive_types[type]; + WCHAR name[3] = {'a',':',0}; + + name[0] += drive->drive; + if (!type_name[0] && type == DEVICE_HARDDISK) type_name = drive_types[DEVICE_FLOPPY]; + if (type_name[0]) + RegSetValueExW( hkey, name, 0, REG_SZ, (const BYTE *)type_name, + (strlenW(type_name) + 1) * sizeof(WCHAR) ); + else + RegDeleteValueW( hkey, name ); + RegCloseKey( hkey ); + } - name[0] += drive->drive; - if (!type_name[0] && type == DEVICE_HARDDISK) type_name = drive_types[DEVICE_FLOPPY]; - if (type_name[0]) - RegSetValueExW( hkey, name, 0, REG_SZ, (const BYTE *)type_name, - (strlenW(type_name) + 1) * sizeof(WCHAR) ); - else - RegDeleteValueW( hkey, name ); - RegCloseKey( hkey ); - } + if (udi) send_notify( drive->drive, DBT_DEVICEARRIVAL ); - if (udi) send_notify( drive->drive, DBT_DEVICEARRIVAL ); - } done: RtlFreeHeap( GetProcessHeap(), 0, path ); return status;
1
0
0
0
Alexandre Julliard : mountmgr: Use set_volume_info to update the volume when creating a new drive.
by Alexandre Julliard
23 Jul '09
23 Jul '09
Module: wine Branch: master Commit: 6880b4d175d6076d8ababbddc6d0ef8433a2b51a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6880b4d175d6076d8ababbddc…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jul 22 18:04:36 2009 +0200 mountmgr: Use set_volume_info to update the volume when creating a new drive. --- dlls/mountmgr.sys/device.c | 69 ++++++++++++------------------------------- 1 files changed, 19 insertions(+), 50 deletions(-) diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c index e0f9705..672ef72 100644 --- a/dlls/mountmgr.sys/device.c +++ b/dlls/mountmgr.sys/device.c @@ -427,24 +427,14 @@ static NTSTATUS set_volume_info( struct volume *volume, struct dos_drive *drive, /* set or change the drive letter for an existing drive */ static void set_drive_letter( struct dos_drive *drive, int letter ) { - void *id = NULL; - unsigned int id_len = 0; struct volume *volume = drive->volume; - struct disk_device *device = volume->device; if (drive->drive == letter) return; if (drive->mount) delete_mount_point( drive->mount ); if (volume->mount) delete_mount_point( volume->mount ); drive->drive = letter; - drive->mount = add_dosdev_mount_point( device->dev_obj, &device->name, letter ); - volume->mount = add_volume_mount_point( device->dev_obj, &device->name, &volume->guid ); - if (device->unix_mount) - { - id = device->unix_mount; - id_len = strlen( device->unix_mount ) + 1; - } - if (drive->mount) set_mount_point_id( drive->mount, id, id_len ); - if (volume->mount) set_mount_point_id( volume->mount, id, id_len ); + drive->mount = NULL; + volume->mount = NULL; } static inline int is_valid_device( struct stat *st ) @@ -531,34 +521,6 @@ done: return drive; } -static void set_unix_mount_point( struct dos_drive *drive, const char *mount_point ) -{ - char *path, *p; - struct volume *volume = drive->volume; - struct disk_device *device = volume->device; - - if (!(path = get_dosdevices_path( &p ))) return; - p[0] = 'a' + drive->drive; - p[2] = 0; - update_symlink( path, mount_point, device->unix_mount ); - - RtlFreeHeap( GetProcessHeap(), 0, device->unix_mount ); - device->unix_mount = strdupA( mount_point ); - - if (mount_point && mount_point[0]) - { - if (drive->mount) set_mount_point_id( drive->mount, mount_point, strlen(mount_point) + 1 ); - if (volume->mount) set_mount_point_id( volume->mount, mount_point, strlen(mount_point) + 1 ); - } - else - { - if (drive->mount) set_mount_point_id( drive->mount, NULL, 0 ); - if (volume->mount) set_mount_point_id( volume->mount, NULL, 0 ); - } - - HeapFree( GetProcessHeap(), 0, path ); -} - /* create devices for mapped drives */ static void create_drive_devices(void) { @@ -653,18 +615,23 @@ NTSTATUS remove_volume( const char *udi ) NTSTATUS add_dos_device( int letter, const char *udi, const char *device, const char *mount_point, enum device_type type, const GUID *guid ) { + char *path, *p; + NTSTATUS status = STATUS_SUCCESS; struct dos_drive *drive, *next; + if (!(path = get_dosdevices_path( &p ))) return STATUS_NO_MEMORY; + if (letter == -1) /* auto-assign a letter */ { letter = add_drive( device, type ); - if (letter == -1) return STATUS_OBJECT_NAME_COLLISION; + if (letter == -1) + { + status = STATUS_OBJECT_NAME_COLLISION; + goto done; + } } else /* simply reset the device symlink */ { - char *path, *p; - - if (!(path = get_dosdevices_path( &p ))) return STATUS_NO_MEMORY; *p = 'a' + letter; update_symlink( path, device, NULL ); } @@ -680,15 +647,15 @@ NTSTATUS add_dos_device( int letter, const char *udi, const char *device, if (drive->drive == letter) delete_dos_device( drive ); } - if (create_dos_device( udi, type, &drive )) return STATUS_NO_MEMORY; + if ((status = create_dos_device( udi, type, &drive ))) goto done; found: if (!guid) guid = get_default_uuid( letter ); - drive->volume->guid = *guid; - RtlFreeHeap( GetProcessHeap(), 0, drive->volume->device->unix_device ); - drive->volume->device->unix_device = strdupA( device ); + p[0] = 'a' + drive->drive; + p[2] = 0; + update_symlink( path, mount_point, drive->volume->device->unix_mount ); set_drive_letter( drive, letter ); - set_unix_mount_point( drive, mount_point ); + set_volume_info( drive->volume, drive, device, mount_point, type, guid ); if (drive->drive != -1) { @@ -716,7 +683,9 @@ found: if (udi) send_notify( drive->drive, DBT_DEVICEARRIVAL ); } - return STATUS_SUCCESS; +done: + RtlFreeHeap( GetProcessHeap(), 0, path ); + return status; } /* remove an existing dos drive, by letter or udi */
1
0
0
0
Alexandre Julliard : mountmgr: Add a helper function to update symlinks.
by Alexandre Julliard
23 Jul '09
23 Jul '09
Module: wine Branch: master Commit: e38aff419b3bc82547e9e7ae1404aee857437c1f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e38aff419b3bc82547e9e7ae1…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jul 22 17:57:08 2009 +0200 mountmgr: Add a helper function to update symlinks. --- dlls/mountmgr.sys/device.c | 71 ++++++++++++++++++++++++------------------- 1 files changed, 40 insertions(+), 31 deletions(-) diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c index 682808a..e0f9705 100644 --- a/dlls/mountmgr.sys/device.c +++ b/dlls/mountmgr.sys/device.c @@ -148,6 +148,20 @@ static char *read_symlink( const char *path ) } } +/* update a symlink if it changed; return TRUE if updated */ +static void update_symlink( const char *path, const char *dest, const char *orig_dest ) +{ + if (dest && dest[0]) + { + if (!orig_dest || strcmp( orig_dest, dest )) + { + unlink( path ); + symlink( dest, path ); + } + } + else unlink( path ); +} + /* send notification about a change to a given drive */ static void send_notify( int drive, int code ) { @@ -517,42 +531,32 @@ done: return drive; } -static BOOL set_unix_mount_point( struct dos_drive *drive, const char *mount_point ) +static void set_unix_mount_point( struct dos_drive *drive, const char *mount_point ) { char *path, *p; - BOOL modified = FALSE; struct volume *volume = drive->volume; struct disk_device *device = volume->device; - if (!(path = get_dosdevices_path( &p ))) return FALSE; + if (!(path = get_dosdevices_path( &p ))) return; p[0] = 'a' + drive->drive; p[2] = 0; + update_symlink( path, mount_point, device->unix_mount ); + + RtlFreeHeap( GetProcessHeap(), 0, device->unix_mount ); + device->unix_mount = strdupA( mount_point ); if (mount_point && mount_point[0]) { - /* try to avoid unlinking if already set correctly */ - if (!device->unix_mount || strcmp( device->unix_mount, mount_point )) - { - unlink( path ); - symlink( mount_point, path ); - modified = TRUE; - } - RtlFreeHeap( GetProcessHeap(), 0, device->unix_mount ); - device->unix_mount = strdupA( mount_point ); if (drive->mount) set_mount_point_id( drive->mount, mount_point, strlen(mount_point) + 1 ); if (volume->mount) set_mount_point_id( volume->mount, mount_point, strlen(mount_point) + 1 ); } else { - if (unlink( path ) != -1) modified = TRUE; - RtlFreeHeap( GetProcessHeap(), 0, device->unix_mount ); - device->unix_mount = NULL; if (drive->mount) set_mount_point_id( drive->mount, NULL, 0 ); if (volume->mount) set_mount_point_id( volume->mount, NULL, 0 ); } HeapFree( GetProcessHeap(), 0, path ); - return modified; } /* create devices for mapped drives */ @@ -662,8 +666,7 @@ NTSTATUS add_dos_device( int letter, const char *udi, const char *device, if (!(path = get_dosdevices_path( &p ))) return STATUS_NO_MEMORY; *p = 'a' + letter; - unlink( path ); - if (device) symlink( device, path ); + update_symlink( path, device, NULL ); } LIST_FOR_EACH_ENTRY_SAFE( drive, next, &drives_list, struct dos_drive, entry ) @@ -721,31 +724,37 @@ NTSTATUS remove_dos_device( int letter, const char *udi ) { HKEY hkey; struct dos_drive *drive; + char *path, *p; LIST_FOR_EACH_ENTRY( drive, &drives_list, struct dos_drive, entry ) { - if (letter != -1 && drive->drive != letter) continue; if (udi) { if (!drive->volume->udi) continue; if (strcmp( udi, drive->volume->udi )) continue; } + else if (drive->drive != letter) continue; - if (drive->drive != -1) + if ((path = get_dosdevices_path( &p ))) { - BOOL modified = set_unix_mount_point( drive, NULL ); - - /* clear the registry key too */ - if (!RegOpenKeyW( HKEY_LOCAL_MACHINE, drives_keyW, &hkey )) - { - WCHAR name[3] = {'a',':',0}; - name[0] += drive->drive; - RegDeleteValueW( hkey, name ); - RegCloseKey( hkey ); - } + p[0] = 'a' + drive->drive; + p[2] = 0; + unlink( path ); + RtlFreeHeap( GetProcessHeap(), 0, path ); + } - if (modified && udi) send_notify( drive->drive, DBT_DEVICEREMOVECOMPLETE ); + /* clear the registry key too */ + if (!RegOpenKeyW( HKEY_LOCAL_MACHINE, drives_keyW, &hkey )) + { + WCHAR name[3] = {'a',':',0}; + name[0] += drive->drive; + RegDeleteValueW( hkey, name ); + RegCloseKey( hkey ); } + + if (udi && drive->volume->device->unix_mount) + send_notify( drive->drive, DBT_DEVICEREMOVECOMPLETE ); + delete_dos_device( drive ); return STATUS_SUCCESS; }
1
0
0
0
Alexandre Julliard : mountmgr: Optionally update the drive mount point in set_volume_info.
by Alexandre Julliard
23 Jul '09
23 Jul '09
Module: wine Branch: master Commit: 878459383a28e534d99bfaf3f32fd7c8d78a194c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=878459383a28e534d99bfaf3f…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jul 22 17:49:39 2009 +0200 mountmgr: Optionally update the drive mount point in set_volume_info. --- dlls/mountmgr.sys/device.c | 37 ++++++++++++++++++++----------------- 1 files changed, 20 insertions(+), 17 deletions(-) diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c index 7b235ec..682808a 100644 --- a/dlls/mountmgr.sys/device.c +++ b/dlls/mountmgr.sys/device.c @@ -352,9 +352,11 @@ static void delete_dos_device( struct dos_drive *drive ) } /* change the information for an existing volume */ -static NTSTATUS set_volume_info( struct volume *volume, const char *device, const char *mount_point, - enum device_type type, const GUID *guid ) +static NTSTATUS set_volume_info( struct volume *volume, struct dos_drive *drive, const char *device, + const char *mount_point, enum device_type type, const GUID *guid ) { + void *id = NULL; + unsigned int id_len = 0; struct disk_device *disk_device = volume->device; NTSTATUS status; @@ -366,6 +368,11 @@ static NTSTATUS set_volume_info( struct volume *volume, const char *device, cons delete_mount_point( volume->mount ); volume->mount = NULL; } + if (drive && drive->mount) + { + delete_mount_point( drive->mount ); + drive->mount = NULL; + } delete_disk_device( volume->device ); volume->device = disk_device; } @@ -389,19 +396,17 @@ static NTSTATUS set_volume_info( struct volume *volume, const char *device, cons if (!volume->mount) volume->mount = add_volume_mount_point( disk_device->dev_obj, &disk_device->name, &volume->guid ); + if (drive && !drive->mount) + drive->mount = add_dosdev_mount_point( disk_device->dev_obj, &disk_device->name, drive->drive ); - if (volume->mount) + if (disk_device->unix_mount) { - void *id = NULL; - unsigned int id_len = 0; - - if (disk_device->unix_mount) - { - id = disk_device->unix_mount; - id_len = strlen( disk_device->unix_mount ) + 1; - } - set_mount_point_id( volume->mount, id, id_len ); + id = disk_device->unix_mount; + id_len = strlen( disk_device->unix_mount ) + 1; } + if (volume->mount) set_mount_point_id( volume->mount, id, id_len ); + if (drive && drive->mount) set_mount_point_id( drive->mount, id, id_len ); + return STATUS_SUCCESS; } @@ -593,10 +598,8 @@ static void create_drive_devices(void) if (!create_dos_device( NULL, drive_type, &drive )) { - drive->volume->device->unix_mount = link; - drive->volume->device->unix_device = device; - drive->volume->guid = *get_default_uuid( i ); - set_drive_letter( drive, i ); + drive->drive = i; + set_volume_info( drive->volume, drive, device, link, drive_type, get_default_uuid(i) ); } else { @@ -624,7 +627,7 @@ NTSTATUS add_volume( const char *udi, const char *device, const char *mount_poin if ((status = create_volume( udi, type, &volume ))) return status; found: - return set_volume_info( volume, device, mount_point, type, guid ); + return set_volume_info( volume, NULL, device, mount_point, type, guid ); } /* create a new disk volume */
1
0
0
0
Alexandre Julliard : mountmgr: Rename the DOS drive mount field for symmetry with the volume structure.
by Alexandre Julliard
23 Jul '09
23 Jul '09
Module: wine Branch: master Commit: 86fdd8ebc54afdd8683550eca08287944db12599 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=86fdd8ebc54afdd8683550eca…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jul 22 17:46:02 2009 +0200 mountmgr: Rename the DOS drive mount field for symmetry with the volume structure. --- dlls/mountmgr.sys/device.c | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c index efbbb33..7b235ec 100644 --- a/dlls/mountmgr.sys/device.c +++ b/dlls/mountmgr.sys/device.c @@ -80,7 +80,7 @@ struct dos_drive struct list entry; /* entry in drives list */ struct volume *volume; /* volume for this drive */ int drive; /* drive letter (0 = A: etc.) */ - struct mount_point *dosdev; /* DosDevices mount point */ + struct mount_point *mount; /* DosDevices mount point */ }; static struct list drives_list = LIST_INIT(drives_list); @@ -329,8 +329,8 @@ static NTSTATUS create_dos_device( const char *udi, enum device_type type, struc NTSTATUS status; if (!(drive = RtlAllocateHeap( GetProcessHeap(), 0, sizeof(*drive) ))) return STATUS_NO_MEMORY; - drive->drive = -1; - drive->dosdev = NULL; + drive->drive = -1; + drive->mount = NULL; if (!(status = create_volume( udi, type, &drive->volume ))) { @@ -346,7 +346,7 @@ static NTSTATUS create_dos_device( const char *udi, enum device_type type, struc static void delete_dos_device( struct dos_drive *drive ) { list_remove( &drive->entry ); - if (drive->dosdev) delete_mount_point( drive->dosdev ); + if (drive->mount) delete_mount_point( drive->mount ); delete_volume( drive->volume ); RtlFreeHeap( GetProcessHeap(), 0, drive ); } @@ -414,17 +414,17 @@ static void set_drive_letter( struct dos_drive *drive, int letter ) struct disk_device *device = volume->device; if (drive->drive == letter) return; - if (drive->dosdev) delete_mount_point( drive->dosdev ); + if (drive->mount) delete_mount_point( drive->mount ); if (volume->mount) delete_mount_point( volume->mount ); drive->drive = letter; - drive->dosdev = add_dosdev_mount_point( device->dev_obj, &device->name, letter ); + drive->mount = add_dosdev_mount_point( device->dev_obj, &device->name, letter ); volume->mount = add_volume_mount_point( device->dev_obj, &device->name, &volume->guid ); if (device->unix_mount) { id = device->unix_mount; id_len = strlen( device->unix_mount ) + 1; } - if (drive->dosdev) set_mount_point_id( drive->dosdev, id, id_len ); + if (drive->mount) set_mount_point_id( drive->mount, id, id_len ); if (volume->mount) set_mount_point_id( volume->mount, id, id_len ); } @@ -534,7 +534,7 @@ static BOOL set_unix_mount_point( struct dos_drive *drive, const char *mount_poi } RtlFreeHeap( GetProcessHeap(), 0, device->unix_mount ); device->unix_mount = strdupA( mount_point ); - if (drive->dosdev) set_mount_point_id( drive->dosdev, mount_point, strlen(mount_point) + 1 ); + if (drive->mount) set_mount_point_id( drive->mount, mount_point, strlen(mount_point) + 1 ); if (volume->mount) set_mount_point_id( volume->mount, mount_point, strlen(mount_point) + 1 ); } else @@ -542,7 +542,7 @@ static BOOL set_unix_mount_point( struct dos_drive *drive, const char *mount_poi if (unlink( path ) != -1) modified = TRUE; RtlFreeHeap( GetProcessHeap(), 0, device->unix_mount ); device->unix_mount = NULL; - if (drive->dosdev) set_mount_point_id( drive->dosdev, NULL, 0 ); + if (drive->mount) set_mount_point_id( drive->mount, NULL, 0 ); if (volume->mount) set_mount_point_id( volume->mount, NULL, 0 ); }
1
0
0
0
Alexandre Julliard : transl: Use the array form for spawning shell commands .
by Alexandre Julliard
23 Jul '09
23 Jul '09
Module: tools Branch: master Commit: f6931374185da7ba6c5ee68e837095b2c2f84d10 URL:
http://source.winehq.org/git/tools.git/?a=commit;h=f6931374185da7ba6c5ee68e…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jul 23 13:19:34 2009 +0200 transl: Use the array form for spawning shell commands. --- transl/scripts/checkmakefile.pl | 29 ++++++++++++++--------------- 1 files changed, 14 insertions(+), 15 deletions(-) diff --git a/transl/scripts/checkmakefile.pl b/transl/scripts/checkmakefile.pl index ae964f0..2c31607 100755 --- a/transl/scripts/checkmakefile.pl +++ b/transl/scripts/checkmakefile.pl @@ -10,13 +10,12 @@ use File::Basename; # configuration parameters my (%CONFIG, $srcdir, $objdir, $toolsdir, $workdir, $wrc); -sub shell($) +sub shell(@) { - my $cmd = shift; - my $ret = system $cmd; + my $ret = system @_; if ($ret) { - print STDERR "$cmd\n"; + print STDERR join(" ", @_) . "\n"; print "!!!!!!! return value: $ret\n"; exit 1; } @@ -66,21 +65,21 @@ sub mycheck } return unless @rcfiles; - # files in dlls/ are compiled with __WINESRC__ - $defs .= " -D__WINESRC__" if ($dir =~ m,^dlls,); + # files in dlls/ are compiled with __WINESRC__ + my @defs = split /s+/, $defs; + push @defs, "-D__WINESRC__" if ($dir =~ m,^dlls,); - print STDERR "*** $dir [$defs]\n"; + printf STDERR "*** $dir [%s]\n", join( " ", @defs ); - my $incl = "-I$srcdir/$dir -I$objdir/$dir -I$srcdir/include -I$objdir/include"; + my @incl = ("-I$srcdir/$dir", "-I$objdir/$dir", "-I$srcdir/include", "-I$objdir/include"); my $norm_fn = $dir; $norm_fn =~ s/[^a-zA-Z0-9]/-/g; - my $targets = join( " ", map { (my $ret = $_) =~ s/.rc$/.res/; $ret; } @rcfiles ); - my $srcs = join( " ", @srcs ); - my $objs = join( " ", map { (my $ret = "$objdir/$dir/$_") =~ s/.rc$/.res/; $ret; } @rcfiles ); + my @targets = map { (my $ret = $_) =~ s/.rc$/.res/; $ret; } @rcfiles; + my @objs = map { (my $ret = "$objdir/$dir/$_") =~ s/.rc$/.res/; $ret; } @rcfiles; - shell "make -C $objdir/$dir -s $targets"; - shell "$toolsdir/tools/winebuild/winebuild --resources -o $workdir/res/$norm_fn.res $objs"; + shell "make", "-C", "$objdir/$dir", "-s", @targets; + shell "$toolsdir/tools/winebuild/winebuild", "--resources", "-o", "$workdir/res/$norm_fn.res", @objs; my $type = -1; my $resource; @@ -99,7 +98,7 @@ sub mycheck if ($mode eq "locale") { - open(VERIFY, "$wrc $incl --verify-translation $defs $srcs|"); + open VERIFY, "-|" or exec $wrc, "--verify-translation", @incl, @defs, @srcs; while (<VERIFY>) { if (m/^EXIST ([0-9a-f]{3}:[0-9a-f]{2})/) @@ -116,7 +115,7 @@ sub mycheck return; } - open(VERIFY, "$wrc $incl --verify-translation $defs $srcs|"); + open VERIFY, "-|" or exec $wrc, "--verify-translation", @incl, @defs, @srcs; while (<VERIFY>) { if (m/^TYPE NEXT/)
1
0
0
0
← Newer
1
...
11
12
13
14
15
16
17
...
107
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
Results per page:
10
25
50
100
200