mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 15:36:04 +00:00
build regedit as unicode by default
svn path=/trunk/; revision=18246
This commit is contained in:
parent
bb46913ed6
commit
9e960ba331
4 changed files with 36 additions and 24 deletions
|
@ -263,7 +263,7 @@ static BOOL ImportRegistryFile(HWND hWnd)
|
||||||
/* ofn.lCustData = ;*/
|
/* ofn.lCustData = ;*/
|
||||||
if (GetOpenFileName(&ofn)) {
|
if (GetOpenFileName(&ofn)) {
|
||||||
/* FIXME - convert to ascii */
|
/* 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);*/
|
/*printf("Can't open file \"%s\"\n", ofn.lpstrFile);*/
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -617,7 +617,7 @@ InitializeRemoteRegistryPicker(OUT IDsObjectPicker **pDsObjectPicker)
|
||||||
static HRESULT
|
static HRESULT
|
||||||
InvokeRemoteRegistryPickerDialog(IN IDsObjectPicker *pDsObjectPicker,
|
InvokeRemoteRegistryPickerDialog(IN IDsObjectPicker *pDsObjectPicker,
|
||||||
IN HWND hwndParent OPTIONAL,
|
IN HWND hwndParent OPTIONAL,
|
||||||
OUT LPWSTR lpBuffer,
|
OUT LPTSTR lpBuffer,
|
||||||
IN UINT uSize)
|
IN UINT uSize)
|
||||||
{
|
{
|
||||||
IDataObject *pdo = NULL;
|
IDataObject *pdo = NULL;
|
||||||
|
@ -652,10 +652,20 @@ InvokeRemoteRegistryPickerDialog(IN IDsObjectPicker *pDsObjectPicker,
|
||||||
{
|
{
|
||||||
nlen = uSize - 1;
|
nlen = uSize - 1;
|
||||||
}
|
}
|
||||||
|
#if UNICODE
|
||||||
memcpy(lpBuffer,
|
memcpy(lpBuffer,
|
||||||
SelectionList->aDsSelection[0].pwzName,
|
SelectionList->aDsSelection[0].pwzName,
|
||||||
nlen * sizeof(WCHAR));
|
nlen * sizeof(WCHAR));
|
||||||
|
#else
|
||||||
|
WideCharToMultiByte(CP_ACP,
|
||||||
|
0,
|
||||||
|
SelectionList->aDsSelection[0].pwzName,
|
||||||
|
nlen,
|
||||||
|
lpBuffer,
|
||||||
|
uSize,
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
|
#endif
|
||||||
lpBuffer[nlen] = L'\0';
|
lpBuffer[nlen] = L'\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -704,7 +714,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
case ID_REGISTRY_CONNECTNETWORKREGISTRY:
|
case ID_REGISTRY_CONNECTNETWORKREGISTRY:
|
||||||
{
|
{
|
||||||
IDsObjectPicker *ObjectPicker;
|
IDsObjectPicker *ObjectPicker;
|
||||||
WCHAR szComputerName[MAX_COMPUTERNAME_LENGTH + 1];
|
TCHAR szComputerName[MAX_COMPUTERNAME_LENGTH + 1];
|
||||||
HRESULT hRet;
|
HRESULT hRet;
|
||||||
|
|
||||||
hRet = CoInitialize(NULL);
|
hRet = CoInitialize(NULL);
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
<module name="regedit" type="win32gui" installname="regedit.exe">
|
<module name="regedit" type="win32gui" installname="regedit.exe">
|
||||||
<include base="regedit">.</include>
|
<include base="regedit">.</include>
|
||||||
<define name="__USE_W32API" />
|
<define name="__USE_W32API" />
|
||||||
|
<define name="UNICODE" />
|
||||||
|
<define name="_UNICODE" />
|
||||||
<define name="_WIN32_IE">0x0501</define>
|
<define name="_WIN32_IE">0x0501</define>
|
||||||
<define name="_WIN32_WINNT">0x0501</define>
|
<define name="_WIN32_WINNT">0x0600</define>
|
||||||
<library>uuid</library>
|
<library>uuid</library>
|
||||||
<library>kernel32</library>
|
<library>kernel32</library>
|
||||||
<library>user32</library>
|
<library>user32</library>
|
||||||
|
|
|
@ -427,7 +427,7 @@ HRESULT setValue(LPSTR val_name, LPSTR val_data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
hRes = RegSetValueEx(
|
hRes = RegSetValueExA(
|
||||||
currentKeyHandle,
|
currentKeyHandle,
|
||||||
val_name,
|
val_name,
|
||||||
0, /* Reserved */
|
0, /* Reserved */
|
||||||
|
@ -987,7 +987,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)
|
||||||
|
@ -1020,7 +1020,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)
|
||||||
|
@ -1174,8 +1174,8 @@ static 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) {
|
||||||
|
@ -1258,8 +1258,8 @@ static 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) {
|
||||||
|
@ -1269,8 +1269,8 @@ static 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);
|
||||||
|
@ -1348,7 +1348,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,
|
||||||
|
@ -1393,7 +1393,7 @@ BOOL export_registry_key(CHAR *file_name, CHAR *reg_key_name)
|
||||||
*/
|
*/
|
||||||
BOOL import_registry_file(LPTSTR filename)
|
BOOL import_registry_file(LPTSTR filename)
|
||||||
{
|
{
|
||||||
FILE* reg_file = fopen(filename, "r");
|
FILE* reg_file = _tfopen(filename, _T("r"));
|
||||||
|
|
||||||
if (reg_file) {
|
if (reg_file) {
|
||||||
processRegLines(reg_file, doSetValue);
|
processRegLines(reg_file, doSetValue);
|
||||||
|
@ -1415,7 +1415,7 @@ static 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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1434,8 +1434,8 @@ static 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) {
|
||||||
|
@ -1446,7 +1446,7 @@ static 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
|
@ -1480,7 +1480,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);
|
||||||
|
|
|
@ -136,7 +136,7 @@ static BOOL RefreshTreeItem(HWND hwndTV, HTREEITEM hItem)
|
||||||
HTREEITEM childItem;
|
HTREEITEM childItem;
|
||||||
LPCTSTR KeyPath;
|
LPCTSTR KeyPath;
|
||||||
DWORD dwCount, dwIndex, dwMaxSubKeyLen;
|
DWORD dwCount, dwIndex, dwMaxSubKeyLen;
|
||||||
LPSTR Name = NULL;
|
LPTSTR Name = NULL;
|
||||||
TVITEM tvItem;
|
TVITEM tvItem;
|
||||||
LPTSTR pszNodes = NULL;
|
LPTSTR pszNodes = NULL;
|
||||||
BOOL bSuccess = FALSE;
|
BOOL bSuccess = FALSE;
|
||||||
|
@ -235,7 +235,7 @@ static BOOL RefreshTreeItem(HWND hwndTV, HTREEITEM hItem)
|
||||||
/* Check if the node is already in there. */
|
/* Check if the node is already in there. */
|
||||||
if (pszNodes) {
|
if (pszNodes) {
|
||||||
for (s = pszNodes; *s; s += _tcslen(s) + 1) {
|
for (s = pszNodes; *s; s += _tcslen(s) + 1) {
|
||||||
if (!strcmp(s, Name)) {
|
if (!_tcscmp(s, Name)) {
|
||||||
found = TRUE;
|
found = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -616,7 +616,7 @@ BOOL SelectNode(HWND hwndTV, LPCTSTR keyPath)
|
||||||
if (!TreeView_Expand(hwndTV, hChildItem, TVE_EXPAND))
|
if (!TreeView_Expand(hwndTV, hChildItem, TVE_EXPAND))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
keyPath = s ? s + 1 : "";
|
keyPath = s ? s + 1 : _T("");
|
||||||
hItem = hChildItem;
|
hItem = hChildItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue