https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1bfb4963037751082dcccc21b128a5a461243383

commit 1bfb4963037751082dcccc21b128a5a461243383
Author:     winesync <[email protected]>
AuthorDate: Sun Jan 16 21:17:19 2022 +0100
Commit:     Thomas Csovcsity <[email protected]>
CommitDate: Sun Jun 19 13:06:34 2022 +0200

    [WINESYNC] reg: Replace the 'reg_count' variable name with context-specific 
names.
    
    Signed-off-by: Hugh McMaster <[email protected]>
    Signed-off-by: Alexandre Julliard <[email protected]>
    
    wine commit id 2c73949a46c2dda10b544cef44c0f6c3623cc74e by Hugh McMaster 
<[email protected]>
---
 base/applications/cmdutils/reg/add.c | 25 +++++++++++++------------
 sdk/tools/winesync/reg.cfg           |  2 +-
 2 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/base/applications/cmdutils/reg/add.c 
b/base/applications/cmdutils/reg/add.c
index db909167f30..c3dec2d5b7f 100644
--- a/base/applications/cmdutils/reg/add.c
+++ b/base/applications/cmdutils/reg/add.c
@@ -48,11 +48,12 @@ static inline BYTE hexchar_to_byte(WCHAR ch)
         return -1;
 }
 
-static LPBYTE get_regdata(const WCHAR *data, DWORD reg_type, WCHAR separator, 
DWORD *reg_count)
+static BYTE *get_regdata(const WCHAR *data, DWORD reg_type, WCHAR separator, 
DWORD *size_bytes)
 {
     static const WCHAR empty;
     LPBYTE out_data = NULL;
-    *reg_count = 0;
+
+    *size_bytes = 0;
 
     if (!data) data = &empty;
 
@@ -62,8 +63,8 @@ static LPBYTE get_regdata(const WCHAR *data, DWORD reg_type, 
WCHAR separator, DW
         case REG_SZ:
         case REG_EXPAND_SZ:
         {
-            *reg_count = (lstrlenW(data) + 1) * sizeof(WCHAR);
-            out_data = malloc(*reg_count);
+            *size_bytes = (lstrlenW(data) + 1) * sizeof(WCHAR);
+            out_data = malloc(*size_bytes);
             lstrcpyW((LPWSTR)out_data,data);
             break;
         }
@@ -78,8 +79,8 @@ static LPBYTE get_regdata(const WCHAR *data, DWORD reg_type, 
WCHAR separator, DW
                 output_message(STRING_MISSING_INTEGER);
                 break;
             }
-            *reg_count = sizeof(DWORD);
-            out_data = malloc(*reg_count);
+            *size_bytes = sizeof(DWORD);
+            out_data = malloc(*size_bytes);
             ((LPDWORD)out_data)[0] = val;
             break;
         }
@@ -87,8 +88,8 @@ static LPBYTE get_regdata(const WCHAR *data, DWORD reg_type, 
WCHAR separator, DW
         {
             BYTE hex0, hex1;
             int i = 0, destByteIndex = 0, datalen = lstrlenW(data);
-            *reg_count = ((datalen + datalen % 2) / 2) * sizeof(BYTE);
-            out_data = malloc(*reg_count);
+            *size_bytes = ((datalen + datalen % 2) / 2) * sizeof(BYTE);
+            out_data = malloc(*size_bytes);
             if(datalen % 2)
             {
                 hex1 = hexchar_to_byte(data[i++]);
@@ -139,7 +140,7 @@ static LPBYTE get_regdata(const WCHAR *data, DWORD 
reg_type, WCHAR separator, DW
             buffer[destindex] = 0;
             if (destindex && buffer[destindex - 1])
                 buffer[++destindex] = 0;
-            *reg_count = (destindex + 1) * sizeof(WCHAR);
+            *size_bytes = (destindex + 1) * sizeof(WCHAR);
             return (BYTE *)buffer;
         }
         default:
@@ -164,7 +165,7 @@ static int run_add(HKEY root, WCHAR *path, WCHAR 
*value_name, BOOL value_empty,
     if (value_name || value_empty || data)
     {
         DWORD reg_type;
-        DWORD reg_count = 0;
+        DWORD data_size = 0;
         BYTE* reg_data = NULL;
 
         if (!force)
@@ -194,13 +195,13 @@ static int run_add(HKEY root, WCHAR *path, WCHAR 
*value_name, BOOL value_empty,
              return 1;
         }
 
-        if (!(reg_data = get_regdata(data, reg_type, separator, &reg_count)))
+        if (!(reg_data = get_regdata(data, reg_type, separator, &data_size)))
         {
             RegCloseKey(hkey);
             return 1;
         }
 
-        RegSetValueExW(hkey, value_name, 0, reg_type, reg_data, reg_count);
+        RegSetValueExW(hkey, value_name, 0, reg_type, reg_data, data_size);
         free(reg_data);
     }
 
diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg
index 553d827ef9a..821c74fa0f1 100644
--- a/sdk/tools/winesync/reg.cfg
+++ b/sdk/tools/winesync/reg.cfg
@@ -4,4 +4,4 @@ directories:
 files:
   programs/reg/resource.h: base/applications/cmdutils/reg/resource.h
 tags:
-  wine: 08786274e25461dc1af3684f0e46c896201b28cb
+  wine: 2c73949a46c2dda10b544cef44c0f6c3623cc74e

Reply via email to