From b6ebd50d3f75e61f098b08b7fd23841c642c267c Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sun, 29 Apr 2018 15:41:03 +0200 Subject: [PATCH] [SYSSETUP] Close the device key after the property sheet page has been released. --- dll/win32/syssetup/proppage.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dll/win32/syssetup/proppage.c b/dll/win32/syssetup/proppage.c index 4072b224fda..0c1fcb08d1c 100644 --- a/dll/win32/syssetup/proppage.c +++ b/dll/win32/syssetup/proppage.c @@ -490,9 +490,15 @@ MouseCallback( UINT uMsg, LPPROPSHEETPAGE ppsp) { + PMOUSE_INFO pMouseInfo; + + pMouseInfo = (PMOUSE_INFO)ppsp->lParam; + if (uMsg == PSPCB_RELEASE) { - HeapFree(GetProcessHeap(), 0, (PMOUSE_INFO)ppsp->lParam); + if (pMouseInfo->hDeviceKey != NULL) + RegCloseKey(pMouseInfo->hDeviceKey); + HeapFree(GetProcessHeap(), 0, pMouseInfo); } return 1;