wbemprox: Implement Win32_LogicalDisk.Caption.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50643
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hans Leidekker 2021-02-09 10:12:54 +01:00 committed by Alexandre Julliard
parent cae84e2b06
commit 14905720ed
2 changed files with 31 additions and 0 deletions

View file

@ -177,6 +177,7 @@ static const struct column col_ip4routetable[] =
};
static const struct column col_logicaldisk[] =
{
{ L"Caption", CIM_STRING|COL_FLAG_DYNAMIC },
{ L"DeviceId", CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY },
{ L"DriveType", CIM_UINT32 },
{ L"FileSystem", CIM_STRING|COL_FLAG_DYNAMIC },
@ -585,6 +586,7 @@ struct record_ip4routetable
};
struct record_logicaldisk
{
const WCHAR *caption;
const WCHAR *device_id;
UINT32 drivetype;
const WCHAR *filesystem;
@ -2501,6 +2503,7 @@ static enum fill_status fill_logicaldisk( struct table *table, const struct expr
rec = (struct record_logicaldisk *)(table->data + offset);
swprintf( device_id, ARRAY_SIZE( device_id ), L"%c:", 'A' + i );
rec->caption = heap_strdupW( device_id );
rec->device_id = heap_strdupW( device_id );
rec->drivetype = type;
rec->filesystem = get_filesystem( root );

View file

@ -1905,6 +1905,33 @@ static void test_SystemRestore( IWbemServices *services )
SysFreeString( class );
}
static void test_Win32_LogicalDisk( IWbemServices *services )
{
BSTR wql = SysAllocString( L"wql" );
BSTR query = SysAllocString( L"SELECT * FROM Win32_LogicalDisk" );
IEnumWbemClassObject *result;
IWbemClassObject *obj;
HRESULT hr;
DWORD count;
hr = IWbemServices_ExecQuery( services, wql, query, 0, NULL, &result );
ok( hr == S_OK, "got %08x\n", hr );
for (;;)
{
hr = IEnumWbemClassObject_Next( result, 10000, 1, &obj, &count );
if (hr != S_OK) break;
check_property( obj, L"Caption", VT_BSTR, CIM_STRING );
check_property( obj, L"Name", VT_BSTR, CIM_STRING );
IWbemClassObject_Release( obj );
}
IEnumWbemClassObject_Release( result );
SysFreeString( query );
SysFreeString( wql );
}
START_TEST(query)
{
BSTR path = SysAllocString( L"ROOT\\CIMV2" );
@ -1955,6 +1982,7 @@ START_TEST(query)
test_Win32_DiskDrive( services );
test_Win32_DisplayControllerConfiguration( services );
test_Win32_IP4RouteTable( services );
test_Win32_LogicalDisk( services );
test_Win32_NetworkAdapter( services );
test_Win32_NetworkAdapterConfiguration( services );
test_Win32_OperatingSystem( services );