[iso] enable extra libcdio debugging with Alt-.

* Also fix 2 memory leaks
This commit is contained in:
Pete Batard 2020-05-12 14:13:44 +01:00
parent bcca9144b7
commit 4bf69215bf
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
4 changed files with 11 additions and 14 deletions

View file

@ -47,6 +47,7 @@
#include "drive.h"
#include "settings.h"
#include "bled/bled.h"
#include "cdio/logging.h"
#include "../res/grub/grub_version.h"
#include "../res/grub2/grub2_version.h"
@ -3105,6 +3106,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
use_fake_units = !ReadSettingBool(SETTING_USE_PROPER_SIZE_UNITS);
use_vds = ReadSettingBool(SETTING_USE_VDS);
usb_debug = ReadSettingBool(SETTING_ENABLE_USB_DEBUG);
cdio_loglevel_default = usb_debug ? CDIO_LOG_DEBUG : CDIO_LOG_WARN;
detect_fakes = !ReadSettingBool(SETTING_DISABLE_FAKE_DRIVES_CHECK);
allow_dual_uefi_bios = ReadSettingBool(SETTING_ENABLE_WIN_DUAL_EFI_BIOS);
force_large_fat32 = ReadSettingBool(SETTING_FORCE_LARGE_FAT32_FORMAT);
@ -3333,6 +3335,7 @@ relaunch:
// Alt-. => Enable USB enumeration debug
if ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == VK_OEM_PERIOD)) {
usb_debug = !usb_debug;
cdio_loglevel_default = usb_debug ? CDIO_LOG_DEBUG : CDIO_LOG_WARN;
WriteSettingBool(SETTING_ENABLE_USB_DEBUG, usb_debug);
PrintStatusTimeout(lmprintf(MSG_270), usb_debug);
GetDevices(0);