NCP22/1A / Subfunction 26
All checks were successful
Source release / source-package (push) Successful in 36s
All checks were successful
Source release / source-package (push) Successful in 36s
This commit is contained in:
71
src/nwconn.c
71
src/nwconn.c
@@ -902,20 +902,69 @@ static int handle_ncp_serv(void)
|
||||
break;
|
||||
|
||||
case 0x1a : { /* Get Pathname of A Volume Dir Pair */
|
||||
#if 0
|
||||
struct INPUT {
|
||||
uint8 header[7]; /* Requestheader */
|
||||
uint8 div[3]; /* 0x0, dlen, ufunc */
|
||||
uint8 volume;
|
||||
uint8 dir_entry[2];
|
||||
} *input = (struct INPUT *) (ncprequest);
|
||||
/*
|
||||
* Old NetWare 2.x compatibility call:
|
||||
* byte volume
|
||||
* word directory entry number (Hi-Lo)
|
||||
*
|
||||
* Reply:
|
||||
* byte path length
|
||||
* byte path[path length]
|
||||
*
|
||||
* This is the older string form of the NCP23/F3 mapping.
|
||||
* NCP23/F3 is preferred for 32-bit directory numbers and
|
||||
* namespace-aware callers.
|
||||
*/
|
||||
struct XDATA {
|
||||
uint8 pathlen;
|
||||
uint8 pathname;
|
||||
uint8 pathname[255];
|
||||
} *xdata = (struct XDATA*)responsedata;
|
||||
#endif
|
||||
completition = 0xfb; /* !!!!! TODO !!!! */
|
||||
}
|
||||
int volume = (int)*(p+1);
|
||||
uint32 dirnum = (uint32)GET_BE16(p+2);
|
||||
uint8 comps[256];
|
||||
uint8 pathbuf[255];
|
||||
int result;
|
||||
int pos = 0;
|
||||
int out = 0;
|
||||
int first = 1;
|
||||
|
||||
result = map_directory_number_to_path(volume, dirnum, 0,
|
||||
comps, sizeof(comps));
|
||||
if (result > -1) {
|
||||
while (pos < result) {
|
||||
int l = (int)comps[pos++];
|
||||
|
||||
if (l <= 0 || pos + l > result) {
|
||||
result = -0x9c;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!first) {
|
||||
if (out >= (int)sizeof(pathbuf)) {
|
||||
result = -0x9c;
|
||||
break;
|
||||
}
|
||||
pathbuf[out++] = '\\';
|
||||
}
|
||||
|
||||
if (out + l > (int)sizeof(pathbuf)) {
|
||||
result = -0x9c;
|
||||
break;
|
||||
}
|
||||
|
||||
memcpy(pathbuf + out, comps + pos, l);
|
||||
out += l;
|
||||
pos += l;
|
||||
first = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (result > -1) {
|
||||
xdata->pathlen = (uint8)out;
|
||||
memcpy(xdata->pathname, pathbuf, out);
|
||||
data_len = out + 1;
|
||||
} else completition = (uint8)(-result);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x1e : { /* SCAN a Directory, e.g. used by ndir.exe */
|
||||
|
||||
Reference in New Issue
Block a user