Nikolay Sivov : scrrun: Implement DriveLetter property for a drive.
Alexandre Julliard
julliard at winehq.org
Mon Mar 31 13:32:43 CDT 2014
Module: wine
Branch: master
Commit: c824cfa08c5a0e66b0fc75ebee1a5e2af56e86e2
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c824cfa08c5a0e66b0fc75ebee1a5e2af56e86e2
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Sun Mar 30 15:59:17 2014 +0400
scrrun: Implement DriveLetter property for a drive.
---
dlls/scrrun/filesystem.c | 13 +++++++++++--
dlls/scrrun/tests/filesystem.c | 9 +++++++++
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/dlls/scrrun/filesystem.c b/dlls/scrrun/filesystem.c
index a1eb6c1..cd0ec2b 100644
--- a/dlls/scrrun/filesystem.c
+++ b/dlls/scrrun/filesystem.c
@@ -687,8 +687,17 @@ static HRESULT WINAPI drive_get_Path(IDrive *iface, BSTR *path)
static HRESULT WINAPI drive_get_DriveLetter(IDrive *iface, BSTR *letter)
{
struct drive *This = impl_from_IDrive(iface);
- FIXME("(%p)->(%p): stub\n", This, letter);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%p)\n", This, letter);
+
+ if (!letter)
+ return E_POINTER;
+
+ *letter = SysAllocStringLen(This->root, 1);
+ if (!*letter)
+ return E_OUTOFMEMORY;
+
+ return S_OK;
}
static HRESULT WINAPI drive_get_ShareName(IDrive *iface, BSTR *share_name)
diff --git a/dlls/scrrun/tests/filesystem.c b/dlls/scrrun/tests/filesystem.c
index 3bf1209..d947d15 100644
--- a/dlls/scrrun/tests/filesystem.c
+++ b/dlls/scrrun/tests/filesystem.c
@@ -1240,10 +1240,19 @@ static void test_DriveCollection(void)
while (IEnumVARIANT_Next(enumvar, 1, &var, &fetched) == S_OK) {
IDrive *drive = (IDrive*)V_DISPATCH(&var);
DriveTypeConst type;
+ BSTR str;
hr = IDrive_get_DriveType(drive, &type);
ok(hr == S_OK, "got 0x%08x\n", hr);
+ hr = IDrive_get_DriveLetter(drive, NULL);
+ ok(hr == E_POINTER, "got 0x%08x\n", hr);
+
+ hr = IDrive_get_DriveLetter(drive, &str);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(SysStringLen(str) == 1, "got string %s\n", wine_dbgstr_w(str));
+ SysFreeString(str);
+
hr = IDrive_get_IsReady(drive, NULL);
ok(hr == E_POINTER, "got 0x%08x\n", hr);
More information about the wine-cvs
mailing list