Commit 2377fc09 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

scrrun: Implement TotalSize property for a drive.

parent f6efe226
...@@ -753,8 +753,18 @@ static HRESULT WINAPI drive_get_FreeSpace(IDrive *iface, VARIANT *v) ...@@ -753,8 +753,18 @@ static HRESULT WINAPI drive_get_FreeSpace(IDrive *iface, VARIANT *v)
static HRESULT WINAPI drive_get_TotalSize(IDrive *iface, VARIANT *v) static HRESULT WINAPI drive_get_TotalSize(IDrive *iface, VARIANT *v)
{ {
struct drive *This = impl_from_IDrive(iface); struct drive *This = impl_from_IDrive(iface);
FIXME("(%p)->(%p): stub\n", This, v); ULARGE_INTEGER total;
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, v);
if (!v)
return E_POINTER;
if (!GetDiskFreeSpaceExW(This->root, NULL, &total, NULL))
return E_FAIL;
V_VT(v) = VT_R8;
return VarR8FromUI8(total.QuadPart, &V_R8(v));
} }
static HRESULT WINAPI drive_get_VolumeName(IDrive *iface, BSTR *name) static HRESULT WINAPI drive_get_VolumeName(IDrive *iface, BSTR *name)
......
...@@ -1247,12 +1247,22 @@ static void test_DriveCollection(void) ...@@ -1247,12 +1247,22 @@ static void test_DriveCollection(void)
hr = IDrive_get_IsReady(drive, NULL); hr = IDrive_get_IsReady(drive, NULL);
ok(hr == E_POINTER, "got 0x%08x\n", hr); ok(hr == E_POINTER, "got 0x%08x\n", hr);
hr = IDrive_get_TotalSize(drive, NULL);
ok(hr == E_POINTER, "got 0x%08x\n", hr);
if (type == Fixed) { if (type == Fixed) {
VARIANT_BOOL ready = VARIANT_FALSE; VARIANT_BOOL ready = VARIANT_FALSE;
VARIANT size;
hr = IDrive_get_IsReady(drive, &ready); hr = IDrive_get_IsReady(drive, &ready);
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
ok(ready == VARIANT_TRUE, "got %x\n", ready); ok(ready == VARIANT_TRUE, "got %x\n", ready);
V_VT(&size) = VT_EMPTY;
hr = IDrive_get_TotalSize(drive, &size);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(V_VT(&size) == VT_R8, "got %d\n", V_VT(&size));
ok(V_R8(&size) > 0, "got %f\n", V_R8(&size));
} }
VariantClear(&var); VariantClear(&var);
} }
......
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