[ros-diffs] [fireball] 42154: - User server: only copy variable length data to the caller if a buffer was provided. Otherwise notify via a debug print that no buffer was provided. Fixes a crash at repainting.

fireball at svn.reactos.org fireball at svn.reactos.org
Thu Jul 23 15:16:59 CEST 2009


Author: fireball
Date: Thu Jul 23 15:16:59 2009
New Revision: 42154

URL: http://svn.reactos.org/svn/reactos?rev=42154&view=rev
Log:
- User server: only copy variable length data to the caller if a buffer was provided. Otherwise notify via a debug print that no buffer was provided. Fixes a crash at repainting.

Modified:
    branches/arwinss/reactos/subsystems/win32/win32k/wine/main.c

Modified: branches/arwinss/reactos/subsystems/win32/win32k/wine/main.c
URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win32/win32k/wine/main.c?rev=42154&r1=42153&r2=42154&view=diff
==============================================================================
--- branches/arwinss/reactos/subsystems/win32/win32k/wine/main.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/subsystems/win32/win32k/wine/main.c [iso-8859-1] Thu Jul 23 15:16:59 2009
@@ -130,13 +130,18 @@
     if (reqinfo->data_count > 1) ExFreePool(RequestData);
 
     /* Copy back the reply data if any */
-    if (ReplySize)
+    if (ReplySize && reqinfo->reply_data)
     {
         /* Copy it */
         RtlCopyMemory(reqinfo->reply_data, ReplyData, ReplySize);
 
         /* Free temp storage */
         ExFreePool(ReplyData);
+    }
+    else if (ReplySize)
+    {
+        DPRINT1("Caller didn't provide any storage for output data, not transferring anything.\n");
+        ReplySize = 0;
     }
 
     /* Set reply's error flag and size */




More information about the Ros-diffs mailing list