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
2f658cb3
Commit
2f658cb3
authored
Feb 04, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Feb 05, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Fix handling of the NULL separator when writing registry values.
parent
1ce79f87
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
0 deletions
+85
-0
action.c
dlls/msi/action.c
+24
-0
install.c
dlls/msi/tests/install.c
+61
-0
No files found.
dlls/msi/action.c
View file @
2f658cb3
...
...
@@ -2240,6 +2240,7 @@ static LPSTR parse_value(MSIPACKAGE *package, LPCWSTR value, DWORD *type,
DWORD
*
size
)
{
LPSTR
data
=
NULL
;
if
(
value
[
0
]
==
'#'
&&
value
[
1
]
!=
'#'
&&
value
[
1
]
!=
'%'
)
{
if
(
value
[
1
]
==
'x'
)
...
...
@@ -2321,6 +2322,7 @@ static LPSTR parse_value(MSIPACKAGE *package, LPCWSTR value, DWORD *type,
{
static
const
WCHAR
szMulti
[]
=
{
'['
,
'~'
,
']'
,
0
};
LPCWSTR
ptr
;
LPWSTR
newdata
;
*
type
=
REG_SZ
;
if
(
value
[
0
]
==
'#'
)
...
...
@@ -2339,7 +2341,29 @@ static LPSTR parse_value(MSIPACKAGE *package, LPCWSTR value, DWORD *type,
if
(
strstrW
(
value
,
szMulti
))
*
type
=
REG_MULTI_SZ
;
/* remove initial delimiter */
if
(
!
strncmpW
(
value
,
szMulti
,
3
))
ptr
=
value
+
3
;
*
size
=
deformat_string
(
package
,
ptr
,(
LPWSTR
*
)
&
data
);
/* add double NULL terminator */
if
(
*
type
==
REG_MULTI_SZ
)
{
*
size
+=
sizeof
(
WCHAR
);
newdata
=
msi_alloc
(
*
size
);
if
(
!
newdata
)
{
msi_free
(
data
);
return
NULL
;
}
memcpy
(
newdata
,
data
,
*
size
-
1
);
newdata
[
*
size
]
=
'\0'
;
msi_free
(
data
);
data
=
(
LPSTR
)
newdata
;
}
}
return
data
;
}
...
...
dlls/msi/tests/install.c
View file @
2f658cb3
...
...
@@ -576,6 +576,16 @@ static const CHAR df_duplicate_file_dat[] = "FileKey\tComponent_\tFile_\tDestNam
"maximus
\t
maximus
\t
maximus
\t
augustus
\t\n
"
"caesar
\t
maximus
\t
maximus
\t\t
NONEXISTENT
\n
"
;
static
const
CHAR
wrv_component_dat
[]
=
"Component
\t
ComponentId
\t
Directory_
\t
Attributes
\t
Condition
\t
KeyPath
\n
"
"s72
\t
S38
\t
s72
\t
i2
\t
S255
\t
S72
\n
"
"Component
\t
Component
\n
"
"augustus
\t\t
MSITESTDIR
\t
0
\t\t
augustus
\n
"
;
static
const
CHAR
wrv_registry_dat
[]
=
"Registry
\t
Root
\t
Key
\t
Name
\t
Value
\t
Component_
\n
"
"s72
\t
i2
\t
l255
\t
L255
\t
L0
\t
s72
\n
"
"Registry
\t
Registry
\n
"
"regdata
\t
2
\t
SOFTWARE
\\
Wine
\\
msitest
\t
Value
\t
[~]one[~]two[~]three
\t
augustus"
;
typedef
struct
_msi_table
{
const
CHAR
*
filename
;
...
...
@@ -864,6 +874,19 @@ static const msi_table df_tables[] =
ADD_TABLE
(
df_duplicate_file
),
};
static
const
msi_table
wrv_tables
[]
=
{
ADD_TABLE
(
wrv_component
),
ADD_TABLE
(
directory
),
ADD_TABLE
(
rof_feature
),
ADD_TABLE
(
ci2_feature_comp
),
ADD_TABLE
(
ci2_file
),
ADD_TABLE
(
install_exec_seq
),
ADD_TABLE
(
rof_media
),
ADD_TABLE
(
property
),
ADD_TABLE
(
wrv_registry
),
};
/* cabinet definitions */
/* make the max size large so there is only one cab file */
...
...
@@ -3625,6 +3648,43 @@ static void test_duplicatefiles(void)
DeleteFile
(
msifile
);
}
static
void
test_writeregistryvalues
(
void
)
{
UINT
r
;
LONG
res
;
HKEY
hkey
;
DWORD
type
,
size
;
CHAR
path
[
MAX_PATH
];
CreateDirectoryA
(
"msitest"
,
NULL
);
create_file
(
"msitest
\\
augustus"
,
500
);
create_database
(
msifile
,
wrv_tables
,
sizeof
(
wrv_tables
)
/
sizeof
(
msi_table
));
MsiSetInternalUI
(
INSTALLUILEVEL_NONE
,
NULL
);
r
=
MsiInstallProductA
(
msifile
,
NULL
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
ok
(
delete_pf
(
"msitest
\\
augustus"
,
TRUE
),
"File installed
\n
"
);
ok
(
delete_pf
(
"msitest"
,
FALSE
),
"File installed
\n
"
);
res
=
RegOpenKey
(
HKEY_LOCAL_MACHINE
,
"SOFTWARE
\\
Wine
\\
msitest"
,
&
hkey
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
size
=
MAX_PATH
;
type
=
REG_MULTI_SZ
;
memset
(
path
,
'a'
,
MAX_PATH
);
res
=
RegQueryValueExA
(
hkey
,
"Value"
,
NULL
,
&
type
,
(
LPBYTE
)
path
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
ok
(
!
memcmp
(
path
,
"one
\0
two
\0
three
\0\0
"
,
size
),
"Wrong multi-sz data
\n
"
);
ok
(
size
==
15
,
"Expected 15, got %d
\n
"
,
size
);
ok
(
type
==
REG_MULTI_SZ
,
"Expected REG_MULTI_SZ, got %d
\n
"
,
type
);
DeleteFile
(
msifile
);
DeleteFile
(
"msitest
\\
augustus"
);
RemoveDirectory
(
"msitest"
);
}
START_TEST
(
install
)
{
DWORD
len
;
...
...
@@ -3667,6 +3727,7 @@ START_TEST(install)
test_movefiles
();
test_missingcab
();
test_duplicatefiles
();
test_writeregistryvalues
();
SetCurrentDirectoryA
(
prev_path
);
}
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