build regedit as unicode by default
Modified: trunk/reactos/subsys/system/regedit/framewnd.c
Modified: trunk/reactos/subsys/system/regedit/regedit.xml
Modified: trunk/reactos/subsys/system/regedit/regproc.c
Modified: trunk/reactos/subsys/system/regedit/treeview.c

Modified: trunk/reactos/subsys/system/regedit/framewnd.c
--- trunk/reactos/subsys/system/regedit/framewnd.c	2005-10-03 12:57:48 UTC (rev 18245)
+++ trunk/reactos/subsys/system/regedit/framewnd.c	2005-10-03 13:44:18 UTC (rev 18246)
@@ -263,7 +263,7 @@
     /*    ofn.lCustData = ;*/
     if (GetOpenFileName(&ofn)) {
         /* FIXME - convert to ascii */
-	if (!import_registry_file((LPSTR)ofn.lpstrFile)) {
+	if (!import_registry_file(ofn.lpstrFile)) {
             /*printf("Can't open file \"%s\"\n", ofn.lpstrFile);*/
             return FALSE;
         }
@@ -617,7 +617,7 @@
 static HRESULT
 InvokeRemoteRegistryPickerDialog(IN IDsObjectPicker *pDsObjectPicker,
                                  IN HWND hwndParent  OPTIONAL,
-                                 OUT LPWSTR lpBuffer,
+                                 OUT LPTSTR lpBuffer,
                                  IN UINT uSize)
 {
     IDataObject *pdo = NULL;
@@ -652,10 +652,20 @@
                     {
                         nlen = uSize - 1;
                     }
-
+#if UNICODE
                     memcpy(lpBuffer,
                            SelectionList->aDsSelection[0].pwzName,
                            nlen * sizeof(WCHAR));
+#else
+                    WideCharToMultiByte(CP_ACP,
+                                        0,
+                                        SelectionList->aDsSelection[0].pwzName,
+                                        nlen,
+                                        lpBuffer,
+                                        uSize,
+                                        NULL,
+                                        NULL);
+#endif
                     lpBuffer[nlen] = L'\0';
                 }
 
@@ -704,7 +714,7 @@
     case ID_REGISTRY_CONNECTNETWORKREGISTRY:
     {
         IDsObjectPicker *ObjectPicker;
-        WCHAR szComputerName[MAX_COMPUTERNAME_LENGTH + 1];
+        TCHAR szComputerName[MAX_COMPUTERNAME_LENGTH + 1];
         HRESULT hRet;
         
         hRet = CoInitialize(NULL);

Modified: trunk/reactos/subsys/system/regedit/regedit.xml
--- trunk/reactos/subsys/system/regedit/regedit.xml	2005-10-03 12:57:48 UTC (rev 18245)
+++ trunk/reactos/subsys/system/regedit/regedit.xml	2005-10-03 13:44:18 UTC (rev 18246)
@@ -1,8 +1,10 @@
 <module name="regedit" type="win32gui" installname="regedit.exe">
 	<include base="regedit">.</include>
 	<define name="__USE_W32API" />
+	<define name="UNICODE" />
+	<define name="_UNICODE" />
 	<define name="_WIN32_IE">0x0501</define>
-	<define name="_WIN32_WINNT">0x0501</define>
+	<define name="_WIN32_WINNT">0x0600</define>
 	<library>uuid</library>
 	<library>kernel32</library>
 	<library>user32</library>

Modified: trunk/reactos/subsys/system/regedit/regproc.c
--- trunk/reactos/subsys/system/regedit/regproc.c	2005-10-03 12:57:48 UTC (rev 18245)
+++ trunk/reactos/subsys/system/regedit/regproc.c	2005-10-03 13:44:18 UTC (rev 18246)
@@ -427,7 +427,7 @@
         }
     }
 
-    hRes = RegSetValueEx(
+    hRes = RegSetValueExA(
                currentKeyHandle,
                val_name,
                0,                  /* Reserved */
@@ -987,7 +987,7 @@
         return;
 
     /* Load and register the library, then free it */
-    theLib = LoadLibrary(stdInput);
+    theLib = LoadLibraryA(stdInput);
     if (theLib) {
         FARPROC lpfnDLLRegProc = GetProcAddress(theLib, "DllRegisterServer");
         if (lpfnDLLRegProc)
@@ -1020,7 +1020,7 @@
         return;
 
     /* Load and unregister the library, then free it */
-    theLib = LoadLibrary(stdInput);
+    theLib = LoadLibraryA(stdInput);
     if (theLib) {
         FARPROC lpfnDLLRegProc = GetProcAddress(theLib, "DllUnregisterServer");
         if (lpfnDLLRegProc)
@@ -1174,8 +1174,8 @@
         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);
+        ret = RegEnumValueA(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) {
@@ -1258,8 +1258,8 @@
     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);
+        ret = RegEnumKeyExA(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) {
@@ -1269,8 +1269,8 @@
             HKEY subkey;
 
             i++;
-            if (RegOpenKey(key, *reg_key_name_buf + curr_len + 1,
-                           &subkey) == ERROR_SUCCESS) {
+            if (RegOpenKeyA(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);
@@ -1348,7 +1348,7 @@
                         &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 (RegOpenKeyA(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,
@@ -1393,7 +1393,7 @@
  */
 BOOL import_registry_file(LPTSTR filename)
 {
-    FILE* reg_file = fopen(filename, "r");
+    FILE* reg_file = _tfopen(filename, _T("r"));
 
     if (reg_file) {
         processRegLines(reg_file, doSetValue);
@@ -1415,7 +1415,7 @@
     LONG ret;
     long int i;
 
-    if (RegOpenKey(key, *reg_key_name_buf, &branch_key) != ERROR_SUCCESS) {
+    if (RegOpenKeyA(key, *reg_key_name_buf, &branch_key) != ERROR_SUCCESS) {
         REGPROC_print_error();
     }
 
@@ -1434,8 +1434,8 @@
     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);
+        ret = RegEnumKeyExA(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) {
@@ -1446,7 +1446,7 @@
     }
     (*reg_key_name_buf)[curr_len] = '\0';
     RegCloseKey(branch_key);
-    RegDeleteKey(key, *reg_key_name_buf);
+    RegDeleteKeyA(key, *reg_key_name_buf);
 }
 
 /******************************************************************************
@@ -1480,7 +1480,7 @@
                 getAppName(), reg_key_name);
         exit(1);
     }
-    if (RegOpenKey(reg_key_class, branch_name, &branch_key) == ERROR_SUCCESS) {
+    if (RegOpenKeyA(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);

Modified: trunk/reactos/subsys/system/regedit/treeview.c
--- trunk/reactos/subsys/system/regedit/treeview.c	2005-10-03 12:57:48 UTC (rev 18245)
+++ trunk/reactos/subsys/system/regedit/treeview.c	2005-10-03 13:44:18 UTC (rev 18246)
@@ -136,7 +136,7 @@
     HTREEITEM childItem;
     LPCTSTR KeyPath;
     DWORD dwCount, dwIndex, dwMaxSubKeyLen;
-    LPSTR Name = NULL;
+    LPTSTR Name = NULL;
     TVITEM tvItem;
     LPTSTR pszNodes = NULL;
     BOOL bSuccess = FALSE;
@@ -235,7 +235,7 @@
         /* Check if the node is already in there. */
         if (pszNodes) {
             for (s = pszNodes; *s; s += _tcslen(s) + 1) {
-                if (!strcmp(s, Name)) {
+                if (!_tcscmp(s, Name)) {
                     found = TRUE;
                     break;
                 }
@@ -616,7 +616,7 @@
 		if (!TreeView_Expand(hwndTV, hChildItem, TVE_EXPAND))
 			return FALSE;
 
-		keyPath = s ? s + 1 : "";
+		keyPath = s ? s + 1 : _T("");
 		hItem = hChildItem;
 	}