flag
This commit is contained in:
17
flag.c
17
flag.c
@@ -33,13 +33,24 @@ typedef struct {
|
||||
uint8 raw[76]; /* file size + dates + owner + archive + reserved */
|
||||
} FLAG_NWINFO;
|
||||
|
||||
|
||||
static int flag_get_current_drive(void)
|
||||
{
|
||||
REGS regs;
|
||||
|
||||
regs.h.ah = 0x19; /* DOS get current default drive */
|
||||
int86(0x21, ®s, ®s); /* AL = 0 for A:, 1 for B:, ... */
|
||||
|
||||
return((int)regs.h.al);
|
||||
}
|
||||
|
||||
static int flag_current_dhandle(uint8 *dhandle)
|
||||
{
|
||||
uint8 connid = 0;
|
||||
uint8 flags = 0;
|
||||
int drive;
|
||||
|
||||
drive = getdisk(); /* 0=A */
|
||||
drive = flag_get_current_drive(); /* 0=A */
|
||||
if (get_drive_info((uint8)drive, &connid, dhandle, &flags))
|
||||
return(-1);
|
||||
if (!connid || (flags & 0x80))
|
||||
@@ -71,7 +82,7 @@ static int flag_ncp23_scan(uint8 dhandle, char *name, FLAG_NWINFO *info)
|
||||
memset(&req, 0, sizeof(req));
|
||||
memset(&repl, 0, sizeof(repl));
|
||||
|
||||
nlen = min(255, strlen(name));
|
||||
nlen = strlen(name); if (nlen > 255) nlen = 255;
|
||||
req.func = 0x0f;
|
||||
req.last[0] = 0xff;
|
||||
req.last[1] = 0xff;
|
||||
@@ -119,7 +130,7 @@ static int flag_ncp23_set(uint8 dhandle, char *name, FLAG_NWINFO *info, uint32 a
|
||||
memset(&req, 0, sizeof(req));
|
||||
memset(&repl, 0, sizeof(repl));
|
||||
|
||||
nlen = min(255, strlen(name));
|
||||
nlen = strlen(name); if (nlen > 255) nlen = 255;
|
||||
|
||||
req.func = 0x10;
|
||||
req.attr = (uint8)(attrs & 0xff);
|
||||
|
||||
Reference in New Issue
Block a user