"James Hawkins" truiken@gmail.com wrote:
This version compares the pointer value to 64000 instead of using a try/catch block, as suggested by Alexandre.
if(pintern->Magic==MAGIC_GLOBAL_USED)
if(pintern > (PGLOBAL32_INTERN)64000 && pintern->Magic==MAGIC_GLOBAL_USED) { if (!pintern->Pointer) /* handle case of GlobalAlloc( ??,0) */
It should be either 65535 (0xffff), or a test for HIWORD(pintern) being 0. Also the cast should be to (char *) on both sides rather than (PGLOBAL32_INTERN).
On 9/20/07, Dmitry Timoshkov dmitry@codeweavers.com wrote:
"James Hawkins" truiken@gmail.com wrote:
This version compares the pointer value to 64000 instead of using a try/catch block, as suggested by Alexandre.
if(pintern->Magic==MAGIC_GLOBAL_USED)
if(pintern > (PGLOBAL32_INTERN)64000 && pintern->Magic==MAGIC_GLOBAL_USED) { if (!pintern->Pointer) /* handle case of GlobalAlloc( ??,0) */
It should be either 65535 (0xffff), or a test for HIWORD(pintern) being 0. Also the cast should be to (char *) on both sides rather than (PGLOBAL32_INTERN).
I'll go with HIWORD(pintern), thanks for the suggestion. I knew it wasn't quite right :)