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
554e1318
Commit
554e1318
authored
Dec 10, 2009
by
James Hawkins
Committed by
Alexandre Julliard
Dec 11, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Refactor Installer.OpenProduct and Installer.OpenDatabase into respective functions.
parent
b33d47e7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
40 deletions
+74
-40
automation.c
dlls/msi/automation.c
+74
-40
No files found.
dlls/msi/automation.c
View file @
554e1318
...
...
@@ -1626,6 +1626,76 @@ done:
return
hr
;
}
static
HRESULT
InstallerImpl_OpenProduct
(
WORD
wFlags
,
DISPPARAMS
*
pDispParams
,
VARIANT
*
pVarResult
,
EXCEPINFO
*
pExcepInfo
,
UINT
*
puArgErr
)
{
HRESULT
hr
;
VARIANTARG
varg0
;
if
(
!
(
wFlags
&
DISPATCH_METHOD
))
return
DISP_E_MEMBERNOTFOUND
;
VariantInit
(
&
varg0
);
hr
=
DispGetParam
(
pDispParams
,
0
,
VT_BSTR
,
&
varg0
,
puArgErr
);
if
(
FAILED
(
hr
))
return
hr
;
FIXME
(
"%s
\n
"
,
debugstr_w
(
V_BSTR
(
&
varg0
)));
VariantInit
(
pVarResult
);
VariantClear
(
&
varg0
);
return
S_OK
;
}
static
HRESULT
InstallerImpl_OpenDatabase
(
WORD
wFlags
,
DISPPARAMS
*
pDispParams
,
VARIANT
*
pVarResult
,
EXCEPINFO
*
pExcepInfo
,
UINT
*
puArgErr
)
{
UINT
ret
;
HRESULT
hr
;
MSIHANDLE
hdb
;
IDispatch
*
dispatch
;
VARIANTARG
varg0
,
varg1
;
if
(
!
(
wFlags
&
DISPATCH_METHOD
))
return
DISP_E_MEMBERNOTFOUND
;
VariantInit
(
&
varg0
);
hr
=
DispGetParam
(
pDispParams
,
0
,
VT_BSTR
,
&
varg0
,
puArgErr
);
if
(
FAILED
(
hr
))
return
hr
;
VariantInit
(
&
varg1
);
hr
=
DispGetParam
(
pDispParams
,
1
,
VT_BSTR
,
&
varg1
,
puArgErr
);
if
(
FAILED
(
hr
))
goto
done
;
V_VT
(
pVarResult
)
=
VT_DISPATCH
;
ret
=
MsiOpenDatabaseW
(
V_BSTR
(
&
varg0
),
V_BSTR
(
&
varg1
),
&
hdb
);
if
(
ret
!=
ERROR_SUCCESS
)
{
hr
=
DISP_E_EXCEPTION
;
goto
done
;
}
hr
=
create_automation_object
(
hdb
,
NULL
,
(
LPVOID
*
)
&
dispatch
,
&
DIID_Database
,
DatabaseImpl_Invoke
,
NULL
,
0
);
if
(
SUCCEEDED
(
hr
))
V_DISPATCH
(
pVarResult
)
=
dispatch
;
done
:
VariantClear
(
&
varg0
);
VariantClear
(
&
varg1
);
return
hr
;
}
static
HRESULT
WINAPI
InstallerImpl_Invoke
(
AutomationObject
*
This
,
DISPID
dispIdMember
,
...
...
@@ -1637,7 +1707,6 @@ static HRESULT WINAPI InstallerImpl_Invoke(
EXCEPINFO
*
pExcepInfo
,
UINT
*
puArgErr
)
{
MSIHANDLE
msiHandle
;
IDispatch
*
pDispatch
=
NULL
;
UINT
ret
;
VARIANTARG
varg0
,
varg1
,
varg2
;
...
...
@@ -1661,47 +1730,12 @@ static HRESULT WINAPI InstallerImpl_Invoke(
pVarResult
,
pExcepInfo
,
puArgErr
);
case
DISPID_INSTALLER_OPENPRODUCT
:
if
(
wFlags
&
DISPATCH_METHOD
)
{
VariantInit
(
pVarResult
);
FIXME
(
"Unhandled method: OpenProduct"
);
}
else
return
DISP_E_MEMBERNOTFOUND
;
break
;
return
InstallerImpl_OpenProduct
(
wFlags
,
pDispParams
,
pVarResult
,
pExcepInfo
,
puArgErr
);
case
DISPID_INSTALLER_OPENDATABASE
:
if
(
wFlags
&
DISPATCH_METHOD
)
{
hr
=
DispGetParam
(
pDispParams
,
0
,
VT_BSTR
,
&
varg0
,
puArgErr
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
DispGetParam
(
pDispParams
,
1
,
VT_BSTR
,
&
varg1
,
puArgErr
);
if
(
FAILED
(
hr
))
{
VariantClear
(
&
varg0
);
return
hr
;
}
V_VT
(
pVarResult
)
=
VT_DISPATCH
;
if
((
ret
=
MsiOpenDatabaseW
(
V_BSTR
(
&
varg0
),
V_BSTR
(
&
varg1
),
&
msiHandle
))
==
ERROR_SUCCESS
)
{
hr
=
create_automation_object
(
msiHandle
,
NULL
,
(
LPVOID
*
)
&
pDispatch
,
&
DIID_Database
,
DatabaseImpl_Invoke
,
NULL
,
0
);
if
(
SUCCEEDED
(
hr
))
V_DISPATCH
(
pVarResult
)
=
pDispatch
;
else
ERR
(
"Failed to create Database object: 0x%08x
\n
"
,
hr
);
}
else
{
VariantClear
(
&
varg0
);
VariantClear
(
&
varg1
);
ERR
(
"MsiOpenDatabase returned %d
\n
"
,
ret
);
return
DISP_E_EXCEPTION
;
}
}
else
return
DISP_E_MEMBERNOTFOUND
;
break
;
return
InstallerImpl_OpenDatabase
(
wFlags
,
pDispParams
,
pVarResult
,
pExcepInfo
,
puArgErr
);
case
DISPID_INSTALLER_SUMMARYINFORMATION
:
if
(
wFlags
&
DISPATCH_METHOD
)
...
...
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