Commit 17c6e285 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

eject: Use wide-char string literals.

parent 412db778
...@@ -37,17 +37,15 @@ static BOOL eject_all; ...@@ -37,17 +37,15 @@ static BOOL eject_all;
/* wrapper for GetDriveTypeW */ /* wrapper for GetDriveTypeW */
static DWORD get_drive_type( WCHAR drive ) static DWORD get_drive_type( WCHAR drive )
{ {
static const WCHAR rootW[] = {'a',':','\\',0};
WCHAR path[16]; WCHAR path[16];
memcpy( path, rootW, sizeof(rootW) ); lstrcpyW( path, L"a:\\" );
path[0] = drive; path[0] = drive;
return GetDriveTypeW( path ); return GetDriveTypeW( path );
} }
static BOOL eject_cd( WCHAR drive ) static BOOL eject_cd( WCHAR drive )
{ {
static const WCHAR deviceW[] = {'\\','\\','.','\\','a',':',0};
PREVENT_MEDIA_REMOVAL removal; PREVENT_MEDIA_REMOVAL removal;
WCHAR buffer[16]; WCHAR buffer[16];
HANDLE handle; HANDLE handle;
...@@ -59,7 +57,7 @@ static BOOL eject_cd( WCHAR drive ) ...@@ -59,7 +57,7 @@ static BOOL eject_cd( WCHAR drive )
return FALSE; return FALSE;
} }
memcpy( buffer, deviceW, sizeof(deviceW) ); lstrcpyW( buffer, L"\\\\.\\a:" );
buffer[4] = drive; buffer[4] = drive;
handle = CreateFileW( buffer, 0, FILE_SHARE_READ|FILE_SHARE_WRITE, handle = CreateFileW( buffer, 0, FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, 0, 0 ); NULL, OPEN_EXISTING, 0, 0 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment