ReactOS 0.4.15-dev-8245-gd24675b
edit.c File Reference
#include "regedit.h"
#include <ndk/cmtypes.h>
Include dependency graph for edit.c:

Go to the source code of this file.

Classes

struct  _IO_RESOURCE_DESCRIPTOR
 
struct  _IO_RESOURCE_LIST
 
struct  _IO_RESOURCE_REQUIREMENTS_LIST
 

Macros

#define NTOS_MODE_USER
 
#define IO_RESOURCE_PREFERRED   0x01
 
#define IO_RESOURCE_DEFAULT   0x02
 
#define IO_RESOURCE_ALTERNATIVE   0x08
 

Typedefs

typedef enum _IRQ_DEVICE_POLICY IRQ_DEVICE_POLICY
 
typedef enum _IRQ_DEVICE_POLICYPIRQ_DEVICE_POLICY
 
typedef enum _IRQ_PRIORITY IRQ_PRIORITY
 
typedef enum _IRQ_PRIORITYPIRQ_PRIORITY
 
typedef struct _IO_RESOURCE_DESCRIPTOR IO_RESOURCE_DESCRIPTOR
 
typedef struct _IO_RESOURCE_DESCRIPTORPIO_RESOURCE_DESCRIPTOR
 
typedef struct _IO_RESOURCE_LIST IO_RESOURCE_LIST
 
typedef struct _IO_RESOURCE_LISTPIO_RESOURCE_LIST
 
typedef struct _IO_RESOURCE_REQUIREMENTS_LIST IO_RESOURCE_REQUIREMENTS_LIST
 
typedef struct _IO_RESOURCE_REQUIREMENTS_LISTPIO_RESOURCE_REQUIREMENTS_LIST
 
typedef enum _EDIT_MODE EDIT_MODE
 

Enumerations

enum  _IRQ_DEVICE_POLICY {
  IrqPolicyMachineDefault = 0 , IrqPolicyAllCloseProcessors , IrqPolicyOneCloseProcessor , IrqPolicyAllProcessorsInMachine ,
  IrqPolicySpecifiedProcessors , IrqPolicySpreadMessagesAcrossAllProcessors , IrqPolicyMachineDefault = 0 , IrqPolicyAllCloseProcessors ,
  IrqPolicyOneCloseProcessor , IrqPolicyAllProcessorsInMachine , IrqPolicySpecifiedProcessors , IrqPolicySpreadMessagesAcrossAllProcessors
}
 
enum  _IRQ_PRIORITY {
  IrqPriorityUndefined = 0 , IrqPriorityLow , IrqPriorityNormal , IrqPriorityHigh ,
  IrqPriorityUndefined = 0 , IrqPriorityLow , IrqPriorityNormal , IrqPriorityHigh ,
  IrqPriorityUndefined = 0 , IrqPriorityLow , IrqPriorityNormal , IrqPriorityHigh
}
 
enum  _EDIT_MODE { EDIT_MODE_DEC , EDIT_MODE_HEX }
 

Functions

void error (HWND hwnd, INT resId,...)
 
static void error_code_messagebox (HWND hwnd, DWORD error_code)
 
void warning (HWND hwnd, INT resId,...)
 
INT_PTR CALLBACK modify_string_dlgproc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK modify_multi_string_dlgproc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
LRESULT CALLBACK DwordEditSubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK modify_dword_dlgproc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK modify_binary_dlgproc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static BOOL CreateResourceColumns (HWND hwnd)
 
static VOID GetInterfaceType (INTERFACE_TYPE InterfaceType, LPWSTR pBuffer, DWORD dwLength)
 
static VOID ParseResources (HWND hwnd)
 
static BOOL OnResourceNotify (HWND hwndDlg, NMHDR *phdr)
 
static INT_PTR CALLBACK modify_resource_dlgproc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static BOOL CreateResourceListColumns (HWND hWndListView)
 
static VOID AddFullResourcesToList (HWND hwnd)
 
static BOOL OnResourceListNotify (HWND hwndDlg, NMHDR *phdr)
 
static INT_PTR CALLBACK modify_resource_list_dlgproc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static BOOL CreateRequirementsListColumns (HWND hWndListView)
 
static VOID GetResourceType (UCHAR ResourceType, LPWSTR pBuffer, DWORD dwLength)
 
static VOID GetShareDisposition (UCHAR ShareDisposition, LPWSTR pBuffer, DWORD dwLength)
 
static VOID GetPortType (USHORT Flags, LPWSTR pBuffer, DWORD dwLength)
 
static VOID GetMemoryAccess (USHORT Flags, LPWSTR pBuffer, DWORD dwLength)
 
static VOID GetInterruptType (USHORT Flags, LPWSTR pBuffer, DWORD dwLength)
 
static VOID AddRequirementsToList (HWND hwndDlg, HWND hwnd)
 
static INT_PTR CALLBACK show_requirements_port_dlgproc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static INT_PTR CALLBACK show_requirements_memory_dlgproc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static INT_PTR CALLBACK show_requirements_interrupt_dlgproc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static INT_PTR CALLBACK show_requirements_dma_dlgproc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static VOID ShowRequirement (HWND hwndDlg)
 
static BOOL OnRequirementsListNotify (HWND hwndDlg, NMHDR *phdr)
 
static INT_PTR CALLBACK modify_requirements_list_dlgproc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
BOOL ModifyValue (HWND hwnd, HKEY hKey, LPCWSTR valueName, BOOL EditBin)
 
static LONG CopyKey (HKEY hDestKey, LPCWSTR lpDestSubKey, HKEY hSrcKey, LPCWSTR lpSrcSubKey)
 
static LONG MoveKey (HKEY hDestKey, LPCWSTR lpDestSubKey, HKEY hSrcKey, LPCWSTR lpSrcSubKey)
 
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)
 

Variables

static const WCHAReditValueName
 
static WCHARstringValueData
 
static PVOID binValueData
 
static DWORD dwordValueData
 
static PCM_RESOURCE_LIST resourceValueData
 
static INT fullResourceIndex = -1
 
static DWORD valueDataLen
 
static PIO_RESOURCE_REQUIREMENTS_LIST requirementsValueData
 
static INT requirementsIndex = -1
 
static EDIT_MODE dwordEditMode = EDIT_MODE_HEX
 

Macro Definition Documentation

◆ IO_RESOURCE_ALTERNATIVE

#define IO_RESOURCE_ALTERNATIVE   0x08

Definition at line 119 of file edit.c.

◆ IO_RESOURCE_DEFAULT

#define IO_RESOURCE_DEFAULT   0x02

Definition at line 118 of file edit.c.

◆ IO_RESOURCE_PREFERRED

#define IO_RESOURCE_PREFERRED   0x01

Definition at line 117 of file edit.c.

◆ NTOS_MODE_USER

#define NTOS_MODE_USER

Definition at line 23 of file edit.c.

Typedef Documentation

◆ EDIT_MODE

◆ IO_RESOURCE_DESCRIPTOR

◆ IO_RESOURCE_LIST

◆ IO_RESOURCE_REQUIREMENTS_LIST

◆ IRQ_DEVICE_POLICY

◆ IRQ_PRIORITY

◆ PIO_RESOURCE_DESCRIPTOR

◆ PIO_RESOURCE_LIST

◆ PIO_RESOURCE_REQUIREMENTS_LIST

◆ PIRQ_DEVICE_POLICY

◆ PIRQ_PRIORITY

Enumeration Type Documentation

◆ _EDIT_MODE

Enumerator
EDIT_MODE_DEC 
EDIT_MODE_HEX 

Definition at line 138 of file edit.c.

139{
142} EDIT_MODE;
@ EDIT_MODE_HEX
Definition: edit.c:141
@ EDIT_MODE_DEC
Definition: edit.c:140
enum _EDIT_MODE EDIT_MODE

◆ _IRQ_DEVICE_POLICY

Enumerator
IrqPolicyMachineDefault 
IrqPolicyAllCloseProcessors 
IrqPolicyOneCloseProcessor 
IrqPolicyAllProcessorsInMachine 
IrqPolicySpecifiedProcessors 
IrqPolicySpreadMessagesAcrossAllProcessors 
IrqPolicyMachineDefault 
IrqPolicyAllCloseProcessors 
IrqPolicyOneCloseProcessor 
IrqPolicyAllProcessorsInMachine 
IrqPolicySpecifiedProcessors 
IrqPolicySpreadMessagesAcrossAllProcessors 

Definition at line 41 of file edit.c.

41 {
enum _IRQ_DEVICE_POLICY IRQ_DEVICE_POLICY
enum _IRQ_DEVICE_POLICY * PIRQ_DEVICE_POLICY
@ IrqPolicyOneCloseProcessor
Definition: edit.c:44
@ IrqPolicyAllCloseProcessors
Definition: edit.c:43
@ IrqPolicyAllProcessorsInMachine
Definition: edit.c:45
@ IrqPolicySpreadMessagesAcrossAllProcessors
Definition: edit.c:47
@ IrqPolicyMachineDefault
Definition: edit.c:42
@ IrqPolicySpecifiedProcessors
Definition: edit.c:46

◆ _IRQ_PRIORITY

Enumerator
IrqPriorityUndefined 
IrqPriorityLow 
IrqPriorityNormal 
IrqPriorityHigh 
IrqPriorityUndefined 
IrqPriorityLow 
IrqPriorityNormal 
IrqPriorityHigh 
IrqPriorityUndefined 
IrqPriorityLow 
IrqPriorityNormal 
IrqPriorityHigh 

Definition at line 52 of file edit.c.

52 {
enum _IRQ_PRIORITY * PIRQ_PRIORITY
enum _IRQ_PRIORITY IRQ_PRIORITY
@ IrqPriorityUndefined
Definition: edit.c:53
@ IrqPriorityHigh
Definition: edit.c:56
@ IrqPriorityNormal
Definition: edit.c:55
@ IrqPriorityLow
Definition: edit.c:54

Function Documentation

◆ AddFullResourcesToList()

static VOID AddFullResourcesToList ( HWND  hwnd)
static

Definition at line 1091 of file edit.c.

1092{
1093 PCM_FULL_RESOURCE_DESCRIPTOR pFullDescriptor;
1094 WCHAR buffer[80];
1095 LVITEMW item;
1096 ULONG i;
1097 INT iItem;
1098
1099 pFullDescriptor = &resourceValueData->List[0];
1100 for (i = 0; i < resourceValueData->Count; i++)
1101 {
1102 wsprintf(buffer, L"%lu", pFullDescriptor->BusNumber);
1103
1104 item.mask = LVIF_TEXT;
1105 item.iItem = i;
1106 item.iSubItem = 0;
1107 item.state = 0;
1108 item.stateMask = 0;
1109 item.pszText = buffer;
1110 item.cchTextMax = (int)wcslen(item.pszText);
1111
1112 iItem = ListView_InsertItem(hwnd, &item);
1113 if (iItem != -1)
1114 {
1115 GetInterfaceType(pFullDescriptor->InterfaceType, buffer, 80);
1116 ListView_SetItemText(hwnd, iItem, 1, buffer);
1117 }
1118 pFullDescriptor = (PVOID)(pFullDescriptor->PartialResourceList.PartialDescriptors +
1119 pFullDescriptor->PartialResourceList.Count);
1120 }
1121}
static PCM_RESOURCE_LIST resourceValueData
Definition: edit.c:149
static VOID GetInterfaceType(INTERFACE_TYPE InterfaceType, LPWSTR pBuffer, DWORD dwLength)
Definition: edit.c:691
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
GLuint buffer
Definition: glext.h:5915
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
static ATOM item
Definition: dde.c:856
#define L(x)
Definition: ntvdm.h:50
#define ListView_InsertItem(hwnd, pitem)
Definition: commctrl.h:2408
#define ListView_SetItemText(hwndLV, i, iSubItem_, pszText_)
Definition: commctrl.h:2691
#define LVIF_TEXT
Definition: commctrl.h:2309
CM_PARTIAL_RESOURCE_LIST PartialResourceList
Definition: hwresource.cpp:160
CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]
Definition: hwresource.cpp:119
CM_FULL_RESOURCE_DESCRIPTOR List[1]
Definition: hwresource.cpp:165
void * PVOID
Definition: typedefs.h:50
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG
Definition: typedefs.h:59
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define wsprintf
Definition: winuser.h:5874
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by modify_resource_list_dlgproc().

◆ AddRequirementsToList()

static VOID AddRequirementsToList ( HWND  hwndDlg,
HWND  hwnd 
)
static

Definition at line 1337 of file edit.c.

1338{
1339 PIO_RESOURCE_LIST pResourceList;
1340 PIO_RESOURCE_DESCRIPTOR pDescriptor;
1341 WCHAR buffer[80];
1342 LVITEMW item;
1343 ULONG i, j, index;
1344 INT iItem;
1345
1346 index = 0;
1347 pResourceList = &requirementsValueData->List[0];
1348 for (i = 0; i < requirementsValueData->AlternativeLists; i++)
1349 {
1350 for (j = 0; j < pResourceList->Count; j++)
1351 {
1352 pDescriptor = &pResourceList->Descriptors[j];
1353
1354 wsprintf(buffer, L"%lu", i + 1);
1355
1356 item.mask = LVIF_TEXT | LVIF_PARAM;
1357 item.iItem = index;
1358 item.iSubItem = 0;
1359 item.state = 0;
1360 item.stateMask = 0;
1361 item.pszText = buffer;
1362 item.cchTextMax = (int)wcslen(item.pszText);
1363 item.lParam = (LPARAM)pDescriptor;
1364
1365 iItem = ListView_InsertItem(hwnd, &item);
1366 if (iItem != -1)
1367 {
1368 wsprintf(buffer, L"%lu", j + 1);
1369 ListView_SetItemText(hwnd, iItem, 1, buffer);
1370 wsprintf(buffer, L"%lu", 1);
1371 ListView_SetItemText(hwnd, iItem, 2, buffer);
1372
1373 GetResourceType(pDescriptor->Type, buffer, 80);
1374 ListView_SetItemText(hwnd, iItem, 3, buffer);
1375 }
1376
1377 index++;
1378 }
1379
1380
1381 pResourceList = (PIO_RESOURCE_LIST)(pResourceList->Descriptors + pResourceList->Count);
1382 }
1383
1388}
#define index(s, c)
Definition: various.h:29
struct _IO_RESOURCE_LIST * PIO_RESOURCE_LIST
static VOID GetResourceType(UCHAR ResourceType, LPWSTR pBuffer, DWORD dwLength)
Definition: edit.c:1230
static PIO_RESOURCE_REQUIREMENTS_LIST requirementsValueData
Definition: edit.c:152
#define IDC_REQINTERFACETYPE
Definition: resource.h:324
#define IDC_REQBUSNUMBER
Definition: resource.h:325
#define IDC_REQSLOTNUMBER
Definition: resource.h:326
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
GLuint index
Definition: glext.h:6031
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
unsigned int UINT
Definition: ndis.h:50
#define LVIF_PARAM
Definition: commctrl.h:2311
ULONG Count
Definition: edit.c:124
IO_RESOURCE_DESCRIPTOR Descriptors[1]
Definition: edit.c:125
INTERFACE_TYPE InterfaceType
Definition: edit.c:130
IO_RESOURCE_LIST List[1]
Definition: edit.c:135
LONG_PTR LPARAM
Definition: windef.h:208
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
BOOL WINAPI SetDlgItemInt(_In_ HWND, _In_ int, _In_ UINT, _In_ BOOL)

Referenced by modify_requirements_list_dlgproc().

◆ CopyKey()

static LONG CopyKey ( HKEY  hDestKey,
LPCWSTR  lpDestSubKey,
HKEY  hSrcKey,
LPCWSTR  lpSrcSubKey 
)
static

Definition at line 1981 of file edit.c.

1982{
1983 LONG lResult;
1984 DWORD dwDisposition;
1985 HKEY hDestSubKey = NULL;
1986 HKEY hSrcSubKey = NULL;
1987 DWORD dwIndex, dwType, cbName, cbData;
1988 WCHAR szSubKey[256];
1989 WCHAR szValueName[256];
1990 BYTE szValueData[512];
1991
1992 FILETIME ft;
1993
1994 /* open the source subkey, if specified */
1995 if (lpSrcSubKey)
1996 {
1997 lResult = RegOpenKeyExW(hSrcKey, lpSrcSubKey, 0, KEY_ALL_ACCESS, &hSrcSubKey);
1998 if (lResult)
1999 goto done;
2000 hSrcKey = hSrcSubKey;
2001 }
2002
2003 /* create the destination subkey */
2004 lResult = RegCreateKeyExW(hDestKey, lpDestSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL,
2005 &hDestSubKey, &dwDisposition);
2006 if (lResult)
2007 goto done;
2008
2009 /* copy all subkeys */
2010 dwIndex = 0;
2011 do
2012 {
2013 cbName = sizeof(szSubKey) / sizeof(szSubKey[0]);
2014 lResult = RegEnumKeyExW(hSrcKey, dwIndex++, szSubKey, &cbName, NULL, NULL, NULL, &ft);
2015 if (lResult == ERROR_SUCCESS)
2016 {
2017 lResult = CopyKey(hDestSubKey, szSubKey, hSrcKey, szSubKey);
2018 if (lResult)
2019 goto done;
2020 }
2021 }
2022 while(lResult == ERROR_SUCCESS);
2023
2024 /* copy all subvalues */
2025 dwIndex = 0;
2026 do
2027 {
2028 cbName = sizeof(szValueName) / sizeof(szValueName[0]);
2029 cbData = sizeof(szValueData) / sizeof(szValueData[0]);
2030 lResult = RegEnumValueW(hSrcKey, dwIndex++, szValueName, &cbName, NULL, &dwType, szValueData, &cbData);
2031 if (lResult == ERROR_SUCCESS)
2032 {
2033 lResult = RegSetValueExW(hDestSubKey, szValueName, 0, dwType, szValueData, cbData);
2034 if (lResult)
2035 goto done;
2036 }
2037 }
2038 while(lResult == ERROR_SUCCESS);
2039
2040 lResult = ERROR_SUCCESS;
2041
2042done:
2043 if (hSrcSubKey)
2044 RegCloseKey(hSrcSubKey);
2045 if (hDestSubKey)
2046 RegCloseKey(hDestSubKey);
2047 if (lResult != ERROR_SUCCESS)
2048 SHDeleteKey(hDestKey, lpDestSubKey);
2049 return lResult;
2050}
static LONG CopyKey(HKEY hDestKey, LPCWSTR lpDestSubKey, HKEY hSrcKey, LPCWSTR lpSrcSubKey)
Definition: edit.c:1981
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2504
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
LONG WINAPI RegEnumValueW(_In_ HKEY hKey, _In_ DWORD index, _Out_ LPWSTR value, _Inout_ PDWORD val_count, _Reserved_ PDWORD reserved, _Out_opt_ PDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ PDWORD count)
Definition: reg.c:2830
unsigned long DWORD
Definition: ntddk_ex.h:95
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define KEY_WRITE
Definition: nt_native.h:1031
long LONG
Definition: pedump.c:60
#define SHDeleteKey
Definition: shlwapi.h:44
unsigned char BYTE
Definition: xxhash.c:193

Referenced by CopyKey(), and MoveKey().

◆ CreateRequirementsListColumns()

static BOOL CreateRequirementsListColumns ( HWND  hWndListView)
static

Definition at line 1186 of file edit.c.

1187{
1188 WCHAR szText[80];
1189 RECT rc;
1190 LVCOLUMN lvC;
1191
1193
1194 GetClientRect(hWndListView, &rc);
1195
1196 /* Create columns. */
1197 lvC.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
1198 lvC.pszText = szText;
1199 lvC.fmt = LVCFMT_LEFT;
1200
1201 /* Load the column labels from the resource file. */
1202 lvC.iSubItem = 0;
1203 lvC.cx = (rc.right - rc.left) / 4;
1205 if (ListView_InsertColumn(hWndListView, 0, &lvC) == -1)
1206 return FALSE;
1207
1208 lvC.iSubItem = 1;
1209 lvC.cx = (rc.right - rc.left) / 4;
1211 if (ListView_InsertColumn(hWndListView, 1, &lvC) == -1)
1212 return FALSE;
1213
1214 lvC.iSubItem = 2;
1215 lvC.cx = (rc.right - rc.left) / 4;
1216 LoadStringW(hInst, IDS_REQDESCRIPTOR, szText, ARRAY_SIZE(szText));
1217 if (ListView_InsertColumn(hWndListView, 2, &lvC) == -1)
1218 return FALSE;
1219
1220 lvC.iSubItem = 3;
1221 lvC.cx = (rc.right - rc.left) - (3 * ((rc.right - rc.left) / 4));
1222 LoadStringW(hInst, IDS_REQDEVICETYPE, szText, ARRAY_SIZE(szText));
1223 if (ListView_InsertColumn(hWndListView, 3, &lvC) == -1)
1224 return FALSE;
1225
1226 return TRUE;
1227}
#define ARRAY_SIZE(A)
Definition: main.h:33
#define IDS_REQDESCRIPTOR
Definition: resource.h:262
#define IDS_REQRESOURCELIST
Definition: resource.h:261
#define IDS_REQALTERNATIVELIST
Definition: resource.h:260
#define IDS_REQDEVICETYPE
Definition: resource.h:263
HINSTANCE hInst
Definition: dxdiag.c:13
#define ListView_InsertColumn(hwnd, iCol, pcol)
Definition: commctrl.h:2636
#define LVCF_WIDTH
Definition: commctrl.h:2587
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2734
#define ListView_SetExtendedListViewStyle(hwndLV, dw)
Definition: commctrl.h:2725
#define LVCF_FMT
Definition: commctrl.h:2586
#define LVCF_SUBITEM
Definition: commctrl.h:2589
#define LVCFMT_LEFT
Definition: commctrl.h:2598
#define LVCF_TEXT
Definition: commctrl.h:2588
#define LVCOLUMN
Definition: commctrl.h:2581
LONG right
Definition: windef.h:308
LONG left
Definition: windef.h:306
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)

Referenced by modify_requirements_list_dlgproc().

◆ CreateResourceColumns()

static BOOL CreateResourceColumns ( HWND  hwnd)
static

Definition at line 553 of file edit.c.

554{
555 WCHAR szText[80];
556 RECT rc;
557 LVCOLUMN lvC;
558 HWND hwndLV;
559 INT width;
560
561 /* Create columns. */
562 lvC.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
563 lvC.pszText = szText;
564 lvC.fmt = LVCFMT_LEFT;
565
566 hwndLV = GetDlgItem(hwnd, IDC_DMA_LIST);
568 GetClientRect(hwndLV, &rc);
569
570 /* Load the column labels from the resource file. */
571 lvC.iSubItem = 0;
572 lvC.cx = (rc.right - rc.left) / 2;
573 LoadStringW(hInst, IDS_DMA_CHANNEL, szText, ARRAY_SIZE(szText));
574 if (ListView_InsertColumn(hwndLV, 0, &lvC) == -1)
575 return FALSE;
576
577 lvC.iSubItem = 1;
578 lvC.cx = (rc.right - rc.left) - lvC.cx;
579 LoadStringW(hInst, IDS_DMA_PORT, szText, ARRAY_SIZE(szText));
580 if (ListView_InsertColumn(hwndLV, 1, &lvC) == -1)
581 return FALSE;
582
583
584 /* Interrupt list */
585 hwndLV = GetDlgItem(hwnd, IDC_IRQ_LIST);
587 GetClientRect(hwndLV, &rc);
588 width = (rc.right - rc.left) / 4;
589
590 /* Load the column labels from the resource file. */
591 lvC.iSubItem = 0;
592 lvC.cx = width;
594 if (ListView_InsertColumn(hwndLV, 0, &lvC) == -1)
595 return FALSE;
596
597 lvC.iSubItem = 1;
599 if (ListView_InsertColumn(hwndLV, 1, &lvC) == -1)
600 return FALSE;
601
602 lvC.iSubItem = 2;
604 if (ListView_InsertColumn(hwndLV, 2, &lvC) == -1)
605 return FALSE;
606
607 lvC.iSubItem = 3;
608 lvC.cx = (rc.right - rc.left) - 3 * width;
610 if (ListView_InsertColumn(hwndLV, 3, &lvC) == -1)
611 return FALSE;
612
613
614 /* Memory list */
617 GetClientRect(hwndLV, &rc);
618 width = (rc.right - rc.left) / 3;
619
620 /* Load the column labels from the resource file. */
621 lvC.iSubItem = 0;
622 lvC.cx = width;
624 if (ListView_InsertColumn(hwndLV, 0, &lvC) == -1)
625 return FALSE;
626
627 lvC.iSubItem = 1;
629 if (ListView_InsertColumn(hwndLV, 1, &lvC) == -1)
630 return FALSE;
631
632 lvC.iSubItem = 2;
633 lvC.cx = (rc.right - rc.left) - 2 * width;
635 if (ListView_InsertColumn(hwndLV, 2, &lvC) == -1)
636 return FALSE;
637
638
639 /* Port list */
640 hwndLV = GetDlgItem(hwnd, IDC_PORT_LIST);
642 GetClientRect(hwndLV, &rc);
643 width = (rc.right - rc.left) / 3;
644
645 /* Load the column labels from the resource file. */
646 lvC.iSubItem = 0;
647 lvC.cx = width;
648 LoadStringW(hInst, IDS_PORT_ADDRESS, szText, ARRAY_SIZE(szText));
649 if (ListView_InsertColumn(hwndLV, 0, &lvC) == -1)
650 return FALSE;
651
652 lvC.iSubItem = 1;
653 LoadStringW(hInst, IDS_PORT_LENGTH, szText, ARRAY_SIZE(szText));
654 if (ListView_InsertColumn(hwndLV, 1, &lvC) == -1)
655 return FALSE;
656
657 lvC.iSubItem = 2;
658 lvC.cx = (rc.right - rc.left) - 2 * width;
659 LoadStringW(hInst, IDS_PORT_ACCESS, szText, ARRAY_SIZE(szText));
660 if (ListView_InsertColumn(hwndLV, 2, &lvC) == -1)
661 return FALSE;
662
663 /* Device specific list */
666 GetClientRect(hwndLV, &rc);
667 width = (rc.right - rc.left) / 3;
668
669 /* Load the column labels from the resource file. */
670 lvC.iSubItem = 0;
671 lvC.cx = width;
673 if (ListView_InsertColumn(hwndLV, 0, &lvC) == -1)
674 return FALSE;
675
676 lvC.iSubItem = 1;
678 if (ListView_InsertColumn(hwndLV, 1, &lvC) == -1)
679 return FALSE;
680
681 lvC.iSubItem = 2;
682 lvC.cx = (rc.right - rc.left) - 2 * width;
684 if (ListView_InsertColumn(hwndLV, 2, &lvC) == -1)
685 return FALSE;
686
687 return TRUE;
688}
#define IDS_INTERRUPT_TYPE
Definition: resource.h:211
#define IDS_INTERRUPT_VECTOR
Definition: resource.h:208
#define IDS_SPECIFIC_RESERVED2
Definition: resource.h:219
#define IDS_PORT_LENGTH
Definition: resource.h:216
#define IDS_MEMORY_LENGTH
Definition: resource.h:213
#define IDS_DMA_PORT
Definition: resource.h:207
#define IDS_MEMORY_ADDRESS
Definition: resource.h:212
#define IDS_PORT_ACCESS
Definition: resource.h:217
#define IDS_MEMORY_ACCESS
Definition: resource.h:214
#define IDS_SPECIFIC_RESERVED1
Definition: resource.h:218
#define IDC_PORT_LIST
Definition: resource.h:310
#define IDC_IRQ_LIST
Definition: resource.h:308
#define IDC_DEVICE_LIST
Definition: resource.h:311
#define IDS_PORT_ADDRESS
Definition: resource.h:215
#define IDS_INTERRUPT_AFFINITY
Definition: resource.h:210
#define IDC_DMA_LIST
Definition: resource.h:307
#define IDS_INTERRUPT_LEVEL
Definition: resource.h:209
#define IDS_SPECIFIC_DATASIZE
Definition: resource.h:220
#define IDC_MEMORY_LIST
Definition: resource.h:309
#define IDS_DMA_CHANNEL
Definition: resource.h:206
GLint GLint GLsizei width
Definition: gl.h:1546
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)

Referenced by modify_resource_dlgproc().

◆ CreateResourceListColumns()

static BOOL CreateResourceListColumns ( HWND  hWndListView)
static

Definition at line 1060 of file edit.c.

1061{
1062 WCHAR szText[80];
1063 RECT rc;
1064 LVCOLUMN lvC;
1065
1067
1068 GetClientRect(hWndListView, &rc);
1069
1070 /* Create columns. */
1071 lvC.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
1072 lvC.pszText = szText;
1073 lvC.fmt = LVCFMT_LEFT;
1074
1075 /* Load the column labels from the resource file. */
1076 lvC.iSubItem = 0;
1077 lvC.cx = (rc.right - rc.left) / 2;
1078 LoadStringW(hInst, IDS_BUSNUMBER, szText, ARRAY_SIZE(szText));
1079 if (ListView_InsertColumn(hWndListView, 0, &lvC) == -1)
1080 return FALSE;
1081
1082 lvC.iSubItem = 1;
1083 lvC.cx = (rc.right - rc.left) - lvC.cx;
1084 LoadStringW(hInst, IDS_INTERFACE, szText, ARRAY_SIZE(szText));
1085 if (ListView_InsertColumn(hWndListView, 1, &lvC) == -1)
1086 return FALSE;
1087
1088 return TRUE;
1089}
#define IDS_BUSNUMBER
Definition: resource.h:203
#define IDS_INTERFACE
Definition: resource.h:204

Referenced by modify_resource_list_dlgproc().

◆ DeleteKey()

BOOL DeleteKey ( HWND  hwnd,
HKEY  hKeyRoot,
LPCWSTR  keyPath 
)

Definition at line 2072 of file edit.c.

2073{
2074 WCHAR msg[128], caption[128];
2075 BOOL result = FALSE;
2076 LONG lRet;
2077 HKEY hKey;
2078
2079 lRet = RegOpenKeyExW(hKeyRoot, keyPath, 0, KEY_READ|KEY_SET_VALUE, &hKey);
2080 if (lRet != ERROR_SUCCESS)
2081 {
2083 return FALSE;
2084 }
2085
2088
2090 goto done;
2091
2092 lRet = SHDeleteKey(hKeyRoot, keyPath);
2093 if (lRet != ERROR_SUCCESS)
2094 {
2095 error(hwnd, IDS_BAD_KEY, keyPath);
2096 goto done;
2097 }
2098 result = TRUE;
2099
2100done:
2102 return result;
2103}
#define msg(x)
Definition: auth_time.c:54
ChildWnd * g_pChildWnd
Definition: childwnd.c:24
static void error_code_messagebox(HWND hwnd, DWORD error_code)
Definition: edit.c:179
#define IDS_QUERY_DELETE_KEY_ONE
Definition: resource.h:153
#define IDS_BAD_KEY
Definition: resource.h:142
#define IDS_QUERY_DELETE_KEY_CONFIRM
Definition: resource.h:155
unsigned int BOOL
Definition: ntddk_ex.h:94
FxAutoRegKey hKey
GLuint64EXT * result
Definition: glext.h:11304
#define error(str)
Definition: mkdosfs.c:1605
#define KEY_READ
Definition: nt_native.h:1023
#define KEY_SET_VALUE
Definition: nt_native.h:1017
HWND hWnd
Definition: main.h:62
#define MB_YESNO
Definition: winuser.h:817
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define MB_ICONQUESTION
Definition: winuser.h:789
#define IDYES
Definition: winuser.h:835

Referenced by _CmdWndProc(), and DECLARE_INTERFACE_().

◆ DwordEditSubclassProc()

LRESULT CALLBACK DwordEditSubclassProc ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 347 of file edit.c.

348{
349 WNDPROC oldwndproc;
350
352
353 switch (uMsg)
354 {
355 case WM_CHAR:
357 {
358 if (isdigit((int) wParam & 0xff) || iscntrl((int) wParam & 0xff))
359 {
360 break;
361 }
362 else
363 {
364 return 0;
365 }
366 }
367 else if (dwordEditMode == EDIT_MODE_HEX)
368 {
369 if (isxdigit((int) wParam & 0xff) || iscntrl((int) wParam & 0xff))
370 {
371 break;
372 }
373 else
374 {
375 return 0;
376 }
377 }
378 else
379 {
380 break;
381 }
382 }
383
384 return CallWindowProcW(oldwndproc, hwnd, uMsg, wParam, lParam);
385}
#define isdigit(c)
Definition: acclib.h:68
#define isxdigit(c)
Definition: acclib.h:70
static EDIT_MODE dwordEditMode
Definition: edit.c:154
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
_Check_return_ _CRTIMP int __cdecl iscntrl(_In_ int _C)
#define GetWindowLongPtr
Definition: treelist.c:73
#define GWLP_USERDATA
Definition: treelist.c:63
#define WM_CHAR
Definition: winuser.h:1717
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2906
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by modify_dword_dlgproc().

◆ error()

void error ( HWND  hwnd,
INT  resId,
  ... 
)

Definition at line 156 of file edit.c.

157{
158 va_list ap;
159 WCHAR title[256];
160 WCHAR errfmt[1024];
161 WCHAR errstr[1024];
163
165
167 StringCbCopyW(title, sizeof(title), L"Error");
168
169 if (!LoadStringW(hInstance, resId, errfmt, ARRAY_SIZE(errfmt)))
170 StringCbCopyW(errfmt, sizeof(errfmt), L"Unknown error string!");
171
172 va_start(ap, resId);
174 va_end(ap);
175
177}
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
#define IDS_ERROR
Definition: resource.h:18
HINSTANCE hInstance
Definition: charmap.c:19
_CRTIMP int __cdecl _vsnwprintf(wchar_t *_Dest, size_t _Count, const wchar_t *_Format, va_list _Args)
static char title[]
Definition: ps.c:92
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:166
const char * errstr(int errcode)
#define GetModuleHandle
Definition: winbase.h:3827
void int int ULONGLONG int va_list * ap
Definition: winesup.h:36
#define MB_ICONERROR
Definition: winuser.h:787
#define MB_OK
Definition: winuser.h:790

◆ error_code_messagebox()

static void error_code_messagebox ( HWND  hwnd,
DWORD  error_code 
)
static

Definition at line 179 of file edit.c.

180{
181 WCHAR title[256];
183 StringCbCopyW(title, sizeof(title), L"Error");
185}
int ErrorMessageBox(HWND hWnd, LPCWSTR lpTitle, DWORD dwErrorCode,...)
Definition: error.c:24
static int error_code[8]
Definition: odbccp32.c:61

Referenced by DeleteKey().

◆ GetInterfaceType()

static VOID GetInterfaceType ( INTERFACE_TYPE  InterfaceType,
LPWSTR  pBuffer,
DWORD  dwLength 
)
static

Definition at line 691 of file edit.c.

694{
695// LPWSTR lpInterfaceType;
696
697 switch (InterfaceType)
698 {
701// lpInterfaceType = L"Undefined";
702 break;
703 case Internal:
705// lpInterfaceType = L"Internal";
706 break;
707 case Isa:
709// lpInterfaceType = L"Isa";
710 break;
711 case Eisa:
713// lpInterfaceType = L"Eisa";
714 break;
715 case MicroChannel:
717// lpInterfaceType = L"MicroChannel";
718 break;
719 case TurboChannel:
721// lpInterfaceType = L"TurboChannel";
722 break;
723 case PCIBus:
725// lpInterfaceType = L"PCIBus";
726 break;
727 case VMEBus:
729// lpInterfaceType = L"VMEBus";
730 break;
731 case NuBus:
733// lpInterfaceType = L"NuBus";
734 break;
735 case PCMCIABus:
737// lpInterfaceType = L"PCMCIABus";
738 break;
739 case CBus:
741// lpInterfaceType = L"CBus";
742 break;
743 case MPIBus:
745// lpInterfaceType = L"MPIBus";
746 break;
747 case MPSABus:
749// lpInterfaceType = L"MPSABus";
750 break;
753// lpInterfaceType = L"ProcessorInternal";
754 break;
755 case InternalPowerBus:
757// lpInterfaceType = L"InternalPowerBus";
758 break;
759 case PNPISABus:
761// lpInterfaceType = L"PNPISABus";
762 break;
763 case PNPBus:
765// lpInterfaceType = L"PNPBus";
766 break;
767 default:
769// lpInterfaceType = L"Unknown interface type";
770 break;
771 }
772
773// wcscpy(pBuffer, lpInterfaceType);
774}
#define IDS_BUS_PCMCIABUS
Definition: resource.h:239
#define IDS_BUS_UNDEFINED
Definition: resource.h:230
#define IDS_BUS_NUBUS
Definition: resource.h:238
#define IDS_BUS_PNPISABUS
Definition: resource.h:245
#define IDS_BUS_TURBOCHANNEL
Definition: resource.h:235
#define IDS_BUS_MICROCHANNEL
Definition: resource.h:234
#define IDS_BUS_EISA
Definition: resource.h:233
#define IDS_BUS_PROCESSORINTERNAL
Definition: resource.h:243
#define IDS_BUS_CBUS
Definition: resource.h:240
#define IDS_BUS_MPSABUS
Definition: resource.h:242
#define IDS_BUS_INTERNALPOWERBUS
Definition: resource.h:244
#define IDS_BUS_PCIBUS
Definition: resource.h:236
#define IDS_BUS_MPIBUS
Definition: resource.h:241
#define IDS_BUS_PNPBUS
Definition: resource.h:246
#define IDS_BUS_INTERNAL
Definition: resource.h:231
#define IDS_BUS_VMEBUS
Definition: resource.h:237
#define IDS_BUS_UNKNOWNTYPE
Definition: resource.h:247
#define IDS_BUS_ISA
Definition: resource.h:232
static DWORD DWORD * dwLength
Definition: fusion.c:86
@ Eisa
Definition: hwresource.cpp:139
@ VMEBus
Definition: hwresource.cpp:143
@ InterfaceTypeUndefined
Definition: hwresource.cpp:136
@ CBus
Definition: hwresource.cpp:146
@ TurboChannel
Definition: hwresource.cpp:141
@ PNPBus
Definition: hwresource.cpp:152
@ PCIBus
Definition: hwresource.cpp:142
@ MPIBus
Definition: hwresource.cpp:147
@ InternalPowerBus
Definition: hwresource.cpp:150
@ MPSABus
Definition: hwresource.cpp:148
@ Internal
Definition: hwresource.cpp:137
@ NuBus
Definition: hwresource.cpp:144
@ MicroChannel
Definition: hwresource.cpp:140
@ PNPISABus
Definition: hwresource.cpp:151
@ ProcessorInternal
Definition: hwresource.cpp:149
@ Isa
Definition: hwresource.cpp:138
@ PCMCIABus
Definition: hwresource.cpp:145
PVOID pBuffer
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID InterfaceType
Definition: wdffdo.h:463

Referenced by AddFullResourcesToList(), AddRequirementsToList(), and ParseResources().

◆ GetInterruptType()

static VOID GetInterruptType ( USHORT  Flags,
LPWSTR  pBuffer,
DWORD  dwLength 
)
static

Definition at line 1321 of file edit.c.

1325{
1327 {
1329 }
1330 else
1331 {
1333 }
1334}
#define IDS_INTERRUPT_EDGE_SENSITIVE
Definition: resource.h:224
#define IDS_INTERRUPT_LEVEL_SENSITIVE
Definition: resource.h:225
#define CM_RESOURCE_INTERRUPT_LEVEL_LATCHED_BITS
Definition: cmtypes.h:151
#define CM_RESOURCE_INTERRUPT_LATCHED
Definition: cmtypes.h:144
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

Referenced by show_requirements_interrupt_dlgproc().

◆ GetKeyName()

BOOL GetKeyName ( LPWSTR  pszDest,
size_t  iDestLength,
HKEY  hRootKey,
LPCWSTR  lpSubKey 
)

Definition at line 2206 of file edit.c.

2207{
2208 LPCWSTR pszRootKey;
2209
2210 if (hRootKey == HKEY_CLASSES_ROOT)
2211 pszRootKey = L"HKEY_CLASSES_ROOT";
2212 else if (hRootKey == HKEY_CURRENT_USER)
2213 pszRootKey = L"HKEY_CURRENT_USER";
2214 else if (hRootKey == HKEY_LOCAL_MACHINE)
2215 pszRootKey = L"HKEY_LOCAL_MACHINE";
2216 else if (hRootKey == HKEY_USERS)
2217 pszRootKey = L"HKEY_USERS";
2218 else if (hRootKey == HKEY_CURRENT_CONFIG)
2219 pszRootKey = L"HKEY_CURRENT_CONFIG";
2220 else if (hRootKey == HKEY_DYN_DATA)
2221 pszRootKey = L"HKEY_DYN_DATA";
2222 else
2223 return FALSE;
2224
2225 if (lpSubKey[0])
2226 _snwprintf(pszDest, iDestLength, L"%s\\%s", pszRootKey, lpSubKey);
2227 else
2228 _snwprintf(pszDest, iDestLength, L"%s", pszRootKey);
2229 return TRUE;
2230}
int _snwprintf(wchar_t *buffer, size_t count, const wchar_t *format,...)
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_CURRENT_CONFIG
Definition: winreg.h:15
#define HKEY_DYN_DATA
Definition: winreg.h:16
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
#define HKEY_USERS
Definition: winreg.h:13
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by CopyKeyName(), ExportRegistryFile(), FindNext(), GetItemFullPath(), and ScControl().

◆ GetMemoryAccess()

static VOID GetMemoryAccess ( USHORT  Flags,
LPWSTR  pBuffer,
DWORD  dwLength 
)
static

Definition at line 1301 of file edit.c.

1305{
1307 {
1309 }
1311 {
1313 }
1315 {
1317 }
1318}
#define IDS_MEMORY_READ_WRITE
Definition: resource.h:228
#define IDS_MEMORY_READ_ONLY
Definition: resource.h:226
#define IDS_MEMORY_WRITE_ONLY
Definition: resource.h:227
#define CM_RESOURCE_MEMORY_READ_ONLY
Definition: cmtypes.h:121
#define CM_RESOURCE_MEMORY_READ_WRITE
Definition: cmtypes.h:120
#define CM_RESOURCE_MEMORY_WRITE_ONLY
Definition: cmtypes.h:122

Referenced by show_requirements_memory_dlgproc().

◆ GetPortType()

static VOID GetPortType ( USHORT  Flags,
LPWSTR  pBuffer,
DWORD  dwLength 
)
static

Definition at line 1285 of file edit.c.

1289{
1291 {
1293 }
1295 {
1297 }
1298}
#define IDS_PORT_PORT_IO
Definition: resource.h:222
#define IDS_PORT_MEMORY_IO
Definition: resource.h:223
#define CM_RESOURCE_PORT_MEMORY
Definition: cmtypes.h:108
#define CM_RESOURCE_PORT_IO
Definition: cmtypes.h:109

Referenced by show_requirements_port_dlgproc().

◆ GetResourceType()

static VOID GetResourceType ( UCHAR  ResourceType,
LPWSTR  pBuffer,
DWORD  dwLength 
)
static

Definition at line 1230 of file edit.c.

1233{
1234 switch (ResourceType)
1235 {
1236 case CmResourceTypePort:
1238 break;
1239
1242 break;
1243
1246 break;
1247
1248 case CmResourceTypeDma:
1250 break;
1251
1252 default:
1253 wsprintf(pBuffer, L"Unknown %u", ResourceType);
1254 break;
1255 }
1256}
#define IDS_TYPE_DMA
Definition: resource.h:268
#define IDS_TYPE_PORT
Definition: resource.h:265
#define IDS_TYPE_MEMORY
Definition: resource.h:267
#define IDS_TYPE_INTERRUPT
Definition: resource.h:266
#define CmResourceTypeMemory
Definition: hwresource.cpp:125
#define CmResourceTypeDma
Definition: hwresource.cpp:126
#define CmResourceTypePort
Definition: hwresource.cpp:123
#define CmResourceTypeInterrupt
Definition: hwresource.cpp:124

Referenced by AddRequirementsToList().

◆ GetShareDisposition()

static VOID GetShareDisposition ( UCHAR  ShareDisposition,
LPWSTR  pBuffer,
DWORD  dwLength 
)
static

Definition at line 1259 of file edit.c.

1263{
1264 switch (ShareDisposition)
1265 {
1268 break;
1269
1272 break;
1273
1276 break;
1277
1280 break;
1281 }
1282}
#define IDS_SHARE_UNDETERMINED
Definition: resource.h:272
#define IDS_SHARE_DRIVER_EXCLUSIVE
Definition: resource.h:270
#define IDS_SHARE_DEVICE_EXCLUSIVE
Definition: resource.h:269
#define IDS_SHARE_SHARED
Definition: resource.h:271
@ CmResourceShareDeviceExclusive
Definition: cmtypes.h:241
@ CmResourceShareShared
Definition: cmtypes.h:243
@ CmResourceShareUndetermined
Definition: cmtypes.h:240
@ CmResourceShareDriverExclusive
Definition: cmtypes.h:242

Referenced by show_requirements_dma_dlgproc(), show_requirements_interrupt_dlgproc(), show_requirements_memory_dlgproc(), and show_requirements_port_dlgproc().

◆ modify_binary_dlgproc()

INT_PTR CALLBACK modify_binary_dlgproc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 502 of file edit.c.

503{
504 HWND hwndValue;
505 UINT len;
506
508
509 switch(uMsg)
510 {
511 case WM_INITDIALOG:
513 {
515 }
516 else
517 {
518 WCHAR buffer[255];
521 }
522 hwndValue = GetDlgItem(hwndDlg, IDC_VALUE_DATA);
524 /* reset the hex edit control's font */
525 SendMessageW(hwndValue, WM_SETFONT, 0, 0);
526 SetFocus(hwndValue);
527 return FALSE;
528 case WM_COMMAND:
529 switch (LOWORD(wParam))
530 {
531 case IDOK:
532 if ((hwndValue = GetDlgItem(hwndDlg, IDC_VALUE_DATA)))
533 {
534 len = (UINT) HexEdit_GetBufferSize(hwndValue);
535 if (len > 0 && binValueData)
537 else
541 }
542 EndDialog(hwndDlg, IDOK);
543 break;
544 case IDCANCEL:
545 EndDialog(hwndDlg, IDCANCEL);
546 return TRUE;
547 }
548 }
549 return FALSE;
550}
static DWORD valueDataLen
Definition: edit.c:151
static const WCHAR * editValueName
Definition: edit.c:145
static PVOID binValueData
Definition: edit.c:147
#define IDC_VALUE_DATA
Definition: resource.h:277
#define IDC_VALUE_NAME
Definition: resource.h:276
#define IDS_DEFAULT_VALUE_NAME
Definition: resource.h:126
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapReAlloc
Definition: compat.h:734
GLenum GLsizei len
Definition: glext.h:6722
#define HexEdit_LoadBuffer(hWnd, Buffer, Size)
Definition: hexedit.h:24
#define HexEdit_GetBufferSize(hWnd)
Definition: hexedit.h:33
#define HexEdit_CopyBuffer(hWnd, Buffer, nMax)
Definition: hexedit.h:30
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define LOWORD(l)
Definition: pedump.c:82
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define IDCANCEL
Definition: winuser.h:831
#define WM_COMMAND
Definition: winuser.h:1740
#define WM_INITDIALOG
Definition: winuser.h:1739
#define IDOK
Definition: winuser.h:830
HWND WINAPI SetFocus(_In_opt_ HWND)
#define WM_SETFONT
Definition: winuser.h:1650
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)

Referenced by ModifyValue().

◆ modify_dword_dlgproc()

INT_PTR CALLBACK modify_dword_dlgproc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 388 of file edit.c.

389{
390 WNDPROC oldproc;
391 HWND hwndValue;
392 WCHAR ValueString[32];
394 DWORD Base;
395 DWORD Value = 0;
396
398
399 switch(uMsg)
400 {
401 case WM_INITDIALOG:
403
404 /* subclass the edit control */
405 hwndValue = GetDlgItem(hwndDlg, IDC_VALUE_DATA);
406 oldproc = (WNDPROC)GetWindowLongPtr(hwndValue, GWLP_WNDPROC);
407 SetWindowLongPtr(hwndValue, GWLP_USERDATA, (DWORD_PTR)oldproc);
409
411 {
413 }
414 else
415 {
416 WCHAR buffer[255];
419 }
421 StringCbPrintfW(ValueString, sizeof(ValueString), L"%lx", dwordValueData);
422 SetDlgItemTextW(hwndDlg, IDC_VALUE_DATA, ValueString);
425 return FALSE;
426
427 case WM_COMMAND:
428 switch (LOWORD(wParam))
429 {
430 case IDC_FORMAT_HEX:
432 {
434 if ((hwndValue = GetDlgItem(hwndDlg, IDC_VALUE_DATA)))
435 {
436 if (GetWindowTextLength(hwndValue))
437 {
438 if (GetWindowTextW(hwndValue, ValueString, 32))
439 {
440 Value = wcstoul (ValueString, &Remainder, 10);
441 }
442 }
443 }
444 StringCbPrintfW(ValueString, sizeof(ValueString), L"%lx", Value);
445 SetDlgItemTextW(hwndDlg, IDC_VALUE_DATA, ValueString);
446 return TRUE;
447 }
448 break;
449
450 case IDC_FORMAT_DEC:
452 {
454 if ((hwndValue = GetDlgItem(hwndDlg, IDC_VALUE_DATA)))
455 {
456 if (GetWindowTextLength(hwndValue))
457 {
458 if (GetWindowTextW(hwndValue, ValueString, 32))
459 {
460 Value = wcstoul (ValueString, &Remainder, 16);
461 }
462 }
463 }
464 StringCbPrintfW(ValueString, sizeof(ValueString), L"%lu", Value);
465 SetDlgItemTextW(hwndDlg, IDC_VALUE_DATA, ValueString);
466 return TRUE;
467 }
468 break;
469
470 case IDOK:
471 if ((hwndValue = GetDlgItem(hwndDlg, IDC_VALUE_DATA)))
472 {
473 if (GetWindowTextLength(hwndValue))
474 {
475 if (!GetWindowTextW(hwndValue, ValueString, 32))
476 {
477 EndDialog(hwndDlg, IDCANCEL);
478 return TRUE;
479 }
480
481 Base = (dwordEditMode == EDIT_MODE_HEX) ? 16 : 10;
482 dwordValueData = wcstoul (ValueString, &Remainder, Base);
483 }
484 else
485 {
486 EndDialog(hwndDlg, IDCANCEL);
487 return TRUE;
488 }
489 }
490 EndDialog(hwndDlg, IDOK);
491 return TRUE;
492
493 case IDCANCEL:
494 EndDialog(hwndDlg, IDCANCEL);
495 return TRUE;
496 }
497 }
498 return FALSE;
499}
static DWORD dwordValueData
Definition: edit.c:148
LRESULT CALLBACK DwordEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: edit.c:347
#define IDC_FORMAT_DEC
Definition: resource.h:281
#define IDC_FORMAT_HEX
Definition: resource.h:280
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
_In_opt_ ULONG Base
Definition: rtlfuncs.h:2439
STRSAFEAPI StringCbPrintfW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:557
#define SetWindowLongPtr
Definition: treelist.c:70
#define GWLP_WNDPROC
Definition: treelist.c:66
uint32_t DWORD_PTR
Definition: typedefs.h:65
#define HIWORD(l)
Definition: typedefs.h:247
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1412
#define GetWindowTextLength
Definition: winuser.h:5808
#define SendMessage
Definition: winuser.h:5852
#define EM_SETSEL
Definition: winuser.h:2018
BOOL WINAPI CheckRadioButton(_In_ HWND, _In_ int, _In_ int, _In_ int)
#define BN_CLICKED
Definition: winuser.h:1925
_In_ LARGE_INTEGER _Out_opt_ PLARGE_INTEGER Remainder
Definition: rtlfuncs.h:3045
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by ModifyValue().

◆ modify_multi_string_dlgproc()

INT_PTR CALLBACK modify_multi_string_dlgproc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 279 of file edit.c.

280{
281 WCHAR* valueData;
282 HWND hwndValue;
283 int len;
284
286
287 switch(uMsg)
288 {
289 case WM_INITDIALOG:
291 {
293 }
294 else
295 {
296 WCHAR buffer[255];
299 }
302 return FALSE;
303 case WM_COMMAND:
304 switch (LOWORD(wParam))
305 {
306 case IDOK:
307 if ((hwndValue = GetDlgItem(hwndDlg, IDC_VALUE_DATA)))
308 {
309 if ((len = GetWindowTextLength(hwndValue)))
310 {
311 if (stringValueData)
312 {
313 if ((valueData = HeapReAlloc(GetProcessHeap(), 0, stringValueData, (len + 1) * sizeof(WCHAR))))
314 {
315 stringValueData = valueData;
316 if (!GetWindowTextW(hwndValue, stringValueData, len + 1))
317 *stringValueData = 0;
318 }
319 }
320 else
321 {
322 if ((valueData = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR))))
323 {
324 stringValueData = valueData;
325 if (!GetWindowTextW(hwndValue, stringValueData, len + 1))
326 *stringValueData = 0;
327 }
328 }
329 }
330 else
331 {
332 if (stringValueData)
333 *stringValueData = 0;
334 }
335 }
336 EndDialog(hwndDlg, IDOK);
337 break;
338 case IDCANCEL:
339 EndDialog(hwndDlg, IDCANCEL);
340 return TRUE;
341 }
342 }
343 return FALSE;
344}
static WCHAR * stringValueData
Definition: edit.c:146

Referenced by ModifyValue().

◆ modify_requirements_list_dlgproc()

static INT_PTR CALLBACK modify_requirements_list_dlgproc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1624 of file edit.c.

1625{
1627
1628 switch(uMsg)
1629 {
1630 case WM_INITDIALOG:
1633 return FALSE;
1634
1635 case WM_NOTIFY:
1636 return OnRequirementsListNotify(hwndDlg, (NMHDR *)lParam);
1637
1638 case WM_COMMAND:
1639 switch (LOWORD(wParam))
1640 {
1642 if (requirementsIndex != -1)
1643 ShowRequirement(hwndDlg);
1644 break;
1645 case IDOK:
1646 EndDialog(hwndDlg, IDOK);
1647 break;
1648 case IDCANCEL:
1649 EndDialog(hwndDlg, IDCANCEL);
1650 return TRUE;
1651 }
1652 }
1653 return FALSE;
1654}
static BOOL OnRequirementsListNotify(HWND hwndDlg, NMHDR *phdr)
Definition: edit.c:1596
static VOID ShowRequirement(HWND hwndDlg)
Definition: edit.c:1559
static VOID AddRequirementsToList(HWND hwndDlg, HWND hwnd)
Definition: edit.c:1337
static BOOL CreateRequirementsListColumns(HWND hWndListView)
Definition: edit.c:1186
static INT requirementsIndex
Definition: edit.c:153
#define IDC_SHOW_REQUIREMENT
Definition: resource.h:327
#define IDC_REQUIREMENTS_LIST
Definition: resource.h:323
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by ModifyValue().

◆ modify_resource_dlgproc()

static INT_PTR CALLBACK modify_resource_dlgproc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1032 of file edit.c.

1033{
1035
1036 switch(uMsg)
1037 {
1038 case WM_INITDIALOG:
1039 CreateResourceColumns(hwndDlg);
1040 ParseResources(hwndDlg);
1041 return FALSE;
1042
1043 case WM_NOTIFY:
1044 return OnResourceNotify(hwndDlg, (NMHDR *)lParam);
1045
1046 case WM_COMMAND:
1047 switch (LOWORD(wParam))
1048 {
1049 case IDOK:
1050 EndDialog(hwndDlg, IDOK);
1051 break;
1052 case IDCANCEL:
1053 EndDialog(hwndDlg, IDCANCEL);
1054 return TRUE;
1055 }
1056 }
1057 return FALSE;
1058}
static BOOL OnResourceNotify(HWND hwndDlg, NMHDR *phdr)
Definition: edit.c:976
static BOOL CreateResourceColumns(HWND hwnd)
Definition: edit.c:553
static VOID ParseResources(HWND hwnd)
Definition: edit.c:778

Referenced by modify_resource_list_dlgproc(), ModifyValue(), and OnResourceListNotify().

◆ modify_resource_list_dlgproc()

static INT_PTR CALLBACK modify_resource_list_dlgproc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1153 of file edit.c.

1154{
1156
1157 switch(uMsg)
1158 {
1159 case WM_INITDIALOG:
1162 return FALSE;
1163
1164 case WM_NOTIFY:
1165 return OnResourceListNotify(hwndDlg, (NMHDR *)lParam);
1166
1167 case WM_COMMAND:
1168 switch (LOWORD(wParam))
1169 {
1170 case IDC_SHOW_RESOURCE:
1171 if (fullResourceIndex != -1)
1173 break;
1174 case IDOK:
1175 EndDialog(hwndDlg, IDOK);
1176 break;
1177 case IDCANCEL:
1178 EndDialog(hwndDlg, IDCANCEL);
1179 return TRUE;
1180 }
1181 }
1182 return FALSE;
1183}
static INT fullResourceIndex
Definition: edit.c:150
static INT_PTR CALLBACK modify_resource_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: edit.c:1032
static VOID AddFullResourcesToList(HWND hwnd)
Definition: edit.c:1091
static BOOL OnResourceListNotify(HWND hwndDlg, NMHDR *phdr)
Definition: edit.c:1124
static BOOL CreateResourceListColumns(HWND hWndListView)
Definition: edit.c:1060
#define IDD_EDIT_RESOURCE
Definition: resource.h:306
#define IDC_SHOW_RESOURCE
Definition: resource.h:304
#define IDC_RESOURCE_LIST
Definition: resource.h:303
#define DialogBoxW(i, t, p, f)
Definition: winuser.h:4399
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Referenced by ModifyValue().

◆ modify_string_dlgproc()

INT_PTR CALLBACK modify_string_dlgproc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 210 of file edit.c.

211{
212 WCHAR* valueData;
213 HWND hwndValue;
214 int len;
215
217
218 switch(uMsg)
219 {
220 case WM_INITDIALOG:
222 {
224 }
225 else
226 {
227 WCHAR buffer[255];
230 }
234 return FALSE;
235 case WM_COMMAND:
236 switch (LOWORD(wParam))
237 {
238 case IDOK:
239 if ((hwndValue = GetDlgItem(hwndDlg, IDC_VALUE_DATA)))
240 {
241 if ((len = GetWindowTextLength(hwndValue)))
242 {
243 if (stringValueData)
244 {
245 if ((valueData = HeapReAlloc(GetProcessHeap(), 0, stringValueData, (len + 1) * sizeof(WCHAR))))
246 {
247 stringValueData = valueData;
248 if (!GetWindowTextW(hwndValue, stringValueData, len + 1))
249 *stringValueData = 0;
250 }
251 }
252 else
253 {
254 if ((valueData = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR))))
255 {
256 stringValueData = valueData;
257 if (!GetWindowTextW(hwndValue, stringValueData, len + 1))
258 *stringValueData = 0;
259 }
260 }
261 }
262 else
263 {
264 if (stringValueData)
265 *stringValueData = 0;
266 }
267 }
268 EndDialog(hwndDlg, IDOK);
269 break;
270 case IDCANCEL:
271 EndDialog(hwndDlg, IDCANCEL);
272 return TRUE;
273 }
274 }
275 return FALSE;
276}

Referenced by ModifyValue().

◆ ModifyValue()

BOOL ModifyValue ( HWND  hwnd,
HKEY  hKey,
LPCWSTR  valueName,
BOOL  EditBin 
)

Definition at line 1656 of file edit.c.

1657{
1658 DWORD type;
1659 LONG lRet;
1660 BOOL result = FALSE;
1661
1662 if (!hKey)
1663 return FALSE;
1664
1665 editValueName = valueName;
1666
1667 lRet = RegQueryValueExW(hKey, valueName, 0, &type, 0, &valueDataLen);
1668 if (lRet != ERROR_SUCCESS && (valueName == NULL || !valueName[0]))
1669 {
1670 lRet = ERROR_SUCCESS; /* Allow editing of (Default) values which don't exist */
1671 type = REG_SZ;
1672 valueDataLen = 0;
1675 }
1676
1677 if (lRet != ERROR_SUCCESS)
1678 {
1679 error(hwnd, IDS_BAD_VALUE, valueName);
1680 goto done;
1681 }
1682
1683 if (EditBin == FALSE && ((type == REG_SZ) || (type == REG_EXPAND_SZ)))
1684 {
1685 if (valueDataLen > 0)
1686 {
1688 {
1690 goto done;
1691 }
1692 lRet = RegQueryValueExW(hKey, valueName, 0, 0, (LPBYTE)stringValueData, &valueDataLen);
1693 if (lRet != ERROR_SUCCESS)
1694 {
1695 error(hwnd, IDS_BAD_VALUE, valueName);
1696 goto done;
1697 }
1698 }
1699 else
1700 {
1702 }
1703
1705 {
1706 if (stringValueData)
1707 {
1708 lRet = RegSetValueExW(hKey, valueName, 0, type, (LPBYTE)stringValueData, (DWORD) (wcslen(stringValueData) + 1) * sizeof(WCHAR));
1709 }
1710 else
1711 {
1712 lRet = RegSetValueExW(hKey, valueName, 0, type, NULL, 0);
1713 }
1714 if (lRet == ERROR_SUCCESS)
1715 result = TRUE;
1716 }
1717 }
1718 else if (EditBin == FALSE && type == REG_MULTI_SZ)
1719 {
1720 if (valueDataLen > 0)
1721 {
1722 size_t llen, listlen, nl_len;
1723 LPWSTR src, lines = NULL;
1724
1726 {
1728 goto done;
1729 }
1730 lRet = RegQueryValueExW(hKey, valueName, 0, 0, (LPBYTE)stringValueData, &valueDataLen);
1731 if (lRet != ERROR_SUCCESS)
1732 {
1733 error(hwnd, IDS_BAD_VALUE, valueName);
1734 goto done;
1735 }
1736
1737 /* convert \0 to \r\n */
1739 nl_len = wcslen(L"\r\n") * sizeof(WCHAR);
1740 listlen = sizeof(WCHAR);
1741 lines = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, listlen + sizeof(WCHAR));
1742 while(*src != L'\0')
1743 {
1744 llen = wcslen(src);
1745 if(llen == 0)
1746 break;
1747 listlen += (llen * sizeof(WCHAR)) + nl_len;
1749 wcscat(lines, src);
1750 wcscat(lines, L"\r\n");
1751 src += llen + 1;
1752 }
1755 }
1756 else
1757 {
1759 }
1760
1762 {
1763 if (stringValueData)
1764 {
1765 /* convert \r\n to \0 */
1766 BOOL EmptyLines = FALSE;
1767 LPWSTR src, lines, nl;
1768 size_t linechars, buflen, c_nl, dest;
1769
1771 buflen = sizeof(WCHAR);
1772 lines = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, buflen + sizeof(WCHAR));
1773 c_nl = wcslen(L"\r\n");
1774 dest = 0;
1775 while(*src != L'\0')
1776 {
1777 if((nl = wcsstr(src, L"\r\n")))
1778 {
1779 linechars = nl - src;
1780 if(nl == src)
1781 {
1782 EmptyLines = TRUE;
1783 src = nl + c_nl;
1784 continue;
1785 }
1786 }
1787 else
1788 {
1789 linechars = wcslen(src);
1790 }
1791 if(linechars > 0)
1792 {
1793 buflen += ((linechars + 1) * sizeof(WCHAR));
1795 memcpy((lines + dest), src, linechars * sizeof(WCHAR));
1796 dest += linechars;
1797 lines[dest++] = L'\0';
1798 }
1799 else
1800 {
1801 EmptyLines = TRUE;
1802 }
1803 src += linechars + (nl != NULL ? c_nl : 0);
1804 }
1805 lines[++dest] = L'\0';
1806
1807 if(EmptyLines)
1808 {
1810 }
1811
1812 lRet = RegSetValueExW(hKey, valueName, 0, type, (LPBYTE)lines, (DWORD) buflen);
1814 }
1815 else
1816 {
1817 lRet = RegSetValueExW(hKey, valueName, 0, type, NULL, 0);
1818 }
1819 if (lRet == ERROR_SUCCESS)
1820 result = TRUE;
1821 }
1822 }
1823 else if (EditBin == FALSE && type == REG_DWORD)
1824 {
1825 lRet = RegQueryValueExW(hKey, valueName, 0, 0, (LPBYTE)&dwordValueData, &valueDataLen);
1826 if (lRet != ERROR_SUCCESS)
1827 {
1828 error(hwnd, IDS_BAD_VALUE, valueName);
1829 goto done;
1830 }
1831
1833 {
1834 lRet = RegSetValueExW(hKey, valueName, 0, type, (LPBYTE)&dwordValueData, sizeof(DWORD));
1835 if (lRet == ERROR_SUCCESS)
1836 result = TRUE;
1837 }
1838 }
1839 else if (EditBin == FALSE && type == REG_RESOURCE_LIST)
1840 {
1841 if (valueDataLen > 0)
1842 {
1844 if (resourceValueData == NULL)
1845 {
1847 goto done;
1848 }
1849
1850 lRet = RegQueryValueExW(hKey, valueName, 0, 0, (LPBYTE)resourceValueData, &valueDataLen);
1851 if (lRet != ERROR_SUCCESS)
1852 {
1853 error(hwnd, IDS_BAD_VALUE, valueName);
1854 goto done;
1855 }
1856 }
1857 else
1858 {
1860 }
1861
1863 {
1864 }
1865 }
1866 else if (EditBin == FALSE && type == REG_FULL_RESOURCE_DESCRIPTOR)
1867 {
1868 if (valueDataLen > 0)
1869 {
1871 if (resourceValueData == NULL)
1872 {
1874 goto done;
1875 }
1876
1877 lRet = RegQueryValueExW(hKey, valueName, 0, 0, (LPBYTE)&resourceValueData->List[0], &valueDataLen);
1878 if (lRet != ERROR_SUCCESS)
1879 {
1880 error(hwnd, IDS_BAD_VALUE, valueName);
1881 goto done;
1882 }
1883
1886 }
1887 else
1888 {
1890 }
1891
1893 {
1894 }
1895 }
1896 else if (EditBin == FALSE && type == REG_RESOURCE_REQUIREMENTS_LIST)
1897 {
1898 if (valueDataLen > 0)
1899 {
1902 {
1904 goto done;
1905 }
1906
1907 lRet = RegQueryValueExW(hKey, valueName, 0, 0, (LPBYTE)requirementsValueData, &valueDataLen);
1908 if (lRet != ERROR_SUCCESS)
1909 {
1910 error(hwnd, IDS_BAD_VALUE, valueName);
1911 goto done;
1912 }
1913
1914 }
1915 else
1916 {
1918 }
1919
1921 {
1922 }
1923 }
1924 else if ((EditBin != FALSE) || (type == REG_NONE) || (type == REG_BINARY))
1925 {
1926 if(valueDataLen > 0)
1927 {
1929 {
1931 goto done;
1932 }
1933
1934 /* Use the unicode version, so editing strings in binary mode is correct */
1935 lRet = RegQueryValueExW(hKey, valueName,
1937 if (lRet != ERROR_SUCCESS)
1938 {
1940 error(hwnd, IDS_BAD_VALUE, valueName);
1941 goto done;
1942 }
1943 }
1944 else
1945 {
1947 }
1948
1950 {
1951 /* Use the unicode version, so editing strings in binary mode is correct */
1952 lRet = RegSetValueExW(hKey, valueName,
1954 if (lRet == ERROR_SUCCESS)
1955 result = TRUE;
1956 }
1957 if(binValueData != NULL)
1959 }
1960 else
1961 {
1963 }
1964
1965done:
1969
1970 if (stringValueData)
1973
1977
1978 return result;
1979}
#define IDS_BAD_VALUE
Definition: resource.h:11
INT_PTR CALLBACK modify_string_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: edit.c:210
static INT_PTR CALLBACK modify_requirements_list_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: edit.c:1624
static INT_PTR CALLBACK modify_resource_list_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: edit.c:1153
INT_PTR CALLBACK modify_multi_string_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: edit.c:279
INT_PTR CALLBACK modify_dword_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: edit.c:388
INT_PTR CALLBACK modify_binary_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: edit.c:502
#define IDD_EDIT_MULTI_STRING
Definition: resource.h:283
#define IDS_TOO_BIG_VALUE
Definition: resource.h:121
#define IDD_EDIT_STRING
Definition: resource.h:275
#define IDD_EDIT_BIN_DATA
Definition: resource.h:284
#define IDD_EDIT_RESOURCE_LIST
Definition: resource.h:302
#define IDD_EDIT_REQUIREMENTS_LIST
Definition: resource.h:322
#define IDS_MULTI_SZ_EMPTY_STRING
Definition: resource.h:124
#define IDS_UNSUPPORTED_TYPE
Definition: resource.h:120
#define IDD_EDIT_DWORD
Definition: resource.h:279
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
#define HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLenum src
Definition: glext.h:6340
_CONST_RETURN wchar_t *__cdecl wcsstr(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_SubStr)
#define REG_SZ
Definition: layer.c:22
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static char * dest
Definition: rtl.c:135
#define REG_BINARY
Definition: nt_native.h:1496
#define REG_RESOURCE_LIST
Definition: nt_native.h:1502
#define REG_MULTI_SZ
Definition: nt_native.h:1501
#define REG_RESOURCE_REQUIREMENTS_LIST
Definition: nt_native.h:1504
#define REG_NONE
Definition: nt_native.h:1492
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
#define REG_FULL_RESOURCE_DESCRIPTOR
Definition: nt_native.h:1503
#define REG_DWORD
Definition: sdbapi.c:596
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define warning(s)
Definition: debug.h:83
eMaj lines
Definition: tritemp.h:206
unsigned char * LPBYTE
Definition: typedefs.h:53

Referenced by _CmdWndProc().

◆ MoveKey()

static LONG MoveKey ( HKEY  hDestKey,
LPCWSTR  lpDestSubKey,
HKEY  hSrcKey,
LPCWSTR  lpSrcSubKey 
)
static

Definition at line 2052 of file edit.c.

2053{
2054 LONG lResult;
2055
2056 if (!lpSrcSubKey)
2058
2059 if (_wcsicmp(lpDestSubKey, lpSrcSubKey) == 0)
2060 {
2061 /* Destination name equals source name */
2062 return ERROR_SUCCESS;
2063 }
2064
2065 lResult = CopyKey(hDestKey, lpDestSubKey, hSrcKey, lpSrcSubKey);
2066 if (lResult == ERROR_SUCCESS)
2067 SHDeleteKey(hSrcKey, lpSrcSubKey);
2068
2069 return lResult;
2070}
#define ERROR_INVALID_FUNCTION
Definition: dderror.h:6
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)

Referenced by RenameKey().

◆ OnRequirementsListNotify()

static BOOL OnRequirementsListNotify ( HWND  hwndDlg,
NMHDR phdr 
)
static

Definition at line 1596 of file edit.c.

1597{
1598 LPNMLISTVIEW lpnmlv = (LPNMLISTVIEW)phdr;
1599
1600 switch (phdr->idFrom)
1601 {
1603 switch(phdr->code)
1604 {
1605 case NM_CLICK:
1606 requirementsIndex = lpnmlv->iItem;
1607 EnableWindow(GetDlgItem(hwndDlg, IDC_SHOW_REQUIREMENT), (lpnmlv->iItem != -1));
1608 break;
1609
1610 case NM_DBLCLK:
1611 if (lpnmlv->iItem != -1)
1612 {
1613 requirementsIndex = lpnmlv->iItem;
1614 ShowRequirement(hwndDlg);
1615 }
1616 break;
1617 }
1618 break;
1619 }
1620
1621 return FALSE;
1622}
#define NM_DBLCLK
Definition: commctrl.h:131
#define NM_CLICK
Definition: commctrl.h:130
struct tagNMLISTVIEW * LPNMLISTVIEW
UINT_PTR idFrom
Definition: winuser.h:3158
UINT code
Definition: winuser.h:3159
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)

Referenced by modify_requirements_list_dlgproc().

◆ OnResourceListNotify()

static BOOL OnResourceListNotify ( HWND  hwndDlg,
NMHDR phdr 
)
static

Definition at line 1124 of file edit.c.

1125{
1126 LPNMLISTVIEW lpnmlv = (LPNMLISTVIEW)phdr;
1127
1128 switch (phdr->idFrom)
1129 {
1130 case IDC_RESOURCE_LIST:
1131 switch(phdr->code)
1132 {
1133 case NM_CLICK:
1134 fullResourceIndex = lpnmlv->iItem;
1135 EnableWindow(GetDlgItem(hwndDlg, IDC_SHOW_RESOURCE), (lpnmlv->iItem != -1));
1136 break;
1137
1138 case NM_DBLCLK:
1139 if (lpnmlv->iItem != -1)
1140 {
1141 fullResourceIndex = lpnmlv->iItem;
1143 }
1144 break;
1145 }
1146 break;
1147 }
1148
1149 return FALSE;
1150}

Referenced by modify_resource_list_dlgproc().

◆ OnResourceNotify()

static BOOL OnResourceNotify ( HWND  hwndDlg,
NMHDR phdr 
)
static

Definition at line 976 of file edit.c.

977{
978 LPNMLISTVIEW lpnmlv = (LPNMLISTVIEW)phdr;
979
980 switch (phdr->idFrom)
981 {
982 case IDC_PORT_LIST:
983 case IDC_MEMORY_LIST:
984 case IDC_DMA_LIST:
985 case IDC_IRQ_LIST:
986 case IDC_DEVICE_LIST:
987 switch(phdr->code)
988 {
989 case NM_CLICK:
990 if (lpnmlv->iItem != -1)
991 {
994
995 item.mask = LVIF_PARAM;
996 item.iItem = lpnmlv->iItem;
997 item.iSubItem = 0;
998
999 if (ListView_GetItem(phdr->hwndFrom, &item))
1000 {
1001 pDescriptor = (PCM_PARTIAL_RESOURCE_DESCRIPTOR)item.lParam;
1002
1005
1007 (pDescriptor->ShareDisposition == CmResourceShareShared));
1008
1011
1014 }
1015 }
1016 else
1017 {
1022 }
1023 break;
1024 }
1025 break;
1026 }
1027
1028 return FALSE;
1029}
#define IDC_DEVICE_EXCLUSIVE
Definition: resource.h:314
#define IDC_UNDETERMINED
Definition: resource.h:312
#define IDC_SHARED
Definition: resource.h:313
#define IDC_DRIVER_EXCLUSIVE
Definition: resource.h:315
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR * PCM_PARTIAL_RESOURCE_DESCRIPTOR
#define ListView_GetItem(hwnd, pitem)
Definition: commctrl.h:2394
HWND hwndFrom
Definition: winuser.h:3157

Referenced by modify_resource_dlgproc().

◆ ParseResources()

static VOID ParseResources ( HWND  hwnd)
static

Definition at line 778 of file edit.c.

779{
780 PCM_FULL_RESOURCE_DESCRIPTOR pFullDescriptor;
781 PCM_PARTIAL_RESOURCE_LIST pPartialResourceList;
783 ULONG i;
784 HWND hwndLV;
785
786 WCHAR buffer[80];
788 INT iItem;
789
790 pFullDescriptor = &resourceValueData->List[0];
791 for (i = 0; i < fullResourceIndex; i++)
792 {
793 pFullDescriptor = (PVOID)(pFullDescriptor->PartialResourceList.PartialDescriptors +
794 pFullDescriptor->PartialResourceList.Count);
795 }
796 pPartialResourceList = &pFullDescriptor->PartialResourceList;
797
798 /* Interface type */
799 GetInterfaceType(pFullDescriptor->InterfaceType, buffer, 80);
801
802 /* Busnumber */
803 SetDlgItemInt(hwnd, IDC_BUSNUMBER, (UINT)pFullDescriptor->BusNumber, TRUE);
804
805 /* Version */
806 SetDlgItemInt(hwnd, IDC_VERSION, (UINT)pPartialResourceList->Version, FALSE);
807
808 /* Revision */
809 SetDlgItemInt(hwnd, IDC_REVISION, (UINT)pPartialResourceList->Revision, FALSE);
810
811 for (i = 0; i < pPartialResourceList->Count; i++)
812 {
813 pDescriptor = &pPartialResourceList->PartialDescriptors[i];
814
815 switch (pDescriptor->Type)
816 {
818 hwndLV = GetDlgItem(hwnd, IDC_PORT_LIST);
819
820#ifdef _M_AMD64
821 wsprintf(buffer, L"0x%016I64x", pDescriptor->u.Port.Start.QuadPart);
822#else
823 wsprintf(buffer, L"0x%08lx", pDescriptor->u.Port.Start.u.LowPart);
824#endif
825
826 item.mask = LVIF_TEXT | LVIF_PARAM;
827 item.iItem = 1000;
828 item.iSubItem = 0;
829 item.state = 0;
830 item.stateMask = 0;
831 item.pszText = buffer;
832 item.cchTextMax = (int)wcslen(item.pszText);
833 item.lParam = (LPARAM)pDescriptor;
834
835 iItem = ListView_InsertItem(hwndLV, &item);
836 if (iItem != -1)
837 {
838 wsprintf(buffer, L"0x%lx", pDescriptor->u.Port.Length);
839 ListView_SetItemText(hwndLV, iItem, 1, buffer);
840
841 if (pDescriptor->Flags & CM_RESOURCE_PORT_IO)
843 else
845 ListView_SetItemText(hwndLV, iItem, 2, buffer);
846 }
847 break;
848
850 hwndLV = GetDlgItem(hwnd, IDC_IRQ_LIST);
851
852 wsprintf(buffer, L"%lu", pDescriptor->u.Interrupt.Vector);
853
854 item.mask = LVIF_TEXT | LVIF_PARAM;
855 item.iItem = 1000;
856 item.iSubItem = 0;
857 item.state = 0;
858 item.stateMask = 0;
859 item.pszText = buffer;
860 item.cchTextMax = (int)wcslen(item.pszText);
861 item.lParam = (LPARAM)pDescriptor;
862
863 iItem = ListView_InsertItem(hwndLV, &item);
864 if (iItem != -1)
865 {
866 wsprintf(buffer, L"%lu", pDescriptor->u.Interrupt.Level);
867 ListView_SetItemText(hwndLV, iItem, 1, buffer);
868
869 wsprintf(buffer, L"0x%08lx", pDescriptor->u.Interrupt.Affinity);
870 ListView_SetItemText(hwndLV, iItem, 2, buffer);
871
872 if (pDescriptor->Flags & CM_RESOURCE_INTERRUPT_LATCHED)
874 else
876
877 ListView_SetItemText(hwndLV, iItem, 3, buffer);
878 }
879 break;
880
883
884#ifdef _M_AMD64
885 wsprintf(buffer, L"0x%016I64x", pDescriptor->u.Memory.Start.QuadPart);
886#else
887 wsprintf(buffer, L"0x%08lx", pDescriptor->u.Memory.Start.u.LowPart);
888#endif
889
890 item.mask = LVIF_TEXT | LVIF_PARAM;
891 item.iItem = 1000;
892 item.iSubItem = 0;
893 item.state = 0;
894 item.stateMask = 0;
895 item.pszText = buffer;
896 item.cchTextMax = (int)wcslen(item.pszText);
897 item.lParam = (LPARAM)pDescriptor;
898
899 iItem = ListView_InsertItem(hwndLV, &item);
900 if (iItem != -1)
901 {
902 wsprintf(buffer, L"0x%lx", pDescriptor->u.Memory.Length);
903 ListView_SetItemText(hwndLV, iItem, 1, buffer);
904
906 {
909 break;
910
913 break;
914
915 default:
917 break;
918 }
919
920 ListView_SetItemText(hwndLV, iItem, 2, buffer);
921 }
922 break;
923
925 hwndLV = GetDlgItem(hwnd, IDC_DMA_LIST);
926
927 wsprintf(buffer, L"%lu", pDescriptor->u.Dma.Channel);
928
929 item.mask = LVIF_TEXT | LVIF_PARAM;
930 item.iItem = 1000;
931 item.iSubItem = 0;
932 item.state = 0;
933 item.stateMask = 0;
934 item.pszText = buffer;
935 item.cchTextMax = (int)wcslen(item.pszText);
936 item.lParam = (LPARAM)pDescriptor;
937
938 iItem = ListView_InsertItem(hwndLV, &item);
939 if (iItem != -1)
940 {
941 wsprintf(buffer, L"%lu", pDescriptor->u.Dma.Port);
942 ListView_SetItemText(hwndLV, iItem, 1, buffer);
943 }
944 break;
945
948
949 wsprintf(buffer, L"0x%08lx", pDescriptor->u.DeviceSpecificData.Reserved1);
950
951 item.mask = LVIF_TEXT | LVIF_PARAM;
952 item.iItem = 1000;
953 item.iSubItem = 0;
954 item.state = 0;
955 item.stateMask = 0;
956 item.pszText = buffer;
957 item.cchTextMax = (int)wcslen(item.pszText);
958 item.lParam = (LPARAM)pDescriptor;
959
960 iItem = ListView_InsertItem(hwndLV, &item);
961 if (iItem != -1)
962 {
963 wsprintf(buffer, L"0x%08lx", pDescriptor->u.DeviceSpecificData.Reserved2);
964 ListView_SetItemText(hwndLV, iItem, 1, buffer);
965
966 wsprintf(buffer, L"0x%lx", pDescriptor->u.DeviceSpecificData.DataSize);
967 ListView_SetItemText(hwndLV, iItem, 2, buffer);
968 }
969 break;
970 }
971 }
972}
#define IDC_REVISION
Definition: resource.h:319
#define IDC_VERSION
Definition: resource.h:318
#define IDC_BUSNUMBER
Definition: resource.h:317
#define IDC_INTERFACETYPE
Definition: resource.h:316
#define CmResourceTypeDeviceSpecific
Definition: hwresource.cpp:127
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@398::@407 DeviceSpecificData
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@398::@404 Dma
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@398 u
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@398::@400 Port
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@398::@403 Memory
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@398::@401 Interrupt

Referenced by modify_resource_dlgproc().

◆ QueryStringValue()

LONG QueryStringValue ( HKEY  hKey,
LPCWSTR  lpSubKey,
LPCWSTR  lpValueName,
LPWSTR  pszBuffer,
DWORD  dwBufferLen 
)

Definition at line 2172 of file edit.c.

2173{
2174 LONG lResult;
2175 HKEY hSubKey = NULL;
2176 DWORD cbData, dwType;
2177
2178 if (lpSubKey)
2179 {
2180 lResult = RegOpenKeyW(hKey, lpSubKey, &hSubKey);
2181 if (lResult != ERROR_SUCCESS)
2182 goto done;
2183 hKey = hSubKey;
2184 }
2185
2186 cbData = (dwBufferLen - 1) * sizeof(*pszBuffer);
2187 lResult = RegQueryValueExW(hKey, lpValueName, NULL, &dwType, (LPBYTE) pszBuffer, &cbData);
2188 if (lResult != ERROR_SUCCESS)
2189 goto done;
2190 if (dwType != REG_SZ)
2191 {
2192 lResult = -1;
2193 goto done;
2194 }
2195
2196 pszBuffer[cbData / sizeof(*pszBuffer)] = L'\0';
2197
2198done:
2199 if (lResult != ERROR_SUCCESS)
2200 pszBuffer[0] = L'\0';
2201 if (hSubKey)
2202 RegCloseKey(hSubKey);
2203 return lResult;
2204}
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3268

◆ RenameKey()

LONG RenameKey ( HKEY  hKey,
LPCWSTR  lpSubKey,
LPCWSTR  lpNewName 
)

Definition at line 2105 of file edit.c.

2106{
2107 LPCWSTR s;
2108 LPWSTR lpNewSubKey = NULL;
2109 LONG Ret = 0;
2110 SIZE_T cbNewSubKey;
2111
2112 if (!lpSubKey)
2113 return Ret;
2114
2115 s = wcsrchr(lpSubKey, L'\\');
2116 if (s)
2117 {
2118 s++;
2119 cbNewSubKey = (s - lpSubKey + wcslen(lpNewName) + 1) * sizeof(WCHAR);
2120 lpNewSubKey = (LPWSTR) HeapAlloc(GetProcessHeap(), 0, cbNewSubKey);
2121 if (lpNewSubKey != NULL)
2122 {
2123 StringCbCopyNW(lpNewSubKey, cbNewSubKey, lpSubKey, (s - lpSubKey) * sizeof(WCHAR));
2124 StringCbCatW(lpNewSubKey, cbNewSubKey, lpNewName);
2125 lpNewName = lpNewSubKey;
2126 }
2127 else
2129 }
2130
2131 Ret = MoveKey(hKey, lpNewName, hKey, lpSubKey);
2132
2133 if (lpNewSubKey)
2134 {
2135 HeapFree(GetProcessHeap(), 0, lpNewSubKey);
2136 }
2137 return Ret;
2138}
static LONG MoveKey(HKEY hDestKey, LPCWSTR lpDestSubKey, HKEY hSrcKey, LPCWSTR lpSrcSubKey)
Definition: edit.c:2052
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define wcsrchr
Definition: compat.h:16
GLdouble s
Definition: gl.h:2039
STRSAFEAPI StringCbCopyNW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc, size_t cbToCopy)
Definition: strsafe.h:255
STRSAFEAPI StringCbCatW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:342
ULONG_PTR SIZE_T
Definition: typedefs.h:80

Referenced by TreeWndNotifyProc().

◆ RenameValue()

LONG RenameValue ( HKEY  hKey,
LPCWSTR  lpSubKey,
LPCWSTR  lpDestValue,
LPCWSTR  lpSrcValue 
)

Definition at line 2140 of file edit.c.

2141{
2142 LONG lResult;
2143 HKEY hSubKey = NULL;
2144 DWORD dwType, cbData;
2145 BYTE data[512];
2146
2147 if (lpSubKey)
2148 {
2149 lResult = RegOpenKeyW(hKey, lpSubKey, &hSubKey);
2150 if (lResult != ERROR_SUCCESS)
2151 goto done;
2152 hKey = hSubKey;
2153 }
2154
2155 cbData = sizeof(data);
2156 lResult = RegQueryValueExW(hKey, lpSrcValue, NULL, &dwType, data, &cbData);
2157 if (lResult != ERROR_SUCCESS)
2158 goto done;
2159
2160 lResult = RegSetValueExW(hKey, lpDestValue, 0, dwType, data, cbData);
2161 if (lResult != ERROR_SUCCESS)
2162 goto done;
2163
2164 RegDeleteValue(hKey, lpSrcValue);
2165
2166done:
2167 if (hSubKey)
2168 RegCloseKey(hSubKey);
2169 return lResult;
2170}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define RegDeleteValue
Definition: winreg.h:508

Referenced by ListWndNotifyProc().

◆ show_requirements_dma_dlgproc()

static INT_PTR CALLBACK show_requirements_dma_dlgproc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1525 of file edit.c.

1526{
1527 PIO_RESOURCE_DESCRIPTOR pDescriptor;
1528 WCHAR Buffer[80];
1529
1530 switch(uMsg)
1531 {
1532 case WM_INITDIALOG:
1533 pDescriptor = (PIO_RESOURCE_DESCRIPTOR)lParam;
1534 wsprintf(Buffer, L"0x%lx", pDescriptor->u.Dma.MinimumChannel);
1536 wsprintf(Buffer, L"0x%lx", pDescriptor->u.Dma.MaximumChannel);
1538
1539 GetShareDisposition(pDescriptor->ShareDisposition, Buffer, 80);
1541
1544 return FALSE;
1545
1546 case WM_COMMAND:
1547 switch (LOWORD(wParam))
1548 {
1549 case IDOK:
1550 case IDCANCEL:
1551 EndDialog(hwndDlg, IDOK);
1552 break;
1553 }
1554 }
1555 return FALSE;
1556}
struct _IO_RESOURCE_DESCRIPTOR * PIO_RESOURCE_DESCRIPTOR
#define IO_RESOURCE_ALTERNATIVE
Definition: edit.c:119
#define IO_RESOURCE_PREFERRED
Definition: edit.c:117
static VOID GetShareDisposition(UCHAR ShareDisposition, LPWSTR pBuffer, DWORD dwLength)
Definition: edit.c:1259
#define IDC_REQ_DMA_PREFERRED
Definition: resource.h:362
#define IDC_REQ_DMA_MIN
Definition: resource.h:358
#define IDC_REQ_DMA_ALTERNATIVE
Definition: resource.h:361
#define IDC_REQ_DMA_MAX
Definition: resource.h:359
#define IDC_REQ_DMA_SHARE
Definition: resource.h:360
Definition: bufpool.h:45
struct _IO_RESOURCE_DESCRIPTOR::@23::@27 Dma
union _IO_RESOURCE_DESCRIPTOR::@23 u
UCHAR ShareDisposition
Definition: edit.c:61

Referenced by ShowRequirement().

◆ show_requirements_interrupt_dlgproc()

static INT_PTR CALLBACK show_requirements_interrupt_dlgproc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1488 of file edit.c.

1489{
1490 PIO_RESOURCE_DESCRIPTOR pDescriptor;
1491 WCHAR Buffer[80];
1492
1493 switch(uMsg)
1494 {
1495 case WM_INITDIALOG:
1496 pDescriptor = (PIO_RESOURCE_DESCRIPTOR)lParam;
1497
1498 GetInterruptType(pDescriptor->Flags, Buffer, 80);
1500
1501 wsprintf(Buffer, L"0x%lx", pDescriptor->u.Interrupt.MinimumVector);
1503 wsprintf(Buffer, L"0x%lx", pDescriptor->u.Interrupt.MaximumVector);
1505
1506 GetShareDisposition(pDescriptor->ShareDisposition, Buffer, 80);
1508
1511 return FALSE;
1512
1513 case WM_COMMAND:
1514 switch (LOWORD(wParam))
1515 {
1516 case IDOK:
1517 case IDCANCEL:
1518 EndDialog(hwndDlg, IDOK);
1519 break;
1520 }
1521 }
1522 return FALSE;
1523}
static VOID GetInterruptType(USHORT Flags, LPWSTR pBuffer, DWORD dwLength)
Definition: edit.c:1321
#define IDC_REQ_INT_PREFERRED
Definition: resource.h:355
#define IDC_REQ_INT_ALTERNATIVE
Definition: resource.h:354
#define IDC_REQ_INT_TYPE
Definition: resource.h:350
#define IDC_REQ_INT_MIN
Definition: resource.h:351
#define IDC_REQ_INT_SHARE
Definition: resource.h:353
#define IDC_REQ_INT_MAX
Definition: resource.h:352
struct _IO_RESOURCE_DESCRIPTOR::@23::@26 Interrupt

Referenced by ShowRequirement().

◆ show_requirements_memory_dlgproc()

static INT_PTR CALLBACK show_requirements_memory_dlgproc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1439 of file edit.c.

1440{
1441 PIO_RESOURCE_DESCRIPTOR pDescriptor;
1442 WCHAR Buffer[80];
1443
1444 switch(uMsg)
1445 {
1446 case WM_INITDIALOG:
1447 pDescriptor = (PIO_RESOURCE_DESCRIPTOR)lParam;
1448
1449 GetMemoryAccess(pDescriptor->Flags, Buffer, 80);
1451
1452 wsprintf(Buffer, L"0x%lx", pDescriptor->u.Memory.Length);
1454 wsprintf(Buffer, L"0x%lx", pDescriptor->u.Memory.Alignment);
1456#ifdef _M_AMD64
1457 wsprintf(Buffer, L"0x%016I64x", pDescriptor->u.Memory.MinimumAddress.QuadPart);
1458#else
1459 wsprintf(Buffer, L"0x%08lx", pDescriptor->u.Memory.MinimumAddress.u.LowPart);
1460#endif
1462#ifdef _M_AMD64
1463 wsprintf(Buffer, L"0x%016I64x", pDescriptor->u.Memory.MaximumAddress.QuadPart);
1464#else
1465 wsprintf(Buffer, L"0x%08lx", pDescriptor->u.Memory.MaximumAddress.u.LowPart);
1466#endif
1468
1469 GetShareDisposition(pDescriptor->ShareDisposition, Buffer, 80);
1471
1474 return FALSE;
1475
1476 case WM_COMMAND:
1477 switch (LOWORD(wParam))
1478 {
1479 case IDOK:
1480 case IDCANCEL:
1481 EndDialog(hwndDlg, IDOK);
1482 break;
1483 }
1484 }
1485 return FALSE;
1486}
static VOID GetMemoryAccess(USHORT Flags, LPWSTR pBuffer, DWORD dwLength)
Definition: edit.c:1301
#define IDC_REQ_MEMORY_MAX
Definition: resource.h:344
#define IDC_REQ_MEMORY_SHARE
Definition: resource.h:345
#define IDC_REQ_MEMORY_ACCESS
Definition: resource.h:340
#define IDC_REQ_MEMORY_MIN
Definition: resource.h:343
#define IDC_REQ_MEMORY_PREFERRED
Definition: resource.h:347
#define IDC_REQ_MEMORY_ALIGN
Definition: resource.h:342
#define IDC_REQ_MEMORY_ALTERNATIVE
Definition: resource.h:346
#define IDC_REQ_MEMORY_LENGTH
Definition: resource.h:341
struct _IO_RESOURCE_DESCRIPTOR::@23::@25 Memory

Referenced by ShowRequirement().

◆ show_requirements_port_dlgproc()

static INT_PTR CALLBACK show_requirements_port_dlgproc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1390 of file edit.c.

1391{
1392 PIO_RESOURCE_DESCRIPTOR pDescriptor;
1393 WCHAR Buffer[80];
1394
1395 switch(uMsg)
1396 {
1397 case WM_INITDIALOG:
1398 pDescriptor = (PIO_RESOURCE_DESCRIPTOR)lParam;
1399
1400 GetPortType(pDescriptor->Flags, Buffer, 80);
1402
1403 wsprintf(Buffer, L"0x%lx", pDescriptor->u.Port.Length);
1405 wsprintf(Buffer, L"0x%lx", pDescriptor->u.Port.Alignment);
1407#ifdef _M_AMD64
1408 wsprintf(Buffer, L"0x%016I64x", pDescriptor->u.Port.MinimumAddress.QuadPart);
1409#else
1410 wsprintf(Buffer, L"0x%08lx", pDescriptor->u.Port.MinimumAddress.u.LowPart);
1411#endif
1413#ifdef _M_AMD64
1414 wsprintf(Buffer, L"0x%016I64x", pDescriptor->u.Port.MaximumAddress.QuadPart);
1415#else
1416 wsprintf(Buffer, L"0x%08lx", pDescriptor->u.Port.MaximumAddress.u.LowPart);
1417#endif
1419
1420 GetShareDisposition(pDescriptor->ShareDisposition, Buffer, 80);
1422
1425 return FALSE;
1426
1427 case WM_COMMAND:
1428 switch (LOWORD(wParam))
1429 {
1430 case IDOK:
1431 case IDCANCEL:
1432 EndDialog(hwndDlg, IDOK);
1433 break;
1434 }
1435 }
1436 return FALSE;
1437}
static VOID GetPortType(USHORT Flags, LPWSTR pBuffer, DWORD dwLength)
Definition: edit.c:1285
#define IDC_REQ_PORT_TYPE
Definition: resource.h:330
#define IDC_REQ_PORT_LENGTH
Definition: resource.h:331
#define IDC_REQ_PORT_ALIGN
Definition: resource.h:332
#define IDC_REQ_PORT_MAX
Definition: resource.h:334
#define IDC_REQ_PORT_SHARE
Definition: resource.h:335
#define IDC_REQ_PORT_MIN
Definition: resource.h:333
#define IDC_REQ_PORT_PREFERRED
Definition: resource.h:337
#define IDC_REQ_PORT_ALTERNATIVE
Definition: resource.h:336
struct _IO_RESOURCE_DESCRIPTOR::@23::@24 Port

Referenced by ShowRequirement().

◆ ShowRequirement()

static VOID ShowRequirement ( HWND  hwndDlg)
static

Definition at line 1559 of file edit.c.

1560{
1561 PIO_RESOURCE_DESCRIPTOR pDescriptor;
1562 LVITEMW item;
1563
1564 if (requirementsIndex == -1)
1565 return;
1566
1567 item.mask = LVIF_PARAM;
1568 item.iItem = requirementsIndex;
1569 item.iSubItem = 0;
1571
1572 pDescriptor = (PIO_RESOURCE_DESCRIPTOR)item.lParam;
1573 if (pDescriptor)
1574 {
1575 switch (pDescriptor->Type)
1576 {
1577 case CmResourceTypePort:
1579 break;
1582 break;
1585 break;
1586 case CmResourceTypeDma:
1588 break;
1589 default:
1590 break;
1591 }
1592 }
1593}
static INT_PTR CALLBACK show_requirements_port_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: edit.c:1390
static INT_PTR CALLBACK show_requirements_dma_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: edit.c:1525
static INT_PTR CALLBACK show_requirements_memory_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: edit.c:1439
static INT_PTR CALLBACK show_requirements_interrupt_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: edit.c:1488
#define IDD_EDIT_REQUIREMENTS_MEMORY
Definition: resource.h:339
#define IDD_EDIT_REQUIREMENTS_DMA
Definition: resource.h:357
#define IDD_EDIT_REQUIREMENTS_INT
Definition: resource.h:349
#define IDD_EDIT_REQUIREMENTS_PORT
Definition: resource.h:329
if(dx< 0)
Definition: linetemp.h:194
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)

Referenced by modify_requirements_list_dlgproc(), and OnRequirementsListNotify().

◆ warning()

void warning ( HWND  hwnd,
INT  resId,
  ... 
)

Definition at line 187 of file edit.c.

188{
189 va_list ap;
190 WCHAR title[256];
191 WCHAR errfmt[1024];
192 WCHAR errstr[1024];
194
196
198 StringCbCopyW(title, sizeof(title), L"Warning");
199
200 if (!LoadStringW(hInstance, resId, errfmt, ARRAY_SIZE(errfmt)))
201 StringCbCopyW(errfmt, sizeof(errfmt), L"Unknown error string!");
202
203 va_start(ap, resId);
204 StringCbVPrintfW(errstr, sizeof(errstr), errfmt, ap);
205 va_end(ap);
206
208}
#define IDS_WARNING
Definition: resource.h:123
STRSAFEAPI StringCbVPrintfW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszFormat, va_list argList)
Definition: strsafe.h:507
#define MB_ICONSTOP
Definition: winuser.h:803

Variable Documentation

◆ binValueData

PVOID binValueData
static

Definition at line 147 of file edit.c.

Referenced by modify_binary_dlgproc(), and ModifyValue().

◆ dwordEditMode

EDIT_MODE dwordEditMode = EDIT_MODE_HEX
static

Definition at line 154 of file edit.c.

Referenced by DwordEditSubclassProc(), and modify_dword_dlgproc().

◆ dwordValueData

DWORD dwordValueData
static

Definition at line 148 of file edit.c.

Referenced by modify_dword_dlgproc(), and ModifyValue().

◆ editValueName

◆ fullResourceIndex

INT fullResourceIndex = -1
static

◆ requirementsIndex

INT requirementsIndex = -1
static

◆ requirementsValueData

PIO_RESOURCE_REQUIREMENTS_LIST requirementsValueData
static

Definition at line 152 of file edit.c.

Referenced by AddRequirementsToList(), and ModifyValue().

◆ resourceValueData

PCM_RESOURCE_LIST resourceValueData
static

Definition at line 149 of file edit.c.

Referenced by AddFullResourcesToList(), ModifyValue(), and ParseResources().

◆ stringValueData

WCHAR* stringValueData
static

Definition at line 146 of file edit.c.

Referenced by modify_multi_string_dlgproc(), modify_string_dlgproc(), and ModifyValue().

◆ valueDataLen

DWORD valueDataLen
static

Definition at line 151 of file edit.c.

Referenced by modify_binary_dlgproc(), and ModifyValue().