Match PSDK STATUS_* definitions.
diff --git a/server/atom.c b/server/atom.c
index 05af583..a8d26af 100644
--- a/server/atom.c
+++ b/server/atom.c
@@ -27,6 +27,9 @@
#include <stdio.h>
#include <string.h>
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
+
#include "unicode.h"
#include "request.h"
#include "object.h"
@@ -34,6 +37,7 @@
#include "handle.h"
#include "user.h"
#include "winuser.h"
+#include "winternl.h"
#define HASH_SIZE 37
#define MIN_HASH_SIZE 4
diff --git a/server/change.c b/server/change.c
index 8bd9e83..f85f0d3 100644
--- a/server/change.c
+++ b/server/change.c
@@ -28,12 +28,15 @@
#include <signal.h>
#include <sys/stat.h>
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
#include "windef.h"
#include "file.h"
#include "handle.h"
#include "thread.h"
#include "request.h"
+#include "winternl.h"
#ifdef linux
#ifndef F_NOTIFY
diff --git a/server/class.c b/server/class.c
index 77c7c58..d483aef 100644
--- a/server/class.c
+++ b/server/class.c
@@ -27,6 +27,9 @@
#include <stdio.h>
#include <string.h>
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
+
#include "wine/list.h"
#include "request.h"
@@ -34,6 +37,7 @@
#include "process.h"
#include "user.h"
#include "winuser.h"
+#include "winternl.h"
struct window_class
{
diff --git a/server/clipboard.c b/server/clipboard.c
index 26570db..3aa7f01 100644
--- a/server/clipboard.c
+++ b/server/clipboard.c
@@ -26,10 +26,13 @@
#include <stdio.h>
#include <string.h>
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
#include "request.h"
#include "object.h"
#include "user.h"
#include "winuser.h"
+#include "winternl.h"
struct clipboard
{
diff --git a/server/console.c b/server/console.c
index 8c556da..d13c7de 100644
--- a/server/console.c
+++ b/server/console.c
@@ -29,11 +29,14 @@
#include <unistd.h>
#include <signal.h>
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
#include "handle.h"
#include "process.h"
#include "request.h"
#include "unicode.h"
#include "console.h"
+#include "winternl.h"
static void console_input_dump( struct object *obj, int verbose );
static void console_input_destroy( struct object *obj );
diff --git a/server/debugger.c b/server/debugger.c
index 893225e..a7f8830 100644
--- a/server/debugger.c
+++ b/server/debugger.c
@@ -27,7 +27,10 @@
#include <stdarg.h>
#include <stdio.h>
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
#include "windef.h"
+#include "winternl.h"
#include "handle.h"
#include "process.h"
diff --git a/server/event.c b/server/event.c
index fad1542..bd73b88 100644
--- a/server/event.c
+++ b/server/event.c
@@ -26,6 +26,8 @@
#include <stdlib.h>
#include <stdarg.h>
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
#include "windef.h"
#include "winternl.h"
diff --git a/server/fd.c b/server/fd.c
index 9dc2718..4ab7cbc 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -45,6 +45,8 @@
#include <sys/types.h>
#include <unistd.h>
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
#include "object.h"
#include "file.h"
#include "handle.h"
diff --git a/server/file.c b/server/file.c
index 625caf1..4d13ca7 100644
--- a/server/file.c
+++ b/server/file.c
@@ -43,6 +43,8 @@
#include <poll.h>
#endif
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
#include "windef.h"
#include "winternl.h"
diff --git a/server/handle.c b/server/handle.c
index b9312ce..176249e 100644
--- a/server/handle.c
+++ b/server/handle.c
@@ -28,6 +28,8 @@
#include <stdio.h>
#include <stdlib.h>
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
#include "windef.h"
#include "winternl.h"
diff --git a/server/hook.c b/server/hook.c
index d523961..431243e 100644
--- a/server/hook.c
+++ b/server/hook.c
@@ -26,9 +26,12 @@
#include <stdarg.h>
#include <stdio.h>
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
+#include "winternl.h"
#include "object.h"
#include "process.h"
diff --git a/server/mailslot.c b/server/mailslot.c
index 5e9f890..2c04fe2 100644
--- a/server/mailslot.c
+++ b/server/mailslot.c
@@ -22,6 +22,8 @@
#include "config.h"
#include "wine/port.h"
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
#include "wine/unicode.h"
#include <assert.h>
diff --git a/server/mapping.c b/server/mapping.c
index 62d98c1..b6e99e4 100644
--- a/server/mapping.c
+++ b/server/mapping.c
@@ -28,6 +28,8 @@
#include <sys/stat.h>
#include <unistd.h>
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
#include "windef.h"
#include "winternl.h"
diff --git a/server/mutex.c b/server/mutex.c
index 52e6d8cbd..0953f3f 100644
--- a/server/mutex.c
+++ b/server/mutex.c
@@ -26,6 +26,8 @@
#include <stdlib.h>
#include <stdarg.h>
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
#include "windef.h"
#include "winternl.h"
diff --git a/server/named_pipe.c b/server/named_pipe.c
index 626c0e1..37eaf2c 100644
--- a/server/named_pipe.c
+++ b/server/named_pipe.c
@@ -42,6 +42,8 @@
#include <poll.h>
#endif
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
#include "windef.h"
#include "winternl.h"
diff --git a/server/object.c b/server/object.c
index 3f8d0a1..2235c60 100644
--- a/server/object.c
+++ b/server/object.c
@@ -29,6 +29,8 @@
#include <unistd.h>
#include <stdarg.h>
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
#include "winternl.h"
#include "file.h"
diff --git a/server/process.c b/server/process.c
index a5db274..fab6761 100644
--- a/server/process.c
+++ b/server/process.c
@@ -37,6 +37,8 @@
#include <poll.h>
#endif
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
#include "winternl.h"
#include "file.h"
diff --git a/server/ptrace.c b/server/ptrace.c
index 0fc82b9..e4cf889 100644
--- a/server/ptrace.c
+++ b/server/ptrace.c
@@ -24,6 +24,7 @@
#include <errno.h>
#include <stdio.h>
#include <signal.h>
+#include <stdarg.h>
#include <sys/types.h>
#ifdef HAVE_SYS_PTRACE_H
# include <sys/ptrace.h>
@@ -33,6 +34,10 @@
#endif
#include <unistd.h>
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
+#include "winternl.h"
+
#include "file.h"
#include "process.h"
#include "thread.h"
diff --git a/server/queue.c b/server/queue.c
index 8468ce6..0453b0e 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -26,10 +26,13 @@
#include <stdio.h>
#include <stdlib.h>
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
+#include "winternl.h"
#include "handle.h"
#include "file.h"
diff --git a/server/region.c b/server/region.c
index 9a3891a..5fdc16d 100644
--- a/server/region.c
+++ b/server/region.c
@@ -75,6 +75,9 @@
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
+#include "winternl.h"
#include "request.h"
#include "user.h"
diff --git a/server/registry.c b/server/registry.c
index 0a0ca23..1ffd19e 100644
--- a/server/registry.c
+++ b/server/registry.c
@@ -37,6 +37,8 @@
#include <sys/stat.h>
#include <unistd.h>
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
#include "object.h"
#include "file.h"
#include "handle.h"
diff --git a/server/semaphore.c b/server/semaphore.c
index 589704a..bff60c5 100644
--- a/server/semaphore.c
+++ b/server/semaphore.c
@@ -26,6 +26,8 @@
#include <stdlib.h>
#include <stdarg.h>
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
#include "windef.h"
#include "winternl.h"
diff --git a/server/serial.c b/server/serial.c
index 09ca6ec..88f44fb 100644
--- a/server/serial.c
+++ b/server/serial.c
@@ -46,6 +46,8 @@
#include <poll.h>
#endif
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
#include "windef.h"
#include "winternl.h"
diff --git a/server/snapshot.c b/server/snapshot.c
index 5401375..7695f0d 100644
--- a/server/snapshot.c
+++ b/server/snapshot.c
@@ -27,7 +27,10 @@
#include <stdio.h>
#include <stdlib.h>
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
#include "windef.h"
+#include "winternl.h"
#include "handle.h"
#include "process.h"
diff --git a/server/sock.c b/server/sock.c
index 601dd77..62f39e5 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -47,7 +47,10 @@
#include <time.h>
#include <unistd.h>
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
#include "windef.h"
+#include "winternl.h"
#include "process.h"
#include "file.h"
diff --git a/server/thread.c b/server/thread.c
index 50d50c8..ff22cf6 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -36,7 +36,10 @@
#include <poll.h>
#endif
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
#include "windef.h"
+#include "winternl.h"
#include "file.h"
#include "handle.h"
@@ -514,7 +517,7 @@
if (thread->suspend + thread->process->suspend > 0) return; /* suspended, ignore it */
if (debug_level) fprintf( stderr, "%04x: *wakeup* signaled=%d cookie=%p\n",
- thread->id, STATUS_TIMEOUT, cookie );
+ thread->id, (int)STATUS_TIMEOUT, cookie );
end_wait( thread );
if (send_thread_wakeup( thread, cookie, STATUS_TIMEOUT ) == -1) return;
/* check if other objects have become signaled in the meantime */
diff --git a/server/thread.h b/server/thread.h
index 64ebfe9..01e12184 100644
--- a/server/thread.h
+++ b/server/thread.h
@@ -22,7 +22,6 @@
#define __WINE_SERVER_THREAD_H
#include "object.h"
-#include "ntstatus.h"
/* thread structure */
diff --git a/server/timer.c b/server/timer.c
index 717d6d5..2576dcd 100644
--- a/server/timer.c
+++ b/server/timer.c
@@ -28,6 +28,8 @@
#include <sys/types.h>
#include <stdarg.h>
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
#include "windef.h"
#include "winternl.h"
diff --git a/server/token.c b/server/token.c
index 7cf5e06..a31d656 100644
--- a/server/token.c
+++ b/server/token.c
@@ -25,8 +25,12 @@
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
+#include <stdarg.h>
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
#include "windef.h"
+#include "winternl.h"
#include "handle.h"
#include "thread.h"
diff --git a/server/trace.c b/server/trace.c
index 36cf305..7a3cd5d 100644
--- a/server/trace.c
+++ b/server/trace.c
@@ -30,6 +30,8 @@
#include <sys/uio.h>
#endif
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
#include "windef.h"
#include "winbase.h"
#include "wincon.h"
diff --git a/server/window.c b/server/window.c
index ea19663..bc6c208 100644
--- a/server/window.c
+++ b/server/window.c
@@ -24,10 +24,13 @@
#include <assert.h>
#include <stdarg.h>
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
+#include "winternl.h"
#include "object.h"
#include "request.h"
diff --git a/server/winstation.c b/server/winstation.c
index 8dbb8f2..0f7b85d 100644
--- a/server/winstation.c
+++ b/server/winstation.c
@@ -24,6 +24,8 @@
#include <stdio.h>
#include <stdarg.h>
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
#include "windef.h"
#include "winbase.h"
#include "winuser.h"