+#ifdef WIN32
+
+#include <winbase.h>
+
+#define GSSEAP_GET_LAST_ERROR() (GetLastError()) /* XXX FIXME */
+
+#define GSSEAP_MUTEX CRITICAL_SECTION
+#define GSSEAP_MUTEX_INIT(m) (InitializeCriticalSection((m)), 0)
+#define GSSEAP_MUTEX_DESTROY(m) DeleteCriticalSection((m))
+#define GSSEAP_MUTEX_LOCK(m) EnterCriticalSection((m))
+#define GSSEAP_MUTEX_UNLOCK(m) LeaveCriticalSection((m))
+
+/* Thread-local is handled separately */
+
+/* Once is handled separately because INIT_ONCE is only on Vista and above */
+#define GSSEAP_ONCE_LEAVE
+#define GSSEAP_ONCE_CALLBACK(cb) void CALLBACK cb(void)
+
+#else
+