Rev 4467 | Rev 4581 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4467 | Rev 4470 | ||
---|---|---|---|
Line 217... | Line 217... | ||
217 | 217 | ||
218 | align 4 |
218 | align 4 |
Line 219... | Line 219... | ||
219 | proc service_proc stdcall, ioctl:dword |
219 | proc service_proc stdcall, ioctl:dword |
220 | 220 | ||
Line 221... | Line 221... | ||
221 | mov edx, [ioctl] |
221 | mov edx, [ioctl] |
Line 222... | Line 222... | ||
222 | mov eax, [IOCTL.io_code] |
222 | mov eax, [edx + IOCTL.io_code] |
223 | 223 | ||
Line 224... | Line 224... | ||
224 | ;------------------------------------------------------ |
224 | ;------------------------------------------------------ |
225 | 225 | ||
226 | cmp eax, 0 ;SRV_GETVERSION |
226 | cmp eax, 0 ;SRV_GETVERSION |
227 | jne @F |
227 | jne @F |
Line 228... | Line 228... | ||
228 | 228 | ||
229 | cmp [IOCTL.out_size], 4 |
229 | cmp [edx + IOCTL.out_size], 4 |
Line 230... | Line 230... | ||
230 | jb .fail |
230 | jb .fail |
231 | mov eax, [IOCTL.output] |
231 | mov eax, [edx + IOCTL.output] |
232 | mov [eax], dword API_VERSION |
232 | mov [eax], dword API_VERSION |
233 | 233 | ||
Line 234... | Line 234... | ||
234 | xor eax, eax |
234 | xor eax, eax |
235 | ret |
235 | ret |
Line 236... | Line 236... | ||
236 | 236 | ||
237 | ;------------------------------------------------------ |
237 | ;------------------------------------------------------ |
238 | @@: |
238 | @@: |
Line 239... | Line 239... | ||
239 | cmp eax, 1 ;SRV_HOOK |
239 | cmp eax, 1 ;SRV_HOOK |
Line 240... | Line 240... | ||
240 | jne .fail |
240 | jne .fail |
241 | 241 | ||
242 | cmp [IOCTL.inp_size], 3 ; Data input must be at least 3 bytes |
242 | cmp [edx + IOCTL.inp_size], 3 ; Data input must be at least 3 bytes |
243 | jb .fail |
243 | jb .fail |
Line 244... | Line 244... | ||
244 | 244 | ||
245 | mov eax, [IOCTL.input] |
245 | mov eax, [edx + IOCTL.input] |
246 | cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given |
246 | cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given |
247 | jne .fail ; other types arent supported for this card yet |
247 | jne .fail ; other types arent supported for this card yet |
248 | 248 | ||
249 | ; check if the device is already listed |
249 | ; check if the device is already listed |
Line 280... | Line 280... | ||
280 | mov [device.unload], unload |
280 | mov [device.unload], unload |
281 | mov [device.name], my_service |
281 | mov [device.name], my_service |
Line 282... | Line 282... | ||
282 | 282 | ||
Line 283... | Line 283... | ||
283 | ; save the pci bus and device numbers |
283 | ; save the pci bus and device numbers |
284 | 284 | ||
285 | mov eax, [IOCTL.input] |
285 | mov eax, [edx + IOCTL.input] |
286 | movzx ecx, byte[eax+1] |
286 | movzx ecx, byte[eax+1] |
287 | mov [device.pci_bus], ecx |
287 | mov [device.pci_bus], ecx |