An important difference between them is corresponding Free function releasing allocated memory: GlobalFree, LocalFree, and HeapFree. In most cases you have to release allocated buffer as soon as you don't need it, to prevent memory leak.

Some functions require global memory objects only. For example, an address of a buffer allocated in memory passed to the SetClipboardData function must be a global address. Otherwise Microsoft recommends using heap functions as faster ones and with more features available.

Here is another example. Notice that now GetClipCursor function is declared in a different way. The parameter is now passed as a value. This is an address of allocated memory block. This address is not going to be modified by the function. The GetClipCursor function will write some data at this address instead. Your task is providing sufficient amount of memory.