Discussion of article "Using WinInet in MQL5. Part 2: POST Requests and Files" - page 2 12 New comment Juer 2018.09.16 10:07 #11 In the tester, it crashes here: if(!https_flag) hRequest=HttpOpenRequestW(hConnect, req.stVerb, req.stObject, Vers, nill, 0, INTERNET_FLAG_KEEP_CONNECTION|INTERNET_FLAG_RELOAD|INTERNET_FLAG_PRAGMA_NOCACHE, 0); else hRequest=HttpOpenRequestW(hConnect, req.stVerb, req.stObject, Vers, nill, 0, INTERNET_FLAG_KEEP_CONNECTION|INTERNET_FLAG_RELOAD|INTERNET_FLAG_PRAGMA_NOCACHE|INTERNET_FLAG_SECURE, 0); Error: 2018.09.16 11:11:23.242 2017.01.01 00:00:00 Access violation at 0x00007FFF798662F9 read to 0x0000009500000000 in 'wininet.dll' 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF798660E0 48895C2418 mov [rsp+0x18], rbx 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF798660E5 48894C2408 mov [rsp+0x8], rcx 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF798660EA 55 push rbp 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF798660EB 56 push rsi 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF798660EC 57 push rdi 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF798660ED 4154 push r12 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF798660EF 4155 push r13 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF798660F1 4156 push r14 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF798660F3 4157 push r15 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF798660F5 488D6C24B0 lea rbp, [rsp-0x50] 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF798660FA 4881EC50010000 sub rsp, 0x150 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF79866101 4D8BF9 mov r15, r9 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF79866104 4D8BF0 mov r14, r8 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF79866107 488BFA mov rdi, rdx 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF7986610A F6056B40380002 test byte [rip+0x38406b], 0x2 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF79866111 0F85DF920700 jnz dword 0x7fff798df3f6 2018.09.16 11:11:23.248 2017.01.01 00:00:00 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF79866117 33C9 xor ecx, ecx 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF79866119 33D2 xor edx, edx 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF7986611B 448D4158 lea r8d, [rcx+0x58] 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF7986611F 894C2468 mov [rsp+0x68], ecx 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF79866123 48894C2450 mov [rsp+0x50], rcx 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF79866128 48894D80 mov [rbp-0x80], rcx 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF7986612C 48894DB8 mov [rbp-0x48], rcx 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF79866130 48894C2470 mov [rsp+0x70], rcx 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF79866135 48894DD0 mov [rbp-0x30], rcx 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF79866139 48894DA8 mov [rbp-0x58], rcx 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF7986613D 448BE9 mov r13d, ecx 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF79866140 48894C2460 mov [rsp+0x60], rcx 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF79866145 66898D98000000 mov [rbp+0x98], cx 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF7986614C 894C2458 mov [rsp+0x58], ecx 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF79866150 48894D90 mov [rbp-0x70], rcx 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF79866154 894C245C mov [rsp+0x5c], ecx 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF79866158 48894D88 mov [rbp-0x78], rcx 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF7986615C 48894D98 mov [rbp-0x68], rcx 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF79866160 488D4DF0 lea rcx, [rbp-0x10] 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF79866164 E8F7B3F8FF call 0x7fff797f1560 ; Ñ; (wininet.dll) 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF79866169 FF1511D23A00 call qword near [rip+0x3ad211] 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF7986616F 8B0D33313800 mov ecx, [rip+0x383133] 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF79866175 8BF0 mov esi, eax 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF79866177 FF1553D33A00 call qword near [rip+0x3ad353] 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF7986617D 488BD8 mov rbx, rax 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF79866180 4885C0 test rax, rax 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF79866183 0F84FAE5FBFF jz dword 0x7fff79824783 2018.09.16 11:11:23.248 2017.01.01 00:00:00 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF79866189 8BCE mov ecx, esi 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF7986618B FF15B7D23A00 call qword near [rip+0x3ad2b7] 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF79866191 33F6 xor esi, esi 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF79866193 4885DB test rbx, rbx 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF79866196 0F84E7920700 jz dword 0x7fff798df483 2018.09.16 11:11:23.248 2017.01.01 00:00:00 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF7986619C 488B4B30 mov rcx, [rbx+0x30] 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF798661A0 488B4328 mov rax, [rbx+0x28] 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF798661A4 48897328 mov [rbx+0x28], rsi 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF798661A8 48894DB0 mov [rbp-0x50], rcx 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF798661AC 488B4B38 mov rcx, [rbx+0x38] 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF798661B0 48897330 mov [rbx+0x30], rsi 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF798661B4 48894DA0 mov [rbp-0x60], rcx 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF798661B8 8B4B40 mov ecx, [rbx+0x40] 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF798661BB 48897338 mov [rbx+0x38], rsi 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF798661BF 894C2478 mov [rsp+0x78], ecx 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF798661C3 488B4B50 mov rcx, [rbx+0x50] 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF798661C7 897340 mov [rbx+0x40], esi 2018.09.16 11:11:23.248 2017.01.01 00:00:00 00007FFF798661CA 48894DC8 mov [rbp-0x38], rcx 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798661CE 48897350 mov [rbx+0x50], rsi 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798661D2 488945E0 mov [rbp-0x20], rax 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798661D6 BAFFFFFFFF mov edx, 0xffffffff 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798661DB 4885FF test rdi, rdi 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798661DE 0F84AA000000 jz dword 0x7fff7986628e 2018.09.16 11:11:23.249 2017.01.01 00:00:00 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798661E4 4883C8FF or rax, 0xff 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798661E8 0F1F0400 nop [rax+rax] 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798661EC 48FFC0 inc rax 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798661EF 6644392C47 cmp [rdi+rax*2], r13W 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798661F4 75F6 jnz 0x7fff798661ec 2018.09.16 11:11:23.249 2017.01.01 00:00:00 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798661F6 4C8BE6 mov r12, rsi 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798661F9 483BC2 cmp rax, rdx 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798661FC 0F8730930700 ja dword 0x7fff798df532 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF79866202 8D4801 lea ecx, [rax+0x1] 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF79866205 3BC8 cmp ecx, eax 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF79866207 0F8225930700 jb dword 0x7fff798df532 2018.09.16 11:11:23.249 2017.01.01 00:00:00 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF7986620D 8BD9 mov ebx, ecx 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF7986620F 4803DB add rbx, rbx 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF79866212 483BDA cmp rbx, rdx 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF79866215 0F8717930700 ja dword 0x7fff798df532 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF7986621B 488B0DCE323800 mov rcx, [rip+0x3832ce] 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF79866222 448BC3 mov r8d, ebx 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF79866225 33D2 xor edx, edx 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF79866227 895DB8 mov [rbp-0x48], ebx 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF7986622A FF1530D13A00 call qword near [rip+0x3ad130] 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF79866230 4C8BE0 mov r12, rax 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF79866233 48894580 mov [rbp-0x80], rax 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF79866237 488945C0 mov [rbp-0x40], rax 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF7986623B 4885C0 test rax, rax 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF7986623E 0F84EE920700 jz dword 0x7fff798df532 2018.09.16 11:11:23.249 2017.01.01 00:00:00 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF79866244 448BCB mov r9d, ebx 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF79866247 488D442458 lea rax, [rsp+0x58] 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF7986624C 4C8BC7 mov r8, rdi 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF7986624F 4889442438 mov [rsp+0x38], rax 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF79866254 41D1E9 shr r9d, 1 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF79866257 4889742430 mov [rsp+0x30], rsi 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF7986625C BA00040000 mov edx, 0x400 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF79866261 33C9 xor ecx, ecx 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF79866263 41FFC9 dec r9d 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF79866266 895C2428 mov [rsp+0x28], ebx 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF7986626A 4C89642420 mov [rsp+0x20], r12 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF7986626F FF1503D13A00 call qword near [rip+0x3ad103] 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF79866275 8945BC mov [rbp-0x44], eax 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF79866278 8BC0 mov eax, eax 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF7986627A 46882C20 mov [rax+r12], r13b 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF7986627E 44396C2458 cmp [rsp+0x58], r13d 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF79866283 0F8522920700 jnz dword 0x7fff798df4ab 2018.09.16 11:11:23.249 2017.01.01 00:00:00 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF79866289 BAFFFFFFFF mov edx, 0xffffffff 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF7986628E 4D85F6 test r14, r14 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF79866291 7434 jz 0x7fff798662c7 2018.09.16 11:11:23.249 2017.01.01 00:00:00 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF79866293 488D44245C lea rax, [rsp+0x5c] 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF79866298 4533C9 xor r9d, r9d 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF7986629B 41B8E9FD0000 mov r8d, 0xfde9 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798662A1 4889442428 mov [rsp+0x28], rax 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798662A6 488D4590 lea rax, [rbp-0x70] 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798662AA 498BCE mov rcx, r14 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798662AD 4889442420 mov [rsp+0x20], rax 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798662B2 E8D5E0F9FF call 0x7fff7980438c ; HttpEndRequestW (wininet.dll) 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798662B7 8BF0 mov esi, eax 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798662B9 89442468 mov [rsp+0x68], eax 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798662BD 85C0 test eax, eax 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798662BF 0F858CFD0400 jnz dword 0x7fff798b6051 2018.09.16 11:11:23.249 2017.01.01 00:00:00 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798662C5 33F6 xor esi, esi 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798662C7 4D85FF test r15, r15 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798662CA 0F856F920700 jnz dword 0x7fff798df53f 2018.09.16 11:11:23.249 2017.01.01 00:00:00 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798662D0 41BEFFFFFFFF mov r14d, 0xffffffff 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798662D6 488B85B0000000 mov rax, [rbp+0xb0] 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798662DD 4885C0 test rax, rax 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798662E0 0F858C930700 jnz dword 0x7fff798df672 2018.09.16 11:11:23.249 2017.01.01 00:00:00 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798662E6 4C8BBDB8000000 mov r15, [rbp+0xb8] 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798662ED 4D85FF test r15, r15 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798662F0 0F8403010000 jz dword 0x7fff798663f9 2018.09.16 11:11:23.249 2017.01.01 00:00:00 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798662F6 0FB7FE movzx edi, si 2018.09.16 11:11:23.249 2017.01.01 00:00:00 crash --> 00007FFF798662F9 4D392F cmp [r15], r13 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798662FC 740C jz 0x7fff7986630a 2018.09.16 11:11:23.249 2017.01.01 00:00:00 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF798662FE 66FFC7 inc di 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF79866301 0FB7C7 movzx eax, di 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF79866304 4D392CC7 cmp [r15+rax*8], r13 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF79866308 75F4 jnz 0x7fff798662fe 2018.09.16 11:11:23.249 2017.01.01 00:00:00 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00007FFF7986630A 488B0DDF313800 mov rcx, [rip+0x3831df] 2018.09.16 11:11:23.249 2017.01.01 00:00:00 2018.09.16 11:11:23.249 2017.01.01 00:00:00 00: 0x00007FFF798662F9 2018.09.16 11:11:23.249 2017.01.01 00:00:00 01: 0x000000959D50C561 2018.09.16 11:11:23.249 2017.01.01 00:00:00 02: 0x0000000000CC0010 2018.09.16 11:11:23.249 2017.01.01 00:00:00 03: 0x000000958E540000 2018.09.16 11:11:23.249 2017.01.01 00:00:00 04: 0x000000959E354970 2018.09.16 11:11:23.249 2017.01.01 00:00:00 05: 0x0000009595F2D2C0 2018.09.16 11:11:23.249 2017.01.01 00:00:00 2018.09.16 11:11:23.250 OnInit critical error On real data everything works. Juer 2018.09.16 11:06 #12 #property tester_library "wininet.dll" #property tester_library "Kernel32.dll" It seemed to help. Juer 2018.09.16 11:12 #13 Juer: It seemed to helpNo, it didn't. Juer 2018.09.16 11:21 #14 #property tester_library "wininet.dll" #property tester_library "Kernel32.dll" Dope... Testing works after compilation. When debugging in testing mode it does not work. And then it doesn't work when testing. Andrey Khatimlianskii 2018.09.16 20:16 #15 Juer: Dope... Testing works after compilation. When debugging in testing mode it does not work. And then it doesn't work just when testing.After running in debug mode ex-file remains from this mode. Apparently, only the release version will work. Yu Pang Chan 2021.03.22 11:03 #16 Thanks anyway for the great library. I finally managed to POST data through wininet, so let me also contribute something here: for access violation, 1. Changing "nill" to NULL does not help2. Changing "nill" to 0 does not helpwhat I did is actually changed the following: --- string nill = ""; +++ string nill = "\0"; and everything will be fine after that. Enjoy :) problem VPS / EA Post HTTP data - Post HTTP data - 12 New comment
In the tester, it crashes here:
Error:
On real data everything works.
It seemed to help
No, it didn't.
Dope... Testing works after compilation. When debugging in testing mode it does not work. And then it doesn't work just when testing.
After running in debug mode ex-file remains from this mode. Apparently, only the release version will work.
Thanks anyway for the great library.
I finally managed to POST data through wininet, so let me also contribute something here:
for access violation,
1. Changing "nill" to NULL does not help
2. Changing "nill" to 0 does not help
what I did is actually changed the following:
and everything will be fine after that. Enjoy :)