ReactOS 0.4.17-dev-970-gcf0f1a6
package.c
Go to the documentation of this file.
1/*
2 * Implementation of the Microsoft Installer (msi.dll)
3 *
4 * Copyright 2004 Aric Stewart for CodeWeavers
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21#define COBJMACROS
22
23#ifdef __REACTOS__
24#define WIN32_NO_STATUS
25#endif
26
27#include <stdarg.h>
28#include "windef.h"
29#include "winbase.h"
30#include "winreg.h"
31#include "winnls.h"
32#ifdef __REACTOS__
33#include <ndk/rtlfuncs.h>
34#else
35#include "winternl.h"
36#endif
37#include "shlwapi.h"
38#include "wingdi.h"
39#include "msi.h"
40#include "msiquery.h"
41#include "objidl.h"
42#include "wincrypt.h"
43#include "winuser.h"
44#include "wininet.h"
45#include "winver.h"
46#include "urlmon.h"
47#include "shlobj.h"
48#include "objbase.h"
49#include "msidefs.h"
50#include "sddl.h"
51
52#include "wine/debug.h"
53#include "wine/exception.h"
54
55#include "msipriv.h"
56#include "winemsi.h"
57#include "resource.h"
58
60
62{
63 struct list *item, *cursor;
64
66 {
68 list_remove( &fl->entry );
69 free( fl );
70 }
71
72 LIST_FOR_EACH_SAFE( item, cursor, &feature->Components )
73 {
75 list_remove( &cl->entry );
76 free( cl );
77 }
78 free( feature->Feature );
79 free( feature->Feature_Parent );
80 free( feature->Directory );
81 free( feature->Description );
82 free( feature->Title );
83 free( feature );
84}
85
87{
88 struct list *item, *cursor;
89
90 LIST_FOR_EACH_SAFE( item, cursor, &folder->children )
91 {
93 list_remove( &fl->entry );
94 free( fl );
95 }
96 free( folder->Parent );
97 free( folder->Directory );
98 free( folder->TargetDefault );
99 free( folder->SourceLongPath );
100 free( folder->SourceShortPath );
101 free( folder->ResolvedTarget );
102 free( folder->ResolvedSource );
103 free( folder );
104}
105
107{
108 struct list *item, *cursor;
109
110 LIST_FOR_EACH_SAFE( item, cursor, &ext->verbs )
111 {
112 MSIVERB *verb = LIST_ENTRY( item, MSIVERB, entry );
113
114 list_remove( &verb->entry );
115 free( verb->Verb );
116 free( verb->Command );
117 free( verb->Argument );
118 free( verb );
119 }
120
121 free( ext->Extension );
122 free( ext->ProgIDText );
123 free( ext );
124}
125
127{
128 free( assembly->feature );
130 free( assembly->application );
131 free( assembly->display_name );
132 if (assembly->tempdir) RemoveDirectoryW( assembly->tempdir );
133 free( assembly->tempdir );
134 free( assembly );
135}
136
138{
139 UINT i;
140 for (i = 0; i < package->script_actions_count[script]; i++)
141 free( package->script_actions[script][i] );
142
143 free( package->script_actions[script] );
144 package->script_actions[script] = NULL;
145 package->script_actions_count[script] = 0;
146}
147
148static void free_package_structures( MSIPACKAGE *package )
149{
150 struct list *item, *cursor;
151 int i;
152
154 {
156 list_remove( &feature->entry );
158 }
159
161 {
165 }
166
167 LIST_FOR_EACH_SAFE( item, cursor, &package->files )
168 {
170
172 free( file->File );
173 free( file->FileName );
174 free( file->ShortName );
175 free( file->LongName );
176 free( file->Version );
177 free( file->Language );
178 if (msi_is_global_assembly( file->Component )) DeleteFileW( file->TargetPath );
179 free( file->TargetPath );
180 free( file );
181 }
182
184 {
186
187 list_remove( &comp->entry );
188 free( comp->Component );
189 free( comp->ComponentId );
190 free( comp->Directory );
191 free( comp->Condition );
192 free( comp->KeyPath );
193 free( comp->FullKeypath );
194 if (comp->assembly) free_assembly( comp->assembly );
195 free( comp );
196 }
197
199 {
201
202 list_remove( &patch->entry );
203 free( patch->path );
204 free( patch );
205 }
206
207 /* clean up extension, progid, class and verb structures */
209 {
211
212 list_remove( &cls->entry );
213 free( cls->clsid );
214 free( cls->Context );
215 free( cls->Description );
216 free( cls->FileTypeMask );
217 free( cls->IconPath );
218 free( cls->DefInprocHandler );
219 free( cls->DefInprocHandler32 );
220 free( cls->Argument );
221 free( cls->ProgIDText );
222 free( cls );
223 }
224
226 {
228
229 list_remove( &ext->entry );
231 }
232
234 {
236
238 free( progid->ProgID );
239 free( progid->Description );
240 free( progid->IconPath );
241 free( progid );
242 }
243
244 LIST_FOR_EACH_SAFE( item, cursor, &package->mimes )
245 {
247
248 list_remove( &mt->entry );
249 free( mt->suffix );
250 free( mt->clsid );
251 free( mt->ContentType );
252 free( mt );
253 }
254
255 LIST_FOR_EACH_SAFE( item, cursor, &package->appids )
256 {
258
259 list_remove( &appid->entry );
260 free( appid->AppID );
261 free( appid->RemoteServerName );
262 free( appid->LocalServer );
263 free( appid->ServiceParameters );
264 free( appid->DllSurrogate );
265 free( appid );
266 }
267
269 {
271
272 list_remove( &info->entry );
273 free( info->value );
274 free( info );
275 }
276
278 {
280
281 list_remove( &info->entry );
282 free( info->volume_label );
283 free( info->disk_prompt );
284 free( info );
285 }
286
287 for (i = 0; i < SCRIPT_MAX; i++)
288 msi_free_action_script( package, i );
289
290 for (i = 0; i < package->unique_actions_count; i++)
291 free( package->unique_actions[i] );
292 free( package->unique_actions );
293
295 {
297
298 list_remove( &binary->entry );
299 if (!DeleteFileW( binary->tmpfile ))
300 ERR( "failed to delete %s (%lu)\n", debugstr_w(binary->tmpfile), GetLastError() );
301 free( binary->source );
302 free( binary->tmpfile );
303 free( binary );
304 }
305
307 {
309
310 list_remove( &cab->entry );
311 IStorage_Release( cab->storage );
312 free( cab->stream );
313 free( cab );
314 }
315
317 {
319
320 list_remove( &patch->entry );
321 if (patch->delete_on_close && !DeleteFileW( patch->localfile ))
322 {
323 ERR( "failed to delete %s (%lu)\n", debugstr_w(patch->localfile), GetLastError() );
324 }
325 msi_free_patchinfo( patch );
326 }
327
328 free( package->PackagePath );
329 free( package->ProductCode );
330 free( package->ActionFormat );
331 free( package->LastAction );
332 free( package->LastActionTemplate );
333 free( package->langids );
334
335 /* cleanup control event subscriptions */
337}
338
340{
341 MSIPACKAGE *package = (MSIPACKAGE *)arg;
342
344
345 if( package->dialog )
346 msi_dialog_destroy( package->dialog );
347
348 msiobj_release( &package->db->hdr );
350 CloseHandle( package->log_file );
351 if (package->rpc_server_started)
352 RpcServerUnregisterIf(s_IWineMsiRemote_v0_0_s_ifspec, NULL, FALSE);
353 if (rpc_handle)
354 RpcBindingFree(&rpc_handle);
355 if (package->custom_server_32_process)
356 custom_stop_server(package->custom_server_32_process, package->custom_server_32_pipe);
357 if (package->custom_server_64_process)
358 custom_stop_server(package->custom_server_64_process, package->custom_server_64_pipe);
359
360 if (package->delete_on_close) DeleteFileW( package->localfile );
361 free( package->localfile );
363}
364
366{
367 MSIQUERY *view;
368 UINT rc;
369
370 rc = MSI_DatabaseOpenViewW(package->db, L"CREATE TABLE `_Property` ( `_Property` CHAR(56) NOT NULL TEMPORARY, "
371 L"`Value` CHAR(98) NOT NULL TEMPORARY PRIMARY KEY `_Property`) HOLD", &view);
372 if (rc != ERROR_SUCCESS)
373 return rc;
374
375 rc = MSI_ViewExecute(view, 0);
377 msiobj_release(&view->hdr);
378 return rc;
379}
380
382{
383 MSIQUERY *view_select;
384 UINT rc;
385
386 rc = MSI_DatabaseOpenViewW( db, L"SELECT * FROM `Property`", &view_select );
387 if (rc != ERROR_SUCCESS)
388 return rc;
389
390 rc = MSI_ViewExecute( view_select, 0 );
391 if (rc != ERROR_SUCCESS)
392 {
393 MSI_ViewClose( view_select );
394 msiobj_release( &view_select->hdr );
395 return rc;
396 }
397
398 while (1)
399 {
400 MSIQUERY *view_insert, *view_update;
401 MSIRECORD *rec_select;
402
403 rc = MSI_ViewFetch( view_select, &rec_select );
404 if (rc != ERROR_SUCCESS)
405 break;
406
407 rc = MSI_DatabaseOpenViewW( db, L"INSERT INTO `_Property` (`_Property`,`Value`) VALUES (?,?)", &view_insert );
408 if (rc != ERROR_SUCCESS)
409 {
410 msiobj_release( &rec_select->hdr );
411 continue;
412 }
413
414 rc = MSI_ViewExecute( view_insert, rec_select );
415 MSI_ViewClose( view_insert );
416 msiobj_release( &view_insert->hdr );
417 if (rc != ERROR_SUCCESS)
418 {
419 MSIRECORD *rec_update;
420
421 TRACE("insert failed, trying update\n");
422
423 rc = MSI_DatabaseOpenViewW( db, L"UPDATE `_Property` SET `Value` = ? WHERE `_Property` = ?", &view_update );
424 if (rc != ERROR_SUCCESS)
425 {
426 WARN("open view failed %u\n", rc);
427 msiobj_release( &rec_select->hdr );
428 continue;
429 }
430
431 rec_update = MSI_CreateRecord( 2 );
432 MSI_RecordCopyField( rec_select, 1, rec_update, 2 );
433 MSI_RecordCopyField( rec_select, 2, rec_update, 1 );
434 rc = MSI_ViewExecute( view_update, rec_update );
435 if (rc != ERROR_SUCCESS)
436 WARN("update failed %u\n", rc);
437
438 MSI_ViewClose( view_update );
439 msiobj_release( &view_update->hdr );
440 msiobj_release( &rec_update->hdr );
441 }
442
443 msiobj_release( &rec_select->hdr );
444 }
445
446 MSI_ViewClose( view_select );
447 msiobj_release( &view_select->hdr );
448 return rc;
449}
450
451/*
452 * set_installed_prop
453 *
454 * Sets the "Installed" property to indicate that
455 * the product is installed for the current user.
456 */
458{
459 HKEY hkey;
460 UINT r;
461
462 if (!package->ProductCode) return ERROR_FUNCTION_FAILED;
463
464 r = MSIREG_OpenUninstallKey( package->ProductCode, package->platform, &hkey, FALSE );
465 if (r == ERROR_SUCCESS)
466 {
467 RegCloseKey( hkey );
468 msi_set_property( package->db, L"Installed", L"1", -1 );
469 }
470 return r;
471}
472
474{
475 SID_NAME_USE use;
477 LPWSTR sid_str = NULL, dom = NULL;
478 DWORD size, dom_size;
479 PSID psid = NULL;
481
482 size = 0;
484
485 user_name = malloc( (size + 1) * sizeof(WCHAR) );
486 if (!user_name)
487 return ERROR_OUTOFMEMORY;
488
489 if (!GetUserNameW( user_name, &size ))
490 goto done;
491
492 size = 0;
493 dom_size = 0;
494 LookupAccountNameW( NULL, user_name, NULL, &size, NULL, &dom_size, &use );
495
496 psid = malloc( size );
497 dom = malloc( dom_size * sizeof (WCHAR) );
498 if (!psid || !dom)
499 {
501 goto done;
502 }
503
504 if (!LookupAccountNameW( NULL, user_name, psid, &size, dom, &dom_size, &use ))
505 goto done;
506
507 if (!ConvertSidToStringSidW( psid, &sid_str ))
508 goto done;
509
510 r = msi_set_property( package->db, L"UserSID", sid_str, -1 );
511
512done:
513 LocalFree( sid_str );
514 free( dom );
515 free( psid );
516 free( user_name );
517
518 return r;
519}
520
522{
523 HKEY netsetup, hkey;
524 LONG res;
525 DWORD size, len, type;
526 WCHAR windir[MAX_PATH], path[MAX_PATH], *filename = NULL;
527
528 res = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\NET Framework Setup\\NDP", 0, KEY_CREATE_SUB_KEY,
529 &netsetup);
530 if (res != ERROR_SUCCESS)
531 return NULL;
532
533 if (!RegCreateKeyExW(netsetup, L"v4\\Client", 0, NULL, 0, KEY_QUERY_VALUE, NULL, &hkey, NULL))
534 {
535 size = sizeof(path);
536 if (!RegQueryValueExW(hkey, L"InstallPath", NULL, &type, (BYTE *)path, &size))
537 {
538 len = lstrlenW(path) + lstrlenW(L"fusion.dll") + 2;
539 if (!(filename = malloc(len * sizeof(WCHAR)))) return NULL;
540
542 lstrcatW(filename, L"\\");
543 lstrcatW(filename, L"fusion.dll");
545 {
546 TRACE( "found %s\n", debugstr_w(filename) );
547 RegCloseKey(hkey);
548 RegCloseKey(netsetup);
549 return filename;
550 }
551 }
552 RegCloseKey(hkey);
553 }
554
555 if (!RegCreateKeyExW(netsetup, L"v2.0.50727", 0, NULL, 0, KEY_QUERY_VALUE, NULL, &hkey, NULL))
556 {
557 RegCloseKey(hkey);
559 len = lstrlenW(windir) + lstrlenW(L"Microsoft.NET\\Framework\\") + lstrlenW(L"v2.0.50727") +
560 lstrlenW(L"fusion.dll") + 3;
561 free(filename);
562 if (!(filename = malloc(len * sizeof(WCHAR)))) return NULL;
563
564 lstrcpyW(filename, windir);
565 lstrcatW(filename, L"\\");
566 lstrcatW(filename, L"Microsoft.NET\\Framework\\");
567 lstrcatW(filename, L"v2.0.50727");
568 lstrcatW(filename, L"\\");
569 lstrcatW(filename, L"fusion.dll");
571 {
572 TRACE( "found %s\n", debugstr_w(filename) );
573 RegCloseKey(netsetup);
574 return filename;
575 }
576 }
577
578 RegCloseKey(netsetup);
579 return filename;
580}
581
583{
586};
587
589{
590 UINT val_len;
594 LPWSTR fusion, verstr;
595 struct lang_codepage *translate;
596
597 fusion = get_fusion_filename(package);
598 if (!fusion)
599 return;
600
602 if (!size)
603 goto done;
604
606 if (!version)
607 goto done;
608
609 if (!GetFileVersionInfoW(fusion, handle, size, version))
610 goto done;
611
612 if (!VerQueryValueW(version, L"\\VarFileInfo\\Translation", (LPVOID *)&translate, &val_len))
613 goto done;
614
615 swprintf(buf, ARRAY_SIZE(buf), L"\\StringFileInfo\\%04x%04x\\ProductVersion", translate[0].wLanguage,
617
618 if (!VerQueryValueW(version, buf, (LPVOID *)&verstr, &val_len))
619 goto done;
620
621 if (!val_len || !verstr)
622 goto done;
623
624 msi_set_property( package->db, L"MsiNetAssemblySupport", verstr, -1 );
625
626done:
627 free(fusion);
628 free(version);
629}
630
632{
633 WCHAR *ptr;
634 RTL_OSVERSIONINFOEXW OSVersion;
635 MEMORYSTATUSEX msex;
636 DWORD verval, len, type;
637 WCHAR pth[MAX_PATH], verstr[11], bufstr[22];
638 HDC dc;
639 HKEY hkey;
640 LPWSTR username, companyname;
641 SYSTEM_INFO sys_info;
643
644 /*
645 * Other things that probably should be set:
646 *
647 * VirtualMemory ShellAdvSupport DefaultUIFont PackagecodeChanging
648 * CaptionHeight BorderTop BorderSide TextHeight RedirectedDllSupport
649 */
650
652 lstrcatW(pth, L"\\");
653 msi_set_property( package->db, L"CommonAppDataFolder", pth, -1 );
654
656 lstrcatW(pth, L"\\");
657 msi_set_property( package->db, L"FavoritesFolder", pth, -1 );
658
660 lstrcatW(pth, L"\\");
661 msi_set_property( package->db, L"FontsFolder", pth, -1 );
662
664 lstrcatW(pth, L"\\");
665 msi_set_property( package->db, L"SendToFolder", pth, -1 );
666
668 lstrcatW(pth, L"\\");
669 msi_set_property( package->db, L"StartMenuFolder", pth, -1 );
670
672 lstrcatW(pth, L"\\");
673 msi_set_property( package->db, L"StartupFolder", pth, -1 );
674
676 lstrcatW(pth, L"\\");
677 msi_set_property( package->db, L"TemplateFolder", pth, -1 );
678
680 lstrcatW(pth, L"\\");
681 msi_set_property( package->db, L"DesktopFolder", pth, -1 );
682
683 /* FIXME: set to AllUsers profile path if ALLUSERS is set */
685 lstrcatW(pth, L"\\");
686 msi_set_property( package->db, L"ProgramMenuFolder", pth, -1 );
687
689 lstrcatW(pth, L"\\");
690 msi_set_property( package->db, L"AdminToolsFolder", pth, -1 );
691
693 lstrcatW(pth, L"\\");
694 msi_set_property( package->db, L"AppDataFolder", pth, -1 );
695
697 lstrcatW(pth, L"\\");
698 msi_set_property( package->db, L"SystemFolder", pth, -1 );
699 msi_set_property( package->db, L"System16Folder", pth, -1 );
700
702 lstrcatW(pth, L"\\");
703 msi_set_property( package->db, L"LocalAppDataFolder", pth, -1 );
704
706 lstrcatW(pth, L"\\");
707 msi_set_property( package->db, L"MyPicturesFolder", pth, -1 );
708
710 lstrcatW(pth, L"\\");
711 msi_set_property( package->db, L"PersonalFolder", pth, -1 );
712
714 lstrcatW(pth, L"\\");
715 msi_set_property( package->db, L"WindowsFolder", pth, -1 );
716
718 lstrcatW(pth, L"\\");
719 msi_set_property( package->db, L"PrintHoodFolder", pth, -1 );
720
722 lstrcatW(pth, L"\\");
723 msi_set_property( package->db, L"NetHoodFolder", pth, -1 );
724
726 lstrcatW(pth, L"\\");
727 msi_set_property( package->db, L"RecentFolder", pth, -1 );
728
729 /* Physical Memory is specified in MB. Using total amount. */
730 msex.dwLength = sizeof(msex);
731 GlobalMemoryStatusEx( &msex );
732 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", (int)(msex.ullTotalPhys / 1024 / 1024) );
733 msi_set_property( package->db, L"PhysicalMemory", bufstr, len );
734
736 ptr = wcschr(pth,'\\');
737 if (ptr) *(ptr + 1) = 0;
738 msi_set_property( package->db, L"WindowsVolume", pth, -1 );
739
740 len = GetTempPathW(MAX_PATH, pth);
741 msi_set_property( package->db, L"TempFolder", pth, len );
742
743 /* in a wine environment the user is always admin and privileged */
744 msi_set_property( package->db, L"AdminUser", L"1", -1 );
745 msi_set_property( package->db, L"Privileged", L"1", -1 );
746 msi_set_property( package->db, L"MsiRunningElevated", L"1", -1 );
747 msi_set_property( package->db, L"MsiTrueAdminUser", L"1", -1 );
748
749 /* set the os things */
750 OSVersion.dwOSVersionInfoSize = sizeof(OSVersion);
751 RtlGetVersion(&OSVersion);
752 verval = OSVersion.dwMinorVersion + OSVersion.dwMajorVersion * 100;
753 if (verval > 603)
754 {
755 verval = 603;
756 OSVersion.dwBuildNumber = 9600;
757 }
758 len = swprintf( verstr, ARRAY_SIZE(verstr), L"%u", verval );
759 switch (OSVersion.dwPlatformId)
760 {
762 msi_set_property( package->db, L"Version9X", verstr, len );
763 break;
765 msi_set_property( package->db, L"VersionNT", verstr, len );
766 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%u", OSVersion.wProductType );
767 msi_set_property( package->db, L"MsiNTProductType", bufstr, len );
768 break;
769 }
770 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%u", OSVersion.dwBuildNumber );
771 msi_set_property( package->db, L"WindowsBuild", bufstr, len );
772 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%u", OSVersion.wServicePackMajor );
773 msi_set_property( package->db, L"ServicePackLevel", bufstr, len );
774
775 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%u.%u", MSI_MAJORVERSION, MSI_MINORVERSION );
776 msi_set_property( package->db, L"VersionMsi", bufstr, len );
777 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%u", MSI_MAJORVERSION * 100 );
778 msi_set_property( package->db, L"VersionDatabase", bufstr, len );
779
780 RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion", 0,
782
783 GetNativeSystemInfo( &sys_info );
784 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", sys_info.wProcessorLevel );
785 msi_set_property( package->db, L"Intel", bufstr, len );
787 {
789 PathAddBackslashW( pth );
790 msi_set_property( package->db, L"SystemFolder", pth, -1 );
791
792 len = sizeof(pth);
793 RegQueryValueExW(hkey, L"ProgramFilesDir", 0, &type, (BYTE *)pth, &len);
794 PathAddBackslashW( pth );
795 msi_set_property( package->db, L"ProgramFilesFolder", pth, -1 );
796
797 len = sizeof(pth);
798 RegQueryValueExW(hkey, L"CommonFilesDir", 0, &type, (BYTE *)pth, &len);
799 PathAddBackslashW( pth );
800 msi_set_property( package->db, L"CommonFilesFolder", pth, -1 );
801 }
804 {
805 msi_set_property( package->db, L"MsiAMD64", bufstr, -1 );
806 msi_set_property( package->db, L"Msix64", bufstr, -1 );
807 msi_set_property( package->db, L"VersionNT64", verstr, -1 );
808
810 PathAddBackslashW( pth );
811 msi_set_property( package->db, L"System64Folder", pth, -1 );
812
814 PathAddBackslashW( pth );
815 msi_set_property( package->db, L"SystemFolder", pth, -1 );
816
817 len = sizeof(pth);
818 RegQueryValueExW(hkey, L"ProgramFilesDir", 0, &type, (BYTE *)pth, &len);
819 PathAddBackslashW( pth );
820 msi_set_property( package->db, L"ProgramFiles64Folder", pth, -1 );
821
822 len = sizeof(pth);
823 RegQueryValueExW(hkey, L"ProgramFilesDir (x86)", 0, &type, (BYTE *)pth, &len);
824 PathAddBackslashW( pth );
825 msi_set_property( package->db, L"ProgramFilesFolder", pth, -1 );
826
827 len = sizeof(pth);
828 RegQueryValueExW(hkey, L"CommonFilesDir", 0, &type, (BYTE *)pth, &len);
829 PathAddBackslashW( pth );
830 msi_set_property( package->db, L"CommonFiles64Folder", pth, -1 );
831
832 len = sizeof(pth);
833 RegQueryValueExW(hkey, L"CommonFilesDir (x86)", 0, &type, (BYTE *)pth, &len);
834 PathAddBackslashW( pth );
835 msi_set_property( package->db, L"CommonFilesFolder", pth, -1 );
836 }
837
838 RegCloseKey(hkey);
839
840 /* Screen properties. */
841 dc = GetDC(0);
842 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", GetDeviceCaps(dc, HORZRES) );
843 msi_set_property( package->db, L"ScreenX", bufstr, len );
844 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", GetDeviceCaps(dc, VERTRES) );
845 msi_set_property( package->db, L"ScreenY", bufstr, len );
846 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", GetDeviceCaps(dc, BITSPIXEL) );
847 msi_set_property( package->db, L"ColorBits", bufstr, len );
848 ReleaseDC(0, dc);
849
850 /* USERNAME and COMPANYNAME */
851 username = msi_dup_property( package->db, L"USERNAME" );
852 companyname = msi_dup_property( package->db, L"COMPANYNAME" );
853
854 if ((!username || !companyname) &&
855 RegOpenKeyW( HKEY_CURRENT_USER, L"SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey ) == ERROR_SUCCESS)
856 {
857 if (!username &&
858 (username = msi_reg_get_val_str( hkey, L"DefName" )))
859 msi_set_property( package->db, L"USERNAME", username, -1 );
860 if (!companyname &&
861 (companyname = msi_reg_get_val_str( hkey, L"DefCompany" )))
862 msi_set_property( package->db, L"COMPANYNAME", companyname, -1 );
863 CloseHandle( hkey );
864 }
865 if ((!username || !companyname) &&
866 RegOpenKeyExW( HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0,
868 {
869 if (!username &&
870 (username = msi_reg_get_val_str( hkey, L"RegisteredOwner" )))
871 msi_set_property( package->db, L"USERNAME", username, -1 );
872 if (!companyname &&
873 (companyname = msi_reg_get_val_str( hkey, L"RegisteredOrganization" )))
874 msi_set_property( package->db, L"COMPANYNAME", companyname, -1 );
875 CloseHandle( hkey );
876 }
877 free( username );
878 free( companyname );
879
880 if ( set_user_sid_prop( package ) != ERROR_SUCCESS)
881 ERR("Failed to set the UserSID property\n");
882
883 set_msi_assembly_prop( package );
884
886 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", langid );
887 msi_set_property( package->db, L"UserLanguageID", bufstr, len );
888
890 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", langid );
891 msi_set_property( package->db, L"SystemLanguageID", bufstr, len );
892
893 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", MsiQueryProductStateW(package->ProductCode) );
894 msi_set_property( package->db, L"ProductState", bufstr, len );
895
896 len = 0;
898 {
900 if ((username = malloc( len * sizeof(WCHAR) )))
901 {
902 if (GetUserNameW( username, &len ))
903 msi_set_property( package->db, L"LogonUser", username, len - 1 );
904 free( username );
905 }
906 }
907 len = 0;
909 {
910 WCHAR *computername;
911 if ((computername = malloc( len * sizeof(WCHAR) )))
912 {
913 if (GetComputerNameW( computername, &len ))
914 msi_set_property( package->db, L"ComputerName", computername, len );
915 free( computername );
916 }
917 }
918}
919
921{
922 MSIPACKAGE *package;
923
924 package = alloc_msiobject( MSIHANDLETYPE_PACKAGE, sizeof (MSIPACKAGE),
925 MSI_FreePackage );
926 if( package )
927 {
928 list_init( &package->components );
929 list_init( &package->features );
930 list_init( &package->files );
931 list_init( &package->filepatches );
932 list_init( &package->tempfiles );
933 list_init( &package->folders );
934 list_init( &package->subscriptions );
935 list_init( &package->appids );
936 list_init( &package->classes );
937 list_init( &package->mimes );
938 list_init( &package->extensions );
939 list_init( &package->progids );
940 list_init( &package->RunningActions );
941 list_init( &package->sourcelist_info );
942 list_init( &package->sourcelist_media );
943 list_init( &package->patches );
944 list_init( &package->binaries );
945 list_init( &package->cabinet_streams );
946 list_init( &package->drlocators );
947 }
948
949 return package;
950}
951
953{
954 BYTE *data;
955 UINT r, sz;
956
957 r = read_stream_data(package->db->storage, L"AdminProperties", FALSE, &data, &sz);
958 if (r != ERROR_SUCCESS)
959 return r;
960
961 r = msi_parse_command_line(package, (WCHAR *)data, TRUE);
962
963 free(data);
964 return r;
965}
966
968{
969 /* FIXME: this should depend on the user's privileges */
970 if (msi_get_property_int( package->db, L"ALLUSERS", 0 ) == 2)
971 {
972 TRACE("resetting ALLUSERS property from 2 to 1\n");
973 msi_set_property( package->db, L"ALLUSERS", L"1", -1 );
974 }
975 msi_set_property( package->db, L"AdminUser", L"1", -1 );
976 msi_set_property( package->db, L"Privileged", L"1", -1 );
977 msi_set_property( package->db, L"MsiRunningElevated", L"1", -1 );
978 msi_set_property( package->db, L"MsiTrueAdminUser", L"1", -1 );
979}
980
982{
983 MSIPACKAGE *package;
984 WCHAR uilevel[11];
985 int len;
986 UINT r;
987
988 TRACE("%p\n", db);
989
990 package = alloc_package();
991 if (package)
992 {
993 msiobj_addref( &db->hdr );
994 package->db = db;
995
996 package->LastAction = NULL;
997 package->LastActionTemplate = NULL;
999 package->WordCount = 0;
1000 package->PackagePath = wcsdup( db->path );
1001
1002 create_temp_property_table( package );
1003 msi_clone_properties( package->db );
1005
1006 package->ProductCode = msi_dup_property( package->db, L"ProductCode" );
1007
1008 set_installer_properties( package );
1009
1010 package->ui_level = gUILevel;
1011 len = swprintf( uilevel, ARRAY_SIZE(uilevel), L"%u", gUILevel & INSTALLUILEVEL_MASK );
1012 msi_set_property( package->db, L"UILevel", uilevel, len );
1013
1014 r = msi_load_suminfo_properties( package );
1015 if (r != ERROR_SUCCESS)
1016 {
1017 msiobj_release( &package->hdr );
1018 return NULL;
1019 }
1020
1022 load_admin_properties( package );
1023
1024 package->log_file = INVALID_HANDLE_VALUE;
1025 package->script = SCRIPT_NONE;
1026 }
1027 return package;
1028}
1029
1031{
1033 DWORD size = 0;
1034 HRESULT hr;
1035
1036 /* call will always fail, because size is 0,
1037 * but will return ERROR_FILE_NOT_FOUND first
1038 * if the file doesn't exist
1039 */
1040 GetUrlCacheEntryInfoW( szUrl, NULL, &size );
1042 {
1043 cache_entry = malloc( size );
1044 if ( !GetUrlCacheEntryInfoW( szUrl, cache_entry, &size ) )
1045 {
1047 free( cache_entry );
1048 return error;
1049 }
1050
1051 lstrcpyW( filename, cache_entry->lpszLocalFileName );
1052 free( cache_entry );
1053 return ERROR_SUCCESS;
1054 }
1055
1057 if ( FAILED(hr) )
1058 {
1059 WARN("failed to download %s to cache file\n", debugstr_w(szUrl));
1060 return ERROR_FUNCTION_FAILED;
1061 }
1062
1063 return ERROR_SUCCESS;
1064}
1065
1067{
1068 DWORD time, len, i, offset;
1069 HANDLE handle;
1070
1071 time = GetTickCount();
1073 lstrcatW( path, L"\\Installer\\" );
1075
1076 len = lstrlenW(path);
1077 for (i = 0; i < 0x10000; i++)
1078 {
1079 offset = swprintf( path + len, MAX_PATH - len, L"%x", (time + i) & 0xffff );
1080 memcpy( path + len + offset, suffix, (lstrlenW( suffix ) + 1) * sizeof(WCHAR) );
1084 {
1086 break;
1087 }
1090 return ERROR_FUNCTION_FAILED;
1091 }
1092
1093 return ERROR_SUCCESS;
1094}
1095
1096static enum platform parse_platform( const WCHAR *str )
1097{
1098 if (!str[0] || !wcscmp( str, L"Intel" )) return PLATFORM_INTEL;
1099 else if (!wcscmp( str, L"Intel64" )) return PLATFORM_INTEL64;
1100 else if (!wcscmp( str, L"x64" ) || !wcscmp( str, L"AMD64" )) return PLATFORM_X64;
1101 else if (!wcscmp( str, L"Arm" )) return PLATFORM_ARM;
1102 else if (!wcscmp( str, L"Arm64" )) return PLATFORM_ARM64;
1103 return PLATFORM_UNRECOGNIZED;
1104}
1105
1107{
1108 WCHAR *template, *p, *q, *platform;
1109 DWORD i, count;
1110
1112 TRACE("version: %d\n", package->version);
1113
1114 package->platform = PLATFORM_INTEL;
1115
1116 template = msi_suminfo_dup_string( si, PID_TEMPLATE );
1117 if (!template)
1118 return ERROR_SUCCESS; /* native accepts missing template property */
1119
1120 TRACE("template: %s\n", debugstr_w(template));
1121
1122 p = wcschr( template, ';' );
1123 if (p) *p++ = 0;
1124
1125 platform = template;
1126 if ((q = wcschr( platform, ',' ))) *q = 0;
1127 package->platform = parse_platform( platform );
1128 while (package->platform == PLATFORM_UNRECOGNIZED && q)
1129 {
1130 platform = q + 1;
1131 if ((q = wcschr( platform, ',' ))) *q = 0;
1132 package->platform = parse_platform( platform );
1133 }
1134 if (package->platform == PLATFORM_UNRECOGNIZED)
1135 {
1136 WARN("unknown platform %s\n", debugstr_w(template));
1137 free( template );
1139 }
1140
1141 if (!p || !*p)
1142 {
1143 free( template );
1144 return ERROR_SUCCESS;
1145 }
1146 count = 1;
1147 for (q = p; (q = wcschr( q, ',' )); q++) count++;
1148
1149 package->langids = malloc( count * sizeof(LANGID) );
1150 if (!package->langids)
1151 {
1152 free( template );
1153 return ERROR_OUTOFMEMORY;
1154 }
1155
1156 i = 0;
1157 while (*p)
1158 {
1159 q = wcschr( p, ',' );
1160 if (q) *q = 0;
1161 package->langids[i] = wcstol( p, NULL, 10 );
1162 if (!q) break;
1163 p = q + 1;
1164 i++;
1165 }
1166 package->num_langids = i + 1;
1167
1168 free( template );
1169 return ERROR_SUCCESS;
1170}
1171
1173{
1174#ifdef __REACTOS__
1175 // IsWow64Process2 is Windows 10 1709+, so use wine's implementation from commit c3f77b0f9a187109385d1dad17796241004057f4.
1176 // The usage of the function was introduced in wine commit 2e32067f1f80b169169fa662576a75b1c2382204
1177 #ifndef __arm__
1178 if (platform == PLATFORM_ARM)
1179 return FALSE;
1180 #endif
1181 #ifndef __aarch64__
1182 if (platform == PLATFORM_ARM64)
1183 return FALSE;
1184 #endif
1185 if (platform == PLATFORM_X64)
1186 {
1187 if (!is_64bit && !is_wow64)
1188 return FALSE;
1189 }
1190 return TRUE;
1191#else
1192 USHORT proc_machine, native_machine;
1193 IsWow64Process2( GetCurrentProcess(), &proc_machine, &native_machine );
1194 switch (platform)
1195 {
1196 case PLATFORM_INTEL:
1200 case PLATFORM_X64:
1203 case PLATFORM_ARM:
1205 case PLATFORM_ARM64:
1207 case PLATFORM_INTEL64:
1208 default:
1209 return FALSE;
1210 }
1211#endif
1212}
1213
1215{
1216 UINT i;
1217
1218 if (!validate_package_platform( package->platform ))
1220
1221 if (package->platform == PLATFORM_X64 && package->version < 200)
1223
1224 if (!package->num_langids)
1225 {
1226 return ERROR_SUCCESS;
1227 }
1228 for (i = 0; i < package->num_langids; i++)
1229 {
1230 LANGID langid = package->langids[i];
1231
1233 {
1235 }
1237 {
1239 }
1241 return ERROR_SUCCESS;
1242 }
1244}
1245
1246static WCHAR *get_property( MSIDATABASE *db, const WCHAR *prop )
1247{
1249 MSIQUERY *view;
1250 MSIRECORD *rec;
1251 WCHAR *ret = NULL;
1252
1253 swprintf(query, ARRAY_SIZE(query), L"SELECT `Value` FROM `Property` WHERE `Property`='%s'", prop);
1255 {
1256 return NULL;
1257 }
1258 if (MSI_ViewExecute( view, 0 ) != ERROR_SUCCESS)
1259 {
1261 msiobj_release( &view->hdr );
1262 return NULL;
1263 }
1264 if (MSI_ViewFetch( view, &rec ) == ERROR_SUCCESS)
1265 {
1266 ret = wcsdup( MSI_RecordGetString( rec, 1 ) );
1267 msiobj_release( &rec->hdr );
1268 }
1270 msiobj_release( &view->hdr );
1271 return ret;
1272}
1273
1275{
1276 return get_property( db, L"ProductCode" );
1277}
1278
1280{
1281 return get_property( db, L"ProductVersion" );
1282}
1283
1284static UINT get_registered_local_package( const WCHAR *product, WCHAR *localfile )
1285{
1287 WCHAR *filename;
1288 HKEY props_key;
1289 UINT r;
1290
1291 r = msi_locate_product( product, &context );
1292 if (r != ERROR_SUCCESS)
1293 return r;
1294
1295 r = MSIREG_OpenInstallProps( product, context, NULL, &props_key, FALSE );
1296 if (r != ERROR_SUCCESS)
1297 return r;
1298
1300 RegCloseKey( props_key );
1301 if (!filename)
1302 return ERROR_FUNCTION_FAILED;
1303
1304 lstrcpyW( localfile, filename );
1305 free( filename );
1306 return ERROR_SUCCESS;
1307}
1308
1310{
1311 WCHAR *ret;
1313 UINT r;
1314
1315 r = msi_get_suminfo( db->storage, 0, &si );
1316 if (r != ERROR_SUCCESS)
1317 {
1318 r = msi_get_db_suminfo( db, 0, &si );
1319 if (r != ERROR_SUCCESS)
1320 {
1321 WARN("failed to load summary info %u\n", r);
1322 return NULL;
1323 }
1324 }
1326 msiobj_release( &si->hdr );
1327 return ret;
1328}
1329
1330static UINT get_local_package( MSIDATABASE *db, WCHAR *localfile )
1331{
1332 WCHAR *product_code;
1333 UINT r;
1334
1335 if (!(product_code = get_product_code( db )))
1337 r = get_registered_local_package( product_code, localfile );
1338 free( product_code );
1339 return r;
1340}
1341
1343{
1344 UINT r;
1345
1346 if (UrlIsW( package, URLIS_URL ))
1347 r = msi_set_property( db, L"OriginalDatabase", package, -1 );
1348 else if (package[0] == '#')
1349 r = msi_set_property( db, L"OriginalDatabase", db->path, -1 );
1350 else
1351 {
1352 DWORD len;
1353 WCHAR *path;
1354
1355 if (!(len = GetFullPathNameW( package, 0, NULL, NULL ))) return GetLastError();
1356 if (!(path = malloc( len * sizeof(WCHAR) ))) return ERROR_OUTOFMEMORY;
1357 len = GetFullPathNameW( package, len, path, NULL );
1358 r = msi_set_property( db, L"OriginalDatabase", path, len );
1359 free( path );
1360 }
1361 return r;
1362}
1363
1364#ifdef __REACTOS__
1367BOOL WINAPI SE_DynamicShim(LPCWSTR ProcessImage, PVOID hsdb, PVOID pQueryResult, LPCSTR Module, LPDWORD lpdwDynamicToken);
1370
1371#define HID_DOS_PATHS 0x1
1372#define SDB_DATABASE_MAIN_SHIM 0x80030000
1373
1374#define APPHELP_VALID_RESULT 0x10000
1375#define APPHELP_RESULT_FOUND 0x40000
1376
1377static void
1378AppHelpCheckPackage(LPCWSTR szPackage)
1379{
1380 USHORT ExeType = 0;
1381 ULONG Reason = 0;
1382
1383 PVOID QueryResult = NULL;
1384 ULONG QueryResultSize = 0;
1385
1386 HANDLE Handle = NULL;
1387 BOOL Continue = ApphelpCheckRunAppEx(
1388 Handle, NULL, NULL, szPackage, NULL, ExeType, &Reason, &QueryResult, &QueryResultSize, NULL,
1389 NULL, NULL, NULL, NULL);
1390
1391 if (Continue)
1392 {
1394 {
1395 DWORD dwToken;
1397 if (hsdb)
1398 {
1399 BOOL bShim = SE_DynamicShim(szPackage, hsdb, QueryResult, "msi.dll", &dwToken);
1400 ERR("ReactOS HACK(CORE-13283): Used SE_DynamicShim %d!\n", bShim);
1401
1402 SdbReleaseDatabase(hsdb);
1403 }
1404 else
1405 {
1406 ERR("Unable to open SDB_DATABASE_MAIN_SHIM\n");
1407 }
1408 }
1409 }
1410
1411 if (QueryResult)
1412 RtlFreeHeap(RtlGetProcessHeap(), 0, QueryResult);
1413}
1414#endif
1415
1417{
1418 MSIDATABASE *db;
1419 MSIPACKAGE *package;
1421 MSIRECORD *data_row, *info_row;
1422 UINT r;
1423 WCHAR localfile[MAX_PATH], cachefile[MAX_PATH];
1424 LPCWSTR file = szPackage;
1425 DWORD index = 0;
1427 BOOL delete_on_close = FALSE;
1428 WCHAR *info_template, *productname, *product_code;
1430
1431 TRACE("%s %p\n", debugstr_w(szPackage), pPackage);
1432
1434
1435 localfile[0] = 0;
1436 if( szPackage[0] == '#' )
1437 {
1438 handle = wcstol(&szPackage[1], NULL, 10);
1440 return ERROR_INVALID_HANDLE;
1441 }
1442 else
1443 {
1444 WCHAR *product_version = NULL;
1445
1446 if ( UrlIsW( szPackage, URLIS_URL ) )
1447 {
1448 r = msi_download_file( szPackage, cachefile );
1449 if (r != ERROR_SUCCESS)
1450 return r;
1451
1452 file = cachefile;
1453 }
1454#ifdef __REACTOS__
1455 AppHelpCheckPackage(file);
1456#endif
1457
1459 if (r != ERROR_SUCCESS)
1460 {
1462 return ERROR_FILE_NOT_FOUND;
1463 return r;
1464 }
1465 r = get_local_package( db, localfile );
1467 {
1468 DWORD localfile_attr;
1469
1470 r = msi_create_empty_local_file( localfile, L".msi" );
1471 if (r != ERROR_SUCCESS)
1472 {
1473 msiobj_release( &db->hdr );
1474 return r;
1475 }
1476
1477 if (!CopyFileW( file, localfile, FALSE ))
1478 {
1479 r = GetLastError();
1480 WARN("unable to copy package %s to %s (%u)\n", debugstr_w(file), debugstr_w(localfile), r);
1481 DeleteFileW( localfile );
1482 msiobj_release( &db->hdr );
1483 return r;
1484 }
1485 delete_on_close = TRUE;
1486
1487 /* Remove read-only bit, we are opening it with write access in MSI_OpenDatabaseW below. */
1488 localfile_attr = GetFileAttributesW( localfile );
1489 if (localfile_attr & FILE_ATTRIBUTE_READONLY)
1490 SetFileAttributesW( localfile, localfile_attr & ~FILE_ATTRIBUTE_READONLY);
1491 }
1493 {
1494 if (!CopyFileW( file, localfile, FALSE ))
1495 {
1496 r = GetLastError();
1497 WARN("unable to update cached package (%u)\n", r);
1498 msiobj_release( &db->hdr );
1499 return r;
1500 }
1501 }
1502 else
1503 product_version = get_product_version( db );
1504 msiobj_release( &db->hdr );
1505 TRACE("opening package %s\n", debugstr_w( localfile ));
1506 r = MSI_OpenDatabaseW( localfile, MSIDBOPEN_TRANSACT, &db );
1507 if (r != ERROR_SUCCESS)
1508 {
1509 free( product_version );
1510 return r;
1511 }
1512
1513 if (product_version)
1514 {
1515 WCHAR *cache_version = get_product_version( db );
1516 if (!product_version != !cache_version ||
1517 (product_version && wcscmp(product_version, cache_version)))
1518 {
1519 msiobj_release( &db->hdr );
1520 free( product_version );
1521 free( cache_version );
1522 return ERROR_PRODUCT_VERSION;
1523 }
1524 free( product_version );
1525 free( cache_version );
1526 }
1527 }
1528 package = MSI_CreatePackage( db );
1529 msiobj_release( &db->hdr );
1530 if (!package) return ERROR_INSTALL_PACKAGE_INVALID;
1531 package->localfile = wcsdup( localfile );
1532 package->delete_on_close = delete_on_close;
1533
1534 r = msi_get_suminfo( db->storage, 0, &si );
1535 if (r != ERROR_SUCCESS)
1536 {
1537 r = msi_get_db_suminfo( db, 0, &si );
1538 if (r != ERROR_SUCCESS)
1539 {
1540 WARN("failed to load summary info\n");
1541 msiobj_release( &package->hdr );
1543 }
1544 }
1545 r = parse_suminfo( si, package );
1546 msiobj_release( &si->hdr );
1547 if (r != ERROR_SUCCESS)
1548 {
1549 WARN("failed to parse summary info %u\n", r);
1550 msiobj_release( &package->hdr );
1551 return r;
1552 }
1553 r = validate_package( package );
1554 if (r != ERROR_SUCCESS)
1555 {
1556 msiobj_release( &package->hdr );
1557 return r;
1558 }
1559 msi_set_property( package->db, L"DATABASE", db->path, -1 );
1560 set_installed_prop( package );
1561 msi_set_context( package );
1562
1563 product_code = get_product_code( db );
1564 if (msi_locate_product( product_code, &context ) == ERROR_SUCCESS)
1565 {
1566 TRACE("product already registered\n");
1567 msi_set_property( package->db, L"ProductToBeRegistered", L"1", -1 );
1568 }
1569 free( product_code );
1570
1571 while (1)
1572 {
1573 WCHAR patch_code[GUID_SIZE];
1574 r = MsiEnumPatchesExW( package->ProductCode, NULL, package->Context,
1575 MSIPATCHSTATE_APPLIED, index, patch_code, NULL, NULL, NULL, NULL );
1576 if (r != ERROR_SUCCESS)
1577 break;
1578
1579 TRACE("found registered patch %s\n", debugstr_w(patch_code));
1580
1581 r = msi_apply_registered_patch( package, patch_code );
1582 if (r != ERROR_SUCCESS)
1583 {
1584 ERR("registered patch failed to apply %u\n", r);
1585 msiobj_release( &package->hdr );
1586 return r;
1587 }
1588 index++;
1589 }
1590 if (index) msi_adjust_privilege_properties( package );
1591
1592 r = msi_set_original_database_property( package->db, szPackage );
1593 if (r != ERROR_SUCCESS)
1594 {
1595 msiobj_release( &package->hdr );
1596 return r;
1597 }
1598 if (gszLogFile)
1601
1602 /* FIXME: when should these messages be sent? */
1603 data_row = MSI_CreateRecord(3);
1604 if (!data_row)
1605 return ERROR_OUTOFMEMORY;
1606 MSI_RecordSetStringW(data_row, 0, NULL);
1607 MSI_RecordSetInteger(data_row, 1, 0);
1608 MSI_RecordSetInteger(data_row, 2, package->num_langids ? package->langids[0] : 0);
1611
1612 info_row = MSI_CreateRecord(0);
1613 if (!info_row)
1614 {
1615 msiobj_release(&data_row->hdr);
1616 return ERROR_OUTOFMEMORY;
1617 }
1618 info_template = msi_get_error_message(package->db, MSIERR_INFO_LOGGINGSTART);
1619 MSI_RecordSetStringW(info_row, 0, info_template);
1620 free(info_template);
1622
1624
1625 productname = msi_dup_property(package->db, INSTALLPROPERTY_PRODUCTNAMEW);
1626 MSI_RecordSetInteger(data_row, 1, 1);
1627 MSI_RecordSetStringW(data_row, 2, productname);
1628 MSI_RecordSetStringW(data_row, 3, NULL);
1630
1631 free(productname);
1632 msiobj_release(&info_row->hdr);
1633 msiobj_release(&data_row->hdr);
1634
1635 *pPackage = package;
1636 return ERROR_SUCCESS;
1637}
1638
1640{
1641 MSIPACKAGE *package = NULL;
1642 UINT ret;
1643
1644 TRACE( "%s, %#lx, %p\n", debugstr_w(szPackage), dwOptions, phPackage );
1645
1646 if( !szPackage || !phPackage )
1648
1649 if ( !*szPackage )
1650 {
1651 FIXME("Should create an empty database and package\n");
1652 return ERROR_FUNCTION_FAILED;
1653 }
1654
1655 if( dwOptions )
1656 FIXME( "dwOptions %#lx not supported\n", dwOptions );
1657
1658 ret = MSI_OpenPackageW( szPackage, 0, &package );
1659 if( ret == ERROR_SUCCESS )
1660 {
1661 *phPackage = alloc_msihandle( &package->hdr );
1662 if (! *phPackage)
1664 msiobj_release( &package->hdr );
1665 }
1666 else
1668
1669 return ret;
1670}
1671
1673{
1674 return MsiOpenPackageExW( szPackage, 0, phPackage );
1675}
1676
1678{
1679 LPWSTR szwPack = NULL;
1680 UINT ret;
1681
1682 if( szPackage )
1683 {
1684 szwPack = strdupAtoW( szPackage );
1685 if( !szwPack )
1686 return ERROR_OUTOFMEMORY;
1687 }
1688
1689 ret = MsiOpenPackageExW( szwPack, dwOptions, phPackage );
1690
1691 free( szwPack );
1692
1693 return ret;
1694}
1695
1697{
1698 return MsiOpenPackageExA( szPackage, 0, phPackage );
1699}
1700
1702{
1703 MSIPACKAGE *package;
1704 MSIHANDLE handle = 0;
1705 MSIHANDLE remote;
1706
1707 TRACE( "%lu\n", hInstall );
1708
1709 package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE);
1710 if( package)
1711 {
1712 handle = alloc_msihandle( &package->db->hdr );
1713 msiobj_release( &package->hdr );
1714 }
1715 else if ((remote = msi_get_remote(hInstall)))
1716 {
1717 __TRY
1718 {
1719 handle = remote_GetActiveDatabase(remote);
1721 }
1723 {
1724 handle = 0;
1725 }
1726 __ENDTRY
1727 }
1728
1729 return handle;
1730}
1731
1733{
1734 if (!package || (package->ui_level & INSTALLUILEVEL_MASK) == INSTALLUILEVEL_NONE)
1735 return 0;
1736
1737 /* todo: check if message needs additional styles (topmost/foreground/modality?) */
1738
1739 switch (eMessageType & 0xff000000)
1740 {
1744 if (package->ui_level & INSTALLUILEVEL_PROGRESSONLY) return 0;
1745 if (!(eMessageType & MB_ICONMASK))
1746 eMessageType |= MB_ICONEXCLAMATION;
1747 return MessageBoxW(gUIhwnd, message, L"Windows Installer", eMessageType & 0x00ffffff);
1749 if (package->ui_level & INSTALLUILEVEL_PROGRESSONLY) return 0;
1750 if (!(eMessageType & MB_ICONMASK))
1751 eMessageType |= MB_ICONASTERISK;
1752 return MessageBoxW(gUIhwnd, message, L"Windows Installer", eMessageType & 0x00ffffff);
1754 if (package->ui_level & INSTALLUILEVEL_PROGRESSONLY) return 0;
1755 if (!(eMessageType & MB_ICONMASK))
1756 eMessageType |= MB_USERICON;
1757 return MessageBoxW(gUIhwnd, message, L"Windows Installer", eMessageType & 0x00ffffff);
1763 return 0;
1765 {
1767 INT rc = ACTION_DialogBox(package, dialog);
1768 free(dialog);
1769 return rc;
1770 }
1772 {
1773 LPWSTR deformatted;
1774 MSIRECORD *uirow = MSI_CreateRecord(1);
1775 if (!uirow) return -1;
1776 deformat_string(package, MSI_RecordGetString(record, 2), &deformatted);
1777 MSI_RecordSetStringW(uirow, 1, deformatted);
1778 msi_event_fire(package, L"ActionText", uirow);
1779
1780 free(deformatted);
1781 msiobj_release(&uirow->hdr);
1782 return 1;
1783 }
1785 {
1786 MSIRECORD *uirow = MSI_CreateRecord(1);
1787 if (!uirow) return -1;
1788 MSI_RecordSetStringW(uirow, 1, message);
1789 msi_event_fire(package, L"ActionData", uirow);
1790 msiobj_release(&uirow->hdr);
1791
1792 if (package->action_progress_increment)
1793 {
1794 uirow = MSI_CreateRecord(2);
1795 if (!uirow) return -1;
1796 MSI_RecordSetInteger(uirow, 1, 2);
1798 msi_event_fire(package, L"SetProgress", uirow);
1799 msiobj_release(&uirow->hdr);
1800 }
1801 return 1;
1802 }
1804 msi_event_fire(package, L"SetProgress", record);
1805 return 1;
1807 switch (MSI_RecordGetInteger(record, 1))
1808 {
1809 case 0:
1810 case 1:
1811 /* do nothing */
1812 return 0;
1813 default:
1814 /* fall through */
1815 ;
1816 }
1817 default:
1818 FIXME("internal UI not implemented for message 0x%08x (UI level = %x)\n", eMessageType, package->ui_level);
1819 return 0;
1820 }
1821}
1822
1823static const struct
1824{
1825 int id;
1826 const WCHAR *text;
1827}
1829{
1830 {2726, L"DEBUG: Error [1]: Action not found: [2]"},
1831 {0}
1833
1835{
1836 int i = 0;
1837
1838 while (internal_errors[i].id != 0)
1839 {
1840 if (internal_errors[i].id == error)
1841 return internal_errors[i].text;
1842 i++;
1843 }
1844
1845 FIXME("missing error message %d\n", error);
1846 return NULL;
1847}
1848
1849/* Returned string must be freed */
1851{
1853 LPWSTR ret = NULL;
1854
1855 if ((record = MSI_QueryGetRecord(db, L"SELECT `Message` FROM `Error` WHERE `Error` = %d", error)))
1856 {
1858 msiobj_release(&record->hdr);
1859 }
1860 else if (error < 2000)
1861 {
1863 if (len)
1864 {
1865 ret = malloc((len + 1) * sizeof(WCHAR));
1867 }
1868 else
1869 ret = NULL;
1870 }
1871
1872 return ret;
1873}
1874
1876{
1877 LPWSTR message = {0};
1878 DWORD len;
1879 DWORD log_type = 1 << (eMessageType >> 24);
1880 UINT res;
1881 INT rc = 0;
1882 char *msg;
1883
1884 TRACE("%x\n", eMessageType);
1885 if (TRACE_ON(msi)) dump_record(record);
1886
1887 if (!package || !record)
1888 message = NULL;
1889 else {
1890 res = MSI_FormatRecordW(package, record, message, &len);
1891 if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA)
1892 return res;
1893 len++;
1894 message = malloc(len * sizeof(WCHAR));
1895 if (!message) return ERROR_OUTOFMEMORY;
1896 MSI_FormatRecordW(package, record, message, &len);
1897 }
1898
1899 /* convert it to ANSI */
1900 len = WideCharToMultiByte( CP_ACP, 0, message, -1, NULL, 0, NULL, NULL );
1901 msg = malloc( len );
1903
1904 if (gUIHandlerRecord && (gUIFilterRecord & log_type))
1905 {
1906 MSIHANDLE rec = alloc_msihandle(&record->hdr);
1907 TRACE( "calling UI handler %p(pvContext = %p, iMessageType = %#x, hRecord = %lu)\n",
1908 gUIHandlerRecord, gUIContextRecord, eMessageType, rec );
1909 rc = gUIHandlerRecord( gUIContextRecord, eMessageType, rec );
1910 MsiCloseHandle( rec );
1911 }
1912 if (!rc && gUIHandlerW && (gUIFilter & log_type))
1913 {
1914 TRACE( "calling UI handler %p(pvContext = %p, iMessageType = %#x, szMessage = %s)\n",
1915 gUIHandlerW, gUIContext, eMessageType, debugstr_w(message) );
1916 rc = gUIHandlerW( gUIContext, eMessageType, message );
1917 }
1918 else if (!rc && gUIHandlerA && (gUIFilter & log_type))
1919 {
1920 TRACE( "calling UI handler %p(pvContext = %p, iMessageType = %#x, szMessage = %s)\n",
1921 gUIHandlerA, gUIContext, eMessageType, debugstr_a(msg) );
1922 rc = gUIHandlerA( gUIContext, eMessageType, msg );
1923 }
1924
1925 if (!rc)
1926 rc = internal_ui_handler(package, eMessageType, record, message);
1927
1928 if (!rc && package && package->log_file != INVALID_HANDLE_VALUE &&
1929 (eMessageType & 0xff000000) != INSTALLMESSAGE_PROGRESS)
1930 {
1931 DWORD written;
1932 WriteFile( package->log_file, msg, len - 1, &written, NULL );
1933 WriteFile( package->log_file, "\n", 1, &written, NULL );
1934 }
1935 free( msg );
1936 free( message );
1937
1938 return rc;
1939}
1940
1942{
1943 switch (eMessageType & 0xff000000)
1944 {
1952 {
1953 /* error message */
1954
1955 LPWSTR template;
1956 LPWSTR template_rec = NULL, template_prefix = NULL;
1958
1959 if (MSI_RecordIsNull(record, 0))
1960 {
1961 if (error >= 32)
1962 {
1963 template_rec = msi_get_error_message(package->db, error);
1964
1965 if (!template_rec && error >= 2000)
1966 {
1967 /* internal error, not localized */
1968 if ((template_rec = (LPWSTR) get_internal_error_message(error)))
1969 {
1970 MSI_RecordSetStringW(record, 0, template_rec);
1972 }
1973 template_rec = msi_get_error_message(package->db, MSIERR_INSTALLERROR);
1974 MSI_RecordSetStringW(record, 0, template_rec);
1975 MSI_ProcessMessageVerbatim(package, eMessageType, record);
1976 free(template_rec);
1977 return 0;
1978 }
1979 }
1980 }
1981 else
1982 template_rec = msi_dup_record_field(record, 0);
1983
1984 template_prefix = msi_get_error_message(package->db, eMessageType >> 24);
1985 if (!template_prefix) template_prefix = wcsdup(L"");
1986
1987 if (!template_rec)
1988 {
1989 /* always returns 0 */
1990 MSI_RecordSetStringW(record, 0, template_prefix);
1991 MSI_ProcessMessageVerbatim(package, eMessageType, record);
1992 free(template_prefix);
1993 return 0;
1994 }
1995
1996 template = malloc((wcslen(template_rec) + wcslen(template_prefix) + 1) * sizeof(WCHAR));
1997 if (!template)
1998 {
1999 free(template_prefix);
2000 free(template_rec);
2001 return ERROR_OUTOFMEMORY;
2002 }
2003
2004 lstrcpyW(template, template_prefix);
2005 lstrcatW(template, template_rec);
2006 MSI_RecordSetStringW(record, 0, template);
2007
2008 free(template_prefix);
2009 free(template_rec);
2010 free(template);
2011 }
2012 break;
2014 {
2015 WCHAR *template = msi_get_error_message(package->db, MSIERR_ACTIONSTART);
2016 MSI_RecordSetStringW(record, 0, template);
2017 free(template);
2018
2019 free(package->LastAction);
2020 free(package->LastActionTemplate);
2021 package->LastAction = msi_dup_record_field(record, 1);
2022 if (!package->LastAction) package->LastAction = wcsdup(L"");
2024 break;
2025 }
2027 if (package->LastAction && package->LastActionTemplate)
2028 {
2029 size_t len = lstrlenW(package->LastAction) + lstrlenW(package->LastActionTemplate) + 7;
2030 WCHAR *template = malloc(len * sizeof(WCHAR));
2031 if (!template) return ERROR_OUTOFMEMORY;
2032 swprintf(template, len, L"{{%s: }}%s", package->LastAction, package->LastActionTemplate);
2033 MSI_RecordSetStringW(record, 0, template);
2034 free(template);
2035 }
2036 break;
2038 {
2039 WCHAR *template = msi_get_error_message(package->db, MSIERR_COMMONDATA);
2040 MSI_RecordSetStringW(record, 0, template);
2041 free(template);
2042 }
2043 break;
2044 }
2045
2046 return MSI_ProcessMessageVerbatim(package, eMessageType, record);
2047}
2048
2050 MSIHANDLE hRecord)
2051{
2053 MSIPACKAGE *package = NULL;
2055
2056 if ((eMessageType & 0xff000000) == INSTALLMESSAGE_INITIALIZE ||
2057 (eMessageType & 0xff000000) == INSTALLMESSAGE_TERMINATE)
2058 return -1;
2059
2060 if ((eMessageType & 0xff000000) == INSTALLMESSAGE_COMMONDATA &&
2061 MsiRecordGetInteger(hRecord, 1) != 2)
2062 return -1;
2063
2065 if (!record)
2066 return ERROR_INVALID_HANDLE;
2067
2068 package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE );
2069 if( !package )
2070 {
2071 MSIHANDLE remote;
2072
2073 if (!(remote = msi_get_remote(hInstall)))
2074 return ERROR_INVALID_HANDLE;
2075
2076 __TRY
2077 {
2078 ret = remote_ProcessMessage(remote, eMessageType, (struct wire_record *)&record->count);
2079 }
2081 {
2083 }
2084 __ENDTRY
2085
2086 msiobj_release(&record->hdr);
2087 return ret;
2088 }
2089
2090 ret = MSI_ProcessMessage( package, eMessageType, record );
2091
2092 msiobj_release( &record->hdr );
2093 msiobj_release( &package->hdr );
2094 return ret;
2095}
2096
2097/* property code */
2098
2100{
2101 LPWSTR szwName = NULL, szwValue = NULL;
2103
2104 szwName = strdupAtoW( szName );
2105 if( szName && !szwName )
2106 goto end;
2107
2108 szwValue = strdupAtoW( szValue );
2109 if( szValue && !szwValue )
2110 goto end;
2111
2112 r = MsiSetPropertyW( hInstall, szwName, szwValue);
2113
2114end:
2115 free( szwName );
2116 free( szwValue );
2117
2118 return r;
2119}
2120
2122{
2124
2126 {
2127 free( folder->ResolvedSource );
2128 folder->ResolvedSource = NULL;
2129 }
2130}
2131
2133{
2134 MSIQUERY *view;
2135 MSIRECORD *row = NULL;
2136 DWORD sz = 0;
2137 WCHAR query[1024];
2138 UINT rc;
2139
2140 TRACE("%p %s %s %d\n", db, debugstr_w(name), debugstr_wn(value, len), len);
2141
2142 if (!name)
2144
2145 /* this one is weird... */
2146 if (!name[0])
2148
2149 if (value && len < 0) len = lstrlenW( value );
2150
2151 rc = msi_get_property( db, name, 0, &sz );
2152 if (!value || (!*value && !len))
2153 {
2154 swprintf( query, ARRAY_SIZE(query), L"DELETE FROM `_Property` WHERE `_Property` = '%s'", name );
2155 }
2156 else if (rc == ERROR_MORE_DATA || rc == ERROR_SUCCESS)
2157 {
2158 swprintf( query, ARRAY_SIZE(query), L"UPDATE `_Property` SET `Value` = ? WHERE `_Property` = '%s'", name );
2159 row = MSI_CreateRecord(1);
2161 }
2162 else
2163 {
2164 lstrcpyW( query, L"INSERT INTO `_Property` (`_Property`,`Value`) VALUES (?,?)" );
2165 row = MSI_CreateRecord(2);
2166 msi_record_set_string( row, 1, name, -1 );
2168 }
2169
2170 rc = MSI_DatabaseOpenViewW(db, query, &view);
2171 if (rc == ERROR_SUCCESS)
2172 {
2173 rc = MSI_ViewExecute(view, row);
2175 msiobj_release(&view->hdr);
2176 }
2177 if (row) msiobj_release(&row->hdr);
2178 return rc;
2179}
2180
2182{
2183 MSIPACKAGE *package;
2184 UINT ret;
2185
2186 package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE);
2187 if( !package )
2188 {
2189 MSIHANDLE remote;
2190
2191 if (!(remote = msi_get_remote(hInstall)))
2192 return ERROR_INVALID_HANDLE;
2193
2194 __TRY
2195 {
2196 ret = remote_SetProperty(remote, szName, szValue);
2197 }
2199 {
2201 }
2202 __ENDTRY
2203
2204 return ret;
2205 }
2206
2207 ret = msi_set_property( package->db, szName, szValue, -1 );
2208 if (ret == ERROR_SUCCESS && !wcscmp( szName, L"SourceDir" ))
2209 msi_reset_source_folders( package );
2210
2211 msiobj_release( &package->hdr );
2212 return ret;
2213}
2214
2216{
2217 MSIRECORD *rec, *row = NULL;
2218 MSIQUERY *view;
2219 UINT r;
2220 WCHAR *buffer;
2221 int length;
2222
2223 if (!name || !*name)
2224 return NULL;
2225
2226 if (!wcscmp(name, L"Date"))
2227 {
2229 if (!length)
2230 return NULL;
2231 buffer = malloc(length * sizeof(WCHAR));
2233
2234 row = MSI_CreateRecord(1);
2235 if (!row)
2236 {
2237 free(buffer);
2238 return NULL;
2239 }
2241 free(buffer);
2242 return row;
2243 }
2244 else if (!wcscmp(name, L"Time"))
2245 {
2247 if (!length)
2248 return NULL;
2249 buffer = malloc(length * sizeof(WCHAR));
2251
2252 row = MSI_CreateRecord(1);
2253 if (!row)
2254 {
2255 free(buffer);
2256 return NULL;
2257 }
2259 free(buffer);
2260 return row;
2261 }
2262
2263 rec = MSI_CreateRecord(1);
2264 if (!rec)
2265 return NULL;
2266
2267 MSI_RecordSetStringW(rec, 1, name);
2268
2269 r = MSI_DatabaseOpenViewW(db, L"SELECT `Value` FROM `_Property` WHERE `_Property`=?", &view);
2270 if (r == ERROR_SUCCESS)
2271 {
2272 MSI_ViewExecute(view, rec);
2275 msiobj_release(&view->hdr);
2276 }
2277 msiobj_release(&rec->hdr);
2278 return row;
2279}
2280
2281/* internal function, not compatible with MsiGetPropertyW */
2283 LPWSTR szValueBuf, LPDWORD pchValueBuf )
2284{
2285 MSIRECORD *row;
2287
2288 TRACE("%p %s %p %p\n", db, debugstr_w(szName), szValueBuf, pchValueBuf);
2289
2290 row = get_property_row( db, szName );
2291
2292 if (*pchValueBuf > 0)
2293 szValueBuf[0] = 0;
2294
2295 if (row)
2296 {
2297 rc = MSI_RecordGetStringW(row, 1, szValueBuf, pchValueBuf);
2298 msiobj_release(&row->hdr);
2299 }
2300
2301 if (rc == ERROR_SUCCESS)
2302 TRACE("returning %s for property %s\n", debugstr_wn(szValueBuf, *pchValueBuf),
2304 else if (rc == ERROR_MORE_DATA)
2305 TRACE( "need %lu sized buffer for %s\n", *pchValueBuf, debugstr_w(szName) );
2306 else
2307 {
2308 *pchValueBuf = 0;
2309 TRACE("property %s not found\n", debugstr_w(szName));
2310 }
2311
2312 return rc;
2313}
2314
2316{
2317 DWORD sz = 0;
2318 LPWSTR str;
2319 UINT r;
2320
2321 r = msi_get_property(db, prop, NULL, &sz);
2322 if (r != ERROR_SUCCESS && r != ERROR_MORE_DATA)
2323 return NULL;
2324
2325 sz++;
2326 str = malloc(sz * sizeof(WCHAR));
2327 r = msi_get_property(db, prop, str, &sz);
2328 if (r != ERROR_SUCCESS)
2329 {
2330 free(str);
2331 str = NULL;
2332 }
2333
2334 return str;
2335}
2336
2338{
2339 LPWSTR str = msi_dup_property( db, prop );
2340 int val = str ? wcstol(str, NULL, 10) : def;
2341 free(str);
2342 return val;
2343}
2344
2346{
2347 const WCHAR *value = L"";
2348 MSIPACKAGE *package;
2349 MSIRECORD *row;
2350 WCHAR *nameW;
2351 int len = 0;
2352 UINT r;
2353
2354 if (!name)
2356
2357 if (!(nameW = strdupAtoW(name)))
2358 return ERROR_OUTOFMEMORY;
2359
2360 package = msihandle2msiinfo(hinst, MSIHANDLETYPE_PACKAGE);
2361 if (!package)
2362 {
2363 WCHAR *value = NULL, *tmp;
2364 MSIHANDLE remote;
2365 DWORD len;
2366
2367 if (!(remote = msi_get_remote(hinst)))
2368 {
2369 free(nameW);
2370 return ERROR_INVALID_HANDLE;
2371 }
2372
2373 __TRY
2374 {
2375 r = remote_GetProperty(remote, nameW, &value, &len);
2376 }
2378 {
2379 r = GetExceptionCode();
2380 }
2381 __ENDTRY
2382
2383 free(nameW);
2384
2385 if (!r)
2386 {
2387 /* String might contain embedded nulls.
2388 * Native returns the correct size but truncates the string. */
2389 tmp = calloc(1, (len + 1) * sizeof(WCHAR));
2390 if (!tmp)
2391 {
2393 return ERROR_OUTOFMEMORY;
2394 }
2395 lstrcpyW(tmp, value);
2396
2397 r = msi_strncpyWtoA(tmp, len, buf, sz, TRUE);
2398
2399 free(tmp);
2400 }
2402 return r;
2403 }
2404
2405 row = get_property_row(package->db, nameW);
2406 if (row)
2408
2409 r = msi_strncpyWtoA(value, len, buf, sz, FALSE);
2410
2411 free(nameW);
2412 if (row) msiobj_release(&row->hdr);
2413 msiobj_release(&package->hdr);
2414 return r;
2415}
2416
2418{
2419 const WCHAR *value = L"";
2420 MSIPACKAGE *package;
2421 MSIRECORD *row;
2422 int len = 0;
2423 UINT r;
2424
2425 if (!name)
2427
2428 package = msihandle2msiinfo(hinst, MSIHANDLETYPE_PACKAGE);
2429 if (!package)
2430 {
2431 WCHAR *value = NULL, *tmp;
2432 MSIHANDLE remote;
2433 DWORD len;
2434
2435 if (!(remote = msi_get_remote(hinst)))
2436 return ERROR_INVALID_HANDLE;
2437
2438 __TRY
2439 {
2440 r = remote_GetProperty(remote, name, &value, &len);
2441 }
2443 {
2444 r = GetExceptionCode();
2445 }
2446 __ENDTRY
2447
2448 if (!r)
2449 {
2450 /* String might contain embedded nulls.
2451 * Native returns the correct size but truncates the string. */
2452 tmp = calloc(1, (len + 1) * sizeof(WCHAR));
2453 if (!tmp)
2454 {
2456 return ERROR_OUTOFMEMORY;
2457 }
2458 lstrcpyW(tmp, value);
2459
2460 r = msi_strncpyW(tmp, len, buf, sz);
2461
2462 free(tmp);
2463 }
2465 return r;
2466 }
2467
2468 row = get_property_row(package->db, name);
2469 if (row)
2471
2472 r = msi_strncpyW(value, len, buf, sz);
2473
2474 if (row) msiobj_release(&row->hdr);
2475 msiobj_release(&package->hdr);
2476 return r;
2477}
2478
2480{
2482}
2483
2485{
2486 WCHAR empty[1];
2487 UINT r;
2488
2489 *size = 0;
2491 if (r == ERROR_MORE_DATA)
2492 {
2493 ++*size;
2494 *value = midl_user_allocate(*size * sizeof(WCHAR));
2495 if (!*value)
2496 return ERROR_OUTOFMEMORY;
2498 }
2499 return r;
2500}
2501
2503{
2505}
2506
2508{
2509 MSIHANDLE rec;
2510 int ret;
2511 UINT r;
2512
2513 if ((r = unmarshal_record(remote_rec, &rec)))
2514 return r;
2515
2517
2518 MsiCloseHandle(rec);
2519 return ret;
2520}
2521
2523{
2524 return MsiDoActionW(hinst, action);
2525}
2526
2528{
2529 return MsiSequenceW(hinst, table, sequence);
2530}
2531
2533{
2534 WCHAR empty[1];
2535 DWORD size = 0;
2536 UINT r;
2537
2539 if (r == ERROR_MORE_DATA)
2540 {
2541 *value = midl_user_allocate(++size * sizeof(WCHAR));
2542 if (!*value)
2543 return ERROR_OUTOFMEMORY;
2545 }
2546 return r;
2547}
2548
2550{
2552}
2553
2555{
2556 WCHAR empty[1];
2557 DWORD size = 1;
2558 UINT r;
2559
2561 if (r == ERROR_MORE_DATA)
2562 {
2563 *value = midl_user_allocate(++size * sizeof(WCHAR));
2564 if (!*value)
2565 return ERROR_OUTOFMEMORY;
2567 }
2568 return r;
2569}
2570
2572{
2573 return MsiGetMode(hinst, mode);
2574}
2575
2577{
2578 return MsiSetMode(hinst, mode, state);
2579}
2580
2582 INSTALLSTATE *installed, INSTALLSTATE *action)
2583{
2584 return MsiGetFeatureStateW(hinst, feature, installed, action);
2585}
2586
2588{
2590}
2591
2593 INSTALLSTATE *installed, INSTALLSTATE *action)
2594{
2595 return MsiGetComponentStateW(hinst, component, installed, action);
2596}
2597
2599{
2601}
2602
2604{
2605 return MsiGetLanguage(hinst);
2606}
2607
2609{
2611}
2612
2614{
2615 WCHAR empty[1];
2616 DWORD size = 0;
2617 MSIHANDLE rec;
2618 UINT r;
2619
2620 if ((r = unmarshal_record(remote_rec, &rec)))
2621 return r;
2622
2623 r = MsiFormatRecordW(hinst, rec, empty, &size);
2624 if (r == ERROR_MORE_DATA)
2625 {
2626 *value = midl_user_allocate(++size * sizeof(WCHAR));
2627 if (!*value)
2628 {
2629 MsiCloseHandle(rec);
2630 return ERROR_OUTOFMEMORY;
2631 }
2632 r = MsiFormatRecordW(hinst, rec, *value, &size);
2633 }
2634
2635 MsiCloseHandle(rec);
2636 return r;
2637}
2638
2640{
2642}
2643
2645 MSICOSTTREE cost_tree, INSTALLSTATE state, INT *cost)
2646{
2647 return MsiGetFeatureCostW(hinst, feature, cost_tree, state, cost);
2648}
2649
2652{
2653 DWORD size = 3;
2655}
2656
2659{
2661
2663 {
2664 if (!wcscmp( info->value, value )) return ERROR_SUCCESS;
2665 }
2666
2667 info = malloc(sizeof(MSISOURCELISTINFO));
2668 if (!info)
2669 return ERROR_OUTOFMEMORY;
2670
2671 info->context = context;
2672 info->options = options;
2673 info->property = property;
2674 info->value = wcsdup(value);
2675 list_add_head(&package->sourcelist_info, &info->entry);
2676
2677 return ERROR_SUCCESS;
2678}
2679
2681 DWORD disk_id, LPWSTR volume_label, LPWSTR disk_prompt)
2682{
2683 MSIMEDIADISK *disk;
2684
2686 {
2687 if (disk->disk_id == disk_id) return ERROR_SUCCESS;
2688 }
2689
2690 disk = malloc(sizeof(MSIMEDIADISK));
2691 if (!disk)
2692 return ERROR_OUTOFMEMORY;
2693
2694 disk->context = context;
2695 disk->options = options;
2696 disk->disk_id = disk_id;
2698 disk->disk_prompt = wcsdup(disk_prompt);
2699 list_add_head(&package->sourcelist_media, &disk->entry);
2700
2701 return ERROR_SUCCESS;
2702}
static struct recvd_message * sequence
Definition: SystemMenu.c:63
#define SDB_DATABASE_MAIN_SHIM
Definition: apphelp.h:24
#define HID_DOS_PATHS
Definition: apphelp.h:19
void WINAPI SdbReleaseDatabase(HSDB)
Definition: hsdb.c:423
HSDB WINAPI SdbInitDatabase(DWORD, LPCWSTR)
Definition: hsdb.c:375
static int state
Definition: maze.c:121
#define msg(x)
Definition: auth_time.c:54
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
static const WCHAR nameW[]
Definition: main.c:49
#define ARRAY_SIZE(A)
Definition: main.h:20
static void list_remove(struct list_entry *entry)
Definition: list.h:90
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
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:634
#define RegCloseKey(hKey)
Definition: registry.h:49
Definition: list.h:39
BOOL WINAPI GetComputerNameW(LPWSTR lpBuffer, LPDWORD lpnSize)
Definition: compname.c:446
HDC dc
Definition: cylfrac.c:34
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
HRESULT hr
Definition: delayimp.cpp:582
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define APPHELP_VALID_RESULT
Definition: apphelp.c:159
BOOL WINAPI ApphelpCheckRunAppEx(_In_ HANDLE FileHandle, _In_opt_ PVOID Unk1, _In_opt_ PVOID Unk2, _In_opt_z_ PCWSTR ApplicationName, _In_opt_ PVOID Environment, _In_opt_ USHORT ExeType, _Inout_opt_ PULONG Reason, _Out_opt_ PVOID *SdbQueryAppCompatData, _Out_opt_ PULONG SdbQueryAppCompatDataSize, _Out_opt_ PVOID *SxsData, _Out_opt_ PULONG SxsDataSize, _Out_opt_ PULONG FusionFlags, _Out_opt_ PULONG64 SomeFlag1, _Out_opt_ PULONG SomeFlag2)
Definition: apphelp.c:185
#define APPHELP_RESULT_FOUND
Definition: apphelp.c:161
NTSTATUS NTAPI RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation)
Definition: version.c:182
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3268
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
BOOL WINAPI LookupAccountNameW(LPCWSTR lpSystemName, LPCWSTR lpAccountName, PSID Sid, LPDWORD cbSid, LPWSTR ReferencedDomainName, LPDWORD cchReferencedDomainName, PSID_NAME_USE peUse)
Definition: misc.c:626
BOOL WINAPI GetUserNameW(LPWSTR lpszName, LPDWORD lpSize)
Definition: misc.c:291
BOOL WINAPI ConvertSidToStringSidW(PSID Sid, LPWSTR *StringSid)
Definition: security.c:3583
static LONG WINAPI rpc_filter(EXCEPTION_POINTERS *eptr)
Definition: rpc.c:184
static const WCHAR empty[1]
Definition: string.c:47
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:61
#define CloseHandle
Definition: compat.h:739
#define wcschr
Definition: compat.h:17
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:109
#define OPEN_EXISTING
Definition: compat.h:775
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define __TRY
Definition: compat.h:80
#define GetCurrentProcess()
Definition: compat.h:759
#define TRACE_ON(x)
Definition: compat.h:75
#define MAX_PATH
Definition: compat.h:34
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
#define CreateFileW
Definition: compat.h:741
#define IMAGE_FILE_MACHINE_ARM64
Definition: compat.h:129
#define __ENDTRY
Definition: compat.h:82
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define lstrcpyW
Definition: compat.h:749
#define WideCharToMultiByte
Definition: compat.h:111
#define lstrlenW
Definition: compat.h:750
static const WCHAR *const ext[]
Definition: module.c:53
static const WCHAR version[]
Definition: asmname.c:66
BOOL WINAPI CopyFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
Definition: copy.c:367
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 RemoveDirectoryW(IN LPCWSTR lpPathName)
Definition: dir.c:700
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:636
BOOL WINAPI SetFileAttributesW(LPCWSTR lpFileName, DWORD dwFileAttributes)
Definition: fileinfo.c:779
BOOL WINAPI WriteFile(_In_ HANDLE hFile, _In_reads_bytes_opt_(nNumberOfBytesToWrite) LPCVOID lpBuffer, _In_ DWORD nNumberOfBytesToWrite, _Out_opt_ LPDWORD lpNumberOfBytesWritten, _Inout_opt_ LPOVERLAPPED lpOverlapped)
Definition: rw.c:25
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
Definition: path.c:2098
UINT WINAPI GetSystemWow64DirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2439
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2331
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1164
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2370
VOID WINAPI GetNativeSystemInfo(IN LPSYSTEM_INFO lpSystemInfo)
Definition: sysinfo.c:207
LANGID WINAPI GetSystemDefaultLangID(void)
Definition: locale.c:1199
BOOL WINAPI IsValidLocale(LCID lcid, DWORD flags)
Definition: locale.c:2925
LANGID WINAPI GetUserDefaultLangID(void)
Definition: locale.c:1182
BOOL WINAPI UrlIsW(const WCHAR *url, URLIS Urlis)
Definition: path.c:4788
BOOL WINAPI DECLSPEC_HOTPATCH IsWow64Process2(HANDLE process, USHORT *machine, USHORT *native_machine)
Definition: process.c:1032
ULONG WINAPI DECLSPEC_HOTPATCH GetTickCount(void)
Definition: sync.c:182
BOOL WINAPI GetFileVersionInfoW(LPCWSTR filename, DWORD handle, DWORD datasize, LPVOID data)
Definition: version.c:967
BOOL WINAPI VerQueryValueW(LPCVOID pBlock, LPCWSTR lpSubBlock, LPVOID *lplpBuffer, PUINT puLen)
Definition: version.c:1171
DWORD WINAPI GetFileVersionInfoSizeW(LPCWSTR filename, LPDWORD handle)
Definition: version.c:738
UINT msi_set_context(MSIPACKAGE *package)
Definition: action.c:390
BOOL msi_is_global_assembly(MSICOMPONENT *comp)
Definition: action.c:2035
UINT msi_parse_command_line(MSIPACKAGE *package, LPCWSTR szCommandLine, BOOL preserve_case)
Definition: action.c:206
void custom_stop_server(HANDLE process, HANDLE pipe)
Definition: custom.c:681
UINT MSI_OpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIDATABASE **pdb)
Definition: database.c:140
HINSTANCE msi_hInstance
Definition: msi_main.c:51
void msi_event_cleanup_all_subscriptions(MSIPACKAGE *package)
Definition: dialog.c:4111
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
void msi_dialog_destroy(msi_dialog *dialog)
Definition: dialog.c:4059
DWORD deformat_string(MSIPACKAGE *package, const WCHAR *fmt, WCHAR **data)
Definition: format.c:1015
UINT WINAPI MsiFormatRecordW(MSIHANDLE hInstall, MSIHANDLE hRecord, WCHAR *szResult, DWORD *sz)
Definition: format.c:899
UINT MSI_FormatRecordW(MSIPACKAGE *package, MSIRECORD *record, LPWSTR buffer, LPDWORD size)
Definition: format.c:838
MSIHANDLE alloc_msihandle(MSIOBJECTHDR *obj)
Definition: handle.c:111
MSIHANDLE msi_get_remote(MSIHANDLE handle)
Definition: handle.c:183
void msiobj_addref(MSIOBJECTHDR *info)
Definition: handle.c:217
UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
Definition: handle.c:269
MSIHANDLE alloc_msi_remote_handle(MSIHANDLE remote)
Definition: handle.c:135
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:158
UINT msi_strncpyW(const WCHAR *str, int len, WCHAR *buf, DWORD *sz)
Definition: install.c:213
UINT WINAPI MsiDoActionW(MSIHANDLE hInstall, LPCWSTR szAction)
Definition: install.c:64
UINT WINAPI MsiSetComponentStateW(MSIHANDLE hInstall, LPCWSTR szComponent, INSTALLSTATE iState)
Definition: install.c:1465
UINT WINAPI MsiGetFeatureCostW(MSIHANDLE hInstall, const WCHAR *szFeature, MSICOSTTREE iCostTree, INSTALLSTATE iState, INT *piCost)
Definition: install.c:1209
LANGID WINAPI MsiGetLanguage(MSIHANDLE hInstall)
Definition: install.c:1543
UINT WINAPI MsiSetInstallLevel(MSIHANDLE hInstall, int iInstallLevel)
Definition: install.c:1599
UINT WINAPI MsiSetFeatureStateW(MSIHANDLE hInstall, LPCWSTR szFeature, INSTALLSTATE iState)
Definition: install.c:950
UINT WINAPI MsiSequenceW(MSIHANDLE hInstall, LPCWSTR szTable, INT iSequenceMode)
Definition: install.c:123
UINT msi_strncpyWtoA(const WCHAR *str, int lenW, char *buf, DWORD *sz, BOOL remote)
Definition: install.c:190
UINT WINAPI MsiGetTargetPathW(MSIHANDLE hinst, const WCHAR *folder, WCHAR *buf, DWORD *sz)
Definition: install.c:311
UINT WINAPI MsiGetFeatureStateW(MSIHANDLE hInstall, const WCHAR *szFeature, INSTALLSTATE *piInstalled, INSTALLSTATE *piAction)
Definition: install.c:1091
UINT WINAPI MsiGetSourcePathW(MSIHANDLE hinst, const WCHAR *folder, WCHAR *buf, DWORD *sz)
Definition: install.c:468
UINT WINAPI MsiSetTargetPathW(MSIHANDLE hInstall, LPCWSTR szFolder, LPCWSTR szFolderPath)
Definition: install.c:600
UINT WINAPI MsiGetComponentStateW(MSIHANDLE hInstall, const WCHAR *szComponent, INSTALLSTATE *piInstalled, INSTALLSTATE *piAction)
Definition: install.c:1503
UINT WINAPI MsiSetMode(MSIHANDLE hInstall, MSIRUNMODE iRunMode, BOOL fState)
Definition: install.c:763
BOOL WINAPI MsiGetMode(MSIHANDLE hInstall, MSIRUNMODE iRunMode)
Definition: install.c:670
UINT msi_locate_product(LPCWSTR szProduct, MSIINSTALLCONTEXT *context)
Definition: msi.c:54
UINT WINAPI MsiEnumComponentCostsW(MSIHANDLE handle, const WCHAR *component, DWORD index, INSTALLSTATE state, WCHAR *drive, DWORD *buflen, int *cost, int *temp)
Definition: msi.c:1962
INSTALLSTATE WINAPI MsiQueryProductStateW(LPCWSTR szProduct)
Definition: msi.c:2223
UINT __cdecl s_remote_SetInstallLevel(MSIHANDLE hinst, int level)
Definition: package.c:2608
UINT __cdecl s_remote_GetFeatureState(MSIHANDLE hinst, LPCWSTR feature, INSTALLSTATE *installed, INSTALLSTATE *action)
Definition: package.c:2581
UINT __cdecl s_remote_Sequence(MSIHANDLE hinst, LPCWSTR table, int sequence)
Definition: package.c:2527
static LPCWSTR get_internal_error_message(int error)
Definition: package.c:1834
UINT WINAPI MsiOpenPackageA(LPCSTR szPackage, MSIHANDLE *phPackage)
Definition: package.c:1696
static UINT set_user_sid_prop(MSIPACKAGE *package)
Definition: package.c:473
INT MSI_ProcessMessageVerbatim(MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record)
Definition: package.c:1875
UINT msi_set_property(MSIDATABASE *db, const WCHAR *name, const WCHAR *value, int len)
Definition: package.c:2132
static void set_msi_assembly_prop(MSIPACKAGE *package)
Definition: package.c:588
static void free_package_structures(MSIPACKAGE *package)
Definition: package.c:148
UINT WINAPI MsiSetPropertyA(MSIHANDLE hInstall, LPCSTR szName, LPCSTR szValue)
Definition: package.c:2099
static UINT validate_package(MSIPACKAGE *package)
Definition: package.c:1214
const WCHAR * text
Definition: package.c:1826
UINT WINAPI MsiOpenPackageExA(LPCSTR szPackage, DWORD dwOptions, MSIHANDLE *phPackage)
Definition: package.c:1677
UINT __cdecl s_remote_EnumComponentCosts(MSIHANDLE hinst, LPCWSTR component, DWORD index, INSTALLSTATE state, LPWSTR drive, INT *cost, INT *temp)
Definition: package.c:2650
UINT __cdecl s_remote_GetTargetPath(MSIHANDLE hinst, LPCWSTR folder, LPWSTR *value)
Definition: package.c:2532
UINT __cdecl s_remote_SetMode(MSIHANDLE hinst, MSIRUNMODE mode, BOOL state)
Definition: package.c:2576
UINT msi_download_file(LPCWSTR szUrl, LPWSTR filename)
Definition: package.c:1030
static void free_folder(MSIFOLDER *folder)
Definition: package.c:86
MSIHANDLE WINAPI MsiGetActiveDatabase(MSIHANDLE hInstall)
Definition: package.c:1701
static BOOL validate_package_platform(enum platform platform)
Definition: package.c:1172
INT MSI_ProcessMessage(MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record)
Definition: package.c:1941
LPWSTR msi_get_error_message(MSIDATABASE *db, int error)
Definition: package.c:1850
MSIHANDLE __cdecl s_remote_GetActiveDatabase(MSIHANDLE hinst)
Definition: package.c:2479
UINT __cdecl s_remote_FormatRecord(MSIHANDLE hinst, struct wire_record *remote_rec, LPWSTR *value)
Definition: package.c:2613
static enum platform parse_platform(const WCHAR *str)
Definition: package.c:1096
int id
Definition: package.c:1825
UINT WINAPI MsiOpenPackageW(LPCWSTR szPackage, MSIHANDLE *phPackage)
Definition: package.c:1672
UINT WINAPI MsiGetPropertyW(MSIHANDLE hinst, const WCHAR *name, WCHAR *buf, DWORD *sz)
Definition: package.c:2417
static VOID set_installer_properties(MSIPACKAGE *package)
Definition: package.c:631
static void MSI_FreePackage(MSIOBJECTHDR *arg)
Definition: package.c:339
void msi_adjust_privilege_properties(MSIPACKAGE *package)
Definition: package.c:967
static LPWSTR get_fusion_filename(MSIPACKAGE *package)
Definition: package.c:521
static UINT create_temp_property_table(MSIPACKAGE *package)
Definition: package.c:365
static UINT get_local_package(MSIDATABASE *db, WCHAR *localfile)
Definition: package.c:1330
static WCHAR * get_product_version(MSIDATABASE *db)
Definition: package.c:1279
UINT __cdecl s_remote_SetTargetPath(MSIHANDLE hinst, LPCWSTR folder, LPCWSTR value)
Definition: package.c:2549
UINT msi_clone_properties(MSIDATABASE *db)
Definition: package.c:381
static UINT get_registered_local_package(const WCHAR *product, WCHAR *localfile)
Definition: package.c:1284
static UINT parse_suminfo(MSISUMMARYINFO *si, MSIPACKAGE *package)
Definition: package.c:1106
static INT internal_ui_handler(MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record, LPCWSTR message)
Definition: package.c:1732
static MSIRECORD * get_property_row(MSIDATABASE *db, const WCHAR *name)
Definition: package.c:2215
UINT msi_set_original_database_property(MSIDATABASE *db, const WCHAR *package)
Definition: package.c:1342
UINT __cdecl s_remote_SetComponentState(MSIHANDLE hinst, LPCWSTR component, INSTALLSTATE state)
Definition: package.c:2598
static UINT load_admin_properties(MSIPACKAGE *package)
Definition: package.c:952
WCHAR * msi_get_package_code(MSIDATABASE *db)
Definition: package.c:1309
MSIPACKAGE * MSI_CreatePackage(MSIDATABASE *db)
Definition: package.c:981
static WCHAR * get_product_code(MSIDATABASE *db)
Definition: package.c:1274
static void free_extension(MSIEXTENSION *ext)
Definition: package.c:106
UINT __cdecl s_remote_SetFeatureState(MSIHANDLE hinst, LPCWSTR feature, INSTALLSTATE state)
Definition: package.c:2587
UINT WINAPI MsiOpenPackageExW(const WCHAR *szPackage, DWORD dwOptions, MSIHANDLE *phPackage)
Definition: package.c:1639
LANGID __cdecl s_remote_GetLanguage(MSIHANDLE hinst)
Definition: package.c:2603
UINT __cdecl s_remote_GetFeatureCost(MSIHANDLE hinst, LPCWSTR feature, MSICOSTTREE cost_tree, INSTALLSTATE state, INT *cost)
Definition: package.c:2644
static void free_feature(MSIFEATURE *feature)
Definition: package.c:61
BOOL __cdecl s_remote_GetMode(MSIHANDLE hinst, MSIRUNMODE mode)
Definition: package.c:2571
static MSIPACKAGE * alloc_package(void)
Definition: package.c:920
void msi_free_action_script(MSIPACKAGE *package, UINT script)
Definition: package.c:137
static UINT set_installed_prop(MSIPACKAGE *package)
Definition: package.c:457
UINT WINAPI MsiSetPropertyW(MSIHANDLE hInstall, LPCWSTR szName, LPCWSTR szValue)
Definition: package.c:2181
UINT __cdecl s_remote_GetProperty(MSIHANDLE hinst, LPCWSTR property, LPWSTR *value, DWORD *size)
Definition: package.c:2484
LPWSTR msi_dup_property(MSIDATABASE *db, LPCWSTR prop)
Definition: package.c:2315
UINT __cdecl s_remote_SetProperty(MSIHANDLE hinst, LPCWSTR property, LPCWSTR value)
Definition: package.c:2502
int __cdecl s_remote_ProcessMessage(MSIHANDLE hinst, INSTALLMESSAGE message, struct wire_record *remote_rec)
Definition: package.c:2507
static WCHAR * get_property(MSIDATABASE *db, const WCHAR *prop)
Definition: package.c:1246
UINT __cdecl s_remote_GetSourcePath(MSIHANDLE hinst, LPCWSTR folder, LPWSTR *value)
Definition: package.c:2554
UINT __cdecl s_remote_GetComponentState(MSIHANDLE hinst, LPCWSTR component, INSTALLSTATE *installed, INSTALLSTATE *action)
Definition: package.c:2592
static const struct @619 internal_errors[]
UINT WINAPI MsiGetPropertyA(MSIHANDLE hinst, const char *name, char *buf, DWORD *sz)
Definition: package.c:2345
UINT __cdecl s_remote_DoAction(MSIHANDLE hinst, LPCWSTR action)
Definition: package.c:2522
UINT msi_create_empty_local_file(LPWSTR path, LPCWSTR suffix)
Definition: package.c:1066
UINT MSI_OpenPackageW(LPCWSTR szPackage, DWORD dwOptions, MSIPACKAGE **pPackage)
Definition: package.c:1416
static void free_assembly(MSIASSEMBLY *assembly)
Definition: package.c:126
INT WINAPI MsiProcessMessage(MSIHANDLE hInstall, INSTALLMESSAGE eMessageType, MSIHANDLE hRecord)
Definition: package.c:2049
int msi_get_property_int(MSIDATABASE *db, LPCWSTR prop, int def)
Definition: package.c:2337
MSICONDITION __cdecl s_remote_EvaluateCondition(MSIHANDLE hinst, LPCWSTR condition)
Definition: package.c:2639
int WINAPI MsiRecordGetInteger(MSIHANDLE handle, UINT iField)
Definition: record.c:237
UINT WINAPI MsiEnumPatchesExW(const WCHAR *szProductCode, const WCHAR *szUserSid, DWORD dwContext, DWORD dwFilter, DWORD dwIndex, WCHAR *szPatchCode, WCHAR *szTargetProductCode, MSIINSTALLCONTEXT *pdwTargetProductContext, WCHAR *szTargetUserSid, DWORD *pcchTargetUserSid)
Definition: registry.c:1950
#define MSIERR_INSTALLERROR
Definition: resource.h:21
#define MSIERR_ACTIONSTART
Definition: resource.h:22
#define IDS_ERROR_BASE
Definition: resource.h:33
#define MSIERR_INFO_LOGGINGSTART
Definition: resource.h:24
#define MSIERR_COMMONDATA
Definition: resource.h:23
#define __cdecl
Definition: corecrt.h:121
_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
static wchar_t * wcsdup(const wchar_t *str)
Definition: string.h:94
HRESULT WINAPI SHGetFolderPathW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
Definition: shellpath.c:2717
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
#define swprintf
Definition: precomp.h:40
BOOL WINAPI GetUrlCacheEntryInfoW(LPCWSTR lpszUrl, LPINTERNET_CACHE_ENTRY_INFOW lpCacheEntryInfo, LPDWORD lpdwCacheEntryInfoBufferSize)
Definition: urlcache.c:2012
return ret
Definition: mutex.c:147
action
Definition: namespace.c:707
#define L(x)
Definition: resources.c:13
#define progid(str)
Definition: exdisp.idl:31
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
Definition: fltkernel.h:1231
ULONG Handle
Definition: gdb_input.c:15
GLint level
Definition: gl.h:1546
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLuint GLuint end
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
GLuint res
Definition: glext.h:9613
GLuint buffer
Definition: glext.h:5915
GLsizeiptr size
Definition: glext.h:5919
GLintptr offset
Definition: glext.h:5920
GLenum condition
Definition: glext.h:9255
GLuint index
Definition: glext.h:6031
GLenum mode
Definition: glext.h:6217
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLbitfield flags
Definition: glext.h:7161
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
GLuint GLfloat * val
Definition: glext.h:7180
GLfloat GLfloat p
Definition: glext.h:8902
const GLuint GLenum const GLvoid * binary
Definition: glext.h:7538
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
unsigned int UINT
Definition: sysinfo.c:13
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
BOOL NTAPI GlobalMemoryStatusEx(LPMEMORYSTATUSEX lpBuffer)
Definition: heapmem.c:1272
const char cursor[]
Definition: icontest.c:13
#define GetExceptionCode
Definition: excpt.h:83
#define FAILED(hr)
Definition: intsafe.h:51
const char * filename
Definition: ioapi.h:137
uint32_t entry
Definition: isohybrid.c:63
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_wn
Definition: kernel32.h:33
#define debugstr_w
Definition: kernel32.h:32
BOOL is_wow64
Definition: main.c:38
INT WINAPI GetTimeFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpTimeStr, INT cchOut)
Definition: lcformat.c:1101
INT WINAPI GetDateFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpDateStr, INT cchOut)
Definition: lcformat.c:1001
static IN LPSTR IN PVOID Unk2
Definition: ldrinit.c:47
static IN LPSTR Unk1
Definition: ldrinit.c:47
USHORT LANGID
Definition: mui.h:9
enum _SID_NAME_USE SID_NAME_USE
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
__u16 time
Definition: mkdosfs.c:8
__u8 volume_label[11]
Definition: mkdosfs.c:4
#define error(str)
Definition: mkdosfs.c:1605
char * appid
Definition: mkisofs.c:161
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define CREATE_NEW
Definition: disk.h:69
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
unsigned __int64 * PULONG64
Definition: imports.h:198
PVOID PVOID PWCHAR PVOID USHORT PULONG PVOID PULONG PVOID PULONG PULONG PULONG64 PULONG SomeFlag2
Definition: env.c:49
LPCWSTR LPCWSTR LPCWSTR DWORD PSDBQUERYRESULT_VISTA pQueryResult
Definition: env.c:37
PVOID PVOID PWCHAR PVOID USHORT ExeType
Definition: env.c:47
PVOID PVOID PWCHAR PVOID USHORT PULONG Reason
Definition: env.c:47
PVOID PVOID PWCHAR PVOID USHORT PULONG PVOID * SdbQueryAppCompatData
Definition: env.c:48
PVOID PVOID PWCHAR PVOID USHORT PULONG PVOID PULONG PVOID PULONG SxsDataSize
Definition: env.c:48
PVOID PVOID PWCHAR PVOID USHORT PULONG PVOID PULONG PVOID PULONG PULONG PULONG64 SomeFlag1
Definition: env.c:49
PVOID PVOID PWCHAR PVOID USHORT PULONG PVOID PULONG PVOID * SxsData
Definition: env.c:48
PVOID PVOID PWCHAR PVOID USHORT PULONG PVOID PULONG PVOID PULONG PULONG FusionFlags
Definition: env.c:49
PVOID PVOID PWCHAR PVOID Environment
Definition: env.c:47
PVOID PVOID PWCHAR PVOID USHORT PULONG PVOID PULONG SdbQueryAppCompatDataSize
Definition: env.c:48
PVOID PVOID PWCHAR ApplicationName
Definition: env.c:47
static PVOID ptr
Definition: dispmode.c:27
static HINSTANCE hinst
Definition: edit.c:551
static HDC
Definition: imagelist.c:88
static void translate(POINT *pt, UINT count, const XFORM *xform)
Definition: metafile.c:8268
static SYSTEM_INFO si
Definition: virtual.c:39
#define PID_TEMPLATE
Definition: suminfo.c:49
#define PID_PAGECOUNT
Definition: suminfo.c:56
#define PID_REVNUMBER
Definition: suminfo.c:51
static WCHAR user_name[UNLEN+1]
Definition: access.c:32
static USHORT native_machine
Definition: wow64.c:92
INTERNETFEATURELIST feature
Definition: misc.c:1807
static HWND dialog
Definition: gui.c:33
static WCHAR username[]
Definition: url.c:32
LANGID langid
Definition: msctf.idl:626
static HRESULT read_stream_data(nsChannelBSC *This, IStream *stream)
Definition: navigate.c:960
void msi_destroy_assembly_caches(MSIPACKAGE *package)
Definition: assembly.c:89
@ MSIPATCHSTATE_APPLIED
Definition: msi.h:54
enum tagMSIINSTALLCONTEXT MSIINSTALLCONTEXT
static const WCHAR INSTALLPROPERTY_LOCALPACKAGEW[]
Definition: msi.h:343
static const WCHAR INSTALLPROPERTY_PRODUCTNAMEW[]
Definition: msi.h:277
@ INSTALLMESSAGE_WARNING
Definition: msi.h:96
@ INSTALLMESSAGE_ACTIONSTART
Definition: msi.h:102
@ INSTALLMESSAGE_ERROR
Definition: msi.h:95
@ INSTALLMESSAGE_USER
Definition: msi.h:97
@ INSTALLMESSAGE_PROGRESS
Definition: msi.h:104
@ INSTALLMESSAGE_TERMINATE
Definition: msi.h:107
@ INSTALLMESSAGE_ACTIONDATA
Definition: msi.h:103
@ INSTALLMESSAGE_COMMONDATA
Definition: msi.h:105
@ INSTALLMESSAGE_OUTOFDISKSPACE
Definition: msi.h:101
@ INSTALLMESSAGE_INFO
Definition: msi.h:98
@ INSTALLMESSAGE_FATALEXIT
Definition: msi.h:94
@ INSTALLMESSAGE_INITIALIZE
Definition: msi.h:106
@ INSTALLMESSAGE_INSTALLSTART
Definition: msi.h:110
@ INSTALLMESSAGE_SHOWDIALOG
Definition: msi.h:108
@ INSTALLMESSAGE_INSTALLEND
Definition: msi.h:111
@ INSTALLUILEVEL_NONE
Definition: msi.h:66
@ INSTALLUILEVEL_PROGRESSONLY
Definition: msi.h:71
WCHAR * gszLogFile
Definition: msi_main.c:50
INSTALLUI_HANDLERA gUIHandlerA
Definition: msi_main.c:43
DWORD gUIFilter
Definition: msi_main.c:46
LPVOID gUIContextRecord
Definition: msi_main.c:49
DWORD gUIFilterRecord
Definition: msi_main.c:47
INSTALLUILEVEL gUILevel
Definition: msi_main.c:41
LPVOID gUIContext
Definition: msi_main.c:48
HWND gUIhwnd
Definition: msi_main.c:42
INSTALLUI_HANDLER_RECORD gUIHandlerRecord
Definition: msi_main.c:45
INSTALLUI_HANDLERW gUIHandlerW
Definition: msi_main.c:44
@ msidbSumInfoSourceTypeAdminImage
Definition: msidefs.h:223
int MSI_RecordGetInteger(MSIRECORD *, UINT)
Definition: record.c:213
UINT MSI_ViewExecute(MSIQUERY *, MSIRECORD *)
Definition: msiquery.c:498
static const BOOL is_64bit
Definition: msipriv.h:44
void dump_record(MSIRECORD *)
Definition: record.c:1028
#define MSIHANDLETYPE_DATABASE
Definition: msipriv.h:746
#define INSTALLUILEVEL_MASK
Definition: msipriv.h:60
UINT msi_record_set_string(MSIRECORD *, UINT, const WCHAR *, int)
Definition: record.c:573
UINT msi_get_string_table_codepage(const string_table *st)
Definition: string.c:671
UINT msi_clone_properties(MSIDATABASE *)
Definition: package.c:381
void msi_reset_source_folders(MSIPACKAGE *package)
Definition: package.c:2121
const WCHAR * msi_record_get_string(const MSIRECORD *, UINT, int *)
Definition: record.c:420
WCHAR * msi_dup_record_field(MSIRECORD *row, INT index) __WINE_DEALLOC(free) __WINE_MALLOC
Definition: record.c:1002
#define MSIHANDLETYPE_RECORD
Definition: msipriv.h:749
UINT MSI_RecordSetInteger(MSIRECORD *, UINT, int)
Definition: record.c:280
WCHAR * msi_get_error_message(MSIDATABASE *, int) __WINE_DEALLOC(free) __WINE_MALLOC
Definition: package.c:1850
UINT MSIREG_OpenInstallProps(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, LPCWSTR szUserSid, HKEY *key, BOOL create)
Definition: registry.c:692
script
Definition: msipriv.h:396
@ SCRIPT_NONE
Definition: msipriv.h:397
@ SCRIPT_MAX
Definition: msipriv.h:401
#define GUID_SIZE
Definition: msipriv.h:757
UINT MSI_ViewClose(MSIQUERY *)
Definition: msiquery.c:450
int msi_get_property_int(MSIDATABASE *package, LPCWSTR prop, int def)
Definition: package.c:2337
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **)
INT MSI_ProcessMessageVerbatim(MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *)
Definition: package.c:1875
UINT msi_package_add_media_disk(MSIPACKAGE *, DWORD, DWORD, DWORD, LPWSTR, LPWSTR)
Definition: package.c:2680
UINT MSIREG_OpenUninstallKey(const WCHAR *, enum platform, HKEY *, BOOL)
UINT msi_apply_registered_patch(MSIPACKAGE *package, LPCWSTR patch_code)
Definition: patch.c:990
UINT msi_set_original_database_property(MSIDATABASE *, const WCHAR *)
Definition: package.c:1342
const WCHAR * MSI_RecordGetString(const MSIRECORD *, UINT)
Definition: record.c:433
UINT msi_load_suminfo_properties(MSIPACKAGE *package)
Definition: suminfo.c:1266
INT msi_suminfo_get_int32(MSISUMMARYINFO *si, UINT uiProperty)
Definition: suminfo.c:712
UINT msi_get_db_suminfo(MSIDATABASE *db, UINT uiUpdateCount, MSISUMMARYINFO **si)
Definition: suminfo.c:491
void msi_free_patchinfo(MSIPATCHINFO *patch)
Definition: patch.c:865
UINT msi_set_property(MSIDATABASE *, const WCHAR *, const WCHAR *, int)
Definition: package.c:2132
MSIRECORD *WINAPIV MSI_QueryGetRecord(MSIDATABASE *db, LPCWSTR query,...)
Definition: msiquery.c:201
UINT msi_get_property(MSIDATABASE *, LPCWSTR, LPWSTR, LPDWORD)
Definition: package.c:2282
#define WINE_OPENPACKAGEFLAGS_RECACHE
Definition: msipriv.h:908
BOOL MSI_RecordIsNull(MSIRECORD *, UINT)
Definition: record.c:321
UINT MSI_RecordCopyField(MSIRECORD *, UINT, MSIRECORD *, UINT)
Definition: record.c:166
INT MSI_ProcessMessage(MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *)
Definition: package.c:1941
UINT MSI_ViewFetch(MSIQUERY *, MSIRECORD **)
Definition: msiquery.c:373
WCHAR * msi_dup_property(MSIDATABASE *db, const WCHAR *prop) __WINE_DEALLOC(free) __WINE_MALLOC
#define MSI_MINORVERSION
Definition: msipriv.h:754
UINT MSI_RecordSetStringW(MSIRECORD *, UINT, LPCWSTR)
Definition: record.c:597
MSIRECORD * MSI_CreateRecord(UINT)
Definition: record.c:76
platform
Definition: msipriv.h:364
@ PLATFORM_X64
Definition: msipriv.h:368
@ PLATFORM_UNRECOGNIZED
Definition: msipriv.h:365
@ PLATFORM_INTEL64
Definition: msipriv.h:367
@ PLATFORM_INTEL
Definition: msipriv.h:366
@ PLATFORM_ARM
Definition: msipriv.h:369
@ PLATFORM_ARM64
Definition: msipriv.h:370
UINT msi_get_suminfo(IStorage *stg, UINT uiUpdateCount, MSISUMMARYINFO **si)
Definition: suminfo.c:461
#define MSI_MAJORVERSION
Definition: msipriv.h:753
UINT MSI_OpenPackageW(LPCWSTR szPackage, DWORD dwOptions, MSIPACKAGE **pPackage)
Definition: package.c:1416
UINT unmarshal_record(const struct wire_record *in, MSIHANDLE *out)
Definition: record.c:1095
void msi_adjust_privilege_properties(MSIPACKAGE *)
Definition: package.c:967
WCHAR * msi_reg_get_val_str(HKEY hkey, const WCHAR *name) __WINE_DEALLOC(free) __WINE_MALLOC
UINT msi_package_add_info(MSIPACKAGE *, DWORD, DWORD, LPCWSTR, LPWSTR)
Definition: package.c:2657
UINT MSI_RecordGetStringW(MSIRECORD *, UINT, LPWSTR, LPDWORD)
WCHAR * msi_suminfo_dup_string(MSISUMMARYINFO *si, UINT property) __WINE_DEALLOC(free) __WINE_MALLOC
Definition: suminfo.c:700
MSICONDITION WINAPI MsiEvaluateConditionW(MSIHANDLE, LPCWSTR)
#define MSIDBOPEN_TRANSACT
Definition: msiquery.h:67
#define MSI_NULL_INTEGER
Definition: msiquery.h:32
#define MSIDBOPEN_READONLY
Definition: msiquery.h:66
#define PROCESSOR_ARCHITECTURE_AMD64
Definition: ketypes.h:114
#define PROCESSOR_ARCHITECTURE_INTEL
Definition: ketypes.h:105
#define VER_PLATFORM_WIN32_NT
Definition: rtltypes.h:246
#define VER_PLATFORM_WIN32_WINDOWS
Definition: rtltypes.h:245
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
#define KEY_CREATE_SUB_KEY
Definition: nt_native.h:1021
#define KEY_QUERY_VALUE
Definition: nt_native.h:1019
#define GENERIC_WRITE
Definition: nt_native.h:90
#define LOCALE_USER_DEFAULT
#define IMAGE_FILE_MACHINE_ARM
Definition: ntimage.h:18
#define IMAGE_FILE_MACHINE_AMD64
Definition: ntimage.h:17
#define PathAddBackslashW
Definition: pathcch.h:302
#define IMAGE_FILE_MACHINE_I386
Definition: pedump.c:174
short WCHAR
Definition: pedump.c:58
long LONG
Definition: pedump.c:60
unsigned short USHORT
Definition: pedump.c:61
static const WCHAR szName[]
Definition: powrprof.c:45
@ URLIS_URL
Definition: shlwapi.h:597
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define MB_ICONHAND
Definition: winuser.h:799
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define MB_ICONMASK
Definition: winuser.h:830
HDC WINAPI GetDC(_In_opt_ HWND)
#define MB_ICONEXCLAMATION
Definition: winuser.h:796
#define MB_USERICON
Definition: winuser.h:794
#define MB_ICONASTERISK
Definition: winuser.h:795
#define calloc
Definition: rosglue.h:14
RPC_STATUS WINAPI RpcBindingFree(RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:769
RPC_STATUS WINAPI RpcServerUnregisterIf(RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, UINT WaitForCallsToComplete)
Definition: rpc_server.c:1202
const WCHAR * str
static calc_node_t temp
Definition: rpn_ieee.c:38
#define LANG_NEUTRAL
Definition: nls.h:22
#define MAKELANGID(p, s)
Definition: nls.h:15
#define SUBLANGID(l)
Definition: nls.h:17
#define SUBLANG_NEUTRAL
Definition: nls.h:167
#define PRIMARYLANGID(l)
Definition: nls.h:16
#define midl_user_free
Definition: rpc.h:41
#define midl_user_allocate
Definition: rpc.h:40
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:236
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list)
Definition: list.h:230
#define LoadStringW
Definition: utils.h:64
BOOL WINAPI SE_DynamicShim(LPCWSTR ProcessImage, HSDB hsdb, PVOID pQueryResult, LPCSTR Module, LPDWORD lpdwDynamicToken)
Definition: shimeng.c:1520
#define CSIDL_TEMPLATES
Definition: shlobj.h:2211
#define CSIDL_SENDTO
Definition: shlobj.h:2200
#define CSIDL_RECENT
Definition: shlobj.h:2199
#define CSIDL_ADMINTOOLS
Definition: shlobj.h:2238
#define CSIDL_FONTS
Definition: shlobj.h:2210
#define CSIDL_PERSONAL
Definition: shlobj.h:2196
#define CSIDL_FAVORITES
Definition: shlobj.h:2197
#define CSIDL_COMMON_APPDATA
Definition: shlobj.h:2225
#define CSIDL_MYPICTURES
Definition: shlobj.h:2229
#define CSIDL_SYSTEM
Definition: shlobj.h:2227
#define CSIDL_LOCAL_APPDATA
Definition: shlobj.h:2218
#define CSIDL_DESKTOP
Definition: shlobj.h:2191
#define CSIDL_STARTMENU
Definition: shlobj.h:2202
#define CSIDL_PROGRAMS
Definition: shlobj.h:2193
#define CSIDL_APPDATA
Definition: shlobj.h:2216
#define CSIDL_PRINTHOOD
Definition: shlobj.h:2217
#define CSIDL_STARTUP
Definition: shlobj.h:2198
#define CSIDL_WINDOWS
Definition: shlobj.h:2226
#define CSIDL_NETHOOD
Definition: shlobj.h:2209
#define TRACE(s)
Definition: solgame.cpp:4
DWORD dwOptions
Definition: solitaire.cpp:25
Definition: wininet.h:2127
ULONG dwMajorVersion
Definition: rtltypes.h:270
ULONG dwMinorVersion
Definition: rtltypes.h:271
ULONG dwOSVersionInfoSize
Definition: rtltypes.h:269
ULONG dwPlatformId
Definition: rtltypes.h:273
UCHAR wProductType
Definition: rtltypes.h:278
ULONG dwBuildNumber
Definition: rtltypes.h:272
USHORT wServicePackMajor
Definition: rtltypes.h:275
WORD wProcessorLevel
Definition: winbase.h:903
WORD wProcessorArchitecture
Definition: winbase.h:892
struct file_info manifest
Definition: actctx.c:555
Definition: svc_auth_des.c:77
Definition: http.c:7252
struct list entry
Definition: wpp.c:51
Definition: fci.c:123
struct list entry
Definition: fci.c:124
Definition: fci.c:112
struct list entry
Definition: fci.c:113
WORD wLanguage
Definition: package.c:584
WORD wCodePage
Definition: package.c:585
Definition: tftpd.h:60
Definition: name.c:39
struct list entry
Definition: msipriv.h:567
struct list entry
Definition: msipriv.h:192
IStorage * storage
Definition: msipriv.h:194
LPWSTR clsid
Definition: msipriv.h:666
LPWSTR IconPath
Definition: msipriv.h:674
LPWSTR Argument
Definition: msipriv.h:677
LPWSTR ProgIDText
Definition: msipriv.h:670
LPWSTR DefInprocHandler
Definition: msipriv.h:675
LPWSTR FileTypeMask
Definition: msipriv.h:673
struct list entry
Definition: msipriv.h:665
LPWSTR Description
Definition: msipriv.h:671
LPWSTR DefInprocHandler32
Definition: msipriv.h:676
LPWSTR Context
Definition: msipriv.h:667
LPWSTR Component
Definition: msipriv.h:538
LPWSTR ComponentId
Definition: msipriv.h:539
MSIASSEMBLY * assembly
Definition: msipriv.h:554
struct list entry
Definition: msipriv.h:537
LPWSTR KeyPath
Definition: msipriv.h:543
LPWSTR Condition
Definition: msipriv.h:542
LPWSTR Directory
Definition: msipriv.h:540
LPWSTR FullKeypath
Definition: msipriv.h:552
MSIOBJECTHDR hdr
Definition: msipriv.h:108
IStorage * storage
Definition: msipriv.h:109
string_table * strings
Definition: msipriv.h:110
LPWSTR path
Definition: msipriv.h:112
WCHAR * path
Definition: msipriv.h:646
struct list entry
Definition: msipriv.h:639
DWORD context
Definition: msipriv.h:169
DWORD options
Definition: msipriv.h:170
LPWSTR volume_label
Definition: msipriv.h:172
struct list entry
Definition: msipriv.h:168
LPWSTR disk_prompt
Definition: msipriv.h:173
DWORD disk_id
Definition: msipriv.h:171
LPWSTR ContentType
Definition: msipriv.h:725
LPWSTR clsid
Definition: msipriv.h:728
struct list entry
Definition: msipriv.h:724
LPWSTR suffix
Definition: msipriv.h:727
int unique_actions_count
Definition: msipriv.h:450
struct list progids
Definition: msipriv.h:442
struct list subscriptions
Definition: msipriv.h:475
BOOL delete_on_close
Definition: msipriv.h:464
UINT WordCount
Definition: msipriv.h:472
struct list drlocators
Definition: msipriv.h:422
struct list classes
Definition: msipriv.h:440
LPWSTR LastAction
Definition: msipriv.h:424
struct list RunningActions
Definition: msipriv.h:454
struct list appids
Definition: msipriv.h:444
struct list features
Definition: msipriv.h:415
MSIOBJECTHDR hdr
Definition: msipriv.h:406
struct list files
Definition: msipriv.h:416
MSIDATABASE * db
Definition: msipriv.h:407
enum platform platform
Definition: msipriv.h:409
struct list cabinet_streams
Definition: msipriv.h:421
struct list extensions
Definition: msipriv.h:441
struct list folders
Definition: msipriv.h:419
UINT num_langids
Definition: msipriv.h:410
LPWSTR * unique_actions
Definition: msipriv.h:449
struct list components
Definition: msipriv.h:414
LPWSTR ProductCode
Definition: msipriv.h:462
LPWSTR PackagePath
Definition: msipriv.h:461
struct list mimes
Definition: msipriv.h:443
INSTALLUILEVEL ui_level
Definition: msipriv.h:466
UINT action_progress_increment
Definition: msipriv.h:427
struct list sourcelist_media
Definition: msipriv.h:478
LANGID * langids
Definition: msipriv.h:411
HANDLE log_file
Definition: msipriv.h:428
enum script script
Definition: msipriv.h:446
MSIINSTALLCONTEXT Context
Definition: msipriv.h:473
LPWSTR LastActionTemplate
Definition: msipriv.h:425
struct list filepatches
Definition: msipriv.h:417
LPWSTR * script_actions[SCRIPT_MAX]
Definition: msipriv.h:447
LPWSTR localfile
Definition: msipriv.h:463
UINT LastActionResult
Definition: msipriv.h:426
struct list patches
Definition: msipriv.h:413
struct list binaries
Definition: msipriv.h:420
LPWSTR ActionFormat
Definition: msipriv.h:423
struct list tempfiles
Definition: msipriv.h:418
int script_actions_count[SCRIPT_MAX]
Definition: msipriv.h:448
struct list sourcelist_info
Definition: msipriv.h:477
struct list entry
Definition: msipriv.h:200
LPWSTR localfile
Definition: msipriv.h:205
BOOL delete_on_close
Definition: msipriv.h:208
MSIOBJECTHDR hdr
Definition: msipriv.h:129
MSIOBJECTHDR hdr
Definition: msipriv.h:151
LPWSTR Command
Definition: msipriv.h:718
struct list entry
Definition: msipriv.h:715
LPWSTR Argument
Definition: msipriv.h:719
LPWSTR Verb
Definition: msipriv.h:716
#define LIST_ENTRY(type)
Definition: queue.h:175
const char * LPCSTR
Definition: typedefs.h:52
uint32_t * PULONG
Definition: typedefs.h:59
const uint16_t * PCWSTR
Definition: typedefs.h:57
const uint16_t * LPCWSTR
Definition: typedefs.h:57
uint16_t * LPWSTR
Definition: typedefs.h:56
uint32_t * LPDWORD
Definition: typedefs.h:59
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG
Definition: typedefs.h:59
HRESULT WINAPI URLDownloadToCacheFileW(LPUNKNOWN lpUnkCaller, LPCWSTR szURL, LPWSTR szFileName, DWORD dwBufLength, DWORD dwReserved, LPBINDSTATUSCALLBACK pBSC)
Definition: umon.c:868
Definition: pdh_main.c:64
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
_In_ FLONG fl
Definition: winddi.h:1279
#define WINAPI
Definition: msvc.h:6
#define __EXCEPT(func)
Definition: exception.h:62
int MSIRUNMODE
Definition: winemsi.idl:30
int MSICOSTTREE
Definition: winemsi.idl:34
int MSICONDITION
Definition: winemsi.idl:29
unsigned long MSIHANDLE
Definition: winemsi.idl:27
int INSTALLSTATE
Definition: winemsi.idl:31
int INSTALLMESSAGE
Definition: winemsi.idl:28
#define ERROR_BUFFER_OVERFLOW
Definition: winerror.h:307
#define ERROR_INSTALL_PACKAGE_INVALID
Definition: winerror.h:1326
#define ERROR_SHARING_VIOLATION
Definition: winerror.h:257
#define ERROR_PRODUCT_VERSION
Definition: winerror.h:1344
#define ERROR_FILE_EXISTS
Definition: winerror.h:287
#define ERROR_INSTALL_PLATFORM_UNSUPPORTED
Definition: winerror.h:1339
#define ERROR_INSTALL_LANGUAGE_UNSUPPORTED
Definition: winerror.h:1329
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:1333
#define HORZRES
Definition: wingdi.h:716
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define VERTRES
Definition: wingdi.h:717
#define BITSPIXEL
Definition: wingdi.h:720
#define LCID_INSTALLED
Definition: winnls.h:224
#define TIME_NOTIMEMARKER
Definition: winnls.h:307
#define DATE_SHORTDATE
Definition: winnls.h:216
#define PROCESSOR_ARCHITECTURE_ARM64
Definition: winnt_old.h:503
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define KEY_WOW64_64KEY
Definition: cmtypes.h:46
unsigned char BYTE
Definition: xxhash.c:193