#include <winmem32.h> |
WORD Global32Realloc(wSelector, dwNewSize, wFlags) | |||||
WORD wSelector; | /* selector of object to reallocate | */ | |||
DWORD dwNewSize; | /* new size of object | */ | |||
WORD wFlags; | /* reserved, must be zero | */ |
The Global32Realloc function changes the size of a 32-bit memory object previously allocated by the Global32Alloc function.
wSelector
Specifies the selector of the object to be changed. This must be the selector returned by a previous call to the Global32Alloc function.
dwNewSize
Specifies the new size, in bytes, of the object. This value must be greater than zero and less than or equal to the size specified by the dwMaxSize parameter of the Global32Alloc function call that created the object.
wFlags
Reserved; must be zero.
The return value is zero if the function is successful. Otherwise, it is an error value, which can be one of the following:
WM32_Insufficient_Mem
WM32_Insufficient_Sels
WM32_Invalid_Arg
WM32_Invalid_Flags
WM32_Invalid_Func
If this function fails, the previous state of the object is unchanged. If the function succeeds, it updates the state of the object and the state of all aliases to the object created by the 32-bit memory application programming interface (API) functions. For this reason, an application must call the the Global32Realloc function to change the size of the object. Using other Windows functions to manipulate the object results in corrupted aliases.
This function does not change the selector specified by the wSelector parameter. If this function succeeds, the new valid range of offsets for the selector is zero through (but not including) dwNewSize.
The system determines the appropriate granularity of the object. As a result, the size of the object (and the selector size limit) may be greater than the requested size by up to 4095 bytes (4K minus 1).