[prev in list] [next in list] [prev in thread] [next in thread]
List: ros-diffs
Subject: [ros-diffs] [gvg] 19790: Make GetProcessWindowStation work for CSRSS
From: <gvg () svn ! reactos ! com>
Date: 2005-11-30 23:24:23
Message-ID: 000001c5f605$32dfe310$6b01a8c0 () PENELOPE
[Download RAW message or body]
Make GetProcessWindowStation work for CSRSS
Modified: trunk/reactos/subsys/win32k/ntuser/winsta.c
Modified: trunk/reactos/w32api/include/winuser.h
_____
Modified: trunk/reactos/subsys/win32k/ntuser/winsta.c
--- trunk/reactos/subsys/win32k/ntuser/winsta.c 2005-11-30 22:44:41 UTC
(rev 19789)
+++ trunk/reactos/subsys/win32k/ntuser/winsta.c 2005-11-30 23:24:19 UTC
(rev 19790)
@@ -915,17 +915,31 @@
HWINSTA FASTCALL
UserGetProcessWindowStation(VOID)
{
+ NTSTATUS Status;
+ HWINSTA WinSta;
+
if(PsGetCurrentProcess() != CsrProcess)
{
return PsGetCurrentProcess()->Win32WindowStation;
}
else
{
- /* FIXME - get the pointer to the window station by querying the
parent of
- the desktop of the calling thread (which is a window
station),
- then use ObFindHandleForObject() to find a suitable
handle */
- DPRINT1("CSRSS called NtUserGetProcessWindowStation()!!! returned
NULL!\n");
- return NULL;
+ DPRINT1("Should use ObFindHandleForObject\n");
+ Status =
ObOpenObjectByPointer(PsGetWin32Thread()->Desktop->WindowStation,
+ 0,
+ NULL,
+ WINSTA_ALL_ACCESS,
+ ExWindowStationObjectType,
+ UserMode,
+ (PHANDLE) &WinSta);
+ if (! NT_SUCCESS(Status))
+ {
+ SetLastNtError(Status);
+ DPRINT1("Unable to open handle for CSRSSs winsta, status
0x%08x\n",
+ Status);
+ return NULL;
+ }
+ return WinSta;
}
}
_____
Modified: trunk/reactos/w32api/include/winuser.h
--- trunk/reactos/w32api/include/winuser.h 2005-11-30 22:44:41 UTC
(rev 19789)
+++ trunk/reactos/w32api/include/winuser.h 2005-11-30 23:24:19 UTC
(rev 19790)
@@ -380,6 +380,7 @@
#define WINSTA_READATTRIBUTES 2
#define WINSTA_READSCREEN 512
#define WINSTA_WRITEATTRIBUTES 16
+#define WINSTA_ALL_ACCESS 895
#define DDL_READWRITE 0
#define DDL_READONLY 1
#define DDL_HIDDEN 2
[Attachment #3 (text/html)]
<html>
<head>
<style>
<!--
body { background-color:#ffffff }
.file { border:1px solid #eeeeee; margin-top:1em; margin-bottom:1em }
.pathname { font-family:monospace; float:right }
.fileheader { margin-bottom:.5em }
.diff { margin:0 }
.tasklist { padding:4px; border:1px dashed #000000; margin-top:1em }
.tasklist ul { margin-top:0; margin-bottom:0 }
tr.alt { background-color:#eeeeee }
#added { background-color:#ddffdd }
#addedchars { background-color:#99ff99; font-weight:bolder }
tr.alt #added { background-color:#ccf7cc }
#removed { background-color:#ffdddd }
#removedchars { background-color:#ff9999; font-weight:bolder }
tr.alt #removed { background-color:#f7cccc }
#info { color:#888888 }
#context { background-color:#eeeeee }
td {padding-left:.3em; padding-right:.3em }
tr.head { border-bottom-width:1px; border-bottom-style:solid }
tr.head td { padding:0; padding-top:.2em }
.task { background-color:#ffff00 }
.comment { padding:4px; border:1px dashed #000000; background-color:#ffffdd }
.error { color:red }
hr { border-width:0px; height:2px; background:black }
-->
</style>
</head>
<body>
<pre class="comment">Make GetProcessWindowStation work for CSRSS</pre><pre \
class="diff" id="context">Modified: \
trunk/reactos/subsys/win32k/ntuser/winsta.c
Modified: trunk/reactos/w32api/include/winuser.h
</pre><hr /><div class="file">
<div class="fileheader"><big><b>Modified: \
trunk/reactos/subsys/win32k/ntuser/winsta.c</b></big></div> <pre class="diff"><small \
id="info">--- trunk/reactos/subsys/win32k/ntuser/winsta.c 2005-11-30 22:44:41 UTC \
(rev 19789)
+++ trunk/reactos/subsys/win32k/ntuser/winsta.c 2005-11-30 23:24:19 UTC (rev 19790)
@@ -915,17 +915,31 @@
</small></pre><pre class="diff" id="context"> HWINSTA FASTCALL
UserGetProcessWindowStation(VOID)
{
</pre><pre class="diff" id="added">+ NTSTATUS Status;
+ HWINSTA WinSta;
+
</pre><pre class="diff" id="context"> if(PsGetCurrentProcess() != \
CsrProcess) {
return PsGetCurrentProcess()->Win32WindowStation;
}
else
{
</pre><pre class="diff" id="removed">- /* FIXME - get the pointer \
to the window station by querying the parent of
- the desktop of the calling \
thread (which is a window station),
- then use \
ObFindHandleForObject() to find a suitable handle */
- DPRINT1("CSRSS called NtUserGetProcessWindowStation()!!! \
returned NULL!\n");
- <span id="removedchars">return NULL</span>;
</pre><pre class="diff" id="added">+ <span \
id="addedchars">DPRINT1("Should use ObFindHandleForObject\n")</span>; + \
Status = \
ObOpenObjectByPointer(PsGetWin32Thread()->Desktop->WindowStation, + \
\
0, + \
\
NULL, + \
WINSTA_ALL_ACCESS, + \
\
ExWindowStationObjectType, + \
\
UserMode, + \
(PHANDLE) \
&WinSta); + if (! NT_SUCCESS(Status))
+ {
+ SetLastNtError(Status);
+ DPRINT1("Unable to open handle for CSRSSs winsta, \
status 0x%08x\n", + \
Status); + return NULL;
+ }
+ return WinSta;
</pre><pre class="diff" id="context"> }
}
</pre></div>
<hr /><div class="file">
<div class="fileheader"><big><b>Modified: \
trunk/reactos/w32api/include/winuser.h</b></big></div> <pre class="diff"><small \
id="info">--- trunk/reactos/w32api/include/winuser.h 2005-11-30 22:44:41 UTC (rev \
19789)
+++ trunk/reactos/w32api/include/winuser.h 2005-11-30 23:24:19 UTC (rev 19790)
@@ -380,6 +380,7 @@
</small></pre><pre class="diff" id="context"> #define WINSTA_READATTRIBUTES 2
#define WINSTA_READSCREEN 512
#define WINSTA_WRITEATTRIBUTES 16
</pre><pre class="diff" id="added">+#define WINSTA_ALL_ACCESS \
895 </pre><pre class="diff" id="context"> #define DDL_READWRITE 0
#define DDL_READONLY 1
#define DDL_HIDDEN 2
</pre>
</div>
</body>
</html>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic