mirror of
https://github.com/reactos/reactos.git
synced 2024-08-21 02:43:48 +00:00
[CSRSS]
Merge from ams64 branch: 35805 remove unneeded msvcrt dependency (all win32 projects already depend on it) (Samuel Serapión) 36992 - Fix csrss compilation (treat handles as pointer sized, use SIZE_T where appropriate) (Stefan Ginsberg) 41485 Fix 64bit issues. (Timo Kreuzer) 41531 fix pointer <-> DWORD casts (Timo Kreuzer) 41536 win32csr: convert to spec (Timo Kreuzer) 43838 Fix csrss build. (Samuel Serapión) svn path=/trunk/; revision=44952
This commit is contained in:
commit
927ff64dae
|
@ -23,7 +23,7 @@ static
|
|||
BOOL
|
||||
CsrIsConsoleHandle(HANDLE Handle)
|
||||
{
|
||||
return ((ULONG)Handle & 0x10000003) == 0x3;
|
||||
return ((ULONG_PTR)Handle & 0x10000003) == 0x3;
|
||||
}
|
||||
|
||||
|
||||
|
@ -77,7 +77,7 @@ CsrGetObject(
|
|||
Object_t **Object,
|
||||
DWORD Access )
|
||||
{
|
||||
ULONG h = (ULONG)Handle >> 2;
|
||||
ULONG_PTR h = (ULONG_PTR)Handle >> 2;
|
||||
|
||||
DPRINT("CsrGetObject, Object: %x, %x, %x\n",
|
||||
Object, Handle, ProcessData ? ProcessData->HandleTableSize : 0);
|
||||
|
@ -130,7 +130,7 @@ CsrReleaseObject(
|
|||
PCSRSS_PROCESS_DATA ProcessData,
|
||||
HANDLE Handle)
|
||||
{
|
||||
ULONG h = (ULONG)Handle >> 2;
|
||||
ULONG_PTR h = (ULONG_PTR)Handle >> 2;
|
||||
Object_t *Object;
|
||||
|
||||
RtlEnterCriticalSection(&ProcessData->HandleTableLock);
|
||||
|
@ -187,7 +187,7 @@ CsrInsertObject(
|
|||
ProcessData->HandleTable[i].Object = Object;
|
||||
ProcessData->HandleTable[i].Access = Access;
|
||||
ProcessData->HandleTable[i].Inheritable = Inheritable;
|
||||
*Handle = (HANDLE)((i << 2) | 0x3);
|
||||
*Handle = UlongToHandle((i << 2) | 0x3);
|
||||
_InterlockedIncrement( &Object->ReferenceCount );
|
||||
RtlLeaveCriticalSection(&ProcessData->HandleTableLock);
|
||||
return(STATUS_SUCCESS);
|
||||
|
@ -239,7 +239,7 @@ CsrVerifyObject(
|
|||
PCSRSS_PROCESS_DATA ProcessData,
|
||||
HANDLE Handle)
|
||||
{
|
||||
ULONG h = (ULONG)Handle >> 2;
|
||||
ULONG_PTR h = (ULONG_PTR)Handle >> 2;
|
||||
|
||||
if (h >= ProcessData->HandleTableSize ||
|
||||
ProcessData->HandleTable[h].Object == NULL)
|
||||
|
|
|
@ -245,7 +245,7 @@ CSR_API(CsrCreateProcess)
|
|||
|
||||
if (Request->Data.CreateProcessRequest.Flags & CREATE_NEW_PROCESS_GROUP)
|
||||
{
|
||||
NewProcessData->ProcessGroup = (DWORD)NewProcessData->ProcessId;
|
||||
NewProcessData->ProcessGroup = (DWORD)(ULONG_PTR)NewProcessData->ProcessId;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -364,14 +364,14 @@ CSR_API(CsrVerifyHandle)
|
|||
|
||||
CSR_API(CsrDuplicateHandle)
|
||||
{
|
||||
ULONG Index;
|
||||
ULONG_PTR Index;
|
||||
PCSRSS_HANDLE Entry;
|
||||
DWORD DesiredAccess;
|
||||
|
||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
||||
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
|
||||
|
||||
Index = (ULONG)Request->Data.DuplicateHandleRequest.Handle >> 2;
|
||||
Index = (ULONG_PTR)Request->Data.DuplicateHandleRequest.Handle >> 2;
|
||||
RtlEnterCriticalSection(&ProcessData->HandleTableLock);
|
||||
if (Index >= ProcessData->HandleTableSize
|
||||
|| (Entry = &ProcessData->HandleTable[Index])->Object == NULL)
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
/* GLOBALS *******************************************************************/
|
||||
|
||||
static BOOLEAN ServicesProcessIdValid = FALSE;
|
||||
static ULONG ServicesProcessId;
|
||||
static ULONG_PTR ServicesProcessId;
|
||||
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
@ -36,7 +36,7 @@ CSR_API(CsrRegisterServicesProcess)
|
|||
}
|
||||
else
|
||||
{
|
||||
ServicesProcessId = (ULONG)Request->Data.RegisterServicesProcessRequest.ProcessId;
|
||||
ServicesProcessId = (ULONG_PTR)Request->Data.RegisterServicesProcessRequest.ProcessId;
|
||||
ServicesProcessIdValid = TRUE;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -271,8 +271,8 @@ ClientConnectionThread(HANDLE ServerPort)
|
|||
}
|
||||
if (ProcessData->Terminated)
|
||||
{
|
||||
DPRINT1("Message %d: process %d already terminated\n",
|
||||
Request->Type, (ULONG)Request->Header.ClientId.UniqueProcess);
|
||||
DPRINT1("Message %d: process %p already terminated\n",
|
||||
Request->Type, Request->Header.ClientId.UniqueProcess);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ InitializeVideoAddressSpace(VOID)
|
|||
HANDLE PhysMemHandle;
|
||||
PVOID BaseAddress;
|
||||
LARGE_INTEGER Offset;
|
||||
ULONG ViewSize;
|
||||
SIZE_T ViewSize;
|
||||
CHAR IVTAndBda[1024+256];
|
||||
|
||||
/* Open the physical memory section */
|
||||
|
|
|
@ -65,7 +65,7 @@ ConioConsoleCtrlEventTimeout(DWORD Event, PCSRSS_PROCESS_DATA ProcessData, DWORD
|
|||
|
||||
Thread = CreateRemoteThread(ProcessData->Process, NULL, 0,
|
||||
(LPTHREAD_START_ROUTINE) ProcessData->CtrlDispatcher,
|
||||
(PVOID) Event, 0, NULL);
|
||||
UlongToPtr(Event), 0, NULL);
|
||||
if (NULL == Thread)
|
||||
{
|
||||
DPRINT1("Failed thread creation (Error: 0x%x)\n", GetLastError());
|
||||
|
|
|
@ -190,7 +190,7 @@ Win32CsrHardError(IN PCSRSS_PROCESS_DATA ProcessData,
|
|||
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||
ULONG nParam = 0;
|
||||
PRTL_MESSAGE_RESOURCE_ENTRY MessageResource;
|
||||
ULONG ParameterList[MAXIMUM_HARDERROR_PARAMETERS];
|
||||
ULONG_PTR ParameterList[MAXIMUM_HARDERROR_PARAMETERS];
|
||||
LPSTR CaptionText, MessageBody;
|
||||
LPWSTR szxCaptionText, szxMessageBody;
|
||||
DWORD SizeOfAllUnicodeStrings = 0;
|
||||
|
@ -330,7 +330,7 @@ Win32CsrHardError(IN PCSRSS_PROCESS_DATA ProcessData,
|
|||
ParameterStringU.MaximumLength = TempStringU.MaximumLength;
|
||||
DPRINT("ParameterStringU=\'%wZ\'\n", &ParameterStringU);
|
||||
RtlUnicodeStringToAnsiString(&ParamStringA, &ParameterStringU, TRUE);
|
||||
ParameterList[nParam] = (ULONG)ParamStringA.Buffer;
|
||||
ParameterList[nParam] = (ULONG_PTR)ParamStringA.Buffer;
|
||||
SizeOfAllUnicodeStrings += ParamStringA.MaximumLength;
|
||||
}
|
||||
}
|
||||
|
@ -345,7 +345,7 @@ Win32CsrHardError(IN PCSRSS_PROCESS_DATA ProcessData,
|
|||
// get text string of the error code
|
||||
Status = RtlFindMessage(
|
||||
(PVOID)GetModuleHandle(TEXT("ntdll")),
|
||||
(ULONG)RT_MESSAGETABLE,
|
||||
(ULONG_PTR)RT_MESSAGETABLE,
|
||||
LANG_NEUTRAL,
|
||||
HardErrorMessage->Status,
|
||||
&MessageResource );
|
||||
|
@ -412,7 +412,7 @@ Win32CsrHardError(IN PCSRSS_PROCESS_DATA ProcessData,
|
|||
MessageBody = NULL;
|
||||
Status = RtlFindMessage(
|
||||
(PVOID)GetModuleHandle(TEXT("ntdll")),
|
||||
(ULONG)RT_MESSAGETABLE,
|
||||
(ULONG_PTR)RT_MESSAGETABLE,
|
||||
LANG_NEUTRAL,
|
||||
ParameterList[0],
|
||||
&MsgResException);
|
||||
|
|
|
@ -57,7 +57,7 @@ CSR_API(CsrSetLogonNotifyWindow)
|
|||
DPRINT1("Can't get window creator\n");
|
||||
return STATUS_INVALID_HANDLE;
|
||||
}
|
||||
if (WindowCreator != (DWORD)LogonProcess)
|
||||
if (WindowCreator != (DWORD_PTR)LogonProcess)
|
||||
{
|
||||
DPRINT1("Trying to register window not created by winlogon as notify window\n");
|
||||
return STATUS_ACCESS_DENIED;
|
||||
|
@ -481,7 +481,7 @@ NotifyAndTerminateProcess(PCSRSS_PROCESS_DATA ProcessData,
|
|||
}
|
||||
else
|
||||
{
|
||||
Context.ProcessId = (DWORD) ProcessData->ProcessId;
|
||||
Context.ProcessId = (DWORD_PTR) ProcessData->ProcessId;
|
||||
Context.wParam = 0;
|
||||
Context.lParam = (0 != (Flags & EWX_INTERNAL_FLAG_LOGOFF) ?
|
||||
ENDSESSION_LOGOFF : 0);
|
||||
|
@ -527,7 +527,7 @@ NotifyAndTerminateProcess(PCSRSS_PROCESS_DATA ProcessData,
|
|||
|
||||
/* Terminate this process */
|
||||
Process = OpenProcess(PROCESS_TERMINATE, FALSE,
|
||||
(DWORD) ProcessData->ProcessId);
|
||||
(DWORD_PTR) ProcessData->ProcessId);
|
||||
if (NULL == Process)
|
||||
{
|
||||
DPRINT1("Unable to open process %d, error %d\n", ProcessData->ProcessId,
|
||||
|
@ -560,7 +560,7 @@ ExitReactosProcessEnum(PCSRSS_PROCESS_DATA ProcessData, PVOID Data)
|
|||
PCSRSS_PROCESS_DATA *NewData;
|
||||
|
||||
/* Do not kill winlogon or csrss */
|
||||
if ((DWORD) ProcessData->ProcessId == Context->CsrssProcess ||
|
||||
if ((DWORD_PTR) ProcessData->ProcessId == Context->CsrssProcess ||
|
||||
ProcessData->ProcessId == LogonProcess)
|
||||
{
|
||||
return STATUS_SUCCESS;
|
||||
|
@ -568,7 +568,7 @@ ExitReactosProcessEnum(PCSRSS_PROCESS_DATA ProcessData, PVOID Data)
|
|||
|
||||
/* Get the login session of this process */
|
||||
Process = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE,
|
||||
(DWORD) ProcessData->ProcessId);
|
||||
(DWORD_PTR) ProcessData->ProcessId);
|
||||
if (NULL == Process)
|
||||
{
|
||||
DPRINT1("Unable to open process %d, error %d\n", ProcessData->ProcessId,
|
||||
|
@ -600,7 +600,7 @@ ExitReactosProcessEnum(PCSRSS_PROCESS_DATA ProcessData, PVOID Data)
|
|||
&(Origin.OriginatingLogonSession)))
|
||||
{
|
||||
/* Kill the shell process last */
|
||||
if ((DWORD) ProcessData->ProcessId == Context->ShellProcess)
|
||||
if ((DWORD_PTR) ProcessData->ProcessId == Context->ShellProcess)
|
||||
{
|
||||
ProcessData->ShutdownLevel = 0;
|
||||
}
|
||||
|
@ -767,7 +767,7 @@ InternalExitReactos(DWORD ProcessId, DWORD ThreadId, UINT Flags)
|
|||
TOKEN_USER *UserInfo;
|
||||
SHUTDOWN_SETTINGS ShutdownSettings;
|
||||
|
||||
if (ProcessId != (DWORD) LogonProcess)
|
||||
if (ProcessId != (DWORD_PTR) LogonProcess)
|
||||
{
|
||||
DPRINT1("Internal ExitWindowsEx call not from winlogon\n");
|
||||
return STATUS_ACCESS_DENIED;
|
||||
|
@ -928,13 +928,13 @@ CSR_API(CsrExitReactos)
|
|||
|
||||
if (0 == (Request->Data.ExitReactosRequest.Flags & EWX_INTERNAL_FLAG))
|
||||
{
|
||||
return UserExitReactos((DWORD) Request->Header.ClientId.UniqueProcess,
|
||||
return UserExitReactos((DWORD_PTR) Request->Header.ClientId.UniqueProcess,
|
||||
Request->Data.ExitReactosRequest.Flags);
|
||||
}
|
||||
else
|
||||
{
|
||||
return InternalExitReactos((DWORD) Request->Header.ClientId.UniqueProcess,
|
||||
(DWORD) Request->Header.ClientId.UniqueThread,
|
||||
return InternalExitReactos((DWORD_PTR) Request->Header.ClientId.UniqueProcess,
|
||||
(DWORD_PTR) Request->Header.ClientId.UniqueThread,
|
||||
Request->Data.ExitReactosRequest.Flags);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
; $Id$
|
||||
;
|
||||
|
||||
LIBRARY win32csr.dll
|
||||
|
||||
EXPORTS
|
||||
|
||||
Win32CsrInitialization@24
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE module SYSTEM "../../../../tools/rbuild/project.dtd">
|
||||
<module name="win32csr" type="win32dll" installbase="system32" installname="win32csr.dll">
|
||||
<importlibrary definition="win32csr.def" />
|
||||
<importlibrary definition="win32csr.spec" />
|
||||
<include base="win32csr">.</include>
|
||||
<include base="csrss">include</include>
|
||||
<include base="ReactOS">include/reactos/subsys</include>
|
||||
|
|
1
reactos/subsystems/win32/csrss/win32csr/win32csr.spec
Normal file
1
reactos/subsystems/win32/csrss/win32csr/win32csr.spec
Normal file
|
@ -0,0 +1 @@
|
|||
@ stdcall Win32CsrInitialization(ptr ptr ptr ptr ptr ptr)
|
Loading…
Reference in a new issue