server: Return STATUS_INVALID_CID from NtOpenProcess.

When appropriate, instead of STATUS_INVALID_PARAMETER.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2020-11-26 10:11:35 +01:00 committed by Alexandre Julliard
parent 3326c578f3
commit e0a1bdf2bc
2 changed files with 4 additions and 4 deletions

View File

@ -2060,17 +2060,17 @@ static void test_process(void)
cid.UniqueProcess = 0;
cid.UniqueThread = 0;
status = pNtOpenProcess( &process, PROCESS_QUERY_LIMITED_INFORMATION, &attr, &cid );
todo_wine ok( status == STATUS_INVALID_CID, "NtOpenProcess returned %x\n", status );
ok( status == STATUS_INVALID_CID, "NtOpenProcess returned %x\n", status );
cid.UniqueProcess = ULongToHandle( 0xdeadbeef );
cid.UniqueThread = ULongToHandle( 0xdeadbeef );
status = pNtOpenProcess( &process, PROCESS_QUERY_LIMITED_INFORMATION, &attr, &cid );
todo_wine ok( status == STATUS_INVALID_CID, "NtOpenProcess returned %x\n", status );
ok( status == STATUS_INVALID_CID, "NtOpenProcess returned %x\n", status );
cid.UniqueProcess = ULongToHandle( GetCurrentThreadId() );
cid.UniqueThread = 0;
status = pNtOpenProcess( &process, PROCESS_QUERY_LIMITED_INFORMATION, &attr, &cid );
todo_wine ok( status == STATUS_INVALID_CID, "NtOpenProcess returned %x\n", status );
ok( status == STATUS_INVALID_CID, "NtOpenProcess returned %x\n", status );
cid.UniqueProcess = ULongToHandle( GetCurrentProcessId() );
cid.UniqueThread = 0;

View File

@ -778,7 +778,7 @@ struct process *get_process_from_id( process_id_t id )
struct object *obj = get_ptid_entry( id );
if (obj && obj->ops == &process_ops) return (struct process *)grab_object( obj );
set_error( STATUS_INVALID_PARAMETER );
set_error( STATUS_INVALID_CID );
return NULL;
}