Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
9d608490
Commit
9d608490
authored
Jul 09, 2008
by
Alexander Nicolaysen Sørnes
Committed by
Alexandre Julliard
Jul 10, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Convert remaining registry import code to Unicode.
parent
db074ee9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
26 deletions
+30
-26
regproc.c
programs/regedit/regproc.c
+30
-26
No files found.
programs/regedit/regproc.c
View file @
9d608490
...
@@ -475,13 +475,10 @@ static void closeKey(void)
...
@@ -475,13 +475,10 @@ static void closeKey(void)
* line - registry file unwrapped line. Should have the registry value name and
* line - registry file unwrapped line. Should have the registry value name and
* complete registry value data.
* complete registry value data.
*/
*/
static
void
processSetValue
(
LPSTR
line
)
static
void
processSetValue
(
WCHAR
*
line
)
{
{
LPSTR
val_name
;
/* registry value name */
WCHAR
*
val_name
;
/* registry value name */
LPSTR
val_data
;
/* registry value data */
WCHAR
*
val_data
;
/* registry value data */
WCHAR
*
val_nameW
;
WCHAR
*
val_dataW
;
int
line_idx
=
0
;
/* current character under analysis */
int
line_idx
=
0
;
/* current character under analysis */
LONG
res
;
LONG
res
;
...
@@ -508,37 +505,44 @@ static void processSetValue(LPSTR line)
...
@@ -508,37 +505,44 @@ static void processSetValue(LPSTR line)
}
}
}
}
if
(
line
[
line_idx
]
!=
'='
)
{
if
(
line
[
line_idx
]
!=
'='
)
{
char
*
lineA
;
line
[
line_idx
]
=
'\"'
;
line
[
line_idx
]
=
'\"'
;
fprintf
(
stderr
,
"Warning! unrecognized line:
\n
%s
\n
"
,
line
);
lineA
=
GetMultiByteString
(
line
);
fprintf
(
stderr
,
"Warning! unrecognized line:
\n
%s
\n
"
,
lineA
);
HeapFree
(
GetProcessHeap
(),
0
,
lineA
);
return
;
return
;
}
}
}
else
{
}
else
{
fprintf
(
stderr
,
"Warning! unrecognized line:
\n
%s
\n
"
,
line
);
char
*
lineA
=
GetMultiByteString
(
line
);
fprintf
(
stderr
,
"Warning! unrecognized line:
\n
%s
\n
"
,
lineA
);
HeapFree
(
GetProcessHeap
(),
0
,
lineA
);
return
;
return
;
}
}
line_idx
++
;
/* skip the '=' character */
line_idx
++
;
/* skip the '=' character */
val_data
=
line
+
line_idx
;
val_data
=
line
+
line_idx
;
val_nameW
=
GetWideString
(
val_name
);
REGPROC_unescape_string
(
val_name
);
val_dataW
=
GetWideString
(
val_data
);
res
=
setValue
(
val_name
,
val_data
);
REGPROC_unescape_string
(
val_nameW
);
res
=
setValue
(
val_nameW
,
val_dataW
);
HeapFree
(
GetProcessHeap
(),
0
,
val_nameW
);
HeapFree
(
GetProcessHeap
(),
0
,
val_dataW
);
if
(
res
!=
ERROR_SUCCESS
)
if
(
res
!=
ERROR_SUCCESS
)
{
char
*
val_nameA
=
GetMultiByteString
(
val_name
);
char
*
val_dataA
=
GetMultiByteString
(
val_data
);
fprintf
(
stderr
,
"%s: ERROR Key %s not created. Value: %s, Data: %s
\n
"
,
fprintf
(
stderr
,
"%s: ERROR Key %s not created. Value: %s, Data: %s
\n
"
,
getAppName
(),
getAppName
(),
currentKeyName
,
currentKeyName
,
val_name
,
val_nameA
,
val_data
);
val_dataA
);
HeapFree
(
GetProcessHeap
(),
0
,
val_nameA
);
HeapFree
(
GetProcessHeap
(),
0
,
val_dataA
);
}
}
}
/******************************************************************************
/******************************************************************************
* This function receives the currently read entry and performs the
* This function receives the currently read entry and performs the
* corresponding action.
* corresponding action.
*/
*/
static
void
processRegEntry
(
LPSTR
stdInput
)
static
void
processRegEntry
(
WCHAR
*
stdInput
)
{
{
/*
/*
* We encountered the end of the file, make sure we
* We encountered the end of the file, make sure we
...
@@ -551,28 +555,24 @@ static void processRegEntry(LPSTR stdInput)
...
@@ -551,28 +555,24 @@ static void processRegEntry(LPSTR stdInput)
if
(
stdInput
[
0
]
==
'['
)
/* We are reading a new key */
if
(
stdInput
[
0
]
==
'['
)
/* We are reading a new key */
{
{
LPSTR
keyEnd
;
WCHAR
*
keyEnd
;
WCHAR
*
stdInputW
;
closeKey
();
/* Close the previous key */
closeKey
();
/* Close the previous key */
/* Get rid of the square brackets */
/* Get rid of the square brackets */
stdInput
++
;
stdInput
++
;
keyEnd
=
strrchr
(
stdInput
,
']'
);
keyEnd
=
strrchr
W
(
stdInput
,
']'
);
if
(
keyEnd
)
if
(
keyEnd
)
*
keyEnd
=
'\0'
;
*
keyEnd
=
'\0'
;
stdInputW
=
GetWideString
(
stdInput
);
/* delete the key if we encounter '-' at the start of reg key */
/* delete the key if we encounter '-' at the start of reg key */
if
(
stdInput
[
0
]
==
'-'
)
if
(
stdInput
[
0
]
==
'-'
)
{
{
delete_registry_key
(
stdInput
W
+
1
);
delete_registry_key
(
stdInput
+
1
);
}
else
if
(
openKeyW
(
stdInput
W
)
!=
ERROR_SUCCESS
)
}
else
if
(
openKeyW
(
stdInput
)
!=
ERROR_SUCCESS
)
{
{
fprintf
(
stderr
,
"%s: setValue failed to open key %s
\n
"
,
fprintf
(
stderr
,
"%s: setValue failed to open key %s
\n
"
,
getAppName
(),
stdInput
);
getAppName
(),
stdInput
);
}
}
HeapFree
(
GetProcessHeap
(),
0
,
stdInputW
);
}
else
if
(
currentKeyHandle
&&
}
else
if
(
currentKeyHandle
&&
((
stdInput
[
0
]
==
'@'
)
||
/* reading a default @=data pair */
((
stdInput
[
0
]
==
'@'
)
||
/* reading a default @=data pair */
(
stdInput
[
0
]
==
'\"'
)))
/* reading a new value=data pair */
(
stdInput
[
0
]
==
'\"'
)))
/* reading a new value=data pair */
...
@@ -606,6 +606,7 @@ void processRegLines(FILE *in)
...
@@ -606,6 +606,7 @@ void processRegLines(FILE *in)
while
(
!
feof
(
in
))
{
while
(
!
feof
(
in
))
{
LPSTR
s
;
/* The pointer into line for where the current fgets should read */
LPSTR
s
;
/* The pointer into line for where the current fgets should read */
LPSTR
check
;
LPSTR
check
;
WCHAR
*
lineW
;
s
=
line
;
s
=
line
;
for
(;;)
{
for
(;;)
{
size_t
size_remaining
;
size_t
size_remaining
;
...
@@ -711,10 +712,13 @@ void processRegLines(FILE *in)
...
@@ -711,10 +712,13 @@ void processRegLines(FILE *in)
continue
;
continue
;
}
}
lineW
=
GetWideString
(
line
);
break
;
/* That is the full virtual line */
break
;
/* That is the full virtual line */
}
}
processRegEntry
(
line
);
processRegEntry
(
lineW
);
HeapFree
(
GetProcessHeap
(),
0
,
lineW
);
}
}
processRegEntry
(
NULL
);
processRegEntry
(
NULL
);
...
...
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