Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
1647de57
Commit
1647de57
authored
17 years ago
by
James Hawkins
Committed by
Alexandre Julliard
17 years ago
Browse files
Options
Downloads
Patches
Plain Diff
msi: Enable remote custom actions.
parent
6b97f890
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/msi/custom.c
+59
-22
59 additions, 22 deletions
dlls/msi/custom.c
dlls/msi/msiserver.idl
+1
-1
1 addition, 1 deletion
dlls/msi/msiserver.idl
with
60 additions
and
23 deletions
dlls/msi/custom.c
+
59
−
22
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
);
}
...
...
This diff is collapsed.
Click to expand it.
dlls/msi/msiserver.idl
+
1
−
1
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
)
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment