Hello all,
IoCompleteRequest is a most frequently used routine in driver
development. So I wanted to dig its implementation by unassembling
with WinDBG. The unassembled code is as follows. The target machine is
running on Windows XP + SP2.
================== Code Begin ==================
kd> u IoCompleteRequest
nt!IoCompleteRequest:
8052efc1 8bff mov edi,edi
8052efc3 55 push ebp
8052efc4 8bec mov ebp,esp
8052efc6 8a550c mov dl,[ebp+0xc]
8052efc9 8b4d08 mov ecx,[ebp+0x8]
8052efcc ff15043e5580 call dword ptr [nt!pIofCompleteRequest
(80553e04)]
8052efd2 5d pop ebp
8052efd3 c20800 ret 0x8
kd> u 80553e04
nt!pIofCompleteRequest:
80553e04 95 xchg eax,ebp
80553e05 51 push ecx
80553e06 4e dec esi
80553e07 80f89c cmp al,0x9c
80553e0a 4e dec esi
80553e0b 80389c cmp byte ptr [eax],0x9c
80553e0e 4e dec esi
80553e0f 800000 add byte ptr [eax],0x0
kd> u
nt!IopPostPadding+0x2:
80553e12 0000 add [eax],al
80553e14 0000 add [eax],al
80553e16 0000 add [eax],al
80553e18 0000 add [eax],al
80553e1a 0000 add [eax],al
80553e1c 0000 add [eax],al
80553e1e 0000 add [eax],al
80553e20 0000 add [eax],al
================== Code End ==================
As shown above, IoCompleteRequest is implemented by
pIofCompleteRequest located at 0x80553e04. However, the assembled code
seems not to be a normal routine. Because it doesn't have the ret
instruction.
What's the cause?