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.

114 lines
2.5 KiB

  1. TITLE WOWDEB.ASM
  2. PAGE ,132
  3. ;
  4. ; WOW v1.0
  5. ;
  6. ; Copyright (c) 1991, Microsoft Corporation
  7. ;
  8. ; wowdeb.ASM
  9. ; Debug Routines
  10. ;
  11. ; History:
  12. ; 19-June-91 Matt Felton (mattfe) Created
  13. ;
  14. .xlist
  15. include kernel.inc
  16. include cmacros.inc
  17. .list
  18. .286p
  19. externFP WOWKernelTrace
  20. DataBegin
  21. externW curTDB
  22. DataEnd
  23. sBegin CODE
  24. assumes CS,CODE
  25. assumes DS,NOTHING
  26. assumes ES,NOTHING
  27. ;-----------------------------------------------------------------------;
  28. ; KdDbgOut ;
  29. ; ;
  30. ; Cmacros.inc has been modified so in the debug kernel all far public ;
  31. ; routines have a preamble compiled so they call this routine with a ;
  32. ; a count of the number of arguements and a pointer to a charater string;
  33. ; with the name of the routine. ;
  34. ; This routine then thunks to 32 bit WOW to output the paramters to the ;
  35. ; log. ;
  36. ; It assumes that if the callers CS != Our CS then its not the kernel ;
  37. ; Calling this routine ;
  38. ; Cmacros doesn't compile in the preamble for some internal routines ;
  39. ; that are called all the time. ;
  40. ; For retail Kernel the preamble and this routine are omitted. ;
  41. ; ;
  42. ; Arguments: ;
  43. ; lpStr long pointer to null terminated string ;
  44. ; cparms count of parameters ;
  45. ; Returns: ;
  46. ; none ;
  47. ; ;
  48. ; Error Returns: ;
  49. ; ;
  50. ; Registers Preserved: ;
  51. ; all ;
  52. ; ;
  53. ; Registers Destroyed: ;
  54. ; WOWKernelTrace Thunk to 32 bits ;
  55. ; ;
  56. ; History: ;
  57. ; ;
  58. ; June 19 1991 Create Matt Felton [mattfe]
  59. ;-----------------------------------------------------------------------;
  60. ifdef KDEBUG
  61. assumes ds, nothing
  62. assumes es, nothing
  63. cProc KdDbgOut,<PUBLIC,FAR>,<ax,bx,dx>
  64. parmW cParms
  65. parmD lpRoutineName
  66. cBegin
  67. SetKernelDS DS
  68. mov ax,curTDB ; if there is no CurrentTDB forget it.
  69. cmp ax,0
  70. jz KdDbgOut_Exit
  71. ; Get the iLogLevel From ROMBIOS Hard Disk Area
  72. push 0040h
  73. pop ds
  74. UnSetKernelDS ds
  75. iLogLevel equ 0042h ; use fixed disk status area
  76. cmp word ptr ds:[iLogLevel],"00" ;No Output if Zero
  77. jz KdDbgOut_Exit
  78. ; Log Application Calls Only
  79. mov ax,cs
  80. mov bx,word ptr [bp] ; (follow BP chain to user CS)
  81. add bx,3
  82. cmp word ptr ds:[iloglevel],"61" ; LOG IT ALL at Level 16
  83. jz @f
  84. cmp ax,word ptr ss:[bx] ;If Users CS != KERNEL CS
  85. jz KdDbgOut_Exit ; then ignore tracing
  86. @@:
  87. sub bx,2 ; Point to Callers Return Address IP:CS Args
  88. cCall WOWKernelTrace,<lpRoutineName,cParms,SSBX>
  89. KdDbgOut_Exit:
  90. cEnd
  91. endif
  92. sEND CODE
  93. end