From 17c4c1bef53544e756dd8dc7ad93402749d5cf54 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Tue, 25 Feb 2014 09:25:54 +0400 Subject: [PATCH] scrrun: Implement DriveType property of IDrive. --- dlls/scrrun/filesystem.c | 30 +++++++++++++++++++++++++++--- dlls/scrrun/scrrun.idl | 12 ++++++------ 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/dlls/scrrun/filesystem.c b/dlls/scrrun/filesystem.c index 2e45809b822..70bc3416591 100644 --- a/dlls/scrrun/filesystem.c +++ b/dlls/scrrun/filesystem.c @@ -573,11 +573,35 @@ static HRESULT WINAPI drive_get_ShareName(IDrive *iface, BSTR *share_name) return E_NOTIMPL; } -static HRESULT WINAPI drive_get_DriveType(IDrive *iface, DriveTypeConst *ptype) +static HRESULT WINAPI drive_get_DriveType(IDrive *iface, DriveTypeConst *type) { struct drive *This = impl_from_IDrive(iface); - FIXME("(%p)->(%p): stub\n", This, ptype); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, type); + + switch (GetDriveTypeW(This->root)) + { + case DRIVE_REMOVABLE: + *type = Removable; + break; + case DRIVE_FIXED: + *type = Fixed; + break; + case DRIVE_REMOTE: + *type = Remote; + break; + case DRIVE_CDROM: + *type = CDRom; + break; + case DRIVE_RAMDISK: + *type = RamDisk; + break; + default: + *type = UnknownType; + break; + } + + return S_OK; } static HRESULT WINAPI drive_get_RootFolder(IDrive *iface, IFolder **folder) diff --git a/dlls/scrrun/scrrun.idl b/dlls/scrrun/scrrun.idl index 91c6314c203..eec87437fbe 100644 --- a/dlls/scrrun/scrrun.idl +++ b/dlls/scrrun/scrrun.idl @@ -92,12 +92,12 @@ library Scripting typedef enum DriveTypeConst { - UnknownType = 0, - Removable = 1, - Fixed = 2, - Remote = 3, - CDRom = 4, - RamDisk = 5 + UnknownType, + Removable, + Fixed, + Remote, + CDRom, + RamDisk } DriveTypeConst; typedef enum StandardStreamTypes