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.

80 lines
1.7 KiB

  1. ;++
  2. ;
  3. ;Copyright (c) 1991 Microsoft Corporation
  4. ;
  5. ;Module Name:
  6. ;
  7. ; localmac.inc
  8. ;
  9. ;Abstract:
  10. ;
  11. ; Contains various macros to get around various things:
  12. ;
  13. ; DosCallBack
  14. ;
  15. ;
  16. ;Author:
  17. ;
  18. ; Richard L Firth (rfirth) 27-Sep-1991
  19. ;
  20. ;Environment:
  21. ;
  22. ; DOS application mode only
  23. ;
  24. ;Revision History:
  25. ;
  26. ; 24-Sep-1991 rfirth
  27. ; Created
  28. ;
  29. ;--
  30. ;*** DosCallBack
  31. ;*
  32. ;* Call back into DOS via the int 2f/ah=12 back door. If CALL_DOS defined,
  33. ;* use a call, else s/w interrupt. Using a call means no other TSRs etc.
  34. ;* which load AFTER the redir can hook it, but we DON'T HAVE TO MAKE A
  35. ;* PRIVILEGE TRANSITION ON x86 which speeds things up. This should be safe,
  36. ;* because no other s/w should really be hooking INT 2F/AH=12
  37. ;*
  38. ;* ENTRY FunctionNumber - dispatch code goes in al
  39. ;* DosAddr - if present, variable containing address of
  40. ;* DOS int 2f entry point
  41. ;* OldMultHandler - this variable contains the address of DOSs
  42. ;* int 2f back door. Specific to redir code
  43. ;*
  44. ;* EXIT nothing
  45. ;*
  46. ;* USES ax, OldMultHandler
  47. ;*
  48. ;* ASSUMES nothing
  49. ;*
  50. ;***
  51. DosCallBack macro FunctionNumber, DosAddr
  52. mov ax,(MultDOS shl 8) + FunctionNumber
  53. ifdef CALL_DOS
  54. pushf
  55. ifb <DosAddr>
  56. if (((.type OldMultHandler) and 32) eq 0) ;; OldMultHandler not defined
  57. extrn OldMultHandler:dword
  58. endif
  59. call OldMultHandler
  60. else
  61. call DosAddr
  62. endif
  63. else
  64. int 2fh
  65. endif
  66. endm
  67. ;
  68. ; defines for DosCallBack FunctionNumbers
  69. ;
  70. SF_FROM_SFN = 22
  71. GET_USER_STACK = 24
  72. PJFN_FROM_HANDLE= 32