You are not logged in.
Pages: 1
Hi ab, whenever I need ideas on how to do something I always grep your mormot2 source. Today I was wanting different ideas on using the ReadFile api and I found how you used it in mormot.core.os.windows.inc in the RunCommandWin function. However, I'm confused on how the TSynTempBuffer var is being used with ReadFile.
var tmp: TSynTempBuffer;
Win32Check(ReadFile(rd, tmp, pending, n, nil));
I didn't see a custom ReadFile function in your code so should that be tmp.buf which is how it's used in other lines or am I not seeing something correctly?
Thanks for all the code you've coded!
Offline
Here TSynTempBuffer is used as a 4KB raw buffer on stack.
If you look at the code, its members like buf or len are just not used.
I understand it may be confusing.
I have made a whole code review to use TBuffer4K instead - which seems more explicit:
https://github.com/synopse/mORMot2/commit/a0126f0da
Offline
Oh that's neat, never seen that done before and I had to find out how it worked. Thanks for your reply.
Offline
Pages: 1