diff --git a/dll/win32/devmgr/precomp.h b/dll/win32/devmgr/precomp.h index 1ca2f4b1111..2165d4bf12b 100644 --- a/dll/win32/devmgr/precomp.h +++ b/dll/win32/devmgr/precomp.h @@ -76,6 +76,8 @@ OUT LPDWORD lpReboot); #include #include +#define DYNAMIC_FIELD_OFFSET(Type, Field) ((LONG)(LONG_PTR)&(((Type*) 0)->Field)) + //WINE_DEFAULT_DEBUG_CHANNEL(devmgr); -#endif \ No newline at end of file +#endif diff --git a/dll/win32/devmgr/properties/hwpage.cpp b/dll/win32/devmgr/properties/hwpage.cpp index 8fb4161c910..9bd2c7ab05a 100644 --- a/dll/win32/devmgr/properties/hwpage.cpp +++ b/dll/win32/devmgr/properties/hwpage.cpp @@ -1030,8 +1030,8 @@ DeviceCreateHardwarePageEx(IN HWND hWndParent, failure cases! */ hpd = (PHARDWARE_PAGE_DATA)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - FIELD_OFFSET(HARDWARE_PAGE_DATA, - ClassDevInfo[uNumberOfGuids])); + DYNAMIC_FIELD_OFFSET(HARDWARE_PAGE_DATA, + ClassDevInfo[uNumberOfGuids])); if (hpd != NULL) { HWND hWnd;