Commit 7995d686 authored by Alexandre Julliard's avatar Alexandre Julliard

kernelbase: Implement ProcessIdToSessionId().

parent eb69da2a
......@@ -1024,11 +1024,20 @@ HANDLE WINAPI DECLSPEC_HOTPATCH OpenProcess( DWORD access, BOOL inherit, DWORD i
/***********************************************************************
* ProcessIdToSessionId (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH ProcessIdToSessionId( DWORD procid, DWORD *sessionid )
BOOL WINAPI DECLSPEC_HOTPATCH ProcessIdToSessionId( DWORD pid, DWORD *id )
{
if (procid != GetCurrentProcessId()) FIXME( "Unsupported for other process %x\n", procid );
*sessionid = NtCurrentTeb()->Peb->SessionId;
return TRUE;
HANDLE process;
NTSTATUS status;
if (pid == GetCurrentProcessId())
{
*id = NtCurrentTeb()->Peb->SessionId;
return TRUE;
}
if (!(process = OpenProcess( PROCESS_QUERY_LIMITED_INFORMATION, FALSE, pid ))) return FALSE;
status = NtQueryInformationProcess( process, ProcessSessionInformation, id, sizeof(*id), NULL );
CloseHandle( process );
return set_ntstatus( status );
}
......
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