Files
WoW-Hybrid-gateway/native/nohelper/realm_diag_admission.private.h
praxisandClaude Fable 5.2 8e02dccb86 In-client stack: transport, session lifecycle and engine bridge
175 files, from working commit b1a079a.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-19 01:32:48 +02:00

24 lines
1.0 KiB
C

#ifndef GW_REALM_DIAG_ADMISSION_PRIVATE_H
#define GW_REALM_DIAG_ADMISSION_PRIVATE_H
#include <windows.h>
#include <stdint.h>
#include "wine_engine_realm.h"
#include "wine_preopen_hook.private.h"
/* The admitted original owner/thread is the sole diagnostic source in both
* direct constructor-seam and historical hardware modes. */
static inline int gw_realm_diag_admitted(const struct GwWirePreOpenHook *pre,
const struct gw_engine_realm_control *realm,
void *owner, DWORD thread) {
return pre && realm && owner && thread &&
pre->abi==1 && pre->size==sizeof(*pre) &&
InterlockedCompareExchange((volatile LONG *)&pre->ready,1,1)==1 &&
pre->owner==owner && pre->primary_thread==thread &&
pre->reserved==0 &&
realm->abi==1 && realm->size==sizeof(*realm) &&
realm->owner==(uint64_t)(uintptr_t)owner;
}
static inline int gw_realm_diag_once(volatile LONG *marker) {
return marker && InterlockedCompareExchange(marker,1,0)==0;
}
#endif