[REGEDIT] Partially sync Regedit to Wine-7.17 (#4717)

* [REGEDIT] Partially Sync to Wine 7.17

- regproc.c and regedit.c are now in sync.
- some other mostly depending fixes for the remaining files

* [REGEDIT_WINETEST] Sync to Wine-7.0
This commit is contained in:
Robert Naumann 2022-11-02 19:02:14 +01:00 committed by GitHub
parent 66030257b1
commit 36a7f0dc7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
49 changed files with 3473 additions and 1869 deletions

View file

@ -22,7 +22,7 @@ file(GLOB regedit_rc_deps res/*.*)
add_rc_deps(regedit.rc ${regedit_rc_deps})
add_executable(regedit ${SOURCE} regedit.rc)
set_module_type(regedit win32gui UNICODE)
target_link_libraries(regedit uuid)
target_link_libraries(regedit uuid wine)
add_importlibs(regedit user32 gdi32 advapi32 ole32 shell32 comctl32 comdlg32 shlwapi msvcrt kernel32 ntdll)
add_pch(regedit regedit.h SOURCE)
add_cd_file(TARGET regedit DESTINATION reactos FOR all)

View file

@ -25,7 +25,7 @@
void ShowAboutBox(HWND hWnd)
{
WCHAR AppStr[255];
LoadStringW(hInst, IDS_APP_TITLE, AppStr, COUNT_OF(AppStr));
LoadStringW(hInst, IDS_APP_TITLE, AppStr, ARRAY_SIZE(AppStr));
ShellAboutW(hWnd, AppStr, NULL, LoadIconW(hInst, MAKEINTRESOURCEW(IDI_REGEDIT)));
}

View file

@ -157,7 +157,7 @@ static void SuggestKeys(HKEY hRootKey, LPCWSTR pszKeyPath, LPWSTR pszSuggestions
/* Check default key */
if (QueryStringValue(hRootKey, pszKeyPath, NULL,
szBuffer, COUNT_OF(szBuffer)) == ERROR_SUCCESS)
szBuffer, ARRAY_SIZE(szBuffer)) == ERROR_SUCCESS)
{
/* Sanity check this key; it cannot be empty, nor can it be a
* loop back */
@ -189,7 +189,7 @@ static void SuggestKeys(HKEY hRootKey, LPCWSTR pszKeyPath, LPWSTR pszSuggestions
if (RegOpenKeyW(hRootKey, pszKeyPath, &hSubKey) == ERROR_SUCCESS)
{
if (QueryStringValue(hSubKey, L"CLSID", NULL, szBuffer,
COUNT_OF(szBuffer)) == ERROR_SUCCESS)
ARRAY_SIZE(szBuffer)) == ERROR_SUCCESS)
{
lstrcpynW(pszSuggestions, L"HKCR\\CLSID\\", (int)iSuggestionsLength);
i = wcslen(pszSuggestions);
@ -218,7 +218,7 @@ LRESULT CALLBACK AddressBarProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPar
case WM_KEYUP:
if (wParam == VK_RETURN)
{
GetWindowTextW(hwnd, s_szNode, COUNT_OF(s_szNode));
GetWindowTextW(hwnd, s_szNode, ARRAY_SIZE(s_szNode));
SelectNode(g_pChildWnd->hTreeWnd, s_szNode);
}
break;
@ -254,7 +254,7 @@ UpdateAddress(HTREEITEM hItem, HKEY hRootKey, LPCWSTR pszPath)
RefreshListView(g_pChildWnd->hListWnd, hRootKey, keyPath);
rootName = get_root_key_name(hRootKey);
cbFullPath = (wcslen(rootName) + 1 + wcslen(keyPath) + 1) * sizeof(WCHAR);
fullPath = HeapAlloc(GetProcessHeap(), 0, cbFullPath);
fullPath = malloc(cbFullPath);
if (fullPath)
{
/* set (correct) the address bar text */
@ -265,7 +265,7 @@ UpdateAddress(HTREEITEM hItem, HKEY hRootKey, LPCWSTR pszPath)
SendMessageW(hStatusBar, SB_SETTEXTW, 0, (LPARAM)fullPath);
SendMessageW(g_pChildWnd->hAddressBarWnd, WM_SETTEXT, 0, (LPARAM)fullPath);
HeapFree(GetProcessHeap(), 0, fullPath);
free(fullPath);
/* disable hive manipulation items temporarily (enable only if necessary) */
EnableMenuItem(hMenuFrame, ID_REGISTRY_LOADHIVE, MF_BYCOMMAND | MF_GRAYED);
@ -313,7 +313,7 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
DWORD style;
/* Load "My Computer" string */
LoadStringW(hInst, IDS_MY_COMPUTER, buffer, COUNT_OF(buffer));
LoadStringW(hInst, IDS_MY_COMPUTER, buffer, ARRAY_SIZE(buffer));
g_pChildWnd = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ChildWnd));
if (!g_pChildWnd) return 0;
@ -384,7 +384,7 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
DestroyTreeView(g_pChildWnd->hTreeWnd);
DestroyMainMenu();
DestroyIcon(g_pChildWnd->hArrowIcon);
HeapFree(GetProcessHeap(), 0, g_pChildWnd);
free(g_pChildWnd);
g_pChildWnd = NULL;
PostQuitMessage(0);
break;
@ -603,7 +603,7 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
TreeView_GetItem(g_pChildWnd->hTreeWnd, &item);
/* Set the Expand/Collapse menu item appropriately */
LoadStringW(hInst, (item.state & TVIS_EXPANDED) ? IDS_COLLAPSE : IDS_EXPAND, buffer, COUNT_OF(buffer));
LoadStringW(hInst, (item.state & TVIS_EXPANDED) ? IDS_COLLAPSE : IDS_EXPAND, buffer, ARRAY_SIZE(buffer));
memset(&mii, 0, sizeof(mii));
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_STRING | MIIM_STATE | MIIM_ID;
@ -632,18 +632,18 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
/* Come up with suggestions */
keyPath = GetItemPath(g_pChildWnd->hTreeWnd, NULL, &hRootKey);
SuggestKeys(hRootKey, keyPath, Suggestions, COUNT_OF(Suggestions));
SuggestKeys(hRootKey, keyPath, Suggestions, ARRAY_SIZE(Suggestions));
if (Suggestions[0])
{
AppendMenu(hContextMenu, MF_SEPARATOR, 0, NULL);
LoadStringW(hInst, IDS_GOTO_SUGGESTED_KEY, resource, COUNT_OF(resource));
LoadStringW(hInst, IDS_GOTO_SUGGESTED_KEY, resource, ARRAY_SIZE(resource));
s = Suggestions;
wID = ID_TREE_SUGGESTION_MIN;
while(*s && (wID <= ID_TREE_SUGGESTION_MAX))
{
_snwprintf(buffer, COUNT_OF(buffer), resource, s);
_snwprintf(buffer, ARRAY_SIZE(buffer), resource, s);
memset(&mii, 0, sizeof(mii));
mii.cbSize = sizeof(mii);

View file

@ -49,14 +49,14 @@ void error(HWND hwnd, INT resId, ...)
hInstance = GetModuleHandle(0);
if (!LoadStringW(hInstance, IDS_ERROR, title, COUNT_OF(title)))
if (!LoadStringW(hInstance, IDS_ERROR, title, ARRAY_SIZE(title)))
wcscpy(title, L"Error");
if (!LoadStringW(hInstance, resId, errfmt, COUNT_OF(errfmt)))
if (!LoadStringW(hInstance, resId, errfmt, ARRAY_SIZE(errfmt)))
wcscpy(errfmt, L"Unknown error string!");
va_start(ap, resId);
_vsnwprintf(errstr, COUNT_OF(errstr), errfmt, ap);
_vsnwprintf(errstr, ARRAY_SIZE(errstr), errfmt, ap);
va_end(ap);
MessageBoxW(hwnd, errstr, title, MB_OK | MB_ICONERROR);
@ -65,7 +65,7 @@ void error(HWND hwnd, INT resId, ...)
static void error_code_messagebox(HWND hwnd, DWORD error_code)
{
WCHAR title[256];
if (!LoadStringW(hInst, IDS_ERROR, title, COUNT_OF(title)))
if (!LoadStringW(hInst, IDS_ERROR, title, ARRAY_SIZE(title)))
wcscpy(title, L"Error");
ErrorMessageBox(hwnd, title, error_code);
}
@ -80,14 +80,14 @@ void warning(HWND hwnd, INT resId, ...)
hInstance = GetModuleHandle(0);
if (!LoadStringW(hInstance, IDS_WARNING, title, COUNT_OF(title)))
if (!LoadStringW(hInstance, IDS_WARNING, title, ARRAY_SIZE(title)))
wcscpy(title, L"Warning");
if (!LoadStringW(hInstance, resId, errfmt, COUNT_OF(errfmt)))
if (!LoadStringW(hInstance, resId, errfmt, ARRAY_SIZE(errfmt)))
wcscpy(errfmt, L"Unknown error string!");
va_start(ap, resId);
_vsnwprintf(errstr, COUNT_OF(errstr), errfmt, ap);
_vsnwprintf(errstr, ARRAY_SIZE(errstr), errfmt, ap);
va_end(ap);
MessageBoxW(hwnd, errstr, title, MB_OK | MB_ICONSTOP);
@ -111,7 +111,7 @@ INT_PTR CALLBACK modify_string_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
else
{
WCHAR buffer[255];
LoadStringW(hInst, IDS_DEFAULT_VALUE_NAME, buffer, COUNT_OF(buffer));
LoadStringW(hInst, IDS_DEFAULT_VALUE_NAME, buffer, ARRAY_SIZE(buffer));
SetDlgItemTextW(hwndDlg, IDC_VALUE_NAME, buffer);
}
SetDlgItemTextW(hwndDlg, IDC_VALUE_DATA, stringValueData);
@ -180,7 +180,7 @@ INT_PTR CALLBACK modify_multi_string_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wPa
else
{
WCHAR buffer[255];
LoadStringW(hInst, IDS_DEFAULT_VALUE_NAME, buffer, COUNT_OF(buffer));
LoadStringW(hInst, IDS_DEFAULT_VALUE_NAME, buffer, ARRAY_SIZE(buffer));
SetDlgItemTextW(hwndDlg, IDC_VALUE_NAME, buffer);
}
SetDlgItemTextW(hwndDlg, IDC_VALUE_DATA, stringValueData);
@ -300,7 +300,7 @@ INT_PTR CALLBACK modify_dword_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
else
{
WCHAR buffer[255];
LoadStringW(hInst, IDS_DEFAULT_VALUE_NAME, buffer, COUNT_OF(buffer));
LoadStringW(hInst, IDS_DEFAULT_VALUE_NAME, buffer, ARRAY_SIZE(buffer));
SetDlgItemTextW(hwndDlg, IDC_VALUE_NAME, buffer);
}
CheckRadioButton (hwndDlg, IDC_FORMAT_HEX, IDC_FORMAT_DEC, IDC_FORMAT_HEX);
@ -402,7 +402,7 @@ INT_PTR CALLBACK modify_binary_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
else
{
WCHAR buffer[255];
LoadStringW(hInst, IDS_DEFAULT_VALUE_NAME, buffer, COUNT_OF(buffer));
LoadStringW(hInst, IDS_DEFAULT_VALUE_NAME, buffer, ARRAY_SIZE(buffer));
SetDlgItemTextW(hwndDlg, IDC_VALUE_NAME, buffer);
}
hwndValue = GetDlgItem(hwndDlg, IDC_VALUE_DATA);
@ -456,13 +456,13 @@ static BOOL CreateResourceColumns(HWND hwnd)
/* Load the column labels from the resource file. */
lvC.iSubItem = 0;
lvC.cx = (rc.right - rc.left) / 2;
LoadStringW(hInst, IDS_DMA_CHANNEL, szText, COUNT_OF(szText));
LoadStringW(hInst, IDS_DMA_CHANNEL, szText, ARRAY_SIZE(szText));
if (ListView_InsertColumn(hwndLV, 0, &lvC) == -1)
return FALSE;
lvC.iSubItem = 1;
lvC.cx = (rc.right - rc.left) - lvC.cx;
LoadStringW(hInst, IDS_DMA_PORT, szText, COUNT_OF(szText));
LoadStringW(hInst, IDS_DMA_PORT, szText, ARRAY_SIZE(szText));
if (ListView_InsertColumn(hwndLV, 1, &lvC) == -1)
return FALSE;
@ -476,23 +476,23 @@ static BOOL CreateResourceColumns(HWND hwnd)
/* Load the column labels from the resource file. */
lvC.iSubItem = 0;
lvC.cx = width;
LoadStringW(hInst, IDS_INTERRUPT_VECTOR, szText, COUNT_OF(szText));
LoadStringW(hInst, IDS_INTERRUPT_VECTOR, szText, ARRAY_SIZE(szText));
if (ListView_InsertColumn(hwndLV, 0, &lvC) == -1)
return FALSE;
lvC.iSubItem = 1;
LoadStringW(hInst, IDS_INTERRUPT_LEVEL, szText, COUNT_OF(szText));
LoadStringW(hInst, IDS_INTERRUPT_LEVEL, szText, ARRAY_SIZE(szText));
if (ListView_InsertColumn(hwndLV, 1, &lvC) == -1)
return FALSE;
lvC.iSubItem = 2;
LoadStringW(hInst, IDS_INTERRUPT_AFFINITY, szText, COUNT_OF(szText));
LoadStringW(hInst, IDS_INTERRUPT_AFFINITY, szText, ARRAY_SIZE(szText));
if (ListView_InsertColumn(hwndLV, 2, &lvC) == -1)
return FALSE;
lvC.iSubItem = 3;
lvC.cx = (rc.right - rc.left) - 3 * width;
LoadStringW(hInst, IDS_INTERRUPT_TYPE, szText, COUNT_OF(szText));
LoadStringW(hInst, IDS_INTERRUPT_TYPE, szText, ARRAY_SIZE(szText));
if (ListView_InsertColumn(hwndLV, 3, &lvC) == -1)
return FALSE;
@ -506,18 +506,18 @@ static BOOL CreateResourceColumns(HWND hwnd)
/* Load the column labels from the resource file. */
lvC.iSubItem = 0;
lvC.cx = width;
LoadStringW(hInst, IDS_MEMORY_ADDRESS, szText, COUNT_OF(szText));
LoadStringW(hInst, IDS_MEMORY_ADDRESS, szText, ARRAY_SIZE(szText));
if (ListView_InsertColumn(hwndLV, 0, &lvC) == -1)
return FALSE;
lvC.iSubItem = 1;
LoadStringW(hInst, IDS_MEMORY_LENGTH, szText, COUNT_OF(szText));
LoadStringW(hInst, IDS_MEMORY_LENGTH, szText, ARRAY_SIZE(szText));
if (ListView_InsertColumn(hwndLV, 1, &lvC) == -1)
return FALSE;
lvC.iSubItem = 2;
lvC.cx = (rc.right - rc.left) - 2 * width;
LoadStringW(hInst, IDS_MEMORY_ACCESS, szText, COUNT_OF(szText));
LoadStringW(hInst, IDS_MEMORY_ACCESS, szText, ARRAY_SIZE(szText));
if (ListView_InsertColumn(hwndLV, 2, &lvC) == -1)
return FALSE;
@ -531,18 +531,18 @@ static BOOL CreateResourceColumns(HWND hwnd)
/* Load the column labels from the resource file. */
lvC.iSubItem = 0;
lvC.cx = width;
LoadStringW(hInst, IDS_PORT_ADDRESS, szText, COUNT_OF(szText));
LoadStringW(hInst, IDS_PORT_ADDRESS, szText, ARRAY_SIZE(szText));
if (ListView_InsertColumn(hwndLV, 0, &lvC) == -1)
return FALSE;
lvC.iSubItem = 1;
LoadStringW(hInst, IDS_PORT_LENGTH, szText, COUNT_OF(szText));
LoadStringW(hInst, IDS_PORT_LENGTH, szText, ARRAY_SIZE(szText));
if (ListView_InsertColumn(hwndLV, 1, &lvC) == -1)
return FALSE;
lvC.iSubItem = 2;
lvC.cx = (rc.right - rc.left) - 2 * width;
LoadStringW(hInst, IDS_PORT_ACCESS, szText, COUNT_OF(szText));
LoadStringW(hInst, IDS_PORT_ACCESS, szText, ARRAY_SIZE(szText));
if (ListView_InsertColumn(hwndLV, 2, &lvC) == -1)
return FALSE;
@ -555,18 +555,18 @@ static BOOL CreateResourceColumns(HWND hwnd)
/* Load the column labels from the resource file. */
lvC.iSubItem = 0;
lvC.cx = width;
LoadStringW(hInst, IDS_SPECIFIC_RESERVED1, szText, COUNT_OF(szText));
LoadStringW(hInst, IDS_SPECIFIC_RESERVED1, szText, ARRAY_SIZE(szText));
if (ListView_InsertColumn(hwndLV, 0, &lvC) == -1)
return FALSE;
lvC.iSubItem = 1;
LoadStringW(hInst, IDS_SPECIFIC_RESERVED2, szText, COUNT_OF(szText));
LoadStringW(hInst, IDS_SPECIFIC_RESERVED2, szText, ARRAY_SIZE(szText));
if (ListView_InsertColumn(hwndLV, 1, &lvC) == -1)
return FALSE;
lvC.iSubItem = 2;
lvC.cx = (rc.right - rc.left) - 2 * width;
LoadStringW(hInst, IDS_SPECIFIC_DATASIZE, szText, COUNT_OF(szText));
LoadStringW(hInst, IDS_SPECIFIC_DATASIZE, szText, ARRAY_SIZE(szText));
if (ListView_InsertColumn(hwndLV, 2, &lvC) == -1)
return FALSE;
@ -725,9 +725,9 @@ ParseResources(HWND hwnd)
ListView_SetItemText(hwndLV, iItem, 1, buffer);
if (pDescriptor->Flags & CM_RESOURCE_PORT_IO)
LoadStringW(hInst, IDS_PORT_PORT_IO, buffer, COUNT_OF(buffer));
LoadStringW(hInst, IDS_PORT_PORT_IO, buffer, ARRAY_SIZE(buffer));
else
LoadStringW(hInst, IDS_PORT_MEMORY_IO, buffer, COUNT_OF(buffer));
LoadStringW(hInst, IDS_PORT_MEMORY_IO, buffer, ARRAY_SIZE(buffer));
ListView_SetItemText(hwndLV, iItem, 2, buffer);
}
break;
@ -756,9 +756,9 @@ ParseResources(HWND hwnd)
ListView_SetItemText(hwndLV, iItem, 2, buffer);
if (pDescriptor->Flags & CM_RESOURCE_INTERRUPT_LATCHED)
LoadStringW(hInst, IDS_INTERRUPT_EDGE_SENSITIVE, buffer, COUNT_OF(buffer));
LoadStringW(hInst, IDS_INTERRUPT_EDGE_SENSITIVE, buffer, ARRAY_SIZE(buffer));
else
LoadStringW(hInst, IDS_INTERRUPT_LEVEL_SENSITIVE, buffer, COUNT_OF(buffer));
LoadStringW(hInst, IDS_INTERRUPT_LEVEL_SENSITIVE, buffer, ARRAY_SIZE(buffer));
ListView_SetItemText(hwndLV, iItem, 3, buffer);
}
@ -791,15 +791,15 @@ ParseResources(HWND hwnd)
switch (pDescriptor->Flags & (CM_RESOURCE_MEMORY_READ_ONLY | CM_RESOURCE_MEMORY_WRITE_ONLY))
{
case CM_RESOURCE_MEMORY_READ_ONLY:
LoadStringW(hInst, IDS_MEMORY_READ_ONLY, buffer, COUNT_OF(buffer));
LoadStringW(hInst, IDS_MEMORY_READ_ONLY, buffer, ARRAY_SIZE(buffer));
break;
case CM_RESOURCE_MEMORY_WRITE_ONLY:
LoadStringW(hInst, IDS_MEMORY_WRITE_ONLY, buffer, COUNT_OF(buffer));
LoadStringW(hInst, IDS_MEMORY_WRITE_ONLY, buffer, ARRAY_SIZE(buffer));
break;
default:
LoadStringW(hInst, IDS_MEMORY_READ_WRITE, buffer, COUNT_OF(buffer));
LoadStringW(hInst, IDS_MEMORY_READ_WRITE, buffer, ARRAY_SIZE(buffer));
break;
}
@ -961,13 +961,13 @@ static BOOL CreateResourceListColumns(HWND hWndListView)
/* Load the column labels from the resource file. */
lvC.iSubItem = 0;
lvC.cx = (rc.right - rc.left) / 2;
LoadStringW(hInst, IDS_BUSNUMBER, szText, COUNT_OF(szText));
LoadStringW(hInst, IDS_BUSNUMBER, szText, ARRAY_SIZE(szText));
if (ListView_InsertColumn(hWndListView, 0, &lvC) == -1)
return FALSE;
lvC.iSubItem = 1;
lvC.cx = (rc.right - rc.left) - lvC.cx;
LoadStringW(hInst, IDS_INTERFACE, szText, COUNT_OF(szText));
LoadStringW(hInst, IDS_INTERFACE, szText, ARRAY_SIZE(szText));
if (ListView_InsertColumn(hWndListView, 1, &lvC) == -1)
return FALSE;
@ -1467,8 +1467,8 @@ BOOL DeleteKey(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath)
return FALSE;
}
LoadStringW(hInst, IDS_QUERY_DELETE_KEY_CONFIRM, caption, COUNT_OF(caption));
LoadStringW(hInst, IDS_QUERY_DELETE_KEY_ONE, msg, COUNT_OF(msg));
LoadStringW(hInst, IDS_QUERY_DELETE_KEY_CONFIRM, caption, ARRAY_SIZE(caption));
LoadStringW(hInst, IDS_QUERY_DELETE_KEY_ONE, msg, ARRAY_SIZE(msg));
if (MessageBoxW(g_pChildWnd->hWnd, msg, caption, MB_ICONQUESTION | MB_YESNO) != IDYES)
goto done;

View file

@ -686,7 +686,7 @@ BOOL FindNext(HWND hWnd)
if (fSuccess)
{
GetKeyName(szFullKey, COUNT_OF(szFullKey), hKeyRoot, pszFoundSubKey);
GetKeyName(szFullKey, ARRAY_SIZE(szFullKey), hKeyRoot, pszFoundSubKey);
SelectNode(g_pChildWnd->hTreeWnd, szFullKey);
free(pszFoundSubKey);
@ -785,7 +785,7 @@ static INT_PTR CALLBACK FindDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR
hControl = GetDlgItem(hDlg, IDC_FINDWHAT);
if (hControl)
GetWindowTextW(hControl, s_szFindWhat, COUNT_OF(s_szFindWhat));
GetWindowTextW(hControl, s_szFindWhat, ARRAY_SIZE(s_szFindWhat));
EndDialog(hDlg, 1);
break;
@ -799,7 +799,7 @@ static INT_PTR CALLBACK FindDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR
switch(LOWORD(wParam))
{
case IDC_FINDWHAT:
GetWindowTextW((HWND) lParam, s_szSavedFindValue, COUNT_OF(s_szSavedFindValue));
GetWindowTextW((HWND) lParam, s_szSavedFindValue, ARRAY_SIZE(s_szSavedFindValue));
hControl = GetDlgItem(hDlg, IDOK);
if (hControl)
{
@ -825,8 +825,8 @@ void FindNextMessageBox(HWND hWnd)
{
WCHAR msg[128], caption[128];
LoadStringW(hInst, IDS_FINISHEDFIND, msg, COUNT_OF(msg));
LoadStringW(hInst, IDS_APP_TITLE, caption, COUNT_OF(caption));
LoadStringW(hInst, IDS_FINISHEDFIND, msg, ARRAY_SIZE(msg));
LoadStringW(hInst, IDS_APP_TITLE, caption, ARRAY_SIZE(caption));
MessageBoxW(hWnd, msg, caption, MB_ICONINFORMATION);
}
}

View file

@ -41,17 +41,10 @@ extern WCHAR Suggestions[256];
static void resize_frame_rect(HWND hWnd, PRECT prect)
{
RECT rt;
/*
if (IsWindowVisible(hToolBar)) {
SendMessageW(hToolBar, WM_SIZE, 0, 0);
GetClientRect(hToolBar, &rt);
prect->top = rt.bottom+3;
prect->bottom -= rt.bottom+3;
}
*/
if (IsWindowVisible(hStatusBar))
{
RECT rt;
SetupStatusBar(hWnd, TRUE);
GetWindowRect(hStatusBar, &rt);
prect->bottom -= rt.bottom - rt.top;
@ -100,7 +93,7 @@ static void OnInitMenu(HWND hWnd)
dwIndex = 0;
do
{
cbValueName = COUNT_OF(szValueName);
cbValueName = ARRAY_SIZE(szValueName);
cbValueData = sizeof(abValueData);
lResult = RegEnumValueW(hKey, dwIndex, szValueName, &cbValueName, NULL, &dwType, abValueData, &cbValueData);
if ((lResult == ERROR_SUCCESS) && (dwType == REG_SZ))
@ -281,7 +274,7 @@ static BOOL InitOpenFileName(HWND hWnd, OPENFILENAME* pofn)
FilterPairs[2].FilterID = IDS_FLT_REGEDIT4_FLT;
FilterPairs[3].DisplayID = IDS_FLT_ALLFILES;
FilterPairs[3].FilterID = IDS_FLT_ALLFILES_FLT;
BuildFilterStrings(Filter, FilterPairs, COUNT_OF(FilterPairs));
BuildFilterStrings(Filter, FilterPairs, ARRAY_SIZE(FilterPairs));
pofn->lpstrFilter = Filter;
pofn->lpstrFile = FileNameBuffer;
@ -368,7 +361,7 @@ static BOOL LoadHive(HWND hWnd)
BuildFilterStrings(Filter, &filter, 1);
ofn.lpstrFilter = Filter;
/* load and set the caption and flags for dialog */
LoadStringW(hInst, IDS_LOAD_HIVE, Caption, COUNT_OF(Caption));
LoadStringW(hInst, IDS_LOAD_HIVE, Caption, ARRAY_SIZE(Caption));
ofn.lpstrTitle = Caption;
ofn.Flags |= OFN_ENABLESIZING;
/* ofn.lCustData = ;*/
@ -416,7 +409,7 @@ static BOOL UnloadHive(HWND hWnd)
/* get the item key to unload */
pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hRootKey);
/* load and set the caption and flags for dialog */
LoadStringW(hInst, IDS_UNLOAD_HIVE, Caption, COUNT_OF(Caption));
LoadStringW(hInst, IDS_UNLOAD_HIVE, Caption, ARRAY_SIZE(Caption));
/* Enable the 'restore' privilege, unload the hive, disable the privilege */
EnablePrivilege(SE_RESTORE_NAME, NULL, TRUE);
@ -450,7 +443,7 @@ static BOOL ImportRegistryFile(HWND hWnd)
pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
InitOpenFileName(hWnd, &ofn);
LoadStringW(hInst, IDS_IMPORT_REG_FILE, Caption, COUNT_OF(Caption));
LoadStringW(hInst, IDS_IMPORT_REG_FILE, Caption, ARRAY_SIZE(Caption));
ofn.lpstrTitle = Caption;
ofn.Flags |= OFN_ENABLESIZING;
/* ofn.lCustData = ;*/
@ -461,22 +454,22 @@ static BOOL ImportRegistryFile(HWND hWnd)
_wcsicmp(ofn.lpstrFile + ofn.nFileExtension, L"reg") == 0) /* REGEDIT4 or Windows Registry Editor Version 5.00 */
{
/* Open the file */
FILE* fp = _wfopen(ofn.lpstrFile, L"r");
FILE* fp = _wfopen(ofn.lpstrFile, L"rb");
/* Import it */
if (fp == NULL || !import_registry_file(fp))
{
/* Error opening the file */
LoadStringW(hInst, IDS_APP_TITLE, szTitle, COUNT_OF(szTitle));
LoadStringW(hInst, IDS_IMPORT_ERROR, szText, COUNT_OF(szText));
LoadStringW(hInst, IDS_APP_TITLE, szTitle, ARRAY_SIZE(szTitle));
LoadStringW(hInst, IDS_IMPORT_ERROR, szText, ARRAY_SIZE(szText));
InfoMessageBox(hWnd, MB_OK | MB_ICONERROR, szTitle, szText, ofn.lpstrFile);
bRet = FALSE;
}
else
{
/* Show successful import */
LoadStringW(hInst, IDS_APP_TITLE, szTitle, COUNT_OF(szTitle));
LoadStringW(hInst, IDS_IMPORT_OK, szText, COUNT_OF(szText));
LoadStringW(hInst, IDS_APP_TITLE, szTitle, ARRAY_SIZE(szTitle));
LoadStringW(hInst, IDS_IMPORT_OK, szText, ARRAY_SIZE(szText));
InfoMessageBox(hWnd, MB_OK | MB_ICONINFORMATION, szTitle, szText, ofn.lpstrFile);
bRet = TRUE;
}
@ -486,8 +479,8 @@ static BOOL ImportRegistryFile(HWND hWnd)
}
else /* Registry Hive Files */
{
LoadStringW(hInst, IDS_QUERY_IMPORT_HIVE_CAPTION, szTitle, COUNT_OF(szTitle));
LoadStringW(hInst, IDS_QUERY_IMPORT_HIVE_MSG, szText, COUNT_OF(szText));
LoadStringW(hInst, IDS_QUERY_IMPORT_HIVE_CAPTION, szTitle, ARRAY_SIZE(szTitle));
LoadStringW(hInst, IDS_QUERY_IMPORT_HIVE_MSG, szText, ARRAY_SIZE(szText));
/* Display a confirmation message */
if (MessageBoxW(g_pChildWnd->hWnd, szText, szTitle, MB_ICONWARNING | MB_YESNO) == IDYES)
@ -595,10 +588,10 @@ BOOL ExportRegistryFile(HWND hWnd)
/* Figure out which key path we are exporting */
pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
GetKeyName(ExportKeyPath, COUNT_OF(ExportKeyPath), hKeyRoot, pszKeyPath);
GetKeyName(ExportKeyPath, ARRAY_SIZE(ExportKeyPath), hKeyRoot, pszKeyPath);
InitOpenFileName(hWnd, &ofn);
LoadStringW(hInst, IDS_EXPORT_REG_FILE, Caption, COUNT_OF(Caption));
LoadStringW(hInst, IDS_EXPORT_REG_FILE, Caption, ARRAY_SIZE(Caption));
ofn.lpstrTitle = Caption;
/* Only set the path if a key (not the root node) is selected */
@ -672,8 +665,8 @@ BOOL ExportRegistryFile(HWND hWnd)
: REG_FORMAT_5)))
{
/* Error creating the file */
LoadStringW(hInst, IDS_APP_TITLE, szTitle, COUNT_OF(szTitle));
LoadStringW(hInst, IDS_EXPORT_ERROR, szText, COUNT_OF(szText));
LoadStringW(hInst, IDS_APP_TITLE, szTitle, ARRAY_SIZE(szTitle));
LoadStringW(hInst, IDS_EXPORT_ERROR, szText, ARRAY_SIZE(szText));
InfoMessageBox(hWnd, MB_OK | MB_ICONERROR, szTitle, szText, ofn.lpstrFile);
bRet = FALSE;
}
@ -803,7 +796,7 @@ BOOL CopyKeyName(HWND hWnd, HKEY hRootKey, LPCWSTR keyName)
if (!EmptyClipboard())
goto done;
if (!GetKeyName(szBuffer, COUNT_OF(szBuffer), hRootKey, keyName))
if (!GetKeyName(szBuffer, ARRAY_SIZE(szBuffer), hRootKey, keyName))
goto done;
hGlobal = GlobalAlloc(GMEM_MOVEABLE, (wcslen(szBuffer) + 1) * sizeof(WCHAR));
@ -838,7 +831,7 @@ static BOOL CreateNewValue(HKEY hRootKey, LPCWSTR pszKeyPath, DWORD dwType)
&hKey) != ERROR_SUCCESS)
return FALSE;
LoadStringW(hInst, IDS_NEW_VALUE, szNewValueFormat, COUNT_OF(szNewValueFormat));
LoadStringW(hInst, IDS_NEW_VALUE, szNewValueFormat, ARRAY_SIZE(szNewValueFormat));
do
{
@ -937,7 +930,7 @@ InitializeRemoteRegistryPicker(OUT IDsObjectPicker **pDsObjectPicker)
InitInfo.cbSize = sizeof(InitInfo);
InitInfo.pwzTargetComputer = NULL;
InitInfo.cDsScopeInfos = COUNT_OF(Scopes);
InitInfo.cDsScopeInfos = ARRAY_SIZE(Scopes);
InitInfo.aDsScopeInfos = Scopes;
InitInfo.flOptions = 0;
InitInfo.cAttributesToFetch = 0;
@ -1068,7 +1061,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
hRet = InvokeRemoteRegistryPickerDialog(ObjectPicker,
hWnd,
szComputerName,
COUNT_OF(szComputerName));
ARRAY_SIZE(szComputerName));
if (hRet == S_OK)
{
/* FIXME - connect to the registry */
@ -1094,7 +1087,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
toggle_child(hWnd, LOWORD(wParam), hStatusBar);
return TRUE;
case ID_HELP_HELPTOPICS:
WinHelpW(hWnd, getAppName(), HELP_FINDER, 0);
WinHelpW(hWnd, L"regedit", HELP_FINDER, 0);
return TRUE;
case ID_HELP_ABOUT:
ShowAboutBox(hWnd);
@ -1169,8 +1162,8 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
if(nSelected >= 1)
{
WCHAR msg[128], caption[128];
LoadStringW(hInst, IDS_QUERY_DELETE_CONFIRM, caption, COUNT_OF(caption));
LoadStringW(hInst, (nSelected == 1 ? IDS_QUERY_DELETE_ONE : IDS_QUERY_DELETE_MORE), msg, COUNT_OF(msg));
LoadStringW(hInst, IDS_QUERY_DELETE_CONFIRM, caption, ARRAY_SIZE(caption));
LoadStringW(hInst, (nSelected == 1 ? IDS_QUERY_DELETE_ONE : IDS_QUERY_DELETE_MORE), msg, ARRAY_SIZE(msg));
if(MessageBoxW(g_pChildWnd->hWnd, msg, caption, MB_ICONQUESTION | MB_YESNO) == IDYES)
{
int ni, errs;
@ -1190,8 +1183,8 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
RefreshListView(g_pChildWnd->hListWnd, hKeyRoot, keyPath);
if(errs > 0)
{
LoadStringW(hInst, IDS_ERR_DELVAL_CAPTION, caption, COUNT_OF(caption));
LoadStringW(hInst, IDS_ERR_DELETEVALUE, msg, COUNT_OF(msg));
LoadStringW(hInst, IDS_ERR_DELVAL_CAPTION, caption, ARRAY_SIZE(caption));
LoadStringW(hInst, IDS_ERR_DELETEVALUE, msg, ARRAY_SIZE(msg));
MessageBoxW(g_pChildWnd->hWnd, msg, caption, MB_ICONSTOP);
}
}
@ -1304,7 +1297,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
mii.fMask = MIIM_TYPE;
mii.fType = MFT_STRING;
mii.dwTypeData = szFavorite;
mii.cch = COUNT_OF(szFavorite);
mii.cch = ARRAY_SIZE(szFavorite);
if (GetMenuItemInfo(hMenu, LOWORD(wParam) - ID_FAVORITES_MIN, TRUE, &mii))
{
@ -1390,7 +1383,7 @@ LRESULT CALLBACK FrameWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
SendMessageW(g_pChildWnd->hTreeWnd, WM_SYSCOLORCHANGE, 0, 0);
break;
case WM_DESTROY:
WinHelpW(hWnd, getAppName(), HELP_QUIT, 0);
WinHelpW(hWnd, L"regedit", HELP_QUIT, 0);
SaveSettings();
PostQuitMessage(0);
default:

View file

@ -15,6 +15,58 @@ BEGIN
VK_F5, ID_VIEW_REFRESH, VIRTKEY, NOINVERT
END
/* Command-line strings */
STRINGTABLE
BEGIN
STRING_USAGE "Usage:\n\
regedit [options] [filename] [reg_key]\n\n\
Options:\n\
[no option] Launch the graphical version of this program.\n\
/L:system.dat The location of the system.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/R:user.dat The location of the user.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/C Import the contents of a registry file.\n\
/D Delete a specified registry key.\n\
/E Export the contents of a specified registry key to a file.\n\
If no key is specified, the entire registry is exported.\n\
/S Silent mode. No messages will be displayed.\n\
/V Launch the GUI in advanced mode. Ignored.\n\
/? Display this information and exit.\n\
[filename] The location of the file containing registry information to\n\
be imported. When used with [/E], this option specifies the\n\
file location where registry information will be exported.\n\
[reg_key] The registry key to be modified.\n\
n\
Usage examples:\n\
regedit ""import.reg""\n\
regedit /E ""export.reg"" ""HKEY_CURRENT_USER\\Console""\n\
regedit /D ""HKEY_LOCAL_MACHINE\\Error\\Path""\n"
STRING_INVALID_SWITCH "regedit: Invalid or unrecognized switch [%1]\n"
STRING_HELP "Type ""regedit /?"" for help.\n"
STRING_NO_FILENAME "regedit: No filename was specified.\n"
STRING_NO_REG_KEY "regedit: No registry key was specified for removal.\n"
STRING_FILE_NOT_FOUND "regedit: The file '%1' was not found.\n"
STRING_CANNOT_OPEN_FILE "regedit: Unable to open the file '%1'.\n"
STRING_UNHANDLED_ACTION "regedit: Unhandled action.\n"
STRING_OUT_OF_MEMORY "regedit: Out of memory! (%1!S!, line %2!u!)\n"
STRING_INVALID_HEX "regedit: Invalid hexadecimal value.\n"
STRING_CSV_HEX_ERROR "regedit: Unable to convert hexadecimal data. An invalid value was encountered at '%1'.\n"
STRING_ESCAPE_SEQUENCE "regedit: Unrecognized escape sequence [\\%1!c!]\n"
STRING_UNKNOWN_DATA_FORMAT "regedit: Unsupported registry data type [0x%1!x!]\n"
STRING_UNEXPECTED_EOL "regedit: Unexpected end of line in '%1'.\n"
STRING_UNRECOGNIZED_LINE "regedit: The line '%1' was not recognized.\n"
STRING_SETVALUE_FAILED "regedit: Unable to add the registry value '%1' to '%2'.\n"
STRING_OPEN_KEY_FAILED "regedit: Unable to open the registry key '%1'.\n"
STRING_UNSUPPORTED_TYPE "regedit: Unsupported registry data type [0x%1!x!] encountered in '%2'.\n"
STRING_EXPORT_AS_BINARY "regedit: The registry value '%1' will be exported as binary data.\n"
STRING_INVALID_SYSTEM_KEY "regedit: Invalid system key [%1]\n"
STRING_REG_KEY_NOT_FOUND "regedit: Unable to export '%1'. The specified registry key was not found.\n"
STRING_DELETE_FAILED "regedit: Unable to delete the registry key '%1'.\n"
STRING_UNKNOWN_TYPE "Unknown Type"
STRING_INVALID_LINE_SYNTAX, "regedit: The line contains invalid syntax.\n"
END
/* Menus */
IDC_REGEDIT MENU

View file

@ -10,6 +10,58 @@ BEGIN
VK_F5, ID_VIEW_REFRESH, VIRTKEY, NOINVERT
END
/* Command-line strings */
STRINGTABLE
BEGIN
STRING_USAGE "Usage:\n\
regedit [options] [filename] [reg_key]\n\n\
Options:\n\
[no option] Launch the graphical version of this program.\n\
/L:system.dat The location of the system.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/R:user.dat The location of the user.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/C Import the contents of a registry file.\n\
/D Delete a specified registry key.\n\
/E Export the contents of a specified registry key to a file.\n\
If no key is specified, the entire registry is exported.\n\
/S Silent mode. No messages will be displayed.\n\
/V Launch the GUI in advanced mode. Ignored.\n\
/? Display this information and exit.\n\
[filename] The location of the file containing registry information to\n\
be imported. When used with [/E], this option specifies the\n\
file location where registry information will be exported.\n\
[reg_key] The registry key to be modified.\n\
n\
Usage examples:\n\
regedit ""import.reg""\n\
regedit /E ""export.reg"" ""HKEY_CURRENT_USER\\Console""\n\
regedit /D ""HKEY_LOCAL_MACHINE\\Error\\Path""\n"
STRING_INVALID_SWITCH "regedit: Invalid or unrecognized switch [%1]\n"
STRING_HELP "Type ""regedit /?"" for help.\n"
STRING_NO_FILENAME "regedit: No filename was specified.\n"
STRING_NO_REG_KEY "regedit: No registry key was specified for removal.\n"
STRING_FILE_NOT_FOUND "regedit: The file '%1' was not found.\n"
STRING_CANNOT_OPEN_FILE "regedit: Unable to open the file '%1'.\n"
STRING_UNHANDLED_ACTION "regedit: Unhandled action.\n"
STRING_OUT_OF_MEMORY "regedit: Out of memory! (%1!S!, line %2!u!)\n"
STRING_INVALID_HEX "regedit: Invalid hexadecimal value.\n"
STRING_CSV_HEX_ERROR "regedit: Unable to convert hexadecimal data. An invalid value was encountered at '%1'.\n"
STRING_ESCAPE_SEQUENCE "regedit: Unrecognized escape sequence [\\%1!c!]\n"
STRING_UNKNOWN_DATA_FORMAT "regedit: Unsupported registry data type [0x%1!x!]\n"
STRING_UNEXPECTED_EOL "regedit: Unexpected end of line in '%1'.\n"
STRING_UNRECOGNIZED_LINE "regedit: The line '%1' was not recognized.\n"
STRING_SETVALUE_FAILED "regedit: Unable to add the registry value '%1' to '%2'.\n"
STRING_OPEN_KEY_FAILED "regedit: Unable to open the registry key '%1'.\n"
STRING_UNSUPPORTED_TYPE "regedit: Unsupported registry data type [0x%1!x!] encountered in '%2'.\n"
STRING_EXPORT_AS_BINARY "regedit: The registry value '%1' will be exported as binary data.\n"
STRING_INVALID_SYSTEM_KEY "regedit: Invalid system key [%1]\n"
STRING_REG_KEY_NOT_FOUND "regedit: Unable to export '%1'. The specified registry key was not found.\n"
STRING_DELETE_FAILED "regedit: Unable to delete the registry key '%1'.\n"
STRING_UNKNOWN_TYPE "Unknown Type"
STRING_INVALID_LINE_SYNTAX, "regedit: The line contains invalid syntax.\n"
END
/* Menus */
IDC_REGEDIT MENU

View file

@ -10,6 +10,58 @@ BEGIN
VK_F5, ID_VIEW_REFRESH, VIRTKEY, NOINVERT
END
/* Command-line strings */
STRINGTABLE
BEGIN
STRING_USAGE "Usage:\n\
regedit [options] [filename] [reg_key]\n\n\
Options:\n\
[no option] Launch the graphical version of this program.\n\
/L:system.dat The location of the system.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/R:user.dat The location of the user.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/C Import the contents of a registry file.\n\
/D Delete a specified registry key.\n\
/E Export the contents of a specified registry key to a file.\n\
If no key is specified, the entire registry is exported.\n\
/S Silent mode. No messages will be displayed.\n\
/V Launch the GUI in advanced mode. Ignored.\n\
/? Display this information and exit.\n\
[filename] The location of the file containing registry information to\n\
be imported. When used with [/E], this option specifies the\n\
file location where registry information will be exported.\n\
[reg_key] The registry key to be modified.\n\
n\
Usage examples:\n\
regedit ""import.reg""\n\
regedit /E ""export.reg"" ""HKEY_CURRENT_USER\\Console""\n\
regedit /D ""HKEY_LOCAL_MACHINE\\Error\\Path""\n"
STRING_INVALID_SWITCH "regedit: Invalid or unrecognized switch [%1]\n"
STRING_HELP "Type ""regedit /?"" for help.\n"
STRING_NO_FILENAME "regedit: No filename was specified.\n"
STRING_NO_REG_KEY "regedit: No registry key was specified for removal.\n"
STRING_FILE_NOT_FOUND "regedit: The file '%1' was not found.\n"
STRING_CANNOT_OPEN_FILE "regedit: Unable to open the file '%1'.\n"
STRING_UNHANDLED_ACTION "regedit: Unhandled action.\n"
STRING_OUT_OF_MEMORY "regedit: Out of memory! (%1!S!, line %2!u!)\n"
STRING_INVALID_HEX "regedit: Invalid hexadecimal value.\n"
STRING_CSV_HEX_ERROR "regedit: Unable to convert hexadecimal data. An invalid value was encountered at '%1'.\n"
STRING_ESCAPE_SEQUENCE "regedit: Unrecognized escape sequence [\\%1!c!]\n"
STRING_UNKNOWN_DATA_FORMAT "regedit: Unsupported registry data type [0x%1!x!]\n"
STRING_UNEXPECTED_EOL "regedit: Unexpected end of line in '%1'.\n"
STRING_UNRECOGNIZED_LINE "regedit: The line '%1' was not recognized.\n"
STRING_SETVALUE_FAILED "regedit: Unable to add the registry value '%1' to '%2'.\n"
STRING_OPEN_KEY_FAILED "regedit: Unable to open the registry key '%1'.\n"
STRING_UNSUPPORTED_TYPE "regedit: Unsupported registry data type [0x%1!x!] encountered in '%2'.\n"
STRING_EXPORT_AS_BINARY "regedit: The registry value '%1' will be exported as binary data.\n"
STRING_INVALID_SYSTEM_KEY "regedit: Invalid system key [%1]\n"
STRING_REG_KEY_NOT_FOUND "regedit: Unable to export '%1'. The specified registry key was not found.\n"
STRING_DELETE_FAILED "regedit: Unable to delete the registry key '%1'.\n"
STRING_UNKNOWN_TYPE "Unknown Type"
STRING_INVALID_LINE_SYNTAX, "regedit: The line contains invalid syntax.\n"
END
/* Menus */
IDC_REGEDIT MENU

View file

@ -10,6 +10,58 @@ BEGIN
VK_F5, ID_VIEW_REFRESH, VIRTKEY, NOINVERT
END
/* Command-line strings */
STRINGTABLE
BEGIN
STRING_USAGE "Usage:\n\
regedit [options] [filename] [reg_key]\n\n\
Options:\n\
[no option] Launch the graphical version of this program.\n\
/L:system.dat The location of the system.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/R:user.dat The location of the user.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/C Import the contents of a registry file.\n\
/D Delete a specified registry key.\n\
/E Export the contents of a specified registry key to a file.\n\
If no key is specified, the entire registry is exported.\n\
/S Silent mode. No messages will be displayed.\n\
/V Launch the GUI in advanced mode. Ignored.\n\
/? Display this information and exit.\n\
[filename] The location of the file containing registry information to\n\
be imported. When used with [/E], this option specifies the\n\
file location where registry information will be exported.\n\
[reg_key] The registry key to be modified.\n\
n\
Usage examples:\n\
regedit ""import.reg""\n\
regedit /E ""export.reg"" ""HKEY_CURRENT_USER\\Console""\n\
regedit /D ""HKEY_LOCAL_MACHINE\\Error\\Path""\n"
STRING_INVALID_SWITCH "regedit: Invalid or unrecognized switch [%1]\n"
STRING_HELP "Type ""regedit /?"" for help.\n"
STRING_NO_FILENAME "regedit: No filename was specified.\n"
STRING_NO_REG_KEY "regedit: No registry key was specified for removal.\n"
STRING_FILE_NOT_FOUND "regedit: The file '%1' was not found.\n"
STRING_CANNOT_OPEN_FILE "regedit: Unable to open the file '%1'.\n"
STRING_UNHANDLED_ACTION "regedit: Unhandled action.\n"
STRING_OUT_OF_MEMORY "regedit: Out of memory! (%1!S!, line %2!u!)\n"
STRING_INVALID_HEX "regedit: Invalid hexadecimal value.\n"
STRING_CSV_HEX_ERROR "regedit: Unable to convert hexadecimal data. An invalid value was encountered at '%1'.\n"
STRING_ESCAPE_SEQUENCE "regedit: Unrecognized escape sequence [\\%1!c!]\n"
STRING_UNKNOWN_DATA_FORMAT "regedit: Unsupported registry data type [0x%1!x!]\n"
STRING_UNEXPECTED_EOL "regedit: Unexpected end of line in '%1'.\n"
STRING_UNRECOGNIZED_LINE "regedit: The line '%1' was not recognized.\n"
STRING_SETVALUE_FAILED "regedit: Unable to add the registry value '%1' to '%2'.\n"
STRING_OPEN_KEY_FAILED "regedit: Unable to open the registry key '%1'.\n"
STRING_UNSUPPORTED_TYPE "regedit: Unsupported registry data type [0x%1!x!] encountered in '%2'.\n"
STRING_EXPORT_AS_BINARY "regedit: The registry value '%1' will be exported as binary data.\n"
STRING_INVALID_SYSTEM_KEY "regedit: Invalid system key [%1]\n"
STRING_REG_KEY_NOT_FOUND "regedit: Unable to export '%1'. The specified registry key was not found.\n"
STRING_DELETE_FAILED "regedit: Unable to delete the registry key '%1'.\n"
STRING_UNKNOWN_TYPE "Unknown Type"
STRING_INVALID_LINE_SYNTAX, "regedit: The line contains invalid syntax.\n"
END
/* Menus */
IDC_REGEDIT MENU

View file

@ -10,6 +10,58 @@ BEGIN
VK_F5, ID_VIEW_REFRESH, VIRTKEY, NOINVERT
END
/* Command-line strings */
STRINGTABLE
BEGIN
STRING_USAGE "Usage:\n\
regedit [options] [filename] [reg_key]\n\n\
Options:\n\
[no option] Launch the graphical version of this program.\n\
/L:system.dat The location of the system.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/R:user.dat The location of the user.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/C Import the contents of a registry file.\n\
/D Delete a specified registry key.\n\
/E Export the contents of a specified registry key to a file.\n\
If no key is specified, the entire registry is exported.\n\
/S Silent mode. No messages will be displayed.\n\
/V Launch the GUI in advanced mode. Ignored.\n\
/? Display this information and exit.\n\
[filename] The location of the file containing registry information to\n\
be imported. When used with [/E], this option specifies the\n\
file location where registry information will be exported.\n\
[reg_key] The registry key to be modified.\n\
n\
Usage examples:\n\
regedit ""import.reg""\n\
regedit /E ""export.reg"" ""HKEY_CURRENT_USER\\Console""\n\
regedit /D ""HKEY_LOCAL_MACHINE\\Error\\Path""\n"
STRING_INVALID_SWITCH "regedit: Invalid or unrecognized switch [%1]\n"
STRING_HELP "Type ""regedit /?"" for help.\n"
STRING_NO_FILENAME "regedit: No filename was specified.\n"
STRING_NO_REG_KEY "regedit: No registry key was specified for removal.\n"
STRING_FILE_NOT_FOUND "regedit: The file '%1' was not found.\n"
STRING_CANNOT_OPEN_FILE "regedit: Unable to open the file '%1'.\n"
STRING_UNHANDLED_ACTION "regedit: Unhandled action.\n"
STRING_OUT_OF_MEMORY "regedit: Out of memory! (%1!S!, line %2!u!)\n"
STRING_INVALID_HEX "regedit: Invalid hexadecimal value.\n"
STRING_CSV_HEX_ERROR "regedit: Unable to convert hexadecimal data. An invalid value was encountered at '%1'.\n"
STRING_ESCAPE_SEQUENCE "regedit: Unrecognized escape sequence [\\%1!c!]\n"
STRING_UNKNOWN_DATA_FORMAT "regedit: Unsupported registry data type [0x%1!x!]\n"
STRING_UNEXPECTED_EOL "regedit: Unexpected end of line in '%1'.\n"
STRING_UNRECOGNIZED_LINE "regedit: The line '%1' was not recognized.\n"
STRING_SETVALUE_FAILED "regedit: Unable to add the registry value '%1' to '%2'.\n"
STRING_OPEN_KEY_FAILED "regedit: Unable to open the registry key '%1'.\n"
STRING_UNSUPPORTED_TYPE "regedit: Unsupported registry data type [0x%1!x!] encountered in '%2'.\n"
STRING_EXPORT_AS_BINARY "regedit: The registry value '%1' will be exported as binary data.\n"
STRING_INVALID_SYSTEM_KEY "regedit: Invalid system key [%1]\n"
STRING_REG_KEY_NOT_FOUND "regedit: Unable to export '%1'. The specified registry key was not found.\n"
STRING_DELETE_FAILED "regedit: Unable to delete the registry key '%1'.\n"
STRING_UNKNOWN_TYPE "Unknown Type"
STRING_INVALID_LINE_SYNTAX, "regedit: The line contains invalid syntax.\n"
END
/* Menus */
IDC_REGEDIT MENU

View file

@ -13,6 +13,58 @@ BEGIN
VK_F5, ID_VIEW_REFRESH, VIRTKEY, NOINVERT
END
/* Command-line strings */
STRINGTABLE
BEGIN
STRING_USAGE "Usage:\n\
regedit [options] [filename] [reg_key]\n\n\
Options:\n\
[no option] Launch the graphical version of this program.\n\
/L:system.dat The location of the system.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/R:user.dat The location of the user.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/C Import the contents of a registry file.\n\
/D Delete a specified registry key.\n\
/E Export the contents of a specified registry key to a file.\n\
If no key is specified, the entire registry is exported.\n\
/S Silent mode. No messages will be displayed.\n\
/V Launch the GUI in advanced mode. Ignored.\n\
/? Display this information and exit.\n\
[filename] The location of the file containing registry information to\n\
be imported. When used with [/E], this option specifies the\n\
file location where registry information will be exported.\n\
[reg_key] The registry key to be modified.\n\
n\
Usage examples:\n\
regedit ""import.reg""\n\
regedit /E ""export.reg"" ""HKEY_CURRENT_USER\\Console""\n\
regedit /D ""HKEY_LOCAL_MACHINE\\Error\\Path""\n"
STRING_INVALID_SWITCH "regedit: Invalid or unrecognized switch [%1]\n"
STRING_HELP "Type ""regedit /?"" for help.\n"
STRING_NO_FILENAME "regedit: No filename was specified.\n"
STRING_NO_REG_KEY "regedit: No registry key was specified for removal.\n"
STRING_FILE_NOT_FOUND "regedit: The file '%1' was not found.\n"
STRING_CANNOT_OPEN_FILE "regedit: Unable to open the file '%1'.\n"
STRING_UNHANDLED_ACTION "regedit: Unhandled action.\n"
STRING_OUT_OF_MEMORY "regedit: Out of memory! (%1!S!, line %2!u!)\n"
STRING_INVALID_HEX "regedit: Invalid hexadecimal value.\n"
STRING_CSV_HEX_ERROR "regedit: Unable to convert hexadecimal data. An invalid value was encountered at '%1'.\n"
STRING_ESCAPE_SEQUENCE "regedit: Unrecognized escape sequence [\\%1!c!]\n"
STRING_UNKNOWN_DATA_FORMAT "regedit: Unsupported registry data type [0x%1!x!]\n"
STRING_UNEXPECTED_EOL "regedit: Unexpected end of line in '%1'.\n"
STRING_UNRECOGNIZED_LINE "regedit: The line '%1' was not recognized.\n"
STRING_SETVALUE_FAILED "regedit: Unable to add the registry value '%1' to '%2'.\n"
STRING_OPEN_KEY_FAILED "regedit: Unable to open the registry key '%1'.\n"
STRING_UNSUPPORTED_TYPE "regedit: Unsupported registry data type [0x%1!x!] encountered in '%2'.\n"
STRING_EXPORT_AS_BINARY "regedit: The registry value '%1' will be exported as binary data.\n"
STRING_INVALID_SYSTEM_KEY "regedit: Invalid system key [%1]\n"
STRING_REG_KEY_NOT_FOUND "regedit: Unable to export '%1'. The specified registry key was not found.\n"
STRING_DELETE_FAILED "regedit: Unable to delete the registry key '%1'.\n"
STRING_UNKNOWN_TYPE "Unknown Type"
STRING_INVALID_LINE_SYNTAX, "regedit: The line contains invalid syntax.\n"
END
/* Menus */
IDC_REGEDIT MENU

View file

@ -10,6 +10,58 @@ BEGIN
VK_F5, ID_VIEW_REFRESH, VIRTKEY, NOINVERT
END
/* Command-line strings */
STRINGTABLE
BEGIN
STRING_USAGE "Usage:\n\
regedit [options] [filename] [reg_key]\n\n\
Options:\n\
[no option] Launch the graphical version of this program.\n\
/L:system.dat The location of the system.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/R:user.dat The location of the user.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/C Import the contents of a registry file.\n\
/D Delete a specified registry key.\n\
/E Export the contents of a specified registry key to a file.\n\
If no key is specified, the entire registry is exported.\n\
/S Silent mode. No messages will be displayed.\n\
/V Launch the GUI in advanced mode. Ignored.\n\
/? Display this information and exit.\n\
[filename] The location of the file containing registry information to\n\
be imported. When used with [/E], this option specifies the\n\
file location where registry information will be exported.\n\
[reg_key] The registry key to be modified.\n\
n\
Usage examples:\n\
regedit ""import.reg""\n\
regedit /E ""export.reg"" ""HKEY_CURRENT_USER\\Console""\n\
regedit /D ""HKEY_LOCAL_MACHINE\\Error\\Path""\n"
STRING_INVALID_SWITCH "regedit: Invalid or unrecognized switch [%1]\n"
STRING_HELP "Type ""regedit /?"" for help.\n"
STRING_NO_FILENAME "regedit: No filename was specified.\n"
STRING_NO_REG_KEY "regedit: No registry key was specified for removal.\n"
STRING_FILE_NOT_FOUND "regedit: The file '%1' was not found.\n"
STRING_CANNOT_OPEN_FILE "regedit: Unable to open the file '%1'.\n"
STRING_UNHANDLED_ACTION "regedit: Unhandled action.\n"
STRING_OUT_OF_MEMORY "regedit: Out of memory! (%1!S!, line %2!u!)\n"
STRING_INVALID_HEX "regedit: Invalid hexadecimal value.\n"
STRING_CSV_HEX_ERROR "regedit: Unable to convert hexadecimal data. An invalid value was encountered at '%1'.\n"
STRING_ESCAPE_SEQUENCE "regedit: Unrecognized escape sequence [\\%1!c!]\n"
STRING_UNKNOWN_DATA_FORMAT "regedit: Unsupported registry data type [0x%1!x!]\n"
STRING_UNEXPECTED_EOL "regedit: Unexpected end of line in '%1'.\n"
STRING_UNRECOGNIZED_LINE "regedit: The line '%1' was not recognized.\n"
STRING_SETVALUE_FAILED "regedit: Unable to add the registry value '%1' to '%2'.\n"
STRING_OPEN_KEY_FAILED "regedit: Unable to open the registry key '%1'.\n"
STRING_UNSUPPORTED_TYPE "regedit: Unsupported registry data type [0x%1!x!] encountered in '%2'.\n"
STRING_EXPORT_AS_BINARY "regedit: The registry value '%1' will be exported as binary data.\n"
STRING_INVALID_SYSTEM_KEY "regedit: Invalid system key [%1]\n"
STRING_REG_KEY_NOT_FOUND "regedit: Unable to export '%1'. The specified registry key was not found.\n"
STRING_DELETE_FAILED "regedit: Unable to delete the registry key '%1'.\n"
STRING_UNKNOWN_TYPE "Unknown Type"
STRING_INVALID_LINE_SYNTAX, "regedit: The line contains invalid syntax.\n"
END
/* Menus */
IDC_REGEDIT MENU

View file

@ -10,6 +10,58 @@ BEGIN
VK_F5, ID_VIEW_REFRESH, VIRTKEY, NOINVERT
END
/* Command-line strings */
STRINGTABLE
BEGIN
STRING_USAGE "Usage:\n\
regedit [options] [filename] [reg_key]\n\n\
Options:\n\
[no option] Launch the graphical version of this program.\n\
/L:system.dat The location of the system.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/R:user.dat The location of the user.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/C Import the contents of a registry file.\n\
/D Delete a specified registry key.\n\
/E Export the contents of a specified registry key to a file.\n\
If no key is specified, the entire registry is exported.\n\
/S Silent mode. No messages will be displayed.\n\
/V Launch the GUI in advanced mode. Ignored.\n\
/? Display this information and exit.\n\
[filename] The location of the file containing registry information to\n\
be imported. When used with [/E], this option specifies the\n\
file location where registry information will be exported.\n\
[reg_key] The registry key to be modified.\n\
n\
Usage examples:\n\
regedit ""import.reg""\n\
regedit /E ""export.reg"" ""HKEY_CURRENT_USER\\Console""\n\
regedit /D ""HKEY_LOCAL_MACHINE\\Error\\Path""\n"
STRING_INVALID_SWITCH "regedit: Invalid or unrecognized switch [%1]\n"
STRING_HELP "Type ""regedit /?"" for help.\n"
STRING_NO_FILENAME "regedit: No filename was specified.\n"
STRING_NO_REG_KEY "regedit: No registry key was specified for removal.\n"
STRING_FILE_NOT_FOUND "regedit: The file '%1' was not found.\n"
STRING_CANNOT_OPEN_FILE "regedit: Unable to open the file '%1'.\n"
STRING_UNHANDLED_ACTION "regedit: Unhandled action.\n"
STRING_OUT_OF_MEMORY "regedit: Out of memory! (%1!S!, line %2!u!)\n"
STRING_INVALID_HEX "regedit: Invalid hexadecimal value.\n"
STRING_CSV_HEX_ERROR "regedit: Unable to convert hexadecimal data. An invalid value was encountered at '%1'.\n"
STRING_ESCAPE_SEQUENCE "regedit: Unrecognized escape sequence [\\%1!c!]\n"
STRING_UNKNOWN_DATA_FORMAT "regedit: Unsupported registry data type [0x%1!x!]\n"
STRING_UNEXPECTED_EOL "regedit: Unexpected end of line in '%1'.\n"
STRING_UNRECOGNIZED_LINE "regedit: The line '%1' was not recognized.\n"
STRING_SETVALUE_FAILED "regedit: Unable to add the registry value '%1' to '%2'.\n"
STRING_OPEN_KEY_FAILED "regedit: Unable to open the registry key '%1'.\n"
STRING_UNSUPPORTED_TYPE "regedit: Unsupported registry data type [0x%1!x!] encountered in '%2'.\n"
STRING_EXPORT_AS_BINARY "regedit: The registry value '%1' will be exported as binary data.\n"
STRING_INVALID_SYSTEM_KEY "regedit: Invalid system key [%1]\n"
STRING_REG_KEY_NOT_FOUND "regedit: Unable to export '%1'. The specified registry key was not found.\n"
STRING_DELETE_FAILED "regedit: Unable to delete the registry key '%1'.\n"
STRING_UNKNOWN_TYPE "Unknown Type"
STRING_INVALID_LINE_SYNTAX, "regedit: The line contains invalid syntax.\n"
END
/* Menus */
IDC_REGEDIT MENU

View file

@ -10,6 +10,58 @@ BEGIN
VK_F5, ID_VIEW_REFRESH, VIRTKEY, NOINVERT
END
/* Command-line strings */
STRINGTABLE
BEGIN
STRING_USAGE "Usage:\n\
regedit [options] [filename] [reg_key]\n\n\
Options:\n\
[no option] Launch the graphical version of this program.\n\
/L:system.dat The location of the system.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/R:user.dat The location of the user.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/C Import the contents of a registry file.\n\
/D Delete a specified registry key.\n\
/E Export the contents of a specified registry key to a file.\n\
If no key is specified, the entire registry is exported.\n\
/S Silent mode. No messages will be displayed.\n\
/V Launch the GUI in advanced mode. Ignored.\n\
/? Display this information and exit.\n\
[filename] The location of the file containing registry information to\n\
be imported. When used with [/E], this option specifies the\n\
file location where registry information will be exported.\n\
[reg_key] The registry key to be modified.\n\
n\
Usage examples:\n\
regedit ""import.reg""\n\
regedit /E ""export.reg"" ""HKEY_CURRENT_USER\\Console""\n\
regedit /D ""HKEY_LOCAL_MACHINE\\Error\\Path""\n"
STRING_INVALID_SWITCH "regedit: Invalid or unrecognized switch [%1]\n"
STRING_HELP "Type ""regedit /?"" for help.\n"
STRING_NO_FILENAME "regedit: No filename was specified.\n"
STRING_NO_REG_KEY "regedit: No registry key was specified for removal.\n"
STRING_FILE_NOT_FOUND "regedit: The file '%1' was not found.\n"
STRING_CANNOT_OPEN_FILE "regedit: Unable to open the file '%1'.\n"
STRING_UNHANDLED_ACTION "regedit: Unhandled action.\n"
STRING_OUT_OF_MEMORY "regedit: Out of memory! (%1!S!, line %2!u!)\n"
STRING_INVALID_HEX "regedit: Invalid hexadecimal value.\n"
STRING_CSV_HEX_ERROR "regedit: Unable to convert hexadecimal data. An invalid value was encountered at '%1'.\n"
STRING_ESCAPE_SEQUENCE "regedit: Unrecognized escape sequence [\\%1!c!]\n"
STRING_UNKNOWN_DATA_FORMAT "regedit: Unsupported registry data type [0x%1!x!]\n"
STRING_UNEXPECTED_EOL "regedit: Unexpected end of line in '%1'.\n"
STRING_UNRECOGNIZED_LINE "regedit: The line '%1' was not recognized.\n"
STRING_SETVALUE_FAILED "regedit: Unable to add the registry value '%1' to '%2'.\n"
STRING_OPEN_KEY_FAILED "regedit: Unable to open the registry key '%1'.\n"
STRING_UNSUPPORTED_TYPE "regedit: Unsupported registry data type [0x%1!x!] encountered in '%2'.\n"
STRING_EXPORT_AS_BINARY "regedit: The registry value '%1' will be exported as binary data.\n"
STRING_INVALID_SYSTEM_KEY "regedit: Invalid system key [%1]\n"
STRING_REG_KEY_NOT_FOUND "regedit: Unable to export '%1'. The specified registry key was not found.\n"
STRING_DELETE_FAILED "regedit: Unable to delete the registry key '%1'.\n"
STRING_UNKNOWN_TYPE "Unknown Type"
STRING_INVALID_LINE_SYNTAX, "regedit: The line contains invalid syntax.\n"
END
/* Menus */
IDC_REGEDIT MENU

View file

@ -10,6 +10,58 @@ BEGIN
VK_F5, ID_VIEW_REFRESH, VIRTKEY, NOINVERT
END
/* Command-line strings */
STRINGTABLE
BEGIN
STRING_USAGE "Usage:\n\
regedit [options] [filename] [reg_key]\n\n\
Options:\n\
[no option] Launch the graphical version of this program.\n\
/L:system.dat The location of the system.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/R:user.dat The location of the user.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/C Import the contents of a registry file.\n\
/D Delete a specified registry key.\n\
/E Export the contents of a specified registry key to a file.\n\
If no key is specified, the entire registry is exported.\n\
/S Silent mode. No messages will be displayed.\n\
/V Launch the GUI in advanced mode. Ignored.\n\
/? Display this information and exit.\n\
[filename] The location of the file containing registry information to\n\
be imported. When used with [/E], this option specifies the\n\
file location where registry information will be exported.\n\
[reg_key] The registry key to be modified.\n\
n\
Usage examples:\n\
regedit ""import.reg""\n\
regedit /E ""export.reg"" ""HKEY_CURRENT_USER\\Console""\n\
regedit /D ""HKEY_LOCAL_MACHINE\\Error\\Path""\n"
STRING_INVALID_SWITCH "regedit: Invalid or unrecognized switch [%1]\n"
STRING_HELP "Type ""regedit /?"" for help.\n"
STRING_NO_FILENAME "regedit: No filename was specified.\n"
STRING_NO_REG_KEY "regedit: No registry key was specified for removal.\n"
STRING_FILE_NOT_FOUND "regedit: The file '%1' was not found.\n"
STRING_CANNOT_OPEN_FILE "regedit: Unable to open the file '%1'.\n"
STRING_UNHANDLED_ACTION "regedit: Unhandled action.\n"
STRING_OUT_OF_MEMORY "regedit: Out of memory! (%1!S!, line %2!u!)\n"
STRING_INVALID_HEX "regedit: Invalid hexadecimal value.\n"
STRING_CSV_HEX_ERROR "regedit: Unable to convert hexadecimal data. An invalid value was encountered at '%1'.\n"
STRING_ESCAPE_SEQUENCE "regedit: Unrecognized escape sequence [\\%1!c!]\n"
STRING_UNKNOWN_DATA_FORMAT "regedit: Unsupported registry data type [0x%1!x!]\n"
STRING_UNEXPECTED_EOL "regedit: Unexpected end of line in '%1'.\n"
STRING_UNRECOGNIZED_LINE "regedit: The line '%1' was not recognized.\n"
STRING_SETVALUE_FAILED "regedit: Unable to add the registry value '%1' to '%2'.\n"
STRING_OPEN_KEY_FAILED "regedit: Unable to open the registry key '%1'.\n"
STRING_UNSUPPORTED_TYPE "regedit: Unsupported registry data type [0x%1!x!] encountered in '%2'.\n"
STRING_EXPORT_AS_BINARY "regedit: The registry value '%1' will be exported as binary data.\n"
STRING_INVALID_SYSTEM_KEY "regedit: Invalid system key [%1]\n"
STRING_REG_KEY_NOT_FOUND "regedit: Unable to export '%1'. The specified registry key was not found.\n"
STRING_DELETE_FAILED "regedit: Unable to delete the registry key '%1'.\n"
STRING_UNKNOWN_TYPE "Unknown Type"
STRING_INVALID_LINE_SYNTAX, "regedit: The line contains invalid syntax.\n"
END
/* Menus */
IDC_REGEDIT MENU

View file

@ -10,6 +10,58 @@ BEGIN
VK_F5, ID_VIEW_REFRESH, VIRTKEY, NOINVERT
END
/* Command-line strings */
STRINGTABLE
BEGIN
STRING_USAGE "Usage:\n\
regedit [options] [filename] [reg_key]\n\n\
Options:\n\
[no option] Launch the graphical version of this program.\n\
/L:system.dat The location of the system.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/R:user.dat The location of the user.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/C Import the contents of a registry file.\n\
/D Delete a specified registry key.\n\
/E Export the contents of a specified registry key to a file.\n\
If no key is specified, the entire registry is exported.\n\
/S Silent mode. No messages will be displayed.\n\
/V Launch the GUI in advanced mode. Ignored.\n\
/? Display this information and exit.\n\
[filename] The location of the file containing registry information to\n\
be imported. When used with [/E], this option specifies the\n\
file location where registry information will be exported.\n\
[reg_key] The registry key to be modified.\n\
n\
Usage examples:\n\
regedit ""import.reg""\n\
regedit /E ""export.reg"" ""HKEY_CURRENT_USER\\Console""\n\
regedit /D ""HKEY_LOCAL_MACHINE\\Error\\Path""\n"
STRING_INVALID_SWITCH "regedit: Invalid or unrecognized switch [%1]\n"
STRING_HELP "Type ""regedit /?"" for help.\n"
STRING_NO_FILENAME "regedit: No filename was specified.\n"
STRING_NO_REG_KEY "regedit: No registry key was specified for removal.\n"
STRING_FILE_NOT_FOUND "regedit: The file '%1' was not found.\n"
STRING_CANNOT_OPEN_FILE "regedit: Unable to open the file '%1'.\n"
STRING_UNHANDLED_ACTION "regedit: Unhandled action.\n"
STRING_OUT_OF_MEMORY "regedit: Out of memory! (%1!S!, line %2!u!)\n"
STRING_INVALID_HEX "regedit: Invalid hexadecimal value.\n"
STRING_CSV_HEX_ERROR "regedit: Unable to convert hexadecimal data. An invalid value was encountered at '%1'.\n"
STRING_ESCAPE_SEQUENCE "regedit: Unrecognized escape sequence [\\%1!c!]\n"
STRING_UNKNOWN_DATA_FORMAT "regedit: Unsupported registry data type [0x%1!x!]\n"
STRING_UNEXPECTED_EOL "regedit: Unexpected end of line in '%1'.\n"
STRING_UNRECOGNIZED_LINE "regedit: The line '%1' was not recognized.\n"
STRING_SETVALUE_FAILED "regedit: Unable to add the registry value '%1' to '%2'.\n"
STRING_OPEN_KEY_FAILED "regedit: Unable to open the registry key '%1'.\n"
STRING_UNSUPPORTED_TYPE "regedit: Unsupported registry data type [0x%1!x!] encountered in '%2'.\n"
STRING_EXPORT_AS_BINARY "regedit: The registry value '%1' will be exported as binary data.\n"
STRING_INVALID_SYSTEM_KEY "regedit: Invalid system key [%1]\n"
STRING_REG_KEY_NOT_FOUND "regedit: Unable to export '%1'. The specified registry key was not found.\n"
STRING_DELETE_FAILED "regedit: Unable to delete the registry key '%1'.\n"
STRING_UNKNOWN_TYPE "Unknown Type"
STRING_INVALID_LINE_SYNTAX, "regedit: The line contains invalid syntax.\n"
END
/* Menus */
IDC_REGEDIT MENU

View file

@ -10,6 +10,58 @@ BEGIN
VK_F5, ID_VIEW_REFRESH, VIRTKEY, NOINVERT
END
/* Command-line strings */
STRINGTABLE
BEGIN
STRING_USAGE "Usage:\n\
regedit [options] [filename] [reg_key]\n\n\
Options:\n\
[no option] Launch the graphical version of this program.\n\
/L:system.dat The location of the system.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/R:user.dat The location of the user.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/C Import the contents of a registry file.\n\
/D Delete a specified registry key.\n\
/E Export the contents of a specified registry key to a file.\n\
If no key is specified, the entire registry is exported.\n\
/S Silent mode. No messages will be displayed.\n\
/V Launch the GUI in advanced mode. Ignored.\n\
/? Display this information and exit.\n\
[filename] The location of the file containing registry information to\n\
be imported. When used with [/E], this option specifies the\n\
file location where registry information will be exported.\n\
[reg_key] The registry key to be modified.\n\
n\
Usage examples:\n\
regedit ""import.reg""\n\
regedit /E ""export.reg"" ""HKEY_CURRENT_USER\\Console""\n\
regedit /D ""HKEY_LOCAL_MACHINE\\Error\\Path""\n"
STRING_INVALID_SWITCH "regedit: Invalid or unrecognized switch [%1]\n"
STRING_HELP "Type ""regedit /?"" for help.\n"
STRING_NO_FILENAME "regedit: No filename was specified.\n"
STRING_NO_REG_KEY "regedit: No registry key was specified for removal.\n"
STRING_FILE_NOT_FOUND "regedit: The file '%1' was not found.\n"
STRING_CANNOT_OPEN_FILE "regedit: Unable to open the file '%1'.\n"
STRING_UNHANDLED_ACTION "regedit: Unhandled action.\n"
STRING_OUT_OF_MEMORY "regedit: Out of memory! (%1!S!, line %2!u!)\n"
STRING_INVALID_HEX "regedit: Invalid hexadecimal value.\n"
STRING_CSV_HEX_ERROR "regedit: Unable to convert hexadecimal data. An invalid value was encountered at '%1'.\n"
STRING_ESCAPE_SEQUENCE "regedit: Unrecognized escape sequence [\\%1!c!]\n"
STRING_UNKNOWN_DATA_FORMAT "regedit: Unsupported registry data type [0x%1!x!]\n"
STRING_UNEXPECTED_EOL "regedit: Unexpected end of line in '%1'.\n"
STRING_UNRECOGNIZED_LINE "regedit: The line '%1' was not recognized.\n"
STRING_SETVALUE_FAILED "regedit: Unable to add the registry value '%1' to '%2'.\n"
STRING_OPEN_KEY_FAILED "regedit: Unable to open the registry key '%1'.\n"
STRING_UNSUPPORTED_TYPE "regedit: Unsupported registry data type [0x%1!x!] encountered in '%2'.\n"
STRING_EXPORT_AS_BINARY "regedit: The registry value '%1' will be exported as binary data.\n"
STRING_INVALID_SYSTEM_KEY "regedit: Invalid system key [%1]\n"
STRING_REG_KEY_NOT_FOUND "regedit: Unable to export '%1'. The specified registry key was not found.\n"
STRING_DELETE_FAILED "regedit: Unable to delete the registry key '%1'.\n"
STRING_UNKNOWN_TYPE "Unknown Type"
STRING_INVALID_LINE_SYNTAX, "regedit: The line contains invalid syntax.\n"
END
/* Menus */
IDC_REGEDIT MENU

View file

@ -12,6 +12,58 @@ BEGIN
VK_F5, ID_VIEW_REFRESH, VIRTKEY, NOINVERT
END
/* Command-line strings */
STRINGTABLE
BEGIN
STRING_USAGE "Usage:\n\
regedit [options] [filename] [reg_key]\n\n\
Options:\n\
[no option] Launch the graphical version of this program.\n\
/L:system.dat The location of the system.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/R:user.dat The location of the user.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/C Import the contents of a registry file.\n\
/D Delete a specified registry key.\n\
/E Export the contents of a specified registry key to a file.\n\
If no key is specified, the entire registry is exported.\n\
/S Silent mode. No messages will be displayed.\n\
/V Launch the GUI in advanced mode. Ignored.\n\
/? Display this information and exit.\n\
[filename] The location of the file containing registry information to\n\
be imported. When used with [/E], this option specifies the\n\
file location where registry information will be exported.\n\
[reg_key] The registry key to be modified.\n\
n\
Usage examples:\n\
regedit ""import.reg""\n\
regedit /E ""export.reg"" ""HKEY_CURRENT_USER\\Console""\n\
regedit /D ""HKEY_LOCAL_MACHINE\\Error\\Path""\n"
STRING_INVALID_SWITCH "regedit: Invalid or unrecognized switch [%1]\n"
STRING_HELP "Type ""regedit /?"" for help.\n"
STRING_NO_FILENAME "regedit: No filename was specified.\n"
STRING_NO_REG_KEY "regedit: No registry key was specified for removal.\n"
STRING_FILE_NOT_FOUND "regedit: The file '%1' was not found.\n"
STRING_CANNOT_OPEN_FILE "regedit: Unable to open the file '%1'.\n"
STRING_UNHANDLED_ACTION "regedit: Unhandled action.\n"
STRING_OUT_OF_MEMORY "regedit: Out of memory! (%1!S!, line %2!u!)\n"
STRING_INVALID_HEX "regedit: Invalid hexadecimal value.\n"
STRING_CSV_HEX_ERROR "regedit: Unable to convert hexadecimal data. An invalid value was encountered at '%1'.\n"
STRING_ESCAPE_SEQUENCE "regedit: Unrecognized escape sequence [\\%1!c!]\n"
STRING_UNKNOWN_DATA_FORMAT "regedit: Unsupported registry data type [0x%1!x!]\n"
STRING_UNEXPECTED_EOL "regedit: Unexpected end of line in '%1'.\n"
STRING_UNRECOGNIZED_LINE "regedit: The line '%1' was not recognized.\n"
STRING_SETVALUE_FAILED "regedit: Unable to add the registry value '%1' to '%2'.\n"
STRING_OPEN_KEY_FAILED "regedit: Unable to open the registry key '%1'.\n"
STRING_UNSUPPORTED_TYPE "regedit: Unsupported registry data type [0x%1!x!] encountered in '%2'.\n"
STRING_EXPORT_AS_BINARY "regedit: The registry value '%1' will be exported as binary data.\n"
STRING_INVALID_SYSTEM_KEY "regedit: Invalid system key [%1]\n"
STRING_REG_KEY_NOT_FOUND "regedit: Unable to export '%1'. The specified registry key was not found.\n"
STRING_DELETE_FAILED "regedit: Unable to delete the registry key '%1'.\n"
STRING_UNKNOWN_TYPE "Unknown Type"
STRING_INVALID_LINE_SYNTAX, "regedit: The line contains invalid syntax.\n"
END
/* Menus */
IDC_REGEDIT MENU

View file

@ -10,6 +10,58 @@ BEGIN
VK_F5, ID_VIEW_REFRESH, VIRTKEY, NOINVERT
END
/* Command-line strings */
STRINGTABLE
BEGIN
STRING_USAGE "Usage:\n\
regedit [options] [filename] [reg_key]\n\n\
Options:\n\
[no option] Launch the graphical version of this program.\n\
/L:system.dat The location of the system.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/R:user.dat The location of the user.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/C Import the contents of a registry file.\n\
/D Delete a specified registry key.\n\
/E Export the contents of a specified registry key to a file.\n\
If no key is specified, the entire registry is exported.\n\
/S Silent mode. No messages will be displayed.\n\
/V Launch the GUI in advanced mode. Ignored.\n\
/? Display this information and exit.\n\
[filename] The location of the file containing registry information to\n\
be imported. When used with [/E], this option specifies the\n\
file location where registry information will be exported.\n\
[reg_key] The registry key to be modified.\n\
n\
Usage examples:\n\
regedit ""import.reg""\n\
regedit /E ""export.reg"" ""HKEY_CURRENT_USER\\Console""\n\
regedit /D ""HKEY_LOCAL_MACHINE\\Error\\Path""\n"
STRING_INVALID_SWITCH "regedit: Invalid or unrecognized switch [%1]\n"
STRING_HELP "Type ""regedit /?"" for help.\n"
STRING_NO_FILENAME "regedit: No filename was specified.\n"
STRING_NO_REG_KEY "regedit: No registry key was specified for removal.\n"
STRING_FILE_NOT_FOUND "regedit: The file '%1' was not found.\n"
STRING_CANNOT_OPEN_FILE "regedit: Unable to open the file '%1'.\n"
STRING_UNHANDLED_ACTION "regedit: Unhandled action.\n"
STRING_OUT_OF_MEMORY "regedit: Out of memory! (%1!S!, line %2!u!)\n"
STRING_INVALID_HEX "regedit: Invalid hexadecimal value.\n"
STRING_CSV_HEX_ERROR "regedit: Unable to convert hexadecimal data. An invalid value was encountered at '%1'.\n"
STRING_ESCAPE_SEQUENCE "regedit: Unrecognized escape sequence [\\%1!c!]\n"
STRING_UNKNOWN_DATA_FORMAT "regedit: Unsupported registry data type [0x%1!x!]\n"
STRING_UNEXPECTED_EOL "regedit: Unexpected end of line in '%1'.\n"
STRING_UNRECOGNIZED_LINE "regedit: The line '%1' was not recognized.\n"
STRING_SETVALUE_FAILED "regedit: Unable to add the registry value '%1' to '%2'.\n"
STRING_OPEN_KEY_FAILED "regedit: Unable to open the registry key '%1'.\n"
STRING_UNSUPPORTED_TYPE "regedit: Unsupported registry data type [0x%1!x!] encountered in '%2'.\n"
STRING_EXPORT_AS_BINARY "regedit: The registry value '%1' will be exported as binary data.\n"
STRING_INVALID_SYSTEM_KEY "regedit: Invalid system key [%1]\n"
STRING_REG_KEY_NOT_FOUND "regedit: Unable to export '%1'. The specified registry key was not found.\n"
STRING_DELETE_FAILED "regedit: Unable to delete the registry key '%1'.\n"
STRING_UNKNOWN_TYPE "Unknown Type"
STRING_INVALID_LINE_SYNTAX, "regedit: The line contains invalid syntax.\n"
END
/* Menus */
IDC_REGEDIT MENU

View file

@ -10,6 +10,58 @@ BEGIN
VK_F5, ID_VIEW_REFRESH, VIRTKEY, NOINVERT
END
/* Command-line strings */
STRINGTABLE
BEGIN
STRING_USAGE "Usage:\n\
regedit [options] [filename] [reg_key]\n\n\
Options:\n\
[no option] Launch the graphical version of this program.\n\
/L:system.dat The location of the system.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/R:user.dat The location of the user.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/C Import the contents of a registry file.\n\
/D Delete a specified registry key.\n\
/E Export the contents of a specified registry key to a file.\n\
If no key is specified, the entire registry is exported.\n\
/S Silent mode. No messages will be displayed.\n\
/V Launch the GUI in advanced mode. Ignored.\n\
/? Display this information and exit.\n\
[filename] The location of the file containing registry information to\n\
be imported. When used with [/E], this option specifies the\n\
file location where registry information will be exported.\n\
[reg_key] The registry key to be modified.\n\
n\
Usage examples:\n\
regedit ""import.reg""\n\
regedit /E ""export.reg"" ""HKEY_CURRENT_USER\\Console""\n\
regedit /D ""HKEY_LOCAL_MACHINE\\Error\\Path""\n"
STRING_INVALID_SWITCH "regedit: Invalid or unrecognized switch [%1]\n"
STRING_HELP "Type ""regedit /?"" for help.\n"
STRING_NO_FILENAME "regedit: No filename was specified.\n"
STRING_NO_REG_KEY "regedit: No registry key was specified for removal.\n"
STRING_FILE_NOT_FOUND "regedit: The file '%1' was not found.\n"
STRING_CANNOT_OPEN_FILE "regedit: Unable to open the file '%1'.\n"
STRING_UNHANDLED_ACTION "regedit: Unhandled action.\n"
STRING_OUT_OF_MEMORY "regedit: Out of memory! (%1!S!, line %2!u!)\n"
STRING_INVALID_HEX "regedit: Invalid hexadecimal value.\n"
STRING_CSV_HEX_ERROR "regedit: Unable to convert hexadecimal data. An invalid value was encountered at '%1'.\n"
STRING_ESCAPE_SEQUENCE "regedit: Unrecognized escape sequence [\\%1!c!]\n"
STRING_UNKNOWN_DATA_FORMAT "regedit: Unsupported registry data type [0x%1!x!]\n"
STRING_UNEXPECTED_EOL "regedit: Unexpected end of line in '%1'.\n"
STRING_UNRECOGNIZED_LINE "regedit: The line '%1' was not recognized.\n"
STRING_SETVALUE_FAILED "regedit: Unable to add the registry value '%1' to '%2'.\n"
STRING_OPEN_KEY_FAILED "regedit: Unable to open the registry key '%1'.\n"
STRING_UNSUPPORTED_TYPE "regedit: Unsupported registry data type [0x%1!x!] encountered in '%2'.\n"
STRING_EXPORT_AS_BINARY "regedit: The registry value '%1' will be exported as binary data.\n"
STRING_INVALID_SYSTEM_KEY "regedit: Invalid system key [%1]\n"
STRING_REG_KEY_NOT_FOUND "regedit: Unable to export '%1'. The specified registry key was not found.\n"
STRING_DELETE_FAILED "regedit: Unable to delete the registry key '%1'.\n"
STRING_UNKNOWN_TYPE "Unknown Type"
STRING_INVALID_LINE_SYNTAX, "regedit: The line contains invalid syntax.\n"
END
/* Menus */
IDC_REGEDIT MENU

View file

@ -20,6 +20,58 @@ BEGIN
VK_F5, ID_VIEW_REFRESH, VIRTKEY, NOINVERT
END
/* Command-line strings */
STRINGTABLE
BEGIN
STRING_USAGE "Usage:\n\
regedit [options] [filename] [reg_key]\n\n\
Options:\n\
[no option] Launch the graphical version of this program.\n\
/L:system.dat The location of the system.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/R:user.dat The location of the user.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/C Import the contents of a registry file.\n\
/D Delete a specified registry key.\n\
/E Export the contents of a specified registry key to a file.\n\
If no key is specified, the entire registry is exported.\n\
/S Silent mode. No messages will be displayed.\n\
/V Launch the GUI in advanced mode. Ignored.\n\
/? Display this information and exit.\n\
[filename] The location of the file containing registry information to\n\
be imported. When used with [/E], this option specifies the\n\
file location where registry information will be exported.\n\
[reg_key] The registry key to be modified.\n\
n\
Usage examples:\n\
regedit ""import.reg""\n\
regedit /E ""export.reg"" ""HKEY_CURRENT_USER\\Console""\n\
regedit /D ""HKEY_LOCAL_MACHINE\\Error\\Path""\n"
STRING_INVALID_SWITCH "regedit: Invalid or unrecognized switch [%1]\n"
STRING_HELP "Type ""regedit /?"" for help.\n"
STRING_NO_FILENAME "regedit: No filename was specified.\n"
STRING_NO_REG_KEY "regedit: No registry key was specified for removal.\n"
STRING_FILE_NOT_FOUND "regedit: The file '%1' was not found.\n"
STRING_CANNOT_OPEN_FILE "regedit: Unable to open the file '%1'.\n"
STRING_UNHANDLED_ACTION "regedit: Unhandled action.\n"
STRING_OUT_OF_MEMORY "regedit: Out of memory! (%1!S!, line %2!u!)\n"
STRING_INVALID_HEX "regedit: Invalid hexadecimal value.\n"
STRING_CSV_HEX_ERROR "regedit: Unable to convert hexadecimal data. An invalid value was encountered at '%1'.\n"
STRING_ESCAPE_SEQUENCE "regedit: Unrecognized escape sequence [\\%1!c!]\n"
STRING_UNKNOWN_DATA_FORMAT "regedit: Unsupported registry data type [0x%1!x!]\n"
STRING_UNEXPECTED_EOL "regedit: Unexpected end of line in '%1'.\n"
STRING_UNRECOGNIZED_LINE "regedit: The line '%1' was not recognized.\n"
STRING_SETVALUE_FAILED "regedit: Unable to add the registry value '%1' to '%2'.\n"
STRING_OPEN_KEY_FAILED "regedit: Unable to open the registry key '%1'.\n"
STRING_UNSUPPORTED_TYPE "regedit: Unsupported registry data type [0x%1!x!] encountered in '%2'.\n"
STRING_EXPORT_AS_BINARY "regedit: The registry value '%1' will be exported as binary data.\n"
STRING_INVALID_SYSTEM_KEY "regedit: Invalid system key [%1]\n"
STRING_REG_KEY_NOT_FOUND "regedit: Unable to export '%1'. The specified registry key was not found.\n"
STRING_DELETE_FAILED "regedit: Unable to delete the registry key '%1'.\n"
STRING_UNKNOWN_TYPE "Unknown Type"
STRING_INVALID_LINE_SYNTAX, "regedit: The line contains invalid syntax.\n"
END
/* Menus */
IDC_REGEDIT MENU

View file

@ -10,6 +10,58 @@ BEGIN
VK_F5, ID_VIEW_REFRESH, VIRTKEY, NOINVERT
END
/* Command-line strings */
STRINGTABLE
BEGIN
STRING_USAGE "Usage:\n\
regedit [options] [filename] [reg_key]\n\n\
Options:\n\
[no option] Launch the graphical version of this program.\n\
/L:system.dat The location of the system.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/R:user.dat The location of the user.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/C Import the contents of a registry file.\n\
/D Delete a specified registry key.\n\
/E Export the contents of a specified registry key to a file.\n\
If no key is specified, the entire registry is exported.\n\
/S Silent mode. No messages will be displayed.\n\
/V Launch the GUI in advanced mode. Ignored.\n\
/? Display this information and exit.\n\
[filename] The location of the file containing registry information to\n\
be imported. When used with [/E], this option specifies the\n\
file location where registry information will be exported.\n\
[reg_key] The registry key to be modified.\n\
n\
Usage examples:\n\
regedit ""import.reg""\n\
regedit /E ""export.reg"" ""HKEY_CURRENT_USER\\Console""\n\
regedit /D ""HKEY_LOCAL_MACHINE\\Error\\Path""\n"
STRING_INVALID_SWITCH "regedit: Invalid or unrecognized switch [%1]\n"
STRING_HELP "Type ""regedit /?"" for help.\n"
STRING_NO_FILENAME "regedit: No filename was specified.\n"
STRING_NO_REG_KEY "regedit: No registry key was specified for removal.\n"
STRING_FILE_NOT_FOUND "regedit: The file '%1' was not found.\n"
STRING_CANNOT_OPEN_FILE "regedit: Unable to open the file '%1'.\n"
STRING_UNHANDLED_ACTION "regedit: Unhandled action.\n"
STRING_OUT_OF_MEMORY "regedit: Out of memory! (%1!S!, line %2!u!)\n"
STRING_INVALID_HEX "regedit: Invalid hexadecimal value.\n"
STRING_CSV_HEX_ERROR "regedit: Unable to convert hexadecimal data. An invalid value was encountered at '%1'.\n"
STRING_ESCAPE_SEQUENCE "regedit: Unrecognized escape sequence [\\%1!c!]\n"
STRING_UNKNOWN_DATA_FORMAT "regedit: Unsupported registry data type [0x%1!x!]\n"
STRING_UNEXPECTED_EOL "regedit: Unexpected end of line in '%1'.\n"
STRING_UNRECOGNIZED_LINE "regedit: The line '%1' was not recognized.\n"
STRING_SETVALUE_FAILED "regedit: Unable to add the registry value '%1' to '%2'.\n"
STRING_OPEN_KEY_FAILED "regedit: Unable to open the registry key '%1'.\n"
STRING_UNSUPPORTED_TYPE "regedit: Unsupported registry data type [0x%1!x!] encountered in '%2'.\n"
STRING_EXPORT_AS_BINARY "regedit: The registry value '%1' will be exported as binary data.\n"
STRING_INVALID_SYSTEM_KEY "regedit: Invalid system key [%1]\n"
STRING_REG_KEY_NOT_FOUND "regedit: Unable to export '%1'. The specified registry key was not found.\n"
STRING_DELETE_FAILED "regedit: Unable to delete the registry key '%1'.\n"
STRING_UNKNOWN_TYPE "Unknown Type"
STRING_INVALID_LINE_SYNTAX, "regedit: The line contains invalid syntax.\n"
END
/* Menus */
IDC_REGEDIT MENU

View file

@ -10,6 +10,58 @@ BEGIN
VK_F5, ID_VIEW_REFRESH, VIRTKEY, NOINVERT
END
/* Command-line strings */
STRINGTABLE
BEGIN
STRING_USAGE "Usage:\n\
regedit [options] [filename] [reg_key]\n\n\
Options:\n\
[no option] Launch the graphical version of this program.\n\
/L:system.dat The location of the system.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/R:user.dat The location of the user.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/C Import the contents of a registry file.\n\
/D Delete a specified registry key.\n\
/E Export the contents of a specified registry key to a file.\n\
If no key is specified, the entire registry is exported.\n\
/S Silent mode. No messages will be displayed.\n\
/V Launch the GUI in advanced mode. Ignored.\n\
/? Display this information and exit.\n\
[filename] The location of the file containing registry information to\n\
be imported. When used with [/E], this option specifies the\n\
file location where registry information will be exported.\n\
[reg_key] The registry key to be modified.\n\
n\
Usage examples:\n\
regedit ""import.reg""\n\
regedit /E ""export.reg"" ""HKEY_CURRENT_USER\\Console""\n\
regedit /D ""HKEY_LOCAL_MACHINE\\Error\\Path""\n"
STRING_INVALID_SWITCH "regedit: Invalid or unrecognized switch [%1]\n"
STRING_HELP "Type ""regedit /?"" for help.\n"
STRING_NO_FILENAME "regedit: No filename was specified.\n"
STRING_NO_REG_KEY "regedit: No registry key was specified for removal.\n"
STRING_FILE_NOT_FOUND "regedit: The file '%1' was not found.\n"
STRING_CANNOT_OPEN_FILE "regedit: Unable to open the file '%1'.\n"
STRING_UNHANDLED_ACTION "regedit: Unhandled action.\n"
STRING_OUT_OF_MEMORY "regedit: Out of memory! (%1!S!, line %2!u!)\n"
STRING_INVALID_HEX "regedit: Invalid hexadecimal value.\n"
STRING_CSV_HEX_ERROR "regedit: Unable to convert hexadecimal data. An invalid value was encountered at '%1'.\n"
STRING_ESCAPE_SEQUENCE "regedit: Unrecognized escape sequence [\\%1!c!]\n"
STRING_UNKNOWN_DATA_FORMAT "regedit: Unsupported registry data type [0x%1!x!]\n"
STRING_UNEXPECTED_EOL "regedit: Unexpected end of line in '%1'.\n"
STRING_UNRECOGNIZED_LINE "regedit: The line '%1' was not recognized.\n"
STRING_SETVALUE_FAILED "regedit: Unable to add the registry value '%1' to '%2'.\n"
STRING_OPEN_KEY_FAILED "regedit: Unable to open the registry key '%1'.\n"
STRING_UNSUPPORTED_TYPE "regedit: Unsupported registry data type [0x%1!x!] encountered in '%2'.\n"
STRING_EXPORT_AS_BINARY "regedit: The registry value '%1' will be exported as binary data.\n"
STRING_INVALID_SYSTEM_KEY "regedit: Invalid system key [%1]\n"
STRING_REG_KEY_NOT_FOUND "regedit: Unable to export '%1'. The specified registry key was not found.\n"
STRING_DELETE_FAILED "regedit: Unable to delete the registry key '%1'.\n"
STRING_UNKNOWN_TYPE "Unknown Type"
STRING_INVALID_LINE_SYNTAX, "regedit: The line contains invalid syntax.\n"
END
/* Menus */
IDC_REGEDIT MENU

View file

@ -12,6 +12,58 @@ BEGIN
VK_F5, ID_VIEW_REFRESH, VIRTKEY, NOINVERT
END
/* Command-line strings */
STRINGTABLE
BEGIN
STRING_USAGE "Usage:\n\
regedit [options] [filename] [reg_key]\n\n\
Options:\n\
[no option] Launch the graphical version of this program.\n\
/L:system.dat The location of the system.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/R:user.dat The location of the user.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/C Import the contents of a registry file.\n\
/D Delete a specified registry key.\n\
/E Export the contents of a specified registry key to a file.\n\
If no key is specified, the entire registry is exported.\n\
/S Silent mode. No messages will be displayed.\n\
/V Launch the GUI in advanced mode. Ignored.\n\
/? Display this information and exit.\n\
[filename] The location of the file containing registry information to\n\
be imported. When used with [/E], this option specifies the\n\
file location where registry information will be exported.\n\
[reg_key] The registry key to be modified.\n\
n\
Usage examples:\n\
regedit ""import.reg""\n\
regedit /E ""export.reg"" ""HKEY_CURRENT_USER\\Console""\n\
regedit /D ""HKEY_LOCAL_MACHINE\\Error\\Path""\n"
STRING_INVALID_SWITCH "regedit: Invalid or unrecognized switch [%1]\n"
STRING_HELP "Type ""regedit /?"" for help.\n"
STRING_NO_FILENAME "regedit: No filename was specified.\n"
STRING_NO_REG_KEY "regedit: No registry key was specified for removal.\n"
STRING_FILE_NOT_FOUND "regedit: The file '%1' was not found.\n"
STRING_CANNOT_OPEN_FILE "regedit: Unable to open the file '%1'.\n"
STRING_UNHANDLED_ACTION "regedit: Unhandled action.\n"
STRING_OUT_OF_MEMORY "regedit: Out of memory! (%1!S!, line %2!u!)\n"
STRING_INVALID_HEX "regedit: Invalid hexadecimal value.\n"
STRING_CSV_HEX_ERROR "regedit: Unable to convert hexadecimal data. An invalid value was encountered at '%1'.\n"
STRING_ESCAPE_SEQUENCE "regedit: Unrecognized escape sequence [\\%1!c!]\n"
STRING_UNKNOWN_DATA_FORMAT "regedit: Unsupported registry data type [0x%1!x!]\n"
STRING_UNEXPECTED_EOL "regedit: Unexpected end of line in '%1'.\n"
STRING_UNRECOGNIZED_LINE "regedit: The line '%1' was not recognized.\n"
STRING_SETVALUE_FAILED "regedit: Unable to add the registry value '%1' to '%2'.\n"
STRING_OPEN_KEY_FAILED "regedit: Unable to open the registry key '%1'.\n"
STRING_UNSUPPORTED_TYPE "regedit: Unsupported registry data type [0x%1!x!] encountered in '%2'.\n"
STRING_EXPORT_AS_BINARY "regedit: The registry value '%1' will be exported as binary data.\n"
STRING_INVALID_SYSTEM_KEY "regedit: Invalid system key [%1]\n"
STRING_REG_KEY_NOT_FOUND "regedit: Unable to export '%1'. The specified registry key was not found.\n"
STRING_DELETE_FAILED "regedit: Unable to delete the registry key '%1'.\n"
STRING_UNKNOWN_TYPE "Unknown Type"
STRING_INVALID_LINE_SYNTAX, "regedit: The line contains invalid syntax.\n"
END
/* Menus */
IDC_REGEDIT MENU

View file

@ -10,6 +10,58 @@ BEGIN
VK_F5, ID_VIEW_REFRESH, VIRTKEY, NOINVERT
END
/* Command-line strings */
STRINGTABLE
BEGIN
STRING_USAGE "Usage:\n\
regedit [options] [filename] [reg_key]\n\n\
Options:\n\
[no option] Launch the graphical version of this program.\n\
/L:system.dat The location of the system.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/R:user.dat The location of the user.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/C Import the contents of a registry file.\n\
/D Delete a specified registry key.\n\
/E Export the contents of a specified registry key to a file.\n\
If no key is specified, the entire registry is exported.\n\
/S Silent mode. No messages will be displayed.\n\
/V Launch the GUI in advanced mode. Ignored.\n\
/? Display this information and exit.\n\
[filename] The location of the file containing registry information to\n\
be imported. When used with [/E], this option specifies the\n\
file location where registry information will be exported.\n\
[reg_key] The registry key to be modified.\n\
n\
Usage examples:\n\
regedit ""import.reg""\n\
regedit /E ""export.reg"" ""HKEY_CURRENT_USER\\Console""\n\
regedit /D ""HKEY_LOCAL_MACHINE\\Error\\Path""\n"
STRING_INVALID_SWITCH "regedit: Invalid or unrecognized switch [%1]\n"
STRING_HELP "Type ""regedit /?"" for help.\n"
STRING_NO_FILENAME "regedit: No filename was specified.\n"
STRING_NO_REG_KEY "regedit: No registry key was specified for removal.\n"
STRING_FILE_NOT_FOUND "regedit: The file '%1' was not found.\n"
STRING_CANNOT_OPEN_FILE "regedit: Unable to open the file '%1'.\n"
STRING_UNHANDLED_ACTION "regedit: Unhandled action.\n"
STRING_OUT_OF_MEMORY "regedit: Out of memory! (%1!S!, line %2!u!)\n"
STRING_INVALID_HEX "regedit: Invalid hexadecimal value.\n"
STRING_CSV_HEX_ERROR "regedit: Unable to convert hexadecimal data. An invalid value was encountered at '%1'.\n"
STRING_ESCAPE_SEQUENCE "regedit: Unrecognized escape sequence [\\%1!c!]\n"
STRING_UNKNOWN_DATA_FORMAT "regedit: Unsupported registry data type [0x%1!x!]\n"
STRING_UNEXPECTED_EOL "regedit: Unexpected end of line in '%1'.\n"
STRING_UNRECOGNIZED_LINE "regedit: The line '%1' was not recognized.\n"
STRING_SETVALUE_FAILED "regedit: Unable to add the registry value '%1' to '%2'.\n"
STRING_OPEN_KEY_FAILED "regedit: Unable to open the registry key '%1'.\n"
STRING_UNSUPPORTED_TYPE "regedit: Unsupported registry data type [0x%1!x!] encountered in '%2'.\n"
STRING_EXPORT_AS_BINARY "regedit: The registry value '%1' will be exported as binary data.\n"
STRING_INVALID_SYSTEM_KEY "regedit: Invalid system key [%1]\n"
STRING_REG_KEY_NOT_FOUND "regedit: Unable to export '%1'. The specified registry key was not found.\n"
STRING_DELETE_FAILED "regedit: Unable to delete the registry key '%1'.\n"
STRING_UNKNOWN_TYPE "Unknown Type"
STRING_INVALID_LINE_SYNTAX, "regedit: The line contains invalid syntax.\n"
END
/* Menus */
IDC_REGEDIT MENU

View file

@ -15,6 +15,58 @@ BEGIN
VK_F5, ID_VIEW_REFRESH, VIRTKEY, NOINVERT
END
/* Command-line strings */
STRINGTABLE
BEGIN
STRING_USAGE "Usage:\n\
regedit [options] [filename] [reg_key]\n\n\
Options:\n\
[no option] Launch the graphical version of this program.\n\
/L:system.dat The location of the system.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/R:user.dat The location of the user.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/C Import the contents of a registry file.\n\
/D Delete a specified registry key.\n\
/E Export the contents of a specified registry key to a file.\n\
If no key is specified, the entire registry is exported.\n\
/S Silent mode. No messages will be displayed.\n\
/V Launch the GUI in advanced mode. Ignored.\n\
/? Display this information and exit.\n\
[filename] The location of the file containing registry information to\n\
be imported. When used with [/E], this option specifies the\n\
file location where registry information will be exported.\n\
[reg_key] The registry key to be modified.\n\
n\
Usage examples:\n\
regedit ""import.reg""\n\
regedit /E ""export.reg"" ""HKEY_CURRENT_USER\\Console""\n\
regedit /D ""HKEY_LOCAL_MACHINE\\Error\\Path""\n"
STRING_INVALID_SWITCH "regedit: Invalid or unrecognized switch [%1]\n"
STRING_HELP "Type ""regedit /?"" for help.\n"
STRING_NO_FILENAME "regedit: No filename was specified.\n"
STRING_NO_REG_KEY "regedit: No registry key was specified for removal.\n"
STRING_FILE_NOT_FOUND "regedit: The file '%1' was not found.\n"
STRING_CANNOT_OPEN_FILE "regedit: Unable to open the file '%1'.\n"
STRING_UNHANDLED_ACTION "regedit: Unhandled action.\n"
STRING_OUT_OF_MEMORY "regedit: Out of memory! (%1!S!, line %2!u!)\n"
STRING_INVALID_HEX "regedit: Invalid hexadecimal value.\n"
STRING_CSV_HEX_ERROR "regedit: Unable to convert hexadecimal data. An invalid value was encountered at '%1'.\n"
STRING_ESCAPE_SEQUENCE "regedit: Unrecognized escape sequence [\\%1!c!]\n"
STRING_UNKNOWN_DATA_FORMAT "regedit: Unsupported registry data type [0x%1!x!]\n"
STRING_UNEXPECTED_EOL "regedit: Unexpected end of line in '%1'.\n"
STRING_UNRECOGNIZED_LINE "regedit: The line '%1' was not recognized.\n"
STRING_SETVALUE_FAILED "regedit: Unable to add the registry value '%1' to '%2'.\n"
STRING_OPEN_KEY_FAILED "regedit: Unable to open the registry key '%1'.\n"
STRING_UNSUPPORTED_TYPE "regedit: Unsupported registry data type [0x%1!x!] encountered in '%2'.\n"
STRING_EXPORT_AS_BINARY "regedit: The registry value '%1' will be exported as binary data.\n"
STRING_INVALID_SYSTEM_KEY "regedit: Invalid system key [%1]\n"
STRING_REG_KEY_NOT_FOUND "regedit: Unable to export '%1'. The specified registry key was not found.\n"
STRING_DELETE_FAILED "regedit: Unable to delete the registry key '%1'.\n"
STRING_UNKNOWN_TYPE "Unknown Type"
STRING_INVALID_LINE_SYNTAX, "regedit: The line contains invalid syntax.\n"
END
/* Menus */
IDC_REGEDIT MENU

View file

@ -10,6 +10,58 @@ BEGIN
VK_F5, ID_VIEW_REFRESH, VIRTKEY, NOINVERT
END
/* Command-line strings */
STRINGTABLE
BEGIN
STRING_USAGE "Usage:\n\
regedit [options] [filename] [reg_key]\n\n\
Options:\n\
[no option] Launch the graphical version of this program.\n\
/L:system.dat The location of the system.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/R:user.dat The location of the user.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/C Import the contents of a registry file.\n\
/D Delete a specified registry key.\n\
/E Export the contents of a specified registry key to a file.\n\
If no key is specified, the entire registry is exported.\n\
/S Silent mode. No messages will be displayed.\n\
/V Launch the GUI in advanced mode. Ignored.\n\
/? Display this information and exit.\n\
[filename] The location of the file containing registry information to\n\
be imported. When used with [/E], this option specifies the\n\
file location where registry information will be exported.\n\
[reg_key] The registry key to be modified.\n\
n\
Usage examples:\n\
regedit ""import.reg""\n\
regedit /E ""export.reg"" ""HKEY_CURRENT_USER\\Console""\n\
regedit /D ""HKEY_LOCAL_MACHINE\\Error\\Path""\n"
STRING_INVALID_SWITCH "regedit: Invalid or unrecognized switch [%1]\n"
STRING_HELP "Type ""regedit /?"" for help.\n"
STRING_NO_FILENAME "regedit: No filename was specified.\n"
STRING_NO_REG_KEY "regedit: No registry key was specified for removal.\n"
STRING_FILE_NOT_FOUND "regedit: The file '%1' was not found.\n"
STRING_CANNOT_OPEN_FILE "regedit: Unable to open the file '%1'.\n"
STRING_UNHANDLED_ACTION "regedit: Unhandled action.\n"
STRING_OUT_OF_MEMORY "regedit: Out of memory! (%1!S!, line %2!u!)\n"
STRING_INVALID_HEX "regedit: Invalid hexadecimal value.\n"
STRING_CSV_HEX_ERROR "regedit: Unable to convert hexadecimal data. An invalid value was encountered at '%1'.\n"
STRING_ESCAPE_SEQUENCE "regedit: Unrecognized escape sequence [\\%1!c!]\n"
STRING_UNKNOWN_DATA_FORMAT "regedit: Unsupported registry data type [0x%1!x!]\n"
STRING_UNEXPECTED_EOL "regedit: Unexpected end of line in '%1'.\n"
STRING_UNRECOGNIZED_LINE "regedit: The line '%1' was not recognized.\n"
STRING_SETVALUE_FAILED "regedit: Unable to add the registry value '%1' to '%2'.\n"
STRING_OPEN_KEY_FAILED "regedit: Unable to open the registry key '%1'.\n"
STRING_UNSUPPORTED_TYPE "regedit: Unsupported registry data type [0x%1!x!] encountered in '%2'.\n"
STRING_EXPORT_AS_BINARY "regedit: The registry value '%1' will be exported as binary data.\n"
STRING_INVALID_SYSTEM_KEY "regedit: Invalid system key [%1]\n"
STRING_REG_KEY_NOT_FOUND "regedit: Unable to export '%1'. The specified registry key was not found.\n"
STRING_DELETE_FAILED "regedit: Unable to delete the registry key '%1'.\n"
STRING_UNKNOWN_TYPE "Unknown Type"
STRING_INVALID_LINE_SYNTAX, "regedit: The line contains invalid syntax.\n"
END
/* Menus */
IDC_REGEDIT MENU

View file

@ -14,6 +14,58 @@ BEGIN
VK_F5, ID_VIEW_REFRESH, VIRTKEY, NOINVERT
END
/* Command-line strings */
STRINGTABLE
BEGIN
STRING_USAGE "Usage:\n\
regedit [options] [filename] [reg_key]\n\n\
Options:\n\
[no option] Launch the graphical version of this program.\n\
/L:system.dat The location of the system.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/R:user.dat The location of the user.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/C Import the contents of a registry file.\n\
/D Delete a specified registry key.\n\
/E Export the contents of a specified registry key to a file.\n\
If no key is specified, the entire registry is exported.\n\
/S Silent mode. No messages will be displayed.\n\
/V Launch the GUI in advanced mode. Ignored.\n\
/? Display this information and exit.\n\
[filename] The location of the file containing registry information to\n\
be imported. When used with [/E], this option specifies the\n\
file location where registry information will be exported.\n\
[reg_key] The registry key to be modified.\n\
n\
Usage examples:\n\
regedit ""import.reg""\n\
regedit /E ""export.reg"" ""HKEY_CURRENT_USER\\Console""\n\
regedit /D ""HKEY_LOCAL_MACHINE\\Error\\Path""\n"
STRING_INVALID_SWITCH "regedit: Invalid or unrecognized switch [%1]\n"
STRING_HELP "Type ""regedit /?"" for help.\n"
STRING_NO_FILENAME "regedit: No filename was specified.\n"
STRING_NO_REG_KEY "regedit: No registry key was specified for removal.\n"
STRING_FILE_NOT_FOUND "regedit: The file '%1' was not found.\n"
STRING_CANNOT_OPEN_FILE "regedit: Unable to open the file '%1'.\n"
STRING_UNHANDLED_ACTION "regedit: Unhandled action.\n"
STRING_OUT_OF_MEMORY "regedit: Out of memory! (%1!S!, line %2!u!)\n"
STRING_INVALID_HEX "regedit: Invalid hexadecimal value.\n"
STRING_CSV_HEX_ERROR "regedit: Unable to convert hexadecimal data. An invalid value was encountered at '%1'.\n"
STRING_ESCAPE_SEQUENCE "regedit: Unrecognized escape sequence [\\%1!c!]\n"
STRING_UNKNOWN_DATA_FORMAT "regedit: Unsupported registry data type [0x%1!x!]\n"
STRING_UNEXPECTED_EOL "regedit: Unexpected end of line in '%1'.\n"
STRING_UNRECOGNIZED_LINE "regedit: The line '%1' was not recognized.\n"
STRING_SETVALUE_FAILED "regedit: Unable to add the registry value '%1' to '%2'.\n"
STRING_OPEN_KEY_FAILED "regedit: Unable to open the registry key '%1'.\n"
STRING_UNSUPPORTED_TYPE "regedit: Unsupported registry data type [0x%1!x!] encountered in '%2'.\n"
STRING_EXPORT_AS_BINARY "regedit: The registry value '%1' will be exported as binary data.\n"
STRING_INVALID_SYSTEM_KEY "regedit: Invalid system key [%1]\n"
STRING_REG_KEY_NOT_FOUND "regedit: Unable to export '%1'. The specified registry key was not found.\n"
STRING_DELETE_FAILED "regedit: Unable to delete the registry key '%1'.\n"
STRING_UNKNOWN_TYPE "Unknown Type"
STRING_INVALID_LINE_SYNTAX, "regedit: The line contains invalid syntax.\n"
END
/* Menus */
IDC_REGEDIT MENU

View file

@ -10,6 +10,58 @@ BEGIN
VK_F5, ID_VIEW_REFRESH, VIRTKEY, NOINVERT
END
/* Command-line strings */
STRINGTABLE
BEGIN
STRING_USAGE "Usage:\n\
regedit [options] [filename] [reg_key]\n\n\
Options:\n\
[no option] Launch the graphical version of this program.\n\
/L:system.dat The location of the system.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/R:user.dat The location of the user.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/C Import the contents of a registry file.\n\
/D Delete a specified registry key.\n\
/E Export the contents of a specified registry key to a file.\n\
If no key is specified, the entire registry is exported.\n\
/S Silent mode. No messages will be displayed.\n\
/V Launch the GUI in advanced mode. Ignored.\n\
/? Display this information and exit.\n\
[filename] The location of the file containing registry information to\n\
be imported. When used with [/E], this option specifies the\n\
file location where registry information will be exported.\n\
[reg_key] The registry key to be modified.\n\
n\
Usage examples:\n\
regedit ""import.reg""\n\
regedit /E ""export.reg"" ""HKEY_CURRENT_USER\\Console""\n\
regedit /D ""HKEY_LOCAL_MACHINE\\Error\\Path""\n"
STRING_INVALID_SWITCH "regedit: Invalid or unrecognized switch [%1]\n"
STRING_HELP "Type ""regedit /?"" for help.\n"
STRING_NO_FILENAME "regedit: No filename was specified.\n"
STRING_NO_REG_KEY "regedit: No registry key was specified for removal.\n"
STRING_FILE_NOT_FOUND "regedit: The file '%1' was not found.\n"
STRING_CANNOT_OPEN_FILE "regedit: Unable to open the file '%1'.\n"
STRING_UNHANDLED_ACTION "regedit: Unhandled action.\n"
STRING_OUT_OF_MEMORY "regedit: Out of memory! (%1!S!, line %2!u!)\n"
STRING_INVALID_HEX "regedit: Invalid hexadecimal value.\n"
STRING_CSV_HEX_ERROR "regedit: Unable to convert hexadecimal data. An invalid value was encountered at '%1'.\n"
STRING_ESCAPE_SEQUENCE "regedit: Unrecognized escape sequence [\\%1!c!]\n"
STRING_UNKNOWN_DATA_FORMAT "regedit: Unsupported registry data type [0x%1!x!]\n"
STRING_UNEXPECTED_EOL "regedit: Unexpected end of line in '%1'.\n"
STRING_UNRECOGNIZED_LINE "regedit: The line '%1' was not recognized.\n"
STRING_SETVALUE_FAILED "regedit: Unable to add the registry value '%1' to '%2'.\n"
STRING_OPEN_KEY_FAILED "regedit: Unable to open the registry key '%1'.\n"
STRING_UNSUPPORTED_TYPE "regedit: Unsupported registry data type [0x%1!x!] encountered in '%2'.\n"
STRING_EXPORT_AS_BINARY "regedit: The registry value '%1' will be exported as binary data.\n"
STRING_INVALID_SYSTEM_KEY "regedit: Invalid system key [%1]\n"
STRING_REG_KEY_NOT_FOUND "regedit: Unable to export '%1'. The specified registry key was not found.\n"
STRING_DELETE_FAILED "regedit: Unable to delete the registry key '%1'.\n"
STRING_UNKNOWN_TYPE "Unknown Type"
STRING_INVALID_LINE_SYNTAX, "regedit: The line contains invalid syntax.\n"
END
/* Menus */
IDC_REGEDIT MENU

View file

@ -12,6 +12,58 @@ BEGIN
VK_F5, ID_VIEW_REFRESH, VIRTKEY, NOINVERT
END
/* Command-line strings */
STRINGTABLE
BEGIN
STRING_USAGE "Usage:\n\
regedit [options] [filename] [reg_key]\n\n\
Options:\n\
[no option] Launch the graphical version of this program.\n\
/L:system.dat The location of the system.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/R:user.dat The location of the user.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/C Import the contents of a registry file.\n\
/D Delete a specified registry key.\n\
/E Export the contents of a specified registry key to a file.\n\
If no key is specified, the entire registry is exported.\n\
/S Silent mode. No messages will be displayed.\n\
/V Launch the GUI in advanced mode. Ignored.\n\
/? Display this information and exit.\n\
[filename] The location of the file containing registry information to\n\
be imported. When used with [/E], this option specifies the\n\
file location where registry information will be exported.\n\
[reg_key] The registry key to be modified.\n\
n\
Usage examples:\n\
regedit ""import.reg""\n\
regedit /E ""export.reg"" ""HKEY_CURRENT_USER\\Console""\n\
regedit /D ""HKEY_LOCAL_MACHINE\\Error\\Path""\n"
STRING_INVALID_SWITCH "regedit: Invalid or unrecognized switch [%1]\n"
STRING_HELP "Type ""regedit /?"" for help.\n"
STRING_NO_FILENAME "regedit: No filename was specified.\n"
STRING_NO_REG_KEY "regedit: No registry key was specified for removal.\n"
STRING_FILE_NOT_FOUND "regedit: The file '%1' was not found.\n"
STRING_CANNOT_OPEN_FILE "regedit: Unable to open the file '%1'.\n"
STRING_UNHANDLED_ACTION "regedit: Unhandled action.\n"
STRING_OUT_OF_MEMORY "regedit: Out of memory! (%1!S!, line %2!u!)\n"
STRING_INVALID_HEX "regedit: Invalid hexadecimal value.\n"
STRING_CSV_HEX_ERROR "regedit: Unable to convert hexadecimal data. An invalid value was encountered at '%1'.\n"
STRING_ESCAPE_SEQUENCE "regedit: Unrecognized escape sequence [\\%1!c!]\n"
STRING_UNKNOWN_DATA_FORMAT "regedit: Unsupported registry data type [0x%1!x!]\n"
STRING_UNEXPECTED_EOL "regedit: Unexpected end of line in '%1'.\n"
STRING_UNRECOGNIZED_LINE "regedit: The line '%1' was not recognized.\n"
STRING_SETVALUE_FAILED "regedit: Unable to add the registry value '%1' to '%2'.\n"
STRING_OPEN_KEY_FAILED "regedit: Unable to open the registry key '%1'.\n"
STRING_UNSUPPORTED_TYPE "regedit: Unsupported registry data type [0x%1!x!] encountered in '%2'.\n"
STRING_EXPORT_AS_BINARY "regedit: The registry value '%1' will be exported as binary data.\n"
STRING_INVALID_SYSTEM_KEY "regedit: Invalid system key [%1]\n"
STRING_REG_KEY_NOT_FOUND "regedit: Unable to export '%1'. The specified registry key was not found.\n"
STRING_DELETE_FAILED "regedit: Unable to delete the registry key '%1'.\n"
STRING_UNKNOWN_TYPE "Unknown Type"
STRING_INVALID_LINE_SYNTAX, "regedit: The line contains invalid syntax.\n"
END
/* Menus */
IDC_REGEDIT MENU

View file

@ -12,6 +12,58 @@ BEGIN
VK_F5, ID_VIEW_REFRESH, VIRTKEY, NOINVERT
END
/* Command-line strings */
STRINGTABLE
BEGIN
STRING_USAGE "Usage:\n\
regedit [options] [filename] [reg_key]\n\n\
Options:\n\
[no option] Launch the graphical version of this program.\n\
/L:system.dat The location of the system.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/R:user.dat The location of the user.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/C Import the contents of a registry file.\n\
/D Delete a specified registry key.\n\
/E Export the contents of a specified registry key to a file.\n\
If no key is specified, the entire registry is exported.\n\
/S Silent mode. No messages will be displayed.\n\
/V Launch the GUI in advanced mode. Ignored.\n\
/? Display this information and exit.\n\
[filename] The location of the file containing registry information to\n\
be imported. When used with [/E], this option specifies the\n\
file location where registry information will be exported.\n\
[reg_key] The registry key to be modified.\n\
n\
Usage examples:\n\
regedit ""import.reg""\n\
regedit /E ""export.reg"" ""HKEY_CURRENT_USER\\Console""\n\
regedit /D ""HKEY_LOCAL_MACHINE\\Error\\Path""\n"
STRING_INVALID_SWITCH "regedit: Invalid or unrecognized switch [%1]\n"
STRING_HELP "Type ""regedit /?"" for help.\n"
STRING_NO_FILENAME "regedit: No filename was specified.\n"
STRING_NO_REG_KEY "regedit: No registry key was specified for removal.\n"
STRING_FILE_NOT_FOUND "regedit: The file '%1' was not found.\n"
STRING_CANNOT_OPEN_FILE "regedit: Unable to open the file '%1'.\n"
STRING_UNHANDLED_ACTION "regedit: Unhandled action.\n"
STRING_OUT_OF_MEMORY "regedit: Out of memory! (%1!S!, line %2!u!)\n"
STRING_INVALID_HEX "regedit: Invalid hexadecimal value.\n"
STRING_CSV_HEX_ERROR "regedit: Unable to convert hexadecimal data. An invalid value was encountered at '%1'.\n"
STRING_ESCAPE_SEQUENCE "regedit: Unrecognized escape sequence [\\%1!c!]\n"
STRING_UNKNOWN_DATA_FORMAT "regedit: Unsupported registry data type [0x%1!x!]\n"
STRING_UNEXPECTED_EOL "regedit: Unexpected end of line in '%1'.\n"
STRING_UNRECOGNIZED_LINE "regedit: The line '%1' was not recognized.\n"
STRING_SETVALUE_FAILED "regedit: Unable to add the registry value '%1' to '%2'.\n"
STRING_OPEN_KEY_FAILED "regedit: Unable to open the registry key '%1'.\n"
STRING_UNSUPPORTED_TYPE "regedit: Unsupported registry data type [0x%1!x!] encountered in '%2'.\n"
STRING_EXPORT_AS_BINARY "regedit: The registry value '%1' will be exported as binary data.\n"
STRING_INVALID_SYSTEM_KEY "regedit: Invalid system key [%1]\n"
STRING_REG_KEY_NOT_FOUND "regedit: Unable to export '%1'. The specified registry key was not found.\n"
STRING_DELETE_FAILED "regedit: Unable to delete the registry key '%1'.\n"
STRING_UNKNOWN_TYPE "Unknown Type"
STRING_INVALID_LINE_SYNTAX, "regedit: The line contains invalid syntax.\n"
END
/* Menus */
IDC_REGEDIT MENU

View file

@ -12,6 +12,58 @@ BEGIN
VK_F5, ID_VIEW_REFRESH, VIRTKEY, NOINVERT
END
/* Command-line strings */
STRINGTABLE
BEGIN
STRING_USAGE "Usage:\n\
regedit [options] [filename] [reg_key]\n\n\
Options:\n\
[no option] Launch the graphical version of this program.\n\
/L:system.dat The location of the system.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/R:user.dat The location of the user.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/C Import the contents of a registry file.\n\
/D Delete a specified registry key.\n\
/E Export the contents of a specified registry key to a file.\n\
If no key is specified, the entire registry is exported.\n\
/S Silent mode. No messages will be displayed.\n\
/V Launch the GUI in advanced mode. Ignored.\n\
/? Display this information and exit.\n\
[filename] The location of the file containing registry information to\n\
be imported. When used with [/E], this option specifies the\n\
file location where registry information will be exported.\n\
[reg_key] The registry key to be modified.\n\
n\
Usage examples:\n\
regedit ""import.reg""\n\
regedit /E ""export.reg"" ""HKEY_CURRENT_USER\\Console""\n\
regedit /D ""HKEY_LOCAL_MACHINE\\Error\\Path""\n"
STRING_INVALID_SWITCH "regedit: Invalid or unrecognized switch [%1]\n"
STRING_HELP "Type ""regedit /?"" for help.\n"
STRING_NO_FILENAME "regedit: No filename was specified.\n"
STRING_NO_REG_KEY "regedit: No registry key was specified for removal.\n"
STRING_FILE_NOT_FOUND "regedit: The file '%1' was not found.\n"
STRING_CANNOT_OPEN_FILE "regedit: Unable to open the file '%1'.\n"
STRING_UNHANDLED_ACTION "regedit: Unhandled action.\n"
STRING_OUT_OF_MEMORY "regedit: Out of memory! (%1!S!, line %2!u!)\n"
STRING_INVALID_HEX "regedit: Invalid hexadecimal value.\n"
STRING_CSV_HEX_ERROR "regedit: Unable to convert hexadecimal data. An invalid value was encountered at '%1'.\n"
STRING_ESCAPE_SEQUENCE "regedit: Unrecognized escape sequence [\\%1!c!]\n"
STRING_UNKNOWN_DATA_FORMAT "regedit: Unsupported registry data type [0x%1!x!]\n"
STRING_UNEXPECTED_EOL "regedit: Unexpected end of line in '%1'.\n"
STRING_UNRECOGNIZED_LINE "regedit: The line '%1' was not recognized.\n"
STRING_SETVALUE_FAILED "regedit: Unable to add the registry value '%1' to '%2'.\n"
STRING_OPEN_KEY_FAILED "regedit: Unable to open the registry key '%1'.\n"
STRING_UNSUPPORTED_TYPE "regedit: Unsupported registry data type [0x%1!x!] encountered in '%2'.\n"
STRING_EXPORT_AS_BINARY "regedit: The registry value '%1' will be exported as binary data.\n"
STRING_INVALID_SYSTEM_KEY "regedit: Invalid system key [%1]\n"
STRING_REG_KEY_NOT_FOUND "regedit: Unable to export '%1'. The specified registry key was not found.\n"
STRING_DELETE_FAILED "regedit: Unable to delete the registry key '%1'.\n"
STRING_UNKNOWN_TYPE "Unknown Type"
STRING_INVALID_LINE_SYNTAX, "regedit: The line contains invalid syntax.\n"
END
/* Menus */
IDC_REGEDIT MENU

View file

@ -20,6 +20,58 @@ BEGIN
VK_F5, ID_VIEW_REFRESH, VIRTKEY, NOINVERT
END
/* Command-line strings */
STRINGTABLE
BEGIN
STRING_USAGE "Usage:\n\
regedit [options] [filename] [reg_key]\n\n\
Options:\n\
[no option] Launch the graphical version of this program.\n\
/L:system.dat The location of the system.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/R:user.dat The location of the user.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/C Import the contents of a registry file.\n\
/D Delete a specified registry key.\n\
/E Export the contents of a specified registry key to a file.\n\
If no key is specified, the entire registry is exported.\n\
/S Silent mode. No messages will be displayed.\n\
/V Launch the GUI in advanced mode. Ignored.\n\
/? Display this information and exit.\n\
[filename] The location of the file containing registry information to\n\
be imported. When used with [/E], this option specifies the\n\
file location where registry information will be exported.\n\
[reg_key] The registry key to be modified.\n\
n\
Usage examples:\n\
regedit ""import.reg""\n\
regedit /E ""export.reg"" ""HKEY_CURRENT_USER\\Console""\n\
regedit /D ""HKEY_LOCAL_MACHINE\\Error\\Path""\n"
STRING_INVALID_SWITCH "regedit: Invalid or unrecognized switch [%1]\n"
STRING_HELP "Type ""regedit /?"" for help.\n"
STRING_NO_FILENAME "regedit: No filename was specified.\n"
STRING_NO_REG_KEY "regedit: No registry key was specified for removal.\n"
STRING_FILE_NOT_FOUND "regedit: The file '%1' was not found.\n"
STRING_CANNOT_OPEN_FILE "regedit: Unable to open the file '%1'.\n"
STRING_UNHANDLED_ACTION "regedit: Unhandled action.\n"
STRING_OUT_OF_MEMORY "regedit: Out of memory! (%1!S!, line %2!u!)\n"
STRING_INVALID_HEX "regedit: Invalid hexadecimal value.\n"
STRING_CSV_HEX_ERROR "regedit: Unable to convert hexadecimal data. An invalid value was encountered at '%1'.\n"
STRING_ESCAPE_SEQUENCE "regedit: Unrecognized escape sequence [\\%1!c!]\n"
STRING_UNKNOWN_DATA_FORMAT "regedit: Unsupported registry data type [0x%1!x!]\n"
STRING_UNEXPECTED_EOL "regedit: Unexpected end of line in '%1'.\n"
STRING_UNRECOGNIZED_LINE "regedit: The line '%1' was not recognized.\n"
STRING_SETVALUE_FAILED "regedit: Unable to add the registry value '%1' to '%2'.\n"
STRING_OPEN_KEY_FAILED "regedit: Unable to open the registry key '%1'.\n"
STRING_UNSUPPORTED_TYPE "regedit: Unsupported registry data type [0x%1!x!] encountered in '%2'.\n"
STRING_EXPORT_AS_BINARY "regedit: The registry value '%1' will be exported as binary data.\n"
STRING_INVALID_SYSTEM_KEY "regedit: Invalid system key [%1]\n"
STRING_REG_KEY_NOT_FOUND "regedit: Unable to export '%1'. The specified registry key was not found.\n"
STRING_DELETE_FAILED "regedit: Unable to delete the registry key '%1'.\n"
STRING_UNKNOWN_TYPE "Unknown Type"
STRING_INVALID_LINE_SYNTAX, "regedit: The line contains invalid syntax.\n"
END
/* Menus */
IDC_REGEDIT MENU

View file

@ -2,7 +2,7 @@
* PROJECT: ReactOS Registry Editor
* LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
* PURPOSE: Chinese (Hong Kong) resource file
* TRANSLATORS: Copyright 2021 Chan Chilung <eason066@gmail.com>
* TRANSLATORS: Copyright 2021 Chan Chilung <eason066@gmail.com>
* REFERENCES: Chinese (Traditional) resource file
*/
@ -18,6 +18,58 @@ BEGIN
VK_F5, ID_VIEW_REFRESH, VIRTKEY, NOINVERT
END
/* Command-line strings */
STRINGTABLE
BEGIN
STRING_USAGE "Usage:\n\
regedit [options] [filename] [reg_key]\n\n\
Options:\n\
[no option] Launch the graphical version of this program.\n\
/L:system.dat The location of the system.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/R:user.dat The location of the user.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/C Import the contents of a registry file.\n\
/D Delete a specified registry key.\n\
/E Export the contents of a specified registry key to a file.\n\
If no key is specified, the entire registry is exported.\n\
/S Silent mode. No messages will be displayed.\n\
/V Launch the GUI in advanced mode. Ignored.\n\
/? Display this information and exit.\n\
[filename] The location of the file containing registry information to\n\
be imported. When used with [/E], this option specifies the\n\
file location where registry information will be exported.\n\
[reg_key] The registry key to be modified.\n\
n\
Usage examples:\n\
regedit ""import.reg""\n\
regedit /E ""export.reg"" ""HKEY_CURRENT_USER\\Console""\n\
regedit /D ""HKEY_LOCAL_MACHINE\\Error\\Path""\n"
STRING_INVALID_SWITCH "regedit: Invalid or unrecognized switch [%1]\n"
STRING_HELP "Type ""regedit /?"" for help.\n"
STRING_NO_FILENAME "regedit: No filename was specified.\n"
STRING_NO_REG_KEY "regedit: No registry key was specified for removal.\n"
STRING_FILE_NOT_FOUND "regedit: The file '%1' was not found.\n"
STRING_CANNOT_OPEN_FILE "regedit: Unable to open the file '%1'.\n"
STRING_UNHANDLED_ACTION "regedit: Unhandled action.\n"
STRING_OUT_OF_MEMORY "regedit: Out of memory! (%1!S!, line %2!u!)\n"
STRING_INVALID_HEX "regedit: Invalid hexadecimal value.\n"
STRING_CSV_HEX_ERROR "regedit: Unable to convert hexadecimal data. An invalid value was encountered at '%1'.\n"
STRING_ESCAPE_SEQUENCE "regedit: Unrecognized escape sequence [\\%1!c!]\n"
STRING_UNKNOWN_DATA_FORMAT "regedit: Unsupported registry data type [0x%1!x!]\n"
STRING_UNEXPECTED_EOL "regedit: Unexpected end of line in '%1'.\n"
STRING_UNRECOGNIZED_LINE "regedit: The line '%1' was not recognized.\n"
STRING_SETVALUE_FAILED "regedit: Unable to add the registry value '%1' to '%2'.\n"
STRING_OPEN_KEY_FAILED "regedit: Unable to open the registry key '%1'.\n"
STRING_UNSUPPORTED_TYPE "regedit: Unsupported registry data type [0x%1!x!] encountered in '%2'.\n"
STRING_EXPORT_AS_BINARY "regedit: The registry value '%1' will be exported as binary data.\n"
STRING_INVALID_SYSTEM_KEY "regedit: Invalid system key [%1]\n"
STRING_REG_KEY_NOT_FOUND "regedit: Unable to export '%1'. The specified registry key was not found.\n"
STRING_DELETE_FAILED "regedit: Unable to delete the registry key '%1'.\n"
STRING_UNKNOWN_TYPE "Unknown Type"
STRING_INVALID_LINE_SYNTAX, "regedit: The line contains invalid syntax.\n"
END
/* Menus */
IDC_REGEDIT MENU

View file

@ -19,6 +19,58 @@ BEGIN
VK_F5, ID_VIEW_REFRESH, VIRTKEY, NOINVERT
END
/* Command-line strings */
STRINGTABLE
BEGIN
STRING_USAGE "Usage:\n\
regedit [options] [filename] [reg_key]\n\n\
Options:\n\
[no option] Launch the graphical version of this program.\n\
/L:system.dat The location of the system.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/R:user.dat The location of the user.dat file to be modified.\n\
Compatible with any other switch. Ignored.\n\
/C Import the contents of a registry file.\n\
/D Delete a specified registry key.\n\
/E Export the contents of a specified registry key to a file.\n\
If no key is specified, the entire registry is exported.\n\
/S Silent mode. No messages will be displayed.\n\
/V Launch the GUI in advanced mode. Ignored.\n\
/? Display this information and exit.\n\
[filename] The location of the file containing registry information to\n\
be imported. When used with [/E], this option specifies the\n\
file location where registry information will be exported.\n\
[reg_key] The registry key to be modified.\n\
n\
Usage examples:\n\
regedit ""import.reg""\n\
regedit /E ""export.reg"" ""HKEY_CURRENT_USER\\Console""\n\
regedit /D ""HKEY_LOCAL_MACHINE\\Error\\Path""\n"
STRING_INVALID_SWITCH "regedit: Invalid or unrecognized switch [%1]\n"
STRING_HELP "Type ""regedit /?"" for help.\n"
STRING_NO_FILENAME "regedit: No filename was specified.\n"
STRING_NO_REG_KEY "regedit: No registry key was specified for removal.\n"
STRING_FILE_NOT_FOUND "regedit: The file '%1' was not found.\n"
STRING_CANNOT_OPEN_FILE "regedit: Unable to open the file '%1'.\n"
STRING_UNHANDLED_ACTION "regedit: Unhandled action.\n"
STRING_OUT_OF_MEMORY "regedit: Out of memory! (%1!S!, line %2!u!)\n"
STRING_INVALID_HEX "regedit: Invalid hexadecimal value.\n"
STRING_CSV_HEX_ERROR "regedit: Unable to convert hexadecimal data. An invalid value was encountered at '%1'.\n"
STRING_ESCAPE_SEQUENCE "regedit: Unrecognized escape sequence [\\%1!c!]\n"
STRING_UNKNOWN_DATA_FORMAT "regedit: Unsupported registry data type [0x%1!x!]\n"
STRING_UNEXPECTED_EOL "regedit: Unexpected end of line in '%1'.\n"
STRING_UNRECOGNIZED_LINE "regedit: The line '%1' was not recognized.\n"
STRING_SETVALUE_FAILED "regedit: Unable to add the registry value '%1' to '%2'.\n"
STRING_OPEN_KEY_FAILED "regedit: Unable to open the registry key '%1'.\n"
STRING_UNSUPPORTED_TYPE "regedit: Unsupported registry data type [0x%1!x!] encountered in '%2'.\n"
STRING_EXPORT_AS_BINARY "regedit: The registry value '%1' will be exported as binary data.\n"
STRING_INVALID_SYSTEM_KEY "regedit: Invalid system key [%1]\n"
STRING_REG_KEY_NOT_FOUND "regedit: Unable to export '%1'. The specified registry key was not found.\n"
STRING_DELETE_FAILED "regedit: Unable to delete the registry key '%1'.\n"
STRING_UNKNOWN_TYPE "Unknown Type"
STRING_INVALID_LINE_SYNTAX, "regedit: The line contains invalid syntax.\n"
END
/* Menus */
IDC_REGEDIT MENU

View file

@ -52,7 +52,7 @@ static INT g_iSortedColumn = 0;
static const int default_column_widths[MAX_LIST_COLUMNS] = { 35, 25, 40 }; /* in percents */
static const int column_alignment[MAX_LIST_COLUMNS] = { LVCFMT_LEFT, LVCFMT_LEFT, LVCFMT_LEFT };
LPCWSTR GetValueName(HWND hwndLV, int iStartAt)
WCHAR *GetValueName(HWND hwndLV, int iStartAt)
{
int item;
LVITEMW LVItem;
@ -181,7 +181,7 @@ static void AddEntryToList(HWND hwndLV, LPWSTR Name, DWORD dwValType, void* ValB
{
WCHAR buffer[255];
/* load (value not set) string */
LoadStringW(hInst, IDS_VALUE_NOT_SET, buffer, COUNT_OF(buffer));
LoadStringW(hInst, IDS_VALUE_NOT_SET, buffer, ARRAY_SIZE(buffer));
ListView_SetItemText(hwndLV, index, 2, buffer);
}
break;
@ -213,6 +213,7 @@ static void AddEntryToList(HWND hwndLV, LPWSTR Name, DWORD dwValType, void* ValB
}
break;
case REG_DWORD:
case REG_NONE:
{
WCHAR buf[200];
if(dwCount == sizeof(DWORD))
@ -221,7 +222,7 @@ static void AddEntryToList(HWND hwndLV, LPWSTR Name, DWORD dwValType, void* ValB
}
else
{
LoadStringW(hInst, IDS_INVALID_DWORD, buf, COUNT_OF(buf));
LoadStringW(hInst, IDS_INVALID_DWORD, buf, ARRAY_SIZE(buf));
}
ListView_SetItemText(hwndLV, index, 2, buf);
}
@ -246,7 +247,7 @@ static void AddEntryToList(HWND hwndLV, LPWSTR Name, DWORD dwValType, void* ValB
else
{
WCHAR szText[128];
LoadStringW(hInst, IDS_BINARY_EMPTY, szText, COUNT_OF(szText));
LoadStringW(hInst, IDS_BINARY_EMPTY, szText, ARRAY_SIZE(szText));
ListView_SetItemText(hwndLV, index, 2, szText);
}
}
@ -271,7 +272,7 @@ static BOOL CreateListColumns(HWND hWndListView, INT cxTotal)
lvC.iSubItem = index;
lvC.cx = (cxTotal * default_column_widths[index]) / 100;
lvC.fmt = column_alignment[index];
LoadStringW(hInst, IDS_LIST_COLUMN_FIRST + index, szText, COUNT_OF(szText));
LoadStringW(hInst, IDS_LIST_COLUMN_FIRST + index, szText, ARRAY_SIZE(szText));
if (ListView_InsertColumn(hWndListView, index, &lvC) == -1) return FALSE;
}
return TRUE;
@ -319,7 +320,7 @@ static void OnGetDispInfo(NMLVDISPINFO* plvdi)
switch (plvdi->item.iSubItem)
{
case 0:
LoadStringW(hInst, IDS_DEFAULT_VALUE_NAME, buffer, COUNT_OF(buffer));
LoadStringW(hInst, IDS_DEFAULT_VALUE_NAME, buffer, ARRAY_SIZE(buffer));
plvdi->item.pszText = buffer;
break;
case 1:
@ -364,7 +365,7 @@ static void OnGetDispInfo(NMLVDISPINFO* plvdi)
default:
{
WCHAR buf2[200];
LoadStringW(hInst, IDS_UNKNOWN_TYPE, buf2, COUNT_OF(buf2));
LoadStringW(hInst, IDS_UNKNOWN_TYPE, buf2, ARRAY_SIZE(buf2));
wsprintf(buffer, buf2, ((LINE_INFO*)plvdi->item.lParam)->dwValType);
plvdi->item.pszText = buffer;
break;
@ -597,8 +598,8 @@ BOOL ListWndNotifyProc(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL *Result)
{
WCHAR msg[128], caption[128];
LoadStringW(hInst, IDS_ERR_RENVAL_TOEMPTY, msg, COUNT_OF(msg));
LoadStringW(hInst, IDS_ERR_RENVAL_CAPTION, caption, COUNT_OF(caption));
LoadStringW(hInst, IDS_ERR_RENVAL_TOEMPTY, msg, ARRAY_SIZE(msg));
LoadStringW(hInst, IDS_ERR_RENVAL_CAPTION, caption, ARRAY_SIZE(caption));
MessageBoxW(0, msg, caption, 0);
*Result = TRUE;
}

View file

@ -20,7 +20,12 @@
#include "regedit.h"
BOOL ProcessCmdLine(LPWSTR lpCmdLine);
BOOL ProcessCmdLine(WCHAR *cmdline);
const WCHAR *reg_class_namesW[] = {L"HKEY_LOCAL_MACHINE", L"HKEY_USERS",
L"HKEY_CLASSES_ROOT", L"HKEY_CURRENT_CONFIG",
L"HKEY_CURRENT_USER", L"HKEY_DYN_DATA"
};
/*******************************************************************************
* Global Variables:
@ -190,7 +195,7 @@ BOOL TranslateChildTabMessage(PMSG msg)
return TRUE;
}
int APIENTRY wWinMain(HINSTANCE hInstance,
int WINAPI wWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPWSTR lpCmdLine,
int nCmdShow)
@ -201,11 +206,11 @@ int APIENTRY wWinMain(HINSTANCE hInstance,
UNREFERENCED_PARAMETER(hPrevInstance);
/* Initialize global strings */
LoadStringW(hInstance, IDS_APP_TITLE, szTitle, COUNT_OF(szTitle));
LoadStringW(hInstance, IDC_REGEDIT_FRAME, szFrameClass, COUNT_OF(szFrameClass));
LoadStringW(hInstance, IDC_REGEDIT, szChildClass, COUNT_OF(szChildClass));
LoadStringW(hInstance, IDS_APP_TITLE, szTitle, ARRAY_SIZE(szTitle));
LoadStringW(hInstance, IDC_REGEDIT_FRAME, szFrameClass, ARRAY_SIZE(szFrameClass));
LoadStringW(hInstance, IDC_REGEDIT, szChildClass, ARRAY_SIZE(szChildClass));
if (ProcessCmdLine(lpCmdLine))
if (ProcessCmdLine(GetCommandLineW()))
{
return 0;
}

View file

@ -30,7 +30,7 @@
#define SPLIT_WIDTH 5
#define SPLIT_MIN 30
#define COUNT_OF(a) (sizeof(a)/sizeof(a[0]))
#define ARRAY_SIZE(A) (sizeof(A)/sizeof(*A))
#define PM_MODIFYVALUE 0
#define PM_NEW 1
@ -38,9 +38,11 @@
#define PM_ROOTITEM 3
#define PM_HEXEDIT 4
#define MAX_NEW_KEY_LEN 128
#define MAX_NEW_KEY_LEN 128
#define KEY_MAX_LEN 1024
extern HINSTANCE hInst;
#define REG_FORMAT_5 1
#define REG_FORMAT_4 2
/******************************************************************************/
@ -86,71 +88,79 @@ extern WCHAR szFrameClass[];
extern WCHAR szChildClass[];
extern const WCHAR g_szGeneralRegKey[];
extern const WCHAR* reg_class_namesW[];
/* about.c */
extern void ShowAboutBox(HWND hWnd);
void ShowAboutBox(HWND hWnd);
/* childwnd.c */
extern LRESULT CALLBACK ChildWndProc(HWND, UINT, WPARAM, LPARAM);
extern void ResizeWnd(int cx, int cy);
extern LPCWSTR get_root_key_name(HKEY hRootKey);
LRESULT CALLBACK ChildWndProc(HWND, UINT, WPARAM, LPARAM);
void ResizeWnd(int cx, int cy);
LPCWSTR get_root_key_name(HKEY hRootKey);
VOID UpdateAddress(HTREEITEM hItem, HKEY hRootKey, LPCWSTR pszPath);
/* edit.c */
BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCWSTR valueName, BOOL EditBin);
BOOL DeleteKey(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath);
LONG RenameKey(HKEY hKey, LPCWSTR lpSubKey, LPCWSTR lpNewName);
LONG RenameValue(HKEY hKey, LPCWSTR lpSubKey, LPCWSTR lpDestValue, LPCWSTR lpSrcValue);
LONG QueryStringValue(HKEY hKey, LPCWSTR lpSubKey, LPCWSTR lpValueName, LPWSTR pszBuffer, DWORD dwBufferLen);
BOOL GetKeyName(LPWSTR pszDest, size_t iDestLength, HKEY hRootKey, LPCWSTR lpSubKey);
/* error.c */
extern int ErrorMessageBox(HWND hWnd, LPCWSTR lpTitle, DWORD dwErrorCode, ...);
extern int InfoMessageBox(HWND hWnd, UINT uType, LPCWSTR lpTitle, LPCWSTR lpMessage, ...);
int ErrorMessageBox(HWND hWnd, LPCWSTR lpTitle, DWORD dwErrorCode, ...);
int InfoMessageBox(HWND hWnd, UINT uType, LPCWSTR lpTitle, LPCWSTR lpMessage, ...);
/* find.c */
extern void FindDialog(HWND hWnd);
extern BOOL FindNext(HWND hWnd);
extern void FindNextMessageBox(HWND hWnd);
void FindDialog(HWND hWnd);
BOOL FindNext(HWND hWnd);
void FindNextMessageBox(HWND hWnd);
/* framewnd.c */
extern LRESULT CALLBACK FrameWndProc(HWND, UINT, WPARAM, LPARAM);
extern void SetupStatusBar(HWND hWnd, BOOL bResize);
extern void UpdateStatusBar(void);
extern BOOL CopyKeyName(HWND hWnd, HKEY hRootKey, LPCWSTR keyName);
extern BOOL ExportRegistryFile(HWND hWnd);
LRESULT CALLBACK FrameWndProc(HWND, UINT, WPARAM, LPARAM);
void SetupStatusBar(HWND hWnd, BOOL bResize);
void UpdateStatusBar(void);
BOOL CopyKeyName(HWND hWnd, HKEY hRootKey, LPCWSTR keyName);
BOOL ExportRegistryFile(HWND hWnd);
/* listview.c */
extern HWND CreateListView(HWND hwndParent, HMENU id, INT cx);
extern BOOL RefreshListView(HWND hwndLV, HKEY hKey, LPCWSTR keyPath);
extern LPCWSTR GetValueName(HWND hwndLV, int iStartAt);
extern BOOL ListWndNotifyProc(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL *Result);
extern BOOL TreeWndNotifyProc(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL *Result);
extern BOOL IsDefaultValue(HWND hwndLV, int i);
HWND CreateListView(HWND hwndParent, HMENU id, INT cx);
BOOL RefreshListView(HWND hwndLV, HKEY hKey, LPCWSTR keyPath);
WCHAR *GetValueName(HWND hwndLV, int iStartAt);
BOOL ListWndNotifyProc(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL *Result);
BOOL TreeWndNotifyProc(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL *Result);
BOOL IsDefaultValue(HWND hwndLV, int i);
/* regedit.c */
LPCWSTR getAppName(void);
void WINAPIV output_message(unsigned int id, ...);
void WINAPIV error_exit(unsigned int id, ...);
/* treeview.c */
extern HWND CreateTreeView(HWND hwndParent, LPWSTR pHostName, HMENU id);
extern BOOL RefreshTreeView(HWND hWndTV);
extern BOOL RefreshTreeItem(HWND hwndTV, HTREEITEM hItem);
extern BOOL OnTreeExpanding(HWND hWnd, NMTREEVIEW* pnmtv);
extern LPCWSTR GetItemPath(HWND hwndTV, HTREEITEM hItem, HKEY* phRootKey);
extern BOOL DeleteNode(HWND hwndTV, HTREEITEM hItem);
extern HTREEITEM InsertNode(HWND hwndTV, HTREEITEM hItem, LPWSTR name);
extern HWND StartKeyRename(HWND hwndTV);
extern BOOL CreateNewKey(HWND hwndTV, HTREEITEM hItem);
extern BOOL SelectNode(HWND hwndTV, LPCWSTR keyPath);
extern void DestroyTreeView(HWND hwndTV);
extern void DestroyListView(HWND hwndLV);
extern void DestroyMainMenu(void);
/* edit.c */
extern BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCWSTR valueName, BOOL EditBin);
extern BOOL DeleteKey(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath);
extern LONG RenameKey(HKEY hKey, LPCWSTR lpSubKey, LPCWSTR lpNewName);
extern LONG RenameValue(HKEY hKey, LPCWSTR lpSubKey, LPCWSTR lpDestValue, LPCWSTR lpSrcValue);
extern LONG QueryStringValue(HKEY hKey, LPCWSTR lpSubKey, LPCWSTR lpValueName, LPWSTR pszBuffer, DWORD dwBufferLen);
extern BOOL GetKeyName(LPWSTR pszDest, size_t iDestLength, HKEY hRootKey, LPCWSTR lpSubKey);
/* regproc.c */
char *GetMultiByteString(const WCHAR *strW);
BOOL import_registry_file(FILE *reg_file);
void delete_registry_key(WCHAR *reg_key_name);
BOOL export_registry_key(WCHAR *file_name, WCHAR *path, DWORD format);
/* security.c */
extern BOOL RegKeyEditPermissions(HWND hWndOwner, HKEY hKey, LPCWSTR lpMachine, LPCWSTR lpKeyName);
BOOL RegKeyEditPermissions(HWND hWndOwner, HKEY hKey, LPCWSTR lpMachine, LPCWSTR lpKeyName);
/* settings.c */
extern void LoadSettings(void);
extern void SaveSettings(void);
void LoadSettings(void);
void SaveSettings(void);
/* treeview.c */
HWND CreateTreeView(HWND hwndParent, LPWSTR pHostName, HMENU id);
BOOL RefreshTreeView(HWND hWndTV);
BOOL RefreshTreeItem(HWND hwndTV, HTREEITEM hItem);
BOOL OnTreeExpanding(HWND hWnd, NMTREEVIEW* pnmtv);
LPCWSTR GetItemPath(HWND hwndTV, HTREEITEM hItem, HKEY* phRootKey);
BOOL DeleteNode(HWND hwndTV, HTREEITEM hItem);
HTREEITEM InsertNode(HWND hwndTV, HTREEITEM hItem, LPWSTR name);
HWND StartKeyRename(HWND hwndTV);
BOOL CreateNewKey(HWND hwndTV, HTREEITEM hItem);
BOOL SelectNode(HWND hwndTV, LPCWSTR keyPath);
void DestroyTreeView(HWND hwndTV);
void DestroyListView(HWND hwndLV);
void DestroyMainMenu(void);
/* EOF */

View file

@ -1,7 +1,7 @@
/*
* Windows regedit.exe registry editor implementation.
*
* Copyright (C) 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
@ -15,373 +15,242 @@
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __REACTOS__
#include <stdlib.h>
#include <windows.h>
#include <commctrl.h>
#include <shellapi.h>
#include "wine/debug.h"
#include "main.h"
#else
#include "regedit.h"
#endif
static const LPCWSTR usage =
L"Usage:\n"
L" regedit filenames\n"
L" regedit /E filename [regpath]\n"
L" regedit /D regpath\n"
L"\n"
L"filenames - List of registry files names\n"
L"filename - Registry file name\n"
L"regpath - Name of the registry key\n"
L"\n"
L"When is called without any switches adds contents of the specified\n"
L"registry files to the registry.\n"
L"\n"
L"Switches:\n"
L" /E - Exports contents of the specified registry key to the specified\n"
L" file. Exports the whole registry if no key is specified.\n"
L" /D - Deletes specified registry key\n"
L" /S - Silent execution, can be used with any other switch.\n"
L" The only existing mode, exists for compatibility with Windows regedit.\n"
L" /V - Advanced mode, can be used with any other switch.\n"
L" Ignored, exists for compatibility with Windows regedit.\n"
L" /L - Location of system.dat file. Can be used with any other switch.\n"
L" Ignored. Exists for compatibility with Windows regedit.\n"
L" /R - Location of user.dat file. Can be used with any other switch.\n"
L" Ignored. Exists for compatibility with Windows regedit.\n"
L" /? - Print this help. Any other switches are ignored.\n"
L" /C - Create registry from. Not implemented.\n"
L"\n"
L"The switches are case-insensitive, can be prefixed either by '-' or '/'.\n"
L"This program is command-line compatible with Microsoft Windows\n"
L"regedit.\n";
WINE_DEFAULT_DEBUG_CHANNEL(regedit);
typedef enum
static void output_writeconsole(const WCHAR *str, DWORD wlen)
{
ACTION_UNDEF, ACTION_ADD, ACTION_EXPORT, ACTION_DELETE
} REGEDIT_ACTION;
DWORD count;
if (!WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), str, wlen, &count, NULL))
{
DWORD len;
char *msgA;
LPCWSTR getAppName(void)
{
return L"regedit";
/* WriteConsole() fails on Windows if its output is redirected. If this occurs,
* we should call WriteFile() with OEM code page.
*/
len = WideCharToMultiByte(GetOEMCP(), 0, str, wlen, NULL, 0, NULL, NULL);
msgA = malloc(len);
if (!msgA) return;
WideCharToMultiByte(GetOEMCP(), 0, str, wlen, msgA, len, NULL, NULL);
WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), msgA, len, &count, FALSE);
free(msgA);
}
}
/******************************************************************************
* Copies file name from command line string to the buffer.
* 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;
*
* params:
* command_line - command line current position pointer
* where *s[0] is the first symbol of the file name.
* file_name - buffer to write the file name to.
*/
void get_file_name(LPWSTR *command_line, LPWSTR file_name)
static void output_formatstring(const WCHAR *fmt, va_list va_args)
{
WCHAR *s = *command_line;
size_t pos = 0; /* position of pointer "s" in *command_line */
file_name[0] = 0;
WCHAR *str;
DWORD len;
if (!s[0])
#ifdef __REACTOS__
SetLastError(NO_ERROR);
#endif
len = FormatMessageW(FORMAT_MESSAGE_FROM_STRING|FORMAT_MESSAGE_ALLOCATE_BUFFER,
fmt, 0, 0, (WCHAR *)&str, 0, &va_args);
#ifdef __REACTOS__
if (len == 0 && GetLastError() != NO_ERROR)
#else
if (len == 0 && GetLastError() != ERROR_NO_WORK_DONE)
#endif
{
WINE_FIXME("Could not format string: le=%lu, fmt=%s\n", GetLastError(), wine_dbgstr_w(fmt));
return;
}
if (s[0] == L'"')
{
s++;
(*command_line)++;
while(s[0] != L'"')
{
if (!s[0])
{
fwprintf(stderr, L"%s: Unexpected end of file name!\n", getAppName());
exit(1);
}
s++;
pos++;
}
}
else
{
while(s[0] && !iswspace(s[0]))
{
s++;
pos++;
}
}
memcpy(file_name, *command_line, pos * sizeof(WCHAR));
/* remove the last backslash */
if (file_name[pos - 1] == L'\\')
{
file_name[pos - 1] = L'\0';
}
else
{
file_name[pos] = L'\0';
}
if (s[0])
{
s++;
pos++;
}
while(s[0] && iswspace(s[0]))
{
s++;
pos++;
}
(*command_line) += pos;
output_writeconsole(str, len);
LocalFree(str);
}
BOOL PerformRegAction(REGEDIT_ACTION action, LPWSTR s, BOOL silent)
void WINAPIV output_message(unsigned int id, ...)
{
switch (action)
WCHAR fmt[1536];
va_list va_args;
if (!LoadStringW(GetModuleHandleW(NULL), id, fmt, ARRAY_SIZE(fmt)))
{
case ACTION_ADD:
{
WCHAR szText[512];
WCHAR filename[MAX_PATH];
LPWSTR command_line = s;
UINT count = 0, mbType = MB_YESNO;
FILE *fp;
WINE_FIXME("LoadString failed with %ld\n", GetLastError());
return;
}
va_start(va_args, id);
output_formatstring(fmt, va_args);
va_end(va_args);
}
get_file_name(&command_line, filename);
while (filename[0])
{
count++;
get_file_name(&command_line, filename);
}
void WINAPIV error_exit(unsigned int id, ...)
{
WCHAR fmt[1536];
va_list va_args;
if (count == 0)
{
InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, NULL, L"No file name is specified.");
InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, szTitle, usage);
exit(4);
}
if (!LoadStringW(GetModuleHandleW(NULL), id, fmt, ARRAY_SIZE(fmt)))
{
#ifndef __REACTOS__
WINE_FIXME("LoadString failed with %lu\n", GetLastError());
#endif
return;
}
va_start(va_args, id);
output_formatstring(fmt, va_args);
va_end(va_args);
if (count > 1)
{
/* Enable three buttons if we have more than one file */
mbType = MB_YESNOCANCEL;
}
exit(0); /* regedit.exe always terminates with error code zero */
}
get_file_name(&s, filename);
while (filename[0])
{
/* Request import confirmation */
if (!silent)
{
int choice;
typedef enum {
ACTION_ADD, ACTION_EXPORT, ACTION_DELETE
} REGEDIT_ACTION;
LoadStringW(hInst, IDS_IMPORT_PROMPT, szText, COUNT_OF(szText));
static void PerformRegAction(REGEDIT_ACTION action, WCHAR **argv, int *i)
{
switch (action) {
case ACTION_ADD: {
WCHAR *filename = argv[*i];
WCHAR *realname = NULL;
FILE *reg_file;
choice = InfoMessageBox(NULL, mbType | MB_ICONQUESTION, szTitle, szText, filename);
switch (choice)
{
case IDNO:
goto cont;
case IDCANCEL:
/* The cancel case is useful if the user is importing more than one registry file
at a time, and wants to back out anytime during the import process. This way, the
user doesn't have to resort to ending the regedit process abruptly just to cancel
the operation. */
return TRUE;
default:
break;
}
}
/* Open the file */
fp = _wfopen(filename, L"r");
/* Import it */
if (fp == NULL || !import_registry_file(fp))
{
/* Error opening the file */
if (!silent)
{
LoadStringW(hInst, IDS_IMPORT_ERROR, szText, COUNT_OF(szText));
InfoMessageBox(NULL, MB_OK | MB_ICONERROR, szTitle, szText, filename);
}
}
else
{
/* Show successful import */
if (!silent)
{
LoadStringW(hInst, IDS_IMPORT_OK, szText, COUNT_OF(szText));
InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, szTitle, szText, filename);
}
}
/* Close the file */
if (fp) fclose(fp);
cont:
get_file_name(&s, filename);
}
break;
}
case ACTION_DELETE:
{
WCHAR reg_key_name[KEY_MAX_LEN];
get_file_name(&s, reg_key_name);
if (!reg_key_name[0])
{
InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, NULL, L"No registry key is specified for removal.");
InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, szTitle, usage);
exit(6);
}
delete_registry_key(reg_key_name);
break;
}
case ACTION_EXPORT:
{
WCHAR filename[MAX_PATH];
filename[0] = L'\0';
get_file_name(&s, filename);
if (!filename[0])
{
InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, NULL, L"No file name is specified.");
InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, szTitle, usage);
exit(7);
}
if (s[0])
{
WCHAR reg_key_name[KEY_MAX_LEN];
get_file_name(&s, reg_key_name);
export_registry_key(filename, reg_key_name, REG_FORMAT_4);
}
if (!lstrcmpW(filename, L"-"))
reg_file = stdin;
else
{
export_registry_key(filename, NULL, REG_FORMAT_4);
int size;
size = SearchPathW(NULL, filename, NULL, 0, NULL, NULL);
if (size > 0)
{
realname = malloc(size * sizeof(WCHAR));
size = SearchPathW(NULL, filename, NULL, size, realname, NULL);
}
if (size == 0)
{
output_message(STRING_FILE_NOT_FOUND, filename);
free(realname);
return;
}
reg_file = _wfopen(realname, L"rb");
if (reg_file == NULL)
{
_wperror(L"regedit");
output_message(STRING_CANNOT_OPEN_FILE, filename);
free(realname);
return;
}
}
import_registry_file(reg_file);
if (realname)
{
free(realname);
fclose(reg_file);
}
break;
}
default:
fwprintf(stderr, L"%s: Unhandled action!\n", getAppName());
exit(8);
case ACTION_DELETE:
delete_registry_key(argv[*i]);
break;
case ACTION_EXPORT: {
WCHAR *filename = argv[*i];
WCHAR *key_name = argv[++(*i)];
if (key_name && *key_name)
export_registry_key(filename, key_name, REG_FORMAT_5);
else
export_registry_key(filename, NULL, REG_FORMAT_5);
break;
}
default:
error_exit(STRING_UNHANDLED_ACTION);
break;
}
}
BOOL ProcessCmdLine(WCHAR *cmdline)
{
WCHAR **argv;
int argc, i;
REGEDIT_ACTION action = ACTION_ADD;
argv = CommandLineToArgvW(cmdline, &argc);
if (!argv)
return FALSE;
if (argc == 1)
{
LocalFree(argv);
return FALSE;
}
for (i = 1; i < argc; i++)
{
if (argv[i][0] != '/' && argv[i][0] != '-')
break; /* No flags specified. */
if (!argv[i][1] && argv[i][0] == '-')
break; /* '-' is a filename. It indicates we should use stdin. */
if (argv[i][1] && argv[i][2] && argv[i][2] != ':')
break; /* This is a file path beginning with '/'. */
switch (towupper(argv[i][1]))
{
case '?':
error_exit(STRING_USAGE);
break;
case 'D':
action = ACTION_DELETE;
break;
case 'E':
action = ACTION_EXPORT;
break;
case 'C':
case 'L':
case 'M':
case 'R':
/* unhandled */;
break;
case 'S':
case 'V':
/* ignored */;
break;
default:
output_message(STRING_INVALID_SWITCH, argv[i]);
error_exit(STRING_HELP);
}
}
if (i == argc)
{
switch (action)
{
case ACTION_ADD:
case ACTION_EXPORT:
output_message(STRING_NO_FILENAME);
break;
case ACTION_DELETE:
output_message(STRING_NO_REG_KEY);
break;
}
error_exit(STRING_HELP);
}
for (; i < argc; i++)
PerformRegAction(action, argv, &i);
LocalFree(argv);
return TRUE;
}
/**
* Process unknown switch.
*
* Params:
* chu - the switch character in upper-case.
* s - the command line string where s points to the switch character.
*/
static void error_unknown_switch(WCHAR chu, LPWSTR s)
{
if (iswalpha(chu))
{
fwprintf(stderr, L"%s: Undefined switch /%c!\n", getAppName(), chu);
}
else
{
fwprintf(stderr, L"%s: Alphabetic character is expected after '%c' "
L"in switch specification\n", getAppName(), *(s - 1));
}
exit(1);
}
BOOL ProcessCmdLine(LPWSTR lpCmdLine)
{
BOOL silent = FALSE;
REGEDIT_ACTION action = ACTION_UNDEF;
LPWSTR s = lpCmdLine; /* command line pointer */
WCHAR ch = *s; /* current character */
while (ch && ((ch == L'-') || (ch == L'/')))
{
WCHAR chu;
WCHAR ch2;
s++;
ch = *s;
ch2 = *(s + 1);
chu = towupper(ch);
if (!ch2 || iswspace(ch2))
{
if (chu == L'S')
{
/* Silence dialogs */
silent = TRUE;
}
else if (chu == L'V')
{
/* Ignore this switch */
}
else
{
switch (chu)
{
case L'D':
action = ACTION_DELETE;
break;
case L'E':
action = ACTION_EXPORT;
break;
case L'?':
InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, szTitle, usage);
exit(3);
break;
default:
error_unknown_switch(chu, s);
break;
}
}
s++;
}
else
{
if (ch2 == L':')
{
switch (chu)
{
case L'L':
/* fall through */
case L'R':
s += 2;
while (*s && !iswspace(*s))
{
s++;
}
break;
default:
error_unknown_switch(chu, s);
break;
}
}
else
{
/* this is a file name, starting from '/' */
s--;
break;
}
}
/* skip spaces to the next parameter */
ch = *s;
while (ch && iswspace(ch))
{
s++;
ch = *s;
}
}
if (*s && action == ACTION_UNDEF)
action = ACTION_ADD;
if (action != ACTION_UNDEF)
return PerformRegAction(action, s, silent);
else
return FALSE;
}

View file

@ -8,10 +8,11 @@
#include <shlwapi.h>
#include <stdio.h>
#include <aclapi.h>
#include <shellapi.h>
#include "main.h"
#include "regproc.h"
#include "hexedit.h"
#include "security.h"
#include "wine/debug.h"
#endif /* _REGEDIT_H */

File diff suppressed because it is too large Load diff

View file

@ -1,31 +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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#pragma once
#define KEY_MAX_LEN 1024
#define REG_FORMAT_5 1
#define REG_FORMAT_4 2
BOOL export_registry_key(WCHAR *file_name, WCHAR *reg_key_name, DWORD format);
BOOL import_registry_file(FILE *in);
void delete_registry_key(WCHAR *reg_key_name);
WCHAR* GetWideString(const char* strA);
CHAR* GetMultiByteString(const WCHAR* strW);

View file

@ -299,3 +299,29 @@
#define ID_ACCEL 3000
#define IDC_STATIC -1
/* Command-line strings */
#define STRING_USAGE 3001
#define STRING_INVALID_SWITCH 3002
#define STRING_HELP 3003
#define STRING_NO_FILENAME 3004
#define STRING_NO_REG_KEY 3005
#define STRING_FILE_NOT_FOUND 3006
#define STRING_CANNOT_OPEN_FILE 3007
#define STRING_UNHANDLED_ACTION 3008
#define STRING_OUT_OF_MEMORY 3009
#define STRING_INVALID_HEX 3010
#define STRING_CSV_HEX_ERROR 3011
#define STRING_ESCAPE_SEQUENCE 3012
#define STRING_UNKNOWN_DATA_FORMAT 3013
#define STRING_UNEXPECTED_EOL 3014
#define STRING_UNRECOGNIZED_LINE 3015
#define STRING_SETVALUE_FAILED 3016
#define STRING_OPEN_KEY_FAILED 3017
#define STRING_UNSUPPORTED_TYPE 3018
#define STRING_EXPORT_AS_BINARY 3019
#define STRING_INVALID_SYSTEM_KEY 3020
#define STRING_REG_KEY_NOT_FOUND 3021
#define STRING_DELETE_FAILED 3022
#define STRING_UNKNOWN_TYPE 3023
#define STRING_INVALID_LINE_SYNTAX 3024

View file

@ -447,7 +447,7 @@ ISecurityInformation_fnGetAccessRights(struct ISecurityInformation *this,
ULONG* piDefaultAccess)
{
*ppAccess = RegAccess;
*pcAccesses = COUNT_OF(RegAccess);
*pcAccesses = ARRAY_SIZE(RegAccess);
*piDefaultAccess = RegDefaultAccess;
return S_OK;
}
@ -475,7 +475,7 @@ ISecurityInformation_fnGetInheritTypes(struct ISecurityInformation *this,
if (obj->ObjectInfo.dwFlags & SI_CONTAINER)
{
*ppInheritTypes = RegInheritTypes;
*pcInheritTypes = COUNT_OF(RegInheritTypes);
*pcInheritTypes = ARRAY_SIZE(RegInheritTypes);
return S_OK;
}

View file

@ -101,7 +101,7 @@ extern void LoadSettings(void)
ShowWindow(hFrameWnd, SW_SHOWNORMAL);
/* Restore key position */
if (QueryStringValue(HKEY_CURRENT_USER, g_szGeneralRegKey, L"LastKey", szBuffer, COUNT_OF(szBuffer)) == ERROR_SUCCESS)
if (QueryStringValue(HKEY_CURRENT_USER, g_szGeneralRegKey, L"LastKey", szBuffer, ARRAY_SIZE(szBuffer)) == ERROR_SUCCESS)
{
SelectNode(g_pChildWnd->hTreeWnd, szBuffer);
}
@ -132,7 +132,7 @@ extern void SaveSettings(void)
rootName = get_root_key_name(hRootKey);
/* Load "My Computer" string and complete it */
if (LoadStringW(hInst, IDS_MY_COMPUTER, szBuffer, COUNT_OF(szBuffer)) &&
if (LoadStringW(hInst, IDS_MY_COMPUTER, szBuffer, ARRAY_SIZE(szBuffer)) &&
SUCCEEDED(StringCbCatW(szBuffer, sizeof(szBuffer), L"\\")) &&
SUCCEEDED(StringCbCatW(szBuffer, sizeof(szBuffer), rootName)) &&
SUCCEEDED(StringCbCatW(szBuffer, sizeof(szBuffer), L"\\")))

View file

@ -370,7 +370,7 @@ HTREEITEM InsertNode(HWND hwndTV, HTREEITEM hItem, LPWSTR name)
item.mask = TVIF_HANDLE | TVIF_TEXT;
item.hItem = hNewItem;
item.pszText = buf;
item.cchTextMax = COUNT_OF(buf);
item.cchTextMax = ARRAY_SIZE(buf);
if (!TreeView_GetItem(hwndTV, &item)) continue;
if (wcscmp(name, item.pszText) == 0) break;
}
@ -439,16 +439,12 @@ static BOOL InitTreeViewImageLists(HWND hwndTV)
{
HIMAGELIST himl; /* handle to image list */
HICON hico; /* handle to icon */
INT cx = GetSystemMetrics(SM_CXSMICON);
INT cy = GetSystemMetrics(SM_CYSMICON);
/* Create the image list. */
if ((himl = ImageList_Create(GetSystemMetrics(SM_CXSMICON),
GetSystemMetrics(SM_CYSMICON),
ILC_MASK | ILC_COLOR32,
0,
NUM_ICONS)) == NULL)
{
if ((himl = ImageList_Create(cx, cy, ILC_MASK, 0, NUM_ICONS)) == NULL)
return FALSE;
}
/* Add the open file, closed file, and document bitmaps. */
hico = LoadImageW(hInst,
@ -586,7 +582,7 @@ BOOL CreateNewKey(HWND hwndTV, HTREEITEM hItem)
else if (RegOpenKeyW(hRootKey, pszKeyPath, &hKey) != ERROR_SUCCESS)
goto done;
if (LoadStringW(hInst, IDS_NEW_KEY, szNewKeyFormat, COUNT_OF(szNewKeyFormat)) <= 0)
if (LoadStringW(hInst, IDS_NEW_KEY, szNewKeyFormat, ARRAY_SIZE(szNewKeyFormat)) <= 0)
goto done;
/* Need to create a new key with a unique name */
@ -700,9 +696,9 @@ BOOL TreeWndNotifyProc(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL *Result)
{
keyPath = GetItemPath(g_pChildWnd->hTreeWnd, TreeView_GetParent(g_pChildWnd->hTreeWnd, ptvdi->item.hItem), &hRootKey);
if (wcslen(keyPath))
_snwprintf(szBuffer, COUNT_OF(szBuffer), L"%s\\%s", keyPath, ptvdi->item.pszText);
_snwprintf(szBuffer, ARRAY_SIZE(szBuffer), L"%s\\%s", keyPath, ptvdi->item.pszText);
else
_snwprintf(szBuffer, COUNT_OF(szBuffer), L"%s", ptvdi->item.pszText);
_snwprintf(szBuffer, ARRAY_SIZE(szBuffer), L"%s", ptvdi->item.pszText);
keyPath = GetItemPath(g_pChildWnd->hTreeWnd, ptvdi->item.hItem, &hRootKey);
if (RegOpenKeyExW(hRootKey, szBuffer, 0, KEY_READ, &hKey) == ERROR_SUCCESS)
{
@ -715,7 +711,7 @@ BOOL TreeWndNotifyProc(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL *Result)
nRenResult = RenameKey(hRootKey, keyPath, ptvdi->item.pszText);
if (nRenResult != ERROR_SUCCESS)
{
LoadStringW(hInst, IDS_ERROR, Caption, COUNT_OF(Caption));
LoadStringW(hInst, IDS_ERROR, Caption, ARRAY_SIZE(Caption));
ErrorMessageBox(hWnd, Caption, nRenResult);
lResult = FALSE;
}
@ -778,7 +774,7 @@ BOOL SelectNode(HWND hwndTV, LPCWSTR keyPath)
TVITEMW tvi;
/* Load "My Computer" string... */
LoadStringW(hInst, IDS_MY_COMPUTER, szBuffer, COUNT_OF(szBuffer));
LoadStringW(hInst, IDS_MY_COMPUTER, szBuffer, ARRAY_SIZE(szBuffer));
wcscat(szBuffer, L"\\");
/* ... and remove it from the key path */
@ -820,7 +816,7 @@ BOOL SelectNode(HWND hwndTV, LPCWSTR keyPath)
tvi.hItem = hChildItem;
tvi.mask = TVIF_TEXT | TVIF_CHILDREN;
tvi.pszText = szBuffer;
tvi.cchTextMax = COUNT_OF(szBuffer);
tvi.cchTextMax = ARRAY_SIZE(szBuffer);
(void)TreeView_GetItem(hwndTV, &tvi);

View file

@ -247,7 +247,6 @@ base/applications/games/winmine # Synced to WineStaging-2.16 with our own re
base/applications/extrac32 # Synced to WineStaging-4.0
base/applications/iexplore # Synced to WineStaging-3.3
base/applications/notepad # Forked at Wine-20041201
base/applications/regedit # Out of sync
base/applications/winhlp32 # Synced to WineStaging-4.0
base/applications/wordpad # Synced to WineStaging-1.9.16
base/applications/write # Synced to WineStaging-3.3
@ -320,6 +319,10 @@ msvcrt -
sdk/lib/crt/wine/undname.c # Synced to WineStaging-1.9.16
sdk/lib/crt/process/thread.c # Synced to WineStaging-1.7.55
regedit
base/applications/regedit/regedit.c # Synced to Wine-7.17
base/applications/regedit/regproc.c # Synced to Wine-7.17
user32 -
win32ss/user/user32/controls/button.c # Synced to WineStaging-1.7.37
win32ss/user/user32/controls/combo.c # Synced to WineStaging-1.7.37

View file

@ -152,6 +152,15 @@ static void open_key_(unsigned line, const HKEY base, const char *path, const DW
lok(lr == ERROR_SUCCESS, "RegOpenKeyExA failed: %d\n", lr);
}
#define close_key(k) close_key_(__LINE__,k)
static void close_key_(unsigned line, HKEY hkey)
{
LONG lr;
lr = RegCloseKey(hkey);
lok(lr == ERROR_SUCCESS, "RegCloseKey failed: %d\n", lr);
}
#define verify_key(k,s) verify_key_(__LINE__,k,s)
static void verify_key_(unsigned line, HKEY key_base, const char *subkey)
{
@ -273,9 +282,8 @@ static void test_basic_import(void)
char buffer[256];
BYTE hex[8];
lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE);
ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND,
"RegDeleteKeyA failed: %d\n", lr);
delete_tree(HKEY_CURRENT_USER, KEY_BASE);
verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
@ -483,18 +491,16 @@ static void test_basic_import(void)
"\"Wine\\\\31\"=\"Test value\"\n\n");
open_key(hkey, "Subkey\"1", 0, &subkey);
verify_reg(subkey, "Wine\\31", REG_SZ, "Test value", 11, 0);
lr = RegCloseKey(subkey);
ok(lr == ERROR_SUCCESS, "got %d, expected 0\n", lr);
delete_key(HKEY_CURRENT_USER, KEY_BASE "\\Subkey\"1");
close_key(subkey);
delete_key(hkey, "Subkey\"1");
exec_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey/2]\n"
"\"123/\\\"4;'5\"=\"Random value name\"\n\n");
open_key(hkey, "Subkey/2", 0, &subkey);
verify_reg(subkey, "123/\"4;'5", REG_SZ, "Random value name", 18, 0);
lr = RegCloseKey(subkey);
ok(lr == ERROR_SUCCESS, "got %d, expected 0\n", lr);
delete_key(HKEY_CURRENT_USER, KEY_BASE "\\Subkey/2");
close_key(subkey);
delete_key(hkey, "Subkey/2");
/* Test the accepted range of the hex-based data types */
exec_import_str("REGEDIT4\n\n"
@ -671,9 +677,35 @@ static void test_basic_import(void)
verify_reg(hkey, "Wine22h", REG_BINARY, NULL, 0, 0);
verify_reg(hkey, "Wine22i", REG_NONE, NULL, 0, 0);
RegCloseKey(hkey);
/* Test with escaped null characters */
exec_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
"\"Wine23a\"=\"\\\\0\"\n"
"\"Wine23b\"=\"\\\\0\\\\0\"\n"
"\"Wine23c\"=\"Value1\\\\0\"\n"
"\"Wine23d\"=\"Value2\\\\0\\\\0\\\\0\\\\0\"\n"
"\"Wine23e\"=\"Value3\\\\0Value4\"\n"
"\"Wine23f\"=\"\\\\0Value5\"\n\n");
verify_reg(hkey, "Wine23a", REG_SZ, "\\0", 3, 0);
verify_reg(hkey, "Wine23b", REG_SZ, "\\0\\0", 5, 0);
verify_reg(hkey, "Wine23c", REG_SZ, "Value1\\0", 9, 0);
verify_reg(hkey, "Wine23d", REG_SZ, "Value2\\0\\0\\0\\0", 15, 0);
verify_reg(hkey, "Wine23e", REG_SZ, "Value3\\0Value4", 15, 0);
verify_reg(hkey, "Wine23f", REG_SZ, "\\0Value5", 9, 0);
delete_key(HKEY_CURRENT_USER, KEY_BASE);
/* Test forward and back slashes */
exec_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
"\"count/up\"=\"one/two/three\"\n"
"\"\\\\foo\\\\bar\"=\"\"\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\https://winehq.org]\n\n");
verify_reg(hkey, "count/up", REG_SZ, "one/two/three", 14, 0);
verify_reg(hkey, "\\foo\\bar", REG_SZ, "", 1, 0);
verify_key(hkey, "https://winehq.org");
close_key(hkey);
delete_tree(HKEY_CURRENT_USER, KEY_BASE);
}
static void test_basic_import_unicode(void)
@ -685,8 +717,8 @@ static void test_basic_import_unicode(void)
char buffer[256];
BYTE hex[8];
lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE);
ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr);
delete_tree(HKEY_CURRENT_USER, KEY_BASE);
verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
@ -895,18 +927,16 @@ static void test_basic_import_unicode(void)
"\"Wine\\\\31\"=\"Test value\"\n\n");
open_key(hkey, "Subkey\"1", 0, &subkey);
verify_reg(subkey, "Wine\\31", REG_SZ, "Test value", 11, 0);
lr = RegCloseKey(subkey);
ok(lr == ERROR_SUCCESS, "got %d, expected 0\n", lr);
delete_key(HKEY_CURRENT_USER, KEY_BASE "\\Subkey\"1");
close_key(subkey);
delete_key(hkey, "Subkey\"1");
exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey/2]\n"
"\"123/\\\"4;'5\"=\"Random value name\"\n\n");
open_key(hkey, "Subkey/2", 0, &subkey);
verify_reg(subkey, "123/\"4;'5", REG_SZ, "Random value name", 18, 0);
lr = RegCloseKey(subkey);
ok(lr == ERROR_SUCCESS, "got %d, expected 0\n", lr);
delete_key(HKEY_CURRENT_USER, KEY_BASE "\\Subkey/2");
close_key(subkey);
delete_key(hkey, "Subkey/2");
/* Test the accepted range of the hex-based data types */
exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
@ -1086,29 +1116,47 @@ static void test_basic_import_unicode(void)
verify_reg(hkey, "Wine22h", REG_BINARY, NULL, 0, 0);
verify_reg(hkey, "Wine22i", REG_NONE, NULL, 0, 0);
RegCloseKey(hkey);
/* Test with escaped null characters */
exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
"\"Wine23a\"=\"\\\\0\"\n"
"\"Wine23b\"=\"\\\\0\\\\0\"\n"
"\"Wine23c\"=\"Value1\\\\0\"\n"
"\"Wine23d\"=\"Value2\\\\0\\\\0\\\\0\\\\0\"\n"
"\"Wine23e\"=\"Value3\\\\0Value4\"\n"
"\"Wine23f\"=\"\\\\0Value5\"\n\n");
verify_reg(hkey, "Wine23a", REG_SZ, "\\0", 3, 0);
verify_reg(hkey, "Wine23b", REG_SZ, "\\0\\0", 5, 0);
verify_reg(hkey, "Wine23c", REG_SZ, "Value1\\0", 9, 0);
verify_reg(hkey, "Wine23d", REG_SZ, "Value2\\0\\0\\0\\0", 15, 0);
verify_reg(hkey, "Wine23e", REG_SZ, "Value3\\0Value4", 15, 0);
verify_reg(hkey, "Wine23f", REG_SZ, "\\0Value5", 9, 0);
delete_key(HKEY_CURRENT_USER, KEY_BASE);
/* Test forward and back slashes */
exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
"\"count/up\"=\"one/two/three\"\n"
"\"\\\\foo\\\\bar\"=\"\"\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\https://winehq.org]\n\n");
verify_reg(hkey, "count/up", REG_SZ, "one/two/three", 14, 0);
verify_reg(hkey, "\\foo\\bar", REG_SZ, "", 1, 0);
verify_key(hkey, "https://winehq.org");
close_key(hkey);
delete_tree(HKEY_CURRENT_USER, KEY_BASE);
}
static void test_basic_import_31(void)
{
HKEY hkey;
LONG lr;
DWORD dispos;
lr = RegDeleteKeyA(HKEY_CLASSES_ROOT, KEY_BASE);
ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND,
"RegDeleteKeyA failed: %d\n", lr);
RegCreateKeyExA(HKEY_CLASSES_ROOT, KEY_BASE, 0, NULL, REG_OPTION_NON_VOLATILE,
KEY_READ|KEY_SET_VALUE, NULL, &hkey, &dispos);
/* Check if regedit.exe is running with elevated privileges */
lr = RegCreateKeyExA(HKEY_CLASSES_ROOT, KEY_BASE, 0, NULL, REG_OPTION_NON_VOLATILE,
KEY_READ, NULL, &hkey, NULL);
if (lr == ERROR_ACCESS_DENIED)
{
win_skip("regedit.exe is not running with elevated privileges; "
"skipping Windows 3.1 import tests\n");
return;
}
if (dispos == REG_OPENED_EXISTING_KEY)
delete_value(hkey, NULL);
/* Test simple value */
exec_import_str("REGEDIT\r\n"
@ -1148,19 +1196,18 @@ static void test_basic_import_31(void)
"HKEY_CLASSES_ROOT\\" KEY_BASE " = No newline");
verify_reg(hkey, "", REG_SZ, "No newline", 11, 0);
RegCloseKey(hkey);
close_key(hkey);
delete_key(HKEY_CLASSES_ROOT, KEY_BASE);
}
static void test_invalid_import(void)
{
LONG lr;
HKEY hkey;
DWORD dword = 0x8;
lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE);
ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr);
delete_tree(HKEY_CURRENT_USER, KEY_BASE);
verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
@ -1641,12 +1688,12 @@ static void test_invalid_import(void)
/* Test with embedded null characters */
exec_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
"\"Wine33a\"=\"\\0\n"
"\"Wine33b\"=\"\\0\\0\n"
"\"Wine33c\"=\"Value1\\0\n"
"\"Wine33d\"=\"Value2\\0\\0\\0\\0\n"
"\"Wine33e\"=\"Value3\\0Value4\n"
"\"Wine33f\"=\"\\0Value4\n\n");
"\"Wine33a\"=\"\\0\"\n"
"\"Wine33b\"=\"\\0\\0\"\n"
"\"Wine33c\"=\"Value1\\0\"\n"
"\"Wine33d\"=\"Value2\\0\\0\\0\\0\"\n"
"\"Wine33e\"=\"Value3\\0Value4\"\n"
"\"Wine33f\"=\"\\0Value5\"\n\n");
verify_reg_nonexist(hkey, "Wine33a");
verify_reg_nonexist(hkey, "Wine33b");
verify_reg_nonexist(hkey, "Wine33c");
@ -1654,19 +1701,18 @@ static void test_invalid_import(void)
verify_reg_nonexist(hkey, "Wine33e");
verify_reg_nonexist(hkey, "Wine33f");
RegCloseKey(hkey);
close_key(hkey);
delete_key(HKEY_CURRENT_USER, KEY_BASE);
}
static void test_invalid_import_unicode(void)
{
LONG lr;
HKEY hkey;
DWORD dword = 0x8;
lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE);
ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr);
delete_tree(HKEY_CURRENT_USER, KEY_BASE);
verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
@ -2153,12 +2199,12 @@ static void test_invalid_import_unicode(void)
/* Test with embedded null characters */
exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
"\"Wine33a\"=\"\\0\n"
"\"Wine33b\"=\"\\0\\0\n"
"\"Wine33c\"=\"Value1\\0\n"
"\"Wine33d\"=\"Value2\\0\\0\\0\\0\n"
"\"Wine33e\"=\"Value3\\0Value4\n"
"\"Wine33f\"=\"\\0Value4\n\n");
"\"Wine33a\"=\"\\0\"\n"
"\"Wine33b\"=\"\\0\\0\"\n"
"\"Wine33c\"=\"Value1\\0\"\n"
"\"Wine33d\"=\"Value2\\0\\0\\0\\0\"\n"
"\"Wine33e\"=\"Value3\\0Value4\"\n"
"\"Wine33f\"=\"\\0Value5\"\n\n");
verify_reg_nonexist(hkey, "Wine33a");
verify_reg_nonexist(hkey, "Wine33b");
verify_reg_nonexist(hkey, "Wine33c");
@ -2166,7 +2212,7 @@ static void test_invalid_import_unicode(void)
verify_reg_nonexist(hkey, "Wine33e");
verify_reg_nonexist(hkey, "Wine33f");
RegCloseKey(hkey);
close_key(hkey);
delete_key(HKEY_CURRENT_USER, KEY_BASE);
}
@ -2174,17 +2220,13 @@ static void test_invalid_import_unicode(void)
static void test_invalid_import_31(void)
{
HKEY hkey;
LONG lr;
DWORD dispos;
/* Check if regedit.exe is running with elevated privileges */
lr = RegCreateKeyExA(HKEY_CLASSES_ROOT, KEY_BASE, 0, NULL, REG_OPTION_NON_VOLATILE,
KEY_READ, NULL, &hkey, NULL);
if (lr == ERROR_ACCESS_DENIED)
{
win_skip("regedit.exe is not running with elevated privileges; "
"skipping Windows 3.1 invalid import tests\n");
return;
}
RegCreateKeyExA(HKEY_CLASSES_ROOT, KEY_BASE, 0, NULL, REG_OPTION_NON_VOLATILE,
KEY_READ|KEY_SET_VALUE, NULL, &hkey, &dispos);
if (dispos == REG_OPENED_EXISTING_KEY)
delete_value(hkey, NULL);
/* Test character validity at the start of the line */
exec_import_str("REGEDIT\r\n"
@ -2220,19 +2262,18 @@ static void test_invalid_import_31(void)
"Hkey_Classes_Root\\" KEY_BASE " = Value3c\r\n");
verify_reg_nonexist(hkey, "");
RegCloseKey(hkey);
close_key(hkey);
delete_key(HKEY_CLASSES_ROOT, KEY_BASE);
}
static void test_comments(void)
{
LONG lr;
HKEY hkey;
DWORD dword;
lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE);
ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr);
delete_tree(HKEY_CURRENT_USER, KEY_BASE);
verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
@ -2459,19 +2500,18 @@ static void test_comments(void)
" 61,74,69,6f,6e,00,00\n\n");
verify_reg_nonexist(hkey, "Wine29d");
RegCloseKey(hkey);
close_key(hkey);
delete_key(HKEY_CURRENT_USER, KEY_BASE);
}
static void test_comments_unicode(void)
{
LONG lr;
HKEY hkey;
DWORD dword;
lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE);
ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr);
delete_tree(HKEY_CURRENT_USER, KEY_BASE);
verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
@ -2700,7 +2740,7 @@ static void test_comments_unicode(void)
" 61,00,74,00,69,00,6f,00,6e,00,00,00,00,00\n\n");
verify_reg_nonexist(hkey, "Wine29d");
RegCloseKey(hkey);
close_key(hkey);
delete_key(HKEY_CURRENT_USER, KEY_BASE);
}
@ -2708,11 +2748,10 @@ static void test_comments_unicode(void)
static void test_import_with_whitespace(void)
{
HKEY hkey;
LONG lr;
DWORD dword;
lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE);
ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr);
delete_tree(HKEY_CURRENT_USER, KEY_BASE);
verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_str(" REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n\n");
@ -2847,8 +2886,7 @@ static void test_import_with_whitespace(void)
" 61,74,69,6f,6e,00,00\n\n");
verify_reg(hkey, "Wine10b", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
lr = RegCloseKey(hkey);
ok(lr == ERROR_SUCCESS, "RegCloseKey failed: got %d, expected 0\n", lr);
close_key(hkey);
delete_key(HKEY_CURRENT_USER, KEY_BASE);
}
@ -2856,11 +2894,10 @@ static void test_import_with_whitespace(void)
static void test_import_with_whitespace_unicode(void)
{
HKEY hkey;
LONG lr;
DWORD dword;
lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE);
ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr);
delete_tree(HKEY_CURRENT_USER, KEY_BASE);
verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_wstr("\xef\xbb\xbf Windows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n\n");
@ -2995,8 +3032,7 @@ static void test_import_with_whitespace_unicode(void)
" 61,00,74,00,69,00,6f,00,6e,00,00,00,00,00\n\n");
verify_reg(hkey, "Wine10b", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
lr = RegCloseKey(hkey);
ok(lr == ERROR_SUCCESS, "RegCloseKey failed: got %d, expected 0\n", lr);
close_key(hkey);
delete_key(HKEY_CURRENT_USER, KEY_BASE);
}
@ -3004,10 +3040,9 @@ static void test_import_with_whitespace_unicode(void)
static void test_key_creation_and_deletion(void)
{
HKEY hkey, subkey;
LONG lr;
lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE);
ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr);
delete_tree(HKEY_CURRENT_USER, KEY_BASE);
verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n\n");
@ -3048,7 +3083,7 @@ static void test_key_creation_and_deletion(void)
verify_key(hkey, "Subkey1e");
open_key(hkey, "Subkey1e", 0, &subkey);
verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0);
RegCloseKey(subkey);
close_key(subkey);
delete_key(hkey, "Subkey1e");
exec_import_str("REGEDIT4\n\n"
@ -3059,7 +3094,7 @@ static void test_key_creation_and_deletion(void)
verify_key(hkey, "Subkey1f");
open_key(hkey, "Subkey1f\\\\", 0, &subkey);
verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0);
RegCloseKey(subkey);
close_key(subkey);
delete_key(hkey, "Subkey1f\\\\");
exec_import_str("REGEDIT4\n\n"
@ -3071,7 +3106,7 @@ static void test_key_creation_and_deletion(void)
verify_key(hkey, "Subkey1g");
open_key(hkey, "Subkey1g\\\\", 0, &subkey);
verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0);
RegCloseKey(subkey);
close_key(subkey);
delete_key(hkey, "Subkey1g\\\\");
/* Test key deletion. We start by creating some registry keys. */
@ -3135,8 +3170,7 @@ static void test_key_creation_and_deletion(void)
verify_key_nonexist(hkey, "Subkey4b");
verify_reg_nonexist(hkey, "Wine1b");
lr = RegCloseKey(hkey);
ok(lr == ERROR_SUCCESS, "RegCloseKey failed: got %d, expected 0\n", lr);
close_key(hkey);
delete_key(HKEY_CURRENT_USER, KEY_BASE);
}
@ -3144,10 +3178,9 @@ static void test_key_creation_and_deletion(void)
static void test_key_creation_and_deletion_unicode(void)
{
HKEY hkey, subkey;
LONG lr;
lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE);
ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr);
delete_tree(HKEY_CURRENT_USER, KEY_BASE);
verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n\n");
@ -3188,7 +3221,7 @@ static void test_key_creation_and_deletion_unicode(void)
verify_key(hkey, "Subkey1e");
open_key(hkey, "Subkey1e", 0, &subkey);
verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0);
RegCloseKey(subkey);
close_key(subkey);
delete_key(hkey, "Subkey1e");
exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
@ -3199,7 +3232,7 @@ static void test_key_creation_and_deletion_unicode(void)
verify_key(hkey, "Subkey1f");
open_key(hkey, "Subkey1f\\\\", 0, &subkey);
verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0);
RegCloseKey(subkey);
close_key(subkey);
delete_key(hkey, "Subkey1f\\\\");
exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
@ -3211,7 +3244,7 @@ static void test_key_creation_and_deletion_unicode(void)
verify_key(hkey, "Subkey1g");
open_key(hkey, "Subkey1g\\\\", 0, &subkey);
verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0);
RegCloseKey(subkey);
close_key(subkey);
delete_key(hkey, "Subkey1g\\\\");
/* Test key deletion. We start by creating some registry keys. */
@ -3275,8 +3308,7 @@ static void test_key_creation_and_deletion_unicode(void)
verify_key_nonexist(hkey, "Subkey4b");
verify_reg_nonexist(hkey, "Wine1b");
lr = RegCloseKey(hkey);
ok(lr == ERROR_SUCCESS, "RegCloseKey failed: got %d, expected 0\n", lr);
close_key(hkey);
delete_key(HKEY_CURRENT_USER, KEY_BASE);
}
@ -3284,12 +3316,11 @@ static void test_key_creation_and_deletion_unicode(void)
static void test_value_deletion(void)
{
HKEY hkey;
LONG lr;
DWORD dword = 0x8;
BYTE hex[4] = {0x11, 0x22, 0x33, 0x44};
lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE);
ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr);
delete_tree(HKEY_CURRENT_USER, KEY_BASE);
verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n\n");
@ -3328,8 +3359,7 @@ static void test_value_deletion(void)
verify_reg_nonexist(hkey, "Wine46e");
verify_reg(hkey, "Wine46f", REG_NONE, "V\0a\0l\0u\0e\0\0", 12, 0);
lr = RegCloseKey(hkey);
ok(lr == ERROR_SUCCESS, "RegCloseKey failed: got %d, expected 0\n", lr);
close_key(hkey);
delete_key(HKEY_CURRENT_USER, KEY_BASE);
}
@ -3338,12 +3368,11 @@ static void test_value_deletion(void)
static void test_value_deletion_unicode(void)
{
HKEY hkey;
LONG lr;
DWORD dword = 0x8;
BYTE hex[4] = {0x11, 0x22, 0x33, 0x44};
lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE);
ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr);
delete_tree(HKEY_CURRENT_USER, KEY_BASE);
verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n\n");
@ -3383,8 +3412,7 @@ static void test_value_deletion_unicode(void)
verify_reg_nonexist(hkey, "Wine46e");
verify_reg(hkey, "Wine46f", REG_NONE, "V\0a\0l\0u\0e\0\0", 12, 0);
lr = RegCloseKey(hkey);
ok(lr == ERROR_SUCCESS, "RegCloseKey failed: got %d, expected 0\n", lr);
close_key(hkey);
delete_key(HKEY_CURRENT_USER, KEY_BASE);
}
@ -3436,7 +3464,6 @@ error:
static void test_export(void)
{
LONG lr;
HKEY hkey, subkey;
DWORD dword;
BYTE hex[4];
@ -3527,8 +3554,25 @@ static void test_export(void)
"\"Wine4g\"=\"Value2\"\r\n"
"\"Wine4h\"=\"abc\"\r\n\r\n";
lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE);
ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr);
const char *slashes_test =
"\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n"
"\"count/up\"=\"one/two/three\"\r\n"
"\"\\\\foo\\\\bar\"=\"\"\r\n\r\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\https://winehq.org]\r\n\r\n";
const char *escaped_null_test =
"\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n"
"\"Wine5a\"=\"\\\\0\"\r\n"
"\"Wine5b\"=\"\\\\0\\\\0\"\r\n"
"\"Wine5c\"=\"Value1\\\\0\"\r\n"
"\"Wine5d\"=\"Value2\\\\0\\\\0\\\\0\\\\0\"\r\n"
"\"Wine5e\"=\"Value3\\\\0Value4\"\r\n"
"\"Wine5f\"=\"\\\\0Value5\"\r\n\r\n";
delete_tree(HKEY_CURRENT_USER, KEY_BASE);
verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
/* Test registry export with an empty key */
add_key(HKEY_CURRENT_USER, KEY_BASE, &hkey);
@ -3548,52 +3592,48 @@ static void test_export(void)
add_key(hkey, "Subkey1", &subkey);
add_value(subkey, "Binary", REG_BINARY, "\x11\x22\x33\x44", 4);
add_value(subkey, "Undefined hex", 0x100, "%PATH%", 7);
RegCloseKey(subkey);
close_key(subkey);
add_key(hkey, "Subkey2a", &subkey);
add_value(subkey, "double\"quote", REG_SZ, "\"Hello, World!\"", 16);
dword = 0x8;
add_value(subkey, "single'quote", REG_DWORD, &dword, sizeof(dword));
RegCloseKey(subkey);
close_key(subkey);
add_key(hkey, "Subkey2a\\Subkey2b", &subkey);
add_value(subkey, NULL, REG_SZ, "Default value name", 19);
add_value(subkey, "Multiple strings", REG_MULTI_SZ, "Line1\0Line2\0Line3\0", 19);
RegCloseKey(subkey);
close_key(subkey);
add_key(hkey, "Subkey3a", &subkey);
add_value(subkey, "Backslash", REG_SZ, "Use \\\\ to escape a backslash", 29);
RegCloseKey(subkey);
close_key(subkey);
add_key(hkey, "Subkey3a\\Subkey3b\\Subkey3c", &subkey);
add_value(subkey, "String expansion", REG_EXPAND_SZ, "%HOME%\\%PATH%", 14);
add_value(subkey, "Zero data type", REG_NONE, "Value", 6);
RegCloseKey(subkey);
close_key(subkey);
add_key(hkey, "Subkey4", &subkey);
dword = 0x12345678;
add_value(subkey, NULL, REG_DWORD, &dword, sizeof(dword));
add_value(subkey, "43981", 0xabcd, "Value", 6);
RegCloseKey(subkey);
RegCloseKey(hkey);
close_key(subkey);
close_key(hkey);
run_regedit_exe("regedit.exe /e file.reg HKEY_CURRENT_USER\\" KEY_BASE);
ok(compare_export("file.reg", complex_test, 0), "compare_export() failed\n");
lr = delete_tree(HKEY_CURRENT_USER, KEY_BASE);
ok(lr == ERROR_SUCCESS, "delete_tree() failed: %d\n", lr);
delete_tree(HKEY_CURRENT_USER, KEY_BASE);
/* Test the export order of registry keys */
add_key(HKEY_CURRENT_USER, KEY_BASE, &hkey);
add_key(hkey, "Subkey2", &subkey);
RegCloseKey(subkey);
close_key(subkey);
add_key(hkey, "Subkey1", &subkey);
RegCloseKey(subkey);
close_key(subkey);
run_regedit_exe("regedit.exe /e file.reg HKEY_CURRENT_USER\\" KEY_BASE);
ok(compare_export("file.reg", key_order_test, 0), "compare_export() failed\n");
delete_key(hkey, "Subkey1");
delete_key(hkey, "Subkey2");
@ -3602,12 +3642,10 @@ static void test_export(void)
*/
add_value(hkey, "Value 2", REG_SZ, "I was added first!", 19);
add_value(hkey, "Value 1", REG_SZ, "I was added second!", 20);
RegCloseKey(hkey);
close_key(hkey);
run_regedit_exe("regedit.exe /e file.reg HKEY_CURRENT_USER\\" KEY_BASE);
ok(compare_export("file.reg", value_order_test, TODO_REG_COMPARE), "compare_export() failed\n");
delete_key(HKEY_CURRENT_USER, KEY_BASE);
/* Test registry export with empty hex data */
@ -3620,11 +3658,10 @@ static void test_export(void)
add_value(hkey, "Wine1f", REG_MULTI_SZ, NULL, 0);
add_value(hkey, "Wine1g", 0x100, NULL, 0);
add_value(hkey, "Wine1h", 0xabcd, NULL, 0);
RegCloseKey(hkey);
close_key(hkey);
run_regedit_exe("regedit.exe /e file.reg HKEY_CURRENT_USER\\" KEY_BASE);
ok(compare_export("file.reg", empty_hex_test, 0), "compare_export() failed\n");
delete_key(HKEY_CURRENT_USER, KEY_BASE);
/* Test registry export after importing alternative registry data types */
@ -3637,11 +3674,10 @@ static void test_export(void)
verify_reg(hkey, "Wine2a", REG_SZ, NULL, 0, 0);
verify_reg(hkey, "Wine2b", REG_BINARY, NULL, 0, 0);
verify_reg(hkey, "Wine2c", REG_DWORD, NULL, 0, 0);
RegCloseKey(hkey);
close_key(hkey);
run_regedit_exe("regedit.exe /e file.reg HKEY_CURRENT_USER\\" KEY_BASE);
ok(compare_export("file.reg", empty_hex_test2, 0), "compare_export() failed\n");
delete_key(HKEY_CURRENT_USER, KEY_BASE);
/* Test registry export with embedded null characters */
@ -3656,11 +3692,10 @@ static void test_export(void)
verify_reg(hkey, "Wine3b", REG_BINARY, hex, 4, 0);
dword = 0x10203040;
verify_reg(hkey, "Wine3c", REG_DWORD, &dword, sizeof(dword), 0);
RegCloseKey(hkey);
close_key(hkey);
run_regedit_exe("regedit.exe /e file.reg HKEY_CURRENT_USER\\" KEY_BASE);
ok(compare_export("file.reg", hex_types_test, 0), "compare_export() failed\n");
delete_key(HKEY_CURRENT_USER, KEY_BASE);
exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
@ -3685,26 +3720,62 @@ static void test_export(void)
verify_reg(hkey, "Wine4f", REG_SZ, "\0Value", 7, 0);
verify_reg(hkey, "Wine4g", REG_SZ, "Value2", 7, 0);
verify_reg(hkey, "Wine4h", REG_SZ, "abc\0def", 8, 0);
RegCloseKey(hkey);
close_key(hkey);
run_regedit_exe("regedit.exe /e file.reg HKEY_CURRENT_USER\\" KEY_BASE);
ok(compare_export("file.reg", embedded_null_test, 0), "compare_export() failed\n");
delete_key(HKEY_CURRENT_USER, KEY_BASE);
/* Test registry export with forward and back slashes */
add_key(HKEY_CURRENT_USER, KEY_BASE, &hkey);
add_key(hkey, "https://winehq.org", &subkey);
close_key(subkey);
add_value(hkey, "count/up", REG_SZ, "one/two/three", 14);
add_value(hkey, "\\foo\\bar", REG_SZ, "", 1);
close_key(hkey);
run_regedit_exe("regedit.exe /e file.reg HKEY_CURRENT_USER\\" KEY_BASE);
ok(compare_export("file.reg", slashes_test, TODO_REG_COMPARE), "compare_export() failed\n");
delete_tree(HKEY_CURRENT_USER, KEY_BASE);
/* Test registry export with escaped null characters */
add_key(HKEY_CURRENT_USER, KEY_BASE, &hkey);
add_value(hkey, "Wine5a", REG_SZ, "\\0", 3);
add_value(hkey, "Wine5b", REG_SZ, "\\0\\0", 5);
add_value(hkey, "Wine5c", REG_SZ, "Value1\\0", 9);
add_value(hkey, "Wine5d", REG_SZ, "Value2\\0\\0\\0\\0", 15);
add_value(hkey, "Wine5e", REG_SZ, "Value3\\0Value4", 15);
add_value(hkey, "Wine5f", REG_SZ, "\\0Value5", 9);
close_key(hkey);
run_regedit_exe("regedit.exe /e file.reg HKEY_CURRENT_USER\\" KEY_BASE);
ok(compare_export("file.reg", escaped_null_test, 0), "compare_export() failed\n");
delete_key(HKEY_CURRENT_USER, KEY_BASE);
}
START_TEST(regedit)
{
if(!exec_import_str("REGEDIT4\r\n\r\n")){
win_skip("regedit not available, skipping regedit tests\n");
return;
}
HKEY hkey;
LONG err;
if (!run_regedit_exe("regedit.exe /s test.reg") && GetLastError() == ERROR_ELEVATION_REQUIRED)
/* Check if regedit.exe is running with elevated privileges */
err = RegDeleteKeyA(HKEY_CLASSES_ROOT, KEY_BASE);
if (err == ERROR_ACCESS_DENIED)
{
win_skip("User is a non-elevated admin; skipping regedit tests.\n");
return;
}
if (err == ERROR_FILE_NOT_FOUND)
{
if (RegCreateKeyExA(HKEY_CLASSES_ROOT, KEY_BASE, 0, NULL, REG_OPTION_NON_VOLATILE,
KEY_READ, NULL, &hkey, NULL))
{
win_skip("User is a non-elevated admin; skipping regedit tests.\n");
return;
}
RegCloseKey(hkey);
RegDeleteKeyA(HKEY_CLASSES_ROOT, KEY_BASE);
}
test_basic_import();
test_basic_import_unicode();