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
7f57d8f1
Commit
7f57d8f1
authored
Oct 30, 2014
by
Hans Leidekker
Committed by
Alexandre Julliard
Oct 31, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Format registry values before interpreting value type.
parent
ed79b3f9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
16 deletions
+58
-16
action.c
dlls/msi/action.c
+10
-14
action.c
dlls/msi/tests/action.c
+48
-2
No files found.
dlls/msi/action.c
View file @
7f57d8f1
...
...
@@ -2438,9 +2438,9 @@ static UINT ACTION_CostFinalize(MSIPACKAGE *package)
return
MSI_SetFeatureStates
(
package
);
}
static
BYTE
*
parse_value
(
MSIPACKAGE
*
package
,
const
WCHAR
*
value
,
DWORD
*
type
,
DWORD
*
size
)
static
BYTE
*
parse_value
(
MSIPACKAGE
*
package
,
const
WCHAR
*
value
,
DWORD
len
,
DWORD
*
type
,
DWORD
*
size
)
{
BYTE
*
data
=
NULL
;
BYTE
*
data
;
if
(
!
value
)
{
...
...
@@ -2529,19 +2529,18 @@ static BYTE *parse_value( MSIPACKAGE *package, const WCHAR *value, DWORD *type,
else
{
const
WCHAR
*
ptr
=
value
;
DWORD
len
;
*
type
=
REG_SZ
;
if
(
value
[
0
]
==
'#'
)
{
ptr
++
;
ptr
++
;
len
--
;
if
(
value
[
1
]
==
'%'
)
{
ptr
++
;
ptr
++
;
len
--
;
*
type
=
REG_EXPAND_SZ
;
}
}
len
=
deformat_string
(
package
,
ptr
,
(
WCHAR
**
)
&
data
);
data
=
(
BYTE
*
)
msi_strdupW
(
ptr
,
len
);
if
(
len
>
strlenW
(
(
const
WCHAR
*
)
data
))
*
type
=
REG_MULTI_SZ
;
*
size
=
(
len
+
1
)
*
sizeof
(
WCHAR
);
}
...
...
@@ -2872,14 +2871,11 @@ static UINT ITERATE_WriteRegistryValues(MSIRECORD *row, LPVOID param)
msi_free
(
keypath
);
return
ERROR_FUNCTION_FAILED
;
}
str
=
msi_record_get_string
(
row
,
5
,
&
len
);
if
(
str
&&
len
>
strlenW
(
str
))
{
type
=
REG_MULTI_SZ
;
new_size
=
(
len
+
1
)
*
sizeof
(
WCHAR
);
new_value
=
(
BYTE
*
)
msi_strdupW
(
str
,
len
);
}
else
new_value
=
parse_value
(
package
,
str
,
&
type
,
&
new_size
);
str
=
msi_record_get_string
(
row
,
5
,
NULL
);
len
=
deformat_string
(
package
,
str
,
&
deformated
);
new_value
=
parse_value
(
package
,
deformated
,
len
,
&
type
,
&
new_size
);
msi_free
(
deformated
);
deformat_string
(
package
,
name
,
&
deformated
);
if
(
!
is_special_entry
(
name
))
...
...
dlls/msi/tests/action.c
View file @
7f57d8f1
...
...
@@ -186,7 +186,8 @@ static const char property_dat[] =
"SERVNAME2
\t
TestService2
\n
"
"SERVDISP
\t
TestServiceDisp
\n
"
"SERVDISP2
\t
TestServiceDisp2
\n
"
"MSIFASTINSTALL
\t
1
\n
"
;
"MSIFASTINSTALL
\t
1
\n
"
"regdata15
\t
#x01
\n
"
;
static
const
char
environment_dat
[]
=
"Environment
\t
Name
\t
Value
\t
Component_
\n
"
...
...
@@ -514,7 +515,11 @@ static const char wrv_registry_dat[] =
"regdata8
\t
2
\t
SOFTWARE
\\
Wine
\\
msitest
\t
Value4
\t
one[~]two
\t
augustus
\n
"
"regdata9
\t
2
\t
SOFTWARE
\\
Wine
\\
msitest
\t
Value5
\t
[~]one[~]two[~]three
\t
augustus
\n
"
"regdata10
\t
2
\t
SOFTWARE
\\
Wine
\\
msitest
\t
Value6
\t
[~]
\t
augustus
\n
"
"regdata11
\t
2
\t
SOFTWARE
\\
Wine
\\
msitest
\t
Value7
\t
[~]two
\t
augustus
\n
"
;
"regdata11
\t
2
\t
SOFTWARE
\\
Wine
\\
msitest
\t
Value7
\t
[~]two
\t
augustus
\n
"
"regdata12
\t
2
\t
SOFTWARE
\\
Wine
\\
msitest
\t
Value8
\t
#1
\t
augustus
\n
"
"regdata13
\t
2
\t
SOFTWARE
\\
Wine
\\
msitest
\t
Value9
\t
#x1
\t
augustus
\n
"
"regdata14
\t
2
\t
SOFTWARE
\\
Wine
\\
msitest
\t
Value10
\t
#x01
\t
augustus
\n
"
"regdata15
\t
2
\t
SOFTWARE
\\
Wine
\\
msitest
\t
Value11
\t
[regdata15]
\t
augustus
\n
"
;
static
const
char
cf_directory_dat
[]
=
"Directory
\t
Directory_Parent
\t
DefaultDir
\n
"
...
...
@@ -4923,6 +4928,7 @@ static void test_write_registry_values(void)
HKEY
hkey
;
DWORD
type
,
size
;
CHAR
path
[
MAX_PATH
];
BYTE
buf
[
8
];
if
(
is_process_limited
())
{
...
...
@@ -5055,6 +5061,42 @@ static void test_write_registry_values(void)
ok
(
size
==
5
,
"Expected 5, got %d
\n
"
,
size
);
ok
(
type
==
REG_MULTI_SZ
,
"Expected REG_MULTI_SZ, got %d
\n
"
,
type
);
size
=
sizeof
(
buf
);
type
=
0xdeadbeef
;
memset
(
buf
,
0
,
size
);
res
=
RegQueryValueExA
(
hkey
,
"Value8"
,
NULL
,
&
type
,
buf
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"got %u
\n
"
,
res
);
ok
(
*
(
DWORD
*
)
buf
==
1
,
"got %u
\n
"
,
*
(
DWORD
*
)
buf
);
ok
(
size
==
4
,
"got %u
\n
"
,
size
);
ok
(
type
==
REG_DWORD
,
"got %u
\n
"
,
type
);
size
=
sizeof
(
buf
);
type
=
0xdeadbeef
;
memset
(
buf
,
0
,
size
);
res
=
RegQueryValueExA
(
hkey
,
"Value9"
,
NULL
,
&
type
,
buf
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"got %u
\n
"
,
res
);
ok
(
buf
[
0
]
==
1
,
"got %u
\n
"
,
buf
[
0
]);
ok
(
size
==
1
,
"got %u
\n
"
,
size
);
ok
(
type
==
REG_BINARY
,
"got %u
\n
"
,
type
);
size
=
sizeof
(
buf
);
type
=
0xdeadbeef
;
memset
(
buf
,
0
,
size
);
res
=
RegQueryValueExA
(
hkey
,
"Value10"
,
NULL
,
&
type
,
buf
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"got %u
\n
"
,
res
);
ok
(
buf
[
0
]
==
1
,
"got %u
\n
"
,
buf
[
0
]);
ok
(
size
==
1
,
"got %u
\n
"
,
size
);
ok
(
type
==
REG_BINARY
,
"got %u
\n
"
,
type
);
size
=
sizeof
(
buf
);
type
=
0xdeadbeef
;
memset
(
buf
,
0
,
size
);
res
=
RegQueryValueExA
(
hkey
,
"Value11"
,
NULL
,
&
type
,
buf
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"got %u
\n
"
,
res
);
ok
(
buf
[
0
]
==
1
,
"got %u
\n
"
,
buf
[
0
]);
ok
(
size
==
1
,
"got %u
\n
"
,
size
);
ok
(
type
==
REG_BINARY
,
"got %u
\n
"
,
type
);
RegDeleteValueA
(
hkey
,
"Value"
);
RegDeleteValueA
(
hkey
,
"Value1"
);
RegDeleteValueA
(
hkey
,
"Value2"
);
...
...
@@ -5063,6 +5105,10 @@ static void test_write_registry_values(void)
RegDeleteValueA
(
hkey
,
"Value5"
);
RegDeleteValueA
(
hkey
,
"Value6"
);
RegDeleteValueA
(
hkey
,
"Value7"
);
RegDeleteValueA
(
hkey
,
"Value8"
);
RegDeleteValueA
(
hkey
,
"Value9"
);
RegDeleteValueA
(
hkey
,
"Value10"
);
RegDeleteValueA
(
hkey
,
"Value11"
);
RegCloseKey
(
hkey
);
RegDeleteKeyA
(
HKEY_LOCAL_MACHINE
,
"SOFTWARE
\\
Wine
\\
msitest"
);
...
...
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