Francois Gouget : ntdll/tests: Fix an infinite loop on platforms where NtQuerySystemInformationEx() is not implemented.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Jan 29 09:10:08 CST 2016


Module: wine
Branch: master
Commit: 93988c503922095353a7c2da3bfacd8ab6fe2754
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=93988c503922095353a7c2da3bfacd8ab6fe2754

Author: Francois Gouget <fgouget at free.fr>
Date:   Fri Jan 29 12:32:16 2016 +0100

ntdll/tests: Fix an infinite loop on platforms where NtQuerySystemInformationEx() is not implemented.

Signed-off-by: Francois Gouget <fgouget at free.fr>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/tests/info.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c
index f590cfb..c9b6703 100644
--- a/dlls/ntdll/tests/info.c
+++ b/dlls/ntdll/tests/info.c
@@ -743,17 +743,21 @@ static void test_query_logicalprocex(void)
 
         status = pNtQuerySystemInformationEx(SystemLogicalProcessorInformationEx, &relationship, sizeof(relationship), infoex, len, &len);
         ok(status == STATUS_SUCCESS, "got 0x%08x\n", status);
-        ok(infoex->Size > 0, "got %u\n", infoex->Size);
 
         ret = pGetLogicalProcessorInformationEx(RelationAll, infoex2, &len2);
         ok(ret, "got %d, error %d\n", ret, GetLastError());
         ok(!memcmp(infoex, infoex2, len), "returned info data mismatch\n");
 
-        for(i = 0; i < len; ){
+        for(i = 0; status == STATUS_SUCCESS && i < len; ){
             SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *ex = (void*)(((char *)infoex) + i);
 
             ok(ex->Relationship >= RelationProcessorCore && ex->Relationship <= RelationGroup,
                     "Got invalid relationship value: 0x%x\n", ex->Relationship);
+            if (!ex->Size)
+            {
+                ok(0, "got infoex[%u].Size=0\n", i);
+                break;
+            }
 
             trace("infoex[%u].Size: %u\n", i, ex->Size);
             switch(ex->Relationship){




More information about the wine-cvs mailing list