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,
176 ERR(
"SetupDiGetDeviceInstallParamsW() failed (Error %lu)\n", rc);
188 ERR(
"SetupDiSetDeviceInstallParamsW() failed (Error %lu)\n", rc);
196 ERR(
"SetupDiInstallDevice() failed (Error %lu)\n", rc);
203 ERR(
"SetupDiGetDeviceInstanceIdW() returned TRUE. FALSE expected\n");
211 ERR(
"HeapAlloc() failed\n");
219 ERR(
"SetupDiGetDeviceInstanceIdW() failed with error 0x%lx\n", rc);
226 ERR(
"HeapAlloc() failed\n");
240 ERR(
"HeapAlloc() failed\n");
251 ERR(
"HeapAlloc() failed\n");
255 wcscpy(ExportName,
L"\\Device\\Tcpip_");
256 wcscat(ExportName, UuidString);
262 ERR(
"RegCreateKeyExW() failed with error 0x%lx\n", rc);
269 ERR(
"RegCreateKeyExW() failed with error 0x%lx\n", rc);
278 ERR(
"RegCreateKeyExW() failed with error 0x%lx\n", rc);
287 ERR(
"RegSetValueExW() failed with error 0x%lx\n", rc);
294 ERR(
"RegSetValueExW() failed with error 0x%lx\n", rc);
301 ERR(
"RegSetValueExW() failed with error 0x%lx\n", rc);
309 ERR(
"RegSetValueExW() failed with error 0x%lx\n", rc);
316 #if _WIN32_WINNT >= 0x502 327 ERR(
"SetupDiCreateDevRegKeyW() failed with error 0x%lx\n", rc);
334 ERR(
"RegSetValueExW() failed with error 0x%lx\n", rc);
341 ERR(
"RegSetValueExW() failed with error 0x%lx\n", rc);
348 ERR(
"RegSetValueExW() failed with error 0x%lx\n", rc);
357 ERR(
"RegSetValueExW() failed with error 0x%lx\n", rc);
365 ERR(
"RegCreateKeyExW() failed with error 0x%lx\n", rc);
372 ERR(
"RegSetValueExW() failed with error 0x%lx\n", rc);
379 ERR(
"RegSetValueExW() failed with error 0x%lx\n", rc);
386 ERR(
"RegSetValueExW() failed with error 0x%lx\n", rc);
394 L"SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}",
404 ERR(
"RegCreateKeyExW() failed with error 0x%lx\n", rc);
411 ERR(
"GetUniqueConnectionName() failed with error 0x%lx\n", rc);
418 ERR(
"RegCreateKeyExW() failed with error 0x%lx\n", rc);
427 ERR(
"RegCreateKeyExW() failed with error 0x%lx\n", rc);
434 ERR(
"RegSetValueExW() failed with error 0x%lx\n", rc);
441 ERR(
"RegSetValueExW() failed with error 0x%lx\n", rc);
449 ERR(
"RegSetValueExW() failed with error 0x%lx\n", rc);
457 ERR(
"RegCreateKeyExW() failed with error 0x%lx\n", rc);
463 ERR(
"AppendStringToMultiSZ() failed with error 0x%lx\n", rc);
469 ERR(
"AppendStringToMultiSZ() failed with error 0x%lx\n", rc);
475 ERR(
"AppendStringToMultiSZ() failed with error 0x%lx\n", rc);
483 ERR(
"SetupDiRestartDevices() failed with error 0x%lx\n", rc);
497 if (hNetworkKey !=
NULL)
499 if (hLinkageKey !=
NULL)
501 if (hConnectionKey !=
NULL)
511 FIXME(
"Installation of network clients is not yet supported\n");
519 FIXME(
"Installation of network services is not yet supported\n");
527 FIXME(
"Installation of network protocols is not yet supported\n");
544 INT CharacteristicsInt;
545 DWORD Characteristics;
564 ERR(
"SetupDiGetSelectedDriverW() failed with error 0x%lx\n", rc);
573 ERR(
"SetupDiGetDriverInfoDetailW() failed with error 0x%lx\n", rc);
581 ERR(
"SetupOpenInfFileW() failed with error 0x%lx\n", rc);
588 ERR(
"SetupDiGetActualSectionToInstallW() failed with error 0x%lx\n", rc);
596 ERR(
"Unable to find key %S in section %S of file %S (error 0x%lx)\n",
597 L"Characteristics", SectionName, DriverInfoDetail.
InfFileName, rc);
604 ERR(
"SetupGetIntField() failed with error 0x%lx\n", rc);
608 Characteristics = (
DWORD)CharacteristicsInt;
616 ERR(
"SetupGetStringFieldW() failed with error 0x%lx\n", rc);
623 ERR(
"HeapAlloc() failed\n");
631 ERR(
"SetupGetStringFieldW() failed with error 0x%lx\n", rc);
641 ERR(
"UuidCreate() failed with RPC status 0x%lx\n", RpcStatus);
649 ERR(
"UuidToStringW() failed with RPC status 0x%lx\n", RpcStatus);
658 ERR(
"HeapAlloc() failed\n");
664 wcscat(UuidString, UuidRpcString);
677 ERR(
"Invalid class guid\n");
684 if (UuidRpcString !=
NULL)
689 TRACE(
"Returning 0x%lx\n", rc);
BOOL WINAPI SetupFindFirstLineW(IN HINF InfHandle, IN PCWSTR Section, IN PCWSTR Key, IN OUT PINFCONTEXT Context)
DWORD WINAPI NetClassInstaller(IN DI_FUNCTION InstallFunction, IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL)
BOOL WINAPI SetupDiGetActualSectionToInstallW(HINF InfHandle, PCWSTR InfSectionName, PWSTR InfSectionWithExt, DWORD InfSectionWithExtSize, PDWORD RequiredSize, PWSTR *Extension)
_In_ ULONG _In_ ULONG _In_ ULONG Length
RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR *String)
BOOL WINAPI SetupDiSetDeviceInstallParamsW(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN PSP_DEVINSTALL_PARAMS_W DeviceInstallParams)
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE BusType
static LONG AppendStringToMultiSZ(IN HKEY hKey, IN PCWSTR ValueName, IN PCWSTR ValueToAppend)
#define ERROR_NOT_ENOUGH_MEMORY
#define INVALID_HANDLE_VALUE
DWORD WINAPI GetLastError(VOID)
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
HINF WINAPI SetupOpenInfFileW(PCWSTR name, PCWSTR class, DWORD style, UINT *error)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
VOID WINAPI SetupCloseInfFile(IN HINF InfHandle)
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)
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
BOOL WINAPI SetupDiRestartDevices(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData)
#define DI_DONOTCALLCONFIGMG
BOOL WINAPI SetupDiInstallDevice(IN HDEVINFO DeviceInfoSet, IN OUT PSP_DEVINFO_DATA DeviceInfoData)
BOOL WINAPI SetupDiGetDeviceInstallParamsW(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, OUT PSP_DEVINSTALL_PARAMS_W DeviceInstallParams)
_Must_inspect_result_ _In_opt_ PVOID _In_opt_ PVOID InstanceId
#define ERROR_FILE_NOT_FOUND
HKEY WINAPI SetupDiCreateDevRegKeyW(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, DWORD Scope, DWORD HwProfile, DWORD KeyType, HINF InfHandle, PCWSTR InfSectionName)
#define DIF_INSTALLDEVICE
#define REG_OPTION_NON_VOLATILE
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
HINSTANCE netcfgx_hInstance
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
static DWORD DWORD * dwLength
_In_opt_ PSP_DEVINFO_DATA DeviceInfoData
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)
RPC_STATUS WINAPI UuidToStringW(UUID *Uuid, RPC_WSTR *StringUuid)
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
SP_DRVINFO_DATA_V2_W SP_DRVINFO_DATA_W
static DWORD InstallNetTransport(VOID)
static DWORD InstallNetService(VOID)
HKEY WINAPI SetupDiOpenDevRegKey(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, DWORD Scope, DWORD HwProfile, DWORD KeyType, REGSAM samDesired)
static DWORD InstallNetClient(VOID)
BOOL WINAPI SetupDiGetSelectedDriverW(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, OUT PSP_DRVINFO_DATA_W DriverInfoData)
RPC_STATUS WINAPI UuidCreate(UUID *Uuid)
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
WCHAR SectionName[LINE_LEN]
struct _SP_DRVINFO_DETAIL_DATA_W SP_DRVINFO_DETAIL_DATA_W
#define ERROR_DI_DO_DEFAULT
BOOL WINAPI SetupGetIntField(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT INT *IntegerValue)
BOOL WINAPI SetupDiGetDeviceInstanceIdW(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, PWSTR DeviceInstanceId, DWORD DeviceInstanceIdSize, PDWORD RequiredSize)
char * cleanup(char *str)
static DWORD InstallNetDevice(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData, LPCWSTR UuidString, DWORD Characteristics, LPCWSTR BusType)
#define ERROR_GEN_FAILURE
static DWORD GetUniqueConnectionName(_In_ HKEY hNetworkKey, _Out_ PWSTR *ppszNameBuffer)
#define KEY_CREATE_SUB_KEY
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)
#define HeapFree(x, y, z)
#define RPC_S_UUID_LOCAL_ONLY
#define RegCloseKey(hKey)
#define IsEqualIID(riid1, riid2)
WCHAR InfFileName[MAX_PATH]
#define HKEY_LOCAL_MACHINE
#define ERROR_INSUFFICIENT_BUFFER
PULONG MinorVersion OPTIONAL
BOOL WINAPI SetupGetStringFieldW(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)