Author: akhaldi Date: Sun Feb 26 16:16:31 2017 New Revision: 73931
URL: http://svn.reactos.org/svn/reactos?rev=73931&view=rev Log: [REG] Sync with Wine Staging 2.2. CORE-12823
68c1765 reg: Simplify help handling by removing an if-else if-else block. 8a8a753 reg: Fix dword conversion on 64-bit operating systems.
Modified: trunk/reactos/base/applications/cmdutils/reg/reg.c trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/base/applications/cmdutils/reg/reg.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils/... ============================================================================== --- trunk/reactos/base/applications/cmdutils/reg/reg.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/reg/reg.c [iso-8859-1] Sun Feb 26 16:16:31 2017 @@ -255,9 +255,9 @@ case REG_DWORD_BIG_ENDIAN: /* Yes, this is correct! */ { LPWSTR rest; - DWORD val; + unsigned long val; val = strtoulW(data, &rest, (tolowerW(data[1]) == 'x') ? 16 : 10); - if (*rest || data[0] == '-' || (val == ~0u && errno == ERANGE)) { + if (*rest || data[0] == '-' || (val == ~0u && errno == ERANGE) || val > ~0u) { output_message(STRING_MISSING_INTEGER); break; } @@ -908,23 +908,32 @@ static const WCHAR deleteW[] = {'d','e','l','e','t','e',0}; static const WCHAR queryW[] = {'q','u','e','r','y',0};
-static enum operations get_operation(const WCHAR *str) +static enum operations get_operation(const WCHAR *str, int *op_help) { if (!lstrcmpiW(str, addW)) + { + *op_help = STRING_ADD_USAGE; return REG_ADD; + }
if (!lstrcmpiW(str, deleteW)) + { + *op_help = STRING_DELETE_USAGE; return REG_DELETE; + }
if (!lstrcmpiW(str, queryW)) + { + *op_help = STRING_QUERY_USAGE; return REG_QUERY; + }
return REG_INVALID; }
int wmain(int argc, WCHAR *argvW[]) { - int i, op, ret; + int i, op, op_help, ret; BOOL show_op_help = FALSE; static const WCHAR switchVAW[] = {'v','a',0}; static const WCHAR switchVEW[] = {'v','e',0}; @@ -945,7 +954,7 @@ return 0; }
- op = get_operation(argvW[1]); + op = get_operation(argvW[1], &op_help);
if (op == REG_INVALID) { @@ -965,12 +974,7 @@ } else if (show_op_help) { - if (op == REG_ADD) - output_message(STRING_ADD_USAGE); - else if (op == REG_DELETE) - output_message(STRING_DELETE_USAGE); - else - output_message(STRING_QUERY_USAGE); + output_message(op_help); return 0; }
Modified: trunk/reactos/media/doc/README.WINE URL: http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=7... ============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sun Feb 26 16:16:31 2017 @@ -227,7 +227,7 @@ ReactOS shares the following programs with Winehq.
reactos/base/applications/cmdutils/cscript # Synced to WineStaging-1.9.11 -reactos/base/applications/cmdutils/reg # Synced to WineStaging-1.9.16 +reactos/base/applications/cmdutils/reg # Synced to WineStaging-2.2 reactos/base/applications/cmdutils/schtasks # Synced to WineStaging-1.9.14 reactos/base/applications/cmdutils/taskkill # Synced to WineStaging-1.9.11 reactos/base/applications/cmdutils/wmic # Synced to WineStaging-1.9.11