mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 17:52:56 +00:00
[STREAMCI]
- install driver's inf svn path=/trunk/; revision=66521
This commit is contained in:
parent
a4ed9e2e4e
commit
bf6e7cd971
1 changed files with 63 additions and 7 deletions
|
@ -130,6 +130,53 @@ InstallSoftwareDeviceInterface(IN LPGUID DeviceId,
|
||||||
return dwResult;
|
return dwResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DWORD
|
||||||
|
InstallSoftwareDeviceInterfaceInf(IN LPWSTR InfName,
|
||||||
|
IN LPWSTR SectionName)
|
||||||
|
{
|
||||||
|
HDEVINFO hDevInfo;
|
||||||
|
HINF hInf;
|
||||||
|
HKEY hKey;
|
||||||
|
SP_DEVICE_INTERFACE_DATA DeviceInterfaceData;
|
||||||
|
GUID SWBusGuid = {STATIC_BUSID_SoftwareDeviceEnumerator};
|
||||||
|
|
||||||
|
hDevInfo = SetupDiGetClassDevsW(&SWBusGuid, NULL, NULL, 0);
|
||||||
|
if (!hDevInfo)
|
||||||
|
{
|
||||||
|
// failed
|
||||||
|
return GetLastError();
|
||||||
|
}
|
||||||
|
|
||||||
|
DeviceInterfaceData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);
|
||||||
|
if (!SetupDiEnumDeviceInterfaces(hDevInfo, NULL, &SWBusGuid, 0, &DeviceInterfaceData))
|
||||||
|
{
|
||||||
|
// failed
|
||||||
|
return GetLastError();
|
||||||
|
}
|
||||||
|
|
||||||
|
hInf = SetupOpenInfFileW(InfName, NULL, INF_STYLE_WIN4, NULL);
|
||||||
|
if (hInf == INVALID_HANDLE_VALUE)
|
||||||
|
{
|
||||||
|
SetupDiDestroyDeviceInfoList(hDevInfo);
|
||||||
|
return GetLastError();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// FIXME check if interface is already installed
|
||||||
|
//
|
||||||
|
|
||||||
|
hKey = SetupDiCreateDeviceInterfaceRegKeyW(hDevInfo, &DeviceInterfaceData, 0, KEY_ALL_ACCESS, hInf, SectionName);
|
||||||
|
|
||||||
|
SetupCloseInfFile(hInf);
|
||||||
|
SetupDiDestroyDeviceInfoList(hDevInfo);
|
||||||
|
if (hKey != INVALID_HANDLE_VALUE)
|
||||||
|
{
|
||||||
|
RegCloseKey(hKey);
|
||||||
|
}
|
||||||
|
return ERROR_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
WINAPI
|
WINAPI
|
||||||
StreamingDeviceSetupW(IN HWND hwnd,
|
StreamingDeviceSetupW(IN HWND hwnd,
|
||||||
|
@ -137,11 +184,11 @@ StreamingDeviceSetupW(IN HWND hwnd,
|
||||||
IN LPWSTR lpszCmdLine,
|
IN LPWSTR lpszCmdLine,
|
||||||
IN int nCmdShow)
|
IN int nCmdShow)
|
||||||
{
|
{
|
||||||
DWORD Length;
|
DWORD Length, dwResult;
|
||||||
LPWSTR pCmdLine;
|
LPWSTR pCmdLine;
|
||||||
LPWSTR pStr;
|
LPWSTR pStr;
|
||||||
GUID Guids[2];
|
GUID Guids[2];
|
||||||
//WCHAR DevicePath[MAX_PATH];
|
WCHAR DevicePath[MAX_PATH];
|
||||||
HRESULT hResult;
|
HRESULT hResult;
|
||||||
DWORD Index;
|
DWORD Index;
|
||||||
|
|
||||||
|
@ -188,9 +235,18 @@ StreamingDeviceSetupW(IN HWND hwnd,
|
||||||
}while(Index < 2);
|
}while(Index < 2);
|
||||||
|
|
||||||
|
|
||||||
hResult = InstallSoftwareDeviceInterface(&Guids[0], &Guids[1], pStr);
|
dwResult = InstallSoftwareDeviceInterface(&Guids[0], &Guids[1], pStr);
|
||||||
|
if (dwResult == ERROR_SUCCESS)
|
||||||
// FIXME
|
{
|
||||||
// install inf section
|
pStr = wcstok(NULL, L",\t\"");
|
||||||
|
if (pStr != NULL)
|
||||||
|
{
|
||||||
|
wcscpy(DevicePath, pStr);
|
||||||
|
pStr = wcstok(NULL, L",\t\"");
|
||||||
|
if (pStr != NULL)
|
||||||
|
{
|
||||||
|
dwResult = InstallSoftwareDeviceInterfaceInf(DevicePath, pStr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue