20{
39
42
43
44 InstallParams.
cbSize =
sizeof(InstallParams);
47 {
49 DPRINT(
"SetupDiGetDeviceInstallParams() failed with error 0x%lx\n", rc);
51 }
52
54
57 {
59 DPRINT(
"SetupDiSetDeviceInstallParams() failed with error 0x%lx\n", rc);
61 }
62
63
66 {
68 DPRINT(
"SetupDiInstallDevice() failed with error 0x%lx\n", rc);
70 }
71
72
73 DriverInfoData.
cbSize =
sizeof(DriverInfoData);
76 {
78 DPRINT(
"SetupDiGetSelectedDriver() failed with error 0x%lx\n", rc);
80 }
81
82 DriverInfoDetailData.
cbSize =
sizeof(DriverInfoDetailData);
84 &DriverInfoData, &DriverInfoDetailData,
85 sizeof(DriverInfoDetailData),
NULL);
87 {
89 DPRINT(
"SetupDiGetDriverInfoDetail() failed with error 0x%lx\n", rc);
91 }
92
95 {
97 DPRINT(
"SetupOpenInfFile() failed with error 0x%lx\n", rc);
99 }
100
104 SectionName,
109 {
111 DPRINT(
"SetupDiGetActualSectionToInstall() failed with error 0x%lx\n", rc);
113 }
114 hr =
StringCbCat(SectionName,
sizeof(SectionName),
_T(
".SoftwareSettings"));
116 {
119 }
120
121
127 {
129 DPRINT(
"SetupDiOpenDevRegKey() failed with error 0x%lx\n", rc);
131 }
133 hDriverKey,
L"Settings",
137#else
139#endif
140 NULL, &hSettingsKey, &disposition);
142 {
143 DPRINT(
"RegCreateKeyEx() failed with error 0x%lx\n", rc);
145 }
146
147
154 {
156 DPRINT(
"SetupInstallFromInfSection() failed with error 0x%lx\n", rc);
158 }
159
160
166 {
168 DPRINT(
"SetupDiGetDeviceRegistryProperty() failed with error 0x%lx\n", rc);
170 }
171
176 {
177 DPRINT(
"RegOpenKeyEx() failed with error 0x%lx\n", rc);
179 }
184 {
185 DPRINT(
"RegOpenKeyEx() failed with error 0x%lx\n", rc);
187 }
188
189
190 for (wIndex = 0; wIndex < 9999; wIndex++)
191 {
193
197 &hDeviceSubKey, &disposition);
199 {
200 DPRINT(
"RegCreateKeyEx() failed with error 0x%lx\n", rc);
202 }
203
205 break;
206
207 if (wIndex == 9999)
208 {
210 DPRINT(
"RegCreateKeyEx() failed\n");
212 }
213
215 hDeviceSubKey =
NULL;
216 }
217
218
219
220
227 {
229 DPRINT(
"SetupInstallFromInfSection() failed with error 0x%lx\n", rc);
231 }
232
233
236 _T(
"Device Description"),
237 0,
240 cbData);
242 {
243 DPRINT(
"RegSetValueEx() failed with error 0x%lx\n", rc);
245 }
246
247
248
249
251 EnumDisplayDevices(
NULL, 0, &DisplayDevice, 0);
252
254
259 {
260
262 }
263 if (hSettingsKey !=
NULL)
267 if (hServiceKey !=
NULL)
269 if (hDeviceSubKey !=
NULL)
271
272 return rc;
273}
static WCHAR ServiceName[]
static HANDLE hServicesKey
#define RegCloseKey(hKey)
#define ERROR_INSUFFICIENT_BUFFER
#define INVALID_HANDLE_VALUE
static void cleanup(void)
BOOL WINAPI SetupDiInstallDevice(IN HDEVINFO DeviceInfoSet, IN OUT PSP_DEVINFO_DATA DeviceInfoData)
HKEY WINAPI SetupDiOpenDevRegKey(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, DWORD Scope, DWORD HwProfile, DWORD KeyType, REGSAM samDesired)
#define KEY_CREATE_SUB_KEY
#define REG_OPTION_NON_VOLATILE
#define REG_CREATED_NEW_KEY
#define KEY_ENUMERATE_SUB_KEYS
#define MAX_SERVICE_NAME_LEN
#define SetupDiGetActualSectionToInstall
#define SetupDiGetDriverInfoDetail
#define SetupInstallFromInfSection
#define SetupDiGetDeviceInstallParams
#define SetupDiGetDeviceRegistryProperty
#define SetupDiSetDeviceInstallParams
_In_opt_ PSP_DEVINFO_DATA DeviceInfoData
#define ERROR_DI_DO_DEFAULT
#define SetupDiGetSelectedDriver
#define DIF_INSTALLDEVICE
#define DI_DONOTCALLCONFIGMG
CHAR Description[LINE_LEN]
CHAR InfFileName[MAX_PATH]
CHAR SectionName[LINE_LEN]
VOID WINAPI SetupCloseInfFile(IN HINF InfHandle)
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
DWORD WINAPI GetLastError(void)
#define ERROR_GEN_FAILURE
DISPLAY_DEVICEA DISPLAY_DEVICE
#define HKEY_LOCAL_MACHINE