]> wirehaze git hosting - MS-DOS.git/blob - v4.0/src/MAPPER/SFILEINF.ASM

wirehaze git hosting

MZ is back!
[MS-DOS.git] / v4.0 / src / MAPPER / SFILEINF.ASM
1 ;\ f \e0
2 page 80,132
3
4 title CP/DOS DosSetFileInfo mapper
5
6
7 FileAttributeSegment segment word public 'fat'
8
9 extrn FileAttributeTable:word
10
11 FileAttributeSegment ends
12
13
14 dosxxx segment byte public 'dos'
15 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
16 ;
17 ;**********************************************************************
18 ;*
19 ;* MODULE: dossetfileinfo
20 ;*
21 ;* FUNCTION: set file information
22 ;*
23 ;* CALLING SEQUENCE:
24 ;*
25 ;* push word file handle
26 ;* push word info level
27 ;* push@ other file info buffer
28 ;* push word file buffer size
29 ;* call dossetfileinfo
30 ;*
31 ;* MODULES CALLED: PC-DOS Int 21h, ah=57h, set file's date/time
32 ;*
33 ;*********************************************************************
34
35 public dossetfileinfo
36 .sall
37 .xlist
38 include macros.inc
39 .list
40
41
42
43 str struc
44 old_bp dw ?
45 return dd ?
46 BufferSize dw ? ; file info buufer size
47 BufferPtr dd ? ; file info buffer
48 Level dw ? ; file info level
49 Handle dw ? ; file handle
50 str ends
51
52 dossetfileinfo proc far
53 Enter dossetfileinfo ; push registers
54
55 mov bx,[bp].Handle ; fill registers for function call
56 lds si,[bp].BufferPtr ; date/time pointer
57 mov dx,word ptr [si]+8 ; date to be set
58 mov cx,word ptr [si]+10 ; time to be set
59
60 mov ax,5701h
61 int 21h
62 jc ErrorExit ; check for error
63
64 ; This code should be un-commented when the attribute can be set from
65 ; the setfileinfo call
66
67 ; lds si,[bp].BufferPtr
68 ; mov ax,ds:[si].the offset to the attribute word
69
70 ; mov bx,seg FileAttributeSegment
71 ; mov ds,bx
72 ; assume ds:FileAttributeSegment
73
74 ; mov bx,[bp].Handle
75 ; add bx,bx
76
77 ; mov FileAttributeTable[bx],ax
78
79 sub ax,ax ; set good return code
80
81 ErrorExit:
82 mexit ; pop registers
83 ret size str - 6 ; return
84
85 dossetfileinfo endp
86
87 dosxxx ends
88
89 end