[NTDLL]
[reactos.git] / dll / ntdll / csr / capture.c
index 1ab781d..0a779ec 100644 (file)
@@ -9,6 +9,7 @@
 /* INCLUDES *******************************************************************/
 
 #include <ntdll.h>
+
 #define NDEBUG
 #include <debug.h>
 
@@ -100,6 +101,9 @@ CsrAllocateCaptureBuffer(IN ULONG ArgumentCount,
     /* Align it to a 4-byte boundary */
     BufferSize = (BufferSize + 3) & ~3;
 
+    /* Add the size of the alignment padding for each argument */
+    BufferSize += ArgumentCount * 3;
+
     /* Allocate memory from the port heap */
     CaptureBuffer = RtlAllocateHeap(CsrPortHeap, HEAP_ZERO_MEMORY, BufferSize);
     if (CaptureBuffer == NULL) return NULL;