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
b0d475b8
Commit
b0d475b8
authored
Jan 29, 2017
by
Zebediah Figura
Committed by
Alexandre Julliard
Jan 30, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Add support for importing Win 3.1 registry files.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0d23bfd3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
3 deletions
+64
-3
regproc.c
programs/regedit/regproc.c
+64
-3
No files found.
programs/regedit/regproc.c
View file @
b0d475b8
...
...
@@ -608,6 +608,49 @@ static void processRegEntry(WCHAR* stdInput, BOOL isUnicode)
}
}
/* version for Windows 3.1 */
static
void
processRegEntry31
(
WCHAR
*
line
)
{
int
key_end
=
0
;
WCHAR
*
value
;
int
res
;
static
WCHAR
empty
[]
=
{
0
};
if
(
line
[
0
]
==
'\0'
)
return
;
/* get key name */
while
(
line
[
key_end
]
&&
!
isspaceW
(
line
[
key_end
]))
key_end
++
;
value
=
line
+
key_end
;
while
(
isspaceW
(
value
[
0
]))
value
++
;
if
(
value
[
0
]
==
'='
)
value
++
;
if
(
value
[
0
]
==
' '
)
value
++
;
/* at most one space is skipped */
line
[
key_end
]
=
'\0'
;
if
(
openKeyW
(
line
)
!=
ERROR_SUCCESS
)
output_message
(
STRING_OPEN_KEY_FAILED
,
line
);
res
=
RegSetValueExW
(
currentKeyHandle
,
empty
,
0
,
/* Reserved */
REG_SZ
,
(
BYTE
*
)
value
,
(
strlenW
(
value
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
res
!=
ERROR_SUCCESS
)
output_message
(
STRING_SETVALUE_FAILED
,
empty
,
currentKeyName
);
closeKey
();
}
/* version constants */
#define REG_VERSION_31 3
#define REG_VERSION_40 4
#define REG_VERSION_50 5
/******************************************************************************
* Processes a registry file.
* Correctly processes comments (in # and ; form), line continuation.
...
...
@@ -624,6 +667,11 @@ static void processRegLinesA(FILE *in, char* first_chars)
char
*
s
;
/* A pointer to buf for fread */
char
*
line
;
/* The start of the current line */
WCHAR
*
lineW
;
unsigned
long
version
=
0
;
static
const
char
header_31
[]
=
"REGEDIT"
;
static
const
char
header_40
[]
=
"REGEDIT4"
;
static
const
char
header_50
[]
=
"Windows Registry Editor Version 5.00"
;
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
line_size
);
CHECK_ENOUGH_MEMORY
(
buf
);
...
...
@@ -720,9 +768,22 @@ static void processRegLinesA(FILE *in, char* first_chars)
*
s_eol
++
=
'\0'
;
*
s_eol
=
'\0'
;
lineW
=
GetWideString
(
line
);
processRegEntry
(
lineW
,
FALSE
);
HeapFree
(
GetProcessHeap
(),
0
,
lineW
);
/* Check if the line is a header string */
if
(
!
memcmp
(
line
,
header_31
,
sizeof
(
header_31
)))
{
version
=
REG_VERSION_31
;
}
else
if
(
!
memcmp
(
line
,
header_40
,
sizeof
(
header_40
)))
{
version
=
REG_VERSION_40
;
}
else
if
(
!
memcmp
(
line
,
header_50
,
sizeof
(
header_50
)))
{
version
=
REG_VERSION_50
;
}
else
{
lineW
=
GetWideString
(
line
);
if
(
version
==
REG_VERSION_31
)
{
processRegEntry31
(
lineW
);
}
else
if
(
version
==
REG_VERSION_40
||
version
==
REG_VERSION_50
)
{
processRegEntry
(
lineW
,
FALSE
);
}
HeapFree
(
GetProcessHeap
(),
0
,
lineW
);
}
line
=
s_eol
+
1
;
}
}
...
...
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