OSDN Git Service

[Release] Ver.2.1.0
[dokopop/dokopop.git] / VxD / hk95d.asm
1 ;;HK95d.asm
2 name HK95D
3 .386p
4 ;; ------------------------------------------------
5 ;; ------------------------------------------------
6 ;; HK95d.asm -- Assembly module, MAIN module for
7 ;; Dynamically loadable VxD for DCHOOK
8 ;; ------------------------------------------------
9 ;; ------------------------------------------------
10
11 ;; -----------------------------------
12 ;; INCLUDE files needed by this module
13 ;; -----------------------------------
14
15 include <inc\win98\vmm.inc>
16 include <inc\win98\vwin32.inc>
17 include <inc\win98\vpicd.inc>
18
19 ;; ------------------------------------
20 ;; C routines/data used by this module
21 ;; ------------------------------------
22 extrn _CHK95_Device_Init:near
23 extrn _CHK95_Device_UNInit:near
24 extrn _CHK95_Device_IOctrl:near
25
26 ;; -------------------------------------
27 ;; Routines/data called from this module
28 ;; -------------------------------------
29 ; public
30
31  ; ==================================================================================
32 ;; Misc HK95-specific Equates
33 ;; ----------------------------------------------------------------------------------
34 HK95_MajoREV equ 1               ;MAJOR revision level
35 HK95_MinoREV equ 0               ;decimal number of revision
36 HK95_DeviceID equ Undefined_Device_ID ;no need for MS device number assignment
37 ; ==================================================================================
38
39 ;; ---------------------------------------------
40 ;; Virtual Device Declaration (Required)
41 ;; (Declares this code as virtual device driver)
42 ;; Also creates the Device Data Block
43 ;; ---------------------------------------------
44  
45 Declare_Virtual_Device HK95D,HK95_MajoREV,HK95_MinoREV,HK95_Control,HK95_DeviceID,Undefined_Init_Order
46
47 VxD_LOCKED_CODE_SEG
48 ;; --------------------------------------------
49 ;; Control Dispatch Table & Proc (Required)
50 ;; Used to dispatch supported messages sent by
51 ;; VMM -- clears carry for unsupported mssgs.
52 ;; --------------------------------------------
53 ;; Only 3 VMM messages are recognized and processed
54 ;; by this routine -- all DIOC interface messages
55 ;; translate to W32_DeviceIoControl mssgs from the VMM.
56 ;; "Control_Dispatch" precedes MSSG NUMBER, PROCEDURE
57
58 BeginProc HK95_Control
59     Control_Dispatch Sys_Dynamic_Device_Exit, HK95_Device_UNInit
60     Control_Dispatch Sys_Dynamic_Device_Init, HK95_Device_Init
61         Control_Dispatch W32_DeviceIoControl,     HK95_Device_IOctrl
62     xor eax,eax  ;;return 0 (required in some instances)
63     clc          ;;clear carry flg for GOOD indicator   
64         ret
65 EndProc HK95_Control
66
67 ;; -------------------------------------------------------------
68 ;; NOTE: "BeginProc & EndProc" are needed in conjunction with
69 ;; the above dispatch table -- below routines facilitate C fcns
70 ;; -------------------------------------------------------------
71
72 ;; =======================================================================
73 ;; Routines below are VXD interface (load, unload, process) ROUTINES
74 ;; =======================================================================
75
76 ;; --------------------------------------------
77 ;; Routine to jump to C routine for processing
78 ;; SYS_DYNAMIC_DEVICE_INIT message
79 ;; --------------------------------------------
80 BeginProc HK95_Device_Init
81     call _CHK95_Device_Init
82     ret
83 EndProc HK95_Device_Init
84
85 ;; --------------------------------------------
86 ;; Routine to jump to C routine for processing
87 ;; SYS_DYNAMIC_DEVICE_EXIT message
88 ;; --------------------------------------------
89
90 BeginProc HK95_Device_UNInit
91         call _CHK95_Device_UNInit
92         ret
93 EndProc HK95_Device_UNInit
94
95 ;; --------------------------------------------
96 ;; Routine to jump to C routine for processing
97 ;; W32_DEVICEIOCONTROL messages -- These are
98 ;; VxD requests from the application.
99 ;; At entry, esi points to the DIOC interface
100 ;; structure passed by the application
101 ;; --------------------------------------------
102
103 BeginProc HK95_Device_IOctrl
104         push esi
105         call _CHK95_Device_IOctrl
106         pop esi
107         ret
108 EndProc HK95_Device_IOctrl
109
110 ;; ======================================================
111 ;; Routines below are miscellaneous assembly interfaces
112 ;; ======================================================
113
114 VxD_LOCKED_CODE_ENDS
115
116 VxD_LOCKED_DATA_SEG
117 VxD_LOCKED_DATA_ENDS
118
119         END
120