mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 00:45:24 +00:00
[WIN32K]
- Remove the now unneeded CSR messaging support. - CsrInit() goes away also and the usage of the CsrProcess is replaced by that of gpepCSRSS. [WINSRV] - Use a DLL instance for loading resources, instead of calling GetModuleHandle. [KERNEL32/NTDLL] - Remove unneeded variables. svn path=/branches/ros-csrss/; revision=57665
This commit is contained in:
parent
dbcead9345
commit
bd4d83d88f
16 changed files with 15 additions and 92 deletions
|
@ -163,6 +163,4 @@ VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
LdrpFinalizeAndDeallocateDataTableEntry(IN PLDR_DATA_TABLE_ENTRY Entry);
|
LdrpFinalizeAndDeallocateDataTableEntry(IN PLDR_DATA_TABLE_ENTRY Entry);
|
||||||
|
|
||||||
extern HANDLE WindowsApiPort;
|
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -155,7 +155,6 @@ typedef struct _BASEP_ACTCTX_BLOCK
|
||||||
#define BASEP_GET_MODULE_HANDLE_EX_PARAMETER_VALIDATION_SUCCESS 2
|
#define BASEP_GET_MODULE_HANDLE_EX_PARAMETER_VALIDATION_SUCCESS 2
|
||||||
#define BASEP_GET_MODULE_HANDLE_EX_PARAMETER_VALIDATION_CONTINUE 3
|
#define BASEP_GET_MODULE_HANDLE_EX_PARAMETER_VALIDATION_CONTINUE 3
|
||||||
|
|
||||||
|
|
||||||
extern PBASE_STATIC_SERVER_DATA BaseStaticServerData;
|
extern PBASE_STATIC_SERVER_DATA BaseStaticServerData;
|
||||||
|
|
||||||
typedef
|
typedef
|
||||||
|
@ -164,8 +163,6 @@ DWORD
|
||||||
HANDLE hProcess,
|
HANDLE hProcess,
|
||||||
DWORD dwMilliseconds);
|
DWORD dwMilliseconds);
|
||||||
|
|
||||||
|
|
||||||
extern BOOLEAN InWindows;
|
|
||||||
extern WaitForInputIdleType UserWaitForInputIdleRoutine;
|
extern WaitForInputIdleType UserWaitForInputIdleRoutine;
|
||||||
|
|
||||||
/* GLOBAL VARIABLES **********************************************************/
|
/* GLOBAL VARIABLES **********************************************************/
|
||||||
|
|
|
@ -103,7 +103,6 @@ list(APPEND SOURCE
|
||||||
user/ntuser/caret.c
|
user/ntuser/caret.c
|
||||||
user/ntuser/class.c
|
user/ntuser/class.c
|
||||||
user/ntuser/clipboard.c
|
user/ntuser/clipboard.c
|
||||||
user/ntuser/csr.c
|
|
||||||
user/ntuser/defwnd.c
|
user/ntuser/defwnd.c
|
||||||
user/ntuser/desktop.c
|
user/ntuser/desktop.c
|
||||||
user/ntuser/display.c
|
user/ntuser/display.c
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
|
|
||||||
extern PENTRY gpentHmgr;
|
extern PENTRY gpentHmgr;
|
||||||
extern PULONG gpaulRefCount;
|
extern PULONG gpaulRefCount;
|
||||||
extern PEPROCESS gpepCSRSS;
|
|
||||||
extern ULONG gulFirstUnused;
|
extern ULONG gulFirstUnused;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,52 +0,0 @@
|
||||||
/*
|
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
|
||||||
* PROJECT: ReactOS kernel
|
|
||||||
* PURPOSE: Interface to csrss
|
|
||||||
* FILE: subsys/win32k/ntuser/csr.c
|
|
||||||
* PROGRAMER: Ge van Geldorp (ge@gse.nl)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <win32k.h>
|
|
||||||
DBG_DEFAULT_CHANNEL(UserMisc);
|
|
||||||
|
|
||||||
static HANDLE WindowsApiPort = NULL;
|
|
||||||
PEPROCESS CsrProcess = NULL;
|
|
||||||
|
|
||||||
NTSTATUS FASTCALL
|
|
||||||
CsrInit(void)
|
|
||||||
{
|
|
||||||
NTSTATUS Status;
|
|
||||||
UNICODE_STRING PortName;
|
|
||||||
ULONG ConnectInfoLength;
|
|
||||||
SECURITY_QUALITY_OF_SERVICE Qos;
|
|
||||||
|
|
||||||
ERR("CsrInit\n");
|
|
||||||
|
|
||||||
RtlInitUnicodeString(&PortName, L"\\Windows\\ApiPort");
|
|
||||||
ConnectInfoLength = 0;
|
|
||||||
Qos.Length = sizeof(Qos);
|
|
||||||
Qos.ImpersonationLevel = SecurityDelegation;
|
|
||||||
Qos.ContextTrackingMode = SECURITY_STATIC_TRACKING;
|
|
||||||
Qos.EffectiveOnly = FALSE;
|
|
||||||
|
|
||||||
CsrProcess = PsGetCurrentProcess();
|
|
||||||
ERR("CsrInit - CsrProcess = 0x%p\n", CsrProcess);
|
|
||||||
|
|
||||||
Status = ZwConnectPort(&WindowsApiPort,
|
|
||||||
&PortName,
|
|
||||||
&Qos,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
&ConnectInfoLength);
|
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
ERR("CsrInit - Status = 0x%p\n", Status);
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* EOF */
|
|
|
@ -1,16 +0,0 @@
|
||||||
/* $Id$
|
|
||||||
*
|
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
|
||||||
* PROJECT: ReactOS kernel
|
|
||||||
* PURPOSE: Interface to csrss
|
|
||||||
* FILE: subsys/win32k/include/csr.h
|
|
||||||
* PROGRAMER: Ge van Geldorp (ge@gse.nl)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
extern PEPROCESS CsrProcess;
|
|
||||||
|
|
||||||
NTSTATUS FASTCALL CsrInit(void);
|
|
||||||
|
|
||||||
/* EOF */
|
|
|
@ -2024,7 +2024,7 @@ NtUserSetThreadDesktop(HDESK hDesktop)
|
||||||
// FIXME: IntSetThreadDesktop validates the desktop handle, it should happen
|
// FIXME: IntSetThreadDesktop validates the desktop handle, it should happen
|
||||||
// here too and set the NT error level. Q. Is it necessary to have the validation
|
// here too and set the NT error level. Q. Is it necessary to have the validation
|
||||||
// in IntSetThreadDesktop? Is it needed there too?
|
// in IntSetThreadDesktop? Is it needed there too?
|
||||||
if (hDesktop || (!hDesktop && CsrProcess == PsGetCurrentProcess()))
|
if (hDesktop || (!hDesktop && PsGetCurrentProcess() == gpepCSRSS))
|
||||||
ret = IntSetThreadDesktop(hDesktop, FALSE);
|
ret = IntSetThreadDesktop(hDesktop, FALSE);
|
||||||
|
|
||||||
UserLeave();
|
UserLeave();
|
||||||
|
|
|
@ -94,7 +94,7 @@ IntHookModuleUnloaded(PDESKTOP pdesk, int iHookID, HHOOK hHook)
|
||||||
|
|
||||||
ERR("IntHookModuleUnloaded: iHookID=%d\n", iHookID);
|
ERR("IntHookModuleUnloaded: iHookID=%d\n", iHookID);
|
||||||
|
|
||||||
ppiCsr = PsGetProcessWin32Process(CsrProcess);
|
ppiCsr = PsGetProcessWin32Process(gpepCSRSS);
|
||||||
|
|
||||||
ListEntry = pdesk->PtiList.Flink;
|
ListEntry = pdesk->PtiList.Flink;
|
||||||
while(ListEntry != &pdesk->PtiList)
|
while(ListEntry != &pdesk->PtiList)
|
||||||
|
@ -147,7 +147,7 @@ UserRegisterUserApiHook(
|
||||||
PPROCESSINFO ppiCsr;
|
PPROCESSINFO ppiCsr;
|
||||||
|
|
||||||
pti = PsGetCurrentThreadWin32Thread();
|
pti = PsGetCurrentThreadWin32Thread();
|
||||||
ppiCsr = PsGetProcessWin32Process(CsrProcess);
|
ppiCsr = PsGetProcessWin32Process(gpepCSRSS);
|
||||||
|
|
||||||
/* Fail if the api hook is already registered */
|
/* Fail if the api hook is already registered */
|
||||||
if(gpsi->dwSRVIFlags & SRVINFO_APIHOOK)
|
if(gpsi->dwSRVIFlags & SRVINFO_APIHOOK)
|
||||||
|
|
|
@ -1522,14 +1522,13 @@ HMENU FASTCALL UserCreateMenu(BOOL PopupMenu)
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
PEPROCESS CurrentProcess = PsGetCurrentProcess();
|
PEPROCESS CurrentProcess = PsGetCurrentProcess();
|
||||||
|
|
||||||
if (CsrProcess != CurrentProcess)
|
if (gpepCSRSS != CurrentProcess)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* CsrProcess does not have a Win32WindowStation
|
* gpepCSRSS does not have a Win32WindowStation
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Status = IntValidateWindowStationHandle(PsGetCurrentProcess()->Win32WindowStation,
|
Status = IntValidateWindowStationHandle(CurrentProcess->Win32WindowStation,
|
||||||
KernelMode,
|
KernelMode,
|
||||||
0,
|
0,
|
||||||
&WinStaObject);
|
&WinStaObject);
|
||||||
|
|
|
@ -20,7 +20,7 @@ ATOM AtomFlashWndState; // Window Flash State atom.
|
||||||
BOOL gbInitialized;
|
BOOL gbInitialized;
|
||||||
HINSTANCE hModClient = NULL;
|
HINSTANCE hModClient = NULL;
|
||||||
BOOL ClientPfnInit = FALSE;
|
BOOL ClientPfnInit = FALSE;
|
||||||
PEPROCESS gpepCSRSS;
|
PEPROCESS gpepCSRSS = NULL;
|
||||||
|
|
||||||
/* PRIVATE FUNCTIONS *********************************************************/
|
/* PRIVATE FUNCTIONS *********************************************************/
|
||||||
|
|
||||||
|
@ -133,8 +133,6 @@ UserInitialize(
|
||||||
|
|
||||||
NtUserUpdatePerUserSystemParameters(0, TRUE);
|
NtUserUpdatePerUserSystemParameters(0, TRUE);
|
||||||
|
|
||||||
CsrInit();
|
|
||||||
|
|
||||||
if (gpsi->hbrGray == NULL)
|
if (gpsi->hbrGray == NULL)
|
||||||
{
|
{
|
||||||
hPattern55AABitmap = GreCreateBitmap(8, 8, 1, 1, (LPBYTE)wPattern55AA);
|
hPattern55AABitmap = GreCreateBitmap(8, 8, 1, 1, (LPBYTE)wPattern55AA);
|
||||||
|
|
|
@ -15,6 +15,7 @@ extern PTHREADINFO gptiCurrent;
|
||||||
extern PPROCESSINFO gppiList;
|
extern PPROCESSINFO gppiList;
|
||||||
extern PPROCESSINFO ppiScrnSaver;
|
extern PPROCESSINFO ppiScrnSaver;
|
||||||
extern PPROCESSINFO gppiInputProvider;
|
extern PPROCESSINFO gppiInputProvider;
|
||||||
|
extern PEPROCESS gpepCSRSS;
|
||||||
|
|
||||||
INIT_FUNCTION NTSTATUS NTAPI InitUserImpl(VOID);
|
INIT_FUNCTION NTSTATUS NTAPI InitUserImpl(VOID);
|
||||||
VOID FASTCALL CleanupUserImpl(VOID);
|
VOID FASTCALL CleanupUserImpl(VOID);
|
||||||
|
|
|
@ -334,7 +334,7 @@ NtUserCallOneParam(
|
||||||
BOOL Ret = TRUE;
|
BOOL Ret = TRUE;
|
||||||
PPROCESSINFO ppi;
|
PPROCESSINFO ppi;
|
||||||
PDWORD pdwLayout;
|
PDWORD pdwLayout;
|
||||||
if ( PsGetCurrentProcess() == CsrProcess)
|
if ( PsGetCurrentProcess() == gpepCSRSS)
|
||||||
{
|
{
|
||||||
EngSetLastError(ERROR_INVALID_ACCESS);
|
EngSetLastError(ERROR_INVALID_ACCESS);
|
||||||
RETURN(FALSE);
|
RETURN(FALSE);
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
HANDLE DllHandle = NULL;
|
HINSTANCE UserSrvDllInstance = NULL;
|
||||||
// HANDLE WinSrvApiPort = NULL;
|
// HANDLE WinSrvApiPort = NULL;
|
||||||
|
|
||||||
/* Memory */
|
/* Memory */
|
||||||
|
@ -357,7 +357,7 @@ BOOL WINAPI _UserSoundSentry(VOID)
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
WINAPI
|
WINAPI
|
||||||
DllMain(IN HANDLE hDll,
|
DllMain(IN HINSTANCE hInstanceDll,
|
||||||
IN DWORD dwReason,
|
IN DWORD dwReason,
|
||||||
IN LPVOID lpReserved)
|
IN LPVOID lpReserved)
|
||||||
{
|
{
|
||||||
|
@ -366,7 +366,7 @@ DllMain(IN HANDLE hDll,
|
||||||
|
|
||||||
if (DLL_PROCESS_ATTACH == dwReason)
|
if (DLL_PROCESS_ATTACH == dwReason)
|
||||||
{
|
{
|
||||||
DllHandle = hDll;
|
UserSrvDllInstance = hInstanceDll;
|
||||||
|
|
||||||
/*** HACK from win32csr... ***/
|
/*** HACK from win32csr... ***/
|
||||||
|
|
||||||
|
|
|
@ -244,7 +244,7 @@ EndNowThreadProc(LPVOID Parameter)
|
||||||
SetThreadDesktop(NotifyContext->Desktop);
|
SetThreadDesktop(NotifyContext->Desktop);
|
||||||
SwitchDesktop(NotifyContext->Desktop);
|
SwitchDesktop(NotifyContext->Desktop);
|
||||||
CallInitCommonControls();
|
CallInitCommonControls();
|
||||||
NotifyContext->Dlg = CreateDialogParam(GetModuleHandleW(L"win32csr"),
|
NotifyContext->Dlg = CreateDialogParam(UserSrvDllInstance,
|
||||||
MAKEINTRESOURCE(IDD_END_NOW), NULL,
|
MAKEINTRESOURCE(IDD_END_NOW), NULL,
|
||||||
EndNowDlgProc, (LPARAM) NotifyContext);
|
EndNowDlgProc, (LPARAM) NotifyContext);
|
||||||
if (NULL == NotifyContext->Dlg)
|
if (NULL == NotifyContext->Dlg)
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
|
|
||||||
|
|
||||||
|
extern HINSTANCE UserSrvDllInstance;
|
||||||
extern HANDLE UserSrvHeap;
|
extern HANDLE UserSrvHeap;
|
||||||
// extern HANDLE BaseSrvSharedHeap;
|
// extern HANDLE BaseSrvSharedHeap;
|
||||||
// extern PBASE_STATIC_SERVER_DATA BaseStaticServerData;
|
// extern PBASE_STATIC_SERVER_DATA BaseStaticServerData;
|
||||||
|
|
|
@ -100,7 +100,6 @@ typedef struct _DESKTOP *PDESKTOP;
|
||||||
#include "user/ntuser/vis.h"
|
#include "user/ntuser/vis.h"
|
||||||
#include "user/ntuser/userfuncs.h"
|
#include "user/ntuser/userfuncs.h"
|
||||||
#include "user/ntuser/scroll.h"
|
#include "user/ntuser/scroll.h"
|
||||||
#include "user/ntuser/csr.h"
|
|
||||||
#include "user/ntuser/winpos.h"
|
#include "user/ntuser/winpos.h"
|
||||||
#include "user/ntuser/callback.h"
|
#include "user/ntuser/callback.h"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue