mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 12:06:52 +00:00
Emanuele Aliberti <ea@reactos.com>
- Some stubs for ts moved in process/session.c. - Implemented ProcessIdToSessionId. svn path=/trunk/; revision=11017
This commit is contained in:
parent
b0f758cf33
commit
bf3b5cc677
4 changed files with 82 additions and 23 deletions
|
@ -168,8 +168,8 @@ DisconnectNamedPipe@4
|
||||||
DnsHostnameToComputerNameA@12
|
DnsHostnameToComputerNameA@12
|
||||||
DnsHostnameToComputerNameW@12
|
DnsHostnameToComputerNameW@12
|
||||||
DosDateTimeToFileTime@12
|
DosDateTimeToFileTime@12
|
||||||
;DosPathToSessionPathA
|
DosPathToSessionPathA@12
|
||||||
;DosPathToSessionPathW
|
DosPathToSessionPathW@12
|
||||||
DuplicateConsoleHandle@16
|
DuplicateConsoleHandle@16
|
||||||
DuplicateHandle@28
|
DuplicateHandle@28
|
||||||
EndUpdateResourceA@8
|
EndUpdateResourceA@8
|
||||||
|
|
|
@ -29,6 +29,7 @@ BEGIN
|
||||||
VALUE "OriginalFilename", "kernel32.dll\0"
|
VALUE "OriginalFilename", "kernel32.dll\0"
|
||||||
VALUE "ProductName", RES_STR_PRODUCT_NAME
|
VALUE "ProductName", RES_STR_PRODUCT_NAME
|
||||||
VALUE "ProductVersion", RES_STR_PRODUCT_VERSION
|
VALUE "ProductVersion", RES_STR_PRODUCT_VERSION
|
||||||
|
VALUE "Build Date", RES_STR_BUILD_DATE
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: stubs.c,v 1.91 2004/09/23 19:03:26 weiden Exp $
|
/* $Id: stubs.c,v 1.92 2004/09/23 21:01:23 ea Exp $
|
||||||
*
|
*
|
||||||
* KERNEL32.DLL stubs (STUB functions)
|
* KERNEL32.DLL stubs (STUB functions)
|
||||||
* Remove from this file, if you implement them.
|
* Remove from this file, if you implement them.
|
||||||
|
@ -1197,17 +1197,6 @@ WriteFileGather(
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* @unimplemented
|
|
||||||
*/
|
|
||||||
DWORD
|
|
||||||
STDCALL
|
|
||||||
WTSGetActiveConsoleSessionId(VOID)
|
|
||||||
{
|
|
||||||
STUB;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: session.c,v 1.5 2003/07/10 18:50:51 chorns Exp $
|
/* $Id: session.c,v 1.6 2004/09/23 21:01:23 ea Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS system libraries
|
* PROJECT: ReactOS system libraries
|
||||||
|
@ -10,22 +10,91 @@
|
||||||
*/
|
*/
|
||||||
#include <k32.h>
|
#include <k32.h>
|
||||||
|
|
||||||
|
DWORD ActiveConsoleSessionId = 0;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
BOOL STDCALL ProcessIdToSessionId (
|
DWORD STDCALL
|
||||||
DWORD dwProcessId,
|
DosPathToSessionPathW (DWORD SessionID, LPWSTR InPath, LPWSTR * OutPath)
|
||||||
DWORD* pSessionId
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
if (NULL != pSessionId)
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* From: ActiveVB.DE
|
||||||
|
*
|
||||||
|
* Declare Function DosPathToSessionPath _
|
||||||
|
* Lib "kernel32.dll" _
|
||||||
|
* Alias "DosPathToSessionPathA" ( _
|
||||||
|
* ByVal SessionId As Long, _
|
||||||
|
* ByVal pInPath As String, _
|
||||||
|
* ByVal ppOutPath As String ) _
|
||||||
|
* As Long
|
||||||
|
*
|
||||||
|
* @unimplemented
|
||||||
|
*/
|
||||||
|
DWORD STDCALL
|
||||||
|
DosPathToSessionPathA (DWORD SessionId, LPSTR InPath, LPSTR * OutPath)
|
||||||
|
{
|
||||||
|
//DosPathToSessionPathW (SessionId,InPathW,OutPathW);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
BOOL STDCALL ProcessIdToSessionId (IN DWORD dwProcessId,
|
||||||
|
OUT DWORD* pSessionId)
|
||||||
|
{
|
||||||
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
|
HANDLE ProcessHandle = INVALID_HANDLE_VALUE;
|
||||||
|
OBJECT_ATTRIBUTES Oa = { sizeof (OBJECT_ATTRIBUTES), 0, };
|
||||||
|
DWORD SessionId = 0;
|
||||||
|
|
||||||
|
if (IsBadWritePtr(pSessionId, sizeof (DWORD)))
|
||||||
{
|
{
|
||||||
/* TODO: implement TS */
|
SetLastError (ERROR_INVALID_DATA); //FIXME
|
||||||
*pSessionId = 0; /* no TS */
|
goto ProcessIdToSessionId_FAIL_EXIT;
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
Status = NtOpenProcess (
|
||||||
|
& ProcessHandle,
|
||||||
|
PROCESS_QUERY_INFORMATION,
|
||||||
|
& Oa,
|
||||||
|
NULL);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
goto ProcessIdToSessionId_FAIL;
|
||||||
|
}
|
||||||
|
Status = NtQueryInformationProcess (
|
||||||
|
ProcessHandle,
|
||||||
|
ProcessSessionInformation,
|
||||||
|
& SessionId,
|
||||||
|
sizeof SessionId,
|
||||||
|
NULL);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
NtClose (ProcessHandle);
|
||||||
|
goto ProcessIdToSessionId_FAIL;
|
||||||
|
}
|
||||||
|
NtClose (ProcessHandle);
|
||||||
|
*pSessionId = SessionId;
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
ProcessIdToSessionId_FAIL:
|
||||||
|
SetLastErrorByStatus(Status);
|
||||||
|
ProcessIdToSessionId_FAIL_EXIT:
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
DWORD STDCALL
|
||||||
|
WTSGetActiveConsoleSessionId (VOID)
|
||||||
|
{
|
||||||
|
return ActiveConsoleSessionId;
|
||||||
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue