summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
41b928c)
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:
<NTOSKRNL.EXE:112296 (ReactOS/ntoskrnl/ke/i386/traphdlr.c:1246 (@KiTrap0EHandler@4))>
<NTOSKRNL.EXE:110154 (ReactOS/ntoskrnl/ke/i386/trap.s:0 (_KiTrap0E))>
<NTOSKRNL.EXE:142926 (ReactOS/lib/sdk/crt/printf/streamout.c:644 (streamout))>
<NTOSKRNL.EXE:140631 (ReactOS/lib/sdk/crt/printf/_sxprintf.c:61 (_vsnprintf))>
<NTOSKRNL.EXE:12736a (ReactOS/lib/rtl/debug.c:85 (vDbgPrintExWithPrefixInternal@24))>
<NTOSKRNL.EXE:12751c (ReactOS/lib/rtl/debug.c:209 (DbgPrint))>
<win32k.sys:55034 (ReactOS/win32ss/user/ntuser/sysparams.c:451 (SpiGet))>
<win32k.sys:56bc7 (ReactOS/win32ss/user/ntuser/sysparams.c:963 (@UserSystemParametersInfo@16)
svn path=/trunk/; revision=57923
#define METRIC2REG(met) (-((((met) * 1440)- 0) / dpi))
#define REQ_INTERACTIVE_WINSTA(err) \
#define METRIC2REG(met) (-((((met) * 1440)- 0) / dpi))
#define REQ_INTERACTIVE_WINSTA(err) \
- if ( GetW32ProcessInfo()->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; \
}
EngSetLastError(err); \
return 0; \
}
/* Get a pointer to the current Windowstation */
if (!ppi->prpwinsta)
{
/* 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;
}
//ASSERT(FALSE);
//return FALSE;
}