Commit in reactos/subsys/system/regedit on MAIN
childwnd.c+2-21.6 -> 1.7
edit.c+19-201.7 -> 1.8
framewnd.c+6-41.5 -> 1.6
listview.c+3-31.10 -> 1.11
regproc.c+17-171.2 -> 1.3
regproc.h+1-11.2 -> 1.3
treeview.c+2-21.5 -> 1.6
+50-49
7 modified files
some fixes to be able to create a unicode build

reactos/subsys/system/regedit
childwnd.c 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- childwnd.c	3 Jan 2004 15:59:46 -0000	1.6
+++ childwnd.c	20 Jun 2004 02:22:44 -0000	1.7
@@ -276,9 +276,9 @@
 		    if (keyPath) {
 		        RefreshListView(pChildWnd->hListWnd, hRootKey, keyPath);
 			rootName = get_root_key_name(hRootKey);
-			fullPath = HeapAlloc(GetProcessHeap(), 0, (lstrlen(rootName) + 1 + lstrlen(keyPath) + 1) * sizeof(TCHAR));
+			fullPath = HeapAlloc(GetProcessHeap(), 0, (_tcslen(rootName) + 1 + _tcslen(keyPath) + 1) * sizeof(TCHAR));
 			if (fullPath) {
-			    _stprintf(fullPath, "%s\\%s", rootName, keyPath);
+			    _stprintf(fullPath, _T("%s\\%s"), rootName, keyPath);
 			    SendMessage(hStatusBar, SB_SETTEXT, 0, (LPARAM)fullPath);
 			    HeapFree(GetProcessHeap(), 0, fullPath);
 			}

reactos/subsys/system/regedit
edit.c 1.7 -> 1.8
diff -u -r1.7 -r1.8
--- edit.c	20 Jun 2004 01:07:26 -0000	1.7
+++ edit.c	20 Jun 2004 02:22:44 -0000	1.8
@@ -59,10 +59,10 @@
     hInstance = GetModuleHandle(0);
 
     if (!LoadString(hInstance, IDS_ERROR, title, COUNT_OF(title)))
-        lstrcpy(title, "Error");
+        _tcscpy(title, _T("Error"));
 
     if (!LoadString(hInstance, resId, errfmt, COUNT_OF(errfmt)))
-        lstrcpy(errfmt, "Unknown error string!");
+        _tcscpy(errfmt, _T("Unknown error string!"));
 
     va_start(ap, resId);
     _vsntprintf(errstr, COUNT_OF(errstr), errfmt, ap);
@@ -82,10 +82,10 @@
     hInstance = GetModuleHandle(0);
 
     if (!LoadString(hInstance, IDS_WARNING, title, COUNT_OF(title)))
-        lstrcpy(title, "Error");
+        _tcscpy(title, _T("Warning"));
 
     if (!LoadString(hInstance, resId, errfmt, COUNT_OF(errfmt)))
-        lstrcpy(errfmt, "Unknown error string!");
+        _tcscpy(errfmt, _T("Unknown error string!"));
 
     va_start(ap, resId);
     _vsntprintf(errstr, COUNT_OF(errstr), errfmt, ap);
@@ -102,7 +102,7 @@
 
     switch(uMsg) {
     case WM_INITDIALOG:
-        if(editValueName && strcmp(editValueName, _T("")))
+        if(editValueName && _tcscmp(editValueName, _T("")))
         {
           SetDlgItemText(hwndDlg, IDC_VALUE_NAME, editValueName);
         }
@@ -165,7 +165,7 @@
 
     switch(uMsg) {
     case WM_INITDIALOG:
-        if(editValueName && strcmp(editValueName, _T("")))
+        if(editValueName && _tcscmp(editValueName, _T("")))
         {
           SetDlgItemText(hwndDlg, IDC_VALUE_NAME, editValueName);
         }
@@ -282,7 +282,7 @@
         SetWindowLong(hwndValue, GWL_USERDATA, (LONG)oldproc);
         SetWindowLong(hwndValue, GWL_WNDPROC, (LONG)DwordEditSubclassProc);
 
-        if(editValueName && strcmp(editValueName, _T("")))
+        if(editValueName && _tcscmp(editValueName, _T("")))
         {
             SetDlgItemText(hwndDlg, IDC_VALUE_NAME, editValueName);
         }
@@ -291,7 +291,7 @@
             SetDlgItemText(hwndDlg, IDC_VALUE_NAME, _T("(Default)"));
         }
         CheckRadioButton (hwndDlg, IDC_FORMAT_HEX, IDC_FORMAT_DEC, IDC_FORMAT_HEX);
-        sprintf (ValueString, "%lx", dwordValueData);
+        _stprintf (ValueString, _T("%lx"), dwordValueData);
         SetDlgItemText(hwndDlg, IDC_VALUE_DATA, ValueString);
         SetFocus(GetDlgItem(hwndDlg, IDC_VALUE_DATA));
         return FALSE;
@@ -313,7 +313,7 @@
                         }
                         else
                         {
-                            Value = strtoul (ValueString, &Remainder, 10);
+                            Value = _tcstoul (ValueString, &Remainder, 10);
                         }
                     }
                     else
@@ -321,7 +321,7 @@
                         Value = 0;
                     }
                 }
-                sprintf (ValueString, "%lx", Value);
+                _stprintf (ValueString, _T("%lx"), Value);
                 SetDlgItemText(hwndDlg, IDC_VALUE_DATA, ValueString);
                 return TRUE;
             }
@@ -341,7 +341,7 @@
                         }
                         else
                         {
-                            Value = strtoul (ValueString, &Remainder, 16);
+                            Value = _tcstoul (ValueString, &Remainder, 16);
                         }
                     }
                     else
@@ -349,7 +349,7 @@
                         Value = 0;
                     }
                 }
-                sprintf (ValueString, "%lu", Value);
+                _stprintf (ValueString, _T("%lu"), Value);
                 SetDlgItemText(hwndDlg, IDC_VALUE_DATA, ValueString);
                 return TRUE;
             }
@@ -367,7 +367,7 @@
                     }
 
                     Base = (dwordEditMode == EDIT_MODE_HEX) ? 16 : 10;
-                    dwordValueData = strtoul (ValueString, &Remainder, Base);
+                    dwordValueData = _tcstoul (ValueString, &Remainder, Base);
                 }
                 else
                 {
@@ -422,7 +422,7 @@
                 error(hwnd, IDS_TOO_BIG_VALUE, valueDataLen);
                 goto done;
             }
-            lRet = RegQueryValueEx(hKey, valueName, 0, 0, stringValueData, &valueDataLen);
+            lRet = RegQueryValueEx(hKey, valueName, 0, 0, (LPBYTE)stringValueData, &valueDataLen);
             if (lRet != ERROR_SUCCESS)
             {
                 error(hwnd, IDS_BAD_VALUE, valueName);
@@ -438,7 +438,7 @@
         {
             if (stringValueData)
             {
-                lRet = RegSetValueEx(hKey, valueName, 0, type, stringValueData, lstrlen(stringValueData) + 1);
+                lRet = RegSetValueEx(hKey, valueName, 0, type, (LPBYTE)stringValueData, (_tcslen(stringValueData) + 1) * sizeof(TCHAR));
             }
             else
             {
@@ -452,7 +452,7 @@
     {
         if (valueDataLen > 0)
         {
-            DWORD NewLen, llen, listlen, nl_len;
+            DWORD llen, listlen, nl_len;
             LPTSTR src, lines = NULL;
             
 	    if (!(stringValueData = HeapAlloc(GetProcessHeap(), 0, valueDataLen)))
@@ -460,7 +460,7 @@
                 error(hwnd, IDS_TOO_BIG_VALUE, valueDataLen);
                 goto done;
             }
-            lRet = RegQueryValueEx(hKey, valueName, 0, 0, stringValueData, &valueDataLen);
+            lRet = RegQueryValueEx(hKey, valueName, 0, 0, (LPBYTE)stringValueData, &valueDataLen);
             if (lRet != ERROR_SUCCESS)
             {
                 error(hwnd, IDS_BAD_VALUE, valueName);
@@ -468,7 +468,6 @@
             }
             
 	    /* convert \0 to \r\n */
-            NewLen = valueDataLen;
             src = stringValueData;
             nl_len = _tcslen(_T("\r\n")) * sizeof(TCHAR);
             listlen = sizeof(TCHAR);
@@ -510,7 +509,7 @@
                 {
                     if((nl = _tcsstr(src, _T("\r\n"))))
                     {
-                        linechars = (nl - src) / sizeof(TCHAR);
+                        linechars = nl - src;
                         if(nl == src)
                         {
                             EmptyLines = TRUE;
@@ -543,7 +542,7 @@
                     warning(hwnd, IDS_MULTI_SZ_EMPTY_STRING);
                 }
                 
-		lRet = RegSetValueEx(hKey, valueName, 0, type, lines, buflen);
+		lRet = RegSetValueEx(hKey, valueName, 0, type, (LPBYTE)lines, buflen);
 		HeapFree(GetProcessHeap(), 0, lines);
             }
             else

reactos/subsys/system/regedit
framewnd.c 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- framewnd.c	1 Jan 2004 22:29:12 -0000	1.5
+++ framewnd.c	20 Jun 2004 02:22:44 -0000	1.6
@@ -245,7 +245,8 @@
     ofn.lpstrTitle = _T("Import Registry File");
     /*    ofn.lCustData = ;*/
     if (GetOpenFileName(&ofn)) {
-        if (!import_registry_file(ofn.lpstrFile)) {
+        /* FIXME - convert to ascii */
+	if (!import_registry_file((LPSTR)ofn.lpstrFile)) {
             /*printf("Can't open file \"%s\"\n", ofn.lpstrFile);*/
             return FALSE;
         }
@@ -287,8 +288,9 @@
     ofn.lpfnHook = ImportRegistryFile_OFNHookProc;
     ofn.lpTemplateName = MAKEINTRESOURCE(IDD_DIALOG1);
     if (GetSaveFileName(&ofn)) {
-        BOOL result;
-        result = export_registry_key(ofn.lpstrFile, ExportKeyPath);
+        BOOL result;   
+        /* FIXME - convert strings to ascii! */
+        result = export_registry_key((CHAR*)ofn.lpstrFile, (CHAR*)ExportKeyPath);
         /*result = export_registry_key(ofn.lpstrFile, NULL);*/
         /*if (!export_registry_key(ofn.lpstrFile, NULL)) {*/
         if (!result) {
@@ -307,7 +309,7 @@
         if (s[0]) {
             TCHAR reg_key_name[KEY_MAX_LEN];
             get_file_name(&s, reg_key_name, KEY_MAX_LEN);
-            export_registry_key(filename, reg_key_name);
+            export_registry_key((CHAR)filename, reg_key_name);
         } else {
             export_registry_key(filename, NULL);
         }

reactos/subsys/system/regedit
listview.c 1.10 -> 1.11
diff -u -r1.10 -r1.11
--- listview.c	20 Jun 2004 01:07:26 -0000	1.10
+++ listview.c	20 Jun 2004 02:22:44 -0000	1.11
@@ -106,7 +106,7 @@
   if(ListView_GetItem(hwndLV, &Item))
   {
     lineinfo = (PLINE_INFO)Item.lParam;
-    return lineinfo && (!lineinfo->name || !strcmp(lineinfo->name, _T("")));
+    return lineinfo && (!lineinfo->name || !_tcscmp(lineinfo->name, _T("")));
   }
   return FALSE;
 }
@@ -392,7 +392,7 @@
               if(Info)
               {
                 lineinfo = (PLINE_INFO)Info->item.lParam;
-                if(!lineinfo->name || !strcmp(lineinfo->name, _T("")))
+                if(!lineinfo->name || !_tcscmp(lineinfo->name, _T("")))
                 {
                   *Result = TRUE;
                 }
@@ -490,7 +490,7 @@
             dwValSize = max_val_size;
             dwValType = 0L;
             ++dwIndex;
-            if(!strcmp(ValName, _T("")))
+            if(!_tcscmp(ValName, _T("")))
             {
               AddedDefault = TRUE;
             }

reactos/subsys/system/regedit
regproc.c 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- regproc.c	1 Jan 2004 15:12:11 -0000	1.2
+++ regproc.c	20 Jun 2004 02:22:44 -0000	1.3
@@ -424,7 +424,7 @@
         }
     }
 
-    hRes = RegSetValueEx(
+    hRes = RegSetValueExA(
                currentKeyHandle,
                val_name,
                0,                  /* Reserved */
@@ -460,7 +460,7 @@
     if (currentKeyName == NULL)
         return ERROR_INVALID_PARAMETER;
 
-    hRes = RegCreateKeyEx(
+    hRes = RegCreateKeyExA(
                currentKeyClass,          /* Class     */
                currentKeyName,           /* Sub Key   */
                0,                        /* MUST BE 0 */
@@ -986,7 +986,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)
@@ -1019,7 +1019,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)
@@ -1173,8 +1173,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) {
@@ -1257,8 +1257,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) {
@@ -1268,8 +1268,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);
@@ -1347,7 +1347,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,
@@ -1390,7 +1390,7 @@
 /******************************************************************************
  * Reads contents of the specified file into the registry.
  */
-BOOL import_registry_file(LPTSTR filename)
+BOOL import_registry_file(LPSTR filename)
 {
     FILE* reg_file = fopen(filename, "r");
 
@@ -1414,7 +1414,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();
     }
 
@@ -1433,8 +1433,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) {
@@ -1445,7 +1445,7 @@
     }
     (*reg_key_name_buf)[curr_len] = '\0';
     RegCloseKey(branch_key);
-    RegDeleteKey(key, *reg_key_name_buf);
+    RegDeleteKeyA(key, *reg_key_name_buf);
 }
 
 /******************************************************************************
@@ -1479,7 +1479,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);

reactos/subsys/system/regedit
regproc.h 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- regproc.h	1 Jan 2004 15:12:11 -0000	1.2
+++ regproc.h	20 Jun 2004 02:22:44 -0000	1.3
@@ -37,7 +37,7 @@
 void doUnregisterDLL(LPSTR lpsLine);
 
 BOOL export_registry_key(CHAR *file_name, CHAR *reg_key_name);
-BOOL import_registry_file(LPTSTR filename);
+BOOL import_registry_file(LPSTR filename);
 void delete_registry_key(CHAR *reg_key_name);
 
 void setAppName(CHAR *name);

reactos/subsys/system/regedit
treeview.c 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- treeview.c	1 Mar 2004 01:07:37 -0000	1.5
+++ treeview.c	20 Jun 2004 02:22:44 -0000	1.6
@@ -111,7 +111,7 @@
 
     tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN | TVIF_PARAM;
     tvi.pszText = label;
-    tvi.cchTextMax = lstrlen(tvi.pszText);
+    tvi.cchTextMax = _tcslen(tvi.pszText);
     tvi.iImage = Image_Closed;
     tvi.iSelectedImage = Image_Open;
     tvi.cChildren = dwChildren;
@@ -132,7 +132,7 @@
     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);
+    tvi.cchTextMax = _tcslen(tvi.pszText);
     /* Assume the item is not a parent item, so give it an image.  */
     tvi.iImage = Image_Root;
     tvi.iSelectedImage = Image_Root;
CVSspam 0.2.8