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.

164 lines
3.9 KiB

  1. page ,132
  2. if 0
  3. /*++
  4. Copyright (c) 1991 Microsoft Corporation
  5. Module Name:
  6. int2a.asm
  7. Abstract:
  8. This module contains the int 2a handler for the NT VDM redir TSR
  9. Author:
  10. Richard L Firth (rfirth) 29-Oct-1991
  11. Environment:
  12. Dos mode only
  13. Revision History:
  14. 05-Sep-1991 rfirth
  15. Created
  16. --*/
  17. endif
  18. .xlist
  19. .xcref
  20. include rdrsvc.inc ; SVC
  21. include debugmac.inc ; debug display macros
  22. include segorder.inc ; load order of 'redir' segments
  23. .cref
  24. .list
  25. .286 ; all code in this module 286 compatible
  26. ResidentCodeStart
  27. assume cs:ResidentCode
  28. assume ds:nothing
  29. assume es:nothing
  30. assume ss:nothing
  31. public Old2aHandler
  32. Old2aHandler dd ?
  33. ; *** Int2aHandler
  34. ; *
  35. ; * Handles int 2a requests, in which we pretend to be minses and any
  36. ; * other missing parts of the net stack
  37. ; *
  38. ; * ENTRY function code in ah:
  39. ; * ah = 0, return ah = 1
  40. ; * ah = 1, Cooked NetBIOS call
  41. ; * ah = 4, al = 0, same as ah = 1
  42. ; * al = 1, Raw NetBIOS call
  43. ; * al = 2, unknown function; we don't handle it
  44. ; * See doslan\minses\int2a.inc in LANMAN
  45. ; * project for details
  46. ; * ah = 5, Get Adapter Resources. Returns in CX number of
  47. ; * available NCBs and in DX the number of available
  48. ; * sessions. We don't (as yet) handle this
  49. ; *
  50. ; * es:bx = NCB
  51. ; *
  52. ; * EXIT See above
  53. ; *
  54. ; * USES ax, flags
  55. ; *
  56. ; * ASSUMES nothing
  57. ; *
  58. ; ***
  59. public Int2aHandler
  60. Int2aHandler proc near
  61. or ah,ah ; installation check
  62. jz increment_ah_and_return
  63. ;
  64. ; not installation. Check for cooked/raw netbios calls
  65. ;
  66. cmp ah,1
  67. je cooked
  68. cmp ah,4
  69. je cooked_or_raw
  70. cmp ah,5
  71. je get_adapter_resources
  72. ;DbgPrintString "Int2aHandler: unrecognized request: "
  73. ;DbgPrintHexWord ax
  74. ;DbgCrLf
  75. ;
  76. ; the call is not for us - chain to the next Int 2A handler
  77. ;
  78. chain_next_handler:
  79. DbgUnsupported
  80. jmp Old2aHandler
  81. cooked_or_raw:
  82. or al,al ; ax = 0x0400?
  83. jz cooked ; yes - cooked
  84. cmp al,1 ; ax = 0x0401?
  85. je raw ; yes - raw
  86. cmp al,2 ; ax = 0x0402?
  87. jne chain_next_handler ; yes - same as raw; no - chain next
  88. ;
  89. ; raw request: just call NetBios via INT 5C and set ah dependent upon whether
  90. ; an error was returned from NetBios
  91. ;
  92. raw: int 5ch
  93. sub ah,ah
  94. or al,al
  95. jz @f
  96. increment_ah_and_return:
  97. inc ah
  98. @@: iret
  99. get_adapter_resources:
  100. mov ax,1
  101. mov bx,16
  102. mov cx,128
  103. mov dx,64
  104. iret
  105. ;
  106. ; 'cooked' call: this tries to convert synchronous NetBios calls to asynchronous
  107. ; then spins & beeps until the command has completed. Some commands are retried
  108. ; for a certain time or number of retries
  109. ;
  110. ;
  111. ; there is no justification for doing the 'cooked' processing that MINSES proper
  112. ; performs: The cooked processing is mainly to give the poor DOS user peace of
  113. ; mind when his machine seems dead, by occasionally beeping in a meaningful
  114. ; manner. Since we can terminate DOS sessions with impunity, there seems little
  115. ; point in letting the user know the machine is still alive, or retrying commands
  116. ; for that matter. However, that may change...
  117. ;
  118. cooked:
  119. DbgUnsupported
  120. jmp short raw ; fudge it for now
  121. Int2aHandler endp
  122. ResidentCodeEnd
  123. end