Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.5 KiB

  1. ;/*
  2. ; * Microsoft Confidential
  3. ; * Copyright (C) Microsoft Corporation 1988 - 1991
  4. ; * All Rights Reserved.
  5. ; */
  6. /*******************************************************************/
  7. /* MEMCTRLC.C */
  8. /* */
  9. /* This module contains the Ctrl-C handler put in by Mem when */
  10. /* it links in UMBs. On a Ctrl-C, UMBs are delinked if they were */
  11. /* explicitly enabled by Mem. The old Ctrl-C handler is restored */
  12. /* and Mem then exits. If we dont do this, UMBs remain linked in */
  13. /* after a Ctrl-C and as a result lot of old programs dont run. */
  14. /* */
  15. /*******************************************************************/
  16. #include <stdio.h>
  17. #include <stdlib.h>
  18. #include <dos.h>
  19. extern char LinkedIn;
  20. extern void (interrupt far *OldCtrlc)();
  21. #pragma warning(4:4762)
  22. void interrupt cdecl far MemCtrlc (unsigned es, unsigned ds,
  23. unsigned di, unsigned si, unsigned bp, unsigned sp,
  24. unsigned bx, unsigned dx, unsigned cx, unsigned ax )
  25. {
  26. union REGS inregs;
  27. ((void)es), ((void)ds), ((void)si), ((void)bp), ((void)sp);
  28. ((void)bx), ((void)dx), ((void)bx), ((void)dx), ((void)cx);
  29. ((void)di), ((void)ax);
  30. if ( LinkedIn ) /* Did we link in UMBs */
  31. {
  32. inregs.x.ax = 0x5803;
  33. inregs.x.bx = 0;
  34. intdos( &inregs, &inregs ); /* Delink UMBs */
  35. }
  36. _dos_setvect( 0x23, OldCtrlc ); /* Restore previous ctrlc handler */
  37. exit(0); /* Exit Mem */
  38. }