* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <regedit.h>
+#include "regedit.h"
+
+#define NTOS_MODE_USER
+#include <ndk/cmtypes.h>
typedef enum _EDIT_MODE
{
SetDlgItemTextW(hwndDlg, IDC_VALUE_NAME, buffer);
}
SetDlgItemTextW(hwndDlg, IDC_VALUE_DATA, stringValueData);
+ SendMessage(GetDlgItem(hwndDlg, IDC_VALUE_DATA), EM_SETSEL, 0, -1);
SetFocus(GetDlgItem(hwndDlg, IDC_VALUE_DATA));
return FALSE;
case WM_COMMAND:
{
WNDPROC oldwndproc;
- oldwndproc = (WNDPROC)(LONG_PTR)GetWindowLongPtr(hwnd, GWL_USERDATA);
+ oldwndproc = (WNDPROC)GetWindowLongPtr(hwnd, GWLP_USERDATA);
switch (uMsg)
{
}
}
- return CallWindowProc(oldwndproc, hwnd, uMsg, wParam, lParam);
+ return CallWindowProcW(oldwndproc, hwnd, uMsg, wParam, lParam);
}
/* subclass the edit control */
hwndValue = GetDlgItem(hwndDlg, IDC_VALUE_DATA);
- oldproc = (WNDPROC)(LONG_PTR)GetWindowLongPtr(hwndValue, GWL_WNDPROC);
- SetWindowLongPtr(hwndValue, GWL_USERDATA, (DWORD_PTR)oldproc);
- SetWindowLongPtr(hwndValue, GWL_WNDPROC, (DWORD_PTR)DwordEditSubclassProc);
+ oldproc = (WNDPROC)GetWindowLongPtr(hwndValue, GWLP_WNDPROC);
+ SetWindowLongPtr(hwndValue, GWLP_USERDATA, (DWORD_PTR)oldproc);
+ SetWindowLongPtr(hwndValue, GWLP_WNDPROC, (DWORD_PTR)DwordEditSubclassProc);
if (editValueName && wcscmp(editValueName, L""))
{
CheckRadioButton (hwndDlg, IDC_FORMAT_HEX, IDC_FORMAT_DEC, IDC_FORMAT_HEX);
swprintf(ValueString, L"%lx", dwordValueData);
SetDlgItemTextW(hwndDlg, IDC_VALUE_DATA, ValueString);
+ SendMessage(GetDlgItem(hwndDlg, IDC_VALUE_DATA), EM_SETSEL, 0, -1);
SetFocus(GetDlgItem(hwndDlg, IDC_VALUE_DATA));
return FALSE;
HWND hwndLV;
WCHAR buffer[80];
- LVITEM item;
+ LVITEMW item;
INT iItem;
- pFullDescriptor = &resourceValueData->List[fullResourceIndex];
+ pFullDescriptor = &resourceValueData->List[0];
+ for (i = 0; i < fullResourceIndex; i++)
+ {
+ pFullDescriptor = (PVOID)(pFullDescriptor->PartialResourceList.PartialDescriptors +
+ pFullDescriptor->PartialResourceList.Count);
+ }
pPartialResourceList = &pFullDescriptor->PartialResourceList;
/* Interface type */
hwndLV = GetDlgItem(hwnd, IDC_PORT_LIST);
#ifdef _M_AMD64
- wsprintf(buffer, L"0x%16I64x", pDescriptor->u.Port.Start.QuadPart);
+ wsprintf(buffer, L"0x%016I64x", pDescriptor->u.Port.Start.QuadPart);
#else
wsprintf(buffer, L"0x%08lx", pDescriptor->u.Port.Start.u.LowPart);
#endif
hwndLV = GetDlgItem(hwnd, IDC_MEMORY_LIST);
#ifdef _M_AMD64
- wsprintf(buffer, L"0x%16I64x", pDescriptor->u.Memory.Start.QuadPart);
+ wsprintf(buffer, L"0x%016I64x", pDescriptor->u.Memory.Start.QuadPart);
#else
wsprintf(buffer, L"0x%08lx", pDescriptor->u.Memory.Start.u.LowPart);
#endif
if (lpnmlv->iItem != -1)
{
PCM_PARTIAL_RESOURCE_DESCRIPTOR pDescriptor;
- LVITEM item;
+ LVITEMW item;
item.mask = LVIF_PARAM;
item.iItem = lpnmlv->iItem;
{
PCM_FULL_RESOURCE_DESCRIPTOR pFullDescriptor;
WCHAR buffer[80];
- LVITEM item;
+ LVITEMW item;
ULONG i;
INT iItem;
+ pFullDescriptor = &resourceValueData->List[0];
for (i = 0; i < resourceValueData->Count; i++)
{
- pFullDescriptor = &resourceValueData->List[i];
-
wsprintf(buffer, L"%lu", pFullDescriptor->BusNumber);
item.mask = LVIF_TEXT;
GetInterfaceType(pFullDescriptor->InterfaceType, buffer, 80);
ListView_SetItemText(hwnd, iItem, 1, buffer);
}
+ pFullDescriptor = (PVOID)(pFullDescriptor->PartialResourceList.PartialDescriptors +
+ pFullDescriptor->PartialResourceList.Count);
}
}
editValueName = valueName;
lRet = RegQueryValueExW(hKey, valueName, 0, &type, 0, &valueDataLen);
- if (lRet != ERROR_SUCCESS && (!wcscmp(valueName, L"") || valueName == NULL))
+ if (lRet != ERROR_SUCCESS && (valueName == NULL || !valueName[0]))
{
lRet = ERROR_SUCCESS; /* Allow editing of (Default) values which don't exist */
type = REG_SZ;
{
}
}
- else if (EditBin == TRUE || type == REG_NONE || type == REG_BINARY)
+ else if (EditBin == FALSE && type == REG_FULL_RESOURCE_DESCRIPTOR)
+ {
+ if (valueDataLen > 0)
+ {
+ resourceValueData = HeapAlloc(GetProcessHeap(), 0, valueDataLen + sizeof(ULONG));
+ if (resourceValueData == NULL)
+ {
+ error(hwnd, IDS_TOO_BIG_VALUE, valueDataLen);
+ goto done;
+ }
+
+ lRet = RegQueryValueExW(hKey, valueName, 0, 0, (LPBYTE)&resourceValueData->List[0], &valueDataLen);
+ if (lRet != ERROR_SUCCESS)
+ {
+ error(hwnd, IDS_BAD_VALUE, valueName);
+ goto done;
+ }
+
+ resourceValueData->Count = 1;
+ fullResourceIndex = 0;
+ }
+ else
+ {
+ resourceValueData = NULL;
+ }
+
+ if (DialogBoxW(0, MAKEINTRESOURCEW(IDD_EDIT_RESOURCE), hwnd, modify_resource_dlgproc) == IDOK)
+ {
+ }
+ }
+ else if ((EditBin != FALSE) || (type == REG_NONE) || (type == REG_BINARY))
{
if(valueDataLen > 0)
{
}
/* create the destination subkey */
- lResult = RegCreateKeyExW(hDestKey, lpDestSubKey, 0, NULL, 0, KEY_WRITE, NULL,
+ lResult = RegCreateKeyExW(hDestKey, lpDestSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL,
&hDestSubKey, &dwDisposition);
if (lResult)
goto done;
if (!lpSrcSubKey)
return ERROR_INVALID_FUNCTION;
+ if (_wcsicmp(lpDestSubKey, lpSrcSubKey) == 0)
+ {
+ /* Destination name equals source name */
+ return ERROR_SUCCESS;
+ }
+
lResult = CopyKey(hDestKey, lpDestSubKey, hSrcKey, lpSrcSubKey);
if (lResult == ERROR_SUCCESS)
SHDeleteKey(hSrcKey, lpSrcSubKey);