我跟踪到了 0xC0000022 的产生,但还没知道具体的原因:
1: kd> kn 100
# ChildEBP RetAddr
00 90a374e0 8884b642 tcpip!WfpAleClassify+0x7c //push 0C0000022h; call tcpip!WfpReportAppErrorAsNtStatus;
01 90a3780c 88857e4d tcpip!WfpAlepAuthorizeConnect+0x866
02 90a379b8 88848655 tcpip!WfpAleAuthorizeConnect+0x308
03 90a379e8 8884730c tcpip!InetInspectConnect+0x3c
04 90a37a3c 888534b7 tcpip!TcpContinueCreateAndConnect+0x4dc
05 90a37a54 88842ae2 tcpip!TcpCreateAndConnectTcbInspectConnectRequestComplete+0xf8
06 90a37abc 88853359 tcpip!TcpCreateAndConnectTcbWorkQueueRoutine+0x4df
07 90a37b18 8e937898 tcpip!TcpCreateAndConnectTcb+0x800
08 90a37bec 8e92d504 afd!AfdSuperConnect+0x48a
09 90a37bfc 83e484bc afd!AfdDispatchDeviceControl+0x3b
0a 90a37c14 84049eee nt!IofCallDriver+0x63
0b 90a37c34 84066cd1 nt!IopSynchronousServiceTail+0x1f8
0c 90a37cd0 840694ac nt!IopXxxControlFile+0x6aa
0d 90a37d04 83e4f42a nt!NtDeviceIoControlFile+0x2a
0e 90a37d04 77db64f4 nt!KiFastCallEntry+0x12a
0f 003ae788 77db4cac ntdll!KiFastSystemCallRet
10 003ae78c 7590799f ntdll!NtDeviceIoControlFile+0xc
11 003ae824 759078bc mswsock!SockDoConnectEx+0x96
12 003ae874 7162750d mswsock!MSAFD_ConnectEx+0xbb
13 003ae950 716271ab webio!WapTcpConnectSocket+0x1ac
14 003ae968 7162701b webio!WapTcpStartConnect+0x172
15 003ae98c 7162d9dc webio!WapTcpDnsQueryCompletionRoutine+0xaa
16 003ae9c8 71626837 webio!WapTcpStartDnsQuery+0x1d6
17 003ae9ec 716266e2 webio!WaTcpConnectRequest+0x2c
18 003aea38 71626671 webio!WapHttpConnect+0x69
19 003aea58 71624105 webio!WaQueueHttpRequest+0x1c4
1a 003aea78 716240b1 webio!WapStartQueueRequest+0x2a
1b 003aea94 71624043 webio!WapGetConnectionCompletionRoutine+0xa9
1c 003aeabc 71623fae webio!WapStartGetConnection+0x115
1d 003aeae0 71623f18 webio!WapStartGetEndpoints+0xf6
1e 003aeb2c 71623db5 webio!WapAsynchronousSendHttpRequest+0x279
1f 003aeb60 71623d45 webio!WapSendHttpRequest+0x49
20 003aebb4 7167698d webio!WebSendHttpRequest+0x34
21 003aebec 716768b8 WINHTTP!WEBIO_SENDER::SendRequest+0x14e
22 003aec18 716766f0 WINHTTP!WEBIO_REQUEST::SendRequest+0x27a
23 003aec78 716763d1 WINHTTP!HTTP_USER_REQUEST::_SysSendRequest+0x40d
24 003aecbc 7167610d WINHTTP!HTTP_USER_REQUEST::_SendRequestWithDrainComplete+0x1f2
25 003aece0 71675e88 WINHTTP!HTTP_USER_REQUEST::SendRequest+0x524
26 003aedb0 001e12c3 WINHTTP!WinHttpSendRequest+0x245
27 003aff10 001e1565 MYTest!WinHttpDownLoad+0x16f
28 003aff2c 001e1578 MYTest!TEST+0x24
29 003aff38 77271174 MYTest!WinMain+0xa
2a 003aff44 77dcb3f5 kernel32!BaseThreadInitThunk+0xe
2b 003aff84 77dcb3c8 ntdll!__RtlUserThreadStart+0x70
2c 003aff9c 00000000 ntdll!_RtlUserThreadStart+0x1b
其中 tcpip!WfpAleClassify 单步执行结果如下:
tcpip!WfpAleClassify:
0008:88887640 55 push ebp
0008:88887641 8bec mov ebp,esp
0008:88887643 51 push ecx
0008:88887644 53 push ebx
0008:88887645 56 push esi
0008:88887646 33db xor ebx,ebx
0008:88887648 57 push edi
0008:88887649 8b7d08 mov edi,dword ptr [ebp+8]
0008:8888764c 895dfc mov dword ptr [ebp-4],ebx
0008:8888764f be94a58e88 mov esi,offset tcpip!`string' (888ea594)
0008:88887654 385d14 cmp byte ptr [ebp+14h],bl
0008:88887657 740b je tcpip!WfpAleClassify+0x26 (88887664)
0008:88887664 ff751c push dword ptr [ebp+1Ch]
0008:88887667 0fb707 movzx eax,word ptr [edi]
0008:8888766a 53 push ebx
0008:8888766b ff7510 push dword ptr [ebp+10h]
0008:8888766e ff750c push dword ptr [ebp+0Ch]
0008:88887671 57 push edi
0008:88887672 50 push eax
0008:88887673 e81bd30000 call tcpip!KfdClassify (88894993 //返回 false
0008:88887678 3bc3 cmp eax,ebx
0008:8888767a 7410 je tcpip!WfpAleClassify+0x4e (8888768c) //Yes
0008:8888768c 8b4d18 mov ecx,dword ptr [ebp+18h]
0008:8888768f 3bcb cmp ecx,ebx
0008:88887691 741c je tcpip!WfpAleClassify+0x71 (888876af) //No
0008:88887693 8b450c mov eax,dword ptr [ebp+0Ch]
0008:88887696 8b4064 mov eax,dword ptr [eax+64h]
0008:88887699 3bc3 cmp eax,ebx
0008:8888769b 7412 je tcpip!WfpAleClassify+0x71 (888876af) //No
0008:8888769d 385829 cmp byte ptr [eax+29h],bl
0008:888876a0 740d je tcpip!WfpAleClassify+0x71 (888876af) //Yes
0008:888876af 8b451c mov eax,dword ptr [ebp+1Ch]
0008:888876b2 813801100000 cmp dword ptr [eax],1001h
0008:888876b8 7540 jne tcpip!WfpAleClassify+0xbc (888876fa) //No
0008:888876ba 6a01 push 1
0008:888876bc 53 push ebx
0008:888876bd 68220000c0 push 0C0000022h
0008:888876c2 56 push esi
0008:888876c3 53 push ebx
0008:888876c4 e805d2ffff call tcpip!WfpReportAppErrorAsNtStatus (888848ce)
下一步将对比在 桌面用户-Session 1 环境下运行时的过程有什么不同,不知道能不能找到原因;