Commit 2eb2865
committed
[WIN32SS:NTUSER] Improve initialization of window station and desktop objects
As soon as `ObCreateObject()` is successfully invoked, zero-out the winsta
and desktop object buffers and assign them the current process session ID
(into their first `dwSessionId` member). Only then, continue with regular
initialization.
It's done in this systematic way in order to ensure that, in case the
regular initialization of these objects fails and `ObDereferenceObject()`
is invoked, the `nt!ExpWin32SessionCallout()` routine (in `ntoskrnl/ex/win32k.c`)
that is executed as part of the Win32 "delete" object callback registered
by win32k.sys with the Object Manager, correctly finds a valid initialized
`SessionId` value in the "common header" of either the window station
or the desktop object being deleted.
As a side-result, other parts of win32k can directly refer to
`pdesk->dwSessionId` instead of `pdesk->rpwinstaParent->dwSessionId`
for a given desktop.1 parent 1968202 commit 2eb2865
3 files changed
Lines changed: 14 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
147 | 153 | | |
148 | 154 | | |
149 | 155 | | |
| |||
2278 | 2284 | | |
2279 | 2285 | | |
2280 | 2286 | | |
2281 | | - | |
2282 | | - | |
2283 | 2287 | | |
2284 | 2288 | | |
2285 | 2289 | | |
| |||
2488 | 2492 | | |
2489 | 2493 | | |
2490 | 2494 | | |
2491 | | - | |
2492 | | - | |
| 2495 | + | |
2493 | 2496 | | |
2494 | 2497 | | |
2495 | 2498 | | |
| |||
2982 | 2985 | | |
2983 | 2986 | | |
2984 | 2987 | | |
2985 | | - | |
| 2988 | + | |
2986 | 2989 | | |
2987 | 2990 | | |
2988 | 2991 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
324 | | - | |
| 324 | + | |
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
504 | 504 | | |
505 | 505 | | |
506 | 506 | | |
507 | | - | |
508 | | - | |
509 | 507 | | |
510 | 508 | | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
511 | 513 | | |
512 | | - | |
513 | 514 | | |
514 | 515 | | |
515 | 516 | | |
| |||
0 commit comments