Files
WoW-Hybrid-gateway/tests/private_capture_account_admission_fixture.c
praxisandClaude Fable 5.2 7f2139d8d0 Offline test fixtures
883 files, from working commit b1a079a.

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

47 lines
2.7 KiB
C

/* Actual Windows account transport gate; synthetic owned token only.
* No credentials, worker, network, engine process or source session is used.
*/
#include <windows.h>
#include "wine_wire_abi.h"
#include "wine_wire_host.h"
#define GW_ENGINE_REALM_EXPORT
#include "../native/wine_wire_account.c"
#include "../native/wine_engine_realm.c"
static unsigned dispatched;
static void text(const char* s){DWORD n;unsigned size=0;while(s[size])++size;WriteFile(GetStdHandle(STD_OUTPUT_HANDLE),s,size,&n,0);}
static void number(unsigned v){char reverse[12],s[12];unsigned n=0,i;do{reverse[n++]=(char)('0'+v%10);v/=10;}while(v);for(i=0;i<n;++i)s[i]=reverse[n-i-1];s[n]=0;text(s);}
static void check(int okay,unsigned code){if(!okay){text("GW_CAPTURE_ADMISSION fail=");number(code);text("\n");ExitProcess(code);}}
NTSTATUS WINAPI gw_wire_dispatch(struct gw_wire_call* c){
check(c->operation==GW_WIRE_PRIVATE_GAMEPLAY_CAPTURE && c->transport==11 && !c->login,40);
++dispatched;text("NOTICE ");number(c->index);text(" ");number(c->opcode);text(" ");number(c->build);text("\n");c->result=0;return 0;
}
static struct gw_wire_call control(unsigned op,unsigned kind,unsigned opcode,unsigned bytes){
struct gw_wire_call c={0};c.abi=GW_WINE_WIRE_ABI;c.size=sizeof(c);c.operation=op;c.index=kind;c.opcode=opcode;c.build=bytes;return c;
}
static void notice(unsigned kind,unsigned opcode,unsigned bytes){
struct gw_wire_call c=control(GW_WIRE_PRIVATE_GAMEPLAY_CAPTURE,kind,opcode,bytes);
check(!gw_wire_account_transport(&c) && !c.result && !c.transport,30);
}
void WINAPI fixture_start(void){
struct gw_wire_call c;unsigned before;
text("GW_CAPTURE_ADMISSION entry\n");
c=control(GW_WIRE_PRIVATE_GAMEPLAY_CAPTURE,0,0,0);
check(gw_wire_account_transport(&c)!=0 && !dispatched,1);
prepared_channel=11;gw_wire_auth_data.state=1;
c=control(GW_WIRE_PRIVATE_GAMEPLAY_CAPTURE,0,0,0);
check(gw_wire_account_transport(&c)!=0 && !dispatched,2);
gw_wire_auth_data.state=2;gw_wire_auth_data.cancel=1;
c=control(GW_WIRE_PRIVATE_GAMEPLAY_CAPTURE,0,0,0);
check(gw_wire_account_transport(&c)!=0 && !dispatched,3);
gw_wire_auth_data.cancel=0;
c=control(GW_WIRE_AUTHENTICATE_MEMORY,0,0,0);
check(gw_wire_account_transport(&c)!=0 && !dispatched,4);
c=control(GW_WIRE_PRIVATE_GAMEPLAY_CAPTURE,0,0,0);c.abi=99;
check(gw_wire_account_transport(&c)!=0 && !dispatched,5);
notice(0,0,0);notice(1,0x3e0176,40);notice(3,0,0);notice(2,0,0);notice(2,0,0);notice(1,0x440001,99);
before=dispatched;prepared_channel=0;
c=control(GW_WIRE_PRIVATE_GAMEPLAY_CAPTURE,0,0,0);
check(gw_wire_account_transport(&c)!=0 && dispatched==before && !c.transport,6);
check(dispatched==6,7);text("GW_CAPTURE_ADMISSION complete\n");ExitProcess(0);
}