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
39b87470
Commit
39b87470
authored
Aug 21, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Aug 21, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Handle components installed as source in MsiQueryComponentState.
parent
b965a74e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
5 deletions
+51
-5
msi.c
dlls/msi/msi.c
+14
-5
msi.c
dlls/msi/tests/msi.c
+37
-0
No files found.
dlls/msi/msi.c
View file @
39b87470
...
...
@@ -1299,7 +1299,7 @@ static BOOL msi_comp_find_package(LPCWSTR prodcode, MSIINSTALLCONTEXT context)
static
BOOL
msi_comp_find_prodcode
(
LPWSTR
squished_pc
,
MSIINSTALLCONTEXT
context
,
LPCWSTR
comp
,
DWORD
*
sz
)
LPCWSTR
comp
,
LPWSTR
val
,
DWORD
*
sz
)
{
HKEY
hkey
;
LONG
res
;
...
...
@@ -1313,8 +1313,7 @@ static BOOL msi_comp_find_prodcode(LPWSTR squished_pc,
if
(
r
!=
ERROR_SUCCESS
)
return
FALSE
;
*
sz
=
0
;
res
=
RegQueryValueExW
(
hkey
,
squished_pc
,
NULL
,
NULL
,
NULL
,
sz
);
res
=
RegQueryValueExW
(
hkey
,
squished_pc
,
NULL
,
NULL
,
(
BYTE
*
)
val
,
sz
);
if
(
res
!=
ERROR_SUCCESS
)
return
FALSE
;
...
...
@@ -1327,6 +1326,7 @@ UINT WINAPI MsiQueryComponentStateW(LPCWSTR szProductCode,
LPCWSTR
szComponent
,
INSTALLSTATE
*
pdwState
)
{
WCHAR
squished_pc
[
GUID_SIZE
];
WCHAR
val
[
MAX_PATH
];
BOOL
found
;
DWORD
sz
;
...
...
@@ -1357,13 +1357,22 @@ UINT WINAPI MsiQueryComponentStateW(LPCWSTR szProductCode,
*
pdwState
=
INSTALLSTATE_UNKNOWN
;
if
(
!
msi_comp_find_prodcode
(
squished_pc
,
dwContext
,
szComponent
,
&
sz
))
sz
=
MAX_PATH
;
if
(
!
msi_comp_find_prodcode
(
squished_pc
,
dwContext
,
szComponent
,
val
,
&
sz
))
return
ERROR_UNKNOWN_COMPONENT
;
if
(
sz
==
0
)
*
pdwState
=
INSTALLSTATE_NOTUSED
;
else
*
pdwState
=
INSTALLSTATE_LOCAL
;
{
if
(
lstrlenW
(
val
)
>
2
&&
val
[
0
]
>=
'0'
&&
val
[
0
]
<=
'9'
&&
val
[
1
]
>=
'0'
&&
val
[
1
]
<=
'9'
)
{
*
pdwState
=
INSTALLSTATE_SOURCE
;
}
else
*
pdwState
=
INSTALLSTATE_LOCAL
;
}
return
ERROR_SUCCESS
;
}
...
...
dlls/msi/tests/msi.c
View file @
39b87470
...
...
@@ -1237,6 +1237,43 @@ static void test_MsiQueryComponentState(void)
res
=
RegSetValueExA
(
compkey
,
prod_squashed
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"hi"
,
2
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* INSTALLSTATE_LOCAL */
state
=
MAGIC_ERROR
;
r
=
pMsiQueryComponentStateA
(
prodcode
,
NULL
,
MSIINSTALLCONTEXT_MACHINE
,
component
,
&
state
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
state
==
INSTALLSTATE_LOCAL
,
"Expected INSTALLSTATE_LOCAL, got %d
\n
"
,
state
);
res
=
RegSetValueExA
(
compkey
,
prod_squashed
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"01
\\
"
,
4
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* INSTALLSTATE_SOURCE */
state
=
MAGIC_ERROR
;
r
=
pMsiQueryComponentStateA
(
prodcode
,
NULL
,
MSIINSTALLCONTEXT_MACHINE
,
component
,
&
state
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
state
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
state
);
res
=
RegSetValueExA
(
compkey
,
prod_squashed
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"01"
,
3
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* bad INSTALLSTATE_SOURCE */
state
=
MAGIC_ERROR
;
r
=
pMsiQueryComponentStateA
(
prodcode
,
NULL
,
MSIINSTALLCONTEXT_MACHINE
,
component
,
&
state
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
state
==
INSTALLSTATE_LOCAL
,
"Expected INSTALLSTATE_LOCAL, got %d
\n
"
,
state
);
res
=
RegSetValueExA
(
compkey
,
prod_squashed
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"01a"
,
4
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* INSTALLSTATE_SOURCE */
state
=
MAGIC_ERROR
;
r
=
pMsiQueryComponentStateA
(
prodcode
,
NULL
,
MSIINSTALLCONTEXT_MACHINE
,
component
,
&
state
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
state
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
state
);
res
=
RegSetValueExA
(
compkey
,
prod_squashed
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"01"
,
3
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* bad INSTALLSTATE_SOURCE */
state
=
MAGIC_ERROR
;
r
=
pMsiQueryComponentStateA
(
prodcode
,
NULL
,
MSIINSTALLCONTEXT_MACHINE
,
component
,
&
state
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
...
...
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