Fixed a couple of error codes.

diff --git a/server/handle.c b/server/handle.c
index f170374..1baa523 100644
--- a/server/handle.c
+++ b/server/handle.c
@@ -331,13 +331,13 @@
     if (!(entry = get_handle( process, handle ))) return 0;
     if (entry->access & RESERVED_CLOSE_PROTECT)
     {
-        set_error( STATUS_INVALID_HANDLE );
+        set_error( STATUS_HANDLE_NOT_CLOSABLE );
         return 0;
     }
     obj = entry->ptr;
     if (!obj->ops->close_handle( obj, process, handle ))
     {
-        set_error( STATUS_INVALID_HANDLE );
+        set_error( STATUS_HANDLE_NOT_CLOSABLE );
         return 0;
     }
     entry->ptr = NULL;
diff --git a/server/thread.c b/server/thread.c
index 93c08ce..b035bb9 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -270,7 +270,7 @@
     struct object *obj = get_ptid_entry( id );
 
     if (obj && obj->ops == &thread_ops) return (struct thread *)grab_object( obj );
-    set_win32_error( ERROR_INVALID_THREAD_ID );
+    set_error( STATUS_INVALID_CID );
     return NULL;
 }