diff --git a/reactos/lib/devmgr/En.rc b/reactos/lib/devmgr/En.rc index 5fdf87213c2..0fb2a89ef75 100644 --- a/reactos/lib/devmgr/En.rc +++ b/reactos/lib/devmgr/En.rc @@ -12,6 +12,7 @@ BEGIN IDS_UNKNOWN "Unknown" IDS_LOCATIONSTR "Location %1!u! (%2)" IDS_DEVCODE " (Code %1!u!)" + IDS_DEVCODE2 " (Code %2!u!)" IDS_ENABLEDEVICE "Use this device (enable)" IDS_DISABLEDEVICE "Do not use this device (disable)" IDS_UNKNOWNDEVICE "Unknown device" @@ -20,59 +21,74 @@ BEGIN IDS_TROUBLESHOOTDEV "&Troubleshoot..." IDS_ENABLEDEV "E&nable Device" IDS_REINSTALLDRV "Re&install Driver" + IDS_PROPERTIES "P&roperties" + IDS_UPDATEDRV "U&pdate Driver..." + IDS_REBOOT "Restart &Computer..." END +/* error messages, source: http://www.z123.org/techsupport/medm.htm */ STRINGTABLE BEGIN IDS_DEV_NO_PROBLEM "This device is working properly." - IDS_DEV_NOT_CONFIGURED "CM_PROB_NOT_CONFIGURED" - IDS_DEV_OUT_OF_MEMORY "CM_PROB_DEVLOADER_FAILED" - IDS_DEV_ENTRY_IS_WRONG_TYPE "CM_PROB_ENTRY_IS_WRONG_TYPE" - IDS_DEV_LACKED_ARBITRATOR "CM_PROB_LACKED_ARBITRATOR" - IDS_DEV_BOOT_CONFIG_CONFLICT "CM_PROB_BOOT_CONFIG_CONFLICT" - IDS_DEV_FAILED_FILTER "CM_PROB_FAILED_FILTER" - IDS_DEV_DEVLOADER_NOT_FOUND "CM_PROB_DEVLOADER_NOT_FOUND" - IDS_DEV_INVALID_DATA "CM_PROB_INVALID_DATA" - IDS_DEV_FAILED_START "CM_PROB_FAILED_START" - IDS_DEV_LIAR "CM_PROB_LIAR" - IDS_DEV_NORMAL_CONFLICT "CM_PROB_NORMAL_CONFLICT" - IDS_DEV_NOT_VERIFIED "CM_PROB_NOT_VERIFIED" - IDS_DEV_NEED_RESTART "CM_PROB_NEED_RESTART" - IDS_DEV_REENUMERATION "CM_PROB_REENUMERATION" - IDS_DEV_PARTIAL_LOG_CONF "CM_PROB_PARTIAL_LOG_CONF" - IDS_DEV_UNKNOWN_RESOURCE "CM_PROB_UNKNOWN_RESOURCE" - IDS_DEV_REINSTALL "CM_PROB_REINSTALL" - IDS_DEV_REGISTRY "CM_PROB_REGISTRY" - IDS_DEV_WILL_BE_REMOVED "CM_PROB_WILL_BE_REMOVED" - IDS_DEV_DISABLED "CM_PROB_DISABLED" - IDS_DEV_DEVLOADER_NOT_READY "CM_PROB_DEVLOADER_NOT_READY" - IDS_DEV_DEVICE_NOT_THERE "CM_PROB_DEVICE_NOT_THERE" - IDS_DEV_MOVED "CM_PROB_MOVED" - IDS_DEV_TOO_EARLY "CM_PROB_TOO_EARLY" - IDS_DEV_NO_VALID_LOG_CONF "CM_PROB_NO_VALID_LOG_CONF" - IDS_DEV_FAILED_INSTALL "CM_PROB_FAILED_INSTALL" - IDS_DEV_HARDWARE_DISABLED "CM_PROB_HARDWARE_DISABLED" - IDS_DEV_CANT_SHARE_IRQ "CM_PROB_CANT_SHARE_IRQ" - IDS_DEV_FAILED_ADD "CM_PROB_FAILED_ADD" - IDS_DEV_DISABLED_SERVICE "CM_PROB_DISABLED_SERVICE" - IDS_DEV_TRANSLATION_FAILED "CM_PROB_TRANSLATION_FAILED" - IDS_DEV_NO_SOFTCONFIG "CM_PROB_NO_SOFTCONFIG" - IDS_DEV_BIOS_TABLE "CM_PROB_BIOS_TABLE" - IDS_DEV_IRQ_TRANSLATION_FAILED "CM_PROB_IRQ_TRANSLATION_FAILED" - IDS_DEV_FAILED_DRIVER_ENTRY "CM_PROB_FAILED_DRIVER_ENTRY" - IDS_DEV_DRIVER_FAILED_PRIOR_UNLOAD "CM_PROB_DRIVER_FAILED_PRIOR_UNLOAD" - IDS_DEV_DRIVER_FAILED_LOAD "CM_PROB_DRIVER_FAILED_LOAD" - IDS_DEV_DRIVER_SERVICE_KEY_INVALID "CM_PROB_DRIVER_SERVICE_KEY_INVALID" - IDS_DEV_LEGACY_SERVICE_NO_DEVICES "CM_PROB_LEGACY_SERVICE_NO_DEVICES" - IDS_DEV_DUPLICATE_DEVICE "CM_PROB_DUPLICATE_DEVICE" - IDS_DEV_FAILED_POST_START "CM_PROB_FAILED_POST_START" - IDS_DEV_HALTED "CM_PROB_HALTED" - IDS_DEV_PHANTOM "CM_PROB_PHANTOM" - IDS_DEV_SYSTEM_SHUTDOWN "CM_PROB_SYSTEM_SHUTDOWN" - IDS_DEV_HELD_FOR_EJECT "CM_PROB_HELD_FOR_EJECT" - IDS_DEV_DRIVER_BLOCKED "CM_PROB_DRIVER_BLOCKED" - IDS_DEV_REGISTRY_TOO_LARGE "CM_PROB_REGISTRY_TOO_LARGE" - IDS_DEV_SETPROPERTIES_FAILED "CM_PROB_SETPROPERTIES_FAILED" + IDS_DEV_NOT_CONFIGURED "This device is not configured correctly." + IDS_DEV_DEVLOADER_FAILED "ReactOS could not load the driver for this device because the computer is reporting two $1 bus types." + IDS_DEV_DEVLOADER_FAILED2 "The $1 device loader(s) for this device could not load the device driver." + IDS_DEV_OUT_OF_MEMORY "The driver for this device may be bad, or your system may be running low on memory or other resources." + IDS_DEV_ENTRY_IS_WRONG_TYPE "This device is not working properly because one of its drivers may be bad, or your registry may be bad." + IDS_DEV_LACKED_ARBITRATOR "The driver for this device requested a resource that ReactOS does not know how to handle." + IDS_DEV_BOOT_CONFIG_CONFLICT "Another device is using the resources this device needs." + IDS_DEV_FAILED_FILTER "The drivers for this device need to be reinstalled." + IDS_DEV_DEVLOADER_NOT_FOUND "This device is not working properly because ReactOS cannot load the file $1 that loads the drivers for the device." + IDS_DEV_DEVLOADER_NOT_FOUND2 "This device is not working properly because the file $1 that loads the drivers for this device is bad." + IDS_DEV_DEVLOADER_NOT_FOUND3 "Device failure: Try changing the driver for this device. If that doesn\'t work, see your hardware documentation." + IDS_DEV_INVALID_DATA "This device is not working properly because the BIOS in your computer is reporting the resources for the device incorrectly." + IDS_DEV_INVALID_DATA2 "This device is not working properly because the BIOS in the device is reporting the resources for the device incorrectly. " + IDS_DEV_FAILED_START "This device is either not present, not working properly, or does not have all the drivers installed." + IDS_DEV_LIAR "ReactOS stopped responding while attempting to start this device, and therefore will never attempt to start this device again." + IDS_DEV_NORMAL_CONFLICT "This device cannot find any free $1 resources to use." + IDS_DEV_NOT_VERIFIED "This device is either not present, not working properly, or does not have all the drivers installed." + IDS_DEV_NEED_RESTART "This device cannot work properly until you restart your computer." + IDS_DEV_REENUMERATION "This device is causing a resource conflict." + IDS_DEV_PARTIAL_LOG_CONF "Windows could not identify all the resources this device uses." + IDS_DEV_UNKNOWN_RESOURCE "The driver information file $1 is telling this child device to use a resource that the parent device does not have or recognize." + IDS_DEV_REINSTALL "The drivers for this device need to be reinstalled." + IDS_DEV_REGISTRY "Your registry may be bad." + IDS_DEV_WILL_BE_REMOVED "ReactOS is removing this device." + IDS_DEV_DISABLED "This device is not started." + IDS_DEV_DISABLED2 "This device is disabled." + IDS_DEV_DEVLOADER_NOT_READY "The loaders for this device cannot load the required drivers." + IDS_DEV_DEVLOADER_NOT_READY2 "This display adapter is functioning correctly." + IDS_DEV_DEVLOADER_NOT_READY3 "The loaders for this device cannot load the required drivers." + IDS_DEV_DEVICE_NOT_THERE "This device is either not present, not working properly, or does not have all the drivers installed." + IDS_DEV_MOVED "ReactOS is in the process of setting up this device." + IDS_DEV_TOO_EARLY "ReactOS is in the process of setting up this device." + IDS_DEV_NO_VALID_LOG_CONF "ReactOS can\'t specify the resources for this device." + IDS_DEV_FAILED_INSTALL "The drivers for this device are not installed." + IDS_DEV_HARDWARE_DISABLED "This device is disabled because the BIOS for the device did not give it any resources." + IDS_DEV_CANT_SHARE_IRQ "This device is using an Interrupt Request (IRQ) resource that is in use by another device and cannot be shared. "\ + "You must change the conflicting setting or remove the real-mode driver causing the conflict." + IDS_DEV_FAILED_ADD "This device is not working properly because $1 is not working properly." + IDS_DEV_DISABLED_SERVICE "ReactOS cannot install the drivers for this device because it cannot access the drive or network location that has the setup files on it." + IDS_DEV_TRANSLATION_FAILED "This device isn\'t responding to its driver." + IDS_DEV_NO_SOFTCONFIG "ReactOS cannot determine the settings for this device. Consult the documentation that came with this device and use the Resource tab to set the configuration." + IDS_DEV_BIOS_TABLE "Your computer\'s system firmware does not include enough information to properly configure and use this device. "\ + "To use this device, contact your computer manufacturer to obtain a firmware or BIOS update." + IDS_DEV_IRQ_TRANSLATION_FAILED "This device is requesting a PCI interrupt but is configured for an ISA interrupt (or vice versa). "\ + "Please use the computer\'s system setup program to reconfigure the interrupt for this device." + IDS_DEV_FAILED_DRIVER_ENTRY "ReactOS cannot initialize the device driver for this hardware." + IDS_DEV_DRIVER_FAILED_PRIOR_UNLOAD "ReactOS cannot load the device driver for this hardware because a previous instance of the device driver is still in memory." + IDS_DEV_DRIVER_FAILED_LOAD "ReactOS cannot load the device driver for this hardware. The driver may be corrupted or missing." + IDS_DEV_DRIVER_SERVICE_KEY_INVALID "ReactOS cannot access this hardware because its service key information in the registry is missing or recorded incorrectly." + IDS_DEV_LEGACY_SERVICE_NO_DEVICES "ReactOS successfully loaded the device driver for this hardware but cannot find the hardware device." + IDS_DEV_DUPLICATE_DEVICE "ReactOS cannot load the device driver for this hardware because there is a duplicate device already running in the system." + IDS_DEV_FAILED_POST_START "ReactOS has stopped this device because it has reported problems." + IDS_DEV_HALTED "An application or service has shut down this hardware device." + IDS_DEV_PHANTOM "Currently, this hardware device is not connected to the computer." + IDS_DEV_SYSTEM_SHUTDOWN "ReactOS cannot gain access to this hardware device because the operating system is in the process of shutting down." + IDS_DEV_HELD_FOR_EJECT "ReactOS cannot use this hardware device because it has been prepared for \"safe removal\", but it has not been removed from the computer" + IDS_DEV_DRIVER_BLOCKED "The software for this device has been blocked from starting because it is known to have problems with ReactOS. Contact the hardware vendor for a new driver." + IDS_DEV_REGISTRY_TOO_LARGE "ReactOS cannot start new hardware devices because the system hive is too large (exceeds the Registry Size Limit)." + IDS_DEV_SETPROPERTIES_FAILED "ReactOS wasn\'t able to change the settings of this device." END IDD_HARDWARE DIALOG DISCARDABLE 0, 0, 300, 400 diff --git a/reactos/lib/devmgr/advprop.c b/reactos/lib/devmgr/advprop.c index fa5dbe039bf..ee46873ce2d 100644 --- a/reactos/lib/devmgr/advprop.c +++ b/reactos/lib/devmgr/advprop.c @@ -166,7 +166,7 @@ ApplyGeneralSettings(IN HWND hwndDlg, { BOOL Ret = FALSE; - if (dap->DeviceUsageChanged && dap->IsAdmin) + if (dap->DeviceUsageChanged && dap->IsAdmin && dap->CanDisable) { UINT SelectedUsageAction; BOOL NeedReboot = FALSE; @@ -237,7 +237,7 @@ UpdateDevInfo(IN HWND hwndDlg, CONFIGRET cr; ULONG Status, ProblemNumber; UINT TroubleShootStrId = IDS_TROUBLESHOOTDEV; - BOOL bFlag; + BOOL bFlag, bDevActionAvailable = TRUE; DWORD i; HDEVINFO DeviceInfoSet = NULL; PSP_DEVINFO_DATA DeviceInfoData = NULL; @@ -478,8 +478,6 @@ GetParentNode: /* set the device troubleshoot button text and disable it if necessary */ hDevProbBtn = GetDlgItem(hwndDlg, IDC_DEVPROBLEM); - EnableWindow(hDevProbBtn, - dap->IsAdmin); cr = CM_Get_DevNode_Status_Ex(&Status, &ProblemNumber, DeviceInfoData->DevInst, @@ -489,12 +487,105 @@ GetParentNode: { switch (ProblemNumber) { - case CM_PROB_DISABLED: - TroubleShootStrId = IDS_ENABLEDEV; + case CM_PROB_DEVLOADER_FAILED: + { + /* FIXME - only if it's not a root bus devloader, + disable the button otherwise */ + TroubleShootStrId = IDS_UPDATEDRV; + break; + } + + case CM_PROB_OUT_OF_MEMORY: + case CM_PROB_ENTRY_IS_WRONG_TYPE: + case CM_PROB_LACKED_ARBITRATOR: + case CM_PROB_FAILED_START: + case CM_PROB_LIAR: + case CM_PROB_UNKNOWN_RESOURCE: + { + TroubleShootStrId = IDS_UPDATEDRV; + break; + } + + case CM_PROB_BOOT_CONFIG_CONFLICT: + case CM_PROB_NORMAL_CONFLICT: + case CM_PROB_REENUMERATION: + { + /* FIXME - Troubleshoot conflict */ + break; + } + + case CM_PROB_FAILED_FILTER: + case CM_PROB_REINSTALL: + case CM_PROB_FAILED_INSTALL: + { + TroubleShootStrId = IDS_REINSTALLDRV; + break; + } + + case CM_PROB_DEVLOADER_NOT_FOUND: + { + /* FIXME - 4 cases: + 1) if it's a missing system devloader: + - disable the button (Reinstall Driver) + 2) if it's not a system devloader but still missing: + - Reinstall Driver + 3) if it's not a system devloader but the file can be found: + - Update Driver + 4) if it's a missing or empty software key + - Update Driver + */ + break; + } + + case CM_PROB_INVALID_DATA: + case CM_PROB_PARTIAL_LOG_CONF: + case CM_PROB_NO_VALID_LOG_CONF: + case CM_PROB_HARDWARE_DISABLED: + case CM_PROB_CANT_SHARE_IRQ: + case CM_PROB_TRANSLATION_FAILED: + case CM_PROB_SYSTEM_SHUTDOWN: + case CM_PROB_PHANTOM: + bDevActionAvailable = FALSE; break; - case CM_PROB_FAILED_INSTALL: - TroubleShootStrId = IDS_REINSTALLDRV; + case CM_PROB_NOT_VERIFIED: + case CM_PROB_DEVICE_NOT_THERE: + /* FIXME - search hardware */ + break; + + case CM_PROB_NEED_RESTART: + case CM_PROB_WILL_BE_REMOVED: + case CM_PROB_MOVED: + case CM_PROB_TOO_EARLY: + case CM_PROB_DISABLED_SERVICE: + TroubleShootStrId = IDS_REBOOT; + break; + + case CM_PROB_REGISTRY: + /* FIXME - check registry? */ + break; + + case CM_PROB_DISABLED: + /* if device was disabled by the user: */ + TroubleShootStrId = IDS_ENABLEDEV; + /* FIXME - otherwise disable button because the device was + disabled by the system*/ + break; + + case CM_PROB_DEVLOADER_NOT_READY: + /* FIXME - if it's a graphics adapter: + - if it's a a secondary adapter and the main adapter + couldn't be found + - disable button + - else + - Properties + - else + - Update driver + */ + break; + + case CM_PROB_FAILED_ADD: + TroubleShootStrId = IDS_PROPERTIES; break; } } @@ -507,6 +598,8 @@ GetParentNode: SetWindowText(hDevProbBtn, dap->szTemp); } + EnableWindow(hDevProbBtn, + dap->IsAdmin && bDevActionAvailable); /* check if the device can be enabled/disabled */ hDevUsage = GetDlgItem(hwndDlg, diff --git a/reactos/lib/devmgr/devprblm.c b/reactos/lib/devmgr/devprblm.c index a787c63aedf..c4ffcd85283 100644 --- a/reactos/lib/devmgr/devprblm.c +++ b/reactos/lib/devmgr/devprblm.c @@ -50,18 +50,123 @@ ShowDeviceProblemWizard(IN HWND hWndParent OPTIONAL, { switch (ProblemNumber) { - case CM_PROB_DISABLED: + case CM_PROB_DEVLOADER_FAILED: { - /* FIXME - display the "Enable Device" wizard */ + /* FIXME - only if it's not a root bus devloader */ + /* FIXME - display the update driver wizard */ break; } + case CM_PROB_OUT_OF_MEMORY: + case CM_PROB_ENTRY_IS_WRONG_TYPE: + case CM_PROB_LACKED_ARBITRATOR: + case CM_PROB_FAILED_START: + case CM_PROB_LIAR: + case CM_PROB_UNKNOWN_RESOURCE: + { + /* FIXME - display the update driver wizard */ + break; + } + + case CM_PROB_BOOT_CONFIG_CONFLICT: + case CM_PROB_NORMAL_CONFLICT: + case CM_PROB_REENUMERATION: + { + /* FIXME - display the conflict wizard */ + break; + } + + case CM_PROB_FAILED_FILTER: + case CM_PROB_REINSTALL: case CM_PROB_FAILED_INSTALL: { - /* FIXME - display the driver installation wizard */ + /* FIXME - display the driver (re)installation wizard */ break; } + case CM_PROB_DEVLOADER_NOT_FOUND: + { + /* FIXME - 4 cases: + 1) if it's a missing system devloader: + - fail + 2) if it's not a system devloader but still missing: + - display the driver reinstallation wizard + 3) if it's not a system devloader but the file can be found: + - display the update driver wizard + 4) if it's a missing or empty software key + - display the update driver wizard + */ + break; + } + + case CM_PROB_INVALID_DATA: + case CM_PROB_PARTIAL_LOG_CONF: + case CM_PROB_NO_VALID_LOG_CONF: + case CM_PROB_HARDWARE_DISABLED: + case CM_PROB_CANT_SHARE_IRQ: + case CM_PROB_TRANSLATION_FAILED: + case CM_PROB_SYSTEM_SHUTDOWN: + case CM_PROB_PHANTOM: + /* FIXME - do nothing */ + break; + + case CM_PROB_NOT_VERIFIED: + case CM_PROB_DEVICE_NOT_THERE: + /* FIXME - display search hardware wizard */ + break; + + case CM_PROB_NEED_RESTART: + case CM_PROB_WILL_BE_REMOVED: + case CM_PROB_MOVED: + case CM_PROB_TOO_EARLY: + case CM_PROB_DISABLED_SERVICE: + /* FIXME - reboot computer */ + break; + + case CM_PROB_REGISTRY: + /* FIXME - check registry */ + break; + + case CM_PROB_DISABLED: + { + /* FIXME - if device was disabled by user display the "Enable Device" wizard, + otherwise Troubleshoot because the device was disabled by the system */ + break; + } + + case CM_PROB_DEVLOADER_NOT_READY: + { + /* FIXME - if it's a graphics adapter: + - if it's a a secondary adapter and the main adapter + couldn't be found + - do nothing or default action + - else + - display the Properties + - else + - Update driver + */ + break; + } + + case CM_PROB_FAILED_ADD: + { + /* FIXME - display the properties of the sub-device */ + break; + } + + case CM_PROB_NO_SOFTCONFIG: + case CM_PROB_IRQ_TRANSLATION_FAILED: + case CM_PROB_FAILED_DRIVER_ENTRY: + case CM_PROB_DRIVER_FAILED_PRIOR_UNLOAD: + case CM_PROB_DRIVER_FAILED_LOAD: + case CM_PROB_DRIVER_SERVICE_KEY_INVALID: + case CM_PROB_LEGACY_SERVICE_NO_DEVICES: + case CM_PROB_DUPLICATE_DEVICE: + case CM_PROB_FAILED_POST_START: + case CM_PROB_HALTED: + case CM_PROB_HELD_FOR_EJECT: + case CM_PROB_DRIVER_BLOCKED: + case CM_PROB_REGISTRY_TOO_LARGE: default: { /* FIXME - troubleshoot the device */ diff --git a/reactos/lib/devmgr/misc.c b/reactos/lib/devmgr/misc.c index 274e8f766b7..c28238a1b03 100644 --- a/reactos/lib/devmgr/misc.c +++ b/reactos/lib/devmgr/misc.c @@ -404,6 +404,7 @@ GetDeviceLocationString(IN DEVINST dnDevInst OPTIONAL, static const UINT ProblemStringId[NUM_CM_PROB] = { IDS_DEV_NO_PROBLEM, + IDS_DEV_DEVLOADER_FAILED, IDS_DEV_NOT_CONFIGURED, IDS_DEV_OUT_OF_MEMORY, IDS_DEV_ENTRY_IS_WRONG_TYPE, @@ -452,7 +453,7 @@ static const UINT ProblemStringId[NUM_CM_PROB] = IDS_DEV_HELD_FOR_EJECT, IDS_DEV_DRIVER_BLOCKED, IDS_DEV_REGISTRY_TOO_LARGE, - IDS_DEV_SETPROPERTIES_FAILED, + IDS_DEV_SETPROPERTIES_FAILED }; @@ -486,18 +487,89 @@ GetDeviceStatusString(IN DEVINST DevInst, } else { - LPWSTR szProblem; + LPWSTR szProblem, szInfo = NULL; + DWORD dwRet; + BOOL AdvFormat = FALSE; UINT StringIDs[] = { MessageId, IDS_DEVCODE, }; - if (LoadAndFormatStringsCat(hDllInstance, - StringIDs, - sizeof(StringIDs) / sizeof(StringIDs[0]), - &szProblem, - ProblemNumber)) + switch (ProblemNumber) + { + case CM_PROB_DEVLOADER_FAILED: + { + /* FIXME - if not a root bus devloader then use IDS_DEV_DEVLOADER_FAILED2 */ + /* FIXME - get the type string (ie. ISAPNP, PCI or BIOS for root bus devloaders, + or FLOP, ESDI, SCSI, etc for others */ + AdvFormat = (szInfo != NULL); + break; + } + + case CM_PROB_DEVLOADER_NOT_FOUND: + { + /* FIXME - 4 cases: + 1) if it's a missing system devloader: + - get the system devloader name + 2) if it's not a system devloader but still missing: + - get the devloader name (file name?) + 3) if it's not a system devloader but the file can be found: + - use IDS_DEV_DEVLOADER_NOT_FOUND2 + 4) if it's a missing or empty software key + - use IDS_DEV_DEVLOADER_NOT_FOUND3 + - AdvFormat = FALSE! + */ + AdvFormat = (szInfo != NULL); + break; + } + + case CM_PROB_INVALID_DATA: + /* FIXME - if the device isn't enumerated by the BIOS/ACPI use IDS_DEV_INVALID_DATA2 */ + AdvFormat = FALSE; + break; + + case CM_PROB_NORMAL_CONFLICT: + /* FIXME - get resource type (IRQ, DMA, Memory or I/O) */ + AdvFormat = (szInfo != NULL); + break; + + case CM_PROB_UNKNOWN_RESOURCE: + /* FIXME - get the .inf file name */ + AdvFormat = (szInfo != NULL); + break; + + case CM_PROB_DISABLED: + /* FIXME - if the device was disabled by the system use IDS_DEV_DISABLED2 */ + break; + + case CM_PROB_FAILED_ADD: + /* FIXME - get the name of the sub-device with the error */ + AdvFormat = (szInfo != NULL); + break; + } + + if (AdvFormat) + { + StringIDs[1] = IDS_DEVCODE2; + dwRet = LoadAndFormatStringsCat(hDllInstance, + StringIDs, + sizeof(StringIDs) / sizeof(StringIDs[0]), + &szProblem, + szInfo, + ProblemNumber); + LocalFree((HLOCAL)szInfo); + } + else + { + dwRet = LoadAndFormatStringsCat(hDllInstance, + StringIDs, + sizeof(StringIDs) / sizeof(StringIDs[0]), + &szProblem, + ProblemNumber); + } + + if (dwRet != 0) { wcsncpy(szBuffer, szProblem, @@ -630,7 +702,7 @@ EnableDevice(IN HDEVINFO DeviceInfoSet, if (bEnable) { - /* try to enable/disable the device on the global profile */ + /* try to enable the device on the global profile */ pcp.StateChange = DICS_ENABLE; pcp.Scope = DICS_FLAG_GLOBAL; diff --git a/reactos/lib/devmgr/resource.h b/reactos/lib/devmgr/resource.h index a97e8f39fa0..c42a07d2c14 100644 --- a/reactos/lib/devmgr/resource.h +++ b/reactos/lib/devmgr/resource.h @@ -24,7 +24,6 @@ #define IDC_PROPERTIES 0x58A #define IDC_DEVUSAGELABEL 0x58B #define IDC_DEVPROBLEM 0x58C -#define IDS_REINSTALLDRV 0x58D #define IDS_NAME 0x100 #define IDS_TYPE 0x101 @@ -34,64 +33,76 @@ #define IDS_UNKNOWN 0x105 #define IDS_LOCATIONSTR 0x106 #define IDS_DEVCODE 0x107 -#define IDS_ENABLEDEVICE 0x108 -#define IDS_DISABLEDEVICE 0x109 -#define IDS_UNKNOWNDEVICE 0x10A -#define IDS_NODRIVERLOADED 0x10B -#define IDS_DEVONPARENT 0x10C -#define IDS_TROUBLESHOOTDEV 0x10D -#define IDS_ENABLEDEV 0x10E +#define IDS_DEVCODE2 0x108 +#define IDS_ENABLEDEVICE 0x109 +#define IDS_DISABLEDEVICE 0x10A +#define IDS_UNKNOWNDEVICE 0x10B +#define IDS_NODRIVERLOADED 0x10C +#define IDS_DEVONPARENT 0x10D +#define IDS_TROUBLESHOOTDEV 0x10E +#define IDS_ENABLEDEV 0x10F +#define IDS_PROPERTIES 0x110 +#define IDS_UPDATEDRV 0x111 +#define IDS_REINSTALLDRV 0x112 +#define IDS_REBOOT 0x113 #define IDS_DEV_NO_PROBLEM 0x200 #define IDS_DEV_NOT_CONFIGURED 0x201 #define IDS_DEV_DEVLOADER_FAILED 0x202 -#define IDS_DEV_OUT_OF_MEMORY 0x203 -#define IDS_DEV_ENTRY_IS_WRONG_TYPE 0x204 -#define IDS_DEV_LACKED_ARBITRATOR 0x205 -#define IDS_DEV_BOOT_CONFIG_CONFLICT 0x206 -#define IDS_DEV_FAILED_FILTER 0x207 -#define IDS_DEV_DEVLOADER_NOT_FOUND 0x208 -#define IDS_DEV_INVALID_DATA 0x209 -#define IDS_DEV_FAILED_START 0x20A -#define IDS_DEV_LIAR 0x20B -#define IDS_DEV_NORMAL_CONFLICT 0x20C -#define IDS_DEV_NOT_VERIFIED 0x20D -#define IDS_DEV_NEED_RESTART 0x20E -#define IDS_DEV_REENUMERATION 0x20F -#define IDS_DEV_PARTIAL_LOG_CONF 0x210 -#define IDS_DEV_UNKNOWN_RESOURCE 0x211 -#define IDS_DEV_REINSTALL 0x212 -#define IDS_DEV_REGISTRY 0x213 -#define IDS_DEV_WILL_BE_REMOVED 0x214 -#define IDS_DEV_DISABLED 0x215 -#define IDS_DEV_DEVLOADER_NOT_READY 0x216 -#define IDS_DEV_DEVICE_NOT_THERE 0x217 -#define IDS_DEV_MOVED 0x218 -#define IDS_DEV_TOO_EARLY 0x219 -#define IDS_DEV_NO_VALID_LOG_CONF 0x21A -#define IDS_DEV_FAILED_INSTALL 0x21B -#define IDS_DEV_HARDWARE_DISABLED 0x21C -#define IDS_DEV_CANT_SHARE_IRQ 0x21D -#define IDS_DEV_FAILED_ADD 0x21E -#define IDS_DEV_DISABLED_SERVICE 0x21F -#define IDS_DEV_TRANSLATION_FAILED 0x220 -#define IDS_DEV_NO_SOFTCONFIG 0x221 -#define IDS_DEV_BIOS_TABLE 0x222 -#define IDS_DEV_IRQ_TRANSLATION_FAILED 0x223 -#define IDS_DEV_FAILED_DRIVER_ENTRY 0x224 -#define IDS_DEV_DRIVER_FAILED_PRIOR_UNLOAD 0x225 -#define IDS_DEV_DRIVER_FAILED_LOAD 0x226 -#define IDS_DEV_DRIVER_SERVICE_KEY_INVALID 0x227 -#define IDS_DEV_LEGACY_SERVICE_NO_DEVICES 0x228 -#define IDS_DEV_DUPLICATE_DEVICE 0x229 -#define IDS_DEV_FAILED_POST_START 0x22A -#define IDS_DEV_HALTED 0x22B -#define IDS_DEV_PHANTOM 0x22C -#define IDS_DEV_SYSTEM_SHUTDOWN 0x22D -#define IDS_DEV_HELD_FOR_EJECT 0x22E -#define IDS_DEV_DRIVER_BLOCKED 0x22F -#define IDS_DEV_REGISTRY_TOO_LARGE 0x230 -#define IDS_DEV_SETPROPERTIES_FAILED 0x231 +#define IDS_DEV_DEVLOADER_FAILED2 0x203 +#define IDS_DEV_OUT_OF_MEMORY 0x204 +#define IDS_DEV_ENTRY_IS_WRONG_TYPE 0x205 +#define IDS_DEV_LACKED_ARBITRATOR 0x206 +#define IDS_DEV_BOOT_CONFIG_CONFLICT 0x207 +#define IDS_DEV_FAILED_FILTER 0x208 +#define IDS_DEV_DEVLOADER_NOT_FOUND 0x209 +#define IDS_DEV_DEVLOADER_NOT_FOUND2 0x20A +#define IDS_DEV_DEVLOADER_NOT_FOUND3 0x20B +#define IDS_DEV_INVALID_DATA 0x20C +#define IDS_DEV_INVALID_DATA2 0x20D +#define IDS_DEV_FAILED_START 0x20E +#define IDS_DEV_LIAR 0x20F +#define IDS_DEV_NORMAL_CONFLICT 0x210 +#define IDS_DEV_NOT_VERIFIED 0x211 +#define IDS_DEV_NEED_RESTART 0x212 +#define IDS_DEV_REENUMERATION 0x213 +#define IDS_DEV_PARTIAL_LOG_CONF 0x214 +#define IDS_DEV_UNKNOWN_RESOURCE 0x215 +#define IDS_DEV_REINSTALL 0x216 +#define IDS_DEV_REGISTRY 0x217 +#define IDS_DEV_WILL_BE_REMOVED 0x218 +#define IDS_DEV_DISABLED 0x219 +#define IDS_DEV_DISABLED2 0x21A +#define IDS_DEV_DEVLOADER_NOT_READY 0x21B +#define IDS_DEV_DEVLOADER_NOT_READY2 0x21C +#define IDS_DEV_DEVLOADER_NOT_READY3 0x21D +#define IDS_DEV_DEVICE_NOT_THERE 0x21E +#define IDS_DEV_MOVED 0x21F +#define IDS_DEV_TOO_EARLY 0x220 +#define IDS_DEV_NO_VALID_LOG_CONF 0x221 +#define IDS_DEV_FAILED_INSTALL 0x222 +#define IDS_DEV_HARDWARE_DISABLED 0x223 +#define IDS_DEV_CANT_SHARE_IRQ 0x224 +#define IDS_DEV_FAILED_ADD 0x225 +#define IDS_DEV_DISABLED_SERVICE 0x226 +#define IDS_DEV_TRANSLATION_FAILED 0x227 +#define IDS_DEV_NO_SOFTCONFIG 0x228 +#define IDS_DEV_BIOS_TABLE 0x229 +#define IDS_DEV_IRQ_TRANSLATION_FAILED 0x22A +#define IDS_DEV_FAILED_DRIVER_ENTRY 0x22B +#define IDS_DEV_DRIVER_FAILED_PRIOR_UNLOAD 0x22C +#define IDS_DEV_DRIVER_FAILED_LOAD 0x22D +#define IDS_DEV_DRIVER_SERVICE_KEY_INVALID 0x22E +#define IDS_DEV_LEGACY_SERVICE_NO_DEVICES 0x22F +#define IDS_DEV_DUPLICATE_DEVICE 0x230 +#define IDS_DEV_FAILED_POST_START 0x231 +#define IDS_DEV_HALTED 0x232 +#define IDS_DEV_PHANTOM 0x233 +#define IDS_DEV_SYSTEM_SHUTDOWN 0x234 +#define IDS_DEV_HELD_FOR_EJECT 0x235 +#define IDS_DEV_DRIVER_BLOCKED 0x236 +#define IDS_DEV_REGISTRY_TOO_LARGE 0x237 +#define IDS_DEV_SETPROPERTIES_FAILED 0x238 #endif /* __DEVMGR_RESOURCE_H */