From 938d30d487444552cc31aeb6fd01e4398981f27a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 16 Dec 2012 14:01:32 +0000 Subject: [PATCH] [WIN32K] Fix BSOD when starting ReactOS in Safe Mode : NEVER dereference a NULL pointer in a DPRINT or you are dead !! (here, the possible NULL pointer is GetW32ProcessInfo()->prpwinsta). More precisely, you obtain: prpwinsta != InputWindowStation) \ + if (GetW32ProcessInfo()->prpwinsta) \ { \ - ERR("NtUserSystemParametersInfo requires interactive window station (current is %wZ)\n", &GetW32ProcessInfo()->prpwinsta->Name); \ + if (GetW32ProcessInfo()->prpwinsta != InputWindowStation) \ + { \ + ERR("NtUserSystemParametersInfo requires interactive window station (current is %wZ)\n", &GetW32ProcessInfo()->prpwinsta->Name); \ + EngSetLastError(err); \ + return 0; \ + } \ + } \ + else \ + { \ + ERR("NtUserSystemParametersInfo called without active window station, and it requires an interactive one.\n"); \ EngSetLastError(err); \ return 0; \ } @@ -1568,7 +1577,7 @@ UserSystemParametersInfo( /* Get a pointer to the current Windowstation */ if (!ppi->prpwinsta) { - ERR("UserSystemParametersInfo called without active windowstation.\n"); + ERR("UserSystemParametersInfo called without active window station.\n"); //ASSERT(FALSE); //return FALSE; }