eject: Use wide-char string literals.

Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2020-10-08 23:27:58 +02:00 committed by Alexandre Julliard
parent 412db77893
commit 17c6e28513
1 changed files with 2 additions and 4 deletions

View File

@ -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 );