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.

200 lines
4.0 KiB

  1. page ,132
  2. ;-----------------------------Module-Header-----------------------------;
  3. ; Module Name: VFD.ASM
  4. ;
  5. ; interface code to VFlatD
  6. ;
  7. ; Created: 03-20-90
  8. ; Author: Todd Laney [ToddLa]
  9. ;
  10. ; Copyright (c) 1984-1994 Microsoft Corporation
  11. ;
  12. ; Restrictions:
  13. ;
  14. ;-----------------------------------------------------------------------;
  15. ?PLM = 1
  16. ?WIN = 0
  17. .xlist
  18. include cmacros.inc
  19. include VflatD.inc
  20. .list
  21. sBegin Data
  22. globalD VflatD_Proc, 0
  23. globalW _hselSecondary, 0
  24. sEnd
  25. sBegin Code
  26. .386p
  27. assumes cs,Code
  28. assumes ds,nothing
  29. assumes es,nothing
  30. ;---------------------------Public-Routine------------------------------;
  31. ; VFDCall - return the version of VFlatD
  32. ;
  33. ; Returns:
  34. ; Wed 04-Jan-1993 13:45:58 -by- Todd Laney [ToddLa]
  35. ; Created.
  36. ;-----------------------------------------------------------------------;
  37. assumes ds,Data
  38. assumes es,nothing
  39. cProc VFDCall, <NEAR>, <>
  40. cBegin
  41. push esi
  42. push edi
  43. push es
  44. pushad
  45. xor di,di
  46. mov es,di
  47. mov ax,1684h
  48. mov bx,VflatD_Chicago_ID
  49. int 2fh ;returns with es:di-->VFlatD Entry point
  50. mov word ptr [VflatD_Proc][0],di
  51. mov word ptr [VflatD_Proc][2],es
  52. mov ax,es
  53. or ax,di
  54. jne short call_vfd
  55. xor di,di
  56. mov es,di
  57. mov ax,1684h
  58. mov bx,VflatD_Windows_ID
  59. int 2fh ;returns with es:di-->VFlatD Entry point
  60. mov word ptr [VflatD_Proc][0],di
  61. mov word ptr [VflatD_Proc][2],es
  62. mov ax,es
  63. or ax,di
  64. jnz short call_vfd
  65. popad
  66. pop es
  67. call_vfd_err:
  68. xor eax,eax
  69. xor ebx,ebx
  70. xor ecx,ecx
  71. xor edx,edx
  72. jmp call_vfd_exit
  73. call_vfd:
  74. popad
  75. pop es
  76. call [VflatD_Proc]
  77. jc call_vfd_err
  78. call_vfd_exit:
  79. pop edi
  80. pop esi
  81. cEnd
  82. ;---------------------------Public-Routine------------------------------;
  83. ; VFDQuery - return the version of VFlatD
  84. ;
  85. ; Returns:
  86. ; Wed 04-Jan-1993 13:45:58 -by- Todd Laney [ToddLa]
  87. ; Created.
  88. ;-----------------------------------------------------------------------;
  89. assumes ds,Data
  90. assumes es,nothing
  91. cProc VFDQueryVersion, <FAR, PUBLIC, PASCAL>, <>
  92. cBegin
  93. xor eax,eax
  94. mov edx,VFlatD_Query
  95. call VFDCall
  96. shld edx,eax,16
  97. cEnd
  98. cProc VFDQuerySel, <FAR, PUBLIC, PASCAL>, <>
  99. cBegin
  100. mov edx,VFlatD_Query
  101. call VFDCall
  102. and ebx,0000FFFFh
  103. mov eax,ebx
  104. shld edx,eax,16
  105. cEnd
  106. cProc VFDQuerySize, <FAR, PUBLIC, PASCAL>, <>
  107. cBegin
  108. mov edx,VFlatD_Query
  109. call VFDCall
  110. mov eax,ecx
  111. shld edx,eax,16
  112. cEnd
  113. cProc VFDQueryBase, <FAR, PUBLIC, PASCAL>, <>
  114. cBegin
  115. mov edx,VFlatD_Query
  116. call VFDCall
  117. mov eax,edx
  118. shld edx,eax,16
  119. cEnd
  120. cProc VFDReset, <FAR, PUBLIC, PASCAL>, <>
  121. cBegin
  122. mov edx,VFlatD_ResetBank
  123. call VFDCall
  124. cEnd
  125. cProc VFDBeginLinearAccess, <FAR, PUBLIC, PASCAL>, <>
  126. cBegin
  127. mov edx,VFlatD_Begin_Linear_Access
  128. mov dh,1 ;; set flag to allow 4k bank to work.
  129. call VFDCall
  130. shld edx,eax,16
  131. cEnd
  132. cProc VFDEndLinearAccess, <FAR, PUBLIC, PASCAL>, <>
  133. cBegin
  134. mov edx,VFlatD_End_Linear_Access
  135. call VFDCall
  136. shld edx,eax,16
  137. cEnd
  138. extrn LocalFree: FAR
  139. extrn LocalAlloc: FAR
  140. cProc LocalAllocSecondary, <FAR, PUBLIC, PASCAL>, <>
  141. parmW flags
  142. parmW allocsize
  143. cBegin
  144. mov ax, _hselSecondary
  145. test ax, ax
  146. jz AllocError
  147. push ds
  148. mov ds, ax
  149. push flags
  150. push allocsize
  151. call LocalAlloc
  152. mov dx, ds ; assume success
  153. pop ds
  154. test ax, ax
  155. jnz okay
  156. AllocError:
  157. xor dx, dx ; nope failed
  158. okay:
  159. cEnd
  160. cProc LocalFreeSecondary, <FAR, PUBLIC, PASCAL>, <>
  161. parmW lp
  162. cBegin
  163. push ds
  164. mov ax, _hselSecondary
  165. test ax, ax
  166. jz FreeError
  167. mov ds, ax
  168. push lp
  169. call LocalFree
  170. FreeError:
  171. pop ds
  172. cEnd
  173. sEnd
  174. end