Rev 4467 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4467 | Rev 4470 | ||
---|---|---|---|
Line 77... | Line 77... | ||
77 | cmp [state], 1 |
77 | cmp [state], 1 |
78 | jne .exit |
78 | jne .exit |
Line 79... | Line 79... | ||
79 | 79 | ||
Line 80... | Line 80... | ||
80 | .entry: |
80 | .entry: |
81 | 81 | ||
82 | DEBUGF 2,"Loading %s driver\n", my_service |
82 | DEBUGF 2,"Loading driver\n" |
Line 83... | Line 83... | ||
83 | stdcall RegService, my_service, service_proc |
83 | stdcall RegService, my_service, service_proc |
84 | ret |
84 | ret |
Line 102... | Line 102... | ||
102 | 102 | ||
103 | align 4 |
103 | align 4 |
Line 104... | Line 104... | ||
104 | proc service_proc stdcall, ioctl:dword |
104 | proc service_proc stdcall, ioctl:dword |
105 | 105 | ||
Line 106... | Line 106... | ||
106 | mov edx, [ioctl] |
106 | mov edx, [ioctl] |
Line 107... | Line 107... | ||
107 | mov eax, [IOCTL.io_code] |
107 | mov eax, [edx + IOCTL.io_code] |
108 | 108 | ||
Line 109... | Line 109... | ||
109 | ;------------------------------------------------------ |
109 | ;------------------------------------------------------ |
110 | 110 | ||
111 | cmp eax, 0 ;SRV_GETVERSION |
111 | cmp eax, 0 ;SRV_GETVERSION |
112 | jne @F |
112 | jne @F |
Line 113... | Line 113... | ||
113 | 113 | ||
114 | cmp [IOCTL.out_size], 4 |
114 | cmp [edx + IOCTL.out_size], 4 |
Line 115... | Line 115... | ||
115 | jb .fail |
115 | jb .fail |
116 | mov eax, [IOCTL.output] |
116 | mov eax, [edx + IOCTL.output] |
117 | mov [eax], dword API_VERSION |
117 | mov [eax], dword API_VERSION |
118 | 118 | ||
Line 119... | Line 119... | ||
119 | xor eax, eax |
119 | xor eax, eax |
120 | ret |
120 | ret |
Line 121... | Line 121... | ||
121 | 121 | ||
122 | ;------------------------------------------------------ |
122 | ;------------------------------------------------------ |
123 | @@: |
123 | @@: |
Line 124... | Line 124... | ||
124 | cmp eax, 1 ;SRV_HOOK |
124 | cmp eax, 1 ;SRV_HOOK |
Line 125... | Line 125... | ||
125 | jne .fail |
125 | jne .fail |
126 | 126 | ||
127 | cmp [IOCTL.inp_size], 3 ; Data input must be at least 3 bytes |
127 | cmp [edx + IOCTL.inp_size], 3 ; Data input must be at least 3 bytes |
128 | jb .fail |
128 | jb .fail |
Line 129... | Line 129... | ||
129 | 129 | ||
130 | mov eax, [IOCTL.input] |
130 | mov eax, [edx + IOCTL.input] |
131 | cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given |
131 | cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given |
132 | jne .fail ; other types arent supported for this card yet |
132 | jne .fail ; other types arent supported for this card yet |
133 | 133 | ||
134 | ; check if the device is already listed |
134 | ; check if the device is already listed |
Line 165... | Line 165... | ||
165 | mov [device.unload], unload |
165 | mov [device.unload], unload |
166 | mov [device.name], my_service |
166 | mov [device.name], my_service |
Line 167... | Line 167... | ||
167 | 167 | ||
Line 168... | Line 168... | ||
168 | ; save the pci bus and device numbers |
168 | ; save the pci bus and device numbers |
169 | 169 | ||
170 | mov eax, [IOCTL.input] |
170 | mov eax, [edx + IOCTL.input] |
171 | movzx ecx, byte [eax+1] |
171 | movzx ecx, byte [eax+1] |
172 | mov [device.pci_bus], ecx |
172 | mov [device.pci_bus], ecx |