mirror of
https://github.com/reactos/reactos.git
synced 2025-01-02 12:32:47 +00:00
some fixes to be able to create a unicode build
svn path=/trunk/; revision=9737
This commit is contained in:
parent
841ace6796
commit
4c4f493412
7 changed files with 50 additions and 49 deletions
|
@ -276,9 +276,9 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
|
||||||
if (keyPath) {
|
if (keyPath) {
|
||||||
RefreshListView(pChildWnd->hListWnd, hRootKey, keyPath);
|
RefreshListView(pChildWnd->hListWnd, hRootKey, keyPath);
|
||||||
rootName = get_root_key_name(hRootKey);
|
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) {
|
if (fullPath) {
|
||||||
_stprintf(fullPath, "%s\\%s", rootName, keyPath);
|
_stprintf(fullPath, _T("%s\\%s"), rootName, keyPath);
|
||||||
SendMessage(hStatusBar, SB_SETTEXT, 0, (LPARAM)fullPath);
|
SendMessage(hStatusBar, SB_SETTEXT, 0, (LPARAM)fullPath);
|
||||||
HeapFree(GetProcessHeap(), 0, fullPath);
|
HeapFree(GetProcessHeap(), 0, fullPath);
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,10 +59,10 @@ void error(HWND hwnd, INT resId, ...)
|
||||||
hInstance = GetModuleHandle(0);
|
hInstance = GetModuleHandle(0);
|
||||||
|
|
||||||
if (!LoadString(hInstance, IDS_ERROR, title, COUNT_OF(title)))
|
if (!LoadString(hInstance, IDS_ERROR, title, COUNT_OF(title)))
|
||||||
lstrcpy(title, "Error");
|
_tcscpy(title, _T("Error"));
|
||||||
|
|
||||||
if (!LoadString(hInstance, resId, errfmt, COUNT_OF(errfmt)))
|
if (!LoadString(hInstance, resId, errfmt, COUNT_OF(errfmt)))
|
||||||
lstrcpy(errfmt, "Unknown error string!");
|
_tcscpy(errfmt, _T("Unknown error string!"));
|
||||||
|
|
||||||
va_start(ap, resId);
|
va_start(ap, resId);
|
||||||
_vsntprintf(errstr, COUNT_OF(errstr), errfmt, ap);
|
_vsntprintf(errstr, COUNT_OF(errstr), errfmt, ap);
|
||||||
|
@ -82,10 +82,10 @@ void warning(HWND hwnd, INT resId, ...)
|
||||||
hInstance = GetModuleHandle(0);
|
hInstance = GetModuleHandle(0);
|
||||||
|
|
||||||
if (!LoadString(hInstance, IDS_WARNING, title, COUNT_OF(title)))
|
if (!LoadString(hInstance, IDS_WARNING, title, COUNT_OF(title)))
|
||||||
lstrcpy(title, "Error");
|
_tcscpy(title, _T("Warning"));
|
||||||
|
|
||||||
if (!LoadString(hInstance, resId, errfmt, COUNT_OF(errfmt)))
|
if (!LoadString(hInstance, resId, errfmt, COUNT_OF(errfmt)))
|
||||||
lstrcpy(errfmt, "Unknown error string!");
|
_tcscpy(errfmt, _T("Unknown error string!"));
|
||||||
|
|
||||||
va_start(ap, resId);
|
va_start(ap, resId);
|
||||||
_vsntprintf(errstr, COUNT_OF(errstr), errfmt, ap);
|
_vsntprintf(errstr, COUNT_OF(errstr), errfmt, ap);
|
||||||
|
@ -102,7 +102,7 @@ INT_PTR CALLBACK modify_string_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
|
||||||
|
|
||||||
switch(uMsg) {
|
switch(uMsg) {
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
if(editValueName && strcmp(editValueName, _T("")))
|
if(editValueName && _tcscmp(editValueName, _T("")))
|
||||||
{
|
{
|
||||||
SetDlgItemText(hwndDlg, IDC_VALUE_NAME, editValueName);
|
SetDlgItemText(hwndDlg, IDC_VALUE_NAME, editValueName);
|
||||||
}
|
}
|
||||||
|
@ -165,7 +165,7 @@ INT_PTR CALLBACK modify_multi_string_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wPa
|
||||||
|
|
||||||
switch(uMsg) {
|
switch(uMsg) {
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
if(editValueName && strcmp(editValueName, _T("")))
|
if(editValueName && _tcscmp(editValueName, _T("")))
|
||||||
{
|
{
|
||||||
SetDlgItemText(hwndDlg, IDC_VALUE_NAME, editValueName);
|
SetDlgItemText(hwndDlg, IDC_VALUE_NAME, editValueName);
|
||||||
}
|
}
|
||||||
|
@ -282,7 +282,7 @@ INT_PTR CALLBACK modify_dword_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
|
||||||
SetWindowLong(hwndValue, GWL_USERDATA, (LONG)oldproc);
|
SetWindowLong(hwndValue, GWL_USERDATA, (LONG)oldproc);
|
||||||
SetWindowLong(hwndValue, GWL_WNDPROC, (LONG)DwordEditSubclassProc);
|
SetWindowLong(hwndValue, GWL_WNDPROC, (LONG)DwordEditSubclassProc);
|
||||||
|
|
||||||
if(editValueName && strcmp(editValueName, _T("")))
|
if(editValueName && _tcscmp(editValueName, _T("")))
|
||||||
{
|
{
|
||||||
SetDlgItemText(hwndDlg, IDC_VALUE_NAME, editValueName);
|
SetDlgItemText(hwndDlg, IDC_VALUE_NAME, editValueName);
|
||||||
}
|
}
|
||||||
|
@ -291,7 +291,7 @@ INT_PTR CALLBACK modify_dword_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
|
||||||
SetDlgItemText(hwndDlg, IDC_VALUE_NAME, _T("(Default)"));
|
SetDlgItemText(hwndDlg, IDC_VALUE_NAME, _T("(Default)"));
|
||||||
}
|
}
|
||||||
CheckRadioButton (hwndDlg, IDC_FORMAT_HEX, IDC_FORMAT_DEC, IDC_FORMAT_HEX);
|
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);
|
SetDlgItemText(hwndDlg, IDC_VALUE_DATA, ValueString);
|
||||||
SetFocus(GetDlgItem(hwndDlg, IDC_VALUE_DATA));
|
SetFocus(GetDlgItem(hwndDlg, IDC_VALUE_DATA));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -313,7 +313,7 @@ INT_PTR CALLBACK modify_dword_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Value = strtoul (ValueString, &Remainder, 10);
|
Value = _tcstoul (ValueString, &Remainder, 10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -321,7 +321,7 @@ INT_PTR CALLBACK modify_dword_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
|
||||||
Value = 0;
|
Value = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sprintf (ValueString, "%lx", Value);
|
_stprintf (ValueString, _T("%lx"), Value);
|
||||||
SetDlgItemText(hwndDlg, IDC_VALUE_DATA, ValueString);
|
SetDlgItemText(hwndDlg, IDC_VALUE_DATA, ValueString);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -341,7 +341,7 @@ INT_PTR CALLBACK modify_dword_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Value = strtoul (ValueString, &Remainder, 16);
|
Value = _tcstoul (ValueString, &Remainder, 16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -349,7 +349,7 @@ INT_PTR CALLBACK modify_dword_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
|
||||||
Value = 0;
|
Value = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sprintf (ValueString, "%lu", Value);
|
_stprintf (ValueString, _T("%lu"), Value);
|
||||||
SetDlgItemText(hwndDlg, IDC_VALUE_DATA, ValueString);
|
SetDlgItemText(hwndDlg, IDC_VALUE_DATA, ValueString);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -367,7 +367,7 @@ INT_PTR CALLBACK modify_dword_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
|
||||||
}
|
}
|
||||||
|
|
||||||
Base = (dwordEditMode == EDIT_MODE_HEX) ? 16 : 10;
|
Base = (dwordEditMode == EDIT_MODE_HEX) ? 16 : 10;
|
||||||
dwordValueData = strtoul (ValueString, &Remainder, Base);
|
dwordValueData = _tcstoul (ValueString, &Remainder, Base);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -422,7 +422,7 @@ BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName)
|
||||||
error(hwnd, IDS_TOO_BIG_VALUE, valueDataLen);
|
error(hwnd, IDS_TOO_BIG_VALUE, valueDataLen);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
lRet = RegQueryValueEx(hKey, valueName, 0, 0, stringValueData, &valueDataLen);
|
lRet = RegQueryValueEx(hKey, valueName, 0, 0, (LPBYTE)stringValueData, &valueDataLen);
|
||||||
if (lRet != ERROR_SUCCESS)
|
if (lRet != ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
error(hwnd, IDS_BAD_VALUE, valueName);
|
error(hwnd, IDS_BAD_VALUE, valueName);
|
||||||
|
@ -438,7 +438,7 @@ BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName)
|
||||||
{
|
{
|
||||||
if (stringValueData)
|
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
|
else
|
||||||
{
|
{
|
||||||
|
@ -452,7 +452,7 @@ BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName)
|
||||||
{
|
{
|
||||||
if (valueDataLen > 0)
|
if (valueDataLen > 0)
|
||||||
{
|
{
|
||||||
DWORD NewLen, llen, listlen, nl_len;
|
DWORD llen, listlen, nl_len;
|
||||||
LPTSTR src, lines = NULL;
|
LPTSTR src, lines = NULL;
|
||||||
|
|
||||||
if (!(stringValueData = HeapAlloc(GetProcessHeap(), 0, valueDataLen)))
|
if (!(stringValueData = HeapAlloc(GetProcessHeap(), 0, valueDataLen)))
|
||||||
|
@ -460,7 +460,7 @@ BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName)
|
||||||
error(hwnd, IDS_TOO_BIG_VALUE, valueDataLen);
|
error(hwnd, IDS_TOO_BIG_VALUE, valueDataLen);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
lRet = RegQueryValueEx(hKey, valueName, 0, 0, stringValueData, &valueDataLen);
|
lRet = RegQueryValueEx(hKey, valueName, 0, 0, (LPBYTE)stringValueData, &valueDataLen);
|
||||||
if (lRet != ERROR_SUCCESS)
|
if (lRet != ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
error(hwnd, IDS_BAD_VALUE, valueName);
|
error(hwnd, IDS_BAD_VALUE, valueName);
|
||||||
|
@ -468,7 +468,6 @@ BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* convert \0 to \r\n */
|
/* convert \0 to \r\n */
|
||||||
NewLen = valueDataLen;
|
|
||||||
src = stringValueData;
|
src = stringValueData;
|
||||||
nl_len = _tcslen(_T("\r\n")) * sizeof(TCHAR);
|
nl_len = _tcslen(_T("\r\n")) * sizeof(TCHAR);
|
||||||
listlen = sizeof(TCHAR);
|
listlen = sizeof(TCHAR);
|
||||||
|
@ -510,7 +509,7 @@ BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName)
|
||||||
{
|
{
|
||||||
if((nl = _tcsstr(src, _T("\r\n"))))
|
if((nl = _tcsstr(src, _T("\r\n"))))
|
||||||
{
|
{
|
||||||
linechars = (nl - src) / sizeof(TCHAR);
|
linechars = nl - src;
|
||||||
if(nl == src)
|
if(nl == src)
|
||||||
{
|
{
|
||||||
EmptyLines = TRUE;
|
EmptyLines = TRUE;
|
||||||
|
@ -543,7 +542,7 @@ BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName)
|
||||||
warning(hwnd, IDS_MULTI_SZ_EMPTY_STRING);
|
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);
|
HeapFree(GetProcessHeap(), 0, lines);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -245,7 +245,8 @@ static BOOL ImportRegistryFile(HWND hWnd)
|
||||||
ofn.lpstrTitle = _T("Import Registry File");
|
ofn.lpstrTitle = _T("Import Registry File");
|
||||||
/* ofn.lCustData = ;*/
|
/* ofn.lCustData = ;*/
|
||||||
if (GetOpenFileName(&ofn)) {
|
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);*/
|
/*printf("Can't open file \"%s\"\n", ofn.lpstrFile);*/
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -287,8 +288,9 @@ static BOOL ExportRegistryFile(HWND hWnd)
|
||||||
ofn.lpfnHook = ImportRegistryFile_OFNHookProc;
|
ofn.lpfnHook = ImportRegistryFile_OFNHookProc;
|
||||||
ofn.lpTemplateName = MAKEINTRESOURCE(IDD_DIALOG1);
|
ofn.lpTemplateName = MAKEINTRESOURCE(IDD_DIALOG1);
|
||||||
if (GetSaveFileName(&ofn)) {
|
if (GetSaveFileName(&ofn)) {
|
||||||
BOOL result;
|
BOOL result;
|
||||||
result = export_registry_key(ofn.lpstrFile, ExportKeyPath);
|
/* FIXME - convert strings to ascii! */
|
||||||
|
result = export_registry_key((CHAR*)ofn.lpstrFile, (CHAR*)ExportKeyPath);
|
||||||
/*result = export_registry_key(ofn.lpstrFile, NULL);*/
|
/*result = export_registry_key(ofn.lpstrFile, NULL);*/
|
||||||
/*if (!export_registry_key(ofn.lpstrFile, NULL)) {*/
|
/*if (!export_registry_key(ofn.lpstrFile, NULL)) {*/
|
||||||
if (!result) {
|
if (!result) {
|
||||||
|
@ -307,7 +309,7 @@ static BOOL ExportRegistryFile(HWND hWnd)
|
||||||
if (s[0]) {
|
if (s[0]) {
|
||||||
TCHAR reg_key_name[KEY_MAX_LEN];
|
TCHAR reg_key_name[KEY_MAX_LEN];
|
||||||
get_file_name(&s, 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 {
|
} else {
|
||||||
export_registry_key(filename, NULL);
|
export_registry_key(filename, NULL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,7 +106,7 @@ BOOL IsDefaultValue(HWND hwndLV, int i)
|
||||||
if(ListView_GetItem(hwndLV, &Item))
|
if(ListView_GetItem(hwndLV, &Item))
|
||||||
{
|
{
|
||||||
lineinfo = (PLINE_INFO)Item.lParam;
|
lineinfo = (PLINE_INFO)Item.lParam;
|
||||||
return lineinfo && (!lineinfo->name || !strcmp(lineinfo->name, _T("")));
|
return lineinfo && (!lineinfo->name || !_tcscmp(lineinfo->name, _T("")));
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -392,7 +392,7 @@ BOOL ListWndNotifyProc(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL *Result)
|
||||||
if(Info)
|
if(Info)
|
||||||
{
|
{
|
||||||
lineinfo = (PLINE_INFO)Info->item.lParam;
|
lineinfo = (PLINE_INFO)Info->item.lParam;
|
||||||
if(!lineinfo->name || !strcmp(lineinfo->name, _T("")))
|
if(!lineinfo->name || !_tcscmp(lineinfo->name, _T("")))
|
||||||
{
|
{
|
||||||
*Result = TRUE;
|
*Result = TRUE;
|
||||||
}
|
}
|
||||||
|
@ -490,7 +490,7 @@ BOOL RefreshListView(HWND hwndLV, HKEY hKey, LPCTSTR keyPath)
|
||||||
dwValSize = max_val_size;
|
dwValSize = max_val_size;
|
||||||
dwValType = 0L;
|
dwValType = 0L;
|
||||||
++dwIndex;
|
++dwIndex;
|
||||||
if(!strcmp(ValName, _T("")))
|
if(!_tcscmp(ValName, _T("")))
|
||||||
{
|
{
|
||||||
AddedDefault = TRUE;
|
AddedDefault = TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -424,7 +424,7 @@ HRESULT setValue(LPSTR val_name, LPSTR val_data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
hRes = RegSetValueEx(
|
hRes = RegSetValueExA(
|
||||||
currentKeyHandle,
|
currentKeyHandle,
|
||||||
val_name,
|
val_name,
|
||||||
0, /* Reserved */
|
0, /* Reserved */
|
||||||
|
@ -460,7 +460,7 @@ HRESULT openKey( LPSTR stdInput)
|
||||||
if (currentKeyName == NULL)
|
if (currentKeyName == NULL)
|
||||||
return ERROR_INVALID_PARAMETER;
|
return ERROR_INVALID_PARAMETER;
|
||||||
|
|
||||||
hRes = RegCreateKeyEx(
|
hRes = RegCreateKeyExA(
|
||||||
currentKeyClass, /* Class */
|
currentKeyClass, /* Class */
|
||||||
currentKeyName, /* Sub Key */
|
currentKeyName, /* Sub Key */
|
||||||
0, /* MUST BE 0 */
|
0, /* MUST BE 0 */
|
||||||
|
@ -986,7 +986,7 @@ void doRegisterDLL(LPSTR stdInput)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Load and register the library, then free it */
|
/* Load and register the library, then free it */
|
||||||
theLib = LoadLibrary(stdInput);
|
theLib = LoadLibraryA(stdInput);
|
||||||
if (theLib) {
|
if (theLib) {
|
||||||
FARPROC lpfnDLLRegProc = GetProcAddress(theLib, "DllRegisterServer");
|
FARPROC lpfnDLLRegProc = GetProcAddress(theLib, "DllRegisterServer");
|
||||||
if (lpfnDLLRegProc)
|
if (lpfnDLLRegProc)
|
||||||
|
@ -1019,7 +1019,7 @@ void doUnregisterDLL(LPSTR stdInput)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Load and unregister the library, then free it */
|
/* Load and unregister the library, then free it */
|
||||||
theLib = LoadLibrary(stdInput);
|
theLib = LoadLibraryA(stdInput);
|
||||||
if (theLib) {
|
if (theLib) {
|
||||||
FARPROC lpfnDLLRegProc = GetProcAddress(theLib, "DllUnregisterServer");
|
FARPROC lpfnDLLRegProc = GetProcAddress(theLib, "DllUnregisterServer");
|
||||||
if (lpfnDLLRegProc)
|
if (lpfnDLLRegProc)
|
||||||
|
@ -1173,8 +1173,8 @@ void export_hkey(FILE *file, HKEY key,
|
||||||
DWORD value_type;
|
DWORD value_type;
|
||||||
DWORD val_name_len1 = *val_name_len;
|
DWORD val_name_len1 = *val_name_len;
|
||||||
DWORD val_size1 = *val_size;
|
DWORD val_size1 = *val_size;
|
||||||
ret = RegEnumValue(key, i, *val_name_buf, &val_name_len1, NULL,
|
ret = RegEnumValueA(key, i, *val_name_buf, &val_name_len1, NULL,
|
||||||
&value_type, *val_buf, &val_size1);
|
&value_type, *val_buf, &val_size1);
|
||||||
if (ret != ERROR_SUCCESS) {
|
if (ret != ERROR_SUCCESS) {
|
||||||
more_data = FALSE;
|
more_data = FALSE;
|
||||||
if (ret != ERROR_NO_MORE_ITEMS) {
|
if (ret != ERROR_NO_MORE_ITEMS) {
|
||||||
|
@ -1257,8 +1257,8 @@ void export_hkey(FILE *file, HKEY key,
|
||||||
while(more_data) {
|
while(more_data) {
|
||||||
DWORD buf_len = *reg_key_name_len - curr_len;
|
DWORD buf_len = *reg_key_name_len - curr_len;
|
||||||
|
|
||||||
ret = RegEnumKeyEx(key, i, *reg_key_name_buf + curr_len + 1, &buf_len,
|
ret = RegEnumKeyExA(key, i, *reg_key_name_buf + curr_len + 1, &buf_len,
|
||||||
NULL, NULL, NULL, NULL);
|
NULL, NULL, NULL, NULL);
|
||||||
if (ret != ERROR_SUCCESS && ret != ERROR_MORE_DATA) {
|
if (ret != ERROR_SUCCESS && ret != ERROR_MORE_DATA) {
|
||||||
more_data = FALSE;
|
more_data = FALSE;
|
||||||
if (ret != ERROR_NO_MORE_ITEMS) {
|
if (ret != ERROR_NO_MORE_ITEMS) {
|
||||||
|
@ -1268,8 +1268,8 @@ void export_hkey(FILE *file, HKEY key,
|
||||||
HKEY subkey;
|
HKEY subkey;
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
if (RegOpenKey(key, *reg_key_name_buf + curr_len + 1,
|
if (RegOpenKeyA(key, *reg_key_name_buf + curr_len + 1,
|
||||||
&subkey) == ERROR_SUCCESS) {
|
&subkey) == ERROR_SUCCESS) {
|
||||||
export_hkey(file, subkey, reg_key_name_buf, reg_key_name_len,
|
export_hkey(file, subkey, reg_key_name_buf, reg_key_name_len,
|
||||||
val_name_buf, val_name_len, val_buf, val_size);
|
val_name_buf, val_name_len, val_buf, val_size);
|
||||||
RegCloseKey(subkey);
|
RegCloseKey(subkey);
|
||||||
|
@ -1347,7 +1347,7 @@ BOOL export_registry_key(CHAR *file_name, CHAR *reg_key_name)
|
||||||
®_key_name_buf, ®_key_name_len,
|
®_key_name_buf, ®_key_name_len,
|
||||||
&val_name_buf, &val_name_len,
|
&val_name_buf, &val_name_len,
|
||||||
&val_buf, &val_size);
|
&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);
|
file = REGPROC_open_export_file(file_name);
|
||||||
export_hkey(file, key,
|
export_hkey(file, key,
|
||||||
®_key_name_buf, ®_key_name_len,
|
®_key_name_buf, ®_key_name_len,
|
||||||
|
@ -1390,7 +1390,7 @@ BOOL export_registry_key(CHAR *file_name, CHAR *reg_key_name)
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Reads contents of the specified file into the registry.
|
* 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");
|
FILE* reg_file = fopen(filename, "r");
|
||||||
|
|
||||||
|
@ -1414,7 +1414,7 @@ void delete_branch(HKEY key,
|
||||||
LONG ret;
|
LONG ret;
|
||||||
long int i;
|
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();
|
REGPROC_print_error();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1433,8 +1433,8 @@ void delete_branch(HKEY key,
|
||||||
for (i = subkeys - 1; i >= 0; i--) {
|
for (i = subkeys - 1; i >= 0; i--) {
|
||||||
DWORD buf_len = *reg_key_name_len - curr_len;
|
DWORD buf_len = *reg_key_name_len - curr_len;
|
||||||
|
|
||||||
ret = RegEnumKeyEx(branch_key, i, *reg_key_name_buf + curr_len + 1,
|
ret = RegEnumKeyExA(branch_key, i, *reg_key_name_buf + curr_len + 1,
|
||||||
&buf_len, NULL, NULL, NULL, NULL);
|
&buf_len, NULL, NULL, NULL, NULL);
|
||||||
if (ret != ERROR_SUCCESS &&
|
if (ret != ERROR_SUCCESS &&
|
||||||
ret != ERROR_MORE_DATA &&
|
ret != ERROR_MORE_DATA &&
|
||||||
ret != ERROR_NO_MORE_ITEMS) {
|
ret != ERROR_NO_MORE_ITEMS) {
|
||||||
|
@ -1445,7 +1445,7 @@ void delete_branch(HKEY key,
|
||||||
}
|
}
|
||||||
(*reg_key_name_buf)[curr_len] = '\0';
|
(*reg_key_name_buf)[curr_len] = '\0';
|
||||||
RegCloseKey(branch_key);
|
RegCloseKey(branch_key);
|
||||||
RegDeleteKey(key, *reg_key_name_buf);
|
RegDeleteKeyA(key, *reg_key_name_buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
|
@ -1479,7 +1479,7 @@ void delete_registry_key(CHAR *reg_key_name)
|
||||||
getAppName(), reg_key_name);
|
getAppName(), reg_key_name);
|
||||||
exit(1);
|
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 */
|
/* check whether the key exists */
|
||||||
RegCloseKey(branch_key);
|
RegCloseKey(branch_key);
|
||||||
delete_branch(reg_key_class, &branch_name, &branch_name_len);
|
delete_branch(reg_key_class, &branch_name, &branch_name_len);
|
||||||
|
|
|
@ -37,7 +37,7 @@ void doRegisterDLL(LPSTR lpsLine);
|
||||||
void doUnregisterDLL(LPSTR lpsLine);
|
void doUnregisterDLL(LPSTR lpsLine);
|
||||||
|
|
||||||
BOOL export_registry_key(CHAR *file_name, CHAR *reg_key_name);
|
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 delete_registry_key(CHAR *reg_key_name);
|
||||||
|
|
||||||
void setAppName(CHAR *name);
|
void setAppName(CHAR *name);
|
||||||
|
|
|
@ -111,7 +111,7 @@ static HTREEITEM AddEntryToTree(HWND hwndTV, HTREEITEM hParent, LPTSTR label, HK
|
||||||
|
|
||||||
tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN | TVIF_PARAM;
|
tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN | TVIF_PARAM;
|
||||||
tvi.pszText = label;
|
tvi.pszText = label;
|
||||||
tvi.cchTextMax = lstrlen(tvi.pszText);
|
tvi.cchTextMax = _tcslen(tvi.pszText);
|
||||||
tvi.iImage = Image_Closed;
|
tvi.iImage = Image_Closed;
|
||||||
tvi.iSelectedImage = Image_Open;
|
tvi.iSelectedImage = Image_Open;
|
||||||
tvi.cChildren = dwChildren;
|
tvi.cChildren = dwChildren;
|
||||||
|
@ -132,7 +132,7 @@ static BOOL InitTreeViewItems(HWND hwndTV, LPTSTR pHostName)
|
||||||
tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN | TVIF_PARAM;
|
tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN | TVIF_PARAM;
|
||||||
/* Set the text of the item. */
|
/* Set the text of the item. */
|
||||||
tvi.pszText = pHostName;
|
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. */
|
/* Assume the item is not a parent item, so give it an image. */
|
||||||
tvi.iImage = Image_Root;
|
tvi.iImage = Image_Root;
|
||||||
tvi.iSelectedImage = Image_Root;
|
tvi.iSelectedImage = Image_Root;
|
||||||
|
|
Loading…
Reference in a new issue