66 dwRequired =
sizeof(
WCHAR);
105 TRACE(
"GetNewConnectionName()\n");
110 pszDefaultName =
L"Network Connection";
121 ERR(
"RegQueryInfoKeyW: Error %lu\n", dwError);
125 TRACE(
"Adapter Count: %lu\n", dwSubKeys);
129 (
Length + ((dwSubKeys != 0) ? 6 : 1)) *
sizeof(
WCHAR));
130 if (pszNameBuffer ==
NULL)
140 TRACE(
"Adapter Name: %S\n", pszNameBuffer);
142 *ppszNameBuffer = pszNameBuffer;
153 DWORD Characteristics,
177 ERR(
"SetupDiGetDeviceInstallParamsW() failed (Error %lu)\n", rc);
189 ERR(
"SetupDiSetDeviceInstallParamsW() failed (Error %lu)\n", rc);
197 ERR(
"SetupDiInstallDevice() failed (Error %lu)\n", rc);
204 ERR(
"SetupDiGetDeviceInstanceIdW() returned TRUE. FALSE expected\n");
212 ERR(
"HeapAlloc() failed\n");
220 ERR(
"SetupDiGetDeviceInstanceIdW() failed with error 0x%lx\n", rc);
228 ERR(
"HeapAlloc() failed\n");
239 ERR(
"HeapAlloc() failed\n");
243 wcscpy(ExportName,
L"\\Device\\Tcpip_");
244 wcscat(ExportName, UuidString);
250 ERR(
"RegCreateKeyExW() failed with error 0x%lx\n", rc);
257 ERR(
"RegCreateKeyExW() failed with error 0x%lx\n", rc);
264 ERR(
"RegSetValueExW() failed with error 0x%lx\n", rc);
271 ERR(
"RegSetValueExW() failed with error 0x%lx\n", rc);
278 ERR(
"RegSetValueExW() failed with error 0x%lx\n", rc);
286 ERR(
"RegSetValueExW() failed with error 0x%lx\n", rc);
291#if _WIN32_WINNT >= 0x502
302 ERR(
"SetupDiCreateDevRegKeyW() failed with error 0x%lx\n", rc);
309 ERR(
"RegSetValueExW() failed with error 0x%lx\n", rc);
316 ERR(
"RegSetValueExW() failed with error 0x%lx\n", rc);
324 ERR(
"RegQueryValueExW() failed with error 0x%lx\n", rc);
329 ERR(
"Invalid registry type for 'MatchingDeviceId'\n");
336 ERR(
"HeapAlloc() failed\n");
343 ERR(
"RegQueryValueExW() failed with error 0x%lx\n", rc);
350 ERR(
"RegSetValueExW() failed with error 0x%lx\n", rc);
359 ERR(
"RegSetValueExW() failed with error 0x%lx\n", rc);
367 ERR(
"RegCreateKeyExW() failed with error 0x%lx\n", rc);
374 ERR(
"RegSetValueExW() failed with error 0x%lx\n", rc);
381 ERR(
"RegSetValueExW() failed with error 0x%lx\n", rc);
388 ERR(
"RegSetValueExW() failed with error 0x%lx\n", rc);
396 L"SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}",
406 ERR(
"RegCreateKeyExW() failed with error 0x%lx\n", rc);
413 ERR(
"GetUniqueConnectionName() failed with error 0x%lx\n", rc);
420 ERR(
"RegCreateKeyExW() failed with error 0x%lx\n", rc);
429 ERR(
"RegCreateKeyExW() failed with error 0x%lx\n", rc);
436 ERR(
"RegSetValueExW() failed with error 0x%lx\n", rc);
443 ERR(
"RegSetValueExW() failed with error 0x%lx\n", rc);
451 ERR(
"RegSetValueExW() failed with error 0x%lx\n", rc);
459 ERR(
"RegCreateKeyExW() failed with error 0x%lx\n", rc);
465 ERR(
"AppendStringToMultiSZ() failed with error 0x%lx\n", rc);
471 ERR(
"AppendStringToMultiSZ() failed with error 0x%lx\n", rc);
477 ERR(
"AppendStringToMultiSZ() failed with error 0x%lx\n", rc);
485 ERR(
"SetupDiRestartDevices() failed with error 0x%lx\n", rc);
497 if (hInterfaceKey !=
NULL)
499 if (hInterfacesKey !=
NULL)
503 if (hNetworkKey !=
NULL)
505 if (hLinkageKey !=
NULL)
507 if (hConnectionKey !=
NULL)
517 FIXME(
"Installation of network clients is not yet supported\n");
525 FIXME(
"Installation of network services is not yet supported\n");
533 FIXME(
"Installation of network protocols is not yet supported\n");
550 INT CharacteristicsInt;
551 DWORD Characteristics;
570 ERR(
"SetupDiGetSelectedDriverW() failed with error 0x%lx\n", rc);
579 ERR(
"SetupDiGetDriverInfoDetailW() failed with error 0x%lx\n", rc);
587 ERR(
"SetupOpenInfFileW() failed with error 0x%lx\n", rc);
594 ERR(
"SetupDiGetActualSectionToInstallW() failed with error 0x%lx\n", rc);
602 ERR(
"Unable to find key %S in section %S of file %S (error 0x%lx)\n",
603 L"Characteristics", SectionName, DriverInfoDetail.
InfFileName, rc);
610 ERR(
"SetupGetIntField() failed with error 0x%lx\n", rc);
614 Characteristics = (
DWORD)CharacteristicsInt;
622 ERR(
"SetupGetStringFieldW() failed with error 0x%lx\n", rc);
629 ERR(
"HeapAlloc() failed\n");
637 ERR(
"SetupGetStringFieldW() failed with error 0x%lx\n", rc);
647 ERR(
"UuidCreate() failed with RPC status 0x%lx\n", RpcStatus);
655 ERR(
"UuidToStringW() failed with RPC status 0x%lx\n", RpcStatus);
664 ERR(
"HeapAlloc() failed\n");
670 wcscat(UuidString, UuidRpcString);
683 ERR(
"Invalid class guid\n");
690 if (UuidRpcString !=
NULL)
695 TRACE(
"Returning 0x%lx\n", rc);
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
#define RegCloseKey(hKey)
#define ERROR_NOT_ENOUGH_MEMORY
#define ERROR_INSUFFICIENT_BUFFER
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)
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
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)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
#define INVALID_HANDLE_VALUE
#define HeapFree(x, y, z)
static DWORD DWORD * dwLength
static void cleanup(void)
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
HINSTANCE netcfgx_hInstance
BOOL WINAPI SetupDiRestartDevices(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData)
BOOL WINAPI SetupDiSetDeviceInstallParamsW(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN PSP_DEVINSTALL_PARAMS_W DeviceInstallParams)
HKEY WINAPI SetupDiCreateDevRegKeyW(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, DWORD Scope, DWORD HwProfile, DWORD KeyType, HINF InfHandle, PCWSTR InfSectionName)
BOOL WINAPI SetupDiGetDeviceInstallParamsW(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, OUT PSP_DEVINSTALL_PARAMS_W DeviceInstallParams)
BOOL WINAPI SetupDiGetActualSectionToInstallW(HINF InfHandle, PCWSTR InfSectionName, PWSTR InfSectionWithExt, DWORD InfSectionWithExtSize, PDWORD RequiredSize, PWSTR *Extension)
BOOL WINAPI SetupDiInstallDevice(IN HDEVINFO DeviceInfoSet, IN OUT PSP_DEVINFO_DATA DeviceInfoData)
BOOL WINAPI SetupDiGetDeviceInstanceIdW(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, PWSTR DeviceInstanceId, DWORD DeviceInstanceIdSize, PDWORD RequiredSize)
HKEY WINAPI SetupDiOpenDevRegKey(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, DWORD Scope, DWORD HwProfile, DWORD KeyType, REGSAM samDesired)
BOOL WINAPI SetupDiGetSelectedDriverW(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, OUT PSP_DRVINFO_DATA_W DriverInfoData)
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)
HINF WINAPI SetupOpenInfFileW(PCWSTR name, PCWSTR class, DWORD style, UINT *error)
_Must_inspect_result_ _In_opt_ PVOID _In_opt_ PVOID InstanceId
#define ERROR_FILE_NOT_FOUND
static DWORD GetUniqueConnectionName(_In_ HKEY hNetworkKey, _Out_ PWSTR *ppszNameBuffer)
static DWORD InstallNetDevice(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData, LPCWSTR UuidString, DWORD Characteristics, LPCWSTR BusType)
static DWORD InstallNetService(VOID)
static LONG AppendStringToMultiSZ(IN HKEY hKey, IN PCWSTR ValueName, IN PCWSTR ValueToAppend)
DWORD WINAPI NetClassInstaller(IN DI_FUNCTION InstallFunction, IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL)
static DWORD InstallNetTransport(VOID)
static DWORD InstallNetClient(VOID)
#define KEY_CREATE_SUB_KEY
#define REG_OPTION_NON_VOLATILE
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define IsEqualIID(riid1, riid2)
RPC_STATUS WINAPI UuidToStringW(UUID *Uuid, RPC_WSTR *StringUuid)
RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR *String)
RPC_STATUS WINAPI UuidCreate(UUID *Uuid)
_In_opt_ PSP_DEVINFO_DATA DeviceInfoData
struct _SP_DRVINFO_DETAIL_DATA_W SP_DRVINFO_DETAIL_DATA_W
SP_DRVINFO_DATA_V2_W SP_DRVINFO_DATA_W
#define ERROR_DI_DO_DEFAULT
#define DIF_INSTALLDEVICE
#define DI_DONOTCALLCONFIGMG
PULONG MinorVersion OPTIONAL
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
WCHAR SectionName[LINE_LEN]
WCHAR InfFileName[MAX_PATH]
BOOL WINAPI SetupGetStringFieldW(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
BOOL WINAPI SetupFindFirstLineW(IN HINF InfHandle, IN PCWSTR Section, IN PCWSTR Key, IN OUT PINFCONTEXT Context)
BOOL WINAPI SetupGetIntField(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT INT *IntegerValue)
VOID WINAPI SetupCloseInfFile(IN HINF InfHandle)
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
DWORD WINAPI GetLastError(void)
#define ERROR_GEN_FAILURE
#define RPC_S_UUID_LOCAL_ONLY
#define HKEY_LOCAL_MACHINE
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE BusType