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
0a71d4fa
Commit
0a71d4fa
authored
Apr 11, 2017
by
Hugh McMaster
Committed by
Alexandre Julliard
Apr 11, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Re-implement convertHexToDWord().
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
467def83
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
13 deletions
+29
-13
regproc.c
programs/regedit/regproc.c
+22
-6
regedit.c
programs/regedit/tests/regedit.c
+7
-7
No files found.
programs/regedit/regproc.c
View file @
0a71d4fa
...
...
@@ -146,15 +146,31 @@ static char* GetMultiByteStringN(const WCHAR* strW, int chars, DWORD* len)
*/
static
BOOL
convertHexToDWord
(
WCHAR
*
str
,
DWORD
*
dw
)
{
char
buf
[
9
]
;
char
dummy
;
WCHAR
*
p
,
*
end
;
int
count
=
0
;
WideCharToMultiByte
(
CP_ACP
,
0
,
str
,
-
1
,
buf
,
9
,
NULL
,
NULL
);
if
(
lstrlenW
(
str
)
>
8
||
sscanf
(
buf
,
"%x%c"
,
dw
,
&
dummy
)
!=
1
)
{
output_message
(
STRING_INVALID_HEX
);
return
FALSE
;
while
(
*
str
==
' '
||
*
str
==
'\t'
)
str
++
;
if
(
!*
str
)
goto
error
;
p
=
str
;
while
(
isxdigitW
(
*
p
))
{
count
++
;
p
++
;
}
if
(
count
>
8
)
goto
error
;
end
=
p
;
while
(
*
p
==
' '
||
*
p
==
'\t'
)
p
++
;
if
(
*
p
&&
*
p
!=
';'
)
goto
error
;
*
end
=
0
;
*
dw
=
strtoulW
(
str
,
&
end
,
16
);
return
TRUE
;
error:
output_message
(
STRING_INVALID_HEX
);
return
FALSE
;
}
/******************************************************************************
...
...
programs/regedit/tests/regedit.c
View file @
0a71d4fa
...
...
@@ -530,7 +530,7 @@ static void test_invalid_import(void)
"
\"
Test14a
\"
=dword:0x123
\n
"
"
\"
Test14b
\"
=dword:123 456
\n
"
"
\"
Test14c
\"
=dword:1234 5678
\n\n
"
);
todo_wine
verify_reg_nonexist
(
hkey
,
"Test14a"
);
verify_reg_nonexist
(
hkey
,
"Test14a"
);
verify_reg_nonexist
(
hkey
,
"Test14b"
);
verify_reg_nonexist
(
hkey
,
"Test14c"
);
...
...
@@ -577,7 +577,7 @@ static void test_comments(void)
todo_wine
verify_reg
(
hkey
,
"Wine4"
,
REG_SZ
,
"Value 2"
,
8
,
0
);
verify_reg_nonexist
(
hkey
,
"Wine5"
);
dword
=
0x2040608
;
todo_wine
verify_reg
(
hkey
,
"Wine6"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
0
);
verify_reg
(
hkey
,
"Wine6"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
0
);
exec_import_str
(
"REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
...
...
@@ -637,7 +637,7 @@ static void test_comments(void)
verify_reg_nonexist
(
hkey
,
"Wine22"
);
verify_reg_nonexist
(
hkey
,
"Wine23"
);
dword
=
0x00000004
;
todo_wine
verify_reg
(
hkey
,
"Wine24"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
0
);
verify_reg
(
hkey
,
"Wine24"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
0
);
exec_import_str
(
"REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
...
...
@@ -646,8 +646,8 @@ static void test_comments(void)
"
\"
Wine25c
\"
=dword:1234#5678
\n
"
"
\"
Wine25d
\"
=dword:1234 #5678
\n\n
"
);
dword
=
0x1234
;
todo_wine
verify_reg
(
hkey
,
"Wine25a"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
0
);
todo_wine
verify_reg
(
hkey
,
"Wine25b"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
0
);
verify_reg
(
hkey
,
"Wine25a"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
0
);
verify_reg
(
hkey
,
"Wine25b"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
0
);
verify_reg_nonexist
(
hkey
,
"Wine25c"
);
verify_reg_nonexist
(
hkey
,
"Wine25d"
);
...
...
@@ -809,8 +809,8 @@ static void test_import_with_whitespace(void)
"
\"
Wine9a
\"
=dword: 00000008
\n
"
"
\"
Wine9b
\"
=dword:
\t\t
00000008
\n\n
"
);
dword
=
0x00000008
;
todo_wine
verify_reg
(
hkey
,
"Wine9a"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
0
);
todo_wine
verify_reg
(
hkey
,
"Wine9b"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
0
);
verify_reg
(
hkey
,
"Wine9a"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
0
);
verify_reg
(
hkey
,
"Wine9b"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
0
);
lr
=
RegCloseKey
(
hkey
);
ok
(
lr
==
ERROR_SUCCESS
,
"RegCloseKey failed: got %d, expected 0
\n
"
,
lr
);
...
...
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