The MASM Forum

General => The Campus => Topic started by: bsdsource on January 30, 2014, 07:00:04 AM

Title: INTERNET_ASYNC_RESULT struture issue
Post by: bsdsource on January 30, 2014, 07:00:04 AM
I have no clue on how to access a INTERNET_ASYNC_RESULT structure from within a wininet callback function.

The following link provides a prototype for an application-defined status callback function:
InternetStatusCallback callback function (//http://)

The above link indicates when an asynchronous operation has been completed, the lpvStatusInformation parameter contains the address of an INTERNET_ASYNC_RESULT structure. It seems that lpvStatusInformation is a LPVOID which is just a DWORD if I'm not mistaken, but how would I access the INTERNET_ASYNC_RESULT structure?
Title: Re: INTERNET_ASYNC_RESULT struture issue
Post by: dedndave on January 30, 2014, 07:28:21 AM
it's in C, but it should help...

http://veridium.net/programming-tutorials/http-client-async-wininet/ (http://veridium.net/programming-tutorials/http-client-async-wininet/)
Title: Re: INTERNET_ASYNC_RESULT struture issue
Post by: qWord on January 30, 2014, 07:30:49 AM
The pointer-type depends on the notification.
IFNDEF DWORD_PTR
DWORD_PTR typedef DWORD ; QWORD for x86-64
ENDIF
InternetStatusCallback proc hInternet:HANDLE,dwContext:DWORD_PTR,dwInternetStatus:DWORD,lpvStatusInformation:LPVOID,dwStatusInformationLength:DWORD
.if dwInternetStatus == INTERNET_STATUS_REQUEST_COMPLETE
mov edx,lpvStatusInformation
mov eax,[edx].INTERNET_ASYNC_RESULT.dwResult
;...
.endif
ret
InternetStatusCallback endp
Title: Re: INTERNET_ASYNC_RESULT struture issue
Post by: bsdsource on January 30, 2014, 09:49:16 AM
qWord, that's exactly what I was looking for. Thanks. :t