From 12298c5cad62d0b7aaa6d57fdfcbc110a681f578 Mon Sep 17 00:00:00 2001
From: Marcus Meissner <marcus@jet.franken.de>
Date: Sun, 25 Jun 2000 12:51:55 +0000
Subject: [PATCH] Return "no debugger attached" in NtQueryInformationProcess to
 satisfy some copy protection mechanisms.

---
 dlls/ntdll/nt.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c
index ff18cef9b96..862eb3364f9 100644
--- a/dlls/ntdll/nt.c
+++ b/dlls/ntdll/nt.c
@@ -97,7 +97,13 @@ NTSTATUS WINAPI NtQueryInformationProcess(
 	OUT PULONG ReturnLength)
 {
 	FIXME("(0x%08x,0x%08x,%p,0x%08lx,%p),stub!\n",
-	ProcessHandle,ProcessInformationClass,ProcessInformation,ProcessInformationLength,ReturnLength);
+		ProcessHandle,ProcessInformationClass,ProcessInformation,ProcessInformationLength,ReturnLength
+	);
+	/* "These are not the debuggers you are looking for." */
+	if (ProcessInformationClass == ProcessDebugPort)
+	    /* set it to 0 aka "no debugger" to satisfy copy protections */
+	    memset(ProcessInformation,0,ProcessInformationLength);
+
 	return 0;
 }
 
-- 
GitLab