The MASM Forum

General => The Campus => Topic started by: enzechen on July 30, 2015, 01:14:00 AM

Title: Any algorithm to only use pure win API to write async I/O like Node.js does?
Post by: enzechen on July 30, 2015, 01:14:00 AM
Could anyone describe some basic idea, e.g. API function, or suggest some book on this?

I think callback function might be one main solution. How could I introduce this type callback function into MASM programming?

Thanks a lot.
Title: Re: Any algorithm to only use pure win API to write async I/O like Node.js does?
Post by: BogdanOntanu on July 30, 2015, 03:08:17 AM
Quote from: enzechen on July 30, 2015, 01:14:00 AM
Could anyone describe some basic idea, e.g. API function, or suggest some book on this?

I think callback function might be one main solution. How could I introduce this type callback function into MASM programming?

Thanks a lot.

A callback is just a simple function (or PROC in MASM). It has to respect the signature described in MSDN and save registers as described in ABI.
Async I/O functions are also described in MSDN.

For example:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365683%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396
Title: Re: Any algorithm to only use pure win API to write async I/O like Node.js does?
Post by: Gunther on August 05, 2015, 07:09:07 PM
Quote from: Meibleke on August 05, 2015, 06:12:06 PM
I find this topic for a long time. I want to talk about this, really.

Seems to be another lousy spam bot.

Gunther
Title: Re: Any algorithm to only use pure win API to write async I/O like Node.js does?
Post by: dedndave on August 07, 2015, 08:27:06 PM
are you talking about WriteFile with an OVERLAPPED structure ?

https://msdn.microsoft.com/en-us/library/windows/desktop/aa365747%28v=vs.85%29.aspx (https://msdn.microsoft.com/en-us/library/windows/desktop/aa365747%28v=vs.85%29.aspx)

or maybe WriteFileEx ?

https://msdn.microsoft.com/en-us/library/windows/desktop/aa365748%28v=vs.85%29.aspx (https://msdn.microsoft.com/en-us/library/windows/desktop/aa365748%28v=vs.85%29.aspx)

you'll have to forgive that many of us don't know squat about java script   :lol:
that's because we can write in assembler   :biggrin: