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
c02356b8
Commit
c02356b8
authored
Oct 20, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added "autodetect" drive type option.
parent
9c6a15ce
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
17 deletions
+44
-17
drive.c
programs/winecfg/drive.c
+29
-1
driveui.c
programs/winecfg/driveui.c
+15
-16
No files found.
programs/winecfg/drive.c
View file @
c02356b8
...
...
@@ -146,6 +146,34 @@ static void set_drive_type( char letter, DWORD type )
}
}
static
DWORD
get_drive_type
(
char
letter
)
{
HKEY
hKey
;
char
driveValue
[
4
];
DWORD
ret
=
DRIVE_UNKNOWN
;
sprintf
(
driveValue
,
"%c:"
,
letter
);
if
(
RegOpenKey
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
Drives"
,
&
hKey
)
!=
ERROR_SUCCESS
)
WINE_TRACE
(
" Unable to open Software
\\
Wine
\\
Drives
\n
"
);
else
{
char
buffer
[
80
];
DWORD
size
=
sizeof
(
buffer
);
if
(
!
RegQueryValueExA
(
hKey
,
driveValue
,
NULL
,
NULL
,
(
LPBYTE
)
buffer
,
&
size
))
{
WINE_TRACE
(
"Got type '%s' for %s
\n
"
,
buffer
,
driveValue
);
if
(
!
strcasecmp
(
buffer
,
"hd"
))
ret
=
DRIVE_FIXED
;
else
if
(
!
strcasecmp
(
buffer
,
"network"
))
ret
=
DRIVE_REMOTE
;
else
if
(
!
strcasecmp
(
buffer
,
"floppy"
))
ret
=
DRIVE_REMOVABLE
;
else
if
(
!
strcasecmp
(
buffer
,
"cdrom"
))
ret
=
DRIVE_CDROM
;
}
RegCloseKey
(
hKey
);
}
return
ret
;
}
#if 0
/* currently unused, but if users have this burning desire to be able to rename drives,
...
...
@@ -279,7 +307,7 @@ void load_drives()
snprintf
(
serialstr
,
sizeof
(
serialstr
),
"%lX"
,
serial
);
WINE_TRACE
(
"serialstr: '%s'
\n
"
,
serialstr
);
add_drive
(
*
devices
,
targetpath
,
volname
,
serialstr
,
GetDriveType
(
rootpath
)
);
add_drive
(
*
devices
,
targetpath
,
volname
,
serialstr
,
get_drive_type
(
devices
[
0
])
);
len
-=
strlen
(
devices
);
devices
+=
strlen
(
devices
);
...
...
programs/winecfg/driveui.c
View file @
c02356b8
...
...
@@ -139,13 +139,14 @@ struct drive_typemap {
};
static
const
struct
drive_typemap
type_pairs
[]
=
{
{
DRIVE_UNKNOWN
,
"Autodetect"
},
{
DRIVE_FIXED
,
"Local hard disk"
},
{
DRIVE_REMOTE
,
"Network share"
},
{
DRIVE_REMOVABLE
,
"Floppy disk"
},
{
DRIVE_CDROM
,
"CD-ROM"
}
};
#define DRIVE_TYPE_DEFAULT
1
#define DRIVE_TYPE_DEFAULT
0
static
void
fill_drive_droplist
(
long
mask
,
char
curletter
,
HWND
dialog
)
{
...
...
@@ -447,24 +448,20 @@ static void update_controls(HWND dialog)
/* drive type */
type
=
current_drive
->
type
;
if
(
type
)
SendDlgItemMessage
(
dialog
,
IDC_COMBO_TYPE
,
CB_RESETCONTENT
,
0
,
0
);
for
(
i
=
0
;
i
<
sizeof
(
type_pairs
)
/
sizeof
(
struct
drive_typemap
);
i
++
)
{
SendDlgItemMessage
(
dialog
,
IDC_COMBO_TYPE
,
CB_RESETCONTENT
,
0
,
0
);
for
(
i
=
0
;
i
<
sizeof
(
type_pairs
)
/
sizeof
(
struct
drive_typemap
);
i
++
)
{
SendDlgItemMessage
(
dialog
,
IDC_COMBO_TYPE
,
CB_ADDSTRING
,
0
,
(
LPARAM
)
type_pairs
[
i
].
sDesc
);
SendDlgItemMessage
(
dialog
,
IDC_COMBO_TYPE
,
CB_ADDSTRING
,
0
,
(
LPARAM
)
type_pairs
[
i
].
sDesc
);
if
(
type_pairs
[
i
].
sCode
==
type
)
{
selection
=
i
;
}
if
(
type_pairs
[
i
].
sCode
==
type
)
{
selection
=
i
;
}
}
if
(
selection
==
-
1
)
selection
=
DRIVE_TYPE_DEFAULT
;
SendDlgItemMessage
(
dialog
,
IDC_COMBO_TYPE
,
CB_SETCURSEL
,
selection
,
0
);
}
else
WINE_WARN
(
"no Type field?
\n
"
);
if
(
selection
==
-
1
)
selection
=
DRIVE_TYPE_DEFAULT
;
SendDlgItemMessage
(
dialog
,
IDC_COMBO_TYPE
,
CB_SETCURSEL
,
selection
,
0
);
/* removeable media properties */
label
=
current_drive
->
label
;
...
...
@@ -811,7 +808,9 @@ DriveDlgProc (HWND dialog, UINT msg, WPARAM wParam, LPARAM lParam)
selection
=
SendDlgItemMessage
(
dialog
,
IDC_COMBO_TYPE
,
CB_GETCURSEL
,
0
,
0
);
if
(
selection
==
2
||
selection
==
3
)
/* cdrom or floppy */
if
(
selection
>=
0
&&
(
type_pairs
[
selection
].
sCode
==
DRIVE_CDROM
||
type_pairs
[
selection
].
sCode
==
DRIVE_REMOVABLE
))
{
if
(
IsDlgButtonChecked
(
dialog
,
IDC_RADIO_AUTODETECT
))
mode
=
BOX_MODE_CD_AUTODETECT
;
...
...
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