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
6d9c80e8
Commit
6d9c80e8
authored
Oct 26, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Oct 26, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create an internal handle-free api for reading MSI database summary
information.
parent
2cb23165
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
44 deletions
+70
-44
msipriv.h
dlls/msi/msipriv.h
+14
-0
suminfo.c
dlls/msi/suminfo.c
+56
-44
No files found.
dlls/msi/msipriv.h
View file @
6d9c80e8
...
...
@@ -219,6 +219,16 @@ typedef struct tagMSIPREVIEW
msi_dialog
*
dialog
;
}
MSIPREVIEW
;
#define MSI_MAX_PROPS 20
typedef
struct
tagMSISUMMARYINFO
{
MSIOBJECTHDR
hdr
;
MSIDATABASE
*
db
;
DWORD
update_count
;
PROPVARIANT
property
[
MSI_MAX_PROPS
];
}
MSISUMMARYINFO
;
#define MSIHANDLETYPE_ANY 0
#define MSIHANDLETYPE_DATABASE 1
#define MSIHANDLETYPE_SUMMARYINFO 2
...
...
@@ -401,6 +411,10 @@ extern void msi_dialog_handle_event( msi_dialog*, LPCWSTR, LPCWSTR, MSIRECORD *
extern
MSIPREVIEW
*
MSI_EnableUIPreview
(
MSIDATABASE
*
);
extern
UINT
MSI_PreviewDialogW
(
MSIPREVIEW
*
,
LPCWSTR
);
/* summary information */
extern
MSISUMMARYINFO
*
MSI_GetSummaryInformationW
(
MSIDATABASE
*
db
,
UINT
uiUpdateCount
);
extern
LPWSTR
msi_suminfo_dup_string
(
MSISUMMARYINFO
*
si
,
UINT
uiProperty
);
/* undocumented functions */
UINT
WINAPI
MsiCreateAndVerifyInstallerDirectory
(
DWORD
);
UINT
WINAPI
MsiDecomposeDescriptorW
(
LPCWSTR
,
LPWSTR
,
LPWSTR
,
LPWSTR
,
DWORD
*
);
...
...
dlls/msi/suminfo.c
View file @
6d9c80e8
...
...
@@ -37,8 +37,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
msi
);
#define MSI_MAX_PROPS 20
#include "pshpack1.h"
typedef
struct
{
...
...
@@ -81,14 +79,6 @@ typedef struct {
#define SECT_HDR_SIZE (sizeof(PROPERTYSECTIONHEADER))
typedef
struct
tagMSISUMMARYINFO
{
MSIOBJECTHDR
hdr
;
MSIDATABASE
*
db
;
DWORD
update_count
;
PROPVARIANT
property
[
MSI_MAX_PROPS
];
}
MSISUMMARYINFO
;
static
const
WCHAR
szSumInfo
[]
=
{
5
,
'S'
,
'u'
,
'm'
,
'm'
,
'a'
,
'r'
,
'y'
,
'I'
,
'n'
,
'f'
,
'o'
,
'r'
,
'm'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
0
};
...
...
@@ -415,45 +405,19 @@ static UINT save_summary_info( MSISUMMARYINFO * si, IStream *stm )
return
ERROR_SUCCESS
;
}
UINT
WINAPI
MsiGetSummaryInformationW
(
MSIHANDLE
hDatabase
,
LPCWSTR
szDatabase
,
UINT
uiUpdateCount
,
MSIHANDLE
*
pHandle
)
MSISUMMARYINFO
*
MSI_GetSummaryInformationW
(
MSIDATABASE
*
db
,
UINT
uiUpdateCount
)
{
UINT
ret
=
ERROR_SUCCESS
;
IStream
*
stm
=
NULL
;
MSISUMMARYINFO
*
si
;
MSIHANDLE
handle
;
MSIDATABASE
*
db
;
DWORD
grfMode
;
HRESULT
r
;
TRACE
(
"%ld %s %d %p
\n
"
,
hDatabase
,
debugstr_w
(
szDatabase
),
uiUpdateCount
,
pHandle
);
if
(
!
pHandle
)
return
ERROR_INVALID_PARAMETER
;
if
(
szDatabase
)
{
UINT
res
;
res
=
MSI_OpenDatabaseW
(
szDatabase
,
NULL
,
&
db
);
if
(
res
!=
ERROR_SUCCESS
)
return
res
;
}
else
{
db
=
msihandle2msiinfo
(
hDatabase
,
MSIHANDLETYPE_DATABASE
);
if
(
!
db
)
return
ERROR_INVALID_PARAMETER
;
}
TRACE
(
"%p %d
\n
"
,
db
,
uiUpdateCount
);
si
=
alloc_msiobject
(
MSIHANDLETYPE_SUMMARYINFO
,
sizeof
(
MSISUMMARYINFO
),
MSI_CloseSummaryInfo
);
if
(
!
si
)
{
ret
=
ERROR_FUNCTION_FAILED
;
goto
end
;
}
return
si
;
msiobj_addref
(
&
db
->
hdr
);
si
->
db
=
db
;
...
...
@@ -469,14 +433,44 @@ UINT WINAPI MsiGetSummaryInformationW( MSIHANDLE hDatabase,
IStream_Release
(
stm
);
}
handle
=
alloc_msihandle
(
&
si
->
hdr
);
if
(
handle
)
*
pHandle
=
handle
;
return
si
;
}
UINT
WINAPI
MsiGetSummaryInformationW
(
MSIHANDLE
hDatabase
,
LPCWSTR
szDatabase
,
UINT
uiUpdateCount
,
MSIHANDLE
*
pHandle
)
{
MSISUMMARYINFO
*
si
;
MSIDATABASE
*
db
;
UINT
ret
=
ERROR_FUNCTION_FAILED
;
TRACE
(
"%ld %s %d %p
\n
"
,
hDatabase
,
debugstr_w
(
szDatabase
),
uiUpdateCount
,
pHandle
);
if
(
!
pHandle
)
return
ERROR_INVALID_PARAMETER
;
if
(
szDatabase
)
{
ret
=
MSI_OpenDatabaseW
(
szDatabase
,
NULL
,
&
db
);
if
(
ret
!=
ERROR_SUCCESS
)
return
ret
;
}
else
ret
=
ERROR_FUNCTION_FAILED
;
{
db
=
msihandle2msiinfo
(
hDatabase
,
MSIHANDLETYPE_DATABASE
);
if
(
!
db
)
return
ERROR_INVALID_PARAMETER
;
}
si
=
MSI_GetSummaryInformationW
(
db
,
uiUpdateCount
);
if
(
si
)
{
*
pHandle
=
alloc_msihandle
(
&
si
->
hdr
);
if
(
*
pHandle
)
ret
=
ERROR_SUCCESS
;
msiobj_release
(
&
si
->
hdr
);
}
end:
if
(
db
)
msiobj_release
(
&
db
->
hdr
);
...
...
@@ -537,6 +531,12 @@ static UINT get_prop( MSIHANDLE handle, UINT uiProperty, UINT *puiDataType,
if
(
!
si
)
return
ERROR_INVALID_HANDLE
;
if
(
uiProperty
>=
MSI_MAX_PROPS
)
{
*
puiDataType
=
VT_EMPTY
;
return
ret
;
}
prop
=
&
si
->
property
[
uiProperty
];
if
(
puiDataType
)
...
...
@@ -588,6 +588,18 @@ static UINT get_prop( MSIHANDLE handle, UINT uiProperty, UINT *puiDataType,
return
ret
;
}
LPWSTR
msi_suminfo_dup_string
(
MSISUMMARYINFO
*
si
,
UINT
uiProperty
)
{
PROPVARIANT
*
prop
;
if
(
uiProperty
>=
MSI_MAX_PROPS
)
return
NULL
;
prop
=
&
si
->
property
[
uiProperty
];
if
(
prop
->
vt
!=
VT_LPSTR
)
return
NULL
;
return
strdupAtoW
(
prop
->
u
.
pszVal
);
}
UINT
WINAPI
MsiSummaryInfoGetPropertyA
(
MSIHANDLE
handle
,
UINT
uiProperty
,
UINT
*
puiDataType
,
INT
*
piValue
,
FILETIME
*
pftValue
,
LPSTR
szValueBuf
,
DWORD
*
pcchValueBuf
)
...
...
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