debug NCP22/42 = GetEffectiveRights
All checks were successful
Source release / source-package (push) Successful in 45s

This commit is contained in:
Mario Fetka
2026-05-25 14:46:24 +02:00
parent 8606579f8b
commit 571c356e70

View File

@@ -1071,14 +1071,30 @@ static int handle_ncp_serv(void)
struct XDATA {
uint8 eff_rights[2]; /* LO-HI */
} *xdata = (struct XDATA*) responsedata;
int result = nw_get_eff_dir_rights(
(int)*(p+1),
p+3,
(int)*(p+2), 1);
int dir_handle = (int)*(p+1);
int pathlen = (int)*(p+2);
uint8 *path = p+3;
int copylen = pathlen;
uint8 pathbuf[256];
int result;
if (copylen > 255) copylen = 255;
memcpy(pathbuf, path, copylen);
pathbuf[copylen] = '\0';
result = nw_get_eff_dir_rights(dir_handle, path, pathlen, 1);
if (result > -1){
U16_TO_16(result, xdata->eff_rights);
data_len = sizeof(struct XDATA);
} else completition = (uint8) (-result);
XDPRINTF((1,0,
"NCP22/42 GetEffectiveRights: dh=%d pathlen=%d path=`%s` rights=0x%04x",
dir_handle, pathlen, pathbuf, result));
} else {
completition = (uint8) (-result);
XDPRINTF((1,0,
"NCP22/42 GetEffectiveRights: dh=%d pathlen=%d path=`%s` rc=%d",
dir_handle, pathlen, pathbuf, result));
}
}
break;