ReactOS 0.4.16-dev-125-g798ea90
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.

Macros

#define NTOS_MODE_USER
 

Typedefs

typedef enum _EDIT_MODE EDIT_MODE
 

Enumerations

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

◆ NTOS_MODE_USER

#define NTOS_MODE_USER

Definition at line 10 of file edit.c.

Typedef Documentation

◆ EDIT_MODE

Enumeration Type Documentation

◆ _EDIT_MODE

Enumerator
EDIT_MODE_DEC 
EDIT_MODE_HEX 

Definition at line 13 of file edit.c.

14{
17} EDIT_MODE;
@ EDIT_MODE_HEX
Definition: edit.c:16
@ EDIT_MODE_DEC
Definition: edit.c:15
enum _EDIT_MODE EDIT_MODE

Function Documentation

◆ AddFullResourcesToList()

static VOID AddFullResourcesToList ( HWND  hwnd)
static

Definition at line 958 of file edit.c.

959{
960 PCM_FULL_RESOURCE_DESCRIPTOR pFullDescriptor;
961 WCHAR buffer[80];
963 ULONG i;
964 INT iItem;
965
966 pFullDescriptor = &resourceValueData->List[0];
967 for (i = 0; i < resourceValueData->Count; i++)
968 {
969 wsprintf(buffer, L"%lu", pFullDescriptor->BusNumber);
970
971 item.mask = LVIF_TEXT;
972 item.iItem = i;
973 item.iSubItem = 0;
974 item.state = 0;
975 item.stateMask = 0;
976 item.pszText = buffer;
977 item.cchTextMax = (int)wcslen(item.pszText);
978
979 iItem = ListView_InsertItem(hwnd, &item);
980 if (iItem != -1)
981 {
982 GetInterfaceType(pFullDescriptor->InterfaceType, buffer, 80);
983 ListView_SetItemText(hwnd, iItem, 1, buffer);
984 }
985 pFullDescriptor = (PVOID)(pFullDescriptor->PartialResourceList.PartialDescriptors +
986 pFullDescriptor->PartialResourceList.Count);
987 }
988}
static PCM_RESOURCE_LIST resourceValueData
Definition: edit.c:24
static VOID GetInterfaceType(INTERFACE_TYPE InterfaceType, LPWSTR pBuffer, DWORD dwLength)
Definition: edit.c:561
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:2413
#define ListView_SetItemText(hwndLV, i, iSubItem_, pszText_)
Definition: commctrl.h:2696
#define LVIF_TEXT
Definition: commctrl.h:2314
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:5877
__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 1203 of file edit.c.

1204{
1205 PIO_RESOURCE_LIST pResourceList;
1206 PIO_RESOURCE_DESCRIPTOR pDescriptor;
1207 WCHAR buffer[80];
1208 LVITEMW item;
1209 ULONG i, j, index;
1210 INT iItem;
1211
1212 index = 0;
1213 pResourceList = &requirementsValueData->List[0];
1214 for (i = 0; i < requirementsValueData->AlternativeLists; i++)
1215 {
1216 for (j = 0; j < pResourceList->Count; j++)
1217 {
1218 pDescriptor = &pResourceList->Descriptors[j];
1219
1220 wsprintf(buffer, L"%lu", i + 1);
1221
1222 item.mask = LVIF_TEXT | LVIF_PARAM;
1223 item.iItem = index;
1224 item.iSubItem = 0;
1225 item.state = 0;
1226 item.stateMask = 0;
1227 item.pszText = buffer;
1228 item.cchTextMax = (int)wcslen(item.pszText);
1229 item.lParam = (LPARAM)pDescriptor;
1230
1231 iItem = ListView_InsertItem(hwnd, &item);
1232 if (iItem != -1)
1233 {
1234 wsprintf(buffer, L"%lu", j + 1);
1235 ListView_SetItemText(hwnd, iItem, 1, buffer);
1236 wsprintf(buffer, L"%lu", 1);
1237 ListView_SetItemText(hwnd, iItem, 2, buffer);
1238
1239 GetResourceType(pDescriptor->Type, buffer, 80);
1240 ListView_SetItemText(hwnd, iItem, 3, buffer);
1241 }
1242
1243 index++;
1244 }
1245
1246
1247 pResourceList = (PIO_RESOURCE_LIST)(pResourceList->Descriptors + pResourceList->Count);
1248 }
1249
1254}
#define index(s, c)
Definition: various.h:29
static VOID GetResourceType(UCHAR ResourceType, LPWSTR pBuffer, DWORD dwLength)
Definition: edit.c:1096
static PIO_RESOURCE_REQUIREMENTS_LIST requirementsValueData
Definition: edit.c:27
#define IDC_REQINTERFACETYPE
Definition: resource.h:276
#define IDC_REQBUSNUMBER
Definition: resource.h:277
#define IDC_REQSLOTNUMBER
Definition: resource.h:278
#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:2316
IO_RESOURCE_DESCRIPTOR Descriptors[1]
Definition: iotypes.h:2737
INTERFACE_TYPE InterfaceType
Definition: iotypes.h:2742
IO_RESOURCE_LIST List[1]
Definition: iotypes.h:2747
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)
struct _IO_RESOURCE_LIST * PIO_RESOURCE_LIST

Referenced by modify_requirements_list_dlgproc().

◆ CopyKey()

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

Definition at line 1847 of file edit.c.

1848{
1849 LONG lResult;
1850 DWORD dwDisposition;
1851 HKEY hDestSubKey = NULL;
1852 HKEY hSrcSubKey = NULL;
1853 DWORD dwIndex, dwType, cbName, cbData;
1854 WCHAR szSubKey[256];
1855 WCHAR szValueName[256];
1856 BYTE szValueData[512];
1857
1858 FILETIME ft;
1859
1860 /* open the source subkey, if specified */
1861 if (lpSrcSubKey)
1862 {
1863 lResult = RegOpenKeyExW(hSrcKey, lpSrcSubKey, 0, KEY_ALL_ACCESS, &hSrcSubKey);
1864 if (lResult)
1865 goto done;
1866 hSrcKey = hSrcSubKey;
1867 }
1868
1869 /* create the destination subkey */
1870 lResult = RegCreateKeyExW(hDestKey, lpDestSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL,
1871 &hDestSubKey, &dwDisposition);
1872 if (lResult)
1873 goto done;
1874
1875 /* copy all subkeys */
1876 dwIndex = 0;
1877 do
1878 {
1879 cbName = ARRAY_SIZE(szSubKey);
1880 lResult = RegEnumKeyExW(hSrcKey, dwIndex++, szSubKey, &cbName, NULL, NULL, NULL, &ft);
1881 if (lResult == ERROR_SUCCESS)
1882 {
1883 lResult = CopyKey(hDestSubKey, szSubKey, hSrcKey, szSubKey);
1884 if (lResult)
1885 goto done;
1886 }
1887 }
1888 while(lResult == ERROR_SUCCESS);
1889
1890 /* copy all subvalues */
1891 dwIndex = 0;
1892 do
1893 {
1894 cbName = ARRAY_SIZE(szValueName);
1895 cbData = ARRAY_SIZE(szValueData);
1896 lResult = RegEnumValueW(hSrcKey, dwIndex++, szValueName, &cbName, NULL, &dwType, szValueData, &cbData);
1897 if (lResult == ERROR_SUCCESS)
1898 {
1899 lResult = RegSetValueExW(hDestSubKey, szValueName, 0, dwType, szValueData, cbData);
1900 if (lResult)
1901 goto done;
1902 }
1903 }
1904 while(lResult == ERROR_SUCCESS);
1905
1906 lResult = ERROR_SUCCESS;
1907
1908done:
1909 if (hSrcSubKey)
1910 RegCloseKey(hSrcSubKey);
1911 if (hDestSubKey)
1912 RegCloseKey(hDestSubKey);
1913 if (lResult != ERROR_SUCCESS)
1914 SHDeleteKey(hDestKey, lpDestSubKey);
1915 return lResult;
1916}
static LONG CopyKey(HKEY hDestKey, LPCWSTR lpDestSubKey, HKEY hSrcKey, LPCWSTR lpSrcSubKey)
Definition: edit.c:1847
#define ARRAY_SIZE(A)
Definition: main.h:20
#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 1052 of file edit.c.

1053{
1054 WCHAR szText[80];
1055 RECT rc;
1056 LVCOLUMN lvC;
1057
1059
1060 GetClientRect(hWndListView, &rc);
1061
1062 /* Create columns. */
1063 lvC.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
1064 lvC.pszText = szText;
1065 lvC.fmt = LVCFMT_LEFT;
1066
1067 /* Load the column labels from the resource file. */
1068 lvC.iSubItem = 0;
1069 lvC.cx = (rc.right - rc.left) / 4;
1071 if (ListView_InsertColumn(hWndListView, 0, &lvC) == -1)
1072 return FALSE;
1073
1074 lvC.iSubItem = 1;
1075 lvC.cx = (rc.right - rc.left) / 4;
1077 if (ListView_InsertColumn(hWndListView, 1, &lvC) == -1)
1078 return FALSE;
1079
1080 lvC.iSubItem = 2;
1081 lvC.cx = (rc.right - rc.left) / 4;
1082 LoadStringW(hInst, IDS_REQDESCRIPTOR, szText, ARRAY_SIZE(szText));
1083 if (ListView_InsertColumn(hWndListView, 2, &lvC) == -1)
1084 return FALSE;
1085
1086 lvC.iSubItem = 3;
1087 lvC.cx = (rc.right - rc.left) - (3 * ((rc.right - rc.left) / 4));
1088 LoadStringW(hInst, IDS_REQDEVICETYPE, szText, ARRAY_SIZE(szText));
1089 if (ListView_InsertColumn(hWndListView, 3, &lvC) == -1)
1090 return FALSE;
1091
1092 return TRUE;
1093}
#define IDS_REQDESCRIPTOR
Definition: resource.h:215
#define IDS_REQRESOURCELIST
Definition: resource.h:214
#define IDS_REQALTERNATIVELIST
Definition: resource.h:213
#define IDS_REQDEVICETYPE
Definition: resource.h:216
HINSTANCE hInst
Definition: dxdiag.c:13
#define ListView_InsertColumn(hwnd, iCol, pcol)
Definition: commctrl.h:2641
#define LVCF_WIDTH
Definition: commctrl.h:2592
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2739
#define ListView_SetExtendedListViewStyle(hwndLV, dw)
Definition: commctrl.h:2730
#define LVCF_FMT
Definition: commctrl.h:2591
#define LVCF_SUBITEM
Definition: commctrl.h:2594
#define LVCFMT_LEFT
Definition: commctrl.h:2603
#define LVCF_TEXT
Definition: commctrl.h:2593
#define LVCOLUMN
Definition: commctrl.h:2586
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 423 of file edit.c.

424{
425 WCHAR szText[80];
426 RECT rc;
427 LVCOLUMN lvC;
428 HWND hwndLV;
429 INT width;
430
431 /* Create columns. */
432 lvC.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
433 lvC.pszText = szText;
434 lvC.fmt = LVCFMT_LEFT;
435
436 hwndLV = GetDlgItem(hwnd, IDC_DMA_LIST);
438 GetClientRect(hwndLV, &rc);
439
440 /* Load the column labels from the resource file. */
441 lvC.iSubItem = 0;
442 lvC.cx = (rc.right - rc.left) / 2;
443 LoadStringW(hInst, IDS_DMA_CHANNEL, szText, ARRAY_SIZE(szText));
444 if (ListView_InsertColumn(hwndLV, 0, &lvC) == -1)
445 return FALSE;
446
447 lvC.iSubItem = 1;
448 lvC.cx = (rc.right - rc.left) - lvC.cx;
449 LoadStringW(hInst, IDS_DMA_PORT, szText, ARRAY_SIZE(szText));
450 if (ListView_InsertColumn(hwndLV, 1, &lvC) == -1)
451 return FALSE;
452
453
454 /* Interrupt list */
455 hwndLV = GetDlgItem(hwnd, IDC_IRQ_LIST);
457 GetClientRect(hwndLV, &rc);
458 width = (rc.right - rc.left) / 4;
459
460 /* Load the column labels from the resource file. */
461 lvC.iSubItem = 0;
462 lvC.cx = width;
464 if (ListView_InsertColumn(hwndLV, 0, &lvC) == -1)
465 return FALSE;
466
467 lvC.iSubItem = 1;
469 if (ListView_InsertColumn(hwndLV, 1, &lvC) == -1)
470 return FALSE;
471
472 lvC.iSubItem = 2;
474 if (ListView_InsertColumn(hwndLV, 2, &lvC) == -1)
475 return FALSE;
476
477 lvC.iSubItem = 3;
478 lvC.cx = (rc.right - rc.left) - 3 * width;
480 if (ListView_InsertColumn(hwndLV, 3, &lvC) == -1)
481 return FALSE;
482
483
484 /* Memory list */
487 GetClientRect(hwndLV, &rc);
488 width = (rc.right - rc.left) / 3;
489
490 /* Load the column labels from the resource file. */
491 lvC.iSubItem = 0;
492 lvC.cx = width;
494 if (ListView_InsertColumn(hwndLV, 0, &lvC) == -1)
495 return FALSE;
496
497 lvC.iSubItem = 1;
499 if (ListView_InsertColumn(hwndLV, 1, &lvC) == -1)
500 return FALSE;
501
502 lvC.iSubItem = 2;
503 lvC.cx = (rc.right - rc.left) - 2 * width;
505 if (ListView_InsertColumn(hwndLV, 2, &lvC) == -1)
506 return FALSE;
507
508
509 /* Port list */
510 hwndLV = GetDlgItem(hwnd, IDC_PORT_LIST);
512 GetClientRect(hwndLV, &rc);
513 width = (rc.right - rc.left) / 3;
514
515 /* Load the column labels from the resource file. */
516 lvC.iSubItem = 0;
517 lvC.cx = width;
518 LoadStringW(hInst, IDS_PORT_ADDRESS, szText, ARRAY_SIZE(szText));
519 if (ListView_InsertColumn(hwndLV, 0, &lvC) == -1)
520 return FALSE;
521
522 lvC.iSubItem = 1;
523 LoadStringW(hInst, IDS_PORT_LENGTH, szText, ARRAY_SIZE(szText));
524 if (ListView_InsertColumn(hwndLV, 1, &lvC) == -1)
525 return FALSE;
526
527 lvC.iSubItem = 2;
528 lvC.cx = (rc.right - rc.left) - 2 * width;
529 LoadStringW(hInst, IDS_PORT_ACCESS, szText, ARRAY_SIZE(szText));
530 if (ListView_InsertColumn(hwndLV, 2, &lvC) == -1)
531 return FALSE;
532
533 /* Device specific list */
536 GetClientRect(hwndLV, &rc);
537 width = (rc.right - rc.left) / 3;
538
539 /* Load the column labels from the resource file. */
540 lvC.iSubItem = 0;
541 lvC.cx = width;
543 if (ListView_InsertColumn(hwndLV, 0, &lvC) == -1)
544 return FALSE;
545
546 lvC.iSubItem = 1;
548 if (ListView_InsertColumn(hwndLV, 1, &lvC) == -1)
549 return FALSE;
550
551 lvC.iSubItem = 2;
552 lvC.cx = (rc.right - rc.left) - 2 * width;
554 if (ListView_InsertColumn(hwndLV, 2, &lvC) == -1)
555 return FALSE;
556
557 return TRUE;
558}
#define IDS_INTERRUPT_TYPE
Definition: resource.h:164
#define IDS_INTERRUPT_VECTOR
Definition: resource.h:161
#define IDS_SPECIFIC_RESERVED2
Definition: resource.h:172
#define IDS_PORT_LENGTH
Definition: resource.h:169
#define IDS_MEMORY_LENGTH
Definition: resource.h:166
#define IDS_DMA_PORT
Definition: resource.h:160
#define IDS_MEMORY_ADDRESS
Definition: resource.h:165
#define IDS_PORT_ACCESS
Definition: resource.h:170
#define IDS_MEMORY_ACCESS
Definition: resource.h:167
#define IDS_SPECIFIC_RESERVED1
Definition: resource.h:171
#define IDC_PORT_LIST
Definition: resource.h:262
#define IDC_IRQ_LIST
Definition: resource.h:260
#define IDC_DEVICE_LIST
Definition: resource.h:263
#define IDS_PORT_ADDRESS
Definition: resource.h:168
#define IDS_INTERRUPT_AFFINITY
Definition: resource.h:163
#define IDC_DMA_LIST
Definition: resource.h:259
#define IDS_INTERRUPT_LEVEL
Definition: resource.h:162
#define IDS_SPECIFIC_DATASIZE
Definition: resource.h:173
#define IDC_MEMORY_LIST
Definition: resource.h:261
#define IDS_DMA_CHANNEL
Definition: resource.h:159
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 927 of file edit.c.

928{
929 WCHAR szText[80];
930 RECT rc;
931 LVCOLUMN lvC;
932
934
935 GetClientRect(hWndListView, &rc);
936
937 /* Create columns. */
938 lvC.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
939 lvC.pszText = szText;
940 lvC.fmt = LVCFMT_LEFT;
941
942 /* Load the column labels from the resource file. */
943 lvC.iSubItem = 0;
944 lvC.cx = (rc.right - rc.left) / 2;
945 LoadStringW(hInst, IDS_BUSNUMBER, szText, ARRAY_SIZE(szText));
946 if (ListView_InsertColumn(hWndListView, 0, &lvC) == -1)
947 return FALSE;
948
949 lvC.iSubItem = 1;
950 lvC.cx = (rc.right - rc.left) - lvC.cx;
951 LoadStringW(hInst, IDS_INTERFACE, szText, ARRAY_SIZE(szText));
952 if (ListView_InsertColumn(hWndListView, 1, &lvC) == -1)
953 return FALSE;
954
955 return TRUE;
956}
#define IDS_BUSNUMBER
Definition: resource.h:156
#define IDS_INTERFACE
Definition: resource.h:157

Referenced by modify_resource_list_dlgproc().

◆ DeleteKey()

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

Definition at line 1938 of file edit.c.

1939{
1940 WCHAR msg[128], caption[128];
1941 BOOL result = FALSE;
1942 LONG lRet;
1943 HKEY hKey;
1944
1945 lRet = RegOpenKeyExW(hKeyRoot, keyPath, 0, KEY_READ|KEY_SET_VALUE, &hKey);
1946 if (lRet != ERROR_SUCCESS)
1947 {
1949 return FALSE;
1950 }
1951
1954
1956 goto done;
1957
1958 lRet = SHDeleteKey(hKeyRoot, keyPath);
1959 if (lRet != ERROR_SUCCESS)
1960 {
1961 error(hwnd, IDS_BAD_KEY, keyPath);
1962 goto done;
1963 }
1964 result = TRUE;
1965
1966done:
1968 return result;
1969}
#define msg(x)
Definition: auth_time.c:54
ChildWnd * g_pChildWnd
Definition: childwnd.c:13
static void error_code_messagebox(HWND hwnd, DWORD error_code)
Definition: edit.c:54
#define IDS_QUERY_DELETE_KEY_ONE
Definition: resource.h:106
#define IDS_BAD_KEY
Definition: resource.h:95
#define IDS_QUERY_DELETE_KEY_CONFIRM
Definition: resource.h:108
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:49
#define MB_YESNO
Definition: winuser.h:820
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define MB_ICONQUESTION
Definition: winuser.h:792
#define IDYES
Definition: winuser.h:838

Referenced by _CmdWndProc(), and DECLARE_INTERFACE_().

◆ DwordEditSubclassProc()

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

Definition at line 220 of file edit.c.

221{
222 WNDPROC oldwndproc;
223
225
226 switch (uMsg)
227 {
228 case WM_CHAR:
230 {
231 if (isdigit((int)wParam & 0xff) || iscntrl((int)wParam & 0xff))
232 {
233 break;
234 }
235 else
236 {
237 return 0;
238 }
239 }
240 else if (dwordEditMode == EDIT_MODE_HEX)
241 {
242 if (isxdigit((int)wParam & 0xff) || iscntrl((int)wParam & 0xff))
243 {
244 break;
245 }
246 else
247 {
248 return 0;
249 }
250 }
251 else
252 {
253 break;
254 }
255 }
256
257 return CallWindowProcW(oldwndproc, hwnd, uMsg, wParam, lParam);
258}
#define isdigit(c)
Definition: acclib.h:68
#define isxdigit(c)
Definition: acclib.h:70
static EDIT_MODE dwordEditMode
Definition: edit.c:29
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:1720
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2909
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 31 of file edit.c.

32{
33 va_list ap;
34 WCHAR title[256];
35 WCHAR errfmt[1024];
36 WCHAR errstr[1024];
38
40
42 StringCbCopyW(title, sizeof(title), L"Error");
43
44 if (!LoadStringW(hInstance, resId, errfmt, ARRAY_SIZE(errfmt)))
45 StringCbCopyW(errfmt, sizeof(errfmt), L"Unknown error string!");
46
47 va_start(ap, resId);
49 va_end(ap);
50
52}
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:790
#define MB_OK
Definition: winuser.h:793

◆ error_code_messagebox()

static void error_code_messagebox ( HWND  hwnd,
DWORD  error_code 
)
static

Definition at line 54 of file edit.c.

55{
56 WCHAR title[256];
58 StringCbCopyW(title, sizeof(title), L"Error");
60}
int ErrorMessageBox(HWND hWnd, LPCWSTR lpTitle, DWORD dwErrorCode,...)
Definition: error.c:11
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 561 of file edit.c.

564{
565// LPWSTR lpInterfaceType;
566
567 switch (InterfaceType)
568 {
571// lpInterfaceType = L"Undefined";
572 break;
573 case Internal:
575// lpInterfaceType = L"Internal";
576 break;
577 case Isa:
579// lpInterfaceType = L"Isa";
580 break;
581 case Eisa:
583// lpInterfaceType = L"Eisa";
584 break;
585 case MicroChannel:
587// lpInterfaceType = L"MicroChannel";
588 break;
589 case TurboChannel:
591// lpInterfaceType = L"TurboChannel";
592 break;
593 case PCIBus:
595// lpInterfaceType = L"PCIBus";
596 break;
597 case VMEBus:
599// lpInterfaceType = L"VMEBus";
600 break;
601 case NuBus:
603// lpInterfaceType = L"NuBus";
604 break;
605 case PCMCIABus:
607// lpInterfaceType = L"PCMCIABus";
608 break;
609 case CBus:
611// lpInterfaceType = L"CBus";
612 break;
613 case MPIBus:
615// lpInterfaceType = L"MPIBus";
616 break;
617 case MPSABus:
619// lpInterfaceType = L"MPSABus";
620 break;
623// lpInterfaceType = L"ProcessorInternal";
624 break;
625 case InternalPowerBus:
627// lpInterfaceType = L"InternalPowerBus";
628 break;
629 case PNPISABus:
631// lpInterfaceType = L"PNPISABus";
632 break;
633 case PNPBus:
635// lpInterfaceType = L"PNPBus";
636 break;
637 default:
639// lpInterfaceType = L"Unknown interface type";
640 break;
641 }
642
643// wcscpy(pBuffer, lpInterfaceType);
644}
#define IDS_BUS_PCMCIABUS
Definition: resource.h:192
#define IDS_BUS_UNDEFINED
Definition: resource.h:183
#define IDS_BUS_NUBUS
Definition: resource.h:191
#define IDS_BUS_PNPISABUS
Definition: resource.h:198
#define IDS_BUS_TURBOCHANNEL
Definition: resource.h:188
#define IDS_BUS_MICROCHANNEL
Definition: resource.h:187
#define IDS_BUS_EISA
Definition: resource.h:186
#define IDS_BUS_PROCESSORINTERNAL
Definition: resource.h:196
#define IDS_BUS_CBUS
Definition: resource.h:193
#define IDS_BUS_MPSABUS
Definition: resource.h:195
#define IDS_BUS_INTERNALPOWERBUS
Definition: resource.h:197
#define IDS_BUS_PCIBUS
Definition: resource.h:189
#define IDS_BUS_MPIBUS
Definition: resource.h:194
#define IDS_BUS_PNPBUS
Definition: resource.h:199
#define IDS_BUS_INTERNAL
Definition: resource.h:184
#define IDS_BUS_VMEBUS
Definition: resource.h:190
#define IDS_BUS_UNKNOWNTYPE
Definition: resource.h:200
#define IDS_BUS_ISA
Definition: resource.h:185
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 1187 of file edit.c.

1191{
1193 {
1195 }
1196 else
1197 {
1199 }
1200}
#define IDS_INTERRUPT_EDGE_SENSITIVE
Definition: resource.h:177
#define IDS_INTERRUPT_LEVEL_SENSITIVE
Definition: resource.h:178
#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 2072 of file edit.c.

2073{
2074 LPCWSTR pszRootKey;
2075
2076 if (hRootKey == HKEY_CLASSES_ROOT)
2077 pszRootKey = L"HKEY_CLASSES_ROOT";
2078 else if (hRootKey == HKEY_CURRENT_USER)
2079 pszRootKey = L"HKEY_CURRENT_USER";
2080 else if (hRootKey == HKEY_LOCAL_MACHINE)
2081 pszRootKey = L"HKEY_LOCAL_MACHINE";
2082 else if (hRootKey == HKEY_USERS)
2083 pszRootKey = L"HKEY_USERS";
2084 else if (hRootKey == HKEY_CURRENT_CONFIG)
2085 pszRootKey = L"HKEY_CURRENT_CONFIG";
2086 else if (hRootKey == HKEY_DYN_DATA)
2087 pszRootKey = L"HKEY_DYN_DATA";
2088 else
2089 return FALSE;
2090
2091 if (lpSubKey[0])
2092 _snwprintf(pszDest, iDestLength, L"%s\\%s", pszRootKey, lpSubKey);
2093 else
2094 _snwprintf(pszDest, iDestLength, L"%s", pszRootKey);
2095 return TRUE;
2096}
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 1167 of file edit.c.

1171{
1173 {
1175 }
1177 {
1179 }
1181 {
1183 }
1184}
#define IDS_MEMORY_READ_WRITE
Definition: resource.h:181
#define IDS_MEMORY_READ_ONLY
Definition: resource.h:179
#define IDS_MEMORY_WRITE_ONLY
Definition: resource.h:180
#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 1151 of file edit.c.

1155{
1157 {
1159 }
1161 {
1163 }
1164}
#define IDS_PORT_PORT_IO
Definition: resource.h:175
#define IDS_PORT_MEMORY_IO
Definition: resource.h:176
#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 1096 of file edit.c.

1099{
1100 switch (ResourceType)
1101 {
1102 case CmResourceTypePort:
1104 break;
1105
1108 break;
1109
1112 break;
1113
1114 case CmResourceTypeDma:
1116 break;
1117
1118 default:
1119 wsprintf(pBuffer, L"Unknown %u", ResourceType);
1120 break;
1121 }
1122}
#define IDS_TYPE_DMA
Definition: resource.h:221
#define IDS_TYPE_PORT
Definition: resource.h:218
#define IDS_TYPE_MEMORY
Definition: resource.h:220
#define IDS_TYPE_INTERRUPT
Definition: resource.h:219
#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 1125 of file edit.c.

1129{
1130 switch (ShareDisposition)
1131 {
1134 break;
1135
1138 break;
1139
1142 break;
1143
1146 break;
1147 }
1148}
#define IDS_SHARE_UNDETERMINED
Definition: resource.h:225
#define IDS_SHARE_DRIVER_EXCLUSIVE
Definition: resource.h:223
#define IDS_SHARE_DEVICE_EXCLUSIVE
Definition: resource.h:222
#define IDS_SHARE_SHARED
Definition: resource.h:224
@ 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 373 of file edit.c.

374{
375 HWND hwndValue;
376 UINT len;
377
379
380 switch(uMsg)
381 {
382 case WM_INITDIALOG:
384 {
386 }
387 else
388 {
389 WCHAR buffer[255];
392 }
393 hwndValue = GetDlgItem(hwndDlg, IDC_VALUE_DATA);
395 /* reset the hex edit control's font */
396 SendMessageW(hwndValue, WM_SETFONT, 0, 0);
397 SetFocus(hwndValue);
398 return FALSE;
399 case WM_COMMAND:
400 switch (LOWORD(wParam))
401 {
402 case IDOK:
403 if ((hwndValue = GetDlgItem(hwndDlg, IDC_VALUE_DATA)))
404 {
405 len = (UINT)HexEdit_GetBufferSize(hwndValue);
406 if (len > 0 && binValueData)
408 else
412 }
413 EndDialog(hwndDlg, IDOK);
414 break;
415 case IDCANCEL:
416 EndDialog(hwndDlg, IDCANCEL);
417 return TRUE;
418 }
419 }
420 return FALSE;
421}
static DWORD valueDataLen
Definition: edit.c:26
static const WCHAR * editValueName
Definition: edit.c:20
static PVOID binValueData
Definition: edit.c:22
#define IDC_VALUE_DATA
Definition: resource.h:229
#define IDC_VALUE_NAME
Definition: resource.h:228
#define IDS_DEFAULT_VALUE_NAME
Definition: resource.h:79
#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:834
#define WM_COMMAND
Definition: winuser.h:1743
#define WM_INITDIALOG
Definition: winuser.h:1742
#define IDOK
Definition: winuser.h:833
HWND WINAPI SetFocus(_In_opt_ HWND)
#define WM_SETFONT
Definition: winuser.h:1653
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 260 of file edit.c.

261{
262 WNDPROC oldproc;
263 HWND hwndValue;
264 WCHAR ValueString[32];
266 DWORD Base;
267 DWORD Value = 0;
268
270
271 switch(uMsg)
272 {
273 case WM_INITDIALOG:
275
276 /* subclass the edit control */
277 hwndValue = GetDlgItem(hwndDlg, IDC_VALUE_DATA);
278 oldproc = (WNDPROC)GetWindowLongPtr(hwndValue, GWLP_WNDPROC);
279 SetWindowLongPtr(hwndValue, GWLP_USERDATA, (DWORD_PTR)oldproc);
281
283 {
285 }
286 else
287 {
288 WCHAR buffer[255];
291 }
293 StringCbPrintfW(ValueString, sizeof(ValueString), L"%lx", dwordValueData);
294 SetDlgItemTextW(hwndDlg, IDC_VALUE_DATA, ValueString);
297 return FALSE;
298
299 case WM_COMMAND:
300 switch (LOWORD(wParam))
301 {
302 case IDC_FORMAT_HEX:
304 {
306 if ((hwndValue = GetDlgItem(hwndDlg, IDC_VALUE_DATA)))
307 {
308 if (GetWindowTextLength(hwndValue))
309 {
310 if (GetWindowTextW(hwndValue, ValueString, 32))
311 {
312 Value = wcstoul (ValueString, &Remainder, 10);
313 }
314 }
315 }
316 StringCbPrintfW(ValueString, sizeof(ValueString), L"%lx", Value);
317 SetDlgItemTextW(hwndDlg, IDC_VALUE_DATA, ValueString);
318 return TRUE;
319 }
320 break;
321
322 case IDC_FORMAT_DEC:
324 {
326 if ((hwndValue = GetDlgItem(hwndDlg, IDC_VALUE_DATA)))
327 {
328 if (GetWindowTextLength(hwndValue))
329 {
330 if (GetWindowTextW(hwndValue, ValueString, 32))
331 {
332 Value = wcstoul (ValueString, &Remainder, 16);
333 }
334 }
335 }
336 StringCbPrintfW(ValueString, sizeof(ValueString), L"%lu", Value);
337 SetDlgItemTextW(hwndDlg, IDC_VALUE_DATA, ValueString);
338 return TRUE;
339 }
340 break;
341
342 case IDOK:
343 if ((hwndValue = GetDlgItem(hwndDlg, IDC_VALUE_DATA)))
344 {
345 if (GetWindowTextLength(hwndValue))
346 {
347 if (!GetWindowTextW(hwndValue, ValueString, 32))
348 {
349 EndDialog(hwndDlg, IDCANCEL);
350 return TRUE;
351 }
352
353 Base = (dwordEditMode == EDIT_MODE_HEX) ? 16 : 10;
354 dwordValueData = wcstoul (ValueString, &Remainder, Base);
355 }
356 else
357 {
358 EndDialog(hwndDlg, IDCANCEL);
359 return TRUE;
360 }
361 }
362 EndDialog(hwndDlg, IDOK);
363 return TRUE;
364
365 case IDCANCEL:
366 EndDialog(hwndDlg, IDCANCEL);
367 return TRUE;
368 }
369 }
370 return FALSE;
371}
static DWORD dwordValueData
Definition: edit.c:23
LRESULT CALLBACK DwordEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: edit.c:220
#define IDC_FORMAT_DEC
Definition: resource.h:233
#define IDC_FORMAT_HEX
Definition: resource.h:232
_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:2451
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:1384
#define GetWindowTextLength
Definition: winuser.h:5811
#define SendMessage
Definition: winuser.h:5855
#define EM_SETSEL
Definition: winuser.h:2021
BOOL WINAPI CheckRadioButton(_In_ HWND, _In_ int, _In_ int, _In_ int)
#define BN_CLICKED
Definition: winuser.h:1928
_In_ LARGE_INTEGER _Out_opt_ PLARGE_INTEGER Remainder
Definition: rtlfuncs.h:3059
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 153 of file edit.c.

154{
155 WCHAR* valueData;
156 HWND hwndValue;
157 int len;
158
160
161 switch(uMsg)
162 {
163 case WM_INITDIALOG:
165 {
167 }
168 else
169 {
170 WCHAR buffer[255];
173 }
176 return FALSE;
177 case WM_COMMAND:
178 switch (LOWORD(wParam))
179 {
180 case IDOK:
181 if ((hwndValue = GetDlgItem(hwndDlg, IDC_VALUE_DATA)))
182 {
183 if ((len = GetWindowTextLength(hwndValue)))
184 {
185 if (stringValueData)
186 {
187 if ((valueData = HeapReAlloc(GetProcessHeap(), 0, stringValueData, (len + 1) * sizeof(WCHAR))))
188 {
189 stringValueData = valueData;
190 if (!GetWindowTextW(hwndValue, stringValueData, len + 1))
191 *stringValueData = 0;
192 }
193 }
194 else
195 {
196 if ((valueData = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR))))
197 {
198 stringValueData = valueData;
199 if (!GetWindowTextW(hwndValue, stringValueData, len + 1))
200 *stringValueData = 0;
201 }
202 }
203 }
204 else
205 {
206 if (stringValueData)
207 *stringValueData = 0;
208 }
209 }
210 EndDialog(hwndDlg, IDOK);
211 break;
212 case IDCANCEL:
213 EndDialog(hwndDlg, IDCANCEL);
214 return TRUE;
215 }
216 }
217 return FALSE;
218}
static WCHAR * stringValueData
Definition: edit.c:21

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 1490 of file edit.c.

1491{
1493
1494 switch(uMsg)
1495 {
1496 case WM_INITDIALOG:
1499 return FALSE;
1500
1501 case WM_NOTIFY:
1502 return OnRequirementsListNotify(hwndDlg, (NMHDR *)lParam);
1503
1504 case WM_COMMAND:
1505 switch (LOWORD(wParam))
1506 {
1508 if (requirementsIndex != -1)
1509 ShowRequirement(hwndDlg);
1510 break;
1511 case IDOK:
1512 EndDialog(hwndDlg, IDOK);
1513 break;
1514 case IDCANCEL:
1515 EndDialog(hwndDlg, IDCANCEL);
1516 return TRUE;
1517 }
1518 }
1519 return FALSE;
1520}
static BOOL OnRequirementsListNotify(HWND hwndDlg, NMHDR *phdr)
Definition: edit.c:1462
static VOID ShowRequirement(HWND hwndDlg)
Definition: edit.c:1425
static VOID AddRequirementsToList(HWND hwndDlg, HWND hwnd)
Definition: edit.c:1203
static BOOL CreateRequirementsListColumns(HWND hWndListView)
Definition: edit.c:1052
static INT requirementsIndex
Definition: edit.c:28
#define IDC_SHOW_REQUIREMENT
Definition: resource.h:279
#define IDC_REQUIREMENTS_LIST
Definition: resource.h:275
#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 899 of file edit.c.

900{
902
903 switch(uMsg)
904 {
905 case WM_INITDIALOG:
906 CreateResourceColumns(hwndDlg);
907 ParseResources(hwndDlg);
908 return FALSE;
909
910 case WM_NOTIFY:
911 return OnResourceNotify(hwndDlg, (NMHDR *)lParam);
912
913 case WM_COMMAND:
914 switch (LOWORD(wParam))
915 {
916 case IDOK:
917 EndDialog(hwndDlg, IDOK);
918 break;
919 case IDCANCEL:
920 EndDialog(hwndDlg, IDCANCEL);
921 return TRUE;
922 }
923 }
924 return FALSE;
925}
static BOOL OnResourceNotify(HWND hwndDlg, NMHDR *phdr)
Definition: edit.c:844
static BOOL CreateResourceColumns(HWND hwnd)
Definition: edit.c:423
static VOID ParseResources(HWND hwnd)
Definition: edit.c:647

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 1019 of file edit.c.

1020{
1022
1023 switch(uMsg)
1024 {
1025 case WM_INITDIALOG:
1028 return FALSE;
1029
1030 case WM_NOTIFY:
1031 return OnResourceListNotify(hwndDlg, (NMHDR *)lParam);
1032
1033 case WM_COMMAND:
1034 switch (LOWORD(wParam))
1035 {
1036 case IDC_SHOW_RESOURCE:
1037 if (fullResourceIndex != -1)
1039 break;
1040 case IDOK:
1041 EndDialog(hwndDlg, IDOK);
1042 break;
1043 case IDCANCEL:
1044 EndDialog(hwndDlg, IDCANCEL);
1045 return TRUE;
1046 }
1047 }
1048 return FALSE;
1049}
static INT fullResourceIndex
Definition: edit.c:25
static INT_PTR CALLBACK modify_resource_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: edit.c:899
static VOID AddFullResourcesToList(HWND hwnd)
Definition: edit.c:958
static BOOL OnResourceListNotify(HWND hwndDlg, NMHDR *phdr)
Definition: edit.c:991
static BOOL CreateResourceListColumns(HWND hWndListView)
Definition: edit.c:927
#define IDD_EDIT_RESOURCE
Definition: resource.h:258
#define IDC_SHOW_RESOURCE
Definition: resource.h:256
#define IDC_RESOURCE_LIST
Definition: resource.h:255
#define DialogBoxW(i, t, p, f)
Definition: winuser.h:4402
#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 85 of file edit.c.

86{
87 WCHAR* valueData;
88 HWND hwndValue;
89 int len;
90
92
93 switch(uMsg)
94 {
95 case WM_INITDIALOG:
97 {
99 }
100 else
101 {
102 WCHAR buffer[255];
105 }
109 return FALSE;
110 case WM_COMMAND:
111 switch (LOWORD(wParam))
112 {
113 case IDOK:
114 if ((hwndValue = GetDlgItem(hwndDlg, IDC_VALUE_DATA)))
115 {
116 if ((len = GetWindowTextLength(hwndValue)))
117 {
118 if (stringValueData)
119 {
120 if ((valueData = HeapReAlloc(GetProcessHeap(), 0, stringValueData, (len + 1) * sizeof(WCHAR))))
121 {
122 stringValueData = valueData;
123 if (!GetWindowTextW(hwndValue, stringValueData, len + 1))
124 *stringValueData = 0;
125 }
126 }
127 else
128 {
129 if ((valueData = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR))))
130 {
131 stringValueData = valueData;
132 if (!GetWindowTextW(hwndValue, stringValueData, len + 1))
133 *stringValueData = 0;
134 }
135 }
136 }
137 else
138 {
139 if (stringValueData)
140 *stringValueData = 0;
141 }
142 }
143 EndDialog(hwndDlg, IDOK);
144 break;
145 case IDCANCEL:
146 EndDialog(hwndDlg, IDCANCEL);
147 return TRUE;
148 }
149 }
150 return FALSE;
151}

Referenced by ModifyValue().

◆ ModifyValue()

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

Definition at line 1522 of file edit.c.

1523{
1524 DWORD type;
1525 LONG lRet;
1526 BOOL result = FALSE;
1527
1528 if (!hKey)
1529 return FALSE;
1530
1531 editValueName = valueName;
1532
1533 lRet = RegQueryValueExW(hKey, valueName, 0, &type, 0, &valueDataLen);
1534 if (lRet != ERROR_SUCCESS && (valueName == NULL || !valueName[0]))
1535 {
1536 lRet = ERROR_SUCCESS; /* Allow editing of (Default) values which don't exist */
1537 type = REG_SZ;
1538 valueDataLen = 0;
1541 }
1542
1543 if (lRet != ERROR_SUCCESS)
1544 {
1545 error(hwnd, IDS_BAD_VALUE, valueName);
1546 goto done;
1547 }
1548
1549 if (EditBin == FALSE && ((type == REG_SZ) || (type == REG_EXPAND_SZ)))
1550 {
1551 if (valueDataLen > 0)
1552 {
1554 {
1556 goto done;
1557 }
1558 lRet = RegQueryValueExW(hKey, valueName, 0, 0, (LPBYTE)stringValueData, &valueDataLen);
1559 if (lRet != ERROR_SUCCESS)
1560 {
1561 error(hwnd, IDS_BAD_VALUE, valueName);
1562 goto done;
1563 }
1564 }
1565 else
1566 {
1568 }
1569
1571 {
1572 if (stringValueData)
1573 {
1574 lRet = RegSetValueExW(hKey, valueName, 0, type, (LPBYTE)stringValueData, (DWORD)(wcslen(stringValueData) + 1) * sizeof(WCHAR));
1575 }
1576 else
1577 {
1578 lRet = RegSetValueExW(hKey, valueName, 0, type, NULL, 0);
1579 }
1580 if (lRet == ERROR_SUCCESS)
1581 result = TRUE;
1582 }
1583 }
1584 else if (EditBin == FALSE && type == REG_MULTI_SZ)
1585 {
1586 if (valueDataLen > 0)
1587 {
1588 size_t llen, listlen, nl_len;
1589 LPWSTR src, lines = NULL;
1590
1592 {
1594 goto done;
1595 }
1596 lRet = RegQueryValueExW(hKey, valueName, 0, 0, (LPBYTE)stringValueData, &valueDataLen);
1597 if (lRet != ERROR_SUCCESS)
1598 {
1599 error(hwnd, IDS_BAD_VALUE, valueName);
1600 goto done;
1601 }
1602
1603 /* convert \0 to \r\n */
1605 nl_len = wcslen(L"\r\n") * sizeof(WCHAR);
1606 listlen = sizeof(WCHAR);
1607 lines = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, listlen + sizeof(WCHAR));
1608 while(*src != L'\0')
1609 {
1610 llen = wcslen(src);
1611 if(llen == 0)
1612 break;
1613 listlen += (llen * sizeof(WCHAR)) + nl_len;
1615 wcscat(lines, src);
1616 wcscat(lines, L"\r\n");
1617 src += llen + 1;
1618 }
1621 }
1622 else
1623 {
1625 }
1626
1628 {
1629 if (stringValueData)
1630 {
1631 /* convert \r\n to \0 */
1632 BOOL EmptyLines = FALSE;
1633 LPWSTR src, lines, nl;
1634 size_t linechars, buflen, c_nl, dest;
1635
1637 buflen = sizeof(WCHAR);
1638 lines = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, buflen + sizeof(WCHAR));
1639 c_nl = wcslen(L"\r\n");
1640 dest = 0;
1641 while(*src != L'\0')
1642 {
1643 if((nl = wcsstr(src, L"\r\n")))
1644 {
1645 linechars = nl - src;
1646 if(nl == src)
1647 {
1648 EmptyLines = TRUE;
1649 src = nl + c_nl;
1650 continue;
1651 }
1652 }
1653 else
1654 {
1655 linechars = wcslen(src);
1656 }
1657 if(linechars > 0)
1658 {
1659 buflen += ((linechars + 1) * sizeof(WCHAR));
1661 memcpy((lines + dest), src, linechars * sizeof(WCHAR));
1662 dest += linechars;
1663 lines[dest++] = L'\0';
1664 }
1665 else
1666 {
1667 EmptyLines = TRUE;
1668 }
1669 src += linechars + (nl != NULL ? c_nl : 0);
1670 }
1671 lines[++dest] = L'\0';
1672
1673 if(EmptyLines)
1674 {
1676 }
1677
1678 lRet = RegSetValueExW(hKey, valueName, 0, type, (LPBYTE)lines, (DWORD)buflen);
1680 }
1681 else
1682 {
1683 lRet = RegSetValueExW(hKey, valueName, 0, type, NULL, 0);
1684 }
1685 if (lRet == ERROR_SUCCESS)
1686 result = TRUE;
1687 }
1688 }
1689 else if (EditBin == FALSE && type == REG_DWORD)
1690 {
1691 lRet = RegQueryValueExW(hKey, valueName, 0, 0, (LPBYTE)&dwordValueData, &valueDataLen);
1692 if (lRet != ERROR_SUCCESS)
1693 {
1694 error(hwnd, IDS_BAD_VALUE, valueName);
1695 goto done;
1696 }
1697
1699 {
1700 lRet = RegSetValueExW(hKey, valueName, 0, type, (LPBYTE)&dwordValueData, sizeof(DWORD));
1701 if (lRet == ERROR_SUCCESS)
1702 result = TRUE;
1703 }
1704 }
1705 else if (EditBin == FALSE && type == REG_RESOURCE_LIST)
1706 {
1707 if (valueDataLen > 0)
1708 {
1710 if (resourceValueData == NULL)
1711 {
1713 goto done;
1714 }
1715
1716 lRet = RegQueryValueExW(hKey, valueName, 0, 0, (LPBYTE)resourceValueData, &valueDataLen);
1717 if (lRet != ERROR_SUCCESS)
1718 {
1719 error(hwnd, IDS_BAD_VALUE, valueName);
1720 goto done;
1721 }
1722 }
1723 else
1724 {
1726 }
1727
1729 {
1730 }
1731 }
1732 else if (EditBin == FALSE && type == REG_FULL_RESOURCE_DESCRIPTOR)
1733 {
1734 if (valueDataLen > 0)
1735 {
1737 if (resourceValueData == NULL)
1738 {
1740 goto done;
1741 }
1742
1743 lRet = RegQueryValueExW(hKey, valueName, 0, 0, (LPBYTE)&resourceValueData->List[0], &valueDataLen);
1744 if (lRet != ERROR_SUCCESS)
1745 {
1746 error(hwnd, IDS_BAD_VALUE, valueName);
1747 goto done;
1748 }
1749
1752 }
1753 else
1754 {
1756 }
1757
1759 {
1760 }
1761 }
1762 else if (EditBin == FALSE && type == REG_RESOURCE_REQUIREMENTS_LIST)
1763 {
1764 if (valueDataLen > 0)
1765 {
1768 {
1770 goto done;
1771 }
1772
1773 lRet = RegQueryValueExW(hKey, valueName, 0, 0, (LPBYTE)requirementsValueData, &valueDataLen);
1774 if (lRet != ERROR_SUCCESS)
1775 {
1776 error(hwnd, IDS_BAD_VALUE, valueName);
1777 goto done;
1778 }
1779
1780 }
1781 else
1782 {
1784 }
1785
1787 {
1788 }
1789 }
1790 else if ((EditBin != FALSE) || (type == REG_NONE) || (type == REG_BINARY))
1791 {
1792 if(valueDataLen > 0)
1793 {
1795 {
1797 goto done;
1798 }
1799
1800 /* Use the unicode version, so editing strings in binary mode is correct */
1801 lRet = RegQueryValueExW(hKey, valueName,
1803 if (lRet != ERROR_SUCCESS)
1804 {
1806 error(hwnd, IDS_BAD_VALUE, valueName);
1807 goto done;
1808 }
1809 }
1810 else
1811 {
1813 }
1814
1816 {
1817 /* Use the unicode version, so editing strings in binary mode is correct */
1818 lRet = RegSetValueExW(hKey, valueName,
1820 if (lRet == ERROR_SUCCESS)
1821 result = TRUE;
1822 }
1823 if(binValueData != NULL)
1825 }
1826 else
1827 {
1829 }
1830
1831done:
1835
1836 if (stringValueData)
1839
1843
1844 return result;
1845}
#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:85
static INT_PTR CALLBACK modify_requirements_list_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: edit.c:1490
static INT_PTR CALLBACK modify_resource_list_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: edit.c:1019
INT_PTR CALLBACK modify_multi_string_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: edit.c:153
INT_PTR CALLBACK modify_dword_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: edit.c:260
INT_PTR CALLBACK modify_binary_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: edit.c:373
#define IDD_EDIT_MULTI_STRING
Definition: resource.h:235
#define IDS_TOO_BIG_VALUE
Definition: resource.h:74
#define IDD_EDIT_STRING
Definition: resource.h:227
#define IDD_EDIT_BIN_DATA
Definition: resource.h:236
#define IDD_EDIT_RESOURCE_LIST
Definition: resource.h:254
#define IDD_EDIT_REQUIREMENTS_LIST
Definition: resource.h:274
#define IDS_MULTI_SZ_EMPTY_STRING
Definition: resource.h:77
#define IDS_UNSUPPORTED_TYPE
Definition: resource.h:73
#define IDD_EDIT_DWORD
Definition: resource.h:231
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 1918 of file edit.c.

1919{
1920 LONG lResult;
1921
1922 if (!lpSrcSubKey)
1924
1925 if (_wcsicmp(lpDestSubKey, lpSrcSubKey) == 0)
1926 {
1927 /* Destination name equals source name */
1928 return ERROR_SUCCESS;
1929 }
1930
1931 lResult = CopyKey(hDestKey, lpDestSubKey, hSrcKey, lpSrcSubKey);
1932 if (lResult == ERROR_SUCCESS)
1933 SHDeleteKey(hSrcKey, lpSrcSubKey);
1934
1935 return lResult;
1936}
#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 1462 of file edit.c.

1463{
1464 LPNMLISTVIEW lpnmlv = (LPNMLISTVIEW)phdr;
1465
1466 switch (phdr->idFrom)
1467 {
1469 switch(phdr->code)
1470 {
1471 case NM_CLICK:
1472 requirementsIndex = lpnmlv->iItem;
1473 EnableWindow(GetDlgItem(hwndDlg, IDC_SHOW_REQUIREMENT), (lpnmlv->iItem != -1));
1474 break;
1475
1476 case NM_DBLCLK:
1477 if (lpnmlv->iItem != -1)
1478 {
1479 requirementsIndex = lpnmlv->iItem;
1480 ShowRequirement(hwndDlg);
1481 }
1482 break;
1483 }
1484 break;
1485 }
1486
1487 return FALSE;
1488}
#define NM_DBLCLK
Definition: commctrl.h:131
#define NM_CLICK
Definition: commctrl.h:130
struct tagNMLISTVIEW * LPNMLISTVIEW
UINT_PTR idFrom
Definition: winuser.h:3161
UINT code
Definition: winuser.h:3162
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 991 of file edit.c.

992{
993 LPNMLISTVIEW lpnmlv = (LPNMLISTVIEW)phdr;
994
995 switch (phdr->idFrom)
996 {
998 switch(phdr->code)
999 {
1000 case NM_CLICK:
1001 fullResourceIndex = lpnmlv->iItem;
1002 EnableWindow(GetDlgItem(hwndDlg, IDC_SHOW_RESOURCE), (lpnmlv->iItem != -1));
1003 break;
1004
1005 case NM_DBLCLK:
1006 if (lpnmlv->iItem != -1)
1007 {
1008 fullResourceIndex = lpnmlv->iItem;
1010 }
1011 break;
1012 }
1013 break;
1014 }
1015
1016 return FALSE;
1017}

Referenced by modify_resource_list_dlgproc().

◆ OnResourceNotify()

static BOOL OnResourceNotify ( HWND  hwndDlg,
NMHDR phdr 
)
static

Definition at line 844 of file edit.c.

845{
846 LPNMLISTVIEW lpnmlv = (LPNMLISTVIEW)phdr;
847
848 switch (phdr->idFrom)
849 {
850 case IDC_PORT_LIST:
851 case IDC_MEMORY_LIST:
852 case IDC_DMA_LIST:
853 case IDC_IRQ_LIST:
854 case IDC_DEVICE_LIST:
855 switch(phdr->code)
856 {
857 case NM_CLICK:
858 if (lpnmlv->iItem != -1)
859 {
862
863 item.mask = LVIF_PARAM;
864 item.iItem = lpnmlv->iItem;
865 item.iSubItem = 0;
866
867 if (ListView_GetItem(phdr->hwndFrom, &item))
868 {
869 pDescriptor = (PCM_PARTIAL_RESOURCE_DESCRIPTOR)item.lParam;
870
873
875 (pDescriptor->ShareDisposition == CmResourceShareShared));
876
879
882 }
883 }
884 else
885 {
890 }
891 break;
892 }
893 break;
894 }
895
896 return FALSE;
897}
#define IDC_DEVICE_EXCLUSIVE
Definition: resource.h:266
#define IDC_UNDETERMINED
Definition: resource.h:264
#define IDC_SHARED
Definition: resource.h:265
#define IDC_DRIVER_EXCLUSIVE
Definition: resource.h:267
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR * PCM_PARTIAL_RESOURCE_DESCRIPTOR
#define ListView_GetItem(hwnd, pitem)
Definition: commctrl.h:2399
HWND hwndFrom
Definition: winuser.h:3160

Referenced by modify_resource_dlgproc().

◆ ParseResources()

static VOID ParseResources ( HWND  hwnd)
static

Definition at line 647 of file edit.c.

648{
649 PCM_FULL_RESOURCE_DESCRIPTOR pFullDescriptor;
650 PCM_PARTIAL_RESOURCE_LIST pPartialResourceList;
652 ULONG i;
653 HWND hwndLV;
654
655 WCHAR buffer[80];
657 INT iItem;
658
659 pFullDescriptor = &resourceValueData->List[0];
660 for (i = 0; i < fullResourceIndex; i++)
661 {
662 pFullDescriptor = (PVOID)(pFullDescriptor->PartialResourceList.PartialDescriptors +
663 pFullDescriptor->PartialResourceList.Count);
664 }
665 pPartialResourceList = &pFullDescriptor->PartialResourceList;
666
667 /* Interface type */
668 GetInterfaceType(pFullDescriptor->InterfaceType, buffer, 80);
670
671 /* Busnumber */
672 SetDlgItemInt(hwnd, IDC_BUSNUMBER, (UINT)pFullDescriptor->BusNumber, TRUE);
673
674 /* Version */
675 SetDlgItemInt(hwnd, IDC_VERSION, (UINT)pPartialResourceList->Version, FALSE);
676
677 /* Revision */
678 SetDlgItemInt(hwnd, IDC_REVISION, (UINT)pPartialResourceList->Revision, FALSE);
679
680 for (i = 0; i < pPartialResourceList->Count; i++)
681 {
682 pDescriptor = &pPartialResourceList->PartialDescriptors[i];
683
684 switch (pDescriptor->Type)
685 {
687 hwndLV = GetDlgItem(hwnd, IDC_PORT_LIST);
688
689#ifdef _M_AMD64
690 wsprintf(buffer, L"0x%016I64x", pDescriptor->u.Port.Start.QuadPart);
691#else
692 wsprintf(buffer, L"0x%08lx", pDescriptor->u.Port.Start.u.LowPart);
693#endif
694
695 item.mask = LVIF_TEXT | LVIF_PARAM;
696 item.iItem = 1000;
697 item.iSubItem = 0;
698 item.state = 0;
699 item.stateMask = 0;
700 item.pszText = buffer;
701 item.cchTextMax = (int)wcslen(item.pszText);
702 item.lParam = (LPARAM)pDescriptor;
703
704 iItem = ListView_InsertItem(hwndLV, &item);
705 if (iItem != -1)
706 {
707 wsprintf(buffer, L"0x%lx", pDescriptor->u.Port.Length);
708 ListView_SetItemText(hwndLV, iItem, 1, buffer);
709
710 if (pDescriptor->Flags & CM_RESOURCE_PORT_IO)
712 else
714 ListView_SetItemText(hwndLV, iItem, 2, buffer);
715 }
716 break;
717
719 hwndLV = GetDlgItem(hwnd, IDC_IRQ_LIST);
720
721 wsprintf(buffer, L"%lu", pDescriptor->u.Interrupt.Vector);
722
723 item.mask = LVIF_TEXT | LVIF_PARAM;
724 item.iItem = 1000;
725 item.iSubItem = 0;
726 item.state = 0;
727 item.stateMask = 0;
728 item.pszText = buffer;
729 item.cchTextMax = (int)wcslen(item.pszText);
730 item.lParam = (LPARAM)pDescriptor;
731
732 iItem = ListView_InsertItem(hwndLV, &item);
733 if (iItem != -1)
734 {
735 wsprintf(buffer, L"%lu", pDescriptor->u.Interrupt.Level);
736 ListView_SetItemText(hwndLV, iItem, 1, buffer);
737
738 wsprintf(buffer, L"0x%08lx", pDescriptor->u.Interrupt.Affinity);
739 ListView_SetItemText(hwndLV, iItem, 2, buffer);
740
741 if (pDescriptor->Flags & CM_RESOURCE_INTERRUPT_LATCHED)
743 else
745
746 ListView_SetItemText(hwndLV, iItem, 3, buffer);
747 }
748 break;
749
752
753#ifdef _M_AMD64
754 wsprintf(buffer, L"0x%016I64x", pDescriptor->u.Memory.Start.QuadPart);
755#else
756 wsprintf(buffer, L"0x%08lx", pDescriptor->u.Memory.Start.u.LowPart);
757#endif
758
759 item.mask = LVIF_TEXT | LVIF_PARAM;
760 item.iItem = 1000;
761 item.iSubItem = 0;
762 item.state = 0;
763 item.stateMask = 0;
764 item.pszText = buffer;
765 item.cchTextMax = (int)wcslen(item.pszText);
766 item.lParam = (LPARAM)pDescriptor;
767
768 iItem = ListView_InsertItem(hwndLV, &item);
769 if (iItem != -1)
770 {
771 wsprintf(buffer, L"0x%lx", pDescriptor->u.Memory.Length);
772 ListView_SetItemText(hwndLV, iItem, 1, buffer);
773
775 {
778 break;
779
782 break;
783
784 default:
786 break;
787 }
788
789 ListView_SetItemText(hwndLV, iItem, 2, buffer);
790 }
791 break;
792
794 hwndLV = GetDlgItem(hwnd, IDC_DMA_LIST);
795
796 wsprintf(buffer, L"%lu", pDescriptor->u.Dma.Channel);
797
798 item.mask = LVIF_TEXT | LVIF_PARAM;
799 item.iItem = 1000;
800 item.iSubItem = 0;
801 item.state = 0;
802 item.stateMask = 0;
803 item.pszText = buffer;
804 item.cchTextMax = (int)wcslen(item.pszText);
805 item.lParam = (LPARAM)pDescriptor;
806
807 iItem = ListView_InsertItem(hwndLV, &item);
808 if (iItem != -1)
809 {
810 wsprintf(buffer, L"%lu", pDescriptor->u.Dma.Port);
811 ListView_SetItemText(hwndLV, iItem, 1, buffer);
812 }
813 break;
814
817
818 wsprintf(buffer, L"0x%08lx", pDescriptor->u.DeviceSpecificData.Reserved1);
819
820 item.mask = LVIF_TEXT | LVIF_PARAM;
821 item.iItem = 1000;
822 item.iSubItem = 0;
823 item.state = 0;
824 item.stateMask = 0;
825 item.pszText = buffer;
826 item.cchTextMax = (int)wcslen(item.pszText);
827 item.lParam = (LPARAM)pDescriptor;
828
829 iItem = ListView_InsertItem(hwndLV, &item);
830 if (iItem != -1)
831 {
832 wsprintf(buffer, L"0x%08lx", pDescriptor->u.DeviceSpecificData.Reserved2);
833 ListView_SetItemText(hwndLV, iItem, 1, buffer);
834
835 wsprintf(buffer, L"0x%lx", pDescriptor->u.DeviceSpecificData.DataSize);
836 ListView_SetItemText(hwndLV, iItem, 2, buffer);
837 }
838 break;
839 }
840 }
841}
#define IDC_REVISION
Definition: resource.h:271
#define IDC_VERSION
Definition: resource.h:270
#define IDC_BUSNUMBER
Definition: resource.h:269
#define IDC_INTERFACETYPE
Definition: resource.h:268
#define CmResourceTypeDeviceSpecific
Definition: hwresource.cpp:127
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@391::@393 Port
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@391::@400 DeviceSpecificData
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@391::@396 Memory
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@391 u
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@391::@394 Interrupt
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@391::@397 Dma

Referenced by modify_resource_dlgproc().

◆ QueryStringValue()

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

Definition at line 2038 of file edit.c.

2039{
2040 LONG lResult;
2041 HKEY hSubKey = NULL;
2042 DWORD cbData, dwType;
2043
2044 if (lpSubKey)
2045 {
2046 lResult = RegOpenKeyW(hKey, lpSubKey, &hSubKey);
2047 if (lResult != ERROR_SUCCESS)
2048 goto done;
2049 hKey = hSubKey;
2050 }
2051
2052 cbData = (dwBufferLen - 1) * sizeof(*pszBuffer);
2053 lResult = RegQueryValueExW(hKey, lpValueName, NULL, &dwType, (LPBYTE)pszBuffer, &cbData);
2054 if (lResult != ERROR_SUCCESS)
2055 goto done;
2056 if (dwType != REG_SZ)
2057 {
2058 lResult = -1;
2059 goto done;
2060 }
2061
2062 pszBuffer[cbData / sizeof(*pszBuffer)] = L'\0';
2063
2064done:
2065 if (lResult != ERROR_SUCCESS)
2066 pszBuffer[0] = L'\0';
2067 if (hSubKey)
2068 RegCloseKey(hSubKey);
2069 return lResult;
2070}
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 1971 of file edit.c.

1972{
1973 LPCWSTR s;
1974 LPWSTR lpNewSubKey = NULL;
1975 LONG Ret = 0;
1976 SIZE_T cbNewSubKey;
1977
1978 if (!lpSubKey)
1979 return Ret;
1980
1981 s = wcsrchr(lpSubKey, L'\\');
1982 if (s)
1983 {
1984 s++;
1985 cbNewSubKey = (s - lpSubKey + wcslen(lpNewName) + 1) * sizeof(WCHAR);
1986 lpNewSubKey = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, cbNewSubKey);
1987 if (lpNewSubKey != NULL)
1988 {
1989 StringCbCopyNW(lpNewSubKey, cbNewSubKey, lpSubKey, (s - lpSubKey) * sizeof(WCHAR));
1990 StringCbCatW(lpNewSubKey, cbNewSubKey, lpNewName);
1991 lpNewName = lpNewSubKey;
1992 }
1993 else
1995 }
1996
1997 Ret = MoveKey(hKey, lpNewName, hKey, lpSubKey);
1998
1999 if (lpNewSubKey)
2000 {
2001 HeapFree(GetProcessHeap(), 0, lpNewSubKey);
2002 }
2003 return Ret;
2004}
static LONG MoveKey(HKEY hDestKey, LPCWSTR lpDestSubKey, HKEY hSrcKey, LPCWSTR lpSrcSubKey)
Definition: edit.c:1918
#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 2006 of file edit.c.

2007{
2008 LONG lResult;
2009 HKEY hSubKey = NULL;
2010 DWORD dwType, cbData;
2011 BYTE data[512];
2012
2013 if (lpSubKey)
2014 {
2015 lResult = RegOpenKeyW(hKey, lpSubKey, &hSubKey);
2016 if (lResult != ERROR_SUCCESS)
2017 goto done;
2018 hKey = hSubKey;
2019 }
2020
2021 cbData = sizeof(data);
2022 lResult = RegQueryValueExW(hKey, lpSrcValue, NULL, &dwType, data, &cbData);
2023 if (lResult != ERROR_SUCCESS)
2024 goto done;
2025
2026 lResult = RegSetValueExW(hKey, lpDestValue, 0, dwType, data, cbData);
2027 if (lResult != ERROR_SUCCESS)
2028 goto done;
2029
2030 RegDeleteValue(hKey, lpSrcValue);
2031
2032done:
2033 if (hSubKey)
2034 RegCloseKey(hSubKey);
2035 return lResult;
2036}
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 1391 of file edit.c.

1392{
1393 PIO_RESOURCE_DESCRIPTOR pDescriptor;
1394 WCHAR Buffer[80];
1395
1396 switch(uMsg)
1397 {
1398 case WM_INITDIALOG:
1399 pDescriptor = (PIO_RESOURCE_DESCRIPTOR)lParam;
1400 wsprintf(Buffer, L"0x%lx", pDescriptor->u.Dma.MinimumChannel);
1402 wsprintf(Buffer, L"0x%lx", pDescriptor->u.Dma.MaximumChannel);
1404
1405 GetShareDisposition(pDescriptor->ShareDisposition, Buffer, 80);
1407
1410 return FALSE;
1411
1412 case WM_COMMAND:
1413 switch (LOWORD(wParam))
1414 {
1415 case IDOK:
1416 case IDCANCEL:
1417 EndDialog(hwndDlg, IDOK);
1418 break;
1419 }
1420 }
1421 return FALSE;
1422}
static VOID GetShareDisposition(UCHAR ShareDisposition, LPWSTR pBuffer, DWORD dwLength)
Definition: edit.c:1125
#define IDC_REQ_DMA_PREFERRED
Definition: resource.h:314
#define IDC_REQ_DMA_MIN
Definition: resource.h:310
#define IDC_REQ_DMA_ALTERNATIVE
Definition: resource.h:313
#define IDC_REQ_DMA_MAX
Definition: resource.h:311
#define IDC_REQ_DMA_SHARE
Definition: resource.h:312
Definition: bufpool.h:45
struct _IO_RESOURCE_DESCRIPTOR * PIO_RESOURCE_DESCRIPTOR
union _IO_RESOURCE_DESCRIPTOR::@2051 u
struct _IO_RESOURCE_DESCRIPTOR::@2051::@2055 Dma
#define IO_RESOURCE_ALTERNATIVE
#define IO_RESOURCE_PREFERRED

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 1354 of file edit.c.

1355{
1356 PIO_RESOURCE_DESCRIPTOR pDescriptor;
1357 WCHAR Buffer[80];
1358
1359 switch(uMsg)
1360 {
1361 case WM_INITDIALOG:
1362 pDescriptor = (PIO_RESOURCE_DESCRIPTOR)lParam;
1363
1364 GetInterruptType(pDescriptor->Flags, Buffer, 80);
1366
1367 wsprintf(Buffer, L"0x%lx", pDescriptor->u.Interrupt.MinimumVector);
1369 wsprintf(Buffer, L"0x%lx", pDescriptor->u.Interrupt.MaximumVector);
1371
1372 GetShareDisposition(pDescriptor->ShareDisposition, Buffer, 80);
1374
1377 return FALSE;
1378
1379 case WM_COMMAND:
1380 switch (LOWORD(wParam))
1381 {
1382 case IDOK:
1383 case IDCANCEL:
1384 EndDialog(hwndDlg, IDOK);
1385 break;
1386 }
1387 }
1388 return FALSE;
1389}
static VOID GetInterruptType(USHORT Flags, LPWSTR pBuffer, DWORD dwLength)
Definition: edit.c:1187
#define IDC_REQ_INT_PREFERRED
Definition: resource.h:307
#define IDC_REQ_INT_ALTERNATIVE
Definition: resource.h:306
#define IDC_REQ_INT_TYPE
Definition: resource.h:302
#define IDC_REQ_INT_MIN
Definition: resource.h:303
#define IDC_REQ_INT_SHARE
Definition: resource.h:305
#define IDC_REQ_INT_MAX
Definition: resource.h:304
struct _IO_RESOURCE_DESCRIPTOR::@2051::@2054 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 1305 of file edit.c.

1306{
1307 PIO_RESOURCE_DESCRIPTOR pDescriptor;
1308 WCHAR Buffer[80];
1309
1310 switch(uMsg)
1311 {
1312 case WM_INITDIALOG:
1313 pDescriptor = (PIO_RESOURCE_DESCRIPTOR)lParam;
1314
1315 GetMemoryAccess(pDescriptor->Flags, Buffer, 80);
1317
1318 wsprintf(Buffer, L"0x%lx", pDescriptor->u.Memory.Length);
1320 wsprintf(Buffer, L"0x%lx", pDescriptor->u.Memory.Alignment);
1322#ifdef _M_AMD64
1323 wsprintf(Buffer, L"0x%016I64x", pDescriptor->u.Memory.MinimumAddress.QuadPart);
1324#else
1325 wsprintf(Buffer, L"0x%08lx", pDescriptor->u.Memory.MinimumAddress.u.LowPart);
1326#endif
1328#ifdef _M_AMD64
1329 wsprintf(Buffer, L"0x%016I64x", pDescriptor->u.Memory.MaximumAddress.QuadPart);
1330#else
1331 wsprintf(Buffer, L"0x%08lx", pDescriptor->u.Memory.MaximumAddress.u.LowPart);
1332#endif
1334
1335 GetShareDisposition(pDescriptor->ShareDisposition, Buffer, 80);
1337
1340 return FALSE;
1341
1342 case WM_COMMAND:
1343 switch (LOWORD(wParam))
1344 {
1345 case IDOK:
1346 case IDCANCEL:
1347 EndDialog(hwndDlg, IDOK);
1348 break;
1349 }
1350 }
1351 return FALSE;
1352}
static VOID GetMemoryAccess(USHORT Flags, LPWSTR pBuffer, DWORD dwLength)
Definition: edit.c:1167
#define IDC_REQ_MEMORY_MAX
Definition: resource.h:296
#define IDC_REQ_MEMORY_SHARE
Definition: resource.h:297
#define IDC_REQ_MEMORY_ACCESS
Definition: resource.h:292
#define IDC_REQ_MEMORY_MIN
Definition: resource.h:295
#define IDC_REQ_MEMORY_PREFERRED
Definition: resource.h:299
#define IDC_REQ_MEMORY_ALIGN
Definition: resource.h:294
#define IDC_REQ_MEMORY_ALTERNATIVE
Definition: resource.h:298
#define IDC_REQ_MEMORY_LENGTH
Definition: resource.h:293
struct _IO_RESOURCE_DESCRIPTOR::@2051::@2053 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 1256 of file edit.c.

1257{
1258 PIO_RESOURCE_DESCRIPTOR pDescriptor;
1259 WCHAR Buffer[80];
1260
1261 switch(uMsg)
1262 {
1263 case WM_INITDIALOG:
1264 pDescriptor = (PIO_RESOURCE_DESCRIPTOR)lParam;
1265
1266 GetPortType(pDescriptor->Flags, Buffer, 80);
1268
1269 wsprintf(Buffer, L"0x%lx", pDescriptor->u.Port.Length);
1271 wsprintf(Buffer, L"0x%lx", pDescriptor->u.Port.Alignment);
1273#ifdef _M_AMD64
1274 wsprintf(Buffer, L"0x%016I64x", pDescriptor->u.Port.MinimumAddress.QuadPart);
1275#else
1276 wsprintf(Buffer, L"0x%08lx", pDescriptor->u.Port.MinimumAddress.u.LowPart);
1277#endif
1279#ifdef _M_AMD64
1280 wsprintf(Buffer, L"0x%016I64x", pDescriptor->u.Port.MaximumAddress.QuadPart);
1281#else
1282 wsprintf(Buffer, L"0x%08lx", pDescriptor->u.Port.MaximumAddress.u.LowPart);
1283#endif
1285
1286 GetShareDisposition(pDescriptor->ShareDisposition, Buffer, 80);
1288
1291 return FALSE;
1292
1293 case WM_COMMAND:
1294 switch (LOWORD(wParam))
1295 {
1296 case IDOK:
1297 case IDCANCEL:
1298 EndDialog(hwndDlg, IDOK);
1299 break;
1300 }
1301 }
1302 return FALSE;
1303}
static VOID GetPortType(USHORT Flags, LPWSTR pBuffer, DWORD dwLength)
Definition: edit.c:1151
#define IDC_REQ_PORT_TYPE
Definition: resource.h:282
#define IDC_REQ_PORT_LENGTH
Definition: resource.h:283
#define IDC_REQ_PORT_ALIGN
Definition: resource.h:284
#define IDC_REQ_PORT_MAX
Definition: resource.h:286
#define IDC_REQ_PORT_SHARE
Definition: resource.h:287
#define IDC_REQ_PORT_MIN
Definition: resource.h:285
#define IDC_REQ_PORT_PREFERRED
Definition: resource.h:289
#define IDC_REQ_PORT_ALTERNATIVE
Definition: resource.h:288
struct _IO_RESOURCE_DESCRIPTOR::@2051::@2052 Port

Referenced by ShowRequirement().

◆ ShowRequirement()

static VOID ShowRequirement ( HWND  hwndDlg)
static

Definition at line 1425 of file edit.c.

1426{
1427 PIO_RESOURCE_DESCRIPTOR pDescriptor;
1428 LVITEMW item;
1429
1430 if (requirementsIndex == -1)
1431 return;
1432
1433 item.mask = LVIF_PARAM;
1434 item.iItem = requirementsIndex;
1435 item.iSubItem = 0;
1437
1438 pDescriptor = (PIO_RESOURCE_DESCRIPTOR)item.lParam;
1439 if (pDescriptor)
1440 {
1441 switch (pDescriptor->Type)
1442 {
1443 case CmResourceTypePort:
1445 break;
1448 break;
1451 break;
1452 case CmResourceTypeDma:
1454 break;
1455 default:
1456 break;
1457 }
1458 }
1459}
static INT_PTR CALLBACK show_requirements_port_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: edit.c:1256
static INT_PTR CALLBACK show_requirements_dma_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: edit.c:1391
static INT_PTR CALLBACK show_requirements_memory_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: edit.c:1305
static INT_PTR CALLBACK show_requirements_interrupt_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: edit.c:1354
#define IDD_EDIT_REQUIREMENTS_MEMORY
Definition: resource.h:291
#define IDD_EDIT_REQUIREMENTS_DMA
Definition: resource.h:309
#define IDD_EDIT_REQUIREMENTS_INT
Definition: resource.h:301
#define IDD_EDIT_REQUIREMENTS_PORT
Definition: resource.h:281
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 62 of file edit.c.

63{
64 va_list ap;
65 WCHAR title[256];
66 WCHAR errfmt[1024];
67 WCHAR errstr[1024];
69
71
73 StringCbCopyW(title, sizeof(title), L"Warning");
74
75 if (!LoadStringW(hInstance, resId, errfmt, ARRAY_SIZE(errfmt)))
76 StringCbCopyW(errfmt, sizeof(errfmt), L"Unknown error string!");
77
78 va_start(ap, resId);
79 StringCbVPrintfW(errstr, sizeof(errstr), errfmt, ap);
80 va_end(ap);
81
83}
#define IDS_WARNING
Definition: resource.h:76
STRSAFEAPI StringCbVPrintfW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszFormat, va_list argList)
Definition: strsafe.h:507
#define MB_ICONSTOP
Definition: winuser.h:806

Variable Documentation

◆ binValueData

PVOID binValueData
static

Definition at line 22 of file edit.c.

Referenced by modify_binary_dlgproc(), and ModifyValue().

◆ dwordEditMode

EDIT_MODE dwordEditMode = EDIT_MODE_HEX
static

Definition at line 29 of file edit.c.

Referenced by DwordEditSubclassProc(), and modify_dword_dlgproc().

◆ dwordValueData

DWORD dwordValueData
static

Definition at line 23 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 27 of file edit.c.

Referenced by AddRequirementsToList(), and ModifyValue().

◆ resourceValueData

PCM_RESOURCE_LIST resourceValueData
static

Definition at line 24 of file edit.c.

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

◆ stringValueData

WCHAR* stringValueData
static

Definition at line 21 of file edit.c.

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

◆ valueDataLen

DWORD valueDataLen
static

Definition at line 26 of file edit.c.

Referenced by modify_binary_dlgproc(), and ModifyValue().