Merged regedit from winehq cvs.
authorSteven Edwards <winehacker@gmail.com>
Fri, 22 Aug 2003 05:55:14 +0000 (05:55 +0000)
committerSteven Edwards <winehacker@gmail.com>
Fri, 22 Aug 2003 05:55:14 +0000 (05:55 +0000)
Moved to new home in reactos tree.
 - I know I said I was on vacation

svn path=/trunk/; revision=5738

36 files changed:
reactos/subsys/system/regedit/En.rc [new file with mode: 0644]
reactos/subsys/system/regedit/Pt.rc [new file with mode: 0644]
reactos/subsys/system/regedit/about.c [moved from rosapps/regedit/about.c with 78% similarity]
reactos/subsys/system/regedit/childwnd.c [moved from rosapps/regedit/childwnd.c with 85% similarity]
reactos/subsys/system/regedit/framewnd.c [moved from rosapps/regedit/framewnd.c with 73% similarity]
reactos/subsys/system/regedit/listview.c [moved from rosapps/regedit/listview.c with 70% similarity]
reactos/subsys/system/regedit/main.c [moved from rosapps/regedit/main.c with 53% similarity]
reactos/subsys/system/regedit/main.h [new file with mode: 0644]
reactos/subsys/system/regedit/makefile [new file with mode: 0644]
reactos/subsys/system/regedit/regedit.c [moved from rosapps/regedit/regcmds.c with 63% similarity]
reactos/subsys/system/regedit/regedit.rc [moved from rosapps/regedit/debug.h with 74% similarity]
reactos/subsys/system/regedit/regproc.c [moved from rosapps/regedit/regproc.c with 50% similarity]
reactos/subsys/system/regedit/regproc.h [new file with mode: 0644]
reactos/subsys/system/regedit/res/folder1.bmp [new file with mode: 0644]
reactos/subsys/system/regedit/res/folder2.bmp [new file with mode: 0644]
reactos/subsys/system/regedit/res/folder3.bmp [new file with mode: 0644]
reactos/subsys/system/regedit/resource.h [moved from rosapps/regedit/resource.h with 82% similarity]
reactos/subsys/system/regedit/resource.rc [new file with mode: 0644]
reactos/subsys/system/regedit/rsrc.rc [moved from rosapps/regedit/about.h with 73% similarity]
reactos/subsys/system/regedit/treeview.c [moved from rosapps/regedit/treeview.c with 55% similarity]
rosapps/Makefile
rosapps/regedit/.cvsignore [deleted file]
rosapps/regedit/Makefile [deleted file]
rosapps/regedit/childwnd.h [deleted file]
rosapps/regedit/dbg.h [deleted file]
rosapps/regedit/debug.c [deleted file]
rosapps/regedit/framewnd.h [deleted file]
rosapps/regedit/hex_str.c [deleted file]
rosapps/regedit/hex_str.h [deleted file]
rosapps/regedit/listview.h [deleted file]
rosapps/regedit/main.h [deleted file]
rosapps/regedit/regedit.rc [deleted file]
rosapps/regedit/regproc.h [deleted file]
rosapps/regedit/trace.c [deleted file]
rosapps/regedit/trace.h [deleted file]
rosapps/regedit/treeview.h [deleted file]

diff --git a/reactos/subsys/system/regedit/En.rc b/reactos/subsys/system/regedit/En.rc
new file mode 100644 (file)
index 0000000..bab413d
--- /dev/null
@@ -0,0 +1,232 @@
+/*
+ * Regedit resources
+ *
+ * Copyright 2002 Robert Dickenson
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(850)
+
+/*
+ * Menu
+ */
+
+IDC_REGEDIT MENU DISCARDABLE
+BEGIN
+    POPUP "&File"
+    BEGIN
+        MENUITEM "E&xit",                       ID_REGISTRY_EXIT
+    END
+    POPUP "&Help"
+    BEGIN
+        MENUITEM "&About ...",                  ID_HELP_ABOUT
+    END
+END
+
+IDR_REGEDIT_MENU MENU DISCARDABLE
+BEGIN
+    POPUP "&Registry"
+    BEGIN
+        MENUITEM "&Import Registry File...",    ID_REGISTRY_IMPORTREGISTRYFILE
+
+        MENUITEM "&Export Registry File...",    ID_REGISTRY_EXPORTREGISTRYFILE
+
+        MENUITEM SEPARATOR
+        MENUITEM "&Connect Network Registry...",
+                                                ID_REGISTRY_CONNECTNETWORKREGISTRY
+        , GRAYED
+        MENUITEM "&Disconnect Network Registry...",
+                                                ID_REGISTRY_DISCONNECTNETWORKREGISTRY
+        , GRAYED
+        MENUITEM SEPARATOR
+        MENUITEM "&Print\tCtrl+P",              ID_REGISTRY_PRINT, GRAYED
+        MENUITEM SEPARATOR
+        MENUITEM "E&xit",                       ID_REGISTRY_EXIT
+    END
+    POPUP "&Edit"
+    BEGIN
+        MENUITEM "&Modify",                     ID_EDIT_MODIFY
+        MENUITEM SEPARATOR
+        POPUP "&New"
+        BEGIN
+            MENUITEM "&Key",                        ID_EDIT_NEW_KEY
+            MENUITEM SEPARATOR
+            MENUITEM "&String Value",               ID_EDIT_NEW_STRINGVALUE
+            MENUITEM "&Binary Value",               ID_EDIT_NEW_BINARYVALUE
+            MENUITEM "&DWORD Value",                ID_EDIT_NEW_DWORDVALUE
+        END
+        MENUITEM SEPARATOR
+        MENUITEM "&Delete\tDel",                ID_EDIT_DELETE
+        MENUITEM "&Rename",                     ID_EDIT_RENAME
+        MENUITEM SEPARATOR
+        MENUITEM "&Copy Key Name",              ID_EDIT_COPYKEYNAME
+        MENUITEM SEPARATOR
+        MENUITEM "&Find\tCtrl+F",               ID_EDIT_FIND, GRAYED
+        MENUITEM "Find Ne&xt\tF3",              ID_EDIT_FINDNEXT, GRAYED
+    END
+    POPUP "&View"
+    BEGIN
+        MENUITEM "Status &Bar",                 ID_VIEW_STATUSBAR
+        MENUITEM SEPARATOR
+        MENUITEM "Sp&lit",                      ID_VIEW_SPLIT
+        MENUITEM SEPARATOR
+        MENUITEM "&Refresh\tF5",                ID_VIEW_REFRESH
+    END
+    POPUP "&Favourites"
+    BEGIN
+        MENUITEM "&Add to Favourites",          ID_FAVOURITES_ADDTOFAVOURITES
+        , GRAYED
+        MENUITEM "&Remove Favourite",           ID_FAVOURITES_REMOVEFAVOURITE
+        , GRAYED
+    END
+    POPUP "&Help"
+    BEGIN
+/*
+ *        MENUITEM "&Help Topics",                ID_HELP_HELPTOPICS
+ *        MENUITEM SEPARATOR
+ */
+        MENUITEM "&About Registry Editor",      ID_HELP_ABOUT
+    END
+END
+
+
+/*
+ * Dialog
+ */
+
+IDD_ABOUTBOX DIALOG DISCARDABLE  22, 17, 230, 75
+STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
+CAPTION "About"
+FONT 8, "System"
+BEGIN
+    ICON            IDI_REGEDIT,IDI_REGEDIT,14,9,16,16
+    LTEXT           "ReactOS regedit Version 1.0",IDC_STATIC,49,10,119,8,
+                    SS_NOPREFIX
+    LTEXT           "Copyright (C) 2002 ReactOS Team",IDC_STATIC,49,20,119,8
+    DEFPUSHBUTTON   "OK",IDOK,195,6,30,11,WS_GROUP
+END
+
+/*
+ * String Table
+ */
+
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_LIST_COLUMN_NAME    "Name"
+    IDS_LIST_COLUMN_TYPE    "Type"
+    IDS_LIST_COLUMN_DATA    "Data"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_APP_TITLE           "Registry Editor"
+    IDC_REGEDIT             "REGEDIT"
+    IDC_REGEDIT_FRAME       "REGEDIT_FRAME"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+    ID_REGISTRY_MENU        "Contains commands for working with the whole registry"
+    ID_EDIT_MENU            "Contains commands for editing values or keys"
+    ID_VIEW_MENU            "Contains commands for customising the registry window"
+    ID_FAVOURITES_MENU      "Contains commands for accessing frequently used keys"
+    ID_HELP_MENU            "Contains commands for displaying help and information about registry editor"
+    ID_EDIT_NEW_MENU        "Contains commands for creating new keys or values"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+    ID_EDIT_MODIFY          "Modifies the value's data"
+    ID_EDIT_NEW_KEY         "Adds a new key"
+    ID_EDIT_NEW_STRINGVALUE "Adds a new string value"
+    ID_EDIT_NEW_BINARYVALUE "Adds a new binary value"
+    ID_EDIT_NEW_DWORDVALUE  "Adds a new double word value"
+    ID_REGISTRY_IMPORTREGISTRYFILE "Imports a text file into the registry"
+    ID_REGISTRY_EXPORTREGISTRYFILE
+                            "Exports all or part of the registry to a text file"
+    ID_REGISTRY_CONNECTNETWORKREGISTRY
+                            "Connects to a remote computer's registry"
+    ID_REGISTRY_DISCONNECTNETWORKREGISTRY
+                            "Disconnects from a remote computer's registry"
+    ID_REGISTRY_PRINT       "Prints all or part of the registry"
+/*    ID_HELP_HELPTOPICS      "Opens registry editor help" */
+    ID_HELP_ABOUT           "Displays program information, version number and copyright"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+    ID_REGISTRY_EXIT        "Quits the registry editor"
+    ID_FAVOURITES_ADDTOFAVOURITES "Adds keys to the favourites list"
+    ID_FAVOURITES_REMOVEFAVOURITE "Removes keys from the favourites list"
+    ID_VIEW_STATUSBAR       "Shows or hides the status bar"
+    ID_VIEW_SPLIT           "Change position of split between two panes"
+    ID_VIEW_REFRESH         "Refreshes the window"
+    ID_EDIT_DELETE          "Deletes the selection"
+    ID_EDIT_RENAME          "Renames the selection"
+    ID_EDIT_COPYKEYNAME     "Copies the name of the selected key to the clipboard"
+    ID_EDIT_FIND            "Finds a text string in a key, value or data"
+    ID_EDIT_FINDNEXT        "Finds next occurrence of text specified in previous search"
+END
+
+/*****************************************************************/
+
+
+/*
+ * Dialog
+ */
+
+IDD_DIALOG1 DIALOG DISCARDABLE  50, 50, 268, 98
+STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
+    WS_BORDER
+FONT 8, "MS Sans Serif"
+BEGIN
+END
+
+IDD_DIALOG2 DIALOG DISCARDABLE  0, 0, 187, 95
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Dialog"
+FONT 8, "MS Sans Serif"
+BEGIN
+    DEFPUSHBUTTON   "OK",IDOK,130,7,50,14
+    PUSHBUTTON      "Cancel",IDCANCEL,130,24,50,14
+END
+
+
+/*
+ * TEXTINCLUDE
+ */
+
+1 TEXTINCLUDE DISCARDABLE
+BEGIN
+    "resource.h\0"
+END
+
+
+
+/*
+ * String Table
+ */
+
+/*
+ *STRINGTABLE DISCARDABLE
+ *BEGIN
+ *    ID_HELP_HELPTOPICS      "Opens Registry Editor Help."
+ *    ID_HELP_ABOUT           "Displays program information, version number, and copyright."
+ *END
+ */
+
+/*****************************************************************/
diff --git a/reactos/subsys/system/regedit/Pt.rc b/reactos/subsys/system/regedit/Pt.rc
new file mode 100644 (file)
index 0000000..2655bbd
--- /dev/null
@@ -0,0 +1,206 @@
+/*
+ * Regedit resources
+ *
+ * Copyright 2003 Marcelo Duarte
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+LANGUAGE LANG_PORTUGUESE, SUBLANG_DEFAULT
+
+/*
+ * Menu
+ */
+
+IDC_REGEDIT MENU DISCARDABLE
+BEGIN
+    POPUP "&Arquivo"
+    BEGIN
+        MENUITEM "Sai&r",                       ID_REGISTRY_EXIT
+    END
+    POPUP "Aj&uda"
+    BEGIN
+        MENUITEM "&Sobre...",                  ID_HELP_ABOUT
+    END
+END
+
+IDR_REGEDIT_MENU MENU DISCARDABLE
+BEGIN
+    POPUP "&Registro"
+    BEGIN
+        MENUITEM "&Importar arquivo do Registro...", ID_REGISTRY_IMPORTREGISTRYFILE
+        MENUITEM "&Exportar arquivo do Registro...", ID_REGISTRY_EXPORTREGISTRYFILE
+        MENUITEM SEPARATOR
+        MENUITEM "&Conectar Registro da rede...",    ID_REGISTRY_CONNECTNETWORKREGISTRY, GRAYED
+        MENUITEM "&Desconectar Registro da rede...", ID_REGISTRY_DISCONNECTNETWORKREGISTRY, GRAYED
+        MENUITEM SEPARATOR
+        MENUITEM "Im&primir\tCtrl+P",                ID_REGISTRY_PRINT, GRAYED
+        MENUITEM SEPARATOR
+        MENUITEM "Sai&r",                            ID_REGISTRY_EXIT
+    END
+    POPUP "&Editar"
+    BEGIN
+        MENUITEM "&Modificar",                       ID_EDIT_MODIFY
+        MENUITEM SEPARATOR
+        POPUP "&Novo"
+        BEGIN
+            MENUITEM "&Chave",                       ID_EDIT_NEW_KEY
+            MENUITEM SEPARATOR
+            MENUITEM "Valor &Texto",                 ID_EDIT_NEW_STRINGVALUE
+            MENUITEM "Valor &Binário",               ID_EDIT_NEW_BINARYVALUE
+            MENUITEM "Valor &DWORD",                 ID_EDIT_NEW_DWORDVALUE
+        END
+        MENUITEM SEPARATOR
+        MENUITEM "&Excluir\tDel",                    ID_EDIT_DELETE
+        MENUITEM "&Renomear",                        ID_EDIT_RENAME
+        MENUITEM SEPARATOR
+        MENUITEM "&Copiar nome da chave",            ID_EDIT_COPYKEYNAME
+        MENUITEM SEPARATOR
+        MENUITEM "&Localizar\tCtrl+F",               ID_EDIT_FIND, GRAYED
+        MENUITEM "L&ocalizar próxima\tF3",           ID_EDIT_FINDNEXT, GRAYED
+    END
+    POPUP "E&xibir"
+    BEGIN
+        MENUITEM "&Barra de status",                 ID_VIEW_STATUSBAR
+        MENUITEM SEPARATOR
+        MENUITEM "&Dividir",                         ID_VIEW_SPLIT
+        MENUITEM SEPARATOR
+        MENUITEM "&Atualizar\tF5",                   ID_VIEW_REFRESH
+    END
+    POPUP "&Favoritos"
+    BEGIN
+        MENUITEM "&Add to Favourites",          ID_FAVOURITES_ADDTOFAVOURITES
+        , GRAYED
+        MENUITEM "&Remove Favourite",           ID_FAVOURITES_REMOVEFAVOURITE
+        , GRAYED
+    END
+    POPUP "Aj&uda"
+    BEGIN
+/*
+ *        MENUITEM "&Topics da Ajuda",                ID_HELP_HELPTOPICS
+ *        MENUITEM SEPARATOR
+ */
+        MENUITEM "&Sobre o Editor do Registro",      ID_HELP_ABOUT
+    END
+END
+
+
+/*
+ * Dialog
+ */
+
+IDD_ABOUTBOX DIALOG DISCARDABLE  22, 17, 230, 75
+STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
+CAPTION "Sobre"
+FONT 8, "System"
+BEGIN
+    ICON            IDI_REGEDIT,IDI_REGEDIT,14,9,16,16
+    LTEXT           "ReactOS regedit Version 1.0",IDC_STATIC,49,10,119,8,
+                    SS_NOPREFIX
+    LTEXT           "Copyright (C) 2002 ReactOS Team",IDC_STATIC,49,20,119,8
+    DEFPUSHBUTTON   "OK",IDOK,195,6,30,11,WS_GROUP
+END
+
+/*
+ * String Table
+ */
+
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_LIST_COLUMN_NAME    "Nome"
+    IDS_LIST_COLUMN_TYPE    "Tipo"
+    IDS_LIST_COLUMN_DATA    "Dados"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_APP_TITLE           "Editor do Registro"
+    IDC_REGEDIT             "REGEDIT"
+    IDC_REGEDIT_FRAME       "REGEDIT_FRAME"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+    ID_REGISTRY_MENU        "Contém comandos para trabalhar com o Registro inteiro."
+    ID_EDIT_MENU            "Contém comandos para a edição de valores ou chaves."
+    ID_VIEW_MENU            "Contém comandos para a personalização da janela do Registro."
+    ID_FAVOURITES_MENU      "Contém comandos para acessar chaves frequentemente usadas."
+    ID_HELP_MENU            "Contém comandos para a exibição da ajuda e informações sobre o Editor do Registro."
+    ID_EDIT_NEW_MENU        "Contém comandos para a creação de novas chaves ou valores"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+    ID_EDIT_MODIFY          "Modifica os dados do valor."
+    ID_EDIT_NEW_KEY         "Adiciona uma nova chave"
+    ID_EDIT_NEW_STRINGVALUE "Adiciona um novo valor texto."
+    ID_EDIT_NEW_BINARYVALUE "Adiciona um novo valor binário."
+    ID_EDIT_NEW_DWORDVALUE  "Adiciona um novo valor DWORD."
+    ID_REGISTRY_IMPORTREGISTRYFILE "Importa um arquivo texto para o registro."
+    ID_REGISTRY_EXPORTREGISTRYFILE
+                            "Exporta todo ou parte do registro para um arquivo texto."
+    ID_REGISTRY_CONNECTNETWORKREGISTRY
+                            "Conecta a um registro em um computador remoto."
+    ID_REGISTRY_DISCONNECTNETWORKREGISTRY
+                            "Desconecta de um registro um computador remoto."
+    ID_REGISTRY_PRINT       "Imprime todo ou parte do registro."
+/*    ID_HELP_HELPTOPICS      "Abre a ajuda do Editor do Registro." */
+    ID_HELP_ABOUT           "Exibe informações do programa, número da versão e copyright."
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+    ID_REGISTRY_EXIT        "Encerra o Editor do Registro."
+    ID_FAVOURITES_ADDTOFAVOURITES "Adiciona chaves a lista de favoritos."
+    ID_FAVOURITES_REMOVEFAVOURITE "Remove chaves da lista de favoritos."
+    ID_VIEW_STATUSBAR       "Mostra ou oculta a barra de status."
+    ID_VIEW_SPLIT           "Altera a posição da divisão entre os painéis."
+    ID_VIEW_REFRESH         "Atualiza a janela."
+    ID_EDIT_DELETE          "Exclui a selecão."
+    ID_EDIT_RENAME          "Renomeia a selecão."
+    ID_EDIT_COPYKEYNAME     "Copia o nome da chave selecionada para a Área de transferência."
+    ID_EDIT_FIND            "Localiza um texto em uma chave, valor ou dado."
+    ID_EDIT_FINDNEXT        "Localiza a próxima ocorrência do texto especificado na pesquisa anterior."
+END
+
+/*
+ * Dialog
+ */
+
+IDD_DIALOG1 DIALOG DISCARDABLE  50, 50, 268, 98
+STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
+    WS_BORDER
+FONT 8, "MS Sans Serif"
+BEGIN
+END
+
+IDD_DIALOG2 DIALOG DISCARDABLE  0, 0, 187, 95
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Dialog"
+FONT 8, "MS Sans Serif"
+BEGIN
+    DEFPUSHBUTTON   "OK",IDOK,130,7,50,14
+    PUSHBUTTON      "Cancelar",IDCANCEL,130,24,50,14
+END
+
+
+/*
+ * TEXTINCLUDE
+ */
+
+1 TEXTINCLUDE DISCARDABLE
+BEGIN
+    "resource.h\0"
+END
similarity index 78%
rename from rosapps/regedit/about.c
rename to reactos/subsys/system/regedit/about.c
index 6b98186..5525434 100644 (file)
@@ -1,9 +1,7 @@
 /*
- *  ReactOS About Dialog Box
+ * Regedit About Dialog Box
  *
- *  about.c
- *
- *  Copyright (C) 2002  Robert Dickenson <robd@reactos.org>
+ * Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-    
-#define WIN32_LEAN_AND_MEAN     // Exclude rarely-used stuff from Windows headers
+
+//#define WIN32_LEAN_AND_MEAN     /* Exclude rarely-used stuff from Windows headers */
 #include <windows.h>
 #include <commctrl.h>
 #include <stdlib.h>
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
-    
-#include "main.h"
-#include "about.h"
 
+#include "main.h"
 
 extern HINSTANCE hInst;
 
-
-LRESULT CALLBACK AboutDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK AboutDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 {
     HWND    hLicenseEditWnd;
     TCHAR   strLicense[0x1000];
@@ -58,6 +53,5 @@ LRESULT CALLBACK AboutDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPAR
 
 void ShowAboutBox(HWND hWnd)
 {
-    DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, (DLGPROC)AboutDialogWndProc);
+    DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, AboutDialogWndProc);
 }
-
similarity index 85%
rename from rosapps/regedit/childwnd.c
rename to reactos/subsys/system/regedit/childwnd.c
index d3f6f8d..d031542 100644 (file)
@@ -1,9 +1,7 @@
 /*
- *  ReactOS regedit
+ * Regedit child window
  *
- *  childwnd.c
- *
- *  Copyright (C) 2002  Robert Dickenson <robd@reactos.org>
+ * Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -20,7 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#define WIN32_LEAN_AND_MEAN     // Exclude rarely-used stuff from Windows headers
+#define WIN32_LEAN_AND_MEAN     /* Exclude rarely-used stuff from Windows headers */
 #include <windows.h>
 #include <tchar.h>
 #include <commctrl.h>
 #define ASSERT assert
 
 #include "main.h"
-#include "framewnd.h"
-#include "childwnd.h"
-#include "treeview.h"
-#include "listview.h"
 
 
-////////////////////////////////////////////////////////////////////////////////
-// Local module support methods
-//
+/*******************************************************************************
+ * Local module support methods
+ */
 
 static void MakeFullRegPath(HWND hwndTV, HTREEITEM hItem, LPTSTR keyPath, int* pPathLen, int max)
 {
@@ -45,7 +39,7 @@ static void MakeFullRegPath(HWND hwndTV, HTREEITEM hItem, LPTSTR keyPath, int* p
     item.hItem = hItem;
     if (TreeView_GetItem(hwndTV, &item)) {
         if (item.hItem != TreeView_GetRoot(hwndTV)) {
-            // recurse
+            /* recurse */
             MakeFullRegPath(hwndTV, TreeView_GetParent(hwndTV, hItem), keyPath, pPathLen, max);
             keyPath[*pPathLen] = _T('\\');
             ++(*pPathLen);
@@ -95,23 +89,23 @@ static void OnPaint(HWND hWnd)
     EndPaint(hWnd, &ps);
 }
 
-////////////////////////////////////////////////////////////////////////////////
-//
-//  FUNCTION: _CmdWndProc(HWND, unsigned, WORD, LONG)
-//
-//  PURPOSE:  Processes WM_COMMAND messages for the main frame window.
-//
-//
+/*******************************************************************************
+ *
+ *  FUNCTION: _CmdWndProc(HWND, unsigned, WORD, LONG)
+ *
+ *  PURPOSE:  Processes WM_COMMAND messages for the main frame window.
+ *
+ */
 
 static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 {
        switch (LOWORD(wParam)) {
-    // Parse the menu selections:
+    /* Parse the menu selections: */
     case ID_REGISTRY_EXIT:
         DestroyWindow(hWnd);
         break;
     case ID_VIEW_REFRESH:
-        // TODO:
+        /* TODO */
         break;
     default:
         return FALSE;
@@ -119,21 +113,21 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
        return TRUE;
 }
 
-////////////////////////////////////////////////////////////////////////////////
-//
-//  FUNCTION: ChildWndProc(HWND, unsigned, WORD, LONG)
-//
-//  PURPOSE:  Processes messages for the child windows.
-//
-//  WM_COMMAND  - process the application menu
-//  WM_PAINT    - Paint the main window
-//  WM_DESTROY  - post a quit message and return
-//
-//
+/*******************************************************************************
+ *
+ *  FUNCTION: ChildWndProc(HWND, unsigned, WORD, LONG)
+ *
+ *  PURPOSE:  Processes messages for the child windows.
+ *
+ *  WM_COMMAND  - process the application menu
+ *  WM_PAINT    - Paint the main window
+ *  WM_DESTROY  - post a quit message and return
+ *
+ */
 LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 {
     static int last_split;
-//    ChildWnd* pChildWnd = (ChildWnd*)GetWindowLong(hWnd, GWL_USERDATA);
+/*    ChildWnd* pChildWnd = (ChildWnd*)GetWindowLong(hWnd, GWL_USERDATA); */
     static ChildWnd* pChildWnd;
 
     switch (message) {
@@ -236,8 +230,8 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
 
        case WM_NOTIFY:
         if ((int)wParam == TREE_WINDOW) {
-            switch (((LPNMHDR)lParam)->code) { 
-            case TVN_ITEMEXPANDING: 
+            switch (((LPNMHDR)lParam)->code) {
+            case TVN_ITEMEXPANDING:
                 return !OnTreeExpanding(pChildWnd->hTreeWnd, (NMTREEVIEW*)lParam);
             case TVN_SELCHANGED:
                 {
@@ -269,7 +263,7 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
         if (wParam != SIZE_MINIMIZED && pChildWnd != NULL) {
                ResizeWnd(pChildWnd, LOWORD(lParam), HIWORD(lParam));
         }
-        // fall through
+        /* fall through */
     default: def:
         return DefWindowProc(hWnd, message, wParam, lParam);
    }
similarity index 73%
rename from rosapps/regedit/framewnd.c
rename to reactos/subsys/system/regedit/framewnd.c
index df03f56..832f341 100644 (file)
@@ -1,9 +1,7 @@
 /*
- *  ReactOS regedit
+ * Regedit frame window
  *
- *  framewnd.c
- *
- *  Copyright (C) 2002  Robert Dickenson <robd@reactos.org>
+ * Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-//#define WIN32_LEAN_AND_MEAN     // Exclude rarely-used stuff from Windows headers
+#define WIN32_LEAN_AND_MEAN     /* Exclude rarely-used stuff from Windows headers */
+
 #include <windows.h>
 #include <tchar.h>
 #include <commctrl.h>
 #include <commdlg.h>
+#include <cderr.h>
 #include <stdlib.h>
 #include <stdio.h>
-    
-#include "main.h"
-#include "about.h"
-#include "framewnd.h"
-#include "treeview.h"
-#include "listview.h"
 #include <shellapi.h>
 
+#include "main.h"
 #include "regproc.h"
 
-////////////////////////////////////////////////////////////////////////////////
-// Global and Local Variables:
-//
+/********************************************************************************
+ * Global and Local Variables:
+ */
 
-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 */
 
 static HWND hChildWnd;
 
-////////////////////////////////////////////////////////////////////////////////
-// Local module support methods
-//
+/*******************************************************************************
+ * Local module support methods
+ */
 
 static void resize_frame_rect(HWND hWnd, PRECT prect)
 {
@@ -76,13 +71,13 @@ void resize_frame_client(HWND hWnd)
        resize_frame_rect(hWnd, &rect);
 }
 
-////////////////////////////////////////////////////////////////////////////////
+/********************************************************************************/
 
 static void OnEnterMenuLoop(HWND hWnd)
 {
     int nParts;
 
-    // Update the status bar pane sizes
+    /* Update the status bar pane sizes */
     nParts = -1;
     SendMessage(hStatusBar, SB_SETPARTS, 1, (long)&nParts);
     bInMenuLoop = TRUE;
@@ -92,7 +87,7 @@ static void OnEnterMenuLoop(HWND hWnd)
 static void OnExitMenuLoop(HWND hWnd)
 {
     bInMenuLoop = FALSE;
-    // Update the status bar pane sizes
+    /* Update the status bar pane sizes*/
        SetupStatusBar(hWnd, TRUE);
        UpdateStatusBar();
 }
@@ -108,9 +103,9 @@ static void OnMenuSelect(HWND hWnd, UINT nItemID, UINT nFlags, HMENU hSysMenu)
         }
     }
     if (LoadString(hInst, nItemID, str, 100)) {
-        // load appropriate string
+        /* load appropriate string*/
         LPTSTR lpsz = str;
-        // first newline terminates actual string
+        /* first newline terminates actual string*/
         lpsz = _tcschr(lpsz, '\n');
         if (lpsz != NULL)
             *lpsz = '\0';
@@ -124,7 +119,7 @@ void SetupStatusBar(HWND hWnd, BOOL bResize)
     int nParts;
     GetClientRect(hWnd, &rc);
     nParts = rc.right;
-//    nParts = -1;
+/*    nParts = -1;*/
        if (bResize)
                SendMessage(hStatusBar, WM_SIZE, 0, 0);
        SendMessage(hStatusBar, SB_SETPARTS, 1, (LPARAM)&nParts);
@@ -230,18 +225,18 @@ static BOOL InitOpenFileName(HWND hWnd, OPENFILENAME* pofn)
     pofn->nMaxFile = _MAX_PATH;
     pofn->lpstrFileTitle = FileTitleBuffer;
     pofn->nMaxFileTitle = _MAX_PATH;
-//    pofn->lpstrInitialDir = _T("");
-//    pofn->lpstrTitle = _T("Import Registry File");
-//    pofn->Flags = OFN_ENABLETEMPLATE + OFN_EXPLORER + OFN_ENABLESIZING;
+/*    pofn->lpstrInitialDir = _T("");*/
+/*    pofn->lpstrTitle = _T("Import Registry File");*/
+/*    pofn->Flags = OFN_ENABLETEMPLATE + OFN_EXPLORER + OFN_ENABLESIZING;*/
     pofn->Flags = OFN_HIDEREADONLY;
-//    pofn->nFileOffset = ;
-//    pofn->nFileExtension = ;
-//    pofn->lpstrDefExt = _T("");
-//    pofn->lCustData = ;
-//    pofn->lpfnHook = ImportRegistryFile_OFNHookProc;
-//    pofn->lpTemplateName = _T("ID_DLG_IMPORT_REGFILE");
-//    pofn->lpTemplateName = MAKEINTRESOURCE(IDD_DIALOG1);
-//    pofn->FlagsEx = ;
+/*    pofn->nFileOffset = ;*/
+/*    pofn->nFileExtension = ;*/
+/*    pofn->lpstrDefExt = _T("");*/
+/*    pofn->lCustData = ;*/
+/*    pofn->lpfnHook = ImportRegistryFile_OFNHookProc;*/
+/*    pofn->lpTemplateName = _T("ID_DLG_IMPORT_REGFILE");*/
+/*    pofn->lpTemplateName = MAKEINTRESOURCE(IDD_DIALOG1);*/
+/*    pofn->FlagsEx = ;*/
        return TRUE;
 }
 
@@ -251,29 +246,29 @@ static BOOL ImportRegistryFile(HWND hWnd)
 
     InitOpenFileName(hWnd, &ofn);
     ofn.lpstrTitle = _T("Import Registry File");
-//    ofn.lCustData = ;
+/*    ofn.lCustData = ;*/
     if (GetOpenFileName(&ofn)) {
         if (!import_registry_file(ofn.lpstrFile)) {
-            //printf("Can't open file \"%s\"\n", ofn.lpstrFile);
+            /*printf("Can't open file \"%s\"\n", ofn.lpstrFile);*/
             return FALSE;
         }
-/*
+#if 0
         get_file_name(&s, filename, MAX_PATH);
         if (!filename[0]) {
             printf("No file name is specified\n%s", usage);
             return FALSE;
-            //exit(1);
+            /*exit(1);*/
         }
         while (filename[0]) {
             if (!import_registry_file(filename)) {
                 perror("");
                 printf("Can't open file \"%s\"\n", filename);
                 return FALSE;
-                //exit(1);
+                /*exit(1);*/
             }
             get_file_name(&s, filename, MAX_PATH);
         }
- */
+#endif
     } else {
         CheckCommDlgError(hWnd);
     }
@@ -289,27 +284,27 @@ static BOOL ExportRegistryFile(HWND hWnd)
     ExportKeyPath[0] = _T('\0');
     InitOpenFileName(hWnd, &ofn);
     ofn.lpstrTitle = _T("Export Registry File");
-//    ofn.lCustData = ;
+/*    ofn.lCustData = ;*/
     ofn.Flags = OFN_ENABLETEMPLATE + OFN_EXPLORER;
     ofn.lpfnHook = ImportRegistryFile_OFNHookProc;
     ofn.lpTemplateName = MAKEINTRESOURCE(IDD_DIALOG1);
     if (GetSaveFileName(&ofn)) {
         BOOL result;
         result = export_registry_key(ofn.lpstrFile, ExportKeyPath);
-        //result = export_registry_key(ofn.lpstrFile, NULL);
-        //if (!export_registry_key(ofn.lpstrFile, NULL)) {
+        /*result = export_registry_key(ofn.lpstrFile, NULL);*/
+        /*if (!export_registry_key(ofn.lpstrFile, NULL)) {*/
         if (!result) {
-            //printf("Can't open file \"%s\"\n", ofn.lpstrFile);
+            /*printf("Can't open file \"%s\"\n", ofn.lpstrFile);*/
             return FALSE;
         }
-/*
+#if 0
         TCHAR filename[MAX_PATH];
         filename[0] = '\0';
         get_file_name(&s, filename, MAX_PATH);
         if (!filename[0]) {
             printf("No file name is specified\n%s", usage);
             return FALSE;
-            //exit(1);
+            /*exit(1);*/
         }
         if (s[0]) {
             TCHAR reg_key_name[KEY_MAX_LEN];
@@ -318,7 +313,7 @@ static BOOL ExportRegistryFile(HWND hWnd)
         } else {
             export_registry_key(filename, NULL);
         }
- */
+#endif
     } else {
         CheckCommDlgError(hWnd);
     }
@@ -333,19 +328,19 @@ BOOL PrintRegistryHive(HWND hWnd, LPTSTR path)
     ZeroMemory(&pd, sizeof(PRINTDLG));
     pd.lStructSize = sizeof(PRINTDLG);
     pd.hwndOwner   = hWnd;
-    pd.hDevMode    = NULL;     // Don't forget to free or store hDevMode
-    pd.hDevNames   = NULL;     // Don't forget to free or store hDevNames
-    pd.Flags       = PD_USEDEVMODECOPIESANDCOLLATE | PD_RETURNDC; 
+    pd.hDevMode    = NULL;     /* Don't forget to free or store hDevMode*/
+    pd.hDevNames   = NULL;     /* Don't forget to free or store hDevNames*/
+    pd.Flags       = PD_USEDEVMODECOPIESANDCOLLATE | PD_RETURNDC;
     pd.nCopies     = 1;
-    pd.nFromPage   = 0xFFFF; 
-    pd.nToPage     = 0xFFFF; 
-    pd.nMinPage    = 1; 
-    pd.nMaxPage    = 0xFFFF; 
+    pd.nFromPage   = 0xFFFF;
+    pd.nToPage     = 0xFFFF;
+    pd.nMinPage    = 1;
+    pd.nMaxPage    = 0xFFFF;
     if (PrintDlg(&pd) == TRUE) {
-        // GDI calls to render output. 
-        DeleteDC(pd.hDC); // Delete DC when done.
+        /* GDI calls to render output. */
+        DeleteDC(pd.hDC); /* Delete DC when done.*/
     }
-#else    
+#else
     HRESULT hResult;
     PRINTDLGEX pd;
 
@@ -353,13 +348,13 @@ BOOL PrintRegistryHive(HWND hWnd, LPTSTR path)
     if (hResult == S_OK) {
         switch (pd.dwResultAction) {
         case PD_RESULT_APPLY:
-            //The user clicked the Apply button and later clicked the Cancel button. This indicates that the user wants to apply the changes made in the property sheet, but does not yet want to print. The PRINTDLGEX structure contains the information specified by the user at the time the Apply button was clicked. 
+            /*The user clicked the Apply button and later clicked the Cancel button. This indicates that the user wants to apply the changes made in the property sheet, but does not yet want to print. The PRINTDLGEX structure contains the information specified by the user at the time the Apply button was clicked. */
             break;
         case PD_RESULT_CANCEL:
-            //The user clicked the Cancel button. The information in the PRINTDLGEX structure is unchanged. 
+            /*The user clicked the Cancel button. The information in the PRINTDLGEX structure is unchanged. */
             break;
         case PD_RESULT_PRINT:
-            //The user clicked the Print button. The PRINTDLGEX structure contains the information specified by the user. 
+            /*The user clicked the Print button. The PRINTDLGEX structure contains the information specified by the user. */
             break;
         default:
             break;
@@ -367,19 +362,19 @@ BOOL PrintRegistryHive(HWND hWnd, LPTSTR path)
     } else {
         switch (hResult) {
         case E_OUTOFMEMORY:
-            //Insufficient memory. 
+            /*Insufficient memory. */
             break;
         case E_INVALIDARG:
-            // One or more arguments are invalid. 
+            /* One or more arguments are invalid. */
             break;
         case E_POINTER:
-            //Invalid pointer. 
+            /*Invalid pointer. */
             break;
         case E_HANDLE:
-            //Invalid handle. 
+            /*Invalid handle. */
             break;
         case E_FAIL:
-            //Unspecified error. 
+            /*Unspecified error. */
             break;
         default:
             break;
@@ -393,33 +388,36 @@ BOOL PrintRegistryHive(HWND hWnd, LPTSTR path)
 BOOL CopyKeyName(HWND hWnd, LPTSTR keyName)
 {
     BOOL result;
-    
+
     result = OpenClipboard(hWnd);
     if (result) {
         result = EmptyClipboard();
         if (result) {
 
-            //HANDLE hClipData;
-            //hClipData = SetClipboardData(UINT uFormat, HANDLE hMem);
+            /*HANDLE hClipData;*/
+            /*hClipData = SetClipboardData(UINT uFormat, HANDLE hMem);*/
 
         } else {
-            // error emptying clipboard
-            DWORD dwError = GetLastError();
+            /* error emptying clipboard*/
+            /* DWORD dwError = GetLastError(); */
+            ;
         }
         if (!CloseClipboard()) {
-            // error closing clipboard
-            DWORD dwError = GetLastError();
+            /* error closing clipboard*/
+            /* DWORD dwError = GetLastError(); */
+            ;
         }
     } else {
-        // error opening clipboard
-        DWORD dwError = GetLastError();
+        /* error opening clipboard*/
+        /* DWORD dwError = GetLastError(); */
+        ;
     }
     return result;
 }
 
 BOOL RefreshView(HWND hWnd)
 {
-    // TODO:
+    /* TODO:*/
     MessageBeep(-1);
     MessageBeep(MB_ICONASTERISK);
     MessageBeep(MB_ICONEXCLAMATION);
@@ -429,17 +427,17 @@ BOOL RefreshView(HWND hWnd)
     return TRUE;
 }
 
-////////////////////////////////////////////////////////////////////////////////
-//
-//  FUNCTION: _CmdWndProc(HWND, unsigned, WORD, LONG)
-//
-//  PURPOSE:  Processes WM_COMMAND messages for the main frame window.
-//
-//
+/*******************************************************************************
+ *
+ *  FUNCTION: _CmdWndProc(HWND, unsigned, WORD, LONG)
+ *
+ *  PURPOSE:  Processes WM_COMMAND messages for the main frame window.
+ *
+ */
 static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 {
        switch (LOWORD(wParam)) {
-    // Parse the menu selections:
+    /* Parse the menu selections:*/
     case ID_REGISTRY_IMPORTREGISTRYFILE:
         ImportRegistryFile(hWnd);
         break;
@@ -457,10 +455,10 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
         CopyKeyName(hWnd, _T(""));
         break;
     case ID_REGISTRY_PRINTERSETUP:
-        //PRINTDLG pd;
-        //PrintDlg(&pd);
-        //PAGESETUPDLG psd;
-        //PageSetupDlg(&psd);
+        /*PRINTDLG pd;*/
+        /*PrintDlg(&pd);*/
+        /*PAGESETUPDLG psd;*/
+        /*PageSetupDlg(&psd);*/
         break;
     case ID_REGISTRY_OPENLOCAL:
         break;
@@ -470,19 +468,19 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
     case ID_VIEW_REFRESH:
         RefreshView(hWnd);
         break;
-//     case ID_OPTIONS_TOOLBAR:
-//             toggle_child(hWnd, LOWORD(wParam), hToolBar);
-//      break;
+/*     case ID_OPTIONS_TOOLBAR:*/
+/*             toggle_child(hWnd, LOWORD(wParam), hToolBar);*/
+/*      break;*/
        case ID_VIEW_STATUSBAR:
                toggle_child(hWnd, LOWORD(wParam), hStatusBar);
         break;
     case ID_HELP_HELPTOPICS:
-//             WinHelp(hWnd, _T("regedit"), HELP_CONTENTS, 0);
+/*             WinHelp(hWnd, _T("regedit"), HELP_CONTENTS, 0);*/
                WinHelp(hWnd, _T("regedit"), HELP_FINDER, 0);
         break;
     case ID_HELP_ABOUT:
 #ifdef WINSHELLAPI
-//        ShellAbout(hWnd, szTitle, _T(""), LoadIcon(hInst, (LPCTSTR)IDI_REGEDIT));
+/*        ShellAbout(hWnd, szTitle, _T(""), LoadIcon(hInst, (LPCTSTR)IDI_REGEDIT));*/
 #else
         ShowAboutBox(hWnd);
 #endif
@@ -493,16 +491,16 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
        return TRUE;
 }
 
-////////////////////////////////////////////////////////////////////////////////
-//
-//  FUNCTION: FrameWndProc(HWND, unsigned, WORD, LONG)
-//
-//  PURPOSE:  Processes messages for the main frame window.
-//
-//  WM_COMMAND  - process the application menu
-//  WM_DESTROY  - post a quit message and return
-//
-//
+/********************************************************************************
+ *
+ *  FUNCTION: FrameWndProc(HWND, unsigned, WORD, LONG)
+ *
+ *  PURPOSE:  Processes messages for the main frame window.
+ *
+ *  WM_COMMAND  - process the application menu
+ *  WM_DESTROY  - post a quit message and return
+ *
+ */
 
 LRESULT CALLBACK FrameWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 {
@@ -514,7 +512,7 @@ LRESULT CALLBACK FrameWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
         pChildWnd = HeapAlloc(GetProcessHeap(), 0, sizeof(ChildWnd));
         _tcsncpy(pChildWnd->szPath, _T("My Computer"), MAX_PATH);
         hChildWnd = CreateWindowEx(0, szChildClass, _T("regedit child window"),
-//                    WS_CHILD|WS_CLIPCHILDREN|WS_VISIBLE|WS_BORDER,
+/*                    WS_CHILD|WS_CLIPCHILDREN|WS_VISIBLE|WS_BORDER,*/
                     WS_CHILD|WS_VISIBLE | WS_EX_CLIENTEDGE,
                     CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
                     hWnd, (HMENU)0, hInst, pChildWnd);
@@ -522,9 +520,9 @@ LRESULT CALLBACK FrameWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
         break;
     case WM_COMMAND:
         if (!_CmdWndProc(hWnd, message, wParam, lParam)) {
-                   return DefWindowProc(hWnd, message, wParam, lParam);
+            return DefWindowProc(hWnd, message, wParam, lParam);
         }
-               break;
+        break;
     case WM_SIZE:
         resize_frame_client(hWnd);
         break;
@@ -544,7 +542,7 @@ LRESULT CALLBACK FrameWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
             HeapFree(GetProcessHeap(), 0, pChildWnd);
             pChildWnd = NULL;
         }
-               WinHelp(hWnd, _T("regedit"), HELP_QUIT, 0);
+        WinHelp(hWnd, _T("regedit"), HELP_QUIT, 0);
         PostQuitMessage(0);
     default:
         return DefWindowProc(hWnd, message, wParam, lParam);
similarity index 70%
rename from rosapps/regedit/listview.c
rename to reactos/subsys/system/regedit/listview.c
index df61d98..92dd153 100644 (file)
@@ -1,9 +1,7 @@
 /*
- *  ReactOS regedit
+ * Regedit listviews
  *
- *  listview.c
- *
- *  Copyright (C) 2002  Robert Dickenson <robd@reactos.org>
+ * Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#define WIN32_LEAN_AND_MEAN     // Exclude rarely-used stuff from Windows headers
 #include <windows.h>
 #include <commctrl.h>
 #include <stdlib.h>
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
-    
+
 #include "commctrl.h"
 
 #include <windowsx.h>
 #include "main.h"
-#include "listview.h"
-#include "hex_str.h"
 
 
-////////////////////////////////////////////////////////////////////////////////
-// Global and Local Variables:
-//
+/*******************************************************************************
+ * Global and Local Variables:
+ */
 
 static WNDPROC g_orgListWndProc;
 
@@ -47,35 +42,33 @@ static int default_column_widths[MAX_LIST_COLUMNS] = { 200, 175, 400 };
 static int column_alignment[MAX_LIST_COLUMNS] = { LVCFMT_LEFT, LVCFMT_LEFT, LVCFMT_LEFT };
 
 
-////////////////////////////////////////////////////////////////////////////////
-// Local module support methods
-//
-extern unsigned char AsciiTable[256][3];
-
+/*******************************************************************************
+ * Local module support methods
+ */
 static void AddEntryToList(HWND hwndLV, LPTSTR Name, DWORD dwValType, void* ValBuf, DWORD dwCount)
-{ 
+{
     LVITEM item;
     int index;
 
-    item.mask = LVIF_TEXT | LVIF_PARAM; 
-    item.iItem = 0;//idx; 
-    item.iSubItem = 0; 
-    item.state = 0; 
-    item.stateMask = 0; 
-    item.pszText = Name; 
-    item.cchTextMax = _tcslen(item.pszText); 
+    item.mask = LVIF_TEXT | LVIF_PARAM;
+    item.iItem = 0;/*idx;  */
+    item.iSubItem = 0;
+    item.state = 0;
+    item.stateMask = 0;
+    item.pszText = Name;
+    item.cchTextMax = _tcslen(item.pszText);
     if (item.cchTextMax == 0)
-        item.pszText = LPSTR_TEXTCALLBACK; 
-    item.iImage = 0; 
+        item.pszText = LPSTR_TEXTCALLBACK;
+    item.iImage = 0;
     item.lParam = (LPARAM)dwValType;
-//    item.lParam = (LPARAM)ValBuf;
+/*    item.lParam = (LPARAM)ValBuf; */
 #if (_WIN32_IE >= 0x0300)
     item.iIndent = 0;
 #endif
 
     index = ListView_InsertItem(hwndLV, &item);
     if (index != -1) {
-//        LPTSTR pszText = NULL;
+/*        LPTSTR pszText = NULL; */
         LPTSTR pszText = _T("value");
         switch (dwValType) {
         case REG_SZ:
@@ -88,28 +81,22 @@ static void AddEntryToList(HWND hwndLV, LPTSTR Name, DWORD dwValType, void* ValB
                 wsprintf(buf, _T("0x%08X (%d)"), *(DWORD*)ValBuf, *(DWORD*)ValBuf);
                 ListView_SetItemText(hwndLV, index, 2, buf);
             }
-//            lpsRes = convertHexToDWORDStr(lpbData, dwLen);
+/*            lpsRes = convertHexToDWORDStr(lpbData, dwLen); */
             break;
         case REG_BINARY:
             {
                 unsigned int i;
-                LPTSTR pData = (LPTSTR)ValBuf;
+                LPBYTE pData = (LPBYTE)ValBuf;
                 LPTSTR strBinary = HeapAlloc(GetProcessHeap(), 0, dwCount * sizeof(TCHAR) * 3 + 1);
-                memset(strBinary, _T(' '), dwCount * sizeof(TCHAR) * 3);
-                strBinary[dwCount * sizeof(TCHAR) * 3] = _T('\0');
-                for (i = 0; i < dwCount; i++) {
-                    unsigned short* pShort;
-                    pShort = (unsigned short*)&(strBinary[i*3]);
-//                    strBinary[i*3] = Byte2Hex((LPTSTR)ValBuf+i);
-//                    *pShort++ = Byte2Hex(*(pData+i));
-                    *pShort = Byte2Hex(*(pData+i));
-                }
+                for (i = 0; i < dwCount; i++)
+                    wsprintf( strBinary + i*3, _T("%02X "), pData[i] );
+                strBinary[dwCount * 3] = 0;
                 ListView_SetItemText(hwndLV, index, 2, strBinary);
                 HeapFree(GetProcessHeap(), 0, strBinary);
             }
             break;
         default:
-//            lpsRes = convertHexToHexCSV(lpbData, dwLen);
+/*            lpsRes = convertHexToHexCSV(lpbData, dwLen); */
             ListView_SetItemText(hwndLV, index, 2, pszText);
             break;
         }
@@ -121,32 +108,32 @@ static void CreateListColumns(HWND hWndListView)
     TCHAR szText[50];
     int index;
     LV_COLUMN lvC;
-    // Create columns.
+
+    /* Create columns. */
     lvC.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
     lvC.pszText = szText;
 
-    // Load the column labels from the resource file.
+    /* Load the column labels from the resource file. */
     for (index = 0; index < MAX_LIST_COLUMNS; index++) {
         lvC.iSubItem = index;
         lvC.cx = default_column_widths[index];
         lvC.fmt = column_alignment[index];
         LoadString(hInst, IDS_LIST_COLUMN_FIRST + index, szText, sizeof(szText)/sizeof(TCHAR));
         if (ListView_InsertColumn(hWndListView, index, &lvC) == -1) {
-            // TODO: handle failure condition...
+            /* TODO: handle failure condition... */
             break;
         }
     }
 }
 
-// OnGetDispInfo - processes the LVN_GETDISPINFO notification message. 
+/* OnGetDispInfo - processes the LVN_GETDISPINFO notification message.  */
+
 static void OnGetDispInfo(NMLVDISPINFO* plvdi)
 {
     static TCHAR buffer[200];
 
     plvdi->item.pszText = NULL;
-    plvdi->item.cchTextMax = 0; 
+    plvdi->item.cchTextMax = 0;
 
     switch (plvdi->item.iSubItem) {
     case 0:
@@ -166,9 +153,9 @@ static void OnGetDispInfo(NMLVDISPINFO* plvdi)
         case REG_DWORD:
             plvdi->item.pszText = _T("REG_DWORD");
             break;
-//        case REG_DWORD_LITTLE_ENDIAN:
-//            plvdi->item.pszText = _T("REG_DWORD_LITTLE_ENDIAN");
-//            break;
+/*        case REG_DWORD_LITTLE_ENDIAN: */
+/*            plvdi->item.pszText = _T("REG_DWORD_LITTLE_ENDIAN"); */
+/*            break; */
         case REG_DWORD_BIG_ENDIAN:
             plvdi->item.pszText = _T("REG_DWORD_BIG_ENDIAN");
             break;
@@ -197,7 +184,7 @@ static void OnGetDispInfo(NMLVDISPINFO* plvdi)
         plvdi->item.pszText = _T("");
         break;
     }
-} 
+}
 
 #if 0
 static int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
@@ -218,8 +205,8 @@ static void ListViewPopUpMenu(HWND hWnd, POINT pt)
 static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 {
        switch (LOWORD(wParam)) {
-//    case ID_FILE_OPEN:
-//        break;
+/*    case ID_FILE_OPEN: */
+/*        break; */
        default:
         return FALSE;
        }
@@ -235,27 +222,27 @@ static LRESULT CALLBACK ListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPAR
         }
                break;
     case WM_NOTIFY:
-        switch (((LPNMHDR)lParam)->code) { 
-        case LVN_GETDISPINFO: 
-            OnGetDispInfo((NMLVDISPINFO*)lParam); 
-            break; 
+        switch (((LPNMHDR)lParam)->code) {
+        case LVN_GETDISPINFO:
+            OnGetDispInfo((NMLVDISPINFO*)lParam);
+            break;
         case NM_DBLCLK:
             {
             NMITEMACTIVATE* nmitem = (LPNMITEMACTIVATE)lParam;
             LVHITTESTINFO info;
 
-            if (nmitem->hdr.hwndFrom != hWnd) break; 
-//            if (nmitem->hdr.idFrom != IDW_LISTVIEW) break; 
-//            if (nmitem->hdr.code != ???) break; 
+            if (nmitem->hdr.hwndFrom != hWnd) break;
+/*            if (nmitem->hdr.idFrom != IDW_LISTVIEW) break;  */
+/*            if (nmitem->hdr.code != ???) break;  */
 #ifdef _MSC_VER
             switch (nmitem->uKeyFlags) {
-            case LVKF_ALT:     //  The ALT key is pressed.  
-                // properties dialog box ?
+            case LVKF_ALT:     /*  The ALT key is pressed.   */
+                /* properties dialog box ? */
                 break;
-            case LVKF_CONTROL: //  The CTRL key is pressed.
-                // run dialog box for providing parameters...
+            case LVKF_CONTROL: /*  The CTRL key is pressed. */
+                /* run dialog box for providing parameters... */
                 break;
-            case LVKF_SHIFT:   //  The SHIFT key is pressed.   
+            case LVKF_SHIFT:   /*  The SHIFT key is pressed.    */
                 break;
             }
 #endif
@@ -277,7 +264,7 @@ static LRESULT CALLBACK ListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPAR
             LV_HITTESTINFO lvH;
             NM_LISTVIEW* pNm = (NM_LISTVIEW*)lParam;
             lvH.pt.x = pNm->ptAction.x;
-            lvH.pt.y = pNm->ptAction.y;     
+            lvH.pt.y = pNm->ptAction.y;
             idx = ListView_HitTest(hWnd, &lvH);
             if (idx != -1) {
                 POINT pt;
@@ -294,10 +281,10 @@ static LRESULT CALLBACK ListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPAR
                break;
        case WM_KEYDOWN:
                if (wParam == VK_TAB) {
-                       //TODO: SetFocus(Globals.hDriveBar)
-                       //SetFocus(child->nFocusPanel? child->left.hWnd: child->right.hWnd);
+                       /*TODO: SetFocus(Globals.hDriveBar) */
+                       /*SetFocus(child->nFocusPanel? child->left.hWnd: child->right.hWnd); */
                }
-        // fall thru...
+        /* fall thru... */
     default:
         return CallWindowProc(g_orgListWndProc, hWnd, message, wParam, lParam);
         break;
@@ -307,33 +294,33 @@ static LRESULT CALLBACK ListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPAR
 
 
 HWND CreateListView(HWND hwndParent, int id)
-{ 
+{
     RECT rcClient;
     HWND hwndLV;
-    // 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 | LVS_REPORT, 
-        0, 0, rcClient.right, rcClient.bottom, 
-        hwndParent, (HMENU)id, hInst, NULL); 
+
+    /* 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 | LVS_REPORT,
+        0, 0, rcClient.right, rcClient.bottom,
+        hwndParent, (HMENU)id, hInst, NULL);
     ListView_SetExtendedListViewStyle(hwndLV,  LVS_EX_FULLROWSELECT);
-    // Initialize the image list, and add items to the control. 
+
+    /* Initialize the image list, and add items to the control.  */
 /*
-    if (!InitListViewImageLists(hwndLV) || 
-            !InitListViewItems(hwndLV, szName)) { 
-        DestroyWindow(hwndLV); 
-        return FALSE; 
-    } 
+    if (!InitListViewImageLists(hwndLV) ||
+            !InitListViewItems(hwndLV, szName)) {
+        DestroyWindow(hwndLV);
+        return FALSE;
+    }
  */
     CreateListColumns(hwndLV);
        g_orgListWndProc = SubclassWindow(hwndLV, ListWndProc);
     return hwndLV;
-} 
+}
 
 BOOL RefreshListView(HWND hwndLV, HKEY hKey, LPTSTR keyPath)
-{ 
+{
     if (hwndLV != NULL) {
         ListView_DeleteAllItems(hwndLV);
     }
@@ -351,7 +338,7 @@ BOOL RefreshListView(HWND hwndLV, HKEY hKey, LPTSTR keyPath)
             errCode = RegQueryInfoKey(hNewKey, NULL, NULL, NULL, NULL,
                         &max_sub_key_len, NULL, &val_count, &max_val_name_len, &max_val_size, NULL, NULL);
 
-#define BUF_HEAD_SPACE 2 // TODO: check why this is required with ROS ???
+#define BUF_HEAD_SPACE 2 /* TODO: check why this is required with ROS ??? */
 
             if (errCode == ERROR_SUCCESS) {
                 TCHAR* ValName = HeapAlloc(GetProcessHeap(), 0, ++max_val_name_len * sizeof(TCHAR) + BUF_HEAD_SPACE);
@@ -360,10 +347,10 @@ BOOL RefreshListView(HWND hwndLV, HKEY hKey, LPTSTR keyPath)
                 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);
-//                }
-//                dwValSize = max_val_size;
+/*                if (RegQueryValueEx(hNewKey, NULL, NULL, &dwValType, ValBuf, &dwValSize) == ERROR_SUCCESS) { */
+/*                    AddEntryToList(hwndLV, _T("(Default)"), dwValType, ValBuf, dwValSize); */
+/*                } */
+/*                dwValSize = max_val_size; */
                 while (RegEnumValue(hNewKey, dwIndex, ValName, &dwValNameLen, NULL, &dwValType, ValBuf, &dwValSize) == ERROR_SUCCESS) {
                     ValBuf[dwValSize] = 0;
                     AddEntryToList(hwndLV, ValName, dwValType, ValBuf, dwValSize);
@@ -375,12 +362,11 @@ BOOL RefreshListView(HWND hwndLV, HKEY hKey, LPTSTR keyPath)
                 HeapFree(GetProcessHeap(), 0, ValBuf);
                 HeapFree(GetProcessHeap(), 0, ValName);
             }
-            //ListView_SortItemsEx(hwndLV, CompareFunc, hwndLV);
-//            SendMessage(hwndLV, LVM_SORTITEMSEX, (WPARAM)CompareFunc, (LPARAM)hwndLV);
+            /*ListView_SortItemsEx(hwndLV, CompareFunc, hwndLV); */
+/*            SendMessage(hwndLV, LVM_SORTITEMSEX, (WPARAM)CompareFunc, (LPARAM)hwndLV); */
             ShowWindow(hwndLV, SW_SHOW);
             RegCloseKey(hNewKey);
         }
     }
     return TRUE;
-} 
-
+}
similarity index 53%
rename from rosapps/regedit/main.c
rename to reactos/subsys/system/regedit/main.c
index ac544a2..d035794 100644 (file)
@@ -1,9 +1,7 @@
 /*
- *  ReactOS regedit
+ * Regedit main function
  *
- *  main.c
- *
- *  Copyright (C) 2002  Robert Dickenson <robd@reactos.org>
+ * Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -20,7 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#define WIN32_LEAN_AND_MEAN     // Exclude rarely-used stuff from Windows headers
+#define WIN32_LEAN_AND_MEAN     /* Exclude rarely-used stuff from Windows headers */
 #include <windows.h>
 #include <commctrl.h>
 #include <stdlib.h>
 #include <process.h>
 #include <stdio.h>
 #include <fcntl.h>
-    
+
+#define REGEDIT_DECLARE_FUNCTIONS
 #include "main.h"
-#include "framewnd.h"
-#include "childwnd.h"
 
 
 BOOL ProcessCmdLine(LPSTR lpCmdLine);
 
 
-////////////////////////////////////////////////////////////////////////////////
-// Global Variables:
-//
+/*******************************************************************************
+ * Global Variables:
+ */
 
 HINSTANCE hInst;
 HWND hFrameWnd;
@@ -54,18 +51,128 @@ TCHAR szFrameClass[MAX_LOADSTRING];
 TCHAR szChildClass[MAX_LOADSTRING];
 
 
-////////////////////////////////////////////////////////////////////////////////
-//
-//
-//   FUNCTION: InitInstance(HANDLE, int)
-//
-//   PURPOSE: Saves instance handle and creates main window
-//
-//   COMMENTS:
-//
-//        In this function, we save the instance handle in a global variable and
-//        create and display the main program window.
-//
+/*******************************************************************************
+ *
+ *   FUNCTION: DynamicBind( void )
+ *
+ *   PURPOSE: Binds all functions dependent on user32.dll
+ */
+static BOOL DynamicBind( void )
+{
+    HMODULE dll;
+
+#define d(x)                                                             \
+    p##x = (typeof (x) ) GetProcAddress( dll, #x );                      \
+    if( ! p##x )                                                         \
+    {                                                                    \
+        fprintf(stderr,"failed to bind function at line %d\n",__LINE__); \
+        return FALSE;                                                    \
+    }                                                                    \
+
+
+    dll = LoadLibrary("user32");
+    if( !dll )
+        return FALSE;
+
+    d(BeginDeferWindowPos)
+    d(BeginPaint)
+    d(CallWindowProcA)
+    d(CheckMenuItem)
+    d(CloseClipboard)
+    d(CreateWindowExA)
+    d(DefWindowProcA)
+    d(DeferWindowPos)
+    d(DestroyMenu)
+    d(DestroyWindow)
+    d(DialogBoxParamA)
+    d(DispatchMessageA)
+    d(EmptyClipboard)
+    d(EndDeferWindowPos)
+    d(EndDialog)
+    d(EndPaint)
+    d(FillRect)
+    d(GetCapture)
+    d(GetClientRect)
+    d(GetCursorPos)
+    d(GetDC)
+    d(GetDlgItem)
+    d(GetMenu)
+    d(GetMessageA)
+    d(GetSubMenu)
+    d(GetSystemMetrics)
+    d(InvertRect)
+    d(IsWindowVisible)
+    d(LoadAcceleratorsA)
+    d(LoadBitmapA)
+    d(LoadCursorA)
+    d(LoadIconA)
+    d(LoadImageA)
+    d(LoadMenuA)
+    d(LoadStringA)
+    d(MessageBeep)
+    d(MoveWindow)
+    d(OpenClipboard)
+    d(PostQuitMessage)
+    d(RegisterClassExA)
+    d(RegisterClipboardFormatA)
+    d(ReleaseCapture)
+    d(ReleaseDC)
+    d(ScreenToClient)
+    d(SendMessageA)
+    d(SetCapture)
+    d(SetCursor)
+    d(SetFocus)
+    d(SetWindowLongA)
+    d(SetWindowTextA)
+    d(ShowWindow)
+    d(TranslateAccelerator)
+    d(TranslateMessage)
+    d(UpdateWindow)
+    d(WinHelpA)
+    d(wsprintfA)
+
+    dll = LoadLibrary("gdi32");
+    if( !dll )
+        return FALSE;
+
+    d(DeleteDC)
+    d(DeleteObject)
+    d(GetStockObject)
+
+    dll = LoadLibrary("comctl32");
+    if( !dll )
+        return FALSE;
+
+    d(CreateStatusWindowA)
+    d(ImageList_Add)
+    d(ImageList_Create)
+    d(ImageList_GetImageCount)
+    d(InitCommonControls)
+
+    dll = LoadLibrary("comdlg32");
+    if( !dll )
+        return FALSE;
+
+    d(CommDlgExtendedError)
+    d(GetOpenFileNameA)
+    d(GetSaveFileNameA)
+    d(PrintDlgA)
+
+    return TRUE;
+}
+
+/*******************************************************************************
+ *
+ *
+ *   FUNCTION: InitInstance(HANDLE, int)
+ *
+ *   PURPOSE: Saves instance handle and creates main window
+ *
+ *   COMMENTS:
+ *
+ *        In this function, we save the instance handle in a global variable and
+ *        create and display the main program window.
+ */
 
 BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
 {
@@ -84,7 +191,7 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
         (HICON)LoadImage(hInstance, MAKEINTRESOURCE(IDI_REGEDIT), IMAGE_ICON,
             GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED)
     };
-    ATOM hFrameWndClass = RegisterClassEx(&wcFrame); // register frame window class
+    ATOM hFrameWndClass = RegisterClassEx(&wcFrame); /* register frame window class */
 
     WNDCLASSEX wcChild = {
         sizeof(WNDCLASSEX),
@@ -102,18 +209,18 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
             GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED)
 
     };
-    ATOM hChildWndClass = RegisterClassEx(&wcChild); // register child windows class
-    hChildWndClass = hChildWndClass; // warning eater
+    ATOM hChildWndClass = RegisterClassEx(&wcChild); /* register child windows class */
+    hChildWndClass = hChildWndClass; /* warning eater */
 
        hMenuFrame = LoadMenu(hInstance, MAKEINTRESOURCE(IDR_REGEDIT_MENU));
 
-    // Initialize the Windows Common Controls DLL
+    /* Initialize the Windows Common Controls DLL */
     InitCommonControls();
 
     nClipboardFormat = RegisterClipboardFormat(strClipboardFormat);
-    if (nClipboardFormat == 0) {
+    /* if (nClipboardFormat == 0) {
         DWORD dwError = GetLastError();
-    }
+    } */
 
     hFrameWnd = CreateWindowEx(0, (LPCTSTR)(int)hFrameWndClass, szTitle,
                     WS_OVERLAPPEDWINDOW | WS_EX_CLIENTEDGE,
@@ -124,11 +231,11 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
         return FALSE;
     }
 
-    // Create the status bar
-    hStatusBar = CreateStatusWindow(WS_VISIBLE|WS_CHILD|WS_CLIPSIBLINGS|SBT_NOBORDERS, 
+    /* Create the status bar */
+    hStatusBar = CreateStatusWindow(WS_VISIBLE|WS_CHILD|WS_CLIPSIBLINGS|SBT_NOBORDERS,
                                     _T(""), hFrameWnd, STATUS_WINDOW);
     if (hStatusBar) {
-        // Create the status bar panes
+        /* Create the status bar panes */
         SetupStatusBar(hFrameWnd, FALSE);
         CheckMenuItem(GetSubMenu(hMenuFrame, ID_VIEW_MENU), ID_VIEW_STATUSBAR, MF_BYCOMMAND|MF_CHECKED);
     }
@@ -137,7 +244,7 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
     return TRUE;
 }
 
-////////////////////////////////////////////////////////////////////////////////
+/******************************************************************************/
 
 void ExitInstance(void)
 {
@@ -158,7 +265,7 @@ int APIENTRY WinMain(HINSTANCE hInstance,
     hCrt = _open_osfhandle((long)GetStdHandle(STD_OUTPUT_HANDLE), _O_TEXT);
     hf = _fdopen(hCrt, "w");
     *stdout = *hf;
-    setvbuf(stdout, NULL, _IONBF, 0); 
+    setvbuf(stdout, NULL, _IONBF, 0);
 
        wprintf(L"command line exit, hInstance = %d\n", hInstance);
        getch();
@@ -170,21 +277,25 @@ int APIENTRY WinMain(HINSTANCE hInstance,
         return 0;
     }
 
-    // Initialize global strings
+    if (!DynamicBind()) {
+        return 0;
+    }
+
+    /* Initialize global strings */
     LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
     LoadString(hInstance, IDC_REGEDIT_FRAME, szFrameClass, MAX_LOADSTRING);
     LoadString(hInstance, IDC_REGEDIT, szChildClass, MAX_LOADSTRING);
-    
-    // Store instance handle in our global variable
+
+    /* Store instance handle in our global variable */
     hInst = hInstance;
 
-    // Perform application initialization:
+    /* Perform application initialization */
     if (!InitInstance(hInstance, nCmdShow)) {
         return FALSE;
     }
     hAccel = LoadAccelerators(hInstance, (LPCTSTR)IDC_REGEDIT);
 
-    // Main message loop:
+    /* Main message loop */
     while (GetMessage(&msg, (HWND)NULL, 0, 0)) {
         if (!TranslateAccelerator(msg.hwnd, hAccel, &msg)) {
             TranslateMessage(&msg);
diff --git a/reactos/subsys/system/regedit/main.h b/reactos/subsys/system/regedit/main.h
new file mode 100644 (file)
index 0000000..19532bd
--- /dev/null
@@ -0,0 +1,256 @@
+/*
+ * Regedit definitions
+ *
+ * Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __MAIN_H__
+#define __MAIN_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "resource.h"
+
+
+#define STATUS_WINDOW   2001
+#define TREE_WINDOW     2002
+#define LIST_WINDOW     2003
+
+#define MAX_LOADSTRING  100
+#define        SPLIT_WIDTH             5
+#define MAX_NAME_LEN    500
+
+
+/******************************************************************************/
+
+enum OPTION_FLAGS {
+    OPTIONS_AUTO_REFRESH               = 0x01,
+    OPTIONS_READ_ONLY_MODE             = 0x02,
+    OPTIONS_CONFIRM_ON_DELETE          = 0x04,
+    OPTIONS_SAVE_ON_EXIT                  = 0x08,
+    OPTIONS_DISPLAY_BINARY_DATA           = 0x10,
+    OPTIONS_VIEW_TREE_ONLY                = 0x20,
+    OPTIONS_VIEW_DATA_ONLY                = 0x40,
+};
+
+typedef struct {
+       HWND    hWnd;
+    HWND    hTreeWnd;
+    HWND    hListWnd;
+    int     nFocusPanel;      /* 0: left  1: right */
+       int             nSplitPos;
+       WINDOWPLACEMENT pos;
+       TCHAR   szPath[MAX_PATH];
+} ChildWnd;
+
+/*******************************************************************************
+ * Global Variables:
+ */
+extern HINSTANCE hInst;
+extern HWND      hFrameWnd;
+extern HMENU     hMenuFrame;
+extern HWND      hStatusBar;
+extern HFONT     hFont;
+extern enum OPTION_FLAGS Options;
+
+extern TCHAR szTitle[];
+extern TCHAR szFrameClass[];
+extern TCHAR szChildClass[];
+
+/*******************************************************************************
+ * Dynamically load all things that depend on user32.dll
+ */
+#include "winuser.h"
+#include "wingdi.h"
+#include "commctrl.h"
+#include "commdlg.h"
+
+#ifdef REGEDIT_DECLARE_FUNCTIONS
+#define d(x) typeof(x) *p##x = NULL;
+#else
+#define d(x) extern typeof(x) *p##x;
+#endif
+
+d(BeginDeferWindowPos)
+d(BeginPaint)
+d(CallWindowProcA)
+d(CheckMenuItem)
+d(CloseClipboard)
+d(CommDlgExtendedError)
+d(CreateStatusWindowA)
+d(CreateWindowExA)
+d(DefWindowProcA)
+d(DeferWindowPos)
+d(DeleteDC)
+d(DeleteObject)
+d(DestroyMenu)
+d(DestroyWindow)
+d(DialogBoxParamA)
+d(DispatchMessageA)
+d(EmptyClipboard)
+d(EndDeferWindowPos)
+d(EndPaint)
+d(EndDialog)
+d(FillRect)
+d(GetCapture)
+d(GetClientRect)
+d(GetCursorPos)
+d(GetDC)
+d(GetDlgItem)
+d(GetMenu)
+d(GetMessageA)
+d(GetOpenFileNameA)
+d(GetSaveFileNameA)
+d(GetStockObject)
+d(GetSubMenu)
+d(GetSystemMetrics)
+d(ImageList_Add)
+d(ImageList_Create)
+d(ImageList_GetImageCount)
+d(InitCommonControls)
+d(InvertRect)
+d(IsWindowVisible)
+d(LoadAcceleratorsA)
+d(LoadBitmapA)
+d(LoadCursorA)
+d(LoadIconA)
+d(LoadImageA)
+d(LoadMenuA)
+d(LoadStringA)
+d(MessageBeep)
+d(MoveWindow)
+d(OpenClipboard)
+d(PostQuitMessage)
+d(PrintDlgA)
+d(RegisterClassExA)
+d(RegisterClipboardFormatA)
+d(ReleaseCapture)
+d(ReleaseDC)
+d(ScreenToClient)
+d(SendMessageA)
+d(SetCapture)
+d(SetCursor)
+d(SetFocus)
+d(SetWindowLongA)
+d(SetWindowTextA)
+d(ShowWindow)
+d(TranslateAccelerator)
+d(TranslateMessage)
+d(UpdateWindow)
+d(WinHelpA)
+d(wsprintfA)
+
+#undef d
+
+#define BeginDeferWindowPos pBeginDeferWindowPos
+#define BeginPaint pBeginPaint
+#define CallWindowProcA pCallWindowProcA
+#define CheckMenuItem pCheckMenuItem
+#define CloseClipboard pCloseClipboard
+#define CommDlgExtendedError pCommDlgExtendedError
+#define CreateStatusWindowA pCreateStatusWindowA
+#define CreateWindowExA pCreateWindowExA
+#define DefWindowProcA pDefWindowProcA
+#define DeferWindowPos pDeferWindowPos
+#define DeleteDC pDeleteDC
+#define DeleteObject pDeleteObject
+#define DestroyMenu pDestroyMenu
+#define DestroyWindow pDestroyWindow
+#define DialogBoxParamA pDialogBoxParamA
+#define DispatchMessageA pDispatchMessageA
+#define EmptyClipboard pEmptyClipboard
+#define EndDeferWindowPos pEndDeferWindowPos
+#define EndDialog pEndDialog
+#define EndPaint pEndPaint
+#define FillRect pFillRect
+#define GetCapture pGetCapture
+#define GetClientRect pGetClientRect
+#define GetCursorPos pGetCursorPos
+#define GetDC pGetDC
+#define GetDlgItem pGetDlgItem
+#define GetMenu pGetMenu
+#define GetMessageA pGetMessageA
+#define GetOpenFileNameA pGetOpenFileNameA
+#define GetSaveFileNameA pGetSaveFileNameA
+#define GetStockObject pGetStockObject
+#define GetSubMenu pGetSubMenu
+#define GetSystemMetrics pGetSystemMetrics
+#define ImageList_Add pImageList_Add
+#define ImageList_Create pImageList_Create
+#define ImageList_GetImageCount pImageList_GetImageCount
+#define InitCommonControls pInitCommonControls
+#define InvertRect pInvertRect
+#define IsWindowVisible pIsWindowVisible
+#define LoadAcceleratorsA pLoadAcceleratorsA
+#define LoadBitmapA pLoadBitmapA
+#define LoadCursorA pLoadCursorA
+#define LoadIconA pLoadIconA
+#define LoadImageA pLoadImageA
+#define LoadMenuA pLoadMenuA
+#define LoadStringA pLoadStringA
+#define MessageBeep pMessageBeep
+#define MoveWindow pMoveWindow
+#define OpenClipboard pOpenClipboard
+#define PostQuitMessage pPostQuitMessage
+#define PrintDlgA pPrintDlgA
+#define RegisterClassExA pRegisterClassExA
+#define RegisterClipboardFormatA pRegisterClipboardFormatA
+#define ReleaseCapture pReleaseCapture
+#define ReleaseDC pReleaseDC
+#define ScreenToClient pScreenToClient
+#define SendMessageA pSendMessageA
+#define SetCapture pSetCapture
+#define SetCursor pSetCursor
+#define SetFocus pSetFocus
+#define SetWindowLongA pSetWindowLongA
+#define SetWindowTextA pSetWindowTextA
+#define ShowWindow pShowWindow
+#undef TranslateAccelerator
+#define TranslateAccelerator pTranslateAccelerator
+#define TranslateMessage pTranslateMessage
+#define UpdateWindow pUpdateWindow
+#define WinHelpA pWinHelpA
+#define wsprintfA pwsprintfA
+
+#ifdef __cplusplus
+};
+#endif
+
+/* about.c */
+extern void ShowAboutBox(HWND hWnd);
+
+/* childwnd.c */
+extern LRESULT CALLBACK ChildWndProc(HWND, UINT, WPARAM, LPARAM);
+
+/* framewnd.c */
+extern LRESULT CALLBACK FrameWndProc(HWND, UINT, WPARAM, LPARAM);
+extern void SetupStatusBar(HWND hWnd, BOOL bResize);
+extern void UpdateStatusBar(void);
+
+/* listview.c */
+extern HWND CreateListView(HWND hwndParent, int id);
+extern BOOL RefreshListView(HWND hwndTV, HKEY hKey, LPTSTR keyPath);
+
+/* treeview.c */
+extern HWND CreateTreeView(HWND hwndParent, LPTSTR pHostName, int id);
+extern BOOL OnTreeExpanding(HWND hWnd, NMTREEVIEW* pnmtv);
+extern HKEY FindRegRoot(HWND hwndTV, HTREEITEM hItem, LPTSTR keyPath, int* pPathLen, int max);
+
+#endif /* __MAIN_H__ */
diff --git a/reactos/subsys/system/regedit/makefile b/reactos/subsys/system/regedit/makefile
new file mode 100644 (file)
index 0000000..0bdd7be
--- /dev/null
@@ -0,0 +1,33 @@
+#
+#  ReactOS regedit
+#
+#  Makefile
+#
+
+PATH_TO_TOP = ../../..
+
+TARGET_TYPE = program
+
+TARGET_APPTYPE = windows
+
+TARGET_NAME = regedit
+
+TARGET_CFLAGS = -D_WIN32_IE=0x0501 -D_WIN32_WINNT=0x0501 -D__USE_W32API 
+       
+TARGET_GCCLIBS = msvcrt advapi32 kernel32 
+
+TARGET_OBJECTS = \
+       about.o \
+       childwnd.o \
+       framewnd.o \
+       listview.o \
+       main.o \
+       regedit.o \
+       regproc.o \
+       treeview.o
+
+include $(PATH_TO_TOP)/rules.mak
+
+include $(TOOLS_PATH)/helper.mk
+
+# EOF
similarity index 63%
rename from rosapps/regedit/regcmds.c
rename to reactos/subsys/system/regedit/regedit.c
index e67be71..023abb7 100644 (file)
@@ -1,12 +1,7 @@
-/* $Id: regcmds.c,v 1.4 2003/01/07 18:06:16 robd Exp $
+/*
+ * Windows regedit.exe registry editor implementation.
  *
- *  ReactOS regedit
- *
- *  regcmds.c
- *
- *  Copyright (C) 2002  Robert Dickenson <robd@reactos.org>
- *
- *  Original Work Copyright 2002 Andriy Palamarchuk
+ * Copyright 2002 Andriy Palamarchuk
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#define WIN32_LEAN_AND_MEAN     // Exclude rarely-used stuff from Windows headers
-#include <windows.h>
-#include <tchar.h>
-#include <stdio.h>
-
-#ifdef WIN32_REGDBG
-#else
 #include <ctype.h>
-#endif
-
+#include <stdio.h>
+#include <windows.h>
 #include "regproc.h"
 
-
-////////////////////////////////////////////////////////////////////////////////
-// Global Variables:
-//
-
 static char *usage =
 "Usage:\n"
 "    regedit filename\n"
@@ -55,7 +38,6 @@ static char *usage =
 "Switches:\n"
 "    /E - exports contents of the specified registry key to the specified\n"
 "      file. Exports the whole registry if no key is specified.\n"
-"    /P - same as /E (export) however prints output to console.\n"
 "    /D - deletes specified registry key\n"
 "    /S - silent execution, can be used with any other switch.\n"
 "      The only existing mode, exists for compatibility with Windows regedit.\n"
@@ -74,9 +56,11 @@ static char *usage =
 "command-line interface only.\n";
 
 typedef enum {
-    ACTION_UNDEF, ACTION_ADD, ACTION_EXPORT, ACTION_DELETE, ACTION_PRINT
+    ACTION_UNDEF, ACTION_ADD, ACTION_EXPORT, ACTION_DELETE
 } REGEDIT_ACTION;
 
+BOOL PerformRegAction(REGEDIT_ACTION action, LPSTR s);
+
 /**
  * Process unknown switch.
  *
@@ -86,75 +70,14 @@ typedef enum {
  */
 void error_unknown_switch(char chu, char *s)
 {
-    if (isalpha(chu)) {
-        printf("Undefined switch /%c!\n", chu);
+    if (isalpha(chu))
+    {
+        printf("%s: Undefined switch /%c!\n", getAppName(), chu);
     } else {
-        printf("Alphabetic character is expected after '%c' "
-               "in switch specification\n", *(s - 1));
-    }
-    //exit(1);
-}
-
-BOOL PerformRegAction(REGEDIT_ACTION action, LPSTR s)
-{
-    TCHAR filename[MAX_PATH];
-    TCHAR reg_key_name[KEY_MAX_LEN];
-
-    switch (action) {
-    case ACTION_ADD:
-        get_file_name(&s, filename, MAX_PATH);
-        if (!filename[0]) {
-            printf("No file name is specified\n%s", usage);
-            return FALSE;
-            //exit(1);
-        }
-        while (filename[0]) {
-            if (!import_registry_file(filename)) {
-                perror("");
-                printf("Can't open file \"%s\"\n", filename);
-                return FALSE;
-                //exit(1);
-            }
-            get_file_name(&s, filename, MAX_PATH);
-        }
-        break;
-    case ACTION_DELETE:
-        get_file_name(&s, reg_key_name, KEY_MAX_LEN);
-        if (!reg_key_name[0]) {
-            printf("No registry key is specified for removal\n%s", usage);
-            return FALSE;
-            //exit(1);
-        }
-        delete_registry_key(reg_key_name);
-        break;
-    case ACTION_EXPORT:
-        filename[0] = '\0';
-        get_file_name(&s, filename, MAX_PATH);
-        if (!filename[0]) {
-            printf("No file name is specified\n%s", usage);
-            return FALSE;
-            //exit(1);
-        }
-        if (s[0]) {
-            get_file_name(&s, reg_key_name, KEY_MAX_LEN);
-            export_registry_key(filename, reg_key_name);
-        } else {
-            export_registry_key(filename, NULL);
-        }
-        break;
-    case ACTION_PRINT:
-        if (s[0]) {
-            get_file_name(&s, reg_key_name, KEY_MAX_LEN);
-            export_registry_key(NULL, reg_key_name);
-        } else {
-            export_registry_key(NULL, NULL);
-        }
-        break;
-    default:
-        printf("Unhandled action!\n");
-        return FALSE;
+        printf("%s: Alphabetic character is expected after '%c' "
+               "in switch specification\n", getAppName(), *(s - 1));
     }
-    return TRUE;
+    exit(1);
 }
 
 BOOL ProcessCmdLine(LPSTR lpCmdLine)
@@ -163,7 +86,9 @@ BOOL ProcessCmdLine(LPSTR lpCmdLine)
     LPSTR s = lpCmdLine;        /* command line pointer */
     CHAR ch = *s;               /* current character */
 
-    while (ch && ((ch == '-') || (ch == '/'))) {
+    setAppName("regedit");
+    while (ch && ((ch == '-') || (ch == '/')))
+    {
         char chu;
         char ch2;
 
@@ -171,46 +96,46 @@ BOOL ProcessCmdLine(LPSTR lpCmdLine)
         ch = *s;
         ch2 = *(s+1);
         chu = toupper(ch);
-        if (!ch2 || isspace(ch2)) {
-            if (chu == 'S' || chu == 'V') {
+        if (!ch2 || isspace(ch2))
+        {
+            if (chu == 'S' || chu == 'V')
+            {
                 /* ignore these switches */
             } else {
-                switch (chu) {
+                switch (chu)
+                {
                 case 'D':
                     action = ACTION_DELETE;
                     break;
                 case 'E':
                     action = ACTION_EXPORT;
                     break;
-                case 'P':
-                    action = ACTION_PRINT;
-                    break;
                 case '?':
                     printf(usage);
-                    return FALSE;
-                    //exit(0);
+                    exit(0);
                     break;
                 default:
                     error_unknown_switch(chu, s);
-                    return FALSE;
                     break;
                 }
             }
             s++;
         } else {
-            if (ch2 == ':') {
-                switch (chu) {
+            if (ch2 == ':')
+            {
+                switch (chu)
+                {
                 case 'L':
                     /* fall through */
                 case 'R':
                     s += 2;
-                    while (*s && !isspace(*s)) {
+                    while (*s && !isspace(*s))
+                    {
                         s++;
                     }
                     break;
                 default:
                     error_unknown_switch(chu, s);
-                    return FALSE;
                     break;
                 }
             } else {
@@ -221,13 +146,97 @@ BOOL ProcessCmdLine(LPSTR lpCmdLine)
         }
         /* skip spaces to the next parameter */
         ch = *s;
-        while (ch && isspace(ch)) {
+        while (ch && isspace(ch))
+        {
             s++;
             ch = *s;
         }
     }
-    if (action == ACTION_UNDEF) {
+
+    if (*s && action == ACTION_UNDEF)
         action = ACTION_ADD;
-    }
+
+    if (action == ACTION_UNDEF)
+        return FALSE;
+
     return PerformRegAction(action, s);
 }
+
+BOOL PerformRegAction(REGEDIT_ACTION action, LPSTR s)
+{
+    switch (action)
+    {
+    case ACTION_ADD:
+    {
+        CHAR filename[MAX_PATH];
+        FILE *reg_file;
+
+        get_file_name(&s, filename);
+        if (!filename[0])
+        {
+            printf("%s: No file name is specified\n", getAppName());
+            printf(usage);
+            exit(1);
+        }
+
+        while(filename[0])
+        {
+            reg_file = fopen(filename, "r");
+            if (reg_file)
+            {
+                processRegLines(reg_file, doSetValue);
+            } else {
+                perror("");
+                printf("%s: Can't open file \"%s\"\n", getAppName(), filename);
+                exit(1);
+            }
+            get_file_name(&s, filename);
+        }
+        break;
+    }
+    case ACTION_DELETE:
+    {
+        CHAR reg_key_name[KEY_MAX_LEN];
+
+        get_file_name(&s, reg_key_name);
+        if (!reg_key_name[0])
+        {
+            printf("%s: No registry key is specified for removal\n",
+                   getAppName());
+            printf(usage);
+            exit(1);
+        }
+        delete_registry_key(reg_key_name);
+        break;
+    }
+    case ACTION_EXPORT:
+    {
+        CHAR filename[MAX_PATH];
+
+        filename[0] = '\0';
+        get_file_name(&s, filename);
+        if (!filename[0])
+        {
+            printf("%s: No file name is specified\n", getAppName());
+            printf(usage);
+            exit(1);
+        }
+
+        if (s[0])
+        {
+            CHAR reg_key_name[KEY_MAX_LEN];
+
+            get_file_name(&s, reg_key_name);
+            export_registry_key(filename, reg_key_name);
+        } else {
+            export_registry_key(filename, NULL);
+        }
+        break;
+    }
+    default:
+        printf("%s: Unhandled action!\n", getAppName());
+        exit(1);
+        break;
+    }
+    return TRUE;
+}
similarity index 74%
rename from rosapps/regedit/debug.h
rename to reactos/subsys/system/regedit/regedit.rc
index 3a18088..a2b9fcd 100644 (file)
@@ -1,9 +1,7 @@
 /*
- *  ReactOS Application Debug Routines
+ * Regedit resources
  *
- *  debug.h
- *
- *  Copyright (C) 2002  Robert Dickenson <robd@reactos.org>
+ * Copyright 2002 Robert Dickenson
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-    
-#ifndef __DEBUG_H__
-#define __DEBUG_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-
 
-#ifdef __cplusplus
-};
-#endif
+#include "windows.h"
+#include "resource.h"
 
-#endif // __DEBUG_H__
+#include "rsrc.rc"
similarity index 50%
rename from rosapps/regedit/regproc.c
rename to reactos/subsys/system/regedit/regproc.c
index 0544841..20f8a49 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#ifdef WIN32_REGDBG
-#include <windows.h>
-#include <tchar.h>
-#ifndef __GNUC__
-#include <ntsecapi.h>
-#else
-#include <ctype.h>
-#endif
 #include <limits.h>
-#include <stdlib.h>
 #include <stdio.h>
-#include <assert.h>
-//#include <winreg.h>
-#include "regdump.h"
-#else
-
-#define WIN32_LEAN_AND_MEAN     // Exclude rarely-used stuff from Windows headers
 #include <windows.h>
-#include <commctrl.h>
-#include <stdlib.h>
-#include <tchar.h>
-#include <process.h>
-#include <stdio.h>
-#include <wchar.h>
-    
-#include <ctype.h>
-#include <limits.h>
 #include <winnt.h>
 #include <winreg.h>
 #include <assert.h>
-
-#endif
-
 #include "regproc.h"
-#include "dbg.h"
-
-#ifdef WIN32_REGDBG
-#define HeapAlloc RegHeapAlloc
-#define HeapReAlloc RegHeapReAlloc
-#define HeapFree RegHeapFree
-#endif /*WIN32_REGDBG*/
 
 #define REG_VAL_BUF_SIZE        4096
 
 #define REG_FILE_HEX_LINE_LEN   76
 
 /* Globals used by the api setValue, queryValue */
-static LPTSTR currentKeyName   = NULL;
+static LPSTR currentKeyName   = NULL;
 static HKEY  currentKeyClass  = 0;
 static HKEY  currentKeyHandle = 0;
 static BOOL  bTheKeyIsOpen    = FALSE;
 
-static TCHAR *reg_class_names[] = {
-    _T("HKEY_LOCAL_MACHINE"),
-    _T("HKEY_USERS"),
-    _T("HKEY_CLASSES_ROOT"),
-    _T("HKEY_CURRENT_CONFIG"),
-    _T("HKEY_CURRENT_USER")
+static CHAR *app_name = "UNKNOWN";
+
+static CHAR *reg_class_names[] = {
+    "HKEY_LOCAL_MACHINE", "HKEY_USERS", "HKEY_CLASSES_ROOT",
+    "HKEY_CURRENT_CONFIG", "HKEY_CURRENT_USER"
 };
 
 #define REG_CLASS_NUMBER (sizeof(reg_class_names) / sizeof(reg_class_names[0]))
@@ -99,29 +64,13 @@ static HKEY reg_class_keys[REG_CLASS_NUMBER] = {
 /* processing macros */
 
 /* common check of memory allocation results */
-#ifdef UNICODE
 #define CHECK_ENOUGH_MEMORY(p) \
     if (!(p)) \
     { \
-        _tprintf(_T("file %S, line %d: Not enough memory"), __FILE__, __LINE__); \
-        assert(0);\
+        printf("%s: file %s, line %d: Not enough memory", \
+               getAppName(), __FILE__, __LINE__); \
         exit(NOT_ENOUGH_MEMORY); \
     }
-#else
-#define CHECK_ENOUGH_MEMORY(p) \
-    if (!(p)) \
-    { \
-        _tprintf(_T("file %s, line %d: Not enough memory"), __FILE__, __LINE__); \
-        assert(0);\
-        exit(NOT_ENOUGH_MEMORY); \
-    }
-#endif
-
-#ifdef UNICODE
-#define _TEOF WEOF 
-#else
-#define _TEOF EOF 
-#endif
 
 /******************************************************************************
  * This is a replacement for strsep which is not portable (missing on Solaris).
@@ -154,7 +103,7 @@ char* getToken(char** str, const char* delims)
 
 /******************************************************************************
  * Copies file name from command line string to the buffer.
- * Rewinds the command line string pointer to the next non-spece character
+ * Rewinds the command line string pointer to the next non-space character
  * after the file name.
  * Buffer contains an empty string if no filename was found;
  *
@@ -163,168 +112,167 @@ char* getToken(char** str, const char* delims)
  *      where *s[0] is the first symbol of the file name.
  * file_name - buffer to write the file name to.
  */
-void get_file_nameA(CHAR **command_line, CHAR *file_name, int max_filename)
+void get_file_name(CHAR **command_line, CHAR *file_name)
 {
     CHAR *s = *command_line;
     int pos = 0;                /* position of pointer "s" in *command_line */
     file_name[0] = 0;
 
-    if (!s[0]) {
+    if (!s[0])
+    {
         return;
     }
-    if (s[0] == '"') {
+
+    if (s[0] == '"')
+    {
         s++;
         (*command_line)++;
-        while (s[0] != '"') {
-            if (!s[0]) {
-                _tprintf(_T("Unexpected end of file name!\n"));
-                assert(0);
-                //exit(1);
+        while(s[0] != '"')
+        {
+            if (!s[0])
+            {
+                printf("%s: Unexpected end of file name!\n", getAppName());
+                exit(1);
             }
             s++;
             pos++;
         }
     } else {
-        while (s[0] && !isspace(s[0])) {
+        while(s[0] && !isspace(s[0]))
+        {
             s++;
             pos++;
         }
     }
     memcpy(file_name, *command_line, pos * sizeof((*command_line)[0]));
     /* remove the last backslash */
-    if (file_name[pos - 1] == '\\') {
+    if (file_name[pos - 1] == '\\')
+    {
         file_name[pos - 1] = '\0';
     } else {
         file_name[pos] = '\0';
     }
-    if (s[0]) {
+
+    if (s[0])
+    {
         s++;
         pos++;
     }
-    while (s[0] && isspace(s[0])) {
+    while(s[0] && isspace(s[0]))
+    {
         s++;
         pos++;
     }
     (*command_line) += pos;
 }
 
-void get_file_nameW(CHAR** command_line, WCHAR* filename, int max_filename)
-{
-    CHAR filenameA[_MAX_PATH];
-    int len;
-
-    get_file_nameA(command_line, filenameA, _MAX_PATH);
-    len = strlen(filenameA);
-    OemToCharBuffW(filenameA, filename, max_filename);
-    filename[len] = _T('\0');
-/*
-    UNICODE_STRING UnicodeString;
-    ANSI_STRING AnsiString;
-    CHAR filenameA[_MAX_PATH];
-
-    get_file_nameA(command_line, filenameA, _MAX_PATH);
-
-    //RtlInitAnsiString(&AnsiString, filenameA);
-    UnicodeString.Buffer = filename;
-    UnicodeString.MaximumLength = max_filename;//MAX_PATH;
-    RtlAnsiStringToUnicodeString(&UnicodeString, &AnsiString, FALSE);
- */
-}
 
 /******************************************************************************
  * Converts a hex representation of a DWORD into a DWORD.
  */
-DWORD convertHexToDWord(TCHAR* str, BYTE* buf)
+DWORD convertHexToDWord(char *str, BYTE *buf)
 {
-    DWORD dw;
-    TCHAR xbuf[9];
-
-    memcpy(xbuf, str, 8 * sizeof(TCHAR));
-    xbuf[88 * sizeof(TCHAR)] = '\0';
-    _stscanf(xbuf, _T("%08lx"), &dw);
-    memcpy(buf, &dw, sizeof(DWORD));
-    return sizeof(DWORD);
+  DWORD dw;
+  char xbuf[9];
+
+  memcpy(xbuf,str,8);
+  xbuf[8]='\0';
+  sscanf(xbuf,"%08lx",&dw);
+  memcpy(buf,&dw,sizeof(DWORD));
+  return sizeof(DWORD);
 }
 
 /******************************************************************************
  * Converts a hex buffer into a hex comma separated values
  */
-TCHAR* convertHexToHexCSV(BYTE* buf, ULONG bufLen)
+char* convertHexToHexCSV(BYTE *buf, ULONG bufLen)
 {
-    TCHAR* str;
-    TCHAR* ptrStr;
-    BYTE* ptrBuf;
-
-    ULONG current = 0;
-    str = HeapAlloc(GetProcessHeap(), 0, (bufLen+1)*2*sizeof(TCHAR));
-    memset(str, 0, (bufLen+1)*2);
-    ptrStr = str;  /* Pointer to result  */
-    ptrBuf = buf;  /* Pointer to current */
-    while (current < bufLen) {
-        BYTE bCur = ptrBuf[current++];
-        TCHAR res[3];
-        _stprintf(res, _T("%02x"), (unsigned int)*&bCur);
-        _tcscat(str, res);
-        _tcscat(str, _T(","));
-    }
-    /* Get rid of the last comma */
-    str[_tcslen(str)-1] = _T('\0');
-    return str;
+  char* str;
+  char* ptrStr;
+  BYTE* ptrBuf;
+
+  ULONG current = 0;
+
+  str    = HeapAlloc(GetProcessHeap(), 0, (bufLen+1)*2);
+  memset(str, 0, (bufLen+1)*2);
+  ptrStr = str;  /* Pointer to result  */
+  ptrBuf = buf;  /* Pointer to current */
+
+  while (current < bufLen)
+  {
+    BYTE bCur = ptrBuf[current++];
+    char res[3];
+
+    sprintf(res, "%02x", (unsigned int)*&bCur);
+    strcat(str, res);
+    strcat(str, ",");
+  }
+
+  /* Get rid of the last comma */
+  str[strlen(str)-1] = '\0';
+  return str;
 }
 
 /******************************************************************************
  * Converts a hex buffer into a DWORD string
  */
-TCHAR* convertHexToDWORDStr(BYTE* buf, ULONG bufLen)
+char* convertHexToDWORDStr(BYTE *buf, ULONG bufLen)
 {
-    TCHAR* str;
-    DWORD dw;
-
-    if (bufLen != sizeof(DWORD)) return NULL;
-    str = HeapAlloc(GetProcessHeap(), 0, ((bufLen*2)+1)*sizeof(TCHAR));
-    memcpy(&dw, buf, sizeof(DWORD));
-    _stprintf(str, _T("%08lx"), dw);
-    /* Get rid of the last comma */
-    return str;
+  char* str;
+  DWORD dw;
+
+  if ( bufLen != sizeof(DWORD) ) return NULL;
+
+  str = HeapAlloc(GetProcessHeap(), 0, (bufLen*2)+1);
+
+  memcpy(&dw,buf,sizeof(DWORD));
+  sprintf(str, "%08lx", dw);
+
+  /* Get rid of the last comma */
+  return str;
 }
 
 /******************************************************************************
  * Converts a hex comma separated values list into a hex list.
  * The Hex input string must be in exactly the correct form.
  */
-DWORD convertHexCSVToHex(TCHAR* str, BYTE* buf, ULONG bufLen)
+DWORD convertHexCSVToHex(char *str, BYTE *buf, ULONG bufLen)
 {
-    TCHAR* s = str;  /* Pointer to current */
-    CHAR* b = buf;  /* Pointer to result  */
-    ULONG strLen    = _tcslen(str);
-    ULONG strPos    = 0;
-    DWORD byteCount = 0;
+  char *s = str;  /* Pointer to current */
+  char *b = buf;  /* Pointer to result  */
 
-    memset(buf, 0, bufLen);
-    /*
-     * warn the user if we are here with a string longer than 2 bytes that does
-     * not contains ",".  It is more likely because the data is invalid.
-     */
-    if ((strLen > 2) && (_tcschr(str, _T(',')) == NULL)) {
-        _tprintf(_T("WARNING converting CSV hex stream with no comma, ") \
-                 _T("input data seems invalid.\n"));
-    }
-    if (strLen > 3*bufLen) {
-        _tprintf(_T("ERROR converting CSV hex stream.  Too long\n"));
-    }
-    while (strPos < strLen) {
-        TCHAR xbuf[3];
-        TCHAR wc;
-        memcpy(xbuf, s, 2);
-        xbuf[3] = _T('\0');
-        _stscanf(xbuf, _T("%02x"), (UINT*)&wc);
-        if (byteCount < bufLen)
-            *b++ = (unsigned char)wc;
-        s += 3;
-        strPos += 3;
-        ++byteCount;
-    }
-    return byteCount;
+  ULONG strLen    = strlen(str);
+  ULONG strPos    = 0;
+  DWORD byteCount = 0;
+
+  memset(buf, 0, bufLen);
+
+  /*
+   * warn the user if we are here with a string longer than 2 bytes that does
+   * not contains ",".  It is more likely because the data is invalid.
+   */
+  if ( ( strLen > 2) && ( strchr(str, ',') == NULL) )
+    printf("%s: WARNING converting CSV hex stream with no comma, "
+           "input data seems invalid.\n", getAppName());
+  if (strLen > 3*bufLen)
+    printf ("%s: ERROR converting CSV hex stream.  Too long\n", getAppName());
+
+  while (strPos < strLen)
+  {
+    char xbuf[3];
+    UINT wc;
+
+    memcpy(xbuf,s,2); xbuf[2]='\0';
+    sscanf(xbuf,"%02x",&wc);
+    if (byteCount < bufLen)
+      *b++ =(unsigned char)wc;
+
+    s+=3;
+    strPos+=3;
+    byteCount++;
+  }
+
+  return byteCount;
 }
 
 /******************************************************************************
@@ -334,89 +282,99 @@ DWORD convertHexCSVToHex(TCHAR* str, BYTE* buf, ULONG bufLen)
  *
  * Note: Updated based on the algorithm used in 'server/registry.c'
  */
-DWORD getDataType(LPTSTR* lpValue, DWORD* parse_type)
+DWORD getDataType(LPSTR *lpValue, DWORD* parse_type)
 {
-    struct data_type { const TCHAR *tag; int len; int type; int parse_type; };
+    struct data_type { const char *tag; int len; int type; int parse_type; };
 
     static const struct data_type data_types[] =
     {                   /* actual type */  /* type to assume for parsing */
-        { _T("\""),        1,   REG_SZ,              REG_SZ },
-        { _T("str:\""),    5,   REG_SZ,              REG_SZ },
-//        { _T("str(2):\""), 8,   REG_EXPAND_SZ,       REG_SZ },
-        { _T("expand:\""), 8,   REG_EXPAND_SZ,       REG_EXPAND_SZ },
-        { _T("hex:"),      4,   REG_BINARY,          REG_BINARY },
-        { _T("dword:"),    6,   REG_DWORD,           REG_DWORD },
-        { _T("hex("),      4,   -1,                  REG_BINARY },
-        { NULL,            0,    0,                  0 }
+        { "\"",        1,   REG_SZ,              REG_SZ },
+        { "str:\"",    5,   REG_SZ,              REG_SZ },
+        { "str(2):\"", 8,   REG_EXPAND_SZ,       REG_SZ },
+        { "hex:",      4,   REG_BINARY,          REG_BINARY },
+        { "dword:",    6,   REG_DWORD,           REG_DWORD },
+        { "hex(",      4,   -1,                  REG_BINARY },
+        { NULL,        0,    0,                  0 }
     };
 
     const struct data_type *ptr;
     int type;
 
-    for (ptr = data_types; ptr->tag; ptr++) {
-        if (memcmp(ptr->tag, *lpValue, ptr->len))
+    for (ptr = data_types; ptr->tag; ptr++)
+    {
+        if (memcmp( ptr->tag, *lpValue, ptr->len ))
             continue;
 
         /* Found! */
         *parse_type = ptr->parse_type;
-        type = ptr->type;
-        *lpValue += ptr->len;
+        type=ptr->type;
+        *lpValue+=ptr->len;
         if (type == -1) {
-            TCHAR* end;
+            char* end;
             /* "hex(xx):" is special */
-            type = (int)_tcstoul(*lpValue , &end, 16);
-            if (**lpValue == _T('\0') || *end != _T(')') || *(end+1) != _T(':')) {
-                type = REG_NONE;
+            type = (int)strtoul( *lpValue , &end, 16 );
+            if (**lpValue=='\0' || *end!=')' || *(end+1)!=':') {
+                type=REG_NONE;
             } else {
-                *lpValue = end + 2;
+                *lpValue=end+2;
             }
         }
         return type;
     }
-    return (**lpValue == _T('\0') ? REG_SZ : REG_NONE);
+    return (**lpValue=='\0'?REG_SZ:REG_NONE);
 }
 
 /******************************************************************************
  * Returns an allocated buffer with a cleaned copy (removed the surrounding
  * dbl quotes) of the passed value.
  */
-LPTSTR getArg(LPTSTR arg)
+LPSTR getArg( LPSTR arg)
 {
-  LPTSTR tmp = NULL;
+  LPSTR tmp = NULL;
   ULONG len;
 
-  if (arg == NULL) return NULL;
+  if (arg == NULL)
+    return NULL;
+
+  /*
+   * Get rid of surrounding quotes
+   */
+  len = strlen(arg);
+
+  if( arg[len-1] == '\"' ) arg[len-1] = '\0';
+  if( arg[0]     == '\"' ) arg++;
+
+  tmp = HeapAlloc(GetProcessHeap(), 0, strlen(arg)+1);
+  strcpy(tmp, arg);
 
-  // Get rid of surrounding quotes
-  len = _tcslen(arg);
-  if (arg[len-1] == _T('\"')) arg[len-1] = _T('\0');
-  if (arg[0]     == _T('\"')) arg++;
-  tmp = HeapAlloc(GetProcessHeap(), 0, (_tcslen(arg)+1) * sizeof(TCHAR));
-  _tcscpy(tmp, arg);
   return tmp;
 }
 
 /******************************************************************************
  * Replaces escape sequences with the characters.
  */
-void REGPROC_unescape_string(LPTSTR str)
+void REGPROC_unescape_string(LPSTR str)
 {
     int str_idx = 0;            /* current character under analysis */
     int val_idx = 0;            /* the last character of the unescaped string */
-    int len = _tcslen(str);
-    for (str_idx = 0; str_idx < len; str_idx++, val_idx++) {
-        if (str[str_idx] == _T('\\')) {
+    int len = strlen(str);
+    for (str_idx = 0; str_idx < len; str_idx++, val_idx++)
+    {
+        if (str[str_idx] == '\\')
+        {
             str_idx++;
-            switch (str[str_idx]) {
-            case _T('n'):
-                str[val_idx] = _T('\n');
+            switch (str[str_idx])
+            {
+            case 'n':
+                str[val_idx] = '\n';
                 break;
-            case _T('\\'):
-            case _T('"'):
+            case '\\':
+            case '"':
                 str[val_idx] = str[str_idx];
                 break;
             default:
-                _tprintf(_T("Warning! Unrecognized escape sequence: \\%c'\n"), str[str_idx]);
+                printf("Warning! Unrecognized escape sequence: \\%c'\n",
+                       str[str_idx]);
                 str[val_idx] = str[str_idx];
                 break;
             }
@@ -424,7 +382,7 @@ void REGPROC_unescape_string(LPTSTR str)
             str[val_idx] = str[str_idx];
         }
     }
-    str[val_idx] = _T('\0');
+    str[val_idx] = '\0';
 }
 
 /******************************************************************************
@@ -435,7 +393,7 @@ void REGPROC_unescape_string(LPTSTR str)
  * val_name - name of the registry value
  * val_data - registry value data
  */
-HRESULT setValue(LPTSTR val_name, LPTSTR val_data)
+HRESULT setValue(LPSTR val_name, LPSTR val_data)
 {
   HRESULT hRes;
   DWORD   dwDataType, dwParseType;
@@ -444,52 +402,56 @@ HRESULT setValue(LPTSTR val_name, LPTSTR val_data)
   BYTE *bBigBuffer = 0;
   DWORD  dwLen;
 
-  if ((val_name == NULL) || (val_data == NULL))
+  if ( (val_name == NULL) || (val_data == NULL) )
     return ERROR_INVALID_PARAMETER;
 
   /* Get the data type stored into the value field */
   dwDataType = getDataType(&val_data, &dwParseType);
 
-//  if (dwParseType == REG_EXPAND_SZ) {
-//  }
-//  if (dwParseType == REG_SZ || dwParseType == REG_EXPAND_SZ) { /* no conversion for string */
-
-  if (dwParseType == REG_SZ) {       /* no conversion for string */
-    dwLen = _tcslen(val_data);
-    if (dwLen > 0 && val_data[dwLen-1] == _T('"')) {
+  if ( dwParseType == REG_SZ)        /* no conversion for string */
+  {
+    dwLen = strlen(val_data);
+    if (dwLen>0 && val_data[dwLen-1]=='"')
+    {
       dwLen--;
-      val_data[dwLen] = _T('\0');
+      val_data[dwLen]='\0';
     }
     dwLen++;
-    dwLen *= sizeof(TCHAR);
     REGPROC_unescape_string(val_data);
     lpbData = val_data;
-  } else if (dwParseType == REG_DWORD) { /* Convert the dword types */
+  }
+  else if (dwParseType == REG_DWORD)  /* Convert the dword types */
+  {
     dwLen   = convertHexToDWord(val_data, convert);
     lpbData = convert;
-  } else {                               /* Convert the hexadecimal types */
-    int b_len = _tcslen(val_data)+2/3;
-    if (b_len > KEY_MAX_LEN) {
-      bBigBuffer = HeapAlloc(GetProcessHeap(), 0, b_len * sizeof(TCHAR));
-      if (bBigBuffer == NULL) {
-          return ERROR_REGISTRY_IO_FAILED;
-      }
+  }
+  else                               /* Convert the hexadecimal types */
+  {
+    int b_len = strlen (val_data)+2/3;
+    if (b_len > KEY_MAX_LEN)
+    {
+      bBigBuffer = HeapAlloc (GetProcessHeap(), 0, b_len);
       CHECK_ENOUGH_MEMORY(bBigBuffer);
       dwLen = convertHexCSVToHex(val_data, bBigBuffer, b_len);
       lpbData = bBigBuffer;
-    } else {
+    }
+    else
+    {
       dwLen   = convertHexCSVToHex(val_data, convert, KEY_MAX_LEN);
       lpbData = convert;
     }
   }
-  hRes = RegSetValueEx(currentKeyHandle, val_name,
-          0, /* Reserved */dwDataType, lpbData, dwLen);
-
-    //_tprintf(_T("  Value: %s, Data: %s\n"), val_name, lpbData);
 
+  hRes = RegSetValueEx(
+          currentKeyHandle,
+          val_name,
+          0,                  /* Reserved */
+          dwDataType,
+          lpbData,
+          dwLen);
 
   if (bBigBuffer)
-      HeapFree(GetProcessHeap(), 0, bBigBuffer);
+      HeapFree (GetProcessHeap(), 0, bBigBuffer);
   return hRes;
 }
 
@@ -497,7 +459,7 @@ HRESULT setValue(LPTSTR val_name, LPTSTR val_data)
 /******************************************************************************
  * Open the key
  */
-HRESULT openKey(LPTSTR stdInput)
+HRESULT openKey( LPSTR stdInput)
 {
   DWORD   dwDisp;
   HRESULT hRes;
@@ -539,65 +501,74 @@ HRESULT openKey(LPTSTR stdInput)
  * Extracts from [HKEY\some\key\path] or HKEY\some\key\path types of line
  * the key name (what starts after the first '\')
  */
-LPTSTR getRegKeyName(LPTSTR lpLine)
+LPSTR getRegKeyName(LPSTR lpLine)
 {
-  LPTSTR keyNameBeg;
-  TCHAR  lpLineCopy[KEY_MAX_LEN];
+  LPSTR keyNameBeg;
+  char  lpLineCopy[KEY_MAX_LEN];
 
   if (lpLine == NULL)
     return NULL;
 
-  _tcscpy(lpLineCopy, lpLine);
-  keyNameBeg = _tcschr(lpLineCopy, _T('\\'));    /* The key name start by '\' */
-  if (keyNameBeg) {
-      LPTSTR keyNameEnd;
+  strcpy(lpLineCopy, lpLine);
+
+  keyNameBeg = strchr(lpLineCopy, '\\');    /* The key name start by '\' */
+  if (keyNameBeg)
+  {
+      LPSTR keyNameEnd;
 
       keyNameBeg++;                             /* is not part of the name */
-      keyNameEnd = _tcschr(lpLineCopy, _T(']'));
-      if (keyNameEnd) {
-          *keyNameEnd = _T('\0');               /* remove ']' from the key name */
+      keyNameEnd = strchr(lpLineCopy, ']');
+      if (keyNameEnd)
+      {
+          *keyNameEnd = '\0';               /* remove ']' from the key name */
       }
   } else {
-      keyNameBeg = lpLineCopy + _tcslen(lpLineCopy); /* branch - empty string */
+      keyNameBeg = lpLineCopy + strlen(lpLineCopy); /* branch - empty string */
   }
-  currentKeyName = HeapAlloc(GetProcessHeap(), 0, (_tcslen(keyNameBeg)+1)*sizeof(TCHAR));
+  currentKeyName = HeapAlloc(GetProcessHeap(), 0, strlen(keyNameBeg) + 1);
   CHECK_ENOUGH_MEMORY(currentKeyName);
-  _tcscpy(currentKeyName, keyNameBeg);
-  return currentKeyName;
+  strcpy(currentKeyName, keyNameBeg);
+   return currentKeyName;
 }
 
 /******************************************************************************
  * Extracts from [HKEY\some\key\path] or HKEY\some\key\path types of line
  * the key class (what ends before the first '\')
  */
-HKEY getRegClass(LPTSTR lpClass)
+HKEY getRegClass(LPSTR lpClass)
 {
-  LPTSTR classNameEnd;
-  LPTSTR classNameBeg;
+  LPSTR classNameEnd;
+  LPSTR classNameBeg;
   int i;
 
-  TCHAR lpClassCopy[KEY_MAX_LEN];
+  char  lpClassCopy[KEY_MAX_LEN];
 
   if (lpClass == NULL)
     return (HKEY)ERROR_INVALID_PARAMETER;
 
-  _tcsncpy(lpClassCopy, lpClass, KEY_MAX_LEN);
+  strncpy(lpClassCopy, lpClass, KEY_MAX_LEN);
 
-  classNameEnd  = _tcschr(lpClassCopy, _T('\\'));    /* The class name ends by '\' */
-  if (!classNameEnd) {                          /* or the whole string */
-      classNameEnd = lpClassCopy + _tcslen(lpClassCopy);
-      if (classNameEnd[-1] == _T(']')) {
+  classNameEnd  = strchr(lpClassCopy, '\\');    /* The class name ends by '\' */
+  if (!classNameEnd)                            /* or the whole string */
+  {
+      classNameEnd = lpClassCopy + strlen(lpClassCopy);
+      if (classNameEnd[-1] == ']')
+      {
           classNameEnd--;
       }
   }
-  *classNameEnd = _T('\0');                       /* Isolate the class name */
-  if (lpClassCopy[0] == _T('[')) {
+  *classNameEnd = '\0';                       /* Isolate the class name */
+  if (lpClassCopy[0] == '[')
+  {
       classNameBeg = lpClassCopy + 1;
   } else {
       classNameBeg = lpClassCopy;
   }
-  for (i = 0; i < REG_CLASS_NUMBER; i++) {
-      if (!_tcscmp(classNameBeg, reg_class_names[i])) {
+
+  for (i = 0; i < REG_CLASS_NUMBER; i++)
+  {
+      if (!strcmp(classNameBeg, reg_class_names[i]))
+      {
           return reg_class_keys[i];
       }
   }
@@ -607,14 +578,17 @@ HKEY getRegClass(LPTSTR lpClass)
 /******************************************************************************
  * Close the currently opened key.
  */
-void closeKey(VOID)
+void closeKey()
 {
-    RegCloseKey(currentKeyHandle);
-    HeapFree(GetProcessHeap(), 0, currentKeyName); /* Allocated by getKeyName */
-    bTheKeyIsOpen    = FALSE;
-    currentKeyName   = NULL;
-    currentKeyClass  = 0;
-    currentKeyHandle = 0;
+  RegCloseKey(currentKeyHandle);
+
+  HeapFree(GetProcessHeap(), 0, currentKeyName); /* Allocated by getKeyName */
+
+  bTheKeyIsOpen    = FALSE;
+
+  currentKeyName   = NULL;
+  currentKeyClass  = 0;
+  currentKeyHandle = 0;
 }
 
 /******************************************************************************
@@ -622,32 +596,38 @@ void closeKey(VOID)
  * receives the currently read line and dispatch the work depending on the
  * context.
  */
-void doSetValue(LPTSTR stdInput)
+void doSetValue(LPSTR stdInput)
 {
   /*
-   * We encountered the end of the file, make sure we
+   * We encoutered the end of the file, make sure we
    * close the opened key and exit
    */
-  if (stdInput == NULL) {
+  if (stdInput == NULL)
+  {
     if (bTheKeyIsOpen != FALSE)
       closeKey();
+
     return;
   }
 
-  if (stdInput[0] == _T('[')) {     /* We are reading a new key */
-      if (bTheKeyIsOpen != FALSE) {
-          closeKey();                    /* Close the previous key before */
-      }
-      if (openKey(stdInput) != ERROR_SUCCESS) {
-          _tprintf(_T("doSetValue failed to open key %s\n"), stdInput);
-      }
-  } else if ((bTheKeyIsOpen) &&
-            ((stdInput[0] == _T('@')) || /* reading a default @=data pair */
-             (stdInput[0] == _T('\"')))) { /* reading a new value=data pair */
+  if      ( stdInput[0] == '[')      /* We are reading a new key */
+  {
+    if ( bTheKeyIsOpen != FALSE )
+      closeKey();                    /* Close the previous key before */
+
+    if ( openKey(stdInput) != ERROR_SUCCESS )
+      printf("%s: setValue failed to open key %s\n", getAppName(), stdInput);
+  }
+  else if( ( bTheKeyIsOpen ) &&
+           (( stdInput[0] == '@') || /* reading a default @=data pair */
+            ( stdInput[0] == '\"'))) /* reading a new value=data pair */
+  {
     processSetValue(stdInput);
-  } else {             /* since we are assuming that the file format is */
-    if (bTheKeyIsOpen) /* valid we must be reading a blank line which  */
-      closeKey();      /* indicate end of this key processing */
+  }
+  else                               /* since we are assuming that the */
+  {                                  /* file format is valid we must   */
+    if ( bTheKeyIsOpen )             /* be reading a blank line which  */
+      closeKey();                    /* indicate end of this key processing */
   }
 }
 
@@ -656,31 +636,37 @@ void doSetValue(LPTSTR stdInput)
  * receives the currently read line and dispatch the work depending on the
  * context.
  */
-void doQueryValue(LPTSTR stdInput) {
+void doQueryValue(LPSTR stdInput) {
   /*
    * We encoutered the end of the file, make sure we
    * close the opened key and exit
    */
-  if (stdInput == NULL) {
+  if (stdInput == NULL)
+  {
     if (bTheKeyIsOpen != FALSE)
       closeKey();
+
     return;
   }
 
-  if (stdInput[0] == _T('[')) {     /* We are reading a new key */
-    if (bTheKeyIsOpen != FALSE)
+  if      ( stdInput[0] == '[')      /* We are reading a new key */
+  {
+    if ( bTheKeyIsOpen != FALSE )
       closeKey();                    /* Close the previous key before */
-    if (openKey(stdInput) != ERROR_SUCCESS ) {
-      _tprintf(_T("doQueryValue failed to open key %s\n"), stdInput);
-    }
+
+    if ( openKey(stdInput) != ERROR_SUCCESS )
+      printf("%s: queryValue failed to open key %s\n", getAppName(), stdInput);
   }
-  else if( (bTheKeyIsOpen) &&
-           ((stdInput[0] == _T('@')) || /* reading a default @=data pair */
-           (stdInput[0] == _T('\"')))) { /* reading a new value=data pair */
+  else if( ( bTheKeyIsOpen ) &&
+           (( stdInput[0] == '@') || /* reading a default @=data pair */
+            ( stdInput[0] == '\"'))) /* reading a new value=data pair */
+  {
     processQueryValue(stdInput);
-  } else {                /* since we are assuming that the file format is */
-    if (bTheKeyIsOpen)    /* valid we must be reading a blank line which  */
-      closeKey();         /* indicate end of this key processing */
+  }
+  else                               /* since we are assuming that the */
+  {                                  /* file format is valid we must   */
+    if ( bTheKeyIsOpen )             /* be reading a blank line which  */
+      closeKey();                    /* indicate end of this key processing */
   }
 }
 
@@ -689,8 +675,8 @@ void doQueryValue(LPTSTR stdInput) {
  * receives the currently read line and dispatch the work depending on the
  * context.
  */
-void doDeleteValue(LPTSTR line) {
-  _tprintf(_T("deleteValue not yet implemented\n"));
+void doDeleteValue(LPSTR line) {
+  printf ("%s: deleteValue not yet implemented\n", getAppName());
 }
 
 /******************************************************************************
@@ -698,8 +684,8 @@ void doDeleteValue(LPTSTR line) {
  * receives the currently read line and dispatch the work depending on the
  * context.
  */
-void doDeleteKey(LPTSTR line)   {
-  _tprintf(_T("deleteKey not yet implemented\n"));
+void doDeleteKey(LPSTR line)   {
+  printf ("%s: deleteKey not yet implemented\n", getAppName());
 }
 
 /******************************************************************************
@@ -707,8 +693,8 @@ void doDeleteKey(LPTSTR line)   {
  * receives the currently read line and dispatch the work depending on the
  * context.
  */
-void doCreateKey(LPTSTR line)   {
-  _tprintf(_T("createKey not yet implemented\n"));
+void doCreateKey(LPSTR line)   {
+  printf ("%s: createKey not yet implemented\n", getAppName());
 }
 
 /******************************************************************************
@@ -719,28 +705,34 @@ void doCreateKey(LPTSTR line)   {
  * line - registry file unwrapped line. Should have the registry value name and
  *      complete registry value data.
  */
-void processSetValue(LPTSTR line)
+void processSetValue(LPSTR line)
 {
-  LPTSTR val_name;                   /* registry value name   */
-  LPTSTR val_data;                   /* registry value data   */
+  LPSTR val_name;                   /* registry value name   */
+  LPSTR val_data;                   /* registry value data   */
 
   int line_idx = 0;                 /* current character under analysis */
   HRESULT hRes = 0;
 
   /* get value name */
-  if (line[line_idx] == _T('@') && line[line_idx + 1] == _T('=')) {
-      line[line_idx] = _T('\0');
+  if (line[line_idx] == '@' && line[line_idx + 1] == '=')
+  {
+      line[line_idx] = '\0';
       val_name = line;
       line_idx++;
-  } else if (line[line_idx] == _T('\"')) {
+  }
+  else if (line[line_idx] == '\"')
+  {
       line_idx++;
       val_name = line + line_idx;
-      while (TRUE) {
-          if (line[line_idx] == _T('\\')) {  /* skip escaped character */
+      while (TRUE)
+      {
+          if (line[line_idx] == '\\')   /* skip escaped character */
+          {
               line_idx += 2;
           } else {
-              if (line[line_idx] == _T('\"')) {
-                  line[line_idx] = _T('\0');
+              if (line[line_idx] == '\"')
+              {
+                  line[line_idx] = '\0';
                   line_idx++;
                   break;
               } else {
@@ -748,36 +740,40 @@ void processSetValue(LPTSTR line)
               }
           }
       }
-      if (line[line_idx] != _T('=')) {
-          line[line_idx] = _T('\"');
-          _tprintf(_T("Warning! uncrecognized line:\n%s\n"), line);
+      if (line[line_idx] != '=')
+      {
+          line[line_idx] = '\"';
+          printf("Warning! unrecognized line:\n%s\n", line);
           return;
       }
-  } else {
-      _tprintf(_T("Warning! unrecognized line:\n%s\n"), line);
+
+  }
+  else
+  {
+      printf("Warning! unrecognized line:\n%s\n", line);
       return;
   }
   line_idx++;                   /* skip the '=' character */
   val_data = line + line_idx;
-  REGPROC_unescape_string(val_name);
-
-    _tprintf(_T("Key: %s, Value: %s, Data: %s\n"), currentKeyName, val_name, val_data);
 
+  REGPROC_unescape_string(val_name);
   hRes = setValue(val_name, val_data);
-  if (hRes != ERROR_SUCCESS) {
-    _tprintf(_T("ERROR Key %s not created. Value: %s, Data: %s\n"), currentKeyName, val_name, val_data);
-  }
+  if ( hRes != ERROR_SUCCESS )
+    printf("%s: ERROR Key %s not created. Value: %s, Data: %s\n",
+           getAppName(),
+           currentKeyName,
+           val_name,
+           val_data);
 }
 
 /******************************************************************************
  * This function is a wrapper for the queryValue function.  It prepares the
  * land and clean the area once completed.
  */
-void processQueryValue(LPTSTR cmdline)
+void processQueryValue(LPSTR cmdline)
 {
-  _tprintf(_T("ERROR!!! - temporary disabled"));
-  //exit(1);
-  return;
+  printf("ERROR!!! - temporary disabled");
+  exit(1);
 #if 0
   LPSTR   argv[QUERY_VALUE_MAX_ARGS];/* args storage    */
   LPSTR   token      = NULL;         /* current token analized */
@@ -790,41 +786,53 @@ void processQueryValue(LPTSTR cmdline)
   /*
    * Init storage and parse the line
    */
-  for (counter = 0; counter < QUERY_VALUE_MAX_ARGS; counter++)
-    argv[counter] = NULL;
+  for (counter=0; counter<QUERY_VALUE_MAX_ARGS; counter++)
+    argv[counter]=NULL;
 
-  while ((token = getToken(&cmdline, queryValueDelim[argCounter])) != NULL) {
+  while( (token = getToken(&cmdline, queryValueDelim[argCounter])) != NULL )
+  {
     argv[argCounter++] = getArg(token);
+
     if (argCounter == QUERY_VALUE_MAX_ARGS)
       break;  /* Stop processing args no matter what */
   }
 
   /* The value we look for is the first token on the line */
-  if (argv[0] == NULL)
+  if ( argv[0] == NULL )
     return; /* SHOULD NOT HAPPEN */
   else
     keyValue = argv[0];
 
-  if ((keyValue[0] == '@') && (_tcslen(keyValue) == 1)) {
-    LONG lLen = KEY_MAX_LEN;
-    TCHAR* lpsData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, KEY_MAX_LEN * sizeof(TCHAR));
+  if( (keyValue[0] == '@') && (strlen(keyValue) == 1) )
+  {
+    LONG  lLen  = KEY_MAX_LEN;
+    CHAR*  lpsData=HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,KEY_MAX_LEN);
     /*
      * We need to query the key default value
      */
-    hRes = RegQueryValue(currentKeyHandle, currentKeyName, (LPBYTE)lpsData, &lLen);
-    if (hRes == ERROR_MORE_DATA) {
-        lpsData = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, lpsData, lLen);
-        hRes = RegQueryValue(currentKeyHandle, currentKeyName, (LPBYTE)lpsData, &lLen);
+    hRes = RegQueryValue(
+             currentKeyHandle,
+             currentKeyName,
+             (LPBYTE)lpsData,
+             &lLen);
+
+    if (hRes==ERROR_MORE_DATA) {
+        lpsData=HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,lpsData,lLen);
+        hRes = RegQueryValue(currentKeyHandle,currentKeyName,(LPBYTE)lpsData,&lLen);
     }
-    if (hRes == ERROR_SUCCESS) {
-      lpsRes = HeapAlloc(GetProcessHeap(), 0, lLen);
+
+    if (hRes == ERROR_SUCCESS)
+    {
+      lpsRes = HeapAlloc( GetProcessHeap(), 0, lLen);
       strncpy(lpsRes, lpsData, lLen);
       lpsRes[lLen-1]='\0';
     }
-  } else {
-    DWORD dwLen = KEY_MAX_LEN;
-    BYTE* lpbData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, KEY_MAX_LEN);
-    DWORD dwType;
+  }
+  else
+  {
+    DWORD  dwLen  = KEY_MAX_LEN;
+    BYTE*  lpbData=HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,KEY_MAX_LEN);
+    DWORD  dwType;
     /*
      * We need to query a specific value for the key
      */
@@ -836,39 +844,56 @@ void processQueryValue(LPTSTR cmdline)
              (LPBYTE)lpbData,
              &dwLen);
 
-    if (hRes == ERROR_MORE_DATA) {
-        lpbData = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, lpbData, dwLen * sizeof(TCHAR));
-        hRes = RegQueryValueEx(currentKeyHandle, keyValue, NULL, &dwType, (LPBYTE)lpbData, &dwLen);
+    if (hRes==ERROR_MORE_DATA) {
+        lpbData=HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,lpbData,dwLen);
+        hRes = RegQueryValueEx(currentKeyHandle,keyValue,NULL,&dwType,(LPBYTE)lpbData,&dwLen);
     }
 
-    if (hRes == ERROR_SUCCESS) {
+    if (hRes == ERROR_SUCCESS)
+    {
       /*
        * Convert the returned data to a displayable format
        */
-      switch (dwType) {
+      switch ( dwType )
+      {
         case REG_SZ:
         case REG_EXPAND_SZ:
-          lpsRes = HeapAlloc(GetProcessHeap(), 0, dwLen * sizeof(TCHAR));
+        {
+          lpsRes = HeapAlloc( GetProcessHeap(), 0, dwLen);
           strncpy(lpsRes, lpbData, dwLen);
-          lpsRes[dwLen-1] = '\0';
+          lpsRes[dwLen-1]='\0';
           break;
+        }
         case REG_DWORD:
+        {
           lpsRes = convertHexToDWORDStr(lpbData, dwLen);
           break;
+        }
         default:
+        {
           lpsRes = convertHexToHexCSV(lpbData, dwLen);
           break;
+        }
       }
     }
 
     HeapFree(GetProcessHeap(), 0, lpbData);
   }
-  if (hRes == ERROR_SUCCESS) {
-    _tprintf(_T("Value \"%s\" = \"%s\" in key [%s]\n"), keyValue, lpsRes, currentKeyName);
 
-  } else {
-    _tprintf(_T("ERROR Value \"%s\" not found. for key \"%s\"\n"), keyValue, currentKeyName);
-  }
+
+  if ( hRes == ERROR_SUCCESS )
+    printf(
+      "%s: Value \"%s\" = \"%s\" in key [%s]\n",
+      getAppName(),
+      keyValue,
+      lpsRes,
+      currentKeyName);
+
+  else
+    printf("%s: ERROR Value \"%s\" not found for key \"%s\".\n",
+      getAppName(),
+      keyValue,
+      currentKeyName);
 
   /*
    * Do some cleanup
@@ -892,28 +917,31 @@ void processQueryValue(LPTSTR cmdline)
  */
 void processRegLines(FILE *in, CommandAPI command)
 {
-    LPTSTR line     = NULL;  /* line read from input stream */
-    ULONG lineSize = REG_VAL_BUF_SIZE;
+    LPSTR line           = NULL;  /* line read from input stream */
+    ULONG lineSize       = REG_VAL_BUF_SIZE;
 
-    line = HeapAlloc(GetProcessHeap(), 0, lineSize * sizeof(TCHAR));
+    line = HeapAlloc(GetProcessHeap(), 0, lineSize);
     CHECK_ENOUGH_MEMORY(line);
 
-    while (!feof(in)) {
-        LPTSTR s; /* The pointer into line for where the current fgets should read */
+    while (!feof(in))
+    {
+        LPSTR s; /* The pointer into line for where the current fgets should read */
         s = line;
-        for (;;) {
+        for (;;)
+        {
             size_t size_remaining;
             int size_to_get;
-            TCHAR *s_eol; /* various local uses */
+            char *s_eol; /* various local uses */
 
             /* Do we need to expand the buffer ? */
             assert (s >= line && s <= line + lineSize);
             size_remaining = lineSize - (s-line);
-            if (size_remaining < 2) { /* room for 1 character and the \0 */
-                TCHAR *new_buffer;
+            if (size_remaining < 2) /* room for 1 character and the \0 */
+            {
+                char *new_buffer;
                 size_t new_size = lineSize + REG_VAL_BUF_SIZE;
                 if (new_size > lineSize) /* no arithmetic overflow */
-                    new_buffer = HeapReAlloc (GetProcessHeap(), 0, line, new_size * sizeof(TCHAR));
+                    new_buffer = HeapReAlloc (GetProcessHeap(), 0, line, new_size);
                 else
                     new_buffer = NULL;
                 CHECK_ENOUGH_MEMORY(new_buffer);
@@ -927,15 +955,17 @@ void processRegLines(FILE *in, CommandAPI command)
              * eof, error, eol or getting the maximum amount.  Abort on error.
              */
             size_to_get = (size_remaining > INT_MAX ? INT_MAX : size_remaining);
-            if (NULL == _fgetts(s, size_to_get, in)) {
-                if (ferror(in)) {
-                    //_tperror(_T("While reading input"));
-                    perror("While reading input");
-                    //exit(IO_ERROR);
-                    return;
-                } else {
-                    assert(feof(in));
-                    *s = _T('\0');
+            if (NULL == fgets (s, size_to_get, in))
+            {
+                if (ferror(in))
+                {
+                    perror ("While reading input");
+                    exit (IO_ERROR);
+                }
+                else
+                {
+                    assert (feof(in));
+                    *s = '\0';
                     /* It is not clear to me from the definition that the
                      * contents of the buffer are well defined on detecting
                      * an eof without managing to read anything.
@@ -944,45 +974,52 @@ void processRegLines(FILE *in, CommandAPI command)
             }
 
             /* If we didn't read the eol nor the eof go around for the rest */
-            s_eol = _tcschr (s, _T('\n'));
-            if (!feof(in) && !s_eol) {
-                s = _tcschr (s, _T('\0'));
+            s_eol = strchr (s, '\n');
+            if (!feof (in) && !s_eol)
+            {
+                s = strchr (s, '\0');
                 /* It should be s + size_to_get - 1 but this is safer */
                 continue;
             }
 
             /* If it is a comment line then discard it and go around again */
-            if (line [0] == _T('#')) {
+            if (line [0] == '#')
+            {
                 s = line;
                 continue;
             }
 
             /* Remove any line feed.  Leave s_eol on the \0 */
-            if (s_eol) {
-                *s_eol = _T('\0');
-                if (s_eol > line && *(s_eol-1) == _T('\r'))
-                    *--s_eol = _T('\0');
-            } else {
-                s_eol = _tcschr (s, _T('\0'));
+            if (s_eol)
+            {
+                *s_eol = '\0';
+                if (s_eol > line && *(s_eol-1) == '\r')
+                    *--s_eol = '\0';
             }
+            else
+                s_eol = strchr (s, '\0');
+
             /* If there is a concatenating \\ then go around again */
-            if (s_eol > line && *(s_eol-1) == _T('\\')) {
+            if (s_eol > line && *(s_eol-1) == '\\')
+            {
                 int c;
                 s = s_eol-1;
                 /* The following error protection could be made more self-
                  * correcting but I thought it not worth trying.
                  */
-
-                if ((c = _fgettc(in)) == _TEOF || c != _T(' ') ||
-                    (c = _fgettc(in)) == _TEOF || c != _T(' '))
-                    _tprintf(_T("ERROR - invalid continuation.\n"));
+                if ((c = fgetc (in)) == EOF || c != ' ' ||
+                    (c = fgetc (in)) == EOF || c != ' ')
+                    printf ("%s: ERROR - invalid continuation.\n", getAppName());
                 continue;
             }
+
             break; /* That is the full virtual line */
         }
+
         command(line);
     }
     command(NULL);
+
     HeapFree(GetProcessHeap(), 0, line);
 }
 
@@ -990,60 +1027,70 @@ void processRegLines(FILE *in, CommandAPI command)
  * This funtion is the main entry point to the registerDLL action.  It
  * receives the currently read line, then loads and registers the requested DLLs
  */
-void doRegisterDLL(LPTSTR stdInput)
-{
-    HMODULE theLib = 0;
-    UINT retVal = 0;
-
-    /* Check for valid input */
-    if (stdInput == NULL) return;
-
-    /* Load and register the library, then free it */
-    theLib = LoadLibrary(stdInput);
-    if (theLib) {
-        FARPROC lpfnDLLRegProc = GetProcAddress(theLib, "DllRegisterServer");
-        if (lpfnDLLRegProc) {
-            retVal = (*lpfnDLLRegProc)();
-        } else {
-            _tprintf(_T("Couldn't find DllRegisterServer proc in '%s'.\n"), stdInput);
-        }
-        if (retVal != S_OK) {
-            _tprintf(_T("Couldn't find DllRegisterServer proc in '%s'.\n"), stdInput);
-        }
-        FreeLibrary(theLib);
-    } else {
-        _tprintf(_T("Could not load DLL '%s'.\n"), stdInput);
-    }
+void doRegisterDLL(LPSTR stdInput) {
+  HMODULE theLib = 0;
+  UINT retVal = 0;
+
+  /* Check for valid input */
+  if (stdInput == NULL)
+    return;
+
+  /* Load and register the library, then free it */
+  theLib = LoadLibrary(stdInput);
+  if (theLib)
+  {
+    FARPROC lpfnDLLRegProc = GetProcAddress(theLib, "DllRegisterServer");
+    if (lpfnDLLRegProc)
+      retVal = (*lpfnDLLRegProc)();
+    else
+      printf("%s: Couldn't find DllRegisterServer proc in '%s'.\n",
+             getAppName(), stdInput);
+
+    if (retVal != S_OK)
+      printf("%s: DLLRegisterServer error 0x%x in '%s'.\n",
+             getAppName(), retVal, stdInput);
+
+    FreeLibrary(theLib);
+  }
+  else
+  {
+    printf("%s: Could not load DLL '%s'.\n", getAppName(), stdInput);
+  }
 }
 
 /******************************************************************************
  * This funtion is the main entry point to the unregisterDLL action.  It
  * receives the currently read line, then loads and unregisters the requested DLLs
  */
-void doUnregisterDLL(LPTSTR stdInput)
-{
-    HMODULE theLib = 0;
-    UINT retVal = 0;
-
-    /* Check for valid input */
-    if (stdInput == NULL) return;
-
-    /* Load and unregister the library, then free it */
-    theLib = LoadLibrary(stdInput);
-    if (theLib) {
-        FARPROC lpfnDLLRegProc = GetProcAddress(theLib, "DllUnregisterServer");
-        if (lpfnDLLRegProc) {
-            retVal = (*lpfnDLLRegProc)();
-        } else {
-            _tprintf(_T("Couldn't find DllUnregisterServer proc in '%s'.\n"), stdInput);
-        }
-        if (retVal != S_OK) {
-            _tprintf(_T("DLLUnregisterServer error 0x%x in '%s'.\n"), retVal, stdInput);
-        }
-        FreeLibrary(theLib);
-    } else {
-        _tprintf(_T("Could not load DLL '%s'.\n"), stdInput);
-    }
+void doUnregisterDLL(LPSTR stdInput) {
+  HMODULE theLib = 0;
+  UINT retVal = 0;
+
+  /* Check for valid input */
+  if (stdInput == NULL)
+    return;
+
+  /* Load and unregister the library, then free it */
+  theLib = LoadLibrary(stdInput);
+  if (theLib)
+  {
+    FARPROC lpfnDLLRegProc = GetProcAddress(theLib, "DllUnregisterServer");
+    if (lpfnDLLRegProc)
+      retVal = (*lpfnDLLRegProc)();
+    else
+      printf("%s: Couldn't find DllUnregisterServer proc in '%s'.\n",
+             getAppName(), stdInput);
+
+    if (retVal != S_OK)
+      printf("%s: DLLUnregisterServer error 0x%x in '%s'.\n",
+             getAppName(), retVal, stdInput);
+
+    FreeLibrary(theLib);
+  }
+  else
+  {
+    printf("%s: Could not load DLL '%s'.\n", getAppName(), stdInput);
+  }
 }
 
 /****************************************************************************
@@ -1052,22 +1099,22 @@ void doUnregisterDLL(LPTSTR stdInput)
  * Print the message for GetLastError
  */
 
-void REGPROC_print_error(VOID)
-{
+void REGPROC_print_error() {
     LPVOID lpMsgBuf;
     DWORD error_code;
     int status;
 
     error_code = GetLastError ();
-    status = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
-                           NULL, error_code, 0, (LPSTR) &lpMsgBuf, 0, NULL);
+    status = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
+                           NULL, error_code, 0, (LPTSTR) &lpMsgBuf, 0, NULL);
     if (!status) {
-        _tprintf(_T("Cannot display message for error %ld, status %ld\n"), error_code, GetLastError());
-    } else {
-        puts(lpMsgBuf);
-        LocalFree((HLOCAL)lpMsgBuf);
+        printf("%s: Cannot display message for error %ld, status %ld\n",
+               getAppName(), error_code, GetLastError());
+        exit(1);
     }
-    //exit(1);
+    puts(lpMsgBuf);
+    LocalFree((HLOCAL)lpMsgBuf);
+    exit(1);
 }
 
 /******************************************************************************
@@ -1080,12 +1127,14 @@ void REGPROC_print_error(VOID)
  * required_len - length of the string to place to the buffer in characters.
  *   The length does not include the terminating null character.
  */
-void REGPROC_resize_char_buffer(TCHAR **buffer, DWORD *len, DWORD required_len)
+void REGPROC_resize_char_buffer(CHAR **buffer, DWORD *len, DWORD required_len)
 {
     required_len++;
-    if (required_len > *len) {
+    if (required_len > *len)
+    {
         *len = required_len;
-        *buffer = HeapReAlloc(GetProcessHeap(), 0, *buffer, *len * sizeof(**buffer) * sizeof(TCHAR));
+        *buffer = HeapReAlloc(GetProcessHeap(), 0, *buffer,
+                              *len * sizeof(**buffer));
         CHECK_ENOUGH_MEMORY(*buffer);
     }
 }
@@ -1093,19 +1142,29 @@ void REGPROC_resize_char_buffer(TCHAR **buffer, DWORD *len, DWORD required_len)
 /******************************************************************************
  * Prints string str to file
  */
-void REGPROC_export_string(FILE *file, TCHAR *str)
+void REGPROC_export_string(FILE *file, CHAR *str)
 {
-    size_t len = _tcslen(str);
+    size_t len = strlen(str);
     size_t i;
 
     /* escaping characters */
-    for (i = 0; i < len; i++) {
-        TCHAR c = str[i];
-        switch (c) {
-        //case _T('\\'): _fputts(_T("\\\\"), file); break;
-        case _T('\"'): _fputts(_T("\\\""), file); break;
-        case _T('\n'): _fputts(_T("\\\n"), file); break;
-        default:       _fputtc(c, file);          break;
+    for (i = 0; i < len; i++)
+    {
+        CHAR c = str[i];
+        switch (c)
+        {
+        case '\\':
+            fputs("\\\\", file);
+            break;
+        case '\"':
+            fputs("\\\"", file);
+            break;
+        case '\n':
+            fputs("\\\n", file);
+            break;
+        default:
+            fputc(c, file);
+            break;
         }
     }
 }
@@ -1127,8 +1186,8 @@ void REGPROC_export_string(FILE *file, TCHAR *str)
  * val_size - size of the buffer for storing values in bytes.
  */
 void export_hkey(FILE *file, HKEY key,
-                 TCHAR **reg_key_name_buf, DWORD *reg_key_name_len,
-                 TCHAR **val_name_buf, DWORD *val_name_len,
+                 CHAR **reg_key_name_buf, DWORD *reg_key_name_len,
+                 CHAR **val_name_buf, DWORD *val_name_len,
                  BYTE **val_buf, DWORD *val_size)
 {
     DWORD max_sub_key_len;
@@ -1140,143 +1199,171 @@ void export_hkey(FILE *file, HKEY key,
     LONG ret;
 
     /* get size information and resize the buffers if necessary */
-    if (RegQueryInfoKey(key, NULL, NULL, NULL, NULL, &max_sub_key_len, NULL,
-                        NULL, &max_val_name_len, &max_val_size, NULL, NULL) != ERROR_SUCCESS) {
+    if (RegQueryInfoKey(key, NULL, NULL, NULL, NULL,
+                        &max_sub_key_len, NULL,
+                        NULL, &max_val_name_len, &max_val_size, NULL, NULL
+        ) != ERROR_SUCCESS)
+    {
         REGPROC_print_error();
     }
-    curr_len = _tcslen(*reg_key_name_buf);
-    REGPROC_resize_char_buffer(reg_key_name_buf, reg_key_name_len, max_sub_key_len + curr_len + 1);
-    REGPROC_resize_char_buffer(val_name_buf, val_name_len, max_val_name_len);
-    if (max_val_size > *val_size) {
+    curr_len = strlen(*reg_key_name_buf);
+    REGPROC_resize_char_buffer(reg_key_name_buf, reg_key_name_len,
+                               max_sub_key_len + curr_len + 1);
+    REGPROC_resize_char_buffer(val_name_buf, val_name_len,
+                               max_val_name_len);
+    if (max_val_size > *val_size)
+    {
         *val_size = max_val_size;
-        *val_buf = HeapReAlloc(GetProcessHeap(), 0, *val_buf, *val_size * sizeof(TCHAR));
+        *val_buf = HeapReAlloc(GetProcessHeap(), 0, *val_buf, *val_size);
         CHECK_ENOUGH_MEMORY(val_buf);
     }
+
     /* output data for the current key */
-    _fputts(_T("\n["), file);
-    _fputts(*reg_key_name_buf, file);
-    _fputts(_T("]\n"), file);
+    fputs("\n[", file);
+    fputs(*reg_key_name_buf, file);
+    fputs("]\n", file);
     /* print all the values */
     i = 0;
     more_data = TRUE;
-    while (more_data) {
+    while(more_data)
+    {
         DWORD value_type;
         DWORD val_name_len1 = *val_name_len;
         DWORD val_size1 = *val_size;
-        ret = RegEnumValue(key, i, *val_name_buf, &val_name_len1, NULL, &value_type, *val_buf, &val_size1);
-        if (ret != ERROR_SUCCESS) {
+        ret = RegEnumValue(key, i, *val_name_buf, &val_name_len1, NULL,
+                           &value_type, *val_buf, &val_size1);
+        if (ret != ERROR_SUCCESS)
+        {
             more_data = FALSE;
-            if (ret != ERROR_NO_MORE_ITEMS) {
+            if (ret != ERROR_NO_MORE_ITEMS)
+            {
                 REGPROC_print_error();
             }
         } else {
             i++;
-            if ((*val_name_buf)[0]) {
-                _fputts(_T("\""), file);
+
+            if ((*val_name_buf)[0])
+            {
+                fputs("\"", file);
                 REGPROC_export_string(file, *val_name_buf);
-                _fputts(_T("\"="), file);
+                fputs("\"=", file);
             } else {
-                _fputts(_T("@="), file);
+                fputs("@=", file);
             }
-            switch (value_type) {
-            case REG_EXPAND_SZ:
-                _fputts(_T("expand:"), file);
+
+            switch (value_type)
+            {
             case REG_SZ:
-                _fputts(_T("\""), file);
+            case REG_EXPAND_SZ:
+                fputs("\"", file);
                 REGPROC_export_string(file, *val_buf);
-                _fputts(_T("\"\n"), file);
+                fputs("\"\n", file);
                 break;
+
             case REG_DWORD:
-                _ftprintf(file, _T("dword:%08lx\n"), *((DWORD *)*val_buf));
+                fprintf(file, "dword:%08lx\n", *((DWORD *)*val_buf));
                 break;
+
             default:
-                _tprintf(_T("warning - unsupported registry format '%ld', ") \
-                         _T("treating as binary\n"), value_type);
-                _tprintf(_T("key name: \"%s\"\n"), *reg_key_name_buf);
-                _tprintf(_T("value name:\"%s\"\n\n"), *val_name_buf);
+                printf("%s: warning - unsupported registry format '%ld', "
+                       "treat as binary\n",
+                       getAppName(), value_type);
+                printf("key name: \"%s\"\n", *reg_key_name_buf);
+                printf("value name:\"%s\"\n\n", *val_name_buf);
                 /* falls through */
             case REG_MULTI_SZ:
                 /* falls through */
             case REG_BINARY:
             {
                 DWORD i1;
-                TCHAR *hex_prefix;
-                TCHAR buf[20];
+                CHAR *hex_prefix;
+                CHAR buf[20];
                 int cur_pos;
 
-                if (value_type == REG_BINARY) {
-                    hex_prefix = _T("hex:");
+                if (value_type == REG_BINARY)
+                {
+                    hex_prefix = "hex:";
                 } else {
                     hex_prefix = buf;
-                    _stprintf(buf, _T("hex(%ld):"), value_type);
+                    sprintf(buf, "hex(%ld):", value_type);
                 }
+
                 /* position of where the next character will be printed */
-                /* NOTE: yes, _tcslen("hex:") is used even for hex(x): */
-                cur_pos = _tcslen(_T("\"\"=")) + _tcslen(_T("hex:")) +
-                    _tcslen(*val_name_buf);
-                _fputts(hex_prefix, file);
-                for (i1 = 0; i1 < val_size1; i1++) {
-                    _ftprintf(file, _T("%02x"), (unsigned int)(*val_buf)[i1]);
-                    if (i1 + 1 < val_size1) {
-                        _fputts(_T(","), file);
+                /* NOTE: yes, strlen("hex:") is used even for hex(x): */
+                cur_pos = strlen("\"\"=") + strlen("hex:") +
+                    strlen(*val_name_buf);
+
+                fputs(hex_prefix, file);
+                for (i1 = 0; i1 < val_size1; i1++)
+                {
+                    fprintf(file, "%02x", (unsigned int)(*val_buf)[i1]);
+                    if (i1 + 1 < val_size1)
+                    {
+                        fputs(",", file);
                     }
                     cur_pos += 3;
+
                     /* wrap the line */
-                    if (cur_pos > REG_FILE_HEX_LINE_LEN) {
-                        _fputts(_T("\\\n  "), file);
+                    if (cur_pos > REG_FILE_HEX_LINE_LEN)
+                    {
+                        fputs("\\\n  ", file);
                         cur_pos = 2;
                     }
                 }
-                _fputts(_T("\n"), file);
+                fputs("\n", file);
                 break;
             }
             }
         }
     }
+
     i = 0;
     more_data = TRUE;
-    (*reg_key_name_buf)[curr_len] = _T('\\');
-    while (more_data) {
+    (*reg_key_name_buf)[curr_len] = '\\';
+    while(more_data)
+    {
         DWORD buf_len = *reg_key_name_len - curr_len;
-        ret = RegEnumKeyEx(key, i, *reg_key_name_buf + curr_len + 1, &buf_len, NULL, NULL, NULL, NULL);
-        if (ret != ERROR_SUCCESS && ret != ERROR_MORE_DATA) {
+
+        ret = RegEnumKeyEx(key, i, *reg_key_name_buf + curr_len + 1, &buf_len,
+                           NULL, NULL, NULL, NULL);
+        if (ret != ERROR_SUCCESS && ret != ERROR_MORE_DATA)
+        {
             more_data = FALSE;
-            if (ret != ERROR_NO_MORE_ITEMS) {
+            if (ret != ERROR_NO_MORE_ITEMS)
+            {
                 REGPROC_print_error();
             }
         } else {
             HKEY subkey;
 
             i++;
-            if (RegOpenKey(key, *reg_key_name_buf + curr_len + 1, &subkey) == ERROR_SUCCESS) {
-                export_hkey(file, subkey, reg_key_name_buf, reg_key_name_len, val_name_buf, val_name_len, val_buf, val_size);
+            if (RegOpenKey(key, *reg_key_name_buf + curr_len + 1,
+                           &subkey) == ERROR_SUCCESS)
+            {
+                export_hkey(file, subkey, reg_key_name_buf, reg_key_name_len,
+                            val_name_buf, val_name_len, val_buf, val_size);
                 RegCloseKey(subkey);
             } else {
                 REGPROC_print_error();
             }
         }
     }
-    (*reg_key_name_buf)[curr_len] = _T('\0');
+    (*reg_key_name_buf)[curr_len] = '\0';
 }
 
 /******************************************************************************
  * Open file for export.
  */
-FILE* REGPROC_open_export_file(TCHAR* file_name)
+FILE *REGPROC_open_export_file(CHAR *file_name)
 {
-    FILE* file;
-
-    if (!file_name) {
-        file = stdout;
-    } else {
-        file = _tfopen(file_name, _T("w"));
-        if (!file) {
-            //perror("");
-            _tprintf(_T("REGPROC_open_export_file(%s) - Can't open file.\n"), file_name);
-        } else {
-            _fputts(_T("REGEDIT4\n"), file);
-        }
+    FILE *file = fopen(file_name, "w");
+    if (!file)
+    {
+        perror("");
+        printf("%s: Can't open file \"%s\"\n", getAppName(), file_name);
+        exit(1);
     }
+    fputs("REGEDIT4\n", file);
     return file;
 }
 
@@ -1288,50 +1375,55 @@ FILE* REGPROC_open_export_file(TCHAR* file_name)
  * reg_key_name - registry branch to export. The whole registry is exported if
  *      reg_key_name is NULL or contains an empty string.
  */
-BOOL export_registry_key(TCHAR* file_name, TCHAR* reg_key_name)
+BOOL export_registry_key(CHAR *file_name, CHAR *reg_key_name)
 {
     HKEY reg_key_class;
 
-    TCHAR *reg_key_name_buf;
-    TCHAR *val_name_buf;
+    CHAR *reg_key_name_buf;
+    CHAR *val_name_buf;
     BYTE *val_buf;
     DWORD reg_key_name_len = KEY_MAX_LEN;
     DWORD val_name_len = KEY_MAX_LEN;
     DWORD val_size = REG_VAL_BUF_SIZE;
     FILE *file = NULL;
 
-    _tprintf(_T("export_registry_key(%s, %s)\n"), reg_key_name, file_name);
-
-    reg_key_name_buf = HeapAlloc(GetProcessHeap(), 0, reg_key_name_len * sizeof(*reg_key_name_buf) * sizeof(TCHAR));
-    val_name_buf = HeapAlloc(GetProcessHeap(), 0, val_name_len * sizeof(*val_name_buf) * sizeof(TCHAR));
-    val_buf = HeapAlloc(GetProcessHeap(), 0, val_size * sizeof(TCHAR));
+    reg_key_name_buf = HeapAlloc(GetProcessHeap(), 0,
+                                 reg_key_name_len  * sizeof(*reg_key_name_buf));
+    val_name_buf = HeapAlloc(GetProcessHeap(), 0,
+                             val_name_len * sizeof(*val_name_buf));
+    val_buf = HeapAlloc(GetProcessHeap(), 0, val_size);
     CHECK_ENOUGH_MEMORY(reg_key_name_buf && val_name_buf && val_buf);
 
-    if (reg_key_name && reg_key_name[0]) {
-        TCHAR *branch_name;
+    if (reg_key_name && reg_key_name[0])
+    {
+        CHAR *branch_name;
         HKEY key;
 
         REGPROC_resize_char_buffer(&reg_key_name_buf, &reg_key_name_len,
-                                   _tcslen(reg_key_name));
-        _tcscpy(reg_key_name_buf, reg_key_name);
+                                   strlen(reg_key_name));
+        strcpy(reg_key_name_buf, reg_key_name);
 
         /* open the specified key */
         reg_key_class = getRegClass(reg_key_name);
-        if (reg_key_class == (HKEY)ERROR_INVALID_PARAMETER) {
-            _tprintf(_T("Incorrect registry class specification in '%s\n"), reg_key_name);
-            //exit(1);
-            return FALSE;
+        if (reg_key_class == (HKEY)ERROR_INVALID_PARAMETER)
+        {
+            printf("%s: Incorrect registry class specification in '%s'\n",
+                   getAppName(), reg_key_name);
+            exit(1);
         }
         branch_name = getRegKeyName(reg_key_name);
         CHECK_ENOUGH_MEMORY(branch_name);
-        if (!branch_name[0]) {
+        if (!branch_name[0])
+        {
             /* no branch - registry class is specified */
             file = REGPROC_open_export_file(file_name);
             export_hkey(file, reg_key_class,
                         &reg_key_name_buf, &reg_key_name_len,
                         &val_name_buf, &val_name_len,
                         &val_buf, &val_size);
-        } else if (RegOpenKey(reg_key_class, branch_name, &key) == ERROR_SUCCESS) {
+        }
+        else if (RegOpenKey(reg_key_class, branch_name, &key) == ERROR_SUCCESS)
+        {
             file = REGPROC_open_export_file(file_name);
             export_hkey(file, key,
                         &reg_key_name_buf, &reg_key_name_len,
@@ -1339,7 +1431,8 @@ BOOL export_registry_key(TCHAR* file_name, TCHAR* reg_key_name)
                         &val_buf, &val_size);
             RegCloseKey(key);
         } else {
-            _tprintf(_T("Can't export. Registry key '%s does not exist!\n"), reg_key_name);
+            printf("%s: Can't export. Registry key '%s' does not exist!\n",
+                   getAppName(), reg_key_name);
             REGPROC_print_error();
         }
         HeapFree(GetProcessHeap(), 0, branch_name);
@@ -1348,12 +1441,14 @@ BOOL export_registry_key(TCHAR* file_name, TCHAR* reg_key_name)
 
         /* export all registry classes */
         file = REGPROC_open_export_file(file_name);
-        for (i = 0; i < REG_CLASS_NUMBER; i++) {
+        for (i = 0; i < REG_CLASS_NUMBER; i++)
+        {
             /* do not export HKEY_CLASSES_ROOT */
             if (reg_class_keys[i] != HKEY_CLASSES_ROOT &&
                 reg_class_keys[i] != HKEY_CURRENT_USER &&
-                reg_class_keys[i] != HKEY_CURRENT_CONFIG) {
-                _tcscpy(reg_key_name_buf, reg_class_names[i]);
+                reg_class_keys[i] != HKEY_CURRENT_CONFIG)
+            {
+                strcpy(reg_key_name_buf, reg_class_names[i]);
                 export_hkey(file, reg_class_keys[i],
                             &reg_key_name_buf, &reg_key_name_len,
                             &val_name_buf, &val_name_len,
@@ -1361,13 +1456,13 @@ BOOL export_registry_key(TCHAR* file_name, TCHAR* reg_key_name)
             }
         }
     }
-    if (file_name && file) {
+
+    if (file)
+    {
         fclose(file);
     }
-//    HeapFree(GetProcessHeap(), 0, reg_key_name);
+    HeapFree(GetProcessHeap(), 0, reg_key_name);
     HeapFree(GetProcessHeap(), 0, val_buf);
-    HeapFree(GetProcessHeap(), 0, val_name_buf);
-    HeapFree(GetProcessHeap(), 0, reg_key_name_buf);
     return TRUE;
 }
 
@@ -1376,7 +1471,7 @@ BOOL export_registry_key(TCHAR* file_name, TCHAR* reg_key_name)
  */
 BOOL import_registry_file(LPTSTR filename)
 {
-    FILE* reg_file = _tfopen(filename, _T("r"));
+    FILE* reg_file = fopen(filename, "r");
 
     if (reg_file) {
         processRegLines(reg_file, doSetValue);
@@ -1388,7 +1483,8 @@ BOOL import_registry_file(LPTSTR filename)
 /******************************************************************************
  * Recursive function which removes the registry key with all subkeys.
  */
-BOOL delete_branch(HKEY key, TCHAR** reg_key_name_buf, DWORD* reg_key_name_len)
+void delete_branch(HKEY key,
+                   CHAR **reg_key_name_buf, DWORD *reg_key_name_len)
 {
     HKEY branch_key;
     DWORD max_sub_key_len;
@@ -1397,29 +1493,35 @@ BOOL delete_branch(HKEY key, TCHAR** reg_key_name_buf, DWORD* reg_key_name_len)
     LONG ret;
     long int i;
 
-    if (RegOpenKey(key, *reg_key_name_buf, &branch_key) != ERROR_SUCCESS) {
+    if (RegOpenKey(key, *reg_key_name_buf, &branch_key) != ERROR_SUCCESS)
+    {
         REGPROC_print_error();
-        return FALSE;
     }
 
     /* get size information and resize the buffers if necessary */
-    if (RegQueryInfoKey(branch_key, NULL, NULL, NULL, &subkeys, &max_sub_key_len,
-                        NULL, NULL, NULL, NULL, NULL, NULL) != ERROR_SUCCESS) {
+    if (RegQueryInfoKey(branch_key, NULL, NULL, NULL,
+                        &subkeys, &max_sub_key_len,
+                        NULL, NULL, NULL, NULL, NULL, NULL
+        ) != ERROR_SUCCESS)
+    {
         REGPROC_print_error();
-        RegCloseKey(branch_key);
-        return FALSE;
     }
-    curr_len = _tcslen(*reg_key_name_buf);
-    REGPROC_resize_char_buffer(reg_key_name_buf, reg_key_name_len, max_sub_key_len + curr_len + 1);
+    curr_len = strlen(*reg_key_name_buf);
+    REGPROC_resize_char_buffer(reg_key_name_buf, reg_key_name_len,
+                               max_sub_key_len + curr_len + 1);
 
     (*reg_key_name_buf)[curr_len] = '\\';
-    for (i = subkeys - 1; i >= 0; i--) {
+    for (i = subkeys - 1; i >= 0; i--)
+    {
         DWORD buf_len = *reg_key_name_len - curr_len;
-        ret = RegEnumKeyEx(branch_key, i, *reg_key_name_buf + curr_len + 1, &buf_len, NULL, NULL, NULL, NULL);
-        if (ret != ERROR_SUCCESS && ret != ERROR_MORE_DATA && ret != ERROR_NO_MORE_ITEMS) {
+
+        ret = RegEnumKeyEx(branch_key, i, *reg_key_name_buf + curr_len + 1,
+                           &buf_len, NULL, NULL, NULL, NULL);
+        if (ret != ERROR_SUCCESS &&
+            ret != ERROR_MORE_DATA &&
+            ret != ERROR_NO_MORE_ITEMS)
+        {
             REGPROC_print_error();
-            RegCloseKey(branch_key);
-            return FALSE;
         } else {
             delete_branch(key, reg_key_name_buf, reg_key_name_len);
         }
@@ -1427,7 +1529,6 @@ BOOL delete_branch(HKEY key, TCHAR** reg_key_name_buf, DWORD* reg_key_name_len)
     (*reg_key_name_buf)[curr_len] = '\0';
     RegCloseKey(branch_key);
     RegDeleteKey(key, *reg_key_name_buf);
-    return TRUE;
 }
 
 /******************************************************************************
@@ -1437,32 +1538,34 @@ BOOL delete_branch(HKEY key, TCHAR** reg_key_name_buf, DWORD* reg_key_name_len)
  * reg_key_name - full name of registry branch to delete. Ignored if is NULL,
  *      empty, points to register key class, does not exist.
  */
-void delete_registry_key(TCHAR* reg_key_name)
+void delete_registry_key(CHAR *reg_key_name)
 {
-    TCHAR* branch_name;
+    CHAR *branch_name;
     DWORD branch_name_len;
     HKEY reg_key_class;
     HKEY branch_key;
 
-    if (!reg_key_name || !reg_key_name[0]) {
+    if (!reg_key_name || !reg_key_name[0])
         return;
-    }
     /* open the specified key */
     reg_key_class = getRegClass(reg_key_name);
-    if (reg_key_class == (HKEY)ERROR_INVALID_PARAMETER) {
-        _tprintf(_T("Incorrect registry class specification in '%s'\n"), reg_key_name);
-        //exit(1);
-        return;
+    if (reg_key_class == (HKEY)ERROR_INVALID_PARAMETER)
+    {
+        printf("%s: Incorrect registry class specification in '%s'\n",
+               getAppName(), reg_key_name);
+        exit(1);
     }
     branch_name = getRegKeyName(reg_key_name);
     CHECK_ENOUGH_MEMORY(branch_name);
-    branch_name_len = _tcslen(branch_name);
-    if (!branch_name[0]) {
-        _tprintf(_T("Can't delete registry class '%s'\n"), reg_key_name);
-        //exit(1);
-        return;
+    branch_name_len = strlen(branch_name);
+    if (!branch_name[0])
+    {
+        printf("%s: Can't delete registry class '%s'\n",
+               getAppName(), reg_key_name);
+        exit(1);
     }
-    if (RegOpenKey(reg_key_class, branch_name, &branch_key) == ERROR_SUCCESS) {
+    if (RegOpenKey(reg_key_class, branch_name, &branch_key) == ERROR_SUCCESS)
+    {
         /* check whether the key exists */
         RegCloseKey(branch_key);
         delete_branch(reg_key_class, &branch_name, &branch_name_len);
@@ -1470,64 +1573,16 @@ void delete_registry_key(TCHAR* reg_key_name)
     HeapFree(GetProcessHeap(), 0, branch_name);
 }
 
-////////////////////////////////////////////////////////////////////////////////
-//#ifdef __GNUC__
-#ifdef WIN32_REGDBG
-
-int nHeapAllocCalls = 0;
-int nHeapReAllocCalls = 0;
-int nHeapFreeCalls = 0;
-int nHeapBuffersOutstanding = 0;
-
-//extern LONG  APIENTRY RegCloseKey(LONG hKey);
-
-#ifdef __GNUC__
-extern PVOID STDCALL AquireMemory(HANDLE PoolType, ULONG NumberOfBytes, ULONG Tag);
-extern PVOID STDCALL ReAquireMemory(HANDLE PoolType, LPVOID lpMem, ULONG NumberOfBytes, ULONG Tag);
-extern BOOL STDCALL FreeMemory(PVOID buf);
-#else
-extern PVOID __cdecl AquireMemory(HANDLE PoolType, ULONG NumberOfBytes, ULONG Tag);
-extern PVOID __cdecl ReAquireMemory(HANDLE PoolType, LPVOID lpMem, ULONG NumberOfBytes, ULONG Tag);
-extern BOOL __cdecl FreeMemory(PVOID buf);
-#endif
-
-LPVOID RegHeapAlloc(HANDLE hHeap, DWORD dwFlags, SIZE_T dwBytes)
-{
-    LPVOID result;
-//    result = HeapAlloc(hHeap, dwFlags, dwBytes);
-    result = AquireMemory(hHeap, dwBytes, 0);
-    ASSERT(result);
-    if (result) {
-        ++nHeapBuffersOutstanding;
-        ++nHeapAllocCalls;
-    }
-    return result;
-}
-
-LPVOID RegHeapReAlloc(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem, SIZE_T dwBytes)
+/******************************************************************************
+ * Sets the application name. Then application name is used in the error
+ * reporting.
+ */
+void setAppName(CHAR *name)
 {
-    LPVOID result;
-//    result = HeapReAlloc(hHeap, dwFlags, lpMem, dwBytes);
-    result = ReAquireMemory(hHeap, lpMem, dwBytes, 0);
-    assert(result);
-    if (result) {
-        ++nHeapReAllocCalls;
-    }
-    return result;
+    app_name = name;
 }
 
-BOOL RegHeapFree(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem)
+CHAR *getAppName()
 {
-    BOOL result = TRUE;
-//    result = HeapFree(hHeap, dwFlags, lpMem);
-    result = FreeMemory(lpMem);
-    assert(result);
-    if (result) {
-        --nHeapBuffersOutstanding;
-        ++nHeapFreeCalls;
-    }
-    return result;
+    return app_name;
 }
-
-#endif /*WIN32_REGDBG*/
-//#endif /*__GNUC__*/
diff --git a/reactos/subsys/system/regedit/regproc.h b/reactos/subsys/system/regedit/regproc.h
new file mode 100644 (file)
index 0000000..2bd67e5
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+ * Copyright 1999 Sylvain St-Germain
+ * Copyright 2002 Andriy Palamarchuk
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/******************************************************************************
+ * Defines and consts
+ */
+#define KEY_MAX_LEN             1024
+
+/* Return values */
+#define SUCCESS               0
+#define KEY_VALUE_ALREADY_SET 2
+
+typedef void (*CommandAPI)(LPSTR lpsLine);
+
+void doSetValue(LPSTR lpsLine);
+void doDeleteValue(LPSTR lpsLine);
+void doCreateKey(LPSTR lpsLine);
+void doDeleteKey(LPSTR lpsLine);
+void doQueryValue(LPSTR lpsLine);
+void doRegisterDLL(LPSTR lpsLine);
+void doUnregisterDLL(LPSTR lpsLine);
+
+BOOL export_registry_key(CHAR *file_name, CHAR *reg_key_name);
+BOOL import_registry_file(LPTSTR filename);
+void delete_registry_key(CHAR *reg_key_name);
+
+void setAppName(CHAR *name);
+CHAR *getAppName();
+
+void processRegLines(FILE *in, CommandAPI command);
+
+/*
+ * Generic prototypes
+ */
+char*   getToken(char** str, const char* delims);
+void get_file_name(CHAR **command_line, CHAR *filename);
+DWORD   convertHexToDWord(char *str, BYTE *buf);
+DWORD   convertHexCSVToHex(char *str, BYTE *buf, ULONG bufLen);
+LPSTR   convertHexToHexCSV( BYTE *buf, ULONG len);
+LPSTR   convertHexToDWORDStr( BYTE *buf, ULONG len);
+LPSTR   getRegKeyName(LPSTR lpLine);
+HKEY    getRegClass(LPSTR lpLine);
+DWORD   getDataType(LPSTR *lpValue, DWORD* parse_type);
+LPSTR   getArg(LPSTR arg);
+HRESULT openKey(LPSTR stdInput);
+void    closeKey();
+
+/*
+ * api setValue prototypes
+ */
+void    processSetValue(LPSTR cmdline);
+HRESULT setValue(LPSTR val_name, LPSTR val_data);
+
+/*
+ * api queryValue prototypes
+ */
+void    processQueryValue(LPSTR cmdline);
diff --git a/reactos/subsys/system/regedit/res/folder1.bmp b/reactos/subsys/system/regedit/res/folder1.bmp
new file mode 100644 (file)
index 0000000..dada286
Binary files /dev/null and b/reactos/subsys/system/regedit/res/folder1.bmp differ
diff --git a/reactos/subsys/system/regedit/res/folder2.bmp b/reactos/subsys/system/regedit/res/folder2.bmp
new file mode 100644 (file)
index 0000000..35fedba
Binary files /dev/null and b/reactos/subsys/system/regedit/res/folder2.bmp differ
diff --git a/reactos/subsys/system/regedit/res/folder3.bmp b/reactos/subsys/system/regedit/res/folder3.bmp
new file mode 100644 (file)
index 0000000..dfc3c4f
Binary files /dev/null and b/reactos/subsys/system/regedit/res/folder3.bmp differ
similarity index 82%
rename from rosapps/regedit/resource.h
rename to reactos/subsys/system/regedit/resource.h
index 6ef4412..f266d40 100644 (file)
@@ -1,7 +1,23 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Developer Studio generated include file.
-// Used by regedit.rc
-//
+/*
+ * Regedit resource definitions
+ *
+ * Copyright 2002 Robert Dickenson
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
 #define ID_REGISTRY_MENU                0
 #define ID_EDIT_MENU                    1
 #define ID_VIEW_MENU                    2
 #define ID_REGISTRY_SAVESUBTREEAS       32834
 #define IDS_LICENSE                     32835
 #define IDC_STATIC                      -1
-
-// Next default values for new objects
-// 
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE        133
-#define _APS_NEXT_COMMAND_VALUE         32836
-#define _APS_NEXT_CONTROL_VALUE         1000
-#define _APS_NEXT_SYMED_VALUE           110
-#endif
-#endif
diff --git a/reactos/subsys/system/regedit/resource.rc b/reactos/subsys/system/regedit/resource.rc
new file mode 100644 (file)
index 0000000..cc2d083
--- /dev/null
@@ -0,0 +1,98 @@
+/*
+ * Regedit resources
+ *
+ * Copyright 2002 Robert Dickenson
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+IDB_OPEN_FILE BITMAP  DISCARDABLE
+#ifndef __WINE__
+"res/folder3.bmp"
+#else
+/* BINRES folder3.bmp */
+{
+ '42 4D F6 00 00 00 00 00 00 00 76 00 00 00 28 00'
+ '00 00 10 00 00 00 10 00 00 00 01 00 04 00 00 00'
+ '00 00 80 00 00 00 00 00 00 00 00 00 00 00 00 00'
+ '00 00 00 00 00 00 00 00 00 00 00 00 80 00 00 80'
+ '00 00 00 80 80 00 80 00 00 00 80 00 80 00 80 80'
+ '00 00 80 80 80 00 FF FF FF 00 00 00 FF 00 00 FF'
+ '00 00 00 FF FF 00 FF 00 00 00 FF 00 FF 00 FF FF'
+ '00 00 FF FF FF 00 88 88 88 88 88 88 88 88 88 88'
+ '88 88 88 88 88 88 88 88 88 88 88 88 88 88 80 00'
+ '00 00 00 00 88 88 80 33 33 33 33 33 08 88 80 03'
+ '33 33 33 33 38 88 80 B3 33 33 33 33 30 88 80 B0'
+ '33 33 33 33 33 88 80 BB 33 33 33 33 33 08 80 BB'
+ '00 00 00 00 00 08 80 BB BB BB BB BB 08 88 80 BB'
+ 'BB BB BB BB 08 88 80 BB B0 00 00 00 08 88 80 00'
+ '00 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88'
+ '88 88 88 88 88 88'
+}
+#endif
+
+IDB_CLOSED_FILE BITMAP  DISCARDABLE
+#ifndef __WINE__
+"res/folder2.bmp"
+#else
+/* BINRES folder2.bmp */
+{
+ '42 4D F6 00 00 00 00 00 00 00 76 00 00 00 28 00'
+ '00 00 10 00 00 00 10 00 00 00 01 00 04 00 00 00'
+ '00 00 80 00 00 00 12 0B 00 00 12 0B 00 00 10 00'
+ '00 00 10 00 00 00 00 00 00 00 00 00 80 00 00 80'
+ '00 00 00 80 80 00 80 00 00 00 80 00 80 00 80 80'
+ '00 00 C0 C0 C0 00 80 80 80 00 00 00 FF 00 00 FF'
+ '00 00 00 00 FF 00 FF 00 00 00 FF 00 FF 00 FF FF'
+ '00 00 FF FF FF 00 FF FF FF FF FF FF FF FF FF FF'
+ 'FF FF FF FF FF FF FF 00 00 00 00 00 00 00 F8 88'
+ '88 88 88 88 88 80 F8 FB 7B 7B 7B 7B 7B 80 F8 F7'
+ 'B7 B7 B7 B7 B7 80 F8 FB 7B 7B 7B 7B 7B 80 F8 F7'
+ 'B7 B7 B7 B7 B7 80 F8 FB 7B 7B 7B 7B 7B 80 F8 F7'
+ 'B7 B7 B7 B7 B7 80 F8 FB 7B 7B 7B 7B 7B 80 F8 FF'
+ 'FF FF FF FF FF 80 F8 B7 B7 B7 B8 88 88 8F FF 8B'
+ '7B 7B 8F FF FF FF FF F8 88 88 FF FF FF FF FF FF'
+ 'FF FF FF FF FF FF'
+}
+#endif
+
+IDB_ROOT BITMAP DISCARDABLE
+#ifndef __WINE__
+"res/folder1.bmp"
+#else
+/* BINRES folder1.bmp */
+{
+ '42 4D F6 00 00 00 00 00 00 00 76 00 00 00 28 00'
+ '00 00 10 00 00 00 10 00 00 00 01 00 04 00 00 00'
+ '00 00 80 00 00 00 00 00 00 00 00 00 00 00 10 00'
+ '00 00 10 00 00 00 00 00 00 00 00 00 80 00 00 80'
+ '00 00 00 80 80 00 80 00 00 00 80 00 80 00 80 80'
+ '00 00 C0 C0 C0 00 80 80 80 00 00 00 FF 00 00 FF'
+ '00 00 00 FF FF 00 FF 00 00 00 FF 00 FF 00 FF FF'
+ '00 00 FF FF FF 00 FF FF FF FF FF FF FF FF FF FF'
+ 'FF FF FF FF FF FF FF 00 00 00 00 00 00 00 F8 88'
+ '88 88 88 88 88 80 F8 FB 7B 7B 7B 7B 7B 80 F8 F7'
+ 'B7 B7 B7 B7 B7 80 F8 FB 7B 7B 7B 7B 7B 80 F8 F7'
+ 'B7 B7 B7 B7 B7 80 F8 FB 7B 7B 7B 7B 7B 80 F8 F7'
+ 'B7 B7 B7 B7 B7 80 F8 FB 7B 7B 7B 7B 7B 80 F8 FF'
+ 'FF FF FF FF FF 80 F8 B7 B7 B7 B8 88 88 8F FF 8B'
+ '7B 7B 8F FF FF FF FF F8 88 88 FF FF FF FF FF FF'
+ 'FF FF FF FF FF FF'
+}
+#endif
+
+#ifdef __WINE__
+#include "wine/wine_common_ver.rc"
+#endif
similarity index 73%
rename from rosapps/regedit/about.h
rename to reactos/subsys/system/regedit/rsrc.rc
index 27710a4..e3e0f06 100644 (file)
@@ -1,9 +1,7 @@
 /*
- *  ReactOS About Dialog Box
+ * Regedit resources
  *
- *  about.h
- *
- *  Copyright (C) 2002  Robert Dickenson <robd@reactos.org>
+ * Copyright 2002 Robert Dickenson
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-    
-#ifndef __ABOUT_H__
-#define __ABOUT_H__
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+#include "windows.h"
+#include "resource.h"
+
+/* define language neutral resources */
 
-void ShowAboutBox(HWND hWnd);
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
 
+#include "resource.rc"
 
-#ifdef __cplusplus
-};
-#endif
+/* include localised resources */
 
-#endif // __ABOUT_H__
+#include "En.rc"
+#include "Pt.rc"
similarity index 55%
rename from rosapps/regedit/treeview.c
rename to reactos/subsys/system/regedit/treeview.c
index 208b6b1..3643c4f 100644 (file)
@@ -1,9 +1,7 @@
 /*
- *  ReactOS regedit
+ * Regedit treeview
  *
- *  treeview.c
- *
- *  Copyright (C) 2002  Robert Dickenson <robd@reactos.org>
+ * Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#define WIN32_LEAN_AND_MEAN     // Exclude rarely-used stuff from Windows headers
+#define WIN32_LEAN_AND_MEAN     /* Exclude rarely-used stuff from Windows headers */
+
+#define NONAMELESSUNION
+#define NONAMELESSSTRUCT
 #include <windows.h>
 #include <commctrl.h>
 #include <stdlib.h>
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
-    
-#include "main.h"
-#include "treeview.h"
 
+#include "main.h"
 
-// Global variables and constants 
-// Image_Open, Image_Closed, and Image_Root - integer variables for indexes of the images. 
-// CX_BITMAP and CY_BITMAP - width and height of an icon. 
-// NUM_BITMAPS - number of bitmaps to add to the image list. 
-int Image_Open; 
-int Image_Closed; 
-int Image_Root; 
+/* Global variables and constants  */
+/* Image_Open, Image_Closed, and Image_Root - integer variables for indexes of the images.  */
+/* CX_BITMAP and CY_BITMAP - width and height of an icon.  */
+/* NUM_BITMAPS - number of bitmaps to add to the image list.  */
+int Image_Open;
+int Image_Closed;
+int Image_Root;
 
 #define CX_BITMAP    16
 #define CY_BITMAP    16
@@ -54,7 +53,7 @@ HKEY FindRegRoot(HWND hwndTV, HTREEITEM hItem, LPTSTR keyPath, int* pPathLen, in
 
     if (TreeView_GetItem(hwndTV, &item)) {
         if (item.lParam == 0) {
-            // recurse
+            /* recurse */
             hKey = FindRegRoot(hwndTV, item.hItem, keyPath, pPathLen, max);
             keyPath[*pPathLen] = _T('\\');
             ++(*pPathLen);
@@ -66,11 +65,11 @@ HKEY FindRegRoot(HWND hwndTV, HTREEITEM hItem, LPTSTR keyPath, int* pPathLen, in
                 *pPathLen += _tcslen(item.pszText);
             }
         } else {
-            // found root key with valid key value
+            /* found root key with valid key value */
             hKey = (HKEY)item.lParam;
             item.mask = TVIF_TEXT;
             item.hItem = hItem;
-//            item.pszText = &keyPath[*pPathLen];
+/*            item.pszText = &keyPath[*pPathLen]; */
             item.pszText = keyPath;
             item.cchTextMax = max;
             if (TreeView_GetItem(hwndTV, &item)) {
@@ -82,48 +81,48 @@ HKEY FindRegRoot(HWND hwndTV, HTREEITEM hItem, LPTSTR keyPath, int* pPathLen, in
 }
 
 static HTREEITEM AddEntryToTree(HWND hwndTV, HTREEITEM hParent, LPTSTR label, HKEY hKey, DWORD dwChildren)
-{ 
+{
     HTREEITEM hItem = 0;
-    TVITEM tvi; 
-    TVINSERTSTRUCT tvins; 
-
-    tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN | TVIF_PARAM; 
-    tvi.pszText = label; 
-    tvi.cchTextMax = lstrlen(tvi.pszText); 
-    tvi.iImage = Image_Closed; 
-    tvi.iSelectedImage = Image_Open; 
-    tvi.cChildren = dwChildren; 
+    TVITEM tvi;
+    TVINSERTSTRUCT tvins;
+
+    tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN | TVIF_PARAM;
+    tvi.pszText = label;
+    tvi.cchTextMax = lstrlen(tvi.pszText);
+    tvi.iImage = Image_Closed;
+    tvi.iSelectedImage = Image_Open;
+    tvi.cChildren = dwChildren;
     tvi.lParam = (LPARAM)hKey;
-    tvins.item = tvi; 
-    if (hKey) tvins.hInsertAfter = (HTREEITEM)TVI_LAST; 
-    else      tvins.hInsertAfter = (HTREEITEM)TVI_SORT; 
-    tvins.hParent = hParent; 
+    tvins.u.item = tvi;
+    if (hKey) tvins.hInsertAfter = (HTREEITEM)TVI_LAST;
+    else      tvins.hInsertAfter = (HTREEITEM)TVI_SORT;
+    tvins.hParent = hParent;
     hItem = (HTREEITEM)SendMessage(hwndTV, TVM_INSERTITEM, 0, (LPARAM)(LPTVINSERTSTRUCT)&tvins);
     return hItem;
 }
 
 
-static BOOL InitTreeViewItems(HWND hwndTV, LPTSTR pHostName) 
-{ 
-    TVITEM tvi; 
-    TVINSERTSTRUCT tvins; 
-    HTREEITEM hRoot; 
-
-    tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN | TVIF_PARAM; 
-    // Set the text of the item. 
-    tvi.pszText = pHostName; 
-    tvi.cchTextMax = lstrlen(tvi.pszText); 
-    // Assume the item is not a parent item, so give it an image. 
-    tvi.iImage = Image_Root; 
-    tvi.iSelectedImage = Image_Root; 
-    tvi.cChildren = 5; 
-    // Save the heading level in the item's application-defined data area. 
+static BOOL InitTreeViewItems(HWND hwndTV, LPTSTR pHostName)
+{
+    TVITEM tvi;
+    TVINSERTSTRUCT tvins;
+    HTREEITEM hRoot;
+
+    tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN | TVIF_PARAM;
+    /* Set the text of the item.  */
+    tvi.pszText = pHostName;
+    tvi.cchTextMax = lstrlen(tvi.pszText);
+    /* Assume the item is not a parent item, so give it an image.  */
+    tvi.iImage = Image_Root;
+    tvi.iSelectedImage = Image_Root;
+    tvi.cChildren = 5;
+    /* Save the heading level in the item's application-defined data area.  */
     tvi.lParam = (LPARAM)NULL;
-    tvins.item = tvi; 
-    tvins.hInsertAfter = (HTREEITEM)TVI_FIRST; 
-    tvins.hParent = TVI_ROOT; 
-    // Add the item to the tree view control. 
-    hRoot = (HTREEITEM)SendMessage(hwndTV, TVM_INSERTITEM, 0, (LPARAM)(LPTVINSERTSTRUCT)&tvins); 
+    tvins.u.item = tvi;
+    tvins.hInsertAfter = (HTREEITEM)TVI_FIRST;
+    tvins.hParent = TVI_ROOT;
+    /* Add the item to the tree view control.  */
+    hRoot = (HTREEITEM)SendMessage(hwndTV, TVM_INSERTITEM, 0, (LPARAM)(LPTVINSERTSTRUCT)&tvins);
 
     AddEntryToTree(hwndTV, hRoot, _T("HKEY_CLASSES_ROOT"), HKEY_CLASSES_ROOT, 1);
     AddEntryToTree(hwndTV, hRoot, _T("HKEY_CURRENT_USER"), HKEY_CURRENT_USER, 1);
@@ -131,49 +130,51 @@ static BOOL InitTreeViewItems(HWND hwndTV, LPTSTR pHostName)
     AddEntryToTree(hwndTV, hRoot, _T("HKEY_USERS"), HKEY_USERS, 1);
     AddEntryToTree(hwndTV, hRoot, _T("HKEY_CURRENT_CONFIG"), HKEY_CURRENT_CONFIG, 1);
 
-    return TRUE; 
-} 
+    return TRUE;
+}
 
-// InitTreeViewImageLists - creates an image list, adds three bitmaps 
-// to it, and associates the image list with a tree view control. 
-// Returns TRUE if successful, or FALSE otherwise. 
-// hwndTV - handle to the tree view control. 
+/*
+ * InitTreeViewImageLists - creates an image list, adds three bitmaps
+ * to it, and associates the image list with a tree view control.
+ * Returns TRUE if successful, or FALSE otherwise.
+ * hwndTV - handle to the tree view control.
+ */
 
-static BOOL InitTreeViewImageLists(HWND hwndTV) 
-{ 
-    HIMAGELIST himl;  // handle to image list 
-    HBITMAP hbmp;     // handle to bitmap 
+static BOOL InitTreeViewImageLists(HWND hwndTV)
+{
+    HIMAGELIST himl;  /* handle to image list  */
+    HBITMAP hbmp;     /* handle to bitmap  */
 
-    // Create the image list. 
-    if ((himl = ImageList_Create(CX_BITMAP, CY_BITMAP, 
-        FALSE, NUM_BITMAPS, 0)) == NULL) 
-        return FALSE; 
+    /* Create the image list.  */
+    if ((himl = ImageList_Create(CX_BITMAP, CY_BITMAP,
+        FALSE, NUM_BITMAPS, 0)) == NULL)
+        return FALSE;
 
-    // Add the open file, closed file, and document bitmaps. 
-    hbmp = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_OPEN_FILE)); 
-    Image_Open = ImageList_Add(himl, hbmp, (HBITMAP) NULL); 
-    DeleteObject(hbmp); 
+    /* Add the open file, closed file, and document bitmaps.  */
+    hbmp = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_OPEN_FILE));
+    Image_Open = ImageList_Add(himl, hbmp, (HBITMAP) NULL);
+    DeleteObject(hbmp);
 
-    hbmp = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_CLOSED_FILE)); 
-    Image_Closed = ImageList_Add(himl, hbmp, (HBITMAP) NULL); 
-    DeleteObject(hbmp); 
+    hbmp = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_CLOSED_FILE));
+    Image_Closed = ImageList_Add(himl, hbmp, (HBITMAP) NULL);
+    DeleteObject(hbmp);
 
-    hbmp = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_ROOT)); 
-    Image_Root = ImageList_Add(himl, hbmp, (HBITMAP) NULL); 
-    DeleteObject(hbmp); 
+    hbmp = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_ROOT));
+    Image_Root = ImageList_Add(himl, hbmp, (HBITMAP) NULL);
+    DeleteObject(hbmp);
 
-    // Fail if not all of the images were added. 
-    if (ImageList_GetImageCount(himl) < 3) 
-        return FALSE; 
+    /* Fail if not all of the images were added.  */
+    if (ImageList_GetImageCount(himl) < 3)
+        return FALSE;
 
-    // Associate the image list with the tree view control. 
-    TreeView_SetImageList(hwndTV, himl, TVSIL_NORMAL); 
+    /* Associate the image list with the tree view control.  */
+    TreeView_SetImageList(hwndTV, himl, TVSIL_NORMAL);
 
-    return TRUE; 
-} 
+    return TRUE;
+}
 
 BOOL OnTreeExpanding(HWND hwndTV, NMTREEVIEW* pnmtv)
-{ 
+{
     HKEY hKey;
     TCHAR keyPath[1000];
     int keyPathLen = 0;
@@ -185,7 +186,7 @@ BOOL OnTreeExpanding(HWND hwndTV, NMTREEVIEW* pnmtv)
     }
     expanding = TRUE;
 
-    // check if this is either the root or a subkey item...
+    /* check if this is either the root or a subkey item... */
     if ((HKEY)pnmtv->itemNew.lParam == NULL) {
         keyPath[0] = _T('\0');
         hKey = FindRegRoot(hwndTV, pnmtv->itemNew.hItem, keyPath, &keyPathLen, sizeof(keyPath)/sizeof(TCHAR));
@@ -202,14 +203,14 @@ BOOL OnTreeExpanding(HWND hwndTV, NMTREEVIEW* pnmtv)
             DWORD cName = MAX_NAME_LEN;
             FILETIME LastWriteTime;
             DWORD dwIndex = 0L;
-            //ShowWindow(hwndTV, SW_HIDE);
+            /*ShowWindow(hwndTV, SW_HIDE); */
             while (RegEnumKeyEx(hNewKey, dwIndex, Name, &cName, NULL, NULL, NULL, &LastWriteTime) == ERROR_SUCCESS) {
                 DWORD dwCount = 0L;
                 errCode = RegOpenKeyEx(hNewKey, Name, 0, KEY_READ, &hKey);
                 if (errCode == ERROR_SUCCESS) {
                     TCHAR SubName[MAX_NAME_LEN];
                     DWORD cSubName = MAX_NAME_LEN;
-//                    if (RegEnumKeyEx(hKey, 0, SubName, &cSubName, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) {
+/*                    if (RegEnumKeyEx(hKey, 0, SubName, &cSubName, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) { */
                     while (RegEnumKeyEx(hKey, dwCount, SubName, &cSubName, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) {
                         ++dwCount;
                     }
@@ -219,34 +220,36 @@ BOOL OnTreeExpanding(HWND hwndTV, NMTREEVIEW* pnmtv)
                 cName = MAX_NAME_LEN;
                 ++dwIndex;
             }
-               //ShowWindow(hwndTV, SW_SHOWNOACTIVATE);
+               /*ShowWindow(hwndTV, SW_SHOWNOACTIVATE); */
             RegCloseKey(hNewKey);
         }
     } else {
     }
     expanding = FALSE;
     return TRUE;
-} 
+}
 
-// CreateTreeView - creates a tree view control. 
-// Returns the handle to the new control if successful, or NULL otherwise. 
-// hwndParent - handle to the control's parent window. 
+/*
+ * CreateTreeView - creates a tree view control.
+ * Returns the handle to the new control if successful, or NULL otherwise.
+ * hwndParent - handle to the control's parent window.
+ */
 
-HWND CreateTreeView(HWND hwndParent, LPTSTR pHostName, int id) 
-{ 
+HWND CreateTreeView(HWND hwndParent, LPTSTR pHostName, int id)
+{
     RECT rcClient;
     HWND hwndTV;
-    // Get the dimensions of the parent window's client area, and create the tree view control. 
-    GetClientRect(hwndParent, &rcClient); 
-    hwndTV = CreateWindowEx(WS_EX_CLIENTEDGE, WC_TREEVIEW, _T("Tree View"), 
+
+    /* Get the dimensions of the parent window's client area, and create the tree view control.  */
+    GetClientRect(hwndParent, &rcClient);
+    hwndTV = CreateWindowEx(WS_EX_CLIENTEDGE, WC_TREEVIEW, _T("Tree View"),
         WS_VISIBLE | WS_CHILD | TVS_HASLINES | TVS_HASBUTTONS | TVS_LINESATROOT,
-        0, 0, rcClient.right, rcClient.bottom, 
-        hwndParent, (HMENU)id, hInst, NULL); 
-    // Initialize the image list, and add items to the control. 
-    if (!InitTreeViewImageLists(hwndTV) || !InitTreeViewItems(hwndTV, pHostName)) { 
-        DestroyWindow(hwndTV); 
-        return NULL; 
-    } 
+        0, 0, rcClient.right, rcClient.bottom,
+        hwndParent, (HMENU)id, hInst, NULL);
+    /* Initialize the image list, and add items to the control.  */
+    if (!InitTreeViewImageLists(hwndTV) || !InitTreeViewItems(hwndTV, pHostName)) {
+        DestroyWindow(hwndTV);
+        return NULL;
+    }
     return hwndTV;
-} 
+}
index 7424d15..e1a8daa 100644 (file)
@@ -25,7 +25,6 @@ APPS =        calc \
        net$(SEP)finger \
        net$(SEP)ncftp \
        net$(SEP)ping \
-       regedit \
        regedt32 \
        welcome \
 #      winfile
diff --git a/rosapps/regedit/.cvsignore b/rosapps/regedit/.cvsignore
deleted file mode 100644 (file)
index 954ada3..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-*.sys
-*.exe
-*.dll
-*.cpl
-*.a
-*.o
-*.d
-*.coff
-*.dsp
-*.dsw
-*.aps
-*.ncb
-*.opt
-*.sym
-*.plg
-*.bak
-*.map
diff --git a/rosapps/regedit/Makefile b/rosapps/regedit/Makefile
deleted file mode 100644 (file)
index 63a581f..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-#  ReactOS regedit
-#
-#  Makefile
-#
-
-PATH_TO_TOP = ../../reactos
-
-TARGET_TYPE = program
-
-TARGET_APPTYPE = console
-
-TARGET_NAME = regedit
-
-#TARGET_CFLAGS = -I$(TEST_ROOT) -DDBG -DUNICODE -D_UNICODE
-#TARGET_CFLAGS = -D_WIN32_IE=0x0400
-#TARGET_RCFLAGS = -D_WIN32_IE=0x0400
-
-WINE_MODE = yes
-
-WINE_RC = $(TARGET_NAME)
-
-WINE_INCLUDE = ./
-
-TARGET_SDKLIBS = \
-       kernel32.a \
-       user32.a \
-       gdi32.a
-
-TARGET_GCCLIBS = comctl32 comdlg32
-
-TARGET_OBJECTS = \
-       about.o \
-        childwnd.o \
-        framewnd.o \
-        hex_str.o \
-        listview.o \
-        main.o \
-       regcmds.o \
-       regproc.o \
-        treeview.o \
-        trace.o
-
-include $(PATH_TO_TOP)/rules.mak
-
-include $(TOOLS_PATH)/helper.mk
-
-# EOF
diff --git a/rosapps/regedit/childwnd.h b/rosapps/regedit/childwnd.h
deleted file mode 100644 (file)
index eb91603..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *  ReactOS regedit
- *
- *  childwnd.h
- *
- *  Copyright (C) 2002  Robert Dickenson <robd@reactos.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef __CHILDWND_H__
-#define __CHILDWND_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-LRESULT CALLBACK ChildWndProc(HWND, UINT, WPARAM, LPARAM);
-    
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif // __CHILDWND_H__
diff --git a/rosapps/regedit/dbg.h b/rosapps/regedit/dbg.h
deleted file mode 100644 (file)
index b531bb7..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef __DBG_H__
-#define __DBG_H__
-
-/*
-void Assert(void* assert, const char* file, int line, void* msg);
-#define ASSERT Assert(void* assert, const char* file, int line, void* msg)
-#define D(_x_) \
-        printf("(%hS:%d)(%hS) ", __FILE__, __LINE__, __FUNCTION__); \
-           printf _x_;
- */
-
-#ifdef ASSERT
-#undef ASSERT
-#endif
-
-#ifdef NASSERT
-#define ASSERT(x)
-#else /* NASSERT */
-//#define ASSERT(x) if (!(x)) { printf("Assertion "#x" failed at %s:%d\n", __FILE__, __LINE__); assert(0); }
-#define ASSERT(x) if (!(x)) { printf("Assertion "#x" failed at %s:%d\n", __FILE__, __LINE__); }
-#endif /* NASSERT */
-
-
-#ifdef __GNUC__
-
-#else
-
-//#define __FUNCTION__ "unknown"
-
-#endif /*__GNUC__*/
-
-
-#endif /*__DBG_H__*/
diff --git a/rosapps/regedit/debug.c b/rosapps/regedit/debug.c
deleted file mode 100644 (file)
index f449900..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *  ReactOS Application Debug Routines
- *
- *  debug.c
- *
- *  Copyright (C) 2002  Robert Dickenson <robd@reactos.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifdef _MSC_VER
-#include "stdafx.h"
-#else
-#define WIN32_LEAN_AND_MEAN     // Exclude rarely-used stuff from Windows headers
-#include <windows.h>
-#include <commctrl.h>
-#include <stdlib.h>
-#include <tchar.h>
-#include <process.h>
-#include <stdio.h>
-#endif
-    
-#include "main.h"
-#include "debug.h"
-
diff --git a/rosapps/regedit/framewnd.h b/rosapps/regedit/framewnd.h
deleted file mode 100644 (file)
index 988ab97..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *  ReactOS regedit
- *
- *  framewnd.h
- *
- *  Copyright (C) 2002  Robert Dickenson <robd@reactos.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef __FRAMEWND_H__
-#define __FRAMEWND_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-LRESULT CALLBACK FrameWndProc(HWND, UINT, WPARAM, LPARAM);
-
-void SetupStatusBar(HWND hWnd, BOOL bResize);
-void UpdateStatusBar(void);
-
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif // __FRAMEWND_H__
diff --git a/rosapps/regedit/hex_str.c b/rosapps/regedit/hex_str.c
deleted file mode 100644 (file)
index d617e6d..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// HEX_STR.C
-//  Copyright (c) 1995 by Robert Dickenson
-//
-#include "hex_str.h"
-
-
-#define LOBYTE(w)   ((unsigned char)(w))
-#define HIBYTE(w)   ((unsigned char)((unsigned short)(w) >> 8))
-
-
-unsigned char AsciiTable[256][3] = {
- "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0A", "0B", "0C", "0D", "0E", "0F",
- "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1A", "1B", "1C", "1D", "1E", "1F",
- "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2A", "2B", "2C", "2D", "2E", "2F",
- "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3A", "3B", "3C", "3D", "3E", "3F",
- "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4A", "4B", "4C", "4D", "4E", "4F",
- "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5A", "5B", "5C", "5D", "5E", "5F",
- "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6A", "6B", "6C", "6D", "6E", "6F",
- "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7A", "7B", "7C", "7D", "7E", "7F",
- "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8A", "8B", "8C", "8D", "8E", "8F",
- "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9A", "9B", "9C", "9D", "9E", "9F",
- "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "AA", "AB", "AC", "AD", "AE", "AF",
- "B0", "B1", "B2", "B3", "B4", "B5", "B6", "B7", "B8", "B9", "BA", "BB", "BC", "BD", "BE", "BF",
- "C0", "C1", "C2", "C3", "C4", "C5", "C6", "C7", "C8", "C9", "CA", "CB", "CC", "CD", "CE", "CF",
- "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7", "D8", "D9", "DA", "DB", "DC", "DD", "DE", "DF",
- "E0", "E1", "E2", "E3", "E4", "E5", "E6", "E7", "E8", "E9", "EA", "EB", "EC", "ED", "EE", "EF",
- "F0", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "FA", "FB", "FC", "FD", "FE", "FF"
-};
-
-unsigned char HexTable[24] = {
-0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0, 10, 11, 12, 13, 14, 15, 16
-};
-
-unsigned long BinaryNibbles[] = {
-  (unsigned long)"0000",
-  (unsigned long)"0001",
-  (unsigned long)"0010",
-  (unsigned long)"0011",
-  (unsigned long)"0100",
-  (unsigned long)"0101",
-  (unsigned long)"0110",
-  (unsigned long)"0111",
-  (unsigned long)"1000",
-  (unsigned long)"1001",
-  (unsigned long)"1010",
-  (unsigned long)"1011",
-  (unsigned long)"1100",
-  (unsigned long)"1101",
-  (unsigned long)"1110",
-  (unsigned long)"1111"
-};
-
-
-void ByteBinStr(char* dst, unsigned char num)
-{
-  *(unsigned long*)dst++ = BinaryNibbles[(num >> 4) & 0x07];
-  *(unsigned long*)dst++ = BinaryNibbles[num & 0x07];
-}
-
-void WordBinStr(char* dst, unsigned short num)
-{
-  ByteBinStr(dst, HIBYTE(num));
-  ByteBinStr(dst+4, LOBYTE(num));
-}
-
-unsigned short Byte2Hex(unsigned char data)
-{
-  register unsigned short result;
-
-  result  = AsciiTable[data][1] << 8;
-  result += AsciiTable[data][0];
-  return result;
-}
-
-unsigned long Word2Hex(unsigned short data)
-{
-  register unsigned long result;
-
-  result  = (unsigned long)Byte2Hex(LOBYTE(data)) << 16;
-  result += Byte2Hex(HIBYTE(data));
-  return result;
-}
-
-unsigned char HexByte(char* str)
-{
-  register unsigned char result;
-
-  result  = HexTable[*str++ - '0'] * 16;
-  result += HexTable[*str++ - '0'];
-  return result;
-}
-
-unsigned int HexWord(char* str)
-{
-  register unsigned int result;
-
-  result  = HexByte(str) << 8;
-  result += HexByte(str+2);
-  return result;
-}
-
-unsigned long HexLong(char* str)
-{
-  register unsigned long result;
-
-  result  = HexByte(str++) << 24;
-  result += HexByte(str++) << 16;
-  result += HexByte(str++) << 8;
-  result += HexByte(str);
-  return result;
-}
-
-unsigned long HexString(char* str)
-{
-  unsigned long temp = 0;
-
-  while ( *str )
-  {
-    temp <<= 4;
-    switch ( *str++ )
-    {
-      case '0':  break;
-      case '1':  temp += 1;   break;
-      case '2':  temp += 2;   break;
-      case '3':  temp += 3;   break;
-      case '4':  temp += 4;   break;
-      case '5':  temp += 5;   break;
-      case '6':  temp += 6;   break;
-      case '7':  temp += 7;   break;
-      case '8':  temp += 8;   break;
-      case '9':  temp += 9;   break;
-      case 'A':  temp += 10;  break;
-      case 'B':  temp += 11;  break;
-      case 'C':  temp += 12;  break;
-      case 'D':  temp += 13;  break;
-      case 'E':  temp += 14;  break;
-      case 'F':  temp += 15;  break;
-      case 'a':  temp += 10;  break;
-      case 'b':  temp += 11;  break;
-      case 'c':  temp += 12;  break;
-      case 'd':  temp += 13;  break;
-      case 'e':  temp += 14;  break;
-      case 'f':  temp += 15;  break;
-      case 'X':  temp = 0;  break;
-      case 'x':  temp = 0;  break;
-      default:   return temp;
-    }
-  }
-  return temp;
-}
-
-///////////////////////////////////////////////////////////////////////////////
diff --git a/rosapps/regedit/hex_str.h b/rosapps/regedit/hex_str.h
deleted file mode 100644 (file)
index b98c710..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// HEX_STR.H
-//  Copyright (c) 1995 by Robert Dickenson
-//
-#ifndef __HEX_STR_H__
-#define __HEX_STR_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-unsigned short Byte2Hex(unsigned char);
-unsigned long Word2Hex(unsigned short);
-unsigned char HexByte(char*);
-unsigned int HexWord(char*);
-unsigned long HexLong(char*);
-unsigned long HexString(char*);
-
-void ByteBinStr(char*, unsigned char);
-void WordBinStr(char*, unsigned short);
-unsigned long HexString(char*);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // __HEX_STR_H__
-///////////////////////////////////////////////////////////////////////////////
diff --git a/rosapps/regedit/listview.h b/rosapps/regedit/listview.h
deleted file mode 100644 (file)
index 565960c..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *  ReactOS regedit
- *
- *  listview.h
- *
- *  Copyright (C) 2002  Robert Dickenson <robd@reactos.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef __LISTVIEW_H__
-#define __LISTVIEW_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-HWND CreateListView(HWND hwndParent, int id);
-BOOL RefreshListView(HWND hwndTV, HKEY hKey, LPTSTR keyPath);
-
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif // __LISTVIEW_H__
diff --git a/rosapps/regedit/main.h b/rosapps/regedit/main.h
deleted file mode 100644 (file)
index 157b152..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- *  ReactOS regedit
- *
- *  main.h
- *
- *  Copyright (C) 2002  Robert Dickenson <robd@reactos.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef __MAIN_H__
-#define __MAIN_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#include "resource.h"
-
-
-#define STATUS_WINDOW   2001
-#define TREE_WINDOW     2002
-#define LIST_WINDOW     2003
-
-#define MAX_LOADSTRING  100
-#define        SPLIT_WIDTH             5
-#define MAX_NAME_LEN    500
-
-
-////////////////////////////////////////////////////////////////////////////////
-
-enum OPTION_FLAGS {
-    OPTIONS_AUTO_REFRESH               = 0x01,
-    OPTIONS_READ_ONLY_MODE             = 0x02,
-    OPTIONS_CONFIRM_ON_DELETE          = 0x04,
-    OPTIONS_SAVE_ON_EXIT                  = 0x08,
-    OPTIONS_DISPLAY_BINARY_DATA           = 0x10,
-    OPTIONS_VIEW_TREE_ONLY                = 0x20,
-    OPTIONS_VIEW_DATA_ONLY                = 0x40,
-};
-
-typedef struct {
-       HWND    hWnd;
-    HWND    hTreeWnd;
-    HWND    hListWnd;
-    int     nFocusPanel;      // 0: left  1: right
-       int             nSplitPos;
-       WINDOWPLACEMENT pos;
-       TCHAR   szPath[MAX_PATH];
-} ChildWnd;
-
-////////////////////////////////////////////////////////////////////////////////
-// Global Variables:
-//
-extern HINSTANCE hInst;
-extern HWND      hFrameWnd;
-extern HMENU     hMenuFrame;
-extern HWND      hStatusBar;
-extern HFONT     hFont;
-extern enum OPTION_FLAGS Options;
-
-extern TCHAR szTitle[];
-extern TCHAR szFrameClass[];
-extern TCHAR szChildClass[];
-
-#if __MINGW32_MAJOR_VERSION < 1
-typedef struct tagNMITEMACTIVATE{
-    NMHDR   hdr;
-    int     iItem;
-    int     iSubItem;
-    UINT    uNewState;
-    UINT    uOldState;
-    UINT    uChanged;
-    POINT   ptAction;
-    LPARAM  lParam;
-    UINT    uKeyFlags;
-} NMITEMACTIVATE, FAR *LPNMITEMACTIVATE;
-#endif
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif // __MAIN_H__
diff --git a/rosapps/regedit/regedit.rc b/rosapps/regedit/regedit.rc
deleted file mode 100644 (file)
index 8f20c33..0000000
+++ /dev/null
@@ -1,380 +0,0 @@
-//Microsoft Developer Studio generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#define APSTUDIO_HIDDEN_SYMBOLS
-#include "windows.h"
-#undef APSTUDIO_HIDDEN_SYMBOLS
-#include "resource.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDI_REGEDIT             ICON    DISCARDABLE     "res/regedit.ico"
-IDI_SMALL               ICON    DISCARDABLE     "res/small.ico"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Bitmap
-//
-
-IDB_OPEN_FILE           BITMAP  DISCARDABLE     "res/folder3.bmp"
-IDB_CLOSED_FILE         BITMAP  DISCARDABLE     "res/folder1.bmp"
-IDB_ROOT                BITMAP  DISCARDABLE     "res/folder2.bmp"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Menu
-//
-
-IDC_REGEDIT MENU DISCARDABLE 
-BEGIN
-    POPUP "&File"
-    BEGIN
-        MENUITEM "E&xit",                       ID_REGISTRY_EXIT
-    END
-    POPUP "&Help"
-    BEGIN
-        MENUITEM "&About ...",                  ID_HELP_ABOUT
-    END
-END
-
-IDR_REGEDIT_MENU MENU DISCARDABLE 
-BEGIN
-    POPUP "&Registry"
-    BEGIN
-        MENUITEM "&Import Registry File...",    ID_REGISTRY_IMPORTREGISTRYFILE
-
-        MENUITEM "&Export Registry File...",    ID_REGISTRY_EXPORTREGISTRYFILE
-
-        MENUITEM SEPARATOR
-        MENUITEM "&Connect Network Registry...", 
-                                                ID_REGISTRY_CONNECTNETWORKREGISTRY
-        , GRAYED
-        MENUITEM "&Disconnect Network Registry...", 
-                                                ID_REGISTRY_DISCONNECTNETWORKREGISTRY
-        , GRAYED
-        MENUITEM SEPARATOR
-        MENUITEM "&Print\tCtrl+P",              ID_REGISTRY_PRINT, GRAYED
-        MENUITEM SEPARATOR
-        MENUITEM "E&xit",                       ID_REGISTRY_EXIT
-    END
-    POPUP "&Edit"
-    BEGIN
-        MENUITEM "&Modify",                     ID_EDIT_MODIFY
-        MENUITEM SEPARATOR
-        POPUP "&New"
-        BEGIN
-            MENUITEM "&Key",                        ID_EDIT_NEW_KEY
-            MENUITEM SEPARATOR
-            MENUITEM "&String Value",               ID_EDIT_NEW_STRINGVALUE
-            MENUITEM "&Binary Value",               ID_EDIT_NEW_BINARYVALUE
-            MENUITEM "&DWORD Value",                ID_EDIT_NEW_DWORDVALUE
-        END
-        MENUITEM SEPARATOR
-        MENUITEM "&Delete\tDel",                ID_EDIT_DELETE
-        MENUITEM "&Rename",                     ID_EDIT_RENAME
-        MENUITEM SEPARATOR
-        MENUITEM "&Copy Key Name",              ID_EDIT_COPYKEYNAME
-        MENUITEM SEPARATOR
-        MENUITEM "&Find\tCtrl+F",               ID_EDIT_FIND, GRAYED
-        MENUITEM "Find Ne&xt\tF3",              ID_EDIT_FINDNEXT, GRAYED
-    END
-    POPUP "&View"
-    BEGIN
-        MENUITEM "Status &Bar",                 ID_VIEW_STATUSBAR
-        MENUITEM SEPARATOR
-        MENUITEM "Sp&lit",                      ID_VIEW_SPLIT
-        MENUITEM SEPARATOR
-        MENUITEM "&Refresh\tF5",                ID_VIEW_REFRESH
-    END
-    POPUP "&Favourites"
-    BEGIN
-        MENUITEM "&Add to Favourites",          ID_FAVOURITES_ADDTOFAVOURITES
-        , GRAYED
-        MENUITEM "&Remove Favourite",           ID_FAVOURITES_REMOVEFAVOURITE
-        , GRAYED
-    END
-    POPUP "&Help"
-    BEGIN
-        MENUITEM "&Help Topics",                ID_HELP_HELPTOPICS
-        MENUITEM SEPARATOR
-        MENUITEM "&About Registry Editor",      ID_HELP_ABOUT
-    END
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_ABOUTBOX DIALOG DISCARDABLE  22, 17, 230, 75
-STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
-CAPTION "About"
-FONT 8, "System"
-BEGIN
-    ICON            IDI_REGEDIT,IDI_REGEDIT,14,9,16,16
-    LTEXT           "ReactOS regedit Version 1.0",IDC_STATIC,49,10,119,8,
-                    SS_NOPREFIX
-    LTEXT           "Copyright (C) 2002 ReactOS Team",IDC_STATIC,49,20,119,8
-    DEFPUSHBUTTON   "OK",IDOK,195,6,30,11,WS_GROUP
-END
-
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-2 TEXTINCLUDE DISCARDABLE 
-BEGIN
-    "#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
-    "#include ""windows.h""\r\n"
-    "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
-    "#include ""resource.h""\r\n"
-    "\0"
-END
-
-3 TEXTINCLUDE DISCARDABLE 
-BEGIN
-    "\r\n"
-    "\0"
-END
-
-#endif    // APSTUDIO_INVOKED
-
-
-#ifndef _MAC
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-(1) VERSIONINFO
- FILEVERSION 0,0,21,3
- PRODUCTVERSION 0,0,21,0
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x40004L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
-BEGIN
-    BLOCK "StringFileInfo"
-    BEGIN
-        BLOCK "040904b0"
-        BEGIN
-            VALUE "Comments", "Absolutely no warranties whatsoever - Use at your own risk\0"
-            VALUE "CompanyName", "ReactOS Development Team\0"
-            VALUE "FileDescription", "ReactOS Registry Editor by Robert Dickenson\0"
-            VALUE "FileVersion", "1, 0, 0, 1\0"
-            VALUE "InternalName", "regedit\0"
-            VALUE "LegalCopyright", "Copyright © 2002 Robert Dickenson\0"
-            VALUE "LegalTrademarks", "\0"
-            VALUE "OriginalFilename", "regedit.exe\0"
-            VALUE "PrivateBuild", "\0"
-            VALUE "ProductName", "ReactOS Operating System\0"
-            VALUE "ProductVersion", "0.0.21\0"
-            VALUE "SpecialBuild", "Non-versioned Development Beta Release\0"
-        END
-    END
-    BLOCK "VarFileInfo"
-    BEGIN
-        VALUE "Translation", 0xc09, 1200
-    END
-END
-
-#endif    // !_MAC
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    IDS_LIST_COLUMN_NAME    "Name"
-    IDS_LIST_COLUMN_TYPE    "Type"
-    IDS_LIST_COLUMN_DATA    "Data"
-END
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    IDS_APP_TITLE           "ReactOS Registry Editor"
-    IDC_REGEDIT             "REGEDIT"
-    IDC_REGEDIT_FRAME       "REGEDIT_FRAME"
-END
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    ID_REGISTRY_MENU        "Contains commands for working with the whole registry"
-    ID_EDIT_MENU            "Contains commands for editing values or keys"
-    ID_VIEW_MENU            "Contains commands for customising the registry window"
-    ID_FAVOURITES_MENU      "Contains commands for accessing frequently used keys"
-    ID_HELP_MENU            "Contains commands for displaying help and information about registry editor"
-    ID_EDIT_NEW_MENU        "Contains commands for creating new keys or values"
-END
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    ID_EDIT_MODIFY          "Modifies the value's data"
-    ID_EDIT_NEW_KEY         "Adds a new key"
-    ID_EDIT_NEW_STRINGVALUE "Adds a new string value"
-    ID_EDIT_NEW_BINARYVALUE "Adds a new binary value"
-    ID_EDIT_NEW_DWORDVALUE  "Adds a new double word value"
-    ID_REGISTRY_IMPORTREGISTRYFILE "Imports a text file into the registry"
-    ID_REGISTRY_EXPORTREGISTRYFILE 
-                            "Exports all or part of the registry to a text file"
-    ID_REGISTRY_CONNECTNETWORKREGISTRY 
-                            "Connects to a remote computer's registry"
-    ID_REGISTRY_DISCONNECTNETWORKREGISTRY 
-                            "Disconnects from a remote computer's registry"
-    ID_REGISTRY_PRINT       "Prints all or part of the registry"
-    ID_HELP_HELPTOPICS      "Opens registry editor help"
-    ID_HELP_ABOUT           "Displays program information, version number and copyright"
-END
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    ID_REGISTRY_EXIT        "Quits the registry editor"
-    ID_FAVOURITES_ADDTOFAVOURITES "Adds keys to the favourites list"
-    ID_FAVOURITES_REMOVEFAVOURITE "Removes keys from the favourites list"
-    ID_VIEW_STATUSBAR       "Shows or hides the status bar"
-    ID_VIEW_SPLIT           "Change position of split between two panes"
-    ID_VIEW_REFRESH         "Refreshes the window"
-    ID_EDIT_DELETE          "Deletes the selection"
-    ID_EDIT_RENAME          "Renames the selection"
-    ID_EDIT_COPYKEYNAME     "Copies the name of the selected key to the clipboard"
-    ID_EDIT_FIND            "Finds a text string in a key, value or data"
-    ID_EDIT_FINDNEXT        "Finds next occurrence of text specified in previous search"
-END
-
-#endif    // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-/////////////////////////////////////////////////////////////////////////////
-// English (Australia) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENA)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_AUS
-#pragma code_page(1252)
-#endif //_WIN32
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_DIALOG1 DIALOG DISCARDABLE  50, 50, 268, 98
-STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | 
-    WS_BORDER
-FONT 8, "MS Sans Serif"
-BEGIN
-END
-
-IDD_DIALOG2 DIALOG DISCARDABLE  0, 0, 187, 95
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Dialog"
-FONT 8, "MS Sans Serif"
-BEGIN
-    DEFPUSHBUTTON   "OK",IDOK,130,7,50,14
-    PUSHBUTTON      "Cancel",IDCANCEL,130,24,50,14
-END
-
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE DISCARDABLE 
-BEGIN
-    "resource.h\0"
-END
-
-#endif    // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO DISCARDABLE 
-BEGIN
-    IDD_DIALOG1, DIALOG
-    BEGIN
-        LEFTMARGIN, 7
-        RIGHTMARGIN, 261
-        TOPMARGIN, 7
-        BOTTOMMARGIN, 91
-    END
-
-    IDD_DIALOG2, DIALOG
-    BEGIN
-        LEFTMARGIN, 7
-        RIGHTMARGIN, 180
-        TOPMARGIN, 7
-        BOTTOMMARGIN, 88
-    END
-END
-#endif    // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    ID_HELP_HELPTOPICS      "Opens Registry Editor Help."
-    ID_HELP_ABOUT           "Displays program information, version number, and copyright."
-END
-
-#endif    // English (Australia) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif    // not APSTUDIO_INVOKED
-
diff --git a/rosapps/regedit/regproc.h b/rosapps/regedit/regproc.h
deleted file mode 100644 (file)
index 70215a1..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright 1999 Sylvain St-Germain
- * Copyright 2002 Andriy Palamarchuk
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-/******************************************************************************
- * Defines and consts
- */
-#define KEY_MAX_LEN             1024
-
-/* Return values */
-#define SUCCESS               0
-#define KEY_VALUE_ALREADY_SET 2
-
-typedef void (*CommandAPI)(LPTSTR lpsLine);
-
-void doSetValue(LPTSTR lpsLine);
-void doDeleteValue(LPTSTR lpsLine);
-void doCreateKey(LPTSTR lpsLine);
-void doDeleteKey(LPTSTR lpsLine);
-void doQueryValue(LPTSTR lpsLine);
-void doRegisterDLL(LPTSTR lpsLine);
-void doUnregisterDLL(LPTSTR lpsLine);
-
-BOOL export_registry_key(TCHAR* file_name, TCHAR* reg_key_name);
-BOOL import_registry_file(LPTSTR filename);
-void delete_registry_key(TCHAR* reg_key_name);
-
-void processRegLines(FILE* in, CommandAPI command);
-
-/*
- * Generic prototypes
- */
-#ifdef _UNICODE
-#define get_file_name get_file_nameW
-#else
-#define get_file_name get_file_nameA
-#endif
-
-char*   getToken(char** str, const char* delims);
-void    get_file_nameA(CHAR** command_line, CHAR* filename, int max_filename);
-void    get_file_nameW(CHAR** command_line, WCHAR* filename, int max_filename);
-DWORD   convertHexToDWord(TCHAR* str, BYTE* buf);
-DWORD   convertHexCSVToHex(TCHAR* str, BYTE* buf, ULONG bufLen);
-LPTSTR  convertHexToHexCSV(BYTE* buf, ULONG len);
-LPTSTR  convertHexToDWORDStr(BYTE* buf, ULONG len);
-LPTSTR  getRegKeyName(LPTSTR lpLine);
-HKEY    getRegClass(LPTSTR lpLine);
-DWORD   getDataType(LPTSTR* lpValue, DWORD* parse_type);
-LPTSTR  getArg(LPTSTR arg);
-HRESULT openKey(LPTSTR stdInput);
-void    closeKey(VOID);
-
-/*
- * api setValue prototypes
- */
-void    processSetValue(LPTSTR cmdline);
-HRESULT setValue(LPTSTR val_name, LPTSTR val_data);
-
-/*
- * api queryValue prototypes
- */
-void    processQueryValue(LPTSTR cmdline);
-
-#ifdef __GNUC__
-#ifdef WIN32_REGDBG
-//typedef UINT_PTR SIZE_T, *PSIZE_T;
-//#define _MAX_PATH   260 /* max. length of full pathname */
-#endif /*WIN32_REGDBG*/
-
-#ifdef UNICODE
-#define _tfopen     _wfopen
-#else
-#define _tfopen     fopen
-#endif
-
-#endif /*__GNUC__*/
-
-LPVOID RegHeapAlloc(
-  HANDLE hHeap,   // handle to private heap block
-  DWORD dwFlags,  // heap allocation control
-  SIZE_T dwBytes  // number of bytes to allocate
-);
-
-LPVOID RegHeapReAlloc(
-  HANDLE hHeap,   // handle to heap block
-  DWORD dwFlags,  // heap reallocation options
-  LPVOID lpMem,   // pointer to memory to reallocate
-  SIZE_T dwBytes  // number of bytes to reallocate
-);
-
-BOOL RegHeapFree(
-  HANDLE hHeap,  // handle to heap
-  DWORD dwFlags, // heap free options
-  LPVOID lpMem   // pointer to memory
-);
diff --git a/rosapps/regedit/trace.c b/rosapps/regedit/trace.c
deleted file mode 100644 (file)
index d225a22..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// Diagnostic Trace
-//
-#include <stdio.h> 
-#include <stdarg.h>
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <tchar.h>
-#include "trace.h"
-
-
-#ifdef _DEBUG
-
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-
-void _DebugBreak(void)
-{
-    DebugBreak();
-}
-
-void Trace(TCHAR* lpszFormat, ...)
-{
-    va_list args;
-    int nBuf;
-    TCHAR szBuffer[512];
-
-    va_start(args, lpszFormat);
-    nBuf = _vsntprintf(szBuffer, sizeof(szBuffer)/sizeof(TCHAR), lpszFormat, args);
-    OutputDebugString(szBuffer);
-    // was there an error? was the expanded string too long?
-    //ASSERT(nBuf >= 0);
-    va_end(args);
-}
-
-void Assert(void* assert, TCHAR* file, int line, void* msg)
-{
-    if (msg == NULL) {
-        printf("ASSERT -- %s occured on line %u of file %s.\n",
-               assert, line, file);
-    } else {
-        printf("ASSERT -- %s occured on line %u of file %s: Message = %s.\n",
-               assert, line, file, msg);
-    }
-}
-
-#else
-
-void Trace(TCHAR* lpszFormat, ...) { };
-void Assert(void* assert, TCHAR* file, int line, void* msg) { };
-
-#endif //_DEBUG
-/////////////////////////////////////////////////////////////////////////////
diff --git a/rosapps/regedit/trace.h b/rosapps/regedit/trace.h
deleted file mode 100644 (file)
index 7f3318e..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// Diagnostic Trace
-//
-#ifndef __TRACE_H__
-#define __TRACE_H__
-
-#ifdef _DEBUG
-
-#ifdef _X86_
-#define BreakPoint()        _asm { int 3h }
-#else
-#define BreakPoint()        _DebugBreak()
-#endif
-
-#ifndef ASSERT
-#define ASSERT(exp)                                 \
-{                                                   \
-    if (!(exp)) {                                   \
-        Assert(#exp, __FILE__, __LINE__, NULL);     \
-        BreakPoint();                               \
-    }                                               \
-}                                                   \
-
-#define ASSERTMSG(exp, msg)                         \
-{                                                   \
-    if (!(exp)) {                                   \
-        Assert(#exp, __FILE__, __LINE__, msg);      \
-        BreakPoint();                               \
-    }                                               \
-}
-#endif
-
-//=============================================================================
-//  MACRO: TRACE()
-//=============================================================================
-
-#define TRACE  Trace
-
-
-#else   // _DEBUG
-
-//=============================================================================
-//  Define away MACRO's ASSERT() and TRACE() in non debug builds
-//=============================================================================
-
-#ifndef ASSERT
-#define ASSERT(exp)
-#define ASSERTMSG(exp, msg)
-#endif
-
-#define TRACE 0 ? (void)0 : Trace
-
-#endif // !_DEBUG
-
-
-void Assert(void* assert, TCHAR* file, int line, void* msg);
-void Trace(TCHAR* lpszFormat, ...);
-
-
-#endif // __TRACE_H__
-/////////////////////////////////////////////////////////////////////////////
diff --git a/rosapps/regedit/treeview.h b/rosapps/regedit/treeview.h
deleted file mode 100644 (file)
index 9f971e0..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *  ReactOS regedit
- *
- *  treeview.h
- *
- *  Copyright (C) 2002  Robert Dickenson <robd@reactos.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef __TREEVIEW_H__
-#define __TREEVIEW_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-HWND CreateTreeView(HWND hwndParent, LPTSTR pHostName, int id);
-BOOL OnTreeExpanding(HWND hWnd, NMTREEVIEW* pnmtv);
-HKEY FindRegRoot(HWND hwndTV, HTREEITEM hItem, LPTSTR keyPath, int* pPathLen, int max);
-
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif // __TREEVIEW_H__