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.

69 lines
1.6 KiB

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;
  3. ; Copyright (c) 1995 Microsoft Corporation. All Rights Reserved.
  4. ;
  5. ; File: w32event.asm
  6. ; Content: signal a win32 event
  7. ; History:
  8. ; Date By Reason
  9. ; ==== == ======
  10. ; 19-jul-95 craige initial implementation
  11. ;
  12. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  13. .386p
  14. Multimedia_OEM_ID equ 0440h ; MS Reserved OEM # 34
  15. MMDEVLDR_Device_ID equ Multimedia_OEM_ID + 10 ;MMDEVLDR's device ID
  16. MMDEVLDR_API_SetEvent equ 4 ;Internal
  17. _TEXT segment para public 'CODE' use16
  18. assume cs:_TEXT
  19. extrn AllocCSToDSAlias: FAR
  20. extrn FreeSelector: FAR
  21. MMDEVLDR_Entry dd ? ; the api entry point for mmdevldr
  22. public _SetWin32Event
  23. _SetWin32Event PROC FAR
  24. mov dx, MMDEVLDR_API_SetEvent
  25. mov ecx, [MMDEVLDR_Entry]
  26. jecxz short mmdevldr_load
  27. jmp [MMDEVLDR_Entry]
  28. mmdevldr_load:
  29. push dx ; save MMDEVLDR command ID
  30. push di
  31. push si
  32. push cs
  33. call AllocCStoDSAlias
  34. mov si, ax
  35. xor di, di ; zero ES:DI before call
  36. mov es, di
  37. mov ax, 1684h ; get device API entry point
  38. mov bx, MMDEVLDR_Device_ID ; virtual device ID
  39. int 2Fh ; call WIN/386 INT 2F API
  40. mov ax, es
  41. mov es, si
  42. mov word ptr es:MMDEVLDR_Entry, di
  43. mov word ptr es:MMDEVLDR_Entry+2, ax
  44. push ax
  45. push si
  46. call FreeSelector
  47. pop ax
  48. or ax, di
  49. pop si
  50. pop di
  51. pop dx
  52. jz short mmdevldr_fail
  53. jmp [MMDEVLDR_Entry]
  54. mmdevldr_fail:
  55. mov ax, 1;
  56. retf
  57. _SetWin32Event ENDP
  58. _TEXT ENDS
  59. end