ReactOS 0.4.15-dev-6656-gbbb33a6
devclass.c
Go to the documentation of this file.
1/*
2 * SetupAPI device class-related functions
3 *
4 * Copyright 2000 Andreas Mohr for CodeWeavers
5 * 2005-2006 Hervé Poussineau (hpoussin@reactos.org)
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 */
21
22#include "setupapi_private.h"
23
24#include <wingdi.h>
25#include <shellapi.h>
26#include <strsafe.h>
27
28/* Unicode constants */
29static const WCHAR BackSlash[] = {'\\',0};
30static const WCHAR ClassGUID[] = {'C','l','a','s','s','G','U','I','D',0};
31static const WCHAR ClassInstall32[] = {'C','l','a','s','s','I','n','s','t','a','l','l','3','2',0};
32static const WCHAR DotServices[] = {'.','S','e','r','v','i','c','e','s',0};
33static const WCHAR InterfaceInstall32[] = {'I','n','t','e','r','f','a','c','e','I','n','s','t','a','l','l','3','2',0};
34static const WCHAR SetupapiDll[] = {'s','e','t','u','p','a','p','i','.','d','l','l',0};
35
36typedef BOOL
38 IN PSP_PROPSHEETPAGE_REQUEST PropPageRequest,
39 IN LPFNADDPROPSHEETPAGE fAddFunc,
41typedef BOOL
47
48static BOOL
54
55static BOOL
61
63{
69
70#define ADD_PARAM_HANDLER(Function, UpdateHandler, ParamsType, ParamsField) \
71 { Function, UpdateHandler, sizeof(ParamsType), FIELD_OFFSET(struct ClassInstallParams, ParamsField) },
72
76};
77#undef ADD_PARAM_HANDLER
78
79#define UNKNOWN_ICON_INDEX 18
80
81/***********************************************************************
82 * SetupDiDestroyClassImageList(SETUPAPI.@)
83 */
86 IN PSP_CLASSIMAGELIST_DATA ClassImageListData)
87{
88 struct ClassImageList *list;
89 BOOL ret = FALSE;
90
91 TRACE("%p\n", ClassImageListData);
92
93 if (!ClassImageListData)
95 else if (ClassImageListData->cbSize != sizeof(SP_CLASSIMAGELIST_DATA))
97 else if ((list = (struct ClassImageList *)ClassImageListData->Reserved) == NULL)
99 else if (list->magic != SETUP_CLASS_IMAGE_LIST_MAGIC)
101 else
102 {
103 /* If Reserved wasn't NULL, then this is valid too */
104 if (ClassImageListData->ImageList)
105 {
106 ImageList_Destroy(ClassImageListData->ImageList);
107 ClassImageListData->ImageList = NULL;
108 }
109
110 MyFree(list);
111 ClassImageListData->Reserved = 0;
112
113 ret = TRUE;
114 }
115
116 TRACE("Returning %d\n", ret);
117 return ret;
118}
119
120LONG
122 IN OUT struct DeviceInfoSet *list,
125 IN PCWSTR Enumerator OPTIONAL)
126{
128 DWORD BufferLength = 4096;
129 PCWSTR InstancePath;
130 struct DeviceInfo *deviceInfo;
131 WCHAR ClassGuidBuffer[MAX_GUID_STRING_LEN];
132 DWORD ClassGuidBufferSize;
135 CONFIGRET cr;
136
138 if (!Buffer)
140
141 do
142 {
143 cr = CM_Get_Device_ID_List_ExW(Enumerator,
144 Buffer,
145 BufferLength / sizeof(WCHAR),
147 list->hMachine);
148 if (cr == CR_BUFFER_SMALL)
149 {
150 if (Buffer)
152 BufferLength *= 2;
154 if (!Buffer)
156 }
157 else if (cr != CR_SUCCESS)
158 {
159 TRACE("CM_Get_Device_ID_List_ExW() failed with status 0x%x\n", cr);
160 if (Buffer)
162 return GetErrorCodeFromCrCode(cr);
163 }
164 }
165 while (cr != CR_SUCCESS);
166
167 for (InstancePath = Buffer; *InstancePath != UNICODE_NULL; InstancePath += wcslen(InstancePath) + 1)
168 {
169 /* Check that device really exists */
170 TRACE("Checking %S\n", InstancePath);
172 (DEVINSTID_W)InstancePath,
174 list->hMachine);
175 if (cr != CR_SUCCESS)
176 {
177 ERR("CM_Locate_DevNode_ExW('%S') failed with status 0x%x\n", InstancePath, cr);
178 continue;
179 }
180
181 /* Retrieve GUID of this device */
182 ClassGuidBufferSize = sizeof(ClassGuidBuffer);
185 NULL,
186 ClassGuidBuffer,
187 &ClassGuidBufferSize,
188 0,
189 list->hMachine);
190 if (cr == CR_SUCCESS)
191 {
192 ClassGuidBuffer[MAX_GUID_STRING_LEN - 2] = '\0'; /* Replace the } by a NULL character */
193 if (UuidFromStringW(&ClassGuidBuffer[1], &ClassGuid) != RPC_S_OK)
194 {
195 /* Bad GUID, skip the entry */
196 ERR("Invalid ClassGUID '%S' for device %S\n", ClassGuidBuffer, InstancePath);
197 continue;
198 }
199 }
200 else
201 {
202 TRACE("Using default class GUID_NULL for device %S\n", InstancePath);
203 memcpy(&ClassGuid, &GUID_NULL, sizeof(GUID));
204 }
205
206 if (Class && !IsEqualIID(&ClassGuid, Class))
207 {
208 TRACE("Skipping %S due to wrong class GUID\n", InstancePath);
209 continue;
210 }
211
212 /* Good! Create a device info element */
213 if (!CreateDeviceInfo(list, InstancePath, &ClassGuid, &deviceInfo))
214 {
215 ERR("Failed to create info for %S\n", InstancePath);
217 return GetLastError();
218 }
219
220 TRACE("Adding device %s to list\n", debugstr_w(InstancePath));
221 InsertTailList(&list->ListHead, &deviceInfo->ListEntry);
222 }
223
225 return ERROR_SUCCESS;
226}
227
228static BOOL
231 OUT PINT ImageIndex)
232{
234 DWORD dwRegType, dwLength;
235 LONG rc;
236 BOOL ret = FALSE;
237
238 /* Read icon registry key */
240 if (rc != ERROR_SUCCESS)
241 {
242 SetLastError(rc);
243 goto cleanup;
244 } else if (dwRegType != REG_SZ)
245 {
247 goto cleanup;
248 }
249 Buffer = MyMalloc(dwLength + sizeof(WCHAR));
250 if (!Buffer)
251 {
253 goto cleanup;
254 }
256 if (rc != ERROR_SUCCESS)
257 {
258 SetLastError(rc);
259 goto cleanup;
260 }
261 /* make sure the returned buffer is NULL-terminated */
262 Buffer[dwLength / sizeof(WCHAR)] = 0;
263
264 /* Transform icon value to a INT */
265 *ImageIndex = atoiW(Buffer);
266 ret = TRUE;
267
268cleanup:
269 MyFree(Buffer);
270 return ret;
271}
272
273/***********************************************************************
274 * SetupDiGetClassImageIndex (SETUPAPI.@)
275 */
278 IN PSP_CLASSIMAGELIST_DATA ClassImageListData,
280 OUT PINT ImageIndex)
281{
282 struct ClassImageList *list;
283 BOOL ret = FALSE;
284
285 TRACE("%p %s %p\n", ClassImageListData, debugstr_guid(ClassGuid), ImageIndex);
286
287 if (!ClassImageListData || !ClassGuid || !ImageIndex)
289 else if (ClassImageListData->cbSize != sizeof(SP_CLASSIMAGELIST_DATA))
291 else if ((list = (struct ClassImageList *)ClassImageListData->Reserved) == NULL)
293 else if (list->magic != SETUP_CLASS_IMAGE_LIST_MAGIC)
295 else
296 {
297 DWORD i;
298
299 for (i = 0; i < list->NumberOfGuids; i++)
300 {
301 if (IsEqualIID(ClassGuid, &list->Guids[i]))
302 break;
303 }
304
305 if (i == list->NumberOfGuids || list->IconIndexes[i] < 0)
307 else
308 {
309 *ImageIndex = list->IconIndexes[i];
310 ret = TRUE;
311 }
312 }
313
314 TRACE("Returning %d\n", ret);
315 return ret;
316}
317
318/***********************************************************************
319 * SetupDiGetClassImageList(SETUPAPI.@)
320 */
323 OUT PSP_CLASSIMAGELIST_DATA ClassImageListData)
324{
325 return SetupDiGetClassImageListExW(ClassImageListData, NULL, NULL);
326}
327
328/***********************************************************************
329 * SetupDiGetClassImageListExA(SETUPAPI.@)
330 */
333 OUT PSP_CLASSIMAGELIST_DATA ClassImageListData,
336{
337 PWSTR MachineNameW = NULL;
338 BOOL ret;
339
340 if (MachineName)
341 {
343 if (MachineNameW == NULL)
344 return FALSE;
345 }
346
347 ret = SetupDiGetClassImageListExW(ClassImageListData, MachineNameW, Reserved);
348
349 MyFree(MachineNameW);
350
351 return ret;
352}
353
354static BOOL WINAPI
355SETUP_GetClassIconInfo(IN CONST GUID *ClassGuid, OUT PINT OutIndex, OUT LPWSTR *OutDllName)
356{
358 INT iconIndex = -UNKNOWN_ICON_INDEX;
360 BOOL ret = FALSE;
361
362 if (ClassGuid)
363 {
366 {
367 SETUP_GetIconIndex(hKey, &iconIndex);
368 }
369 }
370
371 if (iconIndex > 0)
372 {
373 /* Look up icon in dll specified by Installer32 or EnumPropPages32 key */
374 PWCHAR Comma;
375 LONG rc;
376 DWORD dwRegType, dwLength;
378 if (rc == ERROR_SUCCESS && dwRegType == REG_SZ)
379 {
380 Buffer = MyMalloc(dwLength + sizeof(WCHAR));
381 if (Buffer == NULL)
382 {
384 goto cleanup;
385 }
387 if (rc != ERROR_SUCCESS)
388 {
389 SetLastError(rc);
390 goto cleanup;
391 }
392 /* make sure the returned buffer is NULL-terminated */
393 Buffer[dwLength / sizeof(WCHAR)] = 0;
394 }
395 else if
397 && dwRegType == REG_SZ)
398 {
399 Buffer = MyMalloc(dwLength + sizeof(WCHAR));
400 if (Buffer == NULL)
401 {
403 goto cleanup;
404 }
406 if (rc != ERROR_SUCCESS)
407 {
408 SetLastError(rc);
409 goto cleanup;
410 }
411 /* make sure the returned buffer is NULL-terminated */
412 Buffer[dwLength / sizeof(WCHAR)] = 0;
413 }
414 else
415 {
416 /* Unable to find where to load the icon */
418 goto cleanup;
419 }
420 Comma = strchrW(Buffer, ',');
421 if (!Comma)
422 {
424 goto cleanup;
425 }
426 *Comma = '\0';
427 *OutDllName = Buffer;
428 }
429 else
430 {
431 /* Look up icon in setupapi.dll */
432 iconIndex = -iconIndex;
433 *OutDllName = NULL;
434 }
435
436 *OutIndex = iconIndex;
437 ret = TRUE;
438
439 TRACE("Icon index %d, dll name %s\n", iconIndex, debugstr_w(*OutDllName ? *OutDllName : SetupapiDll));
440
441cleanup:
442
445
446 if (Buffer && !ret)
447 MyFree(Buffer);
448
449 return ret;
450}
451
452
453/***********************************************************************
454 * SetupDiGetClassImageListExW(SETUPAPI.@)
455 */
458 OUT PSP_CLASSIMAGELIST_DATA ClassImageListData,
461{
462 BOOL ret = FALSE;
463
464 TRACE("%p %p %p\n", ClassImageListData, debugstr_w(MachineName), Reserved);
465
466 if (!ClassImageListData)
468 else if (ClassImageListData->cbSize != sizeof(SP_CLASSIMAGELIST_DATA))
470 else if (Reserved)
472 else
473 {
474 struct ClassImageList *list = NULL;
475 HDC hDC;
477 DWORD ilMask, bkColor;
478 HICON hIcon;
479 DWORD size;
480 INT i, bpp;
481 UINT idx;
482
483 /* Get list of all class GUIDs in given computer */
485 0,
486 NULL,
487 0,
490 NULL);
492 goto cleanup;
493
494 size = sizeof(struct ClassImageList)
497 if (!list)
498 {
500 goto cleanup;
501 }
503 list->NumberOfGuids = RequiredSize;
504 list->Guids = (GUID*)(list + 1);
505 list->IconIndexes = (INT*)((ULONG_PTR)(list + 1) + sizeof(GUID) * RequiredSize);
506
508 0,
509 list->Guids,
510 list->NumberOfGuids,
513 NULL);
514 if (!ret)
515 goto cleanup;
516 else if (RequiredSize != list->NumberOfGuids)
517 {
518 /* Hm. Class list changed since last call. Ignore
519 * this case as it should be very rare */
521 ret = FALSE;
522 goto cleanup;
523 }
524
525 /* Prepare a HIMAGELIST */
527
528 hDC = GetDC(NULL);
529 if (!hDC)
530 goto cleanup;
531
534
535 if (bpp <= 4)
536 ilMask = ILC_COLOR4;
537 else if (bpp <= 8)
538 ilMask = ILC_COLOR8;
539 else if (bpp <= 16)
540 ilMask = ILC_COLOR16;
541 else if (bpp <= 24)
542 ilMask = ILC_COLOR24;
543 else if (bpp <= 32)
544 ilMask = ILC_COLOR32;
545 else
546 ilMask = ILC_COLOR;
547
548 ilMask |= ILC_MASK;
549
550 ClassImageListData->ImageList = ImageList_Create(16, 16, ilMask, 100, 10);
551 if (!ClassImageListData->ImageList)
552 goto cleanup;
553
554 ClassImageListData->Reserved = (ULONG_PTR)list;
555
556 /* For some reason, Windows sets the list background to COLOR_WINDOW */
557 bkColor = GetSysColor(COLOR_WINDOW);
558 ImageList_SetBkColor(ClassImageListData->ImageList, bkColor);
559
560 /* Now, we "simply" need to load icons associated with all class guids,
561 * and put their index in the image list in the IconIndexes array */
562 for (i = 0; i < list->NumberOfGuids; i++)
563 {
564 INT miniIconIndex;
565 LPWSTR DllName = NULL;
566
567 if (SETUP_GetClassIconInfo(&list->Guids[i], &miniIconIndex, &DllName))
568 {
569 if (DllName && ExtractIconExW(DllName, -miniIconIndex, NULL, &hIcon, 1) == 1)
570 {
571 list->IconIndexes[i] = ImageList_AddIcon(ClassImageListData->ImageList, hIcon);
572 }
573 else if(!DllName)
574 {
576 list->IconIndexes[i] = ImageList_AddIcon(ClassImageListData->ImageList, hIcon);
577 }
578
579 if(hIcon)
581 else
582 list->IconIndexes[i] = -1;
583
584 if(DllName)
585 MyFree(DllName);
586 }
587 else
588 {
589 list->IconIndexes[i] = -1; /* Special value to indicate that the icon is unavailable */
590 }
591 }
592
593 /* Finally, add the overlay icons to the image list */
594 for (i = 0; i <= 2; i++)
595 {
597 if (hIcon)
598 {
599 idx = ImageList_AddIcon(ClassImageListData->ImageList, hIcon);
600 if (idx != -1)
601 ImageList_SetOverlayImage(ClassImageListData->ImageList, idx, i + 1);
603 }
604 }
605
606 ret = TRUE;
607
608cleanup:
609 if (!ret)
610 {
611 if (ClassImageListData->Reserved)
612 SetupDiDestroyClassImageList(ClassImageListData);
613 else if (list)
614 MyFree(list);
615 }
616 }
617
618 TRACE("Returning %d\n", ret);
619 return ret;
620}
621
622/***********************************************************************
623 * SetupDiGetClassInstallParamsA(SETUPAPI.@)
624 */
632{
633 FIXME("SetupDiGetClassInstallParamsA(%p %p %p %lu %p) Stub\n",
635 return FALSE;
636}
637
638/***********************************************************************
639 * SetupDiGetClassInstallParamsW(SETUPAPI.@)
640 */
648{
649 FIXME("SetupDiGetClassInstallParamsW(%p %p %p %lu %p) Stub\n",
651 return FALSE;
652}
653
654/***********************************************************************
655 * SetupDiLoadClassIcon(SETUPAPI.@)
656 */
659 IN CONST GUID *ClassGuid,
660 OUT HICON *LargeIcon OPTIONAL,
661 OUT PINT MiniIconIndex OPTIONAL)
662{
663 INT iconIndex = 0;
664 LPWSTR DllName = NULL;
665 BOOL ret = FALSE;
666 HICON hIcon = NULL;
667
668 if (LargeIcon)
669 {
670 if(!SETUP_GetClassIconInfo(ClassGuid, &iconIndex, &DllName))
671 goto cleanup;
672
673 if (!DllName || ExtractIconExW(DllName, -iconIndex, &hIcon, NULL, 1) != 1 || hIcon == NULL)
674 {
675 /* load the default unknown device icon if ExtractIcon failed */
676 if(DllName)
677 iconIndex = UNKNOWN_ICON_INDEX;
678
680
681 if(!hIcon)
682 goto cleanup;
683 }
684
685 *LargeIcon = hIcon;
686 }
687
688 if (MiniIconIndex)
689 *MiniIconIndex = iconIndex;
690
691 ret = TRUE;
692
693cleanup:
694
695 if(DllName)
696 MyFree(DllName);
697
698 TRACE("Returning %d\n", ret);
699 return ret;
700}
701
702/***********************************************************************
703 * SetupDiInstallClassExW (SETUPAPI.@)
704 */
705HKEY
710 IN PCWSTR InfFileName OPTIONAL,
711 IN DWORD Flags,
712 IN HSPFILEQ FileQueue OPTIONAL,
716{
717 BOOL ret = FALSE;
718
719 TRACE("%p %s 0x%lx %p %s %p %p\n", hwndParent, debugstr_w(InfFileName), Flags,
721
722 if (!InfFileName)
723 {
724 FIXME("Case not implemented: InfFileName NULL\n");
726 }
728 {
729 TRACE("Unknown flags: 0x%08lx\n", Flags & ~(DI_NOVCP | DI_NOBROWSE | DI_FORCECOPY | DI_QUIETINSTALL));
731 }
732 else if ((Flags & DI_NOVCP) && FileQueue == NULL)
734 else if (Reserved1 != NULL)
736 else if (Reserved2 != NULL)
738 else
739 {
740 HDEVINFO hDeviceInfo = INVALID_HANDLE_VALUE;
741 SP_DEVINSTALL_PARAMS_W InstallParams;
742 WCHAR SectionName[MAX_PATH];
744 HKEY hRootKey = INVALID_HANDLE_VALUE;
746
747 hDeviceInfo = SetupDiCreateDeviceInfoList(NULL, NULL);
748 if (hDeviceInfo == INVALID_HANDLE_VALUE)
749 goto cleanup;
750
751 InstallParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS);
752 if (!SetupDiGetDeviceInstallParamsW(hDeviceInfo, NULL, &InstallParams))
753 goto cleanup;
754
755 InstallParams.Flags &= ~(DI_NOVCP | DI_NOBROWSE | DI_QUIETINSTALL);
756 InstallParams.Flags |= Flags & (DI_NOVCP | DI_NOBROWSE | DI_QUIETINSTALL);
757 if (Flags & DI_NOVCP)
758 InstallParams.FileQueue = FileQueue;
759 if (!SetupDiSetDeviceInstallParamsW(hDeviceInfo, NULL, &InstallParams))
760 goto cleanup;
761
762 /* Open the .inf file */
763 hInf = SetupOpenInfFileW(
764 InfFileName,
765 NULL,
767 NULL);
768 if (hInf == INVALID_HANDLE_VALUE)
769 goto cleanup;
770
771 /* Try to append a layout file */
773
775 {
776 /* Retrieve the actual section name */
778 hInf,
780 SectionName,
781 MAX_PATH,
782 NULL,
783 NULL);
784 if (!ret)
785 goto cleanup;
786
787 /* Open registry key related to this interface */
788 /* FIXME: What happens if the key doesn't exist? */
790 if (hRootKey == INVALID_HANDLE_VALUE)
791 goto cleanup;
792
793 /* SetupDiCreateDeviceInterface??? */
794 FIXME("Installing an interface is not implemented\n");
796 }
797 else
798 {
799 /* Create or open the class registry key 'HKLM\CurrentControlSet\Class\{GUID}' */
800 hRootKey = SETUP_CreateClassKey(hInf);
801 if (hRootKey == INVALID_HANDLE_VALUE)
802 goto cleanup;
803
804 /* Retrieve the actual section name */
806 hInf,
808 SectionName,
810 NULL,
811 NULL);
812 if (!ret)
813 goto cleanup;
814
816 if (!callback_context)
817 goto cleanup;
818
821 hInf,
822 SectionName,
824 hRootKey,
825 NULL, /* FIXME: SourceRootPath */
826 !(Flags & DI_NOVCP) && (Flags & DI_FORCECOPY) ? SP_COPY_FORCE_IN_USE : 0, /* CopyFlags */
829 hDeviceInfo,
830 NULL);
831 if (!ret)
832 goto cleanup;
833
834 /* OPTIONAL: Install .Services section */
835 lstrcatW(SectionName, DotServices);
837 hInf,
838 SectionName,
839 0,
840 hDeviceInfo,
841 NULL,
842 NULL,
843 NULL);
844 ret = TRUE;
845 }
846
847cleanup:
848 if (hDeviceInfo != INVALID_HANDLE_VALUE)
849 SetupDiDestroyDeviceInfoList(hDeviceInfo);
850 if (hInf != INVALID_HANDLE_VALUE)
851 SetupCloseInfFile(hInf);
852 if (hRootKey != INVALID_HANDLE_VALUE)
853 RegCloseKey(hRootKey);
855 }
856
857 TRACE("Returning %d\n", ret);
858 return ret;
859}
860
861/***********************************************************************
862 * Helper functions for SetupDiSetClassInstallParamsW
863 */
864static BOOL
870{
872 BOOL ret = FALSE;
873
874 if (!DeviceInfoData)
878 else if (PropChangeParams && PropChangeParams->StateChange != DICS_ENABLE
879 && PropChangeParams->StateChange != DICS_DISABLE && PropChangeParams->StateChange != DICS_PROPCHANGE
880 && PropChangeParams->StateChange != DICS_START && PropChangeParams->StateChange != DICS_STOP)
882 else if (PropChangeParams && PropChangeParams->Scope != DICS_FLAG_GLOBAL
883 && PropChangeParams->Scope != DICS_FLAG_CONFIGSPECIFIC)
885 else if (PropChangeParams
886 && (PropChangeParams->StateChange == DICS_START || PropChangeParams->StateChange == DICS_STOP)
887 && PropChangeParams->Scope != DICS_FLAG_CONFIGSPECIFIC)
889 else
890 {
891 PSP_PROPCHANGE_PARAMS *CurrentPropChangeParams;
892 struct DeviceInfo *deviceInfo = (struct DeviceInfo *)DeviceInfoData->Reserved;
893 CurrentPropChangeParams = &deviceInfo->ClassInstallParams.PropChangeParams;
894
895 if (*CurrentPropChangeParams)
896 {
897 MyFree(*CurrentPropChangeParams);
898 *CurrentPropChangeParams = NULL;
899 }
900 if (PropChangeParams)
901 {
902 *CurrentPropChangeParams = MyMalloc(ClassInstallParamsSize);
903 if (!*CurrentPropChangeParams)
904 {
906 goto done;
907 }
908 memcpy(*CurrentPropChangeParams, PropChangeParams, ClassInstallParamsSize);
909 }
910 ret = TRUE;
911 }
912
913done:
914 return ret;
915}
916
917static BOOL
923{
925 BOOL ret = FALSE;
926
929 else if (AddPropertyPageData && AddPropertyPageData->Flags != 0)
931 else if (AddPropertyPageData && AddPropertyPageData->NumDynamicPages >= MAX_INSTALLWIZARD_DYNAPAGES)
933 else
934 {
935 PSP_ADDPROPERTYPAGE_DATA *CurrentAddPropertyPageData;
936 if (!DeviceInfoData)
937 {
938 struct DeviceInfoSet *list = (struct DeviceInfoSet *)DeviceInfoSet;
939 CurrentAddPropertyPageData = &list->ClassInstallParams.AddPropertyPageData;
940 }
941 else
942 {
943 struct DeviceInfo *deviceInfo = (struct DeviceInfo *)DeviceInfoData->Reserved;
944 CurrentAddPropertyPageData = &deviceInfo->ClassInstallParams.AddPropertyPageData;
945 }
946 if (*CurrentAddPropertyPageData)
947 {
948 MyFree(*CurrentAddPropertyPageData);
949 *CurrentAddPropertyPageData = NULL;
950 }
951 if (AddPropertyPageData)
952 {
953 *CurrentAddPropertyPageData = MyMalloc(ClassInstallParamsSize);
954 if (!*CurrentAddPropertyPageData)
955 {
957 goto done;
958 }
959 memcpy(*CurrentAddPropertyPageData, AddPropertyPageData, ClassInstallParamsSize);
960 }
961 ret = TRUE;
962 }
963
964done:
965 return ret;
966}
967
968/***********************************************************************
969 * SetupDiSetClassInstallParamsW (SETUPAPI.@)
970 */
977{
978 struct DeviceInfoSet *list;
979 BOOL ret = FALSE;
980
981 TRACE("%p %p %p %lu\n", DeviceInfoSet, DeviceInfoData,
983
984 if (!DeviceInfoSet)
990 else if (DeviceInfoData && DeviceInfoData->cbSize != sizeof(SP_DEVINFO_DATA))
992 else if (ClassInstallParams && ClassInstallParams->cbSize != sizeof(SP_CLASSINSTALL_HEADER))
998 else
999 {
1001 BOOL Result;
1002
1005 if (!Result)
1006 goto done;
1007
1009 {
1010 DWORD i;
1011 /* Check parameters in ClassInstallParams */
1012 for (i = 0; i < sizeof(InstallParamsData) / sizeof(InstallParamsData[0]); i++)
1013 {
1014 if (InstallParamsData[i].Function == ClassInstallParams->InstallFunction)
1015 {
1021 if (ret)
1022 {
1025 }
1026 goto done;
1027 }
1028 }
1029 ERR("InstallFunction %u has no associated update handler\n", ClassInstallParams->InstallFunction);
1031 goto done;
1032 }
1033 else
1034 {
1035 InstallParams.Flags &= ~DI_CLASSINSTALLPARAMS;
1037 }
1038 }
1039
1040done:
1041 TRACE("Returning %d\n", ret);
1042 return ret;
1043}
1044
1045/***********************************************************************
1046 * SetupDiGetClassDevPropertySheetsA(SETUPAPI.@)
1047 */
1052 IN LPPROPSHEETHEADERA PropertySheetHeader,
1053 IN DWORD PropertySheetHeaderPageListSize,
1055 IN DWORD PropertySheetType)
1056{
1057 PROPSHEETHEADERW psh;
1058 BOOL ret = FALSE;
1059
1060 TRACE("%p %p %p 0%lx %p 0x%lx\n", DeviceInfoSet, DeviceInfoData,
1061 PropertySheetHeader, PropertySheetHeaderPageListSize,
1062 RequiredSize, PropertySheetType);
1063
1064 if(PropertySheetHeader)
1065 {
1066 psh.dwFlags = PropertySheetHeader->dwFlags;
1067 psh.phpage = PropertySheetHeader->phpage;
1068 psh.nPages = PropertySheetHeader->nPages;
1069 }
1070
1072 PropertySheetHeaderPageListSize, RequiredSize,
1073 PropertySheetType);
1074 if (ret)
1075 {
1076 PropertySheetHeader->nPages = psh.nPages;
1077 }
1078
1079 TRACE("Returning %d\n", ret);
1080 return ret;
1081}
1082
1084{
1089};
1090
1091static BOOL WINAPI
1093 IN HPROPSHEETPAGE hPropSheetPage,
1095{
1096 struct ClassDevPropertySheetsData *PropPageData;
1097
1098 PropPageData = (struct ClassDevPropertySheetsData *)lParam;
1099
1100 PropPageData->NumberOfPages++;
1101
1102 if (PropPageData->PropertySheetHeader->nPages < PropPageData->PropertySheetHeaderPageListSize)
1103 {
1104 PropPageData->PropertySheetHeader->phpage[PropPageData->PropertySheetHeader->nPages] = hPropSheetPage;
1105 PropPageData->PropertySheetHeader->nPages++;
1106 return TRUE;
1107 }
1108
1109 return PropPageData->DontCancel;
1110}
1111
1112static DWORD
1114 IN HKEY hKey,
1115 IN LPWSTR lpValueName,
1116 OUT LPWSTR *lpString)
1117{
1119 DWORD dwLength = 0;
1120 DWORD dwRegType;
1121 DWORD rc;
1122
1123 *lpString = NULL;
1124
1125 RegQueryValueExW(hKey, lpValueName, NULL, &dwRegType, NULL, &dwLength);
1126
1127 if (dwLength == 0 || dwRegType != REG_SZ)
1128 return ERROR_FILE_NOT_FOUND;
1129
1130 lpBuffer = HeapAlloc(GetProcessHeap(), 0, dwLength + sizeof(WCHAR));
1131 if (lpBuffer == NULL)
1133
1134 rc = RegQueryValueExW(hKey, lpValueName, NULL, NULL, (LPBYTE)lpBuffer, &dwLength);
1135 if (rc != ERROR_SUCCESS)
1136 {
1138 return rc;
1139 }
1140
1141 lpBuffer[dwLength / sizeof(WCHAR)] = UNICODE_NULL;
1142
1143 *lpString = lpBuffer;
1144
1145 return ERROR_SUCCESS;
1146}
1147
1148static
1149BOOL
1151 IN DI_FUNCTION InstallFunction,
1155{
1156 PSP_CLASSINSTALL_HEADER pClassInstallParams = NULL;
1157 DWORD dwSize = 0;
1158 DWORD dwError;
1159 BOOL ret = TRUE;
1160
1161 /* Get the size of the old class install parameters */
1164 NULL,
1165 0,
1166 &dwSize))
1167 {
1168 dwError = GetLastError();
1169 if (dwError != ERROR_INSUFFICIENT_BUFFER)
1170 {
1171 ERR("SetupDiGetClassInstallParams failed (Error %lu)\n", dwError);
1172 return FALSE;
1173 }
1174 }
1175
1176 /* Allocate a buffer for the old class install parameters */
1177 pClassInstallParams = HeapAlloc(GetProcessHeap(), 0, dwSize);
1178 if (pClassInstallParams == NULL)
1179 {
1180 ERR("Failed to allocate the parameters buffer!\n");
1181 return FALSE;
1182 }
1183
1184 /* Save the old class install parameters */
1187 pClassInstallParams,
1188 dwSize,
1189 &dwSize))
1190 {
1191 ERR("SetupDiGetClassInstallParams failed (Error %lu)\n", GetLastError());
1192 ret = FALSE;
1193 goto done;
1194 }
1195
1196 /* Set the new class install parameters */
1199 &PageData->ClassInstallHeader,
1200 sizeof(SP_ADDPROPERTYPAGE_DATA)))
1201 {
1202 ERR("SetupDiSetClassInstallParams failed (Error %lu)\n", dwError);
1203 ret = FALSE;
1204 goto done;
1205 }
1206
1207 /* Call the installer */
1208 ret = SetupDiCallClassInstaller(InstallFunction,
1211 if (ret == FALSE)
1212 {
1213 ERR("SetupDiCallClassInstaller failed\n");
1214 goto done;
1215 }
1216
1217 /* Read the new class installer parameters */
1220 &PageData->ClassInstallHeader,
1222 NULL))
1223 {
1224 ERR("SetupDiGetClassInstallParams failed (Error %lu)\n", GetLastError());
1225 ret = FALSE;
1226 goto done;
1227 }
1228
1229done:
1230 /* Restore and free the old class install parameters */
1231 if (pClassInstallParams != NULL)
1232 {
1235 pClassInstallParams,
1236 dwSize);
1237
1238 HeapFree(GetProcessHeap(), 0, pClassInstallParams);
1239 }
1240
1241 return ret;
1242}
1243
1244/***********************************************************************
1245 * SetupDiGetClassDevPropertySheetsW(SETUPAPI.@)
1246 */
1254 IN DWORD PropertySheetType)
1255{
1256 struct DeviceInfoSet *devInfoSet = NULL;
1257 struct DeviceInfo *devInfo = NULL;
1258 BOOL ret = FALSE;
1259
1260 TRACE("%p %p %p 0%lx %p 0x%lx\n", DeviceInfoSet, DeviceInfoData,
1261 PropertySheetHeader, PropertySheetHeaderPageListSize,
1262 RequiredSize, PropertySheetType);
1263
1264 if (!DeviceInfoSet)
1268 else if ((devInfoSet = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEVICE_INFO_SET_MAGIC)
1270 else if (!PropertySheetHeader)
1272 else if (PropertySheetHeader->dwFlags & PSH_PROPSHEETPAGE)
1274 else if (DeviceInfoData && DeviceInfoData->cbSize != sizeof(SP_DEVINFO_DATA))
1276 else if (!DeviceInfoData && IsEqualIID(&devInfoSet->ClassGuid, &GUID_NULL))
1278 else if (PropertySheetType != DIGCDP_FLAG_ADVANCED
1279 && PropertySheetType != DIGCDP_FLAG_BASIC
1280 && PropertySheetType != DIGCDP_FLAG_REMOTE_ADVANCED
1281 && PropertySheetType != DIGCDP_FLAG_REMOTE_BASIC)
1283 else
1284 {
1287 LPWSTR PropPageProvider = NULL;
1289 PROPERTY_PAGE_PROVIDER pPropPageProvider = NULL;
1290 struct ClassDevPropertySheetsData PropPageData;
1291 SP_ADDPROPERTYPAGE_DATA InstallerPropPageData;
1292 DWORD InitialNumberOfPages, i;
1293 DWORD rc;
1294
1295 if (DeviceInfoData)
1296 devInfo = (struct DeviceInfo *)DeviceInfoData->Reserved;
1297
1298 /* Get the class property page provider */
1299 if (devInfoSet->hmodClassPropPageProvider == NULL)
1300 {
1301 hKey = SetupDiOpenClassRegKeyExW(devInfo ? &devInfo->ClassGuid : &devInfoSet->ClassGuid, KEY_QUERY_VALUE,
1302 DIOCR_INSTALLER, NULL/*devInfoSet->MachineName + 2*/, NULL);
1304 {
1305 rc = SETUP_GetValueString(hKey, REGSTR_VAL_ENUMPROPPAGES_32, &PropPageProvider);
1306 if (rc == ERROR_SUCCESS)
1307 {
1308 rc = GetFunctionPointer(PropPageProvider, &hModule, (PVOID*)&pPropPageProvider);
1309 if (rc != ERROR_SUCCESS)
1310 {
1312 goto cleanup;
1313 }
1314
1315 devInfoSet->hmodClassPropPageProvider = hModule;
1316 devInfoSet->pClassPropPageProvider = pPropPageProvider;
1317
1318 HeapFree(GetProcessHeap(), 0, PropPageProvider);
1319 PropPageProvider = NULL;
1320 }
1321
1324 }
1325 }
1326
1327 /* Get the device property page provider */
1328 if (devInfo != NULL && devInfo->hmodDevicePropPageProvider == NULL)
1329 {
1330 hKey = SETUPDI_OpenDrvKey(devInfoSet->HKLM, devInfo, KEY_QUERY_VALUE);
1332 {
1333 rc = SETUP_GetValueString(hKey, REGSTR_VAL_ENUMPROPPAGES_32, &PropPageProvider);
1334 if (rc == ERROR_SUCCESS)
1335 {
1336 rc = GetFunctionPointer(PropPageProvider, &hModule, (PVOID*)&pPropPageProvider);
1337 if (rc != ERROR_SUCCESS)
1338 {
1340 goto cleanup;
1341 }
1342
1344 devInfo->pDevicePropPageProvider = pPropPageProvider;
1345
1346 HeapFree(GetProcessHeap(), 0, PropPageProvider);
1347 PropPageProvider = NULL;
1348 }
1349
1352 }
1353 }
1354
1355 InitialNumberOfPages = PropertySheetHeader->nPages;
1356
1357 Request.cbSize = sizeof(SP_PROPSHEETPAGE_REQUEST);
1359 Request.DeviceInfoSet = DeviceInfoSet;
1360 Request.DeviceInfoData = DeviceInfoData;
1361
1362 PropPageData.PropertySheetHeader = PropertySheetHeader;
1363 PropPageData.PropertySheetHeaderPageListSize = PropertySheetHeaderPageListSize;
1364 PropPageData.NumberOfPages = 0;
1365 PropPageData.DontCancel = (RequiredSize != NULL) ? TRUE : FALSE;
1366
1367 /* Call the class property page provider */
1368 if (devInfoSet->pClassPropPageProvider != NULL)
1370
1371 /* Call the device property page provider */
1372 if (devInfo != NULL && devInfo->pDevicePropPageProvider != NULL)
1374
1375 /* Call the class installer and add the returned pages */
1376 ZeroMemory(&InstallerPropPageData, sizeof(SP_ADDPROPERTYPAGE_DATA));
1377 InstallerPropPageData.ClassInstallHeader.cbSize = sizeof(SP_CLASSINSTALL_HEADER);
1378 InstallerPropPageData.ClassInstallHeader.InstallFunction = DIF_ADDPROPERTYPAGE_ADVANCED;
1379 InstallerPropPageData.hwndWizardDlg = PropertySheetHeader->hwndParent;
1380
1384 &InstallerPropPageData))
1385 {
1386 for (i = 0; i < InstallerPropPageData.NumDynamicPages; i++)
1387 {
1388 if (PropPageData.PropertySheetHeader->nPages < PropertySheetHeaderPageListSize)
1389 {
1390 PropPageData.PropertySheetHeader->phpage[PropPageData.PropertySheetHeader->nPages] =
1391 InstallerPropPageData.DynamicPages[i];
1392 PropPageData.PropertySheetHeader->nPages++;
1393 }
1394 }
1395
1396 PropPageData.NumberOfPages += InstallerPropPageData.NumDynamicPages;
1397 }
1398
1399 if (RequiredSize)
1400 *RequiredSize = PropPageData.NumberOfPages;
1401
1402 if (InitialNumberOfPages + PropPageData.NumberOfPages <= PropertySheetHeaderPageListSize)
1403 {
1404 ret = TRUE;
1405 }
1406 else
1407 {
1409 }
1410
1411cleanup:
1414
1415 if (PropPageProvider != NULL)
1416 HeapFree(GetProcessHeap(), 0, PropPageProvider);
1417 }
1418
1419 TRACE("Returning %d\n", ret);
1420 return ret;
1421}
static HDC hDC
Definition: 3dtext.c:33
HKEY hClassKey
Definition: umpnpmgr.c:45
@ Reserved2
Definition: bcd.h:202
@ Reserved1
Definition: bcd.h:201
#define FIXME(fmt,...)
Definition: debug.h:111
#define ERR(fmt,...)
Definition: debug.h:110
#define RegCloseKey(hKey)
Definition: registry.h:47
_In_ CDROM_SCAN_FOR_SPECIAL_INFO _In_ PCDROM_SCAN_FOR_SPECIAL_HANDLER Function
Definition: cdrom.h:1156
_Null_terminated_ WCHAR * DEVINSTID_W
Definition: cfgmgr32.h:80
#define CM_DRP_CLASSGUID
Definition: cfgmgr32.h:684
DWORD DEVINST
Definition: cfgmgr32.h:76
#define CM_Locate_DevNode_Ex
Definition: cfgmgr32.h:2405
#define CM_GETIDLIST_FILTER_ENUMERATOR
Definition: cfgmgr32.h:655
#define CR_BUFFER_SMALL
Definition: cfgmgr32.h:872
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_SUCCESS
Definition: cfgmgr32.h:842
#define CM_GETIDLIST_FILTER_NONE
Definition: cfgmgr32.h:654
#define CM_LOCATE_DEVNODE_NORMAL
Definition: cfgmgr32.h:760
CONFIGRET WINAPI CM_Get_DevNode_Registry_Property_ExW(_In_ DEVINST dnDevInst, _In_ ULONG ulProperty, _Out_opt_ PULONG pulRegDataType, _Out_writes_bytes_opt_(*pulLength) PVOID Buffer, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:3480
CONFIGRET WINAPI CM_Get_Device_ID_List_ExW(_In_ PCWSTR pszFilter, _Out_writes_(BufferLen) PWCHAR Buffer, _In_ ULONG BufferLen, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:3889
HINSTANCE hInstance
Definition: charmap.c:19
Definition: bufpool.h:45
Definition: list.h:37
LPARAM lParam
Definition: combotst.c:139
VOID WINAPI InitCommonControls(void)
Definition: commctrl.c:863
static HWND hwndParent
Definition: cryptui.c:300
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:175
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#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 MAX_GUID_STRING_LEN
Definition: apphelp.c:29
DWORD bpp
Definition: surface.c:185
unsigned int idx
Definition: utils.c:41
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4118
HMODULE hModule
Definition: animate.c:44
COLORREF WINAPI ImageList_SetBkColor(HIMAGELIST himl, COLORREF clrBk)
Definition: imagelist.c:2889
BOOL WINAPI ImageList_SetOverlayImage(HIMAGELIST himl, INT iImage, INT iOverlay)
Definition: imagelist.c:3180
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
#define GetProcessHeap()
Definition: compat.h:736
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:109
#define SetLastError(x)
Definition: compat.h:752
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define HeapAlloc
Definition: compat.h:733
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
static DWORD DWORD * dwLength
Definition: fusion.c:86
static void cleanup(void)
Definition: main.c:1335
#define ADD_PARAM_HANDLER(Function, UpdateHandler, ParamsType, ParamsField)
Definition: devclass.c:70
static DWORD SETUP_GetValueString(IN HKEY hKey, IN LPWSTR lpValueName, OUT LPWSTR *lpString)
Definition: devclass.c:1113
BOOL WINAPI SetupDiGetClassDevPropertySheetsW(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN OUT LPPROPSHEETHEADERW PropertySheetHeader, IN DWORD PropertySheetHeaderPageListSize, OUT PDWORD RequiredSize OPTIONAL, IN DWORD PropertySheetType)
Definition: devclass.c:1248
static BOOL WINAPI SETUP_GetClassDevPropertySheetsCallback(IN HPROPSHEETPAGE hPropSheetPage, IN OUT LPARAM lParam)
Definition: devclass.c:1092
LONG SETUP_CreateDevicesList(IN OUT struct DeviceInfoSet *list, IN PCWSTR MachineName OPTIONAL, IN CONST GUID *Class OPTIONAL, IN PCWSTR Enumerator OPTIONAL)
Definition: devclass.c:121
static const WCHAR ClassGUID[]
Definition: devclass.c:30
BOOL WINAPI SetupDiGetClassImageListExW(OUT PSP_CLASSIMAGELIST_DATA ClassImageListData, IN PCWSTR MachineName OPTIONAL, IN PVOID Reserved)
Definition: devclass.c:457
BOOL(* UPDATE_CLASS_PARAM_HANDLER)(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN PSP_CLASSINSTALL_HEADER ClassInstallParams OPTIONAL, IN DWORD ClassInstallParamsSize)
Definition: devclass.c:42
BOOL WINAPI SetupDiLoadClassIcon(IN CONST GUID *ClassGuid, OUT HICON *LargeIcon OPTIONAL, OUT PINT MiniIconIndex OPTIONAL)
Definition: devclass.c:658
BOOL WINAPI SetupDiGetClassInstallParamsA(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, OUT PSP_CLASSINSTALL_HEADER ClassInstallParams OPTIONAL, IN DWORD ClassInstallParamsSize, OUT PDWORD RequiredSize OPTIONAL)
Definition: devclass.c:626
static const WCHAR DotServices[]
Definition: devclass.c:32
static const WCHAR SetupapiDll[]
Definition: devclass.c:34
static const INSTALL_PARAMS_DATA InstallParamsData[]
Definition: devclass.c:73
struct _INSTALL_PARAMS_DATA INSTALL_PARAMS_DATA
static BOOL WINAPI SETUP_GetClassIconInfo(IN CONST GUID *ClassGuid, OUT PINT OutIndex, OUT LPWSTR *OutDllName)
Definition: devclass.c:355
BOOL WINAPI SetupDiGetClassDevPropertySheetsA(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN LPPROPSHEETHEADERA PropertySheetHeader, IN DWORD PropertySheetHeaderPageListSize, OUT PDWORD RequiredSize OPTIONAL, IN DWORD PropertySheetType)
Definition: devclass.c:1049
static BOOL SETUP_CallInstaller(IN DI_FUNCTION InstallFunction, IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN PSP_ADDPROPERTYPAGE_DATA PageData)
Definition: devclass.c:1150
BOOL WINAPI SetupDiDestroyClassImageList(IN PSP_CLASSIMAGELIST_DATA ClassImageListData)
Definition: devclass.c:85
BOOL WINAPI SetupDiGetClassImageListExA(OUT PSP_CLASSIMAGELIST_DATA ClassImageListData, IN PCSTR MachineName OPTIONAL, IN PVOID Reserved)
Definition: devclass.c:332
#define UNKNOWN_ICON_INDEX
Definition: devclass.c:79
BOOL WINAPI SetupDiGetClassImageIndex(IN PSP_CLASSIMAGELIST_DATA ClassImageListData, IN CONST GUID *ClassGuid, OUT PINT ImageIndex)
Definition: devclass.c:277
static const WCHAR BackSlash[]
Definition: devclass.c:29
static BOOL SETUP_PropertyChangeHandler(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN PSP_CLASSINSTALL_HEADER ClassInstallParams OPTIONAL, IN DWORD ClassInstallParamsSize)
Definition: devclass.c:865
BOOL WINAPI SetupDiInstallClassExW(IN HWND hwndParent OPTIONAL, IN PCWSTR InfFileName OPTIONAL, IN DWORD Flags, IN HSPFILEQ FileQueue OPTIONAL, IN CONST GUID *InterfaceClassGuid OPTIONAL, IN PVOID Reserved1, IN PVOID Reserved2)
Definition: devclass.c:708
static const WCHAR InterfaceInstall32[]
Definition: devclass.c:33
BOOL(WINAPI * PROPERTY_PAGE_PROVIDER)(IN PSP_PROPSHEETPAGE_REQUEST PropPageRequest, IN LPFNADDPROPSHEETPAGE fAddFunc, IN LPARAM lParam)
Definition: devclass.c:37
BOOL WINAPI SetupDiSetClassInstallParamsW(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN PSP_CLASSINSTALL_HEADER ClassInstallParams OPTIONAL, IN DWORD ClassInstallParamsSize)
Definition: devclass.c:972
BOOL WINAPI SetupDiGetClassInstallParamsW(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, OUT PSP_CLASSINSTALL_HEADER ClassInstallParams OPTIONAL, IN DWORD ClassInstallParamsSize, OUT PDWORD RequiredSize OPTIONAL)
Definition: devclass.c:642
HKEY SETUP_CreateClassKey(HINF hInf)
Definition: devinst.c:3518
static BOOL SETUP_PropertyAddPropertyAdvancedHandler(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN PSP_CLASSINSTALL_HEADER ClassInstallParams OPTIONAL, IN DWORD ClassInstallParamsSize)
Definition: devclass.c:918
BOOL WINAPI SetupDiGetClassImageList(OUT PSP_CLASSIMAGELIST_DATA ClassImageListData)
Definition: devclass.c:322
static BOOL SETUP_GetIconIndex(IN HKEY hClassKey, OUT PINT ImageIndex)
Definition: devclass.c:229
static const WCHAR ClassInstall32[]
Definition: devclass.c:31
BOOL WINAPI SetupDiBuildClassInfoListExW(DWORD Flags, LPGUID ClassGuidList, DWORD ClassGuidListSize, PDWORD RequiredSize, LPCWSTR MachineName, PVOID Reserved)
Definition: devinst.c:722
BOOL WINAPI SetupDiSetDeviceInstallParamsW(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN PSP_DEVINSTALL_PARAMS_W DeviceInstallParams)
Definition: devinst.c:4558
DWORD GetErrorCodeFromCrCode(const IN CONFIGRET cr)
Definition: devinst.c:94
BOOL WINAPI SetupDiGetDeviceInstallParamsW(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, OUT PSP_DEVINSTALL_PARAMS_W DeviceInstallParams)
Definition: devinst.c:4451
BOOL WINAPI SetupDiCallClassInstaller(DI_FUNCTION InstallFunction, HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData)
Definition: devinst.c:4024
BOOL WINAPI SetupDiGetActualSectionToInstallW(HINF InfHandle, PCWSTR InfSectionName, PWSTR InfSectionWithExt, DWORD InfSectionWithExtSize, PDWORD RequiredSize, PWSTR *Extension)
Definition: devinst.c:1980
HKEY SETUPDI_OpenDrvKey(HKEY RootKey, struct DeviceInfo *devInfo, REGSAM samDesired)
Definition: devinst.c:5857
HKEY WINAPI SetupDiOpenClassRegKey(const GUID *ClassGuid, REGSAM samDesired)
Definition: devinst.c:3618
BOOL WINAPI SetupDiDestroyDeviceInfoList(HDEVINFO devinfo)
Definition: devinst.c:2893
HKEY WINAPI SetupDiOpenClassRegKeyExW(const GUID *ClassGuid, REGSAM samDesired, DWORD Flags, PCWSTR MachineName, PVOID Reserved)
Definition: devinst.c:3662
HDEVINFO WINAPI SetupDiCreateDeviceInfoList(const GUID *ClassGuid, HWND hwndParent)
Definition: devinst.c:1205
BOOL CreateDeviceInfo(IN struct DeviceInfoSet *list, IN LPCWSTR InstancePath, IN LPCGUID pClassGuid, OUT struct DeviceInfo **pDeviceInfo)
Definition: devinst.c:528
BOOL WINAPI SetupInstallFromInfSectionW(HWND owner, HINF hinf, PCWSTR section, UINT flags, HKEY key_root, PCWSTR src_root, UINT copy_flags, PSP_FILE_CALLBACK_W callback, PVOID context, HDEVINFO devinfo, PSP_DEVINFO_DATA devinfo_data)
Definition: install.c:1327
BOOL WINAPI SetupInstallServicesFromInfSectionExW(HINF hinf, PCWSTR sectionname, DWORD flags, HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, PVOID reserved1, PVOID reserved2)
Definition: install.c:2078
LPWSTR WINAPI pSetupMultiByteToUnicode(LPCSTR lpMultiByteStr, UINT uCodePage)
Definition: misc.c:281
LPVOID WINAPI MyMalloc(DWORD dwSize)
Definition: misc.c:147
VOID WINAPI MyFree(LPVOID lpMem)
Definition: misc.c:128
DWORD GetFunctionPointer(IN PWSTR InstallerName, OUT HMODULE *ModulePointer, OUT PVOID *FunctionPointer)
Definition: misc.c:44
HINF WINAPI SetupOpenInfFileW(PCWSTR name, PCWSTR class, DWORD style, UINT *error)
Definition: parser.c:1229
BOOL WINAPI SetupOpenAppendInfFileW(PCWSTR name, HINF parent_hinf, UINT *error)
Definition: parser.c:1346
UINT WINAPI SetupDefaultQueueCallbackW(PVOID context, UINT notification, UINT_PTR param1, UINT_PTR param2)
Definition: queue.c:1729
void WINAPI SetupTermDefaultQueueCallback(PVOID context)
Definition: queue.c:1656
PVOID WINAPI SetupInitDefaultQueueCallback(HWND owner)
Definition: queue.c:1629
#define ULONG_PTR
Definition: config.h:101
#define InsertTailList(ListHead, Entry)
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
GLsizeiptr size
Definition: glext.h:5919
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
UINT WINAPI ExtractIconExW(LPCWSTR lpszFile, INT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIcons)
Definition: iconcache.cpp:866
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define INF_STYLE_WIN4
Definition: infsupp.h:41
#define debugstr_guid
Definition: kernel32.h:35
#define debugstr_w
Definition: kernel32.h:32
#define GUID_NULL
Definition: ks.h:106
#define REG_SZ
Definition: layer.c:22
if(dx< 0)
Definition: linetemp.h:194
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
static HDC
Definition: imagelist.c:92
static HICON
Definition: imagelist.c:84
HICON hIcon
Definition: msconfig.c:44
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
unsigned int UINT
Definition: ndis.h:50
u32_t magic(void)
#define BOOL
Definition: nt_native.h:43
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define KEY_ENUMERATE_SUB_KEYS
Definition: nt_native.h:1019
#define UNICODE_NULL
#define CONST
Definition: pedump.c:81
DWORD * PDWORD
Definition: pedump.c:68
long LONG
Definition: pedump.c:60
#define PSH_PROPSHEETPAGE
Definition: prsht.h:43
BOOL(CALLBACK * LPFNADDPROPSHEETPAGE)(HPROPSHEETPAGE, LPARAM)
Definition: prsht.h:327
#define ILC_COLOR4
Definition: commctrl.h:354
#define ILC_COLOR16
Definition: commctrl.h:356
#define ILC_COLOR8
Definition: commctrl.h:355
#define ILC_COLOR32
Definition: commctrl.h:358
#define ImageList_AddIcon(himl, hicon)
Definition: commctrl.h:415
#define ILC_MASK
Definition: commctrl.h:351
#define ILC_COLOR24
Definition: commctrl.h:357
#define ILC_COLOR
Definition: commctrl.h:352
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define atoiW(s)
Definition: unicode.h:54
#define strchrW(s, c)
Definition: unicode.h:34
#define strlenW(s)
Definition: unicode.h:28
#define REGSTR_VAL_INSTALLER_32
Definition: regstr.h:487
#define REGSTR_VAL_INSICON
Definition: regstr.h:488
#define REGSTR_VAL_ENUMPROPPAGES_32
Definition: regstr.h:490
#define list
Definition: rosglue.h:35
#define RPC_S_OK
Definition: rpcnterr.h:22
RPC_STATUS WINAPI UuidFromStringW(RPC_WSTR s, UUID *uuid)
Definition: rpcrt4_main.c:614
#define SPINST_BITREG
Definition: setupapi.h:593
struct _SP_CLASSINSTALL_HEADER SP_CLASSINSTALL_HEADER
#define SetupDiGetClassInstallParams
Definition: setupapi.h:2596
_In_ DWORD _Out_ PDWORD _In_opt_ PCSTR MachineName
Definition: setupapi.h:1293
SP_NEWDEVICEWIZARD_DATA * PSP_ADDPROPERTYPAGE_DATA
Definition: setupapi.h:983
#define DI_NOVCP
Definition: setupapi.h:49
_In_opt_ PSP_DEVINFO_DATA _In_ DWORD ClassInstallParamsSize
Definition: setupapi.h:1530
#define DI_FORCECOPY
Definition: setupapi.h:70
#define DI_CLASSINSTALLPARAMS
Definition: setupapi.h:66
#define MAX_INSTALLWIZARD_DYNAPAGES
Definition: setupapi.h:459
#define SPINST_INI2REG
Definition: setupapi.h:591
SP_DEVINSTALL_PARAMS_A SP_DEVINSTALL_PARAMS
Definition: setupapi.h:1155
#define DIGCDP_FLAG_BASIC
Definition: setupapi.h:164
#define DI_QUIETINSTALL
Definition: setupapi.h:68
#define SetupDiSetClassInstallParams
Definition: setupapi.h:2617
#define DICS_DISABLE
Definition: setupapi.h:114
#define DIOCR_INTERFACE
Definition: setupapi.h:177
struct _SP_PROPCHANGE_PARAMS * PSP_PROPCHANGE_PARAMS
#define DICS_PROPCHANGE
Definition: setupapi.h:116
struct _SP_PROPSHEETPAGE_REQUEST SP_PROPSHEETPAGE_REQUEST
#define DICS_STOP
Definition: setupapi.h:119
#define SPINST_INIFILES
Definition: setupapi.h:589
#define ERROR_INVALID_PROPPAGE_PROVIDER
Definition: setupapi.h:332
#define SPINST_REGISTRY
Definition: setupapi.h:590
#define DICS_ENABLE
Definition: setupapi.h:112
struct _SP_DEVINSTALL_PARAMS_W SP_DEVINSTALL_PARAMS_W
#define DICS_FLAG_CONFIGSPECIFIC
Definition: setupapi.h:115
#define DI_NOBROWSE
Definition: setupapi.h:55
_In_opt_ PSP_DEVINFO_DATA DeviceInfoData
Definition: setupapi.h:1528
#define DICS_START
Definition: setupapi.h:117
UINT DI_FUNCTION
Definition: setupapi.h:672
#define SP_COPY_FORCE_IN_USE
Definition: setupapi.h:486
#define DIOCR_INSTALLER
Definition: setupapi.h:176
#define SPINST_FILES
Definition: setupapi.h:592
#define DICS_FLAG_GLOBAL
Definition: setupapi.h:113
#define DIF_PROPERTYCHANGE
Definition: setupapi.h:137
#define DIF_ADDPROPERTYPAGE_ADVANCED
Definition: setupapi.h:154
#define DIGCDP_FLAG_ADVANCED
Definition: setupapi.h:165
#define SPPSR_ENUM_ADV_DEVICE_PROPERTIES
Definition: setupapi.h:615
#define SETUP_DEVICE_INFO_SET_MAGIC
#define SETUP_CLASS_IMAGE_LIST_MAGIC
#define TRACE(s)
Definition: solgame.cpp:4
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
LPPROPSHEETHEADERW PropertySheetHeader
Definition: devclass.c:1085
SP_DEVINSTALL_PARAMS_W InstallParams
PVOID pClassPropPageProvider
HMODULE hmodClassPropPageProvider
struct ClassInstallParams ClassInstallParams
DEVINST dnDevInst
PVOID pDevicePropPageProvider
HMODULE hmodDevicePropPageProvider
LIST_ENTRY ListEntry
UPDATE_CLASS_PARAM_HANDLER UpdateHandler
Definition: devclass.c:65
DI_FUNCTION Function
Definition: devclass.c:64
DWORD dwFlags
Definition: prsht.h:294
HPROPSHEETPAGE * phpage
Definition: prsht.h:309
ULONG_PTR Reserved
Definition: setupapi.h:838
uint16_t * PWSTR
Definition: typedefs.h:56
#define OPTIONAL
Definition: typedefs.h:41
const uint16_t * PCWSTR
Definition: typedefs.h:57
unsigned char * LPBYTE
Definition: typedefs.h:53
int32_t INT
Definition: typedefs.h:58
const char * PCSTR
Definition: typedefs.h:52
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
VOID WINAPI SetupCloseInfFile(IN HINF InfHandle)
Definition: infsupp.c:43
int ret
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ ULONG _Out_ PVOID _Out_ PULONG RequiredSize
Definition: wdfdevice.h:4439
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3771
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547
#define ZeroMemory
Definition: winbase.h:1700
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
LONG_PTR LPARAM
Definition: windef.h:208
int * PINT
Definition: windef.h:177
#define WINAPI
Definition: msvc.h:6
#define ERROR_INVALID_USER_BUFFER
Definition: winerror.h:1091
#define ERROR_INVALID_INDEX
Definition: winerror.h:894
#define ERROR_GEN_FAILURE
Definition: winerror.h:134
#define ERROR_INVALID_FLAGS
Definition: winerror.h:583
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define BITSPIXEL
Definition: wingdi.h:720
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
DWORD WINAPI GetSysColor(_In_ int)
#define COLOR_WINDOW
Definition: winuser.h:912
#define IMAGE_ICON
Definition: winuser.h:212
HDC WINAPI GetDC(_In_opt_ HWND)
#define LoadImage
Definition: winuser.h:5805
#define LR_DEFAULTCOLOR
Definition: winuser.h:1081
#define MAKEINTRESOURCE
Definition: winuser.h:591
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
_In_ CONST GUID * InterfaceClassGuid
Definition: iofuncs.h:1136
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184