Skip to content

Commit

Permalink
wip2
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbird committed Mar 9, 2024
1 parent 16e3b36 commit 725fb3e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 20 deletions.
16 changes: 3 additions & 13 deletions kernel/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -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(&regs, p);
Expand All @@ -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;
}
14 changes: 8 additions & 6 deletions kernel/newstuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion kernel/proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 725fb3e

Please sign in to comment.