Index: /trunk/source/lisp-kernel/thread_manager.c
===================================================================
--- /trunk/source/lisp-kernel/thread_manager.c	(revision 15141)
+++ /trunk/source/lisp-kernel/thread_manager.c	(revision 15142)
@@ -87,5 +87,5 @@
   /* What if the suspend count is > 1 at this point ?  I don't think
      that that matters, but I'm not sure */
-  pcontext->ContextFlags = CONTEXT_FULL;
+  pcontext->ContextFlags = CONTEXT_ALL;
   rc = GetThreadContext(hthread, pcontext);
   if (rc == 0) {
@@ -2020,5 +2020,5 @@
       return false;
     }
-    pcontext->ContextFlags = CONTEXT_FULL;
+    pcontext->ContextFlags = CONTEXT_ALL;
     rc = GetThreadContext(hthread, pcontext);
     if (rc == 0) {
@@ -2027,9 +2027,4 @@
     where = (pc)(xpPC(pcontext));
 
-    if ((where >= restore_windows_context_start) &&
-        (where < restore_windows_context_end) &&
-        (tcr->valence != TCR_STATE_LISP)) {
-      Bug(NULL, "Forgot about this case ...");
-    }
     if (tcr->valence == TCR_STATE_LISP) {
       if ((where >= restore_windows_context_start) &&
@@ -2066,5 +2061,11 @@
           ResumeThread(hthread);
           SEM_WAIT_FOREVER(TCR_AUX(tcr)->suspend);
-          pcontext = NULL;
+          SuspendThread(hthread);
+          /* The thread is either waiting for its resume semaphore to
+             be signaled or is about to wait.  Signal it now, while
+             the thread's suspended. */
+          SEM_RAISE(TCR_AUX(tcr)->resume);
+          pcontext->ContextFlags = CONTEXT_ALL;
+          GetThreadContext(hthread, pcontext);
         }
       }
@@ -2193,22 +2194,13 @@
     HANDLE hthread = (HANDLE)(TCR_AUX(tcr)->osid);
 
-
-    TCR_AUX(tcr)->suspend_context = NULL;
     if (context) {
-      if (tcr->valence == TCR_STATE_LISP) {
-        rc = SetThreadContext(hthread,context);
-        if (! rc) {
-          Bug(NULL,"SetThreadContext");
-          return false;
-        }
-      }
+      context->ContextFlags = CONTEXT_ALL;
+      TCR_AUX(tcr)->suspend_context = NULL;
+      SetThreadContext(hthread,context);
       rc = ResumeThread(hthread);
       if (rc == -1) {
-        Bug(NULL,"ResumeThread");
+        wperror("ResumeThread");
         return false;
       }
-      return true;
-    } else {
-      SEM_RAISE(TCR_AUX(tcr)->resume);
       return true;
     }
