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
1647de57
Commit
1647de57
authored
Jul 05, 2007
by
James Hawkins
Committed by
Alexandre Julliard
Jul 06, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Enable remote custom actions.
parent
6b97f890
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
23 deletions
+60
-23
custom.c
dlls/msi/custom.c
+59
-22
msiserver.idl
dlls/msi/msiserver.idl
+1
-1
No files found.
dlls/msi/custom.c
View file @
1647de57
...
...
@@ -613,41 +613,75 @@ static void handle_msi_break( LPCWSTR target )
DebugBreak
();
}
static
UINT
get_action_info
(
const
GUID
*
guid
,
INT
*
type
,
MSIHANDLE
*
handle
,
BSTR
*
dll
,
BSTR
*
funcname
,
IWineMsiRemotePackage
**
package
)
{
IClassFactory
*
cf
=
NULL
;
IWineMsiRemoteCustomAction
*
rca
=
NULL
;
HRESULT
r
;
r
=
DllGetClassObject
(
&
CLSID_IWineMsiRemoteCustomAction
,
&
IID_IClassFactory
,
(
LPVOID
*
)
&
cf
);
if
(
FAILED
(
r
))
{
ERR
(
"failed to get IClassFactory interface
\n
"
);
return
ERROR_FUNCTION_FAILED
;
}
r
=
IClassFactory_CreateInstance
(
cf
,
NULL
,
&
IID_IWineMsiRemoteCustomAction
,
(
LPVOID
*
)
&
rca
);
if
(
FAILED
(
r
))
{
ERR
(
"failed to get IWineMsiRemoteCustomAction interface
\n
"
);
return
ERROR_FUNCTION_FAILED
;
}
r
=
IWineMsiRemoteCustomAction_GetActionInfo
(
rca
,
guid
,
type
,
handle
,
dll
,
funcname
,
package
);
IWineMsiRemoteCustomAction_Release
(
rca
);
if
(
FAILED
(
r
))
{
ERR
(
"GetActionInfo failed
\n
"
);
return
ERROR_FUNCTION_FAILED
;
}
return
ERROR_SUCCESS
;
}
static
DWORD
WINAPI
ACTION_CallDllFunction
(
const
GUID
*
guid
)
{
msi_custom_action_info
*
info
;
MsiCustomActionEntryPoint
fn
;
MSIHANDLE
hPackage
;
MSIHANDLE
hPackage
,
handle
;
HANDLE
hModule
;
LPSTR
proc
;
UINT
r
=
ERROR_FUNCTION_FAILED
;
BSTR
dll
=
NULL
,
function
=
NULL
;
INT
type
;
IWineMsiRemotePackage
*
remote_package
=
NULL
;
info
=
find_action_by_guid
(
guid
);
if
(
!
info
)
{
ERR
(
"failed to find action %s
\n
"
,
debugstr_guid
(
guid
)
);
return
r
;
}
TRACE
(
"%s
\n
"
,
debugstr_guid
(
guid
));
TRACE
(
"%s %s
\n
"
,
debugstr_w
(
info
->
source
),
debugstr_w
(
info
->
target
)
);
r
=
get_action_info
(
guid
,
&
type
,
&
handle
,
&
dll
,
&
function
,
&
remote_package
);
if
(
r
!=
ERROR_SUCCESS
)
return
r
;
hModule
=
LoadLibraryW
(
info
->
source
);
hModule
=
LoadLibraryW
(
dll
);
if
(
!
hModule
)
{
ERR
(
"failed to load dll %s
\n
"
,
debugstr_w
(
info
->
source
)
);
ERR
(
"failed to load dll %s
\n
"
,
debugstr_w
(
dll
)
);
return
r
;
}
proc
=
strdupWtoA
(
info
->
target
);
proc
=
strdupWtoA
(
function
);
fn
=
(
MsiCustomActionEntryPoint
)
GetProcAddress
(
hModule
,
proc
);
msi_free
(
proc
);
if
(
fn
)
{
hPackage
=
alloc_msi
handle
(
&
info
->
package
->
hdr
);
hPackage
=
alloc_msi
_remote_handle
(
(
IUnknown
*
)
remote_package
);
if
(
hPackage
)
{
TRACE
(
"calling %s
\n
"
,
debugstr_w
(
info
->
target
)
);
handle_msi_break
(
info
->
target
);
IWineMsiRemotePackage_SetMsiHandle
(
remote_package
,
handle
);
TRACE
(
"calling %s
\n
"
,
debugstr_w
(
function
)
);
handle_msi_break
(
function
);
__TRY
{
...
...
@@ -656,7 +690,7 @@ static DWORD WINAPI ACTION_CallDllFunction( const GUID *guid )
__EXCEPT_PAGE_FAULT
{
ERR
(
"Custom action (%s:%s) caused a page fault: %08x
\n
"
,
debugstr_w
(
info
->
source
),
debugstr_w
(
info
->
target
),
GetExceptionCode
());
debugstr_w
(
dll
),
debugstr_w
(
function
),
GetExceptionCode
());
r
=
ERROR_SUCCESS
;
}
__ENDTRY
;
...
...
@@ -664,16 +698,17 @@ static DWORD WINAPI ACTION_CallDllFunction( const GUID *guid )
MsiCloseHandle
(
hPackage
);
}
else
ERR
(
"failed to create handle for %p
\n
"
,
info
->
package
);
ERR
(
"failed to create handle for %p
\n
"
,
remote_
package
);
}
else
ERR
(
"GetProcAddress(%s) failed
\n
"
,
debugstr_w
(
info
->
target
)
);
ERR
(
"GetProcAddress(%s) failed
\n
"
,
debugstr_w
(
function
)
);
FreeLibrary
(
hModule
);
if
(
info
->
type
&
msidbCustomActionTypeAsync
&&
info
->
type
&
msidbCustomActionTypeContinue
)
release_custom_action_data
(
info
);
IWineMsiRemotePackage_Release
(
remote_package
);
SysFreeString
(
dll
);
SysFreeString
(
function
);
MsiCloseHandle
(
handle
);
return
r
;
}
...
...
@@ -1413,7 +1448,7 @@ static ULONG WINAPI mcr_Release( IWineMsiRemoteCustomAction *iface )
}
static
HRESULT
WINAPI
mcr_GetActionInfo
(
IWineMsiRemoteCustomAction
*
iface
,
LPCGUID
custom_action_guid
,
MSIHANDLE
*
handle
,
BSTR
*
dll
,
BSTR
*
func
,
IWineMsiRemotePackage
**
remote_package
)
INT
*
type
,
MSIHANDLE
*
handle
,
BSTR
*
dll
,
BSTR
*
func
,
IWineMsiRemotePackage
**
remote_package
)
{
msi_custom_action_info
*
info
;
...
...
@@ -1421,10 +1456,12 @@ static HRESULT WINAPI mcr_GetActionInfo( IWineMsiRemoteCustomAction *iface, LPCG
if
(
!
info
)
return
E_FAIL
;
*
type
=
info
->
type
;
*
handle
=
alloc_msihandle
(
&
info
->
package
->
hdr
);
*
dll
=
SysAllocString
(
info
->
source
);
*
func
=
SysAllocString
(
info
->
target
);
release_custom_action_data
(
info
);
return
create_msi_remote_package
(
NULL
,
(
LPVOID
*
)
remote_package
);
}
...
...
dlls/msi/msiserver.idl
View file @
1647de57
...
...
@@ -66,7 +66,7 @@ interface IWineMsiRemotePackage : IUnknown
]
interface
IWineMsiRemoteCustomAction
:
IUnknown
{
HRESULT
GetActionInfo
(
[
in
]
LPCGUID
guid
,
[
out
]
MSIHANDLE
*
handle
,
[
out
]
BSTR
*
dllname
,
HRESULT
GetActionInfo
(
[
in
]
LPCGUID
guid
,
[
out
]
INT
*
type
,
[
out
]
MSIHANDLE
*
handle
,
[
out
]
BSTR
*
dllname
,
[
out
]
BSTR
*
function
,
[
out
]
IWineMsiRemotePackage
**
package
)
;
}
...
...
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