home *** CD-ROM | disk | FTP | other *** search
- /* JohnPC 1991
-
- From the quick programming series:
- "How It Can Always Be Done Even Dirtier",
- The public domain program, #42: The DESQview hider.
-
- Compiles under Borland C++ 2.0
- */
-
- #ifndef __BORLANDC__
- #error Hah! And you thought you could port this?
- #endif
-
- #ifndef __SMALL__
- #error Supposed to be compiled using the small memory model.
- #endif
-
- #pragma inline
- #pragma hdrfile "nodv.sym"
- #include <stdio.h>
- #include <process.h>
- #include <dos.h>
- #pragma hdrstop
-
- unsigned _stklen = 0x1000;
- unsigned _heaplen = 0x400;
-
- void nodv21(void);
- void old21vec(void) { /* Now if this isn't ugly, tell me what is. */ }
- void interrupt (*far* old21p)(void);
-
- void main(int argc, char** argv) {
- int exitv;
-
- if ( argc == 1 ) {
- puts("NODV is a commandline prefix that hides DESQview.\n\
- Just prepend it to the command you would normally enter.");
- exit(-1);
- }
- old21p = (void interrupt (*far*)(void)) old21vec;
- *old21p = getvect(0x21);
- setvect(0x21, (void interrupt (*)(void)) nodv21);
- if ( (exitv = spawnvp(P_WAIT, argv[1], argv + 1)) == -1 )
- puts("Unknown command");
- setvect(0x21, *old21p);
- exit(exitv);
- }
-
- void nodv21(void) {
- asm pop bp;
- if ( _AH == 0x2B && _CX == 0x4445 && _DX == 0x5351 ) {
- _AL = 0xFF;
- asm iret;
- }
- else
- asm jmp dword ptr [cs:old21vec];
- }
-