mirror of
https://github.com/reactos/reactos.git
synced 2024-10-20 08:01:05 +00:00
34086f2971
- Use the new PCONSOLE_PROCESS_DATA type instead of PCSR_PROCESS, for accessing console-specific fields inside a console structure (the code modifications inside these functions will follow in the next commits). - Remove unneeded included header files in consrv.h. - Use a DLL instance in order to facilitate the access to win32 resources. - Activate the declaration of server apis (or rename existing ones to the Windows scheme from the http://j00ru.vexillium.org/csrss_list/api_list.html#Windows_2k3 list). - Comment the Win32CsrValidateBuffer helper (because it should be replaced by the usage of CsrValidateMessageBuffer). - Add the list of the old APIs (just for me, to remember at the end to check that I didn't forget ome of them during the process of moving / renaming). svn path=/branches/ros-csrss/; revision=57686
43 lines
1.4 KiB
C
43 lines
1.4 KiB
C
/*
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
* PROJECT: ReactOS Console Server DLL
|
|
* FILE: win32ss/user/consrv/init.c
|
|
* PURPOSE: Server APIs
|
|
* PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca@sfr.fr)
|
|
*/
|
|
|
|
#include "consrv.h"
|
|
|
|
#define NDEBUG
|
|
#include <debug.h>
|
|
|
|
#if 0
|
|
/* Ensure that a captured buffer is safe to access */
|
|
BOOL FASTCALL
|
|
Win32CsrValidateBuffer(PCSR_PROCESS ProcessData, PVOID Buffer,
|
|
SIZE_T NumElements, SIZE_T ElementSize)
|
|
{
|
|
/* Check that the following conditions are true:
|
|
* 1. The start of the buffer is somewhere within the process's
|
|
* shared memory section view.
|
|
* 2. The remaining space in the view is at least as large as the buffer.
|
|
* (NB: Please don't try to "optimize" this by using multiplication
|
|
* instead of division; remember that 2147483648 * 2 = 0.)
|
|
* 3. The buffer is DWORD-aligned.
|
|
*/
|
|
ULONG_PTR Offset = (BYTE *)Buffer - (BYTE *)ProcessData->ClientViewBase;
|
|
if (Offset >= ProcessData->ClientViewBounds
|
|
|| NumElements > (ProcessData->ClientViewBounds - Offset) / ElementSize
|
|
|| (Offset & (sizeof(DWORD) - 1)) != 0)
|
|
{
|
|
DPRINT1("Invalid buffer %p(%u*%u); section view is %p(%u)\n",
|
|
Buffer, NumElements, ElementSize,
|
|
ProcessData->ClientViewBase, ProcessData->ClientViewBounds);
|
|
return FALSE;
|
|
}
|
|
return TRUE;
|
|
}
|
|
#endif
|
|
|
|
/* EOF */
|