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
667ba16d
Commit
667ba16d
authored
Jun 10, 2011
by
Hans Leidekker
Committed by
Alexandre Julliard
Jun 10, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Implement and test MsiSetFeatureAttributes.
parent
4c9c50d8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
155 additions
and
6 deletions
+155
-6
install.c
dlls/msi/install.c
+66
-4
msi.spec
dlls/msi/msi.spec
+2
-2
install.c
dlls/msi/tests/install.c
+83
-0
msiquery.h
include/msiquery.h
+4
-0
No files found.
dlls/msi/install.c
View file @
667ba16d
...
@@ -1028,6 +1028,70 @@ UINT WINAPI MsiSetFeatureStateW(MSIHANDLE hInstall, LPCWSTR szFeature,
...
@@ -1028,6 +1028,70 @@ UINT WINAPI MsiSetFeatureStateW(MSIHANDLE hInstall, LPCWSTR szFeature,
}
}
/***********************************************************************
/***********************************************************************
* MsiSetFeatureAttributesA (MSI.@)
*/
UINT
WINAPI
MsiSetFeatureAttributesA
(
MSIHANDLE
handle
,
LPCSTR
feature
,
DWORD
attrs
)
{
UINT
r
;
WCHAR
*
featureW
=
NULL
;
TRACE
(
"%u, %s, 0x%08x
\n
"
,
handle
,
debugstr_a
(
feature
),
attrs
);
if
(
feature
&&
!
(
featureW
=
strdupAtoW
(
feature
)))
return
ERROR_OUTOFMEMORY
;
r
=
MsiSetFeatureAttributesW
(
handle
,
featureW
,
attrs
);
msi_free
(
featureW
);
return
r
;
}
static
DWORD
unmap_feature_attributes
(
DWORD
attrs
)
{
DWORD
ret
=
0
;
if
(
attrs
&
INSTALLFEATUREATTRIBUTE_FAVORLOCAL
)
ret
=
msidbFeatureAttributesFavorLocal
;
if
(
attrs
&
INSTALLFEATUREATTRIBUTE_FAVORSOURCE
)
ret
|=
msidbFeatureAttributesFavorSource
;
if
(
attrs
&
INSTALLFEATUREATTRIBUTE_FOLLOWPARENT
)
ret
|=
msidbFeatureAttributesFollowParent
;
if
(
attrs
&
INSTALLFEATUREATTRIBUTE_FAVORADVERTISE
)
ret
|=
msidbFeatureAttributesFavorAdvertise
;
if
(
attrs
&
INSTALLFEATUREATTRIBUTE_DISALLOWADVERTISE
)
ret
|=
msidbFeatureAttributesDisallowAdvertise
;
if
(
attrs
&
INSTALLFEATUREATTRIBUTE_NOUNSUPPORTEDADVERTISE
)
ret
|=
msidbFeatureAttributesNoUnsupportedAdvertise
;
return
ret
;
}
/***********************************************************************
* MsiSetFeatureAttributesW (MSI.@)
*/
UINT
WINAPI
MsiSetFeatureAttributesW
(
MSIHANDLE
handle
,
LPCWSTR
name
,
DWORD
attrs
)
{
MSIPACKAGE
*
package
;
MSIFEATURE
*
feature
;
WCHAR
*
costing
;
TRACE
(
"%u, %s, 0x%08x
\n
"
,
handle
,
debugstr_w
(
name
),
attrs
);
if
(
!
name
||
!
name
[
0
])
return
ERROR_UNKNOWN_FEATURE
;
if
(
!
(
package
=
msihandle2msiinfo
(
handle
,
MSIHANDLETYPE_PACKAGE
)))
return
ERROR_INVALID_HANDLE
;
costing
=
msi_dup_property
(
package
->
db
,
szCostingComplete
);
if
(
!
costing
||
!
strcmpW
(
costing
,
szOne
))
{
msi_free
(
costing
);
msiobj_release
(
&
package
->
hdr
);
return
ERROR_FUNCTION_FAILED
;
}
msi_free
(
costing
);
if
(
!
(
feature
=
msi_get_loaded_feature
(
package
,
name
)))
{
msiobj_release
(
&
package
->
hdr
);
return
ERROR_UNKNOWN_FEATURE
;
}
feature
->
Attributes
=
unmap_feature_attributes
(
attrs
);
msiobj_release
(
&
package
->
hdr
);
return
ERROR_SUCCESS
;
}
/***********************************************************************
* MsiGetFeatureStateA (MSI.@)
* MsiGetFeatureStateA (MSI.@)
*/
*/
UINT
WINAPI
MsiGetFeatureStateA
(
MSIHANDLE
hInstall
,
LPCSTR
szFeature
,
UINT
WINAPI
MsiGetFeatureStateA
(
MSIHANDLE
hInstall
,
LPCSTR
szFeature
,
...
@@ -1036,12 +1100,10 @@ UINT WINAPI MsiGetFeatureStateA(MSIHANDLE hInstall, LPCSTR szFeature,
...
@@ -1036,12 +1100,10 @@ UINT WINAPI MsiGetFeatureStateA(MSIHANDLE hInstall, LPCSTR szFeature,
LPWSTR
szwFeature
=
NULL
;
LPWSTR
szwFeature
=
NULL
;
UINT
rc
;
UINT
rc
;
szwFeature
=
strdupAtoW
(
szFeature
);
if
(
szFeature
&&
!
(
szwFeature
=
strdupAtoW
(
szFeature
)))
return
ERROR_OUTOFMEMORY
;
rc
=
MsiGetFeatureStateW
(
hInstall
,
szwFeature
,
piInstalled
,
piAction
);
rc
=
MsiGetFeatureStateW
(
hInstall
,
szwFeature
,
piInstalled
,
piAction
);
msi_free
(
szwFeature
);
msi_free
(
szwFeature
);
return
rc
;
return
rc
;
}
}
...
...
dlls/msi/msi.spec
View file @
667ba16d
...
@@ -199,8 +199,8 @@
...
@@ -199,8 +199,8 @@
203 stdcall MsiProvideQualifiedComponentExW(wstr wstr long wstr long long ptr ptr)
203 stdcall MsiProvideQualifiedComponentExW(wstr wstr long wstr long long ptr ptr)
204 stdcall MsiEnumRelatedProductsA(str long long ptr)
204 stdcall MsiEnumRelatedProductsA(str long long ptr)
205 stdcall MsiEnumRelatedProductsW(wstr long long ptr)
205 stdcall MsiEnumRelatedProductsW(wstr long long ptr)
206 st
ub MsiSetFeatureAttributesA
206 st
dcall MsiSetFeatureAttributesA(long str long)
207 st
ub MsiSetFeatureAttributesW
207 st
dcall MsiSetFeatureAttributesW(long wstr long)
208 stdcall MsiSourceListClearAllA(str str long)
208 stdcall MsiSourceListClearAllA(str str long)
209 stdcall MsiSourceListClearAllW(wstr wstr long)
209 stdcall MsiSourceListClearAllW(wstr wstr long)
210 stdcall MsiSourceListAddSourceA(str str long str)
210 stdcall MsiSourceListAddSourceA(str str long str)
...
...
dlls/msi/tests/install.c
View file @
667ba16d
...
@@ -6469,6 +6469,88 @@ static void test_MsiGetFeatureInfo(void)
...
@@ -6469,6 +6469,88 @@ static void test_MsiGetFeatureInfo(void)
DeleteFileA
(
msifile
);
DeleteFileA
(
msifile
);
}
}
static
void
test_MsiSetFeatureAttributes
(
void
)
{
UINT
r
;
DWORD
attrs
;
char
path
[
MAX_PATH
];
MSIHANDLE
package
;
if
(
is_process_limited
())
{
skip
(
"process is limited
\n
"
);
return
;
}
create_database
(
msifile
,
tables
,
sizeof
(
tables
)
/
sizeof
(
tables
[
0
])
);
strcpy
(
path
,
CURR_DIR
);
strcat
(
path
,
"
\\
"
);
strcat
(
path
,
msifile
);
r
=
MsiOpenPackage
(
path
,
&
package
);
if
(
r
==
ERROR_INSTALL_PACKAGE_REJECTED
)
{
skip
(
"Not enough rights to perform tests
\n
"
);
DeleteFileA
(
msifile
);
return
;
}
ok
(
r
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %u
\n
"
,
r
);
r
=
MsiSetFeatureAttributesA
(
package
,
"One"
,
INSTALLFEATUREATTRIBUTE_FAVORLOCAL
);
ok
(
r
==
ERROR_FUNCTION_FAILED
,
"Expected ERROR_FUNCTION_FAILED, got %u
\n
"
,
r
);
r
=
MsiDoAction
(
package
,
"CostInitialize"
);
ok
(
r
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %u
\n
"
,
r
);
r
=
MsiSetFeatureAttributesA
(
0
,
"One"
,
INSTALLFEATUREATTRIBUTE_FAVORLOCAL
);
ok
(
r
==
ERROR_INVALID_HANDLE
,
"expected ERROR_INVALID_HANDLE, got %u
\n
"
,
r
);
r
=
MsiSetFeatureAttributesA
(
package
,
""
,
INSTALLFEATUREATTRIBUTE_FAVORLOCAL
);
ok
(
r
==
ERROR_UNKNOWN_FEATURE
,
"expected ERROR_UNKNOWN_FEATURE, got %u
\n
"
,
r
);
r
=
MsiSetFeatureAttributesA
(
package
,
NULL
,
INSTALLFEATUREATTRIBUTE_FAVORLOCAL
);
ok
(
r
==
ERROR_UNKNOWN_FEATURE
,
"expected ERROR_UNKNOWN_FEATURE, got %u
\n
"
,
r
);
r
=
MsiSetFeatureAttributesA
(
package
,
"One"
,
0
);
ok
(
r
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %u
\n
"
,
r
);
attrs
=
0xdeadbeef
;
r
=
MsiGetFeatureInfoA
(
package
,
"One"
,
&
attrs
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
r
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %u
\n
"
,
r
);
ok
(
attrs
==
INSTALLFEATUREATTRIBUTE_FAVORLOCAL
,
"expected INSTALLFEATUREATTRIBUTE_FAVORLOCAL, got 0x%08x
\n
"
,
attrs
);
r
=
MsiSetFeatureAttributesA
(
package
,
"One"
,
INSTALLFEATUREATTRIBUTE_FAVORLOCAL
);
ok
(
r
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %u
\n
"
,
r
);
attrs
=
0
;
r
=
MsiGetFeatureInfoA
(
package
,
"One"
,
&
attrs
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
r
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %u
\n
"
,
r
);
ok
(
attrs
==
INSTALLFEATUREATTRIBUTE_FAVORLOCAL
,
"expected INSTALLFEATUREATTRIBUTE_FAVORLOCAL, got 0x%08x
\n
"
,
attrs
);
r
=
MsiDoAction
(
package
,
"FileCost"
);
ok
(
r
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %u
\n
"
,
r
);
r
=
MsiSetFeatureAttributesA
(
package
,
"One"
,
INSTALLFEATUREATTRIBUTE_FAVORSOURCE
);
ok
(
r
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %u
\n
"
,
r
);
attrs
=
0
;
r
=
MsiGetFeatureInfoA
(
package
,
"One"
,
&
attrs
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
r
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %u
\n
"
,
r
);
ok
(
attrs
==
INSTALLFEATUREATTRIBUTE_FAVORSOURCE
,
"expected INSTALLFEATUREATTRIBUTE_FAVORSOURCE, got 0x%08x
\n
"
,
attrs
);
r
=
MsiDoAction
(
package
,
"CostFinalize"
);
ok
(
r
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %u
\n
"
,
r
);
r
=
MsiSetFeatureAttributesA
(
package
,
"One"
,
INSTALLFEATUREATTRIBUTE_FAVORLOCAL
);
ok
(
r
==
ERROR_FUNCTION_FAILED
,
"expected ERROR_FUNCTION_FAILED, got %u
\n
"
,
r
);
MsiCloseHandle
(
package
);
DeleteFileA
(
msifile
);
}
START_TEST
(
install
)
START_TEST
(
install
)
{
{
DWORD
len
;
DWORD
len
;
...
@@ -6559,6 +6641,7 @@ START_TEST(install)
...
@@ -6559,6 +6641,7 @@ START_TEST(install)
test_command_line_parsing
();
test_command_line_parsing
();
test_upgrade_code
();
test_upgrade_code
();
test_MsiGetFeatureInfo
();
test_MsiGetFeatureInfo
();
test_MsiSetFeatureAttributes
();
DeleteFileA
(
log_file
);
DeleteFileA
(
log_file
);
...
...
include/msiquery.h
View file @
667ba16d
...
@@ -248,6 +248,10 @@ MSIHANDLE WINAPI MsiGetActiveDatabase(MSIHANDLE);
...
@@ -248,6 +248,10 @@ MSIHANDLE WINAPI MsiGetActiveDatabase(MSIHANDLE);
UINT
WINAPI
MsiViewGetColumnInfo
(
MSIHANDLE
,
MSICOLINFO
,
MSIHANDLE
*
);
UINT
WINAPI
MsiViewGetColumnInfo
(
MSIHANDLE
,
MSICOLINFO
,
MSIHANDLE
*
);
INT
WINAPI
MsiProcessMessage
(
MSIHANDLE
,
INSTALLMESSAGE
,
MSIHANDLE
);
INT
WINAPI
MsiProcessMessage
(
MSIHANDLE
,
INSTALLMESSAGE
,
MSIHANDLE
);
UINT
WINAPI
MsiSetFeatureAttributesA
(
MSIHANDLE
,
LPCSTR
,
DWORD
);
UINT
WINAPI
MsiSetFeatureAttributesW
(
MSIHANDLE
,
LPCWSTR
,
DWORD
);
#define MsiSetFeatureAttributes WINELIB_NAME_AW(MsiSetFeatureAttributes)
UINT
WINAPI
MsiSetFeatureStateA
(
MSIHANDLE
,
LPCSTR
,
INSTALLSTATE
);
UINT
WINAPI
MsiSetFeatureStateA
(
MSIHANDLE
,
LPCSTR
,
INSTALLSTATE
);
UINT
WINAPI
MsiSetFeatureStateW
(
MSIHANDLE
,
LPCWSTR
,
INSTALLSTATE
);
UINT
WINAPI
MsiSetFeatureStateW
(
MSIHANDLE
,
LPCWSTR
,
INSTALLSTATE
);
#define MsiSetFeatureState WINELIB_NAME_AW(MsiSetFeatureState)
#define MsiSetFeatureState WINELIB_NAME_AW(MsiSetFeatureState)
...
...
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