1 ; SCCSID = @(#)share.asm 1.1 85/04/10
2 TITLE SHARING ROUTINES
- Routines for
file Sharing
7 CODE SEGMENT BYTE PUBLIC 'CODE'
8 ASSUME
SS:DOSGROUP
,CS:DOSGROUP
17 AsmVars
<IBM
, Installed
>
26 I_need RetryCount
,WORD
30 ; [THISSFT] Points to filled in local file/device SFT for new
31 ; instance of file sf_mode ALWAYS has mode (even on FCB SFTs)
32 ; [WFP_START] has full path of name
36 ; Check for sharing violations on local file/device access
41 ; A sharing violation detected
45 procedure SHARE_CHECK
,NEAR
46 DOSAssume
CS,<DS>,"Share_Check"
62 ; Handle Sharing errors
64 ; Carry set if user says FAIL, causes error_sharing_violation
65 ; Carry clear if user wants a retry
67 ; DS, ES, DI preserved, others destroyed
69 procedure SHARE_VIOLATION
,NEAR
70 DOSAssume
CS,<DS>,"Share_Violation"
76 MOV [READOP
],0 ; All share errors are reading
77 MOV [ALLOWED
],allowed_FAIL
+ allowed_RETRY
79 MOV DI,1 ; Fake some registers
81 MOV DX,ES:[BP.dpb_dir_sector
]
87 retz
; 1 = retry, carry clear
91 EndProc SHARE_VIOLATION
93 ; ShareEnd - terminate sharing info on a particular SFT/UID/PID. This does
94 ; NOT perform a close, it merely asserts that the sharing information
95 ; for the SFT/UID/PID may be safely released.
97 ; Inputs: ES:DI points to an SFT
99 ; Registers modified: all except DS,ES,DI
101 procedure ShareEnd
,Near
102 DOSAssume
CS,<DS>,"ShareEnd"
114 break <ShareEnter
- attempt to
enter a node
into the sharing set
>
117 ; ShareEnter - perform a retried entry of a nodde into the sharing set. If
118 ; the max number of retries is exceeded, we notify the user via int 24.
120 ; Inputs: ThisSFT points to the SFT
121 ; WFP_Start points to the WFP
122 ; Outputs: Carry clear => successful entry
123 ; Carry set => failed system call
124 ; Registers modified: all
126 Procedure ShareEnter
,NEAR
127 DOSAssume
CS,<DS>,"ShareEnter"
134 les di,ThisSFT
; grab sft
136 MOV ES:[DI.sf_MFT
],AX ; indicate free SFT
138 call Share_Check
; attempt to enter into the sharing set
140 jnc done
; success, let the user see this
141 invoke Idle
; wait a while
142 loop attempt
; go back for another attempt
143 call Share_violation
; signal the problem to the user
144 jnc retry
; user said to retry, go do it