Ensure success
Modified: trunk/reactos/subsys/win32k/ntuser/csr.c
_____
Modified: trunk/reactos/subsys/win32k/ntuser/csr.c
--- trunk/reactos/subsys/win32k/ntuser/csr.c 2005-05-19 23:26:56 UTC
(rev 15416)
+++ trunk/reactos/subsys/win32k/ntuser/csr.c 2005-05-20 00:17:35 UTC
(rev 15417)
@@ -104,17 +104,20 @@
&ObjectAttributes,
&Cid);
- /* Duplicate the Handle */
- Status = ZwDuplicateObject(NtCurrentProcess(),
- ObjectHandle,
- CsrProcessHandle,
- Handle,
- DesiredAccess,
- TRUE,
- 0);
+ if ((NT_SUCCESS(Status)))
+ {
+ /* Duplicate the Handle */
+ Status = ZwDuplicateObject(NtCurrentProcess(),
+ ObjectHandle,
+ CsrProcessHandle,
+ Handle,
+ DesiredAccess,
+ TRUE,
+ 0);
- /* Close our handle to CSRSS */
- NtClose(CsrProcessHandle);
+ /* Close our handle to CSRSS */
+ ZwClose(CsrProcessHandle);
+ }
return Status;
}