]>
wirehaze git hosting - MS-DOS.git/blob - v4.0/src/MAPPER/QHANDTYP.ASM
4 title CP
/DOS DOSQhandtype mapper
6 dosxxx
segment byte public 'dos'
7 assume
cs:dosxxx
,ds:nothing
,es:nothing
,ss:nothing
9 ; ************************************************************************* *
11 ; * MODULE: DosQhandtype
13 ; * FILE NAME: DosQhandtype
15 ; * FUNCTION: Determine whether a handle is file or device
19 ; * push handle ; file handle
20 ; * push@ handtype ; handle type
21 ; * push@ flagword ; device descriptor word
26 ; * handle type: 0 - if a file
31 ; *************************************************************************
43 AttributePtr dd ?
; Device descriptor word returned if device
44 HandleTypePtr dd ?
; handle type; 0 = file handle, 1 = device handle
45 Handle dw ?
; file handle
51 Enter dosqhandtype
; push registers
53 mov bx,[bp].Handle
; get file handle
55 int 21h
; get handle type
57 lds si,[bp].AttributePtr
; setup area for attribute return
60 lds si,[bp].HandleTypePtr
61 mov ds:word ptr [si],0 ; assume it is a file
63 test dx,00080h ; test for file
64 jz ItIsAFile
; jump if true
66 mov ds:word ptr [si],1 ; else, it is a device, set flag
70 ret size
str - 6 ; return