code wiki / _hdl_build / _gpu_dxg_r1_recon2.nx

_gpu_dxg_r1_recon2.nx

buildroot/runtime/_hdl_build/_gpu_dxg_r1_recon2.nx

6048 B107 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic gpu
docsdependenciesstructsconstsfunctions

about

_gpu_dxg_r1_recon2.nx -- R1 recon pass 2. nr=0x09 (LX_DXQUERYADAPTERINFO, code 0xC0184709) is PINNED LIVE (it returns -EINVAL=-22 = handler reached, vs -ENOTTY=-25 for unknown nrs). Now we figure out WHY EINVAL on type=8 and find the type/size that returns a real string. Sweeps, on the adapter[0] ENUM handle (0x40000000): (1) type 0..40 with a big buffer + size=1568 -- report ret per type (find which != EINVAL). (2) for type=8 (ADAPTERREGISTRYINFO), sweep private_data_size {0,4,520,1568,1572,4096} to see if EINVAL is a size check. (3) try a NULL private_data (size 0) per type -- some dxgkrnl types only validate size. (4) ALSO try KMTQAITYPE_ADAPTERADDRESS(=6)/ADAPTERGUID(=4)/UMDRIVERNAME(=1) which are the lightest host round-trips, to learn whether WSL dxgkrnl services ANY query type at all. AUTHOR=ORGAN / NO-WAVE / raw syscalls only. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx _gpu_dxg_r1_recon2.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main p sys_write sys_openat_rd sys_exit sys_mmap sys_ioctl n sys_mmap ↻ sys_write ↻ x p ↻ sys_mmap ↻ sys_write ↻ query sys_mmap ↻ sys_ioctl ↻ print_utf16 sys_mmap ↻ sys_write ↻ dump_hex p ↻ x ↻ sys_close

structs

none

consts

15const DXG_LX_DXENUMADAPTERS2: i64 = 0xC0104714
16const QAI_CODE: i64 = 0xC0184709 // _IOWR(0x47, 0x09, 24) -- pinned live in pass 1

functions

18func p(s: *u8) -> i64 { var nn: i64=0; while s[nn]!=(0 as u8){nn=nn+1} sys_write(1,s,nn); return 0 }
called by 3: xdump_hexmain calls 1: sys_write
19func n(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(1,bb,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
20func x(v: i64) -> i64 { p("0x" as *u8); let bb:*u8=sys_mmap(20); var k:i64=0; var m:i64=v; if m==0{bb[0]=48;k=1}; while m>0{ let d:i64=m&15; if d<10{bb[k]=(48+d) as u8}else{bb[k]=(87+d) as u8}; m=(m>>4); k=k+1 } var i:i64=0; let o:*u8=sys_mmap(20); while i<k{o[i]=bb[k-1-i];i=i+1} sys_write(1,o,k); return 0 }
called by 2: dump_hexmain calls 3: psys_mmapsys_write
22func print_utf16(base: *u8, off: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
34func dump_hex(base: *u8, cnt: i64) -> i64
called by 1: main calls 2: px
40func query(fd: i64, handle: i64, qtype: i64, priv: *u8, psize: i64) -> i64
called by 1: main calls 2: sys_mmapsys_ioctl
50func main() -> i64