Author: jmorlan
Date: Sun May 23 02:51:29 2010
New Revision: 47315
URL:
http://svn.reactos.org/svn/reactos?rev=47315&view=rev
Log:
[WIN32CSR] Clean up the debris from r47314: Removed some redundant code, reorganized
headers, fixed win32csr.rbuild indentation
Added:
trunk/reactos/subsystems/win32/csrss/win32csr/desktopbg.h
- copied unchanged from r47308,
trunk/reactos/subsystems/win32/csrss/include/desktopbg.h
Removed:
trunk/reactos/subsystems/win32/csrss/include/desktopbg.h
Modified:
trunk/reactos/subsystems/win32/csrss/csrsrv/srv.h
trunk/reactos/subsystems/win32/csrss/include/api.h
trunk/reactos/subsystems/win32/csrss/win32csr/conio.h
trunk/reactos/subsystems/win32/csrss/win32csr/dllmain.c
trunk/reactos/subsystems/win32/csrss/win32csr/handle.c
trunk/reactos/subsystems/win32/csrss/win32csr/win32csr.h
trunk/reactos/subsystems/win32/csrss/win32csr/win32csr.rbuild
Modified: trunk/reactos/subsystems/win32/csrss/csrsrv/srv.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/csr…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/csrsrv/srv.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/csrsrv/srv.h [iso-8859-1] Sun May 23 02:51:29
2010
@@ -17,5 +17,4 @@
/* Internal CSRSS Headers */
#include <api.h>
-#include <conio.h>
#include <csrplugin.h>
Modified: trunk/reactos/subsystems/win32/csrss/include/api.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/inc…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/include/api.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/include/api.h [iso-8859-1] Sun May 23 02:51:29
2010
@@ -44,31 +44,6 @@
CsrProcessIsConsoleApp = 0x800
} CSR_PROCESS_FLAGS, *PCSR_PROCESS_FLAGS;
-typedef struct Object_tt
-{
- LONG Type;
- LONG ReferenceCount;
- CRITICAL_SECTION Lock;
-} Object_t;
-
-typedef struct ConsoleInput_t
-{
- LIST_ENTRY ListEntry;
- INPUT_RECORD InputEvent;
- BOOLEAN Echoed; // already been echoed or not
- BOOLEAN Fake; // synthesized, not a real event
- BOOLEAN NotChar; // message should not be used to return a character
-} ConsoleInput;
-
-typedef struct tagCSRSS_CONSOLE *PCSRSS_CONSOLE;
-
-typedef struct _CSRSS_HANDLE
-{
- Object_t *Object;
- DWORD Access;
- BOOL Inheritable;
-} CSRSS_HANDLE, *PCSRSS_HANDLE;
-
typedef struct _CSRSS_PROCESS_DATA
{
struct tagCSRSS_CONSOLE *Console;
@@ -76,7 +51,7 @@
BOOL bInheritHandles;
RTL_CRITICAL_SECTION HandleTableLock;
ULONG HandleTableSize;
- PCSRSS_HANDLE HandleTable;
+ struct _CSRSS_HANDLE *HandleTable;
HANDLE ProcessId;
DWORD ProcessGroup;
HANDLE Process;
@@ -109,14 +84,6 @@
ULONG ImpersonationCount;
} CSR_THREAD, *PCSR_THREAD;
-typedef VOID (WINAPI *CSR_CLEANUP_OBJECT_PROC)(Object_t *Object);
-
-typedef struct tagCSRSS_OBJECT_DEFINITION
-{
- LONG Type;
- CSR_CLEANUP_OBJECT_PROC CsrCleanupObjectProc;
-} CSRSS_OBJECT_DEFINITION, *PCSRSS_OBJECT_DEFINITION;
-
typedef NTSTATUS (WINAPI *CSRSS_API_PROC)(PCSRSS_PROCESS_DATA ProcessData,
PCSR_API_MESSAGE Request);
@@ -143,32 +110,24 @@
/* init.c */
extern HANDLE hBootstrapOk;
+NTSTATUS NTAPI CsrServerInitialization(ULONG ArgumentCount, PCHAR Arguments[]);
/* api/process.c */
CSR_API(CsrConnectProcess);
CSR_API(CsrCreateProcess);
CSR_API(CsrTerminateProcess);
CSR_API(CsrSrvCreateThread);
-
-/* print.c */
-VOID WINAPI DisplayString(LPCWSTR lpwString);
-VOID WINAPI PrintString (char* fmt, ...);
+CSR_API(CsrGetShutdownParameters);
+CSR_API(CsrSetShutdownParameters);
/* api/wapi.c */
NTSTATUS FASTCALL CsrApiRegisterDefinitions(PCSRSS_API_DEFINITION NewDefinitions);
VOID FASTCALL CsrApiCallHandler(PCSRSS_PROCESS_DATA ProcessData,
PCSR_API_MESSAGE Request);
-DWORD WINAPI ServerApiPortThread (PVOID PortHandle);
DWORD WINAPI ServerSbApiPortThread (PVOID PortHandle);
-DWORD WINAPI Console_Api( PVOID unused );
-VOID
-NTAPI
-ClientConnectionThread(HANDLE ServerPort);
+VOID NTAPI ClientConnectionThread(HANDLE ServerPort);
extern HANDLE CsrssApiHeap;
-
-/* api/conio.c */
-VOID WINAPI CsrInitConsoleSupport(VOID);
/* api/process.c */
typedef NTSTATUS (WINAPI *CSRSS_ENUM_PROCESS_PROC)(PCSRSS_PROCESS_DATA ProcessData,
@@ -185,34 +144,10 @@
NTSTATUS NTAPI CsrCreateThread(IN PCSRSS_PROCESS_DATA CsrProcess, IN HANDLE hThread, IN
PCLIENT_ID ClientId);
NTSTATUS NTAPI CsrUnlockProcess(IN PCSRSS_PROCESS_DATA CsrProcess);
-/* api/handle.c */
-NTSTATUS FASTCALL CsrRegisterObjectDefinitions(PCSRSS_OBJECT_DEFINITION NewDefinitions);
-NTSTATUS WINAPI CsrInsertObject( PCSRSS_PROCESS_DATA ProcessData, PHANDLE Handle,
Object_t *Object, DWORD Access, BOOL Inheritable );
-NTSTATUS WINAPI CsrDuplicateHandleTable(PCSRSS_PROCESS_DATA SourceProcessData,
PCSRSS_PROCESS_DATA TargetProcessData);
-NTSTATUS WINAPI CsrGetObject( PCSRSS_PROCESS_DATA ProcessData, HANDLE Handle, Object_t
**Object, DWORD Access );
-NTSTATUS NTAPI CsrServerInitialization(ULONG ArgumentCount, PCHAR Arguments[]);
-NTSTATUS WINAPI CsrReleaseObjectByPointer(Object_t *Object);
-NTSTATUS WINAPI CsrReleaseObject( PCSRSS_PROCESS_DATA ProcessData, HANDLE Object );
-NTSTATUS WINAPI CsrReleaseConsole(PCSRSS_PROCESS_DATA ProcessData);
-NTSTATUS WINAPI CsrVerifyObject( PCSRSS_PROCESS_DATA ProcessData, HANDLE Object );
-
//hack
VOID NTAPI CsrThreadRefcountZero(IN PCSR_THREAD CsrThread);
-CSR_API(CsrGetInputHandle);
-CSR_API(CsrGetOutputHandle);
-CSR_API(CsrCloseHandle);
-CSR_API(CsrVerifyHandle);
-CSR_API(CsrDuplicateHandle);
-CSR_API(CsrGetInputWaitHandle);
-
/* api/user.c */
CSR_API(CsrRegisterServicesProcess);
-CSR_API(CsrExitReactos);
-CSR_API(CsrGetShutdownParameters);
-CSR_API(CsrSetShutdownParameters);
-
-CSR_API(CsrSetLogonNotifyWindow);
-CSR_API(CsrRegisterLogonProcess);
/* EOF */
Removed: trunk/reactos/subsystems/win32/csrss/include/desktopbg.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/inc…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/include/desktopbg.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/include/desktopbg.h (removed)
@@ -1,21 +1,0 @@
-/* $Id$
- *
- * COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS system libraries
- * FILE: subsys/csrss/include/destkopbg.h
- * PURPOSE: CSRSS internal desktop background window interface
- */
-
-#pragma once
-
-#include "api.h"
-
-/* Api functions */
-CSR_API(CsrCreateDesktop);
-CSR_API(CsrShowDesktop);
-CSR_API(CsrHideDesktop);
-CSR_API(CsrRegisterSystemClasses);
-
-BOOL FASTCALL DtbgIsDesktopVisible(VOID);
-
-/* EOF */
Modified: trunk/reactos/subsystems/win32/csrss/win32csr/conio.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/win32csr/conio.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/win32csr/conio.h [iso-8859-1] Sun May 23 02:51:29
2010
@@ -48,6 +48,8 @@
USHORT Mode;
} CSRSS_SCREEN_BUFFER, *PCSRSS_SCREEN_BUFFER;
+typedef struct tagCSRSS_CONSOLE *PCSRSS_CONSOLE;
+
typedef struct tagCSRSS_CONSOLE_VTBL
{
VOID (WINAPI *InitScreenBuffer)(PCSRSS_CONSOLE Console, PCSRSS_SCREEN_BUFFER
ScreenBuffer);
@@ -88,9 +90,19 @@
struct tagALIAS_HEADER *Aliases;
} CSRSS_CONSOLE;
+typedef struct ConsoleInput_t
+{
+ LIST_ENTRY ListEntry;
+ INPUT_RECORD InputEvent;
+ BOOLEAN Echoed; // already been echoed or not
+ BOOLEAN Fake; // synthesized, not a real event
+ BOOLEAN NotChar; // message should not be used to return a character
+} ConsoleInput;
+
NTSTATUS FASTCALL ConioConsoleFromProcessData(PCSRSS_PROCESS_DATA ProcessData,
PCSRSS_CONSOLE *Console);
VOID WINAPI ConioDeleteConsole(Object_t *Object);
VOID WINAPI ConioDeleteScreenBuffer(Object_t *Buffer);
+VOID WINAPI CsrInitConsoleSupport(VOID);
void WINAPI ConioProcessKey(MSG *msg, PCSRSS_CONSOLE Console, BOOL TextMode);
PBYTE FASTCALL ConioCoordToPointer(PCSRSS_SCREEN_BUFFER Buf, ULONG X, ULONG Y);
VOID FASTCALL ConioDrawConsole(PCSRSS_CONSOLE Console);
Modified: trunk/reactos/subsystems/win32/csrss/win32csr/dllmain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/win32csr/dllmain.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/win32csr/dllmain.c [iso-8859-1] Sun May 23
02:51:29 2010
@@ -84,13 +84,6 @@
{ 0, 0, NULL }
};
-static CSRSS_OBJECT_DEFINITION Win32CsrObjectDefinitions[] =
- {
- { CONIO_CONSOLE_MAGIC, ConioDeleteConsole },
- { CONIO_SCREEN_BUFFER_MAGIC, ConioDeleteScreenBuffer },
- { 0, NULL }
- };
-
/* FUNCTIONS *****************************************************************/
BOOL WINAPI
@@ -105,77 +98,6 @@
}
return TRUE;
-}
-
-NTSTATUS FASTCALL
-Win32CsrInsertObject(PCSRSS_PROCESS_DATA ProcessData,
- PHANDLE Handle,
- Object_t *Object,
- DWORD Access,
- BOOL Inheritable)
-{
- return CsrInsertObject(ProcessData, Handle, Object, Access, Inheritable);
-}
-
-NTSTATUS FASTCALL
-Win32CsrGetObject(PCSRSS_PROCESS_DATA ProcessData,
- HANDLE Handle,
- Object_t **Object,
- DWORD Access)
-{
- return CsrGetObject(ProcessData, Handle, Object, Access);
-}
-
-NTSTATUS FASTCALL
-Win32CsrLockObject(PCSRSS_PROCESS_DATA ProcessData,
- HANDLE Handle,
- Object_t **Object,
- DWORD Access,
- LONG Type)
-{
- NTSTATUS Status;
-
- Status = CsrGetObject(ProcessData, Handle, Object, Access);
- if (! NT_SUCCESS(Status))
- {
- return Status;
- }
-
- if ((*Object)->Type != Type)
- {
- CsrReleaseObjectByPointer(*Object);
- return STATUS_INVALID_HANDLE;
- }
-
- EnterCriticalSection(&((*Object)->Lock));
-
- return STATUS_SUCCESS;
-}
-
-VOID FASTCALL
-Win32CsrUnlockObject(Object_t *Object)
-{
- LeaveCriticalSection(&(Object->Lock));
- CsrReleaseObjectByPointer(Object);
-}
-
-NTSTATUS FASTCALL
-Win32CsrReleaseObjectByPointer(Object_t *Object)
-{
- return CsrReleaseObjectByPointer(Object);
-}
-
-NTSTATUS FASTCALL
-Win32CsrReleaseObject(PCSRSS_PROCESS_DATA ProcessData,
- HANDLE Object)
-{
- return CsrReleaseObject(ProcessData, Object);
-}
-
-NTSTATUS FASTCALL
-Win32CsrReleaseConsole(PCSRSS_PROCESS_DATA ProcessData)
-{
- return CsrReleaseConsole(ProcessData);
}
NTSTATUS FASTCALL
@@ -207,13 +129,12 @@
PrivateCsrssManualGuiCheck(0);
CsrInitConsoleSupport();
- CsrRegisterObjectDefinitions(Win32CsrObjectDefinitions);
*ApiDefinitions = Win32CsrApiDefinitions;
ServerProcs->InitCompleteProc = Win32CsrInitComplete;
ServerProcs->HardErrorProc = Win32CsrHardError;
- ServerProcs->ProcessInheritProc = CsrDuplicateHandleTable;
- ServerProcs->ProcessDeletedProc = CsrReleaseConsole;
+ ServerProcs->ProcessInheritProc = Win32CsrDuplicateHandleTable;
+ ServerProcs->ProcessDeletedProc = Win32CsrReleaseConsole;
return TRUE;
}
Modified: trunk/reactos/subsystems/win32/csrss/win32csr/handle.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/win32csr/handle.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/win32csr/handle.c [iso-8859-1] Sun May 23
02:51:29 2010
@@ -16,8 +16,12 @@
/* FUNCTIONS *****************************************************************/
-static unsigned ObjectDefinitionsCount = 0;
-static PCSRSS_OBJECT_DEFINITION ObjectDefinitions = NULL;
+static unsigned ObjectDefinitionsCount = 2;
+static CSRSS_OBJECT_DEFINITION ObjectDefinitions[] =
+{
+ { CONIO_CONSOLE_MAGIC, ConioDeleteConsole },
+ { CONIO_SCREEN_BUFFER_MAGIC, ConioDeleteScreenBuffer },
+};
static
BOOL
@@ -26,52 +30,9 @@
return ((ULONG_PTR)Handle & 0x10000003) == 0x3;
}
-
-NTSTATUS
-FASTCALL
-CsrRegisterObjectDefinitions(
- PCSRSS_OBJECT_DEFINITION NewDefinitions)
-{
- unsigned NewCount;
- PCSRSS_OBJECT_DEFINITION Scan;
- PCSRSS_OBJECT_DEFINITION New;
-
- NewCount = 0;
- for (Scan = NewDefinitions; 0 != Scan->Type; Scan++)
- {
- NewCount++;
- }
-
- New = RtlAllocateHeap(Win32CsrApiHeap,
- 0,
- (ObjectDefinitionsCount + NewCount)
- * sizeof(CSRSS_OBJECT_DEFINITION));
- if (NULL == New)
- {
- DPRINT1("Unable to allocate memory\n");
- return STATUS_NO_MEMORY;
- }
-
- if (0 != ObjectDefinitionsCount)
- {
- RtlCopyMemory(New,
- ObjectDefinitions,
- ObjectDefinitionsCount * sizeof(CSRSS_OBJECT_DEFINITION));
- RtlFreeHeap(Win32CsrApiHeap, 0, ObjectDefinitions);
- }
-
- RtlCopyMemory(New + ObjectDefinitionsCount,
- NewDefinitions,
- NewCount * sizeof(CSRSS_OBJECT_DEFINITION));
- ObjectDefinitions = New;
- ObjectDefinitionsCount += NewCount;
-
- return STATUS_SUCCESS;
-}
-
-NTSTATUS
-WINAPI
-CsrGetObject(
+NTSTATUS
+FASTCALL
+Win32CsrGetObject(
PCSRSS_PROCESS_DATA ProcessData,
HANDLE Handle,
Object_t **Object,
@@ -99,8 +60,8 @@
NTSTATUS
-WINAPI
-CsrReleaseObjectByPointer(
+FASTCALL
+Win32CsrReleaseObjectByPointer(
Object_t *Object)
{
unsigned DefIndex;
@@ -123,10 +84,9 @@
return STATUS_SUCCESS;
}
-
-NTSTATUS
-WINAPI
-CsrReleaseObject(
+NTSTATUS
+FASTCALL
+Win32CsrReleaseObject(
PCSRSS_PROCESS_DATA ProcessData,
HANDLE Handle)
{
@@ -143,12 +103,47 @@
ProcessData->HandleTable[h].Object = NULL;
RtlLeaveCriticalSection(&ProcessData->HandleTableLock);
- return CsrReleaseObjectByPointer(Object);
+ return Win32CsrReleaseObjectByPointer(Object);
+}
+
+NTSTATUS
+FASTCALL
+Win32CsrLockObject(PCSRSS_PROCESS_DATA ProcessData,
+ HANDLE Handle,
+ Object_t **Object,
+ DWORD Access,
+ LONG Type)
+{
+ NTSTATUS Status;
+
+ Status = Win32CsrGetObject(ProcessData, Handle, Object, Access);
+ if (! NT_SUCCESS(Status))
+ {
+ return Status;
+ }
+
+ if ((*Object)->Type != Type)
+ {
+ Win32CsrReleaseObjectByPointer(*Object);
+ return STATUS_INVALID_HANDLE;
+ }
+
+ EnterCriticalSection(&((*Object)->Lock));
+
+ return STATUS_SUCCESS;
+}
+
+VOID
+FASTCALL
+Win32CsrUnlockObject(Object_t *Object)
+{
+ LeaveCriticalSection(&(Object->Lock));
+ Win32CsrReleaseObjectByPointer(Object);
}
NTSTATUS
WINAPI
-CsrReleaseConsole(
+Win32CsrReleaseConsole(
PCSRSS_PROCESS_DATA ProcessData)
{
ULONG HandleTableSize;
@@ -169,16 +164,16 @@
for (i = 0; i < HandleTableSize; i++)
{
if (HandleTable[i].Object != NULL)
- CsrReleaseObjectByPointer(HandleTable[i].Object);
+ Win32CsrReleaseObjectByPointer(HandleTable[i].Object);
}
RtlFreeHeap(Win32CsrApiHeap, 0, HandleTable);
if (Console != NULL)
{
- RtlEnterCriticalSection((PRTL_CRITICAL_SECTION)&Console->Header.Lock);
+ EnterCriticalSection(&Console->Header.Lock);
RemoveEntryList(&ProcessData->ProcessEntry);
- RtlLeaveCriticalSection((PRTL_CRITICAL_SECTION)&Console->Header.Lock);
- CsrReleaseObjectByPointer(&Console->Header);
+ LeaveCriticalSection(&Console->Header.Lock);
+ Win32CsrReleaseObjectByPointer(&Console->Header);
return STATUS_SUCCESS;
}
@@ -186,8 +181,8 @@
}
NTSTATUS
-WINAPI
-CsrInsertObject(
+FASTCALL
+Win32CsrInsertObject(
PCSRSS_PROCESS_DATA ProcessData,
PHANDLE Handle,
Object_t *Object,
@@ -195,7 +190,7 @@
BOOL Inheritable)
{
ULONG i;
- PVOID* Block;
+ PCSRSS_HANDLE Block;
RtlEnterCriticalSection(&ProcessData->HandleTableLock);
@@ -219,8 +214,8 @@
RtlCopyMemory(Block,
ProcessData->HandleTable,
ProcessData->HandleTableSize * sizeof(CSRSS_HANDLE));
- Block = _InterlockedExchangePointer((void*
volatile)&ProcessData->HandleTable, Block);
- RtlFreeHeap( Win32CsrApiHeap, 0, Block );
+ RtlFreeHeap(Win32CsrApiHeap, 0, ProcessData->HandleTable);
+ ProcessData->HandleTable = Block;
ProcessData->HandleTableSize += 64;
}
ProcessData->HandleTable[i].Object = Object;
@@ -234,7 +229,7 @@
NTSTATUS
WINAPI
-CsrDuplicateHandleTable(
+Win32CsrDuplicateHandleTable(
PCSRSS_PROCESS_DATA SourceProcessData,
PCSRSS_PROCESS_DATA TargetProcessData)
{
@@ -272,23 +267,6 @@
return(STATUS_SUCCESS);
}
-NTSTATUS
-WINAPI
-CsrVerifyObject(
- PCSRSS_PROCESS_DATA ProcessData,
- HANDLE Handle)
-{
- ULONG_PTR h = (ULONG_PTR)Handle >> 2;
-
- if (h >= ProcessData->HandleTableSize ||
- ProcessData->HandleTable[h].Object == NULL)
- {
- return STATUS_INVALID_HANDLE;
- }
-
- return STATUS_SUCCESS;
-}
-
CSR_API(CsrGetInputHandle)
{
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
@@ -296,11 +274,11 @@
if (ProcessData->Console)
{
- Request->Status = CsrInsertObject(ProcessData,
-
&Request->Data.GetInputHandleRequest.InputHandle,
- (Object_t *)ProcessData->Console,
- Request->Data.GetInputHandleRequest.Access,
-
Request->Data.GetInputHandleRequest.Inheritable);
+ Request->Status = Win32CsrInsertObject(ProcessData,
+
&Request->Data.GetInputHandleRequest.InputHandle,
+ &ProcessData->Console->Header,
+
Request->Data.GetInputHandleRequest.Access,
+
Request->Data.GetInputHandleRequest.Inheritable);
}
else
{
@@ -318,11 +296,11 @@
if (ProcessData->Console)
{
- Request->Status = CsrInsertObject(ProcessData,
-
&Request->Data.GetOutputHandleRequest.OutputHandle,
-
&ProcessData->Console->ActiveBuffer->Header,
-
Request->Data.GetOutputHandleRequest.Access,
-
Request->Data.GetOutputHandleRequest.Inheritable);
+ Request->Status = Win32CsrInsertObject(ProcessData,
+
&Request->Data.GetOutputHandleRequest.OutputHandle,
+
&ProcessData->Console->ActiveBuffer->Header,
+
Request->Data.GetOutputHandleRequest.Access,
+
Request->Data.GetOutputHandleRequest.Inheritable);
}
else
{
@@ -338,21 +316,28 @@
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) -
sizeof(PORT_MESSAGE);
- return CsrReleaseObject(ProcessData, Request->Data.CloseHandleRequest.Handle);
+ return Win32CsrReleaseObject(ProcessData,
Request->Data.CloseHandleRequest.Handle);
}
CSR_API(CsrVerifyHandle)
{
- Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
- Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) -
sizeof(PORT_MESSAGE);
-
- Request->Status = CsrVerifyObject(ProcessData,
Request->Data.VerifyHandleRequest.Handle);
- if (!NT_SUCCESS(Request->Status))
- {
- DPRINT("CsrVerifyObject failed, status=%x\n", Request->Status);
- }
-
- return Request->Status;
+ ULONG_PTR Index;
+ NTSTATUS Status = STATUS_SUCCESS;
+
+ Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+ Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) -
sizeof(PORT_MESSAGE);
+
+ Index = (ULONG_PTR)Request->Data.VerifyHandleRequest.Handle >> 2;
+ RtlEnterCriticalSection(&ProcessData->HandleTableLock);
+ if (Index >= ProcessData->HandleTableSize ||
+ ProcessData->HandleTable[Index].Object == NULL)
+ {
+ DPRINT("CsrVerifyObject failed\n");
+ Status = STATUS_INVALID_HANDLE;
+ }
+ RtlLeaveCriticalSection(&ProcessData->HandleTableLock);
+
+ return Status;
}
CSR_API(CsrDuplicateHandle)
@@ -391,11 +376,11 @@
}
}
- Request->Status = CsrInsertObject(ProcessData,
-
&Request->Data.DuplicateHandleRequest.Handle,
- Entry->Object,
- DesiredAccess,
-
Request->Data.DuplicateHandleRequest.Inheritable);
+ Request->Status = Win32CsrInsertObject(ProcessData,
+
&Request->Data.DuplicateHandleRequest.Handle,
+ Entry->Object,
+ DesiredAccess,
+
Request->Data.DuplicateHandleRequest.Inheritable);
if (NT_SUCCESS(Request->Status)
&& Request->Data.DuplicateHandleRequest.Options &
DUPLICATE_CLOSE_SOURCE)
{
Modified: trunk/reactos/subsystems/win32/csrss/win32csr/win32csr.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/win32csr/win32csr.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/win32csr/win32csr.h [iso-8859-1] Sun May 23
02:51:29 2010
@@ -14,6 +14,29 @@
extern HANDLE Win32CsrApiHeap;
extern HINSTANCE Win32CsrDllHandle;
+typedef struct Object_tt
+{
+ LONG Type;
+ LONG ReferenceCount;
+ CRITICAL_SECTION Lock;
+} Object_t;
+
+typedef struct _CSRSS_HANDLE
+{
+ Object_t *Object;
+ DWORD Access;
+ BOOL Inheritable;
+} CSRSS_HANDLE, *PCSRSS_HANDLE;
+
+typedef VOID (WINAPI *CSR_CLEANUP_OBJECT_PROC)(Object_t *Object);
+
+typedef struct tagCSRSS_OBJECT_DEFINITION
+{
+ LONG Type;
+ CSR_CLEANUP_OBJECT_PROC CsrCleanupObjectProc;
+} CSRSS_OBJECT_DEFINITION, *PCSRSS_OBJECT_DEFINITION;
+
+/* handle.c */
NTSTATUS FASTCALL Win32CsrInsertObject(PCSRSS_PROCESS_DATA ProcessData,
PHANDLE Handle,
Object_t *Object,
@@ -25,7 +48,6 @@
DWORD Access,
long Type);
VOID FASTCALL Win32CsrUnlockObject(Object_t *Object);
-
NTSTATUS FASTCALL Win32CsrGetObject(PCSRSS_PROCESS_DATA ProcessData,
HANDLE Handle,
Object_t **Object,
@@ -33,8 +55,23 @@
NTSTATUS FASTCALL Win32CsrReleaseObjectByPointer(Object_t *Object);
NTSTATUS FASTCALL Win32CsrReleaseObject(PCSRSS_PROCESS_DATA ProcessData,
HANDLE Object);
-NTSTATUS FASTCALL Win32CsrReleaseConsole(PCSRSS_PROCESS_DATA ProcessData);
+NTSTATUS WINAPI Win32CsrReleaseConsole(PCSRSS_PROCESS_DATA ProcessData);
+NTSTATUS WINAPI Win32CsrDuplicateHandleTable(PCSRSS_PROCESS_DATA SourceProcessData,
+ PCSRSS_PROCESS_DATA TargetProcessData);
+CSR_API(CsrGetInputHandle);
+CSR_API(CsrGetOutputHandle);
+CSR_API(CsrCloseHandle);
+CSR_API(CsrVerifyHandle);
+CSR_API(CsrDuplicateHandle);
+CSR_API(CsrGetInputWaitHandle);
+
NTSTATUS FASTCALL Win32CsrEnumProcesses(CSRSS_ENUM_PROCESS_PROC EnumProc,
PVOID Context);
+/* exitros.c */
+CSR_API(CsrExitReactos);
+CSR_API(CsrSetLogonNotifyWindow);
+CSR_API(CsrRegisterLogonProcess);
+
+
/* EOF */
Modified: trunk/reactos/subsystems/win32/csrss/win32csr/win32csr.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/win32csr/win32csr.rbuild [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/win32csr/win32csr.rbuild [iso-8859-1] Sun May 23
02:51:29 2010
@@ -22,7 +22,7 @@
<file>dllmain.c</file>
<file>exitros.c</file>
<file>guiconsole.c</file>
- <file>handle.c</file>
+ <file>handle.c</file>
<file>harderror.c</file>
<file>tuiconsole.c</file>
<file>appswitch.c</file>