Files
WoW-Hybrid-gateway/native/nohelper/wire_realm_observe.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

44 lines
1.7 KiB
C

#ifndef GW_WIRE_REALM_OBSERVE_PRIVATE_H
#define GW_WIRE_REALM_OBSERVE_PRIVATE_H
#include "wine_engine_realm.h"
typedef void (WINAPI *GwWireOriginalRealmOpen)(void *owner);
struct GwWireRealmObservation {
LONG stage_before_call;
LONG stage_after_call;
LONG error;
LONG state_before;
LONG state_after;
LONG result;
LONG entered_original;
LONG exit_gate;
};
typedef void (*GwWireRealmObserver)(const struct GwWireRealmObservation *);
/* The marker is set at the actual original-call boundary by the Realm object.
* A stage transition alone is not evidence that this call entered original. */
static inline void gw_wire_realm_open_observed(
void *owner, GwWireOriginalRealmOpen open_realm,
const struct gw_engine_realm_control *realm,
volatile LONG *entered_original, volatile LONG *exit_gate,
GwWireRealmObserver observer) {
struct GwWireRealmObservation seen;
seen.stage_before_call = InterlockedCompareExchange(
(volatile LONG *)&realm->stage, 0, 0);
open_realm(owner);
seen.stage_after_call = InterlockedCompareExchange(
(volatile LONG *)&realm->stage, 0, 0);
seen.error = InterlockedCompareExchange((volatile LONG *)&realm->error, 0, 0);
seen.state_before = InterlockedCompareExchange(
(volatile LONG *)&realm->state_before, 0, 0);
seen.state_after = InterlockedCompareExchange(
(volatile LONG *)&realm->state_after, 0, 0);
seen.result = InterlockedCompareExchange((volatile LONG *)&realm->result, 0, 0);
seen.entered_original = InterlockedCompareExchange(entered_original, 0, 0);
seen.exit_gate = InterlockedCompareExchange(exit_gate, 0, 0);
if (observer) observer(&seen);
}
#endif