Would someone be kind enough to translate this sentence for someone blissfully unaware of unmanaged code and the intricacies of memory management?
Storage for this buffer is allocated from the shared heap for a 64 KB process. The maximum buffer size will depend on the use of the heap.
It is presented on several dozen MSDN pages, for example. WriteConsole , but I can not find any API that would calculate the maximum size, such an array is allowed before bloating, empirically I can say this somewhere between 61 and 62.5 KB (by calling 64, 63, 62, etc. d. until it stops the installation DllImport SetLastError). Is there something like GetTotalHeapSize(if it is not const 64KB regardless of the version of Windows, platform architecture, default values, etc.) And is something like GetCurrentHeapInUseavailable? How to get the maximum bytes I can pass to this and other P / Invoked methods?
source
share