This commit is contained in:
Mario Fetka
2026-05-23 17:29:01 +02:00
parent 30db93ec8d
commit 64ab3a4fab
3 changed files with 151 additions and 0 deletions

View File

@@ -1218,6 +1218,46 @@ static int tests_c32getfunc(void)
}
static int tests_c32callver(void)
{
uint8 out[32];
uint16 load_ax;
uint16 res_off, res_seg;
uint16 fn_off, fn_seg;
uint16 call_ax, call_dx, flags;
memset(out, 0, sizeof(out));
fprintf(stdout, "TEST C32CALLVER\n");
fprintf(stdout, "Resolve and call CLIENT32GetVersion with zero args\n\n");
C32_CallName0_Probe("CLIENT32GetVersion", 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);
fn_off = tests_get_word_lh(out + 6);
fn_seg = tests_get_word_lh(out + 8);
call_ax = tests_get_word_lh(out + 10);
call_dx = tests_get_word_lh(out + 12);
flags = tests_get_word_lh(out + 14);
fprintf(stdout, "Load AX=%04X\n", load_ax);
fprintf(stdout, "Resolver=%04X:%04X\n", res_seg, res_off);
fprintf(stdout, "Function=%04X:%04X\n", fn_seg, fn_off);
fprintf(stdout, "Call returned DX:AX=%04X:%04X FLAGS=%04X\n",
call_dx, call_ax, flags);
tests_dump_bytes("RAW:", out, 16);
if (fn_off || fn_seg)
fprintf(stdout, "\nFunction pointer resolved.\n");
if (call_ax || call_dx)
fprintf(stdout, "Call returned non-zero version value.\n");
return(0);
}
int func_tests(int argc, char *argv[], int mode)
{
if (argc >= 2) {
@@ -1233,6 +1273,9 @@ int func_tests(int argc, char *argv[], int mode)
if (tests_same_arg(argv[1], "C32GETFUNC"))
return tests_c32getfunc();
if (tests_same_arg(argv[1], "C32CALLVER"))
return tests_c32callver();
if (tests_same_arg(argv[1], "NWREQ87"))
return tests_nwreq87(argc, argv);