Commit eb1146a5 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

ntoskrnl.exe: Implement PsGetProcessId.

parent 1c2d5172
......@@ -2462,6 +2462,7 @@ static void *create_process_object( HANDLE handle )
process->header.Type = 3;
process->header.WaitListHead.Blink = INVALID_HANDLE_VALUE; /* mark as kernel object */
NtQueryInformationProcess( handle, ProcessBasicInformation, &process->info, sizeof(process->info), NULL );
return process;
}
......@@ -2503,6 +2504,15 @@ NTSTATUS WINAPI PsLookupProcessByProcessId( HANDLE processid, PEPROCESS *process
return status;
}
/*********************************************************************
* PsGetProcessId (NTOSKRNL.@)
*/
HANDLE WINAPI PsGetProcessId(PEPROCESS process)
{
TRACE( "%p -> %lx\n", process, process->info.UniqueProcessId );
return (HANDLE)process->info.UniqueProcessId;
}
static void *create_thread_object( HANDLE handle )
{
......@@ -4240,16 +4250,6 @@ void WINAPI ExfUnblockPushLock( EX_PUSH_LOCK *lock, PEX_PUSH_LOCK_WAIT_BLOCK blo
}
/*********************************************************************
* PsGetProcessId (NTOSKRNL.@)
*/
HANDLE WINAPI PsGetProcessId(PEPROCESS process)
{
FIXME("stub: %p\n", process);
return 0;
}
/*********************************************************************
* FsRtlRegisterFileSystemFilterCallbacks (NTOSKRNL.@)
*/
NTSTATUS WINAPI FsRtlRegisterFileSystemFilterCallbacks( DRIVER_OBJECT *object, PFS_FILTER_CALLBACKS callbacks)
......
......@@ -28,8 +28,10 @@ struct _OBJECT_TYPE
void (*release)(void*); /* called when the last reference is released */
};
struct _EPROCESS {
struct _EPROCESS
{
DISPATCHER_HEADER header;
PROCESS_BASIC_INFORMATION info;
};
struct _KTHREAD
......
......@@ -334,6 +334,8 @@ static void test_currentprocess(void)
ret = wait_single(current, 0);
ok(ret == STATUS_TIMEOUT, "got %#x\n", ret);
ok(PsGetProcessId(current) == PsGetCurrentProcessId(), "process IDs don't match\n");
thread = PsGetCurrentThread();
ret = wait_single( thread, 0 );
ok(ret == STATUS_TIMEOUT, "got %#x\n", ret);
......
......@@ -216,6 +216,7 @@ NTSTATUS WINAPI IoRegisterShutdownNotification(PDEVICE_OBJECT);
NTSTATUS WINAPI KeExpandKernelStackAndCallout(PEXPAND_STACK_CALLOUT,void*,SIZE_T);
void WINAPI KeSetTargetProcessorDpc(PRKDPC,CCHAR);
BOOLEAN WINAPI MmIsAddressValid(void *);
HANDLE WINAPI PsGetProcessId(PEPROCESS);
NTSTATUS WINAPI PsSetLoadImageNotifyRoutine(PLOAD_IMAGE_NOTIFY_ROUTINE);
void WINAPI RtlInitializeGenericTableAvl(PRTL_AVL_TABLE,PRTL_AVL_COMPARE_ROUTINE,PRTL_AVL_ALLOCATE_ROUTINE, PRTL_AVL_FREE_ROUTINE,void *);
void WINAPI RtlInsertElementGenericTableAvl(PRTL_AVL_TABLE,void *,ULONG,BOOL*);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment