diff --git a/kernel/network.c b/kernel/network.c index 54593429..79a4957d 100644 --- a/kernel/network.c +++ b/kernel/network.c @@ -156,17 +156,15 @@ BYTE remote_getfree_11a3(void FAR *cds, void *dst) return SUCCESS; } -BYTE remote_getvolumeinfo(UBYTE drive, UBYTE bufsiz, void *dst_r, char FAR *dst_s) +BYTE remote_getvolumeinfo(UBYTE drive, struct xgetvolumeinfo *s) { - UWORD *udst = (UWORD *)dst_r; iregs regs = {}; - struct xgetvolumeinfo s; struct xgetvolumeinfo FAR *p; - p = MK_FAR(s); + p = MK_FAR(*s); regs.a.x = 0x11a0; - regs.c.x = sizeof(s); + regs.c.x = sizeof(*s); regs.d.b.l = drive; regs.d.b.h = 1; /* we'd like a version one structure returned */ regs.es = FP_SEG_OBJ(®s, p); @@ -177,13 +175,5 @@ BYTE remote_getvolumeinfo(UBYTE drive, UBYTE bufsiz, void *dst_r, char FAR *dst_ if ((regs.flags & FLG_CARRY) || (regs.a.x != 0x1c01)) return DE_INVLDFUNC; - if (bufsiz < s.namelen + 1) - return DE_INVLDBUF; - - udst[0] = s.flags.std; - udst[1] = s.flags.ext; - udst[2] = s.maxfilenamelen; - udst[3] = s.maxpathlen; - n_fmemcpy(dst_s, s.name, s.namelen + 1); return SUCCESS; } diff --git a/kernel/newstuff.c b/kernel/newstuff.c index bcbb4532..f9da909d 100644 --- a/kernel/newstuff.c +++ b/kernel/newstuff.c @@ -661,14 +661,16 @@ COUNT DosGetVolumeInfo(const char FAR *DriveString, UBYTE bufsiz, UWORD *outv, c if (cdsp->cdsFlags & CDSNETWDRV) /* Try redirector extension */ { - UWORD rg[4]; - rc = remote_getvolumeinfo(drive, bufsiz, rg, name); + struct xgetvolumeinfo xg; + rc = remote_getvolumeinfo(drive, &xg); if (rc == SUCCESS) { - outv[0] = rg[0]; - /* caller doesn't need extended flags */ - outv[1] = rg[2]; - outv[2] = rg[3]; + outv[0] = xg.flags.std; + outv[1] = xg.maxfilenamelen; + outv[2] = xg.maxpathlen; + if (bufsiz < xg.namelen + 1) + return DE_INVLDBUF; + n_fmemcpy(name, xg.name, xg.namelen + 1); } return rc; } diff --git a/kernel/proto.h b/kernel/proto.h index 06dfe4f8..ceee1797 100644 --- a/kernel/proto.h +++ b/kernel/proto.h @@ -411,7 +411,7 @@ BYTE remote_qualify_filename(__FAR(char) dst, __FAR(const char) src); #define remote_rw(cmd,s,arg) network_redirector_mx(cmd, s, arg) BYTE remote_getfree(__FAR(void) cds, void *dst); BYTE remote_getfree_11a3(__FAR(void) cds, void *dst); -BYTE remote_getvolumeinfo(UBYTE drive, UBYTE bufsiz, void *dst_r, __FAR(char) dst_s); +BYTE remote_getvolumeinfo(UBYTE drive, struct xgetvolumeinfo *s); UDWORD remote_lseek(__FAR(void) sft, DWORD new_pos); UWORD remote_getfattr(void); #define remote_setfattr(attr) (WORD)network_redirector_mx(REM_SETATTR, NULL, attr)