[SYSSETUP] Close the device key after the property sheet page has been released.
authorEric Kohl <eric.kohl@reactos.org>
Sun, 29 Apr 2018 13:41:03 +0000 (15:41 +0200)
committerEric Kohl <eric.kohl@reactos.org>
Sun, 29 Apr 2018 13:41:38 +0000 (15:41 +0200)
dll/win32/syssetup/proppage.c

index 4072b22..0c1fcb0 100644 (file)
@@ -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;