[REGEDIT]
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Wed, 3 Oct 2012 22:42:34 +0000 (22:42 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Wed, 3 Oct 2012 22:42:34 +0000 (22:42 +0000)
- Convert the application's code to UNICODE
- But the regproc.c's code is untouched (apart from the pseudo-error messages issued with fprintf)

svn path=/trunk/; revision=57471

20 files changed:
reactos/base/applications/regedit/about.c
reactos/base/applications/regedit/childwnd.c
reactos/base/applications/regedit/edit.c
reactos/base/applications/regedit/error.c
reactos/base/applications/regedit/find.c
reactos/base/applications/regedit/framewnd.c
reactos/base/applications/regedit/hexedit.c
reactos/base/applications/regedit/hexedit.h
reactos/base/applications/regedit/listview.c
reactos/base/applications/regedit/main.c
reactos/base/applications/regedit/main.h
reactos/base/applications/regedit/regedit.c
reactos/base/applications/regedit/regedit.h
reactos/base/applications/regedit/regproc.c
reactos/base/applications/regedit/regproc.h
reactos/base/applications/regedit/resource.h
reactos/base/applications/regedit/security.c
reactos/base/applications/regedit/security.h
reactos/base/applications/regedit/settings.c
reactos/base/applications/regedit/treeview.c

index e887063..a503c86 100644 (file)
@@ -23,7 +23,9 @@
 
 void ShowAboutBox(HWND hWnd)
 {
 
 void ShowAboutBox(HWND hWnd)
 {
-    TCHAR AppStr[255];
-    LoadString(hInst, IDS_APP_TITLE, AppStr, COUNT_OF(AppStr));
-    ShellAbout(hWnd, AppStr, _T(""), LoadIcon(hInst, MAKEINTRESOURCE(IDI_REGEDIT)));
+    WCHAR AppStr[255];
+    LoadStringW(hInst, IDS_APP_TITLE, AppStr, COUNT_OF(AppStr));
+    ShellAboutW(hWnd, AppStr, L"", LoadIconW(hInst, MAKEINTRESOURCEW(IDI_REGEDIT)));
 }
 }
+
+/* EOF */
index e927478..182ce29 100644 (file)
@@ -24,17 +24,18 @@ ChildWnd* g_pChildWnd;
 static int last_split;
 HBITMAP SizingPattern = 0;
 HBRUSH  SizingBrush = 0;
 static int last_split;
 HBITMAP SizingPattern = 0;
 HBRUSH  SizingBrush = 0;
-static TCHAR Suggestions[256];
+static WCHAR Suggestions[256];
 
 
-extern LPCTSTR get_root_key_name(HKEY hRootKey)
+extern LPCWSTR get_root_key_name(HKEY hRootKey)
 {
 {
-    if (hRootKey == HKEY_CLASSES_ROOT) return _T("HKEY_CLASSES_ROOT");
-    if (hRootKey == HKEY_CURRENT_USER) return _T("HKEY_CURRENT_USER");
-    if (hRootKey == HKEY_LOCAL_MACHINE) return _T("HKEY_LOCAL_MACHINE");
-    if (hRootKey == HKEY_USERS) return _T("HKEY_USERS");
-    if (hRootKey == HKEY_CURRENT_CONFIG) return _T("HKEY_CURRENT_CONFIG");
-    if (hRootKey == HKEY_DYN_DATA) return _T("HKEY_DYN_DATA");
-    return _T("UKNOWN HKEY, PLEASE REPORT");
+    if (hRootKey == HKEY_CLASSES_ROOT) return L"HKEY_CLASSES_ROOT";
+    if (hRootKey == HKEY_CURRENT_USER) return L"HKEY_CURRENT_USER";
+    if (hRootKey == HKEY_LOCAL_MACHINE) return L"HKEY_LOCAL_MACHINE";
+    if (hRootKey == HKEY_USERS) return L"HKEY_USERS";
+    if (hRootKey == HKEY_CURRENT_CONFIG) return L"HKEY_CURRENT_CONFIG";
+    if (hRootKey == HKEY_DYN_DATA) return L"HKEY_DYN_DATA";
+
+    return L"UKNOWN HKEY, PLEASE REPORT";
 }
 
 extern void ResizeWnd(int cx, int cy)
 }
 
 extern void ResizeWnd(int cx, int cy)
@@ -127,7 +128,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 {
     HTREEITEM hSelection;
     HKEY hRootKey;
 {
     HTREEITEM hSelection;
     HKEY hRootKey;
-    LPCTSTR keyPath, s;
+    LPCWSTR keyPath, s;
     WORD wID = LOWORD(wParam);
 
     UNREFERENCED_PARAMETER(message);
     WORD wID = LOWORD(wParam);
 
     UNREFERENCED_PARAMETER(message);
@@ -179,7 +180,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
     case ID_EDIT_NEW_STRINGVALUE:
     case ID_EDIT_NEW_BINARYVALUE:
     case ID_EDIT_NEW_DWORDVALUE:
     case ID_EDIT_NEW_STRINGVALUE:
     case ID_EDIT_NEW_BINARYVALUE:
     case ID_EDIT_NEW_DWORDVALUE:
-        SendMessage(hFrameWnd, WM_COMMAND, wParam, lParam);
+        SendMessageW(hFrameWnd, WM_COMMAND, wParam, lParam);
         break;
     case ID_SWITCH_PANELS:
         g_pChildWnd->nFocusPanel = !g_pChildWnd->nFocusPanel;
         break;
     case ID_SWITCH_PANELS:
         g_pChildWnd->nFocusPanel = !g_pChildWnd->nFocusPanel;
@@ -192,7 +193,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
             while(wID > ID_TREE_SUGGESTION_MIN)
             {
                 if (*s)
             while(wID > ID_TREE_SUGGESTION_MIN)
             {
                 if (*s)
-                    s += _tcslen(s) + 1;
+                    s += wcslen(s) + 1;
                 wID--;
             }
             SelectNode(g_pChildWnd->hTreeWnd, s);
                 wID--;
             }
             SelectNode(g_pChildWnd->hTreeWnd, s);
@@ -208,13 +209,13 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
  *  Key suggestion
  */
 
  *  Key suggestion
  */
 
-#define MIN(a,b)       ((a < b) ? (a) : (b))
+#define MIN(a,b)    ((a < b) ? (a) : (b))
 
 
-static void SuggestKeys(HKEY hRootKey, LPCTSTR pszKeyPath, LPTSTR pszSuggestions,
+static void SuggestKeys(HKEY hRootKey, LPCWSTR pszKeyPath, LPWSTR pszSuggestions,
                         size_t iSuggestionsLength)
 {
                         size_t iSuggestionsLength)
 {
-    TCHAR szBuffer[256];
-    TCHAR szLastFound[256];
+    WCHAR szBuffer[256];
+    WCHAR szLastFound[256];
     size_t i;
     HKEY hOtherKey, hSubKey;
     BOOL bFound;
     size_t i;
     HKEY hOtherKey, hSubKey;
     BOOL bFound;
@@ -223,7 +224,7 @@ static void SuggestKeys(HKEY hRootKey, LPCTSTR pszKeyPath, LPTSTR pszSuggestions
     iSuggestionsLength--;
 
     /* Are we a root key in HKEY_CLASSES_ROOT? */
     iSuggestionsLength--;
 
     /* Are we a root key in HKEY_CLASSES_ROOT? */
-    if ((hRootKey == HKEY_CLASSES_ROOT) && pszKeyPath[0] && !_tcschr(pszKeyPath, TEXT('\\')))
+    if ((hRootKey == HKEY_CLASSES_ROOT) && pszKeyPath[0] && !wcschr(pszKeyPath, L'\\'))
     {
         do
         {
     {
         do
         {
@@ -235,23 +236,23 @@ static void SuggestKeys(HKEY hRootKey, LPCTSTR pszKeyPath, LPTSTR pszSuggestions
             {
                 /* Sanity check this key; it cannot be empty, nor can it be a
                  * loop back */
             {
                 /* Sanity check this key; it cannot be empty, nor can it be a
                  * loop back */
-                if ((szBuffer[0] != '\0') && _tcsicmp(szBuffer, pszKeyPath))
+                if ((szBuffer[0] != L'\0') && wcsicmp(szBuffer, pszKeyPath))
                 {
                 {
-                    if (RegOpenKey(hRootKey, szBuffer, &hOtherKey) == ERROR_SUCCESS)
+                    if (RegOpenKeyW(hRootKey, szBuffer, &hOtherKey) == ERROR_SUCCESS)
                     {
                     {
-                        lstrcpyn(pszSuggestions, TEXT("HKCR\\"), (int) iSuggestionsLength);
-                        i = _tcslen(pszSuggestions);
+                        wcsncpy(pszSuggestions, L"HKCR\\", (int) iSuggestionsLength);
+                        i = wcslen(pszSuggestions);
                         pszSuggestions += i;
                         iSuggestionsLength -= i;
 
                         pszSuggestions += i;
                         iSuggestionsLength -= i;
 
-                        lstrcpyn(pszSuggestions, szBuffer, (int) iSuggestionsLength);
-                        i = MIN(_tcslen(pszSuggestions) + 1, iSuggestionsLength);
+                        wcsncpy(pszSuggestions, szBuffer, (int) iSuggestionsLength);
+                        i = MIN(wcslen(pszSuggestions) + 1, iSuggestionsLength);
                         pszSuggestions += i;
                         iSuggestionsLength -= i;
                         RegCloseKey(hOtherKey);
 
                         bFound = TRUE;
                         pszSuggestions += i;
                         iSuggestionsLength -= i;
                         RegCloseKey(hOtherKey);
 
                         bFound = TRUE;
-                        _tcscpy(szLastFound, szBuffer);
+                        wcscpy(szLastFound, szBuffer);
                         pszKeyPath = szLastFound;
                     }
                 }
                         pszKeyPath = szLastFound;
                     }
                 }
@@ -260,18 +261,18 @@ static void SuggestKeys(HKEY hRootKey, LPCTSTR pszKeyPath, LPTSTR pszSuggestions
         while(bFound && (iSuggestionsLength > 0));
 
         /* Check CLSID key */
         while(bFound && (iSuggestionsLength > 0));
 
         /* Check CLSID key */
-        if (RegOpenKey(hRootKey, pszKeyPath, &hSubKey) == ERROR_SUCCESS)
+        if (RegOpenKeyW(hRootKey, pszKeyPath, &hSubKey) == ERROR_SUCCESS)
         {
         {
-            if (QueryStringValue(hSubKey, TEXT("CLSID"), NULL, szBuffer,
+            if (QueryStringValue(hSubKey, L"CLSID", NULL, szBuffer,
                                  COUNT_OF(szBuffer)) == ERROR_SUCCESS)
             {
                                  COUNT_OF(szBuffer)) == ERROR_SUCCESS)
             {
-                lstrcpyn(pszSuggestions, TEXT("HKCR\\CLSID\\"), (int) iSuggestionsLength);
-                i = _tcslen(pszSuggestions);
+                wcsncpy(pszSuggestions, L"HKCR\\CLSID\\", (int)iSuggestionsLength);
+                i = wcslen(pszSuggestions);
                 pszSuggestions += i;
                 iSuggestionsLength -= i;
 
                 pszSuggestions += i;
                 iSuggestionsLength -= i;
 
-                lstrcpyn(pszSuggestions, szBuffer, (int) iSuggestionsLength);
-                i = MIN(_tcslen(pszSuggestions) + 1, iSuggestionsLength);
+                wcsncpy(pszSuggestions, szBuffer, (int)iSuggestionsLength);
+                i = MIN(wcslen(pszSuggestions) + 1, iSuggestionsLength);
                 pszSuggestions += i;
                 iSuggestionsLength -= i;
             }
                 pszSuggestions += i;
                 iSuggestionsLength -= i;
             }
@@ -284,7 +285,7 @@ static void SuggestKeys(HKEY hRootKey, LPCTSTR pszKeyPath, LPTSTR pszSuggestions
 LRESULT CALLBACK AddressBarProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
     WNDPROC oldwndproc;
 LRESULT CALLBACK AddressBarProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
     WNDPROC oldwndproc;
-    static TCHAR s_szNode[256];
+    static WCHAR s_szNode[256];
     oldwndproc = (WNDPROC)(LONG_PTR)GetWindowLongPtr(hwnd, GWL_USERDATA);
 
     switch (uMsg)
     oldwndproc = (WNDPROC)(LONG_PTR)GetWindowLongPtr(hwnd, GWL_USERDATA);
 
     switch (uMsg)
@@ -292,7 +293,7 @@ LRESULT CALLBACK AddressBarProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPar
     case WM_KEYUP:
         if (wParam == VK_RETURN)
         {
     case WM_KEYUP:
         if (wParam == VK_RETURN)
         {
-            GetWindowText(hwnd, s_szNode, COUNT_OF(s_szNode));
+            GetWindowTextW(hwnd, s_szNode, COUNT_OF(s_szNode));
             SelectNode(g_pChildWnd->hTreeWnd, s_szNode);
         }
         break;
             SelectNode(g_pChildWnd->hTreeWnd, s_szNode);
         }
         break;
@@ -323,22 +324,22 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
     {
         WNDPROC oldproc;
         HFONT hFont;
     {
         WNDPROC oldproc;
         HFONT hFont;
-        TCHAR buffer[MAX_PATH];
+        WCHAR buffer[MAX_PATH];
         /* load "My Computer" string */
         /* load "My Computer" string */
-        LoadString(hInst, IDS_MY_COMPUTER, buffer, COUNT_OF(buffer));
+        LoadStringW(hInst, IDS_MY_COMPUTER, buffer, COUNT_OF(buffer));
 
         g_pChildWnd = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ChildWnd));
         if (!g_pChildWnd) return 0;
 
 
         g_pChildWnd = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ChildWnd));
         if (!g_pChildWnd) return 0;
 
-        _tcsncpy(g_pChildWnd->szPath, buffer, MAX_PATH);
+        wcsncpy(g_pChildWnd->szPath, buffer, MAX_PATH);
         g_pChildWnd->nSplitPos = 250;
         g_pChildWnd->hWnd = hWnd;
         g_pChildWnd->nSplitPos = 250;
         g_pChildWnd->hWnd = hWnd;
-        g_pChildWnd->hAddressBarWnd = CreateWindowEx(WS_EX_CLIENTEDGE, _T("Edit"), NULL, WS_CHILD | WS_VISIBLE | WS_CHILDWINDOW | WS_TABSTOP,
-                                    CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
-                                    hWnd, (HMENU)0, hInst, 0);
-        g_pChildWnd->hAddressBtnWnd = CreateWindowEx(WS_EX_CLIENTEDGE, _T("Button"), _T("»"), WS_CHILD | WS_VISIBLE | WS_CHILDWINDOW | WS_TABSTOP | BS_DEFPUSHBUTTON,
-                                    CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
-                                    hWnd, (HMENU)0, hInst, 0);
+        g_pChildWnd->hAddressBarWnd = CreateWindowExW(WS_EX_CLIENTEDGE, L"Edit", NULL, WS_CHILD | WS_VISIBLE | WS_CHILDWINDOW | WS_TABSTOP,
+                                                      CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
+                                                      hWnd, (HMENU)0, hInst, 0);
+        g_pChildWnd->hAddressBtnWnd = CreateWindowExW(WS_EX_CLIENTEDGE, L"Button", L"»", WS_CHILD | WS_VISIBLE | WS_CHILDWINDOW | WS_TABSTOP | BS_DEFPUSHBUTTON,
+                                                      CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
+                                                      hWnd, (HMENU)0, hInst, 0);
         g_pChildWnd->hTreeWnd = CreateTreeView(hWnd, g_pChildWnd->szPath, (HMENU) TREE_WINDOW);
         g_pChildWnd->hListWnd = CreateListView(hWnd, (HMENU) LIST_WINDOW/*, g_pChildWnd->szPath*/);
         SetFocus(g_pChildWnd->hTreeWnd);
         g_pChildWnd->hTreeWnd = CreateTreeView(hWnd, g_pChildWnd->szPath, (HMENU) TREE_WINDOW);
         g_pChildWnd->hListWnd = CreateListView(hWnd, (HMENU) LIST_WINDOW/*, g_pChildWnd->szPath*/);
         SetFocus(g_pChildWnd->hTreeWnd);
@@ -347,14 +348,14 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
         if ((g_pChildWnd->hAddressBarWnd) && (g_pChildWnd->hAddressBtnWnd))
         {
             hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
         if ((g_pChildWnd->hAddressBarWnd) && (g_pChildWnd->hAddressBtnWnd))
         {
             hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
-            SendMessage(g_pChildWnd->hAddressBarWnd,
-                        WM_SETFONT,
-                        (WPARAM)hFont,
-                        0);
-            SendMessage(g_pChildWnd->hAddressBtnWnd,
-                        WM_SETFONT,
-                        (WPARAM)hFont,
-                        0);
+            SendMessageW(g_pChildWnd->hAddressBarWnd,
+                         WM_SETFONT,
+                         (WPARAM)hFont,
+                         0);
+            SendMessageW(g_pChildWnd->hAddressBtnWnd,
+                         WM_SETFONT,
+                         (WPARAM)hFont,
+                         0);
         }
         /* Subclass the AddressBar */
         oldproc = (WNDPROC)(LONG_PTR)GetWindowLongPtr(g_pChildWnd->hAddressBarWnd, GWL_WNDPROC);
         }
         /* Subclass the AddressBar */
         oldproc = (WNDPROC)(LONG_PTR)GetWindowLongPtr(g_pChildWnd->hAddressBarWnd, GWL_WNDPROC);
@@ -365,7 +366,7 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
     case WM_COMMAND:
         if(HIWORD(wParam) == BN_CLICKED)
         {
     case WM_COMMAND:
         if(HIWORD(wParam) == BN_CLICKED)
         {
-            PostMessage(g_pChildWnd->hAddressBarWnd, WM_KEYUP, VK_RETURN, 0);
+            PostMessageW(g_pChildWnd->hAddressBarWnd, WM_KEYUP, VK_RETURN, 0);
         }
 
         if (!_CmdWndProc(hWnd, message, wParam, lParam))
         }
 
         if (!_CmdWndProc(hWnd, message, wParam, lParam))
@@ -384,7 +385,7 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
             ScreenToClient(hWnd, &pt);
             if (pt.x>=g_pChildWnd->nSplitPos-SPLIT_WIDTH/2 && pt.x<g_pChildWnd->nSplitPos+SPLIT_WIDTH/2+1)
             {
             ScreenToClient(hWnd, &pt);
             if (pt.x>=g_pChildWnd->nSplitPos-SPLIT_WIDTH/2 && pt.x<g_pChildWnd->nSplitPos+SPLIT_WIDTH/2+1)
             {
-                SetCursor(LoadCursor(0, IDC_SIZEWE));
+                SetCursor(LoadCursorW(0, IDC_SIZEWE));
                 return TRUE;
             }
         }
                 return TRUE;
             }
         }
@@ -434,7 +435,7 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
                 ResizeWnd(rt.right, rt.bottom);
                 last_split = -1;
                 ReleaseCapture();
                 ResizeWnd(rt.right, rt.bottom);
                 last_split = -1;
                 ReleaseCapture();
-                SetCursor(LoadCursor(0, IDC_ARROW));
+                SetCursor(LoadCursorW(0, IDC_ARROW));
             }
         break;
 
             }
         break;
 
@@ -493,8 +494,8 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
                 return !OnTreeExpanding(g_pChildWnd->hTreeWnd, (NMTREEVIEW*)lParam);
             case TVN_SELCHANGED:
             {
                 return !OnTreeExpanding(g_pChildWnd->hTreeWnd, (NMTREEVIEW*)lParam);
             case TVN_SELCHANGED:
             {
-                LPCTSTR keyPath, rootName;
-                LPTSTR fullPath;
+                LPCWSTR keyPath, rootName;
+                LPWSTR fullPath;
                 HKEY hRootKey;
 
                 keyPath = GetItemPath(g_pChildWnd->hTreeWnd, ((NMTREEVIEW*)lParam)->itemNew.hItem, &hRootKey);
                 HKEY hRootKey;
 
                 keyPath = GetItemPath(g_pChildWnd->hTreeWnd, ((NMTREEVIEW*)lParam)->itemNew.hItem, &hRootKey);
@@ -502,29 +503,29 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
                 {
                     RefreshListView(g_pChildWnd->hListWnd, hRootKey, keyPath);
                     rootName = get_root_key_name(hRootKey);
                 {
                     RefreshListView(g_pChildWnd->hListWnd, hRootKey, keyPath);
                     rootName = get_root_key_name(hRootKey);
-                    fullPath = HeapAlloc(GetProcessHeap(), 0, (_tcslen(rootName) + 1 + _tcslen(keyPath) + 1) * sizeof(TCHAR));
+                    fullPath = HeapAlloc(GetProcessHeap(), 0, (wcslen(rootName) + 1 + wcslen(keyPath) + 1) * sizeof(WCHAR));
                     if (fullPath)
                     {
                         /* set (correct) the address bar text */
                     if (fullPath)
                     {
                         /* set (correct) the address bar text */
-                        if(keyPath[0] != '\0')
-                            _stprintf(fullPath, _T("%s\\%s"), rootName, keyPath);
+                        if(keyPath[0] != L'\0')
+                            swprintf(fullPath, L"%s\\%s", rootName, keyPath);
                         else
                         else
-                            fullPath = _tcscpy(fullPath, rootName);
-                        SendMessage(hStatusBar, SB_SETTEXT, 0, (LPARAM)fullPath);
-                        SendMessage(g_pChildWnd->hAddressBarWnd, WM_SETTEXT, 0, (LPARAM)fullPath);
+                            fullPath = wcscpy(fullPath, rootName);
+                        SendMessageW(hStatusBar, SB_SETTEXTW, 0, (LPARAM)fullPath);
+                        SendMessageW(g_pChildWnd->hAddressBarWnd, WM_SETTEXT, 0, (LPARAM)fullPath);
                         HeapFree(GetProcessHeap(), 0, fullPath);
                         /* disable hive manipulation items temporarily (enable only if necessary) */
                         EnableMenuItem(GetSubMenu(hMenuFrame,0), ID_REGISTRY_LOADHIVE, MF_BYCOMMAND | MF_GRAYED);
                         EnableMenuItem(GetSubMenu(hMenuFrame,0), ID_REGISTRY_UNLOADHIVE, MF_BYCOMMAND | MF_GRAYED);
                         /* compare the strings to see if we should enable/disable the "Load Hive" menus accordingly */
                         HeapFree(GetProcessHeap(), 0, fullPath);
                         /* disable hive manipulation items temporarily (enable only if necessary) */
                         EnableMenuItem(GetSubMenu(hMenuFrame,0), ID_REGISTRY_LOADHIVE, MF_BYCOMMAND | MF_GRAYED);
                         EnableMenuItem(GetSubMenu(hMenuFrame,0), ID_REGISTRY_UNLOADHIVE, MF_BYCOMMAND | MF_GRAYED);
                         /* compare the strings to see if we should enable/disable the "Load Hive" menus accordingly */
-                        if (!(_tcsicmp(rootName, TEXT("HKEY_LOCAL_MACHINE")) &&
-                                _tcsicmp(rootName, TEXT("HKEY_USERS"))))
+                        if (!(wcsicmp(rootName, L"HKEY_LOCAL_MACHINE") &&
+                                wcsicmp(rootName, L"HKEY_USERS")))
                         {
                             // enable the unload menu item if at the root
                             // otherwise enable the load menu item if there is no slash in keyPath (ie. immediate child selected)
                         {
                             // enable the unload menu item if at the root
                             // otherwise enable the load menu item if there is no slash in keyPath (ie. immediate child selected)
-                            if(keyPath[0] == '\0')
+                            if(keyPath[0] == L'\0')
                                 EnableMenuItem(GetSubMenu(hMenuFrame,0), ID_REGISTRY_LOADHIVE, MF_BYCOMMAND | MF_ENABLED);
                                 EnableMenuItem(GetSubMenu(hMenuFrame,0), ID_REGISTRY_LOADHIVE, MF_BYCOMMAND | MF_ENABLED);
-                            else if(!_tcschr(keyPath, _T('\\')))
+                            else if(!wcschr(keyPath, L'\\'))
                                 EnableMenuItem(GetSubMenu(hMenuFrame,0), ID_REGISTRY_UNLOADHIVE, MF_BYCOMMAND | MF_ENABLED);
                         }
                     }
                                 EnableMenuItem(GetSubMenu(hMenuFrame,0), ID_REGISTRY_UNLOADHIVE, MF_BYCOMMAND | MF_ENABLED);
                         }
                     }
@@ -540,26 +541,26 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
                 /* cancel label edit for rootkeys  */
                 ptvdi = (LPNMTVDISPINFO) lParam;
                 if (!TreeView_GetParent(g_pChildWnd->hTreeWnd, ptvdi->item.hItem) ||
                 /* cancel label edit for rootkeys  */
                 ptvdi = (LPNMTVDISPINFO) lParam;
                 if (!TreeView_GetParent(g_pChildWnd->hTreeWnd, ptvdi->item.hItem) ||
-                        !TreeView_GetParent(g_pChildWnd->hTreeWnd, TreeView_GetParent(g_pChildWnd->hTreeWnd, ptvdi->item.hItem)))
+                    !TreeView_GetParent(g_pChildWnd->hTreeWnd, TreeView_GetParent(g_pChildWnd->hTreeWnd, ptvdi->item.hItem)))
                     return TRUE;
                 break;
             }
             case TVN_ENDLABELEDIT:
             {
                     return TRUE;
                 break;
             }
             case TVN_ENDLABELEDIT:
             {
-                LPCTSTR keyPath;
+                LPCWSTR keyPath;
                 HKEY hRootKey;
                 HKEY hKey = NULL;
                 LPNMTVDISPINFO ptvdi;
                 LONG lResult = TRUE;
                 HKEY hRootKey;
                 HKEY hKey = NULL;
                 LPNMTVDISPINFO ptvdi;
                 LONG lResult = TRUE;
-                TCHAR szBuffer[MAX_PATH];
+                WCHAR szBuffer[MAX_PATH];
 
                 ptvdi = (LPNMTVDISPINFO) lParam;
                 if (ptvdi->item.pszText)
                 {
                     keyPath = GetItemPath(g_pChildWnd->hTreeWnd, TreeView_GetParent(g_pChildWnd->hTreeWnd, ptvdi->item.hItem), &hRootKey);
 
                 ptvdi = (LPNMTVDISPINFO) lParam;
                 if (ptvdi->item.pszText)
                 {
                     keyPath = GetItemPath(g_pChildWnd->hTreeWnd, TreeView_GetParent(g_pChildWnd->hTreeWnd, ptvdi->item.hItem), &hRootKey);
-                    _sntprintf(szBuffer, COUNT_OF(szBuffer), _T("%s\\%s"), keyPath, ptvdi->item.pszText);
+                    _snwprintf(szBuffer, COUNT_OF(szBuffer), L"%s\\%s", keyPath, ptvdi->item.pszText);
                     keyPath = GetItemPath(g_pChildWnd->hTreeWnd, ptvdi->item.hItem, &hRootKey);
                     keyPath = GetItemPath(g_pChildWnd->hTreeWnd, ptvdi->item.hItem, &hRootKey);
-                    if (RegOpenKeyEx(hRootKey, szBuffer, 0, KEY_READ, &hKey) == ERROR_SUCCESS)
+                    if (RegOpenKeyExW(hRootKey, szBuffer, 0, KEY_READ, &hKey) == ERROR_SUCCESS)
                     {
                         lResult = FALSE;
                         RegCloseKey(hKey);
                     {
                         lResult = FALSE;
                         RegCloseKey(hKey);
@@ -615,7 +616,7 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
                 if (i != -1)
                 {
                     rc.left = LVIR_BOUNDS;
                 if (i != -1)
                 {
                     rc.left = LVIR_BOUNDS;
-                    SendMessage(g_pChildWnd->hListWnd, LVM_GETITEMRECT, i, (LPARAM) &rc);
+                    SendMessageW(g_pChildWnd->hListWnd, LVM_GETITEMRECT, i, (LPARAM) &rc);
                     pt.x = rc.left + 8;
                     pt.y = rc.top + 8;
                 }
                     pt.x = rc.left + 8;
                     pt.y = rc.top + 8;
                 }
@@ -648,10 +649,10 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
             HMENU hContextMenu;
             TVITEM item;
             MENUITEMINFO mii;
             HMENU hContextMenu;
             TVITEM item;
             MENUITEMINFO mii;
-            TCHAR resource[256];
-            TCHAR buffer[256];
-            LPTSTR s;
-            LPCTSTR keyPath;
+            WCHAR resource[256];
+            WCHAR buffer[256];
+            LPWSTR s;
+            LPCWSTR keyPath;
             HKEY hRootKey;
             int iLastPos;
             WORD wID;
             HKEY hRootKey;
             int iLastPos;
             WORD wID;
@@ -693,13 +694,13 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
                 (void)TreeView_GetItem(g_pChildWnd->hTreeWnd, &item);
 
                 /* Set the Expand/Collapse menu item appropriately */
                 (void)TreeView_GetItem(g_pChildWnd->hTreeWnd, &item);
 
                 /* Set the Expand/Collapse menu item appropriately */
-                LoadString(hInst, (item.state & TVIS_EXPANDED) ? IDS_COLLAPSE : IDS_EXPAND, buffer, COUNT_OF(buffer));
+                LoadStringW(hInst, (item.state & TVIS_EXPANDED) ? IDS_COLLAPSE : IDS_EXPAND, buffer, COUNT_OF(buffer));
                 memset(&mii, 0, sizeof(mii));
                 mii.cbSize = sizeof(mii);
                 mii.fMask = MIIM_STRING | MIIM_STATE | MIIM_ID;
                 mii.fState = (item.cChildren > 0) ? MFS_DEFAULT : MFS_GRAYED;
                 mii.wID = (item.state & TVIS_EXPANDED) ? ID_TREE_COLLAPSEBRANCH : ID_TREE_EXPANDBRANCH;
                 memset(&mii, 0, sizeof(mii));
                 mii.cbSize = sizeof(mii);
                 mii.fMask = MIIM_STRING | MIIM_STATE | MIIM_ID;
                 mii.fState = (item.cChildren > 0) ? MFS_DEFAULT : MFS_GRAYED;
                 mii.wID = (item.state & TVIS_EXPANDED) ? ID_TREE_COLLAPSEBRANCH : ID_TREE_EXPANDBRANCH;
-                mii.dwTypeData = (LPTSTR) buffer;
+                mii.dwTypeData = (LPWSTR) buffer;
                 SetMenuItemInfo(hContextMenu, 0, TRUE, &mii);
 
                 /* Remove any existing suggestions */
                 SetMenuItemInfo(hContextMenu, 0, TRUE, &mii);
 
                 /* Remove any existing suggestions */
@@ -725,13 +726,13 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
                 {
                     AppendMenu(hContextMenu, MF_SEPARATOR, 0, NULL);
 
                 {
                     AppendMenu(hContextMenu, MF_SEPARATOR, 0, NULL);
 
-                    LoadString(hInst, IDS_GOTO_SUGGESTED_KEY, resource, COUNT_OF(resource));
+                    LoadStringW(hInst, IDS_GOTO_SUGGESTED_KEY, resource, COUNT_OF(resource));
 
                     s = Suggestions;
                     wID = ID_TREE_SUGGESTION_MIN;
                     while(*s && (wID <= ID_TREE_SUGGESTION_MAX))
                     {
 
                     s = Suggestions;
                     wID = ID_TREE_SUGGESTION_MIN;
                     while(*s && (wID <= ID_TREE_SUGGESTION_MAX))
                     {
-                        _sntprintf(buffer, COUNT_OF(buffer), resource, s);
+                        _snwprintf(buffer, COUNT_OF(buffer), resource, s);
 
                         memset(&mii, 0, sizeof(mii));
                         mii.cbSize = sizeof(mii);
 
                         memset(&mii, 0, sizeof(mii));
                         mii.cbSize = sizeof(mii);
@@ -740,7 +741,7 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
                         mii.dwTypeData = buffer;
                         InsertMenuItem(hContextMenu, GetMenuItemCount(hContextMenu), TRUE, &mii);
 
                         mii.dwTypeData = buffer;
                         InsertMenuItem(hContextMenu, GetMenuItemCount(hContextMenu), TRUE, &mii);
 
-                        s += _tcslen(s) + 1;
+                        s += wcslen(s) + 1;
                     }
                 }
                 TrackPopupMenu(hContextMenu, TPM_RIGHTBUTTON, pt.x, pt.y, 0, g_pChildWnd->hWnd, NULL);
                     }
                 }
                 TrackPopupMenu(hContextMenu, TPM_RIGHTBUTTON, pt.x, pt.y, 0, g_pChildWnd->hWnd, NULL);
@@ -757,7 +758,7 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
         /* fall through */
     default:
 def:
         /* fall through */
     default:
 def:
-        return DefWindowProc(hWnd, message, wParam, lParam);
+        return DefWindowProcW(hWnd, message, wParam, lParam);
     }
     return 0;
 }
     }
     return 0;
 }
index 6b30846..4ff2ec9 100644 (file)
@@ -27,8 +27,8 @@ typedef enum _EDIT_MODE
 } EDIT_MODE;
 
 
 } EDIT_MODE;
 
 
-static const TCHAR* editValueName;
-static TCHAR* stringValueData;
+static const WCHAR* editValueName;
+static WCHAR* stringValueData;
 static PVOID binValueData;
 static DWORD dwordValueData;
 static PCM_RESOURCE_LIST resourceValueData;
 static PVOID binValueData;
 static DWORD dwordValueData;
 static PCM_RESOURCE_LIST resourceValueData;
@@ -39,60 +39,60 @@ static EDIT_MODE dwordEditMode = EDIT_MODE_HEX;
 void error(HWND hwnd, INT resId, ...)
 {
     va_list ap;
 void error(HWND hwnd, INT resId, ...)
 {
     va_list ap;
-    TCHAR title[256];
-    TCHAR errfmt[1024];
-    TCHAR errstr[1024];
+    WCHAR title[256];
+    WCHAR errfmt[1024];
+    WCHAR errstr[1024];
     HINSTANCE hInstance;
 
     hInstance = GetModuleHandle(0);
 
     HINSTANCE hInstance;
 
     hInstance = GetModuleHandle(0);
 
-    if (!LoadString(hInstance, IDS_ERROR, title, COUNT_OF(title)))
-        _tcscpy(title, _T("Error"));
+    if (!LoadStringW(hInstance, IDS_ERROR, title, COUNT_OF(title)))
+        wcscpy(title, L"Error");
 
 
-    if (!LoadString(hInstance, resId, errfmt, COUNT_OF(errfmt)))
-        _tcscpy(errfmt, _T("Unknown error string!"));
+    if (!LoadStringW(hInstance, resId, errfmt, COUNT_OF(errfmt)))
+        wcscpy(errfmt, L"Unknown error string!");
 
     va_start(ap, resId);
 
     va_start(ap, resId);
-    _vsntprintf(errstr, COUNT_OF(errstr), errfmt, ap);
+    _vsnwprintf(errstr, COUNT_OF(errstr), errfmt, ap);
     va_end(ap);
 
     va_end(ap);
 
-    MessageBox(hwnd, errstr, title, MB_OK | MB_ICONERROR);
+    MessageBoxW(hwnd, errstr, title, MB_OK | MB_ICONERROR);
 }
 
 static void error_code_messagebox(HWND hwnd, DWORD error_code)
 {
 }
 
 static void error_code_messagebox(HWND hwnd, DWORD error_code)
 {
-    TCHAR title[256];
-    if (!LoadString(hInst, IDS_ERROR, title, COUNT_OF(title)))
-        lstrcpy(title, TEXT("Error"));
+    WCHAR title[256];
+    if (!LoadStringW(hInst, IDS_ERROR, title, COUNT_OF(title)))
+        wcscpy(title, L"Error");
     ErrorMessageBox(hwnd, title, error_code);
 }
 
 void warning(HWND hwnd, INT resId, ...)
 {
     va_list ap;
     ErrorMessageBox(hwnd, title, error_code);
 }
 
 void warning(HWND hwnd, INT resId, ...)
 {
     va_list ap;
-    TCHAR title[256];
-    TCHAR errfmt[1024];
-    TCHAR errstr[1024];
+    WCHAR title[256];
+    WCHAR errfmt[1024];
+    WCHAR errstr[1024];
     HINSTANCE hInstance;
 
     hInstance = GetModuleHandle(0);
 
     HINSTANCE hInstance;
 
     hInstance = GetModuleHandle(0);
 
-    if (!LoadString(hInstance, IDS_WARNING, title, COUNT_OF(title)))
-        _tcscpy(title, _T("Warning"));
+    if (!LoadStringW(hInstance, IDS_WARNING, title, COUNT_OF(title)))
+        wcscpy(title, L"Warning");
 
 
-    if (!LoadString(hInstance, resId, errfmt, COUNT_OF(errfmt)))
-        _tcscpy(errfmt, _T("Unknown error string!"));
+    if (!LoadStringW(hInstance, resId, errfmt, COUNT_OF(errfmt)))
+        wcscpy(errfmt, L"Unknown error string!");
 
     va_start(ap, resId);
 
     va_start(ap, resId);
-    _vsntprintf(errstr, COUNT_OF(errstr), errfmt, ap);
+    _vsnwprintf(errstr, COUNT_OF(errstr), errfmt, ap);
     va_end(ap);
 
     va_end(ap);
 
-    MessageBox(hwnd, errstr, title, MB_OK | MB_ICONSTOP);
+    MessageBoxW(hwnd, errstr, title, MB_OK | MB_ICONSTOP);
 }
 
 INT_PTR CALLBACK modify_string_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
 }
 
 INT_PTR CALLBACK modify_string_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
-    TCHAR* valueData;
+    WCHAR* valueData;
     HWND hwndValue;
     int len;
 
     HWND hwndValue;
     int len;
 
@@ -101,17 +101,17 @@ INT_PTR CALLBACK modify_string_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
     switch(uMsg)
     {
     case WM_INITDIALOG:
     switch(uMsg)
     {
     case WM_INITDIALOG:
-        if(editValueName && _tcscmp(editValueName, _T("")))
+        if (editValueName && wcscmp(editValueName, L""))
         {
         {
-            SetDlgItemText(hwndDlg, IDC_VALUE_NAME, editValueName);
+            SetDlgItemTextW(hwndDlg, IDC_VALUE_NAME, editValueName);
         }
         else
         {
         }
         else
         {
-            TCHAR buffer[255];
-            LoadString(hInst, IDS_DEFAULT_VALUE_NAME, buffer, COUNT_OF(buffer));
-            SetDlgItemText(hwndDlg, IDC_VALUE_NAME, buffer);
+            WCHAR buffer[255];
+            LoadStringW(hInst, IDS_DEFAULT_VALUE_NAME, buffer, COUNT_OF(buffer));
+            SetDlgItemTextW(hwndDlg, IDC_VALUE_NAME, buffer);
         }
         }
-        SetDlgItemText(hwndDlg, IDC_VALUE_DATA, stringValueData);
+        SetDlgItemTextW(hwndDlg, IDC_VALUE_DATA, stringValueData);
         SetFocus(GetDlgItem(hwndDlg, IDC_VALUE_DATA));
         return FALSE;
     case WM_COMMAND:
         SetFocus(GetDlgItem(hwndDlg, IDC_VALUE_DATA));
         return FALSE;
     case WM_COMMAND:
@@ -124,19 +124,19 @@ INT_PTR CALLBACK modify_string_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
                 {
                     if (stringValueData)
                     {
                 {
                     if (stringValueData)
                     {
-                        if ((valueData = HeapReAlloc(GetProcessHeap(), 0, stringValueData, (len + 1) * sizeof(TCHAR))))
+                        if ((valueData = HeapReAlloc(GetProcessHeap(), 0, stringValueData, (len + 1) * sizeof(WCHAR))))
                         {
                             stringValueData = valueData;
                         {
                             stringValueData = valueData;
-                            if (!GetWindowText(hwndValue, stringValueData, len + 1))
+                            if (!GetWindowTextW(hwndValue, stringValueData, len + 1))
                                 *stringValueData = 0;
                         }
                     }
                     else
                     {
                                 *stringValueData = 0;
                         }
                     }
                     else
                     {
-                        if ((valueData = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(TCHAR))))
+                        if ((valueData = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR))))
                         {
                             stringValueData = valueData;
                         {
                             stringValueData = valueData;
-                            if (!GetWindowText(hwndValue, stringValueData, len + 1))
+                            if (!GetWindowTextW(hwndValue, stringValueData, len + 1))
                                 *stringValueData = 0;
                         }
                     }
                                 *stringValueData = 0;
                         }
                     }
@@ -160,7 +160,7 @@ INT_PTR CALLBACK modify_string_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
 
 INT_PTR CALLBACK modify_multi_string_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
 
 INT_PTR CALLBACK modify_multi_string_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
-    TCHAR* valueData;
+    WCHAR* valueData;
     HWND hwndValue;
     int len;
 
     HWND hwndValue;
     int len;
 
@@ -169,17 +169,17 @@ INT_PTR CALLBACK modify_multi_string_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wPa
     switch(uMsg)
     {
     case WM_INITDIALOG:
     switch(uMsg)
     {
     case WM_INITDIALOG:
-        if(editValueName && _tcscmp(editValueName, _T("")))
+        if (editValueName && wcscmp(editValueName, L""))
         {
         {
-            SetDlgItemText(hwndDlg, IDC_VALUE_NAME, editValueName);
+            SetDlgItemTextW(hwndDlg, IDC_VALUE_NAME, editValueName);
         }
         else
         {
         }
         else
         {
-            TCHAR buffer[255];
-            LoadString(hInst, IDS_DEFAULT_VALUE_NAME, buffer, COUNT_OF(buffer));
-            SetDlgItemText(hwndDlg, IDC_VALUE_NAME, buffer);
+            WCHAR buffer[255];
+            LoadStringW(hInst, IDS_DEFAULT_VALUE_NAME, buffer, COUNT_OF(buffer));
+            SetDlgItemTextW(hwndDlg, IDC_VALUE_NAME, buffer);
         }
         }
-        SetDlgItemText(hwndDlg, IDC_VALUE_DATA, stringValueData);
+        SetDlgItemTextW(hwndDlg, IDC_VALUE_DATA, stringValueData);
         SetFocus(GetDlgItem(hwndDlg, IDC_VALUE_DATA));
         return FALSE;
     case WM_COMMAND:
         SetFocus(GetDlgItem(hwndDlg, IDC_VALUE_DATA));
         return FALSE;
     case WM_COMMAND:
@@ -192,19 +192,19 @@ INT_PTR CALLBACK modify_multi_string_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wPa
                 {
                     if (stringValueData)
                     {
                 {
                     if (stringValueData)
                     {
-                        if ((valueData = HeapReAlloc(GetProcessHeap(), 0, stringValueData, (len + 1) * sizeof(TCHAR))))
+                        if ((valueData = HeapReAlloc(GetProcessHeap(), 0, stringValueData, (len + 1) * sizeof(WCHAR))))
                         {
                             stringValueData = valueData;
                         {
                             stringValueData = valueData;
-                            if (!GetWindowText(hwndValue, stringValueData, len + 1))
+                            if (!GetWindowTextW(hwndValue, stringValueData, len + 1))
                                 *stringValueData = 0;
                         }
                     }
                     else
                     {
                                 *stringValueData = 0;
                         }
                     }
                     else
                     {
-                        if ((valueData = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(TCHAR))))
+                        if ((valueData = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR))))
                         {
                             stringValueData = valueData;
                         {
                             stringValueData = valueData;
-                            if (!GetWindowText(hwndValue, stringValueData, len + 1))
+                            if (!GetWindowTextW(hwndValue, stringValueData, len + 1))
                                 *stringValueData = 0;
                         }
                     }
                                 *stringValueData = 0;
                         }
                     }
@@ -271,8 +271,8 @@ INT_PTR CALLBACK modify_dword_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
 {
     WNDPROC oldproc;
     HWND hwndValue;
 {
     WNDPROC oldproc;
     HWND hwndValue;
-    TCHAR ValueString[32];
-    LPTSTR Remainder;
+    WCHAR ValueString[32];
+    LPWSTR Remainder;
     DWORD Base;
     DWORD Value = 0;
 
     DWORD Base;
     DWORD Value = 0;
 
@@ -289,19 +289,19 @@ INT_PTR CALLBACK modify_dword_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
         SetWindowLongPtr(hwndValue, GWL_USERDATA, (DWORD_PTR)oldproc);
         SetWindowLongPtr(hwndValue, GWL_WNDPROC, (DWORD_PTR)DwordEditSubclassProc);
 
         SetWindowLongPtr(hwndValue, GWL_USERDATA, (DWORD_PTR)oldproc);
         SetWindowLongPtr(hwndValue, GWL_WNDPROC, (DWORD_PTR)DwordEditSubclassProc);
 
-        if(editValueName && _tcscmp(editValueName, _T("")))
+        if (editValueName && wcscmp(editValueName, L""))
         {
         {
-            SetDlgItemText(hwndDlg, IDC_VALUE_NAME, editValueName);
+            SetDlgItemTextW(hwndDlg, IDC_VALUE_NAME, editValueName);
         }
         else
         {
         }
         else
         {
-            TCHAR buffer[255];
-            LoadString(hInst, IDS_DEFAULT_VALUE_NAME, buffer, COUNT_OF(buffer));
-            SetDlgItemText(hwndDlg, IDC_VALUE_NAME, buffer);
+            WCHAR buffer[255];
+            LoadStringW(hInst, IDS_DEFAULT_VALUE_NAME, buffer, COUNT_OF(buffer));
+            SetDlgItemTextW(hwndDlg, IDC_VALUE_NAME, buffer);
         }
         CheckRadioButton (hwndDlg, IDC_FORMAT_HEX, IDC_FORMAT_DEC, IDC_FORMAT_HEX);
         }
         CheckRadioButton (hwndDlg, IDC_FORMAT_HEX, IDC_FORMAT_DEC, IDC_FORMAT_HEX);
-        _stprintf (ValueString, _T("%lx"), dwordValueData);
-        SetDlgItemText(hwndDlg, IDC_VALUE_DATA, ValueString);
+        swprintf(ValueString, L"%lx", dwordValueData);
+        SetDlgItemTextW(hwndDlg, IDC_VALUE_DATA, ValueString);
         SetFocus(GetDlgItem(hwndDlg, IDC_VALUE_DATA));
         return FALSE;
 
         SetFocus(GetDlgItem(hwndDlg, IDC_VALUE_DATA));
         return FALSE;
 
@@ -316,14 +316,14 @@ INT_PTR CALLBACK modify_dword_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
                 {
                     if (GetWindowTextLength(hwndValue))
                     {
                 {
                     if (GetWindowTextLength(hwndValue))
                     {
-                        if (GetWindowText(hwndValue, ValueString, 32))
+                        if (GetWindowTextW(hwndValue, ValueString, 32))
                         {
                         {
-                            Value = _tcstoul (ValueString, &Remainder, 10);
+                            Value = wcstoul (ValueString, &Remainder, 10);
                         }
                     }
                 }
                         }
                     }
                 }
-                _stprintf (ValueString, _T("%lx"), Value);
-                SetDlgItemText(hwndDlg, IDC_VALUE_DATA, ValueString);
+                swprintf(ValueString, L"%lx", Value);
+                SetDlgItemTextW(hwndDlg, IDC_VALUE_DATA, ValueString);
                 return TRUE;
             }
             break;
                 return TRUE;
             }
             break;
@@ -336,14 +336,14 @@ INT_PTR CALLBACK modify_dword_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
                 {
                     if (GetWindowTextLength(hwndValue))
                     {
                 {
                     if (GetWindowTextLength(hwndValue))
                     {
-                        if (GetWindowText(hwndValue, ValueString, 32))
+                        if (GetWindowTextW(hwndValue, ValueString, 32))
                         {
                         {
-                            Value = _tcstoul (ValueString, &Remainder, 16);
+                            Value = wcstoul (ValueString, &Remainder, 16);
                         }
                     }
                 }
                         }
                     }
                 }
-                _stprintf (ValueString, _T("%lu"), Value);
-                SetDlgItemText(hwndDlg, IDC_VALUE_DATA, ValueString);
+                swprintf(ValueString, L"%lu", Value);
+                SetDlgItemTextW(hwndDlg, IDC_VALUE_DATA, ValueString);
                 return TRUE;
             }
             break;
                 return TRUE;
             }
             break;
@@ -353,14 +353,14 @@ INT_PTR CALLBACK modify_dword_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
             {
                 if (GetWindowTextLength(hwndValue))
                 {
             {
                 if (GetWindowTextLength(hwndValue))
                 {
-                    if (!GetWindowText(hwndValue, ValueString, 32))
+                    if (!GetWindowTextW(hwndValue, ValueString, 32))
                     {
                         EndDialog(hwndDlg, IDCANCEL);
                         return TRUE;
                     }
 
                     Base = (dwordEditMode == EDIT_MODE_HEX) ? 16 : 10;
                     {
                         EndDialog(hwndDlg, IDCANCEL);
                         return TRUE;
                     }
 
                     Base = (dwordEditMode == EDIT_MODE_HEX) ? 16 : 10;
-                    dwordValueData = _tcstoul (ValueString, &Remainder, Base);
+                    dwordValueData = wcstoul (ValueString, &Remainder, Base);
                 }
                 else
                 {
                 }
                 else
                 {
@@ -390,20 +390,20 @@ INT_PTR CALLBACK modify_binary_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
     switch(uMsg)
     {
     case WM_INITDIALOG:
     switch(uMsg)
     {
     case WM_INITDIALOG:
-        if(editValueName && _tcscmp(editValueName, _T("")))
+        if (editValueName && wcscmp(editValueName, L""))
         {
         {
-            SetDlgItemText(hwndDlg, IDC_VALUE_NAME, editValueName);
+            SetDlgItemTextW(hwndDlg, IDC_VALUE_NAME, editValueName);
         }
         else
         {
         }
         else
         {
-            TCHAR buffer[255];
-            LoadString(hInst, IDS_DEFAULT_VALUE_NAME, buffer, COUNT_OF(buffer));
-            SetDlgItemText(hwndDlg, IDC_VALUE_NAME, buffer);
+            WCHAR buffer[255];
+            LoadStringW(hInst, IDS_DEFAULT_VALUE_NAME, buffer, COUNT_OF(buffer));
+            SetDlgItemTextW(hwndDlg, IDC_VALUE_NAME, buffer);
         }
         hwndValue = GetDlgItem(hwndDlg, IDC_VALUE_DATA);
         HexEdit_LoadBuffer(hwndValue, binValueData, valueDataLen);
         /* reset the hex edit control's font */
         }
         hwndValue = GetDlgItem(hwndDlg, IDC_VALUE_DATA);
         HexEdit_LoadBuffer(hwndValue, binValueData, valueDataLen);
         /* reset the hex edit control's font */
-        SendMessage(hwndValue, WM_SETFONT, 0, 0);
+        SendMessageW(hwndValue, WM_SETFONT, 0, 0);
         SetFocus(hwndValue);
         return FALSE;
     case WM_COMMAND:
         SetFocus(hwndValue);
         return FALSE;
     case WM_COMMAND:
@@ -433,9 +433,9 @@ INT_PTR CALLBACK modify_binary_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
 
 static BOOL CreateResourceColumns(HWND hwnd)
 {
 
 static BOOL CreateResourceColumns(HWND hwnd)
 {
-    TCHAR szText[80];
+    WCHAR szText[80];
     RECT rc;
     RECT rc;
-    LV_COLUMN lvC;
+    LVCOLUMN lvC;
     HWND hwndLV;
     INT width;
 
     HWND hwndLV;
     INT width;
 
@@ -451,13 +451,13 @@ static BOOL CreateResourceColumns(HWND hwnd)
     /* Load the column labels from the resource file. */
     lvC.iSubItem = 0;
     lvC.cx = (rc.right - rc.left) / 2;
     /* Load the column labels from the resource file. */
     lvC.iSubItem = 0;
     lvC.cx = (rc.right - rc.left) / 2;
-    LoadString(hInst, IDS_DMA_CHANNEL, szText, COUNT_OF(szText));
+    LoadStringW(hInst, IDS_DMA_CHANNEL, szText, COUNT_OF(szText));
     if (ListView_InsertColumn(hwndLV, 0, &lvC) == -1)
         return FALSE;
 
     lvC.iSubItem = 1;
     lvC.cx = (rc.right - rc.left) - lvC.cx;
     if (ListView_InsertColumn(hwndLV, 0, &lvC) == -1)
         return FALSE;
 
     lvC.iSubItem = 1;
     lvC.cx = (rc.right - rc.left) - lvC.cx;
-    LoadString(hInst, IDS_DMA_PORT, szText, COUNT_OF(szText));
+    LoadStringW(hInst, IDS_DMA_PORT, szText, COUNT_OF(szText));
     if (ListView_InsertColumn(hwndLV, 1, &lvC) == -1)
         return FALSE;
 
     if (ListView_InsertColumn(hwndLV, 1, &lvC) == -1)
         return FALSE;
 
@@ -471,23 +471,23 @@ static BOOL CreateResourceColumns(HWND hwnd)
     /* Load the column labels from the resource file. */
     lvC.iSubItem = 0;
     lvC.cx = width;
     /* Load the column labels from the resource file. */
     lvC.iSubItem = 0;
     lvC.cx = width;
-    LoadString(hInst, IDS_INTERRUPT_VECTOR, szText, COUNT_OF(szText));
+    LoadStringW(hInst, IDS_INTERRUPT_VECTOR, szText, COUNT_OF(szText));
     if (ListView_InsertColumn(hwndLV, 0, &lvC) == -1)
         return FALSE;
 
     lvC.iSubItem = 1;
     if (ListView_InsertColumn(hwndLV, 0, &lvC) == -1)
         return FALSE;
 
     lvC.iSubItem = 1;
-    LoadString(hInst, IDS_INTERRUPT_LEVEL, szText, COUNT_OF(szText));
+    LoadStringW(hInst, IDS_INTERRUPT_LEVEL, szText, COUNT_OF(szText));
     if (ListView_InsertColumn(hwndLV, 1, &lvC) == -1)
         return FALSE;
 
     lvC.iSubItem = 2;
     if (ListView_InsertColumn(hwndLV, 1, &lvC) == -1)
         return FALSE;
 
     lvC.iSubItem = 2;
-    LoadString(hInst, IDS_INTERRUPT_AFFINITY, szText, COUNT_OF(szText));
+    LoadStringW(hInst, IDS_INTERRUPT_AFFINITY, szText, COUNT_OF(szText));
     if (ListView_InsertColumn(hwndLV, 2, &lvC) == -1)
         return FALSE;
 
     lvC.iSubItem = 3;
     lvC.cx = (rc.right - rc.left) - 3 * width;
     if (ListView_InsertColumn(hwndLV, 2, &lvC) == -1)
         return FALSE;
 
     lvC.iSubItem = 3;
     lvC.cx = (rc.right - rc.left) - 3 * width;
-    LoadString(hInst, IDS_INTERRUPT_TYPE, szText, COUNT_OF(szText));
+    LoadStringW(hInst, IDS_INTERRUPT_TYPE, szText, COUNT_OF(szText));
     if (ListView_InsertColumn(hwndLV, 3, &lvC) == -1)
         return FALSE;
 
     if (ListView_InsertColumn(hwndLV, 3, &lvC) == -1)
         return FALSE;
 
@@ -501,18 +501,18 @@ static BOOL CreateResourceColumns(HWND hwnd)
     /* Load the column labels from the resource file. */
     lvC.iSubItem = 0;
     lvC.cx = width;
     /* Load the column labels from the resource file. */
     lvC.iSubItem = 0;
     lvC.cx = width;
-    LoadString(hInst, IDS_MEMORY_ADDRESS, szText, COUNT_OF(szText));
+    LoadStringW(hInst, IDS_MEMORY_ADDRESS, szText, COUNT_OF(szText));
     if (ListView_InsertColumn(hwndLV, 0, &lvC) == -1)
         return FALSE;
 
     lvC.iSubItem = 1;
     if (ListView_InsertColumn(hwndLV, 0, &lvC) == -1)
         return FALSE;
 
     lvC.iSubItem = 1;
-    LoadString(hInst, IDS_MEMORY_LENGTH, szText, COUNT_OF(szText));
+    LoadStringW(hInst, IDS_MEMORY_LENGTH, szText, COUNT_OF(szText));
     if (ListView_InsertColumn(hwndLV, 1, &lvC) == -1)
         return FALSE;
 
     lvC.iSubItem = 2;
     lvC.cx = (rc.right - rc.left) - 2 * width;
     if (ListView_InsertColumn(hwndLV, 1, &lvC) == -1)
         return FALSE;
 
     lvC.iSubItem = 2;
     lvC.cx = (rc.right - rc.left) - 2 * width;
-    LoadString(hInst, IDS_MEMORY_ACCESS, szText, COUNT_OF(szText));
+    LoadStringW(hInst, IDS_MEMORY_ACCESS, szText, COUNT_OF(szText));
     if (ListView_InsertColumn(hwndLV, 2, &lvC) == -1)
         return FALSE;
 
     if (ListView_InsertColumn(hwndLV, 2, &lvC) == -1)
         return FALSE;
 
@@ -526,18 +526,18 @@ static BOOL CreateResourceColumns(HWND hwnd)
     /* Load the column labels from the resource file. */
     lvC.iSubItem = 0;
     lvC.cx = width;
     /* Load the column labels from the resource file. */
     lvC.iSubItem = 0;
     lvC.cx = width;
-    LoadString(hInst, IDS_PORT_ADDRESS, szText, COUNT_OF(szText));
+    LoadStringW(hInst, IDS_PORT_ADDRESS, szText, COUNT_OF(szText));
     if (ListView_InsertColumn(hwndLV, 0, &lvC) == -1)
         return FALSE;
 
     lvC.iSubItem = 1;
     if (ListView_InsertColumn(hwndLV, 0, &lvC) == -1)
         return FALSE;
 
     lvC.iSubItem = 1;
-    LoadString(hInst, IDS_PORT_LENGTH, szText, COUNT_OF(szText));
+    LoadStringW(hInst, IDS_PORT_LENGTH, szText, COUNT_OF(szText));
     if (ListView_InsertColumn(hwndLV, 1, &lvC) == -1)
         return FALSE;
 
     lvC.iSubItem = 2;
     lvC.cx = (rc.right - rc.left) - 2 * width;
     if (ListView_InsertColumn(hwndLV, 1, &lvC) == -1)
         return FALSE;
 
     lvC.iSubItem = 2;
     lvC.cx = (rc.right - rc.left) - 2 * width;
-    LoadString(hInst, IDS_PORT_ACCESS, szText, COUNT_OF(szText));
+    LoadStringW(hInst, IDS_PORT_ACCESS, szText, COUNT_OF(szText));
     if (ListView_InsertColumn(hwndLV, 2, &lvC) == -1)
         return FALSE;
 
     if (ListView_InsertColumn(hwndLV, 2, &lvC) == -1)
         return FALSE;
 
@@ -550,18 +550,18 @@ static BOOL CreateResourceColumns(HWND hwnd)
     /* Load the column labels from the resource file. */
     lvC.iSubItem = 0;
     lvC.cx = width;
     /* Load the column labels from the resource file. */
     lvC.iSubItem = 0;
     lvC.cx = width;
-    LoadString(hInst, IDS_SPECIFIC_RESERVED1, szText, COUNT_OF(szText));
+    LoadStringW(hInst, IDS_SPECIFIC_RESERVED1, szText, COUNT_OF(szText));
     if (ListView_InsertColumn(hwndLV, 0, &lvC) == -1)
         return FALSE;
 
     lvC.iSubItem = 1;
     if (ListView_InsertColumn(hwndLV, 0, &lvC) == -1)
         return FALSE;
 
     lvC.iSubItem = 1;
-    LoadString(hInst, IDS_SPECIFIC_RESERVED2, szText, COUNT_OF(szText));
+    LoadStringW(hInst, IDS_SPECIFIC_RESERVED2, szText, COUNT_OF(szText));
     if (ListView_InsertColumn(hwndLV, 1, &lvC) == -1)
         return FALSE;
 
     lvC.iSubItem = 2;
     lvC.cx = (rc.right - rc.left) - 2 * width;
     if (ListView_InsertColumn(hwndLV, 1, &lvC) == -1)
         return FALSE;
 
     lvC.iSubItem = 2;
     lvC.cx = (rc.right - rc.left) - 2 * width;
-    LoadString(hInst, IDS_SPECIFIC_DATASIZE, szText, COUNT_OF(szText));
+    LoadStringW(hInst, IDS_SPECIFIC_DATASIZE, szText, COUNT_OF(szText));
     if (ListView_InsertColumn(hwndLV, 2, &lvC) == -1)
         return FALSE;
 
     if (ListView_InsertColumn(hwndLV, 2, &lvC) == -1)
         return FALSE;
 
@@ -570,88 +570,88 @@ static BOOL CreateResourceColumns(HWND hwnd)
 
 static VOID
 GetInterfaceType(INTERFACE_TYPE InterfaceType,
 
 static VOID
 GetInterfaceType(INTERFACE_TYPE InterfaceType,
-                 LPTSTR pBuffer,
+                 LPWSTR pBuffer,
                  DWORD dwLength)
 {
                  DWORD dwLength)
 {
-//    LPTSTR lpInterfaceType;
+//    LPWSTR lpInterfaceType;
 
     switch (InterfaceType)
     {
         case InterfaceTypeUndefined:
 
     switch (InterfaceType)
     {
         case InterfaceTypeUndefined:
-            LoadString(hInst, IDS_BUS_UNDEFINED, pBuffer, dwLength);
-//            lpInterfaceType = _T("Undefined");
+            LoadStringW(hInst, IDS_BUS_UNDEFINED, pBuffer, dwLength);
+//            lpInterfaceType = L"Undefined";
             break;
         case Internal:
             break;
         case Internal:
-            LoadString(hInst, IDS_BUS_INTERNAL, pBuffer, dwLength);
-//            lpInterfaceType = _T("Internal");
+            LoadStringW(hInst, IDS_BUS_INTERNAL, pBuffer, dwLength);
+//            lpInterfaceType = L"Internal";
             break;
         case Isa:
             break;
         case Isa:
-            LoadString(hInst, IDS_BUS_ISA, pBuffer, dwLength);
-//            lpInterfaceType = _T("Isa");
+            LoadStringW(hInst, IDS_BUS_ISA, pBuffer, dwLength);
+//            lpInterfaceType = L"Isa";
             break;
         case Eisa:
             break;
         case Eisa:
-            LoadString(hInst, IDS_BUS_EISA, pBuffer, dwLength);
-//            lpInterfaceType = _T("Eisa");
+            LoadStringW(hInst, IDS_BUS_EISA, pBuffer, dwLength);
+//            lpInterfaceType = L"Eisa";
             break;
         case MicroChannel:
             break;
         case MicroChannel:
-            LoadString(hInst, IDS_BUS_MICROCHANNEL, pBuffer, dwLength);
-//            lpInterfaceType = _T("MicroChannel");
+            LoadStringW(hInst, IDS_BUS_MICROCHANNEL, pBuffer, dwLength);
+//            lpInterfaceType = L"MicroChannel";
             break;
         case TurboChannel:
             break;
         case TurboChannel:
-            LoadString(hInst, IDS_BUS_TURBOCHANNEL, pBuffer, dwLength);
-//            lpInterfaceType = _T("TurboChannel");
+            LoadStringW(hInst, IDS_BUS_TURBOCHANNEL, pBuffer, dwLength);
+//            lpInterfaceType = L"TurboChannel";
             break;
         case PCIBus:
             break;
         case PCIBus:
-            LoadString(hInst, IDS_BUS_PCIBUS, pBuffer, dwLength);
-//            lpInterfaceType = _T("PCIBus");
+            LoadStringW(hInst, IDS_BUS_PCIBUS, pBuffer, dwLength);
+//            lpInterfaceType = L"PCIBus";
             break;
         case VMEBus:
             break;
         case VMEBus:
-            LoadString(hInst, IDS_BUS_VMEBUS, pBuffer, dwLength);
-//            lpInterfaceType = _T("VMEBus");
+            LoadStringW(hInst, IDS_BUS_VMEBUS, pBuffer, dwLength);
+//            lpInterfaceType = L"VMEBus";
             break;
         case NuBus:
             break;
         case NuBus:
-            LoadString(hInst, IDS_BUS_NUBUS, pBuffer, dwLength);
-//            lpInterfaceType = _T("NuBus");
+            LoadStringW(hInst, IDS_BUS_NUBUS, pBuffer, dwLength);
+//            lpInterfaceType = L"NuBus";
             break;
         case PCMCIABus:
             break;
         case PCMCIABus:
-            LoadString(hInst, IDS_BUS_PCMCIABUS, pBuffer, dwLength);
-//            lpInterfaceType = _T("PCMCIABus");
+            LoadStringW(hInst, IDS_BUS_PCMCIABUS, pBuffer, dwLength);
+//            lpInterfaceType = L"PCMCIABus";
             break;
         case CBus:
             break;
         case CBus:
-            LoadString(hInst, IDS_BUS_CBUS, pBuffer, dwLength);
-//            lpInterfaceType = _T("CBus");
+            LoadStringW(hInst, IDS_BUS_CBUS, pBuffer, dwLength);
+//            lpInterfaceType = L"CBus";
             break;
         case MPIBus:
             break;
         case MPIBus:
-            LoadString(hInst, IDS_BUS_MPIBUS, pBuffer, dwLength);
-//            lpInterfaceType = _T("MPIBus");
+            LoadStringW(hInst, IDS_BUS_MPIBUS, pBuffer, dwLength);
+//            lpInterfaceType = L"MPIBus";
             break;
         case MPSABus:
             break;
         case MPSABus:
-            LoadString(hInst, IDS_BUS_MPSABUS, pBuffer, dwLength);
-//            lpInterfaceType = _T("MPSABus");
+            LoadStringW(hInst, IDS_BUS_MPSABUS, pBuffer, dwLength);
+//            lpInterfaceType = L"MPSABus";
             break;
         case ProcessorInternal:
             break;
         case ProcessorInternal:
-            LoadString(hInst, IDS_BUS_PROCESSORINTERNAL, pBuffer, dwLength);
-//            lpInterfaceType = _T("ProcessorInternal");
+            LoadStringW(hInst, IDS_BUS_PROCESSORINTERNAL, pBuffer, dwLength);
+//            lpInterfaceType = L"ProcessorInternal";
             break;
         case InternalPowerBus:
             break;
         case InternalPowerBus:
-            LoadString(hInst, IDS_BUS_INTERNALPOWERBUS, pBuffer, dwLength);
-//            lpInterfaceType = _T("InternalPowerBus");
+            LoadStringW(hInst, IDS_BUS_INTERNALPOWERBUS, pBuffer, dwLength);
+//            lpInterfaceType = L"InternalPowerBus";
             break;
         case PNPISABus:
             break;
         case PNPISABus:
-            LoadString(hInst, IDS_BUS_PNPISABUS, pBuffer, dwLength);
-//            lpInterfaceType = _T("PNPISABus");
+            LoadStringW(hInst, IDS_BUS_PNPISABUS, pBuffer, dwLength);
+//            lpInterfaceType = L"PNPISABus";
             break;
         case PNPBus:
             break;
         case PNPBus:
-            LoadString(hInst, IDS_BUS_PNPBUS, pBuffer, dwLength);
-//            lpInterfaceType = _T("PNPBus");
+            LoadStringW(hInst, IDS_BUS_PNPBUS, pBuffer, dwLength);
+//            lpInterfaceType = L"PNPBus";
             break;
         default:
             break;
         default:
-            LoadString(hInst, IDS_BUS_UNKNOWNTYPE, pBuffer, dwLength);
-//            lpInterfaceType = _T("Unknown interface type");
+            LoadStringW(hInst, IDS_BUS_UNKNOWNTYPE, pBuffer, dwLength);
+//            lpInterfaceType = L"Unknown interface type";
             break;
     }
 
             break;
     }
 
-//    _tcscpy(pBuffer, lpInterfaceType);
+//    wcscpy(pBuffer, lpInterfaceType);
 }
 
 
 }
 
 
@@ -664,7 +664,7 @@ ParseResources(HWND hwnd)
     ULONG i;
     HWND hwndLV;
 
     ULONG i;
     HWND hwndLV;
 
-    TCHAR buffer[80];
+    WCHAR buffer[80];
     LVITEM item;
     INT iItem;
 
     LVITEM item;
     INT iItem;
 
@@ -673,7 +673,7 @@ ParseResources(HWND hwnd)
 
     /* Interface type */
     GetInterfaceType(pFullDescriptor->InterfaceType, buffer, 80);
 
     /* Interface type */
     GetInterfaceType(pFullDescriptor->InterfaceType, buffer, 80);
-    SetDlgItemText(hwnd, IDC_INTERFACETYPE, buffer);
+    SetDlgItemTextW(hwnd, IDC_INTERFACETYPE, buffer);
 
     /* Busnumber */
     SetDlgItemInt(hwnd, IDC_BUSNUMBER, (UINT)pFullDescriptor->BusNumber, FALSE);
 
     /* Busnumber */
     SetDlgItemInt(hwnd, IDC_BUSNUMBER, (UINT)pFullDescriptor->BusNumber, FALSE);
@@ -694,9 +694,9 @@ ParseResources(HWND hwnd)
                 hwndLV = GetDlgItem(hwnd, IDC_PORT_LIST);
 
 #ifdef _M_AMD64
                 hwndLV = GetDlgItem(hwnd, IDC_PORT_LIST);
 
 #ifdef _M_AMD64
-                wsprintf(buffer, _T("0x%16I64x"), pDescriptor->u.Port.Start.QuadPart);
+                wsprintf(buffer, L"0x%16I64x", pDescriptor->u.Port.Start.QuadPart);
 #else
 #else
-                wsprintf(buffer, _T("0x%08lx"), pDescriptor->u.Port.Start.u.LowPart);
+                wsprintf(buffer, L"0x%08lx", pDescriptor->u.Port.Start.u.LowPart);
 #endif
 
                 item.mask = LVIF_TEXT | LVIF_PARAM;
 #endif
 
                 item.mask = LVIF_TEXT | LVIF_PARAM;
@@ -705,19 +705,19 @@ ParseResources(HWND hwnd)
                 item.state = 0;
                 item.stateMask = 0;
                 item.pszText = buffer;
                 item.state = 0;
                 item.stateMask = 0;
                 item.pszText = buffer;
-                item.cchTextMax = (int)_tcslen(item.pszText);
+                item.cchTextMax = (int)wcslen(item.pszText);
                 item.lParam = (LPARAM)pDescriptor;
 
                 iItem = ListView_InsertItem(hwndLV, &item);
                 if (iItem != -1)
                 {
                 item.lParam = (LPARAM)pDescriptor;
 
                 iItem = ListView_InsertItem(hwndLV, &item);
                 if (iItem != -1)
                 {
-                    wsprintf(buffer, _T("0x%lx"), pDescriptor->u.Port.Length);
+                    wsprintf(buffer, L"0x%lx", pDescriptor->u.Port.Length);
                     ListView_SetItemText(hwndLV, iItem, 1, buffer);
 
                     if (pDescriptor->Flags & CM_RESOURCE_PORT_IO)
                     ListView_SetItemText(hwndLV, iItem, 1, buffer);
 
                     if (pDescriptor->Flags & CM_RESOURCE_PORT_IO)
-                        LoadString(hInst, IDS_PORT_PORT_IO, buffer, COUNT_OF(buffer));
+                        LoadStringW(hInst, IDS_PORT_PORT_IO, buffer, COUNT_OF(buffer));
                     else
                     else
-                        LoadString(hInst, IDS_PORT_MEMORY_IO, buffer, COUNT_OF(buffer));
+                        LoadStringW(hInst, IDS_PORT_MEMORY_IO, buffer, COUNT_OF(buffer));
                     ListView_SetItemText(hwndLV, iItem, 2, buffer);
                 }
                 break;
                     ListView_SetItemText(hwndLV, iItem, 2, buffer);
                 }
                 break;
@@ -725,7 +725,7 @@ ParseResources(HWND hwnd)
             case CmResourceTypeInterrupt:
                 hwndLV = GetDlgItem(hwnd, IDC_IRQ_LIST);
 
             case CmResourceTypeInterrupt:
                 hwndLV = GetDlgItem(hwnd, IDC_IRQ_LIST);
 
-                wsprintf(buffer, _T("%lu"), pDescriptor->u.Interrupt.Vector);
+                wsprintf(buffer, L"%lu", pDescriptor->u.Interrupt.Vector);
 
                 item.mask = LVIF_TEXT | LVIF_PARAM;
                 item.iItem = 1000;
 
                 item.mask = LVIF_TEXT | LVIF_PARAM;
                 item.iItem = 1000;
@@ -733,22 +733,22 @@ ParseResources(HWND hwnd)
                 item.state = 0;
                 item.stateMask = 0;
                 item.pszText = buffer;
                 item.state = 0;
                 item.stateMask = 0;
                 item.pszText = buffer;
-                item.cchTextMax = (int)_tcslen(item.pszText);
+                item.cchTextMax = (int)wcslen(item.pszText);
                 item.lParam = (LPARAM)pDescriptor;
 
                 iItem = ListView_InsertItem(hwndLV, &item);
                 if (iItem != -1)
                 {
                 item.lParam = (LPARAM)pDescriptor;
 
                 iItem = ListView_InsertItem(hwndLV, &item);
                 if (iItem != -1)
                 {
-                    wsprintf(buffer, _T("%lu"), pDescriptor->u.Interrupt.Level);
+                    wsprintf(buffer, L"%lu", pDescriptor->u.Interrupt.Level);
                     ListView_SetItemText(hwndLV, iItem, 1, buffer);
 
                     ListView_SetItemText(hwndLV, iItem, 1, buffer);
 
-                    wsprintf(buffer, _T("0x%08lx"), pDescriptor->u.Interrupt.Affinity);
+                    wsprintf(buffer, L"0x%08lx", pDescriptor->u.Interrupt.Affinity);
                     ListView_SetItemText(hwndLV, iItem, 2, buffer);
 
                     if (pDescriptor->Flags & CM_RESOURCE_INTERRUPT_LATCHED)
                     ListView_SetItemText(hwndLV, iItem, 2, buffer);
 
                     if (pDescriptor->Flags & CM_RESOURCE_INTERRUPT_LATCHED)
-                        LoadString(hInst, IDS_INTERRUPT_EDGE_SENSITIVE, buffer, COUNT_OF(buffer));
+                        LoadStringW(hInst, IDS_INTERRUPT_EDGE_SENSITIVE, buffer, COUNT_OF(buffer));
                     else
                     else
-                        LoadString(hInst, IDS_INTERRUPT_LEVEL_SENSITIVE, buffer, COUNT_OF(buffer));
+                        LoadStringW(hInst, IDS_INTERRUPT_LEVEL_SENSITIVE, buffer, COUNT_OF(buffer));
 
                     ListView_SetItemText(hwndLV, iItem, 3, buffer);
                 }
 
                     ListView_SetItemText(hwndLV, iItem, 3, buffer);
                 }
@@ -758,9 +758,9 @@ ParseResources(HWND hwnd)
                 hwndLV = GetDlgItem(hwnd, IDC_MEMORY_LIST);
 
 #ifdef _M_AMD64
                 hwndLV = GetDlgItem(hwnd, IDC_MEMORY_LIST);
 
 #ifdef _M_AMD64
-                wsprintf(buffer, _T("0x%16I64x"), pDescriptor->u.Memory.Start.QuadPart);
+                wsprintf(buffer, L"0x%16I64x", pDescriptor->u.Memory.Start.QuadPart);
 #else
 #else
-                wsprintf(buffer, _T("0x%08lx"), pDescriptor->u.Memory.Start.u.LowPart);
+                wsprintf(buffer, L"0x%08lx", pDescriptor->u.Memory.Start.u.LowPart);
 #endif
 
                 item.mask = LVIF_TEXT | LVIF_PARAM;
 #endif
 
                 item.mask = LVIF_TEXT | LVIF_PARAM;
@@ -769,27 +769,27 @@ ParseResources(HWND hwnd)
                 item.state = 0;
                 item.stateMask = 0;
                 item.pszText = buffer;
                 item.state = 0;
                 item.stateMask = 0;
                 item.pszText = buffer;
-                item.cchTextMax = (int)_tcslen(item.pszText);
+                item.cchTextMax = (int)wcslen(item.pszText);
                 item.lParam = (LPARAM)pDescriptor;
 
                 iItem = ListView_InsertItem(hwndLV, &item);
                 if (iItem != -1)
                 {
                 item.lParam = (LPARAM)pDescriptor;
 
                 iItem = ListView_InsertItem(hwndLV, &item);
                 if (iItem != -1)
                 {
-                    wsprintf(buffer, _T("0x%lx"), pDescriptor->u.Memory.Length);
+                    wsprintf(buffer, L"0x%lx", pDescriptor->u.Memory.Length);
                     ListView_SetItemText(hwndLV, iItem, 1, buffer);
 
                     switch (pDescriptor->Flags & (CM_RESOURCE_MEMORY_READ_ONLY | CM_RESOURCE_MEMORY_WRITE_ONLY))
                     {
                         case CM_RESOURCE_MEMORY_READ_ONLY:
                     ListView_SetItemText(hwndLV, iItem, 1, buffer);
 
                     switch (pDescriptor->Flags & (CM_RESOURCE_MEMORY_READ_ONLY | CM_RESOURCE_MEMORY_WRITE_ONLY))
                     {
                         case CM_RESOURCE_MEMORY_READ_ONLY:
-                            LoadString(hInst, IDS_MEMORY_READ_ONLY, buffer, COUNT_OF(buffer));
+                            LoadStringW(hInst, IDS_MEMORY_READ_ONLY, buffer, COUNT_OF(buffer));
                             break;
 
                         case CM_RESOURCE_MEMORY_WRITE_ONLY:
                             break;
 
                         case CM_RESOURCE_MEMORY_WRITE_ONLY:
-                            LoadString(hInst, IDS_MEMORY_WRITE_ONLY, buffer, COUNT_OF(buffer));
+                            LoadStringW(hInst, IDS_MEMORY_WRITE_ONLY, buffer, COUNT_OF(buffer));
                             break;
 
                         default:
                             break;
 
                         default:
-                            LoadString(hInst, IDS_MEMORY_READ_WRITE, buffer, COUNT_OF(buffer));
+                            LoadStringW(hInst, IDS_MEMORY_READ_WRITE, buffer, COUNT_OF(buffer));
                             break;
                     }
 
                             break;
                     }
 
@@ -800,7 +800,7 @@ ParseResources(HWND hwnd)
             case CmResourceTypeDma:
                 hwndLV = GetDlgItem(hwnd, IDC_DMA_LIST);
 
             case CmResourceTypeDma:
                 hwndLV = GetDlgItem(hwnd, IDC_DMA_LIST);
 
-                wsprintf(buffer, _T("%lu"), pDescriptor->u.Dma.Channel);
+                wsprintf(buffer, L"%lu", pDescriptor->u.Dma.Channel);
 
                 item.mask = LVIF_TEXT | LVIF_PARAM;
                 item.iItem = 1000;
 
                 item.mask = LVIF_TEXT | LVIF_PARAM;
                 item.iItem = 1000;
@@ -808,13 +808,13 @@ ParseResources(HWND hwnd)
                 item.state = 0;
                 item.stateMask = 0;
                 item.pszText = buffer;
                 item.state = 0;
                 item.stateMask = 0;
                 item.pszText = buffer;
-                item.cchTextMax = (int)_tcslen(item.pszText);
+                item.cchTextMax = (int)wcslen(item.pszText);
                 item.lParam = (LPARAM)pDescriptor;
 
                 iItem = ListView_InsertItem(hwndLV, &item);
                 if (iItem != -1)
                 {
                 item.lParam = (LPARAM)pDescriptor;
 
                 iItem = ListView_InsertItem(hwndLV, &item);
                 if (iItem != -1)
                 {
-                    wsprintf(buffer, _T("%lu"), pDescriptor->u.Dma.Port);
+                    wsprintf(buffer, L"%lu", pDescriptor->u.Dma.Port);
                     ListView_SetItemText(hwndLV, iItem, 1, buffer);
                 }
                 break;
                     ListView_SetItemText(hwndLV, iItem, 1, buffer);
                 }
                 break;
@@ -822,7 +822,7 @@ ParseResources(HWND hwnd)
             case CmResourceTypeDeviceSpecific:
                 hwndLV = GetDlgItem(hwnd, IDC_DEVICE_LIST);
 
             case CmResourceTypeDeviceSpecific:
                 hwndLV = GetDlgItem(hwnd, IDC_DEVICE_LIST);
 
-                wsprintf(buffer, _T("0x%08lx"), pDescriptor->u.DeviceSpecificData.Reserved1);
+                wsprintf(buffer, L"0x%08lx", pDescriptor->u.DeviceSpecificData.Reserved1);
 
                 item.mask = LVIF_TEXT | LVIF_PARAM;
                 item.iItem = 1000;
 
                 item.mask = LVIF_TEXT | LVIF_PARAM;
                 item.iItem = 1000;
@@ -830,16 +830,16 @@ ParseResources(HWND hwnd)
                 item.state = 0;
                 item.stateMask = 0;
                 item.pszText = buffer;
                 item.state = 0;
                 item.stateMask = 0;
                 item.pszText = buffer;
-                item.cchTextMax = (int)_tcslen(item.pszText);
+                item.cchTextMax = (int)wcslen(item.pszText);
                 item.lParam = (LPARAM)pDescriptor;
 
                 iItem = ListView_InsertItem(hwndLV, &item);
                 if (iItem != -1)
                 {
                 item.lParam = (LPARAM)pDescriptor;
 
                 iItem = ListView_InsertItem(hwndLV, &item);
                 if (iItem != -1)
                 {
-                    wsprintf(buffer, _T("0x%08lx"), pDescriptor->u.DeviceSpecificData.Reserved2);
+                    wsprintf(buffer, L"0x%08lx", pDescriptor->u.DeviceSpecificData.Reserved2);
                     ListView_SetItemText(hwndLV, iItem, 1, buffer);
 
                     ListView_SetItemText(hwndLV, iItem, 1, buffer);
 
-                    wsprintf(buffer, _T("0x%lx"), pDescriptor->u.DeviceSpecificData.DataSize);
+                    wsprintf(buffer, L"0x%lx", pDescriptor->u.DeviceSpecificData.DataSize);
                     ListView_SetItemText(hwndLV, iItem, 2, buffer);
                 }
                 break;
                     ListView_SetItemText(hwndLV, iItem, 2, buffer);
                 }
                 break;
@@ -935,9 +935,9 @@ static INT_PTR CALLBACK modify_resource_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM
 
 static BOOL CreateResourceListColumns(HWND hWndListView)
 {
 
 static BOOL CreateResourceListColumns(HWND hWndListView)
 {
-    TCHAR szText[80];
+    WCHAR szText[80];
     RECT rc;
     RECT rc;
-    LV_COLUMN lvC;
+    LVCOLUMN lvC;
 
     ListView_SetExtendedListViewStyle(hWndListView, LVS_EX_FULLROWSELECT);
 
 
     ListView_SetExtendedListViewStyle(hWndListView, LVS_EX_FULLROWSELECT);
 
@@ -951,13 +951,13 @@ static BOOL CreateResourceListColumns(HWND hWndListView)
     /* Load the column labels from the resource file. */
     lvC.iSubItem = 0;
     lvC.cx = (rc.right - rc.left) / 2;
     /* Load the column labels from the resource file. */
     lvC.iSubItem = 0;
     lvC.cx = (rc.right - rc.left) / 2;
-    LoadString(hInst, IDS_BUSNUMBER, szText, COUNT_OF(szText));
+    LoadStringW(hInst, IDS_BUSNUMBER, szText, COUNT_OF(szText));
     if (ListView_InsertColumn(hWndListView, 0, &lvC) == -1)
         return FALSE;
 
     lvC.iSubItem = 1;
     lvC.cx = (rc.right - rc.left) - lvC.cx;
     if (ListView_InsertColumn(hWndListView, 0, &lvC) == -1)
         return FALSE;
 
     lvC.iSubItem = 1;
     lvC.cx = (rc.right - rc.left) - lvC.cx;
-    LoadString(hInst, IDS_INTERFACE, szText, COUNT_OF(szText));
+    LoadStringW(hInst, IDS_INTERFACE, szText, COUNT_OF(szText));
     if (ListView_InsertColumn(hWndListView, 1, &lvC) == -1)
         return FALSE;
 
     if (ListView_InsertColumn(hWndListView, 1, &lvC) == -1)
         return FALSE;
 
@@ -967,7 +967,7 @@ static BOOL CreateResourceListColumns(HWND hWndListView)
 static VOID AddFullResourcesToList(HWND hwnd)
 {
     PCM_FULL_RESOURCE_DESCRIPTOR pFullDescriptor;
 static VOID AddFullResourcesToList(HWND hwnd)
 {
     PCM_FULL_RESOURCE_DESCRIPTOR pFullDescriptor;
-    TCHAR buffer[80];
+    WCHAR buffer[80];
     LVITEM item;
     ULONG i;
     INT iItem;
     LVITEM item;
     ULONG i;
     INT iItem;
@@ -976,7 +976,7 @@ static VOID AddFullResourcesToList(HWND hwnd)
     {
         pFullDescriptor = &resourceValueData->List[i];
 
     {
         pFullDescriptor = &resourceValueData->List[i];
 
-        wsprintf(buffer, _T("%lu"), pFullDescriptor->BusNumber);
+        wsprintf(buffer, L"%lu", pFullDescriptor->BusNumber);
 
         item.mask = LVIF_TEXT;
         item.iItem = i;
 
         item.mask = LVIF_TEXT;
         item.iItem = i;
@@ -984,7 +984,7 @@ static VOID AddFullResourcesToList(HWND hwnd)
         item.state = 0;
         item.stateMask = 0;
         item.pszText = buffer;
         item.state = 0;
         item.stateMask = 0;
         item.pszText = buffer;
-        item.cchTextMax = (int)_tcslen(item.pszText);
+        item.cchTextMax = (int)wcslen(item.pszText);
 
         iItem = ListView_InsertItem(hwnd, &item);
         if (iItem != -1)
 
         iItem = ListView_InsertItem(hwnd, &item);
         if (iItem != -1)
@@ -1014,7 +1014,7 @@ OnResourceListNotify(HWND hwndDlg, NMHDR *phdr)
                     if (lpnmlv->iItem != -1)
                     {
                         fullResourceIndex = lpnmlv->iItem;
                     if (lpnmlv->iItem != -1)
                     {
                         fullResourceIndex = lpnmlv->iItem;
-                        DialogBox(0, MAKEINTRESOURCE(IDD_EDIT_RESOURCE), hwndDlg, modify_resource_dlgproc);
+                        DialogBoxW(0, MAKEINTRESOURCEW(IDD_EDIT_RESOURCE), hwndDlg, modify_resource_dlgproc);
                     }
                     break;
             }
                     }
                     break;
             }
@@ -1044,7 +1044,7 @@ static INT_PTR CALLBACK modify_resource_list_dlgproc(HWND hwndDlg, UINT uMsg, WP
         {
         case IDC_SHOW_RESOURCE:
             if (fullResourceIndex != -1)
         {
         case IDC_SHOW_RESOURCE:
             if (fullResourceIndex != -1)
-                DialogBox(0, MAKEINTRESOURCE(IDD_EDIT_RESOURCE), hwndDlg, modify_resource_dlgproc);
+                DialogBoxW(0, MAKEINTRESOURCEW(IDD_EDIT_RESOURCE), hwndDlg, modify_resource_dlgproc);
             break;
         case IDOK:
             EndDialog(hwndDlg, IDOK);
             break;
         case IDOK:
             EndDialog(hwndDlg, IDOK);
@@ -1058,7 +1058,7 @@ static INT_PTR CALLBACK modify_resource_list_dlgproc(HWND hwndDlg, UINT uMsg, WP
 }
 
 
 }
 
 
-BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName, BOOL EditBin)
+BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCWSTR valueName, BOOL EditBin)
 {
     DWORD type;
     LONG lRet;
 {
     DWORD type;
     LONG lRet;
@@ -1069,8 +1069,8 @@ BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName, BOOL EditBin)
 
     editValueName = valueName;
 
 
     editValueName = valueName;
 
-    lRet = RegQueryValueEx(hKey, valueName, 0, &type, 0, &valueDataLen);
-    if (lRet != ERROR_SUCCESS && (!_tcscmp(valueName, _T("")) || valueName == NULL))
+    lRet = RegQueryValueExW(hKey, valueName, 0, &type, 0, &valueDataLen);
+    if (lRet != ERROR_SUCCESS && (!wcscmp(valueName, L"") || valueName == NULL))
     {
         lRet = ERROR_SUCCESS; /* Allow editing of (Default) values which don't exist */
         type = REG_SZ;
     {
         lRet = ERROR_SUCCESS; /* Allow editing of (Default) values which don't exist */
         type = REG_SZ;
@@ -1094,7 +1094,7 @@ BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName, BOOL EditBin)
                 error(hwnd, IDS_TOO_BIG_VALUE, valueDataLen);
                 goto done;
             }
                 error(hwnd, IDS_TOO_BIG_VALUE, valueDataLen);
                 goto done;
             }
-            lRet = RegQueryValueEx(hKey, valueName, 0, 0, (LPBYTE)stringValueData, &valueDataLen);
+            lRet = RegQueryValueExW(hKey, valueName, 0, 0, (LPBYTE)stringValueData, &valueDataLen);
             if (lRet != ERROR_SUCCESS)
             {
                 error(hwnd, IDS_BAD_VALUE, valueName);
             if (lRet != ERROR_SUCCESS)
             {
                 error(hwnd, IDS_BAD_VALUE, valueName);
@@ -1106,15 +1106,15 @@ BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName, BOOL EditBin)
             stringValueData = NULL;
         }
 
             stringValueData = NULL;
         }
 
-        if (DialogBox(0, MAKEINTRESOURCE(IDD_EDIT_STRING), hwnd, modify_string_dlgproc) == IDOK)
+        if (DialogBoxW(0, MAKEINTRESOURCEW(IDD_EDIT_STRING), hwnd, modify_string_dlgproc) == IDOK)
         {
             if (stringValueData)
             {
         {
             if (stringValueData)
             {
-                lRet = RegSetValueEx(hKey, valueName, 0, type, (LPBYTE)stringValueData, (DWORD) (_tcslen(stringValueData) + 1) * sizeof(TCHAR));
+                lRet = RegSetValueExW(hKey, valueName, 0, type, (LPBYTE)stringValueData, (DWORD) (wcslen(stringValueData) + 1) * sizeof(WCHAR));
             }
             else
             {
             }
             else
             {
-                lRet = RegSetValueEx(hKey, valueName, 0, type, NULL, 0);
+                lRet = RegSetValueExW(hKey, valueName, 0, type, NULL, 0);
             }
             if (lRet == ERROR_SUCCESS)
                 result = TRUE;
             }
             if (lRet == ERROR_SUCCESS)
                 result = TRUE;
@@ -1125,14 +1125,14 @@ BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName, BOOL EditBin)
         if (valueDataLen > 0)
         {
             size_t llen, listlen, nl_len;
         if (valueDataLen > 0)
         {
             size_t llen, listlen, nl_len;
-            LPTSTR src, lines = NULL;
+            LPWSTR src, lines = NULL;
 
 
-            if (!(stringValueData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, valueDataLen + sizeof(TCHAR))))
+            if (!(stringValueData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, valueDataLen + sizeof(WCHAR))))
             {
                 error(hwnd, IDS_TOO_BIG_VALUE, valueDataLen);
                 goto done;
             }
             {
                 error(hwnd, IDS_TOO_BIG_VALUE, valueDataLen);
                 goto done;
             }
-            lRet = RegQueryValueEx(hKey, valueName, 0, 0, (LPBYTE)stringValueData, &valueDataLen);
+            lRet = RegQueryValueExW(hKey, valueName, 0, 0, (LPBYTE)stringValueData, &valueDataLen);
             if (lRet != ERROR_SUCCESS)
             {
                 error(hwnd, IDS_BAD_VALUE, valueName);
             if (lRet != ERROR_SUCCESS)
             {
                 error(hwnd, IDS_BAD_VALUE, valueName);
@@ -1141,18 +1141,18 @@ BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName, BOOL EditBin)
 
             /* convert \0 to \r\n */
             src = stringValueData;
 
             /* convert \0 to \r\n */
             src = stringValueData;
-            nl_len = _tcslen(_T("\r\n")) * sizeof(TCHAR);
-            listlen = sizeof(TCHAR);
-            lines = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, listlen + sizeof(TCHAR));
-            while(*src != _T('\0'))
+            nl_len = wcslen(L"\r\n") * sizeof(WCHAR);
+            listlen = sizeof(WCHAR);
+            lines = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, listlen + sizeof(WCHAR));
+            while(*src != L'\0')
             {
             {
-                llen = _tcslen(src);
+                llen = wcslen(src);
                 if(llen == 0)
                     break;
                 if(llen == 0)
                     break;
-                listlen += (llen * sizeof(TCHAR)) + nl_len;
+                listlen += (llen * sizeof(WCHAR)) + nl_len;
                 lines = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, lines, listlen);
                 lines = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, lines, listlen);
-                _tcscat(lines, src);
-                _tcscat(lines, _T("\r\n"));
+                wcscat(lines, src);
+                wcscat(lines, L"\r\n");
                 src += llen + 1;
             }
             HeapFree(GetProcessHeap(), 0, stringValueData);
                 src += llen + 1;
             }
             HeapFree(GetProcessHeap(), 0, stringValueData);
@@ -1163,23 +1163,23 @@ BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName, BOOL EditBin)
             stringValueData = NULL;
         }
 
             stringValueData = NULL;
         }
 
-        if (DialogBox(0, MAKEINTRESOURCE(IDD_EDIT_MULTI_STRING), hwnd, modify_multi_string_dlgproc) == IDOK)
+        if (DialogBoxW(0, MAKEINTRESOURCEW(IDD_EDIT_MULTI_STRING), hwnd, modify_multi_string_dlgproc) == IDOK)
         {
             if (stringValueData)
             {
                 /* convert \r\n to \0 */
                 BOOL EmptyLines = FALSE;
         {
             if (stringValueData)
             {
                 /* convert \r\n to \0 */
                 BOOL EmptyLines = FALSE;
-                LPTSTR src, lines, nl;
+                LPWSTR src, lines, nl;
                 size_t linechars, buflen, c_nl, dest;
 
                 src = stringValueData;
                 size_t linechars, buflen, c_nl, dest;
 
                 src = stringValueData;
-                buflen = sizeof(TCHAR);
-                lines = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, buflen + sizeof(TCHAR));
-                c_nl = _tcslen(_T("\r\n"));
+                buflen = sizeof(WCHAR);
+                lines = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, buflen + sizeof(WCHAR));
+                c_nl = wcslen(L"\r\n");
                 dest = 0;
                 dest = 0;
-                while(*src != _T('\0'))
+                while(*src != L'\0')
                 {
                 {
-                    if((nl = _tcsstr(src, _T("\r\n"))))
+                    if((nl = wcsstr(src, L"\r\n")))
                     {
                         linechars = nl - src;
                         if(nl == src)
                     {
                         linechars = nl - src;
                         if(nl == src)
@@ -1191,15 +1191,15 @@ BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName, BOOL EditBin)
                     }
                     else
                     {
                     }
                     else
                     {
-                        linechars = _tcslen(src);
+                        linechars = wcslen(src);
                     }
                     if(linechars > 0)
                     {
                     }
                     if(linechars > 0)
                     {
-                        buflen += ((linechars + 1) * sizeof(TCHAR));
+                        buflen += ((linechars + 1) * sizeof(WCHAR));
                         lines = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, lines, buflen);
                         lines = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, lines, buflen);
-                        memcpy((lines + dest), src, linechars * sizeof(TCHAR));
+                        memcpy((lines + dest), src, linechars * sizeof(WCHAR));
                         dest += linechars;
                         dest += linechars;
-                        lines[dest++] = _T('\0');
+                        lines[dest++] = L'\0';
                     }
                     else
                     {
                     }
                     else
                     {
@@ -1207,19 +1207,19 @@ BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName, BOOL EditBin)
                     }
                     src += linechars + (nl != NULL ? c_nl : 0);
                 }
                     }
                     src += linechars + (nl != NULL ? c_nl : 0);
                 }
-                lines[++dest] = _T('\0');
+                lines[++dest] = L'\0';
 
                 if(EmptyLines)
                 {
                     warning(hwnd, IDS_MULTI_SZ_EMPTY_STRING);
                 }
 
 
                 if(EmptyLines)
                 {
                     warning(hwnd, IDS_MULTI_SZ_EMPTY_STRING);
                 }
 
-                lRet = RegSetValueEx(hKey, valueName, 0, type, (LPBYTE)lines, (DWORD) buflen);
+                lRet = RegSetValueExW(hKey, valueName, 0, type, (LPBYTE)lines, (DWORD) buflen);
                 HeapFree(GetProcessHeap(), 0, lines);
             }
             else
             {
                 HeapFree(GetProcessHeap(), 0, lines);
             }
             else
             {
-                lRet = RegSetValueEx(hKey, valueName, 0, type, NULL, 0);
+                lRet = RegSetValueExW(hKey, valueName, 0, type, NULL, 0);
             }
             if (lRet == ERROR_SUCCESS)
                 result = TRUE;
             }
             if (lRet == ERROR_SUCCESS)
                 result = TRUE;
@@ -1227,16 +1227,16 @@ BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName, BOOL EditBin)
     }
     else if (EditBin == FALSE && type == REG_DWORD)
     {
     }
     else if (EditBin == FALSE && type == REG_DWORD)
     {
-        lRet = RegQueryValueEx(hKey, valueName, 0, 0, (LPBYTE)&dwordValueData, &valueDataLen);
+        lRet = RegQueryValueExW(hKey, valueName, 0, 0, (LPBYTE)&dwordValueData, &valueDataLen);
         if (lRet != ERROR_SUCCESS)
         {
             error(hwnd, IDS_BAD_VALUE, valueName);
             goto done;
         }
 
         if (lRet != ERROR_SUCCESS)
         {
             error(hwnd, IDS_BAD_VALUE, valueName);
             goto done;
         }
 
-        if (DialogBox(0, MAKEINTRESOURCE(IDD_EDIT_DWORD), hwnd, modify_dword_dlgproc) == IDOK)
+        if (DialogBoxW(0, MAKEINTRESOURCEW(IDD_EDIT_DWORD), hwnd, modify_dword_dlgproc) == IDOK)
         {
         {
-            lRet = RegSetValueEx(hKey, valueName, 0, type, (LPBYTE)&dwordValueData, sizeof(DWORD));
+            lRet = RegSetValueExW(hKey, valueName, 0, type, (LPBYTE)&dwordValueData, sizeof(DWORD));
             if (lRet == ERROR_SUCCESS)
                 result = TRUE;
         }
             if (lRet == ERROR_SUCCESS)
                 result = TRUE;
         }
@@ -1252,7 +1252,7 @@ BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName, BOOL EditBin)
                 goto done;
             }
 
                 goto done;
             }
 
-            lRet = RegQueryValueEx(hKey, valueName, 0, 0, (LPBYTE)resourceValueData, &valueDataLen);
+            lRet = RegQueryValueExW(hKey, valueName, 0, 0, (LPBYTE)resourceValueData, &valueDataLen);
             if (lRet != ERROR_SUCCESS)
             {
                 error(hwnd, IDS_BAD_VALUE, valueName);
             if (lRet != ERROR_SUCCESS)
             {
                 error(hwnd, IDS_BAD_VALUE, valueName);
@@ -1264,30 +1264,12 @@ BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName, BOOL EditBin)
             resourceValueData = NULL;
         }
 
             resourceValueData = NULL;
         }
 
-        if (DialogBox(0, MAKEINTRESOURCE(IDD_EDIT_RESOURCE_LIST), hwnd, modify_resource_list_dlgproc) == IDOK)
+        if (DialogBoxW(0, MAKEINTRESOURCEW(IDD_EDIT_RESOURCE_LIST), hwnd, modify_resource_list_dlgproc) == IDOK)
         {
         }
     }
     else if (EditBin == TRUE || type == REG_NONE || type == REG_BINARY)
     {
         {
         }
     }
     else if (EditBin == TRUE || type == REG_NONE || type == REG_BINARY)
     {
-#ifndef UNICODE
-        LPWSTR u_valuename;
-        int len_vname = lstrlen(valueName);
-
-        if(len_vname > 0)
-        {
-            if(!(u_valuename = HeapAlloc(GetProcessHeap(), 0, (len_vname + 1) * sizeof(WCHAR))))
-            {
-                error(hwnd, IDS_TOO_BIG_VALUE, len_vname);
-                goto done;
-            }
-            /* convert the ansi value name to an unicode string */
-            MultiByteToWideChar(CP_ACP, 0, valueName, -1, u_valuename, len_vname + 1);
-            valueDataLen *= sizeof(WCHAR);
-        }
-        else
-            u_valuename = L"";
-#endif
         if(valueDataLen > 0)
         {
             if(!(binValueData = HeapAlloc(GetProcessHeap(), 0, valueDataLen + 1)))
         if(valueDataLen > 0)
         {
             if(!(binValueData = HeapAlloc(GetProcessHeap(), 0, valueDataLen + 1)))
@@ -1296,21 +1278,12 @@ BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName, BOOL EditBin)
                 goto done;
             }
 
                 goto done;
             }
 
-            /* force to use the unicode version, so editing strings in binary mode is correct */
-            lRet = RegQueryValueExW(hKey,
-#ifndef UNICODE
-                                    u_valuename,
-#else
-                                    valueName,
-#endif
+            /* Use the unicode version, so editing strings in binary mode is correct */
+            lRet = RegQueryValueExW(hKey, valueName,
                                     0, 0, (LPBYTE)binValueData, &valueDataLen);
             if (lRet != ERROR_SUCCESS)
             {
                 HeapFree(GetProcessHeap(), 0, binValueData);
                                     0, 0, (LPBYTE)binValueData, &valueDataLen);
             if (lRet != ERROR_SUCCESS)
             {
                 HeapFree(GetProcessHeap(), 0, binValueData);
-#ifndef UNICODE
-                if(len_vname > 0)
-                    HeapFree(GetProcessHeap(), 0, u_valuename);
-#endif
                 error(hwnd, IDS_BAD_VALUE, valueName);
                 goto done;
             }
                 error(hwnd, IDS_BAD_VALUE, valueName);
                 goto done;
             }
@@ -1320,25 +1293,16 @@ BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName, BOOL EditBin)
             binValueData = NULL;
         }
 
             binValueData = NULL;
         }
 
-        if (DialogBox(0, MAKEINTRESOURCE(IDD_EDIT_BIN_DATA), hwnd, modify_binary_dlgproc) == IDOK)
+        if (DialogBoxW(0, MAKEINTRESOURCEW(IDD_EDIT_BIN_DATA), hwnd, modify_binary_dlgproc) == IDOK)
         {
         {
-            /* force to use the unicode version, so editing strings in binary mode is correct */
-            lRet = RegSetValueExW(hKey,
-#ifndef UNICODE
-                                  u_valuename,
-#else
-                                  valueName,
-#endif
+            /* Use the unicode version, so editing strings in binary mode is correct */
+            lRet = RegSetValueExW(hKey, valueName,
                                   0, type, (LPBYTE)binValueData, valueDataLen);
             if (lRet == ERROR_SUCCESS)
                 result = TRUE;
         }
         if(binValueData != NULL)
             HeapFree(GetProcessHeap(), 0, binValueData);
                                   0, type, (LPBYTE)binValueData, valueDataLen);
             if (lRet == ERROR_SUCCESS)
                 result = TRUE;
         }
         if(binValueData != NULL)
             HeapFree(GetProcessHeap(), 0, binValueData);
-#ifndef UNICODE
-        if(len_vname > 0)
-            HeapFree(GetProcessHeap(), 0, u_valuename);
-#endif
     }
     else
     {
     }
     else
     {
@@ -1357,15 +1321,15 @@ done:
     return result;
 }
 
     return result;
 }
 
-static LONG CopyKey(HKEY hDestKey, LPCTSTR lpDestSubKey, HKEY hSrcKey, LPCTSTR lpSrcSubKey)
+static LONG CopyKey(HKEY hDestKey, LPCWSTR lpDestSubKey, HKEY hSrcKey, LPCWSTR lpSrcSubKey)
 {
     LONG lResult;
     DWORD dwDisposition;
     HKEY hDestSubKey = NULL;
     HKEY hSrcSubKey = NULL;
     DWORD dwIndex, dwType, cbName, cbData;
 {
     LONG lResult;
     DWORD dwDisposition;
     HKEY hDestSubKey = NULL;
     HKEY hSrcSubKey = NULL;
     DWORD dwIndex, dwType, cbName, cbData;
-    TCHAR szSubKey[256];
-    TCHAR szValueName[256];
+    WCHAR szSubKey[256];
+    WCHAR szValueName[256];
     BYTE szValueData[512];
 
     FILETIME ft;
     BYTE szValueData[512];
 
     FILETIME ft;
@@ -1373,14 +1337,14 @@ static LONG CopyKey(HKEY hDestKey, LPCTSTR lpDestSubKey, HKEY hSrcKey, LPCTSTR l
     /* open the source subkey, if specified */
     if (lpSrcSubKey)
     {
     /* open the source subkey, if specified */
     if (lpSrcSubKey)
     {
-        lResult = RegOpenKeyEx(hSrcKey, lpSrcSubKey, 0, KEY_ALL_ACCESS, &hSrcSubKey);
+        lResult = RegOpenKeyExW(hSrcKey, lpSrcSubKey, 0, KEY_ALL_ACCESS, &hSrcSubKey);
         if (lResult)
             goto done;
         hSrcKey = hSrcSubKey;
     }
 
     /* create the destination subkey */
         if (lResult)
             goto done;
         hSrcKey = hSrcSubKey;
     }
 
     /* create the destination subkey */
-    lResult = RegCreateKeyEx(hDestKey, lpDestSubKey, 0, NULL, 0, KEY_WRITE, NULL,
+    lResult = RegCreateKeyExW(hDestKey, lpDestSubKey, 0, NULL, 0, KEY_WRITE, NULL,
                              &hDestSubKey, &dwDisposition);
     if (lResult)
         goto done;
                              &hDestSubKey, &dwDisposition);
     if (lResult)
         goto done;
@@ -1390,7 +1354,7 @@ static LONG CopyKey(HKEY hDestKey, LPCTSTR lpDestSubKey, HKEY hSrcKey, LPCTSTR l
     do
     {
         cbName = sizeof(szSubKey) / sizeof(szSubKey[0]);
     do
     {
         cbName = sizeof(szSubKey) / sizeof(szSubKey[0]);
-        lResult = RegEnumKeyEx(hSrcKey, dwIndex++, szSubKey, &cbName, NULL, NULL, NULL, &ft);
+        lResult = RegEnumKeyExW(hSrcKey, dwIndex++, szSubKey, &cbName, NULL, NULL, NULL, &ft);
         if (lResult == ERROR_SUCCESS)
         {
             lResult = CopyKey(hDestSubKey, szSubKey, hSrcKey, szSubKey);
         if (lResult == ERROR_SUCCESS)
         {
             lResult = CopyKey(hDestSubKey, szSubKey, hSrcKey, szSubKey);
@@ -1406,10 +1370,10 @@ static LONG CopyKey(HKEY hDestKey, LPCTSTR lpDestSubKey, HKEY hSrcKey, LPCTSTR l
     {
         cbName = sizeof(szValueName) / sizeof(szValueName[0]);
         cbData = sizeof(szValueData) / sizeof(szValueData[0]);
     {
         cbName = sizeof(szValueName) / sizeof(szValueName[0]);
         cbData = sizeof(szValueData) / sizeof(szValueData[0]);
-        lResult = RegEnumValue(hSrcKey, dwIndex++, szValueName, &cbName, NULL, &dwType, szValueData, &cbData);
+        lResult = RegEnumValueW(hSrcKey, dwIndex++, szValueName, &cbName, NULL, &dwType, szValueData, &cbData);
         if (lResult == ERROR_SUCCESS)
         {
         if (lResult == ERROR_SUCCESS)
         {
-            lResult = RegSetValueEx(hDestSubKey, szValueName, 0, dwType, szValueData, cbData);
+            lResult = RegSetValueExW(hDestSubKey, szValueName, 0, dwType, szValueData, cbData);
             if (lResult)
                 goto done;
         }
             if (lResult)
                 goto done;
         }
@@ -1428,7 +1392,7 @@ done:
     return lResult;
 }
 
     return lResult;
 }
 
-static LONG MoveKey(HKEY hDestKey, LPCTSTR lpDestSubKey, HKEY hSrcKey, LPCTSTR lpSrcSubKey)
+static LONG MoveKey(HKEY hDestKey, LPCWSTR lpDestSubKey, HKEY hSrcKey, LPCWSTR lpSrcSubKey)
 {
     LONG lResult;
 
 {
     LONG lResult;
 
@@ -1442,24 +1406,24 @@ static LONG MoveKey(HKEY hDestKey, LPCTSTR lpDestSubKey, HKEY hSrcKey, LPCTSTR l
     return lResult;
 }
 
     return lResult;
 }
 
-BOOL DeleteKey(HWND hwnd, HKEY hKeyRoot, LPCTSTR keyPath)
+BOOL DeleteKey(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath)
 {
 {
-    TCHAR msg[128], caption[128];
+    WCHAR msg[128], caption[128];
     BOOL result = FALSE;
     LONG lRet;
     HKEY hKey;
 
     BOOL result = FALSE;
     LONG lRet;
     HKEY hKey;
 
-    lRet = RegOpenKeyEx(hKeyRoot, keyPath, 0, KEY_READ|KEY_SET_VALUE, &hKey);
+    lRet = RegOpenKeyExW(hKeyRoot, keyPath, 0, KEY_READ|KEY_SET_VALUE, &hKey);
     if (lRet != ERROR_SUCCESS)
     {
         error_code_messagebox(hwnd, lRet);
         return FALSE;
     }
 
     if (lRet != ERROR_SUCCESS)
     {
         error_code_messagebox(hwnd, lRet);
         return FALSE;
     }
 
-    LoadString(hInst, IDS_QUERY_DELETE_KEY_CONFIRM, caption, COUNT_OF(caption));
-    LoadString(hInst, IDS_QUERY_DELETE_KEY_ONE, msg, COUNT_OF(msg));
+    LoadStringW(hInst, IDS_QUERY_DELETE_KEY_CONFIRM, caption, COUNT_OF(caption));
+    LoadStringW(hInst, IDS_QUERY_DELETE_KEY_ONE, msg, COUNT_OF(msg));
 
 
-    if (MessageBox(g_pChildWnd->hWnd, msg, caption, MB_ICONQUESTION | MB_YESNO) != IDYES)
+    if (MessageBoxW(g_pChildWnd->hWnd, msg, caption, MB_ICONQUESTION | MB_YESNO) != IDYES)
         goto done;
 
     lRet = SHDeleteKey(hKeyRoot, keyPath);
         goto done;
 
     lRet = SHDeleteKey(hKeyRoot, keyPath);
@@ -1475,24 +1439,24 @@ done:
     return result;
 }
 
     return result;
 }
 
-LONG RenameKey(HKEY hKey, LPCTSTR lpSubKey, LPCTSTR lpNewName)
+LONG RenameKey(HKEY hKey, LPCWSTR lpSubKey, LPCWSTR lpNewName)
 {
 {
-    LPCTSTR s;
-    LPTSTR lpNewSubKey = NULL;
+    LPCWSTR s;
+    LPWSTR lpNewSubKey = NULL;
     LONG Ret = 0;
 
     if (!lpSubKey)
         return Ret;
 
     LONG Ret = 0;
 
     if (!lpSubKey)
         return Ret;
 
-    s = _tcsrchr(lpSubKey, _T('\\'));
+    s = wcsrchr(lpSubKey, L'\\');
     if (s)
     {
         s++;
     if (s)
     {
         s++;
-        lpNewSubKey = (LPTSTR) HeapAlloc(GetProcessHeap(), 0, (s - lpSubKey + _tcslen(lpNewName) + 1) * sizeof(TCHAR));
+        lpNewSubKey = (LPWSTR) HeapAlloc(GetProcessHeap(), 0, (s - lpSubKey + wcslen(lpNewName) + 1) * sizeof(WCHAR));
         if (lpNewSubKey != NULL)
         {
         if (lpNewSubKey != NULL)
         {
-            memcpy(lpNewSubKey, lpSubKey, (s - lpSubKey) * sizeof(TCHAR));
-            lstrcpy(lpNewSubKey + (s - lpSubKey), lpNewName);
+            memcpy(lpNewSubKey, lpSubKey, (s - lpSubKey) * sizeof(WCHAR));
+            wcscpy(lpNewSubKey + (s - lpSubKey), lpNewName);
             lpNewName = lpNewSubKey;
         }
         else
             lpNewName = lpNewSubKey;
         }
         else
@@ -1508,7 +1472,7 @@ LONG RenameKey(HKEY hKey, LPCTSTR lpSubKey, LPCTSTR lpNewName)
     return Ret;
 }
 
     return Ret;
 }
 
-LONG RenameValue(HKEY hKey, LPCTSTR lpSubKey, LPCTSTR lpDestValue, LPCTSTR lpSrcValue)
+LONG RenameValue(HKEY hKey, LPCWSTR lpSubKey, LPCWSTR lpDestValue, LPCWSTR lpSrcValue)
 {
     LONG lResult;
     HKEY hSubKey = NULL;
 {
     LONG lResult;
     HKEY hSubKey = NULL;
@@ -1517,18 +1481,18 @@ LONG RenameValue(HKEY hKey, LPCTSTR lpSubKey, LPCTSTR lpDestValue, LPCTSTR lpSrc
 
     if (lpSubKey)
     {
 
     if (lpSubKey)
     {
-        lResult = RegOpenKey(hKey, lpSubKey, &hSubKey);
+        lResult = RegOpenKeyW(hKey, lpSubKey, &hSubKey);
         if (lResult != ERROR_SUCCESS)
             goto done;
         hKey = hSubKey;
     }
 
     cbData = sizeof(data);
         if (lResult != ERROR_SUCCESS)
             goto done;
         hKey = hSubKey;
     }
 
     cbData = sizeof(data);
-    lResult = RegQueryValueEx(hKey, lpSrcValue, NULL, &dwType, data, &cbData);
+    lResult = RegQueryValueExW(hKey, lpSrcValue, NULL, &dwType, data, &cbData);
     if (lResult != ERROR_SUCCESS)
         goto done;
 
     if (lResult != ERROR_SUCCESS)
         goto done;
 
-    lResult = RegSetValueEx(hKey, lpDestValue, 0, dwType, data, cbData);
+    lResult = RegSetValueExW(hKey, lpDestValue, 0, dwType, data, cbData);
     if (lResult != ERROR_SUCCESS)
         goto done;
 
     if (lResult != ERROR_SUCCESS)
         goto done;
 
@@ -1540,7 +1504,7 @@ done:
     return lResult;
 }
 
     return lResult;
 }
 
-LONG QueryStringValue(HKEY hKey, LPCTSTR lpSubKey, LPCTSTR lpValueName, LPTSTR pszBuffer, DWORD dwBufferLen)
+LONG QueryStringValue(HKEY hKey, LPCWSTR lpSubKey, LPCWSTR lpValueName, LPWSTR pszBuffer, DWORD dwBufferLen)
 {
     LONG lResult;
     HKEY hSubKey = NULL;
 {
     LONG lResult;
     HKEY hSubKey = NULL;
@@ -1548,14 +1512,14 @@ LONG QueryStringValue(HKEY hKey, LPCTSTR lpSubKey, LPCTSTR lpValueName, LPTSTR p
 
     if (lpSubKey)
     {
 
     if (lpSubKey)
     {
-        lResult = RegOpenKey(hKey, lpSubKey, &hSubKey);
+        lResult = RegOpenKeyW(hKey, lpSubKey, &hSubKey);
         if (lResult != ERROR_SUCCESS)
             goto done;
         hKey = hSubKey;
     }
 
     cbData = (dwBufferLen - 1) * sizeof(*pszBuffer);
         if (lResult != ERROR_SUCCESS)
             goto done;
         hKey = hSubKey;
     }
 
     cbData = (dwBufferLen - 1) * sizeof(*pszBuffer);
-    lResult = RegQueryValueEx(hKey, lpValueName, NULL, &dwType, (LPBYTE) pszBuffer, &cbData);
+    lResult = RegQueryValueExW(hKey, lpValueName, NULL, &dwType, (LPBYTE) pszBuffer, &cbData);
     if (lResult != ERROR_SUCCESS)
         goto done;
     if (dwType != REG_SZ)
     if (lResult != ERROR_SUCCESS)
         goto done;
     if (dwType != REG_SZ)
@@ -1564,38 +1528,38 @@ LONG QueryStringValue(HKEY hKey, LPCTSTR lpSubKey, LPCTSTR lpValueName, LPTSTR p
         goto done;
     }
 
         goto done;
     }
 
-    pszBuffer[cbData / sizeof(*pszBuffer)] = _T('\0');
+    pszBuffer[cbData / sizeof(*pszBuffer)] = L'\0';
 
 done:
     if (lResult != ERROR_SUCCESS)
 
 done:
     if (lResult != ERROR_SUCCESS)
-        pszBuffer[0] = _T('\0');
+        pszBuffer[0] = L'\0';
     if (hSubKey)
         RegCloseKey(hSubKey);
     return lResult;
 }
 
     if (hSubKey)
         RegCloseKey(hSubKey);
     return lResult;
 }
 
-BOOL GetKeyName(LPTSTR pszDest, size_t iDestLength, HKEY hRootKey, LPCTSTR lpSubKey)
+BOOL GetKeyName(LPWSTR pszDest, size_t iDestLength, HKEY hRootKey, LPCWSTR lpSubKey)
 {
 {
-    LPCTSTR pszRootKey;
+    LPCWSTR pszRootKey;
 
     if (hRootKey == HKEY_CLASSES_ROOT)
 
     if (hRootKey == HKEY_CLASSES_ROOT)
-        pszRootKey = TEXT("HKEY_CLASSES_ROOT");
+        pszRootKey = L"HKEY_CLASSES_ROOT";
     else if (hRootKey == HKEY_CURRENT_USER)
     else if (hRootKey == HKEY_CURRENT_USER)
-        pszRootKey = TEXT("HKEY_CURRENT_USER");
+        pszRootKey = L"HKEY_CURRENT_USER";
     else if (hRootKey == HKEY_LOCAL_MACHINE)
     else if (hRootKey == HKEY_LOCAL_MACHINE)
-        pszRootKey = TEXT("HKEY_LOCAL_MACHINE");
+        pszRootKey = L"HKEY_LOCAL_MACHINE";
     else if (hRootKey == HKEY_USERS)
     else if (hRootKey == HKEY_USERS)
-        pszRootKey = TEXT("HKEY_USERS");
+        pszRootKey = L"HKEY_USERS";
     else if (hRootKey == HKEY_CURRENT_CONFIG)
     else if (hRootKey == HKEY_CURRENT_CONFIG)
-        pszRootKey = TEXT("HKEY_CURRENT_CONFIG");
+        pszRootKey = L"HKEY_CURRENT_CONFIG";
     else if (hRootKey == HKEY_DYN_DATA)
     else if (hRootKey == HKEY_DYN_DATA)
-        pszRootKey = TEXT("HKEY_DYN_DATA");
+        pszRootKey = L"HKEY_DYN_DATA";
     else
         return FALSE;
 
     if (lpSubKey[0])
     else
         return FALSE;
 
     if (lpSubKey[0])
-        _sntprintf(pszDest, iDestLength, TEXT("%s\\%s"), pszRootKey, lpSubKey);
+        _snwprintf(pszDest, iDestLength, L"%s\\%s", pszRootKey, lpSubKey);
     else
     else
-        _sntprintf(pszDest, iDestLength, TEXT("%s"), pszRootKey);
+        _snwprintf(pszDest, iDestLength, L"%s", pszRootKey);
     return TRUE;
 }
     return TRUE;
 }
index 864094e..6313591 100644 (file)
 
 #include <regedit.h>
 
 
 #include <regedit.h>
 
-int ErrorMessageBox(HWND hWnd, LPCTSTR lpTitle, DWORD dwErrorCode, ...)
+int ErrorMessageBox(HWND hWnd, LPCWSTR lpTitle, DWORD dwErrorCode, ...)
 {
     int iRet = 0;
 {
     int iRet = 0;
-    LPTSTR lpMsgBuf = NULL;
+    LPWSTR lpMsgBuf = NULL;
     DWORD Status = 0;
 
     va_list args = NULL;
     va_start(args, dwErrorCode);
 
     DWORD Status = 0;
 
     va_list args = NULL;
     va_start(args, dwErrorCode);
 
-    Status = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
-                           NULL,
-                           dwErrorCode,
-                           MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
-                           (LPTSTR)&lpMsgBuf,
-                           0,
-                           &args);
+    Status = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
+                            NULL,
+                            dwErrorCode,
+                            MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+                            (LPWSTR)&lpMsgBuf,
+                            0,
+                            &args);
 
     va_end(args);
 
 
     va_end(args);
 
-    iRet = MessageBox(hWnd, (Status && lpMsgBuf ? lpMsgBuf : TEXT("Error displaying error message.\n")), lpTitle, MB_OK | MB_ICONERROR);
+    iRet = MessageBoxW(hWnd, (Status && lpMsgBuf ? lpMsgBuf : L"Error displaying error message.\n"), lpTitle, MB_OK | MB_ICONERROR);
 
     if (lpMsgBuf) LocalFree(lpMsgBuf);
 
 
     if (lpMsgBuf) LocalFree(lpMsgBuf);
 
-    /* Return the MessageBox information */
+    /* Return the MessageBoxW information */
     return iRet;
 }
 
     return iRet;
 }
 
-int InfoMessageBox(HWND hWnd, UINT uType, LPCTSTR lpTitle, LPCTSTR lpMessage, ...)
+int InfoMessageBox(HWND hWnd, UINT uType, LPCWSTR lpTitle, LPCWSTR lpMessage, ...)
 {
     int iRet = 0;
 {
     int iRet = 0;
-    LPTSTR lpMsgBuf = NULL;
+    LPWSTR lpMsgBuf = NULL;
     DWORD Status = 0;
 
     va_list args = NULL;
     va_start(args, lpMessage);
 
     DWORD Status = 0;
 
     va_list args = NULL;
     va_start(args, lpMessage);
 
-    Status = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING,
-                           lpMessage,
-                           0,
-                           0,
-                           (LPTSTR)&lpMsgBuf,
-                           0,
-                           &args);
+    Status = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING,
+                            lpMessage,
+                            0,
+                            0,
+                            (LPWSTR)&lpMsgBuf,
+                            0,
+                            &args);
 
     va_end(args);
 
 
     va_end(args);
 
-    iRet = MessageBox(hWnd, (Status && lpMsgBuf ? lpMsgBuf : TEXT("Error displaying error message.\n")), lpTitle, uType);
+    iRet = MessageBoxW(hWnd, (Status && lpMsgBuf ? lpMsgBuf : L"Error displaying error message.\n"), lpTitle, uType);
 
     if (lpMsgBuf) LocalFree(lpMsgBuf);
 
 
     if (lpMsgBuf) LocalFree(lpMsgBuf);
 
-    /* Return the MessageBox information */
+    /* Return the MessageBoxW information */
     return iRet;
 }
     return iRet;
 }
index 4283864..0a15204 100644 (file)
 #include <regedit.h>
 
 #define RSF_WHOLESTRING    0x00000001
 #include <regedit.h>
 
 #define RSF_WHOLESTRING    0x00000001
-#define RSF_LOOKATKEYS    0x00000002
+#define RSF_LOOKATKEYS     0x00000002
 #define RSF_LOOKATVALUES   0x00000004
 #define RSF_LOOKATDATA     0x00000008
 #define RSF_MATCHCASE      0x00010000
 
 #define RSF_LOOKATVALUES   0x00000004
 #define RSF_LOOKATDATA     0x00000008
 #define RSF_MATCHCASE      0x00010000
 
-static TCHAR s_szFindWhat[256];
-static const TCHAR s_szFindFlags[] = _T("FindFlags");
-static const TCHAR s_szFindFlagsR[] = _T("FindFlagsReactOS");
+static WCHAR s_szFindWhat[256];
+static const WCHAR s_szFindFlags[] = L"FindFlags";
+static const WCHAR s_szFindFlagsR[] = L"FindFlagsReactOS";
 static HWND s_hwndAbortDialog;
 static BOOL s_bAbort;
 
 static DWORD s_dwFlags;
 static HWND s_hwndAbortDialog;
 static BOOL s_bAbort;
 
 static DWORD s_dwFlags;
-static TCHAR s_szName[MAX_PATH];
+static WCHAR s_szName[MAX_PATH];
 static DWORD s_cbName;
 static DWORD s_cbName;
-static const TCHAR s_empty[] = {0};
-static const TCHAR s_backslash[] = {'\\', 0};
+static const WCHAR s_empty[] = L"";
+static const WCHAR s_backslash[] = L"\\";
 
 
-extern VOID SetValueName(HWND hwndLV, LPCTSTR pszValueName);
+extern VOID SetValueName(HWND hwndLV, LPCWSTR pszValueName);
 
 BOOL DoEvents(VOID)
 {
     MSG msg;
 
 BOOL DoEvents(VOID)
 {
     MSG msg;
-    if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
+    if (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE))
     {
         if (msg.message == WM_QUIT)
             s_bAbort = TRUE;
     {
         if (msg.message == WM_QUIT)
             s_bAbort = TRUE;
-        if (!IsDialogMessage(s_hwndAbortDialog, &msg))
+        if (!IsDialogMessageW(s_hwndAbortDialog, &msg))
         {
             TranslateMessage(&msg);
         {
             TranslateMessage(&msg);
-            DispatchMessage(&msg);
+            DispatchMessageW(&msg);
         }
     }
     return s_bAbort;
 }
 
         }
     }
     return s_bAbort;
 }
 
-static LPTSTR lstrstri(LPCTSTR psz1, LPCTSTR psz2)
+static LPWSTR lstrstri(LPCWSTR psz1, LPCWSTR psz2)
 {
     INT i, cch1, cch2;
 
 {
     INT i, cch1, cch2;
 
-    cch1 = lstrlen(psz1);
-    cch2 = lstrlen(psz2);
+    cch1 = wcslen(psz1);
+    cch2 = wcslen(psz2);
     for(i = 0; i <= cch1 - cch2; i++)
     {
     for(i = 0; i <= cch1 - cch2; i++)
     {
-        if (CompareString(LOCALE_SYSTEM_DEFAULT, NORM_IGNORECASE,
-                          psz1 + i, cch2, psz2, cch2) == 2)
-            return (LPTSTR) (psz1 + i);
+        if (CompareStringW(LOCALE_SYSTEM_DEFAULT, NORM_IGNORECASE,
+                           psz1 + i, cch2, psz2, cch2) == 2)
+            return (LPWSTR) (psz1 + i);
     }
     return NULL;
 }
 
     }
     return NULL;
 }
 
-static BOOL CompareName(LPCTSTR pszName1, LPCTSTR pszName2)
+static BOOL CompareName(LPCWSTR pszName1, LPCWSTR pszName2)
 {
     if (s_dwFlags & RSF_WHOLESTRING)
     {
         if (s_dwFlags & RSF_MATCHCASE)
 {
     if (s_dwFlags & RSF_WHOLESTRING)
     {
         if (s_dwFlags & RSF_MATCHCASE)
-            return lstrcmp(pszName1, pszName2) == 0;
+            return wcscmp(pszName1, pszName2) == 0;
         else
         else
-            return lstrcmpi(pszName1, pszName2) == 0;
+            return wcsicmp(pszName1, pszName2) == 0;
     }
     else
     {
         if (s_dwFlags & RSF_MATCHCASE)
     }
     else
     {
         if (s_dwFlags & RSF_MATCHCASE)
-            return _tcsstr(pszName1, pszName2) != NULL;
+            return wcsstr(pszName1, pszName2) != NULL;
         else
             return lstrstri(pszName1, pszName2) != NULL;
     }
         else
             return lstrstri(pszName1, pszName2) != NULL;
     }
@@ -91,19 +91,19 @@ static BOOL CompareName(LPCTSTR pszName1, LPCTSTR pszName2)
 static BOOL
 CompareData(
     DWORD   dwType,
 static BOOL
 CompareData(
     DWORD   dwType,
-    LPCTSTR psz1,
-    LPCTSTR psz2)
+    LPCWSTR psz1,
+    LPCWSTR psz2)
 {
 {
-    INT i, cch1 = lstrlen(psz1), cch2 = lstrlen(psz2);
+    INT i, cch1 = wcslen(psz1), cch2 = wcslen(psz2);
     if (dwType == REG_SZ || dwType == REG_EXPAND_SZ)
     {
         if (s_dwFlags & RSF_WHOLESTRING)
         {
             if (s_dwFlags & RSF_MATCHCASE)
     if (dwType == REG_SZ || dwType == REG_EXPAND_SZ)
     {
         if (s_dwFlags & RSF_WHOLESTRING)
         {
             if (s_dwFlags & RSF_MATCHCASE)
-                return 2 == CompareString(LOCALE_SYSTEM_DEFAULT, 0,
+                return 2 == CompareStringW(LOCALE_SYSTEM_DEFAULT, 0,
                                           psz1, cch1, psz2, cch2);
             else
                                           psz1, cch1, psz2, cch2);
             else
-                return 2 == CompareString(LOCALE_SYSTEM_DEFAULT,
+                return 2 == CompareStringW(LOCALE_SYSTEM_DEFAULT,
                                           NORM_IGNORECASE, psz1, cch1, psz2, cch2);
         }
 
                                           NORM_IGNORECASE, psz1, cch1, psz2, cch2);
         }
 
@@ -111,13 +111,13 @@ CompareData(
         {
             if (s_dwFlags & RSF_MATCHCASE)
             {
         {
             if (s_dwFlags & RSF_MATCHCASE)
             {
-                if (2 == CompareString(LOCALE_SYSTEM_DEFAULT, 0,
+                if (2 == CompareStringW(LOCALE_SYSTEM_DEFAULT, 0,
                                        psz1 + i, cch2, psz2, cch2))
                     return TRUE;
             }
             else
             {
                                        psz1 + i, cch2, psz2, cch2))
                     return TRUE;
             }
             else
             {
-                if (2 == CompareString(LOCALE_SYSTEM_DEFAULT,
+                if (2 == CompareStringW(LOCALE_SYSTEM_DEFAULT,
                                        NORM_IGNORECASE, psz1 + i, cch2, psz2, cch2))
                     return TRUE;
             }
                                        NORM_IGNORECASE, psz1 + i, cch2, psz2, cch2))
                     return TRUE;
             }
@@ -128,55 +128,55 @@ CompareData(
 
 int compare(const void *x, const void *y)
 {
 
 int compare(const void *x, const void *y)
 {
-    const LPCTSTR *a = (const LPCTSTR *)x;
-    const LPCTSTR *b = (const LPCTSTR *)y;
-    return lstrcmpi(*a, *b);
+    const LPCWSTR *a = (const LPCWSTR *)x;
+    const LPCWSTR *b = (const LPCWSTR *)y;
+    return wcsicmp(*a, *b);
 }
 
 BOOL RegFindRecurse(
     HKEY    hKey,
 }
 
 BOOL RegFindRecurse(
     HKEY    hKey,
-    LPCTSTR pszSubKey,
-    LPCTSTR pszValueName,
-    LPTSTR *ppszFoundSubKey,
-    LPTSTR *ppszFoundValueName)
+    LPCWSTR pszSubKey,
+    LPCWSTR pszValueName,
+    LPWSTR *ppszFoundSubKey,
+    LPWSTR *ppszFoundValueName)
 {
     HKEY hSubKey;
     LONG lResult;
 {
     HKEY hSubKey;
     LONG lResult;
-    TCHAR szSubKey[MAX_PATH];
+    WCHAR szSubKey[MAX_PATH];
     DWORD i, c, cb, type;
     BOOL fPast = FALSE;
     DWORD i, c, cb, type;
     BOOL fPast = FALSE;
-    LPTSTR *ppszNames = NULL;
+    LPWSTR *ppszNames = NULL;
     LPBYTE pb = NULL;
 
     if (DoEvents())
         return FALSE;
 
     LPBYTE pb = NULL;
 
     if (DoEvents())
         return FALSE;
 
-    lstrcpy(szSubKey, pszSubKey);
+    wcscpy(szSubKey, pszSubKey);
     hSubKey = NULL;
 
     hSubKey = NULL;
 
-    lResult = RegOpenKeyEx(hKey, szSubKey, 0, KEY_ALL_ACCESS, &hSubKey);
+    lResult = RegOpenKeyExW(hKey, szSubKey, 0, KEY_ALL_ACCESS, &hSubKey);
     if (lResult != ERROR_SUCCESS)
         return FALSE;
 
     if (pszValueName == NULL)
         pszValueName = s_empty;
 
     if (lResult != ERROR_SUCCESS)
         return FALSE;
 
     if (pszValueName == NULL)
         pszValueName = s_empty;
 
-    lResult = RegQueryInfoKey(hSubKey, NULL, NULL, NULL, NULL, NULL, NULL,
+    lResult = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, NULL, NULL, NULL,
                               &c, NULL, NULL, NULL, NULL);
     if (lResult != ERROR_SUCCESS)
         goto err;
                               &c, NULL, NULL, NULL, NULL);
     if (lResult != ERROR_SUCCESS)
         goto err;
-    ppszNames = (LPTSTR *) malloc(c * sizeof(LPTSTR));
+    ppszNames = (LPWSTR *) malloc(c * sizeof(LPWSTR));
     if (ppszNames == NULL)
         goto err;
     if (ppszNames == NULL)
         goto err;
-    ZeroMemory(ppszNames, c * sizeof(LPTSTR));
+    ZeroMemory(ppszNames, c * sizeof(LPWSTR));
 
     for(i = 0; i < c; i++)
     {
         if (DoEvents())
             goto err;
 
 
     for(i = 0; i < c; i++)
     {
         if (DoEvents())
             goto err;
 
-        s_cbName = MAX_PATH * sizeof(TCHAR);
-        lResult = RegEnumValue(hSubKey, i, s_szName, &s_cbName, NULL, NULL,
+        s_cbName = MAX_PATH * sizeof(WCHAR);
+        lResult = RegEnumValueW(hSubKey, i, s_szName, &s_cbName, NULL, NULL,
                                NULL, &cb);
         if (lResult == ERROR_NO_MORE_ITEMS)
         {
                                NULL, &cb);
         if (lResult == ERROR_NO_MORE_ITEMS)
         {
@@ -185,20 +185,20 @@ BOOL RegFindRecurse(
         }
         if (lResult != ERROR_SUCCESS)
             goto err;
         }
         if (lResult != ERROR_SUCCESS)
             goto err;
-        if (s_cbName >= MAX_PATH * sizeof(TCHAR))
+        if (s_cbName >= MAX_PATH * sizeof(WCHAR))
             continue;
 
             continue;
 
-        ppszNames[i] = _tcsdup(s_szName);
+        ppszNames[i] = _wcsdup(s_szName);
     }
 
     }
 
-    qsort(ppszNames, c, sizeof(LPTSTR), compare);
+    qsort(ppszNames, c, sizeof(LPWSTR), compare);
 
     for(i = 0; i < c; i++)
     {
         if (DoEvents())
             goto err;
 
 
     for(i = 0; i < c; i++)
     {
         if (DoEvents())
             goto err;
 
-        if (!fPast && lstrcmpi(ppszNames[i], pszValueName) == 0)
+        if (!fPast && wcsicmp(ppszNames[i], pszValueName) == 0)
         {
             fPast = TRUE;
             continue;
         {
             fPast = TRUE;
             continue;
@@ -209,34 +209,34 @@ BOOL RegFindRecurse(
         if ((s_dwFlags & RSF_LOOKATVALUES) &&
                 CompareName(ppszNames[i], s_szFindWhat))
         {
         if ((s_dwFlags & RSF_LOOKATVALUES) &&
                 CompareName(ppszNames[i], s_szFindWhat))
         {
-            *ppszFoundSubKey = _tcsdup(szSubKey);
+            *ppszFoundSubKey = _wcsdup(szSubKey);
             if (ppszNames[i][0] == 0)
                 *ppszFoundValueName = NULL;
             else
             if (ppszNames[i][0] == 0)
                 *ppszFoundValueName = NULL;
             else
-                *ppszFoundValueName = _tcsdup(ppszNames[i]);
+                *ppszFoundValueName = _wcsdup(ppszNames[i]);
             goto success;
         }
 
             goto success;
         }
 
-        lResult = RegQueryValueEx(hSubKey, ppszNames[i], NULL, &type,
+        lResult = RegQueryValueExW(hSubKey, ppszNames[i], NULL, &type,
                                   NULL, &cb);
         if (lResult != ERROR_SUCCESS)
             goto err;
         pb = malloc(cb);
         if (pb == NULL)
             goto err;
                                   NULL, &cb);
         if (lResult != ERROR_SUCCESS)
             goto err;
         pb = malloc(cb);
         if (pb == NULL)
             goto err;
-        lResult = RegQueryValueEx(hSubKey, ppszNames[i], NULL, &type,
+        lResult = RegQueryValueExW(hSubKey, ppszNames[i], NULL, &type,
                                   pb, &cb);
         if (lResult != ERROR_SUCCESS)
             goto err;
 
         if ((s_dwFlags & RSF_LOOKATDATA) &&
                                   pb, &cb);
         if (lResult != ERROR_SUCCESS)
             goto err;
 
         if ((s_dwFlags & RSF_LOOKATDATA) &&
-                CompareData(type, (LPTSTR) pb, s_szFindWhat))
+                CompareData(type, (LPWSTR) pb, s_szFindWhat))
         {
         {
-            *ppszFoundSubKey = _tcsdup(szSubKey);
+            *ppszFoundSubKey = _wcsdup(szSubKey);
             if (ppszNames[i][0] == 0)
                 *ppszFoundValueName = NULL;
             else
             if (ppszNames[i][0] == 0)
                 *ppszFoundValueName = NULL;
             else
-                *ppszFoundValueName = _tcsdup(ppszNames[i]);
+                *ppszFoundValueName = _wcsdup(ppszNames[i]);
             goto success;
         }
         free(pb);
             goto success;
         }
         free(pb);
@@ -251,22 +251,22 @@ BOOL RegFindRecurse(
     }
     ppszNames = NULL;
 
     }
     ppszNames = NULL;
 
-    lResult = RegQueryInfoKey(hSubKey, NULL, NULL, NULL, &c, NULL, NULL,
+    lResult = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, &c, NULL, NULL,
                               NULL, NULL, NULL, NULL, NULL);
     if (lResult != ERROR_SUCCESS)
         goto err;
                               NULL, NULL, NULL, NULL, NULL);
     if (lResult != ERROR_SUCCESS)
         goto err;
-    ppszNames = (LPTSTR *) malloc(c * sizeof(LPTSTR));
+    ppszNames = (LPWSTR *) malloc(c * sizeof(LPWSTR));
     if (ppszNames == NULL)
         goto err;
     if (ppszNames == NULL)
         goto err;
-    ZeroMemory(ppszNames, c * sizeof(LPTSTR));
+    ZeroMemory(ppszNames, c * sizeof(LPWSTR));
 
     for(i = 0; i < c; i++)
     {
         if (DoEvents())
             goto err;
 
 
     for(i = 0; i < c; i++)
     {
         if (DoEvents())
             goto err;
 
-        s_cbName = MAX_PATH * sizeof(TCHAR);
-        lResult = RegEnumKeyEx(hSubKey, i, s_szName, &s_cbName, NULL, NULL,
+        s_cbName = MAX_PATH * sizeof(WCHAR);
+        lResult = RegEnumKeyExW(hSubKey, i, s_szName, &s_cbName, NULL, NULL,
                                NULL, NULL);
         if (lResult == ERROR_NO_MORE_ITEMS)
         {
                                NULL, NULL);
         if (lResult == ERROR_NO_MORE_ITEMS)
         {
@@ -275,13 +275,13 @@ BOOL RegFindRecurse(
         }
         if (lResult != ERROR_SUCCESS)
             goto err;
         }
         if (lResult != ERROR_SUCCESS)
             goto err;
-        if (s_cbName >= MAX_PATH * sizeof(TCHAR))
+        if (s_cbName >= MAX_PATH * sizeof(WCHAR))
             continue;
 
             continue;
 
-        ppszNames[i] = _tcsdup(s_szName);
+        ppszNames[i] = _wcsdup(s_szName);
     }
 
     }
 
-    qsort(ppszNames, c, sizeof(LPTSTR), compare);
+    qsort(ppszNames, c, sizeof(LPWSTR), compare);
 
     for(i = 0; i < c; i++)
     {
 
     for(i = 0; i < c; i++)
     {
@@ -292,18 +292,18 @@ BOOL RegFindRecurse(
                 CompareName(ppszNames[i], s_szFindWhat))
         {
             *ppszFoundSubKey = malloc(
                 CompareName(ppszNames[i], s_szFindWhat))
         {
             *ppszFoundSubKey = malloc(
-                                   (lstrlen(szSubKey) + lstrlen(ppszNames[i]) + 2) *
-                                   sizeof(TCHAR));
+                                   (wcslen(szSubKey) + wcslen(ppszNames[i]) + 2) *
+                                   sizeof(WCHAR));
             if (*ppszFoundSubKey == NULL)
                 goto err;
             if (szSubKey[0])
             {
             if (*ppszFoundSubKey == NULL)
                 goto err;
             if (szSubKey[0])
             {
-                lstrcpy(*ppszFoundSubKey, szSubKey);
-                lstrcatW(*ppszFoundSubKey, s_backslash);
+                wcscpy(*ppszFoundSubKey, szSubKey);
+                wcscat(*ppszFoundSubKey, s_backslash);
             }
             else
                 **ppszFoundSubKey = 0;
             }
             else
                 **ppszFoundSubKey = 0;
-            lstrcatW(*ppszFoundSubKey, ppszNames[i]);
+            wcscat(*ppszFoundSubKey, ppszNames[i]);
             *ppszFoundValueName = NULL;
             goto success;
         }
             *ppszFoundValueName = NULL;
             goto success;
         }
@@ -311,19 +311,19 @@ BOOL RegFindRecurse(
         if (RegFindRecurse(hSubKey, ppszNames[i], NULL, ppszFoundSubKey,
                            ppszFoundValueName))
         {
         if (RegFindRecurse(hSubKey, ppszNames[i], NULL, ppszFoundSubKey,
                            ppszFoundValueName))
         {
-            LPTSTR psz = *ppszFoundSubKey;
+            LPWSTR psz = *ppszFoundSubKey;
             *ppszFoundSubKey = malloc(
             *ppszFoundSubKey = malloc(
-                                   (lstrlen(szSubKey) + lstrlen(psz) + 2) * sizeof(TCHAR));
+                                   (wcslen(szSubKey) + wcslen(psz) + 2) * sizeof(WCHAR));
             if (*ppszFoundSubKey == NULL)
                 goto err;
             if (szSubKey[0])
             {
             if (*ppszFoundSubKey == NULL)
                 goto err;
             if (szSubKey[0])
             {
-                lstrcpy(*ppszFoundSubKey, szSubKey);
-                lstrcatW(*ppszFoundSubKey, s_backslash);
+                wcscpy(*ppszFoundSubKey, szSubKey);
+                wcscat(*ppszFoundSubKey, s_backslash);
             }
             else
                 **ppszFoundSubKey = 0;
             }
             else
                 **ppszFoundSubKey = 0;
-            lstrcatW(*ppszFoundSubKey, psz);
+            wcscat(*ppszFoundSubKey, psz);
             free(psz);
             goto success;
         }
             free(psz);
             goto success;
         }
@@ -353,67 +353,67 @@ success:
 
 BOOL RegFindWalk(
     HKEY *  phKey,
 
 BOOL RegFindWalk(
     HKEY *  phKey,
-    LPCTSTR pszSubKey,
-    LPCTSTR pszValueName,
-    LPTSTR *ppszFoundSubKey,
-    LPTSTR *ppszFoundValueName)
+    LPCWSTR pszSubKey,
+    LPCWSTR pszValueName,
+    LPWSTR *ppszFoundSubKey,
+    LPWSTR *ppszFoundValueName)
 {
     LONG lResult;
     DWORD i, c;
     HKEY hBaseKey, hSubKey;
 {
     LONG lResult;
     DWORD i, c;
     HKEY hBaseKey, hSubKey;
-    TCHAR szKeyName[MAX_PATH];
-    TCHAR szSubKey[MAX_PATH];
-    LPTSTR pch;
+    WCHAR szKeyName[MAX_PATH];
+    WCHAR szSubKey[MAX_PATH];
+    LPWSTR pch;
     BOOL fPast;
     BOOL fPast;
-    LPTSTR *ppszNames = NULL;
+    LPWSTR *ppszNames = NULL;
 
     hBaseKey = *phKey;
     if (RegFindRecurse(hBaseKey, pszSubKey, pszValueName, ppszFoundSubKey,
                        ppszFoundValueName))
         return TRUE;
 
 
     hBaseKey = *phKey;
     if (RegFindRecurse(hBaseKey, pszSubKey, pszValueName, ppszFoundSubKey,
                        ppszFoundValueName))
         return TRUE;
 
-    if (lstrlen(pszSubKey) >= MAX_PATH)
+    if (wcslen(pszSubKey) >= MAX_PATH)
         return FALSE;
 
         return FALSE;
 
-    lstrcpy(szSubKey, pszSubKey);
+    wcscpy(szSubKey, pszSubKey);
     while(szSubKey[0] != 0)
     {
         if (DoEvents())
             return FALSE;
 
     while(szSubKey[0] != 0)
     {
         if (DoEvents())
             return FALSE;
 
-        pch = _tcsrchr(szSubKey, _T('\\'));
+        pch = wcsrchr(szSubKey, L'\\');
         if (pch == NULL)
         {
         if (pch == NULL)
         {
-            lstrcpy(szKeyName, szSubKey);
+            wcscpy(szKeyName, szSubKey);
             szSubKey[0] = 0;
             hSubKey = hBaseKey;
         }
         else
         {
             szSubKey[0] = 0;
             hSubKey = hBaseKey;
         }
         else
         {
-            lstrcpyn(szKeyName, pch + 1, MAX_PATH);
+            wcsncpy(szKeyName, pch + 1, MAX_PATH);
             *pch = 0;
             *pch = 0;
-            lResult = RegOpenKeyEx(hBaseKey, szSubKey, 0, KEY_ALL_ACCESS,
+            lResult = RegOpenKeyExW(hBaseKey, szSubKey, 0, KEY_ALL_ACCESS,
                                    &hSubKey);
             if (lResult != ERROR_SUCCESS)
                 return FALSE;
         }
 
                                    &hSubKey);
             if (lResult != ERROR_SUCCESS)
                 return FALSE;
         }
 
-        lResult = RegQueryInfoKey(hSubKey, NULL, NULL, NULL, &c, NULL, NULL,
+        lResult = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, &c, NULL, NULL,
                                   NULL, NULL, NULL, NULL, NULL);
         if (lResult != ERROR_SUCCESS)
             goto err;
 
                                   NULL, NULL, NULL, NULL, NULL);
         if (lResult != ERROR_SUCCESS)
             goto err;
 
-        ppszNames = (LPTSTR *) malloc(c * sizeof(LPTSTR));
+        ppszNames = (LPWSTR *) malloc(c * sizeof(LPWSTR));
         if (ppszNames == NULL)
             goto err;
         if (ppszNames == NULL)
             goto err;
-        ZeroMemory(ppszNames, c * sizeof(LPTSTR));
+        ZeroMemory(ppszNames, c * sizeof(LPWSTR));
 
         for(i = 0; i < c; i++)
         {
             if (DoEvents())
                 goto err;
 
 
         for(i = 0; i < c; i++)
         {
             if (DoEvents())
                 goto err;
 
-            s_cbName = MAX_PATH * sizeof(TCHAR);
+            s_cbName = MAX_PATH * sizeof(WCHAR);
             lResult = RegEnumKeyExW(hSubKey, i, s_szName, &s_cbName,
                                     NULL, NULL, NULL, NULL);
             if (lResult == ERROR_NO_MORE_ITEMS)
             lResult = RegEnumKeyExW(hSubKey, i, s_szName, &s_cbName,
                                     NULL, NULL, NULL, NULL);
             if (lResult == ERROR_NO_MORE_ITEMS)
@@ -423,10 +423,10 @@ BOOL RegFindWalk(
             }
             if (lResult != ERROR_SUCCESS)
                 break;
             }
             if (lResult != ERROR_SUCCESS)
                 break;
-            ppszNames[i] = _tcsdup(s_szName);
+            ppszNames[i] = _wcsdup(s_szName);
         }
 
         }
 
-        qsort(ppszNames, c, sizeof(LPTSTR), compare);
+        qsort(ppszNames, c, sizeof(LPWSTR), compare);
 
         fPast = FALSE;
         for(i = 0; i < c; i++)
 
         fPast = FALSE;
         for(i = 0; i < c; i++)
@@ -434,7 +434,7 @@ BOOL RegFindWalk(
             if (DoEvents())
                 goto err;
 
             if (DoEvents())
                 goto err;
 
-            if (!fPast && lstrcmpi(ppszNames[i], szKeyName) == 0)
+            if (!fPast && wcsicmp(ppszNames[i], szKeyName) == 0)
             {
                 fPast = TRUE;
                 continue;
             {
                 fPast = TRUE;
                 continue;
@@ -446,18 +446,18 @@ BOOL RegFindWalk(
                     CompareName(ppszNames[i], s_szFindWhat))
             {
                 *ppszFoundSubKey = malloc(
                     CompareName(ppszNames[i], s_szFindWhat))
             {
                 *ppszFoundSubKey = malloc(
-                                       (lstrlen(szSubKey) + lstrlen(ppszNames[i]) + 2) *
-                                       sizeof(TCHAR));
+                                       (wcslen(szSubKey) + wcslen(ppszNames[i]) + 2) *
+                                       sizeof(WCHAR));
                 if (*ppszFoundSubKey == NULL)
                     goto err;
                 if (szSubKey[0])
                 {
                 if (*ppszFoundSubKey == NULL)
                     goto err;
                 if (szSubKey[0])
                 {
-                    lstrcpy(*ppszFoundSubKey, szSubKey);
-                    lstrcatW(*ppszFoundSubKey, s_backslash);
+                    wcscpy(*ppszFoundSubKey, szSubKey);
+                    wcscat(*ppszFoundSubKey, s_backslash);
                 }
                 else
                     **ppszFoundSubKey = 0;
                 }
                 else
                     **ppszFoundSubKey = 0;
-                lstrcatW(*ppszFoundSubKey, ppszNames[i]);
+                wcscat(*ppszFoundSubKey, ppszNames[i]);
                 *ppszFoundValueName = NULL;
                 goto success;
             }
                 *ppszFoundValueName = NULL;
                 goto success;
             }
@@ -465,20 +465,20 @@ BOOL RegFindWalk(
             if (RegFindRecurse(hSubKey, ppszNames[i], NULL,
                                ppszFoundSubKey, ppszFoundValueName))
             {
             if (RegFindRecurse(hSubKey, ppszNames[i], NULL,
                                ppszFoundSubKey, ppszFoundValueName))
             {
-                LPTSTR psz = *ppszFoundSubKey;
+                LPWSTR psz = *ppszFoundSubKey;
                 *ppszFoundSubKey = malloc(
                 *ppszFoundSubKey = malloc(
-                                       (lstrlen(szSubKey) + lstrlen(psz) + 2) *
-                                       sizeof(TCHAR));
+                                       (wcslen(szSubKey) + wcslen(psz) + 2) *
+                                       sizeof(WCHAR));
                 if (*ppszFoundSubKey == NULL)
                     goto err;
                 if (szSubKey[0])
                 {
                 if (*ppszFoundSubKey == NULL)
                     goto err;
                 if (szSubKey[0])
                 {
-                    lstrcpy(*ppszFoundSubKey, szSubKey);
-                    lstrcatW(*ppszFoundSubKey, s_backslash);
+                    wcscpy(*ppszFoundSubKey, szSubKey);
+                    wcscat(*ppszFoundSubKey, s_backslash);
                 }
                 else
                     **ppszFoundSubKey = 0;
                 }
                 else
                     **ppszFoundSubKey = 0;
-                lstrcatW(*ppszFoundSubKey, psz);
+                wcscat(*ppszFoundSubKey, psz);
                 free(psz);
                 goto success;
             }
                 free(psz);
                 goto success;
             }
@@ -557,11 +557,11 @@ static DWORD GetFindFlags(void)
     DWORD dwType, dwValue, cbData;
     DWORD dwFlags = RSF_LOOKATKEYS | RSF_LOOKATVALUES | RSF_LOOKATDATA;
 
     DWORD dwType, dwValue, cbData;
     DWORD dwFlags = RSF_LOOKATKEYS | RSF_LOOKATVALUES | RSF_LOOKATDATA;
 
-    if (RegOpenKey(HKEY_CURRENT_USER, g_szGeneralRegKey, &hKey) == ERROR_SUCCESS)
+    if (RegOpenKeyW(HKEY_CURRENT_USER, g_szGeneralRegKey, &hKey) == ERROR_SUCCESS)
     {
         /* Retrieve flags from registry key */
         cbData = sizeof(dwValue);
     {
         /* Retrieve flags from registry key */
         cbData = sizeof(dwValue);
-        if (RegQueryValueEx(hKey, s_szFindFlags, NULL, &dwType, (LPBYTE) &dwValue, &cbData) == ERROR_SUCCESS)
+        if (RegQueryValueExW(hKey, s_szFindFlags, NULL, &dwType, (LPBYTE) &dwValue, &cbData) == ERROR_SUCCESS)
         {
             if (dwType == REG_DWORD)
                 dwFlags = (dwFlags & ~0x0000FFFF) | ((dwValue & 0x0000FFFF) << 0);
         {
             if (dwType == REG_DWORD)
                 dwFlags = (dwFlags & ~0x0000FFFF) | ((dwValue & 0x0000FFFF) << 0);
@@ -569,7 +569,7 @@ static DWORD GetFindFlags(void)
 
         /* Retrieve ReactOS Regedit specific flags from registry key */
         cbData = sizeof(dwValue);
 
         /* Retrieve ReactOS Regedit specific flags from registry key */
         cbData = sizeof(dwValue);
-        if (RegQueryValueEx(hKey, s_szFindFlagsR, NULL, &dwType, (LPBYTE) &dwValue, &cbData) == ERROR_SUCCESS)
+        if (RegQueryValueExW(hKey, s_szFindFlagsR, NULL, &dwType, (LPBYTE) &dwValue, &cbData) == ERROR_SUCCESS)
         {
             if (dwType == REG_DWORD)
                 dwFlags = (dwFlags & ~0xFFFF0000) | ((dwValue & 0x0000FFFF) << 16);
         {
             if (dwType == REG_DWORD)
                 dwFlags = (dwFlags & ~0xFFFF0000) | ((dwValue & 0x0000FFFF) << 16);
@@ -586,13 +586,13 @@ static void SetFindFlags(DWORD dwFlags)
     DWORD dwDisposition;
     DWORD dwData;
 
     DWORD dwDisposition;
     DWORD dwData;
 
-    if (RegCreateKeyEx(HKEY_CURRENT_USER, g_szGeneralRegKey, 0, NULL, 0, KEY_ALL_ACCESS, NULL, &hKey, &dwDisposition) == ERROR_SUCCESS)
+    if (RegCreateKeyExW(HKEY_CURRENT_USER, g_szGeneralRegKey, 0, NULL, 0, KEY_ALL_ACCESS, NULL, &hKey, &dwDisposition) == ERROR_SUCCESS)
     {
         dwData = (dwFlags >> 0) & 0x0000FFFF;
     {
         dwData = (dwFlags >> 0) & 0x0000FFFF;
-        RegSetValueEx(hKey, s_szFindFlags, 0, REG_DWORD, (const BYTE *) &dwData, sizeof(dwData));
+        RegSetValueExW(hKey, s_szFindFlags, 0, REG_DWORD, (const BYTE *) &dwData, sizeof(dwData));
 
         dwData = (dwFlags >> 16) & 0x0000FFFF;
 
         dwData = (dwFlags >> 16) & 0x0000FFFF;
-        RegSetValueEx(hKey, s_szFindFlagsR, 0, REG_DWORD, (const BYTE *) &dwData, sizeof(dwData));
+        RegSetValueExW(hKey, s_szFindFlagsR, 0, REG_DWORD, (const BYTE *) &dwData, sizeof(dwData));
 
         RegCloseKey(hKey);
     }
 
         RegCloseKey(hKey);
     }
@@ -629,13 +629,13 @@ static INT_PTR CALLBACK AbortFindDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam,
 BOOL FindNext(HWND hWnd)
 {
     HKEY hKeyRoot;
 BOOL FindNext(HWND hWnd)
 {
     HKEY hKeyRoot;
-    LPCTSTR pszKeyPath;
+    LPCWSTR pszKeyPath;
     BOOL fSuccess;
     BOOL fSuccess;
-    TCHAR szFullKey[512];
-    LPCTSTR pszValueName;
-    LPTSTR pszFoundSubKey, pszFoundValueName;
+    WCHAR szFullKey[512];
+    LPCWSTR pszValueName;
+    LPWSTR pszFoundSubKey, pszFoundValueName;
 
 
-    if (_tcslen(s_szFindWhat) == 0)
+    if (wcslen(s_szFindWhat) == 0)
     {
         FindDialog(hWnd);
         return TRUE;
     {
         FindDialog(hWnd);
         return TRUE;
@@ -651,8 +651,8 @@ BOOL FindNext(HWND hWnd)
     }
 
     /* Create abort find dialog */
     }
 
     /* Create abort find dialog */
-    s_hwndAbortDialog = CreateDialog(GetModuleHandle(NULL),
-                                     MAKEINTRESOURCE(IDD_FINDING), hWnd, AbortFindDialogProc);
+    s_hwndAbortDialog = CreateDialogW(GetModuleHandle(NULL),
+                                     MAKEINTRESOURCEW(IDD_FINDING), hWnd, AbortFindDialogProc);
     if (s_hwndAbortDialog)
     {
         ShowWindow(s_hwndAbortDialog, SW_SHOW);
     if (s_hwndAbortDialog)
     {
         ShowWindow(s_hwndAbortDialog, SW_SHOW);
@@ -699,7 +699,7 @@ static INT_PTR CALLBACK FindDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR
     HWND hControl;
     LONG lStyle;
     DWORD dwFlags;
     HWND hControl;
     LONG lStyle;
     DWORD dwFlags;
-    static TCHAR s_szSavedFindValue[256];
+    static WCHAR s_szSavedFindValue[256];
 
     switch(uMsg)
     {
 
     switch(uMsg)
     {
@@ -708,32 +708,32 @@ static INT_PTR CALLBACK FindDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR
 
         hControl = GetDlgItem(hDlg, IDC_LOOKAT_KEYS);
         if (hControl)
 
         hControl = GetDlgItem(hDlg, IDC_LOOKAT_KEYS);
         if (hControl)
-            SendMessage(hControl, BM_SETCHECK, (dwFlags & RSF_LOOKATKEYS) ? TRUE : FALSE, 0);
+            SendMessageW(hControl, BM_SETCHECK, (dwFlags & RSF_LOOKATKEYS) ? TRUE : FALSE, 0);
 
         hControl = GetDlgItem(hDlg, IDC_LOOKAT_VALUES);
         if (hControl)
 
         hControl = GetDlgItem(hDlg, IDC_LOOKAT_VALUES);
         if (hControl)
-            SendMessage(hControl, BM_SETCHECK, (dwFlags & RSF_LOOKATVALUES) ? TRUE : FALSE, 0);
+            SendMessageW(hControl, BM_SETCHECK, (dwFlags & RSF_LOOKATVALUES) ? TRUE : FALSE, 0);
 
         hControl = GetDlgItem(hDlg, IDC_LOOKAT_DATA);
         if (hControl)
 
         hControl = GetDlgItem(hDlg, IDC_LOOKAT_DATA);
         if (hControl)
-            SendMessage(hControl, BM_SETCHECK, (dwFlags & RSF_LOOKATDATA) ? TRUE : FALSE, 0);
+            SendMessageW(hControl, BM_SETCHECK, (dwFlags & RSF_LOOKATDATA) ? TRUE : FALSE, 0);
 
         /* Match whole string */
         hControl = GetDlgItem(hDlg, IDC_MATCHSTRING);
         if (hControl)
 
         /* Match whole string */
         hControl = GetDlgItem(hDlg, IDC_MATCHSTRING);
         if (hControl)
-            SendMessage(hControl, BM_SETCHECK, (dwFlags & RSF_WHOLESTRING) ? TRUE : FALSE, 0);
+            SendMessageW(hControl, BM_SETCHECK, (dwFlags & RSF_WHOLESTRING) ? TRUE : FALSE, 0);
 
         /* Case sensitivity */
         hControl = GetDlgItem(hDlg, IDC_MATCHCASE);
         if (hControl)
 
         /* Case sensitivity */
         hControl = GetDlgItem(hDlg, IDC_MATCHCASE);
         if (hControl)
-            SendMessage(hControl, BM_SETCHECK, (dwFlags & RSF_MATCHCASE) ? TRUE : FALSE, 0);
+            SendMessageW(hControl, BM_SETCHECK, (dwFlags & RSF_MATCHCASE) ? TRUE : FALSE, 0);
 
         hControl = GetDlgItem(hDlg, IDC_FINDWHAT);
         if (hControl)
         {
 
         hControl = GetDlgItem(hDlg, IDC_FINDWHAT);
         if (hControl)
         {
-            SetWindowText(hControl, s_szSavedFindValue);
+            SetWindowTextW(hControl, s_szSavedFindValue);
             SetFocus(hControl);
             SetFocus(hControl);
-            SendMessage(hControl, EM_SETSEL, 0, -1);
+            SendMessageW(hControl, EM_SETSEL, 0, -1);
         }
         break;
 
         }
         break;
 
@@ -751,30 +751,30 @@ static INT_PTR CALLBACK FindDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR
                 dwFlags = 0;
 
                 hControl = GetDlgItem(hDlg, IDC_LOOKAT_KEYS);
                 dwFlags = 0;
 
                 hControl = GetDlgItem(hDlg, IDC_LOOKAT_KEYS);
-                if (hControl && (SendMessage(hControl, BM_GETCHECK, 0, 0) == BST_CHECKED))
+                if (hControl && (SendMessageW(hControl, BM_GETCHECK, 0, 0) == BST_CHECKED))
                     dwFlags |= RSF_LOOKATKEYS;
 
                 hControl = GetDlgItem(hDlg, IDC_LOOKAT_VALUES);
                     dwFlags |= RSF_LOOKATKEYS;
 
                 hControl = GetDlgItem(hDlg, IDC_LOOKAT_VALUES);
-                if (hControl && (SendMessage(hControl, BM_GETCHECK, 0, 0) == BST_CHECKED))
+                if (hControl && (SendMessageW(hControl, BM_GETCHECK, 0, 0) == BST_CHECKED))
                     dwFlags |= RSF_LOOKATVALUES;
 
                 hControl = GetDlgItem(hDlg, IDC_LOOKAT_DATA);
                     dwFlags |= RSF_LOOKATVALUES;
 
                 hControl = GetDlgItem(hDlg, IDC_LOOKAT_DATA);
-                if (hControl && (SendMessage(hControl, BM_GETCHECK, 0, 0) == BST_CHECKED))
+                if (hControl && (SendMessageW(hControl, BM_GETCHECK, 0, 0) == BST_CHECKED))
                     dwFlags |= RSF_LOOKATDATA;
 
                 hControl = GetDlgItem(hDlg, IDC_MATCHSTRING);
                     dwFlags |= RSF_LOOKATDATA;
 
                 hControl = GetDlgItem(hDlg, IDC_MATCHSTRING);
-                if (hControl && (SendMessage(hControl, BM_GETCHECK, 0, 0) == BST_CHECKED))
+                if (hControl && (SendMessageW(hControl, BM_GETCHECK, 0, 0) == BST_CHECKED))
                     dwFlags |= RSF_WHOLESTRING;
 
                 hControl = GetDlgItem(hDlg, IDC_MATCHCASE);
                     dwFlags |= RSF_WHOLESTRING;
 
                 hControl = GetDlgItem(hDlg, IDC_MATCHCASE);
-                if (hControl && (SendMessage(hControl, BM_GETCHECK, 0, 0) == BST_CHECKED))
+                if (hControl && (SendMessageW(hControl, BM_GETCHECK, 0, 0) == BST_CHECKED))
                     dwFlags |= RSF_MATCHCASE;
 
                 SetFindFlags(dwFlags);
 
                 hControl = GetDlgItem(hDlg, IDC_FINDWHAT);
                 if (hControl)
                     dwFlags |= RSF_MATCHCASE;
 
                 SetFindFlags(dwFlags);
 
                 hControl = GetDlgItem(hDlg, IDC_FINDWHAT);
                 if (hControl)
-                    GetWindowText(hControl, s_szFindWhat, COUNT_OF(s_szFindWhat));
+                    GetWindowTextW(hControl, s_szFindWhat, COUNT_OF(s_szFindWhat));
                 EndDialog(hDlg, 1);
                 break;
 
                 EndDialog(hDlg, 1);
                 break;
 
@@ -788,7 +788,7 @@ static INT_PTR CALLBACK FindDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR
             switch(LOWORD(wParam))
             {
             case IDC_FINDWHAT:
             switch(LOWORD(wParam))
             {
             case IDC_FINDWHAT:
-                GetWindowText((HWND) lParam, s_szSavedFindValue, COUNT_OF(s_szSavedFindValue));
+                GetWindowTextW((HWND) lParam, s_szSavedFindValue, COUNT_OF(s_szSavedFindValue));
                 hControl = GetDlgItem(hDlg, IDOK);
                 if (hControl)
                 {
                 hControl = GetDlgItem(hDlg, IDOK);
                 if (hControl)
                 {
@@ -810,16 +810,16 @@ static INT_PTR CALLBACK FindDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR
 
 void FindDialog(HWND hWnd)
 {
 
 void FindDialog(HWND hWnd)
 {
-    if (DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_FIND),
+    if (DialogBoxParamW(GetModuleHandle(NULL), MAKEINTRESOURCEW(IDD_FIND),
                        hWnd, FindDialogProc, 0) != 0)
     {
         if (!FindNext(hWnd))
         {
                        hWnd, FindDialogProc, 0) != 0)
     {
         if (!FindNext(hWnd))
         {
-            TCHAR msg[128], caption[128];
+            WCHAR msg[128], caption[128];
 
 
-            LoadString(hInst, IDS_FINISHEDFIND, msg, COUNT_OF(msg));
-            LoadString(hInst, IDS_APP_TITLE, caption, COUNT_OF(caption));
-            MessageBox(0, msg, caption, MB_ICONINFORMATION);
+            LoadStringW(hInst, IDS_FINISHEDFIND, msg, COUNT_OF(msg));
+            LoadStringW(hInst, IDS_APP_TITLE, caption, COUNT_OF(caption));
+            MessageBoxW(0, msg, caption, MB_ICONINFORMATION);
         }
     }
 }
         }
     }
 }
index 6ff1371..1f5023d 100644 (file)
@@ -26,7 +26,7 @@
 
 #define FAVORITES_MENU_POSITION 3
 
 
 #define FAVORITES_MENU_POSITION 3
 
-static TCHAR s_szFavoritesRegKey[] = _T("Software\\Microsoft\\Windows\\CurrentVersion\\Applets\\Regedit\\Favorites");
+static WCHAR s_szFavoritesRegKey[] = L"Software\\Microsoft\\Windows\\CurrentVersion\\Applets\\Regedit\\Favorites";
 
 static BOOL bInMenuLoop = FALSE;        /* Tells us if we are in the menu loop */
 
 
 static BOOL bInMenuLoop = FALSE;        /* Tells us if we are in the menu loop */
 
@@ -39,7 +39,7 @@ static void resize_frame_rect(HWND hWnd, PRECT prect)
     RECT rt;
     /*
        if (IsWindowVisible(hToolBar)) {
     RECT rt;
     /*
        if (IsWindowVisible(hToolBar)) {
-               SendMessage(hToolBar, WM_SIZE, 0, 0);
+               SendMessageW(hToolBar, WM_SIZE, 0, 0);
                GetClientRect(hToolBar, &rt);
                prect->top = rt.bottom+3;
                prect->bottom -= rt.bottom+3;
                GetClientRect(hToolBar, &rt);
                prect->top = rt.bottom+3;
                prect->bottom -= rt.bottom+3;
@@ -69,7 +69,7 @@ static void OnInitMenu(HWND hWnd)
     LONG lResult;
     HKEY hKey = NULL;
     DWORD dwIndex, cbValueName, cbValueData, dwType;
     LONG lResult;
     HKEY hKey = NULL;
     DWORD dwIndex, cbValueName, cbValueData, dwType;
-    TCHAR szValueName[256];
+    WCHAR szValueName[256];
     BYTE abValueData[256];
     static int s_nFavoriteMenuSubPos = -1;
     HMENU hMenu;
     BYTE abValueData[256];
     static int s_nFavoriteMenuSubPos = -1;
     HMENU hMenu;
@@ -89,7 +89,7 @@ static void OnInitMenu(HWND hWnd)
             ;
     }
 
             ;
     }
 
-    lResult = RegOpenKey(HKEY_CURRENT_USER, s_szFavoritesRegKey, &hKey);
+    lResult = RegOpenKeyW(HKEY_CURRENT_USER, s_szFavoritesRegKey, &hKey);
     if (lResult != ERROR_SUCCESS)
         goto done;
 
     if (lResult != ERROR_SUCCESS)
         goto done;
 
@@ -98,7 +98,7 @@ static void OnInitMenu(HWND hWnd)
     {
         cbValueName = COUNT_OF(szValueName);
         cbValueData = sizeof(abValueData);
     {
         cbValueName = COUNT_OF(szValueName);
         cbValueData = sizeof(abValueData);
-        lResult = RegEnumValue(hKey, dwIndex, szValueName, &cbValueName, NULL, &dwType, abValueData, &cbValueData);
+        lResult = RegEnumValueW(hKey, dwIndex, szValueName, &cbValueName, NULL, &dwType, abValueData, &cbValueData);
         if ((lResult == ERROR_SUCCESS) && (dwType == REG_SZ))
         {
             if (!bDisplayedAny)
         if ((lResult == ERROR_SUCCESS) && (dwType == REG_SZ))
         {
             if (!bDisplayedAny)
@@ -124,9 +124,9 @@ static void OnEnterMenuLoop(HWND hWnd)
 
     /* Update the status bar pane sizes */
     nParts = -1;
 
     /* Update the status bar pane sizes */
     nParts = -1;
-    SendMessage(hStatusBar, SB_SETPARTS, 1, (LPARAM)&nParts);
+    SendMessageW(hStatusBar, SB_SETPARTS, 1, (LPARAM)&nParts);
     bInMenuLoop = TRUE;
     bInMenuLoop = TRUE;
-    SendMessage(hStatusBar, SB_SETTEXT, (WPARAM)0, (LPARAM)_T(""));
+    SendMessageW(hStatusBar, SB_SETTEXTW, (WPARAM)0, (LPARAM)L"");
 }
 
 static void OnExitMenuLoop(HWND hWnd)
 }
 
 static void OnExitMenuLoop(HWND hWnd)
@@ -139,9 +139,9 @@ static void OnExitMenuLoop(HWND hWnd)
 
 static void OnMenuSelect(HWND hWnd, UINT nItemID, UINT nFlags, HMENU hSysMenu)
 {
 
 static void OnMenuSelect(HWND hWnd, UINT nItemID, UINT nFlags, HMENU hSysMenu)
 {
-    TCHAR str[100];
+    WCHAR str[100];
 
 
-    _tcscpy(str, _T(""));
+    wcscpy(str, L"");
     if (nFlags & MF_POPUP)
     {
         if (hSysMenu != GetMenu(hWnd))
     if (nFlags & MF_POPUP)
     {
         if (hSysMenu != GetMenu(hWnd))
@@ -149,16 +149,16 @@ static void OnMenuSelect(HWND hWnd, UINT nItemID, UINT nFlags, HMENU hSysMenu)
             if (nItemID == 2) nItemID = 5;
         }
     }
             if (nItemID == 2) nItemID = 5;
         }
     }
-    if (LoadString(hInst, nItemID, str, 100))
+    if (LoadStringW(hInst, nItemID, str, 100))
     {
         /* load appropriate string*/
     {
         /* load appropriate string*/
-        LPTSTR lpsz = str;
+        LPWSTR lpsz = str;
         /* first newline terminates actual string*/
         /* first newline terminates actual string*/
-        lpsz = _tcschr(lpsz, _T('\n'));
+        lpsz = wcschr(lpsz, L'\n');
         if (lpsz != NULL)
         if (lpsz != NULL)
-            *lpsz = '\0';
+            *lpsz = L'\0';
     }
     }
-    SendMessage(hStatusBar, SB_SETTEXT, 0, (LPARAM)str);
+    SendMessageW(hStatusBar, SB_SETTEXTW, 0, (LPARAM)str);
 }
 
 void SetupStatusBar(HWND hWnd, BOOL bResize)
 }
 
 void SetupStatusBar(HWND hWnd, BOOL bResize)
@@ -169,8 +169,8 @@ void SetupStatusBar(HWND hWnd, BOOL bResize)
     nParts = rc.right;
     /*    nParts = -1;*/
     if (bResize)
     nParts = rc.right;
     /*    nParts = -1;*/
     if (bResize)
-        SendMessage(hStatusBar, WM_SIZE, 0, 0);
-    SendMessage(hStatusBar, SB_SETPARTS, 1, (LPARAM)&nParts);
+        SendMessageW(hStatusBar, WM_SIZE, 0, 0);
+    SendMessageW(hStatusBar, SB_SETPARTS, 1, (LPARAM)&nParts);
 }
 
 void UpdateStatusBar(void)
 }
 
 void UpdateStatusBar(void)
@@ -178,7 +178,7 @@ void UpdateStatusBar(void)
     NMHDR nmhdr;
     ZeroMemory(&nmhdr, sizeof(NMHDR));
     nmhdr.code = TVN_SELCHANGED;
     NMHDR nmhdr;
     ZeroMemory(&nmhdr, sizeof(NMHDR));
     nmhdr.code = TVN_SELCHANGED;
-    SendMessage(g_pChildWnd->hWnd, WM_NOTIFY, (WPARAM)TREE_WINDOW, (LPARAM)&nmhdr);
+    SendMessageW(g_pChildWnd->hWnd, WM_NOTIFY, (WPARAM)TREE_WINDOW, (LPARAM)&nmhdr);
 }
 
 static void toggle_child(HWND hWnd, UINT cmd, HWND hchild)
 }
 
 static void toggle_child(HWND hWnd, UINT cmd, HWND hchild)
@@ -197,44 +197,44 @@ static BOOL CheckCommDlgError(HWND hWnd)
     UNREFERENCED_PARAMETER(hWnd);
     switch (dwErrorCode)
     {
     UNREFERENCED_PARAMETER(hWnd);
     switch (dwErrorCode)
     {
-    case CDERR_DIALOGFAILURE:
-        break;
-    case CDERR_FINDRESFAILURE:
-        break;
-    case CDERR_NOHINSTANCE:
-        break;
-    case CDERR_INITIALIZATION:
-        break;
-    case CDERR_NOHOOK:
-        break;
-    case CDERR_LOCKRESFAILURE:
-        break;
-    case CDERR_NOTEMPLATE:
-        break;
-    case CDERR_LOADRESFAILURE:
-        break;
-    case CDERR_STRUCTSIZE:
-        break;
-    case CDERR_LOADSTRFAILURE:
-        break;
-    case FNERR_BUFFERTOOSMALL:
-        break;
-    case CDERR_MEMALLOCFAILURE:
-        break;
-    case FNERR_INVALIDFILENAME:
-        break;
-    case CDERR_MEMLOCKFAILURE:
-        break;
-    case FNERR_SUBCLASSFAILURE:
-        break;
-    default:
-        break;
+        case CDERR_DIALOGFAILURE:
+            break;
+        case CDERR_FINDRESFAILURE:
+            break;
+        case CDERR_NOHINSTANCE:
+            break;
+        case CDERR_INITIALIZATION:
+            break;
+        case CDERR_NOHOOK:
+            break;
+        case CDERR_LOCKRESFAILURE:
+            break;
+        case CDERR_NOTEMPLATE:
+            break;
+        case CDERR_LOADRESFAILURE:
+            break;
+        case CDERR_STRUCTSIZE:
+            break;
+        case CDERR_LOADSTRFAILURE:
+            break;
+        case FNERR_BUFFERTOOSMALL:
+            break;
+        case CDERR_MEMALLOCFAILURE:
+            break;
+        case FNERR_INVALIDFILENAME:
+            break;
+        case CDERR_MEMLOCKFAILURE:
+            break;
+        case FNERR_SUBCLASSFAILURE:
+            break;
+        default:
+            break;
     }
     return TRUE;
 }
 
     }
     return TRUE;
 }
 
-TCHAR FileNameBuffer[_MAX_PATH];
-TCHAR FileTitleBuffer[_MAX_PATH];
+WCHAR FileNameBuffer[_MAX_PATH];
+WCHAR FileTitleBuffer[_MAX_PATH];
 
 typedef struct
 {
 
 typedef struct
 {
@@ -243,25 +243,25 @@ typedef struct
 } FILTERPAIR, *PFILTERPAIR;
 
 void
 } FILTERPAIR, *PFILTERPAIR;
 
 void
-BuildFilterStrings(TCHAR *Filter, PFILTERPAIR Pairs, int PairCount)
+BuildFilterStrings(WCHAR *Filter, PFILTERPAIR Pairs, int PairCount)
 {
     int i, c;
 
     c = 0;
     for(i = 0; i < PairCount; i++)
     {
 {
     int i, c;
 
     c = 0;
     for(i = 0; i < PairCount; i++)
     {
-        c += LoadString(hInst, Pairs[i].DisplayID, &Filter[c], 255 * sizeof(TCHAR));
-        Filter[++c] = '\0';
-        c += LoadString(hInst, Pairs[i].FilterID, &Filter[c], 255 * sizeof(TCHAR));
-        Filter[++c] = '\0';
+        c += LoadStringW(hInst, Pairs[i].DisplayID, &Filter[c], 255 * sizeof(WCHAR));
+        Filter[++c] = L'\0';
+        c += LoadStringW(hInst, Pairs[i].FilterID, &Filter[c], 255 * sizeof(WCHAR));
+        Filter[++c] = L'\0';
     }
     }
-    Filter[++c] = '\0';
+    Filter[++c] = L'\0';
 }
 
 static BOOL InitOpenFileName(HWND hWnd, OPENFILENAME* pofn)
 {
     FILTERPAIR FilterPairs[4];
 }
 
 static BOOL InitOpenFileName(HWND hWnd, OPENFILENAME* pofn)
 {
     FILTERPAIR FilterPairs[4];
-    static TCHAR Filter[1024];
+    static WCHAR Filter[1024];
 
     memset(pofn, 0, sizeof(OPENFILENAME));
     pofn->lStructSize = sizeof(OPENFILENAME);
 
     memset(pofn, 0, sizeof(OPENFILENAME));
     pofn->lStructSize = sizeof(OPENFILENAME);
@@ -285,24 +285,24 @@ static BOOL InitOpenFileName(HWND hWnd, OPENFILENAME* pofn)
     pofn->lpstrFileTitle = FileTitleBuffer;
     pofn->nMaxFileTitle = _MAX_PATH;
     pofn->Flags = OFN_HIDEREADONLY;
     pofn->lpstrFileTitle = FileTitleBuffer;
     pofn->nMaxFileTitle = _MAX_PATH;
     pofn->Flags = OFN_HIDEREADONLY;
-    pofn->lpstrDefExt = TEXT("reg");
+    pofn->lpstrDefExt = L"reg";
     return TRUE;
 }
 
 static INT_PTR CALLBACK LoadHive_KeyNameInHookProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
     return TRUE;
 }
 
 static INT_PTR CALLBACK LoadHive_KeyNameInHookProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
-    static LPTSTR sKey = NULL;
+    static LPWSTR sKey = NULL;
     static INT sLength = 0;
     switch(uMsg)
     {
     case WM_INITDIALOG:
     static INT sLength = 0;
     switch(uMsg)
     {
     case WM_INITDIALOG:
-        sKey = (LPTSTR)lParam;
+        sKey = (LPWSTR)lParam;
         sLength = 128; /* FIXME: Ugly hack! */
     case WM_COMMAND:
         switch(LOWORD(wParam))
         {
         case IDOK:
         sLength = 128; /* FIXME: Ugly hack! */
     case WM_COMMAND:
         switch(LOWORD(wParam))
         {
         case IDOK:
-            if(GetDlgItemText(hWndDlg, IDC_EDIT_KEY, sKey, sLength))
+            if(GetDlgItemTextW(hWndDlg, IDC_EDIT_KEY, sKey, sLength))
                 return EndDialog(hWndDlg, -1);
             else
                 return EndDialog(hWndDlg, 0);
                 return EndDialog(hWndDlg, -1);
             else
                 return EndDialog(hWndDlg, 0);
@@ -314,7 +314,7 @@ static INT_PTR CALLBACK LoadHive_KeyNameInHookProc(HWND hWndDlg, UINT uMsg, WPAR
     return FALSE;
 }
 
     return FALSE;
 }
 
-static BOOL EnablePrivilege(LPCTSTR lpszPrivilegeName, LPCTSTR lpszSystemName, BOOL bEnablePrivilege)
+static BOOL EnablePrivilege(LPCWSTR lpszPrivilegeName, LPCWSTR lpszSystemName, BOOL bEnablePrivilege)
 {
     BOOL   bRet   = FALSE;
     HANDLE hToken = NULL;
 {
     BOOL   bRet   = FALSE;
     HANDLE hToken = NULL;
@@ -328,9 +328,9 @@ static BOOL EnablePrivilege(LPCTSTR lpszPrivilegeName, LPCTSTR lpszSystemName, B
         tp.PrivilegeCount = 1;
         tp.Privileges[0].Attributes = (bEnablePrivilege ? SE_PRIVILEGE_ENABLED : 0);
 
         tp.PrivilegeCount = 1;
         tp.Privileges[0].Attributes = (bEnablePrivilege ? SE_PRIVILEGE_ENABLED : 0);
 
-        if (LookupPrivilegeValue(lpszSystemName,
-                                 lpszPrivilegeName,
-                                 &tp.Privileges[0].Luid))
+        if (LookupPrivilegeValueW(lpszSystemName,
+                                  lpszPrivilegeName,
+                                  &tp.Privileges[0].Luid))
         {
             bRet = AdjustTokenPrivileges(hToken, FALSE, &tp, 0, NULL, NULL);
 
         {
             bRet = AdjustTokenPrivileges(hToken, FALSE, &tp, 0, NULL, NULL);
 
@@ -347,11 +347,11 @@ static BOOL EnablePrivilege(LPCTSTR lpszPrivilegeName, LPCTSTR lpszSystemName, B
 static BOOL LoadHive(HWND hWnd)
 {
     OPENFILENAME ofn;
 static BOOL LoadHive(HWND hWnd)
 {
     OPENFILENAME ofn;
-    TCHAR Caption[128];
-    LPCTSTR pszKeyPath;
-    TCHAR xPath[128];
+    WCHAR Caption[128];
+    LPCWSTR pszKeyPath;
+    WCHAR xPath[128];
     HKEY hRootKey;
     HKEY hRootKey;
-    TCHAR Filter[1024];
+    WCHAR Filter[1024];
     FILTERPAIR filter;
     /* get the item key to load the hive in */
     pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hRootKey);
     FILTERPAIR filter;
     /* get the item key to load the hive in */
     pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hRootKey);
@@ -363,20 +363,20 @@ static BOOL LoadHive(HWND hWnd)
     BuildFilterStrings(Filter, &filter, sizeof(filter));
     ofn.lpstrFilter = Filter;
     /* load and set the caption and flags for dialog */
     BuildFilterStrings(Filter, &filter, sizeof(filter));
     ofn.lpstrFilter = Filter;
     /* load and set the caption and flags for dialog */
-    LoadString(hInst, IDS_LOAD_HIVE, Caption, COUNT_OF(Caption));
+    LoadStringW(hInst, IDS_LOAD_HIVE, Caption, COUNT_OF(Caption));
     ofn.lpstrTitle = Caption;
     ofn.Flags |= OFN_ENABLESIZING;
     /*    ofn.lCustData = ;*/
     /* now load the hive */
     if (GetOpenFileName(&ofn))
     {
     ofn.lpstrTitle = Caption;
     ofn.Flags |= OFN_ENABLESIZING;
     /*    ofn.lCustData = ;*/
     /* now load the hive */
     if (GetOpenFileName(&ofn))
     {
-        if(DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_LOADHIVE), hWnd, &LoadHive_KeyNameInHookProc, (LPARAM)xPath))
+        if(DialogBoxParamW(hInst, MAKEINTRESOURCEW(IDD_LOADHIVE), hWnd, &LoadHive_KeyNameInHookProc, (LPARAM)xPath))
         {
             LONG regLoadResult;
 
             /* Enable the 'restore' privilege, load the hive, disable the privilege */
             EnablePrivilege(SE_RESTORE_NAME, NULL, TRUE);
         {
             LONG regLoadResult;
 
             /* Enable the 'restore' privilege, load the hive, disable the privilege */
             EnablePrivilege(SE_RESTORE_NAME, NULL, TRUE);
-            regLoadResult = RegLoadKey(hRootKey, xPath, ofn.lpstrFile);
+            regLoadResult = RegLoadKeyW(hRootKey, xPath, ofn.lpstrFile);
             EnablePrivilege(SE_RESTORE_NAME, NULL, FALSE);
 
             if(regLoadResult == ERROR_SUCCESS)
             EnablePrivilege(SE_RESTORE_NAME, NULL, FALSE);
 
             if(regLoadResult == ERROR_SUCCESS)
@@ -402,19 +402,19 @@ static BOOL LoadHive(HWND hWnd)
 
 static BOOL UnloadHive(HWND hWnd)
 {
 
 static BOOL UnloadHive(HWND hWnd)
 {
-    TCHAR Caption[128];
-    LPCTSTR pszKeyPath;
+    WCHAR Caption[128];
+    LPCWSTR pszKeyPath;
     HKEY hRootKey;
     LONG regUnloadResult;
 
     /* get the item key to unload */
     pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hRootKey);
     /* load and set the caption and flags for dialog */
     HKEY hRootKey;
     LONG regUnloadResult;
 
     /* get the item key to unload */
     pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hRootKey);
     /* load and set the caption and flags for dialog */
-    LoadString(hInst, IDS_UNLOAD_HIVE, Caption, COUNT_OF(Caption));
+    LoadStringW(hInst, IDS_UNLOAD_HIVE, Caption, COUNT_OF(Caption));
 
     /* Enable the 'restore' privilege, unload the hive, disable the privilege */
     EnablePrivilege(SE_RESTORE_NAME, NULL, TRUE);
 
     /* Enable the 'restore' privilege, unload the hive, disable the privilege */
     EnablePrivilege(SE_RESTORE_NAME, NULL, TRUE);
-    regUnloadResult = RegUnLoadKey(hRootKey, pszKeyPath);
+    regUnloadResult = RegUnLoadKeyW(hRootKey, pszKeyPath);
     EnablePrivilege(SE_RESTORE_NAME, NULL, FALSE);
 
     if(regUnloadResult == ERROR_SUCCESS)
     EnablePrivilege(SE_RESTORE_NAME, NULL, FALSE);
 
     if(regUnloadResult == ERROR_SUCCESS)
@@ -436,15 +436,15 @@ static BOOL ImportRegistryFile(HWND hWnd)
 {
     BOOL bRet = FALSE;
     OPENFILENAME ofn;
 {
     BOOL bRet = FALSE;
     OPENFILENAME ofn;
-    TCHAR Caption[128], szTitle[256], szText[256];
+    WCHAR Caption[128], szTitle[256], szText[256];
     HKEY hKeyRoot;
     HKEY hKeyRoot;
-    LPCTSTR pszKeyPath;
+    LPCWSTR pszKeyPath;
 
     /* Figure out in which key path we are importing */
     pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
 
     InitOpenFileName(hWnd, &ofn);
 
     /* Figure out in which key path we are importing */
     pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
 
     InitOpenFileName(hWnd, &ofn);
-    LoadString(hInst, IDS_IMPORT_REG_FILE, Caption, COUNT_OF(Caption));
+    LoadStringW(hInst, IDS_IMPORT_REG_FILE, Caption, COUNT_OF(Caption));
     ofn.lpstrTitle = Caption;
     ofn.Flags |= OFN_ENABLESIZING;
     /*    ofn.lCustData = ;*/
     ofn.lpstrTitle = Caption;
     ofn.Flags |= OFN_ENABLESIZING;
     /*    ofn.lCustData = ;*/
@@ -452,7 +452,7 @@ static BOOL ImportRegistryFile(HWND hWnd)
     {
         /* Look at the extension of the file to determine its type */
         if (ofn.nFileExtension >= 1 &&
     {
         /* Look at the extension of the file to determine its type */
         if (ofn.nFileExtension >= 1 &&
-            _tcsicmp(ofn.lpstrFile + ofn.nFileExtension, TEXT("reg")) == 0) /* REGEDIT4 or Windows Registry Editor Version 5.00 */
+            wcsicmp(ofn.lpstrFile + ofn.nFileExtension, L"reg") == 0) /* REGEDIT4 or Windows Registry Editor Version 5.00 */
         {
             /* Open the file */
             FILE *fp = _wfopen(ofn.lpstrFile, L"r");
         {
             /* Open the file */
             FILE *fp = _wfopen(ofn.lpstrFile, L"r");
@@ -461,16 +461,16 @@ static BOOL ImportRegistryFile(HWND hWnd)
             if (fp == NULL || !import_registry_file(fp))
             {
                 LPSTR p = GetMultiByteString(ofn.lpstrFile);
             if (fp == NULL || !import_registry_file(fp))
             {
                 LPSTR p = GetMultiByteString(ofn.lpstrFile);
-                fprintf(stderr, "Can't open file \"%s\"\n", p);
+                fwprintf(stderr, L"Can't open file \"%s\"\n", p);
                 HeapFree(GetProcessHeap(), 0, p);
                 bRet = FALSE;
             }
             else
             {
                 /* Show successful import */
                 HeapFree(GetProcessHeap(), 0, p);
                 bRet = FALSE;
             }
             else
             {
                 /* Show successful import */
-                LoadString(hInst, IDS_APP_TITLE, szTitle, COUNT_OF(szTitle));
-                LoadString(hInst, IDS_IMPORT_OK, szText, COUNT_OF(szText));
-                MessageBox(NULL, szText, szTitle, MB_OK);
+                LoadStringW(hInst, IDS_APP_TITLE, szTitle, COUNT_OF(szTitle));
+                LoadStringW(hInst, IDS_IMPORT_OK, szText, COUNT_OF(szText));
+                MessageBoxW(NULL, szText, szTitle, MB_OK);
                 bRet = TRUE;
             }
 
                 bRet = TRUE;
             }
 
@@ -479,17 +479,17 @@ static BOOL ImportRegistryFile(HWND hWnd)
         }
         else /* Registry Hive Files */
         {
         }
         else /* Registry Hive Files */
         {
-            LoadString(hInst, IDS_QUERY_IMPORT_HIVE_CAPTION, szTitle, COUNT_OF(szTitle));
-            LoadString(hInst, IDS_QUERY_IMPORT_HIVE_MSG, szText, COUNT_OF(szText));
+            LoadStringW(hInst, IDS_QUERY_IMPORT_HIVE_CAPTION, szTitle, COUNT_OF(szTitle));
+            LoadStringW(hInst, IDS_QUERY_IMPORT_HIVE_MSG, szText, COUNT_OF(szText));
 
             /* Display a confirmation message */
 
             /* Display a confirmation message */
-            if (MessageBox(g_pChildWnd->hWnd, szText, szTitle, MB_ICONWARNING | MB_YESNO) == IDYES)
+            if (MessageBoxW(g_pChildWnd->hWnd, szText, szTitle, MB_ICONWARNING | MB_YESNO) == IDYES)
             {
                 LONG lResult;
                 HKEY hSubKey;
 
                 /* Open the subkey */
             {
                 LONG lResult;
                 HKEY hSubKey;
 
                 /* Open the subkey */
-                lResult = RegOpenKeyEx(hKeyRoot, pszKeyPath, 0, KEY_WRITE, &hSubKey);
+                lResult = RegOpenKeyExW(hKeyRoot, pszKeyPath, 0, KEY_WRITE, &hSubKey);
                 if (lResult == ERROR_SUCCESS)
                 {
                     /* Enable the 'restore' privilege, restore the hive then disable the privilege */
                 if (lResult == ERROR_SUCCESS)
                 {
                     /* Enable the 'restore' privilege, restore the hive then disable the privilege */
@@ -530,7 +530,7 @@ static UINT_PTR CALLBACK ExportRegistryFile_OFNHookProc(HWND hdlg, UINT uiMsg, W
     HWND hwndExportBranchText;
     UINT_PTR iResult = 0;
     OPENFILENAME *pOfn;
     HWND hwndExportBranchText;
     UINT_PTR iResult = 0;
     OPENFILENAME *pOfn;
-    LPTSTR pszSelectedKey;
+    LPWSTR pszSelectedKey;
     OFNOTIFY *pOfnNotify;
 
     UNREFERENCED_PARAMETER(wParam);
     OFNOTIFY *pOfnNotify;
 
     UNREFERENCED_PARAMETER(wParam);
@@ -539,37 +539,37 @@ static UINT_PTR CALLBACK ExportRegistryFile_OFNHookProc(HWND hdlg, UINT uiMsg, W
     {
     case WM_INITDIALOG:
         pOfn = (OPENFILENAME *) lParam;
     {
     case WM_INITDIALOG:
         pOfn = (OPENFILENAME *) lParam;
-        pszSelectedKey = (LPTSTR) pOfn->lCustData;
+        pszSelectedKey = (LPWSTR) pOfn->lCustData;
 
         hwndExportAll = GetDlgItem(hdlg, IDC_EXPORT_ALL);
         if (hwndExportAll)
 
         hwndExportAll = GetDlgItem(hdlg, IDC_EXPORT_ALL);
         if (hwndExportAll)
-            SendMessage(hwndExportAll, BM_SETCHECK, pszSelectedKey ? BST_UNCHECKED : BST_CHECKED, 0);
+            SendMessageW(hwndExportAll, BM_SETCHECK, pszSelectedKey ? BST_UNCHECKED : BST_CHECKED, 0);
 
         hwndExportBranch = GetDlgItem(hdlg, IDC_EXPORT_BRANCH);
         if (hwndExportBranch)
 
         hwndExportBranch = GetDlgItem(hdlg, IDC_EXPORT_BRANCH);
         if (hwndExportBranch)
-            SendMessage(hwndExportBranch, BM_SETCHECK, pszSelectedKey ? BST_CHECKED : BST_UNCHECKED, 0);
+            SendMessageW(hwndExportBranch, BM_SETCHECK, pszSelectedKey ? BST_CHECKED : BST_UNCHECKED, 0);
 
         hwndExportBranchText = GetDlgItem(hdlg, IDC_EXPORT_BRANCH_TEXT);
         if (hwndExportBranchText)
 
         hwndExportBranchText = GetDlgItem(hdlg, IDC_EXPORT_BRANCH_TEXT);
         if (hwndExportBranchText)
-            SetWindowText(hwndExportBranchText, pszSelectedKey);
+            SetWindowTextW(hwndExportBranchText, pszSelectedKey);
         break;
 
     case WM_NOTIFY:
         if (((NMHDR *) lParam)->code == CDN_FILEOK)
         {
             pOfnNotify = (OFNOTIFY *) lParam;
         break;
 
     case WM_NOTIFY:
         if (((NMHDR *) lParam)->code == CDN_FILEOK)
         {
             pOfnNotify = (OFNOTIFY *) lParam;
-            pszSelectedKey = (LPTSTR) pOfnNotify->lpOFN->lCustData;
+            pszSelectedKey = (LPWSTR) pOfnNotify->lpOFN->lCustData;
 
             hwndExportBranch = GetDlgItem(hdlg, IDC_EXPORT_BRANCH);
             hwndExportBranchText = GetDlgItem(hdlg, IDC_EXPORT_BRANCH_TEXT);
             if (hwndExportBranch && hwndExportBranchText
 
             hwndExportBranch = GetDlgItem(hdlg, IDC_EXPORT_BRANCH);
             hwndExportBranchText = GetDlgItem(hdlg, IDC_EXPORT_BRANCH_TEXT);
             if (hwndExportBranch && hwndExportBranchText
-                    && (SendMessage(hwndExportBranch, BM_GETCHECK, 0, 0) == BST_CHECKED))
+                    && (SendMessageW(hwndExportBranch, BM_GETCHECK, 0, 0) == BST_CHECKED))
             {
             {
-                GetWindowText(hwndExportBranchText, pszSelectedKey, _MAX_PATH);
+                GetWindowTextW(hwndExportBranchText, pszSelectedKey, _MAX_PATH);
             }
             else
             {
             }
             else
             {
-                pszSelectedKey[0] = '\0';
+                pszSelectedKey[0] = L'\0';
             }
         }
         break;
             }
         }
         break;
@@ -581,17 +581,17 @@ BOOL ExportRegistryFile(HWND hWnd)
 {
     BOOL bRet = FALSE;
     OPENFILENAME ofn;
 {
     BOOL bRet = FALSE;
     OPENFILENAME ofn;
-    TCHAR ExportKeyPath[_MAX_PATH];
-    TCHAR Caption[128];
+    WCHAR ExportKeyPath[_MAX_PATH];
+    WCHAR Caption[128];
     HKEY hKeyRoot;
     HKEY hKeyRoot;
-    LPCTSTR pszKeyPath;
+    LPCWSTR pszKeyPath;
 
     /* Figure out which key path we are exporting */
     pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
     GetKeyName(ExportKeyPath, COUNT_OF(ExportKeyPath), hKeyRoot, pszKeyPath);
 
     InitOpenFileName(hWnd, &ofn);
 
     /* Figure out which key path we are exporting */
     pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
     GetKeyName(ExportKeyPath, COUNT_OF(ExportKeyPath), hKeyRoot, pszKeyPath);
 
     InitOpenFileName(hWnd, &ofn);
-    LoadString(hInst, IDS_EXPORT_REG_FILE, Caption, COUNT_OF(Caption));
+    LoadStringW(hInst, IDS_EXPORT_REG_FILE, Caption, COUNT_OF(Caption));
     ofn.lpstrTitle = Caption;
 
     /* Only set the path if a key (not the root node) is selected */
     ofn.lpstrTitle = Caption;
 
     /* Only set the path if a key (not the root node) is selected */
@@ -601,7 +601,7 @@ BOOL ExportRegistryFile(HWND hWnd)
     }
     ofn.Flags = OFN_ENABLETEMPLATE | OFN_EXPLORER | OFN_ENABLEHOOK | OFN_OVERWRITEPROMPT;
     ofn.lpfnHook = ExportRegistryFile_OFNHookProc;
     }
     ofn.Flags = OFN_ENABLETEMPLATE | OFN_EXPLORER | OFN_ENABLEHOOK | OFN_OVERWRITEPROMPT;
     ofn.lpfnHook = ExportRegistryFile_OFNHookProc;
-    ofn.lpTemplateName = MAKEINTRESOURCE(IDD_EXPORTRANGE);
+    ofn.lpTemplateName = MAKEINTRESOURCEW(IDD_EXPORTRANGE);
     if (GetSaveFileName(&ofn))
     {
         switch (ofn.nFilterIndex)
     if (GetSaveFileName(&ofn))
     {
         switch (ofn.nFilterIndex)
@@ -612,22 +612,22 @@ BOOL ExportRegistryFile(HWND hWnd)
                 HKEY hSubKey;
 
                 /* Open the subkey */
                 HKEY hSubKey;
 
                 /* Open the subkey */
-                lResult = RegOpenKeyEx(hKeyRoot, pszKeyPath, 0, KEY_READ, &hSubKey);
+                lResult = RegOpenKeyExW(hKeyRoot, pszKeyPath, 0, KEY_READ, &hSubKey);
                 if (lResult == ERROR_SUCCESS)
                 {
                     /* Enable the 'backup' privilege, save the hive then disable the privilege */
                     EnablePrivilege(SE_BACKUP_NAME, NULL, TRUE);
                 if (lResult == ERROR_SUCCESS)
                 {
                     /* Enable the 'backup' privilege, save the hive then disable the privilege */
                     EnablePrivilege(SE_BACKUP_NAME, NULL, TRUE);
-                    lResult = RegSaveKey(hSubKey, ofn.lpstrFile, NULL);
+                    lResult = RegSaveKeyW(hSubKey, ofn.lpstrFile, NULL);
                     if (lResult == ERROR_ALREADY_EXISTS)
                     {
                         /*
                          * We are here, that means that we already said "yes" to the confirmation dialog.
                          * So we absolutely want to replace the hive file.
                          */
                     if (lResult == ERROR_ALREADY_EXISTS)
                     {
                         /*
                          * We are here, that means that we already said "yes" to the confirmation dialog.
                          * So we absolutely want to replace the hive file.
                          */
-                        if (DeleteFile(ofn.lpstrFile))
+                        if (DeleteFileW(ofn.lpstrFile))
                         {
                             /* Try again */
                         {
                             /* Try again */
-                            lResult = RegSaveKey(hSubKey, ofn.lpstrFile, NULL);
+                            lResult = RegSaveKeyW(hSubKey, ofn.lpstrFile, NULL);
                         }
                     }
                     EnablePrivilege(SE_BACKUP_NAME, NULL, FALSE);
                         }
                     }
                     EnablePrivilege(SE_BACKUP_NAME, NULL, FALSE);
@@ -635,12 +635,12 @@ BOOL ExportRegistryFile(HWND hWnd)
                     if (lResult != ERROR_SUCCESS)
                     {
                         /*
                     if (lResult != ERROR_SUCCESS)
                     {
                         /*
-                         * If we are here, it's because RegSaveKey has failed for any reason.
+                         * If we are here, it's because RegSaveKeyW has failed for any reason.
                          * The problem is that even if it has failed, it has created or
                          * replaced the exported hive file with a new empty file. We don't
                          * want to keep this file, so we delete it.
                          */
                          * The problem is that even if it has failed, it has created or
                          * replaced the exported hive file with a new empty file. We don't
                          * want to keep this file, so we delete it.
                          */
-                        DeleteFile(ofn.lpstrFile);
+                        DeleteFileW(ofn.lpstrFile);
                     }
 
                     /* Close the subkey */
                     }
 
                     /* Close the subkey */
@@ -665,7 +665,7 @@ BOOL ExportRegistryFile(HWND hWnd)
                                                                 : REG_FORMAT_5)))
                 {
                     LPSTR p = GetMultiByteString(ofn.lpstrFile);
                                                                 : REG_FORMAT_5)))
                 {
                     LPSTR p = GetMultiByteString(ofn.lpstrFile);
-                    fprintf(stderr, "Can't open file \"%s\"\n", p);
+                    fwprintf(stderr, L"Can't open file \"%s\"\n", p);
                     HeapFree(GetProcessHeap(), 0, p);
                     bRet = FALSE;
                 }
                     HeapFree(GetProcessHeap(), 0, p);
                     bRet = FALSE;
                 }
@@ -686,7 +686,7 @@ BOOL ExportRegistryFile(HWND hWnd)
     return bRet;
 }
 
     return bRet;
 }
 
-BOOL PrintRegistryHive(HWND hWnd, LPTSTR path)
+BOOL PrintRegistryHive(HWND hWnd, LPWSTR path)
 {
 #if 1
     PRINTDLG pd;
 {
 #if 1
     PRINTDLG pd;
@@ -758,18 +758,18 @@ BOOL PrintRegistryHive(HWND hWnd, LPTSTR path)
     return TRUE;
 }
 
     return TRUE;
 }
 
-static void ChooseFavorite(LPCTSTR pszFavorite)
+static void ChooseFavorite(LPCWSTR pszFavorite)
 {
     HKEY hKey = NULL;
 {
     HKEY hKey = NULL;
-    TCHAR szFavoritePath[512];
+    WCHAR szFavoritePath[512];
     DWORD cbData, dwType;
 
     DWORD cbData, dwType;
 
-    if (RegOpenKeyEx(HKEY_CURRENT_USER, s_szFavoritesRegKey, 0, KEY_QUERY_VALUE, &hKey) != ERROR_SUCCESS)
+    if (RegOpenKeyExW(HKEY_CURRENT_USER, s_szFavoritesRegKey, 0, KEY_QUERY_VALUE, &hKey) != ERROR_SUCCESS)
         goto done;
 
     cbData = (sizeof(szFavoritePath) / sizeof(szFavoritePath[0])) - 1;
     memset(szFavoritePath, 0, sizeof(szFavoritePath));
         goto done;
 
     cbData = (sizeof(szFavoritePath) / sizeof(szFavoritePath[0])) - 1;
     memset(szFavoritePath, 0, sizeof(szFavoritePath));
-    if (RegQueryValueEx(hKey, pszFavorite, NULL, &dwType, (LPBYTE) szFavoritePath, &cbData) != ERROR_SUCCESS)
+    if (RegQueryValueExW(hKey, pszFavorite, NULL, &dwType, (LPBYTE) szFavoritePath, &cbData) != ERROR_SUCCESS)
         goto done;
 
     if (dwType == REG_SZ)
         goto done;
 
     if (dwType == REG_SZ)
@@ -780,13 +780,13 @@ done:
         RegCloseKey(hKey);
 }
 
         RegCloseKey(hKey);
 }
 
-BOOL CopyKeyName(HWND hWnd, HKEY hRootKey, LPCTSTR keyName)
+BOOL CopyKeyName(HWND hWnd, HKEY hRootKey, LPCWSTR keyName)
 {
     BOOL bClipboardOpened = FALSE;
     BOOL bSuccess = FALSE;
 {
     BOOL bClipboardOpened = FALSE;
     BOOL bSuccess = FALSE;
-    TCHAR szBuffer[512];
+    WCHAR szBuffer[512];
     HGLOBAL hGlobal;
     HGLOBAL hGlobal;
-    LPTSTR s;
+    LPWSTR s;
 
     if (!OpenClipboard(hWnd))
         goto done;
 
     if (!OpenClipboard(hWnd))
         goto done;
@@ -798,19 +798,15 @@ BOOL CopyKeyName(HWND hWnd, HKEY hRootKey, LPCTSTR keyName)
     if (!GetKeyName(szBuffer, COUNT_OF(szBuffer), hRootKey, keyName))
         goto done;
 
     if (!GetKeyName(szBuffer, COUNT_OF(szBuffer), hRootKey, keyName))
         goto done;
 
-    hGlobal = GlobalAlloc(GMEM_MOVEABLE, (lstrlen(szBuffer) + 1) * sizeof(TCHAR));
+    hGlobal = GlobalAlloc(GMEM_MOVEABLE, (wcslen(szBuffer) + 1) * sizeof(WCHAR));
     if (!hGlobal)
         goto done;
 
     s = GlobalLock(hGlobal);
     if (!hGlobal)
         goto done;
 
     s = GlobalLock(hGlobal);
-    _tcscpy(s, szBuffer);
+    wcscpy(s, szBuffer);
     GlobalUnlock(hGlobal);
 
     GlobalUnlock(hGlobal);
 
-#ifdef UNICODE
     SetClipboardData(CF_UNICODETEXT, hGlobal);
     SetClipboardData(CF_UNICODETEXT, hGlobal);
-#else
-    SetClipboardData(CF_TEXT, hGlobal);
-#endif
     bSuccess = TRUE;
 
 done:
     bSuccess = TRUE;
 
 done:
@@ -819,10 +815,10 @@ done:
     return bSuccess;
 }
 
     return bSuccess;
 }
 
-static BOOL CreateNewValue(HKEY hRootKey, LPCTSTR pszKeyPath, DWORD dwType)
+static BOOL CreateNewValue(HKEY hRootKey, LPCWSTR pszKeyPath, DWORD dwType)
 {
 {
-    TCHAR szNewValueFormat[128];
-    TCHAR szNewValue[128];
+    WCHAR szNewValueFormat[128];
+    WCHAR szNewValue[128];
     int iIndex = 1;
     BYTE data[128];
     DWORD dwExistingType, cbData;
     int iIndex = 1;
     BYTE data[128];
     DWORD dwExistingType, cbData;
@@ -830,41 +826,41 @@ static BOOL CreateNewValue(HKEY hRootKey, LPCTSTR pszKeyPath, DWORD dwType)
     HKEY hKey;
     LVFINDINFO lvfi;
 
     HKEY hKey;
     LVFINDINFO lvfi;
 
-    if (RegOpenKeyEx(hRootKey, pszKeyPath, 0, KEY_QUERY_VALUE | KEY_SET_VALUE,
-                     &hKey) != ERROR_SUCCESS)
+    if (RegOpenKeyExW(hRootKey, pszKeyPath, 0, KEY_QUERY_VALUE | KEY_SET_VALUE,
+                      &hKey) != ERROR_SUCCESS)
         return FALSE;
 
         return FALSE;
 
-    LoadString(hInst, IDS_NEW_VALUE, szNewValueFormat, COUNT_OF(szNewValueFormat));
+    LoadStringW(hInst, IDS_NEW_VALUE, szNewValueFormat, COUNT_OF(szNewValueFormat));
 
     do
     {
         wsprintf(szNewValue, szNewValueFormat, iIndex++);
         cbData = sizeof(data);
 
     do
     {
         wsprintf(szNewValue, szNewValueFormat, iIndex++);
         cbData = sizeof(data);
-        lResult = RegQueryValueEx(hKey, szNewValue, NULL, &dwExistingType, data, &cbData);
+        lResult = RegQueryValueExW(hKey, szNewValue, NULL, &dwExistingType, data, &cbData);
     }
     while(lResult == ERROR_SUCCESS);
 
     switch(dwType)
     {
     }
     while(lResult == ERROR_SUCCESS);
 
     switch(dwType)
     {
-    case REG_DWORD:
-        cbData = sizeof(DWORD);
-        break;
-    case REG_SZ:
-    case REG_EXPAND_SZ:
-        cbData = sizeof(TCHAR);
-        break;
-    case REG_MULTI_SZ:
-        cbData = sizeof(TCHAR) * 2;
-        break;
-    case REG_QWORD:
-        cbData = sizeof(DWORD) * 2;
-        break;
-    default:
-        cbData = 0;
-        break;
+        case REG_DWORD:
+            cbData = sizeof(DWORD);
+            break;
+        case REG_SZ:
+        case REG_EXPAND_SZ:
+            cbData = sizeof(WCHAR);
+            break;
+        case REG_MULTI_SZ:
+            cbData = sizeof(WCHAR) * 2;
+            break;
+        case REG_QWORD:
+            cbData = sizeof(DWORD) * 2;
+            break;
+        default:
+            cbData = 0;
+            break;
     }
     memset(data, 0, cbData);
     }
     memset(data, 0, cbData);
-    lResult = RegSetValueEx(hKey, szNewValue, 0, dwType, data, cbData);
+    lResult = RegSetValueExW(hKey, szNewValue, 0, dwType, data, cbData);
     RegCloseKey(hKey);
     if (lResult != ERROR_SUCCESS)
     {
     RegCloseKey(hKey);
     if (lResult != ERROR_SUCCESS)
     {
@@ -946,7 +942,7 @@ InitializeRemoteRegistryPicker(OUT IDsObjectPicker **pDsObjectPicker)
 static HRESULT
 InvokeRemoteRegistryPickerDialog(IN IDsObjectPicker *pDsObjectPicker,
                                  IN HWND hwndParent  OPTIONAL,
 static HRESULT
 InvokeRemoteRegistryPickerDialog(IN IDsObjectPicker *pDsObjectPicker,
                                  IN HWND hwndParent  OPTIONAL,
-                                 OUT LPTSTR lpBuffer,
+                                 OUT LPWSTR lpBuffer,
                                  IN UINT uSize)
 {
     IDataObject *pdo = NULL;
                                  IN UINT uSize)
 {
     IDataObject *pdo = NULL;
@@ -960,7 +956,7 @@ InvokeRemoteRegistryPickerDialog(IN IDsObjectPicker *pDsObjectPicker,
         STGMEDIUM stm;
         FORMATETC fe;
 
         STGMEDIUM stm;
         FORMATETC fe;
 
-        fe.cfFormat = (CLIPFORMAT) RegisterClipboardFormat(CFSTR_DSOP_DS_SELECTION_LIST);
+        fe.cfFormat = (CLIPFORMAT) RegisterClipboardFormatW(CFSTR_DSOP_DS_SELECTION_LIST);
         fe.ptd = NULL;
         fe.dwAspect = DVASPECT_CONTENT;
         fe.lindex = -1;
         fe.ptd = NULL;
         fe.dwAspect = DVASPECT_CONTENT;
         fe.lindex = -1;
@@ -981,20 +977,11 @@ InvokeRemoteRegistryPickerDialog(IN IDsObjectPicker *pDsObjectPicker,
                     {
                         nlen = uSize - 1;
                     }
                     {
                         nlen = uSize - 1;
                     }
-#if UNICODE
+
                     memcpy(lpBuffer,
                            SelectionList->aDsSelection[0].pwzName,
                            nlen * sizeof(WCHAR));
                     memcpy(lpBuffer,
                            SelectionList->aDsSelection[0].pwzName,
                            nlen * sizeof(WCHAR));
-#else
-                    WideCharToMultiByte(CP_ACP,
-                                        0,
-                                        SelectionList->aDsSelection[0].pwzName,
-                                        nlen,
-                                        lpBuffer,
-                                        uSize,
-                                        NULL,
-                                        NULL);
-#endif
+
                     lpBuffer[nlen] = L'\0';
                 }
 
                     lpBuffer[nlen] = L'\0';
                 }
 
@@ -1026,8 +1013,8 @@ FreeObjectPicker(IN IDsObjectPicker *pDsObjectPicker)
 static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 {
     HKEY hKeyRoot = 0, hKey = 0;
 static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 {
     HKEY hKeyRoot = 0, hKey = 0;
-    LPCTSTR keyPath;
-    LPCTSTR valueName;
+    LPCWSTR keyPath;
+    LPCWSTR valueName;
     BOOL result = TRUE;
     REGSAM regsam = KEY_READ;
     LONG lRet;
     BOOL result = TRUE;
     REGSAM regsam = KEY_READ;
     LONG lRet;
@@ -1053,7 +1040,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
     case ID_REGISTRY_CONNECTNETWORKREGISTRY:
     {
         IDsObjectPicker *ObjectPicker;
     case ID_REGISTRY_CONNECTNETWORKREGISTRY:
     {
         IDsObjectPicker *ObjectPicker;
-        TCHAR szComputerName[MAX_COMPUTERNAME_LENGTH + 1];
+        WCHAR szComputerName[MAX_COMPUTERNAME_LENGTH + 1];
         HRESULT hRet;
 
         hRet = CoInitialize(NULL);
         HRESULT hRet;
 
         hRet = CoInitialize(NULL);
@@ -1082,7 +1069,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
     case ID_REGISTRY_DISCONNECTNETWORKREGISTRY:
         return TRUE;
     case ID_REGISTRY_PRINT:
     case ID_REGISTRY_DISCONNECTNETWORKREGISTRY:
         return TRUE;
     case ID_REGISTRY_PRINT:
-        PrintRegistryHive(hWnd, _T(""));
+        PrintRegistryHive(hWnd, L"");
         return TRUE;
     case ID_REGISTRY_EXIT:
         DestroyWindow(hWnd);
         return TRUE;
     case ID_REGISTRY_EXIT:
         DestroyWindow(hWnd);
@@ -1091,7 +1078,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
         toggle_child(hWnd, LOWORD(wParam), hStatusBar);
         return TRUE;
     case ID_HELP_HELPTOPICS:
         toggle_child(hWnd, LOWORD(wParam), hStatusBar);
         return TRUE;
     case ID_HELP_HELPTOPICS:
-        WinHelp(hWnd, _T("regedit"), HELP_FINDER, 0);
+        WinHelpW(hWnd, getAppName(), HELP_FINDER, 0);
         return TRUE;
     case ID_HELP_ABOUT:
         ShowAboutBox(hWnd);
         return TRUE;
     case ID_HELP_ABOUT:
         ShowAboutBox(hWnd);
@@ -1107,8 +1094,8 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
         if(ClientToScreen(g_pChildWnd->hWnd, &pts))
         {
             SetCursorPos(pts.x, pts.y);
         if(ClientToScreen(g_pChildWnd->hWnd, &pts))
         {
             SetCursorPos(pts.x, pts.y);
-            SetCursor(LoadCursor(0, IDC_SIZEWE));
-            SendMessage(g_pChildWnd->hWnd, WM_LBUTTONDOWN, 0, MAKELPARAM(pt.x, pt.y));
+            SetCursor(LoadCursorW(0, IDC_SIZEWE));
+            SendMessageW(g_pChildWnd->hWnd, WM_LBUTTONDOWN, 0, MAKELPARAM(pt.x, pt.y));
         }
         return TRUE;
     }
         }
         return TRUE;
     }
@@ -1124,7 +1111,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
     valueName = GetValueName(g_pChildWnd->hListWnd, -1);
     if (keyPath)
     {
     valueName = GetValueName(g_pChildWnd->hListWnd, -1);
     if (keyPath)
     {
-        lRet = RegOpenKeyEx(hKeyRoot, keyPath, 0, regsam, &hKey);
+        lRet = RegOpenKeyExW(hKeyRoot, keyPath, 0, regsam, &hKey);
         if (lRet != ERROR_SUCCESS) hKey = 0;
     }
 
         if (lRet != ERROR_SUCCESS) hKey = 0;
     }
 
@@ -1165,10 +1152,10 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
             UINT nSelected = ListView_GetSelectedCount(g_pChildWnd->hListWnd);
             if(nSelected >= 1)
             {
             UINT nSelected = ListView_GetSelectedCount(g_pChildWnd->hListWnd);
             if(nSelected >= 1)
             {
-                TCHAR msg[128], caption[128];
-                LoadString(hInst, IDS_QUERY_DELETE_CONFIRM, caption, COUNT_OF(caption));
-                LoadString(hInst, (nSelected == 1 ? IDS_QUERY_DELETE_ONE : IDS_QUERY_DELETE_MORE), msg, COUNT_OF(msg));
-                if(MessageBox(g_pChildWnd->hWnd, msg, caption, MB_ICONQUESTION | MB_YESNO) == IDYES)
+                WCHAR msg[128], caption[128];
+                LoadStringW(hInst, IDS_QUERY_DELETE_CONFIRM, caption, COUNT_OF(caption));
+                LoadStringW(hInst, (nSelected == 1 ? IDS_QUERY_DELETE_ONE : IDS_QUERY_DELETE_MORE), msg, COUNT_OF(msg));
+                if(MessageBoxW(g_pChildWnd->hWnd, msg, caption, MB_ICONQUESTION | MB_YESNO) == IDYES)
                 {
                     int ni, errs;
 
                 {
                     int ni, errs;
 
@@ -1177,7 +1164,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
                     while((ni = ListView_GetNextItem(g_pChildWnd->hListWnd, item, LVNI_SELECTED)) > -1)
                     {
                         valueName = GetValueName(g_pChildWnd->hListWnd, item);
                     while((ni = ListView_GetNextItem(g_pChildWnd->hListWnd, item, LVNI_SELECTED)) > -1)
                     {
                         valueName = GetValueName(g_pChildWnd->hListWnd, item);
-                        if(RegDeleteValue(hKey, valueName) != ERROR_SUCCESS)
+                        if(RegDeleteValueW(hKey, valueName) != ERROR_SUCCESS)
                         {
                             errs++;
                         }
                         {
                             errs++;
                         }
@@ -1187,9 +1174,9 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
                     RefreshListView(g_pChildWnd->hListWnd, hKeyRoot, keyPath);
                     if(errs > 0)
                     {
                     RefreshListView(g_pChildWnd->hListWnd, hKeyRoot, keyPath);
                     if(errs > 0)
                     {
-                        LoadString(hInst, IDS_ERR_DELVAL_CAPTION, caption, COUNT_OF(caption));
-                        LoadString(hInst, IDS_ERR_DELETEVALUE, msg, COUNT_OF(msg));
-                        MessageBox(g_pChildWnd->hWnd, msg, caption, MB_ICONSTOP);
+                        LoadStringW(hInst, IDS_ERR_DELVAL_CAPTION, caption, COUNT_OF(caption));
+                        LoadStringW(hInst, IDS_ERR_DELETEVALUE, msg, COUNT_OF(msg));
+                        MessageBoxW(g_pChildWnd->hWnd, msg, caption, MB_ICONSTOP);
                     }
                 }
             }
                     }
                 }
             }
@@ -1260,7 +1247,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
         {
             HMENU hMenu;
             MENUITEMINFO mii;
         {
             HMENU hMenu;
             MENUITEMINFO mii;
-            TCHAR szFavorite[512];
+            WCHAR szFavorite[512];
 
             hMenu = GetSubMenu(GetMenu(hWnd), FAVORITES_MENU_POSITION);
 
 
             hMenu = GetSubMenu(GetMenu(hWnd), FAVORITES_MENU_POSITION);
 
@@ -1304,13 +1291,13 @@ LRESULT CALLBACK FrameWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
     switch (message)
     {
     case WM_CREATE:
     switch (message)
     {
     case WM_CREATE:
-        CreateWindowEx(0, szChildClass, NULL, WS_CHILD | WS_VISIBLE,
+        CreateWindowExW(0, szChildClass, NULL, WS_CHILD | WS_VISIBLE,
                        CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
                        hWnd, (HMENU)0, hInst, 0);
         break;
     case WM_COMMAND:
         if (!_CmdWndProc(hWnd, message, wParam, lParam))
                        CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
                        hWnd, (HMENU)0, hInst, 0);
         break;
     case WM_COMMAND:
         if (!_CmdWndProc(hWnd, message, wParam, lParam))
-            return DefWindowProc(hWnd, message, wParam, lParam);
+            return DefWindowProcW(hWnd, message, wParam, lParam);
         break;
     case WM_ACTIVATE:
         if (LOWORD(hWnd))
         break;
     case WM_ACTIVATE:
         if (LOWORD(hWnd))
@@ -1335,15 +1322,15 @@ LRESULT CALLBACK FrameWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
         break;
     case WM_SYSCOLORCHANGE:
         /* Forward WM_SYSCOLORCHANGE to common controls */
         break;
     case WM_SYSCOLORCHANGE:
         /* Forward WM_SYSCOLORCHANGE to common controls */
-        SendMessage(g_pChildWnd->hListWnd, WM_SYSCOLORCHANGE, 0, 0);
-        SendMessage(g_pChildWnd->hTreeWnd, WM_SYSCOLORCHANGE, 0, 0);
+        SendMessageW(g_pChildWnd->hListWnd, WM_SYSCOLORCHANGE, 0, 0);
+        SendMessageW(g_pChildWnd->hTreeWnd, WM_SYSCOLORCHANGE, 0, 0);
         break;
     case WM_DESTROY:
         break;
     case WM_DESTROY:
-        WinHelp(hWnd, _T("regedit"), HELP_QUIT, 0);
+        WinHelpW(hWnd, getAppName(), HELP_QUIT, 0);
         SaveSettings();
         PostQuitMessage(0);
     default:
         SaveSettings();
         PostQuitMessage(0);
     default:
-        return DefWindowProc(hWnd, message, wParam, lParam);
+        return DefWindowProcW(hWnd, message, wParam, lParam);
     }
     return 0;
 }
     }
     return 0;
 }
index 78afe08..209287a 100644 (file)
@@ -49,17 +49,17 @@ typedef struct
     INT SelEnd;
 } HEXEDIT_DATA, *PHEXEDIT_DATA;
 
     INT SelEnd;
 } HEXEDIT_DATA, *PHEXEDIT_DATA;
 
-static const TCHAR ClipboardFormatName[] = TEXT("RegEdit_HexData");
+static const WCHAR ClipboardFormatName[] = L"RegEdit_HexData";
 static UINT ClipboardFormatID = 0;
 
 /* hit test codes */
 static UINT ClipboardFormatID = 0;
 
 /* hit test codes */
-#define HEHT_LEFTMARGIN        (0x1)
-#define HEHT_ADDRESS   (0x2)
-#define HEHT_ADDRESSSPACING    (0x3)
-#define HEHT_HEXDUMP   (0x4)
-#define HEHT_HEXDUMPSPACING    (0x5)
-#define HEHT_ASCIIDUMP (0x6)
-#define HEHT_RIGHTMARGIN       (0x7)
+#define HEHT_LEFTMARGIN     (0x1)
+#define HEHT_ADDRESS        (0x2)
+#define HEHT_ADDRESSSPACING (0x3)
+#define HEHT_HEXDUMP        (0x4)
+#define HEHT_HEXDUMPSPACING (0x5)
+#define HEHT_ASCIIDUMP      (0x6)
+#define HEHT_RIGHTMARGIN    (0x7)
 
 INT_PTR CALLBACK HexEditWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
 
 
 INT_PTR CALLBACK HexEditWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
 
@@ -67,17 +67,17 @@ ATOM
 WINAPI
 RegisterHexEditorClass(HINSTANCE hInstance)
 {
 WINAPI
 RegisterHexEditorClass(HINSTANCE hInstance)
 {
-    WNDCLASSEX WndClass;
+    WNDCLASSEXW WndClass;
 
 
-    ClipboardFormatID = RegisterClipboardFormat(ClipboardFormatName);
+    ClipboardFormatID = RegisterClipboardFormatW(ClipboardFormatName);
 
 
-    ZeroMemory(&WndClass, sizeof(WNDCLASSEX));
-    WndClass.cbSize = sizeof(WNDCLASSEX);
+    ZeroMemory(&WndClass, sizeof(WNDCLASSEXW));
+    WndClass.cbSize = sizeof(WNDCLASSEXW);
     WndClass.style = CS_DBLCLKS;
     WndClass.lpfnWndProc = (WNDPROC)HexEditWndProc;
     WndClass.cbWndExtra = sizeof(PHEXEDIT_DATA);
     WndClass.hInstance = hInstance;
     WndClass.style = CS_DBLCLKS;
     WndClass.lpfnWndProc = (WNDPROC)HexEditWndProc;
     WndClass.cbWndExtra = sizeof(PHEXEDIT_DATA);
     WndClass.hInstance = hInstance;
-    WndClass.hCursor = LoadCursor(0, IDC_IBEAM);
+    WndClass.hCursor = LoadCursorW(NULL, IDC_IBEAM);
     WndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
     WndClass.lpszClassName = HEX_EDIT_CLASS_NAME;
 
     WndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
     WndClass.lpszClassName = HEX_EDIT_CLASS_NAME;
 
@@ -88,7 +88,7 @@ BOOL
 WINAPI
 UnregisterHexEditorClass(HINSTANCE hInstance)
 {
 WINAPI
 UnregisterHexEditorClass(HINSTANCE hInstance)
 {
-    return UnregisterClass(HEX_EDIT_CLASS_NAME, hInstance);
+    return UnregisterClassW(HEX_EDIT_CLASS_NAME, hInstance);
 }
 
 /*** Helper functions *********************************************************/
 }
 
 /*** Helper functions *********************************************************/
@@ -192,7 +192,7 @@ HEXEDIT_PaintLines(PHEXEDIT_DATA hed, HDC hDC, DWORD ScrollPos, DWORD First, DWO
     INT i, isave, i0, i1, x;
     PBYTE buf, current, end, line;
     size_t bufsize;
     INT i, isave, i0, i1, x;
     PBYTE buf, current, end, line;
     size_t bufsize;
-    TCHAR hex[3], addr[17];
+    WCHAR hex[3], addr[17];
     RECT rct, rct2;
 
     FillRect(hDC, rc, (HBRUSH)(COLOR_WINDOW + 1));
     RECT rct, rct2;
 
     FillRect(hDC, rc, (HBRUSH)(COLOR_WINDOW + 1));
@@ -222,8 +222,8 @@ HEXEDIT_PaintLines(PHEXEDIT_DATA hed, HDC hDC, DWORD ScrollPos, DWORD First, DWO
         if(ScrollPos + First == 0)
         {
             /* draw address */
         if(ScrollPos + First == 0)
         {
             /* draw address */
-            wsprintf(addr, TEXT("%04X"), 0);
-            TextOut(hDC, hed->LeftMargin, First * hed->LineHeight, addr, 4);
+            wsprintf(addr, L"%04X", 0);
+            TextOutW(hDC, hed->LeftMargin, First * hed->LineHeight, addr, 4);
         }
     }
 
         }
     }
 
@@ -244,8 +244,8 @@ HEXEDIT_PaintLines(PHEXEDIT_DATA hed, HDC hDC, DWORD ScrollPos, DWORD First, DWO
             dx = hed->LeftMargin;
 
             /* draw address */
             dx = hed->LeftMargin;
 
             /* draw address */
-            wsprintf(addr, TEXT("%04lX"), linestart);
-            TextOut(hDC, dx, dy, addr, 4);
+            wsprintf(addr, L"%04lX", linestart);
+            TextOutW(hDC, dx, dy, addr, 4);
 
             dx += ((4 + hed->AddressSpacing) * hed->CharWidth);
             dh = (3 * hed->CharWidth);
 
             dx += ((4 + hed->AddressSpacing) * hed->CharWidth);
             dh = (3 * hed->CharWidth);
@@ -264,7 +264,7 @@ HEXEDIT_PaintLines(PHEXEDIT_DATA hed, HDC hDC, DWORD ScrollPos, DWORD First, DWO
                 rct.left += dh;
                 rct.right += dh;
 
                 rct.left += dh;
                 rct.right += dh;
 
-                wsprintf(hex, TEXT("%02X"), *(current++));
+                wsprintf(hex, L"%02X", *(current++));
                 if (i0 <= i && i < i1)
                 {
                     rct2.left = dx;
                 if (i0 <= i && i < i1)
                 {
                     rct2.left = dx;
@@ -274,11 +274,11 @@ HEXEDIT_PaintLines(PHEXEDIT_DATA hed, HDC hDC, DWORD ScrollPos, DWORD First, DWO
                     InflateRect(&rct2, hed->CharWidth / 2, 0);
                     FillRect(hDC, &rct2, (HBRUSH)(COLOR_HIGHLIGHT + 1));
                     SetTextColor(hDC, GetSysColor(COLOR_HIGHLIGHTTEXT));
                     InflateRect(&rct2, hed->CharWidth / 2, 0);
                     FillRect(hDC, &rct2, (HBRUSH)(COLOR_HIGHLIGHT + 1));
                     SetTextColor(hDC, GetSysColor(COLOR_HIGHLIGHTTEXT));
-                    ExtTextOut(hDC, dx, dy, 0, &rct, hex, 2, NULL);
+                    ExtTextOutW(hDC, dx, dy, 0, &rct, hex, 2, NULL);
                     SetTextColor(hDC, GetSysColor(COLOR_WINDOWTEXT));
                 }
                 else
                     SetTextColor(hDC, GetSysColor(COLOR_WINDOWTEXT));
                 }
                 else
-                    ExtTextOut(hDC, dx, dy, ETO_OPAQUE, &rct, hex, 2, NULL);
+                    ExtTextOutW(hDC, dx, dy, ETO_OPAQUE, &rct, hex, 2, NULL);
                 dx += dh;
                 i++;
             }
                 dx += dh;
                 i++;
             }
@@ -289,8 +289,8 @@ HEXEDIT_PaintLines(PHEXEDIT_DATA hed, HDC hDC, DWORD ScrollPos, DWORD First, DWO
             i = isave;
             for(x = 0; x < hed->ColumnsPerLine && current < end; x++)
             {
             i = isave;
             for(x = 0; x < hed->ColumnsPerLine && current < end; x++)
             {
-                wsprintf(hex, _T("%C"), *(current++));
-                hex[0] = ((hex[0] & _T('\x007f')) >= _T(' ') ? hex[0] : _T('.'));
+                wsprintf(hex, L"%C", *(current++));
+                hex[0] = ((hex[0] & L'\x007f') >= L' ' ? hex[0] : L'.');
                 if (i0 <= i && i < i1)
                 {
                     rct2.left = dx;
                 if (i0 <= i && i < i1)
                 {
                     rct2.left = dx;
@@ -299,11 +299,11 @@ HEXEDIT_PaintLines(PHEXEDIT_DATA hed, HDC hDC, DWORD ScrollPos, DWORD First, DWO
                     rct2.bottom = dy + hed->LineHeight;
                     FillRect(hDC, &rct2, (HBRUSH)(COLOR_HIGHLIGHT + 1));
                     SetTextColor(hDC, GetSysColor(COLOR_HIGHLIGHTTEXT));
                     rct2.bottom = dy + hed->LineHeight;
                     FillRect(hDC, &rct2, (HBRUSH)(COLOR_HIGHLIGHT + 1));
                     SetTextColor(hDC, GetSysColor(COLOR_HIGHLIGHTTEXT));
-                    TextOut(hDC, dx, dy, hex, 1);
+                    TextOutW(hDC, dx, dy, hex, 1);
                     SetTextColor(hDC, GetSysColor(COLOR_WINDOWTEXT));
                 }
                 else
                     SetTextColor(hDC, GetSysColor(COLOR_WINDOWTEXT));
                 }
                 else
-                    TextOut(hDC, dx, dy, hex, 1);
+                    TextOutW(hDC, dx, dy, hex, 1);
                 dx += hed->CharWidth;
                 i++;
             }
                 dx += hed->CharWidth;
                 i++;
             }
@@ -1048,7 +1048,7 @@ HEXEDIT_WM_KEYDOWN(PHEXEDIT_DATA hed, INT VkCode)
     {
     case 'X':
         if (GetAsyncKeyState(VK_SHIFT) >= 0 &&
     {
     case 'X':
         if (GetAsyncKeyState(VK_SHIFT) >= 0 &&
-                GetAsyncKeyState(VK_CONTROL) < 0 && hed->SelStart != hed->SelEnd)
+            GetAsyncKeyState(VK_CONTROL) < 0 && hed->SelStart != hed->SelEnd)
             HEXEDIT_Cut(hed);
         else
             return TRUE;
             HEXEDIT_Cut(hed);
         else
             return TRUE;
@@ -1056,7 +1056,7 @@ HEXEDIT_WM_KEYDOWN(PHEXEDIT_DATA hed, INT VkCode)
 
     case 'C':
         if (GetAsyncKeyState(VK_SHIFT) >= 0 &&
 
     case 'C':
         if (GetAsyncKeyState(VK_SHIFT) >= 0 &&
-                GetAsyncKeyState(VK_CONTROL) < 0 && hed->SelStart != hed->SelEnd)
+            GetAsyncKeyState(VK_CONTROL) < 0 && hed->SelStart != hed->SelEnd)
             HEXEDIT_Copy(hed);
         else
             return TRUE;
             HEXEDIT_Copy(hed);
         else
             return TRUE;
@@ -1088,7 +1088,7 @@ HEXEDIT_WM_KEYDOWN(PHEXEDIT_DATA hed, INT VkCode)
 
     case VK_DELETE:
         if (GetAsyncKeyState(VK_SHIFT) < 0 && GetAsyncKeyState(VK_CONTROL) >= 0 &&
 
     case VK_DELETE:
         if (GetAsyncKeyState(VK_SHIFT) < 0 && GetAsyncKeyState(VK_CONTROL) >= 0 &&
-                hed->SelStart != hed->SelEnd)
+            hed->SelStart != hed->SelEnd)
             HEXEDIT_Copy(hed);
         if (i0 != i1)
         {
             HEXEDIT_Copy(hed);
         if (i0 != i1)
         {
@@ -1256,9 +1256,10 @@ HEXEDIT_WM_KEYDOWN(PHEXEDIT_DATA hed, INT VkCode)
 }
 
 static BOOL
 }
 
 static BOOL
-HEXEDIT_WM_CHAR(PHEXEDIT_DATA hed, WCHAR ch)
+HEXEDIT_WM_CHAR(PHEXEDIT_DATA hed, WCHAR wch)
 {
     size_t bufsize;
 {
     size_t bufsize;
+    CHAR ch = (CHAR)wch; // keep the lowest octet.
     PBYTE buf;
     INT i0, i1;
 
     PBYTE buf;
     INT i0, i1;
 
@@ -1410,7 +1411,7 @@ HEXEDIT_WM_CONTEXTMENU(PHEXEDIT_DATA hed, INT x, INT y)
 
     SetForegroundWindow(hed->hWndSelf);
     TrackPopupMenu(hMenu, TPM_RIGHTBUTTON, x, y, 0, hed->hWndSelf, NULL);
 
     SetForegroundWindow(hed->hWndSelf);
     TrackPopupMenu(hMenu, TPM_RIGHTBUTTON, x, y, 0, hed->hWndSelf, NULL);
-    PostMessage(hed->hWndSelf, WM_NULL, 0, 0);
+    PostMessageW(hed->hWndSelf, WM_NULL, 0, 0);
 }
 
 INT_PTR CALLBACK
 }
 
 INT_PTR CALLBACK
@@ -1548,6 +1549,6 @@ HexEditWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
         break;
     }
 
         break;
     }
 
-    return DefWindowProc(hWnd, uMsg, wParam, lParam);
+    return DefWindowProcW(hWnd, uMsg, wParam, lParam);
 }
 
 }
 
index 5ee5e22..0e480ed 100644 (file)
@@ -1,6 +1,6 @@
 #pragma once
 
 #pragma once
 
-#define HEX_EDIT_CLASS_NAME _T("HexEdit32")
+#define HEX_EDIT_CLASS_NAME     L"HexEdit32"
 
 ATOM WINAPI
 RegisterHexEditorClass(HINSTANCE hInstance);
 
 ATOM WINAPI
 RegisterHexEditorClass(HINSTANCE hInstance);
@@ -8,30 +8,32 @@ BOOL WINAPI
 UnregisterHexEditorClass(HINSTANCE hInstance);
 
 /* styles */
 UnregisterHexEditorClass(HINSTANCE hInstance);
 
 /* styles */
-#define HES_READONLY   (0x800)
-#define HES_LOWERCASE  (0x10)
-#define HES_UPPERCASE  (0x8)
-#define HES_AUTOVSCROLL        (0x40)
-#define HES_HIDEADDRESS        (0x4)
+#define HES_READONLY    (0x800)
+#define HES_LOWERCASE   (0x10)
+#define HES_UPPERCASE   (0x8)
+#define HES_AUTOVSCROLL (0x40)
+#define HES_HIDEADDRESS (0x4)
 
 /* messages */
 
 /* messages */
-#define HEM_BASE       (WM_USER + 50)
-#define HEM_LOADBUFFER (HEM_BASE + 1)
-#define HEM_COPYBUFFER (HEM_BASE + 2)
-#define HEM_SETMAXBUFFERSIZE   (HEM_BASE + 3)
+#define HEM_BASE                (WM_USER + 50)
+#define HEM_LOADBUFFER          (HEM_BASE + 1)
+#define HEM_COPYBUFFER          (HEM_BASE + 2)
+#define HEM_SETMAXBUFFERSIZE    (HEM_BASE + 3)
 
 /* macros */
 #define HexEdit_LoadBuffer(hWnd, Buffer, Size) \
 
 /* macros */
 #define HexEdit_LoadBuffer(hWnd, Buffer, Size) \
-  SendMessage((hWnd), HEM_LOADBUFFER, (WPARAM)(Buffer), (LPARAM)(Size))
+  SendMessageW((hWnd), HEM_LOADBUFFER, (WPARAM)(Buffer), (LPARAM)(Size))
 
 #define HexEdit_ClearBuffer(hWnd) \
 
 #define HexEdit_ClearBuffer(hWnd) \
-  SendMessage((hWnd), HEM_LOADBUFFER, 0, 0)
+  SendMessageW((hWnd), HEM_LOADBUFFER, 0, 0)
 
 #define HexEdit_CopyBuffer(hWnd, Buffer, nMax) \
 
 #define HexEdit_CopyBuffer(hWnd, Buffer, nMax) \
-  SendMessage((hWnd), HEM_COPYBUFFER, (WPARAM)(Buffer), (LPARAM)(nMax))
+  SendMessageW((hWnd), HEM_COPYBUFFER, (WPARAM)(Buffer), (LPARAM)(nMax))
 
 #define HexEdit_GetBufferSize(hWnd) \
 
 #define HexEdit_GetBufferSize(hWnd) \
-  SendMessage((hWnd), HEM_COPYBUFFER, 0, 0)
+  SendMessageW((hWnd), HEM_COPYBUFFER, 0, 0)
 
 #define HexEdit_SetMaxBufferSize(hWnd, Size) \
 
 #define HexEdit_SetMaxBufferSize(hWnd, Size) \
-  SendMessage((hWnd), HEM_SETMAXBUFFERSIZE, 0, (LPARAM)(Size))
+  SendMessageW((hWnd), HEM_SETMAXBUFFERSIZE, 0, (LPARAM)(Size))
+
+/* EOF */
index b781eb5..ccc1107 100644 (file)
@@ -23,7 +23,7 @@
 
 #define CX_ICON    16
 #define CY_ICON    16
 
 #define CX_ICON    16
 #define CY_ICON    16
-#define NUM_ICONS    2
+#define NUM_ICONS   2
 
 int Image_String = 0;
 int Image_Bin = 0;
 
 int Image_String = 0;
 int Image_Bin = 0;
@@ -32,7 +32,7 @@ INT iListViewSelect = -1;
 typedef struct tagLINE_INFO
 {
     DWORD dwValType;
 typedef struct tagLINE_INFO
 {
     DWORD dwValType;
-    LPTSTR name;
+    LPWSTR name;
     void* val;
     size_t val_len;
 } LINE_INFO, *PLINE_INFO;
     void* val;
     size_t val_len;
 } LINE_INFO, *PLINE_INFO;
@@ -48,7 +48,7 @@ static BOOL  g_invertSort = FALSE;
 static const int default_column_widths[MAX_LIST_COLUMNS] = { 200, 175, 400 };
 static const int column_alignment[MAX_LIST_COLUMNS] = { LVCFMT_LEFT, LVCFMT_LEFT, LVCFMT_LEFT };
 
 static const int default_column_widths[MAX_LIST_COLUMNS] = { 200, 175, 400 };
 static const int column_alignment[MAX_LIST_COLUMNS] = { LVCFMT_LEFT, LVCFMT_LEFT, LVCFMT_LEFT };
 
-LPCTSTR GetValueName(HWND hwndLV, int iStartAt)
+LPCWSTR GetValueName(HWND hwndLV, int iStartAt)
 {
     int item;
     LVITEM LVItem;
 {
     int item;
     LVITEM LVItem;
@@ -77,10 +77,10 @@ LPCTSTR GetValueName(HWND hwndLV, int iStartAt)
     return lineinfo->name;
 }
 
     return lineinfo->name;
 }
 
-VOID SetValueName(HWND hwndLV, LPCTSTR pszValueName)
+VOID SetValueName(HWND hwndLV, LPCWSTR pszValueName)
 {
     INT i, c;
 {
     INT i, c;
-    LV_FINDINFO fi;
+    LVFINDINFOW fi;
 
     c = ListView_GetItemCount(hwndLV);
     for(i = 0; i < c; i++)
 
     c = ListView_GetItemCount(hwndLV);
     for(i = 0; i < c; i++)
@@ -110,7 +110,7 @@ BOOL IsDefaultValue(HWND hwndLV, int i)
     if(ListView_GetItem(hwndLV, &Item))
     {
         lineinfo = (PLINE_INFO)Item.lParam;
     if(ListView_GetItem(hwndLV, &Item))
     {
         lineinfo = (PLINE_INFO)Item.lParam;
-        return lineinfo && (!lineinfo->name || !_tcscmp(lineinfo->name, _T("")));
+        return lineinfo && (!lineinfo->name || !wcscmp(lineinfo->name, L""));
     }
     return FALSE;
 }
     }
     return FALSE;
 }
@@ -118,7 +118,7 @@ BOOL IsDefaultValue(HWND hwndLV, int i)
 /*******************************************************************************
  * Local module support methods
  */
 /*******************************************************************************
  * Local module support methods
  */
-static void AddEntryToList(HWND hwndLV, LPTSTR Name, DWORD dwValType, void* ValBuf, DWORD dwCount, int Position, BOOL ValExists)
+static void AddEntryToList(HWND hwndLV, LPWSTR Name, DWORD dwValType, void* ValBuf, DWORD dwCount, int Position, BOOL ValExists)
 {
     PLINE_INFO linfo;
     LVITEM item;
 {
     PLINE_INFO linfo;
     LVITEM item;
@@ -131,7 +131,7 @@ static void AddEntryToList(HWND hwndLV, LPTSTR Name, DWORD dwValType, void* ValB
     {
         memcpy(&linfo[1], ValBuf, dwCount);
     }
     {
         memcpy(&linfo[1], ValBuf, dwCount);
     }
-    linfo->name = _tcsdup(Name);
+    linfo->name = _wcsdup(Name);
 
     item.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
     item.iItem = (Position == -1 ? 0: Position);
 
     item.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
     item.iItem = (Position == -1 ? 0: Position);
@@ -139,21 +139,21 @@ static void AddEntryToList(HWND hwndLV, LPTSTR Name, DWORD dwValType, void* ValB
     item.state = 0;
     item.stateMask = 0;
     item.pszText = Name;
     item.state = 0;
     item.stateMask = 0;
     item.pszText = Name;
-    item.cchTextMax = (int) _tcslen(item.pszText);
+    item.cchTextMax = (int)wcslen(item.pszText);
     if (item.cchTextMax == 0)
         item.pszText = LPSTR_TEXTCALLBACK;
     item.iImage = 0;
     item.lParam = (LPARAM)linfo;
     switch(dwValType)
     {
     if (item.cchTextMax == 0)
         item.pszText = LPSTR_TEXTCALLBACK;
     item.iImage = 0;
     item.lParam = (LPARAM)linfo;
     switch(dwValType)
     {
-    case REG_SZ:
-    case REG_EXPAND_SZ:
-    case REG_MULTI_SZ:
-        item.iImage = Image_String;
-        break;
-    default:
-        item.iImage = Image_Bin;
-        break;
+        case REG_SZ:
+        case REG_EXPAND_SZ:
+        case REG_MULTI_SZ:
+            item.iImage = Image_String;
+            break;
+        default:
+            item.iImage = Image_Bin;
+            break;
     }
 
     /*    item.lParam = (LPARAM)ValBuf; */
     }
 
     /*    item.lParam = (LPARAM)ValBuf; */
@@ -174,49 +174,49 @@ static void AddEntryToList(HWND hwndLV, LPTSTR Name, DWORD dwValType, void* ValB
             }
             else if(!ValExists)
             {
             }
             else if(!ValExists)
             {
-                TCHAR buffer[255];
+                WCHAR buffer[255];
                 /* load (value not set) string */
                 /* load (value not set) string */
-                LoadString(hInst, IDS_VALUE_NOT_SET, buffer, COUNT_OF(buffer));
+                LoadStringW(hInst, IDS_VALUE_NOT_SET, buffer, COUNT_OF(buffer));
                 ListView_SetItemText(hwndLV, index, 2, buffer);
             }
             break;
         case REG_MULTI_SZ:
         {
                 ListView_SetItemText(hwndLV, index, 2, buffer);
             }
             break;
         case REG_MULTI_SZ:
         {
-            LPTSTR src, str;
+            LPWSTR src, str;
             if(dwCount >= 2)
             {
             if(dwCount >= 2)
             {
-                src = (LPTSTR)ValBuf;
-                str = HeapAlloc(GetProcessHeap(), 0, dwCount + sizeof(TCHAR));
+                src = (LPWSTR)ValBuf;
+                str = HeapAlloc(GetProcessHeap(), 0, dwCount + sizeof(WCHAR));
                 if(str != NULL)
                 {
                 if(str != NULL)
                 {
-                    *str = _T('\0');
+                    *str = L'\0';
                     /* concatenate all srings */
                     /* concatenate all srings */
-                    while(*src != _T('\0'))
+                    while(*src != L'\0')
                     {
                     {
-                        _tcscat(str, src);
-                        _tcscat(str, _T(" "));
-                        src += _tcslen(src) + 1;
+                        wcscat(str, src);
+                        wcscat(str, L" ");
+                        src += wcslen(src) + 1;
                     }
                     ListView_SetItemText(hwndLV, index, 2, str);
                     HeapFree(GetProcessHeap(), 0, str);
                 }
                 else
                     }
                     ListView_SetItemText(hwndLV, index, 2, str);
                     HeapFree(GetProcessHeap(), 0, str);
                 }
                 else
-                    ListView_SetItemText(hwndLV, index, 2, _T(""));
+                    ListView_SetItemText(hwndLV, index, 2, L"");
             }
             else
             }
             else
-                ListView_SetItemText(hwndLV, index, 2, _T(""));
+                ListView_SetItemText(hwndLV, index, 2, L"");
         }
         break;
         case REG_DWORD:
         {
         }
         break;
         case REG_DWORD:
         {
-            TCHAR buf[200];
+            WCHAR buf[200];
             if(dwCount == sizeof(DWORD))
             {
             if(dwCount == sizeof(DWORD))
             {
-                wsprintf(buf, _T("0x%08x (%u)"), *(DWORD*)ValBuf, *(DWORD*)ValBuf);
+                wsprintf(buf, L"0x%08x (%u)", *(DWORD*)ValBuf, *(DWORD*)ValBuf);
             }
             else
             {
             }
             else
             {
-                LoadString(hInst, IDS_INVALID_DWORD, buf, COUNT_OF(buf));
+                LoadStringW(hInst, IDS_INVALID_DWORD, buf, COUNT_OF(buf));
             }
             ListView_SetItemText(hwndLV, index, 2, buf);
         }
             }
             ListView_SetItemText(hwndLV, index, 2, buf);
         }
@@ -226,13 +226,13 @@ static void AddEntryToList(HWND hwndLV, LPTSTR Name, DWORD dwValType, void* ValB
         {
             unsigned int i;
             LPBYTE pData = (LPBYTE)ValBuf;
         {
             unsigned int i;
             LPBYTE pData = (LPBYTE)ValBuf;
-            LPTSTR strBinary;
+            LPWSTR strBinary;
             if(dwCount > 0)
             {
             if(dwCount > 0)
             {
-                strBinary = HeapAlloc(GetProcessHeap(), 0, (dwCount * sizeof(TCHAR) * 3) + sizeof(TCHAR));
+                strBinary = HeapAlloc(GetProcessHeap(), 0, (dwCount * sizeof(WCHAR) * 3) + sizeof(WCHAR));
                 for (i = 0; i < dwCount; i++)
                 {
                 for (i = 0; i < dwCount; i++)
                 {
-                    wsprintf( strBinary + i*3, _T("%02X "), pData[i] );
+                    wsprintf( strBinary + i*3, L"%02X ", pData[i] );
                 }
                 strBinary[dwCount * 3] = 0;
                 ListView_SetItemText(hwndLV, index, 2, strBinary);
                 }
                 strBinary[dwCount * 3] = 0;
                 ListView_SetItemText(hwndLV, index, 2, strBinary);
@@ -240,8 +240,8 @@ static void AddEntryToList(HWND hwndLV, LPTSTR Name, DWORD dwValType, void* ValB
             }
             else
             {
             }
             else
             {
-                TCHAR szText[128];
-                LoadString(hInst, IDS_BINARY_EMPTY, szText, COUNT_OF(szText));
+                WCHAR szText[128];
+                LoadStringW(hInst, IDS_BINARY_EMPTY, szText, COUNT_OF(szText));
                 ListView_SetItemText(hwndLV, index, 2, szText);
             }
         }
                 ListView_SetItemText(hwndLV, index, 2, szText);
             }
         }
@@ -252,9 +252,9 @@ static void AddEntryToList(HWND hwndLV, LPTSTR Name, DWORD dwValType, void* ValB
 
 static BOOL CreateListColumns(HWND hWndListView)
 {
 
 static BOOL CreateListColumns(HWND hWndListView)
 {
-    TCHAR szText[50];
+    WCHAR szText[50];
     int index;
     int index;
-    LV_COLUMN lvC;
+    LVCOLUMN lvC;
 
     /* Create columns. */
     lvC.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
 
     /* Create columns. */
     lvC.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
@@ -266,7 +266,7 @@ static BOOL CreateListColumns(HWND hWndListView)
         lvC.iSubItem = index;
         lvC.cx = default_column_widths[index];
         lvC.fmt = column_alignment[index];
         lvC.iSubItem = index;
         lvC.cx = default_column_widths[index];
         lvC.fmt = column_alignment[index];
-        LoadString(hInst, IDS_LIST_COLUMN_FIRST + index, szText, COUNT_OF(szText));
+        LoadStringW(hInst, IDS_LIST_COLUMN_FIRST + index, szText, COUNT_OF(szText));
         if (ListView_InsertColumn(hWndListView, index, &lvC) == -1) return FALSE;
     }
     return TRUE;
         if (ListView_InsertColumn(hWndListView, index, &lvC) == -1) return FALSE;
     }
     return TRUE;
@@ -282,10 +282,10 @@ static BOOL InitListViewImageLists(HWND hwndLV)
                                  ILC_MASK, 0, NUM_ICONS)) == NULL)
         return FALSE;
 
                                  ILC_MASK, 0, NUM_ICONS)) == NULL)
         return FALSE;
 
-    hico = LoadIcon(hInst, MAKEINTRESOURCE(IDI_BIN));
+    hico = LoadIconW(hInst, MAKEINTRESOURCEW(IDI_BIN));
     Image_Bin = ImageList_AddIcon(himl, hico);
 
     Image_Bin = ImageList_AddIcon(himl, hico);
 
-    hico = LoadIcon(hInst, MAKEINTRESOURCE(IDI_STRING));
+    hico = LoadIconW(hInst, MAKEINTRESOURCEW(IDI_STRING));
     Image_String = ImageList_AddIcon(himl, hico);
 
 
     Image_String = ImageList_AddIcon(himl, hico);
 
 
@@ -305,7 +305,7 @@ static BOOL InitListViewImageLists(HWND hwndLV)
 
 static void OnGetDispInfo(NMLVDISPINFO* plvdi)
 {
 
 static void OnGetDispInfo(NMLVDISPINFO* plvdi)
 {
-    static TCHAR buffer[200];
+    static WCHAR buffer[200];
 
     plvdi->item.pszText = NULL;
     plvdi->item.cchTextMax = 0;
 
     plvdi->item.pszText = NULL;
     plvdi->item.cchTextMax = 0;
@@ -313,60 +313,60 @@ static void OnGetDispInfo(NMLVDISPINFO* plvdi)
     switch (plvdi->item.iSubItem)
     {
     case 0:
     switch (plvdi->item.iSubItem)
     {
     case 0:
-        LoadString(hInst, IDS_DEFAULT_VALUE_NAME, buffer, COUNT_OF(buffer));
+        LoadStringW(hInst, IDS_DEFAULT_VALUE_NAME, buffer, COUNT_OF(buffer));
         plvdi->item.pszText = buffer;
         break;
     case 1:
         switch (((LINE_INFO*)plvdi->item.lParam)->dwValType)
         {
         plvdi->item.pszText = buffer;
         break;
     case 1:
         switch (((LINE_INFO*)plvdi->item.lParam)->dwValType)
         {
-        case REG_NONE:
-            plvdi->item.pszText = _T("REG_NONE");
-            break;
-        case REG_SZ:
-            plvdi->item.pszText = _T("REG_SZ");
-            break;
-        case REG_EXPAND_SZ:
-            plvdi->item.pszText = _T("REG_EXPAND_SZ");
-            break;
-        case REG_BINARY:
-            plvdi->item.pszText = _T("REG_BINARY");
-            break;
-        case REG_DWORD: /* REG_DWORD_LITTLE_ENDIAN */
-            plvdi->item.pszText = _T("REG_DWORD");
-            break;
-        case REG_DWORD_BIG_ENDIAN:
-            plvdi->item.pszText = _T("REG_DWORD_BIG_ENDIAN");
-            break;
-        case REG_LINK:
-            plvdi->item.pszText = _T("REG_LINK");
-            break;
-        case REG_MULTI_SZ:
-            plvdi->item.pszText = _T("REG_MULTI_SZ");
-            break;
-        case REG_RESOURCE_LIST:
-            plvdi->item.pszText = _T("REG_RESOURCE_LIST");
-            break;
-        case REG_FULL_RESOURCE_DESCRIPTOR:
-            plvdi->item.pszText = _T("REG_FULL_RESOURCE_DESCRIPTOR");
-            break;
-        case REG_RESOURCE_REQUIREMENTS_LIST:
-            plvdi->item.pszText = _T("REG_RESOURCE_REQUIREMENTS_LIST");
-            break;
-        case REG_QWORD: /* REG_QWORD_LITTLE_ENDIAN */
-            plvdi->item.pszText = _T("REG_QWORD");
-            break;
-        default:
-        {
-            TCHAR buf2[200];
-            LoadString(hInst, IDS_UNKNOWN_TYPE, buf2, COUNT_OF(buf2));
-            wsprintf(buffer, buf2, ((LINE_INFO*)plvdi->item.lParam)->dwValType);
-            plvdi->item.pszText = buffer;
-            break;
-        }
+            case REG_NONE:
+                plvdi->item.pszText = L"REG_NONE";
+                break;
+            case REG_SZ:
+                plvdi->item.pszText = L"REG_SZ";
+                break;
+            case REG_EXPAND_SZ:
+                plvdi->item.pszText = L"REG_EXPAND_SZ";
+                break;
+            case REG_BINARY:
+                plvdi->item.pszText = L"REG_BINARY";
+                break;
+            case REG_DWORD: /* REG_DWORD_LITTLE_ENDIAN */
+                plvdi->item.pszText = L"REG_DWORD";
+                break;
+            case REG_DWORD_BIG_ENDIAN:
+                plvdi->item.pszText = L"REG_DWORD_BIG_ENDIAN";
+                break;
+            case REG_LINK:
+                plvdi->item.pszText = L"REG_LINK";
+                break;
+            case REG_MULTI_SZ:
+                plvdi->item.pszText = L"REG_MULTI_SZ";
+                break;
+            case REG_RESOURCE_LIST:
+                plvdi->item.pszText = L"REG_RESOURCE_LIST";
+                break;
+            case REG_FULL_RESOURCE_DESCRIPTOR:
+                plvdi->item.pszText = L"REG_FULL_RESOURCE_DESCRIPTOR";
+                break;
+            case REG_RESOURCE_REQUIREMENTS_LIST:
+                plvdi->item.pszText = L"REG_RESOURCE_REQUIREMENTS_LIST";
+                break;
+            case REG_QWORD: /* REG_QWORD_LITTLE_ENDIAN */
+                plvdi->item.pszText = L"REG_QWORD";
+                break;
+            default:
+            {
+                WCHAR buf2[200];
+                LoadStringW(hInst, IDS_UNKNOWN_TYPE, buf2, COUNT_OF(buf2));
+                wsprintf(buffer, buf2, ((LINE_INFO*)plvdi->item.lParam)->dwValType);
+                plvdi->item.pszText = buffer;
+                break;
+            }
         }
         break;
     case 3:
         }
         break;
     case 3:
-        plvdi->item.pszText = _T("");
+        plvdi->item.pszText = L"";
         break;
     }
 }
         break;
     }
 }
@@ -388,7 +388,7 @@ static int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSor
     {
         /* FIXME: Sort on value */
     }
     {
         /* FIXME: Sort on value */
     }
-    return g_invertSort ? _tcsicmp(r->name, l->name) : _tcsicmp(l->name, r->name);
+    return g_invertSort ? wcsicmp(r->name, l->name) : wcsicmp(l->name, r->name);
 }
 
 BOOL ListWndNotifyProc(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL *Result)
 }
 
 BOOL ListWndNotifyProc(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL *Result)
@@ -415,7 +415,7 @@ BOOL ListWndNotifyProc(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL *Result)
     case NM_DBLCLK:
     case NM_RETURN:
     {
     case NM_DBLCLK:
     case NM_RETURN:
     {
-        SendMessage(hFrameWnd, WM_COMMAND, MAKEWPARAM(ID_EDIT_MODIFY, 0), 0);
+        SendMessageW(hFrameWnd, WM_COMMAND, MAKEWPARAM(ID_EDIT_MODIFY, 0), 0);
     }
     return TRUE;
     case NM_SETFOCUS:
     }
     return TRUE;
     case NM_SETFOCUS:
@@ -426,7 +426,7 @@ BOOL ListWndNotifyProc(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL *Result)
         if(Info)
         {
             PLINE_INFO lineinfo = (PLINE_INFO)Info->item.lParam;
         if(Info)
         {
             PLINE_INFO lineinfo = (PLINE_INFO)Info->item.lParam;
-            if(!lineinfo->name || !_tcscmp(lineinfo->name, _T("")))
+            if(!lineinfo->name || !wcscmp(lineinfo->name, L""))
             {
                 *Result = TRUE;
             }
             {
                 *Result = TRUE;
             }
@@ -443,32 +443,32 @@ BOOL ListWndNotifyProc(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL *Result)
         if(Info && Info->item.pszText)
         {
             PLINE_INFO lineinfo = (PLINE_INFO)Info->item.lParam;
         if(Info && Info->item.pszText)
         {
             PLINE_INFO lineinfo = (PLINE_INFO)Info->item.lParam;
-            if(!lineinfo->name || !_tcscmp(lineinfo->name, _T("")))
+            if(!lineinfo->name || !wcscmp(lineinfo->name, L""))
             {
                 *Result = FALSE;
             }
             else
             {
             {
                 *Result = FALSE;
             }
             else
             {
-                if(_tcslen(Info->item.pszText) == 0)
+                if(wcslen(Info->item.pszText) == 0)
                 {
                 {
-                    TCHAR msg[128], caption[128];
+                    WCHAR msg[128], caption[128];
 
 
-                    LoadString(hInst, IDS_ERR_RENVAL_TOEMPTY, msg, COUNT_OF(msg));
-                    LoadString(hInst, IDS_ERR_RENVAL_CAPTION, caption, COUNT_OF(caption));
-                    MessageBox(0, msg, caption, 0);
+                    LoadStringW(hInst, IDS_ERR_RENVAL_TOEMPTY, msg, COUNT_OF(msg));
+                    LoadStringW(hInst, IDS_ERR_RENVAL_CAPTION, caption, COUNT_OF(caption));
+                    MessageBoxW(0, msg, caption, 0);
                     *Result = TRUE;
                 }
                 else
                 {
                     HKEY hKeyRoot;
                     *Result = TRUE;
                 }
                 else
                 {
                     HKEY hKeyRoot;
-                    LPCTSTR keyPath;
+                    LPCWSTR keyPath;
                     LONG lResult;
 
                     keyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
                     lResult = RenameValue(hKeyRoot, keyPath, Info->item.pszText, lineinfo->name);
                     LONG lResult;
 
                     keyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
                     lResult = RenameValue(hKeyRoot, keyPath, Info->item.pszText, lineinfo->name);
-                    lineinfo->name = realloc(lineinfo->name, (_tcslen(Info->item.pszText)+1)*sizeof(TCHAR));
+                    lineinfo->name = realloc(lineinfo->name, (wcslen(Info->item.pszText)+1)*sizeof(WCHAR));
                     if (lineinfo->name != NULL)
                     if (lineinfo->name != NULL)
-                        _tcscpy(lineinfo->name, Info->item.pszText);
+                        wcscpy(lineinfo->name, Info->item.pszText);
 
                     *Result = TRUE;
                     return (lResult == ERROR_SUCCESS);
 
                     *Result = TRUE;
                     return (lResult == ERROR_SUCCESS);
@@ -491,10 +491,10 @@ HWND CreateListView(HWND hwndParent, HMENU id)
 
     /* Get the dimensions of the parent window's client area, and create the list view control.  */
     GetClientRect(hwndParent, &rcClient);
 
     /* Get the dimensions of the parent window's client area, and create the list view control.  */
     GetClientRect(hwndParent, &rcClient);
-    hwndLV = CreateWindowEx(WS_EX_CLIENTEDGE, WC_LISTVIEW, _T("List View"),
-                            WS_VISIBLE | WS_CHILD | WS_TABSTOP | LVS_REPORT | LVS_EDITLABELS,
-                            0, 0, rcClient.right, rcClient.bottom,
-                            hwndParent, id, hInst, NULL);
+    hwndLV = CreateWindowExW(WS_EX_CLIENTEDGE, WC_LISTVIEW, L"List View",
+                             WS_VISIBLE | WS_CHILD | WS_TABSTOP | LVS_REPORT | LVS_EDITLABELS,
+                             0, 0, rcClient.right, rcClient.bottom,
+                             hwndParent, id, hInst, NULL);
     if (!hwndLV) return NULL;
 
     /* Initialize the image list, and add items to the control.  */
     if (!hwndLV) return NULL;
 
     /* Initialize the image list, and add items to the control.  */
@@ -524,7 +524,7 @@ void DestroyListView(HWND hwndLV)
 
 }
 
 
 }
 
-BOOL RefreshListView(HWND hwndLV, HKEY hKey, LPCTSTR keyPath)
+BOOL RefreshListView(HWND hwndLV, HKEY hKey, LPCWSTR keyPath)
 {
     DWORD max_sub_key_len;
     DWORD max_val_name_len;
 {
     DWORD max_sub_key_len;
     DWORD max_val_name_len;
@@ -539,7 +539,7 @@ BOOL RefreshListView(HWND hwndLV, HKEY hKey, LPCTSTR keyPath)
 
     (void)ListView_EditLabel(hwndLV, -1);
 
 
     (void)ListView_EditLabel(hwndLV, -1);
 
-    SendMessage(hwndLV, WM_SETREDRAW, FALSE, 0);
+    SendMessageW(hwndLV, WM_SETREDRAW, FALSE, 0);
     DestroyListView(hwndLV);
 
     g_columnToSort = ~0UL;
     DestroyListView(hwndLV);
 
     g_columnToSort = ~0UL;
@@ -547,38 +547,36 @@ BOOL RefreshListView(HWND hwndLV, HKEY hKey, LPCTSTR keyPath)
 
     if(!hKey) return FALSE;
 
 
     if(!hKey) return FALSE;
 
-    errCode = RegOpenKeyEx(hKey, keyPath, 0, KEY_READ, &hNewKey);
+    errCode = RegOpenKeyExW(hKey, keyPath, 0, KEY_READ, &hNewKey);
     if (errCode != ERROR_SUCCESS) return FALSE;
 
     /* get size information and resize the buffers if necessary */
     if (errCode != ERROR_SUCCESS) return FALSE;
 
     /* get size information and resize the buffers if necessary */
-    errCode = RegQueryInfoKey(hNewKey, NULL, NULL, NULL, NULL, &max_sub_key_len, NULL,
-                              &val_count, &max_val_name_len, &max_val_size, NULL, NULL);
+    errCode = RegQueryInfoKeyW(hNewKey, NULL, NULL, NULL, NULL, &max_sub_key_len, NULL,
+                               &val_count, &max_val_name_len, &max_val_size, NULL, NULL);
 
     if (errCode == ERROR_SUCCESS)
     {
 
     if (errCode == ERROR_SUCCESS)
     {
-        TCHAR* ValName = HeapAlloc(GetProcessHeap(), 0, ++max_val_name_len * sizeof(TCHAR));
+        WCHAR* ValName = HeapAlloc(GetProcessHeap(), 0, ++max_val_name_len * sizeof(WCHAR));
         DWORD dwValNameLen = max_val_name_len;
         DWORD dwValNameLen = max_val_name_len;
-        BYTE* ValBuf = HeapAlloc(GetProcessHeap(), 0, max_val_size + sizeof(TCHAR));
+        BYTE* ValBuf = HeapAlloc(GetProcessHeap(), 0, max_val_size + sizeof(WCHAR));
         DWORD dwValSize = max_val_size;
         DWORD dwIndex = 0L;
         DWORD dwValType;
         DWORD dwValSize = max_val_size;
         DWORD dwIndex = 0L;
         DWORD dwValType;
-        /*                if (RegQueryValueEx(hNewKey, NULL, NULL, &dwValType, ValBuf, &dwValSize) == ERROR_SUCCESS) { */
-        /*                    AddEntryToList(hwndLV, _T("(Default)"), dwValType, ValBuf, dwValSize); */
+        /*                if (RegQueryValueExW(hNewKey, NULL, NULL, &dwValType, ValBuf, &dwValSize) == ERROR_SUCCESS) { */
+        /*                    AddEntryToList(hwndLV, L"(Default)", dwValType, ValBuf, dwValSize); */
         /*                } */
         /*                dwValSize = max_val_size; */
         /*                } */
         /*                dwValSize = max_val_size; */
-        while (RegEnumValue(hNewKey, dwIndex, ValName, &dwValNameLen, NULL, &dwValType, ValBuf, &dwValSize) == ERROR_SUCCESS)
+        while (RegEnumValueW(hNewKey, dwIndex, ValName, &dwValNameLen, NULL, &dwValType, ValBuf, &dwValSize) == ERROR_SUCCESS)
         {
             /* Add a terminating 0 character. Usually this is only necessary for strings. */
         {
             /* Add a terminating 0 character. Usually this is only necessary for strings. */
-            ValBuf[dwValSize] = 0;
-#ifdef UNICODE
-            ValBuf[dwValSize + 1] = 0;
-#endif
+            ValBuf[dwValSize] = ValBuf[dwValSize + 1] = 0;
+
             AddEntryToList(hwndLV, ValName, dwValType, ValBuf, dwValSize, -1, TRUE);
             dwValNameLen = max_val_name_len;
             dwValSize = max_val_size;
             dwValType = 0L;
             ++dwIndex;
             AddEntryToList(hwndLV, ValName, dwValType, ValBuf, dwValSize, -1, TRUE);
             dwValNameLen = max_val_name_len;
      &n