Res
If GlobalReAlloc reallocates a movable object//可移动, the return value is a handle to the memory object. To convert the handle to a pointer, use the GlobalLock function. If GlobalReAlloc reallocates a fixed object//固定, the value of the handle returned is the address of the first byte of the memory block. To access the memory, a process can simply cast the return value to a pointer. If GlobalReAlloc fails, the original memory is not freed, and the original handle and pointer are still valid.我认为GlobalLock(hdibmp)返回的指针仍可访问
If GlobalReAlloc reallocates a movable object//可移动, the return value is a handle to the memory object. To convert the handle to a pointer, use the GlobalLock function. If GlobalReAlloc reallocates a fixed object//固定, the value of the handle returned is the address of the first byte of the memory block. To access the memory, a process can simply cast the return value to a pointer. If GlobalReAlloc fails, the original memory is not freed, and the original handle and pointer are still valid.我认为GlobalLock(hdibmp)返回的指针仍可访问
但如果我再次用 GlobalReAlloc 分配失败,我如何得释放先前分配的内存块
GlobalReAlloc 已经返回了 Null
我不知道怎么知道开始时分配的地址?
楼上的意思是说
GlobalLock(指针)可以得到先前的内存指针?