diff --git a/reactos/dll/win32/wbemprox/builtin.c b/reactos/dll/win32/wbemprox/builtin.c index aa33523c5e4..d00ba55c548 100644 --- a/reactos/dll/win32/wbemprox/builtin.c +++ b/reactos/dll/win32/wbemprox/builtin.c @@ -18,6 +18,7 @@ #include "wbemprox_private.h" +#include #include #include #include @@ -42,6 +43,8 @@ static const WCHAR class_compsysproductW[] = {'W','i','n','3','2','_','C','o','m','p','u','t','e','r','S','y','s','t','e','m','P','r','o','d','u','c','t',0}; static const WCHAR class_datafileW[] = {'C','I','M','_','D','a','t','a','F','i','l','e',0}; +static const WCHAR class_desktopmonitorW[] = + {'W','i','n','3','2','_','D','e','s','k','t','o','p','M','o','n','i','t','o','r',0}; static const WCHAR class_directoryW[] = {'W','i','n','3','2','_','D','i','r','e','c','t','o','r','y',0}; static const WCHAR class_diskdriveW[] = @@ -249,6 +252,8 @@ static const WCHAR prop_parameterW[] = {'P','a','r','a','m','e','t','e','r',0}; static const WCHAR prop_physicaladapterW[] = {'P','h','y','s','i','c','a','l','A','d','a','p','t','e','r',0}; +static const WCHAR prop_pixelsperxlogicalinchW[] = + {'P','i','x','e','l','s','P','e','r','X','L','o','g','i','c','a','l','I','n','c','h',0}; static const WCHAR prop_pnpdeviceidW[] = {'P','N','P','D','e','v','i','c','e','I','D',0}; static const WCHAR prop_pprocessidW[] = @@ -352,6 +357,7 @@ static const struct column col_bios[] = { prop_descriptionW, CIM_STRING }, { prop_identificationcodeW, CIM_STRING }, { prop_manufacturerW, CIM_STRING }, + { prop_nameW, CIM_STRING }, { prop_releasedateW, CIM_DATETIME }, { prop_serialnumberW, CIM_STRING }, { prop_smbiosbiosversionW, CIM_STRING }, @@ -388,6 +394,10 @@ static const struct column col_datafile[] = { prop_nameW, CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY }, { prop_versionW, CIM_STRING|COL_FLAG_DYNAMIC } }; +static const struct column col_desktopmonitor[] = +{ + { prop_pixelsperxlogicalinchW, CIM_UINT32 } +}; static const struct column col_directory[] = { { prop_accessmaskW, CIM_UINT32 }, @@ -632,6 +642,8 @@ static const WCHAR bios_descriptionW[] = {'D','e','f','a','u','l','t',' ','S','y','s','t','e','m',' ','B','I','O','S',0}; static const WCHAR bios_manufacturerW[] = {'T','h','e',' ','W','i','n','e',' ','P','r','o','j','e','c','t',0}; +static const WCHAR bios_nameW[] = + {'W','I','N','E',' ','B','I','O','S',0}; static const WCHAR bios_releasedateW[] = {'2','0','1','2','0','6','0','8','0','0','0','0','0','0','.','0','0','0','0','0','0','+','0','0','0',0}; static const WCHAR bios_serialnumberW[] = @@ -735,6 +747,7 @@ struct record_bios const WCHAR *description; const WCHAR *identificationcode; const WCHAR *manufacturer; + const WCHAR *name; const WCHAR *releasedate; const WCHAR *serialnumber; const WCHAR *smbiosbiosversion; @@ -771,6 +784,10 @@ struct record_datafile const WCHAR *name; const WCHAR *version; }; +struct record_desktopmonitor +{ + UINT32 pixelsperxlogicalinch; +}; struct record_directory { UINT32 accessmask; @@ -1010,7 +1027,7 @@ static const struct record_baseboard data_baseboard[] = }; static const struct record_bios data_bios[] = { - { bios_descriptionW, bios_descriptionW, bios_manufacturerW, bios_releasedateW, bios_serialnumberW, + { bios_descriptionW, bios_descriptionW, bios_manufacturerW, bios_nameW, bios_releasedateW, bios_serialnumberW, bios_smbiosbiosversionW, bios_versionW } }; static const struct record_computersystemproduct data_compsysproduct[] = @@ -1640,6 +1657,35 @@ done: return status; } +static UINT32 get_pixelsperxlogicalinch(void) +{ + HDC hdc = GetDC( NULL ); + UINT32 ret; + + if (!hdc) return 96; + ret = GetDeviceCaps( hdc, LOGPIXELSX ); + ReleaseDC( NULL, hdc ); + return ret; +} + +static enum fill_status fill_desktopmonitor( struct table *table, const struct expr *cond ) +{ + struct record_desktopmonitor *rec; + enum fill_status status = FILL_STATUS_UNFILTERED; + UINT row = 0; + + if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED; + + rec = (struct record_desktopmonitor *)table->data; + rec->pixelsperxlogicalinch = get_pixelsperxlogicalinch(); + + if (match_row( table, row, cond, &status )) row++; + + TRACE("created %u rows\n", row); + table->num_rows = row; + return status; +} + static enum fill_status fill_directory( struct table *table, const struct expr *cond ) { static const WCHAR dotW[] = {'.',0}, dotdotW[] = {'.','.',0}; @@ -2845,6 +2891,7 @@ static struct table builtin_classes[] = { class_compsysW, SIZEOF(col_compsys), col_compsys, 0, 0, NULL, fill_compsys }, { class_compsysproductW, SIZEOF(col_compsysproduct), col_compsysproduct, SIZEOF(data_compsysproduct), 0, (BYTE *)data_compsysproduct }, { class_datafileW, SIZEOF(col_datafile), col_datafile, 0, 0, NULL, fill_datafile }, + { class_desktopmonitorW, SIZEOF(col_desktopmonitor), col_desktopmonitor, 0, 0, NULL, fill_desktopmonitor }, { class_directoryW, SIZEOF(col_directory), col_directory, 0, 0, NULL, fill_directory }, { class_diskdriveW, SIZEOF(col_diskdrive), col_diskdrive, 0, 0, NULL, fill_diskdrive }, { class_diskpartitionW, SIZEOF(col_diskpartition), col_diskpartition, 0, 0, NULL, fill_diskpartition }, diff --git a/reactos/dll/win32/wbemprox/class.c b/reactos/dll/win32/wbemprox/class.c index 41b39dffe34..3d3e777861c 100644 --- a/reactos/dll/win32/wbemprox/class.c +++ b/reactos/dll/win32/wbemprox/class.c @@ -101,17 +101,14 @@ static HRESULT WINAPI enum_class_object_Next( { struct enum_class_object *ec = impl_from_IEnumWbemClassObject( iface ); struct view *view = ec->query->view; + static int once = 0; HRESULT hr; TRACE("%p, %d, %u, %p, %p\n", iface, lTimeout, uCount, apObjects, puReturned); if (!uCount) return WBEM_S_FALSE; if (!apObjects || !puReturned) return WBEM_E_INVALID_PARAMETER; - if (lTimeout != WBEM_INFINITE) - { - static int once; - if (!once++) FIXME("timeout not supported\n"); - } + if (lTimeout != WBEM_INFINITE && !once++) FIXME("timeout not supported\n"); *puReturned = 0; if (ec->index >= view->count) return WBEM_S_FALSE; @@ -153,10 +150,11 @@ static HRESULT WINAPI enum_class_object_Skip( { struct enum_class_object *ec = impl_from_IEnumWbemClassObject( iface ); struct view *view = ec->query->view; + static int once = 0; TRACE("%p, %d, %u\n", iface, lTimeout, nCount); - if (lTimeout != WBEM_INFINITE) FIXME("timeout not supported\n"); + if (lTimeout != WBEM_INFINITE && !once++) FIXME("timeout not supported\n"); if (!view->count) return WBEM_S_FALSE; diff --git a/reactos/dll/win32/wbemprox/query.c b/reactos/dll/win32/wbemprox/query.c index 869870a7e5d..0d179b8afbd 100644 --- a/reactos/dll/win32/wbemprox/query.c +++ b/reactos/dll/win32/wbemprox/query.c @@ -51,10 +51,10 @@ static BOOL eval_like( const WCHAR *lstr, const WCHAR *rstr ) { while (*q == '%') q++; if (!*q) return TRUE; - while (*p && toupperW( p[1] ) != toupperW( q[1] )) p++; - if (!*p) return TRUE; + while (*p && *q && toupperW( *p ) == toupperW( *q )) { p++; q++; }; + if (!*p && !*q) return TRUE; } - if (toupperW( *p++ ) != toupperW( *q++ )) return FALSE; + if (*q != '%' && toupperW( *p++ ) != toupperW( *q++ )) return FALSE; } return TRUE; } diff --git a/reactos/dll/win32/wbemprox/service.c b/reactos/dll/win32/wbemprox/service.c index a399a85119d..6c09f76af1a 100644 --- a/reactos/dll/win32/wbemprox/service.c +++ b/reactos/dll/win32/wbemprox/service.c @@ -56,11 +56,11 @@ static HRESULT control_service( const WCHAR *name, DWORD control, VARIANT *retva goto done; } if (!ControlService( service, control, &status )) error = map_error( GetLastError() ); + CloseServiceHandle( service ); done: set_variant( VT_UI4, error, NULL, retval ); - CloseServiceHandle( service ); - CloseServiceHandle( manager ); + if (manager) CloseServiceHandle( manager ); return S_OK; } @@ -170,11 +170,11 @@ static HRESULT start_service( const WCHAR *name, VARIANT *retval ) goto done; } if (!StartServiceW( service, 0, NULL )) error = map_error( GetLastError() ); + CloseServiceHandle( service ); done: set_variant( VT_UI4, error, NULL, retval ); - CloseServiceHandle( service ); - CloseServiceHandle( manager ); + if (manager) CloseServiceHandle( manager ); return S_OK; } diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index 36514fb9e9b..3f5b6e53b1c 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -199,7 +199,7 @@ reactos/dll/win32/vbscript # Synced to WineStaging-1.7.47 reactos/dll/win32/version # Synced to WineStaging-1.7.55 reactos/dll/win32/vssapi # Synced to WineStaging-1.7.47 reactos/dll/win32/wbemdisp # Synced to WineStaging-1.7.47 -reactos/dll/win32/wbemprox # Synced to WineStaging-1.7.47 +reactos/dll/win32/wbemprox # Synced to WineStaging-1.7.55 reactos/dll/win32/windowscodecs # Synced to WineStaging-1.7.47 reactos/dll/win32/windowscodecsext # Synced to WineStaging-1.7.47 reactos/dll/win32/winemp3.acm # Synced to WineStaging-1.7.47