Author: hbelusca
Date: Wed Nov 7 22:23:36 2012
New Revision: 57689
URL:
http://svn.reactos.org/svn/reactos?rev=57689&view=rev
Log:
[CONSRV]
- Use the DLL instance for getting its win23 resources.
- Use the CONSOLE_PROCESS_DATA structure (see r57686) for accessing console-specific
fields of the processes (instead of using them implemented in the CSR_PROCESS structure).
- Win32CsrDuplicateHandleTable --> ConsoleNewProcess since it's the callback
function called when a new process is created, and start to move some hacks currently
present in BaseSrvCreateProcess.
TODO: suppress the starting-application-related hacks in BaseSrvCreateProcess (in
basesrv).
Modified:
branches/ros-csrss/win32ss/user/consrv/guiconsole.c
branches/ros-csrss/win32ss/user/consrv/handle.c
branches/ros-csrss/win32ss/user/consrv/lineinput.c
Modified: branches/ros-csrss/win32ss/user/consrv/guiconsole.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/g…
==============================================================================
--- branches/ros-csrss/win32ss/user/consrv/guiconsole.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/consrv/guiconsole.c [iso-8859-1] Wed Nov 7 22:23:36
2012
@@ -130,13 +130,12 @@
UINT i = 0;
WCHAR szMenuString[255];
HMENU hSubMenu;
- HINSTANCE hInst = GetModuleHandleW(L"win32csr");
do
{
if (Items[i].uID != (UINT)-1)
{
- if (LoadStringW(hInst,
+ if (LoadStringW(ConSrvDllInstance,
Items[i].uID,
szMenuString,
sizeof(szMenuString) / sizeof(szMenuString[0])) > 0)
@@ -406,15 +405,16 @@
GuiConsoleWriteUserSettings(PCSRSS_CONSOLE Console, PGUI_CONSOLE_DATA GuiData)
{
HKEY hKey;
- PCSR_PROCESS ProcessData;
+ PCONSOLE_PROCESS_DATA ProcessData;
if (Console->ProcessList.Flink == &Console->ProcessList)
{
DPRINT("GuiConsoleWriteUserSettings: No Process!!!\n");
return;
}
- ProcessData = CONTAINING_RECORD(Console->ProcessList.Flink, CSR_PROCESS,
ConsoleLink);
- if (!GuiConsoleOpenUserSettings(GuiData,
PtrToUlong(ProcessData->ClientId.UniqueProcess), &hKey, KEY_READ | KEY_WRITE,
TRUE))
+
+ ProcessData = CONTAINING_RECORD(Console->ProcessList.Flink, CONSOLE_PROCESS_DATA,
ConsoleLink);
+ if (!GuiConsoleOpenUserSettings(GuiData,
PtrToUlong(ProcessData->Process->ClientId.UniqueProcess), &hKey, KEY_READ |
KEY_WRITE, TRUE))
{
return;
}
@@ -703,7 +703,7 @@
HFONT OldFont;
TEXTMETRICW Metrics;
SIZE CharSize;
- PCSR_PROCESS ProcessData;
+ PCONSOLE_PROCESS_DATA ProcessData;
HKEY hKey;
Console->hWindow = hWnd;
@@ -717,8 +717,8 @@
GuiConsoleUseDefaults(Console, GuiData, Console->ActiveBuffer);
if (Console->ProcessList.Flink != &Console->ProcessList)
{
- ProcessData = CONTAINING_RECORD(Console->ProcessList.Flink, CSR_PROCESS,
ConsoleLink);
- if (GuiConsoleOpenUserSettings(GuiData,
PtrToUlong(ProcessData->ClientId.UniqueProcess), &hKey, KEY_READ, FALSE))
+ ProcessData = CONTAINING_RECORD(Console->ProcessList.Flink,
CONSOLE_PROCESS_DATA, ConsoleLink);
+ if (GuiConsoleOpenUserSettings(GuiData,
PtrToUlong(ProcessData->Process->ClientId.UniqueProcess), &hKey, KEY_READ,
FALSE))
{
GuiConsoleReadUserSettings(hKey, Console, GuiData,
Console->ActiveBuffer);
RegCloseKey(hKey);
@@ -801,7 +801,7 @@
SetEvent(GuiData->hGuiInitEvent);
- return (BOOL) DefWindowProcW(hWnd, WM_NCCREATE, 0, (LPARAM) Create);
+ return (BOOL)DefWindowProcW(hWnd, WM_NCCREATE, 0, (LPARAM)Create);
}
static VOID
@@ -1276,7 +1276,7 @@
PCSRSS_CONSOLE Console;
PGUI_CONSOLE_DATA GuiData;
PLIST_ENTRY current_entry;
- PCSR_PROCESS current;
+ PCONSOLE_PROCESS_DATA current;
GuiConsoleGetDataPointers(hWnd, &Console, &GuiData);
@@ -1285,7 +1285,7 @@
current_entry = Console->ProcessList.Flink;
while (current_entry != &Console->ProcessList)
{
- current = CONTAINING_RECORD(current_entry, CSR_PROCESS, ConsoleLink);
+ current = CONTAINING_RECORD(current_entry, CONSOLE_PROCESS_DATA, ConsoleLink);
current_entry = current_entry->Flink;
/* FIXME: Windows will wait up to 5 seconds for the thread to exit.
@@ -2194,7 +2194,7 @@
wc.lpszClassName = L"Win32CsrCreateNotify";
wc.lpfnWndProc = GuiConsoleNotifyWndProc;
wc.style = 0;
- wc.hInstance = (HINSTANCE) GetModuleHandleW(NULL);
+ wc.hInstance = (HINSTANCE)GetModuleHandleW(NULL);
wc.hIcon = NULL;
wc.hCursor = NULL;
wc.hbrBackground = NULL;
@@ -2212,14 +2212,14 @@
wc.lpszClassName = L"ConsoleWindowClass";
wc.lpfnWndProc = GuiConsoleWndProc;
wc.style = 0;
- wc.hInstance = (HINSTANCE) GetModuleHandleW(NULL);
- wc.hIcon = LoadIconW(GetModuleHandleW(L"win32csr"), MAKEINTRESOURCEW(1));
+ wc.hInstance = (HINSTANCE)GetModuleHandleW(NULL);
+ wc.hIcon = LoadIconW(ConSrvDllInstance, MAKEINTRESOURCEW(1));
wc.hCursor = LoadCursorW(NULL, (LPCWSTR) IDC_ARROW);
wc.hbrBackground = CreateSolidBrush(RGB(0,0,0));
wc.lpszMenuName = NULL;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
- wc.hIconSm = LoadImageW(GetModuleHandleW(L"win32csr"), MAKEINTRESOURCEW(1),
IMAGE_ICON,
+ wc.hIconSm = LoadImageW(ConSrvDllInstance, MAKEINTRESOURCEW(1), IMAGE_ICON,
GetSystemMetrics(SM_CXSMICON),
GetSystemMetrics(SM_CYSMICON),
LR_SHARED);
if (RegisterClassExW(&wc) == 0)
@@ -2255,7 +2255,7 @@
Title = L"";
}
- SendMessageW(Console->hWindow, WM_SETTEXT, 0, (LPARAM) Title);
+ SendMessageW(Console->hWindow, WM_SETTEXT, 0, (LPARAM)Title);
if (NULL != Buffer)
{
@@ -2277,7 +2277,7 @@
static VOID WINAPI
GuiCleanupConsole(PCSRSS_CONSOLE Console)
{
- SendMessageW(NotifyWnd, PM_DESTROY_CONSOLE, 0, (LPARAM) Console);
+ SendMessageW(NotifyWnd, PM_DESTROY_CONSOLE, 0, (LPARAM)Console);
}
static CSRSS_CONSOLE_VTBL GuiVtbl =
@@ -2362,7 +2362,7 @@
*/
GuiData->hGuiInitEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
/* create console */
- PostMessageW(NotifyWnd, PM_CREATE_CONSOLE, ShowCmd, (LPARAM) Console);
+ PostMessageW(NotifyWnd, PM_CREATE_CONSOLE, ShowCmd, (LPARAM)Console);
/* wait untill initialization has finished */
WaitForSingleObject(GuiData->hGuiInitEvent, INFINITE);
Modified: branches/ros-csrss/win32ss/user/consrv/handle.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/h…
==============================================================================
--- branches/ros-csrss/win32ss/user/consrv/handle.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/consrv/handle.c [iso-8859-1] Wed Nov 7 22:23:36 2012
@@ -15,15 +15,6 @@
#include <debug.h>
-typedef struct _CSRSS_HANDLE
-{
- Object_t *Object;
- DWORD Access;
- BOOL Inheritable;
- DWORD ShareMode;
-} CSRSS_HANDLE, *PCSRSS_HANDLE;
-
-
/* FUNCTIONS *****************************************************************/
static
@@ -80,7 +71,7 @@
NTSTATUS
FASTCALL
-Win32CsrReleaseObject(PCSR_PROCESS ProcessData,
+Win32CsrReleaseObject(PCONSOLE_PROCESS_DATA ProcessData,
HANDLE Handle)
{
ULONG_PTR h = (ULONG_PTR)Handle >> 2;
@@ -100,7 +91,7 @@
NTSTATUS
FASTCALL
-Win32CsrLockObject(PCSR_PROCESS ProcessData,
+Win32CsrLockObject(PCONSOLE_PROCESS_DATA ProcessData,
HANDLE Handle,
Object_t **Object,
DWORD Access,
@@ -108,7 +99,7 @@
{
ULONG_PTR h = (ULONG_PTR)Handle >> 2;
- DPRINT("CsrGetObject, Object: %x, %x, %x\n",
+ DPRINT("Win32CsrLockObject, Object: %x, %x, %x\n",
Object, Handle, ProcessData ? ProcessData->HandleTableSize : 0);
RtlEnterCriticalSection(&ProcessData->HandleTableLock);
@@ -139,10 +130,87 @@
ConioDeleteConsole(&Console->Header);
}
+NTSTATUS
+NTAPI
+ConsoleNewProcess(PCSR_PROCESS SourceProcess,
+ PCSR_PROCESS TargetProcess)
+{
+ PCONSOLE_PROCESS_DATA SourceProcessData, TargetProcessData;
+ ULONG i;
+
+ DPRINT1("ConsoleNewProcess inside\n");
+ DPRINT1("SourceProcess = 0x%p ; TargetProcess = 0x%p\n", SourceProcess,
TargetProcess);
+
+ /* An empty target process is invalid */
+ if (!TargetProcess)
+ return STATUS_INVALID_PARAMETER;
+
+ DPRINT1("ConsoleNewProcess - OK\n");
+
+ TargetProcessData = ConsoleGetPerProcessData(TargetProcess);
+
+ /* Initialize the new (target) process */
+ TargetProcessData->Process = TargetProcess;
+ RtlInitializeCriticalSection(&TargetProcessData->HandleTableLock);
+
+ /* Do nothing if the source process is NULL */
+ if (!SourceProcess)
+ return STATUS_SUCCESS;
+
+ SourceProcessData = ConsoleGetPerProcessData(SourceProcess);
+
+ // TODO: Check if one of the processes is really a CONSOLE.
+ /*
+ if (!(CreateProcessRequest->CreationFlags & (CREATE_NEW_CONSOLE |
DETACHED_PROCESS)))
+ {
+ // NewProcess == TargetProcess.
+ NewProcess->ParentConsole = Process->Console;
+ NewProcess->bInheritHandles = CreateProcessRequest->bInheritHandles;
+ }
+ */
+
+ /* Only inherit if the if the flag was set */
+ if (!TargetProcessData->bInheritHandles) return STATUS_SUCCESS;
+
+ if (TargetProcessData->HandleTableSize)
+ {
+ return STATUS_INVALID_PARAMETER;
+ }
+
+ RtlEnterCriticalSection(&SourceProcessData->HandleTableLock);
+
+ TargetProcessData->HandleTable = RtlAllocateHeap(ConSrvHeap,
+ HEAP_ZERO_MEMORY,
+
SourceProcessData->HandleTableSize
+ * sizeof(CSRSS_HANDLE));
+ if (TargetProcessData->HandleTable == NULL)
+ {
+ RtlLeaveCriticalSection(&SourceProcessData->HandleTableLock);
+ return STATUS_UNSUCCESSFUL;
+ }
+
+ TargetProcessData->HandleTableSize = SourceProcessData->HandleTableSize;
+
+ for (i = 0; i < SourceProcessData->HandleTableSize; i++)
+ {
+ if (SourceProcessData->HandleTable[i].Object != NULL &&
+ SourceProcessData->HandleTable[i].Inheritable)
+ {
+ TargetProcessData->HandleTable[i] = SourceProcessData->HandleTable[i];
+ Win32CsrCreateHandleEntry(&TargetProcessData->HandleTable[i]);
+ }
+ }
+
+ RtlLeaveCriticalSection(&SourceProcessData->HandleTableLock);
+
+ return STATUS_SUCCESS;
+}
+
VOID
WINAPI
-Win32CsrReleaseConsole(PCSR_PROCESS ProcessData)
-{
+Win32CsrReleaseConsole(PCSR_PROCESS Process)
+{
+ PCONSOLE_PROCESS_DATA ProcessData = ConsoleGetPerProcessData(Process);
PCSRSS_CONSOLE Console;
ULONG i;
@@ -172,7 +240,7 @@
NTSTATUS
FASTCALL
-Win32CsrInsertObject(PCSR_PROCESS ProcessData,
+Win32CsrInsertObject(PCONSOLE_PROCESS_DATA ProcessData,
PHANDLE Handle,
Object_t *Object,
DWORD Access,
@@ -215,112 +283,22 @@
Win32CsrCreateHandleEntry(&ProcessData->HandleTable[i]);
*Handle = UlongToHandle((i << 2) | 0x3);
RtlLeaveCriticalSection(&ProcessData->HandleTableLock);
- return(STATUS_SUCCESS);
-}
-
-NTSTATUS
-WINAPI
-Win32CsrDuplicateHandleTable(PCSR_PROCESS SourceProcessData,
- PCSR_PROCESS TargetProcessData)
-{
- ULONG i;
-
- /* Only inherit if the flag was set */
- if (!TargetProcessData->bInheritHandles) return STATUS_SUCCESS;
-
- if (TargetProcessData->HandleTableSize)
- {
- return STATUS_INVALID_PARAMETER;
- }
-
- RtlEnterCriticalSection(&SourceProcessData->HandleTableLock);
-
- /* we are called from CreateProcessData, it isn't necessary to lock the target
process data */
-
- TargetProcessData->HandleTable = RtlAllocateHeap(ConSrvHeap,
- HEAP_ZERO_MEMORY,
-
SourceProcessData->HandleTableSize
- * sizeof(CSRSS_HANDLE));
- if (TargetProcessData->HandleTable == NULL)
- {
- RtlLeaveCriticalSection(&SourceProcessData->HandleTableLock);
- return(STATUS_UNSUCCESSFUL);
- }
- TargetProcessData->HandleTableSize = SourceProcessData->HandleTableSize;
- for (i = 0; i < SourceProcessData->HandleTableSize; i++)
- {
- if (SourceProcessData->HandleTable[i].Object != NULL &&
- SourceProcessData->HandleTable[i].Inheritable)
- {
- TargetProcessData->HandleTable[i] = SourceProcessData->HandleTable[i];
- Win32CsrCreateHandleEntry(&TargetProcessData->HandleTable[i]);
- }
- }
- RtlLeaveCriticalSection(&SourceProcessData->HandleTableLock);
- return(STATUS_SUCCESS);
-}
-
-CSR_API(CsrGetHandle)
-{
- NTSTATUS Status = STATUS_SUCCESS;
- PCSRSS_GET_INPUT_HANDLE GetInputHandleRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetInputHandleRequest;
- PCSR_PROCESS ProcessData = CsrGetClientThread()->Process;
-
- GetInputHandleRequest->Handle = INVALID_HANDLE_VALUE;
-
- RtlEnterCriticalSection(&ProcessData->HandleTableLock);
- if (ProcessData->Console)
- {
- DWORD DesiredAccess = GetInputHandleRequest->Access;
- DWORD ShareMode = GetInputHandleRequest->ShareMode;
-
- PCSRSS_CONSOLE Console = ProcessData->Console;
- Object_t *Object;
-
- EnterCriticalSection(&Console->Lock);
- if (ApiMessage->ApiNumber == ConsolepGetHandleInformation)
- Object = &Console->ActiveBuffer->Header;
- else
- Object = &Console->Header;
-
- if (((DesiredAccess & GENERIC_READ) && Object->ExclusiveRead !=
0) ||
- ((DesiredAccess & GENERIC_WRITE) && Object->ExclusiveWrite !=
0) ||
- (!(ShareMode & FILE_SHARE_READ) && Object->AccessRead !=
0) ||
- (!(ShareMode & FILE_SHARE_WRITE) && Object->AccessWrite !=
0))
- {
- DPRINT1("Sharing violation\n");
- Status = STATUS_SHARING_VIOLATION;
- }
- else
- {
- Status = Win32CsrInsertObject(ProcessData,
- &GetInputHandleRequest->Handle,
- Object,
- DesiredAccess,
- GetInputHandleRequest->Inheritable,
- ShareMode);
- }
- LeaveCriticalSection(&Console->Lock);
- }
- RtlLeaveCriticalSection(&ProcessData->HandleTableLock);
-
- return Status;
-}
-
-// CSR_API(CsrSetHandle) ??
+ return STATUS_SUCCESS;
+}
CSR_API(SrvCloseHandle)
{
PCSRSS_CLOSE_HANDLE CloseHandleRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.CloseHandleRequest;
- return Win32CsrReleaseObject(CsrGetClientThread()->Process,
CloseHandleRequest->Handle);
+ return
Win32CsrReleaseObject(ConsoleGetPerProcessData(CsrGetClientThread()->Process),
+ CloseHandleRequest->Handle);
}
CSR_API(SrvVerifyConsoleIoHandle)
{
NTSTATUS Status = STATUS_SUCCESS;
PCSRSS_VERIFY_HANDLE VerifyHandleRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.VerifyHandleRequest;
- PCSR_PROCESS ProcessData = CsrGetClientThread()->Process;
+ PCONSOLE_PROCESS_DATA ProcessData =
ConsoleGetPerProcessData(CsrGetClientThread()->Process);
ULONG_PTR Index;
Index = (ULONG_PTR)VerifyHandleRequest->Handle >> 2;
@@ -342,7 +320,7 @@
PCSRSS_HANDLE Entry;
DWORD DesiredAccess;
PCSRSS_DUPLICATE_HANDLE DuplicateHandleRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.DuplicateHandleRequest;
- PCSR_PROCESS ProcessData = CsrGetClientThread()->Process;
+ PCONSOLE_PROCESS_DATA ProcessData =
ConsoleGetPerProcessData(CsrGetClientThread()->Process);
Index = (ULONG_PTR)DuplicateHandleRequest->Handle >> 2;
RtlEnterCriticalSection(&ProcessData->HandleTableLock);
@@ -372,11 +350,11 @@
}
ApiMessage->Status = Win32CsrInsertObject(ProcessData,
- &DuplicateHandleRequest->Handle,
- Entry->Object,
- DesiredAccess,
- DuplicateHandleRequest->Inheritable,
- Entry->ShareMode);
+ &DuplicateHandleRequest->Handle,
+ Entry->Object,
+ DesiredAccess,
+ DuplicateHandleRequest->Inheritable,
+ Entry->ShareMode);
if (NT_SUCCESS(ApiMessage->Status)
&& DuplicateHandleRequest->Options & DUPLICATE_CLOSE_SOURCE)
{
@@ -391,7 +369,9 @@
{
PCSRSS_GET_INPUT_WAIT_HANDLE GetConsoleInputWaitHandle =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetConsoleInputWaitHandle;
- GetConsoleInputWaitHandle->InputWaitHandle =
CsrGetClientThread()->Process->ConsoleEvent;
+ GetConsoleInputWaitHandle->InputWaitHandle =
+ ConsoleGetPerProcessData(CsrGetClientThread()->Process)->ConsoleEvent;
+
return STATUS_SUCCESS;
}
Modified: branches/ros-csrss/win32ss/user/consrv/lineinput.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/l…
==============================================================================
--- branches/ros-csrss/win32ss/user/consrv/lineinput.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/consrv/lineinput.c [iso-8859-1] Wed Nov 7 22:23:36
2012
@@ -152,21 +152,21 @@
CSR_API(SrvGetConsoleCommandHistoryLength)
{
PCSRSS_GET_COMMAND_HISTORY_LENGTH GetCommandHistoryLength =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetCommandHistoryLength;
- PCSR_PROCESS ProcessData = CsrGetClientThread()->Process;
+ PCSR_PROCESS Process = CsrGetClientThread()->Process;
PCSRSS_CONSOLE Console;
NTSTATUS Status;
PHISTORY_BUFFER Hist;
ULONG Length = 0;
INT i;
- if (!Win32CsrValidateBuffer(ProcessData,
+ if (!Win32CsrValidateBuffer(Process,
GetCommandHistoryLength->ExeName.Buffer,
GetCommandHistoryLength->ExeName.Length, 1))
{
return STATUS_ACCESS_VIOLATION;
}
- Status = ConioConsoleFromProcessData(ProcessData, &Console);
+ Status = ConioConsoleFromProcessData(ConsoleGetPerProcessData(Process),
&Console);
if (NT_SUCCESS(Status))
{
Hist = HistoryFindBuffer(Console, &GetCommandHistoryLength->ExeName);
@@ -184,7 +184,7 @@
CSR_API(SrvGetConsoleCommandHistory)
{
PCSRSS_GET_COMMAND_HISTORY GetCommandHistory =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetCommandHistory;
- PCSR_PROCESS ProcessData = CsrGetClientThread()->Process;
+ PCSR_PROCESS Process = CsrGetClientThread()->Process;
PCSRSS_CONSOLE Console;
NTSTATUS Status;
PHISTORY_BUFFER Hist;
@@ -192,15 +192,15 @@
ULONG BufferSize = GetCommandHistory->Length;
INT i;
- if (!Win32CsrValidateBuffer(ProcessData, Buffer, BufferSize, 1) ||
- !Win32CsrValidateBuffer(ProcessData,
+ if (!Win32CsrValidateBuffer(Process, Buffer, BufferSize, 1) ||
+ !Win32CsrValidateBuffer(Process,
GetCommandHistory->ExeName.Buffer,
GetCommandHistory->ExeName.Length, 1))
{
return STATUS_ACCESS_VIOLATION;
}
- Status = ConioConsoleFromProcessData(ProcessData, &Console);
+ Status = ConioConsoleFromProcessData(ConsoleGetPerProcessData(Process),
&Console);
if (NT_SUCCESS(Status))
{
Hist = HistoryFindBuffer(Console, &GetCommandHistory->ExeName);
@@ -228,19 +228,19 @@
CSR_API(SrvExpungeConsoleCommandHistory)
{
PCSRSS_EXPUNGE_COMMAND_HISTORY ExpungeCommandHistory =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.ExpungeCommandHistory;
- PCSR_PROCESS ProcessData = CsrGetClientThread()->Process;
+ PCSR_PROCESS Process = CsrGetClientThread()->Process;
PCSRSS_CONSOLE Console;
PHISTORY_BUFFER Hist;
NTSTATUS Status;
- if (!Win32CsrValidateBuffer(ProcessData,
+ if (!Win32CsrValidateBuffer(Process,
ExpungeCommandHistory->ExeName.Buffer,
ExpungeCommandHistory->ExeName.Length, 1))
{
return STATUS_ACCESS_VIOLATION;
}
- Status = ConioConsoleFromProcessData(ProcessData, &Console);
+ Status = ConioConsoleFromProcessData(ConsoleGetPerProcessData(Process),
&Console);
if (NT_SUCCESS(Status))
{
Hist = HistoryFindBuffer(Console, &ExpungeCommandHistory->ExeName);
@@ -253,21 +253,21 @@
CSR_API(SrvSetConsoleNumberOfCommands)
{
PCSRSS_SET_HISTORY_NUMBER_COMMANDS SetHistoryNumberCommands =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetHistoryNumberCommands;
- PCSR_PROCESS ProcessData = CsrGetClientThread()->Process;
+ PCSR_PROCESS Process = CsrGetClientThread()->Process;
PCSRSS_CONSOLE Console;
PHISTORY_BUFFER Hist;
NTSTATUS Status;
WORD MaxEntries = SetHistoryNumberCommands->NumCommands;
PUNICODE_STRING OldEntryList, NewEntryList;
- if (!Win32CsrValidateBuffer(ProcessData,
+ if (!Win32CsrValidateBuffer(Process,
SetHistoryNumberCommands->ExeName.Buffer,
SetHistoryNumberCommands->ExeName.Length, 1))
{
return STATUS_ACCESS_VIOLATION;
}
- Status = ConioConsoleFromProcessData(ProcessData, &Console);
+ Status = ConioConsoleFromProcessData(ConsoleGetPerProcessData(Process),
&Console);
if (NT_SUCCESS(Status))
{
Hist = HistoryFindBuffer(Console, &SetHistoryNumberCommands->ExeName);
@@ -304,7 +304,7 @@
{
PCSRSS_GET_HISTORY_INFO GetHistoryInfo =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetHistoryInfo;
PCSRSS_CONSOLE Console;
- NTSTATUS Status = ConioConsoleFromProcessData(CsrGetClientThread()->Process,
&Console);
+ NTSTATUS Status =
ConioConsoleFromProcessData(ConsoleGetPerProcessData(CsrGetClientThread()->Process),
&Console);
if (NT_SUCCESS(Status))
{
GetHistoryInfo->HistoryBufferSize = Console->HistoryBufferSize;
@@ -319,7 +319,7 @@
{
PCSRSS_SET_HISTORY_INFO SetHistoryInfo =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetHistoryInfo;
PCSRSS_CONSOLE Console;
- NTSTATUS Status = ConioConsoleFromProcessData(CsrGetClientThread()->Process,
&Console);
+ NTSTATUS Status =
ConioConsoleFromProcessData(ConsoleGetPerProcessData(CsrGetClientThread()->Process),
&Console);
if (NT_SUCCESS(Status))
{
Console->HistoryBufferSize = (WORD)SetHistoryInfo->HistoryBufferSize;