-/*
+/* $Id: handle.c,v 1.6 2002/05/07 22:24:52 hbirr Exp $
+ *
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib/kernel32/misc/handle.c
#define NDEBUG
#include <kernel32/kernel32.h>
+#include <kernel32/error.h>
/* FUNCTIONS *****************************************************************/
&BytesWritten);
if (!NT_SUCCESS(errCode))
{
- SetLastError(RtlNtStatusToDosError(errCode));
+ SetLastErrorByStatus (errCode);
return FALSE;
}
if ( HandleInfo.bInheritHandle )
&BytesWritten);
if (!NT_SUCCESS(errCode))
{
- SetLastError(RtlNtStatusToDosError(errCode));
+ SetLastErrorByStatus (errCode);
return FALSE;
}
if (dwMask & HANDLE_FLAG_INHERIT)
sizeof(OBJECT_DATA_INFORMATION));
if (!NT_SUCCESS(errCode))
{
- SetLastError(RtlNtStatusToDosError(errCode));
+ SetLastErrorByStatus (errCode);
return FALSE;
}
errCode = NtClose(hObject);
if (!NT_SUCCESS(errCode))
{
- SetLastError(RtlNtStatusToDosError(errCode));
+ SetLastErrorByStatus (errCode);
return FALSE;
}
DWORD dwOptions)
{
NTSTATUS errCode;
-
+ if (IsConsoleHandle(hSourceHandle))
+ {
+ /* FIXME: call CSRSS for console handle duplication */
+ if (hSourceProcessHandle == hTargetProcessHandle)
+ {
+ *lpTargetHandle = hSourceHandle;
+ return TRUE;
+ }
+ else
+ {
+ return FALSE;
+ }
+ }
+
errCode = NtDuplicateObject(hSourceProcessHandle,
hSourceHandle,
hTargetProcessHandle,
dwOptions);
if (!NT_SUCCESS(errCode))
{
- SetLastError(RtlNtStatusToDosError(errCode));
+ SetLastErrorByStatus (errCode);
return FALSE;
}
{
return(nCount);
}
+
+
+/* EOF */