2 * DOS interrupt 21h handler
13 #include <sys/types.h>
27 #if defined(__svr4__) || defined(_SCO_DS)
28 /* SVR4 DOESNT do locking the same way must implement properly */
35 #define DOS_GET_DRIVE(reg) ((reg) ? (reg) - 1 : DRIVE_GetCurrentDrive())
37 /* Define the drive parameter block, as used by int21/1F
38 * and int21/32. This table can be accessed through the
39 * global 'dpb' pointer, which points into the local dos
44 BYTE drive_num
; /* 0=A, etc. */
45 BYTE unit_num
; /* Drive's unit number (?) */
46 WORD sector_size
; /* Sector size in bytes */
47 BYTE high_sector
; /* Highest sector in a cluster */
48 BYTE shift
; /* Shift count (?) */
49 WORD reserved
; /* Number of reserved sectors at start */
50 BYTE num_FAT
; /* Number of FATs */
51 WORD dir_entries
; /* Number of root dir entries */
52 WORD first_data
; /* First data sector */
53 WORD high_cluster
; /* Highest cluster number */
54 WORD sectors_in_FAT
; /* Number of sectors per FAT */
55 WORD start_dir
; /* Starting sector of first dir */
56 DWORD driver_head
; /* Address of device driver header (?) */
57 BYTE media_ID
; /* Media ID */
58 BYTE access_flag
; /* Prev. accessed flag (0=yes,0xFF=no) */
59 DWORD next
; /* Pointer to next DPB in list */
60 WORD free_search
; /* Free cluster search start */
61 WORD free_clusters
; /* Number of free clusters (0xFFFF=unknown) */
73 static struct DosHeap
*heap
;
74 static WORD DosHeapHandle
;
76 WORD sharing_retries
= 3; /* number of retries at sharing violation */
77 WORD sharing_pause
= 1; /* pause between retries */
79 extern char TempDirectory
[];
81 static BOOL32
INT21_CreateHeap(void)
83 if (!(DosHeapHandle
= GlobalAlloc16(GMEM_FIXED
,sizeof(struct DosHeap
))))
85 WARN(int21
, "Out of memory\n");
88 heap
= (struct DosHeap
*) GlobalLock16(DosHeapHandle
);
89 dpbsegptr
= PTR_SEG_OFF_TO_SEGPTR(DosHeapHandle
,(int)&heap
->dpb
-(int)heap
);
91 strcpy(heap
->biosdate
, "01/01/80");
95 static BYTE
*GetCurrentDTA(void)
97 TDB
*pTask
= (TDB
*)GlobalLock16( GetCurrentTask() );
98 return (BYTE
*)PTR_SEG_TO_LIN( pTask
->dta
);
102 void CreateBPB(int drive
, BYTE
*data
, BOOL16 limited
)
103 /* limited == TRUE is used with INT 0x21/0x440d */
108 setword(&data
[3], 0);
110 setword(&data
[6], 240);
111 setword(&data
[8], 64000);
113 setword(&data
[0x0b], 40);
114 setword(&data
[0x0d], 56);
115 setword(&data
[0x0f], 2);
116 setword(&data
[0x11], 0);
118 setword(&data
[0x1f], 800);
120 setword(&data
[0x22], 1);
122 } else { /* 1.44mb */
125 setword(&data
[3], 0);
127 setword(&data
[6], 240);
128 setword(&data
[8], 2880);
130 setword(&data
[0x0b], 6);
131 setword(&data
[0x0d], 18);
132 setword(&data
[0x0f], 2);
133 setword(&data
[0x11], 0);
135 setword(&data
[0x1f], 80);
137 setword(&data
[0x22], 2);
142 static int INT21_GetFreeDiskSpace( CONTEXT
*context
)
144 DWORD cluster_sectors
, sector_bytes
, free_clusters
, total_clusters
;
145 char root
[] = "A:\\";
147 *root
+= DOS_GET_DRIVE( DL_reg(context
) );
148 if (!GetDiskFreeSpace32A( root
, &cluster_sectors
, §or_bytes
,
149 &free_clusters
, &total_clusters
)) return 0;
150 AX_reg(context
) = cluster_sectors
;
151 BX_reg(context
) = free_clusters
;
152 CX_reg(context
) = sector_bytes
;
153 DX_reg(context
) = total_clusters
;
157 static int INT21_GetDriveAllocInfo( CONTEXT
*context
)
159 if (!INT21_GetFreeDiskSpace( context
)) return 0;
160 if (!heap
&& !INT21_CreateHeap()) return 0;
161 heap
->mediaID
= 0xf0;
162 DS_reg(context
) = DosHeapHandle
;
163 BX_reg(context
) = (int)&heap
->mediaID
- (int)heap
;
167 static void GetDrivePB( CONTEXT
*context
, int drive
)
169 if(!DRIVE_IsValid(drive
))
171 DOS_ERROR( ER_InvalidDrive
, EC_MediaError
, SA_Abort
, EL_Disk
);
172 AX_reg(context
) = 0x00ff;
174 else if (heap
|| INT21_CreateHeap())
176 FIXME(int21
, "GetDrivePB not fully implemented.\n");
178 /* FIXME: I have no idea what a lot of this information should
179 * say or whether it even really matters since we're not allowing
180 * direct block access. However, some programs seem to depend on
181 * getting at least _something_ back from here. The 'next' pointer
182 * does worry me, though. Should we have a complete table of
183 * separate DPBs per drive? Probably, but I'm lazy. :-) -CH
185 heap
->dpb
.drive_num
= heap
->dpb
.unit_num
= drive
; /*The same?*/
186 heap
->dpb
.sector_size
= 512;
187 heap
->dpb
.high_sector
= 1;
188 heap
->dpb
.shift
= drive
< 2 ? 0 : 6; /*6 for HD, 0 for floppy*/
189 heap
->dpb
.reserved
= 0;
190 heap
->dpb
.num_FAT
= 1;
191 heap
->dpb
.dir_entries
= 2;
192 heap
->dpb
.first_data
= 2;
193 heap
->dpb
.high_cluster
= 64000;
194 heap
->dpb
.sectors_in_FAT
= 1;
195 heap
->dpb
.start_dir
= 1;
196 heap
->dpb
.driver_head
= 0;
197 heap
->dpb
.media_ID
= (drive
> 1) ? 0xF8 : 0xF0;
198 heap
->dpb
.access_flag
= 0;
200 heap
->dpb
.free_search
= 0;
201 heap
->dpb
.free_clusters
= 0xFFFF; /* unknown */
203 AL_reg(context
) = 0x00;
204 DS_reg(context
) = SELECTOROF(dpbsegptr
);
205 BX_reg(context
) = OFFSETOF(dpbsegptr
);
210 static void ioctlGetDeviceInfo( CONTEXT
*context
)
215 TRACE(int21
, "(%d)\n", BX_reg(context
));
217 RESET_CFLAG(context
);
220 if ((file
= FILE_GetFile( BX_reg(context
) )))
222 const DOS_DEVICE
*dev
= DOSFS_GetDevice( file
->unix_name
);
223 FILE_ReleaseFile( file
);
226 DX_reg(context
) = dev
->flags
;
231 /* it seems to be a file */
232 curr_drive
= DRIVE_GetCurrentDrive();
233 DX_reg(context
) = 0x0140 + curr_drive
+ ((curr_drive
> 1) ? 0x0800 : 0);
235 /* bits 0-5 are current drive
236 * bit 6 - file has NOT been written..FIXME: correct?
237 * bit 8 - generate int24 if no diskspace on write/ read past end of file
238 * bit 11 - media not removable
239 * bit 14 - don't set file date/time on closing
240 * bit 15 - file is remote
244 static BOOL32
ioctlGenericBlkDevReq( CONTEXT
*context
)
246 BYTE
*dataptr
= PTR_SEG_OFF_TO_LIN(DS_reg(context
), DX_reg(context
));
247 int drive
= DOS_GET_DRIVE( BL_reg(context
) );
249 if (!DRIVE_IsValid(drive
))
251 DOS_ERROR( ER_FileNotFound
, EC_NotFound
, SA_Abort
, EL_Disk
);
255 if (CH_reg(context
) != 0x08)
257 INT_BARF( context
, 0x21 );
261 switch (CL_reg(context
))
263 case 0x4a: /* lock logical volume */
264 TRACE(int21
,"lock logical volume (%d) level %d mode %d\n",drive
,BH_reg(context
),DX_reg(context
));
267 case 0x60: /* get device parameters */
268 /* used by w4wgrp's winfile */
269 memset(dataptr
, 0, 0x20); /* DOS 6.22 uses 0x20 bytes */
271 dataptr
[6] = 0; /* media type */
274 dataptr
[1] = 0x05; /* fixed disk */
275 setword(&dataptr
[2], 0x01); /* non removable */
276 setword(&dataptr
[4], 0x300); /* # of cylinders */
280 dataptr
[1] = 0x07; /* block dev, floppy */
281 setword(&dataptr
[2], 0x02); /* removable */
282 setword(&dataptr
[4], 80); /* # of cylinders */
284 CreateBPB(drive
, &dataptr
[7], TRUE
);
285 RESET_CFLAG(context
);
288 case 0x66:/* get disk serial number */
290 char label
[12],fsname
[9],path
[4];
293 strcpy(path
,"x:\\");path
[0]=drive
+'A';
294 GetVolumeInformation32A(
295 path
,label
,12,&serial
,NULL
,NULL
,fsname
,9
298 memcpy(dataptr
+2,&serial
,4);
299 memcpy(dataptr
+6,label
,11);
300 memcpy(dataptr
+17,fsname
,8);
305 TRACE(int21
,"logical volume %d unlocked.\n",drive
);
309 memset(dataptr
+1, '\0', dataptr
[0]-1);
310 dataptr
[1] = dataptr
[0];
311 dataptr
[2] = 0x07; /* protected mode driver; no eject; no notification */
312 dataptr
[3] = 0xFF; /* no physical drive */
316 INT_BARF( context
, 0x21 );
321 static void INT21_GetSystemDate( CONTEXT
*context
)
324 GetLocalTime( &systime
);
325 CX_reg(context
) = systime
.wYear
;
326 DX_reg(context
) = (systime
.wMonth
<< 8) | systime
.wDay
;
327 AX_reg(context
) = systime
.wDayOfWeek
;
330 static void INT21_GetSystemTime( CONTEXT
*context
)
333 GetLocalTime( &systime
);
334 CX_reg(context
) = (systime
.wHour
<< 8) | systime
.wMinute
;
335 DX_reg(context
) = (systime
.wSecond
<< 8) | (systime
.wMilliseconds
/ 10);
338 /* Many calls translate a drive argument like this:
339 drive number (00h = default, 01h = A:, etc)
341 static char drivestring
[]="default";
343 char *INT21_DriveName(int drive
)
348 drivestring
[0]= (unsigned char)drive
+ '@';
354 static BOOL32
INT21_CreateFile( CONTEXT
*context
)
356 AX_reg(context
) = _lcreat16( PTR_SEG_OFF_TO_LIN( DS_reg(context
),
357 DX_reg(context
) ), CX_reg(context
) );
358 return (AX_reg(context
) == (WORD
)HFILE_ERROR16
);
362 static void OpenExistingFile( CONTEXT
*context
)
364 AX_reg(context
) = _lopen16( PTR_SEG_OFF_TO_LIN(DS_reg(context
),DX_reg(context
)),
366 if (AX_reg(context
) == (WORD
)HFILE_ERROR16
)
368 AX_reg(context
) = DOS_ExtendedError
;
377 switch (AX_reg(context
) & 0x0070)
379 case 0x00: /* compatability mode */
380 case 0x40: /* DENYNONE */
384 case 0x30: /* DENYREAD */
385 TRACE(int21
, "(%s): DENYREAD changed to DENYALL\n",
386 (char *)PTR_SEG_OFF_TO_LIN(DS_reg(context
),DX_reg(context
)));
387 case 0x10: /* DENYALL */
391 case 0x20: /* DENYWRITE */
402 int result
,retries
=sharing_retries
;
404 #if defined(__svr4__) || defined(_SCO_DS)
405 ERR(int21
, "Should call flock and needs porting to lockf\n");
409 result
= flock(handle
, lock
| LOCK_NB
);
411 if ( retries
&& (!result
) )
414 for(i
=0;i
<32768*((int)sharing_pause
);i
++)
415 result
++; /* stop the optimizer */
416 for(i
=0;i
<32768*((int)sharing_pause
);i
++)
420 while( (!result
) && (!(retries
--)) );
425 AX_reg(context
) = DOS_ExtendedError
;
434 AX_reg(context
) = handle
;
435 RESET_CFLAG(context
);
440 static void CloseFile( CONTEXT
*context
)
442 if ((AX_reg(context
) = _lclose16( BX_reg(context
) )) != 0)
444 AX_reg(context
) = DOS_ExtendedError
;
449 static BOOL32
INT21_ExtendedOpenCreateFile(CONTEXT
*context
)
451 BOOL32 bExtendedError
= FALSE
;
452 BYTE action
= DL_reg(context
);
454 /* Shuffle arguments to call OpenExistingFile */
455 AL_reg(context
) = BL_reg(context
);
456 DX_reg(context
) = SI_reg(context
);
457 /* BX,CX and DX should be preserved */
458 OpenExistingFile(context
);
460 if ((EFL_reg(context
) & 0x0001) == 0) /* File exists */
462 UINT16 uReturnCX
= 0;
464 /* Now decide what do do */
466 if ((action
& 0x07) == 0)
468 BX_reg(context
) = AX_reg(context
);
470 AX_reg(context
) = 0x0050; /*File exists*/
472 WARN(int21
, "extended open/create: failed because file exists \n");
474 else if ((action
& 0x07) == 2)
476 /* Truncate it, but first check if opened for write */
477 if ((BL_reg(context
) & 0x0007)== 0)
479 BX_reg(context
) = AX_reg(context
);
481 WARN(int21
, "extended open/create: failed, trunc on ro file\n");
482 AX_reg(context
) = 0x000C; /*Access code invalid*/
487 /* Shuffle arguments to call CloseFile while
488 * preserving BX and DX */
490 TRACE(int21
, "extended open/create: Closing before truncate\n");
491 BX_reg(context
) = AX_reg(context
);
493 if (EFL_reg(context
) & 0x0001)
495 WARN(int21
, "extended open/create: close before trunc failed\n");
496 AX_reg(context
) = 0x0019; /*Seek Error*/
500 /* Shuffle arguments to call CreateFile */
502 TRACE(int21
, "extended open/create: Truncating\n");
503 AL_reg(context
) = BL_reg(context
);
504 /* CX is still the same */
505 DX_reg(context
) = SI_reg(context
);
506 bExtendedError
= INT21_CreateFile(context
);
508 if (EFL_reg(context
) & 0x0001) /*no file open, flags set */
510 WARN(int21
, "extended open/create: trunc failed\n");
511 return bExtendedError
;
516 else uReturnCX
= 0x1;
518 CX_reg(context
) = uReturnCX
;
520 else /* file does not exist */
522 RESET_CFLAG(context
); /* was set by OpenExistingFile(context) */
523 if ((action
& 0xF0)== 0)
527 WARN(int21
, "extended open/create: failed, file dosen't exist\n");
531 /* Shuffle arguments to call CreateFile */
532 TRACE(int21
, "extended open/create: Creating\n");
533 AL_reg(context
) = BL_reg(context
);
534 /* CX should still be the same */
535 DX_reg(context
) = SI_reg(context
);
536 bExtendedError
= INT21_CreateFile(context
);
537 if (EFL_reg(context
) & 0x0001) /*no file open, flags set */
539 WARN(int21
, "extended open/create: create failed\n");
540 return bExtendedError
;
546 return bExtendedError
;
550 static BOOL32
INT21_ChangeDir( CONTEXT
*context
)
553 char *dirname
= PTR_SEG_OFF_TO_LIN(DS_reg(context
),DX_reg(context
));
555 TRACE(int21
,"changedir %s\n", dirname
);
556 if (dirname
[0] && (dirname
[1] == ':'))
558 drive
= toupper(dirname
[0]) - 'A';
561 else drive
= DRIVE_GetCurrentDrive();
562 return DRIVE_Chdir( drive
, dirname
);
566 static int INT21_FindFirst( CONTEXT
*context
)
570 DOS_FULL_NAME full_name
;
571 FINDFILE_DTA
*dta
= (FINDFILE_DTA
*)GetCurrentDTA();
573 path
= (const char *)PTR_SEG_OFF_TO_LIN(DS_reg(context
), DX_reg(context
));
574 dta
->unixPath
= NULL
;
575 if (!DOSFS_GetFullName( path
, FALSE
, &full_name
))
577 AX_reg(context
) = DOS_ExtendedError
;
581 dta
->unixPath
= HEAP_strdupA( GetProcessHeap(), 0, full_name
.long_name
);
582 p
= strrchr( dta
->unixPath
, '/' );
585 /* Note: terminating NULL in dta->mask overwrites dta->search_attr
586 * (doesn't matter as it is set below anyway)
588 if (!DOSFS_ToDosFCBFormat( p
+ 1, dta
->mask
))
590 HeapFree( GetProcessHeap(), 0, dta
->unixPath
);
591 dta
->unixPath
= NULL
;
592 DOS_ERROR( ER_FileNotFound
, EC_NotFound
, SA_Abort
, EL_Disk
);
593 AX_reg(context
) = ER_FileNotFound
;
597 dta
->drive
= (path
[0] && (path
[1] == ':')) ? toupper(path
[0]) - 'A'
598 : DRIVE_GetCurrentDrive();
600 dta
->search_attr
= CL_reg(context
);
605 static int INT21_FindNext( CONTEXT
*context
)
607 FINDFILE_DTA
*dta
= (FINDFILE_DTA
*)GetCurrentDTA();
608 WIN32_FIND_DATA32A entry
;
611 if (!dta
->unixPath
) return 0;
612 if (!(count
= DOSFS_FindNext( dta
->unixPath
, dta
->mask
, NULL
, dta
->drive
,
613 dta
->search_attr
, dta
->count
, &entry
)))
615 HeapFree( GetProcessHeap(), 0, dta
->unixPath
);
616 dta
->unixPath
= NULL
;
619 if ((int)dta
->count
+ count
> 0xffff)
621 WARN(int21
, "Too many directory entries in %s\n", dta
->unixPath
);
622 HeapFree( GetProcessHeap(), 0, dta
->unixPath
);
623 dta
->unixPath
= NULL
;
627 dta
->fileattr
= entry
.dwFileAttributes
;
628 dta
->filesize
= entry
.nFileSizeLow
;
629 FileTimeToDosDateTime( &entry
.ftLastWriteTime
,
630 &dta
->filedate
, &dta
->filetime
);
631 strcpy( dta
->filename
, entry
.cAlternateFileName
);
636 static BOOL32
INT21_CreateTempFile( CONTEXT
*context
)
638 static int counter
= 0;
639 char *name
= PTR_SEG_OFF_TO_LIN( DS_reg(context
), DX_reg(context
) );
640 char *p
= name
+ strlen(name
);
642 /* despite what Ralf Brown says, some programs seem to call without
643 * ending backslash (DOS accepts that, so we accept it too) */
644 if ((p
== name
) || (p
[-1] != '\\')) *p
++ = '\\';
648 sprintf( p
, "wine%04x.%03d", (int)getpid(), counter
);
649 counter
= (counter
+ 1) % 1000;
651 if ((AX_reg(context
) = _lcreat_uniq( name
, 0 )) != (WORD
)HFILE_ERROR16
)
653 TRACE(int21
, "created %s\n", name
);
656 if (DOS_ExtendedError
!= ER_FileExists
) return FALSE
;
661 static BOOL32
INT21_GetCurrentDirectory( CONTEXT
*context
)
663 int drive
= DOS_GET_DRIVE( DL_reg(context
) );
664 char *ptr
= (char *)PTR_SEG_OFF_TO_LIN( DS_reg(context
), SI_reg(context
) );
666 if (!DRIVE_IsValid(drive
))
668 DOS_ERROR( ER_InvalidDrive
, EC_NotFound
, SA_Abort
, EL_Disk
);
671 lstrcpyn32A( ptr
, DRIVE_GetDosCwd(drive
), 64 );
672 AX_reg(context
) = 0x0100; /* success return code */
677 static int INT21_GetDiskSerialNumber( CONTEXT
*context
)
679 BYTE
*dataptr
= PTR_SEG_OFF_TO_LIN(DS_reg(context
), DX_reg(context
));
680 int drive
= DOS_GET_DRIVE( BL_reg(context
) );
682 if (!DRIVE_IsValid(drive
))
684 DOS_ERROR( ER_InvalidDrive
, EC_NotFound
, SA_Abort
, EL_Disk
);
688 *(WORD
*)dataptr
= 0;
689 *(DWORD
*)(dataptr
+ 2) = DRIVE_GetSerialNumber( drive
);
690 memcpy( dataptr
+ 6, DRIVE_GetLabel( drive
), 11 );
691 strncpy(dataptr
+ 0x11, "FAT16 ", 8);
696 static int INT21_SetDiskSerialNumber( CONTEXT
*context
)
698 BYTE
*dataptr
= PTR_SEG_OFF_TO_LIN(DS_reg(context
), DX_reg(context
));
699 int drive
= DOS_GET_DRIVE( BL_reg(context
) );
701 if (!DRIVE_IsValid(drive
))
703 DOS_ERROR( ER_InvalidDrive
, EC_NotFound
, SA_Abort
, EL_Disk
);
707 DRIVE_SetSerialNumber( drive
, *(DWORD
*)(dataptr
+ 2) );
712 /* microsoft's programmers should be shot for using CP/M style int21
713 calls in Windows for Workgroup's winfile.exe */
715 static int INT21_FindFirstFCB( CONTEXT
*context
)
717 BYTE
*fcb
= (BYTE
*)PTR_SEG_OFF_TO_LIN(DS_reg(context
), DX_reg(context
));
722 if (*fcb
== 0xff) pFCB
= (FINDFILE_FCB
*)(fcb
+ 7);
723 else pFCB
= (FINDFILE_FCB
*)fcb
;
724 drive
= DOS_GET_DRIVE( pFCB
->drive
);
725 root
= DRIVE_GetRoot( drive
);
726 cwd
= DRIVE_GetUnixCwd( drive
);
727 pFCB
->unixPath
= HeapAlloc( GetProcessHeap(), 0,
728 strlen(root
)+strlen(cwd
)+2 );
729 if (!pFCB
->unixPath
) return 0;
730 strcpy( pFCB
->unixPath
, root
);
731 strcat( pFCB
->unixPath
, "/" );
732 strcat( pFCB
->unixPath
, cwd
);
738 static int INT21_FindNextFCB( CONTEXT
*context
)
740 BYTE
*fcb
= (BYTE
*)PTR_SEG_OFF_TO_LIN(DS_reg(context
), DX_reg(context
));
742 DOS_DIRENTRY_LAYOUT
*pResult
= (DOS_DIRENTRY_LAYOUT
*)GetCurrentDTA();
743 WIN32_FIND_DATA32A entry
;
747 if (*fcb
== 0xff) /* extended FCB ? */
750 pFCB
= (FINDFILE_FCB
*)(fcb
+ 7);
755 pFCB
= (FINDFILE_FCB
*)fcb
;
758 if (!pFCB
->unixPath
) return 0;
759 if (!(count
= DOSFS_FindNext( pFCB
->unixPath
, pFCB
->filename
, NULL
,
760 DOS_GET_DRIVE( pFCB
->drive
), attr
,
761 pFCB
->count
, &entry
)))
763 HeapFree( GetProcessHeap(), 0, pFCB
->unixPath
);
764 pFCB
->unixPath
= NULL
;
767 pFCB
->count
+= count
;
769 if (*fcb
== 0xff) { /* place extended FCB header before pResult if called with extended FCB */
770 *(BYTE
*)pResult
= 0xff;
771 (BYTE
*)pResult
+=6; /* leave reserved field behind */
772 *(BYTE
*)pResult
= entry
.dwFileAttributes
;
775 *(BYTE
*)pResult
= DOS_GET_DRIVE( pFCB
->drive
); /* DOS_DIRENTRY_LAYOUT after current drive number */
777 pResult
->fileattr
= entry
.dwFileAttributes
;
778 pResult
->cluster
= 0; /* what else? */
779 pResult
->filesize
= entry
.nFileSizeLow
;
780 memset( pResult
->reserved
, 0, sizeof(pResult
->reserved
) );
781 FileTimeToDosDateTime( &entry
.ftLastWriteTime
,
782 &pResult
->filedate
, &pResult
->filetime
);
784 /* Convert file name to FCB format */
786 memset( pResult
->filename
, ' ', sizeof(pResult
->filename
) );
787 if (!strcmp( entry
.cAlternateFileName
, "." )) pResult
->filename
[0] = '.';
788 else if (!strcmp( entry
.cAlternateFileName
, ".." ))
789 pResult
->filename
[0] = pResult
->filename
[1] = '.';
792 char *p
= strrchr( entry
.cAlternateFileName
, '.' );
793 if (p
&& p
[1] && (p
!= entry
.cAlternateFileName
))
795 memcpy( pResult
->filename
, entry
.cAlternateFileName
,
796 MIN( (p
- entry
.cAlternateFileName
), 8 ) );
797 memcpy( pResult
->filename
+ 8, p
+ 1, MIN( strlen(p
), 3 ) );
800 memcpy( pResult
->filename
, entry
.cAlternateFileName
,
801 MIN( strlen(entry
.cAlternateFileName
), 8 ) );
807 static void DeleteFileFCB( CONTEXT
*context
)
809 FIXME(int21
, "(%p): not implemented yet\n", context
);
812 static void RenameFileFCB( CONTEXT
*context
)
814 FIXME(int21
, "(%p): not implemented yet\n", context
);
819 static void fLock( CONTEXT
* context
)
822 switch ( AX_reg(context
) & 0xff )
824 case 0x00: /* LOCK */
825 TRACE(int21
,"lock handle %d offset %ld length %ld\n",
827 MAKELONG(DX_reg(context
),CX_reg(context
)),
828 MAKELONG(DI_reg(context
),SI_reg(context
))) ;
829 if (!LockFile(BX_reg(context
),
830 MAKELONG(DX_reg(context
),CX_reg(context
)), 0,
831 MAKELONG(DI_reg(context
),SI_reg(context
)), 0)) {
832 AX_reg(context
) = DOS_ExtendedError
;
837 case 0x01: /* UNLOCK */
838 TRACE(int21
,"unlock handle %d offset %ld length %ld\n",
840 MAKELONG(DX_reg(context
),CX_reg(context
)),
841 MAKELONG(DI_reg(context
),SI_reg(context
))) ;
842 if (!UnlockFile(BX_reg(context
),
843 MAKELONG(DX_reg(context
),CX_reg(context
)), 0,
844 MAKELONG(DI_reg(context
),SI_reg(context
)), 0)) {
845 AX_reg(context
) = DOS_ExtendedError
;
850 AX_reg(context
) = 0x0001;
857 INT21_networkfunc (CONTEXT
*context
)
859 switch (AL_reg(context
)) {
860 case 0x00: /* Get machine name. */
862 char *dst
= PTR_SEG_OFF_TO_LIN (DS_reg(context
),DX_reg(context
));
863 TRACE(int21
, "getting machine name to %p\n", dst
);
864 if (gethostname (dst
, 15))
866 WARN(int21
,"failed!\n");
867 DOS_ERROR( ER_NoNetwork
, EC_NotFound
, SA_Abort
, EL_Network
);
870 int len
= strlen (dst
);
874 CH_reg(context
) = 1; /* Valid */
875 CL_reg(context
) = 1; /* NETbios number??? */
876 TRACE(int21
, "returning %s\n", debugstr_an (dst
, 16));
882 DOS_ERROR( ER_NoNetwork
, EC_NotFound
, SA_Abort
, EL_Network
);
888 SEGPTR
INT21_GetListOfLists()
890 static DOS_LISTOFLISTS
*LOL
;
891 static SEGPTR seg_LOL
;
896 0133:0020 6A 13-33 01 CC 00 33 01 59 00 j.3...3.Y.
897 0133:0030 70 00 00 00 72 02 00 02-6D 00 33 01 00 00 2E 05 p...r...m.3.....
898 0133:0040 00 00 FC 04 00 00 03 08-92 21 11 E0 04 80 C6 0D .........!......
899 0133:0050 CC 0D 4E 55 4C 20 20 20-20 20 00 00 00 00 00 00 ..NUL ......
900 0133:0060 00 4B BA C1 06 14 00 00-00 03 01 00 04 70 CE FF .K...........p..
901 0133:0070 FF 00 00 00 00 00 00 00-00 01 00 00 0D 05 00 00 ................
902 0133:0080 00 FF FF 00 00 00 00 FE-00 00 F8 03 FF 9F 70 02 ..............p.
903 0133:0090 D0 44 C8 FD D4 44 C8 FD-D4 44 C8 FD D0 44 C8 FD .D...D...D...D..
904 0133:00A0 D0 44 C8 FD D0 44 .D...D
907 LOL
= SEGPTR_ALLOC(sizeof(DOS_LISTOFLISTS
));
909 LOL
->CX_Int21_5e01
= 0x0;
910 LOL
->LRU_count_FCB_cache
= 0x0;
911 LOL
->LRU_count_FCB_open
= 0x0;
912 LOL
->OEM_func_handler
= -1; /* not available */
913 LOL
->INT21_offset
= 0x0;
914 LOL
->sharing_retry_count
= sharing_retries
; /* default value: 3 */
915 LOL
->sharing_retry_delay
= sharing_pause
; /* default value: 1 */
916 LOL
->ptr_disk_buf
= 0x0;
917 LOL
->offs_unread_CON
= 0x0;
918 LOL
->seg_first_MCB
= 0x0;
919 LOL
->ptr_first_DPB
= 0x0;
920 LOL
->ptr_first_SysFileTable
= 0x0;
921 LOL
->ptr_clock_dev_hdr
= 0x0;
922 LOL
->ptr_CON_dev_hdr
= 0x0;
923 LOL
->max_byte_per_sec
= 512;
924 LOL
->ptr_disk_buf_info
= 0x0;
925 LOL
->ptr_array_CDS
= 0x0;
926 LOL
->ptr_sys_FCB
= 0x0;
927 LOL
->nr_protect_FCB
= 0x0;
928 LOL
->nr_block_dev
= 0x0;
929 LOL
->nr_avail_drive_letters
= 26; /* A - Z */
930 LOL
->nr_drives_JOINed
= 0x0;
931 LOL
->ptr_spec_prg_names
= 0x0;
932 LOL
->ptr_SETVER_prg_list
= 0x0; /* no SETVER list */
933 LOL
->DOS_HIGH_A20_func_offs
= 0x0;
934 LOL
->PSP_last_exec
= 0x0;
935 LOL
->BUFFERS_val
= 99; /* maximum: 99 */
936 LOL
->BUFFERS_nr_lookahead
= 8; /* maximum: 8 */
937 LOL
->boot_drive
= 3; /* C: */
938 LOL
->flag_DWORD_moves
= 0x01; /* i386+ */
939 LOL
->size_extended_mem
= 0xf000; /* very high value */
941 if (!seg_LOL
) seg_LOL
= SEGPTR_GET(LOL
);
942 return seg_LOL
+(WORD
)&((DOS_LISTOFLISTS
*)0)->ptr_first_DPB
;
945 /***********************************************************************
946 * DOS3Call (KERNEL.102)
948 void WINAPI
DOS3Call( CONTEXT
*context
)
950 BOOL32 bSetDOSExtendedError
= FALSE
;
953 TRACE(int21
, "AX=%04x BX=%04x CX=%04x DX=%04x "
954 "SI=%04x DI=%04x DS=%04x ES=%04x EFL=%08lx\n",
955 AX_reg(context
), BX_reg(context
), CX_reg(context
), DX_reg(context
),
956 SI_reg(context
), DI_reg(context
),
957 (WORD
)DS_reg(context
), (WORD
)ES_reg(context
),
961 if (AH_reg(context
) == 0x59) /* Get extended error info */
963 TRACE(int21
, "GET EXTENDED ERROR code 0x%02x class 0x%02x action 0x%02x locus %02x\n",
964 DOS_ExtendedError
, DOS_ErrorClass
, DOS_ErrorAction
, DOS_ErrorLocus
);
965 AX_reg(context
) = DOS_ExtendedError
;
966 BH_reg(context
) = DOS_ErrorClass
;
967 BL_reg(context
) = DOS_ErrorAction
;
968 CH_reg(context
) = DOS_ErrorLocus
;
972 DOS_ERROR( 0, 0, 0, 0 );
973 RESET_CFLAG(context
); /* Not sure if this is a good idea */
975 switch(AH_reg(context
))
977 case 0x00: /* TERMINATE PROGRAM */
978 TRACE(int21
,"TERMINATE PROGRAM\n");
979 TASK_KillCurrentTask( 0 );
982 case 0x01: /* READ CHARACTER FROM STANDARD INPUT, WITH ECHO */
983 case 0x02: /* WRITE CHARACTER TO STANDARD OUTPUT */
984 case 0x03: /* READ CHARACTER FROM STDAUX */
985 case 0x04: /* WRITE CHARACTER TO STDAUX */
986 case 0x05: /* WRITE CHARACTER TO PRINTER */
987 case 0x06: /* DIRECT CONSOLE IN/OUTPUT */
988 case 0x07: /* DIRECT CHARACTER INPUT, WITHOUT ECHO */
989 case 0x08: /* CHARACTER INPUT WITHOUT ECHO */
990 case 0x09: /* WRITE STRING TO STANDARD OUTPUT */
991 case 0x0a: /* BUFFERED INPUT */
992 case 0x0b: /* GET STDIN STATUS */
993 case 0x0c: /* FLUSH BUFFER AND READ STANDARD INPUT */
994 case 0x0f: /* OPEN FILE USING FCB */
995 case 0x10: /* CLOSE FILE USING FCB */
996 case 0x14: /* SEQUENTIAL READ FROM FCB FILE */
997 case 0x15: /* SEQUENTIAL WRITE TO FCB FILE */
998 case 0x16: /* CREATE OR TRUNCATE FILE USING FCB */
999 case 0x21: /* READ RANDOM RECORD FROM FCB FILE */
1000 case 0x22: /* WRITE RANDOM RECORD TO FCB FILE */
1001 case 0x23: /* GET FILE SIZE FOR FCB */
1002 case 0x24: /* SET RANDOM RECORD NUMBER FOR FCB */
1003 case 0x26: /* CREATE NEW PROGRAM SEGMENT PREFIX */
1004 case 0x27: /* RANDOM BLOCK READ FROM FCB FILE */
1005 case 0x28: /* RANDOM BLOCK WRITE TO FCB FILE */
1006 case 0x29: /* PARSE FILENAME INTO FCB */
1007 case 0x37: /* "SWITCHAR" - GET SWITCH CHARACTER
1008 "SWITCHAR" - SET SWITCH CHARACTER
1009 "AVAILDEV" - SPECIFY \DEV\ PREFIX USE */
1010 case 0x54: /* GET VERIFY FLAG */
1011 case 0x48: /* ALLOCATE MEMORY */
1012 case 0x49: /* FREE MEMORY */
1013 case 0x4a: /* RESIZE MEMORY BLOCK */
1014 INT_BARF( context
, 0x21 );
1016 case 0x2e: /* SET VERIFY FLAG */
1017 TRACE(int21
,"SET VERIFY FLAG ignored\n");
1018 /* we cannot change the behaviour anyway, so just ignore it */
1021 case 0x18: /* NULL FUNCTIONS FOR CP/M COMPATIBILITY */
1025 case 0x6b: /* NULL FUNCTION */
1026 AL_reg(context
) = 0;
1029 case 0x5c: /* "FLOCK" - RECORD LOCKING */
1033 case 0x0d: /* DISK BUFFER FLUSH */
1034 TRACE(int21
,"DISK BUFFER FLUSH ignored\n");
1035 RESET_CFLAG(context
); /* dos 6+ only */
1038 case 0x0e: /* SELECT DEFAULT DRIVE */
1039 TRACE(int21
,"SELECT DEFAULT DRIVE %d\n", DL_reg(context
));
1040 DRIVE_SetCurrentDrive( DL_reg(context
) );
1041 AL_reg(context
) = MAX_DOS_DRIVES
;
1044 case 0x11: /* FIND FIRST MATCHING FILE USING FCB */
1045 TRACE(int21
,"FIND FIRST MATCHING FILE USING FCB %p\n",
1046 PTR_SEG_OFF_TO_LIN(DS_reg(context
), DX_reg(context
)));
1047 if (!INT21_FindFirstFCB(context
))
1049 AL_reg(context
) = 0xff;
1052 /* else fall through */
1054 case 0x12: /* FIND NEXT MATCHING FILE USING FCB */
1055 AL_reg(context
) = INT21_FindNextFCB(context
) ? 0x00 : 0xff;
1058 case 0x13: /* DELETE FILE USING FCB */
1059 DeleteFileFCB(context
);
1062 case 0x17: /* RENAME FILE USING FCB */
1063 RenameFileFCB(context
);
1066 case 0x19: /* GET CURRENT DEFAULT DRIVE */
1067 AL_reg(context
) = DRIVE_GetCurrentDrive();
1070 case 0x1a: /* SET DISK TRANSFER AREA ADDRESS */
1072 TDB
*pTask
= (TDB
*)GlobalLock16( GetCurrentTask() );
1073 pTask
->dta
= PTR_SEG_OFF_TO_SEGPTR(DS_reg(context
),DX_reg(context
));
1074 TRACE(int21
, "Set DTA: %08lx\n", pTask
->dta
);
1078 case 0x1b: /* GET ALLOCATION INFORMATION FOR DEFAULT DRIVE */
1079 DL_reg(context
) = 0;
1080 if (!INT21_GetDriveAllocInfo(context
)) AX_reg(context
) = 0xffff;
1083 case 0x1c: /* GET ALLOCATION INFORMATION FOR SPECIFIC DRIVE */
1084 if (!INT21_GetDriveAllocInfo(context
)) AX_reg(context
) = 0xffff;
1087 case 0x1f: /* GET DRIVE PARAMETER BLOCK FOR DEFAULT DRIVE */
1088 GetDrivePB(context
, DRIVE_GetCurrentDrive());
1091 case 0x25: /* SET INTERRUPT VECTOR */
1092 INT_SetHandler( AL_reg(context
),
1093 (FARPROC16
)PTR_SEG_OFF_TO_SEGPTR( DS_reg(context
),
1097 case 0x2a: /* GET SYSTEM DATE */
1098 INT21_GetSystemDate(context
);
1101 case 0x2b: /* SET SYSTEM DATE */
1102 FIXME(int21
, "SetSystemDate(%02d/%02d/%04d): not allowed\n",
1103 DL_reg(context
), DH_reg(context
), CX_reg(context
) );
1104 AL_reg(context
) = 0; /* Let's pretend we succeeded */
1107 case 0x2c: /* GET SYSTEM TIME */
1108 INT21_GetSystemTime(context
);
1111 case 0x2d: /* SET SYSTEM TIME */
1112 FIXME(int21
, "SetSystemTime(%02d:%02d:%02d.%02d): not allowed\n",
1113 CH_reg(context
), CL_reg(context
),
1114 DH_reg(context
), DL_reg(context
) );
1115 AL_reg(context
) = 0; /* Let's pretend we succeeded */
1118 case 0x2f: /* GET DISK TRANSFER AREA ADDRESS */
1119 TRACE(int21
,"GET DISK TRANSFER AREA ADDRESS\n");
1121 TDB
*pTask
= (TDB
*)GlobalLock16( GetCurrentTask() );
1122 ES_reg(context
) = SELECTOROF( pTask
->dta
);
1123 BX_reg(context
) = OFFSETOF( pTask
->dta
);
1127 case 0x30: /* GET DOS VERSION */
1128 TRACE(int21
,"GET DOS VERSION %s requested\n",
1129 (AL_reg(context
) == 0x00)?"OEM number":"version flag");
1130 AX_reg(context
) = (HIWORD(GetVersion16()) >> 8) |
1131 (HIWORD(GetVersion16()) << 8);
1132 BX_reg(context
) = 0x0012; /* 0x123456 is Wine's serial # */
1133 CX_reg(context
) = 0x3456;
1136 case 0x31: /* TERMINATE AND STAY RESIDENT */
1137 TRACE(int21
,"TERMINATE AND STAY RESIDENT stub\n");
1138 INT_BARF( context
, 0x21 );
1141 case 0x32: /* GET DOS DRIVE PARAMETER BLOCK FOR SPECIFIC DRIVE */
1142 TRACE(int21
,"GET DOS DRIVE PARAMETER BLOCK FOR DRIVE %s\n",
1143 INT21_DriveName( DL_reg(context
)));
1144 GetDrivePB(context
, DOS_GET_DRIVE( DL_reg(context
) ) );
1147 case 0x33: /* MULTIPLEXED */
1148 switch (AL_reg(context
))
1150 case 0x00: /* GET CURRENT EXTENDED BREAK STATE */
1151 TRACE(int21
,"GET CURRENT EXTENDED BREAK STATE stub\n");
1152 DL_reg(context
) = 0;
1155 case 0x01: /* SET EXTENDED BREAK STATE */
1156 TRACE(int21
,"SET CURRENT EXTENDED BREAK STATE stub\n");
1159 case 0x02: /* GET AND SET EXTENDED CONTROL-BREAK CHECKING STATE*/
1160 TRACE(int21
,"GET AND SET EXTENDED CONTROL-BREAK CHECKING STATE stub\n");
1161 DL_reg(context
) = 0;
1164 case 0x05: /* GET BOOT DRIVE */
1165 TRACE(int21
,"GET BOOT DRIVE\n");
1166 DL_reg(context
) = 3;
1167 /* c: is Wine's bootdrive (a: is 1)*/
1170 case 0x06: /* GET TRUE VERSION NUMBER */
1171 TRACE(int21
,"GET TRUE VERSION NUMBER\n");
1172 BX_reg(context
) = (HIWORD(GetVersion16() >> 8)) |
1173 (HIWORD(GetVersion16() << 8));
1174 DX_reg(context
) = 0x00;
1178 INT_BARF( context
, 0x21 );
1183 case 0x34: /* GET ADDRESS OF INDOS FLAG */
1184 TRACE(int21
,"GET ADDRESS OF INDOS FLAG\n");
1185 if (!heap
) INT21_CreateHeap();
1186 ES_reg(context
) = DosHeapHandle
;
1187 BX_reg(context
) = (int)&heap
->InDosFlag
- (int)heap
;
1190 case 0x35: /* GET INTERRUPT VECTOR */
1191 TRACE(int21
,"GET INTERRUPT VECTOR 0x%02x\n",AL_reg(context
));
1193 FARPROC16 addr
= INT_GetHandler( AL_reg(context
) );
1194 ES_reg(context
) = SELECTOROF(addr
);
1195 BX_reg(context
) = OFFSETOF(addr
);
1199 case 0x36: /* GET FREE DISK SPACE */
1200 TRACE(int21
,"GET FREE DISK SPACE FOR DRIVE %s\n",
1201 INT21_DriveName( DL_reg(context
)));
1202 if (!INT21_GetFreeDiskSpace(context
)) AX_reg(context
) = 0xffff;
1205 case 0x38: /* GET COUNTRY-SPECIFIC INFORMATION */
1206 TRACE(int21
,"GET COUNTRY-SPECIFIC INFORMATION for country 0x%02x\n",
1208 AX_reg(context
) = 0x02; /* no country support available */
1212 case 0x39: /* "MKDIR" - CREATE SUBDIRECTORY */
1213 TRACE(int21
,"MKDIR %s\n",
1214 (LPCSTR
)PTR_SEG_OFF_TO_LIN( DS_reg(context
), DX_reg(context
)));
1215 bSetDOSExtendedError
= (!CreateDirectory16( PTR_SEG_OFF_TO_LIN( DS_reg(context
),
1216 DX_reg(context
) ), NULL
));
1219 case 0x3a: /* "RMDIR" - REMOVE SUBDIRECTORY */
1220 TRACE(int21
,"RMDIR %s\n",
1221 (LPCSTR
)PTR_SEG_OFF_TO_LIN( DS_reg(context
), DX_reg(context
)));
1222 bSetDOSExtendedError
= (!RemoveDirectory16( PTR_SEG_OFF_TO_LIN( DS_reg(context
),
1223 DX_reg(context
) )));
1226 case 0x3b: /* "CHDIR" - SET CURRENT DIRECTORY */
1227 TRACE(int21
,"CHDIR %s\n",
1228 (LPCSTR
)PTR_SEG_OFF_TO_LIN( DS_reg(context
), DX_reg(context
)));
1229 bSetDOSExtendedError
= !INT21_ChangeDir(context
);
1232 case 0x3c: /* "CREAT" - CREATE OR TRUNCATE FILE */
1233 TRACE(int21
,"CREAT flag 0x%02x %s\n",CX_reg(context
),
1234 (LPCSTR
)PTR_SEG_OFF_TO_LIN( DS_reg(context
), DX_reg(context
)));
1235 AX_reg(context
) = _lcreat16( PTR_SEG_OFF_TO_LIN( DS_reg(context
),
1236 DX_reg(context
) ), CX_reg(context
) );
1237 bSetDOSExtendedError
= (AX_reg(context
) == (WORD
)HFILE_ERROR16
);
1240 case 0x3d: /* "OPEN" - OPEN EXISTING FILE */
1241 TRACE(int21
,"OPEN mode 0x%02x %s\n",AL_reg(context
),
1242 (LPCSTR
)PTR_SEG_OFF_TO_LIN( DS_reg(context
), DX_reg(context
)));
1243 OpenExistingFile(context
);
1246 case 0x3e: /* "CLOSE" - CLOSE FILE */
1247 TRACE(int21
,"CLOSE handle %d\n",BX_reg(context
));
1248 bSetDOSExtendedError
= ((AX_reg(context
) = _lclose16( BX_reg(context
) )) != 0);
1251 case 0x3f: /* "READ" - READ FROM FILE OR DEVICE */
1252 TRACE(int21
,"READ from %d to %ld for %d byte\n",BX_reg(context
),
1253 PTR_SEG_OFF_TO_SEGPTR( DS_reg(context
),DX_reg(context
)),CX_reg(context
) );
1255 LONG result
= WIN16_hread( BX_reg(context
),
1256 PTR_SEG_OFF_TO_SEGPTR( DS_reg(context
),
1259 if (result
== -1) bSetDOSExtendedError
= TRUE
;
1260 else AX_reg(context
) = (WORD
)result
;
1264 case 0x40: /* "WRITE" - WRITE TO FILE OR DEVICE */
1265 TRACE(int21
,"WRITE from %ld to handle %d for %d byte\n",
1266 PTR_SEG_OFF_TO_SEGPTR( DS_reg(context
),DX_reg(context
)),
1267 BX_reg(context
),CX_reg(context
) );
1269 LONG result
= _hwrite16( BX_reg(context
),
1270 PTR_SEG_OFF_TO_LIN( DS_reg(context
),
1273 if (result
== -1) bSetDOSExtendedError
= TRUE
;
1274 else AX_reg(context
) = (WORD
)result
;
1278 case 0x41: /* "UNLINK" - DELETE FILE */
1279 TRACE(int21
,"UNLINK%s\n",
1280 (LPCSTR
)PTR_SEG_OFF_TO_LIN( DS_reg(context
), DX_reg(context
)));
1281 bSetDOSExtendedError
= (!DeleteFile32A( PTR_SEG_OFF_TO_LIN( DS_reg(context
),
1282 DX_reg(context
) )));
1285 case 0x42: /* "LSEEK" - SET CURRENT FILE POSITION */
1286 TRACE(int21
,"LSEEK handle %d offset %ld from %s\n",
1287 BX_reg(context
), MAKELONG(DX_reg(context
),CX_reg(context
)),
1288 (AL_reg(context
)==0)?"start of file":(AL_reg(context
)==1)?
1289 "current file position":"end of file");
1291 LONG status
= _llseek16( BX_reg(context
),
1292 MAKELONG(DX_reg(context
),CX_reg(context
)),
1294 if (status
== -1) bSetDOSExtendedError
= TRUE
;
1297 AX_reg(context
) = LOWORD(status
);
1298 DX_reg(context
) = HIWORD(status
);
1303 case 0x43: /* FILE ATTRIBUTES */
1304 switch (AL_reg(context
))
1307 TRACE(int21
,"GET FILE ATTRIBUTES for %s\n",
1308 (LPCSTR
)PTR_SEG_OFF_TO_LIN( DS_reg(context
), DX_reg(context
)));
1309 AX_reg(context
) = (WORD
)GetFileAttributes32A(
1310 PTR_SEG_OFF_TO_LIN(DS_reg(context
),
1312 if (AX_reg(context
) == 0xffff) bSetDOSExtendedError
= TRUE
;
1313 else CX_reg(context
) = AX_reg(context
);
1317 TRACE(int21
,"SET FILE ATTRIBUTES 0x%02x for %s\n", CX_reg(context
),
1318 (LPCSTR
)PTR_SEG_OFF_TO_LIN( DS_reg(context
), DX_reg(context
)));
1319 bSetDOSExtendedError
=
1320 (!SetFileAttributes32A( PTR_SEG_OFF_TO_LIN(DS_reg(context
),
1325 TRACE(int21
,"GET COMPRESSED FILE SIZE for %s stub\n",
1326 (LPCSTR
)PTR_SEG_OFF_TO_LIN( DS_reg(context
), DX_reg(context
)));
1330 case 0x44: /* IOCTL */
1331 switch (AL_reg(context
))
1334 ioctlGetDeviceInfo(context
);
1341 file
= FILE_GetFile(BX_reg(context
));
1342 if (!strcasecmp(file
->unix_name
, "SCSIMGR$"))
1343 ASPI_DOS_HandleInt(context
);
1344 FILE_ReleaseFile( file
);
1347 case 0x05:{ /* IOCTL - WRITE TO BLOCK DEVICE CONTROL CHANNEL */
1348 /*BYTE *dataptr = PTR_SEG_OFF_TO_LIN(DS_reg(context),DX_reg(context));*/
1349 int drive
= DOS_GET_DRIVE(BL_reg(context
));
1351 FIXME(int21
,"program tried to write to block device control channel of drive %d:\n",drive
);
1352 /* for (i=0;i<CX_reg(context);i++)
1353 fprintf(stdnimp,"%02x ",dataptr[i]);
1354 fprintf(stdnimp,"\n");*/
1355 AX_reg(context
)=CX_reg(context
);
1358 case 0x08: /* Check if drive is removable. */
1359 TRACE(int21
,"IOCTL - CHECK IF BLOCK DEVICE REMOVABLE for drive %s\n",
1360 INT21_DriveName( BL_reg(context
)));
1361 switch(GetDriveType16( DOS_GET_DRIVE( BL_reg(context
) )))
1363 case DRIVE_CANNOTDETERMINE
:
1364 DOS_ERROR( ER_InvalidDrive
, EC_NotFound
, SA_Abort
, EL_Disk
);
1365 AX_reg(context
) = ER_InvalidDrive
;
1368 case DRIVE_REMOVABLE
:
1369 AX_reg(context
) = 0; /* removable */
1372 AX_reg(context
) = 1; /* not removable */
1377 case 0x09: /* CHECK IF BLOCK DEVICE REMOTE */
1378 TRACE(int21
,"IOCTL - CHECK IF BLOCK DEVICE REMOTE for drive %s\n",
1379 INT21_DriveName( BL_reg(context
)));
1380 switch(GetDriveType16( DOS_GET_DRIVE( BL_reg(context
) )))
1382 case DRIVE_CANNOTDETERMINE
:
1383 DOS_ERROR( ER_InvalidDrive
, EC_NotFound
, SA_Abort
, EL_Disk
);
1384 AX_reg(context
) = ER_InvalidDrive
;
1388 DX_reg(context
) = (1<<9) | (1<<12); /* remote */
1391 DX_reg(context
) = 0; /* FIXME: use driver attr here */
1396 case 0x0a: /* check if handle (BX) is remote */
1397 TRACE(int21
,"IOCTL - CHECK IF HANDLE %d IS REMOTE\n",BX_reg(context
));
1398 /* returns DX, bit 15 set if remote, bit 14 set if date/time
1401 DX_reg(context
) = 0;
1404 case 0x0b: /* SET SHARING RETRY COUNT */
1405 TRACE(int21
,"IOCTL - SET SHARING RETRY COUNT pause %d retries %d\n",
1406 CX_reg(context
), DX_reg(context
));
1407 if (!CX_reg(context
))
1409 AX_reg(context
) = 1;
1413 sharing_pause
= CX_reg(context
);
1414 if (!DX_reg(context
))
1415 sharing_retries
= DX_reg(context
);
1416 RESET_CFLAG(context
);
1420 TRACE(int21
,"IOCTL - GENERIC BLOCK DEVICE REQUEST %s\n",
1421 INT21_DriveName( BL_reg(context
)));
1422 bSetDOSExtendedError
= ioctlGenericBlkDevReq(context
);
1425 case 0x0e: /* get logical drive mapping */
1426 TRACE(int21
,"IOCTL - GET LOGICAL DRIVE MAP for drive %s\n",
1427 INT21_DriveName( BL_reg(context
)));
1428 AL_reg(context
) = 0; /* drive has no mapping - FIXME: may be wrong*/
1431 case 0x0F: /* Set logical drive mapping */
1434 TRACE(int21
,"IOCTL - SET LOGICAL DRIVE MAP for drive %s\n",
1435 INT21_DriveName( BL_reg(context
)));
1436 drive
= DOS_GET_DRIVE ( BL_reg(context
) );
1437 if ( ! DRIVE_SetLogicalMapping ( drive
, drive
+1 ) )
1440 AX_reg(context
) = 0x000F; /* invalid drive */
1446 INT_BARF( context
, 0x21 );
1451 case 0x45: /* "DUP" - DUPLICATE FILE HANDLE */
1452 TRACE(int21
,"DUP - DUPLICATE FILE HANDLE %d\n",BX_reg(context
));
1453 bSetDOSExtendedError
= ((AX_reg(context
) = FILE_Dup(BX_reg(context
))) == (WORD
)HFILE_ERROR16
);
1456 case 0x46: /* "DUP2", "FORCEDUP" - FORCE DUPLICATE FILE HANDLE */
1457 TRACE(int21
,"FORCEDUP - FORCE DUPLICATE FILE HANDLE %d to %d\n",
1458 BX_reg(context
),CX_reg(context
));
1459 bSetDOSExtendedError
= (FILE_Dup2( BX_reg(context
), CX_reg(context
) ) == HFILE_ERROR32
);
1462 case 0x47: /* "CWD" - GET CURRENT DIRECTORY */
1463 TRACE(int21
,"CWD - GET CURRENT DIRECTORY for drive %s\n",
1464 INT21_DriveName( DL_reg(context
)));
1465 bSetDOSExtendedError
= !INT21_GetCurrentDirectory(context
);
1468 case 0x4b: /* "EXEC" - LOAD AND/OR EXECUTE PROGRAM */
1469 TRACE(int21
,"EXEC %s\n",
1470 (LPCSTR
)PTR_SEG_OFF_TO_LIN( DS_reg(context
),DX_reg(context
) ));
1471 AX_reg(context
) = WinExec16( PTR_SEG_OFF_TO_LIN( DS_reg(context
),
1474 if (AX_reg(context
) < 32) SET_CFLAG(context
);
1477 case 0x4c: /* "EXIT" - TERMINATE WITH RETURN CODE */
1478 TRACE(int21
,"EXIT with return code %d\n",AL_reg(context
));
1479 TASK_KillCurrentTask( AL_reg(context
) );
1482 case 0x4d: /* GET RETURN CODE */
1483 TRACE(int21
,"GET RETURN CODE (ERRORLEVEL)\n");
1484 AX_reg(context
) = 0; /* normal exit */
1487 case 0x4e: /* "FINDFIRST" - FIND FIRST MATCHING FILE */
1488 TRACE(int21
,"FINDFIRST mask 0x%04x spec %s\n",CX_reg(context
),
1489 (LPCSTR
)PTR_SEG_OFF_TO_LIN( DS_reg(context
), DX_reg(context
)));
1490 if (!INT21_FindFirst(context
)) break;
1493 case 0x4f: /* "FINDNEXT" - FIND NEXT MATCHING FILE */
1494 TRACE(int21
,"FINDNEXT\n");
1495 if (!INT21_FindNext(context
))
1497 DOS_ERROR( ER_NoMoreFiles
, EC_MediaError
, SA_Abort
, EL_Disk
);
1498 AX_reg(context
) = ER_NoMoreFiles
;
1501 else AX_reg(context
) = 0; /* OK */
1504 case 0x51: /* GET PSP ADDRESS */
1505 TRACE(int21
,"GET CURRENT PROCESS ID (GET PSP ADDRESS)\n");
1506 /* FIXME: should we return the original DOS PSP upon */
1507 /* Windows startup ? */
1508 BX_reg(context
) = GetCurrentPDB();
1510 case 0x62: /* GET PSP ADDRESS */
1511 TRACE(int21
,"GET CURRENT PSP ADDRESS\n");
1512 /* FIXME: should we return the original DOS PSP upon */
1513 /* Windows startup ? */
1514 BX_reg(context
) = GetCurrentPDB();
1517 case 0x52: /* "SYSVARS" - GET LIST OF LISTS */
1518 TRACE(int21
,"SYSVARS - GET LIST OF LISTS\n");
1521 lol
= INT21_GetListOfLists();
1522 ES_reg(context
) = HIWORD(lol
);
1523 BX_reg(context
) = LOWORD(lol
);
1527 case 0x56: /* "RENAME" - RENAME FILE */
1528 TRACE(int21
,"RENAME %s to %s\n",
1529 (LPCSTR
)PTR_SEG_OFF_TO_LIN(DS_reg(context
),DX_reg(context
)),
1530 (LPCSTR
)PTR_SEG_OFF_TO_LIN(ES_reg(context
),DI_reg(context
)));
1531 bSetDOSExtendedError
=
1532 (!MoveFile32A( PTR_SEG_OFF_TO_LIN(DS_reg(context
),DX_reg(context
)),
1533 PTR_SEG_OFF_TO_LIN(ES_reg(context
),DI_reg(context
))));
1536 case 0x57: /* FILE DATE AND TIME */
1537 switch (AL_reg(context
))
1539 case 0x00: /* Get */
1542 TRACE(int21
,"GET FILE DATE AND TIME for handle %d\n",
1544 if (!GetFileTime( BX_reg(context
), NULL
, NULL
, &filetime
))
1545 bSetDOSExtendedError
= TRUE
;
1546 else FileTimeToDosDateTime( &filetime
, &DX_reg(context
),
1551 case 0x01: /* Set */
1554 TRACE(int21
,"SET FILE DATE AND TIME for handle %d\n",
1556 DosDateTimeToFileTime( DX_reg(context
), CX_reg(context
),
1558 bSetDOSExtendedError
=
1559 (!SetFileTime( BX_reg(context
), NULL
, NULL
, &filetime
));
1565 case 0x58: /* GET OR SET MEMORY/UMB ALLOCATION STRATEGY */
1566 TRACE(int21
,"GET OR SET MEMORY/UMB ALLOCATION STRATEGY subfunction %d\n",
1568 switch (AL_reg(context
))
1571 AX_reg(context
) = 1;
1574 AX_reg(context
) = 0;
1580 RESET_CFLAG(context
);
1583 case 0x5a: /* CREATE TEMPORARY FILE */
1584 TRACE(int21
,"CREATE TEMPORARY FILE\n");
1585 bSetDOSExtendedError
= !INT21_CreateTempFile(context
);
1588 case 0x5b: /* CREATE NEW FILE */
1589 TRACE(int21
,"CREATE NEW FILE 0x%02x for %s\n", CX_reg(context
),
1590 (LPCSTR
)PTR_SEG_OFF_TO_LIN( DS_reg(context
), DX_reg(context
)));
1591 bSetDOSExtendedError
= ((AX_reg(context
) =
1592 _lcreat_uniq( PTR_SEG_OFF_TO_LIN(DS_reg(context
),DX_reg(context
)), 0 ))
1593 == (WORD
)HFILE_ERROR16
);
1596 case 0x5d: /* NETWORK */
1597 FIXME(int21
,"Function 0x%04x not implemented.\n", AX_reg (context
));
1598 /* Fix the following while you're at it. */
1599 DOS_ERROR( ER_NoNetwork
, EC_NotFound
, SA_Abort
, EL_Network
);
1600 bSetDOSExtendedError
= TRUE
;
1604 bSetDOSExtendedError
= INT21_networkfunc (context
);
1607 case 0x5f: /* NETWORK */
1608 switch (AL_reg(context
))
1610 case 0x07: /* ENABLE DRIVE */
1611 TRACE(int21
,"ENABLE DRIVE %c:\n",(DL_reg(context
)+'A'));
1612 if (!DRIVE_Enable( DL_reg(context
) ))
1614 DOS_ERROR( ER_InvalidDrive
, EC_MediaError
, SA_Abort
, EL_Disk
);
1615 bSetDOSExtendedError
= TRUE
;
1619 case 0x08: /* DISABLE DRIVE */
1620 TRACE(int21
,"DISABLE DRIVE %c:\n",(DL_reg(context
)+'A'));
1621 if (!DRIVE_Disable( DL_reg(context
) ))
1623 DOS_ERROR( ER_InvalidDrive
, EC_MediaError
, SA_Abort
, EL_Disk
);
1624 bSetDOSExtendedError
= TRUE
;
1629 /* network software not installed */
1630 TRACE(int21
,"NETWORK function AX=%04x not implemented\n",AX_reg(context
));
1631 DOS_ERROR( ER_NoNetwork
, EC_NotFound
, SA_Abort
, EL_Network
);
1632 bSetDOSExtendedError
= TRUE
;
1637 case 0x60: /* "TRUENAME" - CANONICALIZE FILENAME OR PATH */
1638 TRACE(int21
,"TRUENAME %s\n",
1639 (LPCSTR
)PTR_SEG_OFF_TO_LIN(DS_reg(context
),SI_reg(context
)));
1641 if (!GetFullPathName32A( PTR_SEG_OFF_TO_LIN(DS_reg(context
),
1642 SI_reg(context
)), 128,
1643 PTR_SEG_OFF_TO_LIN(ES_reg(context
),
1644 DI_reg(context
)),NULL
))
1645 bSetDOSExtendedError
= TRUE
;
1646 else AX_reg(context
) = 0;
1650 case 0x61: /* UNUSED */
1651 case 0x63: /* UNUSED */
1652 case 0x64: /* OS/2 DOS BOX */
1653 INT_BARF( context
, 0x21 );
1657 case 0x65:{/* GET EXTENDED COUNTRY INFORMATION */
1658 extern WORD WINE_LanguageId
;
1659 BYTE
*dataptr
=PTR_SEG_OFF_TO_LIN(ES_reg(context
),DI_reg(context
));
1660 TRACE(int21
,"GET EXTENDED COUNTRY INFORMATION code page %d country %d\n",
1661 BX_reg(context
), DX_reg(context
));
1662 switch (AL_reg(context
)) {
1664 TRACE(int21
,"\tget general internationalization info\n");
1666 *(WORD
*)(dataptr
+1) = 41;
1667 *(WORD
*)(dataptr
+3) = WINE_LanguageId
;
1668 *(WORD
*)(dataptr
+5) = CodePage
;
1669 *(DWORD
*)(dataptr
+0x19) = 0; /* FIXME: ptr to case map routine */
1672 TRACE(int21
,"\tget pointer to collating sequence table\n");
1674 *(DWORD
*)(dataptr
+1) = MAKELONG(DOSMEM_CollateTable
& 0xFFFF,DOSMEM_AllocSelector(DOSMEM_CollateTable
>>16));
1675 CX_reg(context
) = 258;/*FIXME: size of table?*/
1678 TRACE(int21
,"\tunimplemented function %d\n",AL_reg(context
));
1679 INT_BARF( context
, 0x21 );
1685 case 0x66: /* GLOBAL CODE PAGE TABLE */
1686 switch (AL_reg(context
))
1689 TRACE(int21
,"GET GLOBAL CODE PAGE TABLE\n");
1690 DX_reg(context
) = BX_reg(context
) = CodePage
;
1691 RESET_CFLAG(context
);
1694 TRACE(int21
,"SET GLOBAL CODE PAGE TABLE active page %d system page %d\n",
1695 BX_reg(context
),DX_reg(context
));
1696 CodePage
= BX_reg(context
);
1697 RESET_CFLAG(context
);
1702 case 0x67: /* SET HANDLE COUNT */
1703 TRACE(int21
,"SET HANDLE COUNT to %d\n",BX_reg(context
) );
1704 SetHandleCount16( BX_reg(context
) );
1705 if (DOS_ExtendedError
) bSetDOSExtendedError
= TRUE
;
1708 case 0x68: /* "FFLUSH" - COMMIT FILE */
1709 case 0x6a: /* COMMIT FILE */
1710 TRACE(int21
,"FFLUSH/COMMIT handle %d\n",BX_reg(context
));
1711 bSetDOSExtendedError
= (!FlushFileBuffers( BX_reg(context
) ));
1714 case 0x69: /* DISK SERIAL NUMBER */
1715 switch (AL_reg(context
))
1718 TRACE(int21
,"GET DISK SERIAL NUMBER for drive %s\n",
1719 INT21_DriveName(BL_reg(context
)));
1720 if (!INT21_GetDiskSerialNumber(context
)) bSetDOSExtendedError
= TRUE
;
1721 else AX_reg(context
) = 0;
1725 TRACE(int21
,"SET DISK SERIAL NUMBER for drive %s\n",
1726 INT21_DriveName(BL_reg(context
)));
1727 if (!INT21_SetDiskSerialNumber(context
)) bSetDOSExtendedError
= TRUE
;
1728 else AX_reg(context
) = 1;
1733 case 0x6C: /* Extended Open/Create*/
1734 TRACE(int21
,"EXTENDED OPEN/CREATE %s\n",
1735 (LPCSTR
)PTR_SEG_OFF_TO_LIN( DS_reg(context
), DI_reg(context
)));
1736 bSetDOSExtendedError
= INT21_ExtendedOpenCreateFile(context
);
1739 case 0x71: /* MS-DOS 7 (Windows95) - LONG FILENAME FUNCTIONS */
1740 switch(AL_reg(context
))
1742 case 0x39: /* Create directory */
1743 TRACE(int21
,"LONG FILENAME - MAKE DIRECTORY %s\n",
1744 (LPCSTR
)PTR_SEG_OFF_TO_LIN( DS_reg(context
),DX_reg(context
)));
1745 bSetDOSExtendedError
= (!CreateDirectory32A(
1746 PTR_SEG_OFF_TO_LIN( DS_reg(context
),
1747 DX_reg(context
) ), NULL
));
1749 case 0x3a: /* Remove directory */
1750 TRACE(int21
,"LONG FILENAME - REMOVE DIRECTORY %s\n",
1751 (LPCSTR
)PTR_SEG_OFF_TO_LIN( DS_reg(context
),DX_reg(context
)));
1752 bSetDOSExtendedError
= (!RemoveDirectory32A(
1753 PTR_SEG_OFF_TO_LIN( DS_reg(context
),
1754 DX_reg(context
) )));
1756 case 0x43: /* Get/Set file attributes */
1757 TRACE(int21
,"LONG FILENAME -EXTENDED GET/SET FILE ATTRIBUTES %s\n",
1758 (LPCSTR
)PTR_SEG_OFF_TO_LIN( DS_reg(context
),DX_reg(context
)));
1759 switch (BL_reg(context
))
1761 case 0x00: /* Get file attributes */
1762 TRACE(int21
,"\tretrieve attributes\n");
1763 CX_reg(context
) = (WORD
)GetFileAttributes32A(
1764 PTR_SEG_OFF_TO_LIN(DS_reg(context
),
1766 if (CX_reg(context
) == 0xffff) bSetDOSExtendedError
= TRUE
;
1769 TRACE(int21
,"\tset attributes 0x%04x\n",CX_reg(context
));
1770 bSetDOSExtendedError
= (!SetFileAttributes32A(
1771 PTR_SEG_OFF_TO_LIN(DS_reg(context
),
1773 CX_reg(context
) ) );
1776 FIXME(int21
, "Unimplemented long file name function:\n");
1777 INT_BARF( context
, 0x21 );
1779 AL_reg(context
) = 0;
1783 case 0x47: /* Get current directory */
1784 TRACE(int21
," LONG FILENAME - GET CURRENT DIRECTORY for drive %s\n",
1785 INT21_DriveName(DL_reg(context
)));
1786 bSetDOSExtendedError
= !INT21_GetCurrentDirectory(context
);
1789 case 0x4e: /* Find first file */
1790 TRACE(int21
," LONG FILENAME - FIND FIRST MATCHING FILE for %s\n",
1791 (LPCSTR
)PTR_SEG_OFF_TO_LIN(DS_reg(context
),DX_reg(context
)));
1792 /* FIXME: use attributes in CX */
1793 if ((AX_reg(context
) = FindFirstFile16(
1794 PTR_SEG_OFF_TO_LIN(DS_reg(context
),DX_reg(context
)),
1795 (WIN32_FIND_DATA32A
*)PTR_SEG_OFF_TO_LIN(ES_reg(context
),
1797 == INVALID_HANDLE_VALUE16
)
1798 bSetDOSExtendedError
= TRUE
;
1800 case 0x4f: /* Find next file */
1801 TRACE(int21
,"LONG FILENAME - FIND NEXT MATCHING FILE for handle %d\n",
1803 if (!FindNextFile16( BX_reg(context
),
1804 (WIN32_FIND_DATA32A
*)PTR_SEG_OFF_TO_LIN(ES_reg(context
),
1806 bSetDOSExtendedError
= TRUE
;
1808 case 0xa1: /* Find close */
1809 TRACE(int21
,"LONG FILENAME - FINDCLOSE for handle %d\n",
1811 bSetDOSExtendedError
= (!FindClose16( BX_reg(context
) ));
1814 TRACE(int21
,"LONG FILENAME - GET VOLUME INFORMATION for drive %s stub\n",
1815 (LPCSTR
)PTR_SEG_OFF_TO_LIN( DS_reg(context
),DX_reg(context
)));
1818 switch(CL_reg(context
))
1820 case 0x02: /*Get canonical long filename or path */
1821 if (!GetFullPathName32A
1822 ( PTR_SEG_OFF_TO_LIN(DS_reg(context
),
1823 SI_reg(context
)), 128,
1824 PTR_SEG_OFF_TO_LIN(ES_reg(context
),
1825 DI_reg(context
)),NULL
))
1826 bSetDOSExtendedError
= TRUE
;
1827 else AX_reg(context
) = 0;
1830 FIXME(int21
, "Unimplemented long file name function:\n");
1831 INT_BARF( context
, 0x21 );
1833 AL_reg(context
) = 0;
1837 case 0x6c: /* Create or open file */
1838 TRACE(int21
,"LONG FILENAME - CREATE OR OPEN FILE %s\n",
1839 (LPCSTR
)PTR_SEG_OFF_TO_LIN( DS_reg(context
), SI_reg(context
)));
1840 /* translate Dos 7 action to Dos 6 action */
1841 bSetDOSExtendedError
= INT21_ExtendedOpenCreateFile(context
);
1844 case 0x3b: /* Change directory */
1845 TRACE(int21
,"LONG FILENAME - CHANGE DIRECTORY %s\n",
1846 (LPCSTR
)PTR_SEG_OFF_TO_LIN( DS_reg(context
), DX_reg(context
)));
1847 if (!SetCurrentDirectory32A(PTR_SEG_OFF_TO_LIN(
1853 AL_reg(context
) = DOS_ExtendedError
;
1856 case 0x41: /* Delete file */
1857 TRACE(int21
,"LONG FILENAME - DELETE FILE %s\n",
1858 (LPCSTR
)PTR_SEG_OFF_TO_LIN( DS_reg(context
), DX_reg(context
)));
1859 if (!DeleteFile32A(PTR_SEG_OFF_TO_LIN(
1864 AL_reg(context
) = DOS_ExtendedError
;
1867 case 0x56: /* Move (rename) file */
1868 TRACE(int21
,"LONG FILENAME - RENAME FILE %s to %s stub\n",
1869 (LPCSTR
)PTR_SEG_OFF_TO_LIN( DS_reg(context
), DX_reg(context
)),
1870 (LPCSTR
)PTR_SEG_OFF_TO_LIN( ES_reg(context
), DI_reg(context
)));
1872 FIXME(int21
, "Unimplemented long file name function:\n");
1873 INT_BARF( context
, 0x21 );
1875 AL_reg(context
) = 0;
1880 case 0x70: /* MS-DOS 7 (Windows95) - ??? (country-specific?)*/
1881 case 0x72: /* MS-DOS 7 (Windows95) - ??? */
1882 case 0x73: /* MS-DOS 7 (Windows95) - DRIVE LOCKING ??? */
1883 TRACE(int21
,"windows95 function AX %04x\n",
1885 WARN(int21
, " returning unimplemented\n");
1887 AL_reg(context
) = 0;
1890 case 0xdc: /* CONNECTION SERVICES - GET CONNECTION NUMBER */
1891 case 0xea: /* NOVELL NETWARE - RETURN SHELL VERSION */
1895 INT_BARF( context
, 0x21 );
1898 } /* END OF SWITCH */
1900 if( bSetDOSExtendedError
) /* set general error condition */
1902 AX_reg(context
) = DOS_ExtendedError
;
1906 if ((EFL_reg(context
) & 0x0001))
1907 TRACE(int21
, "failed, errorcode 0x%02x class 0x%02x action 0x%02x locus %02x\n",
1908 DOS_ExtendedError
, DOS_ErrorClass
, DOS_ErrorAction
, DOS_ErrorLocus
);
1910 TRACE(int21
, "returning: AX=%04x BX=%04x CX=%04x DX=%04x "
1911 "SI=%04x DI=%04x DS=%04x ES=%04x EFL=%08lx\n",
1912 AX_reg(context
), BX_reg(context
), CX_reg(context
),
1913 DX_reg(context
), SI_reg(context
), DI_reg(context
),
1914 (WORD
)DS_reg(context
), (WORD
)ES_reg(context
),
1918 FARPROC16 WINAPI
GetSetKernelDOSProc(FARPROC16 DosProc
)
1920 FIXME(int21
, "(DosProc=%08x);\n", (UINT32
)DosProc
);