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
161a53f2
Commit
161a53f2
authored
Nov 16, 2006
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Nov 17, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winecfg: Allow editing of broken drive links.
parent
fa47970e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
5 deletions
+36
-5
drive.c
programs/winecfg/drive.c
+36
-5
No files found.
programs/winecfg/drive.c
View file @
161a53f2
...
@@ -21,6 +21,9 @@
...
@@ -21,6 +21,9 @@
*
*
*/
*/
#include "config.h"
#include "wine/port.h"
#include <assert.h>
#include <assert.h>
#include <stdarg.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdio.h>
...
@@ -35,6 +38,7 @@
...
@@ -35,6 +38,7 @@
#include <shlguid.h>
#include <shlguid.h>
#include <shlwapi.h>
#include <shlwapi.h>
#include <shlobj.h>
#include <shlobj.h>
#include <wine/library.h>
#include "winecfg.h"
#include "winecfg.h"
#include "resource.h"
#include "resource.h"
...
@@ -263,12 +267,11 @@ void load_drives()
...
@@ -263,12 +267,11 @@ void load_drives()
int
drivecount
=
0
,
i
;
int
drivecount
=
0
,
i
;
int
retval
;
int
retval
;
static
const
int
arraysize
=
512
;
static
const
int
arraysize
=
512
;
const
char
*
config_dir
=
wine_get_config_dir
();
char
*
path
;
WINE_TRACE
(
"
\n
"
);
WINE_TRACE
(
"
\n
"
);
/* FIXME: broken symlinks in $WINEPREFIX/dosdevices will not be
returned by this API, so we need to handle that */
/* setup the drives array */
/* setup the drives array */
dev
=
devices
=
HeapAlloc
(
GetProcessHeap
(),
0
,
arraysize
);
dev
=
devices
=
HeapAlloc
(
GetProcessHeap
(),
0
,
arraysize
);
len
=
GetLogicalDriveStrings
(
arraysize
,
devices
);
len
=
GetLogicalDriveStrings
(
arraysize
,
devices
);
...
@@ -360,8 +363,37 @@ void load_drives()
...
@@ -360,8 +363,37 @@ void load_drives()
drivecount
++
;
drivecount
++
;
}
}
/* Find all the broken symlinks we might have and add them as well. */
len
=
strlen
(
config_dir
)
+
sizeof
(
"/dosdevices/a:"
);
if
(
!
(
path
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
)))
return
;
strcpy
(
path
,
config_dir
);
strcat
(
path
,
"/dosdevices/a:"
);
for
(
i
=
0
;
i
<
26
;
i
++
)
{
char
buff
[
MAX_PATH
];
struct
stat
st
;
int
cnt
;
if
(
drives
[
i
].
in_use
)
continue
;
path
[
len
-
3
]
=
'a'
+
i
;
if
(
lstat
(
path
,
&
st
)
==
-
1
||
!
S_ISLNK
(
st
.
st_mode
))
continue
;
if
((
cnt
=
readlink
(
path
,
buff
,
sizeof
(
buff
)))
==
-
1
)
continue
;
buff
[
cnt
]
=
'\0'
;
WINE_TRACE
(
"found broken symlink %s -> %s
\n
"
,
path
,
buff
);
add_drive
(
'A'
+
i
,
buff
,
""
,
"0"
,
DRIVE_UNKNOWN
);
drivecount
++
;
}
WINE_TRACE
(
"found %d drives
\n
"
,
drivecount
);
WINE_TRACE
(
"found %d drives
\n
"
,
drivecount
);
HeapFree
(
GetProcessHeap
(),
0
,
path
);
HeapFree
(
GetProcessHeap
(),
0
,
dev
);
HeapFree
(
GetProcessHeap
(),
0
,
dev
);
}
}
...
@@ -421,9 +453,8 @@ void apply_drive_changes(void)
...
@@ -421,9 +453,8 @@ void apply_drive_changes(void)
if
(
!
retval
)
if
(
!
retval
)
{
{
WINE_TRACE
(
" GetVolumeInformation() for '%s' failed
\n
"
,
devicename
);
WINE_TRACE
(
" GetVolumeInformation() for '%s' failed
\n
"
,
devicename
);
WINE_TRACE
(
" Skipping this drive
\n
"
);
PRINTERROR
();
PRINTERROR
();
continue
;
/* skip this drive */
volumeNameBuffer
[
0
]
=
'\0'
;
}
}
WINE_TRACE
(
" current path: '%s', new path: '%s'
\n
"
,
WINE_TRACE
(
" current path: '%s', new path: '%s'
\n
"
,
...
...
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