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
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)
* line - registry file unwrapped line. Should have the registry value name and
* complete registry value data.
*/
static
void
processSetValue
(
LPSTR
line
)
static
void
processSetValue
(
WCHAR
*
line
)
{
LPSTR
val_name
;
/* registry value name */
LPSTR
val_data
;
/* registry value data */
WCHAR
*
val_nameW
;
WCHAR
*
val_dataW
;
WCHAR
*
val_name
;
/* registry value name */
WCHAR
*
val_data
;
/* registry value data */
int
line_idx
=
0
;
/* current character under analysis */
LONG
res
;
...
...
@@ -508,37 +505,44 @@ static void processSetValue(LPSTR line)
}
}
if
(
line
[
line_idx
]
!=
'='
)
{
char
*
lineA
;
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
;
}
}
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
;
}
line_idx
++
;
/* skip the '=' character */
val_data
=
line
+
line_idx
;
val_nameW
=
GetWideString
(
val_name
);
val_dataW
=
GetWideString
(
val_data
);
REGPROC_unescape_string
(
val_nameW
);
res
=
setValue
(
val_nameW
,
val_dataW
);
HeapFree
(
GetProcessHeap
(),
0
,
val_nameW
);
HeapFree
(
GetProcessHeap
(),
0
,
val_dataW
);
REGPROC_unescape_string
(
val_name
);
res
=
setValue
(
val_name
,
val_data
);
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
"
,
getAppName
(),
currentKeyName
,
val_name
,
val_data
);
val_nameA
,
val_dataA
);
HeapFree
(
GetProcessHeap
(),
0
,
val_nameA
);
HeapFree
(
GetProcessHeap
(),
0
,
val_dataA
);
}
}
/******************************************************************************
* This function receives the currently read entry and performs the
* corresponding action.
*/
static
void
processRegEntry
(
LPSTR
stdInput
)
static
void
processRegEntry
(
WCHAR
*
stdInput
)
{
/*
* We encountered the end of the file, make sure we
...
...
@@ -551,28 +555,24 @@ static void processRegEntry(LPSTR stdInput)
if
(
stdInput
[
0
]
==
'['
)
/* We are reading a new key */
{
LPSTR
keyEnd
;
WCHAR
*
stdInputW
;
WCHAR
*
keyEnd
;
closeKey
();
/* Close the previous key */
/* Get rid of the square brackets */
stdInput
++
;
keyEnd
=
strrchr
(
stdInput
,
']'
);
keyEnd
=
strrchr
W
(
stdInput
,
']'
);
if
(
keyEnd
)
*
keyEnd
=
'\0'
;
stdInputW
=
GetWideString
(
stdInput
);
/* delete the key if we encounter '-' at the start of reg key */
if
(
stdInput
[
0
]
==
'-'
)
{
delete_registry_key
(
stdInput
W
+
1
);
}
else
if
(
openKeyW
(
stdInput
W
)
!=
ERROR_SUCCESS
)
delete_registry_key
(
stdInput
+
1
);
}
else
if
(
openKeyW
(
stdInput
)
!=
ERROR_SUCCESS
)
{
fprintf
(
stderr
,
"%s: setValue failed to open key %s
\n
"
,
getAppName
(),
stdInput
);
}
HeapFree
(
GetProcessHeap
(),
0
,
stdInputW
);
}
else
if
(
currentKeyHandle
&&
((
stdInput
[
0
]
==
'@'
)
||
/* reading a default @=data pair */
(
stdInput
[
0
]
==
'\"'
)))
/* reading a new value=data pair */
...
...
@@ -606,6 +606,7 @@ void processRegLines(FILE *in)
while
(
!
feof
(
in
))
{
LPSTR
s
;
/* The pointer into line for where the current fgets should read */
LPSTR
check
;
WCHAR
*
lineW
;
s
=
line
;
for
(;;)
{
size_t
size_remaining
;
...
...
@@ -711,10 +712,13 @@ void processRegLines(FILE *in)
continue
;
}
lineW
=
GetWideString
(
line
);
break
;
/* That is the full virtual line */
}
processRegEntry
(
line
);
processRegEntry
(
lineW
);
HeapFree
(
GetProcessHeap
(),
0
,
lineW
);
}
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