[WINESYNC] reg: Add extended help for supported operations.
authorwinesync <ros-dev@reactos.org>
Sun, 16 Jan 2022 19:41:28 +0000 (20:41 +0100)
committerThomas Csovcsity <thc.fr13nd@gmail.com>
Sun, 19 Jun 2022 11:06:30 +0000 (13:06 +0200)
Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
wine commit id e319a463a20b060c059de36058624639e04c12a0 by Hugh McMaster <hugh.mcmaster@outlook.com>

manual adjustment needed

base/applications/cmdutils/reg/lang/en-US.rc
base/applications/cmdutils/reg/reg.c
sdk/tools/winesync/reg.cfg

index b2cf987..24ae369 100644 (file)
@@ -2,12 +2,94 @@ LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
 
 STRINGTABLE
 {
-    STRING_USAGE, "Usage:\n  REG [operation] [parameters]\n\nSupported operations:\n  ADD | DELETE | IMPORT | EXPORT | QUERY | SAVE | RESTORE\n\nFor help on a specific operation, type:\n  REG [operation] /?\n\n"
-    STRING_ADD_USAGE, "REG ADD key_name [/v value_name | /ve] [/t type] [/s separator] [/d data] [/f]\n"
-    STRING_DELETE_USAGE, "REG DELETE key_name [/v value_name | /ve | /va] [/f]\n"
-    STRING_QUERY_USAGE, "REG QUERY key_name [/v value_name | /ve] [/s]\n"
+    STRING_USAGE, "Usage:\n\
+\  REG [operation] [parameters]\n\n\
+\Supported operations:\n\
+\  ADD | DELETE | EXPORT | IMPORT | QUERY\n\n\
+\For help on a specific operation, type:\n\
+\  REG [operation] /?\n\n"
+
+    STRING_ADD_USAGE, "REG ADD <key> [/v value_name | /ve] [/t type] [/s separator] [/d data] [/f]\n\n\
+\  Adds a key to the registry or adds a new value to a given registry key.\n\n\
+\  <key>\n\
+\     The registry key to add or, if either [/v] or [/ve] is specified,\n\
+\     the key in which to add the new registry data.\n\n\
+\     Format: ROOT\\Subkey\n\n\
+\     ROOT: A predefined registry key. This must be one of the following:\n\n\
+\         HKEY_LOCAL_MACHINE  | HKLM\n\
+\         HKEY_CURRENT_USER   | HKCU\n\
+\         HKEY_CLASSES_ROOT   | HKCR\n\
+\         HKEY_USERS          | HKU\n\
+\         HKEY_CURRENT_CONFIG | HKCC\n\n\
+\     Subkey: The full path to a registry key under a given ROOT key.\n\n\
+\  /v <value_name>\n\
+\     The name of the registry value to add.\n\n\
+\  /ve\n\
+\     Add an unnamed registry value. This option modifies the (Default)\n\
+\     registry value.\n\n\
+\  /t <type>\n\
+\     The type of data to add to the registry. If [/t] is specified,\n\
+\     <type> must be one of the following:\n\n\
+\         REG_SZ    | REG_MULTI_SZ | REG_EXPAND_SZ\n\
+\         REG_DWORD | REG_BINARY   | REG_NONE\n\n\
+\     If [/t] is not specified, the default data type is REG_SZ.\n\n\
+\  /s <separator>\n\
+\     The character used to separate strings in REG_MULTI_SZ data.\n\
+\     If [/s] is not specified, the default separator is \\0.\n\n\
+\  /d <data>\n\
+\     The data to add to the new registry value.\n\n\
+\  /f\n\
+\     Modify the registry without prompting for confirmation.\n\n"
+
+    STRING_DELETE_USAGE, "REG DELETE <key> [/v value_name | /ve | /va] [/f]\n\n\
+\  Deletes a registry key (including all subkeys and values), or deletes\n\
+\  one or more values from a given registry key.\n\n\
+\  <key>\n\
+\     The registry key to delete or, if one of [/v], [/ve] or [/va] is\n\
+\     specified, the registry key in which to delete one or more values.\n\n\
+\     Format: ROOT\\Subkey\n\n\
+\     ROOT: A predefined registry key. This must be one of the following:\n\n\
+\         HKEY_LOCAL_MACHINE  | HKLM\n\
+\         HKEY_CURRENT_USER   | HKCU\n\
+\         HKEY_CLASSES_ROOT   | HKCR\n\
+\         HKEY_USERS          | HKU\n\
+\         HKEY_CURRENT_CONFIG | HKCC\n\n\
+\     Subkey: The full path to a registry key under a given ROOT key.\n\n\
+\  /v <value_name>\n\
+\     The name of the registry value to delete.\n\n\
+\  /ve\n\
+\     Delete an unnamed registry value. This option deletes the (Default)\n\
+\     registry value.\n\n\
+\  /va\n\
+\     Delete all values from a registry key.\n\n\
+\  /f\n\
+\     Delete a registry key (including all subkeys and values) without\n\
+\     prompting for confirmation.\n\n"
+
+    STRING_QUERY_USAGE, "REG QUERY <key> [/v value_name | /ve] [/s]\n\n\
+\  Queries a specified registry key and lists all immediate subkeys, values\n\
+\  and data within that key. Use [/s] to recursively query each subkey.\n\n\
+\  <key>\n\
+\     The registry key to query.\n\n\
+\     Format: ROOT\\Subkey\n\n\
+\     ROOT: A predefined registry key. This must be one of the following:\n\n\
+\         HKEY_LOCAL_MACHINE  | HKLM\n\
+\         HKEY_CURRENT_USER   | HKCU\n\
+\         HKEY_CLASSES_ROOT   | HKCR\n\
+\         HKEY_USERS          | HKU\n\
+\         HKEY_CURRENT_CONFIG | HKCC\n\n\
+\     Subkey: The full path to a registry key under a given ROOT key.\n\n\
+\  /v <value_name>\n\
+\     The name of the registry value to query. If neither [/v] nor [/ve] is\n\
+\     specified, all values under <key> are listed.\n\n\
+\  /ve\n\
+\     Query an unnamed registry value. This option queries the (Default)\n\
+\     registry value.\n\n\
+\  /s\n\
+\     List all registry entries under <key> and its subkeys.\n\n"
+
     STRING_SUCCESS, "The operation completed successfully\n"
-    STRING_INVALID_KEY, "reg: Invalid key name\n"
+    STRING_INVALID_KEY, "reg: Invalid registry key\n"
     STRING_INVALID_CMDLINE, "reg: Invalid command line parameters\n"
     STRING_NO_REMOTE, "reg: Unable to access remote machine\n"
     STRING_CANNOT_FIND, "reg: The system was unable to find the specified registry key or value\n"
@@ -17,8 +99,8 @@ STRINGTABLE
     STRING_UNHANDLED_TYPE, "reg: Unhandled registry data type [/t 0x%1!x!, /d %2]\n"
     STRING_OVERWRITE_VALUE, "The registry value '%1' already exists. Do you want to overwrite it?"
     STRING_YESNO, " (Yes|No)"
-    STRING_YES, "Y"
-    STRING_NO, "N"
+    STRING_YES, "#msgctxt#Yes key#Y"
+    STRING_NO, "#msgctxt#No key#N"
     STRING_CANCELLED, "The registry operation was cancelled\n"
     STRING_DEFAULT_VALUE, "(Default)"
     STRING_DELETE_VALUE, "Are you sure you want to delete the registry value '%1'?"
@@ -33,11 +115,35 @@ STRINGTABLE
     STRING_REG_HELP, "Type ""REG /?"" for help.\n"
     STRING_FUNC_HELP, "Type ""REG %1 /?"" for help.\n"
     STRING_VALUE_NOT_SET, "(value not set)"
-    STRING_IMPORT_USAGE, "REG IMPORT file.reg\n"
+
+    STRING_IMPORT_USAGE, "REG IMPORT <file>\n\n\
+\  Imports keys, values and data from a given file into the registry.\n\n\
+\  <file>\n\
+\     The name and path of the registry file to import.\n\n"
+
     STRING_FILE_NOT_FOUND, "reg: The file '%1' was not found.\n"
     STRING_OPEN_KEY_FAILED, "reg: Unable to open the registry key '%1'.\n"
     STRING_ESCAPE_SEQUENCE, "reg: Unrecognized escape sequence [\\%1!c!]\n"
-    STRING_EXPORT_USAGE, "REG EXPORT key_name file.reg [/y]\n"
+
+    STRING_EXPORT_USAGE, "REG EXPORT <key> <file> [/y]\n\n\
+\  Exports a specified registry key (including all subkeys and values)\n\
+\  to a file.\n\n\
+\  <key>\n\
+\     The registry key to export.\n\n\
+\     Format: ROOT\\Subkey\n\n\
+\     ROOT: A predefined registry key. This must be one of the following:\n\n\
+\         HKEY_LOCAL_MACHINE  | HKLM\n\
+\         HKEY_CURRENT_USER   | HKCU\n\
+\         HKEY_CLASSES_ROOT   | HKCR\n\
+\         HKEY_USERS          | HKU\n\
+\         HKEY_CURRENT_CONFIG | HKCC\n\n\
+\     Subkey: The full path to a registry key under a given ROOT key.\n\n\
+\  <file>\n\
+\     The name and path of the registry file that will be created.\n\
+\     This file must have a .reg extension.\n\n\
+\  /y\n\
+\     Overwrite <file> without prompting for confirmation.\n\n"
+
     STRING_INVALID_SYSTEM_KEY, "reg: Invalid system key [%1]\n"
     STRING_OVERWRITE_FILE, "The file '%1' already exists. Do you want to overwrite it?"
 }
index f49bbb1..8c94366 100644 (file)
@@ -109,17 +109,27 @@ static void output_formatstring(const WCHAR *fmt, __ms_va_list va_args)
 
 void WINAPIV output_message(unsigned int id, ...)
 {
-    WCHAR fmt[1024];
+    WCHAR *fmt = NULL;
+    int len;
     __ms_va_list va_args;
 
-    if (!LoadStringW(GetModuleHandleW(NULL), id, fmt, ARRAY_SIZE(fmt)))
+    if (!(len = LoadStringW(GetModuleHandleW(NULL), id, (WCHAR *)&fmt, 0)))
     {
         WINE_FIXME("LoadString failed with %d\n", GetLastError());
         return;
     }
+
+    len++;
+    fmt = malloc(len * sizeof(WCHAR));
+    if (!fmt) return;
+
+    LoadStringW(GetModuleHandleW(NULL), id, fmt, len);
+
     __ms_va_start(va_args, id);
     output_formatstring(fmt, va_args);
     __ms_va_end(va_args);
+
+    free(fmt);
 }
 
 void WINAPIV output_string(const WCHAR *fmt, ...)
index 56cfb8c..ebb2f3a 100644 (file)
@@ -4,4 +4,4 @@ directories:
 files:
   programs/reg/resource.h: base/applications/cmdutils/reg/resource.h
 tags:
-  wine: cd03238dd0174382c503d7b6771e803d876a2fbf
+  wine: e319a463a20b060c059de36058624639e04c12a0