Re: [PATCH] NtQueryInformationProcess & ProcessDebugPort

2002-04-02 Thread Eric Pouech

> > sdk's windbg already work, so why no VC++ debugger ?
> Then we'll probably have to implement NtQueryInformationProcess completely
> for ProcessDebugPort. Does anyone know what it should return ? The debugger
> process handle ?
the debugport value is not intented for ring3 use. so any non null value
would
do when the debugger is present.

A+




Re: [PATCH] NtQueryInformationProcess & ProcessDebugPort

2002-04-02 Thread Laurent Pinchart

> sdk's windbg already work, so why no VC++ debugger ?
Then we'll probably have to implement NtQueryInformationProcess completely 
for ProcessDebugPort. Does anyone know what it should return ? The debugger 
process handle ?

> btw, your patch will not compile (ret/retv)

Sorry, I sent the wrong file. Here's the correct version.

Laurent Pinchart


--- nt.c	9 Mar 2002 23:39:09 -	1.38
+++ nt.c	2 Apr 2002 21:59:41 -
@@ -116,15 +116,34 @@
 	IN ULONG ProcessInformationLength,
 	OUT PULONG ReturnLength)
 {
-	FIXME("(0x%08x,0x%08x,%p,0x%08lx,%p),stub!\n",
-		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);
+	NTSTATUS ret = STATUS_SUCCESS;
+	ULONG len = 0;
 
-	return 0;
+	switch (ProcessInformationClass) {
+	case ProcessDebugPort:
+		/* "These are not the debuggers you are looking for." */
+		/* set it to 0 aka "no debugger" to satisfy copy protections */
+		if (ProcessInformationLength == 4)
+		{
+			memset(ProcessInformation,0,ProcessInformationLength);
+			len = 4;
+		}
+		else
+			ret = STATUS_INFO_LENGTH_MISMATCH;
+		break;
+	default:
+		FIXME("(0x%08x,0x%08x,%p,0x%08lx,%p),stub!\n",
+			ProcessHandle,ProcessInformationClass,
+			ProcessInformation,ProcessInformationLength,
+			ReturnLength
+		);
+		break;
+	}
+
+	if (ReturnLength)
+		*ReturnLength = len;
+
+	return ret;
 }
 
 /**



Re: [PATCH] NtQueryInformationProcess & ProcessDebugPort

2002-04-02 Thread Eric Pouech

> It fixes cases when ProcessInformationLength != 4, but doesn't check if a
> debugger is present or not. Should it ? I don't expect that anyone would like
> to run Visual Studio on Wine to debug a Win32 program :-)
sdk's windbg already work, so why no VC++ debugger ?
btw, your patch will not compile (ret/retv)

A+




Re: [PATCH] NtQueryInformationProcess & ProcessDebugPort

2002-04-02 Thread Dimitrie O. Paun

On April 2, 2002 12:17 pm, Laurent Pinchart wrote:
> Hi,
>
> Here's a small patch which implements NtQueryInformationProcess properly
> for ProcessInformationClass set to ProcessDebugPort.
>
> It fixes cases when ProcessInformationLength != 4, but doesn't check if a
> debugger is present or not. Should it ? I don't expect that anyone would
> like to run Visual Studio on Wine to debug a Win32 program :-)

Why not??? I think that would be wy cool!

-- 
Dimi.