ReactOS 0.4.17-dev-357-ga8f14ff
dialog.c
Go to the documentation of this file.
1/*
2 * Implementation of the Microsoft Installer (msi.dll)
3 *
4 * Copyright 2005 Mike McCormack for CodeWeavers
5 * Copyright 2005 Aric Stewart for CodeWeavers
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 */
21
22#define COBJMACROS
23
24#include <stdarg.h>
25
26#include "windef.h"
27#include "winbase.h"
28#include "wingdi.h"
29#include "winuser.h"
30#include "winnls.h"
31#include "msi.h"
32#include "msidefs.h"
33#include "ocidl.h"
34#include "olectl.h"
35#include "richedit.h"
36#include "commctrl.h"
37#include "winreg.h"
38#include "shlwapi.h"
39#include "shellapi.h"
40
41#include "wine/debug.h"
42
43#include "msipriv.h"
44#include "msiserver.h"
45#include "resource.h"
46
48
50
51struct control
52{
53 struct list entry;
55 UINT (*handler)( msi_dialog *, struct control *, WPARAM );
56 void (*update)( msi_dialog *, struct control * );
70};
71
72struct font
73{
74 struct list entry;
75 HFONT hfont;
78};
79
81{
84 UINT (*event_handler)( msi_dialog *, const WCHAR *, const WCHAR * );
91 struct list fonts;
92 struct list controls;
100};
101
103{
104 struct list entry;
109};
110
112{
115};
116
118{
122};
123
124/* dialog sequencing */
125
126#define WM_MSI_DIALOG_CREATE (WM_USER+0x100)
127#define WM_MSI_DIALOG_DESTROY (WM_USER+0x101)
128
129#define USER_INSTALLSTATE_ALL 0x1000
130
133
135{
136 UINT sz, r;
137 WCHAR *buf, *new_buf;
138
139 sz = 0x20;
140 buf = malloc( sz * sizeof(WCHAR) );
141 while ( buf )
142 {
143 r = GetWindowTextW( hwnd, buf, sz );
144 if ( r < (sz - 1) )
145 break;
146 sz *= 2;
147 new_buf = realloc( buf, sz * sizeof(WCHAR) );
148 if ( !new_buf )
149 free( buf );
150 buf = new_buf;
151 }
152
153 return buf;
154}
155
157{
158 return MulDiv( val, dialog->scale, 12 );
159}
160
162{
163 struct control *control;
164
165 if( !name )
166 return NULL;
167 if( !dialog->hwnd )
168 return NULL;
169 LIST_FOR_EACH_ENTRY( control, &dialog->controls, struct control, entry )
170 if( !wcscmp( control->name, name ) ) /* FIXME: case sensitive? */
171 return control;
172 return NULL;
173}
174
176{
177 struct control *control;
178
179 if( !type )
180 return NULL;
181 if( !dialog->hwnd )
182 return NULL;
183 LIST_FOR_EACH_ENTRY( control, &dialog->controls, struct control, entry )
184 if( !wcscmp( control->type, type ) ) /* FIXME: case sensitive? */
185 return control;
186 return NULL;
187}
188
190{
191 struct control *control;
192
193 if( !dialog->hwnd )
194 return NULL;
195 LIST_FOR_EACH_ENTRY( control, &dialog->controls, struct control, entry )
196 if( hwnd == control->hwnd )
197 return control;
198 return NULL;
199}
200
202{
204 LPWSTR ret = NULL;
205
206 if (str)
207 deformat_string( package, str, &ret );
208 return ret;
209}
210
212{
213 LPWSTR prop = NULL;
214
215 if (!property)
216 return NULL;
217
218 if (indirect)
219 prop = msi_dup_property( dialog->package->db, property );
220
221 if (!prop)
222 prop = wcsdup( property );
223
224 return prop;
225}
226
227/*
228 * dialog_get_style
229 *
230 * Extract the {\style} string from the front of the text to display and
231 * update the pointer. Only the last style in a list is applied.
232 */
233static WCHAR *dialog_get_style( const WCHAR *p, const WCHAR **rest )
234{
235 LPWSTR ret;
236 LPCWSTR q, i, first;
237 DWORD len;
238
239 q = NULL;
240 *rest = p;
241 if( !p )
242 return NULL;
243
244 while ((first = wcschr( p, '{' )) && (q = wcschr( first + 1, '}' )))
245 {
246 p = first + 1;
247 if( *p != '\\' && *p != '&' )
248 return NULL;
249
250 /* little bit of sanity checking to stop us getting confused with RTF */
251 for( i=++p; i<q; i++ )
252 if( *i == '}' || *i == '\\' )
253 return NULL;
254 }
255
256 if (!q)
257 return NULL;
258
259 *rest = ++q;
260 len = q - p;
261
262 ret = malloc( len * sizeof(WCHAR) );
263 if( !ret )
264 return ret;
265 memcpy( ret, p, len*sizeof(WCHAR) );
266 ret[len-1] = 0;
267 return ret;
268}
269
270static UINT dialog_add_font( MSIRECORD *rec, void *param )
271{
273 struct font *font;
275 LOGFONTW lf;
276 INT style;
277 HDC hdc;
278
279 /* create a font and add it to the list */
280 name = MSI_RecordGetString( rec, 1 );
281 font = malloc( offsetof( struct font, name[wcslen( name ) + 1] ) );
282 lstrcpyW( font->name, name );
283 list_add_head( &dialog->fonts, &font->entry );
284
285 font->color = MSI_RecordGetInteger( rec, 4 );
286
287 memset( &lf, 0, sizeof lf );
288 face = MSI_RecordGetString( rec, 2 );
289 lf.lfHeight = MSI_RecordGetInteger( rec, 3 );
290 style = MSI_RecordGetInteger( rec, 5 );
292 lf.lfWeight = FW_BOLD;
294 lf.lfItalic = TRUE;
296 lf.lfUnderline = TRUE;
298 lf.lfStrikeOut = TRUE;
300
301 /* adjust the height */
302 hdc = GetDC( dialog->hwnd );
303 if (hdc)
304 {
306 ReleaseDC( dialog->hwnd, hdc );
307 }
308
309 font->hfont = CreateFontIndirectW( &lf );
310
311 TRACE("Adding font style %s\n", debugstr_w(font->name) );
312
313 return ERROR_SUCCESS;
314}
315
317{
318 struct font *font = NULL;
319
320 LIST_FOR_EACH_ENTRY( font, &dialog->fonts, struct font, entry )
321 if( !wcscmp( font->name, name ) ) /* FIXME: case sensitive? */
322 break;
323
324 return font;
325}
326
328{
329 struct font *font;
330
332 if( font )
334 else
335 ERR("No font entry for %s\n", debugstr_w(name));
336 return ERROR_SUCCESS;
337}
338
340{
341 MSIQUERY *view;
342 UINT r;
343
344 TRACE("dialog %p\n", dialog );
345
346 r = MSI_OpenQuery( dialog->package->db, &view, L"SELECT * FROM `TextStyle`" );
347 if( r != ERROR_SUCCESS )
348 return r;
349
351 msiobj_release( &view->hdr );
352 return r;
353}
354
355static void destroy_control( struct control *t )
356{
357 list_remove( &t->entry );
358 /* leave dialog->hwnd - destroying parent destroys child windows */
359 free( t->property );
360 free( t->value );
361 if( t->hBitmap )
362 DeleteObject( t->hBitmap );
363 if( t->hIcon )
364 DestroyIcon( t->hIcon );
365 if ( t->hImageList )
366 ImageList_Destroy( t->hImageList );
367 free( t->tabnext );
368 free( t->type );
369 if (t->hDll)
370 FreeLibrary( t->hDll );
371 free( t );
372}
373
375 const WCHAR *szCls, const WCHAR *name, const WCHAR *text,
377{
378 DWORD x, y, width, height;
379 LPWSTR font = NULL, title_font = NULL;
381 struct control *control;
382
383 style |= WS_CHILD;
384
385 control = malloc( offsetof( struct control, name[wcslen( name ) + 1] ) );
386 if (!control)
387 return NULL;
388
390 list_add_tail( &dialog->controls, &control->entry );
394 control->value = NULL;
396 control->hIcon = NULL;
398 control->hDll = NULL;
399 control->tabnext = wcsdup( MSI_RecordGetString( rec, 11 ) );
400 control->type = wcsdup( MSI_RecordGetString( rec, 3 ) );
402 control->progress_max = 100;
404
405 x = MSI_RecordGetInteger( rec, 4 );
406 y = MSI_RecordGetInteger( rec, 5 );
407 width = MSI_RecordGetInteger( rec, 6 );
408 height = MSI_RecordGetInteger( rec, 7 );
409
414
415 if( text )
416 {
417 deformat_string( dialog->package, text, &title_font );
418 font = dialog_get_style( title_font, &title );
419 }
420
421 if (!wcsicmp( MSI_RecordGetString( rec, 3 ), L"Line" ))
422 height = 2; /* line is exactly 2 units in height */
423
424 control->hwnd = CreateWindowExW( exstyle, szCls, title, style,
425 x, y, width, height, parent, NULL, NULL, NULL );
426
427 TRACE("Dialog %s control %s hwnd %p\n",
429
430 dialog_set_font( dialog, control->hwnd, font ? font : dialog->default_font );
431
432 free( title_font );
433 free( font );
434
435 return control;
436}
437
439{
440 MSIRECORD *rec;
441 LPWSTR text;
442
443 rec = MSI_QueryGetRecord( dialog->package->db, L"SELECT * FROM `UIText` WHERE `Key` = '%s'", key );
444 if (!rec) return NULL;
445 text = wcsdup( MSI_RecordGetString( rec, 2 ) );
446 msiobj_release( &rec->hdr );
447 return text;
448}
449
451{
452 MSIRECORD *rec;
453 HANDLE himage = NULL;
454 LPWSTR tmp;
455 UINT r;
456
457 TRACE("%p %s %u %u %08x\n", db, debugstr_w(name), cx, cy, flags);
458
459 if (!(tmp = msi_create_temp_file( db ))) return NULL;
460
461 rec = MSI_QueryGetRecord( db, L"SELECT * FROM `Binary` WHERE `Name` = '%s'", name );
462 if( rec )
463 {
464 r = MSI_RecordStreamToFile( rec, 2, tmp );
465 if( r == ERROR_SUCCESS )
466 {
467 himage = LoadImageW( 0, tmp, type, cx, cy, flags );
468 }
469 msiobj_release( &rec->hdr );
470 }
471 DeleteFileW( tmp );
472
473 free( tmp );
474 return himage;
475}
476
478{
479 DWORD cx = 0, cy = 0, flags;
480
483 {
484 flags &= ~LR_DEFAULTSIZE;
486 {
487 cx += 16;
488 cy += 16;
489 }
491 {
492 cx += 32;
493 cy += 32;
494 }
495 /* msidbControlAttributesIconSize48 handled by above logic */
496 }
497 return load_image( db, text, IMAGE_ICON, cx, cy, flags );
498}
499
501{
502 struct control *control;
503
504 LIST_FOR_EACH_ENTRY( control, &dialog->controls, struct control, entry )
505 {
508 }
509}
510
512{
513 struct control *control;
514
515 LIST_FOR_EACH_ENTRY( control, &dialog->controls, struct control, entry )
516 {
517 if ( control->property && control->update )
519 }
520}
521
522static void dialog_set_property( MSIPACKAGE *package, const WCHAR *property, const WCHAR *value )
523{
524 UINT r = msi_set_property( package->db, property, value, -1 );
525 if (r == ERROR_SUCCESS && !wcscmp( property, L"SourceDir" ))
526 msi_reset_source_folders( package );
527}
528
530{
531 TVITEMW tvi;
532
533 /* get the feature from the item */
534 memset( &tvi, 0, sizeof tvi );
535 tvi.hItem = hItem;
537 SendMessageW( hwnd, TVM_GETITEMW, 0, (LPARAM)&tvi );
538 return (MSIFEATURE *)tvi.lParam;
539}
540
542{
547};
548
550{
551 struct msi_selection_tree_info *info = GetPropW( control->hwnd, L"MSIDATA" );
552 return seltree_feature_from_item( control->hwnd, info->selected );
553}
554
556{
557 struct control* ctrl;
558
560 if (!ctrl)
561 return;
562 if( !wcscmp( attribute, L"Text" ) )
563 {
564 const WCHAR *font_text, *text = NULL;
565 WCHAR *font, *text_fmt = NULL;
566
567 font_text = MSI_RecordGetString( rec , 1 );
568 font = dialog_get_style( font_text, &text );
569 deformat_string( dialog->package, text, &text_fmt );
570 if (text_fmt) text = text_fmt;
571 else text = L"";
572
573 SetWindowTextW( ctrl->hwnd, text );
574
575 free( font );
576 free( text_fmt );
578 }
579 else if( !wcscmp( attribute, L"Progress" ) )
580 {
581 DWORD func, val1, val2, units;
582
583 func = MSI_RecordGetInteger( rec, 1 );
584 val1 = MSI_RecordGetInteger( rec, 2 );
585 val2 = MSI_RecordGetInteger( rec, 3 );
586
587 TRACE( "progress: func %lu val1 %lu val2 %lu\n", func, val1, val2 );
588
589 units = val1 / 512;
590 switch (func)
591 {
592 case 0: /* init */
593 SendMessageW( ctrl->hwnd, PBM_SETRANGE, 0, MAKELPARAM(0,100) );
594 if (val2)
595 {
596 ctrl->progress_max = units ? units : 100;
597 ctrl->progress_current = units;
598 ctrl->progress_backwards = TRUE;
599 SendMessageW( ctrl->hwnd, PBM_SETPOS, 100, 0 );
600 }
601 else
602 {
603 ctrl->progress_max = units ? units : 100;
604 ctrl->progress_current = 0;
605 ctrl->progress_backwards = FALSE;
606 SendMessageW( ctrl->hwnd, PBM_SETPOS, 0, 0 );
607 }
608 break;
609 case 1: /* action data increment */
610 if (val2) dialog->package->action_progress_increment = val1;
611 else dialog->package->action_progress_increment = 0;
612 break;
613 case 2: /* move */
614 if (ctrl->progress_backwards)
615 {
616 if (units >= ctrl->progress_current) ctrl->progress_current -= units;
617 else ctrl->progress_current = 0;
618 }
619 else
620 {
621 if (ctrl->progress_current + units < ctrl->progress_max) ctrl->progress_current += units;
622 else ctrl->progress_current = ctrl->progress_max;
623 }
624 SendMessageW( ctrl->hwnd, PBM_SETPOS, MulDiv(100, ctrl->progress_current, ctrl->progress_max), 0 );
625 break;
626 case 3: /* add */
627 ctrl->progress_max += units;
628 break;
629 default:
630 FIXME( "unknown progress message %lu\n", func );
631 break;
632 }
633 }
634 else if ( !wcscmp( attribute, L"Property" ) )
635 {
637 if (feature) dialog_set_property( dialog->package, ctrl->property, feature->Directory );
638 }
639 else if ( !wcscmp( attribute, L"SelectionPath" ) )
640 {
643 if (!path) return;
644 SetWindowTextW( ctrl->hwnd, path );
645 free( path );
646 }
647 else
648 {
649 FIXME("Attribute %s not being set\n", debugstr_w(attribute));
650 return;
651 }
652}
653
654static void event_subscribe( msi_dialog *dialog, const WCHAR *event, const WCHAR *control, const WCHAR *attribute )
655{
656 struct subscriber *sub;
657
658 TRACE("dialog %s event %s control %s attribute %s\n", debugstr_w(dialog->name), debugstr_w(event),
660
661 LIST_FOR_EACH_ENTRY( sub, &dialog->package->subscriptions, struct subscriber, entry )
662 {
663 if (sub->dialog == dialog &&
664 !wcsicmp( sub->event, event ) &&
665 !wcsicmp( sub->control, control ) &&
666 !wcsicmp( sub->attribute, attribute ))
667 {
668 TRACE("already subscribed\n");
669 return;
670 };
671 }
672 if (!(sub = malloc( sizeof(*sub) ))) return;
673 sub->dialog = dialog;
674 sub->event = wcsdup( event );
675 sub->control = wcsdup( control );
676 sub->attribute = wcsdup( attribute );
677 list_add_tail( &dialog->package->subscriptions, &sub->entry );
678}
679
681{
684};
685
687{
688 struct dialog_control *dc = param;
689 const WCHAR *event = MSI_RecordGetString( row, 3 );
690 const WCHAR *attribute = MSI_RecordGetString( row, 4 );
691
692 event_subscribe( dc->dialog, event, dc->control, attribute );
693 return ERROR_SUCCESS;
694}
695
697{
698 MSIQUERY *view;
700 {
701 dialog,
702 control
703 };
704
705 if (!MSI_OpenQuery( dialog->package->db, &view,
706 L"SELECT * FROM `EventMapping` WHERE `Dialog_` = '%s' AND `Control_` = '%s'",
707 dialog->name, control ))
708 {
710 msiobj_release( &view->hdr );
711 }
712}
713
714/* everything except radio buttons */
715static struct control *dialog_add_control( msi_dialog *dialog, MSIRECORD *rec, const WCHAR *szCls, DWORD style )
716{
718 const WCHAR *text = NULL, *name, *control_type;
719 DWORD exstyle = 0;
720
721 name = MSI_RecordGetString( rec, 2 );
724 if (wcscmp( control_type, L"ScrollableText" )) text = MSI_RecordGetString( rec, 10 );
725
726 TRACE( "%s, %s, %#lx, %s, %#lx\n", debugstr_w(szCls), debugstr_w(name), attributes, debugstr_w(text), style );
727
729 style |= WS_VISIBLE;
733 exstyle |= WS_EX_CLIENTEDGE;
734
736
737 return dialog_create_window( dialog, rec, exstyle, szCls, name, text, style, dialog->hwnd );
738}
739
741{
742 struct font *font;
745};
746
747/*
748 * we don't erase our own background,
749 * so we have to make sure that the parent window redraws first
750 */
752{
753 HWND hParent;
754 RECT rc;
755
756 hParent = GetParent( hWnd );
757 GetWindowRect( hWnd, &rc );
758 MapWindowPoints( NULL, hParent, (LPPOINT) &rc, 2 );
759 InvalidateRect( hParent, &rc, TRUE );
760}
761
763{
764 struct msi_text_info *info;
765 LRESULT r = 0;
766
767 TRACE( "%p %04x %#Ix %#Ix\n", hWnd, msg, wParam, lParam );
768
769 info = GetPropW(hWnd, L"MSIDATA");
770
771 if( msg == WM_CTLCOLORSTATIC &&
772 ( info->attributes & msidbControlAttributesTransparent ) )
773 {
776 }
777
778 r = CallWindowProcW(info->oldproc, hWnd, msg, wParam, lParam);
779 if ( info->font )
780 SetTextColor( (HDC)wParam, info->font->color );
781
782 switch( msg )
783 {
784 case WM_SETTEXT:
786 break;
787 case WM_NCDESTROY:
788 free( info );
789 RemovePropW( hWnd, L"MSIDATA" );
790 break;
791 }
792
793 return r;
794}
795
797{
798 struct control *control;
799 struct msi_text_info *info;
800 LPCWSTR text, ptr, prop, control_name;
801 LPWSTR font_name;
802
803 TRACE("%p %p\n", dialog, rec);
804
805 control = dialog_add_control( dialog, rec, L"Static", SS_LEFT | WS_GROUP );
806 if( !control )
808
809 info = malloc( sizeof *info );
810 if( !info )
811 return ERROR_SUCCESS;
812
813 control_name = MSI_RecordGetString( rec, 2 );
815 prop = MSI_RecordGetString( rec, 9 );
817
818 text = MSI_RecordGetString( rec, 10 );
819 font_name = dialog_get_style( text, &ptr );
820 info->font = ( font_name ) ? dialog_find_font( dialog, font_name ) : NULL;
821 free( font_name );
822
823 info->attributes = MSI_RecordGetInteger( rec, 8 );
824 if( info->attributes & msidbControlAttributesTransparent )
826
829 SetPropW( control->hwnd, L"MSIDATA", info );
830
831 event_subscribe( dialog, L"SelectionPath", control_name, L"SelectionPath" );
832 return ERROR_SUCCESS;
833}
834
835/* strip any leading text style label from text field */
836static WCHAR *get_binary_name( MSIPACKAGE *package, MSIRECORD *rec )
837{
838 WCHAR *p, *text;
839
840 text = get_deformatted_field( package, rec, 10 );
841 if (!text)
842 return NULL;
843
844 p = text;
845 while (*p && *p != '{') p++;
846 if (!*p++) return text;
847
848 while (*p && *p != '}') p++;
849 if (!*p++) return text;
850
851 p = wcsdup( p );
852 free( text );
853 return p;
854}
855
857{
858 LPWSTR p, prop, arg_fmt = NULL;
859 UINT len;
860
861 len = lstrlenW( event );
862 prop = malloc( len * sizeof(WCHAR) );
863 lstrcpyW( prop, &event[1] );
864 p = wcschr( prop, ']' );
865 if (p && (p[1] == 0 || p[1] == ' '))
866 {
867 *p = 0;
868 if (wcscmp( L"{}", arg )) deformat_string( dialog->package, arg, &arg_fmt );
869 dialog_set_property( dialog->package, prop, arg_fmt );
871 free( arg_fmt );
872 }
873 else ERR("Badly formatted property string - what happens?\n");
874 free( prop );
875 return ERROR_SUCCESS;
876}
877
879{
880 LPWSTR event_fmt = NULL, arg_fmt = NULL;
881
882 TRACE("Sending control event %s %s\n", debugstr_w(event), debugstr_w(arg));
883
884 deformat_string( dialog->package, event, &event_fmt );
885 deformat_string( dialog->package, arg, &arg_fmt );
886
887 dialog->event_handler( dialog, event_fmt, arg_fmt );
888
889 free( event_fmt );
890 free( arg_fmt );
891
892 return ERROR_SUCCESS;
893}
894
896{
899 UINT r;
900
901 condition = MSI_RecordGetString( rec, 5 );
904 {
905 event = MSI_RecordGetString( rec, 3 );
906 arg = MSI_RecordGetString( rec, 4 );
907 if (event[0] == '[')
909 else
911 }
912 return ERROR_SUCCESS;
913}
914
916{
917 MSIQUERY *view;
918 UINT r;
919
920 if (HIWORD(param) != BN_CLICKED)
921 return ERROR_SUCCESS;
922
923 r = MSI_OpenQuery( dialog->package->db, &view,
924 L"SELECT * FROM `ControlEvent` WHERE `Dialog_` = '%s' AND `Control_` = '%s' ORDER BY `Ordering`",
925 dialog->name, control->name );
926 if (r != ERROR_SUCCESS)
927 {
928 ERR("query failed\n");
929 return ERROR_SUCCESS;
930 }
932 msiobj_release( &view->hdr );
933
934 /* dialog control events must be processed last regardless of ordering */
935 if (dialog->pending_event)
936 {
937 r = dialog->pending_event( dialog, dialog->pending_argument );
938
939 free( dialog->pending_argument );
940 dialog->pending_event = NULL;
941 dialog->pending_argument = NULL;
942 }
943 return r;
944}
945
947{
948 HBITMAP hOleBitmap = 0, hBitmap = 0, hOldSrcBitmap, hOldDestBitmap;
949 MSIRECORD *rec = NULL;
950 IStream *stm = NULL;
951 IPicture *pic = NULL;
952 HDC srcdc, destdc;
953 BITMAP bm;
954 UINT r;
955
956 rec = MSI_QueryGetRecord( db, L"SELECT * FROM `Binary` WHERE `Name` = '%s'", name );
957 if (!rec)
958 goto end;
959
960 r = MSI_RecordGetIStream( rec, 2, &stm );
961 msiobj_release( &rec->hdr );
962 if (r != ERROR_SUCCESS)
963 goto end;
964
965 r = OleLoadPicture( stm, 0, TRUE, &IID_IPicture, (void **)&pic );
966 IStream_Release( stm );
967 if (FAILED( r ))
968 {
969 ERR("failed to load picture\n");
970 goto end;
971 }
972
973 r = IPicture_get_Handle( pic, (OLE_HANDLE *)&hOleBitmap );
974 if (FAILED( r ))
975 {
976 ERR("failed to get bitmap handle\n");
977 goto end;
978 }
979
980 /* make the bitmap the desired size */
981 r = GetObjectW( hOleBitmap, sizeof(bm), &bm );
982 if (r != sizeof(bm))
983 {
984 ERR("failed to get bitmap size\n");
985 goto end;
986 }
987
988 if (flags & LR_DEFAULTSIZE)
989 {
990 cx = bm.bmWidth;
991 cy = bm.bmHeight;
992 }
993
994 srcdc = CreateCompatibleDC( NULL );
995 hOldSrcBitmap = SelectObject( srcdc, hOleBitmap );
996 destdc = CreateCompatibleDC( NULL );
997 hBitmap = CreateCompatibleBitmap( srcdc, cx, cy );
998 hOldDestBitmap = SelectObject( destdc, hBitmap );
999 StretchBlt( destdc, 0, 0, cx, cy, srcdc, 0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY );
1000 SelectObject( srcdc, hOldSrcBitmap );
1001 SelectObject( destdc, hOldDestBitmap );
1002 DeleteDC( srcdc );
1003 DeleteDC( destdc );
1004
1005end:
1006 if (pic) IPicture_Release( pic );
1007 return hBitmap;
1008}
1009
1011{
1012 struct control *control;
1013 UINT attributes, style, cx = 0, cy = 0, flags = 0;
1014 WCHAR *name = NULL;
1015
1016 TRACE("%p %p\n", dialog, rec);
1017
1018 style = WS_TABSTOP;
1019 attributes = MSI_RecordGetInteger( rec, 8 );
1022 {
1023 style |= BS_BITMAP;
1025 else
1026 {
1029 }
1030 }
1031
1032 control = dialog_add_control( dialog, rec, L"BUTTON", style );
1033 if (!control)
1034 return ERROR_FUNCTION_FAILED;
1035
1037
1039 {
1040 name = get_binary_name( dialog->package, rec );
1041 control->hIcon = load_icon( dialog->package->db, name, attributes );
1042 if (control->hIcon)
1043 {
1045 }
1046 else ERR("Failed to load icon %s\n", debugstr_w(name));
1047 }
1049 {
1050 name = get_binary_name( dialog->package, rec );
1051 control->hBitmap = load_picture( dialog->package->db, name, cx, cy, flags );
1052 if (control->hBitmap)
1053 {
1055 }
1056 else ERR("Failed to load bitmap %s\n", debugstr_w(name));
1057 }
1058
1059 free( name );
1060 return ERROR_SUCCESS;
1061}
1062
1064{
1065 MSIRECORD *rec = NULL;
1066 LPWSTR ret = NULL;
1067
1068 /* find if there is a value associated with the checkbox */
1069 rec = MSI_QueryGetRecord( dialog->package->db, L"SELECT * FROM `CheckBox` WHERE `Property` = '%s'", prop );
1070 if (!rec)
1071 return ret;
1072
1073 ret = get_deformatted_field( dialog->package, rec, 2 );
1074 if( ret && !ret[0] )
1075 {
1076 free( ret );
1077 ret = NULL;
1078 }
1079 msiobj_release( &rec->hdr );
1080 if (ret)
1081 return ret;
1082
1083 ret = msi_dup_property( dialog->package->db, prop );
1084 if( ret && !ret[0] )
1085 {
1086 free( ret );
1087 ret = NULL;
1088 }
1089
1090 return ret;
1091}
1092
1094{
1095 WCHAR state[2] = {0};
1096 DWORD sz = 2;
1097
1098 msi_get_property( dialog->package->db, control->property, state, &sz );
1099 return state[0] ? 1 : 0;
1100}
1101
1103{
1104 LPCWSTR val;
1105
1106 /* if uncheck then the property is set to NULL */
1107 if (!state)
1108 {
1110 return;
1111 }
1112
1113 /* check for a custom state */
1114 if (control->value && control->value[0])
1115 val = control->value;
1116 else
1117 val = L"1";
1118
1120}
1121
1123{
1126}
1127
1129{
1130 UINT state;
1131
1132 if (HIWORD(param) != BN_CLICKED)
1133 return ERROR_SUCCESS;
1134
1135 TRACE("clicked checkbox %s, set %s\n", debugstr_w(control->name), debugstr_w(control->property));
1136
1138 state = state ? 0 : 1;
1141
1143}
1144
1146{
1147 struct control *control;
1148 LPCWSTR prop;
1149
1150 TRACE("%p %p\n", dialog, rec);
1151
1155 prop = MSI_RecordGetString( rec, 9 );
1156 if (prop)
1157 {
1158 control->property = wcsdup( prop );
1160 TRACE("control %s value %s\n", debugstr_w(control->property), debugstr_w(control->value));
1161 }
1163 return ERROR_SUCCESS;
1164}
1165
1167{
1168 if (!dialog_add_control( dialog, rec, L"Static", SS_ETCHEDHORZ | SS_SUNKEN))
1169 return ERROR_FUNCTION_FAILED;
1170
1171 return ERROR_SUCCESS;
1172}
1173
1174/******************** Scroll Text ********************************************/
1175
1177{
1181};
1182
1184{
1185 struct msi_scrolltext_info *info;
1186 HRESULT r;
1187
1188 TRACE( "%p %04x %#Ix %#Ix\n", hWnd, msg, wParam, lParam );
1189
1190 info = GetPropW( hWnd, L"MSIDATA" );
1191
1192 r = CallWindowProcW( info->oldproc, hWnd, msg, wParam, lParam );
1193
1194 switch( msg )
1195 {
1196 case WM_GETDLGCODE:
1197 return DLGC_WANTARROWS;
1198 case WM_NCDESTROY:
1199 free( info );
1200 RemovePropW( hWnd, L"MSIDATA" );
1201 break;
1202 case WM_PAINT:
1203 /* native MSI sets a wait cursor here */
1204 dialog_button_handler( info->dialog, info->control, BN_CLICKED );
1205 break;
1206 }
1207 return r;
1208}
1209
1211{
1215};
1216
1218{
1219 struct msi_streamin_info *info = (struct msi_streamin_info*) arg;
1220
1221 if( (count + info->offset) > info->length )
1222 count = info->length - info->offset;
1223 memcpy( buffer, &info->string[ info->offset ], count );
1224 *pcb = count;
1225 info->offset += count;
1226
1227 TRACE( "%lu/%lu\n", info->offset, info->length );
1228
1229 return 0;
1230}
1231
1232static void scrolltext_add_text( struct control *control, const WCHAR *text )
1233{
1234 struct msi_streamin_info info;
1235 EDITSTREAM es;
1236
1237 info.string = strdupWtoA( text );
1238 info.offset = 0;
1239 info.length = lstrlenA( info.string ) + 1;
1240
1241 es.dwCookie = (DWORD_PTR) &info;
1242 es.dwError = 0;
1243 es.pfnCallback = richedit_stream_in;
1244
1246
1247 free( info.string );
1248}
1249
1251{
1252 struct msi_scrolltext_info *info;
1253 struct control *control;
1254 HMODULE hRichedit;
1255 LPCWSTR text;
1256 DWORD style;
1257
1258 info = malloc( sizeof *info );
1259 if (!info)
1260 return ERROR_FUNCTION_FAILED;
1261
1262 hRichedit = LoadLibraryA("riched20");
1263
1266 control = dialog_add_control( dialog, rec, L"RichEdit20W", style );
1267 if (!control)
1268 {
1269 FreeLibrary( hRichedit );
1270 free( info );
1271 return ERROR_FUNCTION_FAILED;
1272 }
1273
1274 control->hDll = hRichedit;
1275
1276 info->dialog = dialog;
1277 info->control = control;
1278
1279 /* subclass the static control */
1282 SetPropW( control->hwnd, L"MSIDATA", info );
1283
1284 /* add the text into the richedit */
1285 text = MSI_RecordGetString( rec, 10 );
1286 if (text)
1288
1289 return ERROR_SUCCESS;
1290}
1291
1292
1294{
1296 struct control *control;
1297 LPWSTR name;
1298
1301
1302 attributes = MSI_RecordGetInteger( rec, 8 );
1304 {
1307 }
1308
1309 control = dialog_add_control( dialog, rec, L"Static", style );
1310 cx = MSI_RecordGetInteger( rec, 6 );
1311 cy = MSI_RecordGetInteger( rec, 7 );
1314
1315 name = get_binary_name( dialog->package, rec );
1316 control->hBitmap = load_picture( dialog->package->db, name, cx, cy, flags );
1317 if( control->hBitmap )
1320 else
1321 ERR("Failed to load bitmap %s\n", debugstr_w(name));
1322
1323 free( name );
1324
1325 return ERROR_SUCCESS;
1326}
1327
1329{
1330 struct control *control;
1332 LPWSTR name;
1333
1334 TRACE("\n");
1335
1337
1338 attributes = MSI_RecordGetInteger( rec, 8 );
1339 name = get_binary_name( dialog->package, rec );
1340 control->hIcon = load_icon( dialog->package->db, name, attributes );
1341 if( control->hIcon )
1343 else
1344 ERR("Failed to load bitmap %s\n", debugstr_w(name));
1345 free( name );
1346 return ERROR_SUCCESS;
1347}
1348
1349/******************** Combo Box ***************************************/
1350
1352{
1359};
1360
1362{
1363 struct msi_combobox_info *info;
1364 LRESULT r;
1365 DWORD j;
1366
1367 TRACE( "%p %04x %#Ix %#Ix\n", hWnd, msg, wParam, lParam );
1368
1369 info = GetPropW( hWnd, L"MSIDATA" );
1370 if (!info)
1371 return 0;
1372
1373 r = CallWindowProcW( info->oldproc, hWnd, msg, wParam, lParam );
1374
1375 switch (msg)
1376 {
1377 case WM_NCDESTROY:
1378 for (j = 0; j < info->num_items; j++)
1379 free( info->items[j] );
1380 free( info->items );
1381 free( info );
1382 RemovePropW( hWnd, L"MSIDATA" );
1383 break;
1384 }
1385
1386 return r;
1387}
1388
1390{
1391 struct msi_combobox_info *info = param;
1393 int pos;
1394
1395 value = MSI_RecordGetString( rec, 3 );
1396 text = MSI_RecordGetString( rec, 4 );
1397
1398 info->items[info->addpos_items] = wcsdup( value );
1399
1400#ifdef __REACTOS__ /* Import fix from Wine-11.6 */
1401 pos = SendMessageW( info->hwnd, CB_ADDSTRING, 0, (LPARAM)(text ? text : value) );
1402#else
1403 pos = SendMessageW( info->hwnd, CB_ADDSTRING, 0, (LPARAM)text );
1404#endif
1405 SendMessageW( info->hwnd, CB_SETITEMDATA, pos, (LPARAM)info->items[info->addpos_items] );
1406 info->addpos_items++;
1407
1408 return ERROR_SUCCESS;
1409}
1410
1412{
1413 MSIQUERY *view;
1414 DWORD count;
1415 UINT r;
1416
1417 r = MSI_OpenQuery( info->dialog->package->db, &view,
1418 L"SELECT * FROM `ComboBox` WHERE `Property` = '%s' ORDER BY `Order`", property );
1419 if (r != ERROR_SUCCESS)
1420 return r;
1421
1422 /* just get the number of records */
1423 count = 0;
1425 if (r != ERROR_SUCCESS)
1426 {
1427 msiobj_release( &view->hdr );
1428 return r;
1429 }
1430 info->num_items = count;
1431 info->items = malloc( sizeof(*info->items) * count );
1432
1434 msiobj_release( &view->hdr );
1435 return r;
1436}
1437
1439{
1441 struct control *control;
1443 UINT r;
1444
1445 name = MSI_RecordGetString( rec, 2 );
1446 action = MSI_RecordGetString( rec, 3 );
1447 condition = MSI_RecordGetString( rec, 4 );
1450 if (r == MSICONDITION_TRUE && control)
1451 {
1452 TRACE("%s control %s\n", debugstr_w(action), debugstr_w(name));
1453
1454 /* FIXME: case sensitive? */
1455 if (!wcscmp( action, L"Hide" ))
1457 else if (!wcscmp( action, L"Show" ))
1459 else if (!wcscmp( action, L"Disable" ))
1461 else if (!wcscmp( action, L"Enable" ))
1463 else if (!wcscmp( action, L"Default" ))
1465 else
1466 FIXME("Unhandled action %s\n", debugstr_w(action));
1467 }
1468 return ERROR_SUCCESS;
1469}
1470
1472{
1473 UINT r;
1474 MSIQUERY *view;
1475 MSIPACKAGE *package = dialog->package;
1476
1477 TRACE("%p %s\n", dialog, debugstr_w(dialog->name));
1478
1479 /* query the Control table for all the elements of the control */
1480 r = MSI_OpenQuery( package->db, &view, L"SELECT * FROM `ControlCondition` WHERE `Dialog_` = '%s'", dialog->name );
1481 if (r != ERROR_SUCCESS)
1482 return ERROR_SUCCESS;
1483
1485 msiobj_release( &view->hdr );
1486 return r;
1487}
1488
1490{
1491 struct msi_combobox_info *info;
1492 int index;
1493 LPWSTR value;
1494
1496 return ERROR_SUCCESS;
1497
1498 info = GetPropW( control->hwnd, L"MSIDATA" );
1500 if (index == CB_ERR)
1502 else
1504
1505 dialog_set_property( info->dialog->package, control->property, value );
1507
1508 if (index == CB_ERR)
1509 free( value );
1510
1511 return ERROR_SUCCESS;
1512}
1513
1515{
1516 struct msi_combobox_info *info;
1517 LPWSTR value, tmp;
1518 DWORD j;
1519
1520 info = GetPropW( control->hwnd, L"MSIDATA" );
1521
1522 value = msi_dup_property( dialog->package->db, control->property );
1523 if (!value)
1524 {
1526 return;
1527 }
1528
1529 for (j = 0; j < info->num_items; j++)
1530 {
1532 if (!wcscmp( value, tmp ))
1533 break;
1534 }
1535
1536 if (j < info->num_items)
1537 {
1539 }
1540 else
1541 {
1544 }
1545
1546 free( value );
1547}
1548
1550{
1551 struct msi_combobox_info *info;
1552 struct control *control;
1554 LPCWSTR prop;
1555
1556 info = malloc( sizeof *info );
1557 if (!info)
1558 return ERROR_FUNCTION_FAILED;
1559
1561 attributes = MSI_RecordGetInteger( rec, 8 );
1563 style |= CBS_SORT;
1566 else
1568
1570 if (!control)
1571 {
1572 free( info );
1573 return ERROR_FUNCTION_FAILED;
1574 }
1575
1578
1579 prop = MSI_RecordGetString( rec, 9 );
1581
1582 /* subclass */
1583 info->dialog = dialog;
1584 info->hwnd = control->hwnd;
1585 info->items = NULL;
1586 info->addpos_items = 0;
1589 SetPropW( control->hwnd, L"MSIDATA", info );
1590
1591 if (control->property)
1593
1595
1596 return ERROR_SUCCESS;
1597}
1598
1600{
1601 LPWSTR buf;
1602
1603 if (HIWORD(param) != EN_CHANGE)
1604 return ERROR_SUCCESS;
1605
1606 TRACE("edit %s contents changed, set %s\n", debugstr_w(control->name), debugstr_w(control->property));
1607
1610 free( buf );
1611
1612 return ERROR_SUCCESS;
1613}
1614
1615/* length of 2^32 + 1 */
1616#define MAX_NUM_DIGITS 11
1617
1619{
1620 struct control *control;
1621 LPCWSTR prop, text;
1622 LPWSTR val, begin, end;
1624 DWORD limit;
1625
1628
1629 text = MSI_RecordGetString( rec, 10 );
1630 if ( text )
1631 {
1632 begin = wcschr( text, '{' );
1633 end = wcschr( text, '}' );
1634
1635 if ( begin && end && end > begin &&
1636 begin[0] >= '0' && begin[0] <= '9' &&
1637 end - begin < MAX_NUM_DIGITS)
1638 {
1639 lstrcpynW( num, begin + 1, end - begin );
1640 limit = wcstol( num, NULL, 10 );
1641
1643 }
1644 }
1645
1646 prop = MSI_RecordGetString( rec, 9 );
1647 if( prop )
1648 control->property = wcsdup( prop );
1649
1650 val = msi_dup_property( dialog->package->db, control->property );
1652 free( val );
1653 return ERROR_SUCCESS;
1654}
1655
1656/******************** Masked Edit ********************************************/
1657
1658#define MASK_MAX_GROUPS 20
1659
1661{
1666};
1667
1669{
1677};
1678
1680{
1681 switch (type)
1682 {
1683 case '%':
1684 case '#':
1685 case '&':
1686 case '`':
1687 case '?':
1688 case '^':
1689 return TRUE;
1690 }
1691 return FALSE;
1692}
1693
1695{
1696 LPWSTR val;
1697 UINT i, n, r;
1698
1699 val = malloc( (info->num_chars + 1) * sizeof(WCHAR) );
1700 for( i=0, n=0; i<info->num_groups; i++ )
1701 {
1702 if (info->group[i].len == ~0u)
1703 {
1704 UINT len = SendMessageW( info->group[i].hwnd, WM_GETTEXTLENGTH, 0, 0 );
1705 val = realloc( val, (len + 1) * sizeof(WCHAR) );
1706 GetWindowTextW( info->group[i].hwnd, val, len + 1 );
1707 }
1708 else
1709 {
1710 if (info->group[i].len + n > info->num_chars)
1711 {
1712 ERR("can't fit control %d text into template\n",i);
1713 break;
1714 }
1715 if (!mask_editable(info->group[i].type))
1716 {
1717 for(r=0; r<info->group[i].len; r++)
1718 val[n+r] = info->group[i].type;
1719 val[n+r] = 0;
1720 }
1721 else
1722 {
1723 r = GetWindowTextW( info->group[i].hwnd, &val[n], info->group[i].len+1 );
1724 if( r != info->group[i].len )
1725 break;
1726 }
1727 n += r;
1728 }
1729 }
1730
1731 TRACE("%d/%d controls were good\n", i, info->num_groups);
1732
1733 if( i == info->num_groups )
1734 {
1735 TRACE("Set property %s to %s\n", debugstr_w(info->prop), debugstr_w(val));
1736 dialog_set_property( info->dialog->package, info->prop, val );
1738 }
1739 free( val );
1740}
1741
1742/* now move to the next control if necessary */
1744{
1745 HWND hWndNext;
1746 UINT len, i;
1747
1748 for( i=0; i<info->num_groups; i++ )
1749 if( info->group[i].hwnd == hWnd )
1750 break;
1751
1752 /* don't move from the last control */
1753 if( i >= (info->num_groups-1) )
1754 return;
1755
1757 if( len < info->group[i].len )
1758 return;
1759
1760 hWndNext = GetNextDlgTabItem( GetParent( hWnd ), hWnd, FALSE );
1761 SetFocus( hWndNext );
1762}
1763
1765{
1766 struct msi_maskedit_info *info;
1767 HRESULT r;
1768
1769 TRACE("%p %04x %#Ix %#Ix\n", hWnd, msg, wParam, lParam);
1770
1771 info = GetPropW(hWnd, L"MSIDATA");
1772
1773 r = CallWindowProcW(info->oldproc, hWnd, msg, wParam, lParam);
1774
1775 switch( msg )
1776 {
1777 case WM_COMMAND:
1778 if (HIWORD(wParam) == EN_CHANGE)
1779 {
1782 }
1783 break;
1784 case WM_NCDESTROY:
1785 free( info->prop );
1786 free( info );
1787 RemovePropW( hWnd, L"MSIDATA" );
1788 break;
1789 }
1790
1791 return r;
1792}
1793
1794/* fish the various bits of the property out and put them in the control */
1795static void maskedit_set_text( struct msi_maskedit_info *info, const WCHAR *text )
1796{
1797 LPCWSTR p;
1798 UINT i;
1799
1800 p = text;
1801 for( i = 0; i < info->num_groups; i++ )
1802 {
1803 if( info->group[i].len < lstrlenW( p ) )
1804 {
1805 WCHAR *chunk = wcsdup( p );
1806 chunk[ info->group[i].len ] = 0;
1807 SetWindowTextW( info->group[i].hwnd, chunk );
1808 free( chunk );
1809 }
1810 else
1811 {
1812 SetWindowTextW( info->group[i].hwnd, p );
1813 break;
1814 }
1815 p += info->group[i].len;
1816 }
1817}
1818
1820{
1821 struct msi_maskedit_info *info;
1822 int i = 0, n = 0, total = 0;
1823 LPCWSTR p;
1824
1825 TRACE("masked control, template %s\n", debugstr_w(mask));
1826
1827 if( !mask )
1828 return NULL;
1829
1830 info = calloc( 1, sizeof *info );
1831 if( !info )
1832 return info;
1833
1834 p = wcschr(mask, '<');
1835 if( p )
1836 p++;
1837 else
1838 p = mask;
1839
1840 for( i=0; i<MASK_MAX_GROUPS; i++ )
1841 {
1842 /* stop at the end of the string */
1843 if( p[0] == 0 || p[0] == '>' )
1844 {
1845 if (!total)
1846 {
1847 /* create a group for the empty mask */
1848 info->group[0].type = '&';
1849 info->group[0].len = ~0u;
1850 i = 1;
1851 }
1852 break;
1853 }
1854
1855 /* count the number of the same identifier */
1856 for( n=0; p[n] == p[0]; n++ )
1857 ;
1858 info->group[i].ofs = total;
1859 info->group[i].type = p[0];
1860 if( p[n] == '=' )
1861 {
1862 n++;
1863 total++; /* an extra not part of the group */
1864 }
1865 info->group[i].len = n;
1866 total += n;
1867 p += n;
1868 }
1869
1870 TRACE("%d characters in %d groups\n", total, i );
1871 if( i == MASK_MAX_GROUPS )
1872 ERR("too many groups in PIDTemplate %s\n", debugstr_w(mask));
1873
1874 info->num_chars = total;
1875 info->num_groups = i;
1876
1877 return info;
1878}
1879
1881{
1882 DWORD width, height, style, wx, ww;
1883 RECT rect;
1884 HWND hwnd;
1885 UINT i;
1886
1888
1889 GetClientRect( info->hwnd, &rect );
1890
1891 width = rect.right - rect.left;
1893
1894 for( i = 0; i < info->num_groups; i++ )
1895 {
1896 if (!mask_editable( info->group[i].type ))
1897 continue;
1898 if (info->num_chars)
1899 {
1900 wx = (info->group[i].ofs * width) / info->num_chars;
1901 ww = (info->group[i].len * width) / info->num_chars;
1902 }
1903 else
1904 {
1905 wx = 0;
1906 ww = width;
1907 }
1908 hwnd = CreateWindowW( L"Edit", NULL, style, wx, 0, ww, height,
1909 info->hwnd, NULL, NULL, NULL );
1910 if( !hwnd )
1911 {
1912 ERR("failed to create mask edit sub window\n");
1913 break;
1914 }
1915
1916 SendMessageW( hwnd, EM_LIMITTEXT, info->group[i].len, 0 );
1917
1918 dialog_set_font( info->dialog, hwnd, font?font:info->dialog->default_font );
1919 info->group[i].hwnd = hwnd;
1920 }
1921}
1922
1923/*
1924 * office 2003 uses "73931<````=````=````=````=`````>@@@@@"
1925 * delphi 7 uses "<????-??????-??????-????>" and "<???-???>"
1926 * filemaker pro 7 uses "<^^^^=^^^^=^^^^=^^^^=^^^^=^^^^=^^^^^>"
1927 */
1929{
1930 LPWSTR font_mask, val = NULL, font;
1931 struct msi_maskedit_info *info = NULL;
1933 struct control *control;
1934 LPCWSTR prop, mask;
1935
1936 TRACE("\n");
1937
1938 font_mask = get_deformatted_field( dialog->package, rec, 10 );
1939 font = dialog_get_style( font_mask, &mask );
1940 if( !mask )
1941 {
1942 WARN("mask template is empty\n");
1943 goto end;
1944 }
1945
1947 if( !info )
1948 {
1949 ERR("template %s is invalid\n", debugstr_w(mask));
1950 goto end;
1951 }
1952
1953 info->dialog = dialog;
1954
1956 if( !control )
1957 {
1958 ERR("Failed to create maskedit container\n");
1960 goto end;
1961 }
1963
1964 info->hwnd = control->hwnd;
1965
1966 /* subclass the static control */
1967 info->oldproc = (WNDPROC) SetWindowLongPtrW( info->hwnd, GWLP_WNDPROC,
1969 SetPropW( control->hwnd, L"MSIDATA", info );
1970
1971 prop = MSI_RecordGetString( rec, 9 );
1972 if( prop )
1973 info->prop = wcsdup( prop );
1974
1976
1977 if( prop )
1978 {
1979 val = msi_dup_property( dialog->package->db, prop );
1980 if( val )
1981 {
1983 free( val );
1984 }
1985 }
1986
1987end:
1988 if( ret != ERROR_SUCCESS )
1989 free( info );
1990 free( font_mask );
1991 free( font );
1992 return ret;
1993}
1994
1995/******************** Progress Bar *****************************************/
1996
1998{
1999 struct control *control;
2001
2002 style = WS_VISIBLE;
2003 attributes = MSI_RecordGetInteger( rec, 8 );
2005 style |= PBS_SMOOTH;
2006
2008 if( !control )
2009 return ERROR_FUNCTION_FAILED;
2010
2011 event_subscribe( dialog, L"SetProgress", control->name, L"Progress" );
2012 return ERROR_SUCCESS;
2013}
2014
2015/******************** Path Edit ********************************************/
2016
2018{
2022};
2023
2025{
2026 WCHAR *prop, *path;
2028 if (!(prop = dialog_dup_property( dialog, control->property, indirect ))) return NULL;
2029 path = dialog_dup_property( dialog, prop, TRUE );
2030 free( prop );
2031 return path;
2032}
2033
2035{
2036 WCHAR *path;
2037
2038 if (!control && !(control = dialog_find_control_by_type( dialog, L"PathEdit" )))
2039 return;
2040
2041 if (!(path = get_path_property( dialog, control ))) return;
2043 SendMessageW( control->hwnd, EM_SETSEL, 0, -1 );
2044 free( path );
2045}
2046
2047/* FIXME: test when this should fail */
2049{
2050 if ( !path[0] )
2051 return FALSE;
2052
2053 if ( PathIsRelativeW( path ) )
2054 return FALSE;
2055
2056 return TRUE;
2057}
2058
2059/* returns TRUE if the path is valid, FALSE otherwise */
2061{
2062 LPWSTR buf, prop;
2063 BOOL indirect;
2064 BOOL valid;
2065
2068
2070
2071 if ( !dialog_verify_path( buf ) )
2072 {
2073 /* FIXME: display an error message box */
2074 ERR("Invalid path %s\n", debugstr_w( buf ));
2075 valid = FALSE;
2076 SetFocus( control->hwnd );
2077 }
2078 else
2079 {
2080 valid = TRUE;
2081 dialog_set_property( dialog->package, prop, buf );
2082 }
2083
2085
2086 TRACE("edit %s contents changed, set %s\n", debugstr_w(control->name),
2087 debugstr_w(prop));
2088
2089 free( buf );
2090 free( prop );
2091
2092 return valid;
2093}
2094
2096{
2097 struct msi_pathedit_info *info = GetPropW(hWnd, L"MSIDATA");
2098 LRESULT r = 0;
2099
2100 TRACE("%p %04x %#Ix %#Ix\n", hWnd, msg, wParam, lParam);
2101
2102 if ( msg == WM_KILLFOCUS )
2103 {
2104 /* if the path is invalid, don't handle this message */
2105 if ( !dialog_onkillfocus( info->dialog, info->control ) )
2106 return 0;
2107 }
2108
2109 r = CallWindowProcW(info->oldproc, hWnd, msg, wParam, lParam);
2110
2111 if ( msg == WM_NCDESTROY )
2112 {
2113 free( info );
2114 RemovePropW( hWnd, L"MSIDATA" );
2115 }
2116
2117 return r;
2118}
2119
2121{
2122 struct msi_pathedit_info *info;
2123 struct control *control;
2124 LPCWSTR prop;
2125
2126 info = malloc( sizeof *info );
2127 if (!info)
2128 return ERROR_FUNCTION_FAILED;
2129
2132 prop = MSI_RecordGetString( rec, 9 );
2135
2136 info->dialog = dialog;
2137 info->control = control;
2140 SetPropW( control->hwnd, L"MSIDATA", info );
2141
2143
2144 return ERROR_SUCCESS;
2145}
2146
2148{
2149 if (HIWORD(param) != BN_CLICKED)
2150 return ERROR_SUCCESS;
2151
2152 TRACE("clicked radio button %s, set %s\n", debugstr_w(control->name), debugstr_w(control->property));
2153
2155
2157}
2158
2159/* radio buttons are a bit different from normal controls */
2161{
2163 msi_dialog *dialog = group->dialog;
2164 struct control *control;
2165 LPCWSTR prop, text, name;
2167
2168 name = MSI_RecordGetString( rec, 3 );
2169 text = MSI_RecordGetString( rec, 8 );
2170
2171 control = dialog_create_window( dialog, rec, 0, L"BUTTON", name, text, style,
2172 group->parent->hwnd );
2173 if (!control)
2174 return ERROR_FUNCTION_FAILED;
2176
2177 if (group->propval && !wcscmp( control->name, group->propval ))
2179
2180 prop = MSI_RecordGetString( rec, 1 );
2181 if( prop )
2182 control->property = wcsdup( prop );
2183
2184 return ERROR_SUCCESS;
2185}
2186
2188{
2190 return TRUE;
2191}
2192
2194{
2195 WNDPROC oldproc = (WNDPROC)GetPropW( hWnd, L"MSIDATA" );
2196 LRESULT r;
2197
2198 TRACE( "hWnd %p msg %04x wParam %#Ix lParam %#Ix\n", hWnd, msg, wParam, lParam );
2199
2200 if (msg == WM_COMMAND) /* Forward notifications to dialog */
2202
2203 r = CallWindowProcW( oldproc, hWnd, msg, wParam, lParam );
2204
2205 /* make sure the radio buttons show as disabled if the parent is disabled */
2206 if (msg == WM_ENABLE)
2208
2209 return r;
2210}
2211
2213{
2214 UINT r;
2215 LPCWSTR prop;
2216 struct control *control;
2217 MSIQUERY *view;
2219 MSIPACKAGE *package = dialog->package;
2220 WNDPROC oldproc;
2222
2223 prop = MSI_RecordGetString( rec, 9 );
2224
2225 TRACE("%p %p %s\n", dialog, rec, debugstr_w( prop ));
2226
2227 attr = MSI_RecordGetInteger( rec, 8 );
2229 style |= WS_VISIBLE;
2231 style |= WS_DISABLED;
2233 style |= BS_GROUPBOX;
2234 else
2236
2237 /* Create parent group box to hold radio buttons */
2238 control = dialog_add_control( dialog, rec, L"BUTTON", style );
2239 if( !control )
2240 return ERROR_FUNCTION_FAILED;
2241
2244 SetPropW(control->hwnd, L"MSIDATA", oldproc);
2246
2247 if( prop )
2248 control->property = wcsdup( prop );
2249
2250 /* query the Radio Button table for all control in this group */
2251 r = MSI_OpenQuery( package->db, &view, L"SELECT * FROM `RadioButton` WHERE `Property` = '%s'", prop );
2252 if( r != ERROR_SUCCESS )
2253 {
2254 ERR("query failed for dialog %s radio group %s\n",
2255 debugstr_w(dialog->name), debugstr_w(prop));
2257 }
2258
2259 group.dialog = dialog;
2260 group.parent = control;
2261 group.propval = msi_dup_property( dialog->package->db, control->property );
2262
2264 msiobj_release( &view->hdr );
2265 free( group.propval );
2266 return r;
2267}
2268
2270{
2271 TVITEMW tvi;
2272 DWORD index = feature->ActionRequest;
2273
2274 TRACE("Feature %s -> %d %d %d\n", debugstr_w(feature->Title),
2275 feature->Installed, feature->Action, feature->ActionRequest);
2276
2279
2280 tvi.mask = TVIF_STATE;
2281 tvi.hItem = hItem;
2284
2285 SendMessageW( hwnd, TVM_SETITEMW, 0, (LPARAM) &tvi );
2286}
2287
2289{
2290 HMENU hMenu;
2291 INT r;
2292
2293 /* create a menu to display */
2294 hMenu = CreatePopupMenu();
2295
2296 /* FIXME: load strings from resources */
2297 AppendMenuA( hMenu, MF_ENABLED, INSTALLSTATE_LOCAL, "Install feature locally");
2298 AppendMenuA( hMenu, MF_ENABLED, USER_INSTALLSTATE_ALL, "Install entire feature");
2299 AppendMenuA( hMenu, MF_ENABLED, INSTALLSTATE_ADVERTISED, "Install on demand");
2300 AppendMenuA( hMenu, MF_ENABLED, INSTALLSTATE_ABSENT, "Don't install");
2302 x, y, 0, hwnd, NULL );
2303 DestroyMenu( hMenu );
2304 return r;
2305}
2306
2309{
2310 feature->ActionRequest = state;
2313}
2314
2317{
2318 /* update all siblings */
2319 do
2320 {
2323
2326
2327 /* update this sibling's children */
2329 if (child)
2331 }
2332 while ((curr = (HTREEITEM)SendMessageW( hwnd, TVM_GETNEXTITEM, (WPARAM)TVGN_NEXT, (LPARAM)curr )));
2333}
2334
2336{
2339 MSIPACKAGE *package;
2340 union {
2341 RECT rc;
2342 POINT pt[2];
2344 } u;
2345 UINT r;
2346
2347 info = GetPropW(hwnd, L"MSIDATA");
2348 package = info->dialog->package;
2349
2351 if (!feature)
2352 {
2353 ERR("item %p feature was NULL\n", hItem);
2354 return 0;
2355 }
2356
2357 /* get the item's rectangle to put the menu just below it */
2358 u.hItem = hItem;
2360 MapWindowPoints( hwnd, NULL, u.pt, 2 );
2361
2362 r = seltree_popup_menu( hwnd, u.rc.left, u.rc.top );
2363
2364 switch (r)
2365 {
2368 /* fall-through */
2371 {
2374 if (child)
2376 }
2377 /* fall-through */
2378 case INSTALLSTATE_LOCAL:
2380 break;
2381 }
2382
2383 return 0;
2384}
2385
2387{
2389 TVHITTESTINFO tvhti;
2390 HRESULT r;
2391
2392 TRACE("%p %04x %#Ix %#Ix\n", hWnd, msg, wParam, lParam);
2393
2394 info = GetPropW(hWnd, L"MSIDATA");
2395
2396 switch( msg )
2397 {
2398 case WM_LBUTTONDOWN:
2399 tvhti.pt.x = (short)LOWORD( lParam );
2400 tvhti.pt.y = (short)HIWORD( lParam );
2401 tvhti.flags = 0;
2402 tvhti.hItem = 0;
2403 CallWindowProcW(info->oldproc, hWnd, TVM_HITTEST, 0, (LPARAM) &tvhti );
2404 if (tvhti.flags & TVHT_ONITEMSTATEICON)
2405 return seltree_menu( hWnd, tvhti.hItem );
2406 break;
2407 }
2408 r = CallWindowProcW(info->oldproc, hWnd, msg, wParam, lParam);
2409
2410 switch( msg )
2411 {
2412 case WM_NCDESTROY:
2413 free( info );
2414 RemovePropW( hWnd, L"MSIDATA" );
2415 break;
2416 }
2417 return r;
2418}
2419
2420static void seltree_add_child_features( MSIPACKAGE *package, HWND hwnd, const WCHAR *parent, HTREEITEM hParent )
2421{
2422 struct msi_selection_tree_info *info = GetPropW( hwnd, L"MSIDATA" );
2424 TVINSERTSTRUCTW tvis;
2425 HTREEITEM hitem, hfirst = NULL;
2426
2428 {
2429 if ( parent && feature->Feature_Parent && wcscmp( parent, feature->Feature_Parent ))
2430 continue;
2431 else if ( parent && !feature->Feature_Parent )
2432 continue;
2433 else if ( !parent && feature->Feature_Parent )
2434 continue;
2435
2436 if ( !feature->Title )
2437 continue;
2438
2439 if ( !feature->Display )
2440 continue;
2441
2442 memset( &tvis, 0, sizeof tvis );
2443 tvis.hParent = hParent;
2444 tvis.hInsertAfter = TVI_LAST;
2445 tvis.item.mask = TVIF_TEXT | TVIF_PARAM;
2446 tvis.item.pszText = feature->Title;
2447 tvis.item.lParam = (LPARAM) feature;
2448
2449 hitem = (HTREEITEM) SendMessageW( hwnd, TVM_INSERTITEMW, 0, (LPARAM) &tvis );
2450 if (!hitem)
2451 continue;
2452
2453 if (!hfirst)
2454 hfirst = hitem;
2455
2458 feature->Feature, hitem );
2459
2460 /* the node is expanded if Display is odd */
2461 if ( feature->Display % 2 != 0 )
2463 }
2464
2465 /* select the first item */
2467 info->selected = hfirst;
2468}
2469
2471{
2472 const int bm_width = 32, bm_height = 16, bm_count = 3;
2473 const int bm_resource = 0x1001;
2475 int i;
2476 HBITMAP hbmp;
2477
2478 himl = ImageList_Create( bm_width, bm_height, FALSE, 4, 0 );
2479 if (!himl)
2480 {
2481 ERR("failed to create image list\n");
2482 return;
2483 }
2484
2485 for (i=0; i<bm_count; i++)
2486 {
2487 hbmp = LoadBitmapW( msi_hInstance, MAKEINTRESOURCEW(i+bm_resource) );
2488 if (!hbmp)
2489 {
2490 ERR("failed to load bitmap %d\n", i);
2491 break;
2492 }
2493
2494 /*
2495 * Add a dummy bitmap at offset zero because the treeview
2496 * can't use it as a state mask (zero means no user state).
2497 */
2498 if (!i)
2500
2502 }
2503
2505}
2506
2508{
2509 struct msi_selection_tree_info *info = GetPropW( control->hwnd, L"MSIDATA" );
2511 MSIRECORD *row, *rec;
2514 LPCWSTR dir, title = NULL;
2516
2517 if (tv->hdr.code != TVN_SELCHANGINGW)
2518 return ERROR_SUCCESS;
2519
2520 info->selected = tv->itemNew.hItem;
2521
2522 if (!(tv->itemNew.mask & TVIF_TEXT))
2523 {
2525 if (feature)
2526 title = feature->Title;
2527 }
2528 else
2529 title = tv->itemNew.pszText;
2530
2531 row = MSI_QueryGetRecord( dialog->package->db, L"SELECT * FROM `Feature` WHERE `Title` = '%s'", title );
2532 if (!row)
2533 return ERROR_FUNCTION_FAILED;
2534
2535 rec = MSI_CreateRecord( 1 );
2536
2538 msi_event_fire( dialog->package, L"SelectionDescription", rec );
2539
2540 dir = MSI_RecordGetString( row, 7 );
2541 if (dir)
2542 {
2543 folder = msi_get_loaded_folder( dialog->package, dir );
2544 if (!folder)
2545 {
2547 goto done;
2548 }
2549 MSI_RecordSetStringW( rec, 1, folder->ResolvedTarget );
2550 }
2551 else
2552 MSI_RecordSetStringW( rec, 1, NULL );
2553
2554 msi_event_fire( dialog->package, L"SelectionPath", rec );
2555
2556done:
2557 msiobj_release(&row->hdr);
2558 msiobj_release(&rec->hdr);
2559
2560 return r;
2561}
2562
2564{
2565 struct control *control;
2566 LPCWSTR prop, control_name;
2567 MSIPACKAGE *package = dialog->package;
2568 DWORD style;
2570
2571 info = malloc( sizeof *info );
2572 if (!info)
2573 return ERROR_FUNCTION_FAILED;
2574
2575 /* create the treeview control */
2579 if (!control)
2580 {
2581 free(info);
2582 return ERROR_FUNCTION_FAILED;
2583 }
2584
2586 control_name = MSI_RecordGetString( rec, 2 );
2588 prop = MSI_RecordGetString( rec, 9 );
2590
2591 /* subclass */
2592 info->dialog = dialog;
2593 info->hwnd = control->hwnd;
2596 SetPropW( control->hwnd, L"MSIDATA", info );
2597
2598 event_subscribe( dialog, L"SelectionPath", control_name, L"Property" );
2599
2600 /* initialize it */
2603
2604 return ERROR_SUCCESS;
2605}
2606
2607/******************** Group Box ***************************************/
2608
2610{
2611 struct control *control;
2612 DWORD style;
2613
2616 if (!control)
2617 return ERROR_FUNCTION_FAILED;
2618
2619 return ERROR_SUCCESS;
2620}
2621
2622/******************** List Box ***************************************/
2623
2625{
2632};
2633
2635{
2636 struct msi_listbox_info *info;
2637 LRESULT r;
2638 DWORD j;
2639
2640 TRACE("%p %04x %#Ix %#Ix\n", hWnd, msg, wParam, lParam);
2641
2642 info = GetPropW( hWnd, L"MSIDATA" );
2643 if (!info)
2644 return 0;
2645
2646 r = CallWindowProcW( info->oldproc, hWnd, msg, wParam, lParam );
2647
2648 switch( msg )
2649 {
2650 case WM_NCDESTROY:
2651 for (j = 0; j < info->num_items; j++)
2652 free( info->items[j] );
2653 free( info->items );
2654 free( info );
2655 RemovePropW( hWnd, L"MSIDATA" );
2656 break;
2657 }
2658
2659 return r;
2660}
2661
2663{
2664 struct msi_listbox_info *info = param;
2666 int pos;
2667
2668 value = MSI_RecordGetString( rec, 3 );
2669 text = MSI_RecordGetString( rec, 4 );
2670
2671 info->items[info->addpos_items] = wcsdup( value );
2672
2673 pos = SendMessageW( info->hwnd, LB_ADDSTRING, 0, (LPARAM)text );
2674 SendMessageW( info->hwnd, LB_SETITEMDATA, pos, (LPARAM)info->items[info->addpos_items] );
2675 info->addpos_items++;
2676 return ERROR_SUCCESS;
2677}
2678
2680{
2681 MSIQUERY *view;
2682 DWORD count;
2683 UINT r;
2684
2685 r = MSI_OpenQuery( info->dialog->package->db, &view,
2686 L"SELECT * FROM `ListBox` WHERE `Property` = '%s' ORDER BY `Order`", property );
2687 if ( r != ERROR_SUCCESS )
2688 return r;
2689
2690 /* just get the number of records */
2691 count = 0;
2693 if (r != ERROR_SUCCESS)
2694 {
2695 msiobj_release( &view->hdr );
2696 return r;
2697 }
2698 info->num_items = count;
2699 info->items = malloc( sizeof(*info->items) * count );
2700
2702 msiobj_release( &view->hdr );
2703 return r;
2704}
2705
2707{
2708 struct msi_listbox_info *info;
2709 int index;
2710 LPCWSTR value;
2711
2712 if( HIWORD(param) != LBN_SELCHANGE )
2713 return ERROR_SUCCESS;
2714
2715 info = GetPropW( control->hwnd, L"MSIDATA" );
2718
2719 dialog_set_property( info->dialog->package, control->property, value );
2721
2722 return ERROR_SUCCESS;
2723}
2724
2726{
2727 struct msi_listbox_info *info;
2728 struct control *control;
2730 LPCWSTR prop;
2731
2732 info = malloc( sizeof *info );
2733 if (!info)
2734 return ERROR_FUNCTION_FAILED;
2735
2737 attributes = MSI_RecordGetInteger( rec, 8 );
2739 style |= LBS_SORT;
2740
2742 if (!control)
2743 {
2744 free(info);
2745 return ERROR_FUNCTION_FAILED;
2746 }
2747
2749
2750 prop = MSI_RecordGetString( rec, 9 );
2752
2753 /* subclass */
2754 info->dialog = dialog;
2755 info->hwnd = control->hwnd;
2756 info->items = NULL;
2757 info->addpos_items = 0;
2760 SetPropW( control->hwnd, L"MSIDATA", info );
2761
2762 if ( control->property )
2764
2765 return ERROR_SUCCESS;
2766}
2767
2768/******************** Directory Combo ***************************************/
2769
2771{
2772 WCHAR *path;
2773
2774 if (!control && !(control = dialog_find_control_by_type( dialog, L"DirectoryCombo" )))
2775 return;
2776
2777 if (!(path = get_path_property( dialog, control ))) return;
2780
2783
2784 free( path );
2785}
2786
2788{
2789 struct control *control;
2790 LPCWSTR prop;
2791 DWORD style;
2792
2793 /* FIXME: use CBS_OWNERDRAWFIXED and add owner draw code */
2797 if (!control)
2798 return ERROR_FUNCTION_FAILED;
2799
2801 prop = MSI_RecordGetString( rec, 9 );
2803
2805
2806 return ERROR_SUCCESS;
2807}
2808
2809/******************** Directory List ***************************************/
2810
2812{
2813 WCHAR dir_spec[MAX_PATH], *path;
2814 WIN32_FIND_DATAW wfd;
2815 LVITEMW item;
2816 HANDLE file;
2817
2818 if (!control && !(control = dialog_find_control_by_type( dialog, L"DirectoryList" )))
2819 return;
2820
2821 /* clear the list-view */
2823
2824 if (!(path = get_path_property( dialog, control ))) return;
2825 lstrcpyW( dir_spec, path );
2826 lstrcatW( dir_spec, L"*" );
2827
2828 file = FindFirstFileW( dir_spec, &wfd );
2830 {
2831 free( path );
2832 return;
2833 }
2834
2835 do
2836 {
2838 continue;
2839
2840 if ( !wcscmp( wfd.cFileName, L"." ) || !wcscmp( wfd.cFileName, L".." ) )
2841 continue;
2842
2843 item.mask = LVIF_TEXT;
2844 item.cchTextMax = MAX_PATH;
2845 item.iItem = 0;
2846 item.iSubItem = 0;
2847 item.pszText = wfd.cFileName;
2848
2850 } while ( FindNextFileW( file, &wfd ) );
2851
2852 free( path );
2853 FindClose( file );
2854}
2855
2857{
2858 struct control *control;
2859 LPWSTR prop, path, ptr;
2860 BOOL indirect;
2861
2862 control = dialog_find_control_by_type( dialog, L"DirectoryList" );
2865 path = dialog_dup_property( dialog, prop, TRUE );
2866
2867 /* strip off the last directory */
2869 if (ptr != path)
2870 {
2871 *(ptr - 1) = '\0';
2873 }
2874
2875 dialog_set_property( dialog->package, prop, path );
2876
2880
2881 free( path );
2882 free( prop );
2883
2884 return ERROR_SUCCESS;
2885}
2886
2888{
2889 WCHAR newfolder[MAX_PATH], *path, *ptr;
2890 int len, count = 2;
2891
2892 len = LoadStringW( msi_hInstance, IDS_NEWFOLDER, newfolder, ARRAY_SIZE(newfolder) );
2893 len += lstrlenW(root) + 1;
2894 if (!(path = malloc( (len + 4) * sizeof(WCHAR) ))) return NULL;
2895 lstrcpyW( path, root );
2896 lstrcatW( path, newfolder );
2897
2898 for (;;)
2899 {
2901 if (count > 99)
2902 {
2903 free( path );
2904 return NULL;
2905 }
2906 swprintf( path, len + 4, L"%s%s %u", root, newfolder, count++ );
2907 }
2908
2909 ptr = wcsrchr( path, '\\' ) + 1;
2910 *ret_len = lstrlenW(ptr);
2911 memmove( path, ptr, *ret_len * sizeof(WCHAR) );
2912 return path;
2913}
2914
2916{
2917 struct control *control;
2918 WCHAR *path;
2919 LVITEMW item;
2920 int index;
2921
2922 control = dialog_find_control_by_type( dialog, L"DirectoryList" );
2923
2925
2926 item.mask = LVIF_TEXT;
2927 item.iItem = 0;
2928 item.iSubItem = 0;
2929 item.pszText = get_unique_folder_name( path, &item.cchTextMax );
2930
2934
2935 free( path );
2936 free( item.pszText );
2937 return ERROR_SUCCESS;
2938}
2939
2941{
2942 NMHDR *nmhdr = (NMHDR *)param;
2943 WCHAR text[MAX_PATH], *new_path, *path, *prop;
2944 BOOL indirect;
2945
2946 switch (nmhdr->code)
2947 {
2948 case LVN_ENDLABELEDITW:
2949 {
2951 if (!info->item.pszText) return ERROR_SUCCESS;
2952 lstrcpynW( text, info->item.pszText, ARRAY_SIZE(text) );
2953 text[ARRAY_SIZE(text) - 1] = 0;
2954 break;
2955 }
2956 case LVN_ITEMACTIVATE:
2957 {
2958 LVITEMW item;
2960 if (index < 0)
2961 {
2962 ERR("no list-view item selected\n");
2963 return ERROR_FUNCTION_FAILED;
2964 }
2965
2966 item.iSubItem = 0;
2967 item.pszText = text;
2968 item.cchTextMax = MAX_PATH;
2970 text[ARRAY_SIZE(text) - 1] = 0;
2971 break;
2972 }
2973 default:
2974 return ERROR_SUCCESS;
2975 }
2976
2979 path = dialog_dup_property( dialog, prop, TRUE );
2980
2981 if (!(new_path = malloc( (wcslen(path) + wcslen(text) + 2) * sizeof(WCHAR) )))
2982 {
2983 free( prop );
2984 free( path );
2985 return ERROR_OUTOFMEMORY;
2986 }
2987 lstrcpyW( new_path, path );
2988 lstrcatW( new_path, text );
2989 if (nmhdr->code == LVN_ENDLABELEDITW) CreateDirectoryW( new_path, NULL );
2990 lstrcatW( new_path, L"\\" );
2991
2992 dialog_set_property( dialog->package, prop, new_path );
2993
2997
2998 free( prop );
2999 free( path );
3000 free( new_path );
3001
3002 return ERROR_SUCCESS;
3003}
3004
3006{
3007 struct control *control;
3008 LPCWSTR prop;
3009 DWORD style;
3010
3015 if (!control)
3016 return ERROR_FUNCTION_FAILED;
3017
3020 prop = MSI_RecordGetString( rec, 9 );
3022
3023 /* double click to activate an item in the list */
3026
3028
3029 return ERROR_SUCCESS;
3030}
3031
3032/******************** VolumeCost List ***************************************/
3033
3035{
3036 int i;
3037
3038 for (i = 0; i < lstrlenW( str ); i++)
3039 if (!iswdigit(str[i]))
3040 return FALSE;
3041
3042 return TRUE;
3043}
3044
3045static const WCHAR column_keys[][80] =
3046{
3047 L"VolumeCostVolume",
3048 L"VolumeCostSize",
3049 L"VolumeCostAvailable",
3050 L"VolumeCostRequired",
3051 L"VolumeCostDifference",
3052};
3053
3055{
3056 LPCWSTR text = MSI_RecordGetString( rec, 10 );
3057 LPCWSTR begin = text, end;
3058 WCHAR *num;
3059 LVCOLUMNW lvc;
3060 DWORD count = 0;
3061
3062 if (!text) return;
3063
3064 while ((begin = wcschr( begin, '{' )) && count < 5)
3065 {
3066 if (!(end = wcschr( begin, '}' )))
3067 return;
3068
3069 num = malloc( (end - begin + 1) * sizeof(WCHAR) );
3070 if (!num)
3071 return;
3072
3073 lstrcpynW( num, begin + 1, end - begin );
3074 begin += end - begin + 1;
3075
3076 /* empty braces or '0' hides the column */
3077 if ( !num[0] || !wcscmp( num, L"0" ) )
3078 {
3079 count++;
3080 free( num );
3081 continue;
3082 }
3083
3084 /* the width must be a positive number
3085 * if a width is invalid, all remaining columns are hidden
3086 */
3087 if ( !wcsncmp( num, L"-", 1 ) || !str_is_number( num ) ) {
3088#ifdef __REACTOS__
3089 // Skip in case of prefix the string of displayed characters with {\style} or {&style}.
3090 if (count == 0 && (!wcsncmp(num, L"\\", 1) || !wcsncmp(num, L"&", 1)))
3091 {
3092 FIXME("Style prefix not supported\n");
3093 free(num);
3094 continue;
3095 }
3096#endif
3097 free( num );
3098 return;
3099 }
3100
3101 ZeroMemory( &lvc, sizeof(lvc) );
3103 lvc.cx = wcstol( num, NULL, 10 );
3105
3107 free( lvc.pszText );
3108 free( num );
3109 }
3110}
3111
3113{
3115 INT each_cost;
3116 LONGLONG total_cost = 0;
3117
3118 LIST_FOR_EACH_ENTRY( feature, &dialog->package->features, MSIFEATURE, entry )
3119 {
3122 {
3123 total_cost += each_cost;
3124 }
3127 {
3128 total_cost -= each_cost;
3129 }
3130 }
3131 return total_cost;
3132}
3133
3135{
3137 LONGLONG difference, cost;
3138 WCHAR size_text[MAX_PATH];
3139 WCHAR cost_text[MAX_PATH];
3140 LPWSTR drives, ptr;
3141 LVITEMW lvitem;
3142#ifdef __REACTOS__
3143 DWORD size;
3144#else
3145 DWORD size, flags;
3146#endif
3147 int i = 0;
3148
3149 cost = vcl_get_cost(dialog) * 512;
3150 StrFormatByteSizeW(cost, cost_text, MAX_PATH);
3151
3153 if ( !size ) return;
3154
3155 drives = malloc( (size + 1) * sizeof(WCHAR) );
3156 if ( !drives ) return;
3157
3158 GetLogicalDriveStringsW( size, drives );
3159
3160 ptr = drives;
3161 while (*ptr)
3162 {
3163#ifdef __REACTOS__
3165#else
3166 if (GetVolumeInformationW(ptr, NULL, 0, NULL, 0, &flags, NULL, 0) &&
3168#endif
3169 {
3170 ptr += lstrlenW(ptr) + 1;
3171 continue;
3172 }
3173
3174 lvitem.mask = LVIF_TEXT;
3175 lvitem.iItem = i;
3176 lvitem.iSubItem = 0;
3177 lvitem.pszText = ptr;
3178 lvitem.cchTextMax = lstrlenW(ptr) + 1;
3180
3182 difference = unused.QuadPart - cost;
3183
3184 StrFormatByteSizeW(total.QuadPart, size_text, MAX_PATH);
3185 lvitem.iSubItem = 1;
3186 lvitem.pszText = size_text;
3187 lvitem.cchTextMax = lstrlenW(size_text) + 1;
3188 SendMessageW( control->hwnd, LVM_SETITEMW, 0, (LPARAM)&lvitem );
3189
3190 StrFormatByteSizeW(unused.QuadPart, size_text, MAX_PATH);
3191 lvitem.iSubItem = 2;
3192 lvitem.pszText = size_text;
3193 lvitem.cchTextMax = lstrlenW(size_text) + 1;
3194 SendMessageW( control->hwnd, LVM_SETITEMW, 0, (LPARAM)&lvitem );
3195
3196 lvitem.iSubItem = 3;
3197 lvitem.pszText = cost_text;
3198 lvitem.cchTextMax = lstrlenW(cost_text) + 1;
3199 SendMessageW( control->hwnd, LVM_SETITEMW, 0, (LPARAM)&lvitem );
3200
3201 StrFormatByteSizeW(difference, size_text, MAX_PATH);
3202 lvitem.iSubItem = 4;
3203 lvitem.pszText = size_text;
3204 lvitem.cchTextMax = lstrlenW(size_text) + 1;
3205 SendMessageW( control->hwnd, LVM_SETITEMW, 0, (LPARAM)&lvitem );
3206
3207 ptr += lstrlenW(ptr) + 1;
3208 i++;
3209 }
3210
3211 free( drives );
3212}
3213
3215{
3216 struct control *control;
3217 DWORD style;
3218
3223 if (!control)
3224 return ERROR_FUNCTION_FAILED;
3225
3228
3229 return ERROR_SUCCESS;
3230}
3231
3232/******************** VolumeSelect Combo ***************************************/
3233
3235{
3237 LPWSTR prop;
3238 BOOL indirect;
3239 int index;
3240
3241 if (HIWORD(param) != CBN_SELCHANGE)
3242 return ERROR_SUCCESS;
3243
3245 if ( index == CB_ERR )
3246 {
3247 ERR("No ComboBox item selected!\n");
3248 return ERROR_FUNCTION_FAILED;
3249 }
3250
3252
3255
3256 dialog_set_property( dialog->package, prop, text );
3257
3258 free( prop );
3259 return ERROR_SUCCESS;
3260}
3261
3263{
3264 LPWSTR drives, ptr;
3265 DWORD size;
3266
3268 if ( !size ) return;
3269
3270 drives = malloc( (size + 1) * sizeof(WCHAR) );
3271 if ( !drives ) return;
3272
3273 GetLogicalDriveStringsW( size, drives );
3274
3275 ptr = drives;
3276 while (*ptr)
3277 {
3279 ptr += lstrlenW(ptr) + 1;
3280 }
3281
3282 free( drives );
3283}
3284
3286{
3287 struct control *control;
3288 LPCWSTR prop;
3289 DWORD style;
3290
3291 /* FIXME: CBS_OWNERDRAWFIXED */
3296 if (!control)
3297 return ERROR_FUNCTION_FAILED;
3298
3301 prop = MSI_RecordGetString( rec, 9 );
3303
3305
3306 return ERROR_SUCCESS;
3307}
3308
3310{
3311 int len, len_href = ARRAY_SIZE( L"href" ) - 1;
3312 const WCHAR *p, *q;
3313 WCHAR quote = 0;
3314 LITEM item;
3315
3316 item.mask = LIF_ITEMINDEX | LIF_URL;
3317 item.iLink = 0;
3318 item.szUrl[0] = 0;
3319
3321
3322 p = item.szUrl;
3323 while (*p && *p != '<') p++;
3324 if (!*p++) return ERROR_SUCCESS;
3325 if (towupper( *p++ ) != 'A' || !iswspace( *p++ )) return ERROR_SUCCESS;
3326 while (*p && iswspace( *p )) p++;
3327
3328 len = lstrlenW( p );
3329 if (len > len_href && !wcsnicmp( p, L"href", len_href ))
3330 {
3331 p += len_href;
3332 while (*p && iswspace( *p )) p++;
3333 if (!*p || *p++ != '=') return ERROR_SUCCESS;
3334 while (*p && iswspace( *p )) p++;
3335
3336 if (*p == '\"' || *p == '\'') quote = *p++;
3337 q = p;
3338 if (quote)
3339 {
3340 while (*q && *q != quote) q++;
3341 if (*q != quote) return ERROR_SUCCESS;
3342 }
3343 else
3344 {
3345 while (*q && *q != '>' && !iswspace( *q )) q++;
3346 if (!*q) return ERROR_SUCCESS;
3347 }
3348 item.szUrl[q - item.szUrl] = 0;
3349 ShellExecuteW( NULL, L"open", p, NULL, NULL, SW_SHOWNORMAL );
3350 }
3351 return ERROR_SUCCESS;
3352}
3353
3355{
3356 struct control *control;
3358 const WCHAR *text = MSI_RecordGetString( rec, 10 );
3359 int len = lstrlenW( text );
3360 LITEM item;
3361
3363 if (!control)
3364 return ERROR_FUNCTION_FAILED;
3365
3368
3370 item.iLink = 0;
3371 item.state = LIS_ENABLED;
3372 item.stateMask = LIS_ENABLED;
3373 if (len < L_MAX_URL_LENGTH) lstrcpyW( item.szUrl, text );
3374 else item.szUrl[0] = 0;
3375
3377
3378 return ERROR_SUCCESS;
3379}
3380
3381/******************** ListView *****************************************/
3382
3384{
3387};
3388
3390{
3391 NMHDR *nmhdr = (NMHDR *)param;
3392
3393 FIXME("code %#x (%d)\n", nmhdr->code, nmhdr->code);
3394
3395 return ERROR_SUCCESS;
3396}
3397
3399{
3400 struct listview_param *lv_param = (struct listview_param *)param;
3402 LVITEMW item;
3403 HICON hIcon;
3404
3405 text = MSI_RecordGetString( rec, 4 );
3406 binary = MSI_RecordGetString( rec, 5 );
3407 hIcon = load_icon( lv_param->dialog->package->db, binary, 0 );
3408
3409 TRACE("Adding: text %s, binary %s, icon %p\n", debugstr_w(text), debugstr_w(binary), hIcon);
3410
3411 memset( &item, 0, sizeof(item) );
3412 item.mask = LVIF_TEXT | LVIF_IMAGE;
3413 deformat_string( lv_param->dialog->package, text, &item.pszText );
3414 item.iImage = ImageList_AddIcon( lv_param->control->hImageList, hIcon );
3415 item.iItem = item.iImage;
3416 SendMessageW( lv_param->control->hwnd, LVM_INSERTITEMW, 0, (LPARAM)&item );
3417
3418 DestroyIcon( hIcon );
3419
3420 return ERROR_SUCCESS;
3421}
3422
3424{
3425 MSIQUERY *view;
3426 struct listview_param lv_param = { dialog, control };
3427
3428 if (MSI_OpenQuery( dialog->package->db, &view, L"SELECT * FROM `ListView` WHERE `Property` = '%s' ORDER BY `Order`",
3430 {
3432 msiobj_release( &view->hdr );
3433 }
3434
3435 return ERROR_SUCCESS;
3436}
3437
3439{
3440 struct control *control;
3441 LPCWSTR prop;
3443 LVCOLUMNW col;
3444 RECT rc;
3445
3448 attributes = MSI_RecordGetInteger( rec, 8 );
3452 if (!control)
3453 return ERROR_FUNCTION_FAILED;
3454
3455 prop = MSI_RecordGetString( rec, 9 );
3457
3460
3461 col.mask = LVCF_FMT | LVCF_WIDTH;
3462 col.fmt = LVCFMT_LEFT;
3463 col.cx = 16;
3465
3466 GetClientRect( control->hwnd, &rc );
3467 col.cx = rc.right - 16;
3469
3470 if (control->property)
3472
3474
3475 return ERROR_SUCCESS;
3476}
3477
3479{
3480 { L"Text", dialog_text_control },
3481 { L"PushButton", dialog_button_control },
3482 { L"Line", dialog_line_control },
3483 { L"Bitmap", dialog_bitmap_control },
3484 { L"CheckBox", dialog_checkbox_control },
3485 { L"ScrollableText", dialog_scrolltext_control },
3486 { L"ComboBox", dialog_combo_control },
3487 { L"Edit", dialog_edit_control },
3488 { L"MaskedEdit", dialog_maskedit_control },
3489 { L"PathEdit", dialog_pathedit_control },
3490 { L"ProgressBar", dialog_progress_bar },
3491 { L"RadioButtonGroup", dialog_radiogroup_control },
3492 { L"Icon", dialog_icon_control },
3493 { L"SelectionTree", dialog_selection_tree },
3494 { L"GroupBox", dialog_group_box },
3495 { L"ListBox", dialog_list_box },
3496 { L"DirectoryCombo", dialog_directory_combo },
3497 { L"DirectoryList", dialog_directory_list },
3498 { L"VolumeCostList", dialog_volumecost_list },
3499 { L"VolumeSelectCombo", dialog_volumeselect_combo },
3500 { L"HyperLink", dialog_hyperlink },
3501 { L"ListView", dialog_listview }
3502};
3503
3505{
3508 UINT i;
3509
3510 /* find and call the function that can create this type of control */
3512 for( i = 0; i < ARRAY_SIZE( msi_dialog_handler ); i++ )
3514 break;
3517 else
3518 ERR("no handler for element type %s\n", debugstr_w(control_type));
3519
3520 return ERROR_SUCCESS;
3521}
3522
3524{
3525 UINT r;
3526 MSIQUERY *view;
3527 MSIPACKAGE *package = dialog->package;
3528
3529 TRACE("%p %s\n", dialog, debugstr_w(dialog->name) );
3530
3531 /* query the Control table for all the elements of the control */
3532 r = MSI_OpenQuery( package->db, &view, L"SELECT * FROM `Control` WHERE `Dialog_` = '%s'", dialog->name );
3533 if( r != ERROR_SUCCESS )
3534 {
3535 ERR("query failed for dialog %s\n", debugstr_w(dialog->name));
3537 }
3538
3540 msiobj_release( &view->hdr );
3541 return r;
3542}
3543
3545{
3546 /* FIXME: should restore the original values of any properties we changed */
3548}
3549
3550/* figure out the height of 10 point MS Sans Serif */
3552{
3553 LOGFONTW lf;
3555 BOOL r;
3556 LONG height = 0;
3557 HFONT hFont, hOldFont;
3558 HDC hdc;
3559
3560 hdc = GetDC( hwnd );
3561 if (hdc)
3562 {
3563 memset( &lf, 0, sizeof lf );
3564 lf.lfHeight = MulDiv(12, GetDeviceCaps(hdc, LOGPIXELSY), 72);
3565 lstrcpyW( lf.lfFaceName, L"MS Sans Serif" );
3567 if (hFont)
3568 {
3569 hOldFont = SelectObject( hdc, hFont );
3570 r = GetTextMetricsW( hdc, &tm );
3571 if (r)
3572 height = tm.tmHeight;
3573 SelectObject( hdc, hOldFont );
3575 }
3576 ReleaseDC( hwnd, hdc );
3577 }
3578 return height;
3579}
3580
3581/* fetch the associated record from the Dialog table */
3583{
3584 MSIPACKAGE *package = dialog->package;
3585 MSIRECORD *rec = NULL;
3586
3587 TRACE("%p %s\n", dialog, debugstr_w(dialog->name) );
3588
3589 rec = MSI_QueryGetRecord( package->db, L"SELECT * FROM `Dialog` WHERE `Dialog` = '%s'", dialog->name );
3590 if( !rec )
3591 WARN("query failed for dialog %s\n", debugstr_w(dialog->name));
3592
3593 return rec;
3594}
3595
3597{
3598 UINT xres, yres;
3599 POINT center;
3600 SIZE sz;
3601 LONG style;
3602
3603 center.x = MSI_RecordGetInteger( rec, 2 );
3604 center.y = MSI_RecordGetInteger( rec, 3 );
3605
3606 sz.cx = MSI_RecordGetInteger( rec, 4 );
3607 sz.cy = MSI_RecordGetInteger( rec, 5 );
3608
3609 sz.cx = dialog_scale_unit( dialog, sz.cx );
3610 sz.cy = dialog_scale_unit( dialog, sz.cy );
3611
3612 xres = msi_get_property_int( dialog->package->db, L"ScreenX", 0 );
3613 yres = msi_get_property_int( dialog->package->db, L"ScreenY", 0 );
3614
3615 center.x = MulDiv( center.x, xres, 100 );
3616 center.y = MulDiv( center.y, yres, 100 );
3617
3618 /* turn the client pos into the window rectangle */
3619 if (dialog->package->center_x && dialog->package->center_y)
3620 {
3621 pos->left = dialog->package->center_x - sz.cx / 2.0;
3622 pos->right = pos->left + sz.cx;
3623 pos->top = dialog->package->center_y - sz.cy / 2.0;
3624 pos->bottom = pos->top + sz.cy;
3625 }
3626 else
3627 {
3628 pos->left = center.x - sz.cx/2;
3629 pos->right = pos->left + sz.cx;
3630 pos->top = center.y - sz.cy/2;
3631 pos->bottom = pos->top + sz.cy;
3632
3633 /* save the center */
3634 dialog->package->center_x = center.x;
3635 dialog->package->center_y = center.y;
3636 }
3637
3638 dialog->size.cx = sz.cx;
3639 dialog->size.cy = sz.cy;
3640
3641 TRACE("%s\n", wine_dbgstr_rect(pos));
3642
3645}
3646
3648{
3649 struct list tab_chain;
3650 struct control *control;
3651 HWND prev = HWND_TOP;
3652
3653 list_init( &tab_chain );
3654 if (!(control = dialog_find_control( dialog, first ))) return;
3655
3656 dialog->hWndFocus = control->hwnd;
3657 while (control)
3658 {
3660 list_add_tail( &tab_chain, &control->entry );
3661 if (!control->tabnext) break;
3663 }
3664
3665 LIST_FOR_EACH_ENTRY( control, &tab_chain, struct control, entry )
3666 {
3667 SetWindowPos( control->hwnd, prev, 0, 0, 0, 0,
3670 prev = control->hwnd;
3671 }
3672
3673 /* put them back on the main list */
3674 list_move_head( &dialog->controls, &tab_chain );
3675}
3676
3678{
3679 msi_dialog *dialog = cs->lpCreateParams;
3680 MSIRECORD *rec = NULL;
3681 LPWSTR title = NULL;
3682 RECT pos;
3683
3684 TRACE("%p %p\n", dialog, dialog->package);
3685
3686 dialog->hwnd = hwnd;
3688
3689 rec = get_dialog_record( dialog );
3690 if( !rec )
3691 {
3692 TRACE("No record found for dialog %s\n", debugstr_w(dialog->name));
3693 return -1;
3694 }
3695
3697
3699
3700 dialog->attributes = MSI_RecordGetInteger( rec, 6 );
3701
3702 dialog->default_font = msi_dup_property( dialog->package->db, L"DefaultUIFont" );
3703 if (!dialog->default_font)
3704 {
3705 dialog->default_font = wcsdup( L"MS Shell Dlg" );
3706 if (!dialog->default_font)
3707 {
3708 msiobj_release( &rec->hdr );
3709 return -1;
3710 }
3711 }
3712
3713 title = get_deformatted_field( dialog->package, rec, 7 );
3715 free( title );
3716
3717 SetWindowPos( hwnd, 0, pos.left, pos.top,
3718 pos.right - pos.left, pos.bottom - pos.top,
3720
3725 msiobj_release( &rec->hdr );
3726
3727 return 0;
3728}
3729
3731{
3732 struct control *control = NULL;
3733
3734 TRACE( "%p, %#Ix, %p\n", dialog, param, hwnd );
3735
3736 switch (param)
3737 {
3738 case 1: /* enter */
3739 control = dialog_find_control( dialog, dialog->control_default );
3740 break;
3741 case 2: /* escape */
3742 control = dialog_find_control( dialog, dialog->control_cancel );
3743 break;
3744 default:
3746 }
3747
3748 if( control )
3749 {
3750 if( control->handler )
3751 {
3754 }
3755 }
3756
3757 return 0;
3758}
3759
3761{
3762 LPNMHDR nmhdr = (LPNMHDR) param;
3764
3765 TRACE("%p %p\n", dialog, nmhdr->hwndFrom);
3766
3767 if ( control && control->handler )
3769
3770 return 0;
3771}
3772
3774{
3775 HWND hwnd = dialog->hWndFocus;
3776
3779 SetFocus( hwnd );
3780 dialog->hWndFocus = hwnd;
3781}
3782
3785{
3787
3788 TRACE("0x%04x\n", msg);
3789
3790 switch (msg)
3791 {
3792 case WM_MOVE:
3793 dialog->package->center_x = LOWORD(lParam) + dialog->size.cx / 2.0;
3794 dialog->package->center_y = HIWORD(lParam) + dialog->size.cy / 2.0;
3795 break;
3796
3797 case WM_CREATE:
3799
3800 case WM_COMMAND:
3802
3803 case WM_CLOSE:
3804 /* Simulate escape press */
3805 return dialog_oncommand(dialog, 2, NULL);
3806
3807 case WM_ACTIVATE:
3808 if( LOWORD(wParam) == WA_INACTIVE )
3809 dialog->hWndFocus = GetFocus();
3810 else
3812 return 0;
3813
3814 case WM_SETFOCUS:
3816 return 0;
3817
3818 /* bounce back to our subclassed static control */
3819 case WM_CTLCOLORSTATIC:
3821
3822 case WM_DESTROY:
3823 dialog->hwnd = NULL;
3824 return 0;
3825 case WM_NOTIFY:
3826 return dialog_onnotify( dialog, lParam );
3827 }
3828 return DefWindowProcW(hwnd, msg, wParam, lParam);
3829}
3830
3832{
3833 MSG msg;
3834
3835 while (PeekMessageW( &msg, 0, 0, 0, PM_REMOVE ))
3836 {
3837 if (hdlg && IsDialogMessageW( hdlg, &msg )) continue;
3840 }
3841}
3842
3844{
3845 DWORD style;
3846 HWND hwnd, parent;
3847
3850
3851 /* create the dialog window, don't show it yet */
3853 if( dialog->attributes & msidbDialogAttributesVisible )
3854 style |= WS_VISIBLE;
3855
3856 if (dialog->parent == NULL && (dialog->attributes & msidbDialogAttributesMinimize))
3858
3859 parent = dialog->parent ? dialog->parent->hwnd : 0;
3860
3861 hwnd = CreateWindowW( L"MsiDialogCloseClass", dialog->name, style,
3863 parent, NULL, NULL, dialog );
3864 if( !hwnd )
3865 {
3866 ERR("Failed to create dialog %s\n", debugstr_w( dialog->name ));
3867 return ERROR_FUNCTION_FAILED;
3868 }
3869
3871 /* UpdateWindow( hwnd ); - and causes the transparent static controls not to paint */
3872
3873 if( dialog->attributes & msidbDialogAttributesModal )
3874 {
3875 while( !dialog->finished )
3876 {
3879 }
3880 }
3881 else
3882 return ERROR_IO_PENDING;
3883
3884 return ERROR_SUCCESS;
3885}
3886
3888{
3890
3891 TRACE("%d %p\n", msg, dialog);
3892
3893 switch (msg)
3894 {
3899 return 0;
3900 }
3901 return DefWindowProcW( hwnd, msg, wParam, lParam );
3902}
3903
3905{
3906 WNDCLASSW cls;
3907
3908 ZeroMemory( &cls, sizeof cls );
3910 cls.hInstance = NULL;
3913 cls.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
3914 cls.lpszMenuName = NULL;
3915 cls.lpszClassName = L"MsiDialogCloseClass";
3916
3917 if( !RegisterClassW( &cls ) )
3918 return FALSE;
3919
3921 cls.lpszClassName = L"MsiHiddenWindow";
3922
3923 if( !RegisterClassW( &cls ) )
3924 return FALSE;
3925
3927
3928 hMsiHiddenWindow = CreateWindowW( L"MsiHiddenWindow", NULL, WS_OVERLAPPED,
3929 0, 0, 100, 100, NULL, NULL, NULL, NULL );
3930 if( !hMsiHiddenWindow )
3931 return FALSE;
3932
3933 return TRUE;
3934}
3935
3937 UINT (*event_handler)(msi_dialog *, const WCHAR *, const WCHAR *) )
3938{
3939 MSIRECORD *rec = NULL;
3941
3942 TRACE("%s\n", debugstr_w(name));
3943
3945
3946 /* allocate the structure for the dialog to use */
3947 dialog = calloc( 1, offsetof( msi_dialog, name[wcslen( name ) + 1] ) );
3948 if( !dialog )
3949 return NULL;
3950 lstrcpyW( dialog->name, name );
3951 dialog->parent = parent;
3952 dialog->package = package;
3953 dialog->event_handler = event_handler;
3954 dialog->finished = 0;
3955 list_init( &dialog->controls );
3956 list_init( &dialog->fonts );
3957
3958 /* verify that the dialog exists */
3959 rec = get_dialog_record( dialog );
3960 if( !rec )
3961 {
3962 free( dialog );
3963 return NULL;
3964 }
3965 dialog->attributes = MSI_RecordGetInteger( rec, 6 );
3966 dialog->control_default = wcsdup( MSI_RecordGetString( rec, 9 ) );
3967 dialog->control_cancel = wcsdup( MSI_RecordGetString( rec, 10 ) );
3968 msiobj_release( &rec->hdr );
3969
3970 rec = MSI_CreateRecord(2);
3971 if (!rec)
3972 {
3974 return NULL;
3975 }
3976 MSI_RecordSetStringW(rec, 1, name);
3977 MSI_RecordSetStringW(rec, 2, L"Dialog created");
3979 msiobj_release(&rec->hdr);
3980
3981 return dialog;
3982}
3983
3985{
3986 TRACE("%p\n", dialog);
3987 dialog->finished = 1;
3988 PostMessageW(dialog->hwnd, WM_NULL, 0, 0);
3989}
3990
3992{
3993 DWORD r;
3994
3995 /* in threads other than the UI thread, block */
3997 {
3998 if (!handle) return;
4000 {
4001 MSG msg;
4002 while (PeekMessageW( &msg, NULL, 0, 0, PM_REMOVE ))
4003 {
4006 }
4007 }
4008 return;
4009 }
4010
4011 /* there are two choices for the UI thread */
4012 while (1)
4013 {
4015
4016 if( !handle )
4017 break;
4018
4019 /*
4020 * block here until somebody creates a new dialog or
4021 * the handle we're waiting on becomes ready
4022 */
4024 if( r == WAIT_OBJECT_0 )
4025 break;
4026 }
4027}
4028
4030{
4031 TRACE("\n");
4032 dialog->attributes |= msidbDialogAttributesVisible;
4033 dialog->attributes &= ~msidbDialogAttributesModal;
4035}
4036
4037static void free_subscriber( struct subscriber *sub )
4038{
4039 free( sub->event );
4040 free( sub->control );
4041 free( sub->attribute );
4042 free( sub );
4043}
4044
4046{
4047 struct list *item, *next;
4048
4050 {
4051 struct subscriber *sub = LIST_ENTRY( item, struct subscriber, entry );
4052
4053 if (wcscmp( sub->dialog->name, dialog )) continue;
4054 list_remove( &sub->entry );
4055 free_subscriber( sub );
4056 }
4057}
4058
4060{
4061 struct font *font, *next;
4062
4064 {
4066 return;
4067 }
4068
4069 if( dialog->hwnd )
4070 {
4071 ShowWindow( dialog->hwnd, SW_HIDE );
4072 DestroyWindow( dialog->hwnd );
4073 }
4074
4075 /* unsubscribe events */
4076 event_cleanup_subscriptions( dialog->package, dialog->name );
4077
4078 /* destroy the list of controls */
4079 while( !list_empty( &dialog->controls ) )
4080 {
4081 struct control *t;
4082
4083 t = LIST_ENTRY( list_head( &dialog->controls ), struct control, entry );
4084 destroy_control( t );
4085 }
4086
4087 /* destroy the list of fonts */
4088 LIST_FOR_EACH_ENTRY_SAFE( font, next, &dialog->fonts, struct font, entry )
4089 {
4090 list_remove( &font->entry );
4091 DeleteObject( font->hfont );
4092 free( font );
4093 }
4094 free( dialog->default_font );
4095
4096 free( dialog->control_default );
4097 free( dialog->control_cancel );
4098 dialog->package = NULL;
4099 free( dialog );
4100}
4101
4103{
4106 UnregisterClassW( L"MsiDialogCloseClass", NULL );
4107 UnregisterClassW( L"MsiHiddenWindow", NULL );
4108 uiThreadId = 0;
4109}
4110
4112{
4113 struct list *item, *next;
4114
4116 {
4117 struct subscriber *sub = LIST_ENTRY( item, struct subscriber, entry );
4118 list_remove( &sub->entry );
4119 free_subscriber( sub );
4120 }
4121}
4122
4124{
4126 msiobj_release( &preview->package->hdr );
4127}
4128
4130{
4132 MSIPACKAGE *package;
4133
4134 package = MSI_CreatePackage( db );
4135 if (package)
4136 {
4138 if (preview)
4139 {
4140 preview->package = package;
4141 msiobj_addref( &package->hdr );
4142 }
4143 msiobj_release( &package->hdr );
4144 }
4145 return preview;
4146}
4147
4149{
4150 MSIDATABASE *db;
4153
4154 TRACE( "%lu %p\n", hdb, phPreview );
4155
4156 if (!(db = msihandle2msiinfo(hdb, MSIHANDLETYPE_DATABASE)))
4157 return ERROR_INVALID_HANDLE;
4158
4160 if (preview)
4161 {
4162 *phPreview = alloc_msihandle( &preview->hdr );
4163 msiobj_release( &preview->hdr );
4164 r = ERROR_SUCCESS;
4165 if (!*phPreview)
4167 }
4168 msiobj_release( &db->hdr );
4169 return r;
4170}
4171
4172static UINT preview_event_handler( msi_dialog *dialog, const WCHAR *event, const WCHAR *argument )
4173{
4174 MESSAGE("Preview dialog event '%s' (arg='%s')\n", debugstr_w(event), debugstr_w(argument));
4175 return ERROR_SUCCESS;
4176}
4177
4179{
4182
4183 if (preview->dialog)
4184 msi_dialog_destroy( preview->dialog );
4185
4186 /* an empty name means we should just destroy the current preview dialog */
4187 if (szDialogName)
4188 {
4189 dialog = dialog_create( preview->package, szDialogName, NULL, preview_event_handler );
4190 if (dialog)
4192 else
4194 }
4195 preview->dialog = dialog;
4196 return r;
4197}
4198
4200{
4202 UINT r;
4203
4204 TRACE( "%lu %s\n", hPreview, debugstr_w(szDialogName) );
4205
4207 if (!preview)
4208 return ERROR_INVALID_HANDLE;
4209
4210 r = MSI_PreviewDialogW( preview, szDialogName );
4211 msiobj_release( &preview->hdr );
4212 return r;
4213}
4214
4216{
4217 UINT r;
4218 LPWSTR strW = NULL;
4219
4220 TRACE( "%lu %s\n", hPreview, debugstr_a(szDialogName) );
4221
4222 if (szDialogName)
4223 {
4224 strW = strdupAtoW( szDialogName );
4225 if (!strW)
4226 return ERROR_OUTOFMEMORY;
4227 }
4228 r = MsiPreviewDialogW( hPreview, strW );
4229 free( strW );
4230 return r;
4231}
4232
4233UINT WINAPI MsiPreviewBillboardW( MSIHANDLE hPreview, const WCHAR *szControlName, const WCHAR *szBillboard )
4234{
4235 FIXME( "%lu %s %s\n", hPreview, debugstr_w(szControlName), debugstr_w(szBillboard) );
4237}
4238
4239UINT WINAPI MsiPreviewBillboardA( MSIHANDLE hPreview, const char *szControlName, const char *szBillboard )
4240{
4241 FIXME( "%lu %s %s\n", hPreview, debugstr_a(szControlName), debugstr_a(szBillboard) );
4243}
4244
4246{
4247 const WCHAR *event;
4248 UINT (*handler)( msi_dialog *, const WCHAR * );
4249};
4250
4251static UINT dialog_event_handler( msi_dialog *, const WCHAR *, const WCHAR * );
4252
4253/* create a dialog box and run it if it's modal */
4254static INT event_do_dialog( MSIPACKAGE *package, const WCHAR *name, msi_dialog *parent, BOOL destroy_modeless )
4255{
4257 UINT r;
4258 INT retval;
4259
4260 /* create a new dialog */
4262 if (dialog)
4263 {
4264 /* kill the current modeless dialog */
4265 if (destroy_modeless && package->dialog)
4266 {
4267 msi_dialog_destroy( package->dialog );
4268 package->dialog = NULL;
4269 }
4270
4271 /* modeless dialogs return an error message */
4273 if (r == ERROR_SUCCESS)
4274 {
4275 retval = dialog->retval;
4277 return retval;
4278 }
4279 else
4280 {
4281 package->dialog = dialog;
4282 return IDOK;
4283 }
4284 }
4285 else return 0;
4286}
4287
4288/* end a modal dialog box */
4289static UINT event_end_dialog( msi_dialog *dialog, const WCHAR *argument )
4290{
4291 if (!wcscmp( argument, L"Exit" ))
4292 dialog->retval = IDCANCEL;
4293 else if (!wcscmp( argument, L"Retry" ))
4294 dialog->retval = IDRETRY;
4295 else if (!wcscmp( argument, L"Ignore" ))
4296 dialog->retval = IDOK;
4297 else if (!wcscmp( argument, L"Return" ))
4298 dialog->retval = 0;
4299 else
4300 {
4301 ERR("Unknown argument string %s\n", debugstr_w(argument));
4302 dialog->retval = IDABORT;
4303 }
4304 event_cleanup_subscriptions( dialog->package, dialog->name );
4306 return ERROR_SUCCESS;
4307}
4308
4310{
4311 dialog->pending_event = event_end_dialog;
4312 free( dialog->pending_argument );
4313 dialog->pending_argument = wcsdup( argument );
4314 return ERROR_SUCCESS;
4315}
4316
4317/* transition from one modal dialog to another modal dialog */
4318static UINT event_new_dialog( msi_dialog *dialog, const WCHAR *argument )
4319{
4320 /* store the name of the next dialog, and signal this one to end */
4321 dialog->package->next_dialog = wcsdup( argument );
4324 return ERROR_SUCCESS;
4325}
4326
4328{
4329 dialog->pending_event = event_new_dialog;
4330 free( dialog->pending_argument );
4331 dialog->pending_argument = wcsdup( argument );
4332 return ERROR_SUCCESS;
4333}
4334
4335/* create a new child dialog of an existing modal dialog */
4336static UINT event_spawn_dialog( msi_dialog *dialog, const WCHAR *argument )
4337{
4338 INT r;
4339 /* don't destroy a modeless dialogs that might be our parent */
4340 r = event_do_dialog( dialog->package, argument, dialog, FALSE );
4341 if (r != 0)
4342 {
4343 dialog->retval = r;
4345 }
4346 else
4348
4349 return ERROR_SUCCESS;
4350}
4351
4353{
4354 dialog->pending_event = event_spawn_dialog;
4355 free( dialog->pending_argument );
4356 dialog->pending_argument = wcsdup( argument );
4357 return ERROR_SUCCESS;
4358}
4359
4360/* creates a dialog that remains up for a period of time based on a condition */
4362{
4363 FIXME("doing nothing\n");
4364 return ERROR_SUCCESS;
4365}
4366
4367static UINT event_do_action( msi_dialog *dialog, const WCHAR *argument )
4368{
4369 ACTION_PerformAction(dialog->package, argument);
4370 return ERROR_SUCCESS;
4371}
4372
4373static UINT event_add_local( msi_dialog *dialog, const WCHAR *argument )
4374{
4376
4377 LIST_FOR_EACH_ENTRY( feature, &dialog->package->features, MSIFEATURE, entry )
4378 {
4379 if (!wcscmp( argument, feature->Feature ) || !wcscmp( argument, L"ALL" ))
4380 {
4381 if (feature->ActionRequest != INSTALLSTATE_LOCAL)
4382 msi_set_property( dialog->package->db, L"Preselected", L"1", -1 );
4384 }
4385 }
4386 return ERROR_SUCCESS;
4387}
4388
4389static UINT event_remove( msi_dialog *dialog, const WCHAR *argument )
4390{
4392
4393 LIST_FOR_EACH_ENTRY( feature, &dialog->package->features, MSIFEATURE, entry )
4394 {
4395 if (!wcscmp( argument, feature->Feature ) || !wcscmp( argument, L"ALL" ))
4396 {
4397 if (feature->ActionRequest != INSTALLSTATE_ABSENT)
4398 msi_set_property( dialog->package->db, L"Preselected", L"1", -1 );
4400 }
4401 }
4402 return ERROR_SUCCESS;
4403}
4404
4405static UINT event_add_source( msi_dialog *dialog, const WCHAR *argument )
4406{
4408
4409 LIST_FOR_EACH_ENTRY( feature, &dialog->package->features, MSIFEATURE, entry )
4410 {
4411 if (!wcscmp( argument, feature->Feature ) || !wcscmp( argument, L"ALL" ))
4412 {
4413 if (feature->ActionRequest != INSTALLSTATE_SOURCE)
4414 msi_set_property( dialog->package->db, L"Preselected", L"1", -1 );
4416 }
4417 }
4418 return ERROR_SUCCESS;
4419}
4420
4421void msi_event_fire( MSIPACKAGE *package, const WCHAR *event, MSIRECORD *rec )
4422{
4423 struct subscriber *sub;
4424
4425 TRACE("firing event %s\n", debugstr_w(event));
4426
4427 LIST_FOR_EACH_ENTRY( sub, &package->subscriptions, struct subscriber, entry )
4428 {
4429 if (wcsicmp( sub->event, event )) continue;
4430 dialog_handle_event( sub->dialog, sub->control, sub->attribute, rec );
4431 }
4432}
4433
4435{
4436 WCHAR *path = msi_dup_property( dialog->package->db, argument );
4437 MSIRECORD *rec = MSI_CreateRecord( 1 );
4439
4440 MSI_RecordSetStringW( rec, 1, path );
4441 msi_event_fire( dialog->package, L"SelectionPath", rec );
4442 if (path)
4443 {
4444 /* failure to set the path halts the executing of control events */
4445 r = MSI_SetTargetPathW( dialog->package, argument, path );
4446 free( path );
4447 }
4448 msiobj_release( &rec->hdr );
4449 return r;
4450}
4451
4452static UINT event_reset( msi_dialog *dialog, const WCHAR *argument )
4453{
4455 return ERROR_SUCCESS;
4456}
4457
4459{
4460 MSIRECORD *row;
4461 INT rc;
4462
4463 if (!TABLE_Exists(package->db, L"Dialog")) return 0;
4464
4465 row = MSI_CreateRecord(0);
4466 if (!row) return -1;
4469 msiobj_release(&row->hdr);
4470
4471 if (rc == -2) rc = 0;
4472
4473 if (!rc)
4474 {
4476 if (!row) return -1;
4477 MSI_RecordSetInteger(row, 1, 2726);
4480
4481 msiobj_release(&row->hdr);
4482 }
4483 return rc;
4484}
4485
4487{
4488 INT r;
4489
4490 if (package->next_dialog) ERR("Already got next dialog... ignoring it\n");
4491 package->next_dialog = NULL;
4492
4493 /* Dialogs are chained through NewDialog, which sets the next_dialog member.
4494 * We fall out of the loop if we reach a modeless dialog, which immediately
4495 * returns IDOK, or an EndDialog event, which returns the value corresponding
4496 * to its argument.
4497 */
4498 r = event_do_dialog( package, dialog, NULL, TRUE );
4499 while (package->next_dialog)
4500 {
4501 WCHAR *name = package->next_dialog;
4502
4503 package->next_dialog = NULL;
4504 r = event_do_dialog( package, name, NULL, TRUE );
4505 free( name );
4506 }
4507 return r;
4508}
4509
4511{
4512 int level = wcstol( argument, NULL, 10 );
4513
4514 TRACE("setting install level to %d\n", level);
4515 return MSI_SetInstallLevel( dialog->package, level );
4516}
4517
4519{
4521}
4522
4524{
4526}
4527
4529{
4530 return msi_set_property( dialog->package->db, L"REINSTALLMODE", argument, -1 );
4531}
4532
4533static UINT event_reinstall( msi_dialog *dialog, const WCHAR *argument )
4534{
4535 return msi_set_property( dialog->package->db, L"REINSTALL", argument, -1 );
4536}
4537
4539{
4540 return msi_validate_product_id( dialog->package );
4541}
4542
4543static const struct control_event control_events[] =
4544{
4545 { L"EndDialog", pending_event_end_dialog },
4546 { L"NewDialog", pending_event_new_dialog },
4547 { L"SpawnDialog", pending_event_spawn_dialog },
4548 { L"SpawnWaitDialog", event_spawn_wait_dialog },
4549 { L"DoAction", event_do_action },
4550 { L"AddLocal", event_add_local },
4551 { L"Remove", event_remove },
4552 { L"AddSource", event_add_source },
4553 { L"SetTargetPath", event_set_target_path },
4554 { L"Reset", event_reset },
4555 { L"SetInstallLevel", event_set_install_level },
4556 { L"DirectoryListUp", event_directory_list_up },
4557 { L"DirectoryListNew", event_directory_list_new },
4558 { L"SelectionBrowse", event_spawn_dialog },
4559 { L"ReinstallMode", event_reinstall_mode },
4560 { L"Reinstall", event_reinstall },
4561 { L"ValidateProductID", event_validate_product_id },
4562 { NULL, NULL }
4563};
4564
4565static UINT dialog_event_handler( msi_dialog *dialog, const WCHAR *event, const WCHAR *argument )
4566{
4567 unsigned int i;
4568
4569 TRACE("handling event %s\n", debugstr_w(event));
4570
4571 if (!event) return ERROR_SUCCESS;
4572
4573 for (i = 0; control_events[i].event; i++)
4574 {
4575 if (!wcscmp( control_events[i].event, event ))
4576 return control_events[i].handler( dialog, argument );
4577 }
4578 FIXME("unhandled event %s arg(%s)\n", debugstr_w(event), debugstr_w(argument));
4579 return ERROR_SUCCESS;
4580}
Arabic default style
Definition: afstyles.h:94
static int state
Definition: maze.c:121
unsigned int dir
Definition: maze.c:112
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
#define msg(x)
Definition: auth_time.c:54
HWND hWnd
Definition: settings.c:17
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define index(s, c)
Definition: various.h:29
HFONT hFont
Definition: main.c:53
#define ARRAY_SIZE(A)
Definition: main.h:20
static previewinfo preview
Definition: print.c:56
static void list_remove(struct list_entry *entry)
Definition: list.h:90
static int list_empty(struct list_entry *head)
Definition: list.h:58
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
static void list_add_head(struct list_entry *head, struct list_entry *entry)
Definition: list.h:76
static void list_init(struct list_entry *head)
Definition: list.h:51
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
HBITMAP hbmp
HIMAGELIST himl
Definition: list.h:37
RECT rect
Definition: combotst.c:67
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
HDC dc
Definition: cylfrac.c:34
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define ERROR_IO_PENDING
Definition: dderror.h:15
#define realloc
Definition: debug_ros.c:6
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
#define ERROR_SUCCESS
Definition: deptool.c:10
#define LF_FACESIZE
Definition: dimm.idl:39
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static HBITMAP hBitmap
Definition: timezone.c:26
WORD face[3]
Definition: mesh.c:4747
static const WCHAR quote[]
Definition: reg.c:40
INT WINAPI ImageList_Add(HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask)
Definition: imagelist.c:458
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:941
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:814
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:61
#define wcschr
Definition: compat.h:17
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define wcsnicmp
Definition: compat.h:14
#define wcsrchr
Definition: compat.h:16
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define FreeLibrary(x)
Definition: compat.h:748
#define MAX_PATH
Definition: compat.h:34
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
#define CALLBACK
Definition: compat.h:35
#define lstrcpyW
Definition: compat.h:749
#define wcsicmp
Definition: compat.h:15
#define lstrcpynW
Definition: compat.h:738
#define lstrlenW
Definition: compat.h:750
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:58
BOOL WINAPI GetDiskFreeSpaceExW(IN LPCWSTR lpDirectoryName OPTIONAL, OUT PULARGE_INTEGER lpFreeBytesAvailableToCaller, OUT PULARGE_INTEGER lpTotalNumberOfBytes, OUT PULARGE_INTEGER lpTotalNumberOfFreeBytes)
Definition: disk.c:342
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
Definition: disk.c:497
DWORD WINAPI GetLogicalDriveStringsW(IN DWORD nBufferLength, IN LPWSTR lpBuffer)
Definition: disk.c:73
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:636
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:382
BOOL WINAPI GetVolumeInformationW(IN LPCWSTR lpRootPathName, IN LPWSTR lpVolumeNameBuffer, IN DWORD nVolumeNameSize, OUT LPDWORD lpVolumeSerialNumber OPTIONAL, OUT LPDWORD lpMaximumComponentLength OPTIONAL, OUT LPDWORD lpFileSystemFlags OPTIONAL, OUT LPWSTR lpFileSystemNameBuffer OPTIONAL, IN DWORD nFileSystemNameSize)
Definition: volume.c:226
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
WCHAR *WINAPI PathRemoveBackslashW(WCHAR *path)
Definition: path.c:2016
WCHAR *WINAPI PathFindFileNameW(const WCHAR *path)
Definition: path.c:1677
void WINAPI PathStripPathW(WCHAR *path)
Definition: path.c:2304
BOOL WINAPI PathIsRelativeW(const WCHAR *path)
Definition: path.c:1006
MSIFOLDER * msi_get_loaded_folder(MSIPACKAGE *package, const WCHAR *dir)
Definition: action.c:583
UINT msi_validate_product_id(MSIPACKAGE *package)
Definition: action.c:7188
UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action)
Definition: action.c:7640
WCHAR * msi_create_temp_file(MSIDATABASE *db)
Definition: custom.c:215
static WCHAR * get_checkbox_value(msi_dialog *dialog, const WCHAR *prop)
Definition: dialog.c:1063
static UINT event_do_action(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4367
static UINT event_remove(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4389
HINSTANCE msi_hInstance
Definition: msi_main.c:51
static UINT dialog_set_control_condition(MSIRECORD *rec, void *param)
Definition: dialog.c:1438
#define WM_MSI_DIALOG_DESTROY
Definition: dialog.c:127
void msi_event_cleanup_all_subscriptions(MSIPACKAGE *package)
Definition: dialog.c:4111
static struct control * dialog_find_control_by_type(msi_dialog *dialog, const WCHAR *type)
Definition: dialog.c:175
static WCHAR * get_unique_folder_name(const WCHAR *root, int *ret_len)
Definition: dialog.c:2887
static void dialog_set_property(MSIPACKAGE *package, const WCHAR *property, const WCHAR *value)
Definition: dialog.c:522
static void MSI_ClosePreview(MSIOBJECTHDR *arg)
Definition: dialog.c:4123
static HANDLE load_image(MSIDATABASE *db, const WCHAR *name, UINT type, UINT cx, UINT cy, UINT flags)
Definition: dialog.c:450
static UINT dialog_directorylist_up(msi_dialog *dialog)
Definition: dialog.c:2856
static void dialog_update_directory_combo(msi_dialog *dialog, struct control *control)
Definition: dialog.c:2770
static void dialog_setfocus(msi_dialog *dialog)
Definition: dialog.c:3773
static const struct control_handler msi_dialog_handler[]
Definition: dialog.c:3478
static void destroy_control(struct control *t)
Definition: dialog.c:355
static UINT dialog_line_control(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:1166
static void mask_next_control(struct msi_maskedit_info *info, HWND hWnd)
Definition: dialog.c:1743
static UINT dialog_button_control(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:1010
static WCHAR * dialog_get_uitext(msi_dialog *dialog, const WCHAR *key)
Definition: dialog.c:438
UINT WINAPI MsiPreviewBillboardW(MSIHANDLE hPreview, const WCHAR *szControlName, const WCHAR *szBillboard)
Definition: dialog.c:4233
static UINT dialog_listview(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:3438
static void dialog_handle_event(msi_dialog *dialog, const WCHAR *control, const WCHAR *attribute, MSIRECORD *rec)
Definition: dialog.c:555
static void free_subscriber(struct subscriber *sub)
Definition: dialog.c:4037
static INT dialog_get_sans_serif_height(HWND hwnd)
Definition: dialog.c:3551
static void dialog_update_directory_list(msi_dialog *dialog, struct control *control)
Definition: dialog.c:2811
static void seltree_update_feature_installstate(HWND hwnd, HTREEITEM hItem, MSIPACKAGE *package, MSIFEATURE *feature, INSTALLSTATE state)
Definition: dialog.c:2307
static struct control * dialog_find_control_by_hwnd(msi_dialog *dialog, HWND hwnd)
Definition: dialog.c:189
#define MAX_NUM_DIGITS
Definition: dialog.c:1616
static LRESULT seltree_menu(HWND hwnd, HTREEITEM hItem)
Definition: dialog.c:2335
void msi_dialog_unregister_class(void)
Definition: dialog.c:4102
static struct msi_maskedit_info * dialog_parse_groups(const WCHAR *mask)
Definition: dialog.c:1819
static UINT dialog_evaluate_control_conditions(msi_dialog *dialog)
Definition: dialog.c:1471
static UINT dialog_hyperlink_handler(msi_dialog *dialog, struct control *control, WPARAM param)
Definition: dialog.c:3309
static void dialog_checkbox_sync_state(msi_dialog *dialog, struct control *control)
Definition: dialog.c:1122
static BOOL mask_editable(WCHAR type)
Definition: dialog.c:1679
static DWORD CALLBACK richedit_stream_in(DWORD_PTR arg, BYTE *buffer, LONG count, LONG *pcb)
Definition: dialog.c:1217
static UINT listbox_add_item(MSIRECORD *rec, void *param)
Definition: dialog.c:2662
static UINT dialog_listbox_handler(msi_dialog *dialog, struct control *control, WPARAM param)
Definition: dialog.c:2706
static UINT MSI_PreviewDialogW(MSIPREVIEW *preview, LPCWSTR szDialogName)
Definition: dialog.c:4178
static UINT event_new_dialog(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4318
static UINT dialog_set_font(msi_dialog *dialog, HWND hwnd, const WCHAR *name)
Definition: dialog.c:327
static WCHAR * get_window_text(HWND hwnd)
Definition: dialog.c:134
static UINT dialog_icon_control(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:1328
static UINT dialog_scrolltext_control(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:1250
static UINT preview_event_handler(msi_dialog *dialog, const WCHAR *event, const WCHAR *argument)
Definition: dialog.c:4172
static LRESULT dialog_oncommand(msi_dialog *dialog, WPARAM param, HWND hwnd)
Definition: dialog.c:3730
static void process_pending_messages(HWND hdlg)
Definition: dialog.c:3831
static UINT event_add_source(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4405
static UINT dialog_listview_handler(msi_dialog *dialog, struct control *control, WPARAM param)
Definition: dialog.c:3389
static UINT dialog_radiogroup_control(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:2212
static UINT dialog_directorylist_new(msi_dialog *dialog)
Definition: dialog.c:2915
static UINT dialog_hyperlink(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:3354
static void seltree_sync_item_state(HWND hwnd, MSIFEATURE *feature, HTREEITEM hItem)
Definition: dialog.c:2269
static LRESULT WINAPI MSIMaskedEdit_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:1764
static UINT dialog_radiogroup_handler(msi_dialog *dialog, struct control *control, WPARAM param)
Definition: dialog.c:2147
static UINT dialog_set_property_event(msi_dialog *dialog, const WCHAR *event, const WCHAR *arg)
Definition: dialog.c:856
static void dialog_combobox_update(msi_dialog *dialog, struct control *control)
Definition: dialog.c:1514
static LRESULT WINAPI MSIListBox_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:2634
static UINT pending_event_new_dialog(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4327
static void scrolltext_add_text(struct control *control, const WCHAR *text)
Definition: dialog.c:1232
static UINT event_spawn_wait_dialog(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4361
static LRESULT WINAPI MSIScrollText_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:1183
static UINT dialog_checkbox_handler(msi_dialog *dialog, struct control *control, WPARAM param)
Definition: dialog.c:1128
static void event_cleanup_subscriptions(MSIPACKAGE *package, const WCHAR *dialog)
Definition: dialog.c:4045
static UINT pending_event_end_dialog(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4309
static HBITMAP load_picture(MSIDATABASE *db, const WCHAR *name, INT cx, INT cy, DWORD flags)
Definition: dialog.c:946
static UINT event_validate_product_id(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4538
static void seltree_create_imagelist(HWND hwnd)
Definition: dialog.c:2470
static void dialog_map_events(msi_dialog *dialog, const WCHAR *control)
Definition: dialog.c:696
static struct control * dialog_create_window(msi_dialog *dialog, MSIRECORD *rec, DWORD exstyle, const WCHAR *szCls, const WCHAR *name, const WCHAR *text, DWORD style, HWND parent)
Definition: dialog.c:374
static UINT dialog_edit_handler(msi_dialog *dialog, struct control *control, WPARAM param)
Definition: dialog.c:1599
void msi_event_fire(MSIPACKAGE *package, const WCHAR *event, MSIRECORD *rec)
Definition: dialog.c:4421
INT ACTION_DialogBox(MSIPACKAGE *package, const WCHAR *dialog)
Definition: dialog.c:4486
static UINT dialog_edit_control(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:1618
static UINT dialog_add_font(MSIRECORD *rec, void *param)
Definition: dialog.c:270
static UINT event_add_local(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4373
#define MASK_MAX_GROUPS
Definition: dialog.c:1658
static void dialog_do_preview(msi_dialog *dialog)
Definition: dialog.c:4029
static UINT dialog_control_event(MSIRECORD *rec, void *param)
Definition: dialog.c:895
static WCHAR * dialog_get_style(const WCHAR *p, const WCHAR **rest)
Definition: dialog.c:233
static WCHAR * get_path_property(msi_dialog *dialog, struct control *control)
Definition: dialog.c:2024
UINT WINAPI MsiPreviewBillboardA(MSIHANDLE hPreview, const char *szControlName, const char *szBillboard)
Definition: dialog.c:4239
static void dialog_set_tab_order(msi_dialog *dialog, const WCHAR *first)
Definition: dialog.c:3647
static UINT event_set_install_level(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4510
static UINT event_set_target_path(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4434
static const struct control_event control_events[]
Definition: dialog.c:4543
static void dialog_set_checkbox_state(msi_dialog *dialog, struct control *control, UINT state)
Definition: dialog.c:1102
static UINT dialog_event_handler(msi_dialog *, const WCHAR *, const WCHAR *)
Definition: dialog.c:4565
#define USER_INSTALLSTATE_ALL
Definition: dialog.c:129
static UINT dialog_progress_bar(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:1997
static UINT dialog_group_box(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:2609
static UINT dialog_button_handler(msi_dialog *dialog, struct control *control, WPARAM param)
Definition: dialog.c:915
static struct control * dialog_find_control(msi_dialog *dialog, const WCHAR *name)
Definition: dialog.c:161
static LRESULT WINAPI MSIText_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:762
static UINT dialog_run_message_loop(msi_dialog *dialog)
Definition: dialog.c:3843
static void dialog_vcl_add_drives(msi_dialog *dialog, struct control *control)
Definition: dialog.c:3134
static UINT dialog_create_radiobutton(MSIRECORD *rec, void *param)
Definition: dialog.c:2160
static UINT listbox_add_items(struct msi_listbox_info *info, const WCHAR *property)
Definition: dialog.c:2679
static HWND hMsiHiddenWindow
Definition: dialog.c:132
static struct control * dialog_add_control(msi_dialog *dialog, MSIRECORD *rec, const WCHAR *szCls, DWORD style)
Definition: dialog.c:715
static LRESULT WINAPI MSIHiddenWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:3887
static UINT dialog_list_box(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:2725
static void maskedit_set_text(struct msi_maskedit_info *info, const WCHAR *text)
Definition: dialog.c:1795
static UINT dialog_build_font_list(msi_dialog *dialog)
Definition: dialog.c:339
static LRESULT dialog_onnotify(msi_dialog *dialog, LPARAM param)
Definition: dialog.c:3760
static DWORD uiThreadId
Definition: dialog.c:131
static UINT event_reset(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4452
static UINT seltree_popup_menu(HWND hwnd, INT x, INT y)
Definition: dialog.c:2288
static msi_dialog * dialog_create(MSIPACKAGE *package, const WCHAR *name, msi_dialog *parent, UINT(*event_handler)(msi_dialog *, const WCHAR *, const WCHAR *))
Definition: dialog.c:3936
static MSIPREVIEW * MSI_EnableUIPreview(MSIDATABASE *db)
Definition: dialog.c:4129
INT ACTION_ShowDialog(MSIPACKAGE *package, const WCHAR *dialog)
Definition: dialog.c:4458
static void dialog_vsc_add_drives(msi_dialog *dialog, struct control *control)
Definition: dialog.c:3262
static UINT dialog_maskedit_control(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:1928
static HICON load_icon(MSIDATABASE *db, const WCHAR *text, UINT attributes)
Definition: dialog.c:477
static UINT listview_add_items(msi_dialog *dialog, struct control *control)
Definition: dialog.c:3423
static void dialog_update_controls(msi_dialog *dialog, const WCHAR *property)
Definition: dialog.c:500
static LRESULT WINAPI MSIRadioGroup_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:2193
static INT dialog_scale_unit(msi_dialog *dialog, INT val)
Definition: dialog.c:156
static UINT dialog_text_control(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:796
static UINT event_reinstall(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4533
static LRESULT WINAPI MSIComboBox_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:1361
static UINT dialog_combo_control(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:1549
static void dialog_adjust_dialog_pos(msi_dialog *dialog, MSIRECORD *rec, RECT *pos)
Definition: dialog.c:3596
static INT event_do_dialog(MSIPACKAGE *package, const WCHAR *name, msi_dialog *parent, BOOL destroy_modeless)
Definition: dialog.c:4254
static BOOL dialog_verify_path(const WCHAR *path)
Definition: dialog.c:2048
static UINT event_spawn_dialog(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4336
static UINT pending_event_spawn_dialog(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4352
static UINT dialog_selection_tree(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:2563
static const WCHAR column_keys[][80]
Definition: dialog.c:3045
static UINT event_end_dialog(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4289
static WCHAR * dialog_dup_property(msi_dialog *dialog, const WCHAR *property, BOOL indirect)
Definition: dialog.c:211
static UINT dialog_checkbox_control(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:1145
static UINT dialog_volsel_handler(msi_dialog *dialog, struct control *control, WPARAM param)
Definition: dialog.c:3234
static UINT event_directory_list_up(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4518
static BOOL dialog_onkillfocus(msi_dialog *dialog, struct control *control)
Definition: dialog.c:2060
static void seltree_add_child_features(MSIPACKAGE *package, HWND hwnd, const WCHAR *parent, HTREEITEM hParent)
Definition: dialog.c:2420
static UINT dialog_dirlist_handler(msi_dialog *dialog, struct control *control, WPARAM param)
Definition: dialog.c:2940
static LRESULT WINAPI MSIPathEdit_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:2095
UINT WINAPI MsiPreviewDialogA(MSIHANDLE hPreview, LPCSTR szDialogName)
Definition: dialog.c:4215
static UINT event_reinstall_mode(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4528
static UINT dialog_volumecost_list(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:3214
static UINT event_directory_list_new(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4523
static LRESULT WINAPI MSIDialog_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:3783
static UINT dialog_directory_list(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:3005
static BOOL str_is_number(LPCWSTR str)
Definition: dialog.c:3034
static UINT dialog_get_checkbox_state(msi_dialog *dialog, struct control *control)
Definition: dialog.c:1093
static LRESULT dialog_oncreate(HWND hwnd, CREATESTRUCTW *cs)
Definition: dialog.c:3677
static LONGLONG vcl_get_cost(msi_dialog *dialog)
Definition: dialog.c:3112
static WCHAR * get_deformatted_field(MSIPACKAGE *package, MSIRECORD *rec, int field)
Definition: dialog.c:201
static void dialog_end_dialog(msi_dialog *dialog)
Definition: dialog.c:3984
static MSIFEATURE * seltree_get_selected_feature(struct control *control)
Definition: dialog.c:549
static struct font * dialog_find_font(msi_dialog *dialog, const WCHAR *name)
Definition: dialog.c:316
static LRESULT WINAPI MSISelectionTree_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:2386
#define WM_MSI_DIALOG_CREATE
Definition: dialog.c:126
static UINT dialog_pathedit_control(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:2120
static UINT combobox_add_items(struct msi_combobox_info *info, const WCHAR *property)
Definition: dialog.c:1411
static void dialog_update_pathedit(msi_dialog *dialog, struct control *control)
Definition: dialog.c:2034
static void mask_control_change(struct msi_maskedit_info *info)
Definition: dialog.c:1694
static MSIFEATURE * seltree_feature_from_item(HWND hwnd, HTREEITEM hItem)
Definition: dialog.c:529
static UINT listview_add_item(MSIRECORD *rec, void *param)
Definition: dialog.c:3398
static UINT dialog_directory_combo(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:2787
static UINT map_event(MSIRECORD *row, void *param)
Definition: dialog.c:686
static WCHAR * get_binary_name(MSIPACKAGE *package, MSIRECORD *rec)
Definition: dialog.c:836
static void maskedit_create_children(struct msi_maskedit_info *info, const WCHAR *font)
Definition: dialog.c:1880
static UINT dialog_reset(msi_dialog *dialog)
Definition: dialog.c:3544
static UINT combobox_add_item(MSIRECORD *rec, void *param)
Definition: dialog.c:1389
static UINT dialog_volumeselect_combo(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:3285
static BOOL dialog_register_class(void)
Definition: dialog.c:3904
static BOOL CALLBACK radioground_child_enum(HWND hWnd, LPARAM lParam)
Definition: dialog.c:2187
void msi_dialog_destroy(msi_dialog *dialog)
Definition: dialog.c:4059
static UINT dialog_fill_controls(msi_dialog *dialog)
Definition: dialog.c:3523
UINT WINAPI MsiEnableUIPreview(MSIHANDLE hdb, MSIHANDLE *phPreview)
Definition: dialog.c:4148
static UINT dialog_bitmap_control(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:1293
static void dialog_update_all_controls(msi_dialog *dialog)
Definition: dialog.c:511
void msi_dialog_check_messages(HANDLE handle)
Definition: dialog.c:3991
static UINT dialog_create_controls(MSIRECORD *rec, void *param)
Definition: dialog.c:3504
static MSIRECORD * get_dialog_record(msi_dialog *dialog)
Definition: dialog.c:3582
static void seltree_update_siblings_and_children_installstate(HWND hwnd, HTREEITEM curr, MSIPACKAGE *package, INSTALLSTATE state)
Definition: dialog.c:2315
static void dialog_vcl_add_columns(msi_dialog *dialog, struct control *control, MSIRECORD *rec)
Definition: dialog.c:3054
static UINT dialog_send_event(msi_dialog *dialog, const WCHAR *event, const WCHAR *arg)
Definition: dialog.c:878
static UINT dialog_combobox_handler(msi_dialog *dialog, struct control *control, WPARAM param)
Definition: dialog.c:1489
static void text_on_settext(HWND hWnd)
Definition: dialog.c:751
static UINT dialog_seltree_handler(msi_dialog *dialog, struct control *control, WPARAM param)
Definition: dialog.c:2507
UINT WINAPI MsiPreviewDialogW(MSIHANDLE hPreview, LPCWSTR szDialogName)
Definition: dialog.c:4199
static void event_subscribe(msi_dialog *dialog, const WCHAR *event, const WCHAR *control, const WCHAR *attribute)
Definition: dialog.c:654
DWORD deformat_string(MSIPACKAGE *package, const WCHAR *fmt, WCHAR **data)
Definition: format.c:1016
void * alloc_msiobject(UINT type, UINT size, msihandledestructor destroy)
Definition: handle.c:201
MSIHANDLE alloc_msihandle(MSIOBJECTHDR *obj)
Definition: handle.c:111
void msiobj_addref(MSIOBJECTHDR *info)
Definition: handle.c:217
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:158
UINT MSI_SetFeatureStateW(MSIPACKAGE *package, LPCWSTR szFeature, INSTALLSTATE iState)
Definition: install.c:915
UINT MSI_SetTargetPathW(MSIPACKAGE *package, LPCWSTR szFolder, LPCWSTR szFolderPath)
Definition: install.c:564
void ACTION_UpdateComponentStates(MSIPACKAGE *package, MSIFEATURE *feature)
Definition: install.c:833
UINT MSI_GetFeatureCost(MSIPACKAGE *package, MSIFEATURE *feature, MSICOSTTREE tree, INSTALLSTATE state, LPINT cost)
Definition: install.c:1155
UINT MSI_SetInstallLevel(MSIPACKAGE *package, int iInstallLevel)
Definition: install.c:1571
const WCHAR * text
Definition: package.c:1794
_ACRTIMP __msvcrt_long __cdecl wcstol(const wchar_t *, wchar_t **, int)
Definition: wcs.c:2752
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2988
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:1977
_ACRTIMP int __cdecl wcsncmp(const wchar_t *, const wchar_t *, size_t)
Definition: wcs.c:523
static wchar_t * wcsdup(const wchar_t *str)
Definition: string.h:94
HRESULT WINAPI OleLoadPicture(LPSTREAM lpstream, LONG lSize, BOOL fRunmode, REFIID riid, LPVOID *ppvObj)
Definition: olepicture.c:2344
LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
Definition: string.c:854
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:94
#define swprintf
Definition: precomp.h:40
#define pt(x, y)
Definition: drawing.c:79
return ret
Definition: mutex.c:146
action
Definition: namespace.c:707
#define L(x)
Definition: resources.c:13
r parent
Definition: btrfs.c:3010
#define INFINITE
Definition: serial.h:102
#define IDS_NEWFOLDER
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define FILE_READ_ONLY_VOLUME
Definition: from_kernel.h:246
BOOLEAN valid
pKey DeleteObject()
size_t total
GLint level
Definition: gl.h:1546
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLuint GLuint end
Definition: gl.h:1545
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLdouble GLdouble t
Definition: gl.h:2047
GLint GLint GLsizei width
Definition: gl.h:1546
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
GLenum func
Definition: glext.h:6028
struct _cl_event * event
Definition: glext.h:7739
GLdouble n
Definition: glext.h:7729
const GLvoid * indirect
Definition: glext.h:7408
GLuint buffer
Definition: glext.h:5915
GLsizeiptr size
Definition: glext.h:5919
GLenum condition
Definition: glext.h:9255
GLuint index
Definition: glext.h:6031
GLenum GLint GLuint mask
Definition: glext.h:6028
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
GLint limit
Definition: glext.h:10326
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLfloat units
Definition: glext.h:11727
GLbitfield flags
Definition: glext.h:7161
GLboolean GLuint group
Definition: glext.h:11120
const GLint * first
Definition: glext.h:5794
GLuint GLfloat * val
Definition: glext.h:7180
GLfloat GLfloat p
Definition: glext.h:8902
const GLuint GLenum const GLvoid * binary
Definition: glext.h:7538
GLuint GLuint num
Definition: glext.h:9618
GLfloat param
Definition: glext.h:5796
GLenum GLsizei len
Definition: glext.h:6722
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
static LPSTR strdupWtoA(LPCWSTR str)
Definition: hhctrl.h:299
#define es
Definition: i386-dis.c:440
#define cs
Definition: i386-dis.c:442
#define FAILED(hr)
Definition: intsafe.h:51
uint32_t entry
Definition: isohybrid.c:63
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_w
Definition: kernel32.h:32
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
#define ZeroMemory
Definition: minwinbase.h:31
LONG_PTR LPARAM
Definition: minwindef.h:175
LONG_PTR LRESULT
Definition: minwindef.h:176
UINT_PTR WPARAM
Definition: minwindef.h:174
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
#define MESSAGE
Definition: options.h:86
static PVOID ptr
Definition: dispmode.c:27
HDC hdc
Definition: main.c:9
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:88
static HICON
Definition: imagelist.c:80
static JOBOBJECTINFOCLASS LPVOID DWORD LPDWORD ret_len
Definition: process.c:81
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
INTERNETFEATURELIST feature
Definition: misc.c:1719
WCHAR strW[12]
Definition: clipboard.c:2216
static HWND child
Definition: cursoricon.c:298
#define ctrl
Definition: input.c:3281
static HWND dialog
Definition: gui.c:33
static const char * control_type(DWORD dwControlType)
Definition: mixer.c:110
WORD unused[29]
Definition: crypt.c:1298
HICON hIcon
Definition: msconfig.c:44
@ INSTALLMESSAGE_ACTIONSTART
Definition: msi.h:102
@ INSTALLMESSAGE_INFO
Definition: msi.h:98
@ INSTALLMESSAGE_SHOWDIALOG
Definition: msi.h:108
@ INSTALLSTATE_UNKNOWN
Definition: msi.h:42
@ INSTALLSTATE_LOCAL
Definition: msi.h:46
@ INSTALLSTATE_ABSENT
Definition: msi.h:45
@ INSTALLSTATE_SOURCE
Definition: msi.h:47
@ INSTALLSTATE_ADVERTISED
Definition: msi.h:44
@ msidbDialogAttributesModal
Definition: msidefs.h:48
@ msidbDialogAttributesVisible
Definition: msidefs.h:47
@ msidbDialogAttributesMinimize
Definition: msidefs.h:49
@ msidbTextStyleStyleBitsBold
Definition: msidefs.h:108
@ msidbTextStyleStyleBitsUnderline
Definition: msidefs.h:110
@ msidbTextStyleStyleBitsItalic
Definition: msidefs.h:109
@ msidbTextStyleStyleBitsStrike
Definition: msidefs.h:111
@ msidbControlAttributesSorted
Definition: msidefs.h:91
@ msidbControlAttributesProgress95
Definition: msidefs.h:81
@ msidbControlAttributesSunken
Definition: msidefs.h:64
@ msidbControlAttributesIndirect
Definition: msidefs.h:65
@ msidbControlAttributesIconSize32
Definition: msidefs.h:100
@ msidbControlAttributesBitmap
Definition: msidefs.h:96
@ msidbControlAttributesIconSize16
Definition: msidefs.h:99
@ msidbControlAttributesComboList
Definition: msidefs.h:92
@ msidbControlAttributesEnabled
Definition: msidefs.h:63
@ msidbControlAttributesIcon
Definition: msidefs.h:97
@ msidbControlAttributesTransparent
Definition: msidefs.h:72
@ msidbControlAttributesFixedSize
Definition: msidefs.h:98
@ msidbControlAttributesVisible
Definition: msidefs.h:62
@ msidbControlAttributesHasBorder
Definition: msidefs.h:103
int MSI_RecordGetInteger(MSIRECORD *, UINT)
Definition: record.c:213
UINT MSI_RecordGetIStream(MSIRECORD *, UINT, IStream **)
Definition: record.c:852
#define MSIHANDLETYPE_DATABASE
Definition: msipriv.h:722
void msi_reset_source_folders(MSIPACKAGE *package)
Definition: package.c:2089
BOOL TABLE_Exists(MSIDATABASE *db, LPCWSTR name)
Definition: table.c:962
UINT MSI_RecordSetInteger(MSIRECORD *, UINT, int)
Definition: record.c:280
#define MSIHANDLETYPE_PREVIEW
Definition: msipriv.h:727
int msi_get_property_int(MSIDATABASE *package, LPCWSTR prop, int def)
Definition: package.c:2305
MSICONDITION MSI_EvaluateConditionW(MSIPACKAGE *, LPCWSTR)
const WCHAR * MSI_RecordGetString(const MSIRECORD *, UINT)
Definition: record.c:433
UINT WINAPIV MSI_OpenQuery(MSIDATABASE *, MSIQUERY **, LPCWSTR,...)
Definition: msiquery.c:138
UINT msi_set_property(MSIDATABASE *, const WCHAR *, const WCHAR *, int)
Definition: package.c:2100
MSIRECORD *WINAPIV MSI_QueryGetRecord(MSIDATABASE *db, LPCWSTR query,...)
Definition: msiquery.c:201
UINT msi_get_property(MSIDATABASE *, LPCWSTR, LPWSTR, LPDWORD)
Definition: package.c:2250
UINT MSI_RecordStreamToFile(MSIRECORD *, UINT, LPCWSTR)
Definition: record.c:900
WCHAR * msi_dup_property(MSIDATABASE *db, const WCHAR *prop)
INT MSI_ProcessMessage(MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *)
Definition: package.c:1909
UINT MSI_RecordSetStringW(MSIRECORD *, UINT, LPCWSTR)
Definition: record.c:597
MSIRECORD * MSI_CreateRecord(UINT)
Definition: record.c:76
UINT MSI_IterateRecords(MSIQUERY *, LPDWORD, record_func, LPVOID)
Definition: msiquery.c:163
@ MSICONDITION_NONE
Definition: msiquery.h:28
@ MSICONDITION_TRUE
Definition: msiquery.h:27
@ MSICOSTTREE_SELFONLY
Definition: msiquery.h:42
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
Definition: muldiv.c:25
Definition: mk_font.cpp:20
unsigned int UINT
Definition: ndis.h:50
#define LPVOID
Definition: nt_native.h:45
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
const GUID IID_IPicture
static HANDLE ACCESS_MASK ULONG attributes
Definition: om.c:94
#define PathAddBackslashW
Definition: pathcch.h:302
#define LOWORD(l)
Definition: pedump.c:82
#define BS_AUTORADIOBUTTON
Definition: pedump.c:660
#define WS_CHILD
Definition: pedump.c:617
#define ES_READONLY
Definition: pedump.c:675
#define LBS_SORT
Definition: pedump.c:679
#define ES_AUTOVSCROLL
Definition: pedump.c:671
#define WS_OVERLAPPED
Definition: pedump.c:615
#define WS_TABSTOP
Definition: pedump.c:634
#define WS_SYSMENU
Definition: pedump.c:629
short WCHAR
Definition: pedump.c:58
#define WS_BORDER
Definition: pedump.c:625
#define WS_GROUP
Definition: pedump.c:633
#define WS_VSCROLL
Definition: pedump.c:627
#define ES_AUTOHSCROLL
Definition: pedump.c:672
#define WS_VISIBLE
Definition: pedump.c:620
long LONG
Definition: pedump.c:60
#define SS_BITMAP
Definition: pedump.c:704
#define BS_GROUPBOX
Definition: pedump.c:658
#define BS_OWNERDRAW
Definition: pedump.c:661
#define BS_CHECKBOX
Definition: pedump.c:653
#define WS_DISABLED
Definition: pedump.c:621
#define SS_LEFT
Definition: pedump.c:692
#define WS_EX_TRANSPARENT
Definition: pedump.c:649
#define WS_HSCROLL
Definition: pedump.c:628
#define LBS_NOTIFY
Definition: pedump.c:678
#define ES_MULTILINE
Definition: pedump.c:667
#define WS_MINIMIZEBOX
Definition: pedump.c:631
#define SS_ICON
Definition: pedump.c:695
static char title[]
Definition: ps.c:92
#define LVM_DELETEALLITEMS
Definition: commctrl.h:2418
#define TVSIL_STATE
Definition: commctrl.h:3449
#define TVN_SELCHANGINGW
Definition: commctrl.h:3651
#define LVSIL_SMALL
Definition: commctrl.h:2304
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
#define WC_BUTTONW
Definition: commctrl.h:4628
#define TVS_LINESATROOT
Definition: commctrl.h:3254
#define TVI_LAST
Definition: commctrl.h:3375
#define LVS_SINGLESEL
Definition: commctrl.h:2271
#define PROGRESS_CLASSW
Definition: commctrl.h:2181
#define LVS_SHAREIMAGELISTS
Definition: commctrl.h:2275
#define TVIF_TEXT
Definition: commctrl.h:3271
#define L_MAX_URL_LENGTH
Definition: commctrl.h:4740
#define TVM_SETITEMW
Definition: commctrl.h:3498
#define LVS_NOCOLUMNHEADER
Definition: commctrl.h:2289
#define WC_LISTVIEWW
Definition: commctrl.h:2262
#define LVS_EX_TWOCLICKACTIVATE
Definition: commctrl.h:2741
#define LVNI_SELECTED
Definition: commctrl.h:2429
#define TVM_GETITEMW
Definition: commctrl.h:3491
#define LVM_EDITLABELW
Definition: commctrl.h:2541
#define TVM_GETITEMRECT
Definition: commctrl.h:3433
#define LVS_SHOWSELALWAYS
Definition: commctrl.h:2272
#define LVS_REPORT
Definition: commctrl.h:2267
#define LVCF_WIDTH
Definition: commctrl.h:2592
#define LVM_SETIMAGELIST
Definition: commctrl.h:2308
_Out_opt_ int * cx
Definition: commctrl.h:585
#define ILC_COLOR32
Definition: commctrl.h:358
struct tagNMTREEVIEWW * LPNMTREEVIEWW
#define LVM_SETITEMW
Definition: commctrl.h:2402
#define LM_SETITEM
Definition: commctrl.h:4778
#define LVM_GETNEXTITEM
Definition: commctrl.h:2438
struct _TREEITEM * HTREEITEM
Definition: commctrl.h:3269
#define WC_LINK
Definition: commctrl.h:4742
#define LVS_SORTASCENDING
Definition: commctrl.h:2273
#define TVS_HASLINES
Definition: commctrl.h:3253
#define LVM_ENSUREVISIBLE
Definition: commctrl.h:2523
#define PBM_SETPOS
Definition: commctrl.h:2189
#define TVE_EXPAND
Definition: commctrl.h:3428
#define PBM_SETRANGE
Definition: commctrl.h:2188
#define TVHT_ONITEMSTATEICON
Definition: commctrl.h:3536
#define PBS_SMOOTH
Definition: commctrl.h:2185
#define LVN_ENDLABELEDITW
Definition: commctrl.h:3143
#define TVGN_DROPHILITE
Definition: commctrl.h:3465
#define TVM_SELECTITEM
Definition: commctrl.h:3483
#define WC_TREEVIEWW
Definition: commctrl.h:3248
#define TVM_INSERTITEMW
Definition: commctrl.h:3413
#define TVIS_STATEIMAGEMASK
Definition: commctrl.h:3293
#define LVM_GETITEMTEXTW
Definition: commctrl.h:2685
#define TVIF_HANDLE
Definition: commctrl.h:3275
#define LVS_EDITLABELS
Definition: commctrl.h:2278
#define LVM_INSERTCOLUMNW
Definition: commctrl.h:2637
#define LVIF_TEXT
Definition: commctrl.h:2314
#define TVGN_CHILD
Definition: commctrl.h:3461
#define LIF_URL
Definition: commctrl.h:4750
#define TVM_SETIMAGELIST
Definition: commctrl.h:3451
#define LIF_STATE
Definition: commctrl.h:4748
#define LVCF_FMT
Definition: commctrl.h:2591
#define ImageList_AddIcon(himl, hicon)
Definition: commctrl.h:415
#define LVCF_SUBITEM
Definition: commctrl.h:2594
#define LVCFMT_LEFT
Definition: commctrl.h:2603
#define TVGN_CARET
Definition: commctrl.h:3466
#define TVS_HASBUTTONS
Definition: commctrl.h:3252
#define TVM_HITTEST
Definition: commctrl.h:3517
#define INDEXTOSTATEIMAGEMASK(i)
Definition: commctrl.h:2333
#define LM_GETITEM
Definition: commctrl.h:4779
#define LIF_ITEMINDEX
Definition: commctrl.h:4747
#define LVIF_IMAGE
Definition: commctrl.h:2315
#define TVIF_PARAM
Definition: commctrl.h:3273
#define LIS_ENABLED
Definition: commctrl.h:4753
#define LVM_INSERTITEMW
Definition: commctrl.h:2409
#define LVCF_TEXT
Definition: commctrl.h:2593
#define TVM_EXPAND
Definition: commctrl.h:3424
#define LVS_AUTOARRANGE
Definition: commctrl.h:2277
#define LVS_LIST
Definition: commctrl.h:2269
#define TVIF_STATE
Definition: commctrl.h:3274
#define LVN_ITEMACTIVATE
Definition: commctrl.h:3152
#define WC_LISTBOXW
Definition: commctrl.h:4716
#define TVGN_NEXT
Definition: commctrl.h:3458
#define WC_COMBOBOXW
Definition: commctrl.h:4722
#define LVM_SETEXTENDEDLISTVIEWSTYLE
Definition: commctrl.h:2729
#define TVM_GETNEXTITEM
Definition: commctrl.h:3454
static unsigned __int64 next
Definition: rand_nt.c:6
#define EM_STREAMIN
Definition: richedit.h:106
#define SF_RTF
Definition: richedit.h:721
#define WM_NOTIFY
Definition: richedit.h:61
#define calloc
Definition: rosglue.h:14
const WCHAR * str
#define offsetof(TYPE, MEMBER)
#define iswspace(_c)
Definition: ctype.h:669
#define iswdigit(_c)
Definition: ctype.h:667
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
__WINE_SERVER_LIST_INLINE void list_move_head(struct list *dst, struct list *src)
Definition: list.h:176
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list)
Definition: list.h:192
#define LoadStringW
Definition: utils.h:64
#define memset(x, y, z)
Definition: compat.h:39
#define towupper(c)
Definition: wctype.h:99
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2778
#define TRACE(s)
Definition: solgame.cpp:4
BYTE lfStrikeOut
Definition: dimm.idl:66
BYTE lfItalic
Definition: dimm.idl:64
LONG lfHeight
Definition: dimm.idl:59
LONG lfWeight
Definition: dimm.idl:63
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
BYTE lfUnderline
Definition: dimm.idl:65
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
_Field_z_ WCHAR cFileName[MAX_PATH]
Definition: minwinbase.h:291
DWORD dwFileAttributes
Definition: minwinbase.h:283
LPCWSTR lpszClassName
Definition: winuser.h:3293
LPCWSTR lpszMenuName
Definition: winuser.h:3292
HBRUSH hbrBackground
Definition: winuser.h:3291
HICON hIcon
Definition: winuser.h:3289
HINSTANCE hInstance
Definition: winuser.h:3288
WNDPROC lpfnWndProc
Definition: winuser.h:3285
HCURSOR hCursor
Definition: winuser.h:3290
Definition: cookie.c:202
UINT(* handler)(msi_dialog *, const WCHAR *)
Definition: dialog.c:4248
const WCHAR * event
Definition: dialog.c:4247
LPCWSTR control_type
Definition: dialog.c:113
Definition: dialog.c:52
LPWSTR type
Definition: dialog.c:63
float progress_current
Definition: dialog.c:65
void(* update)(msi_dialog *, struct control *)
Definition: dialog.c:56
HBITMAP hBitmap
Definition: dialog.c:59
HWND hwnd
Definition: dialog.c:54
HMODULE hDll
Definition: dialog.c:64
BOOL progress_backwards
Definition: dialog.c:67
DWORD attributes
Definition: dialog.c:68
WCHAR name[1]
Definition: dialog.c:69
struct list entry
Definition: dialog.c:53
UINT(* handler)(msi_dialog *, struct control *, WPARAM)
Definition: dialog.c:55
HIMAGELIST hImageList
Definition: dialog.c:61
LPWSTR value
Definition: dialog.c:58
HICON hIcon
Definition: dialog.c:60
LPWSTR tabnext
Definition: dialog.c:62
float progress_max
Definition: dialog.c:66
LPWSTR property
Definition: dialog.c:57
const WCHAR * control
Definition: dialog.c:683
msi_dialog * dialog
Definition: dialog.c:682
Definition: parser.c:44
Definition: fci.c:127
Definition: fci.c:116
COLORREF color
Definition: dialog.c:76
HFONT hfont
Definition: dialog.c:75
Definition: copy.c:22
Definition: list.h:15
struct control * control
Definition: dialog.c:3386
msi_dialog * dialog
Definition: dialog.c:3385
msi_dialog * dialog
Definition: dialog.c:1353
WNDPROC oldproc
Definition: dialog.c:1355
DWORD addpos_items
Definition: dialog.c:1357
LPWSTR * items
Definition: dialog.c:1358
msi_dialog * parent
Definition: dialog.c:83
LPWSTR default_font
Definition: dialog.c:90
HWND hWndFocus
Definition: dialog.c:93
struct list controls
Definition: dialog.c:92
BOOL finished
Definition: dialog.c:85
MSIPACKAGE * package
Definition: dialog.c:82
HWND hwnd
Definition: dialog.c:89
INT retval
Definition: dialog.c:98
DWORD attributes
Definition: dialog.c:87
LPWSTR control_cancel
Definition: dialog.c:95
LPWSTR control_default
Definition: dialog.c:94
UINT(* pending_event)(msi_dialog *, const WCHAR *)
Definition: dialog.c:96
SIZE size
Definition: dialog.c:88
UINT(* event_handler)(msi_dialog *, const WCHAR *, const WCHAR *)
Definition: dialog.c:84
struct list fonts
Definition: dialog.c:91
LPWSTR pending_argument
Definition: dialog.c:97
WCHAR name[1]
Definition: dialog.c:99
LPWSTR * items
Definition: dialog.c:2631
DWORD num_items
Definition: dialog.c:2629
msi_dialog * dialog
Definition: dialog.c:2626
DWORD addpos_items
Definition: dialog.c:2630
WNDPROC oldproc
Definition: dialog.c:2628
WCHAR type
Definition: dialog.c:1664
msi_dialog * dialog
Definition: dialog.c:1670
WNDPROC oldproc
Definition: dialog.c:1671
struct control * control
Definition: dialog.c:2020
msi_dialog * dialog
Definition: dialog.c:2019
WNDPROC oldproc
Definition: dialog.c:2021
msi_dialog * dialog
Definition: dialog.c:1178
struct control * control
Definition: dialog.c:1179
HTREEITEM selected
Definition: dialog.c:546
msi_dialog * dialog
Definition: dialog.c:543
struct font * font
Definition: dialog.c:742
DWORD attributes
Definition: dialog.c:744
WNDPROC oldproc
Definition: dialog.c:743
Definition: name.c:39
msi_dialog * dialog
Definition: dialog.c:119
struct control * parent
Definition: dialog.c:120
struct list entry
Definition: dialog.c:104
WCHAR * event
Definition: dialog.c:106
WCHAR * attribute
Definition: dialog.c:108
WCHAR * control
Definition: dialog.c:107
msi_dialog * dialog
Definition: dialog.c:105
LONG bmHeight
Definition: wingdi.h:1869
LONG bmWidth
Definition: wingdi.h:1868
LPWSTR pszText
Definition: commctrl.h:2572
LPWSTR pszText
Definition: commctrl.h:2370
int iSubItem
Definition: commctrl.h:2367
int cchTextMax
Definition: commctrl.h:2371
UINT mask
Definition: commctrl.h:2365
MSIOBJECTHDR hdr
Definition: msipriv.h:108
struct list subscriptions
Definition: msipriv.h:461
struct list features
Definition: msipriv.h:402
MSIOBJECTHDR hdr
Definition: msipriv.h:393
MSIDATABASE * db
Definition: msipriv.h:394
LPWSTR next_dialog
Definition: msipriv.h:454
msi_dialog * dialog
Definition: msipriv.h:453
MSIOBJECTHDR hdr
Definition: msipriv.h:151
UINT code
Definition: winuser.h:3267
HWND hwndFrom
Definition: winuser.h:3265
TVITEMW itemNew
Definition: commctrl.h:3643
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
LONG right
Definition: windef.h:108
LONG bottom
Definition: windef.h:109
LONG top
Definition: windef.h:107
LONG left
Definition: windef.h:106
HTREEITEM hItem
Definition: commctrl.h:3526
HTREEITEM hParent
Definition: commctrl.h:3398
HTREEITEM hInsertAfter
Definition: commctrl.h:3399
HTREEITEM hItem
Definition: commctrl.h:3322
LPARAM lParam
Definition: commctrl.h:3330
UINT mask
Definition: commctrl.h:3321
LPWSTR pszText
Definition: commctrl.h:3325
UINT state
Definition: commctrl.h:3323
UINT stateMask
Definition: commctrl.h:3324
#define LIST_ENTRY(type)
Definition: queue.h:175
#define GWLP_WNDPROC
Definition: treelist.c:66
#define GWLP_USERDATA
Definition: treelist.c:63
#define DWORD_PTR
Definition: treelist.c:76
HTREEITEM hItem
Definition: treelist.h:37
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
const char * LPCSTR
Definition: typedefs.h:52
const uint16_t * LPCWSTR
Definition: typedefs.h:57
uint32_t DWORD_PTR
Definition: typedefs.h:65
uint16_t * LPWSTR
Definition: typedefs.h:56
int64_t LONGLONG
Definition: typedefs.h:68
char * LPSTR
Definition: typedefs.h:51
int32_t INT
Definition: typedefs.h:58
#define HIWORD(l)
Definition: typedefs.h:247
Definition: pdh_main.c:96
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
int retval
Definition: wcstombs.cpp:91
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1382
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:459
#define WAIT_OBJECT_0
Definition: winbase.h:383
#define DRIVE_FIXED
Definition: winbase.h:277
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
DWORD COLORREF
Definition: windef.h:100
void * arg
Definition: msvc.h:10
#define WINAPI
Definition: msvc.h:6
unsigned long MSIHANDLE
Definition: winemsi.idl:27
int INSTALLSTATE
Definition: winemsi.idl:31
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:1333
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
Definition: text.c:221
HGDIOBJ WINAPI GetStockObject(_In_ int)
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define FW_BOLD
Definition: wingdi.h:378
#define LOGPIXELSY
Definition: wingdi.h:719
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define TRANSPARENT
Definition: wingdi.h:950
BOOL WINAPI StretchBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_opt_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
#define SRCCOPY
Definition: wingdi.h:333
#define NULL_BRUSH
Definition: wingdi.h:901
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1056
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:917
BOOL WINAPI DeleteDC(_In_ HDC)
#define SW_SHOWNORMAL
Definition: winuser.h:781
#define WM_PAINT
Definition: winuser.h:1648
HWND WINAPI GetFocus(void)
Definition: window.c:1863
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define CB_SETITEMDATA
Definition: winuser.h:1995
#define BS_BITMAP
Definition: winuser.h:258
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1800
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:838
#define WM_GETTEXTLENGTH
Definition: winuser.h:1647
#define SW_HIDE
Definition: winuser.h:779
#define WM_CLOSE
Definition: winuser.h:1649
#define SWP_NOACTIVATE
Definition: winuser.h:1253
#define LB_GETITEMDATA
Definition: winuser.h:2070
#define SWP_NOREDRAW
Definition: winuser.h:1257
#define EM_LIMITTEXT
Definition: winuser.h:2029
#define IMAGE_BITMAP
Definition: winuser.h:211
#define GetWindowLongPtrW
Definition: winuser.h:4983
#define SWP_NOREPOSITION
Definition: winuser.h:1261
#define CB_GETLBTEXT
Definition: winuser.h:1981
#define WM_ENABLE
Definition: winuser.h:1643
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define MAKELPARAM(l, h)
Definition: winuser.h:4116
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
HANDLE WINAPI RemovePropW(_In_ HWND, _In_ LPCWSTR)
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define STM_SETICON
Definition: winuser.h:2128
#define LR_LOADFROMFILE
Definition: winuser.h:1103
#define CBS_AUTOHSCROLL
Definition: winuser.h:281
#define CBS_DROPDOWNLIST
Definition: winuser.h:284
BOOL WINAPI IsDialogMessageW(_In_ HWND, _In_ LPMSG)
BOOL WINAPI AdjustWindowRect(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL)
#define IDCANCEL
Definition: winuser.h:842
#define BST_UNCHECKED
Definition: winuser.h:199
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IMAGE_ICON
Definition: winuser.h:212
#define WS_EX_RIGHTSCROLLBAR
Definition: winuser.h:401
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define WM_CREATE
Definition: winuser.h:1636
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define WS_EX_CONTROLPARENT
Definition: winuser.h:387
#define BS_ICON
Definition: winuser.h:264
#define SS_OWNERDRAW
Definition: winuser.h:352
#define SWP_NOMOVE
Definition: winuser.h:1255
#define WM_COMMAND
Definition: winuser.h:1768
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
#define CB_ERR
Definition: winuser.h:2471
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2572
#define IDC_ARROW
Definition: winuser.h:695
#define CB_SETCURSEL
Definition: winuser.h:1990
#define WM_SETFOCUS
Definition: winuser.h:1641
#define QS_ALLINPUT
Definition: winuser.h:914
#define SWP_NOSIZE
Definition: winuser.h:1256
#define SS_ETCHEDHORZ
Definition: winuser.h:343
#define WA_INACTIVE
Definition: winuser.h:2664
#define WM_LBUTTONDOWN
Definition: winuser.h:1804
#define LB_ADDSTRING
Definition: winuser.h:2060
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2474
#define SS_CENTERIMAGE
Definition: winuser.h:339
HWND WINAPI GetNextDlgTabItem(_In_ HWND, _In_opt_ HWND, _In_ BOOL)
BOOL WINAPI EnumChildWindows(_In_opt_ HWND, _In_ WNDENUMPROC, _In_ LPARAM)
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
#define STM_SETIMAGE
Definition: winuser.h:2129
#define TPM_TOPALIGN
Definition: winuser.h:2419
#define IDOK
Definition: winuser.h:841
#define CBN_SELCHANGE
Definition: winuser.h:2008
#define IDI_APPLICATION
Definition: winuser.h:712
#define BM_SETCHECK
Definition: winuser.h:1950
#define BS_MULTILINE
Definition: winuser.h:267
#define WM_ACTIVATE
Definition: winuser.h:1640
#define BM_SETIMAGE
Definition: winuser.h:1951
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
#define WM_SETTEXT
Definition: winuser.h:1645
DWORD WINAPI MsgWaitForMultipleObjectsEx(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask, _In_ DWORD dwFlags)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define HWND_TOP
Definition: winuser.h:1218
HWND WINAPI SetFocus(_In_opt_ HWND)
#define MF_ENABLED
Definition: winuser.h:128
#define EM_SETLIMITTEXT
Definition: winuser.h:2040
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define WM_SETFONT
Definition: winuser.h:1678
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define TPM_LEFTALIGN
Definition: winuser.h:2413
#define DLGC_WANTARROWS
Definition: winuser.h:2652
#define PM_REMOVE
Definition: winuser.h:1207
#define CB_ADDSTRING
Definition: winuser.h:1965
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
struct tagNMHDR * LPNMHDR
#define CB_GETITEMDATA
Definition: winuser.h:1979
#define WM_NULL
Definition: winuser.h:1635
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HDC WINAPI GetDC(_In_opt_ HWND)
#define EM_SETSEL
Definition: winuser.h:2047
#define CBS_DROPDOWN
Definition: winuser.h:283
#define CBS_HASSTRINGS
Definition: winuser.h:285
#define IDABORT
Definition: winuser.h:843
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4470
#define CBS_SORT
Definition: winuser.h:292
BOOL WINAPI AppendMenuA(_In_ HMENU, _In_ UINT, _In_ UINT_PTR, _In_opt_ LPCSTR)
#define WS_EX_LTRREADING
Definition: winuser.h:393
#define CW_USEDEFAULT
Definition: winuser.h:225
HWND WINAPI GetParent(_In_ HWND)
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
#define LB_SETITEMDATA
Definition: winuser.h:2101
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define WM_MOVE
Definition: winuser.h:1638
#define LBN_SELCHANGE
Definition: winuser.h:2111
#define WM_NCDESTROY
Definition: winuser.h:1712
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
#define SWP_NOOWNERZORDER
Definition: winuser.h:1260
#define BN_CLICKED
Definition: winuser.h:1954
#define SW_SHOW
Definition: winuser.h:786
BOOL WINAPI TrackPopupMenu(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _Reserved_ int, _In_ HWND, _Reserved_ LPCRECT)
#define WM_DESTROY
Definition: winuser.h:1637
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)
#define LR_DEFAULTSIZE
Definition: winuser.h:1105
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define CB_INSERTSTRING
Definition: winuser.h:1986
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:3014
HBITMAP WINAPI LoadBitmapW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2532
#define TPM_RETURNCMD
Definition: winuser.h:2423
#define SWP_NOZORDER
Definition: winuser.h:1258
#define IDRETRY
Definition: winuser.h:844
#define LB_GETCURSEL
Definition: winuser.h:2068
#define CB_GETCURSEL
Definition: winuser.h:1972
#define SetWindowLongPtrW
Definition: winuser.h:5512
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define GWL_STYLE
Definition: winuser.h:863
#define SWP_NOSENDCHANGING
Definition: winuser.h:1262
BOOL WINAPI DestroyWindow(_In_ HWND)
#define WM_KILLFOCUS
Definition: winuser.h:1642
#define WS_EX_LEFT
Definition: winuser.h:391
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2444
#define SS_SUNKEN
Definition: winuser.h:358
#define WM_GETDLGCODE
Definition: winuser.h:1717
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define BST_CHECKED
Definition: winuser.h:197
#define CBN_EDITCHANGE
Definition: winuser.h:2004
#define GWL_EXSTYLE
Definition: winuser.h:862
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2422
#define EN_CHANGE
Definition: winuser.h:2051
#define COLOR_3DFACE
Definition: winuser.h:940
unsigned char BYTE
Definition: xxhash.c:193