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:
*/
INSTALLSTATE
WINAPI
MsiQueryFeatureStateA
(
LPCSTR
szProduct
,
LPCSTR
szFeature
)
{
INSTALLSTATE
rc
;
LPWSTR
szwProduct
=
NULL
;
LPWSTR
szwFeature
=
NULL
;
LPWSTR
szwProduct
=
NULL
,
szwFeature
=
NULL
;
INSTALLSTATE
rc
=
INSTALLSTATE_UNKNOWN
;
if
(
szProduct
)
{
szwProduct
=
strdupAtoW
(
szProduct
);
if
(
!
szwProduct
)
return
ERROR_OUTOFMEMORY
;
}
szwProduct
=
strdupAtoW
(
szProduct
);
if
(
szProduct
&&
!
szwProduct
)
goto
end
;
if
(
szFeature
)
{
szwFeature
=
strdupAtoW
(
szFeature
);
if
(
!
szwFeature
)
{
msi_free
(
szwProduct
);
return
ERROR_OUTOFMEMORY
;
}
}
szwFeature
=
strdupAtoW
(
szFeature
);
if
(
szFeature
&&
!
szwFeature
)
goto
end
;
rc
=
MsiQueryFeatureStateW
(
szwProduct
,
szwFeature
);
end:
msi_free
(
szwProduct
);
msi_free
(
szwFeature
);
...
...
@@ -1114,12 +1105,19 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateA(LPCSTR szProduct, LPCSTR szFeature)
*/
INSTALLSTATE
WINAPI
MsiQueryFeatureStateW
(
LPCWSTR
szProduct
,
LPCWSTR
szFeature
)
{
WCHAR
squishProduct
[
GUID_SIZE
];
UINT
rc
;
DWORD
sz
=
0
;
HKEY
hkey
;
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
);
if
(
rc
!=
ERROR_SUCCESS
)
return
INSTALLSTATE_UNKNOWN
;
...
...
@@ -1129,8 +1127,8 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature)
if
(
rc
==
ERROR_SUCCESS
)
return
INSTALLSTATE_LOCAL
;
else
return
INSTALLSTATE_ABSENT
;
return
INSTALLSTATE_UNKNOWN
;
}
/******************************************************************
...
...
@@ -1414,18 +1412,23 @@ end:
INSTALLSTATE
WINAPI
MsiUseFeatureExW
(
LPCWSTR
szProduct
,
LPCWSTR
szFeature
,
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
);
/*
* Polls all the components of the feature to find install state and then
* writes:
* Software\\Microsoft\\Windows\\CurrentVersion\\
* Installer\\Products\\<squishguid>\\<feature>
* "Usage"=dword:........
*/
state
=
MsiQueryFeatureStateW
(
szProduct
,
szFeature
);
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
db.ok
format.ok
msi.ok
package.ok
record.ok
suminfo.ok
...
...
dlls/msi/tests/Makefile.in
View file @
94caa05d
...
...
@@ -8,6 +8,7 @@ IMPORTS = msi kernel32
CTESTS
=
\
db.c
\
format.c
\
msi.c
\
package.c
\
record.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