Nikolay Sivov : scrrun: Implement FileSystem property.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Jun 24 14:28:32 CDT 2014


Module: wine
Branch: master
Commit: 6a2e1b3f31bf3f6745fe26583620be03c5db0bfe
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6a2e1b3f31bf3f6745fe26583620be03c5db0bfe

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Mon Jun 23 22:05:26 2014 +0400

scrrun: Implement FileSystem property.

---

 dlls/scrrun/filesystem.c       | 15 +++++++++++++--
 dlls/scrrun/tests/filesystem.c | 10 ++++++++++
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/dlls/scrrun/filesystem.c b/dlls/scrrun/filesystem.c
index 4d3c117..fc8531c 100644
--- a/dlls/scrrun/filesystem.c
+++ b/dlls/scrrun/filesystem.c
@@ -971,8 +971,19 @@ static HRESULT WINAPI drive_put_VolumeName(IDrive *iface, BSTR name)
 static HRESULT WINAPI drive_get_FileSystem(IDrive *iface, BSTR *fs)
 {
     struct drive *This = impl_from_IDrive(iface);
-    FIXME("(%p)->(%p): stub\n", This, fs);
-    return E_NOTIMPL;
+    WCHAR nameW[MAX_PATH+1];
+    BOOL ret;
+
+    TRACE("(%p)->(%p)\n", This, fs);
+
+    if (!fs)
+        return E_POINTER;
+
+    *fs = NULL;
+    ret = GetVolumeInformationW(This->root, NULL, 0, NULL, NULL, NULL, nameW, sizeof(nameW)/sizeof(WCHAR));
+    if (ret)
+        *fs = SysAllocString(nameW);
+    return ret ? S_OK : E_FAIL;
 }
 
 static HRESULT WINAPI drive_get_SerialNumber(IDrive *iface, LONG *serial)
diff --git a/dlls/scrrun/tests/filesystem.c b/dlls/scrrun/tests/filesystem.c
index 7b9354e..ac78483 100644
--- a/dlls/scrrun/tests/filesystem.c
+++ b/dlls/scrrun/tests/filesystem.c
@@ -1798,6 +1798,7 @@ static void test_SerialNumber(void)
     VARIANT var;
     LONG serial;
     HRESULT hr;
+    BSTR name;
 
     hr = IFileSystem3_get_Drives(fs3, &drives);
     ok(hr == S_OK, "got 0x%08x\n", hr);
@@ -1820,6 +1821,15 @@ static void test_SerialNumber(void)
     ok(hr == S_OK, "got 0x%08x\n", hr);
     ok(serial != 0xdeadbeef, "got %x\n", serial);
 
+    hr = IDrive_get_FileSystem(drive, NULL);
+    ok(hr == E_POINTER, "got 0x%08x\n", hr);
+
+    name = NULL;
+    hr = IDrive_get_FileSystem(drive, &name);
+    ok(hr == S_OK, "got 0x%08x\n", hr);
+    ok(name != NULL, "got %p\n", name);
+    SysFreeString(name);
+
     IDrive_Release(drive);
     IEnumVARIANT_Release(iter);
     IDriveCollection_Release(drives);




More information about the wine-cvs mailing list