diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c index a657cf19d29..724c618be20 100644 --- a/dlls/mountmgr.sys/device.c +++ b/dlls/mountmgr.sys/device.c @@ -915,13 +915,7 @@ static BOOL get_volume_device_info( struct volume *volume ) if (!unix_device) return FALSE; -#ifdef __APPLE__ - if (access( unix_device, R_OK )) - { - WARN("Unable to open %s, not accessible\n", debugstr_a(unix_device)); - return FALSE; - } -#endif + if (MOUNTMGR_CALL( check_device_access, volume->device->unix_device )) return FALSE; if (!(name = wine_get_dos_file_name( unix_device ))) { diff --git a/dlls/mountmgr.sys/unixlib.c b/dlls/mountmgr.sys/unixlib.c index e45b6696ae6..52a3fce66d6 100644 --- a/dlls/mountmgr.sys/unixlib.c +++ b/dlls/mountmgr.sys/unixlib.c @@ -319,6 +319,15 @@ static NTSTATUS match_unixdev( void *args ) return !stat( params->device, &st ) && st.st_rdev == params->unix_dev; } +static NTSTATUS check_device_access( void *args ) +{ +#ifdef __APPLE__ + const char *unix_device = args; + if (access( unix_device, R_OK )) return STATUS_ACCESS_DENIED; +#endif + return STATUS_SUCCESS; +} + static NTSTATUS detect_serial_ports( void *args ) { const struct detect_ports_params *params = args; @@ -434,6 +443,7 @@ const unixlib_entry_t __wine_unix_call_funcs[] = get_volume_dos_devices, read_volume_file, match_unixdev, + check_device_access, detect_serial_ports, detect_parallel_ports, set_shell_folder, diff --git a/dlls/mountmgr.sys/unixlib.h b/dlls/mountmgr.sys/unixlib.h index 08f7e313236..e7846a764da 100644 --- a/dlls/mountmgr.sys/unixlib.h +++ b/dlls/mountmgr.sys/unixlib.h @@ -145,6 +145,7 @@ enum mountmgr_funcs unix_get_volume_dos_devices, unix_read_volume_file, unix_match_unixdev, + unix_check_device_access, unix_detect_serial_ports, unix_detect_parallel_ports, unix_set_shell_folder,