On Sun, 24 Nov 2002, Siim Vahtre wrote:

> Many weeks have passed but problem is still there.

Try the assembly program below and assemble using
nasm lockdos.asm -o lockdos.com
copy lockdos.com and lockdos.asm to the same directory.

Run two DOSEMU instances.
In one of them, run lockdos.
This will let you select how to lock lockdos.asm

In the other one, try
type lockdos.asm

In my experiment, with C: lredir'ed to an ext2 partition,
using option 1 and 3, the "type" refused to read the file.

So file locking works, right? I'm just not sure what I'm missing here.

Bart

        org 100h
        xor bx, bx
lop:
        mov ah, 9
        mov dx, string
        int 21h
        mov ah, 1
        int 21h
        sub al, '0'
        cmp al, 5
        jae quit
        push ax
        or bx, bx
        jz dontclose
        mov ah, 3eh
        int 21h         ; close file
dontclose:
        pop ax
        shl al, 4
        or al, 2
        mov dx, filename
        mov ah, 3dh
        int 21h         ; open r/w
        mov bx, ax
        jmp short lop
quit:
        ret

string  db 13,10,'Enter locking mode: ', 13, 10
        db '0: compatibility', 13, 10,
        db '1: DENYALL', 13, 10,
        db '2: DENYWRITE', 13, 10,
        db '3: DENYREAD', 13, 10,
        db '4: DENYNONE', 13, 10,
        db '5: quit', 13, 10, '$'
filename db 'lockdos.asm', 0


-
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to