     1                                  ;	SCCSID = @(#)lock.asm	1.1 85/04/10
     2                                  ;TITLE	LOCK ROUTINES - Routines for file locking
     3                                  ;NAME	LOCK
     4                                  
     5                                  ;
     6                                  ;   LOCK_CHECK
     7                                  ;   LOCK_VIOLATION
     8                                  ;   $LockOper
     9                                  ;
    10                                  ;   Revision history:
    11                                  ;     A000   version 4.00   Jan. 1988
    12                                  ;
    13                                  %include "dosseg.nas"
     1                              <1> ;	SCCSID = @(#)dosseg.asm	1.1 85/04/10
     2                              <1> ;	SCCSID = @(#)dosseg.asm	1.1 85/04/10
     3                              <1> ;
     4                              <1> ; segment ordering for MSDOS
     5                              <1> ;
     6                              <1> 
     7                              <1> %include "ddataseg.nas"
     1                              <2> 
     2                              <2> %include "lmacros3.mac"
     1                              <3> [list -]
     1          ******************  <3>  warning: redefining multi-line macro `struc' [-w+pp-macro-redef-multi]
    14                              <4> [list -]
    14                              <3> [list -]
     3                              <2> 
     4                              <2> addsection DOSSTART, align=16 PUBLIC class=DOSSTART
     5                              <2> ; (no prior section) ; DOSSTART		ENDS
     6                              <2> 
     7                              <2> addsection DOSSTARTJUMP, align=1 PUBLIC class=START
     8                              <2> ; (no prior section) ; DOSSTARTJUMP		ENDS
     9                              <2> 
    10                              <2> addsection CONSTANTS, align=2 PUBLIC class=CONST
    11                              <2> ; (no prior section) ; CONSTANTS	ENDS
    12                              <2> 
    13                              <2> addsection DATA, align=2 PUBLIC class=DATA
    14                              <2> ; (no prior section) ; DATA		ENDS
    15                              <2> 
    16                              <2> addsection TABLE, align=2 PUBLIC class=TABLE
    17                              <2> ; (no prior section) ; TABLE		ENDS
    18                              <2> 
    19                              <2> addsection DOSDATATABLE, align=2 PUBLIC class=DOSDATACODE
    20                              <2> ; (no prior section) ; DOSDATATABLE		ENDS
    21                              <2> 
    22                              <2> addsection DOSDATACODE, align=1 PUBLIC class=DOSDATACODE
    23                              <2> ; (no prior section) ; DOSDATACODE		ENDS
    24                              <2> 
    25                              <2> addsection DOSBIODATA, align=2 PUBLIC class=DOSBIODATA
    26                              <2> 
    27                              <2> addsection LAST, align=16 PUBLIC class=LAST
    28                              <2> ; (no prior section) ; LAST		ENDS
    29                              <2> 
    30                              <2> group DOSGROUP DOSSTART DOSSTARTJUMP CONSTANTS DATA TABLE DOSDATATABLE DOSDATACODE DOSBIODATA LAST
     8                              <1> 
     9                              <1> %include "dcodeseg.nas"
     1                              <2> 
     2                              <2> %ifndef DCODESEGNAS
     3                              <2> %assign DCODESEGNAS 1
     4                              <2> 
     5                              <2> section DOSCODETABLE align=2 PUBLIC class=DOSCODE
     6                              <2> ; (no prior section) ; DOSCODETABLE		ENDS
     7                              <2> section DOSCODECODE align=1 PUBLIC class=DOSCODE
     8                              <2> ; (no prior section) ; DOSCODECODE		ENDS
     9                              <2> section DOSBIOCODE align=2 PUBLIC class=DOSCODE
    10                              <2> section BIOCODE	align=2 PUBLIC class=DOSCODE
    11                              <2> 
    12                              <2> %ifnidni DOSENTRYGROUP, DOSCODEGROUP
    13                              <2>  group DOSCODEGROUP DOSCODETABLE DOSCODECODE DOSBIOCODE BIOCODE
    14                              <2> %endif
    15                              <2> 
    16                              <2> %endif
    10                              <1> 
    11                              <1> section LAST
    12                              <1> ; (no prior section) ; LAST		ENDS
    14                                  
    15                                  section DOSCODECODE
    16                                  
    17                                  [list -]
    17          ******************       warning: out: ... for DOS Version 4.00 ... [-w+user]
    17          ******************       warning: out: BPB.INC... [-w+user]
    17          ******************       warning: out: ... CLONE version build switch on ... [-w+user]
    17          ******************       warning: out: DEVSYM.INC... [-w+user]
    24                                  
    25                                  %ifndef IBM
    26                                   %iassign IBM 0
    27                                  %endif
    28                                  %ifndef Installed
    29                                   %iassign Installed 0
    30                                  %endif
    31                                  
    32                                  %iassign Installed TRUE
    33                                  
    34                                  	i_need	THISSFT,DWORD
    35                                  	i_need	THISDPB,DWORD
    36                                  	i_need	EXTERR,WORD
    37                                  	i_need	ALLOWED,BYTE
    38                                  	i_need	RetryCount,WORD
    39                                  	I_need	fShare,BYTE
    40                                  	I_Need	EXTERR_LOCUS,BYTE	; Extended Error Locus
    41                                  	i_need	JShare,DWORD
    42                                  	i_need	Lock_Buffer,DWORD	;AN000; DOS 4.00
    43                                  	i_need	Temp_Var,WORD		;AN000; DOS 4.00
    44                                  
    45                                   assume nocheck, ss:DOSGROUP
    46                                  
    47                                  BREAK <$LockOper - Lock Calls>
    48                                  
    49                                  ;
    50                                  ;   Assembler usage:
    51                                  ;	    MOV     BX, Handle	       (DOS 3.3)
    52                                  ;	    MOV     CX, OffsetHigh
    53                                  ;	    MOV     DX, OffsetLow
    54                                  ;	    MOV     SI, LengthHigh
    55                                  ;	    MOV     DI, LengthLow
    56                                  ;	    MOV     AH, LockOper
    57                                  ;	    MOV     AL, Request
    58                                  ;	    INT     21h
    59                                  ;
    60                                  ;   Error returns:
    61                                  ;	    AX = error_invalid_handle
    62                                  ;	       = error_invalid_function
    63                                  ;	       = error_lock_violation
    64                                  ;
    65                                  ;   Assembler usage:
    66                                  ;	    MOV     AX, 5C??	       (DOS 4.00)
    67                                  ;
    68                                  ;				    0? lock all
    69                                  ;				    8? lock write
    70                                  ;				    ?2 lock multiple
    71                                  ;				    ?3 unlock multiple
    72                                  ;				    ?4 lock/read
    73                                  ;				    ?5 write/unlock
    74                                  ;				    ?6 add (lseek EOF/lock/write/unlock)
    75                                  ;	    MOV     BX, Handle
    76                                  ;	    MOV     CX, count or size
    77                                  ;	    LDS     DX, buffer
    78                                  ;	    INT     21h
    79                                  ;
    80                                  ;   Error returns:
    81                                  ;	    AX = error_invalid_handle
    82                                  ;	       = error_invalid_function
    83                                  ;	       = error_lock_violation
    84                                  
    85                                  	procedure   D_LockOper,NEAR
    85          ******************       warning: proc D_LockOper... [-w+user]
    86                                  ASSUME	DS:NOTHING,ES:NOTHING
    87                                  ;	MOV	BP,AX			;MS. BP=AX				;AN000;
    88                                  ;	AND	BP,7FH			;MS. clear bit 7			;AN000;
    89                                  ;	CMP	BP,Lock_add		;MS. supported function ?		;AN000;
    90                                  ;	JA	lock_bad_func		;MS. no,				;AN000;
    91                                  
    92 00000000 3C01                    	CMP	AL,1			;AN000;;MS. no,
    93 00000002 770C                    	JA	lock_bad_func		;AN000;;MS. no,
    94                                  
    95 00000004 57                      	PUSH	DI			       ; Save LengthLow
    96 00000005 E8(0000)                	invoke	SFFromHandle		       ; ES:DI -> SFT
    97 00000008 7310                    	JNC	lock_do 		       ; have valid handle
    98 0000000A 5F                      	POP	DI			       ; Clean stack
    99 0000000B B006E9(0000)            	error	error_invalid_handle
   100                                  lock_bad_func:
   101                                  errLoc_Unk equ errLOC_Unk	; NASM port equate
   102 00000010 36C606[0000]01          	MOV	byte [ss:EXTERR_LOCUS],errLoc_Unk        ; Extended Error Locus
   103 00000016 B001EBF3                	error	error_invalid_function
   104                                  
   105                                  ; Align_buffer call has been deleted, since it corrupts the DTA  (6/5/88) P5013
   106                                  
   107                                  lock_do:
   108                                  ;	PUSH	AX			;AN000;;MS. save ax
   109                                  ;	PUSH	BX			;AN000;;MS. save handle
   110                                  ;	MOV	[Temp_Var],DX		;AN000;;MS. save DX
   111                                  ;	invoke	Align_Buffer		;AN000;;MS. align ds:dx and set DMAADD
   112                                  ;	POP	BX			;AN000;;MS. restore handle
   113                                  ;	POP	AX			;AN000;;MS. save ax
   114                                  					;AN000;
   115                                  ;	CMP	BP,Unlock_all		;AN000;;MS. old function 0 or 1 ?
   116                                  ;	JA	chk_lock_mul		;AN000;;MS. no, new function
   117                                  ;	TEST	AL,80H			;AN000;;MS. 80H bit on ?
   118                                  ;	JZ	old_33			;AN000;;MS. no, old DOS 3.3 interface
   119                                  ;	MOV	CX,1			;AN000;;MS. adjust for new interface
   120                                  ;	ADD	BP,2			;AN000;;MS.
   121                                  ;	JMP	SHORT chk_lock_mul	;AN000;;MS.
   122                                  old_33:
   123 0000001A 89C3                    	MOV	BX,AX			;AN000;;MS. save AX
   124                                  					;AN000;
   125                                  ;;	MOV	DX,[Temp_Var]		;AN000;;MS. retore DX  (P5013) 6/5/88
   126                                  
   127 0000001C BD[0000]                	MOV	BP, OFFSET Lock_Buffer wrt DOSGROUP ;AN000;;MS. get DOS LOCK buffer
   128 0000001F 895600                  	MOV	WORD PTR [BP + Lock_position],DX	;AN000;;MS. set low offset
   129 00000022 894E02                  	MOV	WORD PTR [BP + Lock_position+2],CX;AN000;;MS. set high offset
   130 00000025 59                      	POP	CX				;AN000;;MS. get low length
   131 00000026 894E04                  	MOV	WORD PTR [BP + Lock_length],CX	;AN000;;MS. set low length
   132 00000029 897606                  	MOV	WORD PTR [BP + Lock_length+2],SI	;AN000;;MS. set high length
   133 0000002C B90100                  	MOV	CX,1				;AN000;;MS. one range
   134 0000002F 16                      	PUSH	ss				;AN000;;MS.
   135 00000030 1F                      	POP	DS				;AN000;;MS. DS:DX points to
   136                                   assume ds:DOSGROUP
   137 00000031 89EA                    	MOV	DX,BP				;AN000;;MS.   Lock_Buffer
   138 00000033 A801                    	TEST	AL,Unlock_all			;AN000;;MS. function 1
   139 00000035 7503                    	JNZ	DOS_Unlock			;AN000;;MS. yes
   140 00000037 EB20                    	JMP	DOS_Lock			;AN000;;MS. function 0
   141 00000039 90                      	nop	; identicalise
   142                                  ;;chk_lock_mul: 				;AN000;
   143                                  ;	POP	SI				;AN000;;MS. pop low length
   144                                  ;	TEST	[ES:DI.sf_flags],sf_isnet	;AN000;;MS. net handle?
   145                                  ;	JZ	LOCAL_DOS_LOCK			;AN000;;MS. no
   146                                  ;	invoke	OWN_SHARE			;AN000;;MS. IFS owns share ?
   147                                  ;	JNZ	LOCAL_DOS_LOCK			;AN000;;MS. no
   148                                  ;	MOV	BX,AX				;AN000;;MS. BX=AX
   149                                  ;	CallInstall NET_XLock,multNet,10	;AN000;;MS. issue Net Extended Lock
   150                                  ;	MOV	[Temp_Var],CX			;AN000;;MS. cx= retuened from IFS
   151                                  ;	JMP	ValChk				;AN000;;MS. check return
   152                                  ;LOCAL_DOS_LOCK:				;AN000;
   153                                  ;	CMP	BP,Lock_mul_range		;AN000;;MS. lock mul range?
   154                                  ;	JNZ	unmul				;AN000;;MS. lock mul range?
   155                                  ;	JMP	LOCAL_LOCK			;AN000;;MS. yes
   156                                  ;unmul:
   157                                  ;	CMP	BP,Unlock_mul_range		;AN000;;MS. unlock mul range?
   158                                  ;	JZ	LOCAL_UNLOCK			;AN000;;MS. yes
   159                                  ;	CMP	BP,Lock_read			;AN000;;MS. lock read?
   160                                  ;	JNZ	chk_write_unlock		;AN000;;MS. no
   161                                  ;	CALL	Set_Lock_Buffer 		;AN000;;MS. set DOS lock buffer
   162                                  ;	CALL	Set_Lock			;AN000;;MS. set the lock
   163                                  ;	JC	lockerror			;AN000;;MS. error
   164                                  ;	invoke	$READ				;AN000;;MS. do read
   165                                  ;	JC	lockerror			;AN000;;MS. error
   166                                  ;lockend:					;AN000;
   167                                  ;	transfer SYS_RET_OK			;AN000;;MS. return
   168                                  ;chk_write_unlock:				;AN000;
   169                                  ;	CMP	BP,Write_unlock 		;AN000;;MS. write unlock ?
   170                                  ;	JNZ	Lock_addf			;AN000;;MS. no
   171                                  ;	CALL	Set_Lock_Buffer 		;AN000;;MS. set DOS lock buffer
   172                                  ;WriteUnlock:					;AN000;
   173                                  ;	PUSH	AX				;AN000;;MS. save AX for unlock
   174                                  ;	invoke	$WRITE				;AN000;;MS. do write
   175                                  ;	MOV	[Temp_Var],AX			;AN000;;MS. save number of bytes writ
   176                                  ;	POP	AX				;AN000;;MS. restore AX
   177                                  ;	JC	lockerror			;AN000;;MS. error
   178                                  ;	MOV	CX,1				;AN000;;MS. one range unlock
   179                                  ;	PUSH	ss				;AN000;;MS.
   180                                  ;	POP	DS				;AN000;;MS. DS:DX points to
   181                                  ;	MOV	DX,OFFSET Lock_Buffer wrt DOSGROUP	;AN000;;MS.  Lock_BUffer
   182                                  ;	JMP	LOCAL_UNLOCK			;AN000;;MS. do unlock
   183                                  ;Lock_addf:					;AN000;
   184                                  ;	MOV	SI,WORD PTR [ES:DI.SF_Size]	 ;AN000;;MS. must be lock add
   185                                  ;	MOV	WORD PTR [ES:DI.SF_Position],SI  ;AN000;;MS. set file position to
   186                                  ;	MOV	SI,WORD PTR [ES:DI.SF_Size+2]	 ;AN000;;MS. EOF
   187                                  ;	MOV	WORD PTR [ES:DI.SF_Position+2],SI;AN000;;MS.
   188                                  ;	CALL	Set_Lock_Buffer 		 ;AN000;;MS. set DOS lock buffer
   189                                  ;	CALL	Set_Lock			 ;AN000;;MS. set the lock
   190                                  ;	JC	lockerror			 ;AN000;;MS. error
   191                                  ;	JMP	WriteUnlock			 ;AN000;;MS. do write unlock
   192                                  						 ;AN000;;MS.
   193                                  DOS_Unlock:
   194 0000003A 26F745050080            	TEST	word [ES:DI + sf_flags],sf_isnet
   195 00000040 7407                    	JZ	LOCAL_UNLOCK
   196                                  ;;	invoke	OWN_SHARE			 ;AN000;;MS. IFS owns share ?
   197                                  ;;	JNZ	LOCAL_UNLOCK			 ;AN000;;MS. no
   198                                  
   199                                  multNet equ MultNET	; NASM port equate
   200 00000042 B80A11CD2F              	CallInstall Net_Xlock,multNet,10
   201 00000047 EB05                    	JMP	SHORT ValChk
   202                                  LOCAL_UNLOCK:
   203                                  %if installed
   204 00000049 36FF1E[1C00]            	Call	far [ss:JShare + 7 * 4]
   205                                  %else
   206                                  	Call	clr_block
   207                                  %endif
   208                                  ValChk:
   209 0000004E 7302                    	JNC	Lock_OK
   210                                  lockerror:
   211 00000050 EBC6                    	transfer SYS_RET_ERR
   212                                  Lock_OK:
   213                                  Temp_VAR equ Temp_Var	; NASM port label
   214 00000052 36A1[0000]              	MOV	AX,[ss:Temp_VAR]			 ;AN000;;MS. AX= number of bytes
   215 00000056 E9(0000)                	transfer SYS_Ret_OK
   216                                  DOS_Lock:
   217 00000059 26F745050080            	TEST	word [ES:DI + sf_flags],sf_isnet
   218 0000005F 7407                    	JZ	LOCAL_LOCK
   219                                  ;;	invoke	OWN_SHARE			 ;AN000;;MS. IFS owns share ?
   220                                  ;;	JNZ	LOCAL_LOCK			 ;AN000;;MS. no
   221 00000061 B80A11CD2F              	CallInstall NET_XLock,multNet,10
   222 00000066 EBE6                    	JMP	ValChk
   223                                  LOCAL_LOCK:
   224                                  %if installed
   225 00000068 36FF1E[1800]            	Call	far [ss:JShare + 6 * 4]
   226                                  %else
   227                                  	Call	Set_Block
   228                                  %endif
   229 0000006D EBDF                    	JMP	ValChk
   230                                  
   231                                  EndProc D_LockOper
   232                                  
   233                                  BREAK <Set_Lock>
   234                                  
   235                                  ;   Input:
   236                                  ;	   BP = Lock_Buffer addr
   237                                  ;	   CX = lock length
   238                                  ;   Function:
   239                                  ;	   set the lock
   240                                  ;   Output:
   241                                  ;	   carry clear ,Lock is set
   242                                  ;			DS:DX = addr of
   243                                  ;	   carry set Lock is not set
   244                                  ;	   DS,DX,CX preserved
   245                                  
   246                                  ;	procedure   Set_Lock,NEAR						;AN000;
   247                                  ;ASSUME  DS:NOTHING,ES:NOTHING							 ;AN000;
   248                                  										;AN000;
   249                                  ;	PUSH	DS			    ;MS. save regs			;AN000;
   250                                  ;	PUSH	DX			    ;MS.				;AN000;
   251                                  ;	PUSH	CX			    ;MS.				;AN000;
   252                                  ;										;AN000;
   253                                  ;	PUSH	ss			    ;MS.				;AN000;
   254                                  ;	POP	DS			    ;MS. DS:DX poits to Lock_Buffer	;AN000;
   255                                  ;	MOV	DX,BP			    ;MS.				;AN000;
   256                                  ;	PUSH	BX			    ;MS. save handle			;AN000;
   257                                  ;	PUSH	AX			    ;MS. save functions 		;AN000;
   258                                  ;	MOV	CX,1			    ;MS. set one lock			;AN000;
   259                                  ;if installed									 ;AN000;
   260                                  ;	Call	JShare + 6 * 4		    ;MS. call share set block		;AN000;
   261                                  ;else										 ;AN000;
   262                                  ;	Call	Set_Block		    ;MS.				;AN000;
   263                                  ;endif										 ;AN000;
   264                                  ;	POP	AX			    ;MS. restore regs			;AN000;
   265                                  ;	POP	BX			    ;MS.				;AN000;
   266                                  ;	POP	CX			    ;MS.				;AN000;
   267                                  ;	POP	DX			    ;MS.				;AN000;
   268                                  ;	POP	DS			    ;MS.				;AN000;
   269                                  ;	return				    ;MS.				;AN000;
   270                                  ;										;AN000;
   271                                  ;EndProc Set_Lock								 ;AN000;
   272                                  
   273                                  BREAK <Set_Lock_Buffer>
   274                                  
   275                                  ;   Input:
   276                                  ;	   ES:DI = addr of SFT
   277                                  ;	   CX = lock length
   278                                  ;   Function:
   279                                  ;	   set up the lock buffer
   280                                  ;   Output:
   281                                  ;	   Lock_Buffer is filled with position and lock length
   282                                  ;	   BP = Lock_Buffer addr
   283                                  ;
   284                                  
   285                                  ;	procedure   Set_Lock_Buffer,NEAR
   286                                  ;ASSUME  DS:NOTHING,ES:NOTHING
   287                                  ;
   288                                  ;	MOV	BP, OFFSET Lock_Buffer wrt DOSGROUP   ;MS. move file position	;AN000;
   289                                  ;	MOV	SI,WORD PTR [ES:DI.sf_position]   ;MS. to DOS lock_buffer	;AN000;
   290                                  ;	MOV	WORD PTR [BP.Lock_position],SI	  ;MS.				;AN000;
   291                                  ;	MOV	SI,WORD PTR [ES:DI.sf_position+2] ;MS.				;AN000;
   292                                  ;	MOV	WORD PTR [BP.Lock_position+2],SI  ;MS.				;AN000;
   293                                  ;	MOV	WORD PTR [BP.Lock_length],CX	  ;MS. move cx to lock_buffer	;AN000;
   294                                  ;	MOV	WORD PTR [BP.Lock_length+2],0	  ;MS.				;AN000;
   295                                  ;	return					  ;MS.				;AN000;
   296                                  ;
   297                                  ;EndProc Set_Lock_Buffer
   298                                  
   299                                  ; Inputs:
   300                                  ;	Outputs of SETUP
   301                                  ;	[USER_ID] Set
   302                                  ;	[PROC_ID] Set
   303                                  ; Function:
   304                                  ;	Check for lock violations on local I/O
   305                                  ;	Retries are attempted with sleeps in between
   306                                  ; Outputs:
   307                                  ;    Carry clear
   308                                  ;	Operation is OK
   309                                  ;    Carry set
   310                                  ;	A lock violation detected
   311                                  ; Outputs of SETUP preserved
   312                                  
   313                                  	procedure   LOCK_CHECK,NEAR
   313          ******************       warning: proc LOCK_CHECK... [-w+user]
   314                                  	DOSAssume   CS,<DS>,"Lock_Check"
   315                                  	ASSUME	ES:NOTHING
   316                                  
   317 0000006F 8B1E[0000]              	MOV	BX,[RetryCount]		; Number retries
   318                                  LockRetry:
   319 00000073 5350                    	SaveReg <BX,AX> 		; MS. save regs 			;AN000;
   320                                  %if installed
   321 00000075 FF1E[2000]              	call	far [JShare + 8 * 4]
   322                                  %else
   323                                  	Call	chk_block
   324                                  %endif
   325 00000079 585B                    	RestoreReg  <AX,BX>		; MS. restrore regs			;AN000;
   326 0000007B 7201C3                  	retnc				; There are no locks
   327 0000007E E8(0000)                	Invoke	Idle			; wait a while
   328 00000081 4B                      	DEC	BX			; remember a retry
   329 00000082 75EF                    	JNZ	LockRetry		; more retries left...
   330 00000084 F9                      	STC
   331 00000085 C3                      	return
   332                                  EndProc LOCK_CHECK
   333                                  
   334                                  ; Inputs:
   335                                  ;	[THISDPB] set
   336                                  ;	[READOP] indicates whether error on read or write
   337                                  ; Function:
   338                                  ;	Handle Lock violation on compatibility (FCB) mode SFTs
   339                                  ; Outputs:
   340                                  ;	Carry set if user says FAIL, causes error_lock_violation
   341                                  ;	Carry clear if user wants a retry
   342                                  ;
   343                                  ; DS, ES, DI, CX preserved, others destroyed
   344                                  
   345                                  	procedure   LOCK_VIOLATION,NEAR
   345          ******************       warning: proc LOCK_VIOLATION... [-w+user]
   346                                  	DOSAssume   CS,<DS>,"Lock_Violation"
   347                                  	ASSUME	ES:NOTHING
   348                                  
   349 00000086 1E                      	PUSH	DS
   350 00000087 06                      	PUSH	ES
   351 00000088 57                      	PUSH	DI
   352 00000089 51                      	PUSH	CX
   353 0000008A B82100                  	MOV	AX,error_lock_violation
   354                                  allowed_FAIL equ Allowed_FAIL	; NASM port equate
   355                                  allowed_RETRY equ Allowed_RETRY	; NASM port equate
   356 0000008D C606[0000]18            	MOV	byte [ALLOWED],allowed_FAIL + allowed_RETRY
   357 00000092 C42E[0000]              	LES	BP,[THISDPB]
   358 00000096 BF0100                  	MOV	DI,1				; Fake some registers
   359 00000099 89F9                    	MOV	CX,DI
   360 0000009B 268B560B                	MOV	DX,[ES:BP + dpb_first_sector]
   361 0000009F E8(0000)                	invoke	HARDERR_DOS
   362 000000A2 59                      	POP	CX
   363 000000A3 5F                      	POP	DI
   364 000000A4 07                      	POP	ES
   365                                   assume es:nothing
   366 000000A5 1F                      	POP	DS
   367                                   assume ds:DOSGROUP
   368 000000A6 3C01                    	CMP	AL,1
   369 000000A8 74DB                    	retz			; 1 = retry, carry clear
   370 000000AA F9                      	STC
   371 000000AB C3                      	return
   372                                  
   373                                  EndProc LOCK_VIOLATION
   374                                  
   375                                  %IF  INSTALLED
   376                                  ;
   377                                  ; do a retz to return error
   378                                  ;
   379                                  Procedure   CheckShare,NEAR
   379          ******************       warning: proc CheckShare... [-w+user]
   380                                   ASSUME ES:NOTHING,DS:NOTHING,SS:DOSGROUP
   381 000000AC 36803E[0000]00          	CMP	byte [ss:fShare],0
   382 000000B2 C3                      	return
   383                                  EndProc CheckShare
   384                                  %ENDIF
   385                                  
   386                                      END
