This commit is contained in:
Mario Fetka
2026-05-23 20:37:11 +02:00
parent aea28fe38a
commit f07488978c
3 changed files with 314 additions and 0 deletions

View File

@@ -1653,6 +1653,64 @@ static int tests_c32scanrefs2(void)
}
static int tests_c32scaniter(int argc, char *argv[])
{
uint8 out[40];
UI iterLo = 0;
UI iterHi = 0;
uint16 load_ax, res_off, res_seg, tramp_off, tramp_seg;
uint16 fn_off, fn_seg, ret_ax, ret_dx;
uint16 cref_lo, cref_hi, rinfo_lo, rinfo_hi, out_iter_lo, out_iter_hi;
if (argc > 2)
iterLo = (UI)atoi(argv[2]);
if (argc > 3)
iterHi = (UI)atoi(argv[3]);
memset(out, 0, sizeof(out));
fprintf(stdout, "TEST C32SCANITER initial iterator=%04X:%04X\n", iterHi, iterLo);
fprintf(stdout, "CONNScanInfo return NWCC_INFO_CONN_REF with caller-supplied iterator\n");
C32_ScanRefsIter_Probe(iterLo, iterHi, out);
load_ax = tests_get_word_lh(out + 0);
res_off = tests_get_word_lh(out + 2);
res_seg = tests_get_word_lh(out + 4);
tramp_off = tests_get_word_lh(out + 6);
tramp_seg = tests_get_word_lh(out + 8);
fn_off = tests_get_word_lh(out + 10);
fn_seg = tests_get_word_lh(out + 12);
ret_ax = tests_get_word_lh(out + 14);
ret_dx = tests_get_word_lh(out + 16);
cref_lo = tests_get_word_lh(out + 18);
cref_hi = tests_get_word_lh(out + 20);
rinfo_lo = tests_get_word_lh(out + 22);
rinfo_hi = tests_get_word_lh(out + 24);
out_iter_lo = tests_get_word_lh(out + 26);
out_iter_hi = tests_get_word_lh(out + 28);
fprintf(stdout, "Load AX=%04X Resolver=%04X:%04X Tramp=%04X:%04X\n",
load_ax, res_seg, res_off, tramp_seg, tramp_off);
fprintf(stdout, "Function CONNScanInfo=%04X:%04X\n", fn_seg, fn_off);
fprintf(stdout, "Return DX:AX=%04X:%04X\n", ret_dx, ret_ax);
fprintf(stdout, "connRef=%04X:%04X returnInfo=%04X:%04X iterator=%04X:%04X\n",
cref_hi, cref_lo, rinfo_hi, rinfo_lo, out_iter_hi, out_iter_lo);
tests_dump_bytes("OUT:", out, 30);
if (ret_ax == 0 && ret_dx == 0) {
fprintf(stdout, "\nNext iterator test:\n");
fprintf(stdout, " TESTS C32SCANITER %u %u\n", out_iter_lo, out_iter_hi);
if ((cref_lo || cref_hi) && !(cref_lo == 0xFFFE && cref_hi == 0xFFFF)) {
fprintf(stdout, "Try open:\n");
fprintf(stdout, " TESTS C32OPENREF %u %u\n", cref_lo, cref_hi);
}
}
return(0);
}
int func_tests(int argc, char *argv[], int mode)
{
if (argc >= 2) {
@@ -1692,6 +1750,9 @@ int func_tests(int argc, char *argv[], int mode)
if (tests_same_arg(argv[1], "C32SCANREFS2"))
return tests_c32scanrefs2();
if (tests_same_arg(argv[1], "C32SCANITER"))
return tests_c32scaniter(argc, argv);
if (tests_same_arg(argv[1], "NWREQ87C32MATRIX"))
return tests_nwreq87c32matrix();