home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / DENYNO.ZIP / DENYNONE.ASM next >
Assembly Source File  |  1992-05-05  |  2KB  |  66 lines

  1. ; This small program was created to help eliminate some of the file sharing
  2. ; problems I was encountering with OS/2 2.00.  The problem, it seems, is that
  3. ; some MS-DOS programs open files with sharing denied, when they really don't
  4. ; need to (Borland C in particular).  This makes it hard to compile in the
  5. ; background while viewing header files that are being compiled.  Denynone is
  6. ; an MS-DOS TSR that simply intercepts all MS-DOS file open requests
  7. ; (function 3D) and ensures the sharing mode is 'deny none'.  In other words,
  8. ; with denynone loaded, most of the sharing problems should be eliminated.  If
  9. ; you know what I'm talking about you probably want denynone, if not, you
  10. ; probably don't.
  11. ; !!BEWARE!!
  12. ;    Obviously, if a program really needs to deny sharing, denyone will
  13. ;    circumvent it, possibly causing serious data loss.  Use denynone at
  14. ;    your own risk.
  15. ; !!BEWARE!!
  16. ; It may be that OS/2 2.00 provides an easier way to do this, but I haven't
  17. ; found it.  If you find it, I would be grateful if you would let me know.
  18. ; Eugene Nelson
  19. ; 70662,2501
  20.  
  21. CODE        SEGMENT
  22.             ASSUME     cs:CODE, ds:NOTHING, es:NOTHING
  23.  
  24.             ORG        100H
  25. START:      jmp        Initialize
  26.  
  27. OldDos      dd        0
  28.  
  29. NewDos      proc       far
  30.             sti
  31.             cmp        ah,3DH
  32.             je         NewDos1
  33. GetOut:     jmp        OldDos        ;could check for extend open 6C here
  34.  
  35. NewDos1:    and        al,10001111b
  36.             or         al,01000000b
  37.             jmp        OldDos
  38. NewDos      endp
  39.  
  40.  
  41. Initialize:
  42.             mov    ax,3521H                   ;OldDos <- Int 21H
  43.             int    21H
  44.             mov    word ptr [OldDos],    bx
  45.             mov    word ptr [OldDos + 2],es
  46.  
  47.             mov    ax,2521H                   ;Int 21H -> NewDos
  48.             mov    dx,offset NewDos
  49.             int    21H
  50.  
  51.             mov    ax, offset initialize
  52.             shr    ax,1
  53.             shr    ax,1
  54.             shr    ax,1
  55.             shr    ax,1
  56.             inc    ax                 ;ax = (offset initialize)/16 + 1
  57.             mov    dx,ax
  58.             mov    ax,3100H
  59.             int    21H                ;DOS exit and remain resident
  60.  
  61. CODE        ENDS
  62.             END     START
  63.