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
0713c328
Commit
0713c328
authored
Aug 07, 2007
by
James Hawkins
Committed by
Alexandre Julliard
Aug 08, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Implement the remaining contexts for MsiQueryComponentState.
parent
1f3133d2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
25 deletions
+39
-25
msi.c
dlls/msi/msi.c
+21
-4
install.c
dlls/msi/tests/install.c
+18
-0
msi.c
dlls/msi/tests/msi.c
+0
-21
No files found.
dlls/msi/msi.c
View file @
0713c328
...
...
@@ -770,6 +770,11 @@ UINT WINAPI MsiQueryComponentStateW(LPCWSTR szProductCode,
DWORD
sz
;
UINT
r
;
static
const
WCHAR
local_package
[]
=
{
'L'
,
'o'
,
'c'
,
'a'
,
'l'
,
'P'
,
'a'
,
'c'
,
'k'
,
'a'
,
'g'
,
'e'
,
0
};
static
const
WCHAR
managed_local_package
[]
=
{
'M'
,
'a'
,
'n'
,
'a'
,
'g'
,
'e'
,
'd'
,
'L'
,
'o'
,
'c'
,
'a'
,
'l'
,
'P'
,
'a'
,
'c'
,
'k'
,
'a'
,
'g'
,
'e'
,
0
};
TRACE
(
"(%s, %s, %d, %s, %p)
\n
"
,
debugstr_w
(
szProductCode
),
debugstr_w
(
szUserSid
),
dwContext
,
debugstr_w
(
szComponent
),
pdwState
);
...
...
@@ -783,15 +788,30 @@ UINT WINAPI MsiQueryComponentStateW(LPCWSTR szProductCode,
return
ERROR_INVALID_PARAMETER
;
if
(
dwContext
==
MSIINSTALLCONTEXT_MACHINE
)
{
r
=
MSIREG_OpenLocalSystemProductKey
(
szProductCode
,
&
hkey
,
FALSE
);
else
r
=
MSIREG_OpenInstallPropertiesKey
(
szProductCode
,
&
hkey
,
FALSE
);
if
(
r
!=
ERROR_SUCCESS
)
return
ERROR_UNKNOWN_PRODUCT
;
sz
=
0
;
if
(
dwContext
!=
MSIINSTALLCONTEXT_USERMANAGED
)
res
=
RegQueryValueExW
(
hkey
,
local_package
,
NULL
,
NULL
,
NULL
,
&
sz
);
else
res
=
RegQueryValueExW
(
hkey
,
managed_local_package
,
NULL
,
NULL
,
NULL
,
&
sz
);
if
(
res
!=
ERROR_SUCCESS
)
return
ERROR_UNKNOWN_PRODUCT
;
RegCloseKey
(
hkey
);
*
pdwState
=
INSTALLSTATE_UNKNOWN
;
if
(
dwContext
==
MSIINSTALLCONTEXT_MACHINE
)
r
=
MSIREG_OpenLocalSystemComponentKey
(
szComponent
,
&
hkey
,
FALSE
);
else
r
=
MSIREG_OpenUserDataComponentKey
(
szComponent
,
&
hkey
,
FALSE
);
if
(
r
!=
ERROR_SUCCESS
)
return
ERROR_UNKNOWN_COMPONENT
;
...
...
@@ -808,9 +828,6 @@ UINT WINAPI MsiQueryComponentStateW(LPCWSTR szProductCode,
*
pdwState
=
INSTALLSTATE_LOCAL
;
return
ERROR_SUCCESS
;
}
return
ERROR_UNKNOWN_COMPONENT
;
}
INSTALLSTATE
WINAPI
MsiQueryProductStateA
(
LPCSTR
szProduct
)
...
...
dlls/msi/tests/install.c
View file @
0713c328
...
...
@@ -1876,7 +1876,10 @@ static void test_publish(void)
r
=
MsiQueryComponentStateA
(
prodcode
,
NULL
,
MSIINSTALLCONTEXT_USERUNMANAGED
,
"{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}"
,
&
state
);
ok
(
r
==
ERROR_UNKNOWN_PRODUCT
,
"Expected ERROR_UNKNOWN_PRODUCT, got %d
\n
"
,
r
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_UNKNOWN
,
"Expected INSTALLSTATE_UNKNOWN, got %d
\n
"
,
state
);
}
/* PublishProduct and RegisterProduct and ProcessComponents */
r
=
MsiInstallProductA
(
msifile
,
"REGISTER_PRODUCT=1 PUBLISH_PRODUCT=1 PROCESS_COMPONENTS=1"
);
...
...
@@ -1931,7 +1934,10 @@ static void test_publish(void)
r
=
MsiQueryComponentStateA
(
prodcode
,
NULL
,
MSIINSTALLCONTEXT_USERUNMANAGED
,
"{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}"
,
&
state
);
ok
(
r
==
ERROR_UNKNOWN_PRODUCT
,
"Expected ERROR_UNKNOWN_PRODUCT, got %d
\n
"
,
r
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_UNKNOWN
,
"Expected INSTALLSTATE_UNKNOWN, got %d
\n
"
,
state
);
}
/* PublishProduct, RegisterProduct, ProcessComponents, PublishFeatures */
r
=
MsiInstallProductA
(
msifile
,
"REGISTER_PRODUCT=1 PUBLISH_PRODUCT=1 PROCESS_COMPONENTS=1 PUBLISH_FEATURES=1"
);
...
...
@@ -1989,7 +1995,10 @@ static void test_publish(void)
r
=
MsiQueryComponentStateA
(
prodcode
,
NULL
,
MSIINSTALLCONTEXT_USERUNMANAGED
,
"{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}"
,
&
state
);
ok
(
r
==
ERROR_UNKNOWN_PRODUCT
,
"Expected ERROR_UNKNOWN_PRODUCT, got %d
\n
"
,
r
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_UNKNOWN
,
"Expected INSTALLSTATE_UNKNOWN, got %d
\n
"
,
state
);
}
/* complete install */
r
=
MsiInstallProductA
(
msifile
,
"FULL=1"
);
...
...
@@ -2047,7 +2056,10 @@ static void test_publish(void)
r
=
MsiQueryComponentStateA
(
prodcode
,
NULL
,
MSIINSTALLCONTEXT_USERUNMANAGED
,
"{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}"
,
&
state
);
ok
(
r
==
ERROR_UNKNOWN_PRODUCT
,
"Expected ERROR_UNKNOWN_PRODUCT, got %d
\n
"
,
r
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_UNKNOWN
,
"Expected INSTALLSTATE_UNKNOWN, got %d
\n
"
,
state
);
}
/* complete install */
r
=
MsiInstallProductA
(
msifile
,
"FULL=1"
);
...
...
@@ -2163,7 +2175,10 @@ static void test_publish(void)
r
=
MsiQueryComponentStateA
(
prodcode
,
NULL
,
MSIINSTALLCONTEXT_USERUNMANAGED
,
"{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}"
,
&
state
);
ok
(
r
==
ERROR_UNKNOWN_PRODUCT
,
"Expected ERROR_UNKNOWN_PRODUCT, got %d
\n
"
,
r
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_UNKNOWN
,
"Expected INSTALLSTATE_UNKNOWN, got %d
\n
"
,
state
);
}
/* complete install */
r
=
MsiInstallProductA
(
msifile
,
"FULL=1"
);
...
...
@@ -2221,7 +2236,10 @@ static void test_publish(void)
r
=
MsiQueryComponentStateA
(
prodcode
,
NULL
,
MSIINSTALLCONTEXT_USERUNMANAGED
,
"{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}"
,
&
state
);
ok
(
r
==
ERROR_UNKNOWN_PRODUCT
,
"Expected ERROR_UNKNOWN_PRODUCT, got %d
\n
"
,
r
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_UNKNOWN
,
"Expected INSTALLSTATE_UNKNOWN, got %d
\n
"
,
state
);
}
/* make sure 'Program Files\msitest' is removed */
delete_pfmsitest_files
();
...
...
dlls/msi/tests/msi.c
View file @
0713c328
...
...
@@ -755,10 +755,7 @@ static void test_MsiQueryComponentState(void)
state
=
0xdeadbeef
;
r
=
MsiQueryComponentStateA
(
prodcode
,
NULL
,
MSIINSTALLCONTEXT_USERUNMANAGED
,
component
,
&
state
);
todo_wine
{
ok
(
r
==
ERROR_UNKNOWN_PRODUCT
,
"Expected ERROR_UNKNOWN_PRODUCT, got %d
\n
"
,
r
);
}
ok
(
state
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %d
\n
"
,
state
);
lstrcpyA
(
keypath
,
"Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
Installer
\\
UserData
\\
"
);
...
...
@@ -776,10 +773,7 @@ static void test_MsiQueryComponentState(void)
state
=
0xdeadbeef
;
r
=
MsiQueryComponentStateA
(
prodcode
,
NULL
,
MSIINSTALLCONTEXT_USERUNMANAGED
,
component
,
&
state
);
ok
(
r
==
ERROR_UNKNOWN_COMPONENT
,
"Expected ERROR_UNKNOWN_COMPONENT, got %d
\n
"
,
r
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_UNKNOWN
,
"Expected INSTALLSTATE_UNKNOWN, got %d
\n
"
,
state
);
}
lstrcpyA
(
keypath
,
"Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
Installer
\\
UserData
\\
"
);
lstrcatA
(
keypath
,
usersid
);
...
...
@@ -793,10 +787,7 @@ static void test_MsiQueryComponentState(void)
state
=
0xdeadbeef
;
r
=
MsiQueryComponentStateA
(
prodcode
,
NULL
,
MSIINSTALLCONTEXT_USERUNMANAGED
,
component
,
&
state
);
ok
(
r
==
ERROR_UNKNOWN_COMPONENT
,
"Expected ERROR_UNKNOWN_COMPONENT, got %d
\n
"
,
r
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_UNKNOWN
,
"Expected INSTALLSTATE_UNKNOWN, got %d
\n
"
,
state
);
}
res
=
RegSetValueExA
(
compkey
,
prod_squashed
,
0
,
REG_SZ
,
(
const
BYTE
*
)
""
,
0
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -804,31 +795,22 @@ static void test_MsiQueryComponentState(void)
/* component\product exists */
state
=
0xdeadbeef
;
r
=
MsiQueryComponentStateA
(
prodcode
,
NULL
,
MSIINSTALLCONTEXT_USERUNMANAGED
,
component
,
&
state
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
state
==
INSTALLSTATE_NOTUSED
,
"Expected INSTALLSTATE_NOTUSED, got %d
\n
"
,
state
);
}
res
=
RegSetValueExA
(
compkey
,
prod_squashed
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"hi"
,
2
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
state
=
0xdeadbeef
;
r
=
MsiQueryComponentStateA
(
prodcode
,
NULL
,
MSIINSTALLCONTEXT_USERUNMANAGED
,
component
,
&
state
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
state
==
INSTALLSTATE_LOCAL
,
"Expected INSTALLSTATE_LOCAL, got %d
\n
"
,
state
);
}
/* MSIINSTALLCONTEXT_USERMANAGED */
state
=
0xdeadbeef
;
r
=
MsiQueryComponentStateA
(
prodcode
,
NULL
,
MSIINSTALLCONTEXT_USERMANAGED
,
component
,
&
state
);
todo_wine
{
ok
(
r
==
ERROR_UNKNOWN_PRODUCT
,
"Expected ERROR_UNKNOWN_PRODUCT, got %d
\n
"
,
r
);
}
ok
(
state
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %d
\n
"
,
state
);
res
=
RegSetValueExA
(
prodkey
,
"ManagedLocalPackage"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"msitest.msi"
,
11
);
...
...
@@ -836,11 +818,8 @@ static void test_MsiQueryComponentState(void)
state
=
0xdeadbeef
;
r
=
MsiQueryComponentStateA
(
prodcode
,
NULL
,
MSIINSTALLCONTEXT_USERMANAGED
,
component
,
&
state
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
state
==
INSTALLSTATE_LOCAL
,
"Expected INSTALLSTATE_LOCAL, got %d
\n
"
,
state
);
}
RegDeleteValueA
(
prodkey
,
"LocalPackage"
);
RegDeleteValueA
(
prodkey
,
"ManagedLocalPackage"
);
...
...
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