ReactOS 0.4.15-dev-6656-gbbb33a6
devclass.c File Reference
#include "setupapi_private.h"
#include <wingdi.h>
#include <shellapi.h>
#include <strsafe.h>
Include dependency graph for devclass.c:

Go to the source code of this file.

Classes

struct  _INSTALL_PARAMS_DATA
 
struct  ClassDevPropertySheetsData
 

Macros

#define ADD_PARAM_HANDLER(Function, UpdateHandler, ParamsType, ParamsField)    { Function, UpdateHandler, sizeof(ParamsType), FIELD_OFFSET(struct ClassInstallParams, ParamsField) },
 
#define UNKNOWN_ICON_INDEX   18
 

Typedefs

typedef BOOL(WINAPIPROPERTY_PAGE_PROVIDER) (IN PSP_PROPSHEETPAGE_REQUEST PropPageRequest, IN LPFNADDPROPSHEETPAGE fAddFunc, IN LPARAM lParam)
 
typedef BOOL(* UPDATE_CLASS_PARAM_HANDLER) (IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN PSP_CLASSINSTALL_HEADER ClassInstallParams OPTIONAL, IN DWORD ClassInstallParamsSize)
 
typedef struct _INSTALL_PARAMS_DATA INSTALL_PARAMS_DATA
 

Functions

static BOOL SETUP_PropertyChangeHandler (IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN PSP_CLASSINSTALL_HEADER ClassInstallParams OPTIONAL, IN DWORD ClassInstallParamsSize)
 
static BOOL SETUP_PropertyAddPropertyAdvancedHandler (IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN PSP_CLASSINSTALL_HEADER ClassInstallParams OPTIONAL, IN DWORD ClassInstallParamsSize)
 
BOOL WINAPI SetupDiDestroyClassImageList (IN PSP_CLASSIMAGELIST_DATA ClassImageListData)
 
LONG SETUP_CreateDevicesList (IN OUT struct DeviceInfoSet *list, IN PCWSTR MachineName OPTIONAL, IN CONST GUID *Class OPTIONAL, IN PCWSTR Enumerator OPTIONAL)
 
static BOOL SETUP_GetIconIndex (IN HKEY hClassKey, OUT PINT ImageIndex)
 
BOOL WINAPI SetupDiGetClassImageIndex (IN PSP_CLASSIMAGELIST_DATA ClassImageListData, IN CONST GUID *ClassGuid, OUT PINT ImageIndex)
 
BOOL WINAPI SetupDiGetClassImageList (OUT PSP_CLASSIMAGELIST_DATA ClassImageListData)
 
BOOL WINAPI SetupDiGetClassImageListExA (OUT PSP_CLASSIMAGELIST_DATA ClassImageListData, IN PCSTR MachineName OPTIONAL, IN PVOID Reserved)
 
static BOOL WINAPI SETUP_GetClassIconInfo (IN CONST GUID *ClassGuid, OUT PINT OutIndex, OUT LPWSTR *OutDllName)
 
BOOL WINAPI SetupDiGetClassImageListExW (OUT PSP_CLASSIMAGELIST_DATA ClassImageListData, IN PCWSTR MachineName OPTIONAL, IN PVOID Reserved)
 
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)
 
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)
 
BOOL WINAPI SetupDiLoadClassIcon (IN CONST GUID *ClassGuid, OUT HICON *LargeIcon OPTIONAL, OUT PINT MiniIconIndex OPTIONAL)
 
HKEY SETUP_CreateClassKey (HINF hInf)
 
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)
 
BOOL WINAPI SetupDiSetClassInstallParamsW (IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN PSP_CLASSINSTALL_HEADER ClassInstallParams OPTIONAL, IN DWORD ClassInstallParamsSize)
 
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)
 
static BOOL WINAPI SETUP_GetClassDevPropertySheetsCallback (IN HPROPSHEETPAGE hPropSheetPage, IN OUT LPARAM lParam)
 
static DWORD SETUP_GetValueString (IN HKEY hKey, IN LPWSTR lpValueName, OUT LPWSTR *lpString)
 
static BOOL SETUP_CallInstaller (IN DI_FUNCTION InstallFunction, IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN PSP_ADDPROPERTYPAGE_DATA PageData)
 
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)
 

Variables

static const WCHAR BackSlash [] = {'\\',0}
 
static const WCHAR ClassGUID [] = {'C','l','a','s','s','G','U','I','D',0}
 
static const WCHAR ClassInstall32 [] = {'C','l','a','s','s','I','n','s','t','a','l','l','3','2',0}
 
static const WCHAR DotServices [] = {'.','S','e','r','v','i','c','e','s',0}
 
static const WCHAR InterfaceInstall32 [] = {'I','n','t','e','r','f','a','c','e','I','n','s','t','a','l','l','3','2',0}
 
static const WCHAR SetupapiDll [] = {'s','e','t','u','p','a','p','i','.','d','l','l',0}
 
static const INSTALL_PARAMS_DATA InstallParamsData []
 

Macro Definition Documentation

◆ ADD_PARAM_HANDLER

#define ADD_PARAM_HANDLER (   Function,
  UpdateHandler,
  ParamsType,
  ParamsField 
)     { Function, UpdateHandler, sizeof(ParamsType), FIELD_OFFSET(struct ClassInstallParams, ParamsField) },

Definition at line 70 of file devclass.c.

◆ UNKNOWN_ICON_INDEX

#define UNKNOWN_ICON_INDEX   18

Definition at line 79 of file devclass.c.

Typedef Documentation

◆ INSTALL_PARAMS_DATA

◆ PROPERTY_PAGE_PROVIDER

typedef BOOL(WINAPI * PROPERTY_PAGE_PROVIDER) (IN PSP_PROPSHEETPAGE_REQUEST PropPageRequest, IN LPFNADDPROPSHEETPAGE fAddFunc, IN LPARAM lParam)

Definition at line 36 of file devclass.c.

◆ UPDATE_CLASS_PARAM_HANDLER

Function Documentation

◆ SETUP_CallInstaller()

static BOOL SETUP_CallInstaller ( IN DI_FUNCTION  InstallFunction,
IN HDEVINFO  DeviceInfoSet,
IN PSP_DEVINFO_DATA DeviceInfoData  OPTIONAL,
IN PSP_ADDPROPERTYPAGE_DATA  PageData 
)
static

Definition at line 1150 of file devclass.c.

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}
#define ERR(fmt,...)
Definition: debug.h:110
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
BOOL WINAPI SetupDiCallClassInstaller(DI_FUNCTION InstallFunction, HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData)
Definition: devinst.c:4024
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
#define SetupDiGetClassInstallParams
Definition: setupapi.h:2596
#define SetupDiSetClassInstallParams
Definition: setupapi.h:2617
_In_opt_ PSP_DEVINFO_DATA DeviceInfoData
Definition: setupapi.h:1528
int ret
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

Referenced by SetupDiGetClassDevPropertySheetsW().

◆ SETUP_CreateClassKey()

HKEY SETUP_CreateClassKey ( HINF  hInf)

Definition at line 3518 of file devinst.c.

3519{
3520 WCHAR FullBuffer[MAX_PATH];
3525
3526 /* Obtain the Class GUID for this class */
3528 hInf,
3529 Version,
3531 Buffer,
3532 sizeof(Buffer) / sizeof(WCHAR),
3533 &RequiredSize))
3534 {
3535 return INVALID_HANDLE_VALUE;
3536 }
3537
3538 /* Build the corresponding registry key name */
3539 lstrcpyW(FullBuffer, REGSTR_PATH_CLASS_NT);
3540 lstrcatW(FullBuffer, BackSlash);
3541 lstrcatW(FullBuffer, Buffer);
3542
3543 /* Obtain the Class name for this class */
3545 hInf,
3546 Version,
3548 Buffer,
3549 sizeof(Buffer) / sizeof(WCHAR),
3550 &RequiredSize))
3551 {
3552 return INVALID_HANDLE_VALUE;
3553 }
3554
3555 /* Try to open or create the registry key */
3556 TRACE("Opening class key %s\n", debugstr_w(FullBuffer));
3557#if 0 // I keep this for reference...
3559 FullBuffer,
3560 0,
3562 &hClassKey))
3563 {
3564 /* Use RegCreateKeyExW */
3565 }
3566#endif
3568 FullBuffer,
3569 0,
3570 NULL,
3573 NULL,
3574 &hClassKey,
3575 &Disposition))
3576 {
3577 ERR("RegCreateKeyExW(%s) failed\n", debugstr_w(FullBuffer));
3578 return INVALID_HANDLE_VALUE;
3579 }
3581 TRACE("The class key %s was successfully created\n", debugstr_w(FullBuffer));
3582 else
3583 TRACE("The class key %s was successfully opened\n", debugstr_w(FullBuffer));
3584
3585 TRACE( "setting value %s to %s\n", debugstr_w(REGSTR_VAL_CLASS), debugstr_w(Buffer) );
3588 0,
3589 REG_SZ,
3590 (LPBYTE)Buffer,
3591 RequiredSize * sizeof(WCHAR)))
3592 {
3595 FullBuffer);
3596 return INVALID_HANDLE_VALUE;
3597 }
3598
3599 return hClassKey;
3600}
HKEY hClassKey
Definition: umpnpmgr.c:45
#define RegCloseKey(hKey)
Definition: registry.h:47
Definition: bufpool.h:45
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1091
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3353
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4897
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
Definition: reg.c:1234
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define MAX_PATH
Definition: compat.h:34
#define lstrcpyW
Definition: compat.h:749
static const WCHAR BackSlash[]
Definition: devinst.c:27
BOOL WINAPI SetupGetLineTextW(PINFCONTEXT context, HINF hinf, PCWSTR section_name, PCWSTR key_name, PWSTR buffer, DWORD size, PDWORD required)
Definition: parser.c:1756
#define debugstr_w
Definition: kernel32.h:32
#define REG_SZ
Definition: layer.c:22
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
_In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Reserved_ ULONG _In_opt_ PUNICODE_STRING _In_ ULONG _Out_opt_ PULONG Disposition
Definition: cmfuncs.h:56
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define REG_CREATED_NEW_KEY
Definition: nt_native.h:1084
#define KEY_SET_VALUE
Definition: nt_native.h:1017
#define REGSTR_VAL_CLASSGUID
Definition: regstr.h:422
#define REGSTR_PATH_CLASS_NT
Definition: regstr.h:479
#define REGSTR_VAL_CLASS
Definition: regstr.h:291
#define TRACE(s)
Definition: solgame.cpp:4
unsigned char * LPBYTE
Definition: typedefs.h:53
_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_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT Version
Definition: wdffdo.h:469
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by SetupDiInstallClassExW().

◆ SETUP_CreateDevicesList()

LONG SETUP_CreateDevicesList ( IN OUT struct DeviceInfoSet list,
IN PCWSTR MachineName  OPTIONAL,
IN CONST GUID *Class  OPTIONAL,
IN PCWSTR Enumerator  OPTIONAL 
)

Definition at line 121 of file devclass.c.

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}
_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
Definition: list.h:37
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define ERROR_SUCCESS
Definition: deptool.c:10
#define MAX_GUID_STRING_LEN
Definition: apphelp.c:29
DWORD GetErrorCodeFromCrCode(const IN CONFIGRET cr)
Definition: devinst.c:94
BOOL CreateDeviceInfo(IN struct DeviceInfoSet *list, IN LPCWSTR InstancePath, IN LPCGUID pClassGuid, OUT struct DeviceInfo **pDeviceInfo)
Definition: devinst.c:528
#define InsertTailList(ListHead, Entry)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define GUID_NULL
Definition: ks.h:106
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define UNICODE_NULL
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define RPC_S_OK
Definition: rpcnterr.h:22
RPC_STATUS WINAPI UuidFromStringW(RPC_WSTR s, UUID *uuid)
Definition: rpcrt4_main.c:614
DEVINST dnDevInst
LIST_ENTRY ListEntry
const uint16_t * PCWSTR
Definition: typedefs.h:57
uint16_t * PWCHAR
Definition: typedefs.h:56
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3771

Referenced by SetupDiGetClassDevsExW().

◆ SETUP_GetClassDevPropertySheetsCallback()

static BOOL WINAPI SETUP_GetClassDevPropertySheetsCallback ( IN HPROPSHEETPAGE  hPropSheetPage,
IN OUT LPARAM  lParam 
)
static

Definition at line 1092 of file devclass.c.

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}
LPARAM lParam
Definition: combotst.c:139
LPPROPSHEETHEADERW PropertySheetHeader
Definition: devclass.c:1085
HPROPSHEETPAGE * phpage
Definition: prsht.h:309

Referenced by SetupDiGetClassDevPropertySheetsW().

◆ SETUP_GetClassIconInfo()

static BOOL WINAPI SETUP_GetClassIconInfo ( IN CONST GUID ClassGuid,
OUT PINT  OutIndex,
OUT LPWSTR OutDllName 
)
static

Definition at line 355 of file devclass.c.

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}
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
#define SetLastError(x)
Definition: compat.h:752
static DWORD DWORD * dwLength
Definition: fusion.c:86
static void cleanup(void)
Definition: main.c:1335
static const WCHAR SetupapiDll[]
Definition: devclass.c:34
#define UNKNOWN_ICON_INDEX
Definition: devclass.c:79
static BOOL SETUP_GetIconIndex(IN HKEY hClassKey, OUT PINT ImageIndex)
Definition: devclass.c:229
HKEY WINAPI SetupDiOpenClassRegKey(const GUID *ClassGuid, REGSAM samDesired)
Definition: devinst.c:3618
LPVOID WINAPI MyMalloc(DWORD dwSize)
Definition: misc.c:147
VOID WINAPI MyFree(LPVOID lpMem)
Definition: misc.c:128
FxAutoRegKey hKey
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
long LONG
Definition: pedump.c:60
#define strchrW(s, c)
Definition: unicode.h:34
#define REGSTR_VAL_INSTALLER_32
Definition: regstr.h:487
#define REGSTR_VAL_ENUMPROPPAGES_32
Definition: regstr.h:490
int32_t INT
Definition: typedefs.h:58
#define ERROR_GEN_FAILURE
Definition: winerror.h:134
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by SetupDiGetClassImageListExW(), and SetupDiLoadClassIcon().

◆ SETUP_GetIconIndex()

static BOOL SETUP_GetIconIndex ( IN HKEY  hClassKey,
OUT PINT  ImageIndex 
)
static

Definition at line 229 of file devclass.c.

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}
#define atoiW(s)
Definition: unicode.h:54
#define REGSTR_VAL_INSICON
Definition: regstr.h:488
#define ERROR_INVALID_INDEX
Definition: winerror.h:894

Referenced by SETUP_GetClassIconInfo().

◆ SETUP_GetValueString()

static DWORD SETUP_GetValueString ( IN HKEY  hKey,
IN LPWSTR  lpValueName,
OUT LPWSTR lpString 
)
static

Definition at line 1113 of file devclass.c.

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}
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:175

Referenced by SetupDiGetClassDevPropertySheetsW().

◆ SETUP_PropertyAddPropertyAdvancedHandler()

static BOOL SETUP_PropertyAddPropertyAdvancedHandler ( IN HDEVINFO  DeviceInfoSet,
IN PSP_DEVINFO_DATA DeviceInfoData  OPTIONAL,
IN PSP_CLASSINSTALL_HEADER ClassInstallParams  OPTIONAL,
IN DWORD  ClassInstallParamsSize 
)
static

Definition at line 918 of file devclass.c.

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}
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
SP_NEWDEVICEWIZARD_DATA * PSP_ADDPROPERTYPAGE_DATA
Definition: setupapi.h:983
_In_opt_ PSP_DEVINFO_DATA _In_ DWORD ClassInstallParamsSize
Definition: setupapi.h:1530
#define MAX_INSTALLWIZARD_DYNAPAGES
Definition: setupapi.h:459
struct ClassInstallParams ClassInstallParams
ULONG_PTR Reserved
Definition: setupapi.h:838
#define ERROR_INVALID_USER_BUFFER
Definition: winerror.h:1091
#define ERROR_INVALID_FLAGS
Definition: winerror.h:583

◆ SETUP_PropertyChangeHandler()

static BOOL SETUP_PropertyChangeHandler ( IN HDEVINFO  DeviceInfoSet,
IN PSP_DEVINFO_DATA DeviceInfoData  OPTIONAL,
IN PSP_CLASSINSTALL_HEADER ClassInstallParams  OPTIONAL,
IN DWORD  ClassInstallParamsSize 
)
static

Definition at line 865 of file devclass.c.

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}
if(dx< 0)
Definition: linetemp.h:194
#define DICS_DISABLE
Definition: setupapi.h:114
struct _SP_PROPCHANGE_PARAMS * PSP_PROPCHANGE_PARAMS
#define DICS_PROPCHANGE
Definition: setupapi.h:116
#define DICS_STOP
Definition: setupapi.h:119
#define DICS_ENABLE
Definition: setupapi.h:112
#define DICS_FLAG_CONFIGSPECIFIC
Definition: setupapi.h:115
#define DICS_START
Definition: setupapi.h:117
#define DICS_FLAG_GLOBAL
Definition: setupapi.h:113

◆ SetupDiDestroyClassImageList()

BOOL WINAPI SetupDiDestroyClassImageList ( IN PSP_CLASSIMAGELIST_DATA  ClassImageListData)

Definition at line 85 of file devclass.c.

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}
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
#define list
Definition: rosglue.h:35
#define SETUP_CLASS_IMAGE_LIST_MAGIC

Referenced by HardwareDlgProc(), SafeRemovalDlgProc(), SetupDiGetClassImageListExW(), and CDeviceView::Uninitialize().

◆ SetupDiGetClassDevPropertySheetsA()

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 at line 1049 of file devclass.c.

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}
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
DWORD dwFlags
Definition: prsht.h:294

◆ SetupDiGetClassDevPropertySheetsW()

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 at line 1248 of file devclass.c.

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}
HMODULE hModule
Definition: animate.c:44
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
static DWORD SETUP_GetValueString(IN HKEY hKey, IN LPWSTR lpValueName, OUT LPWSTR *lpString)
Definition: devclass.c:1113
static BOOL WINAPI SETUP_GetClassDevPropertySheetsCallback(IN HPROPSHEETPAGE hPropSheetPage, IN OUT LPARAM lParam)
Definition: devclass.c:1092
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 * PROPERTY_PAGE_PROVIDER)(IN PSP_PROPSHEETPAGE_REQUEST PropPageRequest, IN LPFNADDPROPSHEETPAGE fAddFunc, IN LPARAM lParam)
Definition: devclass.c:37
HKEY SETUPDI_OpenDrvKey(HKEY RootKey, struct DeviceInfo *devInfo, REGSAM samDesired)
Definition: devinst.c:5857
HKEY WINAPI SetupDiOpenClassRegKeyExW(const GUID *ClassGuid, REGSAM samDesired, DWORD Flags, PCWSTR MachineName, PVOID Reserved)
Definition: devinst.c:3662
DWORD GetFunctionPointer(IN PWSTR InstallerName, OUT HMODULE *ModulePointer, OUT PVOID *FunctionPointer)
Definition: misc.c:44
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
u32_t magic(void)
#define PSH_PROPSHEETPAGE
Definition: prsht.h:43
struct _SP_CLASSINSTALL_HEADER SP_CLASSINSTALL_HEADER
#define DIGCDP_FLAG_BASIC
Definition: setupapi.h:164
struct _SP_PROPSHEETPAGE_REQUEST SP_PROPSHEETPAGE_REQUEST
#define ERROR_INVALID_PROPPAGE_PROVIDER
Definition: setupapi.h:332
#define DIOCR_INSTALLER
Definition: setupapi.h:176
#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
PVOID pClassPropPageProvider
HMODULE hmodClassPropPageProvider
PVOID pDevicePropPageProvider
HMODULE hmodDevicePropPageProvider
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547
#define ZeroMemory
Definition: winbase.h:1700
LONG_PTR LPARAM
Definition: windef.h:208

Referenced by SetupDiGetClassDevPropertySheetsA().

◆ SetupDiGetClassImageIndex()

BOOL WINAPI SetupDiGetClassImageIndex ( IN PSP_CLASSIMAGELIST_DATA  ClassImageListData,
IN CONST GUID ClassGuid,
OUT PINT  ImageIndex 
)

Definition at line 277 of file devclass.c.

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}
#define debugstr_guid
Definition: kernel32.h:35

Referenced by BuildDevicesList(), EnumDeviceClasses(), InitProbeListPage(), InsertDeviceTreeItem(), CClassNode::SetupNode(), and CDeviceNode::SetupNode().

◆ SetupDiGetClassImageList()

BOOL WINAPI SetupDiGetClassImageList ( OUT PSP_CLASSIMAGELIST_DATA  ClassImageListData)

Definition at line 322 of file devclass.c.

324{
325 return SetupDiGetClassImageListExW(ClassImageListData, NULL, NULL);
326}
BOOL WINAPI SetupDiGetClassImageListExW(OUT PSP_CLASSIMAGELIST_DATA ClassImageListData, IN PCWSTR MachineName OPTIONAL, IN PVOID Reserved)
Definition: devclass.c:457

Referenced by DisplayImageList(), HardwareDlgProc(), CDeviceView::Initialize(), InitProbeListPage(), and SafeRemovalDlgProc().

◆ SetupDiGetClassImageListExA()

BOOL WINAPI SetupDiGetClassImageListExA ( OUT PSP_CLASSIMAGELIST_DATA  ClassImageListData,
IN PCSTR MachineName  OPTIONAL,
IN PVOID  Reserved 
)

Definition at line 332 of file devclass.c.

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}
#define CP_ACP
Definition: compat.h:109
LPWSTR WINAPI pSetupMultiByteToUnicode(LPCSTR lpMultiByteStr, UINT uCodePage)
Definition: misc.c:281
_In_ DWORD _Out_ PDWORD _In_opt_ PCSTR MachineName
Definition: setupapi.h:1293
uint16_t * PWSTR
Definition: typedefs.h:56
_Reserved_ PVOID Reserved
Definition: winddi.h:3974

◆ SetupDiGetClassImageListExW()

BOOL WINAPI SetupDiGetClassImageListExW ( OUT PSP_CLASSIMAGELIST_DATA  ClassImageListData,
IN PCWSTR MachineName  OPTIONAL,
IN PVOID  Reserved 
)

Definition at line 457 of file devclass.c.

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}
static HDC hDC
Definition: 3dtext.c:33
HINSTANCE hInstance
Definition: charmap.c:19
VOID WINAPI InitCommonControls(void)
Definition: commctrl.c:863
DWORD bpp
Definition: surface.c:185
unsigned int idx
Definition: utils.c:41
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
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
static BOOL WINAPI SETUP_GetClassIconInfo(IN CONST GUID *ClassGuid, OUT PINT OutIndex, OUT LPWSTR *OutDllName)
Definition: devclass.c:355
BOOL WINAPI SetupDiDestroyClassImageList(IN PSP_CLASSIMAGELIST_DATA ClassImageListData)
Definition: devclass.c:85
BOOL WINAPI SetupDiBuildClassInfoListExW(DWORD Flags, LPGUID ClassGuidList, DWORD ClassGuidListSize, PDWORD RequiredSize, LPCWSTR MachineName, PVOID Reserved)
Definition: devinst.c:722
#define ULONG_PTR
Definition: config.h:101
GLsizeiptr size
Definition: glext.h:5919
UINT WINAPI ExtractIconExW(LPCWSTR lpszFile, INT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIcons)
Definition: iconcache.cpp:866
static HDC
Definition: imagelist.c:92
static HICON
Definition: imagelist.c:84
HICON hIcon
Definition: msconfig.c:44
unsigned int UINT
Definition: ndis.h:50
#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
uint32_t ULONG_PTR
Definition: typedefs.h:65
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
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList

Referenced by SetupDiGetClassImageList(), and SetupDiGetClassImageListExA().

◆ SetupDiGetClassInstallParamsA()

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 at line 626 of file devclass.c.

632{
633 FIXME("SetupDiGetClassInstallParamsA(%p %p %p %lu %p) Stub\n",
635 return FALSE;
636}
#define FIXME(fmt,...)
Definition: debug.h:111

◆ SetupDiGetClassInstallParamsW()

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 at line 642 of file devclass.c.

648{
649 FIXME("SetupDiGetClassInstallParamsW(%p %p %p %lu %p) Stub\n",
651 return FALSE;
652}

Referenced by DiskClassInstaller().

◆ SetupDiInstallClassExW()

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 at line 708 of file devclass.c.

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}
@ Reserved2
Definition: bcd.h:202
@ Reserved1
Definition: bcd.h:201
static HWND hwndParent
Definition: cryptui.c:300
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
static const WCHAR DotServices[]
Definition: devclass.c:32
static const WCHAR InterfaceInstall32[]
Definition: devclass.c:33
HKEY SETUP_CreateClassKey(HINF hInf)
Definition: devinst.c:3518
static const WCHAR ClassInstall32[]
Definition: devclass.c:31
BOOL WINAPI SetupDiSetDeviceInstallParamsW(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN PSP_DEVINSTALL_PARAMS_W DeviceInstallParams)
Definition: devinst.c:4558
BOOL WINAPI SetupDiGetDeviceInstallParamsW(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, OUT PSP_DEVINSTALL_PARAMS_W DeviceInstallParams)
Definition: devinst.c:4451
BOOL WINAPI SetupDiGetActualSectionToInstallW(HINF InfHandle, PCWSTR InfSectionName, PWSTR InfSectionWithExt, DWORD InfSectionWithExtSize, PDWORD RequiredSize, PWSTR *Extension)
Definition: devinst.c:1980
BOOL WINAPI SetupDiDestroyDeviceInfoList(HDEVINFO devinfo)
Definition: devinst.c:2893
HDEVINFO WINAPI SetupDiCreateDeviceInfoList(const GUID *ClassGuid, HWND hwndParent)
Definition: devinst.c:1205
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
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 INF_STYLE_WIN4
Definition: infsupp.h:41
#define KEY_ENUMERATE_SUB_KEYS
Definition: nt_native.h:1019
#define strlenW(s)
Definition: unicode.h:28
#define SPINST_BITREG
Definition: setupapi.h:593
#define DI_NOVCP
Definition: setupapi.h:49
#define DI_FORCECOPY
Definition: setupapi.h:70
#define SPINST_INI2REG
Definition: setupapi.h:591
SP_DEVINSTALL_PARAMS_A SP_DEVINSTALL_PARAMS
Definition: setupapi.h:1155
#define DI_QUIETINSTALL
Definition: setupapi.h:68
#define DIOCR_INTERFACE
Definition: setupapi.h:177
#define SPINST_INIFILES
Definition: setupapi.h:589
#define SPINST_REGISTRY
Definition: setupapi.h:590
#define DI_NOBROWSE
Definition: setupapi.h:55
#define SP_COPY_FORCE_IN_USE
Definition: setupapi.h:486
#define SPINST_FILES
Definition: setupapi.h:592
VOID WINAPI SetupCloseInfFile(IN HINF InfHandle)
Definition: infsupp.c:43
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
_In_ CONST GUID * InterfaceClassGuid
Definition: iofuncs.h:1136

Referenced by SetupDiInstallClassExA(), and SetupDiInstallClassW().

◆ SetupDiLoadClassIcon()

BOOL WINAPI SetupDiLoadClassIcon ( IN CONST GUID ClassGuid,
OUT HICON *LargeIcon  OPTIONAL,
OUT PINT MiniIconIndex  OPTIONAL 
)

Definition at line 658 of file devclass.c.

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}

Referenced by UpdateDevInfo().

◆ SetupDiSetClassInstallParamsW()

BOOL WINAPI SetupDiSetClassInstallParamsW ( IN HDEVINFO  DeviceInfoSet,
IN PSP_DEVINFO_DATA DeviceInfoData  OPTIONAL,
IN PSP_CLASSINSTALL_HEADER ClassInstallParams  OPTIONAL,
IN DWORD  ClassInstallParamsSize 
)

Definition at line 972 of file devclass.c.

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}
_In_ CDROM_SCAN_FOR_SPECIAL_INFO _In_ PCDROM_SCAN_FOR_SPECIAL_HANDLER Function
Definition: cdrom.h:1156
static const INSTALL_PARAMS_DATA InstallParamsData[]
Definition: devclass.c:73
#define DI_CLASSINSTALLPARAMS
Definition: setupapi.h:66
struct _SP_DEVINSTALL_PARAMS_W SP_DEVINSTALL_PARAMS_W
SP_DEVINSTALL_PARAMS_W InstallParams
UPDATE_CLASS_PARAM_HANDLER UpdateHandler
Definition: devclass.c:65
_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

Referenced by DiskClassInstaller(), DisplayDeviceAdvancedProperties(), CDeviceNode::EnableDevice(), CDeviceNode::UninstallDevice(), and UninstallDriver().

Variable Documentation

◆ BackSlash

const WCHAR BackSlash[] = {'\\',0}
static

Definition at line 29 of file devclass.c.

Referenced by CheckForDeviceDesc(), NpTranslateAlias(), and RunTestCases().

◆ ClassGUID

const WCHAR ClassGUID[] = {'C','l','a','s','s','G','U','I','D',0}
static

◆ ClassInstall32

const WCHAR ClassInstall32[] = {'C','l','a','s','s','I','n','s','t','a','l','l','3','2',0}
static

Definition at line 31 of file devclass.c.

Referenced by SetupDiInstallClassExW().

◆ DotServices

const WCHAR DotServices[] = {'.','S','e','r','v','i','c','e','s',0}
static

Definition at line 32 of file devclass.c.

Referenced by SetupDiInstallClassExW().

◆ InstallParamsData

const INSTALL_PARAMS_DATA InstallParamsData[]
static
Initial value:
= {
}

Definition at line 73 of file devclass.c.

Referenced by SetupDiSetClassInstallParamsW().

◆ InterfaceInstall32

const WCHAR InterfaceInstall32[] = {'I','n','t','e','r','f','a','c','e','I','n','s','t','a','l','l','3','2',0}
static

Definition at line 33 of file devclass.c.

Referenced by SetupDiInstallClassExW().

◆ SetupapiDll

const WCHAR SetupapiDll[] = {'s','e','t','u','p','a','p','i','.','d','l','l',0}
static

Definition at line 34 of file devclass.c.

Referenced by SETUP_GetClassIconInfo().