I asked how to dynamically allocate memory in MASM here but I got 2 more questions.
How can I allocate memory for bytes?
.data
tab DB ?
result DB ?
.code
invoke GetProcessHeap
; error here
mov tab, eax ; I cannot do this because of wrong sizes, AL and AH are equal 0
INVOKE HeapAlloc, tab, 0, <size>
invoke GetProcessHeap
mov result, eax ; same here
INVOKE HeapAlloc, result, 0, <size>
Second question, can I use this method of allocating memory in multithreading application or should I use GlobalAlloc?