mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
Implement the StorageCoInstaller and configure it for CD-ROM and Disk devices
This sets the friendly name for CD-ROM and Disk devices.
This commit is contained in:
parent
3d980c4a2c
commit
d9e20ae3fe
4 changed files with 75 additions and 9 deletions
|
@ -402,8 +402,8 @@ HKLM,"SYSTEM\CurrentControlSet\Control\Class\{9D6D66A6-0B0C-4563-9077-A0E9A7955A
|
||||||
|
|
||||||
; Class Co-Installers
|
; Class Co-Installers
|
||||||
HKLM,"SYSTEM\CurrentControlSet\Control\CoDeviceInstallers",,0x00000012
|
HKLM,"SYSTEM\CurrentControlSet\Control\CoDeviceInstallers",,0x00000012
|
||||||
HKLM,"SYSTEM\CurrentControlSet\Control\CoDeviceInstallers","{4D36E965-E325-11CE-BFC1-08002BE10318}",0x00010000,"syssetup.dll,CriticalDeviceCoInstaller"
|
HKLM,"SYSTEM\CurrentControlSet\Control\CoDeviceInstallers","{4D36E965-E325-11CE-BFC1-08002BE10318}",0x00010000,"syssetup.dll,StorageCoInstaller","syssetup.dll,CriticalDeviceCoInstaller"
|
||||||
HKLM,"SYSTEM\CurrentControlSet\Control\CoDeviceInstallers","{4D36E967-E325-11CE-BFC1-08002BE10318}",0x00010000,"syssetup.dll,CriticalDeviceCoInstaller"
|
HKLM,"SYSTEM\CurrentControlSet\Control\CoDeviceInstallers","{4D36E967-E325-11CE-BFC1-08002BE10318}",0x00010000,"syssetup.dll,StorageCoInstaller","syssetup.dll,CriticalDeviceCoInstaller"
|
||||||
HKLM,"SYSTEM\CurrentControlSet\Control\CoDeviceInstallers","{4D36E96A-E325-11CE-BFC1-08002BE10318}",0x00010000,"syssetup.dll,CriticalDeviceCoInstaller"
|
HKLM,"SYSTEM\CurrentControlSet\Control\CoDeviceInstallers","{4D36E96A-E325-11CE-BFC1-08002BE10318}",0x00010000,"syssetup.dll,CriticalDeviceCoInstaller"
|
||||||
HKLM,"SYSTEM\CurrentControlSet\Control\CoDeviceInstallers","{4D36E96B-E325-11CE-BFC1-08002BE10318}",0x00010000,"syssetup.dll,CriticalDeviceCoInstaller"
|
HKLM,"SYSTEM\CurrentControlSet\Control\CoDeviceInstallers","{4D36E96B-E325-11CE-BFC1-08002BE10318}",0x00010000,"syssetup.dll,CriticalDeviceCoInstaller"
|
||||||
HKLM,"SYSTEM\CurrentControlSet\Control\CoDeviceInstallers","{4D36E96F-E325-11CE-BFC1-08002BE10318}",0x00010000,"syssetup.dll,CriticalDeviceCoInstaller"
|
HKLM,"SYSTEM\CurrentControlSet\Control\CoDeviceInstallers","{4D36E96F-E325-11CE-BFC1-08002BE10318}",0x00010000,"syssetup.dll,CriticalDeviceCoInstaller"
|
||||||
|
|
|
@ -377,7 +377,7 @@ ScsiClassInstaller(
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
DWORD
|
DWORD
|
||||||
WINAPI
|
WINAPI
|
||||||
|
@ -387,12 +387,77 @@ StorageCoInstaller(
|
||||||
IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL,
|
IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL,
|
||||||
IN OUT PCOINSTALLER_CONTEXT_DATA Context)
|
IN OUT PCOINSTALLER_CONTEXT_DATA Context)
|
||||||
{
|
{
|
||||||
switch (InstallFunction)
|
ULONG ulStatus, ulProblem;
|
||||||
|
DWORD dwBufferSize = 0;
|
||||||
|
PWSTR pszDeviceDescription;
|
||||||
|
CONFIGRET ret;
|
||||||
|
|
||||||
|
DPRINT("StorageCoInstaller(%u %p %p %p)\n",
|
||||||
|
InstallFunction, DeviceInfoSet, DeviceInfoData, Context);
|
||||||
|
|
||||||
|
if (InstallFunction != DIF_INSTALLDEVICE)
|
||||||
|
return ERROR_SUCCESS;
|
||||||
|
|
||||||
|
if (Context->PostProcessing)
|
||||||
{
|
{
|
||||||
default:
|
if (Context->PrivateData != NULL)
|
||||||
DPRINT1("Install function %u ignored\n", InstallFunction);
|
{
|
||||||
return ERROR_SUCCESS;
|
pszDeviceDescription = (PWSTR)Context->PrivateData;
|
||||||
|
|
||||||
|
/* Store the device description as the friendly name */
|
||||||
|
SetupDiSetDeviceRegistryPropertyW(DeviceInfoSet,
|
||||||
|
DeviceInfoData,
|
||||||
|
SPDRP_FRIENDLYNAME,
|
||||||
|
(PBYTE)pszDeviceDescription,
|
||||||
|
(wcslen(pszDeviceDescription) + 1) * sizeof(WCHAR));
|
||||||
|
|
||||||
|
/* Free the device description */
|
||||||
|
HeapFree(GetProcessHeap(), 0, Context->PrivateData);
|
||||||
|
Context->PrivateData = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (DeviceInfoData == NULL)
|
||||||
|
return ERROR_SUCCESS;
|
||||||
|
|
||||||
|
ret = CM_Get_DevNode_Status(&ulStatus, &ulProblem, DeviceInfoData->DevInst, 0);
|
||||||
|
if (ret != CR_SUCCESS)
|
||||||
|
return ERROR_SUCCESS;
|
||||||
|
|
||||||
|
if (ulStatus & DN_ROOT_ENUMERATED)
|
||||||
|
return ERROR_SUCCESS;
|
||||||
|
|
||||||
|
/* Get the device description size */
|
||||||
|
SetupDiGetDeviceRegistryPropertyW(DeviceInfoSet,
|
||||||
|
DeviceInfoData,
|
||||||
|
SPDRP_DEVICEDESC,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
0,
|
||||||
|
&dwBufferSize);
|
||||||
|
if (dwBufferSize == 0)
|
||||||
|
return ERROR_SUCCESS;
|
||||||
|
|
||||||
|
/* Allocate the device description buffer */
|
||||||
|
pszDeviceDescription = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwBufferSize);
|
||||||
|
if (pszDeviceDescription == NULL)
|
||||||
|
return ERROR_SUCCESS;
|
||||||
|
|
||||||
|
/* Get the device description */
|
||||||
|
SetupDiGetDeviceRegistryPropertyW(DeviceInfoSet,
|
||||||
|
DeviceInfoData,
|
||||||
|
SPDRP_DEVICEDESC,
|
||||||
|
NULL,
|
||||||
|
(PBYTE)pszDeviceDescription,
|
||||||
|
dwBufferSize,
|
||||||
|
&dwBufferSize);
|
||||||
|
|
||||||
|
Context->PrivateData = (PVOID)pszDeviceDescription;
|
||||||
|
return ERROR_DI_POSTPROCESSING_REQUIRED;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,8 @@
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
DWORD WINAPI
|
//DWORD WINAPI
|
||||||
CMP_WaitNoPendingInstallEvents(DWORD dwTimeout);
|
//CMP_WaitNoPendingInstallEvents(DWORD dwTimeout);
|
||||||
|
|
||||||
DWORD WINAPI
|
DWORD WINAPI
|
||||||
SetupStartService(LPCWSTR lpServiceName, BOOL bWait);
|
SetupStartService(LPCWSTR lpServiceName, BOOL bWait);
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
#include <setupapi.h>
|
#include <setupapi.h>
|
||||||
#include <syssetup/syssetup.h>
|
#include <syssetup/syssetup.h>
|
||||||
#include <pseh/pseh2.h>
|
#include <pseh/pseh2.h>
|
||||||
|
#include <cfgmgr32.h>
|
||||||
|
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
|
|
Loading…
Reference in a new issue