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
94caa05d
Commit
94caa05d
authored
Oct 31, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Oct 31, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve MsiUseFeatureEx and MsiGetFeatureState a little, add some
simple test cases.
parent
1928ee88
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
110 additions
and
29 deletions
+110
-29
msi.c
dlls/msi/msi.c
+32
-29
.cvsignore
dlls/msi/tests/.cvsignore
+1
-0
Makefile.in
dlls/msi/tests/Makefile.in
+1
-0
msi.c
dlls/msi/tests/msi.c
+76
-0
No files found.
dlls/msi/msi.c
View file @
94caa05d
...
@@ -1076,29 +1076,20 @@ end:
...
@@ -1076,29 +1076,20 @@ end:
*/
*/
INSTALLSTATE
WINAPI
MsiQueryFeatureStateA
(
LPCSTR
szProduct
,
LPCSTR
szFeature
)
INSTALLSTATE
WINAPI
MsiQueryFeatureStateA
(
LPCSTR
szProduct
,
LPCSTR
szFeature
)
{
{
INSTALLSTATE
rc
;
LPWSTR
szwProduct
=
NULL
,
szwFeature
=
NULL
;
LPWSTR
szwProduct
=
NULL
;
INSTALLSTATE
rc
=
INSTALLSTATE_UNKNOWN
;
LPWSTR
szwFeature
=
NULL
;
if
(
szProduct
)
szwProduct
=
strdupAtoW
(
szProduct
);
{
if
(
szProduct
&&
!
szwProduct
)
szwProduct
=
strdupAtoW
(
szProduct
);
goto
end
;
if
(
!
szwProduct
)
return
ERROR_OUTOFMEMORY
;
}
if
(
szFeature
)
szwFeature
=
strdupAtoW
(
szFeature
);
{
if
(
szFeature
&&
!
szwFeature
)
szwFeature
=
strdupAtoW
(
szFeature
);
goto
end
;
if
(
!
szwFeature
)
{
msi_free
(
szwProduct
);
return
ERROR_OUTOFMEMORY
;
}
}
rc
=
MsiQueryFeatureStateW
(
szwProduct
,
szwFeature
);
rc
=
MsiQueryFeatureStateW
(
szwProduct
,
szwFeature
);
end:
msi_free
(
szwProduct
);
msi_free
(
szwProduct
);
msi_free
(
szwFeature
);
msi_free
(
szwFeature
);
...
@@ -1114,12 +1105,19 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateA(LPCSTR szProduct, LPCSTR szFeature)
...
@@ -1114,12 +1105,19 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateA(LPCSTR szProduct, LPCSTR szFeature)
*/
*/
INSTALLSTATE
WINAPI
MsiQueryFeatureStateW
(
LPCWSTR
szProduct
,
LPCWSTR
szFeature
)
INSTALLSTATE
WINAPI
MsiQueryFeatureStateW
(
LPCWSTR
szProduct
,
LPCWSTR
szFeature
)
{
{
WCHAR
squishProduct
[
GUID_SIZE
];
UINT
rc
;
UINT
rc
;
DWORD
sz
=
0
;
DWORD
sz
=
0
;
HKEY
hkey
;
HKEY
hkey
;
TRACE
(
"%s %s
\n
"
,
debugstr_w
(
szProduct
),
debugstr_w
(
szFeature
));
TRACE
(
"%s %s
\n
"
,
debugstr_w
(
szProduct
),
debugstr_w
(
szFeature
));
if
(
!
szProduct
||
!
szFeature
)
return
INSTALLSTATE_INVALIDARG
;
if
(
!
squash_guid
(
szProduct
,
squishProduct
))
return
INSTALLSTATE_INVALIDARG
;
rc
=
MSIREG_OpenFeaturesKey
(
szProduct
,
&
hkey
,
FALSE
);
rc
=
MSIREG_OpenFeaturesKey
(
szProduct
,
&
hkey
,
FALSE
);
if
(
rc
!=
ERROR_SUCCESS
)
if
(
rc
!=
ERROR_SUCCESS
)
return
INSTALLSTATE_UNKNOWN
;
return
INSTALLSTATE_UNKNOWN
;
...
@@ -1129,8 +1127,8 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature)
...
@@ -1129,8 +1127,8 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature)
if
(
rc
==
ERROR_SUCCESS
)
if
(
rc
==
ERROR_SUCCESS
)
return
INSTALLSTATE_LOCAL
;
return
INSTALLSTATE_LOCAL
;
else
return
INSTALLSTATE_ABSENT
;
return
INSTALLSTATE_UNKNOWN
;
}
}
/******************************************************************
/******************************************************************
...
@@ -1414,18 +1412,23 @@ end:
...
@@ -1414,18 +1412,23 @@ end:
INSTALLSTATE
WINAPI
MsiUseFeatureExW
(
LPCWSTR
szProduct
,
LPCWSTR
szFeature
,
INSTALLSTATE
WINAPI
MsiUseFeatureExW
(
LPCWSTR
szProduct
,
LPCWSTR
szFeature
,
DWORD
dwInstallMode
,
DWORD
dwReserved
)
DWORD
dwInstallMode
,
DWORD
dwReserved
)
{
{
FIXME
(
"%s %s %li %li
\n
"
,
debugstr_w
(
szProduct
),
debugstr_w
(
szFeature
),
INSTALLSTATE
state
;
TRACE
(
"%s %s %li %li
\n
"
,
debugstr_w
(
szProduct
),
debugstr_w
(
szFeature
),
dwInstallMode
,
dwReserved
);
dwInstallMode
,
dwReserved
);
/*
state
=
MsiQueryFeatureStateW
(
szProduct
,
szFeature
);
* Polls all the components of the feature to find install state and then
* writes:
* Software\\Microsoft\\Windows\\CurrentVersion\\
* Installer\\Products\\<squishguid>\\<feature>
* "Usage"=dword:........
*/
return
INSTALLSTATE_LOCAL
;
if
(
dwReserved
)
return
INSTALLSTATE_INVALIDARG
;
if
(
state
==
INSTALLSTATE_LOCAL
&&
dwInstallMode
!=
INSTALLMODE_NODETECTION
)
{
FIXME
(
"mark product %s feature %s as used
\n
"
,
debugstr_w
(
szProduct
),
debugstr_w
(
szFeature
)
);
}
return
state
;
}
}
/***********************************************************************
/***********************************************************************
...
...
dlls/msi/tests/.cvsignore
View file @
94caa05d
Makefile
Makefile
db.ok
db.ok
format.ok
format.ok
msi.ok
package.ok
package.ok
record.ok
record.ok
suminfo.ok
suminfo.ok
...
...
dlls/msi/tests/Makefile.in
View file @
94caa05d
...
@@ -8,6 +8,7 @@ IMPORTS = msi kernel32
...
@@ -8,6 +8,7 @@ IMPORTS = msi kernel32
CTESTS
=
\
CTESTS
=
\
db.c
\
db.c
\
format.c
\
format.c
\
msi.c
\
package.c
\
package.c
\
record.c
\
record.c
\
suminfo.c
suminfo.c
...
...
dlls/msi/tests/msi.c
0 → 100644
View file @
94caa05d
/*
* tests for Microsoft Installer functionality
*
* Copyright 2005 Mike McCormack for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdio.h>
#include <windows.h>
#include <msi.h>
#include <msiquery.h>
#include "wine/test.h"
typedef
INSTALLSTATE
(
WINAPI
*
fnMsiUseFeatureExA
)(
LPCSTR
,
LPCSTR
,
DWORD
,
DWORD
);
fnMsiUseFeatureExA
pMsiUseFeatureExA
;
static
void
test_usefeature
(
void
)
{
UINT
r
;
if
(
!
pMsiUseFeatureExA
)
return
;
r
=
MsiQueryFeatureState
(
NULL
,
NULL
);
ok
(
r
==
INSTALLSTATE_INVALIDARG
,
"wrong return val
\n
"
);
r
=
MsiQueryFeatureState
(
"{9085040-6000-11d3-8cfe-0150048383c9}"
,
NULL
);
ok
(
r
==
INSTALLSTATE_INVALIDARG
,
"wrong return val
\n
"
);
r
=
MsiUseFeatureExA
(
NULL
,
NULL
,
0
,
0
);
ok
(
r
==
INSTALLSTATE_INVALIDARG
,
"wrong return val
\n
"
);
r
=
MsiUseFeatureExA
(
NULL
,
"WORDVIEWFiles"
,
-
2
,
1
);
ok
(
r
==
INSTALLSTATE_INVALIDARG
,
"wrong return val
\n
"
);
r
=
MsiUseFeatureExA
(
"{90850409-6000-11d3-8cfe-0150048383c9}"
,
NULL
,
-
2
,
0
);
ok
(
r
==
INSTALLSTATE_INVALIDARG
,
"wrong return val
\n
"
);
r
=
MsiUseFeatureExA
(
"{9085040-6000-11d3-8cfe-0150048383c9}"
,
"WORDVIEWFiles"
,
-
2
,
0
);
ok
(
r
==
INSTALLSTATE_INVALIDARG
,
"wrong return val
\n
"
);
r
=
MsiUseFeatureExA
(
"{0085040-6000-11d3-8cfe-0150048383c9}"
,
"WORDVIEWFiles"
,
-
2
,
0
);
ok
(
r
==
INSTALLSTATE_INVALIDARG
,
"wrong return val
\n
"
);
r
=
MsiUseFeatureExA
(
"{90850409-6000-11d3-8cfe-0150048383c9}"
,
"WORDVIEWFiles"
,
-
2
,
1
);
ok
(
r
==
INSTALLSTATE_INVALIDARG
,
"wrong return val
\n
"
);
}
START_TEST
(
msi
)
{
HMODULE
hmod
=
GetModuleHandle
(
"msi.dll"
);
pMsiUseFeatureExA
=
(
fnMsiUseFeatureExA
)
GetProcAddress
(
hmod
,
"MsiUseFeatureExA"
);
test_usefeature
();
}
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