48 DPRINT(
"InstallInfSections()\n");
50 if (InfSection ==
NULL)
85 DPRINT1(
"SetupInstallFromInfSectionW(%S) failed (Error %lx)\n", InfSection,
GetLastError());
106 DPRINT(
"InstallInfSections() done %u\n",
ret);
118 WCHAR szKeyBuffer[128];
126 DPRINT(
"CreateInstanceKey()\n");
128 *pInstanceKey =
NULL;
130 wcscpy(szKeyBuffer,
L"SYSTEM\\CurrentControlSet\\Control\\Network\\");
131 wcscat(szKeyBuffer, pComponentInfo->pszClassGuid);
138 DPRINT1(
"UuidCreate() failed with RPC status 0x%lx\n", RpcStatus);
145 DPRINT1(
"UuidToStringW() failed with RPC status 0x%lx\n", RpcStatus);
149 wcscat(szKeyBuffer, UuidString);
154 DPRINT(
"szKeyBuffer %S\n", szKeyBuffer);
167 DPRINT1(
"RegCreateKeyExW() failed with error 0x%lx\n", rc);
175 (
LPBYTE)&pComponentInfo->dwCharacteristics,
179 DPRINT1(
"RegSetValueExW() failed with error 0x%lx\n", rc);
187 (
LPBYTE)pComponentInfo->pszComponentId,
188 (
wcslen(pComponentInfo->pszComponentId) + 1) *
sizeof(
WCHAR));
191 DPRINT1(
"RegSetValueExW() failed with error 0x%lx\n", rc);
199 (
LPBYTE)pComponentInfo->pszDescription,
200 (
wcslen(pComponentInfo->pszDescription) + 1) *
sizeof(
WCHAR));
203 DPRINT1(
"RegSetValueExW() failed with error 0x%lx\n", rc);
211 (
LPBYTE)pComponentInfo->pszInfPath,
212 (
wcslen(pComponentInfo->pszInfPath) + 1) *
sizeof(
WCHAR));
215 DPRINT1(
"RegSetValueExW() failed with error 0x%lx\n", rc);
223 (
LPBYTE)pComponentInfo->pszInfSection,
224 (
wcslen(pComponentInfo->pszInfSection) + 1) *
sizeof(
WCHAR));
227 DPRINT1(
"RegSetValueExW() failed with error 0x%lx\n", rc);
231 *pInstanceKey = hInstanceKey;
238 DPRINT(
"CreateInstanceKey() done %u\n",
ret);
253 INFCONTEXT MfgContext, DevContext, MiscContext;
271 DPRINT(
"No Manufacurer section found!\n");
284 DPRINT(
"Manufacturer: %S\n", szLineBuffer);
300 DPRINT(
"Device: %S\n", szLineBuffer);
301 if (
_wcsicmp(szLineBuffer, pszComponentId) == 0)
315 if (pComponentInfo->pszInfSection)
319 pComponentInfo->pszInfSection,
334 if (pComponentInfo->pszDescription)
338 pComponentInfo->pszDescription,
358 if (pComponentInfo->pszInfSection)
362 pComponentInfo->pszClassGuid,
370 pComponentInfo->pszInfSection,
376 (
PINT)&pComponentInfo->dwCharacteristics);
415 wcscpy(szPathBuffer, szInfPath);
416 wcscat(szPathBuffer,
L"\\*.inf");
424 if (
wcscmp(fdw.cFileName,
L".") == 0 ||
425 wcscmp(fdw.cFileName,
L"..") == 0)
428 DPRINT(
"FileName: %S\n", fdw.cFileName);
430 wcscpy(szFullInfName, szInfPath);
432 wcscat(szFullInfName, fdw.cFileName);
434 DPRINT(
"Full Inf Name: %S\n", szFullInfName);
442 if (pComponentInfo->pszInfPath)
443 wcscpy(pComponentInfo->pszInfPath, fdw.cFileName);
448 if (pComponentInfo->pszComponentId)
449 wcscpy(pComponentInfo->pszComponentId, pszComponentId);
474 DPRINT(
"InstallNetworkComponent(%S)\n", pszComponentId);
507 if (hInstanceKey !=
NULL)
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
BOOL WINAPI SetupFindFirstLineW(IN HINF InfHandle, IN PCWSTR Section, IN PCWSTR Key, IN OUT PINFCONTEXT Context)
struct _COMPONENT_INFO COMPONENT_INFO
RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR *String)
BOOL InstallNetworkComponent(_In_ PWSTR pszComponentId)
#define INVALID_HANDLE_VALUE
DWORD WINAPI GetLastError(VOID)
HINF WINAPI SetupOpenInfFileW(PCWSTR name, PCWSTR class, DWORD style, UINT *error)
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)
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
struct _COMPONENT_INFO * PCOMPONENT_INFO
static BOOL CreateInstanceKey(_In_ PCOMPONENT_INFO pComponentInfo, _Out_ PHKEY pInstanceKey)
#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)
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static DWORD DWORD * dwLength
RPC_STATUS WINAPI UuidToStringW(UUID *Uuid, RPC_WSTR *StringUuid)
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)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
UINT WINAPI SetupDefaultQueueCallbackW(PVOID context, UINT notification, UINT_PTR param1, UINT_PTR param2)
static BOOL InstallInfSections(_In_ HWND hWnd, _In_ HKEY hKey, _In_ LPCWSTR InfFile, _In_ LPCWSTR InfSection)
void WINAPI SetupTermDefaultQueueCallback(PVOID context)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
RPC_STATUS WINAPI UuidCreate(UUID *Uuid)
BOOL WINAPI SetupInstallServicesFromInfSectionW(HINF Inf, PCWSTR SectionName, DWORD Flags)
PVOID WINAPI SetupInitDefaultQueueCallback(HWND owner)
static BOOL CheckInfFile(_In_ PWSTR pszFullInfName, _In_ PWSTR pszComponentId, _In_ PCOMPONENT_INFO pComponentInfo)
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
BOOL WINAPI SetupFindNextLine(IN PINFCONTEXT ContextIn, OUT PINFCONTEXT ContextOut)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
BOOL WINAPI SetupGetIntField(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT INT *IntegerValue)
char * cleanup(char *str)
#define ERROR_GEN_FAILURE
static BOOL ScanForInfFile(_In_ PWSTR pszComponentId, _In_ PCOMPONENT_INFO pComponentInfo)
#define KEY_CREATE_SUB_KEY
#define HeapFree(x, y, z)
#define RPC_S_UUID_LOCAL_ONLY
#define RegCloseKey(hKey)
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
#define HKEY_LOCAL_MACHINE
BOOL WINAPI FindClose(HANDLE hFindFile)
BOOL WINAPI SetupGetStringFieldW(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)