Author: hbelusca
Date: Tue Jul 29 14:00:46 2014
New Revision: 63769

URL: http://svn.reactos.org/svn/reactos?rev=63769&view=rev
Log:
[CONSRV]
Add the optional "number of things read/written" parameters back.

Modified:
    branches/condrv_restructure/win32ss/user/winsrv/consrv/condrv/text.c
    branches/condrv_restructure/win32ss/user/winsrv/consrv/conoutput.c

Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/condrv/text.c
URL: 
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user/winsrv/consrv/condrv/text.c?rev=63769&r1=63768&r2=63769&view=diff
==============================================================================
--- branches/condrv_restructure/win32ss/user/winsrv/consrv/condrv/text.c        
[iso-8859-1] (original)
+++ branches/condrv_restructure/win32ss/user/winsrv/consrv/condrv/text.c        
[iso-8859-1] Tue Jul 29 14:00:46 2014
@@ -892,7 +892,7 @@
                               IN ULONG NumCodesToRead,
                               IN PCOORD ReadCoord,
                               // OUT PCOORD EndCoord,
-                              OUT PULONG CodesRead)
+                              OUT PULONG NumCodesRead OPTIONAL)
 {
     SHORT Xpos, Ypos;
     PVOID ReadBuffer;
@@ -900,8 +900,7 @@
     ULONG CodeSize;
     PCHAR_INFO Ptr;
 
-    if (Console == NULL || Buffer == NULL ||
-        ReadCoord == NULL || /* EndCoord == NULL || */ CodesRead == NULL)
+    if (Console == NULL || Buffer == NULL || ReadCoord == NULL /* || EndCoord 
== NULL */)
     {
         return STATUS_INVALID_PARAMETER;
     }
@@ -909,6 +908,8 @@
     /* Validity checks */
     ASSERT(Console == Buffer->Header.Console);
     ASSERT((StringBuffer != NULL) || (StringBuffer == NULL && NumCodesToRead 
== 0));
+
+    if (NumCodesRead) *NumCodesRead = 0;
 
     switch (CodeType)
     {
@@ -985,7 +986,8 @@
     // EndCoord->X = Xpos;
     // EndCoord->Y = (Ypos - Buffer->VirtualY + Buffer->ScreenBufferSize.Y) % 
Buffer->ScreenBufferSize.Y;
 
-    *CodesRead = (ULONG)((ULONG_PTR)ReadBuffer - (ULONG_PTR)StringBuffer) / 
CodeSize;
+    if (NumCodesRead)
+        *NumCodesRead = (ULONG)((ULONG_PTR)ReadBuffer - 
(ULONG_PTR)StringBuffer) / CodeSize;
     // <= NumCodesToRead
 
     return STATUS_SUCCESS;
@@ -997,9 +999,9 @@
                                IN CODE_TYPE CodeType,
                                IN PVOID StringBuffer,
                                IN ULONG NumCodesToWrite,
-                               IN PCOORD WriteCoord /*,
-                               OUT PCOORD EndCoord,
-                               OUT PULONG CodesWritten */)
+                               IN PCOORD WriteCoord,
+                               // OUT PCOORD EndCoord,
+                               OUT PULONG NumCodesWritten OPTIONAL)
 {
     NTSTATUS Status = STATUS_SUCCESS;
     PVOID WriteBuffer = NULL;
@@ -1008,8 +1010,7 @@
     ULONG CodeSize;
     PCHAR_INFO Ptr;
 
-    if (Console == NULL || Buffer == NULL ||
-        WriteCoord == NULL /* || EndCoord == NULL || CodesWritten == NULL */)
+    if (Console == NULL || Buffer == NULL || WriteCoord == NULL /* || EndCoord 
== NULL */)
     {
         return STATUS_INVALID_PARAMETER;
     }
@@ -1017,6 +1018,8 @@
     /* Validity checks */
     ASSERT(Console == Buffer->Header.Console);
     ASSERT((StringBuffer != NULL) || (StringBuffer == NULL && NumCodesToWrite 
== 0));
+
+    if (NumCodesWritten) *NumCodesWritten = 0;
 
     switch (CodeType)
     {
@@ -1114,7 +1117,7 @@
 Cleanup:
     if (tmpString) RtlFreeHeap(RtlGetProcessHeap(), 0, tmpString);
 
-    // CodesWritten = Written;
+    // if (NumCodesWritten) *NumCodesWritten = Written;
     return Status;
 }
 
@@ -1124,19 +1127,21 @@
                         IN CODE_TYPE CodeType,
                         IN CODE_ELEMENT Code,
                         IN ULONG NumCodesToWrite,
-                        IN PCOORD WriteCoord /*,
-                        OUT PULONG CodesWritten */)
+                        IN PCOORD WriteCoord,
+                        OUT PULONG NumCodesWritten OPTIONAL)
 {
     DWORD X, Y, Length; // , Written = 0;
     PCHAR_INFO Ptr;
 
-    if (Console == NULL || Buffer == NULL || WriteCoord == NULL /* || 
CodesWritten == NULL */)
+    if (Console == NULL || Buffer == NULL || WriteCoord == NULL)
     {
         return STATUS_INVALID_PARAMETER;
     }
 
     /* Validity check */
     ASSERT(Console == Buffer->Header.Console);
+
+    if (NumCodesWritten) *NumCodesWritten = 0;
 
     if (CodeType == CODE_ASCII)
     {
@@ -1189,7 +1194,7 @@
         TermDrawRegion(Console, &UpdateRect);
     }
 
-    // CodesWritten = Written; // NumCodesToWrite;
+    // if (NumCodesWritten) *NumCodesWritten = Written; // NumCodesToWrite;
     return STATUS_SUCCESS;
 }
 

Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/conoutput.c
URL: 
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user/winsrv/consrv/conoutput.c?rev=63769&r1=63768&r2=63769&view=diff
==============================================================================
--- branches/condrv_restructure/win32ss/user/winsrv/consrv/conoutput.c  
[iso-8859-1] (original)
+++ branches/condrv_restructure/win32ss/user/winsrv/consrv/conoutput.c  
[iso-8859-1] Tue Jul 29 14:00:46 2014
@@ -525,7 +525,7 @@
                               IN ULONG NumCodesToRead,
                               IN PCOORD ReadCoord,
                               // OUT PCOORD EndCoord,
-                              OUT PULONG CodesRead);
+                              OUT PULONG NumCodesRead OPTIONAL);
 CSR_API(SrvReadConsoleOutputString)
 {
     NTSTATUS Status;
@@ -607,9 +607,9 @@
                                IN CODE_TYPE CodeType,
                                IN PVOID StringBuffer,
                                IN ULONG NumCodesToWrite,
-                               IN PCOORD WriteCoord /*,
-                               OUT PCOORD EndCoord,
-                               OUT PULONG CodesWritten */);
+                               IN PCOORD WriteCoord,
+                               // OUT PCOORD EndCoord,
+                               OUT PULONG NumCodesWritten OPTIONAL);
 CSR_API(SrvWriteConsoleOutputString)
 {
     NTSTATUS Status;
@@ -677,11 +677,9 @@
                                             WriteOutputCodeRequest->CodeType,
                                             pCode,
                                             WriteOutputCodeRequest->NumCodes,
-                                            &WriteOutputCodeRequest->Coord /*,
-                                            &WriteOutputCodeRequest->EndCoord,
-                                            
&WriteOutputCodeRequest->NrCharactersWritten */);
-
-    // WriteOutputCodeRequest->NrCharactersWritten = Written;
+                                            &WriteOutputCodeRequest->Coord,
+                                            // 
&WriteOutputCodeRequest->EndCoord,
+                                            &WriteOutputCodeRequest->NumCodes);
 
     ConSrvReleaseScreenBuffer(Buffer, TRUE);
     return Status;
@@ -693,8 +691,8 @@
                         IN CODE_TYPE CodeType,
                         IN CODE_ELEMENT Code,
                         IN ULONG NumCodesToWrite,
-                        IN PCOORD WriteCoord /*,
-                        OUT PULONG CodesWritten */);
+                        IN PCOORD WriteCoord,
+                        OUT PULONG NumCodesWritten OPTIONAL);
 CSR_API(SrvFillConsoleOutput)
 {
     NTSTATUS Status;
@@ -721,10 +719,8 @@
                                      CodeType,
                                      FillOutputRequest->Code,
                                      FillOutputRequest->NumCodes,
-                                     &FillOutputRequest->WriteCoord /*,
-                                     &FillOutputRequest->NrCharactersWritten 
*/);
-
-    // FillOutputRequest->NrCharactersWritten = Written;
+                                     &FillOutputRequest->WriteCoord,
+                                     &FillOutputRequest->NumCodes);
 
     ConSrvReleaseScreenBuffer(Buffer, TRUE);
     return Status;


Reply via email to