Replaced the GET/PUT_UA macros by memcpy. Fixed a few big-endian
issues.
diff --git a/windows/class.c b/windows/class.c
index d30b2bc..4a2df8e 100644
--- a/windows/class.c
+++ b/windows/class.c
@@ -795,7 +795,7 @@
if (!(class = get_class_ptr( hwnd, FALSE ))) return 0;
if (offset <= class->cbClsExtra - sizeof(WORD))
- retvalue = GET_WORD((char *)(class + 1) + offset);
+ memcpy( &retvalue, (char *)(class + 1) + offset, sizeof(retvalue) );
else
SetLastError( ERROR_INVALID_INDEX );
release_class_ptr( class );
@@ -847,7 +847,7 @@
if (offset >= 0)
{
if (offset <= class->cbClsExtra - sizeof(LONG))
- retvalue = GET_DWORD((char *)(class + 1) + offset);
+ memcpy( &retvalue, (char *)(class + 1) + offset, sizeof(retvalue) );
else
SetLastError( ERROR_INVALID_INDEX );
release_class_ptr( class );
@@ -940,8 +940,8 @@
if (offset <= class->cbClsExtra - sizeof(WORD))
{
void *ptr = (char *)(class + 1) + offset;
- retval = GET_WORD(ptr);
- PUT_WORD( ptr, newval );
+ memcpy( &retval, ptr, sizeof(retval) );
+ memcpy( ptr, &newval, sizeof(newval) );
}
else SetLastError( ERROR_INVALID_INDEX );
@@ -994,8 +994,8 @@
if (offset <= class->cbClsExtra - sizeof(LONG))
{
void *ptr = (char *)(class + 1) + offset;
- retval = GET_DWORD(ptr);
- PUT_DWORD( ptr, newval );
+ memcpy( &retval, ptr, sizeof(retval) );
+ memcpy( ptr, &newval, sizeof(newval) );
}
else SetLastError( ERROR_INVALID_INDEX );
}