CreateRemoteThread and related stuff (patch)

Alexander Yaworsky yaworsky at
Mon Aug 23 22:13:01 CDT 2004


> There is no need to export __wine_is_current_process from ntdll and use 
> it here when standard win32 apis will suffice.

> Well, not quite. You can open another handle to the process using 
> DuplicateHandle or something else, so you need to go via the server. The 
> simplest way to do this using Win32 is:
>   if (GetProcessId(handle) == GetCurrentProcessId())

You miss. It seems we really need __wine_is_current_process.

> >+        if( ! WriteProcessMemory( hProcess, &info, &local_info,
> >
> This looks wrong. &info? Don't you mean just info?

Yes! Thanks.

> >+    if ((process = get_process_from_handle( req->handle,
> >+                                            PROCESS_CREATE_THREAD
> >+                                            | PROCESS_QUERY_INFORMATION
> >+                                            | PROCESS_VM_OPERATION
> >+                                            | PROCESS_VM_READ | PROCESS_VM_WRITE )))
> >  
> >
> I would argue that it is perfectly alright for the access rights to be 

Maybe. But with the full set of access rights CreateRemoteThread will return earlier in case of error.

> Is it really necessary to perform the action required for remote 
> invocation of some operation asynchronously? It seems to add a lot of 
> unneeded complexity.

What shall we do with csVirtual critical section in ntdll/virtual.c?

More information about the wine-devel mailing list