From f4bf96a0340a5287dc47b2e551481699c0879dbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Sun, 1 May 2005 22:30:13 +0000 Subject: [PATCH] Fix garbage text output with cmd.exe in GUI mode. Thanks to Hartmut for pointing me the problem svn path=/trunk/; revision=14939 --- reactos/drivers/video/videoprt/videoprt.c | 2 +- reactos/ntoskrnl/ob/namespc.c | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/reactos/drivers/video/videoprt/videoprt.c b/reactos/drivers/video/videoprt/videoprt.c index 80e23c99132..493c4092314 100644 --- a/reactos/drivers/video/videoprt/videoprt.c +++ b/reactos/drivers/video/videoprt/videoprt.c @@ -152,7 +152,7 @@ IntVideoPortAllocateDeviceNumber(VOID) DeviceNumber++; continue; } - else if (Status == STATUS_OBJECT_NAME_INVALID) + else if (Status == STATUS_OBJECT_NAME_NOT_FOUND) break; else { diff --git a/reactos/ntoskrnl/ob/namespc.c b/reactos/ntoskrnl/ob/namespc.c index 3fdd92db94d..e0ed0e72a51 100644 --- a/reactos/ntoskrnl/ob/namespc.c +++ b/reactos/ntoskrnl/ob/namespc.c @@ -143,12 +143,15 @@ ObOpenObjectByName(IN POBJECT_ATTRIBUTES ObjectAttributes, return Status; } - if (RemainingPath.Buffer != NULL || - Object == NULL) - { - RtlFreeUnicodeString(&RemainingPath); - return STATUS_OBJECT_NAME_INVALID; - } + if (RemainingPath.Buffer != NULL) + { + if (wcschr(RemainingPath.Buffer + 1, L'\\') == NULL) + return STATUS_OBJECT_NAME_NOT_FOUND; + else + return STATUS_OBJECT_PATH_NOT_FOUND; + } + if (Object == NULL) + return STATUS_UNSUCCESSFUL; Status = ObCreateHandle(PsGetCurrentProcess(), Object,