ReactOS  0.4.13-dev-259-g5ca9c9c
icif.c
Go to the documentation of this file.
1 /*
2  * Copyright 2016 Michael Müller
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  */
18 
19 #define COBJMACROS
20 
21 #include "config.h"
22 
23 #include <stdarg.h>
24 #include <string.h>
25 
26 #include "windef.h"
27 #include "winbase.h"
28 #include "winuser.h"
29 #include "ole2.h"
30 #include "rpcproxy.h"
31 #include "inseng.h"
32 
33 #include "inseng_private.h"
34 
35 #include "wine/list.h"
36 #include "wine/debug.h"
37 
39 
40 #define DEFAULT_INSTALLER_DESC "Active Setup Installation"
41 
42 struct cifgroup
43 {
45 
46  struct list entry;
47 
49 
50  char *id;
51  char *description;
53 };
54 
56 {
59 
61  struct list *start;
62  struct list *position;
63 
64  char *group_id;
65 };
66 
68 {
71 
73  struct list *start;
74  struct list *position;
75 };
76 
77 struct url_info
78 {
79  struct list entry;
81  char *url;
83 };
84 
86 {
87  struct list entry;
88  char *id;
89  char *type;
90 };
91 
93 {
95 
96  struct list entry;
97 
99 
100  char *id;
101  char *guid;
102  char *description;
103  char *details;
104  char *group;
105 
106 
109  char *patchid;
110 
111  char *locale;
113 
118 
119  char *key_success;
121  char *key_cancel;
122 
127 
130 
132  struct list urls;
133 
134  /* mode */
135  /* det version */
136  /* one component */
137  /* custom data */
138 
139  /* in memory state */
145 };
146 
147 struct ciffile
148 {
151 
152  struct list components;
153  struct list groups;
154 
155  char *name;
156 };
157 
158 static inline struct ciffile *impl_from_ICiffile(ICifFile *iface)
159 {
160  return CONTAINING_RECORD(iface, struct ciffile, ICifFile_iface);
161 }
162 
164 {
165  return CONTAINING_RECORD(iface, struct cifcomponent, ICifComponent_iface);
166 }
167 
168 static inline struct cifgroup *impl_from_ICifGroup(ICifGroup *iface)
169 {
170  return CONTAINING_RECORD(iface, struct cifgroup, ICifGroup_iface);
171 }
172 
174 {
176 }
177 
179 {
181 }
182 
183 static HRESULT enum_components_create(ICifFile *file, struct list *start, char *group_id, IEnumCifComponents **iface);
184 
185 static HRESULT copy_substring_null(char *dest, int max_len, char *src)
186 {
187  if (!src)
188  return E_FAIL;
189 
190  if (max_len <= 0)
191  return S_OK;
192 
193  if (!dest)
194  return E_FAIL;
195 
196  while (*src && max_len-- > 1)
197  *dest++ = *src++;
198  *dest = 0;
199 
200  return S_OK;
201 }
202 
203 static void url_entry_free(struct url_info *url)
204 {
205  heap_free(url->url);
206  heap_free(url);
207 }
208 
209 static void dependency_entry_free(struct dependency_info *dependency)
210 {
211  heap_free(dependency->id);
212  heap_free(dependency);
213 }
214 
215 static void component_free(struct cifcomponent *comp)
216 {
217  struct dependency_info *dependency, *dependency_next;
218  struct url_info *url, *url_next;
219 
220  heap_free(comp->id);
221  heap_free(comp->guid);
222  heap_free(comp->description);
223  heap_free(comp->details);
224  heap_free(comp->group);
225 
226  heap_free(comp->patchid);
227 
228  heap_free(comp->locale);
229  heap_free(comp->key_uninstall);
230 
231  heap_free(comp->key_success);
232  heap_free(comp->key_progress);
233  heap_free(comp->key_cancel);
234 
235  LIST_FOR_EACH_ENTRY_SAFE(dependency, dependency_next, &comp->dependencies, struct dependency_info, entry)
236  {
237  list_remove(&dependency->entry);
238  dependency_entry_free(dependency);
239  }
240 
241  LIST_FOR_EACH_ENTRY_SAFE(url, url_next, &comp->urls, struct url_info, entry)
242  {
243  list_remove(&url->entry);
245  }
246 
247  heap_free(comp);
248 }
249 
250 static void group_free(struct cifgroup *group)
251 {
252  heap_free(group->id);
253  heap_free(group->description);
254  heap_free(group);
255 }
256 
257 static HRESULT WINAPI group_GetID(ICifGroup *iface, char *id, DWORD size)
258 {
259  struct cifgroup *This = impl_from_ICifGroup(iface);
260 
261  TRACE("(%p)->(%p, %u)\n", This, id, size);
262 
263  return copy_substring_null(id, size, This->id);
264 }
265 
267 {
268  struct cifgroup *This = impl_from_ICifGroup(iface);
269 
270  TRACE("(%p)->(%p, %u)\n", This, desc, size);
271 
272  return copy_substring_null(desc, size, This->description);
273 }
274 
276 {
277  struct cifgroup *This = impl_from_ICifGroup(iface);
278 
279  TRACE("(%p)\n", This);
280 
281  return This->priority;
282 }
283 
285 {
286  struct cifgroup *This = impl_from_ICifGroup(iface);
287  struct ciffile *file;
288 
289  TRACE("(%p)->(%p, %u, %p)\n", This, enum_components, filter, pv);
290 
291  if (filter)
292  FIXME("filter (%x) not supported\n", filter);
293  if (pv)
294  FIXME("how to handle pv (%p)?\n", pv);
295 
296  file = impl_from_ICiffile(This->parent);
297  return enum_components_create(This->parent, &file->components, This->id, enum_components);
298 }
299 
301 {
302  struct cifgroup *This = impl_from_ICifGroup(iface);
303 
304  FIXME("(%p): stub\n", This);
305 
306  return 0;
307 }
308 
309 static const ICifGroupVtbl cifgroupVtbl =
310 {
311  group_GetID,
316 };
317 
319 {
320  struct cifcomponent *This = impl_from_ICifComponent(iface);
321 
322  This->size_actual_download = size;
323 }
324 
326 {
327  struct cifcomponent *This = impl_from_ICifComponent(iface);
328 
329  This->downloaded = value;
330 }
331 
333 {
334  struct cifcomponent *This = impl_from_ICifComponent(iface);
335 
336  This->installed = value;
337 }
338 
340 {
341  struct cifcomponent *This = impl_from_ICifComponent(iface);
342 
343  return This->id;
344 }
345 
347 {
348  struct cifcomponent *This = impl_from_ICifComponent(iface);
349 
350  TRACE("(%p)->(%p, %u)\n", This, id, size);
351 
352  return copy_substring_null(id, size, This->id);
353 }
354 
356 {
357  struct cifcomponent *This = impl_from_ICifComponent(iface);
358 
359  TRACE("(%p)->(%p, %u)\n", This, guid, size);
360 
361  return copy_substring_null(guid, size, This->guid);
362 }
363 
365 {
366  struct cifcomponent *This = impl_from_ICifComponent(iface);
367 
368  TRACE("(%p)->(%p, %u)\n", This, desc, size);
369 
370  return copy_substring_null(desc, size, This->description);
371 }
372 
374 {
375  struct cifcomponent *This = impl_from_ICifComponent(iface);
376 
377  TRACE("(%p)->(%p, %u)\n", This, details, size);
378 
379  return copy_substring_null(details, size, This->details);
380 }
381 
383 {
384  struct cifcomponent *This = impl_from_ICifComponent(iface);
385  struct url_info *entry;
386 
387  TRACE("(%p)->(%u, %p, %u, %p)\n", This, index, url, size, flags);
388 
389  /* FIXME: check how functions behaves for url == NULL */
390 
391  if (!flags)
392  return E_FAIL;
393 
394  LIST_FOR_EACH_ENTRY(entry, &This->urls, struct url_info, entry)
395  {
396  if (entry->index != index)
397  continue;
398 
399  *flags = entry->flags;
400  return copy_substring_null(url, size, entry->url);
401  }
402 
403  return E_FAIL;
404 }
405 
407 {
408  struct cifcomponent *This = impl_from_ICifComponent(iface);
409 
410  FIXME("(%p)->(%u, %p, %u): stub\n", This, index, list, size);
411 
412  return E_NOTIMPL;
413 }
414 
416 {
417  struct cifcomponent *This = impl_from_ICifComponent(iface);
418 
419  FIXME("(%p)->(%u, %p, %p): stub\n", This, index, min, max);
420 
421  return E_NOTIMPL;
422 }
423 
424 static HRESULT WINAPI component_GetCommand(ICifComponent *iface, UINT index, char *cmd, DWORD cmd_size, char *switches, DWORD switch_size, DWORD *type)
425 {
426  struct cifcomponent *This = impl_from_ICifComponent(iface);
427 
428  FIXME("(%p)->(%u, %p, %u, %p, %u, %p): stub\n", This, index, cmd, cmd_size, switches, switch_size, type);
429 
430  return E_NOTIMPL;
431 }
432 
434 {
435  struct cifcomponent *This = impl_from_ICifComponent(iface);
436 
437  TRACE("(%p)->(%p, %p)\n", This, version, build);
438 
439  if (!version || !build)
440  return E_FAIL;
441 
442  *version = This->version;
443  *build = This->build;
444 
445  return S_OK;
446 }
447 
449 {
450  struct cifcomponent *This = impl_from_ICifComponent(iface);
451 
452  TRACE("(%p)->(%p, %u)\n", This, locale, size);
453 
454  return copy_substring_null(locale, size, This->locale);
455 }
456 
458 {
459  struct cifcomponent *This = impl_from_ICifComponent(iface);
460 
461  TRACE("(%p)->(%p, %u)\n", This, key, size);
462 
463  return copy_substring_null(key, size, This->key_uninstall);
464 }
465 
467 {
468  struct cifcomponent *This = impl_from_ICifComponent(iface);
469 
470  TRACE("(%p)->(%p, %p)\n", This, win, app);
471 
472  if (!win || !app)
473  return E_FAIL;
474 
475  *win = This->size_win;
476  *app = This->size_app;
477 
478  return S_OK;
479 }
480 
482 {
483  struct cifcomponent *This = impl_from_ICifComponent(iface);
484 
485  TRACE("(%p)\n", This);
486 
487  return This->size_download;
488 }
489 
491 {
492  struct cifcomponent *This = impl_from_ICifComponent(iface);
493 
494  TRACE("(%p)\n", This);
495 
496  return This->size_extracted;
497 }
498 
500 {
501  struct cifcomponent *This = impl_from_ICifComponent(iface);
502 
503  TRACE("(%p)->(%p, %u)\n", This, key, size);
504 
505  return copy_substring_null(key, size, This->key_success);
506 }
507 
509  char *cancel, DWORD cancel_size)
510 {
511  struct cifcomponent *This = impl_from_ICifComponent(iface);
512  HRESULT hr;
513 
514  TRACE("(%p)->(%p, %u, %p, %u): semi-stub\n", This, progress, progress_size, cancel, cancel_size);
515 
516  hr = copy_substring_null(progress, progress_size, This->key_progress);
517  if (hr != S_OK) return hr;
518 
519  if (cancel_size > 0 && cancel)
520  *cancel = 0;
521 
522  return S_OK;
523 }
524 
526 {
527  struct cifcomponent *This = impl_from_ICifComponent(iface);
528 
529  TRACE("(%p)\n", This);
530 
531  return This->as_aware ? S_OK : S_FALSE;
532 }
533 
535 {
536  struct cifcomponent *This = impl_from_ICifComponent(iface);
537 
538  TRACE("(%p)\n", This);
539 
540  return This->reboot ? S_OK : S_FALSE;
541 }
542 
544 {
545  struct cifcomponent *This = impl_from_ICifComponent(iface);
546 
547  TRACE("(%p)\n", This);
548 
549  return This->admin ? S_OK : S_FALSE;
550 }
551 
553 {
554  struct cifcomponent *This = impl_from_ICifComponent(iface);
555 
556  TRACE("(%p)\n", This);
557 
558  return This->priority;
559 }
560 
561 static HRESULT WINAPI component_GetDependency(ICifComponent *iface, UINT index, char *id, DWORD id_size, char *type, DWORD *ver, DWORD *build)
562 {
563  struct cifcomponent *This = impl_from_ICifComponent(iface);
564  struct dependency_info *entry;
565  ICifComponent *dependency;
566  int pos = 0;
567 
568  TRACE("(%p)->(%u, %p, %u, %p, %p, %p)\n", This, index, id, id_size, type, ver, build);
569 
570  if (!id || !ver || !build)
571  return E_FAIL;
572 
573  LIST_FOR_EACH_ENTRY(entry, &This->dependencies, struct dependency_info, entry)
574  {
575  if (pos++ < index)
576  continue;
577 
578  if (ICifFile_FindComponent(This->parent, entry->id, &dependency) == S_OK)
579  {
580  ICifComponent_GetVersion(dependency, ver, build);
581  }
582  else
583  {
584  *ver = -1;
585  *build = -1;
586  }
587 
588  if (entry->type)
589  *type = *entry->type;
590  else
591  *type = 'I';
592 
593  return copy_substring_null(id, id_size, entry->id);
594  }
595 
596  return E_FAIL;
597 }
598 
600 {
601  struct cifcomponent *This = impl_from_ICifComponent(iface);
602 
603  TRACE("(%p)\n", This);
604 
605  return This->platform;
606 }
607 
609 {
610  struct cifcomponent *This = impl_from_ICifComponent(iface);
611 
612  FIXME("(%p)->(%u, %p, %u): stub\n", This, index, mode, size);
613 
614  return E_NOTIMPL;
615 }
616 
618 {
619  struct cifcomponent *This = impl_from_ICifComponent(iface);
620 
621  TRACE("(%p)->(%p, %u)\n", This, id, size);
622 
623  return copy_substring_null(id, size, This->group);
624 }
625 
627 {
628  struct cifcomponent *This = impl_from_ICifComponent(iface);
629 
630  TRACE("(%p)\n", This);
631 
632  return This->visibleui ? S_OK : S_FALSE;
633 }
634 
636 {
637  struct cifcomponent *This = impl_from_ICifComponent(iface);
638 
639  TRACE("(%p)->(%p, %u)\n", This, id, size);
640 
641  return copy_substring_null(id, size, This->patchid);
642 }
643 
644 static HRESULT WINAPI component_GetDetVersion(ICifComponent *iface, char *dll, DWORD dll_size, char *entry, DWORD entry_size)
645 {
646  struct cifcomponent *This = impl_from_ICifComponent(iface);
647 
648  FIXME("(%p)->(%p, %u, %p, %u): stub\n", This, dll, dll_size, entry, entry_size);
649 
650  return E_NOTIMPL;
651 }
652 
654 {
655  struct cifcomponent *This = impl_from_ICifComponent(iface);
656 
657  FIXME("(%p)->(%u, %p, %u): stub\n", This, index, id, size);
658 
659  return E_NOTIMPL;
660 }
661 
663 {
664  struct cifcomponent *This = impl_from_ICifComponent(iface);
665 
666  FIXME("(%p)->(%s, %p, %u): stub\n", This, debugstr_a(key), data, size);
667 
668  return E_NOTIMPL;
669 }
670 
672 {
673  struct cifcomponent *This = impl_from_ICifComponent(iface);
674 
675  TRACE("(%p)\n", This);
676 
677  return This->installed;
678 }
679 
681 {
682  struct cifcomponent *This = impl_from_ICifComponent(iface);
683 
684  TRACE("(%p)\n", This);
685 
686  return This->downloaded ? S_OK : S_FALSE;
687 }
688 
690 {
691  struct cifcomponent *This = impl_from_ICifComponent(iface);
692 
693  FIXME("(%p)->(%u, %u, %p, %p): stub\n", This, version, build, ret_version, ret_build);
694 
695  return 0;
696 }
697 
699 {
700  struct cifcomponent *This = impl_from_ICifComponent(iface);
701 
702  TRACE("(%p)\n", This);
703 
704  return This->queue_state;
705 }
706 
708 {
709  struct cifcomponent *This = impl_from_ICifComponent(iface);
710 
711  TRACE("(%p)->(%u)\n", This, state);
712 
713  This->queue_state = state;
714  return S_OK;
715 }
716 
718 {
719  struct cifcomponent *This = impl_from_ICifComponent(iface);
720 
721  TRACE("(%p)\n", This);
722 
723  return This->size_download;
724 }
725 
727 {
728  struct cifcomponent *This = impl_from_ICifComponent(iface);
729 
730  TRACE("(%p)\n", This);
731 
732  return This->current_priority;
733 }
734 
735 
737 {
738  struct cifcomponent *This = impl_from_ICifComponent(iface);
739 
740  TRACE("(%p)->(%u)\n", This, priority);
741 
742  This->current_priority = priority;
743  return S_OK;
744 }
745 
746 static const ICifComponentVtbl cifcomponentVtbl =
747 {
785 };
786 
788 {
790 
792  {
793  TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
794  *ppv = &This->IEnumCifComponents_iface;
795  }
796  /*
797  else if (IsEqualGUID(&IID_IEnumCifComponents, riid))
798  {
799  TRACE("(%p)->(IID_ICifFile %p)\n", This, ppv);
800  *ppv = &This->IEnumCifComponents_iface;
801  }
802  */
803  else
804  {
805  FIXME("(%p)->(%s %p) not found\n", This, debugstr_guid(riid), ppv);
806  *ppv = NULL;
807  return E_NOINTERFACE;
808  }
809 
810  IUnknown_AddRef((IUnknown *)*ppv);
811  return S_OK;
812 }
813 
815 {
818 
819  TRACE("(%p) ref=%d\n", This, ref);
820 
821  return ref;
822 }
823 
825 {
828 
829  TRACE("(%p) ref=%d\n", This, ref);
830 
831  if(!ref)
832  {
833  ICifFile_Release(This->file);
834  heap_free(This);
835  }
836 
837  return ref;
838 }
839 
841 {
843  struct cifcomponent *comp;
844 
845  TRACE("(%p)->(%p)\n", This, component);
846 
847  if (!component)
848  return E_FAIL;
849 
850  if (!This->position)
851  {
852  *component = NULL;
853  return E_FAIL;
854  }
855 
856  do
857  {
858  This->position = list_next(This->start, This->position);
859  if (!This->position)
860  {
861  *component = NULL;
862  return E_FAIL;
863  }
864 
865  comp = CONTAINING_RECORD(This->position, struct cifcomponent, entry);
866  } while (This->group_id && (!comp->group || strcmp(This->group_id, comp->group)));
867 
868  *component = &comp->ICifComponent_iface;
869  return S_OK;
870 }
871 
873 {
875 
876  TRACE("(%p)\n", This);
877 
878  This->position = This->start;
879  return S_OK;
880 }
881 
882 static const IEnumCifComponentsVtbl enum_componentsVtbl =
883 {
889 };
890 
892 {
893  struct ciffenum_components *enumerator;
894 
895  enumerator = heap_alloc_zero(sizeof(*enumerator));
896  if (!enumerator) return E_OUTOFMEMORY;
897 
898  enumerator->IEnumCifComponents_iface.lpVtbl = &enum_componentsVtbl;
899  enumerator->ref = 1;
900  enumerator->file = file;
901  enumerator->start = start;
902  enumerator->position = start;
903  enumerator->group_id = group_id;
904 
905  ICifFile_AddRef(file);
906 
907  *iface = &enumerator->IEnumCifComponents_iface;
908  return S_OK;
909 }
910 
912 {
914 
916  {
917  TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
918  *ppv = &This->IEnumCifGroups_iface;
919  }
920  /*
921  else if (IsEqualGUID(&IID_IEnumCifGroups, riid))
922  {
923  TRACE("(%p)->(IID_ICifFile %p)\n", This, ppv);
924  *ppv = &This->IEnumCifGroups_iface;
925  }
926  */
927  else
928  {
929  FIXME("(%p)->(%s %p) not found\n", This, debugstr_guid(riid), ppv);
930  *ppv = NULL;
931  return E_NOINTERFACE;
932  }
933 
934  IUnknown_AddRef((IUnknown *)*ppv);
935  return S_OK;
936 }
937 
939 {
942 
943  TRACE("(%p) ref=%d\n", This, ref);
944 
945  return ref;
946 }
947 
949 {
952 
953  TRACE("(%p) ref=%d\n", This, ref);
954 
955  if(!ref)
956  {
957  ICifFile_Release(This->file);
958  heap_free(This);
959  }
960 
961  return ref;
962 }
963 
965 {
967  struct cifgroup *gp;
968 
969  TRACE("(%p)->(%p)\n", This, group);
970 
971  if (!This->position || !group)
972  return E_FAIL;
973 
974  This->position = list_next(This->start, This->position);
975 
976  if (!This->position)
977  return E_FAIL;
978 
979  gp = CONTAINING_RECORD(This->position, struct cifgroup, entry);
980  *group = &gp->ICifGroup_iface;
981  return S_OK;
982 }
983 
985 {
987 
988  TRACE("(%p)\n", This);
989 
990  This->position = This->start;
991  return S_OK;
992 }
993 
994 static const IEnumCifGroupsVtbl enum_groupsVtbl =
995 {
1001 };
1002 
1004 {
1005  struct ciffenum_groups *enumerator;
1006 
1007  enumerator = heap_alloc_zero(sizeof(*enumerator));
1008  if (!enumerator) return E_OUTOFMEMORY;
1009 
1010  enumerator->IEnumCifGroups_iface.lpVtbl = &enum_groupsVtbl;
1011  enumerator->ref = 1;
1012  enumerator->file = file;
1013  enumerator->start = start;
1014  enumerator->position = start;
1015 
1016  ICifFile_AddRef(file);
1017 
1018  *iface = &enumerator->IEnumCifGroups_iface;
1019  return S_OK;
1020 }
1021 
1023 {
1024  struct ciffile *This = impl_from_ICiffile(iface);
1025 
1026  if (IsEqualGUID(&IID_IUnknown, riid))
1027  {
1028  TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
1029  *ppv = &This->ICifFile_iface;
1030  }
1031  else if (IsEqualGUID(&IID_ICifFile, riid))
1032  {
1033  TRACE("(%p)->(IID_ICifFile %p)\n", This, ppv);
1034  *ppv = &This->ICifFile_iface;
1035  }
1036  else
1037  {
1038  FIXME("(%p)->(%s %p) not found\n", This, debugstr_guid(riid), ppv);
1039  *ppv = NULL;
1040  return E_NOINTERFACE;
1041  }
1042 
1043  IUnknown_AddRef((IUnknown *)*ppv);
1044  return S_OK;
1045 }
1046 
1048 {
1049  struct ciffile *This = impl_from_ICiffile(iface);
1050  LONG ref = InterlockedIncrement(&This->ref);
1051 
1052  TRACE("(%p) ref=%d\n", This, ref);
1053 
1054  return ref;
1055 }
1056 
1058 {
1059  struct ciffile *This = impl_from_ICiffile(iface);
1060  LONG ref = InterlockedDecrement(&This->ref);
1061 
1062  TRACE("(%p) ref=%d\n", This, ref);
1063 
1064  if(!ref)
1065  {
1066  struct cifcomponent *comp, *comp_next;
1067  struct cifgroup *group, *group_next;
1068 
1069  heap_free(This->name);
1070 
1071  LIST_FOR_EACH_ENTRY_SAFE(comp, comp_next, &This->components, struct cifcomponent, entry)
1072  {
1073  list_remove(&comp->entry);
1074  component_free(comp);
1075  }
1076 
1077  LIST_FOR_EACH_ENTRY_SAFE(group, group_next, &This->groups, struct cifgroup, entry)
1078  {
1079  list_remove(&group->entry);
1080  group_free(group);
1081  }
1082 
1083  heap_free(This);
1084  }
1085 
1086  return ref;
1087 }
1088 
1090 {
1091  struct ciffile *This = impl_from_ICiffile(iface);
1092 
1093  TRACE("(%p)->(%p, %u, %p)\n", This, enum_components, filter, pv);
1094 
1095  if (filter)
1096  FIXME("filter (%x) not supported\n", filter);
1097  if (pv)
1098  FIXME("how to handle pv (%p)?\n", pv);
1099 
1100  return enum_components_create(iface, &This->components, NULL, enum_components);
1101 }
1102 
1103 static HRESULT WINAPI ciffile_FindComponent(ICifFile *iface, const char *id, ICifComponent **component)
1104 {
1105  struct ciffile *This = impl_from_ICiffile(iface);
1106  struct cifcomponent *comp;
1107 
1108  TRACE("(%p)->(%s, %p)\n", This, debugstr_a(id), component);
1109 
1110  LIST_FOR_EACH_ENTRY(comp, &This->components, struct cifcomponent, entry)
1111  {
1112  if (strcmp(comp->id, id) != 0)
1113  continue;
1114 
1115  *component = &comp->ICifComponent_iface;
1116  return S_OK;
1117  }
1118 
1119  return E_FAIL;
1120 }
1121 
1122 static HRESULT WINAPI ciffile_EnumGroups(ICifFile *iface, IEnumCifGroups **enum_groups, DWORD filter, void *pv)
1123 {
1124  struct ciffile *This = impl_from_ICiffile(iface);
1125 
1126  TRACE("(%p)->(%p, %u, %p)\n", This, enum_groups, filter, pv);
1127 
1128  if (filter)
1129  FIXME("filter (%x) not supported\n", filter);
1130  if (pv)
1131  FIXME("how to handle pv (%p)?\n", pv);
1132 
1133  return enum_groups_create(iface, &This->groups, enum_groups);
1134 }
1135 
1136 static HRESULT WINAPI ciffile_FindGroup(ICifFile *iface, const char *id, ICifGroup **group)
1137 {
1138  struct ciffile *This = impl_from_ICiffile(iface);
1139  struct cifgroup *gp;
1140 
1141  TRACE("(%p)->(%s, %p)\n", This, debugstr_a(id), group);
1142 
1143  LIST_FOR_EACH_ENTRY(gp, &This->groups, struct cifgroup, entry)
1144  {
1145  if (strcmp(gp->id, id) != 0)
1146  continue;
1147 
1148  *group = &gp->ICifGroup_iface;
1149  return S_OK;
1150  }
1151 
1152  return E_FAIL;
1153 }
1154 
1155 static HRESULT WINAPI ciffile_EnumModes(ICifFile *iface, IEnumCifModes **cuf_modes, DWORD filter, void *pv)
1156 {
1157  struct ciffile *This = impl_from_ICiffile(iface);
1158 
1159  FIXME("(%p)->(%p, %u, %p): stub\n", This, cuf_modes, filter, pv);
1160 
1161  return E_NOTIMPL;
1162 }
1163 
1164 static HRESULT WINAPI ciffile_FindMode(ICifFile *iface, const char *id, ICifMode **mode)
1165 {
1166  struct ciffile *This = impl_from_ICiffile(iface);
1167 
1168  FIXME("(%p)->(%s, %p): stub\n", This, debugstr_a(id), mode);
1169 
1170  return E_NOTIMPL;
1171 }
1172 
1174 {
1175  struct ciffile *This = impl_from_ICiffile(iface);
1176 
1177  TRACE("(%p)->(%p, %u)\n", This, desc, size);
1178 
1179  return copy_substring_null(desc, size, This->name);
1180 }
1181 
1183 {
1184  struct ciffile *This = impl_from_ICiffile(iface);
1185 
1186  FIXME("(%p)->(%p, %u): stub\n", This, dlls, size);
1187 
1188  return E_NOTIMPL;
1189 }
1190 
1191 static const ICifFileVtbl ciffileVtbl =
1192 {
1204 };
1205 
1206 static BOOL copy_string(char **dest, const char *source)
1207 {
1208  if (!source)
1209  {
1210  *dest = NULL;
1211  return TRUE;
1212  }
1213 
1214  *dest = strdupA(source);
1215  if (!dest) return FALSE;
1216  return TRUE;
1217 }
1218 
1219 static BOOL section_get_str(struct inf_section *inf_sec, const char *key, char **value, const char *def)
1220 {
1221  struct inf_value *inf_val;
1222 
1223  inf_val = inf_get_value(inf_sec, key);
1224  if (!inf_val) return copy_string(value, def);
1225 
1226  *value = inf_value_get_value(inf_val);
1227  if (!*value) return FALSE;
1228 
1229  return TRUE;
1230 }
1231 
1232 static char *next_part(char **str, BOOL strip_quotes)
1233 {
1234  char *start = *str;
1235  char *next = *str;
1236 
1237  while (*next && *next != ',')
1238  next++;
1239 
1240  if (!*next)
1241  {
1242  *str = trim(start, NULL, strip_quotes);
1243  return NULL;
1244  }
1245 
1246  *next = 0;
1247  *str = trim(start, NULL, strip_quotes);
1248  return ++next;
1249 }
1250 
1251 static BOOL value_get_str_field(struct inf_value *inf_val, int field, char **value, const char *def)
1252 {
1253  char *line, *str, *next;
1254  int i = 0;
1255 
1256  line = inf_value_get_value(inf_val);
1257  if (!line) return FALSE;
1258 
1259  str = line;
1260  do
1261  {
1262  i++;
1263  next = next_part(&str, TRUE);
1264 
1265  if (field == i)
1266  {
1268  heap_free(line);
1269  return ret;
1270  }
1271 
1272  str = next;
1273  } while (str);
1274 
1275  return copy_string(value, def);
1276 }
1277 
1278 /*
1279 static BOOL section_get_str_field(struct inf_section *inf_sec, const char *key, int field, char **value, const char *def)
1280 {
1281  struct inf_value *inf_val;
1282 
1283  inf_val = inf_get_value(inf_sec, key);
1284  if (!inf_val) return copy_string(value, def);
1285 
1286  return value_get_str_field(inf_val, field, value, def);
1287 }
1288 */
1289 
1290 static BOOL section_get_dword(struct inf_section *inf_sec, const char *key, DWORD *value, DWORD def)
1291 {
1292  struct inf_value *inf_val;
1293  char *str;
1294 
1295  inf_val = inf_get_value(inf_sec, key);
1296  if (!inf_val)
1297  {
1298  *value = def;
1299  return TRUE;
1300  }
1301 
1302  str = inf_value_get_value(inf_val);
1303  if (!str) return FALSE;
1304 
1305  *value = atoi(str);
1306  heap_free(str);
1307 
1308  return TRUE;
1309 }
1310 
1311 static BOOL value_get_dword_field(struct inf_value *inf_val, int field, DWORD *value, DWORD def)
1312 {
1313  char *value_str;
1314  BOOL ret;
1315 
1316  ret = value_get_str_field(inf_val, field, &value_str, NULL);
1317  if (!ret) return FALSE;
1318  if (!value_str)
1319  {
1320  *value = def;
1321  return TRUE;
1322  }
1323 
1324  *value = atoi(value_str);
1326 
1327  return TRUE;
1328 }
1329 
1330 static BOOL section_get_dword_field(struct inf_section *inf_sec, const char *key, int field, DWORD *value, DWORD def)
1331 {
1332  struct inf_value *inf_val;
1333 
1334  inf_val = inf_get_value(inf_sec, key);
1335  if (!inf_val)
1336  {
1337  *value = def;
1338  return TRUE;
1339  }
1340 
1341  return value_get_dword_field(inf_val, field, value, def);
1342 }
1343 
1345 {
1346  if (!section_get_str(section, "DisplayName", &file->name, DEFAULT_INSTALLER_DESC))
1347  return E_OUTOFMEMORY;
1348 
1349  return S_OK;
1350 }
1351 
1352 static BOOL read_version_entry(struct inf_section *section, DWORD *ret_ver, DWORD *ret_build)
1353 {
1354  DWORD version = 0;
1355  DWORD build = 0;
1356  char *line, *str, *next;
1357 
1358  if (!section_get_str(section, "Version", &line, NULL))
1359  return FALSE;
1360  if (!line) goto done;
1361 
1362  str = line;
1363 
1364  next = next_part(&str, TRUE);
1365  version |= atoi(str) << 16;
1366  if (!next) goto done;
1367  str = next;
1368 
1369  next = next_part(&str, TRUE);
1370  version |= atoi(str) & 0xffff;
1371  if (!next) goto done;
1372  str = next;
1373 
1374  next = next_part(&str, TRUE);
1375  build |= atoi(str) << 16;
1376  if (!next) goto done;
1377  str = next;
1378 
1379  next_part(&str, TRUE);
1380  build |= atoi(str) & 0xffff;
1381 
1382 done:
1383  heap_free(line);
1384  *ret_ver = version;
1385  *ret_build = build;
1386  return TRUE;
1387 }
1388 
1389 static BOOL read_platform_entry(struct inf_section *section, DWORD *ret_platform)
1390 {
1391  DWORD platform = PLATFORM_ALL;
1392  char *line, *str, *next;
1393 
1394  if (!section_get_str(section, "Platform", &line, NULL))
1395  return FALSE;
1396  if (!line) goto done;
1397 
1398  platform = 0;
1399  str = line;
1400  do
1401  {
1402  next = next_part(&str, TRUE);
1403 
1404  if (strcasecmp(str, "Win95") == 0)
1405  platform |= PLATFORM_WIN98;
1406  else if (strcasecmp(str, "Win98") == 0)
1407  platform |= PLATFORM_WIN98;
1408  else if (strcasecmp(str, "NT4") == 0)
1409  platform |= PLATFORM_NT4;
1410  else if (strcasecmp(str, "NT5") == 0)
1411  platform |= PLATFORM_NT5;
1412  else if (strcasecmp(str, "NT4Alpha") == 0)
1413  platform |= PLATFORM_NT4;
1414  else if (strcasecmp(str, "NT5Alpha") == 0)
1415  platform |= PLATFORM_NT5;
1416  else if (strcasecmp(str, "Millen") == 0)
1417  platform |= PLATFORM_MILLEN;
1418  else
1419  FIXME("Unknown platform: %s\n", debugstr_a(str));
1420 
1421  str = next;
1422  } while (str);
1423 
1424 done:
1425  heap_free(line);
1426  *ret_platform = platform;
1427  return TRUE;
1428 }
1429 
1430 static BOOL read_dependencies(struct cifcomponent *component, struct inf_section *section)
1431 {
1432  struct dependency_info *dependency;
1433  char *line, *str, *next;
1434  BOOL ret = TRUE;
1435 
1436  if (!section_get_str(section, "Dependencies", &line, NULL))
1437  return E_OUTOFMEMORY;
1438  if (!line) goto done;
1439 
1440  ret = FALSE;
1441  str = line;
1442  do
1443  {
1444  next = next_part(&str, TRUE);
1445 
1446  dependency = heap_alloc_zero(sizeof(*dependency));
1447  if (!dependency) goto done;
1448 
1449  dependency->id = strdupA(str);
1450  if (!dependency->id)
1451  {
1452  heap_free(dependency);
1453  goto done;
1454  }
1455 
1456  dependency->type = strstr(dependency->id, ":");
1457  if (dependency->type) *dependency->type++ = 0;
1458 
1459  list_add_tail(&component->dependencies, &dependency->entry);
1460 
1461  str = next;
1462  } while (str);
1463 
1464  ret = TRUE;
1465 
1466 done:
1467  heap_free(line);
1468  return ret;
1469 }
1470 
1471 static BOOL read_urls(struct cifcomponent *component, struct inf_section *section)
1472 {
1473  struct inf_value *inf_value = NULL;
1474  struct url_info *url_entry;
1475  char *str, *next;
1476  int index;
1477 
1479  {
1481  if (!str) return E_OUTOFMEMORY;
1482 
1483  if (strncasecmp(str, "URL", 3))
1484  goto next;
1485 
1486  if (!str[3])
1487  goto next;
1488 
1489  index = strtol(str+3, &next, 10);
1490  if (next == str+3 || *next != 0 || index < 1)
1491  goto next;
1492  index--;
1493 
1494  url_entry = heap_alloc_zero(sizeof(*url_entry));
1495  if (!url_entry) goto error;
1496 
1497  url_entry->index = index;
1498 
1499  if (!value_get_str_field(inf_value, 1, &url_entry->url, NULL))
1500  goto error;
1501  if (!url_entry->url || !*url_entry->url)
1502  {
1503  url_entry_free(url_entry);
1504  goto next;
1505  }
1506 
1507  if (!value_get_dword_field(inf_value, 2, &url_entry->flags, 0))
1508  goto error;
1509 
1510  list_add_tail(&component->urls, &url_entry->entry);
1511 
1512  next:
1513  heap_free(str);
1514  }
1515 
1516  return TRUE;
1517 
1518 error:
1519  heap_free(str);
1520  url_entry_free(url_entry);
1521  return FALSE;
1522 };
1523 
1524 void add_component_by_priority(struct ciffile *file, struct cifcomponent *component)
1525 {
1526  struct cifcomponent *entry;
1527 
1528  LIST_FOR_EACH_ENTRY(entry, &file->components, struct cifcomponent, entry)
1529  {
1530  if (entry->priority > component->priority)
1531  continue;
1532 
1533  list_add_before(&entry->entry, &component->entry);
1534  return;
1535  }
1536 
1537  list_add_tail(&file->components, &component->entry);
1538 }
1539 
1540 static HRESULT process_component(struct ciffile *file, struct inf_section *section, const char *section_name)
1541 {
1542  struct cifcomponent *component;
1544 
1545  component = heap_alloc_zero(sizeof(*component));
1546  if (!component) return E_OUTOFMEMORY;
1547 
1548  component->ICifComponent_iface.lpVtbl = &cifcomponentVtbl;
1549  component->parent = &file->ICifFile_iface;
1550 
1551  list_init(&component->urls);
1552  list_init(&component->dependencies);
1553 
1554  component->queue_state = ActionNone;
1555 
1556  component->id = strdupA(section_name);
1557  if (!component->id) goto error;
1558 
1559  if (!section_get_str(section, "DisplayName", &component->description, NULL))
1560  goto error;
1561  if (!section_get_str(section, "GUID", &component->guid, NULL))
1562  goto error;
1563  if (!section_get_str(section, "Details", &component->details, NULL))
1564  goto error;
1565  if (!section_get_str(section, "Group", &component->group, NULL))
1566  goto error;
1567  if (!section_get_str(section, "Locale", &component->locale, "en"))
1568  goto error;
1569  if (!section_get_str(section, "PatchID", &component->patchid, NULL))
1570  goto error;
1571 
1572  if (!section_get_dword_field(section, "Size", 1, &component->size_download, 0))
1573  goto error;
1574  if (!section_get_dword_field(section, "Size", 2, &component->size_extracted, 0))
1575  goto error;
1576  if (!section_get_dword_field(section, "InstalledSize", 1, &component->size_app, 0))
1577  goto error;
1578  if (!section_get_dword_field(section, "InstalledSize", 2, &component->size_win, 0))
1579  goto error;
1580 
1581  if (!section_get_str(section, "SuccessKey", &component->key_success, NULL))
1582  goto error;
1583  if (!section_get_str(section, "CancelKey", &component->key_cancel, NULL))
1584  goto error;
1585  if (!section_get_str(section, "ProgressKey", &component->key_progress, NULL))
1586  goto error;
1587  if (!section_get_str(section, "UninstallKey", &component->key_uninstall, NULL))
1588  goto error;
1589  if (!section_get_dword(section, "Reboot", &component->reboot, 0))
1590  goto error;
1591  if (!section_get_dword(section, "AdminCheck", &component->admin, 0))
1592  goto error;
1593  if (!section_get_dword(section, "UIVisible", &component->visibleui, 1))
1594  goto error;
1595  if (!section_get_dword(section, "ActiveSetupAware", &component->as_aware, 0))
1596  goto error;
1597  if (!section_get_dword(section, "Priority", &component->priority, 0))
1598  goto error;
1599 
1600  if (!read_version_entry(section, &component->version, &component->build))
1601  goto error;
1602  if (!read_platform_entry(section, &component->platform))
1603  goto error;
1604  if (!read_urls(component, section))
1605  goto error;
1606  if (!read_dependencies(component, section))
1607  goto error;
1608 
1609  component->current_priority = component->priority;
1610 
1611  add_component_by_priority(file, component);
1612  return S_OK;
1613 
1614 error:
1615  component_free(component);
1616  return hr;
1617 }
1618 
1619 static HRESULT process_group(struct ciffile *file, struct inf_section *section, const char *section_name)
1620 {
1621  struct cifgroup *group;
1623 
1624  group = heap_alloc_zero(sizeof(*group));
1625  if (!group) return E_OUTOFMEMORY;
1626 
1627  group->ICifGroup_iface.lpVtbl = &cifgroupVtbl;
1628  group->parent = &file->ICifFile_iface;
1629 
1630  group->id = strdupA(section_name);
1631  if (!group->id) goto error;
1632 
1633  if (!section_get_str(section, "DisplayName", &group->description, NULL))
1634  goto error;
1635  if (!section_get_dword(section, "Priority", &group->priority, 0))
1636  goto error;
1637 
1638  list_add_head(&file->groups, &group->entry);
1639  return S_OK;
1640 
1641 error:
1642  group_free(group);
1643  return hr;
1644 }
1645 
1646 static HRESULT process_section(struct ciffile *file, struct inf_section *section, const char *section_name)
1647 {
1648  HRESULT hr;
1649  char *type;
1650 
1651  if (!section_get_str(section, "SectionType", &type, "Component"))
1652  return E_OUTOFMEMORY;
1653 
1654  if (!strcasecmp(type, "Component"))
1655  hr = process_component(file, section, section_name);
1656  else if (strcasecmp(type, "Group") == 0)
1657  hr = process_group(file, section, section_name);
1658  else
1659  FIXME("Don't know how to process %s\n", debugstr_a(type));
1660 
1661  heap_free(type);
1662  return hr;
1663 }
1664 
1665 static HRESULT process_inf(struct ciffile *file, struct inf_file *inf)
1666 {
1667  struct inf_section *section = NULL;
1668  char *section_name;
1669  HRESULT hr = S_OK;
1670 
1671  while (SUCCEEDED(hr) && inf_next_section(inf, &section))
1672  {
1673  section_name = inf_section_get_name(section);
1674  if (!section_name) return E_OUTOFMEMORY;
1675 
1676  TRACE("start processing section %s\n", debugstr_a(section_name));
1677 
1678  if (!strcasecmp(section_name, "Strings") ||
1679  !strncasecmp(section_name, "Strings.", strlen("Strings.")))
1680  {
1681  /* Ignore string sections */
1682  }
1683  else if (strcasecmp(section_name, "Version") == 0)
1685  else
1686  hr = process_section(file, section, section_name);
1687 
1688  TRACE("finished processing section %s (%x)\n", debugstr_a(section_name), hr);
1689  heap_free(section_name);
1690  }
1691 
1692  /* In case there was no version section, set the default installer description */
1693  if (SUCCEEDED(hr) && !file->name)
1694  {
1696  if (!file->name) hr = E_OUTOFMEMORY;
1697  }
1698 
1699  return hr;
1700 }
1701 
1702 static HRESULT load_ciffile(const char *path, ICifFile **icif)
1703 {
1704  struct inf_file *inf = NULL;
1705  struct ciffile *file;
1706  HRESULT hr = E_FAIL;
1707 
1708  file = heap_alloc_zero(sizeof(*file));
1709  if(!file) return E_OUTOFMEMORY;
1710 
1711  file->ICifFile_iface.lpVtbl = &ciffileVtbl;
1712  file->ref = 1;
1713 
1714  list_init(&file->components);
1715  list_init(&file->groups);
1716 
1717  hr = inf_load(path, &inf);
1718  if (FAILED(hr)) goto error;
1719 
1720  hr = process_inf(file, inf);
1721  if (FAILED(hr)) goto error;
1722 
1723  *icif = &file->ICifFile_iface;
1724  return S_OK;
1725 
1726 error:
1727  if (inf) inf_free(inf);
1728  ICifFile_Release(&file->ICifFile_iface);
1729  return hr;
1730 }
1731 
1733 {
1734  TRACE("(%p, %s)\n", icif, debugstr_a(path));
1735 
1736  return load_ciffile(path, icif);
1737 }
1738 
1739 
1741 {
1742  FIXME("(%p, %s): stub\n", icif, debugstr_a(path));
1743 
1744  return E_NOTIMPL;
1745 }
static DWORD WINAPI component_GetCurrentPriority(ICifComponent *iface)
Definition: icif.c:726
void add_component_by_priority(struct ciffile *file, struct cifcomponent *component)
Definition: icif.c:1524
DWORD size_download
Definition: icif.c:116
static BOOL section_get_str(struct inf_section *inf_sec, const char *key, char **value, const char *def)
Definition: icif.c:1219
static struct ciffenum_components * impl_from_IEnumCifComponents(IEnumCifComponents *iface)
Definition: icif.c:173
#define max(a, b)
Definition: svc.c:63
#define REFIID
Definition: guiddef.h:113
#define TRUE
Definition: types.h:120
ICifFile * parent
Definition: icif.c:98
#define E_NOINTERFACE
Definition: winerror.h:2364
ICifFile * file
Definition: icif.c:72
DWORD queue_state
Definition: icif.c:140
DWORD admin
Definition: icif.c:125
Definition: icif.c:147
struct inf_value * inf_get_value(struct inf_section *sec, const char *key)
Definition: inf.c:235
static HRESULT WINAPI component_GetGroup(ICifComponent *iface, char *id, DWORD size)
Definition: icif.c:617
char * locale
Definition: icif.c:111
HRESULT hr
Definition: shlfolder.c:183
#define error(str)
Definition: mkdosfs.c:1605
static HRESULT WINAPI enum_components_QueryInterface(IEnumCifComponents *iface, REFIID riid, void **ppv)
Definition: icif.c:787
#define strcasecmp
Definition: fake.h:9
static HRESULT WINAPI component_IsActiveSetupAware(ICifComponent *iface)
Definition: icif.c:525
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
static HRESULT process_version(struct ciffile *file, struct inf_section *section)
Definition: icif.c:1344
static HRESULT WINAPI component_GetVersion(ICifComponent *iface, DWORD *version, DWORD *build)
Definition: icif.c:433
static void url_entry_free(struct url_info *url)
Definition: icif.c:203
Definition: ftp_var.h:139
static HRESULT copy_substring_null(char *dest, int max_len, char *src)
Definition: icif.c:185
REFIID riid
Definition: precomp.h:44
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
ICifFile * file
Definition: icif.c:60
static const IEnumCifGroupsVtbl enum_groupsVtbl
Definition: icif.c:994
ICifComponent ICifComponent_iface
Definition: icif.c:94
Definition: icif.c:42
static HRESULT WINAPI component_GetCommand(ICifComponent *iface, UINT index, char *cmd, DWORD cmd_size, char *switches, DWORD switch_size, DWORD *type)
Definition: icif.c:424
static HRESULT WINAPI component_GetGUID(ICifComponent *iface, char *guid, DWORD size)
Definition: icif.c:355
char * key_success
Definition: icif.c:119
__WINE_SERVER_LIST_INLINE void list_add_head(struct list *list, struct list *elem)
Definition: list.h:96
static HRESULT process_section(struct ciffile *file, struct inf_section *section, const char *section_name)
Definition: icif.c:1646
REFIID LPVOID * ppv
Definition: atlbase.h:39
char * key_progress
Definition: icif.c:120
static BOOL read_urls(struct cifcomponent *component, struct inf_section *section)
Definition: icif.c:1471
static BOOL read_platform_entry(struct inf_section *section, DWORD *ret_platform)
Definition: icif.c:1389
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static HRESULT WINAPI component_GetSuccessKey(ICifComponent *iface, char *key, DWORD size)
Definition: icif.c:499
static HRESULT WINAPI component_GetDetails(ICifComponent *iface, char *details, DWORD size)
Definition: icif.c:373
static DWORD WINAPI group_GetCurrentPriority(ICifGroup *iface)
Definition: icif.c:300
static HRESULT WINAPI ciffile_EnumModes(ICifFile *iface, IEnumCifModes **cuf_modes, DWORD filter, void *pv)
Definition: icif.c:1155
static HRESULT WINAPI component_GetUrl(ICifComponent *iface, UINT index, char *url, DWORD size, DWORD *flags)
Definition: icif.c:382
static ULONG WINAPI enum_groups_AddRef(IEnumCifGroups *iface)
Definition: icif.c:938
DWORD build
Definition: icif.c:108
char * inf_value_get_value(struct inf_value *value)
Definition: inf.c:253
Definition: parser.c:55
static HRESULT WINAPI enum_groups_QueryInterface(IEnumCifGroups *iface, REFIID riid, void **ppv)
Definition: icif.c:911
static BOOL section_get_dword(struct inf_section *inf_sec, const char *key, DWORD *value, DWORD def)
Definition: icif.c:1290
static const ICifComponentVtbl cifcomponentVtbl
Definition: icif.c:746
char * key_uninstall
Definition: icif.c:112
#define E_FAIL
Definition: ddrawi.h:102
static HRESULT WINAPI component_IsComponentDownloaded(ICifComponent *iface)
Definition: icif.c:680
int32_t INT
Definition: typedefs.h:56
Definition: send.c:47
DWORD size_actual_download
Definition: icif.c:142
void component_set_downloaded(ICifComponent *iface, BOOL value)
Definition: icif.c:325
char * url
Definition: icif.c:81
static HMODULE dll
Definition: str.c:188
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
char * patchid
Definition: icif.c:109
DWORD priority
Definition: icif.c:52
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
char * guid
Definition: icif.c:101
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
const GUID * guid
static HRESULT WINAPI ciffile_EnumGroups(ICifFile *iface, IEnumCifGroups **enum_groups, DWORD filter, void *pv)
Definition: icif.c:1122
void component_set_actual_download_size(ICifComponent *iface, DWORD size)
Definition: icif.c:318
static const ICifGroupVtbl cifgroupVtbl
Definition: icif.c:309
char * inf_section_get_name(struct inf_section *section)
Definition: inf.c:214
static HRESULT process_inf(struct ciffile *file, struct inf_file *inf)
Definition: icif.c:1665
static DWORD WINAPI component_IsThisVersionInstalled(ICifComponent *iface, DWORD version, DWORD build, DWORD *ret_version, DWORD *ret_build)
Definition: icif.c:689
static HRESULT WINAPI group_EnumComponents(ICifGroup *iface, IEnumCifComponents **enum_components, DWORD filter, LPVOID pv)
Definition: icif.c:284
HRESULT WINAPI GetICifRWFileFromFile(ICifRWFile **icif, const char *path)
Definition: icif.c:1740
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
void inf_free(struct inf_file *inf)
Definition: inf.c:172
static BOOL section_get_dword_field(struct inf_section *inf_sec, const char *key, int field, DWORD *value, DWORD def)
Definition: icif.c:1330
char name[1]
Definition: fci.c:135
GLsizei GLuint * groups
Definition: glext.h:11113
static HRESULT process_component(struct ciffile *file, struct inf_section *section, const char *section_name)
Definition: icif.c:1540
Definition: _locale.h:75
unsigned int BOOL
Definition: ntddk_ex.h:94
struct list entry
Definition: icif.c:46
long LONG
Definition: pedump.c:60
ICifFile ICifFile_iface
Definition: icif.c:149
static BOOL read_dependencies(struct cifcomponent *component, struct inf_section *section)
Definition: icif.c:1430
static HRESULT enum_components_create(ICifFile *file, struct list *start, char *group_id, IEnumCifComponents **iface)
Definition: icif.c:891
BOOL downloaded
Definition: icif.c:143
char * type
Definition: icif.c:89
GLenum GLint ref
Definition: glext.h:6028
static UINT enum_components(const WCHAR *usersid, DWORD ctx, DWORD index, DWORD *idx, WCHAR guid[39], MSIINSTALLCONTEXT *installed_ctx, LPWSTR sid, LPDWORD sid_len)
Definition: registry.c:1406
#define FIXME(fmt,...)
Definition: debug.h:110
static ULONG WINAPI ciffile_Release(ICifFile *iface)
Definition: icif.c:1057
#define S_FALSE
Definition: winerror.h:2357
static void dependency_entry_free(struct dependency_info *dependency)
Definition: icif.c:209
static HRESULT enum_groups_create(ICifFile *file, struct list *start, IEnumCifGroups **iface)
Definition: icif.c:1003
char * key_cancel
Definition: icif.c:121
const WCHAR * str
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
#define strncasecmp
Definition: fake.h:10
DWORD size_extracted
Definition: icif.c:117
char * group_id
Definition: icif.c:64
DWORD version
Definition: icif.c:107
smooth NULL
Definition: ftsmooth.c:416
static BOOL value_get_str_field(struct inf_value *inf_val, int field, char **value, const char *def)
Definition: icif.c:1251
static const WCHAR version[]
Definition: asmname.c:64
char * details
Definition: icif.c:103
DWORD as_aware
Definition: icif.c:123
static ULONG WINAPI enum_components_Release(IEnumCifComponents *iface)
Definition: icif.c:824
Definition: parser.c:48
static struct cifgroup * impl_from_ICifGroup(ICifGroup *iface)
Definition: icif.c:168
static HRESULT WINAPI group_GetID(ICifGroup *iface, char *id, DWORD size)
Definition: icif.c:257
GLuint index
Definition: glext.h:6031
static HRESULT WINAPI component_GetProgressKeys(ICifComponent *iface, char *progress, DWORD progress_size, char *cancel, DWORD cancel_size)
Definition: icif.c:508
#define debugstr_guid
Definition: kernel32.h:35
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct list urls
Definition: icif.c:132
char * component_get_id(ICifComponent *iface)
Definition: icif.c:339
static BOOL read_version_entry(struct inf_section *section, DWORD *ret_ver, DWORD *ret_build)
Definition: icif.c:1352
DWORD reboot
Definition: icif.c:124
platform
Definition: msipriv.h:356
static HRESULT load_ciffile(const char *path, ICifFile **icif)
Definition: icif.c:1702
GLboolean GLuint group
Definition: glext.h:11120
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
static BOOL value_get_dword_field(struct inf_value *inf_val, int field, DWORD *value, DWORD def)
Definition: icif.c:1311
static HRESULT WINAPI component_GetFileExtractList(ICifComponent *iface, UINT index, char *list, DWORD size)
Definition: icif.c:406
static HRESULT WINAPI ciffile_GetDescription(ICifFile *iface, char *desc, DWORD size)
Definition: icif.c:1173
static HRESULT WINAPI component_GetPatchID(ICifComponent *iface, char *id, DWORD size)
Definition: icif.c:635
#define TRACE(s)
Definition: solgame.cpp:4
static HRESULT WINAPI component_GetDetVersion(ICifComponent *iface, char *dll, DWORD dll_size, char *entry, DWORD entry_size)
Definition: icif.c:644
GLsizeiptr size
Definition: glext.h:5919
WINE_DEFAULT_DEBUG_CHANNEL(inseng)
static char * next_part(char **str, BOOL strip_quotes)
Definition: icif.c:1232
static HRESULT WINAPI component_GetCustomData(ICifComponent *iface, char *key, char *data, DWORD size)
Definition: icif.c:662
static HRESULT WINAPI component_GetUrlCheckRange(ICifComponent *iface, UINT index, DWORD *min, DWORD *max)
Definition: icif.c:415
DWORD size_win
Definition: icif.c:114
Definition: parser.c:43
#define debugstr_a
Definition: kernel32.h:31
LONG HRESULT
Definition: typedefs.h:77
struct list entry
Definition: icif.c:87
BOOL inf_next_section(struct inf_file *inf, struct inf_section **sec)
Definition: inf.c:185
static const WCHAR url[]
Definition: encode.c:1432
static DWORD WINAPI component_GetPlatform(ICifComponent *iface)
Definition: icif.c:599
static DWORD WINAPI component_IsComponentInstalled(ICifComponent *iface)
Definition: icif.c:671
IEnumCifComponents IEnumCifComponents_iface
Definition: icif.c:57
const GUID IID_IUnknown
char * name
Definition: icif.c:155
#define WINAPI
Definition: msvc.h:8
const char file[]
Definition: icontest.c:11
static HRESULT WINAPI component_GetUninstallKey(ICifComponent *iface, char *key, DWORD size)
Definition: icif.c:457
unsigned long DWORD
Definition: ntddk_ex.h:95
struct list * start
Definition: icif.c:61
DWORD priority
Definition: icif.c:128
static struct cifcomponent * impl_from_ICifComponent(ICifComponent *iface)
Definition: icif.c:163
static HRESULT WINAPI component_IsUIVisible(ICifComponent *iface)
Definition: icif.c:626
BOOL installed
Definition: icif.c:144
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
LONG ref
Definition: icif.c:150
static DWORD WINAPI component_GetExtractSize(ICifComponent *iface)
Definition: icif.c:490
static void group_free(struct cifgroup *group)
Definition: icif.c:250
static DWORD WINAPI component_GetActualDownloadSize(ICifComponent *iface)
Definition: icif.c:717
GLbitfield flags
Definition: glext.h:7161
static DWORD WINAPI group_GetPriority(ICifGroup *iface)
Definition: icif.c:275
DWORD size_app
Definition: icif.c:115
DWORD flags
Definition: icif.c:82
GLenum GLenum GLuint components
Definition: glext.h:9620
int ret
char line[200]
Definition: main.c:97
static HRESULT WINAPI component_GetID(ICifComponent *iface, char *id, DWORD size)
Definition: icif.c:346
HRESULT inf_load(const char *path, struct inf_file **inf_file)
Definition: inf.c:405
void component_set_installed(ICifComponent *iface, BOOL value)
Definition: icif.c:332
#define index(s, c)
Definition: various.h:29
#define InterlockedDecrement
Definition: armddk.h:52
static HRESULT WINAPI component_GetMode(ICifComponent *iface, UINT index, char *mode, DWORD size)
Definition: icif.c:608
static DWORD WINAPI component_GetPriority(ICifComponent *iface)
Definition: icif.c:552
static struct ciffenum_groups * impl_from_IEnumCifGroups(IEnumCifGroups *iface)
Definition: icif.c:178
static HRESULT WINAPI ciffile_FindMode(ICifFile *iface, const char *id, ICifMode **mode)
Definition: icif.c:1164
static int state
Definition: maze.c:121
uint32_t entry
Definition: isohybrid.c:63
static ULONG WINAPI enum_components_AddRef(IEnumCifComponents *iface)
Definition: icif.c:814
Definition: _list.h:228
INT index
Definition: icif.c:80
GLenum src
Definition: glext.h:6340
HRESULT WINAPI GetICifFileFromFile(ICifFile **icif, const char *path)
Definition: icif.c:1732
GLenum mode
Definition: glext.h:6217
GLsizei const GLfloat * value
Definition: glext.h:6069
static HRESULT process_group(struct ciffile *file, struct inf_section *section, const char *section_name)
Definition: icif.c:1619
LONG ref
Definition: filesystem.c:119
static DWORD WINAPI component_GetInstallQueueState(ICifComponent *iface)
Definition: icif.c:698
static HRESULT WINAPI group_GetDescription(ICifGroup *iface, char *desc, DWORD size)
Definition: icif.c:266
static HRESULT WINAPI ciffile_FindComponent(ICifFile *iface, const char *id, ICifComponent **component)
Definition: icif.c:1103
char * description
Definition: icif.c:102
static HRESULT WINAPI component_IsRebootRequired(ICifComponent *iface)
Definition: icif.c:534
DWORD platform
Definition: icif.c:129
#define S_OK
Definition: intsafe.h:59
static BOOL copy_string(char **dest, const char *source)
Definition: icif.c:1206
static unsigned __int64 next
Definition: rand_nt.c:6
static struct ciffile * impl_from_ICiffile(ICifFile *iface)
Definition: icif.c:158
static UNICODE_STRING value_str
Definition: reg.c:1328
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
static HRESULT WINAPI component_SetInstallQueueState(ICifComponent *iface, DWORD state)
Definition: icif.c:707
#define InterlockedIncrement
Definition: armddk.h:53
BOOL inf_section_next_value(struct inf_section *sec, struct inf_value **value)
Definition: inf.c:219
static real win[4][36]
static const IEnumCifComponentsVtbl enum_componentsVtbl
Definition: icif.c:882
GLuint start
Definition: gl.h:1545
static HRESULT WINAPI component_GetTreatAsOneComponents(ICifComponent *iface, UINT index, char *id, DWORD size)
Definition: icif.c:653
struct list dependencies
Definition: icif.c:131
static HRESULT WINAPI component_GetDependency(ICifComponent *iface, UINT index, char *id, DWORD id_size, char *type, DWORD *ver, DWORD *build)
Definition: icif.c:561
static ULONG WINAPI ciffile_AddRef(ICifFile *iface)
Definition: icif.c:1047
Definition: inf.c:30
#define E_NOTIMPL
Definition: ddrawi.h:99
Definition: services.c:325
static HRESULT WINAPI enum_groups_Next(IEnumCifGroups *iface, ICifGroup **group)
Definition: icif.c:964
#define min(a, b)
Definition: monoChain.cc:55
unsigned int UINT
Definition: ndis.h:50
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
char * id
Definition: icif.c:88
struct list entry
Definition: fci.c:128
__WINE_SERVER_LIST_INLINE void list_add_before(struct list *elem, struct list *to_add)
Definition: list.h:87
cd_progress_ptr progress
Definition: cdjpeg.h:150
struct list entry
Definition: icif.c:79
DWORD current_priority
Definition: icif.c:141
static HRESULT WINAPI ciffile_FindGroup(ICifFile *iface, const char *id, ICifGroup **group)
Definition: icif.c:1136
static HRESULT WINAPI component_GetDescription(ICifComponent *iface, char *desc, DWORD size)
Definition: icif.c:364
static HRESULT WINAPI enum_groups_Reset(IEnumCifGroups *iface)
Definition: icif.c:984
Definition: icif.c:77
LONG ref
Definition: icif.c:70
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
char * group
Definition: icif.c:104
_Check_return_ long __cdecl strtol(_In_z_ const char *_Str, _Out_opt_ _Deref_post_z_ char **_EndPtr, _In_ int _Radix)
struct list entry
Definition: icif.c:96
__WINE_SERVER_LIST_INLINE struct list * list_next(const struct list *list, const struct list *elem)
Definition: list.h:115
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
struct list * position
Definition: icif.c:74
IEnumCifGroups IEnumCifGroups_iface
Definition: icif.c:69
char * id
Definition: icif.c:100
unsigned int ULONG
Definition: retypes.h:1
static HRESULT WINAPI ciffile_EnumComponents(ICifFile *iface, IEnumCifComponents **enum_components, DWORD filter, void *pv)
Definition: icif.c:1089
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
int details
Definition: msacm.c:1353
static HRESULT WINAPI component_GetLocale(ICifComponent *iface, char *locale, DWORD size)
Definition: icif.c:448
static HRESULT WINAPI enum_components_Reset(IEnumCifComponents *iface)
Definition: icif.c:872
static void component_free(struct cifcomponent *comp)
Definition: icif.c:215
static int priority
Definition: timer.c:163
static HRESULT WINAPI enum_components_Next(IEnumCifComponents *iface, ICifComponent **component)
Definition: icif.c:840
static const ICifFileVtbl ciffileVtbl
Definition: icif.c:1191
char * description
Definition: icif.c:51
char * inf_value_get_key(struct inf_value *value)
Definition: inf.c:248
static char * dest
Definition: rtl.c:135
static void strip_quotes(WCHAR *word, WCHAR **end)
Definition: xcopy.c:701
static DWORD WINAPI component_GetDownloadSize(ICifComponent *iface)
Definition: icif.c:481
char * id
Definition: icif.c:50
ICifGroup ICifGroup_iface
Definition: icif.c:44
char * trim(char *str, char **last_chr, BOOL strip_quotes)
Definition: inf.c:258
static HRESULT WINAPI component_GetInstalledSize(ICifComponent *iface, DWORD *win, DWORD *app)
Definition: icif.c:466
static LPSTR strdupA(LPCSTR str)
Definition: mimeole.c:482
#define DEFAULT_INSTALLER_DESC
Definition: icif.c:40
static HRESULT WINAPI ciffile_GetDetDlls(ICifFile *iface, char *dlls, DWORD size)
Definition: icif.c:1182
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glext.h:7005
ICifFile * parent
Definition: icif.c:48
static HRESULT WINAPI ciffile_QueryInterface(ICifFile *iface, REFIID riid, void **ppv)
Definition: icif.c:1022
Definition: inf.c:48
struct list * start
Definition: icif.c:73
static ULONG WINAPI enum_groups_Release(IEnumCifGroups *iface)
Definition: icif.c:948
struct list * position
Definition: icif.c:62
static HRESULT WINAPI component_RequiresAdminRights(ICifComponent *iface)
Definition: icif.c:543
DWORD visibleui
Definition: icif.c:126
#define SUCCEEDED(hr)
Definition: intsafe.h:57
static HRESULT WINAPI component_SetCurrentPriority(ICifComponent *iface, DWORD priority)
Definition: icif.c:736
Definition: path.c:42
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
Definition: fci.c:126