⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rxdosifs.asm

📁 dos source
💻 ASM
📖 第 1 页 / 共 2 页
字号:
        TITLE   'ifs - DOS Installable File System Interface'
        PAGE 59, 132
        .LALL

        ;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
        ;  DOS Installable File System Interface                        ;
        ;...............................................................;

        ;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
        ;  Real Time Dos                                                ;
        ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -;
        ;                                                               ;
        ;  This material  was created as a published version  of a DOS  ;
        ;  equivalent product.   This program  logically  functions in  ;
        ;  the same way as  MSDOS functions and it  is  internal  data  ;
        ;  structure compliant with MSDOS 6.0                           ;
        ;                                                               ;
        ;  This product is distributed  AS IS and contains no warranty  ;
        ;  whatsoever,   including  warranty  of   merchantability  or  ;
        ;  fitness for a particular purpose.                            ;
        ;                                                               ;
        ;                                                               ;
        ;  (c) Copyright 1990, 1997. Api Software and Mike Podanoffsky  ;
        ;      All Rights Reserved Worldwide.                           ;
        ;                                                               ;
        ;  This product is protected under copyright laws and  may not  ;
        ;  be reproduced  in whole  or in part, in any form  or media,  ;
        ;  included but not limited to source listing, facsimile, data  ;
        ;  transmission, cd-rom, or  floppy disk without the expressed  ;
        ;  written consent of the author.                               ;
        ;                                                               ;
        ;  License  for  distribution  for commercial  use  or  resale  ;
        ;  required from:                                               ;
        ;                                                               ;
        ;  Api Software                                                 ;
        ;  12 South Walker Street                                       ;
        ;  Lowell,  MA   01851                                          ;
        ;                                                               ;
        ;  internet: mikep@world.std.com                                ;
        ;                                                               ;
        ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -;
        ;  Compile with MASM 5.1                                        ;
        ;...............................................................;

        include rxdosmac.asm
        include rxdosdef.asm

RxDOS   SEGMENT PARA PUBLIC 'CODE'
        assume cs:RxDOS, ds:RxDOS, es:RxDOS, ss:RxDOS

        ;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
        ;  DOS Installable File System Interface                        ;
        ;...............................................................;

        public Interrupt2F

    ; defined in rxdos

        extrn _RetCallersStackFrame             : near
        extrn _RxDOS_pCDS                       : dword
        extrn _RxDOS_bLastDrive                 : byte
        extrn _RxDOS_CurrentDrive               : byte
        extrn SDAFirstName                      : byte
        extrn SDASecondName                     : byte
        extrn SDApCurrentCDS                    : dword
    
        extrn pexterrInvalidFunction            : near
        extrn pexterrFileNotFound               : near
        extrn pexterrPathNotFound               : near
        extrn pexterrIllegalName                : near
        extrn pexterrNoHandlesAvailable         : near
        extrn pexterrAccessDenied               : near
        extrn pexterrInvalidHandle              : near
        extrn pexterrArenaTrashed               : near
        extrn pexterrNotEnoughMemory            : near
        extrn pexterrInvalidBlock               : near
        extrn pexterrInvalidAccess              : near
        extrn pexterrInvalidDrive               : near
        extrn pexterrCurrentDirectory           : near
        extrn pexterrNoMoreFiles                : near
        extrn pexterrFileExists                 : near

    ; defined in rxdosccb

        extrn CCBChanged                        : near
        extrn linkBegCCB                        : near
        extrn locateCCBPHeader                  : near
        extrn readBuffer                        : near
        extrn unlinkCCB                         : near
        extrn updateAllChangedCCBBuffers        : near

    ; defined in rxdosdev

        extrn checkforDeviceName                : near
        extrn checkforDeviceType                : near
        extrn DefineDPB                         : near
        extrn getDPB                            : near
        extrn getSysDate                        : near
        extrn setSysDate                        : near
        extrn getExpandedDateTime               : near
        extrn DevRead                           : near
        extrn DevWrite                          : near

    ; defined in rxdosfcb

        extrn initFCBfromSFT                    : near
        extrn buildFindFromFCB                  : near
        extrn buildDTAfcbFind                   : near

    ; defined in rxdosfil

        extrn blankinitDirName                  : near
        extrn initdiskAccess                    : near
        extrn compareDirEntries                 : near
        extrn computeLogSectorNumber            : near
        extrn ExpandFileName                    : near
        extrn LocateFile                        : near
        extrn LocateFreeDirSlot                 : near
        extrn LocateFileByAttribute             : near

        extrn GetActualDrive                    : near
        extrn getCurrDirCluster                 : near
        extrn getDevice                         : near
        extrn getDrive                          : near
        extrn getWhereInDir                     : near

    ; defined in rxdosmem

        extrn _initializeMemoryBlock            : near
        extrn _collectMemoryBlocks              : near
        extrn _releaseOwnerMemoryBlocks         : near
        extrn _allocateUpperMB                  : near
        extrn _allocateConvMB                   : near
        extrn _modifyMemBlock                   : near

    ; defined in rxdossft

        extrn createSFTEntry                    : near
        extrn FindAvailableSFTHandle            : near
        extrn findmatchingFCBSFT                : near
        extrn FindSFTbyHandle                   : near
        extrn MapApptoSFTHandle                 : near
        extrn MapSFTtoAppHandle                 : near
        extrn releaseSFT                        : near
        extrn VerifyAvailableHandle             : near

        extrn _SFTReadFile                      : near
        extrn _SFTWriteFile                     : near
        extrn _SFTOpenFile                      : near
        extrn _SFTCreateFile                    : near
        extrn _SFTCloseFile                     : near
        extrn _SFTCloseAllFiles                 : near
        extrn _SFTCommitFile                    : near

    ; defined in rxdosstr

        extrn CopyString                        : near
        extrn CopyBlock                         : near
        extrn convFCBNametoASCIZ                : near
        extrn convFilenametoFCBString           : near
        extrn getSysDateinDirFormat             : near
        extrn upperCase                         : near
        extrn lowerCase                         : near
        extrn __ascii_stosb                     : near
        extrn getMonthDayYear                   : near
        extrn getDaysSince1980                  : near
        extrn StringLength                      : near
        extrn condStringLength                  : near

        ;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
        ;  Installable File System (2f/11) Dispatch Table               ;
        ;...............................................................;

IFS_Dispatch:

        dw _IFSInstallCheck                     ; 00h Install Check
        dw _IFSRemoveDirectory                  ; 01h Remove Directory
        dw _IFSUndefined                        ; 02h (Unused)
        dw _IFSMakeDirectory                    ; 03h Make Directory
        dw _IFSUndefined                        ; 04h (Unused)
        dw _IFSChangeDirectory                  ; 05h Change Directory
        dw _IFSCloseFile                        ; 06h Close File
        dw _IFSCommitFile                       ; 07h Commit File
        dw _IFSReadFile                         ; 08h Read File
        dw _IFSWriteFile                        ; 09h Write File
        dw _IFSLockRegion                       ; 0Ah Lock Region
        dw _IFSUnlockRegion                     ; 0Bh Unlock Region
        dw _IFSGetDiskSpace                     ; 0Ch Get Disk Space
        dw _IFSUndefined                        ; 0Dh (Unused)
        dw _IFSSetFileAttributes                ; 0Eh Set File Attributes
        dw _IFSGetFileAttributes                ; 0Fh Get File Attributes
        dw _IFSUndefined                        ; 10h (Unused)
        dw _IFSRenameFile                       ; 11h Rename File
        dw _IFSUndefined                        ; 12h (Unused)
        dw _IFSDeleteFile                       ; 13h Delete File
        dw _IFSUndefined                        ; 14h (Unused)
        dw _IFSUndefined                        ; 15h (Unused)
        dw _IFSOpenFile                         ; 16h Open File
        dw _IFSCreateFile                       ; 17h Create File
        dw _IFSUnsupported                      ; 18h Create File without CDS
        dw _IFSUndefined                        ; 19h (Unused)
        dw _IFSUndefined                        ; 1Ah (Unused)
        dw _IFSFindFirst                        ; 1Bh Find First
        dw _IFSFindNext                         ; 1Ch Find Next
        dw _IFSCloseAllFiles                    ; 1Dh Close All Files
        dw _IFSSetRedirection                   ; 1Eh Set Redirection
        dw _IFSPrinterSetup                     ; 1Fh Printer Setup
        dw _IFSFlushBuffers                     ; 20h Flush Buffers
        dw _IFSSeekFromEnd                      ; 21h Seek From End
        dw _IFSTerminateProcess                 ; 22h Terminate Process
        dw _IFSQualifyFilename                  ; 23h Qualify Filename
        dw _IFSUndefined                        ; 24h (Unused)
        dw _IFSPrinterMode                      ; 25h Printer Mode
        dw _IFSPrinterOnOff                     ; 26h Printer On/Off
        dw _IFSCopy                             ; 27h Copy
        dw _IFSUndefined                        ; 28h (Unused)
        dw _IFSUndefined                        ; 29h (Unused)
        dw _IFSUndefined                        ; 2Ah (Unused)
        dw _IFSIOCTL                            ; 2Bh IOCTL
        dw _IFSUndefined                        ; 2Ch (Unused)
        dw _IFSUndefined                        ; 2Dh (Unused)
        dw _IFSExpandedOpen                     ; 2Eh Expanded Open/Create
        dw _IFSUndefined                        ; 2Fh (Unused)
        dw _IFSGetSegment                       ; 30h Get NFS Segment

_IFS_maxFunctionCode   equ ( $ - IFS_Dispatch ) / 2
IFS_INTERFACECODE       equ 11h

        ;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
        ;  Int 2F Original Chain                                        ;
        ;...............................................................;

Int2F_OriginalPtr:
        dd Int2F_DummyReturn
         
Int2F_DummyReturn:
        iret

        ;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''';
        ;  Install 2F Interface                                         ;
        ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -;
        ;                                                               ;
        ;  We know that the call is for us because no other redirector  ;
        ;  interface has claimed this call.                             ;
        ;                                                               ;
        ;...............................................................;

InstallRedirector:

        pushf                                           ; save interrupts

        cli
        xor ax, ax
        mov ds, ax
        mov bx, 002Fh * 4
        push word ptr [ bx. _pointer ]                  ; address
        push word ptr [ bx. _segment ]                  ; segment

        mov word ptr [ bx. _pointer ], offset Interrupt2F
        mov word ptr [ bx. _segment ], ss               ; segment

        pop word ptr ss:[ Int2F_OriginalPtr. _segment ]
        pop word ptr ss:[ Int2F_OriginalPtr. _pointer ] ; original

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -