The MASM Forum

Specialised Projects => Compiler Based Assembler => Assembler With Microsoft Visual C => Topic started by: TouEnMasm on August 11, 2014, 02:32:03 AM

Title: c to asm ,HTTP critical section
Post by: TouEnMasm on August 11, 2014, 02:32:03 AM
Hello,
I try to translate a c code using HTTP with a critical section.The connection is asynchronous.
I have done the translate in ansi asm,there is no bug but it don't work as expected.
when :

WaitForRequestCompletion,dwContext,Configuration.UserTimeout

is called ,there is no writing in the output file.
If someone could help , I post the the c and asm source code(ANSI not UNICODE).

Corrected,added zip with macros

Title: Re: c to asm ,HTTP critical section
Post by: TouEnMasm on August 11, 2014, 05:04:58 AM

Found ,in the callback function,change all the INTERNET_STATUS_REQUEST_COMPLETE by this one

.elseif eax == INTERNET_STATUS_REQUEST_COMPLETE
;The lpvStatusInformation parameter contains the address of an
;INTERNET_ASYNC_RESULT structure
mov eax,lpvStatusInformation
mov edx,[eax].INTERNET_ASYNC_RESULT.dwError
push edx
.if edx != ERROR_SUCCESS
invoke wsprintf,addr phrase,TXT("Status: INTERNET_STATUS_REQUEST_COMPLETE dwResult!= ERROR_SUCCESS ",13,10),0
.else
invoke wsprintf,addr phrase,TXT( "Status: Request complete",13,10)
.endif
invoke WriteToBlocHeap,addr messages,addr phrase,0
pop edx
invoke ProcessRequest,context,edx
Title: Re: c to asm ,HTTP critical section
Post by: TouEnMasm on August 12, 2014, 02:15:06 AM

This one show a dialog box where the more important features can be modified.
I have made it to avoid publicity,If you have ideas on how to search in the file created put them here.