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
e17ef695
Commit
e17ef695
authored
Sep 13, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Sep 13, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the handling of MsiDoAction args (with test case).
parent
79ca56cd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
20 deletions
+41
-20
install.c
dlls/msi/install.c
+17
-20
package.c
dlls/msi/tests/package.c
+24
-0
No files found.
dlls/msi/install.c
View file @
e17ef695
...
...
@@ -41,24 +41,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi);
UINT
WINAPI
MsiDoActionA
(
MSIHANDLE
hInstall
,
LPCSTR
szAction
)
{
LPWSTR
szwAction
;
UINT
r
c
;
UINT
r
et
;
TRACE
(
" exteral attempt at action %s
\n
"
,
szAction
);
if
(
!
szAction
)
return
ERROR_FUNCTION_FAILED
;
if
(
hInstall
==
0
)
return
ERROR_FUNCTION_FAILED
;
TRACE
(
"%s
\n
"
,
debugstr_a
(
szAction
));
szwAction
=
strdupAtoW
(
szAction
);
if
(
!
szwAction
)
if
(
szAction
&&
!
szwAction
)
return
ERROR_FUNCTION_FAILED
;
rc
=
MsiDoActionW
(
hInstall
,
szwAction
);
HeapFree
(
GetProcessHeap
(),
0
,
szwAction
);
return
rc
;
ret
=
MsiDoActionW
(
hInstall
,
szwAction
);
HeapFree
(
GetProcessHeap
(),
0
,
szwAction
);
return
ret
;
}
/***********************************************************************
...
...
@@ -67,16 +60,20 @@ UINT WINAPI MsiDoActionA( MSIHANDLE hInstall, LPCSTR szAction )
UINT
WINAPI
MsiDoActionW
(
MSIHANDLE
hInstall
,
LPCWSTR
szAction
)
{
MSIPACKAGE
*
package
;
UINT
ret
=
ERROR_INVALID_HANDLE
;
UINT
ret
;
TRACE
(
"
external attempt at action %s
\n
"
,
debugstr_w
(
szAction
));
TRACE
(
"
%s
\n
"
,
debugstr_w
(
szAction
));
package
=
msihandle2msiinfo
(
hInstall
,
MSIHANDLETYPE_PACKAGE
);
if
(
package
)
{
ret
=
ACTION_PerformUIAction
(
package
,
szAction
);
if
(
!
szAction
)
return
ERROR_INVALID_PARAMETER
;
package
=
msihandle2msiinfo
(
hInstall
,
MSIHANDLETYPE_PACKAGE
);
if
(
!
package
)
return
ERROR_INVALID_HANDLE
;
ret
=
ACTION_PerformUIAction
(
package
,
szAction
);
msiobj_release
(
&
package
->
hdr
);
}
return
ret
;
}
...
...
dlls/msi/tests/package.c
View file @
e17ef695
...
...
@@ -272,9 +272,33 @@ static void test_getsourcepath( void )
MsiCloseHandle
(
hpkg
);
}
void
test_doaction
(
void
)
{
MSIHANDLE
hpkg
;
UINT
r
;
r
=
MsiDoAction
(
-
1
,
NULL
);
ok
(
r
==
ERROR_INVALID_PARAMETER
,
"wrong return val
\n
"
);
hpkg
=
package_from_db
(
create_package_db
());
ok
(
hpkg
,
"failed to create package
\n
"
);
r
=
MsiDoAction
(
hpkg
,
NULL
);
ok
(
r
==
ERROR_INVALID_PARAMETER
,
"wrong return val
\n
"
);
r
=
MsiDoAction
(
0
,
"boo"
);
ok
(
r
==
ERROR_INVALID_HANDLE
,
"wrong return val
\n
"
);
r
=
MsiDoAction
(
hpkg
,
"boo"
);
ok
(
r
==
ERROR_FUNCTION_NOT_CALLED
,
"wrong return val
\n
"
);
MsiCloseHandle
(
hpkg
);
}
START_TEST
(
package
)
{
test_createpackage
();
test_getsourcepath_bad
();
test_getsourcepath
();
test_doaction
();
}
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