[PATCH 1/2] regedit: Display REG_DWORD_BIG_ENDIAN values (v2)

Hugh McMaster hugh.mcmaster at outlook.com
Tue Mar 29 05:56:20 CDT 2016


Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
---
 programs/regedit/listview.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/programs/regedit/listview.c b/programs/regedit/listview.c
index c0119ff..6aa4a1b 100644
--- a/programs/regedit/listview.c
+++ b/programs/regedit/listview.c
@@ -20,6 +20,7 @@
  */
 
 #include <windows.h>
+#include <winternl.h>
 #include <commctrl.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -167,10 +168,14 @@ static void AddEntryToList(HWND hwndLV, LPWSTR Name, DWORD dwValType,
                 ListView_SetItemTextW(hwndLV, index, 2, g_szValueNotSet);
             }
             break;
-        case REG_DWORD: {
+        case REG_DWORD:
+        case REG_DWORD_BIG_ENDIAN: {
+                DWORD value = *(DWORD*)ValBuf;
                 WCHAR buf[64];
                 WCHAR format[] = {'0','x','%','0','8','x',' ','(','%','u',')',0};
-                wsprintfW(buf, format, *(DWORD*)ValBuf, *(DWORD*)ValBuf);
+                if (dwValType == REG_DWORD_BIG_ENDIAN)
+                    value = RtlUlongByteSwap(value);
+                sprintfW(buf, format, value, value);
                 ListView_SetItemTextW(hwndLV, index, 2, buf);
             }
             break;
-- 
1.9.1




More information about the wine-patches mailing list