Author: tkreuzer
Date: Tue Mar 4 01:22:07 2008
New Revision: 32555
URL:
http://svn.reactos.org/svn/reactos?rev=3D32555&view=3Drev
Log:
call PsGetCurrentThreadWin32Thread() and PsGetCurrentProcess() only once
Modified:
trunk/reactos/subsystems/win32/win32k/ntuser/winsta.c
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/winsta.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win3=
2k/ntuser/winsta.c?rev=3D32555&r1=3D32554&r2=3D32555&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/reactos/subsystems/win32/win32k/ntuser/winsta.c (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/winsta.c Tue Mar 4 01:22:=
07 2008
@@ -965,19 +965,22 @@
IntGetWinStaObj(VOID)
{
PWINSTATION_OBJECT WinStaObj;
+ PW32THREAD Win32Thread;
+ PEPROCESS CurrentProcess;
=
/*
* just a temporary hack, this will be gone soon
*/
=
- if(PsGetCurrentThreadWin32Thread() !=3D NULL && PsGetCurrentThreadWin32=
Thread()->Desktop !=3D NULL)
- {
- WinStaObj =3D PsGetCurrentThreadWin32Thread()->Desktop->WindowStatio=
n;
+ Win32Thread =3D PsGetCurrentThreadWin32Thread();
+ if(Win32Thread !=3D NULL && Win32Thread->Desktop !=3D NULL)
+ {
+ WinStaObj =3D Win32Thread->Desktop->WindowStation;
ObReferenceObjectByPointer(WinStaObj, KernelMode, ExWindowStationObj=
ectType, 0);
}
- else if(PsGetCurrentProcess() !=3D CsrProcess)
- {
- NTSTATUS Status =3D IntValidateWindowStationHandle(PsGetCurrentProce=
ss()->Win32WindowStation,
+ else if((CurrentProcess =3D PsGetCurrentProcess()) !=3D CsrProcess)
+ {
+ NTSTATUS Status =3D IntValidateWindowStationHandle(CurrentProcess->W=
in32WindowStation,
KernelMode,
0,
&WinStaObj);