From f44c9b73b884c53fbe14f70c74c31f442e8df24d Mon Sep 17 00:00:00 2001 From: short <> Date: Mon, 24 Mar 2003 02:25:44 +0000 Subject: [PATCH] ZwClose(): +handle bogus HANDLEs from our unimplemented PsCreateSystemThread() --- src/libcaptive/ob/handle.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/libcaptive/ob/handle.c b/src/libcaptive/ob/handle.c index e8de9ca..3dc7db0 100644 --- a/src/libcaptive/ob/handle.c +++ b/src/libcaptive/ob/handle.c @@ -25,6 +25,10 @@ #include +/* libcaptive/ps/create.c: */ +extern const guint8 PsCreateSystemThread_bogusthread; + + /** * ZwClose: * @Handle: Handle from some Zw*() create function. @@ -39,5 +43,11 @@ NTSTATUS ZwClose(HANDLE Handle) { g_return_val_if_fail(Handle!=NULL,STATUS_INVALID_HANDLE); + /* FIXME: libcaptive does not yet create the threads (thread objects) + * but ntfs.sys will ZwClose() immediately after its PsCreateSystemThread(). + */ + if (Handle==(HANDLE)&PsCreateSystemThread_bogusthread) + return STATUS_SUCCESS; + return NtClose(Handle); } -- 1.8.3.1