Nikolay Sivov : scrrun: Implement DriveType property of IDrive.
Alexandre Julliard
julliard at winehq.org
Tue Feb 25 16:58:15 CST 2014
Module: wine
Branch: master
Commit: 17c4c1bef53544e756dd8dc7ad93402749d5cf54
URL: http://source.winehq.org/git/wine.git/?a=commit;h=17c4c1bef53544e756dd8dc7ad93402749d5cf54
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Tue Feb 25 09:25:54 2014 +0400
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 2e45809..70bc341 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 91c6314..eec8743 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
More information about the wine-cvs
mailing list