This commit is contained in:
Mario Fetka
2026-05-23 18:36:38 +02:00
parent 4b7d6a1bb9
commit 919ab99ad1
3 changed files with 456 additions and 0 deletions

113
nwtests.c
View File

@@ -1300,6 +1300,113 @@ static int tests_c32mapflat(void)
}
static int tests_nwreq87c32raw_one(UI connLo, UI connHi, UI label)
{
uint8 connid = 0;
uint8 dhandle = 0;
uint8 flags = 0;
int drive;
uint8 hdr[16];
uint8 path[0x140];
uint8 rep0[0x60];
uint8 rep1[0x110];
uint8 out[32];
UI path_len;
uint16 load_ax, res_off, res_seg, tramp_off, tramp_seg, fn_off, fn_seg;
uint16 ret_ax, ret_dx, act_lo, act_hi;
drive = tests_get_current_drive();
get_drive_info((uint8)drive, &connid, &dhandle, &flags);
memset(hdr, 0, sizeof(hdr));
hdr[0] = 6;
hdr[1] = 0;
hdr[2] = 0;
tests_put_word_lh(hdr + 3, 0x0006);
tests_put_dword_lh(hdr + 5, 0x00000004UL);
path_len = tests_build_novell_handle_path(path, dhandle, 0, 0, 1,
"LOGIN.EXE", 0, 0);
memset(rep0, 0, sizeof(rep0));
memset(rep1, 0, sizeof(rep1));
memset(out, 0, sizeof(out));
fprintf(stdout, "\nTEST NWREQ87C32RAW label=%u conn32=%04X:%04X\n",
label, connHi, connLo);
fprintf(stdout, "drive=%c: connid=%u dhandle=%u flags=%02X path_len=%u\n",
'A' + drive, connid, dhandle, flags, path_len);
tests_dump_bytes("HDR :", hdr, 9);
tests_dump_bytes("PATH:", path, path_len > 48 ? 48 : path_len);
C32_NCP87_Raw_Probe(connLo, connHi,
hdr, 9,
path, path_len,
rep0, 0x4d,
rep1, 0x100,
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);
act_lo = tests_get_word_lh(out + 18);
act_hi = tests_get_word_lh(out + 20);
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 COMPAT=%04X:%04X\n", fn_seg, fn_off);
fprintf(stdout, "Return DX:AX=%04X:%04X actual=%04X:%04X\n",
ret_dx, ret_ax, act_hi, act_lo);
tests_dump_bytes("OUT :", out, 22);
tests_dump_bytes("REP0:", rep0, 64);
tests_dump_bytes("REP1:", rep1, 64);
return(0);
}
static int tests_nwreq87c32raw(int argc, char *argv[])
{
UI lo = 0;
UI hi = 0;
if (argc > 2)
lo = (UI)atoi(argv[2]);
if (argc > 3)
hi = (UI)atoi(argv[3]);
return tests_nwreq87c32raw_one(lo, hi, 0);
}
static int tests_nwreq87c32matrix(void)
{
UI vals[6];
int i;
vals[0] = 0;
vals[1] = 1;
vals[2] = 2;
vals[3] = 3;
vals[4] = 0x31;
vals[5] = 0x3130;
fprintf(stdout, "TEST NWREQ87C32MATRIX paged\n");
tests_wait_key();
for (i = 0; i < 6; i++) {
tests_nwreq87c32raw_one(vals[i], 0, (UI)i);
if (i != 5)
tests_wait_key();
}
return(0);
}
int func_tests(int argc, char *argv[], int mode)
{
if (argc >= 2) {
@@ -1321,6 +1428,12 @@ int func_tests(int argc, char *argv[], int mode)
if (tests_same_arg(argv[1], "C32MAPFLAT"))
return tests_c32mapflat();
if (tests_same_arg(argv[1], "NWREQ87C32RAW"))
return tests_nwreq87c32raw(argc, argv);
if (tests_same_arg(argv[1], "NWREQ87C32MATRIX"))
return tests_nwreq87c32matrix();
if (tests_same_arg(argv[1], "NWREQ87"))
return tests_nwreq87(argc, argv);