Rev 4467 | Rev 4803 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4467 | Rev 4470 | ||
---|---|---|---|
Line 404... | Line 404... | ||
404 | 404 | ||
405 | align 4 |
405 | align 4 |
Line 406... | Line 406... | ||
406 | proc service_proc stdcall, ioctl:dword |
406 | proc service_proc stdcall, ioctl:dword |
407 | 407 | ||
Line 408... | Line 408... | ||
408 | mov edx, [ioctl] |
408 | mov edx, [ioctl] |
Line 409... | Line 409... | ||
409 | mov eax, [IOCTL.io_code] |
409 | mov eax, [edx + IOCTL.io_code] |
410 | 410 | ||
Line 411... | Line 411... | ||
411 | ;------------------------------------------------------ |
411 | ;------------------------------------------------------ |
412 | 412 | ||
413 | cmp eax, 0 ;SRV_GETVERSION |
413 | cmp eax, 0 ;SRV_GETVERSION |
414 | jne @F |
414 | jne @F |
Line 415... | Line 415... | ||
415 | 415 | ||
416 | cmp [IOCTL.out_size], 4 |
416 | cmp [edx + IOCTL.out_size], 4 |
Line 417... | Line 417... | ||
417 | jb .fail |
417 | jb .fail |
418 | mov eax, [IOCTL.output] |
418 | mov eax, [edx + IOCTL.output] |
419 | mov [eax], dword API_VERSION |
419 | mov [eax], dword API_VERSION |
420 | 420 | ||
Line 421... | Line 421... | ||
421 | xor eax, eax |
421 | xor eax, eax |
422 | ret |
422 | ret |
Line 423... | Line 423... | ||
423 | 423 | ||
424 | ;------------------------------------------------------ |
424 | ;------------------------------------------------------ |
425 | @@: |
425 | @@: |
Line 426... | Line 426... | ||
426 | cmp eax, 1 ;SRV_HOOK |
426 | cmp eax, 1 ;SRV_HOOK |
Line 427... | Line 427... | ||
427 | jne .fail |
427 | jne .fail |
428 | 428 | ||
429 | cmp [IOCTL.inp_size], 3 ; Data input must be at least 3 bytes |
429 | cmp [edx + IOCTL.inp_size], 3 ; Data input must be at least 3 bytes |
430 | jb .fail |
430 | jb .fail |
Line 431... | Line 431... | ||
431 | 431 | ||
432 | mov eax, [IOCTL.input] |
432 | mov eax, [edx + IOCTL.input] |
433 | cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given |
433 | cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given |
434 | jne .fail ; other types arent supported for this card yet |
434 | jne .fail ; other types arent supported for this card yet |
435 | 435 | ||
436 | ; check if the device is already listed |
436 | ; check if the device is already listed |
Line 467... | Line 467... | ||
467 | mov [device.unload], unload |
467 | mov [device.unload], unload |
468 | mov [device.name], my_service |
468 | mov [device.name], my_service |
Line 469... | Line 469... | ||
469 | 469 | ||
Line 470... | Line 470... | ||
470 | ; save the pci bus and device numbers |
470 | ; save the pci bus and device numbers |
471 | 471 | ||
472 | mov eax, [IOCTL.input] |
472 | mov eax, [edx + IOCTL.input] |
473 | movzx ecx, byte[eax+1] |
473 | movzx ecx, byte[eax+1] |
474 | mov [device.pci_bus], ecx |
474 | mov [device.pci_bus], ecx |