https://bugs.winehq.org/show_bug.cgi?id=52887
Signed-off-by: Louis Lenders xerox.xerox2000x@gmail.com --- dlls/wbemprox/builtin.c | 13 +++++++++++++ dlls/wbemprox/tests/query.c | 26 ++++++++++++++++++++++++++ 2 files changed, 39 insertions(+)
diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index 07a5873208f..69d74d756f8 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -260,6 +260,10 @@ static const struct column col_operatingsystem[] = { L"TotalVisibleMemorySize", CIM_UINT64 }, { L"Version", CIM_STRING|COL_FLAG_DYNAMIC }, }; +static const struct column col_pagefileusage[] = +{ + { L"Name", CIM_STRING }, +}; static const struct column col_param[] = { { L"Class", CIM_STRING }, @@ -687,6 +691,10 @@ struct record_operatingsystem UINT64 totalvisiblememorysize; const WCHAR *version; }; +struct record_pagefileusage +{ + const WCHAR *name; +}; struct record_param { const WCHAR *class; @@ -911,6 +919,10 @@ static const struct record_associator data_associator[] = { L"Win32_DiskDriveToDiskPartition", L"Win32_DiskPartition", L"Win32_DiskDrive" }, { L"Win32_LogicalDiskToPartition", L"Win32_LogicalDisk", L"Win32_DiskPartition" }, }; +static const struct record_pagefileusage data_pagefileusage[] = +{ + { L"c:\pagefile.sys", }, +}; static const struct record_param data_param[] = { { L"__SystemSecurity", L"GetSD", -1, L"ReturnValue", CIM_UINT32 }, @@ -4148,6 +4160,7 @@ static struct table cimv2_builtin_classes[] = { L"Win32_NetworkAdapter", C(col_networkadapter), 0, 0, NULL, fill_networkadapter }, { L"Win32_NetworkAdapterConfiguration", C(col_networkadapterconfig), 0, 0, NULL, fill_networkadapterconfig }, { L"Win32_OperatingSystem", C(col_operatingsystem), 0, 0, NULL, fill_operatingsystem }, + { L"Win32_PageFileUsage", C(col_pagefileusage), D(data_pagefileusage) }, { L"Win32_PhysicalMedia", C(col_physicalmedia), D(data_physicalmedia) }, { L"Win32_PhysicalMemory", C(col_physicalmemory), 0, 0, NULL, fill_physicalmemory }, { L"Win32_PnPEntity", C(col_pnpentity), 0, 0, NULL, fill_pnpentity }, diff --git a/dlls/wbemprox/tests/query.c b/dlls/wbemprox/tests/query.c index 0a8c97ad166..e0fe78b7fd1 100644 --- a/dlls/wbemprox/tests/query.c +++ b/dlls/wbemprox/tests/query.c @@ -1475,6 +1475,31 @@ static void test_Win32_ComputerSystemProduct( IWbemServices *services ) SysFreeString( wql ); }
+static void test_Win32_PageFileUsage( IWbemServices *services ) +{ + BSTR wql = SysAllocString( L"wql" ), query = SysAllocString( L"SELECT * FROM Win32_PageFileUsage" ); + IEnumWbemClassObject *result; + IWbemClassObject *obj; + HRESULT hr; + DWORD count; + + hr = IWbemServices_ExecQuery( services, wql, query, 0, NULL, &result ); + ok( hr == S_OK , "got %#lx\n", hr ); + + for (;;) + { + hr = IEnumWbemClassObject_Next( result, 10000, 1, &obj, &count ); + if (hr != S_OK) break; + + check_property( obj, L"Name", VT_BSTR, CIM_STRING ); + IWbemClassObject_Release( obj ); + } + + IEnumWbemClassObject_Release( result ); + SysFreeString( query ); + SysFreeString( wql ); +} + static void test_Win32_PhysicalMemory( IWbemServices *services ) { BSTR wql = SysAllocString( L"wql" ), query = SysAllocString( L"SELECT * FROM Win32_PhysicalMemory" ); @@ -2226,6 +2251,7 @@ START_TEST(query) test_Win32_NetworkAdapter( services ); test_Win32_NetworkAdapterConfiguration( services ); test_Win32_OperatingSystem( services ); + test_Win32_PageFileUsage( services ); test_Win32_PhysicalMemory( services ); test_Win32_PnPEntity( services ); test_Win32_Printer( services );