Rev 4467 | Rev 4532 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4467 | Rev 4470 | ||
---|---|---|---|
Line 394... | Line 394... | ||
394 | 394 | ||
395 | align 4 |
395 | align 4 |
Line 396... | Line 396... | ||
396 | proc service_proc stdcall, ioctl:dword |
396 | proc service_proc stdcall, ioctl:dword |
397 | 397 | ||
Line 398... | Line 398... | ||
398 | mov edx, [ioctl] |
398 | mov edx, [ioctl] |
Line 399... | Line 399... | ||
399 | mov eax, [IOCTL.io_code] |
399 | mov eax, [edx + IOCTL.io_code] |
400 | 400 | ||
Line 401... | Line 401... | ||
401 | ;------------------------------------------------------ |
401 | ;------------------------------------------------------ |
402 | 402 | ||
403 | cmp eax, 0 ;SRV_GETVERSION |
403 | cmp eax, 0 ;SRV_GETVERSION |
404 | jne @F |
404 | jne @F |
Line 405... | Line 405... | ||
405 | 405 | ||
406 | cmp [IOCTL.out_size], 4 |
406 | cmp [edx + IOCTL.out_size], 4 |
Line 407... | Line 407... | ||
407 | jb .fail |
407 | jb .fail |
408 | mov eax, [IOCTL.output] |
408 | mov eax, [edx + IOCTL.output] |
409 | mov [eax], dword API_VERSION |
409 | mov [eax], dword API_VERSION |
410 | 410 | ||
Line 411... | Line 411... | ||
411 | xor eax, eax |
411 | xor eax, eax |
412 | ret |
412 | ret |
Line 413... | Line 413... | ||
413 | 413 | ||
414 | ;------------------------------------------------------ |
414 | ;------------------------------------------------------ |
415 | @@: |
415 | @@: |
Line 416... | Line 416... | ||
416 | cmp eax, 1 ;SRV_HOOK |
416 | cmp eax, 1 ;SRV_HOOK |
Line 417... | Line 417... | ||
417 | jne .fail |
417 | jne .fail |
418 | 418 | ||
419 | cmp [IOCTL.inp_size], 3 ; Data input must be at least 3 bytes |
419 | cmp [edx + IOCTL.inp_size], 3 ; Data input must be at least 3 bytes |
Line 420... | Line 420... | ||
420 | jb .fail |
420 | jb .fail |
421 | 421 | ||
422 | mov eax, [IOCTL.input] |
422 | mov eax, [edx + IOCTL.input] |
423 | cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given |
423 | cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given |
424 | jne .fail ; other types arent supported for this card yet |
424 | jne .fail ; other types arent supported for this card yet |
425 | 425 | ||
426 | ; check if the device is already listed |
426 | ; check if the device is already listed |
Line 457... | Line 457... | ||
457 | mov [device.unload], unload |
457 | mov [device.unload], unload |
458 | mov [device.name], my_service |
458 | mov [device.name], my_service |
Line 459... | Line 459... | ||
459 | 459 | ||
Line 460... | Line 460... | ||
460 | ; save the pci bus and device numbers |
460 | ; save the pci bus and device numbers |
461 | 461 | ||
462 | mov eax, [IOCTL.input] |
462 | mov eax, [edx + IOCTL.input] |
463 | movzx ecx, byte[eax+1] |
463 | movzx ecx, byte[eax+1] |
464 | mov [device.pci_bus], ecx |
464 | mov [device.pci_bus], ecx |