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
c35bca65
Commit
c35bca65
authored
Oct 29, 2014
by
Bruno Jesus
Committed by
Alexandre Julliard
Oct 29, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Allow importing strings with escaped NULL.
parent
edc259fd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
13 deletions
+8
-13
regproc.c
programs/regedit/regproc.c
+8
-13
No files found.
programs/regedit/regproc.c
View file @
c35bca65
...
...
@@ -255,7 +255,7 @@ static DWORD getDataType(LPWSTR *lpValue, DWORD* parse_type)
/******************************************************************************
* Replaces escape sequences with the characters.
*/
static
void
REGPROC_unescape_string
(
WCHAR
*
str
)
static
int
REGPROC_unescape_string
(
WCHAR
*
str
)
{
int
str_idx
=
0
;
/* current character under analysis */
int
val_idx
=
0
;
/* the last character of the unescaped string */
...
...
@@ -267,6 +267,9 @@ static void REGPROC_unescape_string(WCHAR* str)
case
'n'
:
str
[
val_idx
]
=
'\n'
;
break
;
case
'0'
:
str
[
val_idx
]
=
'\0'
;
break
;
case
'\\'
:
case
'"'
:
str
[
val_idx
]
=
str
[
str_idx
];
...
...
@@ -282,6 +285,7 @@ static void REGPROC_unescape_string(WCHAR* str)
}
}
str
[
val_idx
]
=
'\0'
;
return
val_idx
;
}
static
BOOL
parseKeyName
(
LPWSTR
lpKeyName
,
HKEY
*
hKey
,
LPWSTR
*
lpKeyPath
)
...
...
@@ -364,19 +368,10 @@ static LONG setValue(WCHAR* val_name, WCHAR* val_data, BOOL is_unicode)
if
(
dwParseType
==
REG_SZ
)
/* no conversion for string */
{
REGPROC_unescape_string
(
val_data
);
/* Compute dwLen after REGPROC_unescape_string because it may
* have changed the string length and we don't want to store
* the extra garbage in the registry.
*/
dwLen
=
lstrlenW
(
val_data
);
if
(
val_data
[
dwLen
-
1
]
!=
'"'
)
dwLen
=
REGPROC_unescape_string
(
val_data
);
if
(
!
dwLen
||
val_data
[
dwLen
-
1
]
!=
'"'
)
return
ERROR_INVALID_DATA
;
if
(
dwLen
>
0
&&
val_data
[
dwLen
-
1
]
==
'"'
)
{
dwLen
--
;
val_data
[
dwLen
]
=
'\0'
;
}
val_data
[
dwLen
-
1
]
=
'\0'
;
/* remove last quotes */
lpbData
=
(
BYTE
*
)
val_data
;
dwLen
++
;
/* include terminating null */
dwLen
=
dwLen
*
sizeof
(
WCHAR
);
/* size is in bytes */
...
...
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