Hello, please tell me, in many (at least those I have encountered) string- winapi 'functions, should I pass a pointer to a buffer, the buffer must be a pre-allocated heap (Heap)? Can I send a pointer to a pre-reserved byte array, for example?

  • 6
    Of course, you can use any memory. So select in any segment, even in the stack - Mike

1 answer 1

If only this memory was correct while working with it (and, of course, it is available for writing-reading :)).

For example, when allocating memory in a stack, you should not forget that it will be correct only until the end of the function call.

And so - that highlight, it is good :)