From cdbe644f77e405fb05ad48b543ec59c95cd4b51c Mon Sep 17 00:00:00 2001 From: Slava Monich Date: Sat, 8 Jul 2000 12:44:09 +0000 Subject: [PATCH] BeginDeferWindowPos should allow zero count. --- windows/winpos.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/windows/winpos.c b/windows/winpos.c index b4264cdd22d..45b335f062e 100644 --- a/windows/winpos.c +++ b/windows/winpos.c @@ -8,6 +8,7 @@ #include #include "windef.h" #include "wingdi.h" +#include "winerror.h" #include "wine/winuser16.h" #include "heap.h" #include "module.h" @@ -2929,7 +2930,14 @@ HDWP WINAPI BeginDeferWindowPos( INT count ) HDWP handle; DWP *pDWP; - if (count <= 0) return 0; + if (count < 0) + { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + /* Windows allows zero count, in which case it allocates context for 8 moves */ + if (count == 0) count = 8; + handle = USER_HEAP_ALLOC( sizeof(DWP) + (count-1)*sizeof(WINDOWPOS) ); if (!handle) return 0; pDWP = (DWP *) USER_HEAP_LIN_ADDR( handle ); -- 2.11.4.GIT