Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
8f0bc1e2
Commit
8f0bc1e2
authored
Apr 16, 2011
by
Andrew Nguyen
Committed by
Alexandre Julliard
Apr 18, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Convert the edit code to Unicode.
parent
dfc0fa86
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
12 deletions
+15
-12
edit.c
programs/regedit/edit.c
+15
-12
No files found.
programs/regedit/edit.c
View file @
8f0bc1e2
...
@@ -106,13 +106,16 @@ static void error_code_messagebox(HWND hwnd, DWORD error_code)
...
@@ -106,13 +106,16 @@ static void error_code_messagebox(HWND hwnd, DWORD error_code)
static
BOOL
change_dword_base
(
HWND
hwndDlg
,
BOOL
toHex
)
static
BOOL
change_dword_base
(
HWND
hwndDlg
,
BOOL
toHex
)
{
{
TCHAR
buf
[
128
];
static
const
WCHAR
percent_u
[]
=
{
'%'
,
'u'
,
0
};
static
const
WCHAR
percent_x
[]
=
{
'%'
,
'x'
,
0
};
WCHAR
buf
[
128
];
DWORD
val
;
DWORD
val
;
if
(
!
GetDlgItemText
(
hwndDlg
,
IDC_VALUE_DATA
,
buf
,
COUNT_OF
(
buf
)))
return
FALSE
;
if
(
!
GetDlgItemText
W
(
hwndDlg
,
IDC_VALUE_DATA
,
buf
,
COUNT_OF
(
buf
)))
return
FALSE
;
if
(
!
_stscanf
(
buf
,
toHex
?
"%u"
:
"%x"
,
&
val
))
return
FALSE
;
if
(
!
swscanf
(
buf
,
toHex
?
percent_u
:
percent_x
,
&
val
))
return
FALSE
;
wsprintf
(
buf
,
toHex
?
"%x"
:
"%u"
,
val
);
wsprintf
W
(
buf
,
toHex
?
percent_x
:
percent_u
,
val
);
return
SetDlgItemText
(
hwndDlg
,
IDC_VALUE_DATA
,
buf
);
return
SetDlgItemText
W
(
hwndDlg
,
IDC_VALUE_DATA
,
buf
);
}
}
static
INT_PTR
CALLBACK
modify_dlgproc
(
HWND
hwndDlg
,
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
)
static
INT_PTR
CALLBACK
modify_dlgproc
(
HWND
hwndDlg
,
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
)
...
@@ -163,18 +166,18 @@ static INT_PTR CALLBACK bin_modify_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wPara
...
@@ -163,18 +166,18 @@ static INT_PTR CALLBACK bin_modify_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wPara
switch
(
uMsg
)
{
switch
(
uMsg
)
{
case
WM_INITDIALOG
:
case
WM_INITDIALOG
:
params
=
(
struct
edit_params
*
)
lParam
;
params
=
(
struct
edit_params
*
)
lParam
;
SetWindowLongPtr
(
hwndDlg
,
DWLP_USER
,
(
ULONG_PTR
)
params
);
SetWindowLongPtr
W
(
hwndDlg
,
DWLP_USER
,
(
ULONG_PTR
)
params
);
if
(
params
->
lpszValueName
)
if
(
params
->
lpszValueName
)
SetDlgItemTextW
(
hwndDlg
,
IDC_VALUE_NAME
,
params
->
lpszValueName
);
SetDlgItemTextW
(
hwndDlg
,
IDC_VALUE_NAME
,
params
->
lpszValueName
);
else
else
SetDlgItemTextW
(
hwndDlg
,
IDC_VALUE_NAME
,
g_pszDefaultValueName
);
SetDlgItemTextW
(
hwndDlg
,
IDC_VALUE_NAME
,
g_pszDefaultValueName
);
SendDlgItemMessage
(
hwndDlg
,
IDC_VALUE_DATA
,
HEM_SETDATA
,
(
WPARAM
)
params
->
cbData
,
(
LPARAM
)
params
->
pData
);
SendDlgItemMessage
W
(
hwndDlg
,
IDC_VALUE_DATA
,
HEM_SETDATA
,
(
WPARAM
)
params
->
cbData
,
(
LPARAM
)
params
->
pData
);
return
TRUE
;
return
TRUE
;
case
WM_COMMAND
:
case
WM_COMMAND
:
switch
(
LOWORD
(
wParam
))
{
switch
(
LOWORD
(
wParam
))
{
case
IDOK
:
case
IDOK
:
params
=
(
struct
edit_params
*
)
GetWindowLongPtr
(
hwndDlg
,
DWLP_USER
);
params
=
(
struct
edit_params
*
)
GetWindowLongPtr
W
(
hwndDlg
,
DWLP_USER
);
cbData
=
SendDlgItemMessage
(
hwndDlg
,
IDC_VALUE_DATA
,
HEM_GETDATA
,
0
,
0
);
cbData
=
SendDlgItemMessage
W
(
hwndDlg
,
IDC_VALUE_DATA
,
HEM_GETDATA
,
0
,
0
);
pData
=
HeapAlloc
(
GetProcessHeap
(),
0
,
cbData
);
pData
=
HeapAlloc
(
GetProcessHeap
(),
0
,
cbData
);
if
(
pData
)
if
(
pData
)
...
@@ -263,7 +266,7 @@ BOOL CreateKey(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, LPWSTR keyName)
...
@@ -263,7 +266,7 @@ BOOL CreateKey(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, LPWSTR keyName)
goto
done
;
goto
done
;
}
}
if
(
!
LoadStringW
(
GetModuleHandle
(
0
),
IDS_NEWKEY
,
newKey
,
COUNT_OF
(
newKey
)))
goto
done
;
if
(
!
LoadStringW
(
GetModuleHandle
W
(
0
),
IDS_NEWKEY
,
newKey
,
COUNT_OF
(
newKey
)))
goto
done
;
/* try to find out a name for the newly create key (max 100 times) */
/* try to find out a name for the newly create key (max 100 times) */
for
(
keyNum
=
1
;
keyNum
<
100
;
keyNum
++
)
{
for
(
keyNum
=
1
;
keyNum
<
100
;
keyNum
++
)
{
...
@@ -330,7 +333,7 @@ BOOL ModifyValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, LPCWSTR valueName)
...
@@ -330,7 +333,7 @@ BOOL ModifyValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, LPCWSTR valueName)
params
.
lpszValueName
=
valueName
;
params
.
lpszValueName
=
valueName
;
params
.
pData
=
stringValueData
;
params
.
pData
=
stringValueData
;
params
.
cbData
=
len
;
params
.
cbData
=
len
;
result
=
DialogBoxParam
(
NULL
,
MAKEINTRESOURCE
(
IDD_EDIT_BINARY
),
hwnd
,
result
=
DialogBoxParam
W
(
NULL
,
MAKEINTRESOURCEW
(
IDD_EDIT_BINARY
),
hwnd
,
bin_modify_dlgproc
,
(
LPARAM
)
&
params
);
bin_modify_dlgproc
,
(
LPARAM
)
&
params
);
}
else
if
(
type
==
REG_MULTI_SZ
)
{
}
else
if
(
type
==
REG_MULTI_SZ
)
{
WCHAR
char1
=
'\r'
,
char2
=
'\n'
;
WCHAR
char1
=
'\r'
,
char2
=
'\n'
;
...
@@ -467,7 +470,7 @@ BOOL CreateValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, DWORD valueType, LPW
...
@@ -467,7 +470,7 @@ BOOL CreateValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, DWORD valueType, LPW
return
FALSE
;
return
FALSE
;
}
}
if
(
!
LoadStringW
(
GetModuleHandle
(
0
),
IDS_NEWVALUE
,
newValue
,
COUNT_OF
(
newValue
)))
goto
done
;
if
(
!
LoadStringW
(
GetModuleHandle
W
(
0
),
IDS_NEWVALUE
,
newValue
,
COUNT_OF
(
newValue
)))
goto
done
;
/* try to find out a name for the newly create key (max 100 times) */
/* try to find out a name for the newly create key (max 100 times) */
for
(
valueNum
=
1
;
valueNum
<
100
;
valueNum
++
)
{
for
(
valueNum
=
1
;
valueNum
<
100
;
valueNum
++
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment