ReactOS 0.4.16-dev-1946-g52006dd
installer.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Configuration of network devices
4 * FILE: dll/win32/netcfgx/installer.c
5 * PURPOSE: Network devices installer
6 *
7 * PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org)
8 */
9
10#include "precomp.h"
11#include <strsafe.h>
12
13
14/* Append a REG_SZ to an existing REG_MULTI_SZ string in the registry.
15 * If the value doesn't exist, create it.
16 * Returns ERROR_SUCCESS if success. Otherwise, returns an error code
17 */
18static
19LONG
21 IN HKEY hKey,
23 IN PCWSTR ValueToAppend)
24{
26 DWORD dwRegType;
27 DWORD dwRequired, dwLength;
28 DWORD dwTmp;
29 LONG rc;
30
33 NULL,
34 &dwRegType,
35 NULL,
36 &dwRequired);
37 if (rc != ERROR_FILE_NOT_FOUND)
38 {
39 if (rc != ERROR_SUCCESS)
40 goto cleanup;
41 if (dwRegType != REG_MULTI_SZ)
42 {
44 goto cleanup;
45 }
46
47 dwTmp = dwLength = dwRequired + wcslen(ValueToAppend) * sizeof(WCHAR) + sizeof(UNICODE_NULL);
49 if (!Buffer)
50 {
52 goto cleanup;
53 }
54
57 NULL,
58 NULL,
59 (BYTE*)Buffer,
60 &dwTmp);
61 if (rc != ERROR_SUCCESS)
62 goto cleanup;
63 }
64 else
65 {
66 dwRequired = sizeof(WCHAR);
67 dwLength = wcslen(ValueToAppend) * sizeof(WCHAR) + 2 * sizeof(UNICODE_NULL);
69 if (!Buffer)
70 {
72 goto cleanup;
73 }
74 }
75
76 /* Append the value */
77 wcscpy(&Buffer[dwRequired / sizeof(WCHAR) - 1], ValueToAppend);
78 /* Terminate the REG_MULTI_SZ string */
79 Buffer[dwLength / sizeof(WCHAR) - 1] = UNICODE_NULL;
80
83 0,
85 (const BYTE*)Buffer,
86 dwLength);
87
90 return rc;
91}
92
93static
96 _In_ HKEY hNetworkKey,
97 _Out_ PWSTR *ppszNameBuffer)
98{
99 int Length = 0;
100 PWSTR pszDefaultName = NULL;
101 PWSTR pszNameBuffer = NULL;
102 DWORD dwSubKeys = 0;
103 DWORD dwError;
104
105 TRACE("GetNewConnectionName()\n");
106
108 if (Length == 0)
109 {
110 pszDefaultName = L"Network Connection";
111 Length = wcslen(pszDefaultName);
112 }
113
114 TRACE("Length %d\n", Length);
115
116 dwError = RegQueryInfoKeyW(hNetworkKey,
117 NULL, NULL, NULL, &dwSubKeys,
118 NULL, NULL, NULL, NULL, NULL, NULL, NULL);
119 if (dwError != ERROR_SUCCESS)
120 {
121 ERR("RegQueryInfoKeyW: Error %lu\n", dwError);
122 return dwError;
123 }
124
125 TRACE("Adapter Count: %lu\n", dwSubKeys);
126
127 pszNameBuffer = HeapAlloc(GetProcessHeap(),
129 (Length + ((dwSubKeys != 0) ? 6 : 1)) * sizeof(WCHAR));
130 if (pszNameBuffer == NULL)
131 {
132 return ERROR_OUTOFMEMORY;
133 }
134
135 if (dwSubKeys != 0)
136 StringCchPrintfW(pszNameBuffer, Length + 6, L"%.*s %lu", Length, pszDefaultName, dwSubKeys + 1);
137 else
138 StringCchPrintfW(pszNameBuffer, Length + 1, L"%.*s", Length, pszDefaultName);
139
140 TRACE("Adapter Name: %S\n", pszNameBuffer);
141
142 *ppszNameBuffer = pszNameBuffer;
143
144 return ERROR_SUCCESS;
145}
146
147static
148DWORD
152 LPCWSTR UuidString,
153 DWORD Characteristics,
155{
160 LPWSTR ExportName = NULL;
161 LONG rc;
162 HKEY hInterfacesKey = NULL, hInterfaceKey = NULL;
163 HKEY hKey = NULL;
164 HKEY hNetworkKey = NULL;
165 HKEY hLinkageKey = NULL;
166 HKEY hConnectionKey = NULL;
167 DWORD dwShowIcon, dwLength, dwValue;
168 PWSTR pszNameBuffer = NULL;
169 PWSTR ptr;
170
175 {
176 rc = GetLastError();
177 ERR("SetupDiGetDeviceInstallParamsW() failed (Error %lu)\n", rc);
178 goto cleanup;
179 }
180
181 /* Do not start the adapter in the call to SetupDiInstallDevice */
183
187 {
188 rc = GetLastError();
189 ERR("SetupDiSetDeviceInstallParamsW() failed (Error %lu)\n", rc);
190 goto cleanup;
191 }
192
193 /* Install the adapter */
195 {
196 rc = GetLastError();
197 ERR("SetupDiInstallDevice() failed (Error %lu)\n", rc);
198 goto cleanup;
199 }
200
201 /* Get Instance ID */
203 {
204 ERR("SetupDiGetDeviceInstanceIdW() returned TRUE. FALSE expected\n");
206 goto cleanup;
207 }
208
210 if (!InstanceId)
211 {
212 ERR("HeapAlloc() failed\n");
214 goto cleanup;
215 }
216
218 {
219 rc = GetLastError();
220 ERR("SetupDiGetDeviceInstanceIdW() failed with error 0x%lx\n", rc);
221 goto cleanup;
222 }
223
225 if (!ComponentId)
226 {
227 ERR("HeapAlloc() failed\n");
229 goto cleanup;
230 }
231
233 ptr = wcsrchr(ComponentId, L'\\');
234 if (ptr != NULL)
235 *ptr = UNICODE_NULL;
236
237 /* Create device name */
238 DeviceName = HeapAlloc(GetProcessHeap(), 0, (wcslen(L"\\Device\\") + wcslen(UuidString)) * sizeof(WCHAR) + sizeof(UNICODE_NULL));
239 if (!DeviceName)
240 {
241 ERR("HeapAlloc() failed\n");
243 goto cleanup;
244 }
245 wcscpy(DeviceName, L"\\Device\\");
246 wcscat(DeviceName, UuidString);
247
248 /* Create export name */
249 ExportName = HeapAlloc(GetProcessHeap(), 0, (wcslen(L"\\Device\\Tcpip_") + wcslen(UuidString)) * sizeof(WCHAR) + sizeof(UNICODE_NULL));
250 if (!ExportName)
251 {
252 ERR("HeapAlloc() failed\n");
254 goto cleanup;
255 }
256 wcscpy(ExportName, L"\\Device\\Tcpip_");
257 wcscat(ExportName, UuidString);
258
259 /* Write Tcpip parameters in new service Key */
260 rc = RegCreateKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hInterfacesKey, NULL);
261 if (rc != ERROR_SUCCESS)
262 {
263 ERR("RegCreateKeyExW() failed with error 0x%lx\n", rc);
264 goto cleanup;
265 }
266
267 rc = RegCreateKeyExW(hInterfacesKey, UuidString, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hInterfaceKey, NULL);
268 if (rc != ERROR_SUCCESS)
269 {
270 ERR("RegCreateKeyExW() failed with error 0x%lx\n", rc);
271 goto cleanup;
272 }
273
274 rc = RegSetValueExW(hInterfaceKey, L"DefaultGateway", 0, REG_SZ, (const BYTE*)L"0.0.0.0", (wcslen(L"0.0.0.0") + 1) * sizeof(WCHAR));
275 if (rc != ERROR_SUCCESS)
276 {
277 ERR("RegSetValueExW() failed with error 0x%lx\n", rc);
278 goto cleanup;
279 }
280
281 rc = RegSetValueExW(hInterfaceKey, L"IPAddress", 0, REG_SZ, (const BYTE*)L"0.0.0.0", (wcslen(L"0.0.0.0") + 1) * sizeof(WCHAR));
282 if (rc != ERROR_SUCCESS)
283 {
284 ERR("RegSetValueExW() failed with error 0x%lx\n", rc);
285 goto cleanup;
286 }
287
288 rc = RegSetValueExW(hInterfaceKey, L"SubnetMask", 0, REG_SZ, (const BYTE*)L"0.0.0.0", (wcslen(L"0.0.0.0") + 1) * sizeof(WCHAR));
289 if (rc != ERROR_SUCCESS)
290 {
291 ERR("RegSetValueExW() failed with error 0x%lx\n", rc);
292 goto cleanup;
293 }
294
295 dwValue = 1;
296 rc = RegSetValueExW(hInterfaceKey, L"EnableDHCP", 0, REG_DWORD, (const BYTE*)&dwValue, sizeof(DWORD));
297 if (rc != ERROR_SUCCESS)
298 {
299 ERR("RegSetValueExW() failed with error 0x%lx\n", rc);
300 goto cleanup;
301 }
302
303 /* Write 'Linkage' key in hardware key */
304#if _WIN32_WINNT >= 0x502
306#else
308#endif
312 {
313 hKey = NULL;
314 rc = GetLastError();
315 ERR("SetupDiCreateDevRegKeyW() failed with error 0x%lx\n", rc);
316 goto cleanup;
317 }
318
319 rc = RegSetValueExW(hKey, L"NetCfgInstanceId", 0, REG_SZ, (const BYTE*)UuidString, (wcslen(UuidString) + 1) * sizeof(WCHAR));
320 if (rc != ERROR_SUCCESS)
321 {
322 ERR("RegSetValueExW() failed with error 0x%lx\n", rc);
323 goto cleanup;
324 }
325
326 rc = RegSetValueExW(hKey, L"Characteristics", 0, REG_DWORD, (const BYTE*)&Characteristics, sizeof(DWORD));
327 if (rc != ERROR_SUCCESS)
328 {
329 ERR("RegSetValueExW() failed with error 0x%lx\n", rc);
330 goto cleanup;
331 }
332
333 rc = RegSetValueExW(hKey, L"ComponentId", 0, REG_SZ, (const BYTE*)ComponentId, (wcslen(ComponentId) + 1) * sizeof(WCHAR));
334 if (rc != ERROR_SUCCESS)
335 {
336 ERR("RegSetValueExW() failed with error 0x%lx\n", rc);
337 goto cleanup;
338 }
339
340 if (BusType)
341 {
342 rc = RegSetValueExW(hKey, L"BusType", 0, REG_SZ, (const BYTE*)BusType, (wcslen(BusType) + 1) * sizeof(WCHAR));
343 if (rc != ERROR_SUCCESS)
344 {
345 ERR("RegSetValueExW() failed with error 0x%lx\n", rc);
346 goto cleanup;
347 }
348 }
349
350 rc = RegCreateKeyExW(hKey, L"Linkage", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_SET_VALUE, NULL, &hLinkageKey, NULL);
351 if (rc != ERROR_SUCCESS)
352 {
353 ERR("RegCreateKeyExW() failed with error 0x%lx\n", rc);
354 goto cleanup;
355 }
356
357 rc = RegSetValueExW(hLinkageKey, L"Export", 0, REG_SZ, (const BYTE*)DeviceName, (wcslen(DeviceName) + 1) * sizeof(WCHAR));
358 if (rc != ERROR_SUCCESS)
359 {
360 ERR("RegSetValueExW() failed with error 0x%lx\n", rc);
361 goto cleanup;
362 }
363
364 rc = RegSetValueExW(hLinkageKey, L"RootDevice", 0, REG_SZ, (const BYTE*)UuidString, (wcslen(UuidString) + 1) * sizeof(WCHAR));
365 if (rc != ERROR_SUCCESS)
366 {
367 ERR("RegSetValueExW() failed with error 0x%lx\n", rc);
368 goto cleanup;
369 }
370
371 rc = RegSetValueExW(hLinkageKey, L"UpperBind", 0, REG_SZ, (const BYTE*)L"Tcpip", (wcslen(L"Tcpip") + 1) * sizeof(WCHAR));
372 if (rc != ERROR_SUCCESS)
373 {
374 ERR("RegSetValueExW() failed with error 0x%lx\n", rc);
375 goto cleanup;
376 }
378 hKey = NULL;
379
380 /* Write connection information in network subkey */
382 L"SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}",
383 0,
384 NULL,
387 NULL,
388 &hNetworkKey,
389 NULL);
390 if (rc != ERROR_SUCCESS)
391 {
392 ERR("RegCreateKeyExW() failed with error 0x%lx\n", rc);
393 goto cleanup;
394 }
395
396 rc = GetUniqueConnectionName(hNetworkKey, &pszNameBuffer);
397 if (rc != ERROR_SUCCESS)
398 {
399 ERR("GetUniqueConnectionName() failed with error 0x%lx\n", rc);
400 goto cleanup;
401 }
402
403 rc = RegCreateKeyExW(hNetworkKey, UuidString, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_CREATE_SUB_KEY, NULL, &hKey, NULL);
404 if (rc != ERROR_SUCCESS)
405 {
406 ERR("RegCreateKeyExW() failed with error 0x%lx\n", rc);
407 goto cleanup;
408 }
409
410 rc = RegCreateKeyExW(hKey, L"Connection", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_SET_VALUE, NULL, &hConnectionKey, NULL);
412 hKey = NULL;
413 if (rc != ERROR_SUCCESS)
414 {
415 ERR("RegCreateKeyExW() failed with error 0x%lx\n", rc);
416 goto cleanup;
417 }
418
419 rc = RegSetValueExW(hConnectionKey, L"Name", 0, REG_SZ, (const BYTE*)pszNameBuffer, (wcslen(pszNameBuffer) + 1) * sizeof(WCHAR));
420 if (rc != ERROR_SUCCESS)
421 {
422 ERR("RegSetValueExW() failed with error 0x%lx\n", rc);
423 goto cleanup;
424 }
425
426 rc = RegSetValueExW(hConnectionKey, L"PnpInstanceID", 0, REG_SZ, (const BYTE*)InstanceId, (wcslen(InstanceId) + 1) * sizeof(WCHAR));
427 if (rc != ERROR_SUCCESS)
428 {
429 ERR("RegSetValueExW() failed with error 0x%lx\n", rc);
430 goto cleanup;
431 }
432
433 dwShowIcon = 1;
434 rc = RegSetValueExW(hConnectionKey, L"ShowIcon", 0, REG_DWORD, (const BYTE*)&dwShowIcon, sizeof(dwShowIcon));
435 if (rc != ERROR_SUCCESS)
436 {
437 ERR("RegSetValueExW() failed with error 0x%lx\n", rc);
438 goto cleanup;
439 }
440
441 /* Write linkage information in Tcpip service */
442 rc = RegCreateKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Linkage", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_QUERY_VALUE | KEY_SET_VALUE, NULL, &hKey, NULL);
443 if (rc != ERROR_SUCCESS)
444 {
445 ERR("RegCreateKeyExW() failed with error 0x%lx\n", rc);
446 goto cleanup;
447 }
449 if (rc != ERROR_SUCCESS)
450 {
451 ERR("AppendStringToMultiSZ() failed with error 0x%lx\n", rc);
452 goto cleanup;
453 }
454 rc = AppendStringToMultiSZ(hKey, L"Export", ExportName);
455 if (rc != ERROR_SUCCESS)
456 {
457 ERR("AppendStringToMultiSZ() failed with error 0x%lx\n", rc);
458 goto cleanup;
459 }
460 rc = AppendStringToMultiSZ(hKey, L"Route", UuidString);
461 if (rc != ERROR_SUCCESS)
462 {
463 ERR("AppendStringToMultiSZ() failed with error 0x%lx\n", rc);
464 goto cleanup;
465 }
466
467 /* Start the device */
469 {
470 rc = GetLastError();
471 ERR("SetupDiRestartDevices() failed with error 0x%lx\n", rc);
472 goto cleanup;
473 }
474
475 rc = ERROR_SUCCESS;
476
477cleanup:
478 HeapFree(GetProcessHeap(), 0, pszNameBuffer);
482 HeapFree(GetProcessHeap(), 0, ExportName);
483 if (hInterfaceKey != NULL)
484 RegCloseKey(hInterfaceKey);
485 if (hInterfacesKey != NULL)
486 RegCloseKey(hInterfacesKey);
487 if (hKey != NULL)
489 if (hNetworkKey != NULL)
490 RegCloseKey(hNetworkKey);
491 if (hLinkageKey != NULL)
492 RegCloseKey(hLinkageKey);
493 if (hConnectionKey != NULL)
494 RegCloseKey(hConnectionKey);
495
496 return rc;
497}
498
499static
500DWORD
502{
503 FIXME("Installation of network clients is not yet supported\n");
504 return ERROR_GEN_FAILURE;
505}
506
507static
508DWORD
510{
511 FIXME("Installation of network services is not yet supported\n");
512 return ERROR_GEN_FAILURE;
513}
514
515static
516DWORD
518{
519 FIXME("Installation of network protocols is not yet supported\n");
520 return ERROR_GEN_FAILURE;
521}
522
523DWORD
524WINAPI
526 IN DI_FUNCTION InstallFunction,
529{
530 SP_DRVINFO_DATA_W DriverInfoData;
531 SP_DRVINFO_DETAIL_DATA_W DriverInfoDetail;
532 WCHAR SectionName[LINE_LEN];
534 INFCONTEXT InfContext;
535 UINT ErrorLine;
536 INT CharacteristicsInt;
537 DWORD Characteristics;
539 RPC_STATUS RpcStatus;
540 UUID Uuid;
541 LPWSTR UuidRpcString = NULL;
542 LPWSTR UuidString = NULL;
543 LONG rc;
545
546 if (InstallFunction != DIF_INSTALLDEVICE)
547 return ERROR_DI_DO_DEFAULT;
548
549 TRACE("%lu %p %p\n", InstallFunction, DeviceInfoSet, DeviceInfoData);
550
551 /* Get driver info details */
552 DriverInfoData.cbSize = sizeof(SP_DRVINFO_DATA_W);
554 {
555 rc = GetLastError();
556 ERR("SetupDiGetSelectedDriverW() failed with error 0x%lx\n", rc);
557 goto cleanup;
558 }
559
560 DriverInfoDetail.cbSize = sizeof(SP_DRVINFO_DETAIL_DATA_W);
561 if (!SetupDiGetDriverInfoDetailW(DeviceInfoSet, DeviceInfoData, &DriverInfoData, &DriverInfoDetail, sizeof(DriverInfoDetail), NULL)
563 {
564 rc = GetLastError();
565 ERR("SetupDiGetDriverInfoDetailW() failed with error 0x%lx\n", rc);
566 goto cleanup;
567 }
568
569 hInf = SetupOpenInfFileW(DriverInfoDetail.InfFileName, NULL, INF_STYLE_WIN4, &ErrorLine);
570 if (hInf == INVALID_HANDLE_VALUE)
571 {
572 rc = GetLastError();
573 ERR("SetupOpenInfFileW() failed with error 0x%lx\n", rc);
574 goto cleanup;
575 }
576
577 if (!SetupDiGetActualSectionToInstallW(hInf, DriverInfoDetail.SectionName, SectionName, LINE_LEN, NULL, NULL))
578 {
579 rc = GetLastError();
580 ERR("SetupDiGetActualSectionToInstallW() failed with error 0x%lx\n", rc);
581 goto cleanup;
582 }
583
584 /* Get Characteristics and BusType (optional) from .inf file */
585 if (!SetupFindFirstLineW(hInf, SectionName, L"Characteristics", &InfContext))
586 {
587 rc = GetLastError();
588 ERR("Unable to find key %S in section %S of file %S (error 0x%lx)\n",
589 L"Characteristics", SectionName, DriverInfoDetail.InfFileName, rc);
590 goto cleanup;
591 }
592
593 if (!SetupGetIntField(&InfContext, 1, &CharacteristicsInt))
594 {
595 rc = GetLastError();
596 ERR("SetupGetIntField() failed with error 0x%lx\n", rc);
597 goto cleanup;
598 }
599
600 Characteristics = (DWORD)CharacteristicsInt;
601 if (IsEqualIID(&DeviceInfoData->ClassGuid, &GUID_DEVCLASS_NET))
602 {
603 if (SetupFindFirstLineW(hInf, SectionName, L"BusType", &InfContext))
604 {
605 if (!SetupGetStringFieldW(&InfContext, 1, NULL, 0, &dwLength))
606 {
607 rc = GetLastError();
608 ERR("SetupGetStringFieldW() failed with error 0x%lx\n", rc);
609 goto cleanup;
610 }
611
612 BusType = HeapAlloc(GetProcessHeap(), 0, dwLength * sizeof(WCHAR));
613 if (!BusType)
614 {
615 ERR("HeapAlloc() failed\n");
617 goto cleanup;
618 }
619
620 if (!SetupGetStringFieldW(&InfContext, 1, BusType, dwLength, NULL))
621 {
622 rc = GetLastError();
623 ERR("SetupGetStringFieldW() failed with error 0x%lx\n", rc);
624 goto cleanup;
625 }
626 }
627 }
628
629 /* Create a new UUID */
630 RpcStatus = UuidCreate(&Uuid);
631 if (RpcStatus != RPC_S_OK && RpcStatus != RPC_S_UUID_LOCAL_ONLY)
632 {
633 ERR("UuidCreate() failed with RPC status 0x%lx\n", RpcStatus);
635 goto cleanup;
636 }
637
638 RpcStatus = UuidToStringW(&Uuid, &UuidRpcString);
639 if (RpcStatus != RPC_S_OK)
640 {
641 ERR("UuidToStringW() failed with RPC status 0x%lx\n", RpcStatus);
643 goto cleanup;
644 }
645
646 /* Add curly braces around Uuid */
647 UuidString = HeapAlloc(GetProcessHeap(), 0, (2 + wcslen(UuidRpcString)) * sizeof(WCHAR) + sizeof(UNICODE_NULL));
648 if (!UuidString)
649 {
650 ERR("HeapAlloc() failed\n");
652 goto cleanup;
653 }
654
655 wcscpy(UuidString, L"{");
656 wcscat(UuidString, UuidRpcString);
657 wcscat(UuidString, L"}");
658
659 if (IsEqualIID(&DeviceInfoData->ClassGuid, &GUID_DEVCLASS_NET))
660 rc = InstallNetDevice(DeviceInfoSet, DeviceInfoData, UuidString, Characteristics, BusType);
661 else if (IsEqualIID(&DeviceInfoData->ClassGuid, &GUID_DEVCLASS_NETCLIENT))
662 rc = InstallNetClient();
663 else if (IsEqualIID(&DeviceInfoData->ClassGuid, &GUID_DEVCLASS_NETSERVICE))
664 rc = InstallNetService();
665 else if (IsEqualIID(&DeviceInfoData->ClassGuid, &GUID_DEVCLASS_NETTRANS))
666 rc = InstallNetTransport();
667 else
668 {
669 ERR("Invalid class guid\n");
671 }
672
673cleanup:
674 if (hInf != INVALID_HANDLE_VALUE)
675 SetupCloseInfFile(hInf);
676 if (UuidRpcString != NULL)
677 RpcStringFreeW(&UuidRpcString);
679 HeapFree(GetProcessHeap(), 0, UuidString);
680
681 TRACE("Returning 0x%lx\n", rc);
682 return rc;
683}
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char const char UINT32 ComponentId
Definition: acpixf.h:1281
#define FIXME(fmt,...)
Definition: precomp.h:53
#define ERR(fmt,...)
Definition: precomp.h:57
#define RegCloseKey(hKey)
Definition: registry.h:49
Definition: bufpool.h:45
wcscat
wcscpy
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
LONG WINAPI RegQueryInfoKeyW(HKEY hKey, LPWSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime)
Definition: reg.c:3662
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
#define GetProcessHeap()
Definition: compat.h:736
#define wcsrchr
Definition: compat.h:16
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
static DWORD DWORD * dwLength
Definition: fusion.c:86
static void cleanup(void)
Definition: main.c:1335
INT WINAPI DECLSPEC_HOTPATCH LoadStringW(HINSTANCE instance, UINT resource_id, LPWSTR buffer, INT buflen)
Definition: string.c:1220
HINSTANCE netcfgx_hInstance
Definition: netcfgx.c:15
#define IDS_NET_CONNECT
Definition: resource.h:99
BOOL WINAPI SetupDiRestartDevices(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData)
Definition: devinst.c:6114
BOOL WINAPI SetupDiSetDeviceInstallParamsW(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN PSP_DEVINSTALL_PARAMS_W DeviceInstallParams)
Definition: devinst.c:4558
HKEY WINAPI SetupDiCreateDevRegKeyW(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, DWORD Scope, DWORD HwProfile, DWORD KeyType, HINF InfHandle, PCWSTR InfSectionName)
Definition: devinst.c:1396
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 SetupDiInstallDevice(IN HDEVINFO DeviceInfoSet, IN OUT PSP_DEVINFO_DATA DeviceInfoData)
Definition: devinst.c:5365
BOOL WINAPI SetupDiGetDeviceInstanceIdW(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, PWSTR DeviceInstanceId, DWORD DeviceInstanceIdSize, PDWORD RequiredSize)
Definition: devinst.c:1907
HKEY WINAPI SetupDiOpenDevRegKey(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, DWORD Scope, DWORD HwProfile, DWORD KeyType, REGSAM samDesired)
Definition: devinst.c:5934
BOOL WINAPI SetupDiGetSelectedDriverW(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, OUT PSP_DRVINFO_DATA_W DriverInfoData)
Definition: driver.c:1479
BOOL WINAPI SetupDiGetDriverInfoDetailW(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN PSP_DRVINFO_DATA_W DriverInfoData, IN OUT PSP_DRVINFO_DETAIL_DATA_W DriverInfoDetailData OPTIONAL, IN DWORD DriverInfoDetailDataSize, OUT PDWORD RequiredSize OPTIONAL)
Definition: driver.c:1878
HINF WINAPI SetupOpenInfFileW(PCWSTR name, PCWSTR class, DWORD style, UINT *error)
Definition: parser.c:1229
#define L(x)
Definition: resources.c:13
unsigned long DWORD
Definition: ntddk_ex.h:95
_Must_inspect_result_ _In_opt_ PVOID _In_opt_ PVOID InstanceId
Definition: fsrtlfuncs.h:908
FxAutoRegKey hKey
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define INF_STYLE_WIN4
Definition: infsupp.h:43
#define REG_SZ
Definition: layer.c:22
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
static PVOID ptr
Definition: dispmode.c:27
unsigned int UINT
Definition: ndis.h:50
static DWORD GetUniqueConnectionName(_In_ HKEY hNetworkKey, _Out_ PWSTR *ppszNameBuffer)
Definition: installer.c:95
static DWORD InstallNetDevice(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData, LPCWSTR UuidString, DWORD Characteristics, LPCWSTR BusType)
Definition: installer.c:149
static DWORD InstallNetService(VOID)
Definition: installer.c:509
static LONG AppendStringToMultiSZ(IN HKEY hKey, IN PCWSTR ValueName, IN PCWSTR ValueToAppend)
Definition: installer.c:20
DWORD WINAPI NetClassInstaller(IN DI_FUNCTION InstallFunction, IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL)
Definition: installer.c:525
static DWORD InstallNetTransport(VOID)
Definition: installer.c:517
static DWORD InstallNetClient(VOID)
Definition: installer.c:501
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define KEY_ALL_ACCESS
Definition: nt_native.h:1044
#define KEY_READ
Definition: nt_native.h:1026
#define KEY_CREATE_SUB_KEY
Definition: nt_native.h:1021
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1060
#define KEY_QUERY_VALUE
Definition: nt_native.h:1019
#define REG_MULTI_SZ
Definition: nt_native.h:1504
#define KEY_WRITE
Definition: nt_native.h:1034
#define DWORD
Definition: nt_native.h:44
#define KEY_SET_VALUE
Definition: nt_native.h:1020
#define UNICODE_NULL
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
long LONG
Definition: pedump.c:60
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define RPC_S_OK
Definition: rpcnterr.h:22
RPC_STATUS WINAPI UuidToStringW(UUID *Uuid, RPC_WSTR *StringUuid)
Definition: rpcrt4_main.c:573
RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR *String)
Definition: rpcrt4_main.c:181
RPC_STATUS WINAPI UuidCreate(UUID *Uuid)
Definition: rpcrt4_main.c:330
#define REG_DWORD
Definition: sdbapi.c:615
long RPC_STATUS
Definition: rpc.h:48
#define LINE_LEN
Definition: setupapi.h:20
struct _SP_DRVINFO_DETAIL_DATA_W SP_DRVINFO_DETAIL_DATA_W
#define DIREG_DRV
Definition: setupapi.h:183
SP_DRVINFO_DATA_V2_W SP_DRVINFO_DATA_W
Definition: setupapi.h:1054
_In_opt_ PSP_DEVINFO_DATA DeviceInfoData
Definition: setupapi.h:1529
#define ERROR_DI_DO_DEFAULT
Definition: setupapi.h:311
UINT DI_FUNCTION
Definition: setupapi.h:673
#define DIF_INSTALLDEVICE
Definition: setupapi.h:122
#define DICS_FLAG_GLOBAL
Definition: setupapi.h:113
#define DI_DONOTCALLCONFIGMG
Definition: setupapi.h:63
#define TRACE(s)
Definition: solgame.cpp:4
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
WCHAR SectionName[LINE_LEN]
Definition: setupapi.h:1077
WCHAR InfFileName[MAX_PATH]
Definition: setupapi.h:1078
uint16_t * PWSTR
Definition: typedefs.h:56
const uint16_t * PCWSTR
Definition: typedefs.h:57
int32_t INT
Definition: typedefs.h:58
#define IN
Definition: typedefs.h:39
BOOL WINAPI SetupGetStringFieldW(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
Definition: infsupp.c:186
BOOL WINAPI SetupFindFirstLineW(IN HINF InfHandle, IN PCWSTR Section, IN PCWSTR Key, IN OUT PINFCONTEXT Context)
Definition: infsupp.c:56
BOOL WINAPI SetupGetIntField(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT INT *IntegerValue)
Definition: infsupp.c:148
VOID WINAPI SetupCloseInfFile(IN HINF InfHandle)
Definition: infsupp.c:45
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3281
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
Definition: wdfregistry.h:243
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define WINAPI
Definition: msvc.h:6
#define ERROR_GEN_FAILURE
Definition: winerror.h:256
#define RPC_S_UUID_LOCAL_ONLY
Definition: winerror.h:1488
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE BusType
Definition: halfuncs.h:159
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
unsigned char BYTE
Definition: xxhash.c:193