Reece Dunn : setupapi/tests: Use FIELD_OFFSET instead of offsetof.

Alexandre Julliard julliard at winehq.org
Tue Jul 22 09:35:39 CDT 2008


Module: wine
Branch: master
Commit: 960ae6fedbf90b3e69c9dae89d4aec4a07170e55
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=960ae6fedbf90b3e69c9dae89d4aec4a07170e55

Author: Reece Dunn <msclrhd at googlemail.com>
Date:   Mon Jul 21 21:14:01 2008 +0100

setupapi/tests: Use FIELD_OFFSET instead of offsetof.

---

 dlls/setupapi/tests/devinst.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c
index 8fcff08..4e11bc0 100644
--- a/dlls/setupapi/tests/devinst.c
+++ b/dlls/setupapi/tests/devinst.c
@@ -824,7 +824,7 @@ static void testGetDeviceInterfaceDetail(void)
             LPBYTE buf = HeapAlloc(GetProcessHeap(), 0, size);
             SP_DEVICE_INTERFACE_DETAIL_DATA_A *detail =
                 (SP_DEVICE_INTERFACE_DETAIL_DATA_A *)buf;
-            DWORD expectedsize = offsetof(SP_DEVICE_INTERFACE_DETAIL_DATA_W, DevicePath) + sizeof(WCHAR)*(1 + strlen(path));
+            DWORD expectedsize = FIELD_OFFSET(SP_DEVICE_INTERFACE_DETAIL_DATA_W, DevicePath) + sizeof(WCHAR)*(1 + strlen(path));
 
             detail->cbSize = 0;
             SetLastError(0xdeadbeef);
@@ -1101,7 +1101,7 @@ static void testRegisterAndGetDetail(void)
         detail = (PSP_DEVICE_INTERFACE_DETAIL_DATA_A)HeapAlloc(GetProcessHeap(), 0, dwSize);
         if (detail)
         {
-            detail->cbSize = offsetof(SP_DEVICE_INTERFACE_DETAIL_DATA_A, DevicePath) + sizeof(char);
+            detail->cbSize = FIELD_OFFSET(SP_DEVICE_INTERFACE_DETAIL_DATA_A, DevicePath) + sizeof(char);
             SetLastError(0xdeadbeef);
             ret = pSetupDiGetDeviceInterfaceDetailA(set, &interfaceData,
              detail, dwSize, &dwSize, NULL);




More information about the wine-cvs mailing list