Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
ab6fa810
Commit
ab6fa810
authored
Oct 03, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
explorer: Avoid repeated notifications on device removal.
parent
dde935d1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
device.c
programs/explorer/device.c
+12
-6
No files found.
programs/explorer/device.c
View file @
ab6fa810
...
...
@@ -143,13 +143,14 @@ done:
return
drive
;
}
static
void
set_mount_point
(
struct
dos_drive
*
drive
,
const
char
*
mount_point
)
static
BOOL
set_mount_point
(
struct
dos_drive
*
drive
,
const
char
*
mount_point
)
{
char
*
path
,
*
p
;
struct
stat
path_st
,
mnt_st
;
BOOL
modified
=
FALSE
;
if
(
drive
->
drive
==
-
1
)
return
;
if
(
!
(
path
=
get_dosdevices_path
()))
return
;
if
(
drive
->
drive
==
-
1
)
return
FALSE
;
if
(
!
(
path
=
get_dosdevices_path
()))
return
FALSE
;
p
=
path
+
strlen
(
path
)
-
3
;
*
p
=
'a'
+
drive
->
drive
;
p
[
2
]
=
0
;
...
...
@@ -162,11 +163,16 @@ static void set_mount_point( struct dos_drive *drive, const char *mount_point )
{
unlink
(
path
);
symlink
(
mount_point
,
path
);
modified
=
TRUE
;
}
}
else
unlink
(
path
);
else
{
if
(
unlink
(
path
)
!=
-
1
)
modified
=
TRUE
;
}
HeapFree
(
GetProcessHeap
(),
0
,
path
);
return
modified
;
}
BOOL
add_dos_device
(
const
char
*
udi
,
const
char
*
device
,
...
...
@@ -227,7 +233,7 @@ BOOL remove_dos_device( const char *udi )
if
(
drive
->
drive
!=
-
1
)
{
set_mount_point
(
drive
,
""
);
BOOL
modified
=
set_mount_point
(
drive
,
""
);
/* clear the registry key too */
if
(
!
RegOpenKeyA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
Drives"
,
&
hkey
))
...
...
@@ -238,7 +244,7 @@ BOOL remove_dos_device( const char *udi )
RegCloseKey
(
hkey
);
}
send_notify
(
drive
->
drive
,
DBT_DEVICEREMOVECOMPLETE
);
if
(
modified
)
send_notify
(
drive
->
drive
,
DBT_DEVICEREMOVECOMPLETE
);
}
list_remove
(
&
drive
->
entry
);
...
...
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