Fix for kernel/thread

Francois Gouget fgouget at free.fr
Fri Jan 17 14:52:34 CST 2003


Changelog:

 * dlls/kernel/tests/thread.c

   {Get,Set}ThreadPriorityBoost are stubs on Win98.


Index: dlls/kernel/tests/thread.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/tests/thread.c,v
retrieving revision 1.8
diff -u -r1.8 thread.c
--- dlls/kernel/tests/thread.c	30 Nov 2002 19:03:19 -0000	1.8
+++ dlls/kernel/tests/thread.c	17 Jan 2003 20:31:04 -0000
@@ -370,7 +370,8 @@
    HANDLE curthread,access_thread;
    DWORD curthreadId,exitCode;
    int min_priority=-2,max_priority=2;
-   int i,error;
+   BOOL disabled;
+   int i;

    curthread=GetCurrentThread();
    curthreadId=GetCurrentThreadId();
@@ -398,7 +399,7 @@
          ok(pSetThreadPriorityBoost(access_thread,1)==0,
             "SetThreadPriorityBoost did not obey access restrictions");
        if (pGetThreadPriorityBoost)
-         ok(pGetThreadPriorityBoost(access_thread,&error)==0,
+         ok(pGetThreadPriorityBoost(access_thread,&disabled)==0,
             "GetThreadPriorityBoost did not obey access restrictions");
        ok(GetExitCodeThread(access_thread,&exitCode)==0,
           "GetExitCodeThread did not obey access restrictions");
@@ -426,15 +427,25 @@

 /* Check thread priority boost */
    if (pGetThreadPriorityBoost && pSetThreadPriorityBoost) {
+     BOOL rc;
      todo_wine {
-       ok(pSetThreadPriorityBoost(curthread,1)!=0,
-          "SetThreadPriorityBoost Failed");
-       ok(pGetThreadPriorityBoost(curthread,&error)!=0 && error==1,
-          "GetThreadPriorityBoost Failed");
-       ok(pSetThreadPriorityBoost(curthread,0)!=0,
-          "SetThreadPriorityBoost Failed");
-       ok(pGetThreadPriorityBoost(curthread,&error)!=0 && error==0,
-          "GetThreadPriorityBoost Failed");
+         SetLastError(0);
+         rc=pGetThreadPriorityBoost(curthread,&disabled);
+         if (rc!=0 || GetLastError()!=ERROR_CALL_NOT_IMPLEMENTED) {
+             ok(rc!=0,"error=%ld",GetLastError());
+
+             ok(pSetThreadPriorityBoost(curthread,1)!=0,
+                "error=%ld",GetLastError());
+             rc=pGetThreadPriorityBoost(curthread,&disabled);
+             ok(rc!=0 && disabled==1,
+                "rc=%d error=%ld disabled=%d",rc,GetLastError(),disabled);
+
+             ok(pSetThreadPriorityBoost(curthread,0)!=0,
+                "error=%ld",GetLastError());
+             rc=pGetThreadPriorityBoost(curthread,&disabled);
+             ok(rc!=0 && disabled==0,
+                "rc=%d error=%ld disabled=%d",rc,GetLastError(),disabled);
+         }
      }
    }
 }


-- 
Francois Gouget         fgouget at free.fr        http://fgouget.free.fr/
            Before you criticize someone, walk a mile in his shoes.
       That way, if he gets angry, he'll be a mile away - and barefoot.




More information about the wine-patches mailing list