mirror of
https://github.com/reactos/reactos.git
synced 2024-10-02 07:26:47 +00:00
[USER32]
- Call GetThreadConsoleDesktop of CONSRV if needed, in GetThreadDesktop (in case the process is a console app). - Introduce two last-error helpers UserSetLast(NT)Error which work the same as the (Base)SetLast(NT)Error of kernel32, needed for CSR status errors etc... [WINSRV] - Improve the stub of SrvGetThreadConsoleDesktop (it needs to success, and atm. it always zeroes-out the returned console desktop handle). svn path=/trunk/; revision=65513
This commit is contained in:
parent
0abf72fdee
commit
d3b2696104
|
@ -36,18 +36,24 @@ typedef enum _USERSRV_API_NUMBER
|
||||||
} USERSRV_API_NUMBER, *PUSERSRV_API_NUMBER;
|
} USERSRV_API_NUMBER, *PUSERSRV_API_NUMBER;
|
||||||
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct _USER_EXIT_REACTOS
|
||||||
{
|
{
|
||||||
UINT Flags;
|
UINT Flags;
|
||||||
DWORD Reserved;
|
DWORD Reserved;
|
||||||
} USER_EXIT_REACTOS, *PUSER_EXIT_REACTOS;
|
} USER_EXIT_REACTOS, *PUSER_EXIT_REACTOS;
|
||||||
|
|
||||||
typedef struct
|
typedef struct _USER_GET_THREAD_CONSOLE_DESKTOP
|
||||||
|
{
|
||||||
|
ULONG_PTR ThreadId;
|
||||||
|
HANDLE ConsoleDesktop;
|
||||||
|
} USER_GET_THREAD_CONSOLE_DESKTOP, *PUSER_GET_THREAD_CONSOLE_DESKTOP;
|
||||||
|
|
||||||
|
typedef struct _USER_REGISTER_SERVICES_PROCESS
|
||||||
{
|
{
|
||||||
ULONG_PTR ProcessId;
|
ULONG_PTR ProcessId;
|
||||||
} USER_REGISTER_SERVICES_PROCESS, *PUSER_REGISTER_SERVICES_PROCESS;
|
} USER_REGISTER_SERVICES_PROCESS, *PUSER_REGISTER_SERVICES_PROCESS;
|
||||||
|
|
||||||
typedef struct
|
typedef struct _USER_REGISTER_LOGON_PROCESS
|
||||||
{
|
{
|
||||||
ULONG_PTR ProcessId;
|
ULONG_PTR ProcessId;
|
||||||
BOOL Register;
|
BOOL Register;
|
||||||
|
@ -65,6 +71,7 @@ typedef struct _USER_API_MESSAGE
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
USER_EXIT_REACTOS ExitReactosRequest;
|
USER_EXIT_REACTOS ExitReactosRequest;
|
||||||
|
USER_GET_THREAD_CONSOLE_DESKTOP GetThreadConsoleDesktopRequest;
|
||||||
USER_REGISTER_SERVICES_PROCESS RegisterServicesProcessRequest;
|
USER_REGISTER_SERVICES_PROCESS RegisterServicesProcessRequest;
|
||||||
USER_REGISTER_LOGON_PROCESS RegisterLogonProcessRequest;
|
USER_REGISTER_LOGON_PROCESS RegisterLogonProcessRequest;
|
||||||
} Data;
|
} Data;
|
||||||
|
|
|
@ -68,6 +68,8 @@ BOOL FASTCALL MessageInit(VOID);
|
||||||
VOID FASTCALL MessageCleanup(VOID);
|
VOID FASTCALL MessageCleanup(VOID);
|
||||||
|
|
||||||
/* definitions for misc.c */
|
/* definitions for misc.c */
|
||||||
|
VOID WINAPI UserSetLastError(IN DWORD dwErrCode);
|
||||||
|
VOID WINAPI UserSetLastNTError(IN NTSTATUS Status);
|
||||||
PCALLPROCDATA FASTCALL ValidateCallProc(HANDLE hCallProc);
|
PCALLPROCDATA FASTCALL ValidateCallProc(HANDLE hCallProc);
|
||||||
PWND FASTCALL ValidateHwnd(HWND hwnd);
|
PWND FASTCALL ValidateHwnd(HWND hwnd);
|
||||||
PWND FASTCALL ValidateHwndOrDesk(HWND hwnd);
|
PWND FASTCALL ValidateHwndOrDesk(HWND hwnd);
|
||||||
|
|
|
@ -548,7 +548,23 @@ WINAPI
|
||||||
GetThreadDesktop(
|
GetThreadDesktop(
|
||||||
DWORD dwThreadId)
|
DWORD dwThreadId)
|
||||||
{
|
{
|
||||||
return NtUserGetThreadDesktop(dwThreadId, 0);
|
USER_API_MESSAGE ApiMessage;
|
||||||
|
PUSER_GET_THREAD_CONSOLE_DESKTOP GetThreadConsoleDesktopRequest = &ApiMessage.Data.GetThreadConsoleDesktopRequest;
|
||||||
|
|
||||||
|
GetThreadConsoleDesktopRequest->ThreadId = dwThreadId;
|
||||||
|
|
||||||
|
CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
|
||||||
|
NULL,
|
||||||
|
CSR_CREATE_API_NUMBER(USERSRV_SERVERDLL_INDEX, UserpGetThreadConsoleDesktop),
|
||||||
|
sizeof(*GetThreadConsoleDesktopRequest));
|
||||||
|
if (!NT_SUCCESS(ApiMessage.Status))
|
||||||
|
{
|
||||||
|
UserSetLastNTError(ApiMessage.Status);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NtUserGetThreadDesktop(dwThreadId,
|
||||||
|
(DWORD)GetThreadConsoleDesktopRequest->ConsoleDesktop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,28 +1,9 @@
|
||||||
/*
|
/*
|
||||||
* ReactOS kernel
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* PROJECT: ReactOS user32.dll
|
* PROJECT: ReactOS user32.dll
|
||||||
* FILE: lib/user32/misc/misc.c
|
* FILE: lib/user32/misc/misc.c
|
||||||
* PURPOSE: Misc
|
* PURPOSE: Misc
|
||||||
* PROGRAMMER: Thomas Weidenmueller (w3seek@users.sourceforge.net)
|
* PROGRAMMER: Thomas Weidenmueller (w3seek@users.sourceforge.net)
|
||||||
* UPDATE HISTORY:
|
|
||||||
* 19-11-2003 Created
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* INCLUDES ******************************************************************/
|
/* INCLUDES ******************************************************************/
|
||||||
|
@ -35,6 +16,30 @@ WINE_DEFAULT_DEBUG_CHANNEL(user32);
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
|
VOID
|
||||||
|
WINAPI
|
||||||
|
UserSetLastError(IN DWORD dwErrCode)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Equivalent of SetLastError in kernel32, but without breaking
|
||||||
|
* into the debugger nor checking whether the last old error is
|
||||||
|
* the same as the one we are going to set.
|
||||||
|
*/
|
||||||
|
NtCurrentTeb()->LastErrorValue = dwErrCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID
|
||||||
|
WINAPI
|
||||||
|
UserSetLastNTError(IN NTSTATUS Status)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Equivalent of BaseSetLastNTError in kernel32, but using
|
||||||
|
* UserSetLastError: convert from NT to Win32, then set.
|
||||||
|
*/
|
||||||
|
UserSetLastError(RtlNtStatusToDosError(Status));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -121,8 +121,15 @@ CSR_API(SrvActivateDebugger)
|
||||||
|
|
||||||
CSR_API(SrvGetThreadConsoleDesktop)
|
CSR_API(SrvGetThreadConsoleDesktop)
|
||||||
{
|
{
|
||||||
|
PUSER_GET_THREAD_CONSOLE_DESKTOP GetThreadConsoleDesktopRequest = &((PUSER_API_MESSAGE)ApiMessage)->Data.GetThreadConsoleDesktopRequest;
|
||||||
|
|
||||||
DPRINT1("%s not yet implemented\n", __FUNCTION__);
|
DPRINT1("%s not yet implemented\n", __FUNCTION__);
|
||||||
return STATUS_NOT_IMPLEMENTED;
|
|
||||||
|
/* Return nothing for the moment... */
|
||||||
|
GetThreadConsoleDesktopRequest->ConsoleDesktop = NULL;
|
||||||
|
|
||||||
|
/* Always succeeds */
|
||||||
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
CSR_API(SrvDeviceEvent)
|
CSR_API(SrvDeviceEvent)
|
||||||
|
|
Loading…
Reference in a new issue