Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
5783c2cf
Commit
5783c2cf
authored
Sep 09, 2011
by
Hans Leidekker
Committed by
Alexandre Julliard
Sep 09, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Move the preview code to dialog.c.
parent
79e71d54
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
138 additions
and
187 deletions
+138
-187
Makefile.in
dlls/msi/Makefile.in
+0
-1
dialog.c
dlls/msi/dialog.c
+138
-1
msipriv.h
dlls/msi/msipriv.h
+0
-1
preview.c
dlls/msi/preview.c
+0
-184
No files found.
dlls/msi/Makefile.in
View file @
5783c2cf
...
@@ -31,7 +31,6 @@ C_SRCS = \
...
@@ -31,7 +31,6 @@ C_SRCS = \
msiquery.c
\
msiquery.c
\
package.c
\
package.c
\
patch.c
\
patch.c
\
preview.c
\
record.c
\
record.c
\
registry.c
\
registry.c
\
script.c
\
script.c
\
...
...
dlls/msi/dialog.c
View file @
5783c2cf
...
@@ -38,6 +38,7 @@
...
@@ -38,6 +38,7 @@
#include "commctrl.h"
#include "commctrl.h"
#include "winreg.h"
#include "winreg.h"
#include "shlwapi.h"
#include "shlwapi.h"
#include "msiserver.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "wine/unicode.h"
...
@@ -3848,7 +3849,7 @@ UINT msi_dialog_run_message_loop( msi_dialog *dialog )
...
@@ -3848,7 +3849,7 @@ UINT msi_dialog_run_message_loop( msi_dialog *dialog )
return
ERROR_SUCCESS
;
return
ERROR_SUCCESS
;
}
}
void
msi_dialog_do_preview
(
msi_dialog
*
dialog
)
static
void
msi_dialog_do_preview
(
msi_dialog
*
dialog
)
{
{
TRACE
(
"
\n
"
);
TRACE
(
"
\n
"
);
dialog
->
attributes
|=
msidbDialogAttributesVisible
;
dialog
->
attributes
|=
msidbDialogAttributesVisible
;
...
@@ -4015,3 +4016,139 @@ done:
...
@@ -4015,3 +4016,139 @@ done:
return
r
;
return
r
;
}
}
static
void
MSI_ClosePreview
(
MSIOBJECTHDR
*
arg
)
{
MSIPREVIEW
*
preview
=
(
MSIPREVIEW
*
)
arg
;
msiobj_release
(
&
preview
->
package
->
hdr
);
}
static
MSIPREVIEW
*
MSI_EnableUIPreview
(
MSIDATABASE
*
db
)
{
MSIPREVIEW
*
preview
=
NULL
;
MSIPACKAGE
*
package
;
package
=
MSI_CreatePackage
(
db
,
NULL
);
if
(
package
)
{
preview
=
alloc_msiobject
(
MSIHANDLETYPE_PREVIEW
,
sizeof
(
MSIPREVIEW
),
MSI_ClosePreview
);
if
(
preview
)
{
preview
->
package
=
package
;
msiobj_addref
(
&
package
->
hdr
);
}
msiobj_release
(
&
package
->
hdr
);
}
return
preview
;
}
UINT
WINAPI
MsiEnableUIPreview
(
MSIHANDLE
hdb
,
MSIHANDLE
*
phPreview
)
{
MSIDATABASE
*
db
;
MSIPREVIEW
*
preview
;
UINT
r
=
ERROR_FUNCTION_FAILED
;
TRACE
(
"%d %p
\n
"
,
hdb
,
phPreview
);
db
=
msihandle2msiinfo
(
hdb
,
MSIHANDLETYPE_DATABASE
);
if
(
!
db
)
{
IWineMsiRemoteDatabase
*
remote_database
;
remote_database
=
(
IWineMsiRemoteDatabase
*
)
msi_get_remote
(
hdb
);
if
(
!
remote_database
)
return
ERROR_INVALID_HANDLE
;
*
phPreview
=
0
;
IWineMsiRemoteDatabase_Release
(
remote_database
);
WARN
(
"MsiEnableUIPreview not allowed during a custom action!
\n
"
);
return
ERROR_FUNCTION_FAILED
;
}
preview
=
MSI_EnableUIPreview
(
db
);
if
(
preview
)
{
*
phPreview
=
alloc_msihandle
(
&
preview
->
hdr
);
msiobj_release
(
&
preview
->
hdr
);
r
=
ERROR_SUCCESS
;
if
(
!*
phPreview
)
r
=
ERROR_NOT_ENOUGH_MEMORY
;
}
msiobj_release
(
&
db
->
hdr
);
return
r
;
}
static
UINT
preview_event_handler
(
MSIPACKAGE
*
package
,
LPCWSTR
event
,
LPCWSTR
argument
,
msi_dialog
*
dialog
)
{
MESSAGE
(
"Preview dialog event '%s' (arg='%s')
\n
"
,
debugstr_w
(
event
),
debugstr_w
(
argument
));
return
ERROR_SUCCESS
;
}
static
UINT
MSI_PreviewDialogW
(
MSIPREVIEW
*
preview
,
LPCWSTR
szDialogName
)
{
msi_dialog
*
dialog
=
NULL
;
UINT
r
=
ERROR_SUCCESS
;
if
(
preview
->
dialog
)
msi_dialog_destroy
(
preview
->
dialog
);
/* an empty name means we should just destroy the current preview dialog */
if
(
szDialogName
)
{
dialog
=
msi_dialog_create
(
preview
->
package
,
szDialogName
,
NULL
,
preview_event_handler
);
if
(
dialog
)
msi_dialog_do_preview
(
dialog
);
else
r
=
ERROR_FUNCTION_FAILED
;
}
preview
->
dialog
=
dialog
;
return
r
;
}
UINT
WINAPI
MsiPreviewDialogW
(
MSIHANDLE
hPreview
,
LPCWSTR
szDialogName
)
{
MSIPREVIEW
*
preview
;
UINT
r
;
TRACE
(
"%d %s
\n
"
,
hPreview
,
debugstr_w
(
szDialogName
));
preview
=
msihandle2msiinfo
(
hPreview
,
MSIHANDLETYPE_PREVIEW
);
if
(
!
preview
)
return
ERROR_INVALID_HANDLE
;
r
=
MSI_PreviewDialogW
(
preview
,
szDialogName
);
msiobj_release
(
&
preview
->
hdr
);
return
r
;
}
UINT
WINAPI
MsiPreviewDialogA
(
MSIHANDLE
hPreview
,
LPCSTR
szDialogName
)
{
UINT
r
;
LPWSTR
strW
=
NULL
;
TRACE
(
"%d %s
\n
"
,
hPreview
,
debugstr_a
(
szDialogName
));
if
(
szDialogName
)
{
strW
=
strdupAtoW
(
szDialogName
);
if
(
!
strW
)
return
ERROR_OUTOFMEMORY
;
}
r
=
MsiPreviewDialogW
(
hPreview
,
strW
);
msi_free
(
strW
);
return
r
;
}
UINT
WINAPI
MsiPreviewBillboardW
(
MSIHANDLE
hPreview
,
LPCWSTR
szControlName
,
LPCWSTR
szBillboard
)
{
FIXME
(
"%d %s %s
\n
"
,
hPreview
,
debugstr_w
(
szControlName
),
debugstr_w
(
szBillboard
));
return
ERROR_CALL_NOT_IMPLEMENTED
;
}
UINT
WINAPI
MsiPreviewBillboardA
(
MSIHANDLE
hPreview
,
LPCSTR
szControlName
,
LPCSTR
szBillboard
)
{
FIXME
(
"%d %s %s
\n
"
,
hPreview
,
debugstr_a
(
szControlName
),
debugstr_a
(
szBillboard
));
return
ERROR_CALL_NOT_IMPLEMENTED
;
}
dlls/msi/msipriv.h
View file @
5783c2cf
...
@@ -922,7 +922,6 @@ extern msi_dialog *msi_dialog_create( MSIPACKAGE*, LPCWSTR, msi_dialog*, msi_dia
...
@@ -922,7 +922,6 @@ extern msi_dialog *msi_dialog_create( MSIPACKAGE*, LPCWSTR, msi_dialog*, msi_dia
extern
UINT
msi_dialog_run_message_loop
(
msi_dialog
*
)
DECLSPEC_HIDDEN
;
extern
UINT
msi_dialog_run_message_loop
(
msi_dialog
*
)
DECLSPEC_HIDDEN
;
extern
void
msi_dialog_end_dialog
(
msi_dialog
*
)
DECLSPEC_HIDDEN
;
extern
void
msi_dialog_end_dialog
(
msi_dialog
*
)
DECLSPEC_HIDDEN
;
extern
void
msi_dialog_check_messages
(
HANDLE
)
DECLSPEC_HIDDEN
;
extern
void
msi_dialog_check_messages
(
HANDLE
)
DECLSPEC_HIDDEN
;
extern
void
msi_dialog_do_preview
(
msi_dialog
*
)
DECLSPEC_HIDDEN
;
extern
void
msi_dialog_destroy
(
msi_dialog
*
)
DECLSPEC_HIDDEN
;
extern
void
msi_dialog_destroy
(
msi_dialog
*
)
DECLSPEC_HIDDEN
;
extern
void
msi_dialog_unregister_class
(
void
)
DECLSPEC_HIDDEN
;
extern
void
msi_dialog_unregister_class
(
void
)
DECLSPEC_HIDDEN
;
extern
void
msi_dialog_handle_event
(
msi_dialog
*
,
LPCWSTR
,
LPCWSTR
,
MSIRECORD
*
)
DECLSPEC_HIDDEN
;
extern
void
msi_dialog_handle_event
(
msi_dialog
*
,
LPCWSTR
,
LPCWSTR
,
MSIRECORD
*
)
DECLSPEC_HIDDEN
;
...
...
dlls/msi/preview.c
deleted
100644 → 0
View file @
79e71d54
/*
* Implementation of the Microsoft Installer (msi.dll)
*
* Copyright 2005 Mike McCormack for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define COBJMACROS
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "msi.h"
#include "msipriv.h"
#include "msiserver.h"
#include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
msi
);
static
void
MSI_ClosePreview
(
MSIOBJECTHDR
*
arg
)
{
MSIPREVIEW
*
preview
=
(
MSIPREVIEW
*
)
arg
;
msiobj_release
(
&
preview
->
package
->
hdr
);
}
static
MSIPREVIEW
*
MSI_EnableUIPreview
(
MSIDATABASE
*
db
)
{
MSIPREVIEW
*
preview
=
NULL
;
MSIPACKAGE
*
package
;
package
=
MSI_CreatePackage
(
db
,
NULL
);
if
(
package
)
{
preview
=
alloc_msiobject
(
MSIHANDLETYPE_PREVIEW
,
sizeof
(
MSIPREVIEW
),
MSI_ClosePreview
);
if
(
preview
)
{
preview
->
package
=
package
;
msiobj_addref
(
&
package
->
hdr
);
}
msiobj_release
(
&
package
->
hdr
);
}
return
preview
;
}
UINT
WINAPI
MsiEnableUIPreview
(
MSIHANDLE
hdb
,
MSIHANDLE
*
phPreview
)
{
MSIDATABASE
*
db
;
MSIPREVIEW
*
preview
;
UINT
r
=
ERROR_FUNCTION_FAILED
;
TRACE
(
"%d %p
\n
"
,
hdb
,
phPreview
);
db
=
msihandle2msiinfo
(
hdb
,
MSIHANDLETYPE_DATABASE
);
if
(
!
db
)
{
IWineMsiRemoteDatabase
*
remote_database
;
remote_database
=
(
IWineMsiRemoteDatabase
*
)
msi_get_remote
(
hdb
);
if
(
!
remote_database
)
return
ERROR_INVALID_HANDLE
;
*
phPreview
=
0
;
IWineMsiRemoteDatabase_Release
(
remote_database
);
WARN
(
"MsiEnableUIPreview not allowed during a custom action!
\n
"
);
return
ERROR_FUNCTION_FAILED
;
}
preview
=
MSI_EnableUIPreview
(
db
);
if
(
preview
)
{
*
phPreview
=
alloc_msihandle
(
&
preview
->
hdr
);
msiobj_release
(
&
preview
->
hdr
);
r
=
ERROR_SUCCESS
;
if
(
!
*
phPreview
)
r
=
ERROR_NOT_ENOUGH_MEMORY
;
}
msiobj_release
(
&
db
->
hdr
);
return
r
;
}
static
UINT
preview_event_handler
(
MSIPACKAGE
*
package
,
LPCWSTR
event
,
LPCWSTR
argument
,
msi_dialog
*
dialog
)
{
MESSAGE
(
"Preview dialog event '%s' (arg='%s')
\n
"
,
debugstr_w
(
event
),
debugstr_w
(
argument
));
return
ERROR_SUCCESS
;
}
static
UINT
MSI_PreviewDialogW
(
MSIPREVIEW
*
preview
,
LPCWSTR
szDialogName
)
{
msi_dialog
*
dialog
=
NULL
;
UINT
r
=
ERROR_SUCCESS
;
if
(
preview
->
dialog
)
msi_dialog_destroy
(
preview
->
dialog
);
/* an empty name means we should just destroy the current preview dialog */
if
(
szDialogName
)
{
dialog
=
msi_dialog_create
(
preview
->
package
,
szDialogName
,
NULL
,
preview_event_handler
);
if
(
dialog
)
msi_dialog_do_preview
(
dialog
);
else
r
=
ERROR_FUNCTION_FAILED
;
}
preview
->
dialog
=
dialog
;
return
r
;
}
UINT
WINAPI
MsiPreviewDialogW
(
MSIHANDLE
hPreview
,
LPCWSTR
szDialogName
)
{
MSIPREVIEW
*
preview
;
UINT
r
;
TRACE
(
"%d %s
\n
"
,
hPreview
,
debugstr_w
(
szDialogName
));
preview
=
msihandle2msiinfo
(
hPreview
,
MSIHANDLETYPE_PREVIEW
);
if
(
!
preview
)
return
ERROR_INVALID_HANDLE
;
r
=
MSI_PreviewDialogW
(
preview
,
szDialogName
);
msiobj_release
(
&
preview
->
hdr
);
return
r
;
}
UINT
WINAPI
MsiPreviewDialogA
(
MSIHANDLE
hPreview
,
LPCSTR
szDialogName
)
{
UINT
r
;
LPWSTR
strW
=
NULL
;
TRACE
(
"%d %s
\n
"
,
hPreview
,
debugstr_a
(
szDialogName
));
if
(
szDialogName
)
{
strW
=
strdupAtoW
(
szDialogName
);
if
(
!
strW
)
return
ERROR_OUTOFMEMORY
;
}
r
=
MsiPreviewDialogW
(
hPreview
,
strW
);
msi_free
(
strW
);
return
r
;
}
UINT
WINAPI
MsiPreviewBillboardW
(
MSIHANDLE
hPreview
,
LPCWSTR
szControlName
,
LPCWSTR
szBillboard
)
{
FIXME
(
"%d %s %s
\n
"
,
hPreview
,
debugstr_w
(
szControlName
),
debugstr_w
(
szBillboard
));
return
ERROR_CALL_NOT_IMPLEMENTED
;
}
UINT
WINAPI
MsiPreviewBillboardA
(
MSIHANDLE
hPreview
,
LPCSTR
szControlName
,
LPCSTR
szBillboard
)
{
FIXME
(
"%d %s %s
\n
"
,
hPreview
,
debugstr_a
(
szControlName
),
debugstr_a
(
szBillboard
));
return
ERROR_CALL_NOT_IMPLEMENTED
;
}
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