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
17c6e285
Commit
17c6e285
authored
Oct 08, 2020
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Oct 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eject: Use wide-char string literals.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
412db778
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
eject.c
programs/eject/eject.c
+2
-4
No files found.
programs/eject/eject.c
View file @
17c6e285
...
...
@@ -37,17 +37,15 @@ static BOOL eject_all;
/* wrapper for GetDriveTypeW */
static
DWORD
get_drive_type
(
WCHAR
drive
)
{
static
const
WCHAR
rootW
[]
=
{
'a'
,
':'
,
'\\'
,
0
};
WCHAR
path
[
16
];
memcpy
(
path
,
rootW
,
sizeof
(
rootW
)
);
lstrcpyW
(
path
,
L"a:
\\
"
);
path
[
0
]
=
drive
;
return
GetDriveTypeW
(
path
);
}
static
BOOL
eject_cd
(
WCHAR
drive
)
{
static
const
WCHAR
deviceW
[]
=
{
'\\'
,
'\\'
,
'.'
,
'\\'
,
'a'
,
':'
,
0
};
PREVENT_MEDIA_REMOVAL
removal
;
WCHAR
buffer
[
16
];
HANDLE
handle
;
...
...
@@ -59,7 +57,7 @@ static BOOL eject_cd( WCHAR drive )
return
FALSE
;
}
memcpy
(
buffer
,
deviceW
,
sizeof
(
deviceW
)
);
lstrcpyW
(
buffer
,
L"
\\\\
.
\\
a:"
);
buffer
[
4
]
=
drive
;
handle
=
CreateFileW
(
buffer
,
0
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
OPEN_EXISTING
,
0
,
0
);
...
...
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