Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
19e2d0cd
Commit
19e2d0cd
authored
Jul 21, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mountmgr: Create volumes for non-removable volumes reported by HAL/Disk Arbitration.
parent
22f58341
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
17 deletions
+18
-17
diskarb.c
dlls/mountmgr.sys/diskarb.c
+10
-10
hal.c
dlls/mountmgr.sys/hal.c
+8
-7
No files found.
dlls/mountmgr.sys/diskarb.c
View file @
19e2d0cd
...
@@ -47,10 +47,6 @@ static void appeared_callback( DADiskRef disk, void *context )
...
@@ -47,10 +47,6 @@ static void appeared_callback( DADiskRef disk, void *context )
if
(
!
dict
)
return
;
if
(
!
dict
)
return
;
/* ignore non-removable devices */
if
(
!
(
ref
=
CFDictionaryGetValue
(
dict
,
CFSTR
(
"DAMediaRemovable"
)
))
||
!
CFBooleanGetValue
(
ref
))
goto
done
;
if
((
ref
=
CFDictionaryGetValue
(
dict
,
CFSTR
(
"DAVolumeUUID"
)
)))
if
((
ref
=
CFDictionaryGetValue
(
dict
,
CFSTR
(
"DAVolumeUUID"
)
)))
{
{
CFUUIDBytes
bytes
=
CFUUIDGetUUIDBytes
(
ref
);
CFUUIDBytes
bytes
=
CFUUIDGetUUIDBytes
(
ref
);
...
@@ -78,7 +74,11 @@ static void appeared_callback( DADiskRef disk, void *context )
...
@@ -78,7 +74,11 @@ static void appeared_callback( DADiskRef disk, void *context )
TRACE
(
"got mount notification for '%s' on '%s' uuid %s
\n
"
,
TRACE
(
"got mount notification for '%s' on '%s' uuid %s
\n
"
,
device
,
mount_point
,
wine_dbgstr_guid
(
guid_ptr
)
);
device
,
mount_point
,
wine_dbgstr_guid
(
guid_ptr
)
);
add_dos_device
(
-
1
,
device
,
device
,
mount_point
,
type
,
guid_ptr
);
if
((
ref
=
CFDictionaryGetValue
(
dict
,
CFSTR
(
"DAMediaRemovable"
)
))
&&
CFBooleanGetValue
(
ref
))
add_dos_device
(
-
1
,
device
,
device
,
mount_point
,
type
,
guid_ptr
);
else
if
(
guid_ptr
)
add_volume
(
device
,
device
,
mount_point
,
DEVICE_HARDDISK_VOL
,
guid_ptr
);
done:
done:
CFRelease
(
dict
);
CFRelease
(
dict
);
}
}
...
@@ -96,10 +96,6 @@ static void disappeared_callback( DADiskRef disk, void *context )
...
@@ -96,10 +96,6 @@ static void disappeared_callback( DADiskRef disk, void *context )
if
(
!
dict
)
return
;
if
(
!
dict
)
return
;
/* ignore non-removable devices */
if
(
!
(
ref
=
CFDictionaryGetValue
(
dict
,
CFSTR
(
"DAMediaRemovable"
)
))
||
!
CFBooleanGetValue
(
ref
))
goto
done
;
/* get device name */
/* get device name */
if
(
!
(
ref
=
CFDictionaryGetValue
(
dict
,
CFSTR
(
"DAMediaBSDName"
)
)))
goto
done
;
if
(
!
(
ref
=
CFDictionaryGetValue
(
dict
,
CFSTR
(
"DAMediaBSDName"
)
)))
goto
done
;
strcpy
(
device
,
"/dev/r"
);
strcpy
(
device
,
"/dev/r"
);
...
@@ -107,7 +103,11 @@ static void disappeared_callback( DADiskRef disk, void *context )
...
@@ -107,7 +103,11 @@ static void disappeared_callback( DADiskRef disk, void *context )
TRACE
(
"got unmount notification for '%s'
\n
"
,
device
);
TRACE
(
"got unmount notification for '%s'
\n
"
,
device
);
remove_dos_device
(
-
1
,
device
);
if
((
ref
=
CFDictionaryGetValue
(
dict
,
CFSTR
(
"DAMediaRemovable"
)
))
&&
CFBooleanGetValue
(
ref
))
remove_dos_device
(
-
1
,
device
);
else
remove_volume
(
device
);
done:
done:
CFRelease
(
dict
);
CFRelease
(
dict
);
}
}
...
...
dlls/mountmgr.sys/hal.c
View file @
19e2d0cd
...
@@ -156,9 +156,6 @@ static void new_device( LibHalContext *ctx, const char *udi )
...
@@ -156,9 +156,6 @@ static void new_device( LibHalContext *ctx, const char *udi )
if
(
!
(
parent
=
p_libhal_device_get_property_string
(
ctx
,
udi
,
"info.parent"
,
&
error
)))
if
(
!
(
parent
=
p_libhal_device_get_property_string
(
ctx
,
udi
,
"info.parent"
,
&
error
)))
goto
done
;
goto
done
;
if
(
!
p_libhal_device_get_property_bool
(
ctx
,
parent
,
"storage.removable"
,
&
error
))
goto
done
;
if
(
!
(
uuid_str
=
p_libhal_device_get_property_string
(
ctx
,
udi
,
"volume.uuid"
,
&
error
)))
if
(
!
(
uuid_str
=
p_libhal_device_get_property_string
(
ctx
,
udi
,
"volume.uuid"
,
&
error
)))
p_dbus_error_free
(
&
error
);
/* ignore error */
p_dbus_error_free
(
&
error
);
/* ignore error */
else
else
...
@@ -171,10 +168,13 @@ static void new_device( LibHalContext *ctx, const char *udi )
...
@@ -171,10 +168,13 @@ static void new_device( LibHalContext *ctx, const char *udi )
else
if
(
type
&&
!
strcmp
(
type
,
"floppy"
))
drive_type
=
DEVICE_FLOPPY
;
else
if
(
type
&&
!
strcmp
(
type
,
"floppy"
))
drive_type
=
DEVICE_FLOPPY
;
else
drive_type
=
DEVICE_UNKNOWN
;
else
drive_type
=
DEVICE_UNKNOWN
;
add_dos_device
(
-
1
,
udi
,
device
,
mount_point
,
drive_type
,
guid_ptr
);
if
(
p_libhal_device_get_property_bool
(
ctx
,
parent
,
"storage.removable"
,
&
error
))
{
/* add property watch for mount point */
add_dos_device
(
-
1
,
udi
,
device
,
mount_point
,
drive_type
,
guid_ptr
);
p_libhal_device_add_property_watch
(
ctx
,
udi
,
&
error
);
/* add property watch for mount point */
p_libhal_device_add_property_watch
(
ctx
,
udi
,
&
error
);
}
else
if
(
guid_ptr
)
add_volume
(
udi
,
device
,
mount_point
,
DEVICE_HARDDISK_VOL
,
guid_ptr
);
done:
done:
if
(
type
)
p_libhal_free_string
(
type
);
if
(
type
)
p_libhal_free_string
(
type
);
...
@@ -198,6 +198,7 @@ static void removed_device( LibHalContext *ctx, const char *udi )
...
@@ -198,6 +198,7 @@ static void removed_device( LibHalContext *ctx, const char *udi )
p_libhal_device_remove_property_watch
(
ctx
,
udi
,
&
error
);
p_libhal_device_remove_property_watch
(
ctx
,
udi
,
&
error
);
p_dbus_error_free
(
&
error
);
p_dbus_error_free
(
&
error
);
}
}
else
remove_volume
(
udi
);
}
}
/* HAL callback for property changes */
/* HAL callback for property changes */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment