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
bbdf79bc
Commit
bbdf79bc
authored
Feb 16, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Feb 18, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Convert REG_DWORD properties to strings in MsiGetProductInfo.
parent
8412a136
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
451 additions
and
8 deletions
+451
-8
msi.c
dlls/msi/msi.c
+28
-5
msi.c
dlls/msi/tests/msi.c
+423
-3
No files found.
dlls/msi/msi.c
View file @
bbdf79bc
...
...
@@ -561,6 +561,28 @@ done:
return
rc
;
}
static
LPWSTR
msi_reg_get_value
(
HKEY
hkey
,
LPCWSTR
name
,
DWORD
*
type
)
{
DWORD
dval
;
LONG
res
;
WCHAR
temp
[
20
];
static
const
WCHAR
format
[]
=
{
'%'
,
'd'
,
0
};
res
=
RegQueryValueExW
(
hkey
,
name
,
NULL
,
type
,
NULL
,
NULL
);
if
(
res
!=
ERROR_SUCCESS
)
return
NULL
;
if
(
*
type
==
REG_SZ
)
return
msi_reg_get_val_str
(
hkey
,
name
);
if
(
!
msi_reg_get_val_dword
(
hkey
,
name
,
&
dval
))
return
NULL
;
sprintfW
(
temp
,
format
,
dval
);
return
strdupW
(
temp
);
}
static
UINT
WINAPI
MSI_GetProductInfo
(
LPCWSTR
szProduct
,
LPCWSTR
szAttribute
,
awstring
*
szValue
,
LPDWORD
pcchValueBuf
)
{
...
...
@@ -572,7 +594,7 @@ static UINT WINAPI MSI_GetProductInfo(LPCWSTR szProduct, LPCWSTR szAttribute,
BOOL
classes
=
FALSE
;
BOOL
badconfig
=
FALSE
;
LONG
res
;
DWORD
save
;
DWORD
save
,
type
;
static
WCHAR
empty
[]
=
{
0
};
static
const
WCHAR
sourcelist
[]
=
{
...
...
@@ -641,7 +663,7 @@ static UINT WINAPI MSI_GetProductInfo(LPCWSTR szProduct, LPCWSTR szAttribute,
else
if
(
!
lstrcmpW
(
szAttribute
,
INSTALLPROPERTY_VERSIONSTRINGW
))
szAttribute
=
display_version
;
val
=
msi_reg_get_val
_str
(
userdata
,
szAttribut
e
);
val
=
msi_reg_get_val
ue
(
userdata
,
szAttribute
,
&
typ
e
);
if
(
!
val
)
val
=
empty
;
}
...
...
@@ -669,18 +691,19 @@ static UINT WINAPI MSI_GetProductInfo(LPCWSTR szProduct, LPCWSTR szAttribute,
{
res
=
RegOpenKeyW
(
prodkey
,
sourcelist
,
&
source
);
if
(
res
==
ERROR_SUCCESS
)
val
=
msi_reg_get_val
_str
(
source
,
szAttribut
e
);
val
=
msi_reg_get_val
ue
(
source
,
szAttribute
,
&
typ
e
);
RegCloseKey
(
source
);
}
else
{
val
=
msi_reg_get_val
_str
(
prodkey
,
szAttribut
e
);
val
=
msi_reg_get_val
ue
(
prodkey
,
szAttribute
,
&
typ
e
);
if
(
!
val
)
val
=
empty
;
}
if
(
val
!=
empty
&&
!
lstrcmpW
(
szAttribute
,
INSTALLPROPERTY_PACKAGECODEW
))
if
(
val
!=
empty
&&
type
!=
REG_DWORD
&&
!
lstrcmpW
(
szAttribute
,
INSTALLPROPERTY_PACKAGECODEW
))
{
if
(
lstrlenW
(
val
)
!=
SQUISH_GUID_SIZE
-
1
)
badconfig
=
TRUE
;
...
...
dlls/msi/tests/msi.c
View file @
bbdf79bc
...
...
@@ -2055,7 +2055,7 @@ static void test_MsiGetProductInfo(void)
CHAR
buf
[
MAX_PATH
];
CHAR
keypath
[
MAX_PATH
];
LPSTR
usersid
;
DWORD
sz
;
DWORD
sz
,
val
=
42
;
create_test_guid
(
prodcode
,
prod_squashed
);
create_test_guid
(
packcode
,
pack_squashed
);
...
...
@@ -2429,6 +2429,18 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
"link"
),
"Expected
\"
link
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
4
,
"Expected 4, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"HelpLink"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* HelpLink type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_HELPLINK
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"42"
),
"Expected
\"
42
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
2
,
"Expected 2, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"DisplayName"
,
0
,
REG_SZ
,
(
LPBYTE
)
"name"
,
5
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -2440,6 +2452,18 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
"name"
),
"Expected
\"
name
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
4
,
"Expected 4, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"DisplayName"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* DisplayName type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_INSTALLEDPRODUCTNAME
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"42"
),
"Expected
\"
42
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
2
,
"Expected 2, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"DisplayVersion"
,
0
,
REG_SZ
,
(
LPBYTE
)
"1.1.1"
,
6
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -2451,6 +2475,18 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
"1.1.1"
),
"Expected
\"
1.1.1
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
5
,
"Expected 5, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"DisplayVersion"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* DisplayVersion type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_VERSIONSTRING
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"42"
),
"Expected
\"
42
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
2
,
"Expected 2, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"HelpTelephone"
,
0
,
REG_SZ
,
(
LPBYTE
)
"tele"
,
5
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -2462,6 +2498,18 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
"tele"
),
"Expected
\"
tele
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
4
,
"Expected 4, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"HelpTelephone"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* HelpTelephone type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_HELPTELEPHONE
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"42"
),
"Expected
\"
42
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
2
,
"Expected 2, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"InstallLocation"
,
0
,
REG_SZ
,
(
LPBYTE
)
"loc"
,
4
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -2473,6 +2521,18 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
"loc"
),
"Expected
\"
loc
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
3
,
"Expected 3, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"InstallLocation"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* InstallLocation type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_INSTALLLOCATION
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"42"
),
"Expected
\"
42
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
2
,
"Expected 2, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"InstallSource"
,
0
,
REG_SZ
,
(
LPBYTE
)
"source"
,
7
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -2484,6 +2544,18 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
"source"
),
"Expected
\"
source
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
6
,
"Expected 6, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"InstallSource"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* InstallSource type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_INSTALLSOURCE
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"42"
),
"Expected
\"
42
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
2
,
"Expected 2, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"InstallDate"
,
0
,
REG_SZ
,
(
LPBYTE
)
"date"
,
5
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -2495,6 +2567,18 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
"date"
),
"Expected
\"
date
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
4
,
"Expected 4, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"InstallDate"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* InstallDate type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_INSTALLDATE
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"42"
),
"Expected
\"
42
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
2
,
"Expected 2, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"Publisher"
,
0
,
REG_SZ
,
(
LPBYTE
)
"pub"
,
4
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -2506,6 +2590,18 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
"pub"
),
"Expected
\"
pub
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
3
,
"Expected 3, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"Publisher"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* Publisher type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_PUBLISHER
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"42"
),
"Expected
\"
42
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
2
,
"Expected 2, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"LocalPackage"
,
0
,
REG_SZ
,
(
LPBYTE
)
"pack"
,
5
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -2517,6 +2613,18 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
"pack"
),
"Expected
\"
pack
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
4
,
"Expected 4, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"LocalPackage"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* LocalPackage type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_LOCALPACKAGE
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"42"
),
"Expected
\"
42
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
2
,
"Expected 2, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"UrlInfoAbout"
,
0
,
REG_SZ
,
(
LPBYTE
)
"about"
,
6
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -2528,6 +2636,18 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
"about"
),
"Expected
\"
about
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
5
,
"Expected 5, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"UrlInfoAbout"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* UrlInfoAbout type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_URLINFOABOUT
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"42"
),
"Expected
\"
42
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
2
,
"Expected 2, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"UrlUpdateInfo"
,
0
,
REG_SZ
,
(
LPBYTE
)
"info"
,
5
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -2539,6 +2659,18 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
"info"
),
"Expected
\"
info
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
4
,
"Expected 4, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"UrlUpdateInfo"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* UrlUpdateInfo type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_URLUPDATEINFO
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"42"
),
"Expected
\"
42
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
2
,
"Expected 2, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"VersionMinor"
,
0
,
REG_SZ
,
(
LPBYTE
)
"1"
,
2
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -2550,6 +2682,18 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
"1"
),
"Expected
\"
1
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
1
,
"Expected 1, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"VersionMinor"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* VersionMinor type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_VERSIONMINOR
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"42"
),
"Expected
\"
42
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
2
,
"Expected 2, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"VersionMajor"
,
0
,
REG_SZ
,
(
LPBYTE
)
"1"
,
2
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -2561,6 +2705,18 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
"1"
),
"Expected
\"
1
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
1
,
"Expected 1, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"VersionMajor"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* VersionMajor type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_VERSIONMAJOR
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"42"
),
"Expected
\"
42
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
2
,
"Expected 2, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"ProductID"
,
0
,
REG_SZ
,
(
LPBYTE
)
"id"
,
3
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -2572,6 +2728,18 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
"id"
),
"Expected
\"
id
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
2
,
"Expected 2, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"ProductID"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* ProductID type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_PRODUCTID
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"42"
),
"Expected
\"
42
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
2
,
"Expected 2, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"RegCompany"
,
0
,
REG_SZ
,
(
LPBYTE
)
"comp"
,
5
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -2583,6 +2751,18 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
"comp"
),
"Expected
\"
comp
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
4
,
"Expected 4, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"RegCompany"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* RegCompany type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_REGCOMPANY
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"42"
),
"Expected
\"
42
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
2
,
"Expected 2, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"RegOwner"
,
0
,
REG_SZ
,
(
LPBYTE
)
"own"
,
4
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -2594,6 +2774,18 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
"own"
),
"Expected
\"
own
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
3
,
"Expected 3, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"RegOwner"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* RegOwner type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_REGOWNER
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"42"
),
"Expected
\"
42
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
2
,
"Expected 2, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"InstanceType"
,
0
,
REG_SZ
,
(
LPBYTE
)
"type"
,
5
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -2605,6 +2797,18 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
0
,
"Expected 0, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"InstanceType"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* InstanceType type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_INSTANCETYPE
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
0
,
"Expected 0, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
prodkey
,
"InstanceType"
,
0
,
REG_SZ
,
(
LPBYTE
)
"type"
,
5
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -2616,6 +2820,18 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
"type"
),
"Expected
\"
type
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
4
,
"Expected 4, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
prodkey
,
"InstanceType"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* InstanceType type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_INSTANCETYPE
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"42"
),
"Expected
\"
42
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
2
,
"Expected 2, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"Transforms"
,
0
,
REG_SZ
,
(
LPBYTE
)
"tforms"
,
7
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -2627,6 +2843,18 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
0
,
"Expected 0, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"Transforms"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* Transforms type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_TRANSFORMS
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
0
,
"Expected 0, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
prodkey
,
"Transforms"
,
0
,
REG_SZ
,
(
LPBYTE
)
"tforms"
,
7
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -2638,6 +2866,18 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
"tforms"
),
"Expected
\"
tforms
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
6
,
"Expected 6, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
prodkey
,
"Transforms"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* Transforms type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_TRANSFORMS
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"42"
),
"Expected
\"
42
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
2
,
"Expected 2, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"Language"
,
0
,
REG_SZ
,
(
LPBYTE
)
"lang"
,
5
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -2649,6 +2889,18 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
0
,
"Expected 0, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"Language"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* Language type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_LANGUAGE
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
0
,
"Expected 0, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
prodkey
,
"Language"
,
0
,
REG_SZ
,
(
LPBYTE
)
"lang"
,
5
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -2660,6 +2912,18 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
"lang"
),
"Expected
\"
lang
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
4
,
"Expected 4, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
prodkey
,
"Language"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* Language type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_LANGUAGE
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"42"
),
"Expected
\"
42
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
2
,
"Expected 2, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"ProductName"
,
0
,
REG_SZ
,
(
LPBYTE
)
"name"
,
5
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -2671,6 +2935,18 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
0
,
"Expected 0, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"ProductName"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* ProductName type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_PRODUCTNAME
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
0
,
"Expected 0, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
prodkey
,
"ProductName"
,
0
,
REG_SZ
,
(
LPBYTE
)
"name"
,
5
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -2682,10 +2958,34 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
"name"
),
"Expected
\"
name
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
4
,
"Expected 4, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
prodkey
,
"ProductName"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* ProductName type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_PRODUCTNAME
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"42"
),
"Expected
\"
42
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
2
,
"Expected 2, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"Assignment"
,
0
,
REG_SZ
,
(
LPBYTE
)
"at"
,
3
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* AssignmentType value exists */
/* Assignment value exists */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_ASSIGNMENTTYPE
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
0
,
"Expected 0, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"Assignment"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* Assignment type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_ASSIGNMENTTYPE
,
buf
,
&
sz
);
...
...
@@ -2696,7 +2996,7 @@ static void test_MsiGetProductInfo(void)
res
=
RegSetValueExA
(
prodkey
,
"Assignment"
,
0
,
REG_SZ
,
(
LPBYTE
)
"at"
,
3
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* Assignment
Type
value exists */
/* Assignment value exists */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_ASSIGNMENTTYPE
,
buf
,
&
sz
);
...
...
@@ -2704,6 +3004,18 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
"at"
),
"Expected
\"
at
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
2
,
"Expected 2, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
prodkey
,
"Assignment"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* Assignment type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_ASSIGNMENTTYPE
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"42"
),
"Expected
\"
42
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
2
,
"Expected 2, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"PackageCode"
,
0
,
REG_SZ
,
(
LPBYTE
)
"code"
,
5
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -2715,6 +3027,18 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
0
,
"Expected 0, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"PackageCode"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* PackageCode type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_PACKAGECODE
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
0
,
"Expected 0, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
prodkey
,
"PackageCode"
,
0
,
REG_SZ
,
(
LPBYTE
)
"code"
,
5
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -2727,6 +3051,18 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
"code"
),
"Expected
\"
code
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
MAX_PATH
,
"Expected MAX_PATH, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
prodkey
,
"PackageCode"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* PackageCode type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_PACKAGECODE
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"42"
),
"Expected
\"
42
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
2
,
"Expected 2, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
prodkey
,
"PackageCode"
,
0
,
REG_SZ
,
(
LPBYTE
)
pack_squashed
,
33
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -2749,6 +3085,18 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
0
,
"Expected 0, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"Version"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* Version type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_VERSION
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
0
,
"Expected 0, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
prodkey
,
"Version"
,
0
,
REG_SZ
,
(
LPBYTE
)
"ver"
,
4
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -2760,6 +3108,18 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
"ver"
),
"Expected
\"
ver
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
3
,
"Expected 3, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
prodkey
,
"Version"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* Version type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_VERSION
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"42"
),
"Expected
\"
42
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
2
,
"Expected 2, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"ProductIcon"
,
0
,
REG_SZ
,
(
LPBYTE
)
"ico"
,
4
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -2771,6 +3131,18 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
0
,
"Expected 0, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"ProductIcon"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* ProductIcon type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_PRODUCTICON
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
0
,
"Expected 0, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
prodkey
,
"ProductIcon"
,
0
,
REG_SZ
,
(
LPBYTE
)
"ico"
,
4
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -2782,6 +3154,18 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
"ico"
),
"Expected
\"
ico
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
3
,
"Expected 3, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
prodkey
,
"ProductIcon"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* ProductIcon type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_PRODUCTICON
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"42"
),
"Expected
\"
42
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
2
,
"Expected 2, got %d
\n
"
,
sz
);
res
=
RegCreateKeyA
(
prodkey
,
"SourceList"
,
&
source
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -2795,6 +3179,18 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
"packname"
),
"Expected
\"
packname
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
8
,
"Expected 8, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
source
,
"PackageName"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* PackageName type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_PACKAGENAME
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"42"
),
"Expected
\"
42
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
2
,
"Expected 2, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"AuthorizedLUAApp"
,
0
,
REG_SZ
,
(
LPBYTE
)
"auth"
,
5
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -2806,6 +3202,18 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
0
,
"Expected 0, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
propkey
,
"AuthorizedLUAApp"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* AuthorizedLUAApp type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_AUTHORIZED_LUA_APP
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
0
,
"Expected 0, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
prodkey
,
"AuthorizedLUAApp"
,
0
,
REG_SZ
,
(
LPBYTE
)
"auth"
,
5
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -2817,6 +3225,18 @@ static void test_MsiGetProductInfo(void)
ok
(
!
lstrcmpA
(
buf
,
"auth"
),
"Expected
\"
auth
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
4
,
"Expected 4, got %d
\n
"
,
sz
);
res
=
RegSetValueExA
(
prodkey
,
"AuthorizedLUAApp"
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
val
,
sizeof
(
DWORD
));
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* AuthorizedLUAApp type is REG_DWORD */
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiGetProductInfoA
(
prodcode
,
INSTALLPROPERTY_AUTHORIZED_LUA_APP
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"42"
),
"Expected
\"
42
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
2
,
"Expected 2, got %d
\n
"
,
sz
);
RegDeleteValueA
(
propkey
,
"HelpLink"
);
RegDeleteValueA
(
propkey
,
"DisplayName"
);
RegDeleteValueA
(
propkey
,
"DisplayVersion"
);
...
...
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