Author: akhaldi
Date: Sat Jun 4 18:04:03 2016
New Revision: 71519
URL:
http://svn.reactos.org/svn/reactos?rev=71519&view=rev
Log:
[WMIC] Sync with Wine Staging 1.9.11. CORE-11368
Modified:
trunk/reactos/base/applications/cmdutils/wmic/lang/de-DE.rc
trunk/reactos/base/applications/cmdutils/wmic/lang/en-US.rc
trunk/reactos/base/applications/cmdutils/wmic/lang/ro-RO.rc
trunk/reactos/base/applications/cmdutils/wmic/lang/ru-RU.rc
trunk/reactos/base/applications/cmdutils/wmic/lang/sq-AL.rc
trunk/reactos/base/applications/cmdutils/wmic/lang/tr-TR.rc
trunk/reactos/base/applications/cmdutils/wmic/lang/zh-CN.rc
trunk/reactos/base/applications/cmdutils/wmic/lang/zh-TW.rc
trunk/reactos/base/applications/cmdutils/wmic/main.c
trunk/reactos/base/applications/cmdutils/wmic/wmic.h
trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/base/applications/cmdutils/wmic/lang/de-DE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
==============================================================================
--- trunk/reactos/base/applications/cmdutils/wmic/lang/de-DE.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/cmdutils/wmic/lang/de-DE.rc [iso-8859-1] Sat Jun 4
18:04:03 2016
@@ -5,4 +5,5 @@
STRING_CMDLINE_NOT_SUPPORTED, "Fehler: Befehlszeile nicht unterstützt\n"
STRING_ALIAS_NOT_FOUND, "Fehler: Alias nicht gefunden\n"
STRING_INVALID_QUERY, "Fehler: Ungültige Abfrage\n"
+ STRING_INVALID_PATH, "Invalid syntax for PATH\n"
}
Modified: trunk/reactos/base/applications/cmdutils/wmic/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
==============================================================================
--- trunk/reactos/base/applications/cmdutils/wmic/lang/en-US.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/cmdutils/wmic/lang/en-US.rc [iso-8859-1] Sat Jun 4
18:04:03 2016
@@ -5,4 +5,5 @@
STRING_CMDLINE_NOT_SUPPORTED, "Error: Command line not supported\n"
STRING_ALIAS_NOT_FOUND, "Error: Alias not found\n"
STRING_INVALID_QUERY, "Error: Invalid query\n"
+ STRING_INVALID_PATH, "Invalid syntax for PATH\n"
}
Modified: trunk/reactos/base/applications/cmdutils/wmic/lang/ro-RO.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
==============================================================================
--- trunk/reactos/base/applications/cmdutils/wmic/lang/ro-RO.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/cmdutils/wmic/lang/ro-RO.rc [iso-8859-1] Sat Jun 4
18:04:03 2016
@@ -7,4 +7,5 @@
STRING_CMDLINE_NOT_SUPPORTED, "Eroare: ComandÄ nerecunoscutÄ.\n"
STRING_ALIAS_NOT_FOUND, "Eroare: Nu se poate gÄsi alias.\n"
STRING_INVALID_QUERY, "Eroare: Cerere nevalidÄ.\n"
+ STRING_INVALID_PATH, "Invalid syntax for PATH\n"
}
Modified: trunk/reactos/base/applications/cmdutils/wmic/lang/ru-RU.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
==============================================================================
--- trunk/reactos/base/applications/cmdutils/wmic/lang/ru-RU.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/cmdutils/wmic/lang/ru-RU.rc [iso-8859-1] Sat Jun 4
18:04:03 2016
@@ -5,4 +5,5 @@
STRING_CMDLINE_NOT_SUPPORTED, "ÐÑибка: ÐÐ¾Ð¼Ð°Ð½Ð´Ð½Ð°Ñ ÑÑÑока
не поддеÑживаеÑÑÑ\n"
STRING_ALIAS_NOT_FOUND, "ÐÑибка: ÐÑевдоним не
найден\n"
STRING_INVALID_QUERY, "ÐÑибка: ÐевеÑнÑй запÑоÑ\n"
+ STRING_INVALID_PATH, "Invalid syntax for PATH\n"
}
Modified: trunk/reactos/base/applications/cmdutils/wmic/lang/sq-AL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
==============================================================================
--- trunk/reactos/base/applications/cmdutils/wmic/lang/sq-AL.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/cmdutils/wmic/lang/sq-AL.rc [iso-8859-1] Sat Jun 4
18:04:03 2016
@@ -9,4 +9,5 @@
STRING_CMDLINE_NOT_SUPPORTED, "Gabim: Linja e komandave jo e
mbështetur\n"
STRING_ALIAS_NOT_FOUND, "Gabim: Pseudonimi nuk u gjend\n"
STRING_INVALID_QUERY, "Gabim: Kërkim pa vlere\n"
+ STRING_INVALID_PATH, "Invalid syntax for PATH\n"
}
Modified: trunk/reactos/base/applications/cmdutils/wmic/lang/tr-TR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
==============================================================================
--- trunk/reactos/base/applications/cmdutils/wmic/lang/tr-TR.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/cmdutils/wmic/lang/tr-TR.rc [iso-8859-1] Sat Jun 4
18:04:03 2016
@@ -7,4 +7,5 @@
STRING_CMDLINE_NOT_SUPPORTED, "YanlıÅlık: Komut yatacı
desteklenmiyor\n"
STRING_ALIAS_NOT_FOUND, "YanlıÅlık: BaÅka ad bulunamadı\n"
STRING_INVALID_QUERY, "YanlıÅlık: Geçersiz sorgu\n"
+ STRING_INVALID_PATH, "Invalid syntax for PATH\n"
}
Modified: trunk/reactos/base/applications/cmdutils/wmic/lang/zh-CN.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
==============================================================================
--- trunk/reactos/base/applications/cmdutils/wmic/lang/zh-CN.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/cmdutils/wmic/lang/zh-CN.rc [iso-8859-1] Sat Jun 4
18:04:03 2016
@@ -7,4 +7,5 @@
STRING_CMDLINE_NOT_SUPPORTED, "é误: ä¸æ¯æçå½ä»¤è¡\n"
STRING_ALIAS_NOT_FOUND, "é误: å«åæªæ¾å°\n"
STRING_INVALID_QUERY, "é误: æ æçæ¥è¯¢\n"
+ STRING_INVALID_PATH, "Invalid syntax for PATH\n"
}
Modified: trunk/reactos/base/applications/cmdutils/wmic/lang/zh-TW.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
==============================================================================
--- trunk/reactos/base/applications/cmdutils/wmic/lang/zh-TW.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/cmdutils/wmic/lang/zh-TW.rc [iso-8859-1] Sat Jun 4
18:04:03 2016
@@ -7,4 +7,5 @@
STRING_CMDLINE_NOT_SUPPORTED, "é¯èª¤: ä¸æ¯æ´çå½ä»¤å\n"
STRING_ALIAS_NOT_FOUND, "é¯èª¤: å¥åæªæ¾å°\n"
STRING_INVALID_QUERY, "é¯èª¤: ç¡æçæ¥è©¢\n"
+ STRING_INVALID_PATH, "Invalid syntax for PATH\n"
}
Modified: trunk/reactos/base/applications/cmdutils/wmic/main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
==============================================================================
--- trunk/reactos/base/applications/cmdutils/wmic/main.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/cmdutils/wmic/main.c [iso-8859-1] Sat Jun 4 18:04:03
2016
@@ -162,7 +162,7 @@
return output_string( fmtW, buffer );
}
-static int query_prop( const WCHAR *alias, const WCHAR *propname )
+static int query_prop( const WCHAR *class, const WCHAR *propname )
{
static const WCHAR select_allW[] =
{'S','E','L','E','C','T','
','*',' ','F','R','O','M','
',0};
static const WCHAR cimv2W[] =
{'R','O','O','T','\\','C','I','M','V','2',0};
@@ -175,18 +175,12 @@
IEnumWbemClassObject *result = NULL;
LONG flags = WBEM_FLAG_RETURN_IMMEDIATELY | WBEM_FLAG_FORWARD_ONLY;
BSTR path = NULL, wql = NULL, query = NULL;
- const WCHAR *class;
WCHAR *prop = NULL;
BOOL first = TRUE;
int len, ret = -1;
- WINE_TRACE("%s, %s\n", debugstr_w(alias), debugstr_w(propname));
-
- if (!(class = find_class( alias )))
- {
- output_message( STRING_ALIAS_NOT_FOUND );
- return -1;
- }
+ WINE_TRACE("%s, %s\n", debugstr_w(class), debugstr_w(propname));
+
CoInitialize( NULL );
CoInitializeSecurity( NULL, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_DEFAULT,
RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE, NULL );
@@ -253,11 +247,67 @@
int wmain(int argc, WCHAR *argv[])
{
static const WCHAR getW[] = {'g','e','t',0};
-
- if (argc != 4 || strcmpiW( argv[2], getW ))
- {
- output_message( STRING_CMDLINE_NOT_SUPPORTED );
- return -1;
- }
- return query_prop( argv[1], argv[3] );
-}
+ static const WCHAR quitW[] = {'q','u','i','t',0};
+ static const WCHAR exitW[] = {'e','x','i','t',0};
+ static const WCHAR pathW[] = {'p','a','t','h',0};
+ static const WCHAR classW[] =
{'c','l','a','s','s',0};
+ static const WCHAR contextW[] =
{'c','o','n','t','e','x','t',0};
+
+ const WCHAR *class;
+ const WCHAR *value;
+ int i;
+
+ if (argc == 1)
+ goto not_supported;
+
+ for (i = 1; i < argc && argv[i][0] == '/'; i++)
+ WINE_FIXME("command line switch %s not supported\n",
debugstr_w(argv[i]));
+
+ if (i >= argc)
+ goto not_supported;
+
+ if (!strcmpiW( argv[i], quitW ) ||
+ !strcmpiW( argv[i], exitW ))
+ {
+ return 0;
+ }
+ else if (!strcmpiW( argv[i], classW) ||
+ !strcmpiW( argv[i], contextW))
+ {
+ WINE_FIXME("command %s not supported\n", debugstr_w(argv[i]));
+ goto not_supported;
+ }
+ else if (!strcmpiW( argv[i], pathW))
+ {
+ if (++i >= argc)
+ {
+ output_message( STRING_INVALID_PATH );
+ return 1;
+ }
+ class = argv[i];
+ }
+ else
+ {
+ class = find_class( argv[i] );
+ if (!class)
+ {
+ output_message( STRING_ALIAS_NOT_FOUND );
+ return 1;
+ }
+ }
+
+ if (++i >= argc)
+ goto not_supported;
+
+ if (!strcmpiW( argv[i], getW))
+ {
+ if (++i >= argc)
+ goto not_supported;
+ value = argv[i];
+ return query_prop( class, value );
+ }
+
+not_supported:
+ output_message( STRING_CMDLINE_NOT_SUPPORTED );
+ return 1;
+}
Modified: trunk/reactos/base/applications/cmdutils/wmic/wmic.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
==============================================================================
--- trunk/reactos/base/applications/cmdutils/wmic/wmic.h [iso-8859-1] (original)
+++ trunk/reactos/base/applications/cmdutils/wmic/wmic.h [iso-8859-1] Sat Jun 4 18:04:03
2016
@@ -21,3 +21,4 @@
#define STRING_CMDLINE_NOT_SUPPORTED 101
#define STRING_ALIAS_NOT_FOUND 102
#define STRING_INVALID_QUERY 103
+#define STRING_INVALID_PATH 104
Modified: trunk/reactos/media/doc/README.WINE
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sat Jun 4 18:04:03 2016
@@ -231,7 +231,7 @@
reactos/base/applications/cmdutils/cscript # Synced to WineStaging-1.9.4
reactos/base/applications/cmdutils/reg # Synced to WineStaging-1.9.11
reactos/base/applications/cmdutils/taskkill # Synced to WineStaging-1.9.4
-reactos/base/applications/cmdutils/wmic # Synced to WineStaging-1.9.4
+reactos/base/applications/cmdutils/wmic # Synced to WineStaging-1.9.11
reactos/base/applications/cmdutils/wscript # Synced to WineStaging-1.9.4
reactos/base/applications/cmdutils/xcopy # Synced to WineStaging-1.9.4
reactos/base/applications/games/winmine # Synced to WineStaging-1.9.4 with our own
resources.