Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
ee3e0586
Commit
ee3e0586
authored
Jul 06, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
Jul 06, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Add a test for MsiGetComponentPath and make it pass.
parent
4c0e72ec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
2 deletions
+49
-2
msi.c
dlls/msi/msi.c
+4
-2
msi.c
dlls/msi/tests/msi.c
+45
-0
No files found.
dlls/msi/msi.c
View file @
ee3e0586
...
...
@@ -977,7 +977,7 @@ UINT WINAPI MsiVerifyPackageW( LPCWSTR szPackage )
INSTALLSTATE
WINAPI
MSI_GetComponentPath
(
LPCWSTR
szProduct
,
LPCWSTR
szComponent
,
awstring
*
lpPathBuf
,
DWORD
*
pcchBuf
)
{
WCHAR
squished_pc
[
GUID_SIZE
];
WCHAR
squished_pc
[
GUID_SIZE
]
,
squished_comp
[
GUID_SIZE
]
;
UINT
rc
;
INSTALLSTATE
rrc
=
INSTALLSTATE_UNKNOWN
;
HKEY
hkey
=
0
;
...
...
@@ -992,7 +992,9 @@ INSTALLSTATE WINAPI MSI_GetComponentPath(LPCWSTR szProduct, LPCWSTR szComponent,
if
(
lpPathBuf
&&
!
pcchBuf
)
return
INSTALLSTATE_INVALIDARG
;
squash_guid
(
szProduct
,
squished_pc
);
if
(
!
squash_guid
(
szProduct
,
squished_pc
)
||
!
squash_guid
(
szComponent
,
squished_comp
))
return
INSTALLSTATE_INVALIDARG
;
rc
=
MSIREG_OpenProductsKey
(
szProduct
,
&
hkey
,
FALSE
);
if
(
rc
!=
ERROR_SUCCESS
)
...
...
dlls/msi/tests/msi.c
View file @
ee3e0586
...
...
@@ -31,6 +31,8 @@ typedef UINT (WINAPI *fnMsiOpenPackageExA)(LPCSTR, DWORD, MSIHANDLE*);
fnMsiOpenPackageExA
pMsiOpenPackageExA
;
typedef
UINT
(
WINAPI
*
fnMsiOpenPackageExW
)(
LPCWSTR
,
DWORD
,
MSIHANDLE
*
);
fnMsiOpenPackageExW
pMsiOpenPackageExW
;
typedef
INSTALLSTATE
(
WINAPI
*
fnMsiGetComponentPathA
)(
LPCSTR
,
LPCSTR
,
LPSTR
,
DWORD
*
);
fnMsiGetComponentPathA
pMsiGetComponentPathA
;
static
void
test_usefeature
(
void
)
{
...
...
@@ -83,6 +85,46 @@ static void test_null(void)
ok
(
r
==
ERROR_INVALID_PARAMETER
,
"wrong error
\n
"
);
}
static
void
test_getcomponentpath
(
void
)
{
INSTALLSTATE
r
;
char
buffer
[
0x100
];
DWORD
sz
;
if
(
!
pMsiGetComponentPathA
)
return
;
r
=
pMsiGetComponentPathA
(
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
r
==
INSTALLSTATE_INVALIDARG
,
"wrong return value
\n
"
);
r
=
pMsiGetComponentPathA
(
"bogus"
,
"bogus"
,
NULL
,
NULL
);
ok
(
r
==
INSTALLSTATE_INVALIDARG
,
"wrong return value
\n
"
);
r
=
pMsiGetComponentPathA
(
"bogus"
,
"{00000000-0000-0000-000000000000}"
,
NULL
,
NULL
);
ok
(
r
==
INSTALLSTATE_INVALIDARG
,
"wrong return value
\n
"
);
sz
=
sizeof
buffer
;
buffer
[
0
]
=
0
;
r
=
pMsiGetComponentPathA
(
"bogus"
,
"{00000000-0000-0000-000000000000}"
,
buffer
,
&
sz
);
ok
(
r
==
INSTALLSTATE_INVALIDARG
,
"wrong return value
\n
"
);
r
=
pMsiGetComponentPathA
(
"{00000000-78E1-11D2-B60F-006097C998E7}"
,
"{00000000-0000-0000-0000-000000000000}"
,
buffer
,
&
sz
);
ok
(
r
==
INSTALLSTATE_UNKNOWN
,
"wrong return value
\n
"
);
r
=
pMsiGetComponentPathA
(
"{00000409-78E1-11D2-B60F-006097C998E7}"
,
"{00000000-0000-0000-0000-00000000}"
,
buffer
,
&
sz
);
ok
(
r
==
INSTALLSTATE_INVALIDARG
,
"wrong return value
\n
"
);
r
=
pMsiGetComponentPathA
(
"{00000409-78E1-11D2-B60F-006097C998E7}"
,
"{029E403D-A86A-1D11-5B5B0006799C897E}"
,
buffer
,
&
sz
);
ok
(
r
==
INSTALLSTATE_INVALIDARG
,
"wrong return value
\n
"
);
r
=
pMsiGetComponentPathA
(
"{00000000-78E1-11D2-B60F-006097C9987e}"
,
"{00000000-A68A-11d1-5B5B-0006799C897E}"
,
buffer
,
&
sz
);
ok
(
r
==
INSTALLSTATE_UNKNOWN
,
"wrong return value
\n
"
);
}
START_TEST
(
msi
)
{
HMODULE
hmod
=
GetModuleHandle
(
"msi.dll"
);
...
...
@@ -92,7 +134,10 @@ START_TEST(msi)
GetProcAddress
(
hmod
,
"MsiOpenPackageExA"
);
pMsiOpenPackageExW
=
(
fnMsiOpenPackageExW
)
GetProcAddress
(
hmod
,
"MsiOpenPackageExW"
);
pMsiGetComponentPathA
=
(
fnMsiGetComponentPathA
)
GetProcAddress
(
hmod
,
"MsiGetComponentPathA"
);
test_usefeature
();
test_null
();
test_getcomponentpath
();
}
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