175 files, from working commit b1a079a. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
24 lines
1.0 KiB
C
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
|