The MASM Forum

Members Gallery => Showcase => Topic started by: TouEnMasm on September 06, 2021, 06:09:05 PM

Title: WinHttp in syncrhonous and asynchronous mode
Post by: TouEnMasm on September 06, 2021, 06:09:05 PM
****The synchronous mode is the more easy to code but don't allow
The dowload of big files.
****The asynchronous mode wait that the server is ready to send data.
He allow the download of big files.
He need the safeseh compile option,He need to be thread safe
He need to use Critical Sections in a correct way (enter and leave
the critical sections must be in the same Number).
He need a callback to know when receive data.
The callback give many events and only some of this event allow
actions.they are:
WINHTTP_CALLBACK_STATUS_REQUEST_ERROR         Any of the above functions when an error occurs.
The asynchrounous sample give the full set of API error in text
He give also the full set of status states  of the connexion in text.
Because of the safeseh option,you need JWASM to compile it.
It's a console proc,you can use the command line with parameters url beetween " " to use it or use check.bat.
It's a demo program,the dowloaded  files need to be renamed.(.htm,.exe,;jpg ......)