Author: hbelusca
Date: Sat Oct 27 19:05:10 2012
New Revision: 57625
URL:
http://svn.reactos.org/svn/reactos?rev=57625&view=rev
Log:
[NTDLL]
- Code formatting.
- Fix CSR message length computation.
[CSR]
- Remove unneeded comments.
- Correct arguments names.
Modified:
branches/ros-csrss/dll/ntdll/csr/api.c
branches/ros-csrss/dll/ntdll/csr/capture.c
branches/ros-csrss/dll/ntdll/csr/connect.c
branches/ros-csrss/include/reactos/subsys/csr/csr.h
branches/ros-csrss/include/reactos/subsys/csr/csrmsg.h
Modified: branches/ros-csrss/dll/ntdll/csr/api.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/dll/ntdll/csr/api.c?r…
==============================================================================
--- branches/ros-csrss/dll/ntdll/csr/api.c [iso-8859-1] (original)
+++ branches/ros-csrss/dll/ntdll/csr/api.c [iso-8859-1] Sat Oct 27 19:05:10 2012
@@ -6,16 +6,16 @@
* PROGRAMMER: Alex Ionescu (alex(a)relsoft.net)
*/
-/* INCLUDES *****************************************************************/
+/* INCLUDES *******************************************************************/
#include <ntdll.h>
#define NDEBUG
#include <debug.h>
-/* GLOBALS *******************************************************************/
+/* GLOBALS ********************************************************************/
extern HANDLE CsrApiPort;
-/* FUNCTIONS *****************************************************************/
+/* FUNCTIONS ******************************************************************/
/*
* @implemented
@@ -78,7 +78,7 @@
Status = CsrClientCallServer(&ApiMessage,
NULL,
CSR_CREATE_API_NUMBER(CSRSRV_SERVERDLL_INDEX,
CsrpIdentifyAlertable),
- sizeof(CSR_SET_PRIORITY_CLASS));
+ sizeof(CSR_IDENTIFY_ALTERTABLE_THREAD));
/* Return to caller */
return Status;
Modified: branches/ros-csrss/dll/ntdll/csr/capture.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/dll/ntdll/csr/capture…
==============================================================================
--- branches/ros-csrss/dll/ntdll/csr/capture.c [iso-8859-1] (original)
+++ branches/ros-csrss/dll/ntdll/csr/capture.c [iso-8859-1] Sat Oct 27 19:05:10 2012
@@ -6,16 +6,16 @@
* PROGRAMMER: Alex Ionescu (alex(a)relsoft.net)
*/
-/* INCLUDES *****************************************************************/
+/* INCLUDES *******************************************************************/
#include <ntdll.h>
#define NDEBUG
#include <debug.h>
-/* GLOBALS *******************************************************************/
+/* GLOBALS ********************************************************************/
extern HANDLE CsrPortHeap;
-/* FUNCTIONS *****************************************************************/
+/* FUNCTIONS ******************************************************************/
/*
* @implemented
Modified: branches/ros-csrss/dll/ntdll/csr/connect.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/dll/ntdll/csr/connect…
==============================================================================
--- branches/ros-csrss/dll/ntdll/csr/connect.c [iso-8859-1] (original)
+++ branches/ros-csrss/dll/ntdll/csr/connect.c [iso-8859-1] Sat Oct 27 19:05:10 2012
@@ -6,13 +6,13 @@
* PROGRAMMER: Alex Ionescu (alex(a)relsoft.net)
*/
-/* INCLUDES *****************************************************************/
+/* INCLUDES *******************************************************************/
#include <ntdll.h>
#define NDEBUG
#include <debug.h>
-/* GLOBALS *******************************************************************/
+/* GLOBALS ********************************************************************/
HANDLE CsrApiPort;
HANDLE CsrProcessId;
@@ -28,7 +28,7 @@
#define UNICODE_PATH_SEP L"\\"
-/* FUNCTIONS *****************************************************************/
+/* FUNCTIONS ******************************************************************/
/*
* @implemented
@@ -45,10 +45,10 @@
*/
NTSTATUS
NTAPI
-CsrClientCallServer(PCSR_API_MESSAGE ApiMessage,
- PCSR_CAPTURE_BUFFER CaptureBuffer OPTIONAL,
- CSR_API_NUMBER ApiNumber,
- ULONG RequestLength)
+CsrClientCallServer(IN OUT PCSR_API_MESSAGE ApiMessage,
+ IN OUT PCSR_CAPTURE_BUFFER CaptureBuffer OPTIONAL,
+ IN CSR_API_NUMBER ApiNumber,
+ IN ULONG DataLength)
{
NTSTATUS Status;
ULONG PointerCount;
@@ -58,8 +58,11 @@
/* Fill out the Port Message Header */
ApiMessage->Header.u2.ZeroInit = 0;
- ApiMessage->Header.u1.s1.DataLength = RequestLength - sizeof(PORT_MESSAGE);
- ApiMessage->Header.u1.s1.TotalLength = RequestLength;
+ ApiMessage->Header.u1.s1.TotalLength =
+ FIELD_OFFSET(CSR_API_MESSAGE, Data) + DataLength;
+ /* FIELD_OFFSET(CSR_API_MESSAGE, Data) <= sizeof(CSR_API_MESSAGE) -
sizeof(ApiMessage->Data) */
+ ApiMessage->Header.u1.s1.DataLength =
+ ApiMessage->Header.u1.s1.TotalLength - sizeof(PORT_MESSAGE);
/* Fill out the CSR Header */
ApiMessage->ApiNumber = ApiNumber;
@@ -113,7 +116,7 @@
/* Check if we got a a Capture Buffer */
if (CaptureBuffer)
{
- /* We have to convert from the remote view to our remote view */
+ /* We have to convert back from the remote view to our local view */
DPRINT("Reconverting CaptureBuffer\n");
ApiMessage->CsrCaptureData = (PVOID)((ULONG_PTR)
ApiMessage->CsrCaptureData -
@@ -168,7 +171,7 @@
NTSTATUS
NTAPI
-CsrConnectToServer(IN PWSTR ObjectDirectory)
+CsrpConnectToServer(IN PWSTR ObjectDirectory)
{
ULONG PortNameLength;
UNICODE_STRING PortName;
@@ -318,11 +321,11 @@
*/
NTSTATUS
NTAPI
-CsrClientConnectToServer(PWSTR ObjectDirectory,
- ULONG ServerId,
- PVOID ConnectionInfo,
- PULONG ConnectionInfoSize,
- PBOOLEAN ServerToServerCall)
+CsrClientConnectToServer(IN PWSTR ObjectDirectory,
+ IN ULONG ServerId,
+ IN PVOID ConnectionInfo,
+ IN OUT PULONG ConnectionInfoSize,
+ OUT PBOOLEAN ServerToServerCall)
{
NTSTATUS Status;
PIMAGE_NT_HEADERS NtHeader;
@@ -397,7 +400,7 @@
if (!CsrApiPort)
{
/* No, set it up now */
- if (!NT_SUCCESS(Status = CsrConnectToServer(ObjectDirectory)))
+ if (!NT_SUCCESS(Status = CsrpConnectToServer(ObjectDirectory)))
{
/* Failed */
DPRINT1("Failure to connect to CSR\n");
@@ -410,8 +413,7 @@
ClientConnect->ConnectionInfoSize = *ConnectionInfoSize;
/* Setup a buffer for the connection info */
- CaptureBuffer = CsrAllocateCaptureBuffer(1,
- ClientConnect->ConnectionInfoSize);
+ CaptureBuffer = CsrAllocateCaptureBuffer(1,
ClientConnect->ConnectionInfoSize);
if (CaptureBuffer == NULL)
{
return STATUS_INSUFFICIENT_RESOURCES;
@@ -435,12 +437,6 @@
CaptureBuffer,
CSR_CREATE_API_NUMBER(CSRSRV_SERVERDLL_INDEX,
CsrpClientConnect),
sizeof(CSR_CLIENT_CONNECT));
-/*
- Status = CsrClientCallServer(&ApiMessage,
- CaptureBuffer,
- CSR_CREATE_API_NUMBER(CSR_NATIVE, CONNECT_PROCESS),
- sizeof(CSR_API_MESSAGE));
-*/
}
else
{
Modified: branches/ros-csrss/include/reactos/subsys/csr/csr.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/include/reactos/subsy…
==============================================================================
--- branches/ros-csrss/include/reactos/subsys/csr/csr.h [iso-8859-1] (original)
+++ branches/ros-csrss/include/reactos/subsys/csr/csr.h [iso-8859-1] Sat Oct 27 19:05:10
2012
@@ -33,10 +33,10 @@
NTSTATUS
NTAPI
-CsrClientCallServer(IN OUT PCSR_API_MESSAGE Request,
+CsrClientCallServer(IN OUT PCSR_API_MESSAGE ApiMessage,
IN OUT PCSR_CAPTURE_BUFFER CaptureBuffer OPTIONAL,
- IN ULONG ApiNumber,
- IN ULONG RequestLength);
+ IN CSR_API_NUMBER ApiNumber,
+ IN ULONG DataLength);
PVOID
NTAPI
Modified: branches/ros-csrss/include/reactos/subsys/csr/csrmsg.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/include/reactos/subsy…
==============================================================================
--- branches/ros-csrss/include/reactos/subsys/csr/csrmsg.h [iso-8859-1] (original)
+++ branches/ros-csrss/include/reactos/subsys/csr/csrmsg.h [iso-8859-1] Sat Oct 27
19:05:10 2012
@@ -94,7 +94,7 @@
struct _CSR_CAPTURE_BUFFER *PreviousCaptureBuffer;
ULONG PointerCount;
ULONG_PTR BufferEnd;
- ULONG_PTR PointerArray[1]; // MessagePointerOffsets // Offsets within CSR_API_MSG of
pointers
+ ULONG_PTR PointerArray[1];
} CSR_CAPTURE_BUFFER, *PCSR_CAPTURE_BUFFER;
@@ -122,8 +122,6 @@
CSR_SET_PRIORITY_CLASS SetPriorityClass;
CSR_IDENTIFY_ALTERTABLE_THREAD IdentifyAlertableThread;
- // ULONG_PTR ApiMessageData[39]; //// what to do ????
-
/*** win32csr thingies to remove. ***/
#if 1
CSRSS_CREATE_DESKTOP CreateDesktopRequest;