#pragma inline

#include "dos.h"

struct INTERRUPT

      {

            unsigned bp,di,si,ds,es,dx,cx,bx,ax,ip,cs,fl;

      };

void interrupt nodel(struct INTERRUPT);

void interrupt (*prev)();

 

main()

{

//AIM : to deactivate the dos del command using int21 tsr

      void interrupt nodel(struct INTERRUPT);

      unsigned long far *int21ptr;

      int21ptr=(unsigned long far*)(0x21*4);

      prev=(void (interrupt far*)())*int21ptr;

      *int21ptr=(unsigned long)nodel;

      keep(0,1000);

      return 0;

}

 

void interrupt nodel(struct INTERRUPT r)

{

 //   if((_AH==19)|(_AH==65)) // if delete attempted on a file

  //        {

  //              r.fl=r.fl&0xfffe; //make LSB of flag register on stack as 0

  //              return;

  //        }

      if (_AH==0x41)

            {

                  r.fl=r.fl&0xfffe;

                  return;

            }

 

      asm pop bp;

      asm pop di;

      asm pop si;

      asm pop ds;

      asm pop es;

      asm pop dx;

      asm pop cx;

      asm pop bx;

      asm pop ax;

 

      asm jmp cs:_prev;

}