From 88ce4de0abd3a102e419db98c90b86286d78746d Mon Sep 17 00:00:00 2001 From: Jan Zerebecki Date: Sat, 10 Jan 2009 13:59:06 +0100 Subject: [PATCH] push 460a69df99a5ad9f5823a97170ef7a215171c033 --- configure | 9 + configure.ac | 1 + dlls/advapi32/registry.c | 2 +- dlls/amstream/mediastreamfilter.c | 10 +- dlls/crypt32/protectdata.c | 3 +- dlls/cryptui/Makefile.in | 2 +- dlls/cryptui/cryptui_En.rc | 57 + dlls/cryptui/cryptuires.h | 33 + dlls/cryptui/main.c | 1231 +- dlls/d3d8/surface.c | 6 +- dlls/d3d9/surface.c | 6 +- dlls/d3dxof/parsing.c | 2 +- dlls/ddraw/ddraw.c | 11 + dlls/ddraw/device.c | 9 +- dlls/ddraw/tests/dsurface.c | 10 + dlls/ddrawex/Makefile.in | 4 +- dlls/ddrawex/ddraw.c | 1563 +++ dlls/ddrawex/ddrawex_private.h | 51 +- dlls/ddrawex/main.c | 32 +- dlls/ddrawex/surface.c | 1308 +++ dlls/ddrawex/{ => tests}/Makefile.in | 14 +- dlls/ddrawex/tests/ddrawex.c | 119 + .../ddrawex/{ddrawex_private.h => tests/ddrawex.h} | 28 +- dlls/ddrawex/tests/surface.c | 265 + dlls/dinput/device.c | 2 +- dlls/dinput/effect_linuxinput.c | 6 +- dlls/dinput/joystick_linux.c | 8 +- dlls/dmband/band.c | 8 +- dlls/dmband/bandtrack.c | 4 +- dlls/dmband/dmband_main.c | 4 +- dlls/dmcompos/chordmap.c | 8 +- dlls/dmcompos/chordmaptrack.c | 4 +- dlls/dmcompos/dmcompos_main.c | 10 +- dlls/dmcompos/signposttrack.c | 4 +- dlls/dsound/duplex.c | 4 +- dlls/fusion/asmname.c | 4 +- dlls/fusion/assembly.c | 2 +- dlls/gdi32/tests/generated.c | 11427 ++++++++++++------- dlls/imm32/imm.c | 14 +- dlls/iphlpapi/ifenum.c | 11 - dlls/iphlpapi/ifenum.h | 7 +- dlls/kernel32/cpu.c | 29 +- dlls/kernel32/tests/file.c | 18 +- dlls/kernel32/tests/generated.c | 3415 +++--- dlls/kernel32/tests/process.c | 12 +- dlls/localspl/localspl_main.c | 56 +- dlls/mapi32/imalloc.c | 2 +- dlls/mapi32/tests/imalloc.c | 3 +- dlls/mapi32/tests/prop.c | 4 +- dlls/msacm32/internal.c | 60 +- dlls/msacm32/wineacm.h | 2 - dlls/mshtml/htmlelemcol.c | 5 +- dlls/mshtml/htmlstyle.c | 69 +- dlls/mshtml/mshtml_private.h | 1 - dlls/mshtml/protocol.c | 2 +- dlls/mshtml/tests/dom.c | 36 + dlls/msi/automation.c | 4 +- dlls/msi/tests/db.c | 9 +- dlls/msi/tests/package.c | 7 + dlls/msvcrt/except.c | 7 +- dlls/msvcrt/tests/heap.c | 22 +- dlls/msvcrt/wcs.c | 4 +- dlls/ntdll/tests/env.c | 7 +- dlls/ntdll/tests/generated.c | 2649 +++-- dlls/ntdll/tests/string.c | 10 +- dlls/ntdll/virtual.c | 2 +- dlls/ntoskrnl.exe/ntoskrnl.c | 6 +- dlls/ole32/clipboard.c | 3 +- dlls/ole32/moniker.c | 8 +- dlls/ole32/tests/moniker.c | 11 + dlls/oleaut32/olepicture.c | 12 +- dlls/oleaut32/tests/safearray.c | 11 +- dlls/oleaut32/tests/vartest.c | 4 +- dlls/oleaut32/tests/vartype.c | 2 +- dlls/opengl32/make_opengl | 47 +- dlls/opengl32/opengl_ext.c | 108 +- dlls/qcap/enummedia.c | 4 +- dlls/qcap/enumpins.c | 4 +- dlls/qcap/v4l.c | 2 +- dlls/qcap/vfwcapture.c | 8 +- dlls/quartz/pin.c | 16 - dlls/quartz/pin.h | 1 - dlls/quartz/videorenderer.c | 6 +- dlls/riched20/editor.c | 21 +- dlls/riched20/tests/editor.c | 172 + dlls/rpcrt4/ndr_marshall.c | 6 +- dlls/rpcrt4/tests/generated.c | 703 +- dlls/rpcrt4/tests/ndr_marshall.c | 26 +- dlls/setupapi/setupapi.spec | 2 +- dlls/setupapi/setupcab.c | 16 +- dlls/setupapi/stringtable.c | 14 +- dlls/setupapi/tests/devinst.c | 6 - dlls/setupapi/tests/stringtable.c | 24 +- dlls/shdocvw/shdocvw_main.c | 2 +- dlls/shell32/control.c | 2 +- dlls/shell32/shell32.spec | 1 + dlls/shell32/shelllink.c | 2 +- dlls/shell32/shellord.c | 9 + dlls/shell32/tests/generated.c | 3410 +++--- dlls/shell32/tests/shlfileop.c | 219 +- dlls/shlwapi/tests/generated.c | 361 +- dlls/shlwapi/tests/string.c | 10 +- dlls/urlmon/http.c | 4 +- dlls/urlmon/tests/generated.c | 220 +- dlls/urlmon/umon.c | 4 +- dlls/user32/dialog16.c | 4 +- dlls/user32/sysparams.c | 6 +- dlls/user32/tests/dialog.c | 14 +- dlls/user32/tests/generated.c | 6324 ++++++---- dlls/user32/tests/menu.c | 999 +- dlls/user32/tests/msg.c | 2 +- dlls/user32/tests/win.c | 8 +- dlls/user32/tests/wsprintf.c | 12 +- dlls/version/resource.c | 5 +- dlls/wined3d/arb_program_shader.c | 3 +- dlls/wined3d/basetexture.c | 1 - dlls/wined3d/device.c | 48 +- dlls/wined3d/directx.c | 16 +- dlls/wined3d/drawprim.c | 63 +- dlls/wined3d/glsl_shader.c | 3 +- dlls/wined3d/palette.c | 2 +- dlls/wined3d/pixelshader.c | 5 +- dlls/wined3d/state.c | 36 +- dlls/wined3d/surface.c | 4 +- dlls/wined3d/surface_gdi.c | 4 +- dlls/wined3d/utils.c | 51 +- dlls/wined3d/vertexbuffer.c | 5 +- dlls/wined3d/vertexdeclaration.c | 36 +- dlls/wined3d/vertexshader.c | 166 +- dlls/wined3d/wined3d_gl.h | 2 + dlls/wined3d/wined3d_private.h | 20 +- dlls/wineps.drv/type1afm.c | 2 +- dlls/wininet/ftp.c | 10 +- dlls/wininet/internet.c | 6 +- dlls/wininet/tests/generated.c | 1100 +- dlls/wintrust/crypt.c | 27 +- dlls/wintrust/tests/crypt.c | 61 +- dlls/ws2_32/socket.c | 2 +- dlls/ws2_32/tests/sock.c | 44 +- dlls/xinput1_3/tests/xinput.c | 54 + dlls/xinput1_3/xinput1_3.spec | 4 +- dlls/xinput1_3/xinput1_3_main.c | 24 + include/setupapi.h | 10 +- include/wine/wined3d.idl | 6 +- programs/cmdlgtst/cmdlgtst.c | 18 +- programs/winecfg/theme.c | 6 +- programs/wineconsole/wineconsole.c | 8 +- programs/winedbg/expr.c | 16 +- programs/winedbg/stack.c | 2 +- programs/winedbg/tgt_active.c | 2 +- programs/winedbg/types.c | 4 +- programs/winhlp32/hlpfile.c | 37 +- programs/winhlp32/macro.c | 560 +- programs/winhlp32/macro.h | 197 +- programs/winhlp32/winhelp.c | 1432 ++- programs/winhlp32/winhelp.h | 1 - programs/wordpad/wordpad.c | 4 +- tools/widl/typegen.c | 23 +- tools/winapi/tests.dat | 4 +- tools/winapi/winapi_test | 108 +- 160 files changed, 25893 insertions(+), 13943 deletions(-) create mode 100644 dlls/ddrawex/ddraw.c create mode 100644 dlls/ddrawex/surface.c copy dlls/ddrawex/{ => tests}/Makefile.in (50%) create mode 100644 dlls/ddrawex/tests/ddrawex.c copy dlls/ddrawex/{ddrawex_private.h => tests/ddrawex.h} (68%) create mode 100644 dlls/ddrawex/tests/surface.c rewrite dlls/gdi32/tests/generated.c (62%) rewrite dlls/kernel32/tests/generated.c (63%) rewrite dlls/shell32/tests/generated.c (60%) rewrite dlls/shlwapi/tests/generated.c (62%) rewrite dlls/user32/tests/generated.c (62%) rewrite programs/winhlp32/macro.h (61%) diff --git a/configure b/configure index 0e8fdf30129..72bee06ff05 100755 --- a/configure +++ b/configure @@ -23136,6 +23136,14 @@ dlls/ddrawex/Makefile: dlls/ddrawex/Makefile.in dlls/Makedll.rules" ac_config_files="$ac_config_files dlls/ddrawex/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ + dlls/ddrawex/tests/Makefile" +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ + ddrawex/tests" +ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS +dlls/ddrawex/tests/Makefile: dlls/ddrawex/tests/Makefile.in dlls/Maketest.rules" +ac_config_files="$ac_config_files dlls/ddrawex/tests/Makefile" + +ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/devenum/Makefile" test "x$enable_devenum" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\ devenum" @@ -26733,6 +26741,7 @@ do "dlls/ddraw/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/ddraw/Makefile" ;; "dlls/ddraw/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/ddraw/tests/Makefile" ;; "dlls/ddrawex/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/ddrawex/Makefile" ;; + "dlls/ddrawex/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/ddrawex/tests/Makefile" ;; "dlls/devenum/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/devenum/Makefile" ;; "dlls/dinput/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dinput/Makefile" ;; "dlls/dinput/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dinput/tests/Makefile" ;; diff --git a/configure.ac b/configure.ac index bb5325b03ab..4b394d6901f 100644 --- a/configure.ac +++ b/configure.ac @@ -1849,6 +1849,7 @@ WINE_CONFIG_MAKEFILE([dlls/dciman32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_D WINE_CONFIG_MAKEFILE([dlls/ddraw/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/ddraw/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/ddrawex/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/ddrawex/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/devenum/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/dinput/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/dinput/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c index 6615bc0af76..52de6c5d427 100644 --- a/dlls/advapi32/registry.c +++ b/dlls/advapi32/registry.c @@ -43,7 +43,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(reg); #define HKEY_SPECIAL_ROOT_FIRST HKEY_CLASSES_ROOT #define HKEY_SPECIAL_ROOT_LAST HKEY_DYN_DATA -#define NB_SPECIAL_ROOT_KEYS ((UINT)HKEY_SPECIAL_ROOT_LAST - (UINT)HKEY_SPECIAL_ROOT_FIRST + 1) +#define NB_SPECIAL_ROOT_KEYS ((UINT_PTR)HKEY_SPECIAL_ROOT_LAST - (UINT_PTR)HKEY_SPECIAL_ROOT_FIRST + 1) static HKEY special_root_keys[NB_SPECIAL_ROOT_KEYS]; static BOOL hkcu_cache_disabled; diff --git a/dlls/amstream/mediastreamfilter.c b/dlls/amstream/mediastreamfilter.c index 7f57e607113..73dcc3d31b5 100644 --- a/dlls/amstream/mediastreamfilter.c +++ b/dlls/amstream/mediastreamfilter.c @@ -82,15 +82,15 @@ static HRESULT WINAPI MediaStreamFilterImpl_QueryInterface(IMediaStreamFilter * *ppv = NULL; if (IsEqualIID(riid, &IID_IUnknown)) - *ppv = (LPVOID)This; + *ppv = This; else if (IsEqualIID(riid, &IID_IPersist)) - *ppv = (LPVOID)This; + *ppv = This; else if (IsEqualIID(riid, &IID_IMediaFilter)) - *ppv = (LPVOID)This; + *ppv = This; else if (IsEqualIID(riid, &IID_IBaseFilter)) - *ppv = (LPVOID)This; + *ppv = This; else if (IsEqualIID(riid, &IID_IMediaStreamFilter)) - *ppv = (LPVOID)This; + *ppv = This; if (*ppv) { diff --git a/dlls/crypt32/protectdata.c b/dlls/crypt32/protectdata.c index d86dd8e6295..401e820a929 100644 --- a/dlls/crypt32/protectdata.c +++ b/dlls/crypt32/protectdata.c @@ -330,8 +330,7 @@ BOOL serialize(const struct protect_data_t *pInfo, DATA_BLOB *pSerial) if (ptr - pSerial->pbData != dwStruct) { - ERR("struct size changed!? %u != expected %u\n", - ptr - pSerial->pbData, dwStruct); + ERR("struct size changed!? expected %u\n", dwStruct); LocalFree(pSerial->pbData); pSerial->pbData=NULL; pSerial->cbData=0; diff --git a/dlls/cryptui/Makefile.in b/dlls/cryptui/Makefile.in index d70d0ea6857..ca01d354c34 100644 --- a/dlls/cryptui/Makefile.in +++ b/dlls/cryptui/Makefile.in @@ -3,7 +3,7 @@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = cryptui.dll -IMPORTS = uuid crypt32 ole32 comctl32 comdlg32 user32 gdi32 kernel32 +IMPORTS = uuid crypt32 ole32 comctl32 comdlg32 user32 gdi32 advapi32 kernel32 DELAYIMPORTS = wintrust urlmon IMPORTLIB = cryptui diff --git a/dlls/cryptui/cryptui_En.rc b/dlls/cryptui/cryptui_En.rc index 06092290ad8..474e2928404 100644 --- a/dlls/cryptui/cryptui_En.rc +++ b/dlls/cryptui/cryptui_En.rc @@ -94,6 +94,27 @@ STRINGTABLE DISCARDABLE IDS_IMPORT_SUCCEEDED "The import was successful." IDS_IMPORT_FAILED "The import failed." IDS_WIZARD_TITLE_FONT "Arial" + IDS_PURPOSE_ALL "" + IDS_PURPOSE_ADVANCED "" + IDS_SUBJECT_COLUMN "Issued To" + IDS_ISSUER_COLUMN "Issued By" + IDS_EXPIRATION_COLUMN "Expiration Date" + IDS_FRIENDLY_NAME_COLUMN "Friendly Name" + IDS_ALLOWED_PURPOSE_ALL "" + IDS_ALLOWED_PURPOSE_NONE "" + IDS_WARN_REMOVE_MY "You will no longer be able to decrypt mesages with this certificate, or sign messages with it.\nAre you sure you want to remove this certificate?" + IDS_WARN_REMOVE_PLURAL_MY "You will no longer be able to decrypt mesages with these certificate, or sign messages with them.\nAre you sure you want to remove these certificates?" + IDS_WARN_REMOVE_ADDRESSBOOK "You will no longer be able to encrypt messages with this certificate, or verify messages signed with it.\nAre you sure you want to remove this certificate?" + IDS_WARN_REMOVE_PLURAL_ADDRESSBOOK "You will no longer be able to encrypt messages with these certificates, or verify messages signed with it.\nAre you sure you want to remove these certificates?" + IDS_WARN_REMOVE_CA "Certificates issued by this certification authority will no longer be trusted.\nAre you sure you want to remove this certificate?" + IDS_WARN_REMOVE_PLURAL_CA "Certificates issued by these certification authorities will no longer be trusted.\nAre you sure you want to remove these certificates?" + IDS_WARN_REMOVE_ROOT "Certificates issued by this root certification authority, or any certification authorities it issued, will no longer be trusted.\nAre you sure you want to remove this trusted root certificate?" + IDS_WARN_REMOVE_PLURAL_ROOT "Certificates issued by these root certification authorities, or any certification authorities they issued, will no longer be trusted.\nAre you sure you want to remove these trusted root certificates?" + IDS_WARN_REMOVE_TRUSTEDPUBLISHER "Software signed by this publisher will no longer be trusted.\nAre you sure you want to remove this certificate?" + IDS_WARN_REMOVE_PLURAL_TRUSTEDPUBLISHER "Software signed by these publishers will no longer be trusted.\nAre you sure you want to remove these certificates?" + IDS_WARN_REMOVE_DEFAULT "Are you sure you want to remove this certificate?" + IDS_WARN_REMOVE_PLURAL_DEFAULT "Are you sure you want to remove these certificates?" + IDS_CERT_MGR "Certificates" IDS_PURPOSE_SERVER_AUTH "Ensures the identify of a remote computer" IDS_PURPOSE_CLIENT_AUTH "Proves your identity to a remote computer" IDS_PURPOSE_CODE_SIGNING "Ensures software came from software publisher\nProtects software from alteration after publication" @@ -287,3 +308,39 @@ BEGIN LVS_REPORT|LVS_NOCOLUMNHEADER|LVS_SINGLESEL|WS_CHILD|WS_VISIBLE|WS_TABSTOP|WS_BORDER, 115,67,174,100 END + +IDD_CERT_MGR DIALOG DISCARDABLE 0,0,335,270 +CAPTION "Certificates" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "I&ntended purpose:", IDC_STATIC, 7,9,100,12 + COMBOBOX IDC_MGR_PURPOSE_SELECTION, 83,7,245,14, + CBS_DROPDOWNLIST|WS_BORDER|WS_VSCROLL|WS_TABSTOP + CONTROL "", IDC_MGR_STORES, "SysTabControl32", + WS_CLIPSIBLINGS|WS_TABSTOP, 7,25,321,140 + CONTROL "", IDC_MGR_CERTS, "SysListView32", + LVS_REPORT|WS_CHILD|WS_VISIBLE|WS_TABSTOP|WS_BORDER, 15,46,305,111 + PUSHBUTTON "&Import...", IDC_MGR_IMPORT, 7,172,51,14 + PUSHBUTTON "&Export...", IDC_MGR_EXPORT, 62,172,51,14, WS_DISABLED + PUSHBUTTON "&Remove", IDC_MGR_REMOVE, 117,172,51,14, WS_DISABLED + PUSHBUTTON "&Advanced...", IDC_MGR_ADVANCED, 277,172,51,14 + GROUPBOX "Certificate intended purposes", grp1,7,194,321,47, BS_GROUPBOX + LTEXT "", IDC_MGR_PURPOSES, 13,208,252,30 + PUSHBUTTON "&View...", IDC_MGR_VIEW, 269,218,51,14, WS_DISABLED + PUSHBUTTON "&Close", IDCANCEL, 277,249,51,14, BS_DEFPUSHBUTTON +END + +IDD_CERT_MGR_ADVANCED DIALOG DISCARDABLE 0,0,248,176 +CAPTION "Advanced Options" +FONT 8, "MS Shell Dlg" +BEGIN + GROUPBOX "Certificate purpose", grp1, 7,7,234,141, BS_GROUPBOX + LTEXT "Select one or more purposes to be listed when Advanced Purposes is selected.", + IDC_STATIC, 14,18,220,16 + LTEXT "&Certificate purposes:", IDC_STATIC, 14,41,90,12, WS_TABSTOP + CONTROL "", IDC_CERTIFICATE_USAGES,"SysListView32", + LVS_REPORT|LVS_NOCOLUMNHEADER|LVS_SINGLESEL|WS_CHILD|WS_VISIBLE|WS_TABSTOP|WS_BORDER, + 14,51,220,90 + PUSHBUTTON "OK", IDOK, 132,155,51,14, BS_DEFPUSHBUTTON + PUSHBUTTON "Cancel", IDCANCEL, 190,155,51,14 +END diff --git a/dlls/cryptui/cryptuires.h b/dlls/cryptui/cryptuires.h index 14f576ef19c..4f2cc7f86d6 100644 --- a/dlls/cryptui/cryptuires.h +++ b/dlls/cryptui/cryptuires.h @@ -91,6 +91,27 @@ #define IDS_IMPORT_SUCCEEDED 1071 #define IDS_IMPORT_FAILED 1072 #define IDS_WIZARD_TITLE_FONT 1073 +#define IDS_PURPOSE_ALL 1074 +#define IDS_PURPOSE_ADVANCED 1075 +#define IDS_SUBJECT_COLUMN 1076 +#define IDS_ISSUER_COLUMN 1077 +#define IDS_EXPIRATION_COLUMN 1078 +#define IDS_FRIENDLY_NAME_COLUMN 1079 +#define IDS_ALLOWED_PURPOSE_ALL 1080 +#define IDS_ALLOWED_PURPOSE_NONE 1081 +#define IDS_WARN_REMOVE_MY 1082 +#define IDS_WARN_REMOVE_PLURAL_MY 1083 +#define IDS_WARN_REMOVE_ADDRESSBOOK 1084 +#define IDS_WARN_REMOVE_PLURAL_ADDRESSBOOK 1085 +#define IDS_WARN_REMOVE_CA 1086 +#define IDS_WARN_REMOVE_PLURAL_CA 1087 +#define IDS_WARN_REMOVE_ROOT 1088 +#define IDS_WARN_REMOVE_PLURAL_ROOT 1089 +#define IDS_WARN_REMOVE_TRUSTEDPUBLISHER 1090 +#define IDS_WARN_REMOVE_PLURAL_TRUSTEDPUBLISHER 1091 +#define IDS_WARN_REMOVE_DEFAULT 1092 +#define IDS_WARN_REMOVE_PLURAL_DEFAULT 1093 +#define IDS_CERT_MGR 1094 #define IDS_PURPOSE_SERVER_AUTH 1100 #define IDS_PURPOSE_CLIENT_AUTH 1101 @@ -130,6 +151,8 @@ #define IDD_IMPORT_FILE 108 #define IDD_IMPORT_STORE 109 #define IDD_IMPORT_FINISH 110 +#define IDD_CERT_MGR 111 +#define IDD_CERT_MGR_ADVANCED 112 #define IDB_SMALL_ICONS 200 #define IDB_CERT 201 @@ -184,4 +207,14 @@ #define IDC_IMPORT_BROWSE_STORE 2706 #define IDC_IMPORT_SETTINGS 2707 +#define IDC_MGR_PURPOSE_SELECTION 2800 +#define IDC_MGR_STORES 2801 +#define IDC_MGR_CERTS 2802 +#define IDC_MGR_IMPORT 2803 +#define IDC_MGR_EXPORT 2804 +#define IDC_MGR_REMOVE 2805 +#define IDC_MGR_ADVANCED 2806 +#define IDC_MGR_PURPOSES 2807 +#define IDC_MGR_VIEW 2808 + #endif /* ndef __CRYPTUIRES_H_ */ diff --git a/dlls/cryptui/main.c b/dlls/cryptui/main.c index 987599d6f64..a5fb5808b4f 100644 --- a/dlls/cryptui/main.c +++ b/dlls/cryptui/main.c @@ -38,6 +38,7 @@ #include "cryptuires.h" #include "urlmon.h" #include "hlink.h" +#include "winreg.h" #include "wine/debug.h" #include "wine/unicode.h" @@ -65,13 +66,1108 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) return TRUE; } +#define MAX_STRING_LEN 512 + +static void add_cert_columns(HWND hwnd) +{ + HWND lv = GetDlgItem(hwnd, IDC_MGR_CERTS); + RECT rc; + WCHAR buf[MAX_STRING_LEN]; + LVCOLUMNW column; + + SendMessageW(lv, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT); + GetWindowRect(lv, &rc); + LoadStringW(hInstance, IDS_SUBJECT_COLUMN, buf, + sizeof(buf) / sizeof(buf[0])); + column.mask = LVCF_WIDTH | LVCF_TEXT; + column.cx = (rc.right - rc.left) * 29 / 100 - 2; + column.pszText = buf; + SendMessageW(lv, LVM_INSERTCOLUMNW, 0, (LPARAM)&column); + LoadStringW(hInstance, IDS_ISSUER_COLUMN, buf, + sizeof(buf) / sizeof(buf[0])); + SendMessageW(lv, LVM_INSERTCOLUMNW, 1, (LPARAM)&column); + column.cx = (rc.right - rc.left) * 16 / 100 - 2; + LoadStringW(hInstance, IDS_EXPIRATION_COLUMN, buf, + sizeof(buf) / sizeof(buf[0])); + SendMessageW(lv, LVM_INSERTCOLUMNW, 2, (LPARAM)&column); + column.cx = (rc.right - rc.left) * 23 / 100 - 1; + LoadStringW(hInstance, IDS_FRIENDLY_NAME_COLUMN, buf, + sizeof(buf) / sizeof(buf[0])); + SendMessageW(lv, LVM_INSERTCOLUMNW, 3, (LPARAM)&column); +} + +static void add_cert_to_view(HWND lv, PCCERT_CONTEXT cert, DWORD *allocatedLen, + LPWSTR *str) +{ + DWORD len; + LVITEMW item; + WCHAR dateFmt[80]; /* sufficient for LOCALE_SSHORTDATE */ + WCHAR date[80]; + SYSTEMTIME sysTime; + + item.mask = LVIF_IMAGE | LVIF_PARAM | LVIF_TEXT; + item.iItem = SendMessageW(lv, LVM_GETITEMCOUNT, 0, 0); + item.iSubItem = 0; + item.iImage = 0; + item.lParam = (LPARAM)CertDuplicateCertificateContext(cert); + len = CertGetNameStringW(cert, CERT_NAME_SIMPLE_DISPLAY_TYPE, 0, NULL, + NULL, 0); + if (len > *allocatedLen) + { + HeapFree(GetProcessHeap(), 0, *str); + *str = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + if (*str) + *allocatedLen = len; + } + if (*str) + { + CertGetNameStringW(cert, CERT_NAME_SIMPLE_DISPLAY_TYPE, 0, NULL, + *str, len); + item.pszText = *str; + SendMessageW(lv, LVM_INSERTITEMW, 0, (LPARAM)&item); + } + + item.mask = LVIF_TEXT; + len = CertGetNameStringW(cert, CERT_NAME_SIMPLE_DISPLAY_TYPE, + CERT_NAME_ISSUER_FLAG, NULL, NULL, 0); + if (len > *allocatedLen) + { + HeapFree(GetProcessHeap(), 0, *str); + *str = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + if (*str) + *allocatedLen = len; + } + if (*str) + { + CertGetNameStringW(cert, CERT_NAME_SIMPLE_DISPLAY_TYPE, + CERT_NAME_ISSUER_FLAG, NULL, *str, len); + item.pszText = *str; + item.iSubItem = 1; + SendMessageW(lv, LVM_SETITEMTEXTW, item.iItem, (LPARAM)&item); + } + + GetLocaleInfoW(LOCALE_SYSTEM_DEFAULT, LOCALE_SSHORTDATE, dateFmt, + sizeof(dateFmt) / sizeof(dateFmt[0])); + FileTimeToSystemTime(&cert->pCertInfo->NotAfter, &sysTime); + GetDateFormatW(LOCALE_SYSTEM_DEFAULT, 0, &sysTime, dateFmt, date, + sizeof(date) / sizeof(date[0])); + item.pszText = date; + item.iSubItem = 2; + SendMessageW(lv, LVM_SETITEMTEXTW, item.iItem, (LPARAM)&item); + + len = CertGetNameStringW(cert, CERT_NAME_FRIENDLY_DISPLAY_TYPE, 0, NULL, + NULL, 0); + if (len > *allocatedLen) + { + HeapFree(GetProcessHeap(), 0, *str); + *str = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + if (*str) + *allocatedLen = len; + } + if (*str) + { + CertGetNameStringW(cert, CERT_NAME_FRIENDLY_DISPLAY_TYPE, 0, NULL, + *str, len); + item.pszText = *str; + item.iSubItem = 3; + SendMessageW(lv, LVM_SETITEMTEXTW, item.iItem, (LPARAM)&item); + } +} + +static LPSTR get_cert_mgr_usages(void) +{ + static const WCHAR keyName[] = { 'S','o','f','t','w','a','r','e','\\','M', + 'i','c','r','o','s','o','f','t','\\','C','r','y','p','t','o','g','r','a', + 'p','h','y','\\','U','I','\\','C','e','r','t','m','g','r','\\','P','u', + 'r','p','o','s','e',0 }; + LPSTR str = NULL; + HKEY key; + + if (!RegCreateKeyExW(HKEY_CURRENT_USER, keyName, 0, NULL, 0, KEY_READ, + NULL, &key, NULL)) + { + LONG rc; + DWORD type, size; + + rc = RegQueryValueExA(key, "Purpose", NULL, &type, NULL, &size); + if ((!rc || rc == ERROR_MORE_DATA) && type == REG_SZ) + { + str = HeapAlloc(GetProcessHeap(), 0, size); + if (str) + { + rc = RegQueryValueExA(key, "Purpose", NULL, NULL, (LPBYTE)str, + &size); + if (rc) + { + HeapFree(GetProcessHeap(), 0, str); + str = NULL; + } + } + } + RegCloseKey(key); + } + return str; +} + +typedef enum { + PurposeFilterShowAll = 0, + PurposeFilterShowAdvanced = 1, + PurposeFilterShowOID = 2 +} PurposeFilter; + +static void initialize_purpose_selection(HWND hwnd) +{ + HWND cb = GetDlgItem(hwnd, IDC_MGR_PURPOSE_SELECTION); + WCHAR buf[MAX_STRING_LEN]; + LPSTR usages; + int index; + + LoadStringW(hInstance, IDS_PURPOSE_ALL, buf, + sizeof(buf) / sizeof(buf[0])); + index = SendMessageW(cb, CB_INSERTSTRING, -1, (LPARAM)buf); + SendMessageW(cb, CB_SETITEMDATA, index, (LPARAM)PurposeFilterShowAll); + LoadStringW(hInstance, IDS_PURPOSE_ADVANCED, buf, + sizeof(buf) / sizeof(buf[0])); + index = SendMessageW(cb, CB_INSERTSTRING, -1, (LPARAM)buf); + SendMessageW(cb, CB_SETITEMDATA, index, (LPARAM)PurposeFilterShowAdvanced); + SendMessageW(cb, CB_SETCURSEL, 0, 0); + if ((usages = get_cert_mgr_usages())) + { + LPSTR ptr, comma; + + for (ptr = usages, comma = strchr(ptr, ','); ptr && *ptr; + ptr = comma ? comma + 1 : NULL, + comma = ptr ? strchr(ptr, ',') : NULL) + { + PCCRYPT_OID_INFO info; + + if (comma) + *comma = 0; + if ((info = CryptFindOIDInfo(CRYPT_OID_INFO_OID_KEY, ptr, 0))) + { + index = SendMessageW(cb, CB_INSERTSTRING, 0, + (LPARAM)info->pwszName); + SendMessageW(cb, CB_SETITEMDATA, index, (LPARAM)info); + } + } + HeapFree(GetProcessHeap(), 0, usages); + } +} + +extern BOOL WINAPI WTHelperGetKnownUsages(DWORD action, + PCCRYPT_OID_INFO **usages); + +static CERT_ENHKEY_USAGE *add_oid_to_usage(CERT_ENHKEY_USAGE *usage, LPSTR oid) +{ + if (!usage->cUsageIdentifier) + usage->rgpszUsageIdentifier = HeapAlloc(GetProcessHeap(), 0, + sizeof(LPSTR)); + else + usage->rgpszUsageIdentifier = HeapReAlloc(GetProcessHeap(), 0, + usage->rgpszUsageIdentifier, + (usage->cUsageIdentifier + 1) * sizeof(LPSTR)); + if (usage->rgpszUsageIdentifier) + usage->rgpszUsageIdentifier[usage->cUsageIdentifier++] = oid; + else + { + HeapFree(GetProcessHeap(), 0, usage); + usage = NULL; + } + return usage; +} + +static CERT_ENHKEY_USAGE *convert_usages_str_to_usage(LPSTR usageStr) +{ + CERT_ENHKEY_USAGE *usage = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + sizeof(CERT_ENHKEY_USAGE)); + + if (usage) + { + LPSTR ptr, comma; + + for (ptr = usageStr, comma = strchr(ptr, ','); usage && ptr && *ptr; + ptr = comma ? comma + 1 : NULL, + comma = ptr ? strchr(ptr, ',') : NULL) + { + if (comma) + *comma = 0; + add_oid_to_usage(usage, ptr); + } + } + return usage; +} + +static CERT_ENHKEY_USAGE *create_advanced_filter(void) +{ + CERT_ENHKEY_USAGE *advancedUsage = HeapAlloc(GetProcessHeap(), + HEAP_ZERO_MEMORY, sizeof(CERT_ENHKEY_USAGE)); + + if (advancedUsage) + { + PCCRYPT_OID_INFO *usages; + + if (WTHelperGetKnownUsages(1, &usages)) + { + LPSTR disabledUsagesStr; + + if ((disabledUsagesStr = get_cert_mgr_usages())) + { + CERT_ENHKEY_USAGE *disabledUsages = + convert_usages_str_to_usage(disabledUsagesStr); + + if (disabledUsages) + { + PCCRYPT_OID_INFO *ptr; + + for (ptr = usages; *ptr; ptr++) + { + DWORD i; + BOOL disabled = FALSE; + + for (i = 0; !disabled && + i < disabledUsages->cUsageIdentifier; i++) + if (!strcmp(disabledUsages->rgpszUsageIdentifier[i], + (*ptr)->pszOID)) + disabled = TRUE; + if (!disabled) + add_oid_to_usage(advancedUsage, + (LPSTR)(*ptr)->pszOID); + } + /* The individual strings are pointers to disabledUsagesStr, + * so they're freed when it is. + */ + HeapFree(GetProcessHeap(), 0, + disabledUsages->rgpszUsageIdentifier); + HeapFree(GetProcessHeap(), 0, disabledUsages); + } + HeapFree(GetProcessHeap(), 0, disabledUsagesStr); + } + WTHelperGetKnownUsages(2, &usages); + } + } + return advancedUsage; +} + +static void show_store_certs(HWND hwnd, HCERTSTORE store) +{ + HWND lv = GetDlgItem(hwnd, IDC_MGR_CERTS); + HWND cb = GetDlgItem(hwnd, IDC_MGR_PURPOSE_SELECTION); + PCCERT_CONTEXT cert = NULL; + DWORD allocatedLen = 0; + LPWSTR str = NULL; + int index; + PurposeFilter filter = PurposeFilterShowAll; + LPCSTR oid = NULL; + CERT_ENHKEY_USAGE *advanced = NULL; + + index = SendMessageW(cb, CB_GETCURSEL, 0, 0); + if (index >= 0) + { + INT_PTR data = SendMessageW(cb, CB_GETITEMDATA, index, 0); + + if (!HIWORD(data)) + filter = data; + else + { + PCCRYPT_OID_INFO info = (PCCRYPT_OID_INFO)data; + + filter = PurposeFilterShowOID; + oid = info->pszOID; + } + } + if (filter == PurposeFilterShowAdvanced) + advanced = create_advanced_filter(); + do { + cert = CertEnumCertificatesInStore(store, cert); + if (cert) + { + BOOL show = FALSE; + + if (filter == PurposeFilterShowAll) + show = TRUE; + else + { + int numOIDs; + DWORD cbOIDs = 0; + + if (CertGetValidUsages(1, &cert, &numOIDs, NULL, &cbOIDs)) + { + if (numOIDs == -1) + { + /* -1 implies all usages are valid */ + show = TRUE; + } + else + { + LPSTR *oids = HeapAlloc(GetProcessHeap(), 0, cbOIDs); + + if (oids) + { + if (CertGetValidUsages(1, &cert, &numOIDs, oids, + &cbOIDs)) + { + int i; + + if (filter == PurposeFilterShowOID) + { + for (i = 0; !show && i < numOIDs; i++) + if (!strcmp(oids[i], oid)) + show = TRUE; + } + else + { + for (i = 0; !show && i < numOIDs; i++) + { + DWORD j; + + for (j = 0; !show && + j < advanced->cUsageIdentifier; j++) + if (!strcmp(oids[i], + advanced->rgpszUsageIdentifier[j])) + show = TRUE; + } + } + } + HeapFree(GetProcessHeap(), 0, oids); + } + } + } + } + if (show) + add_cert_to_view(lv, cert, &allocatedLen, &str); + } + } while (cert); + HeapFree(GetProcessHeap(), 0, str); + if (advanced) + { + HeapFree(GetProcessHeap(), 0, advanced->rgpszUsageIdentifier); + HeapFree(GetProcessHeap(), 0, advanced); + } +} + +static const WCHAR my[] = { 'M','y',0 }; +static const WCHAR addressBook[] = { + 'A','d','d','r','e','s','s','B','o','o','k',0 }; +static const WCHAR ca[] = { 'C','A',0 }; +static const WCHAR root[] = { 'R','o','o','t',0 }; +static const WCHAR trustedPublisher[] = { + 'T','r','u','s','t','e','d','P','u','b','l','i','s','h','e','r',0 }; +static const WCHAR disallowed[] = { 'D','i','s','a','l','l','o','w','e','d',0 }; + +struct CertMgrStoreInfo +{ + LPCWSTR name; + int removeWarning; + int removePluralWarning; +}; + +static const struct CertMgrStoreInfo defaultStoreList[] = { + { my, IDS_WARN_REMOVE_MY, IDS_WARN_REMOVE_PLURAL_MY }, + { addressBook, IDS_WARN_REMOVE_ADDRESSBOOK, + IDS_WARN_REMOVE_PLURAL_ADDRESSBOOK }, + { ca, IDS_WARN_REMOVE_CA, IDS_WARN_REMOVE_PLURAL_CA }, + { root, IDS_WARN_REMOVE_ROOT, IDS_WARN_REMOVE_PLURAL_ROOT }, + { trustedPublisher, IDS_WARN_REMOVE_TRUSTEDPUBLISHER, + IDS_WARN_REMOVE_PLURAL_TRUSTEDPUBLISHER }, + { disallowed, IDS_WARN_REMOVE_DEFAULT }, +}; + +static const struct CertMgrStoreInfo publisherStoreList[] = { + { root, IDS_WARN_REMOVE_ROOT, IDS_WARN_REMOVE_PLURAL_ROOT }, + { trustedPublisher, IDS_WARN_REMOVE_TRUSTEDPUBLISHER, + IDS_WARN_REMOVE_PLURAL_TRUSTEDPUBLISHER }, + { disallowed, IDS_WARN_REMOVE_PLURAL_DEFAULT }, +}; + +struct CertMgrData +{ + HIMAGELIST imageList; + LPCWSTR title; + DWORD nStores; + const struct CertMgrStoreInfo *stores; +}; + +static void show_cert_stores(HWND hwnd, DWORD dwFlags, struct CertMgrData *data) +{ + const struct CertMgrStoreInfo *storeList; + int cStores, i; + HWND tab = GetDlgItem(hwnd, IDC_MGR_STORES); + + if (dwFlags & CRYPTUI_CERT_MGR_PUBLISHER_TAB) + { + storeList = publisherStoreList; + cStores = sizeof(publisherStoreList) / sizeof(publisherStoreList[0]); + } + else + { + storeList = defaultStoreList; + cStores = sizeof(defaultStoreList) / sizeof(defaultStoreList[0]); + } + if (dwFlags & CRYPTUI_CERT_MGR_SINGLE_TAB_FLAG) + cStores = 1; + data->nStores = cStores; + data->stores = storeList; + for (i = 0; i < cStores; i++) + { + LPCWSTR name; + TCITEMW item; + HCERTSTORE store; + + if (!(name = CryptFindLocalizedName(storeList[i].name))) + name = storeList[i].name; + store = CertOpenStore(CERT_STORE_PROV_SYSTEM_W, 0, 0, + CERT_SYSTEM_STORE_CURRENT_USER, storeList[i].name); + item.mask = TCIF_TEXT | TCIF_PARAM; + item.pszText = (LPWSTR)name; + item.lParam = (LPARAM)store; + SendMessageW(tab, TCM_INSERTITEMW, i, (LPARAM)&item); + } +} + +static void free_certs(HWND lv) +{ + LVITEMW item; + int items = SendMessageW(lv, LVM_GETITEMCOUNT, 0, 0), i; + + for (i = 0; i < items; i++) + { + item.mask = LVIF_PARAM; + item.iItem = i; + item.iSubItem = 0; + SendMessageW(lv, LVM_GETITEMW, 0, (LPARAM)&item); + CertFreeCertificateContext((PCCERT_CONTEXT)item.lParam); + } +} + +static HCERTSTORE cert_mgr_index_to_store(HWND tab, int index) +{ + TCITEMW item; + + item.mask = TCIF_PARAM; + SendMessageW(tab, TCM_GETITEMW, index, (LPARAM)&item); + return (HCERTSTORE)item.lParam; +} + +static HCERTSTORE cert_mgr_current_store(HWND hwnd) +{ + HWND tab = GetDlgItem(hwnd, IDC_MGR_STORES); + + return cert_mgr_index_to_store(tab, SendMessageW(tab, TCM_GETCURSEL, 0, 0)); +} + +static void close_stores(HWND tab) +{ + int i, tabs = SendMessageW(tab, TCM_GETITEMCOUNT, 0, 0); + + for (i = 0; i < tabs; i++) + CertCloseStore(cert_mgr_index_to_store(tab, i), 0); +} + +static void refresh_store_certs(HWND hwnd) +{ + HWND lv = GetDlgItem(hwnd, IDC_MGR_CERTS); + + free_certs(lv); + SendMessageW(lv, LVM_DELETEALLITEMS, 0, 0); + show_store_certs(hwnd, cert_mgr_current_store(hwnd)); +} + +typedef enum { + CheckBitmapIndexUnchecked = 1, + CheckBitmapIndexChecked = 2, + CheckBitmapIndexDisabledUnchecked = 3, + CheckBitmapIndexDisabledChecked = 4 +} CheckBitmapIndex; + +static void add_known_usage(HWND lv, PCCRYPT_OID_INFO info, + CheckBitmapIndex state) +{ + LVITEMW item; + + item.mask = LVIF_TEXT | LVIF_STATE | LVIF_PARAM; + item.state = INDEXTOSTATEIMAGEMASK(state); + item.stateMask = LVIS_STATEIMAGEMASK; + item.iItem = SendMessageW(lv, LVM_GETITEMCOUNT, 0, 0); + item.iSubItem = 0; + item.lParam = (LPARAM)info; + item.pszText = (LPWSTR)info->pwszName; + SendMessageW(lv, LVM_INSERTITEMW, 0, (LPARAM)&item); +} + +static void add_known_usages_to_list(HWND lv, CheckBitmapIndex state) +{ + PCCRYPT_OID_INFO *usages; + + if (WTHelperGetKnownUsages(1, &usages)) + { + PCCRYPT_OID_INFO *ptr; + + for (ptr = usages; *ptr; ptr++) + add_known_usage(lv, *ptr, state); + WTHelperGetKnownUsages(2, &usages); + } +} + +static void toggle_usage(HWND hwnd, int iItem) +{ + LVITEMW item; + int res; + HWND lv = GetDlgItem(hwnd, IDC_CERTIFICATE_USAGES); + + item.mask = LVIF_STATE; + item.iItem = iItem; + item.iSubItem = 0; + item.stateMask = LVIS_STATEIMAGEMASK; + res = SendMessageW(lv, LVM_GETITEMW, 0, (LPARAM)&item); + if (res) + { + int state = item.state >> 12; + + item.state = INDEXTOSTATEIMAGEMASK( + state == CheckBitmapIndexChecked ? CheckBitmapIndexUnchecked : + CheckBitmapIndexChecked); + SendMessageW(lv, LVM_SETITEMSTATE, iItem, (LPARAM)&item); + } +} + +static LONG_PTR find_oid_in_list(HWND lv, LPCSTR oid) +{ + PCCRYPT_OID_INFO oidInfo = CryptFindOIDInfo(CRYPT_OID_INFO_OID_KEY, + (void *)oid, CRYPT_ENHKEY_USAGE_OID_GROUP_ID); + LONG_PTR ret; + + if (oidInfo) + { + LVFINDINFOW findInfo; + + findInfo.flags = LVFI_PARAM; + findInfo.lParam = (LPARAM)oidInfo; + ret = SendMessageW(lv, LVM_FINDITEMW, -1, (LPARAM)&findInfo); + } + else + { + LVFINDINFOA findInfo; + + findInfo.flags = LVFI_STRING; + findInfo.psz = oid; + ret = SendMessageW(lv, LVM_FINDITEMA, -1, (LPARAM)&findInfo); + } + return ret; +} + +static void save_cert_mgr_usages(HWND hwnd) +{ + static const WCHAR keyName[] = { 'S','o','f','t','w','a','r','e','\\','M', + 'i','c','r','o','s','o','f','t','\\','C','r','y','p','t','o','g','r','a', + 'p','h','y','\\','U','I','\\','C','e','r','t','m','g','r','\\','P','u', + 'r','p','o','s','e',0 }; + HKEY key; + HWND lv = GetDlgItem(hwnd, IDC_CERTIFICATE_USAGES); + int purposes = SendMessageW(lv, LVM_GETITEMCOUNT, 0, 0), i; + LVITEMW item; + LPSTR str = NULL; + + item.mask = LVIF_STATE | LVIF_PARAM; + item.iSubItem = 0; + item.stateMask = LVIS_STATEIMAGEMASK; + for (i = 0; i < purposes; i++) + { + item.iItem = i; + if (SendMessageW(lv, LVM_GETITEMW, 0, (LPARAM)&item)) + { + int state = item.state >> 12; + + if (state == CheckBitmapIndexUnchecked) + { + CRYPT_OID_INFO *info = (CRYPT_OID_INFO *)item.lParam; + BOOL firstString = TRUE; + + if (!str) + str = HeapAlloc(GetProcessHeap(), 0, + strlen(info->pszOID) + 1); + else + { + str = HeapReAlloc(GetProcessHeap(), 0, str, + strlen(str) + 1 + strlen(info->pszOID) + 1); + firstString = FALSE; + } + if (str) + { + LPSTR ptr = firstString ? str : str + strlen(str); + + if (!firstString) + *ptr++ = ','; + strcpy(ptr, info->pszOID); + } + } + } + } + if (!RegCreateKeyExW(HKEY_CURRENT_USER, keyName, 0, NULL, 0, KEY_ALL_ACCESS, + NULL, &key, NULL)) + { + if (str) + RegSetValueExA(key, "Purpose", 0, REG_SZ, (const BYTE *)str, + strlen(str) + 1); + else + RegDeleteValueA(key, "Purpose"); + RegCloseKey(key); + } + HeapFree(GetProcessHeap(), 0, str); +} + +static LRESULT CALLBACK cert_mgr_advanced_dlg_proc(HWND hwnd, UINT msg, + WPARAM wp, LPARAM lp) +{ + switch (msg) + { + case WM_INITDIALOG: + { + RECT rc; + LVCOLUMNW column; + HWND lv = GetDlgItem(hwnd, IDC_CERTIFICATE_USAGES); + HIMAGELIST imageList; + LPSTR disabledUsages; + + GetWindowRect(lv, &rc); + column.mask = LVCF_WIDTH; + column.cx = rc.right - rc.left; + SendMessageW(lv, LVM_INSERTCOLUMNW, 0, (LPARAM)&column); + imageList = ImageList_Create(16, 16, ILC_COLOR4 | ILC_MASK, 4, 0); + if (imageList) + { + HBITMAP bmp; + COLORREF backColor = RGB(255, 0, 255); + + bmp = LoadBitmapW(hInstance, MAKEINTRESOURCEW(IDB_CHECKS)); + ImageList_AddMasked(imageList, bmp, backColor); + DeleteObject(bmp); + ImageList_SetBkColor(imageList, CLR_NONE); + SendMessageW(lv, LVM_SETIMAGELIST, LVSIL_STATE, (LPARAM)imageList); + SetWindowLongPtrW(hwnd, DWLP_USER, (LPARAM)imageList); + } + add_known_usages_to_list(lv, CheckBitmapIndexChecked); + if ((disabledUsages = get_cert_mgr_usages())) + { + LPSTR ptr, comma; + + for (ptr = disabledUsages, comma = strchr(ptr, ','); ptr && *ptr; + ptr = comma ? comma + 1 : NULL, + comma = ptr ? strchr(ptr, ',') : NULL) + { + LONG_PTR index; + + if (comma) + *comma = 0; + if ((index = find_oid_in_list(lv, ptr)) != -1) + toggle_usage(hwnd, index); + } + HeapFree(GetProcessHeap(), 0, disabledUsages); + } + break; + } + case WM_NOTIFY: + { + NMHDR *hdr = (NMHDR *)lp; + NMITEMACTIVATE *nm; + + switch (hdr->code) + { + case NM_CLICK: + nm = (NMITEMACTIVATE *)lp; + toggle_usage(hwnd, nm->iItem); + SendMessageW(GetParent(hwnd), PSM_CHANGED, (WPARAM)hwnd, 0); + break; + } + break; + } + case WM_COMMAND: + switch (wp) + { + case IDOK: + save_cert_mgr_usages(hwnd); + ImageList_Destroy((HIMAGELIST)GetWindowLongPtrW(hwnd, DWLP_USER)); + EndDialog(hwnd, IDOK); + break; + case IDCANCEL: + ImageList_Destroy((HIMAGELIST)GetWindowLongPtrW(hwnd, DWLP_USER)); + EndDialog(hwnd, IDCANCEL); + break; + } + break; + } + return 0; +} + +static void cert_mgr_clear_cert_selection(HWND hwnd) +{ + WCHAR empty[] = { 0 }; + + EnableWindow(GetDlgItem(hwnd, IDC_MGR_EXPORT), FALSE); + EnableWindow(GetDlgItem(hwnd, IDC_MGR_REMOVE), FALSE); + EnableWindow(GetDlgItem(hwnd, IDC_MGR_VIEW), FALSE); + SendMessageW(GetDlgItem(hwnd, IDC_MGR_PURPOSES), WM_SETTEXT, 0, + (LPARAM)empty); + refresh_store_certs(hwnd); +} + +static PCCERT_CONTEXT cert_mgr_index_to_cert(HWND hwnd, int index) +{ + PCCERT_CONTEXT cert = NULL; + LVITEMW item; + + item.mask = LVIF_PARAM; + item.iItem = index; + item.iSubItem = 0; + if (SendMessageW(GetDlgItem(hwnd, IDC_MGR_CERTS), LVM_GETITEMW, 0, + (LPARAM)&item)) + cert = (PCCERT_CONTEXT)item.lParam; + return cert; +} + +static void show_selected_cert(HWND hwnd, int index) +{ + PCCERT_CONTEXT cert = cert_mgr_index_to_cert(hwnd, index); + + if (cert) + { + CRYPTUI_VIEWCERTIFICATE_STRUCTW viewInfo; + + memset(&viewInfo, 0, sizeof(viewInfo)); + viewInfo.dwSize = sizeof(viewInfo); + viewInfo.hwndParent = hwnd; + viewInfo.pCertContext = cert; + /* FIXME: this should be modal */ + CryptUIDlgViewCertificateW(&viewInfo, NULL); + } +} + +static void cert_mgr_show_cert_usages(HWND hwnd, int index) +{ + HWND text = GetDlgItem(hwnd, IDC_MGR_PURPOSES); + PCCERT_CONTEXT cert = cert_mgr_index_to_cert(hwnd, index); + PCERT_ENHKEY_USAGE usage; + DWORD size; + + /* Get enhanced key usage. Have to check for a property and an extension + * separately, because CertGetEnhancedKeyUsage will succeed and return an + * empty usage if neither is set. Unfortunately an empty usage implies + * no usage is allowed, so we have to distinguish between the two cases. + */ + if (CertGetEnhancedKeyUsage(cert, CERT_FIND_PROP_ONLY_ENHKEY_USAGE_FLAG, + NULL, &size)) + { + usage = HeapAlloc(GetProcessHeap(), 0, size); + if (!CertGetEnhancedKeyUsage(cert, + CERT_FIND_PROP_ONLY_ENHKEY_USAGE_FLAG, usage, &size)) + { + HeapFree(GetProcessHeap(), 0, usage); + usage = NULL; + } + } + else if (CertGetEnhancedKeyUsage(cert, CERT_FIND_EXT_ONLY_ENHKEY_USAGE_FLAG, + NULL, &size)) + { + usage = HeapAlloc(GetProcessHeap(), 0, size); + if (!CertGetEnhancedKeyUsage(cert, + CERT_FIND_EXT_ONLY_ENHKEY_USAGE_FLAG, usage, &size)) + { + HeapFree(GetProcessHeap(), 0, usage); + usage = NULL; + } + } + else + usage = NULL; + if (usage) + { + if (usage->cUsageIdentifier) + { + static const WCHAR commaSpace[] = { ',',' ',0 }; + DWORD i, len = 1; + LPWSTR str, ptr; + + for (i = 0; i < usage->cUsageIdentifier; i++) + { + PCCRYPT_OID_INFO info = + CryptFindOIDInfo(CRYPT_OID_INFO_OID_KEY, + usage->rgpszUsageIdentifier[i], + CRYPT_ENHKEY_USAGE_OID_GROUP_ID); + + if (info) + len += strlenW(info->pwszName); + else + len += strlen(usage->rgpszUsageIdentifier[i]); + if (i < usage->cUsageIdentifier - 1) + len += strlenW(commaSpace); + } + str = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + if (str) + { + for (i = 0, ptr = str; i < usage->cUsageIdentifier; i++) + { + PCCRYPT_OID_INFO info = + CryptFindOIDInfo(CRYPT_OID_INFO_OID_KEY, + usage->rgpszUsageIdentifier[i], + CRYPT_ENHKEY_USAGE_OID_GROUP_ID); + + if (info) + { + strcpyW(ptr, info->pwszName); + ptr += strlenW(info->pwszName); + } + else + { + LPCSTR src = usage->rgpszUsageIdentifier[i]; + + for (; *src; ptr++, src++) + *ptr = *src; + *ptr = 0; + } + if (i < usage->cUsageIdentifier - 1) + { + strcpyW(ptr, commaSpace); + ptr += strlenW(commaSpace); + } + } + *ptr = 0; + SendMessageW(text, WM_SETTEXT, 0, (LPARAM)str); + HeapFree(GetProcessHeap(), 0, str); + } + HeapFree(GetProcessHeap(), 0, usage); + } + else + { + WCHAR buf[MAX_STRING_LEN]; + + LoadStringW(hInstance, IDS_ALLOWED_PURPOSE_NONE, buf, + sizeof(buf) / sizeof(buf[0])); + SendMessageW(text, WM_SETTEXT, 0, (LPARAM)buf); + } + } + else + { + WCHAR buf[MAX_STRING_LEN]; + + LoadStringW(hInstance, IDS_ALLOWED_PURPOSE_ALL, buf, + sizeof(buf) / sizeof(buf[0])); + SendMessageW(text, WM_SETTEXT, 0, (LPARAM)buf); + } +} + +static void cert_mgr_do_remove(HWND hwnd) +{ + int tabIndex = SendMessageW(GetDlgItem(hwnd, IDC_MGR_STORES), + TCM_GETCURSEL, 0, 0); + struct CertMgrData *data = + (struct CertMgrData *)GetWindowLongPtrW(hwnd, DWLP_USER); + + if (tabIndex < data->nStores) + { + HWND lv = GetDlgItem(hwnd, IDC_MGR_CERTS); + WCHAR warning[MAX_STRING_LEN], title[MAX_STRING_LEN]; + LPCWSTR pTitle; + int warningID; + + if (SendMessageW(lv, LVM_GETSELECTEDCOUNT, 0, 0) > 1) + warningID = data->stores[tabIndex].removePluralWarning; + else + warningID = data->stores[tabIndex].removeWarning; + if (data->title) + pTitle = data->title; + else + { + LoadStringW(hInstance, IDS_CERT_MGR, title, + sizeof(title) / sizeof(title[0])); + pTitle = title; + } + LoadStringW(hInstance, warningID, warning, + sizeof(warning) / sizeof(warning[0])); + if (MessageBoxW(hwnd, warning, pTitle, MB_YESNO) == IDYES) + { + int selection = -1; + + do { + selection = SendMessageW(lv, LVM_GETNEXTITEM, selection, + LVNI_SELECTED); + if (selection >= 0) + { + PCCERT_CONTEXT cert = cert_mgr_index_to_cert(hwnd, + selection); + + CertDeleteCertificateFromStore(cert); + } + } while (selection >= 0); + cert_mgr_clear_cert_selection(hwnd); + } + } +} + +static LRESULT CALLBACK cert_mgr_dlg_proc(HWND hwnd, UINT msg, WPARAM wp, + LPARAM lp) +{ + struct CertMgrData *data; + + switch (msg) + { + case WM_INITDIALOG: + { + PCCRYPTUI_CERT_MGR_STRUCT pCryptUICertMgr = + (PCCRYPTUI_CERT_MGR_STRUCT)lp; + HWND tab = GetDlgItem(hwnd, IDC_MGR_STORES); + + data = HeapAlloc(GetProcessHeap(), 0, sizeof(struct CertMgrData)); + if (data) + { + data->imageList = ImageList_Create(16, 16, ILC_COLOR4 | ILC_MASK, + 2, 0); + if (data->imageList) + { + HBITMAP bmp; + COLORREF backColor = RGB(255, 0, 255); + + bmp = LoadBitmapW(hInstance, MAKEINTRESOURCEW(IDB_SMALL_ICONS)); + ImageList_AddMasked(data->imageList, bmp, backColor); + DeleteObject(bmp); + ImageList_SetBkColor(data->imageList, CLR_NONE); + SendMessageW(GetDlgItem(hwnd, IDC_MGR_CERTS), LVM_SETIMAGELIST, + LVSIL_SMALL, (LPARAM)data->imageList); + } + SetWindowLongPtrW(hwnd, DWLP_USER, (LPARAM)data); + data->title = pCryptUICertMgr->pwszTitle; + } + initialize_purpose_selection(hwnd); + add_cert_columns(hwnd); + if (pCryptUICertMgr->pwszTitle) + SendMessageW(hwnd, WM_SETTEXT, 0, + (LPARAM)pCryptUICertMgr->pwszTitle); + show_cert_stores(hwnd, pCryptUICertMgr->dwFlags, data); + show_store_certs(hwnd, cert_mgr_index_to_store(tab, 0)); + break; + } + case WM_NOTIFY: + { + NMHDR *hdr = (NMHDR *)lp; + + switch (hdr->code) + { + case TCN_SELCHANGE: + cert_mgr_clear_cert_selection(hwnd); + break; + case LVN_ITEMCHANGED: + { + NMITEMACTIVATE *nm; + HWND lv = GetDlgItem(hwnd, IDC_MGR_CERTS); + + nm = (NMITEMACTIVATE*)lp; + if (nm->uNewState & LVN_ITEMACTIVATE) + { + int numSelected = SendMessageW(lv, LVM_GETSELECTEDCOUNT, 0, 0); + + EnableWindow(GetDlgItem(hwnd, IDC_MGR_EXPORT), numSelected > 0); + EnableWindow(GetDlgItem(hwnd, IDC_MGR_REMOVE), numSelected > 0); + EnableWindow(GetDlgItem(hwnd, IDC_MGR_VIEW), numSelected == 1); + if (numSelected == 1) + cert_mgr_show_cert_usages(hwnd, nm->iItem); + } + break; + } + case NM_DBLCLK: + show_selected_cert(hwnd, ((NMITEMACTIVATE *)lp)->iItem); + break; + case LVN_KEYDOWN: + { + NMLVKEYDOWN *lvk = (NMLVKEYDOWN *)lp; + + if (lvk->wVKey == VK_DELETE) + cert_mgr_do_remove(hwnd); + break; + } + } + break; + } + case WM_COMMAND: + switch (wp) + { + case ((CBN_SELCHANGE << 16) | IDC_MGR_PURPOSE_SELECTION): + cert_mgr_clear_cert_selection(hwnd); + break; + case IDC_MGR_IMPORT: + if (CryptUIWizImport(0, hwnd, NULL, NULL, + cert_mgr_current_store(hwnd))) + refresh_store_certs(hwnd); + break; + case IDC_MGR_ADVANCED: + if (DialogBoxW(hInstance, MAKEINTRESOURCEW(IDD_CERT_MGR_ADVANCED), + hwnd, cert_mgr_advanced_dlg_proc) == IDOK) + { + HWND cb = GetDlgItem(hwnd, IDC_MGR_PURPOSE_SELECTION); + int index, len; + LPWSTR curString = NULL; + + index = SendMessageW(cb, CB_GETCURSEL, 0, 0); + if (index >= 0) + { + len = SendMessageW(cb, CB_GETLBTEXTLEN, index, 0); + curString = HeapAlloc(GetProcessHeap(), 0, + (len + 1) * sizeof(WCHAR)); + SendMessageW(cb, CB_GETLBTEXT, index, (LPARAM)curString); + } + SendMessageW(cb, CB_RESETCONTENT, 0, 0); + initialize_purpose_selection(hwnd); + if (curString) + { + index = SendMessageW(cb, CB_FINDSTRINGEXACT, -1, + (LPARAM)curString); + if (index >= 0) + SendMessageW(cb, CB_SETCURSEL, index, 0); + HeapFree(GetProcessHeap(), 0, curString); + } + refresh_store_certs(hwnd); + } + break; + case IDC_MGR_VIEW: + { + HWND lv = GetDlgItem(hwnd, IDC_MGR_CERTS); + int selection = SendMessageW(lv, LVM_GETNEXTITEM, -1, + LVNI_SELECTED); + + if (selection >= 0) + show_selected_cert(hwnd, selection); + break; + } + case IDC_MGR_REMOVE: + cert_mgr_do_remove(hwnd); + break; + case IDCANCEL: + free_certs(GetDlgItem(hwnd, IDC_MGR_CERTS)); + close_stores(GetDlgItem(hwnd, IDC_MGR_STORES)); + close_stores(GetDlgItem(hwnd, IDC_MGR_STORES)); + data = (struct CertMgrData *)GetWindowLongPtrW(hwnd, DWLP_USER); + ImageList_Destroy(data->imageList); + HeapFree(GetProcessHeap(), 0, data); + EndDialog(hwnd, IDCANCEL); + break; + } + break; + } + return 0; +} + /*********************************************************************** * CryptUIDlgCertMgr (CRYPTUI.@) */ BOOL WINAPI CryptUIDlgCertMgr(PCCRYPTUI_CERT_MGR_STRUCT pCryptUICertMgr) { - FIXME("(%p): stub\n", pCryptUICertMgr); - return FALSE; + TRACE("(%p)\n", pCryptUICertMgr); + + if (pCryptUICertMgr->dwSize != sizeof(CRYPTUI_CERT_MGR_STRUCT)) + { + WARN("unexpected size %d\n", pCryptUICertMgr->dwSize); + SetLastError(E_INVALIDARG); + return FALSE; + } + DialogBoxParamW(hInstance, MAKEINTRESOURCEW(IDD_CERT_MGR), + pCryptUICertMgr->hwndParent, cert_mgr_dlg_proc, (LPARAM)pCryptUICertMgr); + return TRUE; } /* FIXME: real names are unknown, functions are undocumented */ @@ -249,8 +1345,6 @@ static void free_store_info(HWND tree) } } -#define MAX_STRING_LEN 512 - static HCERTSTORE selected_item_to_store(HWND tree, HTREEITEM hItem) { WCHAR buf[MAX_STRING_LEN]; @@ -572,6 +1666,7 @@ static void add_icon_to_control(HWND hwnd, int id) HBITMAP bitmap = NULL; RECT rect; STGMEDIUM stgm; + LPOLECLIENTSITE clientSite = NULL; REOBJECT reObject; TRACE("(%p, %d)\n", hwnd, id); @@ -601,6 +1696,9 @@ static void add_icon_to_control(HWND hwnd, int id) (void**)&dataObject); if (FAILED(hr)) goto end; + hr = IRichEditOle_GetClientSite(richEditOle, &clientSite); + if (FAILED(hr)) + goto end; bitmap = LoadImageW(hInstance, MAKEINTRESOURCEW(id), IMAGE_BITMAP, 0, 0, LR_DEFAULTSIZE | LR_LOADTRANSPARENT); if (!bitmap) @@ -620,7 +1718,7 @@ static void add_icon_to_control(HWND hwnd, int id) reObject.clsid = clsid; reObject.poleobj = object; reObject.pstg = NULL; - reObject.polesite = NULL; + reObject.polesite = clientSite; reObject.sizel.cx = reObject.sizel.cy = 0; reObject.dvaspect = DVASPECT_CONTENT; reObject.dwFlags = 0; @@ -629,6 +1727,8 @@ static void add_icon_to_control(HWND hwnd, int id) IRichEditOle_InsertObject(richEditOle, &reObject); end: + if (clientSite) + IOleClientSite_Release(clientSite); if (dataObject) IDataObject_Release(dataObject); if (oleCache) @@ -1903,13 +3003,6 @@ static void create_cert_details_list(HWND hwnd, struct detail_data *data) set_fields_selection(hwnd, data, 0); } -typedef enum { - CheckBitmapIndexUnchecked = 1, - CheckBitmapIndexChecked = 2, - CheckBitmapIndexDisabledUnchecked = 3, - CheckBitmapIndexDisabledChecked = 4 -} CheckBitmapIndex; - static void add_purpose(HWND hwnd, LPCSTR oid) { HWND lv = GetDlgItem(hwnd, IDC_CERTIFICATE_USAGES); @@ -1981,30 +3074,8 @@ static BOOL is_valid_oid(LPCSTR oid) static BOOL is_oid_in_list(HWND hwnd, LPCSTR oid) { - HWND lv = GetDlgItem(hwnd, IDC_CERTIFICATE_USAGES); - PCCRYPT_OID_INFO oidInfo = CryptFindOIDInfo(CRYPT_OID_INFO_OID_KEY, - (void *)oid, CRYPT_ENHKEY_USAGE_OID_GROUP_ID); - BOOL ret = FALSE; - - if (oidInfo) - { - LVFINDINFOW findInfo; - - findInfo.flags = LVFI_PARAM; - findInfo.lParam = (LPARAM)oidInfo; - if (SendMessageW(lv, LVM_FINDITEMW, -1, (LPARAM)&findInfo) != -1) - ret = TRUE; - } - else - { - LVFINDINFOA findInfo; - - findInfo.flags = LVFI_STRING; - findInfo.psz = oid; - if (SendMessageW(lv, LVM_FINDITEMA, -1, (LPARAM)&findInfo) != -1) - ret = TRUE; - } - return ret; + return find_oid_in_list(GetDlgItem(hwnd, IDC_CERTIFICATE_USAGES), oid) + != -1; } #define MAX_PURPOSE 255 @@ -2189,23 +3260,6 @@ static void select_purposes(HWND hwnd, PurposeSelection selection) } } -extern BOOL WINAPI WTHelperGetKnownUsages(DWORD action, - PCCRYPT_OID_INFO **usages); - -static void add_known_usage(HWND lv, PCCRYPT_OID_INFO info) -{ - LVITEMW item; - - item.mask = LVIF_TEXT | LVIF_STATE | LVIF_PARAM; - item.state = INDEXTOSTATEIMAGEMASK(CheckBitmapIndexDisabledChecked); - item.stateMask = LVIS_STATEIMAGEMASK; - item.iItem = SendMessageW(lv, LVM_GETITEMCOUNT, 0, 0); - item.iSubItem = 0; - item.lParam = (LPARAM)info; - item.pszText = (LPWSTR)info->pwszName; - SendMessageW(lv, LVM_INSERTITEMW, 0, (LPARAM)&item); -} - struct edit_cert_data { PCCERT_CONTEXT cert; @@ -2219,7 +3273,6 @@ static void show_cert_usages(HWND hwnd, struct edit_cert_data *data) HWND lv = GetDlgItem(hwnd, IDC_CERTIFICATE_USAGES); PCERT_ENHKEY_USAGE usage; DWORD size; - PCCRYPT_OID_INFO *usages; RECT rc; LVCOLUMNW column; PurposeSelection purposeSelection; @@ -2280,23 +3333,14 @@ static void show_cert_usages(HWND hwnd, struct edit_cert_data *data) usage->rgpszUsageIdentifier[i], CRYPT_ENHKEY_USAGE_OID_GROUP_ID); if (info) - add_known_usage(lv, info); + add_known_usage(lv, info, CheckBitmapIndexDisabledChecked); else add_purpose(hwnd, usage->rgpszUsageIdentifier[i]); } HeapFree(GetProcessHeap(), 0, usage); } else - { - if (WTHelperGetKnownUsages(1, &usages)) - { - PCCRYPT_OID_INFO *ptr; - - for (ptr = usages; *ptr; ptr++) - add_known_usage(lv, *ptr); - WTHelperGetKnownUsages(2, &usages); - } - } + add_known_usages_to_list(lv, CheckBitmapIndexDisabledChecked); select_purposes(hwnd, purposeSelection); SendMessageW(GetDlgItem(hwnd, IDC_ENABLE_ALL_PURPOSES + purposeSelection), BM_CLICK, 0, 0); @@ -2322,28 +3366,6 @@ static void set_general_cert_properties(HWND hwnd, struct edit_cert_data *data) show_cert_usages(hwnd, data); } -static void toggle_usage(HWND hwnd, int iItem) -{ - LVITEMW item; - int res; - HWND lv = GetDlgItem(hwnd, IDC_CERTIFICATE_USAGES); - - item.mask = LVIF_STATE; - item.iItem = iItem; - item.iSubItem = 0; - item.stateMask = LVIS_STATEIMAGEMASK; - res = SendMessageW(lv, LVM_GETITEMW, 0, (LPARAM)&item); - if (res) - { - int state = item.state >> 12; - - item.state = INDEXTOSTATEIMAGEMASK( - state == CheckBitmapIndexChecked ? CheckBitmapIndexUnchecked : - CheckBitmapIndexChecked); - SendMessageW(lv, LVM_SETITEMSTATE, iItem, (LPARAM)&item); - } -} - static void set_cert_string_property(PCCERT_CONTEXT cert, DWORD prop, LPWSTR str) { @@ -3391,15 +4413,12 @@ static BOOL is_ca_cert(PCCERT_CONTEXT cert, BOOL defaultIfNotSpecified) static HCERTSTORE choose_store_for_cert(PCCERT_CONTEXT cert) { - static const WCHAR AddressBook[] = { 'A','d','d','r','e','s','s', - 'B','o','o','k',0 }; - static const WCHAR CA[] = { 'C','A',0 }; LPCWSTR storeName; if (is_ca_cert(cert, TRUE)) - storeName = CA; + storeName = ca; else - storeName = AddressBook; + storeName = addressBook; return CertOpenStore(CERT_STORE_PROV_SYSTEM_W, 0, 0, CERT_SYSTEM_STORE_CURRENT_USER, storeName); } @@ -3442,8 +4461,6 @@ static BOOL import_crl(PCCRL_CONTEXT crl, HCERTSTORE hDestCertStore) if (hDestCertStore) store = hDestCertStore; else { - static const WCHAR ca[] = { 'C','A',0 }; - if (!(store = CertOpenStore(CERT_STORE_PROV_SYSTEM_W, 0, 0, CERT_SYSTEM_STORE_CURRENT_USER, ca))) { @@ -3995,11 +5012,29 @@ static LRESULT CALLBACK import_store_dlg_proc(HWND hwnd, UINT msg, WPARAM wp, data = (struct ImportWizData *)page->lParam; SetWindowLongPtrW(hwnd, DWLP_USER, (LPARAM)data); - SendMessageW(GetDlgItem(hwnd, IDC_IMPORT_AUTO_STORE), BM_CLICK, 0, 0); - if (data->dwFlags & CRYPTUI_WIZ_IMPORT_NO_CHANGE_DEST_STORE) + if (!data->hDestCertStore) + { + SendMessageW(GetDlgItem(hwnd, IDC_IMPORT_AUTO_STORE), BM_CLICK, + 0, 0); + EnableWindow(GetDlgItem(hwnd, IDC_IMPORT_STORE), FALSE); + EnableWindow(GetDlgItem(hwnd, IDC_IMPORT_BROWSE_STORE), FALSE); EnableWindow(GetDlgItem(hwnd, IDC_IMPORT_SPECIFY_STORE), FALSE); - EnableWindow(GetDlgItem(hwnd, IDC_IMPORT_STORE), FALSE); - EnableWindow(GetDlgItem(hwnd, IDC_IMPORT_BROWSE_STORE), FALSE); + } + else + { + WCHAR storeTitle[MAX_STRING_LEN]; + + SendMessageW(GetDlgItem(hwnd, IDC_IMPORT_SPECIFY_STORE), BM_CLICK, + 0, 0); + EnableWindow(GetDlgItem(hwnd, IDC_IMPORT_STORE), TRUE); + EnableWindow(GetDlgItem(hwnd, IDC_IMPORT_BROWSE_STORE), TRUE); + EnableWindow(GetDlgItem(hwnd, IDC_IMPORT_SPECIFY_STORE), + !(data->dwFlags & CRYPTUI_WIZ_IMPORT_NO_CHANGE_DEST_STORE)); + LoadStringW(hInstance, IDS_IMPORT_DEST_DETERMINED, + storeTitle, sizeof(storeTitle) / sizeof(storeTitle[0])); + SendMessageW(GetDlgItem(hwnd, IDC_IMPORT_STORE), WM_SETTEXT, + 0, (LPARAM)storeTitle); + } break; } case WM_NOTIFY: diff --git a/dlls/d3d8/surface.c b/dlls/d3d8/surface.c index 6ecd7af8c8f..0d06da26938 100644 --- a/dlls/d3d8/surface.c +++ b/dlls/d3d8/surface.c @@ -206,7 +206,11 @@ static HRESULT WINAPI IDirect3DSurface8Impl_UnlockRect(LPDIRECT3DSURFACE8 iface) EnterCriticalSection(&d3d8_cs); hr = IWineD3DSurface_UnlockRect(This->wineD3DSurface); LeaveCriticalSection(&d3d8_cs); - return hr; + switch(hr) + { + case WINEDDERR_NOTLOCKED: return D3DERR_INVALIDCALL; + default: return hr; + } } const IDirect3DSurface8Vtbl Direct3DSurface8_Vtbl = diff --git a/dlls/d3d9/surface.c b/dlls/d3d9/surface.c index 394d52786af..a626049df53 100644 --- a/dlls/d3d9/surface.c +++ b/dlls/d3d9/surface.c @@ -241,7 +241,11 @@ static HRESULT WINAPI IDirect3DSurface9Impl_UnlockRect(LPDIRECT3DSURFACE9 iface) EnterCriticalSection(&d3d9_cs); hr = IWineD3DSurface_UnlockRect(This->wineD3DSurface); LeaveCriticalSection(&d3d9_cs); - return hr; + switch(hr) + { + case WINEDDERR_NOTLOCKED: return D3DERR_INVALIDCALL; + default: return hr; + } } static HRESULT WINAPI IDirect3DSurface9Impl_GetDC(LPDIRECT3DSURFACE9 iface, HDC* phdc) { diff --git a/dlls/d3dxof/parsing.c b/dlls/d3dxof/parsing.c index d4c71d17bcc..41675972e60 100644 --- a/dlls/d3dxof/parsing.c +++ b/dlls/d3dxof/parsing.c @@ -762,7 +762,7 @@ static inline BOOL is_primitive_type(WORD token) return ret; } -BOOL parse_template_option_info(parse_buffer * buf) +static BOOL parse_template_option_info(parse_buffer * buf) { xtemplate* cur_template = &buf->pdxf->xtemplates[buf->pdxf->nb_xtemplates]; diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index 286e4b32f07..5a24ddb5626 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -2432,6 +2432,7 @@ IDirectDrawImpl_CreateSurface(IDirectDraw7 *iface, LONG extra_surfaces = 0; DDSURFACEDESC2 desc2; WINED3DDISPLAYMODE Mode; + const DWORD sysvidmem = DDSCAPS_VIDEOMEMORY | DDSCAPS_SYSTEMMEMORY; TRACE("(%p)->(%p,%p,%p)\n", This, DDSD, Surf, UnkOuter); @@ -2490,6 +2491,16 @@ IDirectDrawImpl_CreateSurface(IDirectDraw7 *iface, LeaveCriticalSection(&ddraw_cs); return DDERR_INVALIDCAPS; } + + if((DDSD->ddsCaps.dwCaps & sysvidmem) == sysvidmem) + { + /* This is a special switch in ddrawex.dll, but not allowed in ddraw.dll */ + WARN("Application tries to put the surface in both system and video memory\n"); + LeaveCriticalSection(&ddraw_cs); + *Surf = NULL; + return DDERR_INVALIDCAPS; + } + /* Check cube maps but only if the size includes them */ if (DDSD->dwSize >= sizeof(DDSURFACEDESC2)) { diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index ab6623a4098..819b07bda95 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -85,6 +85,7 @@ static inline WORD d3d_fpu_setup(void) FIXME("FPUPRESERVE not implemented for this platform / compiler\n"); warned = TRUE; } + return 0; #endif set_fpu_control_word(0x37f); @@ -4003,9 +4004,9 @@ IDirect3DDeviceImpl_7_DrawPrimitiveStrided(IDirect3DDevice7 *iface, if (VertexType & D3DFVF_XYZRHW) { WineD3DStrided.u.s.position.dwType = WINED3DDECLTYPE_FLOAT4; - WineD3DStrided.u.s.position_transformed = TRUE; + WineD3DStrided.position_transformed = TRUE; } else - WineD3DStrided.u.s.position_transformed = FALSE; + WineD3DStrided.position_transformed = FALSE; } if(VertexType & D3DFVF_NORMAL) @@ -4181,9 +4182,9 @@ IDirect3DDeviceImpl_7_DrawIndexedPrimitiveStrided(IDirect3DDevice7 *iface, if (VertexType & D3DFVF_XYZRHW) { WineD3DStrided.u.s.position.dwType = WINED3DDECLTYPE_FLOAT4; - WineD3DStrided.u.s.position_transformed = TRUE; + WineD3DStrided.position_transformed = TRUE; } else - WineD3DStrided.u.s.position_transformed = FALSE; + WineD3DStrided.position_transformed = FALSE; } if(VertexType & D3DFVF_NORMAL) diff --git a/dlls/ddraw/tests/dsurface.c b/dlls/ddraw/tests/dsurface.c index 68a51cdd55f..a12b9683585 100644 --- a/dlls/ddraw/tests/dsurface.c +++ b/dlls/ddraw/tests/dsurface.c @@ -2746,6 +2746,16 @@ static void SurfaceCapsTest(void) IDirectDraw7_Release(dd7); } + + memset(&create, 0, sizeof(create)); + create.dwSize = sizeof(create); + create.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; + create.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY | DDSCAPS_VIDEOMEMORY; + create.dwWidth = 64; + create.dwHeight = 64; + hr = IDirectDraw_CreateSurface(lpDD, &create, &surface1, NULL); + ok(hr == DDERR_INVALIDCAPS, "Creating a SYSMEM | VIDMEM surface returned 0x%08x, expected DDERR_INVALIDCAPS\n", hr); + if(surface1) IDirectDrawSurface_Release(surface1); } static BOOL can_create_primary_surface(void) diff --git a/dlls/ddrawex/Makefile.in b/dlls/ddrawex/Makefile.in index 8cf514b628a..f2ec08082e7 100644 --- a/dlls/ddrawex/Makefile.in +++ b/dlls/ddrawex/Makefile.in @@ -6,8 +6,10 @@ MODULE = ddrawex.dll IMPORTS = dxguid uuid ddraw ole32 advapi32 kernel32 C_SRCS = \ + ddraw.c \ main.c \ - regsvr.c + regsvr.c \ + surface.c @MAKE_DLL_RULES@ diff --git a/dlls/ddrawex/ddraw.c b/dlls/ddrawex/ddraw.c new file mode 100644 index 00000000000..9e8066a038d --- /dev/null +++ b/dlls/ddrawex/ddraw.c @@ -0,0 +1,1563 @@ +/* + * Copyright 2008 Stefan Dösinger for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ +#include "wine/debug.h" + +#define COBJMACROS + +#include "winbase.h" +#include "wingdi.h" + +#include "ddraw.h" +#include "d3d.h" + +#include "ddrawex_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(ddrawex); + +/****************************************************************************** + * Helper functions for COM management + ******************************************************************************/ +static IDirectDrawImpl *impl_from_dd1(IDirectDraw *iface) +{ + return (IDirectDrawImpl *)((char*)iface - FIELD_OFFSET(IDirectDrawImpl, IDirectDraw_Vtbl)); +} +static IDirectDraw *dd1_from_impl(IDirectDrawImpl *This) +{ + return (IDirectDraw *) &This->IDirectDraw_Vtbl; +} + +static IDirectDrawImpl *impl_from_dd2(IDirectDraw2 *iface) +{ + return (IDirectDrawImpl *)((char*)iface - FIELD_OFFSET(IDirectDrawImpl, IDirectDraw2_Vtbl)); +} +static IDirectDraw2 *dd2_from_impl(IDirectDrawImpl *This) +{ + return (IDirectDraw2 *) &This->IDirectDraw2_Vtbl; +} + +static IDirectDrawImpl *impl_from_dd3(IDirectDraw3 *iface) +{ + return (IDirectDrawImpl *)((char*)iface - FIELD_OFFSET(IDirectDrawImpl, IDirectDraw3_Vtbl)); +} +static IDirectDraw3 *dd3_from_impl(IDirectDrawImpl *This) +{ + return (IDirectDraw3 *) &This->IDirectDraw3_Vtbl; +} + +static IDirectDrawImpl *impl_from_dd4(IDirectDraw4 *iface) +{ + return (IDirectDrawImpl *)((char*)iface - FIELD_OFFSET(IDirectDrawImpl, IDirectDraw4_Vtbl)); +} +static IDirectDraw4 *dd4_from_impl(IDirectDrawImpl *This) +{ + return (IDirectDraw4 *) &This->IDirectDraw4_Vtbl; +} + +/****************************************************************************** + * IDirectDraw4 -> ddraw.dll wrappers + ******************************************************************************/ +static HRESULT WINAPI +IDirectDraw4Impl_QueryInterface(IDirectDraw4 *iface, + REFIID refiid, + void **obj) +{ + IDirectDrawImpl *This = impl_from_dd4(iface); + + TRACE("(%p)->(%s,%p)\n", This, debugstr_guid(refiid), obj); + *obj = NULL; + + if(!refiid) + { + return DDERR_INVALIDPARAMS; + } + + if (IsEqualGUID( &IID_IDirectDraw7, refiid ) ) + { + WARN("IDirectDraw7 not allowed in ddrawex.dll\n"); + return E_NOINTERFACE; + } + else if ( IsEqualGUID( &IID_IUnknown, refiid ) || + IsEqualGUID( &IID_IDirectDraw4, refiid ) ) + { + *obj = dd4_from_impl(This); + TRACE("(%p) Returning IDirectDraw4 interface at %p\n", This, *obj); + IDirectDraw4_AddRef((IDirectDraw4 *) *obj); + } + else if ( IsEqualGUID( &IID_IDirectDraw3, refiid ) ) + { + *obj = dd3_from_impl(This); + TRACE("(%p) Returning IDirectDraw3 interface at %p\n", This, *obj); + IDirectDraw3_AddRef((IDirectDraw3 *) *obj); + } + else if ( IsEqualGUID( &IID_IDirectDraw2, refiid ) ) + { + *obj = dd2_from_impl(This); + TRACE("(%p) Returning IDirectDraw2 interface at %p\n", This, *obj); + IDirectDraw2_AddRef((IDirectDraw2 *) *obj); + } + else if ( IsEqualGUID( &IID_IDirectDraw, refiid ) ) + { + *obj = dd1_from_impl(This); + TRACE("(%p) Returning IDirectDraw interface at %p\n", This, *obj); + IDirectDraw_AddRef((IDirectDraw *) *obj); + } + else if ( IsEqualGUID( &IID_IDirect3D , refiid ) || + IsEqualGUID( &IID_IDirect3D2 , refiid ) || + IsEqualGUID( &IID_IDirect3D3 , refiid ) || + IsEqualGUID( &IID_IDirect3D7 , refiid ) ) + { + WARN("Direct3D not allowed in ddrawex.dll\n"); + return E_NOINTERFACE; + } + /* Unknown interface */ + else + { + ERR("(%p)->(%s, %p): No interface found\n", This, debugstr_guid(refiid), obj); + return E_NOINTERFACE; + } + TRACE("Returning S_OK\n"); + return S_OK; +} + +static HRESULT WINAPI +IDirectDraw3Impl_QueryInterface(IDirectDraw3 *iface, + REFIID refiid, + void **obj) +{ + IDirectDrawImpl *This = impl_from_dd3(iface); + TRACE("Thunking to IDirectDraw4\n"); + return IDirectDraw4_QueryInterface(dd4_from_impl(This), refiid, obj); +} + +static HRESULT WINAPI +IDirectDraw2Impl_QueryInterface(IDirectDraw2 *iface, + REFIID refiid, + void **obj) +{ + IDirectDrawImpl *This = impl_from_dd2(iface); + TRACE("Thunking to IDirectDraw4\n"); + return IDirectDraw4_QueryInterface(dd4_from_impl(This), refiid, obj); +} + +static HRESULT WINAPI +IDirectDrawImpl_QueryInterface(IDirectDraw *iface, + REFIID refiid, + void **obj) +{ + IDirectDrawImpl *This = impl_from_dd1(iface); + TRACE("Thunking to IDirectDraw4\n"); + return IDirectDraw4_QueryInterface(dd4_from_impl(This), refiid, obj); +} + +static ULONG WINAPI +IDirectDraw4Impl_AddRef(IDirectDraw4 *iface) +{ + IDirectDrawImpl *This = impl_from_dd4(iface); + ULONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) : incrementing refcount from %u.\n", This, ref - 1); + + return ref; +} + +static ULONG WINAPI +IDirectDraw3Impl_AddRef(IDirectDraw3 *iface) +{ + IDirectDrawImpl *This = impl_from_dd3(iface); + TRACE("Thunking to IDirectDraw4\n"); + return IDirectDraw4_AddRef(dd4_from_impl(This)); +} + +static ULONG WINAPI +IDirectDraw2Impl_AddRef(IDirectDraw2 *iface) +{ + IDirectDrawImpl *This = impl_from_dd2(iface); + TRACE("Thunking to IDirectDraw4\n"); + return IDirectDraw4_AddRef(dd4_from_impl(This)); +} + +static ULONG WINAPI +IDirectDrawImpl_AddRef(IDirectDraw *iface) +{ + IDirectDrawImpl *This = impl_from_dd1(iface); + TRACE("Thunking to IDirectDraw4\n"); + return IDirectDraw4_AddRef(dd4_from_impl(This)); +} + +static ULONG WINAPI +IDirectDraw4Impl_Release(IDirectDraw4 *iface) +{ + IDirectDrawImpl *This = impl_from_dd4(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) : decrementing refcount to %u.\n", This, ref); + + if(ref == 0) + { + TRACE("Destroying object\n"); + IDirectDraw4_Release(This->parent); + HeapFree(GetProcessHeap(), 0, This); + } + return ref; +} + +static ULONG WINAPI +IDirectDraw3Impl_Release(IDirectDraw3 *iface) +{ + IDirectDrawImpl *This = impl_from_dd3(iface); + TRACE("Thunking to IDirectDraw4\n"); + return IDirectDraw4_Release(dd4_from_impl(This)); +} + +static ULONG WINAPI +IDirectDraw2Impl_Release(IDirectDraw2 *iface) +{ + IDirectDrawImpl *This = impl_from_dd2(iface); + TRACE("Thunking to IDirectDraw4\n"); + return IDirectDraw4_Release(dd4_from_impl(This)); +} + +static ULONG WINAPI +IDirectDrawImpl_Release(IDirectDraw *iface) +{ + IDirectDrawImpl *This = impl_from_dd1(iface); + TRACE("Thunking to IDirectDraw4\n"); + return IDirectDraw4_Release(dd4_from_impl(This)); +} + +static HRESULT WINAPI +IDirectDraw4Impl_Compact(IDirectDraw4 *iface) +{ + IDirectDrawImpl *This = impl_from_dd4(iface); + TRACE("(%p)\n", This); + + return IDirectDraw4_Compact(This->parent); +} + +static HRESULT WINAPI +IDirectDraw3Impl_Compact(IDirectDraw3 *iface) +{ + IDirectDrawImpl *This = impl_from_dd3(iface); + TRACE("Thunking to IDirectDraw4\n"); + return IDirectDraw4_Compact(dd4_from_impl(This)); +} + +static HRESULT WINAPI +IDirectDraw2Impl_Compact(IDirectDraw2 *iface) +{ + IDirectDrawImpl *This = impl_from_dd2(iface); + TRACE("Thunking to IDirectDraw4\n"); + return IDirectDraw4_Compact(dd4_from_impl(This)); +} + +static HRESULT WINAPI +IDirectDrawImpl_Compact(IDirectDraw *iface) +{ + IDirectDrawImpl *This = impl_from_dd1(iface); + TRACE("Thunking to IDirectDraw4\n"); + return IDirectDraw4_Compact(dd4_from_impl(This)); +} + +static HRESULT WINAPI +IDirectDraw4Impl_CreateClipper(IDirectDraw4 *iface, + DWORD Flags, + IDirectDrawClipper **clipper, + IUnknown *UnkOuter) +{ + IDirectDrawImpl *This = impl_from_dd4(iface); + TRACE("(%p)->(0x%08x, %p, %p)\n", This, Flags, clipper, UnkOuter); + + if(UnkOuter != NULL) + { + /* This may require a wrapper interface for clippers too which handles this */ + FIXME("Test and implement Aggregation for ddrawex clippers\n"); + } + + return IDirectDraw4_CreateClipper(This->parent, Flags, clipper, UnkOuter); +} + +static HRESULT WINAPI +IDirectDraw3Impl_CreateClipper(IDirectDraw3 *iface, + DWORD Flags, + IDirectDrawClipper **clipper, + IUnknown *UnkOuter) +{ + IDirectDrawImpl *This = impl_from_dd3(iface); + TRACE("Thunking to IDirectDraw4\n"); + return IDirectDraw4_CreateClipper(dd4_from_impl(This), Flags, clipper, UnkOuter); +} + +static HRESULT WINAPI +IDirectDraw2Impl_CreateClipper(IDirectDraw2 *iface, + DWORD Flags, + IDirectDrawClipper **clipper, + IUnknown *UnkOuter) +{ + IDirectDrawImpl *This = impl_from_dd2(iface); + TRACE("Thunking to IDirectDraw4\n"); + return IDirectDraw4_CreateClipper(dd4_from_impl(This), Flags, clipper, UnkOuter); +} + +static HRESULT WINAPI +IDirectDrawImpl_CreateClipper(IDirectDraw *iface, + DWORD Flags, + IDirectDrawClipper **clipper, + IUnknown *UnkOuter) +{ + IDirectDrawImpl *This = impl_from_dd1(iface); + TRACE("Thunking to IDirectDraw4\n"); + return IDirectDraw4_CreateClipper(dd4_from_impl(This), Flags, clipper, UnkOuter); +} + +static HRESULT WINAPI +IDirectDraw4Impl_CreatePalette(IDirectDraw4 *iface, + DWORD Flags, + PALETTEENTRY *ColorTable, + IDirectDrawPalette **Palette, + IUnknown *UnkOuter) +{ + IDirectDrawImpl *This = impl_from_dd4(iface); + TRACE("(%p)(0x%08x,%p,%p,%p)\n", This, Flags, ColorTable, Palette, UnkOuter); + + if(UnkOuter != NULL) + { + /* This may require a wrapper interface for palettes too which handles this */ + FIXME("Test and implement Aggregation for ddrawex palettes\n"); + } + + return IDirectDraw4_CreatePalette(This->parent, Flags, ColorTable, Palette, UnkOuter); +} + +static HRESULT WINAPI +IDirectDraw3Impl_CreatePalette(IDirectDraw3 *iface, + DWORD Flags, + PALETTEENTRY *ColorTable, + IDirectDrawPalette **Palette, + IUnknown *UnkOuter) +{ + IDirectDrawImpl *This = impl_from_dd3(iface); + TRACE("Thunking to IDirectDraw4\n"); + return IDirectDraw4_CreatePalette(dd4_from_impl(This), Flags, ColorTable, Palette, UnkOuter); +} + +static HRESULT WINAPI +IDirectDraw2Impl_CreatePalette(IDirectDraw2 *iface, + DWORD Flags, + PALETTEENTRY *ColorTable, + IDirectDrawPalette **Palette, + IUnknown *UnkOuter) +{ + IDirectDrawImpl *This = impl_from_dd2(iface); + TRACE("Thunking to IDirectDraw4\n"); + return IDirectDraw4_CreatePalette(dd4_from_impl(This), Flags, ColorTable, Palette, UnkOuter); +} + +static HRESULT WINAPI +IDirectDrawImpl_CreatePalette(IDirectDraw *iface, + DWORD Flags, + PALETTEENTRY *ColorTable, + IDirectDrawPalette **Palette, + IUnknown *UnkOuter) +{ + IDirectDrawImpl *This = impl_from_dd1(iface); + TRACE("Thunking to IDirectDraw4\n"); + return IDirectDraw4_CreatePalette(dd4_from_impl(This), Flags, ColorTable, Palette, UnkOuter); +} + +static HRESULT WINAPI +IDirectDraw4Impl_CreateSurface(IDirectDraw4 *iface, + DDSURFACEDESC2 *DDSD, + IDirectDrawSurface4 **Surf, + IUnknown *UnkOuter) +{ + IDirectDrawImpl *This = impl_from_dd4(iface); + HRESULT hr; + const DWORD perm_dc_flags = DDSCAPS_VIDEOMEMORY | DDSCAPS_SYSTEMMEMORY; + BOOL permanent_dc; + TRACE("(%p)(%p, %p, %p)\n", This, DDSD, Surf, UnkOuter); + + if(UnkOuter != NULL) + { + /* Handle this in this dll. Don't forward the UnkOuter to ddraw.dll */ + FIXME("Implement aggregation for ddrawex surfaces\n"); + } + + /* plain ddraw.dll refuses to create a surface that has both VIDMEM and SYSMEM flags + * set. In ddrawex this succeeds, and the GetDC() call changes the behavior. The DC + * is permanently valid, and the surface can be locked between GetDC() and ReleaseDC() + * calls. GetDC() can be called more than once too + */ + if((DDSD->ddsCaps.dwCaps & perm_dc_flags) == perm_dc_flags) + { + permanent_dc = TRUE; + DDSD->ddsCaps.dwCaps &= ~DDSCAPS_VIDEOMEMORY; + DDSD->ddsCaps.dwCaps |= DDSCAPS_OWNDC; + } + else + { + permanent_dc = FALSE; + } + + hr = IDirectDraw4_CreateSurface(This->parent, DDSD, Surf, UnkOuter); + *Surf = dds_get_outer(*Surf); + if(permanent_dc) prepare_permanent_dc(*Surf); + return hr; +} + +void DDSD_to_DDSD2(const DDSURFACEDESC *in, DDSURFACEDESC2 *out) +{ + memset(out, 0, sizeof(*out)); + out->dwSize = sizeof(*out); + out->dwFlags = in->dwFlags; + if(in->dwFlags & DDSD_WIDTH) out->dwWidth = in->dwWidth; + if(in->dwFlags & DDSD_HEIGHT) out->dwHeight = in->dwHeight; + if(in->dwFlags & DDSD_PIXELFORMAT) out->ddpfPixelFormat = in->ddpfPixelFormat; + if(in->dwFlags & DDSD_CAPS) out->ddsCaps.dwCaps = in->ddsCaps.dwCaps; + if(in->dwFlags & DDSD_PITCH) out->lPitch = in->lPitch; + if(in->dwFlags & DDSD_BACKBUFFERCOUNT) out->dwBackBufferCount = in->dwBackBufferCount; + if(in->dwFlags & DDSD_ZBUFFERBITDEPTH) out->dwMipMapCount = in->dwZBufferBitDepth; /* same union */ + if(in->dwFlags & DDSD_ALPHABITDEPTH) out->dwAlphaBitDepth = in->dwAlphaBitDepth; + /* DDraw(native, and wine) does not set the DDSD_LPSURFACE, so always copy */ + out->lpSurface = in->lpSurface; + if(in->dwFlags & DDSD_CKDESTOVERLAY) out->ddckCKDestOverlay = in->ddckCKDestOverlay; + if(in->dwFlags & DDSD_CKDESTBLT) out->ddckCKDestBlt = in->ddckCKDestBlt; + if(in->dwFlags & DDSD_CKSRCOVERLAY) out->ddckCKSrcOverlay = in->ddckCKSrcOverlay; + if(in->dwFlags & DDSD_CKSRCBLT) out->ddckCKSrcBlt = in->ddckCKSrcBlt; + if(in->dwFlags & DDSD_MIPMAPCOUNT) out->dwMipMapCount = in->dwMipMapCount; + if(in->dwFlags & DDSD_REFRESHRATE) out->dwRefreshRate = in->dwRefreshRate; + if(in->dwFlags & DDSD_LINEARSIZE) out->dwLinearSize = in->dwLinearSize; + /* Does not exist in DDSURFACEDESC: + * DDSD_TEXTURESTAGE, DDSD_FVF, DDSD_SRCVBHANDLE, + */ +} + +void DDSD2_to_DDSD(const DDSURFACEDESC2 *in, DDSURFACEDESC *out) +{ + memset(out, 0, sizeof(*out)); + out->dwSize = sizeof(*out); + out->dwFlags = in->dwFlags; + if(in->dwFlags & DDSD_WIDTH) out->dwWidth = in->dwWidth; + if(in->dwFlags & DDSD_HEIGHT) out->dwHeight = in->dwHeight; + if(in->dwFlags & DDSD_PIXELFORMAT) out->ddpfPixelFormat = in->ddpfPixelFormat; + if(in->dwFlags & DDSD_CAPS) out->ddsCaps.dwCaps = in->ddsCaps.dwCaps; + if(in->dwFlags & DDSD_PITCH) out->lPitch = in->lPitch; + if(in->dwFlags & DDSD_BACKBUFFERCOUNT) out->dwBackBufferCount = in->dwBackBufferCount; + if(in->dwFlags & DDSD_ZBUFFERBITDEPTH) out->dwZBufferBitDepth = in->dwMipMapCount; /* same union */ + if(in->dwFlags & DDSD_ALPHABITDEPTH) out->dwAlphaBitDepth = in->dwAlphaBitDepth; + /* DDraw(native, and wine) does not set the DDSD_LPSURFACE, so always copy */ + out->lpSurface = in->lpSurface; + if(in->dwFlags & DDSD_CKDESTOVERLAY) out->ddckCKDestOverlay = in->ddckCKDestOverlay; + if(in->dwFlags & DDSD_CKDESTBLT) out->ddckCKDestBlt = in->ddckCKDestBlt; + if(in->dwFlags & DDSD_CKSRCOVERLAY) out->ddckCKSrcOverlay = in->ddckCKSrcOverlay; + if(in->dwFlags & DDSD_CKSRCBLT) out->ddckCKSrcBlt = in->ddckCKSrcBlt; + if(in->dwFlags & DDSD_MIPMAPCOUNT) out->dwMipMapCount = in->dwMipMapCount; + if(in->dwFlags & DDSD_REFRESHRATE) out->dwRefreshRate = in->dwRefreshRate; + if(in->dwFlags & DDSD_LINEARSIZE) out->dwLinearSize = in->dwLinearSize; + /* Does not exist in DDSURFACEDESC: + * DDSD_TEXTURESTAGE, DDSD_FVF, DDSD_SRCVBHANDLE, + */ + if(in->dwFlags & DDSD_TEXTURESTAGE) WARN("Does not exist in DDSURFACEDESC: DDSD_TEXTURESTAGE\n"); + if(in->dwFlags & DDSD_FVF) WARN("Does not exist in DDSURFACEDESC: DDSD_FVF\n"); + if(in->dwFlags & DDSD_SRCVBHANDLE) WARN("Does not exist in DDSURFACEDESC: DDSD_SRCVBHANDLE\n"); + out->dwFlags &= ~(DDSD_TEXTURESTAGE | DDSD_FVF | DDSD_SRCVBHANDLE); +} + +static HRESULT WINAPI +IDirectDraw3Impl_CreateSurface(IDirectDraw3 *iface, + DDSURFACEDESC *DDSD, + IDirectDrawSurface **Surf, + IUnknown *UnkOuter) +{ + IDirectDrawImpl *This = impl_from_dd3(iface); + DDSURFACEDESC2 ddsd2; + IDirectDrawSurface4 *surf4 = NULL; + HRESULT hr; + TRACE("Thunking to IDirectDraw4\n"); + + DDSD_to_DDSD2(DDSD, &ddsd2); + + hr = IDirectDraw4_CreateSurface(dd4_from_impl(This), &ddsd2, &surf4, UnkOuter); + if(FAILED(hr)) + { + *Surf = NULL; + return hr; + } + + TRACE("Got surface %p\n", surf4); + IDirectDrawSurface4_QueryInterface(surf4, &IID_IDirectDrawSurface, (void **) Surf); + IDirectDrawSurface4_Release(surf4); + return hr; +} + +static HRESULT WINAPI +IDirectDraw2Impl_CreateSurface(IDirectDraw2 *iface, + DDSURFACEDESC *DDSD, + IDirectDrawSurface **Surf, + IUnknown *UnkOuter) +{ + IDirectDrawImpl *This = impl_from_dd2(iface); + TRACE("Thunking to IDirectDraw3\n"); + return IDirectDraw3_CreateSurface(dd3_from_impl(This), DDSD, Surf, UnkOuter); +} + +static HRESULT WINAPI +IDirectDrawImpl_CreateSurface(IDirectDraw *iface, + DDSURFACEDESC *DDSD, + IDirectDrawSurface **Surf, + IUnknown *UnkOuter) +{ + IDirectDrawImpl *This = impl_from_dd1(iface); + TRACE("Thunking to IDirectDraw3\n"); + return IDirectDraw3_CreateSurface(dd3_from_impl(This), DDSD, Surf, UnkOuter); +} + +static HRESULT WINAPI +IDirectDraw4Impl_DuplicateSurface(IDirectDraw4 *iface, + IDirectDrawSurface4 *src, + IDirectDrawSurface4 **dst) +{ + IDirectDrawImpl *This = impl_from_dd4(iface); + FIXME("(%p)->(%p,%p). Create a wrapper surface\n", This, src, dst); + + return IDirectDraw4_DuplicateSurface(This->parent, dds_get_inner(src), dst); +} + +static HRESULT WINAPI +IDirectDraw3Impl_DuplicateSurface(IDirectDraw3 *iface, + IDirectDrawSurface *src, + IDirectDrawSurface **dst) +{ + IDirectDrawImpl *This = impl_from_dd3(iface); + IDirectDrawSurface4 *src_4; + IDirectDrawSurface4 *dst_4; + HRESULT hr; + + TRACE("Thunking to IDirectDraw4\n"); + IDirectDrawSurface_QueryInterface(src, &IID_IDirectDrawSurface4, (void **) &src_4); + hr = IDirectDraw4_DuplicateSurface(dd4_from_impl(This), src_4, &dst_4); + IDirectDrawSurface4_Release(src_4); + + if(FAILED(hr)) + { + *dst = NULL; + return hr; + } + IDirectDrawSurface4_QueryInterface(dst_4, &IID_IDirectDrawSurface, (void **) dst); + IDirectDrawSurface4_Release(dst_4); + return hr; +} + +static HRESULT WINAPI +IDirectDraw2Impl_DuplicateSurface(IDirectDraw2 *iface, + IDirectDrawSurface *src, + IDirectDrawSurface **dst) +{ + IDirectDrawImpl *This = impl_from_dd2(iface); + TRACE("Thunking to IDirectDraw3\n"); + return IDirectDraw3_DuplicateSurface(dd3_from_impl(This), src, dst); +} + +static HRESULT WINAPI +IDirectDrawImpl_DuplicateSurface(IDirectDraw *iface, + IDirectDrawSurface *src, + IDirectDrawSurface **dst) +{ + IDirectDrawImpl *This = impl_from_dd1(iface); + TRACE("Thunking to IDirectDraw3\n"); + return IDirectDraw3_DuplicateSurface(dd3_from_impl(This), src, dst); +} + +static HRESULT WINAPI +IDirectDraw4Impl_EnumDisplayModes(IDirectDraw4 *iface, + DWORD Flags, + DDSURFACEDESC2 *DDSD, + void *Context, + LPDDENUMMODESCALLBACK2 cb) +{ + IDirectDrawImpl *This = impl_from_dd4(iface); + TRACE("(%p)->(0x%08x,%p,%p,%p)\n", This, Flags, DDSD, Context, cb); + + return IDirectDraw4_EnumDisplayModes(This->parent, Flags, DDSD, Context, cb); +} + +struct enummodes_ctx +{ + LPDDENUMMODESCALLBACK orig_cb; + void *orig_ctx; +}; + +static HRESULT WINAPI +enum_modes_cb2(DDSURFACEDESC2 *ddsd2, void *vctx) +{ + struct enummodes_ctx *ctx = (struct enummodes_ctx *) vctx; + DDSURFACEDESC ddsd; + + DDSD2_to_DDSD(ddsd2, &ddsd); + return ctx->orig_cb(&ddsd, ctx->orig_ctx); +} + +static HRESULT WINAPI +IDirectDraw3Impl_EnumDisplayModes(IDirectDraw3 *iface, + DWORD Flags, + DDSURFACEDESC *DDSD, + void *Context, + LPDDENUMMODESCALLBACK cb) +{ + IDirectDrawImpl *This = impl_from_dd3(iface); + DDSURFACEDESC2 ddsd2; + struct enummodes_ctx ctx; + TRACE("(%p)->(0x%08x,%p,%p,%p): Thunking to IDirectDraw4\n", This, Flags, DDSD, Context, cb); + + DDSD_to_DDSD2(DDSD, &ddsd2); + ctx.orig_cb = cb; + ctx.orig_ctx = Context; + return IDirectDraw4_EnumDisplayModes(dd4_from_impl(This), Flags, &ddsd2, &ctx, enum_modes_cb2); +} + +static HRESULT WINAPI +IDirectDraw2Impl_EnumDisplayModes(IDirectDraw2 *iface, + DWORD Flags, + DDSURFACEDESC *DDSD, + void *Context, + LPDDENUMMODESCALLBACK cb) +{ + IDirectDrawImpl *This = impl_from_dd2(iface); + TRACE("(%p)->(0x%08x,%p,%p,%p): Thunking to IDirectDraw3\n", This, Flags, DDSD, Context, cb); + return IDirectDraw3_EnumDisplayModes(dd3_from_impl(This), Flags, DDSD, Context, cb); +} + +static HRESULT WINAPI +IDirectDrawImpl_EnumDisplayModes(IDirectDraw *iface, + DWORD Flags, + DDSURFACEDESC *DDSD, + void *Context, + LPDDENUMMODESCALLBACK cb) +{ + IDirectDrawImpl *This = impl_from_dd1(iface); + TRACE("(%p)->(0x%08x,%p,%p,%p): Thunking to IDirectDraw3\n", This, Flags, DDSD, Context, cb); + return IDirectDraw3_EnumDisplayModes(dd3_from_impl(This), Flags, DDSD, Context, cb); +} + +struct enumsurfaces4_ctx +{ + LPDDENUMSURFACESCALLBACK2 orig_cb; + void *orig_ctx; +}; + +static HRESULT WINAPI +enum_surfaces_wrapper(IDirectDrawSurface4 *surf4, DDSURFACEDESC2 *ddsd2, void *vctx) +{ + struct enumsurfaces4_ctx *ctx = (struct enumsurfaces4_ctx *) vctx; + IDirectDrawSurface4 *outer = dds_get_outer(surf4); + IDirectDrawSurface4_AddRef(outer); + IDirectDrawSurface4_Release(surf4); + TRACE("Returning wrapper surface %p for enumerated inner surface %p\n", outer, surf4); + return ctx->orig_cb(outer, ddsd2, ctx->orig_ctx); +} + +static HRESULT WINAPI +IDirectDraw4Impl_EnumSurfaces(IDirectDraw4 *iface, + DWORD Flags, + DDSURFACEDESC2 *DDSD, + void *Context, + LPDDENUMSURFACESCALLBACK2 Callback) +{ + IDirectDrawImpl *This = impl_from_dd4(iface); + struct enumsurfaces4_ctx *ctx; + TRACE("(%p)->(0x%08x,%p,%p,%p)\n", This, Flags, DDSD, Context, Callback); + + ctx->orig_cb = Callback; + ctx->orig_ctx = Context; + return IDirectDraw4Impl_EnumSurfaces(This->parent, Flags, DDSD, &ctx, enum_surfaces_wrapper); +} + +struct enumsurfaces_ctx +{ + LPDDENUMSURFACESCALLBACK orig_cb; + void *orig_ctx; +}; + +static HRESULT WINAPI +enum_surfaces_cb2(IDirectDrawSurface4 *surf4, DDSURFACEDESC2 *ddsd2, void *vctx) +{ + struct enumsurfaces_ctx *ctx = (struct enumsurfaces_ctx *) vctx; + IDirectDrawSurface *surf1; + DDSURFACEDESC ddsd; + + /* Keep the reference, it goes to the application */ + IDirectDrawSurface4_QueryInterface(surf4, &IID_IDirectDrawSurface, (void **) &surf1); + /* Release the reference this function got */ + IDirectDrawSurface4_Release(surf4); + + DDSD2_to_DDSD(ddsd2, &ddsd); + return ctx->orig_cb(surf1, &ddsd, ctx->orig_ctx); +} + +static HRESULT WINAPI +IDirectDraw3Impl_EnumSurfaces(IDirectDraw3 *iface, + DWORD Flags, + DDSURFACEDESC *DDSD, + void *Context, + LPDDENUMSURFACESCALLBACK Callback) +{ + IDirectDrawImpl *This = impl_from_dd3(iface); + DDSURFACEDESC2 ddsd2; + struct enumsurfaces_ctx ctx; + TRACE("(%p)->(0x%08x,%p,%p,%p): Thunking to IDirectDraw4\n", This, Flags, DDSD, Context, Callback); + + DDSD_to_DDSD2(DDSD, &ddsd2); + ctx.orig_cb = Callback; + ctx.orig_ctx = Context; + return IDirectDraw4_EnumSurfaces(dd4_from_impl(This), Flags, &ddsd2, &ctx, enum_surfaces_cb2); +} + +static HRESULT WINAPI +IDirectDraw2Impl_EnumSurfaces(IDirectDraw2 *iface, + DWORD Flags, + DDSURFACEDESC *DDSD, + void *Context, + LPDDENUMSURFACESCALLBACK Callback) +{ + IDirectDrawImpl *This = impl_from_dd2(iface); + TRACE("(%p)->(0x%08x,%p,%p,%p): Thunking to IDirectDraw3\n", This, Flags, DDSD, Context, Callback); + return IDirectDraw3_EnumSurfaces(dd3_from_impl(This), Flags, DDSD, Context, Callback); +} + +static HRESULT WINAPI +IDirectDrawImpl_EnumSurfaces(IDirectDraw *iface, + DWORD Flags, + DDSURFACEDESC *DDSD, + void *Context, + LPDDENUMSURFACESCALLBACK Callback) +{ + IDirectDrawImpl *This = impl_from_dd1(iface); + TRACE("(%p)->(0x%08x,%p,%p,%p): Thunking to IDirectDraw3\n", This, Flags, DDSD, Context, Callback); + return IDirectDraw3_EnumSurfaces(dd3_from_impl(This), Flags, DDSD, Context, Callback); +} + +static HRESULT WINAPI +IDirectDraw4Impl_FlipToGDISurface(IDirectDraw4 *iface) +{ + IDirectDrawImpl *This = impl_from_dd4(iface); + TRACE("(%p)\n", This); + + return IDirectDraw4_FlipToGDISurface(This->parent); +} + +static HRESULT WINAPI +IDirectDraw3Impl_FlipToGDISurface(IDirectDraw3 *iface) +{ + IDirectDrawImpl *This = impl_from_dd3(iface); + TRACE("(%p). Thunking to IDirectDraw4\n", This); + return IDirectDraw4_FlipToGDISurface(dd4_from_impl(This)); +} + +static HRESULT WINAPI +IDirectDraw2Impl_FlipToGDISurface(IDirectDraw2 *iface) +{ + IDirectDrawImpl *This = impl_from_dd2(iface); + TRACE("(%p). Thunking to IDirectDraw4\n", This); + return IDirectDraw4_FlipToGDISurface(dd4_from_impl(This)); +} + +static HRESULT WINAPI +IDirectDrawImpl_FlipToGDISurface(IDirectDraw *iface) +{ + IDirectDrawImpl *This = impl_from_dd1(iface); + TRACE("(%p). Thunking to IDirectDraw4\n", This); + return IDirectDraw4_FlipToGDISurface(dd4_from_impl(This)); +} + +static HRESULT WINAPI +IDirectDraw4Impl_GetCaps(IDirectDraw4 *iface, + DDCAPS *DriverCaps, + DDCAPS *HELCaps) +{ + IDirectDrawImpl *This = impl_from_dd4(iface); + TRACE("(%p)->(%p,%p)\n", This, DriverCaps, HELCaps); + return IDirectDraw4_GetCaps(This->parent, DriverCaps, HELCaps); +} + +static HRESULT WINAPI +IDirectDraw3Impl_GetCaps(IDirectDraw3 *iface, + DDCAPS *DriverCaps, + DDCAPS *HELCaps) +{ + IDirectDrawImpl *This = impl_from_dd3(iface); + TRACE("(%p)->(%p,%p). Thunking to IDirectDraw4\n", This, DriverCaps, HELCaps); + return IDirectDraw4_GetCaps(dd4_from_impl(This), DriverCaps, HELCaps); +} + +static HRESULT WINAPI +IDirectDraw2Impl_GetCaps(IDirectDraw2 *iface, + DDCAPS *DriverCaps, + DDCAPS *HELCaps) +{ + IDirectDrawImpl *This = impl_from_dd2(iface); + TRACE("(%p)->(%p,%p). Thunking to IDirectDraw4\n", This, DriverCaps, HELCaps); + return IDirectDraw4_GetCaps(dd4_from_impl(This), DriverCaps, HELCaps); +} + +static HRESULT WINAPI +IDirectDrawImpl_GetCaps(IDirectDraw *iface, + DDCAPS *DriverCaps, + DDCAPS *HELCaps) +{ + IDirectDrawImpl *This = impl_from_dd1(iface); + TRACE("(%p)->(%p,%p). Thunking to IDirectDraw4\n", This, DriverCaps, HELCaps); + return IDirectDraw4_GetCaps(dd4_from_impl(This), DriverCaps, HELCaps); +} + +static HRESULT WINAPI +IDirectDraw4Impl_GetDisplayMode(IDirectDraw4 *iface, + DDSURFACEDESC2 *DDSD) +{ + IDirectDrawImpl *This = impl_from_dd4(iface); + TRACE("(%p)->(%p)\n", This, DDSD); + return IDirectDraw4_GetDisplayMode(This->parent, DDSD); +} + +static HRESULT WINAPI +IDirectDraw3Impl_GetDisplayMode(IDirectDraw3 *iface, + DDSURFACEDESC *DDSD) +{ + IDirectDrawImpl *This = impl_from_dd3(iface); + DDSURFACEDESC2 ddsd2; + HRESULT hr; + + TRACE("(%p)->(%p): Thunking to IDirectDraw4\n", This, DDSD); + hr = IDirectDraw4_GetDisplayMode(dd4_from_impl(This), &ddsd2); + DDSD2_to_DDSD(&ddsd2, DDSD); + return hr; +} + +static HRESULT WINAPI +IDirectDraw2Impl_GetDisplayMode(IDirectDraw2 *iface, + DDSURFACEDESC *DDSD) +{ + IDirectDrawImpl *This = impl_from_dd2(iface); + TRACE("(%p)->(%p): Thunking to IDirectDraw3\n", This, DDSD); + return IDirectDraw3_GetDisplayMode(dd3_from_impl(This), DDSD); +} + +static HRESULT WINAPI +IDirectDrawImpl_GetDisplayMode(IDirectDraw *iface, + DDSURFACEDESC *DDSD) +{ + IDirectDrawImpl *This = impl_from_dd1(iface); + TRACE("(%p)->(%p): Thunking to IDirectDraw3\n", This, DDSD); + return IDirectDraw3_GetDisplayMode(dd3_from_impl(This), DDSD); +} + +static HRESULT WINAPI +IDirectDraw4Impl_GetFourCCCodes(IDirectDraw4 *iface, + DWORD *NumCodes, + DWORD *Codes) +{ + IDirectDrawImpl *This = impl_from_dd4(iface); + TRACE("(%p)->(%p, %p):\n", This, NumCodes, Codes); + return IDirectDraw4_GetFourCCCodes(This->parent, NumCodes, Codes); +} + +static HRESULT WINAPI +IDirectDraw3Impl_GetFourCCCodes(IDirectDraw3 *iface, + DWORD *NumCodes, + DWORD *Codes) +{ + IDirectDrawImpl *This = impl_from_dd3(iface); + TRACE("(%p)->(%p, %p): Thunking to IDirectDraw4\n", This, NumCodes, Codes); + return IDirectDraw4_GetFourCCCodes(dd4_from_impl(This), NumCodes, Codes); +} + +static HRESULT WINAPI +IDirectDraw2Impl_GetFourCCCodes(IDirectDraw2 *iface, + DWORD *NumCodes, + DWORD *Codes) +{ + IDirectDrawImpl *This = impl_from_dd2(iface); + TRACE("(%p)->(%p, %p): Thunking to IDirectDraw4\n", This, NumCodes, Codes); + return IDirectDraw4_GetFourCCCodes(dd4_from_impl(This), NumCodes, Codes); +} + +static HRESULT WINAPI +IDirectDrawImpl_GetFourCCCodes(IDirectDraw *iface, + DWORD *NumCodes, + DWORD *Codes) +{ + IDirectDrawImpl *This = impl_from_dd1(iface); + TRACE("(%p)->(%p, %p): Thunking to IDirectDraw4\n", This, NumCodes, Codes); + return IDirectDraw4_GetFourCCCodes(dd4_from_impl(This), NumCodes, Codes); +} + +static HRESULT WINAPI +IDirectDraw4Impl_GetGDISurface(IDirectDraw4 *iface, + IDirectDrawSurface4 **GDISurface) +{ + IDirectDrawImpl *This = impl_from_dd4(iface); + IDirectDrawSurface4 *inner = NULL; + HRESULT hr; + TRACE("(%p)->(%p)\n", This, GDISurface); + + hr = IDirectDraw4_GetGDISurface(This->parent, &inner); + if(SUCCEEDED(hr)) + { + *GDISurface = dds_get_outer(inner); + IDirectDrawSurface4_AddRef(*GDISurface); + IDirectDrawSurface4_Release(inner); + } + else + { + *GDISurface = NULL; + } + return hr; +} + +static HRESULT WINAPI +IDirectDraw3Impl_GetGDISurface(IDirectDraw3 *iface, + IDirectDrawSurface **GDISurface) +{ + IDirectDrawImpl *This = impl_from_dd3(iface); + IDirectDrawSurface4 *surf4; + HRESULT hr; + TRACE("(%p)->(%p): Thunking to IDirectDraw4\n", This, GDISurface); + + hr = IDirectDraw4_GetGDISurface(dd4_from_impl(This), &surf4); + if(FAILED(hr)) { + *GDISurface = NULL; + return hr; + } + + /* Release the reference we got from the DDraw4 call, and pass a reference to the caller */ + IDirectDrawSurface4_QueryInterface(surf4, &IID_IDirectDrawSurface, (void **) GDISurface); + IDirectDrawSurface4_Release(surf4); + return hr; +} + +static HRESULT WINAPI +IDirectDraw2Impl_GetGDISurface(IDirectDraw2 *iface, + IDirectDrawSurface **GDISurface) +{ + IDirectDrawImpl *This = impl_from_dd2(iface); + TRACE("(%p)->(%p): Thunking to IDirectDraw3\n", This, GDISurface); + return IDirectDraw3_GetGDISurface(dd3_from_impl(This), GDISurface); +} + +static HRESULT WINAPI +IDirectDrawImpl_GetGDISurface(IDirectDraw *iface, + IDirectDrawSurface **GDISurface) +{ + IDirectDrawImpl *This = impl_from_dd1(iface); + TRACE("(%p)->(%p): Thunking to IDirectDraw3\n", This, GDISurface); + return IDirectDraw3_GetGDISurface(dd3_from_impl(This), GDISurface); +} + +static HRESULT WINAPI +IDirectDraw4Impl_GetMonitorFrequency(IDirectDraw4 *iface, + DWORD *Freq) +{ + IDirectDrawImpl *This = impl_from_dd4(iface); + TRACE("(%p)->(%p)\n", This, Freq); + return IDirectDraw4_GetMonitorFrequency(This->parent, Freq); +} + +static HRESULT WINAPI +IDirectDraw3Impl_GetMonitorFrequency(IDirectDraw3 *iface, + DWORD *Freq) +{ + IDirectDrawImpl *This = impl_from_dd3(iface); + TRACE("(%p)->(%p): Thunking to IDirectDraw4\n", This, Freq); + return IDirectDraw4_GetMonitorFrequency(dd4_from_impl(This), Freq); +} + +static HRESULT WINAPI +IDirectDraw2Impl_GetMonitorFrequency(IDirectDraw2 *iface, + DWORD *Freq) +{ + IDirectDrawImpl *This = impl_from_dd2(iface); + TRACE("(%p)->(%p): Thunking to IDirectDraw4\n", This, Freq); + return IDirectDraw4_GetMonitorFrequency(dd4_from_impl(This), Freq); +} + +static HRESULT WINAPI +IDirectDrawImpl_GetMonitorFrequency(IDirectDraw *iface, + DWORD *Freq) +{ + IDirectDrawImpl *This = impl_from_dd1(iface); + TRACE("(%p)->(%p): Thunking to IDirectDraw4\n", This, Freq); + return IDirectDraw4_GetMonitorFrequency(dd4_from_impl(This), Freq); +} + +static HRESULT WINAPI +IDirectDraw4Impl_GetScanLine(IDirectDraw4 *iface, + DWORD *Scanline) +{ + IDirectDrawImpl *This = impl_from_dd4(iface); + TRACE("(%p)->(%p)\n", This, Scanline); + return IDirectDraw4_GetScanLine(This->parent, Scanline); +} + +static HRESULT WINAPI +IDirectDraw3Impl_GetScanLine(IDirectDraw3 *iface, + DWORD *Scanline) +{ + IDirectDrawImpl *This = impl_from_dd3(iface); + TRACE("(%p)->(%p): Thunking to IDirectDraw4\n", This, Scanline); + return IDirectDraw4_GetScanLine(dd4_from_impl(This), Scanline); +} + +static HRESULT WINAPI +IDirectDraw2Impl_GetScanLine(IDirectDraw2 *iface, + DWORD *Scanline) +{ + IDirectDrawImpl *This = impl_from_dd2(iface); + TRACE("(%p)->(%p): Thunking to IDirectDraw4\n", This, Scanline); + return IDirectDraw4_GetScanLine(dd4_from_impl(This), Scanline); +} + +static HRESULT WINAPI +IDirectDrawImpl_GetScanLine(IDirectDraw *iface, + DWORD *Scanline) +{ + IDirectDrawImpl *This = impl_from_dd1(iface); + TRACE("(%p)->(%p): Thunking to IDirectDraw4\n", This, Scanline); + return IDirectDraw4_GetScanLine(dd4_from_impl(This), Scanline); +} + +static HRESULT WINAPI +IDirectDraw4Impl_GetVerticalBlankStatus(IDirectDraw4 *iface, + BOOL *status) +{ + IDirectDrawImpl *This = impl_from_dd4(iface); + TRACE("(%p)->(%p)\n", This, status); + return IDirectDraw4_GetVerticalBlankStatus(This->parent, status); +} + +static HRESULT WINAPI +IDirectDraw3Impl_GetVerticalBlankStatus(IDirectDraw3 *iface, + BOOL *status) +{ + IDirectDrawImpl *This = impl_from_dd3(iface); + TRACE("(%p)->(%p): Thunking to IDirectDraw4\n", This, status); + return IDirectDraw4_GetVerticalBlankStatus(dd4_from_impl(This), status); +} + +static HRESULT WINAPI +IDirectDraw2Impl_GetVerticalBlankStatus(IDirectDraw2 *iface, + BOOL *status) +{ + IDirectDrawImpl *This = impl_from_dd2(iface); + TRACE("(%p)->(%p): Thunking to IDirectDraw4\n", This, status); + return IDirectDraw4_GetVerticalBlankStatus(dd4_from_impl(This), status); +} + +static HRESULT WINAPI +IDirectDrawImpl_GetVerticalBlankStatus(IDirectDraw *iface, + BOOL *status) +{ + IDirectDrawImpl *This = impl_from_dd1(iface); + TRACE("(%p)->(%p): Thunking to IDirectDraw4\n", This, status); + return IDirectDraw4_GetVerticalBlankStatus(dd4_from_impl(This), status); +} + +static HRESULT WINAPI +IDirectDraw4Impl_Initialize(IDirectDraw4 *iface, + GUID *Guid) +{ + IDirectDrawImpl *This = impl_from_dd4(iface); + TRACE("(%p)->(%s)\n", This, debugstr_guid(Guid)); + return IDirectDraw4_Initialize(This->parent, Guid); +} + +static HRESULT WINAPI +IDirectDraw3Impl_Initialize(IDirectDraw3 *iface, + GUID *Guid) +{ + IDirectDrawImpl *This = impl_from_dd3(iface); + TRACE("(%p)->(%s): Thunking to IDirectDraw4\n", This, debugstr_guid(Guid)); + return IDirectDraw4_Initialize(dd4_from_impl(This), Guid); +} + +static HRESULT WINAPI +IDirectDraw2Impl_Initialize(IDirectDraw2 *iface, + GUID *Guid) +{ + IDirectDrawImpl *This = impl_from_dd2(iface); + TRACE("(%p)->(%s): Thunking to IDirectDraw4\n", This, debugstr_guid(Guid)); + return IDirectDraw4_Initialize(dd4_from_impl(This), Guid); +} + +static HRESULT WINAPI +IDirectDrawImpl_Initialize(IDirectDraw *iface, + GUID *Guid) +{ + IDirectDrawImpl *This = impl_from_dd1(iface); + TRACE("(%p)->(%s): Thunking to IDirectDraw4\n", This, debugstr_guid(Guid)); + return IDirectDraw4_Initialize(dd4_from_impl(This), Guid); +} + +static HRESULT WINAPI +IDirectDraw4Impl_RestoreDisplayMode(IDirectDraw4 *iface) +{ + IDirectDrawImpl *This = impl_from_dd4(iface); + TRACE("(%p)\n", This); + return IDirectDraw4_RestoreDisplayMode(This->parent); +} + +static HRESULT WINAPI +IDirectDraw3Impl_RestoreDisplayMode(IDirectDraw3 *iface) +{ + IDirectDrawImpl *This = impl_from_dd3(iface); + TRACE("(%p): Thunking to IDirectDraw4\n", This); + return IDirectDraw4_RestoreDisplayMode(dd4_from_impl(This)); +} + +static HRESULT WINAPI +IDirectDraw2Impl_RestoreDisplayMode(IDirectDraw2 *iface) +{ + IDirectDrawImpl *This = impl_from_dd2(iface); + TRACE("(%p): Thunking to IDirectDraw4\n", This); + return IDirectDraw4_RestoreDisplayMode(dd4_from_impl(This)); +} + +static HRESULT WINAPI +IDirectDrawImpl_RestoreDisplayMode(IDirectDraw *iface) +{ + IDirectDrawImpl *This = impl_from_dd1(iface); + TRACE("(%p): Thunking to IDirectDraw4\n", This); + return IDirectDraw4_RestoreDisplayMode(dd4_from_impl(This)); +} + +static HRESULT WINAPI +IDirectDraw4Impl_SetCooperativeLevel(IDirectDraw4 *iface, + HWND hwnd, + DWORD cooplevel) +{ + IDirectDrawImpl *This = impl_from_dd4(iface); + TRACE("(%p)->(%p, 0x%08x)\n", This, hwnd, cooplevel); + return IDirectDraw4_SetCooperativeLevel(This->parent, hwnd, cooplevel); +} + +static HRESULT WINAPI +IDirectDraw3Impl_SetCooperativeLevel(IDirectDraw3 *iface, + HWND hwnd, + DWORD cooplevel) +{ + IDirectDrawImpl *This = impl_from_dd3(iface); + TRACE("(%p)->(%p, 0x%08x): Thunking to IDirectDraw4\n", This, hwnd, cooplevel); + return IDirectDraw4_SetCooperativeLevel(dd4_from_impl(This), hwnd, cooplevel); +} + +static HRESULT WINAPI +IDirectDraw2Impl_SetCooperativeLevel(IDirectDraw2 *iface, + HWND hwnd, + DWORD cooplevel) +{ + IDirectDrawImpl *This = impl_from_dd2(iface); + TRACE("(%p)->(%p, 0x%08x): Thunking to IDirectDraw4\n", This, hwnd, cooplevel); + return IDirectDraw4_SetCooperativeLevel(dd4_from_impl(This), hwnd, cooplevel); +} + +static HRESULT WINAPI +IDirectDrawImpl_SetCooperativeLevel(IDirectDraw *iface, + HWND hwnd, + DWORD cooplevel) +{ + IDirectDrawImpl *This = impl_from_dd1(iface); + TRACE("(%p)->(%p, 0x%08x): Thunking to IDirectDraw4\n", This, hwnd, cooplevel); + return IDirectDraw4_SetCooperativeLevel(dd4_from_impl(This), hwnd, cooplevel); +} + +static HRESULT WINAPI +IDirectDraw4Impl_SetDisplayMode(IDirectDraw4 *iface, + DWORD Width, + DWORD Height, + DWORD BPP, + DWORD RefreshRate, + DWORD Flags) +{ + IDirectDrawImpl *This = impl_from_dd4(iface); + TRACE("(%p)->(%u, %u, %u, %u, 0x%08x)\n", This, Width, Height, BPP, RefreshRate, Flags); + return IDirectDraw4_SetDisplayMode(This->parent, Width, Height, BPP, RefreshRate, Flags); +} + +static HRESULT WINAPI +IDirectDraw3Impl_SetDisplayMode(IDirectDraw3 *iface, + DWORD Width, + DWORD Height, + DWORD BPP, + DWORD RefreshRate, + DWORD Flags) +{ + IDirectDrawImpl *This = impl_from_dd3(iface); + TRACE("(%p)->(%u, %u, %u, %u, 0x%08x): Thunking to IDirectDraw4\n", This, Width, Height, BPP, RefreshRate, Flags); + return IDirectDraw3_SetDisplayMode(dd4_from_impl(This), Width, Height, BPP, RefreshRate, Flags); +} + +static HRESULT WINAPI +IDirectDraw2Impl_SetDisplayMode(IDirectDraw2 *iface, + DWORD Width, + DWORD Height, + DWORD BPP, + DWORD RefreshRate, + DWORD Flags) +{ + IDirectDrawImpl *This = impl_from_dd2(iface); + TRACE("(%p)->(%u, %u, %u, %u, 0x%08x): Thunking to IDirectDraw4\n", This, Width, Height, BPP, RefreshRate, Flags); + return IDirectDraw3_SetDisplayMode(dd4_from_impl(This), Width, Height, BPP, RefreshRate, Flags); +} + +static HRESULT WINAPI +IDirectDrawImpl_SetDisplayMode(IDirectDraw *iface, + DWORD Width, + DWORD Height, + DWORD BPP) +{ + IDirectDrawImpl *This = impl_from_dd1(iface); + TRACE("(%p)->(%u, %u, %u): Thunking to IDirectDraw4\n", This, Width, Height, BPP); + return IDirectDraw3_SetDisplayMode(dd4_from_impl(This), Width, Height, BPP, 0, 0); +} + +static HRESULT WINAPI +IDirectDraw4Impl_WaitForVerticalBlank(IDirectDraw4 *iface, + DWORD Flags, + HANDLE h) +{ + IDirectDrawImpl *This = impl_from_dd4(iface); + TRACE("(%p)->(0x%08x, %p)\n", This, Flags, h); + return IDirectDraw4_WaitForVerticalBlank(This->parent, Flags, h); +} + +static HRESULT WINAPI +IDirectDraw3Impl_WaitForVerticalBlank(IDirectDraw3 *iface, + DWORD Flags, + HANDLE h) +{ + IDirectDrawImpl *This = impl_from_dd3(iface); + TRACE("(%p)->(0x%08x, %p): Thunking to IDirectDraw4\n", This, Flags, h); + return IDirectDraw4_WaitForVerticalBlank(dd4_from_impl(This), Flags, h); +} + +static HRESULT WINAPI +IDirectDraw2Impl_WaitForVerticalBlank(IDirectDraw2 *iface, + DWORD Flags, + HANDLE h) +{ + IDirectDrawImpl *This = impl_from_dd2(iface); + TRACE("(%p)->(0x%08x, %p): Thunking to IDirectDraw4\n", This, Flags, h); + return IDirectDraw4_WaitForVerticalBlank(dd4_from_impl(This), Flags, h); +} + +static HRESULT WINAPI +IDirectDrawImpl_WaitForVerticalBlank(IDirectDraw *iface, + DWORD Flags, + HANDLE h) +{ + IDirectDrawImpl *This = impl_from_dd1(iface); + TRACE("(%p)->(0x%08x, %p): Thunking to IDirectDraw4\n", This, Flags, h); + return IDirectDraw4_WaitForVerticalBlank(dd4_from_impl(This), Flags, h); +} + +static HRESULT WINAPI +IDirectDraw4Impl_GetAvailableVidMem(IDirectDraw4 *iface, + DDSCAPS2 *Caps, + DWORD *total, + DWORD *free) +{ + IDirectDrawImpl *This = impl_from_dd4(iface); + TRACE("(%p)->(%p, %p, %p)\n", This, Caps, total, free); + return IDirectDraw4_GetAvailableVidMem(This->parent, Caps, total, free); +} + +static HRESULT WINAPI +IDirectDraw3Impl_GetAvailableVidMem(IDirectDraw3 *iface, + DDSCAPS *Caps, + DWORD *total, + DWORD *free) +{ + IDirectDrawImpl *This = impl_from_dd3(iface); + DDSCAPS2 caps2; + TRACE("(%p)->(%p, %p, %p): Thunking to IDirectDraw4\n", This, Caps, total, free); + memset(&caps2, 0, sizeof(caps2)); + caps2.dwCaps = Caps->dwCaps; + return IDirectDraw4_GetAvailableVidMem(dd4_from_impl(This), &caps2, total, free); +} + +static HRESULT WINAPI +IDirectDraw2Impl_GetAvailableVidMem(IDirectDraw2 *iface, + DDSCAPS *Caps, + DWORD *total, + DWORD *free) +{ + IDirectDrawImpl *This = impl_from_dd2(iface); + DDSCAPS2 caps2; + TRACE("(%p)->(%p, %p, %p): Thunking to IDirectDraw4\n", This, Caps, total, free); + memset(&caps2, 0, sizeof(caps2)); + caps2.dwCaps = Caps->dwCaps; + return IDirectDraw4_GetAvailableVidMem(dd4_from_impl(This), &caps2, total, free); +} + +static HRESULT WINAPI +IDirectDraw4Impl_GetSurfaceFromDC(IDirectDraw4 *iface, + HDC hdc, + IDirectDrawSurface4 **Surface) +{ + IDirectDrawImpl *This = impl_from_dd4(iface); + IDirectDrawSurface4 *inner; + HRESULT hr; + TRACE("(%p)->(%p, %p)\n", This, hdc, Surface); + hr = IDirectDraw4_GetSurfaceFromDC(This->parent,hdc, &inner); + if(SUCCEEDED(hr)) + { + *Surface = dds_get_outer(inner); + IDirectDrawSurface4_AddRef(*Surface); + IDirectDrawSurface4_Release(inner); + } + else + { + *Surface = NULL; + } + + return hr; +} + +static HRESULT WINAPI +IDirectDraw3Impl_GetSurfaceFromDC(IDirectDraw3 *iface, + HDC hdc, + IDirectDrawSurface **Surface) +{ + IDirectDrawImpl *This = impl_from_dd3(iface); + IDirectDrawSurface4 *surf4; + HRESULT hr; + TRACE("(%p)->(%p, %p): Thunking to IDirectDraw4\n", This, hdc, Surface); + + hr = IDirectDraw4_GetSurfaceFromDC(dd4_from_impl(This), hdc, &surf4); + if(FAILED(hr)) + { + *Surface = NULL; + return hr; + } + IDirectDrawSurface4_QueryInterface(surf4, &IID_IDirectDrawSurface, (void **) Surface); + IDirectDrawSurface4_Release(surf4); + return hr; +} + +static HRESULT WINAPI +IDirectDraw4Impl_RestoreAllSurfaces(IDirectDraw4 *iface) +{ + IDirectDrawImpl *This = impl_from_dd4(iface); + TRACE("(%p)\n", This); + return IDirectDraw4_RestoreAllSurfaces(This->parent); +} + +static HRESULT WINAPI +IDirectDraw4Impl_TestCooperativeLevel(IDirectDraw4 *iface) +{ + IDirectDrawImpl *This = impl_from_dd4(iface); + TRACE("(%p)\n", This); + return IDirectDraw4_TestCooperativeLevel(This->parent); +} + +static HRESULT WINAPI +IDirectDraw4Impl_GetDeviceIdentifier(IDirectDraw4 *iface, + DDDEVICEIDENTIFIER *DDDI, + DWORD Flags) +{ + IDirectDrawImpl *This = impl_from_dd4(iface); + TRACE("(%p)->(%p,0x%08x)\n", This, DDDI, Flags); + return IDirectDraw4_GetDeviceIdentifier(This->parent, DDDI, Flags); +} + +static const IDirectDrawVtbl IDirectDraw1_Vtbl = +{ + IDirectDrawImpl_QueryInterface, + IDirectDrawImpl_AddRef, + IDirectDrawImpl_Release, + IDirectDrawImpl_Compact, + IDirectDrawImpl_CreateClipper, + IDirectDrawImpl_CreatePalette, + IDirectDrawImpl_CreateSurface, + IDirectDrawImpl_DuplicateSurface, + IDirectDrawImpl_EnumDisplayModes, + IDirectDrawImpl_EnumSurfaces, + IDirectDrawImpl_FlipToGDISurface, + IDirectDrawImpl_GetCaps, + IDirectDrawImpl_GetDisplayMode, + IDirectDrawImpl_GetFourCCCodes, + IDirectDrawImpl_GetGDISurface, + IDirectDrawImpl_GetMonitorFrequency, + IDirectDrawImpl_GetScanLine, + IDirectDrawImpl_GetVerticalBlankStatus, + IDirectDrawImpl_Initialize, + IDirectDrawImpl_RestoreDisplayMode, + IDirectDrawImpl_SetCooperativeLevel, + IDirectDrawImpl_SetDisplayMode, + IDirectDrawImpl_WaitForVerticalBlank, +}; + +static const IDirectDraw2Vtbl IDirectDraw2_Vtbl = +{ + IDirectDraw2Impl_QueryInterface, + IDirectDraw2Impl_AddRef, + IDirectDraw2Impl_Release, + IDirectDraw2Impl_Compact, + IDirectDraw2Impl_CreateClipper, + IDirectDraw2Impl_CreatePalette, + IDirectDraw2Impl_CreateSurface, + IDirectDraw2Impl_DuplicateSurface, + IDirectDraw2Impl_EnumDisplayModes, + IDirectDraw2Impl_EnumSurfaces, + IDirectDraw2Impl_FlipToGDISurface, + IDirectDraw2Impl_GetCaps, + IDirectDraw2Impl_GetDisplayMode, + IDirectDraw2Impl_GetFourCCCodes, + IDirectDraw2Impl_GetGDISurface, + IDirectDraw2Impl_GetMonitorFrequency, + IDirectDraw2Impl_GetScanLine, + IDirectDraw2Impl_GetVerticalBlankStatus, + IDirectDraw2Impl_Initialize, + IDirectDraw2Impl_RestoreDisplayMode, + IDirectDraw2Impl_SetCooperativeLevel, + IDirectDraw2Impl_SetDisplayMode, + IDirectDraw2Impl_WaitForVerticalBlank, + IDirectDraw2Impl_GetAvailableVidMem +}; + +static const IDirectDraw3Vtbl IDirectDraw3_Vtbl = +{ + IDirectDraw3Impl_QueryInterface, + IDirectDraw3Impl_AddRef, + IDirectDraw3Impl_Release, + IDirectDraw3Impl_Compact, + IDirectDraw3Impl_CreateClipper, + IDirectDraw3Impl_CreatePalette, + IDirectDraw3Impl_CreateSurface, + IDirectDraw3Impl_DuplicateSurface, + IDirectDraw3Impl_EnumDisplayModes, + IDirectDraw3Impl_EnumSurfaces, + IDirectDraw3Impl_FlipToGDISurface, + IDirectDraw3Impl_GetCaps, + IDirectDraw3Impl_GetDisplayMode, + IDirectDraw3Impl_GetFourCCCodes, + IDirectDraw3Impl_GetGDISurface, + IDirectDraw3Impl_GetMonitorFrequency, + IDirectDraw3Impl_GetScanLine, + IDirectDraw3Impl_GetVerticalBlankStatus, + IDirectDraw3Impl_Initialize, + IDirectDraw3Impl_RestoreDisplayMode, + IDirectDraw3Impl_SetCooperativeLevel, + IDirectDraw3Impl_SetDisplayMode, + IDirectDraw3Impl_WaitForVerticalBlank, + IDirectDraw3Impl_GetAvailableVidMem, + IDirectDraw3Impl_GetSurfaceFromDC, +}; + +static const IDirectDraw4Vtbl IDirectDraw4_Vtbl = +{ + IDirectDraw4Impl_QueryInterface, + IDirectDraw4Impl_AddRef, + IDirectDraw4Impl_Release, + IDirectDraw4Impl_Compact, + IDirectDraw4Impl_CreateClipper, + IDirectDraw4Impl_CreatePalette, + IDirectDraw4Impl_CreateSurface, + IDirectDraw4Impl_DuplicateSurface, + IDirectDraw4Impl_EnumDisplayModes, + IDirectDraw4Impl_EnumSurfaces, + IDirectDraw4Impl_FlipToGDISurface, + IDirectDraw4Impl_GetCaps, + IDirectDraw4Impl_GetDisplayMode, + IDirectDraw4Impl_GetFourCCCodes, + IDirectDraw4Impl_GetGDISurface, + IDirectDraw4Impl_GetMonitorFrequency, + IDirectDraw4Impl_GetScanLine, + IDirectDraw4Impl_GetVerticalBlankStatus, + IDirectDraw4Impl_Initialize, + IDirectDraw4Impl_RestoreDisplayMode, + IDirectDraw4Impl_SetCooperativeLevel, + IDirectDraw4Impl_SetDisplayMode, + IDirectDraw4Impl_WaitForVerticalBlank, + IDirectDraw4Impl_GetAvailableVidMem, + IDirectDraw4Impl_GetSurfaceFromDC, + IDirectDraw4Impl_RestoreAllSurfaces, + IDirectDraw4Impl_TestCooperativeLevel, + IDirectDraw4Impl_GetDeviceIdentifier +}; + +/******************************************************************************* + * IDirectDrawFactoryImpl_CreateDirectDraw + *******************************************************************************/ +HRESULT WINAPI +IDirectDrawFactoryImpl_CreateDirectDraw(IDirectDrawFactory* iface, + GUID * pGUID, + HWND hWnd, + DWORD dwCoopLevelFlags, + DWORD dwReserved, + IUnknown *pUnkOuter, + IDirectDraw **ppDirectDraw) +{ + HRESULT hr; + IDirectDrawImpl *object = NULL; + IDirectDraw *parent = NULL; + + TRACE("(%p)->(%s,%p,0x%08x,0x%08x,%p,%p)", iface, debugstr_guid(pGUID), hWnd, dwCoopLevelFlags, + dwReserved, pUnkOuter, ppDirectDraw); + + if(pUnkOuter) + { + FIXME("Implement aggregation in ddrawex's IDirectDraw interface\n"); + } + + object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); + if(!object) + { + ERR("Out of memory\n"); + hr = E_OUTOFMEMORY; + goto err; + } + object->ref = 1; + object->IDirectDraw_Vtbl = &IDirectDraw1_Vtbl; + object->IDirectDraw2_Vtbl = &IDirectDraw2_Vtbl; + object->IDirectDraw3_Vtbl = &IDirectDraw3_Vtbl; + object->IDirectDraw4_Vtbl = &IDirectDraw4_Vtbl; + + hr = DirectDrawCreate(pGUID, &parent, NULL); + if (FAILED(hr)) goto err; + + hr = IDirectDraw_QueryInterface(parent, &IID_IDirectDraw4, (void **) &object->parent); + if(FAILED(hr)) goto err; + + hr = IDirectDraw_SetCooperativeLevel(dd1_from_impl(object), hWnd, dwCoopLevelFlags); + if (FAILED(hr)) goto err; + + *ppDirectDraw = dd1_from_impl(object); + IDirectDraw_Release(parent); + return DD_OK; + +err: + if(object && object->parent) IDirectDraw4_Release(object->parent); + if(parent) IDirectDraw_Release(parent); + if(object) HeapFree(GetProcessHeap(), 0, object); + *ppDirectDraw = NULL; + return hr; +} + +IDirectDraw4 *dd_get_inner(IDirectDraw4 *outer) +{ + IDirectDrawImpl *This = impl_from_dd4(outer); + return This->parent; +} diff --git a/dlls/ddrawex/ddrawex_private.h b/dlls/ddrawex/ddrawex_private.h index 117ddba1fe6..3e7a0e220c8 100644 --- a/dlls/ddrawex/ddrawex_private.h +++ b/dlls/ddrawex/ddrawex_private.h @@ -55,7 +55,7 @@ typedef struct /****************************************************************************** - * DirectDrawFactopry implementation + * DirectDrawFactory implementation ******************************************************************************/ typedef struct { @@ -63,4 +63,53 @@ typedef struct LONG ref; } IDirectDrawFactoryImpl; +HRESULT WINAPI IDirectDrawFactoryImpl_CreateDirectDraw(IDirectDrawFactory* iface, + GUID * pGUID, HWND hWnd, DWORD dwCoopLevelFlags, DWORD dwReserved, IUnknown *pUnkOuter, + IDirectDraw **ppDirectDraw); + +void DDSD_to_DDSD2(const DDSURFACEDESC *in, DDSURFACEDESC2 *out); +void DDSD2_to_DDSD(const DDSURFACEDESC2 *in, DDSURFACEDESC *out); + +/****************************************************************************** + * IDirectDraw wrapper implementation + ******************************************************************************/ +typedef struct +{ + const IDirectDrawVtbl *IDirectDraw_Vtbl; + const IDirectDraw2Vtbl *IDirectDraw2_Vtbl; + const IDirectDraw3Vtbl *IDirectDraw3_Vtbl; + const IDirectDraw4Vtbl *IDirectDraw4_Vtbl; + LONG ref; + + /* The interface we're forwarding to */ + IDirectDraw4 *parent; +} IDirectDrawImpl; + +IDirectDraw4 *dd_get_outer(IDirectDraw4 *inner); +IDirectDraw4 *dd_get_inner(IDirectDraw4 *outer); + +/****************************************************************************** + * IDirectDrawSurface implementation + ******************************************************************************/ +typedef struct +{ + const IDirectDrawSurface3Vtbl *IDirectDrawSurface3_Vtbl; + const IDirectDrawSurface4Vtbl *IDirectDrawSurface4_Vtbl; + LONG ref; + + /* The interface we're forwarding to */ + IDirectDrawSurface4 *parent; + + BOOL permanent_dc; + HDC hdc; + + /* An UUID we use to store the outer surface as private data in the inner surface */ +#define IID_DDrawexPriv IID_IDirectDrawSurface4 + +} IDirectDrawSurfaceImpl; + +IDirectDrawSurface4 *dds_get_outer(IDirectDrawSurface4 *inner); +IDirectDrawSurface4 *dds_get_inner(IDirectDrawSurface4 *outer); +HRESULT prepare_permanent_dc(IDirectDrawSurface4 *iface); + #endif /* __WINE_DLLS_DDRAWEX_DDRAWEX_PRIVATE_H */ diff --git a/dlls/ddrawex/main.c b/dlls/ddrawex/main.c index 6befb957c85..de63f233797 100644 --- a/dlls/ddrawex/main.c +++ b/dlls/ddrawex/main.c @@ -33,7 +33,7 @@ #include "initguid.h" #include "ddrawex_private.h" -WINE_DEFAULT_DEBUG_CHANNEL(ddraw); +WINE_DEFAULT_DEBUG_CHANNEL(ddrawex); /******************************************************************************* @@ -194,36 +194,6 @@ IDirectDrawFactoryImpl_Release(IDirectDrawFactory *iface) return ref; } - -/******************************************************************************* - * IDirectDrawFactoryImpl_CreateDirectDraw - *******************************************************************************/ -static HRESULT WINAPI -IDirectDrawFactoryImpl_CreateDirectDraw(IDirectDrawFactory* iface, - GUID * pGUID, - HWND hWnd, - DWORD dwCoopLevelFlags, - DWORD dwReserved, - IUnknown *pUnkOuter, - IDirectDraw **ppDirectDraw) -{ - HRESULT hr; - - TRACE("\n"); - - hr = DirectDrawCreateEx(pGUID, (void**)ppDirectDraw, &IID_IDirectDraw3, pUnkOuter); - - if (FAILED(hr)) - return hr; - - hr = IDirectDraw_SetCooperativeLevel(*ppDirectDraw, hWnd, dwCoopLevelFlags); - if (FAILED(hr)) - IDirectDraw_Release(*ppDirectDraw); - - return hr; -} - - /******************************************************************************* * IDirectDrawFactoryImpl_DirectDrawEnumerate *******************************************************************************/ diff --git a/dlls/ddrawex/surface.c b/dlls/ddrawex/surface.c new file mode 100644 index 00000000000..106b02756c2 --- /dev/null +++ b/dlls/ddrawex/surface.c @@ -0,0 +1,1308 @@ +/* + * Copyright 2008 Stefan Dösinger for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "wine/debug.h" + +#define COBJMACROS + +#include "winbase.h" +#include "wingdi.h" + +#include "ddraw.h" +#include "d3d.h" + +#include "ddrawex_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(ddrawex); + +/****************************************************************************** + * Helper functions for COM management + ******************************************************************************/ +static IDirectDrawSurfaceImpl *impl_from_dds3(IDirectDrawSurface3 *iface) +{ + if(!iface) return NULL; + return (IDirectDrawSurfaceImpl *)((char*)iface - FIELD_OFFSET(IDirectDrawSurfaceImpl, IDirectDrawSurface3_Vtbl)); +} +static IDirectDrawSurface3 *dds3_from_impl(IDirectDrawSurfaceImpl *This) +{ + if(!This) return NULL; + return (IDirectDrawSurface3 *) &This->IDirectDrawSurface3_Vtbl; +} + +static IDirectDrawSurfaceImpl *impl_from_dds4(IDirectDrawSurface4 *iface) +{ + if(!iface) return NULL; + return (IDirectDrawSurfaceImpl *)((char*)iface - FIELD_OFFSET(IDirectDrawSurfaceImpl, IDirectDrawSurface4_Vtbl)); +} +static IDirectDrawSurface4 *dds4_from_impl(IDirectDrawSurfaceImpl *This) +{ + if(!This) return NULL; + return (IDirectDrawSurface4 *) &This->IDirectDrawSurface4_Vtbl; +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_QueryInterface(IDirectDrawSurface4 *iface, + REFIID riid, + void **obj) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + + /* According to COM docs, if the QueryInterface fails, obj should be set to NULL */ + *obj = NULL; + + if(!riid) + return DDERR_INVALIDPARAMS; + + TRACE("(%p)->(%s,%p)\n",This,debugstr_guid(riid),obj); + if (IsEqualGUID(riid, &IID_IUnknown) + || IsEqualGUID(riid, &IID_IDirectDrawSurface4) ) + { + *obj = dds4_from_impl(This); + IDirectDrawSurface4_AddRef((IDirectDrawSurface4 *) *obj); + TRACE("(%p) returning IDirectDrawSurface4 interface at %p\n", This, *obj); + return S_OK; + } + else if( IsEqualGUID(riid, &IID_IDirectDrawSurface3) + || IsEqualGUID(riid, &IID_IDirectDrawSurface2) + || IsEqualGUID(riid, &IID_IDirectDrawSurface) ) + { + *obj = dds3_from_impl(This); + IDirectDrawSurface3_AddRef((IDirectDrawSurface3 *) *obj); + TRACE("(%p) returning IDirectDrawSurface3 interface at %p\n", This, *obj); + return S_OK; + } + else if( IsEqualGUID(riid, &IID_IDirectDrawGammaControl) ) + { + FIXME("Implement IDirectDrawGammaControl in ddrawex\n"); + } + else if( IsEqualGUID(riid, &IID_IDirect3DHALDevice)|| + IsEqualGUID(riid, &IID_IDirect3DRGBDevice) ) + { + /* Most likely not supported */ + FIXME("Test IDirect3DDevice in ddrawex\n"); + } + else if (IsEqualGUID( &IID_IDirect3DTexture, riid ) || + IsEqualGUID( &IID_IDirect3DTexture2, riid )) + { + FIXME("Implement IDirect3dTexture in ddrawex\n"); + } + else + { + WARN("No interface\n"); + } + + return E_NOINTERFACE; +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_QueryInterface(IDirectDrawSurface3 *iface, + REFIID riid, + void **obj) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + TRACE("(%p)->(%s,%p): Thunking to IDirectDrawSurface4\n",This,debugstr_guid(riid),obj); + return IDirectDrawSurface4_QueryInterface(dds4_from_impl(This), riid, obj); +} + +static ULONG WINAPI +IDirectDrawSurface4Impl_AddRef(IDirectDrawSurface4 *iface) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + ULONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) : incrementing refcount from %u.\n", This, ref - 1); + + return ref; +} + +static ULONG WINAPI +IDirectDrawSurface3Impl_AddRef(IDirectDrawSurface3 *iface) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + TRACE("(%p): Thunking to IDirectDrawSurface4\n", This); + return IDirectDrawSurface4_AddRef(dds4_from_impl(This)); +} + +static ULONG WINAPI +IDirectDrawSurface4Impl_Release(IDirectDrawSurface4 *iface) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) : decrementing refcount to %u.\n", This, ref); + + if(ref == 0) + { + TRACE("Destroying object\n"); + IDirectDrawSurface4_FreePrivateData(This->parent, &IID_DDrawexPriv); + IDirectDrawSurface4_Release(This->parent); + HeapFree(GetProcessHeap(), 0, This); + } + return ref; +} + +static ULONG WINAPI +IDirectDrawSurface3Impl_Release(IDirectDrawSurface3 *iface) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + TRACE("(%p): Thunking to IDirectDrawSurface4\n", This); + return IDirectDrawSurface4_Release(dds4_from_impl(This)); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_AddAttachedSurface(IDirectDrawSurface4 *iface, + IDirectDrawSurface4 *Attach_iface) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + IDirectDrawSurfaceImpl *attach = impl_from_dds4(Attach_iface); + TRACE("(%p)->(%p)\n", This, attach); + return IDirectDrawSurface4_AddAttachedSurface(This->parent, attach->parent); +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_AddAttachedSurface(IDirectDrawSurface3 *iface, + IDirectDrawSurface3 *Attach_iface) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + IDirectDrawSurfaceImpl *attach = impl_from_dds3(Attach_iface); + TRACE("(%p)->(%p): Thunking to IDirectDrawSurface4\n", This, attach); + return IDirectDrawSurface4_AddAttachedSurface(dds4_from_impl(This), dds4_from_impl(attach)); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_AddOverlayDirtyRect(IDirectDrawSurface4 *iface, + RECT *Rect) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + TRACE("(%p)->(%p)\n", This, Rect); + return IDirectDrawSurface4_AddOverlayDirtyRect(This->parent, Rect); +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_AddOverlayDirtyRect(IDirectDrawSurface3 *iface, + RECT *Rect) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + TRACE("(%p)->(%p): Thunking to IDirectDrawSurface4\n", This, Rect); + return IDirectDrawSurface4_AddOverlayDirtyRect(dds4_from_impl(This), Rect); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_Blt(IDirectDrawSurface4 *iface, + RECT *DestRect, + IDirectDrawSurface4 *SrcSurface, + RECT *SrcRect, + DWORD Flags, + DDBLTFX *DDBltFx) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + IDirectDrawSurfaceImpl *Src = impl_from_dds4(SrcSurface); + TRACE("(%p)->(%p,%p,%p,0x%08x,%p)\n", This, DestRect, Src, SrcRect, Flags, DDBltFx); + return IDirectDrawSurface4_Blt(This->parent, DestRect, Src ? Src->parent : NULL, + SrcRect, Flags, DDBltFx); +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_Blt(IDirectDrawSurface3 *iface, + RECT *DestRect, + IDirectDrawSurface3 *SrcSurface, + RECT *SrcRect, + DWORD Flags, + DDBLTFX *DDBltFx) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + IDirectDrawSurfaceImpl *Src = impl_from_dds3(SrcSurface); + TRACE("(%p)->(%p,%p,%p,0x%08x,%p): Thunking to IDirectDrawSurface4\n", This, DestRect, Src, SrcRect, Flags, DDBltFx); + return IDirectDrawSurface4_Blt(dds4_from_impl(This), DestRect, dds4_from_impl(Src), + SrcRect, Flags, DDBltFx); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_BltBatch(IDirectDrawSurface4 *iface, + DDBLTBATCH *Batch, + DWORD Count, + DWORD Flags) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + TRACE("(%p)->(%p,%u,0x%08x)\n", This, Batch, Count, Flags); + return IDirectDrawSurface4_BltBatch(This->parent, Batch, Count, Flags); +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_BltBatch(IDirectDrawSurface3 *iface, + DDBLTBATCH *Batch, + DWORD Count, + DWORD Flags) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + TRACE("(%p)->(%p,%u,0x%08x): Thunking to IDirectDrawSurface4\n", This, Batch, Count, Flags); + return IDirectDrawSurface4_BltBatch(dds4_from_impl(This), Batch, Count, Flags); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_BltFast(IDirectDrawSurface4 *iface, + DWORD dstx, + DWORD dsty, + IDirectDrawSurface4 *Source, + RECT *rsrc, + DWORD trans) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + IDirectDrawSurfaceImpl *Src = impl_from_dds4(Source); + TRACE("(%p)->(%u,%u,%p,%p,0x%08x)\n", This, dstx, dsty, Src, rsrc, trans); + return IDirectDrawSurface4_BltFast(This->parent, dstx, dsty, Src ? Src->parent : NULL, + rsrc, trans); +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_BltFast(IDirectDrawSurface3 *iface, + DWORD dstx, + DWORD dsty, + IDirectDrawSurface3 *Source, + RECT *rsrc, + DWORD trans) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + IDirectDrawSurfaceImpl *Src = impl_from_dds3(Source); + TRACE("(%p)->(%u,%u,%p,%p,0x%08x): Thunking to IDirectDrawSurface4\n", This, dstx, dsty, Src, rsrc, trans); + return IDirectDrawSurface4_BltFast(dds4_from_impl(This), dstx, dsty, dds4_from_impl(Src), + rsrc, trans); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_DeleteAttachedSurface(IDirectDrawSurface4 *iface, + DWORD Flags, + IDirectDrawSurface4 *Attach) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + IDirectDrawSurfaceImpl *Att = impl_from_dds4(Attach); + TRACE("(%p)->(0x%08x,%p)\n", This, Flags, Att); + return IDirectDrawSurface4_DeleteAttachedSurface(This->parent, Flags, + Att ? Att->parent : NULL); +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_DeleteAttachedSurface(IDirectDrawSurface3 *iface, + DWORD Flags, + IDirectDrawSurface3 *Attach) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + IDirectDrawSurfaceImpl *Att = impl_from_dds3(Attach); + TRACE("(%p)->(0x%08x,%p): Thunking to IDirectDrawSurface4\n", This, Flags, Att); + return IDirectDrawSurface4_DeleteAttachedSurface(dds4_from_impl(This), Flags, + dds4_from_impl(Att)); +} + +struct enumsurfaces_wrap +{ + LPDDENUMSURFACESCALLBACK2 orig_cb; + void *orig_ctx; +}; + +static HRESULT WINAPI +enumsurfaces_wrap_cb(IDirectDrawSurface4 *surf, DDSURFACEDESC2 *desc, void *vctx) +{ + struct enumsurfaces_wrap *ctx = (struct enumsurfaces_wrap *) vctx; + IDirectDrawSurface4 *outer = dds_get_outer(surf); + + TRACE("Returning outer surface %p for inner surface %p\n", outer, surf); + IDirectDrawSurface4_AddRef(outer); + IDirectDrawSurface4_Release(surf); + return ctx->orig_cb(outer, desc, vctx); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_EnumAttachedSurfaces(IDirectDrawSurface4 *iface, + void *context, + LPDDENUMSURFACESCALLBACK2 cb) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + struct enumsurfaces_wrap ctx; + TRACE("(%p)->(%p,%p)\n", This, context, cb); + + ctx.orig_cb = cb; + ctx.orig_ctx = context; + return IDirectDrawSurface4_EnumAttachedSurfaces(This->parent, &ctx, enumsurfaces_wrap_cb); +} + +struct enumsurfaces_thunk +{ + LPDDENUMSURFACESCALLBACK orig_cb; + void *orig_ctx; +}; + +static HRESULT WINAPI +enumsurfaces_thunk_cb(IDirectDrawSurface4 *surf, DDSURFACEDESC2 *desc2, void *vctx) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(surf); + struct enumsurfaces_thunk *ctx = (struct enumsurfaces_thunk *) vctx; + DDSURFACEDESC desc; + + TRACE("Thunking back to IDirectDrawSurface3\n"); + IDirectDrawSurface3_AddRef(dds3_from_impl(This)); + IDirectDrawSurface3_Release(surf); + DDSD2_to_DDSD(desc2, &desc); + return ctx->orig_cb((IDirectDrawSurface *) dds3_from_impl(This), &desc, ctx->orig_ctx); +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_EnumAttachedSurfaces(IDirectDrawSurface3 *iface, + void *context, + LPDDENUMSURFACESCALLBACK cb) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + struct enumsurfaces_thunk ctx; + TRACE("(%p)->(%p,%p): Thunking to IDirectDraw4\n", This, context, cb); + + ctx.orig_cb = cb; + ctx.orig_ctx = context; + return IDirectDrawSurface4_EnumAttachedSurfaces(dds4_from_impl(This), &ctx, enumsurfaces_thunk_cb); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_EnumOverlayZOrders(IDirectDrawSurface4 *iface, + DWORD Flags, + void *context, + LPDDENUMSURFACESCALLBACK2 cb) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + struct enumsurfaces_wrap ctx; + TRACE("(%p)->(0x%08x,%p,%p)\n", This, Flags, context, cb); + + ctx.orig_cb = cb; + ctx.orig_ctx = context; + return IDirectDrawSurface4_EnumOverlayZOrders(This->parent, Flags, &ctx, enumsurfaces_wrap_cb); +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_EnumOverlayZOrders(IDirectDrawSurface3 *iface, + DWORD Flags, + void *context, + LPDDENUMSURFACESCALLBACK cb) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + struct enumsurfaces_thunk ctx; + TRACE("(%p)->(0x%08x,%p,%p): Thunking to IDirectDraw4\n", This, Flags, context, cb); + + ctx.orig_cb = cb; + ctx.orig_ctx = context; + return IDirectDrawSurface4_EnumOverlayZOrders(dds4_from_impl(This), Flags, &ctx, enumsurfaces_thunk_cb); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_Flip(IDirectDrawSurface4 *iface, + IDirectDrawSurface4 *DestOverride, + DWORD Flags) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + IDirectDrawSurfaceImpl *Dest = impl_from_dds4(DestOverride); + TRACE("(%p)->(%p,0x%08x)\n", This, Dest, Flags); + return IDirectDrawSurface4_Flip(This->parent, Dest ? Dest->parent : NULL, Flags); +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_Flip(IDirectDrawSurface3 *iface, + IDirectDrawSurface3 *DestOverride, + DWORD Flags) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + IDirectDrawSurfaceImpl *Dest = impl_from_dds3(DestOverride); + TRACE("(%p)->(%p,0x%08x): Thunking to IDirectDrawSurface4\n", This, Dest, Flags); + return IDirectDrawSurface4_Flip(dds4_from_impl(This), dds4_from_impl(Dest), Flags); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_GetAttachedSurface(IDirectDrawSurface4 *iface, + DDSCAPS2 *Caps, + IDirectDrawSurface4 **Surface) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + IDirectDrawSurface4 *inner = NULL; + HRESULT hr; + TRACE("(%p)->(%p,%p)\n", This, Caps, Surface); + + hr = IDirectDrawSurface4_GetAttachedSurface(dds4_from_impl(This), Caps, &inner); + if(SUCCEEDED(hr)) + { + *Surface = dds_get_outer(inner); + IDirectDrawSurface4_AddRef(*Surface); + IDirectDrawSurface4_Release(inner); + } + else + { + *Surface = NULL; + } + return hr; +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_GetAttachedSurface(IDirectDrawSurface3 *iface, + DDSCAPS *Caps, + IDirectDrawSurface3 **Surface) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + IDirectDrawSurface4 *surf4; + DDSCAPS2 caps2; + HRESULT hr; + TRACE("(%p)->(%p,%p): Thunking to IDirectDrawSurface4\n", This, Caps, Surface); + + memset(&caps2, 0, sizeof(caps2)); + caps2.dwCaps = Caps->dwCaps; + hr = IDirectDrawSurface4_GetAttachedSurface(dds4_from_impl(This), &caps2, &surf4); + if(SUCCEEDED(hr)) + { + IDirectDrawSurface4_QueryInterface(surf4, &IID_IDirectDrawSurface3, (void **) Surface); + IDirectDrawSurface4_Release(surf4); + } + else + { + *Surface = NULL; + } + return hr; +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_GetBltStatus(IDirectDrawSurface4 *iface, + DWORD Flags) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + TRACE("(%p)->(0x%08x)\n", This, Flags); + return IDirectDrawSurface4_GetBltStatus(This->parent, Flags); +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_GetBltStatus(IDirectDrawSurface3 *iface, + DWORD Flags) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + TRACE("(%p)->(0x%08x): Thunking to IDirectDrawSurface4\n", This, Flags); + return IDirectDrawSurface4_GetBltStatus(dds4_from_impl(This), Flags); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_GetCaps(IDirectDrawSurface4 *iface, + DDSCAPS2 *Caps) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + TRACE("(%p)->(%p)\n", This, Caps); + return IDirectDrawSurface4_GetCaps(This->parent, Caps); +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_GetCaps(IDirectDrawSurface3 *iface, + DDSCAPS *Caps) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + DDSCAPS2 caps2; + HRESULT hr; + TRACE("(%p)->(%p): Thunking to IDirectDrawSurface4\n", This, Caps); + + memset(&caps2, 0, sizeof(caps2)); + memset(Caps, 0, sizeof(*Caps)); + hr = IDirectDrawSurface4_GetCaps(dds4_from_impl(This), &caps2); + Caps->dwCaps = caps2.dwCaps; + return hr; +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_GetClipper(IDirectDrawSurface4 *iface, + IDirectDrawClipper **Clipper) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + TRACE("(%p)->(%p)\n", This, Clipper); + return IDirectDrawSurface4_GetClipper(This->parent, Clipper); +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_GetClipper(IDirectDrawSurface3 *iface, + IDirectDrawClipper **Clipper) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + TRACE("(%p)->(%p): Thunking to IDirectDrawSurface4\n", This, Clipper); + return IDirectDrawSurface4_GetClipper(dds4_from_impl(This), Clipper); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_GetColorKey(IDirectDrawSurface4 *iface, + DWORD Flags, + DDCOLORKEY *CKey) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + TRACE("(%p)->(0x%08x,%p)\n", This, Flags, CKey); + return IDirectDrawSurface4_GetColorKey(This->parent, Flags, CKey); +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_GetColorKey(IDirectDrawSurface3 *iface, + DWORD Flags, + DDCOLORKEY *CKey) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + TRACE("(%p)->(0x%08x,%p): Thunking to IDirectDrawSurface4\n", This, Flags, CKey); + return IDirectDrawSurface4_GetColorKey(dds4_from_impl(This), Flags, CKey); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_GetDC(IDirectDrawSurface4 *iface, + HDC *hdc) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + TRACE("(%p)->(%p)\n", This, hdc); + if(This->permanent_dc) + { + TRACE("Returning stored dc %p\n", This->hdc); + *hdc = This->hdc; + return DD_OK; + } + else + { + return IDirectDrawSurface4_GetDC(This->parent, hdc); + } +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_GetDC(IDirectDrawSurface3 *iface, + HDC *hdc) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + TRACE("(%p)->(%p): Thunking to IDirectDrawSurface4\n", This, hdc); + return IDirectDrawSurface4_GetDC(dds4_from_impl(This), hdc); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_GetFlipStatus(IDirectDrawSurface4 *iface, + DWORD Flags) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + TRACE("(%p)->(0x%08x)\n", This, Flags); + return IDirectDrawSurface4_GetFlipStatus(This->parent, Flags); +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_GetFlipStatus(IDirectDrawSurface3 *iface, + DWORD Flags) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + TRACE("(%p)->(0x%08x): Thunking to IDirectDrawSurface4\n", This, Flags); + return IDirectDrawSurface4_GetFlipStatus(dds4_from_impl(This), Flags); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_GetOverlayPosition(IDirectDrawSurface4 *iface, + LONG *X, + LONG *Y) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + TRACE("(%p)->(%p,%p)\n", This, X, Y); + return IDirectDrawSurface4_GetOverlayPosition(This->parent, X, Y); +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_GetOverlayPosition(IDirectDrawSurface3 *iface, + LONG *X, + LONG *Y) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + TRACE("(%p)->(%p,%p): Thunking to IDirectDrawSurface4\n", This, X, Y); + return IDirectDrawSurface4_GetOverlayPosition(dds4_from_impl(This), X, Y); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_GetPalette(IDirectDrawSurface4 *iface, + IDirectDrawPalette **Pal) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + TRACE("(%p)->(%p)\n", This, Pal); + return IDirectDrawSurface4_GetPalette(This->parent, Pal); +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_GetPalette(IDirectDrawSurface3 *iface, + IDirectDrawPalette **Pal) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + TRACE("(%p)->(%p): Thunking to IDirectDrawSurface4\n", This, Pal); + return IDirectDrawSurface4_GetPalette(dds4_from_impl(This), Pal); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_GetPixelFormat(IDirectDrawSurface4 *iface, + DDPIXELFORMAT *PixelFormat) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + TRACE("(%p)->(%p)\n", This, PixelFormat); + return IDirectDrawSurface4_GetPixelFormat(This->parent, PixelFormat); +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_GetPixelFormat(IDirectDrawSurface3 *iface, + DDPIXELFORMAT *PixelFormat) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + TRACE("(%p)->(%p): Thunking to IDirectDrawSurface4\n", This, PixelFormat); + return IDirectDrawSurface4_GetPixelFormat(dds4_from_impl(This), PixelFormat); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_GetSurfaceDesc(IDirectDrawSurface4 *iface, + DDSURFACEDESC2 *DDSD) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + HRESULT hr; + TRACE("(%p)->(%p)\n", This, DDSD); + hr = IDirectDrawSurface4_GetSurfaceDesc(This->parent, DDSD); + + if(SUCCEEDED(hr) && This->permanent_dc) + { + DDSD->ddsCaps.dwCaps |= DDSCAPS_VIDEOMEMORY; + DDSD->ddsCaps.dwCaps &= ~DDSCAPS_OWNDC; + } + + return hr; +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_GetSurfaceDesc(IDirectDrawSurface3 *iface, + DDSURFACEDESC *DDSD) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + DDSURFACEDESC2 ddsd2; + HRESULT hr; + TRACE("(%p)->(%p): Thunking to IDirectDrawSurface4\n", This, DDSD); + + memset(&ddsd2, 0, sizeof(ddsd2)); + ddsd2.dwSize = sizeof(ddsd2); + hr = IDirectDrawSurface4_GetSurfaceDesc(dds4_from_impl(This), &ddsd2); + DDSD2_to_DDSD(&ddsd2, DDSD); + return hr; +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_Initialize(IDirectDrawSurface4 *iface, + IDirectDraw *DD, + DDSURFACEDESC2 *DDSD) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + IDirectDraw4 *outer_DD4; + IDirectDraw4 *inner_DD4; + IDirectDraw *inner_DD; + HRESULT hr; + TRACE("(%p)->(%p,%p)\n", This, DD, DDSD); + + IDirectDraw_QueryInterface(DD, &IID_IDirectDraw4, (void **) &outer_DD4); + inner_DD4 = dd_get_inner(outer_DD4); + IDirectDraw4_Release(outer_DD4); + IDirectDraw4_QueryInterface(inner_DD4, &IID_IDirectDraw4, (void **) &inner_DD); + hr = IDirectDrawSurface4_Initialize(This->parent, inner_DD, DDSD); + IDirectDraw_Release(inner_DD); + return hr; +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_Initialize(IDirectDrawSurface3 *iface, + IDirectDraw *DD, + DDSURFACEDESC *DDSD) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + DDSURFACEDESC2 ddsd2; + TRACE("(%p)->(%p,%p): Thunking to IDirectDrawSurface4\n", This, DD, DDSD); + DDSD_to_DDSD2(DDSD, &ddsd2); + return IDirectDrawSurface4_Initialize(dds4_from_impl(This), DD, &ddsd2); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_IsLost(IDirectDrawSurface4 *iface) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + TRACE("(%p)\n", This); + return IDirectDrawSurface4_IsLost(This->parent); +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_IsLost(IDirectDrawSurface3 *iface) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + TRACE("(%p): Thunking to IDirectDrawSurface4\n", This); + return IDirectDrawSurface4_IsLost(dds4_from_impl(This)); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_Lock(IDirectDrawSurface4 *iface, + RECT *Rect, + DDSURFACEDESC2 *DDSD, + DWORD Flags, + HANDLE h) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + HRESULT hr; + TRACE("(%p)->(%p,%p,0x%08x,%p)\n", This, Rect, DDSD, Flags, h); + hr = IDirectDrawSurface4_Lock(This->parent, Rect, DDSD, Flags, h); + + if(SUCCEEDED(hr) && This->permanent_dc) + { + DDSD->ddsCaps.dwCaps |= DDSCAPS_VIDEOMEMORY; + DDSD->ddsCaps.dwCaps &= ~DDSCAPS_OWNDC; + } + + return hr; +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_Lock(IDirectDrawSurface3 *iface, + RECT *Rect, + DDSURFACEDESC *DDSD, + DWORD Flags, + HANDLE h) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + DDSURFACEDESC2 ddsd2; + HRESULT hr; + TRACE("(%p)->(%p,%p,0x%08x,%p): Thunking to IDirectDrawSurface4\n", This, Rect, DDSD, Flags, h); + memset(&ddsd2, 0, sizeof(ddsd2)); + ddsd2.dwSize = sizeof(ddsd2); + hr = IDirectDrawSurface4_Lock(dds4_from_impl(This), Rect, &ddsd2, Flags, h); + DDSD2_to_DDSD(&ddsd2, DDSD); + return hr; +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_ReleaseDC(IDirectDrawSurface4 *iface, + HDC hdc) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + TRACE("(%p)->(%p)\n", This, hdc); + if(This->permanent_dc) + { + TRACE("Surface has a permanent DC, not doing anything\n"); + return DD_OK; + } + else + { + return IDirectDrawSurface4_ReleaseDC(This->parent, hdc); + } +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_ReleaseDC(IDirectDrawSurface3 *iface, + HDC hdc) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + TRACE("(%p)->(%p): Thunking to IDirectDrawSurface4\n", This, hdc); + return IDirectDrawSurface4_ReleaseDC(dds4_from_impl(This), hdc); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_Restore(IDirectDrawSurface4 *iface) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + TRACE("(%p)\n", This); + return IDirectDrawSurface4_Restore(This->parent); +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_Restore(IDirectDrawSurface3 *iface) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + TRACE("(%p): Thunking to IDirectDrawSurface4\n", This); + return IDirectDrawSurface4_Restore(dds4_from_impl(This)); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_SetClipper(IDirectDrawSurface4 *iface, + IDirectDrawClipper *Clipper) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + TRACE("(%p)->(%p)\n", This, Clipper); + return IDirectDrawSurface4_SetClipper(This->parent, Clipper); +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_SetClipper(IDirectDrawSurface3 *iface, + IDirectDrawClipper *Clipper) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + TRACE("(%p)->(%p): Thunking to IDirectDrawSurface4\n", This, Clipper); + return IDirectDrawSurface4_SetClipper(dds4_from_impl(This), Clipper); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_SetColorKey(IDirectDrawSurface4 *iface, + DWORD Flags, + DDCOLORKEY *CKey) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + TRACE("(%p)->(0x%08x,%p)\n", This, Flags, CKey); + return IDirectDrawSurface4_SetColorKey(This->parent, Flags, CKey); +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_SetColorKey(IDirectDrawSurface3 *iface, + DWORD Flags, + DDCOLORKEY *CKey) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + TRACE("(%p)->(0x%08x,%p): Thunking to IDirectDrawSurface4\n", This, Flags, CKey); + return IDirectDrawSurface4_SetColorKey(dds4_from_impl(This), Flags, CKey); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_SetOverlayPosition(IDirectDrawSurface4 *iface, + LONG X, + LONG Y) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + TRACE("(%p)->(%u,%u)\n", This, X, Y); + return IDirectDrawSurface4_SetOverlayPosition(This->parent, X, Y); +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_SetOverlayPosition(IDirectDrawSurface3 *iface, + LONG X, + LONG Y) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + TRACE("(%p)->(%u,%u): Thunking to IDirectDrawSurface4\n", This, X, Y); + return IDirectDrawSurface4_SetOverlayPosition(dds4_from_impl(This), X, Y); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_SetPalette(IDirectDrawSurface4 *iface, + IDirectDrawPalette *Pal) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + TRACE("(%p)->(%p)\n", This, Pal); + return IDirectDrawSurface4_SetPalette(This->parent, Pal); +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_SetPalette(IDirectDrawSurface3 *iface, + IDirectDrawPalette *Pal) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + TRACE("(%p)->(%p): Thunking to IDirectDrawSurface4\n", This, Pal); + return IDirectDrawSurface4_SetPalette(dds4_from_impl(This), Pal); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_Unlock(IDirectDrawSurface4 *iface, + RECT *pRect) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + TRACE("(%p)->(%p)\n", This, pRect); + return IDirectDrawSurface4_Unlock(This->parent, pRect); +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_Unlock(IDirectDrawSurface3 *iface, + void *data) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + TRACE("(%p)->(%p): Thunking to IDirectDrawSurface4\n", This, data); + return IDirectDrawSurface4_Unlock(dds4_from_impl(This), NULL); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_UpdateOverlay(IDirectDrawSurface4 *iface, + LPRECT SrcRect, + IDirectDrawSurface4 *DstSurface, + LPRECT DstRect, + DWORD Flags, + LPDDOVERLAYFX FX) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + IDirectDrawSurfaceImpl *Dst = impl_from_dds4(DstSurface); + TRACE("(%p)->(%p,%p,%p,0x%08x,%p)\n", This, SrcRect, Dst, DstRect, Flags, FX); + return IDirectDrawSurface4_UpdateOverlay(This->parent, SrcRect, Dst ? Dst->parent : NULL, + DstRect, Flags, FX); +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_UpdateOverlay(IDirectDrawSurface3 *iface, + LPRECT SrcRect, + IDirectDrawSurface3 *DstSurface, + LPRECT DstRect, + DWORD Flags, + LPDDOVERLAYFX FX) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + IDirectDrawSurfaceImpl *Dst = impl_from_dds3(DstSurface); + TRACE("(%p)->(%p,%p,%p,0x%08x,%p): Thunking to IDirectDrawSurface4\n", This, SrcRect, Dst, DstRect, Flags, FX); + return IDirectDrawSurface4_UpdateOverlay(dds4_from_impl(This), SrcRect, dds4_from_impl(Dst), + DstRect, Flags, FX); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_UpdateOverlayDisplay(IDirectDrawSurface4 *iface, + DWORD Flags) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + TRACE("(%p)->(0x%08x)\n", This, Flags); + return IDirectDrawSurface4_UpdateOverlayDisplay(This->parent, Flags); +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_UpdateOverlayDisplay(IDirectDrawSurface3 *iface, + DWORD Flags) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + TRACE("(%p)->(0x%08x): Thunking to IDirectDrawSurface4\n", This, Flags); + return IDirectDrawSurface4_UpdateOverlayDisplay(dds4_from_impl(This), Flags); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_UpdateOverlayZOrder(IDirectDrawSurface4 *iface, + DWORD Flags, + IDirectDrawSurface4 *DDSRef) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + IDirectDrawSurfaceImpl *Ref = impl_from_dds4(DDSRef); + TRACE("(%p)->(0x%08x,%p)\n", This, Flags, Ref); + return IDirectDrawSurface4_UpdateOverlayZOrder(This->parent, Flags, Ref ? Ref->parent : NULL); +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_UpdateOverlayZOrder(IDirectDrawSurface3 *iface, + DWORD Flags, + IDirectDrawSurface3 *DDSRef) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + IDirectDrawSurfaceImpl *Ref = impl_from_dds3(DDSRef); + TRACE("(%p)->(0x%08x,%p): Thunking to IDirectDrawSurface4\n", This, Flags, Ref); + return IDirectDrawSurface4_UpdateOverlayZOrder(dds4_from_impl(This), Flags, dds4_from_impl(Ref)); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_GetDDInterface(IDirectDrawSurface4 *iface, + void **DD) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + FIXME("(%p)->(%p)\n", This, DD); + /* This has to be implemented in ddrawex, DDraw's interface can't be used because it is pretty + * hard to tell which version of the DD interface is returned + */ + *DD = NULL; + return E_FAIL; +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_GetDDInterface(IDirectDrawSurface3 *iface, + void **DD) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + FIXME("(%p)->(%p)\n", This, DD); + /* A thunk it pretty pointless because of the same reason relaying to ddraw.dll works badly + */ + *DD = NULL; + return E_FAIL; +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_PageLock(IDirectDrawSurface4 *iface, + DWORD Flags) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + TRACE("(%p)->(%x)\n", iface, Flags); + return IDirectDrawSurface4_PageLock(This->parent, Flags); +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_PageLock(IDirectDrawSurface3 *iface, + DWORD Flags) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + TRACE("(%p)->(%x): Thunking to IDirectDrawSurface4\n", iface, Flags); + return IDirectDrawSurface4_PageLock(dds4_from_impl(This), Flags); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_PageUnlock(IDirectDrawSurface4 *iface, + DWORD Flags) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + TRACE("(%p)->(%x)\n", iface, Flags); + return IDirectDrawSurface4_PageUnlock(This->parent, Flags); +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_PageUnlock(IDirectDrawSurface3 *iface, + DWORD Flags) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + TRACE("(%p)->(%x): Thunking to IDirectDrawSurface4\n", iface, Flags); + return IDirectDrawSurface4_PageUnlock(dds4_from_impl(This), Flags); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_SetSurfaceDesc(IDirectDrawSurface4 *iface, + DDSURFACEDESC2 *DDSD, + DWORD Flags) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + TRACE("(%p)->(%p,0x%08x)\n", This, DDSD, Flags); + return IDirectDrawSurface4_SetSurfaceDesc(This->parent, DDSD, Flags); +} + +static HRESULT WINAPI +IDirectDrawSurface3Impl_SetSurfaceDesc(IDirectDrawSurface3 *iface, + DDSURFACEDESC *DDSD, + DWORD Flags) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds3(iface); + DDSURFACEDESC2 ddsd; + TRACE("(%p)->(%p,0x%08x): Thunking to IDirectDrawSurface4\n", This, DDSD, Flags); + + DDSD_to_DDSD2(DDSD, &ddsd); + return IDirectDrawSurface4_SetSurfaceDesc(dds4_from_impl(This), &ddsd, Flags); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_SetPrivateData(IDirectDrawSurface4 *iface, + REFGUID tag, + void *Data, + DWORD Size, + DWORD Flags) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + TRACE("(%p)->(%s,%p,%u,0x%08x)\n", iface, debugstr_guid(tag), Data, Size, Flags); + + /* To completely avoid this we'd have to clone the private data API in ddrawex */ + if(IsEqualGUID(&IID_DDrawexPriv, tag)) { + FIXME("Application uses ddrawex's private guid\n"); + } + + return IDirectDrawSurface4_SetPrivateData(This->parent, tag, Data, Size, Flags); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_GetPrivateData(IDirectDrawSurface4 *iface, + REFGUID tag, + void *Data, + DWORD *Size) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + TRACE("(%p)->(%s,%p,%p)\n", iface, debugstr_guid(tag), Data, Size); + + /* To completely avoid this we'd have to clone the private data API in ddrawex */ + if(IsEqualGUID(&IID_DDrawexPriv, tag)) { + FIXME("Application uses ddrawex's private guid\n"); + } + + return IDirectDrawSurface4_GetPrivateData(This->parent, tag, Data, Size); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_FreePrivateData(IDirectDrawSurface4 *iface, + REFGUID tag) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + TRACE("(%p)->(%s)\n", iface, debugstr_guid(tag)); + + /* To completely avoid this we'd have to clone the private data API in ddrawex */ + if(IsEqualGUID(&IID_DDrawexPriv, tag)) { + FIXME("Application uses ddrawex's private guid\n"); + } + + return IDirectDrawSurface4_FreePrivateData(This->parent, tag); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_GetUniquenessValue(IDirectDrawSurface4 *iface, + LPDWORD pValue) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + TRACE("(%p)->(%p)\n", This, pValue); + return IDirectDrawSurface4_GetUniquenessValue(This->parent, pValue); +} + +static HRESULT WINAPI +IDirectDrawSurface4Impl_ChangeUniquenessValue(IDirectDrawSurface4 *iface) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + TRACE("(%p)\n", This); + return IDirectDrawSurface4_ChangeUniquenessValue(This->parent); +} + +const IDirectDrawSurface3Vtbl IDirectDrawSurface3_Vtbl = +{ + /* IUnknown */ + IDirectDrawSurface3Impl_QueryInterface, + IDirectDrawSurface3Impl_AddRef, + IDirectDrawSurface3Impl_Release, + /* IDirectDrawSurface */ + IDirectDrawSurface3Impl_AddAttachedSurface, + IDirectDrawSurface3Impl_AddOverlayDirtyRect, + IDirectDrawSurface3Impl_Blt, + IDirectDrawSurface3Impl_BltBatch, + IDirectDrawSurface3Impl_BltFast, + IDirectDrawSurface3Impl_DeleteAttachedSurface, + IDirectDrawSurface3Impl_EnumAttachedSurfaces, + IDirectDrawSurface3Impl_EnumOverlayZOrders, + IDirectDrawSurface3Impl_Flip, + IDirectDrawSurface3Impl_GetAttachedSurface, + IDirectDrawSurface3Impl_GetBltStatus, + IDirectDrawSurface3Impl_GetCaps, + IDirectDrawSurface3Impl_GetClipper, + IDirectDrawSurface3Impl_GetColorKey, + IDirectDrawSurface3Impl_GetDC, + IDirectDrawSurface3Impl_GetFlipStatus, + IDirectDrawSurface3Impl_GetOverlayPosition, + IDirectDrawSurface3Impl_GetPalette, + IDirectDrawSurface3Impl_GetPixelFormat, + IDirectDrawSurface3Impl_GetSurfaceDesc, + IDirectDrawSurface3Impl_Initialize, + IDirectDrawSurface3Impl_IsLost, + IDirectDrawSurface3Impl_Lock, + IDirectDrawSurface3Impl_ReleaseDC, + IDirectDrawSurface3Impl_Restore, + IDirectDrawSurface3Impl_SetClipper, + IDirectDrawSurface3Impl_SetColorKey, + IDirectDrawSurface3Impl_SetOverlayPosition, + IDirectDrawSurface3Impl_SetPalette, + IDirectDrawSurface3Impl_Unlock, + IDirectDrawSurface3Impl_UpdateOverlay, + IDirectDrawSurface3Impl_UpdateOverlayDisplay, + IDirectDrawSurface3Impl_UpdateOverlayZOrder, + /* IDirectDrawSurface 2 */ + IDirectDrawSurface3Impl_GetDDInterface, + IDirectDrawSurface3Impl_PageLock, + IDirectDrawSurface3Impl_PageUnlock, + /* IDirectDrawSurface 3 */ + IDirectDrawSurface3Impl_SetSurfaceDesc +}; + +const IDirectDrawSurface4Vtbl IDirectDrawSurface4_Vtbl = +{ + /*** IUnknown ***/ + IDirectDrawSurface4Impl_QueryInterface, + IDirectDrawSurface4Impl_AddRef, + IDirectDrawSurface4Impl_Release, + /*** IDirectDrawSurface ***/ + IDirectDrawSurface4Impl_AddAttachedSurface, + IDirectDrawSurface4Impl_AddOverlayDirtyRect, + IDirectDrawSurface4Impl_Blt, + IDirectDrawSurface4Impl_BltBatch, + IDirectDrawSurface4Impl_BltFast, + IDirectDrawSurface4Impl_DeleteAttachedSurface, + IDirectDrawSurface4Impl_EnumAttachedSurfaces, + IDirectDrawSurface4Impl_EnumOverlayZOrders, + IDirectDrawSurface4Impl_Flip, + IDirectDrawSurface4Impl_GetAttachedSurface, + IDirectDrawSurface4Impl_GetBltStatus, + IDirectDrawSurface4Impl_GetCaps, + IDirectDrawSurface4Impl_GetClipper, + IDirectDrawSurface4Impl_GetColorKey, + IDirectDrawSurface4Impl_GetDC, + IDirectDrawSurface4Impl_GetFlipStatus, + IDirectDrawSurface4Impl_GetOverlayPosition, + IDirectDrawSurface4Impl_GetPalette, + IDirectDrawSurface4Impl_GetPixelFormat, + IDirectDrawSurface4Impl_GetSurfaceDesc, + IDirectDrawSurface4Impl_Initialize, + IDirectDrawSurface4Impl_IsLost, + IDirectDrawSurface4Impl_Lock, + IDirectDrawSurface4Impl_ReleaseDC, + IDirectDrawSurface4Impl_Restore, + IDirectDrawSurface4Impl_SetClipper, + IDirectDrawSurface4Impl_SetColorKey, + IDirectDrawSurface4Impl_SetOverlayPosition, + IDirectDrawSurface4Impl_SetPalette, + IDirectDrawSurface4Impl_Unlock, + IDirectDrawSurface4Impl_UpdateOverlay, + IDirectDrawSurface4Impl_UpdateOverlayDisplay, + IDirectDrawSurface4Impl_UpdateOverlayZOrder, + /*** IDirectDrawSurface2 ***/ + IDirectDrawSurface4Impl_GetDDInterface, + IDirectDrawSurface4Impl_PageLock, + IDirectDrawSurface4Impl_PageUnlock, + /*** IDirectDrawSurface3 ***/ + IDirectDrawSurface4Impl_SetSurfaceDesc, + /*** IDirectDrawSurface4 ***/ + IDirectDrawSurface4Impl_SetPrivateData, + IDirectDrawSurface4Impl_GetPrivateData, + IDirectDrawSurface4Impl_FreePrivateData, + IDirectDrawSurface4Impl_GetUniquenessValue, + IDirectDrawSurface4Impl_ChangeUniquenessValue, +}; + +/* dds_get_outer + * + * Given a surface from ddraw.dll it retrieves the pointer to the ddrawex.dll wrapper around it + * + * Parameters: + * inner: ddraw.dll surface to retrieve the outer surface from + * + * Returns: + * The surface wrapper. If there is none yet, a new one is created + */ +IDirectDrawSurface4 *dds_get_outer(IDirectDrawSurface4 *inner) +{ + IDirectDrawSurface4 *outer = NULL; + DWORD size = sizeof(outer); + HRESULT hr; + if(!inner) return NULL; + + hr = IDirectDrawSurface4_GetPrivateData(inner, + &IID_DDrawexPriv, + &outer, + &size); + if(FAILED(hr) || outer == NULL) + { + IDirectDrawSurfaceImpl *impl; + + TRACE("Creating new ddrawex surface wrapper for surface %p\n", inner); + impl = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*impl)); + impl->ref = 1; + impl->IDirectDrawSurface3_Vtbl = &IDirectDrawSurface3_Vtbl; + impl->IDirectDrawSurface4_Vtbl = &IDirectDrawSurface4_Vtbl; + IDirectDrawSurface4_AddRef(inner); + impl->parent = inner; + + outer = dds4_from_impl(impl); + + hr = IDirectDrawSurface4_SetPrivateData(inner, + &IID_DDrawexPriv, + &outer, + sizeof(outer), + 0 /* Flags */); + if(FAILED(hr)) + { + ERR("IDirectDrawSurface4_SetPrivateData failed\n"); + } + } + + return outer; +} + +IDirectDrawSurface4 *dds_get_inner(IDirectDrawSurface4 *outer) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(outer); + if(This == NULL) return NULL; + return This->parent; +} + +HRESULT prepare_permanent_dc(IDirectDrawSurface4 *iface) +{ + IDirectDrawSurfaceImpl *This = impl_from_dds4(iface); + HRESULT hr; + This->permanent_dc = TRUE; + + hr = IDirectDrawSurface4_GetDC(This->parent, &This->hdc); + if(FAILED(hr)) return hr; + hr = IDirectDrawSurface4_ReleaseDC(This->parent, This->hdc); + return hr; +} diff --git a/dlls/ddrawex/Makefile.in b/dlls/ddrawex/tests/Makefile.in similarity index 50% copy from dlls/ddrawex/Makefile.in copy to dlls/ddrawex/tests/Makefile.in index 8cf514b628a..709059ef082 100644 --- a/dlls/ddrawex/Makefile.in +++ b/dlls/ddrawex/tests/Makefile.in @@ -1,14 +1,14 @@ TOPSRCDIR = @top_srcdir@ -TOPOBJDIR = ../.. +TOPOBJDIR = ../../.. SRCDIR = @srcdir@ VPATH = @srcdir@ -MODULE = ddrawex.dll -IMPORTS = dxguid uuid ddraw ole32 advapi32 kernel32 +TESTDLL = ddrawex.dll +IMPORTS = user32 gdi32 kernel32 -C_SRCS = \ - main.c \ - regsvr.c +CTESTS = \ + ddrawex.c \ + surface.c -@MAKE_DLL_RULES@ +@MAKE_TEST_RULES@ @DEPENDENCIES@ # everything below this line is overwritten by make depend diff --git a/dlls/ddrawex/tests/ddrawex.c b/dlls/ddrawex/tests/ddrawex.c new file mode 100644 index 00000000000..848c149dda3 --- /dev/null +++ b/dlls/ddrawex/tests/ddrawex.c @@ -0,0 +1,119 @@ +/* + * Unit tests for ddrawex specific things + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ +#define COBJMACROS + +#include +#include "wine/test.h" +#include "windef.h" +#include "winbase.h" +#include "ddraw.h" +#include "ddrawex.h" +#include "unknwn.h" + +static IDirectDrawFactory *factory; +static HRESULT (WINAPI *pDllGetClassObject)(REFCLSID rclsid, REFIID riid, LPVOID *ppv); + +static IDirectDraw *createDD(void) +{ + HRESULT hr; + IDirectDraw *dd; + + hr = IDirectDrawFactory_CreateDirectDraw(factory, NULL, NULL, DDSCL_NORMAL, 0, + 0, &dd); + ok(hr == DD_OK, "Failed to create an IDirectDraw interface, hr = 0x%08x\n", hr); + return SUCCEEDED(hr) ? dd : NULL; +} + +static ULONG get_ref(IUnknown *o) +{ + IUnknown_AddRef(o); + return IUnknown_Release(o); +} + +static void RefCountTest(void) +{ + IDirectDraw *dd1 = createDD(); + IDirectDraw2 *dd2; + IDirectDraw3 *dd3; + IDirectDraw4 *dd4; + ULONG ref; + + ref = get_ref((IUnknown *) dd1); + ok(ref == 1, "A new ddraw object's refcount is %u, expected 1\n", ref); + + IDirectDraw_AddRef(dd1); + ref = get_ref((IUnknown *) dd1); + ok(ref == 2, "After AddRef the refcount is %u, expected 2\n", ref); + IDirectDraw_Release(dd1); + ref = get_ref((IUnknown *) dd1); + ok(ref == 1, "After Release the refcount is %u, expected 2\n", ref); + + IDirectDraw_QueryInterface(dd1, &IID_IDirectDraw2, (void **) &dd2); + ref = get_ref((IUnknown *) dd2); + ok(ref == 2, "IDirectDraw2 refcount is %u, expected 2\n", ref); + + IDirectDraw_QueryInterface(dd1, &IID_IDirectDraw3, (void **) &dd3); + ref = get_ref((IUnknown *) dd3); + ok(ref == 3, "IDirectDraw3 refcount is %u, expected 3\n", ref); + + IDirectDraw_QueryInterface(dd1, &IID_IDirectDraw4, (void **) &dd4); + ref = get_ref((IUnknown *) dd4); + ok(ref == 4, "IDirectDraw4 refcount is %u, expected 4\n", ref); + + IDirectDraw_Release(dd1); + IDirectDraw2_Release(dd2); + IDirectDraw3_Release(dd3); + + ref = get_ref((IUnknown *) dd4); + ok(ref == 1, "IDirectDraw4 refcount is %u, expected 1\n", ref); + + IDirectDraw4_Release(dd4); +} + +START_TEST(ddrawex) +{ + IClassFactory *classfactory = NULL; + ULONG ref; + HRESULT hr; + HMODULE hmod = LoadLibrary("ddrawex.dll"); + if(hmod == NULL) { + skip("Failed to load ddrawex.dll\n"); + return; + } + pDllGetClassObject = (void*)GetProcAddress(hmod, "DllGetClassObject"); + if(pDllGetClassObject == NULL) { + skip("Failed to get DllGetClassObject\n"); + return; + } + + hr = pDllGetClassObject(&CLSID_DirectDrawFactory, &IID_IClassFactory, (void **) &classfactory); + ok(hr == S_OK, "Failed to create a IClassFactory\n"); + hr = IClassFactory_CreateInstance(classfactory, NULL, &IID_IDirectDrawFactory, (void **) &factory); + ok(hr == S_OK, "Failed to create a IDirectDrawFactory\n"); + + RefCountTest(); + + if(factory) { + ref = IDirectDrawFactory_Release(factory); + ok(ref == 0, "IDirectDrawFactory not cleanly released\n"); + } + if(classfactory) { + ref = IClassFactory_Release(classfactory); + todo_wine ok(ref == 1, "IClassFactory refcount wrong, ref = %u\n", ref); + } +} diff --git a/dlls/ddrawex/ddrawex_private.h b/dlls/ddrawex/tests/ddrawex.h similarity index 68% copy from dlls/ddrawex/ddrawex_private.h copy to dlls/ddrawex/tests/ddrawex.h index 117ddba1fe6..f57adcff7fc 100644 --- a/dlls/ddrawex/ddrawex_private.h +++ b/dlls/ddrawex/tests/ddrawex.h @@ -16,8 +16,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef __WINE_DLLS_DDRAWEX_DDRAWEX_PRIVATE_H -#define __WINE_DLLS_DDRAWEX_DDRAWEX_PRIVATE_H +#ifndef __WINE_DDRAWEX_DDRAWEX_H +#define __WINE_DDRAWEX_DDRAWEX_H DEFINE_GUID(CLSID_DirectDrawFactory, 0x4fd2a832, 0x86c8, 0x11d0, 0x8f, 0xca, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0x9d); DEFINE_GUID(IID_IDirectDrawFactory, 0x4fd2a833, 0x86c8, 0x11d0, 0x8f, 0xca, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0x9d); @@ -29,7 +29,7 @@ DECLARE_INTERFACE_(IDirectDrawFactory, IUnknown) STDMETHOD_(ULONG, AddRef)(THIS) PURE; STDMETHOD_(ULONG, Release)(THIS) PURE; STDMETHOD(CreateDirectDraw)(THIS_ GUID * pGUID, HWND hWnd, DWORD dwCoopLevelFlags, - DWORD dwReserved, IUnknown *pUnkOuter, IDirectDraw **ppDirectDraw) PURE; + DWORD dwReserved, IUnknown *pUnkOuter, IDirectDraw **ppDirectDraw) PURE; STDMETHOD(_DirectDrawEnumerate)(THIS_ LPDDENUMCALLBACKW lpCallback, LPVOID lpContext) PURE; }; #undef INTERFACE @@ -43,24 +43,4 @@ DECLARE_INTERFACE_(IDirectDrawFactory, IUnknown) #define IDirectDrawFactory_DirectDrawEnumerate(p,a,b) (p)->lpVtbl->_DirectDrawEnumerate(p,a,b) #endif -/****************************************************************************** - * DirectDraw ClassFactory implementation - incomplete - ******************************************************************************/ -typedef struct -{ - const IClassFactoryVtbl *lpVtbl; - LONG ref; - HRESULT (*pfnCreateInstance)(IUnknown *pUnkOuter, REFIID iid, LPVOID *ppObj); -} IClassFactoryImpl; - - -/****************************************************************************** - * DirectDrawFactopry implementation - ******************************************************************************/ -typedef struct -{ - const IDirectDrawFactoryVtbl *lpVtbl; - LONG ref; -} IDirectDrawFactoryImpl; - -#endif /* __WINE_DLLS_DDRAWEX_DDRAWEX_PRIVATE_H */ +#endif /* __WINE_DDRAWEX_DDRAWEX_H */ diff --git a/dlls/ddrawex/tests/surface.c b/dlls/ddrawex/tests/surface.c new file mode 100644 index 00000000000..dd9ebfb0c9f --- /dev/null +++ b/dlls/ddrawex/tests/surface.c @@ -0,0 +1,265 @@ +/* + * Unit tests for ddrawex surfaces + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ +#define COBJMACROS +/* For IID_IDirectDraw3 - it is not in dxguid.dll */ +#define INITGUID + +#include +#include "wine/test.h" +#include "windef.h" +#include "winbase.h" +#include "ddraw.h" +#include "ddrawex.h" +#include "unknwn.h" + +static IDirectDrawFactory *factory; +static HRESULT (WINAPI *pDllGetClassObject)(REFCLSID rclsid, REFIID riid, LPVOID *ppv); + +static IDirectDraw *createDD(void) +{ + HRESULT hr; + IDirectDraw *dd; + + hr = IDirectDrawFactory_CreateDirectDraw(factory, NULL, NULL, DDSCL_NORMAL, 0, + 0, &dd); + ok(hr == DD_OK, "Failed to create an IDirectDraw interface, hr = 0x%08x\n", hr); + return SUCCEEDED(hr) ? dd : NULL; +} + +static void dctest_surf(IDirectDrawSurface *surf, int ddsdver) { + HRESULT hr; + HDC dc, dc2 = (HDC) 0x1234; + DDSURFACEDESC ddsd; + DDSURFACEDESC2 ddsd2; + + memset(&ddsd, 0, sizeof(ddsd)); + ddsd.dwSize = sizeof(ddsd); + memset(&ddsd2, 0, sizeof(ddsd2)); + ddsd2.dwSize = sizeof(ddsd2); + + hr = IDirectDrawSurface_GetDC(surf, &dc); + ok(hr == DD_OK, "IDirectDrawSurface_GetDC failed: 0x%08x\n", hr); + + hr = IDirectDrawSurface_GetDC(surf, &dc); + ok(hr == DDERR_DCALREADYCREATED, "IDirectDrawSurface_GetDC failed: 0x%08x\n", hr); + ok(dc2 == (HDC) 0x1234, "The failed GetDC call changed the dc: %p\n", dc2); + + hr = IDirectDrawSurface_Lock(surf, NULL, ddsdver == 1 ? &ddsd : ((DDSURFACEDESC *) &ddsd2), 0, NULL); + ok(hr == DDERR_SURFACEBUSY, "IDirectDrawSurface_Lock returned 0x%08x, expected DDERR_SURFACEBUSY\n", hr); + + hr = IDirectDrawSurface_ReleaseDC(surf, dc); + ok(hr == DD_OK, "IDirectDrawSurface_ReleaseDC failed: 0x%08x\n", hr); + hr = IDirectDrawSurface_ReleaseDC(surf, dc); + ok(hr == DDERR_NODC, "IDirectDrawSurface_ReleaseDC returned 0x%08x, expected DDERR_NODC\n", hr); +} + +static void GetDCTest_main(DDSURFACEDESC *ddsd, DDSURFACEDESC2 *ddsd2, void (*testfunc)(IDirectDrawSurface *surf, int ddsdver)) +{ + IDirectDrawSurface *surf; + IDirectDrawSurface2 *surf2; + IDirectDrawSurface2 *surf3; + IDirectDrawSurface4 *surf4; + HRESULT hr; + IDirectDraw *dd1 = createDD(); + IDirectDraw2 *dd2; + IDirectDraw3 *dd3; + IDirectDraw4 *dd4; + + hr = IDirectDraw_CreateSurface(dd1, ddsd, &surf, NULL); + ok(hr == DD_OK, "IDirectDraw_CreateSurface failed: 0x%08x\n", hr); + testfunc(surf, 1); + IDirectDrawSurface_Release(surf); + + hr = IDirectDraw_QueryInterface(dd1, &IID_IDirectDraw2, (void **) &dd2); + ok(hr == DD_OK, "IDirectDraw_QueryInterface failed: 0x%08x\n", hr); + + hr = IDirectDraw2_CreateSurface(dd2, ddsd, &surf, NULL); + ok(hr == DD_OK, "IDirectDraw2_CreateSurface failed: 0x%08x\n", hr); + testfunc(surf, 1); + + hr = IDirectDrawSurface_QueryInterface(surf, &IID_IDirectDrawSurface2, (void **) &surf2); + ok(hr == DD_OK, "IDirectDrawSurface_QueryInterface failed: 0x%08x\n", hr); + testfunc((IDirectDrawSurface *) surf2, 1); + + IDirectDrawSurface2_Release(surf2); + IDirectDrawSurface_Release(surf); + IDirectDraw2_Release(dd2); + + hr = IDirectDraw_QueryInterface(dd1, &IID_IDirectDraw3, (void **) &dd3); + ok(hr == DD_OK, "IDirectDraw_QueryInterface failed: 0x%08x\n", hr); + + hr = IDirectDraw3_CreateSurface(dd3, ddsd, &surf, NULL); + ok(hr == DD_OK, "IDirectDraw3_CreateSurface failed: 0x%08x\n", hr); + testfunc(surf, 1); + + hr = IDirectDrawSurface_QueryInterface(surf, &IID_IDirectDrawSurface3, (void **) &surf3); + ok(hr == DD_OK, "IDirectDrawSurface_QueryInterface failed: 0x%08x\n", hr); + testfunc((IDirectDrawSurface *) surf3, 1); + + IDirectDrawSurface3_Release(surf3); + IDirectDrawSurface_Release(surf); + IDirectDraw3_Release(dd3); + + hr = IDirectDraw_QueryInterface(dd1, &IID_IDirectDraw4, (void **) &dd4); + ok(hr == DD_OK, "IDirectDraw_QueryInterface failed: 0x%08x\n", hr); + + surf = NULL; + hr = IDirectDraw4_CreateSurface(dd4, ddsd2, &surf4, NULL); + ok(hr == DD_OK, "IDirectDraw4_CreateSurface failed: 0x%08x\n", hr); + testfunc((IDirectDrawSurface *) surf4, 2); + + IDirectDrawSurface4_Release(surf4); + IDirectDraw4_Release(dd4); + + IDirectDraw_Release(dd1); +} + +static void GetDCTest(void) +{ + DDSURFACEDESC ddsd; + DDSURFACEDESC2 ddsd2; + + memset(&ddsd, 0, sizeof(ddsd)); + ddsd.dwSize = sizeof(ddsd); + ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; + ddsd.dwWidth = 64; + ddsd.dwHeight = 64; + ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + memset(&ddsd2, 0, sizeof(ddsd2)); + ddsd2.dwSize = sizeof(ddsd2); + ddsd2.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; + ddsd2.dwWidth = 64; + ddsd2.dwHeight = 64; + ddsd2.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + + GetDCTest_main(&ddsd, &ddsd2, dctest_surf); +} + +static void CapsTest(void) +{ + DDSURFACEDESC ddsd; + IDirectDraw *dd1 = createDD(); + IDirectDrawSurface *surf; + HRESULT hr; + + memset(&ddsd, 0, sizeof(ddsd)); + ddsd.dwSize = sizeof(ddsd); + ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; + ddsd.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY | DDSCAPS_VIDEOMEMORY; + ddsd.dwWidth = 64; + ddsd.dwHeight = 64; + hr = IDirectDraw_CreateSurface(dd1, &ddsd, &surf, NULL); + ok(hr == DD_OK, "Creating a SYSMEM | VIDMEM surface returned 0x%08x, expected DD_OK\n", hr); + if(surf) IDirectDrawSurface_Release(surf); + + IDirectDraw_Release(dd1); +} + +static void dctest_sysvidmem(IDirectDrawSurface *surf, int ddsdver) { + HRESULT hr; + HDC dc, dc2 = (HDC) 0x1234; + DDSURFACEDESC ddsd; + DDSURFACEDESC2 ddsd2; + + memset(&ddsd, 0, sizeof(ddsd)); + ddsd.dwSize = sizeof(ddsd); + memset(&ddsd2, 0, sizeof(ddsd2)); + ddsd2.dwSize = sizeof(ddsd2); + + hr = IDirectDrawSurface_GetDC(surf, &dc); + ok(hr == DD_OK, "IDirectDrawSurface_GetDC failed: 0x%08x\n", hr); + + hr = IDirectDrawSurface_GetDC(surf, &dc2); + ok(hr == DD_OK, "IDirectDrawSurface_GetDC failed: 0x%08x\n", hr); + ok(dc == dc2, "Got two different DCs\n"); + + hr = IDirectDrawSurface_Lock(surf, NULL, ddsdver == 1 ? &ddsd : ((DDSURFACEDESC *) &ddsd2), 0, NULL); + ok(hr == DD_OK, "IDirectDrawSurface_Lock returned 0x%08x, expected DD_OK\n", hr); + + hr = IDirectDrawSurface_Lock(surf, NULL, ddsdver == 1 ? &ddsd : ((DDSURFACEDESC *) &ddsd2), 0, NULL); + ok(hr == DDERR_SURFACEBUSY, "IDirectDrawSurface_Lock returned 0x%08x, expected DDERR_SURFACEBUSY\n", hr); + + hr = IDirectDrawSurface_Unlock(surf, NULL); + ok(hr == DD_OK, "IDirectDrawSurface_Unlock returned 0x%08x, expected DD_OK\n", hr); + hr = IDirectDrawSurface_Unlock(surf, NULL); + ok(hr == DDERR_NOTLOCKED, "IDirectDrawSurface_Unlock returned 0x%08x, expected DDERR_NOTLOCKED\n", hr); + + hr = IDirectDrawSurface_ReleaseDC(surf, dc); + ok(hr == DD_OK, "IDirectDrawSurface_ReleaseDC failed: 0x%08x\n", hr); + hr = IDirectDrawSurface_ReleaseDC(surf, dc); + ok(hr == DD_OK, "IDirectDrawSurface_ReleaseDC failed: 0x%08x\n", hr); + /* That works any number of times... */ + hr = IDirectDrawSurface_ReleaseDC(surf, dc); + ok(hr == DD_OK, "IDirectDrawSurface_ReleaseDC failed: 0x%08x\n", hr); +} + +static void SysVidMemTest(void) +{ + DDSURFACEDESC ddsd; + DDSURFACEDESC2 ddsd2; + + memset(&ddsd, 0, sizeof(ddsd)); + ddsd.dwSize = sizeof(ddsd); + ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; + ddsd.dwWidth = 64; + ddsd.dwHeight = 64; + ddsd.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY | DDSCAPS_VIDEOMEMORY; + memset(&ddsd2, 0, sizeof(ddsd2)); + ddsd2.dwSize = sizeof(ddsd2); + ddsd2.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; + ddsd2.dwWidth = 64; + ddsd2.dwHeight = 64; + ddsd2.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY | DDSCAPS_VIDEOMEMORY; + + GetDCTest_main(&ddsd, &ddsd2, dctest_sysvidmem); +} + +START_TEST(surface) +{ + IClassFactory *classfactory = NULL; + ULONG ref; + HRESULT hr; + HMODULE hmod = LoadLibrary("ddrawex.dll"); + if(hmod == NULL) { + skip("Failed to load ddrawex.dll\n"); + return; + } + pDllGetClassObject = (void*)GetProcAddress(hmod, "DllGetClassObject"); + if(pDllGetClassObject == NULL) { + skip("Failed to get DllGetClassObject\n"); + return; + } + + hr = pDllGetClassObject(&CLSID_DirectDrawFactory, &IID_IClassFactory, (void **) &classfactory); + ok(hr == S_OK, "Failed to create a IClassFactory\n"); + hr = IClassFactory_CreateInstance(classfactory, NULL, &IID_IDirectDrawFactory, (void **) &factory); + ok(hr == S_OK, "Failed to create a IDirectDrawFactory\n"); + + GetDCTest(); + CapsTest(); + SysVidMemTest(); + + if(factory) { + ref = IDirectDrawFactory_Release(factory); + ok(ref == 0, "IDirectDrawFactory not cleanly released\n"); + } + if(classfactory) { + ref = IClassFactory_Release(classfactory); + todo_wine ok(ref == 1, "IClassFactory refcount wrong, ref = %u\n", ref); + } +} diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index 91449f8f846..8e226cc2d3e 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -274,7 +274,7 @@ void fill_DataFormat(void *out, DWORD size, const void *in, const DataFormat *df memset(out, 0, size); if (df->dt == NULL) { /* This means that the app uses Wine's internal data format */ - memcpy(out, in, df->internal_format_size); + memcpy(out, in, min(size, df->internal_format_size)); } else { for (i = 0; i < df->size; i++) { if (df->dt[i].offset_in >= 0) { diff --git a/dlls/dinput/effect_linuxinput.c b/dlls/dinput/effect_linuxinput.c index 3395a37471c..eb6a2b57d5f 100644 --- a/dlls/dinput/effect_linuxinput.c +++ b/dlls/dinput/effect_linuxinput.c @@ -119,8 +119,7 @@ static void _dump_DIEFFECT_flags(DWORD dwFlags) static void _dump_DIENVELOPE(LPCDIENVELOPE env) { if (env->dwSize != sizeof(DIENVELOPE)) { - WARN("Non-standard DIENVELOPE structure size (%d instead of %d).\n", - env->dwSize, sizeof(DIENVELOPE)); + WARN("Non-standard DIENVELOPE structure size %d.\n", env->dwSize); } TRACE("Envelope has attack (level: %d time: %d), fade (level: %d time: %d)\n", env->dwAttackLevel, env->dwAttackTime, env->dwFadeLevel, env->dwFadeTime); @@ -175,8 +174,7 @@ static void _dump_DIEFFECT(LPCDIEFFECT eff, REFGUID guid) TRACE("Dumping DIEFFECT structure:\n"); TRACE(" - dwSize: %d\n", eff->dwSize); if ((eff->dwSize != sizeof(DIEFFECT)) && (eff->dwSize != sizeof(DIEFFECT_DX5))) { - WARN("Non-standard DIEFFECT structure size (%d instead of %d or %d).\n", - eff->dwSize, sizeof(DIEFFECT), sizeof(DIEFFECT_DX5)); + WARN("Non-standard DIEFFECT structure size %d\n", eff->dwSize); } TRACE(" - dwFlags: %d\n", eff->dwFlags); TRACE(" "); diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c index faef24f8d8f..e9b6916e432 100644 --- a/dlls/dinput/joystick_linux.c +++ b/dlls/dinput/joystick_linux.c @@ -1026,9 +1026,7 @@ static HRESULT WINAPI JoystickAImpl_GetDeviceInfo( if ((pdidi->dwSize != sizeof(DIDEVICEINSTANCE_DX3A)) && (pdidi->dwSize != sizeof(DIDEVICEINSTANCEA))) { - WARN("invalid parameter: pdidi->dwSize = %d != %d or %d\n", - pdidi->dwSize, sizeof(DIDEVICEINSTANCE_DX3A), - sizeof(DIDEVICEINSTANCEA)); + WARN("invalid parameter: pdidi->dwSize = %d\n", pdidi->dwSize); return DIERR_INVALIDPARAM; } @@ -1061,9 +1059,7 @@ static HRESULT WINAPI JoystickWImpl_GetDeviceInfo( if ((pdidi->dwSize != sizeof(DIDEVICEINSTANCE_DX3W)) && (pdidi->dwSize != sizeof(DIDEVICEINSTANCEW))) { - WARN("invalid parameter: pdidi->dwSize = %d != %d or %d\n", - pdidi->dwSize, sizeof(DIDEVICEINSTANCE_DX3W), - sizeof(DIDEVICEINSTANCEW)); + WARN("invalid parameter: pdidi->dwSize = %d\n", pdidi->dwSize); return DIERR_INVALIDPARAM; } diff --git a/dlls/dmband/band.c b/dlls/dmband/band.c index 891fb5a8139..c2e56f66ec7 100644 --- a/dlls/dmband/band.c +++ b/dlls/dmband/band.c @@ -32,19 +32,19 @@ static HRESULT WINAPI IDirectMusicBandImpl_IUnknown_QueryInterface (LPUNKNOWN if TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj); if (IsEqualIID (riid, &IID_IUnknown)) { - *ppobj = (LPVOID)&This->UnknownVtbl; + *ppobj = &This->UnknownVtbl; IUnknown_AddRef (iface); return S_OK; } else if (IsEqualIID (riid, &IID_IDirectMusicBand)) { - *ppobj = (LPVOID)&This->BandVtbl; + *ppobj = &This->BandVtbl; IUnknown_AddRef (iface); return S_OK; } else if (IsEqualIID (riid, &IID_IDirectMusicObject)) { - *ppobj = (LPVOID)&This->ObjectVtbl; + *ppobj = &This->ObjectVtbl; IUnknown_AddRef (iface); return S_OK; } else if (IsEqualIID (riid, &IID_IPersistStream)) { - *ppobj = (LPVOID)&This->PersistStreamVtbl; + *ppobj = &This->PersistStreamVtbl; IUnknown_AddRef (iface); return S_OK; } diff --git a/dlls/dmband/bandtrack.c b/dlls/dmband/bandtrack.c index b328b1d1c40..54496e1bf6c 100644 --- a/dlls/dmband/bandtrack.c +++ b/dlls/dmband/bandtrack.c @@ -31,7 +31,7 @@ static HRESULT WINAPI IDirectMusicBandTrack_IUnknown_QueryInterface (LPUNKNOWN i TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj); if (IsEqualIID (riid, &IID_IUnknown)) { - *ppobj = (LPUNKNOWN)&This->UnknownVtbl; + *ppobj = &This->UnknownVtbl; IUnknown_AddRef (iface); return S_OK; } else if (IsEqualIID (riid, &IID_IDirectMusicTrack) @@ -40,7 +40,7 @@ static HRESULT WINAPI IDirectMusicBandTrack_IUnknown_QueryInterface (LPUNKNOWN i IUnknown_AddRef (iface); return S_OK; } else if (IsEqualIID (riid, &IID_IPersistStream)) { - *ppobj = (LPPERSISTSTREAM)&This->PersistStreamVtbl; + *ppobj = &This->PersistStreamVtbl; IUnknown_AddRef (iface); return S_OK; } diff --git a/dlls/dmband/dmband_main.c b/dlls/dmband/dmband_main.c index 6a49f70beb5..b99f64dae21 100644 --- a/dlls/dmband/dmband_main.c +++ b/dlls/dmband/dmband_main.c @@ -168,11 +168,11 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) TRACE("(%s, %s, %p)\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv); if (IsEqualCLSID (rclsid, &CLSID_DirectMusicBand) && IsEqualIID (riid, &IID_IClassFactory)) { - *ppv = (LPVOID) &Band_CF; + *ppv = &Band_CF; IClassFactory_AddRef((IClassFactory*)*ppv); return S_OK; } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicBandTrack) && IsEqualIID (riid, &IID_IClassFactory)) { - *ppv = (LPVOID) &BandTrack_CF; + *ppv = &BandTrack_CF; IClassFactory_AddRef((IClassFactory*)*ppv); return S_OK; } diff --git a/dlls/dmcompos/chordmap.c b/dlls/dmcompos/chordmap.c index fae1771b940..7529df6f50d 100644 --- a/dlls/dmcompos/chordmap.c +++ b/dlls/dmcompos/chordmap.c @@ -36,19 +36,19 @@ static HRESULT WINAPI IDirectMusicChordMapImpl_IUnknown_QueryInterface (LPUNKNOW TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj); if (IsEqualIID (riid, &IID_IUnknown)) { - *ppobj = (LPVOID)&This->UnknownVtbl; + *ppobj = &This->UnknownVtbl; IDirectMusicChordMapImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl); return S_OK; } else if (IsEqualIID (riid, &IID_IDirectMusicChordMap)) { - *ppobj = (LPVOID)&This->ChordMapVtbl; + *ppobj = &This->ChordMapVtbl; IDirectMusicChordMapImpl_IDirectMusicChordMap_AddRef ((LPDIRECTMUSICCHORDMAP)&This->ChordMapVtbl); return S_OK; } else if (IsEqualIID (riid, &IID_IDirectMusicObject)) { - *ppobj = (LPVOID)&This->ObjectVtbl; + *ppobj = &This->ObjectVtbl; IDirectMusicChordMapImpl_IDirectMusicObject_AddRef ((LPDIRECTMUSICOBJECT)&This->ObjectVtbl); return S_OK; } else if (IsEqualIID (riid, &IID_IPersistStream)) { - *ppobj = (LPVOID)&This->PersistStreamVtbl; + *ppobj = &This->PersistStreamVtbl; IDirectMusicChordMapImpl_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl); return S_OK; } diff --git a/dlls/dmcompos/chordmaptrack.c b/dlls/dmcompos/chordmaptrack.c index 5fa462d1e16..c7d2307a5d5 100644 --- a/dlls/dmcompos/chordmaptrack.c +++ b/dlls/dmcompos/chordmaptrack.c @@ -34,7 +34,7 @@ static HRESULT WINAPI IDirectMusicChordMapTrack_IUnknown_QueryInterface (LPUNKNO TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj); if (IsEqualIID (riid, &IID_IUnknown)) { - *ppobj = (LPUNKNOWN)&This->UnknownVtbl; + *ppobj = &This->UnknownVtbl; IDirectMusicChordMapTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl); return S_OK; } else if (IsEqualIID (riid, &IID_IDirectMusicTrack) @@ -43,7 +43,7 @@ static HRESULT WINAPI IDirectMusicChordMapTrack_IUnknown_QueryInterface (LPUNKNO IDirectMusicChordMapTrack_IDirectMusicTrack_AddRef ((LPDIRECTMUSICTRACK8)&This->TrackVtbl); return S_OK; } else if (IsEqualIID (riid, &IID_IPersistStream)) { - *ppobj = (LPPERSISTSTREAM)&This->PersistStreamVtbl; + *ppobj = &This->PersistStreamVtbl; IDirectMusicChordMapTrack_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl); return S_OK; } diff --git a/dlls/dmcompos/dmcompos_main.c b/dlls/dmcompos/dmcompos_main.c index dec8a81064d..74b1ab45426 100644 --- a/dlls/dmcompos/dmcompos_main.c +++ b/dlls/dmcompos/dmcompos_main.c @@ -318,23 +318,23 @@ HRESULT WINAPI DllCanUnloadNow(void) { HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) { TRACE("(%s, %s, %p)\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv); if (IsEqualCLSID (rclsid, &CLSID_DirectMusicChordMap) && IsEqualIID (riid, &IID_IClassFactory)) { - *ppv = (LPVOID) &ChordMap_CF; + *ppv = &ChordMap_CF; IClassFactory_AddRef((IClassFactory*)*ppv); return S_OK; } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicComposer) && IsEqualIID (riid, &IID_IClassFactory)) { - *ppv = (LPVOID) &Composer_CF; + *ppv = &Composer_CF; IClassFactory_AddRef((IClassFactory*)*ppv); return S_OK; } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicChordMapTrack) && IsEqualIID (riid, &IID_IClassFactory)) { - *ppv = (LPVOID) &ChordMapTrack_CF; + *ppv = &ChordMapTrack_CF; IClassFactory_AddRef((IClassFactory*)*ppv); return S_OK; } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicTemplate) && IsEqualIID (riid, &IID_IClassFactory)) { - *ppv = (LPVOID) &Template_CF; + *ppv = &Template_CF; IClassFactory_AddRef((IClassFactory*)*ppv); return S_OK; } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicSignPostTrack) && IsEqualIID (riid, &IID_IClassFactory)) { - *ppv = (LPVOID) &SignPostTrack_CF; + *ppv = &SignPostTrack_CF; IClassFactory_AddRef((IClassFactory*)*ppv); return S_OK; } diff --git a/dlls/dmcompos/signposttrack.c b/dlls/dmcompos/signposttrack.c index bcea8942563..a913d6f240c 100644 --- a/dlls/dmcompos/signposttrack.c +++ b/dlls/dmcompos/signposttrack.c @@ -34,7 +34,7 @@ static HRESULT WINAPI IDirectMusicSignPostTrack_IUnknown_QueryInterface (LPUNKNO TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj); if (IsEqualIID (riid, &IID_IUnknown)) { - *ppobj = (LPUNKNOWN)&This->UnknownVtbl; + *ppobj = &This->UnknownVtbl; IDirectMusicSignPostTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl); return S_OK; } else if (IsEqualIID (riid, &IID_IDirectMusicTrack) @@ -43,7 +43,7 @@ static HRESULT WINAPI IDirectMusicSignPostTrack_IUnknown_QueryInterface (LPUNKNO IDirectMusicSignPostTrack_IDirectMusicTrack_AddRef ((LPDIRECTMUSICTRACK8)&This->TrackVtbl); return S_OK; } else if (IsEqualIID (riid, &IID_IPersistStream)) { - *ppobj = (LPPERSISTSTREAM)&This->PersistStreamVtbl; + *ppobj = &This->PersistStreamVtbl; IDirectMusicSignPostTrack_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl); return S_OK; } diff --git a/dlls/dsound/duplex.c b/dlls/dsound/duplex.c index 32002a8992c..1fe6bbc67da 100644 --- a/dlls/dsound/duplex.c +++ b/dlls/dsound/duplex.c @@ -676,9 +676,9 @@ IDirectSoundFullDuplexImpl_Initialize( IDirectSoundFullDuplexImpl *This = (IDirectSoundFullDuplexImpl *)iface; IDirectSoundBufferImpl * dsb; - TRACE("(%p,%s,%s,%p,%p,%x,%x,%p,%p)\n", This, + TRACE("(%p,%s,%s,%p,%p,%p,%x,%p,%p)\n", This, debugstr_guid(pCaptureGuid), debugstr_guid(pRendererGuid), - lpDscBufferDesc, lpDsBufferDesc, (DWORD)hWnd, dwLevel, + lpDscBufferDesc, lpDsBufferDesc, hWnd, dwLevel, lplpDirectSoundCaptureBuffer8, lplpDirectSoundBuffer8); if (This->renderer_device != NULL || This->capture_device != NULL) { diff --git a/dlls/fusion/asmname.c b/dlls/fusion/asmname.c index 81a5b82ebbf..50ae05ec525 100644 --- a/dlls/fusion/asmname.c +++ b/dlls/fusion/asmname.c @@ -150,7 +150,7 @@ static HRESULT WINAPI IAssemblyNameImpl_GetProperty(IAssemblyName *iface, *pcbProperty = 0; if (name->name) { - lstrcpyW((LPWSTR)pvProperty, name->name); + lstrcpyW(pvProperty, name->name); *pcbProperty = (lstrlenW(name->name) + 1) * 2; } break; @@ -187,7 +187,7 @@ static HRESULT WINAPI IAssemblyNameImpl_GetProperty(IAssemblyName *iface, *pcbProperty = 0; if (name->culture) { - lstrcpyW((LPWSTR)pvProperty, name->culture); + lstrcpyW(pvProperty, name->culture); *pcbProperty = (lstrlenW(name->culture) + 1) * 2; } break; diff --git a/dlls/fusion/assembly.c b/dlls/fusion/assembly.c index dfa449218b1..7be541c4a4f 100644 --- a/dlls/fusion/assembly.c +++ b/dlls/fusion/assembly.c @@ -153,7 +153,7 @@ static BYTE *GetData(BYTE *pData, ULONG *pLength) static VOID *assembly_data_offset(ASSEMBLY *assembly, ULONG offset) { - return (VOID *)&assembly->data[offset]; + return &assembly->data[offset]; } #define MAX_TABLES_WORD 0xFFFF diff --git a/dlls/gdi32/tests/generated.c b/dlls/gdi32/tests/generated.c dissimilarity index 62% index 9a35f24070b..2bd6376e9e5 100644 --- a/dlls/gdi32/tests/generated.c +++ b/dlls/gdi32/tests/generated.c @@ -1,4370 +1,7057 @@ -/* File generated automatically from tools/winapi/test.dat; do not edit! */ -/* This file can be copied, modified and distributed without restriction. */ - -/* - * Unit tests for data structure packing - */ - -#define WINVER 0x0501 -#define _WIN32_IE 0x0501 -#define _WIN32_WINNT 0x0501 - -#define WINE_NOWINSOCK - -#include "windows.h" - -#include "wine/test.h" - -/*********************************************************************** - * Compatibility macros - */ - -#define DWORD_PTR UINT_PTR -#define LONG_PTR INT_PTR -#define ULONG_PTR UINT_PTR - -/*********************************************************************** - * Windows API extension - */ - -#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) -# define FIELD_ALIGNMENT(type, field) __alignof(((type*)0)->field) -#elif defined(__GNUC__) -# define FIELD_ALIGNMENT(type, field) __alignof__(((type*)0)->field) -#else -/* FIXME: Not sure if is possible to do without compiler extension */ -#endif - -#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) -# define _TYPE_ALIGNMENT(type) __alignof(type) -#elif defined(__GNUC__) -# define _TYPE_ALIGNMENT(type) __alignof__(type) -#else -/* - * FIXME: Not sure if is possible to do without compiler extension - * (if type is not just a name that is, if so the normal) - * TYPE_ALIGNMENT can be used) - */ -#endif - -#if defined(TYPE_ALIGNMENT) && defined(_MSC_VER) && _MSC_VER >= 800 && !defined(__cplusplus) -#pragma warning(disable:4116) -#endif - -#if !defined(TYPE_ALIGNMENT) && defined(_TYPE_ALIGNMENT) -# define TYPE_ALIGNMENT _TYPE_ALIGNMENT -#endif - -/*********************************************************************** - * Test helper macros - */ - -#ifdef FIELD_ALIGNMENT -# define TEST_FIELD_ALIGNMENT(type, field, align) \ - ok(FIELD_ALIGNMENT(type, field) == align, \ - "FIELD_ALIGNMENT(" #type ", " #field ") == %d (expected " #align ")\n", \ - (int)FIELD_ALIGNMENT(type, field)) -#else -# define TEST_FIELD_ALIGNMENT(type, field, align) do { } while (0) -#endif - -#define TEST_FIELD_OFFSET(type, field, offset) \ - ok(FIELD_OFFSET(type, field) == offset, \ - "FIELD_OFFSET(" #type ", " #field ") == %ld (expected " #offset ")\n", \ - (long int)FIELD_OFFSET(type, field)) - -#ifdef _TYPE_ALIGNMENT -#define TEST__TYPE_ALIGNMENT(type, align) \ - ok(_TYPE_ALIGNMENT(type) == align, "TYPE_ALIGNMENT(" #type ") == %d (expected " #align ")\n", (int)_TYPE_ALIGNMENT(type)) -#else -# define TEST__TYPE_ALIGNMENT(type, align) do { } while (0) -#endif - -#ifdef TYPE_ALIGNMENT -#define TEST_TYPE_ALIGNMENT(type, align) \ - ok(TYPE_ALIGNMENT(type) == align, "TYPE_ALIGNMENT(" #type ") == %d (expected " #align ")\n", (int)TYPE_ALIGNMENT(type)) -#else -# define TEST_TYPE_ALIGNMENT(type, align) do { } while (0) -#endif - -#define TEST_TYPE_SIZE(type, size) \ - ok(sizeof(type) == size, "sizeof(" #type ") == %d (expected " #size ")\n", ((int) sizeof(type))) - -/*********************************************************************** - * Test macros - */ - -#define TEST_FIELD(type, field_type, field_name, field_offset, field_size, field_align) \ - TEST_TYPE_SIZE(field_type, field_size); \ - TEST_FIELD_ALIGNMENT(type, field_name, field_align); \ - TEST_FIELD_OFFSET(type, field_name, field_offset); \ - -#define TEST_TYPE(type, size, align) \ - TEST_TYPE_ALIGNMENT(type, align); \ - TEST_TYPE_SIZE(type, size) - -#define TEST_TYPE_POINTER(type, size, align) \ - TEST__TYPE_ALIGNMENT(*(type)0, align); \ - TEST_TYPE_SIZE(*(type)0, size) - -#define TEST_TYPE_SIGNED(type) \ - ok((type) -1 < 0, "(" #type ") -1 < 0\n"); - -#define TEST_TYPE_UNSIGNED(type) \ - ok((type) -1 > 0, "(" #type ") -1 > 0\n"); - -static void test_pack_ABC(void) -{ - /* ABC (pack 4) */ - TEST_TYPE(ABC, 12, 4); - TEST_FIELD(ABC, INT, abcA, 0, 4, 4); - TEST_FIELD(ABC, UINT, abcB, 4, 4, 4); - TEST_FIELD(ABC, INT, abcC, 8, 4, 4); -} - -static void test_pack_ABCFLOAT(void) -{ - /* ABCFLOAT (pack 4) */ - TEST_TYPE(ABCFLOAT, 12, 4); - TEST_FIELD(ABCFLOAT, FLOAT, abcfA, 0, 4, 4); - TEST_FIELD(ABCFLOAT, FLOAT, abcfB, 4, 4, 4); - TEST_FIELD(ABCFLOAT, FLOAT, abcfC, 8, 4, 4); -} - -static void test_pack_ABORTPROC(void) -{ - /* ABORTPROC */ - TEST_TYPE(ABORTPROC, 4, 4); -} - -static void test_pack_BITMAP(void) -{ - /* BITMAP (pack 4) */ - TEST_TYPE(BITMAP, 24, 4); - TEST_FIELD(BITMAP, INT, bmType, 0, 4, 4); - TEST_FIELD(BITMAP, INT, bmWidth, 4, 4, 4); - TEST_FIELD(BITMAP, INT, bmHeight, 8, 4, 4); - TEST_FIELD(BITMAP, INT, bmWidthBytes, 12, 4, 4); - TEST_FIELD(BITMAP, WORD, bmPlanes, 16, 2, 2); - TEST_FIELD(BITMAP, WORD, bmBitsPixel, 18, 2, 2); - TEST_FIELD(BITMAP, LPVOID, bmBits, 20, 4, 4); -} - -static void test_pack_BITMAPCOREHEADER(void) -{ - /* BITMAPCOREHEADER (pack 4) */ - TEST_TYPE(BITMAPCOREHEADER, 12, 4); - TEST_FIELD(BITMAPCOREHEADER, DWORD, bcSize, 0, 4, 4); - TEST_FIELD(BITMAPCOREHEADER, WORD, bcWidth, 4, 2, 2); - TEST_FIELD(BITMAPCOREHEADER, WORD, bcHeight, 6, 2, 2); - TEST_FIELD(BITMAPCOREHEADER, WORD, bcPlanes, 8, 2, 2); - TEST_FIELD(BITMAPCOREHEADER, WORD, bcBitCount, 10, 2, 2); -} - -static void test_pack_BITMAPCOREINFO(void) -{ - /* BITMAPCOREINFO (pack 4) */ - TEST_TYPE(BITMAPCOREINFO, 16, 4); - TEST_FIELD(BITMAPCOREINFO, BITMAPCOREHEADER, bmciHeader, 0, 12, 4); - TEST_FIELD(BITMAPCOREINFO, RGBTRIPLE[1], bmciColors, 12, 3, 1); -} - -static void test_pack_BITMAPFILEHEADER(void) -{ - /* BITMAPFILEHEADER (pack 2) */ - TEST_TYPE(BITMAPFILEHEADER, 14, 2); - TEST_FIELD(BITMAPFILEHEADER, WORD, bfType, 0, 2, 2); - TEST_FIELD(BITMAPFILEHEADER, DWORD, bfSize, 2, 4, 2); - TEST_FIELD(BITMAPFILEHEADER, WORD, bfReserved1, 6, 2, 2); - TEST_FIELD(BITMAPFILEHEADER, WORD, bfReserved2, 8, 2, 2); - TEST_FIELD(BITMAPFILEHEADER, DWORD, bfOffBits, 10, 4, 2); -} - -static void test_pack_BITMAPINFO(void) -{ - /* BITMAPINFO (pack 4) */ - TEST_TYPE(BITMAPINFO, 44, 4); - TEST_FIELD(BITMAPINFO, BITMAPINFOHEADER, bmiHeader, 0, 40, 4); - TEST_FIELD(BITMAPINFO, RGBQUAD[1], bmiColors, 40, 4, 1); -} - -static void test_pack_BITMAPINFOHEADER(void) -{ - /* BITMAPINFOHEADER (pack 4) */ - TEST_TYPE(BITMAPINFOHEADER, 40, 4); - TEST_FIELD(BITMAPINFOHEADER, DWORD, biSize, 0, 4, 4); - TEST_FIELD(BITMAPINFOHEADER, LONG, biWidth, 4, 4, 4); - TEST_FIELD(BITMAPINFOHEADER, LONG, biHeight, 8, 4, 4); - TEST_FIELD(BITMAPINFOHEADER, WORD, biPlanes, 12, 2, 2); - TEST_FIELD(BITMAPINFOHEADER, WORD, biBitCount, 14, 2, 2); - TEST_FIELD(BITMAPINFOHEADER, DWORD, biCompression, 16, 4, 4); - TEST_FIELD(BITMAPINFOHEADER, DWORD, biSizeImage, 20, 4, 4); - TEST_FIELD(BITMAPINFOHEADER, LONG, biXPelsPerMeter, 24, 4, 4); - TEST_FIELD(BITMAPINFOHEADER, LONG, biYPelsPerMeter, 28, 4, 4); - TEST_FIELD(BITMAPINFOHEADER, DWORD, biClrUsed, 32, 4, 4); - TEST_FIELD(BITMAPINFOHEADER, DWORD, biClrImportant, 36, 4, 4); -} - -static void test_pack_BITMAPV4HEADER(void) -{ - /* BITMAPV4HEADER (pack 4) */ - TEST_TYPE(BITMAPV4HEADER, 108, 4); - TEST_FIELD(BITMAPV4HEADER, DWORD, bV4Size, 0, 4, 4); - TEST_FIELD(BITMAPV4HEADER, LONG, bV4Width, 4, 4, 4); - TEST_FIELD(BITMAPV4HEADER, LONG, bV4Height, 8, 4, 4); - TEST_FIELD(BITMAPV4HEADER, WORD, bV4Planes, 12, 2, 2); - TEST_FIELD(BITMAPV4HEADER, WORD, bV4BitCount, 14, 2, 2); - TEST_FIELD(BITMAPV4HEADER, DWORD, bV4V4Compression, 16, 4, 4); - TEST_FIELD(BITMAPV4HEADER, DWORD, bV4SizeImage, 20, 4, 4); - TEST_FIELD(BITMAPV4HEADER, LONG, bV4XPelsPerMeter, 24, 4, 4); - TEST_FIELD(BITMAPV4HEADER, LONG, bV4YPelsPerMeter, 28, 4, 4); - TEST_FIELD(BITMAPV4HEADER, DWORD, bV4ClrUsed, 32, 4, 4); - TEST_FIELD(BITMAPV4HEADER, DWORD, bV4ClrImportant, 36, 4, 4); - TEST_FIELD(BITMAPV4HEADER, DWORD, bV4RedMask, 40, 4, 4); - TEST_FIELD(BITMAPV4HEADER, DWORD, bV4GreenMask, 44, 4, 4); - TEST_FIELD(BITMAPV4HEADER, DWORD, bV4BlueMask, 48, 4, 4); - TEST_FIELD(BITMAPV4HEADER, DWORD, bV4AlphaMask, 52, 4, 4); - TEST_FIELD(BITMAPV4HEADER, DWORD, bV4CSType, 56, 4, 4); - TEST_FIELD(BITMAPV4HEADER, CIEXYZTRIPLE, bV4Endpoints, 60, 36, 4); - TEST_FIELD(BITMAPV4HEADER, DWORD, bV4GammaRed, 96, 4, 4); - TEST_FIELD(BITMAPV4HEADER, DWORD, bV4GammaGreen, 100, 4, 4); - TEST_FIELD(BITMAPV4HEADER, DWORD, bV4GammaBlue, 104, 4, 4); -} - -static void test_pack_BITMAPV5HEADER(void) -{ - /* BITMAPV5HEADER (pack 4) */ - TEST_TYPE(BITMAPV5HEADER, 124, 4); - TEST_FIELD(BITMAPV5HEADER, DWORD, bV5Size, 0, 4, 4); - TEST_FIELD(BITMAPV5HEADER, LONG, bV5Width, 4, 4, 4); - TEST_FIELD(BITMAPV5HEADER, LONG, bV5Height, 8, 4, 4); - TEST_FIELD(BITMAPV5HEADER, WORD, bV5Planes, 12, 2, 2); - TEST_FIELD(BITMAPV5HEADER, WORD, bV5BitCount, 14, 2, 2); - TEST_FIELD(BITMAPV5HEADER, DWORD, bV5Compression, 16, 4, 4); - TEST_FIELD(BITMAPV5HEADER, DWORD, bV5SizeImage, 20, 4, 4); - TEST_FIELD(BITMAPV5HEADER, LONG, bV5XPelsPerMeter, 24, 4, 4); - TEST_FIELD(BITMAPV5HEADER, LONG, bV5YPelsPerMeter, 28, 4, 4); - TEST_FIELD(BITMAPV5HEADER, DWORD, bV5ClrUsed, 32, 4, 4); - TEST_FIELD(BITMAPV5HEADER, DWORD, bV5ClrImportant, 36, 4, 4); - TEST_FIELD(BITMAPV5HEADER, DWORD, bV5RedMask, 40, 4, 4); - TEST_FIELD(BITMAPV5HEADER, DWORD, bV5GreenMask, 44, 4, 4); - TEST_FIELD(BITMAPV5HEADER, DWORD, bV5BlueMask, 48, 4, 4); - TEST_FIELD(BITMAPV5HEADER, DWORD, bV5AlphaMask, 52, 4, 4); - TEST_FIELD(BITMAPV5HEADER, DWORD, bV5CSType, 56, 4, 4); - TEST_FIELD(BITMAPV5HEADER, CIEXYZTRIPLE, bV5Endpoints, 60, 36, 4); - TEST_FIELD(BITMAPV5HEADER, DWORD, bV5GammaRed, 96, 4, 4); - TEST_FIELD(BITMAPV5HEADER, DWORD, bV5GammaGreen, 100, 4, 4); - TEST_FIELD(BITMAPV5HEADER, DWORD, bV5GammaBlue, 104, 4, 4); - TEST_FIELD(BITMAPV5HEADER, DWORD, bV5Intent, 108, 4, 4); - TEST_FIELD(BITMAPV5HEADER, DWORD, bV5ProfileData, 112, 4, 4); - TEST_FIELD(BITMAPV5HEADER, DWORD, bV5ProfileSize, 116, 4, 4); - TEST_FIELD(BITMAPV5HEADER, DWORD, bV5Reserved, 120, 4, 4); -} - -static void test_pack_BLENDFUNCTION(void) -{ - /* BLENDFUNCTION (pack 4) */ - TEST_TYPE(BLENDFUNCTION, 4, 1); - TEST_FIELD(BLENDFUNCTION, BYTE, BlendOp, 0, 1, 1); - TEST_FIELD(BLENDFUNCTION, BYTE, BlendFlags, 1, 1, 1); - TEST_FIELD(BLENDFUNCTION, BYTE, SourceConstantAlpha, 2, 1, 1); - TEST_FIELD(BLENDFUNCTION, BYTE, AlphaFormat, 3, 1, 1); -} - -static void test_pack_CHARSETINFO(void) -{ - /* CHARSETINFO (pack 4) */ - TEST_TYPE(CHARSETINFO, 32, 4); - TEST_FIELD(CHARSETINFO, UINT, ciCharset, 0, 4, 4); - TEST_FIELD(CHARSETINFO, UINT, ciACP, 4, 4, 4); - TEST_FIELD(CHARSETINFO, FONTSIGNATURE, fs, 8, 24, 4); -} - -static void test_pack_CIEXYZ(void) -{ - /* CIEXYZ (pack 4) */ - TEST_TYPE(CIEXYZ, 12, 4); - TEST_FIELD(CIEXYZ, FXPT2DOT30, ciexyzX, 0, 4, 4); - TEST_FIELD(CIEXYZ, FXPT2DOT30, ciexyzY, 4, 4, 4); - TEST_FIELD(CIEXYZ, FXPT2DOT30, ciexyzZ, 8, 4, 4); -} - -static void test_pack_CIEXYZTRIPLE(void) -{ - /* CIEXYZTRIPLE (pack 4) */ - TEST_TYPE(CIEXYZTRIPLE, 36, 4); - TEST_FIELD(CIEXYZTRIPLE, CIEXYZ, ciexyzRed, 0, 12, 4); - TEST_FIELD(CIEXYZTRIPLE, CIEXYZ, ciexyzGreen, 12, 12, 4); - TEST_FIELD(CIEXYZTRIPLE, CIEXYZ, ciexyzBlue, 24, 12, 4); -} - -static void test_pack_COLOR16(void) -{ - /* COLOR16 */ - TEST_TYPE(COLOR16, 2, 2); -} - -static void test_pack_COLORADJUSTMENT(void) -{ - /* COLORADJUSTMENT (pack 4) */ - TEST_TYPE(COLORADJUSTMENT, 24, 2); - TEST_FIELD(COLORADJUSTMENT, WORD, caSize, 0, 2, 2); - TEST_FIELD(COLORADJUSTMENT, WORD, caFlags, 2, 2, 2); - TEST_FIELD(COLORADJUSTMENT, WORD, caIlluminantIndex, 4, 2, 2); - TEST_FIELD(COLORADJUSTMENT, WORD, caRedGamma, 6, 2, 2); - TEST_FIELD(COLORADJUSTMENT, WORD, caGreenGamma, 8, 2, 2); - TEST_FIELD(COLORADJUSTMENT, WORD, caBlueGamma, 10, 2, 2); - TEST_FIELD(COLORADJUSTMENT, WORD, caReferenceBlack, 12, 2, 2); - TEST_FIELD(COLORADJUSTMENT, WORD, caReferenceWhite, 14, 2, 2); - TEST_FIELD(COLORADJUSTMENT, SHORT, caContrast, 16, 2, 2); - TEST_FIELD(COLORADJUSTMENT, SHORT, caBrightness, 18, 2, 2); - TEST_FIELD(COLORADJUSTMENT, SHORT, caColorfulness, 20, 2, 2); - TEST_FIELD(COLORADJUSTMENT, SHORT, caRedGreenTint, 22, 2, 2); -} - -static void test_pack_DEVMODEA(void) -{ - /* DEVMODEA (pack 4) */ - TEST_FIELD(DEVMODEA, BYTE[CCHDEVICENAME], dmDeviceName, 0, 32, 1); - TEST_FIELD(DEVMODEA, WORD, dmSpecVersion, 32, 2, 2); - TEST_FIELD(DEVMODEA, WORD, dmDriverVersion, 34, 2, 2); - TEST_FIELD(DEVMODEA, WORD, dmSize, 36, 2, 2); - TEST_FIELD(DEVMODEA, WORD, dmDriverExtra, 38, 2, 2); - TEST_FIELD(DEVMODEA, DWORD, dmFields, 40, 4, 4); -} - -static void test_pack_DEVMODEW(void) -{ - /* DEVMODEW (pack 4) */ - TEST_FIELD(DEVMODEW, WCHAR[CCHDEVICENAME], dmDeviceName, 0, 64, 2); - TEST_FIELD(DEVMODEW, WORD, dmSpecVersion, 64, 2, 2); - TEST_FIELD(DEVMODEW, WORD, dmDriverVersion, 66, 2, 2); - TEST_FIELD(DEVMODEW, WORD, dmSize, 68, 2, 2); - TEST_FIELD(DEVMODEW, WORD, dmDriverExtra, 70, 2, 2); - TEST_FIELD(DEVMODEW, DWORD, dmFields, 72, 4, 4); -} - -static void test_pack_DIBSECTION(void) -{ - /* DIBSECTION (pack 4) */ - TEST_TYPE(DIBSECTION, 84, 4); - TEST_FIELD(DIBSECTION, BITMAP, dsBm, 0, 24, 4); - TEST_FIELD(DIBSECTION, BITMAPINFOHEADER, dsBmih, 24, 40, 4); - TEST_FIELD(DIBSECTION, DWORD[3], dsBitfields, 64, 12, 4); - TEST_FIELD(DIBSECTION, HANDLE, dshSection, 76, 4, 4); - TEST_FIELD(DIBSECTION, DWORD, dsOffset, 80, 4, 4); -} - -static void test_pack_DISPLAY_DEVICEA(void) -{ - /* DISPLAY_DEVICEA (pack 4) */ - TEST_TYPE(DISPLAY_DEVICEA, 424, 4); - TEST_FIELD(DISPLAY_DEVICEA, DWORD, cb, 0, 4, 4); - TEST_FIELD(DISPLAY_DEVICEA, CHAR[32], DeviceName, 4, 32, 1); - TEST_FIELD(DISPLAY_DEVICEA, CHAR[128], DeviceString, 36, 128, 1); - TEST_FIELD(DISPLAY_DEVICEA, DWORD, StateFlags, 164, 4, 4); - TEST_FIELD(DISPLAY_DEVICEA, CHAR[128], DeviceID, 168, 128, 1); - TEST_FIELD(DISPLAY_DEVICEA, CHAR[128], DeviceKey, 296, 128, 1); -} - -static void test_pack_DISPLAY_DEVICEW(void) -{ - /* DISPLAY_DEVICEW (pack 4) */ - TEST_TYPE(DISPLAY_DEVICEW, 840, 4); - TEST_FIELD(DISPLAY_DEVICEW, DWORD, cb, 0, 4, 4); - TEST_FIELD(DISPLAY_DEVICEW, WCHAR[32], DeviceName, 4, 64, 2); - TEST_FIELD(DISPLAY_DEVICEW, WCHAR[128], DeviceString, 68, 256, 2); - TEST_FIELD(DISPLAY_DEVICEW, DWORD, StateFlags, 324, 4, 4); - TEST_FIELD(DISPLAY_DEVICEW, WCHAR[128], DeviceID, 328, 256, 2); - TEST_FIELD(DISPLAY_DEVICEW, WCHAR[128], DeviceKey, 584, 256, 2); -} - -static void test_pack_DOCINFOA(void) -{ - /* DOCINFOA (pack 4) */ - TEST_TYPE(DOCINFOA, 20, 4); - TEST_FIELD(DOCINFOA, INT, cbSize, 0, 4, 4); - TEST_FIELD(DOCINFOA, LPCSTR, lpszDocName, 4, 4, 4); - TEST_FIELD(DOCINFOA, LPCSTR, lpszOutput, 8, 4, 4); - TEST_FIELD(DOCINFOA, LPCSTR, lpszDatatype, 12, 4, 4); - TEST_FIELD(DOCINFOA, DWORD, fwType, 16, 4, 4); -} - -static void test_pack_DOCINFOW(void) -{ - /* DOCINFOW (pack 4) */ - TEST_TYPE(DOCINFOW, 20, 4); - TEST_FIELD(DOCINFOW, INT, cbSize, 0, 4, 4); - TEST_FIELD(DOCINFOW, LPCWSTR, lpszDocName, 4, 4, 4); - TEST_FIELD(DOCINFOW, LPCWSTR, lpszOutput, 8, 4, 4); - TEST_FIELD(DOCINFOW, LPCWSTR, lpszDatatype, 12, 4, 4); - TEST_FIELD(DOCINFOW, DWORD, fwType, 16, 4, 4); -} - -static void test_pack_EMR(void) -{ - /* EMR (pack 4) */ - TEST_TYPE(EMR, 8, 4); - TEST_FIELD(EMR, DWORD, iType, 0, 4, 4); - TEST_FIELD(EMR, DWORD, nSize, 4, 4, 4); -} - -static void test_pack_EMRABORTPATH(void) -{ - /* EMRABORTPATH (pack 4) */ - TEST_TYPE(EMRABORTPATH, 8, 4); - TEST_FIELD(EMRABORTPATH, EMR, emr, 0, 8, 4); -} - -static void test_pack_EMRANGLEARC(void) -{ - /* EMRANGLEARC (pack 4) */ - TEST_TYPE(EMRANGLEARC, 28, 4); - TEST_FIELD(EMRANGLEARC, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRANGLEARC, POINTL, ptlCenter, 8, 8, 4); - TEST_FIELD(EMRANGLEARC, DWORD, nRadius, 16, 4, 4); - TEST_FIELD(EMRANGLEARC, FLOAT, eStartAngle, 20, 4, 4); - TEST_FIELD(EMRANGLEARC, FLOAT, eSweepAngle, 24, 4, 4); -} - -static void test_pack_EMRARC(void) -{ - /* EMRARC (pack 4) */ - TEST_TYPE(EMRARC, 40, 4); - TEST_FIELD(EMRARC, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRARC, RECTL, rclBox, 8, 16, 4); - TEST_FIELD(EMRARC, POINTL, ptlStart, 24, 8, 4); - TEST_FIELD(EMRARC, POINTL, ptlEnd, 32, 8, 4); -} - -static void test_pack_EMRARCTO(void) -{ - /* EMRARCTO (pack 4) */ - TEST_TYPE(EMRARCTO, 40, 4); - TEST_FIELD(EMRARCTO, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRARCTO, RECTL, rclBox, 8, 16, 4); - TEST_FIELD(EMRARCTO, POINTL, ptlStart, 24, 8, 4); - TEST_FIELD(EMRARCTO, POINTL, ptlEnd, 32, 8, 4); -} - -static void test_pack_EMRBEGINPATH(void) -{ - /* EMRBEGINPATH (pack 4) */ - TEST_TYPE(EMRBEGINPATH, 8, 4); - TEST_FIELD(EMRBEGINPATH, EMR, emr, 0, 8, 4); -} - -static void test_pack_EMRBITBLT(void) -{ - /* EMRBITBLT (pack 4) */ - TEST_TYPE(EMRBITBLT, 100, 4); - TEST_FIELD(EMRBITBLT, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRBITBLT, RECTL, rclBounds, 8, 16, 4); - TEST_FIELD(EMRBITBLT, LONG, xDest, 24, 4, 4); - TEST_FIELD(EMRBITBLT, LONG, yDest, 28, 4, 4); - TEST_FIELD(EMRBITBLT, LONG, cxDest, 32, 4, 4); - TEST_FIELD(EMRBITBLT, LONG, cyDest, 36, 4, 4); - TEST_FIELD(EMRBITBLT, DWORD, dwRop, 40, 4, 4); - TEST_FIELD(EMRBITBLT, LONG, xSrc, 44, 4, 4); - TEST_FIELD(EMRBITBLT, LONG, ySrc, 48, 4, 4); - TEST_FIELD(EMRBITBLT, XFORM, xformSrc, 52, 24, 4); - TEST_FIELD(EMRBITBLT, COLORREF, crBkColorSrc, 76, 4, 4); - TEST_FIELD(EMRBITBLT, DWORD, iUsageSrc, 80, 4, 4); - TEST_FIELD(EMRBITBLT, DWORD, offBmiSrc, 84, 4, 4); - TEST_FIELD(EMRBITBLT, DWORD, cbBmiSrc, 88, 4, 4); - TEST_FIELD(EMRBITBLT, DWORD, offBitsSrc, 92, 4, 4); - TEST_FIELD(EMRBITBLT, DWORD, cbBitsSrc, 96, 4, 4); -} - -static void test_pack_EMRCHORD(void) -{ - /* EMRCHORD (pack 4) */ - TEST_TYPE(EMRCHORD, 40, 4); - TEST_FIELD(EMRCHORD, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRCHORD, RECTL, rclBox, 8, 16, 4); - TEST_FIELD(EMRCHORD, POINTL, ptlStart, 24, 8, 4); - TEST_FIELD(EMRCHORD, POINTL, ptlEnd, 32, 8, 4); -} - -static void test_pack_EMRCLOSEFIGURE(void) -{ - /* EMRCLOSEFIGURE (pack 4) */ - TEST_TYPE(EMRCLOSEFIGURE, 8, 4); - TEST_FIELD(EMRCLOSEFIGURE, EMR, emr, 0, 8, 4); -} - -static void test_pack_EMRCREATEBRUSHINDIRECT(void) -{ - /* EMRCREATEBRUSHINDIRECT (pack 4) */ - TEST_TYPE(EMRCREATEBRUSHINDIRECT, 24, 4); - TEST_FIELD(EMRCREATEBRUSHINDIRECT, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRCREATEBRUSHINDIRECT, DWORD, ihBrush, 8, 4, 4); - TEST_FIELD(EMRCREATEBRUSHINDIRECT, LOGBRUSH32, lb, 12, 12, 4); -} - -static void test_pack_EMRCREATECOLORSPACE(void) -{ - /* EMRCREATECOLORSPACE (pack 4) */ - TEST_TYPE(EMRCREATECOLORSPACE, 340, 4); - TEST_FIELD(EMRCREATECOLORSPACE, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRCREATECOLORSPACE, DWORD, ihCS, 8, 4, 4); - TEST_FIELD(EMRCREATECOLORSPACE, LOGCOLORSPACEA, lcs, 12, 328, 4); -} - -static void test_pack_EMRCREATECOLORSPACEW(void) -{ - /* EMRCREATECOLORSPACEW (pack 4) */ - TEST_TYPE(EMRCREATECOLORSPACEW, 612, 4); - TEST_FIELD(EMRCREATECOLORSPACEW, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRCREATECOLORSPACEW, DWORD, ihCS, 8, 4, 4); - TEST_FIELD(EMRCREATECOLORSPACEW, LOGCOLORSPACEW, lcs, 12, 588, 4); - TEST_FIELD(EMRCREATECOLORSPACEW, DWORD, dwFlags, 600, 4, 4); - TEST_FIELD(EMRCREATECOLORSPACEW, DWORD, cbData, 604, 4, 4); - TEST_FIELD(EMRCREATECOLORSPACEW, BYTE[1], Data, 608, 1, 1); -} - -static void test_pack_EMRCREATEDIBPATTERNBRUSHPT(void) -{ - /* EMRCREATEDIBPATTERNBRUSHPT (pack 4) */ - TEST_TYPE(EMRCREATEDIBPATTERNBRUSHPT, 32, 4); - TEST_FIELD(EMRCREATEDIBPATTERNBRUSHPT, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRCREATEDIBPATTERNBRUSHPT, DWORD, ihBrush, 8, 4, 4); - TEST_FIELD(EMRCREATEDIBPATTERNBRUSHPT, DWORD, iUsage, 12, 4, 4); - TEST_FIELD(EMRCREATEDIBPATTERNBRUSHPT, DWORD, offBmi, 16, 4, 4); - TEST_FIELD(EMRCREATEDIBPATTERNBRUSHPT, DWORD, cbBmi, 20, 4, 4); - TEST_FIELD(EMRCREATEDIBPATTERNBRUSHPT, DWORD, offBits, 24, 4, 4); - TEST_FIELD(EMRCREATEDIBPATTERNBRUSHPT, DWORD, cbBits, 28, 4, 4); -} - -static void test_pack_EMRCREATEMONOBRUSH(void) -{ - /* EMRCREATEMONOBRUSH (pack 4) */ - TEST_TYPE(EMRCREATEMONOBRUSH, 32, 4); - TEST_FIELD(EMRCREATEMONOBRUSH, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRCREATEMONOBRUSH, DWORD, ihBrush, 8, 4, 4); - TEST_FIELD(EMRCREATEMONOBRUSH, DWORD, iUsage, 12, 4, 4); - TEST_FIELD(EMRCREATEMONOBRUSH, DWORD, offBmi, 16, 4, 4); - TEST_FIELD(EMRCREATEMONOBRUSH, DWORD, cbBmi, 20, 4, 4); - TEST_FIELD(EMRCREATEMONOBRUSH, DWORD, offBits, 24, 4, 4); - TEST_FIELD(EMRCREATEMONOBRUSH, DWORD, cbBits, 28, 4, 4); -} - -static void test_pack_EMRCREATEPEN(void) -{ - /* EMRCREATEPEN (pack 4) */ - TEST_TYPE(EMRCREATEPEN, 28, 4); - TEST_FIELD(EMRCREATEPEN, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRCREATEPEN, DWORD, ihPen, 8, 4, 4); - TEST_FIELD(EMRCREATEPEN, LOGPEN, lopn, 12, 16, 4); -} - -static void test_pack_EMRDELETECOLORSPACE(void) -{ - /* EMRDELETECOLORSPACE (pack 4) */ - TEST_TYPE(EMRDELETECOLORSPACE, 12, 4); - TEST_FIELD(EMRDELETECOLORSPACE, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRDELETECOLORSPACE, DWORD, ihCS, 8, 4, 4); -} - -static void test_pack_EMRDELETEOBJECT(void) -{ - /* EMRDELETEOBJECT (pack 4) */ - TEST_TYPE(EMRDELETEOBJECT, 12, 4); - TEST_FIELD(EMRDELETEOBJECT, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRDELETEOBJECT, DWORD, ihObject, 8, 4, 4); -} - -static void test_pack_EMRELLIPSE(void) -{ - /* EMRELLIPSE (pack 4) */ - TEST_TYPE(EMRELLIPSE, 24, 4); - TEST_FIELD(EMRELLIPSE, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRELLIPSE, RECTL, rclBox, 8, 16, 4); -} - -static void test_pack_EMRENDPATH(void) -{ - /* EMRENDPATH (pack 4) */ - TEST_TYPE(EMRENDPATH, 8, 4); - TEST_FIELD(EMRENDPATH, EMR, emr, 0, 8, 4); -} - -static void test_pack_EMREOF(void) -{ - /* EMREOF (pack 4) */ - TEST_TYPE(EMREOF, 20, 4); - TEST_FIELD(EMREOF, EMR, emr, 0, 8, 4); - TEST_FIELD(EMREOF, DWORD, nPalEntries, 8, 4, 4); - TEST_FIELD(EMREOF, DWORD, offPalEntries, 12, 4, 4); - TEST_FIELD(EMREOF, DWORD, nSizeLast, 16, 4, 4); -} - -static void test_pack_EMREXCLUDECLIPRECT(void) -{ - /* EMREXCLUDECLIPRECT (pack 4) */ - TEST_TYPE(EMREXCLUDECLIPRECT, 24, 4); - TEST_FIELD(EMREXCLUDECLIPRECT, EMR, emr, 0, 8, 4); - TEST_FIELD(EMREXCLUDECLIPRECT, RECTL, rclClip, 8, 16, 4); -} - -static void test_pack_EMREXTCREATEFONTINDIRECTW(void) -{ - /* EMREXTCREATEFONTINDIRECTW (pack 4) */ - TEST_TYPE(EMREXTCREATEFONTINDIRECTW, 332, 4); - TEST_FIELD(EMREXTCREATEFONTINDIRECTW, EMR, emr, 0, 8, 4); - TEST_FIELD(EMREXTCREATEFONTINDIRECTW, DWORD, ihFont, 8, 4, 4); - TEST_FIELD(EMREXTCREATEFONTINDIRECTW, EXTLOGFONTW, elfw, 12, 320, 4); -} - -static void test_pack_EMREXTCREATEPEN(void) -{ - /* EMREXTCREATEPEN (pack 4) */ - TEST_TYPE(EMREXTCREATEPEN, 56, 4); - TEST_FIELD(EMREXTCREATEPEN, EMR, emr, 0, 8, 4); - TEST_FIELD(EMREXTCREATEPEN, DWORD, ihPen, 8, 4, 4); - TEST_FIELD(EMREXTCREATEPEN, DWORD, offBmi, 12, 4, 4); - TEST_FIELD(EMREXTCREATEPEN, DWORD, cbBmi, 16, 4, 4); - TEST_FIELD(EMREXTCREATEPEN, DWORD, offBits, 20, 4, 4); - TEST_FIELD(EMREXTCREATEPEN, DWORD, cbBits, 24, 4, 4); - TEST_FIELD(EMREXTCREATEPEN, EXTLOGPEN, elp, 28, 28, 4); -} - -static void test_pack_EMREXTFLOODFILL(void) -{ - /* EMREXTFLOODFILL (pack 4) */ - TEST_TYPE(EMREXTFLOODFILL, 24, 4); - TEST_FIELD(EMREXTFLOODFILL, EMR, emr, 0, 8, 4); - TEST_FIELD(EMREXTFLOODFILL, POINTL, ptlStart, 8, 8, 4); - TEST_FIELD(EMREXTFLOODFILL, COLORREF, crColor, 16, 4, 4); - TEST_FIELD(EMREXTFLOODFILL, DWORD, iMode, 20, 4, 4); -} - -static void test_pack_EMREXTSELECTCLIPRGN(void) -{ - /* EMREXTSELECTCLIPRGN (pack 4) */ - TEST_TYPE(EMREXTSELECTCLIPRGN, 20, 4); - TEST_FIELD(EMREXTSELECTCLIPRGN, EMR, emr, 0, 8, 4); - TEST_FIELD(EMREXTSELECTCLIPRGN, DWORD, cbRgnData, 8, 4, 4); - TEST_FIELD(EMREXTSELECTCLIPRGN, DWORD, iMode, 12, 4, 4); - TEST_FIELD(EMREXTSELECTCLIPRGN, BYTE[1], RgnData, 16, 1, 1); -} - -static void test_pack_EMREXTTEXTOUTA(void) -{ - /* EMREXTTEXTOUTA (pack 4) */ - TEST_TYPE(EMREXTTEXTOUTA, 76, 4); - TEST_FIELD(EMREXTTEXTOUTA, EMR, emr, 0, 8, 4); - TEST_FIELD(EMREXTTEXTOUTA, RECTL, rclBounds, 8, 16, 4); - TEST_FIELD(EMREXTTEXTOUTA, DWORD, iGraphicsMode, 24, 4, 4); - TEST_FIELD(EMREXTTEXTOUTA, FLOAT, exScale, 28, 4, 4); - TEST_FIELD(EMREXTTEXTOUTA, FLOAT, eyScale, 32, 4, 4); - TEST_FIELD(EMREXTTEXTOUTA, EMRTEXT, emrtext, 36, 40, 4); -} - -static void test_pack_EMREXTTEXTOUTW(void) -{ - /* EMREXTTEXTOUTW (pack 4) */ - TEST_TYPE(EMREXTTEXTOUTW, 76, 4); - TEST_FIELD(EMREXTTEXTOUTW, EMR, emr, 0, 8, 4); - TEST_FIELD(EMREXTTEXTOUTW, RECTL, rclBounds, 8, 16, 4); - TEST_FIELD(EMREXTTEXTOUTW, DWORD, iGraphicsMode, 24, 4, 4); - TEST_FIELD(EMREXTTEXTOUTW, FLOAT, exScale, 28, 4, 4); - TEST_FIELD(EMREXTTEXTOUTW, FLOAT, eyScale, 32, 4, 4); - TEST_FIELD(EMREXTTEXTOUTW, EMRTEXT, emrtext, 36, 40, 4); -} - -static void test_pack_EMRFILLPATH(void) -{ - /* EMRFILLPATH (pack 4) */ - TEST_TYPE(EMRFILLPATH, 24, 4); - TEST_FIELD(EMRFILLPATH, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRFILLPATH, RECTL, rclBounds, 8, 16, 4); -} - -static void test_pack_EMRFILLRGN(void) -{ - /* EMRFILLRGN (pack 4) */ - TEST_TYPE(EMRFILLRGN, 36, 4); - TEST_FIELD(EMRFILLRGN, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRFILLRGN, RECTL, rclBounds, 8, 16, 4); - TEST_FIELD(EMRFILLRGN, DWORD, cbRgnData, 24, 4, 4); - TEST_FIELD(EMRFILLRGN, DWORD, ihBrush, 28, 4, 4); - TEST_FIELD(EMRFILLRGN, BYTE[1], RgnData, 32, 1, 1); -} - -static void test_pack_EMRFLATTENPATH(void) -{ - /* EMRFLATTENPATH (pack 4) */ - TEST_TYPE(EMRFLATTENPATH, 8, 4); - TEST_FIELD(EMRFLATTENPATH, EMR, emr, 0, 8, 4); -} - -static void test_pack_EMRFORMAT(void) -{ - /* EMRFORMAT (pack 4) */ - TEST_TYPE(EMRFORMAT, 16, 4); - TEST_FIELD(EMRFORMAT, DWORD, dSignature, 0, 4, 4); - TEST_FIELD(EMRFORMAT, DWORD, nVersion, 4, 4, 4); - TEST_FIELD(EMRFORMAT, DWORD, cbData, 8, 4, 4); - TEST_FIELD(EMRFORMAT, DWORD, offData, 12, 4, 4); -} - -static void test_pack_EMRFRAMERGN(void) -{ - /* EMRFRAMERGN (pack 4) */ - TEST_TYPE(EMRFRAMERGN, 44, 4); - TEST_FIELD(EMRFRAMERGN, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRFRAMERGN, RECTL, rclBounds, 8, 16, 4); - TEST_FIELD(EMRFRAMERGN, DWORD, cbRgnData, 24, 4, 4); - TEST_FIELD(EMRFRAMERGN, DWORD, ihBrush, 28, 4, 4); - TEST_FIELD(EMRFRAMERGN, SIZEL, szlStroke, 32, 8, 4); - TEST_FIELD(EMRFRAMERGN, BYTE[1], RgnData, 40, 1, 1); -} - -static void test_pack_EMRGDICOMMENT(void) -{ - /* EMRGDICOMMENT (pack 4) */ - TEST_TYPE(EMRGDICOMMENT, 16, 4); - TEST_FIELD(EMRGDICOMMENT, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRGDICOMMENT, DWORD, cbData, 8, 4, 4); - TEST_FIELD(EMRGDICOMMENT, BYTE[1], Data, 12, 1, 1); -} - -static void test_pack_EMRGLSBOUNDEDRECORD(void) -{ - /* EMRGLSBOUNDEDRECORD (pack 4) */ - TEST_TYPE(EMRGLSBOUNDEDRECORD, 32, 4); - TEST_FIELD(EMRGLSBOUNDEDRECORD, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRGLSBOUNDEDRECORD, RECTL, rclBounds, 8, 16, 4); - TEST_FIELD(EMRGLSBOUNDEDRECORD, DWORD, cbData, 24, 4, 4); - TEST_FIELD(EMRGLSBOUNDEDRECORD, BYTE[1], Data, 28, 1, 1); -} - -static void test_pack_EMRGLSRECORD(void) -{ - /* EMRGLSRECORD (pack 4) */ - TEST_TYPE(EMRGLSRECORD, 16, 4); - TEST_FIELD(EMRGLSRECORD, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRGLSRECORD, DWORD, cbData, 8, 4, 4); - TEST_FIELD(EMRGLSRECORD, BYTE[1], Data, 12, 1, 1); -} - -static void test_pack_EMRINTERSECTCLIPRECT(void) -{ - /* EMRINTERSECTCLIPRECT (pack 4) */ - TEST_TYPE(EMRINTERSECTCLIPRECT, 24, 4); - TEST_FIELD(EMRINTERSECTCLIPRECT, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRINTERSECTCLIPRECT, RECTL, rclClip, 8, 16, 4); -} - -static void test_pack_EMRINVERTRGN(void) -{ - /* EMRINVERTRGN (pack 4) */ - TEST_TYPE(EMRINVERTRGN, 32, 4); - TEST_FIELD(EMRINVERTRGN, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRINVERTRGN, RECTL, rclBounds, 8, 16, 4); - TEST_FIELD(EMRINVERTRGN, DWORD, cbRgnData, 24, 4, 4); - TEST_FIELD(EMRINVERTRGN, BYTE[1], RgnData, 28, 1, 1); -} - -static void test_pack_EMRLINETO(void) -{ - /* EMRLINETO (pack 4) */ - TEST_TYPE(EMRLINETO, 16, 4); - TEST_FIELD(EMRLINETO, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRLINETO, POINTL, ptl, 8, 8, 4); -} - -static void test_pack_EMRMASKBLT(void) -{ - /* EMRMASKBLT (pack 4) */ - TEST_TYPE(EMRMASKBLT, 128, 4); - TEST_FIELD(EMRMASKBLT, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRMASKBLT, RECTL, rclBounds, 8, 16, 4); - TEST_FIELD(EMRMASKBLT, LONG, xDest, 24, 4, 4); - TEST_FIELD(EMRMASKBLT, LONG, yDest, 28, 4, 4); - TEST_FIELD(EMRMASKBLT, LONG, cxDest, 32, 4, 4); - TEST_FIELD(EMRMASKBLT, LONG, cyDest, 36, 4, 4); - TEST_FIELD(EMRMASKBLT, DWORD, dwRop, 40, 4, 4); - TEST_FIELD(EMRMASKBLT, LONG, xSrc, 44, 4, 4); - TEST_FIELD(EMRMASKBLT, LONG, ySrc, 48, 4, 4); - TEST_FIELD(EMRMASKBLT, XFORM, xformSrc, 52, 24, 4); - TEST_FIELD(EMRMASKBLT, COLORREF, crBkColorSrc, 76, 4, 4); - TEST_FIELD(EMRMASKBLT, DWORD, iUsageSrc, 80, 4, 4); - TEST_FIELD(EMRMASKBLT, DWORD, offBmiSrc, 84, 4, 4); - TEST_FIELD(EMRMASKBLT, DWORD, cbBmiSrc, 88, 4, 4); - TEST_FIELD(EMRMASKBLT, DWORD, offBitsSrc, 92, 4, 4); - TEST_FIELD(EMRMASKBLT, DWORD, cbBitsSrc, 96, 4, 4); - TEST_FIELD(EMRMASKBLT, LONG, xMask, 100, 4, 4); - TEST_FIELD(EMRMASKBLT, LONG, yMask, 104, 4, 4); - TEST_FIELD(EMRMASKBLT, DWORD, iUsageMask, 108, 4, 4); - TEST_FIELD(EMRMASKBLT, DWORD, offBmiMask, 112, 4, 4); - TEST_FIELD(EMRMASKBLT, DWORD, cbBmiMask, 116, 4, 4); - TEST_FIELD(EMRMASKBLT, DWORD, offBitsMask, 120, 4, 4); - TEST_FIELD(EMRMASKBLT, DWORD, cbBitsMask, 124, 4, 4); -} - -static void test_pack_EMRMODIFYWORLDTRANSFORM(void) -{ - /* EMRMODIFYWORLDTRANSFORM (pack 4) */ - TEST_TYPE(EMRMODIFYWORLDTRANSFORM, 36, 4); - TEST_FIELD(EMRMODIFYWORLDTRANSFORM, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRMODIFYWORLDTRANSFORM, XFORM, xform, 8, 24, 4); - TEST_FIELD(EMRMODIFYWORLDTRANSFORM, DWORD, iMode, 32, 4, 4); -} - -static void test_pack_EMRMOVETOEX(void) -{ - /* EMRMOVETOEX (pack 4) */ - TEST_TYPE(EMRMOVETOEX, 16, 4); - TEST_FIELD(EMRMOVETOEX, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRMOVETOEX, POINTL, ptl, 8, 8, 4); -} - -static void test_pack_EMROFFSETCLIPRGN(void) -{ - /* EMROFFSETCLIPRGN (pack 4) */ - TEST_TYPE(EMROFFSETCLIPRGN, 16, 4); - TEST_FIELD(EMROFFSETCLIPRGN, EMR, emr, 0, 8, 4); - TEST_FIELD(EMROFFSETCLIPRGN, POINTL, ptlOffset, 8, 8, 4); -} - -static void test_pack_EMRPAINTRGN(void) -{ - /* EMRPAINTRGN (pack 4) */ - TEST_TYPE(EMRPAINTRGN, 32, 4); - TEST_FIELD(EMRPAINTRGN, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRPAINTRGN, RECTL, rclBounds, 8, 16, 4); - TEST_FIELD(EMRPAINTRGN, DWORD, cbRgnData, 24, 4, 4); - TEST_FIELD(EMRPAINTRGN, BYTE[1], RgnData, 28, 1, 1); -} - -static void test_pack_EMRPIE(void) -{ - /* EMRPIE (pack 4) */ - TEST_TYPE(EMRPIE, 40, 4); - TEST_FIELD(EMRPIE, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRPIE, RECTL, rclBox, 8, 16, 4); - TEST_FIELD(EMRPIE, POINTL, ptlStart, 24, 8, 4); - TEST_FIELD(EMRPIE, POINTL, ptlEnd, 32, 8, 4); -} - -static void test_pack_EMRPIXELFORMAT(void) -{ - /* EMRPIXELFORMAT (pack 4) */ - TEST_TYPE(EMRPIXELFORMAT, 48, 4); - TEST_FIELD(EMRPIXELFORMAT, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRPIXELFORMAT, PIXELFORMATDESCRIPTOR, pfd, 8, 40, 4); -} - -static void test_pack_EMRPLGBLT(void) -{ - /* EMRPLGBLT (pack 4) */ - TEST_TYPE(EMRPLGBLT, 140, 4); - TEST_FIELD(EMRPLGBLT, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRPLGBLT, RECTL, rclBounds, 8, 16, 4); - TEST_FIELD(EMRPLGBLT, POINTL[3], aptlDest, 24, 24, 4); - TEST_FIELD(EMRPLGBLT, LONG, xSrc, 48, 4, 4); - TEST_FIELD(EMRPLGBLT, LONG, ySrc, 52, 4, 4); - TEST_FIELD(EMRPLGBLT, LONG, cxSrc, 56, 4, 4); - TEST_FIELD(EMRPLGBLT, LONG, cySrc, 60, 4, 4); - TEST_FIELD(EMRPLGBLT, XFORM, xformSrc, 64, 24, 4); - TEST_FIELD(EMRPLGBLT, COLORREF, crBkColorSrc, 88, 4, 4); - TEST_FIELD(EMRPLGBLT, DWORD, iUsageSrc, 92, 4, 4); - TEST_FIELD(EMRPLGBLT, DWORD, offBmiSrc, 96, 4, 4); - TEST_FIELD(EMRPLGBLT, DWORD, cbBmiSrc, 100, 4, 4); - TEST_FIELD(EMRPLGBLT, DWORD, offBitsSrc, 104, 4, 4); - TEST_FIELD(EMRPLGBLT, DWORD, cbBitsSrc, 108, 4, 4); - TEST_FIELD(EMRPLGBLT, LONG, xMask, 112, 4, 4); - TEST_FIELD(EMRPLGBLT, LONG, yMask, 116, 4, 4); - TEST_FIELD(EMRPLGBLT, DWORD, iUsageMask, 120, 4, 4); - TEST_FIELD(EMRPLGBLT, DWORD, offBmiMask, 124, 4, 4); - TEST_FIELD(EMRPLGBLT, DWORD, cbBmiMask, 128, 4, 4); - TEST_FIELD(EMRPLGBLT, DWORD, offBitsMask, 132, 4, 4); - TEST_FIELD(EMRPLGBLT, DWORD, cbBitsMask, 136, 4, 4); -} - -static void test_pack_EMRPOLYBEZIER(void) -{ - /* EMRPOLYBEZIER (pack 4) */ - TEST_TYPE(EMRPOLYBEZIER, 36, 4); - TEST_FIELD(EMRPOLYBEZIER, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRPOLYBEZIER, RECTL, rclBounds, 8, 16, 4); - TEST_FIELD(EMRPOLYBEZIER, DWORD, cptl, 24, 4, 4); - TEST_FIELD(EMRPOLYBEZIER, POINTL[1], aptl, 28, 8, 4); -} - -static void test_pack_EMRPOLYBEZIER16(void) -{ - /* EMRPOLYBEZIER16 (pack 4) */ - TEST_TYPE(EMRPOLYBEZIER16, 32, 4); - TEST_FIELD(EMRPOLYBEZIER16, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRPOLYBEZIER16, RECTL, rclBounds, 8, 16, 4); - TEST_FIELD(EMRPOLYBEZIER16, DWORD, cpts, 24, 4, 4); - TEST_FIELD(EMRPOLYBEZIER16, POINTS[1], apts, 28, 4, 2); -} - -static void test_pack_EMRPOLYBEZIERTO(void) -{ - /* EMRPOLYBEZIERTO (pack 4) */ - TEST_TYPE(EMRPOLYBEZIERTO, 36, 4); - TEST_FIELD(EMRPOLYBEZIERTO, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRPOLYBEZIERTO, RECTL, rclBounds, 8, 16, 4); - TEST_FIELD(EMRPOLYBEZIERTO, DWORD, cptl, 24, 4, 4); - TEST_FIELD(EMRPOLYBEZIERTO, POINTL[1], aptl, 28, 8, 4); -} - -static void test_pack_EMRPOLYBEZIERTO16(void) -{ - /* EMRPOLYBEZIERTO16 (pack 4) */ - TEST_TYPE(EMRPOLYBEZIERTO16, 32, 4); - TEST_FIELD(EMRPOLYBEZIERTO16, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRPOLYBEZIERTO16, RECTL, rclBounds, 8, 16, 4); - TEST_FIELD(EMRPOLYBEZIERTO16, DWORD, cpts, 24, 4, 4); - TEST_FIELD(EMRPOLYBEZIERTO16, POINTS[1], apts, 28, 4, 2); -} - -static void test_pack_EMRPOLYDRAW(void) -{ - /* EMRPOLYDRAW (pack 4) */ - TEST_TYPE(EMRPOLYDRAW, 40, 4); - TEST_FIELD(EMRPOLYDRAW, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRPOLYDRAW, RECTL, rclBounds, 8, 16, 4); - TEST_FIELD(EMRPOLYDRAW, DWORD, cptl, 24, 4, 4); - TEST_FIELD(EMRPOLYDRAW, POINTL[1], aptl, 28, 8, 4); - TEST_FIELD(EMRPOLYDRAW, BYTE[1], abTypes, 36, 1, 1); -} - -static void test_pack_EMRPOLYDRAW16(void) -{ - /* EMRPOLYDRAW16 (pack 4) */ - TEST_TYPE(EMRPOLYDRAW16, 36, 4); - TEST_FIELD(EMRPOLYDRAW16, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRPOLYDRAW16, RECTL, rclBounds, 8, 16, 4); - TEST_FIELD(EMRPOLYDRAW16, DWORD, cpts, 24, 4, 4); - TEST_FIELD(EMRPOLYDRAW16, POINTS[1], apts, 28, 4, 2); - TEST_FIELD(EMRPOLYDRAW16, BYTE[1], abTypes, 32, 1, 1); -} - -static void test_pack_EMRPOLYGON(void) -{ - /* EMRPOLYGON (pack 4) */ - TEST_TYPE(EMRPOLYGON, 36, 4); - TEST_FIELD(EMRPOLYGON, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRPOLYGON, RECTL, rclBounds, 8, 16, 4); - TEST_FIELD(EMRPOLYGON, DWORD, cptl, 24, 4, 4); - TEST_FIELD(EMRPOLYGON, POINTL[1], aptl, 28, 8, 4); -} - -static void test_pack_EMRPOLYGON16(void) -{ - /* EMRPOLYGON16 (pack 4) */ - TEST_TYPE(EMRPOLYGON16, 32, 4); - TEST_FIELD(EMRPOLYGON16, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRPOLYGON16, RECTL, rclBounds, 8, 16, 4); - TEST_FIELD(EMRPOLYGON16, DWORD, cpts, 24, 4, 4); - TEST_FIELD(EMRPOLYGON16, POINTS[1], apts, 28, 4, 2); -} - -static void test_pack_EMRPOLYLINE(void) -{ - /* EMRPOLYLINE (pack 4) */ - TEST_TYPE(EMRPOLYLINE, 36, 4); - TEST_FIELD(EMRPOLYLINE, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRPOLYLINE, RECTL, rclBounds, 8, 16, 4); - TEST_FIELD(EMRPOLYLINE, DWORD, cptl, 24, 4, 4); - TEST_FIELD(EMRPOLYLINE, POINTL[1], aptl, 28, 8, 4); -} - -static void test_pack_EMRPOLYLINE16(void) -{ - /* EMRPOLYLINE16 (pack 4) */ - TEST_TYPE(EMRPOLYLINE16, 32, 4); - TEST_FIELD(EMRPOLYLINE16, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRPOLYLINE16, RECTL, rclBounds, 8, 16, 4); - TEST_FIELD(EMRPOLYLINE16, DWORD, cpts, 24, 4, 4); - TEST_FIELD(EMRPOLYLINE16, POINTS[1], apts, 28, 4, 2); -} - -static void test_pack_EMRPOLYLINETO(void) -{ - /* EMRPOLYLINETO (pack 4) */ - TEST_TYPE(EMRPOLYLINETO, 36, 4); - TEST_FIELD(EMRPOLYLINETO, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRPOLYLINETO, RECTL, rclBounds, 8, 16, 4); - TEST_FIELD(EMRPOLYLINETO, DWORD, cptl, 24, 4, 4); - TEST_FIELD(EMRPOLYLINETO, POINTL[1], aptl, 28, 8, 4); -} - -static void test_pack_EMRPOLYLINETO16(void) -{ - /* EMRPOLYLINETO16 (pack 4) */ - TEST_TYPE(EMRPOLYLINETO16, 32, 4); - TEST_FIELD(EMRPOLYLINETO16, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRPOLYLINETO16, RECTL, rclBounds, 8, 16, 4); - TEST_FIELD(EMRPOLYLINETO16, DWORD, cpts, 24, 4, 4); - TEST_FIELD(EMRPOLYLINETO16, POINTS[1], apts, 28, 4, 2); -} - -static void test_pack_EMRPOLYPOLYGON(void) -{ - /* EMRPOLYPOLYGON (pack 4) */ - TEST_TYPE(EMRPOLYPOLYGON, 44, 4); - TEST_FIELD(EMRPOLYPOLYGON, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRPOLYPOLYGON, RECTL, rclBounds, 8, 16, 4); - TEST_FIELD(EMRPOLYPOLYGON, DWORD, nPolys, 24, 4, 4); - TEST_FIELD(EMRPOLYPOLYGON, DWORD, cptl, 28, 4, 4); - TEST_FIELD(EMRPOLYPOLYGON, DWORD[1], aPolyCounts, 32, 4, 4); - TEST_FIELD(EMRPOLYPOLYGON, POINTL[1], aptl, 36, 8, 4); -} - -static void test_pack_EMRPOLYPOLYGON16(void) -{ - /* EMRPOLYPOLYGON16 (pack 4) */ - TEST_TYPE(EMRPOLYPOLYGON16, 40, 4); - TEST_FIELD(EMRPOLYPOLYGON16, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRPOLYPOLYGON16, RECTL, rclBounds, 8, 16, 4); - TEST_FIELD(EMRPOLYPOLYGON16, DWORD, nPolys, 24, 4, 4); - TEST_FIELD(EMRPOLYPOLYGON16, DWORD, cpts, 28, 4, 4); - TEST_FIELD(EMRPOLYPOLYGON16, DWORD[1], aPolyCounts, 32, 4, 4); - TEST_FIELD(EMRPOLYPOLYGON16, POINTS[1], apts, 36, 4, 2); -} - -static void test_pack_EMRPOLYPOLYLINE(void) -{ - /* EMRPOLYPOLYLINE (pack 4) */ - TEST_TYPE(EMRPOLYPOLYLINE, 44, 4); - TEST_FIELD(EMRPOLYPOLYLINE, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRPOLYPOLYLINE, RECTL, rclBounds, 8, 16, 4); - TEST_FIELD(EMRPOLYPOLYLINE, DWORD, nPolys, 24, 4, 4); - TEST_FIELD(EMRPOLYPOLYLINE, DWORD, cptl, 28, 4, 4); - TEST_FIELD(EMRPOLYPOLYLINE, DWORD[1], aPolyCounts, 32, 4, 4); - TEST_FIELD(EMRPOLYPOLYLINE, POINTL[1], aptl, 36, 8, 4); -} - -static void test_pack_EMRPOLYPOLYLINE16(void) -{ - /* EMRPOLYPOLYLINE16 (pack 4) */ - TEST_TYPE(EMRPOLYPOLYLINE16, 40, 4); - TEST_FIELD(EMRPOLYPOLYLINE16, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRPOLYPOLYLINE16, RECTL, rclBounds, 8, 16, 4); - TEST_FIELD(EMRPOLYPOLYLINE16, DWORD, nPolys, 24, 4, 4); - TEST_FIELD(EMRPOLYPOLYLINE16, DWORD, cpts, 28, 4, 4); - TEST_FIELD(EMRPOLYPOLYLINE16, DWORD[1], aPolyCounts, 32, 4, 4); - TEST_FIELD(EMRPOLYPOLYLINE16, POINTS[1], apts, 36, 4, 2); -} - -static void test_pack_EMRPOLYTEXTOUTA(void) -{ - /* EMRPOLYTEXTOUTA (pack 4) */ - TEST_TYPE(EMRPOLYTEXTOUTA, 80, 4); - TEST_FIELD(EMRPOLYTEXTOUTA, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRPOLYTEXTOUTA, RECTL, rclBounds, 8, 16, 4); - TEST_FIELD(EMRPOLYTEXTOUTA, DWORD, iGraphicsMode, 24, 4, 4); - TEST_FIELD(EMRPOLYTEXTOUTA, FLOAT, exScale, 28, 4, 4); - TEST_FIELD(EMRPOLYTEXTOUTA, FLOAT, eyScale, 32, 4, 4); - TEST_FIELD(EMRPOLYTEXTOUTA, LONG, cStrings, 36, 4, 4); - TEST_FIELD(EMRPOLYTEXTOUTA, EMRTEXT[1], aemrtext, 40, 40, 4); -} - -static void test_pack_EMRPOLYTEXTOUTW(void) -{ - /* EMRPOLYTEXTOUTW (pack 4) */ - TEST_TYPE(EMRPOLYTEXTOUTW, 80, 4); - TEST_FIELD(EMRPOLYTEXTOUTW, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRPOLYTEXTOUTW, RECTL, rclBounds, 8, 16, 4); - TEST_FIELD(EMRPOLYTEXTOUTW, DWORD, iGraphicsMode, 24, 4, 4); - TEST_FIELD(EMRPOLYTEXTOUTW, FLOAT, exScale, 28, 4, 4); - TEST_FIELD(EMRPOLYTEXTOUTW, FLOAT, eyScale, 32, 4, 4); - TEST_FIELD(EMRPOLYTEXTOUTW, LONG, cStrings, 36, 4, 4); - TEST_FIELD(EMRPOLYTEXTOUTW, EMRTEXT[1], aemrtext, 40, 40, 4); -} - -static void test_pack_EMRREALIZEPALETTE(void) -{ - /* EMRREALIZEPALETTE (pack 4) */ - TEST_TYPE(EMRREALIZEPALETTE, 8, 4); - TEST_FIELD(EMRREALIZEPALETTE, EMR, emr, 0, 8, 4); -} - -static void test_pack_EMRRECTANGLE(void) -{ - /* EMRRECTANGLE (pack 4) */ - TEST_TYPE(EMRRECTANGLE, 24, 4); - TEST_FIELD(EMRRECTANGLE, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRRECTANGLE, RECTL, rclBox, 8, 16, 4); -} - -static void test_pack_EMRRESIZEPALETTE(void) -{ - /* EMRRESIZEPALETTE (pack 4) */ - TEST_TYPE(EMRRESIZEPALETTE, 16, 4); - TEST_FIELD(EMRRESIZEPALETTE, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRRESIZEPALETTE, DWORD, ihPal, 8, 4, 4); - TEST_FIELD(EMRRESIZEPALETTE, DWORD, cEntries, 12, 4, 4); -} - -static void test_pack_EMRRESTOREDC(void) -{ - /* EMRRESTOREDC (pack 4) */ - TEST_TYPE(EMRRESTOREDC, 12, 4); - TEST_FIELD(EMRRESTOREDC, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRRESTOREDC, LONG, iRelative, 8, 4, 4); -} - -static void test_pack_EMRROUNDRECT(void) -{ - /* EMRROUNDRECT (pack 4) */ - TEST_TYPE(EMRROUNDRECT, 32, 4); - TEST_FIELD(EMRROUNDRECT, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRROUNDRECT, RECTL, rclBox, 8, 16, 4); - TEST_FIELD(EMRROUNDRECT, SIZEL, szlCorner, 24, 8, 4); -} - -static void test_pack_EMRSAVEDC(void) -{ - /* EMRSAVEDC (pack 4) */ - TEST_TYPE(EMRSAVEDC, 8, 4); - TEST_FIELD(EMRSAVEDC, EMR, emr, 0, 8, 4); -} - -static void test_pack_EMRSCALEVIEWPORTEXTEX(void) -{ - /* EMRSCALEVIEWPORTEXTEX (pack 4) */ - TEST_TYPE(EMRSCALEVIEWPORTEXTEX, 24, 4); - TEST_FIELD(EMRSCALEVIEWPORTEXTEX, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRSCALEVIEWPORTEXTEX, LONG, xNum, 8, 4, 4); - TEST_FIELD(EMRSCALEVIEWPORTEXTEX, LONG, xDenom, 12, 4, 4); - TEST_FIELD(EMRSCALEVIEWPORTEXTEX, LONG, yNum, 16, 4, 4); - TEST_FIELD(EMRSCALEVIEWPORTEXTEX, LONG, yDenom, 20, 4, 4); -} - -static void test_pack_EMRSCALEWINDOWEXTEX(void) -{ - /* EMRSCALEWINDOWEXTEX (pack 4) */ - TEST_TYPE(EMRSCALEWINDOWEXTEX, 24, 4); - TEST_FIELD(EMRSCALEWINDOWEXTEX, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRSCALEWINDOWEXTEX, LONG, xNum, 8, 4, 4); - TEST_FIELD(EMRSCALEWINDOWEXTEX, LONG, xDenom, 12, 4, 4); - TEST_FIELD(EMRSCALEWINDOWEXTEX, LONG, yNum, 16, 4, 4); - TEST_FIELD(EMRSCALEWINDOWEXTEX, LONG, yDenom, 20, 4, 4); -} - -static void test_pack_EMRSELECTCLIPPATH(void) -{ - /* EMRSELECTCLIPPATH (pack 4) */ - TEST_TYPE(EMRSELECTCLIPPATH, 12, 4); - TEST_FIELD(EMRSELECTCLIPPATH, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRSELECTCLIPPATH, DWORD, iMode, 8, 4, 4); -} - -static void test_pack_EMRSELECTCOLORSPACE(void) -{ - /* EMRSELECTCOLORSPACE (pack 4) */ - TEST_TYPE(EMRSELECTCOLORSPACE, 12, 4); - TEST_FIELD(EMRSELECTCOLORSPACE, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRSELECTCOLORSPACE, DWORD, ihCS, 8, 4, 4); -} - -static void test_pack_EMRSELECTOBJECT(void) -{ - /* EMRSELECTOBJECT (pack 4) */ - TEST_TYPE(EMRSELECTOBJECT, 12, 4); - TEST_FIELD(EMRSELECTOBJECT, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRSELECTOBJECT, DWORD, ihObject, 8, 4, 4); -} - -static void test_pack_EMRSELECTPALETTE(void) -{ - /* EMRSELECTPALETTE (pack 4) */ - TEST_TYPE(EMRSELECTPALETTE, 12, 4); - TEST_FIELD(EMRSELECTPALETTE, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRSELECTPALETTE, DWORD, ihPal, 8, 4, 4); -} - -static void test_pack_EMRSETARCDIRECTION(void) -{ - /* EMRSETARCDIRECTION (pack 4) */ - TEST_TYPE(EMRSETARCDIRECTION, 12, 4); - TEST_FIELD(EMRSETARCDIRECTION, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRSETARCDIRECTION, DWORD, iArcDirection, 8, 4, 4); -} - -static void test_pack_EMRSETBKCOLOR(void) -{ - /* EMRSETBKCOLOR (pack 4) */ - TEST_TYPE(EMRSETBKCOLOR, 12, 4); - TEST_FIELD(EMRSETBKCOLOR, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRSETBKCOLOR, COLORREF, crColor, 8, 4, 4); -} - -static void test_pack_EMRSETBKMODE(void) -{ - /* EMRSETBKMODE (pack 4) */ - TEST_TYPE(EMRSETBKMODE, 12, 4); - TEST_FIELD(EMRSETBKMODE, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRSETBKMODE, DWORD, iMode, 8, 4, 4); -} - -static void test_pack_EMRSETBRUSHORGEX(void) -{ - /* EMRSETBRUSHORGEX (pack 4) */ - TEST_TYPE(EMRSETBRUSHORGEX, 16, 4); - TEST_FIELD(EMRSETBRUSHORGEX, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRSETBRUSHORGEX, POINTL, ptlOrigin, 8, 8, 4); -} - -static void test_pack_EMRSETCOLORADJUSTMENT(void) -{ - /* EMRSETCOLORADJUSTMENT (pack 4) */ - TEST_TYPE(EMRSETCOLORADJUSTMENT, 32, 4); - TEST_FIELD(EMRSETCOLORADJUSTMENT, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRSETCOLORADJUSTMENT, COLORADJUSTMENT, ColorAdjustment, 8, 24, 2); -} - -static void test_pack_EMRSETCOLORSPACE(void) -{ - /* EMRSETCOLORSPACE (pack 4) */ - TEST_TYPE(EMRSETCOLORSPACE, 12, 4); - TEST_FIELD(EMRSETCOLORSPACE, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRSETCOLORSPACE, DWORD, ihCS, 8, 4, 4); -} - -static void test_pack_EMRSETDIBITSTODEVICE(void) -{ - /* EMRSETDIBITSTODEVICE (pack 4) */ - TEST_TYPE(EMRSETDIBITSTODEVICE, 76, 4); - TEST_FIELD(EMRSETDIBITSTODEVICE, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRSETDIBITSTODEVICE, RECTL, rclBounds, 8, 16, 4); - TEST_FIELD(EMRSETDIBITSTODEVICE, LONG, xDest, 24, 4, 4); - TEST_FIELD(EMRSETDIBITSTODEVICE, LONG, yDest, 28, 4, 4); - TEST_FIELD(EMRSETDIBITSTODEVICE, LONG, xSrc, 32, 4, 4); - TEST_FIELD(EMRSETDIBITSTODEVICE, LONG, ySrc, 36, 4, 4); - TEST_FIELD(EMRSETDIBITSTODEVICE, LONG, cxSrc, 40, 4, 4); - TEST_FIELD(EMRSETDIBITSTODEVICE, LONG, cySrc, 44, 4, 4); - TEST_FIELD(EMRSETDIBITSTODEVICE, DWORD, offBmiSrc, 48, 4, 4); - TEST_FIELD(EMRSETDIBITSTODEVICE, DWORD, cbBmiSrc, 52, 4, 4); - TEST_FIELD(EMRSETDIBITSTODEVICE, DWORD, offBitsSrc, 56, 4, 4); - TEST_FIELD(EMRSETDIBITSTODEVICE, DWORD, cbBitsSrc, 60, 4, 4); - TEST_FIELD(EMRSETDIBITSTODEVICE, DWORD, iUsageSrc, 64, 4, 4); - TEST_FIELD(EMRSETDIBITSTODEVICE, DWORD, iStartScan, 68, 4, 4); - TEST_FIELD(EMRSETDIBITSTODEVICE, DWORD, cScans, 72, 4, 4); -} - -static void test_pack_EMRSETICMMODE(void) -{ - /* EMRSETICMMODE (pack 4) */ - TEST_TYPE(EMRSETICMMODE, 12, 4); - TEST_FIELD(EMRSETICMMODE, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRSETICMMODE, DWORD, iMode, 8, 4, 4); -} - -static void test_pack_EMRSETLAYOUT(void) -{ - /* EMRSETLAYOUT (pack 4) */ - TEST_TYPE(EMRSETLAYOUT, 12, 4); - TEST_FIELD(EMRSETLAYOUT, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRSETLAYOUT, DWORD, iMode, 8, 4, 4); -} - -static void test_pack_EMRSETMAPMODE(void) -{ - /* EMRSETMAPMODE (pack 4) */ - TEST_TYPE(EMRSETMAPMODE, 12, 4); - TEST_FIELD(EMRSETMAPMODE, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRSETMAPMODE, DWORD, iMode, 8, 4, 4); -} - -static void test_pack_EMRSETMAPPERFLAGS(void) -{ - /* EMRSETMAPPERFLAGS (pack 4) */ - TEST_TYPE(EMRSETMAPPERFLAGS, 12, 4); - TEST_FIELD(EMRSETMAPPERFLAGS, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRSETMAPPERFLAGS, DWORD, dwFlags, 8, 4, 4); -} - -static void test_pack_EMRSETMETARGN(void) -{ - /* EMRSETMETARGN (pack 4) */ - TEST_TYPE(EMRSETMETARGN, 8, 4); - TEST_FIELD(EMRSETMETARGN, EMR, emr, 0, 8, 4); -} - -static void test_pack_EMRSETMITERLIMIT(void) -{ - /* EMRSETMITERLIMIT (pack 4) */ - TEST_TYPE(EMRSETMITERLIMIT, 12, 4); - TEST_FIELD(EMRSETMITERLIMIT, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRSETMITERLIMIT, FLOAT, eMiterLimit, 8, 4, 4); -} - -static void test_pack_EMRSETPIXELV(void) -{ - /* EMRSETPIXELV (pack 4) */ - TEST_TYPE(EMRSETPIXELV, 20, 4); - TEST_FIELD(EMRSETPIXELV, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRSETPIXELV, POINTL, ptlPixel, 8, 8, 4); - TEST_FIELD(EMRSETPIXELV, COLORREF, crColor, 16, 4, 4); -} - -static void test_pack_EMRSETPOLYFILLMODE(void) -{ - /* EMRSETPOLYFILLMODE (pack 4) */ - TEST_TYPE(EMRSETPOLYFILLMODE, 12, 4); - TEST_FIELD(EMRSETPOLYFILLMODE, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRSETPOLYFILLMODE, DWORD, iMode, 8, 4, 4); -} - -static void test_pack_EMRSETROP2(void) -{ - /* EMRSETROP2 (pack 4) */ - TEST_TYPE(EMRSETROP2, 12, 4); - TEST_FIELD(EMRSETROP2, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRSETROP2, DWORD, iMode, 8, 4, 4); -} - -static void test_pack_EMRSETSTRETCHBLTMODE(void) -{ - /* EMRSETSTRETCHBLTMODE (pack 4) */ - TEST_TYPE(EMRSETSTRETCHBLTMODE, 12, 4); - TEST_FIELD(EMRSETSTRETCHBLTMODE, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRSETSTRETCHBLTMODE, DWORD, iMode, 8, 4, 4); -} - -static void test_pack_EMRSETTEXTALIGN(void) -{ - /* EMRSETTEXTALIGN (pack 4) */ - TEST_TYPE(EMRSETTEXTALIGN, 12, 4); - TEST_FIELD(EMRSETTEXTALIGN, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRSETTEXTALIGN, DWORD, iMode, 8, 4, 4); -} - -static void test_pack_EMRSETTEXTCOLOR(void) -{ - /* EMRSETTEXTCOLOR (pack 4) */ - TEST_TYPE(EMRSETTEXTCOLOR, 12, 4); - TEST_FIELD(EMRSETTEXTCOLOR, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRSETTEXTCOLOR, COLORREF, crColor, 8, 4, 4); -} - -static void test_pack_EMRSETVIEWPORTEXTEX(void) -{ - /* EMRSETVIEWPORTEXTEX (pack 4) */ - TEST_TYPE(EMRSETVIEWPORTEXTEX, 16, 4); - TEST_FIELD(EMRSETVIEWPORTEXTEX, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRSETVIEWPORTEXTEX, SIZEL, szlExtent, 8, 8, 4); -} - -static void test_pack_EMRSETVIEWPORTORGEX(void) -{ - /* EMRSETVIEWPORTORGEX (pack 4) */ - TEST_TYPE(EMRSETVIEWPORTORGEX, 16, 4); - TEST_FIELD(EMRSETVIEWPORTORGEX, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRSETVIEWPORTORGEX, POINTL, ptlOrigin, 8, 8, 4); -} - -static void test_pack_EMRSETWINDOWEXTEX(void) -{ - /* EMRSETWINDOWEXTEX (pack 4) */ - TEST_TYPE(EMRSETWINDOWEXTEX, 16, 4); - TEST_FIELD(EMRSETWINDOWEXTEX, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRSETWINDOWEXTEX, SIZEL, szlExtent, 8, 8, 4); -} - -static void test_pack_EMRSETWINDOWORGEX(void) -{ - /* EMRSETWINDOWORGEX (pack 4) */ - TEST_TYPE(EMRSETWINDOWORGEX, 16, 4); - TEST_FIELD(EMRSETWINDOWORGEX, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRSETWINDOWORGEX, POINTL, ptlOrigin, 8, 8, 4); -} - -static void test_pack_EMRSETWORLDTRANSFORM(void) -{ - /* EMRSETWORLDTRANSFORM (pack 4) */ - TEST_TYPE(EMRSETWORLDTRANSFORM, 32, 4); - TEST_FIELD(EMRSETWORLDTRANSFORM, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRSETWORLDTRANSFORM, XFORM, xform, 8, 24, 4); -} - -static void test_pack_EMRSTRETCHBLT(void) -{ - /* EMRSTRETCHBLT (pack 4) */ - TEST_TYPE(EMRSTRETCHBLT, 108, 4); - TEST_FIELD(EMRSTRETCHBLT, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRSTRETCHBLT, RECTL, rclBounds, 8, 16, 4); - TEST_FIELD(EMRSTRETCHBLT, LONG, xDest, 24, 4, 4); - TEST_FIELD(EMRSTRETCHBLT, LONG, yDest, 28, 4, 4); - TEST_FIELD(EMRSTRETCHBLT, LONG, cxDest, 32, 4, 4); - TEST_FIELD(EMRSTRETCHBLT, LONG, cyDest, 36, 4, 4); - TEST_FIELD(EMRSTRETCHBLT, DWORD, dwRop, 40, 4, 4); - TEST_FIELD(EMRSTRETCHBLT, LONG, xSrc, 44, 4, 4); - TEST_FIELD(EMRSTRETCHBLT, LONG, ySrc, 48, 4, 4); - TEST_FIELD(EMRSTRETCHBLT, XFORM, xformSrc, 52, 24, 4); - TEST_FIELD(EMRSTRETCHBLT, COLORREF, crBkColorSrc, 76, 4, 4); - TEST_FIELD(EMRSTRETCHBLT, DWORD, iUsageSrc, 80, 4, 4); - TEST_FIELD(EMRSTRETCHBLT, DWORD, offBmiSrc, 84, 4, 4); - TEST_FIELD(EMRSTRETCHBLT, DWORD, cbBmiSrc, 88, 4, 4); - TEST_FIELD(EMRSTRETCHBLT, DWORD, offBitsSrc, 92, 4, 4); - TEST_FIELD(EMRSTRETCHBLT, DWORD, cbBitsSrc, 96, 4, 4); - TEST_FIELD(EMRSTRETCHBLT, LONG, cxSrc, 100, 4, 4); - TEST_FIELD(EMRSTRETCHBLT, LONG, cySrc, 104, 4, 4); -} - -static void test_pack_EMRSTRETCHDIBITS(void) -{ - /* EMRSTRETCHDIBITS (pack 4) */ - TEST_TYPE(EMRSTRETCHDIBITS, 80, 4); - TEST_FIELD(EMRSTRETCHDIBITS, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRSTRETCHDIBITS, RECTL, rclBounds, 8, 16, 4); - TEST_FIELD(EMRSTRETCHDIBITS, LONG, xDest, 24, 4, 4); - TEST_FIELD(EMRSTRETCHDIBITS, LONG, yDest, 28, 4, 4); - TEST_FIELD(EMRSTRETCHDIBITS, LONG, xSrc, 32, 4, 4); - TEST_FIELD(EMRSTRETCHDIBITS, LONG, ySrc, 36, 4, 4); - TEST_FIELD(EMRSTRETCHDIBITS, LONG, cxSrc, 40, 4, 4); - TEST_FIELD(EMRSTRETCHDIBITS, LONG, cySrc, 44, 4, 4); - TEST_FIELD(EMRSTRETCHDIBITS, DWORD, offBmiSrc, 48, 4, 4); - TEST_FIELD(EMRSTRETCHDIBITS, DWORD, cbBmiSrc, 52, 4, 4); - TEST_FIELD(EMRSTRETCHDIBITS, DWORD, offBitsSrc, 56, 4, 4); - TEST_FIELD(EMRSTRETCHDIBITS, DWORD, cbBitsSrc, 60, 4, 4); - TEST_FIELD(EMRSTRETCHDIBITS, DWORD, iUsageSrc, 64, 4, 4); - TEST_FIELD(EMRSTRETCHDIBITS, DWORD, dwRop, 68, 4, 4); - TEST_FIELD(EMRSTRETCHDIBITS, LONG, cxDest, 72, 4, 4); - TEST_FIELD(EMRSTRETCHDIBITS, LONG, cyDest, 76, 4, 4); -} - -static void test_pack_EMRSTROKEANDFILLPATH(void) -{ - /* EMRSTROKEANDFILLPATH (pack 4) */ - TEST_TYPE(EMRSTROKEANDFILLPATH, 24, 4); - TEST_FIELD(EMRSTROKEANDFILLPATH, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRSTROKEANDFILLPATH, RECTL, rclBounds, 8, 16, 4); -} - -static void test_pack_EMRSTROKEPATH(void) -{ - /* EMRSTROKEPATH (pack 4) */ - TEST_TYPE(EMRSTROKEPATH, 24, 4); - TEST_FIELD(EMRSTROKEPATH, EMR, emr, 0, 8, 4); - TEST_FIELD(EMRSTROKEPATH, RECTL, rclBounds, 8, 16, 4); -} - -static void test_pack_EMRTEXT(void) -{ - /* EMRTEXT (pack 4) */ - TEST_TYPE(EMRTEXT, 40, 4); - TEST_FIELD(EMRTEXT, POINTL, ptlReference, 0, 8, 4); - TEST_FIELD(EMRTEXT, DWORD, nChars, 8, 4, 4); - TEST_FIELD(EMRTEXT, DWORD, offString, 12, 4, 4); - TEST_FIELD(EMRTEXT, DWORD, fOptions, 16, 4, 4); - TEST_FIELD(EMRTEXT, RECTL, rcl, 20, 16, 4); - TEST_FIELD(EMRTEXT, DWORD, offDx, 36, 4, 4); -} - -static void test_pack_EMRWIDENPATH(void) -{ - /* EMRWIDENPATH (pack 4) */ - TEST_TYPE(EMRWIDENPATH, 8, 4); - TEST_FIELD(EMRWIDENPATH, EMR, emr, 0, 8, 4); -} - -static void test_pack_ENHMETAHEADER(void) -{ - /* ENHMETAHEADER (pack 4) */ - TEST_TYPE(ENHMETAHEADER, 108, 4); - TEST_FIELD(ENHMETAHEADER, DWORD, iType, 0, 4, 4); - TEST_FIELD(ENHMETAHEADER, DWORD, nSize, 4, 4, 4); - TEST_FIELD(ENHMETAHEADER, RECTL, rclBounds, 8, 16, 4); - TEST_FIELD(ENHMETAHEADER, RECTL, rclFrame, 24, 16, 4); - TEST_FIELD(ENHMETAHEADER, DWORD, dSignature, 40, 4, 4); - TEST_FIELD(ENHMETAHEADER, DWORD, nVersion, 44, 4, 4); - TEST_FIELD(ENHMETAHEADER, DWORD, nBytes, 48, 4, 4); - TEST_FIELD(ENHMETAHEADER, DWORD, nRecords, 52, 4, 4); - TEST_FIELD(ENHMETAHEADER, WORD, nHandles, 56, 2, 2); - TEST_FIELD(ENHMETAHEADER, WORD, sReserved, 58, 2, 2); - TEST_FIELD(ENHMETAHEADER, DWORD, nDescription, 60, 4, 4); - TEST_FIELD(ENHMETAHEADER, DWORD, offDescription, 64, 4, 4); - TEST_FIELD(ENHMETAHEADER, DWORD, nPalEntries, 68, 4, 4); - TEST_FIELD(ENHMETAHEADER, SIZEL, szlDevice, 72, 8, 4); - TEST_FIELD(ENHMETAHEADER, SIZEL, szlMillimeters, 80, 8, 4); - TEST_FIELD(ENHMETAHEADER, DWORD, cbPixelFormat, 88, 4, 4); - TEST_FIELD(ENHMETAHEADER, DWORD, offPixelFormat, 92, 4, 4); - TEST_FIELD(ENHMETAHEADER, DWORD, bOpenGL, 96, 4, 4); - TEST_FIELD(ENHMETAHEADER, SIZEL, szlMicrometers, 100, 8, 4); -} - -static void test_pack_ENHMETARECORD(void) -{ - /* ENHMETARECORD (pack 4) */ - TEST_TYPE(ENHMETARECORD, 12, 4); - TEST_FIELD(ENHMETARECORD, DWORD, iType, 0, 4, 4); - TEST_FIELD(ENHMETARECORD, DWORD, nSize, 4, 4, 4); - TEST_FIELD(ENHMETARECORD, DWORD[1], dParm, 8, 4, 4); -} - -static void test_pack_ENHMFENUMPROC(void) -{ - /* ENHMFENUMPROC */ - TEST_TYPE(ENHMFENUMPROC, 4, 4); -} - -static void test_pack_ENUMLOGFONTA(void) -{ - /* ENUMLOGFONTA (pack 4) */ - TEST_TYPE(ENUMLOGFONTA, 156, 4); - TEST_FIELD(ENUMLOGFONTA, LOGFONTA, elfLogFont, 0, 60, 4); - TEST_FIELD(ENUMLOGFONTA, BYTE[LF_FULLFACESIZE], elfFullName, 60, 64, 1); - TEST_FIELD(ENUMLOGFONTA, BYTE[LF_FACESIZE], elfStyle, 124, 32, 1); -} - -static void test_pack_ENUMLOGFONTEXA(void) -{ - /* ENUMLOGFONTEXA (pack 4) */ - TEST_TYPE(ENUMLOGFONTEXA, 188, 4); - TEST_FIELD(ENUMLOGFONTEXA, LOGFONTA, elfLogFont, 0, 60, 4); - TEST_FIELD(ENUMLOGFONTEXA, BYTE[LF_FULLFACESIZE], elfFullName, 60, 64, 1); - TEST_FIELD(ENUMLOGFONTEXA, BYTE[LF_FACESIZE], elfStyle, 124, 32, 1); - TEST_FIELD(ENUMLOGFONTEXA, BYTE[LF_FACESIZE], elfScript, 156, 32, 1); -} - -static void test_pack_ENUMLOGFONTEXW(void) -{ - /* ENUMLOGFONTEXW (pack 4) */ - TEST_TYPE(ENUMLOGFONTEXW, 348, 4); - TEST_FIELD(ENUMLOGFONTEXW, LOGFONTW, elfLogFont, 0, 92, 4); - TEST_FIELD(ENUMLOGFONTEXW, WCHAR[LF_FULLFACESIZE], elfFullName, 92, 128, 2); - TEST_FIELD(ENUMLOGFONTEXW, WCHAR[LF_FACESIZE], elfStyle, 220, 64, 2); - TEST_FIELD(ENUMLOGFONTEXW, WCHAR[LF_FACESIZE], elfScript, 284, 64, 2); -} - -static void test_pack_ENUMLOGFONTW(void) -{ - /* ENUMLOGFONTW (pack 4) */ - TEST_TYPE(ENUMLOGFONTW, 284, 4); - TEST_FIELD(ENUMLOGFONTW, LOGFONTW, elfLogFont, 0, 92, 4); - TEST_FIELD(ENUMLOGFONTW, WCHAR[LF_FULLFACESIZE], elfFullName, 92, 128, 2); - TEST_FIELD(ENUMLOGFONTW, WCHAR[LF_FACESIZE], elfStyle, 220, 64, 2); -} - -static void test_pack_EXTLOGFONTA(void) -{ - /* EXTLOGFONTA (pack 4) */ - TEST_TYPE(EXTLOGFONTA, 192, 4); - TEST_FIELD(EXTLOGFONTA, LOGFONTA, elfLogFont, 0, 60, 4); - TEST_FIELD(EXTLOGFONTA, BYTE[LF_FULLFACESIZE], elfFullName, 60, 64, 1); - TEST_FIELD(EXTLOGFONTA, BYTE[LF_FACESIZE], elfStyle, 124, 32, 1); - TEST_FIELD(EXTLOGFONTA, DWORD, elfVersion, 156, 4, 4); - TEST_FIELD(EXTLOGFONTA, DWORD, elfStyleSize, 160, 4, 4); - TEST_FIELD(EXTLOGFONTA, DWORD, elfMatch, 164, 4, 4); - TEST_FIELD(EXTLOGFONTA, DWORD, elfReserved, 168, 4, 4); - TEST_FIELD(EXTLOGFONTA, BYTE[ELF_VENDOR_SIZE], elfVendorId, 172, 4, 1); - TEST_FIELD(EXTLOGFONTA, DWORD, elfCulture, 176, 4, 4); - TEST_FIELD(EXTLOGFONTA, PANOSE, elfPanose, 180, 10, 1); -} - -static void test_pack_EXTLOGFONTW(void) -{ - /* EXTLOGFONTW (pack 4) */ - TEST_TYPE(EXTLOGFONTW, 320, 4); - TEST_FIELD(EXTLOGFONTW, LOGFONTW, elfLogFont, 0, 92, 4); - TEST_FIELD(EXTLOGFONTW, WCHAR[LF_FULLFACESIZE], elfFullName, 92, 128, 2); - TEST_FIELD(EXTLOGFONTW, WCHAR[LF_FACESIZE], elfStyle, 220, 64, 2); - TEST_FIELD(EXTLOGFONTW, DWORD, elfVersion, 284, 4, 4); - TEST_FIELD(EXTLOGFONTW, DWORD, elfStyleSize, 288, 4, 4); - TEST_FIELD(EXTLOGFONTW, DWORD, elfMatch, 292, 4, 4); - TEST_FIELD(EXTLOGFONTW, DWORD, elfReserved, 296, 4, 4); - TEST_FIELD(EXTLOGFONTW, BYTE[ELF_VENDOR_SIZE], elfVendorId, 300, 4, 1); - TEST_FIELD(EXTLOGFONTW, DWORD, elfCulture, 304, 4, 4); - TEST_FIELD(EXTLOGFONTW, PANOSE, elfPanose, 308, 10, 1); -} - -static void test_pack_EXTLOGPEN(void) -{ - /* EXTLOGPEN (pack 4) */ - TEST_TYPE(EXTLOGPEN, 28, 4); - TEST_FIELD(EXTLOGPEN, DWORD, elpPenStyle, 0, 4, 4); - TEST_FIELD(EXTLOGPEN, DWORD, elpWidth, 4, 4, 4); - TEST_FIELD(EXTLOGPEN, UINT, elpBrushStyle, 8, 4, 4); - TEST_FIELD(EXTLOGPEN, COLORREF, elpColor, 12, 4, 4); - TEST_FIELD(EXTLOGPEN, ULONG_PTR, elpHatch, 16, 4, 4); - TEST_FIELD(EXTLOGPEN, DWORD, elpNumEntries, 20, 4, 4); - TEST_FIELD(EXTLOGPEN, DWORD[1], elpStyleEntry, 24, 4, 4); -} - -static void test_pack_FIXED(void) -{ - /* FIXED (pack 4) */ - TEST_TYPE(FIXED, 4, 2); - TEST_FIELD(FIXED, WORD, fract, 0, 2, 2); - TEST_FIELD(FIXED, SHORT, value, 2, 2, 2); -} - -static void test_pack_FONTENUMPROCA(void) -{ - /* FONTENUMPROCA */ - TEST_TYPE(FONTENUMPROCA, 4, 4); -} - -static void test_pack_FONTENUMPROCW(void) -{ - /* FONTENUMPROCW */ - TEST_TYPE(FONTENUMPROCW, 4, 4); -} - -static void test_pack_FONTSIGNATURE(void) -{ - /* FONTSIGNATURE (pack 4) */ - TEST_TYPE(FONTSIGNATURE, 24, 4); - TEST_FIELD(FONTSIGNATURE, DWORD[4], fsUsb, 0, 16, 4); - TEST_FIELD(FONTSIGNATURE, DWORD[2], fsCsb, 16, 8, 4); -} - -static void test_pack_FXPT16DOT16(void) -{ - /* FXPT16DOT16 */ - TEST_TYPE(FXPT16DOT16, 4, 4); -} - -static void test_pack_FXPT2DOT30(void) -{ - /* FXPT2DOT30 */ - TEST_TYPE(FXPT2DOT30, 4, 4); -} - -static void test_pack_GCP_RESULTSA(void) -{ - /* GCP_RESULTSA (pack 4) */ - TEST_TYPE(GCP_RESULTSA, 36, 4); - TEST_FIELD(GCP_RESULTSA, DWORD, lStructSize, 0, 4, 4); - TEST_FIELD(GCP_RESULTSA, LPSTR, lpOutString, 4, 4, 4); - TEST_FIELD(GCP_RESULTSA, UINT *, lpOrder, 8, 4, 4); - TEST_FIELD(GCP_RESULTSA, INT *, lpDx, 12, 4, 4); - TEST_FIELD(GCP_RESULTSA, INT *, lpCaretPos, 16, 4, 4); - TEST_FIELD(GCP_RESULTSA, LPSTR, lpClass, 20, 4, 4); - TEST_FIELD(GCP_RESULTSA, LPWSTR, lpGlyphs, 24, 4, 4); - TEST_FIELD(GCP_RESULTSA, UINT, nGlyphs, 28, 4, 4); - TEST_FIELD(GCP_RESULTSA, UINT, nMaxFit, 32, 4, 4); -} - -static void test_pack_GCP_RESULTSW(void) -{ - /* GCP_RESULTSW (pack 4) */ - TEST_TYPE(GCP_RESULTSW, 36, 4); - TEST_FIELD(GCP_RESULTSW, DWORD, lStructSize, 0, 4, 4); - TEST_FIELD(GCP_RESULTSW, LPWSTR, lpOutString, 4, 4, 4); - TEST_FIELD(GCP_RESULTSW, UINT *, lpOrder, 8, 4, 4); - TEST_FIELD(GCP_RESULTSW, INT *, lpDx, 12, 4, 4); - TEST_FIELD(GCP_RESULTSW, INT *, lpCaretPos, 16, 4, 4); - TEST_FIELD(GCP_RESULTSW, LPSTR, lpClass, 20, 4, 4); - TEST_FIELD(GCP_RESULTSW, LPWSTR, lpGlyphs, 24, 4, 4); - TEST_FIELD(GCP_RESULTSW, UINT, nGlyphs, 28, 4, 4); - TEST_FIELD(GCP_RESULTSW, UINT, nMaxFit, 32, 4, 4); -} - -static void test_pack_GLYPHMETRICS(void) -{ - /* GLYPHMETRICS (pack 4) */ - TEST_TYPE(GLYPHMETRICS, 20, 4); - TEST_FIELD(GLYPHMETRICS, UINT, gmBlackBoxX, 0, 4, 4); - TEST_FIELD(GLYPHMETRICS, UINT, gmBlackBoxY, 4, 4, 4); - TEST_FIELD(GLYPHMETRICS, POINT, gmptGlyphOrigin, 8, 8, 4); - TEST_FIELD(GLYPHMETRICS, SHORT, gmCellIncX, 16, 2, 2); - TEST_FIELD(GLYPHMETRICS, SHORT, gmCellIncY, 18, 2, 2); -} - -static void test_pack_GLYPHMETRICSFLOAT(void) -{ - /* GLYPHMETRICSFLOAT (pack 4) */ - TEST_TYPE(GLYPHMETRICSFLOAT, 24, 4); - TEST_FIELD(GLYPHMETRICSFLOAT, FLOAT, gmfBlackBoxX, 0, 4, 4); - TEST_FIELD(GLYPHMETRICSFLOAT, FLOAT, gmfBlackBoxY, 4, 4, 4); - TEST_FIELD(GLYPHMETRICSFLOAT, POINTFLOAT, gmfptGlyphOrigin, 8, 8, 4); - TEST_FIELD(GLYPHMETRICSFLOAT, FLOAT, gmfCellIncX, 16, 4, 4); - TEST_FIELD(GLYPHMETRICSFLOAT, FLOAT, gmfCellIncY, 20, 4, 4); -} - -static void test_pack_GOBJENUMPROC(void) -{ - /* GOBJENUMPROC */ - TEST_TYPE(GOBJENUMPROC, 4, 4); -} - -static void test_pack_GRADIENT_RECT(void) -{ - /* GRADIENT_RECT (pack 4) */ - TEST_TYPE(GRADIENT_RECT, 8, 4); - TEST_FIELD(GRADIENT_RECT, ULONG, UpperLeft, 0, 4, 4); - TEST_FIELD(GRADIENT_RECT, ULONG, LowerRight, 4, 4, 4); -} - -static void test_pack_GRADIENT_TRIANGLE(void) -{ - /* GRADIENT_TRIANGLE (pack 4) */ - TEST_TYPE(GRADIENT_TRIANGLE, 12, 4); - TEST_FIELD(GRADIENT_TRIANGLE, ULONG, Vertex1, 0, 4, 4); - TEST_FIELD(GRADIENT_TRIANGLE, ULONG, Vertex2, 4, 4, 4); - TEST_FIELD(GRADIENT_TRIANGLE, ULONG, Vertex3, 8, 4, 4); -} - -static void test_pack_HANDLETABLE(void) -{ - /* HANDLETABLE (pack 4) */ - TEST_TYPE(HANDLETABLE, 4, 4); - TEST_FIELD(HANDLETABLE, HGDIOBJ[1], objectHandle, 0, 4, 4); -} - -static void test_pack_ICMENUMPROCA(void) -{ - /* ICMENUMPROCA */ - TEST_TYPE(ICMENUMPROCA, 4, 4); -} - -static void test_pack_ICMENUMPROCW(void) -{ - /* ICMENUMPROCW */ - TEST_TYPE(ICMENUMPROCW, 4, 4); -} - -static void test_pack_KERNINGPAIR(void) -{ - /* KERNINGPAIR (pack 4) */ - TEST_TYPE(KERNINGPAIR, 8, 4); - TEST_FIELD(KERNINGPAIR, WORD, wFirst, 0, 2, 2); - TEST_FIELD(KERNINGPAIR, WORD, wSecond, 2, 2, 2); - TEST_FIELD(KERNINGPAIR, INT, iKernAmount, 4, 4, 4); -} - -static void test_pack_LAYERPLANEDESCRIPTOR(void) -{ - /* LAYERPLANEDESCRIPTOR (pack 4) */ - TEST_TYPE(LAYERPLANEDESCRIPTOR, 32, 4); - TEST_FIELD(LAYERPLANEDESCRIPTOR, WORD, nSize, 0, 2, 2); - TEST_FIELD(LAYERPLANEDESCRIPTOR, WORD, nVersion, 2, 2, 2); - TEST_FIELD(LAYERPLANEDESCRIPTOR, DWORD, dwFlags, 4, 4, 4); - TEST_FIELD(LAYERPLANEDESCRIPTOR, BYTE, iPixelType, 8, 1, 1); - TEST_FIELD(LAYERPLANEDESCRIPTOR, BYTE, cColorBits, 9, 1, 1); - TEST_FIELD(LAYERPLANEDESCRIPTOR, BYTE, cRedBits, 10, 1, 1); - TEST_FIELD(LAYERPLANEDESCRIPTOR, BYTE, cRedShift, 11, 1, 1); - TEST_FIELD(LAYERPLANEDESCRIPTOR, BYTE, cGreenBits, 12, 1, 1); - TEST_FIELD(LAYERPLANEDESCRIPTOR, BYTE, cGreenShift, 13, 1, 1); - TEST_FIELD(LAYERPLANEDESCRIPTOR, BYTE, cBlueBits, 14, 1, 1); - TEST_FIELD(LAYERPLANEDESCRIPTOR, BYTE, cBlueShift, 15, 1, 1); - TEST_FIELD(LAYERPLANEDESCRIPTOR, BYTE, cAlphaBits, 16, 1, 1); - TEST_FIELD(LAYERPLANEDESCRIPTOR, BYTE, cAlphaShift, 17, 1, 1); - TEST_FIELD(LAYERPLANEDESCRIPTOR, BYTE, cAccumBits, 18, 1, 1); - TEST_FIELD(LAYERPLANEDESCRIPTOR, BYTE, cAccumRedBits, 19, 1, 1); - TEST_FIELD(LAYERPLANEDESCRIPTOR, BYTE, cAccumGreenBits, 20, 1, 1); - TEST_FIELD(LAYERPLANEDESCRIPTOR, BYTE, cAccumBlueBits, 21, 1, 1); - TEST_FIELD(LAYERPLANEDESCRIPTOR, BYTE, cAccumAlphaBits, 22, 1, 1); - TEST_FIELD(LAYERPLANEDESCRIPTOR, BYTE, cDepthBits, 23, 1, 1); - TEST_FIELD(LAYERPLANEDESCRIPTOR, BYTE, cStencilBits, 24, 1, 1); - TEST_FIELD(LAYERPLANEDESCRIPTOR, BYTE, cAuxBuffers, 25, 1, 1); - TEST_FIELD(LAYERPLANEDESCRIPTOR, BYTE, iLayerPlane, 26, 1, 1); - TEST_FIELD(LAYERPLANEDESCRIPTOR, BYTE, bReserved, 27, 1, 1); - TEST_FIELD(LAYERPLANEDESCRIPTOR, COLORREF, crTransparent, 28, 4, 4); -} - -static void test_pack_LCSCSTYPE(void) -{ - /* LCSCSTYPE */ - TEST_TYPE(LCSCSTYPE, 4, 4); -} - -static void test_pack_LCSGAMUTMATCH(void) -{ - /* LCSGAMUTMATCH */ - TEST_TYPE(LCSGAMUTMATCH, 4, 4); -} - -static void test_pack_LINEDDAPROC(void) -{ - /* LINEDDAPROC */ - TEST_TYPE(LINEDDAPROC, 4, 4); -} - -static void test_pack_LOCALESIGNATURE(void) -{ - /* LOCALESIGNATURE (pack 4) */ - TEST_TYPE(LOCALESIGNATURE, 32, 4); - TEST_FIELD(LOCALESIGNATURE, DWORD[4], lsUsb, 0, 16, 4); - TEST_FIELD(LOCALESIGNATURE, DWORD[2], lsCsbDefault, 16, 8, 4); - TEST_FIELD(LOCALESIGNATURE, DWORD[2], lsCsbSupported, 24, 8, 4); -} - -static void test_pack_LOGBRUSH(void) -{ - /* LOGBRUSH (pack 4) */ - TEST_TYPE(LOGBRUSH, 12, 4); - TEST_FIELD(LOGBRUSH, UINT, lbStyle, 0, 4, 4); - TEST_FIELD(LOGBRUSH, COLORREF, lbColor, 4, 4, 4); - TEST_FIELD(LOGBRUSH, ULONG_PTR, lbHatch, 8, 4, 4); -} - -static void test_pack_LOGCOLORSPACEA(void) -{ - /* LOGCOLORSPACEA (pack 4) */ - TEST_TYPE(LOGCOLORSPACEA, 328, 4); - TEST_FIELD(LOGCOLORSPACEA, DWORD, lcsSignature, 0, 4, 4); - TEST_FIELD(LOGCOLORSPACEA, DWORD, lcsVersion, 4, 4, 4); - TEST_FIELD(LOGCOLORSPACEA, DWORD, lcsSize, 8, 4, 4); - TEST_FIELD(LOGCOLORSPACEA, LCSCSTYPE, lcsCSType, 12, 4, 4); - TEST_FIELD(LOGCOLORSPACEA, LCSGAMUTMATCH, lcsIntent, 16, 4, 4); - TEST_FIELD(LOGCOLORSPACEA, CIEXYZTRIPLE, lcsEndpoints, 20, 36, 4); - TEST_FIELD(LOGCOLORSPACEA, DWORD, lcsGammaRed, 56, 4, 4); - TEST_FIELD(LOGCOLORSPACEA, DWORD, lcsGammaGreen, 60, 4, 4); - TEST_FIELD(LOGCOLORSPACEA, DWORD, lcsGammaBlue, 64, 4, 4); - TEST_FIELD(LOGCOLORSPACEA, CHAR[MAX_PATH], lcsFilename, 68, 260, 1); -} - -static void test_pack_LOGCOLORSPACEW(void) -{ - /* LOGCOLORSPACEW (pack 4) */ - TEST_TYPE(LOGCOLORSPACEW, 588, 4); - TEST_FIELD(LOGCOLORSPACEW, DWORD, lcsSignature, 0, 4, 4); - TEST_FIELD(LOGCOLORSPACEW, DWORD, lcsVersion, 4, 4, 4); - TEST_FIELD(LOGCOLORSPACEW, DWORD, lcsSize, 8, 4, 4); - TEST_FIELD(LOGCOLORSPACEW, LCSCSTYPE, lcsCSType, 12, 4, 4); - TEST_FIELD(LOGCOLORSPACEW, LCSGAMUTMATCH, lcsIntent, 16, 4, 4); - TEST_FIELD(LOGCOLORSPACEW, CIEXYZTRIPLE, lcsEndpoints, 20, 36, 4); - TEST_FIELD(LOGCOLORSPACEW, DWORD, lcsGammaRed, 56, 4, 4); - TEST_FIELD(LOGCOLORSPACEW, DWORD, lcsGammaGreen, 60, 4, 4); - TEST_FIELD(LOGCOLORSPACEW, DWORD, lcsGammaBlue, 64, 4, 4); - TEST_FIELD(LOGCOLORSPACEW, WCHAR[MAX_PATH], lcsFilename, 68, 520, 2); -} - -static void test_pack_LOGFONTA(void) -{ - /* LOGFONTA (pack 4) */ - TEST_TYPE(LOGFONTA, 60, 4); - TEST_FIELD(LOGFONTA, LONG, lfHeight, 0, 4, 4); - TEST_FIELD(LOGFONTA, LONG, lfWidth, 4, 4, 4); - TEST_FIELD(LOGFONTA, LONG, lfEscapement, 8, 4, 4); - TEST_FIELD(LOGFONTA, LONG, lfOrientation, 12, 4, 4); - TEST_FIELD(LOGFONTA, LONG, lfWeight, 16, 4, 4); - TEST_FIELD(LOGFONTA, BYTE, lfItalic, 20, 1, 1); - TEST_FIELD(LOGFONTA, BYTE, lfUnderline, 21, 1, 1); - TEST_FIELD(LOGFONTA, BYTE, lfStrikeOut, 22, 1, 1); - TEST_FIELD(LOGFONTA, BYTE, lfCharSet, 23, 1, 1); - TEST_FIELD(LOGFONTA, BYTE, lfOutPrecision, 24, 1, 1); - TEST_FIELD(LOGFONTA, BYTE, lfClipPrecision, 25, 1, 1); - TEST_FIELD(LOGFONTA, BYTE, lfQuality, 26, 1, 1); - TEST_FIELD(LOGFONTA, BYTE, lfPitchAndFamily, 27, 1, 1); - TEST_FIELD(LOGFONTA, CHAR[LF_FACESIZE], lfFaceName, 28, 32, 1); -} - -static void test_pack_LOGFONTW(void) -{ - /* LOGFONTW (pack 4) */ - TEST_TYPE(LOGFONTW, 92, 4); - TEST_FIELD(LOGFONTW, LONG, lfHeight, 0, 4, 4); - TEST_FIELD(LOGFONTW, LONG, lfWidth, 4, 4, 4); - TEST_FIELD(LOGFONTW, LONG, lfEscapement, 8, 4, 4); - TEST_FIELD(LOGFONTW, LONG, lfOrientation, 12, 4, 4); - TEST_FIELD(LOGFONTW, LONG, lfWeight, 16, 4, 4); - TEST_FIELD(LOGFONTW, BYTE, lfItalic, 20, 1, 1); - TEST_FIELD(LOGFONTW, BYTE, lfUnderline, 21, 1, 1); - TEST_FIELD(LOGFONTW, BYTE, lfStrikeOut, 22, 1, 1); - TEST_FIELD(LOGFONTW, BYTE, lfCharSet, 23, 1, 1); - TEST_FIELD(LOGFONTW, BYTE, lfOutPrecision, 24, 1, 1); - TEST_FIELD(LOGFONTW, BYTE, lfClipPrecision, 25, 1, 1); - TEST_FIELD(LOGFONTW, BYTE, lfQuality, 26, 1, 1); - TEST_FIELD(LOGFONTW, BYTE, lfPitchAndFamily, 27, 1, 1); - TEST_FIELD(LOGFONTW, WCHAR[LF_FACESIZE], lfFaceName, 28, 64, 2); -} - -static void test_pack_LOGPEN(void) -{ - /* LOGPEN (pack 4) */ - TEST_TYPE(LOGPEN, 16, 4); - TEST_FIELD(LOGPEN, UINT, lopnStyle, 0, 4, 4); - TEST_FIELD(LOGPEN, POINT, lopnWidth, 4, 8, 4); - TEST_FIELD(LOGPEN, COLORREF, lopnColor, 12, 4, 4); -} - -static void test_pack_LPABC(void) -{ - /* LPABC */ - TEST_TYPE(LPABC, 4, 4); - TEST_TYPE_POINTER(LPABC, 12, 4); -} - -static void test_pack_LPABCFLOAT(void) -{ - /* LPABCFLOAT */ - TEST_TYPE(LPABCFLOAT, 4, 4); - TEST_TYPE_POINTER(LPABCFLOAT, 12, 4); -} - -static void test_pack_LPBITMAP(void) -{ - /* LPBITMAP */ - TEST_TYPE(LPBITMAP, 4, 4); - TEST_TYPE_POINTER(LPBITMAP, 24, 4); -} - -static void test_pack_LPBITMAPCOREHEADER(void) -{ - /* LPBITMAPCOREHEADER */ - TEST_TYPE(LPBITMAPCOREHEADER, 4, 4); - TEST_TYPE_POINTER(LPBITMAPCOREHEADER, 12, 4); -} - -static void test_pack_LPBITMAPCOREINFO(void) -{ - /* LPBITMAPCOREINFO */ - TEST_TYPE(LPBITMAPCOREINFO, 4, 4); - TEST_TYPE_POINTER(LPBITMAPCOREINFO, 16, 4); -} - -static void test_pack_LPBITMAPFILEHEADER(void) -{ - /* LPBITMAPFILEHEADER */ - TEST_TYPE(LPBITMAPFILEHEADER, 4, 4); - TEST_TYPE_POINTER(LPBITMAPFILEHEADER, 14, 2); -} - -static void test_pack_LPBITMAPINFO(void) -{ - /* LPBITMAPINFO */ - TEST_TYPE(LPBITMAPINFO, 4, 4); - TEST_TYPE_POINTER(LPBITMAPINFO, 44, 4); -} - -static void test_pack_LPBITMAPINFOHEADER(void) -{ - /* LPBITMAPINFOHEADER */ - TEST_TYPE(LPBITMAPINFOHEADER, 4, 4); - TEST_TYPE_POINTER(LPBITMAPINFOHEADER, 40, 4); -} - -static void test_pack_LPBITMAPV5HEADER(void) -{ - /* LPBITMAPV5HEADER */ - TEST_TYPE(LPBITMAPV5HEADER, 4, 4); - TEST_TYPE_POINTER(LPBITMAPV5HEADER, 124, 4); -} - -static void test_pack_LPCHARSETINFO(void) -{ - /* LPCHARSETINFO */ - TEST_TYPE(LPCHARSETINFO, 4, 4); - TEST_TYPE_POINTER(LPCHARSETINFO, 32, 4); -} - -static void test_pack_LPCIEXYZ(void) -{ - /* LPCIEXYZ */ - TEST_TYPE(LPCIEXYZ, 4, 4); - TEST_TYPE_POINTER(LPCIEXYZ, 12, 4); -} - -static void test_pack_LPCIEXYZTRIPLE(void) -{ - /* LPCIEXYZTRIPLE */ - TEST_TYPE(LPCIEXYZTRIPLE, 4, 4); - TEST_TYPE_POINTER(LPCIEXYZTRIPLE, 36, 4); -} - -static void test_pack_LPCOLORADJUSTMENT(void) -{ - /* LPCOLORADJUSTMENT */ - TEST_TYPE(LPCOLORADJUSTMENT, 4, 4); - TEST_TYPE_POINTER(LPCOLORADJUSTMENT, 24, 2); -} - -static void test_pack_LPDEVMODEA(void) -{ - /* LPDEVMODEA */ - TEST_TYPE(LPDEVMODEA, 4, 4); -} - -static void test_pack_LPDEVMODEW(void) -{ - /* LPDEVMODEW */ - TEST_TYPE(LPDEVMODEW, 4, 4); -} - -static void test_pack_LPDIBSECTION(void) -{ - /* LPDIBSECTION */ - TEST_TYPE(LPDIBSECTION, 4, 4); - TEST_TYPE_POINTER(LPDIBSECTION, 84, 4); -} - -static void test_pack_LPDISPLAY_DEVICEA(void) -{ - /* LPDISPLAY_DEVICEA */ - TEST_TYPE(LPDISPLAY_DEVICEA, 4, 4); - TEST_TYPE_POINTER(LPDISPLAY_DEVICEA, 424, 4); -} - -static void test_pack_LPDISPLAY_DEVICEW(void) -{ - /* LPDISPLAY_DEVICEW */ - TEST_TYPE(LPDISPLAY_DEVICEW, 4, 4); - TEST_TYPE_POINTER(LPDISPLAY_DEVICEW, 840, 4); -} - -static void test_pack_LPDOCINFOA(void) -{ - /* LPDOCINFOA */ - TEST_TYPE(LPDOCINFOA, 4, 4); - TEST_TYPE_POINTER(LPDOCINFOA, 20, 4); -} - -static void test_pack_LPDOCINFOW(void) -{ - /* LPDOCINFOW */ - TEST_TYPE(LPDOCINFOW, 4, 4); - TEST_TYPE_POINTER(LPDOCINFOW, 20, 4); -} - -static void test_pack_LPENHMETAHEADER(void) -{ - /* LPENHMETAHEADER */ - TEST_TYPE(LPENHMETAHEADER, 4, 4); - TEST_TYPE_POINTER(LPENHMETAHEADER, 108, 4); -} - -static void test_pack_LPENHMETARECORD(void) -{ - /* LPENHMETARECORD */ - TEST_TYPE(LPENHMETARECORD, 4, 4); - TEST_TYPE_POINTER(LPENHMETARECORD, 12, 4); -} - -static void test_pack_LPENUMLOGFONTA(void) -{ - /* LPENUMLOGFONTA */ - TEST_TYPE(LPENUMLOGFONTA, 4, 4); - TEST_TYPE_POINTER(LPENUMLOGFONTA, 156, 4); -} - -static void test_pack_LPENUMLOGFONTEXA(void) -{ - /* LPENUMLOGFONTEXA */ - TEST_TYPE(LPENUMLOGFONTEXA, 4, 4); - TEST_TYPE_POINTER(LPENUMLOGFONTEXA, 188, 4); -} - -static void test_pack_LPENUMLOGFONTEXW(void) -{ - /* LPENUMLOGFONTEXW */ - TEST_TYPE(LPENUMLOGFONTEXW, 4, 4); - TEST_TYPE_POINTER(LPENUMLOGFONTEXW, 348, 4); -} - -static void test_pack_LPENUMLOGFONTW(void) -{ - /* LPENUMLOGFONTW */ - TEST_TYPE(LPENUMLOGFONTW, 4, 4); - TEST_TYPE_POINTER(LPENUMLOGFONTW, 284, 4); -} - -static void test_pack_LPEXTLOGFONTA(void) -{ - /* LPEXTLOGFONTA */ - TEST_TYPE(LPEXTLOGFONTA, 4, 4); - TEST_TYPE_POINTER(LPEXTLOGFONTA, 192, 4); -} - -static void test_pack_LPEXTLOGFONTW(void) -{ - /* LPEXTLOGFONTW */ - TEST_TYPE(LPEXTLOGFONTW, 4, 4); - TEST_TYPE_POINTER(LPEXTLOGFONTW, 320, 4); -} - -static void test_pack_LPEXTLOGPEN(void) -{ - /* LPEXTLOGPEN */ - TEST_TYPE(LPEXTLOGPEN, 4, 4); - TEST_TYPE_POINTER(LPEXTLOGPEN, 28, 4); -} - -static void test_pack_LPFONTSIGNATURE(void) -{ - /* LPFONTSIGNATURE */ - TEST_TYPE(LPFONTSIGNATURE, 4, 4); - TEST_TYPE_POINTER(LPFONTSIGNATURE, 24, 4); -} - -static void test_pack_LPGCP_RESULTSA(void) -{ - /* LPGCP_RESULTSA */ - TEST_TYPE(LPGCP_RESULTSA, 4, 4); - TEST_TYPE_POINTER(LPGCP_RESULTSA, 36, 4); -} - -static void test_pack_LPGCP_RESULTSW(void) -{ - /* LPGCP_RESULTSW */ - TEST_TYPE(LPGCP_RESULTSW, 4, 4); - TEST_TYPE_POINTER(LPGCP_RESULTSW, 36, 4); -} - -static void test_pack_LPGLYPHMETRICS(void) -{ - /* LPGLYPHMETRICS */ - TEST_TYPE(LPGLYPHMETRICS, 4, 4); - TEST_TYPE_POINTER(LPGLYPHMETRICS, 20, 4); -} - -static void test_pack_LPGLYPHMETRICSFLOAT(void) -{ - /* LPGLYPHMETRICSFLOAT */ - TEST_TYPE(LPGLYPHMETRICSFLOAT, 4, 4); - TEST_TYPE_POINTER(LPGLYPHMETRICSFLOAT, 24, 4); -} - -static void test_pack_LPGRADIENT_RECT(void) -{ - /* LPGRADIENT_RECT */ - TEST_TYPE(LPGRADIENT_RECT, 4, 4); - TEST_TYPE_POINTER(LPGRADIENT_RECT, 8, 4); -} - -static void test_pack_LPGRADIENT_TRIANGLE(void) -{ - /* LPGRADIENT_TRIANGLE */ - TEST_TYPE(LPGRADIENT_TRIANGLE, 4, 4); - TEST_TYPE_POINTER(LPGRADIENT_TRIANGLE, 12, 4); -} - -static void test_pack_LPHANDLETABLE(void) -{ - /* LPHANDLETABLE */ - TEST_TYPE(LPHANDLETABLE, 4, 4); - TEST_TYPE_POINTER(LPHANDLETABLE, 4, 4); -} - -static void test_pack_LPKERNINGPAIR(void) -{ - /* LPKERNINGPAIR */ - TEST_TYPE(LPKERNINGPAIR, 4, 4); - TEST_TYPE_POINTER(LPKERNINGPAIR, 8, 4); -} - -static void test_pack_LPLAYERPLANEDESCRIPTOR(void) -{ - /* LPLAYERPLANEDESCRIPTOR */ - TEST_TYPE(LPLAYERPLANEDESCRIPTOR, 4, 4); - TEST_TYPE_POINTER(LPLAYERPLANEDESCRIPTOR, 32, 4); -} - -static void test_pack_LPLOCALESIGNATURE(void) -{ - /* LPLOCALESIGNATURE */ - TEST_TYPE(LPLOCALESIGNATURE, 4, 4); - TEST_TYPE_POINTER(LPLOCALESIGNATURE, 32, 4); -} - -static void test_pack_LPLOGBRUSH(void) -{ - /* LPLOGBRUSH */ - TEST_TYPE(LPLOGBRUSH, 4, 4); - TEST_TYPE_POINTER(LPLOGBRUSH, 12, 4); -} - -static void test_pack_LPLOGCOLORSPACEA(void) -{ - /* LPLOGCOLORSPACEA */ - TEST_TYPE(LPLOGCOLORSPACEA, 4, 4); - TEST_TYPE_POINTER(LPLOGCOLORSPACEA, 328, 4); -} - -static void test_pack_LPLOGCOLORSPACEW(void) -{ - /* LPLOGCOLORSPACEW */ - TEST_TYPE(LPLOGCOLORSPACEW, 4, 4); - TEST_TYPE_POINTER(LPLOGCOLORSPACEW, 588, 4); -} - -static void test_pack_LPLOGFONTA(void) -{ - /* LPLOGFONTA */ - TEST_TYPE(LPLOGFONTA, 4, 4); - TEST_TYPE_POINTER(LPLOGFONTA, 60, 4); -} - -static void test_pack_LPLOGFONTW(void) -{ - /* LPLOGFONTW */ - TEST_TYPE(LPLOGFONTW, 4, 4); - TEST_TYPE_POINTER(LPLOGFONTW, 92, 4); -} - -static void test_pack_LPLOGPEN(void) -{ - /* LPLOGPEN */ - TEST_TYPE(LPLOGPEN, 4, 4); - TEST_TYPE_POINTER(LPLOGPEN, 16, 4); -} - -static void test_pack_LPMAT2(void) -{ - /* LPMAT2 */ - TEST_TYPE(LPMAT2, 4, 4); - TEST_TYPE_POINTER(LPMAT2, 16, 2); -} - -static void test_pack_LPMETAFILEPICT(void) -{ - /* LPMETAFILEPICT */ - TEST_TYPE(LPMETAFILEPICT, 4, 4); - TEST_TYPE_POINTER(LPMETAFILEPICT, 16, 4); -} - -static void test_pack_LPMETAHEADER(void) -{ - /* LPMETAHEADER */ - TEST_TYPE(LPMETAHEADER, 4, 4); - TEST_TYPE_POINTER(LPMETAHEADER, 18, 2); -} - -static void test_pack_LPMETARECORD(void) -{ - /* LPMETARECORD */ - TEST_TYPE(LPMETARECORD, 4, 4); - TEST_TYPE_POINTER(LPMETARECORD, 8, 4); -} - -static void test_pack_LPNEWTEXTMETRICA(void) -{ - /* LPNEWTEXTMETRICA */ - TEST_TYPE(LPNEWTEXTMETRICA, 4, 4); - TEST_TYPE_POINTER(LPNEWTEXTMETRICA, 72, 4); -} - -static void test_pack_LPNEWTEXTMETRICW(void) -{ - /* LPNEWTEXTMETRICW */ - TEST_TYPE(LPNEWTEXTMETRICW, 4, 4); - TEST_TYPE_POINTER(LPNEWTEXTMETRICW, 76, 4); -} - -static void test_pack_LPOUTLINETEXTMETRICA(void) -{ - /* LPOUTLINETEXTMETRICA */ - TEST_TYPE(LPOUTLINETEXTMETRICA, 4, 4); - TEST_TYPE_POINTER(LPOUTLINETEXTMETRICA, 212, 4); -} - -static void test_pack_LPOUTLINETEXTMETRICW(void) -{ - /* LPOUTLINETEXTMETRICW */ - TEST_TYPE(LPOUTLINETEXTMETRICW, 4, 4); - TEST_TYPE_POINTER(LPOUTLINETEXTMETRICW, 216, 4); -} - -static void test_pack_LPPANOSE(void) -{ - /* LPPANOSE */ - TEST_TYPE(LPPANOSE, 4, 4); - TEST_TYPE_POINTER(LPPANOSE, 10, 1); -} - -static void test_pack_LPPELARRAY(void) -{ - /* LPPELARRAY */ - TEST_TYPE(LPPELARRAY, 4, 4); - TEST_TYPE_POINTER(LPPELARRAY, 20, 4); -} - -static void test_pack_LPPIXELFORMATDESCRIPTOR(void) -{ - /* LPPIXELFORMATDESCRIPTOR */ - TEST_TYPE(LPPIXELFORMATDESCRIPTOR, 4, 4); - TEST_TYPE_POINTER(LPPIXELFORMATDESCRIPTOR, 40, 4); -} - -static void test_pack_LPPOINTFX(void) -{ - /* LPPOINTFX */ - TEST_TYPE(LPPOINTFX, 4, 4); - TEST_TYPE_POINTER(LPPOINTFX, 8, 2); -} - -static void test_pack_LPPOLYTEXTA(void) -{ - /* LPPOLYTEXTA */ - TEST_TYPE(LPPOLYTEXTA, 4, 4); - TEST_TYPE_POINTER(LPPOLYTEXTA, 40, 4); -} - -static void test_pack_LPPOLYTEXTW(void) -{ - /* LPPOLYTEXTW */ - TEST_TYPE(LPPOLYTEXTW, 4, 4); - TEST_TYPE_POINTER(LPPOLYTEXTW, 40, 4); -} - -static void test_pack_LPRASTERIZER_STATUS(void) -{ - /* LPRASTERIZER_STATUS */ - TEST_TYPE(LPRASTERIZER_STATUS, 4, 4); - TEST_TYPE_POINTER(LPRASTERIZER_STATUS, 6, 2); -} - -static void test_pack_LPRGBQUAD(void) -{ - /* LPRGBQUAD */ - TEST_TYPE(LPRGBQUAD, 4, 4); - TEST_TYPE_POINTER(LPRGBQUAD, 4, 1); -} - -static void test_pack_LPRGNDATA(void) -{ - /* LPRGNDATA */ - TEST_TYPE(LPRGNDATA, 4, 4); - TEST_TYPE_POINTER(LPRGNDATA, 36, 4); -} - -static void test_pack_LPTEXTMETRICA(void) -{ - /* LPTEXTMETRICA */ - TEST_TYPE(LPTEXTMETRICA, 4, 4); - TEST_TYPE_POINTER(LPTEXTMETRICA, 56, 4); -} - -static void test_pack_LPTEXTMETRICW(void) -{ - /* LPTEXTMETRICW */ - TEST_TYPE(LPTEXTMETRICW, 4, 4); - TEST_TYPE_POINTER(LPTEXTMETRICW, 60, 4); -} - -static void test_pack_LPTRIVERTEX(void) -{ - /* LPTRIVERTEX */ - TEST_TYPE(LPTRIVERTEX, 4, 4); - TEST_TYPE_POINTER(LPTRIVERTEX, 16, 4); -} - -static void test_pack_LPTTPOLYCURVE(void) -{ - /* LPTTPOLYCURVE */ - TEST_TYPE(LPTTPOLYCURVE, 4, 4); - TEST_TYPE_POINTER(LPTTPOLYCURVE, 12, 2); -} - -static void test_pack_LPTTPOLYGONHEADER(void) -{ - /* LPTTPOLYGONHEADER */ - TEST_TYPE(LPTTPOLYGONHEADER, 4, 4); - TEST_TYPE_POINTER(LPTTPOLYGONHEADER, 16, 4); -} - -static void test_pack_LPXFORM(void) -{ - /* LPXFORM */ - TEST_TYPE(LPXFORM, 4, 4); - TEST_TYPE_POINTER(LPXFORM, 24, 4); -} - -static void test_pack_MAT2(void) -{ - /* MAT2 (pack 4) */ - TEST_TYPE(MAT2, 16, 2); - TEST_FIELD(MAT2, FIXED, eM11, 0, 4, 2); - TEST_FIELD(MAT2, FIXED, eM12, 4, 4, 2); - TEST_FIELD(MAT2, FIXED, eM21, 8, 4, 2); - TEST_FIELD(MAT2, FIXED, eM22, 12, 4, 2); -} - -static void test_pack_METAFILEPICT(void) -{ - /* METAFILEPICT (pack 4) */ - TEST_TYPE(METAFILEPICT, 16, 4); - TEST_FIELD(METAFILEPICT, LONG, mm, 0, 4, 4); - TEST_FIELD(METAFILEPICT, LONG, xExt, 4, 4, 4); - TEST_FIELD(METAFILEPICT, LONG, yExt, 8, 4, 4); - TEST_FIELD(METAFILEPICT, HMETAFILE, hMF, 12, 4, 4); -} - -static void test_pack_METAHEADER(void) -{ - /* METAHEADER (pack 2) */ - TEST_TYPE(METAHEADER, 18, 2); - TEST_FIELD(METAHEADER, WORD, mtType, 0, 2, 2); - TEST_FIELD(METAHEADER, WORD, mtHeaderSize, 2, 2, 2); - TEST_FIELD(METAHEADER, WORD, mtVersion, 4, 2, 2); - TEST_FIELD(METAHEADER, DWORD, mtSize, 6, 4, 2); - TEST_FIELD(METAHEADER, WORD, mtNoObjects, 10, 2, 2); - TEST_FIELD(METAHEADER, DWORD, mtMaxRecord, 12, 4, 2); - TEST_FIELD(METAHEADER, WORD, mtNoParameters, 16, 2, 2); -} - -static void test_pack_METARECORD(void) -{ - /* METARECORD (pack 4) */ - TEST_TYPE(METARECORD, 8, 4); - TEST_FIELD(METARECORD, DWORD, rdSize, 0, 4, 4); - TEST_FIELD(METARECORD, WORD, rdFunction, 4, 2, 2); - TEST_FIELD(METARECORD, WORD[1], rdParm, 6, 2, 2); -} - -static void test_pack_MFENUMPROC(void) -{ - /* MFENUMPROC */ - TEST_TYPE(MFENUMPROC, 4, 4); -} - -static void test_pack_NEWTEXTMETRICA(void) -{ - /* NEWTEXTMETRICA (pack 4) */ - TEST_TYPE(NEWTEXTMETRICA, 72, 4); - TEST_FIELD(NEWTEXTMETRICA, LONG, tmHeight, 0, 4, 4); - TEST_FIELD(NEWTEXTMETRICA, LONG, tmAscent, 4, 4, 4); - TEST_FIELD(NEWTEXTMETRICA, LONG, tmDescent, 8, 4, 4); - TEST_FIELD(NEWTEXTMETRICA, LONG, tmInternalLeading, 12, 4, 4); - TEST_FIELD(NEWTEXTMETRICA, LONG, tmExternalLeading, 16, 4, 4); - TEST_FIELD(NEWTEXTMETRICA, LONG, tmAveCharWidth, 20, 4, 4); - TEST_FIELD(NEWTEXTMETRICA, LONG, tmMaxCharWidth, 24, 4, 4); - TEST_FIELD(NEWTEXTMETRICA, LONG, tmWeight, 28, 4, 4); - TEST_FIELD(NEWTEXTMETRICA, LONG, tmOverhang, 32, 4, 4); - TEST_FIELD(NEWTEXTMETRICA, LONG, tmDigitizedAspectX, 36, 4, 4); - TEST_FIELD(NEWTEXTMETRICA, LONG, tmDigitizedAspectY, 40, 4, 4); - TEST_FIELD(NEWTEXTMETRICA, BYTE, tmFirstChar, 44, 1, 1); - TEST_FIELD(NEWTEXTMETRICA, BYTE, tmLastChar, 45, 1, 1); - TEST_FIELD(NEWTEXTMETRICA, BYTE, tmDefaultChar, 46, 1, 1); - TEST_FIELD(NEWTEXTMETRICA, BYTE, tmBreakChar, 47, 1, 1); - TEST_FIELD(NEWTEXTMETRICA, BYTE, tmItalic, 48, 1, 1); - TEST_FIELD(NEWTEXTMETRICA, BYTE, tmUnderlined, 49, 1, 1); - TEST_FIELD(NEWTEXTMETRICA, BYTE, tmStruckOut, 50, 1, 1); - TEST_FIELD(NEWTEXTMETRICA, BYTE, tmPitchAndFamily, 51, 1, 1); - TEST_FIELD(NEWTEXTMETRICA, BYTE, tmCharSet, 52, 1, 1); - TEST_FIELD(NEWTEXTMETRICA, DWORD, ntmFlags, 56, 4, 4); - TEST_FIELD(NEWTEXTMETRICA, UINT, ntmSizeEM, 60, 4, 4); - TEST_FIELD(NEWTEXTMETRICA, UINT, ntmCellHeight, 64, 4, 4); - TEST_FIELD(NEWTEXTMETRICA, UINT, ntmAvgWidth, 68, 4, 4); -} - -static void test_pack_NEWTEXTMETRICEXA(void) -{ - /* NEWTEXTMETRICEXA (pack 4) */ - TEST_TYPE(NEWTEXTMETRICEXA, 96, 4); - TEST_FIELD(NEWTEXTMETRICEXA, NEWTEXTMETRICA, ntmTm, 0, 72, 4); - TEST_FIELD(NEWTEXTMETRICEXA, FONTSIGNATURE, ntmFontSig, 72, 24, 4); -} - -static void test_pack_NEWTEXTMETRICEXW(void) -{ - /* NEWTEXTMETRICEXW (pack 4) */ - TEST_TYPE(NEWTEXTMETRICEXW, 100, 4); - TEST_FIELD(NEWTEXTMETRICEXW, NEWTEXTMETRICW, ntmTm, 0, 76, 4); - TEST_FIELD(NEWTEXTMETRICEXW, FONTSIGNATURE, ntmFontSig, 76, 24, 4); -} - -static void test_pack_NEWTEXTMETRICW(void) -{ - /* NEWTEXTMETRICW (pack 4) */ - TEST_TYPE(NEWTEXTMETRICW, 76, 4); - TEST_FIELD(NEWTEXTMETRICW, LONG, tmHeight, 0, 4, 4); - TEST_FIELD(NEWTEXTMETRICW, LONG, tmAscent, 4, 4, 4); - TEST_FIELD(NEWTEXTMETRICW, LONG, tmDescent, 8, 4, 4); - TEST_FIELD(NEWTEXTMETRICW, LONG, tmInternalLeading, 12, 4, 4); - TEST_FIELD(NEWTEXTMETRICW, LONG, tmExternalLeading, 16, 4, 4); - TEST_FIELD(NEWTEXTMETRICW, LONG, tmAveCharWidth, 20, 4, 4); - TEST_FIELD(NEWTEXTMETRICW, LONG, tmMaxCharWidth, 24, 4, 4); - TEST_FIELD(NEWTEXTMETRICW, LONG, tmWeight, 28, 4, 4); - TEST_FIELD(NEWTEXTMETRICW, LONG, tmOverhang, 32, 4, 4); - TEST_FIELD(NEWTEXTMETRICW, LONG, tmDigitizedAspectX, 36, 4, 4); - TEST_FIELD(NEWTEXTMETRICW, LONG, tmDigitizedAspectY, 40, 4, 4); - TEST_FIELD(NEWTEXTMETRICW, WCHAR, tmFirstChar, 44, 2, 2); - TEST_FIELD(NEWTEXTMETRICW, WCHAR, tmLastChar, 46, 2, 2); - TEST_FIELD(NEWTEXTMETRICW, WCHAR, tmDefaultChar, 48, 2, 2); - TEST_FIELD(NEWTEXTMETRICW, WCHAR, tmBreakChar, 50, 2, 2); - TEST_FIELD(NEWTEXTMETRICW, BYTE, tmItalic, 52, 1, 1); - TEST_FIELD(NEWTEXTMETRICW, BYTE, tmUnderlined, 53, 1, 1); - TEST_FIELD(NEWTEXTMETRICW, BYTE, tmStruckOut, 54, 1, 1); - TEST_FIELD(NEWTEXTMETRICW, BYTE, tmPitchAndFamily, 55, 1, 1); - TEST_FIELD(NEWTEXTMETRICW, BYTE, tmCharSet, 56, 1, 1); - TEST_FIELD(NEWTEXTMETRICW, DWORD, ntmFlags, 60, 4, 4); - TEST_FIELD(NEWTEXTMETRICW, UINT, ntmSizeEM, 64, 4, 4); - TEST_FIELD(NEWTEXTMETRICW, UINT, ntmCellHeight, 68, 4, 4); - TEST_FIELD(NEWTEXTMETRICW, UINT, ntmAvgWidth, 72, 4, 4); -} - -static void test_pack_NPEXTLOGPEN(void) -{ - /* NPEXTLOGPEN */ - TEST_TYPE(NPEXTLOGPEN, 4, 4); - TEST_TYPE_POINTER(NPEXTLOGPEN, 28, 4); -} - -static void test_pack_OLDFONTENUMPROC(void) -{ - /* OLDFONTENUMPROC */ - TEST_TYPE(OLDFONTENUMPROC, 4, 4); -} - -static void test_pack_OLDFONTENUMPROCA(void) -{ - /* OLDFONTENUMPROCA */ - TEST_TYPE(OLDFONTENUMPROCA, 4, 4); -} - -static void test_pack_OLDFONTENUMPROCW(void) -{ - /* OLDFONTENUMPROCW */ - TEST_TYPE(OLDFONTENUMPROCW, 4, 4); -} - -static void test_pack_OUTLINETEXTMETRICA(void) -{ - /* OUTLINETEXTMETRICA (pack 4) */ - TEST_TYPE(OUTLINETEXTMETRICA, 212, 4); - TEST_FIELD(OUTLINETEXTMETRICA, UINT, otmSize, 0, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICA, TEXTMETRICA, otmTextMetrics, 4, 56, 4); - TEST_FIELD(OUTLINETEXTMETRICA, BYTE, otmFiller, 60, 1, 1); - TEST_FIELD(OUTLINETEXTMETRICA, PANOSE, otmPanoseNumber, 61, 10, 1); - TEST_FIELD(OUTLINETEXTMETRICA, UINT, otmfsSelection, 72, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICA, UINT, otmfsType, 76, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICA, INT, otmsCharSlopeRise, 80, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICA, INT, otmsCharSlopeRun, 84, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICA, INT, otmItalicAngle, 88, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICA, UINT, otmEMSquare, 92, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICA, INT, otmAscent, 96, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICA, INT, otmDescent, 100, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICA, UINT, otmLineGap, 104, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICA, UINT, otmsCapEmHeight, 108, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICA, UINT, otmsXHeight, 112, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICA, RECT, otmrcFontBox, 116, 16, 4); - TEST_FIELD(OUTLINETEXTMETRICA, INT, otmMacAscent, 132, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICA, INT, otmMacDescent, 136, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICA, UINT, otmMacLineGap, 140, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICA, UINT, otmusMinimumPPEM, 144, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICA, POINT, otmptSubscriptSize, 148, 8, 4); - TEST_FIELD(OUTLINETEXTMETRICA, POINT, otmptSubscriptOffset, 156, 8, 4); - TEST_FIELD(OUTLINETEXTMETRICA, POINT, otmptSuperscriptSize, 164, 8, 4); - TEST_FIELD(OUTLINETEXTMETRICA, POINT, otmptSuperscriptOffset, 172, 8, 4); - TEST_FIELD(OUTLINETEXTMETRICA, UINT, otmsStrikeoutSize, 180, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICA, INT, otmsStrikeoutPosition, 184, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICA, INT, otmsUnderscoreSize, 188, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICA, INT, otmsUnderscorePosition, 192, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICA, LPSTR, otmpFamilyName, 196, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICA, LPSTR, otmpFaceName, 200, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICA, LPSTR, otmpStyleName, 204, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICA, LPSTR, otmpFullName, 208, 4, 4); -} - -static void test_pack_OUTLINETEXTMETRICW(void) -{ - /* OUTLINETEXTMETRICW (pack 4) */ - TEST_TYPE(OUTLINETEXTMETRICW, 216, 4); - TEST_FIELD(OUTLINETEXTMETRICW, UINT, otmSize, 0, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICW, TEXTMETRICW, otmTextMetrics, 4, 60, 4); - TEST_FIELD(OUTLINETEXTMETRICW, BYTE, otmFiller, 64, 1, 1); - TEST_FIELD(OUTLINETEXTMETRICW, PANOSE, otmPanoseNumber, 65, 10, 1); - TEST_FIELD(OUTLINETEXTMETRICW, UINT, otmfsSelection, 76, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICW, UINT, otmfsType, 80, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICW, INT, otmsCharSlopeRise, 84, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICW, INT, otmsCharSlopeRun, 88, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICW, INT, otmItalicAngle, 92, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICW, UINT, otmEMSquare, 96, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICW, INT, otmAscent, 100, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICW, INT, otmDescent, 104, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICW, UINT, otmLineGap, 108, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICW, UINT, otmsCapEmHeight, 112, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICW, UINT, otmsXHeight, 116, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICW, RECT, otmrcFontBox, 120, 16, 4); - TEST_FIELD(OUTLINETEXTMETRICW, INT, otmMacAscent, 136, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICW, INT, otmMacDescent, 140, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICW, UINT, otmMacLineGap, 144, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICW, UINT, otmusMinimumPPEM, 148, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICW, POINT, otmptSubscriptSize, 152, 8, 4); - TEST_FIELD(OUTLINETEXTMETRICW, POINT, otmptSubscriptOffset, 160, 8, 4); - TEST_FIELD(OUTLINETEXTMETRICW, POINT, otmptSuperscriptSize, 168, 8, 4); - TEST_FIELD(OUTLINETEXTMETRICW, POINT, otmptSuperscriptOffset, 176, 8, 4); - TEST_FIELD(OUTLINETEXTMETRICW, UINT, otmsStrikeoutSize, 184, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICW, INT, otmsStrikeoutPosition, 188, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICW, INT, otmsUnderscoreSize, 192, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICW, INT, otmsUnderscorePosition, 196, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICW, LPSTR, otmpFamilyName, 200, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICW, LPSTR, otmpFaceName, 204, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICW, LPSTR, otmpStyleName, 208, 4, 4); - TEST_FIELD(OUTLINETEXTMETRICW, LPSTR, otmpFullName, 212, 4, 4); -} - -static void test_pack_PABC(void) -{ - /* PABC */ - TEST_TYPE(PABC, 4, 4); - TEST_TYPE_POINTER(PABC, 12, 4); -} - -static void test_pack_PABCFLOAT(void) -{ - /* PABCFLOAT */ - TEST_TYPE(PABCFLOAT, 4, 4); - TEST_TYPE_POINTER(PABCFLOAT, 12, 4); -} - -static void test_pack_PANOSE(void) -{ - /* PANOSE (pack 4) */ - TEST_TYPE(PANOSE, 10, 1); - TEST_FIELD(PANOSE, BYTE, bFamilyType, 0, 1, 1); - TEST_FIELD(PANOSE, BYTE, bSerifStyle, 1, 1, 1); - TEST_FIELD(PANOSE, BYTE, bWeight, 2, 1, 1); - TEST_FIELD(PANOSE, BYTE, bProportion, 3, 1, 1); - TEST_FIELD(PANOSE, BYTE, bContrast, 4, 1, 1); - TEST_FIELD(PANOSE, BYTE, bStrokeVariation, 5, 1, 1); - TEST_FIELD(PANOSE, BYTE, bArmStyle, 6, 1, 1); - TEST_FIELD(PANOSE, BYTE, bLetterform, 7, 1, 1); - TEST_FIELD(PANOSE, BYTE, bMidline, 8, 1, 1); - TEST_FIELD(PANOSE, BYTE, bXHeight, 9, 1, 1); -} - -static void test_pack_PATTERN(void) -{ - /* PATTERN */ - TEST_TYPE(PATTERN, 12, 4); -} - -static void test_pack_PBITMAP(void) -{ - /* PBITMAP */ - TEST_TYPE(PBITMAP, 4, 4); - TEST_TYPE_POINTER(PBITMAP, 24, 4); -} - -static void test_pack_PBITMAPCOREHEADER(void) -{ - /* PBITMAPCOREHEADER */ - TEST_TYPE(PBITMAPCOREHEADER, 4, 4); - TEST_TYPE_POINTER(PBITMAPCOREHEADER, 12, 4); -} - -static void test_pack_PBITMAPCOREINFO(void) -{ - /* PBITMAPCOREINFO */ - TEST_TYPE(PBITMAPCOREINFO, 4, 4); - TEST_TYPE_POINTER(PBITMAPCOREINFO, 16, 4); -} - -static void test_pack_PBITMAPFILEHEADER(void) -{ - /* PBITMAPFILEHEADER */ - TEST_TYPE(PBITMAPFILEHEADER, 4, 4); - TEST_TYPE_POINTER(PBITMAPFILEHEADER, 14, 2); -} - -static void test_pack_PBITMAPINFO(void) -{ - /* PBITMAPINFO */ - TEST_TYPE(PBITMAPINFO, 4, 4); - TEST_TYPE_POINTER(PBITMAPINFO, 44, 4); -} - -static void test_pack_PBITMAPINFOHEADER(void) -{ - /* PBITMAPINFOHEADER */ - TEST_TYPE(PBITMAPINFOHEADER, 4, 4); - TEST_TYPE_POINTER(PBITMAPINFOHEADER, 40, 4); -} - -static void test_pack_PBITMAPV4HEADER(void) -{ - /* PBITMAPV4HEADER */ - TEST_TYPE(PBITMAPV4HEADER, 4, 4); - TEST_TYPE_POINTER(PBITMAPV4HEADER, 108, 4); -} - -static void test_pack_PBITMAPV5HEADER(void) -{ - /* PBITMAPV5HEADER */ - TEST_TYPE(PBITMAPV5HEADER, 4, 4); - TEST_TYPE_POINTER(PBITMAPV5HEADER, 124, 4); -} - -static void test_pack_PBLENDFUNCTION(void) -{ - /* PBLENDFUNCTION */ - TEST_TYPE(PBLENDFUNCTION, 4, 4); - TEST_TYPE_POINTER(PBLENDFUNCTION, 4, 1); -} - -static void test_pack_PCHARSETINFO(void) -{ - /* PCHARSETINFO */ - TEST_TYPE(PCHARSETINFO, 4, 4); - TEST_TYPE_POINTER(PCHARSETINFO, 32, 4); -} - -static void test_pack_PCOLORADJUSTMENT(void) -{ - /* PCOLORADJUSTMENT */ - TEST_TYPE(PCOLORADJUSTMENT, 4, 4); - TEST_TYPE_POINTER(PCOLORADJUSTMENT, 24, 2); -} - -static void test_pack_PDEVMODEA(void) -{ - /* PDEVMODEA */ - TEST_TYPE(PDEVMODEA, 4, 4); -} - -static void test_pack_PDEVMODEW(void) -{ - /* PDEVMODEW */ - TEST_TYPE(PDEVMODEW, 4, 4); -} - -static void test_pack_PDIBSECTION(void) -{ - /* PDIBSECTION */ - TEST_TYPE(PDIBSECTION, 4, 4); - TEST_TYPE_POINTER(PDIBSECTION, 84, 4); -} - -static void test_pack_PDISPLAY_DEVICEA(void) -{ - /* PDISPLAY_DEVICEA */ - TEST_TYPE(PDISPLAY_DEVICEA, 4, 4); - TEST_TYPE_POINTER(PDISPLAY_DEVICEA, 424, 4); -} - -static void test_pack_PDISPLAY_DEVICEW(void) -{ - /* PDISPLAY_DEVICEW */ - TEST_TYPE(PDISPLAY_DEVICEW, 4, 4); - TEST_TYPE_POINTER(PDISPLAY_DEVICEW, 840, 4); -} - -static void test_pack_PELARRAY(void) -{ - /* PELARRAY (pack 4) */ - TEST_TYPE(PELARRAY, 20, 4); - TEST_FIELD(PELARRAY, LONG, paXCount, 0, 4, 4); - TEST_FIELD(PELARRAY, LONG, paYCount, 4, 4, 4); - TEST_FIELD(PELARRAY, LONG, paXExt, 8, 4, 4); - TEST_FIELD(PELARRAY, LONG, paYExt, 12, 4, 4); - TEST_FIELD(PELARRAY, BYTE, paRGBs, 16, 1, 1); -} - -static void test_pack_PEMR(void) -{ - /* PEMR */ - TEST_TYPE(PEMR, 4, 4); - TEST_TYPE_POINTER(PEMR, 8, 4); -} - -static void test_pack_PEMRABORTPATH(void) -{ - /* PEMRABORTPATH */ - TEST_TYPE(PEMRABORTPATH, 4, 4); - TEST_TYPE_POINTER(PEMRABORTPATH, 8, 4); -} - -static void test_pack_PEMRANGLEARC(void) -{ - /* PEMRANGLEARC */ - TEST_TYPE(PEMRANGLEARC, 4, 4); - TEST_TYPE_POINTER(PEMRANGLEARC, 28, 4); -} - -static void test_pack_PEMRARC(void) -{ - /* PEMRARC */ - TEST_TYPE(PEMRARC, 4, 4); - TEST_TYPE_POINTER(PEMRARC, 40, 4); -} - -static void test_pack_PEMRARCTO(void) -{ - /* PEMRARCTO */ - TEST_TYPE(PEMRARCTO, 4, 4); - TEST_TYPE_POINTER(PEMRARCTO, 40, 4); -} - -static void test_pack_PEMRBEGINPATH(void) -{ - /* PEMRBEGINPATH */ - TEST_TYPE(PEMRBEGINPATH, 4, 4); - TEST_TYPE_POINTER(PEMRBEGINPATH, 8, 4); -} - -static void test_pack_PEMRBITBLT(void) -{ - /* PEMRBITBLT */ - TEST_TYPE(PEMRBITBLT, 4, 4); - TEST_TYPE_POINTER(PEMRBITBLT, 100, 4); -} - -static void test_pack_PEMRCHORD(void) -{ - /* PEMRCHORD */ - TEST_TYPE(PEMRCHORD, 4, 4); - TEST_TYPE_POINTER(PEMRCHORD, 40, 4); -} - -static void test_pack_PEMRCLOSEFIGURE(void) -{ - /* PEMRCLOSEFIGURE */ - TEST_TYPE(PEMRCLOSEFIGURE, 4, 4); - TEST_TYPE_POINTER(PEMRCLOSEFIGURE, 8, 4); -} - -static void test_pack_PEMRCREATEBRUSHINDIRECT(void) -{ - /* PEMRCREATEBRUSHINDIRECT */ - TEST_TYPE(PEMRCREATEBRUSHINDIRECT, 4, 4); - TEST_TYPE_POINTER(PEMRCREATEBRUSHINDIRECT, 24, 4); -} - -static void test_pack_PEMRCREATECOLORSPACE(void) -{ - /* PEMRCREATECOLORSPACE */ - TEST_TYPE(PEMRCREATECOLORSPACE, 4, 4); - TEST_TYPE_POINTER(PEMRCREATECOLORSPACE, 340, 4); -} - -static void test_pack_PEMRCREATECOLORSPACEW(void) -{ - /* PEMRCREATECOLORSPACEW */ - TEST_TYPE(PEMRCREATECOLORSPACEW, 4, 4); - TEST_TYPE_POINTER(PEMRCREATECOLORSPACEW, 612, 4); -} - -static void test_pack_PEMRCREATEDIBPATTERNBRUSHPT(void) -{ - /* PEMRCREATEDIBPATTERNBRUSHPT */ - TEST_TYPE(PEMRCREATEDIBPATTERNBRUSHPT, 4, 4); - TEST_TYPE_POINTER(PEMRCREATEDIBPATTERNBRUSHPT, 32, 4); -} - -static void test_pack_PEMRCREATEMONOBRUSH(void) -{ - /* PEMRCREATEMONOBRUSH */ - TEST_TYPE(PEMRCREATEMONOBRUSH, 4, 4); - TEST_TYPE_POINTER(PEMRCREATEMONOBRUSH, 32, 4); -} - -static void test_pack_PEMRCREATEPALETTE(void) -{ - /* PEMRCREATEPALETTE */ - TEST_TYPE(PEMRCREATEPALETTE, 4, 4); - TEST_TYPE_POINTER(PEMRCREATEPALETTE, 20, 4); -} - -static void test_pack_PEMRCREATEPEN(void) -{ - /* PEMRCREATEPEN */ - TEST_TYPE(PEMRCREATEPEN, 4, 4); - TEST_TYPE_POINTER(PEMRCREATEPEN, 28, 4); -} - -static void test_pack_PEMRDELETECOLORSPACE(void) -{ - /* PEMRDELETECOLORSPACE */ - TEST_TYPE(PEMRDELETECOLORSPACE, 4, 4); - TEST_TYPE_POINTER(PEMRDELETECOLORSPACE, 12, 4); -} - -static void test_pack_PEMRDELETEOBJECT(void) -{ - /* PEMRDELETEOBJECT */ - TEST_TYPE(PEMRDELETEOBJECT, 4, 4); - TEST_TYPE_POINTER(PEMRDELETEOBJECT, 12, 4); -} - -static void test_pack_PEMRELLIPSE(void) -{ - /* PEMRELLIPSE */ - TEST_TYPE(PEMRELLIPSE, 4, 4); - TEST_TYPE_POINTER(PEMRELLIPSE, 24, 4); -} - -static void test_pack_PEMRENDPATH(void) -{ - /* PEMRENDPATH */ - TEST_TYPE(PEMRENDPATH, 4, 4); - TEST_TYPE_POINTER(PEMRENDPATH, 8, 4); -} - -static void test_pack_PEMREOF(void) -{ - /* PEMREOF */ - TEST_TYPE(PEMREOF, 4, 4); - TEST_TYPE_POINTER(PEMREOF, 20, 4); -} - -static void test_pack_PEMREXCLUDECLIPRECT(void) -{ - /* PEMREXCLUDECLIPRECT */ - TEST_TYPE(PEMREXCLUDECLIPRECT, 4, 4); - TEST_TYPE_POINTER(PEMREXCLUDECLIPRECT, 24, 4); -} - -static void test_pack_PEMREXTCREATEFONTINDIRECTW(void) -{ - /* PEMREXTCREATEFONTINDIRECTW */ - TEST_TYPE(PEMREXTCREATEFONTINDIRECTW, 4, 4); - TEST_TYPE_POINTER(PEMREXTCREATEFONTINDIRECTW, 332, 4); -} - -static void test_pack_PEMREXTCREATEPEN(void) -{ - /* PEMREXTCREATEPEN */ - TEST_TYPE(PEMREXTCREATEPEN, 4, 4); - TEST_TYPE_POINTER(PEMREXTCREATEPEN, 56, 4); -} - -static void test_pack_PEMREXTFLOODFILL(void) -{ - /* PEMREXTFLOODFILL */ - TEST_TYPE(PEMREXTFLOODFILL, 4, 4); - TEST_TYPE_POINTER(PEMREXTFLOODFILL, 24, 4); -} - -static void test_pack_PEMREXTSELECTCLIPRGN(void) -{ - /* PEMREXTSELECTCLIPRGN */ - TEST_TYPE(PEMREXTSELECTCLIPRGN, 4, 4); - TEST_TYPE_POINTER(PEMREXTSELECTCLIPRGN, 20, 4); -} - -static void test_pack_PEMREXTTEXTOUTA(void) -{ - /* PEMREXTTEXTOUTA */ - TEST_TYPE(PEMREXTTEXTOUTA, 4, 4); - TEST_TYPE_POINTER(PEMREXTTEXTOUTA, 76, 4); -} - -static void test_pack_PEMREXTTEXTOUTW(void) -{ - /* PEMREXTTEXTOUTW */ - TEST_TYPE(PEMREXTTEXTOUTW, 4, 4); - TEST_TYPE_POINTER(PEMREXTTEXTOUTW, 76, 4); -} - -static void test_pack_PEMRFILLPATH(void) -{ - /* PEMRFILLPATH */ - TEST_TYPE(PEMRFILLPATH, 4, 4); - TEST_TYPE_POINTER(PEMRFILLPATH, 24, 4); -} - -static void test_pack_PEMRFILLRGN(void) -{ - /* PEMRFILLRGN */ - TEST_TYPE(PEMRFILLRGN, 4, 4); - TEST_TYPE_POINTER(PEMRFILLRGN, 36, 4); -} - -static void test_pack_PEMRFLATTENPATH(void) -{ - /* PEMRFLATTENPATH */ - TEST_TYPE(PEMRFLATTENPATH, 4, 4); - TEST_TYPE_POINTER(PEMRFLATTENPATH, 8, 4); -} - -static void test_pack_PEMRFORMAT(void) -{ - /* PEMRFORMAT */ - TEST_TYPE(PEMRFORMAT, 4, 4); - TEST_TYPE_POINTER(PEMRFORMAT, 16, 4); -} - -static void test_pack_PEMRFRAMERGN(void) -{ - /* PEMRFRAMERGN */ - TEST_TYPE(PEMRFRAMERGN, 4, 4); - TEST_TYPE_POINTER(PEMRFRAMERGN, 44, 4); -} - -static void test_pack_PEMRGDICOMMENT(void) -{ - /* PEMRGDICOMMENT */ - TEST_TYPE(PEMRGDICOMMENT, 4, 4); - TEST_TYPE_POINTER(PEMRGDICOMMENT, 16, 4); -} - -static void test_pack_PEMRGLSBOUNDEDRECORD(void) -{ - /* PEMRGLSBOUNDEDRECORD */ - TEST_TYPE(PEMRGLSBOUNDEDRECORD, 4, 4); - TEST_TYPE_POINTER(PEMRGLSBOUNDEDRECORD, 32, 4); -} - -static void test_pack_PEMRGLSRECORD(void) -{ - /* PEMRGLSRECORD */ - TEST_TYPE(PEMRGLSRECORD, 4, 4); - TEST_TYPE_POINTER(PEMRGLSRECORD, 16, 4); -} - -static void test_pack_PEMRINTERSECTCLIPRECT(void) -{ - /* PEMRINTERSECTCLIPRECT */ - TEST_TYPE(PEMRINTERSECTCLIPRECT, 4, 4); - TEST_TYPE_POINTER(PEMRINTERSECTCLIPRECT, 24, 4); -} - -static void test_pack_PEMRINVERTRGN(void) -{ - /* PEMRINVERTRGN */ - TEST_TYPE(PEMRINVERTRGN, 4, 4); - TEST_TYPE_POINTER(PEMRINVERTRGN, 32, 4); -} - -static void test_pack_PEMRLINETO(void) -{ - /* PEMRLINETO */ - TEST_TYPE(PEMRLINETO, 4, 4); - TEST_TYPE_POINTER(PEMRLINETO, 16, 4); -} - -static void test_pack_PEMRMASKBLT(void) -{ - /* PEMRMASKBLT */ - TEST_TYPE(PEMRMASKBLT, 4, 4); - TEST_TYPE_POINTER(PEMRMASKBLT, 128, 4); -} - -static void test_pack_PEMRMODIFYWORLDTRANSFORM(void) -{ - /* PEMRMODIFYWORLDTRANSFORM */ - TEST_TYPE(PEMRMODIFYWORLDTRANSFORM, 4, 4); - TEST_TYPE_POINTER(PEMRMODIFYWORLDTRANSFORM, 36, 4); -} - -static void test_pack_PEMRMOVETOEX(void) -{ - /* PEMRMOVETOEX */ - TEST_TYPE(PEMRMOVETOEX, 4, 4); - TEST_TYPE_POINTER(PEMRMOVETOEX, 16, 4); -} - -static void test_pack_PEMROFFSETCLIPRGN(void) -{ - /* PEMROFFSETCLIPRGN */ - TEST_TYPE(PEMROFFSETCLIPRGN, 4, 4); - TEST_TYPE_POINTER(PEMROFFSETCLIPRGN, 16, 4); -} - -static void test_pack_PEMRPAINTRGN(void) -{ - /* PEMRPAINTRGN */ - TEST_TYPE(PEMRPAINTRGN, 4, 4); - TEST_TYPE_POINTER(PEMRPAINTRGN, 32, 4); -} - -static void test_pack_PEMRPIE(void) -{ - /* PEMRPIE */ - TEST_TYPE(PEMRPIE, 4, 4); - TEST_TYPE_POINTER(PEMRPIE, 40, 4); -} - -static void test_pack_PEMRPIXELFORMAT(void) -{ - /* PEMRPIXELFORMAT */ - TEST_TYPE(PEMRPIXELFORMAT, 4, 4); - TEST_TYPE_POINTER(PEMRPIXELFORMAT, 48, 4); -} - -static void test_pack_PEMRPLGBLT(void) -{ - /* PEMRPLGBLT */ - TEST_TYPE(PEMRPLGBLT, 4, 4); - TEST_TYPE_POINTER(PEMRPLGBLT, 140, 4); -} - -static void test_pack_PEMRPOLYBEZIER(void) -{ - /* PEMRPOLYBEZIER */ - TEST_TYPE(PEMRPOLYBEZIER, 4, 4); - TEST_TYPE_POINTER(PEMRPOLYBEZIER, 36, 4); -} - -static void test_pack_PEMRPOLYBEZIER16(void) -{ - /* PEMRPOLYBEZIER16 */ - TEST_TYPE(PEMRPOLYBEZIER16, 4, 4); - TEST_TYPE_POINTER(PEMRPOLYBEZIER16, 32, 4); -} - -static void test_pack_PEMRPOLYBEZIERTO(void) -{ - /* PEMRPOLYBEZIERTO */ - TEST_TYPE(PEMRPOLYBEZIERTO, 4, 4); - TEST_TYPE_POINTER(PEMRPOLYBEZIERTO, 36, 4); -} - -static void test_pack_PEMRPOLYBEZIERTO16(void) -{ - /* PEMRPOLYBEZIERTO16 */ - TEST_TYPE(PEMRPOLYBEZIERTO16, 4, 4); - TEST_TYPE_POINTER(PEMRPOLYBEZIERTO16, 32, 4); -} - -static void test_pack_PEMRPOLYDRAW(void) -{ - /* PEMRPOLYDRAW */ - TEST_TYPE(PEMRPOLYDRAW, 4, 4); - TEST_TYPE_POINTER(PEMRPOLYDRAW, 40, 4); -} - -static void test_pack_PEMRPOLYDRAW16(void) -{ - /* PEMRPOLYDRAW16 */ - TEST_TYPE(PEMRPOLYDRAW16, 4, 4); - TEST_TYPE_POINTER(PEMRPOLYDRAW16, 36, 4); -} - -static void test_pack_PEMRPOLYGON(void) -{ - /* PEMRPOLYGON */ - TEST_TYPE(PEMRPOLYGON, 4, 4); - TEST_TYPE_POINTER(PEMRPOLYGON, 36, 4); -} - -static void test_pack_PEMRPOLYGON16(void) -{ - /* PEMRPOLYGON16 */ - TEST_TYPE(PEMRPOLYGON16, 4, 4); - TEST_TYPE_POINTER(PEMRPOLYGON16, 32, 4); -} - -static void test_pack_PEMRPOLYLINE(void) -{ - /* PEMRPOLYLINE */ - TEST_TYPE(PEMRPOLYLINE, 4, 4); - TEST_TYPE_POINTER(PEMRPOLYLINE, 36, 4); -} - -static void test_pack_PEMRPOLYLINE16(void) -{ - /* PEMRPOLYLINE16 */ - TEST_TYPE(PEMRPOLYLINE16, 4, 4); - TEST_TYPE_POINTER(PEMRPOLYLINE16, 32, 4); -} - -static void test_pack_PEMRPOLYLINETO(void) -{ - /* PEMRPOLYLINETO */ - TEST_TYPE(PEMRPOLYLINETO, 4, 4); - TEST_TYPE_POINTER(PEMRPOLYLINETO, 36, 4); -} - -static void test_pack_PEMRPOLYLINETO16(void) -{ - /* PEMRPOLYLINETO16 */ - TEST_TYPE(PEMRPOLYLINETO16, 4, 4); - TEST_TYPE_POINTER(PEMRPOLYLINETO16, 32, 4); -} - -static void test_pack_PEMRPOLYPOLYGON(void) -{ - /* PEMRPOLYPOLYGON */ - TEST_TYPE(PEMRPOLYPOLYGON, 4, 4); - TEST_TYPE_POINTER(PEMRPOLYPOLYGON, 44, 4); -} - -static void test_pack_PEMRPOLYPOLYGON16(void) -{ - /* PEMRPOLYPOLYGON16 */ - TEST_TYPE(PEMRPOLYPOLYGON16, 4, 4); - TEST_TYPE_POINTER(PEMRPOLYPOLYGON16, 40, 4); -} - -static void test_pack_PEMRPOLYPOLYLINE(void) -{ - /* PEMRPOLYPOLYLINE */ - TEST_TYPE(PEMRPOLYPOLYLINE, 4, 4); - TEST_TYPE_POINTER(PEMRPOLYPOLYLINE, 44, 4); -} - -static void test_pack_PEMRPOLYPOLYLINE16(void) -{ - /* PEMRPOLYPOLYLINE16 */ - TEST_TYPE(PEMRPOLYPOLYLINE16, 4, 4); - TEST_TYPE_POINTER(PEMRPOLYPOLYLINE16, 40, 4); -} - -static void test_pack_PEMRPOLYTEXTOUTA(void) -{ - /* PEMRPOLYTEXTOUTA */ - TEST_TYPE(PEMRPOLYTEXTOUTA, 4, 4); - TEST_TYPE_POINTER(PEMRPOLYTEXTOUTA, 80, 4); -} - -static void test_pack_PEMRPOLYTEXTOUTW(void) -{ - /* PEMRPOLYTEXTOUTW */ - TEST_TYPE(PEMRPOLYTEXTOUTW, 4, 4); - TEST_TYPE_POINTER(PEMRPOLYTEXTOUTW, 80, 4); -} - -static void test_pack_PEMRREALIZEPALETTE(void) -{ - /* PEMRREALIZEPALETTE */ - TEST_TYPE(PEMRREALIZEPALETTE, 4, 4); - TEST_TYPE_POINTER(PEMRREALIZEPALETTE, 8, 4); -} - -static void test_pack_PEMRRECTANGLE(void) -{ - /* PEMRRECTANGLE */ - TEST_TYPE(PEMRRECTANGLE, 4, 4); - TEST_TYPE_POINTER(PEMRRECTANGLE, 24, 4); -} - -static void test_pack_PEMRRESIZEPALETTE(void) -{ - /* PEMRRESIZEPALETTE */ - TEST_TYPE(PEMRRESIZEPALETTE, 4, 4); - TEST_TYPE_POINTER(PEMRRESIZEPALETTE, 16, 4); -} - -static void test_pack_PEMRRESTOREDC(void) -{ - /* PEMRRESTOREDC */ - TEST_TYPE(PEMRRESTOREDC, 4, 4); - TEST_TYPE_POINTER(PEMRRESTOREDC, 12, 4); -} - -static void test_pack_PEMRROUNDRECT(void) -{ - /* PEMRROUNDRECT */ - TEST_TYPE(PEMRROUNDRECT, 4, 4); - TEST_TYPE_POINTER(PEMRROUNDRECT, 32, 4); -} - -static void test_pack_PEMRSAVEDC(void) -{ - /* PEMRSAVEDC */ - TEST_TYPE(PEMRSAVEDC, 4, 4); - TEST_TYPE_POINTER(PEMRSAVEDC, 8, 4); -} - -static void test_pack_PEMRSCALEVIEWPORTEXTEX(void) -{ - /* PEMRSCALEVIEWPORTEXTEX */ - TEST_TYPE(PEMRSCALEVIEWPORTEXTEX, 4, 4); - TEST_TYPE_POINTER(PEMRSCALEVIEWPORTEXTEX, 24, 4); -} - -static void test_pack_PEMRSCALEWINDOWEXTEX(void) -{ - /* PEMRSCALEWINDOWEXTEX */ - TEST_TYPE(PEMRSCALEWINDOWEXTEX, 4, 4); - TEST_TYPE_POINTER(PEMRSCALEWINDOWEXTEX, 24, 4); -} - -static void test_pack_PEMRSELECTCLIPPATH(void) -{ - /* PEMRSELECTCLIPPATH */ - TEST_TYPE(PEMRSELECTCLIPPATH, 4, 4); - TEST_TYPE_POINTER(PEMRSELECTCLIPPATH, 12, 4); -} - -static void test_pack_PEMRSELECTCOLORSPACE(void) -{ - /* PEMRSELECTCOLORSPACE */ - TEST_TYPE(PEMRSELECTCOLORSPACE, 4, 4); - TEST_TYPE_POINTER(PEMRSELECTCOLORSPACE, 12, 4); -} - -static void test_pack_PEMRSELECTOBJECT(void) -{ - /* PEMRSELECTOBJECT */ - TEST_TYPE(PEMRSELECTOBJECT, 4, 4); - TEST_TYPE_POINTER(PEMRSELECTOBJECT, 12, 4); -} - -static void test_pack_PEMRSELECTPALETTE(void) -{ - /* PEMRSELECTPALETTE */ - TEST_TYPE(PEMRSELECTPALETTE, 4, 4); - TEST_TYPE_POINTER(PEMRSELECTPALETTE, 12, 4); -} - -static void test_pack_PEMRSETARCDIRECTION(void) -{ - /* PEMRSETARCDIRECTION */ - TEST_TYPE(PEMRSETARCDIRECTION, 4, 4); - TEST_TYPE_POINTER(PEMRSETARCDIRECTION, 12, 4); -} - -static void test_pack_PEMRSETBKCOLOR(void) -{ - /* PEMRSETBKCOLOR */ - TEST_TYPE(PEMRSETBKCOLOR, 4, 4); - TEST_TYPE_POINTER(PEMRSETBKCOLOR, 12, 4); -} - -static void test_pack_PEMRSETBKMODE(void) -{ - /* PEMRSETBKMODE */ - TEST_TYPE(PEMRSETBKMODE, 4, 4); - TEST_TYPE_POINTER(PEMRSETBKMODE, 12, 4); -} - -static void test_pack_PEMRSETBRUSHORGEX(void) -{ - /* PEMRSETBRUSHORGEX */ - TEST_TYPE(PEMRSETBRUSHORGEX, 4, 4); - TEST_TYPE_POINTER(PEMRSETBRUSHORGEX, 16, 4); -} - -static void test_pack_PEMRSETCOLORADJUSTMENT(void) -{ - /* PEMRSETCOLORADJUSTMENT */ - TEST_TYPE(PEMRSETCOLORADJUSTMENT, 4, 4); - TEST_TYPE_POINTER(PEMRSETCOLORADJUSTMENT, 32, 4); -} - -static void test_pack_PEMRSETCOLORSPACE(void) -{ - /* PEMRSETCOLORSPACE */ - TEST_TYPE(PEMRSETCOLORSPACE, 4, 4); - TEST_TYPE_POINTER(PEMRSETCOLORSPACE, 12, 4); -} - -static void test_pack_PEMRSETDIBITSTODEVICE(void) -{ - /* PEMRSETDIBITSTODEVICE */ - TEST_TYPE(PEMRSETDIBITSTODEVICE, 4, 4); - TEST_TYPE_POINTER(PEMRSETDIBITSTODEVICE, 76, 4); -} - -static void test_pack_PEMRSETICMMODE(void) -{ - /* PEMRSETICMMODE */ - TEST_TYPE(PEMRSETICMMODE, 4, 4); - TEST_TYPE_POINTER(PEMRSETICMMODE, 12, 4); -} - -static void test_pack_PEMRSETLAYOUT(void) -{ - /* PEMRSETLAYOUT */ - TEST_TYPE(PEMRSETLAYOUT, 4, 4); - TEST_TYPE_POINTER(PEMRSETLAYOUT, 12, 4); -} - -static void test_pack_PEMRSETMAPMODE(void) -{ - /* PEMRSETMAPMODE */ - TEST_TYPE(PEMRSETMAPMODE, 4, 4); - TEST_TYPE_POINTER(PEMRSETMAPMODE, 12, 4); -} - -static void test_pack_PEMRSETMAPPERFLAGS(void) -{ - /* PEMRSETMAPPERFLAGS */ - TEST_TYPE(PEMRSETMAPPERFLAGS, 4, 4); - TEST_TYPE_POINTER(PEMRSETMAPPERFLAGS, 12, 4); -} - -static void test_pack_PEMRSETMETARGN(void) -{ - /* PEMRSETMETARGN */ - TEST_TYPE(PEMRSETMETARGN, 4, 4); - TEST_TYPE_POINTER(PEMRSETMETARGN, 8, 4); -} - -static void test_pack_PEMRSETMITERLIMIT(void) -{ - /* PEMRSETMITERLIMIT */ - TEST_TYPE(PEMRSETMITERLIMIT, 4, 4); - TEST_TYPE_POINTER(PEMRSETMITERLIMIT, 12, 4); -} - -static void test_pack_PEMRSETPALETTEENTRIES(void) -{ - /* PEMRSETPALETTEENTRIES */ - TEST_TYPE(PEMRSETPALETTEENTRIES, 4, 4); - TEST_TYPE_POINTER(PEMRSETPALETTEENTRIES, 24, 4); -} - -static void test_pack_PEMRSETPIXELV(void) -{ - /* PEMRSETPIXELV */ - TEST_TYPE(PEMRSETPIXELV, 4, 4); - TEST_TYPE_POINTER(PEMRSETPIXELV, 20, 4); -} - -static void test_pack_PEMRSETPOLYFILLMODE(void) -{ - /* PEMRSETPOLYFILLMODE */ - TEST_TYPE(PEMRSETPOLYFILLMODE, 4, 4); - TEST_TYPE_POINTER(PEMRSETPOLYFILLMODE, 12, 4); -} - -static void test_pack_PEMRSETROP2(void) -{ - /* PEMRSETROP2 */ - TEST_TYPE(PEMRSETROP2, 4, 4); - TEST_TYPE_POINTER(PEMRSETROP2, 12, 4); -} - -static void test_pack_PEMRSETSTRETCHBLTMODE(void) -{ - /* PEMRSETSTRETCHBLTMODE */ - TEST_TYPE(PEMRSETSTRETCHBLTMODE, 4, 4); - TEST_TYPE_POINTER(PEMRSETSTRETCHBLTMODE, 12, 4); -} - -static void test_pack_PEMRSETTEXTALIGN(void) -{ - /* PEMRSETTEXTALIGN */ - TEST_TYPE(PEMRSETTEXTALIGN, 4, 4); - TEST_TYPE_POINTER(PEMRSETTEXTALIGN, 12, 4); -} - -static void test_pack_PEMRSETTEXTCOLOR(void) -{ - /* PEMRSETTEXTCOLOR */ - TEST_TYPE(PEMRSETTEXTCOLOR, 4, 4); - TEST_TYPE_POINTER(PEMRSETTEXTCOLOR, 12, 4); -} - -static void test_pack_PEMRSETVIEWPORTEXTEX(void) -{ - /* PEMRSETVIEWPORTEXTEX */ - TEST_TYPE(PEMRSETVIEWPORTEXTEX, 4, 4); - TEST_TYPE_POINTER(PEMRSETVIEWPORTEXTEX, 16, 4); -} - -static void test_pack_PEMRSETVIEWPORTORGEX(void) -{ - /* PEMRSETVIEWPORTORGEX */ - TEST_TYPE(PEMRSETVIEWPORTORGEX, 4, 4); - TEST_TYPE_POINTER(PEMRSETVIEWPORTORGEX, 16, 4); -} - -static void test_pack_PEMRSETWINDOWEXTEX(void) -{ - /* PEMRSETWINDOWEXTEX */ - TEST_TYPE(PEMRSETWINDOWEXTEX, 4, 4); - TEST_TYPE_POINTER(PEMRSETWINDOWEXTEX, 16, 4); -} - -static void test_pack_PEMRSETWINDOWORGEX(void) -{ - /* PEMRSETWINDOWORGEX */ - TEST_TYPE(PEMRSETWINDOWORGEX, 4, 4); - TEST_TYPE_POINTER(PEMRSETWINDOWORGEX, 16, 4); -} - -static void test_pack_PEMRSETWORLDTRANSFORM(void) -{ - /* PEMRSETWORLDTRANSFORM */ - TEST_TYPE(PEMRSETWORLDTRANSFORM, 4, 4); - TEST_TYPE_POINTER(PEMRSETWORLDTRANSFORM, 32, 4); -} - -static void test_pack_PEMRSTRETCHBLT(void) -{ - /* PEMRSTRETCHBLT */ - TEST_TYPE(PEMRSTRETCHBLT, 4, 4); - TEST_TYPE_POINTER(PEMRSTRETCHBLT, 108, 4); -} - -static void test_pack_PEMRSTRETCHDIBITS(void) -{ - /* PEMRSTRETCHDIBITS */ - TEST_TYPE(PEMRSTRETCHDIBITS, 4, 4); - TEST_TYPE_POINTER(PEMRSTRETCHDIBITS, 80, 4); -} - -static void test_pack_PEMRSTROKEANDFILLPATH(void) -{ - /* PEMRSTROKEANDFILLPATH */ - TEST_TYPE(PEMRSTROKEANDFILLPATH, 4, 4); - TEST_TYPE_POINTER(PEMRSTROKEANDFILLPATH, 24, 4); -} - -static void test_pack_PEMRSTROKEPATH(void) -{ - /* PEMRSTROKEPATH */ - TEST_TYPE(PEMRSTROKEPATH, 4, 4); - TEST_TYPE_POINTER(PEMRSTROKEPATH, 24, 4); -} - -static void test_pack_PEMRTEXT(void) -{ - /* PEMRTEXT */ - TEST_TYPE(PEMRTEXT, 4, 4); - TEST_TYPE_POINTER(PEMRTEXT, 40, 4); -} - -static void test_pack_PEMRWIDENPATH(void) -{ - /* PEMRWIDENPATH */ - TEST_TYPE(PEMRWIDENPATH, 4, 4); - TEST_TYPE_POINTER(PEMRWIDENPATH, 8, 4); -} - -static void test_pack_PENHMETAHEADER(void) -{ - /* PENHMETAHEADER */ - TEST_TYPE(PENHMETAHEADER, 4, 4); - TEST_TYPE_POINTER(PENHMETAHEADER, 108, 4); -} - -static void test_pack_PEXTLOGFONTA(void) -{ - /* PEXTLOGFONTA */ - TEST_TYPE(PEXTLOGFONTA, 4, 4); - TEST_TYPE_POINTER(PEXTLOGFONTA, 192, 4); -} - -static void test_pack_PEXTLOGFONTW(void) -{ - /* PEXTLOGFONTW */ - TEST_TYPE(PEXTLOGFONTW, 4, 4); - TEST_TYPE_POINTER(PEXTLOGFONTW, 320, 4); -} - -static void test_pack_PEXTLOGPEN(void) -{ - /* PEXTLOGPEN */ - TEST_TYPE(PEXTLOGPEN, 4, 4); - TEST_TYPE_POINTER(PEXTLOGPEN, 28, 4); -} - -static void test_pack_PFONTSIGNATURE(void) -{ - /* PFONTSIGNATURE */ - TEST_TYPE(PFONTSIGNATURE, 4, 4); - TEST_TYPE_POINTER(PFONTSIGNATURE, 24, 4); -} - -static void test_pack_PGLYPHMETRICSFLOAT(void) -{ - /* PGLYPHMETRICSFLOAT */ - TEST_TYPE(PGLYPHMETRICSFLOAT, 4, 4); - TEST_TYPE_POINTER(PGLYPHMETRICSFLOAT, 24, 4); -} - -static void test_pack_PGRADIENT_RECT(void) -{ - /* PGRADIENT_RECT */ - TEST_TYPE(PGRADIENT_RECT, 4, 4); - TEST_TYPE_POINTER(PGRADIENT_RECT, 8, 4); -} - -static void test_pack_PGRADIENT_TRIANGLE(void) -{ - /* PGRADIENT_TRIANGLE */ - TEST_TYPE(PGRADIENT_TRIANGLE, 4, 4); - TEST_TYPE_POINTER(PGRADIENT_TRIANGLE, 12, 4); -} - -static void test_pack_PHANDLETABLE(void) -{ - /* PHANDLETABLE */ - TEST_TYPE(PHANDLETABLE, 4, 4); - TEST_TYPE_POINTER(PHANDLETABLE, 4, 4); -} - -static void test_pack_PIXELFORMATDESCRIPTOR(void) -{ - /* PIXELFORMATDESCRIPTOR (pack 4) */ - TEST_TYPE(PIXELFORMATDESCRIPTOR, 40, 4); - TEST_FIELD(PIXELFORMATDESCRIPTOR, WORD, nSize, 0, 2, 2); - TEST_FIELD(PIXELFORMATDESCRIPTOR, WORD, nVersion, 2, 2, 2); - TEST_FIELD(PIXELFORMATDESCRIPTOR, DWORD, dwFlags, 4, 4, 4); - TEST_FIELD(PIXELFORMATDESCRIPTOR, BYTE, iPixelType, 8, 1, 1); - TEST_FIELD(PIXELFORMATDESCRIPTOR, BYTE, cColorBits, 9, 1, 1); - TEST_FIELD(PIXELFORMATDESCRIPTOR, BYTE, cRedBits, 10, 1, 1); - TEST_FIELD(PIXELFORMATDESCRIPTOR, BYTE, cRedShift, 11, 1, 1); - TEST_FIELD(PIXELFORMATDESCRIPTOR, BYTE, cGreenBits, 12, 1, 1); - TEST_FIELD(PIXELFORMATDESCRIPTOR, BYTE, cGreenShift, 13, 1, 1); - TEST_FIELD(PIXELFORMATDESCRIPTOR, BYTE, cBlueBits, 14, 1, 1); - TEST_FIELD(PIXELFORMATDESCRIPTOR, BYTE, cBlueShift, 15, 1, 1); - TEST_FIELD(PIXELFORMATDESCRIPTOR, BYTE, cAlphaBits, 16, 1, 1); - TEST_FIELD(PIXELFORMATDESCRIPTOR, BYTE, cAlphaShift, 17, 1, 1); - TEST_FIELD(PIXELFORMATDESCRIPTOR, BYTE, cAccumBits, 18, 1, 1); - TEST_FIELD(PIXELFORMATDESCRIPTOR, BYTE, cAccumRedBits, 19, 1, 1); - TEST_FIELD(PIXELFORMATDESCRIPTOR, BYTE, cAccumGreenBits, 20, 1, 1); - TEST_FIELD(PIXELFORMATDESCRIPTOR, BYTE, cAccumBlueBits, 21, 1, 1); - TEST_FIELD(PIXELFORMATDESCRIPTOR, BYTE, cAccumAlphaBits, 22, 1, 1); - TEST_FIELD(PIXELFORMATDESCRIPTOR, BYTE, cDepthBits, 23, 1, 1); - TEST_FIELD(PIXELFORMATDESCRIPTOR, BYTE, cStencilBits, 24, 1, 1); - TEST_FIELD(PIXELFORMATDESCRIPTOR, BYTE, cAuxBuffers, 25, 1, 1); - TEST_FIELD(PIXELFORMATDESCRIPTOR, BYTE, iLayerType, 26, 1, 1); - TEST_FIELD(PIXELFORMATDESCRIPTOR, BYTE, bReserved, 27, 1, 1); - TEST_FIELD(PIXELFORMATDESCRIPTOR, DWORD, dwLayerMask, 28, 4, 4); - TEST_FIELD(PIXELFORMATDESCRIPTOR, DWORD, dwVisibleMask, 32, 4, 4); - TEST_FIELD(PIXELFORMATDESCRIPTOR, DWORD, dwDamageMask, 36, 4, 4); -} - -static void test_pack_PLAYERPLANEDESCRIPTOR(void) -{ - /* PLAYERPLANEDESCRIPTOR */ - TEST_TYPE(PLAYERPLANEDESCRIPTOR, 4, 4); - TEST_TYPE_POINTER(PLAYERPLANEDESCRIPTOR, 32, 4); -} - -static void test_pack_PLOCALESIGNATURE(void) -{ - /* PLOCALESIGNATURE */ - TEST_TYPE(PLOCALESIGNATURE, 4, 4); - TEST_TYPE_POINTER(PLOCALESIGNATURE, 32, 4); -} - -static void test_pack_PLOGBRUSH(void) -{ - /* PLOGBRUSH */ - TEST_TYPE(PLOGBRUSH, 4, 4); - TEST_TYPE_POINTER(PLOGBRUSH, 12, 4); -} - -static void test_pack_PLOGFONTA(void) -{ - /* PLOGFONTA */ - TEST_TYPE(PLOGFONTA, 4, 4); - TEST_TYPE_POINTER(PLOGFONTA, 60, 4); -} - -static void test_pack_PLOGFONTW(void) -{ - /* PLOGFONTW */ - TEST_TYPE(PLOGFONTW, 4, 4); - TEST_TYPE_POINTER(PLOGFONTW, 92, 4); -} - -static void test_pack_PMETAHEADER(void) -{ - /* PMETAHEADER */ - TEST_TYPE(PMETAHEADER, 4, 4); - TEST_TYPE_POINTER(PMETAHEADER, 18, 2); -} - -static void test_pack_PMETARECORD(void) -{ - /* PMETARECORD */ - TEST_TYPE(PMETARECORD, 4, 4); - TEST_TYPE_POINTER(PMETARECORD, 8, 4); -} - -static void test_pack_PNEWTEXTMETRICA(void) -{ - /* PNEWTEXTMETRICA */ - TEST_TYPE(PNEWTEXTMETRICA, 4, 4); - TEST_TYPE_POINTER(PNEWTEXTMETRICA, 72, 4); -} - -static void test_pack_PNEWTEXTMETRICW(void) -{ - /* PNEWTEXTMETRICW */ - TEST_TYPE(PNEWTEXTMETRICW, 4, 4); - TEST_TYPE_POINTER(PNEWTEXTMETRICW, 76, 4); -} - -static void test_pack_POINTFLOAT(void) -{ - /* POINTFLOAT (pack 4) */ - TEST_TYPE(POINTFLOAT, 8, 4); - TEST_FIELD(POINTFLOAT, FLOAT, x, 0, 4, 4); - TEST_FIELD(POINTFLOAT, FLOAT, y, 4, 4, 4); -} - -static void test_pack_POINTFX(void) -{ - /* POINTFX (pack 4) */ - TEST_TYPE(POINTFX, 8, 2); - TEST_FIELD(POINTFX, FIXED, x, 0, 4, 2); - TEST_FIELD(POINTFX, FIXED, y, 4, 4, 2); -} - -static void test_pack_POLYTEXTA(void) -{ - /* POLYTEXTA (pack 4) */ - TEST_TYPE(POLYTEXTA, 40, 4); - TEST_FIELD(POLYTEXTA, INT, x, 0, 4, 4); - TEST_FIELD(POLYTEXTA, INT, y, 4, 4, 4); - TEST_FIELD(POLYTEXTA, UINT, n, 8, 4, 4); - TEST_FIELD(POLYTEXTA, LPCSTR, lpstr, 12, 4, 4); - TEST_FIELD(POLYTEXTA, UINT, uiFlags, 16, 4, 4); - TEST_FIELD(POLYTEXTA, RECT, rcl, 20, 16, 4); - TEST_FIELD(POLYTEXTA, INT *, pdx, 36, 4, 4); -} - -static void test_pack_POLYTEXTW(void) -{ - /* POLYTEXTW (pack 4) */ - TEST_TYPE(POLYTEXTW, 40, 4); - TEST_FIELD(POLYTEXTW, INT, x, 0, 4, 4); - TEST_FIELD(POLYTEXTW, INT, y, 4, 4, 4); - TEST_FIELD(POLYTEXTW, UINT, n, 8, 4, 4); - TEST_FIELD(POLYTEXTW, LPCWSTR, lpstr, 12, 4, 4); - TEST_FIELD(POLYTEXTW, UINT, uiFlags, 16, 4, 4); - TEST_FIELD(POLYTEXTW, RECT, rcl, 20, 16, 4); - TEST_FIELD(POLYTEXTW, INT *, pdx, 36, 4, 4); -} - -static void test_pack_POUTLINETEXTMETRICA(void) -{ - /* POUTLINETEXTMETRICA */ - TEST_TYPE(POUTLINETEXTMETRICA, 4, 4); - TEST_TYPE_POINTER(POUTLINETEXTMETRICA, 212, 4); -} - -static void test_pack_POUTLINETEXTMETRICW(void) -{ - /* POUTLINETEXTMETRICW */ - TEST_TYPE(POUTLINETEXTMETRICW, 4, 4); - TEST_TYPE_POINTER(POUTLINETEXTMETRICW, 216, 4); -} - -static void test_pack_PPELARRAY(void) -{ - /* PPELARRAY */ - TEST_TYPE(PPELARRAY, 4, 4); - TEST_TYPE_POINTER(PPELARRAY, 20, 4); -} - -static void test_pack_PPIXELFORMATDESCRIPTOR(void) -{ - /* PPIXELFORMATDESCRIPTOR */ - TEST_TYPE(PPIXELFORMATDESCRIPTOR, 4, 4); - TEST_TYPE_POINTER(PPIXELFORMATDESCRIPTOR, 40, 4); -} - -static void test_pack_PPOINTFLOAT(void) -{ - /* PPOINTFLOAT */ - TEST_TYPE(PPOINTFLOAT, 4, 4); - TEST_TYPE_POINTER(PPOINTFLOAT, 8, 4); -} - -static void test_pack_PPOLYTEXTA(void) -{ - /* PPOLYTEXTA */ - TEST_TYPE(PPOLYTEXTA, 4, 4); - TEST_TYPE_POINTER(PPOLYTEXTA, 40, 4); -} - -static void test_pack_PPOLYTEXTW(void) -{ - /* PPOLYTEXTW */ - TEST_TYPE(PPOLYTEXTW, 4, 4); - TEST_TYPE_POINTER(PPOLYTEXTW, 40, 4); -} - -static void test_pack_PRGNDATA(void) -{ - /* PRGNDATA */ - TEST_TYPE(PRGNDATA, 4, 4); - TEST_TYPE_POINTER(PRGNDATA, 36, 4); -} - -static void test_pack_PRGNDATAHEADER(void) -{ - /* PRGNDATAHEADER */ - TEST_TYPE(PRGNDATAHEADER, 4, 4); - TEST_TYPE_POINTER(PRGNDATAHEADER, 32, 4); -} - -static void test_pack_PTEXTMETRICA(void) -{ - /* PTEXTMETRICA */ - TEST_TYPE(PTEXTMETRICA, 4, 4); - TEST_TYPE_POINTER(PTEXTMETRICA, 56, 4); -} - -static void test_pack_PTEXTMETRICW(void) -{ - /* PTEXTMETRICW */ - TEST_TYPE(PTEXTMETRICW, 4, 4); - TEST_TYPE_POINTER(PTEXTMETRICW, 60, 4); -} - -static void test_pack_PTRIVERTEX(void) -{ - /* PTRIVERTEX */ - TEST_TYPE(PTRIVERTEX, 4, 4); - TEST_TYPE_POINTER(PTRIVERTEX, 16, 4); -} - -static void test_pack_PXFORM(void) -{ - /* PXFORM */ - TEST_TYPE(PXFORM, 4, 4); - TEST_TYPE_POINTER(PXFORM, 24, 4); -} - -static void test_pack_RASTERIZER_STATUS(void) -{ - /* RASTERIZER_STATUS (pack 4) */ - TEST_TYPE(RASTERIZER_STATUS, 6, 2); - TEST_FIELD(RASTERIZER_STATUS, SHORT, nSize, 0, 2, 2); - TEST_FIELD(RASTERIZER_STATUS, SHORT, wFlags, 2, 2, 2); - TEST_FIELD(RASTERIZER_STATUS, SHORT, nLanguageID, 4, 2, 2); -} - -static void test_pack_RGBQUAD(void) -{ - /* RGBQUAD (pack 4) */ - TEST_TYPE(RGBQUAD, 4, 1); - TEST_FIELD(RGBQUAD, BYTE, rgbBlue, 0, 1, 1); - TEST_FIELD(RGBQUAD, BYTE, rgbGreen, 1, 1, 1); - TEST_FIELD(RGBQUAD, BYTE, rgbRed, 2, 1, 1); - TEST_FIELD(RGBQUAD, BYTE, rgbReserved, 3, 1, 1); -} - -static void test_pack_RGBTRIPLE(void) -{ - /* RGBTRIPLE (pack 4) */ - TEST_TYPE(RGBTRIPLE, 3, 1); - TEST_FIELD(RGBTRIPLE, BYTE, rgbtBlue, 0, 1, 1); - TEST_FIELD(RGBTRIPLE, BYTE, rgbtGreen, 1, 1, 1); - TEST_FIELD(RGBTRIPLE, BYTE, rgbtRed, 2, 1, 1); -} - -static void test_pack_RGNDATA(void) -{ - /* RGNDATA (pack 4) */ - TEST_TYPE(RGNDATA, 36, 4); - TEST_FIELD(RGNDATA, RGNDATAHEADER, rdh, 0, 32, 4); - TEST_FIELD(RGNDATA, char[1], Buffer, 32, 1, 1); -} - -static void test_pack_RGNDATAHEADER(void) -{ - /* RGNDATAHEADER (pack 4) */ - TEST_TYPE(RGNDATAHEADER, 32, 4); - TEST_FIELD(RGNDATAHEADER, DWORD, dwSize, 0, 4, 4); - TEST_FIELD(RGNDATAHEADER, DWORD, iType, 4, 4, 4); - TEST_FIELD(RGNDATAHEADER, DWORD, nCount, 8, 4, 4); - TEST_FIELD(RGNDATAHEADER, DWORD, nRgnSize, 12, 4, 4); - TEST_FIELD(RGNDATAHEADER, RECT, rcBound, 16, 16, 4); -} - -static void test_pack_TEXTMETRICA(void) -{ - /* TEXTMETRICA (pack 4) */ - TEST_TYPE(TEXTMETRICA, 56, 4); - TEST_FIELD(TEXTMETRICA, LONG, tmHeight, 0, 4, 4); - TEST_FIELD(TEXTMETRICA, LONG, tmAscent, 4, 4, 4); - TEST_FIELD(TEXTMETRICA, LONG, tmDescent, 8, 4, 4); - TEST_FIELD(TEXTMETRICA, LONG, tmInternalLeading, 12, 4, 4); - TEST_FIELD(TEXTMETRICA, LONG, tmExternalLeading, 16, 4, 4); - TEST_FIELD(TEXTMETRICA, LONG, tmAveCharWidth, 20, 4, 4); - TEST_FIELD(TEXTMETRICA, LONG, tmMaxCharWidth, 24, 4, 4); - TEST_FIELD(TEXTMETRICA, LONG, tmWeight, 28, 4, 4); - TEST_FIELD(TEXTMETRICA, LONG, tmOverhang, 32, 4, 4); - TEST_FIELD(TEXTMETRICA, LONG, tmDigitizedAspectX, 36, 4, 4); - TEST_FIELD(TEXTMETRICA, LONG, tmDigitizedAspectY, 40, 4, 4); - TEST_FIELD(TEXTMETRICA, BYTE, tmFirstChar, 44, 1, 1); - TEST_FIELD(TEXTMETRICA, BYTE, tmLastChar, 45, 1, 1); - TEST_FIELD(TEXTMETRICA, BYTE, tmDefaultChar, 46, 1, 1); - TEST_FIELD(TEXTMETRICA, BYTE, tmBreakChar, 47, 1, 1); - TEST_FIELD(TEXTMETRICA, BYTE, tmItalic, 48, 1, 1); - TEST_FIELD(TEXTMETRICA, BYTE, tmUnderlined, 49, 1, 1); - TEST_FIELD(TEXTMETRICA, BYTE, tmStruckOut, 50, 1, 1); - TEST_FIELD(TEXTMETRICA, BYTE, tmPitchAndFamily, 51, 1, 1); - TEST_FIELD(TEXTMETRICA, BYTE, tmCharSet, 52, 1, 1); -} - -static void test_pack_TEXTMETRICW(void) -{ - /* TEXTMETRICW (pack 4) */ - TEST_TYPE(TEXTMETRICW, 60, 4); - TEST_FIELD(TEXTMETRICW, LONG, tmHeight, 0, 4, 4); - TEST_FIELD(TEXTMETRICW, LONG, tmAscent, 4, 4, 4); - TEST_FIELD(TEXTMETRICW, LONG, tmDescent, 8, 4, 4); - TEST_FIELD(TEXTMETRICW, LONG, tmInternalLeading, 12, 4, 4); - TEST_FIELD(TEXTMETRICW, LONG, tmExternalLeading, 16, 4, 4); - TEST_FIELD(TEXTMETRICW, LONG, tmAveCharWidth, 20, 4, 4); - TEST_FIELD(TEXTMETRICW, LONG, tmMaxCharWidth, 24, 4, 4); - TEST_FIELD(TEXTMETRICW, LONG, tmWeight, 28, 4, 4); - TEST_FIELD(TEXTMETRICW, LONG, tmOverhang, 32, 4, 4); - TEST_FIELD(TEXTMETRICW, LONG, tmDigitizedAspectX, 36, 4, 4); - TEST_FIELD(TEXTMETRICW, LONG, tmDigitizedAspectY, 40, 4, 4); - TEST_FIELD(TEXTMETRICW, WCHAR, tmFirstChar, 44, 2, 2); - TEST_FIELD(TEXTMETRICW, WCHAR, tmLastChar, 46, 2, 2); - TEST_FIELD(TEXTMETRICW, WCHAR, tmDefaultChar, 48, 2, 2); - TEST_FIELD(TEXTMETRICW, WCHAR, tmBreakChar, 50, 2, 2); - TEST_FIELD(TEXTMETRICW, BYTE, tmItalic, 52, 1, 1); - TEST_FIELD(TEXTMETRICW, BYTE, tmUnderlined, 53, 1, 1); - TEST_FIELD(TEXTMETRICW, BYTE, tmStruckOut, 54, 1, 1); - TEST_FIELD(TEXTMETRICW, BYTE, tmPitchAndFamily, 55, 1, 1); - TEST_FIELD(TEXTMETRICW, BYTE, tmCharSet, 56, 1, 1); -} - -static void test_pack_TRIVERTEX(void) -{ - /* TRIVERTEX (pack 4) */ - TEST_TYPE(TRIVERTEX, 16, 4); - TEST_FIELD(TRIVERTEX, LONG, x, 0, 4, 4); - TEST_FIELD(TRIVERTEX, LONG, y, 4, 4, 4); - TEST_FIELD(TRIVERTEX, COLOR16, Red, 8, 2, 2); - TEST_FIELD(TRIVERTEX, COLOR16, Green, 10, 2, 2); - TEST_FIELD(TRIVERTEX, COLOR16, Blue, 12, 2, 2); - TEST_FIELD(TRIVERTEX, COLOR16, Alpha, 14, 2, 2); -} - -static void test_pack_TTPOLYCURVE(void) -{ - /* TTPOLYCURVE (pack 4) */ - TEST_TYPE(TTPOLYCURVE, 12, 2); - TEST_FIELD(TTPOLYCURVE, WORD, wType, 0, 2, 2); - TEST_FIELD(TTPOLYCURVE, WORD, cpfx, 2, 2, 2); - TEST_FIELD(TTPOLYCURVE, POINTFX[1], apfx, 4, 8, 2); -} - -static void test_pack_TTPOLYGONHEADER(void) -{ - /* TTPOLYGONHEADER (pack 4) */ - TEST_TYPE(TTPOLYGONHEADER, 16, 4); - TEST_FIELD(TTPOLYGONHEADER, DWORD, cb, 0, 4, 4); - TEST_FIELD(TTPOLYGONHEADER, DWORD, dwType, 4, 4, 4); - TEST_FIELD(TTPOLYGONHEADER, POINTFX, pfxStart, 8, 8, 2); -} - -static void test_pack_XFORM(void) -{ - /* XFORM (pack 4) */ - TEST_TYPE(XFORM, 24, 4); - TEST_FIELD(XFORM, FLOAT, eM11, 0, 4, 4); - TEST_FIELD(XFORM, FLOAT, eM12, 4, 4, 4); - TEST_FIELD(XFORM, FLOAT, eM21, 8, 4, 4); - TEST_FIELD(XFORM, FLOAT, eM22, 12, 4, 4); - TEST_FIELD(XFORM, FLOAT, eDx, 16, 4, 4); - TEST_FIELD(XFORM, FLOAT, eDy, 20, 4, 4); -} - -static void test_pack(void) -{ - test_pack_ABC(); - test_pack_ABCFLOAT(); - test_pack_ABORTPROC(); - test_pack_BITMAP(); - test_pack_BITMAPCOREHEADER(); - test_pack_BITMAPCOREINFO(); - test_pack_BITMAPFILEHEADER(); - test_pack_BITMAPINFO(); - test_pack_BITMAPINFOHEADER(); - test_pack_BITMAPV4HEADER(); - test_pack_BITMAPV5HEADER(); - test_pack_BLENDFUNCTION(); - test_pack_CHARSETINFO(); - test_pack_CIEXYZ(); - test_pack_CIEXYZTRIPLE(); - test_pack_COLOR16(); - test_pack_COLORADJUSTMENT(); - test_pack_DEVMODEA(); - test_pack_DEVMODEW(); - test_pack_DIBSECTION(); - test_pack_DISPLAY_DEVICEA(); - test_pack_DISPLAY_DEVICEW(); - test_pack_DOCINFOA(); - test_pack_DOCINFOW(); - test_pack_EMR(); - test_pack_EMRABORTPATH(); - test_pack_EMRANGLEARC(); - test_pack_EMRARC(); - test_pack_EMRARCTO(); - test_pack_EMRBEGINPATH(); - test_pack_EMRBITBLT(); - test_pack_EMRCHORD(); - test_pack_EMRCLOSEFIGURE(); - test_pack_EMRCREATEBRUSHINDIRECT(); - test_pack_EMRCREATECOLORSPACE(); - test_pack_EMRCREATECOLORSPACEW(); - test_pack_EMRCREATEDIBPATTERNBRUSHPT(); - test_pack_EMRCREATEMONOBRUSH(); - test_pack_EMRCREATEPEN(); - test_pack_EMRDELETECOLORSPACE(); - test_pack_EMRDELETEOBJECT(); - test_pack_EMRELLIPSE(); - test_pack_EMRENDPATH(); - test_pack_EMREOF(); - test_pack_EMREXCLUDECLIPRECT(); - test_pack_EMREXTCREATEFONTINDIRECTW(); - test_pack_EMREXTCREATEPEN(); - test_pack_EMREXTFLOODFILL(); - test_pack_EMREXTSELECTCLIPRGN(); - test_pack_EMREXTTEXTOUTA(); - test_pack_EMREXTTEXTOUTW(); - test_pack_EMRFILLPATH(); - test_pack_EMRFILLRGN(); - test_pack_EMRFLATTENPATH(); - test_pack_EMRFORMAT(); - test_pack_EMRFRAMERGN(); - test_pack_EMRGDICOMMENT(); - test_pack_EMRGLSBOUNDEDRECORD(); - test_pack_EMRGLSRECORD(); - test_pack_EMRINTERSECTCLIPRECT(); - test_pack_EMRINVERTRGN(); - test_pack_EMRLINETO(); - test_pack_EMRMASKBLT(); - test_pack_EMRMODIFYWORLDTRANSFORM(); - test_pack_EMRMOVETOEX(); - test_pack_EMROFFSETCLIPRGN(); - test_pack_EMRPAINTRGN(); - test_pack_EMRPIE(); - test_pack_EMRPIXELFORMAT(); - test_pack_EMRPLGBLT(); - test_pack_EMRPOLYBEZIER(); - test_pack_EMRPOLYBEZIER16(); - test_pack_EMRPOLYBEZIERTO(); - test_pack_EMRPOLYBEZIERTO16(); - test_pack_EMRPOLYDRAW(); - test_pack_EMRPOLYDRAW16(); - test_pack_EMRPOLYGON(); - test_pack_EMRPOLYGON16(); - test_pack_EMRPOLYLINE(); - test_pack_EMRPOLYLINE16(); - test_pack_EMRPOLYLINETO(); - test_pack_EMRPOLYLINETO16(); - test_pack_EMRPOLYPOLYGON(); - test_pack_EMRPOLYPOLYGON16(); - test_pack_EMRPOLYPOLYLINE(); - test_pack_EMRPOLYPOLYLINE16(); - test_pack_EMRPOLYTEXTOUTA(); - test_pack_EMRPOLYTEXTOUTW(); - test_pack_EMRREALIZEPALETTE(); - test_pack_EMRRECTANGLE(); - test_pack_EMRRESIZEPALETTE(); - test_pack_EMRRESTOREDC(); - test_pack_EMRROUNDRECT(); - test_pack_EMRSAVEDC(); - test_pack_EMRSCALEVIEWPORTEXTEX(); - test_pack_EMRSCALEWINDOWEXTEX(); - test_pack_EMRSELECTCLIPPATH(); - test_pack_EMRSELECTCOLORSPACE(); - test_pack_EMRSELECTOBJECT(); - test_pack_EMRSELECTPALETTE(); - test_pack_EMRSETARCDIRECTION(); - test_pack_EMRSETBKCOLOR(); - test_pack_EMRSETBKMODE(); - test_pack_EMRSETBRUSHORGEX(); - test_pack_EMRSETCOLORADJUSTMENT(); - test_pack_EMRSETCOLORSPACE(); - test_pack_EMRSETDIBITSTODEVICE(); - test_pack_EMRSETICMMODE(); - test_pack_EMRSETLAYOUT(); - test_pack_EMRSETMAPMODE(); - test_pack_EMRSETMAPPERFLAGS(); - test_pack_EMRSETMETARGN(); - test_pack_EMRSETMITERLIMIT(); - test_pack_EMRSETPIXELV(); - test_pack_EMRSETPOLYFILLMODE(); - test_pack_EMRSETROP2(); - test_pack_EMRSETSTRETCHBLTMODE(); - test_pack_EMRSETTEXTALIGN(); - test_pack_EMRSETTEXTCOLOR(); - test_pack_EMRSETVIEWPORTEXTEX(); - test_pack_EMRSETVIEWPORTORGEX(); - test_pack_EMRSETWINDOWEXTEX(); - test_pack_EMRSETWINDOWORGEX(); - test_pack_EMRSETWORLDTRANSFORM(); - test_pack_EMRSTRETCHBLT(); - test_pack_EMRSTRETCHDIBITS(); - test_pack_EMRSTROKEANDFILLPATH(); - test_pack_EMRSTROKEPATH(); - test_pack_EMRTEXT(); - test_pack_EMRWIDENPATH(); - test_pack_ENHMETAHEADER(); - test_pack_ENHMETARECORD(); - test_pack_ENHMFENUMPROC(); - test_pack_ENUMLOGFONTA(); - test_pack_ENUMLOGFONTEXA(); - test_pack_ENUMLOGFONTEXW(); - test_pack_ENUMLOGFONTW(); - test_pack_EXTLOGFONTA(); - test_pack_EXTLOGFONTW(); - test_pack_EXTLOGPEN(); - test_pack_FIXED(); - test_pack_FONTENUMPROCA(); - test_pack_FONTENUMPROCW(); - test_pack_FONTSIGNATURE(); - test_pack_FXPT16DOT16(); - test_pack_FXPT2DOT30(); - test_pack_GCP_RESULTSA(); - test_pack_GCP_RESULTSW(); - test_pack_GLYPHMETRICS(); - test_pack_GLYPHMETRICSFLOAT(); - test_pack_GOBJENUMPROC(); - test_pack_GRADIENT_RECT(); - test_pack_GRADIENT_TRIANGLE(); - test_pack_HANDLETABLE(); - test_pack_ICMENUMPROCA(); - test_pack_ICMENUMPROCW(); - test_pack_KERNINGPAIR(); - test_pack_LAYERPLANEDESCRIPTOR(); - test_pack_LCSCSTYPE(); - test_pack_LCSGAMUTMATCH(); - test_pack_LINEDDAPROC(); - test_pack_LOCALESIGNATURE(); - test_pack_LOGBRUSH(); - test_pack_LOGCOLORSPACEA(); - test_pack_LOGCOLORSPACEW(); - test_pack_LOGFONTA(); - test_pack_LOGFONTW(); - test_pack_LOGPEN(); - test_pack_LPABC(); - test_pack_LPABCFLOAT(); - test_pack_LPBITMAP(); - test_pack_LPBITMAPCOREHEADER(); - test_pack_LPBITMAPCOREINFO(); - test_pack_LPBITMAPFILEHEADER(); - test_pack_LPBITMAPINFO(); - test_pack_LPBITMAPINFOHEADER(); - test_pack_LPBITMAPV5HEADER(); - test_pack_LPCHARSETINFO(); - test_pack_LPCIEXYZ(); - test_pack_LPCIEXYZTRIPLE(); - test_pack_LPCOLORADJUSTMENT(); - test_pack_LPDEVMODEA(); - test_pack_LPDEVMODEW(); - test_pack_LPDIBSECTION(); - test_pack_LPDISPLAY_DEVICEA(); - test_pack_LPDISPLAY_DEVICEW(); - test_pack_LPDOCINFOA(); - test_pack_LPDOCINFOW(); - test_pack_LPENHMETAHEADER(); - test_pack_LPENHMETARECORD(); - test_pack_LPENUMLOGFONTA(); - test_pack_LPENUMLOGFONTEXA(); - test_pack_LPENUMLOGFONTEXW(); - test_pack_LPENUMLOGFONTW(); - test_pack_LPEXTLOGFONTA(); - test_pack_LPEXTLOGFONTW(); - test_pack_LPEXTLOGPEN(); - test_pack_LPFONTSIGNATURE(); - test_pack_LPGCP_RESULTSA(); - test_pack_LPGCP_RESULTSW(); - test_pack_LPGLYPHMETRICS(); - test_pack_LPGLYPHMETRICSFLOAT(); - test_pack_LPGRADIENT_RECT(); - test_pack_LPGRADIENT_TRIANGLE(); - test_pack_LPHANDLETABLE(); - test_pack_LPKERNINGPAIR(); - test_pack_LPLAYERPLANEDESCRIPTOR(); - test_pack_LPLOCALESIGNATURE(); - test_pack_LPLOGBRUSH(); - test_pack_LPLOGCOLORSPACEA(); - test_pack_LPLOGCOLORSPACEW(); - test_pack_LPLOGFONTA(); - test_pack_LPLOGFONTW(); - test_pack_LPLOGPEN(); - test_pack_LPMAT2(); - test_pack_LPMETAFILEPICT(); - test_pack_LPMETAHEADER(); - test_pack_LPMETARECORD(); - test_pack_LPNEWTEXTMETRICA(); - test_pack_LPNEWTEXTMETRICW(); - test_pack_LPOUTLINETEXTMETRICA(); - test_pack_LPOUTLINETEXTMETRICW(); - test_pack_LPPANOSE(); - test_pack_LPPELARRAY(); - test_pack_LPPIXELFORMATDESCRIPTOR(); - test_pack_LPPOINTFX(); - test_pack_LPPOLYTEXTA(); - test_pack_LPPOLYTEXTW(); - test_pack_LPRASTERIZER_STATUS(); - test_pack_LPRGBQUAD(); - test_pack_LPRGNDATA(); - test_pack_LPTEXTMETRICA(); - test_pack_LPTEXTMETRICW(); - test_pack_LPTRIVERTEX(); - test_pack_LPTTPOLYCURVE(); - test_pack_LPTTPOLYGONHEADER(); - test_pack_LPXFORM(); - test_pack_MAT2(); - test_pack_METAFILEPICT(); - test_pack_METAHEADER(); - test_pack_METARECORD(); - test_pack_MFENUMPROC(); - test_pack_NEWTEXTMETRICA(); - test_pack_NEWTEXTMETRICEXA(); - test_pack_NEWTEXTMETRICEXW(); - test_pack_NEWTEXTMETRICW(); - test_pack_NPEXTLOGPEN(); - test_pack_OLDFONTENUMPROC(); - test_pack_OLDFONTENUMPROCA(); - test_pack_OLDFONTENUMPROCW(); - test_pack_OUTLINETEXTMETRICA(); - test_pack_OUTLINETEXTMETRICW(); - test_pack_PABC(); - test_pack_PABCFLOAT(); - test_pack_PANOSE(); - test_pack_PATTERN(); - test_pack_PBITMAP(); - test_pack_PBITMAPCOREHEADER(); - test_pack_PBITMAPCOREINFO(); - test_pack_PBITMAPFILEHEADER(); - test_pack_PBITMAPINFO(); - test_pack_PBITMAPINFOHEADER(); - test_pack_PBITMAPV4HEADER(); - test_pack_PBITMAPV5HEADER(); - test_pack_PBLENDFUNCTION(); - test_pack_PCHARSETINFO(); - test_pack_PCOLORADJUSTMENT(); - test_pack_PDEVMODEA(); - test_pack_PDEVMODEW(); - test_pack_PDIBSECTION(); - test_pack_PDISPLAY_DEVICEA(); - test_pack_PDISPLAY_DEVICEW(); - test_pack_PELARRAY(); - test_pack_PEMR(); - test_pack_PEMRABORTPATH(); - test_pack_PEMRANGLEARC(); - test_pack_PEMRARC(); - test_pack_PEMRARCTO(); - test_pack_PEMRBEGINPATH(); - test_pack_PEMRBITBLT(); - test_pack_PEMRCHORD(); - test_pack_PEMRCLOSEFIGURE(); - test_pack_PEMRCREATEBRUSHINDIRECT(); - test_pack_PEMRCREATECOLORSPACE(); - test_pack_PEMRCREATECOLORSPACEW(); - test_pack_PEMRCREATEDIBPATTERNBRUSHPT(); - test_pack_PEMRCREATEMONOBRUSH(); - test_pack_PEMRCREATEPALETTE(); - test_pack_PEMRCREATEPEN(); - test_pack_PEMRDELETECOLORSPACE(); - test_pack_PEMRDELETEOBJECT(); - test_pack_PEMRELLIPSE(); - test_pack_PEMRENDPATH(); - test_pack_PEMREOF(); - test_pack_PEMREXCLUDECLIPRECT(); - test_pack_PEMREXTCREATEFONTINDIRECTW(); - test_pack_PEMREXTCREATEPEN(); - test_pack_PEMREXTFLOODFILL(); - test_pack_PEMREXTSELECTCLIPRGN(); - test_pack_PEMREXTTEXTOUTA(); - test_pack_PEMREXTTEXTOUTW(); - test_pack_PEMRFILLPATH(); - test_pack_PEMRFILLRGN(); - test_pack_PEMRFLATTENPATH(); - test_pack_PEMRFORMAT(); - test_pack_PEMRFRAMERGN(); - test_pack_PEMRGDICOMMENT(); - test_pack_PEMRGLSBOUNDEDRECORD(); - test_pack_PEMRGLSRECORD(); - test_pack_PEMRINTERSECTCLIPRECT(); - test_pack_PEMRINVERTRGN(); - test_pack_PEMRLINETO(); - test_pack_PEMRMASKBLT(); - test_pack_PEMRMODIFYWORLDTRANSFORM(); - test_pack_PEMRMOVETOEX(); - test_pack_PEMROFFSETCLIPRGN(); - test_pack_PEMRPAINTRGN(); - test_pack_PEMRPIE(); - test_pack_PEMRPIXELFORMAT(); - test_pack_PEMRPLGBLT(); - test_pack_PEMRPOLYBEZIER(); - test_pack_PEMRPOLYBEZIER16(); - test_pack_PEMRPOLYBEZIERTO(); - test_pack_PEMRPOLYBEZIERTO16(); - test_pack_PEMRPOLYDRAW(); - test_pack_PEMRPOLYDRAW16(); - test_pack_PEMRPOLYGON(); - test_pack_PEMRPOLYGON16(); - test_pack_PEMRPOLYLINE(); - test_pack_PEMRPOLYLINE16(); - test_pack_PEMRPOLYLINETO(); - test_pack_PEMRPOLYLINETO16(); - test_pack_PEMRPOLYPOLYGON(); - test_pack_PEMRPOLYPOLYGON16(); - test_pack_PEMRPOLYPOLYLINE(); - test_pack_PEMRPOLYPOLYLINE16(); - test_pack_PEMRPOLYTEXTOUTA(); - test_pack_PEMRPOLYTEXTOUTW(); - test_pack_PEMRREALIZEPALETTE(); - test_pack_PEMRRECTANGLE(); - test_pack_PEMRRESIZEPALETTE(); - test_pack_PEMRRESTOREDC(); - test_pack_PEMRROUNDRECT(); - test_pack_PEMRSAVEDC(); - test_pack_PEMRSCALEVIEWPORTEXTEX(); - test_pack_PEMRSCALEWINDOWEXTEX(); - test_pack_PEMRSELECTCLIPPATH(); - test_pack_PEMRSELECTCOLORSPACE(); - test_pack_PEMRSELECTOBJECT(); - test_pack_PEMRSELECTPALETTE(); - test_pack_PEMRSETARCDIRECTION(); - test_pack_PEMRSETBKCOLOR(); - test_pack_PEMRSETBKMODE(); - test_pack_PEMRSETBRUSHORGEX(); - test_pack_PEMRSETCOLORADJUSTMENT(); - test_pack_PEMRSETCOLORSPACE(); - test_pack_PEMRSETDIBITSTODEVICE(); - test_pack_PEMRSETICMMODE(); - test_pack_PEMRSETLAYOUT(); - test_pack_PEMRSETMAPMODE(); - test_pack_PEMRSETMAPPERFLAGS(); - test_pack_PEMRSETMETARGN(); - test_pack_PEMRSETMITERLIMIT(); - test_pack_PEMRSETPALETTEENTRIES(); - test_pack_PEMRSETPIXELV(); - test_pack_PEMRSETPOLYFILLMODE(); - test_pack_PEMRSETROP2(); - test_pack_PEMRSETSTRETCHBLTMODE(); - test_pack_PEMRSETTEXTALIGN(); - test_pack_PEMRSETTEXTCOLOR(); - test_pack_PEMRSETVIEWPORTEXTEX(); - test_pack_PEMRSETVIEWPORTORGEX(); - test_pack_PEMRSETWINDOWEXTEX(); - test_pack_PEMRSETWINDOWORGEX(); - test_pack_PEMRSETWORLDTRANSFORM(); - test_pack_PEMRSTRETCHBLT(); - test_pack_PEMRSTRETCHDIBITS(); - test_pack_PEMRSTROKEANDFILLPATH(); - test_pack_PEMRSTROKEPATH(); - test_pack_PEMRTEXT(); - test_pack_PEMRWIDENPATH(); - test_pack_PENHMETAHEADER(); - test_pack_PEXTLOGFONTA(); - test_pack_PEXTLOGFONTW(); - test_pack_PEXTLOGPEN(); - test_pack_PFONTSIGNATURE(); - test_pack_PGLYPHMETRICSFLOAT(); - test_pack_PGRADIENT_RECT(); - test_pack_PGRADIENT_TRIANGLE(); - test_pack_PHANDLETABLE(); - test_pack_PIXELFORMATDESCRIPTOR(); - test_pack_PLAYERPLANEDESCRIPTOR(); - test_pack_PLOCALESIGNATURE(); - test_pack_PLOGBRUSH(); - test_pack_PLOGFONTA(); - test_pack_PLOGFONTW(); - test_pack_PMETAHEADER(); - test_pack_PMETARECORD(); - test_pack_PNEWTEXTMETRICA(); - test_pack_PNEWTEXTMETRICW(); - test_pack_POINTFLOAT(); - test_pack_POINTFX(); - test_pack_POLYTEXTA(); - test_pack_POLYTEXTW(); - test_pack_POUTLINETEXTMETRICA(); - test_pack_POUTLINETEXTMETRICW(); - test_pack_PPELARRAY(); - test_pack_PPIXELFORMATDESCRIPTOR(); - test_pack_PPOINTFLOAT(); - test_pack_PPOLYTEXTA(); - test_pack_PPOLYTEXTW(); - test_pack_PRGNDATA(); - test_pack_PRGNDATAHEADER(); - test_pack_PTEXTMETRICA(); - test_pack_PTEXTMETRICW(); - test_pack_PTRIVERTEX(); - test_pack_PXFORM(); - test_pack_RASTERIZER_STATUS(); - test_pack_RGBQUAD(); - test_pack_RGBTRIPLE(); - test_pack_RGNDATA(); - test_pack_RGNDATAHEADER(); - test_pack_TEXTMETRICA(); - test_pack_TEXTMETRICW(); - test_pack_TRIVERTEX(); - test_pack_TTPOLYCURVE(); - test_pack_TTPOLYGONHEADER(); - test_pack_XFORM(); -} - -START_TEST(generated) -{ - test_pack(); -} +/* File generated automatically from tools/winapi/tests.dat; do not edit! */ +/* This file can be copied, modified and distributed without restriction. */ + +/* + * Unit tests for data structure packing + */ + +#define WINVER 0x0501 +#define _WIN32_IE 0x0501 +#define _WIN32_WINNT 0x0501 + +#define WINE_NOWINSOCK + +#include "windows.h" + +#include "wine/test.h" + +/*********************************************************************** + * Compatibility macros + */ + +#define DWORD_PTR UINT_PTR +#define LONG_PTR INT_PTR +#define ULONG_PTR UINT_PTR + +/*********************************************************************** + * Windows API extension + */ + +#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) +# define _TYPE_ALIGNMENT(type) __alignof(type) +#elif defined(__GNUC__) +# define _TYPE_ALIGNMENT(type) __alignof__(type) +#else +/* + * FIXME: May not be possible without a compiler extension + * (if type is not just a name that is, otherwise the normal + * TYPE_ALIGNMENT can be used) + */ +#endif + +#if defined(TYPE_ALIGNMENT) && defined(_MSC_VER) && _MSC_VER >= 800 && !defined(__cplusplus) +#pragma warning(disable:4116) +#endif + +#if !defined(TYPE_ALIGNMENT) && defined(_TYPE_ALIGNMENT) +# define TYPE_ALIGNMENT _TYPE_ALIGNMENT +#endif + +/*********************************************************************** + * Test helper macros + */ + +#ifdef _WIN64 + +# define TEST_TYPE_SIZE(type, size) +# define TEST_TYPE_ALIGN(type, align) +# define TEST_TARGET_ALIGN(type, align) +# define TEST_FIELD_ALIGN(type, field, align) +# define TEST_FIELD_OFFSET(type, field, offset) + +#else + +# define TEST_TYPE_SIZE(type, size) C_ASSERT(sizeof(type) == size); + +# ifdef TYPE_ALIGNMENT +# define TEST_TYPE_ALIGN(type, align) C_ASSERT(TYPE_ALIGNMENT(type) == align); +# else +# define TEST_TYPE_ALIGN(type, align) +# endif + +# ifdef _TYPE_ALIGNMENT +# define TEST_TARGET_ALIGN(type, align) C_ASSERT(_TYPE_ALIGNMENT(*(type)0) == align); +# define TEST_FIELD_ALIGN(type, field, align) C_ASSERT(_TYPE_ALIGNMENT(((type*)0)->field) == align); +# else +# define TEST_TARGET_ALIGN(type, align) +# define TEST_FIELD_ALIGN(type, field, align) +# endif + +# define TEST_FIELD_OFFSET(type, field, offset) C_ASSERT(FIELD_OFFSET(type, field) == offset); + +#endif + +#define TEST_TARGET_SIZE(type, size) TEST_TYPE_SIZE(*(type)0, size) +#define TEST_FIELD_SIZE(type, field, size) TEST_TYPE_SIZE((((type*)0)->field), size) +#define TEST_TYPE_SIGNED(type) C_ASSERT((type) -1 < 0); +#define TEST_TYPE_UNSIGNED(type) C_ASSERT((type) -1 > 0); + + +static void test_pack_ABC(void) +{ + /* ABC (pack 4) */ + TEST_TYPE_SIZE (ABC, 12) + TEST_TYPE_ALIGN (ABC, 4) + TEST_FIELD_SIZE (ABC, abcA, 4) + TEST_FIELD_ALIGN (ABC, abcA, 4) + TEST_FIELD_OFFSET(ABC, abcA, 0) + TEST_FIELD_SIZE (ABC, abcB, 4) + TEST_FIELD_ALIGN (ABC, abcB, 4) + TEST_FIELD_OFFSET(ABC, abcB, 4) + TEST_FIELD_SIZE (ABC, abcC, 4) + TEST_FIELD_ALIGN (ABC, abcC, 4) + TEST_FIELD_OFFSET(ABC, abcC, 8) +} + +static void test_pack_ABCFLOAT(void) +{ + /* ABCFLOAT (pack 4) */ + TEST_TYPE_SIZE (ABCFLOAT, 12) + TEST_TYPE_ALIGN (ABCFLOAT, 4) + TEST_FIELD_SIZE (ABCFLOAT, abcfA, 4) + TEST_FIELD_ALIGN (ABCFLOAT, abcfA, 4) + TEST_FIELD_OFFSET(ABCFLOAT, abcfA, 0) + TEST_FIELD_SIZE (ABCFLOAT, abcfB, 4) + TEST_FIELD_ALIGN (ABCFLOAT, abcfB, 4) + TEST_FIELD_OFFSET(ABCFLOAT, abcfB, 4) + TEST_FIELD_SIZE (ABCFLOAT, abcfC, 4) + TEST_FIELD_ALIGN (ABCFLOAT, abcfC, 4) + TEST_FIELD_OFFSET(ABCFLOAT, abcfC, 8) +} + +static void test_pack_ABORTPROC(void) +{ + /* ABORTPROC */ + TEST_TYPE_SIZE (ABORTPROC, 4) + TEST_TYPE_ALIGN (ABORTPROC, 4) +} + +static void test_pack_BITMAP(void) +{ + /* BITMAP (pack 4) */ + TEST_TYPE_SIZE (BITMAP, 24) + TEST_TYPE_ALIGN (BITMAP, 4) + TEST_FIELD_SIZE (BITMAP, bmType, 4) + TEST_FIELD_ALIGN (BITMAP, bmType, 4) + TEST_FIELD_OFFSET(BITMAP, bmType, 0) + TEST_FIELD_SIZE (BITMAP, bmWidth, 4) + TEST_FIELD_ALIGN (BITMAP, bmWidth, 4) + TEST_FIELD_OFFSET(BITMAP, bmWidth, 4) + TEST_FIELD_SIZE (BITMAP, bmHeight, 4) + TEST_FIELD_ALIGN (BITMAP, bmHeight, 4) + TEST_FIELD_OFFSET(BITMAP, bmHeight, 8) + TEST_FIELD_SIZE (BITMAP, bmWidthBytes, 4) + TEST_FIELD_ALIGN (BITMAP, bmWidthBytes, 4) + TEST_FIELD_OFFSET(BITMAP, bmWidthBytes, 12) + TEST_FIELD_SIZE (BITMAP, bmPlanes, 2) + TEST_FIELD_ALIGN (BITMAP, bmPlanes, 2) + TEST_FIELD_OFFSET(BITMAP, bmPlanes, 16) + TEST_FIELD_SIZE (BITMAP, bmBitsPixel, 2) + TEST_FIELD_ALIGN (BITMAP, bmBitsPixel, 2) + TEST_FIELD_OFFSET(BITMAP, bmBitsPixel, 18) + TEST_FIELD_SIZE (BITMAP, bmBits, 4) + TEST_FIELD_ALIGN (BITMAP, bmBits, 4) + TEST_FIELD_OFFSET(BITMAP, bmBits, 20) +} + +static void test_pack_BITMAPCOREHEADER(void) +{ + /* BITMAPCOREHEADER (pack 4) */ + TEST_TYPE_SIZE (BITMAPCOREHEADER, 12) + TEST_TYPE_ALIGN (BITMAPCOREHEADER, 4) + TEST_FIELD_SIZE (BITMAPCOREHEADER, bcSize, 4) + TEST_FIELD_ALIGN (BITMAPCOREHEADER, bcSize, 4) + TEST_FIELD_OFFSET(BITMAPCOREHEADER, bcSize, 0) + TEST_FIELD_SIZE (BITMAPCOREHEADER, bcWidth, 2) + TEST_FIELD_ALIGN (BITMAPCOREHEADER, bcWidth, 2) + TEST_FIELD_OFFSET(BITMAPCOREHEADER, bcWidth, 4) + TEST_FIELD_SIZE (BITMAPCOREHEADER, bcHeight, 2) + TEST_FIELD_ALIGN (BITMAPCOREHEADER, bcHeight, 2) + TEST_FIELD_OFFSET(BITMAPCOREHEADER, bcHeight, 6) + TEST_FIELD_SIZE (BITMAPCOREHEADER, bcPlanes, 2) + TEST_FIELD_ALIGN (BITMAPCOREHEADER, bcPlanes, 2) + TEST_FIELD_OFFSET(BITMAPCOREHEADER, bcPlanes, 8) + TEST_FIELD_SIZE (BITMAPCOREHEADER, bcBitCount, 2) + TEST_FIELD_ALIGN (BITMAPCOREHEADER, bcBitCount, 2) + TEST_FIELD_OFFSET(BITMAPCOREHEADER, bcBitCount, 10) +} + +static void test_pack_BITMAPCOREINFO(void) +{ + /* BITMAPCOREINFO (pack 4) */ + TEST_TYPE_SIZE (BITMAPCOREINFO, 16) + TEST_TYPE_ALIGN (BITMAPCOREINFO, 4) + TEST_FIELD_SIZE (BITMAPCOREINFO, bmciHeader, 12) + TEST_FIELD_ALIGN (BITMAPCOREINFO, bmciHeader, 4) + TEST_FIELD_OFFSET(BITMAPCOREINFO, bmciHeader, 0) + TEST_FIELD_SIZE (BITMAPCOREINFO, bmciColors, 3) + TEST_FIELD_ALIGN (BITMAPCOREINFO, bmciColors, 1) + TEST_FIELD_OFFSET(BITMAPCOREINFO, bmciColors, 12) +} + +static void test_pack_BITMAPFILEHEADER(void) +{ + /* BITMAPFILEHEADER (pack 2) */ + TEST_TYPE_SIZE (BITMAPFILEHEADER, 14) + TEST_TYPE_ALIGN (BITMAPFILEHEADER, 2) + TEST_FIELD_SIZE (BITMAPFILEHEADER, bfType, 2) + TEST_FIELD_ALIGN (BITMAPFILEHEADER, bfType, 2) + TEST_FIELD_OFFSET(BITMAPFILEHEADER, bfType, 0) + TEST_FIELD_SIZE (BITMAPFILEHEADER, bfSize, 4) + TEST_FIELD_ALIGN (BITMAPFILEHEADER, bfSize, 2) + TEST_FIELD_OFFSET(BITMAPFILEHEADER, bfSize, 2) + TEST_FIELD_SIZE (BITMAPFILEHEADER, bfReserved1, 2) + TEST_FIELD_ALIGN (BITMAPFILEHEADER, bfReserved1, 2) + TEST_FIELD_OFFSET(BITMAPFILEHEADER, bfReserved1, 6) + TEST_FIELD_SIZE (BITMAPFILEHEADER, bfReserved2, 2) + TEST_FIELD_ALIGN (BITMAPFILEHEADER, bfReserved2, 2) + TEST_FIELD_OFFSET(BITMAPFILEHEADER, bfReserved2, 8) + TEST_FIELD_SIZE (BITMAPFILEHEADER, bfOffBits, 4) + TEST_FIELD_ALIGN (BITMAPFILEHEADER, bfOffBits, 2) + TEST_FIELD_OFFSET(BITMAPFILEHEADER, bfOffBits, 10) +} + +static void test_pack_BITMAPINFO(void) +{ + /* BITMAPINFO (pack 4) */ + TEST_TYPE_SIZE (BITMAPINFO, 44) + TEST_TYPE_ALIGN (BITMAPINFO, 4) + TEST_FIELD_SIZE (BITMAPINFO, bmiHeader, 40) + TEST_FIELD_ALIGN (BITMAPINFO, bmiHeader, 4) + TEST_FIELD_OFFSET(BITMAPINFO, bmiHeader, 0) + TEST_FIELD_SIZE (BITMAPINFO, bmiColors, 4) + TEST_FIELD_ALIGN (BITMAPINFO, bmiColors, 1) + TEST_FIELD_OFFSET(BITMAPINFO, bmiColors, 40) +} + +static void test_pack_BITMAPINFOHEADER(void) +{ + /* BITMAPINFOHEADER (pack 4) */ + TEST_TYPE_SIZE (BITMAPINFOHEADER, 40) + TEST_TYPE_ALIGN (BITMAPINFOHEADER, 4) + TEST_FIELD_SIZE (BITMAPINFOHEADER, biSize, 4) + TEST_FIELD_ALIGN (BITMAPINFOHEADER, biSize, 4) + TEST_FIELD_OFFSET(BITMAPINFOHEADER, biSize, 0) + TEST_FIELD_SIZE (BITMAPINFOHEADER, biWidth, 4) + TEST_FIELD_ALIGN (BITMAPINFOHEADER, biWidth, 4) + TEST_FIELD_OFFSET(BITMAPINFOHEADER, biWidth, 4) + TEST_FIELD_SIZE (BITMAPINFOHEADER, biHeight, 4) + TEST_FIELD_ALIGN (BITMAPINFOHEADER, biHeight, 4) + TEST_FIELD_OFFSET(BITMAPINFOHEADER, biHeight, 8) + TEST_FIELD_SIZE (BITMAPINFOHEADER, biPlanes, 2) + TEST_FIELD_ALIGN (BITMAPINFOHEADER, biPlanes, 2) + TEST_FIELD_OFFSET(BITMAPINFOHEADER, biPlanes, 12) + TEST_FIELD_SIZE (BITMAPINFOHEADER, biBitCount, 2) + TEST_FIELD_ALIGN (BITMAPINFOHEADER, biBitCount, 2) + TEST_FIELD_OFFSET(BITMAPINFOHEADER, biBitCount, 14) + TEST_FIELD_SIZE (BITMAPINFOHEADER, biCompression, 4) + TEST_FIELD_ALIGN (BITMAPINFOHEADER, biCompression, 4) + TEST_FIELD_OFFSET(BITMAPINFOHEADER, biCompression, 16) + TEST_FIELD_SIZE (BITMAPINFOHEADER, biSizeImage, 4) + TEST_FIELD_ALIGN (BITMAPINFOHEADER, biSizeImage, 4) + TEST_FIELD_OFFSET(BITMAPINFOHEADER, biSizeImage, 20) + TEST_FIELD_SIZE (BITMAPINFOHEADER, biXPelsPerMeter, 4) + TEST_FIELD_ALIGN (BITMAPINFOHEADER, biXPelsPerMeter, 4) + TEST_FIELD_OFFSET(BITMAPINFOHEADER, biXPelsPerMeter, 24) + TEST_FIELD_SIZE (BITMAPINFOHEADER, biYPelsPerMeter, 4) + TEST_FIELD_ALIGN (BITMAPINFOHEADER, biYPelsPerMeter, 4) + TEST_FIELD_OFFSET(BITMAPINFOHEADER, biYPelsPerMeter, 28) + TEST_FIELD_SIZE (BITMAPINFOHEADER, biClrUsed, 4) + TEST_FIELD_ALIGN (BITMAPINFOHEADER, biClrUsed, 4) + TEST_FIELD_OFFSET(BITMAPINFOHEADER, biClrUsed, 32) + TEST_FIELD_SIZE (BITMAPINFOHEADER, biClrImportant, 4) + TEST_FIELD_ALIGN (BITMAPINFOHEADER, biClrImportant, 4) + TEST_FIELD_OFFSET(BITMAPINFOHEADER, biClrImportant, 36) +} + +static void test_pack_BITMAPV4HEADER(void) +{ + /* BITMAPV4HEADER (pack 4) */ + TEST_TYPE_SIZE (BITMAPV4HEADER, 108) + TEST_TYPE_ALIGN (BITMAPV4HEADER, 4) + TEST_FIELD_SIZE (BITMAPV4HEADER, bV4Size, 4) + TEST_FIELD_ALIGN (BITMAPV4HEADER, bV4Size, 4) + TEST_FIELD_OFFSET(BITMAPV4HEADER, bV4Size, 0) + TEST_FIELD_SIZE (BITMAPV4HEADER, bV4Width, 4) + TEST_FIELD_ALIGN (BITMAPV4HEADER, bV4Width, 4) + TEST_FIELD_OFFSET(BITMAPV4HEADER, bV4Width, 4) + TEST_FIELD_SIZE (BITMAPV4HEADER, bV4Height, 4) + TEST_FIELD_ALIGN (BITMAPV4HEADER, bV4Height, 4) + TEST_FIELD_OFFSET(BITMAPV4HEADER, bV4Height, 8) + TEST_FIELD_SIZE (BITMAPV4HEADER, bV4Planes, 2) + TEST_FIELD_ALIGN (BITMAPV4HEADER, bV4Planes, 2) + TEST_FIELD_OFFSET(BITMAPV4HEADER, bV4Planes, 12) + TEST_FIELD_SIZE (BITMAPV4HEADER, bV4BitCount, 2) + TEST_FIELD_ALIGN (BITMAPV4HEADER, bV4BitCount, 2) + TEST_FIELD_OFFSET(BITMAPV4HEADER, bV4BitCount, 14) + TEST_FIELD_SIZE (BITMAPV4HEADER, bV4V4Compression, 4) + TEST_FIELD_ALIGN (BITMAPV4HEADER, bV4V4Compression, 4) + TEST_FIELD_OFFSET(BITMAPV4HEADER, bV4V4Compression, 16) + TEST_FIELD_SIZE (BITMAPV4HEADER, bV4SizeImage, 4) + TEST_FIELD_ALIGN (BITMAPV4HEADER, bV4SizeImage, 4) + TEST_FIELD_OFFSET(BITMAPV4HEADER, bV4SizeImage, 20) + TEST_FIELD_SIZE (BITMAPV4HEADER, bV4XPelsPerMeter, 4) + TEST_FIELD_ALIGN (BITMAPV4HEADER, bV4XPelsPerMeter, 4) + TEST_FIELD_OFFSET(BITMAPV4HEADER, bV4XPelsPerMeter, 24) + TEST_FIELD_SIZE (BITMAPV4HEADER, bV4YPelsPerMeter, 4) + TEST_FIELD_ALIGN (BITMAPV4HEADER, bV4YPelsPerMeter, 4) + TEST_FIELD_OFFSET(BITMAPV4HEADER, bV4YPelsPerMeter, 28) + TEST_FIELD_SIZE (BITMAPV4HEADER, bV4ClrUsed, 4) + TEST_FIELD_ALIGN (BITMAPV4HEADER, bV4ClrUsed, 4) + TEST_FIELD_OFFSET(BITMAPV4HEADER, bV4ClrUsed, 32) + TEST_FIELD_SIZE (BITMAPV4HEADER, bV4ClrImportant, 4) + TEST_FIELD_ALIGN (BITMAPV4HEADER, bV4ClrImportant, 4) + TEST_FIELD_OFFSET(BITMAPV4HEADER, bV4ClrImportant, 36) + TEST_FIELD_SIZE (BITMAPV4HEADER, bV4RedMask, 4) + TEST_FIELD_ALIGN (BITMAPV4HEADER, bV4RedMask, 4) + TEST_FIELD_OFFSET(BITMAPV4HEADER, bV4RedMask, 40) + TEST_FIELD_SIZE (BITMAPV4HEADER, bV4GreenMask, 4) + TEST_FIELD_ALIGN (BITMAPV4HEADER, bV4GreenMask, 4) + TEST_FIELD_OFFSET(BITMAPV4HEADER, bV4GreenMask, 44) + TEST_FIELD_SIZE (BITMAPV4HEADER, bV4BlueMask, 4) + TEST_FIELD_ALIGN (BITMAPV4HEADER, bV4BlueMask, 4) + TEST_FIELD_OFFSET(BITMAPV4HEADER, bV4BlueMask, 48) + TEST_FIELD_SIZE (BITMAPV4HEADER, bV4AlphaMask, 4) + TEST_FIELD_ALIGN (BITMAPV4HEADER, bV4AlphaMask, 4) + TEST_FIELD_OFFSET(BITMAPV4HEADER, bV4AlphaMask, 52) + TEST_FIELD_SIZE (BITMAPV4HEADER, bV4CSType, 4) + TEST_FIELD_ALIGN (BITMAPV4HEADER, bV4CSType, 4) + TEST_FIELD_OFFSET(BITMAPV4HEADER, bV4CSType, 56) + TEST_FIELD_SIZE (BITMAPV4HEADER, bV4Endpoints, 36) + TEST_FIELD_ALIGN (BITMAPV4HEADER, bV4Endpoints, 4) + TEST_FIELD_OFFSET(BITMAPV4HEADER, bV4Endpoints, 60) + TEST_FIELD_SIZE (BITMAPV4HEADER, bV4GammaRed, 4) + TEST_FIELD_ALIGN (BITMAPV4HEADER, bV4GammaRed, 4) + TEST_FIELD_OFFSET(BITMAPV4HEADER, bV4GammaRed, 96) + TEST_FIELD_SIZE (BITMAPV4HEADER, bV4GammaGreen, 4) + TEST_FIELD_ALIGN (BITMAPV4HEADER, bV4GammaGreen, 4) + TEST_FIELD_OFFSET(BITMAPV4HEADER, bV4GammaGreen, 100) + TEST_FIELD_SIZE (BITMAPV4HEADER, bV4GammaBlue, 4) + TEST_FIELD_ALIGN (BITMAPV4HEADER, bV4GammaBlue, 4) + TEST_FIELD_OFFSET(BITMAPV4HEADER, bV4GammaBlue, 104) +} + +static void test_pack_BITMAPV5HEADER(void) +{ + /* BITMAPV5HEADER (pack 4) */ + TEST_TYPE_SIZE (BITMAPV5HEADER, 124) + TEST_TYPE_ALIGN (BITMAPV5HEADER, 4) + TEST_FIELD_SIZE (BITMAPV5HEADER, bV5Size, 4) + TEST_FIELD_ALIGN (BITMAPV5HEADER, bV5Size, 4) + TEST_FIELD_OFFSET(BITMAPV5HEADER, bV5Size, 0) + TEST_FIELD_SIZE (BITMAPV5HEADER, bV5Width, 4) + TEST_FIELD_ALIGN (BITMAPV5HEADER, bV5Width, 4) + TEST_FIELD_OFFSET(BITMAPV5HEADER, bV5Width, 4) + TEST_FIELD_SIZE (BITMAPV5HEADER, bV5Height, 4) + TEST_FIELD_ALIGN (BITMAPV5HEADER, bV5Height, 4) + TEST_FIELD_OFFSET(BITMAPV5HEADER, bV5Height, 8) + TEST_FIELD_SIZE (BITMAPV5HEADER, bV5Planes, 2) + TEST_FIELD_ALIGN (BITMAPV5HEADER, bV5Planes, 2) + TEST_FIELD_OFFSET(BITMAPV5HEADER, bV5Planes, 12) + TEST_FIELD_SIZE (BITMAPV5HEADER, bV5BitCount, 2) + TEST_FIELD_ALIGN (BITMAPV5HEADER, bV5BitCount, 2) + TEST_FIELD_OFFSET(BITMAPV5HEADER, bV5BitCount, 14) + TEST_FIELD_SIZE (BITMAPV5HEADER, bV5Compression, 4) + TEST_FIELD_ALIGN (BITMAPV5HEADER, bV5Compression, 4) + TEST_FIELD_OFFSET(BITMAPV5HEADER, bV5Compression, 16) + TEST_FIELD_SIZE (BITMAPV5HEADER, bV5SizeImage, 4) + TEST_FIELD_ALIGN (BITMAPV5HEADER, bV5SizeImage, 4) + TEST_FIELD_OFFSET(BITMAPV5HEADER, bV5SizeImage, 20) + TEST_FIELD_SIZE (BITMAPV5HEADER, bV5XPelsPerMeter, 4) + TEST_FIELD_ALIGN (BITMAPV5HEADER, bV5XPelsPerMeter, 4) + TEST_FIELD_OFFSET(BITMAPV5HEADER, bV5XPelsPerMeter, 24) + TEST_FIELD_SIZE (BITMAPV5HEADER, bV5YPelsPerMeter, 4) + TEST_FIELD_ALIGN (BITMAPV5HEADER, bV5YPelsPerMeter, 4) + TEST_FIELD_OFFSET(BITMAPV5HEADER, bV5YPelsPerMeter, 28) + TEST_FIELD_SIZE (BITMAPV5HEADER, bV5ClrUsed, 4) + TEST_FIELD_ALIGN (BITMAPV5HEADER, bV5ClrUsed, 4) + TEST_FIELD_OFFSET(BITMAPV5HEADER, bV5ClrUsed, 32) + TEST_FIELD_SIZE (BITMAPV5HEADER, bV5ClrImportant, 4) + TEST_FIELD_ALIGN (BITMAPV5HEADER, bV5ClrImportant, 4) + TEST_FIELD_OFFSET(BITMAPV5HEADER, bV5ClrImportant, 36) + TEST_FIELD_SIZE (BITMAPV5HEADER, bV5RedMask, 4) + TEST_FIELD_ALIGN (BITMAPV5HEADER, bV5RedMask, 4) + TEST_FIELD_OFFSET(BITMAPV5HEADER, bV5RedMask, 40) + TEST_FIELD_SIZE (BITMAPV5HEADER, bV5GreenMask, 4) + TEST_FIELD_ALIGN (BITMAPV5HEADER, bV5GreenMask, 4) + TEST_FIELD_OFFSET(BITMAPV5HEADER, bV5GreenMask, 44) + TEST_FIELD_SIZE (BITMAPV5HEADER, bV5BlueMask, 4) + TEST_FIELD_ALIGN (BITMAPV5HEADER, bV5BlueMask, 4) + TEST_FIELD_OFFSET(BITMAPV5HEADER, bV5BlueMask, 48) + TEST_FIELD_SIZE (BITMAPV5HEADER, bV5AlphaMask, 4) + TEST_FIELD_ALIGN (BITMAPV5HEADER, bV5AlphaMask, 4) + TEST_FIELD_OFFSET(BITMAPV5HEADER, bV5AlphaMask, 52) + TEST_FIELD_SIZE (BITMAPV5HEADER, bV5CSType, 4) + TEST_FIELD_ALIGN (BITMAPV5HEADER, bV5CSType, 4) + TEST_FIELD_OFFSET(BITMAPV5HEADER, bV5CSType, 56) + TEST_FIELD_SIZE (BITMAPV5HEADER, bV5Endpoints, 36) + TEST_FIELD_ALIGN (BITMAPV5HEADER, bV5Endpoints, 4) + TEST_FIELD_OFFSET(BITMAPV5HEADER, bV5Endpoints, 60) + TEST_FIELD_SIZE (BITMAPV5HEADER, bV5GammaRed, 4) + TEST_FIELD_ALIGN (BITMAPV5HEADER, bV5GammaRed, 4) + TEST_FIELD_OFFSET(BITMAPV5HEADER, bV5GammaRed, 96) + TEST_FIELD_SIZE (BITMAPV5HEADER, bV5GammaGreen, 4) + TEST_FIELD_ALIGN (BITMAPV5HEADER, bV5GammaGreen, 4) + TEST_FIELD_OFFSET(BITMAPV5HEADER, bV5GammaGreen, 100) + TEST_FIELD_SIZE (BITMAPV5HEADER, bV5GammaBlue, 4) + TEST_FIELD_ALIGN (BITMAPV5HEADER, bV5GammaBlue, 4) + TEST_FIELD_OFFSET(BITMAPV5HEADER, bV5GammaBlue, 104) + TEST_FIELD_SIZE (BITMAPV5HEADER, bV5Intent, 4) + TEST_FIELD_ALIGN (BITMAPV5HEADER, bV5Intent, 4) + TEST_FIELD_OFFSET(BITMAPV5HEADER, bV5Intent, 108) + TEST_FIELD_SIZE (BITMAPV5HEADER, bV5ProfileData, 4) + TEST_FIELD_ALIGN (BITMAPV5HEADER, bV5ProfileData, 4) + TEST_FIELD_OFFSET(BITMAPV5HEADER, bV5ProfileData, 112) + TEST_FIELD_SIZE (BITMAPV5HEADER, bV5ProfileSize, 4) + TEST_FIELD_ALIGN (BITMAPV5HEADER, bV5ProfileSize, 4) + TEST_FIELD_OFFSET(BITMAPV5HEADER, bV5ProfileSize, 116) + TEST_FIELD_SIZE (BITMAPV5HEADER, bV5Reserved, 4) + TEST_FIELD_ALIGN (BITMAPV5HEADER, bV5Reserved, 4) + TEST_FIELD_OFFSET(BITMAPV5HEADER, bV5Reserved, 120) +} + +static void test_pack_BLENDFUNCTION(void) +{ + /* BLENDFUNCTION (pack 4) */ + TEST_TYPE_SIZE (BLENDFUNCTION, 4) + TEST_TYPE_ALIGN (BLENDFUNCTION, 1) + TEST_FIELD_SIZE (BLENDFUNCTION, BlendOp, 1) + TEST_FIELD_ALIGN (BLENDFUNCTION, BlendOp, 1) + TEST_FIELD_OFFSET(BLENDFUNCTION, BlendOp, 0) + TEST_FIELD_SIZE (BLENDFUNCTION, BlendFlags, 1) + TEST_FIELD_ALIGN (BLENDFUNCTION, BlendFlags, 1) + TEST_FIELD_OFFSET(BLENDFUNCTION, BlendFlags, 1) + TEST_FIELD_SIZE (BLENDFUNCTION, SourceConstantAlpha, 1) + TEST_FIELD_ALIGN (BLENDFUNCTION, SourceConstantAlpha, 1) + TEST_FIELD_OFFSET(BLENDFUNCTION, SourceConstantAlpha, 2) + TEST_FIELD_SIZE (BLENDFUNCTION, AlphaFormat, 1) + TEST_FIELD_ALIGN (BLENDFUNCTION, AlphaFormat, 1) + TEST_FIELD_OFFSET(BLENDFUNCTION, AlphaFormat, 3) +} + +static void test_pack_CHARSETINFO(void) +{ + /* CHARSETINFO (pack 4) */ + TEST_TYPE_SIZE (CHARSETINFO, 32) + TEST_TYPE_ALIGN (CHARSETINFO, 4) + TEST_FIELD_SIZE (CHARSETINFO, ciCharset, 4) + TEST_FIELD_ALIGN (CHARSETINFO, ciCharset, 4) + TEST_FIELD_OFFSET(CHARSETINFO, ciCharset, 0) + TEST_FIELD_SIZE (CHARSETINFO, ciACP, 4) + TEST_FIELD_ALIGN (CHARSETINFO, ciACP, 4) + TEST_FIELD_OFFSET(CHARSETINFO, ciACP, 4) + TEST_FIELD_SIZE (CHARSETINFO, fs, 24) + TEST_FIELD_ALIGN (CHARSETINFO, fs, 4) + TEST_FIELD_OFFSET(CHARSETINFO, fs, 8) +} + +static void test_pack_CIEXYZ(void) +{ + /* CIEXYZ (pack 4) */ + TEST_TYPE_SIZE (CIEXYZ, 12) + TEST_TYPE_ALIGN (CIEXYZ, 4) + TEST_FIELD_SIZE (CIEXYZ, ciexyzX, 4) + TEST_FIELD_ALIGN (CIEXYZ, ciexyzX, 4) + TEST_FIELD_OFFSET(CIEXYZ, ciexyzX, 0) + TEST_FIELD_SIZE (CIEXYZ, ciexyzY, 4) + TEST_FIELD_ALIGN (CIEXYZ, ciexyzY, 4) + TEST_FIELD_OFFSET(CIEXYZ, ciexyzY, 4) + TEST_FIELD_SIZE (CIEXYZ, ciexyzZ, 4) + TEST_FIELD_ALIGN (CIEXYZ, ciexyzZ, 4) + TEST_FIELD_OFFSET(CIEXYZ, ciexyzZ, 8) +} + +static void test_pack_CIEXYZTRIPLE(void) +{ + /* CIEXYZTRIPLE (pack 4) */ + TEST_TYPE_SIZE (CIEXYZTRIPLE, 36) + TEST_TYPE_ALIGN (CIEXYZTRIPLE, 4) + TEST_FIELD_SIZE (CIEXYZTRIPLE, ciexyzRed, 12) + TEST_FIELD_ALIGN (CIEXYZTRIPLE, ciexyzRed, 4) + TEST_FIELD_OFFSET(CIEXYZTRIPLE, ciexyzRed, 0) + TEST_FIELD_SIZE (CIEXYZTRIPLE, ciexyzGreen, 12) + TEST_FIELD_ALIGN (CIEXYZTRIPLE, ciexyzGreen, 4) + TEST_FIELD_OFFSET(CIEXYZTRIPLE, ciexyzGreen, 12) + TEST_FIELD_SIZE (CIEXYZTRIPLE, ciexyzBlue, 12) + TEST_FIELD_ALIGN (CIEXYZTRIPLE, ciexyzBlue, 4) + TEST_FIELD_OFFSET(CIEXYZTRIPLE, ciexyzBlue, 24) +} + +static void test_pack_COLOR16(void) +{ + /* COLOR16 */ + TEST_TYPE_SIZE (COLOR16, 2) + TEST_TYPE_ALIGN (COLOR16, 2) +} + +static void test_pack_COLORADJUSTMENT(void) +{ + /* COLORADJUSTMENT (pack 4) */ + TEST_TYPE_SIZE (COLORADJUSTMENT, 24) + TEST_TYPE_ALIGN (COLORADJUSTMENT, 2) + TEST_FIELD_SIZE (COLORADJUSTMENT, caSize, 2) + TEST_FIELD_ALIGN (COLORADJUSTMENT, caSize, 2) + TEST_FIELD_OFFSET(COLORADJUSTMENT, caSize, 0) + TEST_FIELD_SIZE (COLORADJUSTMENT, caFlags, 2) + TEST_FIELD_ALIGN (COLORADJUSTMENT, caFlags, 2) + TEST_FIELD_OFFSET(COLORADJUSTMENT, caFlags, 2) + TEST_FIELD_SIZE (COLORADJUSTMENT, caIlluminantIndex, 2) + TEST_FIELD_ALIGN (COLORADJUSTMENT, caIlluminantIndex, 2) + TEST_FIELD_OFFSET(COLORADJUSTMENT, caIlluminantIndex, 4) + TEST_FIELD_SIZE (COLORADJUSTMENT, caRedGamma, 2) + TEST_FIELD_ALIGN (COLORADJUSTMENT, caRedGamma, 2) + TEST_FIELD_OFFSET(COLORADJUSTMENT, caRedGamma, 6) + TEST_FIELD_SIZE (COLORADJUSTMENT, caGreenGamma, 2) + TEST_FIELD_ALIGN (COLORADJUSTMENT, caGreenGamma, 2) + TEST_FIELD_OFFSET(COLORADJUSTMENT, caGreenGamma, 8) + TEST_FIELD_SIZE (COLORADJUSTMENT, caBlueGamma, 2) + TEST_FIELD_ALIGN (COLORADJUSTMENT, caBlueGamma, 2) + TEST_FIELD_OFFSET(COLORADJUSTMENT, caBlueGamma, 10) + TEST_FIELD_SIZE (COLORADJUSTMENT, caReferenceBlack, 2) + TEST_FIELD_ALIGN (COLORADJUSTMENT, caReferenceBlack, 2) + TEST_FIELD_OFFSET(COLORADJUSTMENT, caReferenceBlack, 12) + TEST_FIELD_SIZE (COLORADJUSTMENT, caReferenceWhite, 2) + TEST_FIELD_ALIGN (COLORADJUSTMENT, caReferenceWhite, 2) + TEST_FIELD_OFFSET(COLORADJUSTMENT, caReferenceWhite, 14) + TEST_FIELD_SIZE (COLORADJUSTMENT, caContrast, 2) + TEST_FIELD_ALIGN (COLORADJUSTMENT, caContrast, 2) + TEST_FIELD_OFFSET(COLORADJUSTMENT, caContrast, 16) + TEST_FIELD_SIZE (COLORADJUSTMENT, caBrightness, 2) + TEST_FIELD_ALIGN (COLORADJUSTMENT, caBrightness, 2) + TEST_FIELD_OFFSET(COLORADJUSTMENT, caBrightness, 18) + TEST_FIELD_SIZE (COLORADJUSTMENT, caColorfulness, 2) + TEST_FIELD_ALIGN (COLORADJUSTMENT, caColorfulness, 2) + TEST_FIELD_OFFSET(COLORADJUSTMENT, caColorfulness, 20) + TEST_FIELD_SIZE (COLORADJUSTMENT, caRedGreenTint, 2) + TEST_FIELD_ALIGN (COLORADJUSTMENT, caRedGreenTint, 2) + TEST_FIELD_OFFSET(COLORADJUSTMENT, caRedGreenTint, 22) +} + +static void test_pack_DEVMODEA(void) +{ + /* DEVMODEA (pack 4) */ + TEST_FIELD_SIZE (DEVMODEA, dmDeviceName, 32) + TEST_FIELD_ALIGN (DEVMODEA, dmDeviceName, 1) + TEST_FIELD_OFFSET(DEVMODEA, dmDeviceName, 0) + TEST_FIELD_SIZE (DEVMODEA, dmSpecVersion, 2) + TEST_FIELD_ALIGN (DEVMODEA, dmSpecVersion, 2) + TEST_FIELD_OFFSET(DEVMODEA, dmSpecVersion, 32) + TEST_FIELD_SIZE (DEVMODEA, dmDriverVersion, 2) + TEST_FIELD_ALIGN (DEVMODEA, dmDriverVersion, 2) + TEST_FIELD_OFFSET(DEVMODEA, dmDriverVersion, 34) + TEST_FIELD_SIZE (DEVMODEA, dmSize, 2) + TEST_FIELD_ALIGN (DEVMODEA, dmSize, 2) + TEST_FIELD_OFFSET(DEVMODEA, dmSize, 36) + TEST_FIELD_SIZE (DEVMODEA, dmDriverExtra, 2) + TEST_FIELD_ALIGN (DEVMODEA, dmDriverExtra, 2) + TEST_FIELD_OFFSET(DEVMODEA, dmDriverExtra, 38) + TEST_FIELD_SIZE (DEVMODEA, dmFields, 4) + TEST_FIELD_ALIGN (DEVMODEA, dmFields, 4) + TEST_FIELD_OFFSET(DEVMODEA, dmFields, 40) +} + +static void test_pack_DEVMODEW(void) +{ + /* DEVMODEW (pack 4) */ + TEST_FIELD_SIZE (DEVMODEW, dmDeviceName, 64) + TEST_FIELD_ALIGN (DEVMODEW, dmDeviceName, 2) + TEST_FIELD_OFFSET(DEVMODEW, dmDeviceName, 0) + TEST_FIELD_SIZE (DEVMODEW, dmSpecVersion, 2) + TEST_FIELD_ALIGN (DEVMODEW, dmSpecVersion, 2) + TEST_FIELD_OFFSET(DEVMODEW, dmSpecVersion, 64) + TEST_FIELD_SIZE (DEVMODEW, dmDriverVersion, 2) + TEST_FIELD_ALIGN (DEVMODEW, dmDriverVersion, 2) + TEST_FIELD_OFFSET(DEVMODEW, dmDriverVersion, 66) + TEST_FIELD_SIZE (DEVMODEW, dmSize, 2) + TEST_FIELD_ALIGN (DEVMODEW, dmSize, 2) + TEST_FIELD_OFFSET(DEVMODEW, dmSize, 68) + TEST_FIELD_SIZE (DEVMODEW, dmDriverExtra, 2) + TEST_FIELD_ALIGN (DEVMODEW, dmDriverExtra, 2) + TEST_FIELD_OFFSET(DEVMODEW, dmDriverExtra, 70) + TEST_FIELD_SIZE (DEVMODEW, dmFields, 4) + TEST_FIELD_ALIGN (DEVMODEW, dmFields, 4) + TEST_FIELD_OFFSET(DEVMODEW, dmFields, 72) +} + +static void test_pack_DIBSECTION(void) +{ + /* DIBSECTION (pack 4) */ + TEST_TYPE_SIZE (DIBSECTION, 84) + TEST_TYPE_ALIGN (DIBSECTION, 4) + TEST_FIELD_SIZE (DIBSECTION, dsBm, 24) + TEST_FIELD_ALIGN (DIBSECTION, dsBm, 4) + TEST_FIELD_OFFSET(DIBSECTION, dsBm, 0) + TEST_FIELD_SIZE (DIBSECTION, dsBmih, 40) + TEST_FIELD_ALIGN (DIBSECTION, dsBmih, 4) + TEST_FIELD_OFFSET(DIBSECTION, dsBmih, 24) + TEST_FIELD_SIZE (DIBSECTION, dsBitfields, 12) + TEST_FIELD_ALIGN (DIBSECTION, dsBitfields, 4) + TEST_FIELD_OFFSET(DIBSECTION, dsBitfields, 64) + TEST_FIELD_SIZE (DIBSECTION, dshSection, 4) + TEST_FIELD_ALIGN (DIBSECTION, dshSection, 4) + TEST_FIELD_OFFSET(DIBSECTION, dshSection, 76) + TEST_FIELD_SIZE (DIBSECTION, dsOffset, 4) + TEST_FIELD_ALIGN (DIBSECTION, dsOffset, 4) + TEST_FIELD_OFFSET(DIBSECTION, dsOffset, 80) +} + +static void test_pack_DISPLAY_DEVICEA(void) +{ + /* DISPLAY_DEVICEA (pack 4) */ + TEST_TYPE_SIZE (DISPLAY_DEVICEA, 424) + TEST_TYPE_ALIGN (DISPLAY_DEVICEA, 4) + TEST_FIELD_SIZE (DISPLAY_DEVICEA, cb, 4) + TEST_FIELD_ALIGN (DISPLAY_DEVICEA, cb, 4) + TEST_FIELD_OFFSET(DISPLAY_DEVICEA, cb, 0) + TEST_FIELD_SIZE (DISPLAY_DEVICEA, DeviceName, 32) + TEST_FIELD_ALIGN (DISPLAY_DEVICEA, DeviceName, 1) + TEST_FIELD_OFFSET(DISPLAY_DEVICEA, DeviceName, 4) + TEST_FIELD_SIZE (DISPLAY_DEVICEA, DeviceString, 128) + TEST_FIELD_ALIGN (DISPLAY_DEVICEA, DeviceString, 1) + TEST_FIELD_OFFSET(DISPLAY_DEVICEA, DeviceString, 36) + TEST_FIELD_SIZE (DISPLAY_DEVICEA, StateFlags, 4) + TEST_FIELD_ALIGN (DISPLAY_DEVICEA, StateFlags, 4) + TEST_FIELD_OFFSET(DISPLAY_DEVICEA, StateFlags, 164) + TEST_FIELD_SIZE (DISPLAY_DEVICEA, DeviceID, 128) + TEST_FIELD_ALIGN (DISPLAY_DEVICEA, DeviceID, 1) + TEST_FIELD_OFFSET(DISPLAY_DEVICEA, DeviceID, 168) + TEST_FIELD_SIZE (DISPLAY_DEVICEA, DeviceKey, 128) + TEST_FIELD_ALIGN (DISPLAY_DEVICEA, DeviceKey, 1) + TEST_FIELD_OFFSET(DISPLAY_DEVICEA, DeviceKey, 296) +} + +static void test_pack_DISPLAY_DEVICEW(void) +{ + /* DISPLAY_DEVICEW (pack 4) */ + TEST_TYPE_SIZE (DISPLAY_DEVICEW, 840) + TEST_TYPE_ALIGN (DISPLAY_DEVICEW, 4) + TEST_FIELD_SIZE (DISPLAY_DEVICEW, cb, 4) + TEST_FIELD_ALIGN (DISPLAY_DEVICEW, cb, 4) + TEST_FIELD_OFFSET(DISPLAY_DEVICEW, cb, 0) + TEST_FIELD_SIZE (DISPLAY_DEVICEW, DeviceName, 64) + TEST_FIELD_ALIGN (DISPLAY_DEVICEW, DeviceName, 2) + TEST_FIELD_OFFSET(DISPLAY_DEVICEW, DeviceName, 4) + TEST_FIELD_SIZE (DISPLAY_DEVICEW, DeviceString, 256) + TEST_FIELD_ALIGN (DISPLAY_DEVICEW, DeviceString, 2) + TEST_FIELD_OFFSET(DISPLAY_DEVICEW, DeviceString, 68) + TEST_FIELD_SIZE (DISPLAY_DEVICEW, StateFlags, 4) + TEST_FIELD_ALIGN (DISPLAY_DEVICEW, StateFlags, 4) + TEST_FIELD_OFFSET(DISPLAY_DEVICEW, StateFlags, 324) + TEST_FIELD_SIZE (DISPLAY_DEVICEW, DeviceID, 256) + TEST_FIELD_ALIGN (DISPLAY_DEVICEW, DeviceID, 2) + TEST_FIELD_OFFSET(DISPLAY_DEVICEW, DeviceID, 328) + TEST_FIELD_SIZE (DISPLAY_DEVICEW, DeviceKey, 256) + TEST_FIELD_ALIGN (DISPLAY_DEVICEW, DeviceKey, 2) + TEST_FIELD_OFFSET(DISPLAY_DEVICEW, DeviceKey, 584) +} + +static void test_pack_DOCINFOA(void) +{ + /* DOCINFOA (pack 4) */ + TEST_TYPE_SIZE (DOCINFOA, 20) + TEST_TYPE_ALIGN (DOCINFOA, 4) + TEST_FIELD_SIZE (DOCINFOA, cbSize, 4) + TEST_FIELD_ALIGN (DOCINFOA, cbSize, 4) + TEST_FIELD_OFFSET(DOCINFOA, cbSize, 0) + TEST_FIELD_SIZE (DOCINFOA, lpszDocName, 4) + TEST_FIELD_ALIGN (DOCINFOA, lpszDocName, 4) + TEST_FIELD_OFFSET(DOCINFOA, lpszDocName, 4) + TEST_FIELD_SIZE (DOCINFOA, lpszOutput, 4) + TEST_FIELD_ALIGN (DOCINFOA, lpszOutput, 4) + TEST_FIELD_OFFSET(DOCINFOA, lpszOutput, 8) + TEST_FIELD_SIZE (DOCINFOA, lpszDatatype, 4) + TEST_FIELD_ALIGN (DOCINFOA, lpszDatatype, 4) + TEST_FIELD_OFFSET(DOCINFOA, lpszDatatype, 12) + TEST_FIELD_SIZE (DOCINFOA, fwType, 4) + TEST_FIELD_ALIGN (DOCINFOA, fwType, 4) + TEST_FIELD_OFFSET(DOCINFOA, fwType, 16) +} + +static void test_pack_DOCINFOW(void) +{ + /* DOCINFOW (pack 4) */ + TEST_TYPE_SIZE (DOCINFOW, 20) + TEST_TYPE_ALIGN (DOCINFOW, 4) + TEST_FIELD_SIZE (DOCINFOW, cbSize, 4) + TEST_FIELD_ALIGN (DOCINFOW, cbSize, 4) + TEST_FIELD_OFFSET(DOCINFOW, cbSize, 0) + TEST_FIELD_SIZE (DOCINFOW, lpszDocName, 4) + TEST_FIELD_ALIGN (DOCINFOW, lpszDocName, 4) + TEST_FIELD_OFFSET(DOCINFOW, lpszDocName, 4) + TEST_FIELD_SIZE (DOCINFOW, lpszOutput, 4) + TEST_FIELD_ALIGN (DOCINFOW, lpszOutput, 4) + TEST_FIELD_OFFSET(DOCINFOW, lpszOutput, 8) + TEST_FIELD_SIZE (DOCINFOW, lpszDatatype, 4) + TEST_FIELD_ALIGN (DOCINFOW, lpszDatatype, 4) + TEST_FIELD_OFFSET(DOCINFOW, lpszDatatype, 12) + TEST_FIELD_SIZE (DOCINFOW, fwType, 4) + TEST_FIELD_ALIGN (DOCINFOW, fwType, 4) + TEST_FIELD_OFFSET(DOCINFOW, fwType, 16) +} + +static void test_pack_EMR(void) +{ + /* EMR (pack 4) */ + TEST_TYPE_SIZE (EMR, 8) + TEST_TYPE_ALIGN (EMR, 4) + TEST_FIELD_SIZE (EMR, iType, 4) + TEST_FIELD_ALIGN (EMR, iType, 4) + TEST_FIELD_OFFSET(EMR, iType, 0) + TEST_FIELD_SIZE (EMR, nSize, 4) + TEST_FIELD_ALIGN (EMR, nSize, 4) + TEST_FIELD_OFFSET(EMR, nSize, 4) +} + +static void test_pack_EMRABORTPATH(void) +{ + /* EMRABORTPATH (pack 4) */ + TEST_TYPE_SIZE (EMRABORTPATH, 8) + TEST_TYPE_ALIGN (EMRABORTPATH, 4) + TEST_FIELD_SIZE (EMRABORTPATH, emr, 8) + TEST_FIELD_ALIGN (EMRABORTPATH, emr, 4) + TEST_FIELD_OFFSET(EMRABORTPATH, emr, 0) +} + +static void test_pack_EMRANGLEARC(void) +{ + /* EMRANGLEARC (pack 4) */ + TEST_TYPE_SIZE (EMRANGLEARC, 28) + TEST_TYPE_ALIGN (EMRANGLEARC, 4) + TEST_FIELD_SIZE (EMRANGLEARC, emr, 8) + TEST_FIELD_ALIGN (EMRANGLEARC, emr, 4) + TEST_FIELD_OFFSET(EMRANGLEARC, emr, 0) + TEST_FIELD_SIZE (EMRANGLEARC, ptlCenter, 8) + TEST_FIELD_ALIGN (EMRANGLEARC, ptlCenter, 4) + TEST_FIELD_OFFSET(EMRANGLEARC, ptlCenter, 8) + TEST_FIELD_SIZE (EMRANGLEARC, nRadius, 4) + TEST_FIELD_ALIGN (EMRANGLEARC, nRadius, 4) + TEST_FIELD_OFFSET(EMRANGLEARC, nRadius, 16) + TEST_FIELD_SIZE (EMRANGLEARC, eStartAngle, 4) + TEST_FIELD_ALIGN (EMRANGLEARC, eStartAngle, 4) + TEST_FIELD_OFFSET(EMRANGLEARC, eStartAngle, 20) + TEST_FIELD_SIZE (EMRANGLEARC, eSweepAngle, 4) + TEST_FIELD_ALIGN (EMRANGLEARC, eSweepAngle, 4) + TEST_FIELD_OFFSET(EMRANGLEARC, eSweepAngle, 24) +} + +static void test_pack_EMRARC(void) +{ + /* EMRARC (pack 4) */ + TEST_TYPE_SIZE (EMRARC, 40) + TEST_TYPE_ALIGN (EMRARC, 4) + TEST_FIELD_SIZE (EMRARC, emr, 8) + TEST_FIELD_ALIGN (EMRARC, emr, 4) + TEST_FIELD_OFFSET(EMRARC, emr, 0) + TEST_FIELD_SIZE (EMRARC, rclBox, 16) + TEST_FIELD_ALIGN (EMRARC, rclBox, 4) + TEST_FIELD_OFFSET(EMRARC, rclBox, 8) + TEST_FIELD_SIZE (EMRARC, ptlStart, 8) + TEST_FIELD_ALIGN (EMRARC, ptlStart, 4) + TEST_FIELD_OFFSET(EMRARC, ptlStart, 24) + TEST_FIELD_SIZE (EMRARC, ptlEnd, 8) + TEST_FIELD_ALIGN (EMRARC, ptlEnd, 4) + TEST_FIELD_OFFSET(EMRARC, ptlEnd, 32) +} + +static void test_pack_EMRARCTO(void) +{ + /* EMRARCTO (pack 4) */ + TEST_TYPE_SIZE (EMRARCTO, 40) + TEST_TYPE_ALIGN (EMRARCTO, 4) + TEST_FIELD_SIZE (EMRARCTO, emr, 8) + TEST_FIELD_ALIGN (EMRARCTO, emr, 4) + TEST_FIELD_OFFSET(EMRARCTO, emr, 0) + TEST_FIELD_SIZE (EMRARCTO, rclBox, 16) + TEST_FIELD_ALIGN (EMRARCTO, rclBox, 4) + TEST_FIELD_OFFSET(EMRARCTO, rclBox, 8) + TEST_FIELD_SIZE (EMRARCTO, ptlStart, 8) + TEST_FIELD_ALIGN (EMRARCTO, ptlStart, 4) + TEST_FIELD_OFFSET(EMRARCTO, ptlStart, 24) + TEST_FIELD_SIZE (EMRARCTO, ptlEnd, 8) + TEST_FIELD_ALIGN (EMRARCTO, ptlEnd, 4) + TEST_FIELD_OFFSET(EMRARCTO, ptlEnd, 32) +} + +static void test_pack_EMRBEGINPATH(void) +{ + /* EMRBEGINPATH (pack 4) */ + TEST_TYPE_SIZE (EMRBEGINPATH, 8) + TEST_TYPE_ALIGN (EMRBEGINPATH, 4) + TEST_FIELD_SIZE (EMRBEGINPATH, emr, 8) + TEST_FIELD_ALIGN (EMRBEGINPATH, emr, 4) + TEST_FIELD_OFFSET(EMRBEGINPATH, emr, 0) +} + +static void test_pack_EMRBITBLT(void) +{ + /* EMRBITBLT (pack 4) */ + TEST_TYPE_SIZE (EMRBITBLT, 100) + TEST_TYPE_ALIGN (EMRBITBLT, 4) + TEST_FIELD_SIZE (EMRBITBLT, emr, 8) + TEST_FIELD_ALIGN (EMRBITBLT, emr, 4) + TEST_FIELD_OFFSET(EMRBITBLT, emr, 0) + TEST_FIELD_SIZE (EMRBITBLT, rclBounds, 16) + TEST_FIELD_ALIGN (EMRBITBLT, rclBounds, 4) + TEST_FIELD_OFFSET(EMRBITBLT, rclBounds, 8) + TEST_FIELD_SIZE (EMRBITBLT, xDest, 4) + TEST_FIELD_ALIGN (EMRBITBLT, xDest, 4) + TEST_FIELD_OFFSET(EMRBITBLT, xDest, 24) + TEST_FIELD_SIZE (EMRBITBLT, yDest, 4) + TEST_FIELD_ALIGN (EMRBITBLT, yDest, 4) + TEST_FIELD_OFFSET(EMRBITBLT, yDest, 28) + TEST_FIELD_SIZE (EMRBITBLT, cxDest, 4) + TEST_FIELD_ALIGN (EMRBITBLT, cxDest, 4) + TEST_FIELD_OFFSET(EMRBITBLT, cxDest, 32) + TEST_FIELD_SIZE (EMRBITBLT, cyDest, 4) + TEST_FIELD_ALIGN (EMRBITBLT, cyDest, 4) + TEST_FIELD_OFFSET(EMRBITBLT, cyDest, 36) + TEST_FIELD_SIZE (EMRBITBLT, dwRop, 4) + TEST_FIELD_ALIGN (EMRBITBLT, dwRop, 4) + TEST_FIELD_OFFSET(EMRBITBLT, dwRop, 40) + TEST_FIELD_SIZE (EMRBITBLT, xSrc, 4) + TEST_FIELD_ALIGN (EMRBITBLT, xSrc, 4) + TEST_FIELD_OFFSET(EMRBITBLT, xSrc, 44) + TEST_FIELD_SIZE (EMRBITBLT, ySrc, 4) + TEST_FIELD_ALIGN (EMRBITBLT, ySrc, 4) + TEST_FIELD_OFFSET(EMRBITBLT, ySrc, 48) + TEST_FIELD_SIZE (EMRBITBLT, xformSrc, 24) + TEST_FIELD_ALIGN (EMRBITBLT, xformSrc, 4) + TEST_FIELD_OFFSET(EMRBITBLT, xformSrc, 52) + TEST_FIELD_SIZE (EMRBITBLT, crBkColorSrc, 4) + TEST_FIELD_ALIGN (EMRBITBLT, crBkColorSrc, 4) + TEST_FIELD_OFFSET(EMRBITBLT, crBkColorSrc, 76) + TEST_FIELD_SIZE (EMRBITBLT, iUsageSrc, 4) + TEST_FIELD_ALIGN (EMRBITBLT, iUsageSrc, 4) + TEST_FIELD_OFFSET(EMRBITBLT, iUsageSrc, 80) + TEST_FIELD_SIZE (EMRBITBLT, offBmiSrc, 4) + TEST_FIELD_ALIGN (EMRBITBLT, offBmiSrc, 4) + TEST_FIELD_OFFSET(EMRBITBLT, offBmiSrc, 84) + TEST_FIELD_SIZE (EMRBITBLT, cbBmiSrc, 4) + TEST_FIELD_ALIGN (EMRBITBLT, cbBmiSrc, 4) + TEST_FIELD_OFFSET(EMRBITBLT, cbBmiSrc, 88) + TEST_FIELD_SIZE (EMRBITBLT, offBitsSrc, 4) + TEST_FIELD_ALIGN (EMRBITBLT, offBitsSrc, 4) + TEST_FIELD_OFFSET(EMRBITBLT, offBitsSrc, 92) + TEST_FIELD_SIZE (EMRBITBLT, cbBitsSrc, 4) + TEST_FIELD_ALIGN (EMRBITBLT, cbBitsSrc, 4) + TEST_FIELD_OFFSET(EMRBITBLT, cbBitsSrc, 96) +} + +static void test_pack_EMRCHORD(void) +{ + /* EMRCHORD (pack 4) */ + TEST_TYPE_SIZE (EMRCHORD, 40) + TEST_TYPE_ALIGN (EMRCHORD, 4) + TEST_FIELD_SIZE (EMRCHORD, emr, 8) + TEST_FIELD_ALIGN (EMRCHORD, emr, 4) + TEST_FIELD_OFFSET(EMRCHORD, emr, 0) + TEST_FIELD_SIZE (EMRCHORD, rclBox, 16) + TEST_FIELD_ALIGN (EMRCHORD, rclBox, 4) + TEST_FIELD_OFFSET(EMRCHORD, rclBox, 8) + TEST_FIELD_SIZE (EMRCHORD, ptlStart, 8) + TEST_FIELD_ALIGN (EMRCHORD, ptlStart, 4) + TEST_FIELD_OFFSET(EMRCHORD, ptlStart, 24) + TEST_FIELD_SIZE (EMRCHORD, ptlEnd, 8) + TEST_FIELD_ALIGN (EMRCHORD, ptlEnd, 4) + TEST_FIELD_OFFSET(EMRCHORD, ptlEnd, 32) +} + +static void test_pack_EMRCLOSEFIGURE(void) +{ + /* EMRCLOSEFIGURE (pack 4) */ + TEST_TYPE_SIZE (EMRCLOSEFIGURE, 8) + TEST_TYPE_ALIGN (EMRCLOSEFIGURE, 4) + TEST_FIELD_SIZE (EMRCLOSEFIGURE, emr, 8) + TEST_FIELD_ALIGN (EMRCLOSEFIGURE, emr, 4) + TEST_FIELD_OFFSET(EMRCLOSEFIGURE, emr, 0) +} + +static void test_pack_EMRCREATEBRUSHINDIRECT(void) +{ + /* EMRCREATEBRUSHINDIRECT (pack 4) */ + TEST_TYPE_SIZE (EMRCREATEBRUSHINDIRECT, 24) + TEST_TYPE_ALIGN (EMRCREATEBRUSHINDIRECT, 4) + TEST_FIELD_SIZE (EMRCREATEBRUSHINDIRECT, emr, 8) + TEST_FIELD_ALIGN (EMRCREATEBRUSHINDIRECT, emr, 4) + TEST_FIELD_OFFSET(EMRCREATEBRUSHINDIRECT, emr, 0) + TEST_FIELD_SIZE (EMRCREATEBRUSHINDIRECT, ihBrush, 4) + TEST_FIELD_ALIGN (EMRCREATEBRUSHINDIRECT, ihBrush, 4) + TEST_FIELD_OFFSET(EMRCREATEBRUSHINDIRECT, ihBrush, 8) + TEST_FIELD_SIZE (EMRCREATEBRUSHINDIRECT, lb, 12) + TEST_FIELD_ALIGN (EMRCREATEBRUSHINDIRECT, lb, 4) + TEST_FIELD_OFFSET(EMRCREATEBRUSHINDIRECT, lb, 12) +} + +static void test_pack_EMRCREATECOLORSPACE(void) +{ + /* EMRCREATECOLORSPACE (pack 4) */ + TEST_TYPE_SIZE (EMRCREATECOLORSPACE, 340) + TEST_TYPE_ALIGN (EMRCREATECOLORSPACE, 4) + TEST_FIELD_SIZE (EMRCREATECOLORSPACE, emr, 8) + TEST_FIELD_ALIGN (EMRCREATECOLORSPACE, emr, 4) + TEST_FIELD_OFFSET(EMRCREATECOLORSPACE, emr, 0) + TEST_FIELD_SIZE (EMRCREATECOLORSPACE, ihCS, 4) + TEST_FIELD_ALIGN (EMRCREATECOLORSPACE, ihCS, 4) + TEST_FIELD_OFFSET(EMRCREATECOLORSPACE, ihCS, 8) + TEST_FIELD_SIZE (EMRCREATECOLORSPACE, lcs, 328) + TEST_FIELD_ALIGN (EMRCREATECOLORSPACE, lcs, 4) + TEST_FIELD_OFFSET(EMRCREATECOLORSPACE, lcs, 12) +} + +static void test_pack_EMRCREATECOLORSPACEW(void) +{ + /* EMRCREATECOLORSPACEW (pack 4) */ + TEST_TYPE_SIZE (EMRCREATECOLORSPACEW, 612) + TEST_TYPE_ALIGN (EMRCREATECOLORSPACEW, 4) + TEST_FIELD_SIZE (EMRCREATECOLORSPACEW, emr, 8) + TEST_FIELD_ALIGN (EMRCREATECOLORSPACEW, emr, 4) + TEST_FIELD_OFFSET(EMRCREATECOLORSPACEW, emr, 0) + TEST_FIELD_SIZE (EMRCREATECOLORSPACEW, ihCS, 4) + TEST_FIELD_ALIGN (EMRCREATECOLORSPACEW, ihCS, 4) + TEST_FIELD_OFFSET(EMRCREATECOLORSPACEW, ihCS, 8) + TEST_FIELD_SIZE (EMRCREATECOLORSPACEW, lcs, 588) + TEST_FIELD_ALIGN (EMRCREATECOLORSPACEW, lcs, 4) + TEST_FIELD_OFFSET(EMRCREATECOLORSPACEW, lcs, 12) + TEST_FIELD_SIZE (EMRCREATECOLORSPACEW, dwFlags, 4) + TEST_FIELD_ALIGN (EMRCREATECOLORSPACEW, dwFlags, 4) + TEST_FIELD_OFFSET(EMRCREATECOLORSPACEW, dwFlags, 600) + TEST_FIELD_SIZE (EMRCREATECOLORSPACEW, cbData, 4) + TEST_FIELD_ALIGN (EMRCREATECOLORSPACEW, cbData, 4) + TEST_FIELD_OFFSET(EMRCREATECOLORSPACEW, cbData, 604) + TEST_FIELD_SIZE (EMRCREATECOLORSPACEW, Data, 1) + TEST_FIELD_ALIGN (EMRCREATECOLORSPACEW, Data, 1) + TEST_FIELD_OFFSET(EMRCREATECOLORSPACEW, Data, 608) +} + +static void test_pack_EMRCREATEDIBPATTERNBRUSHPT(void) +{ + /* EMRCREATEDIBPATTERNBRUSHPT (pack 4) */ + TEST_TYPE_SIZE (EMRCREATEDIBPATTERNBRUSHPT, 32) + TEST_TYPE_ALIGN (EMRCREATEDIBPATTERNBRUSHPT, 4) + TEST_FIELD_SIZE (EMRCREATEDIBPATTERNBRUSHPT, emr, 8) + TEST_FIELD_ALIGN (EMRCREATEDIBPATTERNBRUSHPT, emr, 4) + TEST_FIELD_OFFSET(EMRCREATEDIBPATTERNBRUSHPT, emr, 0) + TEST_FIELD_SIZE (EMRCREATEDIBPATTERNBRUSHPT, ihBrush, 4) + TEST_FIELD_ALIGN (EMRCREATEDIBPATTERNBRUSHPT, ihBrush, 4) + TEST_FIELD_OFFSET(EMRCREATEDIBPATTERNBRUSHPT, ihBrush, 8) + TEST_FIELD_SIZE (EMRCREATEDIBPATTERNBRUSHPT, iUsage, 4) + TEST_FIELD_ALIGN (EMRCREATEDIBPATTERNBRUSHPT, iUsage, 4) + TEST_FIELD_OFFSET(EMRCREATEDIBPATTERNBRUSHPT, iUsage, 12) + TEST_FIELD_SIZE (EMRCREATEDIBPATTERNBRUSHPT, offBmi, 4) + TEST_FIELD_ALIGN (EMRCREATEDIBPATTERNBRUSHPT, offBmi, 4) + TEST_FIELD_OFFSET(EMRCREATEDIBPATTERNBRUSHPT, offBmi, 16) + TEST_FIELD_SIZE (EMRCREATEDIBPATTERNBRUSHPT, cbBmi, 4) + TEST_FIELD_ALIGN (EMRCREATEDIBPATTERNBRUSHPT, cbBmi, 4) + TEST_FIELD_OFFSET(EMRCREATEDIBPATTERNBRUSHPT, cbBmi, 20) + TEST_FIELD_SIZE (EMRCREATEDIBPATTERNBRUSHPT, offBits, 4) + TEST_FIELD_ALIGN (EMRCREATEDIBPATTERNBRUSHPT, offBits, 4) + TEST_FIELD_OFFSET(EMRCREATEDIBPATTERNBRUSHPT, offBits, 24) + TEST_FIELD_SIZE (EMRCREATEDIBPATTERNBRUSHPT, cbBits, 4) + TEST_FIELD_ALIGN (EMRCREATEDIBPATTERNBRUSHPT, cbBits, 4) + TEST_FIELD_OFFSET(EMRCREATEDIBPATTERNBRUSHPT, cbBits, 28) +} + +static void test_pack_EMRCREATEMONOBRUSH(void) +{ + /* EMRCREATEMONOBRUSH (pack 4) */ + TEST_TYPE_SIZE (EMRCREATEMONOBRUSH, 32) + TEST_TYPE_ALIGN (EMRCREATEMONOBRUSH, 4) + TEST_FIELD_SIZE (EMRCREATEMONOBRUSH, emr, 8) + TEST_FIELD_ALIGN (EMRCREATEMONOBRUSH, emr, 4) + TEST_FIELD_OFFSET(EMRCREATEMONOBRUSH, emr, 0) + TEST_FIELD_SIZE (EMRCREATEMONOBRUSH, ihBrush, 4) + TEST_FIELD_ALIGN (EMRCREATEMONOBRUSH, ihBrush, 4) + TEST_FIELD_OFFSET(EMRCREATEMONOBRUSH, ihBrush, 8) + TEST_FIELD_SIZE (EMRCREATEMONOBRUSH, iUsage, 4) + TEST_FIELD_ALIGN (EMRCREATEMONOBRUSH, iUsage, 4) + TEST_FIELD_OFFSET(EMRCREATEMONOBRUSH, iUsage, 12) + TEST_FIELD_SIZE (EMRCREATEMONOBRUSH, offBmi, 4) + TEST_FIELD_ALIGN (EMRCREATEMONOBRUSH, offBmi, 4) + TEST_FIELD_OFFSET(EMRCREATEMONOBRUSH, offBmi, 16) + TEST_FIELD_SIZE (EMRCREATEMONOBRUSH, cbBmi, 4) + TEST_FIELD_ALIGN (EMRCREATEMONOBRUSH, cbBmi, 4) + TEST_FIELD_OFFSET(EMRCREATEMONOBRUSH, cbBmi, 20) + TEST_FIELD_SIZE (EMRCREATEMONOBRUSH, offBits, 4) + TEST_FIELD_ALIGN (EMRCREATEMONOBRUSH, offBits, 4) + TEST_FIELD_OFFSET(EMRCREATEMONOBRUSH, offBits, 24) + TEST_FIELD_SIZE (EMRCREATEMONOBRUSH, cbBits, 4) + TEST_FIELD_ALIGN (EMRCREATEMONOBRUSH, cbBits, 4) + TEST_FIELD_OFFSET(EMRCREATEMONOBRUSH, cbBits, 28) +} + +static void test_pack_EMRCREATEPEN(void) +{ + /* EMRCREATEPEN (pack 4) */ + TEST_TYPE_SIZE (EMRCREATEPEN, 28) + TEST_TYPE_ALIGN (EMRCREATEPEN, 4) + TEST_FIELD_SIZE (EMRCREATEPEN, emr, 8) + TEST_FIELD_ALIGN (EMRCREATEPEN, emr, 4) + TEST_FIELD_OFFSET(EMRCREATEPEN, emr, 0) + TEST_FIELD_SIZE (EMRCREATEPEN, ihPen, 4) + TEST_FIELD_ALIGN (EMRCREATEPEN, ihPen, 4) + TEST_FIELD_OFFSET(EMRCREATEPEN, ihPen, 8) + TEST_FIELD_SIZE (EMRCREATEPEN, lopn, 16) + TEST_FIELD_ALIGN (EMRCREATEPEN, lopn, 4) + TEST_FIELD_OFFSET(EMRCREATEPEN, lopn, 12) +} + +static void test_pack_EMRDELETECOLORSPACE(void) +{ + /* EMRDELETECOLORSPACE (pack 4) */ + TEST_TYPE_SIZE (EMRDELETECOLORSPACE, 12) + TEST_TYPE_ALIGN (EMRDELETECOLORSPACE, 4) + TEST_FIELD_SIZE (EMRDELETECOLORSPACE, emr, 8) + TEST_FIELD_ALIGN (EMRDELETECOLORSPACE, emr, 4) + TEST_FIELD_OFFSET(EMRDELETECOLORSPACE, emr, 0) + TEST_FIELD_SIZE (EMRDELETECOLORSPACE, ihCS, 4) + TEST_FIELD_ALIGN (EMRDELETECOLORSPACE, ihCS, 4) + TEST_FIELD_OFFSET(EMRDELETECOLORSPACE, ihCS, 8) +} + +static void test_pack_EMRDELETEOBJECT(void) +{ + /* EMRDELETEOBJECT (pack 4) */ + TEST_TYPE_SIZE (EMRDELETEOBJECT, 12) + TEST_TYPE_ALIGN (EMRDELETEOBJECT, 4) + TEST_FIELD_SIZE (EMRDELETEOBJECT, emr, 8) + TEST_FIELD_ALIGN (EMRDELETEOBJECT, emr, 4) + TEST_FIELD_OFFSET(EMRDELETEOBJECT, emr, 0) + TEST_FIELD_SIZE (EMRDELETEOBJECT, ihObject, 4) + TEST_FIELD_ALIGN (EMRDELETEOBJECT, ihObject, 4) + TEST_FIELD_OFFSET(EMRDELETEOBJECT, ihObject, 8) +} + +static void test_pack_EMRELLIPSE(void) +{ + /* EMRELLIPSE (pack 4) */ + TEST_TYPE_SIZE (EMRELLIPSE, 24) + TEST_TYPE_ALIGN (EMRELLIPSE, 4) + TEST_FIELD_SIZE (EMRELLIPSE, emr, 8) + TEST_FIELD_ALIGN (EMRELLIPSE, emr, 4) + TEST_FIELD_OFFSET(EMRELLIPSE, emr, 0) + TEST_FIELD_SIZE (EMRELLIPSE, rclBox, 16) + TEST_FIELD_ALIGN (EMRELLIPSE, rclBox, 4) + TEST_FIELD_OFFSET(EMRELLIPSE, rclBox, 8) +} + +static void test_pack_EMRENDPATH(void) +{ + /* EMRENDPATH (pack 4) */ + TEST_TYPE_SIZE (EMRENDPATH, 8) + TEST_TYPE_ALIGN (EMRENDPATH, 4) + TEST_FIELD_SIZE (EMRENDPATH, emr, 8) + TEST_FIELD_ALIGN (EMRENDPATH, emr, 4) + TEST_FIELD_OFFSET(EMRENDPATH, emr, 0) +} + +static void test_pack_EMREOF(void) +{ + /* EMREOF (pack 4) */ + TEST_TYPE_SIZE (EMREOF, 20) + TEST_TYPE_ALIGN (EMREOF, 4) + TEST_FIELD_SIZE (EMREOF, emr, 8) + TEST_FIELD_ALIGN (EMREOF, emr, 4) + TEST_FIELD_OFFSET(EMREOF, emr, 0) + TEST_FIELD_SIZE (EMREOF, nPalEntries, 4) + TEST_FIELD_ALIGN (EMREOF, nPalEntries, 4) + TEST_FIELD_OFFSET(EMREOF, nPalEntries, 8) + TEST_FIELD_SIZE (EMREOF, offPalEntries, 4) + TEST_FIELD_ALIGN (EMREOF, offPalEntries, 4) + TEST_FIELD_OFFSET(EMREOF, offPalEntries, 12) + TEST_FIELD_SIZE (EMREOF, nSizeLast, 4) + TEST_FIELD_ALIGN (EMREOF, nSizeLast, 4) + TEST_FIELD_OFFSET(EMREOF, nSizeLast, 16) +} + +static void test_pack_EMREXCLUDECLIPRECT(void) +{ + /* EMREXCLUDECLIPRECT (pack 4) */ + TEST_TYPE_SIZE (EMREXCLUDECLIPRECT, 24) + TEST_TYPE_ALIGN (EMREXCLUDECLIPRECT, 4) + TEST_FIELD_SIZE (EMREXCLUDECLIPRECT, emr, 8) + TEST_FIELD_ALIGN (EMREXCLUDECLIPRECT, emr, 4) + TEST_FIELD_OFFSET(EMREXCLUDECLIPRECT, emr, 0) + TEST_FIELD_SIZE (EMREXCLUDECLIPRECT, rclClip, 16) + TEST_FIELD_ALIGN (EMREXCLUDECLIPRECT, rclClip, 4) + TEST_FIELD_OFFSET(EMREXCLUDECLIPRECT, rclClip, 8) +} + +static void test_pack_EMREXTCREATEFONTINDIRECTW(void) +{ + /* EMREXTCREATEFONTINDIRECTW (pack 4) */ + TEST_TYPE_SIZE (EMREXTCREATEFONTINDIRECTW, 332) + TEST_TYPE_ALIGN (EMREXTCREATEFONTINDIRECTW, 4) + TEST_FIELD_SIZE (EMREXTCREATEFONTINDIRECTW, emr, 8) + TEST_FIELD_ALIGN (EMREXTCREATEFONTINDIRECTW, emr, 4) + TEST_FIELD_OFFSET(EMREXTCREATEFONTINDIRECTW, emr, 0) + TEST_FIELD_SIZE (EMREXTCREATEFONTINDIRECTW, ihFont, 4) + TEST_FIELD_ALIGN (EMREXTCREATEFONTINDIRECTW, ihFont, 4) + TEST_FIELD_OFFSET(EMREXTCREATEFONTINDIRECTW, ihFont, 8) + TEST_FIELD_SIZE (EMREXTCREATEFONTINDIRECTW, elfw, 320) + TEST_FIELD_ALIGN (EMREXTCREATEFONTINDIRECTW, elfw, 4) + TEST_FIELD_OFFSET(EMREXTCREATEFONTINDIRECTW, elfw, 12) +} + +static void test_pack_EMREXTCREATEPEN(void) +{ + /* EMREXTCREATEPEN (pack 4) */ + TEST_TYPE_SIZE (EMREXTCREATEPEN, 56) + TEST_TYPE_ALIGN (EMREXTCREATEPEN, 4) + TEST_FIELD_SIZE (EMREXTCREATEPEN, emr, 8) + TEST_FIELD_ALIGN (EMREXTCREATEPEN, emr, 4) + TEST_FIELD_OFFSET(EMREXTCREATEPEN, emr, 0) + TEST_FIELD_SIZE (EMREXTCREATEPEN, ihPen, 4) + TEST_FIELD_ALIGN (EMREXTCREATEPEN, ihPen, 4) + TEST_FIELD_OFFSET(EMREXTCREATEPEN, ihPen, 8) + TEST_FIELD_SIZE (EMREXTCREATEPEN, offBmi, 4) + TEST_FIELD_ALIGN (EMREXTCREATEPEN, offBmi, 4) + TEST_FIELD_OFFSET(EMREXTCREATEPEN, offBmi, 12) + TEST_FIELD_SIZE (EMREXTCREATEPEN, cbBmi, 4) + TEST_FIELD_ALIGN (EMREXTCREATEPEN, cbBmi, 4) + TEST_FIELD_OFFSET(EMREXTCREATEPEN, cbBmi, 16) + TEST_FIELD_SIZE (EMREXTCREATEPEN, offBits, 4) + TEST_FIELD_ALIGN (EMREXTCREATEPEN, offBits, 4) + TEST_FIELD_OFFSET(EMREXTCREATEPEN, offBits, 20) + TEST_FIELD_SIZE (EMREXTCREATEPEN, cbBits, 4) + TEST_FIELD_ALIGN (EMREXTCREATEPEN, cbBits, 4) + TEST_FIELD_OFFSET(EMREXTCREATEPEN, cbBits, 24) + TEST_FIELD_SIZE (EMREXTCREATEPEN, elp, 28) + TEST_FIELD_ALIGN (EMREXTCREATEPEN, elp, 4) + TEST_FIELD_OFFSET(EMREXTCREATEPEN, elp, 28) +} + +static void test_pack_EMREXTFLOODFILL(void) +{ + /* EMREXTFLOODFILL (pack 4) */ + TEST_TYPE_SIZE (EMREXTFLOODFILL, 24) + TEST_TYPE_ALIGN (EMREXTFLOODFILL, 4) + TEST_FIELD_SIZE (EMREXTFLOODFILL, emr, 8) + TEST_FIELD_ALIGN (EMREXTFLOODFILL, emr, 4) + TEST_FIELD_OFFSET(EMREXTFLOODFILL, emr, 0) + TEST_FIELD_SIZE (EMREXTFLOODFILL, ptlStart, 8) + TEST_FIELD_ALIGN (EMREXTFLOODFILL, ptlStart, 4) + TEST_FIELD_OFFSET(EMREXTFLOODFILL, ptlStart, 8) + TEST_FIELD_SIZE (EMREXTFLOODFILL, crColor, 4) + TEST_FIELD_ALIGN (EMREXTFLOODFILL, crColor, 4) + TEST_FIELD_OFFSET(EMREXTFLOODFILL, crColor, 16) + TEST_FIELD_SIZE (EMREXTFLOODFILL, iMode, 4) + TEST_FIELD_ALIGN (EMREXTFLOODFILL, iMode, 4) + TEST_FIELD_OFFSET(EMREXTFLOODFILL, iMode, 20) +} + +static void test_pack_EMREXTSELECTCLIPRGN(void) +{ + /* EMREXTSELECTCLIPRGN (pack 4) */ + TEST_TYPE_SIZE (EMREXTSELECTCLIPRGN, 20) + TEST_TYPE_ALIGN (EMREXTSELECTCLIPRGN, 4) + TEST_FIELD_SIZE (EMREXTSELECTCLIPRGN, emr, 8) + TEST_FIELD_ALIGN (EMREXTSELECTCLIPRGN, emr, 4) + TEST_FIELD_OFFSET(EMREXTSELECTCLIPRGN, emr, 0) + TEST_FIELD_SIZE (EMREXTSELECTCLIPRGN, cbRgnData, 4) + TEST_FIELD_ALIGN (EMREXTSELECTCLIPRGN, cbRgnData, 4) + TEST_FIELD_OFFSET(EMREXTSELECTCLIPRGN, cbRgnData, 8) + TEST_FIELD_SIZE (EMREXTSELECTCLIPRGN, iMode, 4) + TEST_FIELD_ALIGN (EMREXTSELECTCLIPRGN, iMode, 4) + TEST_FIELD_OFFSET(EMREXTSELECTCLIPRGN, iMode, 12) + TEST_FIELD_SIZE (EMREXTSELECTCLIPRGN, RgnData, 1) + TEST_FIELD_ALIGN (EMREXTSELECTCLIPRGN, RgnData, 1) + TEST_FIELD_OFFSET(EMREXTSELECTCLIPRGN, RgnData, 16) +} + +static void test_pack_EMREXTTEXTOUTA(void) +{ + /* EMREXTTEXTOUTA (pack 4) */ + TEST_TYPE_SIZE (EMREXTTEXTOUTA, 76) + TEST_TYPE_ALIGN (EMREXTTEXTOUTA, 4) + TEST_FIELD_SIZE (EMREXTTEXTOUTA, emr, 8) + TEST_FIELD_ALIGN (EMREXTTEXTOUTA, emr, 4) + TEST_FIELD_OFFSET(EMREXTTEXTOUTA, emr, 0) + TEST_FIELD_SIZE (EMREXTTEXTOUTA, rclBounds, 16) + TEST_FIELD_ALIGN (EMREXTTEXTOUTA, rclBounds, 4) + TEST_FIELD_OFFSET(EMREXTTEXTOUTA, rclBounds, 8) + TEST_FIELD_SIZE (EMREXTTEXTOUTA, iGraphicsMode, 4) + TEST_FIELD_ALIGN (EMREXTTEXTOUTA, iGraphicsMode, 4) + TEST_FIELD_OFFSET(EMREXTTEXTOUTA, iGraphicsMode, 24) + TEST_FIELD_SIZE (EMREXTTEXTOUTA, exScale, 4) + TEST_FIELD_ALIGN (EMREXTTEXTOUTA, exScale, 4) + TEST_FIELD_OFFSET(EMREXTTEXTOUTA, exScale, 28) + TEST_FIELD_SIZE (EMREXTTEXTOUTA, eyScale, 4) + TEST_FIELD_ALIGN (EMREXTTEXTOUTA, eyScale, 4) + TEST_FIELD_OFFSET(EMREXTTEXTOUTA, eyScale, 32) + TEST_FIELD_SIZE (EMREXTTEXTOUTA, emrtext, 40) + TEST_FIELD_ALIGN (EMREXTTEXTOUTA, emrtext, 4) + TEST_FIELD_OFFSET(EMREXTTEXTOUTA, emrtext, 36) +} + +static void test_pack_EMREXTTEXTOUTW(void) +{ + /* EMREXTTEXTOUTW (pack 4) */ + TEST_TYPE_SIZE (EMREXTTEXTOUTW, 76) + TEST_TYPE_ALIGN (EMREXTTEXTOUTW, 4) + TEST_FIELD_SIZE (EMREXTTEXTOUTW, emr, 8) + TEST_FIELD_ALIGN (EMREXTTEXTOUTW, emr, 4) + TEST_FIELD_OFFSET(EMREXTTEXTOUTW, emr, 0) + TEST_FIELD_SIZE (EMREXTTEXTOUTW, rclBounds, 16) + TEST_FIELD_ALIGN (EMREXTTEXTOUTW, rclBounds, 4) + TEST_FIELD_OFFSET(EMREXTTEXTOUTW, rclBounds, 8) + TEST_FIELD_SIZE (EMREXTTEXTOUTW, iGraphicsMode, 4) + TEST_FIELD_ALIGN (EMREXTTEXTOUTW, iGraphicsMode, 4) + TEST_FIELD_OFFSET(EMREXTTEXTOUTW, iGraphicsMode, 24) + TEST_FIELD_SIZE (EMREXTTEXTOUTW, exScale, 4) + TEST_FIELD_ALIGN (EMREXTTEXTOUTW, exScale, 4) + TEST_FIELD_OFFSET(EMREXTTEXTOUTW, exScale, 28) + TEST_FIELD_SIZE (EMREXTTEXTOUTW, eyScale, 4) + TEST_FIELD_ALIGN (EMREXTTEXTOUTW, eyScale, 4) + TEST_FIELD_OFFSET(EMREXTTEXTOUTW, eyScale, 32) + TEST_FIELD_SIZE (EMREXTTEXTOUTW, emrtext, 40) + TEST_FIELD_ALIGN (EMREXTTEXTOUTW, emrtext, 4) + TEST_FIELD_OFFSET(EMREXTTEXTOUTW, emrtext, 36) +} + +static void test_pack_EMRFILLPATH(void) +{ + /* EMRFILLPATH (pack 4) */ + TEST_TYPE_SIZE (EMRFILLPATH, 24) + TEST_TYPE_ALIGN (EMRFILLPATH, 4) + TEST_FIELD_SIZE (EMRFILLPATH, emr, 8) + TEST_FIELD_ALIGN (EMRFILLPATH, emr, 4) + TEST_FIELD_OFFSET(EMRFILLPATH, emr, 0) + TEST_FIELD_SIZE (EMRFILLPATH, rclBounds, 16) + TEST_FIELD_ALIGN (EMRFILLPATH, rclBounds, 4) + TEST_FIELD_OFFSET(EMRFILLPATH, rclBounds, 8) +} + +static void test_pack_EMRFILLRGN(void) +{ + /* EMRFILLRGN (pack 4) */ + TEST_TYPE_SIZE (EMRFILLRGN, 36) + TEST_TYPE_ALIGN (EMRFILLRGN, 4) + TEST_FIELD_SIZE (EMRFILLRGN, emr, 8) + TEST_FIELD_ALIGN (EMRFILLRGN, emr, 4) + TEST_FIELD_OFFSET(EMRFILLRGN, emr, 0) + TEST_FIELD_SIZE (EMRFILLRGN, rclBounds, 16) + TEST_FIELD_ALIGN (EMRFILLRGN, rclBounds, 4) + TEST_FIELD_OFFSET(EMRFILLRGN, rclBounds, 8) + TEST_FIELD_SIZE (EMRFILLRGN, cbRgnData, 4) + TEST_FIELD_ALIGN (EMRFILLRGN, cbRgnData, 4) + TEST_FIELD_OFFSET(EMRFILLRGN, cbRgnData, 24) + TEST_FIELD_SIZE (EMRFILLRGN, ihBrush, 4) + TEST_FIELD_ALIGN (EMRFILLRGN, ihBrush, 4) + TEST_FIELD_OFFSET(EMRFILLRGN, ihBrush, 28) + TEST_FIELD_SIZE (EMRFILLRGN, RgnData, 1) + TEST_FIELD_ALIGN (EMRFILLRGN, RgnData, 1) + TEST_FIELD_OFFSET(EMRFILLRGN, RgnData, 32) +} + +static void test_pack_EMRFLATTENPATH(void) +{ + /* EMRFLATTENPATH (pack 4) */ + TEST_TYPE_SIZE (EMRFLATTENPATH, 8) + TEST_TYPE_ALIGN (EMRFLATTENPATH, 4) + TEST_FIELD_SIZE (EMRFLATTENPATH, emr, 8) + TEST_FIELD_ALIGN (EMRFLATTENPATH, emr, 4) + TEST_FIELD_OFFSET(EMRFLATTENPATH, emr, 0) +} + +static void test_pack_EMRFORMAT(void) +{ + /* EMRFORMAT (pack 4) */ + TEST_TYPE_SIZE (EMRFORMAT, 16) + TEST_TYPE_ALIGN (EMRFORMAT, 4) + TEST_FIELD_SIZE (EMRFORMAT, dSignature, 4) + TEST_FIELD_ALIGN (EMRFORMAT, dSignature, 4) + TEST_FIELD_OFFSET(EMRFORMAT, dSignature, 0) + TEST_FIELD_SIZE (EMRFORMAT, nVersion, 4) + TEST_FIELD_ALIGN (EMRFORMAT, nVersion, 4) + TEST_FIELD_OFFSET(EMRFORMAT, nVersion, 4) + TEST_FIELD_SIZE (EMRFORMAT, cbData, 4) + TEST_FIELD_ALIGN (EMRFORMAT, cbData, 4) + TEST_FIELD_OFFSET(EMRFORMAT, cbData, 8) + TEST_FIELD_SIZE (EMRFORMAT, offData, 4) + TEST_FIELD_ALIGN (EMRFORMAT, offData, 4) + TEST_FIELD_OFFSET(EMRFORMAT, offData, 12) +} + +static void test_pack_EMRFRAMERGN(void) +{ + /* EMRFRAMERGN (pack 4) */ + TEST_TYPE_SIZE (EMRFRAMERGN, 44) + TEST_TYPE_ALIGN (EMRFRAMERGN, 4) + TEST_FIELD_SIZE (EMRFRAMERGN, emr, 8) + TEST_FIELD_ALIGN (EMRFRAMERGN, emr, 4) + TEST_FIELD_OFFSET(EMRFRAMERGN, emr, 0) + TEST_FIELD_SIZE (EMRFRAMERGN, rclBounds, 16) + TEST_FIELD_ALIGN (EMRFRAMERGN, rclBounds, 4) + TEST_FIELD_OFFSET(EMRFRAMERGN, rclBounds, 8) + TEST_FIELD_SIZE (EMRFRAMERGN, cbRgnData, 4) + TEST_FIELD_ALIGN (EMRFRAMERGN, cbRgnData, 4) + TEST_FIELD_OFFSET(EMRFRAMERGN, cbRgnData, 24) + TEST_FIELD_SIZE (EMRFRAMERGN, ihBrush, 4) + TEST_FIELD_ALIGN (EMRFRAMERGN, ihBrush, 4) + TEST_FIELD_OFFSET(EMRFRAMERGN, ihBrush, 28) + TEST_FIELD_SIZE (EMRFRAMERGN, szlStroke, 8) + TEST_FIELD_ALIGN (EMRFRAMERGN, szlStroke, 4) + TEST_FIELD_OFFSET(EMRFRAMERGN, szlStroke, 32) + TEST_FIELD_SIZE (EMRFRAMERGN, RgnData, 1) + TEST_FIELD_ALIGN (EMRFRAMERGN, RgnData, 1) + TEST_FIELD_OFFSET(EMRFRAMERGN, RgnData, 40) +} + +static void test_pack_EMRGDICOMMENT(void) +{ + /* EMRGDICOMMENT (pack 4) */ + TEST_TYPE_SIZE (EMRGDICOMMENT, 16) + TEST_TYPE_ALIGN (EMRGDICOMMENT, 4) + TEST_FIELD_SIZE (EMRGDICOMMENT, emr, 8) + TEST_FIELD_ALIGN (EMRGDICOMMENT, emr, 4) + TEST_FIELD_OFFSET(EMRGDICOMMENT, emr, 0) + TEST_FIELD_SIZE (EMRGDICOMMENT, cbData, 4) + TEST_FIELD_ALIGN (EMRGDICOMMENT, cbData, 4) + TEST_FIELD_OFFSET(EMRGDICOMMENT, cbData, 8) + TEST_FIELD_SIZE (EMRGDICOMMENT, Data, 1) + TEST_FIELD_ALIGN (EMRGDICOMMENT, Data, 1) + TEST_FIELD_OFFSET(EMRGDICOMMENT, Data, 12) +} + +static void test_pack_EMRGLSBOUNDEDRECORD(void) +{ + /* EMRGLSBOUNDEDRECORD (pack 4) */ + TEST_TYPE_SIZE (EMRGLSBOUNDEDRECORD, 32) + TEST_TYPE_ALIGN (EMRGLSBOUNDEDRECORD, 4) + TEST_FIELD_SIZE (EMRGLSBOUNDEDRECORD, emr, 8) + TEST_FIELD_ALIGN (EMRGLSBOUNDEDRECORD, emr, 4) + TEST_FIELD_OFFSET(EMRGLSBOUNDEDRECORD, emr, 0) + TEST_FIELD_SIZE (EMRGLSBOUNDEDRECORD, rclBounds, 16) + TEST_FIELD_ALIGN (EMRGLSBOUNDEDRECORD, rclBounds, 4) + TEST_FIELD_OFFSET(EMRGLSBOUNDEDRECORD, rclBounds, 8) + TEST_FIELD_SIZE (EMRGLSBOUNDEDRECORD, cbData, 4) + TEST_FIELD_ALIGN (EMRGLSBOUNDEDRECORD, cbData, 4) + TEST_FIELD_OFFSET(EMRGLSBOUNDEDRECORD, cbData, 24) + TEST_FIELD_SIZE (EMRGLSBOUNDEDRECORD, Data, 1) + TEST_FIELD_ALIGN (EMRGLSBOUNDEDRECORD, Data, 1) + TEST_FIELD_OFFSET(EMRGLSBOUNDEDRECORD, Data, 28) +} + +static void test_pack_EMRGLSRECORD(void) +{ + /* EMRGLSRECORD (pack 4) */ + TEST_TYPE_SIZE (EMRGLSRECORD, 16) + TEST_TYPE_ALIGN (EMRGLSRECORD, 4) + TEST_FIELD_SIZE (EMRGLSRECORD, emr, 8) + TEST_FIELD_ALIGN (EMRGLSRECORD, emr, 4) + TEST_FIELD_OFFSET(EMRGLSRECORD, emr, 0) + TEST_FIELD_SIZE (EMRGLSRECORD, cbData, 4) + TEST_FIELD_ALIGN (EMRGLSRECORD, cbData, 4) + TEST_FIELD_OFFSET(EMRGLSRECORD, cbData, 8) + TEST_FIELD_SIZE (EMRGLSRECORD, Data, 1) + TEST_FIELD_ALIGN (EMRGLSRECORD, Data, 1) + TEST_FIELD_OFFSET(EMRGLSRECORD, Data, 12) +} + +static void test_pack_EMRINTERSECTCLIPRECT(void) +{ + /* EMRINTERSECTCLIPRECT (pack 4) */ + TEST_TYPE_SIZE (EMRINTERSECTCLIPRECT, 24) + TEST_TYPE_ALIGN (EMRINTERSECTCLIPRECT, 4) + TEST_FIELD_SIZE (EMRINTERSECTCLIPRECT, emr, 8) + TEST_FIELD_ALIGN (EMRINTERSECTCLIPRECT, emr, 4) + TEST_FIELD_OFFSET(EMRINTERSECTCLIPRECT, emr, 0) + TEST_FIELD_SIZE (EMRINTERSECTCLIPRECT, rclClip, 16) + TEST_FIELD_ALIGN (EMRINTERSECTCLIPRECT, rclClip, 4) + TEST_FIELD_OFFSET(EMRINTERSECTCLIPRECT, rclClip, 8) +} + +static void test_pack_EMRINVERTRGN(void) +{ + /* EMRINVERTRGN (pack 4) */ + TEST_TYPE_SIZE (EMRINVERTRGN, 32) + TEST_TYPE_ALIGN (EMRINVERTRGN, 4) + TEST_FIELD_SIZE (EMRINVERTRGN, emr, 8) + TEST_FIELD_ALIGN (EMRINVERTRGN, emr, 4) + TEST_FIELD_OFFSET(EMRINVERTRGN, emr, 0) + TEST_FIELD_SIZE (EMRINVERTRGN, rclBounds, 16) + TEST_FIELD_ALIGN (EMRINVERTRGN, rclBounds, 4) + TEST_FIELD_OFFSET(EMRINVERTRGN, rclBounds, 8) + TEST_FIELD_SIZE (EMRINVERTRGN, cbRgnData, 4) + TEST_FIELD_ALIGN (EMRINVERTRGN, cbRgnData, 4) + TEST_FIELD_OFFSET(EMRINVERTRGN, cbRgnData, 24) + TEST_FIELD_SIZE (EMRINVERTRGN, RgnData, 1) + TEST_FIELD_ALIGN (EMRINVERTRGN, RgnData, 1) + TEST_FIELD_OFFSET(EMRINVERTRGN, RgnData, 28) +} + +static void test_pack_EMRLINETO(void) +{ + /* EMRLINETO (pack 4) */ + TEST_TYPE_SIZE (EMRLINETO, 16) + TEST_TYPE_ALIGN (EMRLINETO, 4) + TEST_FIELD_SIZE (EMRLINETO, emr, 8) + TEST_FIELD_ALIGN (EMRLINETO, emr, 4) + TEST_FIELD_OFFSET(EMRLINETO, emr, 0) + TEST_FIELD_SIZE (EMRLINETO, ptl, 8) + TEST_FIELD_ALIGN (EMRLINETO, ptl, 4) + TEST_FIELD_OFFSET(EMRLINETO, ptl, 8) +} + +static void test_pack_EMRMASKBLT(void) +{ + /* EMRMASKBLT (pack 4) */ + TEST_TYPE_SIZE (EMRMASKBLT, 128) + TEST_TYPE_ALIGN (EMRMASKBLT, 4) + TEST_FIELD_SIZE (EMRMASKBLT, emr, 8) + TEST_FIELD_ALIGN (EMRMASKBLT, emr, 4) + TEST_FIELD_OFFSET(EMRMASKBLT, emr, 0) + TEST_FIELD_SIZE (EMRMASKBLT, rclBounds, 16) + TEST_FIELD_ALIGN (EMRMASKBLT, rclBounds, 4) + TEST_FIELD_OFFSET(EMRMASKBLT, rclBounds, 8) + TEST_FIELD_SIZE (EMRMASKBLT, xDest, 4) + TEST_FIELD_ALIGN (EMRMASKBLT, xDest, 4) + TEST_FIELD_OFFSET(EMRMASKBLT, xDest, 24) + TEST_FIELD_SIZE (EMRMASKBLT, yDest, 4) + TEST_FIELD_ALIGN (EMRMASKBLT, yDest, 4) + TEST_FIELD_OFFSET(EMRMASKBLT, yDest, 28) + TEST_FIELD_SIZE (EMRMASKBLT, cxDest, 4) + TEST_FIELD_ALIGN (EMRMASKBLT, cxDest, 4) + TEST_FIELD_OFFSET(EMRMASKBLT, cxDest, 32) + TEST_FIELD_SIZE (EMRMASKBLT, cyDest, 4) + TEST_FIELD_ALIGN (EMRMASKBLT, cyDest, 4) + TEST_FIELD_OFFSET(EMRMASKBLT, cyDest, 36) + TEST_FIELD_SIZE (EMRMASKBLT, dwRop, 4) + TEST_FIELD_ALIGN (EMRMASKBLT, dwRop, 4) + TEST_FIELD_OFFSET(EMRMASKBLT, dwRop, 40) + TEST_FIELD_SIZE (EMRMASKBLT, xSrc, 4) + TEST_FIELD_ALIGN (EMRMASKBLT, xSrc, 4) + TEST_FIELD_OFFSET(EMRMASKBLT, xSrc, 44) + TEST_FIELD_SIZE (EMRMASKBLT, ySrc, 4) + TEST_FIELD_ALIGN (EMRMASKBLT, ySrc, 4) + TEST_FIELD_OFFSET(EMRMASKBLT, ySrc, 48) + TEST_FIELD_SIZE (EMRMASKBLT, xformSrc, 24) + TEST_FIELD_ALIGN (EMRMASKBLT, xformSrc, 4) + TEST_FIELD_OFFSET(EMRMASKBLT, xformSrc, 52) + TEST_FIELD_SIZE (EMRMASKBLT, crBkColorSrc, 4) + TEST_FIELD_ALIGN (EMRMASKBLT, crBkColorSrc, 4) + TEST_FIELD_OFFSET(EMRMASKBLT, crBkColorSrc, 76) + TEST_FIELD_SIZE (EMRMASKBLT, iUsageSrc, 4) + TEST_FIELD_ALIGN (EMRMASKBLT, iUsageSrc, 4) + TEST_FIELD_OFFSET(EMRMASKBLT, iUsageSrc, 80) + TEST_FIELD_SIZE (EMRMASKBLT, offBmiSrc, 4) + TEST_FIELD_ALIGN (EMRMASKBLT, offBmiSrc, 4) + TEST_FIELD_OFFSET(EMRMASKBLT, offBmiSrc, 84) + TEST_FIELD_SIZE (EMRMASKBLT, cbBmiSrc, 4) + TEST_FIELD_ALIGN (EMRMASKBLT, cbBmiSrc, 4) + TEST_FIELD_OFFSET(EMRMASKBLT, cbBmiSrc, 88) + TEST_FIELD_SIZE (EMRMASKBLT, offBitsSrc, 4) + TEST_FIELD_ALIGN (EMRMASKBLT, offBitsSrc, 4) + TEST_FIELD_OFFSET(EMRMASKBLT, offBitsSrc, 92) + TEST_FIELD_SIZE (EMRMASKBLT, cbBitsSrc, 4) + TEST_FIELD_ALIGN (EMRMASKBLT, cbBitsSrc, 4) + TEST_FIELD_OFFSET(EMRMASKBLT, cbBitsSrc, 96) + TEST_FIELD_SIZE (EMRMASKBLT, xMask, 4) + TEST_FIELD_ALIGN (EMRMASKBLT, xMask, 4) + TEST_FIELD_OFFSET(EMRMASKBLT, xMask, 100) + TEST_FIELD_SIZE (EMRMASKBLT, yMask, 4) + TEST_FIELD_ALIGN (EMRMASKBLT, yMask, 4) + TEST_FIELD_OFFSET(EMRMASKBLT, yMask, 104) + TEST_FIELD_SIZE (EMRMASKBLT, iUsageMask, 4) + TEST_FIELD_ALIGN (EMRMASKBLT, iUsageMask, 4) + TEST_FIELD_OFFSET(EMRMASKBLT, iUsageMask, 108) + TEST_FIELD_SIZE (EMRMASKBLT, offBmiMask, 4) + TEST_FIELD_ALIGN (EMRMASKBLT, offBmiMask, 4) + TEST_FIELD_OFFSET(EMRMASKBLT, offBmiMask, 112) + TEST_FIELD_SIZE (EMRMASKBLT, cbBmiMask, 4) + TEST_FIELD_ALIGN (EMRMASKBLT, cbBmiMask, 4) + TEST_FIELD_OFFSET(EMRMASKBLT, cbBmiMask, 116) + TEST_FIELD_SIZE (EMRMASKBLT, offBitsMask, 4) + TEST_FIELD_ALIGN (EMRMASKBLT, offBitsMask, 4) + TEST_FIELD_OFFSET(EMRMASKBLT, offBitsMask, 120) + TEST_FIELD_SIZE (EMRMASKBLT, cbBitsMask, 4) + TEST_FIELD_ALIGN (EMRMASKBLT, cbBitsMask, 4) + TEST_FIELD_OFFSET(EMRMASKBLT, cbBitsMask, 124) +} + +static void test_pack_EMRMODIFYWORLDTRANSFORM(void) +{ + /* EMRMODIFYWORLDTRANSFORM (pack 4) */ + TEST_TYPE_SIZE (EMRMODIFYWORLDTRANSFORM, 36) + TEST_TYPE_ALIGN (EMRMODIFYWORLDTRANSFORM, 4) + TEST_FIELD_SIZE (EMRMODIFYWORLDTRANSFORM, emr, 8) + TEST_FIELD_ALIGN (EMRMODIFYWORLDTRANSFORM, emr, 4) + TEST_FIELD_OFFSET(EMRMODIFYWORLDTRANSFORM, emr, 0) + TEST_FIELD_SIZE (EMRMODIFYWORLDTRANSFORM, xform, 24) + TEST_FIELD_ALIGN (EMRMODIFYWORLDTRANSFORM, xform, 4) + TEST_FIELD_OFFSET(EMRMODIFYWORLDTRANSFORM, xform, 8) + TEST_FIELD_SIZE (EMRMODIFYWORLDTRANSFORM, iMode, 4) + TEST_FIELD_ALIGN (EMRMODIFYWORLDTRANSFORM, iMode, 4) + TEST_FIELD_OFFSET(EMRMODIFYWORLDTRANSFORM, iMode, 32) +} + +static void test_pack_EMRMOVETOEX(void) +{ + /* EMRMOVETOEX (pack 4) */ + TEST_TYPE_SIZE (EMRMOVETOEX, 16) + TEST_TYPE_ALIGN (EMRMOVETOEX, 4) + TEST_FIELD_SIZE (EMRMOVETOEX, emr, 8) + TEST_FIELD_ALIGN (EMRMOVETOEX, emr, 4) + TEST_FIELD_OFFSET(EMRMOVETOEX, emr, 0) + TEST_FIELD_SIZE (EMRMOVETOEX, ptl, 8) + TEST_FIELD_ALIGN (EMRMOVETOEX, ptl, 4) + TEST_FIELD_OFFSET(EMRMOVETOEX, ptl, 8) +} + +static void test_pack_EMROFFSETCLIPRGN(void) +{ + /* EMROFFSETCLIPRGN (pack 4) */ + TEST_TYPE_SIZE (EMROFFSETCLIPRGN, 16) + TEST_TYPE_ALIGN (EMROFFSETCLIPRGN, 4) + TEST_FIELD_SIZE (EMROFFSETCLIPRGN, emr, 8) + TEST_FIELD_ALIGN (EMROFFSETCLIPRGN, emr, 4) + TEST_FIELD_OFFSET(EMROFFSETCLIPRGN, emr, 0) + TEST_FIELD_SIZE (EMROFFSETCLIPRGN, ptlOffset, 8) + TEST_FIELD_ALIGN (EMROFFSETCLIPRGN, ptlOffset, 4) + TEST_FIELD_OFFSET(EMROFFSETCLIPRGN, ptlOffset, 8) +} + +static void test_pack_EMRPAINTRGN(void) +{ + /* EMRPAINTRGN (pack 4) */ + TEST_TYPE_SIZE (EMRPAINTRGN, 32) + TEST_TYPE_ALIGN (EMRPAINTRGN, 4) + TEST_FIELD_SIZE (EMRPAINTRGN, emr, 8) + TEST_FIELD_ALIGN (EMRPAINTRGN, emr, 4) + TEST_FIELD_OFFSET(EMRPAINTRGN, emr, 0) + TEST_FIELD_SIZE (EMRPAINTRGN, rclBounds, 16) + TEST_FIELD_ALIGN (EMRPAINTRGN, rclBounds, 4) + TEST_FIELD_OFFSET(EMRPAINTRGN, rclBounds, 8) + TEST_FIELD_SIZE (EMRPAINTRGN, cbRgnData, 4) + TEST_FIELD_ALIGN (EMRPAINTRGN, cbRgnData, 4) + TEST_FIELD_OFFSET(EMRPAINTRGN, cbRgnData, 24) + TEST_FIELD_SIZE (EMRPAINTRGN, RgnData, 1) + TEST_FIELD_ALIGN (EMRPAINTRGN, RgnData, 1) + TEST_FIELD_OFFSET(EMRPAINTRGN, RgnData, 28) +} + +static void test_pack_EMRPIE(void) +{ + /* EMRPIE (pack 4) */ + TEST_TYPE_SIZE (EMRPIE, 40) + TEST_TYPE_ALIGN (EMRPIE, 4) + TEST_FIELD_SIZE (EMRPIE, emr, 8) + TEST_FIELD_ALIGN (EMRPIE, emr, 4) + TEST_FIELD_OFFSET(EMRPIE, emr, 0) + TEST_FIELD_SIZE (EMRPIE, rclBox, 16) + TEST_FIELD_ALIGN (EMRPIE, rclBox, 4) + TEST_FIELD_OFFSET(EMRPIE, rclBox, 8) + TEST_FIELD_SIZE (EMRPIE, ptlStart, 8) + TEST_FIELD_ALIGN (EMRPIE, ptlStart, 4) + TEST_FIELD_OFFSET(EMRPIE, ptlStart, 24) + TEST_FIELD_SIZE (EMRPIE, ptlEnd, 8) + TEST_FIELD_ALIGN (EMRPIE, ptlEnd, 4) + TEST_FIELD_OFFSET(EMRPIE, ptlEnd, 32) +} + +static void test_pack_EMRPIXELFORMAT(void) +{ + /* EMRPIXELFORMAT (pack 4) */ + TEST_TYPE_SIZE (EMRPIXELFORMAT, 48) + TEST_TYPE_ALIGN (EMRPIXELFORMAT, 4) + TEST_FIELD_SIZE (EMRPIXELFORMAT, emr, 8) + TEST_FIELD_ALIGN (EMRPIXELFORMAT, emr, 4) + TEST_FIELD_OFFSET(EMRPIXELFORMAT, emr, 0) + TEST_FIELD_SIZE (EMRPIXELFORMAT, pfd, 40) + TEST_FIELD_ALIGN (EMRPIXELFORMAT, pfd, 4) + TEST_FIELD_OFFSET(EMRPIXELFORMAT, pfd, 8) +} + +static void test_pack_EMRPLGBLT(void) +{ + /* EMRPLGBLT (pack 4) */ + TEST_TYPE_SIZE (EMRPLGBLT, 140) + TEST_TYPE_ALIGN (EMRPLGBLT, 4) + TEST_FIELD_SIZE (EMRPLGBLT, emr, 8) + TEST_FIELD_ALIGN (EMRPLGBLT, emr, 4) + TEST_FIELD_OFFSET(EMRPLGBLT, emr, 0) + TEST_FIELD_SIZE (EMRPLGBLT, rclBounds, 16) + TEST_FIELD_ALIGN (EMRPLGBLT, rclBounds, 4) + TEST_FIELD_OFFSET(EMRPLGBLT, rclBounds, 8) + TEST_FIELD_SIZE (EMRPLGBLT, aptlDest, 24) + TEST_FIELD_ALIGN (EMRPLGBLT, aptlDest, 4) + TEST_FIELD_OFFSET(EMRPLGBLT, aptlDest, 24) + TEST_FIELD_SIZE (EMRPLGBLT, xSrc, 4) + TEST_FIELD_ALIGN (EMRPLGBLT, xSrc, 4) + TEST_FIELD_OFFSET(EMRPLGBLT, xSrc, 48) + TEST_FIELD_SIZE (EMRPLGBLT, ySrc, 4) + TEST_FIELD_ALIGN (EMRPLGBLT, ySrc, 4) + TEST_FIELD_OFFSET(EMRPLGBLT, ySrc, 52) + TEST_FIELD_SIZE (EMRPLGBLT, cxSrc, 4) + TEST_FIELD_ALIGN (EMRPLGBLT, cxSrc, 4) + TEST_FIELD_OFFSET(EMRPLGBLT, cxSrc, 56) + TEST_FIELD_SIZE (EMRPLGBLT, cySrc, 4) + TEST_FIELD_ALIGN (EMRPLGBLT, cySrc, 4) + TEST_FIELD_OFFSET(EMRPLGBLT, cySrc, 60) + TEST_FIELD_SIZE (EMRPLGBLT, xformSrc, 24) + TEST_FIELD_ALIGN (EMRPLGBLT, xformSrc, 4) + TEST_FIELD_OFFSET(EMRPLGBLT, xformSrc, 64) + TEST_FIELD_SIZE (EMRPLGBLT, crBkColorSrc, 4) + TEST_FIELD_ALIGN (EMRPLGBLT, crBkColorSrc, 4) + TEST_FIELD_OFFSET(EMRPLGBLT, crBkColorSrc, 88) + TEST_FIELD_SIZE (EMRPLGBLT, iUsageSrc, 4) + TEST_FIELD_ALIGN (EMRPLGBLT, iUsageSrc, 4) + TEST_FIELD_OFFSET(EMRPLGBLT, iUsageSrc, 92) + TEST_FIELD_SIZE (EMRPLGBLT, offBmiSrc, 4) + TEST_FIELD_ALIGN (EMRPLGBLT, offBmiSrc, 4) + TEST_FIELD_OFFSET(EMRPLGBLT, offBmiSrc, 96) + TEST_FIELD_SIZE (EMRPLGBLT, cbBmiSrc, 4) + TEST_FIELD_ALIGN (EMRPLGBLT, cbBmiSrc, 4) + TEST_FIELD_OFFSET(EMRPLGBLT, cbBmiSrc, 100) + TEST_FIELD_SIZE (EMRPLGBLT, offBitsSrc, 4) + TEST_FIELD_ALIGN (EMRPLGBLT, offBitsSrc, 4) + TEST_FIELD_OFFSET(EMRPLGBLT, offBitsSrc, 104) + TEST_FIELD_SIZE (EMRPLGBLT, cbBitsSrc, 4) + TEST_FIELD_ALIGN (EMRPLGBLT, cbBitsSrc, 4) + TEST_FIELD_OFFSET(EMRPLGBLT, cbBitsSrc, 108) + TEST_FIELD_SIZE (EMRPLGBLT, xMask, 4) + TEST_FIELD_ALIGN (EMRPLGBLT, xMask, 4) + TEST_FIELD_OFFSET(EMRPLGBLT, xMask, 112) + TEST_FIELD_SIZE (EMRPLGBLT, yMask, 4) + TEST_FIELD_ALIGN (EMRPLGBLT, yMask, 4) + TEST_FIELD_OFFSET(EMRPLGBLT, yMask, 116) + TEST_FIELD_SIZE (EMRPLGBLT, iUsageMask, 4) + TEST_FIELD_ALIGN (EMRPLGBLT, iUsageMask, 4) + TEST_FIELD_OFFSET(EMRPLGBLT, iUsageMask, 120) + TEST_FIELD_SIZE (EMRPLGBLT, offBmiMask, 4) + TEST_FIELD_ALIGN (EMRPLGBLT, offBmiMask, 4) + TEST_FIELD_OFFSET(EMRPLGBLT, offBmiMask, 124) + TEST_FIELD_SIZE (EMRPLGBLT, cbBmiMask, 4) + TEST_FIELD_ALIGN (EMRPLGBLT, cbBmiMask, 4) + TEST_FIELD_OFFSET(EMRPLGBLT, cbBmiMask, 128) + TEST_FIELD_SIZE (EMRPLGBLT, offBitsMask, 4) + TEST_FIELD_ALIGN (EMRPLGBLT, offBitsMask, 4) + TEST_FIELD_OFFSET(EMRPLGBLT, offBitsMask, 132) + TEST_FIELD_SIZE (EMRPLGBLT, cbBitsMask, 4) + TEST_FIELD_ALIGN (EMRPLGBLT, cbBitsMask, 4) + TEST_FIELD_OFFSET(EMRPLGBLT, cbBitsMask, 136) +} + +static void test_pack_EMRPOLYBEZIER(void) +{ + /* EMRPOLYBEZIER (pack 4) */ + TEST_TYPE_SIZE (EMRPOLYBEZIER, 36) + TEST_TYPE_ALIGN (EMRPOLYBEZIER, 4) + TEST_FIELD_SIZE (EMRPOLYBEZIER, emr, 8) + TEST_FIELD_ALIGN (EMRPOLYBEZIER, emr, 4) + TEST_FIELD_OFFSET(EMRPOLYBEZIER, emr, 0) + TEST_FIELD_SIZE (EMRPOLYBEZIER, rclBounds, 16) + TEST_FIELD_ALIGN (EMRPOLYBEZIER, rclBounds, 4) + TEST_FIELD_OFFSET(EMRPOLYBEZIER, rclBounds, 8) + TEST_FIELD_SIZE (EMRPOLYBEZIER, cptl, 4) + TEST_FIELD_ALIGN (EMRPOLYBEZIER, cptl, 4) + TEST_FIELD_OFFSET(EMRPOLYBEZIER, cptl, 24) + TEST_FIELD_SIZE (EMRPOLYBEZIER, aptl, 8) + TEST_FIELD_ALIGN (EMRPOLYBEZIER, aptl, 4) + TEST_FIELD_OFFSET(EMRPOLYBEZIER, aptl, 28) +} + +static void test_pack_EMRPOLYBEZIER16(void) +{ + /* EMRPOLYBEZIER16 (pack 4) */ + TEST_TYPE_SIZE (EMRPOLYBEZIER16, 32) + TEST_TYPE_ALIGN (EMRPOLYBEZIER16, 4) + TEST_FIELD_SIZE (EMRPOLYBEZIER16, emr, 8) + TEST_FIELD_ALIGN (EMRPOLYBEZIER16, emr, 4) + TEST_FIELD_OFFSET(EMRPOLYBEZIER16, emr, 0) + TEST_FIELD_SIZE (EMRPOLYBEZIER16, rclBounds, 16) + TEST_FIELD_ALIGN (EMRPOLYBEZIER16, rclBounds, 4) + TEST_FIELD_OFFSET(EMRPOLYBEZIER16, rclBounds, 8) + TEST_FIELD_SIZE (EMRPOLYBEZIER16, cpts, 4) + TEST_FIELD_ALIGN (EMRPOLYBEZIER16, cpts, 4) + TEST_FIELD_OFFSET(EMRPOLYBEZIER16, cpts, 24) + TEST_FIELD_SIZE (EMRPOLYBEZIER16, apts, 4) + TEST_FIELD_ALIGN (EMRPOLYBEZIER16, apts, 2) + TEST_FIELD_OFFSET(EMRPOLYBEZIER16, apts, 28) +} + +static void test_pack_EMRPOLYBEZIERTO(void) +{ + /* EMRPOLYBEZIERTO (pack 4) */ + TEST_TYPE_SIZE (EMRPOLYBEZIERTO, 36) + TEST_TYPE_ALIGN (EMRPOLYBEZIERTO, 4) + TEST_FIELD_SIZE (EMRPOLYBEZIERTO, emr, 8) + TEST_FIELD_ALIGN (EMRPOLYBEZIERTO, emr, 4) + TEST_FIELD_OFFSET(EMRPOLYBEZIERTO, emr, 0) + TEST_FIELD_SIZE (EMRPOLYBEZIERTO, rclBounds, 16) + TEST_FIELD_ALIGN (EMRPOLYBEZIERTO, rclBounds, 4) + TEST_FIELD_OFFSET(EMRPOLYBEZIERTO, rclBounds, 8) + TEST_FIELD_SIZE (EMRPOLYBEZIERTO, cptl, 4) + TEST_FIELD_ALIGN (EMRPOLYBEZIERTO, cptl, 4) + TEST_FIELD_OFFSET(EMRPOLYBEZIERTO, cptl, 24) + TEST_FIELD_SIZE (EMRPOLYBEZIERTO, aptl, 8) + TEST_FIELD_ALIGN (EMRPOLYBEZIERTO, aptl, 4) + TEST_FIELD_OFFSET(EMRPOLYBEZIERTO, aptl, 28) +} + +static void test_pack_EMRPOLYBEZIERTO16(void) +{ + /* EMRPOLYBEZIERTO16 (pack 4) */ + TEST_TYPE_SIZE (EMRPOLYBEZIERTO16, 32) + TEST_TYPE_ALIGN (EMRPOLYBEZIERTO16, 4) + TEST_FIELD_SIZE (EMRPOLYBEZIERTO16, emr, 8) + TEST_FIELD_ALIGN (EMRPOLYBEZIERTO16, emr, 4) + TEST_FIELD_OFFSET(EMRPOLYBEZIERTO16, emr, 0) + TEST_FIELD_SIZE (EMRPOLYBEZIERTO16, rclBounds, 16) + TEST_FIELD_ALIGN (EMRPOLYBEZIERTO16, rclBounds, 4) + TEST_FIELD_OFFSET(EMRPOLYBEZIERTO16, rclBounds, 8) + TEST_FIELD_SIZE (EMRPOLYBEZIERTO16, cpts, 4) + TEST_FIELD_ALIGN (EMRPOLYBEZIERTO16, cpts, 4) + TEST_FIELD_OFFSET(EMRPOLYBEZIERTO16, cpts, 24) + TEST_FIELD_SIZE (EMRPOLYBEZIERTO16, apts, 4) + TEST_FIELD_ALIGN (EMRPOLYBEZIERTO16, apts, 2) + TEST_FIELD_OFFSET(EMRPOLYBEZIERTO16, apts, 28) +} + +static void test_pack_EMRPOLYDRAW(void) +{ + /* EMRPOLYDRAW (pack 4) */ + TEST_TYPE_SIZE (EMRPOLYDRAW, 40) + TEST_TYPE_ALIGN (EMRPOLYDRAW, 4) + TEST_FIELD_SIZE (EMRPOLYDRAW, emr, 8) + TEST_FIELD_ALIGN (EMRPOLYDRAW, emr, 4) + TEST_FIELD_OFFSET(EMRPOLYDRAW, emr, 0) + TEST_FIELD_SIZE (EMRPOLYDRAW, rclBounds, 16) + TEST_FIELD_ALIGN (EMRPOLYDRAW, rclBounds, 4) + TEST_FIELD_OFFSET(EMRPOLYDRAW, rclBounds, 8) + TEST_FIELD_SIZE (EMRPOLYDRAW, cptl, 4) + TEST_FIELD_ALIGN (EMRPOLYDRAW, cptl, 4) + TEST_FIELD_OFFSET(EMRPOLYDRAW, cptl, 24) + TEST_FIELD_SIZE (EMRPOLYDRAW, aptl, 8) + TEST_FIELD_ALIGN (EMRPOLYDRAW, aptl, 4) + TEST_FIELD_OFFSET(EMRPOLYDRAW, aptl, 28) + TEST_FIELD_SIZE (EMRPOLYDRAW, abTypes, 1) + TEST_FIELD_ALIGN (EMRPOLYDRAW, abTypes, 1) + TEST_FIELD_OFFSET(EMRPOLYDRAW, abTypes, 36) +} + +static void test_pack_EMRPOLYDRAW16(void) +{ + /* EMRPOLYDRAW16 (pack 4) */ + TEST_TYPE_SIZE (EMRPOLYDRAW16, 36) + TEST_TYPE_ALIGN (EMRPOLYDRAW16, 4) + TEST_FIELD_SIZE (EMRPOLYDRAW16, emr, 8) + TEST_FIELD_ALIGN (EMRPOLYDRAW16, emr, 4) + TEST_FIELD_OFFSET(EMRPOLYDRAW16, emr, 0) + TEST_FIELD_SIZE (EMRPOLYDRAW16, rclBounds, 16) + TEST_FIELD_ALIGN (EMRPOLYDRAW16, rclBounds, 4) + TEST_FIELD_OFFSET(EMRPOLYDRAW16, rclBounds, 8) + TEST_FIELD_SIZE (EMRPOLYDRAW16, cpts, 4) + TEST_FIELD_ALIGN (EMRPOLYDRAW16, cpts, 4) + TEST_FIELD_OFFSET(EMRPOLYDRAW16, cpts, 24) + TEST_FIELD_SIZE (EMRPOLYDRAW16, apts, 4) + TEST_FIELD_ALIGN (EMRPOLYDRAW16, apts, 2) + TEST_FIELD_OFFSET(EMRPOLYDRAW16, apts, 28) + TEST_FIELD_SIZE (EMRPOLYDRAW16, abTypes, 1) + TEST_FIELD_ALIGN (EMRPOLYDRAW16, abTypes, 1) + TEST_FIELD_OFFSET(EMRPOLYDRAW16, abTypes, 32) +} + +static void test_pack_EMRPOLYGON(void) +{ + /* EMRPOLYGON (pack 4) */ + TEST_TYPE_SIZE (EMRPOLYGON, 36) + TEST_TYPE_ALIGN (EMRPOLYGON, 4) + TEST_FIELD_SIZE (EMRPOLYGON, emr, 8) + TEST_FIELD_ALIGN (EMRPOLYGON, emr, 4) + TEST_FIELD_OFFSET(EMRPOLYGON, emr, 0) + TEST_FIELD_SIZE (EMRPOLYGON, rclBounds, 16) + TEST_FIELD_ALIGN (EMRPOLYGON, rclBounds, 4) + TEST_FIELD_OFFSET(EMRPOLYGON, rclBounds, 8) + TEST_FIELD_SIZE (EMRPOLYGON, cptl, 4) + TEST_FIELD_ALIGN (EMRPOLYGON, cptl, 4) + TEST_FIELD_OFFSET(EMRPOLYGON, cptl, 24) + TEST_FIELD_SIZE (EMRPOLYGON, aptl, 8) + TEST_FIELD_ALIGN (EMRPOLYGON, aptl, 4) + TEST_FIELD_OFFSET(EMRPOLYGON, aptl, 28) +} + +static void test_pack_EMRPOLYGON16(void) +{ + /* EMRPOLYGON16 (pack 4) */ + TEST_TYPE_SIZE (EMRPOLYGON16, 32) + TEST_TYPE_ALIGN (EMRPOLYGON16, 4) + TEST_FIELD_SIZE (EMRPOLYGON16, emr, 8) + TEST_FIELD_ALIGN (EMRPOLYGON16, emr, 4) + TEST_FIELD_OFFSET(EMRPOLYGON16, emr, 0) + TEST_FIELD_SIZE (EMRPOLYGON16, rclBounds, 16) + TEST_FIELD_ALIGN (EMRPOLYGON16, rclBounds, 4) + TEST_FIELD_OFFSET(EMRPOLYGON16, rclBounds, 8) + TEST_FIELD_SIZE (EMRPOLYGON16, cpts, 4) + TEST_FIELD_ALIGN (EMRPOLYGON16, cpts, 4) + TEST_FIELD_OFFSET(EMRPOLYGON16, cpts, 24) + TEST_FIELD_SIZE (EMRPOLYGON16, apts, 4) + TEST_FIELD_ALIGN (EMRPOLYGON16, apts, 2) + TEST_FIELD_OFFSET(EMRPOLYGON16, apts, 28) +} + +static void test_pack_EMRPOLYLINE(void) +{ + /* EMRPOLYLINE (pack 4) */ + TEST_TYPE_SIZE (EMRPOLYLINE, 36) + TEST_TYPE_ALIGN (EMRPOLYLINE, 4) + TEST_FIELD_SIZE (EMRPOLYLINE, emr, 8) + TEST_FIELD_ALIGN (EMRPOLYLINE, emr, 4) + TEST_FIELD_OFFSET(EMRPOLYLINE, emr, 0) + TEST_FIELD_SIZE (EMRPOLYLINE, rclBounds, 16) + TEST_FIELD_ALIGN (EMRPOLYLINE, rclBounds, 4) + TEST_FIELD_OFFSET(EMRPOLYLINE, rclBounds, 8) + TEST_FIELD_SIZE (EMRPOLYLINE, cptl, 4) + TEST_FIELD_ALIGN (EMRPOLYLINE, cptl, 4) + TEST_FIELD_OFFSET(EMRPOLYLINE, cptl, 24) + TEST_FIELD_SIZE (EMRPOLYLINE, aptl, 8) + TEST_FIELD_ALIGN (EMRPOLYLINE, aptl, 4) + TEST_FIELD_OFFSET(EMRPOLYLINE, aptl, 28) +} + +static void test_pack_EMRPOLYLINE16(void) +{ + /* EMRPOLYLINE16 (pack 4) */ + TEST_TYPE_SIZE (EMRPOLYLINE16, 32) + TEST_TYPE_ALIGN (EMRPOLYLINE16, 4) + TEST_FIELD_SIZE (EMRPOLYLINE16, emr, 8) + TEST_FIELD_ALIGN (EMRPOLYLINE16, emr, 4) + TEST_FIELD_OFFSET(EMRPOLYLINE16, emr, 0) + TEST_FIELD_SIZE (EMRPOLYLINE16, rclBounds, 16) + TEST_FIELD_ALIGN (EMRPOLYLINE16, rclBounds, 4) + TEST_FIELD_OFFSET(EMRPOLYLINE16, rclBounds, 8) + TEST_FIELD_SIZE (EMRPOLYLINE16, cpts, 4) + TEST_FIELD_ALIGN (EMRPOLYLINE16, cpts, 4) + TEST_FIELD_OFFSET(EMRPOLYLINE16, cpts, 24) + TEST_FIELD_SIZE (EMRPOLYLINE16, apts, 4) + TEST_FIELD_ALIGN (EMRPOLYLINE16, apts, 2) + TEST_FIELD_OFFSET(EMRPOLYLINE16, apts, 28) +} + +static void test_pack_EMRPOLYLINETO(void) +{ + /* EMRPOLYLINETO (pack 4) */ + TEST_TYPE_SIZE (EMRPOLYLINETO, 36) + TEST_TYPE_ALIGN (EMRPOLYLINETO, 4) + TEST_FIELD_SIZE (EMRPOLYLINETO, emr, 8) + TEST_FIELD_ALIGN (EMRPOLYLINETO, emr, 4) + TEST_FIELD_OFFSET(EMRPOLYLINETO, emr, 0) + TEST_FIELD_SIZE (EMRPOLYLINETO, rclBounds, 16) + TEST_FIELD_ALIGN (EMRPOLYLINETO, rclBounds, 4) + TEST_FIELD_OFFSET(EMRPOLYLINETO, rclBounds, 8) + TEST_FIELD_SIZE (EMRPOLYLINETO, cptl, 4) + TEST_FIELD_ALIGN (EMRPOLYLINETO, cptl, 4) + TEST_FIELD_OFFSET(EMRPOLYLINETO, cptl, 24) + TEST_FIELD_SIZE (EMRPOLYLINETO, aptl, 8) + TEST_FIELD_ALIGN (EMRPOLYLINETO, aptl, 4) + TEST_FIELD_OFFSET(EMRPOLYLINETO, aptl, 28) +} + +static void test_pack_EMRPOLYLINETO16(void) +{ + /* EMRPOLYLINETO16 (pack 4) */ + TEST_TYPE_SIZE (EMRPOLYLINETO16, 32) + TEST_TYPE_ALIGN (EMRPOLYLINETO16, 4) + TEST_FIELD_SIZE (EMRPOLYLINETO16, emr, 8) + TEST_FIELD_ALIGN (EMRPOLYLINETO16, emr, 4) + TEST_FIELD_OFFSET(EMRPOLYLINETO16, emr, 0) + TEST_FIELD_SIZE (EMRPOLYLINETO16, rclBounds, 16) + TEST_FIELD_ALIGN (EMRPOLYLINETO16, rclBounds, 4) + TEST_FIELD_OFFSET(EMRPOLYLINETO16, rclBounds, 8) + TEST_FIELD_SIZE (EMRPOLYLINETO16, cpts, 4) + TEST_FIELD_ALIGN (EMRPOLYLINETO16, cpts, 4) + TEST_FIELD_OFFSET(EMRPOLYLINETO16, cpts, 24) + TEST_FIELD_SIZE (EMRPOLYLINETO16, apts, 4) + TEST_FIELD_ALIGN (EMRPOLYLINETO16, apts, 2) + TEST_FIELD_OFFSET(EMRPOLYLINETO16, apts, 28) +} + +static void test_pack_EMRPOLYPOLYGON(void) +{ + /* EMRPOLYPOLYGON (pack 4) */ + TEST_TYPE_SIZE (EMRPOLYPOLYGON, 44) + TEST_TYPE_ALIGN (EMRPOLYPOLYGON, 4) + TEST_FIELD_SIZE (EMRPOLYPOLYGON, emr, 8) + TEST_FIELD_ALIGN (EMRPOLYPOLYGON, emr, 4) + TEST_FIELD_OFFSET(EMRPOLYPOLYGON, emr, 0) + TEST_FIELD_SIZE (EMRPOLYPOLYGON, rclBounds, 16) + TEST_FIELD_ALIGN (EMRPOLYPOLYGON, rclBounds, 4) + TEST_FIELD_OFFSET(EMRPOLYPOLYGON, rclBounds, 8) + TEST_FIELD_SIZE (EMRPOLYPOLYGON, nPolys, 4) + TEST_FIELD_ALIGN (EMRPOLYPOLYGON, nPolys, 4) + TEST_FIELD_OFFSET(EMRPOLYPOLYGON, nPolys, 24) + TEST_FIELD_SIZE (EMRPOLYPOLYGON, cptl, 4) + TEST_FIELD_ALIGN (EMRPOLYPOLYGON, cptl, 4) + TEST_FIELD_OFFSET(EMRPOLYPOLYGON, cptl, 28) + TEST_FIELD_SIZE (EMRPOLYPOLYGON, aPolyCounts, 4) + TEST_FIELD_ALIGN (EMRPOLYPOLYGON, aPolyCounts, 4) + TEST_FIELD_OFFSET(EMRPOLYPOLYGON, aPolyCounts, 32) + TEST_FIELD_SIZE (EMRPOLYPOLYGON, aptl, 8) + TEST_FIELD_ALIGN (EMRPOLYPOLYGON, aptl, 4) + TEST_FIELD_OFFSET(EMRPOLYPOLYGON, aptl, 36) +} + +static void test_pack_EMRPOLYPOLYGON16(void) +{ + /* EMRPOLYPOLYGON16 (pack 4) */ + TEST_TYPE_SIZE (EMRPOLYPOLYGON16, 40) + TEST_TYPE_ALIGN (EMRPOLYPOLYGON16, 4) + TEST_FIELD_SIZE (EMRPOLYPOLYGON16, emr, 8) + TEST_FIELD_ALIGN (EMRPOLYPOLYGON16, emr, 4) + TEST_FIELD_OFFSET(EMRPOLYPOLYGON16, emr, 0) + TEST_FIELD_SIZE (EMRPOLYPOLYGON16, rclBounds, 16) + TEST_FIELD_ALIGN (EMRPOLYPOLYGON16, rclBounds, 4) + TEST_FIELD_OFFSET(EMRPOLYPOLYGON16, rclBounds, 8) + TEST_FIELD_SIZE (EMRPOLYPOLYGON16, nPolys, 4) + TEST_FIELD_ALIGN (EMRPOLYPOLYGON16, nPolys, 4) + TEST_FIELD_OFFSET(EMRPOLYPOLYGON16, nPolys, 24) + TEST_FIELD_SIZE (EMRPOLYPOLYGON16, cpts, 4) + TEST_FIELD_ALIGN (EMRPOLYPOLYGON16, cpts, 4) + TEST_FIELD_OFFSET(EMRPOLYPOLYGON16, cpts, 28) + TEST_FIELD_SIZE (EMRPOLYPOLYGON16, aPolyCounts, 4) + TEST_FIELD_ALIGN (EMRPOLYPOLYGON16, aPolyCounts, 4) + TEST_FIELD_OFFSET(EMRPOLYPOLYGON16, aPolyCounts, 32) + TEST_FIELD_SIZE (EMRPOLYPOLYGON16, apts, 4) + TEST_FIELD_ALIGN (EMRPOLYPOLYGON16, apts, 2) + TEST_FIELD_OFFSET(EMRPOLYPOLYGON16, apts, 36) +} + +static void test_pack_EMRPOLYPOLYLINE(void) +{ + /* EMRPOLYPOLYLINE (pack 4) */ + TEST_TYPE_SIZE (EMRPOLYPOLYLINE, 44) + TEST_TYPE_ALIGN (EMRPOLYPOLYLINE, 4) + TEST_FIELD_SIZE (EMRPOLYPOLYLINE, emr, 8) + TEST_FIELD_ALIGN (EMRPOLYPOLYLINE, emr, 4) + TEST_FIELD_OFFSET(EMRPOLYPOLYLINE, emr, 0) + TEST_FIELD_SIZE (EMRPOLYPOLYLINE, rclBounds, 16) + TEST_FIELD_ALIGN (EMRPOLYPOLYLINE, rclBounds, 4) + TEST_FIELD_OFFSET(EMRPOLYPOLYLINE, rclBounds, 8) + TEST_FIELD_SIZE (EMRPOLYPOLYLINE, nPolys, 4) + TEST_FIELD_ALIGN (EMRPOLYPOLYLINE, nPolys, 4) + TEST_FIELD_OFFSET(EMRPOLYPOLYLINE, nPolys, 24) + TEST_FIELD_SIZE (EMRPOLYPOLYLINE, cptl, 4) + TEST_FIELD_ALIGN (EMRPOLYPOLYLINE, cptl, 4) + TEST_FIELD_OFFSET(EMRPOLYPOLYLINE, cptl, 28) + TEST_FIELD_SIZE (EMRPOLYPOLYLINE, aPolyCounts, 4) + TEST_FIELD_ALIGN (EMRPOLYPOLYLINE, aPolyCounts, 4) + TEST_FIELD_OFFSET(EMRPOLYPOLYLINE, aPolyCounts, 32) + TEST_FIELD_SIZE (EMRPOLYPOLYLINE, aptl, 8) + TEST_FIELD_ALIGN (EMRPOLYPOLYLINE, aptl, 4) + TEST_FIELD_OFFSET(EMRPOLYPOLYLINE, aptl, 36) +} + +static void test_pack_EMRPOLYPOLYLINE16(void) +{ + /* EMRPOLYPOLYLINE16 (pack 4) */ + TEST_TYPE_SIZE (EMRPOLYPOLYLINE16, 40) + TEST_TYPE_ALIGN (EMRPOLYPOLYLINE16, 4) + TEST_FIELD_SIZE (EMRPOLYPOLYLINE16, emr, 8) + TEST_FIELD_ALIGN (EMRPOLYPOLYLINE16, emr, 4) + TEST_FIELD_OFFSET(EMRPOLYPOLYLINE16, emr, 0) + TEST_FIELD_SIZE (EMRPOLYPOLYLINE16, rclBounds, 16) + TEST_FIELD_ALIGN (EMRPOLYPOLYLINE16, rclBounds, 4) + TEST_FIELD_OFFSET(EMRPOLYPOLYLINE16, rclBounds, 8) + TEST_FIELD_SIZE (EMRPOLYPOLYLINE16, nPolys, 4) + TEST_FIELD_ALIGN (EMRPOLYPOLYLINE16, nPolys, 4) + TEST_FIELD_OFFSET(EMRPOLYPOLYLINE16, nPolys, 24) + TEST_FIELD_SIZE (EMRPOLYPOLYLINE16, cpts, 4) + TEST_FIELD_ALIGN (EMRPOLYPOLYLINE16, cpts, 4) + TEST_FIELD_OFFSET(EMRPOLYPOLYLINE16, cpts, 28) + TEST_FIELD_SIZE (EMRPOLYPOLYLINE16, aPolyCounts, 4) + TEST_FIELD_ALIGN (EMRPOLYPOLYLINE16, aPolyCounts, 4) + TEST_FIELD_OFFSET(EMRPOLYPOLYLINE16, aPolyCounts, 32) + TEST_FIELD_SIZE (EMRPOLYPOLYLINE16, apts, 4) + TEST_FIELD_ALIGN (EMRPOLYPOLYLINE16, apts, 2) + TEST_FIELD_OFFSET(EMRPOLYPOLYLINE16, apts, 36) +} + +static void test_pack_EMRPOLYTEXTOUTA(void) +{ + /* EMRPOLYTEXTOUTA (pack 4) */ + TEST_TYPE_SIZE (EMRPOLYTEXTOUTA, 80) + TEST_TYPE_ALIGN (EMRPOLYTEXTOUTA, 4) + TEST_FIELD_SIZE (EMRPOLYTEXTOUTA, emr, 8) + TEST_FIELD_ALIGN (EMRPOLYTEXTOUTA, emr, 4) + TEST_FIELD_OFFSET(EMRPOLYTEXTOUTA, emr, 0) + TEST_FIELD_SIZE (EMRPOLYTEXTOUTA, rclBounds, 16) + TEST_FIELD_ALIGN (EMRPOLYTEXTOUTA, rclBounds, 4) + TEST_FIELD_OFFSET(EMRPOLYTEXTOUTA, rclBounds, 8) + TEST_FIELD_SIZE (EMRPOLYTEXTOUTA, iGraphicsMode, 4) + TEST_FIELD_ALIGN (EMRPOLYTEXTOUTA, iGraphicsMode, 4) + TEST_FIELD_OFFSET(EMRPOLYTEXTOUTA, iGraphicsMode, 24) + TEST_FIELD_SIZE (EMRPOLYTEXTOUTA, exScale, 4) + TEST_FIELD_ALIGN (EMRPOLYTEXTOUTA, exScale, 4) + TEST_FIELD_OFFSET(EMRPOLYTEXTOUTA, exScale, 28) + TEST_FIELD_SIZE (EMRPOLYTEXTOUTA, eyScale, 4) + TEST_FIELD_ALIGN (EMRPOLYTEXTOUTA, eyScale, 4) + TEST_FIELD_OFFSET(EMRPOLYTEXTOUTA, eyScale, 32) + TEST_FIELD_SIZE (EMRPOLYTEXTOUTA, cStrings, 4) + TEST_FIELD_ALIGN (EMRPOLYTEXTOUTA, cStrings, 4) + TEST_FIELD_OFFSET(EMRPOLYTEXTOUTA, cStrings, 36) + TEST_FIELD_SIZE (EMRPOLYTEXTOUTA, aemrtext, 40) + TEST_FIELD_ALIGN (EMRPOLYTEXTOUTA, aemrtext, 4) + TEST_FIELD_OFFSET(EMRPOLYTEXTOUTA, aemrtext, 40) +} + +static void test_pack_EMRPOLYTEXTOUTW(void) +{ + /* EMRPOLYTEXTOUTW (pack 4) */ + TEST_TYPE_SIZE (EMRPOLYTEXTOUTW, 80) + TEST_TYPE_ALIGN (EMRPOLYTEXTOUTW, 4) + TEST_FIELD_SIZE (EMRPOLYTEXTOUTW, emr, 8) + TEST_FIELD_ALIGN (EMRPOLYTEXTOUTW, emr, 4) + TEST_FIELD_OFFSET(EMRPOLYTEXTOUTW, emr, 0) + TEST_FIELD_SIZE (EMRPOLYTEXTOUTW, rclBounds, 16) + TEST_FIELD_ALIGN (EMRPOLYTEXTOUTW, rclBounds, 4) + TEST_FIELD_OFFSET(EMRPOLYTEXTOUTW, rclBounds, 8) + TEST_FIELD_SIZE (EMRPOLYTEXTOUTW, iGraphicsMode, 4) + TEST_FIELD_ALIGN (EMRPOLYTEXTOUTW, iGraphicsMode, 4) + TEST_FIELD_OFFSET(EMRPOLYTEXTOUTW, iGraphicsMode, 24) + TEST_FIELD_SIZE (EMRPOLYTEXTOUTW, exScale, 4) + TEST_FIELD_ALIGN (EMRPOLYTEXTOUTW, exScale, 4) + TEST_FIELD_OFFSET(EMRPOLYTEXTOUTW, exScale, 28) + TEST_FIELD_SIZE (EMRPOLYTEXTOUTW, eyScale, 4) + TEST_FIELD_ALIGN (EMRPOLYTEXTOUTW, eyScale, 4) + TEST_FIELD_OFFSET(EMRPOLYTEXTOUTW, eyScale, 32) + TEST_FIELD_SIZE (EMRPOLYTEXTOUTW, cStrings, 4) + TEST_FIELD_ALIGN (EMRPOLYTEXTOUTW, cStrings, 4) + TEST_FIELD_OFFSET(EMRPOLYTEXTOUTW, cStrings, 36) + TEST_FIELD_SIZE (EMRPOLYTEXTOUTW, aemrtext, 40) + TEST_FIELD_ALIGN (EMRPOLYTEXTOUTW, aemrtext, 4) + TEST_FIELD_OFFSET(EMRPOLYTEXTOUTW, aemrtext, 40) +} + +static void test_pack_EMRREALIZEPALETTE(void) +{ + /* EMRREALIZEPALETTE (pack 4) */ + TEST_TYPE_SIZE (EMRREALIZEPALETTE, 8) + TEST_TYPE_ALIGN (EMRREALIZEPALETTE, 4) + TEST_FIELD_SIZE (EMRREALIZEPALETTE, emr, 8) + TEST_FIELD_ALIGN (EMRREALIZEPALETTE, emr, 4) + TEST_FIELD_OFFSET(EMRREALIZEPALETTE, emr, 0) +} + +static void test_pack_EMRRECTANGLE(void) +{ + /* EMRRECTANGLE (pack 4) */ + TEST_TYPE_SIZE (EMRRECTANGLE, 24) + TEST_TYPE_ALIGN (EMRRECTANGLE, 4) + TEST_FIELD_SIZE (EMRRECTANGLE, emr, 8) + TEST_FIELD_ALIGN (EMRRECTANGLE, emr, 4) + TEST_FIELD_OFFSET(EMRRECTANGLE, emr, 0) + TEST_FIELD_SIZE (EMRRECTANGLE, rclBox, 16) + TEST_FIELD_ALIGN (EMRRECTANGLE, rclBox, 4) + TEST_FIELD_OFFSET(EMRRECTANGLE, rclBox, 8) +} + +static void test_pack_EMRRESIZEPALETTE(void) +{ + /* EMRRESIZEPALETTE (pack 4) */ + TEST_TYPE_SIZE (EMRRESIZEPALETTE, 16) + TEST_TYPE_ALIGN (EMRRESIZEPALETTE, 4) + TEST_FIELD_SIZE (EMRRESIZEPALETTE, emr, 8) + TEST_FIELD_ALIGN (EMRRESIZEPALETTE, emr, 4) + TEST_FIELD_OFFSET(EMRRESIZEPALETTE, emr, 0) + TEST_FIELD_SIZE (EMRRESIZEPALETTE, ihPal, 4) + TEST_FIELD_ALIGN (EMRRESIZEPALETTE, ihPal, 4) + TEST_FIELD_OFFSET(EMRRESIZEPALETTE, ihPal, 8) + TEST_FIELD_SIZE (EMRRESIZEPALETTE, cEntries, 4) + TEST_FIELD_ALIGN (EMRRESIZEPALETTE, cEntries, 4) + TEST_FIELD_OFFSET(EMRRESIZEPALETTE, cEntries, 12) +} + +static void test_pack_EMRRESTOREDC(void) +{ + /* EMRRESTOREDC (pack 4) */ + TEST_TYPE_SIZE (EMRRESTOREDC, 12) + TEST_TYPE_ALIGN (EMRRESTOREDC, 4) + TEST_FIELD_SIZE (EMRRESTOREDC, emr, 8) + TEST_FIELD_ALIGN (EMRRESTOREDC, emr, 4) + TEST_FIELD_OFFSET(EMRRESTOREDC, emr, 0) + TEST_FIELD_SIZE (EMRRESTOREDC, iRelative, 4) + TEST_FIELD_ALIGN (EMRRESTOREDC, iRelative, 4) + TEST_FIELD_OFFSET(EMRRESTOREDC, iRelative, 8) +} + +static void test_pack_EMRROUNDRECT(void) +{ + /* EMRROUNDRECT (pack 4) */ + TEST_TYPE_SIZE (EMRROUNDRECT, 32) + TEST_TYPE_ALIGN (EMRROUNDRECT, 4) + TEST_FIELD_SIZE (EMRROUNDRECT, emr, 8) + TEST_FIELD_ALIGN (EMRROUNDRECT, emr, 4) + TEST_FIELD_OFFSET(EMRROUNDRECT, emr, 0) + TEST_FIELD_SIZE (EMRROUNDRECT, rclBox, 16) + TEST_FIELD_ALIGN (EMRROUNDRECT, rclBox, 4) + TEST_FIELD_OFFSET(EMRROUNDRECT, rclBox, 8) + TEST_FIELD_SIZE (EMRROUNDRECT, szlCorner, 8) + TEST_FIELD_ALIGN (EMRROUNDRECT, szlCorner, 4) + TEST_FIELD_OFFSET(EMRROUNDRECT, szlCorner, 24) +} + +static void test_pack_EMRSAVEDC(void) +{ + /* EMRSAVEDC (pack 4) */ + TEST_TYPE_SIZE (EMRSAVEDC, 8) + TEST_TYPE_ALIGN (EMRSAVEDC, 4) + TEST_FIELD_SIZE (EMRSAVEDC, emr, 8) + TEST_FIELD_ALIGN (EMRSAVEDC, emr, 4) + TEST_FIELD_OFFSET(EMRSAVEDC, emr, 0) +} + +static void test_pack_EMRSCALEVIEWPORTEXTEX(void) +{ + /* EMRSCALEVIEWPORTEXTEX (pack 4) */ + TEST_TYPE_SIZE (EMRSCALEVIEWPORTEXTEX, 24) + TEST_TYPE_ALIGN (EMRSCALEVIEWPORTEXTEX, 4) + TEST_FIELD_SIZE (EMRSCALEVIEWPORTEXTEX, emr, 8) + TEST_FIELD_ALIGN (EMRSCALEVIEWPORTEXTEX, emr, 4) + TEST_FIELD_OFFSET(EMRSCALEVIEWPORTEXTEX, emr, 0) + TEST_FIELD_SIZE (EMRSCALEVIEWPORTEXTEX, xNum, 4) + TEST_FIELD_ALIGN (EMRSCALEVIEWPORTEXTEX, xNum, 4) + TEST_FIELD_OFFSET(EMRSCALEVIEWPORTEXTEX, xNum, 8) + TEST_FIELD_SIZE (EMRSCALEVIEWPORTEXTEX, xDenom, 4) + TEST_FIELD_ALIGN (EMRSCALEVIEWPORTEXTEX, xDenom, 4) + TEST_FIELD_OFFSET(EMRSCALEVIEWPORTEXTEX, xDenom, 12) + TEST_FIELD_SIZE (EMRSCALEVIEWPORTEXTEX, yNum, 4) + TEST_FIELD_ALIGN (EMRSCALEVIEWPORTEXTEX, yNum, 4) + TEST_FIELD_OFFSET(EMRSCALEVIEWPORTEXTEX, yNum, 16) + TEST_FIELD_SIZE (EMRSCALEVIEWPORTEXTEX, yDenom, 4) + TEST_FIELD_ALIGN (EMRSCALEVIEWPORTEXTEX, yDenom, 4) + TEST_FIELD_OFFSET(EMRSCALEVIEWPORTEXTEX, yDenom, 20) +} + +static void test_pack_EMRSCALEWINDOWEXTEX(void) +{ + /* EMRSCALEWINDOWEXTEX (pack 4) */ + TEST_TYPE_SIZE (EMRSCALEWINDOWEXTEX, 24) + TEST_TYPE_ALIGN (EMRSCALEWINDOWEXTEX, 4) + TEST_FIELD_SIZE (EMRSCALEWINDOWEXTEX, emr, 8) + TEST_FIELD_ALIGN (EMRSCALEWINDOWEXTEX, emr, 4) + TEST_FIELD_OFFSET(EMRSCALEWINDOWEXTEX, emr, 0) + TEST_FIELD_SIZE (EMRSCALEWINDOWEXTEX, xNum, 4) + TEST_FIELD_ALIGN (EMRSCALEWINDOWEXTEX, xNum, 4) + TEST_FIELD_OFFSET(EMRSCALEWINDOWEXTEX, xNum, 8) + TEST_FIELD_SIZE (EMRSCALEWINDOWEXTEX, xDenom, 4) + TEST_FIELD_ALIGN (EMRSCALEWINDOWEXTEX, xDenom, 4) + TEST_FIELD_OFFSET(EMRSCALEWINDOWEXTEX, xDenom, 12) + TEST_FIELD_SIZE (EMRSCALEWINDOWEXTEX, yNum, 4) + TEST_FIELD_ALIGN (EMRSCALEWINDOWEXTEX, yNum, 4) + TEST_FIELD_OFFSET(EMRSCALEWINDOWEXTEX, yNum, 16) + TEST_FIELD_SIZE (EMRSCALEWINDOWEXTEX, yDenom, 4) + TEST_FIELD_ALIGN (EMRSCALEWINDOWEXTEX, yDenom, 4) + TEST_FIELD_OFFSET(EMRSCALEWINDOWEXTEX, yDenom, 20) +} + +static void test_pack_EMRSELECTCLIPPATH(void) +{ + /* EMRSELECTCLIPPATH (pack 4) */ + TEST_TYPE_SIZE (EMRSELECTCLIPPATH, 12) + TEST_TYPE_ALIGN (EMRSELECTCLIPPATH, 4) + TEST_FIELD_SIZE (EMRSELECTCLIPPATH, emr, 8) + TEST_FIELD_ALIGN (EMRSELECTCLIPPATH, emr, 4) + TEST_FIELD_OFFSET(EMRSELECTCLIPPATH, emr, 0) + TEST_FIELD_SIZE (EMRSELECTCLIPPATH, iMode, 4) + TEST_FIELD_ALIGN (EMRSELECTCLIPPATH, iMode, 4) + TEST_FIELD_OFFSET(EMRSELECTCLIPPATH, iMode, 8) +} + +static void test_pack_EMRSELECTCOLORSPACE(void) +{ + /* EMRSELECTCOLORSPACE (pack 4) */ + TEST_TYPE_SIZE (EMRSELECTCOLORSPACE, 12) + TEST_TYPE_ALIGN (EMRSELECTCOLORSPACE, 4) + TEST_FIELD_SIZE (EMRSELECTCOLORSPACE, emr, 8) + TEST_FIELD_ALIGN (EMRSELECTCOLORSPACE, emr, 4) + TEST_FIELD_OFFSET(EMRSELECTCOLORSPACE, emr, 0) + TEST_FIELD_SIZE (EMRSELECTCOLORSPACE, ihCS, 4) + TEST_FIELD_ALIGN (EMRSELECTCOLORSPACE, ihCS, 4) + TEST_FIELD_OFFSET(EMRSELECTCOLORSPACE, ihCS, 8) +} + +static void test_pack_EMRSELECTOBJECT(void) +{ + /* EMRSELECTOBJECT (pack 4) */ + TEST_TYPE_SIZE (EMRSELECTOBJECT, 12) + TEST_TYPE_ALIGN (EMRSELECTOBJECT, 4) + TEST_FIELD_SIZE (EMRSELECTOBJECT, emr, 8) + TEST_FIELD_ALIGN (EMRSELECTOBJECT, emr, 4) + TEST_FIELD_OFFSET(EMRSELECTOBJECT, emr, 0) + TEST_FIELD_SIZE (EMRSELECTOBJECT, ihObject, 4) + TEST_FIELD_ALIGN (EMRSELECTOBJECT, ihObject, 4) + TEST_FIELD_OFFSET(EMRSELECTOBJECT, ihObject, 8) +} + +static void test_pack_EMRSELECTPALETTE(void) +{ + /* EMRSELECTPALETTE (pack 4) */ + TEST_TYPE_SIZE (EMRSELECTPALETTE, 12) + TEST_TYPE_ALIGN (EMRSELECTPALETTE, 4) + TEST_FIELD_SIZE (EMRSELECTPALETTE, emr, 8) + TEST_FIELD_ALIGN (EMRSELECTPALETTE, emr, 4) + TEST_FIELD_OFFSET(EMRSELECTPALETTE, emr, 0) + TEST_FIELD_SIZE (EMRSELECTPALETTE, ihPal, 4) + TEST_FIELD_ALIGN (EMRSELECTPALETTE, ihPal, 4) + TEST_FIELD_OFFSET(EMRSELECTPALETTE, ihPal, 8) +} + +static void test_pack_EMRSETARCDIRECTION(void) +{ + /* EMRSETARCDIRECTION (pack 4) */ + TEST_TYPE_SIZE (EMRSETARCDIRECTION, 12) + TEST_TYPE_ALIGN (EMRSETARCDIRECTION, 4) + TEST_FIELD_SIZE (EMRSETARCDIRECTION, emr, 8) + TEST_FIELD_ALIGN (EMRSETARCDIRECTION, emr, 4) + TEST_FIELD_OFFSET(EMRSETARCDIRECTION, emr, 0) + TEST_FIELD_SIZE (EMRSETARCDIRECTION, iArcDirection, 4) + TEST_FIELD_ALIGN (EMRSETARCDIRECTION, iArcDirection, 4) + TEST_FIELD_OFFSET(EMRSETARCDIRECTION, iArcDirection, 8) +} + +static void test_pack_EMRSETBKCOLOR(void) +{ + /* EMRSETBKCOLOR (pack 4) */ + TEST_TYPE_SIZE (EMRSETBKCOLOR, 12) + TEST_TYPE_ALIGN (EMRSETBKCOLOR, 4) + TEST_FIELD_SIZE (EMRSETBKCOLOR, emr, 8) + TEST_FIELD_ALIGN (EMRSETBKCOLOR, emr, 4) + TEST_FIELD_OFFSET(EMRSETBKCOLOR, emr, 0) + TEST_FIELD_SIZE (EMRSETBKCOLOR, crColor, 4) + TEST_FIELD_ALIGN (EMRSETBKCOLOR, crColor, 4) + TEST_FIELD_OFFSET(EMRSETBKCOLOR, crColor, 8) +} + +static void test_pack_EMRSETBKMODE(void) +{ + /* EMRSETBKMODE (pack 4) */ + TEST_TYPE_SIZE (EMRSETBKMODE, 12) + TEST_TYPE_ALIGN (EMRSETBKMODE, 4) + TEST_FIELD_SIZE (EMRSETBKMODE, emr, 8) + TEST_FIELD_ALIGN (EMRSETBKMODE, emr, 4) + TEST_FIELD_OFFSET(EMRSETBKMODE, emr, 0) + TEST_FIELD_SIZE (EMRSETBKMODE, iMode, 4) + TEST_FIELD_ALIGN (EMRSETBKMODE, iMode, 4) + TEST_FIELD_OFFSET(EMRSETBKMODE, iMode, 8) +} + +static void test_pack_EMRSETBRUSHORGEX(void) +{ + /* EMRSETBRUSHORGEX (pack 4) */ + TEST_TYPE_SIZE (EMRSETBRUSHORGEX, 16) + TEST_TYPE_ALIGN (EMRSETBRUSHORGEX, 4) + TEST_FIELD_SIZE (EMRSETBRUSHORGEX, emr, 8) + TEST_FIELD_ALIGN (EMRSETBRUSHORGEX, emr, 4) + TEST_FIELD_OFFSET(EMRSETBRUSHORGEX, emr, 0) + TEST_FIELD_SIZE (EMRSETBRUSHORGEX, ptlOrigin, 8) + TEST_FIELD_ALIGN (EMRSETBRUSHORGEX, ptlOrigin, 4) + TEST_FIELD_OFFSET(EMRSETBRUSHORGEX, ptlOrigin, 8) +} + +static void test_pack_EMRSETCOLORADJUSTMENT(void) +{ + /* EMRSETCOLORADJUSTMENT (pack 4) */ + TEST_TYPE_SIZE (EMRSETCOLORADJUSTMENT, 32) + TEST_TYPE_ALIGN (EMRSETCOLORADJUSTMENT, 4) + TEST_FIELD_SIZE (EMRSETCOLORADJUSTMENT, emr, 8) + TEST_FIELD_ALIGN (EMRSETCOLORADJUSTMENT, emr, 4) + TEST_FIELD_OFFSET(EMRSETCOLORADJUSTMENT, emr, 0) + TEST_FIELD_SIZE (EMRSETCOLORADJUSTMENT, ColorAdjustment, 24) + TEST_FIELD_ALIGN (EMRSETCOLORADJUSTMENT, ColorAdjustment, 2) + TEST_FIELD_OFFSET(EMRSETCOLORADJUSTMENT, ColorAdjustment, 8) +} + +static void test_pack_EMRSETCOLORSPACE(void) +{ + /* EMRSETCOLORSPACE (pack 4) */ + TEST_TYPE_SIZE (EMRSETCOLORSPACE, 12) + TEST_TYPE_ALIGN (EMRSETCOLORSPACE, 4) + TEST_FIELD_SIZE (EMRSETCOLORSPACE, emr, 8) + TEST_FIELD_ALIGN (EMRSETCOLORSPACE, emr, 4) + TEST_FIELD_OFFSET(EMRSETCOLORSPACE, emr, 0) + TEST_FIELD_SIZE (EMRSETCOLORSPACE, ihCS, 4) + TEST_FIELD_ALIGN (EMRSETCOLORSPACE, ihCS, 4) + TEST_FIELD_OFFSET(EMRSETCOLORSPACE, ihCS, 8) +} + +static void test_pack_EMRSETDIBITSTODEVICE(void) +{ + /* EMRSETDIBITSTODEVICE (pack 4) */ + TEST_TYPE_SIZE (EMRSETDIBITSTODEVICE, 76) + TEST_TYPE_ALIGN (EMRSETDIBITSTODEVICE, 4) + TEST_FIELD_SIZE (EMRSETDIBITSTODEVICE, emr, 8) + TEST_FIELD_ALIGN (EMRSETDIBITSTODEVICE, emr, 4) + TEST_FIELD_OFFSET(EMRSETDIBITSTODEVICE, emr, 0) + TEST_FIELD_SIZE (EMRSETDIBITSTODEVICE, rclBounds, 16) + TEST_FIELD_ALIGN (EMRSETDIBITSTODEVICE, rclBounds, 4) + TEST_FIELD_OFFSET(EMRSETDIBITSTODEVICE, rclBounds, 8) + TEST_FIELD_SIZE (EMRSETDIBITSTODEVICE, xDest, 4) + TEST_FIELD_ALIGN (EMRSETDIBITSTODEVICE, xDest, 4) + TEST_FIELD_OFFSET(EMRSETDIBITSTODEVICE, xDest, 24) + TEST_FIELD_SIZE (EMRSETDIBITSTODEVICE, yDest, 4) + TEST_FIELD_ALIGN (EMRSETDIBITSTODEVICE, yDest, 4) + TEST_FIELD_OFFSET(EMRSETDIBITSTODEVICE, yDest, 28) + TEST_FIELD_SIZE (EMRSETDIBITSTODEVICE, xSrc, 4) + TEST_FIELD_ALIGN (EMRSETDIBITSTODEVICE, xSrc, 4) + TEST_FIELD_OFFSET(EMRSETDIBITSTODEVICE, xSrc, 32) + TEST_FIELD_SIZE (EMRSETDIBITSTODEVICE, ySrc, 4) + TEST_FIELD_ALIGN (EMRSETDIBITSTODEVICE, ySrc, 4) + TEST_FIELD_OFFSET(EMRSETDIBITSTODEVICE, ySrc, 36) + TEST_FIELD_SIZE (EMRSETDIBITSTODEVICE, cxSrc, 4) + TEST_FIELD_ALIGN (EMRSETDIBITSTODEVICE, cxSrc, 4) + TEST_FIELD_OFFSET(EMRSETDIBITSTODEVICE, cxSrc, 40) + TEST_FIELD_SIZE (EMRSETDIBITSTODEVICE, cySrc, 4) + TEST_FIELD_ALIGN (EMRSETDIBITSTODEVICE, cySrc, 4) + TEST_FIELD_OFFSET(EMRSETDIBITSTODEVICE, cySrc, 44) + TEST_FIELD_SIZE (EMRSETDIBITSTODEVICE, offBmiSrc, 4) + TEST_FIELD_ALIGN (EMRSETDIBITSTODEVICE, offBmiSrc, 4) + TEST_FIELD_OFFSET(EMRSETDIBITSTODEVICE, offBmiSrc, 48) + TEST_FIELD_SIZE (EMRSETDIBITSTODEVICE, cbBmiSrc, 4) + TEST_FIELD_ALIGN (EMRSETDIBITSTODEVICE, cbBmiSrc, 4) + TEST_FIELD_OFFSET(EMRSETDIBITSTODEVICE, cbBmiSrc, 52) + TEST_FIELD_SIZE (EMRSETDIBITSTODEVICE, offBitsSrc, 4) + TEST_FIELD_ALIGN (EMRSETDIBITSTODEVICE, offBitsSrc, 4) + TEST_FIELD_OFFSET(EMRSETDIBITSTODEVICE, offBitsSrc, 56) + TEST_FIELD_SIZE (EMRSETDIBITSTODEVICE, cbBitsSrc, 4) + TEST_FIELD_ALIGN (EMRSETDIBITSTODEVICE, cbBitsSrc, 4) + TEST_FIELD_OFFSET(EMRSETDIBITSTODEVICE, cbBitsSrc, 60) + TEST_FIELD_SIZE (EMRSETDIBITSTODEVICE, iUsageSrc, 4) + TEST_FIELD_ALIGN (EMRSETDIBITSTODEVICE, iUsageSrc, 4) + TEST_FIELD_OFFSET(EMRSETDIBITSTODEVICE, iUsageSrc, 64) + TEST_FIELD_SIZE (EMRSETDIBITSTODEVICE, iStartScan, 4) + TEST_FIELD_ALIGN (EMRSETDIBITSTODEVICE, iStartScan, 4) + TEST_FIELD_OFFSET(EMRSETDIBITSTODEVICE, iStartScan, 68) + TEST_FIELD_SIZE (EMRSETDIBITSTODEVICE, cScans, 4) + TEST_FIELD_ALIGN (EMRSETDIBITSTODEVICE, cScans, 4) + TEST_FIELD_OFFSET(EMRSETDIBITSTODEVICE, cScans, 72) +} + +static void test_pack_EMRSETICMMODE(void) +{ + /* EMRSETICMMODE (pack 4) */ + TEST_TYPE_SIZE (EMRSETICMMODE, 12) + TEST_TYPE_ALIGN (EMRSETICMMODE, 4) + TEST_FIELD_SIZE (EMRSETICMMODE, emr, 8) + TEST_FIELD_ALIGN (EMRSETICMMODE, emr, 4) + TEST_FIELD_OFFSET(EMRSETICMMODE, emr, 0) + TEST_FIELD_SIZE (EMRSETICMMODE, iMode, 4) + TEST_FIELD_ALIGN (EMRSETICMMODE, iMode, 4) + TEST_FIELD_OFFSET(EMRSETICMMODE, iMode, 8) +} + +static void test_pack_EMRSETLAYOUT(void) +{ + /* EMRSETLAYOUT (pack 4) */ + TEST_TYPE_SIZE (EMRSETLAYOUT, 12) + TEST_TYPE_ALIGN (EMRSETLAYOUT, 4) + TEST_FIELD_SIZE (EMRSETLAYOUT, emr, 8) + TEST_FIELD_ALIGN (EMRSETLAYOUT, emr, 4) + TEST_FIELD_OFFSET(EMRSETLAYOUT, emr, 0) + TEST_FIELD_SIZE (EMRSETLAYOUT, iMode, 4) + TEST_FIELD_ALIGN (EMRSETLAYOUT, iMode, 4) + TEST_FIELD_OFFSET(EMRSETLAYOUT, iMode, 8) +} + +static void test_pack_EMRSETMAPMODE(void) +{ + /* EMRSETMAPMODE (pack 4) */ + TEST_TYPE_SIZE (EMRSETMAPMODE, 12) + TEST_TYPE_ALIGN (EMRSETMAPMODE, 4) + TEST_FIELD_SIZE (EMRSETMAPMODE, emr, 8) + TEST_FIELD_ALIGN (EMRSETMAPMODE, emr, 4) + TEST_FIELD_OFFSET(EMRSETMAPMODE, emr, 0) + TEST_FIELD_SIZE (EMRSETMAPMODE, iMode, 4) + TEST_FIELD_ALIGN (EMRSETMAPMODE, iMode, 4) + TEST_FIELD_OFFSET(EMRSETMAPMODE, iMode, 8) +} + +static void test_pack_EMRSETMAPPERFLAGS(void) +{ + /* EMRSETMAPPERFLAGS (pack 4) */ + TEST_TYPE_SIZE (EMRSETMAPPERFLAGS, 12) + TEST_TYPE_ALIGN (EMRSETMAPPERFLAGS, 4) + TEST_FIELD_SIZE (EMRSETMAPPERFLAGS, emr, 8) + TEST_FIELD_ALIGN (EMRSETMAPPERFLAGS, emr, 4) + TEST_FIELD_OFFSET(EMRSETMAPPERFLAGS, emr, 0) + TEST_FIELD_SIZE (EMRSETMAPPERFLAGS, dwFlags, 4) + TEST_FIELD_ALIGN (EMRSETMAPPERFLAGS, dwFlags, 4) + TEST_FIELD_OFFSET(EMRSETMAPPERFLAGS, dwFlags, 8) +} + +static void test_pack_EMRSETMETARGN(void) +{ + /* EMRSETMETARGN (pack 4) */ + TEST_TYPE_SIZE (EMRSETMETARGN, 8) + TEST_TYPE_ALIGN (EMRSETMETARGN, 4) + TEST_FIELD_SIZE (EMRSETMETARGN, emr, 8) + TEST_FIELD_ALIGN (EMRSETMETARGN, emr, 4) + TEST_FIELD_OFFSET(EMRSETMETARGN, emr, 0) +} + +static void test_pack_EMRSETMITERLIMIT(void) +{ + /* EMRSETMITERLIMIT (pack 4) */ + TEST_TYPE_SIZE (EMRSETMITERLIMIT, 12) + TEST_TYPE_ALIGN (EMRSETMITERLIMIT, 4) + TEST_FIELD_SIZE (EMRSETMITERLIMIT, emr, 8) + TEST_FIELD_ALIGN (EMRSETMITERLIMIT, emr, 4) + TEST_FIELD_OFFSET(EMRSETMITERLIMIT, emr, 0) + TEST_FIELD_SIZE (EMRSETMITERLIMIT, eMiterLimit, 4) + TEST_FIELD_ALIGN (EMRSETMITERLIMIT, eMiterLimit, 4) + TEST_FIELD_OFFSET(EMRSETMITERLIMIT, eMiterLimit, 8) +} + +static void test_pack_EMRSETPIXELV(void) +{ + /* EMRSETPIXELV (pack 4) */ + TEST_TYPE_SIZE (EMRSETPIXELV, 20) + TEST_TYPE_ALIGN (EMRSETPIXELV, 4) + TEST_FIELD_SIZE (EMRSETPIXELV, emr, 8) + TEST_FIELD_ALIGN (EMRSETPIXELV, emr, 4) + TEST_FIELD_OFFSET(EMRSETPIXELV, emr, 0) + TEST_FIELD_SIZE (EMRSETPIXELV, ptlPixel, 8) + TEST_FIELD_ALIGN (EMRSETPIXELV, ptlPixel, 4) + TEST_FIELD_OFFSET(EMRSETPIXELV, ptlPixel, 8) + TEST_FIELD_SIZE (EMRSETPIXELV, crColor, 4) + TEST_FIELD_ALIGN (EMRSETPIXELV, crColor, 4) + TEST_FIELD_OFFSET(EMRSETPIXELV, crColor, 16) +} + +static void test_pack_EMRSETPOLYFILLMODE(void) +{ + /* EMRSETPOLYFILLMODE (pack 4) */ + TEST_TYPE_SIZE (EMRSETPOLYFILLMODE, 12) + TEST_TYPE_ALIGN (EMRSETPOLYFILLMODE, 4) + TEST_FIELD_SIZE (EMRSETPOLYFILLMODE, emr, 8) + TEST_FIELD_ALIGN (EMRSETPOLYFILLMODE, emr, 4) + TEST_FIELD_OFFSET(EMRSETPOLYFILLMODE, emr, 0) + TEST_FIELD_SIZE (EMRSETPOLYFILLMODE, iMode, 4) + TEST_FIELD_ALIGN (EMRSETPOLYFILLMODE, iMode, 4) + TEST_FIELD_OFFSET(EMRSETPOLYFILLMODE, iMode, 8) +} + +static void test_pack_EMRSETROP2(void) +{ + /* EMRSETROP2 (pack 4) */ + TEST_TYPE_SIZE (EMRSETROP2, 12) + TEST_TYPE_ALIGN (EMRSETROP2, 4) + TEST_FIELD_SIZE (EMRSETROP2, emr, 8) + TEST_FIELD_ALIGN (EMRSETROP2, emr, 4) + TEST_FIELD_OFFSET(EMRSETROP2, emr, 0) + TEST_FIELD_SIZE (EMRSETROP2, iMode, 4) + TEST_FIELD_ALIGN (EMRSETROP2, iMode, 4) + TEST_FIELD_OFFSET(EMRSETROP2, iMode, 8) +} + +static void test_pack_EMRSETSTRETCHBLTMODE(void) +{ + /* EMRSETSTRETCHBLTMODE (pack 4) */ + TEST_TYPE_SIZE (EMRSETSTRETCHBLTMODE, 12) + TEST_TYPE_ALIGN (EMRSETSTRETCHBLTMODE, 4) + TEST_FIELD_SIZE (EMRSETSTRETCHBLTMODE, emr, 8) + TEST_FIELD_ALIGN (EMRSETSTRETCHBLTMODE, emr, 4) + TEST_FIELD_OFFSET(EMRSETSTRETCHBLTMODE, emr, 0) + TEST_FIELD_SIZE (EMRSETSTRETCHBLTMODE, iMode, 4) + TEST_FIELD_ALIGN (EMRSETSTRETCHBLTMODE, iMode, 4) + TEST_FIELD_OFFSET(EMRSETSTRETCHBLTMODE, iMode, 8) +} + +static void test_pack_EMRSETTEXTALIGN(void) +{ + /* EMRSETTEXTALIGN (pack 4) */ + TEST_TYPE_SIZE (EMRSETTEXTALIGN, 12) + TEST_TYPE_ALIGN (EMRSETTEXTALIGN, 4) + TEST_FIELD_SIZE (EMRSETTEXTALIGN, emr, 8) + TEST_FIELD_ALIGN (EMRSETTEXTALIGN, emr, 4) + TEST_FIELD_OFFSET(EMRSETTEXTALIGN, emr, 0) + TEST_FIELD_SIZE (EMRSETTEXTALIGN, iMode, 4) + TEST_FIELD_ALIGN (EMRSETTEXTALIGN, iMode, 4) + TEST_FIELD_OFFSET(EMRSETTEXTALIGN, iMode, 8) +} + +static void test_pack_EMRSETTEXTCOLOR(void) +{ + /* EMRSETTEXTCOLOR (pack 4) */ + TEST_TYPE_SIZE (EMRSETTEXTCOLOR, 12) + TEST_TYPE_ALIGN (EMRSETTEXTCOLOR, 4) + TEST_FIELD_SIZE (EMRSETTEXTCOLOR, emr, 8) + TEST_FIELD_ALIGN (EMRSETTEXTCOLOR, emr, 4) + TEST_FIELD_OFFSET(EMRSETTEXTCOLOR, emr, 0) + TEST_FIELD_SIZE (EMRSETTEXTCOLOR, crColor, 4) + TEST_FIELD_ALIGN (EMRSETTEXTCOLOR, crColor, 4) + TEST_FIELD_OFFSET(EMRSETTEXTCOLOR, crColor, 8) +} + +static void test_pack_EMRSETVIEWPORTEXTEX(void) +{ + /* EMRSETVIEWPORTEXTEX (pack 4) */ + TEST_TYPE_SIZE (EMRSETVIEWPORTEXTEX, 16) + TEST_TYPE_ALIGN (EMRSETVIEWPORTEXTEX, 4) + TEST_FIELD_SIZE (EMRSETVIEWPORTEXTEX, emr, 8) + TEST_FIELD_ALIGN (EMRSETVIEWPORTEXTEX, emr, 4) + TEST_FIELD_OFFSET(EMRSETVIEWPORTEXTEX, emr, 0) + TEST_FIELD_SIZE (EMRSETVIEWPORTEXTEX, szlExtent, 8) + TEST_FIELD_ALIGN (EMRSETVIEWPORTEXTEX, szlExtent, 4) + TEST_FIELD_OFFSET(EMRSETVIEWPORTEXTEX, szlExtent, 8) +} + +static void test_pack_EMRSETVIEWPORTORGEX(void) +{ + /* EMRSETVIEWPORTORGEX (pack 4) */ + TEST_TYPE_SIZE (EMRSETVIEWPORTORGEX, 16) + TEST_TYPE_ALIGN (EMRSETVIEWPORTORGEX, 4) + TEST_FIELD_SIZE (EMRSETVIEWPORTORGEX, emr, 8) + TEST_FIELD_ALIGN (EMRSETVIEWPORTORGEX, emr, 4) + TEST_FIELD_OFFSET(EMRSETVIEWPORTORGEX, emr, 0) + TEST_FIELD_SIZE (EMRSETVIEWPORTORGEX, ptlOrigin, 8) + TEST_FIELD_ALIGN (EMRSETVIEWPORTORGEX, ptlOrigin, 4) + TEST_FIELD_OFFSET(EMRSETVIEWPORTORGEX, ptlOrigin, 8) +} + +static void test_pack_EMRSETWINDOWEXTEX(void) +{ + /* EMRSETWINDOWEXTEX (pack 4) */ + TEST_TYPE_SIZE (EMRSETWINDOWEXTEX, 16) + TEST_TYPE_ALIGN (EMRSETWINDOWEXTEX, 4) + TEST_FIELD_SIZE (EMRSETWINDOWEXTEX, emr, 8) + TEST_FIELD_ALIGN (EMRSETWINDOWEXTEX, emr, 4) + TEST_FIELD_OFFSET(EMRSETWINDOWEXTEX, emr, 0) + TEST_FIELD_SIZE (EMRSETWINDOWEXTEX, szlExtent, 8) + TEST_FIELD_ALIGN (EMRSETWINDOWEXTEX, szlExtent, 4) + TEST_FIELD_OFFSET(EMRSETWINDOWEXTEX, szlExtent, 8) +} + +static void test_pack_EMRSETWINDOWORGEX(void) +{ + /* EMRSETWINDOWORGEX (pack 4) */ + TEST_TYPE_SIZE (EMRSETWINDOWORGEX, 16) + TEST_TYPE_ALIGN (EMRSETWINDOWORGEX, 4) + TEST_FIELD_SIZE (EMRSETWINDOWORGEX, emr, 8) + TEST_FIELD_ALIGN (EMRSETWINDOWORGEX, emr, 4) + TEST_FIELD_OFFSET(EMRSETWINDOWORGEX, emr, 0) + TEST_FIELD_SIZE (EMRSETWINDOWORGEX, ptlOrigin, 8) + TEST_FIELD_ALIGN (EMRSETWINDOWORGEX, ptlOrigin, 4) + TEST_FIELD_OFFSET(EMRSETWINDOWORGEX, ptlOrigin, 8) +} + +static void test_pack_EMRSETWORLDTRANSFORM(void) +{ + /* EMRSETWORLDTRANSFORM (pack 4) */ + TEST_TYPE_SIZE (EMRSETWORLDTRANSFORM, 32) + TEST_TYPE_ALIGN (EMRSETWORLDTRANSFORM, 4) + TEST_FIELD_SIZE (EMRSETWORLDTRANSFORM, emr, 8) + TEST_FIELD_ALIGN (EMRSETWORLDTRANSFORM, emr, 4) + TEST_FIELD_OFFSET(EMRSETWORLDTRANSFORM, emr, 0) + TEST_FIELD_SIZE (EMRSETWORLDTRANSFORM, xform, 24) + TEST_FIELD_ALIGN (EMRSETWORLDTRANSFORM, xform, 4) + TEST_FIELD_OFFSET(EMRSETWORLDTRANSFORM, xform, 8) +} + +static void test_pack_EMRSTRETCHBLT(void) +{ + /* EMRSTRETCHBLT (pack 4) */ + TEST_TYPE_SIZE (EMRSTRETCHBLT, 108) + TEST_TYPE_ALIGN (EMRSTRETCHBLT, 4) + TEST_FIELD_SIZE (EMRSTRETCHBLT, emr, 8) + TEST_FIELD_ALIGN (EMRSTRETCHBLT, emr, 4) + TEST_FIELD_OFFSET(EMRSTRETCHBLT, emr, 0) + TEST_FIELD_SIZE (EMRSTRETCHBLT, rclBounds, 16) + TEST_FIELD_ALIGN (EMRSTRETCHBLT, rclBounds, 4) + TEST_FIELD_OFFSET(EMRSTRETCHBLT, rclBounds, 8) + TEST_FIELD_SIZE (EMRSTRETCHBLT, xDest, 4) + TEST_FIELD_ALIGN (EMRSTRETCHBLT, xDest, 4) + TEST_FIELD_OFFSET(EMRSTRETCHBLT, xDest, 24) + TEST_FIELD_SIZE (EMRSTRETCHBLT, yDest, 4) + TEST_FIELD_ALIGN (EMRSTRETCHBLT, yDest, 4) + TEST_FIELD_OFFSET(EMRSTRETCHBLT, yDest, 28) + TEST_FIELD_SIZE (EMRSTRETCHBLT, cxDest, 4) + TEST_FIELD_ALIGN (EMRSTRETCHBLT, cxDest, 4) + TEST_FIELD_OFFSET(EMRSTRETCHBLT, cxDest, 32) + TEST_FIELD_SIZE (EMRSTRETCHBLT, cyDest, 4) + TEST_FIELD_ALIGN (EMRSTRETCHBLT, cyDest, 4) + TEST_FIELD_OFFSET(EMRSTRETCHBLT, cyDest, 36) + TEST_FIELD_SIZE (EMRSTRETCHBLT, dwRop, 4) + TEST_FIELD_ALIGN (EMRSTRETCHBLT, dwRop, 4) + TEST_FIELD_OFFSET(EMRSTRETCHBLT, dwRop, 40) + TEST_FIELD_SIZE (EMRSTRETCHBLT, xSrc, 4) + TEST_FIELD_ALIGN (EMRSTRETCHBLT, xSrc, 4) + TEST_FIELD_OFFSET(EMRSTRETCHBLT, xSrc, 44) + TEST_FIELD_SIZE (EMRSTRETCHBLT, ySrc, 4) + TEST_FIELD_ALIGN (EMRSTRETCHBLT, ySrc, 4) + TEST_FIELD_OFFSET(EMRSTRETCHBLT, ySrc, 48) + TEST_FIELD_SIZE (EMRSTRETCHBLT, xformSrc, 24) + TEST_FIELD_ALIGN (EMRSTRETCHBLT, xformSrc, 4) + TEST_FIELD_OFFSET(EMRSTRETCHBLT, xformSrc, 52) + TEST_FIELD_SIZE (EMRSTRETCHBLT, crBkColorSrc, 4) + TEST_FIELD_ALIGN (EMRSTRETCHBLT, crBkColorSrc, 4) + TEST_FIELD_OFFSET(EMRSTRETCHBLT, crBkColorSrc, 76) + TEST_FIELD_SIZE (EMRSTRETCHBLT, iUsageSrc, 4) + TEST_FIELD_ALIGN (EMRSTRETCHBLT, iUsageSrc, 4) + TEST_FIELD_OFFSET(EMRSTRETCHBLT, iUsageSrc, 80) + TEST_FIELD_SIZE (EMRSTRETCHBLT, offBmiSrc, 4) + TEST_FIELD_ALIGN (EMRSTRETCHBLT, offBmiSrc, 4) + TEST_FIELD_OFFSET(EMRSTRETCHBLT, offBmiSrc, 84) + TEST_FIELD_SIZE (EMRSTRETCHBLT, cbBmiSrc, 4) + TEST_FIELD_ALIGN (EMRSTRETCHBLT, cbBmiSrc, 4) + TEST_FIELD_OFFSET(EMRSTRETCHBLT, cbBmiSrc, 88) + TEST_FIELD_SIZE (EMRSTRETCHBLT, offBitsSrc, 4) + TEST_FIELD_ALIGN (EMRSTRETCHBLT, offBitsSrc, 4) + TEST_FIELD_OFFSET(EMRSTRETCHBLT, offBitsSrc, 92) + TEST_FIELD_SIZE (EMRSTRETCHBLT, cbBitsSrc, 4) + TEST_FIELD_ALIGN (EMRSTRETCHBLT, cbBitsSrc, 4) + TEST_FIELD_OFFSET(EMRSTRETCHBLT, cbBitsSrc, 96) + TEST_FIELD_SIZE (EMRSTRETCHBLT, cxSrc, 4) + TEST_FIELD_ALIGN (EMRSTRETCHBLT, cxSrc, 4) + TEST_FIELD_OFFSET(EMRSTRETCHBLT, cxSrc, 100) + TEST_FIELD_SIZE (EMRSTRETCHBLT, cySrc, 4) + TEST_FIELD_ALIGN (EMRSTRETCHBLT, cySrc, 4) + TEST_FIELD_OFFSET(EMRSTRETCHBLT, cySrc, 104) +} + +static void test_pack_EMRSTRETCHDIBITS(void) +{ + /* EMRSTRETCHDIBITS (pack 4) */ + TEST_TYPE_SIZE (EMRSTRETCHDIBITS, 80) + TEST_TYPE_ALIGN (EMRSTRETCHDIBITS, 4) + TEST_FIELD_SIZE (EMRSTRETCHDIBITS, emr, 8) + TEST_FIELD_ALIGN (EMRSTRETCHDIBITS, emr, 4) + TEST_FIELD_OFFSET(EMRSTRETCHDIBITS, emr, 0) + TEST_FIELD_SIZE (EMRSTRETCHDIBITS, rclBounds, 16) + TEST_FIELD_ALIGN (EMRSTRETCHDIBITS, rclBounds, 4) + TEST_FIELD_OFFSET(EMRSTRETCHDIBITS, rclBounds, 8) + TEST_FIELD_SIZE (EMRSTRETCHDIBITS, xDest, 4) + TEST_FIELD_ALIGN (EMRSTRETCHDIBITS, xDest, 4) + TEST_FIELD_OFFSET(EMRSTRETCHDIBITS, xDest, 24) + TEST_FIELD_SIZE (EMRSTRETCHDIBITS, yDest, 4) + TEST_FIELD_ALIGN (EMRSTRETCHDIBITS, yDest, 4) + TEST_FIELD_OFFSET(EMRSTRETCHDIBITS, yDest, 28) + TEST_FIELD_SIZE (EMRSTRETCHDIBITS, xSrc, 4) + TEST_FIELD_ALIGN (EMRSTRETCHDIBITS, xSrc, 4) + TEST_FIELD_OFFSET(EMRSTRETCHDIBITS, xSrc, 32) + TEST_FIELD_SIZE (EMRSTRETCHDIBITS, ySrc, 4) + TEST_FIELD_ALIGN (EMRSTRETCHDIBITS, ySrc, 4) + TEST_FIELD_OFFSET(EMRSTRETCHDIBITS, ySrc, 36) + TEST_FIELD_SIZE (EMRSTRETCHDIBITS, cxSrc, 4) + TEST_FIELD_ALIGN (EMRSTRETCHDIBITS, cxSrc, 4) + TEST_FIELD_OFFSET(EMRSTRETCHDIBITS, cxSrc, 40) + TEST_FIELD_SIZE (EMRSTRETCHDIBITS, cySrc, 4) + TEST_FIELD_ALIGN (EMRSTRETCHDIBITS, cySrc, 4) + TEST_FIELD_OFFSET(EMRSTRETCHDIBITS, cySrc, 44) + TEST_FIELD_SIZE (EMRSTRETCHDIBITS, offBmiSrc, 4) + TEST_FIELD_ALIGN (EMRSTRETCHDIBITS, offBmiSrc, 4) + TEST_FIELD_OFFSET(EMRSTRETCHDIBITS, offBmiSrc, 48) + TEST_FIELD_SIZE (EMRSTRETCHDIBITS, cbBmiSrc, 4) + TEST_FIELD_ALIGN (EMRSTRETCHDIBITS, cbBmiSrc, 4) + TEST_FIELD_OFFSET(EMRSTRETCHDIBITS, cbBmiSrc, 52) + TEST_FIELD_SIZE (EMRSTRETCHDIBITS, offBitsSrc, 4) + TEST_FIELD_ALIGN (EMRSTRETCHDIBITS, offBitsSrc, 4) + TEST_FIELD_OFFSET(EMRSTRETCHDIBITS, offBitsSrc, 56) + TEST_FIELD_SIZE (EMRSTRETCHDIBITS, cbBitsSrc, 4) + TEST_FIELD_ALIGN (EMRSTRETCHDIBITS, cbBitsSrc, 4) + TEST_FIELD_OFFSET(EMRSTRETCHDIBITS, cbBitsSrc, 60) + TEST_FIELD_SIZE (EMRSTRETCHDIBITS, iUsageSrc, 4) + TEST_FIELD_ALIGN (EMRSTRETCHDIBITS, iUsageSrc, 4) + TEST_FIELD_OFFSET(EMRSTRETCHDIBITS, iUsageSrc, 64) + TEST_FIELD_SIZE (EMRSTRETCHDIBITS, dwRop, 4) + TEST_FIELD_ALIGN (EMRSTRETCHDIBITS, dwRop, 4) + TEST_FIELD_OFFSET(EMRSTRETCHDIBITS, dwRop, 68) + TEST_FIELD_SIZE (EMRSTRETCHDIBITS, cxDest, 4) + TEST_FIELD_ALIGN (EMRSTRETCHDIBITS, cxDest, 4) + TEST_FIELD_OFFSET(EMRSTRETCHDIBITS, cxDest, 72) + TEST_FIELD_SIZE (EMRSTRETCHDIBITS, cyDest, 4) + TEST_FIELD_ALIGN (EMRSTRETCHDIBITS, cyDest, 4) + TEST_FIELD_OFFSET(EMRSTRETCHDIBITS, cyDest, 76) +} + +static void test_pack_EMRSTROKEANDFILLPATH(void) +{ + /* EMRSTROKEANDFILLPATH (pack 4) */ + TEST_TYPE_SIZE (EMRSTROKEANDFILLPATH, 24) + TEST_TYPE_ALIGN (EMRSTROKEANDFILLPATH, 4) + TEST_FIELD_SIZE (EMRSTROKEANDFILLPATH, emr, 8) + TEST_FIELD_ALIGN (EMRSTROKEANDFILLPATH, emr, 4) + TEST_FIELD_OFFSET(EMRSTROKEANDFILLPATH, emr, 0) + TEST_FIELD_SIZE (EMRSTROKEANDFILLPATH, rclBounds, 16) + TEST_FIELD_ALIGN (EMRSTROKEANDFILLPATH, rclBounds, 4) + TEST_FIELD_OFFSET(EMRSTROKEANDFILLPATH, rclBounds, 8) +} + +static void test_pack_EMRSTROKEPATH(void) +{ + /* EMRSTROKEPATH (pack 4) */ + TEST_TYPE_SIZE (EMRSTROKEPATH, 24) + TEST_TYPE_ALIGN (EMRSTROKEPATH, 4) + TEST_FIELD_SIZE (EMRSTROKEPATH, emr, 8) + TEST_FIELD_ALIGN (EMRSTROKEPATH, emr, 4) + TEST_FIELD_OFFSET(EMRSTROKEPATH, emr, 0) + TEST_FIELD_SIZE (EMRSTROKEPATH, rclBounds, 16) + TEST_FIELD_ALIGN (EMRSTROKEPATH, rclBounds, 4) + TEST_FIELD_OFFSET(EMRSTROKEPATH, rclBounds, 8) +} + +static void test_pack_EMRTEXT(void) +{ + /* EMRTEXT (pack 4) */ + TEST_TYPE_SIZE (EMRTEXT, 40) + TEST_TYPE_ALIGN (EMRTEXT, 4) + TEST_FIELD_SIZE (EMRTEXT, ptlReference, 8) + TEST_FIELD_ALIGN (EMRTEXT, ptlReference, 4) + TEST_FIELD_OFFSET(EMRTEXT, ptlReference, 0) + TEST_FIELD_SIZE (EMRTEXT, nChars, 4) + TEST_FIELD_ALIGN (EMRTEXT, nChars, 4) + TEST_FIELD_OFFSET(EMRTEXT, nChars, 8) + TEST_FIELD_SIZE (EMRTEXT, offString, 4) + TEST_FIELD_ALIGN (EMRTEXT, offString, 4) + TEST_FIELD_OFFSET(EMRTEXT, offString, 12) + TEST_FIELD_SIZE (EMRTEXT, fOptions, 4) + TEST_FIELD_ALIGN (EMRTEXT, fOptions, 4) + TEST_FIELD_OFFSET(EMRTEXT, fOptions, 16) + TEST_FIELD_SIZE (EMRTEXT, rcl, 16) + TEST_FIELD_ALIGN (EMRTEXT, rcl, 4) + TEST_FIELD_OFFSET(EMRTEXT, rcl, 20) + TEST_FIELD_SIZE (EMRTEXT, offDx, 4) + TEST_FIELD_ALIGN (EMRTEXT, offDx, 4) + TEST_FIELD_OFFSET(EMRTEXT, offDx, 36) +} + +static void test_pack_EMRWIDENPATH(void) +{ + /* EMRWIDENPATH (pack 4) */ + TEST_TYPE_SIZE (EMRWIDENPATH, 8) + TEST_TYPE_ALIGN (EMRWIDENPATH, 4) + TEST_FIELD_SIZE (EMRWIDENPATH, emr, 8) + TEST_FIELD_ALIGN (EMRWIDENPATH, emr, 4) + TEST_FIELD_OFFSET(EMRWIDENPATH, emr, 0) +} + +static void test_pack_ENHMETAHEADER(void) +{ + /* ENHMETAHEADER (pack 4) */ + TEST_TYPE_SIZE (ENHMETAHEADER, 108) + TEST_TYPE_ALIGN (ENHMETAHEADER, 4) + TEST_FIELD_SIZE (ENHMETAHEADER, iType, 4) + TEST_FIELD_ALIGN (ENHMETAHEADER, iType, 4) + TEST_FIELD_OFFSET(ENHMETAHEADER, iType, 0) + TEST_FIELD_SIZE (ENHMETAHEADER, nSize, 4) + TEST_FIELD_ALIGN (ENHMETAHEADER, nSize, 4) + TEST_FIELD_OFFSET(ENHMETAHEADER, nSize, 4) + TEST_FIELD_SIZE (ENHMETAHEADER, rclBounds, 16) + TEST_FIELD_ALIGN (ENHMETAHEADER, rclBounds, 4) + TEST_FIELD_OFFSET(ENHMETAHEADER, rclBounds, 8) + TEST_FIELD_SIZE (ENHMETAHEADER, rclFrame, 16) + TEST_FIELD_ALIGN (ENHMETAHEADER, rclFrame, 4) + TEST_FIELD_OFFSET(ENHMETAHEADER, rclFrame, 24) + TEST_FIELD_SIZE (ENHMETAHEADER, dSignature, 4) + TEST_FIELD_ALIGN (ENHMETAHEADER, dSignature, 4) + TEST_FIELD_OFFSET(ENHMETAHEADER, dSignature, 40) + TEST_FIELD_SIZE (ENHMETAHEADER, nVersion, 4) + TEST_FIELD_ALIGN (ENHMETAHEADER, nVersion, 4) + TEST_FIELD_OFFSET(ENHMETAHEADER, nVersion, 44) + TEST_FIELD_SIZE (ENHMETAHEADER, nBytes, 4) + TEST_FIELD_ALIGN (ENHMETAHEADER, nBytes, 4) + TEST_FIELD_OFFSET(ENHMETAHEADER, nBytes, 48) + TEST_FIELD_SIZE (ENHMETAHEADER, nRecords, 4) + TEST_FIELD_ALIGN (ENHMETAHEADER, nRecords, 4) + TEST_FIELD_OFFSET(ENHMETAHEADER, nRecords, 52) + TEST_FIELD_SIZE (ENHMETAHEADER, nHandles, 2) + TEST_FIELD_ALIGN (ENHMETAHEADER, nHandles, 2) + TEST_FIELD_OFFSET(ENHMETAHEADER, nHandles, 56) + TEST_FIELD_SIZE (ENHMETAHEADER, sReserved, 2) + TEST_FIELD_ALIGN (ENHMETAHEADER, sReserved, 2) + TEST_FIELD_OFFSET(ENHMETAHEADER, sReserved, 58) + TEST_FIELD_SIZE (ENHMETAHEADER, nDescription, 4) + TEST_FIELD_ALIGN (ENHMETAHEADER, nDescription, 4) + TEST_FIELD_OFFSET(ENHMETAHEADER, nDescription, 60) + TEST_FIELD_SIZE (ENHMETAHEADER, offDescription, 4) + TEST_FIELD_ALIGN (ENHMETAHEADER, offDescription, 4) + TEST_FIELD_OFFSET(ENHMETAHEADER, offDescription, 64) + TEST_FIELD_SIZE (ENHMETAHEADER, nPalEntries, 4) + TEST_FIELD_ALIGN (ENHMETAHEADER, nPalEntries, 4) + TEST_FIELD_OFFSET(ENHMETAHEADER, nPalEntries, 68) + TEST_FIELD_SIZE (ENHMETAHEADER, szlDevice, 8) + TEST_FIELD_ALIGN (ENHMETAHEADER, szlDevice, 4) + TEST_FIELD_OFFSET(ENHMETAHEADER, szlDevice, 72) + TEST_FIELD_SIZE (ENHMETAHEADER, szlMillimeters, 8) + TEST_FIELD_ALIGN (ENHMETAHEADER, szlMillimeters, 4) + TEST_FIELD_OFFSET(ENHMETAHEADER, szlMillimeters, 80) + TEST_FIELD_SIZE (ENHMETAHEADER, cbPixelFormat, 4) + TEST_FIELD_ALIGN (ENHMETAHEADER, cbPixelFormat, 4) + TEST_FIELD_OFFSET(ENHMETAHEADER, cbPixelFormat, 88) + TEST_FIELD_SIZE (ENHMETAHEADER, offPixelFormat, 4) + TEST_FIELD_ALIGN (ENHMETAHEADER, offPixelFormat, 4) + TEST_FIELD_OFFSET(ENHMETAHEADER, offPixelFormat, 92) + TEST_FIELD_SIZE (ENHMETAHEADER, bOpenGL, 4) + TEST_FIELD_ALIGN (ENHMETAHEADER, bOpenGL, 4) + TEST_FIELD_OFFSET(ENHMETAHEADER, bOpenGL, 96) + TEST_FIELD_SIZE (ENHMETAHEADER, szlMicrometers, 8) + TEST_FIELD_ALIGN (ENHMETAHEADER, szlMicrometers, 4) + TEST_FIELD_OFFSET(ENHMETAHEADER, szlMicrometers, 100) +} + +static void test_pack_ENHMETARECORD(void) +{ + /* ENHMETARECORD (pack 4) */ + TEST_TYPE_SIZE (ENHMETARECORD, 12) + TEST_TYPE_ALIGN (ENHMETARECORD, 4) + TEST_FIELD_SIZE (ENHMETARECORD, iType, 4) + TEST_FIELD_ALIGN (ENHMETARECORD, iType, 4) + TEST_FIELD_OFFSET(ENHMETARECORD, iType, 0) + TEST_FIELD_SIZE (ENHMETARECORD, nSize, 4) + TEST_FIELD_ALIGN (ENHMETARECORD, nSize, 4) + TEST_FIELD_OFFSET(ENHMETARECORD, nSize, 4) + TEST_FIELD_SIZE (ENHMETARECORD, dParm, 4) + TEST_FIELD_ALIGN (ENHMETARECORD, dParm, 4) + TEST_FIELD_OFFSET(ENHMETARECORD, dParm, 8) +} + +static void test_pack_ENHMFENUMPROC(void) +{ + /* ENHMFENUMPROC */ + TEST_TYPE_SIZE (ENHMFENUMPROC, 4) + TEST_TYPE_ALIGN (ENHMFENUMPROC, 4) +} + +static void test_pack_ENUMLOGFONTA(void) +{ + /* ENUMLOGFONTA (pack 4) */ + TEST_TYPE_SIZE (ENUMLOGFONTA, 156) + TEST_TYPE_ALIGN (ENUMLOGFONTA, 4) + TEST_FIELD_SIZE (ENUMLOGFONTA, elfLogFont, 60) + TEST_FIELD_ALIGN (ENUMLOGFONTA, elfLogFont, 4) + TEST_FIELD_OFFSET(ENUMLOGFONTA, elfLogFont, 0) + TEST_FIELD_SIZE (ENUMLOGFONTA, elfFullName, 64) + TEST_FIELD_ALIGN (ENUMLOGFONTA, elfFullName, 1) + TEST_FIELD_OFFSET(ENUMLOGFONTA, elfFullName, 60) + TEST_FIELD_SIZE (ENUMLOGFONTA, elfStyle, 32) + TEST_FIELD_ALIGN (ENUMLOGFONTA, elfStyle, 1) + TEST_FIELD_OFFSET(ENUMLOGFONTA, elfStyle, 124) +} + +static void test_pack_ENUMLOGFONTEXA(void) +{ + /* ENUMLOGFONTEXA (pack 4) */ + TEST_TYPE_SIZE (ENUMLOGFONTEXA, 188) + TEST_TYPE_ALIGN (ENUMLOGFONTEXA, 4) + TEST_FIELD_SIZE (ENUMLOGFONTEXA, elfLogFont, 60) + TEST_FIELD_ALIGN (ENUMLOGFONTEXA, elfLogFont, 4) + TEST_FIELD_OFFSET(ENUMLOGFONTEXA, elfLogFont, 0) + TEST_FIELD_SIZE (ENUMLOGFONTEXA, elfFullName, 64) + TEST_FIELD_ALIGN (ENUMLOGFONTEXA, elfFullName, 1) + TEST_FIELD_OFFSET(ENUMLOGFONTEXA, elfFullName, 60) + TEST_FIELD_SIZE (ENUMLOGFONTEXA, elfStyle, 32) + TEST_FIELD_ALIGN (ENUMLOGFONTEXA, elfStyle, 1) + TEST_FIELD_OFFSET(ENUMLOGFONTEXA, elfStyle, 124) + TEST_FIELD_SIZE (ENUMLOGFONTEXA, elfScript, 32) + TEST_FIELD_ALIGN (ENUMLOGFONTEXA, elfScript, 1) + TEST_FIELD_OFFSET(ENUMLOGFONTEXA, elfScript, 156) +} + +static void test_pack_ENUMLOGFONTEXW(void) +{ + /* ENUMLOGFONTEXW (pack 4) */ + TEST_TYPE_SIZE (ENUMLOGFONTEXW, 348) + TEST_TYPE_ALIGN (ENUMLOGFONTEXW, 4) + TEST_FIELD_SIZE (ENUMLOGFONTEXW, elfLogFont, 92) + TEST_FIELD_ALIGN (ENUMLOGFONTEXW, elfLogFont, 4) + TEST_FIELD_OFFSET(ENUMLOGFONTEXW, elfLogFont, 0) + TEST_FIELD_SIZE (ENUMLOGFONTEXW, elfFullName, 128) + TEST_FIELD_ALIGN (ENUMLOGFONTEXW, elfFullName, 2) + TEST_FIELD_OFFSET(ENUMLOGFONTEXW, elfFullName, 92) + TEST_FIELD_SIZE (ENUMLOGFONTEXW, elfStyle, 64) + TEST_FIELD_ALIGN (ENUMLOGFONTEXW, elfStyle, 2) + TEST_FIELD_OFFSET(ENUMLOGFONTEXW, elfStyle, 220) + TEST_FIELD_SIZE (ENUMLOGFONTEXW, elfScript, 64) + TEST_FIELD_ALIGN (ENUMLOGFONTEXW, elfScript, 2) + TEST_FIELD_OFFSET(ENUMLOGFONTEXW, elfScript, 284) +} + +static void test_pack_ENUMLOGFONTW(void) +{ + /* ENUMLOGFONTW (pack 4) */ + TEST_TYPE_SIZE (ENUMLOGFONTW, 284) + TEST_TYPE_ALIGN (ENUMLOGFONTW, 4) + TEST_FIELD_SIZE (ENUMLOGFONTW, elfLogFont, 92) + TEST_FIELD_ALIGN (ENUMLOGFONTW, elfLogFont, 4) + TEST_FIELD_OFFSET(ENUMLOGFONTW, elfLogFont, 0) + TEST_FIELD_SIZE (ENUMLOGFONTW, elfFullName, 128) + TEST_FIELD_ALIGN (ENUMLOGFONTW, elfFullName, 2) + TEST_FIELD_OFFSET(ENUMLOGFONTW, elfFullName, 92) + TEST_FIELD_SIZE (ENUMLOGFONTW, elfStyle, 64) + TEST_FIELD_ALIGN (ENUMLOGFONTW, elfStyle, 2) + TEST_FIELD_OFFSET(ENUMLOGFONTW, elfStyle, 220) +} + +static void test_pack_EXTLOGFONTA(void) +{ + /* EXTLOGFONTA (pack 4) */ + TEST_TYPE_SIZE (EXTLOGFONTA, 192) + TEST_TYPE_ALIGN (EXTLOGFONTA, 4) + TEST_FIELD_SIZE (EXTLOGFONTA, elfLogFont, 60) + TEST_FIELD_ALIGN (EXTLOGFONTA, elfLogFont, 4) + TEST_FIELD_OFFSET(EXTLOGFONTA, elfLogFont, 0) + TEST_FIELD_SIZE (EXTLOGFONTA, elfFullName, 64) + TEST_FIELD_ALIGN (EXTLOGFONTA, elfFullName, 1) + TEST_FIELD_OFFSET(EXTLOGFONTA, elfFullName, 60) + TEST_FIELD_SIZE (EXTLOGFONTA, elfStyle, 32) + TEST_FIELD_ALIGN (EXTLOGFONTA, elfStyle, 1) + TEST_FIELD_OFFSET(EXTLOGFONTA, elfStyle, 124) + TEST_FIELD_SIZE (EXTLOGFONTA, elfVersion, 4) + TEST_FIELD_ALIGN (EXTLOGFONTA, elfVersion, 4) + TEST_FIELD_OFFSET(EXTLOGFONTA, elfVersion, 156) + TEST_FIELD_SIZE (EXTLOGFONTA, elfStyleSize, 4) + TEST_FIELD_ALIGN (EXTLOGFONTA, elfStyleSize, 4) + TEST_FIELD_OFFSET(EXTLOGFONTA, elfStyleSize, 160) + TEST_FIELD_SIZE (EXTLOGFONTA, elfMatch, 4) + TEST_FIELD_ALIGN (EXTLOGFONTA, elfMatch, 4) + TEST_FIELD_OFFSET(EXTLOGFONTA, elfMatch, 164) + TEST_FIELD_SIZE (EXTLOGFONTA, elfReserved, 4) + TEST_FIELD_ALIGN (EXTLOGFONTA, elfReserved, 4) + TEST_FIELD_OFFSET(EXTLOGFONTA, elfReserved, 168) + TEST_FIELD_SIZE (EXTLOGFONTA, elfVendorId, 4) + TEST_FIELD_ALIGN (EXTLOGFONTA, elfVendorId, 1) + TEST_FIELD_OFFSET(EXTLOGFONTA, elfVendorId, 172) + TEST_FIELD_SIZE (EXTLOGFONTA, elfCulture, 4) + TEST_FIELD_ALIGN (EXTLOGFONTA, elfCulture, 4) + TEST_FIELD_OFFSET(EXTLOGFONTA, elfCulture, 176) + TEST_FIELD_SIZE (EXTLOGFONTA, elfPanose, 10) + TEST_FIELD_ALIGN (EXTLOGFONTA, elfPanose, 1) + TEST_FIELD_OFFSET(EXTLOGFONTA, elfPanose, 180) +} + +static void test_pack_EXTLOGFONTW(void) +{ + /* EXTLOGFONTW (pack 4) */ + TEST_TYPE_SIZE (EXTLOGFONTW, 320) + TEST_TYPE_ALIGN (EXTLOGFONTW, 4) + TEST_FIELD_SIZE (EXTLOGFONTW, elfLogFont, 92) + TEST_FIELD_ALIGN (EXTLOGFONTW, elfLogFont, 4) + TEST_FIELD_OFFSET(EXTLOGFONTW, elfLogFont, 0) + TEST_FIELD_SIZE (EXTLOGFONTW, elfFullName, 128) + TEST_FIELD_ALIGN (EXTLOGFONTW, elfFullName, 2) + TEST_FIELD_OFFSET(EXTLOGFONTW, elfFullName, 92) + TEST_FIELD_SIZE (EXTLOGFONTW, elfStyle, 64) + TEST_FIELD_ALIGN (EXTLOGFONTW, elfStyle, 2) + TEST_FIELD_OFFSET(EXTLOGFONTW, elfStyle, 220) + TEST_FIELD_SIZE (EXTLOGFONTW, elfVersion, 4) + TEST_FIELD_ALIGN (EXTLOGFONTW, elfVersion, 4) + TEST_FIELD_OFFSET(EXTLOGFONTW, elfVersion, 284) + TEST_FIELD_SIZE (EXTLOGFONTW, elfStyleSize, 4) + TEST_FIELD_ALIGN (EXTLOGFONTW, elfStyleSize, 4) + TEST_FIELD_OFFSET(EXTLOGFONTW, elfStyleSize, 288) + TEST_FIELD_SIZE (EXTLOGFONTW, elfMatch, 4) + TEST_FIELD_ALIGN (EXTLOGFONTW, elfMatch, 4) + TEST_FIELD_OFFSET(EXTLOGFONTW, elfMatch, 292) + TEST_FIELD_SIZE (EXTLOGFONTW, elfReserved, 4) + TEST_FIELD_ALIGN (EXTLOGFONTW, elfReserved, 4) + TEST_FIELD_OFFSET(EXTLOGFONTW, elfReserved, 296) + TEST_FIELD_SIZE (EXTLOGFONTW, elfVendorId, 4) + TEST_FIELD_ALIGN (EXTLOGFONTW, elfVendorId, 1) + TEST_FIELD_OFFSET(EXTLOGFONTW, elfVendorId, 300) + TEST_FIELD_SIZE (EXTLOGFONTW, elfCulture, 4) + TEST_FIELD_ALIGN (EXTLOGFONTW, elfCulture, 4) + TEST_FIELD_OFFSET(EXTLOGFONTW, elfCulture, 304) + TEST_FIELD_SIZE (EXTLOGFONTW, elfPanose, 10) + TEST_FIELD_ALIGN (EXTLOGFONTW, elfPanose, 1) + TEST_FIELD_OFFSET(EXTLOGFONTW, elfPanose, 308) +} + +static void test_pack_EXTLOGPEN(void) +{ + /* EXTLOGPEN (pack 4) */ + TEST_TYPE_SIZE (EXTLOGPEN, 28) + TEST_TYPE_ALIGN (EXTLOGPEN, 4) + TEST_FIELD_SIZE (EXTLOGPEN, elpPenStyle, 4) + TEST_FIELD_ALIGN (EXTLOGPEN, elpPenStyle, 4) + TEST_FIELD_OFFSET(EXTLOGPEN, elpPenStyle, 0) + TEST_FIELD_SIZE (EXTLOGPEN, elpWidth, 4) + TEST_FIELD_ALIGN (EXTLOGPEN, elpWidth, 4) + TEST_FIELD_OFFSET(EXTLOGPEN, elpWidth, 4) + TEST_FIELD_SIZE (EXTLOGPEN, elpBrushStyle, 4) + TEST_FIELD_ALIGN (EXTLOGPEN, elpBrushStyle, 4) + TEST_FIELD_OFFSET(EXTLOGPEN, elpBrushStyle, 8) + TEST_FIELD_SIZE (EXTLOGPEN, elpColor, 4) + TEST_FIELD_ALIGN (EXTLOGPEN, elpColor, 4) + TEST_FIELD_OFFSET(EXTLOGPEN, elpColor, 12) + TEST_FIELD_SIZE (EXTLOGPEN, elpHatch, 4) + TEST_FIELD_ALIGN (EXTLOGPEN, elpHatch, 4) + TEST_FIELD_OFFSET(EXTLOGPEN, elpHatch, 16) + TEST_FIELD_SIZE (EXTLOGPEN, elpNumEntries, 4) + TEST_FIELD_ALIGN (EXTLOGPEN, elpNumEntries, 4) + TEST_FIELD_OFFSET(EXTLOGPEN, elpNumEntries, 20) + TEST_FIELD_SIZE (EXTLOGPEN, elpStyleEntry, 4) + TEST_FIELD_ALIGN (EXTLOGPEN, elpStyleEntry, 4) + TEST_FIELD_OFFSET(EXTLOGPEN, elpStyleEntry, 24) +} + +static void test_pack_FIXED(void) +{ + /* FIXED (pack 4) */ + TEST_TYPE_SIZE (FIXED, 4) + TEST_TYPE_ALIGN (FIXED, 2) + TEST_FIELD_SIZE (FIXED, fract, 2) + TEST_FIELD_ALIGN (FIXED, fract, 2) + TEST_FIELD_OFFSET(FIXED, fract, 0) + TEST_FIELD_SIZE (FIXED, value, 2) + TEST_FIELD_ALIGN (FIXED, value, 2) + TEST_FIELD_OFFSET(FIXED, value, 2) +} + +static void test_pack_FONTENUMPROCA(void) +{ + /* FONTENUMPROCA */ + TEST_TYPE_SIZE (FONTENUMPROCA, 4) + TEST_TYPE_ALIGN (FONTENUMPROCA, 4) +} + +static void test_pack_FONTENUMPROCW(void) +{ + /* FONTENUMPROCW */ + TEST_TYPE_SIZE (FONTENUMPROCW, 4) + TEST_TYPE_ALIGN (FONTENUMPROCW, 4) +} + +static void test_pack_FONTSIGNATURE(void) +{ + /* FONTSIGNATURE (pack 4) */ + TEST_TYPE_SIZE (FONTSIGNATURE, 24) + TEST_TYPE_ALIGN (FONTSIGNATURE, 4) + TEST_FIELD_SIZE (FONTSIGNATURE, fsUsb, 16) + TEST_FIELD_ALIGN (FONTSIGNATURE, fsUsb, 4) + TEST_FIELD_OFFSET(FONTSIGNATURE, fsUsb, 0) + TEST_FIELD_SIZE (FONTSIGNATURE, fsCsb, 8) + TEST_FIELD_ALIGN (FONTSIGNATURE, fsCsb, 4) + TEST_FIELD_OFFSET(FONTSIGNATURE, fsCsb, 16) +} + +static void test_pack_FXPT16DOT16(void) +{ + /* FXPT16DOT16 */ + TEST_TYPE_SIZE (FXPT16DOT16, 4) + TEST_TYPE_ALIGN (FXPT16DOT16, 4) +} + +static void test_pack_FXPT2DOT30(void) +{ + /* FXPT2DOT30 */ + TEST_TYPE_SIZE (FXPT2DOT30, 4) + TEST_TYPE_ALIGN (FXPT2DOT30, 4) +} + +static void test_pack_GCP_RESULTSA(void) +{ + /* GCP_RESULTSA (pack 4) */ + TEST_TYPE_SIZE (GCP_RESULTSA, 36) + TEST_TYPE_ALIGN (GCP_RESULTSA, 4) + TEST_FIELD_SIZE (GCP_RESULTSA, lStructSize, 4) + TEST_FIELD_ALIGN (GCP_RESULTSA, lStructSize, 4) + TEST_FIELD_OFFSET(GCP_RESULTSA, lStructSize, 0) + TEST_FIELD_SIZE (GCP_RESULTSA, lpOutString, 4) + TEST_FIELD_ALIGN (GCP_RESULTSA, lpOutString, 4) + TEST_FIELD_OFFSET(GCP_RESULTSA, lpOutString, 4) + TEST_FIELD_SIZE (GCP_RESULTSA, lpOrder, 4) + TEST_FIELD_ALIGN (GCP_RESULTSA, lpOrder, 4) + TEST_FIELD_OFFSET(GCP_RESULTSA, lpOrder, 8) + TEST_FIELD_SIZE (GCP_RESULTSA, lpDx, 4) + TEST_FIELD_ALIGN (GCP_RESULTSA, lpDx, 4) + TEST_FIELD_OFFSET(GCP_RESULTSA, lpDx, 12) + TEST_FIELD_SIZE (GCP_RESULTSA, lpCaretPos, 4) + TEST_FIELD_ALIGN (GCP_RESULTSA, lpCaretPos, 4) + TEST_FIELD_OFFSET(GCP_RESULTSA, lpCaretPos, 16) + TEST_FIELD_SIZE (GCP_RESULTSA, lpClass, 4) + TEST_FIELD_ALIGN (GCP_RESULTSA, lpClass, 4) + TEST_FIELD_OFFSET(GCP_RESULTSA, lpClass, 20) + TEST_FIELD_SIZE (GCP_RESULTSA, lpGlyphs, 4) + TEST_FIELD_ALIGN (GCP_RESULTSA, lpGlyphs, 4) + TEST_FIELD_OFFSET(GCP_RESULTSA, lpGlyphs, 24) + TEST_FIELD_SIZE (GCP_RESULTSA, nGlyphs, 4) + TEST_FIELD_ALIGN (GCP_RESULTSA, nGlyphs, 4) + TEST_FIELD_OFFSET(GCP_RESULTSA, nGlyphs, 28) + TEST_FIELD_SIZE (GCP_RESULTSA, nMaxFit, 4) + TEST_FIELD_ALIGN (GCP_RESULTSA, nMaxFit, 4) + TEST_FIELD_OFFSET(GCP_RESULTSA, nMaxFit, 32) +} + +static void test_pack_GCP_RESULTSW(void) +{ + /* GCP_RESULTSW (pack 4) */ + TEST_TYPE_SIZE (GCP_RESULTSW, 36) + TEST_TYPE_ALIGN (GCP_RESULTSW, 4) + TEST_FIELD_SIZE (GCP_RESULTSW, lStructSize, 4) + TEST_FIELD_ALIGN (GCP_RESULTSW, lStructSize, 4) + TEST_FIELD_OFFSET(GCP_RESULTSW, lStructSize, 0) + TEST_FIELD_SIZE (GCP_RESULTSW, lpOutString, 4) + TEST_FIELD_ALIGN (GCP_RESULTSW, lpOutString, 4) + TEST_FIELD_OFFSET(GCP_RESULTSW, lpOutString, 4) + TEST_FIELD_SIZE (GCP_RESULTSW, lpOrder, 4) + TEST_FIELD_ALIGN (GCP_RESULTSW, lpOrder, 4) + TEST_FIELD_OFFSET(GCP_RESULTSW, lpOrder, 8) + TEST_FIELD_SIZE (GCP_RESULTSW, lpDx, 4) + TEST_FIELD_ALIGN (GCP_RESULTSW, lpDx, 4) + TEST_FIELD_OFFSET(GCP_RESULTSW, lpDx, 12) + TEST_FIELD_SIZE (GCP_RESULTSW, lpCaretPos, 4) + TEST_FIELD_ALIGN (GCP_RESULTSW, lpCaretPos, 4) + TEST_FIELD_OFFSET(GCP_RESULTSW, lpCaretPos, 16) + TEST_FIELD_SIZE (GCP_RESULTSW, lpClass, 4) + TEST_FIELD_ALIGN (GCP_RESULTSW, lpClass, 4) + TEST_FIELD_OFFSET(GCP_RESULTSW, lpClass, 20) + TEST_FIELD_SIZE (GCP_RESULTSW, lpGlyphs, 4) + TEST_FIELD_ALIGN (GCP_RESULTSW, lpGlyphs, 4) + TEST_FIELD_OFFSET(GCP_RESULTSW, lpGlyphs, 24) + TEST_FIELD_SIZE (GCP_RESULTSW, nGlyphs, 4) + TEST_FIELD_ALIGN (GCP_RESULTSW, nGlyphs, 4) + TEST_FIELD_OFFSET(GCP_RESULTSW, nGlyphs, 28) + TEST_FIELD_SIZE (GCP_RESULTSW, nMaxFit, 4) + TEST_FIELD_ALIGN (GCP_RESULTSW, nMaxFit, 4) + TEST_FIELD_OFFSET(GCP_RESULTSW, nMaxFit, 32) +} + +static void test_pack_GLYPHMETRICS(void) +{ + /* GLYPHMETRICS (pack 4) */ + TEST_TYPE_SIZE (GLYPHMETRICS, 20) + TEST_TYPE_ALIGN (GLYPHMETRICS, 4) + TEST_FIELD_SIZE (GLYPHMETRICS, gmBlackBoxX, 4) + TEST_FIELD_ALIGN (GLYPHMETRICS, gmBlackBoxX, 4) + TEST_FIELD_OFFSET(GLYPHMETRICS, gmBlackBoxX, 0) + TEST_FIELD_SIZE (GLYPHMETRICS, gmBlackBoxY, 4) + TEST_FIELD_ALIGN (GLYPHMETRICS, gmBlackBoxY, 4) + TEST_FIELD_OFFSET(GLYPHMETRICS, gmBlackBoxY, 4) + TEST_FIELD_SIZE (GLYPHMETRICS, gmptGlyphOrigin, 8) + TEST_FIELD_ALIGN (GLYPHMETRICS, gmptGlyphOrigin, 4) + TEST_FIELD_OFFSET(GLYPHMETRICS, gmptGlyphOrigin, 8) + TEST_FIELD_SIZE (GLYPHMETRICS, gmCellIncX, 2) + TEST_FIELD_ALIGN (GLYPHMETRICS, gmCellIncX, 2) + TEST_FIELD_OFFSET(GLYPHMETRICS, gmCellIncX, 16) + TEST_FIELD_SIZE (GLYPHMETRICS, gmCellIncY, 2) + TEST_FIELD_ALIGN (GLYPHMETRICS, gmCellIncY, 2) + TEST_FIELD_OFFSET(GLYPHMETRICS, gmCellIncY, 18) +} + +static void test_pack_GLYPHMETRICSFLOAT(void) +{ + /* GLYPHMETRICSFLOAT (pack 4) */ + TEST_TYPE_SIZE (GLYPHMETRICSFLOAT, 24) + TEST_TYPE_ALIGN (GLYPHMETRICSFLOAT, 4) + TEST_FIELD_SIZE (GLYPHMETRICSFLOAT, gmfBlackBoxX, 4) + TEST_FIELD_ALIGN (GLYPHMETRICSFLOAT, gmfBlackBoxX, 4) + TEST_FIELD_OFFSET(GLYPHMETRICSFLOAT, gmfBlackBoxX, 0) + TEST_FIELD_SIZE (GLYPHMETRICSFLOAT, gmfBlackBoxY, 4) + TEST_FIELD_ALIGN (GLYPHMETRICSFLOAT, gmfBlackBoxY, 4) + TEST_FIELD_OFFSET(GLYPHMETRICSFLOAT, gmfBlackBoxY, 4) + TEST_FIELD_SIZE (GLYPHMETRICSFLOAT, gmfptGlyphOrigin, 8) + TEST_FIELD_ALIGN (GLYPHMETRICSFLOAT, gmfptGlyphOrigin, 4) + TEST_FIELD_OFFSET(GLYPHMETRICSFLOAT, gmfptGlyphOrigin, 8) + TEST_FIELD_SIZE (GLYPHMETRICSFLOAT, gmfCellIncX, 4) + TEST_FIELD_ALIGN (GLYPHMETRICSFLOAT, gmfCellIncX, 4) + TEST_FIELD_OFFSET(GLYPHMETRICSFLOAT, gmfCellIncX, 16) + TEST_FIELD_SIZE (GLYPHMETRICSFLOAT, gmfCellIncY, 4) + TEST_FIELD_ALIGN (GLYPHMETRICSFLOAT, gmfCellIncY, 4) + TEST_FIELD_OFFSET(GLYPHMETRICSFLOAT, gmfCellIncY, 20) +} + +static void test_pack_GOBJENUMPROC(void) +{ + /* GOBJENUMPROC */ + TEST_TYPE_SIZE (GOBJENUMPROC, 4) + TEST_TYPE_ALIGN (GOBJENUMPROC, 4) +} + +static void test_pack_GRADIENT_RECT(void) +{ + /* GRADIENT_RECT (pack 4) */ + TEST_TYPE_SIZE (GRADIENT_RECT, 8) + TEST_TYPE_ALIGN (GRADIENT_RECT, 4) + TEST_FIELD_SIZE (GRADIENT_RECT, UpperLeft, 4) + TEST_FIELD_ALIGN (GRADIENT_RECT, UpperLeft, 4) + TEST_FIELD_OFFSET(GRADIENT_RECT, UpperLeft, 0) + TEST_FIELD_SIZE (GRADIENT_RECT, LowerRight, 4) + TEST_FIELD_ALIGN (GRADIENT_RECT, LowerRight, 4) + TEST_FIELD_OFFSET(GRADIENT_RECT, LowerRight, 4) +} + +static void test_pack_GRADIENT_TRIANGLE(void) +{ + /* GRADIENT_TRIANGLE (pack 4) */ + TEST_TYPE_SIZE (GRADIENT_TRIANGLE, 12) + TEST_TYPE_ALIGN (GRADIENT_TRIANGLE, 4) + TEST_FIELD_SIZE (GRADIENT_TRIANGLE, Vertex1, 4) + TEST_FIELD_ALIGN (GRADIENT_TRIANGLE, Vertex1, 4) + TEST_FIELD_OFFSET(GRADIENT_TRIANGLE, Vertex1, 0) + TEST_FIELD_SIZE (GRADIENT_TRIANGLE, Vertex2, 4) + TEST_FIELD_ALIGN (GRADIENT_TRIANGLE, Vertex2, 4) + TEST_FIELD_OFFSET(GRADIENT_TRIANGLE, Vertex2, 4) + TEST_FIELD_SIZE (GRADIENT_TRIANGLE, Vertex3, 4) + TEST_FIELD_ALIGN (GRADIENT_TRIANGLE, Vertex3, 4) + TEST_FIELD_OFFSET(GRADIENT_TRIANGLE, Vertex3, 8) +} + +static void test_pack_HANDLETABLE(void) +{ + /* HANDLETABLE (pack 4) */ + TEST_TYPE_SIZE (HANDLETABLE, 4) + TEST_TYPE_ALIGN (HANDLETABLE, 4) + TEST_FIELD_SIZE (HANDLETABLE, objectHandle, 4) + TEST_FIELD_ALIGN (HANDLETABLE, objectHandle, 4) + TEST_FIELD_OFFSET(HANDLETABLE, objectHandle, 0) +} + +static void test_pack_ICMENUMPROCA(void) +{ + /* ICMENUMPROCA */ + TEST_TYPE_SIZE (ICMENUMPROCA, 4) + TEST_TYPE_ALIGN (ICMENUMPROCA, 4) +} + +static void test_pack_ICMENUMPROCW(void) +{ + /* ICMENUMPROCW */ + TEST_TYPE_SIZE (ICMENUMPROCW, 4) + TEST_TYPE_ALIGN (ICMENUMPROCW, 4) +} + +static void test_pack_KERNINGPAIR(void) +{ + /* KERNINGPAIR (pack 4) */ + TEST_TYPE_SIZE (KERNINGPAIR, 8) + TEST_TYPE_ALIGN (KERNINGPAIR, 4) + TEST_FIELD_SIZE (KERNINGPAIR, wFirst, 2) + TEST_FIELD_ALIGN (KERNINGPAIR, wFirst, 2) + TEST_FIELD_OFFSET(KERNINGPAIR, wFirst, 0) + TEST_FIELD_SIZE (KERNINGPAIR, wSecond, 2) + TEST_FIELD_ALIGN (KERNINGPAIR, wSecond, 2) + TEST_FIELD_OFFSET(KERNINGPAIR, wSecond, 2) + TEST_FIELD_SIZE (KERNINGPAIR, iKernAmount, 4) + TEST_FIELD_ALIGN (KERNINGPAIR, iKernAmount, 4) + TEST_FIELD_OFFSET(KERNINGPAIR, iKernAmount, 4) +} + +static void test_pack_LAYERPLANEDESCRIPTOR(void) +{ + /* LAYERPLANEDESCRIPTOR (pack 4) */ + TEST_TYPE_SIZE (LAYERPLANEDESCRIPTOR, 32) + TEST_TYPE_ALIGN (LAYERPLANEDESCRIPTOR, 4) + TEST_FIELD_SIZE (LAYERPLANEDESCRIPTOR, nSize, 2) + TEST_FIELD_ALIGN (LAYERPLANEDESCRIPTOR, nSize, 2) + TEST_FIELD_OFFSET(LAYERPLANEDESCRIPTOR, nSize, 0) + TEST_FIELD_SIZE (LAYERPLANEDESCRIPTOR, nVersion, 2) + TEST_FIELD_ALIGN (LAYERPLANEDESCRIPTOR, nVersion, 2) + TEST_FIELD_OFFSET(LAYERPLANEDESCRIPTOR, nVersion, 2) + TEST_FIELD_SIZE (LAYERPLANEDESCRIPTOR, dwFlags, 4) + TEST_FIELD_ALIGN (LAYERPLANEDESCRIPTOR, dwFlags, 4) + TEST_FIELD_OFFSET(LAYERPLANEDESCRIPTOR, dwFlags, 4) + TEST_FIELD_SIZE (LAYERPLANEDESCRIPTOR, iPixelType, 1) + TEST_FIELD_ALIGN (LAYERPLANEDESCRIPTOR, iPixelType, 1) + TEST_FIELD_OFFSET(LAYERPLANEDESCRIPTOR, iPixelType, 8) + TEST_FIELD_SIZE (LAYERPLANEDESCRIPTOR, cColorBits, 1) + TEST_FIELD_ALIGN (LAYERPLANEDESCRIPTOR, cColorBits, 1) + TEST_FIELD_OFFSET(LAYERPLANEDESCRIPTOR, cColorBits, 9) + TEST_FIELD_SIZE (LAYERPLANEDESCRIPTOR, cRedBits, 1) + TEST_FIELD_ALIGN (LAYERPLANEDESCRIPTOR, cRedBits, 1) + TEST_FIELD_OFFSET(LAYERPLANEDESCRIPTOR, cRedBits, 10) + TEST_FIELD_SIZE (LAYERPLANEDESCRIPTOR, cRedShift, 1) + TEST_FIELD_ALIGN (LAYERPLANEDESCRIPTOR, cRedShift, 1) + TEST_FIELD_OFFSET(LAYERPLANEDESCRIPTOR, cRedShift, 11) + TEST_FIELD_SIZE (LAYERPLANEDESCRIPTOR, cGreenBits, 1) + TEST_FIELD_ALIGN (LAYERPLANEDESCRIPTOR, cGreenBits, 1) + TEST_FIELD_OFFSET(LAYERPLANEDESCRIPTOR, cGreenBits, 12) + TEST_FIELD_SIZE (LAYERPLANEDESCRIPTOR, cGreenShift, 1) + TEST_FIELD_ALIGN (LAYERPLANEDESCRIPTOR, cGreenShift, 1) + TEST_FIELD_OFFSET(LAYERPLANEDESCRIPTOR, cGreenShift, 13) + TEST_FIELD_SIZE (LAYERPLANEDESCRIPTOR, cBlueBits, 1) + TEST_FIELD_ALIGN (LAYERPLANEDESCRIPTOR, cBlueBits, 1) + TEST_FIELD_OFFSET(LAYERPLANEDESCRIPTOR, cBlueBits, 14) + TEST_FIELD_SIZE (LAYERPLANEDESCRIPTOR, cBlueShift, 1) + TEST_FIELD_ALIGN (LAYERPLANEDESCRIPTOR, cBlueShift, 1) + TEST_FIELD_OFFSET(LAYERPLANEDESCRIPTOR, cBlueShift, 15) + TEST_FIELD_SIZE (LAYERPLANEDESCRIPTOR, cAlphaBits, 1) + TEST_FIELD_ALIGN (LAYERPLANEDESCRIPTOR, cAlphaBits, 1) + TEST_FIELD_OFFSET(LAYERPLANEDESCRIPTOR, cAlphaBits, 16) + TEST_FIELD_SIZE (LAYERPLANEDESCRIPTOR, cAlphaShift, 1) + TEST_FIELD_ALIGN (LAYERPLANEDESCRIPTOR, cAlphaShift, 1) + TEST_FIELD_OFFSET(LAYERPLANEDESCRIPTOR, cAlphaShift, 17) + TEST_FIELD_SIZE (LAYERPLANEDESCRIPTOR, cAccumBits, 1) + TEST_FIELD_ALIGN (LAYERPLANEDESCRIPTOR, cAccumBits, 1) + TEST_FIELD_OFFSET(LAYERPLANEDESCRIPTOR, cAccumBits, 18) + TEST_FIELD_SIZE (LAYERPLANEDESCRIPTOR, cAccumRedBits, 1) + TEST_FIELD_ALIGN (LAYERPLANEDESCRIPTOR, cAccumRedBits, 1) + TEST_FIELD_OFFSET(LAYERPLANEDESCRIPTOR, cAccumRedBits, 19) + TEST_FIELD_SIZE (LAYERPLANEDESCRIPTOR, cAccumGreenBits, 1) + TEST_FIELD_ALIGN (LAYERPLANEDESCRIPTOR, cAccumGreenBits, 1) + TEST_FIELD_OFFSET(LAYERPLANEDESCRIPTOR, cAccumGreenBits, 20) + TEST_FIELD_SIZE (LAYERPLANEDESCRIPTOR, cAccumBlueBits, 1) + TEST_FIELD_ALIGN (LAYERPLANEDESCRIPTOR, cAccumBlueBits, 1) + TEST_FIELD_OFFSET(LAYERPLANEDESCRIPTOR, cAccumBlueBits, 21) + TEST_FIELD_SIZE (LAYERPLANEDESCRIPTOR, cAccumAlphaBits, 1) + TEST_FIELD_ALIGN (LAYERPLANEDESCRIPTOR, cAccumAlphaBits, 1) + TEST_FIELD_OFFSET(LAYERPLANEDESCRIPTOR, cAccumAlphaBits, 22) + TEST_FIELD_SIZE (LAYERPLANEDESCRIPTOR, cDepthBits, 1) + TEST_FIELD_ALIGN (LAYERPLANEDESCRIPTOR, cDepthBits, 1) + TEST_FIELD_OFFSET(LAYERPLANEDESCRIPTOR, cDepthBits, 23) + TEST_FIELD_SIZE (LAYERPLANEDESCRIPTOR, cStencilBits, 1) + TEST_FIELD_ALIGN (LAYERPLANEDESCRIPTOR, cStencilBits, 1) + TEST_FIELD_OFFSET(LAYERPLANEDESCRIPTOR, cStencilBits, 24) + TEST_FIELD_SIZE (LAYERPLANEDESCRIPTOR, cAuxBuffers, 1) + TEST_FIELD_ALIGN (LAYERPLANEDESCRIPTOR, cAuxBuffers, 1) + TEST_FIELD_OFFSET(LAYERPLANEDESCRIPTOR, cAuxBuffers, 25) + TEST_FIELD_SIZE (LAYERPLANEDESCRIPTOR, iLayerPlane, 1) + TEST_FIELD_ALIGN (LAYERPLANEDESCRIPTOR, iLayerPlane, 1) + TEST_FIELD_OFFSET(LAYERPLANEDESCRIPTOR, iLayerPlane, 26) + TEST_FIELD_SIZE (LAYERPLANEDESCRIPTOR, bReserved, 1) + TEST_FIELD_ALIGN (LAYERPLANEDESCRIPTOR, bReserved, 1) + TEST_FIELD_OFFSET(LAYERPLANEDESCRIPTOR, bReserved, 27) + TEST_FIELD_SIZE (LAYERPLANEDESCRIPTOR, crTransparent, 4) + TEST_FIELD_ALIGN (LAYERPLANEDESCRIPTOR, crTransparent, 4) + TEST_FIELD_OFFSET(LAYERPLANEDESCRIPTOR, crTransparent, 28) +} + +static void test_pack_LCSCSTYPE(void) +{ + /* LCSCSTYPE */ + TEST_TYPE_SIZE (LCSCSTYPE, 4) + TEST_TYPE_ALIGN (LCSCSTYPE, 4) +} + +static void test_pack_LCSGAMUTMATCH(void) +{ + /* LCSGAMUTMATCH */ + TEST_TYPE_SIZE (LCSGAMUTMATCH, 4) + TEST_TYPE_ALIGN (LCSGAMUTMATCH, 4) +} + +static void test_pack_LINEDDAPROC(void) +{ + /* LINEDDAPROC */ + TEST_TYPE_SIZE (LINEDDAPROC, 4) + TEST_TYPE_ALIGN (LINEDDAPROC, 4) +} + +static void test_pack_LOCALESIGNATURE(void) +{ + /* LOCALESIGNATURE (pack 4) */ + TEST_TYPE_SIZE (LOCALESIGNATURE, 32) + TEST_TYPE_ALIGN (LOCALESIGNATURE, 4) + TEST_FIELD_SIZE (LOCALESIGNATURE, lsUsb, 16) + TEST_FIELD_ALIGN (LOCALESIGNATURE, lsUsb, 4) + TEST_FIELD_OFFSET(LOCALESIGNATURE, lsUsb, 0) + TEST_FIELD_SIZE (LOCALESIGNATURE, lsCsbDefault, 8) + TEST_FIELD_ALIGN (LOCALESIGNATURE, lsCsbDefault, 4) + TEST_FIELD_OFFSET(LOCALESIGNATURE, lsCsbDefault, 16) + TEST_FIELD_SIZE (LOCALESIGNATURE, lsCsbSupported, 8) + TEST_FIELD_ALIGN (LOCALESIGNATURE, lsCsbSupported, 4) + TEST_FIELD_OFFSET(LOCALESIGNATURE, lsCsbSupported, 24) +} + +static void test_pack_LOGBRUSH(void) +{ + /* LOGBRUSH (pack 4) */ + TEST_TYPE_SIZE (LOGBRUSH, 12) + TEST_TYPE_ALIGN (LOGBRUSH, 4) + TEST_FIELD_SIZE (LOGBRUSH, lbStyle, 4) + TEST_FIELD_ALIGN (LOGBRUSH, lbStyle, 4) + TEST_FIELD_OFFSET(LOGBRUSH, lbStyle, 0) + TEST_FIELD_SIZE (LOGBRUSH, lbColor, 4) + TEST_FIELD_ALIGN (LOGBRUSH, lbColor, 4) + TEST_FIELD_OFFSET(LOGBRUSH, lbColor, 4) + TEST_FIELD_SIZE (LOGBRUSH, lbHatch, 4) + TEST_FIELD_ALIGN (LOGBRUSH, lbHatch, 4) + TEST_FIELD_OFFSET(LOGBRUSH, lbHatch, 8) +} + +static void test_pack_LOGCOLORSPACEA(void) +{ + /* LOGCOLORSPACEA (pack 4) */ + TEST_TYPE_SIZE (LOGCOLORSPACEA, 328) + TEST_TYPE_ALIGN (LOGCOLORSPACEA, 4) + TEST_FIELD_SIZE (LOGCOLORSPACEA, lcsSignature, 4) + TEST_FIELD_ALIGN (LOGCOLORSPACEA, lcsSignature, 4) + TEST_FIELD_OFFSET(LOGCOLORSPACEA, lcsSignature, 0) + TEST_FIELD_SIZE (LOGCOLORSPACEA, lcsVersion, 4) + TEST_FIELD_ALIGN (LOGCOLORSPACEA, lcsVersion, 4) + TEST_FIELD_OFFSET(LOGCOLORSPACEA, lcsVersion, 4) + TEST_FIELD_SIZE (LOGCOLORSPACEA, lcsSize, 4) + TEST_FIELD_ALIGN (LOGCOLORSPACEA, lcsSize, 4) + TEST_FIELD_OFFSET(LOGCOLORSPACEA, lcsSize, 8) + TEST_FIELD_SIZE (LOGCOLORSPACEA, lcsCSType, 4) + TEST_FIELD_ALIGN (LOGCOLORSPACEA, lcsCSType, 4) + TEST_FIELD_OFFSET(LOGCOLORSPACEA, lcsCSType, 12) + TEST_FIELD_SIZE (LOGCOLORSPACEA, lcsIntent, 4) + TEST_FIELD_ALIGN (LOGCOLORSPACEA, lcsIntent, 4) + TEST_FIELD_OFFSET(LOGCOLORSPACEA, lcsIntent, 16) + TEST_FIELD_SIZE (LOGCOLORSPACEA, lcsEndpoints, 36) + TEST_FIELD_ALIGN (LOGCOLORSPACEA, lcsEndpoints, 4) + TEST_FIELD_OFFSET(LOGCOLORSPACEA, lcsEndpoints, 20) + TEST_FIELD_SIZE (LOGCOLORSPACEA, lcsGammaRed, 4) + TEST_FIELD_ALIGN (LOGCOLORSPACEA, lcsGammaRed, 4) + TEST_FIELD_OFFSET(LOGCOLORSPACEA, lcsGammaRed, 56) + TEST_FIELD_SIZE (LOGCOLORSPACEA, lcsGammaGreen, 4) + TEST_FIELD_ALIGN (LOGCOLORSPACEA, lcsGammaGreen, 4) + TEST_FIELD_OFFSET(LOGCOLORSPACEA, lcsGammaGreen, 60) + TEST_FIELD_SIZE (LOGCOLORSPACEA, lcsGammaBlue, 4) + TEST_FIELD_ALIGN (LOGCOLORSPACEA, lcsGammaBlue, 4) + TEST_FIELD_OFFSET(LOGCOLORSPACEA, lcsGammaBlue, 64) + TEST_FIELD_SIZE (LOGCOLORSPACEA, lcsFilename, 260) + TEST_FIELD_ALIGN (LOGCOLORSPACEA, lcsFilename, 1) + TEST_FIELD_OFFSET(LOGCOLORSPACEA, lcsFilename, 68) +} + +static void test_pack_LOGCOLORSPACEW(void) +{ + /* LOGCOLORSPACEW (pack 4) */ + TEST_TYPE_SIZE (LOGCOLORSPACEW, 588) + TEST_TYPE_ALIGN (LOGCOLORSPACEW, 4) + TEST_FIELD_SIZE (LOGCOLORSPACEW, lcsSignature, 4) + TEST_FIELD_ALIGN (LOGCOLORSPACEW, lcsSignature, 4) + TEST_FIELD_OFFSET(LOGCOLORSPACEW, lcsSignature, 0) + TEST_FIELD_SIZE (LOGCOLORSPACEW, lcsVersion, 4) + TEST_FIELD_ALIGN (LOGCOLORSPACEW, lcsVersion, 4) + TEST_FIELD_OFFSET(LOGCOLORSPACEW, lcsVersion, 4) + TEST_FIELD_SIZE (LOGCOLORSPACEW, lcsSize, 4) + TEST_FIELD_ALIGN (LOGCOLORSPACEW, lcsSize, 4) + TEST_FIELD_OFFSET(LOGCOLORSPACEW, lcsSize, 8) + TEST_FIELD_SIZE (LOGCOLORSPACEW, lcsCSType, 4) + TEST_FIELD_ALIGN (LOGCOLORSPACEW, lcsCSType, 4) + TEST_FIELD_OFFSET(LOGCOLORSPACEW, lcsCSType, 12) + TEST_FIELD_SIZE (LOGCOLORSPACEW, lcsIntent, 4) + TEST_FIELD_ALIGN (LOGCOLORSPACEW, lcsIntent, 4) + TEST_FIELD_OFFSET(LOGCOLORSPACEW, lcsIntent, 16) + TEST_FIELD_SIZE (LOGCOLORSPACEW, lcsEndpoints, 36) + TEST_FIELD_ALIGN (LOGCOLORSPACEW, lcsEndpoints, 4) + TEST_FIELD_OFFSET(LOGCOLORSPACEW, lcsEndpoints, 20) + TEST_FIELD_SIZE (LOGCOLORSPACEW, lcsGammaRed, 4) + TEST_FIELD_ALIGN (LOGCOLORSPACEW, lcsGammaRed, 4) + TEST_FIELD_OFFSET(LOGCOLORSPACEW, lcsGammaRed, 56) + TEST_FIELD_SIZE (LOGCOLORSPACEW, lcsGammaGreen, 4) + TEST_FIELD_ALIGN (LOGCOLORSPACEW, lcsGammaGreen, 4) + TEST_FIELD_OFFSET(LOGCOLORSPACEW, lcsGammaGreen, 60) + TEST_FIELD_SIZE (LOGCOLORSPACEW, lcsGammaBlue, 4) + TEST_FIELD_ALIGN (LOGCOLORSPACEW, lcsGammaBlue, 4) + TEST_FIELD_OFFSET(LOGCOLORSPACEW, lcsGammaBlue, 64) + TEST_FIELD_SIZE (LOGCOLORSPACEW, lcsFilename, 520) + TEST_FIELD_ALIGN (LOGCOLORSPACEW, lcsFilename, 2) + TEST_FIELD_OFFSET(LOGCOLORSPACEW, lcsFilename, 68) +} + +static void test_pack_LOGFONTA(void) +{ + /* LOGFONTA (pack 4) */ + TEST_TYPE_SIZE (LOGFONTA, 60) + TEST_TYPE_ALIGN (LOGFONTA, 4) + TEST_FIELD_SIZE (LOGFONTA, lfHeight, 4) + TEST_FIELD_ALIGN (LOGFONTA, lfHeight, 4) + TEST_FIELD_OFFSET(LOGFONTA, lfHeight, 0) + TEST_FIELD_SIZE (LOGFONTA, lfWidth, 4) + TEST_FIELD_ALIGN (LOGFONTA, lfWidth, 4) + TEST_FIELD_OFFSET(LOGFONTA, lfWidth, 4) + TEST_FIELD_SIZE (LOGFONTA, lfEscapement, 4) + TEST_FIELD_ALIGN (LOGFONTA, lfEscapement, 4) + TEST_FIELD_OFFSET(LOGFONTA, lfEscapement, 8) + TEST_FIELD_SIZE (LOGFONTA, lfOrientation, 4) + TEST_FIELD_ALIGN (LOGFONTA, lfOrientation, 4) + TEST_FIELD_OFFSET(LOGFONTA, lfOrientation, 12) + TEST_FIELD_SIZE (LOGFONTA, lfWeight, 4) + TEST_FIELD_ALIGN (LOGFONTA, lfWeight, 4) + TEST_FIELD_OFFSET(LOGFONTA, lfWeight, 16) + TEST_FIELD_SIZE (LOGFONTA, lfItalic, 1) + TEST_FIELD_ALIGN (LOGFONTA, lfItalic, 1) + TEST_FIELD_OFFSET(LOGFONTA, lfItalic, 20) + TEST_FIELD_SIZE (LOGFONTA, lfUnderline, 1) + TEST_FIELD_ALIGN (LOGFONTA, lfUnderline, 1) + TEST_FIELD_OFFSET(LOGFONTA, lfUnderline, 21) + TEST_FIELD_SIZE (LOGFONTA, lfStrikeOut, 1) + TEST_FIELD_ALIGN (LOGFONTA, lfStrikeOut, 1) + TEST_FIELD_OFFSET(LOGFONTA, lfStrikeOut, 22) + TEST_FIELD_SIZE (LOGFONTA, lfCharSet, 1) + TEST_FIELD_ALIGN (LOGFONTA, lfCharSet, 1) + TEST_FIELD_OFFSET(LOGFONTA, lfCharSet, 23) + TEST_FIELD_SIZE (LOGFONTA, lfOutPrecision, 1) + TEST_FIELD_ALIGN (LOGFONTA, lfOutPrecision, 1) + TEST_FIELD_OFFSET(LOGFONTA, lfOutPrecision, 24) + TEST_FIELD_SIZE (LOGFONTA, lfClipPrecision, 1) + TEST_FIELD_ALIGN (LOGFONTA, lfClipPrecision, 1) + TEST_FIELD_OFFSET(LOGFONTA, lfClipPrecision, 25) + TEST_FIELD_SIZE (LOGFONTA, lfQuality, 1) + TEST_FIELD_ALIGN (LOGFONTA, lfQuality, 1) + TEST_FIELD_OFFSET(LOGFONTA, lfQuality, 26) + TEST_FIELD_SIZE (LOGFONTA, lfPitchAndFamily, 1) + TEST_FIELD_ALIGN (LOGFONTA, lfPitchAndFamily, 1) + TEST_FIELD_OFFSET(LOGFONTA, lfPitchAndFamily, 27) + TEST_FIELD_SIZE (LOGFONTA, lfFaceName, 32) + TEST_FIELD_ALIGN (LOGFONTA, lfFaceName, 1) + TEST_FIELD_OFFSET(LOGFONTA, lfFaceName, 28) +} + +static void test_pack_LOGFONTW(void) +{ + /* LOGFONTW (pack 4) */ + TEST_TYPE_SIZE (LOGFONTW, 92) + TEST_TYPE_ALIGN (LOGFONTW, 4) + TEST_FIELD_SIZE (LOGFONTW, lfHeight, 4) + TEST_FIELD_ALIGN (LOGFONTW, lfHeight, 4) + TEST_FIELD_OFFSET(LOGFONTW, lfHeight, 0) + TEST_FIELD_SIZE (LOGFONTW, lfWidth, 4) + TEST_FIELD_ALIGN (LOGFONTW, lfWidth, 4) + TEST_FIELD_OFFSET(LOGFONTW, lfWidth, 4) + TEST_FIELD_SIZE (LOGFONTW, lfEscapement, 4) + TEST_FIELD_ALIGN (LOGFONTW, lfEscapement, 4) + TEST_FIELD_OFFSET(LOGFONTW, lfEscapement, 8) + TEST_FIELD_SIZE (LOGFONTW, lfOrientation, 4) + TEST_FIELD_ALIGN (LOGFONTW, lfOrientation, 4) + TEST_FIELD_OFFSET(LOGFONTW, lfOrientation, 12) + TEST_FIELD_SIZE (LOGFONTW, lfWeight, 4) + TEST_FIELD_ALIGN (LOGFONTW, lfWeight, 4) + TEST_FIELD_OFFSET(LOGFONTW, lfWeight, 16) + TEST_FIELD_SIZE (LOGFONTW, lfItalic, 1) + TEST_FIELD_ALIGN (LOGFONTW, lfItalic, 1) + TEST_FIELD_OFFSET(LOGFONTW, lfItalic, 20) + TEST_FIELD_SIZE (LOGFONTW, lfUnderline, 1) + TEST_FIELD_ALIGN (LOGFONTW, lfUnderline, 1) + TEST_FIELD_OFFSET(LOGFONTW, lfUnderline, 21) + TEST_FIELD_SIZE (LOGFONTW, lfStrikeOut, 1) + TEST_FIELD_ALIGN (LOGFONTW, lfStrikeOut, 1) + TEST_FIELD_OFFSET(LOGFONTW, lfStrikeOut, 22) + TEST_FIELD_SIZE (LOGFONTW, lfCharSet, 1) + TEST_FIELD_ALIGN (LOGFONTW, lfCharSet, 1) + TEST_FIELD_OFFSET(LOGFONTW, lfCharSet, 23) + TEST_FIELD_SIZE (LOGFONTW, lfOutPrecision, 1) + TEST_FIELD_ALIGN (LOGFONTW, lfOutPrecision, 1) + TEST_FIELD_OFFSET(LOGFONTW, lfOutPrecision, 24) + TEST_FIELD_SIZE (LOGFONTW, lfClipPrecision, 1) + TEST_FIELD_ALIGN (LOGFONTW, lfClipPrecision, 1) + TEST_FIELD_OFFSET(LOGFONTW, lfClipPrecision, 25) + TEST_FIELD_SIZE (LOGFONTW, lfQuality, 1) + TEST_FIELD_ALIGN (LOGFONTW, lfQuality, 1) + TEST_FIELD_OFFSET(LOGFONTW, lfQuality, 26) + TEST_FIELD_SIZE (LOGFONTW, lfPitchAndFamily, 1) + TEST_FIELD_ALIGN (LOGFONTW, lfPitchAndFamily, 1) + TEST_FIELD_OFFSET(LOGFONTW, lfPitchAndFamily, 27) + TEST_FIELD_SIZE (LOGFONTW, lfFaceName, 64) + TEST_FIELD_ALIGN (LOGFONTW, lfFaceName, 2) + TEST_FIELD_OFFSET(LOGFONTW, lfFaceName, 28) +} + +static void test_pack_LOGPEN(void) +{ + /* LOGPEN (pack 4) */ + TEST_TYPE_SIZE (LOGPEN, 16) + TEST_TYPE_ALIGN (LOGPEN, 4) + TEST_FIELD_SIZE (LOGPEN, lopnStyle, 4) + TEST_FIELD_ALIGN (LOGPEN, lopnStyle, 4) + TEST_FIELD_OFFSET(LOGPEN, lopnStyle, 0) + TEST_FIELD_SIZE (LOGPEN, lopnWidth, 8) + TEST_FIELD_ALIGN (LOGPEN, lopnWidth, 4) + TEST_FIELD_OFFSET(LOGPEN, lopnWidth, 4) + TEST_FIELD_SIZE (LOGPEN, lopnColor, 4) + TEST_FIELD_ALIGN (LOGPEN, lopnColor, 4) + TEST_FIELD_OFFSET(LOGPEN, lopnColor, 12) +} + +static void test_pack_LPABC(void) +{ + /* LPABC */ + TEST_TYPE_SIZE (LPABC, 4) + TEST_TYPE_ALIGN (LPABC, 4) + TEST_TARGET_SIZE (LPABC, 12) + TEST_TARGET_ALIGN(LPABC, 4) +} + +static void test_pack_LPABCFLOAT(void) +{ + /* LPABCFLOAT */ + TEST_TYPE_SIZE (LPABCFLOAT, 4) + TEST_TYPE_ALIGN (LPABCFLOAT, 4) + TEST_TARGET_SIZE (LPABCFLOAT, 12) + TEST_TARGET_ALIGN(LPABCFLOAT, 4) +} + +static void test_pack_LPBITMAP(void) +{ + /* LPBITMAP */ + TEST_TYPE_SIZE (LPBITMAP, 4) + TEST_TYPE_ALIGN (LPBITMAP, 4) + TEST_TARGET_SIZE (LPBITMAP, 24) + TEST_TARGET_ALIGN(LPBITMAP, 4) +} + +static void test_pack_LPBITMAPCOREHEADER(void) +{ + /* LPBITMAPCOREHEADER */ + TEST_TYPE_SIZE (LPBITMAPCOREHEADER, 4) + TEST_TYPE_ALIGN (LPBITMAPCOREHEADER, 4) + TEST_TARGET_SIZE (LPBITMAPCOREHEADER, 12) + TEST_TARGET_ALIGN(LPBITMAPCOREHEADER, 4) +} + +static void test_pack_LPBITMAPCOREINFO(void) +{ + /* LPBITMAPCOREINFO */ + TEST_TYPE_SIZE (LPBITMAPCOREINFO, 4) + TEST_TYPE_ALIGN (LPBITMAPCOREINFO, 4) + TEST_TARGET_SIZE (LPBITMAPCOREINFO, 16) + TEST_TARGET_ALIGN(LPBITMAPCOREINFO, 4) +} + +static void test_pack_LPBITMAPFILEHEADER(void) +{ + /* LPBITMAPFILEHEADER */ + TEST_TYPE_SIZE (LPBITMAPFILEHEADER, 4) + TEST_TYPE_ALIGN (LPBITMAPFILEHEADER, 4) + TEST_TARGET_SIZE (LPBITMAPFILEHEADER, 14) + TEST_TARGET_ALIGN(LPBITMAPFILEHEADER, 2) +} + +static void test_pack_LPBITMAPINFO(void) +{ + /* LPBITMAPINFO */ + TEST_TYPE_SIZE (LPBITMAPINFO, 4) + TEST_TYPE_ALIGN (LPBITMAPINFO, 4) + TEST_TARGET_SIZE (LPBITMAPINFO, 44) + TEST_TARGET_ALIGN(LPBITMAPINFO, 4) +} + +static void test_pack_LPBITMAPINFOHEADER(void) +{ + /* LPBITMAPINFOHEADER */ + TEST_TYPE_SIZE (LPBITMAPINFOHEADER, 4) + TEST_TYPE_ALIGN (LPBITMAPINFOHEADER, 4) + TEST_TARGET_SIZE (LPBITMAPINFOHEADER, 40) + TEST_TARGET_ALIGN(LPBITMAPINFOHEADER, 4) +} + +static void test_pack_LPBITMAPV5HEADER(void) +{ + /* LPBITMAPV5HEADER */ + TEST_TYPE_SIZE (LPBITMAPV5HEADER, 4) + TEST_TYPE_ALIGN (LPBITMAPV5HEADER, 4) + TEST_TARGET_SIZE (LPBITMAPV5HEADER, 124) + TEST_TARGET_ALIGN(LPBITMAPV5HEADER, 4) +} + +static void test_pack_LPCHARSETINFO(void) +{ + /* LPCHARSETINFO */ + TEST_TYPE_SIZE (LPCHARSETINFO, 4) + TEST_TYPE_ALIGN (LPCHARSETINFO, 4) + TEST_TARGET_SIZE (LPCHARSETINFO, 32) + TEST_TARGET_ALIGN(LPCHARSETINFO, 4) +} + +static void test_pack_LPCIEXYZ(void) +{ + /* LPCIEXYZ */ + TEST_TYPE_SIZE (LPCIEXYZ, 4) + TEST_TYPE_ALIGN (LPCIEXYZ, 4) + TEST_TARGET_SIZE (LPCIEXYZ, 12) + TEST_TARGET_ALIGN(LPCIEXYZ, 4) +} + +static void test_pack_LPCIEXYZTRIPLE(void) +{ + /* LPCIEXYZTRIPLE */ + TEST_TYPE_SIZE (LPCIEXYZTRIPLE, 4) + TEST_TYPE_ALIGN (LPCIEXYZTRIPLE, 4) + TEST_TARGET_SIZE (LPCIEXYZTRIPLE, 36) + TEST_TARGET_ALIGN(LPCIEXYZTRIPLE, 4) +} + +static void test_pack_LPCOLORADJUSTMENT(void) +{ + /* LPCOLORADJUSTMENT */ + TEST_TYPE_SIZE (LPCOLORADJUSTMENT, 4) + TEST_TYPE_ALIGN (LPCOLORADJUSTMENT, 4) + TEST_TARGET_SIZE (LPCOLORADJUSTMENT, 24) + TEST_TARGET_ALIGN(LPCOLORADJUSTMENT, 2) +} + +static void test_pack_LPDEVMODEA(void) +{ + /* LPDEVMODEA */ + TEST_TYPE_SIZE (LPDEVMODEA, 4) + TEST_TYPE_ALIGN (LPDEVMODEA, 4) +} + +static void test_pack_LPDEVMODEW(void) +{ + /* LPDEVMODEW */ + TEST_TYPE_SIZE (LPDEVMODEW, 4) + TEST_TYPE_ALIGN (LPDEVMODEW, 4) +} + +static void test_pack_LPDIBSECTION(void) +{ + /* LPDIBSECTION */ + TEST_TYPE_SIZE (LPDIBSECTION, 4) + TEST_TYPE_ALIGN (LPDIBSECTION, 4) + TEST_TARGET_SIZE (LPDIBSECTION, 84) + TEST_TARGET_ALIGN(LPDIBSECTION, 4) +} + +static void test_pack_LPDISPLAY_DEVICEA(void) +{ + /* LPDISPLAY_DEVICEA */ + TEST_TYPE_SIZE (LPDISPLAY_DEVICEA, 4) + TEST_TYPE_ALIGN (LPDISPLAY_DEVICEA, 4) + TEST_TARGET_SIZE (LPDISPLAY_DEVICEA, 424) + TEST_TARGET_ALIGN(LPDISPLAY_DEVICEA, 4) +} + +static void test_pack_LPDISPLAY_DEVICEW(void) +{ + /* LPDISPLAY_DEVICEW */ + TEST_TYPE_SIZE (LPDISPLAY_DEVICEW, 4) + TEST_TYPE_ALIGN (LPDISPLAY_DEVICEW, 4) + TEST_TARGET_SIZE (LPDISPLAY_DEVICEW, 840) + TEST_TARGET_ALIGN(LPDISPLAY_DEVICEW, 4) +} + +static void test_pack_LPDOCINFOA(void) +{ + /* LPDOCINFOA */ + TEST_TYPE_SIZE (LPDOCINFOA, 4) + TEST_TYPE_ALIGN (LPDOCINFOA, 4) + TEST_TARGET_SIZE (LPDOCINFOA, 20) + TEST_TARGET_ALIGN(LPDOCINFOA, 4) +} + +static void test_pack_LPDOCINFOW(void) +{ + /* LPDOCINFOW */ + TEST_TYPE_SIZE (LPDOCINFOW, 4) + TEST_TYPE_ALIGN (LPDOCINFOW, 4) + TEST_TARGET_SIZE (LPDOCINFOW, 20) + TEST_TARGET_ALIGN(LPDOCINFOW, 4) +} + +static void test_pack_LPENHMETAHEADER(void) +{ + /* LPENHMETAHEADER */ + TEST_TYPE_SIZE (LPENHMETAHEADER, 4) + TEST_TYPE_ALIGN (LPENHMETAHEADER, 4) + TEST_TARGET_SIZE (LPENHMETAHEADER, 108) + TEST_TARGET_ALIGN(LPENHMETAHEADER, 4) +} + +static void test_pack_LPENHMETARECORD(void) +{ + /* LPENHMETARECORD */ + TEST_TYPE_SIZE (LPENHMETARECORD, 4) + TEST_TYPE_ALIGN (LPENHMETARECORD, 4) + TEST_TARGET_SIZE (LPENHMETARECORD, 12) + TEST_TARGET_ALIGN(LPENHMETARECORD, 4) +} + +static void test_pack_LPENUMLOGFONTA(void) +{ + /* LPENUMLOGFONTA */ + TEST_TYPE_SIZE (LPENUMLOGFONTA, 4) + TEST_TYPE_ALIGN (LPENUMLOGFONTA, 4) + TEST_TARGET_SIZE (LPENUMLOGFONTA, 156) + TEST_TARGET_ALIGN(LPENUMLOGFONTA, 4) +} + +static void test_pack_LPENUMLOGFONTEXA(void) +{ + /* LPENUMLOGFONTEXA */ + TEST_TYPE_SIZE (LPENUMLOGFONTEXA, 4) + TEST_TYPE_ALIGN (LPENUMLOGFONTEXA, 4) + TEST_TARGET_SIZE (LPENUMLOGFONTEXA, 188) + TEST_TARGET_ALIGN(LPENUMLOGFONTEXA, 4) +} + +static void test_pack_LPENUMLOGFONTEXW(void) +{ + /* LPENUMLOGFONTEXW */ + TEST_TYPE_SIZE (LPENUMLOGFONTEXW, 4) + TEST_TYPE_ALIGN (LPENUMLOGFONTEXW, 4) + TEST_TARGET_SIZE (LPENUMLOGFONTEXW, 348) + TEST_TARGET_ALIGN(LPENUMLOGFONTEXW, 4) +} + +static void test_pack_LPENUMLOGFONTW(void) +{ + /* LPENUMLOGFONTW */ + TEST_TYPE_SIZE (LPENUMLOGFONTW, 4) + TEST_TYPE_ALIGN (LPENUMLOGFONTW, 4) + TEST_TARGET_SIZE (LPENUMLOGFONTW, 284) + TEST_TARGET_ALIGN(LPENUMLOGFONTW, 4) +} + +static void test_pack_LPEXTLOGFONTA(void) +{ + /* LPEXTLOGFONTA */ + TEST_TYPE_SIZE (LPEXTLOGFONTA, 4) + TEST_TYPE_ALIGN (LPEXTLOGFONTA, 4) + TEST_TARGET_SIZE (LPEXTLOGFONTA, 192) + TEST_TARGET_ALIGN(LPEXTLOGFONTA, 4) +} + +static void test_pack_LPEXTLOGFONTW(void) +{ + /* LPEXTLOGFONTW */ + TEST_TYPE_SIZE (LPEXTLOGFONTW, 4) + TEST_TYPE_ALIGN (LPEXTLOGFONTW, 4) + TEST_TARGET_SIZE (LPEXTLOGFONTW, 320) + TEST_TARGET_ALIGN(LPEXTLOGFONTW, 4) +} + +static void test_pack_LPEXTLOGPEN(void) +{ + /* LPEXTLOGPEN */ + TEST_TYPE_SIZE (LPEXTLOGPEN, 4) + TEST_TYPE_ALIGN (LPEXTLOGPEN, 4) + TEST_TARGET_SIZE (LPEXTLOGPEN, 28) + TEST_TARGET_ALIGN(LPEXTLOGPEN, 4) +} + +static void test_pack_LPFONTSIGNATURE(void) +{ + /* LPFONTSIGNATURE */ + TEST_TYPE_SIZE (LPFONTSIGNATURE, 4) + TEST_TYPE_ALIGN (LPFONTSIGNATURE, 4) + TEST_TARGET_SIZE (LPFONTSIGNATURE, 24) + TEST_TARGET_ALIGN(LPFONTSIGNATURE, 4) +} + +static void test_pack_LPGCP_RESULTSA(void) +{ + /* LPGCP_RESULTSA */ + TEST_TYPE_SIZE (LPGCP_RESULTSA, 4) + TEST_TYPE_ALIGN (LPGCP_RESULTSA, 4) + TEST_TARGET_SIZE (LPGCP_RESULTSA, 36) + TEST_TARGET_ALIGN(LPGCP_RESULTSA, 4) +} + +static void test_pack_LPGCP_RESULTSW(void) +{ + /* LPGCP_RESULTSW */ + TEST_TYPE_SIZE (LPGCP_RESULTSW, 4) + TEST_TYPE_ALIGN (LPGCP_RESULTSW, 4) + TEST_TARGET_SIZE (LPGCP_RESULTSW, 36) + TEST_TARGET_ALIGN(LPGCP_RESULTSW, 4) +} + +static void test_pack_LPGLYPHMETRICS(void) +{ + /* LPGLYPHMETRICS */ + TEST_TYPE_SIZE (LPGLYPHMETRICS, 4) + TEST_TYPE_ALIGN (LPGLYPHMETRICS, 4) + TEST_TARGET_SIZE (LPGLYPHMETRICS, 20) + TEST_TARGET_ALIGN(LPGLYPHMETRICS, 4) +} + +static void test_pack_LPGLYPHMETRICSFLOAT(void) +{ + /* LPGLYPHMETRICSFLOAT */ + TEST_TYPE_SIZE (LPGLYPHMETRICSFLOAT, 4) + TEST_TYPE_ALIGN (LPGLYPHMETRICSFLOAT, 4) + TEST_TARGET_SIZE (LPGLYPHMETRICSFLOAT, 24) + TEST_TARGET_ALIGN(LPGLYPHMETRICSFLOAT, 4) +} + +static void test_pack_LPGRADIENT_RECT(void) +{ + /* LPGRADIENT_RECT */ + TEST_TYPE_SIZE (LPGRADIENT_RECT, 4) + TEST_TYPE_ALIGN (LPGRADIENT_RECT, 4) + TEST_TARGET_SIZE (LPGRADIENT_RECT, 8) + TEST_TARGET_ALIGN(LPGRADIENT_RECT, 4) +} + +static void test_pack_LPGRADIENT_TRIANGLE(void) +{ + /* LPGRADIENT_TRIANGLE */ + TEST_TYPE_SIZE (LPGRADIENT_TRIANGLE, 4) + TEST_TYPE_ALIGN (LPGRADIENT_TRIANGLE, 4) + TEST_TARGET_SIZE (LPGRADIENT_TRIANGLE, 12) + TEST_TARGET_ALIGN(LPGRADIENT_TRIANGLE, 4) +} + +static void test_pack_LPHANDLETABLE(void) +{ + /* LPHANDLETABLE */ + TEST_TYPE_SIZE (LPHANDLETABLE, 4) + TEST_TYPE_ALIGN (LPHANDLETABLE, 4) + TEST_TARGET_SIZE (LPHANDLETABLE, 4) + TEST_TARGET_ALIGN(LPHANDLETABLE, 4) +} + +static void test_pack_LPKERNINGPAIR(void) +{ + /* LPKERNINGPAIR */ + TEST_TYPE_SIZE (LPKERNINGPAIR, 4) + TEST_TYPE_ALIGN (LPKERNINGPAIR, 4) + TEST_TARGET_SIZE (LPKERNINGPAIR, 8) + TEST_TARGET_ALIGN(LPKERNINGPAIR, 4) +} + +static void test_pack_LPLAYERPLANEDESCRIPTOR(void) +{ + /* LPLAYERPLANEDESCRIPTOR */ + TEST_TYPE_SIZE (LPLAYERPLANEDESCRIPTOR, 4) + TEST_TYPE_ALIGN (LPLAYERPLANEDESCRIPTOR, 4) + TEST_TARGET_SIZE (LPLAYERPLANEDESCRIPTOR, 32) + TEST_TARGET_ALIGN(LPLAYERPLANEDESCRIPTOR, 4) +} + +static void test_pack_LPLOCALESIGNATURE(void) +{ + /* LPLOCALESIGNATURE */ + TEST_TYPE_SIZE (LPLOCALESIGNATURE, 4) + TEST_TYPE_ALIGN (LPLOCALESIGNATURE, 4) + TEST_TARGET_SIZE (LPLOCALESIGNATURE, 32) + TEST_TARGET_ALIGN(LPLOCALESIGNATURE, 4) +} + +static void test_pack_LPLOGBRUSH(void) +{ + /* LPLOGBRUSH */ + TEST_TYPE_SIZE (LPLOGBRUSH, 4) + TEST_TYPE_ALIGN (LPLOGBRUSH, 4) + TEST_TARGET_SIZE (LPLOGBRUSH, 12) + TEST_TARGET_ALIGN(LPLOGBRUSH, 4) +} + +static void test_pack_LPLOGCOLORSPACEA(void) +{ + /* LPLOGCOLORSPACEA */ + TEST_TYPE_SIZE (LPLOGCOLORSPACEA, 4) + TEST_TYPE_ALIGN (LPLOGCOLORSPACEA, 4) + TEST_TARGET_SIZE (LPLOGCOLORSPACEA, 328) + TEST_TARGET_ALIGN(LPLOGCOLORSPACEA, 4) +} + +static void test_pack_LPLOGCOLORSPACEW(void) +{ + /* LPLOGCOLORSPACEW */ + TEST_TYPE_SIZE (LPLOGCOLORSPACEW, 4) + TEST_TYPE_ALIGN (LPLOGCOLORSPACEW, 4) + TEST_TARGET_SIZE (LPLOGCOLORSPACEW, 588) + TEST_TARGET_ALIGN(LPLOGCOLORSPACEW, 4) +} + +static void test_pack_LPLOGFONTA(void) +{ + /* LPLOGFONTA */ + TEST_TYPE_SIZE (LPLOGFONTA, 4) + TEST_TYPE_ALIGN (LPLOGFONTA, 4) + TEST_TARGET_SIZE (LPLOGFONTA, 60) + TEST_TARGET_ALIGN(LPLOGFONTA, 4) +} + +static void test_pack_LPLOGFONTW(void) +{ + /* LPLOGFONTW */ + TEST_TYPE_SIZE (LPLOGFONTW, 4) + TEST_TYPE_ALIGN (LPLOGFONTW, 4) + TEST_TARGET_SIZE (LPLOGFONTW, 92) + TEST_TARGET_ALIGN(LPLOGFONTW, 4) +} + +static void test_pack_LPLOGPEN(void) +{ + /* LPLOGPEN */ + TEST_TYPE_SIZE (LPLOGPEN, 4) + TEST_TYPE_ALIGN (LPLOGPEN, 4) + TEST_TARGET_SIZE (LPLOGPEN, 16) + TEST_TARGET_ALIGN(LPLOGPEN, 4) +} + +static void test_pack_LPMAT2(void) +{ + /* LPMAT2 */ + TEST_TYPE_SIZE (LPMAT2, 4) + TEST_TYPE_ALIGN (LPMAT2, 4) + TEST_TARGET_SIZE (LPMAT2, 16) + TEST_TARGET_ALIGN(LPMAT2, 2) +} + +static void test_pack_LPMETAFILEPICT(void) +{ + /* LPMETAFILEPICT */ + TEST_TYPE_SIZE (LPMETAFILEPICT, 4) + TEST_TYPE_ALIGN (LPMETAFILEPICT, 4) + TEST_TARGET_SIZE (LPMETAFILEPICT, 16) + TEST_TARGET_ALIGN(LPMETAFILEPICT, 4) +} + +static void test_pack_LPMETAHEADER(void) +{ + /* LPMETAHEADER */ + TEST_TYPE_SIZE (LPMETAHEADER, 4) + TEST_TYPE_ALIGN (LPMETAHEADER, 4) + TEST_TARGET_SIZE (LPMETAHEADER, 18) + TEST_TARGET_ALIGN(LPMETAHEADER, 2) +} + +static void test_pack_LPMETARECORD(void) +{ + /* LPMETARECORD */ + TEST_TYPE_SIZE (LPMETARECORD, 4) + TEST_TYPE_ALIGN (LPMETARECORD, 4) + TEST_TARGET_SIZE (LPMETARECORD, 8) + TEST_TARGET_ALIGN(LPMETARECORD, 4) +} + +static void test_pack_LPNEWTEXTMETRICA(void) +{ + /* LPNEWTEXTMETRICA */ + TEST_TYPE_SIZE (LPNEWTEXTMETRICA, 4) + TEST_TYPE_ALIGN (LPNEWTEXTMETRICA, 4) + TEST_TARGET_SIZE (LPNEWTEXTMETRICA, 72) + TEST_TARGET_ALIGN(LPNEWTEXTMETRICA, 4) +} + +static void test_pack_LPNEWTEXTMETRICW(void) +{ + /* LPNEWTEXTMETRICW */ + TEST_TYPE_SIZE (LPNEWTEXTMETRICW, 4) + TEST_TYPE_ALIGN (LPNEWTEXTMETRICW, 4) + TEST_TARGET_SIZE (LPNEWTEXTMETRICW, 76) + TEST_TARGET_ALIGN(LPNEWTEXTMETRICW, 4) +} + +static void test_pack_LPOUTLINETEXTMETRICA(void) +{ + /* LPOUTLINETEXTMETRICA */ + TEST_TYPE_SIZE (LPOUTLINETEXTMETRICA, 4) + TEST_TYPE_ALIGN (LPOUTLINETEXTMETRICA, 4) + TEST_TARGET_SIZE (LPOUTLINETEXTMETRICA, 212) + TEST_TARGET_ALIGN(LPOUTLINETEXTMETRICA, 4) +} + +static void test_pack_LPOUTLINETEXTMETRICW(void) +{ + /* LPOUTLINETEXTMETRICW */ + TEST_TYPE_SIZE (LPOUTLINETEXTMETRICW, 4) + TEST_TYPE_ALIGN (LPOUTLINETEXTMETRICW, 4) + TEST_TARGET_SIZE (LPOUTLINETEXTMETRICW, 216) + TEST_TARGET_ALIGN(LPOUTLINETEXTMETRICW, 4) +} + +static void test_pack_LPPANOSE(void) +{ + /* LPPANOSE */ + TEST_TYPE_SIZE (LPPANOSE, 4) + TEST_TYPE_ALIGN (LPPANOSE, 4) + TEST_TARGET_SIZE (LPPANOSE, 10) + TEST_TARGET_ALIGN(LPPANOSE, 1) +} + +static void test_pack_LPPELARRAY(void) +{ + /* LPPELARRAY */ + TEST_TYPE_SIZE (LPPELARRAY, 4) + TEST_TYPE_ALIGN (LPPELARRAY, 4) + TEST_TARGET_SIZE (LPPELARRAY, 20) + TEST_TARGET_ALIGN(LPPELARRAY, 4) +} + +static void test_pack_LPPIXELFORMATDESCRIPTOR(void) +{ + /* LPPIXELFORMATDESCRIPTOR */ + TEST_TYPE_SIZE (LPPIXELFORMATDESCRIPTOR, 4) + TEST_TYPE_ALIGN (LPPIXELFORMATDESCRIPTOR, 4) + TEST_TARGET_SIZE (LPPIXELFORMATDESCRIPTOR, 40) + TEST_TARGET_ALIGN(LPPIXELFORMATDESCRIPTOR, 4) +} + +static void test_pack_LPPOINTFX(void) +{ + /* LPPOINTFX */ + TEST_TYPE_SIZE (LPPOINTFX, 4) + TEST_TYPE_ALIGN (LPPOINTFX, 4) + TEST_TARGET_SIZE (LPPOINTFX, 8) + TEST_TARGET_ALIGN(LPPOINTFX, 2) +} + +static void test_pack_LPPOLYTEXTA(void) +{ + /* LPPOLYTEXTA */ + TEST_TYPE_SIZE (LPPOLYTEXTA, 4) + TEST_TYPE_ALIGN (LPPOLYTEXTA, 4) + TEST_TARGET_SIZE (LPPOLYTEXTA, 40) + TEST_TARGET_ALIGN(LPPOLYTEXTA, 4) +} + +static void test_pack_LPPOLYTEXTW(void) +{ + /* LPPOLYTEXTW */ + TEST_TYPE_SIZE (LPPOLYTEXTW, 4) + TEST_TYPE_ALIGN (LPPOLYTEXTW, 4) + TEST_TARGET_SIZE (LPPOLYTEXTW, 40) + TEST_TARGET_ALIGN(LPPOLYTEXTW, 4) +} + +static void test_pack_LPRASTERIZER_STATUS(void) +{ + /* LPRASTERIZER_STATUS */ + TEST_TYPE_SIZE (LPRASTERIZER_STATUS, 4) + TEST_TYPE_ALIGN (LPRASTERIZER_STATUS, 4) + TEST_TARGET_SIZE (LPRASTERIZER_STATUS, 6) + TEST_TARGET_ALIGN(LPRASTERIZER_STATUS, 2) +} + +static void test_pack_LPRGBQUAD(void) +{ + /* LPRGBQUAD */ + TEST_TYPE_SIZE (LPRGBQUAD, 4) + TEST_TYPE_ALIGN (LPRGBQUAD, 4) + TEST_TARGET_SIZE (LPRGBQUAD, 4) + TEST_TARGET_ALIGN(LPRGBQUAD, 1) +} + +static void test_pack_LPRGNDATA(void) +{ + /* LPRGNDATA */ + TEST_TYPE_SIZE (LPRGNDATA, 4) + TEST_TYPE_ALIGN (LPRGNDATA, 4) + TEST_TARGET_SIZE (LPRGNDATA, 36) + TEST_TARGET_ALIGN(LPRGNDATA, 4) +} + +static void test_pack_LPTEXTMETRICA(void) +{ + /* LPTEXTMETRICA */ + TEST_TYPE_SIZE (LPTEXTMETRICA, 4) + TEST_TYPE_ALIGN (LPTEXTMETRICA, 4) + TEST_TARGET_SIZE (LPTEXTMETRICA, 56) + TEST_TARGET_ALIGN(LPTEXTMETRICA, 4) +} + +static void test_pack_LPTEXTMETRICW(void) +{ + /* LPTEXTMETRICW */ + TEST_TYPE_SIZE (LPTEXTMETRICW, 4) + TEST_TYPE_ALIGN (LPTEXTMETRICW, 4) + TEST_TARGET_SIZE (LPTEXTMETRICW, 60) + TEST_TARGET_ALIGN(LPTEXTMETRICW, 4) +} + +static void test_pack_LPTRIVERTEX(void) +{ + /* LPTRIVERTEX */ + TEST_TYPE_SIZE (LPTRIVERTEX, 4) + TEST_TYPE_ALIGN (LPTRIVERTEX, 4) + TEST_TARGET_SIZE (LPTRIVERTEX, 16) + TEST_TARGET_ALIGN(LPTRIVERTEX, 4) +} + +static void test_pack_LPTTPOLYCURVE(void) +{ + /* LPTTPOLYCURVE */ + TEST_TYPE_SIZE (LPTTPOLYCURVE, 4) + TEST_TYPE_ALIGN (LPTTPOLYCURVE, 4) + TEST_TARGET_SIZE (LPTTPOLYCURVE, 12) + TEST_TARGET_ALIGN(LPTTPOLYCURVE, 2) +} + +static void test_pack_LPTTPOLYGONHEADER(void) +{ + /* LPTTPOLYGONHEADER */ + TEST_TYPE_SIZE (LPTTPOLYGONHEADER, 4) + TEST_TYPE_ALIGN (LPTTPOLYGONHEADER, 4) + TEST_TARGET_SIZE (LPTTPOLYGONHEADER, 16) + TEST_TARGET_ALIGN(LPTTPOLYGONHEADER, 4) +} + +static void test_pack_LPXFORM(void) +{ + /* LPXFORM */ + TEST_TYPE_SIZE (LPXFORM, 4) + TEST_TYPE_ALIGN (LPXFORM, 4) + TEST_TARGET_SIZE (LPXFORM, 24) + TEST_TARGET_ALIGN(LPXFORM, 4) +} + +static void test_pack_MAT2(void) +{ + /* MAT2 (pack 4) */ + TEST_TYPE_SIZE (MAT2, 16) + TEST_TYPE_ALIGN (MAT2, 2) + TEST_FIELD_SIZE (MAT2, eM11, 4) + TEST_FIELD_ALIGN (MAT2, eM11, 2) + TEST_FIELD_OFFSET(MAT2, eM11, 0) + TEST_FIELD_SIZE (MAT2, eM12, 4) + TEST_FIELD_ALIGN (MAT2, eM12, 2) + TEST_FIELD_OFFSET(MAT2, eM12, 4) + TEST_FIELD_SIZE (MAT2, eM21, 4) + TEST_FIELD_ALIGN (MAT2, eM21, 2) + TEST_FIELD_OFFSET(MAT2, eM21, 8) + TEST_FIELD_SIZE (MAT2, eM22, 4) + TEST_FIELD_ALIGN (MAT2, eM22, 2) + TEST_FIELD_OFFSET(MAT2, eM22, 12) +} + +static void test_pack_METAFILEPICT(void) +{ + /* METAFILEPICT (pack 4) */ + TEST_TYPE_SIZE (METAFILEPICT, 16) + TEST_TYPE_ALIGN (METAFILEPICT, 4) + TEST_FIELD_SIZE (METAFILEPICT, mm, 4) + TEST_FIELD_ALIGN (METAFILEPICT, mm, 4) + TEST_FIELD_OFFSET(METAFILEPICT, mm, 0) + TEST_FIELD_SIZE (METAFILEPICT, xExt, 4) + TEST_FIELD_ALIGN (METAFILEPICT, xExt, 4) + TEST_FIELD_OFFSET(METAFILEPICT, xExt, 4) + TEST_FIELD_SIZE (METAFILEPICT, yExt, 4) + TEST_FIELD_ALIGN (METAFILEPICT, yExt, 4) + TEST_FIELD_OFFSET(METAFILEPICT, yExt, 8) + TEST_FIELD_SIZE (METAFILEPICT, hMF, 4) + TEST_FIELD_ALIGN (METAFILEPICT, hMF, 4) + TEST_FIELD_OFFSET(METAFILEPICT, hMF, 12) +} + +static void test_pack_METAHEADER(void) +{ + /* METAHEADER (pack 2) */ + TEST_TYPE_SIZE (METAHEADER, 18) + TEST_TYPE_ALIGN (METAHEADER, 2) + TEST_FIELD_SIZE (METAHEADER, mtType, 2) + TEST_FIELD_ALIGN (METAHEADER, mtType, 2) + TEST_FIELD_OFFSET(METAHEADER, mtType, 0) + TEST_FIELD_SIZE (METAHEADER, mtHeaderSize, 2) + TEST_FIELD_ALIGN (METAHEADER, mtHeaderSize, 2) + TEST_FIELD_OFFSET(METAHEADER, mtHeaderSize, 2) + TEST_FIELD_SIZE (METAHEADER, mtVersion, 2) + TEST_FIELD_ALIGN (METAHEADER, mtVersion, 2) + TEST_FIELD_OFFSET(METAHEADER, mtVersion, 4) + TEST_FIELD_SIZE (METAHEADER, mtSize, 4) + TEST_FIELD_ALIGN (METAHEADER, mtSize, 2) + TEST_FIELD_OFFSET(METAHEADER, mtSize, 6) + TEST_FIELD_SIZE (METAHEADER, mtNoObjects, 2) + TEST_FIELD_ALIGN (METAHEADER, mtNoObjects, 2) + TEST_FIELD_OFFSET(METAHEADER, mtNoObjects, 10) + TEST_FIELD_SIZE (METAHEADER, mtMaxRecord, 4) + TEST_FIELD_ALIGN (METAHEADER, mtMaxRecord, 2) + TEST_FIELD_OFFSET(METAHEADER, mtMaxRecord, 12) + TEST_FIELD_SIZE (METAHEADER, mtNoParameters, 2) + TEST_FIELD_ALIGN (METAHEADER, mtNoParameters, 2) + TEST_FIELD_OFFSET(METAHEADER, mtNoParameters, 16) +} + +static void test_pack_METARECORD(void) +{ + /* METARECORD (pack 4) */ + TEST_TYPE_SIZE (METARECORD, 8) + TEST_TYPE_ALIGN (METARECORD, 4) + TEST_FIELD_SIZE (METARECORD, rdSize, 4) + TEST_FIELD_ALIGN (METARECORD, rdSize, 4) + TEST_FIELD_OFFSET(METARECORD, rdSize, 0) + TEST_FIELD_SIZE (METARECORD, rdFunction, 2) + TEST_FIELD_ALIGN (METARECORD, rdFunction, 2) + TEST_FIELD_OFFSET(METARECORD, rdFunction, 4) + TEST_FIELD_SIZE (METARECORD, rdParm, 2) + TEST_FIELD_ALIGN (METARECORD, rdParm, 2) + TEST_FIELD_OFFSET(METARECORD, rdParm, 6) +} + +static void test_pack_MFENUMPROC(void) +{ + /* MFENUMPROC */ + TEST_TYPE_SIZE (MFENUMPROC, 4) + TEST_TYPE_ALIGN (MFENUMPROC, 4) +} + +static void test_pack_NEWTEXTMETRICA(void) +{ + /* NEWTEXTMETRICA (pack 4) */ + TEST_TYPE_SIZE (NEWTEXTMETRICA, 72) + TEST_TYPE_ALIGN (NEWTEXTMETRICA, 4) + TEST_FIELD_SIZE (NEWTEXTMETRICA, tmHeight, 4) + TEST_FIELD_ALIGN (NEWTEXTMETRICA, tmHeight, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICA, tmHeight, 0) + TEST_FIELD_SIZE (NEWTEXTMETRICA, tmAscent, 4) + TEST_FIELD_ALIGN (NEWTEXTMETRICA, tmAscent, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICA, tmAscent, 4) + TEST_FIELD_SIZE (NEWTEXTMETRICA, tmDescent, 4) + TEST_FIELD_ALIGN (NEWTEXTMETRICA, tmDescent, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICA, tmDescent, 8) + TEST_FIELD_SIZE (NEWTEXTMETRICA, tmInternalLeading, 4) + TEST_FIELD_ALIGN (NEWTEXTMETRICA, tmInternalLeading, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICA, tmInternalLeading, 12) + TEST_FIELD_SIZE (NEWTEXTMETRICA, tmExternalLeading, 4) + TEST_FIELD_ALIGN (NEWTEXTMETRICA, tmExternalLeading, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICA, tmExternalLeading, 16) + TEST_FIELD_SIZE (NEWTEXTMETRICA, tmAveCharWidth, 4) + TEST_FIELD_ALIGN (NEWTEXTMETRICA, tmAveCharWidth, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICA, tmAveCharWidth, 20) + TEST_FIELD_SIZE (NEWTEXTMETRICA, tmMaxCharWidth, 4) + TEST_FIELD_ALIGN (NEWTEXTMETRICA, tmMaxCharWidth, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICA, tmMaxCharWidth, 24) + TEST_FIELD_SIZE (NEWTEXTMETRICA, tmWeight, 4) + TEST_FIELD_ALIGN (NEWTEXTMETRICA, tmWeight, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICA, tmWeight, 28) + TEST_FIELD_SIZE (NEWTEXTMETRICA, tmOverhang, 4) + TEST_FIELD_ALIGN (NEWTEXTMETRICA, tmOverhang, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICA, tmOverhang, 32) + TEST_FIELD_SIZE (NEWTEXTMETRICA, tmDigitizedAspectX, 4) + TEST_FIELD_ALIGN (NEWTEXTMETRICA, tmDigitizedAspectX, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICA, tmDigitizedAspectX, 36) + TEST_FIELD_SIZE (NEWTEXTMETRICA, tmDigitizedAspectY, 4) + TEST_FIELD_ALIGN (NEWTEXTMETRICA, tmDigitizedAspectY, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICA, tmDigitizedAspectY, 40) + TEST_FIELD_SIZE (NEWTEXTMETRICA, tmFirstChar, 1) + TEST_FIELD_ALIGN (NEWTEXTMETRICA, tmFirstChar, 1) + TEST_FIELD_OFFSET(NEWTEXTMETRICA, tmFirstChar, 44) + TEST_FIELD_SIZE (NEWTEXTMETRICA, tmLastChar, 1) + TEST_FIELD_ALIGN (NEWTEXTMETRICA, tmLastChar, 1) + TEST_FIELD_OFFSET(NEWTEXTMETRICA, tmLastChar, 45) + TEST_FIELD_SIZE (NEWTEXTMETRICA, tmDefaultChar, 1) + TEST_FIELD_ALIGN (NEWTEXTMETRICA, tmDefaultChar, 1) + TEST_FIELD_OFFSET(NEWTEXTMETRICA, tmDefaultChar, 46) + TEST_FIELD_SIZE (NEWTEXTMETRICA, tmBreakChar, 1) + TEST_FIELD_ALIGN (NEWTEXTMETRICA, tmBreakChar, 1) + TEST_FIELD_OFFSET(NEWTEXTMETRICA, tmBreakChar, 47) + TEST_FIELD_SIZE (NEWTEXTMETRICA, tmItalic, 1) + TEST_FIELD_ALIGN (NEWTEXTMETRICA, tmItalic, 1) + TEST_FIELD_OFFSET(NEWTEXTMETRICA, tmItalic, 48) + TEST_FIELD_SIZE (NEWTEXTMETRICA, tmUnderlined, 1) + TEST_FIELD_ALIGN (NEWTEXTMETRICA, tmUnderlined, 1) + TEST_FIELD_OFFSET(NEWTEXTMETRICA, tmUnderlined, 49) + TEST_FIELD_SIZE (NEWTEXTMETRICA, tmStruckOut, 1) + TEST_FIELD_ALIGN (NEWTEXTMETRICA, tmStruckOut, 1) + TEST_FIELD_OFFSET(NEWTEXTMETRICA, tmStruckOut, 50) + TEST_FIELD_SIZE (NEWTEXTMETRICA, tmPitchAndFamily, 1) + TEST_FIELD_ALIGN (NEWTEXTMETRICA, tmPitchAndFamily, 1) + TEST_FIELD_OFFSET(NEWTEXTMETRICA, tmPitchAndFamily, 51) + TEST_FIELD_SIZE (NEWTEXTMETRICA, tmCharSet, 1) + TEST_FIELD_ALIGN (NEWTEXTMETRICA, tmCharSet, 1) + TEST_FIELD_OFFSET(NEWTEXTMETRICA, tmCharSet, 52) + TEST_FIELD_SIZE (NEWTEXTMETRICA, ntmFlags, 4) + TEST_FIELD_ALIGN (NEWTEXTMETRICA, ntmFlags, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICA, ntmFlags, 56) + TEST_FIELD_SIZE (NEWTEXTMETRICA, ntmSizeEM, 4) + TEST_FIELD_ALIGN (NEWTEXTMETRICA, ntmSizeEM, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICA, ntmSizeEM, 60) + TEST_FIELD_SIZE (NEWTEXTMETRICA, ntmCellHeight, 4) + TEST_FIELD_ALIGN (NEWTEXTMETRICA, ntmCellHeight, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICA, ntmCellHeight, 64) + TEST_FIELD_SIZE (NEWTEXTMETRICA, ntmAvgWidth, 4) + TEST_FIELD_ALIGN (NEWTEXTMETRICA, ntmAvgWidth, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICA, ntmAvgWidth, 68) +} + +static void test_pack_NEWTEXTMETRICEXA(void) +{ + /* NEWTEXTMETRICEXA (pack 4) */ + TEST_TYPE_SIZE (NEWTEXTMETRICEXA, 96) + TEST_TYPE_ALIGN (NEWTEXTMETRICEXA, 4) + TEST_FIELD_SIZE (NEWTEXTMETRICEXA, ntmTm, 72) + TEST_FIELD_ALIGN (NEWTEXTMETRICEXA, ntmTm, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICEXA, ntmTm, 0) + TEST_FIELD_SIZE (NEWTEXTMETRICEXA, ntmFontSig, 24) + TEST_FIELD_ALIGN (NEWTEXTMETRICEXA, ntmFontSig, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICEXA, ntmFontSig, 72) +} + +static void test_pack_NEWTEXTMETRICEXW(void) +{ + /* NEWTEXTMETRICEXW (pack 4) */ + TEST_TYPE_SIZE (NEWTEXTMETRICEXW, 100) + TEST_TYPE_ALIGN (NEWTEXTMETRICEXW, 4) + TEST_FIELD_SIZE (NEWTEXTMETRICEXW, ntmTm, 76) + TEST_FIELD_ALIGN (NEWTEXTMETRICEXW, ntmTm, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICEXW, ntmTm, 0) + TEST_FIELD_SIZE (NEWTEXTMETRICEXW, ntmFontSig, 24) + TEST_FIELD_ALIGN (NEWTEXTMETRICEXW, ntmFontSig, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICEXW, ntmFontSig, 76) +} + +static void test_pack_NEWTEXTMETRICW(void) +{ + /* NEWTEXTMETRICW (pack 4) */ + TEST_TYPE_SIZE (NEWTEXTMETRICW, 76) + TEST_TYPE_ALIGN (NEWTEXTMETRICW, 4) + TEST_FIELD_SIZE (NEWTEXTMETRICW, tmHeight, 4) + TEST_FIELD_ALIGN (NEWTEXTMETRICW, tmHeight, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICW, tmHeight, 0) + TEST_FIELD_SIZE (NEWTEXTMETRICW, tmAscent, 4) + TEST_FIELD_ALIGN (NEWTEXTMETRICW, tmAscent, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICW, tmAscent, 4) + TEST_FIELD_SIZE (NEWTEXTMETRICW, tmDescent, 4) + TEST_FIELD_ALIGN (NEWTEXTMETRICW, tmDescent, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICW, tmDescent, 8) + TEST_FIELD_SIZE (NEWTEXTMETRICW, tmInternalLeading, 4) + TEST_FIELD_ALIGN (NEWTEXTMETRICW, tmInternalLeading, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICW, tmInternalLeading, 12) + TEST_FIELD_SIZE (NEWTEXTMETRICW, tmExternalLeading, 4) + TEST_FIELD_ALIGN (NEWTEXTMETRICW, tmExternalLeading, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICW, tmExternalLeading, 16) + TEST_FIELD_SIZE (NEWTEXTMETRICW, tmAveCharWidth, 4) + TEST_FIELD_ALIGN (NEWTEXTMETRICW, tmAveCharWidth, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICW, tmAveCharWidth, 20) + TEST_FIELD_SIZE (NEWTEXTMETRICW, tmMaxCharWidth, 4) + TEST_FIELD_ALIGN (NEWTEXTMETRICW, tmMaxCharWidth, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICW, tmMaxCharWidth, 24) + TEST_FIELD_SIZE (NEWTEXTMETRICW, tmWeight, 4) + TEST_FIELD_ALIGN (NEWTEXTMETRICW, tmWeight, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICW, tmWeight, 28) + TEST_FIELD_SIZE (NEWTEXTMETRICW, tmOverhang, 4) + TEST_FIELD_ALIGN (NEWTEXTMETRICW, tmOverhang, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICW, tmOverhang, 32) + TEST_FIELD_SIZE (NEWTEXTMETRICW, tmDigitizedAspectX, 4) + TEST_FIELD_ALIGN (NEWTEXTMETRICW, tmDigitizedAspectX, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICW, tmDigitizedAspectX, 36) + TEST_FIELD_SIZE (NEWTEXTMETRICW, tmDigitizedAspectY, 4) + TEST_FIELD_ALIGN (NEWTEXTMETRICW, tmDigitizedAspectY, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICW, tmDigitizedAspectY, 40) + TEST_FIELD_SIZE (NEWTEXTMETRICW, tmFirstChar, 2) + TEST_FIELD_ALIGN (NEWTEXTMETRICW, tmFirstChar, 2) + TEST_FIELD_OFFSET(NEWTEXTMETRICW, tmFirstChar, 44) + TEST_FIELD_SIZE (NEWTEXTMETRICW, tmLastChar, 2) + TEST_FIELD_ALIGN (NEWTEXTMETRICW, tmLastChar, 2) + TEST_FIELD_OFFSET(NEWTEXTMETRICW, tmLastChar, 46) + TEST_FIELD_SIZE (NEWTEXTMETRICW, tmDefaultChar, 2) + TEST_FIELD_ALIGN (NEWTEXTMETRICW, tmDefaultChar, 2) + TEST_FIELD_OFFSET(NEWTEXTMETRICW, tmDefaultChar, 48) + TEST_FIELD_SIZE (NEWTEXTMETRICW, tmBreakChar, 2) + TEST_FIELD_ALIGN (NEWTEXTMETRICW, tmBreakChar, 2) + TEST_FIELD_OFFSET(NEWTEXTMETRICW, tmBreakChar, 50) + TEST_FIELD_SIZE (NEWTEXTMETRICW, tmItalic, 1) + TEST_FIELD_ALIGN (NEWTEXTMETRICW, tmItalic, 1) + TEST_FIELD_OFFSET(NEWTEXTMETRICW, tmItalic, 52) + TEST_FIELD_SIZE (NEWTEXTMETRICW, tmUnderlined, 1) + TEST_FIELD_ALIGN (NEWTEXTMETRICW, tmUnderlined, 1) + TEST_FIELD_OFFSET(NEWTEXTMETRICW, tmUnderlined, 53) + TEST_FIELD_SIZE (NEWTEXTMETRICW, tmStruckOut, 1) + TEST_FIELD_ALIGN (NEWTEXTMETRICW, tmStruckOut, 1) + TEST_FIELD_OFFSET(NEWTEXTMETRICW, tmStruckOut, 54) + TEST_FIELD_SIZE (NEWTEXTMETRICW, tmPitchAndFamily, 1) + TEST_FIELD_ALIGN (NEWTEXTMETRICW, tmPitchAndFamily, 1) + TEST_FIELD_OFFSET(NEWTEXTMETRICW, tmPitchAndFamily, 55) + TEST_FIELD_SIZE (NEWTEXTMETRICW, tmCharSet, 1) + TEST_FIELD_ALIGN (NEWTEXTMETRICW, tmCharSet, 1) + TEST_FIELD_OFFSET(NEWTEXTMETRICW, tmCharSet, 56) + TEST_FIELD_SIZE (NEWTEXTMETRICW, ntmFlags, 4) + TEST_FIELD_ALIGN (NEWTEXTMETRICW, ntmFlags, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICW, ntmFlags, 60) + TEST_FIELD_SIZE (NEWTEXTMETRICW, ntmSizeEM, 4) + TEST_FIELD_ALIGN (NEWTEXTMETRICW, ntmSizeEM, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICW, ntmSizeEM, 64) + TEST_FIELD_SIZE (NEWTEXTMETRICW, ntmCellHeight, 4) + TEST_FIELD_ALIGN (NEWTEXTMETRICW, ntmCellHeight, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICW, ntmCellHeight, 68) + TEST_FIELD_SIZE (NEWTEXTMETRICW, ntmAvgWidth, 4) + TEST_FIELD_ALIGN (NEWTEXTMETRICW, ntmAvgWidth, 4) + TEST_FIELD_OFFSET(NEWTEXTMETRICW, ntmAvgWidth, 72) +} + +static void test_pack_NPEXTLOGPEN(void) +{ + /* NPEXTLOGPEN */ + TEST_TYPE_SIZE (NPEXTLOGPEN, 4) + TEST_TYPE_ALIGN (NPEXTLOGPEN, 4) + TEST_TARGET_SIZE (NPEXTLOGPEN, 28) + TEST_TARGET_ALIGN(NPEXTLOGPEN, 4) +} + +static void test_pack_OLDFONTENUMPROC(void) +{ + /* OLDFONTENUMPROC */ + TEST_TYPE_SIZE (OLDFONTENUMPROC, 4) + TEST_TYPE_ALIGN (OLDFONTENUMPROC, 4) +} + +static void test_pack_OLDFONTENUMPROCA(void) +{ + /* OLDFONTENUMPROCA */ + TEST_TYPE_SIZE (OLDFONTENUMPROCA, 4) + TEST_TYPE_ALIGN (OLDFONTENUMPROCA, 4) +} + +static void test_pack_OLDFONTENUMPROCW(void) +{ + /* OLDFONTENUMPROCW */ + TEST_TYPE_SIZE (OLDFONTENUMPROCW, 4) + TEST_TYPE_ALIGN (OLDFONTENUMPROCW, 4) +} + +static void test_pack_OUTLINETEXTMETRICA(void) +{ + /* OUTLINETEXTMETRICA (pack 4) */ + TEST_TYPE_SIZE (OUTLINETEXTMETRICA, 212) + TEST_TYPE_ALIGN (OUTLINETEXTMETRICA, 4) + TEST_FIELD_SIZE (OUTLINETEXTMETRICA, otmSize, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICA, otmSize, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICA, otmSize, 0) + TEST_FIELD_SIZE (OUTLINETEXTMETRICA, otmTextMetrics, 56) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICA, otmTextMetrics, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICA, otmTextMetrics, 4) + TEST_FIELD_SIZE (OUTLINETEXTMETRICA, otmFiller, 1) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICA, otmFiller, 1) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICA, otmFiller, 60) + TEST_FIELD_SIZE (OUTLINETEXTMETRICA, otmPanoseNumber, 10) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICA, otmPanoseNumber, 1) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICA, otmPanoseNumber, 61) + TEST_FIELD_SIZE (OUTLINETEXTMETRICA, otmfsSelection, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICA, otmfsSelection, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICA, otmfsSelection, 72) + TEST_FIELD_SIZE (OUTLINETEXTMETRICA, otmfsType, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICA, otmfsType, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICA, otmfsType, 76) + TEST_FIELD_SIZE (OUTLINETEXTMETRICA, otmsCharSlopeRise, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICA, otmsCharSlopeRise, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICA, otmsCharSlopeRise, 80) + TEST_FIELD_SIZE (OUTLINETEXTMETRICA, otmsCharSlopeRun, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICA, otmsCharSlopeRun, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICA, otmsCharSlopeRun, 84) + TEST_FIELD_SIZE (OUTLINETEXTMETRICA, otmItalicAngle, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICA, otmItalicAngle, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICA, otmItalicAngle, 88) + TEST_FIELD_SIZE (OUTLINETEXTMETRICA, otmEMSquare, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICA, otmEMSquare, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICA, otmEMSquare, 92) + TEST_FIELD_SIZE (OUTLINETEXTMETRICA, otmAscent, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICA, otmAscent, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICA, otmAscent, 96) + TEST_FIELD_SIZE (OUTLINETEXTMETRICA, otmDescent, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICA, otmDescent, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICA, otmDescent, 100) + TEST_FIELD_SIZE (OUTLINETEXTMETRICA, otmLineGap, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICA, otmLineGap, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICA, otmLineGap, 104) + TEST_FIELD_SIZE (OUTLINETEXTMETRICA, otmsCapEmHeight, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICA, otmsCapEmHeight, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICA, otmsCapEmHeight, 108) + TEST_FIELD_SIZE (OUTLINETEXTMETRICA, otmsXHeight, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICA, otmsXHeight, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICA, otmsXHeight, 112) + TEST_FIELD_SIZE (OUTLINETEXTMETRICA, otmrcFontBox, 16) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICA, otmrcFontBox, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICA, otmrcFontBox, 116) + TEST_FIELD_SIZE (OUTLINETEXTMETRICA, otmMacAscent, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICA, otmMacAscent, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICA, otmMacAscent, 132) + TEST_FIELD_SIZE (OUTLINETEXTMETRICA, otmMacDescent, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICA, otmMacDescent, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICA, otmMacDescent, 136) + TEST_FIELD_SIZE (OUTLINETEXTMETRICA, otmMacLineGap, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICA, otmMacLineGap, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICA, otmMacLineGap, 140) + TEST_FIELD_SIZE (OUTLINETEXTMETRICA, otmusMinimumPPEM, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICA, otmusMinimumPPEM, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICA, otmusMinimumPPEM, 144) + TEST_FIELD_SIZE (OUTLINETEXTMETRICA, otmptSubscriptSize, 8) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICA, otmptSubscriptSize, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICA, otmptSubscriptSize, 148) + TEST_FIELD_SIZE (OUTLINETEXTMETRICA, otmptSubscriptOffset, 8) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICA, otmptSubscriptOffset, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICA, otmptSubscriptOffset, 156) + TEST_FIELD_SIZE (OUTLINETEXTMETRICA, otmptSuperscriptSize, 8) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICA, otmptSuperscriptSize, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICA, otmptSuperscriptSize, 164) + TEST_FIELD_SIZE (OUTLINETEXTMETRICA, otmptSuperscriptOffset, 8) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICA, otmptSuperscriptOffset, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICA, otmptSuperscriptOffset, 172) + TEST_FIELD_SIZE (OUTLINETEXTMETRICA, otmsStrikeoutSize, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICA, otmsStrikeoutSize, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICA, otmsStrikeoutSize, 180) + TEST_FIELD_SIZE (OUTLINETEXTMETRICA, otmsStrikeoutPosition, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICA, otmsStrikeoutPosition, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICA, otmsStrikeoutPosition, 184) + TEST_FIELD_SIZE (OUTLINETEXTMETRICA, otmsUnderscoreSize, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICA, otmsUnderscoreSize, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICA, otmsUnderscoreSize, 188) + TEST_FIELD_SIZE (OUTLINETEXTMETRICA, otmsUnderscorePosition, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICA, otmsUnderscorePosition, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICA, otmsUnderscorePosition, 192) + TEST_FIELD_SIZE (OUTLINETEXTMETRICA, otmpFamilyName, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICA, otmpFamilyName, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICA, otmpFamilyName, 196) + TEST_FIELD_SIZE (OUTLINETEXTMETRICA, otmpFaceName, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICA, otmpFaceName, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICA, otmpFaceName, 200) + TEST_FIELD_SIZE (OUTLINETEXTMETRICA, otmpStyleName, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICA, otmpStyleName, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICA, otmpStyleName, 204) + TEST_FIELD_SIZE (OUTLINETEXTMETRICA, otmpFullName, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICA, otmpFullName, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICA, otmpFullName, 208) +} + +static void test_pack_OUTLINETEXTMETRICW(void) +{ + /* OUTLINETEXTMETRICW (pack 4) */ + TEST_TYPE_SIZE (OUTLINETEXTMETRICW, 216) + TEST_TYPE_ALIGN (OUTLINETEXTMETRICW, 4) + TEST_FIELD_SIZE (OUTLINETEXTMETRICW, otmSize, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICW, otmSize, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICW, otmSize, 0) + TEST_FIELD_SIZE (OUTLINETEXTMETRICW, otmTextMetrics, 60) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICW, otmTextMetrics, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICW, otmTextMetrics, 4) + TEST_FIELD_SIZE (OUTLINETEXTMETRICW, otmFiller, 1) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICW, otmFiller, 1) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICW, otmFiller, 64) + TEST_FIELD_SIZE (OUTLINETEXTMETRICW, otmPanoseNumber, 10) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICW, otmPanoseNumber, 1) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICW, otmPanoseNumber, 65) + TEST_FIELD_SIZE (OUTLINETEXTMETRICW, otmfsSelection, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICW, otmfsSelection, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICW, otmfsSelection, 76) + TEST_FIELD_SIZE (OUTLINETEXTMETRICW, otmfsType, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICW, otmfsType, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICW, otmfsType, 80) + TEST_FIELD_SIZE (OUTLINETEXTMETRICW, otmsCharSlopeRise, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICW, otmsCharSlopeRise, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICW, otmsCharSlopeRise, 84) + TEST_FIELD_SIZE (OUTLINETEXTMETRICW, otmsCharSlopeRun, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICW, otmsCharSlopeRun, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICW, otmsCharSlopeRun, 88) + TEST_FIELD_SIZE (OUTLINETEXTMETRICW, otmItalicAngle, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICW, otmItalicAngle, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICW, otmItalicAngle, 92) + TEST_FIELD_SIZE (OUTLINETEXTMETRICW, otmEMSquare, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICW, otmEMSquare, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICW, otmEMSquare, 96) + TEST_FIELD_SIZE (OUTLINETEXTMETRICW, otmAscent, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICW, otmAscent, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICW, otmAscent, 100) + TEST_FIELD_SIZE (OUTLINETEXTMETRICW, otmDescent, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICW, otmDescent, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICW, otmDescent, 104) + TEST_FIELD_SIZE (OUTLINETEXTMETRICW, otmLineGap, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICW, otmLineGap, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICW, otmLineGap, 108) + TEST_FIELD_SIZE (OUTLINETEXTMETRICW, otmsCapEmHeight, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICW, otmsCapEmHeight, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICW, otmsCapEmHeight, 112) + TEST_FIELD_SIZE (OUTLINETEXTMETRICW, otmsXHeight, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICW, otmsXHeight, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICW, otmsXHeight, 116) + TEST_FIELD_SIZE (OUTLINETEXTMETRICW, otmrcFontBox, 16) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICW, otmrcFontBox, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICW, otmrcFontBox, 120) + TEST_FIELD_SIZE (OUTLINETEXTMETRICW, otmMacAscent, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICW, otmMacAscent, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICW, otmMacAscent, 136) + TEST_FIELD_SIZE (OUTLINETEXTMETRICW, otmMacDescent, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICW, otmMacDescent, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICW, otmMacDescent, 140) + TEST_FIELD_SIZE (OUTLINETEXTMETRICW, otmMacLineGap, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICW, otmMacLineGap, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICW, otmMacLineGap, 144) + TEST_FIELD_SIZE (OUTLINETEXTMETRICW, otmusMinimumPPEM, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICW, otmusMinimumPPEM, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICW, otmusMinimumPPEM, 148) + TEST_FIELD_SIZE (OUTLINETEXTMETRICW, otmptSubscriptSize, 8) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICW, otmptSubscriptSize, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICW, otmptSubscriptSize, 152) + TEST_FIELD_SIZE (OUTLINETEXTMETRICW, otmptSubscriptOffset, 8) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICW, otmptSubscriptOffset, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICW, otmptSubscriptOffset, 160) + TEST_FIELD_SIZE (OUTLINETEXTMETRICW, otmptSuperscriptSize, 8) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICW, otmptSuperscriptSize, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICW, otmptSuperscriptSize, 168) + TEST_FIELD_SIZE (OUTLINETEXTMETRICW, otmptSuperscriptOffset, 8) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICW, otmptSuperscriptOffset, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICW, otmptSuperscriptOffset, 176) + TEST_FIELD_SIZE (OUTLINETEXTMETRICW, otmsStrikeoutSize, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICW, otmsStrikeoutSize, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICW, otmsStrikeoutSize, 184) + TEST_FIELD_SIZE (OUTLINETEXTMETRICW, otmsStrikeoutPosition, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICW, otmsStrikeoutPosition, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICW, otmsStrikeoutPosition, 188) + TEST_FIELD_SIZE (OUTLINETEXTMETRICW, otmsUnderscoreSize, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICW, otmsUnderscoreSize, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICW, otmsUnderscoreSize, 192) + TEST_FIELD_SIZE (OUTLINETEXTMETRICW, otmsUnderscorePosition, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICW, otmsUnderscorePosition, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICW, otmsUnderscorePosition, 196) + TEST_FIELD_SIZE (OUTLINETEXTMETRICW, otmpFamilyName, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICW, otmpFamilyName, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICW, otmpFamilyName, 200) + TEST_FIELD_SIZE (OUTLINETEXTMETRICW, otmpFaceName, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICW, otmpFaceName, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICW, otmpFaceName, 204) + TEST_FIELD_SIZE (OUTLINETEXTMETRICW, otmpStyleName, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICW, otmpStyleName, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICW, otmpStyleName, 208) + TEST_FIELD_SIZE (OUTLINETEXTMETRICW, otmpFullName, 4) + TEST_FIELD_ALIGN (OUTLINETEXTMETRICW, otmpFullName, 4) + TEST_FIELD_OFFSET(OUTLINETEXTMETRICW, otmpFullName, 212) +} + +static void test_pack_PABC(void) +{ + /* PABC */ + TEST_TYPE_SIZE (PABC, 4) + TEST_TYPE_ALIGN (PABC, 4) + TEST_TARGET_SIZE (PABC, 12) + TEST_TARGET_ALIGN(PABC, 4) +} + +static void test_pack_PABCFLOAT(void) +{ + /* PABCFLOAT */ + TEST_TYPE_SIZE (PABCFLOAT, 4) + TEST_TYPE_ALIGN (PABCFLOAT, 4) + TEST_TARGET_SIZE (PABCFLOAT, 12) + TEST_TARGET_ALIGN(PABCFLOAT, 4) +} + +static void test_pack_PANOSE(void) +{ + /* PANOSE (pack 4) */ + TEST_TYPE_SIZE (PANOSE, 10) + TEST_TYPE_ALIGN (PANOSE, 1) + TEST_FIELD_SIZE (PANOSE, bFamilyType, 1) + TEST_FIELD_ALIGN (PANOSE, bFamilyType, 1) + TEST_FIELD_OFFSET(PANOSE, bFamilyType, 0) + TEST_FIELD_SIZE (PANOSE, bSerifStyle, 1) + TEST_FIELD_ALIGN (PANOSE, bSerifStyle, 1) + TEST_FIELD_OFFSET(PANOSE, bSerifStyle, 1) + TEST_FIELD_SIZE (PANOSE, bWeight, 1) + TEST_FIELD_ALIGN (PANOSE, bWeight, 1) + TEST_FIELD_OFFSET(PANOSE, bWeight, 2) + TEST_FIELD_SIZE (PANOSE, bProportion, 1) + TEST_FIELD_ALIGN (PANOSE, bProportion, 1) + TEST_FIELD_OFFSET(PANOSE, bProportion, 3) + TEST_FIELD_SIZE (PANOSE, bContrast, 1) + TEST_FIELD_ALIGN (PANOSE, bContrast, 1) + TEST_FIELD_OFFSET(PANOSE, bContrast, 4) + TEST_FIELD_SIZE (PANOSE, bStrokeVariation, 1) + TEST_FIELD_ALIGN (PANOSE, bStrokeVariation, 1) + TEST_FIELD_OFFSET(PANOSE, bStrokeVariation, 5) + TEST_FIELD_SIZE (PANOSE, bArmStyle, 1) + TEST_FIELD_ALIGN (PANOSE, bArmStyle, 1) + TEST_FIELD_OFFSET(PANOSE, bArmStyle, 6) + TEST_FIELD_SIZE (PANOSE, bLetterform, 1) + TEST_FIELD_ALIGN (PANOSE, bLetterform, 1) + TEST_FIELD_OFFSET(PANOSE, bLetterform, 7) + TEST_FIELD_SIZE (PANOSE, bMidline, 1) + TEST_FIELD_ALIGN (PANOSE, bMidline, 1) + TEST_FIELD_OFFSET(PANOSE, bMidline, 8) + TEST_FIELD_SIZE (PANOSE, bXHeight, 1) + TEST_FIELD_ALIGN (PANOSE, bXHeight, 1) + TEST_FIELD_OFFSET(PANOSE, bXHeight, 9) +} + +static void test_pack_PATTERN(void) +{ + /* PATTERN */ + TEST_TYPE_SIZE (PATTERN, 12) + TEST_TYPE_ALIGN (PATTERN, 4) +} + +static void test_pack_PBITMAP(void) +{ + /* PBITMAP */ + TEST_TYPE_SIZE (PBITMAP, 4) + TEST_TYPE_ALIGN (PBITMAP, 4) + TEST_TARGET_SIZE (PBITMAP, 24) + TEST_TARGET_ALIGN(PBITMAP, 4) +} + +static void test_pack_PBITMAPCOREHEADER(void) +{ + /* PBITMAPCOREHEADER */ + TEST_TYPE_SIZE (PBITMAPCOREHEADER, 4) + TEST_TYPE_ALIGN (PBITMAPCOREHEADER, 4) + TEST_TARGET_SIZE (PBITMAPCOREHEADER, 12) + TEST_TARGET_ALIGN(PBITMAPCOREHEADER, 4) +} + +static void test_pack_PBITMAPCOREINFO(void) +{ + /* PBITMAPCOREINFO */ + TEST_TYPE_SIZE (PBITMAPCOREINFO, 4) + TEST_TYPE_ALIGN (PBITMAPCOREINFO, 4) + TEST_TARGET_SIZE (PBITMAPCOREINFO, 16) + TEST_TARGET_ALIGN(PBITMAPCOREINFO, 4) +} + +static void test_pack_PBITMAPFILEHEADER(void) +{ + /* PBITMAPFILEHEADER */ + TEST_TYPE_SIZE (PBITMAPFILEHEADER, 4) + TEST_TYPE_ALIGN (PBITMAPFILEHEADER, 4) + TEST_TARGET_SIZE (PBITMAPFILEHEADER, 14) + TEST_TARGET_ALIGN(PBITMAPFILEHEADER, 2) +} + +static void test_pack_PBITMAPINFO(void) +{ + /* PBITMAPINFO */ + TEST_TYPE_SIZE (PBITMAPINFO, 4) + TEST_TYPE_ALIGN (PBITMAPINFO, 4) + TEST_TARGET_SIZE (PBITMAPINFO, 44) + TEST_TARGET_ALIGN(PBITMAPINFO, 4) +} + +static void test_pack_PBITMAPINFOHEADER(void) +{ + /* PBITMAPINFOHEADER */ + TEST_TYPE_SIZE (PBITMAPINFOHEADER, 4) + TEST_TYPE_ALIGN (PBITMAPINFOHEADER, 4) + TEST_TARGET_SIZE (PBITMAPINFOHEADER, 40) + TEST_TARGET_ALIGN(PBITMAPINFOHEADER, 4) +} + +static void test_pack_PBITMAPV4HEADER(void) +{ + /* PBITMAPV4HEADER */ + TEST_TYPE_SIZE (PBITMAPV4HEADER, 4) + TEST_TYPE_ALIGN (PBITMAPV4HEADER, 4) + TEST_TARGET_SIZE (PBITMAPV4HEADER, 108) + TEST_TARGET_ALIGN(PBITMAPV4HEADER, 4) +} + +static void test_pack_PBITMAPV5HEADER(void) +{ + /* PBITMAPV5HEADER */ + TEST_TYPE_SIZE (PBITMAPV5HEADER, 4) + TEST_TYPE_ALIGN (PBITMAPV5HEADER, 4) + TEST_TARGET_SIZE (PBITMAPV5HEADER, 124) + TEST_TARGET_ALIGN(PBITMAPV5HEADER, 4) +} + +static void test_pack_PBLENDFUNCTION(void) +{ + /* PBLENDFUNCTION */ + TEST_TYPE_SIZE (PBLENDFUNCTION, 4) + TEST_TYPE_ALIGN (PBLENDFUNCTION, 4) + TEST_TARGET_SIZE (PBLENDFUNCTION, 4) + TEST_TARGET_ALIGN(PBLENDFUNCTION, 1) +} + +static void test_pack_PCHARSETINFO(void) +{ + /* PCHARSETINFO */ + TEST_TYPE_SIZE (PCHARSETINFO, 4) + TEST_TYPE_ALIGN (PCHARSETINFO, 4) + TEST_TARGET_SIZE (PCHARSETINFO, 32) + TEST_TARGET_ALIGN(PCHARSETINFO, 4) +} + +static void test_pack_PCOLORADJUSTMENT(void) +{ + /* PCOLORADJUSTMENT */ + TEST_TYPE_SIZE (PCOLORADJUSTMENT, 4) + TEST_TYPE_ALIGN (PCOLORADJUSTMENT, 4) + TEST_TARGET_SIZE (PCOLORADJUSTMENT, 24) + TEST_TARGET_ALIGN(PCOLORADJUSTMENT, 2) +} + +static void test_pack_PDEVMODEA(void) +{ + /* PDEVMODEA */ + TEST_TYPE_SIZE (PDEVMODEA, 4) + TEST_TYPE_ALIGN (PDEVMODEA, 4) +} + +static void test_pack_PDEVMODEW(void) +{ + /* PDEVMODEW */ + TEST_TYPE_SIZE (PDEVMODEW, 4) + TEST_TYPE_ALIGN (PDEVMODEW, 4) +} + +static void test_pack_PDIBSECTION(void) +{ + /* PDIBSECTION */ + TEST_TYPE_SIZE (PDIBSECTION, 4) + TEST_TYPE_ALIGN (PDIBSECTION, 4) + TEST_TARGET_SIZE (PDIBSECTION, 84) + TEST_TARGET_ALIGN(PDIBSECTION, 4) +} + +static void test_pack_PDISPLAY_DEVICEA(void) +{ + /* PDISPLAY_DEVICEA */ + TEST_TYPE_SIZE (PDISPLAY_DEVICEA, 4) + TEST_TYPE_ALIGN (PDISPLAY_DEVICEA, 4) + TEST_TARGET_SIZE (PDISPLAY_DEVICEA, 424) + TEST_TARGET_ALIGN(PDISPLAY_DEVICEA, 4) +} + +static void test_pack_PDISPLAY_DEVICEW(void) +{ + /* PDISPLAY_DEVICEW */ + TEST_TYPE_SIZE (PDISPLAY_DEVICEW, 4) + TEST_TYPE_ALIGN (PDISPLAY_DEVICEW, 4) + TEST_TARGET_SIZE (PDISPLAY_DEVICEW, 840) + TEST_TARGET_ALIGN(PDISPLAY_DEVICEW, 4) +} + +static void test_pack_PELARRAY(void) +{ + /* PELARRAY (pack 4) */ + TEST_TYPE_SIZE (PELARRAY, 20) + TEST_TYPE_ALIGN (PELARRAY, 4) + TEST_FIELD_SIZE (PELARRAY, paXCount, 4) + TEST_FIELD_ALIGN (PELARRAY, paXCount, 4) + TEST_FIELD_OFFSET(PELARRAY, paXCount, 0) + TEST_FIELD_SIZE (PELARRAY, paYCount, 4) + TEST_FIELD_ALIGN (PELARRAY, paYCount, 4) + TEST_FIELD_OFFSET(PELARRAY, paYCount, 4) + TEST_FIELD_SIZE (PELARRAY, paXExt, 4) + TEST_FIELD_ALIGN (PELARRAY, paXExt, 4) + TEST_FIELD_OFFSET(PELARRAY, paXExt, 8) + TEST_FIELD_SIZE (PELARRAY, paYExt, 4) + TEST_FIELD_ALIGN (PELARRAY, paYExt, 4) + TEST_FIELD_OFFSET(PELARRAY, paYExt, 12) + TEST_FIELD_SIZE (PELARRAY, paRGBs, 1) + TEST_FIELD_ALIGN (PELARRAY, paRGBs, 1) + TEST_FIELD_OFFSET(PELARRAY, paRGBs, 16) +} + +static void test_pack_PEMR(void) +{ + /* PEMR */ + TEST_TYPE_SIZE (PEMR, 4) + TEST_TYPE_ALIGN (PEMR, 4) + TEST_TARGET_SIZE (PEMR, 8) + TEST_TARGET_ALIGN(PEMR, 4) +} + +static void test_pack_PEMRABORTPATH(void) +{ + /* PEMRABORTPATH */ + TEST_TYPE_SIZE (PEMRABORTPATH, 4) + TEST_TYPE_ALIGN (PEMRABORTPATH, 4) + TEST_TARGET_SIZE (PEMRABORTPATH, 8) + TEST_TARGET_ALIGN(PEMRABORTPATH, 4) +} + +static void test_pack_PEMRANGLEARC(void) +{ + /* PEMRANGLEARC */ + TEST_TYPE_SIZE (PEMRANGLEARC, 4) + TEST_TYPE_ALIGN (PEMRANGLEARC, 4) + TEST_TARGET_SIZE (PEMRANGLEARC, 28) + TEST_TARGET_ALIGN(PEMRANGLEARC, 4) +} + +static void test_pack_PEMRARC(void) +{ + /* PEMRARC */ + TEST_TYPE_SIZE (PEMRARC, 4) + TEST_TYPE_ALIGN (PEMRARC, 4) + TEST_TARGET_SIZE (PEMRARC, 40) + TEST_TARGET_ALIGN(PEMRARC, 4) +} + +static void test_pack_PEMRARCTO(void) +{ + /* PEMRARCTO */ + TEST_TYPE_SIZE (PEMRARCTO, 4) + TEST_TYPE_ALIGN (PEMRARCTO, 4) + TEST_TARGET_SIZE (PEMRARCTO, 40) + TEST_TARGET_ALIGN(PEMRARCTO, 4) +} + +static void test_pack_PEMRBEGINPATH(void) +{ + /* PEMRBEGINPATH */ + TEST_TYPE_SIZE (PEMRBEGINPATH, 4) + TEST_TYPE_ALIGN (PEMRBEGINPATH, 4) + TEST_TARGET_SIZE (PEMRBEGINPATH, 8) + TEST_TARGET_ALIGN(PEMRBEGINPATH, 4) +} + +static void test_pack_PEMRBITBLT(void) +{ + /* PEMRBITBLT */ + TEST_TYPE_SIZE (PEMRBITBLT, 4) + TEST_TYPE_ALIGN (PEMRBITBLT, 4) + TEST_TARGET_SIZE (PEMRBITBLT, 100) + TEST_TARGET_ALIGN(PEMRBITBLT, 4) +} + +static void test_pack_PEMRCHORD(void) +{ + /* PEMRCHORD */ + TEST_TYPE_SIZE (PEMRCHORD, 4) + TEST_TYPE_ALIGN (PEMRCHORD, 4) + TEST_TARGET_SIZE (PEMRCHORD, 40) + TEST_TARGET_ALIGN(PEMRCHORD, 4) +} + +static void test_pack_PEMRCLOSEFIGURE(void) +{ + /* PEMRCLOSEFIGURE */ + TEST_TYPE_SIZE (PEMRCLOSEFIGURE, 4) + TEST_TYPE_ALIGN (PEMRCLOSEFIGURE, 4) + TEST_TARGET_SIZE (PEMRCLOSEFIGURE, 8) + TEST_TARGET_ALIGN(PEMRCLOSEFIGURE, 4) +} + +static void test_pack_PEMRCREATEBRUSHINDIRECT(void) +{ + /* PEMRCREATEBRUSHINDIRECT */ + TEST_TYPE_SIZE (PEMRCREATEBRUSHINDIRECT, 4) + TEST_TYPE_ALIGN (PEMRCREATEBRUSHINDIRECT, 4) + TEST_TARGET_SIZE (PEMRCREATEBRUSHINDIRECT, 24) + TEST_TARGET_ALIGN(PEMRCREATEBRUSHINDIRECT, 4) +} + +static void test_pack_PEMRCREATECOLORSPACE(void) +{ + /* PEMRCREATECOLORSPACE */ + TEST_TYPE_SIZE (PEMRCREATECOLORSPACE, 4) + TEST_TYPE_ALIGN (PEMRCREATECOLORSPACE, 4) + TEST_TARGET_SIZE (PEMRCREATECOLORSPACE, 340) + TEST_TARGET_ALIGN(PEMRCREATECOLORSPACE, 4) +} + +static void test_pack_PEMRCREATECOLORSPACEW(void) +{ + /* PEMRCREATECOLORSPACEW */ + TEST_TYPE_SIZE (PEMRCREATECOLORSPACEW, 4) + TEST_TYPE_ALIGN (PEMRCREATECOLORSPACEW, 4) + TEST_TARGET_SIZE (PEMRCREATECOLORSPACEW, 612) + TEST_TARGET_ALIGN(PEMRCREATECOLORSPACEW, 4) +} + +static void test_pack_PEMRCREATEDIBPATTERNBRUSHPT(void) +{ + /* PEMRCREATEDIBPATTERNBRUSHPT */ + TEST_TYPE_SIZE (PEMRCREATEDIBPATTERNBRUSHPT, 4) + TEST_TYPE_ALIGN (PEMRCREATEDIBPATTERNBRUSHPT, 4) + TEST_TARGET_SIZE (PEMRCREATEDIBPATTERNBRUSHPT, 32) + TEST_TARGET_ALIGN(PEMRCREATEDIBPATTERNBRUSHPT, 4) +} + +static void test_pack_PEMRCREATEMONOBRUSH(void) +{ + /* PEMRCREATEMONOBRUSH */ + TEST_TYPE_SIZE (PEMRCREATEMONOBRUSH, 4) + TEST_TYPE_ALIGN (PEMRCREATEMONOBRUSH, 4) + TEST_TARGET_SIZE (PEMRCREATEMONOBRUSH, 32) + TEST_TARGET_ALIGN(PEMRCREATEMONOBRUSH, 4) +} + +static void test_pack_PEMRCREATEPALETTE(void) +{ + /* PEMRCREATEPALETTE */ + TEST_TYPE_SIZE (PEMRCREATEPALETTE, 4) + TEST_TYPE_ALIGN (PEMRCREATEPALETTE, 4) + TEST_TARGET_SIZE (PEMRCREATEPALETTE, 20) + TEST_TARGET_ALIGN(PEMRCREATEPALETTE, 4) +} + +static void test_pack_PEMRCREATEPEN(void) +{ + /* PEMRCREATEPEN */ + TEST_TYPE_SIZE (PEMRCREATEPEN, 4) + TEST_TYPE_ALIGN (PEMRCREATEPEN, 4) + TEST_TARGET_SIZE (PEMRCREATEPEN, 28) + TEST_TARGET_ALIGN(PEMRCREATEPEN, 4) +} + +static void test_pack_PEMRDELETECOLORSPACE(void) +{ + /* PEMRDELETECOLORSPACE */ + TEST_TYPE_SIZE (PEMRDELETECOLORSPACE, 4) + TEST_TYPE_ALIGN (PEMRDELETECOLORSPACE, 4) + TEST_TARGET_SIZE (PEMRDELETECOLORSPACE, 12) + TEST_TARGET_ALIGN(PEMRDELETECOLORSPACE, 4) +} + +static void test_pack_PEMRDELETEOBJECT(void) +{ + /* PEMRDELETEOBJECT */ + TEST_TYPE_SIZE (PEMRDELETEOBJECT, 4) + TEST_TYPE_ALIGN (PEMRDELETEOBJECT, 4) + TEST_TARGET_SIZE (PEMRDELETEOBJECT, 12) + TEST_TARGET_ALIGN(PEMRDELETEOBJECT, 4) +} + +static void test_pack_PEMRELLIPSE(void) +{ + /* PEMRELLIPSE */ + TEST_TYPE_SIZE (PEMRELLIPSE, 4) + TEST_TYPE_ALIGN (PEMRELLIPSE, 4) + TEST_TARGET_SIZE (PEMRELLIPSE, 24) + TEST_TARGET_ALIGN(PEMRELLIPSE, 4) +} + +static void test_pack_PEMRENDPATH(void) +{ + /* PEMRENDPATH */ + TEST_TYPE_SIZE (PEMRENDPATH, 4) + TEST_TYPE_ALIGN (PEMRENDPATH, 4) + TEST_TARGET_SIZE (PEMRENDPATH, 8) + TEST_TARGET_ALIGN(PEMRENDPATH, 4) +} + +static void test_pack_PEMREOF(void) +{ + /* PEMREOF */ + TEST_TYPE_SIZE (PEMREOF, 4) + TEST_TYPE_ALIGN (PEMREOF, 4) + TEST_TARGET_SIZE (PEMREOF, 20) + TEST_TARGET_ALIGN(PEMREOF, 4) +} + +static void test_pack_PEMREXCLUDECLIPRECT(void) +{ + /* PEMREXCLUDECLIPRECT */ + TEST_TYPE_SIZE (PEMREXCLUDECLIPRECT, 4) + TEST_TYPE_ALIGN (PEMREXCLUDECLIPRECT, 4) + TEST_TARGET_SIZE (PEMREXCLUDECLIPRECT, 24) + TEST_TARGET_ALIGN(PEMREXCLUDECLIPRECT, 4) +} + +static void test_pack_PEMREXTCREATEFONTINDIRECTW(void) +{ + /* PEMREXTCREATEFONTINDIRECTW */ + TEST_TYPE_SIZE (PEMREXTCREATEFONTINDIRECTW, 4) + TEST_TYPE_ALIGN (PEMREXTCREATEFONTINDIRECTW, 4) + TEST_TARGET_SIZE (PEMREXTCREATEFONTINDIRECTW, 332) + TEST_TARGET_ALIGN(PEMREXTCREATEFONTINDIRECTW, 4) +} + +static void test_pack_PEMREXTCREATEPEN(void) +{ + /* PEMREXTCREATEPEN */ + TEST_TYPE_SIZE (PEMREXTCREATEPEN, 4) + TEST_TYPE_ALIGN (PEMREXTCREATEPEN, 4) + TEST_TARGET_SIZE (PEMREXTCREATEPEN, 56) + TEST_TARGET_ALIGN(PEMREXTCREATEPEN, 4) +} + +static void test_pack_PEMREXTFLOODFILL(void) +{ + /* PEMREXTFLOODFILL */ + TEST_TYPE_SIZE (PEMREXTFLOODFILL, 4) + TEST_TYPE_ALIGN (PEMREXTFLOODFILL, 4) + TEST_TARGET_SIZE (PEMREXTFLOODFILL, 24) + TEST_TARGET_ALIGN(PEMREXTFLOODFILL, 4) +} + +static void test_pack_PEMREXTSELECTCLIPRGN(void) +{ + /* PEMREXTSELECTCLIPRGN */ + TEST_TYPE_SIZE (PEMREXTSELECTCLIPRGN, 4) + TEST_TYPE_ALIGN (PEMREXTSELECTCLIPRGN, 4) + TEST_TARGET_SIZE (PEMREXTSELECTCLIPRGN, 20) + TEST_TARGET_ALIGN(PEMREXTSELECTCLIPRGN, 4) +} + +static void test_pack_PEMREXTTEXTOUTA(void) +{ + /* PEMREXTTEXTOUTA */ + TEST_TYPE_SIZE (PEMREXTTEXTOUTA, 4) + TEST_TYPE_ALIGN (PEMREXTTEXTOUTA, 4) + TEST_TARGET_SIZE (PEMREXTTEXTOUTA, 76) + TEST_TARGET_ALIGN(PEMREXTTEXTOUTA, 4) +} + +static void test_pack_PEMREXTTEXTOUTW(void) +{ + /* PEMREXTTEXTOUTW */ + TEST_TYPE_SIZE (PEMREXTTEXTOUTW, 4) + TEST_TYPE_ALIGN (PEMREXTTEXTOUTW, 4) + TEST_TARGET_SIZE (PEMREXTTEXTOUTW, 76) + TEST_TARGET_ALIGN(PEMREXTTEXTOUTW, 4) +} + +static void test_pack_PEMRFILLPATH(void) +{ + /* PEMRFILLPATH */ + TEST_TYPE_SIZE (PEMRFILLPATH, 4) + TEST_TYPE_ALIGN (PEMRFILLPATH, 4) + TEST_TARGET_SIZE (PEMRFILLPATH, 24) + TEST_TARGET_ALIGN(PEMRFILLPATH, 4) +} + +static void test_pack_PEMRFILLRGN(void) +{ + /* PEMRFILLRGN */ + TEST_TYPE_SIZE (PEMRFILLRGN, 4) + TEST_TYPE_ALIGN (PEMRFILLRGN, 4) + TEST_TARGET_SIZE (PEMRFILLRGN, 36) + TEST_TARGET_ALIGN(PEMRFILLRGN, 4) +} + +static void test_pack_PEMRFLATTENPATH(void) +{ + /* PEMRFLATTENPATH */ + TEST_TYPE_SIZE (PEMRFLATTENPATH, 4) + TEST_TYPE_ALIGN (PEMRFLATTENPATH, 4) + TEST_TARGET_SIZE (PEMRFLATTENPATH, 8) + TEST_TARGET_ALIGN(PEMRFLATTENPATH, 4) +} + +static void test_pack_PEMRFORMAT(void) +{ + /* PEMRFORMAT */ + TEST_TYPE_SIZE (PEMRFORMAT, 4) + TEST_TYPE_ALIGN (PEMRFORMAT, 4) + TEST_TARGET_SIZE (PEMRFORMAT, 16) + TEST_TARGET_ALIGN(PEMRFORMAT, 4) +} + +static void test_pack_PEMRFRAMERGN(void) +{ + /* PEMRFRAMERGN */ + TEST_TYPE_SIZE (PEMRFRAMERGN, 4) + TEST_TYPE_ALIGN (PEMRFRAMERGN, 4) + TEST_TARGET_SIZE (PEMRFRAMERGN, 44) + TEST_TARGET_ALIGN(PEMRFRAMERGN, 4) +} + +static void test_pack_PEMRGDICOMMENT(void) +{ + /* PEMRGDICOMMENT */ + TEST_TYPE_SIZE (PEMRGDICOMMENT, 4) + TEST_TYPE_ALIGN (PEMRGDICOMMENT, 4) + TEST_TARGET_SIZE (PEMRGDICOMMENT, 16) + TEST_TARGET_ALIGN(PEMRGDICOMMENT, 4) +} + +static void test_pack_PEMRGLSBOUNDEDRECORD(void) +{ + /* PEMRGLSBOUNDEDRECORD */ + TEST_TYPE_SIZE (PEMRGLSBOUNDEDRECORD, 4) + TEST_TYPE_ALIGN (PEMRGLSBOUNDEDRECORD, 4) + TEST_TARGET_SIZE (PEMRGLSBOUNDEDRECORD, 32) + TEST_TARGET_ALIGN(PEMRGLSBOUNDEDRECORD, 4) +} + +static void test_pack_PEMRGLSRECORD(void) +{ + /* PEMRGLSRECORD */ + TEST_TYPE_SIZE (PEMRGLSRECORD, 4) + TEST_TYPE_ALIGN (PEMRGLSRECORD, 4) + TEST_TARGET_SIZE (PEMRGLSRECORD, 16) + TEST_TARGET_ALIGN(PEMRGLSRECORD, 4) +} + +static void test_pack_PEMRINTERSECTCLIPRECT(void) +{ + /* PEMRINTERSECTCLIPRECT */ + TEST_TYPE_SIZE (PEMRINTERSECTCLIPRECT, 4) + TEST_TYPE_ALIGN (PEMRINTERSECTCLIPRECT, 4) + TEST_TARGET_SIZE (PEMRINTERSECTCLIPRECT, 24) + TEST_TARGET_ALIGN(PEMRINTERSECTCLIPRECT, 4) +} + +static void test_pack_PEMRINVERTRGN(void) +{ + /* PEMRINVERTRGN */ + TEST_TYPE_SIZE (PEMRINVERTRGN, 4) + TEST_TYPE_ALIGN (PEMRINVERTRGN, 4) + TEST_TARGET_SIZE (PEMRINVERTRGN, 32) + TEST_TARGET_ALIGN(PEMRINVERTRGN, 4) +} + +static void test_pack_PEMRLINETO(void) +{ + /* PEMRLINETO */ + TEST_TYPE_SIZE (PEMRLINETO, 4) + TEST_TYPE_ALIGN (PEMRLINETO, 4) + TEST_TARGET_SIZE (PEMRLINETO, 16) + TEST_TARGET_ALIGN(PEMRLINETO, 4) +} + +static void test_pack_PEMRMASKBLT(void) +{ + /* PEMRMASKBLT */ + TEST_TYPE_SIZE (PEMRMASKBLT, 4) + TEST_TYPE_ALIGN (PEMRMASKBLT, 4) + TEST_TARGET_SIZE (PEMRMASKBLT, 128) + TEST_TARGET_ALIGN(PEMRMASKBLT, 4) +} + +static void test_pack_PEMRMODIFYWORLDTRANSFORM(void) +{ + /* PEMRMODIFYWORLDTRANSFORM */ + TEST_TYPE_SIZE (PEMRMODIFYWORLDTRANSFORM, 4) + TEST_TYPE_ALIGN (PEMRMODIFYWORLDTRANSFORM, 4) + TEST_TARGET_SIZE (PEMRMODIFYWORLDTRANSFORM, 36) + TEST_TARGET_ALIGN(PEMRMODIFYWORLDTRANSFORM, 4) +} + +static void test_pack_PEMRMOVETOEX(void) +{ + /* PEMRMOVETOEX */ + TEST_TYPE_SIZE (PEMRMOVETOEX, 4) + TEST_TYPE_ALIGN (PEMRMOVETOEX, 4) + TEST_TARGET_SIZE (PEMRMOVETOEX, 16) + TEST_TARGET_ALIGN(PEMRMOVETOEX, 4) +} + +static void test_pack_PEMROFFSETCLIPRGN(void) +{ + /* PEMROFFSETCLIPRGN */ + TEST_TYPE_SIZE (PEMROFFSETCLIPRGN, 4) + TEST_TYPE_ALIGN (PEMROFFSETCLIPRGN, 4) + TEST_TARGET_SIZE (PEMROFFSETCLIPRGN, 16) + TEST_TARGET_ALIGN(PEMROFFSETCLIPRGN, 4) +} + +static void test_pack_PEMRPAINTRGN(void) +{ + /* PEMRPAINTRGN */ + TEST_TYPE_SIZE (PEMRPAINTRGN, 4) + TEST_TYPE_ALIGN (PEMRPAINTRGN, 4) + TEST_TARGET_SIZE (PEMRPAINTRGN, 32) + TEST_TARGET_ALIGN(PEMRPAINTRGN, 4) +} + +static void test_pack_PEMRPIE(void) +{ + /* PEMRPIE */ + TEST_TYPE_SIZE (PEMRPIE, 4) + TEST_TYPE_ALIGN (PEMRPIE, 4) + TEST_TARGET_SIZE (PEMRPIE, 40) + TEST_TARGET_ALIGN(PEMRPIE, 4) +} + +static void test_pack_PEMRPIXELFORMAT(void) +{ + /* PEMRPIXELFORMAT */ + TEST_TYPE_SIZE (PEMRPIXELFORMAT, 4) + TEST_TYPE_ALIGN (PEMRPIXELFORMAT, 4) + TEST_TARGET_SIZE (PEMRPIXELFORMAT, 48) + TEST_TARGET_ALIGN(PEMRPIXELFORMAT, 4) +} + +static void test_pack_PEMRPLGBLT(void) +{ + /* PEMRPLGBLT */ + TEST_TYPE_SIZE (PEMRPLGBLT, 4) + TEST_TYPE_ALIGN (PEMRPLGBLT, 4) + TEST_TARGET_SIZE (PEMRPLGBLT, 140) + TEST_TARGET_ALIGN(PEMRPLGBLT, 4) +} + +static void test_pack_PEMRPOLYBEZIER(void) +{ + /* PEMRPOLYBEZIER */ + TEST_TYPE_SIZE (PEMRPOLYBEZIER, 4) + TEST_TYPE_ALIGN (PEMRPOLYBEZIER, 4) + TEST_TARGET_SIZE (PEMRPOLYBEZIER, 36) + TEST_TARGET_ALIGN(PEMRPOLYBEZIER, 4) +} + +static void test_pack_PEMRPOLYBEZIER16(void) +{ + /* PEMRPOLYBEZIER16 */ + TEST_TYPE_SIZE (PEMRPOLYBEZIER16, 4) + TEST_TYPE_ALIGN (PEMRPOLYBEZIER16, 4) + TEST_TARGET_SIZE (PEMRPOLYBEZIER16, 32) + TEST_TARGET_ALIGN(PEMRPOLYBEZIER16, 4) +} + +static void test_pack_PEMRPOLYBEZIERTO(void) +{ + /* PEMRPOLYBEZIERTO */ + TEST_TYPE_SIZE (PEMRPOLYBEZIERTO, 4) + TEST_TYPE_ALIGN (PEMRPOLYBEZIERTO, 4) + TEST_TARGET_SIZE (PEMRPOLYBEZIERTO, 36) + TEST_TARGET_ALIGN(PEMRPOLYBEZIERTO, 4) +} + +static void test_pack_PEMRPOLYBEZIERTO16(void) +{ + /* PEMRPOLYBEZIERTO16 */ + TEST_TYPE_SIZE (PEMRPOLYBEZIERTO16, 4) + TEST_TYPE_ALIGN (PEMRPOLYBEZIERTO16, 4) + TEST_TARGET_SIZE (PEMRPOLYBEZIERTO16, 32) + TEST_TARGET_ALIGN(PEMRPOLYBEZIERTO16, 4) +} + +static void test_pack_PEMRPOLYDRAW(void) +{ + /* PEMRPOLYDRAW */ + TEST_TYPE_SIZE (PEMRPOLYDRAW, 4) + TEST_TYPE_ALIGN (PEMRPOLYDRAW, 4) + TEST_TARGET_SIZE (PEMRPOLYDRAW, 40) + TEST_TARGET_ALIGN(PEMRPOLYDRAW, 4) +} + +static void test_pack_PEMRPOLYDRAW16(void) +{ + /* PEMRPOLYDRAW16 */ + TEST_TYPE_SIZE (PEMRPOLYDRAW16, 4) + TEST_TYPE_ALIGN (PEMRPOLYDRAW16, 4) + TEST_TARGET_SIZE (PEMRPOLYDRAW16, 36) + TEST_TARGET_ALIGN(PEMRPOLYDRAW16, 4) +} + +static void test_pack_PEMRPOLYGON(void) +{ + /* PEMRPOLYGON */ + TEST_TYPE_SIZE (PEMRPOLYGON, 4) + TEST_TYPE_ALIGN (PEMRPOLYGON, 4) + TEST_TARGET_SIZE (PEMRPOLYGON, 36) + TEST_TARGET_ALIGN(PEMRPOLYGON, 4) +} + +static void test_pack_PEMRPOLYGON16(void) +{ + /* PEMRPOLYGON16 */ + TEST_TYPE_SIZE (PEMRPOLYGON16, 4) + TEST_TYPE_ALIGN (PEMRPOLYGON16, 4) + TEST_TARGET_SIZE (PEMRPOLYGON16, 32) + TEST_TARGET_ALIGN(PEMRPOLYGON16, 4) +} + +static void test_pack_PEMRPOLYLINE(void) +{ + /* PEMRPOLYLINE */ + TEST_TYPE_SIZE (PEMRPOLYLINE, 4) + TEST_TYPE_ALIGN (PEMRPOLYLINE, 4) + TEST_TARGET_SIZE (PEMRPOLYLINE, 36) + TEST_TARGET_ALIGN(PEMRPOLYLINE, 4) +} + +static void test_pack_PEMRPOLYLINE16(void) +{ + /* PEMRPOLYLINE16 */ + TEST_TYPE_SIZE (PEMRPOLYLINE16, 4) + TEST_TYPE_ALIGN (PEMRPOLYLINE16, 4) + TEST_TARGET_SIZE (PEMRPOLYLINE16, 32) + TEST_TARGET_ALIGN(PEMRPOLYLINE16, 4) +} + +static void test_pack_PEMRPOLYLINETO(void) +{ + /* PEMRPOLYLINETO */ + TEST_TYPE_SIZE (PEMRPOLYLINETO, 4) + TEST_TYPE_ALIGN (PEMRPOLYLINETO, 4) + TEST_TARGET_SIZE (PEMRPOLYLINETO, 36) + TEST_TARGET_ALIGN(PEMRPOLYLINETO, 4) +} + +static void test_pack_PEMRPOLYLINETO16(void) +{ + /* PEMRPOLYLINETO16 */ + TEST_TYPE_SIZE (PEMRPOLYLINETO16, 4) + TEST_TYPE_ALIGN (PEMRPOLYLINETO16, 4) + TEST_TARGET_SIZE (PEMRPOLYLINETO16, 32) + TEST_TARGET_ALIGN(PEMRPOLYLINETO16, 4) +} + +static void test_pack_PEMRPOLYPOLYGON(void) +{ + /* PEMRPOLYPOLYGON */ + TEST_TYPE_SIZE (PEMRPOLYPOLYGON, 4) + TEST_TYPE_ALIGN (PEMRPOLYPOLYGON, 4) + TEST_TARGET_SIZE (PEMRPOLYPOLYGON, 44) + TEST_TARGET_ALIGN(PEMRPOLYPOLYGON, 4) +} + +static void test_pack_PEMRPOLYPOLYGON16(void) +{ + /* PEMRPOLYPOLYGON16 */ + TEST_TYPE_SIZE (PEMRPOLYPOLYGON16, 4) + TEST_TYPE_ALIGN (PEMRPOLYPOLYGON16, 4) + TEST_TARGET_SIZE (PEMRPOLYPOLYGON16, 40) + TEST_TARGET_ALIGN(PEMRPOLYPOLYGON16, 4) +} + +static void test_pack_PEMRPOLYPOLYLINE(void) +{ + /* PEMRPOLYPOLYLINE */ + TEST_TYPE_SIZE (PEMRPOLYPOLYLINE, 4) + TEST_TYPE_ALIGN (PEMRPOLYPOLYLINE, 4) + TEST_TARGET_SIZE (PEMRPOLYPOLYLINE, 44) + TEST_TARGET_ALIGN(PEMRPOLYPOLYLINE, 4) +} + +static void test_pack_PEMRPOLYPOLYLINE16(void) +{ + /* PEMRPOLYPOLYLINE16 */ + TEST_TYPE_SIZE (PEMRPOLYPOLYLINE16, 4) + TEST_TYPE_ALIGN (PEMRPOLYPOLYLINE16, 4) + TEST_TARGET_SIZE (PEMRPOLYPOLYLINE16, 40) + TEST_TARGET_ALIGN(PEMRPOLYPOLYLINE16, 4) +} + +static void test_pack_PEMRPOLYTEXTOUTA(void) +{ + /* PEMRPOLYTEXTOUTA */ + TEST_TYPE_SIZE (PEMRPOLYTEXTOUTA, 4) + TEST_TYPE_ALIGN (PEMRPOLYTEXTOUTA, 4) + TEST_TARGET_SIZE (PEMRPOLYTEXTOUTA, 80) + TEST_TARGET_ALIGN(PEMRPOLYTEXTOUTA, 4) +} + +static void test_pack_PEMRPOLYTEXTOUTW(void) +{ + /* PEMRPOLYTEXTOUTW */ + TEST_TYPE_SIZE (PEMRPOLYTEXTOUTW, 4) + TEST_TYPE_ALIGN (PEMRPOLYTEXTOUTW, 4) + TEST_TARGET_SIZE (PEMRPOLYTEXTOUTW, 80) + TEST_TARGET_ALIGN(PEMRPOLYTEXTOUTW, 4) +} + +static void test_pack_PEMRREALIZEPALETTE(void) +{ + /* PEMRREALIZEPALETTE */ + TEST_TYPE_SIZE (PEMRREALIZEPALETTE, 4) + TEST_TYPE_ALIGN (PEMRREALIZEPALETTE, 4) + TEST_TARGET_SIZE (PEMRREALIZEPALETTE, 8) + TEST_TARGET_ALIGN(PEMRREALIZEPALETTE, 4) +} + +static void test_pack_PEMRRECTANGLE(void) +{ + /* PEMRRECTANGLE */ + TEST_TYPE_SIZE (PEMRRECTANGLE, 4) + TEST_TYPE_ALIGN (PEMRRECTANGLE, 4) + TEST_TARGET_SIZE (PEMRRECTANGLE, 24) + TEST_TARGET_ALIGN(PEMRRECTANGLE, 4) +} + +static void test_pack_PEMRRESIZEPALETTE(void) +{ + /* PEMRRESIZEPALETTE */ + TEST_TYPE_SIZE (PEMRRESIZEPALETTE, 4) + TEST_TYPE_ALIGN (PEMRRESIZEPALETTE, 4) + TEST_TARGET_SIZE (PEMRRESIZEPALETTE, 16) + TEST_TARGET_ALIGN(PEMRRESIZEPALETTE, 4) +} + +static void test_pack_PEMRRESTOREDC(void) +{ + /* PEMRRESTOREDC */ + TEST_TYPE_SIZE (PEMRRESTOREDC, 4) + TEST_TYPE_ALIGN (PEMRRESTOREDC, 4) + TEST_TARGET_SIZE (PEMRRESTOREDC, 12) + TEST_TARGET_ALIGN(PEMRRESTOREDC, 4) +} + +static void test_pack_PEMRROUNDRECT(void) +{ + /* PEMRROUNDRECT */ + TEST_TYPE_SIZE (PEMRROUNDRECT, 4) + TEST_TYPE_ALIGN (PEMRROUNDRECT, 4) + TEST_TARGET_SIZE (PEMRROUNDRECT, 32) + TEST_TARGET_ALIGN(PEMRROUNDRECT, 4) +} + +static void test_pack_PEMRSAVEDC(void) +{ + /* PEMRSAVEDC */ + TEST_TYPE_SIZE (PEMRSAVEDC, 4) + TEST_TYPE_ALIGN (PEMRSAVEDC, 4) + TEST_TARGET_SIZE (PEMRSAVEDC, 8) + TEST_TARGET_ALIGN(PEMRSAVEDC, 4) +} + +static void test_pack_PEMRSCALEVIEWPORTEXTEX(void) +{ + /* PEMRSCALEVIEWPORTEXTEX */ + TEST_TYPE_SIZE (PEMRSCALEVIEWPORTEXTEX, 4) + TEST_TYPE_ALIGN (PEMRSCALEVIEWPORTEXTEX, 4) + TEST_TARGET_SIZE (PEMRSCALEVIEWPORTEXTEX, 24) + TEST_TARGET_ALIGN(PEMRSCALEVIEWPORTEXTEX, 4) +} + +static void test_pack_PEMRSCALEWINDOWEXTEX(void) +{ + /* PEMRSCALEWINDOWEXTEX */ + TEST_TYPE_SIZE (PEMRSCALEWINDOWEXTEX, 4) + TEST_TYPE_ALIGN (PEMRSCALEWINDOWEXTEX, 4) + TEST_TARGET_SIZE (PEMRSCALEWINDOWEXTEX, 24) + TEST_TARGET_ALIGN(PEMRSCALEWINDOWEXTEX, 4) +} + +static void test_pack_PEMRSELECTCLIPPATH(void) +{ + /* PEMRSELECTCLIPPATH */ + TEST_TYPE_SIZE (PEMRSELECTCLIPPATH, 4) + TEST_TYPE_ALIGN (PEMRSELECTCLIPPATH, 4) + TEST_TARGET_SIZE (PEMRSELECTCLIPPATH, 12) + TEST_TARGET_ALIGN(PEMRSELECTCLIPPATH, 4) +} + +static void test_pack_PEMRSELECTCOLORSPACE(void) +{ + /* PEMRSELECTCOLORSPACE */ + TEST_TYPE_SIZE (PEMRSELECTCOLORSPACE, 4) + TEST_TYPE_ALIGN (PEMRSELECTCOLORSPACE, 4) + TEST_TARGET_SIZE (PEMRSELECTCOLORSPACE, 12) + TEST_TARGET_ALIGN(PEMRSELECTCOLORSPACE, 4) +} + +static void test_pack_PEMRSELECTOBJECT(void) +{ + /* PEMRSELECTOBJECT */ + TEST_TYPE_SIZE (PEMRSELECTOBJECT, 4) + TEST_TYPE_ALIGN (PEMRSELECTOBJECT, 4) + TEST_TARGET_SIZE (PEMRSELECTOBJECT, 12) + TEST_TARGET_ALIGN(PEMRSELECTOBJECT, 4) +} + +static void test_pack_PEMRSELECTPALETTE(void) +{ + /* PEMRSELECTPALETTE */ + TEST_TYPE_SIZE (PEMRSELECTPALETTE, 4) + TEST_TYPE_ALIGN (PEMRSELECTPALETTE, 4) + TEST_TARGET_SIZE (PEMRSELECTPALETTE, 12) + TEST_TARGET_ALIGN(PEMRSELECTPALETTE, 4) +} + +static void test_pack_PEMRSETARCDIRECTION(void) +{ + /* PEMRSETARCDIRECTION */ + TEST_TYPE_SIZE (PEMRSETARCDIRECTION, 4) + TEST_TYPE_ALIGN (PEMRSETARCDIRECTION, 4) + TEST_TARGET_SIZE (PEMRSETARCDIRECTION, 12) + TEST_TARGET_ALIGN(PEMRSETARCDIRECTION, 4) +} + +static void test_pack_PEMRSETBKCOLOR(void) +{ + /* PEMRSETBKCOLOR */ + TEST_TYPE_SIZE (PEMRSETBKCOLOR, 4) + TEST_TYPE_ALIGN (PEMRSETBKCOLOR, 4) + TEST_TARGET_SIZE (PEMRSETBKCOLOR, 12) + TEST_TARGET_ALIGN(PEMRSETBKCOLOR, 4) +} + +static void test_pack_PEMRSETBKMODE(void) +{ + /* PEMRSETBKMODE */ + TEST_TYPE_SIZE (PEMRSETBKMODE, 4) + TEST_TYPE_ALIGN (PEMRSETBKMODE, 4) + TEST_TARGET_SIZE (PEMRSETBKMODE, 12) + TEST_TARGET_ALIGN(PEMRSETBKMODE, 4) +} + +static void test_pack_PEMRSETBRUSHORGEX(void) +{ + /* PEMRSETBRUSHORGEX */ + TEST_TYPE_SIZE (PEMRSETBRUSHORGEX, 4) + TEST_TYPE_ALIGN (PEMRSETBRUSHORGEX, 4) + TEST_TARGET_SIZE (PEMRSETBRUSHORGEX, 16) + TEST_TARGET_ALIGN(PEMRSETBRUSHORGEX, 4) +} + +static void test_pack_PEMRSETCOLORADJUSTMENT(void) +{ + /* PEMRSETCOLORADJUSTMENT */ + TEST_TYPE_SIZE (PEMRSETCOLORADJUSTMENT, 4) + TEST_TYPE_ALIGN (PEMRSETCOLORADJUSTMENT, 4) + TEST_TARGET_SIZE (PEMRSETCOLORADJUSTMENT, 32) + TEST_TARGET_ALIGN(PEMRSETCOLORADJUSTMENT, 4) +} + +static void test_pack_PEMRSETCOLORSPACE(void) +{ + /* PEMRSETCOLORSPACE */ + TEST_TYPE_SIZE (PEMRSETCOLORSPACE, 4) + TEST_TYPE_ALIGN (PEMRSETCOLORSPACE, 4) + TEST_TARGET_SIZE (PEMRSETCOLORSPACE, 12) + TEST_TARGET_ALIGN(PEMRSETCOLORSPACE, 4) +} + +static void test_pack_PEMRSETDIBITSTODEVICE(void) +{ + /* PEMRSETDIBITSTODEVICE */ + TEST_TYPE_SIZE (PEMRSETDIBITSTODEVICE, 4) + TEST_TYPE_ALIGN (PEMRSETDIBITSTODEVICE, 4) + TEST_TARGET_SIZE (PEMRSETDIBITSTODEVICE, 76) + TEST_TARGET_ALIGN(PEMRSETDIBITSTODEVICE, 4) +} + +static void test_pack_PEMRSETICMMODE(void) +{ + /* PEMRSETICMMODE */ + TEST_TYPE_SIZE (PEMRSETICMMODE, 4) + TEST_TYPE_ALIGN (PEMRSETICMMODE, 4) + TEST_TARGET_SIZE (PEMRSETICMMODE, 12) + TEST_TARGET_ALIGN(PEMRSETICMMODE, 4) +} + +static void test_pack_PEMRSETLAYOUT(void) +{ + /* PEMRSETLAYOUT */ + TEST_TYPE_SIZE (PEMRSETLAYOUT, 4) + TEST_TYPE_ALIGN (PEMRSETLAYOUT, 4) + TEST_TARGET_SIZE (PEMRSETLAYOUT, 12) + TEST_TARGET_ALIGN(PEMRSETLAYOUT, 4) +} + +static void test_pack_PEMRSETMAPMODE(void) +{ + /* PEMRSETMAPMODE */ + TEST_TYPE_SIZE (PEMRSETMAPMODE, 4) + TEST_TYPE_ALIGN (PEMRSETMAPMODE, 4) + TEST_TARGET_SIZE (PEMRSETMAPMODE, 12) + TEST_TARGET_ALIGN(PEMRSETMAPMODE, 4) +} + +static void test_pack_PEMRSETMAPPERFLAGS(void) +{ + /* PEMRSETMAPPERFLAGS */ + TEST_TYPE_SIZE (PEMRSETMAPPERFLAGS, 4) + TEST_TYPE_ALIGN (PEMRSETMAPPERFLAGS, 4) + TEST_TARGET_SIZE (PEMRSETMAPPERFLAGS, 12) + TEST_TARGET_ALIGN(PEMRSETMAPPERFLAGS, 4) +} + +static void test_pack_PEMRSETMETARGN(void) +{ + /* PEMRSETMETARGN */ + TEST_TYPE_SIZE (PEMRSETMETARGN, 4) + TEST_TYPE_ALIGN (PEMRSETMETARGN, 4) + TEST_TARGET_SIZE (PEMRSETMETARGN, 8) + TEST_TARGET_ALIGN(PEMRSETMETARGN, 4) +} + +static void test_pack_PEMRSETMITERLIMIT(void) +{ + /* PEMRSETMITERLIMIT */ + TEST_TYPE_SIZE (PEMRSETMITERLIMIT, 4) + TEST_TYPE_ALIGN (PEMRSETMITERLIMIT, 4) + TEST_TARGET_SIZE (PEMRSETMITERLIMIT, 12) + TEST_TARGET_ALIGN(PEMRSETMITERLIMIT, 4) +} + +static void test_pack_PEMRSETPALETTEENTRIES(void) +{ + /* PEMRSETPALETTEENTRIES */ + TEST_TYPE_SIZE (PEMRSETPALETTEENTRIES, 4) + TEST_TYPE_ALIGN (PEMRSETPALETTEENTRIES, 4) + TEST_TARGET_SIZE (PEMRSETPALETTEENTRIES, 24) + TEST_TARGET_ALIGN(PEMRSETPALETTEENTRIES, 4) +} + +static void test_pack_PEMRSETPIXELV(void) +{ + /* PEMRSETPIXELV */ + TEST_TYPE_SIZE (PEMRSETPIXELV, 4) + TEST_TYPE_ALIGN (PEMRSETPIXELV, 4) + TEST_TARGET_SIZE (PEMRSETPIXELV, 20) + TEST_TARGET_ALIGN(PEMRSETPIXELV, 4) +} + +static void test_pack_PEMRSETPOLYFILLMODE(void) +{ + /* PEMRSETPOLYFILLMODE */ + TEST_TYPE_SIZE (PEMRSETPOLYFILLMODE, 4) + TEST_TYPE_ALIGN (PEMRSETPOLYFILLMODE, 4) + TEST_TARGET_SIZE (PEMRSETPOLYFILLMODE, 12) + TEST_TARGET_ALIGN(PEMRSETPOLYFILLMODE, 4) +} + +static void test_pack_PEMRSETROP2(void) +{ + /* PEMRSETROP2 */ + TEST_TYPE_SIZE (PEMRSETROP2, 4) + TEST_TYPE_ALIGN (PEMRSETROP2, 4) + TEST_TARGET_SIZE (PEMRSETROP2, 12) + TEST_TARGET_ALIGN(PEMRSETROP2, 4) +} + +static void test_pack_PEMRSETSTRETCHBLTMODE(void) +{ + /* PEMRSETSTRETCHBLTMODE */ + TEST_TYPE_SIZE (PEMRSETSTRETCHBLTMODE, 4) + TEST_TYPE_ALIGN (PEMRSETSTRETCHBLTMODE, 4) + TEST_TARGET_SIZE (PEMRSETSTRETCHBLTMODE, 12) + TEST_TARGET_ALIGN(PEMRSETSTRETCHBLTMODE, 4) +} + +static void test_pack_PEMRSETTEXTALIGN(void) +{ + /* PEMRSETTEXTALIGN */ + TEST_TYPE_SIZE (PEMRSETTEXTALIGN, 4) + TEST_TYPE_ALIGN (PEMRSETTEXTALIGN, 4) + TEST_TARGET_SIZE (PEMRSETTEXTALIGN, 12) + TEST_TARGET_ALIGN(PEMRSETTEXTALIGN, 4) +} + +static void test_pack_PEMRSETTEXTCOLOR(void) +{ + /* PEMRSETTEXTCOLOR */ + TEST_TYPE_SIZE (PEMRSETTEXTCOLOR, 4) + TEST_TYPE_ALIGN (PEMRSETTEXTCOLOR, 4) + TEST_TARGET_SIZE (PEMRSETTEXTCOLOR, 12) + TEST_TARGET_ALIGN(PEMRSETTEXTCOLOR, 4) +} + +static void test_pack_PEMRSETVIEWPORTEXTEX(void) +{ + /* PEMRSETVIEWPORTEXTEX */ + TEST_TYPE_SIZE (PEMRSETVIEWPORTEXTEX, 4) + TEST_TYPE_ALIGN (PEMRSETVIEWPORTEXTEX, 4) + TEST_TARGET_SIZE (PEMRSETVIEWPORTEXTEX, 16) + TEST_TARGET_ALIGN(PEMRSETVIEWPORTEXTEX, 4) +} + +static void test_pack_PEMRSETVIEWPORTORGEX(void) +{ + /* PEMRSETVIEWPORTORGEX */ + TEST_TYPE_SIZE (PEMRSETVIEWPORTORGEX, 4) + TEST_TYPE_ALIGN (PEMRSETVIEWPORTORGEX, 4) + TEST_TARGET_SIZE (PEMRSETVIEWPORTORGEX, 16) + TEST_TARGET_ALIGN(PEMRSETVIEWPORTORGEX, 4) +} + +static void test_pack_PEMRSETWINDOWEXTEX(void) +{ + /* PEMRSETWINDOWEXTEX */ + TEST_TYPE_SIZE (PEMRSETWINDOWEXTEX, 4) + TEST_TYPE_ALIGN (PEMRSETWINDOWEXTEX, 4) + TEST_TARGET_SIZE (PEMRSETWINDOWEXTEX, 16) + TEST_TARGET_ALIGN(PEMRSETWINDOWEXTEX, 4) +} + +static void test_pack_PEMRSETWINDOWORGEX(void) +{ + /* PEMRSETWINDOWORGEX */ + TEST_TYPE_SIZE (PEMRSETWINDOWORGEX, 4) + TEST_TYPE_ALIGN (PEMRSETWINDOWORGEX, 4) + TEST_TARGET_SIZE (PEMRSETWINDOWORGEX, 16) + TEST_TARGET_ALIGN(PEMRSETWINDOWORGEX, 4) +} + +static void test_pack_PEMRSETWORLDTRANSFORM(void) +{ + /* PEMRSETWORLDTRANSFORM */ + TEST_TYPE_SIZE (PEMRSETWORLDTRANSFORM, 4) + TEST_TYPE_ALIGN (PEMRSETWORLDTRANSFORM, 4) + TEST_TARGET_SIZE (PEMRSETWORLDTRANSFORM, 32) + TEST_TARGET_ALIGN(PEMRSETWORLDTRANSFORM, 4) +} + +static void test_pack_PEMRSTRETCHBLT(void) +{ + /* PEMRSTRETCHBLT */ + TEST_TYPE_SIZE (PEMRSTRETCHBLT, 4) + TEST_TYPE_ALIGN (PEMRSTRETCHBLT, 4) + TEST_TARGET_SIZE (PEMRSTRETCHBLT, 108) + TEST_TARGET_ALIGN(PEMRSTRETCHBLT, 4) +} + +static void test_pack_PEMRSTRETCHDIBITS(void) +{ + /* PEMRSTRETCHDIBITS */ + TEST_TYPE_SIZE (PEMRSTRETCHDIBITS, 4) + TEST_TYPE_ALIGN (PEMRSTRETCHDIBITS, 4) + TEST_TARGET_SIZE (PEMRSTRETCHDIBITS, 80) + TEST_TARGET_ALIGN(PEMRSTRETCHDIBITS, 4) +} + +static void test_pack_PEMRSTROKEANDFILLPATH(void) +{ + /* PEMRSTROKEANDFILLPATH */ + TEST_TYPE_SIZE (PEMRSTROKEANDFILLPATH, 4) + TEST_TYPE_ALIGN (PEMRSTROKEANDFILLPATH, 4) + TEST_TARGET_SIZE (PEMRSTROKEANDFILLPATH, 24) + TEST_TARGET_ALIGN(PEMRSTROKEANDFILLPATH, 4) +} + +static void test_pack_PEMRSTROKEPATH(void) +{ + /* PEMRSTROKEPATH */ + TEST_TYPE_SIZE (PEMRSTROKEPATH, 4) + TEST_TYPE_ALIGN (PEMRSTROKEPATH, 4) + TEST_TARGET_SIZE (PEMRSTROKEPATH, 24) + TEST_TARGET_ALIGN(PEMRSTROKEPATH, 4) +} + +static void test_pack_PEMRTEXT(void) +{ + /* PEMRTEXT */ + TEST_TYPE_SIZE (PEMRTEXT, 4) + TEST_TYPE_ALIGN (PEMRTEXT, 4) + TEST_TARGET_SIZE (PEMRTEXT, 40) + TEST_TARGET_ALIGN(PEMRTEXT, 4) +} + +static void test_pack_PEMRWIDENPATH(void) +{ + /* PEMRWIDENPATH */ + TEST_TYPE_SIZE (PEMRWIDENPATH, 4) + TEST_TYPE_ALIGN (PEMRWIDENPATH, 4) + TEST_TARGET_SIZE (PEMRWIDENPATH, 8) + TEST_TARGET_ALIGN(PEMRWIDENPATH, 4) +} + +static void test_pack_PENHMETAHEADER(void) +{ + /* PENHMETAHEADER */ + TEST_TYPE_SIZE (PENHMETAHEADER, 4) + TEST_TYPE_ALIGN (PENHMETAHEADER, 4) + TEST_TARGET_SIZE (PENHMETAHEADER, 108) + TEST_TARGET_ALIGN(PENHMETAHEADER, 4) +} + +static void test_pack_PEXTLOGFONTA(void) +{ + /* PEXTLOGFONTA */ + TEST_TYPE_SIZE (PEXTLOGFONTA, 4) + TEST_TYPE_ALIGN (PEXTLOGFONTA, 4) + TEST_TARGET_SIZE (PEXTLOGFONTA, 192) + TEST_TARGET_ALIGN(PEXTLOGFONTA, 4) +} + +static void test_pack_PEXTLOGFONTW(void) +{ + /* PEXTLOGFONTW */ + TEST_TYPE_SIZE (PEXTLOGFONTW, 4) + TEST_TYPE_ALIGN (PEXTLOGFONTW, 4) + TEST_TARGET_SIZE (PEXTLOGFONTW, 320) + TEST_TARGET_ALIGN(PEXTLOGFONTW, 4) +} + +static void test_pack_PEXTLOGPEN(void) +{ + /* PEXTLOGPEN */ + TEST_TYPE_SIZE (PEXTLOGPEN, 4) + TEST_TYPE_ALIGN (PEXTLOGPEN, 4) + TEST_TARGET_SIZE (PEXTLOGPEN, 28) + TEST_TARGET_ALIGN(PEXTLOGPEN, 4) +} + +static void test_pack_PFONTSIGNATURE(void) +{ + /* PFONTSIGNATURE */ + TEST_TYPE_SIZE (PFONTSIGNATURE, 4) + TEST_TYPE_ALIGN (PFONTSIGNATURE, 4) + TEST_TARGET_SIZE (PFONTSIGNATURE, 24) + TEST_TARGET_ALIGN(PFONTSIGNATURE, 4) +} + +static void test_pack_PGLYPHMETRICSFLOAT(void) +{ + /* PGLYPHMETRICSFLOAT */ + TEST_TYPE_SIZE (PGLYPHMETRICSFLOAT, 4) + TEST_TYPE_ALIGN (PGLYPHMETRICSFLOAT, 4) + TEST_TARGET_SIZE (PGLYPHMETRICSFLOAT, 24) + TEST_TARGET_ALIGN(PGLYPHMETRICSFLOAT, 4) +} + +static void test_pack_PGRADIENT_RECT(void) +{ + /* PGRADIENT_RECT */ + TEST_TYPE_SIZE (PGRADIENT_RECT, 4) + TEST_TYPE_ALIGN (PGRADIENT_RECT, 4) + TEST_TARGET_SIZE (PGRADIENT_RECT, 8) + TEST_TARGET_ALIGN(PGRADIENT_RECT, 4) +} + +static void test_pack_PGRADIENT_TRIANGLE(void) +{ + /* PGRADIENT_TRIANGLE */ + TEST_TYPE_SIZE (PGRADIENT_TRIANGLE, 4) + TEST_TYPE_ALIGN (PGRADIENT_TRIANGLE, 4) + TEST_TARGET_SIZE (PGRADIENT_TRIANGLE, 12) + TEST_TARGET_ALIGN(PGRADIENT_TRIANGLE, 4) +} + +static void test_pack_PHANDLETABLE(void) +{ + /* PHANDLETABLE */ + TEST_TYPE_SIZE (PHANDLETABLE, 4) + TEST_TYPE_ALIGN (PHANDLETABLE, 4) + TEST_TARGET_SIZE (PHANDLETABLE, 4) + TEST_TARGET_ALIGN(PHANDLETABLE, 4) +} + +static void test_pack_PIXELFORMATDESCRIPTOR(void) +{ + /* PIXELFORMATDESCRIPTOR (pack 4) */ + TEST_TYPE_SIZE (PIXELFORMATDESCRIPTOR, 40) + TEST_TYPE_ALIGN (PIXELFORMATDESCRIPTOR, 4) + TEST_FIELD_SIZE (PIXELFORMATDESCRIPTOR, nSize, 2) + TEST_FIELD_ALIGN (PIXELFORMATDESCRIPTOR, nSize, 2) + TEST_FIELD_OFFSET(PIXELFORMATDESCRIPTOR, nSize, 0) + TEST_FIELD_SIZE (PIXELFORMATDESCRIPTOR, nVersion, 2) + TEST_FIELD_ALIGN (PIXELFORMATDESCRIPTOR, nVersion, 2) + TEST_FIELD_OFFSET(PIXELFORMATDESCRIPTOR, nVersion, 2) + TEST_FIELD_SIZE (PIXELFORMATDESCRIPTOR, dwFlags, 4) + TEST_FIELD_ALIGN (PIXELFORMATDESCRIPTOR, dwFlags, 4) + TEST_FIELD_OFFSET(PIXELFORMATDESCRIPTOR, dwFlags, 4) + TEST_FIELD_SIZE (PIXELFORMATDESCRIPTOR, iPixelType, 1) + TEST_FIELD_ALIGN (PIXELFORMATDESCRIPTOR, iPixelType, 1) + TEST_FIELD_OFFSET(PIXELFORMATDESCRIPTOR, iPixelType, 8) + TEST_FIELD_SIZE (PIXELFORMATDESCRIPTOR, cColorBits, 1) + TEST_FIELD_ALIGN (PIXELFORMATDESCRIPTOR, cColorBits, 1) + TEST_FIELD_OFFSET(PIXELFORMATDESCRIPTOR, cColorBits, 9) + TEST_FIELD_SIZE (PIXELFORMATDESCRIPTOR, cRedBits, 1) + TEST_FIELD_ALIGN (PIXELFORMATDESCRIPTOR, cRedBits, 1) + TEST_FIELD_OFFSET(PIXELFORMATDESCRIPTOR, cRedBits, 10) + TEST_FIELD_SIZE (PIXELFORMATDESCRIPTOR, cRedShift, 1) + TEST_FIELD_ALIGN (PIXELFORMATDESCRIPTOR, cRedShift, 1) + TEST_FIELD_OFFSET(PIXELFORMATDESCRIPTOR, cRedShift, 11) + TEST_FIELD_SIZE (PIXELFORMATDESCRIPTOR, cGreenBits, 1) + TEST_FIELD_ALIGN (PIXELFORMATDESCRIPTOR, cGreenBits, 1) + TEST_FIELD_OFFSET(PIXELFORMATDESCRIPTOR, cGreenBits, 12) + TEST_FIELD_SIZE (PIXELFORMATDESCRIPTOR, cGreenShift, 1) + TEST_FIELD_ALIGN (PIXELFORMATDESCRIPTOR, cGreenShift, 1) + TEST_FIELD_OFFSET(PIXELFORMATDESCRIPTOR, cGreenShift, 13) + TEST_FIELD_SIZE (PIXELFORMATDESCRIPTOR, cBlueBits, 1) + TEST_FIELD_ALIGN (PIXELFORMATDESCRIPTOR, cBlueBits, 1) + TEST_FIELD_OFFSET(PIXELFORMATDESCRIPTOR, cBlueBits, 14) + TEST_FIELD_SIZE (PIXELFORMATDESCRIPTOR, cBlueShift, 1) + TEST_FIELD_ALIGN (PIXELFORMATDESCRIPTOR, cBlueShift, 1) + TEST_FIELD_OFFSET(PIXELFORMATDESCRIPTOR, cBlueShift, 15) + TEST_FIELD_SIZE (PIXELFORMATDESCRIPTOR, cAlphaBits, 1) + TEST_FIELD_ALIGN (PIXELFORMATDESCRIPTOR, cAlphaBits, 1) + TEST_FIELD_OFFSET(PIXELFORMATDESCRIPTOR, cAlphaBits, 16) + TEST_FIELD_SIZE (PIXELFORMATDESCRIPTOR, cAlphaShift, 1) + TEST_FIELD_ALIGN (PIXELFORMATDESCRIPTOR, cAlphaShift, 1) + TEST_FIELD_OFFSET(PIXELFORMATDESCRIPTOR, cAlphaShift, 17) + TEST_FIELD_SIZE (PIXELFORMATDESCRIPTOR, cAccumBits, 1) + TEST_FIELD_ALIGN (PIXELFORMATDESCRIPTOR, cAccumBits, 1) + TEST_FIELD_OFFSET(PIXELFORMATDESCRIPTOR, cAccumBits, 18) + TEST_FIELD_SIZE (PIXELFORMATDESCRIPTOR, cAccumRedBits, 1) + TEST_FIELD_ALIGN (PIXELFORMATDESCRIPTOR, cAccumRedBits, 1) + TEST_FIELD_OFFSET(PIXELFORMATDESCRIPTOR, cAccumRedBits, 19) + TEST_FIELD_SIZE (PIXELFORMATDESCRIPTOR, cAccumGreenBits, 1) + TEST_FIELD_ALIGN (PIXELFORMATDESCRIPTOR, cAccumGreenBits, 1) + TEST_FIELD_OFFSET(PIXELFORMATDESCRIPTOR, cAccumGreenBits, 20) + TEST_FIELD_SIZE (PIXELFORMATDESCRIPTOR, cAccumBlueBits, 1) + TEST_FIELD_ALIGN (PIXELFORMATDESCRIPTOR, cAccumBlueBits, 1) + TEST_FIELD_OFFSET(PIXELFORMATDESCRIPTOR, cAccumBlueBits, 21) + TEST_FIELD_SIZE (PIXELFORMATDESCRIPTOR, cAccumAlphaBits, 1) + TEST_FIELD_ALIGN (PIXELFORMATDESCRIPTOR, cAccumAlphaBits, 1) + TEST_FIELD_OFFSET(PIXELFORMATDESCRIPTOR, cAccumAlphaBits, 22) + TEST_FIELD_SIZE (PIXELFORMATDESCRIPTOR, cDepthBits, 1) + TEST_FIELD_ALIGN (PIXELFORMATDESCRIPTOR, cDepthBits, 1) + TEST_FIELD_OFFSET(PIXELFORMATDESCRIPTOR, cDepthBits, 23) + TEST_FIELD_SIZE (PIXELFORMATDESCRIPTOR, cStencilBits, 1) + TEST_FIELD_ALIGN (PIXELFORMATDESCRIPTOR, cStencilBits, 1) + TEST_FIELD_OFFSET(PIXELFORMATDESCRIPTOR, cStencilBits, 24) + TEST_FIELD_SIZE (PIXELFORMATDESCRIPTOR, cAuxBuffers, 1) + TEST_FIELD_ALIGN (PIXELFORMATDESCRIPTOR, cAuxBuffers, 1) + TEST_FIELD_OFFSET(PIXELFORMATDESCRIPTOR, cAuxBuffers, 25) + TEST_FIELD_SIZE (PIXELFORMATDESCRIPTOR, iLayerType, 1) + TEST_FIELD_ALIGN (PIXELFORMATDESCRIPTOR, iLayerType, 1) + TEST_FIELD_OFFSET(PIXELFORMATDESCRIPTOR, iLayerType, 26) + TEST_FIELD_SIZE (PIXELFORMATDESCRIPTOR, bReserved, 1) + TEST_FIELD_ALIGN (PIXELFORMATDESCRIPTOR, bReserved, 1) + TEST_FIELD_OFFSET(PIXELFORMATDESCRIPTOR, bReserved, 27) + TEST_FIELD_SIZE (PIXELFORMATDESCRIPTOR, dwLayerMask, 4) + TEST_FIELD_ALIGN (PIXELFORMATDESCRIPTOR, dwLayerMask, 4) + TEST_FIELD_OFFSET(PIXELFORMATDESCRIPTOR, dwLayerMask, 28) + TEST_FIELD_SIZE (PIXELFORMATDESCRIPTOR, dwVisibleMask, 4) + TEST_FIELD_ALIGN (PIXELFORMATDESCRIPTOR, dwVisibleMask, 4) + TEST_FIELD_OFFSET(PIXELFORMATDESCRIPTOR, dwVisibleMask, 32) + TEST_FIELD_SIZE (PIXELFORMATDESCRIPTOR, dwDamageMask, 4) + TEST_FIELD_ALIGN (PIXELFORMATDESCRIPTOR, dwDamageMask, 4) + TEST_FIELD_OFFSET(PIXELFORMATDESCRIPTOR, dwDamageMask, 36) +} + +static void test_pack_PLAYERPLANEDESCRIPTOR(void) +{ + /* PLAYERPLANEDESCRIPTOR */ + TEST_TYPE_SIZE (PLAYERPLANEDESCRIPTOR, 4) + TEST_TYPE_ALIGN (PLAYERPLANEDESCRIPTOR, 4) + TEST_TARGET_SIZE (PLAYERPLANEDESCRIPTOR, 32) + TEST_TARGET_ALIGN(PLAYERPLANEDESCRIPTOR, 4) +} + +static void test_pack_PLOCALESIGNATURE(void) +{ + /* PLOCALESIGNATURE */ + TEST_TYPE_SIZE (PLOCALESIGNATURE, 4) + TEST_TYPE_ALIGN (PLOCALESIGNATURE, 4) + TEST_TARGET_SIZE (PLOCALESIGNATURE, 32) + TEST_TARGET_ALIGN(PLOCALESIGNATURE, 4) +} + +static void test_pack_PLOGBRUSH(void) +{ + /* PLOGBRUSH */ + TEST_TYPE_SIZE (PLOGBRUSH, 4) + TEST_TYPE_ALIGN (PLOGBRUSH, 4) + TEST_TARGET_SIZE (PLOGBRUSH, 12) + TEST_TARGET_ALIGN(PLOGBRUSH, 4) +} + +static void test_pack_PLOGFONTA(void) +{ + /* PLOGFONTA */ + TEST_TYPE_SIZE (PLOGFONTA, 4) + TEST_TYPE_ALIGN (PLOGFONTA, 4) + TEST_TARGET_SIZE (PLOGFONTA, 60) + TEST_TARGET_ALIGN(PLOGFONTA, 4) +} + +static void test_pack_PLOGFONTW(void) +{ + /* PLOGFONTW */ + TEST_TYPE_SIZE (PLOGFONTW, 4) + TEST_TYPE_ALIGN (PLOGFONTW, 4) + TEST_TARGET_SIZE (PLOGFONTW, 92) + TEST_TARGET_ALIGN(PLOGFONTW, 4) +} + +static void test_pack_PMETAHEADER(void) +{ + /* PMETAHEADER */ + TEST_TYPE_SIZE (PMETAHEADER, 4) + TEST_TYPE_ALIGN (PMETAHEADER, 4) + TEST_TARGET_SIZE (PMETAHEADER, 18) + TEST_TARGET_ALIGN(PMETAHEADER, 2) +} + +static void test_pack_PMETARECORD(void) +{ + /* PMETARECORD */ + TEST_TYPE_SIZE (PMETARECORD, 4) + TEST_TYPE_ALIGN (PMETARECORD, 4) + TEST_TARGET_SIZE (PMETARECORD, 8) + TEST_TARGET_ALIGN(PMETARECORD, 4) +} + +static void test_pack_PNEWTEXTMETRICA(void) +{ + /* PNEWTEXTMETRICA */ + TEST_TYPE_SIZE (PNEWTEXTMETRICA, 4) + TEST_TYPE_ALIGN (PNEWTEXTMETRICA, 4) + TEST_TARGET_SIZE (PNEWTEXTMETRICA, 72) + TEST_TARGET_ALIGN(PNEWTEXTMETRICA, 4) +} + +static void test_pack_PNEWTEXTMETRICW(void) +{ + /* PNEWTEXTMETRICW */ + TEST_TYPE_SIZE (PNEWTEXTMETRICW, 4) + TEST_TYPE_ALIGN (PNEWTEXTMETRICW, 4) + TEST_TARGET_SIZE (PNEWTEXTMETRICW, 76) + TEST_TARGET_ALIGN(PNEWTEXTMETRICW, 4) +} + +static void test_pack_POINTFLOAT(void) +{ + /* POINTFLOAT (pack 4) */ + TEST_TYPE_SIZE (POINTFLOAT, 8) + TEST_TYPE_ALIGN (POINTFLOAT, 4) + TEST_FIELD_SIZE (POINTFLOAT, x, 4) + TEST_FIELD_ALIGN (POINTFLOAT, x, 4) + TEST_FIELD_OFFSET(POINTFLOAT, x, 0) + TEST_FIELD_SIZE (POINTFLOAT, y, 4) + TEST_FIELD_ALIGN (POINTFLOAT, y, 4) + TEST_FIELD_OFFSET(POINTFLOAT, y, 4) +} + +static void test_pack_POINTFX(void) +{ + /* POINTFX (pack 4) */ + TEST_TYPE_SIZE (POINTFX, 8) + TEST_TYPE_ALIGN (POINTFX, 2) + TEST_FIELD_SIZE (POINTFX, x, 4) + TEST_FIELD_ALIGN (POINTFX, x, 2) + TEST_FIELD_OFFSET(POINTFX, x, 0) + TEST_FIELD_SIZE (POINTFX, y, 4) + TEST_FIELD_ALIGN (POINTFX, y, 2) + TEST_FIELD_OFFSET(POINTFX, y, 4) +} + +static void test_pack_POLYTEXTA(void) +{ + /* POLYTEXTA (pack 4) */ + TEST_TYPE_SIZE (POLYTEXTA, 40) + TEST_TYPE_ALIGN (POLYTEXTA, 4) + TEST_FIELD_SIZE (POLYTEXTA, x, 4) + TEST_FIELD_ALIGN (POLYTEXTA, x, 4) + TEST_FIELD_OFFSET(POLYTEXTA, x, 0) + TEST_FIELD_SIZE (POLYTEXTA, y, 4) + TEST_FIELD_ALIGN (POLYTEXTA, y, 4) + TEST_FIELD_OFFSET(POLYTEXTA, y, 4) + TEST_FIELD_SIZE (POLYTEXTA, n, 4) + TEST_FIELD_ALIGN (POLYTEXTA, n, 4) + TEST_FIELD_OFFSET(POLYTEXTA, n, 8) + TEST_FIELD_SIZE (POLYTEXTA, lpstr, 4) + TEST_FIELD_ALIGN (POLYTEXTA, lpstr, 4) + TEST_FIELD_OFFSET(POLYTEXTA, lpstr, 12) + TEST_FIELD_SIZE (POLYTEXTA, uiFlags, 4) + TEST_FIELD_ALIGN (POLYTEXTA, uiFlags, 4) + TEST_FIELD_OFFSET(POLYTEXTA, uiFlags, 16) + TEST_FIELD_SIZE (POLYTEXTA, rcl, 16) + TEST_FIELD_ALIGN (POLYTEXTA, rcl, 4) + TEST_FIELD_OFFSET(POLYTEXTA, rcl, 20) + TEST_FIELD_SIZE (POLYTEXTA, pdx, 4) + TEST_FIELD_ALIGN (POLYTEXTA, pdx, 4) + TEST_FIELD_OFFSET(POLYTEXTA, pdx, 36) +} + +static void test_pack_POLYTEXTW(void) +{ + /* POLYTEXTW (pack 4) */ + TEST_TYPE_SIZE (POLYTEXTW, 40) + TEST_TYPE_ALIGN (POLYTEXTW, 4) + TEST_FIELD_SIZE (POLYTEXTW, x, 4) + TEST_FIELD_ALIGN (POLYTEXTW, x, 4) + TEST_FIELD_OFFSET(POLYTEXTW, x, 0) + TEST_FIELD_SIZE (POLYTEXTW, y, 4) + TEST_FIELD_ALIGN (POLYTEXTW, y, 4) + TEST_FIELD_OFFSET(POLYTEXTW, y, 4) + TEST_FIELD_SIZE (POLYTEXTW, n, 4) + TEST_FIELD_ALIGN (POLYTEXTW, n, 4) + TEST_FIELD_OFFSET(POLYTEXTW, n, 8) + TEST_FIELD_SIZE (POLYTEXTW, lpstr, 4) + TEST_FIELD_ALIGN (POLYTEXTW, lpstr, 4) + TEST_FIELD_OFFSET(POLYTEXTW, lpstr, 12) + TEST_FIELD_SIZE (POLYTEXTW, uiFlags, 4) + TEST_FIELD_ALIGN (POLYTEXTW, uiFlags, 4) + TEST_FIELD_OFFSET(POLYTEXTW, uiFlags, 16) + TEST_FIELD_SIZE (POLYTEXTW, rcl, 16) + TEST_FIELD_ALIGN (POLYTEXTW, rcl, 4) + TEST_FIELD_OFFSET(POLYTEXTW, rcl, 20) + TEST_FIELD_SIZE (POLYTEXTW, pdx, 4) + TEST_FIELD_ALIGN (POLYTEXTW, pdx, 4) + TEST_FIELD_OFFSET(POLYTEXTW, pdx, 36) +} + +static void test_pack_POUTLINETEXTMETRICA(void) +{ + /* POUTLINETEXTMETRICA */ + TEST_TYPE_SIZE (POUTLINETEXTMETRICA, 4) + TEST_TYPE_ALIGN (POUTLINETEXTMETRICA, 4) + TEST_TARGET_SIZE (POUTLINETEXTMETRICA, 212) + TEST_TARGET_ALIGN(POUTLINETEXTMETRICA, 4) +} + +static void test_pack_POUTLINETEXTMETRICW(void) +{ + /* POUTLINETEXTMETRICW */ + TEST_TYPE_SIZE (POUTLINETEXTMETRICW, 4) + TEST_TYPE_ALIGN (POUTLINETEXTMETRICW, 4) + TEST_TARGET_SIZE (POUTLINETEXTMETRICW, 216) + TEST_TARGET_ALIGN(POUTLINETEXTMETRICW, 4) +} + +static void test_pack_PPELARRAY(void) +{ + /* PPELARRAY */ + TEST_TYPE_SIZE (PPELARRAY, 4) + TEST_TYPE_ALIGN (PPELARRAY, 4) + TEST_TARGET_SIZE (PPELARRAY, 20) + TEST_TARGET_ALIGN(PPELARRAY, 4) +} + +static void test_pack_PPIXELFORMATDESCRIPTOR(void) +{ + /* PPIXELFORMATDESCRIPTOR */ + TEST_TYPE_SIZE (PPIXELFORMATDESCRIPTOR, 4) + TEST_TYPE_ALIGN (PPIXELFORMATDESCRIPTOR, 4) + TEST_TARGET_SIZE (PPIXELFORMATDESCRIPTOR, 40) + TEST_TARGET_ALIGN(PPIXELFORMATDESCRIPTOR, 4) +} + +static void test_pack_PPOINTFLOAT(void) +{ + /* PPOINTFLOAT */ + TEST_TYPE_SIZE (PPOINTFLOAT, 4) + TEST_TYPE_ALIGN (PPOINTFLOAT, 4) + TEST_TARGET_SIZE (PPOINTFLOAT, 8) + TEST_TARGET_ALIGN(PPOINTFLOAT, 4) +} + +static void test_pack_PPOLYTEXTA(void) +{ + /* PPOLYTEXTA */ + TEST_TYPE_SIZE (PPOLYTEXTA, 4) + TEST_TYPE_ALIGN (PPOLYTEXTA, 4) + TEST_TARGET_SIZE (PPOLYTEXTA, 40) + TEST_TARGET_ALIGN(PPOLYTEXTA, 4) +} + +static void test_pack_PPOLYTEXTW(void) +{ + /* PPOLYTEXTW */ + TEST_TYPE_SIZE (PPOLYTEXTW, 4) + TEST_TYPE_ALIGN (PPOLYTEXTW, 4) + TEST_TARGET_SIZE (PPOLYTEXTW, 40) + TEST_TARGET_ALIGN(PPOLYTEXTW, 4) +} + +static void test_pack_PRGNDATA(void) +{ + /* PRGNDATA */ + TEST_TYPE_SIZE (PRGNDATA, 4) + TEST_TYPE_ALIGN (PRGNDATA, 4) + TEST_TARGET_SIZE (PRGNDATA, 36) + TEST_TARGET_ALIGN(PRGNDATA, 4) +} + +static void test_pack_PRGNDATAHEADER(void) +{ + /* PRGNDATAHEADER */ + TEST_TYPE_SIZE (PRGNDATAHEADER, 4) + TEST_TYPE_ALIGN (PRGNDATAHEADER, 4) + TEST_TARGET_SIZE (PRGNDATAHEADER, 32) + TEST_TARGET_ALIGN(PRGNDATAHEADER, 4) +} + +static void test_pack_PTEXTMETRICA(void) +{ + /* PTEXTMETRICA */ + TEST_TYPE_SIZE (PTEXTMETRICA, 4) + TEST_TYPE_ALIGN (PTEXTMETRICA, 4) + TEST_TARGET_SIZE (PTEXTMETRICA, 56) + TEST_TARGET_ALIGN(PTEXTMETRICA, 4) +} + +static void test_pack_PTEXTMETRICW(void) +{ + /* PTEXTMETRICW */ + TEST_TYPE_SIZE (PTEXTMETRICW, 4) + TEST_TYPE_ALIGN (PTEXTMETRICW, 4) + TEST_TARGET_SIZE (PTEXTMETRICW, 60) + TEST_TARGET_ALIGN(PTEXTMETRICW, 4) +} + +static void test_pack_PTRIVERTEX(void) +{ + /* PTRIVERTEX */ + TEST_TYPE_SIZE (PTRIVERTEX, 4) + TEST_TYPE_ALIGN (PTRIVERTEX, 4) + TEST_TARGET_SIZE (PTRIVERTEX, 16) + TEST_TARGET_ALIGN(PTRIVERTEX, 4) +} + +static void test_pack_PXFORM(void) +{ + /* PXFORM */ + TEST_TYPE_SIZE (PXFORM, 4) + TEST_TYPE_ALIGN (PXFORM, 4) + TEST_TARGET_SIZE (PXFORM, 24) + TEST_TARGET_ALIGN(PXFORM, 4) +} + +static void test_pack_RASTERIZER_STATUS(void) +{ + /* RASTERIZER_STATUS (pack 4) */ + TEST_TYPE_SIZE (RASTERIZER_STATUS, 6) + TEST_TYPE_ALIGN (RASTERIZER_STATUS, 2) + TEST_FIELD_SIZE (RASTERIZER_STATUS, nSize, 2) + TEST_FIELD_ALIGN (RASTERIZER_STATUS, nSize, 2) + TEST_FIELD_OFFSET(RASTERIZER_STATUS, nSize, 0) + TEST_FIELD_SIZE (RASTERIZER_STATUS, wFlags, 2) + TEST_FIELD_ALIGN (RASTERIZER_STATUS, wFlags, 2) + TEST_FIELD_OFFSET(RASTERIZER_STATUS, wFlags, 2) + TEST_FIELD_SIZE (RASTERIZER_STATUS, nLanguageID, 2) + TEST_FIELD_ALIGN (RASTERIZER_STATUS, nLanguageID, 2) + TEST_FIELD_OFFSET(RASTERIZER_STATUS, nLanguageID, 4) +} + +static void test_pack_RGBQUAD(void) +{ + /* RGBQUAD (pack 4) */ + TEST_TYPE_SIZE (RGBQUAD, 4) + TEST_TYPE_ALIGN (RGBQUAD, 1) + TEST_FIELD_SIZE (RGBQUAD, rgbBlue, 1) + TEST_FIELD_ALIGN (RGBQUAD, rgbBlue, 1) + TEST_FIELD_OFFSET(RGBQUAD, rgbBlue, 0) + TEST_FIELD_SIZE (RGBQUAD, rgbGreen, 1) + TEST_FIELD_ALIGN (RGBQUAD, rgbGreen, 1) + TEST_FIELD_OFFSET(RGBQUAD, rgbGreen, 1) + TEST_FIELD_SIZE (RGBQUAD, rgbRed, 1) + TEST_FIELD_ALIGN (RGBQUAD, rgbRed, 1) + TEST_FIELD_OFFSET(RGBQUAD, rgbRed, 2) + TEST_FIELD_SIZE (RGBQUAD, rgbReserved, 1) + TEST_FIELD_ALIGN (RGBQUAD, rgbReserved, 1) + TEST_FIELD_OFFSET(RGBQUAD, rgbReserved, 3) +} + +static void test_pack_RGBTRIPLE(void) +{ + /* RGBTRIPLE (pack 4) */ + TEST_TYPE_SIZE (RGBTRIPLE, 3) + TEST_TYPE_ALIGN (RGBTRIPLE, 1) + TEST_FIELD_SIZE (RGBTRIPLE, rgbtBlue, 1) + TEST_FIELD_ALIGN (RGBTRIPLE, rgbtBlue, 1) + TEST_FIELD_OFFSET(RGBTRIPLE, rgbtBlue, 0) + TEST_FIELD_SIZE (RGBTRIPLE, rgbtGreen, 1) + TEST_FIELD_ALIGN (RGBTRIPLE, rgbtGreen, 1) + TEST_FIELD_OFFSET(RGBTRIPLE, rgbtGreen, 1) + TEST_FIELD_SIZE (RGBTRIPLE, rgbtRed, 1) + TEST_FIELD_ALIGN (RGBTRIPLE, rgbtRed, 1) + TEST_FIELD_OFFSET(RGBTRIPLE, rgbtRed, 2) +} + +static void test_pack_RGNDATA(void) +{ + /* RGNDATA (pack 4) */ + TEST_TYPE_SIZE (RGNDATA, 36) + TEST_TYPE_ALIGN (RGNDATA, 4) + TEST_FIELD_SIZE (RGNDATA, rdh, 32) + TEST_FIELD_ALIGN (RGNDATA, rdh, 4) + TEST_FIELD_OFFSET(RGNDATA, rdh, 0) + TEST_FIELD_SIZE (RGNDATA, Buffer, 1) + TEST_FIELD_ALIGN (RGNDATA, Buffer, 1) + TEST_FIELD_OFFSET(RGNDATA, Buffer, 32) +} + +static void test_pack_RGNDATAHEADER(void) +{ + /* RGNDATAHEADER (pack 4) */ + TEST_TYPE_SIZE (RGNDATAHEADER, 32) + TEST_TYPE_ALIGN (RGNDATAHEADER, 4) + TEST_FIELD_SIZE (RGNDATAHEADER, dwSize, 4) + TEST_FIELD_ALIGN (RGNDATAHEADER, dwSize, 4) + TEST_FIELD_OFFSET(RGNDATAHEADER, dwSize, 0) + TEST_FIELD_SIZE (RGNDATAHEADER, iType, 4) + TEST_FIELD_ALIGN (RGNDATAHEADER, iType, 4) + TEST_FIELD_OFFSET(RGNDATAHEADER, iType, 4) + TEST_FIELD_SIZE (RGNDATAHEADER, nCount, 4) + TEST_FIELD_ALIGN (RGNDATAHEADER, nCount, 4) + TEST_FIELD_OFFSET(RGNDATAHEADER, nCount, 8) + TEST_FIELD_SIZE (RGNDATAHEADER, nRgnSize, 4) + TEST_FIELD_ALIGN (RGNDATAHEADER, nRgnSize, 4) + TEST_FIELD_OFFSET(RGNDATAHEADER, nRgnSize, 12) + TEST_FIELD_SIZE (RGNDATAHEADER, rcBound, 16) + TEST_FIELD_ALIGN (RGNDATAHEADER, rcBound, 4) + TEST_FIELD_OFFSET(RGNDATAHEADER, rcBound, 16) +} + +static void test_pack_TEXTMETRICA(void) +{ + /* TEXTMETRICA (pack 4) */ + TEST_TYPE_SIZE (TEXTMETRICA, 56) + TEST_TYPE_ALIGN (TEXTMETRICA, 4) + TEST_FIELD_SIZE (TEXTMETRICA, tmHeight, 4) + TEST_FIELD_ALIGN (TEXTMETRICA, tmHeight, 4) + TEST_FIELD_OFFSET(TEXTMETRICA, tmHeight, 0) + TEST_FIELD_SIZE (TEXTMETRICA, tmAscent, 4) + TEST_FIELD_ALIGN (TEXTMETRICA, tmAscent, 4) + TEST_FIELD_OFFSET(TEXTMETRICA, tmAscent, 4) + TEST_FIELD_SIZE (TEXTMETRICA, tmDescent, 4) + TEST_FIELD_ALIGN (TEXTMETRICA, tmDescent, 4) + TEST_FIELD_OFFSET(TEXTMETRICA, tmDescent, 8) + TEST_FIELD_SIZE (TEXTMETRICA, tmInternalLeading, 4) + TEST_FIELD_ALIGN (TEXTMETRICA, tmInternalLeading, 4) + TEST_FIELD_OFFSET(TEXTMETRICA, tmInternalLeading, 12) + TEST_FIELD_SIZE (TEXTMETRICA, tmExternalLeading, 4) + TEST_FIELD_ALIGN (TEXTMETRICA, tmExternalLeading, 4) + TEST_FIELD_OFFSET(TEXTMETRICA, tmExternalLeading, 16) + TEST_FIELD_SIZE (TEXTMETRICA, tmAveCharWidth, 4) + TEST_FIELD_ALIGN (TEXTMETRICA, tmAveCharWidth, 4) + TEST_FIELD_OFFSET(TEXTMETRICA, tmAveCharWidth, 20) + TEST_FIELD_SIZE (TEXTMETRICA, tmMaxCharWidth, 4) + TEST_FIELD_ALIGN (TEXTMETRICA, tmMaxCharWidth, 4) + TEST_FIELD_OFFSET(TEXTMETRICA, tmMaxCharWidth, 24) + TEST_FIELD_SIZE (TEXTMETRICA, tmWeight, 4) + TEST_FIELD_ALIGN (TEXTMETRICA, tmWeight, 4) + TEST_FIELD_OFFSET(TEXTMETRICA, tmWeight, 28) + TEST_FIELD_SIZE (TEXTMETRICA, tmOverhang, 4) + TEST_FIELD_ALIGN (TEXTMETRICA, tmOverhang, 4) + TEST_FIELD_OFFSET(TEXTMETRICA, tmOverhang, 32) + TEST_FIELD_SIZE (TEXTMETRICA, tmDigitizedAspectX, 4) + TEST_FIELD_ALIGN (TEXTMETRICA, tmDigitizedAspectX, 4) + TEST_FIELD_OFFSET(TEXTMETRICA, tmDigitizedAspectX, 36) + TEST_FIELD_SIZE (TEXTMETRICA, tmDigitizedAspectY, 4) + TEST_FIELD_ALIGN (TEXTMETRICA, tmDigitizedAspectY, 4) + TEST_FIELD_OFFSET(TEXTMETRICA, tmDigitizedAspectY, 40) + TEST_FIELD_SIZE (TEXTMETRICA, tmFirstChar, 1) + TEST_FIELD_ALIGN (TEXTMETRICA, tmFirstChar, 1) + TEST_FIELD_OFFSET(TEXTMETRICA, tmFirstChar, 44) + TEST_FIELD_SIZE (TEXTMETRICA, tmLastChar, 1) + TEST_FIELD_ALIGN (TEXTMETRICA, tmLastChar, 1) + TEST_FIELD_OFFSET(TEXTMETRICA, tmLastChar, 45) + TEST_FIELD_SIZE (TEXTMETRICA, tmDefaultChar, 1) + TEST_FIELD_ALIGN (TEXTMETRICA, tmDefaultChar, 1) + TEST_FIELD_OFFSET(TEXTMETRICA, tmDefaultChar, 46) + TEST_FIELD_SIZE (TEXTMETRICA, tmBreakChar, 1) + TEST_FIELD_ALIGN (TEXTMETRICA, tmBreakChar, 1) + TEST_FIELD_OFFSET(TEXTMETRICA, tmBreakChar, 47) + TEST_FIELD_SIZE (TEXTMETRICA, tmItalic, 1) + TEST_FIELD_ALIGN (TEXTMETRICA, tmItalic, 1) + TEST_FIELD_OFFSET(TEXTMETRICA, tmItalic, 48) + TEST_FIELD_SIZE (TEXTMETRICA, tmUnderlined, 1) + TEST_FIELD_ALIGN (TEXTMETRICA, tmUnderlined, 1) + TEST_FIELD_OFFSET(TEXTMETRICA, tmUnderlined, 49) + TEST_FIELD_SIZE (TEXTMETRICA, tmStruckOut, 1) + TEST_FIELD_ALIGN (TEXTMETRICA, tmStruckOut, 1) + TEST_FIELD_OFFSET(TEXTMETRICA, tmStruckOut, 50) + TEST_FIELD_SIZE (TEXTMETRICA, tmPitchAndFamily, 1) + TEST_FIELD_ALIGN (TEXTMETRICA, tmPitchAndFamily, 1) + TEST_FIELD_OFFSET(TEXTMETRICA, tmPitchAndFamily, 51) + TEST_FIELD_SIZE (TEXTMETRICA, tmCharSet, 1) + TEST_FIELD_ALIGN (TEXTMETRICA, tmCharSet, 1) + TEST_FIELD_OFFSET(TEXTMETRICA, tmCharSet, 52) +} + +static void test_pack_TEXTMETRICW(void) +{ + /* TEXTMETRICW (pack 4) */ + TEST_TYPE_SIZE (TEXTMETRICW, 60) + TEST_TYPE_ALIGN (TEXTMETRICW, 4) + TEST_FIELD_SIZE (TEXTMETRICW, tmHeight, 4) + TEST_FIELD_ALIGN (TEXTMETRICW, tmHeight, 4) + TEST_FIELD_OFFSET(TEXTMETRICW, tmHeight, 0) + TEST_FIELD_SIZE (TEXTMETRICW, tmAscent, 4) + TEST_FIELD_ALIGN (TEXTMETRICW, tmAscent, 4) + TEST_FIELD_OFFSET(TEXTMETRICW, tmAscent, 4) + TEST_FIELD_SIZE (TEXTMETRICW, tmDescent, 4) + TEST_FIELD_ALIGN (TEXTMETRICW, tmDescent, 4) + TEST_FIELD_OFFSET(TEXTMETRICW, tmDescent, 8) + TEST_FIELD_SIZE (TEXTMETRICW, tmInternalLeading, 4) + TEST_FIELD_ALIGN (TEXTMETRICW, tmInternalLeading, 4) + TEST_FIELD_OFFSET(TEXTMETRICW, tmInternalLeading, 12) + TEST_FIELD_SIZE (TEXTMETRICW, tmExternalLeading, 4) + TEST_FIELD_ALIGN (TEXTMETRICW, tmExternalLeading, 4) + TEST_FIELD_OFFSET(TEXTMETRICW, tmExternalLeading, 16) + TEST_FIELD_SIZE (TEXTMETRICW, tmAveCharWidth, 4) + TEST_FIELD_ALIGN (TEXTMETRICW, tmAveCharWidth, 4) + TEST_FIELD_OFFSET(TEXTMETRICW, tmAveCharWidth, 20) + TEST_FIELD_SIZE (TEXTMETRICW, tmMaxCharWidth, 4) + TEST_FIELD_ALIGN (TEXTMETRICW, tmMaxCharWidth, 4) + TEST_FIELD_OFFSET(TEXTMETRICW, tmMaxCharWidth, 24) + TEST_FIELD_SIZE (TEXTMETRICW, tmWeight, 4) + TEST_FIELD_ALIGN (TEXTMETRICW, tmWeight, 4) + TEST_FIELD_OFFSET(TEXTMETRICW, tmWeight, 28) + TEST_FIELD_SIZE (TEXTMETRICW, tmOverhang, 4) + TEST_FIELD_ALIGN (TEXTMETRICW, tmOverhang, 4) + TEST_FIELD_OFFSET(TEXTMETRICW, tmOverhang, 32) + TEST_FIELD_SIZE (TEXTMETRICW, tmDigitizedAspectX, 4) + TEST_FIELD_ALIGN (TEXTMETRICW, tmDigitizedAspectX, 4) + TEST_FIELD_OFFSET(TEXTMETRICW, tmDigitizedAspectX, 36) + TEST_FIELD_SIZE (TEXTMETRICW, tmDigitizedAspectY, 4) + TEST_FIELD_ALIGN (TEXTMETRICW, tmDigitizedAspectY, 4) + TEST_FIELD_OFFSET(TEXTMETRICW, tmDigitizedAspectY, 40) + TEST_FIELD_SIZE (TEXTMETRICW, tmFirstChar, 2) + TEST_FIELD_ALIGN (TEXTMETRICW, tmFirstChar, 2) + TEST_FIELD_OFFSET(TEXTMETRICW, tmFirstChar, 44) + TEST_FIELD_SIZE (TEXTMETRICW, tmLastChar, 2) + TEST_FIELD_ALIGN (TEXTMETRICW, tmLastChar, 2) + TEST_FIELD_OFFSET(TEXTMETRICW, tmLastChar, 46) + TEST_FIELD_SIZE (TEXTMETRICW, tmDefaultChar, 2) + TEST_FIELD_ALIGN (TEXTMETRICW, tmDefaultChar, 2) + TEST_FIELD_OFFSET(TEXTMETRICW, tmDefaultChar, 48) + TEST_FIELD_SIZE (TEXTMETRICW, tmBreakChar, 2) + TEST_FIELD_ALIGN (TEXTMETRICW, tmBreakChar, 2) + TEST_FIELD_OFFSET(TEXTMETRICW, tmBreakChar, 50) + TEST_FIELD_SIZE (TEXTMETRICW, tmItalic, 1) + TEST_FIELD_ALIGN (TEXTMETRICW, tmItalic, 1) + TEST_FIELD_OFFSET(TEXTMETRICW, tmItalic, 52) + TEST_FIELD_SIZE (TEXTMETRICW, tmUnderlined, 1) + TEST_FIELD_ALIGN (TEXTMETRICW, tmUnderlined, 1) + TEST_FIELD_OFFSET(TEXTMETRICW, tmUnderlined, 53) + TEST_FIELD_SIZE (TEXTMETRICW, tmStruckOut, 1) + TEST_FIELD_ALIGN (TEXTMETRICW, tmStruckOut, 1) + TEST_FIELD_OFFSET(TEXTMETRICW, tmStruckOut, 54) + TEST_FIELD_SIZE (TEXTMETRICW, tmPitchAndFamily, 1) + TEST_FIELD_ALIGN (TEXTMETRICW, tmPitchAndFamily, 1) + TEST_FIELD_OFFSET(TEXTMETRICW, tmPitchAndFamily, 55) + TEST_FIELD_SIZE (TEXTMETRICW, tmCharSet, 1) + TEST_FIELD_ALIGN (TEXTMETRICW, tmCharSet, 1) + TEST_FIELD_OFFSET(TEXTMETRICW, tmCharSet, 56) +} + +static void test_pack_TRIVERTEX(void) +{ + /* TRIVERTEX (pack 4) */ + TEST_TYPE_SIZE (TRIVERTEX, 16) + TEST_TYPE_ALIGN (TRIVERTEX, 4) + TEST_FIELD_SIZE (TRIVERTEX, x, 4) + TEST_FIELD_ALIGN (TRIVERTEX, x, 4) + TEST_FIELD_OFFSET(TRIVERTEX, x, 0) + TEST_FIELD_SIZE (TRIVERTEX, y, 4) + TEST_FIELD_ALIGN (TRIVERTEX, y, 4) + TEST_FIELD_OFFSET(TRIVERTEX, y, 4) + TEST_FIELD_SIZE (TRIVERTEX, Red, 2) + TEST_FIELD_ALIGN (TRIVERTEX, Red, 2) + TEST_FIELD_OFFSET(TRIVERTEX, Red, 8) + TEST_FIELD_SIZE (TRIVERTEX, Green, 2) + TEST_FIELD_ALIGN (TRIVERTEX, Green, 2) + TEST_FIELD_OFFSET(TRIVERTEX, Green, 10) + TEST_FIELD_SIZE (TRIVERTEX, Blue, 2) + TEST_FIELD_ALIGN (TRIVERTEX, Blue, 2) + TEST_FIELD_OFFSET(TRIVERTEX, Blue, 12) + TEST_FIELD_SIZE (TRIVERTEX, Alpha, 2) + TEST_FIELD_ALIGN (TRIVERTEX, Alpha, 2) + TEST_FIELD_OFFSET(TRIVERTEX, Alpha, 14) +} + +static void test_pack_TTPOLYCURVE(void) +{ + /* TTPOLYCURVE (pack 4) */ + TEST_TYPE_SIZE (TTPOLYCURVE, 12) + TEST_TYPE_ALIGN (TTPOLYCURVE, 2) + TEST_FIELD_SIZE (TTPOLYCURVE, wType, 2) + TEST_FIELD_ALIGN (TTPOLYCURVE, wType, 2) + TEST_FIELD_OFFSET(TTPOLYCURVE, wType, 0) + TEST_FIELD_SIZE (TTPOLYCURVE, cpfx, 2) + TEST_FIELD_ALIGN (TTPOLYCURVE, cpfx, 2) + TEST_FIELD_OFFSET(TTPOLYCURVE, cpfx, 2) + TEST_FIELD_SIZE (TTPOLYCURVE, apfx, 8) + TEST_FIELD_ALIGN (TTPOLYCURVE, apfx, 2) + TEST_FIELD_OFFSET(TTPOLYCURVE, apfx, 4) +} + +static void test_pack_TTPOLYGONHEADER(void) +{ + /* TTPOLYGONHEADER (pack 4) */ + TEST_TYPE_SIZE (TTPOLYGONHEADER, 16) + TEST_TYPE_ALIGN (TTPOLYGONHEADER, 4) + TEST_FIELD_SIZE (TTPOLYGONHEADER, cb, 4) + TEST_FIELD_ALIGN (TTPOLYGONHEADER, cb, 4) + TEST_FIELD_OFFSET(TTPOLYGONHEADER, cb, 0) + TEST_FIELD_SIZE (TTPOLYGONHEADER, dwType, 4) + TEST_FIELD_ALIGN (TTPOLYGONHEADER, dwType, 4) + TEST_FIELD_OFFSET(TTPOLYGONHEADER, dwType, 4) + TEST_FIELD_SIZE (TTPOLYGONHEADER, pfxStart, 8) + TEST_FIELD_ALIGN (TTPOLYGONHEADER, pfxStart, 2) + TEST_FIELD_OFFSET(TTPOLYGONHEADER, pfxStart, 8) +} + +static void test_pack_XFORM(void) +{ + /* XFORM (pack 4) */ + TEST_TYPE_SIZE (XFORM, 24) + TEST_TYPE_ALIGN (XFORM, 4) + TEST_FIELD_SIZE (XFORM, eM11, 4) + TEST_FIELD_ALIGN (XFORM, eM11, 4) + TEST_FIELD_OFFSET(XFORM, eM11, 0) + TEST_FIELD_SIZE (XFORM, eM12, 4) + TEST_FIELD_ALIGN (XFORM, eM12, 4) + TEST_FIELD_OFFSET(XFORM, eM12, 4) + TEST_FIELD_SIZE (XFORM, eM21, 4) + TEST_FIELD_ALIGN (XFORM, eM21, 4) + TEST_FIELD_OFFSET(XFORM, eM21, 8) + TEST_FIELD_SIZE (XFORM, eM22, 4) + TEST_FIELD_ALIGN (XFORM, eM22, 4) + TEST_FIELD_OFFSET(XFORM, eM22, 12) + TEST_FIELD_SIZE (XFORM, eDx, 4) + TEST_FIELD_ALIGN (XFORM, eDx, 4) + TEST_FIELD_OFFSET(XFORM, eDx, 16) + TEST_FIELD_SIZE (XFORM, eDy, 4) + TEST_FIELD_ALIGN (XFORM, eDy, 4) + TEST_FIELD_OFFSET(XFORM, eDy, 20) +} + +static void test_pack(void) +{ + test_pack_ABC(); + test_pack_ABCFLOAT(); + test_pack_ABORTPROC(); + test_pack_BITMAP(); + test_pack_BITMAPCOREHEADER(); + test_pack_BITMAPCOREINFO(); + test_pack_BITMAPFILEHEADER(); + test_pack_BITMAPINFO(); + test_pack_BITMAPINFOHEADER(); + test_pack_BITMAPV4HEADER(); + test_pack_BITMAPV5HEADER(); + test_pack_BLENDFUNCTION(); + test_pack_CHARSETINFO(); + test_pack_CIEXYZ(); + test_pack_CIEXYZTRIPLE(); + test_pack_COLOR16(); + test_pack_COLORADJUSTMENT(); + test_pack_DEVMODEA(); + test_pack_DEVMODEW(); + test_pack_DIBSECTION(); + test_pack_DISPLAY_DEVICEA(); + test_pack_DISPLAY_DEVICEW(); + test_pack_DOCINFOA(); + test_pack_DOCINFOW(); + test_pack_EMR(); + test_pack_EMRABORTPATH(); + test_pack_EMRANGLEARC(); + test_pack_EMRARC(); + test_pack_EMRARCTO(); + test_pack_EMRBEGINPATH(); + test_pack_EMRBITBLT(); + test_pack_EMRCHORD(); + test_pack_EMRCLOSEFIGURE(); + test_pack_EMRCREATEBRUSHINDIRECT(); + test_pack_EMRCREATECOLORSPACE(); + test_pack_EMRCREATECOLORSPACEW(); + test_pack_EMRCREATEDIBPATTERNBRUSHPT(); + test_pack_EMRCREATEMONOBRUSH(); + test_pack_EMRCREATEPEN(); + test_pack_EMRDELETECOLORSPACE(); + test_pack_EMRDELETEOBJECT(); + test_pack_EMRELLIPSE(); + test_pack_EMRENDPATH(); + test_pack_EMREOF(); + test_pack_EMREXCLUDECLIPRECT(); + test_pack_EMREXTCREATEFONTINDIRECTW(); + test_pack_EMREXTCREATEPEN(); + test_pack_EMREXTFLOODFILL(); + test_pack_EMREXTSELECTCLIPRGN(); + test_pack_EMREXTTEXTOUTA(); + test_pack_EMREXTTEXTOUTW(); + test_pack_EMRFILLPATH(); + test_pack_EMRFILLRGN(); + test_pack_EMRFLATTENPATH(); + test_pack_EMRFORMAT(); + test_pack_EMRFRAMERGN(); + test_pack_EMRGDICOMMENT(); + test_pack_EMRGLSBOUNDEDRECORD(); + test_pack_EMRGLSRECORD(); + test_pack_EMRINTERSECTCLIPRECT(); + test_pack_EMRINVERTRGN(); + test_pack_EMRLINETO(); + test_pack_EMRMASKBLT(); + test_pack_EMRMODIFYWORLDTRANSFORM(); + test_pack_EMRMOVETOEX(); + test_pack_EMROFFSETCLIPRGN(); + test_pack_EMRPAINTRGN(); + test_pack_EMRPIE(); + test_pack_EMRPIXELFORMAT(); + test_pack_EMRPLGBLT(); + test_pack_EMRPOLYBEZIER(); + test_pack_EMRPOLYBEZIER16(); + test_pack_EMRPOLYBEZIERTO(); + test_pack_EMRPOLYBEZIERTO16(); + test_pack_EMRPOLYDRAW(); + test_pack_EMRPOLYDRAW16(); + test_pack_EMRPOLYGON(); + test_pack_EMRPOLYGON16(); + test_pack_EMRPOLYLINE(); + test_pack_EMRPOLYLINE16(); + test_pack_EMRPOLYLINETO(); + test_pack_EMRPOLYLINETO16(); + test_pack_EMRPOLYPOLYGON(); + test_pack_EMRPOLYPOLYGON16(); + test_pack_EMRPOLYPOLYLINE(); + test_pack_EMRPOLYPOLYLINE16(); + test_pack_EMRPOLYTEXTOUTA(); + test_pack_EMRPOLYTEXTOUTW(); + test_pack_EMRREALIZEPALETTE(); + test_pack_EMRRECTANGLE(); + test_pack_EMRRESIZEPALETTE(); + test_pack_EMRRESTOREDC(); + test_pack_EMRROUNDRECT(); + test_pack_EMRSAVEDC(); + test_pack_EMRSCALEVIEWPORTEXTEX(); + test_pack_EMRSCALEWINDOWEXTEX(); + test_pack_EMRSELECTCLIPPATH(); + test_pack_EMRSELECTCOLORSPACE(); + test_pack_EMRSELECTOBJECT(); + test_pack_EMRSELECTPALETTE(); + test_pack_EMRSETARCDIRECTION(); + test_pack_EMRSETBKCOLOR(); + test_pack_EMRSETBKMODE(); + test_pack_EMRSETBRUSHORGEX(); + test_pack_EMRSETCOLORADJUSTMENT(); + test_pack_EMRSETCOLORSPACE(); + test_pack_EMRSETDIBITSTODEVICE(); + test_pack_EMRSETICMMODE(); + test_pack_EMRSETLAYOUT(); + test_pack_EMRSETMAPMODE(); + test_pack_EMRSETMAPPERFLAGS(); + test_pack_EMRSETMETARGN(); + test_pack_EMRSETMITERLIMIT(); + test_pack_EMRSETPIXELV(); + test_pack_EMRSETPOLYFILLMODE(); + test_pack_EMRSETROP2(); + test_pack_EMRSETSTRETCHBLTMODE(); + test_pack_EMRSETTEXTALIGN(); + test_pack_EMRSETTEXTCOLOR(); + test_pack_EMRSETVIEWPORTEXTEX(); + test_pack_EMRSETVIEWPORTORGEX(); + test_pack_EMRSETWINDOWEXTEX(); + test_pack_EMRSETWINDOWORGEX(); + test_pack_EMRSETWORLDTRANSFORM(); + test_pack_EMRSTRETCHBLT(); + test_pack_EMRSTRETCHDIBITS(); + test_pack_EMRSTROKEANDFILLPATH(); + test_pack_EMRSTROKEPATH(); + test_pack_EMRTEXT(); + test_pack_EMRWIDENPATH(); + test_pack_ENHMETAHEADER(); + test_pack_ENHMETARECORD(); + test_pack_ENHMFENUMPROC(); + test_pack_ENUMLOGFONTA(); + test_pack_ENUMLOGFONTEXA(); + test_pack_ENUMLOGFONTEXW(); + test_pack_ENUMLOGFONTW(); + test_pack_EXTLOGFONTA(); + test_pack_EXTLOGFONTW(); + test_pack_EXTLOGPEN(); + test_pack_FIXED(); + test_pack_FONTENUMPROCA(); + test_pack_FONTENUMPROCW(); + test_pack_FONTSIGNATURE(); + test_pack_FXPT16DOT16(); + test_pack_FXPT2DOT30(); + test_pack_GCP_RESULTSA(); + test_pack_GCP_RESULTSW(); + test_pack_GLYPHMETRICS(); + test_pack_GLYPHMETRICSFLOAT(); + test_pack_GOBJENUMPROC(); + test_pack_GRADIENT_RECT(); + test_pack_GRADIENT_TRIANGLE(); + test_pack_HANDLETABLE(); + test_pack_ICMENUMPROCA(); + test_pack_ICMENUMPROCW(); + test_pack_KERNINGPAIR(); + test_pack_LAYERPLANEDESCRIPTOR(); + test_pack_LCSCSTYPE(); + test_pack_LCSGAMUTMATCH(); + test_pack_LINEDDAPROC(); + test_pack_LOCALESIGNATURE(); + test_pack_LOGBRUSH(); + test_pack_LOGCOLORSPACEA(); + test_pack_LOGCOLORSPACEW(); + test_pack_LOGFONTA(); + test_pack_LOGFONTW(); + test_pack_LOGPEN(); + test_pack_LPABC(); + test_pack_LPABCFLOAT(); + test_pack_LPBITMAP(); + test_pack_LPBITMAPCOREHEADER(); + test_pack_LPBITMAPCOREINFO(); + test_pack_LPBITMAPFILEHEADER(); + test_pack_LPBITMAPINFO(); + test_pack_LPBITMAPINFOHEADER(); + test_pack_LPBITMAPV5HEADER(); + test_pack_LPCHARSETINFO(); + test_pack_LPCIEXYZ(); + test_pack_LPCIEXYZTRIPLE(); + test_pack_LPCOLORADJUSTMENT(); + test_pack_LPDEVMODEA(); + test_pack_LPDEVMODEW(); + test_pack_LPDIBSECTION(); + test_pack_LPDISPLAY_DEVICEA(); + test_pack_LPDISPLAY_DEVICEW(); + test_pack_LPDOCINFOA(); + test_pack_LPDOCINFOW(); + test_pack_LPENHMETAHEADER(); + test_pack_LPENHMETARECORD(); + test_pack_LPENUMLOGFONTA(); + test_pack_LPENUMLOGFONTEXA(); + test_pack_LPENUMLOGFONTEXW(); + test_pack_LPENUMLOGFONTW(); + test_pack_LPEXTLOGFONTA(); + test_pack_LPEXTLOGFONTW(); + test_pack_LPEXTLOGPEN(); + test_pack_LPFONTSIGNATURE(); + test_pack_LPGCP_RESULTSA(); + test_pack_LPGCP_RESULTSW(); + test_pack_LPGLYPHMETRICS(); + test_pack_LPGLYPHMETRICSFLOAT(); + test_pack_LPGRADIENT_RECT(); + test_pack_LPGRADIENT_TRIANGLE(); + test_pack_LPHANDLETABLE(); + test_pack_LPKERNINGPAIR(); + test_pack_LPLAYERPLANEDESCRIPTOR(); + test_pack_LPLOCALESIGNATURE(); + test_pack_LPLOGBRUSH(); + test_pack_LPLOGCOLORSPACEA(); + test_pack_LPLOGCOLORSPACEW(); + test_pack_LPLOGFONTA(); + test_pack_LPLOGFONTW(); + test_pack_LPLOGPEN(); + test_pack_LPMAT2(); + test_pack_LPMETAFILEPICT(); + test_pack_LPMETAHEADER(); + test_pack_LPMETARECORD(); + test_pack_LPNEWTEXTMETRICA(); + test_pack_LPNEWTEXTMETRICW(); + test_pack_LPOUTLINETEXTMETRICA(); + test_pack_LPOUTLINETEXTMETRICW(); + test_pack_LPPANOSE(); + test_pack_LPPELARRAY(); + test_pack_LPPIXELFORMATDESCRIPTOR(); + test_pack_LPPOINTFX(); + test_pack_LPPOLYTEXTA(); + test_pack_LPPOLYTEXTW(); + test_pack_LPRASTERIZER_STATUS(); + test_pack_LPRGBQUAD(); + test_pack_LPRGNDATA(); + test_pack_LPTEXTMETRICA(); + test_pack_LPTEXTMETRICW(); + test_pack_LPTRIVERTEX(); + test_pack_LPTTPOLYCURVE(); + test_pack_LPTTPOLYGONHEADER(); + test_pack_LPXFORM(); + test_pack_MAT2(); + test_pack_METAFILEPICT(); + test_pack_METAHEADER(); + test_pack_METARECORD(); + test_pack_MFENUMPROC(); + test_pack_NEWTEXTMETRICA(); + test_pack_NEWTEXTMETRICEXA(); + test_pack_NEWTEXTMETRICEXW(); + test_pack_NEWTEXTMETRICW(); + test_pack_NPEXTLOGPEN(); + test_pack_OLDFONTENUMPROC(); + test_pack_OLDFONTENUMPROCA(); + test_pack_OLDFONTENUMPROCW(); + test_pack_OUTLINETEXTMETRICA(); + test_pack_OUTLINETEXTMETRICW(); + test_pack_PABC(); + test_pack_PABCFLOAT(); + test_pack_PANOSE(); + test_pack_PATTERN(); + test_pack_PBITMAP(); + test_pack_PBITMAPCOREHEADER(); + test_pack_PBITMAPCOREINFO(); + test_pack_PBITMAPFILEHEADER(); + test_pack_PBITMAPINFO(); + test_pack_PBITMAPINFOHEADER(); + test_pack_PBITMAPV4HEADER(); + test_pack_PBITMAPV5HEADER(); + test_pack_PBLENDFUNCTION(); + test_pack_PCHARSETINFO(); + test_pack_PCOLORADJUSTMENT(); + test_pack_PDEVMODEA(); + test_pack_PDEVMODEW(); + test_pack_PDIBSECTION(); + test_pack_PDISPLAY_DEVICEA(); + test_pack_PDISPLAY_DEVICEW(); + test_pack_PELARRAY(); + test_pack_PEMR(); + test_pack_PEMRABORTPATH(); + test_pack_PEMRANGLEARC(); + test_pack_PEMRARC(); + test_pack_PEMRARCTO(); + test_pack_PEMRBEGINPATH(); + test_pack_PEMRBITBLT(); + test_pack_PEMRCHORD(); + test_pack_PEMRCLOSEFIGURE(); + test_pack_PEMRCREATEBRUSHINDIRECT(); + test_pack_PEMRCREATECOLORSPACE(); + test_pack_PEMRCREATECOLORSPACEW(); + test_pack_PEMRCREATEDIBPATTERNBRUSHPT(); + test_pack_PEMRCREATEMONOBRUSH(); + test_pack_PEMRCREATEPALETTE(); + test_pack_PEMRCREATEPEN(); + test_pack_PEMRDELETECOLORSPACE(); + test_pack_PEMRDELETEOBJECT(); + test_pack_PEMRELLIPSE(); + test_pack_PEMRENDPATH(); + test_pack_PEMREOF(); + test_pack_PEMREXCLUDECLIPRECT(); + test_pack_PEMREXTCREATEFONTINDIRECTW(); + test_pack_PEMREXTCREATEPEN(); + test_pack_PEMREXTFLOODFILL(); + test_pack_PEMREXTSELECTCLIPRGN(); + test_pack_PEMREXTTEXTOUTA(); + test_pack_PEMREXTTEXTOUTW(); + test_pack_PEMRFILLPATH(); + test_pack_PEMRFILLRGN(); + test_pack_PEMRFLATTENPATH(); + test_pack_PEMRFORMAT(); + test_pack_PEMRFRAMERGN(); + test_pack_PEMRGDICOMMENT(); + test_pack_PEMRGLSBOUNDEDRECORD(); + test_pack_PEMRGLSRECORD(); + test_pack_PEMRINTERSECTCLIPRECT(); + test_pack_PEMRINVERTRGN(); + test_pack_PEMRLINETO(); + test_pack_PEMRMASKBLT(); + test_pack_PEMRMODIFYWORLDTRANSFORM(); + test_pack_PEMRMOVETOEX(); + test_pack_PEMROFFSETCLIPRGN(); + test_pack_PEMRPAINTRGN(); + test_pack_PEMRPIE(); + test_pack_PEMRPIXELFORMAT(); + test_pack_PEMRPLGBLT(); + test_pack_PEMRPOLYBEZIER(); + test_pack_PEMRPOLYBEZIER16(); + test_pack_PEMRPOLYBEZIERTO(); + test_pack_PEMRPOLYBEZIERTO16(); + test_pack_PEMRPOLYDRAW(); + test_pack_PEMRPOLYDRAW16(); + test_pack_PEMRPOLYGON(); + test_pack_PEMRPOLYGON16(); + test_pack_PEMRPOLYLINE(); + test_pack_PEMRPOLYLINE16(); + test_pack_PEMRPOLYLINETO(); + test_pack_PEMRPOLYLINETO16(); + test_pack_PEMRPOLYPOLYGON(); + test_pack_PEMRPOLYPOLYGON16(); + test_pack_PEMRPOLYPOLYLINE(); + test_pack_PEMRPOLYPOLYLINE16(); + test_pack_PEMRPOLYTEXTOUTA(); + test_pack_PEMRPOLYTEXTOUTW(); + test_pack_PEMRREALIZEPALETTE(); + test_pack_PEMRRECTANGLE(); + test_pack_PEMRRESIZEPALETTE(); + test_pack_PEMRRESTOREDC(); + test_pack_PEMRROUNDRECT(); + test_pack_PEMRSAVEDC(); + test_pack_PEMRSCALEVIEWPORTEXTEX(); + test_pack_PEMRSCALEWINDOWEXTEX(); + test_pack_PEMRSELECTCLIPPATH(); + test_pack_PEMRSELECTCOLORSPACE(); + test_pack_PEMRSELECTOBJECT(); + test_pack_PEMRSELECTPALETTE(); + test_pack_PEMRSETARCDIRECTION(); + test_pack_PEMRSETBKCOLOR(); + test_pack_PEMRSETBKMODE(); + test_pack_PEMRSETBRUSHORGEX(); + test_pack_PEMRSETCOLORADJUSTMENT(); + test_pack_PEMRSETCOLORSPACE(); + test_pack_PEMRSETDIBITSTODEVICE(); + test_pack_PEMRSETICMMODE(); + test_pack_PEMRSETLAYOUT(); + test_pack_PEMRSETMAPMODE(); + test_pack_PEMRSETMAPPERFLAGS(); + test_pack_PEMRSETMETARGN(); + test_pack_PEMRSETMITERLIMIT(); + test_pack_PEMRSETPALETTEENTRIES(); + test_pack_PEMRSETPIXELV(); + test_pack_PEMRSETPOLYFILLMODE(); + test_pack_PEMRSETROP2(); + test_pack_PEMRSETSTRETCHBLTMODE(); + test_pack_PEMRSETTEXTALIGN(); + test_pack_PEMRSETTEXTCOLOR(); + test_pack_PEMRSETVIEWPORTEXTEX(); + test_pack_PEMRSETVIEWPORTORGEX(); + test_pack_PEMRSETWINDOWEXTEX(); + test_pack_PEMRSETWINDOWORGEX(); + test_pack_PEMRSETWORLDTRANSFORM(); + test_pack_PEMRSTRETCHBLT(); + test_pack_PEMRSTRETCHDIBITS(); + test_pack_PEMRSTROKEANDFILLPATH(); + test_pack_PEMRSTROKEPATH(); + test_pack_PEMRTEXT(); + test_pack_PEMRWIDENPATH(); + test_pack_PENHMETAHEADER(); + test_pack_PEXTLOGFONTA(); + test_pack_PEXTLOGFONTW(); + test_pack_PEXTLOGPEN(); + test_pack_PFONTSIGNATURE(); + test_pack_PGLYPHMETRICSFLOAT(); + test_pack_PGRADIENT_RECT(); + test_pack_PGRADIENT_TRIANGLE(); + test_pack_PHANDLETABLE(); + test_pack_PIXELFORMATDESCRIPTOR(); + test_pack_PLAYERPLANEDESCRIPTOR(); + test_pack_PLOCALESIGNATURE(); + test_pack_PLOGBRUSH(); + test_pack_PLOGFONTA(); + test_pack_PLOGFONTW(); + test_pack_PMETAHEADER(); + test_pack_PMETARECORD(); + test_pack_PNEWTEXTMETRICA(); + test_pack_PNEWTEXTMETRICW(); + test_pack_POINTFLOAT(); + test_pack_POINTFX(); + test_pack_POLYTEXTA(); + test_pack_POLYTEXTW(); + test_pack_POUTLINETEXTMETRICA(); + test_pack_POUTLINETEXTMETRICW(); + test_pack_PPELARRAY(); + test_pack_PPIXELFORMATDESCRIPTOR(); + test_pack_PPOINTFLOAT(); + test_pack_PPOLYTEXTA(); + test_pack_PPOLYTEXTW(); + test_pack_PRGNDATA(); + test_pack_PRGNDATAHEADER(); + test_pack_PTEXTMETRICA(); + test_pack_PTEXTMETRICW(); + test_pack_PTRIVERTEX(); + test_pack_PXFORM(); + test_pack_RASTERIZER_STATUS(); + test_pack_RGBQUAD(); + test_pack_RGBTRIPLE(); + test_pack_RGNDATA(); + test_pack_RGNDATAHEADER(); + test_pack_TEXTMETRICA(); + test_pack_TEXTMETRICW(); + test_pack_TRIVERTEX(); + test_pack_TTPOLYCURVE(); + test_pack_TTPOLYGONHEADER(); + test_pack_XFORM(); +} + +START_TEST(generated) +{ +#ifdef _WIN64 + ok(0, "The type size / alignment tests don't support Win64 yet\n"); +#else + test_pack(); +#endif +} diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c index 74d71d9c3e5..2299f203d1e 100644 --- a/dlls/imm32/imm.c +++ b/dlls/imm32/imm.c @@ -108,7 +108,7 @@ static const WCHAR szwWineIMCProperty[] = {'W','i','n','e','I','m','m','H','I',' static const WCHAR szImeFileW[] = {'I','m','e',' ','F','i','l','e',0}; static const WCHAR szLayoutTextW[] = {'L','a','y','o','u','t',' ','T','e','x','t',0}; -static const WCHAR szImeRegFmt[] = {'S','y','s','t','e','m','\\','C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\','C','o','n','t','r','o','l','\\','K','e','y','b','o','a','r','d',' ','L','a','y','o','u','t','s','\\','%','0','8','x',0}; +static const WCHAR szImeRegFmt[] = {'S','y','s','t','e','m','\\','C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\','C','o','n','t','r','o','l','\\','K','e','y','b','o','a','r','d',' ','L','a','y','o','u','t','s','\\','%','0','8','l','x',0}; #define is_himc_ime_unicode(p) (p->immKbd->imeInfo.fdwProperty & IME_PROP_UNICODE) @@ -279,7 +279,7 @@ static ImmHkl *IMM_GetImmHkl(HKL hkl) ImmHkl *ptr; WCHAR filename[MAX_PATH]; - TRACE("Seeking ime for keyboard 0x%x\n",(unsigned)hkl); + TRACE("Seeking ime for keyboard %p\n",hkl); LIST_FOR_EACH_ENTRY(ptr, &ImmHklList, ImmHkl, entry) { @@ -658,7 +658,7 @@ HIMC WINAPI ImmCreateContext(void) } new_context->immKbd->uSelected++; - TRACE("Created context 0x%x\n",(UINT)new_context); + TRACE("Created context %p\n",new_context); return new_context; } @@ -1480,7 +1480,7 @@ BOOL WINAPI ImmGetConversionStatus( */ HWND WINAPI ImmGetDefaultIMEWnd(HWND hWnd) { - TRACE("Default is %x\n",(unsigned)IMM_GetThreadData()->hwndDefault); + TRACE("Default is %p\n",IMM_GetThreadData()->hwndDefault); return IMM_GetThreadData()->hwndDefault; } @@ -1597,7 +1597,7 @@ UINT WINAPI ImmGetIMEFileNameW(HKL hKL, LPWSTR lpszFileName, UINT uBufLen) DWORD rc; WCHAR regKey[sizeof(szImeRegFmt)/sizeof(WCHAR)+8]; - wsprintfW( regKey, szImeRegFmt, (unsigned)hKL ); + wsprintfW( regKey, szImeRegFmt, (ULONG_PTR)hKL ); rc = RegOpenKeyW( HKEY_LOCAL_MACHINE, regKey, &hkey); if (rc != ERROR_SUCCESS) { @@ -1819,8 +1819,8 @@ HKL WINAPI ImmInstallIMEW( { DWORD disposition = 0; - hkl = (HKL)(((0xe000|count)<<16) | lcid); - wsprintfW( regKey, szImeRegFmt, (unsigned)hkl); + hkl = (HKL)MAKELPARAM( lcid, 0xe000 | count ); + wsprintfW( regKey, szImeRegFmt, (ULONG_PTR)hkl); rc = RegCreateKeyExW(HKEY_LOCAL_MACHINE, regKey, 0, NULL, 0, KEY_WRITE, NULL, &hkey, &disposition); if (rc == ERROR_SUCCESS && disposition == REG_CREATED_NEW_KEY) diff --git a/dlls/iphlpapi/ifenum.c b/dlls/iphlpapi/ifenum.c index 2929b701962..f36fc99e896 100644 --- a/dlls/iphlpapi/ifenum.c +++ b/dlls/iphlpapi/ifenum.c @@ -652,17 +652,6 @@ DWORD getInterfaceEntryByName(const char *name, PMIB_IFROW entry) return ret; } -DWORD getInterfaceEntryByIndex(DWORD index, PMIB_IFROW entry) -{ - char nameBuf[IF_NAMESIZE]; - char *name = getInterfaceNameByIndex(index, nameBuf); - - if (name) - return getInterfaceEntryByName(name, entry); - else - return ERROR_INVALID_DATA; -} - /* Enumerates the IP addresses in the system using SIOCGIFCONF, returning * the count to you in *pcAddresses. It also returns to you the struct ifconf * used by the call to ioctl, so that you may process the addresses further. diff --git a/dlls/iphlpapi/ifenum.h b/dlls/iphlpapi/ifenum.h index 775244cdc24..d4717508666 100644 --- a/dlls/iphlpapi/ifenum.h +++ b/dlls/iphlpapi/ifenum.h @@ -91,13 +91,12 @@ DWORD getInterfacePhysicalByName(const char *name, PDWORD len, PBYTE addr, DWORD getInterfacePhysicalByIndex(DWORD index, PDWORD len, PBYTE addr, PDWORD type); -/* Fills in the MIB_IFROW by name/index. Doesn't fill in interface statistics, +/* Fills in the MIB_IFROW by name. Doesn't fill in interface statistics, * see ipstats.h for that. - * Returns ERROR_INVALID_PARAMETER if name or entry is NULL, ERROR_INVALID_DATA - * if name/index isn't valid, and NO_ERROR otherwise. + * Returns ERROR_INVALID_PARAMETER if name is NULL, ERROR_INVALID_DATA + * if name isn't valid, and NO_ERROR otherwise. */ DWORD getInterfaceEntryByName(const char *name, PMIB_IFROW entry); -DWORD getInterfaceEntryByIndex(DWORD index, PMIB_IFROW entry); DWORD getNumIPAddresses(void); diff --git a/dlls/kernel32/cpu.c b/dlls/kernel32/cpu.c index bd3d74add8e..95ac469e889 100644 --- a/dlls/kernel32/cpu.c +++ b/dlls/kernel32/cpu.c @@ -547,7 +547,8 @@ VOID WINAPI GetSystemInfo( #elif defined (__NetBSD__) { int mib[2]; - int value[2]; + int value; + size_t val_len; char model[256]; char *cpuclass; FILE *f = fopen ("/var/run/dmesg.boot", "r"); @@ -556,33 +557,33 @@ VOID WINAPI GetSystemInfo( mib[0] = CTL_MACHDEP; #ifdef CPU_FPU_PRESENT mib[1] = CPU_FPU_PRESENT; - value[1] = sizeof(int); - if (sysctl(mib, 2, value, value+1, NULL, 0) >= 0) + val_len = sizeof(value); + if (sysctl(mib, 2, &value, &val_len, NULL, 0) >= 0) if (value) PF[PF_FLOATING_POINT_EMULATED] = FALSE; else PF[PF_FLOATING_POINT_EMULATED] = TRUE; #endif #ifdef CPU_SSE mib[1] = CPU_SSE; /* this should imply MMX */ - value[1] = sizeof(int); - if (sysctl(mib, 2, value, value+1, NULL, 0) >= 0) + val_len = sizeof(value); + if (sysctl(mib, 2, &value, &val_len, NULL, 0) >= 0) if (value) PF[PF_MMX_INSTRUCTIONS_AVAILABLE] = TRUE; #endif #ifdef CPU_SSE2 mib[1] = CPU_SSE2; /* this should imply MMX */ - value[1] = sizeof(int); - if (sysctl(mib, 2, value, value+1, NULL, 0) >= 0) + value[1] = sizeof(value); + if (sysctl(mib, 2, &value, &val_len, NULL, 0) >= 0) if (value) PF[PF_MMX_INSTRUCTIONS_AVAILABLE] = TRUE; #endif mib[0] = CTL_HW; mib[1] = HW_NCPU; - value[1] = sizeof(int); - if (sysctl(mib, 2, value, value+1, NULL, 0) >= 0) - if (value[0] > cachedsi.dwNumberOfProcessors) + val_len = sizeof(value); + if (sysctl(mib, 2, &value, &val_len, NULL, 0) >= 0) + if (value > cachedsi.dwNumberOfProcessors) cachedsi.dwNumberOfProcessors = value[0]; mib[1] = HW_MODEL; - value[1] = 255; - if (sysctl(mib, 2, model, value+1, NULL, 0) >= 0) { - model[value[1]] = '\0'; /* just in case */ + val_len = sizeof(model)-1; + if (sysctl(mib, 2, model, &val_len, NULL, 0) >= 0) { + model[val_len] = '\0'; /* just in case */ cpuclass = strstr(model, "-class"); if (cpuclass != NULL) { while(cpuclass > model && cpuclass[0] != '(') cpuclass--; @@ -636,7 +637,7 @@ VOID WINAPI GetSystemInfo( #elif defined(__FreeBSD__) { int ret, num; - unsigned len; + size_t len; get_cpuinfo( &cachedsi ); diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c index b4a0b98164a..abbb4139eba 100644 --- a/dlls/kernel32/tests/file.c +++ b/dlls/kernel32/tests/file.c @@ -364,7 +364,7 @@ static void test__llseek( void ) bytes_read = _hread( filehandle, buffer, 1); ok( 1 == bytes_read, "file read size error\n" ); ok( buffer[0] == sillytext[27], "_llseek error, it got lost seeking\n" ); - ok( _llseek( filehandle, -400 * strlen( sillytext ), FILE_END ) != -1, "should be able to seek\n" ); + ok( _llseek( filehandle, -400 * (LONG)strlen( sillytext ), FILE_END ) != -1, "should be able to seek\n" ); bytes_read = _hread( filehandle, buffer, 1); ok( 1 == bytes_read, "file read size error\n" ); @@ -1845,8 +1845,8 @@ static void test_OpenFile(void) ok( ofs.cBytes == sizeof(OFSTRUCT), "OpenFile set ofs.cBytes to %d\n", ofs.cBytes ); ok( ofs.nErrCode == ERROR_SUCCESS || broken(ofs.nErrCode != ERROR_SUCCESS) /* win9x */, "OpenFile set ofs.nErrCode to %d\n", ofs.nErrCode ); - ret = CloseHandle((HANDLE)hFile); - ok( ret == TRUE, "CloseHandle() returns %d\n", ret ); + ret = _lclose(hFile); + ok( !ret, "_lclose() returns %d\n", ret ); retval = GetFileAttributesA(filename); ok( retval != INVALID_FILE_ATTRIBUTES, "GetFileAttributesA: error %d\n", GetLastError() ); @@ -1863,8 +1863,8 @@ static void test_OpenFile(void) "OpenFile set ofs.nErrCode to %d\n", ofs.nErrCode ); ok( lstrcmpiA(ofs.szPathName, buff) == 0, "OpenFile returned '%s', but was expected to return '%s'\n", ofs.szPathName, buff ); - ret = CloseHandle((HANDLE)hFile); - ok( ret == TRUE, "CloseHandle() returns %d\n", ret ); + ret = _lclose(hFile); + ok( !ret, "_lclose() returns %d\n", ret ); memset(&ofs, 0xA5, sizeof(ofs)); SetLastError(0xfaceabee); @@ -1878,8 +1878,8 @@ static void test_OpenFile(void) "OpenFile set ofs.nErrCode to %d\n", ofs.nErrCode ); ok( lstrcmpiA(ofs.szPathName, buff) == 0, "OpenFile returned '%s', but was expected to return '%s'\n", ofs.szPathName, buff ); - ret = CloseHandle((HANDLE)hFile); - ok( ret == TRUE, "CloseHandle() returns %d\n", ret ); + ret = _lclose(hFile); + ok( !ret, "_lclose() returns %d\n", ret ); memset(&ofs, 0xA5, sizeof(ofs)); SetLastError(0xfaceabee); @@ -1893,8 +1893,8 @@ static void test_OpenFile(void) "OpenFile set ofs.nErrCode to %d\n", ofs.nErrCode ); ok( lstrcmpiA(ofs.szPathName, buff) == 0, "OpenFile returned '%s', but was expected to return '%s'\n", ofs.szPathName, buff ); - ret = CloseHandle((HANDLE)hFile); - ok( ret == TRUE, "CloseHandle() returns %d\n", ret ); + ret = _lclose(hFile); + ok( !ret, "_lclose() returns %d\n", ret ); memset(&ofs, 0xA5, sizeof(ofs)); SetLastError(0xfaceabee); diff --git a/dlls/kernel32/tests/generated.c b/dlls/kernel32/tests/generated.c dissimilarity index 63% index 846d7268a49..be68a085936 100644 --- a/dlls/kernel32/tests/generated.c +++ b/dlls/kernel32/tests/generated.c @@ -1,1335 +1,2080 @@ -/* File generated automatically from tools/winapi/test.dat; do not edit! */ -/* This file can be copied, modified and distributed without restriction. */ - -/* - * Unit tests for data structure packing - */ - -#define WINVER 0x0501 -#define _WIN32_IE 0x0501 -#define _WIN32_WINNT 0x0501 - -#define WINE_NOWINSOCK - -#include "windows.h" - -#include "wine/test.h" - -/*********************************************************************** - * Compatibility macros - */ - -#define DWORD_PTR UINT_PTR -#define LONG_PTR INT_PTR -#define ULONG_PTR UINT_PTR - -/*********************************************************************** - * Windows API extension - */ - -#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) -# define FIELD_ALIGNMENT(type, field) __alignof(((type*)0)->field) -#elif defined(__GNUC__) -# define FIELD_ALIGNMENT(type, field) __alignof__(((type*)0)->field) -#else -/* FIXME: Not sure if is possible to do without compiler extension */ -#endif - -#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) -# define _TYPE_ALIGNMENT(type) __alignof(type) -#elif defined(__GNUC__) -# define _TYPE_ALIGNMENT(type) __alignof__(type) -#else -/* - * FIXME: Not sure if is possible to do without compiler extension - * (if type is not just a name that is, if so the normal) - * TYPE_ALIGNMENT can be used) - */ -#endif - -#if defined(TYPE_ALIGNMENT) && defined(_MSC_VER) && _MSC_VER >= 800 && !defined(__cplusplus) -#pragma warning(disable:4116) -#endif - -#if !defined(TYPE_ALIGNMENT) && defined(_TYPE_ALIGNMENT) -# define TYPE_ALIGNMENT _TYPE_ALIGNMENT -#endif - -/*********************************************************************** - * Test helper macros - */ - -#ifdef FIELD_ALIGNMENT -# define TEST_FIELD_ALIGNMENT(type, field, align) \ - ok(FIELD_ALIGNMENT(type, field) == align, \ - "FIELD_ALIGNMENT(" #type ", " #field ") == %d (expected " #align ")\n", \ - (int)FIELD_ALIGNMENT(type, field)) -#else -# define TEST_FIELD_ALIGNMENT(type, field, align) do { } while (0) -#endif - -#define TEST_FIELD_OFFSET(type, field, offset) \ - ok(FIELD_OFFSET(type, field) == offset, \ - "FIELD_OFFSET(" #type ", " #field ") == %ld (expected " #offset ")\n", \ - (long int)FIELD_OFFSET(type, field)) - -#ifdef _TYPE_ALIGNMENT -#define TEST__TYPE_ALIGNMENT(type, align) \ - ok(_TYPE_ALIGNMENT(type) == align, "TYPE_ALIGNMENT(" #type ") == %d (expected " #align ")\n", (int)_TYPE_ALIGNMENT(type)) -#else -# define TEST__TYPE_ALIGNMENT(type, align) do { } while (0) -#endif - -#ifdef TYPE_ALIGNMENT -#define TEST_TYPE_ALIGNMENT(type, align) \ - ok(TYPE_ALIGNMENT(type) == align, "TYPE_ALIGNMENT(" #type ") == %d (expected " #align ")\n", (int)TYPE_ALIGNMENT(type)) -#else -# define TEST_TYPE_ALIGNMENT(type, align) do { } while (0) -#endif - -#define TEST_TYPE_SIZE(type, size) \ - ok(sizeof(type) == size, "sizeof(" #type ") == %d (expected " #size ")\n", ((int) sizeof(type))) - -/*********************************************************************** - * Test macros - */ - -#define TEST_FIELD(type, field_type, field_name, field_offset, field_size, field_align) \ - TEST_TYPE_SIZE(field_type, field_size); \ - TEST_FIELD_ALIGNMENT(type, field_name, field_align); \ - TEST_FIELD_OFFSET(type, field_name, field_offset); \ - -#define TEST_TYPE(type, size, align) \ - TEST_TYPE_ALIGNMENT(type, align); \ - TEST_TYPE_SIZE(type, size) - -#define TEST_TYPE_POINTER(type, size, align) \ - TEST__TYPE_ALIGNMENT(*(type)0, align); \ - TEST_TYPE_SIZE(*(type)0, size) - -#define TEST_TYPE_SIGNED(type) \ - ok((type) -1 < 0, "(" #type ") -1 < 0\n"); - -#define TEST_TYPE_UNSIGNED(type) \ - ok((type) -1 > 0, "(" #type ") -1 > 0\n"); - -static void test_pack_LPOSVERSIONINFOA(void) -{ - /* LPOSVERSIONINFOA */ - TEST_TYPE(LPOSVERSIONINFOA, 4, 4); - TEST_TYPE_POINTER(LPOSVERSIONINFOA, 148, 4); -} - -static void test_pack_LPOSVERSIONINFOEXA(void) -{ - /* LPOSVERSIONINFOEXA */ - TEST_TYPE(LPOSVERSIONINFOEXA, 4, 4); - TEST_TYPE_POINTER(LPOSVERSIONINFOEXA, 156, 4); -} - -static void test_pack_LPOSVERSIONINFOEXW(void) -{ - /* LPOSVERSIONINFOEXW */ - TEST_TYPE(LPOSVERSIONINFOEXW, 4, 4); - TEST_TYPE_POINTER(LPOSVERSIONINFOEXW, 284, 4); -} - -static void test_pack_LPOSVERSIONINFOW(void) -{ - /* LPOSVERSIONINFOW */ - TEST_TYPE(LPOSVERSIONINFOW, 4, 4); - TEST_TYPE_POINTER(LPOSVERSIONINFOW, 276, 4); -} - -static void test_pack_OSVERSIONINFOA(void) -{ - /* OSVERSIONINFOA (pack 4) */ - TEST_TYPE(OSVERSIONINFOA, 148, 4); - TEST_FIELD(OSVERSIONINFOA, DWORD, dwOSVersionInfoSize, 0, 4, 4); - TEST_FIELD(OSVERSIONINFOA, DWORD, dwMajorVersion, 4, 4, 4); - TEST_FIELD(OSVERSIONINFOA, DWORD, dwMinorVersion, 8, 4, 4); - TEST_FIELD(OSVERSIONINFOA, DWORD, dwBuildNumber, 12, 4, 4); - TEST_FIELD(OSVERSIONINFOA, DWORD, dwPlatformId, 16, 4, 4); - TEST_FIELD(OSVERSIONINFOA, CHAR[128], szCSDVersion, 20, 128, 1); -} - -static void test_pack_OSVERSIONINFOEXA(void) -{ - /* OSVERSIONINFOEXA (pack 4) */ - TEST_TYPE(OSVERSIONINFOEXA, 156, 4); - TEST_FIELD(OSVERSIONINFOEXA, DWORD, dwOSVersionInfoSize, 0, 4, 4); - TEST_FIELD(OSVERSIONINFOEXA, DWORD, dwMajorVersion, 4, 4, 4); - TEST_FIELD(OSVERSIONINFOEXA, DWORD, dwMinorVersion, 8, 4, 4); - TEST_FIELD(OSVERSIONINFOEXA, DWORD, dwBuildNumber, 12, 4, 4); - TEST_FIELD(OSVERSIONINFOEXA, DWORD, dwPlatformId, 16, 4, 4); - TEST_FIELD(OSVERSIONINFOEXA, CHAR[128], szCSDVersion, 20, 128, 1); - TEST_FIELD(OSVERSIONINFOEXA, WORD, wServicePackMajor, 148, 2, 2); - TEST_FIELD(OSVERSIONINFOEXA, WORD, wServicePackMinor, 150, 2, 2); - TEST_FIELD(OSVERSIONINFOEXA, WORD, wSuiteMask, 152, 2, 2); - TEST_FIELD(OSVERSIONINFOEXA, BYTE, wProductType, 154, 1, 1); - TEST_FIELD(OSVERSIONINFOEXA, BYTE, wReserved, 155, 1, 1); -} - -static void test_pack_OSVERSIONINFOEXW(void) -{ - /* OSVERSIONINFOEXW (pack 4) */ - TEST_TYPE(OSVERSIONINFOEXW, 284, 4); - TEST_FIELD(OSVERSIONINFOEXW, DWORD, dwOSVersionInfoSize, 0, 4, 4); - TEST_FIELD(OSVERSIONINFOEXW, DWORD, dwMajorVersion, 4, 4, 4); - TEST_FIELD(OSVERSIONINFOEXW, DWORD, dwMinorVersion, 8, 4, 4); - TEST_FIELD(OSVERSIONINFOEXW, DWORD, dwBuildNumber, 12, 4, 4); - TEST_FIELD(OSVERSIONINFOEXW, DWORD, dwPlatformId, 16, 4, 4); - TEST_FIELD(OSVERSIONINFOEXW, WCHAR[128], szCSDVersion, 20, 256, 2); - TEST_FIELD(OSVERSIONINFOEXW, WORD, wServicePackMajor, 276, 2, 2); - TEST_FIELD(OSVERSIONINFOEXW, WORD, wServicePackMinor, 278, 2, 2); - TEST_FIELD(OSVERSIONINFOEXW, WORD, wSuiteMask, 280, 2, 2); - TEST_FIELD(OSVERSIONINFOEXW, BYTE, wProductType, 282, 1, 1); - TEST_FIELD(OSVERSIONINFOEXW, BYTE, wReserved, 283, 1, 1); -} - -static void test_pack_OSVERSIONINFOW(void) -{ - /* OSVERSIONINFOW (pack 4) */ - TEST_TYPE(OSVERSIONINFOW, 276, 4); - TEST_FIELD(OSVERSIONINFOW, DWORD, dwOSVersionInfoSize, 0, 4, 4); - TEST_FIELD(OSVERSIONINFOW, DWORD, dwMajorVersion, 4, 4, 4); - TEST_FIELD(OSVERSIONINFOW, DWORD, dwMinorVersion, 8, 4, 4); - TEST_FIELD(OSVERSIONINFOW, DWORD, dwBuildNumber, 12, 4, 4); - TEST_FIELD(OSVERSIONINFOW, DWORD, dwPlatformId, 16, 4, 4); - TEST_FIELD(OSVERSIONINFOW, WCHAR[128], szCSDVersion, 20, 256, 2); -} - -static void test_pack_POSVERSIONINFOA(void) -{ - /* POSVERSIONINFOA */ - TEST_TYPE(POSVERSIONINFOA, 4, 4); - TEST_TYPE_POINTER(POSVERSIONINFOA, 148, 4); -} - -static void test_pack_POSVERSIONINFOEXA(void) -{ - /* POSVERSIONINFOEXA */ - TEST_TYPE(POSVERSIONINFOEXA, 4, 4); - TEST_TYPE_POINTER(POSVERSIONINFOEXA, 156, 4); -} - -static void test_pack_POSVERSIONINFOEXW(void) -{ - /* POSVERSIONINFOEXW */ - TEST_TYPE(POSVERSIONINFOEXW, 4, 4); - TEST_TYPE_POINTER(POSVERSIONINFOEXW, 284, 4); -} - -static void test_pack_POSVERSIONINFOW(void) -{ - /* POSVERSIONINFOW */ - TEST_TYPE(POSVERSIONINFOW, 4, 4); - TEST_TYPE_POINTER(POSVERSIONINFOW, 276, 4); -} - -static void test_pack_LPLONG(void) -{ - /* LPLONG */ - TEST_TYPE(LPLONG, 4, 4); -} - -static void test_pack_LPVOID(void) -{ - /* LPVOID */ - TEST_TYPE(LPVOID, 4, 4); -} - -static void test_pack_PHKEY(void) -{ - /* PHKEY */ - TEST_TYPE(PHKEY, 4, 4); -} - -static void test_pack_ACTCTXA(void) -{ - /* ACTCTXA (pack 4) */ - TEST_TYPE(ACTCTXA, 32, 4); - TEST_FIELD(ACTCTXA, ULONG, cbSize, 0, 4, 4); - TEST_FIELD(ACTCTXA, DWORD, dwFlags, 4, 4, 4); - TEST_FIELD(ACTCTXA, LPCSTR, lpSource, 8, 4, 4); - TEST_FIELD(ACTCTXA, USHORT, wProcessorArchitecture, 12, 2, 2); - TEST_FIELD(ACTCTXA, LANGID, wLangId, 14, 2, 2); - TEST_FIELD(ACTCTXA, LPCSTR, lpAssemblyDirectory, 16, 4, 4); - TEST_FIELD(ACTCTXA, LPCSTR, lpResourceName, 20, 4, 4); - TEST_FIELD(ACTCTXA, LPCSTR, lpApplicationName, 24, 4, 4); - TEST_FIELD(ACTCTXA, HMODULE, hModule, 28, 4, 4); -} - -static void test_pack_ACTCTXW(void) -{ - /* ACTCTXW (pack 4) */ - TEST_TYPE(ACTCTXW, 32, 4); - TEST_FIELD(ACTCTXW, ULONG, cbSize, 0, 4, 4); - TEST_FIELD(ACTCTXW, DWORD, dwFlags, 4, 4, 4); - TEST_FIELD(ACTCTXW, LPCWSTR, lpSource, 8, 4, 4); - TEST_FIELD(ACTCTXW, USHORT, wProcessorArchitecture, 12, 2, 2); - TEST_FIELD(ACTCTXW, LANGID, wLangId, 14, 2, 2); - TEST_FIELD(ACTCTXW, LPCWSTR, lpAssemblyDirectory, 16, 4, 4); - TEST_FIELD(ACTCTXW, LPCWSTR, lpResourceName, 20, 4, 4); - TEST_FIELD(ACTCTXW, LPCWSTR, lpApplicationName, 24, 4, 4); - TEST_FIELD(ACTCTXW, HMODULE, hModule, 28, 4, 4); -} - -static void test_pack_ACTCTX_SECTION_KEYED_DATA(void) -{ - /* ACTCTX_SECTION_KEYED_DATA (pack 4) */ - TEST_TYPE(ACTCTX_SECTION_KEYED_DATA, 64, 4); - TEST_FIELD(ACTCTX_SECTION_KEYED_DATA, ULONG, cbSize, 0, 4, 4); - TEST_FIELD(ACTCTX_SECTION_KEYED_DATA, ULONG, ulDataFormatVersion, 4, 4, 4); - TEST_FIELD(ACTCTX_SECTION_KEYED_DATA, PVOID, lpData, 8, 4, 4); - TEST_FIELD(ACTCTX_SECTION_KEYED_DATA, ULONG, ulLength, 12, 4, 4); - TEST_FIELD(ACTCTX_SECTION_KEYED_DATA, PVOID, lpSectionGlobalData, 16, 4, 4); - TEST_FIELD(ACTCTX_SECTION_KEYED_DATA, ULONG, ulSectionGlobalDataLength, 20, 4, 4); - TEST_FIELD(ACTCTX_SECTION_KEYED_DATA, PVOID, lpSectionBase, 24, 4, 4); - TEST_FIELD(ACTCTX_SECTION_KEYED_DATA, ULONG, ulSectionTotalLength, 28, 4, 4); - TEST_FIELD(ACTCTX_SECTION_KEYED_DATA, HANDLE, hActCtx, 32, 4, 4); - TEST_FIELD(ACTCTX_SECTION_KEYED_DATA, ULONG, ulAssemblyRosterIndex, 36, 4, 4); - TEST_FIELD(ACTCTX_SECTION_KEYED_DATA, ULONG, ulFlags, 40, 4, 4); - TEST_FIELD(ACTCTX_SECTION_KEYED_DATA, ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, AssemblyMetadata, 44, 20, 4); -} - -static void test_pack_ACTCTX_SECTION_KEYED_DATA_2600(void) -{ - /* ACTCTX_SECTION_KEYED_DATA_2600 (pack 4) */ - TEST_TYPE(ACTCTX_SECTION_KEYED_DATA_2600, 40, 4); - TEST_FIELD(ACTCTX_SECTION_KEYED_DATA_2600, ULONG, cbSize, 0, 4, 4); - TEST_FIELD(ACTCTX_SECTION_KEYED_DATA_2600, ULONG, ulDataFormatVersion, 4, 4, 4); - TEST_FIELD(ACTCTX_SECTION_KEYED_DATA_2600, PVOID, lpData, 8, 4, 4); - TEST_FIELD(ACTCTX_SECTION_KEYED_DATA_2600, ULONG, ulLength, 12, 4, 4); - TEST_FIELD(ACTCTX_SECTION_KEYED_DATA_2600, PVOID, lpSectionGlobalData, 16, 4, 4); - TEST_FIELD(ACTCTX_SECTION_KEYED_DATA_2600, ULONG, ulSectionGlobalDataLength, 20, 4, 4); - TEST_FIELD(ACTCTX_SECTION_KEYED_DATA_2600, PVOID, lpSectionBase, 24, 4, 4); - TEST_FIELD(ACTCTX_SECTION_KEYED_DATA_2600, ULONG, ulSectionTotalLength, 28, 4, 4); - TEST_FIELD(ACTCTX_SECTION_KEYED_DATA_2600, HANDLE, hActCtx, 32, 4, 4); - TEST_FIELD(ACTCTX_SECTION_KEYED_DATA_2600, ULONG, ulAssemblyRosterIndex, 36, 4, 4); -} - -static void test_pack_ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA(void) -{ - /* ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA (pack 4) */ - TEST_TYPE(ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, 20, 4); - TEST_FIELD(ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, PVOID, lpInformation, 0, 4, 4); - TEST_FIELD(ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, PVOID, lpSectionBase, 4, 4, 4); - TEST_FIELD(ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, ULONG, ulSectionLength, 8, 4, 4); - TEST_FIELD(ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, PVOID, lpSectionGlobalDataBase, 12, 4, 4); - TEST_FIELD(ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, ULONG, ulSectionGlobalDataLength, 16, 4, 4); -} - -static void test_pack_ACTIVATION_CONTEXT_BASIC_INFORMATION(void) -{ - /* ACTIVATION_CONTEXT_BASIC_INFORMATION (pack 4) */ - TEST_TYPE(ACTIVATION_CONTEXT_BASIC_INFORMATION, 8, 4); - TEST_FIELD(ACTIVATION_CONTEXT_BASIC_INFORMATION, HANDLE, hActCtx, 0, 4, 4); - TEST_FIELD(ACTIVATION_CONTEXT_BASIC_INFORMATION, DWORD, dwFlags, 4, 4, 4); -} - -static void test_pack_BY_HANDLE_FILE_INFORMATION(void) -{ - /* BY_HANDLE_FILE_INFORMATION (pack 4) */ - TEST_TYPE(BY_HANDLE_FILE_INFORMATION, 52, 4); - TEST_FIELD(BY_HANDLE_FILE_INFORMATION, DWORD, dwFileAttributes, 0, 4, 4); - TEST_FIELD(BY_HANDLE_FILE_INFORMATION, FILETIME, ftCreationTime, 4, 8, 4); - TEST_FIELD(BY_HANDLE_FILE_INFORMATION, FILETIME, ftLastAccessTime, 12, 8, 4); - TEST_FIELD(BY_HANDLE_FILE_INFORMATION, FILETIME, ftLastWriteTime, 20, 8, 4); - TEST_FIELD(BY_HANDLE_FILE_INFORMATION, DWORD, dwVolumeSerialNumber, 28, 4, 4); - TEST_FIELD(BY_HANDLE_FILE_INFORMATION, DWORD, nFileSizeHigh, 32, 4, 4); - TEST_FIELD(BY_HANDLE_FILE_INFORMATION, DWORD, nFileSizeLow, 36, 4, 4); - TEST_FIELD(BY_HANDLE_FILE_INFORMATION, DWORD, nNumberOfLinks, 40, 4, 4); - TEST_FIELD(BY_HANDLE_FILE_INFORMATION, DWORD, nFileIndexHigh, 44, 4, 4); - TEST_FIELD(BY_HANDLE_FILE_INFORMATION, DWORD, nFileIndexLow, 48, 4, 4); -} - -static void test_pack_COMMCONFIG(void) -{ - /* COMMCONFIG (pack 4) */ - TEST_TYPE(COMMCONFIG, 52, 4); - TEST_FIELD(COMMCONFIG, DWORD, dwSize, 0, 4, 4); - TEST_FIELD(COMMCONFIG, WORD, wVersion, 4, 2, 2); - TEST_FIELD(COMMCONFIG, WORD, wReserved, 6, 2, 2); - TEST_FIELD(COMMCONFIG, DCB, dcb, 8, 28, 4); - TEST_FIELD(COMMCONFIG, DWORD, dwProviderSubType, 36, 4, 4); - TEST_FIELD(COMMCONFIG, DWORD, dwProviderOffset, 40, 4, 4); - TEST_FIELD(COMMCONFIG, DWORD, dwProviderSize, 44, 4, 4); - TEST_FIELD(COMMCONFIG, DWORD[1], wcProviderData, 48, 4, 4); -} - -static void test_pack_COMMPROP(void) -{ - /* COMMPROP (pack 4) */ - TEST_TYPE(COMMPROP, 64, 4); - TEST_FIELD(COMMPROP, WORD, wPacketLength, 0, 2, 2); - TEST_FIELD(COMMPROP, WORD, wPacketVersion, 2, 2, 2); - TEST_FIELD(COMMPROP, DWORD, dwServiceMask, 4, 4, 4); - TEST_FIELD(COMMPROP, DWORD, dwReserved1, 8, 4, 4); - TEST_FIELD(COMMPROP, DWORD, dwMaxTxQueue, 12, 4, 4); - TEST_FIELD(COMMPROP, DWORD, dwMaxRxQueue, 16, 4, 4); - TEST_FIELD(COMMPROP, DWORD, dwMaxBaud, 20, 4, 4); - TEST_FIELD(COMMPROP, DWORD, dwProvSubType, 24, 4, 4); - TEST_FIELD(COMMPROP, DWORD, dwProvCapabilities, 28, 4, 4); - TEST_FIELD(COMMPROP, DWORD, dwSettableParams, 32, 4, 4); - TEST_FIELD(COMMPROP, DWORD, dwSettableBaud, 36, 4, 4); - TEST_FIELD(COMMPROP, WORD, wSettableData, 40, 2, 2); - TEST_FIELD(COMMPROP, WORD, wSettableStopParity, 42, 2, 2); - TEST_FIELD(COMMPROP, DWORD, dwCurrentTxQueue, 44, 4, 4); - TEST_FIELD(COMMPROP, DWORD, dwCurrentRxQueue, 48, 4, 4); - TEST_FIELD(COMMPROP, DWORD, dwProvSpec1, 52, 4, 4); - TEST_FIELD(COMMPROP, DWORD, dwProvSpec2, 56, 4, 4); - TEST_FIELD(COMMPROP, WCHAR[1], wcProvChar, 60, 2, 2); -} - -static void test_pack_COMMTIMEOUTS(void) -{ - /* COMMTIMEOUTS (pack 4) */ - TEST_TYPE(COMMTIMEOUTS, 20, 4); - TEST_FIELD(COMMTIMEOUTS, DWORD, ReadIntervalTimeout, 0, 4, 4); - TEST_FIELD(COMMTIMEOUTS, DWORD, ReadTotalTimeoutMultiplier, 4, 4, 4); - TEST_FIELD(COMMTIMEOUTS, DWORD, ReadTotalTimeoutConstant, 8, 4, 4); - TEST_FIELD(COMMTIMEOUTS, DWORD, WriteTotalTimeoutMultiplier, 12, 4, 4); - TEST_FIELD(COMMTIMEOUTS, DWORD, WriteTotalTimeoutConstant, 16, 4, 4); -} - -static void test_pack_COMSTAT(void) -{ - /* COMSTAT (pack 4) */ - TEST_TYPE(COMSTAT, 12, 4); - TEST_FIELD(COMSTAT, DWORD, cbInQue, 4, 4, 4); - TEST_FIELD(COMSTAT, DWORD, cbOutQue, 8, 4, 4); -} - -static void test_pack_CREATE_PROCESS_DEBUG_INFO(void) -{ - /* CREATE_PROCESS_DEBUG_INFO (pack 4) */ - TEST_TYPE(CREATE_PROCESS_DEBUG_INFO, 40, 4); - TEST_FIELD(CREATE_PROCESS_DEBUG_INFO, HANDLE, hFile, 0, 4, 4); - TEST_FIELD(CREATE_PROCESS_DEBUG_INFO, HANDLE, hProcess, 4, 4, 4); - TEST_FIELD(CREATE_PROCESS_DEBUG_INFO, HANDLE, hThread, 8, 4, 4); - TEST_FIELD(CREATE_PROCESS_DEBUG_INFO, LPVOID, lpBaseOfImage, 12, 4, 4); - TEST_FIELD(CREATE_PROCESS_DEBUG_INFO, DWORD, dwDebugInfoFileOffset, 16, 4, 4); - TEST_FIELD(CREATE_PROCESS_DEBUG_INFO, DWORD, nDebugInfoSize, 20, 4, 4); - TEST_FIELD(CREATE_PROCESS_DEBUG_INFO, LPVOID, lpThreadLocalBase, 24, 4, 4); - TEST_FIELD(CREATE_PROCESS_DEBUG_INFO, LPTHREAD_START_ROUTINE, lpStartAddress, 28, 4, 4); - TEST_FIELD(CREATE_PROCESS_DEBUG_INFO, LPVOID, lpImageName, 32, 4, 4); - TEST_FIELD(CREATE_PROCESS_DEBUG_INFO, WORD, fUnicode, 36, 2, 2); -} - -static void test_pack_CREATE_THREAD_DEBUG_INFO(void) -{ - /* CREATE_THREAD_DEBUG_INFO (pack 4) */ - TEST_TYPE(CREATE_THREAD_DEBUG_INFO, 12, 4); - TEST_FIELD(CREATE_THREAD_DEBUG_INFO, HANDLE, hThread, 0, 4, 4); - TEST_FIELD(CREATE_THREAD_DEBUG_INFO, LPVOID, lpThreadLocalBase, 4, 4, 4); - TEST_FIELD(CREATE_THREAD_DEBUG_INFO, LPTHREAD_START_ROUTINE, lpStartAddress, 8, 4, 4); -} - -static void test_pack_CRITICAL_SECTION(void) -{ - /* CRITICAL_SECTION */ - TEST_TYPE(CRITICAL_SECTION, 24, 4); -} - -static void test_pack_CRITICAL_SECTION_DEBUG(void) -{ - /* CRITICAL_SECTION_DEBUG */ -} - -static void test_pack_DCB(void) -{ - /* DCB (pack 4) */ - TEST_TYPE(DCB, 28, 4); - TEST_FIELD(DCB, DWORD, DCBlength, 0, 4, 4); - TEST_FIELD(DCB, DWORD, BaudRate, 4, 4, 4); - TEST_FIELD(DCB, WORD, wReserved, 12, 2, 2); - TEST_FIELD(DCB, WORD, XonLim, 14, 2, 2); - TEST_FIELD(DCB, WORD, XoffLim, 16, 2, 2); - TEST_FIELD(DCB, BYTE, ByteSize, 18, 1, 1); - TEST_FIELD(DCB, BYTE, Parity, 19, 1, 1); - TEST_FIELD(DCB, BYTE, StopBits, 20, 1, 1); - TEST_FIELD(DCB, char, XonChar, 21, 1, 1); - TEST_FIELD(DCB, char, XoffChar, 22, 1, 1); - TEST_FIELD(DCB, char, ErrorChar, 23, 1, 1); - TEST_FIELD(DCB, char, EofChar, 24, 1, 1); - TEST_FIELD(DCB, char, EvtChar, 25, 1, 1); - TEST_FIELD(DCB, WORD, wReserved1, 26, 2, 2); -} - -static void test_pack_DEBUG_EVENT(void) -{ - /* DEBUG_EVENT (pack 4) */ - TEST_FIELD(DEBUG_EVENT, DWORD, dwDebugEventCode, 0, 4, 4); - TEST_FIELD(DEBUG_EVENT, DWORD, dwProcessId, 4, 4, 4); - TEST_FIELD(DEBUG_EVENT, DWORD, dwThreadId, 8, 4, 4); -} - -static void test_pack_ENUMRESLANGPROCA(void) -{ - /* ENUMRESLANGPROCA */ - TEST_TYPE(ENUMRESLANGPROCA, 4, 4); -} - -static void test_pack_ENUMRESLANGPROCW(void) -{ - /* ENUMRESLANGPROCW */ - TEST_TYPE(ENUMRESLANGPROCW, 4, 4); -} - -static void test_pack_ENUMRESNAMEPROCA(void) -{ - /* ENUMRESNAMEPROCA */ - TEST_TYPE(ENUMRESNAMEPROCA, 4, 4); -} - -static void test_pack_ENUMRESNAMEPROCW(void) -{ - /* ENUMRESNAMEPROCW */ - TEST_TYPE(ENUMRESNAMEPROCW, 4, 4); -} - -static void test_pack_ENUMRESTYPEPROCA(void) -{ - /* ENUMRESTYPEPROCA */ - TEST_TYPE(ENUMRESTYPEPROCA, 4, 4); -} - -static void test_pack_ENUMRESTYPEPROCW(void) -{ - /* ENUMRESTYPEPROCW */ - TEST_TYPE(ENUMRESTYPEPROCW, 4, 4); -} - -static void test_pack_EXCEPTION_DEBUG_INFO(void) -{ - /* EXCEPTION_DEBUG_INFO (pack 4) */ - TEST_TYPE(EXCEPTION_DEBUG_INFO, 84, 4); - TEST_FIELD(EXCEPTION_DEBUG_INFO, EXCEPTION_RECORD, ExceptionRecord, 0, 80, 4); - TEST_FIELD(EXCEPTION_DEBUG_INFO, DWORD, dwFirstChance, 80, 4, 4); -} - -static void test_pack_EXIT_PROCESS_DEBUG_INFO(void) -{ - /* EXIT_PROCESS_DEBUG_INFO (pack 4) */ - TEST_TYPE(EXIT_PROCESS_DEBUG_INFO, 4, 4); - TEST_FIELD(EXIT_PROCESS_DEBUG_INFO, DWORD, dwExitCode, 0, 4, 4); -} - -static void test_pack_EXIT_THREAD_DEBUG_INFO(void) -{ - /* EXIT_THREAD_DEBUG_INFO (pack 4) */ - TEST_TYPE(EXIT_THREAD_DEBUG_INFO, 4, 4); - TEST_FIELD(EXIT_THREAD_DEBUG_INFO, DWORD, dwExitCode, 0, 4, 4); -} - -static void test_pack_HW_PROFILE_INFOA(void) -{ - /* HW_PROFILE_INFOA (pack 4) */ - TEST_TYPE(HW_PROFILE_INFOA, 124, 4); - TEST_FIELD(HW_PROFILE_INFOA, DWORD, dwDockInfo, 0, 4, 4); - TEST_FIELD(HW_PROFILE_INFOA, CHAR[HW_PROFILE_GUIDLEN], szHwProfileGuid, 4, 39, 1); - TEST_FIELD(HW_PROFILE_INFOA, CHAR[MAX_PROFILE_LEN], szHwProfileName, 43, 80, 1); -} - -static void test_pack_HW_PROFILE_INFOW(void) -{ - /* HW_PROFILE_INFOW (pack 4) */ - TEST_TYPE(HW_PROFILE_INFOW, 244, 4); - TEST_FIELD(HW_PROFILE_INFOW, DWORD, dwDockInfo, 0, 4, 4); - TEST_FIELD(HW_PROFILE_INFOW, WCHAR[HW_PROFILE_GUIDLEN], szHwProfileGuid, 4, 78, 2); - TEST_FIELD(HW_PROFILE_INFOW, WCHAR[MAX_PROFILE_LEN], szHwProfileName, 82, 160, 2); -} - -static void test_pack_LOAD_DLL_DEBUG_INFO(void) -{ - /* LOAD_DLL_DEBUG_INFO (pack 4) */ - TEST_TYPE(LOAD_DLL_DEBUG_INFO, 24, 4); - TEST_FIELD(LOAD_DLL_DEBUG_INFO, HANDLE, hFile, 0, 4, 4); - TEST_FIELD(LOAD_DLL_DEBUG_INFO, LPVOID, lpBaseOfDll, 4, 4, 4); - TEST_FIELD(LOAD_DLL_DEBUG_INFO, DWORD, dwDebugInfoFileOffset, 8, 4, 4); - TEST_FIELD(LOAD_DLL_DEBUG_INFO, DWORD, nDebugInfoSize, 12, 4, 4); - TEST_FIELD(LOAD_DLL_DEBUG_INFO, LPVOID, lpImageName, 16, 4, 4); - TEST_FIELD(LOAD_DLL_DEBUG_INFO, WORD, fUnicode, 20, 2, 2); -} - -static void test_pack_LPBY_HANDLE_FILE_INFORMATION(void) -{ - /* LPBY_HANDLE_FILE_INFORMATION */ - TEST_TYPE(LPBY_HANDLE_FILE_INFORMATION, 4, 4); - TEST_TYPE_POINTER(LPBY_HANDLE_FILE_INFORMATION, 52, 4); -} - -static void test_pack_LPCOMMCONFIG(void) -{ - /* LPCOMMCONFIG */ - TEST_TYPE(LPCOMMCONFIG, 4, 4); - TEST_TYPE_POINTER(LPCOMMCONFIG, 52, 4); -} - -static void test_pack_LPCOMMPROP(void) -{ - /* LPCOMMPROP */ - TEST_TYPE(LPCOMMPROP, 4, 4); - TEST_TYPE_POINTER(LPCOMMPROP, 64, 4); -} - -static void test_pack_LPCOMMTIMEOUTS(void) -{ - /* LPCOMMTIMEOUTS */ - TEST_TYPE(LPCOMMTIMEOUTS, 4, 4); - TEST_TYPE_POINTER(LPCOMMTIMEOUTS, 20, 4); -} - -static void test_pack_LPCOMSTAT(void) -{ - /* LPCOMSTAT */ - TEST_TYPE(LPCOMSTAT, 4, 4); - TEST_TYPE_POINTER(LPCOMSTAT, 12, 4); -} - -static void test_pack_LPCRITICAL_SECTION(void) -{ - /* LPCRITICAL_SECTION */ - TEST_TYPE(LPCRITICAL_SECTION, 4, 4); -} - -static void test_pack_LPCRITICAL_SECTION_DEBUG(void) -{ - /* LPCRITICAL_SECTION_DEBUG */ - TEST_TYPE(LPCRITICAL_SECTION_DEBUG, 4, 4); -} - -static void test_pack_LPDCB(void) -{ - /* LPDCB */ - TEST_TYPE(LPDCB, 4, 4); - TEST_TYPE_POINTER(LPDCB, 28, 4); -} - -static void test_pack_LPDEBUG_EVENT(void) -{ - /* LPDEBUG_EVENT */ - TEST_TYPE(LPDEBUG_EVENT, 4, 4); -} - -static void test_pack_LPEXCEPTION_POINTERS(void) -{ - /* LPEXCEPTION_POINTERS */ - TEST_TYPE(LPEXCEPTION_POINTERS, 4, 4); -} - -static void test_pack_LPEXCEPTION_RECORD(void) -{ - /* LPEXCEPTION_RECORD */ - TEST_TYPE(LPEXCEPTION_RECORD, 4, 4); -} - -static void test_pack_LPFIBER_START_ROUTINE(void) -{ - /* LPFIBER_START_ROUTINE */ - TEST_TYPE(LPFIBER_START_ROUTINE, 4, 4); -} - -static void test_pack_LPHW_PROFILE_INFOA(void) -{ - /* LPHW_PROFILE_INFOA */ - TEST_TYPE(LPHW_PROFILE_INFOA, 4, 4); - TEST_TYPE_POINTER(LPHW_PROFILE_INFOA, 124, 4); -} - -static void test_pack_LPHW_PROFILE_INFOW(void) -{ - /* LPHW_PROFILE_INFOW */ - TEST_TYPE(LPHW_PROFILE_INFOW, 4, 4); - TEST_TYPE_POINTER(LPHW_PROFILE_INFOW, 244, 4); -} - -static void test_pack_LPMEMORYSTATUS(void) -{ - /* LPMEMORYSTATUS */ - TEST_TYPE(LPMEMORYSTATUS, 4, 4); - TEST_TYPE_POINTER(LPMEMORYSTATUS, 32, 4); -} - -static void test_pack_LPMEMORYSTATUSEX(void) -{ - /* LPMEMORYSTATUSEX */ - TEST_TYPE(LPMEMORYSTATUSEX, 4, 4); - TEST_TYPE_POINTER(LPMEMORYSTATUSEX, 64, 8); -} - -static void test_pack_LPOFSTRUCT(void) -{ - /* LPOFSTRUCT */ - TEST_TYPE(LPOFSTRUCT, 4, 4); - TEST_TYPE_POINTER(LPOFSTRUCT, 136, 2); -} - -static void test_pack_LPOVERLAPPED(void) -{ - /* LPOVERLAPPED */ - TEST_TYPE(LPOVERLAPPED, 4, 4); -} - -static void test_pack_LPOVERLAPPED_COMPLETION_ROUTINE(void) -{ - /* LPOVERLAPPED_COMPLETION_ROUTINE */ - TEST_TYPE(LPOVERLAPPED_COMPLETION_ROUTINE, 4, 4); -} - -static void test_pack_LPPROCESS_HEAP_ENTRY(void) -{ - /* LPPROCESS_HEAP_ENTRY */ - TEST_TYPE(LPPROCESS_HEAP_ENTRY, 4, 4); -} - -static void test_pack_LPPROCESS_INFORMATION(void) -{ - /* LPPROCESS_INFORMATION */ - TEST_TYPE(LPPROCESS_INFORMATION, 4, 4); - TEST_TYPE_POINTER(LPPROCESS_INFORMATION, 16, 4); -} - -static void test_pack_LPPROGRESS_ROUTINE(void) -{ - /* LPPROGRESS_ROUTINE */ - TEST_TYPE(LPPROGRESS_ROUTINE, 4, 4); -} - -static void test_pack_LPSECURITY_ATTRIBUTES(void) -{ - /* LPSECURITY_ATTRIBUTES */ - TEST_TYPE(LPSECURITY_ATTRIBUTES, 4, 4); - TEST_TYPE_POINTER(LPSECURITY_ATTRIBUTES, 12, 4); -} - -static void test_pack_LPSTARTUPINFOA(void) -{ - /* LPSTARTUPINFOA */ - TEST_TYPE(LPSTARTUPINFOA, 4, 4); - TEST_TYPE_POINTER(LPSTARTUPINFOA, 68, 4); -} - -static void test_pack_LPSTARTUPINFOW(void) -{ - /* LPSTARTUPINFOW */ - TEST_TYPE(LPSTARTUPINFOW, 4, 4); - TEST_TYPE_POINTER(LPSTARTUPINFOW, 68, 4); -} - -static void test_pack_LPSYSTEMTIME(void) -{ - /* LPSYSTEMTIME */ - TEST_TYPE(LPSYSTEMTIME, 4, 4); - TEST_TYPE_POINTER(LPSYSTEMTIME, 16, 2); -} - -static void test_pack_LPSYSTEM_INFO(void) -{ - /* LPSYSTEM_INFO */ - TEST_TYPE(LPSYSTEM_INFO, 4, 4); -} - -static void test_pack_LPSYSTEM_POWER_STATUS(void) -{ - /* LPSYSTEM_POWER_STATUS */ - TEST_TYPE(LPSYSTEM_POWER_STATUS, 4, 4); - TEST_TYPE_POINTER(LPSYSTEM_POWER_STATUS, 12, 4); -} - -static void test_pack_LPTHREAD_START_ROUTINE(void) -{ - /* LPTHREAD_START_ROUTINE */ - TEST_TYPE(LPTHREAD_START_ROUTINE, 4, 4); -} - -static void test_pack_LPTIME_ZONE_INFORMATION(void) -{ - /* LPTIME_ZONE_INFORMATION */ - TEST_TYPE(LPTIME_ZONE_INFORMATION, 4, 4); - TEST_TYPE_POINTER(LPTIME_ZONE_INFORMATION, 172, 4); -} - -static void test_pack_LPWIN32_FILE_ATTRIBUTE_DATA(void) -{ - /* LPWIN32_FILE_ATTRIBUTE_DATA */ - TEST_TYPE(LPWIN32_FILE_ATTRIBUTE_DATA, 4, 4); - TEST_TYPE_POINTER(LPWIN32_FILE_ATTRIBUTE_DATA, 36, 4); -} - -static void test_pack_LPWIN32_FIND_DATAA(void) -{ - /* LPWIN32_FIND_DATAA */ - TEST_TYPE(LPWIN32_FIND_DATAA, 4, 4); - TEST_TYPE_POINTER(LPWIN32_FIND_DATAA, 320, 4); -} - -static void test_pack_LPWIN32_FIND_DATAW(void) -{ - /* LPWIN32_FIND_DATAW */ - TEST_TYPE(LPWIN32_FIND_DATAW, 4, 4); - TEST_TYPE_POINTER(LPWIN32_FIND_DATAW, 592, 4); -} - -static void test_pack_LPWIN32_STREAM_ID(void) -{ - /* LPWIN32_STREAM_ID */ - TEST_TYPE(LPWIN32_STREAM_ID, 4, 4); - TEST_TYPE_POINTER(LPWIN32_STREAM_ID, 24, 8); -} - -static void test_pack_MEMORYSTATUS(void) -{ - /* MEMORYSTATUS (pack 4) */ - TEST_TYPE(MEMORYSTATUS, 32, 4); - TEST_FIELD(MEMORYSTATUS, DWORD, dwLength, 0, 4, 4); - TEST_FIELD(MEMORYSTATUS, DWORD, dwMemoryLoad, 4, 4, 4); - TEST_FIELD(MEMORYSTATUS, SIZE_T, dwTotalPhys, 8, 4, 4); - TEST_FIELD(MEMORYSTATUS, SIZE_T, dwAvailPhys, 12, 4, 4); - TEST_FIELD(MEMORYSTATUS, SIZE_T, dwTotalPageFile, 16, 4, 4); - TEST_FIELD(MEMORYSTATUS, SIZE_T, dwAvailPageFile, 20, 4, 4); - TEST_FIELD(MEMORYSTATUS, SIZE_T, dwTotalVirtual, 24, 4, 4); - TEST_FIELD(MEMORYSTATUS, SIZE_T, dwAvailVirtual, 28, 4, 4); -} - -static void test_pack_MEMORYSTATUSEX(void) -{ - /* MEMORYSTATUSEX (pack 8) */ - TEST_TYPE(MEMORYSTATUSEX, 64, 8); - TEST_FIELD(MEMORYSTATUSEX, DWORD, dwLength, 0, 4, 4); - TEST_FIELD(MEMORYSTATUSEX, DWORD, dwMemoryLoad, 4, 4, 4); - TEST_FIELD(MEMORYSTATUSEX, DWORDLONG, ullTotalPhys, 8, 8, 8); - TEST_FIELD(MEMORYSTATUSEX, DWORDLONG, ullAvailPhys, 16, 8, 8); - TEST_FIELD(MEMORYSTATUSEX, DWORDLONG, ullTotalPageFile, 24, 8, 8); - TEST_FIELD(MEMORYSTATUSEX, DWORDLONG, ullAvailPageFile, 32, 8, 8); - TEST_FIELD(MEMORYSTATUSEX, DWORDLONG, ullTotalVirtual, 40, 8, 8); - TEST_FIELD(MEMORYSTATUSEX, DWORDLONG, ullAvailVirtual, 48, 8, 8); - TEST_FIELD(MEMORYSTATUSEX, DWORDLONG, ullAvailExtendedVirtual, 56, 8, 8); -} - -static void test_pack_OFSTRUCT(void) -{ - /* OFSTRUCT (pack 4) */ - TEST_TYPE(OFSTRUCT, 136, 2); - TEST_FIELD(OFSTRUCT, BYTE, cBytes, 0, 1, 1); - TEST_FIELD(OFSTRUCT, BYTE, fFixedDisk, 1, 1, 1); - TEST_FIELD(OFSTRUCT, WORD, nErrCode, 2, 2, 2); - TEST_FIELD(OFSTRUCT, WORD, Reserved1, 4, 2, 2); - TEST_FIELD(OFSTRUCT, WORD, Reserved2, 6, 2, 2); - TEST_FIELD(OFSTRUCT, CHAR[OFS_MAXPATHNAME], szPathName, 8, 128, 1); -} - -static void test_pack_OUTPUT_DEBUG_STRING_INFO(void) -{ - /* OUTPUT_DEBUG_STRING_INFO (pack 4) */ - TEST_TYPE(OUTPUT_DEBUG_STRING_INFO, 8, 4); - TEST_FIELD(OUTPUT_DEBUG_STRING_INFO, LPSTR, lpDebugStringData, 0, 4, 4); - TEST_FIELD(OUTPUT_DEBUG_STRING_INFO, WORD, fUnicode, 4, 2, 2); - TEST_FIELD(OUTPUT_DEBUG_STRING_INFO, WORD, nDebugStringLength, 6, 2, 2); -} - -static void test_pack_PACTCTXA(void) -{ - /* PACTCTXA */ - TEST_TYPE(PACTCTXA, 4, 4); - TEST_TYPE_POINTER(PACTCTXA, 32, 4); -} - -static void test_pack_PACTCTXW(void) -{ - /* PACTCTXW */ - TEST_TYPE(PACTCTXW, 4, 4); - TEST_TYPE_POINTER(PACTCTXW, 32, 4); -} - -static void test_pack_PACTCTX_SECTION_KEYED_DATA(void) -{ - /* PACTCTX_SECTION_KEYED_DATA */ - TEST_TYPE(PACTCTX_SECTION_KEYED_DATA, 4, 4); - TEST_TYPE_POINTER(PACTCTX_SECTION_KEYED_DATA, 64, 4); -} - -static void test_pack_PACTCTX_SECTION_KEYED_DATA_2600(void) -{ - /* PACTCTX_SECTION_KEYED_DATA_2600 */ - TEST_TYPE(PACTCTX_SECTION_KEYED_DATA_2600, 4, 4); - TEST_TYPE_POINTER(PACTCTX_SECTION_KEYED_DATA_2600, 40, 4); -} - -static void test_pack_PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA(void) -{ - /* PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA */ - TEST_TYPE(PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, 4, 4); - TEST_TYPE_POINTER(PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, 20, 4); -} - -static void test_pack_PACTIVATION_CONTEXT_BASIC_INFORMATION(void) -{ - /* PACTIVATION_CONTEXT_BASIC_INFORMATION */ - TEST_TYPE(PACTIVATION_CONTEXT_BASIC_INFORMATION, 4, 4); - TEST_TYPE_POINTER(PACTIVATION_CONTEXT_BASIC_INFORMATION, 8, 4); -} - -static void test_pack_PAPCFUNC(void) -{ - /* PAPCFUNC */ - TEST_TYPE(PAPCFUNC, 4, 4); -} - -static void test_pack_PBY_HANDLE_FILE_INFORMATION(void) -{ - /* PBY_HANDLE_FILE_INFORMATION */ - TEST_TYPE(PBY_HANDLE_FILE_INFORMATION, 4, 4); - TEST_TYPE_POINTER(PBY_HANDLE_FILE_INFORMATION, 52, 4); -} - -static void test_pack_PCACTCTXA(void) -{ - /* PCACTCTXA */ - TEST_TYPE(PCACTCTXA, 4, 4); - TEST_TYPE_POINTER(PCACTCTXA, 32, 4); -} - -static void test_pack_PCACTCTXW(void) -{ - /* PCACTCTXW */ - TEST_TYPE(PCACTCTXW, 4, 4); - TEST_TYPE_POINTER(PCACTCTXW, 32, 4); -} - -static void test_pack_PCACTCTX_SECTION_KEYED_DATA(void) -{ - /* PCACTCTX_SECTION_KEYED_DATA */ - TEST_TYPE(PCACTCTX_SECTION_KEYED_DATA, 4, 4); - TEST_TYPE_POINTER(PCACTCTX_SECTION_KEYED_DATA, 64, 4); -} - -static void test_pack_PCACTCTX_SECTION_KEYED_DATA_2600(void) -{ - /* PCACTCTX_SECTION_KEYED_DATA_2600 */ - TEST_TYPE(PCACTCTX_SECTION_KEYED_DATA_2600, 4, 4); - TEST_TYPE_POINTER(PCACTCTX_SECTION_KEYED_DATA_2600, 40, 4); -} - -static void test_pack_PCACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA(void) -{ - /* PCACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA */ - TEST_TYPE(PCACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, 4, 4); - TEST_TYPE_POINTER(PCACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, 20, 4); -} - -static void test_pack_PCRITICAL_SECTION(void) -{ - /* PCRITICAL_SECTION */ - TEST_TYPE(PCRITICAL_SECTION, 4, 4); -} - -static void test_pack_PCRITICAL_SECTION_DEBUG(void) -{ - /* PCRITICAL_SECTION_DEBUG */ - TEST_TYPE(PCRITICAL_SECTION_DEBUG, 4, 4); -} - -static void test_pack_PFIBER_START_ROUTINE(void) -{ - /* PFIBER_START_ROUTINE */ - TEST_TYPE(PFIBER_START_ROUTINE, 4, 4); -} - -static void test_pack_POFSTRUCT(void) -{ - /* POFSTRUCT */ - TEST_TYPE(POFSTRUCT, 4, 4); - TEST_TYPE_POINTER(POFSTRUCT, 136, 2); -} - -static void test_pack_PPROCESS_HEAP_ENTRY(void) -{ - /* PPROCESS_HEAP_ENTRY */ - TEST_TYPE(PPROCESS_HEAP_ENTRY, 4, 4); -} - -static void test_pack_PPROCESS_INFORMATION(void) -{ - /* PPROCESS_INFORMATION */ - TEST_TYPE(PPROCESS_INFORMATION, 4, 4); - TEST_TYPE_POINTER(PPROCESS_INFORMATION, 16, 4); -} - -static void test_pack_PQUERYACTCTXW_FUNC(void) -{ - /* PQUERYACTCTXW_FUNC */ - TEST_TYPE(PQUERYACTCTXW_FUNC, 4, 4); -} - -static void test_pack_PROCESS_HEAP_ENTRY(void) -{ - /* PROCESS_HEAP_ENTRY (pack 4) */ - TEST_FIELD(PROCESS_HEAP_ENTRY, LPVOID, lpData, 0, 4, 4); - TEST_FIELD(PROCESS_HEAP_ENTRY, DWORD, cbData, 4, 4, 4); - TEST_FIELD(PROCESS_HEAP_ENTRY, BYTE, cbOverhead, 8, 1, 1); - TEST_FIELD(PROCESS_HEAP_ENTRY, BYTE, iRegionIndex, 9, 1, 1); - TEST_FIELD(PROCESS_HEAP_ENTRY, WORD, wFlags, 10, 2, 2); -} - -static void test_pack_PROCESS_INFORMATION(void) -{ - /* PROCESS_INFORMATION (pack 4) */ - TEST_TYPE(PROCESS_INFORMATION, 16, 4); - TEST_FIELD(PROCESS_INFORMATION, HANDLE, hProcess, 0, 4, 4); - TEST_FIELD(PROCESS_INFORMATION, HANDLE, hThread, 4, 4, 4); - TEST_FIELD(PROCESS_INFORMATION, DWORD, dwProcessId, 8, 4, 4); - TEST_FIELD(PROCESS_INFORMATION, DWORD, dwThreadId, 12, 4, 4); -} - -static void test_pack_PSECURITY_ATTRIBUTES(void) -{ - /* PSECURITY_ATTRIBUTES */ - TEST_TYPE(PSECURITY_ATTRIBUTES, 4, 4); - TEST_TYPE_POINTER(PSECURITY_ATTRIBUTES, 12, 4); -} - -static void test_pack_PSYSTEMTIME(void) -{ - /* PSYSTEMTIME */ - TEST_TYPE(PSYSTEMTIME, 4, 4); - TEST_TYPE_POINTER(PSYSTEMTIME, 16, 2); -} - -static void test_pack_PTIMERAPCROUTINE(void) -{ - /* PTIMERAPCROUTINE */ - TEST_TYPE(PTIMERAPCROUTINE, 4, 4); -} - -static void test_pack_PTIME_ZONE_INFORMATION(void) -{ - /* PTIME_ZONE_INFORMATION */ - TEST_TYPE(PTIME_ZONE_INFORMATION, 4, 4); - TEST_TYPE_POINTER(PTIME_ZONE_INFORMATION, 172, 4); -} - -static void test_pack_PWIN32_FIND_DATAA(void) -{ - /* PWIN32_FIND_DATAA */ - TEST_TYPE(PWIN32_FIND_DATAA, 4, 4); - TEST_TYPE_POINTER(PWIN32_FIND_DATAA, 320, 4); -} - -static void test_pack_PWIN32_FIND_DATAW(void) -{ - /* PWIN32_FIND_DATAW */ - TEST_TYPE(PWIN32_FIND_DATAW, 4, 4); - TEST_TYPE_POINTER(PWIN32_FIND_DATAW, 592, 4); -} - -static void test_pack_RIP_INFO(void) -{ - /* RIP_INFO (pack 4) */ - TEST_TYPE(RIP_INFO, 8, 4); - TEST_FIELD(RIP_INFO, DWORD, dwError, 0, 4, 4); - TEST_FIELD(RIP_INFO, DWORD, dwType, 4, 4, 4); -} - -static void test_pack_SECURITY_ATTRIBUTES(void) -{ - /* SECURITY_ATTRIBUTES (pack 4) */ - TEST_TYPE(SECURITY_ATTRIBUTES, 12, 4); - TEST_FIELD(SECURITY_ATTRIBUTES, DWORD, nLength, 0, 4, 4); - TEST_FIELD(SECURITY_ATTRIBUTES, LPVOID, lpSecurityDescriptor, 4, 4, 4); - TEST_FIELD(SECURITY_ATTRIBUTES, BOOL, bInheritHandle, 8, 4, 4); -} - -static void test_pack_STARTUPINFOA(void) -{ - /* STARTUPINFOA (pack 4) */ - TEST_TYPE(STARTUPINFOA, 68, 4); - TEST_FIELD(STARTUPINFOA, DWORD, cb, 0, 4, 4); - TEST_FIELD(STARTUPINFOA, LPSTR, lpReserved, 4, 4, 4); - TEST_FIELD(STARTUPINFOA, LPSTR, lpDesktop, 8, 4, 4); - TEST_FIELD(STARTUPINFOA, LPSTR, lpTitle, 12, 4, 4); - TEST_FIELD(STARTUPINFOA, DWORD, dwX, 16, 4, 4); - TEST_FIELD(STARTUPINFOA, DWORD, dwY, 20, 4, 4); - TEST_FIELD(STARTUPINFOA, DWORD, dwXSize, 24, 4, 4); - TEST_FIELD(STARTUPINFOA, DWORD, dwYSize, 28, 4, 4); - TEST_FIELD(STARTUPINFOA, DWORD, dwXCountChars, 32, 4, 4); - TEST_FIELD(STARTUPINFOA, DWORD, dwYCountChars, 36, 4, 4); - TEST_FIELD(STARTUPINFOA, DWORD, dwFillAttribute, 40, 4, 4); - TEST_FIELD(STARTUPINFOA, DWORD, dwFlags, 44, 4, 4); - TEST_FIELD(STARTUPINFOA, WORD, wShowWindow, 48, 2, 2); - TEST_FIELD(STARTUPINFOA, WORD, cbReserved2, 50, 2, 2); - TEST_FIELD(STARTUPINFOA, BYTE *, lpReserved2, 52, 4, 4); - TEST_FIELD(STARTUPINFOA, HANDLE, hStdInput, 56, 4, 4); - TEST_FIELD(STARTUPINFOA, HANDLE, hStdOutput, 60, 4, 4); - TEST_FIELD(STARTUPINFOA, HANDLE, hStdError, 64, 4, 4); -} - -static void test_pack_STARTUPINFOW(void) -{ - /* STARTUPINFOW (pack 4) */ - TEST_TYPE(STARTUPINFOW, 68, 4); - TEST_FIELD(STARTUPINFOW, DWORD, cb, 0, 4, 4); - TEST_FIELD(STARTUPINFOW, LPWSTR, lpReserved, 4, 4, 4); - TEST_FIELD(STARTUPINFOW, LPWSTR, lpDesktop, 8, 4, 4); - TEST_FIELD(STARTUPINFOW, LPWSTR, lpTitle, 12, 4, 4); - TEST_FIELD(STARTUPINFOW, DWORD, dwX, 16, 4, 4); - TEST_FIELD(STARTUPINFOW, DWORD, dwY, 20, 4, 4); - TEST_FIELD(STARTUPINFOW, DWORD, dwXSize, 24, 4, 4); - TEST_FIELD(STARTUPINFOW, DWORD, dwYSize, 28, 4, 4); - TEST_FIELD(STARTUPINFOW, DWORD, dwXCountChars, 32, 4, 4); - TEST_FIELD(STARTUPINFOW, DWORD, dwYCountChars, 36, 4, 4); - TEST_FIELD(STARTUPINFOW, DWORD, dwFillAttribute, 40, 4, 4); - TEST_FIELD(STARTUPINFOW, DWORD, dwFlags, 44, 4, 4); - TEST_FIELD(STARTUPINFOW, WORD, wShowWindow, 48, 2, 2); - TEST_FIELD(STARTUPINFOW, WORD, cbReserved2, 50, 2, 2); - TEST_FIELD(STARTUPINFOW, BYTE *, lpReserved2, 52, 4, 4); - TEST_FIELD(STARTUPINFOW, HANDLE, hStdInput, 56, 4, 4); - TEST_FIELD(STARTUPINFOW, HANDLE, hStdOutput, 60, 4, 4); - TEST_FIELD(STARTUPINFOW, HANDLE, hStdError, 64, 4, 4); -} - -static void test_pack_SYSTEMTIME(void) -{ - /* SYSTEMTIME (pack 4) */ - TEST_TYPE(SYSTEMTIME, 16, 2); - TEST_FIELD(SYSTEMTIME, WORD, wYear, 0, 2, 2); - TEST_FIELD(SYSTEMTIME, WORD, wMonth, 2, 2, 2); - TEST_FIELD(SYSTEMTIME, WORD, wDayOfWeek, 4, 2, 2); - TEST_FIELD(SYSTEMTIME, WORD, wDay, 6, 2, 2); - TEST_FIELD(SYSTEMTIME, WORD, wHour, 8, 2, 2); - TEST_FIELD(SYSTEMTIME, WORD, wMinute, 10, 2, 2); - TEST_FIELD(SYSTEMTIME, WORD, wSecond, 12, 2, 2); - TEST_FIELD(SYSTEMTIME, WORD, wMilliseconds, 14, 2, 2); -} - -static void test_pack_SYSTEM_INFO(void) -{ - /* SYSTEM_INFO (pack 4) */ -} - -static void test_pack_SYSTEM_POWER_STATUS(void) -{ - /* SYSTEM_POWER_STATUS (pack 4) */ - TEST_TYPE(SYSTEM_POWER_STATUS, 12, 4); - TEST_FIELD(SYSTEM_POWER_STATUS, BYTE, ACLineStatus, 0, 1, 1); - TEST_FIELD(SYSTEM_POWER_STATUS, BYTE, BatteryFlag, 1, 1, 1); - TEST_FIELD(SYSTEM_POWER_STATUS, BYTE, BatteryLifePercent, 2, 1, 1); - TEST_FIELD(SYSTEM_POWER_STATUS, BYTE, Reserved1, 3, 1, 1); - TEST_FIELD(SYSTEM_POWER_STATUS, DWORD, BatteryLifeTime, 4, 4, 4); - TEST_FIELD(SYSTEM_POWER_STATUS, DWORD, BatteryFullLifeTime, 8, 4, 4); -} - -static void test_pack_TIME_ZONE_INFORMATION(void) -{ - /* TIME_ZONE_INFORMATION (pack 4) */ - TEST_TYPE(TIME_ZONE_INFORMATION, 172, 4); - TEST_FIELD(TIME_ZONE_INFORMATION, LONG, Bias, 0, 4, 4); - TEST_FIELD(TIME_ZONE_INFORMATION, WCHAR[32], StandardName, 4, 64, 2); - TEST_FIELD(TIME_ZONE_INFORMATION, SYSTEMTIME, StandardDate, 68, 16, 2); - TEST_FIELD(TIME_ZONE_INFORMATION, LONG, StandardBias, 84, 4, 4); - TEST_FIELD(TIME_ZONE_INFORMATION, WCHAR[32], DaylightName, 88, 64, 2); - TEST_FIELD(TIME_ZONE_INFORMATION, SYSTEMTIME, DaylightDate, 152, 16, 2); - TEST_FIELD(TIME_ZONE_INFORMATION, LONG, DaylightBias, 168, 4, 4); -} - -static void test_pack_UNLOAD_DLL_DEBUG_INFO(void) -{ - /* UNLOAD_DLL_DEBUG_INFO (pack 4) */ - TEST_TYPE(UNLOAD_DLL_DEBUG_INFO, 4, 4); - TEST_FIELD(UNLOAD_DLL_DEBUG_INFO, LPVOID, lpBaseOfDll, 0, 4, 4); -} - -static void test_pack_WAITORTIMERCALLBACK(void) -{ - /* WAITORTIMERCALLBACK */ - TEST_TYPE(WAITORTIMERCALLBACK, 4, 4); -} - -static void test_pack_WIN32_FILE_ATTRIBUTE_DATA(void) -{ - /* WIN32_FILE_ATTRIBUTE_DATA (pack 4) */ - TEST_TYPE(WIN32_FILE_ATTRIBUTE_DATA, 36, 4); - TEST_FIELD(WIN32_FILE_ATTRIBUTE_DATA, DWORD, dwFileAttributes, 0, 4, 4); - TEST_FIELD(WIN32_FILE_ATTRIBUTE_DATA, FILETIME, ftCreationTime, 4, 8, 4); - TEST_FIELD(WIN32_FILE_ATTRIBUTE_DATA, FILETIME, ftLastAccessTime, 12, 8, 4); - TEST_FIELD(WIN32_FILE_ATTRIBUTE_DATA, FILETIME, ftLastWriteTime, 20, 8, 4); - TEST_FIELD(WIN32_FILE_ATTRIBUTE_DATA, DWORD, nFileSizeHigh, 28, 4, 4); - TEST_FIELD(WIN32_FILE_ATTRIBUTE_DATA, DWORD, nFileSizeLow, 32, 4, 4); -} - -static void test_pack_WIN32_FIND_DATAA(void) -{ - /* WIN32_FIND_DATAA (pack 4) */ - TEST_TYPE(WIN32_FIND_DATAA, 320, 4); - TEST_FIELD(WIN32_FIND_DATAA, DWORD, dwFileAttributes, 0, 4, 4); - TEST_FIELD(WIN32_FIND_DATAA, FILETIME, ftCreationTime, 4, 8, 4); - TEST_FIELD(WIN32_FIND_DATAA, FILETIME, ftLastAccessTime, 12, 8, 4); - TEST_FIELD(WIN32_FIND_DATAA, FILETIME, ftLastWriteTime, 20, 8, 4); - TEST_FIELD(WIN32_FIND_DATAA, DWORD, nFileSizeHigh, 28, 4, 4); - TEST_FIELD(WIN32_FIND_DATAA, DWORD, nFileSizeLow, 32, 4, 4); - TEST_FIELD(WIN32_FIND_DATAA, DWORD, dwReserved0, 36, 4, 4); - TEST_FIELD(WIN32_FIND_DATAA, DWORD, dwReserved1, 40, 4, 4); - TEST_FIELD(WIN32_FIND_DATAA, CHAR[260], cFileName, 44, 260, 1); - TEST_FIELD(WIN32_FIND_DATAA, CHAR[14], cAlternateFileName, 304, 14, 1); -} - -static void test_pack_WIN32_FIND_DATAW(void) -{ - /* WIN32_FIND_DATAW (pack 4) */ - TEST_TYPE(WIN32_FIND_DATAW, 592, 4); - TEST_FIELD(WIN32_FIND_DATAW, DWORD, dwFileAttributes, 0, 4, 4); - TEST_FIELD(WIN32_FIND_DATAW, FILETIME, ftCreationTime, 4, 8, 4); - TEST_FIELD(WIN32_FIND_DATAW, FILETIME, ftLastAccessTime, 12, 8, 4); - TEST_FIELD(WIN32_FIND_DATAW, FILETIME, ftLastWriteTime, 20, 8, 4); - TEST_FIELD(WIN32_FIND_DATAW, DWORD, nFileSizeHigh, 28, 4, 4); - TEST_FIELD(WIN32_FIND_DATAW, DWORD, nFileSizeLow, 32, 4, 4); - TEST_FIELD(WIN32_FIND_DATAW, DWORD, dwReserved0, 36, 4, 4); - TEST_FIELD(WIN32_FIND_DATAW, DWORD, dwReserved1, 40, 4, 4); - TEST_FIELD(WIN32_FIND_DATAW, WCHAR[260], cFileName, 44, 520, 2); - TEST_FIELD(WIN32_FIND_DATAW, WCHAR[14], cAlternateFileName, 564, 28, 2); -} - -static void test_pack_WIN32_STREAM_ID(void) -{ - /* WIN32_STREAM_ID (pack 8) */ - TEST_TYPE(WIN32_STREAM_ID, 24, 8); - TEST_FIELD(WIN32_STREAM_ID, DWORD, dwStreamId, 0, 4, 4); - TEST_FIELD(WIN32_STREAM_ID, DWORD, dwStreamAttributes, 4, 4, 4); - TEST_FIELD(WIN32_STREAM_ID, LARGE_INTEGER, Size, 8, 8, 8); - TEST_FIELD(WIN32_STREAM_ID, DWORD, dwStreamNameSize, 16, 4, 4); - TEST_FIELD(WIN32_STREAM_ID, WCHAR[ANYSIZE_ARRAY], cStreamName, 20, 2, 2); -} - -static void test_pack(void) -{ - test_pack_ACTCTXA(); - test_pack_ACTCTXW(); - test_pack_ACTCTX_SECTION_KEYED_DATA(); - test_pack_ACTCTX_SECTION_KEYED_DATA_2600(); - test_pack_ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA(); - test_pack_ACTIVATION_CONTEXT_BASIC_INFORMATION(); - test_pack_BY_HANDLE_FILE_INFORMATION(); - test_pack_COMMCONFIG(); - test_pack_COMMPROP(); - test_pack_COMMTIMEOUTS(); - test_pack_COMSTAT(); - test_pack_CREATE_PROCESS_DEBUG_INFO(); - test_pack_CREATE_THREAD_DEBUG_INFO(); - test_pack_CRITICAL_SECTION(); - test_pack_CRITICAL_SECTION_DEBUG(); - test_pack_DCB(); - test_pack_DEBUG_EVENT(); - test_pack_ENUMRESLANGPROCA(); - test_pack_ENUMRESLANGPROCW(); - test_pack_ENUMRESNAMEPROCA(); - test_pack_ENUMRESNAMEPROCW(); - test_pack_ENUMRESTYPEPROCA(); - test_pack_ENUMRESTYPEPROCW(); - test_pack_EXCEPTION_DEBUG_INFO(); - test_pack_EXIT_PROCESS_DEBUG_INFO(); - test_pack_EXIT_THREAD_DEBUG_INFO(); - test_pack_HW_PROFILE_INFOA(); - test_pack_HW_PROFILE_INFOW(); - test_pack_LOAD_DLL_DEBUG_INFO(); - test_pack_LPBY_HANDLE_FILE_INFORMATION(); - test_pack_LPCOMMCONFIG(); - test_pack_LPCOMMPROP(); - test_pack_LPCOMMTIMEOUTS(); - test_pack_LPCOMSTAT(); - test_pack_LPCRITICAL_SECTION(); - test_pack_LPCRITICAL_SECTION_DEBUG(); - test_pack_LPDCB(); - test_pack_LPDEBUG_EVENT(); - test_pack_LPEXCEPTION_POINTERS(); - test_pack_LPEXCEPTION_RECORD(); - test_pack_LPFIBER_START_ROUTINE(); - test_pack_LPHW_PROFILE_INFOA(); - test_pack_LPHW_PROFILE_INFOW(); - test_pack_LPLONG(); - test_pack_LPMEMORYSTATUS(); - test_pack_LPMEMORYSTATUSEX(); - test_pack_LPOFSTRUCT(); - test_pack_LPOSVERSIONINFOA(); - test_pack_LPOSVERSIONINFOEXA(); - test_pack_LPOSVERSIONINFOEXW(); - test_pack_LPOSVERSIONINFOW(); - test_pack_LPOVERLAPPED(); - test_pack_LPOVERLAPPED_COMPLETION_ROUTINE(); - test_pack_LPPROCESS_HEAP_ENTRY(); - test_pack_LPPROCESS_INFORMATION(); - test_pack_LPPROGRESS_ROUTINE(); - test_pack_LPSECURITY_ATTRIBUTES(); - test_pack_LPSTARTUPINFOA(); - test_pack_LPSTARTUPINFOW(); - test_pack_LPSYSTEMTIME(); - test_pack_LPSYSTEM_INFO(); - test_pack_LPSYSTEM_POWER_STATUS(); - test_pack_LPTHREAD_START_ROUTINE(); - test_pack_LPTIME_ZONE_INFORMATION(); - test_pack_LPVOID(); - test_pack_LPWIN32_FILE_ATTRIBUTE_DATA(); - test_pack_LPWIN32_FIND_DATAA(); - test_pack_LPWIN32_FIND_DATAW(); - test_pack_LPWIN32_STREAM_ID(); - test_pack_MEMORYSTATUS(); - test_pack_MEMORYSTATUSEX(); - test_pack_OFSTRUCT(); - test_pack_OSVERSIONINFOA(); - test_pack_OSVERSIONINFOEXA(); - test_pack_OSVERSIONINFOEXW(); - test_pack_OSVERSIONINFOW(); - test_pack_OUTPUT_DEBUG_STRING_INFO(); - test_pack_PACTCTXA(); - test_pack_PACTCTXW(); - test_pack_PACTCTX_SECTION_KEYED_DATA(); - test_pack_PACTCTX_SECTION_KEYED_DATA_2600(); - test_pack_PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA(); - test_pack_PACTIVATION_CONTEXT_BASIC_INFORMATION(); - test_pack_PAPCFUNC(); - test_pack_PBY_HANDLE_FILE_INFORMATION(); - test_pack_PCACTCTXA(); - test_pack_PCACTCTXW(); - test_pack_PCACTCTX_SECTION_KEYED_DATA(); - test_pack_PCACTCTX_SECTION_KEYED_DATA_2600(); - test_pack_PCACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA(); - test_pack_PCRITICAL_SECTION(); - test_pack_PCRITICAL_SECTION_DEBUG(); - test_pack_PFIBER_START_ROUTINE(); - test_pack_PHKEY(); - test_pack_POFSTRUCT(); - test_pack_POSVERSIONINFOA(); - test_pack_POSVERSIONINFOEXA(); - test_pack_POSVERSIONINFOEXW(); - test_pack_POSVERSIONINFOW(); - test_pack_PPROCESS_HEAP_ENTRY(); - test_pack_PPROCESS_INFORMATION(); - test_pack_PQUERYACTCTXW_FUNC(); - test_pack_PROCESS_HEAP_ENTRY(); - test_pack_PROCESS_INFORMATION(); - test_pack_PSECURITY_ATTRIBUTES(); - test_pack_PSYSTEMTIME(); - test_pack_PTIMERAPCROUTINE(); - test_pack_PTIME_ZONE_INFORMATION(); - test_pack_PWIN32_FIND_DATAA(); - test_pack_PWIN32_FIND_DATAW(); - test_pack_RIP_INFO(); - test_pack_SECURITY_ATTRIBUTES(); - test_pack_STARTUPINFOA(); - test_pack_STARTUPINFOW(); - test_pack_SYSTEMTIME(); - test_pack_SYSTEM_INFO(); - test_pack_SYSTEM_POWER_STATUS(); - test_pack_TIME_ZONE_INFORMATION(); - test_pack_UNLOAD_DLL_DEBUG_INFO(); - test_pack_WAITORTIMERCALLBACK(); - test_pack_WIN32_FILE_ATTRIBUTE_DATA(); - test_pack_WIN32_FIND_DATAA(); - test_pack_WIN32_FIND_DATAW(); - test_pack_WIN32_STREAM_ID(); -} - -START_TEST(generated) -{ - test_pack(); -} +/* File generated automatically from tools/winapi/tests.dat; do not edit! */ +/* This file can be copied, modified and distributed without restriction. */ + +/* + * Unit tests for data structure packing + */ + +#define WINVER 0x0501 +#define _WIN32_IE 0x0501 +#define _WIN32_WINNT 0x0501 + +#define WINE_NOWINSOCK + +#include "windows.h" + +#include "wine/test.h" + +/*********************************************************************** + * Compatibility macros + */ + +#define DWORD_PTR UINT_PTR +#define LONG_PTR INT_PTR +#define ULONG_PTR UINT_PTR + +/*********************************************************************** + * Windows API extension + */ + +#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) +# define _TYPE_ALIGNMENT(type) __alignof(type) +#elif defined(__GNUC__) +# define _TYPE_ALIGNMENT(type) __alignof__(type) +#else +/* + * FIXME: May not be possible without a compiler extension + * (if type is not just a name that is, otherwise the normal + * TYPE_ALIGNMENT can be used) + */ +#endif + +#if defined(TYPE_ALIGNMENT) && defined(_MSC_VER) && _MSC_VER >= 800 && !defined(__cplusplus) +#pragma warning(disable:4116) +#endif + +#if !defined(TYPE_ALIGNMENT) && defined(_TYPE_ALIGNMENT) +# define TYPE_ALIGNMENT _TYPE_ALIGNMENT +#endif + +/*********************************************************************** + * Test helper macros + */ + +#ifdef _WIN64 + +# define TEST_TYPE_SIZE(type, size) +# define TEST_TYPE_ALIGN(type, align) +# define TEST_TARGET_ALIGN(type, align) +# define TEST_FIELD_ALIGN(type, field, align) +# define TEST_FIELD_OFFSET(type, field, offset) + +#else + +# define TEST_TYPE_SIZE(type, size) C_ASSERT(sizeof(type) == size); + +# ifdef TYPE_ALIGNMENT +# define TEST_TYPE_ALIGN(type, align) C_ASSERT(TYPE_ALIGNMENT(type) == align); +# else +# define TEST_TYPE_ALIGN(type, align) +# endif + +# ifdef _TYPE_ALIGNMENT +# define TEST_TARGET_ALIGN(type, align) C_ASSERT(_TYPE_ALIGNMENT(*(type)0) == align); +# define TEST_FIELD_ALIGN(type, field, align) C_ASSERT(_TYPE_ALIGNMENT(((type*)0)->field) == align); +# else +# define TEST_TARGET_ALIGN(type, align) +# define TEST_FIELD_ALIGN(type, field, align) +# endif + +# define TEST_FIELD_OFFSET(type, field, offset) C_ASSERT(FIELD_OFFSET(type, field) == offset); + +#endif + +#define TEST_TARGET_SIZE(type, size) TEST_TYPE_SIZE(*(type)0, size) +#define TEST_FIELD_SIZE(type, field, size) TEST_TYPE_SIZE((((type*)0)->field), size) +#define TEST_TYPE_SIGNED(type) C_ASSERT((type) -1 < 0); +#define TEST_TYPE_UNSIGNED(type) C_ASSERT((type) -1 > 0); + + +static void test_pack_LPOSVERSIONINFOA(void) +{ + /* LPOSVERSIONINFOA */ + TEST_TYPE_SIZE (LPOSVERSIONINFOA, 4) + TEST_TYPE_ALIGN (LPOSVERSIONINFOA, 4) + TEST_TARGET_SIZE (LPOSVERSIONINFOA, 148) + TEST_TARGET_ALIGN(LPOSVERSIONINFOA, 4) +} + +static void test_pack_LPOSVERSIONINFOEXA(void) +{ + /* LPOSVERSIONINFOEXA */ + TEST_TYPE_SIZE (LPOSVERSIONINFOEXA, 4) + TEST_TYPE_ALIGN (LPOSVERSIONINFOEXA, 4) + TEST_TARGET_SIZE (LPOSVERSIONINFOEXA, 156) + TEST_TARGET_ALIGN(LPOSVERSIONINFOEXA, 4) +} + +static void test_pack_LPOSVERSIONINFOEXW(void) +{ + /* LPOSVERSIONINFOEXW */ + TEST_TYPE_SIZE (LPOSVERSIONINFOEXW, 4) + TEST_TYPE_ALIGN (LPOSVERSIONINFOEXW, 4) + TEST_TARGET_SIZE (LPOSVERSIONINFOEXW, 284) + TEST_TARGET_ALIGN(LPOSVERSIONINFOEXW, 4) +} + +static void test_pack_LPOSVERSIONINFOW(void) +{ + /* LPOSVERSIONINFOW */ + TEST_TYPE_SIZE (LPOSVERSIONINFOW, 4) + TEST_TYPE_ALIGN (LPOSVERSIONINFOW, 4) + TEST_TARGET_SIZE (LPOSVERSIONINFOW, 276) + TEST_TARGET_ALIGN(LPOSVERSIONINFOW, 4) +} + +static void test_pack_OSVERSIONINFOA(void) +{ + /* OSVERSIONINFOA (pack 4) */ + TEST_TYPE_SIZE (OSVERSIONINFOA, 148) + TEST_TYPE_ALIGN (OSVERSIONINFOA, 4) + TEST_FIELD_SIZE (OSVERSIONINFOA, dwOSVersionInfoSize, 4) + TEST_FIELD_ALIGN (OSVERSIONINFOA, dwOSVersionInfoSize, 4) + TEST_FIELD_OFFSET(OSVERSIONINFOA, dwOSVersionInfoSize, 0) + TEST_FIELD_SIZE (OSVERSIONINFOA, dwMajorVersion, 4) + TEST_FIELD_ALIGN (OSVERSIONINFOA, dwMajorVersion, 4) + TEST_FIELD_OFFSET(OSVERSIONINFOA, dwMajorVersion, 4) + TEST_FIELD_SIZE (OSVERSIONINFOA, dwMinorVersion, 4) + TEST_FIELD_ALIGN (OSVERSIONINFOA, dwMinorVersion, 4) + TEST_FIELD_OFFSET(OSVERSIONINFOA, dwMinorVersion, 8) + TEST_FIELD_SIZE (OSVERSIONINFOA, dwBuildNumber, 4) + TEST_FIELD_ALIGN (OSVERSIONINFOA, dwBuildNumber, 4) + TEST_FIELD_OFFSET(OSVERSIONINFOA, dwBuildNumber, 12) + TEST_FIELD_SIZE (OSVERSIONINFOA, dwPlatformId, 4) + TEST_FIELD_ALIGN (OSVERSIONINFOA, dwPlatformId, 4) + TEST_FIELD_OFFSET(OSVERSIONINFOA, dwPlatformId, 16) + TEST_FIELD_SIZE (OSVERSIONINFOA, szCSDVersion, 128) + TEST_FIELD_ALIGN (OSVERSIONINFOA, szCSDVersion, 1) + TEST_FIELD_OFFSET(OSVERSIONINFOA, szCSDVersion, 20) +} + +static void test_pack_OSVERSIONINFOEXA(void) +{ + /* OSVERSIONINFOEXA (pack 4) */ + TEST_TYPE_SIZE (OSVERSIONINFOEXA, 156) + TEST_TYPE_ALIGN (OSVERSIONINFOEXA, 4) + TEST_FIELD_SIZE (OSVERSIONINFOEXA, dwOSVersionInfoSize, 4) + TEST_FIELD_ALIGN (OSVERSIONINFOEXA, dwOSVersionInfoSize, 4) + TEST_FIELD_OFFSET(OSVERSIONINFOEXA, dwOSVersionInfoSize, 0) + TEST_FIELD_SIZE (OSVERSIONINFOEXA, dwMajorVersion, 4) + TEST_FIELD_ALIGN (OSVERSIONINFOEXA, dwMajorVersion, 4) + TEST_FIELD_OFFSET(OSVERSIONINFOEXA, dwMajorVersion, 4) + TEST_FIELD_SIZE (OSVERSIONINFOEXA, dwMinorVersion, 4) + TEST_FIELD_ALIGN (OSVERSIONINFOEXA, dwMinorVersion, 4) + TEST_FIELD_OFFSET(OSVERSIONINFOEXA, dwMinorVersion, 8) + TEST_FIELD_SIZE (OSVERSIONINFOEXA, dwBuildNumber, 4) + TEST_FIELD_ALIGN (OSVERSIONINFOEXA, dwBuildNumber, 4) + TEST_FIELD_OFFSET(OSVERSIONINFOEXA, dwBuildNumber, 12) + TEST_FIELD_SIZE (OSVERSIONINFOEXA, dwPlatformId, 4) + TEST_FIELD_ALIGN (OSVERSIONINFOEXA, dwPlatformId, 4) + TEST_FIELD_OFFSET(OSVERSIONINFOEXA, dwPlatformId, 16) + TEST_FIELD_SIZE (OSVERSIONINFOEXA, szCSDVersion, 128) + TEST_FIELD_ALIGN (OSVERSIONINFOEXA, szCSDVersion, 1) + TEST_FIELD_OFFSET(OSVERSIONINFOEXA, szCSDVersion, 20) + TEST_FIELD_SIZE (OSVERSIONINFOEXA, wServicePackMajor, 2) + TEST_FIELD_ALIGN (OSVERSIONINFOEXA, wServicePackMajor, 2) + TEST_FIELD_OFFSET(OSVERSIONINFOEXA, wServicePackMajor, 148) + TEST_FIELD_SIZE (OSVERSIONINFOEXA, wServicePackMinor, 2) + TEST_FIELD_ALIGN (OSVERSIONINFOEXA, wServicePackMinor, 2) + TEST_FIELD_OFFSET(OSVERSIONINFOEXA, wServicePackMinor, 150) + TEST_FIELD_SIZE (OSVERSIONINFOEXA, wSuiteMask, 2) + TEST_FIELD_ALIGN (OSVERSIONINFOEXA, wSuiteMask, 2) + TEST_FIELD_OFFSET(OSVERSIONINFOEXA, wSuiteMask, 152) + TEST_FIELD_SIZE (OSVERSIONINFOEXA, wProductType, 1) + TEST_FIELD_ALIGN (OSVERSIONINFOEXA, wProductType, 1) + TEST_FIELD_OFFSET(OSVERSIONINFOEXA, wProductType, 154) + TEST_FIELD_SIZE (OSVERSIONINFOEXA, wReserved, 1) + TEST_FIELD_ALIGN (OSVERSIONINFOEXA, wReserved, 1) + TEST_FIELD_OFFSET(OSVERSIONINFOEXA, wReserved, 155) +} + +static void test_pack_OSVERSIONINFOEXW(void) +{ + /* OSVERSIONINFOEXW (pack 4) */ + TEST_TYPE_SIZE (OSVERSIONINFOEXW, 284) + TEST_TYPE_ALIGN (OSVERSIONINFOEXW, 4) + TEST_FIELD_SIZE (OSVERSIONINFOEXW, dwOSVersionInfoSize, 4) + TEST_FIELD_ALIGN (OSVERSIONINFOEXW, dwOSVersionInfoSize, 4) + TEST_FIELD_OFFSET(OSVERSIONINFOEXW, dwOSVersionInfoSize, 0) + TEST_FIELD_SIZE (OSVERSIONINFOEXW, dwMajorVersion, 4) + TEST_FIELD_ALIGN (OSVERSIONINFOEXW, dwMajorVersion, 4) + TEST_FIELD_OFFSET(OSVERSIONINFOEXW, dwMajorVersion, 4) + TEST_FIELD_SIZE (OSVERSIONINFOEXW, dwMinorVersion, 4) + TEST_FIELD_ALIGN (OSVERSIONINFOEXW, dwMinorVersion, 4) + TEST_FIELD_OFFSET(OSVERSIONINFOEXW, dwMinorVersion, 8) + TEST_FIELD_SIZE (OSVERSIONINFOEXW, dwBuildNumber, 4) + TEST_FIELD_ALIGN (OSVERSIONINFOEXW, dwBuildNumber, 4) + TEST_FIELD_OFFSET(OSVERSIONINFOEXW, dwBuildNumber, 12) + TEST_FIELD_SIZE (OSVERSIONINFOEXW, dwPlatformId, 4) + TEST_FIELD_ALIGN (OSVERSIONINFOEXW, dwPlatformId, 4) + TEST_FIELD_OFFSET(OSVERSIONINFOEXW, dwPlatformId, 16) + TEST_FIELD_SIZE (OSVERSIONINFOEXW, szCSDVersion, 256) + TEST_FIELD_ALIGN (OSVERSIONINFOEXW, szCSDVersion, 2) + TEST_FIELD_OFFSET(OSVERSIONINFOEXW, szCSDVersion, 20) + TEST_FIELD_SIZE (OSVERSIONINFOEXW, wServicePackMajor, 2) + TEST_FIELD_ALIGN (OSVERSIONINFOEXW, wServicePackMajor, 2) + TEST_FIELD_OFFSET(OSVERSIONINFOEXW, wServicePackMajor, 276) + TEST_FIELD_SIZE (OSVERSIONINFOEXW, wServicePackMinor, 2) + TEST_FIELD_ALIGN (OSVERSIONINFOEXW, wServicePackMinor, 2) + TEST_FIELD_OFFSET(OSVERSIONINFOEXW, wServicePackMinor, 278) + TEST_FIELD_SIZE (OSVERSIONINFOEXW, wSuiteMask, 2) + TEST_FIELD_ALIGN (OSVERSIONINFOEXW, wSuiteMask, 2) + TEST_FIELD_OFFSET(OSVERSIONINFOEXW, wSuiteMask, 280) + TEST_FIELD_SIZE (OSVERSIONINFOEXW, wProductType, 1) + TEST_FIELD_ALIGN (OSVERSIONINFOEXW, wProductType, 1) + TEST_FIELD_OFFSET(OSVERSIONINFOEXW, wProductType, 282) + TEST_FIELD_SIZE (OSVERSIONINFOEXW, wReserved, 1) + TEST_FIELD_ALIGN (OSVERSIONINFOEXW, wReserved, 1) + TEST_FIELD_OFFSET(OSVERSIONINFOEXW, wReserved, 283) +} + +static void test_pack_OSVERSIONINFOW(void) +{ + /* OSVERSIONINFOW (pack 4) */ + TEST_TYPE_SIZE (OSVERSIONINFOW, 276) + TEST_TYPE_ALIGN (OSVERSIONINFOW, 4) + TEST_FIELD_SIZE (OSVERSIONINFOW, dwOSVersionInfoSize, 4) + TEST_FIELD_ALIGN (OSVERSIONINFOW, dwOSVersionInfoSize, 4) + TEST_FIELD_OFFSET(OSVERSIONINFOW, dwOSVersionInfoSize, 0) + TEST_FIELD_SIZE (OSVERSIONINFOW, dwMajorVersion, 4) + TEST_FIELD_ALIGN (OSVERSIONINFOW, dwMajorVersion, 4) + TEST_FIELD_OFFSET(OSVERSIONINFOW, dwMajorVersion, 4) + TEST_FIELD_SIZE (OSVERSIONINFOW, dwMinorVersion, 4) + TEST_FIELD_ALIGN (OSVERSIONINFOW, dwMinorVersion, 4) + TEST_FIELD_OFFSET(OSVERSIONINFOW, dwMinorVersion, 8) + TEST_FIELD_SIZE (OSVERSIONINFOW, dwBuildNumber, 4) + TEST_FIELD_ALIGN (OSVERSIONINFOW, dwBuildNumber, 4) + TEST_FIELD_OFFSET(OSVERSIONINFOW, dwBuildNumber, 12) + TEST_FIELD_SIZE (OSVERSIONINFOW, dwPlatformId, 4) + TEST_FIELD_ALIGN (OSVERSIONINFOW, dwPlatformId, 4) + TEST_FIELD_OFFSET(OSVERSIONINFOW, dwPlatformId, 16) + TEST_FIELD_SIZE (OSVERSIONINFOW, szCSDVersion, 256) + TEST_FIELD_ALIGN (OSVERSIONINFOW, szCSDVersion, 2) + TEST_FIELD_OFFSET(OSVERSIONINFOW, szCSDVersion, 20) +} + +static void test_pack_POSVERSIONINFOA(void) +{ + /* POSVERSIONINFOA */ + TEST_TYPE_SIZE (POSVERSIONINFOA, 4) + TEST_TYPE_ALIGN (POSVERSIONINFOA, 4) + TEST_TARGET_SIZE (POSVERSIONINFOA, 148) + TEST_TARGET_ALIGN(POSVERSIONINFOA, 4) +} + +static void test_pack_POSVERSIONINFOEXA(void) +{ + /* POSVERSIONINFOEXA */ + TEST_TYPE_SIZE (POSVERSIONINFOEXA, 4) + TEST_TYPE_ALIGN (POSVERSIONINFOEXA, 4) + TEST_TARGET_SIZE (POSVERSIONINFOEXA, 156) + TEST_TARGET_ALIGN(POSVERSIONINFOEXA, 4) +} + +static void test_pack_POSVERSIONINFOEXW(void) +{ + /* POSVERSIONINFOEXW */ + TEST_TYPE_SIZE (POSVERSIONINFOEXW, 4) + TEST_TYPE_ALIGN (POSVERSIONINFOEXW, 4) + TEST_TARGET_SIZE (POSVERSIONINFOEXW, 284) + TEST_TARGET_ALIGN(POSVERSIONINFOEXW, 4) +} + +static void test_pack_POSVERSIONINFOW(void) +{ + /* POSVERSIONINFOW */ + TEST_TYPE_SIZE (POSVERSIONINFOW, 4) + TEST_TYPE_ALIGN (POSVERSIONINFOW, 4) + TEST_TARGET_SIZE (POSVERSIONINFOW, 276) + TEST_TARGET_ALIGN(POSVERSIONINFOW, 4) +} + +static void test_pack_LPLONG(void) +{ + /* LPLONG */ + TEST_TYPE_SIZE (LPLONG, 4) + TEST_TYPE_ALIGN (LPLONG, 4) +} + +static void test_pack_LPVOID(void) +{ + /* LPVOID */ + TEST_TYPE_SIZE (LPVOID, 4) + TEST_TYPE_ALIGN (LPVOID, 4) +} + +static void test_pack_PHKEY(void) +{ + /* PHKEY */ + TEST_TYPE_SIZE (PHKEY, 4) + TEST_TYPE_ALIGN (PHKEY, 4) +} + +static void test_pack_ACTCTXA(void) +{ + /* ACTCTXA (pack 4) */ + TEST_TYPE_SIZE (ACTCTXA, 32) + TEST_TYPE_ALIGN (ACTCTXA, 4) + TEST_FIELD_SIZE (ACTCTXA, cbSize, 4) + TEST_FIELD_ALIGN (ACTCTXA, cbSize, 4) + TEST_FIELD_OFFSET(ACTCTXA, cbSize, 0) + TEST_FIELD_SIZE (ACTCTXA, dwFlags, 4) + TEST_FIELD_ALIGN (ACTCTXA, dwFlags, 4) + TEST_FIELD_OFFSET(ACTCTXA, dwFlags, 4) + TEST_FIELD_SIZE (ACTCTXA, lpSource, 4) + TEST_FIELD_ALIGN (ACTCTXA, lpSource, 4) + TEST_FIELD_OFFSET(ACTCTXA, lpSource, 8) + TEST_FIELD_SIZE (ACTCTXA, wProcessorArchitecture, 2) + TEST_FIELD_ALIGN (ACTCTXA, wProcessorArchitecture, 2) + TEST_FIELD_OFFSET(ACTCTXA, wProcessorArchitecture, 12) + TEST_FIELD_SIZE (ACTCTXA, wLangId, 2) + TEST_FIELD_ALIGN (ACTCTXA, wLangId, 2) + TEST_FIELD_OFFSET(ACTCTXA, wLangId, 14) + TEST_FIELD_SIZE (ACTCTXA, lpAssemblyDirectory, 4) + TEST_FIELD_ALIGN (ACTCTXA, lpAssemblyDirectory, 4) + TEST_FIELD_OFFSET(ACTCTXA, lpAssemblyDirectory, 16) + TEST_FIELD_SIZE (ACTCTXA, lpResourceName, 4) + TEST_FIELD_ALIGN (ACTCTXA, lpResourceName, 4) + TEST_FIELD_OFFSET(ACTCTXA, lpResourceName, 20) + TEST_FIELD_SIZE (ACTCTXA, lpApplicationName, 4) + TEST_FIELD_ALIGN (ACTCTXA, lpApplicationName, 4) + TEST_FIELD_OFFSET(ACTCTXA, lpApplicationName, 24) + TEST_FIELD_SIZE (ACTCTXA, hModule, 4) + TEST_FIELD_ALIGN (ACTCTXA, hModule, 4) + TEST_FIELD_OFFSET(ACTCTXA, hModule, 28) +} + +static void test_pack_ACTCTXW(void) +{ + /* ACTCTXW (pack 4) */ + TEST_TYPE_SIZE (ACTCTXW, 32) + TEST_TYPE_ALIGN (ACTCTXW, 4) + TEST_FIELD_SIZE (ACTCTXW, cbSize, 4) + TEST_FIELD_ALIGN (ACTCTXW, cbSize, 4) + TEST_FIELD_OFFSET(ACTCTXW, cbSize, 0) + TEST_FIELD_SIZE (ACTCTXW, dwFlags, 4) + TEST_FIELD_ALIGN (ACTCTXW, dwFlags, 4) + TEST_FIELD_OFFSET(ACTCTXW, dwFlags, 4) + TEST_FIELD_SIZE (ACTCTXW, lpSource, 4) + TEST_FIELD_ALIGN (ACTCTXW, lpSource, 4) + TEST_FIELD_OFFSET(ACTCTXW, lpSource, 8) + TEST_FIELD_SIZE (ACTCTXW, wProcessorArchitecture, 2) + TEST_FIELD_ALIGN (ACTCTXW, wProcessorArchitecture, 2) + TEST_FIELD_OFFSET(ACTCTXW, wProcessorArchitecture, 12) + TEST_FIELD_SIZE (ACTCTXW, wLangId, 2) + TEST_FIELD_ALIGN (ACTCTXW, wLangId, 2) + TEST_FIELD_OFFSET(ACTCTXW, wLangId, 14) + TEST_FIELD_SIZE (ACTCTXW, lpAssemblyDirectory, 4) + TEST_FIELD_ALIGN (ACTCTXW, lpAssemblyDirectory, 4) + TEST_FIELD_OFFSET(ACTCTXW, lpAssemblyDirectory, 16) + TEST_FIELD_SIZE (ACTCTXW, lpResourceName, 4) + TEST_FIELD_ALIGN (ACTCTXW, lpResourceName, 4) + TEST_FIELD_OFFSET(ACTCTXW, lpResourceName, 20) + TEST_FIELD_SIZE (ACTCTXW, lpApplicationName, 4) + TEST_FIELD_ALIGN (ACTCTXW, lpApplicationName, 4) + TEST_FIELD_OFFSET(ACTCTXW, lpApplicationName, 24) + TEST_FIELD_SIZE (ACTCTXW, hModule, 4) + TEST_FIELD_ALIGN (ACTCTXW, hModule, 4) + TEST_FIELD_OFFSET(ACTCTXW, hModule, 28) +} + +static void test_pack_ACTCTX_SECTION_KEYED_DATA(void) +{ + /* ACTCTX_SECTION_KEYED_DATA (pack 4) */ + TEST_TYPE_SIZE (ACTCTX_SECTION_KEYED_DATA, 64) + TEST_TYPE_ALIGN (ACTCTX_SECTION_KEYED_DATA, 4) + TEST_FIELD_SIZE (ACTCTX_SECTION_KEYED_DATA, cbSize, 4) + TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA, cbSize, 4) + TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, cbSize, 0) + TEST_FIELD_SIZE (ACTCTX_SECTION_KEYED_DATA, ulDataFormatVersion, 4) + TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA, ulDataFormatVersion, 4) + TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulDataFormatVersion, 4) + TEST_FIELD_SIZE (ACTCTX_SECTION_KEYED_DATA, lpData, 4) + TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA, lpData, 4) + TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, lpData, 8) + TEST_FIELD_SIZE (ACTCTX_SECTION_KEYED_DATA, ulLength, 4) + TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA, ulLength, 4) + TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulLength, 12) + TEST_FIELD_SIZE (ACTCTX_SECTION_KEYED_DATA, lpSectionGlobalData, 4) + TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA, lpSectionGlobalData, 4) + TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, lpSectionGlobalData, 16) + TEST_FIELD_SIZE (ACTCTX_SECTION_KEYED_DATA, ulSectionGlobalDataLength, 4) + TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA, ulSectionGlobalDataLength, 4) + TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulSectionGlobalDataLength, 20) + TEST_FIELD_SIZE (ACTCTX_SECTION_KEYED_DATA, lpSectionBase, 4) + TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA, lpSectionBase, 4) + TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, lpSectionBase, 24) + TEST_FIELD_SIZE (ACTCTX_SECTION_KEYED_DATA, ulSectionTotalLength, 4) + TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA, ulSectionTotalLength, 4) + TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulSectionTotalLength, 28) + TEST_FIELD_SIZE (ACTCTX_SECTION_KEYED_DATA, hActCtx, 4) + TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA, hActCtx, 4) + TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, hActCtx, 32) + TEST_FIELD_SIZE (ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex, 4) + TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex, 4) + TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex, 36) + TEST_FIELD_SIZE (ACTCTX_SECTION_KEYED_DATA, ulFlags, 4) + TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA, ulFlags, 4) + TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulFlags, 40) + TEST_FIELD_SIZE (ACTCTX_SECTION_KEYED_DATA, AssemblyMetadata, 20) + TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA, AssemblyMetadata, 4) + TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, AssemblyMetadata, 44) +} + +static void test_pack_ACTCTX_SECTION_KEYED_DATA_2600(void) +{ + /* ACTCTX_SECTION_KEYED_DATA_2600 (pack 4) */ + TEST_TYPE_SIZE (ACTCTX_SECTION_KEYED_DATA_2600, 40) + TEST_TYPE_ALIGN (ACTCTX_SECTION_KEYED_DATA_2600, 4) + TEST_FIELD_SIZE (ACTCTX_SECTION_KEYED_DATA_2600, cbSize, 4) + TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA_2600, cbSize, 4) + TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA_2600, cbSize, 0) + TEST_FIELD_SIZE (ACTCTX_SECTION_KEYED_DATA_2600, ulDataFormatVersion, 4) + TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA_2600, ulDataFormatVersion, 4) + TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA_2600, ulDataFormatVersion, 4) + TEST_FIELD_SIZE (ACTCTX_SECTION_KEYED_DATA_2600, lpData, 4) + TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA_2600, lpData, 4) + TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA_2600, lpData, 8) + TEST_FIELD_SIZE (ACTCTX_SECTION_KEYED_DATA_2600, ulLength, 4) + TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA_2600, ulLength, 4) + TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA_2600, ulLength, 12) + TEST_FIELD_SIZE (ACTCTX_SECTION_KEYED_DATA_2600, lpSectionGlobalData, 4) + TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA_2600, lpSectionGlobalData, 4) + TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA_2600, lpSectionGlobalData, 16) + TEST_FIELD_SIZE (ACTCTX_SECTION_KEYED_DATA_2600, ulSectionGlobalDataLength, 4) + TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA_2600, ulSectionGlobalDataLength, 4) + TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA_2600, ulSectionGlobalDataLength, 20) + TEST_FIELD_SIZE (ACTCTX_SECTION_KEYED_DATA_2600, lpSectionBase, 4) + TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA_2600, lpSectionBase, 4) + TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA_2600, lpSectionBase, 24) + TEST_FIELD_SIZE (ACTCTX_SECTION_KEYED_DATA_2600, ulSectionTotalLength, 4) + TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA_2600, ulSectionTotalLength, 4) + TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA_2600, ulSectionTotalLength, 28) + TEST_FIELD_SIZE (ACTCTX_SECTION_KEYED_DATA_2600, hActCtx, 4) + TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA_2600, hActCtx, 4) + TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA_2600, hActCtx, 32) + TEST_FIELD_SIZE (ACTCTX_SECTION_KEYED_DATA_2600, ulAssemblyRosterIndex, 4) + TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA_2600, ulAssemblyRosterIndex, 4) + TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA_2600, ulAssemblyRosterIndex, 36) +} + +static void test_pack_ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA(void) +{ + /* ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA (pack 4) */ + TEST_TYPE_SIZE (ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, 20) + TEST_TYPE_ALIGN (ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, 4) + TEST_FIELD_SIZE (ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, lpInformation, 4) + TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, lpInformation, 4) + TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, lpInformation, 0) + TEST_FIELD_SIZE (ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, lpSectionBase, 4) + TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, lpSectionBase, 4) + TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, lpSectionBase, 4) + TEST_FIELD_SIZE (ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, ulSectionLength, 4) + TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, ulSectionLength, 4) + TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, ulSectionLength, 8) + TEST_FIELD_SIZE (ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, lpSectionGlobalDataBase, 4) + TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, lpSectionGlobalDataBase, 4) + TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, lpSectionGlobalDataBase, 12) + TEST_FIELD_SIZE (ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, ulSectionGlobalDataLength, 4) + TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, ulSectionGlobalDataLength, 4) + TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, ulSectionGlobalDataLength, 16) +} + +static void test_pack_ACTIVATION_CONTEXT_BASIC_INFORMATION(void) +{ + /* ACTIVATION_CONTEXT_BASIC_INFORMATION (pack 4) */ + TEST_TYPE_SIZE (ACTIVATION_CONTEXT_BASIC_INFORMATION, 8) + TEST_TYPE_ALIGN (ACTIVATION_CONTEXT_BASIC_INFORMATION, 4) + TEST_FIELD_SIZE (ACTIVATION_CONTEXT_BASIC_INFORMATION, hActCtx, 4) + TEST_FIELD_ALIGN (ACTIVATION_CONTEXT_BASIC_INFORMATION, hActCtx, 4) + TEST_FIELD_OFFSET(ACTIVATION_CONTEXT_BASIC_INFORMATION, hActCtx, 0) + TEST_FIELD_SIZE (ACTIVATION_CONTEXT_BASIC_INFORMATION, dwFlags, 4) + TEST_FIELD_ALIGN (ACTIVATION_CONTEXT_BASIC_INFORMATION, dwFlags, 4) + TEST_FIELD_OFFSET(ACTIVATION_CONTEXT_BASIC_INFORMATION, dwFlags, 4) +} + +static void test_pack_BY_HANDLE_FILE_INFORMATION(void) +{ + /* BY_HANDLE_FILE_INFORMATION (pack 4) */ + TEST_TYPE_SIZE (BY_HANDLE_FILE_INFORMATION, 52) + TEST_TYPE_ALIGN (BY_HANDLE_FILE_INFORMATION, 4) + TEST_FIELD_SIZE (BY_HANDLE_FILE_INFORMATION, dwFileAttributes, 4) + TEST_FIELD_ALIGN (BY_HANDLE_FILE_INFORMATION, dwFileAttributes, 4) + TEST_FIELD_OFFSET(BY_HANDLE_FILE_INFORMATION, dwFileAttributes, 0) + TEST_FIELD_SIZE (BY_HANDLE_FILE_INFORMATION, ftCreationTime, 8) + TEST_FIELD_ALIGN (BY_HANDLE_FILE_INFORMATION, ftCreationTime, 4) + TEST_FIELD_OFFSET(BY_HANDLE_FILE_INFORMATION, ftCreationTime, 4) + TEST_FIELD_SIZE (BY_HANDLE_FILE_INFORMATION, ftLastAccessTime, 8) + TEST_FIELD_ALIGN (BY_HANDLE_FILE_INFORMATION, ftLastAccessTime, 4) + TEST_FIELD_OFFSET(BY_HANDLE_FILE_INFORMATION, ftLastAccessTime, 12) + TEST_FIELD_SIZE (BY_HANDLE_FILE_INFORMATION, ftLastWriteTime, 8) + TEST_FIELD_ALIGN (BY_HANDLE_FILE_INFORMATION, ftLastWriteTime, 4) + TEST_FIELD_OFFSET(BY_HANDLE_FILE_INFORMATION, ftLastWriteTime, 20) + TEST_FIELD_SIZE (BY_HANDLE_FILE_INFORMATION, dwVolumeSerialNumber, 4) + TEST_FIELD_ALIGN (BY_HANDLE_FILE_INFORMATION, dwVolumeSerialNumber, 4) + TEST_FIELD_OFFSET(BY_HANDLE_FILE_INFORMATION, dwVolumeSerialNumber, 28) + TEST_FIELD_SIZE (BY_HANDLE_FILE_INFORMATION, nFileSizeHigh, 4) + TEST_FIELD_ALIGN (BY_HANDLE_FILE_INFORMATION, nFileSizeHigh, 4) + TEST_FIELD_OFFSET(BY_HANDLE_FILE_INFORMATION, nFileSizeHigh, 32) + TEST_FIELD_SIZE (BY_HANDLE_FILE_INFORMATION, nFileSizeLow, 4) + TEST_FIELD_ALIGN (BY_HANDLE_FILE_INFORMATION, nFileSizeLow, 4) + TEST_FIELD_OFFSET(BY_HANDLE_FILE_INFORMATION, nFileSizeLow, 36) + TEST_FIELD_SIZE (BY_HANDLE_FILE_INFORMATION, nNumberOfLinks, 4) + TEST_FIELD_ALIGN (BY_HANDLE_FILE_INFORMATION, nNumberOfLinks, 4) + TEST_FIELD_OFFSET(BY_HANDLE_FILE_INFORMATION, nNumberOfLinks, 40) + TEST_FIELD_SIZE (BY_HANDLE_FILE_INFORMATION, nFileIndexHigh, 4) + TEST_FIELD_ALIGN (BY_HANDLE_FILE_INFORMATION, nFileIndexHigh, 4) + TEST_FIELD_OFFSET(BY_HANDLE_FILE_INFORMATION, nFileIndexHigh, 44) + TEST_FIELD_SIZE (BY_HANDLE_FILE_INFORMATION, nFileIndexLow, 4) + TEST_FIELD_ALIGN (BY_HANDLE_FILE_INFORMATION, nFileIndexLow, 4) + TEST_FIELD_OFFSET(BY_HANDLE_FILE_INFORMATION, nFileIndexLow, 48) +} + +static void test_pack_COMMCONFIG(void) +{ + /* COMMCONFIG (pack 4) */ + TEST_TYPE_SIZE (COMMCONFIG, 52) + TEST_TYPE_ALIGN (COMMCONFIG, 4) + TEST_FIELD_SIZE (COMMCONFIG, dwSize, 4) + TEST_FIELD_ALIGN (COMMCONFIG, dwSize, 4) + TEST_FIELD_OFFSET(COMMCONFIG, dwSize, 0) + TEST_FIELD_SIZE (COMMCONFIG, wVersion, 2) + TEST_FIELD_ALIGN (COMMCONFIG, wVersion, 2) + TEST_FIELD_OFFSET(COMMCONFIG, wVersion, 4) + TEST_FIELD_SIZE (COMMCONFIG, wReserved, 2) + TEST_FIELD_ALIGN (COMMCONFIG, wReserved, 2) + TEST_FIELD_OFFSET(COMMCONFIG, wReserved, 6) + TEST_FIELD_SIZE (COMMCONFIG, dcb, 28) + TEST_FIELD_ALIGN (COMMCONFIG, dcb, 4) + TEST_FIELD_OFFSET(COMMCONFIG, dcb, 8) + TEST_FIELD_SIZE (COMMCONFIG, dwProviderSubType, 4) + TEST_FIELD_ALIGN (COMMCONFIG, dwProviderSubType, 4) + TEST_FIELD_OFFSET(COMMCONFIG, dwProviderSubType, 36) + TEST_FIELD_SIZE (COMMCONFIG, dwProviderOffset, 4) + TEST_FIELD_ALIGN (COMMCONFIG, dwProviderOffset, 4) + TEST_FIELD_OFFSET(COMMCONFIG, dwProviderOffset, 40) + TEST_FIELD_SIZE (COMMCONFIG, dwProviderSize, 4) + TEST_FIELD_ALIGN (COMMCONFIG, dwProviderSize, 4) + TEST_FIELD_OFFSET(COMMCONFIG, dwProviderSize, 44) + TEST_FIELD_SIZE (COMMCONFIG, wcProviderData, 4) + TEST_FIELD_ALIGN (COMMCONFIG, wcProviderData, 4) + TEST_FIELD_OFFSET(COMMCONFIG, wcProviderData, 48) +} + +static void test_pack_COMMPROP(void) +{ + /* COMMPROP (pack 4) */ + TEST_TYPE_SIZE (COMMPROP, 64) + TEST_TYPE_ALIGN (COMMPROP, 4) + TEST_FIELD_SIZE (COMMPROP, wPacketLength, 2) + TEST_FIELD_ALIGN (COMMPROP, wPacketLength, 2) + TEST_FIELD_OFFSET(COMMPROP, wPacketLength, 0) + TEST_FIELD_SIZE (COMMPROP, wPacketVersion, 2) + TEST_FIELD_ALIGN (COMMPROP, wPacketVersion, 2) + TEST_FIELD_OFFSET(COMMPROP, wPacketVersion, 2) + TEST_FIELD_SIZE (COMMPROP, dwServiceMask, 4) + TEST_FIELD_ALIGN (COMMPROP, dwServiceMask, 4) + TEST_FIELD_OFFSET(COMMPROP, dwServiceMask, 4) + TEST_FIELD_SIZE (COMMPROP, dwReserved1, 4) + TEST_FIELD_ALIGN (COMMPROP, dwReserved1, 4) + TEST_FIELD_OFFSET(COMMPROP, dwReserved1, 8) + TEST_FIELD_SIZE (COMMPROP, dwMaxTxQueue, 4) + TEST_FIELD_ALIGN (COMMPROP, dwMaxTxQueue, 4) + TEST_FIELD_OFFSET(COMMPROP, dwMaxTxQueue, 12) + TEST_FIELD_SIZE (COMMPROP, dwMaxRxQueue, 4) + TEST_FIELD_ALIGN (COMMPROP, dwMaxRxQueue, 4) + TEST_FIELD_OFFSET(COMMPROP, dwMaxRxQueue, 16) + TEST_FIELD_SIZE (COMMPROP, dwMaxBaud, 4) + TEST_FIELD_ALIGN (COMMPROP, dwMaxBaud, 4) + TEST_FIELD_OFFSET(COMMPROP, dwMaxBaud, 20) + TEST_FIELD_SIZE (COMMPROP, dwProvSubType, 4) + TEST_FIELD_ALIGN (COMMPROP, dwProvSubType, 4) + TEST_FIELD_OFFSET(COMMPROP, dwProvSubType, 24) + TEST_FIELD_SIZE (COMMPROP, dwProvCapabilities, 4) + TEST_FIELD_ALIGN (COMMPROP, dwProvCapabilities, 4) + TEST_FIELD_OFFSET(COMMPROP, dwProvCapabilities, 28) + TEST_FIELD_SIZE (COMMPROP, dwSettableParams, 4) + TEST_FIELD_ALIGN (COMMPROP, dwSettableParams, 4) + TEST_FIELD_OFFSET(COMMPROP, dwSettableParams, 32) + TEST_FIELD_SIZE (COMMPROP, dwSettableBaud, 4) + TEST_FIELD_ALIGN (COMMPROP, dwSettableBaud, 4) + TEST_FIELD_OFFSET(COMMPROP, dwSettableBaud, 36) + TEST_FIELD_SIZE (COMMPROP, wSettableData, 2) + TEST_FIELD_ALIGN (COMMPROP, wSettableData, 2) + TEST_FIELD_OFFSET(COMMPROP, wSettableData, 40) + TEST_FIELD_SIZE (COMMPROP, wSettableStopParity, 2) + TEST_FIELD_ALIGN (COMMPROP, wSettableStopParity, 2) + TEST_FIELD_OFFSET(COMMPROP, wSettableStopParity, 42) + TEST_FIELD_SIZE (COMMPROP, dwCurrentTxQueue, 4) + TEST_FIELD_ALIGN (COMMPROP, dwCurrentTxQueue, 4) + TEST_FIELD_OFFSET(COMMPROP, dwCurrentTxQueue, 44) + TEST_FIELD_SIZE (COMMPROP, dwCurrentRxQueue, 4) + TEST_FIELD_ALIGN (COMMPROP, dwCurrentRxQueue, 4) + TEST_FIELD_OFFSET(COMMPROP, dwCurrentRxQueue, 48) + TEST_FIELD_SIZE (COMMPROP, dwProvSpec1, 4) + TEST_FIELD_ALIGN (COMMPROP, dwProvSpec1, 4) + TEST_FIELD_OFFSET(COMMPROP, dwProvSpec1, 52) + TEST_FIELD_SIZE (COMMPROP, dwProvSpec2, 4) + TEST_FIELD_ALIGN (COMMPROP, dwProvSpec2, 4) + TEST_FIELD_OFFSET(COMMPROP, dwProvSpec2, 56) + TEST_FIELD_SIZE (COMMPROP, wcProvChar, 2) + TEST_FIELD_ALIGN (COMMPROP, wcProvChar, 2) + TEST_FIELD_OFFSET(COMMPROP, wcProvChar, 60) +} + +static void test_pack_COMMTIMEOUTS(void) +{ + /* COMMTIMEOUTS (pack 4) */ + TEST_TYPE_SIZE (COMMTIMEOUTS, 20) + TEST_TYPE_ALIGN (COMMTIMEOUTS, 4) + TEST_FIELD_SIZE (COMMTIMEOUTS, ReadIntervalTimeout, 4) + TEST_FIELD_ALIGN (COMMTIMEOUTS, ReadIntervalTimeout, 4) + TEST_FIELD_OFFSET(COMMTIMEOUTS, ReadIntervalTimeout, 0) + TEST_FIELD_SIZE (COMMTIMEOUTS, ReadTotalTimeoutMultiplier, 4) + TEST_FIELD_ALIGN (COMMTIMEOUTS, ReadTotalTimeoutMultiplier, 4) + TEST_FIELD_OFFSET(COMMTIMEOUTS, ReadTotalTimeoutMultiplier, 4) + TEST_FIELD_SIZE (COMMTIMEOUTS, ReadTotalTimeoutConstant, 4) + TEST_FIELD_ALIGN (COMMTIMEOUTS, ReadTotalTimeoutConstant, 4) + TEST_FIELD_OFFSET(COMMTIMEOUTS, ReadTotalTimeoutConstant, 8) + TEST_FIELD_SIZE (COMMTIMEOUTS, WriteTotalTimeoutMultiplier, 4) + TEST_FIELD_ALIGN (COMMTIMEOUTS, WriteTotalTimeoutMultiplier, 4) + TEST_FIELD_OFFSET(COMMTIMEOUTS, WriteTotalTimeoutMultiplier, 12) + TEST_FIELD_SIZE (COMMTIMEOUTS, WriteTotalTimeoutConstant, 4) + TEST_FIELD_ALIGN (COMMTIMEOUTS, WriteTotalTimeoutConstant, 4) + TEST_FIELD_OFFSET(COMMTIMEOUTS, WriteTotalTimeoutConstant, 16) +} + +static void test_pack_COMSTAT(void) +{ + /* COMSTAT (pack 4) */ + TEST_TYPE_SIZE (COMSTAT, 12) + TEST_TYPE_ALIGN (COMSTAT, 4) + TEST_FIELD_SIZE (COMSTAT, cbInQue, 4) + TEST_FIELD_ALIGN (COMSTAT, cbInQue, 4) + TEST_FIELD_OFFSET(COMSTAT, cbInQue, 4) + TEST_FIELD_SIZE (COMSTAT, cbOutQue, 4) + TEST_FIELD_ALIGN (COMSTAT, cbOutQue, 4) + TEST_FIELD_OFFSET(COMSTAT, cbOutQue, 8) +} + +static void test_pack_CREATE_PROCESS_DEBUG_INFO(void) +{ + /* CREATE_PROCESS_DEBUG_INFO (pack 4) */ + TEST_TYPE_SIZE (CREATE_PROCESS_DEBUG_INFO, 40) + TEST_TYPE_ALIGN (CREATE_PROCESS_DEBUG_INFO, 4) + TEST_FIELD_SIZE (CREATE_PROCESS_DEBUG_INFO, hFile, 4) + TEST_FIELD_ALIGN (CREATE_PROCESS_DEBUG_INFO, hFile, 4) + TEST_FIELD_OFFSET(CREATE_PROCESS_DEBUG_INFO, hFile, 0) + TEST_FIELD_SIZE (CREATE_PROCESS_DEBUG_INFO, hProcess, 4) + TEST_FIELD_ALIGN (CREATE_PROCESS_DEBUG_INFO, hProcess, 4) + TEST_FIELD_OFFSET(CREATE_PROCESS_DEBUG_INFO, hProcess, 4) + TEST_FIELD_SIZE (CREATE_PROCESS_DEBUG_INFO, hThread, 4) + TEST_FIELD_ALIGN (CREATE_PROCESS_DEBUG_INFO, hThread, 4) + TEST_FIELD_OFFSET(CREATE_PROCESS_DEBUG_INFO, hThread, 8) + TEST_FIELD_SIZE (CREATE_PROCESS_DEBUG_INFO, lpBaseOfImage, 4) + TEST_FIELD_ALIGN (CREATE_PROCESS_DEBUG_INFO, lpBaseOfImage, 4) + TEST_FIELD_OFFSET(CREATE_PROCESS_DEBUG_INFO, lpBaseOfImage, 12) + TEST_FIELD_SIZE (CREATE_PROCESS_DEBUG_INFO, dwDebugInfoFileOffset, 4) + TEST_FIELD_ALIGN (CREATE_PROCESS_DEBUG_INFO, dwDebugInfoFileOffset, 4) + TEST_FIELD_OFFSET(CREATE_PROCESS_DEBUG_INFO, dwDebugInfoFileOffset, 16) + TEST_FIELD_SIZE (CREATE_PROCESS_DEBUG_INFO, nDebugInfoSize, 4) + TEST_FIELD_ALIGN (CREATE_PROCESS_DEBUG_INFO, nDebugInfoSize, 4) + TEST_FIELD_OFFSET(CREATE_PROCESS_DEBUG_INFO, nDebugInfoSize, 20) + TEST_FIELD_SIZE (CREATE_PROCESS_DEBUG_INFO, lpThreadLocalBase, 4) + TEST_FIELD_ALIGN (CREATE_PROCESS_DEBUG_INFO, lpThreadLocalBase, 4) + TEST_FIELD_OFFSET(CREATE_PROCESS_DEBUG_INFO, lpThreadLocalBase, 24) + TEST_FIELD_SIZE (CREATE_PROCESS_DEBUG_INFO, lpStartAddress, 4) + TEST_FIELD_ALIGN (CREATE_PROCESS_DEBUG_INFO, lpStartAddress, 4) + TEST_FIELD_OFFSET(CREATE_PROCESS_DEBUG_INFO, lpStartAddress, 28) + TEST_FIELD_SIZE (CREATE_PROCESS_DEBUG_INFO, lpImageName, 4) + TEST_FIELD_ALIGN (CREATE_PROCESS_DEBUG_INFO, lpImageName, 4) + TEST_FIELD_OFFSET(CREATE_PROCESS_DEBUG_INFO, lpImageName, 32) + TEST_FIELD_SIZE (CREATE_PROCESS_DEBUG_INFO, fUnicode, 2) + TEST_FIELD_ALIGN (CREATE_PROCESS_DEBUG_INFO, fUnicode, 2) + TEST_FIELD_OFFSET(CREATE_PROCESS_DEBUG_INFO, fUnicode, 36) +} + +static void test_pack_CREATE_THREAD_DEBUG_INFO(void) +{ + /* CREATE_THREAD_DEBUG_INFO (pack 4) */ + TEST_TYPE_SIZE (CREATE_THREAD_DEBUG_INFO, 12) + TEST_TYPE_ALIGN (CREATE_THREAD_DEBUG_INFO, 4) + TEST_FIELD_SIZE (CREATE_THREAD_DEBUG_INFO, hThread, 4) + TEST_FIELD_ALIGN (CREATE_THREAD_DEBUG_INFO, hThread, 4) + TEST_FIELD_OFFSET(CREATE_THREAD_DEBUG_INFO, hThread, 0) + TEST_FIELD_SIZE (CREATE_THREAD_DEBUG_INFO, lpThreadLocalBase, 4) + TEST_FIELD_ALIGN (CREATE_THREAD_DEBUG_INFO, lpThreadLocalBase, 4) + TEST_FIELD_OFFSET(CREATE_THREAD_DEBUG_INFO, lpThreadLocalBase, 4) + TEST_FIELD_SIZE (CREATE_THREAD_DEBUG_INFO, lpStartAddress, 4) + TEST_FIELD_ALIGN (CREATE_THREAD_DEBUG_INFO, lpStartAddress, 4) + TEST_FIELD_OFFSET(CREATE_THREAD_DEBUG_INFO, lpStartAddress, 8) +} + +static void test_pack_CRITICAL_SECTION(void) +{ + /* CRITICAL_SECTION */ + TEST_TYPE_SIZE (CRITICAL_SECTION, 24) + TEST_TYPE_ALIGN (CRITICAL_SECTION, 4) +} + +static void test_pack_CRITICAL_SECTION_DEBUG(void) +{ + /* CRITICAL_SECTION_DEBUG */ +} + +static void test_pack_DCB(void) +{ + /* DCB (pack 4) */ + TEST_TYPE_SIZE (DCB, 28) + TEST_TYPE_ALIGN (DCB, 4) + TEST_FIELD_SIZE (DCB, DCBlength, 4) + TEST_FIELD_ALIGN (DCB, DCBlength, 4) + TEST_FIELD_OFFSET(DCB, DCBlength, 0) + TEST_FIELD_SIZE (DCB, BaudRate, 4) + TEST_FIELD_ALIGN (DCB, BaudRate, 4) + TEST_FIELD_OFFSET(DCB, BaudRate, 4) + TEST_FIELD_SIZE (DCB, wReserved, 2) + TEST_FIELD_ALIGN (DCB, wReserved, 2) + TEST_FIELD_OFFSET(DCB, wReserved, 12) + TEST_FIELD_SIZE (DCB, XonLim, 2) + TEST_FIELD_ALIGN (DCB, XonLim, 2) + TEST_FIELD_OFFSET(DCB, XonLim, 14) + TEST_FIELD_SIZE (DCB, XoffLim, 2) + TEST_FIELD_ALIGN (DCB, XoffLim, 2) + TEST_FIELD_OFFSET(DCB, XoffLim, 16) + TEST_FIELD_SIZE (DCB, ByteSize, 1) + TEST_FIELD_ALIGN (DCB, ByteSize, 1) + TEST_FIELD_OFFSET(DCB, ByteSize, 18) + TEST_FIELD_SIZE (DCB, Parity, 1) + TEST_FIELD_ALIGN (DCB, Parity, 1) + TEST_FIELD_OFFSET(DCB, Parity, 19) + TEST_FIELD_SIZE (DCB, StopBits, 1) + TEST_FIELD_ALIGN (DCB, StopBits, 1) + TEST_FIELD_OFFSET(DCB, StopBits, 20) + TEST_FIELD_SIZE (DCB, XonChar, 1) + TEST_FIELD_ALIGN (DCB, XonChar, 1) + TEST_FIELD_OFFSET(DCB, XonChar, 21) + TEST_FIELD_SIZE (DCB, XoffChar, 1) + TEST_FIELD_ALIGN (DCB, XoffChar, 1) + TEST_FIELD_OFFSET(DCB, XoffChar, 22) + TEST_FIELD_SIZE (DCB, ErrorChar, 1) + TEST_FIELD_ALIGN (DCB, ErrorChar, 1) + TEST_FIELD_OFFSET(DCB, ErrorChar, 23) + TEST_FIELD_SIZE (DCB, EofChar, 1) + TEST_FIELD_ALIGN (DCB, EofChar, 1) + TEST_FIELD_OFFSET(DCB, EofChar, 24) + TEST_FIELD_SIZE (DCB, EvtChar, 1) + TEST_FIELD_ALIGN (DCB, EvtChar, 1) + TEST_FIELD_OFFSET(DCB, EvtChar, 25) + TEST_FIELD_SIZE (DCB, wReserved1, 2) + TEST_FIELD_ALIGN (DCB, wReserved1, 2) + TEST_FIELD_OFFSET(DCB, wReserved1, 26) +} + +static void test_pack_DEBUG_EVENT(void) +{ + /* DEBUG_EVENT (pack 4) */ + TEST_FIELD_SIZE (DEBUG_EVENT, dwDebugEventCode, 4) + TEST_FIELD_ALIGN (DEBUG_EVENT, dwDebugEventCode, 4) + TEST_FIELD_OFFSET(DEBUG_EVENT, dwDebugEventCode, 0) + TEST_FIELD_SIZE (DEBUG_EVENT, dwProcessId, 4) + TEST_FIELD_ALIGN (DEBUG_EVENT, dwProcessId, 4) + TEST_FIELD_OFFSET(DEBUG_EVENT, dwProcessId, 4) + TEST_FIELD_SIZE (DEBUG_EVENT, dwThreadId, 4) + TEST_FIELD_ALIGN (DEBUG_EVENT, dwThreadId, 4) + TEST_FIELD_OFFSET(DEBUG_EVENT, dwThreadId, 8) +} + +static void test_pack_ENUMRESLANGPROCA(void) +{ + /* ENUMRESLANGPROCA */ + TEST_TYPE_SIZE (ENUMRESLANGPROCA, 4) + TEST_TYPE_ALIGN (ENUMRESLANGPROCA, 4) +} + +static void test_pack_ENUMRESLANGPROCW(void) +{ + /* ENUMRESLANGPROCW */ + TEST_TYPE_SIZE (ENUMRESLANGPROCW, 4) + TEST_TYPE_ALIGN (ENUMRESLANGPROCW, 4) +} + +static void test_pack_ENUMRESNAMEPROCA(void) +{ + /* ENUMRESNAMEPROCA */ + TEST_TYPE_SIZE (ENUMRESNAMEPROCA, 4) + TEST_TYPE_ALIGN (ENUMRESNAMEPROCA, 4) +} + +static void test_pack_ENUMRESNAMEPROCW(void) +{ + /* ENUMRESNAMEPROCW */ + TEST_TYPE_SIZE (ENUMRESNAMEPROCW, 4) + TEST_TYPE_ALIGN (ENUMRESNAMEPROCW, 4) +} + +static void test_pack_ENUMRESTYPEPROCA(void) +{ + /* ENUMRESTYPEPROCA */ + TEST_TYPE_SIZE (ENUMRESTYPEPROCA, 4) + TEST_TYPE_ALIGN (ENUMRESTYPEPROCA, 4) +} + +static void test_pack_ENUMRESTYPEPROCW(void) +{ + /* ENUMRESTYPEPROCW */ + TEST_TYPE_SIZE (ENUMRESTYPEPROCW, 4) + TEST_TYPE_ALIGN (ENUMRESTYPEPROCW, 4) +} + +static void test_pack_EXCEPTION_DEBUG_INFO(void) +{ + /* EXCEPTION_DEBUG_INFO (pack 4) */ + TEST_TYPE_SIZE (EXCEPTION_DEBUG_INFO, 84) + TEST_TYPE_ALIGN (EXCEPTION_DEBUG_INFO, 4) + TEST_FIELD_SIZE (EXCEPTION_DEBUG_INFO, ExceptionRecord, 80) + TEST_FIELD_ALIGN (EXCEPTION_DEBUG_INFO, ExceptionRecord, 4) + TEST_FIELD_OFFSET(EXCEPTION_DEBUG_INFO, ExceptionRecord, 0) + TEST_FIELD_SIZE (EXCEPTION_DEBUG_INFO, dwFirstChance, 4) + TEST_FIELD_ALIGN (EXCEPTION_DEBUG_INFO, dwFirstChance, 4) + TEST_FIELD_OFFSET(EXCEPTION_DEBUG_INFO, dwFirstChance, 80) +} + +static void test_pack_EXIT_PROCESS_DEBUG_INFO(void) +{ + /* EXIT_PROCESS_DEBUG_INFO (pack 4) */ + TEST_TYPE_SIZE (EXIT_PROCESS_DEBUG_INFO, 4) + TEST_TYPE_ALIGN (EXIT_PROCESS_DEBUG_INFO, 4) + TEST_FIELD_SIZE (EXIT_PROCESS_DEBUG_INFO, dwExitCode, 4) + TEST_FIELD_ALIGN (EXIT_PROCESS_DEBUG_INFO, dwExitCode, 4) + TEST_FIELD_OFFSET(EXIT_PROCESS_DEBUG_INFO, dwExitCode, 0) +} + +static void test_pack_EXIT_THREAD_DEBUG_INFO(void) +{ + /* EXIT_THREAD_DEBUG_INFO (pack 4) */ + TEST_TYPE_SIZE (EXIT_THREAD_DEBUG_INFO, 4) + TEST_TYPE_ALIGN (EXIT_THREAD_DEBUG_INFO, 4) + TEST_FIELD_SIZE (EXIT_THREAD_DEBUG_INFO, dwExitCode, 4) + TEST_FIELD_ALIGN (EXIT_THREAD_DEBUG_INFO, dwExitCode, 4) + TEST_FIELD_OFFSET(EXIT_THREAD_DEBUG_INFO, dwExitCode, 0) +} + +static void test_pack_HW_PROFILE_INFOA(void) +{ + /* HW_PROFILE_INFOA (pack 4) */ + TEST_TYPE_SIZE (HW_PROFILE_INFOA, 124) + TEST_TYPE_ALIGN (HW_PROFILE_INFOA, 4) + TEST_FIELD_SIZE (HW_PROFILE_INFOA, dwDockInfo, 4) + TEST_FIELD_ALIGN (HW_PROFILE_INFOA, dwDockInfo, 4) + TEST_FIELD_OFFSET(HW_PROFILE_INFOA, dwDockInfo, 0) + TEST_FIELD_SIZE (HW_PROFILE_INFOA, szHwProfileGuid, 39) + TEST_FIELD_ALIGN (HW_PROFILE_INFOA, szHwProfileGuid, 1) + TEST_FIELD_OFFSET(HW_PROFILE_INFOA, szHwProfileGuid, 4) + TEST_FIELD_SIZE (HW_PROFILE_INFOA, szHwProfileName, 80) + TEST_FIELD_ALIGN (HW_PROFILE_INFOA, szHwProfileName, 1) + TEST_FIELD_OFFSET(HW_PROFILE_INFOA, szHwProfileName, 43) +} + +static void test_pack_HW_PROFILE_INFOW(void) +{ + /* HW_PROFILE_INFOW (pack 4) */ + TEST_TYPE_SIZE (HW_PROFILE_INFOW, 244) + TEST_TYPE_ALIGN (HW_PROFILE_INFOW, 4) + TEST_FIELD_SIZE (HW_PROFILE_INFOW, dwDockInfo, 4) + TEST_FIELD_ALIGN (HW_PROFILE_INFOW, dwDockInfo, 4) + TEST_FIELD_OFFSET(HW_PROFILE_INFOW, dwDockInfo, 0) + TEST_FIELD_SIZE (HW_PROFILE_INFOW, szHwProfileGuid, 78) + TEST_FIELD_ALIGN (HW_PROFILE_INFOW, szHwProfileGuid, 2) + TEST_FIELD_OFFSET(HW_PROFILE_INFOW, szHwProfileGuid, 4) + TEST_FIELD_SIZE (HW_PROFILE_INFOW, szHwProfileName, 160) + TEST_FIELD_ALIGN (HW_PROFILE_INFOW, szHwProfileName, 2) + TEST_FIELD_OFFSET(HW_PROFILE_INFOW, szHwProfileName, 82) +} + +static void test_pack_LOAD_DLL_DEBUG_INFO(void) +{ + /* LOAD_DLL_DEBUG_INFO (pack 4) */ + TEST_TYPE_SIZE (LOAD_DLL_DEBUG_INFO, 24) + TEST_TYPE_ALIGN (LOAD_DLL_DEBUG_INFO, 4) + TEST_FIELD_SIZE (LOAD_DLL_DEBUG_INFO, hFile, 4) + TEST_FIELD_ALIGN (LOAD_DLL_DEBUG_INFO, hFile, 4) + TEST_FIELD_OFFSET(LOAD_DLL_DEBUG_INFO, hFile, 0) + TEST_FIELD_SIZE (LOAD_DLL_DEBUG_INFO, lpBaseOfDll, 4) + TEST_FIELD_ALIGN (LOAD_DLL_DEBUG_INFO, lpBaseOfDll, 4) + TEST_FIELD_OFFSET(LOAD_DLL_DEBUG_INFO, lpBaseOfDll, 4) + TEST_FIELD_SIZE (LOAD_DLL_DEBUG_INFO, dwDebugInfoFileOffset, 4) + TEST_FIELD_ALIGN (LOAD_DLL_DEBUG_INFO, dwDebugInfoFileOffset, 4) + TEST_FIELD_OFFSET(LOAD_DLL_DEBUG_INFO, dwDebugInfoFileOffset, 8) + TEST_FIELD_SIZE (LOAD_DLL_DEBUG_INFO, nDebugInfoSize, 4) + TEST_FIELD_ALIGN (LOAD_DLL_DEBUG_INFO, nDebugInfoSize, 4) + TEST_FIELD_OFFSET(LOAD_DLL_DEBUG_INFO, nDebugInfoSize, 12) + TEST_FIELD_SIZE (LOAD_DLL_DEBUG_INFO, lpImageName, 4) + TEST_FIELD_ALIGN (LOAD_DLL_DEBUG_INFO, lpImageName, 4) + TEST_FIELD_OFFSET(LOAD_DLL_DEBUG_INFO, lpImageName, 16) + TEST_FIELD_SIZE (LOAD_DLL_DEBUG_INFO, fUnicode, 2) + TEST_FIELD_ALIGN (LOAD_DLL_DEBUG_INFO, fUnicode, 2) + TEST_FIELD_OFFSET(LOAD_DLL_DEBUG_INFO, fUnicode, 20) +} + +static void test_pack_LPBY_HANDLE_FILE_INFORMATION(void) +{ + /* LPBY_HANDLE_FILE_INFORMATION */ + TEST_TYPE_SIZE (LPBY_HANDLE_FILE_INFORMATION, 4) + TEST_TYPE_ALIGN (LPBY_HANDLE_FILE_INFORMATION, 4) + TEST_TARGET_SIZE (LPBY_HANDLE_FILE_INFORMATION, 52) + TEST_TARGET_ALIGN(LPBY_HANDLE_FILE_INFORMATION, 4) +} + +static void test_pack_LPCOMMCONFIG(void) +{ + /* LPCOMMCONFIG */ + TEST_TYPE_SIZE (LPCOMMCONFIG, 4) + TEST_TYPE_ALIGN (LPCOMMCONFIG, 4) + TEST_TARGET_SIZE (LPCOMMCONFIG, 52) + TEST_TARGET_ALIGN(LPCOMMCONFIG, 4) +} + +static void test_pack_LPCOMMPROP(void) +{ + /* LPCOMMPROP */ + TEST_TYPE_SIZE (LPCOMMPROP, 4) + TEST_TYPE_ALIGN (LPCOMMPROP, 4) + TEST_TARGET_SIZE (LPCOMMPROP, 64) + TEST_TARGET_ALIGN(LPCOMMPROP, 4) +} + +static void test_pack_LPCOMMTIMEOUTS(void) +{ + /* LPCOMMTIMEOUTS */ + TEST_TYPE_SIZE (LPCOMMTIMEOUTS, 4) + TEST_TYPE_ALIGN (LPCOMMTIMEOUTS, 4) + TEST_TARGET_SIZE (LPCOMMTIMEOUTS, 20) + TEST_TARGET_ALIGN(LPCOMMTIMEOUTS, 4) +} + +static void test_pack_LPCOMSTAT(void) +{ + /* LPCOMSTAT */ + TEST_TYPE_SIZE (LPCOMSTAT, 4) + TEST_TYPE_ALIGN (LPCOMSTAT, 4) + TEST_TARGET_SIZE (LPCOMSTAT, 12) + TEST_TARGET_ALIGN(LPCOMSTAT, 4) +} + +static void test_pack_LPCRITICAL_SECTION(void) +{ + /* LPCRITICAL_SECTION */ + TEST_TYPE_SIZE (LPCRITICAL_SECTION, 4) + TEST_TYPE_ALIGN (LPCRITICAL_SECTION, 4) +} + +static void test_pack_LPCRITICAL_SECTION_DEBUG(void) +{ + /* LPCRITICAL_SECTION_DEBUG */ + TEST_TYPE_SIZE (LPCRITICAL_SECTION_DEBUG, 4) + TEST_TYPE_ALIGN (LPCRITICAL_SECTION_DEBUG, 4) +} + +static void test_pack_LPDCB(void) +{ + /* LPDCB */ + TEST_TYPE_SIZE (LPDCB, 4) + TEST_TYPE_ALIGN (LPDCB, 4) + TEST_TARGET_SIZE (LPDCB, 28) + TEST_TARGET_ALIGN(LPDCB, 4) +} + +static void test_pack_LPDEBUG_EVENT(void) +{ + /* LPDEBUG_EVENT */ + TEST_TYPE_SIZE (LPDEBUG_EVENT, 4) + TEST_TYPE_ALIGN (LPDEBUG_EVENT, 4) +} + +static void test_pack_LPEXCEPTION_POINTERS(void) +{ + /* LPEXCEPTION_POINTERS */ + TEST_TYPE_SIZE (LPEXCEPTION_POINTERS, 4) + TEST_TYPE_ALIGN (LPEXCEPTION_POINTERS, 4) +} + +static void test_pack_LPEXCEPTION_RECORD(void) +{ + /* LPEXCEPTION_RECORD */ + TEST_TYPE_SIZE (LPEXCEPTION_RECORD, 4) + TEST_TYPE_ALIGN (LPEXCEPTION_RECORD, 4) +} + +static void test_pack_LPFIBER_START_ROUTINE(void) +{ + /* LPFIBER_START_ROUTINE */ + TEST_TYPE_SIZE (LPFIBER_START_ROUTINE, 4) + TEST_TYPE_ALIGN (LPFIBER_START_ROUTINE, 4) +} + +static void test_pack_LPHW_PROFILE_INFOA(void) +{ + /* LPHW_PROFILE_INFOA */ + TEST_TYPE_SIZE (LPHW_PROFILE_INFOA, 4) + TEST_TYPE_ALIGN (LPHW_PROFILE_INFOA, 4) + TEST_TARGET_SIZE (LPHW_PROFILE_INFOA, 124) + TEST_TARGET_ALIGN(LPHW_PROFILE_INFOA, 4) +} + +static void test_pack_LPHW_PROFILE_INFOW(void) +{ + /* LPHW_PROFILE_INFOW */ + TEST_TYPE_SIZE (LPHW_PROFILE_INFOW, 4) + TEST_TYPE_ALIGN (LPHW_PROFILE_INFOW, 4) + TEST_TARGET_SIZE (LPHW_PROFILE_INFOW, 244) + TEST_TARGET_ALIGN(LPHW_PROFILE_INFOW, 4) +} + +static void test_pack_LPMEMORYSTATUS(void) +{ + /* LPMEMORYSTATUS */ + TEST_TYPE_SIZE (LPMEMORYSTATUS, 4) + TEST_TYPE_ALIGN (LPMEMORYSTATUS, 4) + TEST_TARGET_SIZE (LPMEMORYSTATUS, 32) + TEST_TARGET_ALIGN(LPMEMORYSTATUS, 4) +} + +static void test_pack_LPMEMORYSTATUSEX(void) +{ + /* LPMEMORYSTATUSEX */ + TEST_TYPE_SIZE (LPMEMORYSTATUSEX, 4) + TEST_TYPE_ALIGN (LPMEMORYSTATUSEX, 4) + TEST_TARGET_SIZE (LPMEMORYSTATUSEX, 64) + TEST_TARGET_ALIGN(LPMEMORYSTATUSEX, 8) +} + +static void test_pack_LPOFSTRUCT(void) +{ + /* LPOFSTRUCT */ + TEST_TYPE_SIZE (LPOFSTRUCT, 4) + TEST_TYPE_ALIGN (LPOFSTRUCT, 4) + TEST_TARGET_SIZE (LPOFSTRUCT, 136) + TEST_TARGET_ALIGN(LPOFSTRUCT, 2) +} + +static void test_pack_LPOVERLAPPED(void) +{ + /* LPOVERLAPPED */ + TEST_TYPE_SIZE (LPOVERLAPPED, 4) + TEST_TYPE_ALIGN (LPOVERLAPPED, 4) +} + +static void test_pack_LPOVERLAPPED_COMPLETION_ROUTINE(void) +{ + /* LPOVERLAPPED_COMPLETION_ROUTINE */ + TEST_TYPE_SIZE (LPOVERLAPPED_COMPLETION_ROUTINE, 4) + TEST_TYPE_ALIGN (LPOVERLAPPED_COMPLETION_ROUTINE, 4) +} + +static void test_pack_LPPROCESS_HEAP_ENTRY(void) +{ + /* LPPROCESS_HEAP_ENTRY */ + TEST_TYPE_SIZE (LPPROCESS_HEAP_ENTRY, 4) + TEST_TYPE_ALIGN (LPPROCESS_HEAP_ENTRY, 4) +} + +static void test_pack_LPPROCESS_INFORMATION(void) +{ + /* LPPROCESS_INFORMATION */ + TEST_TYPE_SIZE (LPPROCESS_INFORMATION, 4) + TEST_TYPE_ALIGN (LPPROCESS_INFORMATION, 4) + TEST_TARGET_SIZE (LPPROCESS_INFORMATION, 16) + TEST_TARGET_ALIGN(LPPROCESS_INFORMATION, 4) +} + +static void test_pack_LPPROGRESS_ROUTINE(void) +{ + /* LPPROGRESS_ROUTINE */ + TEST_TYPE_SIZE (LPPROGRESS_ROUTINE, 4) + TEST_TYPE_ALIGN (LPPROGRESS_ROUTINE, 4) +} + +static void test_pack_LPSECURITY_ATTRIBUTES(void) +{ + /* LPSECURITY_ATTRIBUTES */ + TEST_TYPE_SIZE (LPSECURITY_ATTRIBUTES, 4) + TEST_TYPE_ALIGN (LPSECURITY_ATTRIBUTES, 4) + TEST_TARGET_SIZE (LPSECURITY_ATTRIBUTES, 12) + TEST_TARGET_ALIGN(LPSECURITY_ATTRIBUTES, 4) +} + +static void test_pack_LPSTARTUPINFOA(void) +{ + /* LPSTARTUPINFOA */ + TEST_TYPE_SIZE (LPSTARTUPINFOA, 4) + TEST_TYPE_ALIGN (LPSTARTUPINFOA, 4) + TEST_TARGET_SIZE (LPSTARTUPINFOA, 68) + TEST_TARGET_ALIGN(LPSTARTUPINFOA, 4) +} + +static void test_pack_LPSTARTUPINFOW(void) +{ + /* LPSTARTUPINFOW */ + TEST_TYPE_SIZE (LPSTARTUPINFOW, 4) + TEST_TYPE_ALIGN (LPSTARTUPINFOW, 4) + TEST_TARGET_SIZE (LPSTARTUPINFOW, 68) + TEST_TARGET_ALIGN(LPSTARTUPINFOW, 4) +} + +static void test_pack_LPSYSTEMTIME(void) +{ + /* LPSYSTEMTIME */ + TEST_TYPE_SIZE (LPSYSTEMTIME, 4) + TEST_TYPE_ALIGN (LPSYSTEMTIME, 4) + TEST_TARGET_SIZE (LPSYSTEMTIME, 16) + TEST_TARGET_ALIGN(LPSYSTEMTIME, 2) +} + +static void test_pack_LPSYSTEM_INFO(void) +{ + /* LPSYSTEM_INFO */ + TEST_TYPE_SIZE (LPSYSTEM_INFO, 4) + TEST_TYPE_ALIGN (LPSYSTEM_INFO, 4) +} + +static void test_pack_LPSYSTEM_POWER_STATUS(void) +{ + /* LPSYSTEM_POWER_STATUS */ + TEST_TYPE_SIZE (LPSYSTEM_POWER_STATUS, 4) + TEST_TYPE_ALIGN (LPSYSTEM_POWER_STATUS, 4) + TEST_TARGET_SIZE (LPSYSTEM_POWER_STATUS, 12) + TEST_TARGET_ALIGN(LPSYSTEM_POWER_STATUS, 4) +} + +static void test_pack_LPTHREAD_START_ROUTINE(void) +{ + /* LPTHREAD_START_ROUTINE */ + TEST_TYPE_SIZE (LPTHREAD_START_ROUTINE, 4) + TEST_TYPE_ALIGN (LPTHREAD_START_ROUTINE, 4) +} + +static void test_pack_LPTIME_ZONE_INFORMATION(void) +{ + /* LPTIME_ZONE_INFORMATION */ + TEST_TYPE_SIZE (LPTIME_ZONE_INFORMATION, 4) + TEST_TYPE_ALIGN (LPTIME_ZONE_INFORMATION, 4) + TEST_TARGET_SIZE (LPTIME_ZONE_INFORMATION, 172) + TEST_TARGET_ALIGN(LPTIME_ZONE_INFORMATION, 4) +} + +static void test_pack_LPWIN32_FILE_ATTRIBUTE_DATA(void) +{ + /* LPWIN32_FILE_ATTRIBUTE_DATA */ + TEST_TYPE_SIZE (LPWIN32_FILE_ATTRIBUTE_DATA, 4) + TEST_TYPE_ALIGN (LPWIN32_FILE_ATTRIBUTE_DATA, 4) + TEST_TARGET_SIZE (LPWIN32_FILE_ATTRIBUTE_DATA, 36) + TEST_TARGET_ALIGN(LPWIN32_FILE_ATTRIBUTE_DATA, 4) +} + +static void test_pack_LPWIN32_FIND_DATAA(void) +{ + /* LPWIN32_FIND_DATAA */ + TEST_TYPE_SIZE (LPWIN32_FIND_DATAA, 4) + TEST_TYPE_ALIGN (LPWIN32_FIND_DATAA, 4) + TEST_TARGET_SIZE (LPWIN32_FIND_DATAA, 320) + TEST_TARGET_ALIGN(LPWIN32_FIND_DATAA, 4) +} + +static void test_pack_LPWIN32_FIND_DATAW(void) +{ + /* LPWIN32_FIND_DATAW */ + TEST_TYPE_SIZE (LPWIN32_FIND_DATAW, 4) + TEST_TYPE_ALIGN (LPWIN32_FIND_DATAW, 4) + TEST_TARGET_SIZE (LPWIN32_FIND_DATAW, 592) + TEST_TARGET_ALIGN(LPWIN32_FIND_DATAW, 4) +} + +static void test_pack_LPWIN32_STREAM_ID(void) +{ + /* LPWIN32_STREAM_ID */ + TEST_TYPE_SIZE (LPWIN32_STREAM_ID, 4) + TEST_TYPE_ALIGN (LPWIN32_STREAM_ID, 4) + TEST_TARGET_SIZE (LPWIN32_STREAM_ID, 24) + TEST_TARGET_ALIGN(LPWIN32_STREAM_ID, 8) +} + +static void test_pack_MEMORYSTATUS(void) +{ + /* MEMORYSTATUS (pack 4) */ + TEST_TYPE_SIZE (MEMORYSTATUS, 32) + TEST_TYPE_ALIGN (MEMORYSTATUS, 4) + TEST_FIELD_SIZE (MEMORYSTATUS, dwLength, 4) + TEST_FIELD_ALIGN (MEMORYSTATUS, dwLength, 4) + TEST_FIELD_OFFSET(MEMORYSTATUS, dwLength, 0) + TEST_FIELD_SIZE (MEMORYSTATUS, dwMemoryLoad, 4) + TEST_FIELD_ALIGN (MEMORYSTATUS, dwMemoryLoad, 4) + TEST_FIELD_OFFSET(MEMORYSTATUS, dwMemoryLoad, 4) + TEST_FIELD_SIZE (MEMORYSTATUS, dwTotalPhys, 4) + TEST_FIELD_ALIGN (MEMORYSTATUS, dwTotalPhys, 4) + TEST_FIELD_OFFSET(MEMORYSTATUS, dwTotalPhys, 8) + TEST_FIELD_SIZE (MEMORYSTATUS, dwAvailPhys, 4) + TEST_FIELD_ALIGN (MEMORYSTATUS, dwAvailPhys, 4) + TEST_FIELD_OFFSET(MEMORYSTATUS, dwAvailPhys, 12) + TEST_FIELD_SIZE (MEMORYSTATUS, dwTotalPageFile, 4) + TEST_FIELD_ALIGN (MEMORYSTATUS, dwTotalPageFile, 4) + TEST_FIELD_OFFSET(MEMORYSTATUS, dwTotalPageFile, 16) + TEST_FIELD_SIZE (MEMORYSTATUS, dwAvailPageFile, 4) + TEST_FIELD_ALIGN (MEMORYSTATUS, dwAvailPageFile, 4) + TEST_FIELD_OFFSET(MEMORYSTATUS, dwAvailPageFile, 20) + TEST_FIELD_SIZE (MEMORYSTATUS, dwTotalVirtual, 4) + TEST_FIELD_ALIGN (MEMORYSTATUS, dwTotalVirtual, 4) + TEST_FIELD_OFFSET(MEMORYSTATUS, dwTotalVirtual, 24) + TEST_FIELD_SIZE (MEMORYSTATUS, dwAvailVirtual, 4) + TEST_FIELD_ALIGN (MEMORYSTATUS, dwAvailVirtual, 4) + TEST_FIELD_OFFSET(MEMORYSTATUS, dwAvailVirtual, 28) +} + +static void test_pack_MEMORYSTATUSEX(void) +{ + /* MEMORYSTATUSEX (pack 8) */ + TEST_TYPE_SIZE (MEMORYSTATUSEX, 64) + TEST_TYPE_ALIGN (MEMORYSTATUSEX, 8) + TEST_FIELD_SIZE (MEMORYSTATUSEX, dwLength, 4) + TEST_FIELD_ALIGN (MEMORYSTATUSEX, dwLength, 4) + TEST_FIELD_OFFSET(MEMORYSTATUSEX, dwLength, 0) + TEST_FIELD_SIZE (MEMORYSTATUSEX, dwMemoryLoad, 4) + TEST_FIELD_ALIGN (MEMORYSTATUSEX, dwMemoryLoad, 4) + TEST_FIELD_OFFSET(MEMORYSTATUSEX, dwMemoryLoad, 4) + TEST_FIELD_SIZE (MEMORYSTATUSEX, ullTotalPhys, 8) + TEST_FIELD_ALIGN (MEMORYSTATUSEX, ullTotalPhys, 8) + TEST_FIELD_OFFSET(MEMORYSTATUSEX, ullTotalPhys, 8) + TEST_FIELD_SIZE (MEMORYSTATUSEX, ullAvailPhys, 8) + TEST_FIELD_ALIGN (MEMORYSTATUSEX, ullAvailPhys, 8) + TEST_FIELD_OFFSET(MEMORYSTATUSEX, ullAvailPhys, 16) + TEST_FIELD_SIZE (MEMORYSTATUSEX, ullTotalPageFile, 8) + TEST_FIELD_ALIGN (MEMORYSTATUSEX, ullTotalPageFile, 8) + TEST_FIELD_OFFSET(MEMORYSTATUSEX, ullTotalPageFile, 24) + TEST_FIELD_SIZE (MEMORYSTATUSEX, ullAvailPageFile, 8) + TEST_FIELD_ALIGN (MEMORYSTATUSEX, ullAvailPageFile, 8) + TEST_FIELD_OFFSET(MEMORYSTATUSEX, ullAvailPageFile, 32) + TEST_FIELD_SIZE (MEMORYSTATUSEX, ullTotalVirtual, 8) + TEST_FIELD_ALIGN (MEMORYSTATUSEX, ullTotalVirtual, 8) + TEST_FIELD_OFFSET(MEMORYSTATUSEX, ullTotalVirtual, 40) + TEST_FIELD_SIZE (MEMORYSTATUSEX, ullAvailVirtual, 8) + TEST_FIELD_ALIGN (MEMORYSTATUSEX, ullAvailVirtual, 8) + TEST_FIELD_OFFSET(MEMORYSTATUSEX, ullAvailVirtual, 48) + TEST_FIELD_SIZE (MEMORYSTATUSEX, ullAvailExtendedVirtual, 8) + TEST_FIELD_ALIGN (MEMORYSTATUSEX, ullAvailExtendedVirtual, 8) + TEST_FIELD_OFFSET(MEMORYSTATUSEX, ullAvailExtendedVirtual, 56) +} + +static void test_pack_OFSTRUCT(void) +{ + /* OFSTRUCT (pack 4) */ + TEST_TYPE_SIZE (OFSTRUCT, 136) + TEST_TYPE_ALIGN (OFSTRUCT, 2) + TEST_FIELD_SIZE (OFSTRUCT, cBytes, 1) + TEST_FIELD_ALIGN (OFSTRUCT, cBytes, 1) + TEST_FIELD_OFFSET(OFSTRUCT, cBytes, 0) + TEST_FIELD_SIZE (OFSTRUCT, fFixedDisk, 1) + TEST_FIELD_ALIGN (OFSTRUCT, fFixedDisk, 1) + TEST_FIELD_OFFSET(OFSTRUCT, fFixedDisk, 1) + TEST_FIELD_SIZE (OFSTRUCT, nErrCode, 2) + TEST_FIELD_ALIGN (OFSTRUCT, nErrCode, 2) + TEST_FIELD_OFFSET(OFSTRUCT, nErrCode, 2) + TEST_FIELD_SIZE (OFSTRUCT, Reserved1, 2) + TEST_FIELD_ALIGN (OFSTRUCT, Reserved1, 2) + TEST_FIELD_OFFSET(OFSTRUCT, Reserved1, 4) + TEST_FIELD_SIZE (OFSTRUCT, Reserved2, 2) + TEST_FIELD_ALIGN (OFSTRUCT, Reserved2, 2) + TEST_FIELD_OFFSET(OFSTRUCT, Reserved2, 6) + TEST_FIELD_SIZE (OFSTRUCT, szPathName, 128) + TEST_FIELD_ALIGN (OFSTRUCT, szPathName, 1) + TEST_FIELD_OFFSET(OFSTRUCT, szPathName, 8) +} + +static void test_pack_OUTPUT_DEBUG_STRING_INFO(void) +{ + /* OUTPUT_DEBUG_STRING_INFO (pack 4) */ + TEST_TYPE_SIZE (OUTPUT_DEBUG_STRING_INFO, 8) + TEST_TYPE_ALIGN (OUTPUT_DEBUG_STRING_INFO, 4) + TEST_FIELD_SIZE (OUTPUT_DEBUG_STRING_INFO, lpDebugStringData, 4) + TEST_FIELD_ALIGN (OUTPUT_DEBUG_STRING_INFO, lpDebugStringData, 4) + TEST_FIELD_OFFSET(OUTPUT_DEBUG_STRING_INFO, lpDebugStringData, 0) + TEST_FIELD_SIZE (OUTPUT_DEBUG_STRING_INFO, fUnicode, 2) + TEST_FIELD_ALIGN (OUTPUT_DEBUG_STRING_INFO, fUnicode, 2) + TEST_FIELD_OFFSET(OUTPUT_DEBUG_STRING_INFO, fUnicode, 4) + TEST_FIELD_SIZE (OUTPUT_DEBUG_STRING_INFO, nDebugStringLength, 2) + TEST_FIELD_ALIGN (OUTPUT_DEBUG_STRING_INFO, nDebugStringLength, 2) + TEST_FIELD_OFFSET(OUTPUT_DEBUG_STRING_INFO, nDebugStringLength, 6) +} + +static void test_pack_PACTCTXA(void) +{ + /* PACTCTXA */ + TEST_TYPE_SIZE (PACTCTXA, 4) + TEST_TYPE_ALIGN (PACTCTXA, 4) + TEST_TARGET_SIZE (PACTCTXA, 32) + TEST_TARGET_ALIGN(PACTCTXA, 4) +} + +static void test_pack_PACTCTXW(void) +{ + /* PACTCTXW */ + TEST_TYPE_SIZE (PACTCTXW, 4) + TEST_TYPE_ALIGN (PACTCTXW, 4) + TEST_TARGET_SIZE (PACTCTXW, 32) + TEST_TARGET_ALIGN(PACTCTXW, 4) +} + +static void test_pack_PACTCTX_SECTION_KEYED_DATA(void) +{ + /* PACTCTX_SECTION_KEYED_DATA */ + TEST_TYPE_SIZE (PACTCTX_SECTION_KEYED_DATA, 4) + TEST_TYPE_ALIGN (PACTCTX_SECTION_KEYED_DATA, 4) + TEST_TARGET_SIZE (PACTCTX_SECTION_KEYED_DATA, 64) + TEST_TARGET_ALIGN(PACTCTX_SECTION_KEYED_DATA, 4) +} + +static void test_pack_PACTCTX_SECTION_KEYED_DATA_2600(void) +{ + /* PACTCTX_SECTION_KEYED_DATA_2600 */ + TEST_TYPE_SIZE (PACTCTX_SECTION_KEYED_DATA_2600, 4) + TEST_TYPE_ALIGN (PACTCTX_SECTION_KEYED_DATA_2600, 4) + TEST_TARGET_SIZE (PACTCTX_SECTION_KEYED_DATA_2600, 40) + TEST_TARGET_ALIGN(PACTCTX_SECTION_KEYED_DATA_2600, 4) +} + +static void test_pack_PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA(void) +{ + /* PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA */ + TEST_TYPE_SIZE (PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, 4) + TEST_TYPE_ALIGN (PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, 4) + TEST_TARGET_SIZE (PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, 20) + TEST_TARGET_ALIGN(PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, 4) +} + +static void test_pack_PACTIVATION_CONTEXT_BASIC_INFORMATION(void) +{ + /* PACTIVATION_CONTEXT_BASIC_INFORMATION */ + TEST_TYPE_SIZE (PACTIVATION_CONTEXT_BASIC_INFORMATION, 4) + TEST_TYPE_ALIGN (PACTIVATION_CONTEXT_BASIC_INFORMATION, 4) + TEST_TARGET_SIZE (PACTIVATION_CONTEXT_BASIC_INFORMATION, 8) + TEST_TARGET_ALIGN(PACTIVATION_CONTEXT_BASIC_INFORMATION, 4) +} + +static void test_pack_PAPCFUNC(void) +{ + /* PAPCFUNC */ + TEST_TYPE_SIZE (PAPCFUNC, 4) + TEST_TYPE_ALIGN (PAPCFUNC, 4) +} + +static void test_pack_PBY_HANDLE_FILE_INFORMATION(void) +{ + /* PBY_HANDLE_FILE_INFORMATION */ + TEST_TYPE_SIZE (PBY_HANDLE_FILE_INFORMATION, 4) + TEST_TYPE_ALIGN (PBY_HANDLE_FILE_INFORMATION, 4) + TEST_TARGET_SIZE (PBY_HANDLE_FILE_INFORMATION, 52) + TEST_TARGET_ALIGN(PBY_HANDLE_FILE_INFORMATION, 4) +} + +static void test_pack_PCACTCTXA(void) +{ + /* PCACTCTXA */ + TEST_TYPE_SIZE (PCACTCTXA, 4) + TEST_TYPE_ALIGN (PCACTCTXA, 4) + TEST_TARGET_SIZE (PCACTCTXA, 32) + TEST_TARGET_ALIGN(PCACTCTXA, 4) +} + +static void test_pack_PCACTCTXW(void) +{ + /* PCACTCTXW */ + TEST_TYPE_SIZE (PCACTCTXW, 4) + TEST_TYPE_ALIGN (PCACTCTXW, 4) + TEST_TARGET_SIZE (PCACTCTXW, 32) + TEST_TARGET_ALIGN(PCACTCTXW, 4) +} + +static void test_pack_PCACTCTX_SECTION_KEYED_DATA(void) +{ + /* PCACTCTX_SECTION_KEYED_DATA */ + TEST_TYPE_SIZE (PCACTCTX_SECTION_KEYED_DATA, 4) + TEST_TYPE_ALIGN (PCACTCTX_SECTION_KEYED_DATA, 4) + TEST_TARGET_SIZE (PCACTCTX_SECTION_KEYED_DATA, 64) + TEST_TARGET_ALIGN(PCACTCTX_SECTION_KEYED_DATA, 4) +} + +static void test_pack_PCACTCTX_SECTION_KEYED_DATA_2600(void) +{ + /* PCACTCTX_SECTION_KEYED_DATA_2600 */ + TEST_TYPE_SIZE (PCACTCTX_SECTION_KEYED_DATA_2600, 4) + TEST_TYPE_ALIGN (PCACTCTX_SECTION_KEYED_DATA_2600, 4) + TEST_TARGET_SIZE (PCACTCTX_SECTION_KEYED_DATA_2600, 40) + TEST_TARGET_ALIGN(PCACTCTX_SECTION_KEYED_DATA_2600, 4) +} + +static void test_pack_PCACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA(void) +{ + /* PCACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA */ + TEST_TYPE_SIZE (PCACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, 4) + TEST_TYPE_ALIGN (PCACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, 4) + TEST_TARGET_SIZE (PCACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, 20) + TEST_TARGET_ALIGN(PCACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, 4) +} + +static void test_pack_PCRITICAL_SECTION(void) +{ + /* PCRITICAL_SECTION */ + TEST_TYPE_SIZE (PCRITICAL_SECTION, 4) + TEST_TYPE_ALIGN (PCRITICAL_SECTION, 4) +} + +static void test_pack_PCRITICAL_SECTION_DEBUG(void) +{ + /* PCRITICAL_SECTION_DEBUG */ + TEST_TYPE_SIZE (PCRITICAL_SECTION_DEBUG, 4) + TEST_TYPE_ALIGN (PCRITICAL_SECTION_DEBUG, 4) +} + +static void test_pack_PFIBER_START_ROUTINE(void) +{ + /* PFIBER_START_ROUTINE */ + TEST_TYPE_SIZE (PFIBER_START_ROUTINE, 4) + TEST_TYPE_ALIGN (PFIBER_START_ROUTINE, 4) +} + +static void test_pack_POFSTRUCT(void) +{ + /* POFSTRUCT */ + TEST_TYPE_SIZE (POFSTRUCT, 4) + TEST_TYPE_ALIGN (POFSTRUCT, 4) + TEST_TARGET_SIZE (POFSTRUCT, 136) + TEST_TARGET_ALIGN(POFSTRUCT, 2) +} + +static void test_pack_PPROCESS_HEAP_ENTRY(void) +{ + /* PPROCESS_HEAP_ENTRY */ + TEST_TYPE_SIZE (PPROCESS_HEAP_ENTRY, 4) + TEST_TYPE_ALIGN (PPROCESS_HEAP_ENTRY, 4) +} + +static void test_pack_PPROCESS_INFORMATION(void) +{ + /* PPROCESS_INFORMATION */ + TEST_TYPE_SIZE (PPROCESS_INFORMATION, 4) + TEST_TYPE_ALIGN (PPROCESS_INFORMATION, 4) + TEST_TARGET_SIZE (PPROCESS_INFORMATION, 16) + TEST_TARGET_ALIGN(PPROCESS_INFORMATION, 4) +} + +static void test_pack_PQUERYACTCTXW_FUNC(void) +{ + /* PQUERYACTCTXW_FUNC */ + TEST_TYPE_SIZE (PQUERYACTCTXW_FUNC, 4) + TEST_TYPE_ALIGN (PQUERYACTCTXW_FUNC, 4) +} + +static void test_pack_PROCESS_HEAP_ENTRY(void) +{ + /* PROCESS_HEAP_ENTRY (pack 4) */ + TEST_FIELD_SIZE (PROCESS_HEAP_ENTRY, lpData, 4) + TEST_FIELD_ALIGN (PROCESS_HEAP_ENTRY, lpData, 4) + TEST_FIELD_OFFSET(PROCESS_HEAP_ENTRY, lpData, 0) + TEST_FIELD_SIZE (PROCESS_HEAP_ENTRY, cbData, 4) + TEST_FIELD_ALIGN (PROCESS_HEAP_ENTRY, cbData, 4) + TEST_FIELD_OFFSET(PROCESS_HEAP_ENTRY, cbData, 4) + TEST_FIELD_SIZE (PROCESS_HEAP_ENTRY, cbOverhead, 1) + TEST_FIELD_ALIGN (PROCESS_HEAP_ENTRY, cbOverhead, 1) + TEST_FIELD_OFFSET(PROCESS_HEAP_ENTRY, cbOverhead, 8) + TEST_FIELD_SIZE (PROCESS_HEAP_ENTRY, iRegionIndex, 1) + TEST_FIELD_ALIGN (PROCESS_HEAP_ENTRY, iRegionIndex, 1) + TEST_FIELD_OFFSET(PROCESS_HEAP_ENTRY, iRegionIndex, 9) + TEST_FIELD_SIZE (PROCESS_HEAP_ENTRY, wFlags, 2) + TEST_FIELD_ALIGN (PROCESS_HEAP_ENTRY, wFlags, 2) + TEST_FIELD_OFFSET(PROCESS_HEAP_ENTRY, wFlags, 10) +} + +static void test_pack_PROCESS_INFORMATION(void) +{ + /* PROCESS_INFORMATION (pack 4) */ + TEST_TYPE_SIZE (PROCESS_INFORMATION, 16) + TEST_TYPE_ALIGN (PROCESS_INFORMATION, 4) + TEST_FIELD_SIZE (PROCESS_INFORMATION, hProcess, 4) + TEST_FIELD_ALIGN (PROCESS_INFORMATION, hProcess, 4) + TEST_FIELD_OFFSET(PROCESS_INFORMATION, hProcess, 0) + TEST_FIELD_SIZE (PROCESS_INFORMATION, hThread, 4) + TEST_FIELD_ALIGN (PROCESS_INFORMATION, hThread, 4) + TEST_FIELD_OFFSET(PROCESS_INFORMATION, hThread, 4) + TEST_FIELD_SIZE (PROCESS_INFORMATION, dwProcessId, 4) + TEST_FIELD_ALIGN (PROCESS_INFORMATION, dwProcessId, 4) + TEST_FIELD_OFFSET(PROCESS_INFORMATION, dwProcessId, 8) + TEST_FIELD_SIZE (PROCESS_INFORMATION, dwThreadId, 4) + TEST_FIELD_ALIGN (PROCESS_INFORMATION, dwThreadId, 4) + TEST_FIELD_OFFSET(PROCESS_INFORMATION, dwThreadId, 12) +} + +static void test_pack_PSECURITY_ATTRIBUTES(void) +{ + /* PSECURITY_ATTRIBUTES */ + TEST_TYPE_SIZE (PSECURITY_ATTRIBUTES, 4) + TEST_TYPE_ALIGN (PSECURITY_ATTRIBUTES, 4) + TEST_TARGET_SIZE (PSECURITY_ATTRIBUTES, 12) + TEST_TARGET_ALIGN(PSECURITY_ATTRIBUTES, 4) +} + +static void test_pack_PSYSTEMTIME(void) +{ + /* PSYSTEMTIME */ + TEST_TYPE_SIZE (PSYSTEMTIME, 4) + TEST_TYPE_ALIGN (PSYSTEMTIME, 4) + TEST_TARGET_SIZE (PSYSTEMTIME, 16) + TEST_TARGET_ALIGN(PSYSTEMTIME, 2) +} + +static void test_pack_PTIMERAPCROUTINE(void) +{ + /* PTIMERAPCROUTINE */ + TEST_TYPE_SIZE (PTIMERAPCROUTINE, 4) + TEST_TYPE_ALIGN (PTIMERAPCROUTINE, 4) +} + +static void test_pack_PTIME_ZONE_INFORMATION(void) +{ + /* PTIME_ZONE_INFORMATION */ + TEST_TYPE_SIZE (PTIME_ZONE_INFORMATION, 4) + TEST_TYPE_ALIGN (PTIME_ZONE_INFORMATION, 4) + TEST_TARGET_SIZE (PTIME_ZONE_INFORMATION, 172) + TEST_TARGET_ALIGN(PTIME_ZONE_INFORMATION, 4) +} + +static void test_pack_PWIN32_FIND_DATAA(void) +{ + /* PWIN32_FIND_DATAA */ + TEST_TYPE_SIZE (PWIN32_FIND_DATAA, 4) + TEST_TYPE_ALIGN (PWIN32_FIND_DATAA, 4) + TEST_TARGET_SIZE (PWIN32_FIND_DATAA, 320) + TEST_TARGET_ALIGN(PWIN32_FIND_DATAA, 4) +} + +static void test_pack_PWIN32_FIND_DATAW(void) +{ + /* PWIN32_FIND_DATAW */ + TEST_TYPE_SIZE (PWIN32_FIND_DATAW, 4) + TEST_TYPE_ALIGN (PWIN32_FIND_DATAW, 4) + TEST_TARGET_SIZE (PWIN32_FIND_DATAW, 592) + TEST_TARGET_ALIGN(PWIN32_FIND_DATAW, 4) +} + +static void test_pack_RIP_INFO(void) +{ + /* RIP_INFO (pack 4) */ + TEST_TYPE_SIZE (RIP_INFO, 8) + TEST_TYPE_ALIGN (RIP_INFO, 4) + TEST_FIELD_SIZE (RIP_INFO, dwError, 4) + TEST_FIELD_ALIGN (RIP_INFO, dwError, 4) + TEST_FIELD_OFFSET(RIP_INFO, dwError, 0) + TEST_FIELD_SIZE (RIP_INFO, dwType, 4) + TEST_FIELD_ALIGN (RIP_INFO, dwType, 4) + TEST_FIELD_OFFSET(RIP_INFO, dwType, 4) +} + +static void test_pack_SECURITY_ATTRIBUTES(void) +{ + /* SECURITY_ATTRIBUTES (pack 4) */ + TEST_TYPE_SIZE (SECURITY_ATTRIBUTES, 12) + TEST_TYPE_ALIGN (SECURITY_ATTRIBUTES, 4) + TEST_FIELD_SIZE (SECURITY_ATTRIBUTES, nLength, 4) + TEST_FIELD_ALIGN (SECURITY_ATTRIBUTES, nLength, 4) + TEST_FIELD_OFFSET(SECURITY_ATTRIBUTES, nLength, 0) + TEST_FIELD_SIZE (SECURITY_ATTRIBUTES, lpSecurityDescriptor, 4) + TEST_FIELD_ALIGN (SECURITY_ATTRIBUTES, lpSecurityDescriptor, 4) + TEST_FIELD_OFFSET(SECURITY_ATTRIBUTES, lpSecurityDescriptor, 4) + TEST_FIELD_SIZE (SECURITY_ATTRIBUTES, bInheritHandle, 4) + TEST_FIELD_ALIGN (SECURITY_ATTRIBUTES, bInheritHandle, 4) + TEST_FIELD_OFFSET(SECURITY_ATTRIBUTES, bInheritHandle, 8) +} + +static void test_pack_STARTUPINFOA(void) +{ + /* STARTUPINFOA (pack 4) */ + TEST_TYPE_SIZE (STARTUPINFOA, 68) + TEST_TYPE_ALIGN (STARTUPINFOA, 4) + TEST_FIELD_SIZE (STARTUPINFOA, cb, 4) + TEST_FIELD_ALIGN (STARTUPINFOA, cb, 4) + TEST_FIELD_OFFSET(STARTUPINFOA, cb, 0) + TEST_FIELD_SIZE (STARTUPINFOA, lpReserved, 4) + TEST_FIELD_ALIGN (STARTUPINFOA, lpReserved, 4) + TEST_FIELD_OFFSET(STARTUPINFOA, lpReserved, 4) + TEST_FIELD_SIZE (STARTUPINFOA, lpDesktop, 4) + TEST_FIELD_ALIGN (STARTUPINFOA, lpDesktop, 4) + TEST_FIELD_OFFSET(STARTUPINFOA, lpDesktop, 8) + TEST_FIELD_SIZE (STARTUPINFOA, lpTitle, 4) + TEST_FIELD_ALIGN (STARTUPINFOA, lpTitle, 4) + TEST_FIELD_OFFSET(STARTUPINFOA, lpTitle, 12) + TEST_FIELD_SIZE (STARTUPINFOA, dwX, 4) + TEST_FIELD_ALIGN (STARTUPINFOA, dwX, 4) + TEST_FIELD_OFFSET(STARTUPINFOA, dwX, 16) + TEST_FIELD_SIZE (STARTUPINFOA, dwY, 4) + TEST_FIELD_ALIGN (STARTUPINFOA, dwY, 4) + TEST_FIELD_OFFSET(STARTUPINFOA, dwY, 20) + TEST_FIELD_SIZE (STARTUPINFOA, dwXSize, 4) + TEST_FIELD_ALIGN (STARTUPINFOA, dwXSize, 4) + TEST_FIELD_OFFSET(STARTUPINFOA, dwXSize, 24) + TEST_FIELD_SIZE (STARTUPINFOA, dwYSize, 4) + TEST_FIELD_ALIGN (STARTUPINFOA, dwYSize, 4) + TEST_FIELD_OFFSET(STARTUPINFOA, dwYSize, 28) + TEST_FIELD_SIZE (STARTUPINFOA, dwXCountChars, 4) + TEST_FIELD_ALIGN (STARTUPINFOA, dwXCountChars, 4) + TEST_FIELD_OFFSET(STARTUPINFOA, dwXCountChars, 32) + TEST_FIELD_SIZE (STARTUPINFOA, dwYCountChars, 4) + TEST_FIELD_ALIGN (STARTUPINFOA, dwYCountChars, 4) + TEST_FIELD_OFFSET(STARTUPINFOA, dwYCountChars, 36) + TEST_FIELD_SIZE (STARTUPINFOA, dwFillAttribute, 4) + TEST_FIELD_ALIGN (STARTUPINFOA, dwFillAttribute, 4) + TEST_FIELD_OFFSET(STARTUPINFOA, dwFillAttribute, 40) + TEST_FIELD_SIZE (STARTUPINFOA, dwFlags, 4) + TEST_FIELD_ALIGN (STARTUPINFOA, dwFlags, 4) + TEST_FIELD_OFFSET(STARTUPINFOA, dwFlags, 44) + TEST_FIELD_SIZE (STARTUPINFOA, wShowWindow, 2) + TEST_FIELD_ALIGN (STARTUPINFOA, wShowWindow, 2) + TEST_FIELD_OFFSET(STARTUPINFOA, wShowWindow, 48) + TEST_FIELD_SIZE (STARTUPINFOA, cbReserved2, 2) + TEST_FIELD_ALIGN (STARTUPINFOA, cbReserved2, 2) + TEST_FIELD_OFFSET(STARTUPINFOA, cbReserved2, 50) + TEST_FIELD_SIZE (STARTUPINFOA, lpReserved2, 4) + TEST_FIELD_ALIGN (STARTUPINFOA, lpReserved2, 4) + TEST_FIELD_OFFSET(STARTUPINFOA, lpReserved2, 52) + TEST_FIELD_SIZE (STARTUPINFOA, hStdInput, 4) + TEST_FIELD_ALIGN (STARTUPINFOA, hStdInput, 4) + TEST_FIELD_OFFSET(STARTUPINFOA, hStdInput, 56) + TEST_FIELD_SIZE (STARTUPINFOA, hStdOutput, 4) + TEST_FIELD_ALIGN (STARTUPINFOA, hStdOutput, 4) + TEST_FIELD_OFFSET(STARTUPINFOA, hStdOutput, 60) + TEST_FIELD_SIZE (STARTUPINFOA, hStdError, 4) + TEST_FIELD_ALIGN (STARTUPINFOA, hStdError, 4) + TEST_FIELD_OFFSET(STARTUPINFOA, hStdError, 64) +} + +static void test_pack_STARTUPINFOW(void) +{ + /* STARTUPINFOW (pack 4) */ + TEST_TYPE_SIZE (STARTUPINFOW, 68) + TEST_TYPE_ALIGN (STARTUPINFOW, 4) + TEST_FIELD_SIZE (STARTUPINFOW, cb, 4) + TEST_FIELD_ALIGN (STARTUPINFOW, cb, 4) + TEST_FIELD_OFFSET(STARTUPINFOW, cb, 0) + TEST_FIELD_SIZE (STARTUPINFOW, lpReserved, 4) + TEST_FIELD_ALIGN (STARTUPINFOW, lpReserved, 4) + TEST_FIELD_OFFSET(STARTUPINFOW, lpReserved, 4) + TEST_FIELD_SIZE (STARTUPINFOW, lpDesktop, 4) + TEST_FIELD_ALIGN (STARTUPINFOW, lpDesktop, 4) + TEST_FIELD_OFFSET(STARTUPINFOW, lpDesktop, 8) + TEST_FIELD_SIZE (STARTUPINFOW, lpTitle, 4) + TEST_FIELD_ALIGN (STARTUPINFOW, lpTitle, 4) + TEST_FIELD_OFFSET(STARTUPINFOW, lpTitle, 12) + TEST_FIELD_SIZE (STARTUPINFOW, dwX, 4) + TEST_FIELD_ALIGN (STARTUPINFOW, dwX, 4) + TEST_FIELD_OFFSET(STARTUPINFOW, dwX, 16) + TEST_FIELD_SIZE (STARTUPINFOW, dwY, 4) + TEST_FIELD_ALIGN (STARTUPINFOW, dwY, 4) + TEST_FIELD_OFFSET(STARTUPINFOW, dwY, 20) + TEST_FIELD_SIZE (STARTUPINFOW, dwXSize, 4) + TEST_FIELD_ALIGN (STARTUPINFOW, dwXSize, 4) + TEST_FIELD_OFFSET(STARTUPINFOW, dwXSize, 24) + TEST_FIELD_SIZE (STARTUPINFOW, dwYSize, 4) + TEST_FIELD_ALIGN (STARTUPINFOW, dwYSize, 4) + TEST_FIELD_OFFSET(STARTUPINFOW, dwYSize, 28) + TEST_FIELD_SIZE (STARTUPINFOW, dwXCountChars, 4) + TEST_FIELD_ALIGN (STARTUPINFOW, dwXCountChars, 4) + TEST_FIELD_OFFSET(STARTUPINFOW, dwXCountChars, 32) + TEST_FIELD_SIZE (STARTUPINFOW, dwYCountChars, 4) + TEST_FIELD_ALIGN (STARTUPINFOW, dwYCountChars, 4) + TEST_FIELD_OFFSET(STARTUPINFOW, dwYCountChars, 36) + TEST_FIELD_SIZE (STARTUPINFOW, dwFillAttribute, 4) + TEST_FIELD_ALIGN (STARTUPINFOW, dwFillAttribute, 4) + TEST_FIELD_OFFSET(STARTUPINFOW, dwFillAttribute, 40) + TEST_FIELD_SIZE (STARTUPINFOW, dwFlags, 4) + TEST_FIELD_ALIGN (STARTUPINFOW, dwFlags, 4) + TEST_FIELD_OFFSET(STARTUPINFOW, dwFlags, 44) + TEST_FIELD_SIZE (STARTUPINFOW, wShowWindow, 2) + TEST_FIELD_ALIGN (STARTUPINFOW, wShowWindow, 2) + TEST_FIELD_OFFSET(STARTUPINFOW, wShowWindow, 48) + TEST_FIELD_SIZE (STARTUPINFOW, cbReserved2, 2) + TEST_FIELD_ALIGN (STARTUPINFOW, cbReserved2, 2) + TEST_FIELD_OFFSET(STARTUPINFOW, cbReserved2, 50) + TEST_FIELD_SIZE (STARTUPINFOW, lpReserved2, 4) + TEST_FIELD_ALIGN (STARTUPINFOW, lpReserved2, 4) + TEST_FIELD_OFFSET(STARTUPINFOW, lpReserved2, 52) + TEST_FIELD_SIZE (STARTUPINFOW, hStdInput, 4) + TEST_FIELD_ALIGN (STARTUPINFOW, hStdInput, 4) + TEST_FIELD_OFFSET(STARTUPINFOW, hStdInput, 56) + TEST_FIELD_SIZE (STARTUPINFOW, hStdOutput, 4) + TEST_FIELD_ALIGN (STARTUPINFOW, hStdOutput, 4) + TEST_FIELD_OFFSET(STARTUPINFOW, hStdOutput, 60) + TEST_FIELD_SIZE (STARTUPINFOW, hStdError, 4) + TEST_FIELD_ALIGN (STARTUPINFOW, hStdError, 4) + TEST_FIELD_OFFSET(STARTUPINFOW, hStdError, 64) +} + +static void test_pack_SYSTEMTIME(void) +{ + /* SYSTEMTIME (pack 4) */ + TEST_TYPE_SIZE (SYSTEMTIME, 16) + TEST_TYPE_ALIGN (SYSTEMTIME, 2) + TEST_FIELD_SIZE (SYSTEMTIME, wYear, 2) + TEST_FIELD_ALIGN (SYSTEMTIME, wYear, 2) + TEST_FIELD_OFFSET(SYSTEMTIME, wYear, 0) + TEST_FIELD_SIZE (SYSTEMTIME, wMonth, 2) + TEST_FIELD_ALIGN (SYSTEMTIME, wMonth, 2) + TEST_FIELD_OFFSET(SYSTEMTIME, wMonth, 2) + TEST_FIELD_SIZE (SYSTEMTIME, wDayOfWeek, 2) + TEST_FIELD_ALIGN (SYSTEMTIME, wDayOfWeek, 2) + TEST_FIELD_OFFSET(SYSTEMTIME, wDayOfWeek, 4) + TEST_FIELD_SIZE (SYSTEMTIME, wDay, 2) + TEST_FIELD_ALIGN (SYSTEMTIME, wDay, 2) + TEST_FIELD_OFFSET(SYSTEMTIME, wDay, 6) + TEST_FIELD_SIZE (SYSTEMTIME, wHour, 2) + TEST_FIELD_ALIGN (SYSTEMTIME, wHour, 2) + TEST_FIELD_OFFSET(SYSTEMTIME, wHour, 8) + TEST_FIELD_SIZE (SYSTEMTIME, wMinute, 2) + TEST_FIELD_ALIGN (SYSTEMTIME, wMinute, 2) + TEST_FIELD_OFFSET(SYSTEMTIME, wMinute, 10) + TEST_FIELD_SIZE (SYSTEMTIME, wSecond, 2) + TEST_FIELD_ALIGN (SYSTEMTIME, wSecond, 2) + TEST_FIELD_OFFSET(SYSTEMTIME, wSecond, 12) + TEST_FIELD_SIZE (SYSTEMTIME, wMilliseconds, 2) + TEST_FIELD_ALIGN (SYSTEMTIME, wMilliseconds, 2) + TEST_FIELD_OFFSET(SYSTEMTIME, wMilliseconds, 14) +} + +static void test_pack_SYSTEM_INFO(void) +{ + /* SYSTEM_INFO (pack 4) */ +} + +static void test_pack_SYSTEM_POWER_STATUS(void) +{ + /* SYSTEM_POWER_STATUS (pack 4) */ + TEST_TYPE_SIZE (SYSTEM_POWER_STATUS, 12) + TEST_TYPE_ALIGN (SYSTEM_POWER_STATUS, 4) + TEST_FIELD_SIZE (SYSTEM_POWER_STATUS, ACLineStatus, 1) + TEST_FIELD_ALIGN (SYSTEM_POWER_STATUS, ACLineStatus, 1) + TEST_FIELD_OFFSET(SYSTEM_POWER_STATUS, ACLineStatus, 0) + TEST_FIELD_SIZE (SYSTEM_POWER_STATUS, BatteryFlag, 1) + TEST_FIELD_ALIGN (SYSTEM_POWER_STATUS, BatteryFlag, 1) + TEST_FIELD_OFFSET(SYSTEM_POWER_STATUS, BatteryFlag, 1) + TEST_FIELD_SIZE (SYSTEM_POWER_STATUS, BatteryLifePercent, 1) + TEST_FIELD_ALIGN (SYSTEM_POWER_STATUS, BatteryLifePercent, 1) + TEST_FIELD_OFFSET(SYSTEM_POWER_STATUS, BatteryLifePercent, 2) + TEST_FIELD_SIZE (SYSTEM_POWER_STATUS, Reserved1, 1) + TEST_FIELD_ALIGN (SYSTEM_POWER_STATUS, Reserved1, 1) + TEST_FIELD_OFFSET(SYSTEM_POWER_STATUS, Reserved1, 3) + TEST_FIELD_SIZE (SYSTEM_POWER_STATUS, BatteryLifeTime, 4) + TEST_FIELD_ALIGN (SYSTEM_POWER_STATUS, BatteryLifeTime, 4) + TEST_FIELD_OFFSET(SYSTEM_POWER_STATUS, BatteryLifeTime, 4) + TEST_FIELD_SIZE (SYSTEM_POWER_STATUS, BatteryFullLifeTime, 4) + TEST_FIELD_ALIGN (SYSTEM_POWER_STATUS, BatteryFullLifeTime, 4) + TEST_FIELD_OFFSET(SYSTEM_POWER_STATUS, BatteryFullLifeTime, 8) +} + +static void test_pack_TIME_ZONE_INFORMATION(void) +{ + /* TIME_ZONE_INFORMATION (pack 4) */ + TEST_TYPE_SIZE (TIME_ZONE_INFORMATION, 172) + TEST_TYPE_ALIGN (TIME_ZONE_INFORMATION, 4) + TEST_FIELD_SIZE (TIME_ZONE_INFORMATION, Bias, 4) + TEST_FIELD_ALIGN (TIME_ZONE_INFORMATION, Bias, 4) + TEST_FIELD_OFFSET(TIME_ZONE_INFORMATION, Bias, 0) + TEST_FIELD_SIZE (TIME_ZONE_INFORMATION, StandardName, 64) + TEST_FIELD_ALIGN (TIME_ZONE_INFORMATION, StandardName, 2) + TEST_FIELD_OFFSET(TIME_ZONE_INFORMATION, StandardName, 4) + TEST_FIELD_SIZE (TIME_ZONE_INFORMATION, StandardDate, 16) + TEST_FIELD_ALIGN (TIME_ZONE_INFORMATION, StandardDate, 2) + TEST_FIELD_OFFSET(TIME_ZONE_INFORMATION, StandardDate, 68) + TEST_FIELD_SIZE (TIME_ZONE_INFORMATION, StandardBias, 4) + TEST_FIELD_ALIGN (TIME_ZONE_INFORMATION, StandardBias, 4) + TEST_FIELD_OFFSET(TIME_ZONE_INFORMATION, StandardBias, 84) + TEST_FIELD_SIZE (TIME_ZONE_INFORMATION, DaylightName, 64) + TEST_FIELD_ALIGN (TIME_ZONE_INFORMATION, DaylightName, 2) + TEST_FIELD_OFFSET(TIME_ZONE_INFORMATION, DaylightName, 88) + TEST_FIELD_SIZE (TIME_ZONE_INFORMATION, DaylightDate, 16) + TEST_FIELD_ALIGN (TIME_ZONE_INFORMATION, DaylightDate, 2) + TEST_FIELD_OFFSET(TIME_ZONE_INFORMATION, DaylightDate, 152) + TEST_FIELD_SIZE (TIME_ZONE_INFORMATION, DaylightBias, 4) + TEST_FIELD_ALIGN (TIME_ZONE_INFORMATION, DaylightBias, 4) + TEST_FIELD_OFFSET(TIME_ZONE_INFORMATION, DaylightBias, 168) +} + +static void test_pack_UNLOAD_DLL_DEBUG_INFO(void) +{ + /* UNLOAD_DLL_DEBUG_INFO (pack 4) */ + TEST_TYPE_SIZE (UNLOAD_DLL_DEBUG_INFO, 4) + TEST_TYPE_ALIGN (UNLOAD_DLL_DEBUG_INFO, 4) + TEST_FIELD_SIZE (UNLOAD_DLL_DEBUG_INFO, lpBaseOfDll, 4) + TEST_FIELD_ALIGN (UNLOAD_DLL_DEBUG_INFO, lpBaseOfDll, 4) + TEST_FIELD_OFFSET(UNLOAD_DLL_DEBUG_INFO, lpBaseOfDll, 0) +} + +static void test_pack_WAITORTIMERCALLBACK(void) +{ + /* WAITORTIMERCALLBACK */ + TEST_TYPE_SIZE (WAITORTIMERCALLBACK, 4) + TEST_TYPE_ALIGN (WAITORTIMERCALLBACK, 4) +} + +static void test_pack_WIN32_FILE_ATTRIBUTE_DATA(void) +{ + /* WIN32_FILE_ATTRIBUTE_DATA (pack 4) */ + TEST_TYPE_SIZE (WIN32_FILE_ATTRIBUTE_DATA, 36) + TEST_TYPE_ALIGN (WIN32_FILE_ATTRIBUTE_DATA, 4) + TEST_FIELD_SIZE (WIN32_FILE_ATTRIBUTE_DATA, dwFileAttributes, 4) + TEST_FIELD_ALIGN (WIN32_FILE_ATTRIBUTE_DATA, dwFileAttributes, 4) + TEST_FIELD_OFFSET(WIN32_FILE_ATTRIBUTE_DATA, dwFileAttributes, 0) + TEST_FIELD_SIZE (WIN32_FILE_ATTRIBUTE_DATA, ftCreationTime, 8) + TEST_FIELD_ALIGN (WIN32_FILE_ATTRIBUTE_DATA, ftCreationTime, 4) + TEST_FIELD_OFFSET(WIN32_FILE_ATTRIBUTE_DATA, ftCreationTime, 4) + TEST_FIELD_SIZE (WIN32_FILE_ATTRIBUTE_DATA, ftLastAccessTime, 8) + TEST_FIELD_ALIGN (WIN32_FILE_ATTRIBUTE_DATA, ftLastAccessTime, 4) + TEST_FIELD_OFFSET(WIN32_FILE_ATTRIBUTE_DATA, ftLastAccessTime, 12) + TEST_FIELD_SIZE (WIN32_FILE_ATTRIBUTE_DATA, ftLastWriteTime, 8) + TEST_FIELD_ALIGN (WIN32_FILE_ATTRIBUTE_DATA, ftLastWriteTime, 4) + TEST_FIELD_OFFSET(WIN32_FILE_ATTRIBUTE_DATA, ftLastWriteTime, 20) + TEST_FIELD_SIZE (WIN32_FILE_ATTRIBUTE_DATA, nFileSizeHigh, 4) + TEST_FIELD_ALIGN (WIN32_FILE_ATTRIBUTE_DATA, nFileSizeHigh, 4) + TEST_FIELD_OFFSET(WIN32_FILE_ATTRIBUTE_DATA, nFileSizeHigh, 28) + TEST_FIELD_SIZE (WIN32_FILE_ATTRIBUTE_DATA, nFileSizeLow, 4) + TEST_FIELD_ALIGN (WIN32_FILE_ATTRIBUTE_DATA, nFileSizeLow, 4) + TEST_FIELD_OFFSET(WIN32_FILE_ATTRIBUTE_DATA, nFileSizeLow, 32) +} + +static void test_pack_WIN32_FIND_DATAA(void) +{ + /* WIN32_FIND_DATAA (pack 4) */ + TEST_TYPE_SIZE (WIN32_FIND_DATAA, 320) + TEST_TYPE_ALIGN (WIN32_FIND_DATAA, 4) + TEST_FIELD_SIZE (WIN32_FIND_DATAA, dwFileAttributes, 4) + TEST_FIELD_ALIGN (WIN32_FIND_DATAA, dwFileAttributes, 4) + TEST_FIELD_OFFSET(WIN32_FIND_DATAA, dwFileAttributes, 0) + TEST_FIELD_SIZE (WIN32_FIND_DATAA, ftCreationTime, 8) + TEST_FIELD_ALIGN (WIN32_FIND_DATAA, ftCreationTime, 4) + TEST_FIELD_OFFSET(WIN32_FIND_DATAA, ftCreationTime, 4) + TEST_FIELD_SIZE (WIN32_FIND_DATAA, ftLastAccessTime, 8) + TEST_FIELD_ALIGN (WIN32_FIND_DATAA, ftLastAccessTime, 4) + TEST_FIELD_OFFSET(WIN32_FIND_DATAA, ftLastAccessTime, 12) + TEST_FIELD_SIZE (WIN32_FIND_DATAA, ftLastWriteTime, 8) + TEST_FIELD_ALIGN (WIN32_FIND_DATAA, ftLastWriteTime, 4) + TEST_FIELD_OFFSET(WIN32_FIND_DATAA, ftLastWriteTime, 20) + TEST_FIELD_SIZE (WIN32_FIND_DATAA, nFileSizeHigh, 4) + TEST_FIELD_ALIGN (WIN32_FIND_DATAA, nFileSizeHigh, 4) + TEST_FIELD_OFFSET(WIN32_FIND_DATAA, nFileSizeHigh, 28) + TEST_FIELD_SIZE (WIN32_FIND_DATAA, nFileSizeLow, 4) + TEST_FIELD_ALIGN (WIN32_FIND_DATAA, nFileSizeLow, 4) + TEST_FIELD_OFFSET(WIN32_FIND_DATAA, nFileSizeLow, 32) + TEST_FIELD_SIZE (WIN32_FIND_DATAA, dwReserved0, 4) + TEST_FIELD_ALIGN (WIN32_FIND_DATAA, dwReserved0, 4) + TEST_FIELD_OFFSET(WIN32_FIND_DATAA, dwReserved0, 36) + TEST_FIELD_SIZE (WIN32_FIND_DATAA, dwReserved1, 4) + TEST_FIELD_ALIGN (WIN32_FIND_DATAA, dwReserved1, 4) + TEST_FIELD_OFFSET(WIN32_FIND_DATAA, dwReserved1, 40) + TEST_FIELD_SIZE (WIN32_FIND_DATAA, cFileName, 260) + TEST_FIELD_ALIGN (WIN32_FIND_DATAA, cFileName, 1) + TEST_FIELD_OFFSET(WIN32_FIND_DATAA, cFileName, 44) + TEST_FIELD_SIZE (WIN32_FIND_DATAA, cAlternateFileName, 14) + TEST_FIELD_ALIGN (WIN32_FIND_DATAA, cAlternateFileName, 1) + TEST_FIELD_OFFSET(WIN32_FIND_DATAA, cAlternateFileName, 304) +} + +static void test_pack_WIN32_FIND_DATAW(void) +{ + /* WIN32_FIND_DATAW (pack 4) */ + TEST_TYPE_SIZE (WIN32_FIND_DATAW, 592) + TEST_TYPE_ALIGN (WIN32_FIND_DATAW, 4) + TEST_FIELD_SIZE (WIN32_FIND_DATAW, dwFileAttributes, 4) + TEST_FIELD_ALIGN (WIN32_FIND_DATAW, dwFileAttributes, 4) + TEST_FIELD_OFFSET(WIN32_FIND_DATAW, dwFileAttributes, 0) + TEST_FIELD_SIZE (WIN32_FIND_DATAW, ftCreationTime, 8) + TEST_FIELD_ALIGN (WIN32_FIND_DATAW, ftCreationTime, 4) + TEST_FIELD_OFFSET(WIN32_FIND_DATAW, ftCreationTime, 4) + TEST_FIELD_SIZE (WIN32_FIND_DATAW, ftLastAccessTime, 8) + TEST_FIELD_ALIGN (WIN32_FIND_DATAW, ftLastAccessTime, 4) + TEST_FIELD_OFFSET(WIN32_FIND_DATAW, ftLastAccessTime, 12) + TEST_FIELD_SIZE (WIN32_FIND_DATAW, ftLastWriteTime, 8) + TEST_FIELD_ALIGN (WIN32_FIND_DATAW, ftLastWriteTime, 4) + TEST_FIELD_OFFSET(WIN32_FIND_DATAW, ftLastWriteTime, 20) + TEST_FIELD_SIZE (WIN32_FIND_DATAW, nFileSizeHigh, 4) + TEST_FIELD_ALIGN (WIN32_FIND_DATAW, nFileSizeHigh, 4) + TEST_FIELD_OFFSET(WIN32_FIND_DATAW, nFileSizeHigh, 28) + TEST_FIELD_SIZE (WIN32_FIND_DATAW, nFileSizeLow, 4) + TEST_FIELD_ALIGN (WIN32_FIND_DATAW, nFileSizeLow, 4) + TEST_FIELD_OFFSET(WIN32_FIND_DATAW, nFileSizeLow, 32) + TEST_FIELD_SIZE (WIN32_FIND_DATAW, dwReserved0, 4) + TEST_FIELD_ALIGN (WIN32_FIND_DATAW, dwReserved0, 4) + TEST_FIELD_OFFSET(WIN32_FIND_DATAW, dwReserved0, 36) + TEST_FIELD_SIZE (WIN32_FIND_DATAW, dwReserved1, 4) + TEST_FIELD_ALIGN (WIN32_FIND_DATAW, dwReserved1, 4) + TEST_FIELD_OFFSET(WIN32_FIND_DATAW, dwReserved1, 40) + TEST_FIELD_SIZE (WIN32_FIND_DATAW, cFileName, 520) + TEST_FIELD_ALIGN (WIN32_FIND_DATAW, cFileName, 2) + TEST_FIELD_OFFSET(WIN32_FIND_DATAW, cFileName, 44) + TEST_FIELD_SIZE (WIN32_FIND_DATAW, cAlternateFileName, 28) + TEST_FIELD_ALIGN (WIN32_FIND_DATAW, cAlternateFileName, 2) + TEST_FIELD_OFFSET(WIN32_FIND_DATAW, cAlternateFileName, 564) +} + +static void test_pack_WIN32_STREAM_ID(void) +{ + /* WIN32_STREAM_ID (pack 8) */ + TEST_TYPE_SIZE (WIN32_STREAM_ID, 24) + TEST_TYPE_ALIGN (WIN32_STREAM_ID, 8) + TEST_FIELD_SIZE (WIN32_STREAM_ID, dwStreamId, 4) + TEST_FIELD_ALIGN (WIN32_STREAM_ID, dwStreamId, 4) + TEST_FIELD_OFFSET(WIN32_STREAM_ID, dwStreamId, 0) + TEST_FIELD_SIZE (WIN32_STREAM_ID, dwStreamAttributes, 4) + TEST_FIELD_ALIGN (WIN32_STREAM_ID, dwStreamAttributes, 4) + TEST_FIELD_OFFSET(WIN32_STREAM_ID, dwStreamAttributes, 4) + TEST_FIELD_SIZE (WIN32_STREAM_ID, Size, 8) + TEST_FIELD_ALIGN (WIN32_STREAM_ID, Size, 8) + TEST_FIELD_OFFSET(WIN32_STREAM_ID, Size, 8) + TEST_FIELD_SIZE (WIN32_STREAM_ID, dwStreamNameSize, 4) + TEST_FIELD_ALIGN (WIN32_STREAM_ID, dwStreamNameSize, 4) + TEST_FIELD_OFFSET(WIN32_STREAM_ID, dwStreamNameSize, 16) + TEST_FIELD_SIZE (WIN32_STREAM_ID, cStreamName, 2) + TEST_FIELD_ALIGN (WIN32_STREAM_ID, cStreamName, 2) + TEST_FIELD_OFFSET(WIN32_STREAM_ID, cStreamName, 20) +} + +static void test_pack(void) +{ + test_pack_ACTCTXA(); + test_pack_ACTCTXW(); + test_pack_ACTCTX_SECTION_KEYED_DATA(); + test_pack_ACTCTX_SECTION_KEYED_DATA_2600(); + test_pack_ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA(); + test_pack_ACTIVATION_CONTEXT_BASIC_INFORMATION(); + test_pack_BY_HANDLE_FILE_INFORMATION(); + test_pack_COMMCONFIG(); + test_pack_COMMPROP(); + test_pack_COMMTIMEOUTS(); + test_pack_COMSTAT(); + test_pack_CREATE_PROCESS_DEBUG_INFO(); + test_pack_CREATE_THREAD_DEBUG_INFO(); + test_pack_CRITICAL_SECTION(); + test_pack_CRITICAL_SECTION_DEBUG(); + test_pack_DCB(); + test_pack_DEBUG_EVENT(); + test_pack_ENUMRESLANGPROCA(); + test_pack_ENUMRESLANGPROCW(); + test_pack_ENUMRESNAMEPROCA(); + test_pack_ENUMRESNAMEPROCW(); + test_pack_ENUMRESTYPEPROCA(); + test_pack_ENUMRESTYPEPROCW(); + test_pack_EXCEPTION_DEBUG_INFO(); + test_pack_EXIT_PROCESS_DEBUG_INFO(); + test_pack_EXIT_THREAD_DEBUG_INFO(); + test_pack_HW_PROFILE_INFOA(); + test_pack_HW_PROFILE_INFOW(); + test_pack_LOAD_DLL_DEBUG_INFO(); + test_pack_LPBY_HANDLE_FILE_INFORMATION(); + test_pack_LPCOMMCONFIG(); + test_pack_LPCOMMPROP(); + test_pack_LPCOMMTIMEOUTS(); + test_pack_LPCOMSTAT(); + test_pack_LPCRITICAL_SECTION(); + test_pack_LPCRITICAL_SECTION_DEBUG(); + test_pack_LPDCB(); + test_pack_LPDEBUG_EVENT(); + test_pack_LPEXCEPTION_POINTERS(); + test_pack_LPEXCEPTION_RECORD(); + test_pack_LPFIBER_START_ROUTINE(); + test_pack_LPHW_PROFILE_INFOA(); + test_pack_LPHW_PROFILE_INFOW(); + test_pack_LPLONG(); + test_pack_LPMEMORYSTATUS(); + test_pack_LPMEMORYSTATUSEX(); + test_pack_LPOFSTRUCT(); + test_pack_LPOSVERSIONINFOA(); + test_pack_LPOSVERSIONINFOEXA(); + test_pack_LPOSVERSIONINFOEXW(); + test_pack_LPOSVERSIONINFOW(); + test_pack_LPOVERLAPPED(); + test_pack_LPOVERLAPPED_COMPLETION_ROUTINE(); + test_pack_LPPROCESS_HEAP_ENTRY(); + test_pack_LPPROCESS_INFORMATION(); + test_pack_LPPROGRESS_ROUTINE(); + test_pack_LPSECURITY_ATTRIBUTES(); + test_pack_LPSTARTUPINFOA(); + test_pack_LPSTARTUPINFOW(); + test_pack_LPSYSTEMTIME(); + test_pack_LPSYSTEM_INFO(); + test_pack_LPSYSTEM_POWER_STATUS(); + test_pack_LPTHREAD_START_ROUTINE(); + test_pack_LPTIME_ZONE_INFORMATION(); + test_pack_LPVOID(); + test_pack_LPWIN32_FILE_ATTRIBUTE_DATA(); + test_pack_LPWIN32_FIND_DATAA(); + test_pack_LPWIN32_FIND_DATAW(); + test_pack_LPWIN32_STREAM_ID(); + test_pack_MEMORYSTATUS(); + test_pack_MEMORYSTATUSEX(); + test_pack_OFSTRUCT(); + test_pack_OSVERSIONINFOA(); + test_pack_OSVERSIONINFOEXA(); + test_pack_OSVERSIONINFOEXW(); + test_pack_OSVERSIONINFOW(); + test_pack_OUTPUT_DEBUG_STRING_INFO(); + test_pack_PACTCTXA(); + test_pack_PACTCTXW(); + test_pack_PACTCTX_SECTION_KEYED_DATA(); + test_pack_PACTCTX_SECTION_KEYED_DATA_2600(); + test_pack_PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA(); + test_pack_PACTIVATION_CONTEXT_BASIC_INFORMATION(); + test_pack_PAPCFUNC(); + test_pack_PBY_HANDLE_FILE_INFORMATION(); + test_pack_PCACTCTXA(); + test_pack_PCACTCTXW(); + test_pack_PCACTCTX_SECTION_KEYED_DATA(); + test_pack_PCACTCTX_SECTION_KEYED_DATA_2600(); + test_pack_PCACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA(); + test_pack_PCRITICAL_SECTION(); + test_pack_PCRITICAL_SECTION_DEBUG(); + test_pack_PFIBER_START_ROUTINE(); + test_pack_PHKEY(); + test_pack_POFSTRUCT(); + test_pack_POSVERSIONINFOA(); + test_pack_POSVERSIONINFOEXA(); + test_pack_POSVERSIONINFOEXW(); + test_pack_POSVERSIONINFOW(); + test_pack_PPROCESS_HEAP_ENTRY(); + test_pack_PPROCESS_INFORMATION(); + test_pack_PQUERYACTCTXW_FUNC(); + test_pack_PROCESS_HEAP_ENTRY(); + test_pack_PROCESS_INFORMATION(); + test_pack_PSECURITY_ATTRIBUTES(); + test_pack_PSYSTEMTIME(); + test_pack_PTIMERAPCROUTINE(); + test_pack_PTIME_ZONE_INFORMATION(); + test_pack_PWIN32_FIND_DATAA(); + test_pack_PWIN32_FIND_DATAW(); + test_pack_RIP_INFO(); + test_pack_SECURITY_ATTRIBUTES(); + test_pack_STARTUPINFOA(); + test_pack_STARTUPINFOW(); + test_pack_SYSTEMTIME(); + test_pack_SYSTEM_INFO(); + test_pack_SYSTEM_POWER_STATUS(); + test_pack_TIME_ZONE_INFORMATION(); + test_pack_UNLOAD_DLL_DEBUG_INFO(); + test_pack_WAITORTIMERCALLBACK(); + test_pack_WIN32_FILE_ATTRIBUTE_DATA(); + test_pack_WIN32_FIND_DATAA(); + test_pack_WIN32_FIND_DATAW(); + test_pack_WIN32_STREAM_ID(); +} + +START_TEST(generated) +{ +#ifdef _WIN64 + ok(0, "The type size / alignment tests don't support Win64 yet\n"); +#else + test_pack(); +#endif +} diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c index 0568b527e03..22d5cbf90b1 100644 --- a/dlls/kernel32/tests/process.c +++ b/dlls/kernel32/tests/process.c @@ -241,7 +241,7 @@ static void doChild(const char* file, const char* option) siA.dwX, siA.dwY, siA.dwXSize, siA.dwYSize, siA.dwXCountChars, siA.dwYCountChars, siA.dwFillAttribute, siA.dwFlags, siA.wShowWindow, - (DWORD)siA.hStdInput, (DWORD)siA.hStdOutput, (DWORD)siA.hStdError); + (DWORD_PTR)siA.hStdInput, (DWORD_PTR)siA.hStdOutput, (DWORD_PTR)siA.hStdError); /* since GetStartupInfoW is only implemented in win2k, * zero out before calling so we can notice the difference @@ -258,7 +258,7 @@ static void doChild(const char* file, const char* option) siW.dwX, siW.dwY, siW.dwXSize, siW.dwYSize, siW.dwXCountChars, siW.dwYCountChars, siW.dwFillAttribute, siW.dwFlags, siW.wShowWindow, - (DWORD)siW.hStdInput, (DWORD)siW.hStdOutput, (DWORD)siW.hStdError); + (DWORD_PTR)siW.hStdInput, (DWORD_PTR)siW.hStdOutput, (DWORD_PTR)siW.hStdError); /* Arguments */ childPrintf(hFile, "[Arguments]\nargcA=%d\n", myARGC); @@ -492,7 +492,7 @@ static void ok_child_stringWA( int line, const char *sect, const char *key, #define okChildInt(sect, key, expect) \ do { \ UINT result = GetPrivateProfileIntA((sect), (key), !(expect), resfile); \ - ok(result == expect, "%s:%s expected %d, but got %d\n", (sect), (key), (int)(expect), result); \ + ok(result == expect, "%s:%s expected %u, but got %u\n", (sect), (key), (UINT)(expect), result); \ } while (0) static void test_Startup(void) @@ -1292,9 +1292,9 @@ static void test_Console(void) okChildInt("StartupInfoA", "wShowWindow", startup.wShowWindow); /* check child correctly inherited the console */ - okChildInt("StartupInfoA", "hStdInput", (DWORD)startup.hStdInput); - okChildInt("StartupInfoA", "hStdOutput", (DWORD)startup.hStdOutput); - okChildInt("StartupInfoA", "hStdError", (DWORD)startup.hStdError); + okChildInt("StartupInfoA", "hStdInput", (DWORD_PTR)startup.hStdInput); + okChildInt("StartupInfoA", "hStdOutput", (DWORD_PTR)startup.hStdOutput); + okChildInt("StartupInfoA", "hStdError", (DWORD_PTR)startup.hStdError); okChildInt("Console", "SizeX", (DWORD)sbi.dwSize.X); okChildInt("Console", "SizeY", (DWORD)sbi.dwSize.Y); okChildInt("Console", "CursorX", (DWORD)sbi.dwCursorPosition.X); diff --git a/dlls/localspl/localspl_main.c b/dlls/localspl/localspl_main.c index 4483ac88905..7137d9721f8 100644 --- a/dlls/localspl/localspl_main.c +++ b/dlls/localspl/localspl_main.c @@ -28,8 +28,9 @@ #include "wingdi.h" #include "winreg.h" #include "winspool.h" -#include "ddk/winsplp.h" #include "winuser.h" +#include "ddk/winddiui.h" +#include "ddk/winsplp.h" #include "wine/list.h" #include "wine/debug.h" @@ -722,6 +723,44 @@ static BOOL WINAPI fpGetPrinterDriverDirectory(LPWSTR pName, LPWSTR pEnvironment return TRUE; } +/****************************************************************** + * driver_load [internal] + * + * load a driver user interface dll + * + * On failure, NULL is returned + * + */ + +static HMODULE driver_load(const printenv_t * env, LPWSTR dllname) +{ + WCHAR fullname[MAX_PATH]; + HMODULE hui; + DWORD len; + + TRACE("(%p, %s)\n", env, debugstr_w(dllname)); + + /* build the driverdir */ + len = sizeof(fullname) - + (lstrlenW(env->versionsubdir) + 1 + lstrlenW(dllname) + 1) * sizeof(WCHAR); + + if (!fpGetPrinterDriverDirectory(NULL, (LPWSTR) env->envname, 1, + (LPBYTE) fullname, len, &len)) { + /* Should never Fail */ + SetLastError(ERROR_BUFFER_OVERFLOW); + return NULL; + } + + lstrcatW(fullname, env->versionsubdir); + lstrcatW(fullname, backslashW); + lstrcatW(fullname, dllname); + + hui = LoadLibraryW(fullname); + TRACE("%p: LoadLibrary(%s) %d\n", hui, debugstr_w(fullname), GetLastError()); + + return hui; +} + /****************************************************************************** * myAddPrinterDriverEx [internal] * @@ -735,12 +774,15 @@ static BOOL myAddPrinterDriverEx(DWORD level, LPBYTE pDriverInfo, DWORD dwFileCo const printenv_t *env; apd_data_t apd; DRIVER_INFO_8W di; + BOOL (WINAPI *pDrvDriverEvent)(DWORD, DWORD, LPBYTE, LPARAM); + HMODULE hui; LPWSTR ptr; HKEY hroot; HKEY hdrv; DWORD disposition; DWORD len; LONG lres; + BOOL res; /* we need to set all entries in the Registry, independent from the Level of DRIVER_INFO, that the caller supplied */ @@ -873,7 +915,17 @@ static BOOL myAddPrinterDriverEx(DWORD level, LPBYTE pDriverInfo, DWORD dwFileCo if (level > 5) TRACE("level %u for Driver %s is incomplete\n", level, debugstr_w(di.pName)); RegCloseKey(hdrv); - TRACE("### DrvDriverEvent(...,DRIVEREVENT_INITIALIZE) not implemented yet\n"); + hui = driver_load(env, di.pConfigFile); + pDrvDriverEvent = (void *)GetProcAddress(hui, "DrvDriverEvent"); + if (hui && pDrvDriverEvent) { + + /* Support for DrvDriverEvent is optional */ + TRACE("DRIVER_EVENT_INITIALIZE for %s (%s)\n", debugstr_w(di.pName), debugstr_w(di.pConfigFile)); + /* MSDN: level for DRIVER_INFO is 1 to 3 */ + res = pDrvDriverEvent(DRIVER_EVENT_INITIALIZE, 3, (LPBYTE) &di, 0); + TRACE("got %d from DRIVER_EVENT_INITIALIZE\n", res); + } + FreeLibrary(hui); TRACE("=> TRUE with %u\n", GetLastError()); return TRUE; diff --git a/dlls/mapi32/imalloc.c b/dlls/mapi32/imalloc.c index c5b4570da1a..a913eee022d 100644 --- a/dlls/mapi32/imalloc.c +++ b/dlls/mapi32/imalloc.c @@ -78,7 +78,7 @@ static HRESULT WINAPI IMAPIMalloc_fnQueryInterface(LPMALLOC iface, REFIID refiid if (IsEqualIID(refiid, &IID_IUnknown) || IsEqualIID(refiid, &IID_IMalloc)) { - *ppvObj = (LPMALLOC) &MAPI_IMalloc; + *ppvObj = &MAPI_IMalloc; TRACE("Returning IMalloc (%p)\n", *ppvObj); return S_OK; } diff --git a/dlls/mapi32/tests/imalloc.c b/dlls/mapi32/tests/imalloc.c index 63c66f27747..5e3a06014f3 100644 --- a/dlls/mapi32/tests/imalloc.c +++ b/dlls/mapi32/tests/imalloc.c @@ -64,8 +64,7 @@ static void test_IMalloc(void) /* Prove that native mapi uses LocalAlloc/LocalFree */ lpMem = IMalloc_Alloc(lpMalloc, 61); - ok (lpMem && IMalloc_GetSize(lpMalloc, lpMem) == - LocalSize((HANDLE)lpMem), + ok (lpMem && IMalloc_GetSize(lpMalloc, lpMem) == LocalSize(lpMem), "Expected non-null, same size, got %p, %s size\n", lpMem, lpMem ? "different" : "same"); diff --git a/dlls/mapi32/tests/prop.c b/dlls/mapi32/tests/prop.c index a2b92891934..0e979d15e08 100644 --- a/dlls/mapi32/tests/prop.c +++ b/dlls/mapi32/tests/prop.c @@ -93,11 +93,11 @@ static void test_PropCopyMore(void) if (!pPropCopyMore) return; - scode = pMAPIAllocateBuffer(sizeof(LPSPropValue), (LPVOID *)lpDest); + scode = pMAPIAllocateBuffer(sizeof(LPSPropValue), lpDest); if (FAILED(scode)) return; - scode = pMAPIAllocateMore(sizeof(LPSPropValue), lpDest, (LPVOID *)lpSrc); + scode = pMAPIAllocateMore(sizeof(LPSPropValue), lpDest, lpSrc); if (FAILED(scode)) return; diff --git a/dlls/msacm32/internal.c b/dlls/msacm32/internal.c index 84898ea4f92..cf76a574ab6 100644 --- a/dlls/msacm32/internal.c +++ b/dlls/msacm32/internal.c @@ -44,7 +44,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msacm); HANDLE MSACM_hHeap = NULL; PWINE_ACMDRIVERID MSACM_pFirstACMDriverID = NULL; -PWINE_ACMDRIVERID MSACM_pLastACMDriverID = NULL; +static PWINE_ACMDRIVERID MSACM_pLastACMDriverID; static DWORD MSACM_suspendBroadcastCount = 0; static BOOL MSACM_pendingBroadcast = FALSE; @@ -711,6 +711,35 @@ void MSACM_WriteCurrentPriorities(void) RegCloseKey(hPriorityKey); } +static PWINE_ACMLOCALDRIVER MSACM_pFirstACMLocalDriver; +static PWINE_ACMLOCALDRIVER MSACM_pLastACMLocalDriver; + +static PWINE_ACMLOCALDRIVER MSACM_UnregisterLocalDriver(PWINE_ACMLOCALDRIVER paldrv) +{ + PWINE_ACMLOCALDRIVER pNextACMLocalDriver; + + if (paldrv->pACMInstList) { + ERR("local driver instances still present after closing all drivers - memory leak\n"); + return NULL; + } + + if (paldrv == MSACM_pFirstACMLocalDriver) + MSACM_pFirstACMLocalDriver = paldrv->pNextACMLocalDrv; + if (paldrv == MSACM_pLastACMLocalDriver) + MSACM_pLastACMLocalDriver = paldrv->pPrevACMLocalDrv; + + if (paldrv->pPrevACMLocalDrv) + paldrv->pPrevACMLocalDrv->pNextACMLocalDrv = paldrv->pNextACMLocalDrv; + if (paldrv->pNextACMLocalDrv) + paldrv->pNextACMLocalDrv->pPrevACMLocalDrv = paldrv->pPrevACMLocalDrv; + + pNextACMLocalDriver = paldrv->pNextACMLocalDrv; + + HeapFree(MSACM_hHeap, 0, paldrv); + + return pNextACMLocalDriver; +} + /*********************************************************************** * MSACM_UnregisterDriver() */ @@ -824,9 +853,6 @@ MMRESULT MSACM_Message(HACMDRIVER had, UINT uMsg, LPARAM lParam1, LPARAM lParam2 return MMSYSERR_INVALHANDLE; } -static PWINE_ACMLOCALDRIVER MSACM_pFirstACMLocalDriver; -static PWINE_ACMLOCALDRIVER MSACM_pLastACMLocalDriver; - PWINE_ACMLOCALDRIVER MSACM_RegisterLocalDriver(HMODULE hModule, DRIVERPROC lpDriverProc) { PWINE_ACMLOCALDRIVER paldrv; @@ -1040,29 +1066,3 @@ LRESULT MSACM_CloseLocalDriver(PWINE_ACMLOCALDRIVERINST paldrv) ERR("unable to close driver instance\n"); return FALSE; } - -PWINE_ACMLOCALDRIVER MSACM_UnregisterLocalDriver(PWINE_ACMLOCALDRIVER paldrv) -{ - PWINE_ACMLOCALDRIVER pNextACMLocalDriver; - - if (paldrv->pACMInstList) { - ERR("local driver instances still present after closing all drivers - memory leak\n"); - return NULL; - } - - if (paldrv == MSACM_pFirstACMLocalDriver) - MSACM_pFirstACMLocalDriver = paldrv->pNextACMLocalDrv; - if (paldrv == MSACM_pLastACMLocalDriver) - MSACM_pLastACMLocalDriver = paldrv->pPrevACMLocalDrv; - - if (paldrv->pPrevACMLocalDrv) - paldrv->pPrevACMLocalDrv->pNextACMLocalDrv = paldrv->pNextACMLocalDrv; - if (paldrv->pNextACMLocalDrv) - paldrv->pNextACMLocalDrv->pPrevACMLocalDrv = paldrv->pPrevACMLocalDrv; - - pNextACMLocalDriver = paldrv->pNextACMLocalDrv; - - HeapFree(MSACM_hHeap, 0, paldrv); - - return pNextACMLocalDriver; -} diff --git a/dlls/msacm32/wineacm.h b/dlls/msacm32/wineacm.h index fc034012a6d..3c001309d2a 100644 --- a/dlls/msacm32/wineacm.h +++ b/dlls/msacm32/wineacm.h @@ -370,7 +370,6 @@ typedef struct _WINE_ACMNOTIFYWND /* From internal.c */ extern HANDLE MSACM_hHeap; extern PWINE_ACMDRIVERID MSACM_pFirstACMDriverID; -extern PWINE_ACMDRIVERID MSACM_pLastACMDriverID; extern PWINE_ACMDRIVERID MSACM_RegisterDriver(LPCWSTR pszDriverAlias, LPCWSTR pszFileName, PWINE_ACMLOCALDRIVER pLocalDriver); extern void MSACM_RegisterAllDrivers(void); @@ -397,7 +396,6 @@ extern PWINE_ACMDRIVERID MSACM_RegisterDriverFromRegistry(LPCWSTR pszRegEntry); extern PWINE_ACMLOCALDRIVER MSACM_RegisterLocalDriver(HMODULE hModule, DRIVERPROC lpDriverProc); extern PWINE_ACMLOCALDRIVERINST MSACM_OpenLocalDriver(PWINE_ACMLOCALDRIVER, LPARAM); extern LRESULT MSACM_CloseLocalDriver(PWINE_ACMLOCALDRIVERINST); -extern PWINE_ACMLOCALDRIVER MSACM_UnregisterLocalDriver(PWINE_ACMLOCALDRIVER); /* extern PWINE_ACMLOCALDRIVER MSACM_GetLocalDriver(HACMDRIVER hDriver); */ diff --git a/dlls/mshtml/htmlelemcol.c b/dlls/mshtml/htmlelemcol.c index f0ca6d76acd..2dbbacadb36 100644 --- a/dlls/mshtml/htmlelemcol.c +++ b/dlls/mshtml/htmlelemcol.c @@ -50,6 +50,9 @@ typedef struct { DWORD size; } elem_vector_t; +static IHTMLElementCollection *HTMLElementCollection_Create(IUnknown *ref_unk, + HTMLElement **elems, DWORD len); + static void elem_vector_add(elem_vector_t *buf, HTMLElement *elem) { if(buf->len == buf->size) { @@ -534,7 +537,7 @@ IHTMLElementCollection *create_collection_from_htmlcol(HTMLDocument *doc, IUnkno return HTMLElementCollection_Create(unk, buf.buf, buf.len); } -IHTMLElementCollection *HTMLElementCollection_Create(IUnknown *ref_unk, +static IHTMLElementCollection *HTMLElementCollection_Create(IUnknown *ref_unk, HTMLElement **elems, DWORD len) { HTMLElementCollection *ret = heap_alloc_zero(sizeof(HTMLElementCollection)); diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index fa4ad519461..3453f7b2859 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -2048,18 +2048,75 @@ static HRESULT WINAPI HTMLStyle_setAttribute(IHTMLStyle *iface, BSTR strAttribut VARIANT AttributeValue, LONG lFlags) { HTMLStyle *This = HTMLSTYLE_THIS(iface); - FIXME("(%p)->(%s v%d %08x)\n", This, debugstr_w(strAttributeName), - V_VT(&AttributeValue), lFlags); - return E_NOTIMPL; + HRESULT hres; + DISPID dispid; + + TRACE("(%p)->(%s v%d %08x)\n", This, debugstr_w(strAttributeName), + V_VT(&AttributeValue), lFlags); + + if(!strAttributeName) + return E_INVALIDARG; + + if(lFlags == 1) + FIXME("Parameter lFlags ignored\n"); + + hres = HTMLStyle_GetIDsOfNames(iface, &IID_NULL, (LPOLESTR*)&strAttributeName, 1, + LOCALE_USER_DEFAULT, &dispid); + if(hres == S_OK) + { + VARIANT ret; + DISPID dispidNamed = DISPID_PROPERTYPUT; + DISPPARAMS params; + + params.cArgs = 1; + params.rgvarg = &AttributeValue; + params.cNamedArgs = 1; + params.rgdispidNamedArgs = &dispidNamed; + + hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT, + DISPATCH_PROPERTYPUT, ¶ms, &ret, NULL, NULL); + } + else + { + FIXME("Custom attributes not supported.\n"); + } + + TRACE("ret: %08x\n", hres); + + return hres; } static HRESULT WINAPI HTMLStyle_getAttribute(IHTMLStyle *iface, BSTR strAttributeName, LONG lFlags, VARIANT *AttributeValue) { HTMLStyle *This = HTMLSTYLE_THIS(iface); - FIXME("(%p)->(%s %08x %p)\n", This, debugstr_w(strAttributeName), - lFlags, AttributeValue); - return E_NOTIMPL; + HRESULT hres; + DISPID dispid; + + TRACE("(%p)->(%s v%p %08x)\n", This, debugstr_w(strAttributeName), + AttributeValue, lFlags); + + if(!AttributeValue || !strAttributeName) + return E_INVALIDARG; + + if(lFlags == 1) + FIXME("Parameter lFlags ignored\n"); + + hres = HTMLStyle_GetIDsOfNames(iface, &IID_NULL, (LPOLESTR*)&strAttributeName, 1, + LOCALE_USER_DEFAULT, &dispid); + if(hres == S_OK) + { + DISPPARAMS params = {NULL, NULL, 0, 0 }; + + hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT, + DISPATCH_PROPERTYGET, ¶ms, AttributeValue, NULL, NULL); + } + else + { + FIXME("Custom attributes not supported.\n"); + } + + return hres; } static HRESULT WINAPI HTMLStyle_removeAttribute(IHTMLStyle *iface, BSTR strAttributeName, diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index a7e364e27a2..148c997c007 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -614,7 +614,6 @@ void doc_insert_script(HTMLDocument*,nsIDOMHTMLScriptElement*); IDispatch *script_parse_event(HTMLDocument*,LPCWSTR); void set_script_mode(HTMLDocument*,SCRIPTMODE); -IHTMLElementCollection *HTMLElementCollection_Create(IUnknown*,HTMLElement**,DWORD); IHTMLElementCollection *create_all_collection(HTMLDOMNode*,BOOL); IHTMLElementCollection *create_collection_from_nodelist(HTMLDocument*,IUnknown*,nsIDOMNodeList*); IHTMLElementCollection *create_collection_from_htmlcol(HTMLDocument*,IUnknown*,nsIDOMHTMLCollection*); diff --git a/dlls/mshtml/protocol.c b/dlls/mshtml/protocol.c index 84836006c42..e5e22daaeaf 100644 --- a/dlls/mshtml/protocol.c +++ b/dlls/mshtml/protocol.c @@ -647,7 +647,7 @@ static HRESULT WINAPI ResProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl, LPWSTR endpoint = NULL; DWORD file_id = strtolW(url_file, &endpoint, 10); if(endpoint == url_file+strlenW(url_file)) - src = FindResourceW(hdll, (LPCWSTR)file_id, (LPCWSTR)RT_HTML); + src = FindResourceW(hdll, MAKEINTRESOURCEW(file_id), MAKEINTRESOURCEW(RT_HTML)); if(!src) { WARN("Could not find resource\n"); diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index be54998a6da..46136c10ba9 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -2750,6 +2750,42 @@ static void test_default_style(IHTMLStyle *style) ok(hres == S_OK, "put_overflow failed: %08x\n", hres); SysFreeString(sOverflowDefault); + /* Attribute Tests*/ + hres = IHTMLStyle_getAttribute(style, NULL, 1, &v); + ok(hres == E_INVALIDARG, "getAttribute failed: %08x\n", hres); + + str = a2bstr("position"); + hres = IHTMLStyle_getAttribute(style, str, 1, NULL); + ok(hres == E_INVALIDARG, "getAttribute failed: %08x\n", hres); + + hres = IHTMLStyle_getAttribute(style, str, 1, &v); + ok(hres == S_OK, "getAttribute failed: %08x\n", hres); + ok(V_VT(&v) == VT_BSTR, "type failed: %d\n", V_VT(&v)); + VariantClear(&v); + + hres = IHTMLStyle_setAttribute(style, NULL, v, 1); + ok(hres == E_INVALIDARG, "getAttribute failed: %08x\n", hres); + + V_VT(&v) = VT_BSTR; + V_BSTR(&v) = a2bstr("absolute"); + hres = IHTMLStyle_setAttribute(style, str, v, 1); + ok(hres == S_OK, "setAttribute failed: %08x\n", hres); + VariantClear(&v); + + hres = IHTMLStyle_getAttribute(style, str, 1, &v); + ok(hres == S_OK, "getAttribute failed: %08x\n", hres); + ok(V_VT(&v) == VT_BSTR, "type failed: %d\n", V_VT(&v)); + ok(!strcmp_wa(V_BSTR(&v), "absolute"), "str=%s\n", dbgstr_w(V_BSTR(&v))); + VariantClear(&v); + + V_VT(&v) = VT_BSTR; + V_BSTR(&v) = NULL; + hres = IHTMLStyle_setAttribute(style, str, v, 1); + ok(hres == S_OK, "setAttribute failed: %08x\n", hres); + VariantClear(&v); + + SysFreeString(str); + hres = IHTMLStyle_QueryInterface(style, &IID_IHTMLStyle2, (void**)&style2); ok(hres == S_OK, "Could not get IHTMLStyle2 iface: %08x\n", hres); if(SUCCEEDED(hres)) { diff --git a/dlls/msi/automation.c b/dlls/msi/automation.c index 3b01266c975..6668b177082 100644 --- a/dlls/msi/automation.c +++ b/dlls/msi/automation.c @@ -1731,9 +1731,9 @@ static HRESULT WINAPI InstallerImpl_Invoke( if (V_I4(&varg0) >= REG_INDEX_CLASSES_ROOT && V_I4(&varg0) <= REG_INDEX_DYN_DATA) - V_I4(&varg0) |= (UINT)HKEY_CLASSES_ROOT; + V_I4(&varg0) |= (UINT_PTR)HKEY_CLASSES_ROOT; - ret = RegOpenKeyW((HKEY)V_I4(&varg0), V_BSTR(&varg1), &hkey); + ret = RegOpenKeyW((HKEY)(UINT_PTR)V_I4(&varg0), V_BSTR(&varg1), &hkey); /* Third parameter can be VT_EMPTY, VT_I4, or VT_BSTR */ switch (V_VT(&varg2)) diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c index 4037ac6e697..d04823ebb6c 100644 --- a/dlls/msi/tests/db.c +++ b/dlls/msi/tests/db.c @@ -5742,14 +5742,13 @@ static void test_noquotes(void) static void read_file_data(LPCSTR filename, LPSTR buffer) { - OFSTRUCT ofs; - HFILE file; + HANDLE file; DWORD read; - file = OpenFile(filename, &ofs, OF_READ); + file = CreateFileA( filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL ); ZeroMemory(buffer, MAX_PATH); - ReadFile((HANDLE)file, buffer, MAX_PATH, &read, NULL); - CloseHandle((HANDLE)file); + ReadFile(file, buffer, MAX_PATH, &read, NULL); + CloseHandle(file); } static void test_forcecodepage(void) diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c index 871d673ab3a..aa0b6f39b14 100644 --- a/dlls/msi/tests/package.c +++ b/dlls/msi/tests/package.c @@ -9585,6 +9585,13 @@ static void test_MsiGetProductProperty(void) lstrcatA(keypath, prod_squashed); res = RegCreateKeyA(HKEY_LOCAL_MACHINE, keypath, &userkey); + if (res == ERROR_ACCESS_DENIED) + { + skip("Not enough rights to perform tests\n"); + RegDeleteKeyA(prodkey, ""); + RegCloseKey(prodkey); + return; + } ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); res = RegCreateKeyA(userkey, "InstallProperties", &props); diff --git a/dlls/msvcrt/except.c b/dlls/msvcrt/except.c index 7c4ee473748..9b254f858a7 100644 --- a/dlls/msvcrt/except.c +++ b/dlls/msvcrt/except.c @@ -96,6 +96,9 @@ static inline int call_unwind_func( int (*func)(void), void *ebp ) #endif + +#ifdef __i386__ + static DWORD MSVCRT_nested_handler(PEXCEPTION_RECORD rec, EXCEPTION_REGISTRATION_RECORD* frame, PCONTEXT context, @@ -111,7 +114,7 @@ static DWORD MSVCRT_nested_handler(PEXCEPTION_RECORD rec, /********************************************************************* * _EH_prolog (MSVCRT.@) */ -#ifdef __i386__ + /* Provided for VC++ binary compatibility only */ __ASM_GLOBAL_FUNC(_EH_prolog, "pushl $-1\n\t" @@ -251,7 +254,7 @@ int CDECL _except_handler3(PEXCEPTION_RECORD rec, } } #else - FIXME("exception %lx flags=%lx at %p handler=%p %p %p stub\n", + FIXME("exception %x flags=%x at %p handler=%p %p %p stub\n", rec->ExceptionCode, rec->ExceptionFlags, rec->ExceptionAddress, frame->handler, context, dispatcher); #endif diff --git a/dlls/msvcrt/tests/heap.c b/dlls/msvcrt/tests/heap.c index e094992d6ea..6e6b54446a6 100644 --- a/dlls/msvcrt/tests/heap.c +++ b/dlls/msvcrt/tests/heap.c @@ -48,8 +48,7 @@ static void test_aligned_malloc(unsigned int size, unsigned int alignment) { void *saved; saved = *(void **)((DWORD_PTR)((char *)mem - sizeof(void *)) & ~(sizeof(void *) - 1)); - trace("_aligned_malloc(%3d, %3d) returns %p, saved = %p, diff = %d\n", - size, alignment, mem, saved, (char *)saved - (char *)mem); + trace("_aligned_malloc(%3d, %3d) returns %p, saved = %p\n", size, alignment, mem, saved ); } p_aligned_free(mem); } @@ -79,8 +78,8 @@ static void test_aligned_offset_malloc(unsigned int size, unsigned int alignment { void *saved; saved = *(void **)((DWORD_PTR)((char *)mem - sizeof(void *)) & ~(sizeof(void *) - 1)); - trace("_aligned_offset_malloc(%3d, %3d, %3d) returns %p, saved = %p, diff = %d\n", - size, alignment, offset, mem, saved, (char *)saved - (char *)mem); + trace("_aligned_offset_malloc(%3d, %3d, %3d) returns %p, saved = %p\n", + size, alignment, offset, mem, saved); } p_aligned_free(mem); } @@ -116,8 +115,7 @@ static void test_aligned_realloc(unsigned int size1, unsigned int size2, unsigne { void *saved; saved = *(void **)((DWORD_PTR)((char *)mem - sizeof(void *)) & ~(sizeof(void *) - 1)); - trace("_aligned_malloc(%3d, %3d) returns %p, saved = %p, diff = %d\n", - size1, alignment, mem, saved, (char *)saved - (char *)mem); + trace("_aligned_malloc(%3d, %3d) returns %p, saved = %p\n", size1, alignment, mem, saved); } mem2 = p_aligned_realloc(mem, size2, alignment); @@ -132,8 +130,8 @@ static void test_aligned_realloc(unsigned int size1, unsigned int size2, unsigne { void *saved; saved = *(void **)((DWORD_PTR)((char *)mem2 - sizeof(void *)) & ~(sizeof(void *) - 1)); - trace("_aligned_realloc(%p, %3d, %3d) returns %p, saved = %p, diff = %d\n", - mem, size2, alignment, mem2, saved, (char *)saved - (char *)mem2); + trace("_aligned_realloc(%p, %3d, %3d) returns %p, saved = %p\n", + mem, size2, alignment, mem2, saved); } if (mem1) { @@ -189,8 +187,8 @@ static void test_aligned_offset_realloc(unsigned int size1, unsigned int size2, { void *saved; saved = *(void **)((DWORD_PTR)((char *)mem - sizeof(void *)) & ~(sizeof(void *) - 1)); - trace("_aligned_offset_malloc(%3d, %3d, %3d) returns %p, saved = %p, diff = %d\n", - size1, alignment, offset, mem, saved, (char *)saved - (char *)mem); + trace("_aligned_offset_malloc(%3d, %3d, %3d) returns %p, saved = %p\n", + size1, alignment, offset, mem, saved); } mem2 = p_aligned_offset_realloc(mem, size2, alignment, offset); @@ -205,8 +203,8 @@ static void test_aligned_offset_realloc(unsigned int size1, unsigned int size2, { void *saved; saved = *(void **)((DWORD_PTR)((char *)mem2 - sizeof(void *)) & ~(sizeof(void *) - 1)); - trace("_aligned_offset_realloc(%p, %3d, %3d, %3d) returns %p, saved = %p, diff = %d\n", - mem, size2, alignment, offset, mem2, saved, (char *)saved - (char *)mem2); + trace("_aligned_offset_realloc(%p, %3d, %3d, %3d) returns %p, saved = %p\n", + mem, size2, alignment, offset, mem2, saved); } if (mem1) { diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c index 9506a803393..37004cf4bdd 100644 --- a/dlls/msvcrt/wcs.c +++ b/dlls/msvcrt/wcs.c @@ -683,9 +683,9 @@ static int pf_vsnprintf( pf_output *out, const WCHAR *format, __ms_va_list valis flags.PadZero = 0; if( flags.Alternate ) - sprintf(pointer, "0X%0*lX", 2 * sizeof(ptr), (ULONG_PTR)ptr); + sprintf(pointer, "0X%0*lX", 2 * (int)sizeof(ptr), (ULONG_PTR)ptr); else - sprintf(pointer, "%0*lX", 2 * sizeof(ptr), (ULONG_PTR)ptr); + sprintf(pointer, "%0*lX", 2 * (int)sizeof(ptr), (ULONG_PTR)ptr); r = pf_output_format_A( out, pointer, -1, &flags ); } diff --git a/dlls/ntdll/tests/env.c b/dlls/ntdll/tests/env.c index 92f654e7674..82898412643 100644 --- a/dlls/ntdll/tests/env.c +++ b/dlls/ntdll/tests/env.c @@ -86,11 +86,12 @@ static void testQuery(void) WCHAR bv[257]; UNICODE_STRING name; UNICODE_STRING value; - const struct test* test; NTSTATUS nts; + unsigned int i; - for (test = tests; test->var; test++) + for (i = 0; tests[i].var; i++) { + const struct test *test = &tests[i]; name.Length = strlen(test->var) * 2; name.MaximumLength = name.Length + 2; name.Buffer = bn; @@ -103,7 +104,7 @@ static void testQuery(void) nts = pRtlQueryEnvironmentVariable_U(small_env, &name, &value); ok( nts == test->status || (test->alt && nts == test->alt), "[%d]: Wrong status for '%s', expecting %x got %x\n", - test - tests, test->var, test->status, nts ); + i, test->var, test->status, nts ); if (nts == test->status) switch (nts) { case STATUS_SUCCESS: diff --git a/dlls/ntdll/tests/generated.c b/dlls/ntdll/tests/generated.c index 4818c9e50eb..89b2e05b18a 100644 --- a/dlls/ntdll/tests/generated.c +++ b/dlls/ntdll/tests/generated.c @@ -1,4 +1,4 @@ -/* File generated automatically from tools/winapi/test.dat; do not edit! */ +/* File generated automatically from tools/winapi/tests.dat; do not edit! */ /* This file can be copied, modified and distributed without restriction. */ /* @@ -28,21 +28,13 @@ */ #if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) -# define FIELD_ALIGNMENT(type, field) __alignof(((type*)0)->field) -#elif defined(__GNUC__) -# define FIELD_ALIGNMENT(type, field) __alignof__(((type*)0)->field) -#else -/* FIXME: Not sure if is possible to do without compiler extension */ -#endif - -#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) # define _TYPE_ALIGNMENT(type) __alignof(type) #elif defined(__GNUC__) # define _TYPE_ALIGNMENT(type) __alignof__(type) #else /* - * FIXME: Not sure if is possible to do without compiler extension - * (if type is not just a name that is, if so the normal) + * FIXME: May not be possible without a compiler extension + * (if type is not just a name that is, otherwise the normal * TYPE_ALIGNMENT can be used) */ #endif @@ -59,392 +51,517 @@ * Test helper macros */ -#ifdef FIELD_ALIGNMENT -# define TEST_FIELD_ALIGNMENT(type, field, align) \ - ok(FIELD_ALIGNMENT(type, field) == align, \ - "FIELD_ALIGNMENT(" #type ", " #field ") == %d (expected " #align ")\n", \ - (int)FIELD_ALIGNMENT(type, field)) -#else -# define TEST_FIELD_ALIGNMENT(type, field, align) do { } while (0) -#endif - -#define TEST_FIELD_OFFSET(type, field, offset) \ - ok(FIELD_OFFSET(type, field) == offset, \ - "FIELD_OFFSET(" #type ", " #field ") == %ld (expected " #offset ")\n", \ - (long int)FIELD_OFFSET(type, field)) +#ifdef _WIN64 -#ifdef _TYPE_ALIGNMENT -#define TEST__TYPE_ALIGNMENT(type, align) \ - ok(_TYPE_ALIGNMENT(type) == align, "TYPE_ALIGNMENT(" #type ") == %d (expected " #align ")\n", (int)_TYPE_ALIGNMENT(type)) -#else -# define TEST__TYPE_ALIGNMENT(type, align) do { } while (0) -#endif +# define TEST_TYPE_SIZE(type, size) +# define TEST_TYPE_ALIGN(type, align) +# define TEST_TARGET_ALIGN(type, align) +# define TEST_FIELD_ALIGN(type, field, align) +# define TEST_FIELD_OFFSET(type, field, offset) -#ifdef TYPE_ALIGNMENT -#define TEST_TYPE_ALIGNMENT(type, align) \ - ok(TYPE_ALIGNMENT(type) == align, "TYPE_ALIGNMENT(" #type ") == %d (expected " #align ")\n", (int)TYPE_ALIGNMENT(type)) #else -# define TEST_TYPE_ALIGNMENT(type, align) do { } while (0) -#endif -#define TEST_TYPE_SIZE(type, size) \ - ok(sizeof(type) == size, "sizeof(" #type ") == %d (expected " #size ")\n", ((int) sizeof(type))) +# define TEST_TYPE_SIZE(type, size) C_ASSERT(sizeof(type) == size); -/*********************************************************************** - * Test macros - */ +# ifdef TYPE_ALIGNMENT +# define TEST_TYPE_ALIGN(type, align) C_ASSERT(TYPE_ALIGNMENT(type) == align); +# else +# define TEST_TYPE_ALIGN(type, align) +# endif -#define TEST_FIELD(type, field_type, field_name, field_offset, field_size, field_align) \ - TEST_TYPE_SIZE(field_type, field_size); \ - TEST_FIELD_ALIGNMENT(type, field_name, field_align); \ - TEST_FIELD_OFFSET(type, field_name, field_offset); \ +# ifdef _TYPE_ALIGNMENT +# define TEST_TARGET_ALIGN(type, align) C_ASSERT(_TYPE_ALIGNMENT(*(type)0) == align); +# define TEST_FIELD_ALIGN(type, field, align) C_ASSERT(_TYPE_ALIGNMENT(((type*)0)->field) == align); +# else +# define TEST_TARGET_ALIGN(type, align) +# define TEST_FIELD_ALIGN(type, field, align) +# endif -#define TEST_TYPE(type, size, align) \ - TEST_TYPE_ALIGNMENT(type, align); \ - TEST_TYPE_SIZE(type, size) +# define TEST_FIELD_OFFSET(type, field, offset) C_ASSERT(FIELD_OFFSET(type, field) == offset); -#define TEST_TYPE_POINTER(type, size, align) \ - TEST__TYPE_ALIGNMENT(*(type)0, align); \ - TEST_TYPE_SIZE(*(type)0, size) +#endif -#define TEST_TYPE_SIGNED(type) \ - ok((type) -1 < 0, "(" #type ") -1 < 0\n"); +#define TEST_TARGET_SIZE(type, size) TEST_TYPE_SIZE(*(type)0, size) +#define TEST_FIELD_SIZE(type, field, size) TEST_TYPE_SIZE((((type*)0)->field), size) +#define TEST_TYPE_SIGNED(type) C_ASSERT((type) -1 < 0); +#define TEST_TYPE_UNSIGNED(type) C_ASSERT((type) -1 > 0); -#define TEST_TYPE_UNSIGNED(type) \ - ok((type) -1 > 0, "(" #type ") -1 > 0\n"); static void test_pack_DWORD32(void) { /* DWORD32 */ - TEST_TYPE(DWORD32, 4, 4); - TEST_TYPE_UNSIGNED(DWORD32); + TEST_TYPE_SIZE (DWORD32, 4) + TEST_TYPE_ALIGN (DWORD32, 4) + TEST_TYPE_UNSIGNED(DWORD32) } static void test_pack_DWORD64(void) { /* DWORD64 */ - TEST_TYPE(DWORD64, 8, 8); - TEST_TYPE_UNSIGNED(DWORD64); + TEST_TYPE_SIZE (DWORD64, 8) + TEST_TYPE_ALIGN (DWORD64, 8) + TEST_TYPE_UNSIGNED(DWORD64) } static void test_pack_DWORD_PTR(void) { /* DWORD_PTR */ - TEST_TYPE(DWORD_PTR, 4, 4); + TEST_TYPE_SIZE (DWORD_PTR, 4) + TEST_TYPE_ALIGN (DWORD_PTR, 4) } static void test_pack_HALF_PTR(void) { /* HALF_PTR */ - TEST_TYPE(HALF_PTR, 2, 2); - TEST_TYPE_SIGNED(HALF_PTR); + TEST_TYPE_SIZE (HALF_PTR, 2) + TEST_TYPE_ALIGN (HALF_PTR, 2) + TEST_TYPE_SIGNED(HALF_PTR) } static void test_pack_INT16(void) { /* INT16 */ - TEST_TYPE(INT16, 2, 2); - TEST_TYPE_SIGNED(INT16); + TEST_TYPE_SIZE (INT16, 2) + TEST_TYPE_ALIGN (INT16, 2) + TEST_TYPE_SIGNED(INT16) } static void test_pack_INT32(void) { /* INT32 */ - TEST_TYPE(INT32, 4, 4); - TEST_TYPE_SIGNED(INT32); + TEST_TYPE_SIZE (INT32, 4) + TEST_TYPE_ALIGN (INT32, 4) + TEST_TYPE_SIGNED(INT32) } static void test_pack_INT64(void) { /* INT64 */ - TEST_TYPE(INT64, 8, 8); - TEST_TYPE_SIGNED(INT64); + TEST_TYPE_SIZE (INT64, 8) + TEST_TYPE_ALIGN (INT64, 8) + TEST_TYPE_SIGNED(INT64) } static void test_pack_INT8(void) { /* INT8 */ - TEST_TYPE(INT8, 1, 1); - TEST_TYPE_SIGNED(INT8); + TEST_TYPE_SIZE (INT8, 1) + TEST_TYPE_ALIGN (INT8, 1) + TEST_TYPE_SIGNED(INT8) } static void test_pack_INT_PTR(void) { /* INT_PTR */ - TEST_TYPE(INT_PTR, 4, 4); - TEST_TYPE_SIGNED(INT_PTR); + TEST_TYPE_SIZE (INT_PTR, 4) + TEST_TYPE_ALIGN (INT_PTR, 4) + TEST_TYPE_SIGNED(INT_PTR) } static void test_pack_LONG32(void) { /* LONG32 */ - TEST_TYPE(LONG32, 4, 4); - TEST_TYPE_SIGNED(LONG32); + TEST_TYPE_SIZE (LONG32, 4) + TEST_TYPE_ALIGN (LONG32, 4) + TEST_TYPE_SIGNED(LONG32) } static void test_pack_LONG64(void) { /* LONG64 */ - TEST_TYPE(LONG64, 8, 8); - TEST_TYPE_SIGNED(LONG64); + TEST_TYPE_SIZE (LONG64, 8) + TEST_TYPE_ALIGN (LONG64, 8) + TEST_TYPE_SIGNED(LONG64) } static void test_pack_LONG_PTR(void) { /* LONG_PTR */ - TEST_TYPE(LONG_PTR, 4, 4); - TEST_TYPE_SIGNED(LONG_PTR); + TEST_TYPE_SIZE (LONG_PTR, 4) + TEST_TYPE_ALIGN (LONG_PTR, 4) + TEST_TYPE_SIGNED(LONG_PTR) } static void test_pack_SIZE_T(void) { /* SIZE_T */ - TEST_TYPE(SIZE_T, 4, 4); + TEST_TYPE_SIZE (SIZE_T, 4) + TEST_TYPE_ALIGN (SIZE_T, 4) } static void test_pack_SSIZE_T(void) { /* SSIZE_T */ - TEST_TYPE(SSIZE_T, 4, 4); + TEST_TYPE_SIZE (SSIZE_T, 4) + TEST_TYPE_ALIGN (SSIZE_T, 4) } static void test_pack_UHALF_PTR(void) { /* UHALF_PTR */ - TEST_TYPE(UHALF_PTR, 2, 2); - TEST_TYPE_UNSIGNED(UHALF_PTR); + TEST_TYPE_SIZE (UHALF_PTR, 2) + TEST_TYPE_ALIGN (UHALF_PTR, 2) + TEST_TYPE_UNSIGNED(UHALF_PTR) } static void test_pack_UINT16(void) { /* UINT16 */ - TEST_TYPE(UINT16, 2, 2); - TEST_TYPE_UNSIGNED(UINT16); + TEST_TYPE_SIZE (UINT16, 2) + TEST_TYPE_ALIGN (UINT16, 2) + TEST_TYPE_UNSIGNED(UINT16) } static void test_pack_UINT32(void) { /* UINT32 */ - TEST_TYPE(UINT32, 4, 4); - TEST_TYPE_UNSIGNED(UINT32); + TEST_TYPE_SIZE (UINT32, 4) + TEST_TYPE_ALIGN (UINT32, 4) + TEST_TYPE_UNSIGNED(UINT32) } static void test_pack_UINT64(void) { /* UINT64 */ - TEST_TYPE(UINT64, 8, 8); - TEST_TYPE_UNSIGNED(UINT64); + TEST_TYPE_SIZE (UINT64, 8) + TEST_TYPE_ALIGN (UINT64, 8) + TEST_TYPE_UNSIGNED(UINT64) } static void test_pack_UINT8(void) { /* UINT8 */ - TEST_TYPE(UINT8, 1, 1); - TEST_TYPE_UNSIGNED(UINT8); + TEST_TYPE_SIZE (UINT8, 1) + TEST_TYPE_ALIGN (UINT8, 1) + TEST_TYPE_UNSIGNED(UINT8) } static void test_pack_UINT_PTR(void) { /* UINT_PTR */ - TEST_TYPE(UINT_PTR, 4, 4); - TEST_TYPE_UNSIGNED(UINT_PTR); + TEST_TYPE_SIZE (UINT_PTR, 4) + TEST_TYPE_ALIGN (UINT_PTR, 4) + TEST_TYPE_UNSIGNED(UINT_PTR) } static void test_pack_ULONG32(void) { /* ULONG32 */ - TEST_TYPE(ULONG32, 4, 4); - TEST_TYPE_UNSIGNED(ULONG32); + TEST_TYPE_SIZE (ULONG32, 4) + TEST_TYPE_ALIGN (ULONG32, 4) + TEST_TYPE_UNSIGNED(ULONG32) } static void test_pack_ULONG64(void) { /* ULONG64 */ - TEST_TYPE(ULONG64, 8, 8); - TEST_TYPE_UNSIGNED(ULONG64); + TEST_TYPE_SIZE (ULONG64, 8) + TEST_TYPE_ALIGN (ULONG64, 8) + TEST_TYPE_UNSIGNED(ULONG64) } static void test_pack_ULONG_PTR(void) { /* ULONG_PTR */ - TEST_TYPE(ULONG_PTR, 4, 4); - TEST_TYPE_UNSIGNED(ULONG_PTR); + TEST_TYPE_SIZE (ULONG_PTR, 4) + TEST_TYPE_ALIGN (ULONG_PTR, 4) + TEST_TYPE_UNSIGNED(ULONG_PTR) } static void test_pack_ACCESS_ALLOWED_ACE(void) { /* ACCESS_ALLOWED_ACE (pack 4) */ - TEST_TYPE(ACCESS_ALLOWED_ACE, 12, 4); - TEST_FIELD(ACCESS_ALLOWED_ACE, ACE_HEADER, Header, 0, 4, 2); - TEST_FIELD(ACCESS_ALLOWED_ACE, DWORD, Mask, 4, 4, 4); - TEST_FIELD(ACCESS_ALLOWED_ACE, DWORD, SidStart, 8, 4, 4); + TEST_TYPE_SIZE (ACCESS_ALLOWED_ACE, 12) + TEST_TYPE_ALIGN (ACCESS_ALLOWED_ACE, 4) + TEST_FIELD_SIZE (ACCESS_ALLOWED_ACE, Header, 4) + TEST_FIELD_ALIGN (ACCESS_ALLOWED_ACE, Header, 2) + TEST_FIELD_OFFSET(ACCESS_ALLOWED_ACE, Header, 0) + TEST_FIELD_SIZE (ACCESS_ALLOWED_ACE, Mask, 4) + TEST_FIELD_ALIGN (ACCESS_ALLOWED_ACE, Mask, 4) + TEST_FIELD_OFFSET(ACCESS_ALLOWED_ACE, Mask, 4) + TEST_FIELD_SIZE (ACCESS_ALLOWED_ACE, SidStart, 4) + TEST_FIELD_ALIGN (ACCESS_ALLOWED_ACE, SidStart, 4) + TEST_FIELD_OFFSET(ACCESS_ALLOWED_ACE, SidStart, 8) } static void test_pack_ACCESS_DENIED_ACE(void) { /* ACCESS_DENIED_ACE (pack 4) */ - TEST_TYPE(ACCESS_DENIED_ACE, 12, 4); - TEST_FIELD(ACCESS_DENIED_ACE, ACE_HEADER, Header, 0, 4, 2); - TEST_FIELD(ACCESS_DENIED_ACE, DWORD, Mask, 4, 4, 4); - TEST_FIELD(ACCESS_DENIED_ACE, DWORD, SidStart, 8, 4, 4); + TEST_TYPE_SIZE (ACCESS_DENIED_ACE, 12) + TEST_TYPE_ALIGN (ACCESS_DENIED_ACE, 4) + TEST_FIELD_SIZE (ACCESS_DENIED_ACE, Header, 4) + TEST_FIELD_ALIGN (ACCESS_DENIED_ACE, Header, 2) + TEST_FIELD_OFFSET(ACCESS_DENIED_ACE, Header, 0) + TEST_FIELD_SIZE (ACCESS_DENIED_ACE, Mask, 4) + TEST_FIELD_ALIGN (ACCESS_DENIED_ACE, Mask, 4) + TEST_FIELD_OFFSET(ACCESS_DENIED_ACE, Mask, 4) + TEST_FIELD_SIZE (ACCESS_DENIED_ACE, SidStart, 4) + TEST_FIELD_ALIGN (ACCESS_DENIED_ACE, SidStart, 4) + TEST_FIELD_OFFSET(ACCESS_DENIED_ACE, SidStart, 8) } static void test_pack_ACCESS_MASK(void) { /* ACCESS_MASK */ - TEST_TYPE(ACCESS_MASK, 4, 4); - TEST_TYPE_UNSIGNED(ACCESS_MASK); + TEST_TYPE_SIZE (ACCESS_MASK, 4) + TEST_TYPE_ALIGN (ACCESS_MASK, 4) + TEST_TYPE_UNSIGNED(ACCESS_MASK) } static void test_pack_ACE_HEADER(void) { /* ACE_HEADER (pack 4) */ - TEST_TYPE(ACE_HEADER, 4, 2); - TEST_FIELD(ACE_HEADER, BYTE, AceType, 0, 1, 1); - TEST_FIELD(ACE_HEADER, BYTE, AceFlags, 1, 1, 1); - TEST_FIELD(ACE_HEADER, WORD, AceSize, 2, 2, 2); + TEST_TYPE_SIZE (ACE_HEADER, 4) + TEST_TYPE_ALIGN (ACE_HEADER, 2) + TEST_FIELD_SIZE (ACE_HEADER, AceType, 1) + TEST_FIELD_ALIGN (ACE_HEADER, AceType, 1) + TEST_FIELD_OFFSET(ACE_HEADER, AceType, 0) + TEST_FIELD_SIZE (ACE_HEADER, AceFlags, 1) + TEST_FIELD_ALIGN (ACE_HEADER, AceFlags, 1) + TEST_FIELD_OFFSET(ACE_HEADER, AceFlags, 1) + TEST_FIELD_SIZE (ACE_HEADER, AceSize, 2) + TEST_FIELD_ALIGN (ACE_HEADER, AceSize, 2) + TEST_FIELD_OFFSET(ACE_HEADER, AceSize, 2) } static void test_pack_ACL(void) { /* ACL (pack 4) */ - TEST_TYPE(ACL, 8, 2); - TEST_FIELD(ACL, BYTE, AclRevision, 0, 1, 1); - TEST_FIELD(ACL, BYTE, Sbz1, 1, 1, 1); - TEST_FIELD(ACL, WORD, AclSize, 2, 2, 2); - TEST_FIELD(ACL, WORD, AceCount, 4, 2, 2); - TEST_FIELD(ACL, WORD, Sbz2, 6, 2, 2); + TEST_TYPE_SIZE (ACL, 8) + TEST_TYPE_ALIGN (ACL, 2) + TEST_FIELD_SIZE (ACL, AclRevision, 1) + TEST_FIELD_ALIGN (ACL, AclRevision, 1) + TEST_FIELD_OFFSET(ACL, AclRevision, 0) + TEST_FIELD_SIZE (ACL, Sbz1, 1) + TEST_FIELD_ALIGN (ACL, Sbz1, 1) + TEST_FIELD_OFFSET(ACL, Sbz1, 1) + TEST_FIELD_SIZE (ACL, AclSize, 2) + TEST_FIELD_ALIGN (ACL, AclSize, 2) + TEST_FIELD_OFFSET(ACL, AclSize, 2) + TEST_FIELD_SIZE (ACL, AceCount, 2) + TEST_FIELD_ALIGN (ACL, AceCount, 2) + TEST_FIELD_OFFSET(ACL, AceCount, 4) + TEST_FIELD_SIZE (ACL, Sbz2, 2) + TEST_FIELD_ALIGN (ACL, Sbz2, 2) + TEST_FIELD_OFFSET(ACL, Sbz2, 6) } static void test_pack_ACL_REVISION_INFORMATION(void) { /* ACL_REVISION_INFORMATION (pack 4) */ - TEST_TYPE(ACL_REVISION_INFORMATION, 4, 4); - TEST_FIELD(ACL_REVISION_INFORMATION, DWORD, AclRevision, 0, 4, 4); + TEST_TYPE_SIZE (ACL_REVISION_INFORMATION, 4) + TEST_TYPE_ALIGN (ACL_REVISION_INFORMATION, 4) + TEST_FIELD_SIZE (ACL_REVISION_INFORMATION, AclRevision, 4) + TEST_FIELD_ALIGN (ACL_REVISION_INFORMATION, AclRevision, 4) + TEST_FIELD_OFFSET(ACL_REVISION_INFORMATION, AclRevision, 0) } static void test_pack_ACL_SIZE_INFORMATION(void) { /* ACL_SIZE_INFORMATION (pack 4) */ - TEST_TYPE(ACL_SIZE_INFORMATION, 12, 4); - TEST_FIELD(ACL_SIZE_INFORMATION, DWORD, AceCount, 0, 4, 4); - TEST_FIELD(ACL_SIZE_INFORMATION, DWORD, AclBytesInUse, 4, 4, 4); - TEST_FIELD(ACL_SIZE_INFORMATION, DWORD, AclBytesFree, 8, 4, 4); + TEST_TYPE_SIZE (ACL_SIZE_INFORMATION, 12) + TEST_TYPE_ALIGN (ACL_SIZE_INFORMATION, 4) + TEST_FIELD_SIZE (ACL_SIZE_INFORMATION, AceCount, 4) + TEST_FIELD_ALIGN (ACL_SIZE_INFORMATION, AceCount, 4) + TEST_FIELD_OFFSET(ACL_SIZE_INFORMATION, AceCount, 0) + TEST_FIELD_SIZE (ACL_SIZE_INFORMATION, AclBytesInUse, 4) + TEST_FIELD_ALIGN (ACL_SIZE_INFORMATION, AclBytesInUse, 4) + TEST_FIELD_OFFSET(ACL_SIZE_INFORMATION, AclBytesInUse, 4) + TEST_FIELD_SIZE (ACL_SIZE_INFORMATION, AclBytesFree, 4) + TEST_FIELD_ALIGN (ACL_SIZE_INFORMATION, AclBytesFree, 4) + TEST_FIELD_OFFSET(ACL_SIZE_INFORMATION, AclBytesFree, 8) } static void test_pack_BOOLEAN(void) { /* BOOLEAN */ - TEST_TYPE(BOOLEAN, 1, 1); - TEST_TYPE_UNSIGNED(BOOLEAN); + TEST_TYPE_SIZE (BOOLEAN, 1) + TEST_TYPE_ALIGN (BOOLEAN, 1) + TEST_TYPE_UNSIGNED(BOOLEAN) } static void test_pack_CCHAR(void) { /* CCHAR */ - TEST_TYPE(CCHAR, 1, 1); - TEST_TYPE_SIGNED(CCHAR); + TEST_TYPE_SIZE (CCHAR, 1) + TEST_TYPE_ALIGN (CCHAR, 1) + TEST_TYPE_SIGNED(CCHAR) } static void test_pack_CHAR(void) { /* CHAR */ - TEST_TYPE(CHAR, 1, 1); - TEST_TYPE_SIGNED(CHAR); + TEST_TYPE_SIZE (CHAR, 1) + TEST_TYPE_ALIGN (CHAR, 1) + TEST_TYPE_SIGNED(CHAR) } static void test_pack_DWORDLONG(void) { /* DWORDLONG */ - TEST_TYPE(DWORDLONG, 8, 8); - TEST_TYPE_UNSIGNED(DWORDLONG); + TEST_TYPE_SIZE (DWORDLONG, 8) + TEST_TYPE_ALIGN (DWORDLONG, 8) + TEST_TYPE_UNSIGNED(DWORDLONG) } static void test_pack_EXCEPTION_POINTERS(void) { /* EXCEPTION_POINTERS (pack 4) */ - TEST_TYPE(EXCEPTION_POINTERS, 8, 4); - TEST_FIELD(EXCEPTION_POINTERS, PEXCEPTION_RECORD, ExceptionRecord, 0, 4, 4); - TEST_FIELD(EXCEPTION_POINTERS, PCONTEXT, ContextRecord, 4, 4, 4); + TEST_TYPE_SIZE (EXCEPTION_POINTERS, 8) + TEST_TYPE_ALIGN (EXCEPTION_POINTERS, 4) + TEST_FIELD_SIZE (EXCEPTION_POINTERS, ExceptionRecord, 4) + TEST_FIELD_ALIGN (EXCEPTION_POINTERS, ExceptionRecord, 4) + TEST_FIELD_OFFSET(EXCEPTION_POINTERS, ExceptionRecord, 0) + TEST_FIELD_SIZE (EXCEPTION_POINTERS, ContextRecord, 4) + TEST_FIELD_ALIGN (EXCEPTION_POINTERS, ContextRecord, 4) + TEST_FIELD_OFFSET(EXCEPTION_POINTERS, ContextRecord, 4) } static void test_pack_EXCEPTION_RECORD(void) { /* EXCEPTION_RECORD (pack 4) */ - TEST_TYPE(EXCEPTION_RECORD, 80, 4); - TEST_FIELD(EXCEPTION_RECORD, DWORD, ExceptionCode, 0, 4, 4); - TEST_FIELD(EXCEPTION_RECORD, DWORD, ExceptionFlags, 4, 4, 4); - TEST_FIELD(EXCEPTION_RECORD, struct _EXCEPTION_RECORD *, ExceptionRecord, 8, 4, 4); - TEST_FIELD(EXCEPTION_RECORD, PVOID, ExceptionAddress, 12, 4, 4); - TEST_FIELD(EXCEPTION_RECORD, DWORD, NumberParameters, 16, 4, 4); - TEST_FIELD(EXCEPTION_RECORD, ULONG_PTR[EXCEPTION_MAXIMUM_PARAMETERS], ExceptionInformation, 20, 60, 4); + TEST_TYPE_SIZE (EXCEPTION_RECORD, 80) + TEST_TYPE_ALIGN (EXCEPTION_RECORD, 4) + TEST_FIELD_SIZE (EXCEPTION_RECORD, ExceptionCode, 4) + TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionCode, 4) + TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionCode, 0) + TEST_FIELD_SIZE (EXCEPTION_RECORD, ExceptionFlags, 4) + TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionFlags, 4) + TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionFlags, 4) + TEST_FIELD_SIZE (EXCEPTION_RECORD, ExceptionRecord, 4) + TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionRecord, 4) + TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionRecord, 8) + TEST_FIELD_SIZE (EXCEPTION_RECORD, ExceptionAddress, 4) + TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionAddress, 4) + TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionAddress, 12) + TEST_FIELD_SIZE (EXCEPTION_RECORD, NumberParameters, 4) + TEST_FIELD_ALIGN (EXCEPTION_RECORD, NumberParameters, 4) + TEST_FIELD_OFFSET(EXCEPTION_RECORD, NumberParameters, 16) + TEST_FIELD_SIZE (EXCEPTION_RECORD, ExceptionInformation, 60) + TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionInformation, 4) + TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionInformation, 20) } static void test_pack_EXECUTION_STATE(void) { /* EXECUTION_STATE */ - TEST_TYPE(EXECUTION_STATE, 4, 4); - TEST_TYPE_UNSIGNED(EXECUTION_STATE); + TEST_TYPE_SIZE (EXECUTION_STATE, 4) + TEST_TYPE_ALIGN (EXECUTION_STATE, 4) + TEST_TYPE_UNSIGNED(EXECUTION_STATE) } static void test_pack_FLOATING_SAVE_AREA(void) { /* FLOATING_SAVE_AREA (pack 4) */ - TEST_TYPE(FLOATING_SAVE_AREA, 112, 4); - TEST_FIELD(FLOATING_SAVE_AREA, DWORD, ControlWord, 0, 4, 4); - TEST_FIELD(FLOATING_SAVE_AREA, DWORD, StatusWord, 4, 4, 4); - TEST_FIELD(FLOATING_SAVE_AREA, DWORD, TagWord, 8, 4, 4); - TEST_FIELD(FLOATING_SAVE_AREA, DWORD, ErrorOffset, 12, 4, 4); - TEST_FIELD(FLOATING_SAVE_AREA, DWORD, ErrorSelector, 16, 4, 4); - TEST_FIELD(FLOATING_SAVE_AREA, DWORD, DataOffset, 20, 4, 4); - TEST_FIELD(FLOATING_SAVE_AREA, DWORD, DataSelector, 24, 4, 4); - TEST_FIELD(FLOATING_SAVE_AREA, BYTE[SIZE_OF_80387_REGISTERS], RegisterArea, 28, 80, 1); - TEST_FIELD(FLOATING_SAVE_AREA, DWORD, Cr0NpxState, 108, 4, 4); + TEST_TYPE_SIZE (FLOATING_SAVE_AREA, 112) + TEST_TYPE_ALIGN (FLOATING_SAVE_AREA, 4) + TEST_FIELD_SIZE (FLOATING_SAVE_AREA, ControlWord, 4) + TEST_FIELD_ALIGN (FLOATING_SAVE_AREA, ControlWord, 4) + TEST_FIELD_OFFSET(FLOATING_SAVE_AREA, ControlWord, 0) + TEST_FIELD_SIZE (FLOATING_SAVE_AREA, StatusWord, 4) + TEST_FIELD_ALIGN (FLOATING_SAVE_AREA, StatusWord, 4) + TEST_FIELD_OFFSET(FLOATING_SAVE_AREA, StatusWord, 4) + TEST_FIELD_SIZE (FLOATING_SAVE_AREA, TagWord, 4) + TEST_FIELD_ALIGN (FLOATING_SAVE_AREA, TagWord, 4) + TEST_FIELD_OFFSET(FLOATING_SAVE_AREA, TagWord, 8) + TEST_FIELD_SIZE (FLOATING_SAVE_AREA, ErrorOffset, 4) + TEST_FIELD_ALIGN (FLOATING_SAVE_AREA, ErrorOffset, 4) + TEST_FIELD_OFFSET(FLOATING_SAVE_AREA, ErrorOffset, 12) + TEST_FIELD_SIZE (FLOATING_SAVE_AREA, ErrorSelector, 4) + TEST_FIELD_ALIGN (FLOATING_SAVE_AREA, ErrorSelector, 4) + TEST_FIELD_OFFSET(FLOATING_SAVE_AREA, ErrorSelector, 16) + TEST_FIELD_SIZE (FLOATING_SAVE_AREA, DataOffset, 4) + TEST_FIELD_ALIGN (FLOATING_SAVE_AREA, DataOffset, 4) + TEST_FIELD_OFFSET(FLOATING_SAVE_AREA, DataOffset, 20) + TEST_FIELD_SIZE (FLOATING_SAVE_AREA, DataSelector, 4) + TEST_FIELD_ALIGN (FLOATING_SAVE_AREA, DataSelector, 4) + TEST_FIELD_OFFSET(FLOATING_SAVE_AREA, DataSelector, 24) + TEST_FIELD_SIZE (FLOATING_SAVE_AREA, RegisterArea, 80) + TEST_FIELD_ALIGN (FLOATING_SAVE_AREA, RegisterArea, 1) + TEST_FIELD_OFFSET(FLOATING_SAVE_AREA, RegisterArea, 28) + TEST_FIELD_SIZE (FLOATING_SAVE_AREA, Cr0NpxState, 4) + TEST_FIELD_ALIGN (FLOATING_SAVE_AREA, Cr0NpxState, 4) + TEST_FIELD_OFFSET(FLOATING_SAVE_AREA, Cr0NpxState, 108) } static void test_pack_FPO_DATA(void) { /* FPO_DATA (pack 4) */ - TEST_TYPE(FPO_DATA, 16, 4); - TEST_FIELD(FPO_DATA, DWORD, ulOffStart, 0, 4, 4); - TEST_FIELD(FPO_DATA, DWORD, cbProcSize, 4, 4, 4); - TEST_FIELD(FPO_DATA, DWORD, cdwLocals, 8, 4, 4); - TEST_FIELD(FPO_DATA, WORD, cdwParams, 12, 2, 2); + TEST_TYPE_SIZE (FPO_DATA, 16) + TEST_TYPE_ALIGN (FPO_DATA, 4) + TEST_FIELD_SIZE (FPO_DATA, ulOffStart, 4) + TEST_FIELD_ALIGN (FPO_DATA, ulOffStart, 4) + TEST_FIELD_OFFSET(FPO_DATA, ulOffStart, 0) + TEST_FIELD_SIZE (FPO_DATA, cbProcSize, 4) + TEST_FIELD_ALIGN (FPO_DATA, cbProcSize, 4) + TEST_FIELD_OFFSET(FPO_DATA, cbProcSize, 4) + TEST_FIELD_SIZE (FPO_DATA, cdwLocals, 4) + TEST_FIELD_ALIGN (FPO_DATA, cdwLocals, 4) + TEST_FIELD_OFFSET(FPO_DATA, cdwLocals, 8) + TEST_FIELD_SIZE (FPO_DATA, cdwParams, 2) + TEST_FIELD_ALIGN (FPO_DATA, cdwParams, 2) + TEST_FIELD_OFFSET(FPO_DATA, cdwParams, 12) } static void test_pack_GENERIC_MAPPING(void) { /* GENERIC_MAPPING (pack 4) */ - TEST_TYPE(GENERIC_MAPPING, 16, 4); - TEST_FIELD(GENERIC_MAPPING, ACCESS_MASK, GenericRead, 0, 4, 4); - TEST_FIELD(GENERIC_MAPPING, ACCESS_MASK, GenericWrite, 4, 4, 4); - TEST_FIELD(GENERIC_MAPPING, ACCESS_MASK, GenericExecute, 8, 4, 4); - TEST_FIELD(GENERIC_MAPPING, ACCESS_MASK, GenericAll, 12, 4, 4); + TEST_TYPE_SIZE (GENERIC_MAPPING, 16) + TEST_TYPE_ALIGN (GENERIC_MAPPING, 4) + TEST_FIELD_SIZE (GENERIC_MAPPING, GenericRead, 4) + TEST_FIELD_ALIGN (GENERIC_MAPPING, GenericRead, 4) + TEST_FIELD_OFFSET(GENERIC_MAPPING, GenericRead, 0) + TEST_FIELD_SIZE (GENERIC_MAPPING, GenericWrite, 4) + TEST_FIELD_ALIGN (GENERIC_MAPPING, GenericWrite, 4) + TEST_FIELD_OFFSET(GENERIC_MAPPING, GenericWrite, 4) + TEST_FIELD_SIZE (GENERIC_MAPPING, GenericExecute, 4) + TEST_FIELD_ALIGN (GENERIC_MAPPING, GenericExecute, 4) + TEST_FIELD_OFFSET(GENERIC_MAPPING, GenericExecute, 8) + TEST_FIELD_SIZE (GENERIC_MAPPING, GenericAll, 4) + TEST_FIELD_ALIGN (GENERIC_MAPPING, GenericAll, 4) + TEST_FIELD_OFFSET(GENERIC_MAPPING, GenericAll, 12) } static void test_pack_HANDLE(void) { /* HANDLE */ - TEST_TYPE(HANDLE, 4, 4); + TEST_TYPE_SIZE (HANDLE, 4) + TEST_TYPE_ALIGN (HANDLE, 4) } static void test_pack_HRESULT(void) { /* HRESULT */ - TEST_TYPE(HRESULT, 4, 4); + TEST_TYPE_SIZE (HRESULT, 4) + TEST_TYPE_ALIGN (HRESULT, 4) } static void test_pack_IMAGE_ARCHIVE_MEMBER_HEADER(void) { /* IMAGE_ARCHIVE_MEMBER_HEADER (pack 4) */ - TEST_TYPE(IMAGE_ARCHIVE_MEMBER_HEADER, 60, 1); - TEST_FIELD(IMAGE_ARCHIVE_MEMBER_HEADER, BYTE[16], Name, 0, 16, 1); - TEST_FIELD(IMAGE_ARCHIVE_MEMBER_HEADER, BYTE[12], Date, 16, 12, 1); - TEST_FIELD(IMAGE_ARCHIVE_MEMBER_HEADER, BYTE[6], UserID, 28, 6, 1); - TEST_FIELD(IMAGE_ARCHIVE_MEMBER_HEADER, BYTE[6], GroupID, 34, 6, 1); - TEST_FIELD(IMAGE_ARCHIVE_MEMBER_HEADER, BYTE[8], Mode, 40, 8, 1); - TEST_FIELD(IMAGE_ARCHIVE_MEMBER_HEADER, BYTE[10], Size, 48, 10, 1); - TEST_FIELD(IMAGE_ARCHIVE_MEMBER_HEADER, BYTE[2], EndHeader, 58, 2, 1); + TEST_TYPE_SIZE (IMAGE_ARCHIVE_MEMBER_HEADER, 60) + TEST_TYPE_ALIGN (IMAGE_ARCHIVE_MEMBER_HEADER, 1) + TEST_FIELD_SIZE (IMAGE_ARCHIVE_MEMBER_HEADER, Name, 16) + TEST_FIELD_ALIGN (IMAGE_ARCHIVE_MEMBER_HEADER, Name, 1) + TEST_FIELD_OFFSET(IMAGE_ARCHIVE_MEMBER_HEADER, Name, 0) + TEST_FIELD_SIZE (IMAGE_ARCHIVE_MEMBER_HEADER, Date, 12) + TEST_FIELD_ALIGN (IMAGE_ARCHIVE_MEMBER_HEADER, Date, 1) + TEST_FIELD_OFFSET(IMAGE_ARCHIVE_MEMBER_HEADER, Date, 16) + TEST_FIELD_SIZE (IMAGE_ARCHIVE_MEMBER_HEADER, UserID, 6) + TEST_FIELD_ALIGN (IMAGE_ARCHIVE_MEMBER_HEADER, UserID, 1) + TEST_FIELD_OFFSET(IMAGE_ARCHIVE_MEMBER_HEADER, UserID, 28) + TEST_FIELD_SIZE (IMAGE_ARCHIVE_MEMBER_HEADER, GroupID, 6) + TEST_FIELD_ALIGN (IMAGE_ARCHIVE_MEMBER_HEADER, GroupID, 1) + TEST_FIELD_OFFSET(IMAGE_ARCHIVE_MEMBER_HEADER, GroupID, 34) + TEST_FIELD_SIZE (IMAGE_ARCHIVE_MEMBER_HEADER, Mode, 8) + TEST_FIELD_ALIGN (IMAGE_ARCHIVE_MEMBER_HEADER, Mode, 1) + TEST_FIELD_OFFSET(IMAGE_ARCHIVE_MEMBER_HEADER, Mode, 40) + TEST_FIELD_SIZE (IMAGE_ARCHIVE_MEMBER_HEADER, Size, 10) + TEST_FIELD_ALIGN (IMAGE_ARCHIVE_MEMBER_HEADER, Size, 1) + TEST_FIELD_OFFSET(IMAGE_ARCHIVE_MEMBER_HEADER, Size, 48) + TEST_FIELD_SIZE (IMAGE_ARCHIVE_MEMBER_HEADER, EndHeader, 2) + TEST_FIELD_ALIGN (IMAGE_ARCHIVE_MEMBER_HEADER, EndHeader, 1) + TEST_FIELD_OFFSET(IMAGE_ARCHIVE_MEMBER_HEADER, EndHeader, 58) } static void test_pack_IMAGE_AUX_SYMBOL(void) @@ -455,146 +572,304 @@ static void test_pack_IMAGE_AUX_SYMBOL(void) static void test_pack_IMAGE_BASE_RELOCATION(void) { /* IMAGE_BASE_RELOCATION (pack 4) */ - TEST_TYPE(IMAGE_BASE_RELOCATION, 8, 4); - TEST_FIELD(IMAGE_BASE_RELOCATION, DWORD, VirtualAddress, 0, 4, 4); - TEST_FIELD(IMAGE_BASE_RELOCATION, DWORD, SizeOfBlock, 4, 4, 4); + TEST_TYPE_SIZE (IMAGE_BASE_RELOCATION, 8) + TEST_TYPE_ALIGN (IMAGE_BASE_RELOCATION, 4) + TEST_FIELD_SIZE (IMAGE_BASE_RELOCATION, VirtualAddress, 4) + TEST_FIELD_ALIGN (IMAGE_BASE_RELOCATION, VirtualAddress, 4) + TEST_FIELD_OFFSET(IMAGE_BASE_RELOCATION, VirtualAddress, 0) + TEST_FIELD_SIZE (IMAGE_BASE_RELOCATION, SizeOfBlock, 4) + TEST_FIELD_ALIGN (IMAGE_BASE_RELOCATION, SizeOfBlock, 4) + TEST_FIELD_OFFSET(IMAGE_BASE_RELOCATION, SizeOfBlock, 4) } static void test_pack_IMAGE_BOUND_FORWARDER_REF(void) { /* IMAGE_BOUND_FORWARDER_REF (pack 4) */ - TEST_TYPE(IMAGE_BOUND_FORWARDER_REF, 8, 4); - TEST_FIELD(IMAGE_BOUND_FORWARDER_REF, DWORD, TimeDateStamp, 0, 4, 4); - TEST_FIELD(IMAGE_BOUND_FORWARDER_REF, WORD, OffsetModuleName, 4, 2, 2); - TEST_FIELD(IMAGE_BOUND_FORWARDER_REF, WORD, Reserved, 6, 2, 2); + TEST_TYPE_SIZE (IMAGE_BOUND_FORWARDER_REF, 8) + TEST_TYPE_ALIGN (IMAGE_BOUND_FORWARDER_REF, 4) + TEST_FIELD_SIZE (IMAGE_BOUND_FORWARDER_REF, TimeDateStamp, 4) + TEST_FIELD_ALIGN (IMAGE_BOUND_FORWARDER_REF, TimeDateStamp, 4) + TEST_FIELD_OFFSET(IMAGE_BOUND_FORWARDER_REF, TimeDateStamp, 0) + TEST_FIELD_SIZE (IMAGE_BOUND_FORWARDER_REF, OffsetModuleName, 2) + TEST_FIELD_ALIGN (IMAGE_BOUND_FORWARDER_REF, OffsetModuleName, 2) + TEST_FIELD_OFFSET(IMAGE_BOUND_FORWARDER_REF, OffsetModuleName, 4) + TEST_FIELD_SIZE (IMAGE_BOUND_FORWARDER_REF, Reserved, 2) + TEST_FIELD_ALIGN (IMAGE_BOUND_FORWARDER_REF, Reserved, 2) + TEST_FIELD_OFFSET(IMAGE_BOUND_FORWARDER_REF, Reserved, 6) } static void test_pack_IMAGE_BOUND_IMPORT_DESCRIPTOR(void) { /* IMAGE_BOUND_IMPORT_DESCRIPTOR (pack 4) */ - TEST_TYPE(IMAGE_BOUND_IMPORT_DESCRIPTOR, 8, 4); - TEST_FIELD(IMAGE_BOUND_IMPORT_DESCRIPTOR, DWORD, TimeDateStamp, 0, 4, 4); - TEST_FIELD(IMAGE_BOUND_IMPORT_DESCRIPTOR, WORD, OffsetModuleName, 4, 2, 2); - TEST_FIELD(IMAGE_BOUND_IMPORT_DESCRIPTOR, WORD, NumberOfModuleForwarderRefs, 6, 2, 2); + TEST_TYPE_SIZE (IMAGE_BOUND_IMPORT_DESCRIPTOR, 8) + TEST_TYPE_ALIGN (IMAGE_BOUND_IMPORT_DESCRIPTOR, 4) + TEST_FIELD_SIZE (IMAGE_BOUND_IMPORT_DESCRIPTOR, TimeDateStamp, 4) + TEST_FIELD_ALIGN (IMAGE_BOUND_IMPORT_DESCRIPTOR, TimeDateStamp, 4) + TEST_FIELD_OFFSET(IMAGE_BOUND_IMPORT_DESCRIPTOR, TimeDateStamp, 0) + TEST_FIELD_SIZE (IMAGE_BOUND_IMPORT_DESCRIPTOR, OffsetModuleName, 2) + TEST_FIELD_ALIGN (IMAGE_BOUND_IMPORT_DESCRIPTOR, OffsetModuleName, 2) + TEST_FIELD_OFFSET(IMAGE_BOUND_IMPORT_DESCRIPTOR, OffsetModuleName, 4) + TEST_FIELD_SIZE (IMAGE_BOUND_IMPORT_DESCRIPTOR, NumberOfModuleForwarderRefs, 2) + TEST_FIELD_ALIGN (IMAGE_BOUND_IMPORT_DESCRIPTOR, NumberOfModuleForwarderRefs, 2) + TEST_FIELD_OFFSET(IMAGE_BOUND_IMPORT_DESCRIPTOR, NumberOfModuleForwarderRefs, 6) } static void test_pack_IMAGE_COFF_SYMBOLS_HEADER(void) { /* IMAGE_COFF_SYMBOLS_HEADER (pack 4) */ - TEST_TYPE(IMAGE_COFF_SYMBOLS_HEADER, 32, 4); - TEST_FIELD(IMAGE_COFF_SYMBOLS_HEADER, DWORD, NumberOfSymbols, 0, 4, 4); - TEST_FIELD(IMAGE_COFF_SYMBOLS_HEADER, DWORD, LvaToFirstSymbol, 4, 4, 4); - TEST_FIELD(IMAGE_COFF_SYMBOLS_HEADER, DWORD, NumberOfLinenumbers, 8, 4, 4); - TEST_FIELD(IMAGE_COFF_SYMBOLS_HEADER, DWORD, LvaToFirstLinenumber, 12, 4, 4); - TEST_FIELD(IMAGE_COFF_SYMBOLS_HEADER, DWORD, RvaToFirstByteOfCode, 16, 4, 4); - TEST_FIELD(IMAGE_COFF_SYMBOLS_HEADER, DWORD, RvaToLastByteOfCode, 20, 4, 4); - TEST_FIELD(IMAGE_COFF_SYMBOLS_HEADER, DWORD, RvaToFirstByteOfData, 24, 4, 4); - TEST_FIELD(IMAGE_COFF_SYMBOLS_HEADER, DWORD, RvaToLastByteOfData, 28, 4, 4); + TEST_TYPE_SIZE (IMAGE_COFF_SYMBOLS_HEADER, 32) + TEST_TYPE_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, 4) + TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, NumberOfSymbols, 4) + TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, NumberOfSymbols, 4) + TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, NumberOfSymbols, 0) + TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstSymbol, 4) + TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstSymbol, 4) + TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstSymbol, 4) + TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, NumberOfLinenumbers, 4) + TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, NumberOfLinenumbers, 4) + TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, NumberOfLinenumbers, 8) + TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstLinenumber, 4) + TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstLinenumber, 4) + TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstLinenumber, 12) + TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfCode, 4) + TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfCode, 4) + TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfCode, 16) + TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfCode, 4) + TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfCode, 4) + TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfCode, 20) + TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfData, 4) + TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfData, 4) + TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfData, 24) + TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfData, 4) + TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfData, 4) + TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfData, 28) } static void test_pack_IMAGE_DATA_DIRECTORY(void) { /* IMAGE_DATA_DIRECTORY (pack 4) */ - TEST_TYPE(IMAGE_DATA_DIRECTORY, 8, 4); - TEST_FIELD(IMAGE_DATA_DIRECTORY, DWORD, VirtualAddress, 0, 4, 4); - TEST_FIELD(IMAGE_DATA_DIRECTORY, DWORD, Size, 4, 4, 4); + TEST_TYPE_SIZE (IMAGE_DATA_DIRECTORY, 8) + TEST_TYPE_ALIGN (IMAGE_DATA_DIRECTORY, 4) + TEST_FIELD_SIZE (IMAGE_DATA_DIRECTORY, VirtualAddress, 4) + TEST_FIELD_ALIGN (IMAGE_DATA_DIRECTORY, VirtualAddress, 4) + TEST_FIELD_OFFSET(IMAGE_DATA_DIRECTORY, VirtualAddress, 0) + TEST_FIELD_SIZE (IMAGE_DATA_DIRECTORY, Size, 4) + TEST_FIELD_ALIGN (IMAGE_DATA_DIRECTORY, Size, 4) + TEST_FIELD_OFFSET(IMAGE_DATA_DIRECTORY, Size, 4) } static void test_pack_IMAGE_DEBUG_DIRECTORY(void) { /* IMAGE_DEBUG_DIRECTORY (pack 4) */ - TEST_TYPE(IMAGE_DEBUG_DIRECTORY, 28, 4); - TEST_FIELD(IMAGE_DEBUG_DIRECTORY, DWORD, Characteristics, 0, 4, 4); - TEST_FIELD(IMAGE_DEBUG_DIRECTORY, DWORD, TimeDateStamp, 4, 4, 4); - TEST_FIELD(IMAGE_DEBUG_DIRECTORY, WORD, MajorVersion, 8, 2, 2); - TEST_FIELD(IMAGE_DEBUG_DIRECTORY, WORD, MinorVersion, 10, 2, 2); - TEST_FIELD(IMAGE_DEBUG_DIRECTORY, DWORD, Type, 12, 4, 4); - TEST_FIELD(IMAGE_DEBUG_DIRECTORY, DWORD, SizeOfData, 16, 4, 4); - TEST_FIELD(IMAGE_DEBUG_DIRECTORY, DWORD, AddressOfRawData, 20, 4, 4); - TEST_FIELD(IMAGE_DEBUG_DIRECTORY, DWORD, PointerToRawData, 24, 4, 4); + TEST_TYPE_SIZE (IMAGE_DEBUG_DIRECTORY, 28) + TEST_TYPE_ALIGN (IMAGE_DEBUG_DIRECTORY, 4) + TEST_FIELD_SIZE (IMAGE_DEBUG_DIRECTORY, Characteristics, 4) + TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, Characteristics, 4) + TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, Characteristics, 0) + TEST_FIELD_SIZE (IMAGE_DEBUG_DIRECTORY, TimeDateStamp, 4) + TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, TimeDateStamp, 4) + TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, TimeDateStamp, 4) + TEST_FIELD_SIZE (IMAGE_DEBUG_DIRECTORY, MajorVersion, 2) + TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, MajorVersion, 2) + TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, MajorVersion, 8) + TEST_FIELD_SIZE (IMAGE_DEBUG_DIRECTORY, MinorVersion, 2) + TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, MinorVersion, 2) + TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, MinorVersion, 10) + TEST_FIELD_SIZE (IMAGE_DEBUG_DIRECTORY, Type, 4) + TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, Type, 4) + TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, Type, 12) + TEST_FIELD_SIZE (IMAGE_DEBUG_DIRECTORY, SizeOfData, 4) + TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, SizeOfData, 4) + TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, SizeOfData, 16) + TEST_FIELD_SIZE (IMAGE_DEBUG_DIRECTORY, AddressOfRawData, 4) + TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, AddressOfRawData, 4) + TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, AddressOfRawData, 20) + TEST_FIELD_SIZE (IMAGE_DEBUG_DIRECTORY, PointerToRawData, 4) + TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, PointerToRawData, 4) + TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, PointerToRawData, 24) } static void test_pack_IMAGE_DEBUG_MISC(void) { /* IMAGE_DEBUG_MISC (pack 4) */ - TEST_TYPE(IMAGE_DEBUG_MISC, 16, 4); - TEST_FIELD(IMAGE_DEBUG_MISC, DWORD, DataType, 0, 4, 4); - TEST_FIELD(IMAGE_DEBUG_MISC, DWORD, Length, 4, 4, 4); - TEST_FIELD(IMAGE_DEBUG_MISC, BYTE, Unicode, 8, 1, 1); - TEST_FIELD(IMAGE_DEBUG_MISC, BYTE[ 3 ], Reserved, 9, 3, 1); - TEST_FIELD(IMAGE_DEBUG_MISC, BYTE[ 1 ], Data, 12, 1, 1); + TEST_TYPE_SIZE (IMAGE_DEBUG_MISC, 16) + TEST_TYPE_ALIGN (IMAGE_DEBUG_MISC, 4) + TEST_FIELD_SIZE (IMAGE_DEBUG_MISC, DataType, 4) + TEST_FIELD_ALIGN (IMAGE_DEBUG_MISC, DataType, 4) + TEST_FIELD_OFFSET(IMAGE_DEBUG_MISC, DataType, 0) + TEST_FIELD_SIZE (IMAGE_DEBUG_MISC, Length, 4) + TEST_FIELD_ALIGN (IMAGE_DEBUG_MISC, Length, 4) + TEST_FIELD_OFFSET(IMAGE_DEBUG_MISC, Length, 4) + TEST_FIELD_SIZE (IMAGE_DEBUG_MISC, Unicode, 1) + TEST_FIELD_ALIGN (IMAGE_DEBUG_MISC, Unicode, 1) + TEST_FIELD_OFFSET(IMAGE_DEBUG_MISC, Unicode, 8) + TEST_FIELD_SIZE (IMAGE_DEBUG_MISC, Reserved, 3) + TEST_FIELD_ALIGN (IMAGE_DEBUG_MISC, Reserved, 1) + TEST_FIELD_OFFSET(IMAGE_DEBUG_MISC, Reserved, 9) + TEST_FIELD_SIZE (IMAGE_DEBUG_MISC, Data, 1) + TEST_FIELD_ALIGN (IMAGE_DEBUG_MISC, Data, 1) + TEST_FIELD_OFFSET(IMAGE_DEBUG_MISC, Data, 12) } static void test_pack_IMAGE_DOS_HEADER(void) { /* IMAGE_DOS_HEADER (pack 2) */ - TEST_TYPE(IMAGE_DOS_HEADER, 64, 2); - TEST_FIELD(IMAGE_DOS_HEADER, WORD, e_magic, 0, 2, 2); - TEST_FIELD(IMAGE_DOS_HEADER, WORD, e_cblp, 2, 2, 2); - TEST_FIELD(IMAGE_DOS_HEADER, WORD, e_cp, 4, 2, 2); - TEST_FIELD(IMAGE_DOS_HEADER, WORD, e_crlc, 6, 2, 2); - TEST_FIELD(IMAGE_DOS_HEADER, WORD, e_cparhdr, 8, 2, 2); - TEST_FIELD(IMAGE_DOS_HEADER, WORD, e_minalloc, 10, 2, 2); - TEST_FIELD(IMAGE_DOS_HEADER, WORD, e_maxalloc, 12, 2, 2); - TEST_FIELD(IMAGE_DOS_HEADER, WORD, e_ss, 14, 2, 2); - TEST_FIELD(IMAGE_DOS_HEADER, WORD, e_sp, 16, 2, 2); - TEST_FIELD(IMAGE_DOS_HEADER, WORD, e_csum, 18, 2, 2); - TEST_FIELD(IMAGE_DOS_HEADER, WORD, e_ip, 20, 2, 2); - TEST_FIELD(IMAGE_DOS_HEADER, WORD, e_cs, 22, 2, 2); - TEST_FIELD(IMAGE_DOS_HEADER, WORD, e_lfarlc, 24, 2, 2); - TEST_FIELD(IMAGE_DOS_HEADER, WORD, e_ovno, 26, 2, 2); - TEST_FIELD(IMAGE_DOS_HEADER, WORD[4], e_res, 28, 8, 2); - TEST_FIELD(IMAGE_DOS_HEADER, WORD, e_oemid, 36, 2, 2); - TEST_FIELD(IMAGE_DOS_HEADER, WORD, e_oeminfo, 38, 2, 2); - TEST_FIELD(IMAGE_DOS_HEADER, WORD[10], e_res2, 40, 20, 2); - TEST_FIELD(IMAGE_DOS_HEADER, DWORD, e_lfanew, 60, 4, 2); + TEST_TYPE_SIZE (IMAGE_DOS_HEADER, 64) + TEST_TYPE_ALIGN (IMAGE_DOS_HEADER, 2) + TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_magic, 2) + TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_magic, 2) + TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_magic, 0) + TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_cblp, 2) + TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_cblp, 2) + TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_cblp, 2) + TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_cp, 2) + TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_cp, 2) + TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_cp, 4) + TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_crlc, 2) + TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_crlc, 2) + TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_crlc, 6) + TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_cparhdr, 2) + TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_cparhdr, 2) + TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_cparhdr, 8) + TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_minalloc, 2) + TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_minalloc, 2) + TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_minalloc, 10) + TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_maxalloc, 2) + TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_maxalloc, 2) + TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_maxalloc, 12) + TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_ss, 2) + TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_ss, 2) + TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_ss, 14) + TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_sp, 2) + TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_sp, 2) + TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_sp, 16) + TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_csum, 2) + TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_csum, 2) + TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_csum, 18) + TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_ip, 2) + TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_ip, 2) + TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_ip, 20) + TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_cs, 2) + TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_cs, 2) + TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_cs, 22) + TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_lfarlc, 2) + TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_lfarlc, 2) + TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_lfarlc, 24) + TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_ovno, 2) + TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_ovno, 2) + TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_ovno, 26) + TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_res, 8) + TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_res, 2) + TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_res, 28) + TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_oemid, 2) + TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_oemid, 2) + TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_oemid, 36) + TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_oeminfo, 2) + TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_oeminfo, 2) + TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_oeminfo, 38) + TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_res2, 20) + TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_res2, 2) + TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_res2, 40) + TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_lfanew, 4) + TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_lfanew, 2) + TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_lfanew, 60) } static void test_pack_IMAGE_EXPORT_DIRECTORY(void) { /* IMAGE_EXPORT_DIRECTORY (pack 4) */ - TEST_TYPE(IMAGE_EXPORT_DIRECTORY, 40, 4); - TEST_FIELD(IMAGE_EXPORT_DIRECTORY, DWORD, Characteristics, 0, 4, 4); - TEST_FIELD(IMAGE_EXPORT_DIRECTORY, DWORD, TimeDateStamp, 4, 4, 4); - TEST_FIELD(IMAGE_EXPORT_DIRECTORY, WORD, MajorVersion, 8, 2, 2); - TEST_FIELD(IMAGE_EXPORT_DIRECTORY, WORD, MinorVersion, 10, 2, 2); - TEST_FIELD(IMAGE_EXPORT_DIRECTORY, DWORD, Name, 12, 4, 4); - TEST_FIELD(IMAGE_EXPORT_DIRECTORY, DWORD, Base, 16, 4, 4); - TEST_FIELD(IMAGE_EXPORT_DIRECTORY, DWORD, NumberOfFunctions, 20, 4, 4); - TEST_FIELD(IMAGE_EXPORT_DIRECTORY, DWORD, NumberOfNames, 24, 4, 4); - TEST_FIELD(IMAGE_EXPORT_DIRECTORY, DWORD, AddressOfFunctions, 28, 4, 4); - TEST_FIELD(IMAGE_EXPORT_DIRECTORY, DWORD, AddressOfNames, 32, 4, 4); - TEST_FIELD(IMAGE_EXPORT_DIRECTORY, DWORD, AddressOfNameOrdinals, 36, 4, 4); + TEST_TYPE_SIZE (IMAGE_EXPORT_DIRECTORY, 40) + TEST_TYPE_ALIGN (IMAGE_EXPORT_DIRECTORY, 4) + TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, Characteristics, 4) + TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, Characteristics, 4) + TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, Characteristics, 0) + TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, TimeDateStamp, 4) + TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, TimeDateStamp, 4) + TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, TimeDateStamp, 4) + TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, MajorVersion, 2) + TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, MajorVersion, 2) + TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, MajorVersion, 8) + TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, MinorVersion, 2) + TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, MinorVersion, 2) + TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, MinorVersion, 10) + TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, Name, 4) + TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, Name, 4) + TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, Name, 12) + TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, Base, 4) + TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, Base, 4) + TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, Base, 16) + TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, NumberOfFunctions, 4) + TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, NumberOfFunctions, 4) + TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, NumberOfFunctions, 20) + TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, NumberOfNames, 4) + TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, NumberOfNames, 4) + TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, NumberOfNames, 24) + TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, AddressOfFunctions, 4) + TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, AddressOfFunctions, 4) + TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, AddressOfFunctions, 28) + TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, AddressOfNames, 4) + TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, AddressOfNames, 4) + TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, AddressOfNames, 32) + TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, AddressOfNameOrdinals, 4) + TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, AddressOfNameOrdinals, 4) + TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, AddressOfNameOrdinals, 36) } static void test_pack_IMAGE_FILE_HEADER(void) { /* IMAGE_FILE_HEADER (pack 4) */ - TEST_TYPE(IMAGE_FILE_HEADER, 20, 4); - TEST_FIELD(IMAGE_FILE_HEADER, WORD, Machine, 0, 2, 2); - TEST_FIELD(IMAGE_FILE_HEADER, WORD, NumberOfSections, 2, 2, 2); - TEST_FIELD(IMAGE_FILE_HEADER, DWORD, TimeDateStamp, 4, 4, 4); - TEST_FIELD(IMAGE_FILE_HEADER, DWORD, PointerToSymbolTable, 8, 4, 4); - TEST_FIELD(IMAGE_FILE_HEADER, DWORD, NumberOfSymbols, 12, 4, 4); - TEST_FIELD(IMAGE_FILE_HEADER, WORD, SizeOfOptionalHeader, 16, 2, 2); - TEST_FIELD(IMAGE_FILE_HEADER, WORD, Characteristics, 18, 2, 2); + TEST_TYPE_SIZE (IMAGE_FILE_HEADER, 20) + TEST_TYPE_ALIGN (IMAGE_FILE_HEADER, 4) + TEST_FIELD_SIZE (IMAGE_FILE_HEADER, Machine, 2) + TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, Machine, 2) + TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, Machine, 0) + TEST_FIELD_SIZE (IMAGE_FILE_HEADER, NumberOfSections, 2) + TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, NumberOfSections, 2) + TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, NumberOfSections, 2) + TEST_FIELD_SIZE (IMAGE_FILE_HEADER, TimeDateStamp, 4) + TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, TimeDateStamp, 4) + TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, TimeDateStamp, 4) + TEST_FIELD_SIZE (IMAGE_FILE_HEADER, PointerToSymbolTable, 4) + TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, PointerToSymbolTable, 4) + TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, PointerToSymbolTable, 8) + TEST_FIELD_SIZE (IMAGE_FILE_HEADER, NumberOfSymbols, 4) + TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, NumberOfSymbols, 4) + TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, NumberOfSymbols, 12) + TEST_FIELD_SIZE (IMAGE_FILE_HEADER, SizeOfOptionalHeader, 2) + TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, SizeOfOptionalHeader, 2) + TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, SizeOfOptionalHeader, 16) + TEST_FIELD_SIZE (IMAGE_FILE_HEADER, Characteristics, 2) + TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, Characteristics, 2) + TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, Characteristics, 18) } static void test_pack_IMAGE_FUNCTION_ENTRY(void) { /* IMAGE_FUNCTION_ENTRY (pack 4) */ - TEST_TYPE(IMAGE_FUNCTION_ENTRY, 12, 4); - TEST_FIELD(IMAGE_FUNCTION_ENTRY, DWORD, StartingAddress, 0, 4, 4); - TEST_FIELD(IMAGE_FUNCTION_ENTRY, DWORD, EndingAddress, 4, 4, 4); - TEST_FIELD(IMAGE_FUNCTION_ENTRY, DWORD, EndOfPrologue, 8, 4, 4); + TEST_TYPE_SIZE (IMAGE_FUNCTION_ENTRY, 12) + TEST_TYPE_ALIGN (IMAGE_FUNCTION_ENTRY, 4) + TEST_FIELD_SIZE (IMAGE_FUNCTION_ENTRY, StartingAddress, 4) + TEST_FIELD_ALIGN (IMAGE_FUNCTION_ENTRY, StartingAddress, 4) + TEST_FIELD_OFFSET(IMAGE_FUNCTION_ENTRY, StartingAddress, 0) + TEST_FIELD_SIZE (IMAGE_FUNCTION_ENTRY, EndingAddress, 4) + TEST_FIELD_ALIGN (IMAGE_FUNCTION_ENTRY, EndingAddress, 4) + TEST_FIELD_OFFSET(IMAGE_FUNCTION_ENTRY, EndingAddress, 4) + TEST_FIELD_SIZE (IMAGE_FUNCTION_ENTRY, EndOfPrologue, 4) + TEST_FIELD_ALIGN (IMAGE_FUNCTION_ENTRY, EndOfPrologue, 4) + TEST_FIELD_OFFSET(IMAGE_FUNCTION_ENTRY, EndOfPrologue, 8) } static void test_pack_IMAGE_IMPORT_BY_NAME(void) { /* IMAGE_IMPORT_BY_NAME (pack 4) */ - TEST_TYPE(IMAGE_IMPORT_BY_NAME, 4, 2); - TEST_FIELD(IMAGE_IMPORT_BY_NAME, WORD, Hint, 0, 2, 2); - TEST_FIELD(IMAGE_IMPORT_BY_NAME, BYTE[1], Name, 2, 1, 1); + TEST_TYPE_SIZE (IMAGE_IMPORT_BY_NAME, 4) + TEST_TYPE_ALIGN (IMAGE_IMPORT_BY_NAME, 2) + TEST_FIELD_SIZE (IMAGE_IMPORT_BY_NAME, Hint, 2) + TEST_FIELD_ALIGN (IMAGE_IMPORT_BY_NAME, Hint, 2) + TEST_FIELD_OFFSET(IMAGE_IMPORT_BY_NAME, Hint, 0) + TEST_FIELD_SIZE (IMAGE_IMPORT_BY_NAME, Name, 1) + TEST_FIELD_ALIGN (IMAGE_IMPORT_BY_NAME, Name, 1) + TEST_FIELD_OFFSET(IMAGE_IMPORT_BY_NAME, Name, 2) } static void test_pack_IMAGE_IMPORT_DESCRIPTOR(void) @@ -610,69 +885,172 @@ static void test_pack_IMAGE_LINENUMBER(void) static void test_pack_IMAGE_LOAD_CONFIG_DIRECTORY(void) { /* IMAGE_LOAD_CONFIG_DIRECTORY (pack 4) */ - TEST_TYPE(IMAGE_LOAD_CONFIG_DIRECTORY, 72, 4); - TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, DWORD, Size, 0, 4, 4); - TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, DWORD, TimeDateStamp, 4, 4, 4); - TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, WORD, MajorVersion, 8, 2, 2); - TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, WORD, MinorVersion, 10, 2, 2); - TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, DWORD, GlobalFlagsClear, 12, 4, 4); - TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, DWORD, GlobalFlagsSet, 16, 4, 4); - TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, DWORD, CriticalSectionDefaultTimeout, 20, 4, 4); - TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, DWORD, DeCommitFreeBlockThreshold, 24, 4, 4); - TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, DWORD, DeCommitTotalFreeThreshold, 28, 4, 4); - TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, PVOID, LockPrefixTable, 32, 4, 4); - TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, DWORD, MaximumAllocationSize, 36, 4, 4); - TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, DWORD, VirtualMemoryThreshold, 40, 4, 4); - TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, DWORD, ProcessHeapFlags, 44, 4, 4); - TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, DWORD, ProcessAffinityMask, 48, 4, 4); - TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, WORD, CSDVersion, 52, 2, 2); - TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, WORD, Reserved1, 54, 2, 2); - TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, PVOID, EditList, 56, 4, 4); - TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, DWORD, SecurityCookie, 60, 4, 4); - TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, DWORD, SEHandlerTable, 64, 4, 4); - TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, DWORD, SEHandlerCount, 68, 4, 4); + TEST_TYPE_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, 72) + TEST_TYPE_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, 4) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, Size, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, Size, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, Size, 0) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, TimeDateStamp, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, TimeDateStamp, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, TimeDateStamp, 4) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, MajorVersion, 2) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, MajorVersion, 2) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, MajorVersion, 8) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, MinorVersion, 2) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, MinorVersion, 2) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, MinorVersion, 10) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, GlobalFlagsClear, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, GlobalFlagsClear, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, GlobalFlagsClear, 12) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, GlobalFlagsSet, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, GlobalFlagsSet, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, GlobalFlagsSet, 16) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, CriticalSectionDefaultTimeout, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, CriticalSectionDefaultTimeout, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, CriticalSectionDefaultTimeout, 20) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, DeCommitFreeBlockThreshold, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, DeCommitFreeBlockThreshold, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, DeCommitFreeBlockThreshold, 24) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, DeCommitTotalFreeThreshold, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, DeCommitTotalFreeThreshold, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, DeCommitTotalFreeThreshold, 28) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, LockPrefixTable, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, LockPrefixTable, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, LockPrefixTable, 32) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, MaximumAllocationSize, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, MaximumAllocationSize, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, MaximumAllocationSize, 36) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, VirtualMemoryThreshold, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, VirtualMemoryThreshold, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, VirtualMemoryThreshold, 40) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, ProcessHeapFlags, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, ProcessHeapFlags, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, ProcessHeapFlags, 44) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, ProcessAffinityMask, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, ProcessAffinityMask, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, ProcessAffinityMask, 48) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, CSDVersion, 2) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, CSDVersion, 2) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, CSDVersion, 52) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, Reserved1, 2) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, Reserved1, 2) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, Reserved1, 54) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, EditList, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, EditList, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, EditList, 56) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, SecurityCookie, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, SecurityCookie, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, SecurityCookie, 60) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, SEHandlerTable, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, SEHandlerTable, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, SEHandlerTable, 64) + TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, SEHandlerCount, 4) + TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, SEHandlerCount, 4) + TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY, SEHandlerCount, 68) } static void test_pack_IMAGE_NT_HEADERS(void) { /* IMAGE_NT_HEADERS */ - TEST_TYPE(IMAGE_NT_HEADERS, 248, 4); + TEST_TYPE_SIZE (IMAGE_NT_HEADERS, 248) + TEST_TYPE_ALIGN (IMAGE_NT_HEADERS, 4) } static void test_pack_IMAGE_OS2_HEADER(void) { /* IMAGE_OS2_HEADER (pack 2) */ - TEST_TYPE(IMAGE_OS2_HEADER, 64, 2); - TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_magic, 0, 2, 2); - TEST_FIELD(IMAGE_OS2_HEADER, BYTE, ne_ver, 2, 1, 1); - TEST_FIELD(IMAGE_OS2_HEADER, BYTE, ne_rev, 3, 1, 1); - TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_enttab, 4, 2, 2); - TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_cbenttab, 6, 2, 2); - TEST_FIELD(IMAGE_OS2_HEADER, LONG, ne_crc, 8, 4, 2); - TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_flags, 12, 2, 2); - TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_autodata, 14, 2, 2); - TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_heap, 16, 2, 2); - TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_stack, 18, 2, 2); - TEST_FIELD(IMAGE_OS2_HEADER, DWORD, ne_csip, 20, 4, 2); - TEST_FIELD(IMAGE_OS2_HEADER, DWORD, ne_sssp, 24, 4, 2); - TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_cseg, 28, 2, 2); - TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_cmod, 30, 2, 2); - TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_cbnrestab, 32, 2, 2); - TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_segtab, 34, 2, 2); - TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_rsrctab, 36, 2, 2); - TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_restab, 38, 2, 2); - TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_modtab, 40, 2, 2); - TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_imptab, 42, 2, 2); - TEST_FIELD(IMAGE_OS2_HEADER, DWORD, ne_nrestab, 44, 4, 2); - TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_cmovent, 48, 2, 2); - TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_align, 50, 2, 2); - TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_cres, 52, 2, 2); - TEST_FIELD(IMAGE_OS2_HEADER, BYTE, ne_exetyp, 54, 1, 1); - TEST_FIELD(IMAGE_OS2_HEADER, BYTE, ne_flagsothers, 55, 1, 1); - TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_pretthunks, 56, 2, 2); - TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_psegrefbytes, 58, 2, 2); - TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_swaparea, 60, 2, 2); - TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_expver, 62, 2, 2); + TEST_TYPE_SIZE (IMAGE_OS2_HEADER, 64) + TEST_TYPE_ALIGN (IMAGE_OS2_HEADER, 2) + TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_magic, 2) + TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_magic, 2) + TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_magic, 0) + TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_ver, 1) + TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_ver, 1) + TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_ver, 2) + TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_rev, 1) + TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_rev, 1) + TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_rev, 3) + TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_enttab, 2) + TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_enttab, 2) + TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_enttab, 4) + TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_cbenttab, 2) + TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_cbenttab, 2) + TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_cbenttab, 6) + TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_crc, 4) + TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_crc, 2) + TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_crc, 8) + TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_flags, 2) + TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_flags, 2) + TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_flags, 12) + TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_autodata, 2) + TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_autodata, 2) + TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_autodata, 14) + TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_heap, 2) + TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_heap, 2) + TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_heap, 16) + TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_stack, 2) + TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_stack, 2) + TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_stack, 18) + TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_csip, 4) + TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_csip, 2) + TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_csip, 20) + TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_sssp, 4) + TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_sssp, 2) + TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_sssp, 24) + TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_cseg, 2) + TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_cseg, 2) + TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_cseg, 28) + TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_cmod, 2) + TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_cmod, 2) + TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_cmod, 30) + TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_cbnrestab, 2) + TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_cbnrestab, 2) + TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_cbnrestab, 32) + TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_segtab, 2) + TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_segtab, 2) + TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_segtab, 34) + TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_rsrctab, 2) + TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_rsrctab, 2) + TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_rsrctab, 36) + TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_restab, 2) + TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_restab, 2) + TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_restab, 38) + TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_modtab, 2) + TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_modtab, 2) + TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_modtab, 40) + TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_imptab, 2) + TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_imptab, 2) + TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_imptab, 42) + TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_nrestab, 4) + TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_nrestab, 2) + TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_nrestab, 44) + TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_cmovent, 2) + TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_cmovent, 2) + TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_cmovent, 48) + TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_align, 2) + TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_align, 2) + TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_align, 50) + TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_cres, 2) + TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_cres, 2) + TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_cres, 52) + TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_exetyp, 1) + TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_exetyp, 1) + TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_exetyp, 54) + TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_flagsothers, 1) + TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_flagsothers, 1) + TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_flagsothers, 55) + TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_pretthunks, 2) + TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_pretthunks, 2) + TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_pretthunks, 56) + TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_psegrefbytes, 2) + TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_psegrefbytes, 2) + TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_psegrefbytes, 58) + TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_swaparea, 2) + TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_swaparea, 2) + TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_swaparea, 60) + TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_expver, 2) + TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_expver, 2) + TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_expver, 62) } static void test_pack_IMAGE_RELOCATION(void) @@ -683,23 +1061,45 @@ static void test_pack_IMAGE_RELOCATION(void) static void test_pack_IMAGE_RESOURCE_DATA_ENTRY(void) { /* IMAGE_RESOURCE_DATA_ENTRY (pack 4) */ - TEST_TYPE(IMAGE_RESOURCE_DATA_ENTRY, 16, 4); - TEST_FIELD(IMAGE_RESOURCE_DATA_ENTRY, DWORD, OffsetToData, 0, 4, 4); - TEST_FIELD(IMAGE_RESOURCE_DATA_ENTRY, DWORD, Size, 4, 4, 4); - TEST_FIELD(IMAGE_RESOURCE_DATA_ENTRY, DWORD, CodePage, 8, 4, 4); - TEST_FIELD(IMAGE_RESOURCE_DATA_ENTRY, DWORD, Reserved, 12, 4, 4); + TEST_TYPE_SIZE (IMAGE_RESOURCE_DATA_ENTRY, 16) + TEST_TYPE_ALIGN (IMAGE_RESOURCE_DATA_ENTRY, 4) + TEST_FIELD_SIZE (IMAGE_RESOURCE_DATA_ENTRY, OffsetToData, 4) + TEST_FIELD_ALIGN (IMAGE_RESOURCE_DATA_ENTRY, OffsetToData, 4) + TEST_FIELD_OFFSET(IMAGE_RESOURCE_DATA_ENTRY, OffsetToData, 0) + TEST_FIELD_SIZE (IMAGE_RESOURCE_DATA_ENTRY, Size, 4) + TEST_FIELD_ALIGN (IMAGE_RESOURCE_DATA_ENTRY, Size, 4) + TEST_FIELD_OFFSET(IMAGE_RESOURCE_DATA_ENTRY, Size, 4) + TEST_FIELD_SIZE (IMAGE_RESOURCE_DATA_ENTRY, CodePage, 4) + TEST_FIELD_ALIGN (IMAGE_RESOURCE_DATA_ENTRY, CodePage, 4) + TEST_FIELD_OFFSET(IMAGE_RESOURCE_DATA_ENTRY, CodePage, 8) + TEST_FIELD_SIZE (IMAGE_RESOURCE_DATA_ENTRY, Reserved, 4) + TEST_FIELD_ALIGN (IMAGE_RESOURCE_DATA_ENTRY, Reserved, 4) + TEST_FIELD_OFFSET(IMAGE_RESOURCE_DATA_ENTRY, Reserved, 12) } static void test_pack_IMAGE_RESOURCE_DIRECTORY(void) { /* IMAGE_RESOURCE_DIRECTORY (pack 4) */ - TEST_TYPE(IMAGE_RESOURCE_DIRECTORY, 16, 4); - TEST_FIELD(IMAGE_RESOURCE_DIRECTORY, DWORD, Characteristics, 0, 4, 4); - TEST_FIELD(IMAGE_RESOURCE_DIRECTORY, DWORD, TimeDateStamp, 4, 4, 4); - TEST_FIELD(IMAGE_RESOURCE_DIRECTORY, WORD, MajorVersion, 8, 2, 2); - TEST_FIELD(IMAGE_RESOURCE_DIRECTORY, WORD, MinorVersion, 10, 2, 2); - TEST_FIELD(IMAGE_RESOURCE_DIRECTORY, WORD, NumberOfNamedEntries, 12, 2, 2); - TEST_FIELD(IMAGE_RESOURCE_DIRECTORY, WORD, NumberOfIdEntries, 14, 2, 2); + TEST_TYPE_SIZE (IMAGE_RESOURCE_DIRECTORY, 16) + TEST_TYPE_ALIGN (IMAGE_RESOURCE_DIRECTORY, 4) + TEST_FIELD_SIZE (IMAGE_RESOURCE_DIRECTORY, Characteristics, 4) + TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY, Characteristics, 4) + TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY, Characteristics, 0) + TEST_FIELD_SIZE (IMAGE_RESOURCE_DIRECTORY, TimeDateStamp, 4) + TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY, TimeDateStamp, 4) + TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY, TimeDateStamp, 4) + TEST_FIELD_SIZE (IMAGE_RESOURCE_DIRECTORY, MajorVersion, 2) + TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY, MajorVersion, 2) + TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY, MajorVersion, 8) + TEST_FIELD_SIZE (IMAGE_RESOURCE_DIRECTORY, MinorVersion, 2) + TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY, MinorVersion, 2) + TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY, MinorVersion, 10) + TEST_FIELD_SIZE (IMAGE_RESOURCE_DIRECTORY, NumberOfNamedEntries, 2) + TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY, NumberOfNamedEntries, 2) + TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY, NumberOfNamedEntries, 12) + TEST_FIELD_SIZE (IMAGE_RESOURCE_DIRECTORY, NumberOfIdEntries, 2) + TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY, NumberOfIdEntries, 2) + TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY, NumberOfIdEntries, 14) } static void test_pack_IMAGE_RESOURCE_DIRECTORY_ENTRY(void) @@ -710,42 +1110,81 @@ static void test_pack_IMAGE_RESOURCE_DIRECTORY_ENTRY(void) static void test_pack_IMAGE_RESOURCE_DIRECTORY_STRING(void) { /* IMAGE_RESOURCE_DIRECTORY_STRING (pack 4) */ - TEST_TYPE(IMAGE_RESOURCE_DIRECTORY_STRING, 4, 2); - TEST_FIELD(IMAGE_RESOURCE_DIRECTORY_STRING, WORD, Length, 0, 2, 2); - TEST_FIELD(IMAGE_RESOURCE_DIRECTORY_STRING, CHAR[ 1 ], NameString, 2, 1, 1); + TEST_TYPE_SIZE (IMAGE_RESOURCE_DIRECTORY_STRING, 4) + TEST_TYPE_ALIGN (IMAGE_RESOURCE_DIRECTORY_STRING, 2) + TEST_FIELD_SIZE (IMAGE_RESOURCE_DIRECTORY_STRING, Length, 2) + TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY_STRING, Length, 2) + TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY_STRING, Length, 0) + TEST_FIELD_SIZE (IMAGE_RESOURCE_DIRECTORY_STRING, NameString, 1) + TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY_STRING, NameString, 1) + TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY_STRING, NameString, 2) } static void test_pack_IMAGE_RESOURCE_DIR_STRING_U(void) { /* IMAGE_RESOURCE_DIR_STRING_U (pack 4) */ - TEST_TYPE(IMAGE_RESOURCE_DIR_STRING_U, 4, 2); - TEST_FIELD(IMAGE_RESOURCE_DIR_STRING_U, WORD, Length, 0, 2, 2); - TEST_FIELD(IMAGE_RESOURCE_DIR_STRING_U, WCHAR[ 1 ], NameString, 2, 2, 2); + TEST_TYPE_SIZE (IMAGE_RESOURCE_DIR_STRING_U, 4) + TEST_TYPE_ALIGN (IMAGE_RESOURCE_DIR_STRING_U, 2) + TEST_FIELD_SIZE (IMAGE_RESOURCE_DIR_STRING_U, Length, 2) + TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIR_STRING_U, Length, 2) + TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIR_STRING_U, Length, 0) + TEST_FIELD_SIZE (IMAGE_RESOURCE_DIR_STRING_U, NameString, 2) + TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIR_STRING_U, NameString, 2) + TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIR_STRING_U, NameString, 2) } static void test_pack_IMAGE_SECTION_HEADER(void) { /* IMAGE_SECTION_HEADER (pack 4) */ - TEST_FIELD(IMAGE_SECTION_HEADER, BYTE[IMAGE_SIZEOF_SHORT_NAME], Name, 0, 8, 1); + TEST_FIELD_SIZE (IMAGE_SECTION_HEADER, Name, 8) + TEST_FIELD_ALIGN (IMAGE_SECTION_HEADER, Name, 1) + TEST_FIELD_OFFSET(IMAGE_SECTION_HEADER, Name, 0) } static void test_pack_IMAGE_SEPARATE_DEBUG_HEADER(void) { /* IMAGE_SEPARATE_DEBUG_HEADER (pack 4) */ - TEST_TYPE(IMAGE_SEPARATE_DEBUG_HEADER, 48, 4); - TEST_FIELD(IMAGE_SEPARATE_DEBUG_HEADER, WORD, Signature, 0, 2, 2); - TEST_FIELD(IMAGE_SEPARATE_DEBUG_HEADER, WORD, Flags, 2, 2, 2); - TEST_FIELD(IMAGE_SEPARATE_DEBUG_HEADER, WORD, Machine, 4, 2, 2); - TEST_FIELD(IMAGE_SEPARATE_DEBUG_HEADER, WORD, Characteristics, 6, 2, 2); - TEST_FIELD(IMAGE_SEPARATE_DEBUG_HEADER, DWORD, TimeDateStamp, 8, 4, 4); - TEST_FIELD(IMAGE_SEPARATE_DEBUG_HEADER, DWORD, CheckSum, 12, 4, 4); - TEST_FIELD(IMAGE_SEPARATE_DEBUG_HEADER, DWORD, ImageBase, 16, 4, 4); - TEST_FIELD(IMAGE_SEPARATE_DEBUG_HEADER, DWORD, SizeOfImage, 20, 4, 4); - TEST_FIELD(IMAGE_SEPARATE_DEBUG_HEADER, DWORD, NumberOfSections, 24, 4, 4); - TEST_FIELD(IMAGE_SEPARATE_DEBUG_HEADER, DWORD, ExportedNamesSize, 28, 4, 4); - TEST_FIELD(IMAGE_SEPARATE_DEBUG_HEADER, DWORD, DebugDirectorySize, 32, 4, 4); - TEST_FIELD(IMAGE_SEPARATE_DEBUG_HEADER, DWORD, SectionAlignment, 36, 4, 4); - TEST_FIELD(IMAGE_SEPARATE_DEBUG_HEADER, DWORD[ 2 ], Reserved, 40, 8, 4); + TEST_TYPE_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, 48) + TEST_TYPE_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, 4) + TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, Signature, 2) + TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, Signature, 2) + TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, Signature, 0) + TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, Flags, 2) + TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, Flags, 2) + TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, Flags, 2) + TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, Machine, 2) + TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, Machine, 2) + TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, Machine, 4) + TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, Characteristics, 2) + TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, Characteristics, 2) + TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, Characteristics, 6) + TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, TimeDateStamp, 4) + TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, TimeDateStamp, 4) + TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, TimeDateStamp, 8) + TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, CheckSum, 4) + TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, CheckSum, 4) + TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, CheckSum, 12) + TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, ImageBase, 4) + TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, ImageBase, 4) + TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, ImageBase, 16) + TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, SizeOfImage, 4) + TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, SizeOfImage, 4) + TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, SizeOfImage, 20) + TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, NumberOfSections, 4) + TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, NumberOfSections, 4) + TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, NumberOfSections, 24) + TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, ExportedNamesSize, 4) + TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, ExportedNamesSize, 4) + TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, ExportedNamesSize, 28) + TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, DebugDirectorySize, 4) + TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, DebugDirectorySize, 4) + TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, DebugDirectorySize, 32) + TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, SectionAlignment, 4) + TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, SectionAlignment, 4) + TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, SectionAlignment, 36) + TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, Reserved, 8) + TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, Reserved, 4) + TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, Reserved, 40) } static void test_pack_IMAGE_SYMBOL(void) @@ -761,83 +1200,201 @@ static void test_pack_IMAGE_THUNK_DATA(void) static void test_pack_IMAGE_TLS_DIRECTORY(void) { /* IMAGE_TLS_DIRECTORY */ - TEST_TYPE(IMAGE_TLS_DIRECTORY, 24, 4); + TEST_TYPE_SIZE (IMAGE_TLS_DIRECTORY, 24) + TEST_TYPE_ALIGN (IMAGE_TLS_DIRECTORY, 4) } static void test_pack_IMAGE_VXD_HEADER(void) { /* IMAGE_VXD_HEADER (pack 2) */ - TEST_TYPE(IMAGE_VXD_HEADER, 196, 2); - TEST_FIELD(IMAGE_VXD_HEADER, WORD, e32_magic, 0, 2, 2); - TEST_FIELD(IMAGE_VXD_HEADER, BYTE, e32_border, 2, 1, 1); - TEST_FIELD(IMAGE_VXD_HEADER, BYTE, e32_worder, 3, 1, 1); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_level, 4, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, WORD, e32_cpu, 8, 2, 2); - TEST_FIELD(IMAGE_VXD_HEADER, WORD, e32_os, 10, 2, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_ver, 12, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_mflags, 16, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_mpages, 20, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_startobj, 24, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_eip, 28, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_stackobj, 32, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_esp, 36, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_pagesize, 40, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_lastpagesize, 44, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_fixupsize, 48, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_fixupsum, 52, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_ldrsize, 56, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_ldrsum, 60, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_objtab, 64, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_objcnt, 68, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_objmap, 72, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_itermap, 76, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_rsrctab, 80, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_rsrccnt, 84, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_restab, 88, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_enttab, 92, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_dirtab, 96, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_dircnt, 100, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_fpagetab, 104, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_frectab, 108, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_impmod, 112, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_impmodcnt, 116, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_impproc, 120, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_pagesum, 124, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_datapage, 128, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_preload, 132, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_nrestab, 136, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_cbnrestab, 140, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_nressum, 144, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_autodata, 148, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_debuginfo, 152, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_debuglen, 156, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_instpreload, 160, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_instdemand, 164, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_heapsize, 168, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, BYTE[12], e32_res3, 172, 12, 1); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_winresoff, 184, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_winreslen, 188, 4, 2); - TEST_FIELD(IMAGE_VXD_HEADER, WORD, e32_devid, 192, 2, 2); - TEST_FIELD(IMAGE_VXD_HEADER, WORD, e32_ddkver, 194, 2, 2); + TEST_TYPE_SIZE (IMAGE_VXD_HEADER, 196) + TEST_TYPE_ALIGN (IMAGE_VXD_HEADER, 2) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_magic, 2) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_magic, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_magic, 0) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_border, 1) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_border, 1) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_border, 2) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_worder, 1) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_worder, 1) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_worder, 3) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_level, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_level, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_level, 4) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_cpu, 2) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_cpu, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_cpu, 8) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_os, 2) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_os, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_os, 10) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_ver, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_ver, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_ver, 12) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_mflags, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_mflags, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_mflags, 16) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_mpages, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_mpages, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_mpages, 20) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_startobj, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_startobj, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_startobj, 24) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_eip, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_eip, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_eip, 28) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_stackobj, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_stackobj, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_stackobj, 32) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_esp, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_esp, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_esp, 36) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_pagesize, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_pagesize, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_pagesize, 40) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_lastpagesize, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_lastpagesize, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_lastpagesize, 44) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_fixupsize, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_fixupsize, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_fixupsize, 48) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_fixupsum, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_fixupsum, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_fixupsum, 52) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_ldrsize, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_ldrsize, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_ldrsize, 56) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_ldrsum, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_ldrsum, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_ldrsum, 60) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_objtab, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_objtab, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_objtab, 64) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_objcnt, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_objcnt, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_objcnt, 68) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_objmap, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_objmap, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_objmap, 72) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_itermap, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_itermap, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_itermap, 76) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_rsrctab, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_rsrctab, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_rsrctab, 80) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_rsrccnt, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_rsrccnt, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_rsrccnt, 84) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_restab, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_restab, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_restab, 88) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_enttab, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_enttab, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_enttab, 92) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_dirtab, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_dirtab, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_dirtab, 96) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_dircnt, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_dircnt, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_dircnt, 100) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_fpagetab, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_fpagetab, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_fpagetab, 104) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_frectab, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_frectab, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_frectab, 108) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_impmod, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_impmod, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_impmod, 112) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_impmodcnt, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_impmodcnt, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_impmodcnt, 116) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_impproc, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_impproc, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_impproc, 120) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_pagesum, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_pagesum, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_pagesum, 124) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_datapage, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_datapage, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_datapage, 128) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_preload, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_preload, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_preload, 132) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_nrestab, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_nrestab, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_nrestab, 136) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_cbnrestab, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_cbnrestab, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_cbnrestab, 140) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_nressum, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_nressum, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_nressum, 144) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_autodata, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_autodata, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_autodata, 148) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_debuginfo, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_debuginfo, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_debuginfo, 152) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_debuglen, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_debuglen, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_debuglen, 156) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_instpreload, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_instpreload, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_instpreload, 160) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_instdemand, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_instdemand, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_instdemand, 164) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_heapsize, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_heapsize, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_heapsize, 168) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_res3, 12) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_res3, 1) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_res3, 172) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_winresoff, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_winresoff, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_winresoff, 184) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_winreslen, 4) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_winreslen, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_winreslen, 188) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_devid, 2) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_devid, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_devid, 192) + TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_ddkver, 2) + TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_ddkver, 2) + TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_ddkver, 194) } static void test_pack_IO_COUNTERS(void) { /* IO_COUNTERS (pack 8) */ - TEST_TYPE(IO_COUNTERS, 48, 8); - TEST_FIELD(IO_COUNTERS, ULONGLONG, ReadOperationCount, 0, 8, 8); - TEST_FIELD(IO_COUNTERS, ULONGLONG, WriteOperationCount, 8, 8, 8); - TEST_FIELD(IO_COUNTERS, ULONGLONG, OtherOperationCount, 16, 8, 8); - TEST_FIELD(IO_COUNTERS, ULONGLONG, ReadTransferCount, 24, 8, 8); - TEST_FIELD(IO_COUNTERS, ULONGLONG, WriteTransferCount, 32, 8, 8); - TEST_FIELD(IO_COUNTERS, ULONGLONG, OtherTransferCount, 40, 8, 8); + TEST_TYPE_SIZE (IO_COUNTERS, 48) + TEST_TYPE_ALIGN (IO_COUNTERS, 8) + TEST_FIELD_SIZE (IO_COUNTERS, ReadOperationCount, 8) + TEST_FIELD_ALIGN (IO_COUNTERS, ReadOperationCount, 8) + TEST_FIELD_OFFSET(IO_COUNTERS, ReadOperationCount, 0) + TEST_FIELD_SIZE (IO_COUNTERS, WriteOperationCount, 8) + TEST_FIELD_ALIGN (IO_COUNTERS, WriteOperationCount, 8) + TEST_FIELD_OFFSET(IO_COUNTERS, WriteOperationCount, 8) + TEST_FIELD_SIZE (IO_COUNTERS, OtherOperationCount, 8) + TEST_FIELD_ALIGN (IO_COUNTERS, OtherOperationCount, 8) + TEST_FIELD_OFFSET(IO_COUNTERS, OtherOperationCount, 16) + TEST_FIELD_SIZE (IO_COUNTERS, ReadTransferCount, 8) + TEST_FIELD_ALIGN (IO_COUNTERS, ReadTransferCount, 8) + TEST_FIELD_OFFSET(IO_COUNTERS, ReadTransferCount, 24) + TEST_FIELD_SIZE (IO_COUNTERS, WriteTransferCount, 8) + TEST_FIELD_ALIGN (IO_COUNTERS, WriteTransferCount, 8) + TEST_FIELD_OFFSET(IO_COUNTERS, WriteTransferCount, 32) + TEST_FIELD_SIZE (IO_COUNTERS, OtherTransferCount, 8) + TEST_FIELD_ALIGN (IO_COUNTERS, OtherTransferCount, 8) + TEST_FIELD_OFFSET(IO_COUNTERS, OtherTransferCount, 40) } static void test_pack_LANGID(void) { /* LANGID */ - TEST_TYPE(LANGID, 2, 2); - TEST_TYPE_UNSIGNED(LANGID); + TEST_TYPE_SIZE (LANGID, 2) + TEST_TYPE_ALIGN (LANGID, 2) + TEST_TYPE_UNSIGNED(LANGID) } static void test_pack_LARGE_INTEGER(void) @@ -848,955 +1405,1361 @@ static void test_pack_LARGE_INTEGER(void) static void test_pack_LCID(void) { /* LCID */ - TEST_TYPE(LCID, 4, 4); - TEST_TYPE_UNSIGNED(LCID); + TEST_TYPE_SIZE (LCID, 4) + TEST_TYPE_ALIGN (LCID, 4) + TEST_TYPE_UNSIGNED(LCID) } static void test_pack_LIST_ENTRY(void) { /* LIST_ENTRY (pack 4) */ - TEST_TYPE(LIST_ENTRY, 8, 4); - TEST_FIELD(LIST_ENTRY, struct _LIST_ENTRY *, Flink, 0, 4, 4); - TEST_FIELD(LIST_ENTRY, struct _LIST_ENTRY *, Blink, 4, 4, 4); + TEST_TYPE_SIZE (LIST_ENTRY, 8) + TEST_TYPE_ALIGN (LIST_ENTRY, 4) + TEST_FIELD_SIZE (LIST_ENTRY, Flink, 4) + TEST_FIELD_ALIGN (LIST_ENTRY, Flink, 4) + TEST_FIELD_OFFSET(LIST_ENTRY, Flink, 0) + TEST_FIELD_SIZE (LIST_ENTRY, Blink, 4) + TEST_FIELD_ALIGN (LIST_ENTRY, Blink, 4) + TEST_FIELD_OFFSET(LIST_ENTRY, Blink, 4) } static void test_pack_LONG(void) { /* LONG */ - TEST_TYPE(LONG, 4, 4); - TEST_TYPE_SIGNED(LONG); + TEST_TYPE_SIZE (LONG, 4) + TEST_TYPE_ALIGN (LONG, 4) + TEST_TYPE_SIGNED(LONG) } static void test_pack_LONGLONG(void) { /* LONGLONG */ - TEST_TYPE(LONGLONG, 8, 8); - TEST_TYPE_SIGNED(LONGLONG); + TEST_TYPE_SIZE (LONGLONG, 8) + TEST_TYPE_ALIGN (LONGLONG, 8) + TEST_TYPE_SIGNED(LONGLONG) } static void test_pack_LUID(void) { /* LUID (pack 4) */ - TEST_TYPE(LUID, 8, 4); - TEST_FIELD(LUID, DWORD, LowPart, 0, 4, 4); - TEST_FIELD(LUID, LONG, HighPart, 4, 4, 4); + TEST_TYPE_SIZE (LUID, 8) + TEST_TYPE_ALIGN (LUID, 4) + TEST_FIELD_SIZE (LUID, LowPart, 4) + TEST_FIELD_ALIGN (LUID, LowPart, 4) + TEST_FIELD_OFFSET(LUID, LowPart, 0) + TEST_FIELD_SIZE (LUID, HighPart, 4) + TEST_FIELD_ALIGN (LUID, HighPart, 4) + TEST_FIELD_OFFSET(LUID, HighPart, 4) } static void test_pack_LUID_AND_ATTRIBUTES(void) { /* LUID_AND_ATTRIBUTES (pack 4) */ - TEST_TYPE(LUID_AND_ATTRIBUTES, 12, 4); - TEST_FIELD(LUID_AND_ATTRIBUTES, LUID, Luid, 0, 8, 4); - TEST_FIELD(LUID_AND_ATTRIBUTES, DWORD, Attributes, 8, 4, 4); + TEST_TYPE_SIZE (LUID_AND_ATTRIBUTES, 12) + TEST_TYPE_ALIGN (LUID_AND_ATTRIBUTES, 4) + TEST_FIELD_SIZE (LUID_AND_ATTRIBUTES, Luid, 8) + TEST_FIELD_ALIGN (LUID_AND_ATTRIBUTES, Luid, 4) + TEST_FIELD_OFFSET(LUID_AND_ATTRIBUTES, Luid, 0) + TEST_FIELD_SIZE (LUID_AND_ATTRIBUTES, Attributes, 4) + TEST_FIELD_ALIGN (LUID_AND_ATTRIBUTES, Attributes, 4) + TEST_FIELD_OFFSET(LUID_AND_ATTRIBUTES, Attributes, 8) } static void test_pack_MEMORY_BASIC_INFORMATION(void) { /* MEMORY_BASIC_INFORMATION (pack 4) */ - TEST_TYPE(MEMORY_BASIC_INFORMATION, 28, 4); - TEST_FIELD(MEMORY_BASIC_INFORMATION, LPVOID, BaseAddress, 0, 4, 4); - TEST_FIELD(MEMORY_BASIC_INFORMATION, LPVOID, AllocationBase, 4, 4, 4); - TEST_FIELD(MEMORY_BASIC_INFORMATION, DWORD, AllocationProtect, 8, 4, 4); - TEST_FIELD(MEMORY_BASIC_INFORMATION, SIZE_T, RegionSize, 12, 4, 4); - TEST_FIELD(MEMORY_BASIC_INFORMATION, DWORD, State, 16, 4, 4); - TEST_FIELD(MEMORY_BASIC_INFORMATION, DWORD, Protect, 20, 4, 4); - TEST_FIELD(MEMORY_BASIC_INFORMATION, DWORD, Type, 24, 4, 4); + TEST_TYPE_SIZE (MEMORY_BASIC_INFORMATION, 28) + TEST_TYPE_ALIGN (MEMORY_BASIC_INFORMATION, 4) + TEST_FIELD_SIZE (MEMORY_BASIC_INFORMATION, BaseAddress, 4) + TEST_FIELD_ALIGN (MEMORY_BASIC_INFORMATION, BaseAddress, 4) + TEST_FIELD_OFFSET(MEMORY_BASIC_INFORMATION, BaseAddress, 0) + TEST_FIELD_SIZE (MEMORY_BASIC_INFORMATION, AllocationBase, 4) + TEST_FIELD_ALIGN (MEMORY_BASIC_INFORMATION, AllocationBase, 4) + TEST_FIELD_OFFSET(MEMORY_BASIC_INFORMATION, AllocationBase, 4) + TEST_FIELD_SIZE (MEMORY_BASIC_INFORMATION, AllocationProtect, 4) + TEST_FIELD_ALIGN (MEMORY_BASIC_INFORMATION, AllocationProtect, 4) + TEST_FIELD_OFFSET(MEMORY_BASIC_INFORMATION, AllocationProtect, 8) + TEST_FIELD_SIZE (MEMORY_BASIC_INFORMATION, RegionSize, 4) + TEST_FIELD_ALIGN (MEMORY_BASIC_INFORMATION, RegionSize, 4) + TEST_FIELD_OFFSET(MEMORY_BASIC_INFORMATION, RegionSize, 12) + TEST_FIELD_SIZE (MEMORY_BASIC_INFORMATION, State, 4) + TEST_FIELD_ALIGN (MEMORY_BASIC_INFORMATION, State, 4) + TEST_FIELD_OFFSET(MEMORY_BASIC_INFORMATION, State, 16) + TEST_FIELD_SIZE (MEMORY_BASIC_INFORMATION, Protect, 4) + TEST_FIELD_ALIGN (MEMORY_BASIC_INFORMATION, Protect, 4) + TEST_FIELD_OFFSET(MEMORY_BASIC_INFORMATION, Protect, 20) + TEST_FIELD_SIZE (MEMORY_BASIC_INFORMATION, Type, 4) + TEST_FIELD_ALIGN (MEMORY_BASIC_INFORMATION, Type, 4) + TEST_FIELD_OFFSET(MEMORY_BASIC_INFORMATION, Type, 24) } static void test_pack_MESSAGE_RESOURCE_BLOCK(void) { /* MESSAGE_RESOURCE_BLOCK (pack 4) */ - TEST_TYPE(MESSAGE_RESOURCE_BLOCK, 12, 4); - TEST_FIELD(MESSAGE_RESOURCE_BLOCK, DWORD, LowId, 0, 4, 4); - TEST_FIELD(MESSAGE_RESOURCE_BLOCK, DWORD, HighId, 4, 4, 4); - TEST_FIELD(MESSAGE_RESOURCE_BLOCK, DWORD, OffsetToEntries, 8, 4, 4); + TEST_TYPE_SIZE (MESSAGE_RESOURCE_BLOCK, 12) + TEST_TYPE_ALIGN (MESSAGE_RESOURCE_BLOCK, 4) + TEST_FIELD_SIZE (MESSAGE_RESOURCE_BLOCK, LowId, 4) + TEST_FIELD_ALIGN (MESSAGE_RESOURCE_BLOCK, LowId, 4) + TEST_FIELD_OFFSET(MESSAGE_RESOURCE_BLOCK, LowId, 0) + TEST_FIELD_SIZE (MESSAGE_RESOURCE_BLOCK, HighId, 4) + TEST_FIELD_ALIGN (MESSAGE_RESOURCE_BLOCK, HighId, 4) + TEST_FIELD_OFFSET(MESSAGE_RESOURCE_BLOCK, HighId, 4) + TEST_FIELD_SIZE (MESSAGE_RESOURCE_BLOCK, OffsetToEntries, 4) + TEST_FIELD_ALIGN (MESSAGE_RESOURCE_BLOCK, OffsetToEntries, 4) + TEST_FIELD_OFFSET(MESSAGE_RESOURCE_BLOCK, OffsetToEntries, 8) } static void test_pack_MESSAGE_RESOURCE_DATA(void) { /* MESSAGE_RESOURCE_DATA (pack 4) */ - TEST_TYPE(MESSAGE_RESOURCE_DATA, 16, 4); - TEST_FIELD(MESSAGE_RESOURCE_DATA, DWORD, NumberOfBlocks, 0, 4, 4); - TEST_FIELD(MESSAGE_RESOURCE_DATA, MESSAGE_RESOURCE_BLOCK[ 1 ], Blocks, 4, 12, 4); + TEST_TYPE_SIZE (MESSAGE_RESOURCE_DATA, 16) + TEST_TYPE_ALIGN (MESSAGE_RESOURCE_DATA, 4) + TEST_FIELD_SIZE (MESSAGE_RESOURCE_DATA, NumberOfBlocks, 4) + TEST_FIELD_ALIGN (MESSAGE_RESOURCE_DATA, NumberOfBlocks, 4) + TEST_FIELD_OFFSET(MESSAGE_RESOURCE_DATA, NumberOfBlocks, 0) + TEST_FIELD_SIZE (MESSAGE_RESOURCE_DATA, Blocks, 12) + TEST_FIELD_ALIGN (MESSAGE_RESOURCE_DATA, Blocks, 4) + TEST_FIELD_OFFSET(MESSAGE_RESOURCE_DATA, Blocks, 4) } static void test_pack_MESSAGE_RESOURCE_ENTRY(void) { /* MESSAGE_RESOURCE_ENTRY (pack 4) */ - TEST_TYPE(MESSAGE_RESOURCE_ENTRY, 6, 2); - TEST_FIELD(MESSAGE_RESOURCE_ENTRY, WORD, Length, 0, 2, 2); - TEST_FIELD(MESSAGE_RESOURCE_ENTRY, WORD, Flags, 2, 2, 2); - TEST_FIELD(MESSAGE_RESOURCE_ENTRY, BYTE[1], Text, 4, 1, 1); + TEST_TYPE_SIZE (MESSAGE_RESOURCE_ENTRY, 6) + TEST_TYPE_ALIGN (MESSAGE_RESOURCE_ENTRY, 2) + TEST_FIELD_SIZE (MESSAGE_RESOURCE_ENTRY, Length, 2) + TEST_FIELD_ALIGN (MESSAGE_RESOURCE_ENTRY, Length, 2) + TEST_FIELD_OFFSET(MESSAGE_RESOURCE_ENTRY, Length, 0) + TEST_FIELD_SIZE (MESSAGE_RESOURCE_ENTRY, Flags, 2) + TEST_FIELD_ALIGN (MESSAGE_RESOURCE_ENTRY, Flags, 2) + TEST_FIELD_OFFSET(MESSAGE_RESOURCE_ENTRY, Flags, 2) + TEST_FIELD_SIZE (MESSAGE_RESOURCE_ENTRY, Text, 1) + TEST_FIELD_ALIGN (MESSAGE_RESOURCE_ENTRY, Text, 1) + TEST_FIELD_OFFSET(MESSAGE_RESOURCE_ENTRY, Text, 4) } static void test_pack_NT_TIB(void) { /* NT_TIB (pack 4) */ - TEST_FIELD(NT_TIB, struct _EXCEPTION_REGISTRATION_RECORD *, ExceptionList, 0, 4, 4); - TEST_FIELD(NT_TIB, PVOID, StackBase, 4, 4, 4); - TEST_FIELD(NT_TIB, PVOID, StackLimit, 8, 4, 4); - TEST_FIELD(NT_TIB, PVOID, SubSystemTib, 12, 4, 4); + TEST_FIELD_SIZE (NT_TIB, ExceptionList, 4) + TEST_FIELD_ALIGN (NT_TIB, ExceptionList, 4) + TEST_FIELD_OFFSET(NT_TIB, ExceptionList, 0) + TEST_FIELD_SIZE (NT_TIB, StackBase, 4) + TEST_FIELD_ALIGN (NT_TIB, StackBase, 4) + TEST_FIELD_OFFSET(NT_TIB, StackBase, 4) + TEST_FIELD_SIZE (NT_TIB, StackLimit, 4) + TEST_FIELD_ALIGN (NT_TIB, StackLimit, 4) + TEST_FIELD_OFFSET(NT_TIB, StackLimit, 8) + TEST_FIELD_SIZE (NT_TIB, SubSystemTib, 4) + TEST_FIELD_ALIGN (NT_TIB, SubSystemTib, 4) + TEST_FIELD_OFFSET(NT_TIB, SubSystemTib, 12) } static void test_pack_OBJECT_TYPE_LIST(void) { /* OBJECT_TYPE_LIST (pack 4) */ - TEST_TYPE(OBJECT_TYPE_LIST, 8, 4); - TEST_FIELD(OBJECT_TYPE_LIST, WORD, Level, 0, 2, 2); - TEST_FIELD(OBJECT_TYPE_LIST, WORD, Sbz, 2, 2, 2); - TEST_FIELD(OBJECT_TYPE_LIST, GUID *, ObjectType, 4, 4, 4); + TEST_TYPE_SIZE (OBJECT_TYPE_LIST, 8) + TEST_TYPE_ALIGN (OBJECT_TYPE_LIST, 4) + TEST_FIELD_SIZE (OBJECT_TYPE_LIST, Level, 2) + TEST_FIELD_ALIGN (OBJECT_TYPE_LIST, Level, 2) + TEST_FIELD_OFFSET(OBJECT_TYPE_LIST, Level, 0) + TEST_FIELD_SIZE (OBJECT_TYPE_LIST, Sbz, 2) + TEST_FIELD_ALIGN (OBJECT_TYPE_LIST, Sbz, 2) + TEST_FIELD_OFFSET(OBJECT_TYPE_LIST, Sbz, 2) + TEST_FIELD_SIZE (OBJECT_TYPE_LIST, ObjectType, 4) + TEST_FIELD_ALIGN (OBJECT_TYPE_LIST, ObjectType, 4) + TEST_FIELD_OFFSET(OBJECT_TYPE_LIST, ObjectType, 4) } static void test_pack_PACCESS_ALLOWED_ACE(void) { /* PACCESS_ALLOWED_ACE */ - TEST_TYPE(PACCESS_ALLOWED_ACE, 4, 4); - TEST_TYPE_POINTER(PACCESS_ALLOWED_ACE, 12, 4); + TEST_TYPE_SIZE (PACCESS_ALLOWED_ACE, 4) + TEST_TYPE_ALIGN (PACCESS_ALLOWED_ACE, 4) + TEST_TARGET_SIZE (PACCESS_ALLOWED_ACE, 12) + TEST_TARGET_ALIGN(PACCESS_ALLOWED_ACE, 4) } static void test_pack_PACCESS_DENIED_ACE(void) { /* PACCESS_DENIED_ACE */ - TEST_TYPE(PACCESS_DENIED_ACE, 4, 4); - TEST_TYPE_POINTER(PACCESS_DENIED_ACE, 12, 4); + TEST_TYPE_SIZE (PACCESS_DENIED_ACE, 4) + TEST_TYPE_ALIGN (PACCESS_DENIED_ACE, 4) + TEST_TARGET_SIZE (PACCESS_DENIED_ACE, 12) + TEST_TARGET_ALIGN(PACCESS_DENIED_ACE, 4) } static void test_pack_PACCESS_TOKEN(void) { /* PACCESS_TOKEN */ - TEST_TYPE(PACCESS_TOKEN, 4, 4); + TEST_TYPE_SIZE (PACCESS_TOKEN, 4) + TEST_TYPE_ALIGN (PACCESS_TOKEN, 4) } static void test_pack_PACE_HEADER(void) { /* PACE_HEADER */ - TEST_TYPE(PACE_HEADER, 4, 4); - TEST_TYPE_POINTER(PACE_HEADER, 4, 2); + TEST_TYPE_SIZE (PACE_HEADER, 4) + TEST_TYPE_ALIGN (PACE_HEADER, 4) + TEST_TARGET_SIZE (PACE_HEADER, 4) + TEST_TARGET_ALIGN(PACE_HEADER, 2) } static void test_pack_PACL(void) { /* PACL */ - TEST_TYPE(PACL, 4, 4); - TEST_TYPE_POINTER(PACL, 8, 2); + TEST_TYPE_SIZE (PACL, 4) + TEST_TYPE_ALIGN (PACL, 4) + TEST_TARGET_SIZE (PACL, 8) + TEST_TARGET_ALIGN(PACL, 2) } static void test_pack_PACL_REVISION_INFORMATION(void) { /* PACL_REVISION_INFORMATION */ - TEST_TYPE(PACL_REVISION_INFORMATION, 4, 4); - TEST_TYPE_POINTER(PACL_REVISION_INFORMATION, 4, 4); + TEST_TYPE_SIZE (PACL_REVISION_INFORMATION, 4) + TEST_TYPE_ALIGN (PACL_REVISION_INFORMATION, 4) + TEST_TARGET_SIZE (PACL_REVISION_INFORMATION, 4) + TEST_TARGET_ALIGN(PACL_REVISION_INFORMATION, 4) } static void test_pack_PACL_SIZE_INFORMATION(void) { /* PACL_SIZE_INFORMATION */ - TEST_TYPE(PACL_SIZE_INFORMATION, 4, 4); - TEST_TYPE_POINTER(PACL_SIZE_INFORMATION, 12, 4); + TEST_TYPE_SIZE (PACL_SIZE_INFORMATION, 4) + TEST_TYPE_ALIGN (PACL_SIZE_INFORMATION, 4) + TEST_TARGET_SIZE (PACL_SIZE_INFORMATION, 12) + TEST_TARGET_ALIGN(PACL_SIZE_INFORMATION, 4) } static void test_pack_PCCH(void) { /* PCCH */ - TEST_TYPE(PCCH, 4, 4); - TEST_TYPE_POINTER(PCCH, 1, 1); + TEST_TYPE_SIZE (PCCH, 4) + TEST_TYPE_ALIGN (PCCH, 4) + TEST_TARGET_SIZE (PCCH, 1) + TEST_TARGET_ALIGN(PCCH, 1) } static void test_pack_PCH(void) { /* PCH */ - TEST_TYPE(PCH, 4, 4); - TEST_TYPE_POINTER(PCH, 1, 1); + TEST_TYPE_SIZE (PCH, 4) + TEST_TYPE_ALIGN (PCH, 4) + TEST_TARGET_SIZE (PCH, 1) + TEST_TARGET_ALIGN(PCH, 1) } static void test_pack_PCSTR(void) { /* PCSTR */ - TEST_TYPE(PCSTR, 4, 4); - TEST_TYPE_POINTER(PCSTR, 1, 1); + TEST_TYPE_SIZE (PCSTR, 4) + TEST_TYPE_ALIGN (PCSTR, 4) + TEST_TARGET_SIZE (PCSTR, 1) + TEST_TARGET_ALIGN(PCSTR, 1) } static void test_pack_PCTSTR(void) { /* PCTSTR */ - TEST_TYPE(PCTSTR, 4, 4); + TEST_TYPE_SIZE (PCTSTR, 4) + TEST_TYPE_ALIGN (PCTSTR, 4) } static void test_pack_PCWCH(void) { /* PCWCH */ - TEST_TYPE(PCWCH, 4, 4); - TEST_TYPE_POINTER(PCWCH, 2, 2); + TEST_TYPE_SIZE (PCWCH, 4) + TEST_TYPE_ALIGN (PCWCH, 4) + TEST_TARGET_SIZE (PCWCH, 2) + TEST_TARGET_ALIGN(PCWCH, 2) } static void test_pack_PCWSTR(void) { /* PCWSTR */ - TEST_TYPE(PCWSTR, 4, 4); - TEST_TYPE_POINTER(PCWSTR, 2, 2); + TEST_TYPE_SIZE (PCWSTR, 4) + TEST_TYPE_ALIGN (PCWSTR, 4) + TEST_TARGET_SIZE (PCWSTR, 2) + TEST_TARGET_ALIGN(PCWSTR, 2) } static void test_pack_PEXCEPTION_POINTERS(void) { /* PEXCEPTION_POINTERS */ - TEST_TYPE(PEXCEPTION_POINTERS, 4, 4); - TEST_TYPE_POINTER(PEXCEPTION_POINTERS, 8, 4); + TEST_TYPE_SIZE (PEXCEPTION_POINTERS, 4) + TEST_TYPE_ALIGN (PEXCEPTION_POINTERS, 4) + TEST_TARGET_SIZE (PEXCEPTION_POINTERS, 8) + TEST_TARGET_ALIGN(PEXCEPTION_POINTERS, 4) } static void test_pack_PEXCEPTION_RECORD(void) { /* PEXCEPTION_RECORD */ - TEST_TYPE(PEXCEPTION_RECORD, 4, 4); - TEST_TYPE_POINTER(PEXCEPTION_RECORD, 80, 4); + TEST_TYPE_SIZE (PEXCEPTION_RECORD, 4) + TEST_TYPE_ALIGN (PEXCEPTION_RECORD, 4) + TEST_TARGET_SIZE (PEXCEPTION_RECORD, 80) + TEST_TARGET_ALIGN(PEXCEPTION_RECORD, 4) } static void test_pack_PFLOATING_SAVE_AREA(void) { /* PFLOATING_SAVE_AREA */ - TEST_TYPE(PFLOATING_SAVE_AREA, 4, 4); - TEST_TYPE_POINTER(PFLOATING_SAVE_AREA, 112, 4); + TEST_TYPE_SIZE (PFLOATING_SAVE_AREA, 4) + TEST_TYPE_ALIGN (PFLOATING_SAVE_AREA, 4) + TEST_TARGET_SIZE (PFLOATING_SAVE_AREA, 112) + TEST_TARGET_ALIGN(PFLOATING_SAVE_AREA, 4) } static void test_pack_PFPO_DATA(void) { /* PFPO_DATA */ - TEST_TYPE(PFPO_DATA, 4, 4); - TEST_TYPE_POINTER(PFPO_DATA, 16, 4); + TEST_TYPE_SIZE (PFPO_DATA, 4) + TEST_TYPE_ALIGN (PFPO_DATA, 4) + TEST_TARGET_SIZE (PFPO_DATA, 16) + TEST_TARGET_ALIGN(PFPO_DATA, 4) } static void test_pack_PGENERIC_MAPPING(void) { /* PGENERIC_MAPPING */ - TEST_TYPE(PGENERIC_MAPPING, 4, 4); - TEST_TYPE_POINTER(PGENERIC_MAPPING, 16, 4); + TEST_TYPE_SIZE (PGENERIC_MAPPING, 4) + TEST_TYPE_ALIGN (PGENERIC_MAPPING, 4) + TEST_TARGET_SIZE (PGENERIC_MAPPING, 16) + TEST_TARGET_ALIGN(PGENERIC_MAPPING, 4) } static void test_pack_PHANDLE(void) { /* PHANDLE */ - TEST_TYPE(PHANDLE, 4, 4); - TEST_TYPE_POINTER(PHANDLE, 4, 4); + TEST_TYPE_SIZE (PHANDLE, 4) + TEST_TYPE_ALIGN (PHANDLE, 4) + TEST_TARGET_SIZE (PHANDLE, 4) + TEST_TARGET_ALIGN(PHANDLE, 4) } static void test_pack_PIMAGE_ARCHIVE_MEMBER_HEADER(void) { /* PIMAGE_ARCHIVE_MEMBER_HEADER */ - TEST_TYPE(PIMAGE_ARCHIVE_MEMBER_HEADER, 4, 4); - TEST_TYPE_POINTER(PIMAGE_ARCHIVE_MEMBER_HEADER, 60, 1); + TEST_TYPE_SIZE (PIMAGE_ARCHIVE_MEMBER_HEADER, 4) + TEST_TYPE_ALIGN (PIMAGE_ARCHIVE_MEMBER_HEADER, 4) + TEST_TARGET_SIZE (PIMAGE_ARCHIVE_MEMBER_HEADER, 60) + TEST_TARGET_ALIGN(PIMAGE_ARCHIVE_MEMBER_HEADER, 1) } static void test_pack_PIMAGE_AUX_SYMBOL(void) { /* PIMAGE_AUX_SYMBOL */ - TEST_TYPE(PIMAGE_AUX_SYMBOL, 4, 4); + TEST_TYPE_SIZE (PIMAGE_AUX_SYMBOL, 4) + TEST_TYPE_ALIGN (PIMAGE_AUX_SYMBOL, 4) } static void test_pack_PIMAGE_BASE_RELOCATION(void) { /* PIMAGE_BASE_RELOCATION */ - TEST_TYPE(PIMAGE_BASE_RELOCATION, 4, 4); - TEST_TYPE_POINTER(PIMAGE_BASE_RELOCATION, 8, 4); + TEST_TYPE_SIZE (PIMAGE_BASE_RELOCATION, 4) + TEST_TYPE_ALIGN (PIMAGE_BASE_RELOCATION, 4) + TEST_TARGET_SIZE (PIMAGE_BASE_RELOCATION, 8) + TEST_TARGET_ALIGN(PIMAGE_BASE_RELOCATION, 4) } static void test_pack_PIMAGE_BOUND_FORWARDER_REF(void) { /* PIMAGE_BOUND_FORWARDER_REF */ - TEST_TYPE(PIMAGE_BOUND_FORWARDER_REF, 4, 4); - TEST_TYPE_POINTER(PIMAGE_BOUND_FORWARDER_REF, 8, 4); + TEST_TYPE_SIZE (PIMAGE_BOUND_FORWARDER_REF, 4) + TEST_TYPE_ALIGN (PIMAGE_BOUND_FORWARDER_REF, 4) + TEST_TARGET_SIZE (PIMAGE_BOUND_FORWARDER_REF, 8) + TEST_TARGET_ALIGN(PIMAGE_BOUND_FORWARDER_REF, 4) } static void test_pack_PIMAGE_BOUND_IMPORT_DESCRIPTOR(void) { /* PIMAGE_BOUND_IMPORT_DESCRIPTOR */ - TEST_TYPE(PIMAGE_BOUND_IMPORT_DESCRIPTOR, 4, 4); - TEST_TYPE_POINTER(PIMAGE_BOUND_IMPORT_DESCRIPTOR, 8, 4); + TEST_TYPE_SIZE (PIMAGE_BOUND_IMPORT_DESCRIPTOR, 4) + TEST_TYPE_ALIGN (PIMAGE_BOUND_IMPORT_DESCRIPTOR, 4) + TEST_TARGET_SIZE (PIMAGE_BOUND_IMPORT_DESCRIPTOR, 8) + TEST_TARGET_ALIGN(PIMAGE_BOUND_IMPORT_DESCRIPTOR, 4) } static void test_pack_PIMAGE_COFF_SYMBOLS_HEADER(void) { /* PIMAGE_COFF_SYMBOLS_HEADER */ - TEST_TYPE(PIMAGE_COFF_SYMBOLS_HEADER, 4, 4); - TEST_TYPE_POINTER(PIMAGE_COFF_SYMBOLS_HEADER, 32, 4); + TEST_TYPE_SIZE (PIMAGE_COFF_SYMBOLS_HEADER, 4) + TEST_TYPE_ALIGN (PIMAGE_COFF_SYMBOLS_HEADER, 4) + TEST_TARGET_SIZE (PIMAGE_COFF_SYMBOLS_HEADER, 32) + TEST_TARGET_ALIGN(PIMAGE_COFF_SYMBOLS_HEADER, 4) } static void test_pack_PIMAGE_DATA_DIRECTORY(void) { /* PIMAGE_DATA_DIRECTORY */ - TEST_TYPE(PIMAGE_DATA_DIRECTORY, 4, 4); - TEST_TYPE_POINTER(PIMAGE_DATA_DIRECTORY, 8, 4); + TEST_TYPE_SIZE (PIMAGE_DATA_DIRECTORY, 4) + TEST_TYPE_ALIGN (PIMAGE_DATA_DIRECTORY, 4) + TEST_TARGET_SIZE (PIMAGE_DATA_DIRECTORY, 8) + TEST_TARGET_ALIGN(PIMAGE_DATA_DIRECTORY, 4) } static void test_pack_PIMAGE_DEBUG_DIRECTORY(void) { /* PIMAGE_DEBUG_DIRECTORY */ - TEST_TYPE(PIMAGE_DEBUG_DIRECTORY, 4, 4); - TEST_TYPE_POINTER(PIMAGE_DEBUG_DIRECTORY, 28, 4); + TEST_TYPE_SIZE (PIMAGE_DEBUG_DIRECTORY, 4) + TEST_TYPE_ALIGN (PIMAGE_DEBUG_DIRECTORY, 4) + TEST_TARGET_SIZE (PIMAGE_DEBUG_DIRECTORY, 28) + TEST_TARGET_ALIGN(PIMAGE_DEBUG_DIRECTORY, 4) } static void test_pack_PIMAGE_DEBUG_MISC(void) { /* PIMAGE_DEBUG_MISC */ - TEST_TYPE(PIMAGE_DEBUG_MISC, 4, 4); - TEST_TYPE_POINTER(PIMAGE_DEBUG_MISC, 16, 4); + TEST_TYPE_SIZE (PIMAGE_DEBUG_MISC, 4) + TEST_TYPE_ALIGN (PIMAGE_DEBUG_MISC, 4) + TEST_TARGET_SIZE (PIMAGE_DEBUG_MISC, 16) + TEST_TARGET_ALIGN(PIMAGE_DEBUG_MISC, 4) } static void test_pack_PIMAGE_DOS_HEADER(void) { /* PIMAGE_DOS_HEADER */ - TEST_TYPE(PIMAGE_DOS_HEADER, 4, 4); - TEST_TYPE_POINTER(PIMAGE_DOS_HEADER, 64, 2); + TEST_TYPE_SIZE (PIMAGE_DOS_HEADER, 4) + TEST_TYPE_ALIGN (PIMAGE_DOS_HEADER, 4) + TEST_TARGET_SIZE (PIMAGE_DOS_HEADER, 64) + TEST_TARGET_ALIGN(PIMAGE_DOS_HEADER, 2) } static void test_pack_PIMAGE_EXPORT_DIRECTORY(void) { /* PIMAGE_EXPORT_DIRECTORY */ - TEST_TYPE(PIMAGE_EXPORT_DIRECTORY, 4, 4); - TEST_TYPE_POINTER(PIMAGE_EXPORT_DIRECTORY, 40, 4); + TEST_TYPE_SIZE (PIMAGE_EXPORT_DIRECTORY, 4) + TEST_TYPE_ALIGN (PIMAGE_EXPORT_DIRECTORY, 4) + TEST_TARGET_SIZE (PIMAGE_EXPORT_DIRECTORY, 40) + TEST_TARGET_ALIGN(PIMAGE_EXPORT_DIRECTORY, 4) } static void test_pack_PIMAGE_FILE_HEADER(void) { /* PIMAGE_FILE_HEADER */ - TEST_TYPE(PIMAGE_FILE_HEADER, 4, 4); - TEST_TYPE_POINTER(PIMAGE_FILE_HEADER, 20, 4); + TEST_TYPE_SIZE (PIMAGE_FILE_HEADER, 4) + TEST_TYPE_ALIGN (PIMAGE_FILE_HEADER, 4) + TEST_TARGET_SIZE (PIMAGE_FILE_HEADER, 20) + TEST_TARGET_ALIGN(PIMAGE_FILE_HEADER, 4) } static void test_pack_PIMAGE_FUNCTION_ENTRY(void) { /* PIMAGE_FUNCTION_ENTRY */ - TEST_TYPE(PIMAGE_FUNCTION_ENTRY, 4, 4); - TEST_TYPE_POINTER(PIMAGE_FUNCTION_ENTRY, 12, 4); + TEST_TYPE_SIZE (PIMAGE_FUNCTION_ENTRY, 4) + TEST_TYPE_ALIGN (PIMAGE_FUNCTION_ENTRY, 4) + TEST_TARGET_SIZE (PIMAGE_FUNCTION_ENTRY, 12) + TEST_TARGET_ALIGN(PIMAGE_FUNCTION_ENTRY, 4) } static void test_pack_PIMAGE_IMPORT_BY_NAME(void) { /* PIMAGE_IMPORT_BY_NAME */ - TEST_TYPE(PIMAGE_IMPORT_BY_NAME, 4, 4); - TEST_TYPE_POINTER(PIMAGE_IMPORT_BY_NAME, 4, 2); + TEST_TYPE_SIZE (PIMAGE_IMPORT_BY_NAME, 4) + TEST_TYPE_ALIGN (PIMAGE_IMPORT_BY_NAME, 4) + TEST_TARGET_SIZE (PIMAGE_IMPORT_BY_NAME, 4) + TEST_TARGET_ALIGN(PIMAGE_IMPORT_BY_NAME, 2) } static void test_pack_PIMAGE_IMPORT_DESCRIPTOR(void) { /* PIMAGE_IMPORT_DESCRIPTOR */ - TEST_TYPE(PIMAGE_IMPORT_DESCRIPTOR, 4, 4); + TEST_TYPE_SIZE (PIMAGE_IMPORT_DESCRIPTOR, 4) + TEST_TYPE_ALIGN (PIMAGE_IMPORT_DESCRIPTOR, 4) } static void test_pack_PIMAGE_LINENUMBER(void) { /* PIMAGE_LINENUMBER */ - TEST_TYPE(PIMAGE_LINENUMBER, 4, 4); + TEST_TYPE_SIZE (PIMAGE_LINENUMBER, 4) + TEST_TYPE_ALIGN (PIMAGE_LINENUMBER, 4) } static void test_pack_PIMAGE_LOAD_CONFIG_DIRECTORY(void) { /* PIMAGE_LOAD_CONFIG_DIRECTORY */ - TEST_TYPE(PIMAGE_LOAD_CONFIG_DIRECTORY, 4, 4); - TEST_TYPE_POINTER(PIMAGE_LOAD_CONFIG_DIRECTORY, 72, 4); + TEST_TYPE_SIZE (PIMAGE_LOAD_CONFIG_DIRECTORY, 4) + TEST_TYPE_ALIGN (PIMAGE_LOAD_CONFIG_DIRECTORY, 4) + TEST_TARGET_SIZE (PIMAGE_LOAD_CONFIG_DIRECTORY, 72) + TEST_TARGET_ALIGN(PIMAGE_LOAD_CONFIG_DIRECTORY, 4) } static void test_pack_PIMAGE_NT_HEADERS(void) { /* PIMAGE_NT_HEADERS */ - TEST_TYPE(PIMAGE_NT_HEADERS, 4, 4); + TEST_TYPE_SIZE (PIMAGE_NT_HEADERS, 4) + TEST_TYPE_ALIGN (PIMAGE_NT_HEADERS, 4) } static void test_pack_PIMAGE_OPTIONAL_HEADER(void) { /* PIMAGE_OPTIONAL_HEADER */ - TEST_TYPE(PIMAGE_OPTIONAL_HEADER, 4, 4); + TEST_TYPE_SIZE (PIMAGE_OPTIONAL_HEADER, 4) + TEST_TYPE_ALIGN (PIMAGE_OPTIONAL_HEADER, 4) } static void test_pack_PIMAGE_OS2_HEADER(void) { /* PIMAGE_OS2_HEADER */ - TEST_TYPE(PIMAGE_OS2_HEADER, 4, 4); - TEST_TYPE_POINTER(PIMAGE_OS2_HEADER, 64, 2); + TEST_TYPE_SIZE (PIMAGE_OS2_HEADER, 4) + TEST_TYPE_ALIGN (PIMAGE_OS2_HEADER, 4) + TEST_TARGET_SIZE (PIMAGE_OS2_HEADER, 64) + TEST_TARGET_ALIGN(PIMAGE_OS2_HEADER, 2) } static void test_pack_PIMAGE_RELOCATION(void) { /* PIMAGE_RELOCATION */ - TEST_TYPE(PIMAGE_RELOCATION, 4, 4); + TEST_TYPE_SIZE (PIMAGE_RELOCATION, 4) + TEST_TYPE_ALIGN (PIMAGE_RELOCATION, 4) } static void test_pack_PIMAGE_RESOURCE_DATA_ENTRY(void) { /* PIMAGE_RESOURCE_DATA_ENTRY */ - TEST_TYPE(PIMAGE_RESOURCE_DATA_ENTRY, 4, 4); - TEST_TYPE_POINTER(PIMAGE_RESOURCE_DATA_ENTRY, 16, 4); + TEST_TYPE_SIZE (PIMAGE_RESOURCE_DATA_ENTRY, 4) + TEST_TYPE_ALIGN (PIMAGE_RESOURCE_DATA_ENTRY, 4) + TEST_TARGET_SIZE (PIMAGE_RESOURCE_DATA_ENTRY, 16) + TEST_TARGET_ALIGN(PIMAGE_RESOURCE_DATA_ENTRY, 4) } static void test_pack_PIMAGE_RESOURCE_DIRECTORY(void) { /* PIMAGE_RESOURCE_DIRECTORY */ - TEST_TYPE(PIMAGE_RESOURCE_DIRECTORY, 4, 4); - TEST_TYPE_POINTER(PIMAGE_RESOURCE_DIRECTORY, 16, 4); + TEST_TYPE_SIZE (PIMAGE_RESOURCE_DIRECTORY, 4) + TEST_TYPE_ALIGN (PIMAGE_RESOURCE_DIRECTORY, 4) + TEST_TARGET_SIZE (PIMAGE_RESOURCE_DIRECTORY, 16) + TEST_TARGET_ALIGN(PIMAGE_RESOURCE_DIRECTORY, 4) } static void test_pack_PIMAGE_RESOURCE_DIRECTORY_ENTRY(void) { /* PIMAGE_RESOURCE_DIRECTORY_ENTRY */ - TEST_TYPE(PIMAGE_RESOURCE_DIRECTORY_ENTRY, 4, 4); + TEST_TYPE_SIZE (PIMAGE_RESOURCE_DIRECTORY_ENTRY, 4) + TEST_TYPE_ALIGN (PIMAGE_RESOURCE_DIRECTORY_ENTRY, 4) } static void test_pack_PIMAGE_RESOURCE_DIRECTORY_STRING(void) { /* PIMAGE_RESOURCE_DIRECTORY_STRING */ - TEST_TYPE(PIMAGE_RESOURCE_DIRECTORY_STRING, 4, 4); - TEST_TYPE_POINTER(PIMAGE_RESOURCE_DIRECTORY_STRING, 4, 2); + TEST_TYPE_SIZE (PIMAGE_RESOURCE_DIRECTORY_STRING, 4) + TEST_TYPE_ALIGN (PIMAGE_RESOURCE_DIRECTORY_STRING, 4) + TEST_TARGET_SIZE (PIMAGE_RESOURCE_DIRECTORY_STRING, 4) + TEST_TARGET_ALIGN(PIMAGE_RESOURCE_DIRECTORY_STRING, 2) } static void test_pack_PIMAGE_RESOURCE_DIR_STRING_U(void) { /* PIMAGE_RESOURCE_DIR_STRING_U */ - TEST_TYPE(PIMAGE_RESOURCE_DIR_STRING_U, 4, 4); - TEST_TYPE_POINTER(PIMAGE_RESOURCE_DIR_STRING_U, 4, 2); + TEST_TYPE_SIZE (PIMAGE_RESOURCE_DIR_STRING_U, 4) + TEST_TYPE_ALIGN (PIMAGE_RESOURCE_DIR_STRING_U, 4) + TEST_TARGET_SIZE (PIMAGE_RESOURCE_DIR_STRING_U, 4) + TEST_TARGET_ALIGN(PIMAGE_RESOURCE_DIR_STRING_U, 2) } static void test_pack_PIMAGE_SECTION_HEADER(void) { /* PIMAGE_SECTION_HEADER */ - TEST_TYPE(PIMAGE_SECTION_HEADER, 4, 4); + TEST_TYPE_SIZE (PIMAGE_SECTION_HEADER, 4) + TEST_TYPE_ALIGN (PIMAGE_SECTION_HEADER, 4) } static void test_pack_PIMAGE_SEPARATE_DEBUG_HEADER(void) { /* PIMAGE_SEPARATE_DEBUG_HEADER */ - TEST_TYPE(PIMAGE_SEPARATE_DEBUG_HEADER, 4, 4); - TEST_TYPE_POINTER(PIMAGE_SEPARATE_DEBUG_HEADER, 48, 4); + TEST_TYPE_SIZE (PIMAGE_SEPARATE_DEBUG_HEADER, 4) + TEST_TYPE_ALIGN (PIMAGE_SEPARATE_DEBUG_HEADER, 4) + TEST_TARGET_SIZE (PIMAGE_SEPARATE_DEBUG_HEADER, 48) + TEST_TARGET_ALIGN(PIMAGE_SEPARATE_DEBUG_HEADER, 4) } static void test_pack_PIMAGE_SYMBOL(void) { /* PIMAGE_SYMBOL */ - TEST_TYPE(PIMAGE_SYMBOL, 4, 4); + TEST_TYPE_SIZE (PIMAGE_SYMBOL, 4) + TEST_TYPE_ALIGN (PIMAGE_SYMBOL, 4) } static void test_pack_PIMAGE_THUNK_DATA(void) { /* PIMAGE_THUNK_DATA */ - TEST_TYPE(PIMAGE_THUNK_DATA, 4, 4); + TEST_TYPE_SIZE (PIMAGE_THUNK_DATA, 4) + TEST_TYPE_ALIGN (PIMAGE_THUNK_DATA, 4) } static void test_pack_PIMAGE_TLS_CALLBACK(void) { /* PIMAGE_TLS_CALLBACK */ - TEST_TYPE(PIMAGE_TLS_CALLBACK, 4, 4); + TEST_TYPE_SIZE (PIMAGE_TLS_CALLBACK, 4) + TEST_TYPE_ALIGN (PIMAGE_TLS_CALLBACK, 4) } static void test_pack_PIMAGE_TLS_DIRECTORY(void) { /* PIMAGE_TLS_DIRECTORY */ - TEST_TYPE(PIMAGE_TLS_DIRECTORY, 4, 4); + TEST_TYPE_SIZE (PIMAGE_TLS_DIRECTORY, 4) + TEST_TYPE_ALIGN (PIMAGE_TLS_DIRECTORY, 4) } static void test_pack_PIMAGE_VXD_HEADER(void) { /* PIMAGE_VXD_HEADER */ - TEST_TYPE(PIMAGE_VXD_HEADER, 4, 4); - TEST_TYPE_POINTER(PIMAGE_VXD_HEADER, 196, 2); + TEST_TYPE_SIZE (PIMAGE_VXD_HEADER, 4) + TEST_TYPE_ALIGN (PIMAGE_VXD_HEADER, 4) + TEST_TARGET_SIZE (PIMAGE_VXD_HEADER, 196) + TEST_TARGET_ALIGN(PIMAGE_VXD_HEADER, 2) } static void test_pack_PIO_COUNTERS(void) { /* PIO_COUNTERS */ - TEST_TYPE(PIO_COUNTERS, 4, 4); - TEST_TYPE_POINTER(PIO_COUNTERS, 48, 8); + TEST_TYPE_SIZE (PIO_COUNTERS, 4) + TEST_TYPE_ALIGN (PIO_COUNTERS, 4) + TEST_TARGET_SIZE (PIO_COUNTERS, 48) + TEST_TARGET_ALIGN(PIO_COUNTERS, 8) } static void test_pack_PISECURITY_DESCRIPTOR(void) { /* PISECURITY_DESCRIPTOR */ - TEST_TYPE(PISECURITY_DESCRIPTOR, 4, 4); - TEST_TYPE_POINTER(PISECURITY_DESCRIPTOR, 20, 4); + TEST_TYPE_SIZE (PISECURITY_DESCRIPTOR, 4) + TEST_TYPE_ALIGN (PISECURITY_DESCRIPTOR, 4) + TEST_TARGET_SIZE (PISECURITY_DESCRIPTOR, 20) + TEST_TARGET_ALIGN(PISECURITY_DESCRIPTOR, 4) } static void test_pack_PISECURITY_DESCRIPTOR_RELATIVE(void) { /* PISECURITY_DESCRIPTOR_RELATIVE */ - TEST_TYPE(PISECURITY_DESCRIPTOR_RELATIVE, 4, 4); - TEST_TYPE_POINTER(PISECURITY_DESCRIPTOR_RELATIVE, 20, 4); + TEST_TYPE_SIZE (PISECURITY_DESCRIPTOR_RELATIVE, 4) + TEST_TYPE_ALIGN (PISECURITY_DESCRIPTOR_RELATIVE, 4) + TEST_TARGET_SIZE (PISECURITY_DESCRIPTOR_RELATIVE, 20) + TEST_TARGET_ALIGN(PISECURITY_DESCRIPTOR_RELATIVE, 4) } static void test_pack_PISID(void) { /* PISID */ - TEST_TYPE(PISID, 4, 4); - TEST_TYPE_POINTER(PISID, 12, 4); + TEST_TYPE_SIZE (PISID, 4) + TEST_TYPE_ALIGN (PISID, 4) + TEST_TARGET_SIZE (PISID, 12) + TEST_TARGET_ALIGN(PISID, 4) } static void test_pack_PLARGE_INTEGER(void) { /* PLARGE_INTEGER */ - TEST_TYPE(PLARGE_INTEGER, 4, 4); + TEST_TYPE_SIZE (PLARGE_INTEGER, 4) + TEST_TYPE_ALIGN (PLARGE_INTEGER, 4) } static void test_pack_PLIST_ENTRY(void) { /* PLIST_ENTRY */ - TEST_TYPE(PLIST_ENTRY, 4, 4); - TEST_TYPE_POINTER(PLIST_ENTRY, 8, 4); + TEST_TYPE_SIZE (PLIST_ENTRY, 4) + TEST_TYPE_ALIGN (PLIST_ENTRY, 4) + TEST_TARGET_SIZE (PLIST_ENTRY, 8) + TEST_TARGET_ALIGN(PLIST_ENTRY, 4) } static void test_pack_PLUID(void) { /* PLUID */ - TEST_TYPE(PLUID, 4, 4); - TEST_TYPE_POINTER(PLUID, 8, 4); + TEST_TYPE_SIZE (PLUID, 4) + TEST_TYPE_ALIGN (PLUID, 4) + TEST_TARGET_SIZE (PLUID, 8) + TEST_TARGET_ALIGN(PLUID, 4) } static void test_pack_PLUID_AND_ATTRIBUTES(void) { /* PLUID_AND_ATTRIBUTES */ - TEST_TYPE(PLUID_AND_ATTRIBUTES, 4, 4); - TEST_TYPE_POINTER(PLUID_AND_ATTRIBUTES, 12, 4); + TEST_TYPE_SIZE (PLUID_AND_ATTRIBUTES, 4) + TEST_TYPE_ALIGN (PLUID_AND_ATTRIBUTES, 4) + TEST_TARGET_SIZE (PLUID_AND_ATTRIBUTES, 12) + TEST_TARGET_ALIGN(PLUID_AND_ATTRIBUTES, 4) } static void test_pack_PMEMORY_BASIC_INFORMATION(void) { /* PMEMORY_BASIC_INFORMATION */ - TEST_TYPE(PMEMORY_BASIC_INFORMATION, 4, 4); - TEST_TYPE_POINTER(PMEMORY_BASIC_INFORMATION, 28, 4); + TEST_TYPE_SIZE (PMEMORY_BASIC_INFORMATION, 4) + TEST_TYPE_ALIGN (PMEMORY_BASIC_INFORMATION, 4) + TEST_TARGET_SIZE (PMEMORY_BASIC_INFORMATION, 28) + TEST_TARGET_ALIGN(PMEMORY_BASIC_INFORMATION, 4) } static void test_pack_PMESSAGE_RESOURCE_BLOCK(void) { /* PMESSAGE_RESOURCE_BLOCK */ - TEST_TYPE(PMESSAGE_RESOURCE_BLOCK, 4, 4); - TEST_TYPE_POINTER(PMESSAGE_RESOURCE_BLOCK, 12, 4); + TEST_TYPE_SIZE (PMESSAGE_RESOURCE_BLOCK, 4) + TEST_TYPE_ALIGN (PMESSAGE_RESOURCE_BLOCK, 4) + TEST_TARGET_SIZE (PMESSAGE_RESOURCE_BLOCK, 12) + TEST_TARGET_ALIGN(PMESSAGE_RESOURCE_BLOCK, 4) } static void test_pack_PMESSAGE_RESOURCE_DATA(void) { /* PMESSAGE_RESOURCE_DATA */ - TEST_TYPE(PMESSAGE_RESOURCE_DATA, 4, 4); - TEST_TYPE_POINTER(PMESSAGE_RESOURCE_DATA, 16, 4); + TEST_TYPE_SIZE (PMESSAGE_RESOURCE_DATA, 4) + TEST_TYPE_ALIGN (PMESSAGE_RESOURCE_DATA, 4) + TEST_TARGET_SIZE (PMESSAGE_RESOURCE_DATA, 16) + TEST_TARGET_ALIGN(PMESSAGE_RESOURCE_DATA, 4) } static void test_pack_PMESSAGE_RESOURCE_ENTRY(void) { /* PMESSAGE_RESOURCE_ENTRY */ - TEST_TYPE(PMESSAGE_RESOURCE_ENTRY, 4, 4); - TEST_TYPE_POINTER(PMESSAGE_RESOURCE_ENTRY, 6, 2); + TEST_TYPE_SIZE (PMESSAGE_RESOURCE_ENTRY, 4) + TEST_TYPE_ALIGN (PMESSAGE_RESOURCE_ENTRY, 4) + TEST_TARGET_SIZE (PMESSAGE_RESOURCE_ENTRY, 6) + TEST_TARGET_ALIGN(PMESSAGE_RESOURCE_ENTRY, 2) } static void test_pack_PNT_TIB(void) { /* PNT_TIB */ - TEST_TYPE(PNT_TIB, 4, 4); + TEST_TYPE_SIZE (PNT_TIB, 4) + TEST_TYPE_ALIGN (PNT_TIB, 4) } static void test_pack_POBJECT_TYPE_LIST(void) { /* POBJECT_TYPE_LIST */ - TEST_TYPE(POBJECT_TYPE_LIST, 4, 4); - TEST_TYPE_POINTER(POBJECT_TYPE_LIST, 8, 4); + TEST_TYPE_SIZE (POBJECT_TYPE_LIST, 4) + TEST_TYPE_ALIGN (POBJECT_TYPE_LIST, 4) + TEST_TARGET_SIZE (POBJECT_TYPE_LIST, 8) + TEST_TARGET_ALIGN(POBJECT_TYPE_LIST, 4) } static void test_pack_PPRIVILEGE_SET(void) { /* PPRIVILEGE_SET */ - TEST_TYPE(PPRIVILEGE_SET, 4, 4); - TEST_TYPE_POINTER(PPRIVILEGE_SET, 20, 4); + TEST_TYPE_SIZE (PPRIVILEGE_SET, 4) + TEST_TYPE_ALIGN (PPRIVILEGE_SET, 4) + TEST_TARGET_SIZE (PPRIVILEGE_SET, 20) + TEST_TARGET_ALIGN(PPRIVILEGE_SET, 4) } static void test_pack_PRIVILEGE_SET(void) { /* PRIVILEGE_SET (pack 4) */ - TEST_TYPE(PRIVILEGE_SET, 20, 4); - TEST_FIELD(PRIVILEGE_SET, DWORD, PrivilegeCount, 0, 4, 4); - TEST_FIELD(PRIVILEGE_SET, DWORD, Control, 4, 4, 4); - TEST_FIELD(PRIVILEGE_SET, LUID_AND_ATTRIBUTES[ANYSIZE_ARRAY], Privilege, 8, 12, 4); + TEST_TYPE_SIZE (PRIVILEGE_SET, 20) + TEST_TYPE_ALIGN (PRIVILEGE_SET, 4) + TEST_FIELD_SIZE (PRIVILEGE_SET, PrivilegeCount, 4) + TEST_FIELD_ALIGN (PRIVILEGE_SET, PrivilegeCount, 4) + TEST_FIELD_OFFSET(PRIVILEGE_SET, PrivilegeCount, 0) + TEST_FIELD_SIZE (PRIVILEGE_SET, Control, 4) + TEST_FIELD_ALIGN (PRIVILEGE_SET, Control, 4) + TEST_FIELD_OFFSET(PRIVILEGE_SET, Control, 4) + TEST_FIELD_SIZE (PRIVILEGE_SET, Privilege, 12) + TEST_FIELD_ALIGN (PRIVILEGE_SET, Privilege, 4) + TEST_FIELD_OFFSET(PRIVILEGE_SET, Privilege, 8) } static void test_pack_PRLIST_ENTRY(void) { /* PRLIST_ENTRY */ - TEST_TYPE(PRLIST_ENTRY, 4, 4); - TEST_TYPE_POINTER(PRLIST_ENTRY, 8, 4); + TEST_TYPE_SIZE (PRLIST_ENTRY, 4) + TEST_TYPE_ALIGN (PRLIST_ENTRY, 4) + TEST_TARGET_SIZE (PRLIST_ENTRY, 8) + TEST_TARGET_ALIGN(PRLIST_ENTRY, 4) } static void test_pack_PRTL_CRITICAL_SECTION(void) { /* PRTL_CRITICAL_SECTION */ - TEST_TYPE(PRTL_CRITICAL_SECTION, 4, 4); - TEST_TYPE_POINTER(PRTL_CRITICAL_SECTION, 24, 4); + TEST_TYPE_SIZE (PRTL_CRITICAL_SECTION, 4) + TEST_TYPE_ALIGN (PRTL_CRITICAL_SECTION, 4) + TEST_TARGET_SIZE (PRTL_CRITICAL_SECTION, 24) + TEST_TARGET_ALIGN(PRTL_CRITICAL_SECTION, 4) } static void test_pack_PRTL_CRITICAL_SECTION_DEBUG(void) { /* PRTL_CRITICAL_SECTION_DEBUG */ - TEST_TYPE(PRTL_CRITICAL_SECTION_DEBUG, 4, 4); + TEST_TYPE_SIZE (PRTL_CRITICAL_SECTION_DEBUG, 4) + TEST_TYPE_ALIGN (PRTL_CRITICAL_SECTION_DEBUG, 4) } static void test_pack_PRTL_OSVERSIONINFOEXW(void) { /* PRTL_OSVERSIONINFOEXW */ - TEST_TYPE(PRTL_OSVERSIONINFOEXW, 4, 4); - TEST_TYPE_POINTER(PRTL_OSVERSIONINFOEXW, 284, 4); + TEST_TYPE_SIZE (PRTL_OSVERSIONINFOEXW, 4) + TEST_TYPE_ALIGN (PRTL_OSVERSIONINFOEXW, 4) + TEST_TARGET_SIZE (PRTL_OSVERSIONINFOEXW, 284) + TEST_TARGET_ALIGN(PRTL_OSVERSIONINFOEXW, 4) } static void test_pack_PRTL_OSVERSIONINFOW(void) { /* PRTL_OSVERSIONINFOW */ - TEST_TYPE(PRTL_OSVERSIONINFOW, 4, 4); - TEST_TYPE_POINTER(PRTL_OSVERSIONINFOW, 276, 4); + TEST_TYPE_SIZE (PRTL_OSVERSIONINFOW, 4) + TEST_TYPE_ALIGN (PRTL_OSVERSIONINFOW, 4) + TEST_TARGET_SIZE (PRTL_OSVERSIONINFOW, 276) + TEST_TARGET_ALIGN(PRTL_OSVERSIONINFOW, 4) } static void test_pack_PRTL_RESOURCE_DEBUG(void) { /* PRTL_RESOURCE_DEBUG */ - TEST_TYPE(PRTL_RESOURCE_DEBUG, 4, 4); + TEST_TYPE_SIZE (PRTL_RESOURCE_DEBUG, 4) + TEST_TYPE_ALIGN (PRTL_RESOURCE_DEBUG, 4) } static void test_pack_PSECURITY_DESCRIPTOR(void) { /* PSECURITY_DESCRIPTOR */ - TEST_TYPE(PSECURITY_DESCRIPTOR, 4, 4); + TEST_TYPE_SIZE (PSECURITY_DESCRIPTOR, 4) + TEST_TYPE_ALIGN (PSECURITY_DESCRIPTOR, 4) } static void test_pack_PSECURITY_QUALITY_OF_SERVICE(void) { /* PSECURITY_QUALITY_OF_SERVICE */ - TEST_TYPE(PSECURITY_QUALITY_OF_SERVICE, 4, 4); + TEST_TYPE_SIZE (PSECURITY_QUALITY_OF_SERVICE, 4) + TEST_TYPE_ALIGN (PSECURITY_QUALITY_OF_SERVICE, 4) } static void test_pack_PSID(void) { /* PSID */ - TEST_TYPE(PSID, 4, 4); + TEST_TYPE_SIZE (PSID, 4) + TEST_TYPE_ALIGN (PSID, 4) } static void test_pack_PSID_IDENTIFIER_AUTHORITY(void) { /* PSID_IDENTIFIER_AUTHORITY */ - TEST_TYPE(PSID_IDENTIFIER_AUTHORITY, 4, 4); - TEST_TYPE_POINTER(PSID_IDENTIFIER_AUTHORITY, 6, 1); + TEST_TYPE_SIZE (PSID_IDENTIFIER_AUTHORITY, 4) + TEST_TYPE_ALIGN (PSID_IDENTIFIER_AUTHORITY, 4) + TEST_TARGET_SIZE (PSID_IDENTIFIER_AUTHORITY, 6) + TEST_TARGET_ALIGN(PSID_IDENTIFIER_AUTHORITY, 1) } static void test_pack_PSINGLE_LIST_ENTRY(void) { /* PSINGLE_LIST_ENTRY */ - TEST_TYPE(PSINGLE_LIST_ENTRY, 4, 4); - TEST_TYPE_POINTER(PSINGLE_LIST_ENTRY, 4, 4); + TEST_TYPE_SIZE (PSINGLE_LIST_ENTRY, 4) + TEST_TYPE_ALIGN (PSINGLE_LIST_ENTRY, 4) + TEST_TARGET_SIZE (PSINGLE_LIST_ENTRY, 4) + TEST_TARGET_ALIGN(PSINGLE_LIST_ENTRY, 4) } static void test_pack_PSTR(void) { /* PSTR */ - TEST_TYPE(PSTR, 4, 4); - TEST_TYPE_POINTER(PSTR, 1, 1); + TEST_TYPE_SIZE (PSTR, 4) + TEST_TYPE_ALIGN (PSTR, 4) + TEST_TARGET_SIZE (PSTR, 1) + TEST_TARGET_ALIGN(PSTR, 1) } static void test_pack_PSYSTEM_ALARM_ACE(void) { /* PSYSTEM_ALARM_ACE */ - TEST_TYPE(PSYSTEM_ALARM_ACE, 4, 4); - TEST_TYPE_POINTER(PSYSTEM_ALARM_ACE, 12, 4); + TEST_TYPE_SIZE (PSYSTEM_ALARM_ACE, 4) + TEST_TYPE_ALIGN (PSYSTEM_ALARM_ACE, 4) + TEST_TARGET_SIZE (PSYSTEM_ALARM_ACE, 12) + TEST_TARGET_ALIGN(PSYSTEM_ALARM_ACE, 4) } static void test_pack_PSYSTEM_AUDIT_ACE(void) { /* PSYSTEM_AUDIT_ACE */ - TEST_TYPE(PSYSTEM_AUDIT_ACE, 4, 4); - TEST_TYPE_POINTER(PSYSTEM_AUDIT_ACE, 12, 4); + TEST_TYPE_SIZE (PSYSTEM_AUDIT_ACE, 4) + TEST_TYPE_ALIGN (PSYSTEM_AUDIT_ACE, 4) + TEST_TARGET_SIZE (PSYSTEM_AUDIT_ACE, 12) + TEST_TARGET_ALIGN(PSYSTEM_AUDIT_ACE, 4) } static void test_pack_PTOKEN_GROUPS(void) { /* PTOKEN_GROUPS */ - TEST_TYPE(PTOKEN_GROUPS, 4, 4); - TEST_TYPE_POINTER(PTOKEN_GROUPS, 12, 4); + TEST_TYPE_SIZE (PTOKEN_GROUPS, 4) + TEST_TYPE_ALIGN (PTOKEN_GROUPS, 4) + TEST_TARGET_SIZE (PTOKEN_GROUPS, 12) + TEST_TARGET_ALIGN(PTOKEN_GROUPS, 4) } static void test_pack_PTOKEN_PRIVILEGES(void) { /* PTOKEN_PRIVILEGES */ - TEST_TYPE(PTOKEN_PRIVILEGES, 4, 4); - TEST_TYPE_POINTER(PTOKEN_PRIVILEGES, 16, 4); + TEST_TYPE_SIZE (PTOKEN_PRIVILEGES, 4) + TEST_TYPE_ALIGN (PTOKEN_PRIVILEGES, 4) + TEST_TARGET_SIZE (PTOKEN_PRIVILEGES, 16) + TEST_TARGET_ALIGN(PTOKEN_PRIVILEGES, 4) } static void test_pack_PTOKEN_USER(void) { /* PTOKEN_USER */ - TEST_TYPE(PTOKEN_USER, 4, 4); - TEST_TYPE_POINTER(PTOKEN_USER, 8, 4); + TEST_TYPE_SIZE (PTOKEN_USER, 4) + TEST_TYPE_ALIGN (PTOKEN_USER, 4) + TEST_TARGET_SIZE (PTOKEN_USER, 8) + TEST_TARGET_ALIGN(PTOKEN_USER, 4) } static void test_pack_PTSTR(void) { /* PTSTR */ - TEST_TYPE(PTSTR, 4, 4); + TEST_TYPE_SIZE (PTSTR, 4) + TEST_TYPE_ALIGN (PTSTR, 4) } static void test_pack_PULARGE_INTEGER(void) { /* PULARGE_INTEGER */ - TEST_TYPE(PULARGE_INTEGER, 4, 4); + TEST_TYPE_SIZE (PULARGE_INTEGER, 4) + TEST_TYPE_ALIGN (PULARGE_INTEGER, 4) } static void test_pack_PVECTORED_EXCEPTION_HANDLER(void) { /* PVECTORED_EXCEPTION_HANDLER */ - TEST_TYPE(PVECTORED_EXCEPTION_HANDLER, 4, 4); + TEST_TYPE_SIZE (PVECTORED_EXCEPTION_HANDLER, 4) + TEST_TYPE_ALIGN (PVECTORED_EXCEPTION_HANDLER, 4) } static void test_pack_PVOID(void) { /* PVOID */ - TEST_TYPE(PVOID, 4, 4); + TEST_TYPE_SIZE (PVOID, 4) + TEST_TYPE_ALIGN (PVOID, 4) } static void test_pack_PWCH(void) { /* PWCH */ - TEST_TYPE(PWCH, 4, 4); - TEST_TYPE_POINTER(PWCH, 2, 2); + TEST_TYPE_SIZE (PWCH, 4) + TEST_TYPE_ALIGN (PWCH, 4) + TEST_TARGET_SIZE (PWCH, 2) + TEST_TARGET_ALIGN(PWCH, 2) } static void test_pack_PWSTR(void) { /* PWSTR */ - TEST_TYPE(PWSTR, 4, 4); - TEST_TYPE_POINTER(PWSTR, 2, 2); + TEST_TYPE_SIZE (PWSTR, 4) + TEST_TYPE_ALIGN (PWSTR, 4) + TEST_TARGET_SIZE (PWSTR, 2) + TEST_TARGET_ALIGN(PWSTR, 2) } static void test_pack_RTL_CRITICAL_SECTION(void) { /* RTL_CRITICAL_SECTION (pack 4) */ - TEST_TYPE(RTL_CRITICAL_SECTION, 24, 4); - TEST_FIELD(RTL_CRITICAL_SECTION, PRTL_CRITICAL_SECTION_DEBUG, DebugInfo, 0, 4, 4); - TEST_FIELD(RTL_CRITICAL_SECTION, LONG, LockCount, 4, 4, 4); - TEST_FIELD(RTL_CRITICAL_SECTION, LONG, RecursionCount, 8, 4, 4); - TEST_FIELD(RTL_CRITICAL_SECTION, HANDLE, OwningThread, 12, 4, 4); - TEST_FIELD(RTL_CRITICAL_SECTION, HANDLE, LockSemaphore, 16, 4, 4); - TEST_FIELD(RTL_CRITICAL_SECTION, ULONG_PTR, SpinCount, 20, 4, 4); + TEST_TYPE_SIZE (RTL_CRITICAL_SECTION, 24) + TEST_TYPE_ALIGN (RTL_CRITICAL_SECTION, 4) + TEST_FIELD_SIZE (RTL_CRITICAL_SECTION, DebugInfo, 4) + TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION, DebugInfo, 4) + TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION, DebugInfo, 0) + TEST_FIELD_SIZE (RTL_CRITICAL_SECTION, LockCount, 4) + TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION, LockCount, 4) + TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION, LockCount, 4) + TEST_FIELD_SIZE (RTL_CRITICAL_SECTION, RecursionCount, 4) + TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION, RecursionCount, 4) + TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION, RecursionCount, 8) + TEST_FIELD_SIZE (RTL_CRITICAL_SECTION, OwningThread, 4) + TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION, OwningThread, 4) + TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION, OwningThread, 12) + TEST_FIELD_SIZE (RTL_CRITICAL_SECTION, LockSemaphore, 4) + TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION, LockSemaphore, 4) + TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION, LockSemaphore, 16) + TEST_FIELD_SIZE (RTL_CRITICAL_SECTION, SpinCount, 4) + TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION, SpinCount, 4) + TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION, SpinCount, 20) } static void test_pack_RTL_CRITICAL_SECTION_DEBUG(void) { /* RTL_CRITICAL_SECTION_DEBUG (pack 4) */ - TEST_FIELD(RTL_CRITICAL_SECTION_DEBUG, WORD, Type, 0, 2, 2); - TEST_FIELD(RTL_CRITICAL_SECTION_DEBUG, WORD, CreatorBackTraceIndex, 2, 2, 2); - TEST_FIELD(RTL_CRITICAL_SECTION_DEBUG, struct _RTL_CRITICAL_SECTION *, CriticalSection, 4, 4, 4); - TEST_FIELD(RTL_CRITICAL_SECTION_DEBUG, LIST_ENTRY, ProcessLocksList, 8, 8, 4); - TEST_FIELD(RTL_CRITICAL_SECTION_DEBUG, DWORD, EntryCount, 16, 4, 4); - TEST_FIELD(RTL_CRITICAL_SECTION_DEBUG, DWORD, ContentionCount, 20, 4, 4); + TEST_FIELD_SIZE (RTL_CRITICAL_SECTION_DEBUG, Type, 2) + TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION_DEBUG, Type, 2) + TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION_DEBUG, Type, 0) + TEST_FIELD_SIZE (RTL_CRITICAL_SECTION_DEBUG, CreatorBackTraceIndex, 2) + TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION_DEBUG, CreatorBackTraceIndex, 2) + TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION_DEBUG, CreatorBackTraceIndex, 2) + TEST_FIELD_SIZE (RTL_CRITICAL_SECTION_DEBUG, CriticalSection, 4) + TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION_DEBUG, CriticalSection, 4) + TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION_DEBUG, CriticalSection, 4) + TEST_FIELD_SIZE (RTL_CRITICAL_SECTION_DEBUG, ProcessLocksList, 8) + TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION_DEBUG, ProcessLocksList, 4) + TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION_DEBUG, ProcessLocksList, 8) + TEST_FIELD_SIZE (RTL_CRITICAL_SECTION_DEBUG, EntryCount, 4) + TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION_DEBUG, EntryCount, 4) + TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION_DEBUG, EntryCount, 16) + TEST_FIELD_SIZE (RTL_CRITICAL_SECTION_DEBUG, ContentionCount, 4) + TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION_DEBUG, ContentionCount, 4) + TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION_DEBUG, ContentionCount, 20) } static void test_pack_RTL_OSVERSIONINFOEXW(void) { /* RTL_OSVERSIONINFOEXW (pack 4) */ - TEST_TYPE(RTL_OSVERSIONINFOEXW, 284, 4); - TEST_FIELD(RTL_OSVERSIONINFOEXW, DWORD, dwOSVersionInfoSize, 0, 4, 4); - TEST_FIELD(RTL_OSVERSIONINFOEXW, DWORD, dwMajorVersion, 4, 4, 4); - TEST_FIELD(RTL_OSVERSIONINFOEXW, DWORD, dwMinorVersion, 8, 4, 4); - TEST_FIELD(RTL_OSVERSIONINFOEXW, DWORD, dwBuildNumber, 12, 4, 4); - TEST_FIELD(RTL_OSVERSIONINFOEXW, DWORD, dwPlatformId, 16, 4, 4); - TEST_FIELD(RTL_OSVERSIONINFOEXW, WCHAR[128], szCSDVersion, 20, 256, 2); - TEST_FIELD(RTL_OSVERSIONINFOEXW, WORD, wServicePackMajor, 276, 2, 2); - TEST_FIELD(RTL_OSVERSIONINFOEXW, WORD, wServicePackMinor, 278, 2, 2); - TEST_FIELD(RTL_OSVERSIONINFOEXW, WORD, wSuiteMask, 280, 2, 2); - TEST_FIELD(RTL_OSVERSIONINFOEXW, BYTE, wProductType, 282, 1, 1); - TEST_FIELD(RTL_OSVERSIONINFOEXW, BYTE, wReserved, 283, 1, 1); + TEST_TYPE_SIZE (RTL_OSVERSIONINFOEXW, 284) + TEST_TYPE_ALIGN (RTL_OSVERSIONINFOEXW, 4) + TEST_FIELD_SIZE (RTL_OSVERSIONINFOEXW, dwOSVersionInfoSize, 4) + TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, dwOSVersionInfoSize, 4) + TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, dwOSVersionInfoSize, 0) + TEST_FIELD_SIZE (RTL_OSVERSIONINFOEXW, dwMajorVersion, 4) + TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, dwMajorVersion, 4) + TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, dwMajorVersion, 4) + TEST_FIELD_SIZE (RTL_OSVERSIONINFOEXW, dwMinorVersion, 4) + TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, dwMinorVersion, 4) + TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, dwMinorVersion, 8) + TEST_FIELD_SIZE (RTL_OSVERSIONINFOEXW, dwBuildNumber, 4) + TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, dwBuildNumber, 4) + TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, dwBuildNumber, 12) + TEST_FIELD_SIZE (RTL_OSVERSIONINFOEXW, dwPlatformId, 4) + TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, dwPlatformId, 4) + TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, dwPlatformId, 16) + TEST_FIELD_SIZE (RTL_OSVERSIONINFOEXW, szCSDVersion, 256) + TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, szCSDVersion, 2) + TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, szCSDVersion, 20) + TEST_FIELD_SIZE (RTL_OSVERSIONINFOEXW, wServicePackMajor, 2) + TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, wServicePackMajor, 2) + TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, wServicePackMajor, 276) + TEST_FIELD_SIZE (RTL_OSVERSIONINFOEXW, wServicePackMinor, 2) + TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, wServicePackMinor, 2) + TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, wServicePackMinor, 278) + TEST_FIELD_SIZE (RTL_OSVERSIONINFOEXW, wSuiteMask, 2) + TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, wSuiteMask, 2) + TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, wSuiteMask, 280) + TEST_FIELD_SIZE (RTL_OSVERSIONINFOEXW, wProductType, 1) + TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, wProductType, 1) + TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, wProductType, 282) + TEST_FIELD_SIZE (RTL_OSVERSIONINFOEXW, wReserved, 1) + TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, wReserved, 1) + TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, wReserved, 283) } static void test_pack_RTL_OSVERSIONINFOW(void) { /* RTL_OSVERSIONINFOW (pack 4) */ - TEST_TYPE(RTL_OSVERSIONINFOW, 276, 4); - TEST_FIELD(RTL_OSVERSIONINFOW, DWORD, dwOSVersionInfoSize, 0, 4, 4); - TEST_FIELD(RTL_OSVERSIONINFOW, DWORD, dwMajorVersion, 4, 4, 4); - TEST_FIELD(RTL_OSVERSIONINFOW, DWORD, dwMinorVersion, 8, 4, 4); - TEST_FIELD(RTL_OSVERSIONINFOW, DWORD, dwBuildNumber, 12, 4, 4); - TEST_FIELD(RTL_OSVERSIONINFOW, DWORD, dwPlatformId, 16, 4, 4); - TEST_FIELD(RTL_OSVERSIONINFOW, WCHAR[128], szCSDVersion, 20, 256, 2); + TEST_TYPE_SIZE (RTL_OSVERSIONINFOW, 276) + TEST_TYPE_ALIGN (RTL_OSVERSIONINFOW, 4) + TEST_FIELD_SIZE (RTL_OSVERSIONINFOW, dwOSVersionInfoSize, 4) + TEST_FIELD_ALIGN (RTL_OSVERSIONINFOW, dwOSVersionInfoSize, 4) + TEST_FIELD_OFFSET(RTL_OSVERSIONINFOW, dwOSVersionInfoSize, 0) + TEST_FIELD_SIZE (RTL_OSVERSIONINFOW, dwMajorVersion, 4) + TEST_FIELD_ALIGN (RTL_OSVERSIONINFOW, dwMajorVersion, 4) + TEST_FIELD_OFFSET(RTL_OSVERSIONINFOW, dwMajorVersion, 4) + TEST_FIELD_SIZE (RTL_OSVERSIONINFOW, dwMinorVersion, 4) + TEST_FIELD_ALIGN (RTL_OSVERSIONINFOW, dwMinorVersion, 4) + TEST_FIELD_OFFSET(RTL_OSVERSIONINFOW, dwMinorVersion, 8) + TEST_FIELD_SIZE (RTL_OSVERSIONINFOW, dwBuildNumber, 4) + TEST_FIELD_ALIGN (RTL_OSVERSIONINFOW, dwBuildNumber, 4) + TEST_FIELD_OFFSET(RTL_OSVERSIONINFOW, dwBuildNumber, 12) + TEST_FIELD_SIZE (RTL_OSVERSIONINFOW, dwPlatformId, 4) + TEST_FIELD_ALIGN (RTL_OSVERSIONINFOW, dwPlatformId, 4) + TEST_FIELD_OFFSET(RTL_OSVERSIONINFOW, dwPlatformId, 16) + TEST_FIELD_SIZE (RTL_OSVERSIONINFOW, szCSDVersion, 256) + TEST_FIELD_ALIGN (RTL_OSVERSIONINFOW, szCSDVersion, 2) + TEST_FIELD_OFFSET(RTL_OSVERSIONINFOW, szCSDVersion, 20) } static void test_pack_RTL_RESOURCE_DEBUG(void) { /* RTL_RESOURCE_DEBUG (pack 4) */ - TEST_FIELD(RTL_RESOURCE_DEBUG, WORD, Type, 0, 2, 2); - TEST_FIELD(RTL_RESOURCE_DEBUG, WORD, CreatorBackTraceIndex, 2, 2, 2); - TEST_FIELD(RTL_RESOURCE_DEBUG, struct _RTL_CRITICAL_SECTION *, CriticalSection, 4, 4, 4); - TEST_FIELD(RTL_RESOURCE_DEBUG, LIST_ENTRY, ProcessLocksList, 8, 8, 4); - TEST_FIELD(RTL_RESOURCE_DEBUG, DWORD, EntryCount, 16, 4, 4); - TEST_FIELD(RTL_RESOURCE_DEBUG, DWORD, ContentionCount, 20, 4, 4); + TEST_FIELD_SIZE (RTL_RESOURCE_DEBUG, Type, 2) + TEST_FIELD_ALIGN (RTL_RESOURCE_DEBUG, Type, 2) + TEST_FIELD_OFFSET(RTL_RESOURCE_DEBUG, Type, 0) + TEST_FIELD_SIZE (RTL_RESOURCE_DEBUG, CreatorBackTraceIndex, 2) + TEST_FIELD_ALIGN (RTL_RESOURCE_DEBUG, CreatorBackTraceIndex, 2) + TEST_FIELD_OFFSET(RTL_RESOURCE_DEBUG, CreatorBackTraceIndex, 2) + TEST_FIELD_SIZE (RTL_RESOURCE_DEBUG, CriticalSection, 4) + TEST_FIELD_ALIGN (RTL_RESOURCE_DEBUG, CriticalSection, 4) + TEST_FIELD_OFFSET(RTL_RESOURCE_DEBUG, CriticalSection, 4) + TEST_FIELD_SIZE (RTL_RESOURCE_DEBUG, ProcessLocksList, 8) + TEST_FIELD_ALIGN (RTL_RESOURCE_DEBUG, ProcessLocksList, 4) + TEST_FIELD_OFFSET(RTL_RESOURCE_DEBUG, ProcessLocksList, 8) + TEST_FIELD_SIZE (RTL_RESOURCE_DEBUG, EntryCount, 4) + TEST_FIELD_ALIGN (RTL_RESOURCE_DEBUG, EntryCount, 4) + TEST_FIELD_OFFSET(RTL_RESOURCE_DEBUG, EntryCount, 16) + TEST_FIELD_SIZE (RTL_RESOURCE_DEBUG, ContentionCount, 4) + TEST_FIELD_ALIGN (RTL_RESOURCE_DEBUG, ContentionCount, 4) + TEST_FIELD_OFFSET(RTL_RESOURCE_DEBUG, ContentionCount, 20) } static void test_pack_SECURITY_CONTEXT_TRACKING_MODE(void) { /* SECURITY_CONTEXT_TRACKING_MODE */ - TEST_TYPE(SECURITY_CONTEXT_TRACKING_MODE, 1, 1); + TEST_TYPE_SIZE (SECURITY_CONTEXT_TRACKING_MODE, 1) + TEST_TYPE_ALIGN (SECURITY_CONTEXT_TRACKING_MODE, 1) } static void test_pack_SECURITY_DESCRIPTOR(void) { /* SECURITY_DESCRIPTOR (pack 4) */ - TEST_TYPE(SECURITY_DESCRIPTOR, 20, 4); - TEST_FIELD(SECURITY_DESCRIPTOR, BYTE, Revision, 0, 1, 1); - TEST_FIELD(SECURITY_DESCRIPTOR, BYTE, Sbz1, 1, 1, 1); - TEST_FIELD(SECURITY_DESCRIPTOR, SECURITY_DESCRIPTOR_CONTROL, Control, 2, 2, 2); - TEST_FIELD(SECURITY_DESCRIPTOR, PSID, Owner, 4, 4, 4); - TEST_FIELD(SECURITY_DESCRIPTOR, PSID, Group, 8, 4, 4); - TEST_FIELD(SECURITY_DESCRIPTOR, PACL, Sacl, 12, 4, 4); - TEST_FIELD(SECURITY_DESCRIPTOR, PACL, Dacl, 16, 4, 4); + TEST_TYPE_SIZE (SECURITY_DESCRIPTOR, 20) + TEST_TYPE_ALIGN (SECURITY_DESCRIPTOR, 4) + TEST_FIELD_SIZE (SECURITY_DESCRIPTOR, Revision, 1) + TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR, Revision, 1) + TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR, Revision, 0) + TEST_FIELD_SIZE (SECURITY_DESCRIPTOR, Sbz1, 1) + TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR, Sbz1, 1) + TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR, Sbz1, 1) + TEST_FIELD_SIZE (SECURITY_DESCRIPTOR, Control, 2) + TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR, Control, 2) + TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR, Control, 2) + TEST_FIELD_SIZE (SECURITY_DESCRIPTOR, Owner, 4) + TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR, Owner, 4) + TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR, Owner, 4) + TEST_FIELD_SIZE (SECURITY_DESCRIPTOR, Group, 4) + TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR, Group, 4) + TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR, Group, 8) + TEST_FIELD_SIZE (SECURITY_DESCRIPTOR, Sacl, 4) + TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR, Sacl, 4) + TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR, Sacl, 12) + TEST_FIELD_SIZE (SECURITY_DESCRIPTOR, Dacl, 4) + TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR, Dacl, 4) + TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR, Dacl, 16) } static void test_pack_SECURITY_DESCRIPTOR_CONTROL(void) { /* SECURITY_DESCRIPTOR_CONTROL */ - TEST_TYPE(SECURITY_DESCRIPTOR_CONTROL, 2, 2); - TEST_TYPE_UNSIGNED(SECURITY_DESCRIPTOR_CONTROL); + TEST_TYPE_SIZE (SECURITY_DESCRIPTOR_CONTROL, 2) + TEST_TYPE_ALIGN (SECURITY_DESCRIPTOR_CONTROL, 2) + TEST_TYPE_UNSIGNED(SECURITY_DESCRIPTOR_CONTROL) } static void test_pack_SECURITY_DESCRIPTOR_RELATIVE(void) { /* SECURITY_DESCRIPTOR_RELATIVE (pack 4) */ - TEST_TYPE(SECURITY_DESCRIPTOR_RELATIVE, 20, 4); - TEST_FIELD(SECURITY_DESCRIPTOR_RELATIVE, BYTE, Revision, 0, 1, 1); - TEST_FIELD(SECURITY_DESCRIPTOR_RELATIVE, BYTE, Sbz1, 1, 1, 1); - TEST_FIELD(SECURITY_DESCRIPTOR_RELATIVE, SECURITY_DESCRIPTOR_CONTROL, Control, 2, 2, 2); - TEST_FIELD(SECURITY_DESCRIPTOR_RELATIVE, DWORD, Owner, 4, 4, 4); - TEST_FIELD(SECURITY_DESCRIPTOR_RELATIVE, DWORD, Group, 8, 4, 4); - TEST_FIELD(SECURITY_DESCRIPTOR_RELATIVE, DWORD, Sacl, 12, 4, 4); - TEST_FIELD(SECURITY_DESCRIPTOR_RELATIVE, DWORD, Dacl, 16, 4, 4); + TEST_TYPE_SIZE (SECURITY_DESCRIPTOR_RELATIVE, 20) + TEST_TYPE_ALIGN (SECURITY_DESCRIPTOR_RELATIVE, 4) + TEST_FIELD_SIZE (SECURITY_DESCRIPTOR_RELATIVE, Revision, 1) + TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR_RELATIVE, Revision, 1) + TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR_RELATIVE, Revision, 0) + TEST_FIELD_SIZE (SECURITY_DESCRIPTOR_RELATIVE, Sbz1, 1) + TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR_RELATIVE, Sbz1, 1) + TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR_RELATIVE, Sbz1, 1) + TEST_FIELD_SIZE (SECURITY_DESCRIPTOR_RELATIVE, Control, 2) + TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR_RELATIVE, Control, 2) + TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR_RELATIVE, Control, 2) + TEST_FIELD_SIZE (SECURITY_DESCRIPTOR_RELATIVE, Owner, 4) + TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR_RELATIVE, Owner, 4) + TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR_RELATIVE, Owner, 4) + TEST_FIELD_SIZE (SECURITY_DESCRIPTOR_RELATIVE, Group, 4) + TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR_RELATIVE, Group, 4) + TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR_RELATIVE, Group, 8) + TEST_FIELD_SIZE (SECURITY_DESCRIPTOR_RELATIVE, Sacl, 4) + TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR_RELATIVE, Sacl, 4) + TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR_RELATIVE, Sacl, 12) + TEST_FIELD_SIZE (SECURITY_DESCRIPTOR_RELATIVE, Dacl, 4) + TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR_RELATIVE, Dacl, 4) + TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR_RELATIVE, Dacl, 16) } static void test_pack_SECURITY_INFORMATION(void) { /* SECURITY_INFORMATION */ - TEST_TYPE(SECURITY_INFORMATION, 4, 4); - TEST_TYPE_UNSIGNED(SECURITY_INFORMATION); + TEST_TYPE_SIZE (SECURITY_INFORMATION, 4) + TEST_TYPE_ALIGN (SECURITY_INFORMATION, 4) + TEST_TYPE_UNSIGNED(SECURITY_INFORMATION) } static void test_pack_SECURITY_QUALITY_OF_SERVICE(void) { /* SECURITY_QUALITY_OF_SERVICE (pack 4) */ - TEST_FIELD(SECURITY_QUALITY_OF_SERVICE, DWORD, Length, 0, 4, 4); + TEST_FIELD_SIZE (SECURITY_QUALITY_OF_SERVICE, Length, 4) + TEST_FIELD_ALIGN (SECURITY_QUALITY_OF_SERVICE, Length, 4) + TEST_FIELD_OFFSET(SECURITY_QUALITY_OF_SERVICE, Length, 0) } static void test_pack_SHORT(void) { /* SHORT */ - TEST_TYPE(SHORT, 2, 2); - TEST_TYPE_SIGNED(SHORT); + TEST_TYPE_SIZE (SHORT, 2) + TEST_TYPE_ALIGN (SHORT, 2) + TEST_TYPE_SIGNED(SHORT) } static void test_pack_SID(void) { /* SID (pack 4) */ - TEST_TYPE(SID, 12, 4); - TEST_FIELD(SID, BYTE, Revision, 0, 1, 1); - TEST_FIELD(SID, BYTE, SubAuthorityCount, 1, 1, 1); - TEST_FIELD(SID, SID_IDENTIFIER_AUTHORITY, IdentifierAuthority, 2, 6, 1); - TEST_FIELD(SID, DWORD[1], SubAuthority, 8, 4, 4); + TEST_TYPE_SIZE (SID, 12) + TEST_TYPE_ALIGN (SID, 4) + TEST_FIELD_SIZE (SID, Revision, 1) + TEST_FIELD_ALIGN (SID, Revision, 1) + TEST_FIELD_OFFSET(SID, Revision, 0) + TEST_FIELD_SIZE (SID, SubAuthorityCount, 1) + TEST_FIELD_ALIGN (SID, SubAuthorityCount, 1) + TEST_FIELD_OFFSET(SID, SubAuthorityCount, 1) + TEST_FIELD_SIZE (SID, IdentifierAuthority, 6) + TEST_FIELD_ALIGN (SID, IdentifierAuthority, 1) + TEST_FIELD_OFFSET(SID, IdentifierAuthority, 2) + TEST_FIELD_SIZE (SID, SubAuthority, 4) + TEST_FIELD_ALIGN (SID, SubAuthority, 4) + TEST_FIELD_OFFSET(SID, SubAuthority, 8) } static void test_pack_SID_AND_ATTRIBUTES(void) { /* SID_AND_ATTRIBUTES (pack 4) */ - TEST_TYPE(SID_AND_ATTRIBUTES, 8, 4); - TEST_FIELD(SID_AND_ATTRIBUTES, PSID, Sid, 0, 4, 4); - TEST_FIELD(SID_AND_ATTRIBUTES, DWORD, Attributes, 4, 4, 4); + TEST_TYPE_SIZE (SID_AND_ATTRIBUTES, 8) + TEST_TYPE_ALIGN (SID_AND_ATTRIBUTES, 4) + TEST_FIELD_SIZE (SID_AND_ATTRIBUTES, Sid, 4) + TEST_FIELD_ALIGN (SID_AND_ATTRIBUTES, Sid, 4) + TEST_FIELD_OFFSET(SID_AND_ATTRIBUTES, Sid, 0) + TEST_FIELD_SIZE (SID_AND_ATTRIBUTES, Attributes, 4) + TEST_FIELD_ALIGN (SID_AND_ATTRIBUTES, Attributes, 4) + TEST_FIELD_OFFSET(SID_AND_ATTRIBUTES, Attributes, 4) } static void test_pack_SID_IDENTIFIER_AUTHORITY(void) { /* SID_IDENTIFIER_AUTHORITY (pack 4) */ - TEST_TYPE(SID_IDENTIFIER_AUTHORITY, 6, 1); - TEST_FIELD(SID_IDENTIFIER_AUTHORITY, BYTE[6], Value, 0, 6, 1); + TEST_TYPE_SIZE (SID_IDENTIFIER_AUTHORITY, 6) + TEST_TYPE_ALIGN (SID_IDENTIFIER_AUTHORITY, 1) + TEST_FIELD_SIZE (SID_IDENTIFIER_AUTHORITY, Value, 6) + TEST_FIELD_ALIGN (SID_IDENTIFIER_AUTHORITY, Value, 1) + TEST_FIELD_OFFSET(SID_IDENTIFIER_AUTHORITY, Value, 0) } static void test_pack_SINGLE_LIST_ENTRY(void) { /* SINGLE_LIST_ENTRY (pack 4) */ - TEST_TYPE(SINGLE_LIST_ENTRY, 4, 4); - TEST_FIELD(SINGLE_LIST_ENTRY, struct _SINGLE_LIST_ENTRY *, Next, 0, 4, 4); + TEST_TYPE_SIZE (SINGLE_LIST_ENTRY, 4) + TEST_TYPE_ALIGN (SINGLE_LIST_ENTRY, 4) + TEST_FIELD_SIZE (SINGLE_LIST_ENTRY, Next, 4) + TEST_FIELD_ALIGN (SINGLE_LIST_ENTRY, Next, 4) + TEST_FIELD_OFFSET(SINGLE_LIST_ENTRY, Next, 0) } static void test_pack_SYSTEM_ALARM_ACE(void) { /* SYSTEM_ALARM_ACE (pack 4) */ - TEST_TYPE(SYSTEM_ALARM_ACE, 12, 4); - TEST_FIELD(SYSTEM_ALARM_ACE, ACE_HEADER, Header, 0, 4, 2); - TEST_FIELD(SYSTEM_ALARM_ACE, DWORD, Mask, 4, 4, 4); - TEST_FIELD(SYSTEM_ALARM_ACE, DWORD, SidStart, 8, 4, 4); + TEST_TYPE_SIZE (SYSTEM_ALARM_ACE, 12) + TEST_TYPE_ALIGN (SYSTEM_ALARM_ACE, 4) + TEST_FIELD_SIZE (SYSTEM_ALARM_ACE, Header, 4) + TEST_FIELD_ALIGN (SYSTEM_ALARM_ACE, Header, 2) + TEST_FIELD_OFFSET(SYSTEM_ALARM_ACE, Header, 0) + TEST_FIELD_SIZE (SYSTEM_ALARM_ACE, Mask, 4) + TEST_FIELD_ALIGN (SYSTEM_ALARM_ACE, Mask, 4) + TEST_FIELD_OFFSET(SYSTEM_ALARM_ACE, Mask, 4) + TEST_FIELD_SIZE (SYSTEM_ALARM_ACE, SidStart, 4) + TEST_FIELD_ALIGN (SYSTEM_ALARM_ACE, SidStart, 4) + TEST_FIELD_OFFSET(SYSTEM_ALARM_ACE, SidStart, 8) } static void test_pack_SYSTEM_AUDIT_ACE(void) { /* SYSTEM_AUDIT_ACE (pack 4) */ - TEST_TYPE(SYSTEM_AUDIT_ACE, 12, 4); - TEST_FIELD(SYSTEM_AUDIT_ACE, ACE_HEADER, Header, 0, 4, 2); - TEST_FIELD(SYSTEM_AUDIT_ACE, DWORD, Mask, 4, 4, 4); - TEST_FIELD(SYSTEM_AUDIT_ACE, DWORD, SidStart, 8, 4, 4); + TEST_TYPE_SIZE (SYSTEM_AUDIT_ACE, 12) + TEST_TYPE_ALIGN (SYSTEM_AUDIT_ACE, 4) + TEST_FIELD_SIZE (SYSTEM_AUDIT_ACE, Header, 4) + TEST_FIELD_ALIGN (SYSTEM_AUDIT_ACE, Header, 2) + TEST_FIELD_OFFSET(SYSTEM_AUDIT_ACE, Header, 0) + TEST_FIELD_SIZE (SYSTEM_AUDIT_ACE, Mask, 4) + TEST_FIELD_ALIGN (SYSTEM_AUDIT_ACE, Mask, 4) + TEST_FIELD_OFFSET(SYSTEM_AUDIT_ACE, Mask, 4) + TEST_FIELD_SIZE (SYSTEM_AUDIT_ACE, SidStart, 4) + TEST_FIELD_ALIGN (SYSTEM_AUDIT_ACE, SidStart, 4) + TEST_FIELD_OFFSET(SYSTEM_AUDIT_ACE, SidStart, 8) } static void test_pack_TCHAR(void) { /* TCHAR */ - TEST_TYPE(TCHAR, 1, 1); + TEST_TYPE_SIZE (TCHAR, 1) + TEST_TYPE_ALIGN (TCHAR, 1) } static void test_pack_TOKEN_DEFAULT_DACL(void) { /* TOKEN_DEFAULT_DACL (pack 4) */ - TEST_TYPE(TOKEN_DEFAULT_DACL, 4, 4); - TEST_FIELD(TOKEN_DEFAULT_DACL, PACL, DefaultDacl, 0, 4, 4); + TEST_TYPE_SIZE (TOKEN_DEFAULT_DACL, 4) + TEST_TYPE_ALIGN (TOKEN_DEFAULT_DACL, 4) + TEST_FIELD_SIZE (TOKEN_DEFAULT_DACL, DefaultDacl, 4) + TEST_FIELD_ALIGN (TOKEN_DEFAULT_DACL, DefaultDacl, 4) + TEST_FIELD_OFFSET(TOKEN_DEFAULT_DACL, DefaultDacl, 0) } static void test_pack_TOKEN_GROUPS(void) { /* TOKEN_GROUPS (pack 4) */ - TEST_TYPE(TOKEN_GROUPS, 12, 4); - TEST_FIELD(TOKEN_GROUPS, DWORD, GroupCount, 0, 4, 4); - TEST_FIELD(TOKEN_GROUPS, SID_AND_ATTRIBUTES[ANYSIZE_ARRAY], Groups, 4, 8, 4); + TEST_TYPE_SIZE (TOKEN_GROUPS, 12) + TEST_TYPE_ALIGN (TOKEN_GROUPS, 4) + TEST_FIELD_SIZE (TOKEN_GROUPS, GroupCount, 4) + TEST_FIELD_ALIGN (TOKEN_GROUPS, GroupCount, 4) + TEST_FIELD_OFFSET(TOKEN_GROUPS, GroupCount, 0) + TEST_FIELD_SIZE (TOKEN_GROUPS, Groups, 8) + TEST_FIELD_ALIGN (TOKEN_GROUPS, Groups, 4) + TEST_FIELD_OFFSET(TOKEN_GROUPS, Groups, 4) } static void test_pack_TOKEN_OWNER(void) { /* TOKEN_OWNER (pack 4) */ - TEST_TYPE(TOKEN_OWNER, 4, 4); - TEST_FIELD(TOKEN_OWNER, PSID, Owner, 0, 4, 4); + TEST_TYPE_SIZE (TOKEN_OWNER, 4) + TEST_TYPE_ALIGN (TOKEN_OWNER, 4) + TEST_FIELD_SIZE (TOKEN_OWNER, Owner, 4) + TEST_FIELD_ALIGN (TOKEN_OWNER, Owner, 4) + TEST_FIELD_OFFSET(TOKEN_OWNER, Owner, 0) } static void test_pack_TOKEN_PRIMARY_GROUP(void) { /* TOKEN_PRIMARY_GROUP (pack 4) */ - TEST_TYPE(TOKEN_PRIMARY_GROUP, 4, 4); - TEST_FIELD(TOKEN_PRIMARY_GROUP, PSID, PrimaryGroup, 0, 4, 4); + TEST_TYPE_SIZE (TOKEN_PRIMARY_GROUP, 4) + TEST_TYPE_ALIGN (TOKEN_PRIMARY_GROUP, 4) + TEST_FIELD_SIZE (TOKEN_PRIMARY_GROUP, PrimaryGroup, 4) + TEST_FIELD_ALIGN (TOKEN_PRIMARY_GROUP, PrimaryGroup, 4) + TEST_FIELD_OFFSET(TOKEN_PRIMARY_GROUP, PrimaryGroup, 0) } static void test_pack_TOKEN_PRIVILEGES(void) { /* TOKEN_PRIVILEGES (pack 4) */ - TEST_TYPE(TOKEN_PRIVILEGES, 16, 4); - TEST_FIELD(TOKEN_PRIVILEGES, DWORD, PrivilegeCount, 0, 4, 4); - TEST_FIELD(TOKEN_PRIVILEGES, LUID_AND_ATTRIBUTES[ANYSIZE_ARRAY], Privileges, 4, 12, 4); + TEST_TYPE_SIZE (TOKEN_PRIVILEGES, 16) + TEST_TYPE_ALIGN (TOKEN_PRIVILEGES, 4) + TEST_FIELD_SIZE (TOKEN_PRIVILEGES, PrivilegeCount, 4) + TEST_FIELD_ALIGN (TOKEN_PRIVILEGES, PrivilegeCount, 4) + TEST_FIELD_OFFSET(TOKEN_PRIVILEGES, PrivilegeCount, 0) + TEST_FIELD_SIZE (TOKEN_PRIVILEGES, Privileges, 12) + TEST_FIELD_ALIGN (TOKEN_PRIVILEGES, Privileges, 4) + TEST_FIELD_OFFSET(TOKEN_PRIVILEGES, Privileges, 4) } static void test_pack_TOKEN_SOURCE(void) { /* TOKEN_SOURCE (pack 4) */ - TEST_TYPE(TOKEN_SOURCE, 16, 4); - TEST_FIELD(TOKEN_SOURCE, char[TOKEN_SOURCE_LENGTH], SourceName, 0, 8, 1); - TEST_FIELD(TOKEN_SOURCE, LUID, SourceIdentifier, 8, 8, 4); + TEST_TYPE_SIZE (TOKEN_SOURCE, 16) + TEST_TYPE_ALIGN (TOKEN_SOURCE, 4) + TEST_FIELD_SIZE (TOKEN_SOURCE, SourceName, 8) + TEST_FIELD_ALIGN (TOKEN_SOURCE, SourceName, 1) + TEST_FIELD_OFFSET(TOKEN_SOURCE, SourceName, 0) + TEST_FIELD_SIZE (TOKEN_SOURCE, SourceIdentifier, 8) + TEST_FIELD_ALIGN (TOKEN_SOURCE, SourceIdentifier, 4) + TEST_FIELD_OFFSET(TOKEN_SOURCE, SourceIdentifier, 8) } static void test_pack_TOKEN_STATISTICS(void) { /* TOKEN_STATISTICS (pack 4) */ - TEST_FIELD(TOKEN_STATISTICS, LUID, TokenId, 0, 8, 4); - TEST_FIELD(TOKEN_STATISTICS, LUID, AuthenticationId, 8, 8, 4); - TEST_FIELD(TOKEN_STATISTICS, LARGE_INTEGER, ExpirationTime, 16, 8, 4); + TEST_FIELD_SIZE (TOKEN_STATISTICS, TokenId, 8) + TEST_FIELD_ALIGN (TOKEN_STATISTICS, TokenId, 4) + TEST_FIELD_OFFSET(TOKEN_STATISTICS, TokenId, 0) + TEST_FIELD_SIZE (TOKEN_STATISTICS, AuthenticationId, 8) + TEST_FIELD_ALIGN (TOKEN_STATISTICS, AuthenticationId, 4) + TEST_FIELD_OFFSET(TOKEN_STATISTICS, AuthenticationId, 8) + TEST_FIELD_SIZE (TOKEN_STATISTICS, ExpirationTime, 8) + TEST_FIELD_ALIGN (TOKEN_STATISTICS, ExpirationTime, 4) + TEST_FIELD_OFFSET(TOKEN_STATISTICS, ExpirationTime, 16) } static void test_pack_TOKEN_USER(void) { /* TOKEN_USER (pack 4) */ - TEST_TYPE(TOKEN_USER, 8, 4); - TEST_FIELD(TOKEN_USER, SID_AND_ATTRIBUTES, User, 0, 8, 4); + TEST_TYPE_SIZE (TOKEN_USER, 8) + TEST_TYPE_ALIGN (TOKEN_USER, 4) + TEST_FIELD_SIZE (TOKEN_USER, User, 8) + TEST_FIELD_ALIGN (TOKEN_USER, User, 4) + TEST_FIELD_OFFSET(TOKEN_USER, User, 0) } static void test_pack_ULARGE_INTEGER(void) @@ -1807,324 +2770,410 @@ static void test_pack_ULARGE_INTEGER(void) static void test_pack_ULONGLONG(void) { /* ULONGLONG */ - TEST_TYPE(ULONGLONG, 8, 8); - TEST_TYPE_UNSIGNED(ULONGLONG); + TEST_TYPE_SIZE (ULONGLONG, 8) + TEST_TYPE_ALIGN (ULONGLONG, 8) + TEST_TYPE_UNSIGNED(ULONGLONG) } static void test_pack_WAITORTIMERCALLBACKFUNC(void) { /* WAITORTIMERCALLBACKFUNC */ - TEST_TYPE(WAITORTIMERCALLBACKFUNC, 4, 4); + TEST_TYPE_SIZE (WAITORTIMERCALLBACKFUNC, 4) + TEST_TYPE_ALIGN (WAITORTIMERCALLBACKFUNC, 4) } static void test_pack_WCHAR(void) { /* WCHAR */ - TEST_TYPE(WCHAR, 2, 2); - TEST_TYPE_UNSIGNED(WCHAR); + TEST_TYPE_SIZE (WCHAR, 2) + TEST_TYPE_ALIGN (WCHAR, 2) + TEST_TYPE_UNSIGNED(WCHAR) } static void test_pack_ATOM(void) { /* ATOM */ - TEST_TYPE(ATOM, 2, 2); - TEST_TYPE_UNSIGNED(ATOM); + TEST_TYPE_SIZE (ATOM, 2) + TEST_TYPE_ALIGN (ATOM, 2) + TEST_TYPE_UNSIGNED(ATOM) } static void test_pack_BOOL(void) { /* BOOL */ - TEST_TYPE(BOOL, 4, 4); - TEST_TYPE_SIGNED(BOOL); + TEST_TYPE_SIZE (BOOL, 4) + TEST_TYPE_ALIGN (BOOL, 4) + TEST_TYPE_SIGNED(BOOL) } static void test_pack_BYTE(void) { /* BYTE */ - TEST_TYPE(BYTE, 1, 1); - TEST_TYPE_UNSIGNED(BYTE); + TEST_TYPE_SIZE (BYTE, 1) + TEST_TYPE_ALIGN (BYTE, 1) + TEST_TYPE_UNSIGNED(BYTE) } static void test_pack_COLORREF(void) { /* COLORREF */ - TEST_TYPE(COLORREF, 4, 4); - TEST_TYPE_UNSIGNED(COLORREF); + TEST_TYPE_SIZE (COLORREF, 4) + TEST_TYPE_ALIGN (COLORREF, 4) + TEST_TYPE_UNSIGNED(COLORREF) } static void test_pack_DWORD(void) { /* DWORD */ - TEST_TYPE(DWORD, 4, 4); - TEST_TYPE_UNSIGNED(DWORD); + TEST_TYPE_SIZE (DWORD, 4) + TEST_TYPE_ALIGN (DWORD, 4) + TEST_TYPE_UNSIGNED(DWORD) } static void test_pack_FARPROC(void) { /* FARPROC */ - TEST_TYPE(FARPROC, 4, 4); + TEST_TYPE_SIZE (FARPROC, 4) + TEST_TYPE_ALIGN (FARPROC, 4) } static void test_pack_FLOAT(void) { /* FLOAT */ - TEST_TYPE(FLOAT, 4, 4); + TEST_TYPE_SIZE (FLOAT, 4) + TEST_TYPE_ALIGN (FLOAT, 4) } static void test_pack_GLOBALHANDLE(void) { /* GLOBALHANDLE */ - TEST_TYPE(GLOBALHANDLE, 4, 4); + TEST_TYPE_SIZE (GLOBALHANDLE, 4) + TEST_TYPE_ALIGN (GLOBALHANDLE, 4) } static void test_pack_HCURSOR(void) { /* HCURSOR */ - TEST_TYPE(HCURSOR, 4, 4); - TEST_TYPE_UNSIGNED(HCURSOR); + TEST_TYPE_SIZE (HCURSOR, 4) + TEST_TYPE_ALIGN (HCURSOR, 4) + TEST_TYPE_UNSIGNED(HCURSOR) } static void test_pack_HFILE(void) { /* HFILE */ - TEST_TYPE(HFILE, 4, 4); - TEST_TYPE_SIGNED(HFILE); + TEST_TYPE_SIZE (HFILE, 4) + TEST_TYPE_ALIGN (HFILE, 4) + TEST_TYPE_SIGNED(HFILE) } static void test_pack_HGDIOBJ(void) { /* HGDIOBJ */ - TEST_TYPE(HGDIOBJ, 4, 4); + TEST_TYPE_SIZE (HGDIOBJ, 4) + TEST_TYPE_ALIGN (HGDIOBJ, 4) } static void test_pack_HGLOBAL(void) { /* HGLOBAL */ - TEST_TYPE(HGLOBAL, 4, 4); + TEST_TYPE_SIZE (HGLOBAL, 4) + TEST_TYPE_ALIGN (HGLOBAL, 4) } static void test_pack_HLOCAL(void) { /* HLOCAL */ - TEST_TYPE(HLOCAL, 4, 4); + TEST_TYPE_SIZE (HLOCAL, 4) + TEST_TYPE_ALIGN (HLOCAL, 4) } static void test_pack_HMODULE(void) { /* HMODULE */ - TEST_TYPE(HMODULE, 4, 4); - TEST_TYPE_UNSIGNED(HMODULE); + TEST_TYPE_SIZE (HMODULE, 4) + TEST_TYPE_ALIGN (HMODULE, 4) + TEST_TYPE_UNSIGNED(HMODULE) } static void test_pack_INT(void) { /* INT */ - TEST_TYPE(INT, 4, 4); - TEST_TYPE_SIGNED(INT); + TEST_TYPE_SIZE (INT, 4) + TEST_TYPE_ALIGN (INT, 4) + TEST_TYPE_SIGNED(INT) } static void test_pack_LOCALHANDLE(void) { /* LOCALHANDLE */ - TEST_TYPE(LOCALHANDLE, 4, 4); + TEST_TYPE_SIZE (LOCALHANDLE, 4) + TEST_TYPE_ALIGN (LOCALHANDLE, 4) } static void test_pack_LPARAM(void) { /* LPARAM */ - TEST_TYPE(LPARAM, 4, 4); + TEST_TYPE_SIZE (LPARAM, 4) + TEST_TYPE_ALIGN (LPARAM, 4) } static void test_pack_LPCRECT(void) { /* LPCRECT */ - TEST_TYPE(LPCRECT, 4, 4); - TEST_TYPE_POINTER(LPCRECT, 16, 4); + TEST_TYPE_SIZE (LPCRECT, 4) + TEST_TYPE_ALIGN (LPCRECT, 4) + TEST_TARGET_SIZE (LPCRECT, 16) + TEST_TARGET_ALIGN(LPCRECT, 4) } static void test_pack_LPCRECTL(void) { /* LPCRECTL */ - TEST_TYPE(LPCRECTL, 4, 4); - TEST_TYPE_POINTER(LPCRECTL, 16, 4); + TEST_TYPE_SIZE (LPCRECTL, 4) + TEST_TYPE_ALIGN (LPCRECTL, 4) + TEST_TARGET_SIZE (LPCRECTL, 16) + TEST_TARGET_ALIGN(LPCRECTL, 4) } static void test_pack_LPCVOID(void) { /* LPCVOID */ - TEST_TYPE(LPCVOID, 4, 4); + TEST_TYPE_SIZE (LPCVOID, 4) + TEST_TYPE_ALIGN (LPCVOID, 4) } static void test_pack_LPPOINT(void) { /* LPPOINT */ - TEST_TYPE(LPPOINT, 4, 4); - TEST_TYPE_POINTER(LPPOINT, 8, 4); + TEST_TYPE_SIZE (LPPOINT, 4) + TEST_TYPE_ALIGN (LPPOINT, 4) + TEST_TARGET_SIZE (LPPOINT, 8) + TEST_TARGET_ALIGN(LPPOINT, 4) } static void test_pack_LPRECT(void) { /* LPRECT */ - TEST_TYPE(LPRECT, 4, 4); - TEST_TYPE_POINTER(LPRECT, 16, 4); + TEST_TYPE_SIZE (LPRECT, 4) + TEST_TYPE_ALIGN (LPRECT, 4) + TEST_TARGET_SIZE (LPRECT, 16) + TEST_TARGET_ALIGN(LPRECT, 4) } static void test_pack_LPRECTL(void) { /* LPRECTL */ - TEST_TYPE(LPRECTL, 4, 4); - TEST_TYPE_POINTER(LPRECTL, 16, 4); + TEST_TYPE_SIZE (LPRECTL, 4) + TEST_TYPE_ALIGN (LPRECTL, 4) + TEST_TARGET_SIZE (LPRECTL, 16) + TEST_TARGET_ALIGN(LPRECTL, 4) } static void test_pack_LPSIZE(void) { /* LPSIZE */ - TEST_TYPE(LPSIZE, 4, 4); - TEST_TYPE_POINTER(LPSIZE, 8, 4); + TEST_TYPE_SIZE (LPSIZE, 4) + TEST_TYPE_ALIGN (LPSIZE, 4) + TEST_TARGET_SIZE (LPSIZE, 8) + TEST_TARGET_ALIGN(LPSIZE, 4) } static void test_pack_LRESULT(void) { /* LRESULT */ - TEST_TYPE(LRESULT, 4, 4); + TEST_TYPE_SIZE (LRESULT, 4) + TEST_TYPE_ALIGN (LRESULT, 4) } static void test_pack_POINT(void) { /* POINT (pack 4) */ - TEST_TYPE(POINT, 8, 4); - TEST_FIELD(POINT, LONG, x, 0, 4, 4); - TEST_FIELD(POINT, LONG, y, 4, 4, 4); + TEST_TYPE_SIZE (POINT, 8) + TEST_TYPE_ALIGN (POINT, 4) + TEST_FIELD_SIZE (POINT, x, 4) + TEST_FIELD_ALIGN (POINT, x, 4) + TEST_FIELD_OFFSET(POINT, x, 0) + TEST_FIELD_SIZE (POINT, y, 4) + TEST_FIELD_ALIGN (POINT, y, 4) + TEST_FIELD_OFFSET(POINT, y, 4) } static void test_pack_POINTL(void) { /* POINTL (pack 4) */ - TEST_TYPE(POINTL, 8, 4); - TEST_FIELD(POINTL, LONG, x, 0, 4, 4); - TEST_FIELD(POINTL, LONG, y, 4, 4, 4); + TEST_TYPE_SIZE (POINTL, 8) + TEST_TYPE_ALIGN (POINTL, 4) + TEST_FIELD_SIZE (POINTL, x, 4) + TEST_FIELD_ALIGN (POINTL, x, 4) + TEST_FIELD_OFFSET(POINTL, x, 0) + TEST_FIELD_SIZE (POINTL, y, 4) + TEST_FIELD_ALIGN (POINTL, y, 4) + TEST_FIELD_OFFSET(POINTL, y, 4) } static void test_pack_PPOINT(void) { /* PPOINT */ - TEST_TYPE(PPOINT, 4, 4); - TEST_TYPE_POINTER(PPOINT, 8, 4); + TEST_TYPE_SIZE (PPOINT, 4) + TEST_TYPE_ALIGN (PPOINT, 4) + TEST_TARGET_SIZE (PPOINT, 8) + TEST_TARGET_ALIGN(PPOINT, 4) } static void test_pack_PPOINTL(void) { /* PPOINTL */ - TEST_TYPE(PPOINTL, 4, 4); - TEST_TYPE_POINTER(PPOINTL, 8, 4); + TEST_TYPE_SIZE (PPOINTL, 4) + TEST_TYPE_ALIGN (PPOINTL, 4) + TEST_TARGET_SIZE (PPOINTL, 8) + TEST_TARGET_ALIGN(PPOINTL, 4) } static void test_pack_PRECT(void) { /* PRECT */ - TEST_TYPE(PRECT, 4, 4); - TEST_TYPE_POINTER(PRECT, 16, 4); + TEST_TYPE_SIZE (PRECT, 4) + TEST_TYPE_ALIGN (PRECT, 4) + TEST_TARGET_SIZE (PRECT, 16) + TEST_TARGET_ALIGN(PRECT, 4) } static void test_pack_PRECTL(void) { /* PRECTL */ - TEST_TYPE(PRECTL, 4, 4); - TEST_TYPE_POINTER(PRECTL, 16, 4); + TEST_TYPE_SIZE (PRECTL, 4) + TEST_TYPE_ALIGN (PRECTL, 4) + TEST_TARGET_SIZE (PRECTL, 16) + TEST_TARGET_ALIGN(PRECTL, 4) } static void test_pack_PROC(void) { /* PROC */ - TEST_TYPE(PROC, 4, 4); + TEST_TYPE_SIZE (PROC, 4) + TEST_TYPE_ALIGN (PROC, 4) } static void test_pack_PSIZE(void) { /* PSIZE */ - TEST_TYPE(PSIZE, 4, 4); - TEST_TYPE_POINTER(PSIZE, 8, 4); + TEST_TYPE_SIZE (PSIZE, 4) + TEST_TYPE_ALIGN (PSIZE, 4) + TEST_TARGET_SIZE (PSIZE, 8) + TEST_TARGET_ALIGN(PSIZE, 4) } static void test_pack_PSZ(void) { /* PSZ */ - TEST_TYPE(PSZ, 4, 4); + TEST_TYPE_SIZE (PSZ, 4) + TEST_TYPE_ALIGN (PSZ, 4) } static void test_pack_RECT(void) { /* RECT (pack 4) */ - TEST_TYPE(RECT, 16, 4); - TEST_FIELD(RECT, LONG, left, 0, 4, 4); - TEST_FIELD(RECT, LONG, top, 4, 4, 4); - TEST_FIELD(RECT, LONG, right, 8, 4, 4); - TEST_FIELD(RECT, LONG, bottom, 12, 4, 4); + TEST_TYPE_SIZE (RECT, 16) + TEST_TYPE_ALIGN (RECT, 4) + TEST_FIELD_SIZE (RECT, left, 4) + TEST_FIELD_ALIGN (RECT, left, 4) + TEST_FIELD_OFFSET(RECT, left, 0) + TEST_FIELD_SIZE (RECT, top, 4) + TEST_FIELD_ALIGN (RECT, top, 4) + TEST_FIELD_OFFSET(RECT, top, 4) + TEST_FIELD_SIZE (RECT, right, 4) + TEST_FIELD_ALIGN (RECT, right, 4) + TEST_FIELD_OFFSET(RECT, right, 8) + TEST_FIELD_SIZE (RECT, bottom, 4) + TEST_FIELD_ALIGN (RECT, bottom, 4) + TEST_FIELD_OFFSET(RECT, bottom, 12) } static void test_pack_RECTL(void) { /* RECTL (pack 4) */ - TEST_TYPE(RECTL, 16, 4); - TEST_FIELD(RECTL, LONG, left, 0, 4, 4); - TEST_FIELD(RECTL, LONG, top, 4, 4, 4); - TEST_FIELD(RECTL, LONG, right, 8, 4, 4); - TEST_FIELD(RECTL, LONG, bottom, 12, 4, 4); + TEST_TYPE_SIZE (RECTL, 16) + TEST_TYPE_ALIGN (RECTL, 4) + TEST_FIELD_SIZE (RECTL, left, 4) + TEST_FIELD_ALIGN (RECTL, left, 4) + TEST_FIELD_OFFSET(RECTL, left, 0) + TEST_FIELD_SIZE (RECTL, top, 4) + TEST_FIELD_ALIGN (RECTL, top, 4) + TEST_FIELD_OFFSET(RECTL, top, 4) + TEST_FIELD_SIZE (RECTL, right, 4) + TEST_FIELD_ALIGN (RECTL, right, 4) + TEST_FIELD_OFFSET(RECTL, right, 8) + TEST_FIELD_SIZE (RECTL, bottom, 4) + TEST_FIELD_ALIGN (RECTL, bottom, 4) + TEST_FIELD_OFFSET(RECTL, bottom, 12) } static void test_pack_SIZE(void) { /* SIZE (pack 4) */ - TEST_TYPE(SIZE, 8, 4); - TEST_FIELD(SIZE, LONG, cx, 0, 4, 4); - TEST_FIELD(SIZE, LONG, cy, 4, 4, 4); + TEST_TYPE_SIZE (SIZE, 8) + TEST_TYPE_ALIGN (SIZE, 4) + TEST_FIELD_SIZE (SIZE, cx, 4) + TEST_FIELD_ALIGN (SIZE, cx, 4) + TEST_FIELD_OFFSET(SIZE, cx, 0) + TEST_FIELD_SIZE (SIZE, cy, 4) + TEST_FIELD_ALIGN (SIZE, cy, 4) + TEST_FIELD_OFFSET(SIZE, cy, 4) } static void test_pack_SIZEL(void) { /* SIZEL */ - TEST_TYPE(SIZEL, 8, 4); + TEST_TYPE_SIZE (SIZEL, 8) + TEST_TYPE_ALIGN (SIZEL, 4) } static void test_pack_UCHAR(void) { /* UCHAR */ - TEST_TYPE(UCHAR, 1, 1); - TEST_TYPE_UNSIGNED(UCHAR); + TEST_TYPE_SIZE (UCHAR, 1) + TEST_TYPE_ALIGN (UCHAR, 1) + TEST_TYPE_UNSIGNED(UCHAR) } static void test_pack_UINT(void) { /* UINT */ - TEST_TYPE(UINT, 4, 4); - TEST_TYPE_UNSIGNED(UINT); + TEST_TYPE_SIZE (UINT, 4) + TEST_TYPE_ALIGN (UINT, 4) + TEST_TYPE_UNSIGNED(UINT) } static void test_pack_ULONG(void) { /* ULONG */ - TEST_TYPE(ULONG, 4, 4); - TEST_TYPE_UNSIGNED(ULONG); + TEST_TYPE_SIZE (ULONG, 4) + TEST_TYPE_ALIGN (ULONG, 4) + TEST_TYPE_UNSIGNED(ULONG) } static void test_pack_USHORT(void) { /* USHORT */ - TEST_TYPE(USHORT, 2, 2); - TEST_TYPE_UNSIGNED(USHORT); + TEST_TYPE_SIZE (USHORT, 2) + TEST_TYPE_ALIGN (USHORT, 2) + TEST_TYPE_UNSIGNED(USHORT) } static void test_pack_WORD(void) { /* WORD */ - TEST_TYPE(WORD, 2, 2); - TEST_TYPE_UNSIGNED(WORD); + TEST_TYPE_SIZE (WORD, 2) + TEST_TYPE_ALIGN (WORD, 2) + TEST_TYPE_UNSIGNED(WORD) } static void test_pack_WPARAM(void) { /* WPARAM */ - TEST_TYPE(WPARAM, 4, 4); + TEST_TYPE_SIZE (WPARAM, 4) + TEST_TYPE_ALIGN (WPARAM, 4) } static void test_pack(void) @@ -2387,5 +3436,9 @@ static void test_pack(void) START_TEST(generated) { +#ifdef _WIN64 + ok(0, "The type size / alignment tests don't support Win64 yet\n"); +#else test_pack(); +#endif } diff --git a/dlls/ntdll/tests/string.c b/dlls/ntdll/tests/string.c index 6f4d85bdd85..16c11926016 100644 --- a/dlls/ntdll/tests/string.c +++ b/dlls/ntdll/tests/string.c @@ -621,11 +621,13 @@ static void one_ui64toa_test(int test_num, const ulonglong2str_t *ulonglong2str) dest_str[LARGE_STRI_BUFFER_LENGTH] = '\0'; result = p_ui64toa(ulonglong2str->value, dest_str, ulonglong2str->base); ok(result == dest_str, - "(test %d): _ui64toa(%Lu, [out], %d) has result %p, expected: %p\n", - test_num, ulonglong2str->value, ulonglong2str->base, result, dest_str); + "(test %d): _ui64toa(%08x%08x, [out], %d) has result %p, expected: %p\n", + test_num, (DWORD)(ulonglong2str->value >> 32), (DWORD)ulonglong2str->value, + ulonglong2str->base, result, dest_str); ok(memcmp(dest_str, ulonglong2str->Buffer, LARGE_STRI_BUFFER_LENGTH) == 0, - "(test %d): _ui64toa(%Lu, [out], %d) assigns string \"%s\", expected: \"%s\"\n", - test_num, ulonglong2str->value, ulonglong2str->base, dest_str, ulonglong2str->Buffer); + "(test %d): _ui64toa(%08x%08x, [out], %d) assigns string \"%s\", expected: \"%s\"\n", + test_num, (DWORD)(ulonglong2str->value >> 32), (DWORD)ulonglong2str->value, + ulonglong2str->base, dest_str, ulonglong2str->Buffer); } diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c index d2610e9546c..59fc491a634 100644 --- a/dlls/ntdll/virtual.c +++ b/dlls/ntdll/virtual.c @@ -123,7 +123,7 @@ static void *user_space_limit = (void *)0x7fff0000; /* top of the user addre static void *working_set_limit = (void *)0x7fff0000; /* top of the current working set */ #else static UINT page_shift; -static UINT page_size; +static UINT_PTR page_size; static UINT_PTR page_mask; static void *address_space_limit; static void *user_space_limit; diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index d27014f7d79..81c4f33c104 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -118,12 +118,12 @@ static HANDLE get_device_manager(void) static LONG CALLBACK vectored_handler( EXCEPTION_POINTERS *ptrs ) { EXCEPTION_RECORD *record = ptrs->ExceptionRecord; - CONTEXT *context = ptrs->ContextRecord; if (record->ExceptionCode == EXCEPTION_ACCESS_VIOLATION || record->ExceptionCode == EXCEPTION_PRIV_INSTRUCTION) { #ifdef __i386__ + CONTEXT *context = ptrs->ContextRecord; extern DWORD __wine_emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context ); if (__wine_emulate_instruction( record, context ) == ExceptionContinueExecution) @@ -1068,7 +1068,7 @@ NTSTATUS WINAPI PsCreateSystemThread(PHANDLE ThreadHandle, ULONG DesiredAccess, */ HANDLE WINAPI PsGetCurrentProcessId(void) { - return (HANDLE)GetCurrentProcessId(); /* FIXME: not quite right... */ + return UlongToHandle(GetCurrentProcessId()); /* FIXME: not quite right... */ } @@ -1077,7 +1077,7 @@ HANDLE WINAPI PsGetCurrentProcessId(void) */ HANDLE WINAPI PsGetCurrentThreadId(void) { - return (HANDLE)GetCurrentThreadId(); /* FIXME: not quite right... */ + return UlongToHandle(GetCurrentThreadId()); /* FIXME: not quite right... */ } diff --git a/dlls/ole32/clipboard.c b/dlls/ole32/clipboard.c index a3586542d09..8cfaffc2f0d 100644 --- a/dlls/ole32/clipboard.c +++ b/dlls/ole32/clipboard.c @@ -80,9 +80,10 @@ #include "compobj_private.h" +WINE_DEFAULT_DEBUG_CHANNEL(ole); + #define HANDLE_ERROR(err) do { hr = err; TRACE("(HRESULT=%x)\n", (HRESULT)err); goto CLEANUP; } while (0) -WINE_DEFAULT_DEBUG_CHANNEL(ole); /**************************************************************************** * OLEClipbrd diff --git a/dlls/ole32/moniker.c b/dlls/ole32/moniker.c index c5b5c2f5845..68a4cc6be2e 100644 --- a/dlls/ole32/moniker.c +++ b/dlls/ole32/moniker.c @@ -1344,7 +1344,7 @@ static ULONG WINAPI EnumMonikerImpl_Release(IEnumMoniker* iface) return ref; } /*********************************************************************** - * EnmumMoniker_Next + * EnumMoniker_Next */ static HRESULT WINAPI EnumMonikerImpl_Next(IEnumMoniker* iface, ULONG celt, IMoniker** rgelt, ULONG * pceltFetched) { @@ -1379,7 +1379,7 @@ static HRESULT WINAPI EnumMonikerImpl_Next(IEnumMoniker* iface, ULONG celt, IM } /*********************************************************************** - * EnmumMoniker_Skip + * EnumMoniker_Skip */ static HRESULT WINAPI EnumMonikerImpl_Skip(IEnumMoniker* iface, ULONG celt) { @@ -1396,7 +1396,7 @@ static HRESULT WINAPI EnumMonikerImpl_Skip(IEnumMoniker* iface, ULONG celt) } /*********************************************************************** - * EnmumMoniker_Reset + * EnumMoniker_Reset */ static HRESULT WINAPI EnumMonikerImpl_Reset(IEnumMoniker* iface) { @@ -1410,7 +1410,7 @@ static HRESULT WINAPI EnumMonikerImpl_Reset(IEnumMoniker* iface) } /*********************************************************************** - * EnmumMoniker_Clone + * EnumMoniker_Clone */ static HRESULT WINAPI EnumMonikerImpl_Clone(IEnumMoniker* iface, IEnumMoniker ** ppenum) { diff --git a/dlls/ole32/tests/moniker.c b/dlls/ole32/tests/moniker.c index b959e74fd85..34169850203 100644 --- a/dlls/ole32/tests/moniker.c +++ b/dlls/ole32/tests/moniker.c @@ -1332,6 +1332,9 @@ static void test_class_moniker(void) ok_ole_success(hr, CreateBindCtx); /* IsRunning test */ + hr = IMoniker_IsRunning(moniker, NULL, NULL, NULL); + ok(hr == E_NOTIMPL, "IMoniker_IsRunning should return E_NOTIMPL, not 0x%08x\n", hr); + hr = IMoniker_IsRunning(moniker, bindctx, NULL, NULL); ok(hr == E_NOTIMPL, "IMoniker_IsRunning should return E_NOTIMPL, not 0x%08x\n", hr); @@ -1461,6 +1464,10 @@ static void test_item_moniker(void) ok_ole_success(hr, CreateBindCtx); /* IsRunning test */ + hr = IMoniker_IsRunning(moniker, NULL, NULL, NULL); + todo_wine + ok(hr == E_INVALIDARG, "IMoniker_IsRunning should return E_INVALIDARG, not 0x%08x\n", hr); + hr = IMoniker_IsRunning(moniker, bindctx, NULL, NULL); ok(hr == S_FALSE, "IMoniker_IsRunning should return S_FALSE, not 0x%08x\n", hr); @@ -1593,6 +1600,10 @@ static void test_generic_composite_moniker(void) ok_ole_success(hr, CreateBindCtx); /* IsRunning test */ + hr = IMoniker_IsRunning(moniker, NULL, NULL, NULL); + todo_wine + ok(hr == E_INVALIDARG, "IMoniker_IsRunning should return E_INVALIDARG, not 0x%08x\n", hr); + hr = IMoniker_IsRunning(moniker, bindctx, NULL, NULL); todo_wine ok(hr == S_FALSE, "IMoniker_IsRunning should return S_FALSE, not 0x%08x\n", hr); diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c index a0f18558784..c80f3578754 100644 --- a/dlls/oleaut32/olepicture.c +++ b/dlls/oleaut32/olepicture.c @@ -529,16 +529,16 @@ static HRESULT WINAPI OLEPictureImpl_get_Handle(IPicture *iface, *phandle = 0; break; case PICTYPE_BITMAP: - *phandle = (OLE_HANDLE)This->desc.u.bmp.hbitmap; + *phandle = HandleToUlong(This->desc.u.bmp.hbitmap); break; case PICTYPE_METAFILE: - *phandle = (OLE_HANDLE)This->desc.u.wmf.hmeta; + *phandle = HandleToUlong(This->desc.u.wmf.hmeta); break; case PICTYPE_ICON: - *phandle = (OLE_HANDLE)This->desc.u.icon.hicon; + *phandle = HandleToUlong(This->desc.u.icon.hicon); break; case PICTYPE_ENHMETAFILE: - *phandle = (OLE_HANDLE)This->desc.u.emf.hemf; + *phandle = HandleToUlong(This->desc.u.emf.hemf); break; default: FIXME("Unimplemented type %d\n", This->desc.picType); @@ -568,7 +568,7 @@ static HRESULT WINAPI OLEPictureImpl_get_hPal(IPicture *iface, hres = S_FALSE; break; case PICTYPE_BITMAP: - *phandle = (OLE_HANDLE)This->desc.u.bmp.hpal; + *phandle = HandleToUlong(This->desc.u.bmp.hpal); hres = S_OK; break; case PICTYPE_METAFILE: @@ -782,7 +782,7 @@ static HRESULT WINAPI OLEPictureImpl_SelectPicture(IPicture *iface, *phdcOut = This->hDCCur; This->hDCCur = hdcIn; if (phbmpOut) - *phbmpOut = (OLE_HANDLE)This->desc.u.bmp.hbitmap; + *phbmpOut = HandleToUlong(This->desc.u.bmp.hbitmap); return S_OK; } else { FIXME("Don't know how to select picture type %d\n",This->desc.picType); diff --git a/dlls/oleaut32/tests/safearray.c b/dlls/oleaut32/tests/safearray.c index 0a031415a02..4fc615eed54 100644 --- a/dlls/oleaut32/tests/safearray.c +++ b/dlls/oleaut32/tests/safearray.c @@ -275,7 +275,7 @@ static struct { static void test_safearray(void) { SAFEARRAY *a, b, *c; - unsigned int i; + unsigned int i, diff; LONG indices[2]; HRESULT hres; SAFEARRAYBOUND bound, bounds[2]; @@ -434,19 +434,22 @@ static void test_safearray(void) indices[1] = 23; hres = SafeArrayPtrOfIndex(a, indices, (void**)&ptr2); ok(S_OK == hres,"SAPOI failed [1,23], hres 0x%x\n",hres); - ok(ptr2 - ptr1 == 8,"ptr difference is not 8, but %d (%p vs %p)\n", ptr2-ptr1, ptr2, ptr1); + diff = ptr2 - ptr1; + ok(diff == 8,"ptr difference is not 8, but %d (%p vs %p)\n", diff, ptr2, ptr1); indices[0] = 3; indices[1] = 24; hres = SafeArrayPtrOfIndex(a, indices, (void**)&ptr2); ok(S_OK == hres,"SAPOI failed [5,24], hres 0x%x\n",hres); - ok(ptr2 - ptr1 == 176,"ptr difference is not 176, but %d (%p vs %p)\n", ptr2-ptr1, ptr2, ptr1); + diff = ptr2 - ptr1; + ok(diff == 176,"ptr difference is not 176, but %d (%p vs %p)\n", diff, ptr2, ptr1); indices[0] = 20; indices[1] = 23; hres = SafeArrayPtrOfIndex(a, indices, (void**)&ptr2); ok(S_OK == hres,"SAPOI failed [20,23], hres 0x%x\n",hres); - ok(ptr2 - ptr1 == 76,"ptr difference is not 76, but %d (%p vs %p)\n", ptr2-ptr1, ptr2, ptr1); + diff = ptr2 - ptr1; + ok(diff == 76,"ptr difference is not 76, but %d (%p vs %p)\n", diff, ptr2, ptr1); hres = SafeArrayUnaccessData(a); ok(S_OK == hres, "SAUAD failed with 0x%x\n", hres); diff --git a/dlls/oleaut32/tests/vartest.c b/dlls/oleaut32/tests/vartest.c index 61225e41442..648c959b691 100644 --- a/dlls/oleaut32/tests/vartest.c +++ b/dlls/oleaut32/tests/vartest.c @@ -2838,7 +2838,7 @@ static void test_VarFix(void) S1(U1(*pdec)).Mid32 = 0; S1(U1(*pdec)).Lo32 = 1; hres = pVarFix(&v,&vDst); - ok(hres == S_OK && V_VT(&vDst) == VT_DECIMAL && !memcmp(&v, &vDst, sizeof(v)), + ok(hres == S_OK && V_VT(&vDst) == VT_DECIMAL && !memcmp(&V_DECIMAL(&v), &V_DECIMAL(&vDst), sizeof(DECIMAL)), "VarFix: expected 0x0,%d,identical, got 0x%X,%d\n", VT_DECIMAL, hres, V_VT(&vDst)); @@ -2953,7 +2953,7 @@ static void test_VarInt(void) S1(U1(*pdec)).Mid32 = 0; S1(U1(*pdec)).Lo32 = 1; hres = pVarInt(&v,&vDst); - ok(hres == S_OK && V_VT(&vDst) == VT_DECIMAL && !memcmp(&v, &vDst, sizeof(v)), + ok(hres == S_OK && V_VT(&vDst) == VT_DECIMAL && !memcmp(&V_DECIMAL(&v), &V_DECIMAL(&vDst), sizeof(DECIMAL)), "VarInt: expected 0x0,%d,identical, got 0x%X,%d\n", VT_DECIMAL, hres, V_VT(&vDst)); diff --git a/dlls/oleaut32/tests/vartype.c b/dlls/oleaut32/tests/vartype.c index e2db5196562..6e3136d39bc 100644 --- a/dlls/oleaut32/tests/vartype.c +++ b/dlls/oleaut32/tests/vartype.c @@ -5060,7 +5060,7 @@ static void test_SysStringByteLen(void) BSTR str = GetBSTR(&bstr); bstr.dwLen = 0; - ok (SysStringByteLen(str) == 0, "Expected dwLen 0, got %d\n", SysStringLen(str)); + ok (SysStringByteLen(str) == 0, "Expected dwLen 0, got %d\n", SysStringByteLen(str)); bstr.dwLen = 2; ok (SysStringByteLen(str) == 2, "Expected dwLen 2, got %d\n", SysStringByteLen(str)); } diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index d02a92ab92e..7235b280885 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -3,14 +3,18 @@ use strict; # This script is called thus : # -# make_opengl path_to_spec_file opengl_version +# make_opengl [opengl_version] +# +# - It needs the gl.spec and gl.tm files in the current directory. +# These files are hosted in the OpenGL extension registry at +# opengl.org: # -# - path_to_spec_file is the path to the directory where the OpenGL -# spec files are located. These files are hosted in the OpenGL -# extension registry at opengl.org: # http://www.opengl.org/registry/api/gl.spec # http://www.opengl.org/registry/api/gl.tm # +# If they are not found in the current directory the script will +# attempt to download them from there. +# # The files used to be hosted and maintained by SGI. You can still find # find them in the sample implementation CVS tree which is located at # CVS_ROOT/projects/ogl-sample/main/doc/registry/specs. @@ -18,7 +22,7 @@ use strict; # http://oss.sgi.com/cgi-bin/cvsweb.cgi/projects/ogl-sample/main/doc/registry/specs/ # # - opengl_version is the OpenGL version emulated by the library -# (can be 1.0 to 1.5). +# (can be 1.0 to 1.5). The default is 1.2. # # This script generates the three following files : # @@ -119,10 +123,10 @@ my %debug_conv = "GLuint" => "%d", "GLushort" => "%d", "GLhalfNV" => "%d", - "GLintptrARB" => "%d", - "GLsizeiptrARB" => "%d", - "GLintptr" => "%d", - "GLsizeiptr" => "%d", + "GLintptrARB" => "%ld", + "GLsizeiptrARB" => "%ld", + "GLintptr" => "%ld", + "GLsizeiptr" => "%ld", "GLhandleARB" => "%d", "GLcharARB" => "%c", "GLvoid" => "(void)", @@ -166,10 +170,10 @@ sub ConvertType($) my ($type) = @_; my %hash = ( "GLstring" => "const GLubyte *", - "GLintptrARB" => "ptrdiff_t", - "GLsizeiptrARB" => "ptrdiff_t", - "GLintptr" => "ptrdiff_t", - "GLsizeiptr" => "ptrdiff_t", + "GLintptrARB" => "INT_PTR", + "GLsizeiptrARB" => "INT_PTR", + "GLintptr" => "INT_PTR", + "GLsizeiptr" => "INT_PTR", "GLhandleARB" => "unsigned int", "GLcharARB" => "char", "GLchar" => "char", @@ -283,13 +287,12 @@ sub GenerateThunk($$$$$) # # Extract and checks the number of arguments # -if (@ARGV != 2) { +if (@ARGV > 1) { my $name0=$0; $name0=~s%^.*/%%; - die "Usage: $name0 OpenGL_registry_location OpenGL_version\n"; + die "Usage: $name0 [version]\n"; } -my $registry_path = shift @ARGV; -my $version = shift @ARGV; +my $version = $ARGV[0] || "1.2"; if ($version eq "1.0") { %norm_categories = %cat_1_0; } elsif ($version eq "1.1") { @@ -307,10 +310,16 @@ if ($version eq "1.0") { } # +# Fetch the registry files +# +-f "gl.spec" || system "wget http://www.opengl.org/registry/api/gl.spec" || die "cannot download gl.spec"; +-f "gl.tm" || system "wget http://www.opengl.org/registry/api/gl.tm" || die "cannot download gl.tm"; + +# # Open the registry files # -open(TYPES, "$registry_path/gl.tm") || die "Could not open 'gl.tm'. Please check your path in the registry files.\n"; -open(REGISTRY, "$registry_path/gl.spec") || die "Could not open 'gl.spec'. Please check your path in the registry files.\n"; +open(TYPES, "gl.tm") || die "Could not open gl.tm"; +open(REGISTRY, "gl.spec") || die "Could not open gl.spec"; # # First, create a mapping between the pseudo types used in the spec file diff --git a/dlls/opengl32/opengl_ext.c b/dlls/opengl32/opengl_ext.c index 77ad92640c1..7e7755e54ed 100644 --- a/dlls/opengl32/opengl_ext.c +++ b/dlls/opengl32/opengl_ext.c @@ -1761,41 +1761,41 @@ static void WINAPI wine_glBindBufferBaseNV( GLenum target, GLuint index, GLuint LEAVE_GL(); } -static void WINAPI wine_glBindBufferOffsetEXT( GLenum target, GLuint index, GLuint buffer, ptrdiff_t offset ) { - void (*func_glBindBufferOffsetEXT)( GLenum, GLuint, GLuint, ptrdiff_t ) = extension_funcs[EXT_glBindBufferOffsetEXT]; - TRACE("(%d, %d, %d, %d)\n", target, index, buffer, offset ); +static void WINAPI wine_glBindBufferOffsetEXT( GLenum target, GLuint index, GLuint buffer, INT_PTR offset ) { + void (*func_glBindBufferOffsetEXT)( GLenum, GLuint, GLuint, INT_PTR ) = extension_funcs[EXT_glBindBufferOffsetEXT]; + TRACE("(%d, %d, %d, %ld)\n", target, index, buffer, offset ); ENTER_GL(); func_glBindBufferOffsetEXT( target, index, buffer, offset ); LEAVE_GL(); } -static void WINAPI wine_glBindBufferOffsetNV( GLenum target, GLuint index, GLuint buffer, ptrdiff_t offset ) { - void (*func_glBindBufferOffsetNV)( GLenum, GLuint, GLuint, ptrdiff_t ) = extension_funcs[EXT_glBindBufferOffsetNV]; - TRACE("(%d, %d, %d, %d)\n", target, index, buffer, offset ); +static void WINAPI wine_glBindBufferOffsetNV( GLenum target, GLuint index, GLuint buffer, INT_PTR offset ) { + void (*func_glBindBufferOffsetNV)( GLenum, GLuint, GLuint, INT_PTR ) = extension_funcs[EXT_glBindBufferOffsetNV]; + TRACE("(%d, %d, %d, %ld)\n", target, index, buffer, offset ); ENTER_GL(); func_glBindBufferOffsetNV( target, index, buffer, offset ); LEAVE_GL(); } -static void WINAPI wine_glBindBufferRange( GLenum target, GLuint index, GLuint buffer, ptrdiff_t offset, ptrdiff_t size ) { - void (*func_glBindBufferRange)( GLenum, GLuint, GLuint, ptrdiff_t, ptrdiff_t ) = extension_funcs[EXT_glBindBufferRange]; - TRACE("(%d, %d, %d, %d, %d)\n", target, index, buffer, offset, size ); +static void WINAPI wine_glBindBufferRange( GLenum target, GLuint index, GLuint buffer, INT_PTR offset, INT_PTR size ) { + void (*func_glBindBufferRange)( GLenum, GLuint, GLuint, INT_PTR, INT_PTR ) = extension_funcs[EXT_glBindBufferRange]; + TRACE("(%d, %d, %d, %ld, %ld)\n", target, index, buffer, offset, size ); ENTER_GL(); func_glBindBufferRange( target, index, buffer, offset, size ); LEAVE_GL(); } -static void WINAPI wine_glBindBufferRangeEXT( GLenum target, GLuint index, GLuint buffer, ptrdiff_t offset, ptrdiff_t size ) { - void (*func_glBindBufferRangeEXT)( GLenum, GLuint, GLuint, ptrdiff_t, ptrdiff_t ) = extension_funcs[EXT_glBindBufferRangeEXT]; - TRACE("(%d, %d, %d, %d, %d)\n", target, index, buffer, offset, size ); +static void WINAPI wine_glBindBufferRangeEXT( GLenum target, GLuint index, GLuint buffer, INT_PTR offset, INT_PTR size ) { + void (*func_glBindBufferRangeEXT)( GLenum, GLuint, GLuint, INT_PTR, INT_PTR ) = extension_funcs[EXT_glBindBufferRangeEXT]; + TRACE("(%d, %d, %d, %ld, %ld)\n", target, index, buffer, offset, size ); ENTER_GL(); func_glBindBufferRangeEXT( target, index, buffer, offset, size ); LEAVE_GL(); } -static void WINAPI wine_glBindBufferRangeNV( GLenum target, GLuint index, GLuint buffer, ptrdiff_t offset, ptrdiff_t size ) { - void (*func_glBindBufferRangeNV)( GLenum, GLuint, GLuint, ptrdiff_t, ptrdiff_t ) = extension_funcs[EXT_glBindBufferRangeNV]; - TRACE("(%d, %d, %d, %d, %d)\n", target, index, buffer, offset, size ); +static void WINAPI wine_glBindBufferRangeNV( GLenum target, GLuint index, GLuint buffer, INT_PTR offset, INT_PTR size ) { + void (*func_glBindBufferRangeNV)( GLenum, GLuint, GLuint, INT_PTR, INT_PTR ) = extension_funcs[EXT_glBindBufferRangeNV]; + TRACE("(%d, %d, %d, %ld, %ld)\n", target, index, buffer, offset, size ); ENTER_GL(); func_glBindBufferRangeNV( target, index, buffer, offset, size ); LEAVE_GL(); @@ -2123,17 +2123,17 @@ static void WINAPI wine_glBlitFramebufferEXT( GLint srcX0, GLint srcY0, GLint sr LEAVE_GL(); } -static void WINAPI wine_glBufferData( GLenum target, ptrdiff_t size, GLvoid* data, GLenum usage ) { - void (*func_glBufferData)( GLenum, ptrdiff_t, GLvoid*, GLenum ) = extension_funcs[EXT_glBufferData]; - TRACE("(%d, %d, %p, %d)\n", target, size, data, usage ); +static void WINAPI wine_glBufferData( GLenum target, INT_PTR size, GLvoid* data, GLenum usage ) { + void (*func_glBufferData)( GLenum, INT_PTR, GLvoid*, GLenum ) = extension_funcs[EXT_glBufferData]; + TRACE("(%d, %ld, %p, %d)\n", target, size, data, usage ); ENTER_GL(); func_glBufferData( target, size, data, usage ); LEAVE_GL(); } -static void WINAPI wine_glBufferDataARB( GLenum target, ptrdiff_t size, GLvoid* data, GLenum usage ) { - void (*func_glBufferDataARB)( GLenum, ptrdiff_t, GLvoid*, GLenum ) = extension_funcs[EXT_glBufferDataARB]; - TRACE("(%d, %d, %p, %d)\n", target, size, data, usage ); +static void WINAPI wine_glBufferDataARB( GLenum target, INT_PTR size, GLvoid* data, GLenum usage ) { + void (*func_glBufferDataARB)( GLenum, INT_PTR, GLvoid*, GLenum ) = extension_funcs[EXT_glBufferDataARB]; + TRACE("(%d, %ld, %p, %d)\n", target, size, data, usage ); ENTER_GL(); func_glBufferDataARB( target, size, data, usage ); LEAVE_GL(); @@ -2157,17 +2157,17 @@ static GLuint WINAPI wine_glBufferRegionEnabled( void ) { return ret_value; } -static void WINAPI wine_glBufferSubData( GLenum target, ptrdiff_t offset, ptrdiff_t size, GLvoid* data ) { - void (*func_glBufferSubData)( GLenum, ptrdiff_t, ptrdiff_t, GLvoid* ) = extension_funcs[EXT_glBufferSubData]; - TRACE("(%d, %d, %d, %p)\n", target, offset, size, data ); +static void WINAPI wine_glBufferSubData( GLenum target, INT_PTR offset, INT_PTR size, GLvoid* data ) { + void (*func_glBufferSubData)( GLenum, INT_PTR, INT_PTR, GLvoid* ) = extension_funcs[EXT_glBufferSubData]; + TRACE("(%d, %ld, %ld, %p)\n", target, offset, size, data ); ENTER_GL(); func_glBufferSubData( target, offset, size, data ); LEAVE_GL(); } -static void WINAPI wine_glBufferSubDataARB( GLenum target, ptrdiff_t offset, ptrdiff_t size, GLvoid* data ) { - void (*func_glBufferSubDataARB)( GLenum, ptrdiff_t, ptrdiff_t, GLvoid* ) = extension_funcs[EXT_glBufferSubDataARB]; - TRACE("(%d, %d, %d, %p)\n", target, offset, size, data ); +static void WINAPI wine_glBufferSubDataARB( GLenum target, INT_PTR offset, INT_PTR size, GLvoid* data ) { + void (*func_glBufferSubDataARB)( GLenum, INT_PTR, INT_PTR, GLvoid* ) = extension_funcs[EXT_glBufferSubDataARB]; + TRACE("(%d, %ld, %ld, %p)\n", target, offset, size, data ); ENTER_GL(); func_glBufferSubDataARB( target, offset, size, data ); LEAVE_GL(); @@ -3701,17 +3701,17 @@ static void WINAPI wine_glFinishTextureSUNX( void ) { LEAVE_GL(); } -static void WINAPI wine_glFlushMappedBufferRange( GLenum target, ptrdiff_t offset, ptrdiff_t length ) { - void (*func_glFlushMappedBufferRange)( GLenum, ptrdiff_t, ptrdiff_t ) = extension_funcs[EXT_glFlushMappedBufferRange]; - TRACE("(%d, %d, %d)\n", target, offset, length ); +static void WINAPI wine_glFlushMappedBufferRange( GLenum target, INT_PTR offset, INT_PTR length ) { + void (*func_glFlushMappedBufferRange)( GLenum, INT_PTR, INT_PTR ) = extension_funcs[EXT_glFlushMappedBufferRange]; + TRACE("(%d, %ld, %ld)\n", target, offset, length ); ENTER_GL(); func_glFlushMappedBufferRange( target, offset, length ); LEAVE_GL(); } -static void WINAPI wine_glFlushMappedBufferRangeAPPLE( GLenum target, ptrdiff_t offset, ptrdiff_t size ) { - void (*func_glFlushMappedBufferRangeAPPLE)( GLenum, ptrdiff_t, ptrdiff_t ) = extension_funcs[EXT_glFlushMappedBufferRangeAPPLE]; - TRACE("(%d, %d, %d)\n", target, offset, size ); +static void WINAPI wine_glFlushMappedBufferRangeAPPLE( GLenum target, INT_PTR offset, INT_PTR size ) { + void (*func_glFlushMappedBufferRangeAPPLE)( GLenum, INT_PTR, INT_PTR ) = extension_funcs[EXT_glFlushMappedBufferRangeAPPLE]; + TRACE("(%d, %ld, %ld)\n", target, offset, size ); ENTER_GL(); func_glFlushMappedBufferRangeAPPLE( target, offset, size ); LEAVE_GL(); @@ -4473,17 +4473,17 @@ static void WINAPI wine_glGetBufferPointervARB( GLenum target, GLenum pname, GLv LEAVE_GL(); } -static void WINAPI wine_glGetBufferSubData( GLenum target, ptrdiff_t offset, ptrdiff_t size, GLvoid* data ) { - void (*func_glGetBufferSubData)( GLenum, ptrdiff_t, ptrdiff_t, GLvoid* ) = extension_funcs[EXT_glGetBufferSubData]; - TRACE("(%d, %d, %d, %p)\n", target, offset, size, data ); +static void WINAPI wine_glGetBufferSubData( GLenum target, INT_PTR offset, INT_PTR size, GLvoid* data ) { + void (*func_glGetBufferSubData)( GLenum, INT_PTR, INT_PTR, GLvoid* ) = extension_funcs[EXT_glGetBufferSubData]; + TRACE("(%d, %ld, %ld, %p)\n", target, offset, size, data ); ENTER_GL(); func_glGetBufferSubData( target, offset, size, data ); LEAVE_GL(); } -static void WINAPI wine_glGetBufferSubDataARB( GLenum target, ptrdiff_t offset, ptrdiff_t size, GLvoid* data ) { - void (*func_glGetBufferSubDataARB)( GLenum, ptrdiff_t, ptrdiff_t, GLvoid* ) = extension_funcs[EXT_glGetBufferSubDataARB]; - TRACE("(%d, %d, %d, %p)\n", target, offset, size, data ); +static void WINAPI wine_glGetBufferSubDataARB( GLenum target, INT_PTR offset, INT_PTR size, GLvoid* data ) { + void (*func_glGetBufferSubDataARB)( GLenum, INT_PTR, INT_PTR, GLvoid* ) = extension_funcs[EXT_glGetBufferSubDataARB]; + TRACE("(%d, %ld, %ld, %p)\n", target, offset, size, data ); ENTER_GL(); func_glGetBufferSubDataARB( target, offset, size, data ); LEAVE_GL(); @@ -5089,9 +5089,9 @@ static void WINAPI wine_glGetNamedBufferPointervEXT( GLuint buffer, GLenum pname LEAVE_GL(); } -static void WINAPI wine_glGetNamedBufferSubDataEXT( GLuint buffer, ptrdiff_t offset, ptrdiff_t size, GLvoid* data ) { - void (*func_glGetNamedBufferSubDataEXT)( GLuint, ptrdiff_t, ptrdiff_t, GLvoid* ) = extension_funcs[EXT_glGetNamedBufferSubDataEXT]; - TRACE("(%d, %d, %d, %p)\n", buffer, offset, size, data ); +static void WINAPI wine_glGetNamedBufferSubDataEXT( GLuint buffer, INT_PTR offset, INT_PTR size, GLvoid* data ) { + void (*func_glGetNamedBufferSubDataEXT)( GLuint, INT_PTR, INT_PTR, GLvoid* ) = extension_funcs[EXT_glGetNamedBufferSubDataEXT]; + TRACE("(%d, %ld, %ld, %p)\n", buffer, offset, size, data ); ENTER_GL(); func_glGetNamedBufferSubDataEXT( buffer, offset, size, data ); LEAVE_GL(); @@ -5697,9 +5697,9 @@ static GLint WINAPI wine_glGetUniformLocationARB( unsigned int programObj, char* return ret_value; } -static ptrdiff_t WINAPI wine_glGetUniformOffsetEXT( GLuint program, GLint location ) { - ptrdiff_t ret_value; - ptrdiff_t (*func_glGetUniformOffsetEXT)( GLuint, GLint ) = extension_funcs[EXT_glGetUniformOffsetEXT]; +static INT_PTR WINAPI wine_glGetUniformOffsetEXT( GLuint program, GLint location ) { + INT_PTR ret_value; + INT_PTR (*func_glGetUniformOffsetEXT)( GLuint, GLint ) = extension_funcs[EXT_glGetUniformOffsetEXT]; TRACE("(%d, %d)\n", program, location ); ENTER_GL(); ret_value = func_glGetUniformOffsetEXT( program, location ); @@ -6503,9 +6503,9 @@ static GLvoid* WINAPI wine_glMapBufferARB( GLenum target, GLenum access ) { return ret_value; } -static void WINAPI wine_glMapBufferRange( GLenum target, ptrdiff_t offset, ptrdiff_t length, GLbitfield access ) { - void (*func_glMapBufferRange)( GLenum, ptrdiff_t, ptrdiff_t, GLbitfield ) = extension_funcs[EXT_glMapBufferRange]; - TRACE("(%d, %d, %d, %d)\n", target, offset, length, access ); +static void WINAPI wine_glMapBufferRange( GLenum target, INT_PTR offset, INT_PTR length, GLbitfield access ) { + void (*func_glMapBufferRange)( GLenum, INT_PTR, INT_PTR, GLbitfield ) = extension_funcs[EXT_glMapBufferRange]; + TRACE("(%d, %ld, %ld, %d)\n", target, offset, length, access ); ENTER_GL(); func_glMapBufferRange( target, offset, length, access ); LEAVE_GL(); @@ -7883,17 +7883,17 @@ static void WINAPI wine_glMultiTexSubImage3DEXT( GLenum texunit, GLenum target, LEAVE_GL(); } -static void WINAPI wine_glNamedBufferDataEXT( GLuint buffer, ptrdiff_t size, GLvoid* data, GLenum usage ) { - void (*func_glNamedBufferDataEXT)( GLuint, ptrdiff_t, GLvoid*, GLenum ) = extension_funcs[EXT_glNamedBufferDataEXT]; - TRACE("(%d, %d, %p, %d)\n", buffer, size, data, usage ); +static void WINAPI wine_glNamedBufferDataEXT( GLuint buffer, INT_PTR size, GLvoid* data, GLenum usage ) { + void (*func_glNamedBufferDataEXT)( GLuint, INT_PTR, GLvoid*, GLenum ) = extension_funcs[EXT_glNamedBufferDataEXT]; + TRACE("(%d, %ld, %p, %d)\n", buffer, size, data, usage ); ENTER_GL(); func_glNamedBufferDataEXT( buffer, size, data, usage ); LEAVE_GL(); } -static void WINAPI wine_glNamedBufferSubDataEXT( GLuint buffer, ptrdiff_t offset, ptrdiff_t size, GLvoid* data ) { - void (*func_glNamedBufferSubDataEXT)( GLuint, ptrdiff_t, ptrdiff_t, GLvoid* ) = extension_funcs[EXT_glNamedBufferSubDataEXT]; - TRACE("(%d, %d, %d, %p)\n", buffer, offset, size, data ); +static void WINAPI wine_glNamedBufferSubDataEXT( GLuint buffer, INT_PTR offset, INT_PTR size, GLvoid* data ) { + void (*func_glNamedBufferSubDataEXT)( GLuint, INT_PTR, INT_PTR, GLvoid* ) = extension_funcs[EXT_glNamedBufferSubDataEXT]; + TRACE("(%d, %ld, %ld, %p)\n", buffer, offset, size, data ); ENTER_GL(); func_glNamedBufferSubDataEXT( buffer, offset, size, data ); LEAVE_GL(); diff --git a/dlls/qcap/enummedia.c b/dlls/qcap/enummedia.c index a4df6b35330..cff4b9fbbcf 100644 --- a/dlls/qcap/enummedia.c +++ b/dlls/qcap/enummedia.c @@ -133,9 +133,9 @@ static HRESULT WINAPI IEnumMediaTypesImpl_QueryInterface(IEnumMediaTypes * iface *ppv = NULL; if (IsEqualIID(riid, &IID_IUnknown)) - *ppv = (LPVOID)iface; + *ppv = iface; else if (IsEqualIID(riid, &IID_IEnumMediaTypes)) - *ppv = (LPVOID)iface; + *ppv = iface; if (*ppv) { diff --git a/dlls/qcap/enumpins.c b/dlls/qcap/enumpins.c index c57c043fd70..a4b1a9fa067 100644 --- a/dlls/qcap/enumpins.c +++ b/dlls/qcap/enumpins.c @@ -69,9 +69,9 @@ static HRESULT WINAPI IEnumPinsImpl_QueryInterface(IEnumPins * iface, REFIID rii *ppv = NULL; if (IsEqualIID(riid, &IID_IUnknown)) - *ppv = (LPVOID)iface; + *ppv = iface; else if (IsEqualIID(riid, &IID_IEnumPins)) - *ppv = (LPVOID)iface; + *ppv = iface; if (*ppv) { diff --git a/dlls/qcap/v4l.c b/dlls/qcap/v4l.c index d4f9417a1b0..7a131cd0db2 100644 --- a/dlls/qcap/v4l.c +++ b/dlls/qcap/v4l.c @@ -568,7 +568,7 @@ static void V4l_FreeFrame(Capture * capBox) static DWORD WINAPI ReadThread(LPVOID lParam) { - Capture * capBox = (Capture *)lParam; + Capture * capBox = lParam; HRESULT hr; IMediaSample *pSample = NULL; unsigned long framecount = 0; diff --git a/dlls/qcap/vfwcapture.c b/dlls/qcap/vfwcapture.c index cfb9487c787..07fba256140 100644 --- a/dlls/qcap/vfwcapture.c +++ b/dlls/qcap/vfwcapture.c @@ -612,7 +612,7 @@ PPB_Load( IPersistPropertyBag * iface, IPropertyBag *pPropBag, TRACE("%p/%p-> (%p, %p)\n", iface, This, pPropBag, pErrorLog); V_VT(&var) = VT_I4; - hr = IPropertyBag_Read(pPropBag, (LPCOLESTR)VFWIndex, &var, pErrorLog); + hr = IPropertyBag_Read(pPropBag, VFWIndex, &var, pErrorLog); if (SUCCEEDED(hr)) { @@ -662,7 +662,7 @@ KSP_QueryInterface( IKsPropertySet * iface, REFIID riid, LPVOID * ppv ) if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IKsPropertySet)) { - *ppv = (LPVOID)iface; + *ppv = iface; IKsPropertySet_AddRef( iface ); return S_OK; } @@ -788,9 +788,9 @@ static HRESULT WINAPI VfwPin_QueryInterface(IPin * iface, REFIID riid, LPVOID * *ppv = NULL; if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IPin)) - *ppv = (LPVOID)This; + *ppv = This; else if (IsEqualIID(riid, &IID_IKsPropertySet)) - *ppv = (LPVOID)&(This->KSP_VT); + *ppv = &(This->KSP_VT); else if (IsEqualIID(riid, &IID_IAMStreamConfig)) return IUnknown_QueryInterface((IUnknown *)This->parent, riid, ppv); diff --git a/dlls/quartz/pin.c b/dlls/quartz/pin.c index 00165e535c1..78116fc9920 100644 --- a/dlls/quartz/pin.c +++ b/dlls/quartz/pin.c @@ -953,22 +953,6 @@ HRESULT OutputPin_SendSample(OutputPin * This, IMediaSample * pSample) return hr; } -HRESULT OutputPin_DeliverNewSegment(OutputPin * This, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate) -{ - HRESULT hr; - - EnterCriticalSection(This->pin.pCritSec); - { - if (!This->pin.pConnectedTo) - hr = VFW_E_NOT_CONNECTED; - else - hr = IPin_NewSegment(This->pin.pConnectedTo, tStart, tStop, dRate); - } - LeaveCriticalSection(This->pin.pCritSec); - - return hr; -} - HRESULT OutputPin_CommitAllocator(OutputPin * This) { HRESULT hr = S_OK; diff --git a/dlls/quartz/pin.h b/dlls/quartz/pin.h index df0f4fdd5b2..2cbaddba0f9 100644 --- a/dlls/quartz/pin.h +++ b/dlls/quartz/pin.h @@ -187,7 +187,6 @@ HRESULT OutputPin_DecommitAllocator(OutputPin * This); HRESULT OutputPin_GetDeliveryBuffer(OutputPin * This, IMediaSample ** ppSample, REFERENCE_TIME * tStart, REFERENCE_TIME * tStop, DWORD dwFlags); HRESULT OutputPin_SendSample(OutputPin * This, IMediaSample * pSample); HRESULT OutputPin_DeliverDisconnect(OutputPin * This); -HRESULT OutputPin_DeliverNewSegment(OutputPin * This, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate); /* Pull Pin */ HRESULT WINAPI PullPin_ReceiveConnection(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt); diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c index ac948d56dcd..9a2e1c366ba 100644 --- a/dlls/quartz/videorenderer.c +++ b/dlls/quartz/videorenderer.c @@ -96,7 +96,7 @@ typedef struct VideoRendererImpl static LRESULT CALLBACK VideoWndProcA(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - VideoRendererImpl* pVideoRenderer = (VideoRendererImpl*)GetWindowLongA(hwnd, 0); + VideoRendererImpl* pVideoRenderer = (VideoRendererImpl*)GetWindowLongPtrW(hwnd, 0); LPRECT lprect = (LPRECT)lParam; if (pVideoRenderer && pVideoRenderer->hWndMsgDrain) @@ -197,7 +197,7 @@ static BOOL CreateRenderingWindow(VideoRendererImpl* This) return FALSE; } - SetWindowLongA(This->hWnd, 0, (LONG)This); + SetWindowLongPtrW(This->hWnd, 0, (LONG_PTR)This); return TRUE; } @@ -1989,7 +1989,7 @@ static HRESULT WINAPI Videowindow_get_Owner(IVideoWindow *iface, OAHWND *Owner) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); - TRACE("(%p/%p)->(%08x)\n", This, iface, (DWORD) Owner); + TRACE("(%p/%p)->(%p)\n", This, iface, Owner); *(HWND*)Owner = GetParent(This->hWnd); diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 107dcea60e6..563e12e82bc 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -2319,7 +2319,8 @@ static LRESULT ME_Char(ME_TextEditor *editor, WPARAM charCode, else if (para == ME_GetParagraph(editor->pCursors[1].pRun) && cursor.nOffset + cursor.pRun->member.run.nCharOfs == 0 && para->member.para.prev_para->member.para.nFlags & MEPF_ROWSTART && - !para->member.para.prev_para->member.para.nCharOfs) + !para->member.para.prev_para->member.para.nCharOfs && + wstr == '\r') { /* Insert a newline before the table. */ WCHAR endl = '\r'; @@ -2956,21 +2957,9 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, return ME_StreamOut(editor, wParam, (EDITSTREAM *)lParam); case WM_GETDLGCODE: { - UINT code = DLGC_WANTCHARS|DLGC_WANTARROWS; - if(lParam && (((LPMSG)lParam)->message == WM_KEYDOWN)) - { - int vk = (int)((LPMSG)lParam)->wParam; - /* if style says we want return key */ - if((vk == VK_RETURN) && (GetWindowLongW(editor->hWnd, GWL_STYLE) & ES_WANTRETURN)) - { - code |= DLGC_WANTMESSAGE; - } - /* we always handle ctrl-tab */ - if((vk == VK_TAB) && (GetKeyState(VK_CONTROL) & 0x8000)) - { - code |= DLGC_WANTMESSAGE; - } - } + UINT code = DLGC_WANTCHARS|DLGC_WANTTAB|DLGC_WANTARROWS|DLGC_HASSETSEL; + if (GetWindowLongW(editor->hWnd, GWL_STYLE) & ES_MULTILINE) + code |= DLGC_WANTMESSAGE; return code; } case EM_EMPTYUNDOBUFFER: diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c index 9e2f5e41507..11930ad4b21 100644 --- a/dlls/riched20/tests/editor.c +++ b/dlls/riched20/tests/editor.c @@ -6010,6 +6010,177 @@ static void test_format_rect(void) DestroyWindow(hwnd); } +static void test_WM_GETDLGCODE(void) +{ + HWND hwnd; + UINT res, expected; + MSG msg; + + expected = DLGC_WANTCHARS|DLGC_WANTTAB|DLGC_WANTARROWS|DLGC_HASSETSEL|DLGC_WANTMESSAGE; + + hwnd = CreateWindowEx(0, RICHEDIT_CLASS, NULL, + ES_MULTILINE|ES_WANTRETURN|WS_POPUP, + 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL); + ok(hwnd != NULL, "class: %s, error: %d\n", RICHEDIT_CLASS, (int) GetLastError()); + msg.hwnd = hwnd; + res = SendMessage(hwnd, WM_GETDLGCODE, VK_RETURN, 0); + expected = expected | DLGC_WANTMESSAGE; + ok(res == expected, "WM_GETDLGCODE returned %x but expected %x\n", + res, expected); + DestroyWindow(hwnd); + + msg.message = WM_KEYDOWN; + msg.wParam = VK_RETURN; + msg.lParam = MapVirtualKey(VK_RETURN, MAPVK_VK_TO_VSC) | 0x0001; + msg.pt.x = 0; + msg.pt.y = 0; + msg.time = GetTickCount(); + + hwnd = CreateWindowEx(0, RICHEDIT_CLASS, NULL, + ES_MULTILINE|ES_WANTRETURN|WS_POPUP, + 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL); + ok(hwnd != NULL, "class: %s, error: %d\n", RICHEDIT_CLASS, (int) GetLastError()); + msg.hwnd = hwnd; + res = SendMessage(hwnd, WM_GETDLGCODE, VK_RETURN, (LPARAM)&msg); + expected = expected | DLGC_WANTMESSAGE; + ok(res == expected, "WM_GETDLGCODE returned %x but expected %x\n", + res, expected); + DestroyWindow(hwnd); + + hwnd = CreateWindowEx(0, RICHEDIT_CLASS, NULL, + ES_MULTILINE|WS_POPUP, + 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL); + ok(hwnd != NULL, "class: %s, error: %d\n", RICHEDIT_CLASS, (int) GetLastError()); + msg.hwnd = hwnd; + res = SendMessage(hwnd, WM_GETDLGCODE, VK_RETURN, (LPARAM)&msg); + expected = DLGC_WANTCHARS|DLGC_WANTTAB|DLGC_WANTARROWS|DLGC_HASSETSEL|DLGC_WANTMESSAGE; + ok(res == expected, "WM_GETDLGCODE returned %x but expected %x\n", + res, expected); + DestroyWindow(hwnd); + + hwnd = CreateWindowEx(0, RICHEDIT_CLASS, NULL, + ES_WANTRETURN|WS_POPUP, + 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL); + ok(hwnd != NULL, "class: %s, error: %d\n", RICHEDIT_CLASS, (int) GetLastError()); + msg.hwnd = hwnd; + res = SendMessage(hwnd, WM_GETDLGCODE, VK_RETURN, (LPARAM)&msg); + expected = DLGC_WANTCHARS|DLGC_WANTTAB|DLGC_WANTARROWS|DLGC_HASSETSEL; + ok(res == expected, "WM_GETDLGCODE returned %x but expected %x\n", + res, expected); + DestroyWindow(hwnd); + + hwnd = CreateWindowEx(0, RICHEDIT_CLASS, NULL, + WS_POPUP, + 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL); + ok(hwnd != NULL, "class: %s, error: %d\n", RICHEDIT_CLASS, (int) GetLastError()); + msg.hwnd = hwnd; + res = SendMessage(hwnd, WM_GETDLGCODE, VK_RETURN, (LPARAM)&msg); + expected = DLGC_WANTCHARS|DLGC_WANTTAB|DLGC_WANTARROWS|DLGC_HASSETSEL; + ok(res == expected, "WM_GETDLGCODE returned %x but expected %x\n", + res, expected); + DestroyWindow(hwnd); + + msg.wParam = VK_TAB; + msg.lParam = MapVirtualKey(VK_TAB, MAPVK_VK_TO_VSC) | 0x0001; + + hwnd = CreateWindowEx(0, RICHEDIT_CLASS, NULL, + ES_MULTILINE|WS_POPUP, + 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL); + ok(hwnd != NULL, "class: %s, error: %d\n", RICHEDIT_CLASS, (int) GetLastError()); + msg.hwnd = hwnd; + res = SendMessage(hwnd, WM_GETDLGCODE, VK_RETURN, (LPARAM)&msg); + expected = DLGC_WANTCHARS|DLGC_WANTTAB|DLGC_WANTARROWS|DLGC_HASSETSEL|DLGC_WANTMESSAGE; + ok(res == expected, "WM_GETDLGCODE returned %x but expected %x\n", + res, expected); + DestroyWindow(hwnd); + + hwnd = CreateWindowEx(0, RICHEDIT_CLASS, NULL, + WS_POPUP, + 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL); + ok(hwnd != NULL, "class: %s, error: %d\n", RICHEDIT_CLASS, (int) GetLastError()); + msg.hwnd = hwnd; + res = SendMessage(hwnd, WM_GETDLGCODE, VK_RETURN, (LPARAM)&msg); + expected = DLGC_WANTCHARS|DLGC_WANTTAB|DLGC_WANTARROWS|DLGC_HASSETSEL; + ok(res == expected, "WM_GETDLGCODE returned %x but expected %x\n", + res, expected); + DestroyWindow(hwnd); + + hold_key(VK_CONTROL); + + hwnd = CreateWindowEx(0, RICHEDIT_CLASS, NULL, + ES_MULTILINE|WS_POPUP, + 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL); + ok(hwnd != NULL, "class: %s, error: %d\n", RICHEDIT_CLASS, (int) GetLastError()); + msg.hwnd = hwnd; + res = SendMessage(hwnd, WM_GETDLGCODE, VK_RETURN, (LPARAM)&msg); + expected = DLGC_WANTCHARS|DLGC_WANTTAB|DLGC_WANTARROWS|DLGC_HASSETSEL|DLGC_WANTMESSAGE; + ok(res == expected, "WM_GETDLGCODE returned %x but expected %x\n", + res, expected); + DestroyWindow(hwnd); + + hwnd = CreateWindowEx(0, RICHEDIT_CLASS, NULL, + WS_POPUP, + 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL); + ok(hwnd != NULL, "class: %s, error: %d\n", RICHEDIT_CLASS, (int) GetLastError()); + msg.hwnd = hwnd; + res = SendMessage(hwnd, WM_GETDLGCODE, VK_RETURN, (LPARAM)&msg); + expected = DLGC_WANTCHARS|DLGC_WANTTAB|DLGC_WANTARROWS|DLGC_HASSETSEL; + ok(res == expected, "WM_GETDLGCODE returned %x but expected %x\n", + res, expected); + DestroyWindow(hwnd); + + release_key(VK_CONTROL); + + msg.wParam = 'a'; + msg.lParam = MapVirtualKey('a', MAPVK_VK_TO_VSC) | 0x0001; + + hwnd = CreateWindowEx(0, RICHEDIT_CLASS, NULL, + ES_MULTILINE|WS_POPUP, + 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL); + ok(hwnd != NULL, "class: %s, error: %d\n", RICHEDIT_CLASS, (int) GetLastError()); + msg.hwnd = hwnd; + res = SendMessage(hwnd, WM_GETDLGCODE, VK_RETURN, (LPARAM)&msg); + expected = DLGC_WANTCHARS|DLGC_WANTTAB|DLGC_WANTARROWS|DLGC_HASSETSEL|DLGC_WANTMESSAGE; + ok(res == expected, "WM_GETDLGCODE returned %x but expected %x\n", + res, expected); + DestroyWindow(hwnd); + + hwnd = CreateWindowEx(0, RICHEDIT_CLASS, NULL, + WS_POPUP, + 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL); + ok(hwnd != NULL, "class: %s, error: %d\n", RICHEDIT_CLASS, (int) GetLastError()); + msg.hwnd = hwnd; + res = SendMessage(hwnd, WM_GETDLGCODE, VK_RETURN, (LPARAM)&msg); + expected = DLGC_WANTCHARS|DLGC_WANTTAB|DLGC_WANTARROWS|DLGC_HASSETSEL; + ok(res == expected, "WM_GETDLGCODE returned %x but expected %x\n", + res, expected); + DestroyWindow(hwnd); + + msg.message = WM_CHAR; + + hwnd = CreateWindowEx(0, RICHEDIT_CLASS, NULL, + ES_MULTILINE|WS_POPUP, + 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL); + ok(hwnd != NULL, "class: %s, error: %d\n", RICHEDIT_CLASS, (int) GetLastError()); + msg.hwnd = hwnd; + res = SendMessage(hwnd, WM_GETDLGCODE, VK_RETURN, (LPARAM)&msg); + expected = DLGC_WANTCHARS|DLGC_WANTTAB|DLGC_WANTARROWS|DLGC_HASSETSEL|DLGC_WANTMESSAGE; + ok(res == expected, "WM_GETDLGCODE returned %x but expected %x\n", + res, expected); + DestroyWindow(hwnd); + + hwnd = CreateWindowEx(0, RICHEDIT_CLASS, NULL, + WS_POPUP, + 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL); + ok(hwnd != NULL, "class: %s, error: %d\n", RICHEDIT_CLASS, (int) GetLastError()); + msg.hwnd = hwnd; + res = SendMessage(hwnd, WM_GETDLGCODE, VK_RETURN, (LPARAM)&msg); + expected = DLGC_WANTCHARS|DLGC_WANTTAB|DLGC_WANTARROWS|DLGC_HASSETSEL; + ok(res == expected, "WM_GETDLGCODE returned %x but expected %x\n", + res, expected); + DestroyWindow(hwnd); +} + START_TEST( editor ) { /* Must explicitly LoadLibrary(). The test has no references to functions in @@ -6063,6 +6234,7 @@ START_TEST( editor ) test_word_wrap(); test_auto_yscroll(); test_format_rect(); + test_WM_GETDLGCODE(); /* Set the environment variable WINETEST_RICHED20 to keep windows * responsive and open for 30 seconds. This is useful for debugging. diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c index 9608f1e56c6..f0a13de930c 100644 --- a/dlls/rpcrt4/ndr_marshall.c +++ b/dlls/rpcrt4/ndr_marshall.c @@ -58,8 +58,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ole); (*(pchar) = LOBYTE(LOWORD(uint32)), \ *((pchar)+1) = HIBYTE(LOWORD(uint32)), \ *((pchar)+2) = LOBYTE(HIWORD(uint32)), \ - *((pchar)+3) = HIBYTE(HIWORD(uint32)), \ - (uint32)) /* allow as r-value */ + *((pchar)+3) = HIBYTE(HIWORD(uint32))) # define LITTLE_ENDIAN_UINT32_READ(pchar) \ (MAKELONG( \ @@ -71,8 +70,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ole); (*((pchar)+3) = LOBYTE(LOWORD(uint32)), \ *((pchar)+2) = HIBYTE(LOWORD(uint32)), \ *((pchar)+1) = LOBYTE(HIWORD(uint32)), \ - *(pchar) = HIBYTE(HIWORD(uint32)), \ - (uint32)) /* allow as r-value */ + *(pchar) = HIBYTE(HIWORD(uint32))) #define BIG_ENDIAN_UINT32_READ(pchar) \ (MAKELONG( \ diff --git a/dlls/rpcrt4/tests/generated.c b/dlls/rpcrt4/tests/generated.c index 609e49cbf25..77ddd85ba8d 100644 --- a/dlls/rpcrt4/tests/generated.c +++ b/dlls/rpcrt4/tests/generated.c @@ -1,4 +1,4 @@ -/* File generated automatically from tools/winapi/test.dat; do not edit! */ +/* File generated automatically from tools/winapi/tests.dat; do not edit! */ /* This file can be copied, modified and distributed without restriction. */ /* @@ -33,21 +33,13 @@ */ #if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) -# define FIELD_ALIGNMENT(type, field) __alignof(((type*)0)->field) -#elif defined(__GNUC__) -# define FIELD_ALIGNMENT(type, field) __alignof__(((type*)0)->field) -#else -/* FIXME: Not sure if is possible to do without compiler extension */ -#endif - -#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) # define _TYPE_ALIGNMENT(type) __alignof(type) #elif defined(__GNUC__) # define _TYPE_ALIGNMENT(type) __alignof__(type) #else /* - * FIXME: Not sure if is possible to do without compiler extension - * (if type is not just a name that is, if so the normal) + * FIXME: May not be possible without a compiler extension + * (if type is not just a name that is, otherwise the normal * TYPE_ALIGNMENT can be used) */ #endif @@ -64,84 +56,70 @@ * Test helper macros */ -#ifdef FIELD_ALIGNMENT -# define TEST_FIELD_ALIGNMENT(type, field, align) \ - ok(FIELD_ALIGNMENT(type, field) == align, \ - "FIELD_ALIGNMENT(" #type ", " #field ") == %d (expected " #align ")\n", \ - (int)FIELD_ALIGNMENT(type, field)) -#else -# define TEST_FIELD_ALIGNMENT(type, field, align) do { } while (0) -#endif - -#define TEST_FIELD_OFFSET(type, field, offset) \ - ok(FIELD_OFFSET(type, field) == offset, \ - "FIELD_OFFSET(" #type ", " #field ") == %ld (expected " #offset ")\n", \ - (long int)FIELD_OFFSET(type, field)) +#ifdef _WIN64 -#ifdef _TYPE_ALIGNMENT -#define TEST__TYPE_ALIGNMENT(type, align) \ - ok(_TYPE_ALIGNMENT(type) == align, "TYPE_ALIGNMENT(" #type ") == %d (expected " #align ")\n", (int)_TYPE_ALIGNMENT(type)) -#else -# define TEST__TYPE_ALIGNMENT(type, align) do { } while (0) -#endif +# define TEST_TYPE_SIZE(type, size) +# define TEST_TYPE_ALIGN(type, align) +# define TEST_TARGET_ALIGN(type, align) +# define TEST_FIELD_ALIGN(type, field, align) +# define TEST_FIELD_OFFSET(type, field, offset) -#ifdef TYPE_ALIGNMENT -#define TEST_TYPE_ALIGNMENT(type, align) \ - ok(TYPE_ALIGNMENT(type) == align, "TYPE_ALIGNMENT(" #type ") == %d (expected " #align ")\n", (int)TYPE_ALIGNMENT(type)) #else -# define TEST_TYPE_ALIGNMENT(type, align) do { } while (0) -#endif -#define TEST_TYPE_SIZE(type, size) \ - ok(sizeof(type) == size, "sizeof(" #type ") == %d (expected " #size ")\n", ((int) sizeof(type))) +# define TEST_TYPE_SIZE(type, size) C_ASSERT(sizeof(type) == size); -/*********************************************************************** - * Test macros - */ +# ifdef TYPE_ALIGNMENT +# define TEST_TYPE_ALIGN(type, align) C_ASSERT(TYPE_ALIGNMENT(type) == align); +# else +# define TEST_TYPE_ALIGN(type, align) +# endif -#define TEST_FIELD(type, field_type, field_name, field_offset, field_size, field_align) \ - TEST_TYPE_SIZE(field_type, field_size); \ - TEST_FIELD_ALIGNMENT(type, field_name, field_align); \ - TEST_FIELD_OFFSET(type, field_name, field_offset); \ +# ifdef _TYPE_ALIGNMENT +# define TEST_TARGET_ALIGN(type, align) C_ASSERT(_TYPE_ALIGNMENT(*(type)0) == align); +# define TEST_FIELD_ALIGN(type, field, align) C_ASSERT(_TYPE_ALIGNMENT(((type*)0)->field) == align); +# else +# define TEST_TARGET_ALIGN(type, align) +# define TEST_FIELD_ALIGN(type, field, align) +# endif -#define TEST_TYPE(type, size, align) \ - TEST_TYPE_ALIGNMENT(type, align); \ - TEST_TYPE_SIZE(type, size) +# define TEST_FIELD_OFFSET(type, field, offset) C_ASSERT(FIELD_OFFSET(type, field) == offset); -#define TEST_TYPE_POINTER(type, size, align) \ - TEST__TYPE_ALIGNMENT(*(type)0, align); \ - TEST_TYPE_SIZE(*(type)0, size) +#endif -#define TEST_TYPE_SIGNED(type) \ - ok((type) -1 < 0, "(" #type ") -1 < 0\n"); +#define TEST_TARGET_SIZE(type, size) TEST_TYPE_SIZE(*(type)0, size) +#define TEST_FIELD_SIZE(type, field, size) TEST_TYPE_SIZE((((type*)0)->field), size) +#define TEST_TYPE_SIGNED(type) C_ASSERT((type) -1 < 0); +#define TEST_TYPE_UNSIGNED(type) C_ASSERT((type) -1 > 0); -#define TEST_TYPE_UNSIGNED(type) \ - ok((type) -1 > 0, "(" #type ") -1 > 0\n"); static void test_pack_I_RPC_HANDLE(void) { /* I_RPC_HANDLE */ - TEST_TYPE(I_RPC_HANDLE, 4, 4); + TEST_TYPE_SIZE (I_RPC_HANDLE, 4) + TEST_TYPE_ALIGN (I_RPC_HANDLE, 4) } static void test_pack_RPC_STATUS(void) { /* RPC_STATUS */ - TEST_TYPE(RPC_STATUS, 4, 4); - TEST_TYPE_SIGNED(RPC_STATUS); + TEST_TYPE_SIZE (RPC_STATUS, 4) + TEST_TYPE_ALIGN (RPC_STATUS, 4) } static void test_pack_PRPC_POLICY(void) { /* PRPC_POLICY */ - TEST_TYPE(PRPC_POLICY, 4, 4); - TEST_TYPE_POINTER(PRPC_POLICY, 12, 4); + TEST_TYPE_SIZE (PRPC_POLICY, 4) + TEST_TYPE_ALIGN (PRPC_POLICY, 4) + TEST_TARGET_SIZE (PRPC_POLICY, 12) + TEST_TARGET_ALIGN(PRPC_POLICY, 4) } static void test_pack_RPC_AUTH_IDENTITY_HANDLE(void) { /* RPC_AUTH_IDENTITY_HANDLE */ - TEST_TYPE(RPC_AUTH_IDENTITY_HANDLE, 4, 4); + TEST_TYPE_SIZE (RPC_AUTH_IDENTITY_HANDLE, 4) + TEST_TYPE_ALIGN (RPC_AUTH_IDENTITY_HANDLE, 4) } static void test_pack_RPC_AUTH_KEY_RETRIEVAL_FN(void) @@ -152,95 +130,168 @@ static void test_pack_RPC_AUTH_KEY_RETRIEVAL_FN(void) static void test_pack_RPC_AUTHZ_HANDLE(void) { /* RPC_AUTHZ_HANDLE */ - TEST_TYPE(RPC_AUTHZ_HANDLE, 4, 4); + TEST_TYPE_SIZE (RPC_AUTHZ_HANDLE, 4) + TEST_TYPE_ALIGN (RPC_AUTHZ_HANDLE, 4) } static void test_pack_RPC_BINDING_HANDLE(void) { /* RPC_BINDING_HANDLE */ - TEST_TYPE(RPC_BINDING_HANDLE, 4, 4); + TEST_TYPE_SIZE (RPC_BINDING_HANDLE, 4) + TEST_TYPE_ALIGN (RPC_BINDING_HANDLE, 4) } static void test_pack_RPC_BINDING_VECTOR(void) { /* RPC_BINDING_VECTOR (pack 4) */ - TEST_TYPE(RPC_BINDING_VECTOR, 8, 4); - TEST_FIELD(RPC_BINDING_VECTOR, unsigned long, Count, 0, 4, 4); - TEST_FIELD(RPC_BINDING_VECTOR, RPC_BINDING_HANDLE[1], BindingH, 4, 4, 4); + TEST_TYPE_SIZE (RPC_BINDING_VECTOR, 8) + TEST_TYPE_ALIGN (RPC_BINDING_VECTOR, 4) + TEST_FIELD_SIZE (RPC_BINDING_VECTOR, Count, 4) + TEST_FIELD_ALIGN (RPC_BINDING_VECTOR, Count, 4) + TEST_FIELD_OFFSET(RPC_BINDING_VECTOR, Count, 0) + TEST_FIELD_SIZE (RPC_BINDING_VECTOR, BindingH, 4) + TEST_FIELD_ALIGN (RPC_BINDING_VECTOR, BindingH, 4) + TEST_FIELD_OFFSET(RPC_BINDING_VECTOR, BindingH, 4) } static void test_pack_RPC_IF_HANDLE(void) { /* RPC_IF_HANDLE */ - TEST_TYPE(RPC_IF_HANDLE, 4, 4); + TEST_TYPE_SIZE (RPC_IF_HANDLE, 4) + TEST_TYPE_ALIGN (RPC_IF_HANDLE, 4) } static void test_pack_RPC_IF_ID(void) { /* RPC_IF_ID (pack 4) */ + TEST_TYPE_SIZE (RPC_IF_ID, 20) + TEST_TYPE_ALIGN (RPC_IF_ID, 4) + TEST_FIELD_SIZE (RPC_IF_ID, Uuid, 16) + TEST_FIELD_ALIGN (RPC_IF_ID, Uuid, 4) + TEST_FIELD_OFFSET(RPC_IF_ID, Uuid, 0) + TEST_FIELD_SIZE (RPC_IF_ID, VersMajor, 2) + TEST_FIELD_ALIGN (RPC_IF_ID, VersMajor, 2) + TEST_FIELD_OFFSET(RPC_IF_ID, VersMajor, 16) + TEST_FIELD_SIZE (RPC_IF_ID, VersMinor, 2) + TEST_FIELD_ALIGN (RPC_IF_ID, VersMinor, 2) + TEST_FIELD_OFFSET(RPC_IF_ID, VersMinor, 18) } static void test_pack_RPC_POLICY(void) { /* RPC_POLICY (pack 4) */ - TEST_TYPE(RPC_POLICY, 12, 4); - TEST_FIELD(RPC_POLICY, unsigned int, Length, 0, 4, 4); - TEST_FIELD(RPC_POLICY, unsigned long, EndpointFlags, 4, 4, 4); - TEST_FIELD(RPC_POLICY, unsigned long, NICFlags, 8, 4, 4); + TEST_TYPE_SIZE (RPC_POLICY, 12) + TEST_TYPE_ALIGN (RPC_POLICY, 4) + TEST_FIELD_SIZE (RPC_POLICY, Length, 4) + TEST_FIELD_ALIGN (RPC_POLICY, Length, 4) + TEST_FIELD_OFFSET(RPC_POLICY, Length, 0) + TEST_FIELD_SIZE (RPC_POLICY, EndpointFlags, 4) + TEST_FIELD_ALIGN (RPC_POLICY, EndpointFlags, 4) + TEST_FIELD_OFFSET(RPC_POLICY, EndpointFlags, 4) + TEST_FIELD_SIZE (RPC_POLICY, NICFlags, 4) + TEST_FIELD_ALIGN (RPC_POLICY, NICFlags, 4) + TEST_FIELD_OFFSET(RPC_POLICY, NICFlags, 8) } static void test_pack_UUID_VECTOR(void) { /* UUID_VECTOR (pack 4) */ - TEST_TYPE(UUID_VECTOR, 8, 4); - TEST_FIELD(UUID_VECTOR, unsigned long, Count, 0, 4, 4); - TEST_FIELD(UUID_VECTOR, UUID *[1], Uuid, 4, 4, 4); + TEST_TYPE_SIZE (UUID_VECTOR, 8) + TEST_TYPE_ALIGN (UUID_VECTOR, 4) + TEST_FIELD_SIZE (UUID_VECTOR, Count, 4) + TEST_FIELD_ALIGN (UUID_VECTOR, Count, 4) + TEST_FIELD_OFFSET(UUID_VECTOR, Count, 0) + TEST_FIELD_SIZE (UUID_VECTOR, Uuid, 4) + TEST_FIELD_ALIGN (UUID_VECTOR, Uuid, 4) + TEST_FIELD_OFFSET(UUID_VECTOR, Uuid, 4) } static void test_pack_PRPC_CLIENT_INTERFACE(void) { /* PRPC_CLIENT_INTERFACE */ - TEST_TYPE(PRPC_CLIENT_INTERFACE, 4, 4); + TEST_TYPE_SIZE (PRPC_CLIENT_INTERFACE, 4) + TEST_TYPE_ALIGN (PRPC_CLIENT_INTERFACE, 4) + TEST_TARGET_SIZE (PRPC_CLIENT_INTERFACE, 68) + TEST_TARGET_ALIGN(PRPC_CLIENT_INTERFACE, 4) } static void test_pack_PRPC_DISPATCH_TABLE(void) { /* PRPC_DISPATCH_TABLE */ - TEST_TYPE(PRPC_DISPATCH_TABLE, 4, 4); - TEST_TYPE_POINTER(PRPC_DISPATCH_TABLE, 12, 4); + TEST_TYPE_SIZE (PRPC_DISPATCH_TABLE, 4) + TEST_TYPE_ALIGN (PRPC_DISPATCH_TABLE, 4) + TEST_TARGET_SIZE (PRPC_DISPATCH_TABLE, 12) + TEST_TARGET_ALIGN(PRPC_DISPATCH_TABLE, 4) } static void test_pack_PRPC_MESSAGE(void) { /* PRPC_MESSAGE */ - TEST_TYPE(PRPC_MESSAGE, 4, 4); - TEST_TYPE_POINTER(PRPC_MESSAGE, 44, 4); + TEST_TYPE_SIZE (PRPC_MESSAGE, 4) + TEST_TYPE_ALIGN (PRPC_MESSAGE, 4) + TEST_TARGET_SIZE (PRPC_MESSAGE, 44) + TEST_TARGET_ALIGN(PRPC_MESSAGE, 4) } static void test_pack_PRPC_PROTSEQ_ENDPOINT(void) { /* PRPC_PROTSEQ_ENDPOINT */ - TEST_TYPE(PRPC_PROTSEQ_ENDPOINT, 4, 4); - TEST_TYPE_POINTER(PRPC_PROTSEQ_ENDPOINT, 8, 4); + TEST_TYPE_SIZE (PRPC_PROTSEQ_ENDPOINT, 4) + TEST_TYPE_ALIGN (PRPC_PROTSEQ_ENDPOINT, 4) + TEST_TARGET_SIZE (PRPC_PROTSEQ_ENDPOINT, 8) + TEST_TARGET_ALIGN(PRPC_PROTSEQ_ENDPOINT, 4) } static void test_pack_PRPC_SERVER_INTERFACE(void) { /* PRPC_SERVER_INTERFACE */ - TEST_TYPE(PRPC_SERVER_INTERFACE, 4, 4); + TEST_TYPE_SIZE (PRPC_SERVER_INTERFACE, 4) + TEST_TYPE_ALIGN (PRPC_SERVER_INTERFACE, 4) + TEST_TARGET_SIZE (PRPC_SERVER_INTERFACE, 68) + TEST_TARGET_ALIGN(PRPC_SERVER_INTERFACE, 4) } static void test_pack_PRPC_SYNTAX_IDENTIFIER(void) { /* PRPC_SYNTAX_IDENTIFIER */ - TEST_TYPE(PRPC_SYNTAX_IDENTIFIER, 4, 4); - TEST_TYPE_POINTER(PRPC_SYNTAX_IDENTIFIER, 20, 4); + TEST_TYPE_SIZE (PRPC_SYNTAX_IDENTIFIER, 4) + TEST_TYPE_ALIGN (PRPC_SYNTAX_IDENTIFIER, 4) + TEST_TARGET_SIZE (PRPC_SYNTAX_IDENTIFIER, 20) + TEST_TARGET_ALIGN(PRPC_SYNTAX_IDENTIFIER, 4) } static void test_pack_RPC_CLIENT_INTERFACE(void) { /* RPC_CLIENT_INTERFACE (pack 4) */ - TEST_FIELD(RPC_CLIENT_INTERFACE, unsigned int, Length, 0, 4, 4); + TEST_TYPE_SIZE (RPC_CLIENT_INTERFACE, 68) + TEST_TYPE_ALIGN (RPC_CLIENT_INTERFACE, 4) + TEST_FIELD_SIZE (RPC_CLIENT_INTERFACE, Length, 4) + TEST_FIELD_ALIGN (RPC_CLIENT_INTERFACE, Length, 4) + TEST_FIELD_OFFSET(RPC_CLIENT_INTERFACE, Length, 0) + TEST_FIELD_SIZE (RPC_CLIENT_INTERFACE, InterfaceId, 20) + TEST_FIELD_ALIGN (RPC_CLIENT_INTERFACE, InterfaceId, 4) + TEST_FIELD_OFFSET(RPC_CLIENT_INTERFACE, InterfaceId, 4) + TEST_FIELD_SIZE (RPC_CLIENT_INTERFACE, TransferSyntax, 20) + TEST_FIELD_ALIGN (RPC_CLIENT_INTERFACE, TransferSyntax, 4) + TEST_FIELD_OFFSET(RPC_CLIENT_INTERFACE, TransferSyntax, 24) + TEST_FIELD_SIZE (RPC_CLIENT_INTERFACE, DispatchTable, 4) + TEST_FIELD_ALIGN (RPC_CLIENT_INTERFACE, DispatchTable, 4) + TEST_FIELD_OFFSET(RPC_CLIENT_INTERFACE, DispatchTable, 44) + TEST_FIELD_SIZE (RPC_CLIENT_INTERFACE, RpcProtseqEndpointCount, 4) + TEST_FIELD_ALIGN (RPC_CLIENT_INTERFACE, RpcProtseqEndpointCount, 4) + TEST_FIELD_OFFSET(RPC_CLIENT_INTERFACE, RpcProtseqEndpointCount, 48) + TEST_FIELD_SIZE (RPC_CLIENT_INTERFACE, RpcProtseqEndpoint, 4) + TEST_FIELD_ALIGN (RPC_CLIENT_INTERFACE, RpcProtseqEndpoint, 4) + TEST_FIELD_OFFSET(RPC_CLIENT_INTERFACE, RpcProtseqEndpoint, 52) + TEST_FIELD_SIZE (RPC_CLIENT_INTERFACE, Reserved, 4) + TEST_FIELD_ALIGN (RPC_CLIENT_INTERFACE, Reserved, 4) + TEST_FIELD_OFFSET(RPC_CLIENT_INTERFACE, Reserved, 56) + TEST_FIELD_SIZE (RPC_CLIENT_INTERFACE, InterpreterInfo, 4) + TEST_FIELD_ALIGN (RPC_CLIENT_INTERFACE, InterpreterInfo, 4) + TEST_FIELD_OFFSET(RPC_CLIENT_INTERFACE, InterpreterInfo, 60) + TEST_FIELD_SIZE (RPC_CLIENT_INTERFACE, Flags, 4) + TEST_FIELD_ALIGN (RPC_CLIENT_INTERFACE, Flags, 4) + TEST_FIELD_OFFSET(RPC_CLIENT_INTERFACE, Flags, 64) } static void test_pack_RPC_DISPATCH_FUNCTION(void) @@ -251,86 +302,184 @@ static void test_pack_RPC_DISPATCH_FUNCTION(void) static void test_pack_RPC_DISPATCH_TABLE(void) { /* RPC_DISPATCH_TABLE (pack 4) */ - TEST_TYPE(RPC_DISPATCH_TABLE, 12, 4); - TEST_FIELD(RPC_DISPATCH_TABLE, unsigned int, DispatchTableCount, 0, 4, 4); - TEST_FIELD(RPC_DISPATCH_TABLE, RPC_DISPATCH_FUNCTION*, DispatchTable, 4, 4, 4); - TEST_FIELD(RPC_DISPATCH_TABLE, LONG_PTR, Reserved, 8, 4, 4); + TEST_TYPE_SIZE (RPC_DISPATCH_TABLE, 12) + TEST_TYPE_ALIGN (RPC_DISPATCH_TABLE, 4) + TEST_FIELD_SIZE (RPC_DISPATCH_TABLE, DispatchTableCount, 4) + TEST_FIELD_ALIGN (RPC_DISPATCH_TABLE, DispatchTableCount, 4) + TEST_FIELD_OFFSET(RPC_DISPATCH_TABLE, DispatchTableCount, 0) + TEST_FIELD_SIZE (RPC_DISPATCH_TABLE, DispatchTable, 4) + TEST_FIELD_ALIGN (RPC_DISPATCH_TABLE, DispatchTable, 4) + TEST_FIELD_OFFSET(RPC_DISPATCH_TABLE, DispatchTable, 4) + TEST_FIELD_SIZE (RPC_DISPATCH_TABLE, Reserved, 4) + TEST_FIELD_ALIGN (RPC_DISPATCH_TABLE, Reserved, 4) + TEST_FIELD_OFFSET(RPC_DISPATCH_TABLE, Reserved, 8) } static void test_pack_RPC_MESSAGE(void) { /* RPC_MESSAGE (pack 4) */ - TEST_TYPE(RPC_MESSAGE, 44, 4); - TEST_FIELD(RPC_MESSAGE, RPC_BINDING_HANDLE, Handle, 0, 4, 4); - TEST_FIELD(RPC_MESSAGE, unsigned long, DataRepresentation, 4, 4, 4); - TEST_FIELD(RPC_MESSAGE, void*, Buffer, 8, 4, 4); - TEST_FIELD(RPC_MESSAGE, unsigned int, BufferLength, 12, 4, 4); - TEST_FIELD(RPC_MESSAGE, unsigned int, ProcNum, 16, 4, 4); - TEST_FIELD(RPC_MESSAGE, PRPC_SYNTAX_IDENTIFIER, TransferSyntax, 20, 4, 4); - TEST_FIELD(RPC_MESSAGE, void*, RpcInterfaceInformation, 24, 4, 4); - TEST_FIELD(RPC_MESSAGE, void*, ReservedForRuntime, 28, 4, 4); - TEST_FIELD(RPC_MESSAGE, RPC_MGR_EPV*, ManagerEpv, 32, 4, 4); - TEST_FIELD(RPC_MESSAGE, void*, ImportContext, 36, 4, 4); - TEST_FIELD(RPC_MESSAGE, unsigned long, RpcFlags, 40, 4, 4); + TEST_TYPE_SIZE (RPC_MESSAGE, 44) + TEST_TYPE_ALIGN (RPC_MESSAGE, 4) + TEST_FIELD_SIZE (RPC_MESSAGE, Handle, 4) + TEST_FIELD_ALIGN (RPC_MESSAGE, Handle, 4) + TEST_FIELD_OFFSET(RPC_MESSAGE, Handle, 0) + TEST_FIELD_SIZE (RPC_MESSAGE, DataRepresentation, 4) + TEST_FIELD_ALIGN (RPC_MESSAGE, DataRepresentation, 4) + TEST_FIELD_OFFSET(RPC_MESSAGE, DataRepresentation, 4) + TEST_FIELD_SIZE (RPC_MESSAGE, Buffer, 4) + TEST_FIELD_ALIGN (RPC_MESSAGE, Buffer, 4) + TEST_FIELD_OFFSET(RPC_MESSAGE, Buffer, 8) + TEST_FIELD_SIZE (RPC_MESSAGE, BufferLength, 4) + TEST_FIELD_ALIGN (RPC_MESSAGE, BufferLength, 4) + TEST_FIELD_OFFSET(RPC_MESSAGE, BufferLength, 12) + TEST_FIELD_SIZE (RPC_MESSAGE, ProcNum, 4) + TEST_FIELD_ALIGN (RPC_MESSAGE, ProcNum, 4) + TEST_FIELD_OFFSET(RPC_MESSAGE, ProcNum, 16) + TEST_FIELD_SIZE (RPC_MESSAGE, TransferSyntax, 4) + TEST_FIELD_ALIGN (RPC_MESSAGE, TransferSyntax, 4) + TEST_FIELD_OFFSET(RPC_MESSAGE, TransferSyntax, 20) + TEST_FIELD_SIZE (RPC_MESSAGE, RpcInterfaceInformation, 4) + TEST_FIELD_ALIGN (RPC_MESSAGE, RpcInterfaceInformation, 4) + TEST_FIELD_OFFSET(RPC_MESSAGE, RpcInterfaceInformation, 24) + TEST_FIELD_SIZE (RPC_MESSAGE, ReservedForRuntime, 4) + TEST_FIELD_ALIGN (RPC_MESSAGE, ReservedForRuntime, 4) + TEST_FIELD_OFFSET(RPC_MESSAGE, ReservedForRuntime, 28) + TEST_FIELD_SIZE (RPC_MESSAGE, ManagerEpv, 4) + TEST_FIELD_ALIGN (RPC_MESSAGE, ManagerEpv, 4) + TEST_FIELD_OFFSET(RPC_MESSAGE, ManagerEpv, 32) + TEST_FIELD_SIZE (RPC_MESSAGE, ImportContext, 4) + TEST_FIELD_ALIGN (RPC_MESSAGE, ImportContext, 4) + TEST_FIELD_OFFSET(RPC_MESSAGE, ImportContext, 36) + TEST_FIELD_SIZE (RPC_MESSAGE, RpcFlags, 4) + TEST_FIELD_ALIGN (RPC_MESSAGE, RpcFlags, 4) + TEST_FIELD_OFFSET(RPC_MESSAGE, RpcFlags, 40) } static void test_pack_RPC_PROTSEQ_ENDPOINT(void) { /* RPC_PROTSEQ_ENDPOINT (pack 4) */ - TEST_TYPE(RPC_PROTSEQ_ENDPOINT, 8, 4); - TEST_FIELD(RPC_PROTSEQ_ENDPOINT, unsigned char*, RpcProtocolSequence, 0, 4, 4); - TEST_FIELD(RPC_PROTSEQ_ENDPOINT, unsigned char*, Endpoint, 4, 4, 4); + TEST_TYPE_SIZE (RPC_PROTSEQ_ENDPOINT, 8) + TEST_TYPE_ALIGN (RPC_PROTSEQ_ENDPOINT, 4) + TEST_FIELD_SIZE (RPC_PROTSEQ_ENDPOINT, RpcProtocolSequence, 4) + TEST_FIELD_ALIGN (RPC_PROTSEQ_ENDPOINT, RpcProtocolSequence, 4) + TEST_FIELD_OFFSET(RPC_PROTSEQ_ENDPOINT, RpcProtocolSequence, 0) + TEST_FIELD_SIZE (RPC_PROTSEQ_ENDPOINT, Endpoint, 4) + TEST_FIELD_ALIGN (RPC_PROTSEQ_ENDPOINT, Endpoint, 4) + TEST_FIELD_OFFSET(RPC_PROTSEQ_ENDPOINT, Endpoint, 4) } static void test_pack_RPC_SERVER_INTERFACE(void) { /* RPC_SERVER_INTERFACE (pack 4) */ - TEST_FIELD(RPC_SERVER_INTERFACE, unsigned int, Length, 0, 4, 4); + TEST_TYPE_SIZE (RPC_SERVER_INTERFACE, 68) + TEST_TYPE_ALIGN (RPC_SERVER_INTERFACE, 4) + TEST_FIELD_SIZE (RPC_SERVER_INTERFACE, Length, 4) + TEST_FIELD_ALIGN (RPC_SERVER_INTERFACE, Length, 4) + TEST_FIELD_OFFSET(RPC_SERVER_INTERFACE, Length, 0) + TEST_FIELD_SIZE (RPC_SERVER_INTERFACE, InterfaceId, 20) + TEST_FIELD_ALIGN (RPC_SERVER_INTERFACE, InterfaceId, 4) + TEST_FIELD_OFFSET(RPC_SERVER_INTERFACE, InterfaceId, 4) + TEST_FIELD_SIZE (RPC_SERVER_INTERFACE, TransferSyntax, 20) + TEST_FIELD_ALIGN (RPC_SERVER_INTERFACE, TransferSyntax, 4) + TEST_FIELD_OFFSET(RPC_SERVER_INTERFACE, TransferSyntax, 24) + TEST_FIELD_SIZE (RPC_SERVER_INTERFACE, DispatchTable, 4) + TEST_FIELD_ALIGN (RPC_SERVER_INTERFACE, DispatchTable, 4) + TEST_FIELD_OFFSET(RPC_SERVER_INTERFACE, DispatchTable, 44) + TEST_FIELD_SIZE (RPC_SERVER_INTERFACE, RpcProtseqEndpointCount, 4) + TEST_FIELD_ALIGN (RPC_SERVER_INTERFACE, RpcProtseqEndpointCount, 4) + TEST_FIELD_OFFSET(RPC_SERVER_INTERFACE, RpcProtseqEndpointCount, 48) + TEST_FIELD_SIZE (RPC_SERVER_INTERFACE, RpcProtseqEndpoint, 4) + TEST_FIELD_ALIGN (RPC_SERVER_INTERFACE, RpcProtseqEndpoint, 4) + TEST_FIELD_OFFSET(RPC_SERVER_INTERFACE, RpcProtseqEndpoint, 52) + TEST_FIELD_SIZE (RPC_SERVER_INTERFACE, DefaultManagerEpv, 4) + TEST_FIELD_ALIGN (RPC_SERVER_INTERFACE, DefaultManagerEpv, 4) + TEST_FIELD_OFFSET(RPC_SERVER_INTERFACE, DefaultManagerEpv, 56) + TEST_FIELD_SIZE (RPC_SERVER_INTERFACE, InterpreterInfo, 4) + TEST_FIELD_ALIGN (RPC_SERVER_INTERFACE, InterpreterInfo, 4) + TEST_FIELD_OFFSET(RPC_SERVER_INTERFACE, InterpreterInfo, 60) + TEST_FIELD_SIZE (RPC_SERVER_INTERFACE, Flags, 4) + TEST_FIELD_ALIGN (RPC_SERVER_INTERFACE, Flags, 4) + TEST_FIELD_OFFSET(RPC_SERVER_INTERFACE, Flags, 64) } static void test_pack_RPC_SYNTAX_IDENTIFIER(void) { /* RPC_SYNTAX_IDENTIFIER (pack 4) */ - TEST_TYPE(RPC_SYNTAX_IDENTIFIER, 20, 4); - TEST_FIELD(RPC_SYNTAX_IDENTIFIER, GUID, SyntaxGUID, 0, 16, 4); - TEST_FIELD(RPC_SYNTAX_IDENTIFIER, RPC_VERSION, SyntaxVersion, 16, 4, 2); + TEST_TYPE_SIZE (RPC_SYNTAX_IDENTIFIER, 20) + TEST_TYPE_ALIGN (RPC_SYNTAX_IDENTIFIER, 4) + TEST_FIELD_SIZE (RPC_SYNTAX_IDENTIFIER, SyntaxGUID, 16) + TEST_FIELD_ALIGN (RPC_SYNTAX_IDENTIFIER, SyntaxGUID, 4) + TEST_FIELD_OFFSET(RPC_SYNTAX_IDENTIFIER, SyntaxGUID, 0) + TEST_FIELD_SIZE (RPC_SYNTAX_IDENTIFIER, SyntaxVersion, 4) + TEST_FIELD_ALIGN (RPC_SYNTAX_IDENTIFIER, SyntaxVersion, 2) + TEST_FIELD_OFFSET(RPC_SYNTAX_IDENTIFIER, SyntaxVersion, 16) } static void test_pack_RPC_VERSION(void) { /* RPC_VERSION (pack 4) */ - TEST_TYPE(RPC_VERSION, 4, 2); - TEST_FIELD(RPC_VERSION, unsigned short, MajorVersion, 0, 2, 2); - TEST_FIELD(RPC_VERSION, unsigned short, MinorVersion, 2, 2, 2); + TEST_TYPE_SIZE (RPC_VERSION, 4) + TEST_TYPE_ALIGN (RPC_VERSION, 2) + TEST_FIELD_SIZE (RPC_VERSION, MajorVersion, 2) + TEST_FIELD_ALIGN (RPC_VERSION, MajorVersion, 2) + TEST_FIELD_OFFSET(RPC_VERSION, MajorVersion, 0) + TEST_FIELD_SIZE (RPC_VERSION, MinorVersion, 2) + TEST_FIELD_ALIGN (RPC_VERSION, MinorVersion, 2) + TEST_FIELD_OFFSET(RPC_VERSION, MinorVersion, 2) } static void test_pack_ARRAY_INFO(void) { /* ARRAY_INFO (pack 4) */ - TEST_TYPE(ARRAY_INFO, 24, 4); - TEST_FIELD(ARRAY_INFO, LONG, Dimension, 0, 4, 4); - TEST_FIELD(ARRAY_INFO, ULONG *, BufferConformanceMark, 4, 4, 4); - TEST_FIELD(ARRAY_INFO, ULONG *, BufferVarianceMark, 8, 4, 4); - TEST_FIELD(ARRAY_INFO, ULONG *, MaxCountArray, 12, 4, 4); - TEST_FIELD(ARRAY_INFO, ULONG *, OffsetArray, 16, 4, 4); - TEST_FIELD(ARRAY_INFO, ULONG *, ActualCountArray, 20, 4, 4); + TEST_TYPE_SIZE (ARRAY_INFO, 24) + TEST_TYPE_ALIGN (ARRAY_INFO, 4) + TEST_FIELD_SIZE (ARRAY_INFO, Dimension, 4) + TEST_FIELD_ALIGN (ARRAY_INFO, Dimension, 4) + TEST_FIELD_OFFSET(ARRAY_INFO, Dimension, 0) + TEST_FIELD_SIZE (ARRAY_INFO, BufferConformanceMark, 4) + TEST_FIELD_ALIGN (ARRAY_INFO, BufferConformanceMark, 4) + TEST_FIELD_OFFSET(ARRAY_INFO, BufferConformanceMark, 4) + TEST_FIELD_SIZE (ARRAY_INFO, BufferVarianceMark, 4) + TEST_FIELD_ALIGN (ARRAY_INFO, BufferVarianceMark, 4) + TEST_FIELD_OFFSET(ARRAY_INFO, BufferVarianceMark, 8) + TEST_FIELD_SIZE (ARRAY_INFO, MaxCountArray, 4) + TEST_FIELD_ALIGN (ARRAY_INFO, MaxCountArray, 4) + TEST_FIELD_OFFSET(ARRAY_INFO, MaxCountArray, 12) + TEST_FIELD_SIZE (ARRAY_INFO, OffsetArray, 4) + TEST_FIELD_ALIGN (ARRAY_INFO, OffsetArray, 4) + TEST_FIELD_OFFSET(ARRAY_INFO, OffsetArray, 16) + TEST_FIELD_SIZE (ARRAY_INFO, ActualCountArray, 4) + TEST_FIELD_ALIGN (ARRAY_INFO, ActualCountArray, 4) + TEST_FIELD_OFFSET(ARRAY_INFO, ActualCountArray, 20) } static void test_pack_COMM_FAULT_OFFSETS(void) { /* COMM_FAULT_OFFSETS (pack 4) */ - TEST_TYPE(COMM_FAULT_OFFSETS, 4, 2); - TEST_FIELD(COMM_FAULT_OFFSETS, short, CommOffset, 0, 2, 2); - TEST_FIELD(COMM_FAULT_OFFSETS, short, FaultOffset, 2, 2, 2); + TEST_TYPE_SIZE (COMM_FAULT_OFFSETS, 4) + TEST_TYPE_ALIGN (COMM_FAULT_OFFSETS, 2) + TEST_FIELD_SIZE (COMM_FAULT_OFFSETS, CommOffset, 2) + TEST_FIELD_ALIGN (COMM_FAULT_OFFSETS, CommOffset, 2) + TEST_FIELD_OFFSET(COMM_FAULT_OFFSETS, CommOffset, 0) + TEST_FIELD_SIZE (COMM_FAULT_OFFSETS, FaultOffset, 2) + TEST_FIELD_ALIGN (COMM_FAULT_OFFSETS, FaultOffset, 2) + TEST_FIELD_OFFSET(COMM_FAULT_OFFSETS, FaultOffset, 2) } static void test_pack_CS_STUB_INFO(void) { /* CS_STUB_INFO (pack 4) */ - TEST_TYPE(CS_STUB_INFO, 12, 4); - TEST_FIELD(CS_STUB_INFO, ULONG, WireCodeset, 0, 4, 4); - TEST_FIELD(CS_STUB_INFO, ULONG, DesiredReceivingCodeset, 4, 4, 4); - TEST_FIELD(CS_STUB_INFO, void *, CSArrayInfo, 8, 4, 4); + TEST_TYPE_SIZE (CS_STUB_INFO, 12) + TEST_TYPE_ALIGN (CS_STUB_INFO, 4) + TEST_FIELD_SIZE (CS_STUB_INFO, WireCodeset, 4) + TEST_FIELD_ALIGN (CS_STUB_INFO, WireCodeset, 4) + TEST_FIELD_OFFSET(CS_STUB_INFO, WireCodeset, 0) + TEST_FIELD_SIZE (CS_STUB_INFO, DesiredReceivingCodeset, 4) + TEST_FIELD_ALIGN (CS_STUB_INFO, DesiredReceivingCodeset, 4) + TEST_FIELD_OFFSET(CS_STUB_INFO, DesiredReceivingCodeset, 4) + TEST_FIELD_SIZE (CS_STUB_INFO, CSArrayInfo, 4) + TEST_FIELD_ALIGN (CS_STUB_INFO, CSArrayInfo, 4) + TEST_FIELD_OFFSET(CS_STUB_INFO, CSArrayInfo, 8) } static void test_pack_EXPR_EVAL(void) @@ -341,11 +490,20 @@ static void test_pack_EXPR_EVAL(void) static void test_pack_FULL_PTR_TO_REFID_ELEMENT(void) { /* FULL_PTR_TO_REFID_ELEMENT (pack 4) */ - TEST_TYPE(FULL_PTR_TO_REFID_ELEMENT, 16, 4); - TEST_FIELD(FULL_PTR_TO_REFID_ELEMENT, struct _FULL_PTR_TO_REFID_ELEMENT *, Next, 0, 4, 4); - TEST_FIELD(FULL_PTR_TO_REFID_ELEMENT, void *, Pointer, 4, 4, 4); - TEST_FIELD(FULL_PTR_TO_REFID_ELEMENT, ULONG, RefId, 8, 4, 4); - TEST_FIELD(FULL_PTR_TO_REFID_ELEMENT, unsigned char, State, 12, 1, 1); + TEST_TYPE_SIZE (FULL_PTR_TO_REFID_ELEMENT, 16) + TEST_TYPE_ALIGN (FULL_PTR_TO_REFID_ELEMENT, 4) + TEST_FIELD_SIZE (FULL_PTR_TO_REFID_ELEMENT, Next, 4) + TEST_FIELD_ALIGN (FULL_PTR_TO_REFID_ELEMENT, Next, 4) + TEST_FIELD_OFFSET(FULL_PTR_TO_REFID_ELEMENT, Next, 0) + TEST_FIELD_SIZE (FULL_PTR_TO_REFID_ELEMENT, Pointer, 4) + TEST_FIELD_ALIGN (FULL_PTR_TO_REFID_ELEMENT, Pointer, 4) + TEST_FIELD_OFFSET(FULL_PTR_TO_REFID_ELEMENT, Pointer, 4) + TEST_FIELD_SIZE (FULL_PTR_TO_REFID_ELEMENT, RefId, 4) + TEST_FIELD_ALIGN (FULL_PTR_TO_REFID_ELEMENT, RefId, 4) + TEST_FIELD_OFFSET(FULL_PTR_TO_REFID_ELEMENT, RefId, 8) + TEST_FIELD_SIZE (FULL_PTR_TO_REFID_ELEMENT, State, 1) + TEST_FIELD_ALIGN (FULL_PTR_TO_REFID_ELEMENT, State, 1) + TEST_FIELD_OFFSET(FULL_PTR_TO_REFID_ELEMENT, State, 12) } static void test_pack_FULL_PTR_XLAT_TABLES(void) @@ -356,8 +514,12 @@ static void test_pack_FULL_PTR_XLAT_TABLES(void) static void test_pack_GENERIC_BINDING_INFO(void) { /* GENERIC_BINDING_INFO (pack 4) */ - TEST_FIELD(GENERIC_BINDING_INFO, void *, pObj, 0, 4, 4); - TEST_FIELD(GENERIC_BINDING_INFO, unsigned int, Size, 4, 4, 4); + TEST_FIELD_SIZE (GENERIC_BINDING_INFO, pObj, 4) + TEST_FIELD_ALIGN (GENERIC_BINDING_INFO, pObj, 4) + TEST_FIELD_OFFSET(GENERIC_BINDING_INFO, pObj, 0) + TEST_FIELD_SIZE (GENERIC_BINDING_INFO, Size, 4) + TEST_FIELD_ALIGN (GENERIC_BINDING_INFO, Size, 4) + TEST_FIELD_OFFSET(GENERIC_BINDING_INFO, Size, 4) } static void test_pack_GENERIC_BINDING_ROUTINE_PAIR(void) @@ -373,73 +535,170 @@ static void test_pack_MALLOC_FREE_STRUCT(void) static void test_pack_MIDL_FORMAT_STRING(void) { /* MIDL_FORMAT_STRING (pack 4) */ - TEST_FIELD(MIDL_FORMAT_STRING, short, Pad, 0, 2, 2); + TEST_FIELD_SIZE (MIDL_FORMAT_STRING, Pad, 2) + TEST_FIELD_ALIGN (MIDL_FORMAT_STRING, Pad, 2) + TEST_FIELD_OFFSET(MIDL_FORMAT_STRING, Pad, 0) } static void test_pack_MIDL_SERVER_INFO(void) { /* MIDL_SERVER_INFO (pack 4) */ - TEST_TYPE(MIDL_SERVER_INFO, 32, 4); - TEST_FIELD(MIDL_SERVER_INFO, PMIDL_STUB_DESC, pStubDesc, 0, 4, 4); - TEST_FIELD(MIDL_SERVER_INFO, SERVER_ROUTINE *, DispatchTable, 4, 4, 4); - TEST_FIELD(MIDL_SERVER_INFO, PFORMAT_STRING, ProcString, 8, 4, 4); - TEST_FIELD(MIDL_SERVER_INFO, unsigned short *, FmtStringOffset, 12, 4, 4); - TEST_FIELD(MIDL_SERVER_INFO, STUB_THUNK *, ThunkTable, 16, 4, 4); - TEST_FIELD(MIDL_SERVER_INFO, PRPC_SYNTAX_IDENTIFIER, pTransferSyntax, 20, 4, 4); - TEST_FIELD(MIDL_SERVER_INFO, ULONG_PTR, nCount, 24, 4, 4); - TEST_FIELD(MIDL_SERVER_INFO, PMIDL_SYNTAX_INFO, pSyntaxInfo, 28, 4, 4); + TEST_TYPE_SIZE (MIDL_SERVER_INFO, 32) + TEST_TYPE_ALIGN (MIDL_SERVER_INFO, 4) + TEST_FIELD_SIZE (MIDL_SERVER_INFO, pStubDesc, 4) + TEST_FIELD_ALIGN (MIDL_SERVER_INFO, pStubDesc, 4) + TEST_FIELD_OFFSET(MIDL_SERVER_INFO, pStubDesc, 0) + TEST_FIELD_SIZE (MIDL_SERVER_INFO, DispatchTable, 4) + TEST_FIELD_ALIGN (MIDL_SERVER_INFO, DispatchTable, 4) + TEST_FIELD_OFFSET(MIDL_SERVER_INFO, DispatchTable, 4) + TEST_FIELD_SIZE (MIDL_SERVER_INFO, ProcString, 4) + TEST_FIELD_ALIGN (MIDL_SERVER_INFO, ProcString, 4) + TEST_FIELD_OFFSET(MIDL_SERVER_INFO, ProcString, 8) + TEST_FIELD_SIZE (MIDL_SERVER_INFO, FmtStringOffset, 4) + TEST_FIELD_ALIGN (MIDL_SERVER_INFO, FmtStringOffset, 4) + TEST_FIELD_OFFSET(MIDL_SERVER_INFO, FmtStringOffset, 12) + TEST_FIELD_SIZE (MIDL_SERVER_INFO, ThunkTable, 4) + TEST_FIELD_ALIGN (MIDL_SERVER_INFO, ThunkTable, 4) + TEST_FIELD_OFFSET(MIDL_SERVER_INFO, ThunkTable, 16) + TEST_FIELD_SIZE (MIDL_SERVER_INFO, pTransferSyntax, 4) + TEST_FIELD_ALIGN (MIDL_SERVER_INFO, pTransferSyntax, 4) + TEST_FIELD_OFFSET(MIDL_SERVER_INFO, pTransferSyntax, 20) + TEST_FIELD_SIZE (MIDL_SERVER_INFO, nCount, 4) + TEST_FIELD_ALIGN (MIDL_SERVER_INFO, nCount, 4) + TEST_FIELD_OFFSET(MIDL_SERVER_INFO, nCount, 24) + TEST_FIELD_SIZE (MIDL_SERVER_INFO, pSyntaxInfo, 4) + TEST_FIELD_ALIGN (MIDL_SERVER_INFO, pSyntaxInfo, 4) + TEST_FIELD_OFFSET(MIDL_SERVER_INFO, pSyntaxInfo, 28) } static void test_pack_MIDL_STUB_DESC(void) { /* MIDL_STUB_DESC (pack 4) */ - TEST_FIELD(MIDL_STUB_DESC, void *, RpcInterfaceInformation, 0, 4, 4); + TEST_FIELD_SIZE (MIDL_STUB_DESC, RpcInterfaceInformation, 4) + TEST_FIELD_ALIGN (MIDL_STUB_DESC, RpcInterfaceInformation, 4) + TEST_FIELD_OFFSET(MIDL_STUB_DESC, RpcInterfaceInformation, 0) } static void test_pack_MIDL_STUB_MESSAGE(void) { /* MIDL_STUB_MESSAGE (pack 4) */ - TEST_FIELD(MIDL_STUB_MESSAGE, PRPC_MESSAGE, RpcMsg, 0, 4, 4); - TEST_FIELD(MIDL_STUB_MESSAGE, unsigned char *, Buffer, 4, 4, 4); - TEST_FIELD(MIDL_STUB_MESSAGE, unsigned char *, BufferStart, 8, 4, 4); - TEST_FIELD(MIDL_STUB_MESSAGE, unsigned char *, BufferEnd, 12, 4, 4); - TEST_FIELD(MIDL_STUB_MESSAGE, unsigned char *, BufferMark, 16, 4, 4); - TEST_FIELD(MIDL_STUB_MESSAGE, ULONG, BufferLength, 20, 4, 4); - TEST_FIELD(MIDL_STUB_MESSAGE, ULONG, MemorySize, 24, 4, 4); - TEST_FIELD(MIDL_STUB_MESSAGE, unsigned char *, Memory, 28, 4, 4); - TEST_FIELD(MIDL_STUB_MESSAGE, int, ReuseBuffer, 36, 4, 4); - TEST_FIELD(MIDL_STUB_MESSAGE, struct NDR_ALLOC_ALL_NODES_CONTEXT *, pAllocAllNodesContext, 40, 4, 4); - TEST_FIELD(MIDL_STUB_MESSAGE, struct NDR_POINTER_QUEUE_STATE *, pPointerQueueState, 44, 4, 4); - TEST_FIELD(MIDL_STUB_MESSAGE, int, IgnoreEmbeddedPointers, 48, 4, 4); - TEST_FIELD(MIDL_STUB_MESSAGE, unsigned char *, PointerBufferMark, 52, 4, 4); - TEST_FIELD(MIDL_STUB_MESSAGE, unsigned char, CorrDespIncrement, 56, 1, 1); - TEST_FIELD(MIDL_STUB_MESSAGE, unsigned char, uFlags, 57, 1, 1); - TEST_FIELD(MIDL_STUB_MESSAGE, ULONG_PTR, MaxCount, 60, 4, 4); - TEST_FIELD(MIDL_STUB_MESSAGE, ULONG, Offset, 64, 4, 4); - TEST_FIELD(MIDL_STUB_MESSAGE, ULONG, ActualCount, 68, 4, 4); + TEST_FIELD_SIZE (MIDL_STUB_MESSAGE, RpcMsg, 4) + TEST_FIELD_ALIGN (MIDL_STUB_MESSAGE, RpcMsg, 4) + TEST_FIELD_OFFSET(MIDL_STUB_MESSAGE, RpcMsg, 0) + TEST_FIELD_SIZE (MIDL_STUB_MESSAGE, Buffer, 4) + TEST_FIELD_ALIGN (MIDL_STUB_MESSAGE, Buffer, 4) + TEST_FIELD_OFFSET(MIDL_STUB_MESSAGE, Buffer, 4) + TEST_FIELD_SIZE (MIDL_STUB_MESSAGE, BufferStart, 4) + TEST_FIELD_ALIGN (MIDL_STUB_MESSAGE, BufferStart, 4) + TEST_FIELD_OFFSET(MIDL_STUB_MESSAGE, BufferStart, 8) + TEST_FIELD_SIZE (MIDL_STUB_MESSAGE, BufferEnd, 4) + TEST_FIELD_ALIGN (MIDL_STUB_MESSAGE, BufferEnd, 4) + TEST_FIELD_OFFSET(MIDL_STUB_MESSAGE, BufferEnd, 12) + TEST_FIELD_SIZE (MIDL_STUB_MESSAGE, BufferMark, 4) + TEST_FIELD_ALIGN (MIDL_STUB_MESSAGE, BufferMark, 4) + TEST_FIELD_OFFSET(MIDL_STUB_MESSAGE, BufferMark, 16) + TEST_FIELD_SIZE (MIDL_STUB_MESSAGE, BufferLength, 4) + TEST_FIELD_ALIGN (MIDL_STUB_MESSAGE, BufferLength, 4) + TEST_FIELD_OFFSET(MIDL_STUB_MESSAGE, BufferLength, 20) + TEST_FIELD_SIZE (MIDL_STUB_MESSAGE, MemorySize, 4) + TEST_FIELD_ALIGN (MIDL_STUB_MESSAGE, MemorySize, 4) + TEST_FIELD_OFFSET(MIDL_STUB_MESSAGE, MemorySize, 24) + TEST_FIELD_SIZE (MIDL_STUB_MESSAGE, Memory, 4) + TEST_FIELD_ALIGN (MIDL_STUB_MESSAGE, Memory, 4) + TEST_FIELD_OFFSET(MIDL_STUB_MESSAGE, Memory, 28) + TEST_FIELD_SIZE (MIDL_STUB_MESSAGE, ReuseBuffer, 4) + TEST_FIELD_ALIGN (MIDL_STUB_MESSAGE, ReuseBuffer, 4) + TEST_FIELD_OFFSET(MIDL_STUB_MESSAGE, ReuseBuffer, 36) + TEST_FIELD_SIZE (MIDL_STUB_MESSAGE, pAllocAllNodesContext, 4) + TEST_FIELD_ALIGN (MIDL_STUB_MESSAGE, pAllocAllNodesContext, 4) + TEST_FIELD_OFFSET(MIDL_STUB_MESSAGE, pAllocAllNodesContext, 40) + TEST_FIELD_SIZE (MIDL_STUB_MESSAGE, pPointerQueueState, 4) + TEST_FIELD_ALIGN (MIDL_STUB_MESSAGE, pPointerQueueState, 4) + TEST_FIELD_OFFSET(MIDL_STUB_MESSAGE, pPointerQueueState, 44) + TEST_FIELD_SIZE (MIDL_STUB_MESSAGE, IgnoreEmbeddedPointers, 4) + TEST_FIELD_ALIGN (MIDL_STUB_MESSAGE, IgnoreEmbeddedPointers, 4) + TEST_FIELD_OFFSET(MIDL_STUB_MESSAGE, IgnoreEmbeddedPointers, 48) + TEST_FIELD_SIZE (MIDL_STUB_MESSAGE, PointerBufferMark, 4) + TEST_FIELD_ALIGN (MIDL_STUB_MESSAGE, PointerBufferMark, 4) + TEST_FIELD_OFFSET(MIDL_STUB_MESSAGE, PointerBufferMark, 52) + TEST_FIELD_SIZE (MIDL_STUB_MESSAGE, CorrDespIncrement, 1) + TEST_FIELD_ALIGN (MIDL_STUB_MESSAGE, CorrDespIncrement, 1) + TEST_FIELD_OFFSET(MIDL_STUB_MESSAGE, CorrDespIncrement, 56) + TEST_FIELD_SIZE (MIDL_STUB_MESSAGE, uFlags, 1) + TEST_FIELD_ALIGN (MIDL_STUB_MESSAGE, uFlags, 1) + TEST_FIELD_OFFSET(MIDL_STUB_MESSAGE, uFlags, 57) + TEST_FIELD_SIZE (MIDL_STUB_MESSAGE, MaxCount, 4) + TEST_FIELD_ALIGN (MIDL_STUB_MESSAGE, MaxCount, 4) + TEST_FIELD_OFFSET(MIDL_STUB_MESSAGE, MaxCount, 60) + TEST_FIELD_SIZE (MIDL_STUB_MESSAGE, Offset, 4) + TEST_FIELD_ALIGN (MIDL_STUB_MESSAGE, Offset, 4) + TEST_FIELD_OFFSET(MIDL_STUB_MESSAGE, Offset, 64) + TEST_FIELD_SIZE (MIDL_STUB_MESSAGE, ActualCount, 4) + TEST_FIELD_ALIGN (MIDL_STUB_MESSAGE, ActualCount, 4) + TEST_FIELD_OFFSET(MIDL_STUB_MESSAGE, ActualCount, 68) } static void test_pack_MIDL_STUBLESS_PROXY_INFO(void) { /* MIDL_STUBLESS_PROXY_INFO (pack 4) */ - TEST_TYPE(MIDL_STUBLESS_PROXY_INFO, 24, 4); - TEST_FIELD(MIDL_STUBLESS_PROXY_INFO, PMIDL_STUB_DESC, pStubDesc, 0, 4, 4); - TEST_FIELD(MIDL_STUBLESS_PROXY_INFO, PFORMAT_STRING, ProcFormatString, 4, 4, 4); - TEST_FIELD(MIDL_STUBLESS_PROXY_INFO, unsigned short *, FormatStringOffset, 8, 4, 4); - TEST_FIELD(MIDL_STUBLESS_PROXY_INFO, PRPC_SYNTAX_IDENTIFIER, pTransferSyntax, 12, 4, 4); - TEST_FIELD(MIDL_STUBLESS_PROXY_INFO, ULONG_PTR, nCount, 16, 4, 4); - TEST_FIELD(MIDL_STUBLESS_PROXY_INFO, PMIDL_SYNTAX_INFO, pSyntaxInfo, 20, 4, 4); + TEST_TYPE_SIZE (MIDL_STUBLESS_PROXY_INFO, 24) + TEST_TYPE_ALIGN (MIDL_STUBLESS_PROXY_INFO, 4) + TEST_FIELD_SIZE (MIDL_STUBLESS_PROXY_INFO, pStubDesc, 4) + TEST_FIELD_ALIGN (MIDL_STUBLESS_PROXY_INFO, pStubDesc, 4) + TEST_FIELD_OFFSET(MIDL_STUBLESS_PROXY_INFO, pStubDesc, 0) + TEST_FIELD_SIZE (MIDL_STUBLESS_PROXY_INFO, ProcFormatString, 4) + TEST_FIELD_ALIGN (MIDL_STUBLESS_PROXY_INFO, ProcFormatString, 4) + TEST_FIELD_OFFSET(MIDL_STUBLESS_PROXY_INFO, ProcFormatString, 4) + TEST_FIELD_SIZE (MIDL_STUBLESS_PROXY_INFO, FormatStringOffset, 4) + TEST_FIELD_ALIGN (MIDL_STUBLESS_PROXY_INFO, FormatStringOffset, 4) + TEST_FIELD_OFFSET(MIDL_STUBLESS_PROXY_INFO, FormatStringOffset, 8) + TEST_FIELD_SIZE (MIDL_STUBLESS_PROXY_INFO, pTransferSyntax, 4) + TEST_FIELD_ALIGN (MIDL_STUBLESS_PROXY_INFO, pTransferSyntax, 4) + TEST_FIELD_OFFSET(MIDL_STUBLESS_PROXY_INFO, pTransferSyntax, 12) + TEST_FIELD_SIZE (MIDL_STUBLESS_PROXY_INFO, nCount, 4) + TEST_FIELD_ALIGN (MIDL_STUBLESS_PROXY_INFO, nCount, 4) + TEST_FIELD_OFFSET(MIDL_STUBLESS_PROXY_INFO, nCount, 16) + TEST_FIELD_SIZE (MIDL_STUBLESS_PROXY_INFO, pSyntaxInfo, 4) + TEST_FIELD_ALIGN (MIDL_STUBLESS_PROXY_INFO, pSyntaxInfo, 4) + TEST_FIELD_OFFSET(MIDL_STUBLESS_PROXY_INFO, pSyntaxInfo, 20) } static void test_pack_MIDL_SYNTAX_INFO(void) { /* MIDL_SYNTAX_INFO (pack 4) */ + TEST_TYPE_SIZE (MIDL_SYNTAX_INFO, 48) + TEST_TYPE_ALIGN (MIDL_SYNTAX_INFO, 4) + TEST_FIELD_SIZE (MIDL_SYNTAX_INFO, TransferSyntax, 20) + TEST_FIELD_ALIGN (MIDL_SYNTAX_INFO, TransferSyntax, 4) + TEST_FIELD_OFFSET(MIDL_SYNTAX_INFO, TransferSyntax, 0) + TEST_FIELD_SIZE (MIDL_SYNTAX_INFO, DispatchTable, 4) + TEST_FIELD_ALIGN (MIDL_SYNTAX_INFO, DispatchTable, 4) + TEST_FIELD_OFFSET(MIDL_SYNTAX_INFO, DispatchTable, 20) + TEST_FIELD_SIZE (MIDL_SYNTAX_INFO, ProcString, 4) + TEST_FIELD_ALIGN (MIDL_SYNTAX_INFO, ProcString, 4) + TEST_FIELD_OFFSET(MIDL_SYNTAX_INFO, ProcString, 24) + TEST_FIELD_SIZE (MIDL_SYNTAX_INFO, FmtStringOffset, 4) + TEST_FIELD_ALIGN (MIDL_SYNTAX_INFO, FmtStringOffset, 4) + TEST_FIELD_OFFSET(MIDL_SYNTAX_INFO, FmtStringOffset, 28) + TEST_FIELD_SIZE (MIDL_SYNTAX_INFO, TypeString, 4) + TEST_FIELD_ALIGN (MIDL_SYNTAX_INFO, TypeString, 4) + TEST_FIELD_OFFSET(MIDL_SYNTAX_INFO, TypeString, 32) + TEST_FIELD_SIZE (MIDL_SYNTAX_INFO, aUserMarshalQuadruple, 4) + TEST_FIELD_ALIGN (MIDL_SYNTAX_INFO, aUserMarshalQuadruple, 4) + TEST_FIELD_OFFSET(MIDL_SYNTAX_INFO, aUserMarshalQuadruple, 36) + TEST_FIELD_SIZE (MIDL_SYNTAX_INFO, pReserved1, 4) + TEST_FIELD_ALIGN (MIDL_SYNTAX_INFO, pReserved1, 4) + TEST_FIELD_OFFSET(MIDL_SYNTAX_INFO, pReserved1, 40) + TEST_FIELD_SIZE (MIDL_SYNTAX_INFO, pReserved2, 4) + TEST_FIELD_ALIGN (MIDL_SYNTAX_INFO, pReserved2, 4) + TEST_FIELD_OFFSET(MIDL_SYNTAX_INFO, pReserved2, 44) } static void test_pack_NDR_CCONTEXT(void) { /* NDR_CCONTEXT */ - TEST_TYPE(NDR_CCONTEXT, 4, 4); + TEST_TYPE_SIZE (NDR_CCONTEXT, 4) + TEST_TYPE_ALIGN (NDR_CCONTEXT, 4) } static void test_pack_NDR_NOTIFY_ROUTINE(void) @@ -460,123 +719,157 @@ static void test_pack_NDR_RUNDOWN(void) static void test_pack_NDR_SCONTEXT(void) { /* NDR_SCONTEXT */ - TEST_TYPE(NDR_SCONTEXT, 4, 4); + TEST_TYPE_SIZE (NDR_SCONTEXT, 4) + TEST_TYPE_ALIGN (NDR_SCONTEXT, 4) } static void test_pack_NDR_USER_MARSHAL_INFO(void) { /* NDR_USER_MARSHAL_INFO (pack 4) */ - TEST_FIELD(NDR_USER_MARSHAL_INFO, ULONG, InformationLevel, 0, 4, 4); + TEST_FIELD_SIZE (NDR_USER_MARSHAL_INFO, InformationLevel, 4) + TEST_FIELD_ALIGN (NDR_USER_MARSHAL_INFO, InformationLevel, 4) + TEST_FIELD_OFFSET(NDR_USER_MARSHAL_INFO, InformationLevel, 0) } static void test_pack_NDR_USER_MARSHAL_INFO_LEVEL1(void) { /* NDR_USER_MARSHAL_INFO_LEVEL1 (pack 4) */ - TEST_FIELD(NDR_USER_MARSHAL_INFO_LEVEL1, void *, Buffer, 0, 4, 4); - TEST_FIELD(NDR_USER_MARSHAL_INFO_LEVEL1, ULONG, BufferSize, 4, 4, 4); + TEST_FIELD_SIZE (NDR_USER_MARSHAL_INFO_LEVEL1, Buffer, 4) + TEST_FIELD_ALIGN (NDR_USER_MARSHAL_INFO_LEVEL1, Buffer, 4) + TEST_FIELD_OFFSET(NDR_USER_MARSHAL_INFO_LEVEL1, Buffer, 0) + TEST_FIELD_SIZE (NDR_USER_MARSHAL_INFO_LEVEL1, BufferSize, 4) + TEST_FIELD_ALIGN (NDR_USER_MARSHAL_INFO_LEVEL1, BufferSize, 4) + TEST_FIELD_OFFSET(NDR_USER_MARSHAL_INFO_LEVEL1, BufferSize, 4) } static void test_pack_PARRAY_INFO(void) { /* PARRAY_INFO */ - TEST_TYPE(PARRAY_INFO, 4, 4); - TEST_TYPE_POINTER(PARRAY_INFO, 24, 4); + TEST_TYPE_SIZE (PARRAY_INFO, 4) + TEST_TYPE_ALIGN (PARRAY_INFO, 4) + TEST_TARGET_SIZE (PARRAY_INFO, 24) + TEST_TARGET_ALIGN(PARRAY_INFO, 4) } static void test_pack_PFORMAT_STRING(void) { /* PFORMAT_STRING */ - TEST_TYPE(PFORMAT_STRING, 4, 4); + TEST_TYPE_SIZE (PFORMAT_STRING, 4) + TEST_TYPE_ALIGN (PFORMAT_STRING, 4) } static void test_pack_PFULL_PTR_TO_REFID_ELEMENT(void) { /* PFULL_PTR_TO_REFID_ELEMENT */ - TEST_TYPE(PFULL_PTR_TO_REFID_ELEMENT, 4, 4); - TEST_TYPE_POINTER(PFULL_PTR_TO_REFID_ELEMENT, 16, 4); + TEST_TYPE_SIZE (PFULL_PTR_TO_REFID_ELEMENT, 4) + TEST_TYPE_ALIGN (PFULL_PTR_TO_REFID_ELEMENT, 4) + TEST_TARGET_SIZE (PFULL_PTR_TO_REFID_ELEMENT, 16) + TEST_TARGET_ALIGN(PFULL_PTR_TO_REFID_ELEMENT, 4) } static void test_pack_PFULL_PTR_XLAT_TABLES(void) { /* PFULL_PTR_XLAT_TABLES */ - TEST_TYPE(PFULL_PTR_XLAT_TABLES, 4, 4); + TEST_TYPE_SIZE (PFULL_PTR_XLAT_TABLES, 4) + TEST_TYPE_ALIGN (PFULL_PTR_XLAT_TABLES, 4) } static void test_pack_PGENERIC_BINDING_INFO(void) { /* PGENERIC_BINDING_INFO */ - TEST_TYPE(PGENERIC_BINDING_INFO, 4, 4); + TEST_TYPE_SIZE (PGENERIC_BINDING_INFO, 4) + TEST_TYPE_ALIGN (PGENERIC_BINDING_INFO, 4) } static void test_pack_PGENERIC_BINDING_ROUTINE_PAIR(void) { /* PGENERIC_BINDING_ROUTINE_PAIR */ - TEST_TYPE(PGENERIC_BINDING_ROUTINE_PAIR, 4, 4); + TEST_TYPE_SIZE (PGENERIC_BINDING_ROUTINE_PAIR, 4) + TEST_TYPE_ALIGN (PGENERIC_BINDING_ROUTINE_PAIR, 4) } static void test_pack_PMIDL_SERVER_INFO(void) { /* PMIDL_SERVER_INFO */ - TEST_TYPE(PMIDL_SERVER_INFO, 4, 4); - TEST_TYPE_POINTER(PMIDL_SERVER_INFO, 32, 4); + TEST_TYPE_SIZE (PMIDL_SERVER_INFO, 4) + TEST_TYPE_ALIGN (PMIDL_SERVER_INFO, 4) + TEST_TARGET_SIZE (PMIDL_SERVER_INFO, 32) + TEST_TARGET_ALIGN(PMIDL_SERVER_INFO, 4) } static void test_pack_PMIDL_STUB_DESC(void) { /* PMIDL_STUB_DESC */ - TEST_TYPE(PMIDL_STUB_DESC, 4, 4); + TEST_TYPE_SIZE (PMIDL_STUB_DESC, 4) + TEST_TYPE_ALIGN (PMIDL_STUB_DESC, 4) } static void test_pack_PMIDL_STUB_MESSAGE(void) { /* PMIDL_STUB_MESSAGE */ - TEST_TYPE(PMIDL_STUB_MESSAGE, 4, 4); + TEST_TYPE_SIZE (PMIDL_STUB_MESSAGE, 4) + TEST_TYPE_ALIGN (PMIDL_STUB_MESSAGE, 4) } static void test_pack_PMIDL_STUBLESS_PROXY_INFO(void) { /* PMIDL_STUBLESS_PROXY_INFO */ - TEST_TYPE(PMIDL_STUBLESS_PROXY_INFO, 4, 4); - TEST_TYPE_POINTER(PMIDL_STUBLESS_PROXY_INFO, 24, 4); + TEST_TYPE_SIZE (PMIDL_STUBLESS_PROXY_INFO, 4) + TEST_TYPE_ALIGN (PMIDL_STUBLESS_PROXY_INFO, 4) + TEST_TARGET_SIZE (PMIDL_STUBLESS_PROXY_INFO, 24) + TEST_TARGET_ALIGN(PMIDL_STUBLESS_PROXY_INFO, 4) } static void test_pack_PMIDL_SYNTAX_INFO(void) { /* PMIDL_SYNTAX_INFO */ - TEST_TYPE(PMIDL_SYNTAX_INFO, 4, 4); + TEST_TYPE_SIZE (PMIDL_SYNTAX_INFO, 4) + TEST_TYPE_ALIGN (PMIDL_SYNTAX_INFO, 4) + TEST_TARGET_SIZE (PMIDL_SYNTAX_INFO, 48) + TEST_TARGET_ALIGN(PMIDL_SYNTAX_INFO, 4) } static void test_pack_PNDR_ASYNC_MESSAGE(void) { /* PNDR_ASYNC_MESSAGE */ - TEST_TYPE(PNDR_ASYNC_MESSAGE, 4, 4); + TEST_TYPE_SIZE (PNDR_ASYNC_MESSAGE, 4) + TEST_TYPE_ALIGN (PNDR_ASYNC_MESSAGE, 4) } static void test_pack_PNDR_CORRELATION_INFO(void) { /* PNDR_CORRELATION_INFO */ - TEST_TYPE(PNDR_CORRELATION_INFO, 4, 4); + TEST_TYPE_SIZE (PNDR_CORRELATION_INFO, 4) + TEST_TYPE_ALIGN (PNDR_CORRELATION_INFO, 4) } static void test_pack_PSCONTEXT_QUEUE(void) { /* PSCONTEXT_QUEUE */ - TEST_TYPE(PSCONTEXT_QUEUE, 4, 4); - TEST_TYPE_POINTER(PSCONTEXT_QUEUE, 8, 4); + TEST_TYPE_SIZE (PSCONTEXT_QUEUE, 4) + TEST_TYPE_ALIGN (PSCONTEXT_QUEUE, 4) + TEST_TARGET_SIZE (PSCONTEXT_QUEUE, 8) + TEST_TARGET_ALIGN(PSCONTEXT_QUEUE, 4) } static void test_pack_PXMIT_ROUTINE_QUINTUPLE(void) { /* PXMIT_ROUTINE_QUINTUPLE */ - TEST_TYPE(PXMIT_ROUTINE_QUINTUPLE, 4, 4); + TEST_TYPE_SIZE (PXMIT_ROUTINE_QUINTUPLE, 4) + TEST_TYPE_ALIGN (PXMIT_ROUTINE_QUINTUPLE, 4) } static void test_pack_SCONTEXT_QUEUE(void) { /* SCONTEXT_QUEUE (pack 4) */ - TEST_TYPE(SCONTEXT_QUEUE, 8, 4); - TEST_FIELD(SCONTEXT_QUEUE, ULONG, NumberOfObjects, 0, 4, 4); - TEST_FIELD(SCONTEXT_QUEUE, NDR_SCONTEXT *, ArrayOfObjects, 4, 4, 4); + TEST_TYPE_SIZE (SCONTEXT_QUEUE, 8) + TEST_TYPE_ALIGN (SCONTEXT_QUEUE, 4) + TEST_FIELD_SIZE (SCONTEXT_QUEUE, NumberOfObjects, 4) + TEST_FIELD_ALIGN (SCONTEXT_QUEUE, NumberOfObjects, 4) + TEST_FIELD_OFFSET(SCONTEXT_QUEUE, NumberOfObjects, 0) + TEST_FIELD_SIZE (SCONTEXT_QUEUE, ArrayOfObjects, 4) + TEST_FIELD_ALIGN (SCONTEXT_QUEUE, ArrayOfObjects, 4) + TEST_FIELD_OFFSET(SCONTEXT_QUEUE, ArrayOfObjects, 4) } static void test_pack_SERVER_ROUTINE(void) @@ -592,10 +885,18 @@ static void test_pack_STUB_THUNK(void) static void test_pack_USER_MARSHAL_CB(void) { /* USER_MARSHAL_CB (pack 4) */ - TEST_FIELD(USER_MARSHAL_CB, ULONG, Flags, 0, 4, 4); - TEST_FIELD(USER_MARSHAL_CB, PMIDL_STUB_MESSAGE, pStubMsg, 4, 4, 4); - TEST_FIELD(USER_MARSHAL_CB, PFORMAT_STRING, pReserve, 8, 4, 4); - TEST_FIELD(USER_MARSHAL_CB, ULONG, Signature, 12, 4, 4); + TEST_FIELD_SIZE (USER_MARSHAL_CB, Flags, 4) + TEST_FIELD_ALIGN (USER_MARSHAL_CB, Flags, 4) + TEST_FIELD_OFFSET(USER_MARSHAL_CB, Flags, 0) + TEST_FIELD_SIZE (USER_MARSHAL_CB, pStubMsg, 4) + TEST_FIELD_ALIGN (USER_MARSHAL_CB, pStubMsg, 4) + TEST_FIELD_OFFSET(USER_MARSHAL_CB, pStubMsg, 4) + TEST_FIELD_SIZE (USER_MARSHAL_CB, pReserve, 4) + TEST_FIELD_ALIGN (USER_MARSHAL_CB, pReserve, 4) + TEST_FIELD_OFFSET(USER_MARSHAL_CB, pReserve, 8) + TEST_FIELD_SIZE (USER_MARSHAL_CB, Signature, 4) + TEST_FIELD_ALIGN (USER_MARSHAL_CB, Signature, 4) + TEST_FIELD_OFFSET(USER_MARSHAL_CB, Signature, 12) } static void test_pack_USER_MARSHAL_FREEING_ROUTINE(void) @@ -719,5 +1020,9 @@ static void test_pack(void) START_TEST(generated) { +#ifdef _WIN64 + ok(0, "The type size / alignment tests don't support Win64 yet\n"); +#else test_pack(); +#endif } diff --git a/dlls/rpcrt4/tests/ndr_marshall.c b/dlls/rpcrt4/tests/ndr_marshall.c index 418c6eedf17..de49848dc67 100644 --- a/dlls/rpcrt4/tests/ndr_marshall.c +++ b/dlls/rpcrt4/tests/ndr_marshall.c @@ -538,6 +538,7 @@ static void test_nontrivial_pointer_types(void) RPC_MESSAGE RpcMessage; MIDL_STUB_MESSAGE StubMsg; MIDL_STUB_DESC StubDesc; + DWORD size; void *ptr; char **p1; char *p2; @@ -580,8 +581,8 @@ static void test_nontrivial_pointer_types(void) ptr = NdrPointerMarshall( &StubMsg, (unsigned char *)p1, &fmtstr_ref_unique_out[4] ); ok(ptr == NULL, "ret %p\n", ptr); - ok(StubMsg.Buffer - StubMsg.BufferStart == 5, "Buffer %p Start %p len %d\n", - StubMsg.Buffer, StubMsg.BufferStart, StubMsg.Buffer - StubMsg.BufferStart); + size = StubMsg.Buffer - StubMsg.BufferStart; + ok(size == 5, "Buffer %p Start %p len %d\n", StubMsg.Buffer, StubMsg.BufferStart, size); ok(*(unsigned int *)StubMsg.BufferStart != 0, "pointer ID marshalled incorrectly\n"); ok(*(unsigned char *)(StubMsg.BufferStart + 4) == 0x22, "char data marshalled incorrectly: 0x%x\n", *(unsigned char *)(StubMsg.BufferStart + 4)); @@ -1549,6 +1550,7 @@ static void test_conformant_string(void) RPC_MESSAGE RpcMessage; MIDL_STUB_MESSAGE StubMsg; MIDL_STUB_DESC StubDesc; + DWORD size; void *ptr; unsigned char *mem, *mem_orig; char memsrc[] = "This is a test string"; @@ -1581,8 +1583,9 @@ static void test_conformant_string(void) ptr = NdrPointerMarshall( &StubMsg, (unsigned char *)memsrc, fmtstr_conf_str ); ok(ptr == NULL, "ret %p\n", ptr); - ok(StubMsg.Buffer - StubMsg.BufferStart == sizeof(memsrc) + 12, "Buffer %p Start %p len %d\n", - StubMsg.Buffer, StubMsg.BufferStart, StubMsg.Buffer - StubMsg.BufferStart); + size = StubMsg.Buffer - StubMsg.BufferStart; + ok(size == sizeof(memsrc) + 12, "Buffer %p Start %p len %d\n", + StubMsg.Buffer, StubMsg.BufferStart, size); ok(!memcmp(StubMsg.BufferStart + 12, memsrc, sizeof(memsrc)), "incorrectly marshaled\n"); StubMsg.Buffer = StubMsg.BufferStart; @@ -1665,6 +1668,7 @@ static void test_nonconformant_string(void) RPC_MESSAGE RpcMessage; MIDL_STUB_MESSAGE StubMsg; MIDL_STUB_DESC StubDesc; + DWORD size; void *ptr; unsigned char *mem, *mem_orig; unsigned char memsrc[10] = "This is"; @@ -1700,8 +1704,9 @@ static void test_nonconformant_string(void) ptr = NdrNonConformantStringMarshall( &StubMsg, (unsigned char *)memsrc, fmtstr_nonconf_str ); ok(ptr == NULL, "ret %p\n", ptr); - ok(StubMsg.Buffer - StubMsg.BufferStart == strlen((char *)memsrc) + 1 + 8, "Buffer %p Start %p len %d\n", - StubMsg.Buffer, StubMsg.BufferStart, StubMsg.Buffer - StubMsg.BufferStart); + size = StubMsg.Buffer - StubMsg.BufferStart; + ok(size == strlen((char *)memsrc) + 1 + 8, "Buffer %p Start %p len %d\n", + StubMsg.Buffer, StubMsg.BufferStart, size); ok(!memcmp(StubMsg.BufferStart + 8, memsrc, strlen((char *)memsrc) + 1), "incorrectly marshaled\n"); StubMsg.Buffer = StubMsg.BufferStart; @@ -1774,8 +1779,9 @@ static void test_nonconformant_string(void) ptr = NdrNonConformantStringMarshall( &StubMsg, (unsigned char *)memsrc2, fmtstr_nonconf_str ); ok(ptr == NULL, "ret %p\n", ptr); - ok(StubMsg.Buffer - StubMsg.BufferStart == strlen((char *)memsrc2) + 1 + 8, "Buffer %p Start %p len %d\n", - StubMsg.Buffer, StubMsg.BufferStart, StubMsg.Buffer - StubMsg.BufferStart); + size = StubMsg.Buffer - StubMsg.BufferStart; + ok(size == strlen((char *)memsrc2) + 1 + 8, "Buffer %p Start %p len %d\n", + StubMsg.Buffer, StubMsg.BufferStart, size); ok(!memcmp(StubMsg.BufferStart + 8, memsrc2, strlen((char *)memsrc2) + 1), "incorrectly marshaled\n"); StubMsg.Buffer = StubMsg.BufferStart; @@ -1909,8 +1915,8 @@ static void test_conf_complex_struct(void) ptr = NdrComplexStructMarshall( &StubMsg, (unsigned char *)memsrc, &fmtstr_complex_struct[30] ); ok(ptr == NULL, "ret %p\n", ptr); - ok(*(unsigned int *)StubMsg.BufferStart == 20, "Conformance should have been 20 instead of %d\n", (unsigned int)StubMsg.BufferStart); - ok(*(unsigned int *)(StubMsg.BufferStart + 4) == 20, "conf_complex.size should have been 20 instead of %d\n", (unsigned int)(StubMsg.BufferStart + 4)); + ok(*(unsigned int *)StubMsg.BufferStart == 20, "Conformance should have been 20 instead of %d\n", *(unsigned int *)StubMsg.BufferStart); + ok(*(unsigned int *)(StubMsg.BufferStart + 4) == 20, "conf_complex.size should have been 20 instead of %d\n", *(unsigned int *)(StubMsg.BufferStart + 4)); for (i = 0; i < 20; i++) ok(*(unsigned int *)(StubMsg.BufferStart + 8 + i * 4) == 0, "pointer id for conf_complex.array[%d] should have been 0 instead of 0x%x\n", i, *(unsigned int *)(StubMsg.BufferStart + 8 + i * 4)); diff --git a/dlls/setupapi/setupapi.spec b/dlls/setupapi/setupapi.spec index 03435bc2e90..6c86043470a 100644 --- a/dlls/setupapi/setupapi.spec +++ b/dlls/setupapi/setupapi.spec @@ -533,7 +533,7 @@ @ stdcall StringTableInitialize() @ stdcall StringTableInitializeEx(long long) @ stdcall StringTableLookUpString(ptr wstr long) -@ stdcall StringTableLookUpStringEx(ptr wstr long ptr ptr) +@ stdcall StringTableLookUpStringEx(ptr wstr long ptr long) @ stdcall StringTableSetExtraData(ptr long ptr long) @ stdcall StringTableStringFromId(ptr long) @ stdcall StringTableStringFromIdEx(ptr long ptr ptr) diff --git a/dlls/setupapi/setupcab.c b/dlls/setupapi/setupcab.c index a2a7a5f71f2..765f4167269 100644 --- a/dlls/setupapi/setupcab.c +++ b/dlls/setupapi/setupcab.c @@ -307,7 +307,7 @@ static INT_PTR CDECL sc_FNNOTIFY_A(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION p ci.DiskName = pfdin->psz2; ci.SetId = pfdin->setID; ci.CabinetNumber = pfdin->iCabinet; - phsc->msghandler(phsc->context, SPFILENOTIFY_CABINETINFO, (UINT) &ci, 0); + phsc->msghandler(phsc->context, SPFILENOTIFY_CABINETINFO, (UINT_PTR) &ci, 0); return 0; case fdintPARTIAL_FILE: TRACE("Partial file notification\n"); @@ -328,7 +328,7 @@ static INT_PTR CDECL sc_FNNOTIFY_A(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION p fici.DosAttribs = pfdin->attribs; memset(&(fici.FullTargetName[0]), 0, MAX_PATH); err = phsc->msghandler(phsc->context, SPFILENOTIFY_FILEINCABINET, - (UINT) &fici, (UINT) pfdin->psz1); + (UINT_PTR)&fici, (UINT_PTR)pfdin->psz1); if (err == FILEOP_DOIT) { TRACE(" Callback specified filename: %s\n", debugstr_a(&(fici.FullTargetName[0]))); if (!fici.FullTargetName[0]) { @@ -352,7 +352,7 @@ static INT_PTR CDECL sc_FNNOTIFY_A(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION p fp.Flags = 0; /* the following should be a fixme -- but it occurs too many times */ WARN("Should set file date/time/attribs (and execute files?)\n"); - err = phsc->msghandler(phsc->context, SPFILENOTIFY_FILEEXTRACTED, (UINT) &fp, 0); + err = phsc->msghandler(phsc->context, SPFILENOTIFY_FILEEXTRACTED, (UINT_PTR)&fp, 0); if (sc_cb_close(pfdin->hf)) WARN("_close failed.\n"); if (err) { @@ -374,7 +374,7 @@ static INT_PTR CDECL sc_FNNOTIFY_A(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION p ci.CabinetNumber = pfdin->iCabinet; /* remember the new cabinet name */ strcpy(&(phsc->most_recent_cabinet_name[0]), pfdin->psz1); - err = phsc->msghandler(phsc->context, SPFILENOTIFY_NEEDNEWCABINET, (UINT) &ci, (UINT) &(mysterio[0])); + err = phsc->msghandler(phsc->context, SPFILENOTIFY_NEEDNEWCABINET, (UINT_PTR)&ci, (UINT_PTR)mysterio); if (err) { SetLastError(err); return -1; @@ -438,7 +438,7 @@ static INT_PTR CDECL sc_FNNOTIFY_W(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION p ci.DiskName = &(buf2[0]); ci.SetId = pfdin->setID; ci.CabinetNumber = pfdin->iCabinet; - phsc->msghandler(phsc->context, SPFILENOTIFY_CABINETINFO, (UINT) &ci, 0); + phsc->msghandler(phsc->context, SPFILENOTIFY_CABINETINFO, (UINT_PTR)&ci, 0); return 0; case fdintPARTIAL_FILE: TRACE("Partial file notification\n"); @@ -462,7 +462,7 @@ static INT_PTR CDECL sc_FNNOTIFY_W(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION p fici.DosAttribs = pfdin->attribs; memset(&(fici.FullTargetName[0]), 0, MAX_PATH * sizeof(WCHAR)); err = phsc->msghandler(phsc->context, SPFILENOTIFY_FILEINCABINET, - (UINT) &fici, (UINT) pfdin->psz1); + (UINT_PTR)&fici, (UINT_PTR)pfdin->psz1); if (err == FILEOP_DOIT) { TRACE(" Callback specified filename: %s\n", debugstr_w(&(fici.FullTargetName[0]))); if (fici.FullTargetName[0]) { @@ -495,7 +495,7 @@ static INT_PTR CDECL sc_FNNOTIFY_W(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION p fp.Flags = 0; /* a valid fixme -- but occurs too many times */ /* FIXME("Should set file date/time/attribs (and execute files?)\n"); */ - err = phsc->msghandler(phsc->context, SPFILENOTIFY_FILEEXTRACTED, (UINT) &fp, 0); + err = phsc->msghandler(phsc->context, SPFILENOTIFY_FILEEXTRACTED, (UINT_PTR)&fp, 0); if (sc_cb_close(pfdin->hf)) WARN("_close failed.\n"); if (err) { @@ -525,7 +525,7 @@ static INT_PTR CDECL sc_FNNOTIFY_W(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION p ci.DiskName = &(buf2[0]); ci.SetId = pfdin->setID; ci.CabinetNumber = pfdin->iCabinet; - err = phsc->msghandler(phsc->context, SPFILENOTIFY_NEEDNEWCABINET, (UINT) &ci, (UINT) &(mysterio[0])); + err = phsc->msghandler(phsc->context, SPFILENOTIFY_NEEDNEWCABINET, (UINT_PTR)&ci, (UINT_PTR)mysterio); if (err) { SetLastError(err); return -1; diff --git a/dlls/setupapi/stringtable.c b/dlls/setupapi/stringtable.c index fe319b8733d..0dbe6e8ebc7 100644 --- a/dlls/setupapi/stringtable.c +++ b/dlls/setupapi/stringtable.c @@ -457,7 +457,7 @@ StringTableGetExtraData(HSTRING_TABLE hStringTable, * dwFlags [I] Flags * 1: case sensitive compare * lpExtraData [O] Pointer to the buffer that receives the extra data - * lpReserved [I/O] Unused + * dwReserved [I/O] Unused * * RETURNS * Success: String ID @@ -468,13 +468,13 @@ StringTableLookUpStringEx(HSTRING_TABLE hStringTable, LPWSTR lpString, DWORD dwFlags, LPVOID lpExtraData, - LPDWORD lpReserved) + DWORD dwReserved) { PSTRING_TABLE pStringTable; DWORD i; - TRACE("%p %s %x %p, %p\n", hStringTable, debugstr_w(lpString), dwFlags, - lpExtraData, lpReserved); + TRACE("%p %s %x %p, %x\n", hStringTable, debugstr_w(lpString), dwFlags, + lpExtraData, dwReserved); pStringTable = (PSTRING_TABLE)hStringTable; if (pStringTable == NULL) @@ -493,7 +493,7 @@ StringTableLookUpStringEx(HSTRING_TABLE hStringTable, if (!lstrcmpW(pStringTable->pSlots[i].pString, lpString)) { if (lpExtraData) - memcpy(lpExtraData, pStringTable->pSlots[i].pData, (DWORD)lpReserved); + memcpy(lpExtraData, pStringTable->pSlots[i].pData, dwReserved); return i + 1; } } @@ -502,7 +502,7 @@ StringTableLookUpStringEx(HSTRING_TABLE hStringTable, if (!lstrcmpiW(pStringTable->pSlots[i].pString, lpString)) { if (lpExtraData) - memcpy(lpExtraData, pStringTable->pSlots[i].pData, (DWORD)lpReserved); + memcpy(lpExtraData, pStringTable->pSlots[i].pData, dwReserved); return i + 1; } } @@ -532,7 +532,7 @@ StringTableLookUpString(HSTRING_TABLE hStringTable, LPWSTR lpString, DWORD dwFlags) { - return StringTableLookUpStringEx(hStringTable, lpString, dwFlags, NULL, NULL); + return StringTableLookUpStringEx(hStringTable, lpString, dwFlags, NULL, 0); } diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c index 78b2ca3ec3a..9a5b1fc6137 100644 --- a/dlls/setupapi/tests/devinst.c +++ b/dlls/setupapi/tests/devinst.c @@ -835,12 +835,6 @@ static void testGetDeviceInterfaceDetail(void) SetLastError(0xdeadbeef); ret = pSetupDiGetDeviceInterfaceDetailA(set, &interfaceData, detail, size, &size, NULL); - ok(!ret && GetLastError() == ERROR_INVALID_USER_BUFFER, - "Expected ERROR_INVALID_USER_BUFFER, got %08x\n", GetLastError()); - /* Windows 2000 and up check for the exact size */ - detail->cbSize = FIELD_OFFSET(SP_DEVICE_INTERFACE_DETAIL_DATA_A, DevicePath[1]); - ret = pSetupDiGetDeviceInterfaceDetailA(set, &interfaceData, detail, - size, &size, NULL); ok(ret, "SetupDiGetDeviceInterfaceDetailA failed: %d\n", GetLastError()); ok(!lstrcmpiA(path, detail->DevicePath) || diff --git a/dlls/setupapi/tests/stringtable.c b/dlls/setupapi/tests/stringtable.c index a209f23f056..40e4a54d189 100644 --- a/dlls/setupapi/tests/stringtable.c +++ b/dlls/setupapi/tests/stringtable.c @@ -46,7 +46,7 @@ static HSTRING_TABLE (WINAPI *pStringTableDuplicate)(HSTRING_TABLE hStringTable) static HSTRING_TABLE (WINAPI *pStringTableInitialize)(VOID); static HSTRING_TABLE (WINAPI *pStringTableInitializeEx)(DWORD, DWORD); static DWORD (WINAPI *pStringTableLookUpString)(HSTRING_TABLE, LPWSTR, DWORD); -static DWORD (WINAPI *pStringTableLookUpStringEx)(HSTRING_TABLE, LPWSTR, DWORD, LPVOID, LPDWORD); +static DWORD (WINAPI *pStringTableLookUpStringEx)(HSTRING_TABLE, LPWSTR, DWORD, LPVOID, DWORD); static LPWSTR (WINAPI *pStringTableStringFromId)(HSTRING_TABLE, DWORD); #if 0 static BOOL (WINAPI *pStringTableStringFromIdEx)(HSTRING_TABLE, DWORD, LPWSTR, LPDWORD); @@ -247,33 +247,33 @@ static void test_StringTableLookUpStringEx(void) ok(table2 != NULL, "Failed to duplicate String Table\n"); /* case insensitive */ - retval = pStringTableLookUpStringEx(table, string, 0, NULL, NULL); + retval = pStringTableLookUpStringEx(table, string, 0, NULL, 0); ok(retval != ~0u, "Failed find string in String Table 1\n"); ok(retval == hstring, "Lookup for string (%x) does not match previous handle (%x) in String Table 1\n", retval, hstring); - retval = pStringTableLookUpStringEx(table2, string, 0, NULL, NULL); + retval = pStringTableLookUpStringEx(table2, string, 0, NULL, 0); ok(retval != ~0u, "Failed find string in String Table 2\n"); - retval = pStringTableLookUpStringEx(table, String, 0, NULL, NULL); + retval = pStringTableLookUpStringEx(table, String, 0, NULL, 0); ok(retval != ~0u, "Failed find String in String Table 1\n"); - retval = pStringTableLookUpStringEx(table2, String, 0, NULL, NULL); + retval = pStringTableLookUpStringEx(table2, String, 0, NULL, 0); ok(retval != ~0u, "Failed find String in String Table 2\n"); - retval=pStringTableLookUpStringEx(table, foo, 0, NULL, NULL); + retval=pStringTableLookUpStringEx(table, foo, 0, NULL, 0); ok(retval != ~0u, "Failed find foo in String Table 1\n"); ok(retval == hfoo, "Lookup for foo (%x) does not match previous handle (%x) in String Table 1\n", retval, hfoo); - retval = pStringTableLookUpStringEx(table2, foo, 0, NULL, NULL); + retval = pStringTableLookUpStringEx(table2, foo, 0, NULL, 0); ok(retval != ~0u, "Failed find foo in String Table 2\n"); /* case sensitive */ - retval = pStringTableLookUpStringEx(table, string,ST_CASE_SENSITIVE_COMPARE, NULL, NULL); - retval2 = pStringTableLookUpStringEx(table, String, ST_CASE_SENSITIVE_COMPARE, NULL, NULL); + retval = pStringTableLookUpStringEx(table, string,ST_CASE_SENSITIVE_COMPARE, NULL, 0); + retval2 = pStringTableLookUpStringEx(table, String, ST_CASE_SENSITIVE_COMPARE, NULL, 0); ok(retval != retval2, "Lookup of string equals String in Table 1\n"); ok(retval == hString, "Lookup for String (%x) does not match previous handle (%x) in String Table 1\n", @@ -289,17 +289,17 @@ static void test_StringTableLookUpStringEx(void) ok(retval != ~0u, "failed to add 'UILEVEL' to string table\n"); memset(buffer, 0x55, sizeof(buffer)); - retval = pStringTableLookUpStringEx(table, uilevel, ST_CASE_SENSITIVE_COMPARE, buffer, (LPDWORD)0); + retval = pStringTableLookUpStringEx(table, uilevel, ST_CASE_SENSITIVE_COMPARE, buffer, 0); ok(retval != ~0u, "failed find 'UILEVEL' in string table\n"); ok(memcmp(buffer, &data, 4), "unexpected data\n"); memset(buffer, 0x55, sizeof(buffer)); - retval = pStringTableLookUpStringEx(table, uilevel, ST_CASE_SENSITIVE_COMPARE, buffer, (LPDWORD)2); + retval = pStringTableLookUpStringEx(table, uilevel, ST_CASE_SENSITIVE_COMPARE, buffer, 2); ok(retval != ~0u, "failed find 'UILEVEL' in string table\n"); ok(!memcmp(buffer, &data, 2), "unexpected data\n"); memset(buffer, 0x55, sizeof(buffer)); - retval = pStringTableLookUpStringEx(table, uilevel, ST_CASE_SENSITIVE_COMPARE, buffer, (LPDWORD)sizeof(buffer)); + retval = pStringTableLookUpStringEx(table, uilevel, ST_CASE_SENSITIVE_COMPARE, buffer, sizeof(buffer)); ok(retval != ~0u, "failed find 'UILEVEL' in string table\n"); ok(!memcmp(buffer, &data, 4), "unexpected data\n"); diff --git a/dlls/shdocvw/shdocvw_main.c b/dlls/shdocvw/shdocvw_main.c index 8640600f730..a065aa5e0b8 100644 --- a/dlls/shdocvw/shdocvw_main.c +++ b/dlls/shdocvw/shdocvw_main.c @@ -205,7 +205,7 @@ void WINAPI OpenURL(HWND hWnd, HINSTANCE hInst, LPCSTR lpcstrUrl, int nShowCmd) * Some forwards (by ordinal) to SHLWAPI */ -static void* fetch_shlwapi_ordinal(unsigned ord) +static void* fetch_shlwapi_ordinal(UINT_PTR ord) { static const WCHAR shlwapiW[] = {'s','h','l','w','a','p','i','.','d','l','l','\0'}; static HANDLE h; diff --git a/dlls/shell32/control.c b/dlls/shell32/control.c index 464b9d1b682..fc012a97893 100644 --- a/dlls/shell32/control.c +++ b/dlls/shell32/control.c @@ -300,7 +300,7 @@ static void Control_WndProc_Create(HWND hWnd, const CREATESTRUCTW* cs) mii.dwTypeData = applet->info[i].szName; mii.cch = sizeof(applet->info[i].szName) / sizeof(applet->info[i].szName[0]); mii.wID = IDM_CPANEL_APPLET_BASE + menucount; - mii.dwItemData = (DWORD) item; + mii.dwItemData = (ULONG_PTR)item; if (InsertMenuItemW(hSubMenu, menucount, TRUE, &mii)) { /* add the list view item */ diff --git a/dlls/shell32/shell32.spec b/dlls/shell32/shell32.spec index b4761c66059..a3d76ac6b16 100644 --- a/dlls/shell32/shell32.spec +++ b/dlls/shell32/shell32.spec @@ -231,6 +231,7 @@ 523 stdcall -noname SHFreeShared(long long) 524 stdcall -noname RealDriveType(long long) 525 stub RealDriveTypeFlags + 526 stdcall @() SHELL32_526 640 stdcall -noname NTSHChangeNotifyRegister(long long long long long long) 641 stdcall -noname NTSHChangeNotifyDeregister(long) diff --git a/dlls/shell32/shelllink.c b/dlls/shell32/shelllink.c index b4a686ed0aa..3329fc86ef0 100644 --- a/dlls/shell32/shelllink.c +++ b/dlls/shell32/shelllink.c @@ -2529,7 +2529,7 @@ ShellLink_InvokeCommand( IContextMenu* iface, LPCMINVOKECOMMANDINFO lpici ) if ( lpici->lpVerb != MAKEINTRESOURCEA(This->iIdOpen) ) { - ERR("Unknown id %d != %d\n", (INT)lpici->lpVerb, This->iIdOpen ); + ERR("Unknown id %p != %d\n", lpici->lpVerb, This->iIdOpen ); return E_INVALIDARG; } diff --git a/dlls/shell32/shellord.c b/dlls/shell32/shellord.c index 78934451d61..2b7103cd112 100644 --- a/dlls/shell32/shellord.c +++ b/dlls/shell32/shellord.c @@ -1992,3 +1992,12 @@ BOOL WINAPI LinkWindow_UnregisterClass(void) FIXME("()\n"); return TRUE; } + +/************************************************************************* + * (SHELL32.526) + */ +BOOL WINAPI SHELL32_526(void) +{ + FIXME("()\n"); + return FALSE; +} diff --git a/dlls/shell32/tests/generated.c b/dlls/shell32/tests/generated.c dissimilarity index 60% index 7e8d2811cd6..76eec39f212 100644 --- a/dlls/shell32/tests/generated.c +++ b/dlls/shell32/tests/generated.c @@ -1,1389 +1,2021 @@ -/* File generated automatically from tools/winapi/test.dat; do not edit! */ -/* This file can be copied, modified and distributed without restriction. */ - -/* - * Unit tests for data structure packing - */ - -#define WINVER 0x0501 -#define _WIN32_IE 0x0501 -#define _WIN32_WINNT 0x0501 - -#define WINE_NOWINSOCK - -#include -#include "windef.h" -#include "winbase.h" -#include "wtypes.h" -#include "shellapi.h" -#include "winuser.h" -#include "wingdi.h" -#include "shlobj.h" - -#include "wine/test.h" - -/*********************************************************************** - * Compatibility macros - */ - -#define DWORD_PTR UINT_PTR -#define LONG_PTR INT_PTR -#define ULONG_PTR UINT_PTR - -/*********************************************************************** - * Windows API extension - */ - -#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) -# define FIELD_ALIGNMENT(type, field) __alignof(((type*)0)->field) -#elif defined(__GNUC__) -# define FIELD_ALIGNMENT(type, field) __alignof__(((type*)0)->field) -#else -/* FIXME: Not sure if is possible to do without compiler extension */ -#endif - -#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) -# define _TYPE_ALIGNMENT(type) __alignof(type) -#elif defined(__GNUC__) -# define _TYPE_ALIGNMENT(type) __alignof__(type) -#else -/* - * FIXME: Not sure if is possible to do without compiler extension - * (if type is not just a name that is, if so the normal) - * TYPE_ALIGNMENT can be used) - */ -#endif - -#if defined(TYPE_ALIGNMENT) && defined(_MSC_VER) && _MSC_VER >= 800 && !defined(__cplusplus) -#pragma warning(disable:4116) -#endif - -#if !defined(TYPE_ALIGNMENT) && defined(_TYPE_ALIGNMENT) -# define TYPE_ALIGNMENT _TYPE_ALIGNMENT -#endif - -/*********************************************************************** - * Test helper macros - */ - -#ifdef FIELD_ALIGNMENT -# define TEST_FIELD_ALIGNMENT(type, field, align) \ - ok(FIELD_ALIGNMENT(type, field) == align, \ - "FIELD_ALIGNMENT(" #type ", " #field ") == %d (expected " #align ")\n", \ - (int)FIELD_ALIGNMENT(type, field)) -#else -# define TEST_FIELD_ALIGNMENT(type, field, align) do { } while (0) -#endif - -#define TEST_FIELD_OFFSET(type, field, offset) \ - ok(FIELD_OFFSET(type, field) == offset, \ - "FIELD_OFFSET(" #type ", " #field ") == %ld (expected " #offset ")\n", \ - (long int)FIELD_OFFSET(type, field)) - -#ifdef _TYPE_ALIGNMENT -#define TEST__TYPE_ALIGNMENT(type, align) \ - ok(_TYPE_ALIGNMENT(type) == align, "TYPE_ALIGNMENT(" #type ") == %d (expected " #align ")\n", (int)_TYPE_ALIGNMENT(type)) -#else -# define TEST__TYPE_ALIGNMENT(type, align) do { } while (0) -#endif - -#ifdef TYPE_ALIGNMENT -#define TEST_TYPE_ALIGNMENT(type, align) \ - ok(TYPE_ALIGNMENT(type) == align, "TYPE_ALIGNMENT(" #type ") == %d (expected " #align ")\n", (int)TYPE_ALIGNMENT(type)) -#else -# define TEST_TYPE_ALIGNMENT(type, align) do { } while (0) -#endif - -#define TEST_TYPE_SIZE(type, size) \ - ok(sizeof(type) == size, "sizeof(" #type ") == %d (expected " #size ")\n", ((int) sizeof(type))) - -/*********************************************************************** - * Test macros - */ - -#define TEST_FIELD(type, field_type, field_name, field_offset, field_size, field_align) \ - TEST_TYPE_SIZE(field_type, field_size); \ - TEST_FIELD_ALIGNMENT(type, field_name, field_align); \ - TEST_FIELD_OFFSET(type, field_name, field_offset); \ - -#define TEST_TYPE(type, size, align) \ - TEST_TYPE_ALIGNMENT(type, align); \ - TEST_TYPE_SIZE(type, size) - -#define TEST_TYPE_POINTER(type, size, align) \ - TEST__TYPE_ALIGNMENT(*(type)0, align); \ - TEST_TYPE_SIZE(*(type)0, size) - -#define TEST_TYPE_SIGNED(type) \ - ok((type) -1 < 0, "(" #type ") -1 < 0\n"); - -#define TEST_TYPE_UNSIGNED(type) \ - ok((type) -1 > 0, "(" #type ") -1 > 0\n"); - -static void test_pack_BLOB(void) -{ - /* BLOB (pack 4) */ - TEST_TYPE(BLOB, 8, 4); - TEST_FIELD(BLOB, ULONG, cbSize, 0, 4, 4); - TEST_FIELD(BLOB, BYTE *, pBlobData, 4, 4, 4); -} - -static void test_pack_BSTR(void) -{ - /* BSTR */ - TEST_TYPE(BSTR, 4, 4); - TEST_TYPE_POINTER(BSTR, 2, 2); -} - -static void test_pack_BSTRBLOB(void) -{ - /* BSTRBLOB (pack 4) */ - TEST_TYPE(BSTRBLOB, 8, 4); - TEST_FIELD(BSTRBLOB, ULONG, cbSize, 0, 4, 4); - TEST_FIELD(BSTRBLOB, BYTE *, pData, 4, 4, 4); -} - -static void test_pack_BYTE_BLOB(void) -{ - /* BYTE_BLOB (pack 4) */ - TEST_TYPE(BYTE_BLOB, 8, 4); - TEST_FIELD(BYTE_BLOB, unsigned long, clSize, 0, 4, 4); - TEST_FIELD(BYTE_BLOB, byte[1], abData, 4, 1, 1); -} - -static void test_pack_BYTE_SIZEDARR(void) -{ - /* BYTE_SIZEDARR (pack 4) */ - TEST_TYPE(BYTE_SIZEDARR, 8, 4); - TEST_FIELD(BYTE_SIZEDARR, unsigned long, clSize, 0, 4, 4); - TEST_FIELD(BYTE_SIZEDARR, byte *, pData, 4, 4, 4); -} - -static void test_pack_CLIPDATA(void) -{ - /* CLIPDATA (pack 4) */ - TEST_TYPE(CLIPDATA, 12, 4); - TEST_FIELD(CLIPDATA, ULONG, cbSize, 0, 4, 4); - TEST_FIELD(CLIPDATA, long, ulClipFmt, 4, 4, 4); - TEST_FIELD(CLIPDATA, BYTE *, pClipData, 8, 4, 4); -} - -static void test_pack_CLIPFORMAT(void) -{ - /* CLIPFORMAT */ - TEST_TYPE(CLIPFORMAT, 2, 2); - TEST_TYPE_UNSIGNED(CLIPFORMAT); -} - -static void test_pack_COAUTHIDENTITY(void) -{ - /* COAUTHIDENTITY (pack 4) */ - TEST_TYPE(COAUTHIDENTITY, 28, 4); - TEST_FIELD(COAUTHIDENTITY, USHORT *, User, 0, 4, 4); - TEST_FIELD(COAUTHIDENTITY, ULONG, UserLength, 4, 4, 4); - TEST_FIELD(COAUTHIDENTITY, USHORT *, Domain, 8, 4, 4); - TEST_FIELD(COAUTHIDENTITY, ULONG, DomainLength, 12, 4, 4); - TEST_FIELD(COAUTHIDENTITY, USHORT *, Password, 16, 4, 4); - TEST_FIELD(COAUTHIDENTITY, ULONG, PasswordLength, 20, 4, 4); - TEST_FIELD(COAUTHIDENTITY, ULONG, Flags, 24, 4, 4); -} - -static void test_pack_COAUTHINFO(void) -{ - /* COAUTHINFO (pack 4) */ - TEST_TYPE(COAUTHINFO, 28, 4); - TEST_FIELD(COAUTHINFO, DWORD, dwAuthnSvc, 0, 4, 4); - TEST_FIELD(COAUTHINFO, DWORD, dwAuthzSvc, 4, 4, 4); - TEST_FIELD(COAUTHINFO, LPWSTR, pwszServerPrincName, 8, 4, 4); - TEST_FIELD(COAUTHINFO, DWORD, dwAuthnLevel, 12, 4, 4); - TEST_FIELD(COAUTHINFO, DWORD, dwImpersonationLevel, 16, 4, 4); - TEST_FIELD(COAUTHINFO, COAUTHIDENTITY *, pAuthIdentityData, 20, 4, 4); - TEST_FIELD(COAUTHINFO, DWORD, dwCapabilities, 24, 4, 4); -} - -static void test_pack_DATE(void) -{ - /* DATE */ - TEST_TYPE(DATE, 8, 8); -} - -static void test_pack_DOUBLE(void) -{ - /* DOUBLE */ - TEST_TYPE(DOUBLE, 8, 8); -} - -static void test_pack_DWORD_SIZEDARR(void) -{ - /* DWORD_SIZEDARR (pack 4) */ - TEST_TYPE(DWORD_SIZEDARR, 8, 4); - TEST_FIELD(DWORD_SIZEDARR, unsigned long, clSize, 0, 4, 4); - TEST_FIELD(DWORD_SIZEDARR, unsigned long *, pData, 4, 4, 4); -} - -static void test_pack_FLAGGED_BYTE_BLOB(void) -{ - /* FLAGGED_BYTE_BLOB (pack 4) */ - TEST_TYPE(FLAGGED_BYTE_BLOB, 12, 4); - TEST_FIELD(FLAGGED_BYTE_BLOB, unsigned long, fFlags, 0, 4, 4); - TEST_FIELD(FLAGGED_BYTE_BLOB, unsigned long, clSize, 4, 4, 4); - TEST_FIELD(FLAGGED_BYTE_BLOB, byte[1], abData, 8, 1, 1); -} - -static void test_pack_FLAGGED_WORD_BLOB(void) -{ - /* FLAGGED_WORD_BLOB (pack 4) */ - TEST_TYPE(FLAGGED_WORD_BLOB, 12, 4); - TEST_FIELD(FLAGGED_WORD_BLOB, unsigned long, fFlags, 0, 4, 4); - TEST_FIELD(FLAGGED_WORD_BLOB, unsigned long, clSize, 4, 4, 4); - TEST_FIELD(FLAGGED_WORD_BLOB, unsigned short[1], asData, 8, 2, 2); -} - -static void test_pack_HMETAFILEPICT(void) -{ - /* HMETAFILEPICT */ - TEST_TYPE(HMETAFILEPICT, 4, 4); -} - -static void test_pack_HYPER_SIZEDARR(void) -{ - /* HYPER_SIZEDARR (pack 4) */ - TEST_TYPE(HYPER_SIZEDARR, 8, 4); - TEST_FIELD(HYPER_SIZEDARR, unsigned long, clSize, 0, 4, 4); - TEST_FIELD(HYPER_SIZEDARR, hyper *, pData, 4, 4, 4); -} - -static void test_pack_LPBLOB(void) -{ - /* LPBLOB */ - TEST_TYPE(LPBLOB, 4, 4); -} - -static void test_pack_LPBSTR(void) -{ - /* LPBSTR */ - TEST_TYPE(LPBSTR, 4, 4); - TEST_TYPE_POINTER(LPBSTR, 4, 4); -} - -static void test_pack_LPBSTRBLOB(void) -{ - /* LPBSTRBLOB */ - TEST_TYPE(LPBSTRBLOB, 4, 4); -} - -static void test_pack_LPCOLESTR(void) -{ - /* LPCOLESTR */ - TEST_TYPE(LPCOLESTR, 4, 4); - TEST_TYPE_POINTER(LPCOLESTR, 2, 2); -} - -static void test_pack_LPCY(void) -{ - /* LPCY */ - TEST_TYPE(LPCY, 4, 4); -} - -static void test_pack_LPDECIMAL(void) -{ - /* LPDECIMAL */ - TEST_TYPE(LPDECIMAL, 4, 4); -} - -static void test_pack_LPOLESTR(void) -{ - /* LPOLESTR */ - TEST_TYPE(LPOLESTR, 4, 4); - TEST_TYPE_POINTER(LPOLESTR, 2, 2); -} - -static void test_pack_OLECHAR(void) -{ - /* OLECHAR */ - TEST_TYPE(OLECHAR, 2, 2); -} - -static void test_pack_PROPID(void) -{ - /* PROPID */ - TEST_TYPE(PROPID, 4, 4); -} - -static void test_pack_RemHBITMAP(void) -{ - /* RemHBITMAP (pack 4) */ - TEST_TYPE(RemHBITMAP, 8, 4); - TEST_FIELD(RemHBITMAP, unsigned long, cbData, 0, 4, 4); - TEST_FIELD(RemHBITMAP, byte[1], data, 4, 1, 1); -} - -static void test_pack_RemHENHMETAFILE(void) -{ - /* RemHENHMETAFILE (pack 4) */ - TEST_TYPE(RemHENHMETAFILE, 8, 4); - TEST_FIELD(RemHENHMETAFILE, unsigned long, cbData, 0, 4, 4); - TEST_FIELD(RemHENHMETAFILE, byte[1], data, 4, 1, 1); -} - -static void test_pack_RemHGLOBAL(void) -{ - /* RemHGLOBAL (pack 4) */ - TEST_TYPE(RemHGLOBAL, 12, 4); - TEST_FIELD(RemHGLOBAL, long, fNullHGlobal, 0, 4, 4); - TEST_FIELD(RemHGLOBAL, unsigned long, cbData, 4, 4, 4); - TEST_FIELD(RemHGLOBAL, byte[1], data, 8, 1, 1); -} - -static void test_pack_RemHMETAFILEPICT(void) -{ - /* RemHMETAFILEPICT (pack 4) */ - TEST_TYPE(RemHMETAFILEPICT, 20, 4); - TEST_FIELD(RemHMETAFILEPICT, long, mm, 0, 4, 4); - TEST_FIELD(RemHMETAFILEPICT, long, xExt, 4, 4, 4); - TEST_FIELD(RemHMETAFILEPICT, long, yExt, 8, 4, 4); - TEST_FIELD(RemHMETAFILEPICT, unsigned long, cbData, 12, 4, 4); - TEST_FIELD(RemHMETAFILEPICT, byte[1], data, 16, 1, 1); -} - -static void test_pack_RemHPALETTE(void) -{ - /* RemHPALETTE (pack 4) */ - TEST_TYPE(RemHPALETTE, 8, 4); - TEST_FIELD(RemHPALETTE, unsigned long, cbData, 0, 4, 4); - TEST_FIELD(RemHPALETTE, byte[1], data, 4, 1, 1); -} - -static void test_pack_SCODE(void) -{ - /* SCODE */ - TEST_TYPE(SCODE, 4, 4); -} - -static void test_pack_UP_BYTE_BLOB(void) -{ - /* UP_BYTE_BLOB */ - TEST_TYPE(UP_BYTE_BLOB, 4, 4); - TEST_TYPE_POINTER(UP_BYTE_BLOB, 8, 4); -} - -static void test_pack_UP_FLAGGED_BYTE_BLOB(void) -{ - /* UP_FLAGGED_BYTE_BLOB */ - TEST_TYPE(UP_FLAGGED_BYTE_BLOB, 4, 4); - TEST_TYPE_POINTER(UP_FLAGGED_BYTE_BLOB, 12, 4); -} - -static void test_pack_UP_FLAGGED_WORD_BLOB(void) -{ - /* UP_FLAGGED_WORD_BLOB */ - TEST_TYPE(UP_FLAGGED_WORD_BLOB, 4, 4); - TEST_TYPE_POINTER(UP_FLAGGED_WORD_BLOB, 12, 4); -} - -static void test_pack_VARIANT_BOOL(void) -{ - /* VARIANT_BOOL */ - TEST_TYPE(VARIANT_BOOL, 2, 2); - TEST_TYPE_SIGNED(VARIANT_BOOL); -} - -static void test_pack_VARTYPE(void) -{ - /* VARTYPE */ - TEST_TYPE(VARTYPE, 2, 2); - TEST_TYPE_UNSIGNED(VARTYPE); -} - -static void test_pack_WORD_SIZEDARR(void) -{ - /* WORD_SIZEDARR (pack 4) */ - TEST_TYPE(WORD_SIZEDARR, 8, 4); - TEST_FIELD(WORD_SIZEDARR, unsigned long, clSize, 0, 4, 4); - TEST_FIELD(WORD_SIZEDARR, unsigned short *, pData, 4, 4, 4); -} - -static void test_pack_remoteMETAFILEPICT(void) -{ - /* remoteMETAFILEPICT (pack 4) */ - TEST_TYPE(remoteMETAFILEPICT, 16, 4); - TEST_FIELD(remoteMETAFILEPICT, long, mm, 0, 4, 4); - TEST_FIELD(remoteMETAFILEPICT, long, xExt, 4, 4, 4); - TEST_FIELD(remoteMETAFILEPICT, long, yExt, 8, 4, 4); - TEST_FIELD(remoteMETAFILEPICT, userHMETAFILE *, hMF, 12, 4, 4); -} - -static void test_pack_userBITMAP(void) -{ - /* userBITMAP (pack 4) */ - TEST_TYPE(userBITMAP, 28, 4); - TEST_FIELD(userBITMAP, LONG, bmType, 0, 4, 4); - TEST_FIELD(userBITMAP, LONG, bmWidth, 4, 4, 4); - TEST_FIELD(userBITMAP, LONG, bmHeight, 8, 4, 4); - TEST_FIELD(userBITMAP, LONG, bmWidthBytes, 12, 4, 4); - TEST_FIELD(userBITMAP, WORD, bmPlanes, 16, 2, 2); - TEST_FIELD(userBITMAP, WORD, bmBitsPixel, 18, 2, 2); - TEST_FIELD(userBITMAP, ULONG, cbSize, 20, 4, 4); - TEST_FIELD(userBITMAP, byte[1], pBuffer, 24, 1, 1); -} - -static void test_pack_userCLIPFORMAT(void) -{ - /* userCLIPFORMAT (pack 4) */ - TEST_FIELD(userCLIPFORMAT, long, fContext, 0, 4, 4); -} - -static void test_pack_userHBITMAP(void) -{ - /* userHBITMAP (pack 4) */ - TEST_FIELD(userHBITMAP, long, fContext, 0, 4, 4); -} - -static void test_pack_userHENHMETAFILE(void) -{ - /* userHENHMETAFILE (pack 4) */ - TEST_FIELD(userHENHMETAFILE, long, fContext, 0, 4, 4); -} - -static void test_pack_userHGLOBAL(void) -{ - /* userHGLOBAL (pack 4) */ - TEST_FIELD(userHGLOBAL, long, fContext, 0, 4, 4); -} - -static void test_pack_userHMETAFILE(void) -{ - /* userHMETAFILE (pack 4) */ - TEST_FIELD(userHMETAFILE, long, fContext, 0, 4, 4); -} - -static void test_pack_userHMETAFILEPICT(void) -{ - /* userHMETAFILEPICT (pack 4) */ - TEST_FIELD(userHMETAFILEPICT, long, fContext, 0, 4, 4); -} - -static void test_pack_userHPALETTE(void) -{ - /* userHPALETTE (pack 4) */ - TEST_FIELD(userHPALETTE, long, fContext, 0, 4, 4); -} - -static void test_pack_wireBSTR(void) -{ - /* wireBSTR */ - TEST_TYPE(wireBSTR, 4, 4); - TEST_TYPE_POINTER(wireBSTR, 12, 4); -} - -static void test_pack_wireCLIPFORMAT(void) -{ - /* wireCLIPFORMAT */ - TEST_TYPE(wireCLIPFORMAT, 4, 4); -} - -static void test_pack_wireHBITMAP(void) -{ - /* wireHBITMAP */ - TEST_TYPE(wireHBITMAP, 4, 4); -} - -static void test_pack_wireHENHMETAFILE(void) -{ - /* wireHENHMETAFILE */ - TEST_TYPE(wireHENHMETAFILE, 4, 4); -} - -static void test_pack_wireHGLOBAL(void) -{ - /* wireHGLOBAL */ - TEST_TYPE(wireHGLOBAL, 4, 4); -} - -static void test_pack_wireHMETAFILE(void) -{ - /* wireHMETAFILE */ - TEST_TYPE(wireHMETAFILE, 4, 4); -} - -static void test_pack_wireHMETAFILEPICT(void) -{ - /* wireHMETAFILEPICT */ - TEST_TYPE(wireHMETAFILEPICT, 4, 4); -} - -static void test_pack_wireHPALETTE(void) -{ - /* wireHPALETTE */ - TEST_TYPE(wireHPALETTE, 4, 4); -} - -static void test_pack_CLSID(void) -{ - /* CLSID */ - TEST_TYPE(CLSID, 16, 4); -} - -static void test_pack_FMTID(void) -{ - /* FMTID */ - TEST_TYPE(FMTID, 16, 4); -} - -static void test_pack_GUID(void) -{ - /* GUID (pack 4) */ - TEST_TYPE(GUID, 16, 4); - TEST_FIELD(GUID, unsigned long, Data1, 0, 4, 4); - TEST_FIELD(GUID, unsigned short, Data2, 4, 2, 2); - TEST_FIELD(GUID, unsigned short, Data3, 6, 2, 2); - TEST_FIELD(GUID, unsigned char[ 8 ], Data4, 8, 8, 1); -} - -static void test_pack_IID(void) -{ - /* IID */ - TEST_TYPE(IID, 16, 4); -} - -static void test_pack_LPGUID(void) -{ - /* LPGUID */ - TEST_TYPE(LPGUID, 4, 4); - TEST_TYPE_POINTER(LPGUID, 16, 4); -} - -static void test_pack_APPBARDATA(void) -{ - /* APPBARDATA (pack 1) */ - TEST_TYPE(APPBARDATA, 36, 1); - TEST_FIELD(APPBARDATA, DWORD, cbSize, 0, 4, 1); - TEST_FIELD(APPBARDATA, HWND, hWnd, 4, 4, 1); - TEST_FIELD(APPBARDATA, UINT, uCallbackMessage, 8, 4, 1); - TEST_FIELD(APPBARDATA, UINT, uEdge, 12, 4, 1); - TEST_FIELD(APPBARDATA, RECT, rc, 16, 16, 1); - TEST_FIELD(APPBARDATA, LPARAM, lParam, 32, 4, 1); -} - -static void test_pack_DRAGINFOA(void) -{ - /* DRAGINFOA (pack 1) */ - TEST_TYPE(DRAGINFOA, 24, 1); - TEST_FIELD(DRAGINFOA, UINT, uSize, 0, 4, 1); - TEST_FIELD(DRAGINFOA, POINT, pt, 4, 8, 1); - TEST_FIELD(DRAGINFOA, BOOL, fNC, 12, 4, 1); - TEST_FIELD(DRAGINFOA, LPSTR, lpFileList, 16, 4, 1); - TEST_FIELD(DRAGINFOA, DWORD, grfKeyState, 20, 4, 1); -} - -static void test_pack_DRAGINFOW(void) -{ - /* DRAGINFOW (pack 1) */ - TEST_TYPE(DRAGINFOW, 24, 1); - TEST_FIELD(DRAGINFOW, UINT, uSize, 0, 4, 1); - TEST_FIELD(DRAGINFOW, POINT, pt, 4, 8, 1); - TEST_FIELD(DRAGINFOW, BOOL, fNC, 12, 4, 1); - TEST_FIELD(DRAGINFOW, LPWSTR, lpFileList, 16, 4, 1); - TEST_FIELD(DRAGINFOW, DWORD, grfKeyState, 20, 4, 1); -} - -static void test_pack_FILEOP_FLAGS(void) -{ - /* FILEOP_FLAGS */ - TEST_TYPE(FILEOP_FLAGS, 2, 2); - TEST_TYPE_UNSIGNED(FILEOP_FLAGS); -} - -static void test_pack_LPDRAGINFOA(void) -{ - /* LPDRAGINFOA */ - TEST_TYPE(LPDRAGINFOA, 4, 4); - TEST_TYPE_POINTER(LPDRAGINFOA, 24, 1); -} - -static void test_pack_LPDRAGINFOW(void) -{ - /* LPDRAGINFOW */ - TEST_TYPE(LPDRAGINFOW, 4, 4); - TEST_TYPE_POINTER(LPDRAGINFOW, 24, 1); -} - -static void test_pack_LPSHELLEXECUTEINFOA(void) -{ - /* LPSHELLEXECUTEINFOA */ - TEST_TYPE(LPSHELLEXECUTEINFOA, 4, 4); -} - -static void test_pack_LPSHELLEXECUTEINFOW(void) -{ - /* LPSHELLEXECUTEINFOW */ - TEST_TYPE(LPSHELLEXECUTEINFOW, 4, 4); -} - -static void test_pack_LPSHFILEOPSTRUCTA(void) -{ - /* LPSHFILEOPSTRUCTA */ - TEST_TYPE(LPSHFILEOPSTRUCTA, 4, 4); - TEST_TYPE_POINTER(LPSHFILEOPSTRUCTA, 30, 1); -} - -static void test_pack_LPSHFILEOPSTRUCTW(void) -{ - /* LPSHFILEOPSTRUCTW */ - TEST_TYPE(LPSHFILEOPSTRUCTW, 4, 4); - TEST_TYPE_POINTER(LPSHFILEOPSTRUCTW, 30, 1); -} - -static void test_pack_LPSHNAMEMAPPINGA(void) -{ - /* LPSHNAMEMAPPINGA */ - TEST_TYPE(LPSHNAMEMAPPINGA, 4, 4); - TEST_TYPE_POINTER(LPSHNAMEMAPPINGA, 16, 1); -} - -static void test_pack_LPSHNAMEMAPPINGW(void) -{ - /* LPSHNAMEMAPPINGW */ - TEST_TYPE(LPSHNAMEMAPPINGW, 4, 4); - TEST_TYPE_POINTER(LPSHNAMEMAPPINGW, 16, 1); -} - -static void test_pack_NOTIFYICONDATAA(void) -{ - /* NOTIFYICONDATAA (pack 1) */ - TEST_FIELD(NOTIFYICONDATAA, DWORD, cbSize, 0, 4, 1); - TEST_FIELD(NOTIFYICONDATAA, HWND, hWnd, 4, 4, 1); - TEST_FIELD(NOTIFYICONDATAA, UINT, uID, 8, 4, 1); - TEST_FIELD(NOTIFYICONDATAA, UINT, uFlags, 12, 4, 1); - TEST_FIELD(NOTIFYICONDATAA, UINT, uCallbackMessage, 16, 4, 1); - TEST_FIELD(NOTIFYICONDATAA, HICON, hIcon, 20, 4, 1); - TEST_FIELD(NOTIFYICONDATAA, CHAR[128], szTip, 24, 128, 1); - TEST_FIELD(NOTIFYICONDATAA, DWORD, dwState, 152, 4, 1); - TEST_FIELD(NOTIFYICONDATAA, DWORD, dwStateMask, 156, 4, 1); - TEST_FIELD(NOTIFYICONDATAA, CHAR[256], szInfo, 160, 256, 1); -} - -static void test_pack_NOTIFYICONDATAW(void) -{ - /* NOTIFYICONDATAW (pack 1) */ - TEST_FIELD(NOTIFYICONDATAW, DWORD, cbSize, 0, 4, 1); - TEST_FIELD(NOTIFYICONDATAW, HWND, hWnd, 4, 4, 1); - TEST_FIELD(NOTIFYICONDATAW, UINT, uID, 8, 4, 1); - TEST_FIELD(NOTIFYICONDATAW, UINT, uFlags, 12, 4, 1); - TEST_FIELD(NOTIFYICONDATAW, UINT, uCallbackMessage, 16, 4, 1); - TEST_FIELD(NOTIFYICONDATAW, HICON, hIcon, 20, 4, 1); - TEST_FIELD(NOTIFYICONDATAW, WCHAR[128], szTip, 24, 256, 1); - TEST_FIELD(NOTIFYICONDATAW, DWORD, dwState, 280, 4, 1); - TEST_FIELD(NOTIFYICONDATAW, DWORD, dwStateMask, 284, 4, 1); - TEST_FIELD(NOTIFYICONDATAW, WCHAR[256], szInfo, 288, 512, 1); -} - -static void test_pack_PAPPBARDATA(void) -{ - /* PAPPBARDATA */ - TEST_TYPE(PAPPBARDATA, 4, 4); - TEST_TYPE_POINTER(PAPPBARDATA, 36, 1); -} - -static void test_pack_PNOTIFYICONDATAA(void) -{ - /* PNOTIFYICONDATAA */ - TEST_TYPE(PNOTIFYICONDATAA, 4, 4); -} - -static void test_pack_PNOTIFYICONDATAW(void) -{ - /* PNOTIFYICONDATAW */ - TEST_TYPE(PNOTIFYICONDATAW, 4, 4); -} - -static void test_pack_PRINTEROP_FLAGS(void) -{ - /* PRINTEROP_FLAGS */ - TEST_TYPE(PRINTEROP_FLAGS, 2, 2); - TEST_TYPE_UNSIGNED(PRINTEROP_FLAGS); -} - -static void test_pack_SHELLEXECUTEINFOA(void) -{ - /* SHELLEXECUTEINFOA (pack 1) */ - TEST_FIELD(SHELLEXECUTEINFOA, DWORD, cbSize, 0, 4, 1); - TEST_FIELD(SHELLEXECUTEINFOA, ULONG, fMask, 4, 4, 1); - TEST_FIELD(SHELLEXECUTEINFOA, HWND, hwnd, 8, 4, 1); - TEST_FIELD(SHELLEXECUTEINFOA, LPCSTR, lpVerb, 12, 4, 1); - TEST_FIELD(SHELLEXECUTEINFOA, LPCSTR, lpFile, 16, 4, 1); - TEST_FIELD(SHELLEXECUTEINFOA, LPCSTR, lpParameters, 20, 4, 1); - TEST_FIELD(SHELLEXECUTEINFOA, LPCSTR, lpDirectory, 24, 4, 1); - TEST_FIELD(SHELLEXECUTEINFOA, INT, nShow, 28, 4, 1); - TEST_FIELD(SHELLEXECUTEINFOA, HINSTANCE, hInstApp, 32, 4, 1); - TEST_FIELD(SHELLEXECUTEINFOA, LPVOID, lpIDList, 36, 4, 1); - TEST_FIELD(SHELLEXECUTEINFOA, LPCSTR, lpClass, 40, 4, 1); - TEST_FIELD(SHELLEXECUTEINFOA, HKEY, hkeyClass, 44, 4, 1); - TEST_FIELD(SHELLEXECUTEINFOA, DWORD, dwHotKey, 48, 4, 1); -} - -static void test_pack_SHELLEXECUTEINFOW(void) -{ - /* SHELLEXECUTEINFOW (pack 1) */ - TEST_FIELD(SHELLEXECUTEINFOW, DWORD, cbSize, 0, 4, 1); - TEST_FIELD(SHELLEXECUTEINFOW, ULONG, fMask, 4, 4, 1); - TEST_FIELD(SHELLEXECUTEINFOW, HWND, hwnd, 8, 4, 1); - TEST_FIELD(SHELLEXECUTEINFOW, LPCWSTR, lpVerb, 12, 4, 1); - TEST_FIELD(SHELLEXECUTEINFOW, LPCWSTR, lpFile, 16, 4, 1); - TEST_FIELD(SHELLEXECUTEINFOW, LPCWSTR, lpParameters, 20, 4, 1); - TEST_FIELD(SHELLEXECUTEINFOW, LPCWSTR, lpDirectory, 24, 4, 1); - TEST_FIELD(SHELLEXECUTEINFOW, INT, nShow, 28, 4, 1); - TEST_FIELD(SHELLEXECUTEINFOW, HINSTANCE, hInstApp, 32, 4, 1); - TEST_FIELD(SHELLEXECUTEINFOW, LPVOID, lpIDList, 36, 4, 1); - TEST_FIELD(SHELLEXECUTEINFOW, LPCWSTR, lpClass, 40, 4, 1); - TEST_FIELD(SHELLEXECUTEINFOW, HKEY, hkeyClass, 44, 4, 1); - TEST_FIELD(SHELLEXECUTEINFOW, DWORD, dwHotKey, 48, 4, 1); -} - -static void test_pack_SHFILEINFOA(void) -{ - /* SHFILEINFOA (pack 1) */ - TEST_TYPE(SHFILEINFOA, 352, 1); - TEST_FIELD(SHFILEINFOA, HICON, hIcon, 0, 4, 1); - TEST_FIELD(SHFILEINFOA, int, iIcon, 4, 4, 1); - TEST_FIELD(SHFILEINFOA, DWORD, dwAttributes, 8, 4, 1); - TEST_FIELD(SHFILEINFOA, CHAR[MAX_PATH], szDisplayName, 12, 260, 1); - TEST_FIELD(SHFILEINFOA, CHAR[80], szTypeName, 272, 80, 1); -} - -static void test_pack_SHFILEINFOW(void) -{ - /* SHFILEINFOW (pack 1) */ - TEST_TYPE(SHFILEINFOW, 692, 1); - TEST_FIELD(SHFILEINFOW, HICON, hIcon, 0, 4, 1); - TEST_FIELD(SHFILEINFOW, int, iIcon, 4, 4, 1); - TEST_FIELD(SHFILEINFOW, DWORD, dwAttributes, 8, 4, 1); - TEST_FIELD(SHFILEINFOW, WCHAR[MAX_PATH], szDisplayName, 12, 520, 1); - TEST_FIELD(SHFILEINFOW, WCHAR[80], szTypeName, 532, 160, 1); -} - -static void test_pack_SHFILEOPSTRUCTA(void) -{ - /* SHFILEOPSTRUCTA (pack 1) */ - TEST_TYPE(SHFILEOPSTRUCTA, 30, 1); - TEST_FIELD(SHFILEOPSTRUCTA, HWND, hwnd, 0, 4, 1); - TEST_FIELD(SHFILEOPSTRUCTA, UINT, wFunc, 4, 4, 1); - TEST_FIELD(SHFILEOPSTRUCTA, LPCSTR, pFrom, 8, 4, 1); - TEST_FIELD(SHFILEOPSTRUCTA, LPCSTR, pTo, 12, 4, 1); - TEST_FIELD(SHFILEOPSTRUCTA, FILEOP_FLAGS, fFlags, 16, 2, 1); - TEST_FIELD(SHFILEOPSTRUCTA, BOOL, fAnyOperationsAborted, 18, 4, 1); - TEST_FIELD(SHFILEOPSTRUCTA, LPVOID, hNameMappings, 22, 4, 1); - TEST_FIELD(SHFILEOPSTRUCTA, LPCSTR, lpszProgressTitle, 26, 4, 1); -} - -static void test_pack_SHFILEOPSTRUCTW(void) -{ - /* SHFILEOPSTRUCTW (pack 1) */ - TEST_TYPE(SHFILEOPSTRUCTW, 30, 1); - TEST_FIELD(SHFILEOPSTRUCTW, HWND, hwnd, 0, 4, 1); - TEST_FIELD(SHFILEOPSTRUCTW, UINT, wFunc, 4, 4, 1); - TEST_FIELD(SHFILEOPSTRUCTW, LPCWSTR, pFrom, 8, 4, 1); - TEST_FIELD(SHFILEOPSTRUCTW, LPCWSTR, pTo, 12, 4, 1); - TEST_FIELD(SHFILEOPSTRUCTW, FILEOP_FLAGS, fFlags, 16, 2, 1); - TEST_FIELD(SHFILEOPSTRUCTW, BOOL, fAnyOperationsAborted, 18, 4, 1); - TEST_FIELD(SHFILEOPSTRUCTW, LPVOID, hNameMappings, 22, 4, 1); - TEST_FIELD(SHFILEOPSTRUCTW, LPCWSTR, lpszProgressTitle, 26, 4, 1); -} - -static void test_pack_SHNAMEMAPPINGA(void) -{ - /* SHNAMEMAPPINGA (pack 1) */ - TEST_TYPE(SHNAMEMAPPINGA, 16, 1); - TEST_FIELD(SHNAMEMAPPINGA, LPSTR, pszOldPath, 0, 4, 1); - TEST_FIELD(SHNAMEMAPPINGA, LPSTR, pszNewPath, 4, 4, 1); - TEST_FIELD(SHNAMEMAPPINGA, int, cchOldPath, 8, 4, 1); - TEST_FIELD(SHNAMEMAPPINGA, int, cchNewPath, 12, 4, 1); -} - -static void test_pack_SHNAMEMAPPINGW(void) -{ - /* SHNAMEMAPPINGW (pack 1) */ - TEST_TYPE(SHNAMEMAPPINGW, 16, 1); - TEST_FIELD(SHNAMEMAPPINGW, LPWSTR, pszOldPath, 0, 4, 1); - TEST_FIELD(SHNAMEMAPPINGW, LPWSTR, pszNewPath, 4, 4, 1); - TEST_FIELD(SHNAMEMAPPINGW, int, cchOldPath, 8, 4, 1); - TEST_FIELD(SHNAMEMAPPINGW, int, cchNewPath, 12, 4, 1); -} - -static void test_pack_ITEMIDLIST(void) -{ - /* ITEMIDLIST (pack 1) */ - TEST_TYPE(ITEMIDLIST, 3, 1); - TEST_FIELD(ITEMIDLIST, SHITEMID, mkid, 0, 3, 1); -} - -static void test_pack_LPCITEMIDLIST(void) -{ - /* LPCITEMIDLIST */ - TEST_TYPE(LPCITEMIDLIST, 4, 4); - TEST_TYPE_POINTER(LPCITEMIDLIST, 3, 1); -} - -static void test_pack_LPCSHITEMID(void) -{ - /* LPCSHITEMID */ - TEST_TYPE(LPCSHITEMID, 4, 4); - TEST_TYPE_POINTER(LPCSHITEMID, 3, 1); -} - -static void test_pack_LPITEMIDLIST(void) -{ - /* LPITEMIDLIST */ - TEST_TYPE(LPITEMIDLIST, 4, 4); -} - -static void test_pack_LPSHELLDETAILS(void) -{ - /* LPSHELLDETAILS */ - TEST_TYPE(LPSHELLDETAILS, 4, 4); -} - -static void test_pack_LPSHITEMID(void) -{ - /* LPSHITEMID */ - TEST_TYPE(LPSHITEMID, 4, 4); -} - -static void test_pack_LPSTRRET(void) -{ - /* LPSTRRET */ - TEST_TYPE(LPSTRRET, 4, 4); -} - -static void test_pack_SHELLDETAILS(void) -{ - /* SHELLDETAILS (pack 1) */ - TEST_FIELD(SHELLDETAILS, int, fmt, 0, 4, 1); - TEST_FIELD(SHELLDETAILS, int, cxChar, 4, 4, 1); -} - -static void test_pack_SHITEMID(void) -{ - /* SHITEMID (pack 1) */ - TEST_TYPE(SHITEMID, 3, 1); - TEST_FIELD(SHITEMID, WORD, cb, 0, 2, 1); - TEST_FIELD(SHITEMID, BYTE[1], abID, 2, 1, 1); -} - -static void test_pack_STRRET(void) -{ - /* STRRET (pack 4) */ - TEST_FIELD(STRRET, UINT, uType, 0, 4, 4); -} - -static void test_pack_AUTO_SCROLL_DATA(void) -{ - /* AUTO_SCROLL_DATA (pack 1) */ - TEST_TYPE(AUTO_SCROLL_DATA, 48, 1); - TEST_FIELD(AUTO_SCROLL_DATA, int, iNextSample, 0, 4, 1); - TEST_FIELD(AUTO_SCROLL_DATA, DWORD, dwLastScroll, 4, 4, 1); - TEST_FIELD(AUTO_SCROLL_DATA, BOOL, bFull, 8, 4, 1); - TEST_FIELD(AUTO_SCROLL_DATA, POINT[NUM_POINTS], pts, 12, 24, 1); - TEST_FIELD(AUTO_SCROLL_DATA, DWORD[NUM_POINTS], dwTimes, 36, 12, 1); -} - -static void test_pack_BFFCALLBACK(void) -{ - /* BFFCALLBACK */ - TEST_TYPE(BFFCALLBACK, 4, 4); -} - -static void test_pack_BROWSEINFOA(void) -{ - /* BROWSEINFOA (pack 8) */ - TEST_TYPE(BROWSEINFOA, 32, 4); - TEST_FIELD(BROWSEINFOA, HWND, hwndOwner, 0, 4, 4); - TEST_FIELD(BROWSEINFOA, LPCITEMIDLIST, pidlRoot, 4, 4, 4); - TEST_FIELD(BROWSEINFOA, LPSTR, pszDisplayName, 8, 4, 4); - TEST_FIELD(BROWSEINFOA, LPCSTR, lpszTitle, 12, 4, 4); - TEST_FIELD(BROWSEINFOA, UINT, ulFlags, 16, 4, 4); - TEST_FIELD(BROWSEINFOA, BFFCALLBACK, lpfn, 20, 4, 4); - TEST_FIELD(BROWSEINFOA, LPARAM, lParam, 24, 4, 4); - TEST_FIELD(BROWSEINFOA, INT, iImage, 28, 4, 4); -} - -static void test_pack_BROWSEINFOW(void) -{ - /* BROWSEINFOW (pack 8) */ - TEST_TYPE(BROWSEINFOW, 32, 4); - TEST_FIELD(BROWSEINFOW, HWND, hwndOwner, 0, 4, 4); - TEST_FIELD(BROWSEINFOW, LPCITEMIDLIST, pidlRoot, 4, 4, 4); - TEST_FIELD(BROWSEINFOW, LPWSTR, pszDisplayName, 8, 4, 4); - TEST_FIELD(BROWSEINFOW, LPCWSTR, lpszTitle, 12, 4, 4); - TEST_FIELD(BROWSEINFOW, UINT, ulFlags, 16, 4, 4); - TEST_FIELD(BROWSEINFOW, BFFCALLBACK, lpfn, 20, 4, 4); - TEST_FIELD(BROWSEINFOW, LPARAM, lParam, 24, 4, 4); - TEST_FIELD(BROWSEINFOW, INT, iImage, 28, 4, 4); -} - -static void test_pack_CABINETSTATE(void) -{ - /* CABINETSTATE (pack 1) */ - TEST_TYPE(CABINETSTATE, 12, 1); - TEST_FIELD(CABINETSTATE, WORD, cLength, 0, 2, 1); - TEST_FIELD(CABINETSTATE, WORD, nVersion, 2, 2, 1); - TEST_FIELD(CABINETSTATE, UINT, fMenuEnumFilter, 8, 4, 1); -} - -static void test_pack_CIDA(void) -{ - /* CIDA (pack 1) */ - TEST_TYPE(CIDA, 8, 1); - TEST_FIELD(CIDA, UINT, cidl, 0, 4, 1); - TEST_FIELD(CIDA, UINT[1], aoffset, 4, 4, 1); -} - -static void test_pack_CSFV(void) -{ - /* CSFV (pack 1) */ - TEST_FIELD(CSFV, UINT, cbSize, 0, 4, 1); - TEST_FIELD(CSFV, IShellFolder*, pshf, 4, 4, 1); - TEST_FIELD(CSFV, IShellView*, psvOuter, 8, 4, 1); - TEST_FIELD(CSFV, LPCITEMIDLIST, pidl, 12, 4, 1); - TEST_FIELD(CSFV, LONG, lEvents, 16, 4, 1); - TEST_FIELD(CSFV, LPFNVIEWCALLBACK, pfnCallback, 20, 4, 1); -} - -static void test_pack_DROPFILES(void) -{ - /* DROPFILES (pack 1) */ - TEST_TYPE(DROPFILES, 20, 1); - TEST_FIELD(DROPFILES, DWORD, pFiles, 0, 4, 1); - TEST_FIELD(DROPFILES, POINT, pt, 4, 8, 1); - TEST_FIELD(DROPFILES, BOOL, fNC, 12, 4, 1); - TEST_FIELD(DROPFILES, BOOL, fWide, 16, 4, 1); -} - -static void test_pack_FILEDESCRIPTORA(void) -{ - /* FILEDESCRIPTORA (pack 1) */ - TEST_TYPE(FILEDESCRIPTORA, 332, 1); - TEST_FIELD(FILEDESCRIPTORA, DWORD, dwFlags, 0, 4, 1); - TEST_FIELD(FILEDESCRIPTORA, CLSID, clsid, 4, 16, 1); - TEST_FIELD(FILEDESCRIPTORA, SIZEL, sizel, 20, 8, 1); - TEST_FIELD(FILEDESCRIPTORA, POINTL, pointl, 28, 8, 1); - TEST_FIELD(FILEDESCRIPTORA, DWORD, dwFileAttributes, 36, 4, 1); - TEST_FIELD(FILEDESCRIPTORA, FILETIME, ftCreationTime, 40, 8, 1); - TEST_FIELD(FILEDESCRIPTORA, FILETIME, ftLastAccessTime, 48, 8, 1); - TEST_FIELD(FILEDESCRIPTORA, FILETIME, ftLastWriteTime, 56, 8, 1); - TEST_FIELD(FILEDESCRIPTORA, DWORD, nFileSizeHigh, 64, 4, 1); - TEST_FIELD(FILEDESCRIPTORA, DWORD, nFileSizeLow, 68, 4, 1); - TEST_FIELD(FILEDESCRIPTORA, CHAR[MAX_PATH], cFileName, 72, 260, 1); -} - -static void test_pack_FILEDESCRIPTORW(void) -{ - /* FILEDESCRIPTORW (pack 1) */ - TEST_TYPE(FILEDESCRIPTORW, 592, 1); - TEST_FIELD(FILEDESCRIPTORW, DWORD, dwFlags, 0, 4, 1); - TEST_FIELD(FILEDESCRIPTORW, CLSID, clsid, 4, 16, 1); - TEST_FIELD(FILEDESCRIPTORW, SIZEL, sizel, 20, 8, 1); - TEST_FIELD(FILEDESCRIPTORW, POINTL, pointl, 28, 8, 1); - TEST_FIELD(FILEDESCRIPTORW, DWORD, dwFileAttributes, 36, 4, 1); - TEST_FIELD(FILEDESCRIPTORW, FILETIME, ftCreationTime, 40, 8, 1); - TEST_FIELD(FILEDESCRIPTORW, FILETIME, ftLastAccessTime, 48, 8, 1); - TEST_FIELD(FILEDESCRIPTORW, FILETIME, ftLastWriteTime, 56, 8, 1); - TEST_FIELD(FILEDESCRIPTORW, DWORD, nFileSizeHigh, 64, 4, 1); - TEST_FIELD(FILEDESCRIPTORW, DWORD, nFileSizeLow, 68, 4, 1); - TEST_FIELD(FILEDESCRIPTORW, WCHAR[MAX_PATH], cFileName, 72, 520, 1); -} - -static void test_pack_FILEGROUPDESCRIPTORA(void) -{ - /* FILEGROUPDESCRIPTORA (pack 1) */ - TEST_TYPE(FILEGROUPDESCRIPTORA, 336, 1); - TEST_FIELD(FILEGROUPDESCRIPTORA, UINT, cItems, 0, 4, 1); - TEST_FIELD(FILEGROUPDESCRIPTORA, FILEDESCRIPTORA[1], fgd, 4, 332, 1); -} - -static void test_pack_FILEGROUPDESCRIPTORW(void) -{ - /* FILEGROUPDESCRIPTORW (pack 1) */ - TEST_TYPE(FILEGROUPDESCRIPTORW, 596, 1); - TEST_FIELD(FILEGROUPDESCRIPTORW, UINT, cItems, 0, 4, 1); - TEST_FIELD(FILEGROUPDESCRIPTORW, FILEDESCRIPTORW[1], fgd, 4, 592, 1); -} - -static void test_pack_LPBROWSEINFOA(void) -{ - /* LPBROWSEINFOA */ - TEST_TYPE(LPBROWSEINFOA, 4, 4); - TEST_TYPE_POINTER(LPBROWSEINFOA, 32, 4); -} - -static void test_pack_LPBROWSEINFOW(void) -{ - /* LPBROWSEINFOW */ - TEST_TYPE(LPBROWSEINFOW, 4, 4); - TEST_TYPE_POINTER(LPBROWSEINFOW, 32, 4); -} - -static void test_pack_LPCABINETSTATE(void) -{ - /* LPCABINETSTATE */ - TEST_TYPE(LPCABINETSTATE, 4, 4); - TEST_TYPE_POINTER(LPCABINETSTATE, 12, 1); -} - -static void test_pack_LPCSFV(void) -{ - /* LPCSFV */ - TEST_TYPE(LPCSFV, 4, 4); -} - -static void test_pack_LPDROPFILES(void) -{ - /* LPDROPFILES */ - TEST_TYPE(LPDROPFILES, 4, 4); - TEST_TYPE_POINTER(LPDROPFILES, 20, 1); -} - -static void test_pack_LPFILEDESCRIPTORA(void) -{ - /* LPFILEDESCRIPTORA */ - TEST_TYPE(LPFILEDESCRIPTORA, 4, 4); - TEST_TYPE_POINTER(LPFILEDESCRIPTORA, 332, 1); -} - -static void test_pack_LPFILEDESCRIPTORW(void) -{ - /* LPFILEDESCRIPTORW */ - TEST_TYPE(LPFILEDESCRIPTORW, 4, 4); - TEST_TYPE_POINTER(LPFILEDESCRIPTORW, 592, 1); -} - -static void test_pack_LPFILEGROUPDESCRIPTORA(void) -{ - /* LPFILEGROUPDESCRIPTORA */ - TEST_TYPE(LPFILEGROUPDESCRIPTORA, 4, 4); - TEST_TYPE_POINTER(LPFILEGROUPDESCRIPTORA, 336, 1); -} - -static void test_pack_LPFILEGROUPDESCRIPTORW(void) -{ - /* LPFILEGROUPDESCRIPTORW */ - TEST_TYPE(LPFILEGROUPDESCRIPTORW, 4, 4); - TEST_TYPE_POINTER(LPFILEGROUPDESCRIPTORW, 596, 1); -} - -static void test_pack_LPFNVIEWCALLBACK(void) -{ - /* LPFNVIEWCALLBACK */ - TEST_TYPE(LPFNVIEWCALLBACK, 4, 4); -} - -static void test_pack_LPIDA(void) -{ - /* LPIDA */ - TEST_TYPE(LPIDA, 4, 4); - TEST_TYPE_POINTER(LPIDA, 8, 1); -} - -static void test_pack_LPQCMINFO(void) -{ - /* LPQCMINFO */ - TEST_TYPE(LPQCMINFO, 4, 4); - TEST_TYPE_POINTER(LPQCMINFO, 20, 4); -} - -static void test_pack_LPSHChangeDWORDAsIDList(void) -{ - /* LPSHChangeDWORDAsIDList */ - TEST_TYPE(LPSHChangeDWORDAsIDList, 4, 4); - TEST_TYPE_POINTER(LPSHChangeDWORDAsIDList, 12, 1); -} - -static void test_pack_LPSHChangeProductKeyAsIDList(void) -{ - /* LPSHChangeProductKeyAsIDList */ - TEST_TYPE(LPSHChangeProductKeyAsIDList, 4, 4); - TEST_TYPE_POINTER(LPSHChangeProductKeyAsIDList, 82, 1); -} - -static void test_pack_LPSHDESCRIPTIONID(void) -{ - /* LPSHDESCRIPTIONID */ - TEST_TYPE(LPSHDESCRIPTIONID, 4, 4); - TEST_TYPE_POINTER(LPSHDESCRIPTIONID, 20, 4); -} - -static void test_pack_LPSHELLFLAGSTATE(void) -{ - /* LPSHELLFLAGSTATE */ - TEST_TYPE(LPSHELLFLAGSTATE, 4, 4); - TEST_TYPE_POINTER(LPSHELLFLAGSTATE, 4, 1); -} - -static void test_pack_LPSHELLSTATE(void) -{ - /* LPSHELLSTATE */ - TEST_TYPE(LPSHELLSTATE, 4, 4); - TEST_TYPE_POINTER(LPSHELLSTATE, 32, 1); -} - -static void test_pack_LPTBINFO(void) -{ - /* LPTBINFO */ - TEST_TYPE(LPTBINFO, 4, 4); - TEST_TYPE_POINTER(LPTBINFO, 8, 4); -} - -static void test_pack_PBROWSEINFOA(void) -{ - /* PBROWSEINFOA */ - TEST_TYPE(PBROWSEINFOA, 4, 4); - TEST_TYPE_POINTER(PBROWSEINFOA, 32, 4); -} - -static void test_pack_PBROWSEINFOW(void) -{ - /* PBROWSEINFOW */ - TEST_TYPE(PBROWSEINFOW, 4, 4); - TEST_TYPE_POINTER(PBROWSEINFOW, 32, 4); -} - -static void test_pack_QCMINFO(void) -{ - /* QCMINFO (pack 8) */ - TEST_TYPE(QCMINFO, 20, 4); - TEST_FIELD(QCMINFO, HMENU, hmenu, 0, 4, 4); - TEST_FIELD(QCMINFO, UINT, indexMenu, 4, 4, 4); - TEST_FIELD(QCMINFO, UINT, idCmdFirst, 8, 4, 4); - TEST_FIELD(QCMINFO, UINT, idCmdLast, 12, 4, 4); - TEST_FIELD(QCMINFO, QCMINFO_IDMAP const*, pIdMap, 16, 4, 4); -} - -static void test_pack_QCMINFO_IDMAP(void) -{ - /* QCMINFO_IDMAP (pack 8) */ - TEST_TYPE(QCMINFO_IDMAP, 12, 4); - TEST_FIELD(QCMINFO_IDMAP, UINT, nMaxIds, 0, 4, 4); - TEST_FIELD(QCMINFO_IDMAP, QCMINFO_IDMAP_PLACEMENT[1], pIdList, 4, 8, 4); -} - -static void test_pack_QCMINFO_IDMAP_PLACEMENT(void) -{ - /* QCMINFO_IDMAP_PLACEMENT (pack 8) */ - TEST_TYPE(QCMINFO_IDMAP_PLACEMENT, 8, 4); - TEST_FIELD(QCMINFO_IDMAP_PLACEMENT, UINT, id, 0, 4, 4); - TEST_FIELD(QCMINFO_IDMAP_PLACEMENT, UINT, fFlags, 4, 4, 4); -} - -static void test_pack_SHChangeDWORDAsIDList(void) -{ - /* SHChangeDWORDAsIDList (pack 1) */ - TEST_TYPE(SHChangeDWORDAsIDList, 12, 1); - TEST_FIELD(SHChangeDWORDAsIDList, USHORT, cb, 0, 2, 1); - TEST_FIELD(SHChangeDWORDAsIDList, DWORD, dwItem1, 2, 4, 1); - TEST_FIELD(SHChangeDWORDAsIDList, DWORD, dwItem2, 6, 4, 1); - TEST_FIELD(SHChangeDWORDAsIDList, USHORT, cbZero, 10, 2, 1); -} - -static void test_pack_SHChangeNotifyEntry(void) -{ - /* SHChangeNotifyEntry (pack 1) */ - TEST_TYPE(SHChangeNotifyEntry, 8, 1); - TEST_FIELD(SHChangeNotifyEntry, LPCITEMIDLIST, pidl, 0, 4, 1); - TEST_FIELD(SHChangeNotifyEntry, BOOL, fRecursive, 4, 4, 1); -} - -static void test_pack_SHChangeProductKeyAsIDList(void) -{ - /* SHChangeProductKeyAsIDList (pack 1) */ - TEST_TYPE(SHChangeProductKeyAsIDList, 82, 1); - TEST_FIELD(SHChangeProductKeyAsIDList, USHORT, cb, 0, 2, 1); - TEST_FIELD(SHChangeProductKeyAsIDList, WCHAR[39], wszProductKey, 2, 78, 1); - TEST_FIELD(SHChangeProductKeyAsIDList, USHORT, cbZero, 80, 2, 1); -} - -static void test_pack_SHDESCRIPTIONID(void) -{ - /* SHDESCRIPTIONID (pack 8) */ - TEST_TYPE(SHDESCRIPTIONID, 20, 4); - TEST_FIELD(SHDESCRIPTIONID, DWORD, dwDescriptionId, 0, 4, 4); - TEST_FIELD(SHDESCRIPTIONID, CLSID, clsid, 4, 16, 4); -} - -static void test_pack_SHELLFLAGSTATE(void) -{ - /* SHELLFLAGSTATE (pack 1) */ - TEST_TYPE(SHELLFLAGSTATE, 4, 1); -} - -static void test_pack_SHELLSTATE(void) -{ - /* SHELLSTATE (pack 1) */ - TEST_TYPE(SHELLSTATE, 32, 1); - TEST_FIELD(SHELLSTATE, DWORD, dwWin95Unused, 4, 4, 1); - TEST_FIELD(SHELLSTATE, UINT, uWin95Unused, 8, 4, 1); - TEST_FIELD(SHELLSTATE, LONG, lParamSort, 12, 4, 1); - TEST_FIELD(SHELLSTATE, int, iSortDirection, 16, 4, 1); - TEST_FIELD(SHELLSTATE, UINT, version, 20, 4, 1); - TEST_FIELD(SHELLSTATE, UINT, uNotUsed, 24, 4, 1); -} - -static void test_pack_SHELLVIEWID(void) -{ - /* SHELLVIEWID */ - TEST_TYPE(SHELLVIEWID, 16, 4); -} - -static void test_pack_TBINFO(void) -{ - /* TBINFO (pack 8) */ - TEST_TYPE(TBINFO, 8, 4); - TEST_FIELD(TBINFO, UINT, cbuttons, 0, 4, 4); - TEST_FIELD(TBINFO, UINT, uFlags, 4, 4, 4); -} - -static void test_pack(void) -{ - test_pack_APPBARDATA(); - test_pack_AUTO_SCROLL_DATA(); - test_pack_BFFCALLBACK(); - test_pack_BLOB(); - test_pack_BROWSEINFOA(); - test_pack_BROWSEINFOW(); - test_pack_BSTR(); - test_pack_BSTRBLOB(); - test_pack_BYTE_BLOB(); - test_pack_BYTE_SIZEDARR(); - test_pack_CABINETSTATE(); - test_pack_CIDA(); - test_pack_CLIPDATA(); - test_pack_CLIPFORMAT(); - test_pack_CLSID(); - test_pack_COAUTHIDENTITY(); - test_pack_COAUTHINFO(); - test_pack_CSFV(); - test_pack_DATE(); - test_pack_DOUBLE(); - test_pack_DRAGINFOA(); - test_pack_DRAGINFOW(); - test_pack_DROPFILES(); - test_pack_DWORD_SIZEDARR(); - test_pack_FILEDESCRIPTORA(); - test_pack_FILEDESCRIPTORW(); - test_pack_FILEGROUPDESCRIPTORA(); - test_pack_FILEGROUPDESCRIPTORW(); - test_pack_FILEOP_FLAGS(); - test_pack_FLAGGED_BYTE_BLOB(); - test_pack_FLAGGED_WORD_BLOB(); - test_pack_FMTID(); - test_pack_GUID(); - test_pack_HMETAFILEPICT(); - test_pack_HYPER_SIZEDARR(); - test_pack_IID(); - test_pack_ITEMIDLIST(); - test_pack_LPBLOB(); - test_pack_LPBROWSEINFOA(); - test_pack_LPBROWSEINFOW(); - test_pack_LPBSTR(); - test_pack_LPBSTRBLOB(); - test_pack_LPCABINETSTATE(); - test_pack_LPCITEMIDLIST(); - test_pack_LPCOLESTR(); - test_pack_LPCSFV(); - test_pack_LPCSHITEMID(); - test_pack_LPCY(); - test_pack_LPDECIMAL(); - test_pack_LPDRAGINFOA(); - test_pack_LPDRAGINFOW(); - test_pack_LPDROPFILES(); - test_pack_LPFILEDESCRIPTORA(); - test_pack_LPFILEDESCRIPTORW(); - test_pack_LPFILEGROUPDESCRIPTORA(); - test_pack_LPFILEGROUPDESCRIPTORW(); - test_pack_LPFNVIEWCALLBACK(); - test_pack_LPGUID(); - test_pack_LPIDA(); - test_pack_LPITEMIDLIST(); - test_pack_LPOLESTR(); - test_pack_LPQCMINFO(); - test_pack_LPSHChangeDWORDAsIDList(); - test_pack_LPSHChangeProductKeyAsIDList(); - test_pack_LPSHDESCRIPTIONID(); - test_pack_LPSHELLDETAILS(); - test_pack_LPSHELLEXECUTEINFOA(); - test_pack_LPSHELLEXECUTEINFOW(); - test_pack_LPSHELLFLAGSTATE(); - test_pack_LPSHELLSTATE(); - test_pack_LPSHFILEOPSTRUCTA(); - test_pack_LPSHFILEOPSTRUCTW(); - test_pack_LPSHITEMID(); - test_pack_LPSHNAMEMAPPINGA(); - test_pack_LPSHNAMEMAPPINGW(); - test_pack_LPSTRRET(); - test_pack_LPTBINFO(); - test_pack_NOTIFYICONDATAA(); - test_pack_NOTIFYICONDATAW(); - test_pack_OLECHAR(); - test_pack_PAPPBARDATA(); - test_pack_PBROWSEINFOA(); - test_pack_PBROWSEINFOW(); - test_pack_PNOTIFYICONDATAA(); - test_pack_PNOTIFYICONDATAW(); - test_pack_PRINTEROP_FLAGS(); - test_pack_PROPID(); - test_pack_QCMINFO(); - test_pack_QCMINFO_IDMAP(); - test_pack_QCMINFO_IDMAP_PLACEMENT(); - test_pack_RemHBITMAP(); - test_pack_RemHENHMETAFILE(); - test_pack_RemHGLOBAL(); - test_pack_RemHMETAFILEPICT(); - test_pack_RemHPALETTE(); - test_pack_SCODE(); - test_pack_SHChangeDWORDAsIDList(); - test_pack_SHChangeNotifyEntry(); - test_pack_SHChangeProductKeyAsIDList(); - test_pack_SHDESCRIPTIONID(); - test_pack_SHELLDETAILS(); - test_pack_SHELLEXECUTEINFOA(); - test_pack_SHELLEXECUTEINFOW(); - test_pack_SHELLFLAGSTATE(); - test_pack_SHELLSTATE(); - test_pack_SHELLVIEWID(); - test_pack_SHFILEINFOA(); - test_pack_SHFILEINFOW(); - test_pack_SHFILEOPSTRUCTA(); - test_pack_SHFILEOPSTRUCTW(); - test_pack_SHITEMID(); - test_pack_SHNAMEMAPPINGA(); - test_pack_SHNAMEMAPPINGW(); - test_pack_STRRET(); - test_pack_TBINFO(); - test_pack_UP_BYTE_BLOB(); - test_pack_UP_FLAGGED_BYTE_BLOB(); - test_pack_UP_FLAGGED_WORD_BLOB(); - test_pack_VARIANT_BOOL(); - test_pack_VARTYPE(); - test_pack_WORD_SIZEDARR(); - test_pack_remoteMETAFILEPICT(); - test_pack_userBITMAP(); - test_pack_userCLIPFORMAT(); - test_pack_userHBITMAP(); - test_pack_userHENHMETAFILE(); - test_pack_userHGLOBAL(); - test_pack_userHMETAFILE(); - test_pack_userHMETAFILEPICT(); - test_pack_userHPALETTE(); - test_pack_wireBSTR(); - test_pack_wireCLIPFORMAT(); - test_pack_wireHBITMAP(); - test_pack_wireHENHMETAFILE(); - test_pack_wireHGLOBAL(); - test_pack_wireHMETAFILE(); - test_pack_wireHMETAFILEPICT(); - test_pack_wireHPALETTE(); -} - -START_TEST(generated) -{ - test_pack(); -} +/* File generated automatically from tools/winapi/tests.dat; do not edit! */ +/* This file can be copied, modified and distributed without restriction. */ + +/* + * Unit tests for data structure packing + */ + +#define WINVER 0x0501 +#define _WIN32_IE 0x0501 +#define _WIN32_WINNT 0x0501 + +#define WINE_NOWINSOCK + +#include +#include "windef.h" +#include "winbase.h" +#include "wtypes.h" +#include "shellapi.h" +#include "winuser.h" +#include "wingdi.h" +#include "shlobj.h" + +#include "wine/test.h" + +/*********************************************************************** + * Compatibility macros + */ + +#define DWORD_PTR UINT_PTR +#define LONG_PTR INT_PTR +#define ULONG_PTR UINT_PTR + +/*********************************************************************** + * Windows API extension + */ + +#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) +# define _TYPE_ALIGNMENT(type) __alignof(type) +#elif defined(__GNUC__) +# define _TYPE_ALIGNMENT(type) __alignof__(type) +#else +/* + * FIXME: May not be possible without a compiler extension + * (if type is not just a name that is, otherwise the normal + * TYPE_ALIGNMENT can be used) + */ +#endif + +#if defined(TYPE_ALIGNMENT) && defined(_MSC_VER) && _MSC_VER >= 800 && !defined(__cplusplus) +#pragma warning(disable:4116) +#endif + +#if !defined(TYPE_ALIGNMENT) && defined(_TYPE_ALIGNMENT) +# define TYPE_ALIGNMENT _TYPE_ALIGNMENT +#endif + +/*********************************************************************** + * Test helper macros + */ + +#ifdef _WIN64 + +# define TEST_TYPE_SIZE(type, size) +# define TEST_TYPE_ALIGN(type, align) +# define TEST_TARGET_ALIGN(type, align) +# define TEST_FIELD_ALIGN(type, field, align) +# define TEST_FIELD_OFFSET(type, field, offset) + +#else + +# define TEST_TYPE_SIZE(type, size) C_ASSERT(sizeof(type) == size); + +# ifdef TYPE_ALIGNMENT +# define TEST_TYPE_ALIGN(type, align) C_ASSERT(TYPE_ALIGNMENT(type) == align); +# else +# define TEST_TYPE_ALIGN(type, align) +# endif + +# ifdef _TYPE_ALIGNMENT +# define TEST_TARGET_ALIGN(type, align) C_ASSERT(_TYPE_ALIGNMENT(*(type)0) == align); +# define TEST_FIELD_ALIGN(type, field, align) C_ASSERT(_TYPE_ALIGNMENT(((type*)0)->field) == align); +# else +# define TEST_TARGET_ALIGN(type, align) +# define TEST_FIELD_ALIGN(type, field, align) +# endif + +# define TEST_FIELD_OFFSET(type, field, offset) C_ASSERT(FIELD_OFFSET(type, field) == offset); + +#endif + +#define TEST_TARGET_SIZE(type, size) TEST_TYPE_SIZE(*(type)0, size) +#define TEST_FIELD_SIZE(type, field, size) TEST_TYPE_SIZE((((type*)0)->field), size) +#define TEST_TYPE_SIGNED(type) C_ASSERT((type) -1 < 0); +#define TEST_TYPE_UNSIGNED(type) C_ASSERT((type) -1 > 0); + + +static void test_pack_BLOB(void) +{ + /* BLOB (pack 4) */ + TEST_TYPE_SIZE (BLOB, 8) + TEST_TYPE_ALIGN (BLOB, 4) + TEST_FIELD_SIZE (BLOB, cbSize, 4) + TEST_FIELD_ALIGN (BLOB, cbSize, 4) + TEST_FIELD_OFFSET(BLOB, cbSize, 0) + TEST_FIELD_SIZE (BLOB, pBlobData, 4) + TEST_FIELD_ALIGN (BLOB, pBlobData, 4) + TEST_FIELD_OFFSET(BLOB, pBlobData, 4) +} + +static void test_pack_BSTR(void) +{ + /* BSTR */ + TEST_TYPE_SIZE (BSTR, 4) + TEST_TYPE_ALIGN (BSTR, 4) + TEST_TARGET_SIZE (BSTR, 2) + TEST_TARGET_ALIGN(BSTR, 2) +} + +static void test_pack_BSTRBLOB(void) +{ + /* BSTRBLOB (pack 4) */ + TEST_TYPE_SIZE (BSTRBLOB, 8) + TEST_TYPE_ALIGN (BSTRBLOB, 4) + TEST_FIELD_SIZE (BSTRBLOB, cbSize, 4) + TEST_FIELD_ALIGN (BSTRBLOB, cbSize, 4) + TEST_FIELD_OFFSET(BSTRBLOB, cbSize, 0) + TEST_FIELD_SIZE (BSTRBLOB, pData, 4) + TEST_FIELD_ALIGN (BSTRBLOB, pData, 4) + TEST_FIELD_OFFSET(BSTRBLOB, pData, 4) +} + +static void test_pack_BYTE_BLOB(void) +{ + /* BYTE_BLOB (pack 4) */ + TEST_TYPE_SIZE (BYTE_BLOB, 8) + TEST_TYPE_ALIGN (BYTE_BLOB, 4) + TEST_FIELD_SIZE (BYTE_BLOB, clSize, 4) + TEST_FIELD_ALIGN (BYTE_BLOB, clSize, 4) + TEST_FIELD_OFFSET(BYTE_BLOB, clSize, 0) + TEST_FIELD_SIZE (BYTE_BLOB, abData, 1) + TEST_FIELD_ALIGN (BYTE_BLOB, abData, 1) + TEST_FIELD_OFFSET(BYTE_BLOB, abData, 4) +} + +static void test_pack_BYTE_SIZEDARR(void) +{ + /* BYTE_SIZEDARR (pack 4) */ + TEST_TYPE_SIZE (BYTE_SIZEDARR, 8) + TEST_TYPE_ALIGN (BYTE_SIZEDARR, 4) + TEST_FIELD_SIZE (BYTE_SIZEDARR, clSize, 4) + TEST_FIELD_ALIGN (BYTE_SIZEDARR, clSize, 4) + TEST_FIELD_OFFSET(BYTE_SIZEDARR, clSize, 0) + TEST_FIELD_SIZE (BYTE_SIZEDARR, pData, 4) + TEST_FIELD_ALIGN (BYTE_SIZEDARR, pData, 4) + TEST_FIELD_OFFSET(BYTE_SIZEDARR, pData, 4) +} + +static void test_pack_CLIPDATA(void) +{ + /* CLIPDATA (pack 4) */ + TEST_TYPE_SIZE (CLIPDATA, 12) + TEST_TYPE_ALIGN (CLIPDATA, 4) + TEST_FIELD_SIZE (CLIPDATA, cbSize, 4) + TEST_FIELD_ALIGN (CLIPDATA, cbSize, 4) + TEST_FIELD_OFFSET(CLIPDATA, cbSize, 0) + TEST_FIELD_SIZE (CLIPDATA, ulClipFmt, 4) + TEST_FIELD_ALIGN (CLIPDATA, ulClipFmt, 4) + TEST_FIELD_OFFSET(CLIPDATA, ulClipFmt, 4) + TEST_FIELD_SIZE (CLIPDATA, pClipData, 4) + TEST_FIELD_ALIGN (CLIPDATA, pClipData, 4) + TEST_FIELD_OFFSET(CLIPDATA, pClipData, 8) +} + +static void test_pack_CLIPFORMAT(void) +{ + /* CLIPFORMAT */ + TEST_TYPE_SIZE (CLIPFORMAT, 2) + TEST_TYPE_ALIGN (CLIPFORMAT, 2) + TEST_TYPE_UNSIGNED(CLIPFORMAT) +} + +static void test_pack_COAUTHIDENTITY(void) +{ + /* COAUTHIDENTITY (pack 4) */ + TEST_TYPE_SIZE (COAUTHIDENTITY, 28) + TEST_TYPE_ALIGN (COAUTHIDENTITY, 4) + TEST_FIELD_SIZE (COAUTHIDENTITY, User, 4) + TEST_FIELD_ALIGN (COAUTHIDENTITY, User, 4) + TEST_FIELD_OFFSET(COAUTHIDENTITY, User, 0) + TEST_FIELD_SIZE (COAUTHIDENTITY, UserLength, 4) + TEST_FIELD_ALIGN (COAUTHIDENTITY, UserLength, 4) + TEST_FIELD_OFFSET(COAUTHIDENTITY, UserLength, 4) + TEST_FIELD_SIZE (COAUTHIDENTITY, Domain, 4) + TEST_FIELD_ALIGN (COAUTHIDENTITY, Domain, 4) + TEST_FIELD_OFFSET(COAUTHIDENTITY, Domain, 8) + TEST_FIELD_SIZE (COAUTHIDENTITY, DomainLength, 4) + TEST_FIELD_ALIGN (COAUTHIDENTITY, DomainLength, 4) + TEST_FIELD_OFFSET(COAUTHIDENTITY, DomainLength, 12) + TEST_FIELD_SIZE (COAUTHIDENTITY, Password, 4) + TEST_FIELD_ALIGN (COAUTHIDENTITY, Password, 4) + TEST_FIELD_OFFSET(COAUTHIDENTITY, Password, 16) + TEST_FIELD_SIZE (COAUTHIDENTITY, PasswordLength, 4) + TEST_FIELD_ALIGN (COAUTHIDENTITY, PasswordLength, 4) + TEST_FIELD_OFFSET(COAUTHIDENTITY, PasswordLength, 20) + TEST_FIELD_SIZE (COAUTHIDENTITY, Flags, 4) + TEST_FIELD_ALIGN (COAUTHIDENTITY, Flags, 4) + TEST_FIELD_OFFSET(COAUTHIDENTITY, Flags, 24) +} + +static void test_pack_COAUTHINFO(void) +{ + /* COAUTHINFO (pack 4) */ + TEST_TYPE_SIZE (COAUTHINFO, 28) + TEST_TYPE_ALIGN (COAUTHINFO, 4) + TEST_FIELD_SIZE (COAUTHINFO, dwAuthnSvc, 4) + TEST_FIELD_ALIGN (COAUTHINFO, dwAuthnSvc, 4) + TEST_FIELD_OFFSET(COAUTHINFO, dwAuthnSvc, 0) + TEST_FIELD_SIZE (COAUTHINFO, dwAuthzSvc, 4) + TEST_FIELD_ALIGN (COAUTHINFO, dwAuthzSvc, 4) + TEST_FIELD_OFFSET(COAUTHINFO, dwAuthzSvc, 4) + TEST_FIELD_SIZE (COAUTHINFO, pwszServerPrincName, 4) + TEST_FIELD_ALIGN (COAUTHINFO, pwszServerPrincName, 4) + TEST_FIELD_OFFSET(COAUTHINFO, pwszServerPrincName, 8) + TEST_FIELD_SIZE (COAUTHINFO, dwAuthnLevel, 4) + TEST_FIELD_ALIGN (COAUTHINFO, dwAuthnLevel, 4) + TEST_FIELD_OFFSET(COAUTHINFO, dwAuthnLevel, 12) + TEST_FIELD_SIZE (COAUTHINFO, dwImpersonationLevel, 4) + TEST_FIELD_ALIGN (COAUTHINFO, dwImpersonationLevel, 4) + TEST_FIELD_OFFSET(COAUTHINFO, dwImpersonationLevel, 16) + TEST_FIELD_SIZE (COAUTHINFO, pAuthIdentityData, 4) + TEST_FIELD_ALIGN (COAUTHINFO, pAuthIdentityData, 4) + TEST_FIELD_OFFSET(COAUTHINFO, pAuthIdentityData, 20) + TEST_FIELD_SIZE (COAUTHINFO, dwCapabilities, 4) + TEST_FIELD_ALIGN (COAUTHINFO, dwCapabilities, 4) + TEST_FIELD_OFFSET(COAUTHINFO, dwCapabilities, 24) +} + +static void test_pack_DATE(void) +{ + /* DATE */ + TEST_TYPE_SIZE (DATE, 8) + TEST_TYPE_ALIGN (DATE, 8) +} + +static void test_pack_DOUBLE(void) +{ + /* DOUBLE */ + TEST_TYPE_SIZE (DOUBLE, 8) + TEST_TYPE_ALIGN (DOUBLE, 8) +} + +static void test_pack_DWORD_SIZEDARR(void) +{ + /* DWORD_SIZEDARR (pack 4) */ + TEST_TYPE_SIZE (DWORD_SIZEDARR, 8) + TEST_TYPE_ALIGN (DWORD_SIZEDARR, 4) + TEST_FIELD_SIZE (DWORD_SIZEDARR, clSize, 4) + TEST_FIELD_ALIGN (DWORD_SIZEDARR, clSize, 4) + TEST_FIELD_OFFSET(DWORD_SIZEDARR, clSize, 0) + TEST_FIELD_SIZE (DWORD_SIZEDARR, pData, 4) + TEST_FIELD_ALIGN (DWORD_SIZEDARR, pData, 4) + TEST_FIELD_OFFSET(DWORD_SIZEDARR, pData, 4) +} + +static void test_pack_FLAGGED_BYTE_BLOB(void) +{ + /* FLAGGED_BYTE_BLOB (pack 4) */ + TEST_TYPE_SIZE (FLAGGED_BYTE_BLOB, 12) + TEST_TYPE_ALIGN (FLAGGED_BYTE_BLOB, 4) + TEST_FIELD_SIZE (FLAGGED_BYTE_BLOB, fFlags, 4) + TEST_FIELD_ALIGN (FLAGGED_BYTE_BLOB, fFlags, 4) + TEST_FIELD_OFFSET(FLAGGED_BYTE_BLOB, fFlags, 0) + TEST_FIELD_SIZE (FLAGGED_BYTE_BLOB, clSize, 4) + TEST_FIELD_ALIGN (FLAGGED_BYTE_BLOB, clSize, 4) + TEST_FIELD_OFFSET(FLAGGED_BYTE_BLOB, clSize, 4) + TEST_FIELD_SIZE (FLAGGED_BYTE_BLOB, abData, 1) + TEST_FIELD_ALIGN (FLAGGED_BYTE_BLOB, abData, 1) + TEST_FIELD_OFFSET(FLAGGED_BYTE_BLOB, abData, 8) +} + +static void test_pack_FLAGGED_WORD_BLOB(void) +{ + /* FLAGGED_WORD_BLOB (pack 4) */ + TEST_TYPE_SIZE (FLAGGED_WORD_BLOB, 12) + TEST_TYPE_ALIGN (FLAGGED_WORD_BLOB, 4) + TEST_FIELD_SIZE (FLAGGED_WORD_BLOB, fFlags, 4) + TEST_FIELD_ALIGN (FLAGGED_WORD_BLOB, fFlags, 4) + TEST_FIELD_OFFSET(FLAGGED_WORD_BLOB, fFlags, 0) + TEST_FIELD_SIZE (FLAGGED_WORD_BLOB, clSize, 4) + TEST_FIELD_ALIGN (FLAGGED_WORD_BLOB, clSize, 4) + TEST_FIELD_OFFSET(FLAGGED_WORD_BLOB, clSize, 4) + TEST_FIELD_SIZE (FLAGGED_WORD_BLOB, asData, 2) + TEST_FIELD_ALIGN (FLAGGED_WORD_BLOB, asData, 2) + TEST_FIELD_OFFSET(FLAGGED_WORD_BLOB, asData, 8) +} + +static void test_pack_HMETAFILEPICT(void) +{ + /* HMETAFILEPICT */ + TEST_TYPE_SIZE (HMETAFILEPICT, 4) + TEST_TYPE_ALIGN (HMETAFILEPICT, 4) +} + +static void test_pack_HYPER_SIZEDARR(void) +{ + /* HYPER_SIZEDARR (pack 4) */ + TEST_TYPE_SIZE (HYPER_SIZEDARR, 8) + TEST_TYPE_ALIGN (HYPER_SIZEDARR, 4) + TEST_FIELD_SIZE (HYPER_SIZEDARR, clSize, 4) + TEST_FIELD_ALIGN (HYPER_SIZEDARR, clSize, 4) + TEST_FIELD_OFFSET(HYPER_SIZEDARR, clSize, 0) + TEST_FIELD_SIZE (HYPER_SIZEDARR, pData, 4) + TEST_FIELD_ALIGN (HYPER_SIZEDARR, pData, 4) + TEST_FIELD_OFFSET(HYPER_SIZEDARR, pData, 4) +} + +static void test_pack_LPBLOB(void) +{ + /* LPBLOB */ + TEST_TYPE_SIZE (LPBLOB, 4) + TEST_TYPE_ALIGN (LPBLOB, 4) +} + +static void test_pack_LPBSTR(void) +{ + /* LPBSTR */ + TEST_TYPE_SIZE (LPBSTR, 4) + TEST_TYPE_ALIGN (LPBSTR, 4) + TEST_TARGET_SIZE (LPBSTR, 4) + TEST_TARGET_ALIGN(LPBSTR, 4) +} + +static void test_pack_LPBSTRBLOB(void) +{ + /* LPBSTRBLOB */ + TEST_TYPE_SIZE (LPBSTRBLOB, 4) + TEST_TYPE_ALIGN (LPBSTRBLOB, 4) +} + +static void test_pack_LPCOLESTR(void) +{ + /* LPCOLESTR */ + TEST_TYPE_SIZE (LPCOLESTR, 4) + TEST_TYPE_ALIGN (LPCOLESTR, 4) + TEST_TARGET_SIZE (LPCOLESTR, 2) + TEST_TARGET_ALIGN(LPCOLESTR, 2) +} + +static void test_pack_LPCY(void) +{ + /* LPCY */ + TEST_TYPE_SIZE (LPCY, 4) + TEST_TYPE_ALIGN (LPCY, 4) +} + +static void test_pack_LPDECIMAL(void) +{ + /* LPDECIMAL */ + TEST_TYPE_SIZE (LPDECIMAL, 4) + TEST_TYPE_ALIGN (LPDECIMAL, 4) +} + +static void test_pack_LPOLESTR(void) +{ + /* LPOLESTR */ + TEST_TYPE_SIZE (LPOLESTR, 4) + TEST_TYPE_ALIGN (LPOLESTR, 4) + TEST_TARGET_SIZE (LPOLESTR, 2) + TEST_TARGET_ALIGN(LPOLESTR, 2) +} + +static void test_pack_OLECHAR(void) +{ + /* OLECHAR */ + TEST_TYPE_SIZE (OLECHAR, 2) + TEST_TYPE_ALIGN (OLECHAR, 2) +} + +static void test_pack_PROPID(void) +{ + /* PROPID */ + TEST_TYPE_SIZE (PROPID, 4) + TEST_TYPE_ALIGN (PROPID, 4) +} + +static void test_pack_RemHBITMAP(void) +{ + /* RemHBITMAP (pack 4) */ + TEST_TYPE_SIZE (RemHBITMAP, 8) + TEST_TYPE_ALIGN (RemHBITMAP, 4) + TEST_FIELD_SIZE (RemHBITMAP, cbData, 4) + TEST_FIELD_ALIGN (RemHBITMAP, cbData, 4) + TEST_FIELD_OFFSET(RemHBITMAP, cbData, 0) + TEST_FIELD_SIZE (RemHBITMAP, data, 1) + TEST_FIELD_ALIGN (RemHBITMAP, data, 1) + TEST_FIELD_OFFSET(RemHBITMAP, data, 4) +} + +static void test_pack_RemHENHMETAFILE(void) +{ + /* RemHENHMETAFILE (pack 4) */ + TEST_TYPE_SIZE (RemHENHMETAFILE, 8) + TEST_TYPE_ALIGN (RemHENHMETAFILE, 4) + TEST_FIELD_SIZE (RemHENHMETAFILE, cbData, 4) + TEST_FIELD_ALIGN (RemHENHMETAFILE, cbData, 4) + TEST_FIELD_OFFSET(RemHENHMETAFILE, cbData, 0) + TEST_FIELD_SIZE (RemHENHMETAFILE, data, 1) + TEST_FIELD_ALIGN (RemHENHMETAFILE, data, 1) + TEST_FIELD_OFFSET(RemHENHMETAFILE, data, 4) +} + +static void test_pack_RemHGLOBAL(void) +{ + /* RemHGLOBAL (pack 4) */ + TEST_TYPE_SIZE (RemHGLOBAL, 12) + TEST_TYPE_ALIGN (RemHGLOBAL, 4) + TEST_FIELD_SIZE (RemHGLOBAL, fNullHGlobal, 4) + TEST_FIELD_ALIGN (RemHGLOBAL, fNullHGlobal, 4) + TEST_FIELD_OFFSET(RemHGLOBAL, fNullHGlobal, 0) + TEST_FIELD_SIZE (RemHGLOBAL, cbData, 4) + TEST_FIELD_ALIGN (RemHGLOBAL, cbData, 4) + TEST_FIELD_OFFSET(RemHGLOBAL, cbData, 4) + TEST_FIELD_SIZE (RemHGLOBAL, data, 1) + TEST_FIELD_ALIGN (RemHGLOBAL, data, 1) + TEST_FIELD_OFFSET(RemHGLOBAL, data, 8) +} + +static void test_pack_RemHMETAFILEPICT(void) +{ + /* RemHMETAFILEPICT (pack 4) */ + TEST_TYPE_SIZE (RemHMETAFILEPICT, 20) + TEST_TYPE_ALIGN (RemHMETAFILEPICT, 4) + TEST_FIELD_SIZE (RemHMETAFILEPICT, mm, 4) + TEST_FIELD_ALIGN (RemHMETAFILEPICT, mm, 4) + TEST_FIELD_OFFSET(RemHMETAFILEPICT, mm, 0) + TEST_FIELD_SIZE (RemHMETAFILEPICT, xExt, 4) + TEST_FIELD_ALIGN (RemHMETAFILEPICT, xExt, 4) + TEST_FIELD_OFFSET(RemHMETAFILEPICT, xExt, 4) + TEST_FIELD_SIZE (RemHMETAFILEPICT, yExt, 4) + TEST_FIELD_ALIGN (RemHMETAFILEPICT, yExt, 4) + TEST_FIELD_OFFSET(RemHMETAFILEPICT, yExt, 8) + TEST_FIELD_SIZE (RemHMETAFILEPICT, cbData, 4) + TEST_FIELD_ALIGN (RemHMETAFILEPICT, cbData, 4) + TEST_FIELD_OFFSET(RemHMETAFILEPICT, cbData, 12) + TEST_FIELD_SIZE (RemHMETAFILEPICT, data, 1) + TEST_FIELD_ALIGN (RemHMETAFILEPICT, data, 1) + TEST_FIELD_OFFSET(RemHMETAFILEPICT, data, 16) +} + +static void test_pack_RemHPALETTE(void) +{ + /* RemHPALETTE (pack 4) */ + TEST_TYPE_SIZE (RemHPALETTE, 8) + TEST_TYPE_ALIGN (RemHPALETTE, 4) + TEST_FIELD_SIZE (RemHPALETTE, cbData, 4) + TEST_FIELD_ALIGN (RemHPALETTE, cbData, 4) + TEST_FIELD_OFFSET(RemHPALETTE, cbData, 0) + TEST_FIELD_SIZE (RemHPALETTE, data, 1) + TEST_FIELD_ALIGN (RemHPALETTE, data, 1) + TEST_FIELD_OFFSET(RemHPALETTE, data, 4) +} + +static void test_pack_SCODE(void) +{ + /* SCODE */ + TEST_TYPE_SIZE (SCODE, 4) + TEST_TYPE_ALIGN (SCODE, 4) +} + +static void test_pack_UP_BYTE_BLOB(void) +{ + /* UP_BYTE_BLOB */ + TEST_TYPE_SIZE (UP_BYTE_BLOB, 4) + TEST_TYPE_ALIGN (UP_BYTE_BLOB, 4) + TEST_TARGET_SIZE (UP_BYTE_BLOB, 8) + TEST_TARGET_ALIGN(UP_BYTE_BLOB, 4) +} + +static void test_pack_UP_FLAGGED_BYTE_BLOB(void) +{ + /* UP_FLAGGED_BYTE_BLOB */ + TEST_TYPE_SIZE (UP_FLAGGED_BYTE_BLOB, 4) + TEST_TYPE_ALIGN (UP_FLAGGED_BYTE_BLOB, 4) + TEST_TARGET_SIZE (UP_FLAGGED_BYTE_BLOB, 12) + TEST_TARGET_ALIGN(UP_FLAGGED_BYTE_BLOB, 4) +} + +static void test_pack_UP_FLAGGED_WORD_BLOB(void) +{ + /* UP_FLAGGED_WORD_BLOB */ + TEST_TYPE_SIZE (UP_FLAGGED_WORD_BLOB, 4) + TEST_TYPE_ALIGN (UP_FLAGGED_WORD_BLOB, 4) + TEST_TARGET_SIZE (UP_FLAGGED_WORD_BLOB, 12) + TEST_TARGET_ALIGN(UP_FLAGGED_WORD_BLOB, 4) +} + +static void test_pack_VARIANT_BOOL(void) +{ + /* VARIANT_BOOL */ + TEST_TYPE_SIZE (VARIANT_BOOL, 2) + TEST_TYPE_ALIGN (VARIANT_BOOL, 2) + TEST_TYPE_SIGNED(VARIANT_BOOL) +} + +static void test_pack_VARTYPE(void) +{ + /* VARTYPE */ + TEST_TYPE_SIZE (VARTYPE, 2) + TEST_TYPE_ALIGN (VARTYPE, 2) + TEST_TYPE_UNSIGNED(VARTYPE) +} + +static void test_pack_WORD_SIZEDARR(void) +{ + /* WORD_SIZEDARR (pack 4) */ + TEST_TYPE_SIZE (WORD_SIZEDARR, 8) + TEST_TYPE_ALIGN (WORD_SIZEDARR, 4) + TEST_FIELD_SIZE (WORD_SIZEDARR, clSize, 4) + TEST_FIELD_ALIGN (WORD_SIZEDARR, clSize, 4) + TEST_FIELD_OFFSET(WORD_SIZEDARR, clSize, 0) + TEST_FIELD_SIZE (WORD_SIZEDARR, pData, 4) + TEST_FIELD_ALIGN (WORD_SIZEDARR, pData, 4) + TEST_FIELD_OFFSET(WORD_SIZEDARR, pData, 4) +} + +static void test_pack_remoteMETAFILEPICT(void) +{ + /* remoteMETAFILEPICT (pack 4) */ + TEST_TYPE_SIZE (remoteMETAFILEPICT, 16) + TEST_TYPE_ALIGN (remoteMETAFILEPICT, 4) + TEST_FIELD_SIZE (remoteMETAFILEPICT, mm, 4) + TEST_FIELD_ALIGN (remoteMETAFILEPICT, mm, 4) + TEST_FIELD_OFFSET(remoteMETAFILEPICT, mm, 0) + TEST_FIELD_SIZE (remoteMETAFILEPICT, xExt, 4) + TEST_FIELD_ALIGN (remoteMETAFILEPICT, xExt, 4) + TEST_FIELD_OFFSET(remoteMETAFILEPICT, xExt, 4) + TEST_FIELD_SIZE (remoteMETAFILEPICT, yExt, 4) + TEST_FIELD_ALIGN (remoteMETAFILEPICT, yExt, 4) + TEST_FIELD_OFFSET(remoteMETAFILEPICT, yExt, 8) + TEST_FIELD_SIZE (remoteMETAFILEPICT, hMF, 4) + TEST_FIELD_ALIGN (remoteMETAFILEPICT, hMF, 4) + TEST_FIELD_OFFSET(remoteMETAFILEPICT, hMF, 12) +} + +static void test_pack_userBITMAP(void) +{ + /* userBITMAP (pack 4) */ + TEST_TYPE_SIZE (userBITMAP, 28) + TEST_TYPE_ALIGN (userBITMAP, 4) + TEST_FIELD_SIZE (userBITMAP, bmType, 4) + TEST_FIELD_ALIGN (userBITMAP, bmType, 4) + TEST_FIELD_OFFSET(userBITMAP, bmType, 0) + TEST_FIELD_SIZE (userBITMAP, bmWidth, 4) + TEST_FIELD_ALIGN (userBITMAP, bmWidth, 4) + TEST_FIELD_OFFSET(userBITMAP, bmWidth, 4) + TEST_FIELD_SIZE (userBITMAP, bmHeight, 4) + TEST_FIELD_ALIGN (userBITMAP, bmHeight, 4) + TEST_FIELD_OFFSET(userBITMAP, bmHeight, 8) + TEST_FIELD_SIZE (userBITMAP, bmWidthBytes, 4) + TEST_FIELD_ALIGN (userBITMAP, bmWidthBytes, 4) + TEST_FIELD_OFFSET(userBITMAP, bmWidthBytes, 12) + TEST_FIELD_SIZE (userBITMAP, bmPlanes, 2) + TEST_FIELD_ALIGN (userBITMAP, bmPlanes, 2) + TEST_FIELD_OFFSET(userBITMAP, bmPlanes, 16) + TEST_FIELD_SIZE (userBITMAP, bmBitsPixel, 2) + TEST_FIELD_ALIGN (userBITMAP, bmBitsPixel, 2) + TEST_FIELD_OFFSET(userBITMAP, bmBitsPixel, 18) + TEST_FIELD_SIZE (userBITMAP, cbSize, 4) + TEST_FIELD_ALIGN (userBITMAP, cbSize, 4) + TEST_FIELD_OFFSET(userBITMAP, cbSize, 20) + TEST_FIELD_SIZE (userBITMAP, pBuffer, 1) + TEST_FIELD_ALIGN (userBITMAP, pBuffer, 1) + TEST_FIELD_OFFSET(userBITMAP, pBuffer, 24) +} + +static void test_pack_userCLIPFORMAT(void) +{ + /* userCLIPFORMAT (pack 4) */ + TEST_FIELD_SIZE (userCLIPFORMAT, fContext, 4) + TEST_FIELD_ALIGN (userCLIPFORMAT, fContext, 4) + TEST_FIELD_OFFSET(userCLIPFORMAT, fContext, 0) +} + +static void test_pack_userHBITMAP(void) +{ + /* userHBITMAP (pack 4) */ + TEST_FIELD_SIZE (userHBITMAP, fContext, 4) + TEST_FIELD_ALIGN (userHBITMAP, fContext, 4) + TEST_FIELD_OFFSET(userHBITMAP, fContext, 0) +} + +static void test_pack_userHENHMETAFILE(void) +{ + /* userHENHMETAFILE (pack 4) */ + TEST_FIELD_SIZE (userHENHMETAFILE, fContext, 4) + TEST_FIELD_ALIGN (userHENHMETAFILE, fContext, 4) + TEST_FIELD_OFFSET(userHENHMETAFILE, fContext, 0) +} + +static void test_pack_userHGLOBAL(void) +{ + /* userHGLOBAL (pack 4) */ + TEST_FIELD_SIZE (userHGLOBAL, fContext, 4) + TEST_FIELD_ALIGN (userHGLOBAL, fContext, 4) + TEST_FIELD_OFFSET(userHGLOBAL, fContext, 0) +} + +static void test_pack_userHMETAFILE(void) +{ + /* userHMETAFILE (pack 4) */ + TEST_FIELD_SIZE (userHMETAFILE, fContext, 4) + TEST_FIELD_ALIGN (userHMETAFILE, fContext, 4) + TEST_FIELD_OFFSET(userHMETAFILE, fContext, 0) +} + +static void test_pack_userHMETAFILEPICT(void) +{ + /* userHMETAFILEPICT (pack 4) */ + TEST_FIELD_SIZE (userHMETAFILEPICT, fContext, 4) + TEST_FIELD_ALIGN (userHMETAFILEPICT, fContext, 4) + TEST_FIELD_OFFSET(userHMETAFILEPICT, fContext, 0) +} + +static void test_pack_userHPALETTE(void) +{ + /* userHPALETTE (pack 4) */ + TEST_FIELD_SIZE (userHPALETTE, fContext, 4) + TEST_FIELD_ALIGN (userHPALETTE, fContext, 4) + TEST_FIELD_OFFSET(userHPALETTE, fContext, 0) +} + +static void test_pack_wireBSTR(void) +{ + /* wireBSTR */ + TEST_TYPE_SIZE (wireBSTR, 4) + TEST_TYPE_ALIGN (wireBSTR, 4) + TEST_TARGET_SIZE (wireBSTR, 12) + TEST_TARGET_ALIGN(wireBSTR, 4) +} + +static void test_pack_wireCLIPFORMAT(void) +{ + /* wireCLIPFORMAT */ + TEST_TYPE_SIZE (wireCLIPFORMAT, 4) + TEST_TYPE_ALIGN (wireCLIPFORMAT, 4) +} + +static void test_pack_wireHBITMAP(void) +{ + /* wireHBITMAP */ + TEST_TYPE_SIZE (wireHBITMAP, 4) + TEST_TYPE_ALIGN (wireHBITMAP, 4) +} + +static void test_pack_wireHENHMETAFILE(void) +{ + /* wireHENHMETAFILE */ + TEST_TYPE_SIZE (wireHENHMETAFILE, 4) + TEST_TYPE_ALIGN (wireHENHMETAFILE, 4) +} + +static void test_pack_wireHGLOBAL(void) +{ + /* wireHGLOBAL */ + TEST_TYPE_SIZE (wireHGLOBAL, 4) + TEST_TYPE_ALIGN (wireHGLOBAL, 4) +} + +static void test_pack_wireHMETAFILE(void) +{ + /* wireHMETAFILE */ + TEST_TYPE_SIZE (wireHMETAFILE, 4) + TEST_TYPE_ALIGN (wireHMETAFILE, 4) +} + +static void test_pack_wireHMETAFILEPICT(void) +{ + /* wireHMETAFILEPICT */ + TEST_TYPE_SIZE (wireHMETAFILEPICT, 4) + TEST_TYPE_ALIGN (wireHMETAFILEPICT, 4) +} + +static void test_pack_wireHPALETTE(void) +{ + /* wireHPALETTE */ + TEST_TYPE_SIZE (wireHPALETTE, 4) + TEST_TYPE_ALIGN (wireHPALETTE, 4) +} + +static void test_pack_CLSID(void) +{ + /* CLSID */ + TEST_TYPE_SIZE (CLSID, 16) + TEST_TYPE_ALIGN (CLSID, 4) +} + +static void test_pack_FMTID(void) +{ + /* FMTID */ + TEST_TYPE_SIZE (FMTID, 16) + TEST_TYPE_ALIGN (FMTID, 4) +} + +static void test_pack_IID(void) +{ + /* IID */ + TEST_TYPE_SIZE (IID, 16) + TEST_TYPE_ALIGN (IID, 4) +} + +static void test_pack_APPBARDATA(void) +{ + /* APPBARDATA (pack 1) */ + TEST_TYPE_SIZE (APPBARDATA, 36) + TEST_TYPE_ALIGN (APPBARDATA, 1) + TEST_FIELD_SIZE (APPBARDATA, cbSize, 4) + TEST_FIELD_ALIGN (APPBARDATA, cbSize, 1) + TEST_FIELD_OFFSET(APPBARDATA, cbSize, 0) + TEST_FIELD_SIZE (APPBARDATA, hWnd, 4) + TEST_FIELD_ALIGN (APPBARDATA, hWnd, 1) + TEST_FIELD_OFFSET(APPBARDATA, hWnd, 4) + TEST_FIELD_SIZE (APPBARDATA, uCallbackMessage, 4) + TEST_FIELD_ALIGN (APPBARDATA, uCallbackMessage, 1) + TEST_FIELD_OFFSET(APPBARDATA, uCallbackMessage, 8) + TEST_FIELD_SIZE (APPBARDATA, uEdge, 4) + TEST_FIELD_ALIGN (APPBARDATA, uEdge, 1) + TEST_FIELD_OFFSET(APPBARDATA, uEdge, 12) + TEST_FIELD_SIZE (APPBARDATA, rc, 16) + TEST_FIELD_ALIGN (APPBARDATA, rc, 1) + TEST_FIELD_OFFSET(APPBARDATA, rc, 16) + TEST_FIELD_SIZE (APPBARDATA, lParam, 4) + TEST_FIELD_ALIGN (APPBARDATA, lParam, 1) + TEST_FIELD_OFFSET(APPBARDATA, lParam, 32) +} + +static void test_pack_DRAGINFOA(void) +{ + /* DRAGINFOA (pack 1) */ + TEST_TYPE_SIZE (DRAGINFOA, 24) + TEST_TYPE_ALIGN (DRAGINFOA, 1) + TEST_FIELD_SIZE (DRAGINFOA, uSize, 4) + TEST_FIELD_ALIGN (DRAGINFOA, uSize, 1) + TEST_FIELD_OFFSET(DRAGINFOA, uSize, 0) + TEST_FIELD_SIZE (DRAGINFOA, pt, 8) + TEST_FIELD_ALIGN (DRAGINFOA, pt, 1) + TEST_FIELD_OFFSET(DRAGINFOA, pt, 4) + TEST_FIELD_SIZE (DRAGINFOA, fNC, 4) + TEST_FIELD_ALIGN (DRAGINFOA, fNC, 1) + TEST_FIELD_OFFSET(DRAGINFOA, fNC, 12) + TEST_FIELD_SIZE (DRAGINFOA, lpFileList, 4) + TEST_FIELD_ALIGN (DRAGINFOA, lpFileList, 1) + TEST_FIELD_OFFSET(DRAGINFOA, lpFileList, 16) + TEST_FIELD_SIZE (DRAGINFOA, grfKeyState, 4) + TEST_FIELD_ALIGN (DRAGINFOA, grfKeyState, 1) + TEST_FIELD_OFFSET(DRAGINFOA, grfKeyState, 20) +} + +static void test_pack_DRAGINFOW(void) +{ + /* DRAGINFOW (pack 1) */ + TEST_TYPE_SIZE (DRAGINFOW, 24) + TEST_TYPE_ALIGN (DRAGINFOW, 1) + TEST_FIELD_SIZE (DRAGINFOW, uSize, 4) + TEST_FIELD_ALIGN (DRAGINFOW, uSize, 1) + TEST_FIELD_OFFSET(DRAGINFOW, uSize, 0) + TEST_FIELD_SIZE (DRAGINFOW, pt, 8) + TEST_FIELD_ALIGN (DRAGINFOW, pt, 1) + TEST_FIELD_OFFSET(DRAGINFOW, pt, 4) + TEST_FIELD_SIZE (DRAGINFOW, fNC, 4) + TEST_FIELD_ALIGN (DRAGINFOW, fNC, 1) + TEST_FIELD_OFFSET(DRAGINFOW, fNC, 12) + TEST_FIELD_SIZE (DRAGINFOW, lpFileList, 4) + TEST_FIELD_ALIGN (DRAGINFOW, lpFileList, 1) + TEST_FIELD_OFFSET(DRAGINFOW, lpFileList, 16) + TEST_FIELD_SIZE (DRAGINFOW, grfKeyState, 4) + TEST_FIELD_ALIGN (DRAGINFOW, grfKeyState, 1) + TEST_FIELD_OFFSET(DRAGINFOW, grfKeyState, 20) +} + +static void test_pack_FILEOP_FLAGS(void) +{ + /* FILEOP_FLAGS */ + TEST_TYPE_SIZE (FILEOP_FLAGS, 2) + TEST_TYPE_ALIGN (FILEOP_FLAGS, 2) + TEST_TYPE_UNSIGNED(FILEOP_FLAGS) +} + +static void test_pack_LPDRAGINFOA(void) +{ + /* LPDRAGINFOA */ + TEST_TYPE_SIZE (LPDRAGINFOA, 4) + TEST_TYPE_ALIGN (LPDRAGINFOA, 4) + TEST_TARGET_SIZE (LPDRAGINFOA, 24) + TEST_TARGET_ALIGN(LPDRAGINFOA, 1) +} + +static void test_pack_LPDRAGINFOW(void) +{ + /* LPDRAGINFOW */ + TEST_TYPE_SIZE (LPDRAGINFOW, 4) + TEST_TYPE_ALIGN (LPDRAGINFOW, 4) + TEST_TARGET_SIZE (LPDRAGINFOW, 24) + TEST_TARGET_ALIGN(LPDRAGINFOW, 1) +} + +static void test_pack_LPSHELLEXECUTEINFOA(void) +{ + /* LPSHELLEXECUTEINFOA */ + TEST_TYPE_SIZE (LPSHELLEXECUTEINFOA, 4) + TEST_TYPE_ALIGN (LPSHELLEXECUTEINFOA, 4) +} + +static void test_pack_LPSHELLEXECUTEINFOW(void) +{ + /* LPSHELLEXECUTEINFOW */ + TEST_TYPE_SIZE (LPSHELLEXECUTEINFOW, 4) + TEST_TYPE_ALIGN (LPSHELLEXECUTEINFOW, 4) +} + +static void test_pack_LPSHFILEOPSTRUCTA(void) +{ + /* LPSHFILEOPSTRUCTA */ + TEST_TYPE_SIZE (LPSHFILEOPSTRUCTA, 4) + TEST_TYPE_ALIGN (LPSHFILEOPSTRUCTA, 4) + TEST_TARGET_SIZE (LPSHFILEOPSTRUCTA, 30) + TEST_TARGET_ALIGN(LPSHFILEOPSTRUCTA, 1) +} + +static void test_pack_LPSHFILEOPSTRUCTW(void) +{ + /* LPSHFILEOPSTRUCTW */ + TEST_TYPE_SIZE (LPSHFILEOPSTRUCTW, 4) + TEST_TYPE_ALIGN (LPSHFILEOPSTRUCTW, 4) + TEST_TARGET_SIZE (LPSHFILEOPSTRUCTW, 30) + TEST_TARGET_ALIGN(LPSHFILEOPSTRUCTW, 1) +} + +static void test_pack_LPSHNAMEMAPPINGA(void) +{ + /* LPSHNAMEMAPPINGA */ + TEST_TYPE_SIZE (LPSHNAMEMAPPINGA, 4) + TEST_TYPE_ALIGN (LPSHNAMEMAPPINGA, 4) + TEST_TARGET_SIZE (LPSHNAMEMAPPINGA, 16) + TEST_TARGET_ALIGN(LPSHNAMEMAPPINGA, 1) +} + +static void test_pack_LPSHNAMEMAPPINGW(void) +{ + /* LPSHNAMEMAPPINGW */ + TEST_TYPE_SIZE (LPSHNAMEMAPPINGW, 4) + TEST_TYPE_ALIGN (LPSHNAMEMAPPINGW, 4) + TEST_TARGET_SIZE (LPSHNAMEMAPPINGW, 16) + TEST_TARGET_ALIGN(LPSHNAMEMAPPINGW, 1) +} + +static void test_pack_NOTIFYICONDATAA(void) +{ + /* NOTIFYICONDATAA (pack 1) */ + TEST_FIELD_SIZE (NOTIFYICONDATAA, cbSize, 4) + TEST_FIELD_ALIGN (NOTIFYICONDATAA, cbSize, 1) + TEST_FIELD_OFFSET(NOTIFYICONDATAA, cbSize, 0) + TEST_FIELD_SIZE (NOTIFYICONDATAA, hWnd, 4) + TEST_FIELD_ALIGN (NOTIFYICONDATAA, hWnd, 1) + TEST_FIELD_OFFSET(NOTIFYICONDATAA, hWnd, 4) + TEST_FIELD_SIZE (NOTIFYICONDATAA, uID, 4) + TEST_FIELD_ALIGN (NOTIFYICONDATAA, uID, 1) + TEST_FIELD_OFFSET(NOTIFYICONDATAA, uID, 8) + TEST_FIELD_SIZE (NOTIFYICONDATAA, uFlags, 4) + TEST_FIELD_ALIGN (NOTIFYICONDATAA, uFlags, 1) + TEST_FIELD_OFFSET(NOTIFYICONDATAA, uFlags, 12) + TEST_FIELD_SIZE (NOTIFYICONDATAA, uCallbackMessage, 4) + TEST_FIELD_ALIGN (NOTIFYICONDATAA, uCallbackMessage, 1) + TEST_FIELD_OFFSET(NOTIFYICONDATAA, uCallbackMessage, 16) + TEST_FIELD_SIZE (NOTIFYICONDATAA, hIcon, 4) + TEST_FIELD_ALIGN (NOTIFYICONDATAA, hIcon, 1) + TEST_FIELD_OFFSET(NOTIFYICONDATAA, hIcon, 20) + TEST_FIELD_SIZE (NOTIFYICONDATAA, szTip, 128) + TEST_FIELD_ALIGN (NOTIFYICONDATAA, szTip, 1) + TEST_FIELD_OFFSET(NOTIFYICONDATAA, szTip, 24) + TEST_FIELD_SIZE (NOTIFYICONDATAA, dwState, 4) + TEST_FIELD_ALIGN (NOTIFYICONDATAA, dwState, 1) + TEST_FIELD_OFFSET(NOTIFYICONDATAA, dwState, 152) + TEST_FIELD_SIZE (NOTIFYICONDATAA, dwStateMask, 4) + TEST_FIELD_ALIGN (NOTIFYICONDATAA, dwStateMask, 1) + TEST_FIELD_OFFSET(NOTIFYICONDATAA, dwStateMask, 156) + TEST_FIELD_SIZE (NOTIFYICONDATAA, szInfo, 256) + TEST_FIELD_ALIGN (NOTIFYICONDATAA, szInfo, 1) + TEST_FIELD_OFFSET(NOTIFYICONDATAA, szInfo, 160) +} + +static void test_pack_NOTIFYICONDATAW(void) +{ + /* NOTIFYICONDATAW (pack 1) */ + TEST_FIELD_SIZE (NOTIFYICONDATAW, cbSize, 4) + TEST_FIELD_ALIGN (NOTIFYICONDATAW, cbSize, 1) + TEST_FIELD_OFFSET(NOTIFYICONDATAW, cbSize, 0) + TEST_FIELD_SIZE (NOTIFYICONDATAW, hWnd, 4) + TEST_FIELD_ALIGN (NOTIFYICONDATAW, hWnd, 1) + TEST_FIELD_OFFSET(NOTIFYICONDATAW, hWnd, 4) + TEST_FIELD_SIZE (NOTIFYICONDATAW, uID, 4) + TEST_FIELD_ALIGN (NOTIFYICONDATAW, uID, 1) + TEST_FIELD_OFFSET(NOTIFYICONDATAW, uID, 8) + TEST_FIELD_SIZE (NOTIFYICONDATAW, uFlags, 4) + TEST_FIELD_ALIGN (NOTIFYICONDATAW, uFlags, 1) + TEST_FIELD_OFFSET(NOTIFYICONDATAW, uFlags, 12) + TEST_FIELD_SIZE (NOTIFYICONDATAW, uCallbackMessage, 4) + TEST_FIELD_ALIGN (NOTIFYICONDATAW, uCallbackMessage, 1) + TEST_FIELD_OFFSET(NOTIFYICONDATAW, uCallbackMessage, 16) + TEST_FIELD_SIZE (NOTIFYICONDATAW, hIcon, 4) + TEST_FIELD_ALIGN (NOTIFYICONDATAW, hIcon, 1) + TEST_FIELD_OFFSET(NOTIFYICONDATAW, hIcon, 20) + TEST_FIELD_SIZE (NOTIFYICONDATAW, szTip, 256) + TEST_FIELD_ALIGN (NOTIFYICONDATAW, szTip, 1) + TEST_FIELD_OFFSET(NOTIFYICONDATAW, szTip, 24) + TEST_FIELD_SIZE (NOTIFYICONDATAW, dwState, 4) + TEST_FIELD_ALIGN (NOTIFYICONDATAW, dwState, 1) + TEST_FIELD_OFFSET(NOTIFYICONDATAW, dwState, 280) + TEST_FIELD_SIZE (NOTIFYICONDATAW, dwStateMask, 4) + TEST_FIELD_ALIGN (NOTIFYICONDATAW, dwStateMask, 1) + TEST_FIELD_OFFSET(NOTIFYICONDATAW, dwStateMask, 284) + TEST_FIELD_SIZE (NOTIFYICONDATAW, szInfo, 512) + TEST_FIELD_ALIGN (NOTIFYICONDATAW, szInfo, 1) + TEST_FIELD_OFFSET(NOTIFYICONDATAW, szInfo, 288) +} + +static void test_pack_PAPPBARDATA(void) +{ + /* PAPPBARDATA */ + TEST_TYPE_SIZE (PAPPBARDATA, 4) + TEST_TYPE_ALIGN (PAPPBARDATA, 4) + TEST_TARGET_SIZE (PAPPBARDATA, 36) + TEST_TARGET_ALIGN(PAPPBARDATA, 1) +} + +static void test_pack_PNOTIFYICONDATAA(void) +{ + /* PNOTIFYICONDATAA */ + TEST_TYPE_SIZE (PNOTIFYICONDATAA, 4) + TEST_TYPE_ALIGN (PNOTIFYICONDATAA, 4) +} + +static void test_pack_PNOTIFYICONDATAW(void) +{ + /* PNOTIFYICONDATAW */ + TEST_TYPE_SIZE (PNOTIFYICONDATAW, 4) + TEST_TYPE_ALIGN (PNOTIFYICONDATAW, 4) +} + +static void test_pack_PRINTEROP_FLAGS(void) +{ + /* PRINTEROP_FLAGS */ + TEST_TYPE_SIZE (PRINTEROP_FLAGS, 2) + TEST_TYPE_ALIGN (PRINTEROP_FLAGS, 2) + TEST_TYPE_UNSIGNED(PRINTEROP_FLAGS) +} + +static void test_pack_SHELLEXECUTEINFOA(void) +{ + /* SHELLEXECUTEINFOA (pack 1) */ + TEST_FIELD_SIZE (SHELLEXECUTEINFOA, cbSize, 4) + TEST_FIELD_ALIGN (SHELLEXECUTEINFOA, cbSize, 1) + TEST_FIELD_OFFSET(SHELLEXECUTEINFOA, cbSize, 0) + TEST_FIELD_SIZE (SHELLEXECUTEINFOA, fMask, 4) + TEST_FIELD_ALIGN (SHELLEXECUTEINFOA, fMask, 1) + TEST_FIELD_OFFSET(SHELLEXECUTEINFOA, fMask, 4) + TEST_FIELD_SIZE (SHELLEXECUTEINFOA, hwnd, 4) + TEST_FIELD_ALIGN (SHELLEXECUTEINFOA, hwnd, 1) + TEST_FIELD_OFFSET(SHELLEXECUTEINFOA, hwnd, 8) + TEST_FIELD_SIZE (SHELLEXECUTEINFOA, lpVerb, 4) + TEST_FIELD_ALIGN (SHELLEXECUTEINFOA, lpVerb, 1) + TEST_FIELD_OFFSET(SHELLEXECUTEINFOA, lpVerb, 12) + TEST_FIELD_SIZE (SHELLEXECUTEINFOA, lpFile, 4) + TEST_FIELD_ALIGN (SHELLEXECUTEINFOA, lpFile, 1) + TEST_FIELD_OFFSET(SHELLEXECUTEINFOA, lpFile, 16) + TEST_FIELD_SIZE (SHELLEXECUTEINFOA, lpParameters, 4) + TEST_FIELD_ALIGN (SHELLEXECUTEINFOA, lpParameters, 1) + TEST_FIELD_OFFSET(SHELLEXECUTEINFOA, lpParameters, 20) + TEST_FIELD_SIZE (SHELLEXECUTEINFOA, lpDirectory, 4) + TEST_FIELD_ALIGN (SHELLEXECUTEINFOA, lpDirectory, 1) + TEST_FIELD_OFFSET(SHELLEXECUTEINFOA, lpDirectory, 24) + TEST_FIELD_SIZE (SHELLEXECUTEINFOA, nShow, 4) + TEST_FIELD_ALIGN (SHELLEXECUTEINFOA, nShow, 1) + TEST_FIELD_OFFSET(SHELLEXECUTEINFOA, nShow, 28) + TEST_FIELD_SIZE (SHELLEXECUTEINFOA, hInstApp, 4) + TEST_FIELD_ALIGN (SHELLEXECUTEINFOA, hInstApp, 1) + TEST_FIELD_OFFSET(SHELLEXECUTEINFOA, hInstApp, 32) + TEST_FIELD_SIZE (SHELLEXECUTEINFOA, lpIDList, 4) + TEST_FIELD_ALIGN (SHELLEXECUTEINFOA, lpIDList, 1) + TEST_FIELD_OFFSET(SHELLEXECUTEINFOA, lpIDList, 36) + TEST_FIELD_SIZE (SHELLEXECUTEINFOA, lpClass, 4) + TEST_FIELD_ALIGN (SHELLEXECUTEINFOA, lpClass, 1) + TEST_FIELD_OFFSET(SHELLEXECUTEINFOA, lpClass, 40) + TEST_FIELD_SIZE (SHELLEXECUTEINFOA, hkeyClass, 4) + TEST_FIELD_ALIGN (SHELLEXECUTEINFOA, hkeyClass, 1) + TEST_FIELD_OFFSET(SHELLEXECUTEINFOA, hkeyClass, 44) + TEST_FIELD_SIZE (SHELLEXECUTEINFOA, dwHotKey, 4) + TEST_FIELD_ALIGN (SHELLEXECUTEINFOA, dwHotKey, 1) + TEST_FIELD_OFFSET(SHELLEXECUTEINFOA, dwHotKey, 48) +} + +static void test_pack_SHELLEXECUTEINFOW(void) +{ + /* SHELLEXECUTEINFOW (pack 1) */ + TEST_FIELD_SIZE (SHELLEXECUTEINFOW, cbSize, 4) + TEST_FIELD_ALIGN (SHELLEXECUTEINFOW, cbSize, 1) + TEST_FIELD_OFFSET(SHELLEXECUTEINFOW, cbSize, 0) + TEST_FIELD_SIZE (SHELLEXECUTEINFOW, fMask, 4) + TEST_FIELD_ALIGN (SHELLEXECUTEINFOW, fMask, 1) + TEST_FIELD_OFFSET(SHELLEXECUTEINFOW, fMask, 4) + TEST_FIELD_SIZE (SHELLEXECUTEINFOW, hwnd, 4) + TEST_FIELD_ALIGN (SHELLEXECUTEINFOW, hwnd, 1) + TEST_FIELD_OFFSET(SHELLEXECUTEINFOW, hwnd, 8) + TEST_FIELD_SIZE (SHELLEXECUTEINFOW, lpVerb, 4) + TEST_FIELD_ALIGN (SHELLEXECUTEINFOW, lpVerb, 1) + TEST_FIELD_OFFSET(SHELLEXECUTEINFOW, lpVerb, 12) + TEST_FIELD_SIZE (SHELLEXECUTEINFOW, lpFile, 4) + TEST_FIELD_ALIGN (SHELLEXECUTEINFOW, lpFile, 1) + TEST_FIELD_OFFSET(SHELLEXECUTEINFOW, lpFile, 16) + TEST_FIELD_SIZE (SHELLEXECUTEINFOW, lpParameters, 4) + TEST_FIELD_ALIGN (SHELLEXECUTEINFOW, lpParameters, 1) + TEST_FIELD_OFFSET(SHELLEXECUTEINFOW, lpParameters, 20) + TEST_FIELD_SIZE (SHELLEXECUTEINFOW, lpDirectory, 4) + TEST_FIELD_ALIGN (SHELLEXECUTEINFOW, lpDirectory, 1) + TEST_FIELD_OFFSET(SHELLEXECUTEINFOW, lpDirectory, 24) + TEST_FIELD_SIZE (SHELLEXECUTEINFOW, nShow, 4) + TEST_FIELD_ALIGN (SHELLEXECUTEINFOW, nShow, 1) + TEST_FIELD_OFFSET(SHELLEXECUTEINFOW, nShow, 28) + TEST_FIELD_SIZE (SHELLEXECUTEINFOW, hInstApp, 4) + TEST_FIELD_ALIGN (SHELLEXECUTEINFOW, hInstApp, 1) + TEST_FIELD_OFFSET(SHELLEXECUTEINFOW, hInstApp, 32) + TEST_FIELD_SIZE (SHELLEXECUTEINFOW, lpIDList, 4) + TEST_FIELD_ALIGN (SHELLEXECUTEINFOW, lpIDList, 1) + TEST_FIELD_OFFSET(SHELLEXECUTEINFOW, lpIDList, 36) + TEST_FIELD_SIZE (SHELLEXECUTEINFOW, lpClass, 4) + TEST_FIELD_ALIGN (SHELLEXECUTEINFOW, lpClass, 1) + TEST_FIELD_OFFSET(SHELLEXECUTEINFOW, lpClass, 40) + TEST_FIELD_SIZE (SHELLEXECUTEINFOW, hkeyClass, 4) + TEST_FIELD_ALIGN (SHELLEXECUTEINFOW, hkeyClass, 1) + TEST_FIELD_OFFSET(SHELLEXECUTEINFOW, hkeyClass, 44) + TEST_FIELD_SIZE (SHELLEXECUTEINFOW, dwHotKey, 4) + TEST_FIELD_ALIGN (SHELLEXECUTEINFOW, dwHotKey, 1) + TEST_FIELD_OFFSET(SHELLEXECUTEINFOW, dwHotKey, 48) +} + +static void test_pack_SHFILEINFOA(void) +{ + /* SHFILEINFOA (pack 1) */ + TEST_TYPE_SIZE (SHFILEINFOA, 352) + TEST_TYPE_ALIGN (SHFILEINFOA, 1) + TEST_FIELD_SIZE (SHFILEINFOA, hIcon, 4) + TEST_FIELD_ALIGN (SHFILEINFOA, hIcon, 1) + TEST_FIELD_OFFSET(SHFILEINFOA, hIcon, 0) + TEST_FIELD_SIZE (SHFILEINFOA, iIcon, 4) + TEST_FIELD_ALIGN (SHFILEINFOA, iIcon, 1) + TEST_FIELD_OFFSET(SHFILEINFOA, iIcon, 4) + TEST_FIELD_SIZE (SHFILEINFOA, dwAttributes, 4) + TEST_FIELD_ALIGN (SHFILEINFOA, dwAttributes, 1) + TEST_FIELD_OFFSET(SHFILEINFOA, dwAttributes, 8) + TEST_FIELD_SIZE (SHFILEINFOA, szDisplayName, 260) + TEST_FIELD_ALIGN (SHFILEINFOA, szDisplayName, 1) + TEST_FIELD_OFFSET(SHFILEINFOA, szDisplayName, 12) + TEST_FIELD_SIZE (SHFILEINFOA, szTypeName, 80) + TEST_FIELD_ALIGN (SHFILEINFOA, szTypeName, 1) + TEST_FIELD_OFFSET(SHFILEINFOA, szTypeName, 272) +} + +static void test_pack_SHFILEINFOW(void) +{ + /* SHFILEINFOW (pack 1) */ + TEST_TYPE_SIZE (SHFILEINFOW, 692) + TEST_TYPE_ALIGN (SHFILEINFOW, 1) + TEST_FIELD_SIZE (SHFILEINFOW, hIcon, 4) + TEST_FIELD_ALIGN (SHFILEINFOW, hIcon, 1) + TEST_FIELD_OFFSET(SHFILEINFOW, hIcon, 0) + TEST_FIELD_SIZE (SHFILEINFOW, iIcon, 4) + TEST_FIELD_ALIGN (SHFILEINFOW, iIcon, 1) + TEST_FIELD_OFFSET(SHFILEINFOW, iIcon, 4) + TEST_FIELD_SIZE (SHFILEINFOW, dwAttributes, 4) + TEST_FIELD_ALIGN (SHFILEINFOW, dwAttributes, 1) + TEST_FIELD_OFFSET(SHFILEINFOW, dwAttributes, 8) + TEST_FIELD_SIZE (SHFILEINFOW, szDisplayName, 520) + TEST_FIELD_ALIGN (SHFILEINFOW, szDisplayName, 1) + TEST_FIELD_OFFSET(SHFILEINFOW, szDisplayName, 12) + TEST_FIELD_SIZE (SHFILEINFOW, szTypeName, 160) + TEST_FIELD_ALIGN (SHFILEINFOW, szTypeName, 1) + TEST_FIELD_OFFSET(SHFILEINFOW, szTypeName, 532) +} + +static void test_pack_SHFILEOPSTRUCTA(void) +{ + /* SHFILEOPSTRUCTA (pack 1) */ + TEST_TYPE_SIZE (SHFILEOPSTRUCTA, 30) + TEST_TYPE_ALIGN (SHFILEOPSTRUCTA, 1) + TEST_FIELD_SIZE (SHFILEOPSTRUCTA, hwnd, 4) + TEST_FIELD_ALIGN (SHFILEOPSTRUCTA, hwnd, 1) + TEST_FIELD_OFFSET(SHFILEOPSTRUCTA, hwnd, 0) + TEST_FIELD_SIZE (SHFILEOPSTRUCTA, wFunc, 4) + TEST_FIELD_ALIGN (SHFILEOPSTRUCTA, wFunc, 1) + TEST_FIELD_OFFSET(SHFILEOPSTRUCTA, wFunc, 4) + TEST_FIELD_SIZE (SHFILEOPSTRUCTA, pFrom, 4) + TEST_FIELD_ALIGN (SHFILEOPSTRUCTA, pFrom, 1) + TEST_FIELD_OFFSET(SHFILEOPSTRUCTA, pFrom, 8) + TEST_FIELD_SIZE (SHFILEOPSTRUCTA, pTo, 4) + TEST_FIELD_ALIGN (SHFILEOPSTRUCTA, pTo, 1) + TEST_FIELD_OFFSET(SHFILEOPSTRUCTA, pTo, 12) + TEST_FIELD_SIZE (SHFILEOPSTRUCTA, fFlags, 2) + TEST_FIELD_ALIGN (SHFILEOPSTRUCTA, fFlags, 1) + TEST_FIELD_OFFSET(SHFILEOPSTRUCTA, fFlags, 16) + TEST_FIELD_SIZE (SHFILEOPSTRUCTA, fAnyOperationsAborted, 4) + TEST_FIELD_ALIGN (SHFILEOPSTRUCTA, fAnyOperationsAborted, 1) + TEST_FIELD_OFFSET(SHFILEOPSTRUCTA, fAnyOperationsAborted, 18) + TEST_FIELD_SIZE (SHFILEOPSTRUCTA, hNameMappings, 4) + TEST_FIELD_ALIGN (SHFILEOPSTRUCTA, hNameMappings, 1) + TEST_FIELD_OFFSET(SHFILEOPSTRUCTA, hNameMappings, 22) + TEST_FIELD_SIZE (SHFILEOPSTRUCTA, lpszProgressTitle, 4) + TEST_FIELD_ALIGN (SHFILEOPSTRUCTA, lpszProgressTitle, 1) + TEST_FIELD_OFFSET(SHFILEOPSTRUCTA, lpszProgressTitle, 26) +} + +static void test_pack_SHFILEOPSTRUCTW(void) +{ + /* SHFILEOPSTRUCTW (pack 1) */ + TEST_TYPE_SIZE (SHFILEOPSTRUCTW, 30) + TEST_TYPE_ALIGN (SHFILEOPSTRUCTW, 1) + TEST_FIELD_SIZE (SHFILEOPSTRUCTW, hwnd, 4) + TEST_FIELD_ALIGN (SHFILEOPSTRUCTW, hwnd, 1) + TEST_FIELD_OFFSET(SHFILEOPSTRUCTW, hwnd, 0) + TEST_FIELD_SIZE (SHFILEOPSTRUCTW, wFunc, 4) + TEST_FIELD_ALIGN (SHFILEOPSTRUCTW, wFunc, 1) + TEST_FIELD_OFFSET(SHFILEOPSTRUCTW, wFunc, 4) + TEST_FIELD_SIZE (SHFILEOPSTRUCTW, pFrom, 4) + TEST_FIELD_ALIGN (SHFILEOPSTRUCTW, pFrom, 1) + TEST_FIELD_OFFSET(SHFILEOPSTRUCTW, pFrom, 8) + TEST_FIELD_SIZE (SHFILEOPSTRUCTW, pTo, 4) + TEST_FIELD_ALIGN (SHFILEOPSTRUCTW, pTo, 1) + TEST_FIELD_OFFSET(SHFILEOPSTRUCTW, pTo, 12) + TEST_FIELD_SIZE (SHFILEOPSTRUCTW, fFlags, 2) + TEST_FIELD_ALIGN (SHFILEOPSTRUCTW, fFlags, 1) + TEST_FIELD_OFFSET(SHFILEOPSTRUCTW, fFlags, 16) + TEST_FIELD_SIZE (SHFILEOPSTRUCTW, fAnyOperationsAborted, 4) + TEST_FIELD_ALIGN (SHFILEOPSTRUCTW, fAnyOperationsAborted, 1) + TEST_FIELD_OFFSET(SHFILEOPSTRUCTW, fAnyOperationsAborted, 18) + TEST_FIELD_SIZE (SHFILEOPSTRUCTW, hNameMappings, 4) + TEST_FIELD_ALIGN (SHFILEOPSTRUCTW, hNameMappings, 1) + TEST_FIELD_OFFSET(SHFILEOPSTRUCTW, hNameMappings, 22) + TEST_FIELD_SIZE (SHFILEOPSTRUCTW, lpszProgressTitle, 4) + TEST_FIELD_ALIGN (SHFILEOPSTRUCTW, lpszProgressTitle, 1) + TEST_FIELD_OFFSET(SHFILEOPSTRUCTW, lpszProgressTitle, 26) +} + +static void test_pack_SHNAMEMAPPINGA(void) +{ + /* SHNAMEMAPPINGA (pack 1) */ + TEST_TYPE_SIZE (SHNAMEMAPPINGA, 16) + TEST_TYPE_ALIGN (SHNAMEMAPPINGA, 1) + TEST_FIELD_SIZE (SHNAMEMAPPINGA, pszOldPath, 4) + TEST_FIELD_ALIGN (SHNAMEMAPPINGA, pszOldPath, 1) + TEST_FIELD_OFFSET(SHNAMEMAPPINGA, pszOldPath, 0) + TEST_FIELD_SIZE (SHNAMEMAPPINGA, pszNewPath, 4) + TEST_FIELD_ALIGN (SHNAMEMAPPINGA, pszNewPath, 1) + TEST_FIELD_OFFSET(SHNAMEMAPPINGA, pszNewPath, 4) + TEST_FIELD_SIZE (SHNAMEMAPPINGA, cchOldPath, 4) + TEST_FIELD_ALIGN (SHNAMEMAPPINGA, cchOldPath, 1) + TEST_FIELD_OFFSET(SHNAMEMAPPINGA, cchOldPath, 8) + TEST_FIELD_SIZE (SHNAMEMAPPINGA, cchNewPath, 4) + TEST_FIELD_ALIGN (SHNAMEMAPPINGA, cchNewPath, 1) + TEST_FIELD_OFFSET(SHNAMEMAPPINGA, cchNewPath, 12) +} + +static void test_pack_SHNAMEMAPPINGW(void) +{ + /* SHNAMEMAPPINGW (pack 1) */ + TEST_TYPE_SIZE (SHNAMEMAPPINGW, 16) + TEST_TYPE_ALIGN (SHNAMEMAPPINGW, 1) + TEST_FIELD_SIZE (SHNAMEMAPPINGW, pszOldPath, 4) + TEST_FIELD_ALIGN (SHNAMEMAPPINGW, pszOldPath, 1) + TEST_FIELD_OFFSET(SHNAMEMAPPINGW, pszOldPath, 0) + TEST_FIELD_SIZE (SHNAMEMAPPINGW, pszNewPath, 4) + TEST_FIELD_ALIGN (SHNAMEMAPPINGW, pszNewPath, 1) + TEST_FIELD_OFFSET(SHNAMEMAPPINGW, pszNewPath, 4) + TEST_FIELD_SIZE (SHNAMEMAPPINGW, cchOldPath, 4) + TEST_FIELD_ALIGN (SHNAMEMAPPINGW, cchOldPath, 1) + TEST_FIELD_OFFSET(SHNAMEMAPPINGW, cchOldPath, 8) + TEST_FIELD_SIZE (SHNAMEMAPPINGW, cchNewPath, 4) + TEST_FIELD_ALIGN (SHNAMEMAPPINGW, cchNewPath, 1) + TEST_FIELD_OFFSET(SHNAMEMAPPINGW, cchNewPath, 12) +} + +static void test_pack_ITEMIDLIST(void) +{ + /* ITEMIDLIST (pack 1) */ + TEST_TYPE_SIZE (ITEMIDLIST, 3) + TEST_TYPE_ALIGN (ITEMIDLIST, 1) + TEST_FIELD_SIZE (ITEMIDLIST, mkid, 3) + TEST_FIELD_ALIGN (ITEMIDLIST, mkid, 1) + TEST_FIELD_OFFSET(ITEMIDLIST, mkid, 0) +} + +static void test_pack_LPCITEMIDLIST(void) +{ + /* LPCITEMIDLIST */ + TEST_TYPE_SIZE (LPCITEMIDLIST, 4) + TEST_TYPE_ALIGN (LPCITEMIDLIST, 4) + TEST_TARGET_SIZE (LPCITEMIDLIST, 3) + TEST_TARGET_ALIGN(LPCITEMIDLIST, 1) +} + +static void test_pack_LPCSHITEMID(void) +{ + /* LPCSHITEMID */ + TEST_TYPE_SIZE (LPCSHITEMID, 4) + TEST_TYPE_ALIGN (LPCSHITEMID, 4) + TEST_TARGET_SIZE (LPCSHITEMID, 3) + TEST_TARGET_ALIGN(LPCSHITEMID, 1) +} + +static void test_pack_LPITEMIDLIST(void) +{ + /* LPITEMIDLIST */ + TEST_TYPE_SIZE (LPITEMIDLIST, 4) + TEST_TYPE_ALIGN (LPITEMIDLIST, 4) +} + +static void test_pack_LPSHELLDETAILS(void) +{ + /* LPSHELLDETAILS */ + TEST_TYPE_SIZE (LPSHELLDETAILS, 4) + TEST_TYPE_ALIGN (LPSHELLDETAILS, 4) +} + +static void test_pack_LPSHITEMID(void) +{ + /* LPSHITEMID */ + TEST_TYPE_SIZE (LPSHITEMID, 4) + TEST_TYPE_ALIGN (LPSHITEMID, 4) +} + +static void test_pack_LPSTRRET(void) +{ + /* LPSTRRET */ + TEST_TYPE_SIZE (LPSTRRET, 4) + TEST_TYPE_ALIGN (LPSTRRET, 4) +} + +static void test_pack_SHELLDETAILS(void) +{ + /* SHELLDETAILS (pack 1) */ + TEST_FIELD_SIZE (SHELLDETAILS, fmt, 4) + TEST_FIELD_ALIGN (SHELLDETAILS, fmt, 1) + TEST_FIELD_OFFSET(SHELLDETAILS, fmt, 0) + TEST_FIELD_SIZE (SHELLDETAILS, cxChar, 4) + TEST_FIELD_ALIGN (SHELLDETAILS, cxChar, 1) + TEST_FIELD_OFFSET(SHELLDETAILS, cxChar, 4) +} + +static void test_pack_SHITEMID(void) +{ + /* SHITEMID (pack 1) */ + TEST_TYPE_SIZE (SHITEMID, 3) + TEST_TYPE_ALIGN (SHITEMID, 1) + TEST_FIELD_SIZE (SHITEMID, cb, 2) + TEST_FIELD_ALIGN (SHITEMID, cb, 1) + TEST_FIELD_OFFSET(SHITEMID, cb, 0) + TEST_FIELD_SIZE (SHITEMID, abID, 1) + TEST_FIELD_ALIGN (SHITEMID, abID, 1) + TEST_FIELD_OFFSET(SHITEMID, abID, 2) +} + +static void test_pack_STRRET(void) +{ + /* STRRET (pack 4) */ + TEST_FIELD_SIZE (STRRET, uType, 4) + TEST_FIELD_ALIGN (STRRET, uType, 4) + TEST_FIELD_OFFSET(STRRET, uType, 0) +} + +static void test_pack_AUTO_SCROLL_DATA(void) +{ + /* AUTO_SCROLL_DATA (pack 1) */ + TEST_TYPE_SIZE (AUTO_SCROLL_DATA, 48) + TEST_TYPE_ALIGN (AUTO_SCROLL_DATA, 1) + TEST_FIELD_SIZE (AUTO_SCROLL_DATA, iNextSample, 4) + TEST_FIELD_ALIGN (AUTO_SCROLL_DATA, iNextSample, 1) + TEST_FIELD_OFFSET(AUTO_SCROLL_DATA, iNextSample, 0) + TEST_FIELD_SIZE (AUTO_SCROLL_DATA, dwLastScroll, 4) + TEST_FIELD_ALIGN (AUTO_SCROLL_DATA, dwLastScroll, 1) + TEST_FIELD_OFFSET(AUTO_SCROLL_DATA, dwLastScroll, 4) + TEST_FIELD_SIZE (AUTO_SCROLL_DATA, bFull, 4) + TEST_FIELD_ALIGN (AUTO_SCROLL_DATA, bFull, 1) + TEST_FIELD_OFFSET(AUTO_SCROLL_DATA, bFull, 8) + TEST_FIELD_SIZE (AUTO_SCROLL_DATA, pts, 24) + TEST_FIELD_ALIGN (AUTO_SCROLL_DATA, pts, 1) + TEST_FIELD_OFFSET(AUTO_SCROLL_DATA, pts, 12) + TEST_FIELD_SIZE (AUTO_SCROLL_DATA, dwTimes, 12) + TEST_FIELD_ALIGN (AUTO_SCROLL_DATA, dwTimes, 1) + TEST_FIELD_OFFSET(AUTO_SCROLL_DATA, dwTimes, 36) +} + +static void test_pack_BFFCALLBACK(void) +{ + /* BFFCALLBACK */ + TEST_TYPE_SIZE (BFFCALLBACK, 4) + TEST_TYPE_ALIGN (BFFCALLBACK, 4) +} + +static void test_pack_BROWSEINFOA(void) +{ + /* BROWSEINFOA (pack 8) */ + TEST_TYPE_SIZE (BROWSEINFOA, 32) + TEST_TYPE_ALIGN (BROWSEINFOA, 4) + TEST_FIELD_SIZE (BROWSEINFOA, hwndOwner, 4) + TEST_FIELD_ALIGN (BROWSEINFOA, hwndOwner, 4) + TEST_FIELD_OFFSET(BROWSEINFOA, hwndOwner, 0) + TEST_FIELD_SIZE (BROWSEINFOA, pidlRoot, 4) + TEST_FIELD_ALIGN (BROWSEINFOA, pidlRoot, 4) + TEST_FIELD_OFFSET(BROWSEINFOA, pidlRoot, 4) + TEST_FIELD_SIZE (BROWSEINFOA, pszDisplayName, 4) + TEST_FIELD_ALIGN (BROWSEINFOA, pszDisplayName, 4) + TEST_FIELD_OFFSET(BROWSEINFOA, pszDisplayName, 8) + TEST_FIELD_SIZE (BROWSEINFOA, lpszTitle, 4) + TEST_FIELD_ALIGN (BROWSEINFOA, lpszTitle, 4) + TEST_FIELD_OFFSET(BROWSEINFOA, lpszTitle, 12) + TEST_FIELD_SIZE (BROWSEINFOA, ulFlags, 4) + TEST_FIELD_ALIGN (BROWSEINFOA, ulFlags, 4) + TEST_FIELD_OFFSET(BROWSEINFOA, ulFlags, 16) + TEST_FIELD_SIZE (BROWSEINFOA, lpfn, 4) + TEST_FIELD_ALIGN (BROWSEINFOA, lpfn, 4) + TEST_FIELD_OFFSET(BROWSEINFOA, lpfn, 20) + TEST_FIELD_SIZE (BROWSEINFOA, lParam, 4) + TEST_FIELD_ALIGN (BROWSEINFOA, lParam, 4) + TEST_FIELD_OFFSET(BROWSEINFOA, lParam, 24) + TEST_FIELD_SIZE (BROWSEINFOA, iImage, 4) + TEST_FIELD_ALIGN (BROWSEINFOA, iImage, 4) + TEST_FIELD_OFFSET(BROWSEINFOA, iImage, 28) +} + +static void test_pack_BROWSEINFOW(void) +{ + /* BROWSEINFOW (pack 8) */ + TEST_TYPE_SIZE (BROWSEINFOW, 32) + TEST_TYPE_ALIGN (BROWSEINFOW, 4) + TEST_FIELD_SIZE (BROWSEINFOW, hwndOwner, 4) + TEST_FIELD_ALIGN (BROWSEINFOW, hwndOwner, 4) + TEST_FIELD_OFFSET(BROWSEINFOW, hwndOwner, 0) + TEST_FIELD_SIZE (BROWSEINFOW, pidlRoot, 4) + TEST_FIELD_ALIGN (BROWSEINFOW, pidlRoot, 4) + TEST_FIELD_OFFSET(BROWSEINFOW, pidlRoot, 4) + TEST_FIELD_SIZE (BROWSEINFOW, pszDisplayName, 4) + TEST_FIELD_ALIGN (BROWSEINFOW, pszDisplayName, 4) + TEST_FIELD_OFFSET(BROWSEINFOW, pszDisplayName, 8) + TEST_FIELD_SIZE (BROWSEINFOW, lpszTitle, 4) + TEST_FIELD_ALIGN (BROWSEINFOW, lpszTitle, 4) + TEST_FIELD_OFFSET(BROWSEINFOW, lpszTitle, 12) + TEST_FIELD_SIZE (BROWSEINFOW, ulFlags, 4) + TEST_FIELD_ALIGN (BROWSEINFOW, ulFlags, 4) + TEST_FIELD_OFFSET(BROWSEINFOW, ulFlags, 16) + TEST_FIELD_SIZE (BROWSEINFOW, lpfn, 4) + TEST_FIELD_ALIGN (BROWSEINFOW, lpfn, 4) + TEST_FIELD_OFFSET(BROWSEINFOW, lpfn, 20) + TEST_FIELD_SIZE (BROWSEINFOW, lParam, 4) + TEST_FIELD_ALIGN (BROWSEINFOW, lParam, 4) + TEST_FIELD_OFFSET(BROWSEINFOW, lParam, 24) + TEST_FIELD_SIZE (BROWSEINFOW, iImage, 4) + TEST_FIELD_ALIGN (BROWSEINFOW, iImage, 4) + TEST_FIELD_OFFSET(BROWSEINFOW, iImage, 28) +} + +static void test_pack_CABINETSTATE(void) +{ + /* CABINETSTATE (pack 1) */ + TEST_TYPE_SIZE (CABINETSTATE, 12) + TEST_TYPE_ALIGN (CABINETSTATE, 1) + TEST_FIELD_SIZE (CABINETSTATE, cLength, 2) + TEST_FIELD_ALIGN (CABINETSTATE, cLength, 1) + TEST_FIELD_OFFSET(CABINETSTATE, cLength, 0) + TEST_FIELD_SIZE (CABINETSTATE, nVersion, 2) + TEST_FIELD_ALIGN (CABINETSTATE, nVersion, 1) + TEST_FIELD_OFFSET(CABINETSTATE, nVersion, 2) + TEST_FIELD_SIZE (CABINETSTATE, fMenuEnumFilter, 4) + TEST_FIELD_ALIGN (CABINETSTATE, fMenuEnumFilter, 1) + TEST_FIELD_OFFSET(CABINETSTATE, fMenuEnumFilter, 8) +} + +static void test_pack_CIDA(void) +{ + /* CIDA (pack 1) */ + TEST_TYPE_SIZE (CIDA, 8) + TEST_TYPE_ALIGN (CIDA, 1) + TEST_FIELD_SIZE (CIDA, cidl, 4) + TEST_FIELD_ALIGN (CIDA, cidl, 1) + TEST_FIELD_OFFSET(CIDA, cidl, 0) + TEST_FIELD_SIZE (CIDA, aoffset, 4) + TEST_FIELD_ALIGN (CIDA, aoffset, 1) + TEST_FIELD_OFFSET(CIDA, aoffset, 4) +} + +static void test_pack_CSFV(void) +{ + /* CSFV (pack 1) */ + TEST_FIELD_SIZE (CSFV, cbSize, 4) + TEST_FIELD_ALIGN (CSFV, cbSize, 1) + TEST_FIELD_OFFSET(CSFV, cbSize, 0) + TEST_FIELD_SIZE (CSFV, pshf, 4) + TEST_FIELD_ALIGN (CSFV, pshf, 1) + TEST_FIELD_OFFSET(CSFV, pshf, 4) + TEST_FIELD_SIZE (CSFV, psvOuter, 4) + TEST_FIELD_ALIGN (CSFV, psvOuter, 1) + TEST_FIELD_OFFSET(CSFV, psvOuter, 8) + TEST_FIELD_SIZE (CSFV, pidl, 4) + TEST_FIELD_ALIGN (CSFV, pidl, 1) + TEST_FIELD_OFFSET(CSFV, pidl, 12) + TEST_FIELD_SIZE (CSFV, lEvents, 4) + TEST_FIELD_ALIGN (CSFV, lEvents, 1) + TEST_FIELD_OFFSET(CSFV, lEvents, 16) + TEST_FIELD_SIZE (CSFV, pfnCallback, 4) + TEST_FIELD_ALIGN (CSFV, pfnCallback, 1) + TEST_FIELD_OFFSET(CSFV, pfnCallback, 20) +} + +static void test_pack_DROPFILES(void) +{ + /* DROPFILES (pack 1) */ + TEST_TYPE_SIZE (DROPFILES, 20) + TEST_TYPE_ALIGN (DROPFILES, 1) + TEST_FIELD_SIZE (DROPFILES, pFiles, 4) + TEST_FIELD_ALIGN (DROPFILES, pFiles, 1) + TEST_FIELD_OFFSET(DROPFILES, pFiles, 0) + TEST_FIELD_SIZE (DROPFILES, pt, 8) + TEST_FIELD_ALIGN (DROPFILES, pt, 1) + TEST_FIELD_OFFSET(DROPFILES, pt, 4) + TEST_FIELD_SIZE (DROPFILES, fNC, 4) + TEST_FIELD_ALIGN (DROPFILES, fNC, 1) + TEST_FIELD_OFFSET(DROPFILES, fNC, 12) + TEST_FIELD_SIZE (DROPFILES, fWide, 4) + TEST_FIELD_ALIGN (DROPFILES, fWide, 1) + TEST_FIELD_OFFSET(DROPFILES, fWide, 16) +} + +static void test_pack_FILEDESCRIPTORA(void) +{ + /* FILEDESCRIPTORA (pack 1) */ + TEST_TYPE_SIZE (FILEDESCRIPTORA, 332) + TEST_TYPE_ALIGN (FILEDESCRIPTORA, 1) + TEST_FIELD_SIZE (FILEDESCRIPTORA, dwFlags, 4) + TEST_FIELD_ALIGN (FILEDESCRIPTORA, dwFlags, 1) + TEST_FIELD_OFFSET(FILEDESCRIPTORA, dwFlags, 0) + TEST_FIELD_SIZE (FILEDESCRIPTORA, clsid, 16) + TEST_FIELD_ALIGN (FILEDESCRIPTORA, clsid, 1) + TEST_FIELD_OFFSET(FILEDESCRIPTORA, clsid, 4) + TEST_FIELD_SIZE (FILEDESCRIPTORA, sizel, 8) + TEST_FIELD_ALIGN (FILEDESCRIPTORA, sizel, 1) + TEST_FIELD_OFFSET(FILEDESCRIPTORA, sizel, 20) + TEST_FIELD_SIZE (FILEDESCRIPTORA, pointl, 8) + TEST_FIELD_ALIGN (FILEDESCRIPTORA, pointl, 1) + TEST_FIELD_OFFSET(FILEDESCRIPTORA, pointl, 28) + TEST_FIELD_SIZE (FILEDESCRIPTORA, dwFileAttributes, 4) + TEST_FIELD_ALIGN (FILEDESCRIPTORA, dwFileAttributes, 1) + TEST_FIELD_OFFSET(FILEDESCRIPTORA, dwFileAttributes, 36) + TEST_FIELD_SIZE (FILEDESCRIPTORA, ftCreationTime, 8) + TEST_FIELD_ALIGN (FILEDESCRIPTORA, ftCreationTime, 1) + TEST_FIELD_OFFSET(FILEDESCRIPTORA, ftCreationTime, 40) + TEST_FIELD_SIZE (FILEDESCRIPTORA, ftLastAccessTime, 8) + TEST_FIELD_ALIGN (FILEDESCRIPTORA, ftLastAccessTime, 1) + TEST_FIELD_OFFSET(FILEDESCRIPTORA, ftLastAccessTime, 48) + TEST_FIELD_SIZE (FILEDESCRIPTORA, ftLastWriteTime, 8) + TEST_FIELD_ALIGN (FILEDESCRIPTORA, ftLastWriteTime, 1) + TEST_FIELD_OFFSET(FILEDESCRIPTORA, ftLastWriteTime, 56) + TEST_FIELD_SIZE (FILEDESCRIPTORA, nFileSizeHigh, 4) + TEST_FIELD_ALIGN (FILEDESCRIPTORA, nFileSizeHigh, 1) + TEST_FIELD_OFFSET(FILEDESCRIPTORA, nFileSizeHigh, 64) + TEST_FIELD_SIZE (FILEDESCRIPTORA, nFileSizeLow, 4) + TEST_FIELD_ALIGN (FILEDESCRIPTORA, nFileSizeLow, 1) + TEST_FIELD_OFFSET(FILEDESCRIPTORA, nFileSizeLow, 68) + TEST_FIELD_SIZE (FILEDESCRIPTORA, cFileName, 260) + TEST_FIELD_ALIGN (FILEDESCRIPTORA, cFileName, 1) + TEST_FIELD_OFFSET(FILEDESCRIPTORA, cFileName, 72) +} + +static void test_pack_FILEDESCRIPTORW(void) +{ + /* FILEDESCRIPTORW (pack 1) */ + TEST_TYPE_SIZE (FILEDESCRIPTORW, 592) + TEST_TYPE_ALIGN (FILEDESCRIPTORW, 1) + TEST_FIELD_SIZE (FILEDESCRIPTORW, dwFlags, 4) + TEST_FIELD_ALIGN (FILEDESCRIPTORW, dwFlags, 1) + TEST_FIELD_OFFSET(FILEDESCRIPTORW, dwFlags, 0) + TEST_FIELD_SIZE (FILEDESCRIPTORW, clsid, 16) + TEST_FIELD_ALIGN (FILEDESCRIPTORW, clsid, 1) + TEST_FIELD_OFFSET(FILEDESCRIPTORW, clsid, 4) + TEST_FIELD_SIZE (FILEDESCRIPTORW, sizel, 8) + TEST_FIELD_ALIGN (FILEDESCRIPTORW, sizel, 1) + TEST_FIELD_OFFSET(FILEDESCRIPTORW, sizel, 20) + TEST_FIELD_SIZE (FILEDESCRIPTORW, pointl, 8) + TEST_FIELD_ALIGN (FILEDESCRIPTORW, pointl, 1) + TEST_FIELD_OFFSET(FILEDESCRIPTORW, pointl, 28) + TEST_FIELD_SIZE (FILEDESCRIPTORW, dwFileAttributes, 4) + TEST_FIELD_ALIGN (FILEDESCRIPTORW, dwFileAttributes, 1) + TEST_FIELD_OFFSET(FILEDESCRIPTORW, dwFileAttributes, 36) + TEST_FIELD_SIZE (FILEDESCRIPTORW, ftCreationTime, 8) + TEST_FIELD_ALIGN (FILEDESCRIPTORW, ftCreationTime, 1) + TEST_FIELD_OFFSET(FILEDESCRIPTORW, ftCreationTime, 40) + TEST_FIELD_SIZE (FILEDESCRIPTORW, ftLastAccessTime, 8) + TEST_FIELD_ALIGN (FILEDESCRIPTORW, ftLastAccessTime, 1) + TEST_FIELD_OFFSET(FILEDESCRIPTORW, ftLastAccessTime, 48) + TEST_FIELD_SIZE (FILEDESCRIPTORW, ftLastWriteTime, 8) + TEST_FIELD_ALIGN (FILEDESCRIPTORW, ftLastWriteTime, 1) + TEST_FIELD_OFFSET(FILEDESCRIPTORW, ftLastWriteTime, 56) + TEST_FIELD_SIZE (FILEDESCRIPTORW, nFileSizeHigh, 4) + TEST_FIELD_ALIGN (FILEDESCRIPTORW, nFileSizeHigh, 1) + TEST_FIELD_OFFSET(FILEDESCRIPTORW, nFileSizeHigh, 64) + TEST_FIELD_SIZE (FILEDESCRIPTORW, nFileSizeLow, 4) + TEST_FIELD_ALIGN (FILEDESCRIPTORW, nFileSizeLow, 1) + TEST_FIELD_OFFSET(FILEDESCRIPTORW, nFileSizeLow, 68) + TEST_FIELD_SIZE (FILEDESCRIPTORW, cFileName, 520) + TEST_FIELD_ALIGN (FILEDESCRIPTORW, cFileName, 1) + TEST_FIELD_OFFSET(FILEDESCRIPTORW, cFileName, 72) +} + +static void test_pack_FILEGROUPDESCRIPTORA(void) +{ + /* FILEGROUPDESCRIPTORA (pack 1) */ + TEST_TYPE_SIZE (FILEGROUPDESCRIPTORA, 336) + TEST_TYPE_ALIGN (FILEGROUPDESCRIPTORA, 1) + TEST_FIELD_SIZE (FILEGROUPDESCRIPTORA, cItems, 4) + TEST_FIELD_ALIGN (FILEGROUPDESCRIPTORA, cItems, 1) + TEST_FIELD_OFFSET(FILEGROUPDESCRIPTORA, cItems, 0) + TEST_FIELD_SIZE (FILEGROUPDESCRIPTORA, fgd, 332) + TEST_FIELD_ALIGN (FILEGROUPDESCRIPTORA, fgd, 1) + TEST_FIELD_OFFSET(FILEGROUPDESCRIPTORA, fgd, 4) +} + +static void test_pack_FILEGROUPDESCRIPTORW(void) +{ + /* FILEGROUPDESCRIPTORW (pack 1) */ + TEST_TYPE_SIZE (FILEGROUPDESCRIPTORW, 596) + TEST_TYPE_ALIGN (FILEGROUPDESCRIPTORW, 1) + TEST_FIELD_SIZE (FILEGROUPDESCRIPTORW, cItems, 4) + TEST_FIELD_ALIGN (FILEGROUPDESCRIPTORW, cItems, 1) + TEST_FIELD_OFFSET(FILEGROUPDESCRIPTORW, cItems, 0) + TEST_FIELD_SIZE (FILEGROUPDESCRIPTORW, fgd, 592) + TEST_FIELD_ALIGN (FILEGROUPDESCRIPTORW, fgd, 1) + TEST_FIELD_OFFSET(FILEGROUPDESCRIPTORW, fgd, 4) +} + +static void test_pack_LPBROWSEINFOA(void) +{ + /* LPBROWSEINFOA */ + TEST_TYPE_SIZE (LPBROWSEINFOA, 4) + TEST_TYPE_ALIGN (LPBROWSEINFOA, 4) + TEST_TARGET_SIZE (LPBROWSEINFOA, 32) + TEST_TARGET_ALIGN(LPBROWSEINFOA, 4) +} + +static void test_pack_LPBROWSEINFOW(void) +{ + /* LPBROWSEINFOW */ + TEST_TYPE_SIZE (LPBROWSEINFOW, 4) + TEST_TYPE_ALIGN (LPBROWSEINFOW, 4) + TEST_TARGET_SIZE (LPBROWSEINFOW, 32) + TEST_TARGET_ALIGN(LPBROWSEINFOW, 4) +} + +static void test_pack_LPCABINETSTATE(void) +{ + /* LPCABINETSTATE */ + TEST_TYPE_SIZE (LPCABINETSTATE, 4) + TEST_TYPE_ALIGN (LPCABINETSTATE, 4) + TEST_TARGET_SIZE (LPCABINETSTATE, 12) + TEST_TARGET_ALIGN(LPCABINETSTATE, 1) +} + +static void test_pack_LPCSFV(void) +{ + /* LPCSFV */ + TEST_TYPE_SIZE (LPCSFV, 4) + TEST_TYPE_ALIGN (LPCSFV, 4) +} + +static void test_pack_LPDROPFILES(void) +{ + /* LPDROPFILES */ + TEST_TYPE_SIZE (LPDROPFILES, 4) + TEST_TYPE_ALIGN (LPDROPFILES, 4) + TEST_TARGET_SIZE (LPDROPFILES, 20) + TEST_TARGET_ALIGN(LPDROPFILES, 1) +} + +static void test_pack_LPFILEDESCRIPTORA(void) +{ + /* LPFILEDESCRIPTORA */ + TEST_TYPE_SIZE (LPFILEDESCRIPTORA, 4) + TEST_TYPE_ALIGN (LPFILEDESCRIPTORA, 4) + TEST_TARGET_SIZE (LPFILEDESCRIPTORA, 332) + TEST_TARGET_ALIGN(LPFILEDESCRIPTORA, 1) +} + +static void test_pack_LPFILEDESCRIPTORW(void) +{ + /* LPFILEDESCRIPTORW */ + TEST_TYPE_SIZE (LPFILEDESCRIPTORW, 4) + TEST_TYPE_ALIGN (LPFILEDESCRIPTORW, 4) + TEST_TARGET_SIZE (LPFILEDESCRIPTORW, 592) + TEST_TARGET_ALIGN(LPFILEDESCRIPTORW, 1) +} + +static void test_pack_LPFILEGROUPDESCRIPTORA(void) +{ + /* LPFILEGROUPDESCRIPTORA */ + TEST_TYPE_SIZE (LPFILEGROUPDESCRIPTORA, 4) + TEST_TYPE_ALIGN (LPFILEGROUPDESCRIPTORA, 4) + TEST_TARGET_SIZE (LPFILEGROUPDESCRIPTORA, 336) + TEST_TARGET_ALIGN(LPFILEGROUPDESCRIPTORA, 1) +} + +static void test_pack_LPFILEGROUPDESCRIPTORW(void) +{ + /* LPFILEGROUPDESCRIPTORW */ + TEST_TYPE_SIZE (LPFILEGROUPDESCRIPTORW, 4) + TEST_TYPE_ALIGN (LPFILEGROUPDESCRIPTORW, 4) + TEST_TARGET_SIZE (LPFILEGROUPDESCRIPTORW, 596) + TEST_TARGET_ALIGN(LPFILEGROUPDESCRIPTORW, 1) +} + +static void test_pack_LPFNVIEWCALLBACK(void) +{ + /* LPFNVIEWCALLBACK */ + TEST_TYPE_SIZE (LPFNVIEWCALLBACK, 4) + TEST_TYPE_ALIGN (LPFNVIEWCALLBACK, 4) +} + +static void test_pack_LPIDA(void) +{ + /* LPIDA */ + TEST_TYPE_SIZE (LPIDA, 4) + TEST_TYPE_ALIGN (LPIDA, 4) + TEST_TARGET_SIZE (LPIDA, 8) + TEST_TARGET_ALIGN(LPIDA, 1) +} + +static void test_pack_LPQCMINFO(void) +{ + /* LPQCMINFO */ + TEST_TYPE_SIZE (LPQCMINFO, 4) + TEST_TYPE_ALIGN (LPQCMINFO, 4) + TEST_TARGET_SIZE (LPQCMINFO, 20) + TEST_TARGET_ALIGN(LPQCMINFO, 4) +} + +static void test_pack_LPSHChangeDWORDAsIDList(void) +{ + /* LPSHChangeDWORDAsIDList */ + TEST_TYPE_SIZE (LPSHChangeDWORDAsIDList, 4) + TEST_TYPE_ALIGN (LPSHChangeDWORDAsIDList, 4) + TEST_TARGET_SIZE (LPSHChangeDWORDAsIDList, 12) + TEST_TARGET_ALIGN(LPSHChangeDWORDAsIDList, 1) +} + +static void test_pack_LPSHChangeProductKeyAsIDList(void) +{ + /* LPSHChangeProductKeyAsIDList */ + TEST_TYPE_SIZE (LPSHChangeProductKeyAsIDList, 4) + TEST_TYPE_ALIGN (LPSHChangeProductKeyAsIDList, 4) + TEST_TARGET_SIZE (LPSHChangeProductKeyAsIDList, 82) + TEST_TARGET_ALIGN(LPSHChangeProductKeyAsIDList, 1) +} + +static void test_pack_LPSHDESCRIPTIONID(void) +{ + /* LPSHDESCRIPTIONID */ + TEST_TYPE_SIZE (LPSHDESCRIPTIONID, 4) + TEST_TYPE_ALIGN (LPSHDESCRIPTIONID, 4) + TEST_TARGET_SIZE (LPSHDESCRIPTIONID, 20) + TEST_TARGET_ALIGN(LPSHDESCRIPTIONID, 4) +} + +static void test_pack_LPSHELLFLAGSTATE(void) +{ + /* LPSHELLFLAGSTATE */ + TEST_TYPE_SIZE (LPSHELLFLAGSTATE, 4) + TEST_TYPE_ALIGN (LPSHELLFLAGSTATE, 4) + TEST_TARGET_SIZE (LPSHELLFLAGSTATE, 4) + TEST_TARGET_ALIGN(LPSHELLFLAGSTATE, 1) +} + +static void test_pack_LPSHELLSTATE(void) +{ + /* LPSHELLSTATE */ + TEST_TYPE_SIZE (LPSHELLSTATE, 4) + TEST_TYPE_ALIGN (LPSHELLSTATE, 4) + TEST_TARGET_SIZE (LPSHELLSTATE, 32) + TEST_TARGET_ALIGN(LPSHELLSTATE, 1) +} + +static void test_pack_LPTBINFO(void) +{ + /* LPTBINFO */ + TEST_TYPE_SIZE (LPTBINFO, 4) + TEST_TYPE_ALIGN (LPTBINFO, 4) + TEST_TARGET_SIZE (LPTBINFO, 8) + TEST_TARGET_ALIGN(LPTBINFO, 4) +} + +static void test_pack_PBROWSEINFOA(void) +{ + /* PBROWSEINFOA */ + TEST_TYPE_SIZE (PBROWSEINFOA, 4) + TEST_TYPE_ALIGN (PBROWSEINFOA, 4) + TEST_TARGET_SIZE (PBROWSEINFOA, 32) + TEST_TARGET_ALIGN(PBROWSEINFOA, 4) +} + +static void test_pack_PBROWSEINFOW(void) +{ + /* PBROWSEINFOW */ + TEST_TYPE_SIZE (PBROWSEINFOW, 4) + TEST_TYPE_ALIGN (PBROWSEINFOW, 4) + TEST_TARGET_SIZE (PBROWSEINFOW, 32) + TEST_TARGET_ALIGN(PBROWSEINFOW, 4) +} + +static void test_pack_QCMINFO(void) +{ + /* QCMINFO (pack 8) */ + TEST_TYPE_SIZE (QCMINFO, 20) + TEST_TYPE_ALIGN (QCMINFO, 4) + TEST_FIELD_SIZE (QCMINFO, hmenu, 4) + TEST_FIELD_ALIGN (QCMINFO, hmenu, 4) + TEST_FIELD_OFFSET(QCMINFO, hmenu, 0) + TEST_FIELD_SIZE (QCMINFO, indexMenu, 4) + TEST_FIELD_ALIGN (QCMINFO, indexMenu, 4) + TEST_FIELD_OFFSET(QCMINFO, indexMenu, 4) + TEST_FIELD_SIZE (QCMINFO, idCmdFirst, 4) + TEST_FIELD_ALIGN (QCMINFO, idCmdFirst, 4) + TEST_FIELD_OFFSET(QCMINFO, idCmdFirst, 8) + TEST_FIELD_SIZE (QCMINFO, idCmdLast, 4) + TEST_FIELD_ALIGN (QCMINFO, idCmdLast, 4) + TEST_FIELD_OFFSET(QCMINFO, idCmdLast, 12) + TEST_FIELD_SIZE (QCMINFO, pIdMap, 4) + TEST_FIELD_ALIGN (QCMINFO, pIdMap, 4) + TEST_FIELD_OFFSET(QCMINFO, pIdMap, 16) +} + +static void test_pack_QCMINFO_IDMAP(void) +{ + /* QCMINFO_IDMAP (pack 8) */ + TEST_TYPE_SIZE (QCMINFO_IDMAP, 12) + TEST_TYPE_ALIGN (QCMINFO_IDMAP, 4) + TEST_FIELD_SIZE (QCMINFO_IDMAP, nMaxIds, 4) + TEST_FIELD_ALIGN (QCMINFO_IDMAP, nMaxIds, 4) + TEST_FIELD_OFFSET(QCMINFO_IDMAP, nMaxIds, 0) + TEST_FIELD_SIZE (QCMINFO_IDMAP, pIdList, 8) + TEST_FIELD_ALIGN (QCMINFO_IDMAP, pIdList, 4) + TEST_FIELD_OFFSET(QCMINFO_IDMAP, pIdList, 4) +} + +static void test_pack_QCMINFO_IDMAP_PLACEMENT(void) +{ + /* QCMINFO_IDMAP_PLACEMENT (pack 8) */ + TEST_TYPE_SIZE (QCMINFO_IDMAP_PLACEMENT, 8) + TEST_TYPE_ALIGN (QCMINFO_IDMAP_PLACEMENT, 4) + TEST_FIELD_SIZE (QCMINFO_IDMAP_PLACEMENT, id, 4) + TEST_FIELD_ALIGN (QCMINFO_IDMAP_PLACEMENT, id, 4) + TEST_FIELD_OFFSET(QCMINFO_IDMAP_PLACEMENT, id, 0) + TEST_FIELD_SIZE (QCMINFO_IDMAP_PLACEMENT, fFlags, 4) + TEST_FIELD_ALIGN (QCMINFO_IDMAP_PLACEMENT, fFlags, 4) + TEST_FIELD_OFFSET(QCMINFO_IDMAP_PLACEMENT, fFlags, 4) +} + +static void test_pack_SHChangeDWORDAsIDList(void) +{ + /* SHChangeDWORDAsIDList (pack 1) */ + TEST_TYPE_SIZE (SHChangeDWORDAsIDList, 12) + TEST_TYPE_ALIGN (SHChangeDWORDAsIDList, 1) + TEST_FIELD_SIZE (SHChangeDWORDAsIDList, cb, 2) + TEST_FIELD_ALIGN (SHChangeDWORDAsIDList, cb, 1) + TEST_FIELD_OFFSET(SHChangeDWORDAsIDList, cb, 0) + TEST_FIELD_SIZE (SHChangeDWORDAsIDList, dwItem1, 4) + TEST_FIELD_ALIGN (SHChangeDWORDAsIDList, dwItem1, 1) + TEST_FIELD_OFFSET(SHChangeDWORDAsIDList, dwItem1, 2) + TEST_FIELD_SIZE (SHChangeDWORDAsIDList, dwItem2, 4) + TEST_FIELD_ALIGN (SHChangeDWORDAsIDList, dwItem2, 1) + TEST_FIELD_OFFSET(SHChangeDWORDAsIDList, dwItem2, 6) + TEST_FIELD_SIZE (SHChangeDWORDAsIDList, cbZero, 2) + TEST_FIELD_ALIGN (SHChangeDWORDAsIDList, cbZero, 1) + TEST_FIELD_OFFSET(SHChangeDWORDAsIDList, cbZero, 10) +} + +static void test_pack_SHChangeNotifyEntry(void) +{ + /* SHChangeNotifyEntry (pack 1) */ + TEST_TYPE_SIZE (SHChangeNotifyEntry, 8) + TEST_TYPE_ALIGN (SHChangeNotifyEntry, 1) + TEST_FIELD_SIZE (SHChangeNotifyEntry, pidl, 4) + TEST_FIELD_ALIGN (SHChangeNotifyEntry, pidl, 1) + TEST_FIELD_OFFSET(SHChangeNotifyEntry, pidl, 0) + TEST_FIELD_SIZE (SHChangeNotifyEntry, fRecursive, 4) + TEST_FIELD_ALIGN (SHChangeNotifyEntry, fRecursive, 1) + TEST_FIELD_OFFSET(SHChangeNotifyEntry, fRecursive, 4) +} + +static void test_pack_SHChangeProductKeyAsIDList(void) +{ + /* SHChangeProductKeyAsIDList (pack 1) */ + TEST_TYPE_SIZE (SHChangeProductKeyAsIDList, 82) + TEST_TYPE_ALIGN (SHChangeProductKeyAsIDList, 1) + TEST_FIELD_SIZE (SHChangeProductKeyAsIDList, cb, 2) + TEST_FIELD_ALIGN (SHChangeProductKeyAsIDList, cb, 1) + TEST_FIELD_OFFSET(SHChangeProductKeyAsIDList, cb, 0) + TEST_FIELD_SIZE (SHChangeProductKeyAsIDList, wszProductKey, 78) + TEST_FIELD_ALIGN (SHChangeProductKeyAsIDList, wszProductKey, 1) + TEST_FIELD_OFFSET(SHChangeProductKeyAsIDList, wszProductKey, 2) + TEST_FIELD_SIZE (SHChangeProductKeyAsIDList, cbZero, 2) + TEST_FIELD_ALIGN (SHChangeProductKeyAsIDList, cbZero, 1) + TEST_FIELD_OFFSET(SHChangeProductKeyAsIDList, cbZero, 80) +} + +static void test_pack_SHDESCRIPTIONID(void) +{ + /* SHDESCRIPTIONID (pack 8) */ + TEST_TYPE_SIZE (SHDESCRIPTIONID, 20) + TEST_TYPE_ALIGN (SHDESCRIPTIONID, 4) + TEST_FIELD_SIZE (SHDESCRIPTIONID, dwDescriptionId, 4) + TEST_FIELD_ALIGN (SHDESCRIPTIONID, dwDescriptionId, 4) + TEST_FIELD_OFFSET(SHDESCRIPTIONID, dwDescriptionId, 0) + TEST_FIELD_SIZE (SHDESCRIPTIONID, clsid, 16) + TEST_FIELD_ALIGN (SHDESCRIPTIONID, clsid, 4) + TEST_FIELD_OFFSET(SHDESCRIPTIONID, clsid, 4) +} + +static void test_pack_SHELLFLAGSTATE(void) +{ + /* SHELLFLAGSTATE (pack 1) */ + TEST_TYPE_SIZE (SHELLFLAGSTATE, 4) + TEST_TYPE_ALIGN (SHELLFLAGSTATE, 1) +} + +static void test_pack_SHELLSTATE(void) +{ + /* SHELLSTATE (pack 1) */ + TEST_TYPE_SIZE (SHELLSTATE, 32) + TEST_TYPE_ALIGN (SHELLSTATE, 1) + TEST_FIELD_SIZE (SHELLSTATE, dwWin95Unused, 4) + TEST_FIELD_ALIGN (SHELLSTATE, dwWin95Unused, 1) + TEST_FIELD_OFFSET(SHELLSTATE, dwWin95Unused, 4) + TEST_FIELD_SIZE (SHELLSTATE, uWin95Unused, 4) + TEST_FIELD_ALIGN (SHELLSTATE, uWin95Unused, 1) + TEST_FIELD_OFFSET(SHELLSTATE, uWin95Unused, 8) + TEST_FIELD_SIZE (SHELLSTATE, lParamSort, 4) + TEST_FIELD_ALIGN (SHELLSTATE, lParamSort, 1) + TEST_FIELD_OFFSET(SHELLSTATE, lParamSort, 12) + TEST_FIELD_SIZE (SHELLSTATE, iSortDirection, 4) + TEST_FIELD_ALIGN (SHELLSTATE, iSortDirection, 1) + TEST_FIELD_OFFSET(SHELLSTATE, iSortDirection, 16) + TEST_FIELD_SIZE (SHELLSTATE, version, 4) + TEST_FIELD_ALIGN (SHELLSTATE, version, 1) + TEST_FIELD_OFFSET(SHELLSTATE, version, 20) + TEST_FIELD_SIZE (SHELLSTATE, uNotUsed, 4) + TEST_FIELD_ALIGN (SHELLSTATE, uNotUsed, 1) + TEST_FIELD_OFFSET(SHELLSTATE, uNotUsed, 24) +} + +static void test_pack_TBINFO(void) +{ + /* TBINFO (pack 8) */ + TEST_TYPE_SIZE (TBINFO, 8) + TEST_TYPE_ALIGN (TBINFO, 4) + TEST_FIELD_SIZE (TBINFO, cbuttons, 4) + TEST_FIELD_ALIGN (TBINFO, cbuttons, 4) + TEST_FIELD_OFFSET(TBINFO, cbuttons, 0) + TEST_FIELD_SIZE (TBINFO, uFlags, 4) + TEST_FIELD_ALIGN (TBINFO, uFlags, 4) + TEST_FIELD_OFFSET(TBINFO, uFlags, 4) +} + +static void test_pack(void) +{ + test_pack_APPBARDATA(); + test_pack_AUTO_SCROLL_DATA(); + test_pack_BFFCALLBACK(); + test_pack_BLOB(); + test_pack_BROWSEINFOA(); + test_pack_BROWSEINFOW(); + test_pack_BSTR(); + test_pack_BSTRBLOB(); + test_pack_BYTE_BLOB(); + test_pack_BYTE_SIZEDARR(); + test_pack_CABINETSTATE(); + test_pack_CIDA(); + test_pack_CLIPDATA(); + test_pack_CLIPFORMAT(); + test_pack_CLSID(); + test_pack_COAUTHIDENTITY(); + test_pack_COAUTHINFO(); + test_pack_CSFV(); + test_pack_DATE(); + test_pack_DOUBLE(); + test_pack_DRAGINFOA(); + test_pack_DRAGINFOW(); + test_pack_DROPFILES(); + test_pack_DWORD_SIZEDARR(); + test_pack_FILEDESCRIPTORA(); + test_pack_FILEDESCRIPTORW(); + test_pack_FILEGROUPDESCRIPTORA(); + test_pack_FILEGROUPDESCRIPTORW(); + test_pack_FILEOP_FLAGS(); + test_pack_FLAGGED_BYTE_BLOB(); + test_pack_FLAGGED_WORD_BLOB(); + test_pack_FMTID(); + test_pack_HMETAFILEPICT(); + test_pack_HYPER_SIZEDARR(); + test_pack_IID(); + test_pack_ITEMIDLIST(); + test_pack_LPBLOB(); + test_pack_LPBROWSEINFOA(); + test_pack_LPBROWSEINFOW(); + test_pack_LPBSTR(); + test_pack_LPBSTRBLOB(); + test_pack_LPCABINETSTATE(); + test_pack_LPCITEMIDLIST(); + test_pack_LPCOLESTR(); + test_pack_LPCSFV(); + test_pack_LPCSHITEMID(); + test_pack_LPCY(); + test_pack_LPDECIMAL(); + test_pack_LPDRAGINFOA(); + test_pack_LPDRAGINFOW(); + test_pack_LPDROPFILES(); + test_pack_LPFILEDESCRIPTORA(); + test_pack_LPFILEDESCRIPTORW(); + test_pack_LPFILEGROUPDESCRIPTORA(); + test_pack_LPFILEGROUPDESCRIPTORW(); + test_pack_LPFNVIEWCALLBACK(); + test_pack_LPIDA(); + test_pack_LPITEMIDLIST(); + test_pack_LPOLESTR(); + test_pack_LPQCMINFO(); + test_pack_LPSHChangeDWORDAsIDList(); + test_pack_LPSHChangeProductKeyAsIDList(); + test_pack_LPSHDESCRIPTIONID(); + test_pack_LPSHELLDETAILS(); + test_pack_LPSHELLEXECUTEINFOA(); + test_pack_LPSHELLEXECUTEINFOW(); + test_pack_LPSHELLFLAGSTATE(); + test_pack_LPSHELLSTATE(); + test_pack_LPSHFILEOPSTRUCTA(); + test_pack_LPSHFILEOPSTRUCTW(); + test_pack_LPSHITEMID(); + test_pack_LPSHNAMEMAPPINGA(); + test_pack_LPSHNAMEMAPPINGW(); + test_pack_LPSTRRET(); + test_pack_LPTBINFO(); + test_pack_NOTIFYICONDATAA(); + test_pack_NOTIFYICONDATAW(); + test_pack_OLECHAR(); + test_pack_PAPPBARDATA(); + test_pack_PBROWSEINFOA(); + test_pack_PBROWSEINFOW(); + test_pack_PNOTIFYICONDATAA(); + test_pack_PNOTIFYICONDATAW(); + test_pack_PRINTEROP_FLAGS(); + test_pack_PROPID(); + test_pack_QCMINFO(); + test_pack_QCMINFO_IDMAP(); + test_pack_QCMINFO_IDMAP_PLACEMENT(); + test_pack_RemHBITMAP(); + test_pack_RemHENHMETAFILE(); + test_pack_RemHGLOBAL(); + test_pack_RemHMETAFILEPICT(); + test_pack_RemHPALETTE(); + test_pack_SCODE(); + test_pack_SHChangeDWORDAsIDList(); + test_pack_SHChangeNotifyEntry(); + test_pack_SHChangeProductKeyAsIDList(); + test_pack_SHDESCRIPTIONID(); + test_pack_SHELLDETAILS(); + test_pack_SHELLEXECUTEINFOA(); + test_pack_SHELLEXECUTEINFOW(); + test_pack_SHELLFLAGSTATE(); + test_pack_SHELLSTATE(); + test_pack_SHFILEINFOA(); + test_pack_SHFILEINFOW(); + test_pack_SHFILEOPSTRUCTA(); + test_pack_SHFILEOPSTRUCTW(); + test_pack_SHITEMID(); + test_pack_SHNAMEMAPPINGA(); + test_pack_SHNAMEMAPPINGW(); + test_pack_STRRET(); + test_pack_TBINFO(); + test_pack_UP_BYTE_BLOB(); + test_pack_UP_FLAGGED_BYTE_BLOB(); + test_pack_UP_FLAGGED_WORD_BLOB(); + test_pack_VARIANT_BOOL(); + test_pack_VARTYPE(); + test_pack_WORD_SIZEDARR(); + test_pack_remoteMETAFILEPICT(); + test_pack_userBITMAP(); + test_pack_userCLIPFORMAT(); + test_pack_userHBITMAP(); + test_pack_userHENHMETAFILE(); + test_pack_userHGLOBAL(); + test_pack_userHMETAFILE(); + test_pack_userHMETAFILEPICT(); + test_pack_userHPALETTE(); + test_pack_wireBSTR(); + test_pack_wireCLIPFORMAT(); + test_pack_wireHBITMAP(); + test_pack_wireHENHMETAFILE(); + test_pack_wireHGLOBAL(); + test_pack_wireHMETAFILE(); + test_pack_wireHMETAFILEPICT(); + test_pack_wireHPALETTE(); +} + +START_TEST(generated) +{ +#ifdef _WIN64 + ok(0, "The type size / alignment tests don't support Win64 yet\n"); +#else + test_pack(); +#endif +} diff --git a/dlls/shell32/tests/shlfileop.c b/dlls/shell32/tests/shlfileop.c index 6adced60deb..48e89fa96dd 100644 --- a/dlls/shell32/tests/shlfileop.c +++ b/dlls/shell32/tests/shlfileop.c @@ -33,12 +33,15 @@ #endif /* Error codes could be pre-Win32 */ -#define DE_SAMEFILE 0x71 -#define DE_MANYSRC1DEST 0x72 -#define DE_OPCANCELLED 0x75 -#define DE_DESTSUBTREE 0x76 -#define DE_INVALIDFILES 0x7C -#define DE_DESTSAMETREE 0x7D +#define DE_SAMEFILE 0x71 +#define DE_MANYSRC1DEST 0x72 +#define DE_DIFFDIR 0x73 +#define DE_OPCANCELLED 0x75 +#define DE_DESTSUBTREE 0x76 +#define DE_INVALIDFILES 0x7C +#define DE_DESTSAMETREE 0x7D +#define DE_FLDDESTISFILE 0x7E +#define DE_FILEDESTISFLD 0x80 #define expect_retval(ret, ret_prewin32)\ ok(retval == ret ||\ broken(retval == ret_prewin32),\ @@ -190,8 +193,12 @@ static void test_get_file_info(void) todo_wine ok(shfi.hIcon == 0, "SHGetFileInfoA('' | 0) did not clear hIcon\n"); todo_wine ok(shfi.szDisplayName[0] == 0, "SHGetFileInfoA('' | 0) did not clear szDisplayName[0]\n"); todo_wine ok(shfi.szTypeName[0] == 0, "SHGetFileInfoA('' | 0) did not clear szTypeName[0]\n"); - ok(shfi.iIcon == 0xcfcfcfcf, "SHGetFileInfoA('' | 0) should not clear iIcon\n"); - ok(shfi.dwAttributes == 0xcfcfcfcf, "SHGetFileInfoA('' | 0) should not clear dwAttributes\n"); + ok(shfi.iIcon == 0xcfcfcfcf || + broken(shfi.iIcon != 0xcfcfcfcf), /* NT4 doesn't clear but sets this field */ + "SHGetFileInfoA('' | 0) should not clear iIcon\n"); + ok(shfi.dwAttributes == 0xcfcfcfcf || + broken(shfi.dwAttributes != 0xcfcfcfcf), /* NT4 doesn't clear but sets this field */ + "SHGetFileInfoA('' | 0) should not clear dwAttributes\n"); if (pSHGetFileInfoW) { @@ -222,7 +229,9 @@ static void test_get_file_info(void) todo_wine ok(shfi.hIcon == 0, "SHGetFileInfoA(c:\\nonexistent | SHGFI_ATTRIBUTES) did not clear hIcon\n"); todo_wine ok(shfi.szDisplayName[0] == 0, "SHGetFileInfoA(c:\\nonexistent | SHGFI_ATTRIBUTES) did not clear szDisplayName[0]\n"); todo_wine ok(shfi.szTypeName[0] == 0, "SHGetFileInfoA(c:\\nonexistent | SHGFI_ATTRIBUTES) did not clear szTypeName[0]\n"); - ok(shfi.iIcon == 0xcfcfcfcf, "SHGetFileInfoA(c:\\nonexistent | SHGFI_ATTRIBUTES) should not clear iIcon\n"); + ok(shfi.iIcon == 0xcfcfcfcf || + broken(shfi.iIcon != 0xcfcfcfcf), /* NT4 doesn't clear but sets this field */ + "SHGetFileInfoA(c:\\nonexistent | SHGFI_ATTRIBUTES) should not clear iIcon\n"); rc=SHGetFileInfoA("c:\\nonexistent", FILE_ATTRIBUTE_DIRECTORY, &shfi, sizeof(shfi), @@ -311,7 +320,10 @@ static void test_get_file_info_iconlist(void) todo_wine ok(shInfoa.hIcon == 0, "SHGetFileInfoA(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) did not clear hIcon\n"); todo_wine ok(shInfoa.szTypeName[0] == 0, "SHGetFileInfoA(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) did not clear szTypeName[0]\n"); ok(shInfoa.iIcon != 0xcfcfcfcf, "SHGetFileInfoA(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) should set iIcon\n"); - ok(shInfoa.dwAttributes == 0xcfcfcfcf, "SHGetFileInfoA(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) should not change dwAttributes\n"); + ok(shInfoa.dwAttributes == 0xcfcfcfcf || + shInfoa.dwAttributes == 0 || /* Vista */ + broken(shInfoa.dwAttributes != 0xcfcfcfcf), /* NT4 doesn't clear but sets this field */ + "SHGetFileInfoA(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL), unexpected dwAttributes\n"); CloseHandle(hSysImageList); if (!pSHGetFileInfoW) @@ -334,7 +346,9 @@ static void test_get_file_info_iconlist(void) todo_wine ok(shInfow.hIcon == 0, "SHGetFileInfoW(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) did not clear hIcon\n"); ok(shInfow.szTypeName[0] == 0, "SHGetFileInfoW(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) did not clear szTypeName[0]\n"); ok(shInfow.iIcon != 0xcfcfcfcf, "SHGetFileInfoW(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) should set iIcon\n"); - ok(shInfow.dwAttributes == 0xcfcfcfcf, "SHGetFileInfoW(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) should not change dwAttributes\n"); + ok(shInfow.dwAttributes == 0xcfcfcfcf || + shInfoa.dwAttributes == 0, /* Vista */ + "SHGetFileInfoW(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) unexpected dwAttributes\n"); CloseHandle(hSysImageList); /* Various suposidly invalid flag testing */ @@ -343,7 +357,9 @@ static void test_get_file_info_iconlist(void) SHGFI_SYSICONINDEX|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_SMALLICON); ok(hr != 0, "SHGFI_SYSICONINDEX|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_SMALLICON Failed\n"); ok(shInfow.iIcon!=0xcfcfcfcf, "Icon Index Missing\n"); - ok(shInfow.dwAttributes==0xcfcfcfcf,"dwAttributes modified\n"); + ok(shInfow.dwAttributes==0xcfcfcfcf || + shInfoa.dwAttributes==0, /* Vista */ + "unexpected dwAttributes\n"); memset(&shInfow, 0xcf, sizeof(shInfow)); hr = pSHGetFileInfoW((const WCHAR *)pidList, 0, &shInfow, sizeof(shInfow), @@ -368,7 +384,9 @@ static void test_get_file_info_iconlist(void) SHGFI_SYSICONINDEX|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_LARGEICON); ok(hr != 0, "SHGFI_SYSICONINDEX|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_LARGEICON Failed\n"); ok(shInfow.iIcon!=0xcfcfcfcf, "Icon Index Missing\n"); - ok(shInfow.dwAttributes==0xcfcfcfcf,"dwAttributes modified\n"); + ok(shInfow.dwAttributes==0xcfcfcfcf || + shInfoa.dwAttributes==0, /* Vista */ + "unexpected dwAttributes\n"); memset(&shInfow, 0xcf, sizeof(shInfow)); hr = pSHGetFileInfoW((const WCHAR *)pidList, 0, &shInfow, sizeof(shInfow), @@ -405,7 +423,9 @@ static void test_get_file_info_iconlist(void) SHGFI_EXETYPE); todo_wine ok(hr != 0, "SHGFI_SYSICONINDEX|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_SMALLICON|SHGFI_EXETYPE Failed\n"); ok(shInfow.iIcon!=0xcfcfcfcf, "Icon Index Missing\n"); - ok(shInfow.dwAttributes==0xcfcfcfcf,"dwAttributes modified\n"); + ok(shInfow.dwAttributes==0xcfcfcfcf || + shInfoa.dwAttributes==0, /* Vista */ + "unexpected dwAttributes\n"); memset(&shInfow, 0xcf, sizeof(shInfow)); hr = pSHGetFileInfoW((const WCHAR *)pidList, 0, &shInfow, sizeof(shInfow), @@ -434,7 +454,9 @@ static void test_get_file_info_iconlist(void) SHGFI_SYSICONINDEX|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_EXETYPE); todo_wine ok(hr != 0, "SHGFI_SYSICONINDEX|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_EXETYPE Failed\n"); ok(shInfow.iIcon!=0xcfcfcfcf, "Icon Index Missing\n"); - ok(shInfow.dwAttributes==0xcfcfcfcf,"dwAttributes modified\n"); + ok(shInfow.dwAttributes==0xcfcfcfcf || + shInfoa.dwAttributes==0, /* Vista */ + "unexpected dwAttributes\n"); memset(&shInfow, 0xcf, sizeof(shInfow)); hr = pSHGetFileInfoW((const WCHAR *)pidList, 0, &shInfow, sizeof(shInfow), @@ -495,17 +517,19 @@ static void test_delete(void) shfo.lpszProgressTitle = NULL; ok(!SHFileOperationA(&shfo), "Deletion was not successful\n"); - ok(file_exists("test4.txt"), "Directory should not have been removed\n"); + ok(dir_exists("test4.txt"), "Directory should not have been removed\n"); ok(!file_exists("test1.txt"), "File should have been removed\n"); + ok(!file_exists("test2.txt"), "File should have been removed\n"); + ok(!file_exists("test3.txt"), "File should have been removed\n"); ret = SHFileOperationA(&shfo); - ok(!ret, "Directory exists, but is not removed, ret=%d\n", ret); - ok(file_exists("test4.txt"), "Directory should not have been removed\n"); + ok(ret == ERROR_SUCCESS, "Directory exists, but is not removed, ret=%d\n", ret); + ok(dir_exists("test4.txt"), "Directory should not have been removed\n"); shfo.fFlags = FOF_NOCONFIRMATION | FOF_SILENT | FOF_NOERRORUI; ok(!SHFileOperationA(&shfo), "Directory is not removed\n"); - ok(!file_exists("test4.txt"), "Directory should have been removed\n"); + ok(!dir_exists("test4.txt"), "Directory should have been removed\n"); ret = SHFileOperationA(&shfo); ok(!ret, "The requested file does not exist, ret=%d\n", ret); @@ -515,13 +539,13 @@ static void test_delete(void) buf[strlen(buf) + 1] = '\0'; ok(MoveFileA("test1.txt", "test4.txt\\test1.txt"), "Filling the subdirectory failed\n"); ok(!SHFileOperationA(&shfo), "Directory is not removed\n"); - ok(!file_exists("test4.txt"), "Directory is not removed\n"); + ok(!dir_exists("test4.txt"), "Directory is not removed\n"); init_shfo_tests(); shfo.pFrom = "test1.txt\0test4.txt\0"; ok(!SHFileOperationA(&shfo), "Directory and a file are not removed\n"); ok(!file_exists("test1.txt"), "The file should have been removed\n"); - ok(!file_exists("test4.txt"), "Directory should have been removed\n"); + ok(!dir_exists("test4.txt"), "Directory should have been removed\n"); ok(file_exists("test2.txt"), "This file should not have been removed\n"); /* FOF_FILESONLY does not delete a dir matching a wildcard */ @@ -531,13 +555,15 @@ static void test_delete(void) ok(!SHFileOperation(&shfo), "Failed to delete files\n"); ok(!file_exists("test1.txt"), "test1.txt should have been removed\n"); ok(!file_exists("test_5.txt"), "test_5.txt should have been removed\n"); - ok(file_exists("test4.txt"), "test4.txt should not have been removed\n"); + ok(dir_exists("test4.txt"), "test4.txt should not have been removed\n"); /* FOF_FILESONLY only deletes a dir if explicitly specified */ init_shfo_tests(); shfo.pFrom = "test_?.txt\0test4.txt\0"; ok(!SHFileOperation(&shfo), "Failed to delete files and directory\n"); - ok(!file_exists("test4.txt"), "test4.txt should have been removed\n"); + ok(!dir_exists("test4.txt") || + broken(dir_exists("test4.txt")), /* NT4 */ + "test4.txt should have been removed\n"); ok(!file_exists("test_5.txt"), "test_5.txt should have been removed\n"); ok(file_exists("test1.txt"), "test1.txt should not have been removed\n"); @@ -559,7 +585,9 @@ static void test_delete(void) shfo.pFrom = "test1.txt\0"; shfo.wFunc = 0; ret = SHFileOperation(&shfo); - ok(ret == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", ret); + ok(ret == ERROR_INVALID_PARAMETER || + broken(ret == ERROR_SUCCESS), /* Win9x, NT4 */ + "Expected ERROR_INVALID_PARAMETER, got %d\n", ret); ok(file_exists("test1.txt"), "Expected test1.txt to exist\n"); /* try an invalid list, only one null terminator */ @@ -573,18 +601,33 @@ static void test_delete(void) ok(file_exists("test1.txt"), "Expected test1.txt to exist\n"); } + /* delete a nonexistent file */ + shfo.pFrom = "nonexistent.txt\0"; + shfo.wFunc = FO_DELETE; + ret = SHFileOperation(&shfo); + todo_wine + ok(ret == 1026 || + ret == ERROR_FILE_NOT_FOUND || /* Vista */ + broken(ret == ERROR_SUCCESS), /* NT4 */ + "Expected 1026 or ERROR_FILE_NOT_FOUND, got %d\n", ret); + /* delete a dir, and then a file inside the dir, same as * deleting a nonexistent file - * - * FIXME: Vista throws up a dialog window to ask if one.txt should be created */ - init_shfo_tests(); - shfo.pFrom = "testdir2\0testdir2\\one.txt\0"; - shfo.wFunc = FO_DELETE; - ret = SHFileOperation(&shfo); - ok(ret == ERROR_PATH_NOT_FOUND, "Expected ERROR_PATH_NOT_FOUND, got %d\n", ret); - ok(!file_exists("testdir2"), "Expected testdir2 to not exist\n"); - ok(!file_exists("testdir2\\one.txt"), "Expected testdir2\\one.txt to not exist\n"); + if (ret != ERROR_FILE_NOT_FOUND) + { + /* Vista would throw up a dialog box that we can't suppress */ + init_shfo_tests(); + shfo.pFrom = "testdir2\0testdir2\\one.txt\0"; + ret = SHFileOperation(&shfo); + ok(ret == ERROR_PATH_NOT_FOUND || + broken(ret == ERROR_SUCCESS), /* NT4 */ + "Expected ERROR_PATH_NOT_FOUND, got %d\n", ret); + ok(!dir_exists("testdir2"), "Expected testdir2 to not exist\n"); + ok(!file_exists("testdir2\\one.txt"), "Expected testdir2\\one.txt to not exist\n"); + } + else + skip("Test would show a dialog box\n"); /* try the FOF_NORECURSION flag, continues deleting subdirs */ init_shfo_tests(); @@ -593,7 +636,7 @@ static void test_delete(void) ret = SHFileOperation(&shfo); ok(ret == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", ret); ok(!file_exists("testdir2\\one.txt"), "Expected testdir2\\one.txt to not exist\n"); - ok(!file_exists("testdir2\\nested"), "Expected testdir2\\nested to exist\n"); + ok(!dir_exists("testdir2\\nested"), "Expected testdir2\\nested to not exist\n"); } /* tests the FO_RENAME action */ @@ -614,20 +657,34 @@ static void test_rename(void) set_curr_dir_path(from, "test1.txt\0"); set_curr_dir_path(to, "test4.txt\0"); - ok(SHFileOperationA(&shfo), "File is not renamed moving to other directory " - "when specifying directory name only\n"); - ok(file_exists("test1.txt"), "The file is removed\n"); + retval = SHFileOperationA(&shfo); + ok(retval == ERROR_ALREADY_EXISTS || + retval == DE_FILEDESTISFLD || /* Vista */ + broken(retval == ERROR_INVALID_NAME), /* Win9x, NT4 */ + "Expected ERROR_ALREADY_EXISTS or DE_FILEDESTISFLD, got %d\n", retval); + ok(file_exists("test1.txt"), "The file is renamed\n"); set_curr_dir_path(from, "test3.txt\0"); set_curr_dir_path(to, "test4.txt\\test1.txt\0"); - ok(!SHFileOperationA(&shfo), "File is renamed moving to other directory\n"); - ok(file_exists("test4.txt\\test1.txt"), "The file is not renamed\n"); + retval = SHFileOperationA(&shfo); + if (retval == DE_DIFFDIR) + { + /* Vista and W2K8 (broken or new behavior ?) */ + ok(!file_exists("test4.txt\\test1.txt"), "The file is renamed\n"); + } + else + { + ok(retval == ERROR_SUCCESS, "File is renamed moving to other directory\n"); + ok(file_exists("test4.txt\\test1.txt"), "The file is not renamed\n"); + } set_curr_dir_path(from, "test1.txt\0test2.txt\0test4.txt\0"); set_curr_dir_path(to, "test6.txt\0test7.txt\0test8.txt\0"); - retval = SHFileOperationA(&shfo); /* W98 returns 0, W2K and newer returns ERROR_GEN_FAILURE, both do nothing */ - ok(!retval || retval == ERROR_GEN_FAILURE || retval == ERROR_INVALID_TARGET_HANDLE, - "Can't rename many files, retval = %d\n", retval); + retval = SHFileOperationA(&shfo); + ok(retval == ERROR_GEN_FAILURE || + retval == DE_MANYSRC1DEST || /* Vista */ + broken(retval == ERROR_SUCCESS), /* Win9x */ + "Expected ERROR_GEN_FAILURE or DE_MANYSRC1DEST , got %d\n", retval); ok(file_exists("test1.txt"), "The file is renamed - many files are specified\n"); memcpy(&shfo2, &shfo, sizeof(SHFILEOPSTRUCTA)); @@ -635,34 +692,37 @@ static void test_rename(void) set_curr_dir_path(from, "test1.txt\0test2.txt\0test4.txt\0"); set_curr_dir_path(to, "test6.txt\0test7.txt\0test8.txt\0"); - retval = SHFileOperationA(&shfo2); /* W98 returns 0, W2K and newer returns ERROR_GEN_FAILURE, both do nothing */ - ok(!retval || retval == ERROR_GEN_FAILURE || retval == ERROR_INVALID_TARGET_HANDLE, - "Can't rename many files, retval = %d\n", retval); + retval = SHFileOperationA(&shfo2); + ok(retval == ERROR_GEN_FAILURE || + retval == DE_MANYSRC1DEST || /* Vista */ + broken(retval == ERROR_SUCCESS), /* Win9x */ + "Expected ERROR_GEN_FAILURE or DE_MANYSRC1DEST files, got %d\n", retval); ok(file_exists("test1.txt"), "The file is not renamed - many files are specified\n"); set_curr_dir_path(from, "test1.txt\0"); set_curr_dir_path(to, "test6.txt\0"); retval = SHFileOperationA(&shfo); - ok(!retval, "Rename file failed, retval = %d\n", retval); + ok(retval == ERROR_SUCCESS, "Rename file failed, retval = %d\n", retval); ok(!file_exists("test1.txt"), "The file is not renamed\n"); ok(file_exists("test6.txt"), "The file is not renamed\n"); set_curr_dir_path(from, "test6.txt\0"); set_curr_dir_path(to, "test1.txt\0"); retval = SHFileOperationA(&shfo); - ok(!retval, "Rename file back failed, retval = %d\n", retval); + ok(retval == ERROR_SUCCESS, "Rename file back failed, retval = %d\n", retval); set_curr_dir_path(from, "test4.txt\0"); set_curr_dir_path(to, "test6.txt\0"); retval = SHFileOperationA(&shfo); - ok(!retval, "Rename dir failed, retval = %d\n", retval); - ok(!file_exists("test4.txt"), "The dir is not renamed\n"); - ok(file_exists("test6.txt"), "The dir is not renamed\n"); + ok(retval == ERROR_SUCCESS, "Rename dir failed, retval = %d\n", retval); + ok(!dir_exists("test4.txt"), "The dir is not renamed\n"); + ok(dir_exists("test6.txt"), "The dir is not renamed\n"); set_curr_dir_path(from, "test6.txt\0"); set_curr_dir_path(to, "test4.txt\0"); retval = SHFileOperationA(&shfo); - ok(!retval, "Rename dir back failed, retval = %d\n", retval); + ok(retval == ERROR_SUCCESS, "Rename dir back failed, retval = %d\n", retval); + ok(dir_exists("test4.txt"), "The dir is not renamed\n"); /* try to rename more than one file to a single file */ shfo.pFrom = "test1.txt\0test2.txt\0"; @@ -670,7 +730,7 @@ static void test_rename(void) retval = SHFileOperationA(&shfo); ok(retval == ERROR_GEN_FAILURE || retval == DE_MANYSRC1DEST || /* Vista */ - broken(!retval), /* Win9x */ + broken(retval == ERROR_SUCCESS), /* Win9x */ "Expected ERROR_GEN_FAILURE or DE_MANYSRC1DEST, got %d\n", retval); ok(file_exists("test1.txt"), "Expected test1.txt to exist\n"); ok(file_exists("test2.txt"), "Expected test2.txt to exist\n"); @@ -681,7 +741,8 @@ static void test_rename(void) shfo.pTo = "newfile\0"; retval = SHFileOperationA(&shfo); ok(retval == 1026 || - retval == ERROR_FILE_NOT_FOUND, /* Vista */ + retval == ERROR_FILE_NOT_FOUND || /* Vista */ + broken(retval == ERROR_SUCCESS), /* NT4 */ "Expected 1026 or ERROR_FILE_NOT_FOUND, got %d\n", retval); ok(!file_exists("newfile"), "Expected newfile to not exist\n"); @@ -689,28 +750,45 @@ static void test_rename(void) shfo.pFrom = "test1.txt\0"; shfo.pTo = "test2.txt\0"; retval = SHFileOperationA(&shfo); - ok(retval == ERROR_ALREADY_EXISTS, "Expected ERROR_ALREADY_EXISTS, got %d\n", retval); + if (retval == ERROR_SUCCESS) + { + /* Vista and W2K8 (broken or new behavior ?) */ + createTestFile("test1.txt"); + } + else + { + ok(retval == ERROR_ALREADY_EXISTS || + broken(retval == DE_OPCANCELLED) || /* NT4 */ + broken(retval == ERROR_INVALID_NAME), /* Win9x */ + "Expected ERROR_ALREADY_EXISTS, got %d\n", retval); + } /* pFrom is valid, but pTo is empty */ shfo.pFrom = "test1.txt\0"; shfo.pTo = "\0"; retval = SHFileOperationA(&shfo); - expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* Win9x */); + ok(retval == ERROR_CANCELLED || + retval == DE_DIFFDIR || /* Vista */ + broken(retval == DE_OPCANCELLED) || /* Win9x */ + broken(retval == 65652), /* NT4 */ + "Expected ERROR_CANCELLED or DE_DIFFDIR\n"); ok(file_exists("test1.txt"), "Expected test1.txt to exist\n"); /* pFrom is empty */ shfo.pFrom = "\0"; retval = SHFileOperationA(&shfo); ok(retval == ERROR_ACCESS_DENIED || - retval == ERROR_INVALID_TARGET_HANDLE, /* Vista */ - "Expected ERROR_ACCESS_DENIED or ERROR_INVALID_TARGET_HANDLE, got %d\n", retval); + retval == DE_MANYSRC1DEST || /* Vista */ + broken(retval == ERROR_SUCCESS), /* Win9x */ + "Expected ERROR_ACCESS_DENIED or DE_MANYSRC1DEST, got %d\n", retval); /* pFrom is NULL, commented out because it crashes on nt 4.0 */ -#if 0 - shfo.pFrom = NULL; - retval = SHFileOperationA(&shfo); - ok(retval == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", retval); -#endif + if (0) + { + shfo.pFrom = NULL; + retval = SHFileOperationA(&shfo); + ok(retval == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", retval); + } } /* tests the FO_COPY action */ @@ -872,8 +950,16 @@ static void test_copy(void) set_curr_dir_path(from, "test1.txt\0test2.txt\0"); set_curr_dir_path(to, "test3.txt\0"); retval = SHFileOperation(&shfo); - expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* Win9x, NT4 */); - ok(shfo.fAnyOperationsAborted, "Expected aborted operations\n"); + if (retval == DE_FLDDESTISFILE) + { + /* Vista and W2K8 (broken or new behavior ?) */ + ok(!shfo.fAnyOperationsAborted, "Didn't expect aborted operations\n"); + } + else + { + expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* Win9x, NT4 */); + ok(shfo.fAnyOperationsAborted, "Expected aborted operations\n"); + } ok(!file_exists("test3.txt\\test2.txt"), "Expected test3.txt\\test2.txt to not exist\n"); /* try to copy many files to nonexistent directory */ @@ -1515,7 +1601,10 @@ static void test_copy(void) shfo.fFlags = FOF_MULTIDESTFILES | FOF_NOCONFIRMATION | FOF_SILENT | FOF_NOERRORUI; retval = SHFileOperation(&shfo); - expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* Win9x, NT4 */); + ok(retval == ERROR_CANCELLED || + retval == DE_FILEDESTISFLD || /* Vista */ + broken(retval == DE_OPCANCELLED), /* Win9x, NT4 */ + "Expected ERROR_CANCELLED or DE_FILEDESTISFLD. got %d\n", retval); if (file_exists("threedir\\threedir")) { /* NT4 */ diff --git a/dlls/shlwapi/tests/generated.c b/dlls/shlwapi/tests/generated.c dissimilarity index 62% index 6d50fbcf32e..db44d275994 100644 --- a/dlls/shlwapi/tests/generated.c +++ b/dlls/shlwapi/tests/generated.c @@ -1,180 +1,181 @@ -/* File generated automatically from tools/winapi/test.dat; do not edit! */ -/* This file can be copied, modified and distributed without restriction. */ - -/* - * Unit tests for data structure packing - */ - -#define WINVER 0x0501 -#define _WIN32_IE 0x0501 -#define _WIN32_WINNT 0x0501 - -#define WINE_NOWINSOCK - -#include -#include "windef.h" -#include "winbase.h" -#include "wtypes.h" -#include "winreg.h" -#include "shlwapi.h" - -#include "wine/test.h" - -/*********************************************************************** - * Compatibility macros - */ - -#define DWORD_PTR UINT_PTR -#define LONG_PTR INT_PTR -#define ULONG_PTR UINT_PTR - -/*********************************************************************** - * Windows API extension - */ - -#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) -# define FIELD_ALIGNMENT(type, field) __alignof(((type*)0)->field) -#elif defined(__GNUC__) -# define FIELD_ALIGNMENT(type, field) __alignof__(((type*)0)->field) -#else -/* FIXME: Not sure if is possible to do without compiler extension */ -#endif - -#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) -# define _TYPE_ALIGNMENT(type) __alignof(type) -#elif defined(__GNUC__) -# define _TYPE_ALIGNMENT(type) __alignof__(type) -#else -/* - * FIXME: Not sure if is possible to do without compiler extension - * (if type is not just a name that is, if so the normal) - * TYPE_ALIGNMENT can be used) - */ -#endif - -#if defined(TYPE_ALIGNMENT) && defined(_MSC_VER) && _MSC_VER >= 800 && !defined(__cplusplus) -#pragma warning(disable:4116) -#endif - -#if !defined(TYPE_ALIGNMENT) && defined(_TYPE_ALIGNMENT) -# define TYPE_ALIGNMENT _TYPE_ALIGNMENT -#endif - -/*********************************************************************** - * Test helper macros - */ - -#ifdef FIELD_ALIGNMENT -# define TEST_FIELD_ALIGNMENT(type, field, align) \ - ok(FIELD_ALIGNMENT(type, field) == align, \ - "FIELD_ALIGNMENT(" #type ", " #field ") == %d (expected " #align ")\n", \ - (int)FIELD_ALIGNMENT(type, field)) -#else -# define TEST_FIELD_ALIGNMENT(type, field, align) do { } while (0) -#endif - -#define TEST_FIELD_OFFSET(type, field, offset) \ - ok(FIELD_OFFSET(type, field) == offset, \ - "FIELD_OFFSET(" #type ", " #field ") == %ld (expected " #offset ")\n", \ - (long int)FIELD_OFFSET(type, field)) - -#ifdef _TYPE_ALIGNMENT -#define TEST__TYPE_ALIGNMENT(type, align) \ - ok(_TYPE_ALIGNMENT(type) == align, "TYPE_ALIGNMENT(" #type ") == %d (expected " #align ")\n", (int)_TYPE_ALIGNMENT(type)) -#else -# define TEST__TYPE_ALIGNMENT(type, align) do { } while (0) -#endif - -#ifdef TYPE_ALIGNMENT -#define TEST_TYPE_ALIGNMENT(type, align) \ - ok(TYPE_ALIGNMENT(type) == align, "TYPE_ALIGNMENT(" #type ") == %d (expected " #align ")\n", (int)TYPE_ALIGNMENT(type)) -#else -# define TEST_TYPE_ALIGNMENT(type, align) do { } while (0) -#endif - -#define TEST_TYPE_SIZE(type, size) \ - ok(sizeof(type) == size, "sizeof(" #type ") == %d (expected " #size ")\n", ((int) sizeof(type))) - -/*********************************************************************** - * Test macros - */ - -#define TEST_FIELD(type, field_type, field_name, field_offset, field_size, field_align) \ - TEST_TYPE_SIZE(field_type, field_size); \ - TEST_FIELD_ALIGNMENT(type, field_name, field_align); \ - TEST_FIELD_OFFSET(type, field_name, field_offset); \ - -#define TEST_TYPE(type, size, align) \ - TEST_TYPE_ALIGNMENT(type, align); \ - TEST_TYPE_SIZE(type, size) - -#define TEST_TYPE_POINTER(type, size, align) \ - TEST__TYPE_ALIGNMENT(*(type)0, align); \ - TEST_TYPE_SIZE(*(type)0, size) - -#define TEST_TYPE_SIGNED(type) \ - ok((type) -1 < 0, "(" #type ") -1 < 0\n"); - -#define TEST_TYPE_UNSIGNED(type) \ - ok((type) -1 > 0, "(" #type ") -1 > 0\n"); - -static void test_pack_ASSOCF(void) -{ - /* ASSOCF */ - TEST_TYPE(ASSOCF, 4, 4); - TEST_TYPE_UNSIGNED(ASSOCF); -} - -static void test_pack_DLLGETVERSIONPROC(void) -{ - /* DLLGETVERSIONPROC */ - TEST_TYPE(DLLGETVERSIONPROC, 4, 4); -} - -static void test_pack_DLLVERSIONINFO(void) -{ - /* DLLVERSIONINFO (pack 8) */ - TEST_TYPE(DLLVERSIONINFO, 20, 4); - TEST_FIELD(DLLVERSIONINFO, DWORD, cbSize, 0, 4, 4); - TEST_FIELD(DLLVERSIONINFO, DWORD, dwMajorVersion, 4, 4, 4); - TEST_FIELD(DLLVERSIONINFO, DWORD, dwMinorVersion, 8, 4, 4); - TEST_FIELD(DLLVERSIONINFO, DWORD, dwBuildNumber, 12, 4, 4); - TEST_FIELD(DLLVERSIONINFO, DWORD, dwPlatformID, 16, 4, 4); -} - -static void test_pack_DLLVERSIONINFO2(void) -{ - /* DLLVERSIONINFO2 (pack 8) */ - TEST_TYPE(DLLVERSIONINFO2, 32, 8); - TEST_FIELD(DLLVERSIONINFO2, DLLVERSIONINFO, info1, 0, 20, 4); - TEST_FIELD(DLLVERSIONINFO2, DWORD, dwFlags, 20, 4, 4); - TEST_FIELD(DLLVERSIONINFO2, ULONGLONG, ullVersion, 24, 8, 8); -} - -static void test_pack_HUSKEY(void) -{ - /* HUSKEY */ - TEST_TYPE(HUSKEY, 4, 4); -} - -static void test_pack_PHUSKEY(void) -{ - /* PHUSKEY */ - TEST_TYPE(PHUSKEY, 4, 4); - TEST_TYPE_POINTER(PHUSKEY, 4, 4); -} - -static void test_pack(void) -{ - test_pack_ASSOCF(); - test_pack_DLLGETVERSIONPROC(); - test_pack_DLLVERSIONINFO(); - test_pack_DLLVERSIONINFO2(); - test_pack_HUSKEY(); - test_pack_PHUSKEY(); -} - -START_TEST(generated) -{ - test_pack(); -} +/* File generated automatically from tools/winapi/tests.dat; do not edit! */ +/* This file can be copied, modified and distributed without restriction. */ + +/* + * Unit tests for data structure packing + */ + +#define WINVER 0x0501 +#define _WIN32_IE 0x0501 +#define _WIN32_WINNT 0x0501 + +#define WINE_NOWINSOCK + +#include +#include "windef.h" +#include "winbase.h" +#include "wtypes.h" +#include "winreg.h" +#include "shlwapi.h" + +#include "wine/test.h" + +/*********************************************************************** + * Compatibility macros + */ + +#define DWORD_PTR UINT_PTR +#define LONG_PTR INT_PTR +#define ULONG_PTR UINT_PTR + +/*********************************************************************** + * Windows API extension + */ + +#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) +# define _TYPE_ALIGNMENT(type) __alignof(type) +#elif defined(__GNUC__) +# define _TYPE_ALIGNMENT(type) __alignof__(type) +#else +/* + * FIXME: May not be possible without a compiler extension + * (if type is not just a name that is, otherwise the normal + * TYPE_ALIGNMENT can be used) + */ +#endif + +#if defined(TYPE_ALIGNMENT) && defined(_MSC_VER) && _MSC_VER >= 800 && !defined(__cplusplus) +#pragma warning(disable:4116) +#endif + +#if !defined(TYPE_ALIGNMENT) && defined(_TYPE_ALIGNMENT) +# define TYPE_ALIGNMENT _TYPE_ALIGNMENT +#endif + +/*********************************************************************** + * Test helper macros + */ + +#ifdef _WIN64 + +# define TEST_TYPE_SIZE(type, size) +# define TEST_TYPE_ALIGN(type, align) +# define TEST_TARGET_ALIGN(type, align) +# define TEST_FIELD_ALIGN(type, field, align) +# define TEST_FIELD_OFFSET(type, field, offset) + +#else + +# define TEST_TYPE_SIZE(type, size) C_ASSERT(sizeof(type) == size); + +# ifdef TYPE_ALIGNMENT +# define TEST_TYPE_ALIGN(type, align) C_ASSERT(TYPE_ALIGNMENT(type) == align); +# else +# define TEST_TYPE_ALIGN(type, align) +# endif + +# ifdef _TYPE_ALIGNMENT +# define TEST_TARGET_ALIGN(type, align) C_ASSERT(_TYPE_ALIGNMENT(*(type)0) == align); +# define TEST_FIELD_ALIGN(type, field, align) C_ASSERT(_TYPE_ALIGNMENT(((type*)0)->field) == align); +# else +# define TEST_TARGET_ALIGN(type, align) +# define TEST_FIELD_ALIGN(type, field, align) +# endif + +# define TEST_FIELD_OFFSET(type, field, offset) C_ASSERT(FIELD_OFFSET(type, field) == offset); + +#endif + +#define TEST_TARGET_SIZE(type, size) TEST_TYPE_SIZE(*(type)0, size) +#define TEST_FIELD_SIZE(type, field, size) TEST_TYPE_SIZE((((type*)0)->field), size) +#define TEST_TYPE_SIGNED(type) C_ASSERT((type) -1 < 0); +#define TEST_TYPE_UNSIGNED(type) C_ASSERT((type) -1 > 0); + + +static void test_pack_ASSOCF(void) +{ + /* ASSOCF */ + TEST_TYPE_SIZE (ASSOCF, 4) + TEST_TYPE_ALIGN (ASSOCF, 4) + TEST_TYPE_UNSIGNED(ASSOCF) +} + +static void test_pack_DLLGETVERSIONPROC(void) +{ + /* DLLGETVERSIONPROC */ + TEST_TYPE_SIZE (DLLGETVERSIONPROC, 4) + TEST_TYPE_ALIGN (DLLGETVERSIONPROC, 4) +} + +static void test_pack_DLLVERSIONINFO(void) +{ + /* DLLVERSIONINFO (pack 8) */ + TEST_TYPE_SIZE (DLLVERSIONINFO, 20) + TEST_TYPE_ALIGN (DLLVERSIONINFO, 4) + TEST_FIELD_SIZE (DLLVERSIONINFO, cbSize, 4) + TEST_FIELD_ALIGN (DLLVERSIONINFO, cbSize, 4) + TEST_FIELD_OFFSET(DLLVERSIONINFO, cbSize, 0) + TEST_FIELD_SIZE (DLLVERSIONINFO, dwMajorVersion, 4) + TEST_FIELD_ALIGN (DLLVERSIONINFO, dwMajorVersion, 4) + TEST_FIELD_OFFSET(DLLVERSIONINFO, dwMajorVersion, 4) + TEST_FIELD_SIZE (DLLVERSIONINFO, dwMinorVersion, 4) + TEST_FIELD_ALIGN (DLLVERSIONINFO, dwMinorVersion, 4) + TEST_FIELD_OFFSET(DLLVERSIONINFO, dwMinorVersion, 8) + TEST_FIELD_SIZE (DLLVERSIONINFO, dwBuildNumber, 4) + TEST_FIELD_ALIGN (DLLVERSIONINFO, dwBuildNumber, 4) + TEST_FIELD_OFFSET(DLLVERSIONINFO, dwBuildNumber, 12) + TEST_FIELD_SIZE (DLLVERSIONINFO, dwPlatformID, 4) + TEST_FIELD_ALIGN (DLLVERSIONINFO, dwPlatformID, 4) + TEST_FIELD_OFFSET(DLLVERSIONINFO, dwPlatformID, 16) +} + +static void test_pack_DLLVERSIONINFO2(void) +{ + /* DLLVERSIONINFO2 (pack 8) */ + TEST_TYPE_SIZE (DLLVERSIONINFO2, 32) + TEST_TYPE_ALIGN (DLLVERSIONINFO2, 8) + TEST_FIELD_SIZE (DLLVERSIONINFO2, info1, 20) + TEST_FIELD_ALIGN (DLLVERSIONINFO2, info1, 4) + TEST_FIELD_OFFSET(DLLVERSIONINFO2, info1, 0) + TEST_FIELD_SIZE (DLLVERSIONINFO2, dwFlags, 4) + TEST_FIELD_ALIGN (DLLVERSIONINFO2, dwFlags, 4) + TEST_FIELD_OFFSET(DLLVERSIONINFO2, dwFlags, 20) + TEST_FIELD_SIZE (DLLVERSIONINFO2, ullVersion, 8) + TEST_FIELD_ALIGN (DLLVERSIONINFO2, ullVersion, 8) + TEST_FIELD_OFFSET(DLLVERSIONINFO2, ullVersion, 24) +} + +static void test_pack_HUSKEY(void) +{ + /* HUSKEY */ + TEST_TYPE_SIZE (HUSKEY, 4) + TEST_TYPE_ALIGN (HUSKEY, 4) +} + +static void test_pack_PHUSKEY(void) +{ + /* PHUSKEY */ + TEST_TYPE_SIZE (PHUSKEY, 4) + TEST_TYPE_ALIGN (PHUSKEY, 4) + TEST_TARGET_SIZE (PHUSKEY, 4) + TEST_TARGET_ALIGN(PHUSKEY, 4) +} + +static void test_pack(void) +{ + test_pack_ASSOCF(); + test_pack_DLLGETVERSIONPROC(); + test_pack_DLLVERSIONINFO(); + test_pack_DLLVERSIONINFO2(); + test_pack_HUSKEY(); + test_pack_PHUSKEY(); +} + +START_TEST(generated) +{ +#ifdef _WIN64 + ok(0, "The type size / alignment tests don't support Win64 yet\n"); +#else + test_pack(); +#endif +} diff --git a/dlls/shlwapi/tests/string.c b/dlls/shlwapi/tests/string.c index 34ab7ba9a70..df9398abceb 100644 --- a/dlls/shlwapi/tests/string.c +++ b/dlls/shlwapi/tests/string.c @@ -203,9 +203,8 @@ static void test_StrChrA(void) for (count = 32; count < 128; count++) { LPSTR result = StrChrA(string+32, count); - ok(result - string == count, - "found char '%c' in wrong place: got %d, expected %d\n", - count, result - string, count); + INT pos = result - string; + ok(pos == count, "found char '%c' in wrong place: got %d, expected %d\n", count, pos, count); } for (count = 32; count < 128; count++) @@ -340,9 +339,8 @@ static void test_StrRChrW(void) for (count = 32; count < 128; count++) { LPWSTR result = StrRChrW(string+32, NULL, count); - ok(result - string == count, - "found char %d in wrong place: got %d, expected %d\n", - count, result - string, count); + INT pos = result - string; + ok(pos == count, "found char %d in wrong place: got %d, expected %d\n", count, pos, count); } for (count = 32; count < 128; count++) diff --git a/dlls/urlmon/http.c b/dlls/urlmon/http.c index 99321effaf5..20e90edf93b 100644 --- a/dlls/urlmon/http.c +++ b/dlls/urlmon/http.c @@ -397,7 +397,7 @@ static HRESULT WINAPI HttpProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl InternetSetStatusCallbackW(This->internet, HTTPPROTOCOL_InternetStatusCallback); This->connect = InternetConnectW(This->internet, host, url.nPort, user, - pass, INTERNET_SERVICE_HTTP, 0, (DWORD)This); + pass, INTERNET_SERVICE_HTTP, 0, (DWORD_PTR)This); if (!This->connect) { WARN("InternetConnect failed: %d\n", GetLastError()); @@ -425,7 +425,7 @@ static HRESULT WINAPI HttpProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl wszBindVerb[This->bind_info.dwBindVerb] : This->bind_info.szCustomVerb, path, NULL, NULL, (LPCWSTR *)accept_mimes, - request_flags, (DWORD)This); + request_flags, (DWORD_PTR)This); if (!This->request) { WARN("HttpOpenRequest failed: %d\n", GetLastError()); diff --git a/dlls/urlmon/tests/generated.c b/dlls/urlmon/tests/generated.c index d29c226ca17..8a2f353b043 100644 --- a/dlls/urlmon/tests/generated.c +++ b/dlls/urlmon/tests/generated.c @@ -1,4 +1,4 @@ -/* File generated automatically from tools/winapi/test.dat; do not edit! */ +/* File generated automatically from tools/winapi/tests.dat; do not edit! */ /* This file can be copied, modified and distributed without restriction. */ /* @@ -31,21 +31,13 @@ */ #if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) -# define FIELD_ALIGNMENT(type, field) __alignof(((type*)0)->field) -#elif defined(__GNUC__) -# define FIELD_ALIGNMENT(type, field) __alignof__(((type*)0)->field) -#else -/* FIXME: Not sure if is possible to do without compiler extension */ -#endif - -#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) # define _TYPE_ALIGNMENT(type) __alignof(type) #elif defined(__GNUC__) # define _TYPE_ALIGNMENT(type) __alignof__(type) #else /* - * FIXME: Not sure if is possible to do without compiler extension - * (if type is not just a name that is, if so the normal) + * FIXME: May not be possible without a compiler extension + * (if type is not just a name that is, otherwise the normal * TYPE_ALIGNMENT can be used) */ #endif @@ -62,65 +54,51 @@ * Test helper macros */ -#ifdef FIELD_ALIGNMENT -# define TEST_FIELD_ALIGNMENT(type, field, align) \ - ok(FIELD_ALIGNMENT(type, field) == align, \ - "FIELD_ALIGNMENT(" #type ", " #field ") == %d (expected " #align ")\n", \ - (int)FIELD_ALIGNMENT(type, field)) -#else -# define TEST_FIELD_ALIGNMENT(type, field, align) do { } while (0) -#endif - -#define TEST_FIELD_OFFSET(type, field, offset) \ - ok(FIELD_OFFSET(type, field) == offset, \ - "FIELD_OFFSET(" #type ", " #field ") == %ld (expected " #offset ")\n", \ - (long int)FIELD_OFFSET(type, field)) +#ifdef _WIN64 -#ifdef _TYPE_ALIGNMENT -#define TEST__TYPE_ALIGNMENT(type, align) \ - ok(_TYPE_ALIGNMENT(type) == align, "TYPE_ALIGNMENT(" #type ") == %d (expected " #align ")\n", (int)_TYPE_ALIGNMENT(type)) -#else -# define TEST__TYPE_ALIGNMENT(type, align) do { } while (0) -#endif +# define TEST_TYPE_SIZE(type, size) +# define TEST_TYPE_ALIGN(type, align) +# define TEST_TARGET_ALIGN(type, align) +# define TEST_FIELD_ALIGN(type, field, align) +# define TEST_FIELD_OFFSET(type, field, offset) -#ifdef TYPE_ALIGNMENT -#define TEST_TYPE_ALIGNMENT(type, align) \ - ok(TYPE_ALIGNMENT(type) == align, "TYPE_ALIGNMENT(" #type ") == %d (expected " #align ")\n", (int)TYPE_ALIGNMENT(type)) #else -# define TEST_TYPE_ALIGNMENT(type, align) do { } while (0) -#endif -#define TEST_TYPE_SIZE(type, size) \ - ok(sizeof(type) == size, "sizeof(" #type ") == %d (expected " #size ")\n", ((int) sizeof(type))) +# define TEST_TYPE_SIZE(type, size) C_ASSERT(sizeof(type) == size); -/*********************************************************************** - * Test macros - */ +# ifdef TYPE_ALIGNMENT +# define TEST_TYPE_ALIGN(type, align) C_ASSERT(TYPE_ALIGNMENT(type) == align); +# else +# define TEST_TYPE_ALIGN(type, align) +# endif -#define TEST_FIELD(type, field_type, field_name, field_offset, field_size, field_align) \ - TEST_TYPE_SIZE(field_type, field_size); \ - TEST_FIELD_ALIGNMENT(type, field_name, field_align); \ - TEST_FIELD_OFFSET(type, field_name, field_offset); \ +# ifdef _TYPE_ALIGNMENT +# define TEST_TARGET_ALIGN(type, align) C_ASSERT(_TYPE_ALIGNMENT(*(type)0) == align); +# define TEST_FIELD_ALIGN(type, field, align) C_ASSERT(_TYPE_ALIGNMENT(((type*)0)->field) == align); +# else +# define TEST_TARGET_ALIGN(type, align) +# define TEST_FIELD_ALIGN(type, field, align) +# endif -#define TEST_TYPE(type, size, align) \ - TEST_TYPE_ALIGNMENT(type, align); \ - TEST_TYPE_SIZE(type, size) +# define TEST_FIELD_OFFSET(type, field, offset) C_ASSERT(FIELD_OFFSET(type, field) == offset); -#define TEST_TYPE_POINTER(type, size, align) \ - TEST__TYPE_ALIGNMENT(*(type)0, align); \ - TEST_TYPE_SIZE(*(type)0, size) +#endif -#define TEST_TYPE_SIGNED(type) \ - ok((type) -1 < 0, "(" #type ") -1 < 0\n"); +#define TEST_TARGET_SIZE(type, size) TEST_TYPE_SIZE(*(type)0, size) +#define TEST_FIELD_SIZE(type, field, size) TEST_TYPE_SIZE((((type*)0)->field), size) +#define TEST_TYPE_SIGNED(type) C_ASSERT((type) -1 < 0); +#define TEST_TYPE_UNSIGNED(type) C_ASSERT((type) -1 > 0); -#define TEST_TYPE_UNSIGNED(type) \ - ok((type) -1 > 0, "(" #type ") -1 > 0\n"); static void test_pack_BINDINFO(void) { /* BINDINFO (pack 4) */ - TEST_FIELD(BINDINFO, ULONG, cbSize, 0, 4, 4); - TEST_FIELD(BINDINFO, LPWSTR, szExtraInfo, 4, 4, 4); + TEST_FIELD_SIZE (BINDINFO, cbSize, 4) + TEST_FIELD_ALIGN (BINDINFO, cbSize, 4) + TEST_FIELD_OFFSET(BINDINFO, cbSize, 0) + TEST_FIELD_SIZE (BINDINFO, szExtraInfo, 4) + TEST_FIELD_ALIGN (BINDINFO, szExtraInfo, 4) + TEST_FIELD_OFFSET(BINDINFO, szExtraInfo, 4) } static void test_pack_IBindHost(void) @@ -206,106 +184,162 @@ static void test_pack_IWinInetInfoVtbl(void) static void test_pack_LPBINDHOST(void) { /* LPBINDHOST */ - TEST_TYPE(LPBINDHOST, 4, 4); + TEST_TYPE_SIZE (LPBINDHOST, 4) + TEST_TYPE_ALIGN (LPBINDHOST, 4) } static void test_pack_LPBINDING(void) { /* LPBINDING */ - TEST_TYPE(LPBINDING, 4, 4); + TEST_TYPE_SIZE (LPBINDING, 4) + TEST_TYPE_ALIGN (LPBINDING, 4) } static void test_pack_LPBINDSTATUSCALLBACK(void) { /* LPBINDSTATUSCALLBACK */ - TEST_TYPE(LPBINDSTATUSCALLBACK, 4, 4); + TEST_TYPE_SIZE (LPBINDSTATUSCALLBACK, 4) + TEST_TYPE_ALIGN (LPBINDSTATUSCALLBACK, 4) } static void test_pack_LPIINTERNETPROTOCOLINFO(void) { /* LPIINTERNETPROTOCOLINFO */ - TEST_TYPE(LPIINTERNETPROTOCOLINFO, 4, 4); + TEST_TYPE_SIZE (LPIINTERNETPROTOCOLINFO, 4) + TEST_TYPE_ALIGN (LPIINTERNETPROTOCOLINFO, 4) } static void test_pack_LPIINTERNETSESSION(void) { /* LPIINTERNETSESSION */ - TEST_TYPE(LPIINTERNETSESSION, 4, 4); + TEST_TYPE_SIZE (LPIINTERNETSESSION, 4) + TEST_TYPE_ALIGN (LPIINTERNETSESSION, 4) } static void test_pack_LPPERSISTMONIKER(void) { /* LPPERSISTMONIKER */ - TEST_TYPE(LPPERSISTMONIKER, 4, 4); + TEST_TYPE_SIZE (LPPERSISTMONIKER, 4) + TEST_TYPE_ALIGN (LPPERSISTMONIKER, 4) } static void test_pack_LPREMFORMATETC(void) { /* LPREMFORMATETC */ - TEST_TYPE(LPREMFORMATETC, 4, 4); + TEST_TYPE_SIZE (LPREMFORMATETC, 4) + TEST_TYPE_ALIGN (LPREMFORMATETC, 4) } static void test_pack_LPREMSECURITY_ATTRIBUTES(void) { /* LPREMSECURITY_ATTRIBUTES */ - TEST_TYPE(LPREMSECURITY_ATTRIBUTES, 4, 4); + TEST_TYPE_SIZE (LPREMSECURITY_ATTRIBUTES, 4) + TEST_TYPE_ALIGN (LPREMSECURITY_ATTRIBUTES, 4) } static void test_pack_LPWININETHTTPINFO(void) { /* LPWININETHTTPINFO */ - TEST_TYPE(LPWININETHTTPINFO, 4, 4); + TEST_TYPE_SIZE (LPWININETHTTPINFO, 4) + TEST_TYPE_ALIGN (LPWININETHTTPINFO, 4) } static void test_pack_LPWININETINFO(void) { /* LPWININETINFO */ - TEST_TYPE(LPWININETINFO, 4, 4); + TEST_TYPE_SIZE (LPWININETINFO, 4) + TEST_TYPE_ALIGN (LPWININETINFO, 4) } static void test_pack_PREMSECURITY_ATTRIBUTES(void) { /* PREMSECURITY_ATTRIBUTES */ - TEST_TYPE(PREMSECURITY_ATTRIBUTES, 4, 4); + TEST_TYPE_SIZE (PREMSECURITY_ATTRIBUTES, 4) + TEST_TYPE_ALIGN (PREMSECURITY_ATTRIBUTES, 4) } static void test_pack_REMSECURITY_ATTRIBUTES(void) { /* REMSECURITY_ATTRIBUTES (pack 4) */ - TEST_TYPE(REMSECURITY_ATTRIBUTES, 12, 4); - TEST_FIELD(REMSECURITY_ATTRIBUTES, DWORD, nLength, 0, 4, 4); - TEST_FIELD(REMSECURITY_ATTRIBUTES, DWORD, lpSecurityDescriptor, 4, 4, 4); - TEST_FIELD(REMSECURITY_ATTRIBUTES, BOOL, bInheritHandle, 8, 4, 4); + TEST_TYPE_SIZE (REMSECURITY_ATTRIBUTES, 12) + TEST_TYPE_ALIGN (REMSECURITY_ATTRIBUTES, 4) + TEST_FIELD_SIZE (REMSECURITY_ATTRIBUTES, nLength, 4) + TEST_FIELD_ALIGN (REMSECURITY_ATTRIBUTES, nLength, 4) + TEST_FIELD_OFFSET(REMSECURITY_ATTRIBUTES, nLength, 0) + TEST_FIELD_SIZE (REMSECURITY_ATTRIBUTES, lpSecurityDescriptor, 4) + TEST_FIELD_ALIGN (REMSECURITY_ATTRIBUTES, lpSecurityDescriptor, 4) + TEST_FIELD_OFFSET(REMSECURITY_ATTRIBUTES, lpSecurityDescriptor, 4) + TEST_FIELD_SIZE (REMSECURITY_ATTRIBUTES, bInheritHandle, 4) + TEST_FIELD_ALIGN (REMSECURITY_ATTRIBUTES, bInheritHandle, 4) + TEST_FIELD_OFFSET(REMSECURITY_ATTRIBUTES, bInheritHandle, 8) } static void test_pack_RemBINDINFO(void) { /* RemBINDINFO (pack 4) */ - TEST_TYPE(RemBINDINFO, 72, 4); - TEST_FIELD(RemBINDINFO, ULONG, cbSize, 0, 4, 4); - TEST_FIELD(RemBINDINFO, LPWSTR, szExtraInfo, 4, 4, 4); - TEST_FIELD(RemBINDINFO, DWORD, grfBindInfoF, 8, 4, 4); - TEST_FIELD(RemBINDINFO, DWORD, dwBindVerb, 12, 4, 4); - TEST_FIELD(RemBINDINFO, LPWSTR, szCustomVerb, 16, 4, 4); - TEST_FIELD(RemBINDINFO, DWORD, cbstgmedData, 20, 4, 4); - TEST_FIELD(RemBINDINFO, DWORD, dwOptions, 24, 4, 4); - TEST_FIELD(RemBINDINFO, DWORD, dwOptionsFlags, 28, 4, 4); - TEST_FIELD(RemBINDINFO, DWORD, dwCodePage, 32, 4, 4); - TEST_FIELD(RemBINDINFO, REMSECURITY_ATTRIBUTES, securityAttributes, 36, 12, 4); - TEST_FIELD(RemBINDINFO, IID, iid, 48, 16, 4); - TEST_FIELD(RemBINDINFO, IUnknown *, pUnk, 64, 4, 4); - TEST_FIELD(RemBINDINFO, DWORD, dwReserved, 68, 4, 4); + TEST_TYPE_SIZE (RemBINDINFO, 72) + TEST_TYPE_ALIGN (RemBINDINFO, 4) + TEST_FIELD_SIZE (RemBINDINFO, cbSize, 4) + TEST_FIELD_ALIGN (RemBINDINFO, cbSize, 4) + TEST_FIELD_OFFSET(RemBINDINFO, cbSize, 0) + TEST_FIELD_SIZE (RemBINDINFO, szExtraInfo, 4) + TEST_FIELD_ALIGN (RemBINDINFO, szExtraInfo, 4) + TEST_FIELD_OFFSET(RemBINDINFO, szExtraInfo, 4) + TEST_FIELD_SIZE (RemBINDINFO, grfBindInfoF, 4) + TEST_FIELD_ALIGN (RemBINDINFO, grfBindInfoF, 4) + TEST_FIELD_OFFSET(RemBINDINFO, grfBindInfoF, 8) + TEST_FIELD_SIZE (RemBINDINFO, dwBindVerb, 4) + TEST_FIELD_ALIGN (RemBINDINFO, dwBindVerb, 4) + TEST_FIELD_OFFSET(RemBINDINFO, dwBindVerb, 12) + TEST_FIELD_SIZE (RemBINDINFO, szCustomVerb, 4) + TEST_FIELD_ALIGN (RemBINDINFO, szCustomVerb, 4) + TEST_FIELD_OFFSET(RemBINDINFO, szCustomVerb, 16) + TEST_FIELD_SIZE (RemBINDINFO, cbstgmedData, 4) + TEST_FIELD_ALIGN (RemBINDINFO, cbstgmedData, 4) + TEST_FIELD_OFFSET(RemBINDINFO, cbstgmedData, 20) + TEST_FIELD_SIZE (RemBINDINFO, dwOptions, 4) + TEST_FIELD_ALIGN (RemBINDINFO, dwOptions, 4) + TEST_FIELD_OFFSET(RemBINDINFO, dwOptions, 24) + TEST_FIELD_SIZE (RemBINDINFO, dwOptionsFlags, 4) + TEST_FIELD_ALIGN (RemBINDINFO, dwOptionsFlags, 4) + TEST_FIELD_OFFSET(RemBINDINFO, dwOptionsFlags, 28) + TEST_FIELD_SIZE (RemBINDINFO, dwCodePage, 4) + TEST_FIELD_ALIGN (RemBINDINFO, dwCodePage, 4) + TEST_FIELD_OFFSET(RemBINDINFO, dwCodePage, 32) + TEST_FIELD_SIZE (RemBINDINFO, securityAttributes, 12) + TEST_FIELD_ALIGN (RemBINDINFO, securityAttributes, 4) + TEST_FIELD_OFFSET(RemBINDINFO, securityAttributes, 36) + TEST_FIELD_SIZE (RemBINDINFO, iid, 16) + TEST_FIELD_ALIGN (RemBINDINFO, iid, 4) + TEST_FIELD_OFFSET(RemBINDINFO, iid, 48) + TEST_FIELD_SIZE (RemBINDINFO, pUnk, 4) + TEST_FIELD_ALIGN (RemBINDINFO, pUnk, 4) + TEST_FIELD_OFFSET(RemBINDINFO, pUnk, 64) + TEST_FIELD_SIZE (RemBINDINFO, dwReserved, 4) + TEST_FIELD_ALIGN (RemBINDINFO, dwReserved, 4) + TEST_FIELD_OFFSET(RemBINDINFO, dwReserved, 68) } static void test_pack_RemFORMATETC(void) { /* RemFORMATETC (pack 4) */ - TEST_TYPE(RemFORMATETC, 20, 4); - TEST_FIELD(RemFORMATETC, DWORD, cfFormat, 0, 4, 4); - TEST_FIELD(RemFORMATETC, DWORD, ptd, 4, 4, 4); - TEST_FIELD(RemFORMATETC, DWORD, dwAspect, 8, 4, 4); - TEST_FIELD(RemFORMATETC, LONG, lindex, 12, 4, 4); - TEST_FIELD(RemFORMATETC, DWORD, tymed, 16, 4, 4); + TEST_TYPE_SIZE (RemFORMATETC, 20) + TEST_TYPE_ALIGN (RemFORMATETC, 4) + TEST_FIELD_SIZE (RemFORMATETC, cfFormat, 4) + TEST_FIELD_ALIGN (RemFORMATETC, cfFormat, 4) + TEST_FIELD_OFFSET(RemFORMATETC, cfFormat, 0) + TEST_FIELD_SIZE (RemFORMATETC, ptd, 4) + TEST_FIELD_ALIGN (RemFORMATETC, ptd, 4) + TEST_FIELD_OFFSET(RemFORMATETC, ptd, 4) + TEST_FIELD_SIZE (RemFORMATETC, dwAspect, 4) + TEST_FIELD_ALIGN (RemFORMATETC, dwAspect, 4) + TEST_FIELD_OFFSET(RemFORMATETC, dwAspect, 8) + TEST_FIELD_SIZE (RemFORMATETC, lindex, 4) + TEST_FIELD_ALIGN (RemFORMATETC, lindex, 4) + TEST_FIELD_OFFSET(RemFORMATETC, lindex, 12) + TEST_FIELD_SIZE (RemFORMATETC, tymed, 4) + TEST_FIELD_ALIGN (RemFORMATETC, tymed, 4) + TEST_FIELD_OFFSET(RemFORMATETC, tymed, 16) } static void test_pack(void) @@ -345,5 +379,9 @@ static void test_pack(void) START_TEST(generated) { +#ifdef _WIN64 + ok(0, "The type size / alignment tests don't support Win64 yet\n"); +#else test_pack(); +#endif } diff --git a/dlls/urlmon/umon.c b/dlls/urlmon/umon.c index 860c386dfde..01266ddfbd1 100644 --- a/dlls/urlmon/umon.c +++ b/dlls/urlmon/umon.c @@ -606,7 +606,7 @@ static HRESULT URLMonikerImpl_BindToStorage_hack(LPCWSTR URLName, IBindCtx* pbc, } bind->hconnect = InternetConnectW(bind->hinternet, host, url.nPort, user, pass, - dwService, 0, (DWORD)bind); + dwService, 0, (DWORD_PTR)bind); if (!bind->hconnect) { hres = HRESULT_FROM_WIN32(GetLastError()); @@ -650,7 +650,7 @@ static HRESULT URLMonikerImpl_BindToStorage_hack(LPCWSTR URLName, IBindCtx* pbc, break; case INTERNET_SERVICE_HTTP: - bind->hrequest = HttpOpenRequestW(bind->hconnect, NULL, path, NULL, NULL, NULL, 0, (DWORD)bind); + bind->hrequest = HttpOpenRequestW(bind->hconnect, NULL, path, NULL, NULL, NULL, 0, (DWORD_PTR)bind); if (!bind->hrequest) { hres = HRESULT_FROM_WIN32(GetLastError()); diff --git a/dlls/user32/dialog16.c b/dlls/user32/dialog16.c index 4fcbef41a30..e529b2da6c4 100644 --- a/dlls/user32/dialog16.c +++ b/dlls/user32/dialog16.c @@ -768,8 +768,8 @@ HWND16 WINAPI CreateDialogParam16( HINSTANCE16 hInst, LPCSTR dlgTemplate, HGLOBAL16 hmem; LPCVOID data; - TRACE("%04x,%s,%04x,%08x,%ld\n", - hInst, debugstr_a(dlgTemplate), owner, (DWORD)dlgProc, param ); + TRACE("%04x,%s,%04x,%p,%ld\n", + hInst, debugstr_a(dlgTemplate), owner, dlgProc, param ); if (!(hRsrc = FindResource16( hInst, dlgTemplate, (LPSTR)RT_DIALOG ))) return 0; if (!(hmem = LoadResource16( hInst, hRsrc ))) return 0; diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c index 92dc912eab5..8ecfed42a58 100644 --- a/dlls/user32/sysparams.c +++ b/dlls/user32/sysparams.c @@ -2394,7 +2394,7 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam, SPI_SETFONTSMOOTHINGTYPE_VALNAME, (LPBYTE)&pvParam, sizeof(UINT), REG_DWORD, fWinIni )) { - font_smoothing_type = (UINT)pvParam; + font_smoothing_type = PtrToUlong(pvParam); spi_loaded[spi_idx] = TRUE; } else @@ -2424,7 +2424,7 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam, SPI_SETFONTSMOOTHINGCONTRAST_VALNAME, (LPBYTE)&pvParam, sizeof(UINT), REG_DWORD, fWinIni )) { - font_smoothing_contrast = (UINT)pvParam; + font_smoothing_contrast = PtrToUlong(pvParam); spi_loaded[spi_idx] = TRUE; } else @@ -2458,7 +2458,7 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam, SPI_SETFONTSMOOTHINGORIENTATION_VALNAME, (LPBYTE)&pvParam, sizeof(UINT), REG_DWORD, fWinIni )) { - font_smoothing_orientation = (UINT)pvParam; + font_smoothing_orientation = PtrToUlong(pvParam); spi_loaded[spi_idx] = TRUE; } else diff --git a/dlls/user32/tests/dialog.c b/dlls/user32/tests/dialog.c index f92566c16b4..3f07bd3efc2 100644 --- a/dlls/user32/tests/dialog.c +++ b/dlls/user32/tests/dialog.c @@ -54,7 +54,7 @@ static BOOL g_bInitialFocusInitDlgResult; static int g_terminated; typedef struct { - unsigned int id; + INT_PTR id; int parent; DWORD style; DWORD exstyle; @@ -160,7 +160,7 @@ static BOOL CreateWindows (HINSTANCE hinst) { if (p->id >= sizeof(hwnd)/sizeof(hwnd[0])) { - trace ("Control %d is out of range\n", p->id); + trace ("Control %ld is out of range\n", p->id); return FALSE; } else @@ -168,21 +168,21 @@ static BOOL CreateWindows (HINSTANCE hinst) } if (p->id <= 0) { - trace ("Control %d is out of range\n", p->id); + trace ("Control %ld is out of range\n", p->id); return FALSE; } if (hwnd[p->id] != 0) { - trace ("Control %d is used more than once\n", p->id); + trace ("Control %ld is used more than once\n", p->id); return FALSE; } /* Create the control */ - sprintf (ctrlname, "ctrl%4.4d", p->id); + sprintf (ctrlname, "ctrl%4.4ld", p->id); hwnd[p->id] = CreateWindowEx (p->exstyle, TEXT(p->parent ? "static" : "GetNextDlgItemWindowClass"), TEXT(ctrlname), p->style, 10, 10, 10, 10, hwnd[p->parent], p->parent ? (HMENU) (2000 + p->id) : 0, hinst, 0); if (!hwnd[p->id]) { - trace ("Failed to create control %d\n", p->id); + trace ("Failed to create control %ld\n", p->id); return FALSE; } @@ -196,7 +196,7 @@ static BOOL CreateWindows (HINSTANCE hinst) exstyle = GetWindowLong (hwnd[p->id], GWL_EXSTYLE); if (style != p->style || exstyle != p->exstyle) { - trace ("Style mismatch at %d: %8.8x %8.8x cf %8.8x %8.8x\n", p->id, style, exstyle, p->style, p->exstyle); + trace ("Style mismatch at %ld: %8.8x %8.8x cf %8.8x %8.8x\n", p->id, style, exstyle, p->style, p->exstyle); } } p++; diff --git a/dlls/user32/tests/generated.c b/dlls/user32/tests/generated.c dissimilarity index 62% index c2d24f913ff..d25de8fddd1 100644 --- a/dlls/user32/tests/generated.c +++ b/dlls/user32/tests/generated.c @@ -1,2481 +1,3843 @@ -/* File generated automatically from tools/winapi/test.dat; do not edit! */ -/* This file can be copied, modified and distributed without restriction. */ - -/* - * Unit tests for data structure packing - */ - -#define WINVER 0x0501 -#define _WIN32_IE 0x0501 -#define _WIN32_WINNT 0x0501 - -#define WINE_NOWINSOCK - -#include "windows.h" - -#include "wine/test.h" - -/*********************************************************************** - * Compatibility macros - */ - -#define DWORD_PTR UINT_PTR -#define LONG_PTR INT_PTR -#define ULONG_PTR UINT_PTR - -/*********************************************************************** - * Windows API extension - */ - -#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) -# define FIELD_ALIGNMENT(type, field) __alignof(((type*)0)->field) -#elif defined(__GNUC__) -# define FIELD_ALIGNMENT(type, field) __alignof__(((type*)0)->field) -#else -/* FIXME: Not sure if is possible to do without compiler extension */ -#endif - -#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) -# define _TYPE_ALIGNMENT(type) __alignof(type) -#elif defined(__GNUC__) -# define _TYPE_ALIGNMENT(type) __alignof__(type) -#else -/* - * FIXME: Not sure if is possible to do without compiler extension - * (if type is not just a name that is, if so the normal) - * TYPE_ALIGNMENT can be used) - */ -#endif - -#if defined(TYPE_ALIGNMENT) && defined(_MSC_VER) && _MSC_VER >= 800 && !defined(__cplusplus) -#pragma warning(disable:4116) -#endif - -#if !defined(TYPE_ALIGNMENT) && defined(_TYPE_ALIGNMENT) -# define TYPE_ALIGNMENT _TYPE_ALIGNMENT -#endif - -/*********************************************************************** - * Test helper macros - */ - -#ifdef FIELD_ALIGNMENT -# define TEST_FIELD_ALIGNMENT(type, field, align) \ - ok(FIELD_ALIGNMENT(type, field) == align, \ - "FIELD_ALIGNMENT(" #type ", " #field ") == %d (expected " #align ")\n", \ - (int)FIELD_ALIGNMENT(type, field)) -#else -# define TEST_FIELD_ALIGNMENT(type, field, align) do { } while (0) -#endif - -#define TEST_FIELD_OFFSET(type, field, offset) \ - ok(FIELD_OFFSET(type, field) == offset, \ - "FIELD_OFFSET(" #type ", " #field ") == %ld (expected " #offset ")\n", \ - (long int)FIELD_OFFSET(type, field)) - -#ifdef _TYPE_ALIGNMENT -#define TEST__TYPE_ALIGNMENT(type, align) \ - ok(_TYPE_ALIGNMENT(type) == align, "TYPE_ALIGNMENT(" #type ") == %d (expected " #align ")\n", (int)_TYPE_ALIGNMENT(type)) -#else -# define TEST__TYPE_ALIGNMENT(type, align) do { } while (0) -#endif - -#ifdef TYPE_ALIGNMENT -#define TEST_TYPE_ALIGNMENT(type, align) \ - ok(TYPE_ALIGNMENT(type) == align, "TYPE_ALIGNMENT(" #type ") == %d (expected " #align ")\n", (int)TYPE_ALIGNMENT(type)) -#else -# define TEST_TYPE_ALIGNMENT(type, align) do { } while (0) -#endif - -#define TEST_TYPE_SIZE(type, size) \ - ok(sizeof(type) == size, "sizeof(" #type ") == %d (expected " #size ")\n", ((int) sizeof(type))) - -/*********************************************************************** - * Test macros - */ - -#define TEST_FIELD(type, field_type, field_name, field_offset, field_size, field_align) \ - TEST_TYPE_SIZE(field_type, field_size); \ - TEST_FIELD_ALIGNMENT(type, field_name, field_align); \ - TEST_FIELD_OFFSET(type, field_name, field_offset); \ - -#define TEST_TYPE(type, size, align) \ - TEST_TYPE_ALIGNMENT(type, align); \ - TEST_TYPE_SIZE(type, size) - -#define TEST_TYPE_POINTER(type, size, align) \ - TEST__TYPE_ALIGNMENT(*(type)0, align); \ - TEST_TYPE_SIZE(*(type)0, size) - -#define TEST_TYPE_SIGNED(type) \ - ok((type) -1 < 0, "(" #type ") -1 < 0\n"); - -#define TEST_TYPE_UNSIGNED(type) \ - ok((type) -1 > 0, "(" #type ") -1 > 0\n"); - -static void test_pack_ACCESSTIMEOUT(void) -{ - /* ACCESSTIMEOUT (pack 4) */ - TEST_TYPE(ACCESSTIMEOUT, 12, 4); - TEST_FIELD(ACCESSTIMEOUT, UINT, cbSize, 0, 4, 4); - TEST_FIELD(ACCESSTIMEOUT, DWORD, dwFlags, 4, 4, 4); - TEST_FIELD(ACCESSTIMEOUT, DWORD, iTimeOutMSec, 8, 4, 4); -} - -static void test_pack_ANIMATIONINFO(void) -{ - /* ANIMATIONINFO (pack 4) */ - TEST_TYPE(ANIMATIONINFO, 8, 4); - TEST_FIELD(ANIMATIONINFO, UINT, cbSize, 0, 4, 4); - TEST_FIELD(ANIMATIONINFO, INT, iMinAnimate, 4, 4, 4); -} - -static void test_pack_CBTACTIVATESTRUCT(void) -{ - /* CBTACTIVATESTRUCT (pack 4) */ - TEST_TYPE(CBTACTIVATESTRUCT, 8, 4); - TEST_FIELD(CBTACTIVATESTRUCT, BOOL, fMouse, 0, 4, 4); - TEST_FIELD(CBTACTIVATESTRUCT, HWND, hWndActive, 4, 4, 4); -} - -static void test_pack_CBT_CREATEWNDA(void) -{ - /* CBT_CREATEWNDA (pack 4) */ - TEST_TYPE(CBT_CREATEWNDA, 8, 4); - TEST_FIELD(CBT_CREATEWNDA, CREATESTRUCTA *, lpcs, 0, 4, 4); - TEST_FIELD(CBT_CREATEWNDA, HWND, hwndInsertAfter, 4, 4, 4); -} - -static void test_pack_CBT_CREATEWNDW(void) -{ - /* CBT_CREATEWNDW (pack 4) */ - TEST_TYPE(CBT_CREATEWNDW, 8, 4); - TEST_FIELD(CBT_CREATEWNDW, CREATESTRUCTW *, lpcs, 0, 4, 4); - TEST_FIELD(CBT_CREATEWNDW, HWND, hwndInsertAfter, 4, 4, 4); -} - -static void test_pack_CLIENTCREATESTRUCT(void) -{ - /* CLIENTCREATESTRUCT (pack 4) */ - TEST_TYPE(CLIENTCREATESTRUCT, 8, 4); - TEST_FIELD(CLIENTCREATESTRUCT, HMENU, hWindowMenu, 0, 4, 4); - TEST_FIELD(CLIENTCREATESTRUCT, UINT, idFirstChild, 4, 4, 4); -} - -static void test_pack_COMBOBOXINFO(void) -{ - /* COMBOBOXINFO (pack 4) */ - TEST_TYPE(COMBOBOXINFO, 52, 4); - TEST_FIELD(COMBOBOXINFO, DWORD, cbSize, 0, 4, 4); - TEST_FIELD(COMBOBOXINFO, RECT, rcItem, 4, 16, 4); - TEST_FIELD(COMBOBOXINFO, RECT, rcButton, 20, 16, 4); - TEST_FIELD(COMBOBOXINFO, DWORD, stateButton, 36, 4, 4); - TEST_FIELD(COMBOBOXINFO, HWND, hwndCombo, 40, 4, 4); - TEST_FIELD(COMBOBOXINFO, HWND, hwndItem, 44, 4, 4); - TEST_FIELD(COMBOBOXINFO, HWND, hwndList, 48, 4, 4); -} - -static void test_pack_COMPAREITEMSTRUCT(void) -{ - /* COMPAREITEMSTRUCT (pack 4) */ - TEST_TYPE(COMPAREITEMSTRUCT, 32, 4); - TEST_FIELD(COMPAREITEMSTRUCT, UINT, CtlType, 0, 4, 4); - TEST_FIELD(COMPAREITEMSTRUCT, UINT, CtlID, 4, 4, 4); - TEST_FIELD(COMPAREITEMSTRUCT, HWND, hwndItem, 8, 4, 4); - TEST_FIELD(COMPAREITEMSTRUCT, UINT, itemID1, 12, 4, 4); - TEST_FIELD(COMPAREITEMSTRUCT, ULONG_PTR, itemData1, 16, 4, 4); - TEST_FIELD(COMPAREITEMSTRUCT, UINT, itemID2, 20, 4, 4); - TEST_FIELD(COMPAREITEMSTRUCT, ULONG_PTR, itemData2, 24, 4, 4); - TEST_FIELD(COMPAREITEMSTRUCT, DWORD, dwLocaleId, 28, 4, 4); -} - -static void test_pack_COPYDATASTRUCT(void) -{ - /* COPYDATASTRUCT (pack 4) */ - TEST_TYPE(COPYDATASTRUCT, 12, 4); - TEST_FIELD(COPYDATASTRUCT, ULONG_PTR, dwData, 0, 4, 4); - TEST_FIELD(COPYDATASTRUCT, DWORD, cbData, 4, 4, 4); - TEST_FIELD(COPYDATASTRUCT, PVOID, lpData, 8, 4, 4); -} - -static void test_pack_CREATESTRUCTA(void) -{ - /* CREATESTRUCTA (pack 4) */ - TEST_TYPE(CREATESTRUCTA, 48, 4); - TEST_FIELD(CREATESTRUCTA, LPVOID, lpCreateParams, 0, 4, 4); - TEST_FIELD(CREATESTRUCTA, HINSTANCE, hInstance, 4, 4, 4); - TEST_FIELD(CREATESTRUCTA, HMENU, hMenu, 8, 4, 4); - TEST_FIELD(CREATESTRUCTA, HWND, hwndParent, 12, 4, 4); - TEST_FIELD(CREATESTRUCTA, INT, cy, 16, 4, 4); - TEST_FIELD(CREATESTRUCTA, INT, cx, 20, 4, 4); - TEST_FIELD(CREATESTRUCTA, INT, y, 24, 4, 4); - TEST_FIELD(CREATESTRUCTA, INT, x, 28, 4, 4); - TEST_FIELD(CREATESTRUCTA, LONG, style, 32, 4, 4); - TEST_FIELD(CREATESTRUCTA, LPCSTR, lpszName, 36, 4, 4); - TEST_FIELD(CREATESTRUCTA, LPCSTR, lpszClass, 40, 4, 4); - TEST_FIELD(CREATESTRUCTA, DWORD, dwExStyle, 44, 4, 4); -} - -static void test_pack_CREATESTRUCTW(void) -{ - /* CREATESTRUCTW (pack 4) */ - TEST_TYPE(CREATESTRUCTW, 48, 4); - TEST_FIELD(CREATESTRUCTW, LPVOID, lpCreateParams, 0, 4, 4); - TEST_FIELD(CREATESTRUCTW, HINSTANCE, hInstance, 4, 4, 4); - TEST_FIELD(CREATESTRUCTW, HMENU, hMenu, 8, 4, 4); - TEST_FIELD(CREATESTRUCTW, HWND, hwndParent, 12, 4, 4); - TEST_FIELD(CREATESTRUCTW, INT, cy, 16, 4, 4); - TEST_FIELD(CREATESTRUCTW, INT, cx, 20, 4, 4); - TEST_FIELD(CREATESTRUCTW, INT, y, 24, 4, 4); - TEST_FIELD(CREATESTRUCTW, INT, x, 28, 4, 4); - TEST_FIELD(CREATESTRUCTW, LONG, style, 32, 4, 4); - TEST_FIELD(CREATESTRUCTW, LPCWSTR, lpszName, 36, 4, 4); - TEST_FIELD(CREATESTRUCTW, LPCWSTR, lpszClass, 40, 4, 4); - TEST_FIELD(CREATESTRUCTW, DWORD, dwExStyle, 44, 4, 4); -} - -static void test_pack_CURSORINFO(void) -{ - /* CURSORINFO (pack 4) */ - TEST_TYPE(CURSORINFO, 20, 4); - TEST_FIELD(CURSORINFO, DWORD, cbSize, 0, 4, 4); - TEST_FIELD(CURSORINFO, DWORD, flags, 4, 4, 4); - TEST_FIELD(CURSORINFO, HCURSOR, hCursor, 8, 4, 4); - TEST_FIELD(CURSORINFO, POINT, ptScreenPos, 12, 8, 4); -} - -static void test_pack_CWPRETSTRUCT(void) -{ - /* CWPRETSTRUCT (pack 4) */ - TEST_TYPE(CWPRETSTRUCT, 20, 4); - TEST_FIELD(CWPRETSTRUCT, LRESULT, lResult, 0, 4, 4); - TEST_FIELD(CWPRETSTRUCT, LPARAM, lParam, 4, 4, 4); - TEST_FIELD(CWPRETSTRUCT, WPARAM, wParam, 8, 4, 4); - TEST_FIELD(CWPRETSTRUCT, DWORD, message, 12, 4, 4); - TEST_FIELD(CWPRETSTRUCT, HWND, hwnd, 16, 4, 4); -} - -static void test_pack_CWPSTRUCT(void) -{ - /* CWPSTRUCT (pack 4) */ - TEST_TYPE(CWPSTRUCT, 16, 4); - TEST_FIELD(CWPSTRUCT, LPARAM, lParam, 0, 4, 4); - TEST_FIELD(CWPSTRUCT, WPARAM, wParam, 4, 4, 4); - TEST_FIELD(CWPSTRUCT, UINT, message, 8, 4, 4); - TEST_FIELD(CWPSTRUCT, HWND, hwnd, 12, 4, 4); -} - -static void test_pack_DEBUGHOOKINFO(void) -{ - /* DEBUGHOOKINFO (pack 4) */ - TEST_TYPE(DEBUGHOOKINFO, 20, 4); - TEST_FIELD(DEBUGHOOKINFO, DWORD, idThread, 0, 4, 4); - TEST_FIELD(DEBUGHOOKINFO, DWORD, idThreadInstaller, 4, 4, 4); - TEST_FIELD(DEBUGHOOKINFO, LPARAM, lParam, 8, 4, 4); - TEST_FIELD(DEBUGHOOKINFO, WPARAM, wParam, 12, 4, 4); - TEST_FIELD(DEBUGHOOKINFO, INT, code, 16, 4, 4); -} - -static void test_pack_DELETEITEMSTRUCT(void) -{ - /* DELETEITEMSTRUCT (pack 4) */ - TEST_TYPE(DELETEITEMSTRUCT, 20, 4); - TEST_FIELD(DELETEITEMSTRUCT, UINT, CtlType, 0, 4, 4); - TEST_FIELD(DELETEITEMSTRUCT, UINT, CtlID, 4, 4, 4); - TEST_FIELD(DELETEITEMSTRUCT, UINT, itemID, 8, 4, 4); - TEST_FIELD(DELETEITEMSTRUCT, HWND, hwndItem, 12, 4, 4); - TEST_FIELD(DELETEITEMSTRUCT, ULONG_PTR, itemData, 16, 4, 4); -} - -static void test_pack_DESKTOPENUMPROCA(void) -{ - /* DESKTOPENUMPROCA */ - TEST_TYPE(DESKTOPENUMPROCA, 4, 4); -} - -static void test_pack_DESKTOPENUMPROCW(void) -{ - /* DESKTOPENUMPROCW */ - TEST_TYPE(DESKTOPENUMPROCW, 4, 4); -} - -static void test_pack_DLGITEMTEMPLATE(void) -{ - /* DLGITEMTEMPLATE (pack 2) */ - TEST_TYPE(DLGITEMTEMPLATE, 18, 2); - TEST_FIELD(DLGITEMTEMPLATE, DWORD, style, 0, 4, 2); - TEST_FIELD(DLGITEMTEMPLATE, DWORD, dwExtendedStyle, 4, 4, 2); - TEST_FIELD(DLGITEMTEMPLATE, short, x, 8, 2, 2); - TEST_FIELD(DLGITEMTEMPLATE, short, y, 10, 2, 2); - TEST_FIELD(DLGITEMTEMPLATE, short, cx, 12, 2, 2); - TEST_FIELD(DLGITEMTEMPLATE, short, cy, 14, 2, 2); - TEST_FIELD(DLGITEMTEMPLATE, WORD, id, 16, 2, 2); -} - -static void test_pack_DLGPROC(void) -{ - /* DLGPROC */ - TEST_TYPE(DLGPROC, 4, 4); -} - -static void test_pack_DLGTEMPLATE(void) -{ - /* DLGTEMPLATE (pack 2) */ - TEST_TYPE(DLGTEMPLATE, 18, 2); - TEST_FIELD(DLGTEMPLATE, DWORD, style, 0, 4, 2); - TEST_FIELD(DLGTEMPLATE, DWORD, dwExtendedStyle, 4, 4, 2); - TEST_FIELD(DLGTEMPLATE, WORD, cdit, 8, 2, 2); - TEST_FIELD(DLGTEMPLATE, short, x, 10, 2, 2); - TEST_FIELD(DLGTEMPLATE, short, y, 12, 2, 2); - TEST_FIELD(DLGTEMPLATE, short, cx, 14, 2, 2); - TEST_FIELD(DLGTEMPLATE, short, cy, 16, 2, 2); -} - -static void test_pack_DRAWITEMSTRUCT(void) -{ - /* DRAWITEMSTRUCT (pack 4) */ - TEST_TYPE(DRAWITEMSTRUCT, 48, 4); - TEST_FIELD(DRAWITEMSTRUCT, UINT, CtlType, 0, 4, 4); - TEST_FIELD(DRAWITEMSTRUCT, UINT, CtlID, 4, 4, 4); - TEST_FIELD(DRAWITEMSTRUCT, UINT, itemID, 8, 4, 4); - TEST_FIELD(DRAWITEMSTRUCT, UINT, itemAction, 12, 4, 4); - TEST_FIELD(DRAWITEMSTRUCT, UINT, itemState, 16, 4, 4); - TEST_FIELD(DRAWITEMSTRUCT, HWND, hwndItem, 20, 4, 4); - TEST_FIELD(DRAWITEMSTRUCT, HDC, hDC, 24, 4, 4); - TEST_FIELD(DRAWITEMSTRUCT, RECT, rcItem, 28, 16, 4); - TEST_FIELD(DRAWITEMSTRUCT, ULONG_PTR, itemData, 44, 4, 4); -} - -static void test_pack_DRAWSTATEPROC(void) -{ - /* DRAWSTATEPROC */ - TEST_TYPE(DRAWSTATEPROC, 4, 4); -} - -static void test_pack_DRAWTEXTPARAMS(void) -{ - /* DRAWTEXTPARAMS (pack 4) */ - TEST_TYPE(DRAWTEXTPARAMS, 20, 4); - TEST_FIELD(DRAWTEXTPARAMS, UINT, cbSize, 0, 4, 4); - TEST_FIELD(DRAWTEXTPARAMS, INT, iTabLength, 4, 4, 4); - TEST_FIELD(DRAWTEXTPARAMS, INT, iLeftMargin, 8, 4, 4); - TEST_FIELD(DRAWTEXTPARAMS, INT, iRightMargin, 12, 4, 4); - TEST_FIELD(DRAWTEXTPARAMS, UINT, uiLengthDrawn, 16, 4, 4); -} - -static void test_pack_EDITWORDBREAKPROCA(void) -{ - /* EDITWORDBREAKPROCA */ - TEST_TYPE(EDITWORDBREAKPROCA, 4, 4); -} - -static void test_pack_EDITWORDBREAKPROCW(void) -{ - /* EDITWORDBREAKPROCW */ - TEST_TYPE(EDITWORDBREAKPROCW, 4, 4); -} - -static void test_pack_EVENTMSG(void) -{ - /* EVENTMSG (pack 4) */ - TEST_TYPE(EVENTMSG, 20, 4); - TEST_FIELD(EVENTMSG, UINT, message, 0, 4, 4); - TEST_FIELD(EVENTMSG, UINT, paramL, 4, 4, 4); - TEST_FIELD(EVENTMSG, UINT, paramH, 8, 4, 4); - TEST_FIELD(EVENTMSG, DWORD, time, 12, 4, 4); - TEST_FIELD(EVENTMSG, HWND, hwnd, 16, 4, 4); -} - -static void test_pack_FILTERKEYS(void) -{ - /* FILTERKEYS (pack 4) */ - TEST_TYPE(FILTERKEYS, 24, 4); - TEST_FIELD(FILTERKEYS, UINT, cbSize, 0, 4, 4); - TEST_FIELD(FILTERKEYS, DWORD, dwFlags, 4, 4, 4); - TEST_FIELD(FILTERKEYS, DWORD, iWaitMSec, 8, 4, 4); - TEST_FIELD(FILTERKEYS, DWORD, iDelayMSec, 12, 4, 4); - TEST_FIELD(FILTERKEYS, DWORD, iRepeatMSec, 16, 4, 4); - TEST_FIELD(FILTERKEYS, DWORD, iBounceMSec, 20, 4, 4); -} - -static void test_pack_FLASHWINFO(void) -{ - /* FLASHWINFO (pack 4) */ - TEST_TYPE(FLASHWINFO, 20, 4); - TEST_FIELD(FLASHWINFO, UINT, cbSize, 0, 4, 4); - TEST_FIELD(FLASHWINFO, HWND, hwnd, 4, 4, 4); - TEST_FIELD(FLASHWINFO, DWORD, dwFlags, 8, 4, 4); - TEST_FIELD(FLASHWINFO, UINT, uCount, 12, 4, 4); - TEST_FIELD(FLASHWINFO, DWORD, dwTimeout, 16, 4, 4); -} - -static void test_pack_GRAYSTRINGPROC(void) -{ - /* GRAYSTRINGPROC */ - TEST_TYPE(GRAYSTRINGPROC, 4, 4); -} - -static void test_pack_GUITHREADINFO(void) -{ - /* GUITHREADINFO (pack 4) */ - TEST_TYPE(GUITHREADINFO, 48, 4); - TEST_FIELD(GUITHREADINFO, DWORD, cbSize, 0, 4, 4); - TEST_FIELD(GUITHREADINFO, DWORD, flags, 4, 4, 4); - TEST_FIELD(GUITHREADINFO, HWND, hwndActive, 8, 4, 4); - TEST_FIELD(GUITHREADINFO, HWND, hwndFocus, 12, 4, 4); - TEST_FIELD(GUITHREADINFO, HWND, hwndCapture, 16, 4, 4); - TEST_FIELD(GUITHREADINFO, HWND, hwndMenuOwner, 20, 4, 4); - TEST_FIELD(GUITHREADINFO, HWND, hwndMoveSize, 24, 4, 4); - TEST_FIELD(GUITHREADINFO, HWND, hwndCaret, 28, 4, 4); - TEST_FIELD(GUITHREADINFO, RECT, rcCaret, 32, 16, 4); -} - -static void test_pack_HARDWAREHOOKSTRUCT(void) -{ - /* HARDWAREHOOKSTRUCT (pack 4) */ - TEST_TYPE(HARDWAREHOOKSTRUCT, 16, 4); - TEST_FIELD(HARDWAREHOOKSTRUCT, HWND, hwnd, 0, 4, 4); - TEST_FIELD(HARDWAREHOOKSTRUCT, UINT, message, 4, 4, 4); - TEST_FIELD(HARDWAREHOOKSTRUCT, WPARAM, wParam, 8, 4, 4); - TEST_FIELD(HARDWAREHOOKSTRUCT, LPARAM, lParam, 12, 4, 4); -} - -static void test_pack_HARDWAREINPUT(void) -{ - /* HARDWAREINPUT (pack 4) */ - TEST_TYPE(HARDWAREINPUT, 8, 4); - TEST_FIELD(HARDWAREINPUT, DWORD, uMsg, 0, 4, 4); - TEST_FIELD(HARDWAREINPUT, WORD, wParamL, 4, 2, 2); - TEST_FIELD(HARDWAREINPUT, WORD, wParamH, 6, 2, 2); -} - -static void test_pack_HDEVNOTIFY(void) -{ - /* HDEVNOTIFY */ - TEST_TYPE(HDEVNOTIFY, 4, 4); -} - -static void test_pack_HDWP(void) -{ - /* HDWP */ - TEST_TYPE(HDWP, 4, 4); -} - -static void test_pack_HELPINFO(void) -{ - /* HELPINFO (pack 4) */ - TEST_TYPE(HELPINFO, 28, 4); - TEST_FIELD(HELPINFO, UINT, cbSize, 0, 4, 4); - TEST_FIELD(HELPINFO, INT, iContextType, 4, 4, 4); - TEST_FIELD(HELPINFO, INT, iCtrlId, 8, 4, 4); - TEST_FIELD(HELPINFO, HANDLE, hItemHandle, 12, 4, 4); - TEST_FIELD(HELPINFO, DWORD_PTR, dwContextId, 16, 4, 4); - TEST_FIELD(HELPINFO, POINT, MousePos, 20, 8, 4); -} - -static void test_pack_HELPWININFOA(void) -{ - /* HELPWININFOA (pack 4) */ - TEST_TYPE(HELPWININFOA, 28, 4); - TEST_FIELD(HELPWININFOA, int, wStructSize, 0, 4, 4); - TEST_FIELD(HELPWININFOA, int, x, 4, 4, 4); - TEST_FIELD(HELPWININFOA, int, y, 8, 4, 4); - TEST_FIELD(HELPWININFOA, int, dx, 12, 4, 4); - TEST_FIELD(HELPWININFOA, int, dy, 16, 4, 4); - TEST_FIELD(HELPWININFOA, int, wMax, 20, 4, 4); - TEST_FIELD(HELPWININFOA, CHAR[2], rgchMember, 24, 2, 1); -} - -static void test_pack_HELPWININFOW(void) -{ - /* HELPWININFOW (pack 4) */ - TEST_TYPE(HELPWININFOW, 28, 4); - TEST_FIELD(HELPWININFOW, int, wStructSize, 0, 4, 4); - TEST_FIELD(HELPWININFOW, int, x, 4, 4, 4); - TEST_FIELD(HELPWININFOW, int, y, 8, 4, 4); - TEST_FIELD(HELPWININFOW, int, dx, 12, 4, 4); - TEST_FIELD(HELPWININFOW, int, dy, 16, 4, 4); - TEST_FIELD(HELPWININFOW, int, wMax, 20, 4, 4); - TEST_FIELD(HELPWININFOW, WCHAR[2], rgchMember, 24, 4, 2); -} - -static void test_pack_HIGHCONTRASTA(void) -{ - /* HIGHCONTRASTA (pack 4) */ - TEST_TYPE(HIGHCONTRASTA, 12, 4); - TEST_FIELD(HIGHCONTRASTA, UINT, cbSize, 0, 4, 4); - TEST_FIELD(HIGHCONTRASTA, DWORD, dwFlags, 4, 4, 4); - TEST_FIELD(HIGHCONTRASTA, LPSTR, lpszDefaultScheme, 8, 4, 4); -} - -static void test_pack_HIGHCONTRASTW(void) -{ - /* HIGHCONTRASTW (pack 4) */ - TEST_TYPE(HIGHCONTRASTW, 12, 4); - TEST_FIELD(HIGHCONTRASTW, UINT, cbSize, 0, 4, 4); - TEST_FIELD(HIGHCONTRASTW, DWORD, dwFlags, 4, 4, 4); - TEST_FIELD(HIGHCONTRASTW, LPWSTR, lpszDefaultScheme, 8, 4, 4); -} - -static void test_pack_HOOKPROC(void) -{ - /* HOOKPROC */ - TEST_TYPE(HOOKPROC, 4, 4); -} - -static void test_pack_ICONINFO(void) -{ - /* ICONINFO (pack 4) */ - TEST_TYPE(ICONINFO, 20, 4); - TEST_FIELD(ICONINFO, BOOL, fIcon, 0, 4, 4); - TEST_FIELD(ICONINFO, DWORD, xHotspot, 4, 4, 4); - TEST_FIELD(ICONINFO, DWORD, yHotspot, 8, 4, 4); - TEST_FIELD(ICONINFO, HBITMAP, hbmMask, 12, 4, 4); - TEST_FIELD(ICONINFO, HBITMAP, hbmColor, 16, 4, 4); -} - -static void test_pack_ICONMETRICSA(void) -{ - /* ICONMETRICSA (pack 4) */ - TEST_TYPE(ICONMETRICSA, 76, 4); - TEST_FIELD(ICONMETRICSA, UINT, cbSize, 0, 4, 4); - TEST_FIELD(ICONMETRICSA, int, iHorzSpacing, 4, 4, 4); - TEST_FIELD(ICONMETRICSA, int, iVertSpacing, 8, 4, 4); - TEST_FIELD(ICONMETRICSA, int, iTitleWrap, 12, 4, 4); - TEST_FIELD(ICONMETRICSA, LOGFONTA, lfFont, 16, 60, 4); -} - -static void test_pack_ICONMETRICSW(void) -{ - /* ICONMETRICSW (pack 4) */ - TEST_TYPE(ICONMETRICSW, 108, 4); - TEST_FIELD(ICONMETRICSW, UINT, cbSize, 0, 4, 4); - TEST_FIELD(ICONMETRICSW, int, iHorzSpacing, 4, 4, 4); - TEST_FIELD(ICONMETRICSW, int, iVertSpacing, 8, 4, 4); - TEST_FIELD(ICONMETRICSW, int, iTitleWrap, 12, 4, 4); - TEST_FIELD(ICONMETRICSW, LOGFONTW, lfFont, 16, 92, 4); -} - -static void test_pack_INPUT(void) -{ - /* INPUT (pack 4) */ - TEST_FIELD(INPUT, DWORD, type, 0, 4, 4); -} - -static void test_pack_KBDLLHOOKSTRUCT(void) -{ - /* KBDLLHOOKSTRUCT (pack 4) */ - TEST_TYPE(KBDLLHOOKSTRUCT, 20, 4); - TEST_FIELD(KBDLLHOOKSTRUCT, DWORD, vkCode, 0, 4, 4); - TEST_FIELD(KBDLLHOOKSTRUCT, DWORD, scanCode, 4, 4, 4); - TEST_FIELD(KBDLLHOOKSTRUCT, DWORD, flags, 8, 4, 4); - TEST_FIELD(KBDLLHOOKSTRUCT, DWORD, time, 12, 4, 4); - TEST_FIELD(KBDLLHOOKSTRUCT, ULONG_PTR, dwExtraInfo, 16, 4, 4); -} - -static void test_pack_KEYBDINPUT(void) -{ - /* KEYBDINPUT (pack 4) */ - TEST_TYPE(KEYBDINPUT, 16, 4); - TEST_FIELD(KEYBDINPUT, WORD, wVk, 0, 2, 2); - TEST_FIELD(KEYBDINPUT, WORD, wScan, 2, 2, 2); - TEST_FIELD(KEYBDINPUT, DWORD, dwFlags, 4, 4, 4); - TEST_FIELD(KEYBDINPUT, DWORD, time, 8, 4, 4); - TEST_FIELD(KEYBDINPUT, ULONG_PTR, dwExtraInfo, 12, 4, 4); -} - -static void test_pack_LPACCESSTIMEOUT(void) -{ - /* LPACCESSTIMEOUT */ - TEST_TYPE(LPACCESSTIMEOUT, 4, 4); - TEST_TYPE_POINTER(LPACCESSTIMEOUT, 12, 4); -} - -static void test_pack_LPANIMATIONINFO(void) -{ - /* LPANIMATIONINFO */ - TEST_TYPE(LPANIMATIONINFO, 4, 4); - TEST_TYPE_POINTER(LPANIMATIONINFO, 8, 4); -} - -static void test_pack_LPCBTACTIVATESTRUCT(void) -{ - /* LPCBTACTIVATESTRUCT */ - TEST_TYPE(LPCBTACTIVATESTRUCT, 4, 4); - TEST_TYPE_POINTER(LPCBTACTIVATESTRUCT, 8, 4); -} - -static void test_pack_LPCBT_CREATEWNDA(void) -{ - /* LPCBT_CREATEWNDA */ - TEST_TYPE(LPCBT_CREATEWNDA, 4, 4); - TEST_TYPE_POINTER(LPCBT_CREATEWNDA, 8, 4); -} - -static void test_pack_LPCBT_CREATEWNDW(void) -{ - /* LPCBT_CREATEWNDW */ - TEST_TYPE(LPCBT_CREATEWNDW, 4, 4); - TEST_TYPE_POINTER(LPCBT_CREATEWNDW, 8, 4); -} - -static void test_pack_LPCDLGTEMPLATEA(void) -{ - /* LPCDLGTEMPLATEA */ - TEST_TYPE(LPCDLGTEMPLATEA, 4, 4); - TEST_TYPE_POINTER(LPCDLGTEMPLATEA, 18, 2); -} - -static void test_pack_LPCDLGTEMPLATEW(void) -{ - /* LPCDLGTEMPLATEW */ - TEST_TYPE(LPCDLGTEMPLATEW, 4, 4); - TEST_TYPE_POINTER(LPCDLGTEMPLATEW, 18, 2); -} - -static void test_pack_LPCLIENTCREATESTRUCT(void) -{ - /* LPCLIENTCREATESTRUCT */ - TEST_TYPE(LPCLIENTCREATESTRUCT, 4, 4); - TEST_TYPE_POINTER(LPCLIENTCREATESTRUCT, 8, 4); -} - -static void test_pack_LPCMENUINFO(void) -{ - /* LPCMENUINFO */ - TEST_TYPE(LPCMENUINFO, 4, 4); - TEST_TYPE_POINTER(LPCMENUINFO, 28, 4); -} - -static void test_pack_LPCMENUITEMINFOA(void) -{ - /* LPCMENUITEMINFOA */ - TEST_TYPE(LPCMENUITEMINFOA, 4, 4); - TEST_TYPE_POINTER(LPCMENUITEMINFOA, 48, 4); -} - -static void test_pack_LPCMENUITEMINFOW(void) -{ - /* LPCMENUITEMINFOW */ - TEST_TYPE(LPCMENUITEMINFOW, 4, 4); - TEST_TYPE_POINTER(LPCMENUITEMINFOW, 48, 4); -} - -static void test_pack_LPCOMBOBOXINFO(void) -{ - /* LPCOMBOBOXINFO */ - TEST_TYPE(LPCOMBOBOXINFO, 4, 4); - TEST_TYPE_POINTER(LPCOMBOBOXINFO, 52, 4); -} - -static void test_pack_LPCOMPAREITEMSTRUCT(void) -{ - /* LPCOMPAREITEMSTRUCT */ - TEST_TYPE(LPCOMPAREITEMSTRUCT, 4, 4); - TEST_TYPE_POINTER(LPCOMPAREITEMSTRUCT, 32, 4); -} - -static void test_pack_LPCREATESTRUCTA(void) -{ - /* LPCREATESTRUCTA */ - TEST_TYPE(LPCREATESTRUCTA, 4, 4); - TEST_TYPE_POINTER(LPCREATESTRUCTA, 48, 4); -} - -static void test_pack_LPCREATESTRUCTW(void) -{ - /* LPCREATESTRUCTW */ - TEST_TYPE(LPCREATESTRUCTW, 4, 4); - TEST_TYPE_POINTER(LPCREATESTRUCTW, 48, 4); -} - -static void test_pack_LPCSCROLLINFO(void) -{ - /* LPCSCROLLINFO */ - TEST_TYPE(LPCSCROLLINFO, 4, 4); - TEST_TYPE_POINTER(LPCSCROLLINFO, 28, 4); -} - -static void test_pack_LPCURSORINFO(void) -{ - /* LPCURSORINFO */ - TEST_TYPE(LPCURSORINFO, 4, 4); - TEST_TYPE_POINTER(LPCURSORINFO, 20, 4); -} - -static void test_pack_LPCWPRETSTRUCT(void) -{ - /* LPCWPRETSTRUCT */ - TEST_TYPE(LPCWPRETSTRUCT, 4, 4); - TEST_TYPE_POINTER(LPCWPRETSTRUCT, 20, 4); -} - -static void test_pack_LPCWPSTRUCT(void) -{ - /* LPCWPSTRUCT */ - TEST_TYPE(LPCWPSTRUCT, 4, 4); - TEST_TYPE_POINTER(LPCWPSTRUCT, 16, 4); -} - -static void test_pack_LPDEBUGHOOKINFO(void) -{ - /* LPDEBUGHOOKINFO */ - TEST_TYPE(LPDEBUGHOOKINFO, 4, 4); - TEST_TYPE_POINTER(LPDEBUGHOOKINFO, 20, 4); -} - -static void test_pack_LPDELETEITEMSTRUCT(void) -{ - /* LPDELETEITEMSTRUCT */ - TEST_TYPE(LPDELETEITEMSTRUCT, 4, 4); - TEST_TYPE_POINTER(LPDELETEITEMSTRUCT, 20, 4); -} - -static void test_pack_LPDLGITEMTEMPLATEA(void) -{ - /* LPDLGITEMTEMPLATEA */ - TEST_TYPE(LPDLGITEMTEMPLATEA, 4, 4); - TEST_TYPE_POINTER(LPDLGITEMTEMPLATEA, 18, 2); -} - -static void test_pack_LPDLGITEMTEMPLATEW(void) -{ - /* LPDLGITEMTEMPLATEW */ - TEST_TYPE(LPDLGITEMTEMPLATEW, 4, 4); - TEST_TYPE_POINTER(LPDLGITEMTEMPLATEW, 18, 2); -} - -static void test_pack_LPDLGTEMPLATEA(void) -{ - /* LPDLGTEMPLATEA */ - TEST_TYPE(LPDLGTEMPLATEA, 4, 4); - TEST_TYPE_POINTER(LPDLGTEMPLATEA, 18, 2); -} - -static void test_pack_LPDLGTEMPLATEW(void) -{ - /* LPDLGTEMPLATEW */ - TEST_TYPE(LPDLGTEMPLATEW, 4, 4); - TEST_TYPE_POINTER(LPDLGTEMPLATEW, 18, 2); -} - -static void test_pack_LPDRAWITEMSTRUCT(void) -{ - /* LPDRAWITEMSTRUCT */ - TEST_TYPE(LPDRAWITEMSTRUCT, 4, 4); - TEST_TYPE_POINTER(LPDRAWITEMSTRUCT, 48, 4); -} - -static void test_pack_LPDRAWTEXTPARAMS(void) -{ - /* LPDRAWTEXTPARAMS */ - TEST_TYPE(LPDRAWTEXTPARAMS, 4, 4); - TEST_TYPE_POINTER(LPDRAWTEXTPARAMS, 20, 4); -} - -static void test_pack_LPEVENTMSG(void) -{ - /* LPEVENTMSG */ - TEST_TYPE(LPEVENTMSG, 4, 4); - TEST_TYPE_POINTER(LPEVENTMSG, 20, 4); -} - -static void test_pack_LPFILTERKEYS(void) -{ - /* LPFILTERKEYS */ - TEST_TYPE(LPFILTERKEYS, 4, 4); - TEST_TYPE_POINTER(LPFILTERKEYS, 24, 4); -} - -static void test_pack_LPGUITHREADINFO(void) -{ - /* LPGUITHREADINFO */ - TEST_TYPE(LPGUITHREADINFO, 4, 4); - TEST_TYPE_POINTER(LPGUITHREADINFO, 48, 4); -} - -static void test_pack_LPHARDWAREHOOKSTRUCT(void) -{ - /* LPHARDWAREHOOKSTRUCT */ - TEST_TYPE(LPHARDWAREHOOKSTRUCT, 4, 4); - TEST_TYPE_POINTER(LPHARDWAREHOOKSTRUCT, 16, 4); -} - -static void test_pack_LPHARDWAREINPUT(void) -{ - /* LPHARDWAREINPUT */ - TEST_TYPE(LPHARDWAREINPUT, 4, 4); - TEST_TYPE_POINTER(LPHARDWAREINPUT, 8, 4); -} - -static void test_pack_LPHELPINFO(void) -{ - /* LPHELPINFO */ - TEST_TYPE(LPHELPINFO, 4, 4); - TEST_TYPE_POINTER(LPHELPINFO, 28, 4); -} - -static void test_pack_LPHELPWININFOA(void) -{ - /* LPHELPWININFOA */ - TEST_TYPE(LPHELPWININFOA, 4, 4); - TEST_TYPE_POINTER(LPHELPWININFOA, 28, 4); -} - -static void test_pack_LPHELPWININFOW(void) -{ - /* LPHELPWININFOW */ - TEST_TYPE(LPHELPWININFOW, 4, 4); - TEST_TYPE_POINTER(LPHELPWININFOW, 28, 4); -} - -static void test_pack_LPHIGHCONTRASTA(void) -{ - /* LPHIGHCONTRASTA */ - TEST_TYPE(LPHIGHCONTRASTA, 4, 4); - TEST_TYPE_POINTER(LPHIGHCONTRASTA, 12, 4); -} - -static void test_pack_LPHIGHCONTRASTW(void) -{ - /* LPHIGHCONTRASTW */ - TEST_TYPE(LPHIGHCONTRASTW, 4, 4); - TEST_TYPE_POINTER(LPHIGHCONTRASTW, 12, 4); -} - -static void test_pack_LPICONMETRICSA(void) -{ - /* LPICONMETRICSA */ - TEST_TYPE(LPICONMETRICSA, 4, 4); - TEST_TYPE_POINTER(LPICONMETRICSA, 76, 4); -} - -static void test_pack_LPICONMETRICSW(void) -{ - /* LPICONMETRICSW */ - TEST_TYPE(LPICONMETRICSW, 4, 4); - TEST_TYPE_POINTER(LPICONMETRICSW, 108, 4); -} - -static void test_pack_LPINPUT(void) -{ - /* LPINPUT */ - TEST_TYPE(LPINPUT, 4, 4); -} - -static void test_pack_LPKBDLLHOOKSTRUCT(void) -{ - /* LPKBDLLHOOKSTRUCT */ - TEST_TYPE(LPKBDLLHOOKSTRUCT, 4, 4); - TEST_TYPE_POINTER(LPKBDLLHOOKSTRUCT, 20, 4); -} - -static void test_pack_LPKEYBDINPUT(void) -{ - /* LPKEYBDINPUT */ - TEST_TYPE(LPKEYBDINPUT, 4, 4); - TEST_TYPE_POINTER(LPKEYBDINPUT, 16, 4); -} - -static void test_pack_LPMDICREATESTRUCTA(void) -{ - /* LPMDICREATESTRUCTA */ - TEST_TYPE(LPMDICREATESTRUCTA, 4, 4); - TEST_TYPE_POINTER(LPMDICREATESTRUCTA, 36, 4); -} - -static void test_pack_LPMDICREATESTRUCTW(void) -{ - /* LPMDICREATESTRUCTW */ - TEST_TYPE(LPMDICREATESTRUCTW, 4, 4); - TEST_TYPE_POINTER(LPMDICREATESTRUCTW, 36, 4); -} - -static void test_pack_LPMDINEXTMENU(void) -{ - /* LPMDINEXTMENU */ - TEST_TYPE(LPMDINEXTMENU, 4, 4); - TEST_TYPE_POINTER(LPMDINEXTMENU, 12, 4); -} - -static void test_pack_LPMEASUREITEMSTRUCT(void) -{ - /* LPMEASUREITEMSTRUCT */ - TEST_TYPE(LPMEASUREITEMSTRUCT, 4, 4); - TEST_TYPE_POINTER(LPMEASUREITEMSTRUCT, 24, 4); -} - -static void test_pack_LPMENUINFO(void) -{ - /* LPMENUINFO */ - TEST_TYPE(LPMENUINFO, 4, 4); - TEST_TYPE_POINTER(LPMENUINFO, 28, 4); -} - -static void test_pack_LPMENUITEMINFOA(void) -{ - /* LPMENUITEMINFOA */ - TEST_TYPE(LPMENUITEMINFOA, 4, 4); - TEST_TYPE_POINTER(LPMENUITEMINFOA, 48, 4); -} - -static void test_pack_LPMENUITEMINFOW(void) -{ - /* LPMENUITEMINFOW */ - TEST_TYPE(LPMENUITEMINFOW, 4, 4); - TEST_TYPE_POINTER(LPMENUITEMINFOW, 48, 4); -} - -static void test_pack_LPMINIMIZEDMETRICS(void) -{ - /* LPMINIMIZEDMETRICS */ - TEST_TYPE(LPMINIMIZEDMETRICS, 4, 4); - TEST_TYPE_POINTER(LPMINIMIZEDMETRICS, 20, 4); -} - -static void test_pack_LPMINMAXINFO(void) -{ - /* LPMINMAXINFO */ - TEST_TYPE(LPMINMAXINFO, 4, 4); - TEST_TYPE_POINTER(LPMINMAXINFO, 40, 4); -} - -static void test_pack_LPMONITORINFO(void) -{ - /* LPMONITORINFO */ - TEST_TYPE(LPMONITORINFO, 4, 4); - TEST_TYPE_POINTER(LPMONITORINFO, 40, 4); -} - -static void test_pack_LPMONITORINFOEXA(void) -{ - /* LPMONITORINFOEXA */ - TEST_TYPE(LPMONITORINFOEXA, 4, 4); - TEST_TYPE_POINTER(LPMONITORINFOEXA, 72, 4); -} - -static void test_pack_LPMONITORINFOEXW(void) -{ - /* LPMONITORINFOEXW */ - TEST_TYPE(LPMONITORINFOEXW, 4, 4); - TEST_TYPE_POINTER(LPMONITORINFOEXW, 104, 4); -} - -static void test_pack_LPMOUSEHOOKSTRUCT(void) -{ - /* LPMOUSEHOOKSTRUCT */ - TEST_TYPE(LPMOUSEHOOKSTRUCT, 4, 4); - TEST_TYPE_POINTER(LPMOUSEHOOKSTRUCT, 20, 4); -} - -static void test_pack_LPMOUSEINPUT(void) -{ - /* LPMOUSEINPUT */ - TEST_TYPE(LPMOUSEINPUT, 4, 4); - TEST_TYPE_POINTER(LPMOUSEINPUT, 24, 4); -} - -static void test_pack_LPMOUSEKEYS(void) -{ - /* LPMOUSEKEYS */ - TEST_TYPE(LPMOUSEKEYS, 4, 4); - TEST_TYPE_POINTER(LPMOUSEKEYS, 28, 4); -} - -static void test_pack_LPMSG(void) -{ - /* LPMSG */ - TEST_TYPE(LPMSG, 4, 4); - TEST_TYPE_POINTER(LPMSG, 28, 4); -} - -static void test_pack_LPMSGBOXPARAMSA(void) -{ - /* LPMSGBOXPARAMSA */ - TEST_TYPE(LPMSGBOXPARAMSA, 4, 4); - TEST_TYPE_POINTER(LPMSGBOXPARAMSA, 40, 4); -} - -static void test_pack_LPMSGBOXPARAMSW(void) -{ - /* LPMSGBOXPARAMSW */ - TEST_TYPE(LPMSGBOXPARAMSW, 4, 4); - TEST_TYPE_POINTER(LPMSGBOXPARAMSW, 40, 4); -} - -static void test_pack_LPMSLLHOOKSTRUCT(void) -{ - /* LPMSLLHOOKSTRUCT */ - TEST_TYPE(LPMSLLHOOKSTRUCT, 4, 4); - TEST_TYPE_POINTER(LPMSLLHOOKSTRUCT, 24, 4); -} - -static void test_pack_LPMULTIKEYHELPA(void) -{ - /* LPMULTIKEYHELPA */ - TEST_TYPE(LPMULTIKEYHELPA, 4, 4); - TEST_TYPE_POINTER(LPMULTIKEYHELPA, 8, 4); -} - -static void test_pack_LPMULTIKEYHELPW(void) -{ - /* LPMULTIKEYHELPW */ - TEST_TYPE(LPMULTIKEYHELPW, 4, 4); - TEST_TYPE_POINTER(LPMULTIKEYHELPW, 8, 4); -} - -static void test_pack_LPNCCALCSIZE_PARAMS(void) -{ - /* LPNCCALCSIZE_PARAMS */ - TEST_TYPE(LPNCCALCSIZE_PARAMS, 4, 4); - TEST_TYPE_POINTER(LPNCCALCSIZE_PARAMS, 52, 4); -} - -static void test_pack_LPNMHDR(void) -{ - /* LPNMHDR */ - TEST_TYPE(LPNMHDR, 4, 4); - TEST_TYPE_POINTER(LPNMHDR, 12, 4); -} - -static void test_pack_LPNONCLIENTMETRICSA(void) -{ - /* LPNONCLIENTMETRICSA */ - TEST_TYPE(LPNONCLIENTMETRICSA, 4, 4); - TEST_TYPE_POINTER(LPNONCLIENTMETRICSA, 340, 4); -} - -static void test_pack_LPNONCLIENTMETRICSW(void) -{ - /* LPNONCLIENTMETRICSW */ - TEST_TYPE(LPNONCLIENTMETRICSW, 4, 4); - TEST_TYPE_POINTER(LPNONCLIENTMETRICSW, 500, 4); -} - -static void test_pack_LPPAINTSTRUCT(void) -{ - /* LPPAINTSTRUCT */ - TEST_TYPE(LPPAINTSTRUCT, 4, 4); - TEST_TYPE_POINTER(LPPAINTSTRUCT, 64, 4); -} - -static void test_pack_LPSCROLLINFO(void) -{ - /* LPSCROLLINFO */ - TEST_TYPE(LPSCROLLINFO, 4, 4); - TEST_TYPE_POINTER(LPSCROLLINFO, 28, 4); -} - -static void test_pack_LPSERIALKEYSA(void) -{ - /* LPSERIALKEYSA */ - TEST_TYPE(LPSERIALKEYSA, 4, 4); - TEST_TYPE_POINTER(LPSERIALKEYSA, 28, 4); -} - -static void test_pack_LPSERIALKEYSW(void) -{ - /* LPSERIALKEYSW */ - TEST_TYPE(LPSERIALKEYSW, 4, 4); - TEST_TYPE_POINTER(LPSERIALKEYSW, 28, 4); -} - -static void test_pack_LPSOUNDSENTRYA(void) -{ - /* LPSOUNDSENTRYA */ - TEST_TYPE(LPSOUNDSENTRYA, 4, 4); - TEST_TYPE_POINTER(LPSOUNDSENTRYA, 48, 4); -} - -static void test_pack_LPSOUNDSENTRYW(void) -{ - /* LPSOUNDSENTRYW */ - TEST_TYPE(LPSOUNDSENTRYW, 4, 4); - TEST_TYPE_POINTER(LPSOUNDSENTRYW, 48, 4); -} - -static void test_pack_LPSTICKYKEYS(void) -{ - /* LPSTICKYKEYS */ - TEST_TYPE(LPSTICKYKEYS, 4, 4); - TEST_TYPE_POINTER(LPSTICKYKEYS, 8, 4); -} - -static void test_pack_LPSTYLESTRUCT(void) -{ - /* LPSTYLESTRUCT */ - TEST_TYPE(LPSTYLESTRUCT, 4, 4); - TEST_TYPE_POINTER(LPSTYLESTRUCT, 8, 4); -} - -static void test_pack_LPTITLEBARINFO(void) -{ - /* LPTITLEBARINFO */ - TEST_TYPE(LPTITLEBARINFO, 4, 4); - TEST_TYPE_POINTER(LPTITLEBARINFO, 44, 4); -} - -static void test_pack_LPTOGGLEKEYS(void) -{ - /* LPTOGGLEKEYS */ - TEST_TYPE(LPTOGGLEKEYS, 4, 4); - TEST_TYPE_POINTER(LPTOGGLEKEYS, 8, 4); -} - -static void test_pack_LPTPMPARAMS(void) -{ - /* LPTPMPARAMS */ - TEST_TYPE(LPTPMPARAMS, 4, 4); - TEST_TYPE_POINTER(LPTPMPARAMS, 20, 4); -} - -static void test_pack_LPTRACKMOUSEEVENT(void) -{ - /* LPTRACKMOUSEEVENT */ - TEST_TYPE(LPTRACKMOUSEEVENT, 4, 4); - TEST_TYPE_POINTER(LPTRACKMOUSEEVENT, 16, 4); -} - -static void test_pack_LPWINDOWINFO(void) -{ - /* LPWINDOWINFO */ - TEST_TYPE(LPWINDOWINFO, 4, 4); - TEST_TYPE_POINTER(LPWINDOWINFO, 60, 4); -} - -static void test_pack_LPWINDOWPLACEMENT(void) -{ - /* LPWINDOWPLACEMENT */ - TEST_TYPE(LPWINDOWPLACEMENT, 4, 4); - TEST_TYPE_POINTER(LPWINDOWPLACEMENT, 44, 4); -} - -static void test_pack_LPWINDOWPOS(void) -{ - /* LPWINDOWPOS */ - TEST_TYPE(LPWINDOWPOS, 4, 4); - TEST_TYPE_POINTER(LPWINDOWPOS, 28, 4); -} - -static void test_pack_LPWNDCLASSA(void) -{ - /* LPWNDCLASSA */ - TEST_TYPE(LPWNDCLASSA, 4, 4); - TEST_TYPE_POINTER(LPWNDCLASSA, 40, 4); -} - -static void test_pack_LPWNDCLASSEXA(void) -{ - /* LPWNDCLASSEXA */ - TEST_TYPE(LPWNDCLASSEXA, 4, 4); - TEST_TYPE_POINTER(LPWNDCLASSEXA, 48, 4); -} - -static void test_pack_LPWNDCLASSEXW(void) -{ - /* LPWNDCLASSEXW */ - TEST_TYPE(LPWNDCLASSEXW, 4, 4); - TEST_TYPE_POINTER(LPWNDCLASSEXW, 48, 4); -} - -static void test_pack_LPWNDCLASSW(void) -{ - /* LPWNDCLASSW */ - TEST_TYPE(LPWNDCLASSW, 4, 4); - TEST_TYPE_POINTER(LPWNDCLASSW, 40, 4); -} - -static void test_pack_MDICREATESTRUCTA(void) -{ - /* MDICREATESTRUCTA (pack 4) */ - TEST_TYPE(MDICREATESTRUCTA, 36, 4); - TEST_FIELD(MDICREATESTRUCTA, LPCSTR, szClass, 0, 4, 4); - TEST_FIELD(MDICREATESTRUCTA, LPCSTR, szTitle, 4, 4, 4); - TEST_FIELD(MDICREATESTRUCTA, HINSTANCE, hOwner, 8, 4, 4); - TEST_FIELD(MDICREATESTRUCTA, INT, x, 12, 4, 4); - TEST_FIELD(MDICREATESTRUCTA, INT, y, 16, 4, 4); - TEST_FIELD(MDICREATESTRUCTA, INT, cx, 20, 4, 4); - TEST_FIELD(MDICREATESTRUCTA, INT, cy, 24, 4, 4); - TEST_FIELD(MDICREATESTRUCTA, DWORD, style, 28, 4, 4); - TEST_FIELD(MDICREATESTRUCTA, LPARAM, lParam, 32, 4, 4); -} - -static void test_pack_MDICREATESTRUCTW(void) -{ - /* MDICREATESTRUCTW (pack 4) */ - TEST_TYPE(MDICREATESTRUCTW, 36, 4); - TEST_FIELD(MDICREATESTRUCTW, LPCWSTR, szClass, 0, 4, 4); - TEST_FIELD(MDICREATESTRUCTW, LPCWSTR, szTitle, 4, 4, 4); - TEST_FIELD(MDICREATESTRUCTW, HINSTANCE, hOwner, 8, 4, 4); - TEST_FIELD(MDICREATESTRUCTW, INT, x, 12, 4, 4); - TEST_FIELD(MDICREATESTRUCTW, INT, y, 16, 4, 4); - TEST_FIELD(MDICREATESTRUCTW, INT, cx, 20, 4, 4); - TEST_FIELD(MDICREATESTRUCTW, INT, cy, 24, 4, 4); - TEST_FIELD(MDICREATESTRUCTW, DWORD, style, 28, 4, 4); - TEST_FIELD(MDICREATESTRUCTW, LPARAM, lParam, 32, 4, 4); -} - -static void test_pack_MDINEXTMENU(void) -{ - /* MDINEXTMENU (pack 4) */ - TEST_TYPE(MDINEXTMENU, 12, 4); - TEST_FIELD(MDINEXTMENU, HMENU, hmenuIn, 0, 4, 4); - TEST_FIELD(MDINEXTMENU, HMENU, hmenuNext, 4, 4, 4); - TEST_FIELD(MDINEXTMENU, HWND, hwndNext, 8, 4, 4); -} - -static void test_pack_MEASUREITEMSTRUCT(void) -{ - /* MEASUREITEMSTRUCT (pack 4) */ - TEST_TYPE(MEASUREITEMSTRUCT, 24, 4); - TEST_FIELD(MEASUREITEMSTRUCT, UINT, CtlType, 0, 4, 4); - TEST_FIELD(MEASUREITEMSTRUCT, UINT, CtlID, 4, 4, 4); - TEST_FIELD(MEASUREITEMSTRUCT, UINT, itemID, 8, 4, 4); - TEST_FIELD(MEASUREITEMSTRUCT, UINT, itemWidth, 12, 4, 4); - TEST_FIELD(MEASUREITEMSTRUCT, UINT, itemHeight, 16, 4, 4); - TEST_FIELD(MEASUREITEMSTRUCT, ULONG_PTR, itemData, 20, 4, 4); -} - -static void test_pack_MENUINFO(void) -{ - /* MENUINFO (pack 4) */ - TEST_TYPE(MENUINFO, 28, 4); - TEST_FIELD(MENUINFO, DWORD, cbSize, 0, 4, 4); - TEST_FIELD(MENUINFO, DWORD, fMask, 4, 4, 4); - TEST_FIELD(MENUINFO, DWORD, dwStyle, 8, 4, 4); - TEST_FIELD(MENUINFO, UINT, cyMax, 12, 4, 4); - TEST_FIELD(MENUINFO, HBRUSH, hbrBack, 16, 4, 4); - TEST_FIELD(MENUINFO, DWORD, dwContextHelpID, 20, 4, 4); - TEST_FIELD(MENUINFO, ULONG_PTR, dwMenuData, 24, 4, 4); -} - -static void test_pack_MENUITEMINFOA(void) -{ - /* MENUITEMINFOA (pack 4) */ - TEST_TYPE(MENUITEMINFOA, 48, 4); - TEST_FIELD(MENUITEMINFOA, UINT, cbSize, 0, 4, 4); - TEST_FIELD(MENUITEMINFOA, UINT, fMask, 4, 4, 4); - TEST_FIELD(MENUITEMINFOA, UINT, fType, 8, 4, 4); - TEST_FIELD(MENUITEMINFOA, UINT, fState, 12, 4, 4); - TEST_FIELD(MENUITEMINFOA, UINT, wID, 16, 4, 4); - TEST_FIELD(MENUITEMINFOA, HMENU, hSubMenu, 20, 4, 4); - TEST_FIELD(MENUITEMINFOA, HBITMAP, hbmpChecked, 24, 4, 4); - TEST_FIELD(MENUITEMINFOA, HBITMAP, hbmpUnchecked, 28, 4, 4); - TEST_FIELD(MENUITEMINFOA, ULONG_PTR, dwItemData, 32, 4, 4); - TEST_FIELD(MENUITEMINFOA, LPSTR, dwTypeData, 36, 4, 4); - TEST_FIELD(MENUITEMINFOA, UINT, cch, 40, 4, 4); - TEST_FIELD(MENUITEMINFOA, HBITMAP, hbmpItem, 44, 4, 4); -} - -static void test_pack_MENUITEMINFOW(void) -{ - /* MENUITEMINFOW (pack 4) */ - TEST_TYPE(MENUITEMINFOW, 48, 4); - TEST_FIELD(MENUITEMINFOW, UINT, cbSize, 0, 4, 4); - TEST_FIELD(MENUITEMINFOW, UINT, fMask, 4, 4, 4); - TEST_FIELD(MENUITEMINFOW, UINT, fType, 8, 4, 4); - TEST_FIELD(MENUITEMINFOW, UINT, fState, 12, 4, 4); - TEST_FIELD(MENUITEMINFOW, UINT, wID, 16, 4, 4); - TEST_FIELD(MENUITEMINFOW, HMENU, hSubMenu, 20, 4, 4); - TEST_FIELD(MENUITEMINFOW, HBITMAP, hbmpChecked, 24, 4, 4); - TEST_FIELD(MENUITEMINFOW, HBITMAP, hbmpUnchecked, 28, 4, 4); - TEST_FIELD(MENUITEMINFOW, ULONG_PTR, dwItemData, 32, 4, 4); - TEST_FIELD(MENUITEMINFOW, LPWSTR, dwTypeData, 36, 4, 4); - TEST_FIELD(MENUITEMINFOW, UINT, cch, 40, 4, 4); - TEST_FIELD(MENUITEMINFOW, HBITMAP, hbmpItem, 44, 4, 4); -} - -static void test_pack_MENUITEMTEMPLATE(void) -{ - /* MENUITEMTEMPLATE (pack 4) */ - TEST_TYPE(MENUITEMTEMPLATE, 6, 2); - TEST_FIELD(MENUITEMTEMPLATE, WORD, mtOption, 0, 2, 2); - TEST_FIELD(MENUITEMTEMPLATE, WORD, mtID, 2, 2, 2); - TEST_FIELD(MENUITEMTEMPLATE, WCHAR[1], mtString, 4, 2, 2); -} - -static void test_pack_MENUITEMTEMPLATEHEADER(void) -{ - /* MENUITEMTEMPLATEHEADER (pack 4) */ - TEST_TYPE(MENUITEMTEMPLATEHEADER, 4, 2); - TEST_FIELD(MENUITEMTEMPLATEHEADER, WORD, versionNumber, 0, 2, 2); - TEST_FIELD(MENUITEMTEMPLATEHEADER, WORD, offset, 2, 2, 2); -} - -static void test_pack_MINIMIZEDMETRICS(void) -{ - /* MINIMIZEDMETRICS (pack 4) */ - TEST_TYPE(MINIMIZEDMETRICS, 20, 4); - TEST_FIELD(MINIMIZEDMETRICS, UINT, cbSize, 0, 4, 4); - TEST_FIELD(MINIMIZEDMETRICS, int, iWidth, 4, 4, 4); - TEST_FIELD(MINIMIZEDMETRICS, int, iHorzGap, 8, 4, 4); - TEST_FIELD(MINIMIZEDMETRICS, int, iVertGap, 12, 4, 4); - TEST_FIELD(MINIMIZEDMETRICS, int, iArrange, 16, 4, 4); -} - -static void test_pack_MINMAXINFO(void) -{ - /* MINMAXINFO (pack 4) */ - TEST_TYPE(MINMAXINFO, 40, 4); - TEST_FIELD(MINMAXINFO, POINT, ptReserved, 0, 8, 4); - TEST_FIELD(MINMAXINFO, POINT, ptMaxSize, 8, 8, 4); - TEST_FIELD(MINMAXINFO, POINT, ptMaxPosition, 16, 8, 4); - TEST_FIELD(MINMAXINFO, POINT, ptMinTrackSize, 24, 8, 4); - TEST_FIELD(MINMAXINFO, POINT, ptMaxTrackSize, 32, 8, 4); -} - -static void test_pack_MONITORENUMPROC(void) -{ - /* MONITORENUMPROC */ - TEST_TYPE(MONITORENUMPROC, 4, 4); -} - -static void test_pack_MONITORINFO(void) -{ - /* MONITORINFO (pack 4) */ - TEST_TYPE(MONITORINFO, 40, 4); - TEST_FIELD(MONITORINFO, DWORD, cbSize, 0, 4, 4); - TEST_FIELD(MONITORINFO, RECT, rcMonitor, 4, 16, 4); - TEST_FIELD(MONITORINFO, RECT, rcWork, 20, 16, 4); - TEST_FIELD(MONITORINFO, DWORD, dwFlags, 36, 4, 4); -} - -static void test_pack_MONITORINFOEXA(void) -{ - /* MONITORINFOEXA (pack 4) */ - TEST_TYPE(MONITORINFOEXA, 72, 4); - TEST_FIELD(MONITORINFOEXA, DWORD, cbSize, 0, 4, 4); - TEST_FIELD(MONITORINFOEXA, RECT, rcMonitor, 4, 16, 4); - TEST_FIELD(MONITORINFOEXA, RECT, rcWork, 20, 16, 4); - TEST_FIELD(MONITORINFOEXA, DWORD, dwFlags, 36, 4, 4); - TEST_FIELD(MONITORINFOEXA, CHAR[CCHDEVICENAME], szDevice, 40, 32, 1); -} - -static void test_pack_MONITORINFOEXW(void) -{ - /* MONITORINFOEXW (pack 4) */ - TEST_TYPE(MONITORINFOEXW, 104, 4); - TEST_FIELD(MONITORINFOEXW, DWORD, cbSize, 0, 4, 4); - TEST_FIELD(MONITORINFOEXW, RECT, rcMonitor, 4, 16, 4); - TEST_FIELD(MONITORINFOEXW, RECT, rcWork, 20, 16, 4); - TEST_FIELD(MONITORINFOEXW, DWORD, dwFlags, 36, 4, 4); - TEST_FIELD(MONITORINFOEXW, WCHAR[CCHDEVICENAME], szDevice, 40, 64, 2); -} - -static void test_pack_MOUSEHOOKSTRUCT(void) -{ - /* MOUSEHOOKSTRUCT (pack 4) */ - TEST_TYPE(MOUSEHOOKSTRUCT, 20, 4); - TEST_FIELD(MOUSEHOOKSTRUCT, POINT, pt, 0, 8, 4); - TEST_FIELD(MOUSEHOOKSTRUCT, HWND, hwnd, 8, 4, 4); - TEST_FIELD(MOUSEHOOKSTRUCT, UINT, wHitTestCode, 12, 4, 4); - TEST_FIELD(MOUSEHOOKSTRUCT, ULONG_PTR, dwExtraInfo, 16, 4, 4); -} - -static void test_pack_MOUSEINPUT(void) -{ - /* MOUSEINPUT (pack 4) */ - TEST_TYPE(MOUSEINPUT, 24, 4); - TEST_FIELD(MOUSEINPUT, LONG, dx, 0, 4, 4); - TEST_FIELD(MOUSEINPUT, LONG, dy, 4, 4, 4); - TEST_FIELD(MOUSEINPUT, DWORD, mouseData, 8, 4, 4); - TEST_FIELD(MOUSEINPUT, DWORD, dwFlags, 12, 4, 4); - TEST_FIELD(MOUSEINPUT, DWORD, time, 16, 4, 4); - TEST_FIELD(MOUSEINPUT, ULONG_PTR, dwExtraInfo, 20, 4, 4); -} - -static void test_pack_MOUSEKEYS(void) -{ - /* MOUSEKEYS (pack 4) */ - TEST_TYPE(MOUSEKEYS, 28, 4); - TEST_FIELD(MOUSEKEYS, UINT, cbSize, 0, 4, 4); - TEST_FIELD(MOUSEKEYS, DWORD, dwFlags, 4, 4, 4); - TEST_FIELD(MOUSEKEYS, DWORD, iMaxSpeed, 8, 4, 4); - TEST_FIELD(MOUSEKEYS, DWORD, iTimeToMaxSpeed, 12, 4, 4); - TEST_FIELD(MOUSEKEYS, DWORD, iCtrlSpeed, 16, 4, 4); - TEST_FIELD(MOUSEKEYS, DWORD, dwReserved1, 20, 4, 4); - TEST_FIELD(MOUSEKEYS, DWORD, dwReserved2, 24, 4, 4); -} - -static void test_pack_MSG(void) -{ - /* MSG (pack 4) */ - TEST_TYPE(MSG, 28, 4); - TEST_FIELD(MSG, HWND, hwnd, 0, 4, 4); - TEST_FIELD(MSG, UINT, message, 4, 4, 4); - TEST_FIELD(MSG, WPARAM, wParam, 8, 4, 4); - TEST_FIELD(MSG, LPARAM, lParam, 12, 4, 4); - TEST_FIELD(MSG, DWORD, time, 16, 4, 4); - TEST_FIELD(MSG, POINT, pt, 20, 8, 4); -} - -static void test_pack_MSGBOXCALLBACK(void) -{ - /* MSGBOXCALLBACK */ - TEST_TYPE(MSGBOXCALLBACK, 4, 4); -} - -static void test_pack_MSGBOXPARAMSA(void) -{ - /* MSGBOXPARAMSA (pack 4) */ - TEST_TYPE(MSGBOXPARAMSA, 40, 4); - TEST_FIELD(MSGBOXPARAMSA, UINT, cbSize, 0, 4, 4); - TEST_FIELD(MSGBOXPARAMSA, HWND, hwndOwner, 4, 4, 4); - TEST_FIELD(MSGBOXPARAMSA, HINSTANCE, hInstance, 8, 4, 4); - TEST_FIELD(MSGBOXPARAMSA, LPCSTR, lpszText, 12, 4, 4); - TEST_FIELD(MSGBOXPARAMSA, LPCSTR, lpszCaption, 16, 4, 4); - TEST_FIELD(MSGBOXPARAMSA, DWORD, dwStyle, 20, 4, 4); - TEST_FIELD(MSGBOXPARAMSA, LPCSTR, lpszIcon, 24, 4, 4); - TEST_FIELD(MSGBOXPARAMSA, DWORD_PTR, dwContextHelpId, 28, 4, 4); - TEST_FIELD(MSGBOXPARAMSA, MSGBOXCALLBACK, lpfnMsgBoxCallback, 32, 4, 4); - TEST_FIELD(MSGBOXPARAMSA, DWORD, dwLanguageId, 36, 4, 4); -} - -static void test_pack_MSGBOXPARAMSW(void) -{ - /* MSGBOXPARAMSW (pack 4) */ - TEST_TYPE(MSGBOXPARAMSW, 40, 4); - TEST_FIELD(MSGBOXPARAMSW, UINT, cbSize, 0, 4, 4); - TEST_FIELD(MSGBOXPARAMSW, HWND, hwndOwner, 4, 4, 4); - TEST_FIELD(MSGBOXPARAMSW, HINSTANCE, hInstance, 8, 4, 4); - TEST_FIELD(MSGBOXPARAMSW, LPCWSTR, lpszText, 12, 4, 4); - TEST_FIELD(MSGBOXPARAMSW, LPCWSTR, lpszCaption, 16, 4, 4); - TEST_FIELD(MSGBOXPARAMSW, DWORD, dwStyle, 20, 4, 4); - TEST_FIELD(MSGBOXPARAMSW, LPCWSTR, lpszIcon, 24, 4, 4); - TEST_FIELD(MSGBOXPARAMSW, DWORD_PTR, dwContextHelpId, 28, 4, 4); - TEST_FIELD(MSGBOXPARAMSW, MSGBOXCALLBACK, lpfnMsgBoxCallback, 32, 4, 4); - TEST_FIELD(MSGBOXPARAMSW, DWORD, dwLanguageId, 36, 4, 4); -} - -static void test_pack_MSLLHOOKSTRUCT(void) -{ - /* MSLLHOOKSTRUCT (pack 4) */ - TEST_TYPE(MSLLHOOKSTRUCT, 24, 4); - TEST_FIELD(MSLLHOOKSTRUCT, POINT, pt, 0, 8, 4); - TEST_FIELD(MSLLHOOKSTRUCT, DWORD, mouseData, 8, 4, 4); - TEST_FIELD(MSLLHOOKSTRUCT, DWORD, flags, 12, 4, 4); - TEST_FIELD(MSLLHOOKSTRUCT, DWORD, time, 16, 4, 4); - TEST_FIELD(MSLLHOOKSTRUCT, ULONG_PTR, dwExtraInfo, 20, 4, 4); -} - -static void test_pack_MULTIKEYHELPA(void) -{ - /* MULTIKEYHELPA (pack 4) */ - TEST_TYPE(MULTIKEYHELPA, 8, 4); - TEST_FIELD(MULTIKEYHELPA, DWORD, mkSize, 0, 4, 4); - TEST_FIELD(MULTIKEYHELPA, CHAR, mkKeylist, 4, 1, 1); - TEST_FIELD(MULTIKEYHELPA, CHAR[1], szKeyphrase, 5, 1, 1); -} - -static void test_pack_MULTIKEYHELPW(void) -{ - /* MULTIKEYHELPW (pack 4) */ - TEST_TYPE(MULTIKEYHELPW, 8, 4); - TEST_FIELD(MULTIKEYHELPW, DWORD, mkSize, 0, 4, 4); - TEST_FIELD(MULTIKEYHELPW, WCHAR, mkKeylist, 4, 2, 2); - TEST_FIELD(MULTIKEYHELPW, WCHAR[1], szKeyphrase, 6, 2, 2); -} - -static void test_pack_NAMEENUMPROCA(void) -{ - /* NAMEENUMPROCA */ - TEST_TYPE(NAMEENUMPROCA, 4, 4); -} - -static void test_pack_NAMEENUMPROCW(void) -{ - /* NAMEENUMPROCW */ - TEST_TYPE(NAMEENUMPROCW, 4, 4); -} - -static void test_pack_NCCALCSIZE_PARAMS(void) -{ - /* NCCALCSIZE_PARAMS (pack 4) */ - TEST_TYPE(NCCALCSIZE_PARAMS, 52, 4); - TEST_FIELD(NCCALCSIZE_PARAMS, RECT[3], rgrc, 0, 48, 4); - TEST_FIELD(NCCALCSIZE_PARAMS, WINDOWPOS *, lppos, 48, 4, 4); -} - -static void test_pack_NMHDR(void) -{ - /* NMHDR (pack 4) */ - TEST_TYPE(NMHDR, 12, 4); - TEST_FIELD(NMHDR, HWND, hwndFrom, 0, 4, 4); - TEST_FIELD(NMHDR, UINT_PTR, idFrom, 4, 4, 4); - TEST_FIELD(NMHDR, UINT, code, 8, 4, 4); -} - -static void test_pack_NONCLIENTMETRICSA(void) -{ - /* NONCLIENTMETRICSA (pack 4) */ - TEST_TYPE(NONCLIENTMETRICSA, 340, 4); - TEST_FIELD(NONCLIENTMETRICSA, UINT, cbSize, 0, 4, 4); - TEST_FIELD(NONCLIENTMETRICSA, INT, iBorderWidth, 4, 4, 4); - TEST_FIELD(NONCLIENTMETRICSA, INT, iScrollWidth, 8, 4, 4); - TEST_FIELD(NONCLIENTMETRICSA, INT, iScrollHeight, 12, 4, 4); - TEST_FIELD(NONCLIENTMETRICSA, INT, iCaptionWidth, 16, 4, 4); - TEST_FIELD(NONCLIENTMETRICSA, INT, iCaptionHeight, 20, 4, 4); - TEST_FIELD(NONCLIENTMETRICSA, LOGFONTA, lfCaptionFont, 24, 60, 4); - TEST_FIELD(NONCLIENTMETRICSA, INT, iSmCaptionWidth, 84, 4, 4); - TEST_FIELD(NONCLIENTMETRICSA, INT, iSmCaptionHeight, 88, 4, 4); - TEST_FIELD(NONCLIENTMETRICSA, LOGFONTA, lfSmCaptionFont, 92, 60, 4); - TEST_FIELD(NONCLIENTMETRICSA, INT, iMenuWidth, 152, 4, 4); - TEST_FIELD(NONCLIENTMETRICSA, INT, iMenuHeight, 156, 4, 4); - TEST_FIELD(NONCLIENTMETRICSA, LOGFONTA, lfMenuFont, 160, 60, 4); - TEST_FIELD(NONCLIENTMETRICSA, LOGFONTA, lfStatusFont, 220, 60, 4); - TEST_FIELD(NONCLIENTMETRICSA, LOGFONTA, lfMessageFont, 280, 60, 4); -} - -static void test_pack_NONCLIENTMETRICSW(void) -{ - /* NONCLIENTMETRICSW (pack 4) */ - TEST_TYPE(NONCLIENTMETRICSW, 500, 4); - TEST_FIELD(NONCLIENTMETRICSW, UINT, cbSize, 0, 4, 4); - TEST_FIELD(NONCLIENTMETRICSW, INT, iBorderWidth, 4, 4, 4); - TEST_FIELD(NONCLIENTMETRICSW, INT, iScrollWidth, 8, 4, 4); - TEST_FIELD(NONCLIENTMETRICSW, INT, iScrollHeight, 12, 4, 4); - TEST_FIELD(NONCLIENTMETRICSW, INT, iCaptionWidth, 16, 4, 4); - TEST_FIELD(NONCLIENTMETRICSW, INT, iCaptionHeight, 20, 4, 4); - TEST_FIELD(NONCLIENTMETRICSW, LOGFONTW, lfCaptionFont, 24, 92, 4); - TEST_FIELD(NONCLIENTMETRICSW, INT, iSmCaptionWidth, 116, 4, 4); - TEST_FIELD(NONCLIENTMETRICSW, INT, iSmCaptionHeight, 120, 4, 4); - TEST_FIELD(NONCLIENTMETRICSW, LOGFONTW, lfSmCaptionFont, 124, 92, 4); - TEST_FIELD(NONCLIENTMETRICSW, INT, iMenuWidth, 216, 4, 4); - TEST_FIELD(NONCLIENTMETRICSW, INT, iMenuHeight, 220, 4, 4); - TEST_FIELD(NONCLIENTMETRICSW, LOGFONTW, lfMenuFont, 224, 92, 4); - TEST_FIELD(NONCLIENTMETRICSW, LOGFONTW, lfStatusFont, 316, 92, 4); - TEST_FIELD(NONCLIENTMETRICSW, LOGFONTW, lfMessageFont, 408, 92, 4); -} - -static void test_pack_PAINTSTRUCT(void) -{ - /* PAINTSTRUCT (pack 4) */ - TEST_TYPE(PAINTSTRUCT, 64, 4); - TEST_FIELD(PAINTSTRUCT, HDC, hdc, 0, 4, 4); - TEST_FIELD(PAINTSTRUCT, BOOL, fErase, 4, 4, 4); - TEST_FIELD(PAINTSTRUCT, RECT, rcPaint, 8, 16, 4); - TEST_FIELD(PAINTSTRUCT, BOOL, fRestore, 24, 4, 4); - TEST_FIELD(PAINTSTRUCT, BOOL, fIncUpdate, 28, 4, 4); - TEST_FIELD(PAINTSTRUCT, BYTE[32], rgbReserved, 32, 32, 1); -} - -static void test_pack_PCOMBOBOXINFO(void) -{ - /* PCOMBOBOXINFO */ - TEST_TYPE(PCOMBOBOXINFO, 4, 4); - TEST_TYPE_POINTER(PCOMBOBOXINFO, 52, 4); -} - -static void test_pack_PCOMPAREITEMSTRUCT(void) -{ - /* PCOMPAREITEMSTRUCT */ - TEST_TYPE(PCOMPAREITEMSTRUCT, 4, 4); - TEST_TYPE_POINTER(PCOMPAREITEMSTRUCT, 32, 4); -} - -static void test_pack_PCOPYDATASTRUCT(void) -{ - /* PCOPYDATASTRUCT */ - TEST_TYPE(PCOPYDATASTRUCT, 4, 4); - TEST_TYPE_POINTER(PCOPYDATASTRUCT, 12, 4); -} - -static void test_pack_PCURSORINFO(void) -{ - /* PCURSORINFO */ - TEST_TYPE(PCURSORINFO, 4, 4); - TEST_TYPE_POINTER(PCURSORINFO, 20, 4); -} - -static void test_pack_PCWPRETSTRUCT(void) -{ - /* PCWPRETSTRUCT */ - TEST_TYPE(PCWPRETSTRUCT, 4, 4); - TEST_TYPE_POINTER(PCWPRETSTRUCT, 20, 4); -} - -static void test_pack_PCWPSTRUCT(void) -{ - /* PCWPSTRUCT */ - TEST_TYPE(PCWPSTRUCT, 4, 4); - TEST_TYPE_POINTER(PCWPSTRUCT, 16, 4); -} - -static void test_pack_PDEBUGHOOKINFO(void) -{ - /* PDEBUGHOOKINFO */ - TEST_TYPE(PDEBUGHOOKINFO, 4, 4); - TEST_TYPE_POINTER(PDEBUGHOOKINFO, 20, 4); -} - -static void test_pack_PDELETEITEMSTRUCT(void) -{ - /* PDELETEITEMSTRUCT */ - TEST_TYPE(PDELETEITEMSTRUCT, 4, 4); - TEST_TYPE_POINTER(PDELETEITEMSTRUCT, 20, 4); -} - -static void test_pack_PDLGITEMTEMPLATEA(void) -{ - /* PDLGITEMTEMPLATEA */ - TEST_TYPE(PDLGITEMTEMPLATEA, 4, 4); - TEST_TYPE_POINTER(PDLGITEMTEMPLATEA, 18, 2); -} - -static void test_pack_PDLGITEMTEMPLATEW(void) -{ - /* PDLGITEMTEMPLATEW */ - TEST_TYPE(PDLGITEMTEMPLATEW, 4, 4); - TEST_TYPE_POINTER(PDLGITEMTEMPLATEW, 18, 2); -} - -static void test_pack_PDRAWITEMSTRUCT(void) -{ - /* PDRAWITEMSTRUCT */ - TEST_TYPE(PDRAWITEMSTRUCT, 4, 4); - TEST_TYPE_POINTER(PDRAWITEMSTRUCT, 48, 4); -} - -static void test_pack_PEVENTMSG(void) -{ - /* PEVENTMSG */ - TEST_TYPE(PEVENTMSG, 4, 4); - TEST_TYPE_POINTER(PEVENTMSG, 20, 4); -} - -static void test_pack_PFLASHWINFO(void) -{ - /* PFLASHWINFO */ - TEST_TYPE(PFLASHWINFO, 4, 4); - TEST_TYPE_POINTER(PFLASHWINFO, 20, 4); -} - -static void test_pack_PGUITHREADINFO(void) -{ - /* PGUITHREADINFO */ - TEST_TYPE(PGUITHREADINFO, 4, 4); - TEST_TYPE_POINTER(PGUITHREADINFO, 48, 4); -} - -static void test_pack_PHARDWAREHOOKSTRUCT(void) -{ - /* PHARDWAREHOOKSTRUCT */ - TEST_TYPE(PHARDWAREHOOKSTRUCT, 4, 4); - TEST_TYPE_POINTER(PHARDWAREHOOKSTRUCT, 16, 4); -} - -static void test_pack_PHARDWAREINPUT(void) -{ - /* PHARDWAREINPUT */ - TEST_TYPE(PHARDWAREINPUT, 4, 4); - TEST_TYPE_POINTER(PHARDWAREINPUT, 8, 4); -} - -static void test_pack_PHDEVNOTIFY(void) -{ - /* PHDEVNOTIFY */ - TEST_TYPE(PHDEVNOTIFY, 4, 4); - TEST_TYPE_POINTER(PHDEVNOTIFY, 4, 4); -} - -static void test_pack_PHELPWININFOA(void) -{ - /* PHELPWININFOA */ - TEST_TYPE(PHELPWININFOA, 4, 4); - TEST_TYPE_POINTER(PHELPWININFOA, 28, 4); -} - -static void test_pack_PHELPWININFOW(void) -{ - /* PHELPWININFOW */ - TEST_TYPE(PHELPWININFOW, 4, 4); - TEST_TYPE_POINTER(PHELPWININFOW, 28, 4); -} - -static void test_pack_PICONINFO(void) -{ - /* PICONINFO */ - TEST_TYPE(PICONINFO, 4, 4); - TEST_TYPE_POINTER(PICONINFO, 20, 4); -} - -static void test_pack_PICONMETRICSA(void) -{ - /* PICONMETRICSA */ - TEST_TYPE(PICONMETRICSA, 4, 4); - TEST_TYPE_POINTER(PICONMETRICSA, 76, 4); -} - -static void test_pack_PICONMETRICSW(void) -{ - /* PICONMETRICSW */ - TEST_TYPE(PICONMETRICSW, 4, 4); - TEST_TYPE_POINTER(PICONMETRICSW, 108, 4); -} - -static void test_pack_PINPUT(void) -{ - /* PINPUT */ - TEST_TYPE(PINPUT, 4, 4); -} - -static void test_pack_PKBDLLHOOKSTRUCT(void) -{ - /* PKBDLLHOOKSTRUCT */ - TEST_TYPE(PKBDLLHOOKSTRUCT, 4, 4); - TEST_TYPE_POINTER(PKBDLLHOOKSTRUCT, 20, 4); -} - -static void test_pack_PKEYBDINPUT(void) -{ - /* PKEYBDINPUT */ - TEST_TYPE(PKEYBDINPUT, 4, 4); - TEST_TYPE_POINTER(PKEYBDINPUT, 16, 4); -} - -static void test_pack_PMDINEXTMENU(void) -{ - /* PMDINEXTMENU */ - TEST_TYPE(PMDINEXTMENU, 4, 4); - TEST_TYPE_POINTER(PMDINEXTMENU, 12, 4); -} - -static void test_pack_PMEASUREITEMSTRUCT(void) -{ - /* PMEASUREITEMSTRUCT */ - TEST_TYPE(PMEASUREITEMSTRUCT, 4, 4); - TEST_TYPE_POINTER(PMEASUREITEMSTRUCT, 24, 4); -} - -static void test_pack_PMENUITEMTEMPLATE(void) -{ - /* PMENUITEMTEMPLATE */ - TEST_TYPE(PMENUITEMTEMPLATE, 4, 4); - TEST_TYPE_POINTER(PMENUITEMTEMPLATE, 6, 2); -} - -static void test_pack_PMENUITEMTEMPLATEHEADER(void) -{ - /* PMENUITEMTEMPLATEHEADER */ - TEST_TYPE(PMENUITEMTEMPLATEHEADER, 4, 4); - TEST_TYPE_POINTER(PMENUITEMTEMPLATEHEADER, 4, 2); -} - -static void test_pack_PMINIMIZEDMETRICS(void) -{ - /* PMINIMIZEDMETRICS */ - TEST_TYPE(PMINIMIZEDMETRICS, 4, 4); - TEST_TYPE_POINTER(PMINIMIZEDMETRICS, 20, 4); -} - -static void test_pack_PMINMAXINFO(void) -{ - /* PMINMAXINFO */ - TEST_TYPE(PMINMAXINFO, 4, 4); - TEST_TYPE_POINTER(PMINMAXINFO, 40, 4); -} - -static void test_pack_PMOUSEHOOKSTRUCT(void) -{ - /* PMOUSEHOOKSTRUCT */ - TEST_TYPE(PMOUSEHOOKSTRUCT, 4, 4); - TEST_TYPE_POINTER(PMOUSEHOOKSTRUCT, 20, 4); -} - -static void test_pack_PMOUSEINPUT(void) -{ - /* PMOUSEINPUT */ - TEST_TYPE(PMOUSEINPUT, 4, 4); - TEST_TYPE_POINTER(PMOUSEINPUT, 24, 4); -} - -static void test_pack_PMSG(void) -{ - /* PMSG */ - TEST_TYPE(PMSG, 4, 4); - TEST_TYPE_POINTER(PMSG, 28, 4); -} - -static void test_pack_PMSGBOXPARAMSA(void) -{ - /* PMSGBOXPARAMSA */ - TEST_TYPE(PMSGBOXPARAMSA, 4, 4); - TEST_TYPE_POINTER(PMSGBOXPARAMSA, 40, 4); -} - -static void test_pack_PMSGBOXPARAMSW(void) -{ - /* PMSGBOXPARAMSW */ - TEST_TYPE(PMSGBOXPARAMSW, 4, 4); - TEST_TYPE_POINTER(PMSGBOXPARAMSW, 40, 4); -} - -static void test_pack_PMSLLHOOKSTRUCT(void) -{ - /* PMSLLHOOKSTRUCT */ - TEST_TYPE(PMSLLHOOKSTRUCT, 4, 4); - TEST_TYPE_POINTER(PMSLLHOOKSTRUCT, 24, 4); -} - -static void test_pack_PMULTIKEYHELPA(void) -{ - /* PMULTIKEYHELPA */ - TEST_TYPE(PMULTIKEYHELPA, 4, 4); - TEST_TYPE_POINTER(PMULTIKEYHELPA, 8, 4); -} - -static void test_pack_PMULTIKEYHELPW(void) -{ - /* PMULTIKEYHELPW */ - TEST_TYPE(PMULTIKEYHELPW, 4, 4); - TEST_TYPE_POINTER(PMULTIKEYHELPW, 8, 4); -} - -static void test_pack_PNONCLIENTMETRICSA(void) -{ - /* PNONCLIENTMETRICSA */ - TEST_TYPE(PNONCLIENTMETRICSA, 4, 4); - TEST_TYPE_POINTER(PNONCLIENTMETRICSA, 340, 4); -} - -static void test_pack_PNONCLIENTMETRICSW(void) -{ - /* PNONCLIENTMETRICSW */ - TEST_TYPE(PNONCLIENTMETRICSW, 4, 4); - TEST_TYPE_POINTER(PNONCLIENTMETRICSW, 500, 4); -} - -static void test_pack_PPAINTSTRUCT(void) -{ - /* PPAINTSTRUCT */ - TEST_TYPE(PPAINTSTRUCT, 4, 4); - TEST_TYPE_POINTER(PPAINTSTRUCT, 64, 4); -} - -static void test_pack_PROPENUMPROCA(void) -{ - /* PROPENUMPROCA */ - TEST_TYPE(PROPENUMPROCA, 4, 4); -} - -static void test_pack_PROPENUMPROCEXA(void) -{ - /* PROPENUMPROCEXA */ - TEST_TYPE(PROPENUMPROCEXA, 4, 4); -} - -static void test_pack_PROPENUMPROCEXW(void) -{ - /* PROPENUMPROCEXW */ - TEST_TYPE(PROPENUMPROCEXW, 4, 4); -} - -static void test_pack_PROPENUMPROCW(void) -{ - /* PROPENUMPROCW */ - TEST_TYPE(PROPENUMPROCW, 4, 4); -} - -static void test_pack_PTITLEBARINFO(void) -{ - /* PTITLEBARINFO */ - TEST_TYPE(PTITLEBARINFO, 4, 4); - TEST_TYPE_POINTER(PTITLEBARINFO, 44, 4); -} - -static void test_pack_PUSEROBJECTFLAGS(void) -{ - /* PUSEROBJECTFLAGS */ - TEST_TYPE(PUSEROBJECTFLAGS, 4, 4); - TEST_TYPE_POINTER(PUSEROBJECTFLAGS, 12, 4); -} - -static void test_pack_PWINDOWINFO(void) -{ - /* PWINDOWINFO */ - TEST_TYPE(PWINDOWINFO, 4, 4); - TEST_TYPE_POINTER(PWINDOWINFO, 60, 4); -} - -static void test_pack_PWINDOWPLACEMENT(void) -{ - /* PWINDOWPLACEMENT */ - TEST_TYPE(PWINDOWPLACEMENT, 4, 4); - TEST_TYPE_POINTER(PWINDOWPLACEMENT, 44, 4); -} - -static void test_pack_PWINDOWPOS(void) -{ - /* PWINDOWPOS */ - TEST_TYPE(PWINDOWPOS, 4, 4); - TEST_TYPE_POINTER(PWINDOWPOS, 28, 4); -} - -static void test_pack_PWNDCLASSA(void) -{ - /* PWNDCLASSA */ - TEST_TYPE(PWNDCLASSA, 4, 4); - TEST_TYPE_POINTER(PWNDCLASSA, 40, 4); -} - -static void test_pack_PWNDCLASSEXA(void) -{ - /* PWNDCLASSEXA */ - TEST_TYPE(PWNDCLASSEXA, 4, 4); - TEST_TYPE_POINTER(PWNDCLASSEXA, 48, 4); -} - -static void test_pack_PWNDCLASSEXW(void) -{ - /* PWNDCLASSEXW */ - TEST_TYPE(PWNDCLASSEXW, 4, 4); - TEST_TYPE_POINTER(PWNDCLASSEXW, 48, 4); -} - -static void test_pack_PWNDCLASSW(void) -{ - /* PWNDCLASSW */ - TEST_TYPE(PWNDCLASSW, 4, 4); - TEST_TYPE_POINTER(PWNDCLASSW, 40, 4); -} - -static void test_pack_SCROLLINFO(void) -{ - /* SCROLLINFO (pack 4) */ - TEST_TYPE(SCROLLINFO, 28, 4); - TEST_FIELD(SCROLLINFO, UINT, cbSize, 0, 4, 4); - TEST_FIELD(SCROLLINFO, UINT, fMask, 4, 4, 4); - TEST_FIELD(SCROLLINFO, INT, nMin, 8, 4, 4); - TEST_FIELD(SCROLLINFO, INT, nMax, 12, 4, 4); - TEST_FIELD(SCROLLINFO, UINT, nPage, 16, 4, 4); - TEST_FIELD(SCROLLINFO, INT, nPos, 20, 4, 4); - TEST_FIELD(SCROLLINFO, INT, nTrackPos, 24, 4, 4); -} - -static void test_pack_SENDASYNCPROC(void) -{ - /* SENDASYNCPROC */ - TEST_TYPE(SENDASYNCPROC, 4, 4); -} - -static void test_pack_SERIALKEYSA(void) -{ - /* SERIALKEYSA (pack 4) */ - TEST_TYPE(SERIALKEYSA, 28, 4); - TEST_FIELD(SERIALKEYSA, UINT, cbSize, 0, 4, 4); - TEST_FIELD(SERIALKEYSA, DWORD, dwFlags, 4, 4, 4); - TEST_FIELD(SERIALKEYSA, LPSTR, lpszActivePort, 8, 4, 4); - TEST_FIELD(SERIALKEYSA, LPSTR, lpszPort, 12, 4, 4); - TEST_FIELD(SERIALKEYSA, UINT, iBaudRate, 16, 4, 4); - TEST_FIELD(SERIALKEYSA, UINT, iPortState, 20, 4, 4); - TEST_FIELD(SERIALKEYSA, UINT, iActive, 24, 4, 4); -} - -static void test_pack_SERIALKEYSW(void) -{ - /* SERIALKEYSW (pack 4) */ - TEST_TYPE(SERIALKEYSW, 28, 4); - TEST_FIELD(SERIALKEYSW, UINT, cbSize, 0, 4, 4); - TEST_FIELD(SERIALKEYSW, DWORD, dwFlags, 4, 4, 4); - TEST_FIELD(SERIALKEYSW, LPWSTR, lpszActivePort, 8, 4, 4); - TEST_FIELD(SERIALKEYSW, LPWSTR, lpszPort, 12, 4, 4); - TEST_FIELD(SERIALKEYSW, UINT, iBaudRate, 16, 4, 4); - TEST_FIELD(SERIALKEYSW, UINT, iPortState, 20, 4, 4); - TEST_FIELD(SERIALKEYSW, UINT, iActive, 24, 4, 4); -} - -static void test_pack_SOUNDSENTRYA(void) -{ - /* SOUNDSENTRYA (pack 4) */ - TEST_TYPE(SOUNDSENTRYA, 48, 4); - TEST_FIELD(SOUNDSENTRYA, UINT, cbSize, 0, 4, 4); - TEST_FIELD(SOUNDSENTRYA, DWORD, dwFlags, 4, 4, 4); - TEST_FIELD(SOUNDSENTRYA, DWORD, iFSTextEffect, 8, 4, 4); - TEST_FIELD(SOUNDSENTRYA, DWORD, iFSTextEffectMSec, 12, 4, 4); - TEST_FIELD(SOUNDSENTRYA, DWORD, iFSTextEffectColorBits, 16, 4, 4); - TEST_FIELD(SOUNDSENTRYA, DWORD, iFSGrafEffect, 20, 4, 4); - TEST_FIELD(SOUNDSENTRYA, DWORD, iFSGrafEffectMSec, 24, 4, 4); - TEST_FIELD(SOUNDSENTRYA, DWORD, iFSGrafEffectColor, 28, 4, 4); - TEST_FIELD(SOUNDSENTRYA, DWORD, iWindowsEffect, 32, 4, 4); - TEST_FIELD(SOUNDSENTRYA, DWORD, iWindowsEffectMSec, 36, 4, 4); - TEST_FIELD(SOUNDSENTRYA, LPSTR, lpszWindowsEffectDLL, 40, 4, 4); - TEST_FIELD(SOUNDSENTRYA, DWORD, iWindowsEffectOrdinal, 44, 4, 4); -} - -static void test_pack_SOUNDSENTRYW(void) -{ - /* SOUNDSENTRYW (pack 4) */ - TEST_TYPE(SOUNDSENTRYW, 48, 4); - TEST_FIELD(SOUNDSENTRYW, UINT, cbSize, 0, 4, 4); - TEST_FIELD(SOUNDSENTRYW, DWORD, dwFlags, 4, 4, 4); - TEST_FIELD(SOUNDSENTRYW, DWORD, iFSTextEffect, 8, 4, 4); - TEST_FIELD(SOUNDSENTRYW, DWORD, iFSTextEffectMSec, 12, 4, 4); - TEST_FIELD(SOUNDSENTRYW, DWORD, iFSTextEffectColorBits, 16, 4, 4); - TEST_FIELD(SOUNDSENTRYW, DWORD, iFSGrafEffect, 20, 4, 4); - TEST_FIELD(SOUNDSENTRYW, DWORD, iFSGrafEffectMSec, 24, 4, 4); - TEST_FIELD(SOUNDSENTRYW, DWORD, iFSGrafEffectColor, 28, 4, 4); - TEST_FIELD(SOUNDSENTRYW, DWORD, iWindowsEffect, 32, 4, 4); - TEST_FIELD(SOUNDSENTRYW, DWORD, iWindowsEffectMSec, 36, 4, 4); - TEST_FIELD(SOUNDSENTRYW, LPWSTR, lpszWindowsEffectDLL, 40, 4, 4); - TEST_FIELD(SOUNDSENTRYW, DWORD, iWindowsEffectOrdinal, 44, 4, 4); -} - -static void test_pack_STICKYKEYS(void) -{ - /* STICKYKEYS (pack 4) */ - TEST_TYPE(STICKYKEYS, 8, 4); - TEST_FIELD(STICKYKEYS, DWORD, cbSize, 0, 4, 4); - TEST_FIELD(STICKYKEYS, DWORD, dwFlags, 4, 4, 4); -} - -static void test_pack_STYLESTRUCT(void) -{ - /* STYLESTRUCT (pack 4) */ - TEST_TYPE(STYLESTRUCT, 8, 4); - TEST_FIELD(STYLESTRUCT, DWORD, styleOld, 0, 4, 4); - TEST_FIELD(STYLESTRUCT, DWORD, styleNew, 4, 4, 4); -} - -static void test_pack_TIMERPROC(void) -{ - /* TIMERPROC */ - TEST_TYPE(TIMERPROC, 4, 4); -} - -static void test_pack_TITLEBARINFO(void) -{ - /* TITLEBARINFO (pack 4) */ - TEST_TYPE(TITLEBARINFO, 44, 4); - TEST_FIELD(TITLEBARINFO, DWORD, cbSize, 0, 4, 4); - TEST_FIELD(TITLEBARINFO, RECT, rcTitleBar, 4, 16, 4); - TEST_FIELD(TITLEBARINFO, DWORD[CCHILDREN_TITLEBAR+1], rgstate, 20, 24, 4); -} - -static void test_pack_TOGGLEKEYS(void) -{ - /* TOGGLEKEYS (pack 4) */ - TEST_TYPE(TOGGLEKEYS, 8, 4); - TEST_FIELD(TOGGLEKEYS, DWORD, cbSize, 0, 4, 4); - TEST_FIELD(TOGGLEKEYS, DWORD, dwFlags, 4, 4, 4); -} - -static void test_pack_TPMPARAMS(void) -{ - /* TPMPARAMS (pack 4) */ - TEST_TYPE(TPMPARAMS, 20, 4); - TEST_FIELD(TPMPARAMS, UINT, cbSize, 0, 4, 4); - TEST_FIELD(TPMPARAMS, RECT, rcExclude, 4, 16, 4); -} - -static void test_pack_TRACKMOUSEEVENT(void) -{ - /* TRACKMOUSEEVENT (pack 4) */ - TEST_TYPE(TRACKMOUSEEVENT, 16, 4); - TEST_FIELD(TRACKMOUSEEVENT, DWORD, cbSize, 0, 4, 4); - TEST_FIELD(TRACKMOUSEEVENT, DWORD, dwFlags, 4, 4, 4); - TEST_FIELD(TRACKMOUSEEVENT, HWND, hwndTrack, 8, 4, 4); - TEST_FIELD(TRACKMOUSEEVENT, DWORD, dwHoverTime, 12, 4, 4); -} - -static void test_pack_USEROBJECTFLAGS(void) -{ - /* USEROBJECTFLAGS (pack 4) */ - TEST_TYPE(USEROBJECTFLAGS, 12, 4); - TEST_FIELD(USEROBJECTFLAGS, BOOL, fInherit, 0, 4, 4); - TEST_FIELD(USEROBJECTFLAGS, BOOL, fReserved, 4, 4, 4); - TEST_FIELD(USEROBJECTFLAGS, DWORD, dwFlags, 8, 4, 4); -} - -static void test_pack_WINDOWINFO(void) -{ - /* WINDOWINFO (pack 4) */ - TEST_TYPE(WINDOWINFO, 60, 4); - TEST_FIELD(WINDOWINFO, DWORD, cbSize, 0, 4, 4); - TEST_FIELD(WINDOWINFO, RECT, rcWindow, 4, 16, 4); - TEST_FIELD(WINDOWINFO, RECT, rcClient, 20, 16, 4); - TEST_FIELD(WINDOWINFO, DWORD, dwStyle, 36, 4, 4); - TEST_FIELD(WINDOWINFO, DWORD, dwExStyle, 40, 4, 4); - TEST_FIELD(WINDOWINFO, DWORD, dwWindowStatus, 44, 4, 4); - TEST_FIELD(WINDOWINFO, UINT, cxWindowBorders, 48, 4, 4); - TEST_FIELD(WINDOWINFO, UINT, cyWindowBorders, 52, 4, 4); - TEST_FIELD(WINDOWINFO, ATOM, atomWindowType, 56, 2, 2); - TEST_FIELD(WINDOWINFO, WORD, wCreatorVersion, 58, 2, 2); -} - -static void test_pack_WINDOWPLACEMENT(void) -{ - /* WINDOWPLACEMENT (pack 4) */ - TEST_TYPE(WINDOWPLACEMENT, 44, 4); - TEST_FIELD(WINDOWPLACEMENT, UINT, length, 0, 4, 4); - TEST_FIELD(WINDOWPLACEMENT, UINT, flags, 4, 4, 4); - TEST_FIELD(WINDOWPLACEMENT, UINT, showCmd, 8, 4, 4); - TEST_FIELD(WINDOWPLACEMENT, POINT, ptMinPosition, 12, 8, 4); - TEST_FIELD(WINDOWPLACEMENT, POINT, ptMaxPosition, 20, 8, 4); - TEST_FIELD(WINDOWPLACEMENT, RECT, rcNormalPosition, 28, 16, 4); -} - -static void test_pack_WINDOWPOS(void) -{ - /* WINDOWPOS (pack 4) */ - TEST_TYPE(WINDOWPOS, 28, 4); - TEST_FIELD(WINDOWPOS, HWND, hwnd, 0, 4, 4); - TEST_FIELD(WINDOWPOS, HWND, hwndInsertAfter, 4, 4, 4); - TEST_FIELD(WINDOWPOS, INT, x, 8, 4, 4); - TEST_FIELD(WINDOWPOS, INT, y, 12, 4, 4); - TEST_FIELD(WINDOWPOS, INT, cx, 16, 4, 4); - TEST_FIELD(WINDOWPOS, INT, cy, 20, 4, 4); - TEST_FIELD(WINDOWPOS, UINT, flags, 24, 4, 4); -} - -static void test_pack_WINEVENTPROC(void) -{ - /* WINEVENTPROC */ - TEST_TYPE(WINEVENTPROC, 4, 4); -} - -static void test_pack_WINSTAENUMPROCA(void) -{ - /* WINSTAENUMPROCA */ - TEST_TYPE(WINSTAENUMPROCA, 4, 4); -} - -static void test_pack_WINSTAENUMPROCW(void) -{ - /* WINSTAENUMPROCW */ - TEST_TYPE(WINSTAENUMPROCW, 4, 4); -} - -static void test_pack_WNDCLASSA(void) -{ - /* WNDCLASSA (pack 4) */ - TEST_TYPE(WNDCLASSA, 40, 4); - TEST_FIELD(WNDCLASSA, UINT, style, 0, 4, 4); - TEST_FIELD(WNDCLASSA, WNDPROC, lpfnWndProc, 4, 4, 4); - TEST_FIELD(WNDCLASSA, INT, cbClsExtra, 8, 4, 4); - TEST_FIELD(WNDCLASSA, INT, cbWndExtra, 12, 4, 4); - TEST_FIELD(WNDCLASSA, HINSTANCE, hInstance, 16, 4, 4); - TEST_FIELD(WNDCLASSA, HICON, hIcon, 20, 4, 4); - TEST_FIELD(WNDCLASSA, HCURSOR, hCursor, 24, 4, 4); - TEST_FIELD(WNDCLASSA, HBRUSH, hbrBackground, 28, 4, 4); - TEST_FIELD(WNDCLASSA, LPCSTR, lpszMenuName, 32, 4, 4); - TEST_FIELD(WNDCLASSA, LPCSTR, lpszClassName, 36, 4, 4); -} - -static void test_pack_WNDCLASSEXA(void) -{ - /* WNDCLASSEXA (pack 4) */ - TEST_TYPE(WNDCLASSEXA, 48, 4); - TEST_FIELD(WNDCLASSEXA, UINT, cbSize, 0, 4, 4); - TEST_FIELD(WNDCLASSEXA, UINT, style, 4, 4, 4); - TEST_FIELD(WNDCLASSEXA, WNDPROC, lpfnWndProc, 8, 4, 4); - TEST_FIELD(WNDCLASSEXA, INT, cbClsExtra, 12, 4, 4); - TEST_FIELD(WNDCLASSEXA, INT, cbWndExtra, 16, 4, 4); - TEST_FIELD(WNDCLASSEXA, HINSTANCE, hInstance, 20, 4, 4); - TEST_FIELD(WNDCLASSEXA, HICON, hIcon, 24, 4, 4); - TEST_FIELD(WNDCLASSEXA, HCURSOR, hCursor, 28, 4, 4); - TEST_FIELD(WNDCLASSEXA, HBRUSH, hbrBackground, 32, 4, 4); - TEST_FIELD(WNDCLASSEXA, LPCSTR, lpszMenuName, 36, 4, 4); - TEST_FIELD(WNDCLASSEXA, LPCSTR, lpszClassName, 40, 4, 4); - TEST_FIELD(WNDCLASSEXA, HICON, hIconSm, 44, 4, 4); -} - -static void test_pack_WNDCLASSEXW(void) -{ - /* WNDCLASSEXW (pack 4) */ - TEST_TYPE(WNDCLASSEXW, 48, 4); - TEST_FIELD(WNDCLASSEXW, UINT, cbSize, 0, 4, 4); - TEST_FIELD(WNDCLASSEXW, UINT, style, 4, 4, 4); - TEST_FIELD(WNDCLASSEXW, WNDPROC, lpfnWndProc, 8, 4, 4); - TEST_FIELD(WNDCLASSEXW, INT, cbClsExtra, 12, 4, 4); - TEST_FIELD(WNDCLASSEXW, INT, cbWndExtra, 16, 4, 4); - TEST_FIELD(WNDCLASSEXW, HINSTANCE, hInstance, 20, 4, 4); - TEST_FIELD(WNDCLASSEXW, HICON, hIcon, 24, 4, 4); - TEST_FIELD(WNDCLASSEXW, HCURSOR, hCursor, 28, 4, 4); - TEST_FIELD(WNDCLASSEXW, HBRUSH, hbrBackground, 32, 4, 4); - TEST_FIELD(WNDCLASSEXW, LPCWSTR, lpszMenuName, 36, 4, 4); - TEST_FIELD(WNDCLASSEXW, LPCWSTR, lpszClassName, 40, 4, 4); - TEST_FIELD(WNDCLASSEXW, HICON, hIconSm, 44, 4, 4); -} - -static void test_pack_WNDCLASSW(void) -{ - /* WNDCLASSW (pack 4) */ - TEST_TYPE(WNDCLASSW, 40, 4); - TEST_FIELD(WNDCLASSW, UINT, style, 0, 4, 4); - TEST_FIELD(WNDCLASSW, WNDPROC, lpfnWndProc, 4, 4, 4); - TEST_FIELD(WNDCLASSW, INT, cbClsExtra, 8, 4, 4); - TEST_FIELD(WNDCLASSW, INT, cbWndExtra, 12, 4, 4); - TEST_FIELD(WNDCLASSW, HINSTANCE, hInstance, 16, 4, 4); - TEST_FIELD(WNDCLASSW, HICON, hIcon, 20, 4, 4); - TEST_FIELD(WNDCLASSW, HCURSOR, hCursor, 24, 4, 4); - TEST_FIELD(WNDCLASSW, HBRUSH, hbrBackground, 28, 4, 4); - TEST_FIELD(WNDCLASSW, LPCWSTR, lpszMenuName, 32, 4, 4); - TEST_FIELD(WNDCLASSW, LPCWSTR, lpszClassName, 36, 4, 4); -} - -static void test_pack_WNDENUMPROC(void) -{ - /* WNDENUMPROC */ - TEST_TYPE(WNDENUMPROC, 4, 4); -} - -static void test_pack_WNDPROC(void) -{ - /* WNDPROC */ - TEST_TYPE(WNDPROC, 4, 4); -} - -static void test_pack(void) -{ - test_pack_ACCESSTIMEOUT(); - test_pack_ANIMATIONINFO(); - test_pack_CBTACTIVATESTRUCT(); - test_pack_CBT_CREATEWNDA(); - test_pack_CBT_CREATEWNDW(); - test_pack_CLIENTCREATESTRUCT(); - test_pack_COMBOBOXINFO(); - test_pack_COMPAREITEMSTRUCT(); - test_pack_COPYDATASTRUCT(); - test_pack_CREATESTRUCTA(); - test_pack_CREATESTRUCTW(); - test_pack_CURSORINFO(); - test_pack_CWPRETSTRUCT(); - test_pack_CWPSTRUCT(); - test_pack_DEBUGHOOKINFO(); - test_pack_DELETEITEMSTRUCT(); - test_pack_DESKTOPENUMPROCA(); - test_pack_DESKTOPENUMPROCW(); - test_pack_DLGITEMTEMPLATE(); - test_pack_DLGPROC(); - test_pack_DLGTEMPLATE(); - test_pack_DRAWITEMSTRUCT(); - test_pack_DRAWSTATEPROC(); - test_pack_DRAWTEXTPARAMS(); - test_pack_EDITWORDBREAKPROCA(); - test_pack_EDITWORDBREAKPROCW(); - test_pack_EVENTMSG(); - test_pack_FILTERKEYS(); - test_pack_FLASHWINFO(); - test_pack_GRAYSTRINGPROC(); - test_pack_GUITHREADINFO(); - test_pack_HARDWAREHOOKSTRUCT(); - test_pack_HARDWAREINPUT(); - test_pack_HDEVNOTIFY(); - test_pack_HDWP(); - test_pack_HELPINFO(); - test_pack_HELPWININFOA(); - test_pack_HELPWININFOW(); - test_pack_HIGHCONTRASTA(); - test_pack_HIGHCONTRASTW(); - test_pack_HOOKPROC(); - test_pack_ICONINFO(); - test_pack_ICONMETRICSA(); - test_pack_ICONMETRICSW(); - test_pack_INPUT(); - test_pack_KBDLLHOOKSTRUCT(); - test_pack_KEYBDINPUT(); - test_pack_LPACCESSTIMEOUT(); - test_pack_LPANIMATIONINFO(); - test_pack_LPCBTACTIVATESTRUCT(); - test_pack_LPCBT_CREATEWNDA(); - test_pack_LPCBT_CREATEWNDW(); - test_pack_LPCDLGTEMPLATEA(); - test_pack_LPCDLGTEMPLATEW(); - test_pack_LPCLIENTCREATESTRUCT(); - test_pack_LPCMENUINFO(); - test_pack_LPCMENUITEMINFOA(); - test_pack_LPCMENUITEMINFOW(); - test_pack_LPCOMBOBOXINFO(); - test_pack_LPCOMPAREITEMSTRUCT(); - test_pack_LPCREATESTRUCTA(); - test_pack_LPCREATESTRUCTW(); - test_pack_LPCSCROLLINFO(); - test_pack_LPCURSORINFO(); - test_pack_LPCWPRETSTRUCT(); - test_pack_LPCWPSTRUCT(); - test_pack_LPDEBUGHOOKINFO(); - test_pack_LPDELETEITEMSTRUCT(); - test_pack_LPDLGITEMTEMPLATEA(); - test_pack_LPDLGITEMTEMPLATEW(); - test_pack_LPDLGTEMPLATEA(); - test_pack_LPDLGTEMPLATEW(); - test_pack_LPDRAWITEMSTRUCT(); - test_pack_LPDRAWTEXTPARAMS(); - test_pack_LPEVENTMSG(); - test_pack_LPFILTERKEYS(); - test_pack_LPGUITHREADINFO(); - test_pack_LPHARDWAREHOOKSTRUCT(); - test_pack_LPHARDWAREINPUT(); - test_pack_LPHELPINFO(); - test_pack_LPHELPWININFOA(); - test_pack_LPHELPWININFOW(); - test_pack_LPHIGHCONTRASTA(); - test_pack_LPHIGHCONTRASTW(); - test_pack_LPICONMETRICSA(); - test_pack_LPICONMETRICSW(); - test_pack_LPINPUT(); - test_pack_LPKBDLLHOOKSTRUCT(); - test_pack_LPKEYBDINPUT(); - test_pack_LPMDICREATESTRUCTA(); - test_pack_LPMDICREATESTRUCTW(); - test_pack_LPMDINEXTMENU(); - test_pack_LPMEASUREITEMSTRUCT(); - test_pack_LPMENUINFO(); - test_pack_LPMENUITEMINFOA(); - test_pack_LPMENUITEMINFOW(); - test_pack_LPMINIMIZEDMETRICS(); - test_pack_LPMINMAXINFO(); - test_pack_LPMONITORINFO(); - test_pack_LPMONITORINFOEXA(); - test_pack_LPMONITORINFOEXW(); - test_pack_LPMOUSEHOOKSTRUCT(); - test_pack_LPMOUSEINPUT(); - test_pack_LPMOUSEKEYS(); - test_pack_LPMSG(); - test_pack_LPMSGBOXPARAMSA(); - test_pack_LPMSGBOXPARAMSW(); - test_pack_LPMSLLHOOKSTRUCT(); - test_pack_LPMULTIKEYHELPA(); - test_pack_LPMULTIKEYHELPW(); - test_pack_LPNCCALCSIZE_PARAMS(); - test_pack_LPNMHDR(); - test_pack_LPNONCLIENTMETRICSA(); - test_pack_LPNONCLIENTMETRICSW(); - test_pack_LPPAINTSTRUCT(); - test_pack_LPSCROLLINFO(); - test_pack_LPSERIALKEYSA(); - test_pack_LPSERIALKEYSW(); - test_pack_LPSOUNDSENTRYA(); - test_pack_LPSOUNDSENTRYW(); - test_pack_LPSTICKYKEYS(); - test_pack_LPSTYLESTRUCT(); - test_pack_LPTITLEBARINFO(); - test_pack_LPTOGGLEKEYS(); - test_pack_LPTPMPARAMS(); - test_pack_LPTRACKMOUSEEVENT(); - test_pack_LPWINDOWINFO(); - test_pack_LPWINDOWPLACEMENT(); - test_pack_LPWINDOWPOS(); - test_pack_LPWNDCLASSA(); - test_pack_LPWNDCLASSEXA(); - test_pack_LPWNDCLASSEXW(); - test_pack_LPWNDCLASSW(); - test_pack_MDICREATESTRUCTA(); - test_pack_MDICREATESTRUCTW(); - test_pack_MDINEXTMENU(); - test_pack_MEASUREITEMSTRUCT(); - test_pack_MENUINFO(); - test_pack_MENUITEMINFOA(); - test_pack_MENUITEMINFOW(); - test_pack_MENUITEMTEMPLATE(); - test_pack_MENUITEMTEMPLATEHEADER(); - test_pack_MINIMIZEDMETRICS(); - test_pack_MINMAXINFO(); - test_pack_MONITORENUMPROC(); - test_pack_MONITORINFO(); - test_pack_MONITORINFOEXA(); - test_pack_MONITORINFOEXW(); - test_pack_MOUSEHOOKSTRUCT(); - test_pack_MOUSEINPUT(); - test_pack_MOUSEKEYS(); - test_pack_MSG(); - test_pack_MSGBOXCALLBACK(); - test_pack_MSGBOXPARAMSA(); - test_pack_MSGBOXPARAMSW(); - test_pack_MSLLHOOKSTRUCT(); - test_pack_MULTIKEYHELPA(); - test_pack_MULTIKEYHELPW(); - test_pack_NAMEENUMPROCA(); - test_pack_NAMEENUMPROCW(); - test_pack_NCCALCSIZE_PARAMS(); - test_pack_NMHDR(); - test_pack_NONCLIENTMETRICSA(); - test_pack_NONCLIENTMETRICSW(); - test_pack_PAINTSTRUCT(); - test_pack_PCOMBOBOXINFO(); - test_pack_PCOMPAREITEMSTRUCT(); - test_pack_PCOPYDATASTRUCT(); - test_pack_PCURSORINFO(); - test_pack_PCWPRETSTRUCT(); - test_pack_PCWPSTRUCT(); - test_pack_PDEBUGHOOKINFO(); - test_pack_PDELETEITEMSTRUCT(); - test_pack_PDLGITEMTEMPLATEA(); - test_pack_PDLGITEMTEMPLATEW(); - test_pack_PDRAWITEMSTRUCT(); - test_pack_PEVENTMSG(); - test_pack_PFLASHWINFO(); - test_pack_PGUITHREADINFO(); - test_pack_PHARDWAREHOOKSTRUCT(); - test_pack_PHARDWAREINPUT(); - test_pack_PHDEVNOTIFY(); - test_pack_PHELPWININFOA(); - test_pack_PHELPWININFOW(); - test_pack_PICONINFO(); - test_pack_PICONMETRICSA(); - test_pack_PICONMETRICSW(); - test_pack_PINPUT(); - test_pack_PKBDLLHOOKSTRUCT(); - test_pack_PKEYBDINPUT(); - test_pack_PMDINEXTMENU(); - test_pack_PMEASUREITEMSTRUCT(); - test_pack_PMENUITEMTEMPLATE(); - test_pack_PMENUITEMTEMPLATEHEADER(); - test_pack_PMINIMIZEDMETRICS(); - test_pack_PMINMAXINFO(); - test_pack_PMOUSEHOOKSTRUCT(); - test_pack_PMOUSEINPUT(); - test_pack_PMSG(); - test_pack_PMSGBOXPARAMSA(); - test_pack_PMSGBOXPARAMSW(); - test_pack_PMSLLHOOKSTRUCT(); - test_pack_PMULTIKEYHELPA(); - test_pack_PMULTIKEYHELPW(); - test_pack_PNONCLIENTMETRICSA(); - test_pack_PNONCLIENTMETRICSW(); - test_pack_PPAINTSTRUCT(); - test_pack_PROPENUMPROCA(); - test_pack_PROPENUMPROCEXA(); - test_pack_PROPENUMPROCEXW(); - test_pack_PROPENUMPROCW(); - test_pack_PTITLEBARINFO(); - test_pack_PUSEROBJECTFLAGS(); - test_pack_PWINDOWINFO(); - test_pack_PWINDOWPLACEMENT(); - test_pack_PWINDOWPOS(); - test_pack_PWNDCLASSA(); - test_pack_PWNDCLASSEXA(); - test_pack_PWNDCLASSEXW(); - test_pack_PWNDCLASSW(); - test_pack_SCROLLINFO(); - test_pack_SENDASYNCPROC(); - test_pack_SERIALKEYSA(); - test_pack_SERIALKEYSW(); - test_pack_SOUNDSENTRYA(); - test_pack_SOUNDSENTRYW(); - test_pack_STICKYKEYS(); - test_pack_STYLESTRUCT(); - test_pack_TIMERPROC(); - test_pack_TITLEBARINFO(); - test_pack_TOGGLEKEYS(); - test_pack_TPMPARAMS(); - test_pack_TRACKMOUSEEVENT(); - test_pack_USEROBJECTFLAGS(); - test_pack_WINDOWINFO(); - test_pack_WINDOWPLACEMENT(); - test_pack_WINDOWPOS(); - test_pack_WINEVENTPROC(); - test_pack_WINSTAENUMPROCA(); - test_pack_WINSTAENUMPROCW(); - test_pack_WNDCLASSA(); - test_pack_WNDCLASSEXA(); - test_pack_WNDCLASSEXW(); - test_pack_WNDCLASSW(); - test_pack_WNDENUMPROC(); - test_pack_WNDPROC(); -} - -START_TEST(generated) -{ - test_pack(); -} +/* File generated automatically from tools/winapi/tests.dat; do not edit! */ +/* This file can be copied, modified and distributed without restriction. */ + +/* + * Unit tests for data structure packing + */ + +#define WINVER 0x0501 +#define _WIN32_IE 0x0501 +#define _WIN32_WINNT 0x0501 + +#define WINE_NOWINSOCK + +#include "windows.h" + +#include "wine/test.h" + +/*********************************************************************** + * Compatibility macros + */ + +#define DWORD_PTR UINT_PTR +#define LONG_PTR INT_PTR +#define ULONG_PTR UINT_PTR + +/*********************************************************************** + * Windows API extension + */ + +#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) +# define _TYPE_ALIGNMENT(type) __alignof(type) +#elif defined(__GNUC__) +# define _TYPE_ALIGNMENT(type) __alignof__(type) +#else +/* + * FIXME: May not be possible without a compiler extension + * (if type is not just a name that is, otherwise the normal + * TYPE_ALIGNMENT can be used) + */ +#endif + +#if defined(TYPE_ALIGNMENT) && defined(_MSC_VER) && _MSC_VER >= 800 && !defined(__cplusplus) +#pragma warning(disable:4116) +#endif + +#if !defined(TYPE_ALIGNMENT) && defined(_TYPE_ALIGNMENT) +# define TYPE_ALIGNMENT _TYPE_ALIGNMENT +#endif + +/*********************************************************************** + * Test helper macros + */ + +#ifdef _WIN64 + +# define TEST_TYPE_SIZE(type, size) +# define TEST_TYPE_ALIGN(type, align) +# define TEST_TARGET_ALIGN(type, align) +# define TEST_FIELD_ALIGN(type, field, align) +# define TEST_FIELD_OFFSET(type, field, offset) + +#else + +# define TEST_TYPE_SIZE(type, size) C_ASSERT(sizeof(type) == size); + +# ifdef TYPE_ALIGNMENT +# define TEST_TYPE_ALIGN(type, align) C_ASSERT(TYPE_ALIGNMENT(type) == align); +# else +# define TEST_TYPE_ALIGN(type, align) +# endif + +# ifdef _TYPE_ALIGNMENT +# define TEST_TARGET_ALIGN(type, align) C_ASSERT(_TYPE_ALIGNMENT(*(type)0) == align); +# define TEST_FIELD_ALIGN(type, field, align) C_ASSERT(_TYPE_ALIGNMENT(((type*)0)->field) == align); +# else +# define TEST_TARGET_ALIGN(type, align) +# define TEST_FIELD_ALIGN(type, field, align) +# endif + +# define TEST_FIELD_OFFSET(type, field, offset) C_ASSERT(FIELD_OFFSET(type, field) == offset); + +#endif + +#define TEST_TARGET_SIZE(type, size) TEST_TYPE_SIZE(*(type)0, size) +#define TEST_FIELD_SIZE(type, field, size) TEST_TYPE_SIZE((((type*)0)->field), size) +#define TEST_TYPE_SIGNED(type) C_ASSERT((type) -1 < 0); +#define TEST_TYPE_UNSIGNED(type) C_ASSERT((type) -1 > 0); + + +static void test_pack_ACCESSTIMEOUT(void) +{ + /* ACCESSTIMEOUT (pack 4) */ + TEST_TYPE_SIZE (ACCESSTIMEOUT, 12) + TEST_TYPE_ALIGN (ACCESSTIMEOUT, 4) + TEST_FIELD_SIZE (ACCESSTIMEOUT, cbSize, 4) + TEST_FIELD_ALIGN (ACCESSTIMEOUT, cbSize, 4) + TEST_FIELD_OFFSET(ACCESSTIMEOUT, cbSize, 0) + TEST_FIELD_SIZE (ACCESSTIMEOUT, dwFlags, 4) + TEST_FIELD_ALIGN (ACCESSTIMEOUT, dwFlags, 4) + TEST_FIELD_OFFSET(ACCESSTIMEOUT, dwFlags, 4) + TEST_FIELD_SIZE (ACCESSTIMEOUT, iTimeOutMSec, 4) + TEST_FIELD_ALIGN (ACCESSTIMEOUT, iTimeOutMSec, 4) + TEST_FIELD_OFFSET(ACCESSTIMEOUT, iTimeOutMSec, 8) +} + +static void test_pack_ANIMATIONINFO(void) +{ + /* ANIMATIONINFO (pack 4) */ + TEST_TYPE_SIZE (ANIMATIONINFO, 8) + TEST_TYPE_ALIGN (ANIMATIONINFO, 4) + TEST_FIELD_SIZE (ANIMATIONINFO, cbSize, 4) + TEST_FIELD_ALIGN (ANIMATIONINFO, cbSize, 4) + TEST_FIELD_OFFSET(ANIMATIONINFO, cbSize, 0) + TEST_FIELD_SIZE (ANIMATIONINFO, iMinAnimate, 4) + TEST_FIELD_ALIGN (ANIMATIONINFO, iMinAnimate, 4) + TEST_FIELD_OFFSET(ANIMATIONINFO, iMinAnimate, 4) +} + +static void test_pack_CBTACTIVATESTRUCT(void) +{ + /* CBTACTIVATESTRUCT (pack 4) */ + TEST_TYPE_SIZE (CBTACTIVATESTRUCT, 8) + TEST_TYPE_ALIGN (CBTACTIVATESTRUCT, 4) + TEST_FIELD_SIZE (CBTACTIVATESTRUCT, fMouse, 4) + TEST_FIELD_ALIGN (CBTACTIVATESTRUCT, fMouse, 4) + TEST_FIELD_OFFSET(CBTACTIVATESTRUCT, fMouse, 0) + TEST_FIELD_SIZE (CBTACTIVATESTRUCT, hWndActive, 4) + TEST_FIELD_ALIGN (CBTACTIVATESTRUCT, hWndActive, 4) + TEST_FIELD_OFFSET(CBTACTIVATESTRUCT, hWndActive, 4) +} + +static void test_pack_CBT_CREATEWNDA(void) +{ + /* CBT_CREATEWNDA (pack 4) */ + TEST_TYPE_SIZE (CBT_CREATEWNDA, 8) + TEST_TYPE_ALIGN (CBT_CREATEWNDA, 4) + TEST_FIELD_SIZE (CBT_CREATEWNDA, lpcs, 4) + TEST_FIELD_ALIGN (CBT_CREATEWNDA, lpcs, 4) + TEST_FIELD_OFFSET(CBT_CREATEWNDA, lpcs, 0) + TEST_FIELD_SIZE (CBT_CREATEWNDA, hwndInsertAfter, 4) + TEST_FIELD_ALIGN (CBT_CREATEWNDA, hwndInsertAfter, 4) + TEST_FIELD_OFFSET(CBT_CREATEWNDA, hwndInsertAfter, 4) +} + +static void test_pack_CBT_CREATEWNDW(void) +{ + /* CBT_CREATEWNDW (pack 4) */ + TEST_TYPE_SIZE (CBT_CREATEWNDW, 8) + TEST_TYPE_ALIGN (CBT_CREATEWNDW, 4) + TEST_FIELD_SIZE (CBT_CREATEWNDW, lpcs, 4) + TEST_FIELD_ALIGN (CBT_CREATEWNDW, lpcs, 4) + TEST_FIELD_OFFSET(CBT_CREATEWNDW, lpcs, 0) + TEST_FIELD_SIZE (CBT_CREATEWNDW, hwndInsertAfter, 4) + TEST_FIELD_ALIGN (CBT_CREATEWNDW, hwndInsertAfter, 4) + TEST_FIELD_OFFSET(CBT_CREATEWNDW, hwndInsertAfter, 4) +} + +static void test_pack_CLIENTCREATESTRUCT(void) +{ + /* CLIENTCREATESTRUCT (pack 4) */ + TEST_TYPE_SIZE (CLIENTCREATESTRUCT, 8) + TEST_TYPE_ALIGN (CLIENTCREATESTRUCT, 4) + TEST_FIELD_SIZE (CLIENTCREATESTRUCT, hWindowMenu, 4) + TEST_FIELD_ALIGN (CLIENTCREATESTRUCT, hWindowMenu, 4) + TEST_FIELD_OFFSET(CLIENTCREATESTRUCT, hWindowMenu, 0) + TEST_FIELD_SIZE (CLIENTCREATESTRUCT, idFirstChild, 4) + TEST_FIELD_ALIGN (CLIENTCREATESTRUCT, idFirstChild, 4) + TEST_FIELD_OFFSET(CLIENTCREATESTRUCT, idFirstChild, 4) +} + +static void test_pack_COMBOBOXINFO(void) +{ + /* COMBOBOXINFO (pack 4) */ + TEST_TYPE_SIZE (COMBOBOXINFO, 52) + TEST_TYPE_ALIGN (COMBOBOXINFO, 4) + TEST_FIELD_SIZE (COMBOBOXINFO, cbSize, 4) + TEST_FIELD_ALIGN (COMBOBOXINFO, cbSize, 4) + TEST_FIELD_OFFSET(COMBOBOXINFO, cbSize, 0) + TEST_FIELD_SIZE (COMBOBOXINFO, rcItem, 16) + TEST_FIELD_ALIGN (COMBOBOXINFO, rcItem, 4) + TEST_FIELD_OFFSET(COMBOBOXINFO, rcItem, 4) + TEST_FIELD_SIZE (COMBOBOXINFO, rcButton, 16) + TEST_FIELD_ALIGN (COMBOBOXINFO, rcButton, 4) + TEST_FIELD_OFFSET(COMBOBOXINFO, rcButton, 20) + TEST_FIELD_SIZE (COMBOBOXINFO, stateButton, 4) + TEST_FIELD_ALIGN (COMBOBOXINFO, stateButton, 4) + TEST_FIELD_OFFSET(COMBOBOXINFO, stateButton, 36) + TEST_FIELD_SIZE (COMBOBOXINFO, hwndCombo, 4) + TEST_FIELD_ALIGN (COMBOBOXINFO, hwndCombo, 4) + TEST_FIELD_OFFSET(COMBOBOXINFO, hwndCombo, 40) + TEST_FIELD_SIZE (COMBOBOXINFO, hwndItem, 4) + TEST_FIELD_ALIGN (COMBOBOXINFO, hwndItem, 4) + TEST_FIELD_OFFSET(COMBOBOXINFO, hwndItem, 44) + TEST_FIELD_SIZE (COMBOBOXINFO, hwndList, 4) + TEST_FIELD_ALIGN (COMBOBOXINFO, hwndList, 4) + TEST_FIELD_OFFSET(COMBOBOXINFO, hwndList, 48) +} + +static void test_pack_COMPAREITEMSTRUCT(void) +{ + /* COMPAREITEMSTRUCT (pack 4) */ + TEST_TYPE_SIZE (COMPAREITEMSTRUCT, 32) + TEST_TYPE_ALIGN (COMPAREITEMSTRUCT, 4) + TEST_FIELD_SIZE (COMPAREITEMSTRUCT, CtlType, 4) + TEST_FIELD_ALIGN (COMPAREITEMSTRUCT, CtlType, 4) + TEST_FIELD_OFFSET(COMPAREITEMSTRUCT, CtlType, 0) + TEST_FIELD_SIZE (COMPAREITEMSTRUCT, CtlID, 4) + TEST_FIELD_ALIGN (COMPAREITEMSTRUCT, CtlID, 4) + TEST_FIELD_OFFSET(COMPAREITEMSTRUCT, CtlID, 4) + TEST_FIELD_SIZE (COMPAREITEMSTRUCT, hwndItem, 4) + TEST_FIELD_ALIGN (COMPAREITEMSTRUCT, hwndItem, 4) + TEST_FIELD_OFFSET(COMPAREITEMSTRUCT, hwndItem, 8) + TEST_FIELD_SIZE (COMPAREITEMSTRUCT, itemID1, 4) + TEST_FIELD_ALIGN (COMPAREITEMSTRUCT, itemID1, 4) + TEST_FIELD_OFFSET(COMPAREITEMSTRUCT, itemID1, 12) + TEST_FIELD_SIZE (COMPAREITEMSTRUCT, itemData1, 4) + TEST_FIELD_ALIGN (COMPAREITEMSTRUCT, itemData1, 4) + TEST_FIELD_OFFSET(COMPAREITEMSTRUCT, itemData1, 16) + TEST_FIELD_SIZE (COMPAREITEMSTRUCT, itemID2, 4) + TEST_FIELD_ALIGN (COMPAREITEMSTRUCT, itemID2, 4) + TEST_FIELD_OFFSET(COMPAREITEMSTRUCT, itemID2, 20) + TEST_FIELD_SIZE (COMPAREITEMSTRUCT, itemData2, 4) + TEST_FIELD_ALIGN (COMPAREITEMSTRUCT, itemData2, 4) + TEST_FIELD_OFFSET(COMPAREITEMSTRUCT, itemData2, 24) + TEST_FIELD_SIZE (COMPAREITEMSTRUCT, dwLocaleId, 4) + TEST_FIELD_ALIGN (COMPAREITEMSTRUCT, dwLocaleId, 4) + TEST_FIELD_OFFSET(COMPAREITEMSTRUCT, dwLocaleId, 28) +} + +static void test_pack_COPYDATASTRUCT(void) +{ + /* COPYDATASTRUCT (pack 4) */ + TEST_TYPE_SIZE (COPYDATASTRUCT, 12) + TEST_TYPE_ALIGN (COPYDATASTRUCT, 4) + TEST_FIELD_SIZE (COPYDATASTRUCT, dwData, 4) + TEST_FIELD_ALIGN (COPYDATASTRUCT, dwData, 4) + TEST_FIELD_OFFSET(COPYDATASTRUCT, dwData, 0) + TEST_FIELD_SIZE (COPYDATASTRUCT, cbData, 4) + TEST_FIELD_ALIGN (COPYDATASTRUCT, cbData, 4) + TEST_FIELD_OFFSET(COPYDATASTRUCT, cbData, 4) + TEST_FIELD_SIZE (COPYDATASTRUCT, lpData, 4) + TEST_FIELD_ALIGN (COPYDATASTRUCT, lpData, 4) + TEST_FIELD_OFFSET(COPYDATASTRUCT, lpData, 8) +} + +static void test_pack_CREATESTRUCTA(void) +{ + /* CREATESTRUCTA (pack 4) */ + TEST_TYPE_SIZE (CREATESTRUCTA, 48) + TEST_TYPE_ALIGN (CREATESTRUCTA, 4) + TEST_FIELD_SIZE (CREATESTRUCTA, lpCreateParams, 4) + TEST_FIELD_ALIGN (CREATESTRUCTA, lpCreateParams, 4) + TEST_FIELD_OFFSET(CREATESTRUCTA, lpCreateParams, 0) + TEST_FIELD_SIZE (CREATESTRUCTA, hInstance, 4) + TEST_FIELD_ALIGN (CREATESTRUCTA, hInstance, 4) + TEST_FIELD_OFFSET(CREATESTRUCTA, hInstance, 4) + TEST_FIELD_SIZE (CREATESTRUCTA, hMenu, 4) + TEST_FIELD_ALIGN (CREATESTRUCTA, hMenu, 4) + TEST_FIELD_OFFSET(CREATESTRUCTA, hMenu, 8) + TEST_FIELD_SIZE (CREATESTRUCTA, hwndParent, 4) + TEST_FIELD_ALIGN (CREATESTRUCTA, hwndParent, 4) + TEST_FIELD_OFFSET(CREATESTRUCTA, hwndParent, 12) + TEST_FIELD_SIZE (CREATESTRUCTA, cy, 4) + TEST_FIELD_ALIGN (CREATESTRUCTA, cy, 4) + TEST_FIELD_OFFSET(CREATESTRUCTA, cy, 16) + TEST_FIELD_SIZE (CREATESTRUCTA, cx, 4) + TEST_FIELD_ALIGN (CREATESTRUCTA, cx, 4) + TEST_FIELD_OFFSET(CREATESTRUCTA, cx, 20) + TEST_FIELD_SIZE (CREATESTRUCTA, y, 4) + TEST_FIELD_ALIGN (CREATESTRUCTA, y, 4) + TEST_FIELD_OFFSET(CREATESTRUCTA, y, 24) + TEST_FIELD_SIZE (CREATESTRUCTA, x, 4) + TEST_FIELD_ALIGN (CREATESTRUCTA, x, 4) + TEST_FIELD_OFFSET(CREATESTRUCTA, x, 28) + TEST_FIELD_SIZE (CREATESTRUCTA, style, 4) + TEST_FIELD_ALIGN (CREATESTRUCTA, style, 4) + TEST_FIELD_OFFSET(CREATESTRUCTA, style, 32) + TEST_FIELD_SIZE (CREATESTRUCTA, lpszName, 4) + TEST_FIELD_ALIGN (CREATESTRUCTA, lpszName, 4) + TEST_FIELD_OFFSET(CREATESTRUCTA, lpszName, 36) + TEST_FIELD_SIZE (CREATESTRUCTA, lpszClass, 4) + TEST_FIELD_ALIGN (CREATESTRUCTA, lpszClass, 4) + TEST_FIELD_OFFSET(CREATESTRUCTA, lpszClass, 40) + TEST_FIELD_SIZE (CREATESTRUCTA, dwExStyle, 4) + TEST_FIELD_ALIGN (CREATESTRUCTA, dwExStyle, 4) + TEST_FIELD_OFFSET(CREATESTRUCTA, dwExStyle, 44) +} + +static void test_pack_CREATESTRUCTW(void) +{ + /* CREATESTRUCTW (pack 4) */ + TEST_TYPE_SIZE (CREATESTRUCTW, 48) + TEST_TYPE_ALIGN (CREATESTRUCTW, 4) + TEST_FIELD_SIZE (CREATESTRUCTW, lpCreateParams, 4) + TEST_FIELD_ALIGN (CREATESTRUCTW, lpCreateParams, 4) + TEST_FIELD_OFFSET(CREATESTRUCTW, lpCreateParams, 0) + TEST_FIELD_SIZE (CREATESTRUCTW, hInstance, 4) + TEST_FIELD_ALIGN (CREATESTRUCTW, hInstance, 4) + TEST_FIELD_OFFSET(CREATESTRUCTW, hInstance, 4) + TEST_FIELD_SIZE (CREATESTRUCTW, hMenu, 4) + TEST_FIELD_ALIGN (CREATESTRUCTW, hMenu, 4) + TEST_FIELD_OFFSET(CREATESTRUCTW, hMenu, 8) + TEST_FIELD_SIZE (CREATESTRUCTW, hwndParent, 4) + TEST_FIELD_ALIGN (CREATESTRUCTW, hwndParent, 4) + TEST_FIELD_OFFSET(CREATESTRUCTW, hwndParent, 12) + TEST_FIELD_SIZE (CREATESTRUCTW, cy, 4) + TEST_FIELD_ALIGN (CREATESTRUCTW, cy, 4) + TEST_FIELD_OFFSET(CREATESTRUCTW, cy, 16) + TEST_FIELD_SIZE (CREATESTRUCTW, cx, 4) + TEST_FIELD_ALIGN (CREATESTRUCTW, cx, 4) + TEST_FIELD_OFFSET(CREATESTRUCTW, cx, 20) + TEST_FIELD_SIZE (CREATESTRUCTW, y, 4) + TEST_FIELD_ALIGN (CREATESTRUCTW, y, 4) + TEST_FIELD_OFFSET(CREATESTRUCTW, y, 24) + TEST_FIELD_SIZE (CREATESTRUCTW, x, 4) + TEST_FIELD_ALIGN (CREATESTRUCTW, x, 4) + TEST_FIELD_OFFSET(CREATESTRUCTW, x, 28) + TEST_FIELD_SIZE (CREATESTRUCTW, style, 4) + TEST_FIELD_ALIGN (CREATESTRUCTW, style, 4) + TEST_FIELD_OFFSET(CREATESTRUCTW, style, 32) + TEST_FIELD_SIZE (CREATESTRUCTW, lpszName, 4) + TEST_FIELD_ALIGN (CREATESTRUCTW, lpszName, 4) + TEST_FIELD_OFFSET(CREATESTRUCTW, lpszName, 36) + TEST_FIELD_SIZE (CREATESTRUCTW, lpszClass, 4) + TEST_FIELD_ALIGN (CREATESTRUCTW, lpszClass, 4) + TEST_FIELD_OFFSET(CREATESTRUCTW, lpszClass, 40) + TEST_FIELD_SIZE (CREATESTRUCTW, dwExStyle, 4) + TEST_FIELD_ALIGN (CREATESTRUCTW, dwExStyle, 4) + TEST_FIELD_OFFSET(CREATESTRUCTW, dwExStyle, 44) +} + +static void test_pack_CURSORINFO(void) +{ + /* CURSORINFO (pack 4) */ + TEST_TYPE_SIZE (CURSORINFO, 20) + TEST_TYPE_ALIGN (CURSORINFO, 4) + TEST_FIELD_SIZE (CURSORINFO, cbSize, 4) + TEST_FIELD_ALIGN (CURSORINFO, cbSize, 4) + TEST_FIELD_OFFSET(CURSORINFO, cbSize, 0) + TEST_FIELD_SIZE (CURSORINFO, flags, 4) + TEST_FIELD_ALIGN (CURSORINFO, flags, 4) + TEST_FIELD_OFFSET(CURSORINFO, flags, 4) + TEST_FIELD_SIZE (CURSORINFO, hCursor, 4) + TEST_FIELD_ALIGN (CURSORINFO, hCursor, 4) + TEST_FIELD_OFFSET(CURSORINFO, hCursor, 8) + TEST_FIELD_SIZE (CURSORINFO, ptScreenPos, 8) + TEST_FIELD_ALIGN (CURSORINFO, ptScreenPos, 4) + TEST_FIELD_OFFSET(CURSORINFO, ptScreenPos, 12) +} + +static void test_pack_CWPRETSTRUCT(void) +{ + /* CWPRETSTRUCT (pack 4) */ + TEST_TYPE_SIZE (CWPRETSTRUCT, 20) + TEST_TYPE_ALIGN (CWPRETSTRUCT, 4) + TEST_FIELD_SIZE (CWPRETSTRUCT, lResult, 4) + TEST_FIELD_ALIGN (CWPRETSTRUCT, lResult, 4) + TEST_FIELD_OFFSET(CWPRETSTRUCT, lResult, 0) + TEST_FIELD_SIZE (CWPRETSTRUCT, lParam, 4) + TEST_FIELD_ALIGN (CWPRETSTRUCT, lParam, 4) + TEST_FIELD_OFFSET(CWPRETSTRUCT, lParam, 4) + TEST_FIELD_SIZE (CWPRETSTRUCT, wParam, 4) + TEST_FIELD_ALIGN (CWPRETSTRUCT, wParam, 4) + TEST_FIELD_OFFSET(CWPRETSTRUCT, wParam, 8) + TEST_FIELD_SIZE (CWPRETSTRUCT, message, 4) + TEST_FIELD_ALIGN (CWPRETSTRUCT, message, 4) + TEST_FIELD_OFFSET(CWPRETSTRUCT, message, 12) + TEST_FIELD_SIZE (CWPRETSTRUCT, hwnd, 4) + TEST_FIELD_ALIGN (CWPRETSTRUCT, hwnd, 4) + TEST_FIELD_OFFSET(CWPRETSTRUCT, hwnd, 16) +} + +static void test_pack_CWPSTRUCT(void) +{ + /* CWPSTRUCT (pack 4) */ + TEST_TYPE_SIZE (CWPSTRUCT, 16) + TEST_TYPE_ALIGN (CWPSTRUCT, 4) + TEST_FIELD_SIZE (CWPSTRUCT, lParam, 4) + TEST_FIELD_ALIGN (CWPSTRUCT, lParam, 4) + TEST_FIELD_OFFSET(CWPSTRUCT, lParam, 0) + TEST_FIELD_SIZE (CWPSTRUCT, wParam, 4) + TEST_FIELD_ALIGN (CWPSTRUCT, wParam, 4) + TEST_FIELD_OFFSET(CWPSTRUCT, wParam, 4) + TEST_FIELD_SIZE (CWPSTRUCT, message, 4) + TEST_FIELD_ALIGN (CWPSTRUCT, message, 4) + TEST_FIELD_OFFSET(CWPSTRUCT, message, 8) + TEST_FIELD_SIZE (CWPSTRUCT, hwnd, 4) + TEST_FIELD_ALIGN (CWPSTRUCT, hwnd, 4) + TEST_FIELD_OFFSET(CWPSTRUCT, hwnd, 12) +} + +static void test_pack_DEBUGHOOKINFO(void) +{ + /* DEBUGHOOKINFO (pack 4) */ + TEST_TYPE_SIZE (DEBUGHOOKINFO, 20) + TEST_TYPE_ALIGN (DEBUGHOOKINFO, 4) + TEST_FIELD_SIZE (DEBUGHOOKINFO, idThread, 4) + TEST_FIELD_ALIGN (DEBUGHOOKINFO, idThread, 4) + TEST_FIELD_OFFSET(DEBUGHOOKINFO, idThread, 0) + TEST_FIELD_SIZE (DEBUGHOOKINFO, idThreadInstaller, 4) + TEST_FIELD_ALIGN (DEBUGHOOKINFO, idThreadInstaller, 4) + TEST_FIELD_OFFSET(DEBUGHOOKINFO, idThreadInstaller, 4) + TEST_FIELD_SIZE (DEBUGHOOKINFO, lParam, 4) + TEST_FIELD_ALIGN (DEBUGHOOKINFO, lParam, 4) + TEST_FIELD_OFFSET(DEBUGHOOKINFO, lParam, 8) + TEST_FIELD_SIZE (DEBUGHOOKINFO, wParam, 4) + TEST_FIELD_ALIGN (DEBUGHOOKINFO, wParam, 4) + TEST_FIELD_OFFSET(DEBUGHOOKINFO, wParam, 12) + TEST_FIELD_SIZE (DEBUGHOOKINFO, code, 4) + TEST_FIELD_ALIGN (DEBUGHOOKINFO, code, 4) + TEST_FIELD_OFFSET(DEBUGHOOKINFO, code, 16) +} + +static void test_pack_DELETEITEMSTRUCT(void) +{ + /* DELETEITEMSTRUCT (pack 4) */ + TEST_TYPE_SIZE (DELETEITEMSTRUCT, 20) + TEST_TYPE_ALIGN (DELETEITEMSTRUCT, 4) + TEST_FIELD_SIZE (DELETEITEMSTRUCT, CtlType, 4) + TEST_FIELD_ALIGN (DELETEITEMSTRUCT, CtlType, 4) + TEST_FIELD_OFFSET(DELETEITEMSTRUCT, CtlType, 0) + TEST_FIELD_SIZE (DELETEITEMSTRUCT, CtlID, 4) + TEST_FIELD_ALIGN (DELETEITEMSTRUCT, CtlID, 4) + TEST_FIELD_OFFSET(DELETEITEMSTRUCT, CtlID, 4) + TEST_FIELD_SIZE (DELETEITEMSTRUCT, itemID, 4) + TEST_FIELD_ALIGN (DELETEITEMSTRUCT, itemID, 4) + TEST_FIELD_OFFSET(DELETEITEMSTRUCT, itemID, 8) + TEST_FIELD_SIZE (DELETEITEMSTRUCT, hwndItem, 4) + TEST_FIELD_ALIGN (DELETEITEMSTRUCT, hwndItem, 4) + TEST_FIELD_OFFSET(DELETEITEMSTRUCT, hwndItem, 12) + TEST_FIELD_SIZE (DELETEITEMSTRUCT, itemData, 4) + TEST_FIELD_ALIGN (DELETEITEMSTRUCT, itemData, 4) + TEST_FIELD_OFFSET(DELETEITEMSTRUCT, itemData, 16) +} + +static void test_pack_DESKTOPENUMPROCA(void) +{ + /* DESKTOPENUMPROCA */ + TEST_TYPE_SIZE (DESKTOPENUMPROCA, 4) + TEST_TYPE_ALIGN (DESKTOPENUMPROCA, 4) +} + +static void test_pack_DESKTOPENUMPROCW(void) +{ + /* DESKTOPENUMPROCW */ + TEST_TYPE_SIZE (DESKTOPENUMPROCW, 4) + TEST_TYPE_ALIGN (DESKTOPENUMPROCW, 4) +} + +static void test_pack_DLGITEMTEMPLATE(void) +{ + /* DLGITEMTEMPLATE (pack 2) */ + TEST_TYPE_SIZE (DLGITEMTEMPLATE, 18) + TEST_TYPE_ALIGN (DLGITEMTEMPLATE, 2) + TEST_FIELD_SIZE (DLGITEMTEMPLATE, style, 4) + TEST_FIELD_ALIGN (DLGITEMTEMPLATE, style, 2) + TEST_FIELD_OFFSET(DLGITEMTEMPLATE, style, 0) + TEST_FIELD_SIZE (DLGITEMTEMPLATE, dwExtendedStyle, 4) + TEST_FIELD_ALIGN (DLGITEMTEMPLATE, dwExtendedStyle, 2) + TEST_FIELD_OFFSET(DLGITEMTEMPLATE, dwExtendedStyle, 4) + TEST_FIELD_SIZE (DLGITEMTEMPLATE, x, 2) + TEST_FIELD_ALIGN (DLGITEMTEMPLATE, x, 2) + TEST_FIELD_OFFSET(DLGITEMTEMPLATE, x, 8) + TEST_FIELD_SIZE (DLGITEMTEMPLATE, y, 2) + TEST_FIELD_ALIGN (DLGITEMTEMPLATE, y, 2) + TEST_FIELD_OFFSET(DLGITEMTEMPLATE, y, 10) + TEST_FIELD_SIZE (DLGITEMTEMPLATE, cx, 2) + TEST_FIELD_ALIGN (DLGITEMTEMPLATE, cx, 2) + TEST_FIELD_OFFSET(DLGITEMTEMPLATE, cx, 12) + TEST_FIELD_SIZE (DLGITEMTEMPLATE, cy, 2) + TEST_FIELD_ALIGN (DLGITEMTEMPLATE, cy, 2) + TEST_FIELD_OFFSET(DLGITEMTEMPLATE, cy, 14) + TEST_FIELD_SIZE (DLGITEMTEMPLATE, id, 2) + TEST_FIELD_ALIGN (DLGITEMTEMPLATE, id, 2) + TEST_FIELD_OFFSET(DLGITEMTEMPLATE, id, 16) +} + +static void test_pack_DLGPROC(void) +{ + /* DLGPROC */ + TEST_TYPE_SIZE (DLGPROC, 4) + TEST_TYPE_ALIGN (DLGPROC, 4) +} + +static void test_pack_DLGTEMPLATE(void) +{ + /* DLGTEMPLATE (pack 2) */ + TEST_TYPE_SIZE (DLGTEMPLATE, 18) + TEST_TYPE_ALIGN (DLGTEMPLATE, 2) + TEST_FIELD_SIZE (DLGTEMPLATE, style, 4) + TEST_FIELD_ALIGN (DLGTEMPLATE, style, 2) + TEST_FIELD_OFFSET(DLGTEMPLATE, style, 0) + TEST_FIELD_SIZE (DLGTEMPLATE, dwExtendedStyle, 4) + TEST_FIELD_ALIGN (DLGTEMPLATE, dwExtendedStyle, 2) + TEST_FIELD_OFFSET(DLGTEMPLATE, dwExtendedStyle, 4) + TEST_FIELD_SIZE (DLGTEMPLATE, cdit, 2) + TEST_FIELD_ALIGN (DLGTEMPLATE, cdit, 2) + TEST_FIELD_OFFSET(DLGTEMPLATE, cdit, 8) + TEST_FIELD_SIZE (DLGTEMPLATE, x, 2) + TEST_FIELD_ALIGN (DLGTEMPLATE, x, 2) + TEST_FIELD_OFFSET(DLGTEMPLATE, x, 10) + TEST_FIELD_SIZE (DLGTEMPLATE, y, 2) + TEST_FIELD_ALIGN (DLGTEMPLATE, y, 2) + TEST_FIELD_OFFSET(DLGTEMPLATE, y, 12) + TEST_FIELD_SIZE (DLGTEMPLATE, cx, 2) + TEST_FIELD_ALIGN (DLGTEMPLATE, cx, 2) + TEST_FIELD_OFFSET(DLGTEMPLATE, cx, 14) + TEST_FIELD_SIZE (DLGTEMPLATE, cy, 2) + TEST_FIELD_ALIGN (DLGTEMPLATE, cy, 2) + TEST_FIELD_OFFSET(DLGTEMPLATE, cy, 16) +} + +static void test_pack_DRAWITEMSTRUCT(void) +{ + /* DRAWITEMSTRUCT (pack 4) */ + TEST_TYPE_SIZE (DRAWITEMSTRUCT, 48) + TEST_TYPE_ALIGN (DRAWITEMSTRUCT, 4) + TEST_FIELD_SIZE (DRAWITEMSTRUCT, CtlType, 4) + TEST_FIELD_ALIGN (DRAWITEMSTRUCT, CtlType, 4) + TEST_FIELD_OFFSET(DRAWITEMSTRUCT, CtlType, 0) + TEST_FIELD_SIZE (DRAWITEMSTRUCT, CtlID, 4) + TEST_FIELD_ALIGN (DRAWITEMSTRUCT, CtlID, 4) + TEST_FIELD_OFFSET(DRAWITEMSTRUCT, CtlID, 4) + TEST_FIELD_SIZE (DRAWITEMSTRUCT, itemID, 4) + TEST_FIELD_ALIGN (DRAWITEMSTRUCT, itemID, 4) + TEST_FIELD_OFFSET(DRAWITEMSTRUCT, itemID, 8) + TEST_FIELD_SIZE (DRAWITEMSTRUCT, itemAction, 4) + TEST_FIELD_ALIGN (DRAWITEMSTRUCT, itemAction, 4) + TEST_FIELD_OFFSET(DRAWITEMSTRUCT, itemAction, 12) + TEST_FIELD_SIZE (DRAWITEMSTRUCT, itemState, 4) + TEST_FIELD_ALIGN (DRAWITEMSTRUCT, itemState, 4) + TEST_FIELD_OFFSET(DRAWITEMSTRUCT, itemState, 16) + TEST_FIELD_SIZE (DRAWITEMSTRUCT, hwndItem, 4) + TEST_FIELD_ALIGN (DRAWITEMSTRUCT, hwndItem, 4) + TEST_FIELD_OFFSET(DRAWITEMSTRUCT, hwndItem, 20) + TEST_FIELD_SIZE (DRAWITEMSTRUCT, hDC, 4) + TEST_FIELD_ALIGN (DRAWITEMSTRUCT, hDC, 4) + TEST_FIELD_OFFSET(DRAWITEMSTRUCT, hDC, 24) + TEST_FIELD_SIZE (DRAWITEMSTRUCT, rcItem, 16) + TEST_FIELD_ALIGN (DRAWITEMSTRUCT, rcItem, 4) + TEST_FIELD_OFFSET(DRAWITEMSTRUCT, rcItem, 28) + TEST_FIELD_SIZE (DRAWITEMSTRUCT, itemData, 4) + TEST_FIELD_ALIGN (DRAWITEMSTRUCT, itemData, 4) + TEST_FIELD_OFFSET(DRAWITEMSTRUCT, itemData, 44) +} + +static void test_pack_DRAWSTATEPROC(void) +{ + /* DRAWSTATEPROC */ + TEST_TYPE_SIZE (DRAWSTATEPROC, 4) + TEST_TYPE_ALIGN (DRAWSTATEPROC, 4) +} + +static void test_pack_DRAWTEXTPARAMS(void) +{ + /* DRAWTEXTPARAMS (pack 4) */ + TEST_TYPE_SIZE (DRAWTEXTPARAMS, 20) + TEST_TYPE_ALIGN (DRAWTEXTPARAMS, 4) + TEST_FIELD_SIZE (DRAWTEXTPARAMS, cbSize, 4) + TEST_FIELD_ALIGN (DRAWTEXTPARAMS, cbSize, 4) + TEST_FIELD_OFFSET(DRAWTEXTPARAMS, cbSize, 0) + TEST_FIELD_SIZE (DRAWTEXTPARAMS, iTabLength, 4) + TEST_FIELD_ALIGN (DRAWTEXTPARAMS, iTabLength, 4) + TEST_FIELD_OFFSET(DRAWTEXTPARAMS, iTabLength, 4) + TEST_FIELD_SIZE (DRAWTEXTPARAMS, iLeftMargin, 4) + TEST_FIELD_ALIGN (DRAWTEXTPARAMS, iLeftMargin, 4) + TEST_FIELD_OFFSET(DRAWTEXTPARAMS, iLeftMargin, 8) + TEST_FIELD_SIZE (DRAWTEXTPARAMS, iRightMargin, 4) + TEST_FIELD_ALIGN (DRAWTEXTPARAMS, iRightMargin, 4) + TEST_FIELD_OFFSET(DRAWTEXTPARAMS, iRightMargin, 12) + TEST_FIELD_SIZE (DRAWTEXTPARAMS, uiLengthDrawn, 4) + TEST_FIELD_ALIGN (DRAWTEXTPARAMS, uiLengthDrawn, 4) + TEST_FIELD_OFFSET(DRAWTEXTPARAMS, uiLengthDrawn, 16) +} + +static void test_pack_EDITWORDBREAKPROCA(void) +{ + /* EDITWORDBREAKPROCA */ + TEST_TYPE_SIZE (EDITWORDBREAKPROCA, 4) + TEST_TYPE_ALIGN (EDITWORDBREAKPROCA, 4) +} + +static void test_pack_EDITWORDBREAKPROCW(void) +{ + /* EDITWORDBREAKPROCW */ + TEST_TYPE_SIZE (EDITWORDBREAKPROCW, 4) + TEST_TYPE_ALIGN (EDITWORDBREAKPROCW, 4) +} + +static void test_pack_EVENTMSG(void) +{ + /* EVENTMSG (pack 4) */ + TEST_TYPE_SIZE (EVENTMSG, 20) + TEST_TYPE_ALIGN (EVENTMSG, 4) + TEST_FIELD_SIZE (EVENTMSG, message, 4) + TEST_FIELD_ALIGN (EVENTMSG, message, 4) + TEST_FIELD_OFFSET(EVENTMSG, message, 0) + TEST_FIELD_SIZE (EVENTMSG, paramL, 4) + TEST_FIELD_ALIGN (EVENTMSG, paramL, 4) + TEST_FIELD_OFFSET(EVENTMSG, paramL, 4) + TEST_FIELD_SIZE (EVENTMSG, paramH, 4) + TEST_FIELD_ALIGN (EVENTMSG, paramH, 4) + TEST_FIELD_OFFSET(EVENTMSG, paramH, 8) + TEST_FIELD_SIZE (EVENTMSG, time, 4) + TEST_FIELD_ALIGN (EVENTMSG, time, 4) + TEST_FIELD_OFFSET(EVENTMSG, time, 12) + TEST_FIELD_SIZE (EVENTMSG, hwnd, 4) + TEST_FIELD_ALIGN (EVENTMSG, hwnd, 4) + TEST_FIELD_OFFSET(EVENTMSG, hwnd, 16) +} + +static void test_pack_FILTERKEYS(void) +{ + /* FILTERKEYS (pack 4) */ + TEST_TYPE_SIZE (FILTERKEYS, 24) + TEST_TYPE_ALIGN (FILTERKEYS, 4) + TEST_FIELD_SIZE (FILTERKEYS, cbSize, 4) + TEST_FIELD_ALIGN (FILTERKEYS, cbSize, 4) + TEST_FIELD_OFFSET(FILTERKEYS, cbSize, 0) + TEST_FIELD_SIZE (FILTERKEYS, dwFlags, 4) + TEST_FIELD_ALIGN (FILTERKEYS, dwFlags, 4) + TEST_FIELD_OFFSET(FILTERKEYS, dwFlags, 4) + TEST_FIELD_SIZE (FILTERKEYS, iWaitMSec, 4) + TEST_FIELD_ALIGN (FILTERKEYS, iWaitMSec, 4) + TEST_FIELD_OFFSET(FILTERKEYS, iWaitMSec, 8) + TEST_FIELD_SIZE (FILTERKEYS, iDelayMSec, 4) + TEST_FIELD_ALIGN (FILTERKEYS, iDelayMSec, 4) + TEST_FIELD_OFFSET(FILTERKEYS, iDelayMSec, 12) + TEST_FIELD_SIZE (FILTERKEYS, iRepeatMSec, 4) + TEST_FIELD_ALIGN (FILTERKEYS, iRepeatMSec, 4) + TEST_FIELD_OFFSET(FILTERKEYS, iRepeatMSec, 16) + TEST_FIELD_SIZE (FILTERKEYS, iBounceMSec, 4) + TEST_FIELD_ALIGN (FILTERKEYS, iBounceMSec, 4) + TEST_FIELD_OFFSET(FILTERKEYS, iBounceMSec, 20) +} + +static void test_pack_FLASHWINFO(void) +{ + /* FLASHWINFO (pack 4) */ + TEST_TYPE_SIZE (FLASHWINFO, 20) + TEST_TYPE_ALIGN (FLASHWINFO, 4) + TEST_FIELD_SIZE (FLASHWINFO, cbSize, 4) + TEST_FIELD_ALIGN (FLASHWINFO, cbSize, 4) + TEST_FIELD_OFFSET(FLASHWINFO, cbSize, 0) + TEST_FIELD_SIZE (FLASHWINFO, hwnd, 4) + TEST_FIELD_ALIGN (FLASHWINFO, hwnd, 4) + TEST_FIELD_OFFSET(FLASHWINFO, hwnd, 4) + TEST_FIELD_SIZE (FLASHWINFO, dwFlags, 4) + TEST_FIELD_ALIGN (FLASHWINFO, dwFlags, 4) + TEST_FIELD_OFFSET(FLASHWINFO, dwFlags, 8) + TEST_FIELD_SIZE (FLASHWINFO, uCount, 4) + TEST_FIELD_ALIGN (FLASHWINFO, uCount, 4) + TEST_FIELD_OFFSET(FLASHWINFO, uCount, 12) + TEST_FIELD_SIZE (FLASHWINFO, dwTimeout, 4) + TEST_FIELD_ALIGN (FLASHWINFO, dwTimeout, 4) + TEST_FIELD_OFFSET(FLASHWINFO, dwTimeout, 16) +} + +static void test_pack_GRAYSTRINGPROC(void) +{ + /* GRAYSTRINGPROC */ + TEST_TYPE_SIZE (GRAYSTRINGPROC, 4) + TEST_TYPE_ALIGN (GRAYSTRINGPROC, 4) +} + +static void test_pack_GUITHREADINFO(void) +{ + /* GUITHREADINFO (pack 4) */ + TEST_TYPE_SIZE (GUITHREADINFO, 48) + TEST_TYPE_ALIGN (GUITHREADINFO, 4) + TEST_FIELD_SIZE (GUITHREADINFO, cbSize, 4) + TEST_FIELD_ALIGN (GUITHREADINFO, cbSize, 4) + TEST_FIELD_OFFSET(GUITHREADINFO, cbSize, 0) + TEST_FIELD_SIZE (GUITHREADINFO, flags, 4) + TEST_FIELD_ALIGN (GUITHREADINFO, flags, 4) + TEST_FIELD_OFFSET(GUITHREADINFO, flags, 4) + TEST_FIELD_SIZE (GUITHREADINFO, hwndActive, 4) + TEST_FIELD_ALIGN (GUITHREADINFO, hwndActive, 4) + TEST_FIELD_OFFSET(GUITHREADINFO, hwndActive, 8) + TEST_FIELD_SIZE (GUITHREADINFO, hwndFocus, 4) + TEST_FIELD_ALIGN (GUITHREADINFO, hwndFocus, 4) + TEST_FIELD_OFFSET(GUITHREADINFO, hwndFocus, 12) + TEST_FIELD_SIZE (GUITHREADINFO, hwndCapture, 4) + TEST_FIELD_ALIGN (GUITHREADINFO, hwndCapture, 4) + TEST_FIELD_OFFSET(GUITHREADINFO, hwndCapture, 16) + TEST_FIELD_SIZE (GUITHREADINFO, hwndMenuOwner, 4) + TEST_FIELD_ALIGN (GUITHREADINFO, hwndMenuOwner, 4) + TEST_FIELD_OFFSET(GUITHREADINFO, hwndMenuOwner, 20) + TEST_FIELD_SIZE (GUITHREADINFO, hwndMoveSize, 4) + TEST_FIELD_ALIGN (GUITHREADINFO, hwndMoveSize, 4) + TEST_FIELD_OFFSET(GUITHREADINFO, hwndMoveSize, 24) + TEST_FIELD_SIZE (GUITHREADINFO, hwndCaret, 4) + TEST_FIELD_ALIGN (GUITHREADINFO, hwndCaret, 4) + TEST_FIELD_OFFSET(GUITHREADINFO, hwndCaret, 28) + TEST_FIELD_SIZE (GUITHREADINFO, rcCaret, 16) + TEST_FIELD_ALIGN (GUITHREADINFO, rcCaret, 4) + TEST_FIELD_OFFSET(GUITHREADINFO, rcCaret, 32) +} + +static void test_pack_HARDWAREHOOKSTRUCT(void) +{ + /* HARDWAREHOOKSTRUCT (pack 4) */ + TEST_TYPE_SIZE (HARDWAREHOOKSTRUCT, 16) + TEST_TYPE_ALIGN (HARDWAREHOOKSTRUCT, 4) + TEST_FIELD_SIZE (HARDWAREHOOKSTRUCT, hwnd, 4) + TEST_FIELD_ALIGN (HARDWAREHOOKSTRUCT, hwnd, 4) + TEST_FIELD_OFFSET(HARDWAREHOOKSTRUCT, hwnd, 0) + TEST_FIELD_SIZE (HARDWAREHOOKSTRUCT, message, 4) + TEST_FIELD_ALIGN (HARDWAREHOOKSTRUCT, message, 4) + TEST_FIELD_OFFSET(HARDWAREHOOKSTRUCT, message, 4) + TEST_FIELD_SIZE (HARDWAREHOOKSTRUCT, wParam, 4) + TEST_FIELD_ALIGN (HARDWAREHOOKSTRUCT, wParam, 4) + TEST_FIELD_OFFSET(HARDWAREHOOKSTRUCT, wParam, 8) + TEST_FIELD_SIZE (HARDWAREHOOKSTRUCT, lParam, 4) + TEST_FIELD_ALIGN (HARDWAREHOOKSTRUCT, lParam, 4) + TEST_FIELD_OFFSET(HARDWAREHOOKSTRUCT, lParam, 12) +} + +static void test_pack_HARDWAREINPUT(void) +{ + /* HARDWAREINPUT (pack 4) */ + TEST_TYPE_SIZE (HARDWAREINPUT, 8) + TEST_TYPE_ALIGN (HARDWAREINPUT, 4) + TEST_FIELD_SIZE (HARDWAREINPUT, uMsg, 4) + TEST_FIELD_ALIGN (HARDWAREINPUT, uMsg, 4) + TEST_FIELD_OFFSET(HARDWAREINPUT, uMsg, 0) + TEST_FIELD_SIZE (HARDWAREINPUT, wParamL, 2) + TEST_FIELD_ALIGN (HARDWAREINPUT, wParamL, 2) + TEST_FIELD_OFFSET(HARDWAREINPUT, wParamL, 4) + TEST_FIELD_SIZE (HARDWAREINPUT, wParamH, 2) + TEST_FIELD_ALIGN (HARDWAREINPUT, wParamH, 2) + TEST_FIELD_OFFSET(HARDWAREINPUT, wParamH, 6) +} + +static void test_pack_HDEVNOTIFY(void) +{ + /* HDEVNOTIFY */ + TEST_TYPE_SIZE (HDEVNOTIFY, 4) + TEST_TYPE_ALIGN (HDEVNOTIFY, 4) +} + +static void test_pack_HDWP(void) +{ + /* HDWP */ + TEST_TYPE_SIZE (HDWP, 4) + TEST_TYPE_ALIGN (HDWP, 4) +} + +static void test_pack_HELPINFO(void) +{ + /* HELPINFO (pack 4) */ + TEST_TYPE_SIZE (HELPINFO, 28) + TEST_TYPE_ALIGN (HELPINFO, 4) + TEST_FIELD_SIZE (HELPINFO, cbSize, 4) + TEST_FIELD_ALIGN (HELPINFO, cbSize, 4) + TEST_FIELD_OFFSET(HELPINFO, cbSize, 0) + TEST_FIELD_SIZE (HELPINFO, iContextType, 4) + TEST_FIELD_ALIGN (HELPINFO, iContextType, 4) + TEST_FIELD_OFFSET(HELPINFO, iContextType, 4) + TEST_FIELD_SIZE (HELPINFO, iCtrlId, 4) + TEST_FIELD_ALIGN (HELPINFO, iCtrlId, 4) + TEST_FIELD_OFFSET(HELPINFO, iCtrlId, 8) + TEST_FIELD_SIZE (HELPINFO, hItemHandle, 4) + TEST_FIELD_ALIGN (HELPINFO, hItemHandle, 4) + TEST_FIELD_OFFSET(HELPINFO, hItemHandle, 12) + TEST_FIELD_SIZE (HELPINFO, dwContextId, 4) + TEST_FIELD_ALIGN (HELPINFO, dwContextId, 4) + TEST_FIELD_OFFSET(HELPINFO, dwContextId, 16) + TEST_FIELD_SIZE (HELPINFO, MousePos, 8) + TEST_FIELD_ALIGN (HELPINFO, MousePos, 4) + TEST_FIELD_OFFSET(HELPINFO, MousePos, 20) +} + +static void test_pack_HELPWININFOA(void) +{ + /* HELPWININFOA (pack 4) */ + TEST_TYPE_SIZE (HELPWININFOA, 28) + TEST_TYPE_ALIGN (HELPWININFOA, 4) + TEST_FIELD_SIZE (HELPWININFOA, wStructSize, 4) + TEST_FIELD_ALIGN (HELPWININFOA, wStructSize, 4) + TEST_FIELD_OFFSET(HELPWININFOA, wStructSize, 0) + TEST_FIELD_SIZE (HELPWININFOA, x, 4) + TEST_FIELD_ALIGN (HELPWININFOA, x, 4) + TEST_FIELD_OFFSET(HELPWININFOA, x, 4) + TEST_FIELD_SIZE (HELPWININFOA, y, 4) + TEST_FIELD_ALIGN (HELPWININFOA, y, 4) + TEST_FIELD_OFFSET(HELPWININFOA, y, 8) + TEST_FIELD_SIZE (HELPWININFOA, dx, 4) + TEST_FIELD_ALIGN (HELPWININFOA, dx, 4) + TEST_FIELD_OFFSET(HELPWININFOA, dx, 12) + TEST_FIELD_SIZE (HELPWININFOA, dy, 4) + TEST_FIELD_ALIGN (HELPWININFOA, dy, 4) + TEST_FIELD_OFFSET(HELPWININFOA, dy, 16) + TEST_FIELD_SIZE (HELPWININFOA, wMax, 4) + TEST_FIELD_ALIGN (HELPWININFOA, wMax, 4) + TEST_FIELD_OFFSET(HELPWININFOA, wMax, 20) + TEST_FIELD_SIZE (HELPWININFOA, rgchMember, 2) + TEST_FIELD_ALIGN (HELPWININFOA, rgchMember, 1) + TEST_FIELD_OFFSET(HELPWININFOA, rgchMember, 24) +} + +static void test_pack_HELPWININFOW(void) +{ + /* HELPWININFOW (pack 4) */ + TEST_TYPE_SIZE (HELPWININFOW, 28) + TEST_TYPE_ALIGN (HELPWININFOW, 4) + TEST_FIELD_SIZE (HELPWININFOW, wStructSize, 4) + TEST_FIELD_ALIGN (HELPWININFOW, wStructSize, 4) + TEST_FIELD_OFFSET(HELPWININFOW, wStructSize, 0) + TEST_FIELD_SIZE (HELPWININFOW, x, 4) + TEST_FIELD_ALIGN (HELPWININFOW, x, 4) + TEST_FIELD_OFFSET(HELPWININFOW, x, 4) + TEST_FIELD_SIZE (HELPWININFOW, y, 4) + TEST_FIELD_ALIGN (HELPWININFOW, y, 4) + TEST_FIELD_OFFSET(HELPWININFOW, y, 8) + TEST_FIELD_SIZE (HELPWININFOW, dx, 4) + TEST_FIELD_ALIGN (HELPWININFOW, dx, 4) + TEST_FIELD_OFFSET(HELPWININFOW, dx, 12) + TEST_FIELD_SIZE (HELPWININFOW, dy, 4) + TEST_FIELD_ALIGN (HELPWININFOW, dy, 4) + TEST_FIELD_OFFSET(HELPWININFOW, dy, 16) + TEST_FIELD_SIZE (HELPWININFOW, wMax, 4) + TEST_FIELD_ALIGN (HELPWININFOW, wMax, 4) + TEST_FIELD_OFFSET(HELPWININFOW, wMax, 20) + TEST_FIELD_SIZE (HELPWININFOW, rgchMember, 4) + TEST_FIELD_ALIGN (HELPWININFOW, rgchMember, 2) + TEST_FIELD_OFFSET(HELPWININFOW, rgchMember, 24) +} + +static void test_pack_HIGHCONTRASTA(void) +{ + /* HIGHCONTRASTA (pack 4) */ + TEST_TYPE_SIZE (HIGHCONTRASTA, 12) + TEST_TYPE_ALIGN (HIGHCONTRASTA, 4) + TEST_FIELD_SIZE (HIGHCONTRASTA, cbSize, 4) + TEST_FIELD_ALIGN (HIGHCONTRASTA, cbSize, 4) + TEST_FIELD_OFFSET(HIGHCONTRASTA, cbSize, 0) + TEST_FIELD_SIZE (HIGHCONTRASTA, dwFlags, 4) + TEST_FIELD_ALIGN (HIGHCONTRASTA, dwFlags, 4) + TEST_FIELD_OFFSET(HIGHCONTRASTA, dwFlags, 4) + TEST_FIELD_SIZE (HIGHCONTRASTA, lpszDefaultScheme, 4) + TEST_FIELD_ALIGN (HIGHCONTRASTA, lpszDefaultScheme, 4) + TEST_FIELD_OFFSET(HIGHCONTRASTA, lpszDefaultScheme, 8) +} + +static void test_pack_HIGHCONTRASTW(void) +{ + /* HIGHCONTRASTW (pack 4) */ + TEST_TYPE_SIZE (HIGHCONTRASTW, 12) + TEST_TYPE_ALIGN (HIGHCONTRASTW, 4) + TEST_FIELD_SIZE (HIGHCONTRASTW, cbSize, 4) + TEST_FIELD_ALIGN (HIGHCONTRASTW, cbSize, 4) + TEST_FIELD_OFFSET(HIGHCONTRASTW, cbSize, 0) + TEST_FIELD_SIZE (HIGHCONTRASTW, dwFlags, 4) + TEST_FIELD_ALIGN (HIGHCONTRASTW, dwFlags, 4) + TEST_FIELD_OFFSET(HIGHCONTRASTW, dwFlags, 4) + TEST_FIELD_SIZE (HIGHCONTRASTW, lpszDefaultScheme, 4) + TEST_FIELD_ALIGN (HIGHCONTRASTW, lpszDefaultScheme, 4) + TEST_FIELD_OFFSET(HIGHCONTRASTW, lpszDefaultScheme, 8) +} + +static void test_pack_HOOKPROC(void) +{ + /* HOOKPROC */ + TEST_TYPE_SIZE (HOOKPROC, 4) + TEST_TYPE_ALIGN (HOOKPROC, 4) +} + +static void test_pack_ICONINFO(void) +{ + /* ICONINFO (pack 4) */ + TEST_TYPE_SIZE (ICONINFO, 20) + TEST_TYPE_ALIGN (ICONINFO, 4) + TEST_FIELD_SIZE (ICONINFO, fIcon, 4) + TEST_FIELD_ALIGN (ICONINFO, fIcon, 4) + TEST_FIELD_OFFSET(ICONINFO, fIcon, 0) + TEST_FIELD_SIZE (ICONINFO, xHotspot, 4) + TEST_FIELD_ALIGN (ICONINFO, xHotspot, 4) + TEST_FIELD_OFFSET(ICONINFO, xHotspot, 4) + TEST_FIELD_SIZE (ICONINFO, yHotspot, 4) + TEST_FIELD_ALIGN (ICONINFO, yHotspot, 4) + TEST_FIELD_OFFSET(ICONINFO, yHotspot, 8) + TEST_FIELD_SIZE (ICONINFO, hbmMask, 4) + TEST_FIELD_ALIGN (ICONINFO, hbmMask, 4) + TEST_FIELD_OFFSET(ICONINFO, hbmMask, 12) + TEST_FIELD_SIZE (ICONINFO, hbmColor, 4) + TEST_FIELD_ALIGN (ICONINFO, hbmColor, 4) + TEST_FIELD_OFFSET(ICONINFO, hbmColor, 16) +} + +static void test_pack_ICONMETRICSA(void) +{ + /* ICONMETRICSA (pack 4) */ + TEST_TYPE_SIZE (ICONMETRICSA, 76) + TEST_TYPE_ALIGN (ICONMETRICSA, 4) + TEST_FIELD_SIZE (ICONMETRICSA, cbSize, 4) + TEST_FIELD_ALIGN (ICONMETRICSA, cbSize, 4) + TEST_FIELD_OFFSET(ICONMETRICSA, cbSize, 0) + TEST_FIELD_SIZE (ICONMETRICSA, iHorzSpacing, 4) + TEST_FIELD_ALIGN (ICONMETRICSA, iHorzSpacing, 4) + TEST_FIELD_OFFSET(ICONMETRICSA, iHorzSpacing, 4) + TEST_FIELD_SIZE (ICONMETRICSA, iVertSpacing, 4) + TEST_FIELD_ALIGN (ICONMETRICSA, iVertSpacing, 4) + TEST_FIELD_OFFSET(ICONMETRICSA, iVertSpacing, 8) + TEST_FIELD_SIZE (ICONMETRICSA, iTitleWrap, 4) + TEST_FIELD_ALIGN (ICONMETRICSA, iTitleWrap, 4) + TEST_FIELD_OFFSET(ICONMETRICSA, iTitleWrap, 12) + TEST_FIELD_SIZE (ICONMETRICSA, lfFont, 60) + TEST_FIELD_ALIGN (ICONMETRICSA, lfFont, 4) + TEST_FIELD_OFFSET(ICONMETRICSA, lfFont, 16) +} + +static void test_pack_ICONMETRICSW(void) +{ + /* ICONMETRICSW (pack 4) */ + TEST_TYPE_SIZE (ICONMETRICSW, 108) + TEST_TYPE_ALIGN (ICONMETRICSW, 4) + TEST_FIELD_SIZE (ICONMETRICSW, cbSize, 4) + TEST_FIELD_ALIGN (ICONMETRICSW, cbSize, 4) + TEST_FIELD_OFFSET(ICONMETRICSW, cbSize, 0) + TEST_FIELD_SIZE (ICONMETRICSW, iHorzSpacing, 4) + TEST_FIELD_ALIGN (ICONMETRICSW, iHorzSpacing, 4) + TEST_FIELD_OFFSET(ICONMETRICSW, iHorzSpacing, 4) + TEST_FIELD_SIZE (ICONMETRICSW, iVertSpacing, 4) + TEST_FIELD_ALIGN (ICONMETRICSW, iVertSpacing, 4) + TEST_FIELD_OFFSET(ICONMETRICSW, iVertSpacing, 8) + TEST_FIELD_SIZE (ICONMETRICSW, iTitleWrap, 4) + TEST_FIELD_ALIGN (ICONMETRICSW, iTitleWrap, 4) + TEST_FIELD_OFFSET(ICONMETRICSW, iTitleWrap, 12) + TEST_FIELD_SIZE (ICONMETRICSW, lfFont, 92) + TEST_FIELD_ALIGN (ICONMETRICSW, lfFont, 4) + TEST_FIELD_OFFSET(ICONMETRICSW, lfFont, 16) +} + +static void test_pack_INPUT(void) +{ + /* INPUT (pack 4) */ + TEST_FIELD_SIZE (INPUT, type, 4) + TEST_FIELD_ALIGN (INPUT, type, 4) + TEST_FIELD_OFFSET(INPUT, type, 0) +} + +static void test_pack_KBDLLHOOKSTRUCT(void) +{ + /* KBDLLHOOKSTRUCT (pack 4) */ + TEST_TYPE_SIZE (KBDLLHOOKSTRUCT, 20) + TEST_TYPE_ALIGN (KBDLLHOOKSTRUCT, 4) + TEST_FIELD_SIZE (KBDLLHOOKSTRUCT, vkCode, 4) + TEST_FIELD_ALIGN (KBDLLHOOKSTRUCT, vkCode, 4) + TEST_FIELD_OFFSET(KBDLLHOOKSTRUCT, vkCode, 0) + TEST_FIELD_SIZE (KBDLLHOOKSTRUCT, scanCode, 4) + TEST_FIELD_ALIGN (KBDLLHOOKSTRUCT, scanCode, 4) + TEST_FIELD_OFFSET(KBDLLHOOKSTRUCT, scanCode, 4) + TEST_FIELD_SIZE (KBDLLHOOKSTRUCT, flags, 4) + TEST_FIELD_ALIGN (KBDLLHOOKSTRUCT, flags, 4) + TEST_FIELD_OFFSET(KBDLLHOOKSTRUCT, flags, 8) + TEST_FIELD_SIZE (KBDLLHOOKSTRUCT, time, 4) + TEST_FIELD_ALIGN (KBDLLHOOKSTRUCT, time, 4) + TEST_FIELD_OFFSET(KBDLLHOOKSTRUCT, time, 12) + TEST_FIELD_SIZE (KBDLLHOOKSTRUCT, dwExtraInfo, 4) + TEST_FIELD_ALIGN (KBDLLHOOKSTRUCT, dwExtraInfo, 4) + TEST_FIELD_OFFSET(KBDLLHOOKSTRUCT, dwExtraInfo, 16) +} + +static void test_pack_KEYBDINPUT(void) +{ + /* KEYBDINPUT (pack 4) */ + TEST_TYPE_SIZE (KEYBDINPUT, 16) + TEST_TYPE_ALIGN (KEYBDINPUT, 4) + TEST_FIELD_SIZE (KEYBDINPUT, wVk, 2) + TEST_FIELD_ALIGN (KEYBDINPUT, wVk, 2) + TEST_FIELD_OFFSET(KEYBDINPUT, wVk, 0) + TEST_FIELD_SIZE (KEYBDINPUT, wScan, 2) + TEST_FIELD_ALIGN (KEYBDINPUT, wScan, 2) + TEST_FIELD_OFFSET(KEYBDINPUT, wScan, 2) + TEST_FIELD_SIZE (KEYBDINPUT, dwFlags, 4) + TEST_FIELD_ALIGN (KEYBDINPUT, dwFlags, 4) + TEST_FIELD_OFFSET(KEYBDINPUT, dwFlags, 4) + TEST_FIELD_SIZE (KEYBDINPUT, time, 4) + TEST_FIELD_ALIGN (KEYBDINPUT, time, 4) + TEST_FIELD_OFFSET(KEYBDINPUT, time, 8) + TEST_FIELD_SIZE (KEYBDINPUT, dwExtraInfo, 4) + TEST_FIELD_ALIGN (KEYBDINPUT, dwExtraInfo, 4) + TEST_FIELD_OFFSET(KEYBDINPUT, dwExtraInfo, 12) +} + +static void test_pack_LPACCESSTIMEOUT(void) +{ + /* LPACCESSTIMEOUT */ + TEST_TYPE_SIZE (LPACCESSTIMEOUT, 4) + TEST_TYPE_ALIGN (LPACCESSTIMEOUT, 4) + TEST_TARGET_SIZE (LPACCESSTIMEOUT, 12) + TEST_TARGET_ALIGN(LPACCESSTIMEOUT, 4) +} + +static void test_pack_LPANIMATIONINFO(void) +{ + /* LPANIMATIONINFO */ + TEST_TYPE_SIZE (LPANIMATIONINFO, 4) + TEST_TYPE_ALIGN (LPANIMATIONINFO, 4) + TEST_TARGET_SIZE (LPANIMATIONINFO, 8) + TEST_TARGET_ALIGN(LPANIMATIONINFO, 4) +} + +static void test_pack_LPCBTACTIVATESTRUCT(void) +{ + /* LPCBTACTIVATESTRUCT */ + TEST_TYPE_SIZE (LPCBTACTIVATESTRUCT, 4) + TEST_TYPE_ALIGN (LPCBTACTIVATESTRUCT, 4) + TEST_TARGET_SIZE (LPCBTACTIVATESTRUCT, 8) + TEST_TARGET_ALIGN(LPCBTACTIVATESTRUCT, 4) +} + +static void test_pack_LPCBT_CREATEWNDA(void) +{ + /* LPCBT_CREATEWNDA */ + TEST_TYPE_SIZE (LPCBT_CREATEWNDA, 4) + TEST_TYPE_ALIGN (LPCBT_CREATEWNDA, 4) + TEST_TARGET_SIZE (LPCBT_CREATEWNDA, 8) + TEST_TARGET_ALIGN(LPCBT_CREATEWNDA, 4) +} + +static void test_pack_LPCBT_CREATEWNDW(void) +{ + /* LPCBT_CREATEWNDW */ + TEST_TYPE_SIZE (LPCBT_CREATEWNDW, 4) + TEST_TYPE_ALIGN (LPCBT_CREATEWNDW, 4) + TEST_TARGET_SIZE (LPCBT_CREATEWNDW, 8) + TEST_TARGET_ALIGN(LPCBT_CREATEWNDW, 4) +} + +static void test_pack_LPCDLGTEMPLATEA(void) +{ + /* LPCDLGTEMPLATEA */ + TEST_TYPE_SIZE (LPCDLGTEMPLATEA, 4) + TEST_TYPE_ALIGN (LPCDLGTEMPLATEA, 4) + TEST_TARGET_SIZE (LPCDLGTEMPLATEA, 18) + TEST_TARGET_ALIGN(LPCDLGTEMPLATEA, 2) +} + +static void test_pack_LPCDLGTEMPLATEW(void) +{ + /* LPCDLGTEMPLATEW */ + TEST_TYPE_SIZE (LPCDLGTEMPLATEW, 4) + TEST_TYPE_ALIGN (LPCDLGTEMPLATEW, 4) + TEST_TARGET_SIZE (LPCDLGTEMPLATEW, 18) + TEST_TARGET_ALIGN(LPCDLGTEMPLATEW, 2) +} + +static void test_pack_LPCLIENTCREATESTRUCT(void) +{ + /* LPCLIENTCREATESTRUCT */ + TEST_TYPE_SIZE (LPCLIENTCREATESTRUCT, 4) + TEST_TYPE_ALIGN (LPCLIENTCREATESTRUCT, 4) + TEST_TARGET_SIZE (LPCLIENTCREATESTRUCT, 8) + TEST_TARGET_ALIGN(LPCLIENTCREATESTRUCT, 4) +} + +static void test_pack_LPCMENUINFO(void) +{ + /* LPCMENUINFO */ + TEST_TYPE_SIZE (LPCMENUINFO, 4) + TEST_TYPE_ALIGN (LPCMENUINFO, 4) + TEST_TARGET_SIZE (LPCMENUINFO, 28) + TEST_TARGET_ALIGN(LPCMENUINFO, 4) +} + +static void test_pack_LPCMENUITEMINFOA(void) +{ + /* LPCMENUITEMINFOA */ + TEST_TYPE_SIZE (LPCMENUITEMINFOA, 4) + TEST_TYPE_ALIGN (LPCMENUITEMINFOA, 4) + TEST_TARGET_SIZE (LPCMENUITEMINFOA, 48) + TEST_TARGET_ALIGN(LPCMENUITEMINFOA, 4) +} + +static void test_pack_LPCMENUITEMINFOW(void) +{ + /* LPCMENUITEMINFOW */ + TEST_TYPE_SIZE (LPCMENUITEMINFOW, 4) + TEST_TYPE_ALIGN (LPCMENUITEMINFOW, 4) + TEST_TARGET_SIZE (LPCMENUITEMINFOW, 48) + TEST_TARGET_ALIGN(LPCMENUITEMINFOW, 4) +} + +static void test_pack_LPCOMBOBOXINFO(void) +{ + /* LPCOMBOBOXINFO */ + TEST_TYPE_SIZE (LPCOMBOBOXINFO, 4) + TEST_TYPE_ALIGN (LPCOMBOBOXINFO, 4) + TEST_TARGET_SIZE (LPCOMBOBOXINFO, 52) + TEST_TARGET_ALIGN(LPCOMBOBOXINFO, 4) +} + +static void test_pack_LPCOMPAREITEMSTRUCT(void) +{ + /* LPCOMPAREITEMSTRUCT */ + TEST_TYPE_SIZE (LPCOMPAREITEMSTRUCT, 4) + TEST_TYPE_ALIGN (LPCOMPAREITEMSTRUCT, 4) + TEST_TARGET_SIZE (LPCOMPAREITEMSTRUCT, 32) + TEST_TARGET_ALIGN(LPCOMPAREITEMSTRUCT, 4) +} + +static void test_pack_LPCREATESTRUCTA(void) +{ + /* LPCREATESTRUCTA */ + TEST_TYPE_SIZE (LPCREATESTRUCTA, 4) + TEST_TYPE_ALIGN (LPCREATESTRUCTA, 4) + TEST_TARGET_SIZE (LPCREATESTRUCTA, 48) + TEST_TARGET_ALIGN(LPCREATESTRUCTA, 4) +} + +static void test_pack_LPCREATESTRUCTW(void) +{ + /* LPCREATESTRUCTW */ + TEST_TYPE_SIZE (LPCREATESTRUCTW, 4) + TEST_TYPE_ALIGN (LPCREATESTRUCTW, 4) + TEST_TARGET_SIZE (LPCREATESTRUCTW, 48) + TEST_TARGET_ALIGN(LPCREATESTRUCTW, 4) +} + +static void test_pack_LPCSCROLLINFO(void) +{ + /* LPCSCROLLINFO */ + TEST_TYPE_SIZE (LPCSCROLLINFO, 4) + TEST_TYPE_ALIGN (LPCSCROLLINFO, 4) + TEST_TARGET_SIZE (LPCSCROLLINFO, 28) + TEST_TARGET_ALIGN(LPCSCROLLINFO, 4) +} + +static void test_pack_LPCURSORINFO(void) +{ + /* LPCURSORINFO */ + TEST_TYPE_SIZE (LPCURSORINFO, 4) + TEST_TYPE_ALIGN (LPCURSORINFO, 4) + TEST_TARGET_SIZE (LPCURSORINFO, 20) + TEST_TARGET_ALIGN(LPCURSORINFO, 4) +} + +static void test_pack_LPCWPRETSTRUCT(void) +{ + /* LPCWPRETSTRUCT */ + TEST_TYPE_SIZE (LPCWPRETSTRUCT, 4) + TEST_TYPE_ALIGN (LPCWPRETSTRUCT, 4) + TEST_TARGET_SIZE (LPCWPRETSTRUCT, 20) + TEST_TARGET_ALIGN(LPCWPRETSTRUCT, 4) +} + +static void test_pack_LPCWPSTRUCT(void) +{ + /* LPCWPSTRUCT */ + TEST_TYPE_SIZE (LPCWPSTRUCT, 4) + TEST_TYPE_ALIGN (LPCWPSTRUCT, 4) + TEST_TARGET_SIZE (LPCWPSTRUCT, 16) + TEST_TARGET_ALIGN(LPCWPSTRUCT, 4) +} + +static void test_pack_LPDEBUGHOOKINFO(void) +{ + /* LPDEBUGHOOKINFO */ + TEST_TYPE_SIZE (LPDEBUGHOOKINFO, 4) + TEST_TYPE_ALIGN (LPDEBUGHOOKINFO, 4) + TEST_TARGET_SIZE (LPDEBUGHOOKINFO, 20) + TEST_TARGET_ALIGN(LPDEBUGHOOKINFO, 4) +} + +static void test_pack_LPDELETEITEMSTRUCT(void) +{ + /* LPDELETEITEMSTRUCT */ + TEST_TYPE_SIZE (LPDELETEITEMSTRUCT, 4) + TEST_TYPE_ALIGN (LPDELETEITEMSTRUCT, 4) + TEST_TARGET_SIZE (LPDELETEITEMSTRUCT, 20) + TEST_TARGET_ALIGN(LPDELETEITEMSTRUCT, 4) +} + +static void test_pack_LPDLGITEMTEMPLATEA(void) +{ + /* LPDLGITEMTEMPLATEA */ + TEST_TYPE_SIZE (LPDLGITEMTEMPLATEA, 4) + TEST_TYPE_ALIGN (LPDLGITEMTEMPLATEA, 4) + TEST_TARGET_SIZE (LPDLGITEMTEMPLATEA, 18) + TEST_TARGET_ALIGN(LPDLGITEMTEMPLATEA, 2) +} + +static void test_pack_LPDLGITEMTEMPLATEW(void) +{ + /* LPDLGITEMTEMPLATEW */ + TEST_TYPE_SIZE (LPDLGITEMTEMPLATEW, 4) + TEST_TYPE_ALIGN (LPDLGITEMTEMPLATEW, 4) + TEST_TARGET_SIZE (LPDLGITEMTEMPLATEW, 18) + TEST_TARGET_ALIGN(LPDLGITEMTEMPLATEW, 2) +} + +static void test_pack_LPDLGTEMPLATEA(void) +{ + /* LPDLGTEMPLATEA */ + TEST_TYPE_SIZE (LPDLGTEMPLATEA, 4) + TEST_TYPE_ALIGN (LPDLGTEMPLATEA, 4) + TEST_TARGET_SIZE (LPDLGTEMPLATEA, 18) + TEST_TARGET_ALIGN(LPDLGTEMPLATEA, 2) +} + +static void test_pack_LPDLGTEMPLATEW(void) +{ + /* LPDLGTEMPLATEW */ + TEST_TYPE_SIZE (LPDLGTEMPLATEW, 4) + TEST_TYPE_ALIGN (LPDLGTEMPLATEW, 4) + TEST_TARGET_SIZE (LPDLGTEMPLATEW, 18) + TEST_TARGET_ALIGN(LPDLGTEMPLATEW, 2) +} + +static void test_pack_LPDRAWITEMSTRUCT(void) +{ + /* LPDRAWITEMSTRUCT */ + TEST_TYPE_SIZE (LPDRAWITEMSTRUCT, 4) + TEST_TYPE_ALIGN (LPDRAWITEMSTRUCT, 4) + TEST_TARGET_SIZE (LPDRAWITEMSTRUCT, 48) + TEST_TARGET_ALIGN(LPDRAWITEMSTRUCT, 4) +} + +static void test_pack_LPDRAWTEXTPARAMS(void) +{ + /* LPDRAWTEXTPARAMS */ + TEST_TYPE_SIZE (LPDRAWTEXTPARAMS, 4) + TEST_TYPE_ALIGN (LPDRAWTEXTPARAMS, 4) + TEST_TARGET_SIZE (LPDRAWTEXTPARAMS, 20) + TEST_TARGET_ALIGN(LPDRAWTEXTPARAMS, 4) +} + +static void test_pack_LPEVENTMSG(void) +{ + /* LPEVENTMSG */ + TEST_TYPE_SIZE (LPEVENTMSG, 4) + TEST_TYPE_ALIGN (LPEVENTMSG, 4) + TEST_TARGET_SIZE (LPEVENTMSG, 20) + TEST_TARGET_ALIGN(LPEVENTMSG, 4) +} + +static void test_pack_LPFILTERKEYS(void) +{ + /* LPFILTERKEYS */ + TEST_TYPE_SIZE (LPFILTERKEYS, 4) + TEST_TYPE_ALIGN (LPFILTERKEYS, 4) + TEST_TARGET_SIZE (LPFILTERKEYS, 24) + TEST_TARGET_ALIGN(LPFILTERKEYS, 4) +} + +static void test_pack_LPGUITHREADINFO(void) +{ + /* LPGUITHREADINFO */ + TEST_TYPE_SIZE (LPGUITHREADINFO, 4) + TEST_TYPE_ALIGN (LPGUITHREADINFO, 4) + TEST_TARGET_SIZE (LPGUITHREADINFO, 48) + TEST_TARGET_ALIGN(LPGUITHREADINFO, 4) +} + +static void test_pack_LPHARDWAREHOOKSTRUCT(void) +{ + /* LPHARDWAREHOOKSTRUCT */ + TEST_TYPE_SIZE (LPHARDWAREHOOKSTRUCT, 4) + TEST_TYPE_ALIGN (LPHARDWAREHOOKSTRUCT, 4) + TEST_TARGET_SIZE (LPHARDWAREHOOKSTRUCT, 16) + TEST_TARGET_ALIGN(LPHARDWAREHOOKSTRUCT, 4) +} + +static void test_pack_LPHARDWAREINPUT(void) +{ + /* LPHARDWAREINPUT */ + TEST_TYPE_SIZE (LPHARDWAREINPUT, 4) + TEST_TYPE_ALIGN (LPHARDWAREINPUT, 4) + TEST_TARGET_SIZE (LPHARDWAREINPUT, 8) + TEST_TARGET_ALIGN(LPHARDWAREINPUT, 4) +} + +static void test_pack_LPHELPINFO(void) +{ + /* LPHELPINFO */ + TEST_TYPE_SIZE (LPHELPINFO, 4) + TEST_TYPE_ALIGN (LPHELPINFO, 4) + TEST_TARGET_SIZE (LPHELPINFO, 28) + TEST_TARGET_ALIGN(LPHELPINFO, 4) +} + +static void test_pack_LPHELPWININFOA(void) +{ + /* LPHELPWININFOA */ + TEST_TYPE_SIZE (LPHELPWININFOA, 4) + TEST_TYPE_ALIGN (LPHELPWININFOA, 4) + TEST_TARGET_SIZE (LPHELPWININFOA, 28) + TEST_TARGET_ALIGN(LPHELPWININFOA, 4) +} + +static void test_pack_LPHELPWININFOW(void) +{ + /* LPHELPWININFOW */ + TEST_TYPE_SIZE (LPHELPWININFOW, 4) + TEST_TYPE_ALIGN (LPHELPWININFOW, 4) + TEST_TARGET_SIZE (LPHELPWININFOW, 28) + TEST_TARGET_ALIGN(LPHELPWININFOW, 4) +} + +static void test_pack_LPHIGHCONTRASTA(void) +{ + /* LPHIGHCONTRASTA */ + TEST_TYPE_SIZE (LPHIGHCONTRASTA, 4) + TEST_TYPE_ALIGN (LPHIGHCONTRASTA, 4) + TEST_TARGET_SIZE (LPHIGHCONTRASTA, 12) + TEST_TARGET_ALIGN(LPHIGHCONTRASTA, 4) +} + +static void test_pack_LPHIGHCONTRASTW(void) +{ + /* LPHIGHCONTRASTW */ + TEST_TYPE_SIZE (LPHIGHCONTRASTW, 4) + TEST_TYPE_ALIGN (LPHIGHCONTRASTW, 4) + TEST_TARGET_SIZE (LPHIGHCONTRASTW, 12) + TEST_TARGET_ALIGN(LPHIGHCONTRASTW, 4) +} + +static void test_pack_LPICONMETRICSA(void) +{ + /* LPICONMETRICSA */ + TEST_TYPE_SIZE (LPICONMETRICSA, 4) + TEST_TYPE_ALIGN (LPICONMETRICSA, 4) + TEST_TARGET_SIZE (LPICONMETRICSA, 76) + TEST_TARGET_ALIGN(LPICONMETRICSA, 4) +} + +static void test_pack_LPICONMETRICSW(void) +{ + /* LPICONMETRICSW */ + TEST_TYPE_SIZE (LPICONMETRICSW, 4) + TEST_TYPE_ALIGN (LPICONMETRICSW, 4) + TEST_TARGET_SIZE (LPICONMETRICSW, 108) + TEST_TARGET_ALIGN(LPICONMETRICSW, 4) +} + +static void test_pack_LPINPUT(void) +{ + /* LPINPUT */ + TEST_TYPE_SIZE (LPINPUT, 4) + TEST_TYPE_ALIGN (LPINPUT, 4) +} + +static void test_pack_LPKBDLLHOOKSTRUCT(void) +{ + /* LPKBDLLHOOKSTRUCT */ + TEST_TYPE_SIZE (LPKBDLLHOOKSTRUCT, 4) + TEST_TYPE_ALIGN (LPKBDLLHOOKSTRUCT, 4) + TEST_TARGET_SIZE (LPKBDLLHOOKSTRUCT, 20) + TEST_TARGET_ALIGN(LPKBDLLHOOKSTRUCT, 4) +} + +static void test_pack_LPKEYBDINPUT(void) +{ + /* LPKEYBDINPUT */ + TEST_TYPE_SIZE (LPKEYBDINPUT, 4) + TEST_TYPE_ALIGN (LPKEYBDINPUT, 4) + TEST_TARGET_SIZE (LPKEYBDINPUT, 16) + TEST_TARGET_ALIGN(LPKEYBDINPUT, 4) +} + +static void test_pack_LPMDICREATESTRUCTA(void) +{ + /* LPMDICREATESTRUCTA */ + TEST_TYPE_SIZE (LPMDICREATESTRUCTA, 4) + TEST_TYPE_ALIGN (LPMDICREATESTRUCTA, 4) + TEST_TARGET_SIZE (LPMDICREATESTRUCTA, 36) + TEST_TARGET_ALIGN(LPMDICREATESTRUCTA, 4) +} + +static void test_pack_LPMDICREATESTRUCTW(void) +{ + /* LPMDICREATESTRUCTW */ + TEST_TYPE_SIZE (LPMDICREATESTRUCTW, 4) + TEST_TYPE_ALIGN (LPMDICREATESTRUCTW, 4) + TEST_TARGET_SIZE (LPMDICREATESTRUCTW, 36) + TEST_TARGET_ALIGN(LPMDICREATESTRUCTW, 4) +} + +static void test_pack_LPMDINEXTMENU(void) +{ + /* LPMDINEXTMENU */ + TEST_TYPE_SIZE (LPMDINEXTMENU, 4) + TEST_TYPE_ALIGN (LPMDINEXTMENU, 4) + TEST_TARGET_SIZE (LPMDINEXTMENU, 12) + TEST_TARGET_ALIGN(LPMDINEXTMENU, 4) +} + +static void test_pack_LPMEASUREITEMSTRUCT(void) +{ + /* LPMEASUREITEMSTRUCT */ + TEST_TYPE_SIZE (LPMEASUREITEMSTRUCT, 4) + TEST_TYPE_ALIGN (LPMEASUREITEMSTRUCT, 4) + TEST_TARGET_SIZE (LPMEASUREITEMSTRUCT, 24) + TEST_TARGET_ALIGN(LPMEASUREITEMSTRUCT, 4) +} + +static void test_pack_LPMENUINFO(void) +{ + /* LPMENUINFO */ + TEST_TYPE_SIZE (LPMENUINFO, 4) + TEST_TYPE_ALIGN (LPMENUINFO, 4) + TEST_TARGET_SIZE (LPMENUINFO, 28) + TEST_TARGET_ALIGN(LPMENUINFO, 4) +} + +static void test_pack_LPMENUITEMINFOA(void) +{ + /* LPMENUITEMINFOA */ + TEST_TYPE_SIZE (LPMENUITEMINFOA, 4) + TEST_TYPE_ALIGN (LPMENUITEMINFOA, 4) + TEST_TARGET_SIZE (LPMENUITEMINFOA, 48) + TEST_TARGET_ALIGN(LPMENUITEMINFOA, 4) +} + +static void test_pack_LPMENUITEMINFOW(void) +{ + /* LPMENUITEMINFOW */ + TEST_TYPE_SIZE (LPMENUITEMINFOW, 4) + TEST_TYPE_ALIGN (LPMENUITEMINFOW, 4) + TEST_TARGET_SIZE (LPMENUITEMINFOW, 48) + TEST_TARGET_ALIGN(LPMENUITEMINFOW, 4) +} + +static void test_pack_LPMINIMIZEDMETRICS(void) +{ + /* LPMINIMIZEDMETRICS */ + TEST_TYPE_SIZE (LPMINIMIZEDMETRICS, 4) + TEST_TYPE_ALIGN (LPMINIMIZEDMETRICS, 4) + TEST_TARGET_SIZE (LPMINIMIZEDMETRICS, 20) + TEST_TARGET_ALIGN(LPMINIMIZEDMETRICS, 4) +} + +static void test_pack_LPMINMAXINFO(void) +{ + /* LPMINMAXINFO */ + TEST_TYPE_SIZE (LPMINMAXINFO, 4) + TEST_TYPE_ALIGN (LPMINMAXINFO, 4) + TEST_TARGET_SIZE (LPMINMAXINFO, 40) + TEST_TARGET_ALIGN(LPMINMAXINFO, 4) +} + +static void test_pack_LPMONITORINFO(void) +{ + /* LPMONITORINFO */ + TEST_TYPE_SIZE (LPMONITORINFO, 4) + TEST_TYPE_ALIGN (LPMONITORINFO, 4) + TEST_TARGET_SIZE (LPMONITORINFO, 40) + TEST_TARGET_ALIGN(LPMONITORINFO, 4) +} + +static void test_pack_LPMONITORINFOEXA(void) +{ + /* LPMONITORINFOEXA */ + TEST_TYPE_SIZE (LPMONITORINFOEXA, 4) + TEST_TYPE_ALIGN (LPMONITORINFOEXA, 4) + TEST_TARGET_SIZE (LPMONITORINFOEXA, 72) + TEST_TARGET_ALIGN(LPMONITORINFOEXA, 4) +} + +static void test_pack_LPMONITORINFOEXW(void) +{ + /* LPMONITORINFOEXW */ + TEST_TYPE_SIZE (LPMONITORINFOEXW, 4) + TEST_TYPE_ALIGN (LPMONITORINFOEXW, 4) + TEST_TARGET_SIZE (LPMONITORINFOEXW, 104) + TEST_TARGET_ALIGN(LPMONITORINFOEXW, 4) +} + +static void test_pack_LPMOUSEHOOKSTRUCT(void) +{ + /* LPMOUSEHOOKSTRUCT */ + TEST_TYPE_SIZE (LPMOUSEHOOKSTRUCT, 4) + TEST_TYPE_ALIGN (LPMOUSEHOOKSTRUCT, 4) + TEST_TARGET_SIZE (LPMOUSEHOOKSTRUCT, 20) + TEST_TARGET_ALIGN(LPMOUSEHOOKSTRUCT, 4) +} + +static void test_pack_LPMOUSEINPUT(void) +{ + /* LPMOUSEINPUT */ + TEST_TYPE_SIZE (LPMOUSEINPUT, 4) + TEST_TYPE_ALIGN (LPMOUSEINPUT, 4) + TEST_TARGET_SIZE (LPMOUSEINPUT, 24) + TEST_TARGET_ALIGN(LPMOUSEINPUT, 4) +} + +static void test_pack_LPMOUSEKEYS(void) +{ + /* LPMOUSEKEYS */ + TEST_TYPE_SIZE (LPMOUSEKEYS, 4) + TEST_TYPE_ALIGN (LPMOUSEKEYS, 4) + TEST_TARGET_SIZE (LPMOUSEKEYS, 28) + TEST_TARGET_ALIGN(LPMOUSEKEYS, 4) +} + +static void test_pack_LPMSG(void) +{ + /* LPMSG */ + TEST_TYPE_SIZE (LPMSG, 4) + TEST_TYPE_ALIGN (LPMSG, 4) + TEST_TARGET_SIZE (LPMSG, 28) + TEST_TARGET_ALIGN(LPMSG, 4) +} + +static void test_pack_LPMSGBOXPARAMSA(void) +{ + /* LPMSGBOXPARAMSA */ + TEST_TYPE_SIZE (LPMSGBOXPARAMSA, 4) + TEST_TYPE_ALIGN (LPMSGBOXPARAMSA, 4) + TEST_TARGET_SIZE (LPMSGBOXPARAMSA, 40) + TEST_TARGET_ALIGN(LPMSGBOXPARAMSA, 4) +} + +static void test_pack_LPMSGBOXPARAMSW(void) +{ + /* LPMSGBOXPARAMSW */ + TEST_TYPE_SIZE (LPMSGBOXPARAMSW, 4) + TEST_TYPE_ALIGN (LPMSGBOXPARAMSW, 4) + TEST_TARGET_SIZE (LPMSGBOXPARAMSW, 40) + TEST_TARGET_ALIGN(LPMSGBOXPARAMSW, 4) +} + +static void test_pack_LPMSLLHOOKSTRUCT(void) +{ + /* LPMSLLHOOKSTRUCT */ + TEST_TYPE_SIZE (LPMSLLHOOKSTRUCT, 4) + TEST_TYPE_ALIGN (LPMSLLHOOKSTRUCT, 4) + TEST_TARGET_SIZE (LPMSLLHOOKSTRUCT, 24) + TEST_TARGET_ALIGN(LPMSLLHOOKSTRUCT, 4) +} + +static void test_pack_LPMULTIKEYHELPA(void) +{ + /* LPMULTIKEYHELPA */ + TEST_TYPE_SIZE (LPMULTIKEYHELPA, 4) + TEST_TYPE_ALIGN (LPMULTIKEYHELPA, 4) + TEST_TARGET_SIZE (LPMULTIKEYHELPA, 8) + TEST_TARGET_ALIGN(LPMULTIKEYHELPA, 4) +} + +static void test_pack_LPMULTIKEYHELPW(void) +{ + /* LPMULTIKEYHELPW */ + TEST_TYPE_SIZE (LPMULTIKEYHELPW, 4) + TEST_TYPE_ALIGN (LPMULTIKEYHELPW, 4) + TEST_TARGET_SIZE (LPMULTIKEYHELPW, 8) + TEST_TARGET_ALIGN(LPMULTIKEYHELPW, 4) +} + +static void test_pack_LPNCCALCSIZE_PARAMS(void) +{ + /* LPNCCALCSIZE_PARAMS */ + TEST_TYPE_SIZE (LPNCCALCSIZE_PARAMS, 4) + TEST_TYPE_ALIGN (LPNCCALCSIZE_PARAMS, 4) + TEST_TARGET_SIZE (LPNCCALCSIZE_PARAMS, 52) + TEST_TARGET_ALIGN(LPNCCALCSIZE_PARAMS, 4) +} + +static void test_pack_LPNMHDR(void) +{ + /* LPNMHDR */ + TEST_TYPE_SIZE (LPNMHDR, 4) + TEST_TYPE_ALIGN (LPNMHDR, 4) + TEST_TARGET_SIZE (LPNMHDR, 12) + TEST_TARGET_ALIGN(LPNMHDR, 4) +} + +static void test_pack_LPNONCLIENTMETRICSA(void) +{ + /* LPNONCLIENTMETRICSA */ + TEST_TYPE_SIZE (LPNONCLIENTMETRICSA, 4) + TEST_TYPE_ALIGN (LPNONCLIENTMETRICSA, 4) + TEST_TARGET_SIZE (LPNONCLIENTMETRICSA, 340) + TEST_TARGET_ALIGN(LPNONCLIENTMETRICSA, 4) +} + +static void test_pack_LPNONCLIENTMETRICSW(void) +{ + /* LPNONCLIENTMETRICSW */ + TEST_TYPE_SIZE (LPNONCLIENTMETRICSW, 4) + TEST_TYPE_ALIGN (LPNONCLIENTMETRICSW, 4) + TEST_TARGET_SIZE (LPNONCLIENTMETRICSW, 500) + TEST_TARGET_ALIGN(LPNONCLIENTMETRICSW, 4) +} + +static void test_pack_LPPAINTSTRUCT(void) +{ + /* LPPAINTSTRUCT */ + TEST_TYPE_SIZE (LPPAINTSTRUCT, 4) + TEST_TYPE_ALIGN (LPPAINTSTRUCT, 4) + TEST_TARGET_SIZE (LPPAINTSTRUCT, 64) + TEST_TARGET_ALIGN(LPPAINTSTRUCT, 4) +} + +static void test_pack_LPSCROLLINFO(void) +{ + /* LPSCROLLINFO */ + TEST_TYPE_SIZE (LPSCROLLINFO, 4) + TEST_TYPE_ALIGN (LPSCROLLINFO, 4) + TEST_TARGET_SIZE (LPSCROLLINFO, 28) + TEST_TARGET_ALIGN(LPSCROLLINFO, 4) +} + +static void test_pack_LPSERIALKEYSA(void) +{ + /* LPSERIALKEYSA */ + TEST_TYPE_SIZE (LPSERIALKEYSA, 4) + TEST_TYPE_ALIGN (LPSERIALKEYSA, 4) + TEST_TARGET_SIZE (LPSERIALKEYSA, 28) + TEST_TARGET_ALIGN(LPSERIALKEYSA, 4) +} + +static void test_pack_LPSERIALKEYSW(void) +{ + /* LPSERIALKEYSW */ + TEST_TYPE_SIZE (LPSERIALKEYSW, 4) + TEST_TYPE_ALIGN (LPSERIALKEYSW, 4) + TEST_TARGET_SIZE (LPSERIALKEYSW, 28) + TEST_TARGET_ALIGN(LPSERIALKEYSW, 4) +} + +static void test_pack_LPSOUNDSENTRYA(void) +{ + /* LPSOUNDSENTRYA */ + TEST_TYPE_SIZE (LPSOUNDSENTRYA, 4) + TEST_TYPE_ALIGN (LPSOUNDSENTRYA, 4) + TEST_TARGET_SIZE (LPSOUNDSENTRYA, 48) + TEST_TARGET_ALIGN(LPSOUNDSENTRYA, 4) +} + +static void test_pack_LPSOUNDSENTRYW(void) +{ + /* LPSOUNDSENTRYW */ + TEST_TYPE_SIZE (LPSOUNDSENTRYW, 4) + TEST_TYPE_ALIGN (LPSOUNDSENTRYW, 4) + TEST_TARGET_SIZE (LPSOUNDSENTRYW, 48) + TEST_TARGET_ALIGN(LPSOUNDSENTRYW, 4) +} + +static void test_pack_LPSTICKYKEYS(void) +{ + /* LPSTICKYKEYS */ + TEST_TYPE_SIZE (LPSTICKYKEYS, 4) + TEST_TYPE_ALIGN (LPSTICKYKEYS, 4) + TEST_TARGET_SIZE (LPSTICKYKEYS, 8) + TEST_TARGET_ALIGN(LPSTICKYKEYS, 4) +} + +static void test_pack_LPSTYLESTRUCT(void) +{ + /* LPSTYLESTRUCT */ + TEST_TYPE_SIZE (LPSTYLESTRUCT, 4) + TEST_TYPE_ALIGN (LPSTYLESTRUCT, 4) + TEST_TARGET_SIZE (LPSTYLESTRUCT, 8) + TEST_TARGET_ALIGN(LPSTYLESTRUCT, 4) +} + +static void test_pack_LPTITLEBARINFO(void) +{ + /* LPTITLEBARINFO */ + TEST_TYPE_SIZE (LPTITLEBARINFO, 4) + TEST_TYPE_ALIGN (LPTITLEBARINFO, 4) + TEST_TARGET_SIZE (LPTITLEBARINFO, 44) + TEST_TARGET_ALIGN(LPTITLEBARINFO, 4) +} + +static void test_pack_LPTOGGLEKEYS(void) +{ + /* LPTOGGLEKEYS */ + TEST_TYPE_SIZE (LPTOGGLEKEYS, 4) + TEST_TYPE_ALIGN (LPTOGGLEKEYS, 4) + TEST_TARGET_SIZE (LPTOGGLEKEYS, 8) + TEST_TARGET_ALIGN(LPTOGGLEKEYS, 4) +} + +static void test_pack_LPTPMPARAMS(void) +{ + /* LPTPMPARAMS */ + TEST_TYPE_SIZE (LPTPMPARAMS, 4) + TEST_TYPE_ALIGN (LPTPMPARAMS, 4) + TEST_TARGET_SIZE (LPTPMPARAMS, 20) + TEST_TARGET_ALIGN(LPTPMPARAMS, 4) +} + +static void test_pack_LPTRACKMOUSEEVENT(void) +{ + /* LPTRACKMOUSEEVENT */ + TEST_TYPE_SIZE (LPTRACKMOUSEEVENT, 4) + TEST_TYPE_ALIGN (LPTRACKMOUSEEVENT, 4) + TEST_TARGET_SIZE (LPTRACKMOUSEEVENT, 16) + TEST_TARGET_ALIGN(LPTRACKMOUSEEVENT, 4) +} + +static void test_pack_LPWINDOWINFO(void) +{ + /* LPWINDOWINFO */ + TEST_TYPE_SIZE (LPWINDOWINFO, 4) + TEST_TYPE_ALIGN (LPWINDOWINFO, 4) + TEST_TARGET_SIZE (LPWINDOWINFO, 60) + TEST_TARGET_ALIGN(LPWINDOWINFO, 4) +} + +static void test_pack_LPWINDOWPLACEMENT(void) +{ + /* LPWINDOWPLACEMENT */ + TEST_TYPE_SIZE (LPWINDOWPLACEMENT, 4) + TEST_TYPE_ALIGN (LPWINDOWPLACEMENT, 4) + TEST_TARGET_SIZE (LPWINDOWPLACEMENT, 44) + TEST_TARGET_ALIGN(LPWINDOWPLACEMENT, 4) +} + +static void test_pack_LPWINDOWPOS(void) +{ + /* LPWINDOWPOS */ + TEST_TYPE_SIZE (LPWINDOWPOS, 4) + TEST_TYPE_ALIGN (LPWINDOWPOS, 4) + TEST_TARGET_SIZE (LPWINDOWPOS, 28) + TEST_TARGET_ALIGN(LPWINDOWPOS, 4) +} + +static void test_pack_LPWNDCLASSA(void) +{ + /* LPWNDCLASSA */ + TEST_TYPE_SIZE (LPWNDCLASSA, 4) + TEST_TYPE_ALIGN (LPWNDCLASSA, 4) + TEST_TARGET_SIZE (LPWNDCLASSA, 40) + TEST_TARGET_ALIGN(LPWNDCLASSA, 4) +} + +static void test_pack_LPWNDCLASSEXA(void) +{ + /* LPWNDCLASSEXA */ + TEST_TYPE_SIZE (LPWNDCLASSEXA, 4) + TEST_TYPE_ALIGN (LPWNDCLASSEXA, 4) + TEST_TARGET_SIZE (LPWNDCLASSEXA, 48) + TEST_TARGET_ALIGN(LPWNDCLASSEXA, 4) +} + +static void test_pack_LPWNDCLASSEXW(void) +{ + /* LPWNDCLASSEXW */ + TEST_TYPE_SIZE (LPWNDCLASSEXW, 4) + TEST_TYPE_ALIGN (LPWNDCLASSEXW, 4) + TEST_TARGET_SIZE (LPWNDCLASSEXW, 48) + TEST_TARGET_ALIGN(LPWNDCLASSEXW, 4) +} + +static void test_pack_LPWNDCLASSW(void) +{ + /* LPWNDCLASSW */ + TEST_TYPE_SIZE (LPWNDCLASSW, 4) + TEST_TYPE_ALIGN (LPWNDCLASSW, 4) + TEST_TARGET_SIZE (LPWNDCLASSW, 40) + TEST_TARGET_ALIGN(LPWNDCLASSW, 4) +} + +static void test_pack_MDICREATESTRUCTA(void) +{ + /* MDICREATESTRUCTA (pack 4) */ + TEST_TYPE_SIZE (MDICREATESTRUCTA, 36) + TEST_TYPE_ALIGN (MDICREATESTRUCTA, 4) + TEST_FIELD_SIZE (MDICREATESTRUCTA, szClass, 4) + TEST_FIELD_ALIGN (MDICREATESTRUCTA, szClass, 4) + TEST_FIELD_OFFSET(MDICREATESTRUCTA, szClass, 0) + TEST_FIELD_SIZE (MDICREATESTRUCTA, szTitle, 4) + TEST_FIELD_ALIGN (MDICREATESTRUCTA, szTitle, 4) + TEST_FIELD_OFFSET(MDICREATESTRUCTA, szTitle, 4) + TEST_FIELD_SIZE (MDICREATESTRUCTA, hOwner, 4) + TEST_FIELD_ALIGN (MDICREATESTRUCTA, hOwner, 4) + TEST_FIELD_OFFSET(MDICREATESTRUCTA, hOwner, 8) + TEST_FIELD_SIZE (MDICREATESTRUCTA, x, 4) + TEST_FIELD_ALIGN (MDICREATESTRUCTA, x, 4) + TEST_FIELD_OFFSET(MDICREATESTRUCTA, x, 12) + TEST_FIELD_SIZE (MDICREATESTRUCTA, y, 4) + TEST_FIELD_ALIGN (MDICREATESTRUCTA, y, 4) + TEST_FIELD_OFFSET(MDICREATESTRUCTA, y, 16) + TEST_FIELD_SIZE (MDICREATESTRUCTA, cx, 4) + TEST_FIELD_ALIGN (MDICREATESTRUCTA, cx, 4) + TEST_FIELD_OFFSET(MDICREATESTRUCTA, cx, 20) + TEST_FIELD_SIZE (MDICREATESTRUCTA, cy, 4) + TEST_FIELD_ALIGN (MDICREATESTRUCTA, cy, 4) + TEST_FIELD_OFFSET(MDICREATESTRUCTA, cy, 24) + TEST_FIELD_SIZE (MDICREATESTRUCTA, style, 4) + TEST_FIELD_ALIGN (MDICREATESTRUCTA, style, 4) + TEST_FIELD_OFFSET(MDICREATESTRUCTA, style, 28) + TEST_FIELD_SIZE (MDICREATESTRUCTA, lParam, 4) + TEST_FIELD_ALIGN (MDICREATESTRUCTA, lParam, 4) + TEST_FIELD_OFFSET(MDICREATESTRUCTA, lParam, 32) +} + +static void test_pack_MDICREATESTRUCTW(void) +{ + /* MDICREATESTRUCTW (pack 4) */ + TEST_TYPE_SIZE (MDICREATESTRUCTW, 36) + TEST_TYPE_ALIGN (MDICREATESTRUCTW, 4) + TEST_FIELD_SIZE (MDICREATESTRUCTW, szClass, 4) + TEST_FIELD_ALIGN (MDICREATESTRUCTW, szClass, 4) + TEST_FIELD_OFFSET(MDICREATESTRUCTW, szClass, 0) + TEST_FIELD_SIZE (MDICREATESTRUCTW, szTitle, 4) + TEST_FIELD_ALIGN (MDICREATESTRUCTW, szTitle, 4) + TEST_FIELD_OFFSET(MDICREATESTRUCTW, szTitle, 4) + TEST_FIELD_SIZE (MDICREATESTRUCTW, hOwner, 4) + TEST_FIELD_ALIGN (MDICREATESTRUCTW, hOwner, 4) + TEST_FIELD_OFFSET(MDICREATESTRUCTW, hOwner, 8) + TEST_FIELD_SIZE (MDICREATESTRUCTW, x, 4) + TEST_FIELD_ALIGN (MDICREATESTRUCTW, x, 4) + TEST_FIELD_OFFSET(MDICREATESTRUCTW, x, 12) + TEST_FIELD_SIZE (MDICREATESTRUCTW, y, 4) + TEST_FIELD_ALIGN (MDICREATESTRUCTW, y, 4) + TEST_FIELD_OFFSET(MDICREATESTRUCTW, y, 16) + TEST_FIELD_SIZE (MDICREATESTRUCTW, cx, 4) + TEST_FIELD_ALIGN (MDICREATESTRUCTW, cx, 4) + TEST_FIELD_OFFSET(MDICREATESTRUCTW, cx, 20) + TEST_FIELD_SIZE (MDICREATESTRUCTW, cy, 4) + TEST_FIELD_ALIGN (MDICREATESTRUCTW, cy, 4) + TEST_FIELD_OFFSET(MDICREATESTRUCTW, cy, 24) + TEST_FIELD_SIZE (MDICREATESTRUCTW, style, 4) + TEST_FIELD_ALIGN (MDICREATESTRUCTW, style, 4) + TEST_FIELD_OFFSET(MDICREATESTRUCTW, style, 28) + TEST_FIELD_SIZE (MDICREATESTRUCTW, lParam, 4) + TEST_FIELD_ALIGN (MDICREATESTRUCTW, lParam, 4) + TEST_FIELD_OFFSET(MDICREATESTRUCTW, lParam, 32) +} + +static void test_pack_MDINEXTMENU(void) +{ + /* MDINEXTMENU (pack 4) */ + TEST_TYPE_SIZE (MDINEXTMENU, 12) + TEST_TYPE_ALIGN (MDINEXTMENU, 4) + TEST_FIELD_SIZE (MDINEXTMENU, hmenuIn, 4) + TEST_FIELD_ALIGN (MDINEXTMENU, hmenuIn, 4) + TEST_FIELD_OFFSET(MDINEXTMENU, hmenuIn, 0) + TEST_FIELD_SIZE (MDINEXTMENU, hmenuNext, 4) + TEST_FIELD_ALIGN (MDINEXTMENU, hmenuNext, 4) + TEST_FIELD_OFFSET(MDINEXTMENU, hmenuNext, 4) + TEST_FIELD_SIZE (MDINEXTMENU, hwndNext, 4) + TEST_FIELD_ALIGN (MDINEXTMENU, hwndNext, 4) + TEST_FIELD_OFFSET(MDINEXTMENU, hwndNext, 8) +} + +static void test_pack_MEASUREITEMSTRUCT(void) +{ + /* MEASUREITEMSTRUCT (pack 4) */ + TEST_TYPE_SIZE (MEASUREITEMSTRUCT, 24) + TEST_TYPE_ALIGN (MEASUREITEMSTRUCT, 4) + TEST_FIELD_SIZE (MEASUREITEMSTRUCT, CtlType, 4) + TEST_FIELD_ALIGN (MEASUREITEMSTRUCT, CtlType, 4) + TEST_FIELD_OFFSET(MEASUREITEMSTRUCT, CtlType, 0) + TEST_FIELD_SIZE (MEASUREITEMSTRUCT, CtlID, 4) + TEST_FIELD_ALIGN (MEASUREITEMSTRUCT, CtlID, 4) + TEST_FIELD_OFFSET(MEASUREITEMSTRUCT, CtlID, 4) + TEST_FIELD_SIZE (MEASUREITEMSTRUCT, itemID, 4) + TEST_FIELD_ALIGN (MEASUREITEMSTRUCT, itemID, 4) + TEST_FIELD_OFFSET(MEASUREITEMSTRUCT, itemID, 8) + TEST_FIELD_SIZE (MEASUREITEMSTRUCT, itemWidth, 4) + TEST_FIELD_ALIGN (MEASUREITEMSTRUCT, itemWidth, 4) + TEST_FIELD_OFFSET(MEASUREITEMSTRUCT, itemWidth, 12) + TEST_FIELD_SIZE (MEASUREITEMSTRUCT, itemHeight, 4) + TEST_FIELD_ALIGN (MEASUREITEMSTRUCT, itemHeight, 4) + TEST_FIELD_OFFSET(MEASUREITEMSTRUCT, itemHeight, 16) + TEST_FIELD_SIZE (MEASUREITEMSTRUCT, itemData, 4) + TEST_FIELD_ALIGN (MEASUREITEMSTRUCT, itemData, 4) + TEST_FIELD_OFFSET(MEASUREITEMSTRUCT, itemData, 20) +} + +static void test_pack_MENUINFO(void) +{ + /* MENUINFO (pack 4) */ + TEST_TYPE_SIZE (MENUINFO, 28) + TEST_TYPE_ALIGN (MENUINFO, 4) + TEST_FIELD_SIZE (MENUINFO, cbSize, 4) + TEST_FIELD_ALIGN (MENUINFO, cbSize, 4) + TEST_FIELD_OFFSET(MENUINFO, cbSize, 0) + TEST_FIELD_SIZE (MENUINFO, fMask, 4) + TEST_FIELD_ALIGN (MENUINFO, fMask, 4) + TEST_FIELD_OFFSET(MENUINFO, fMask, 4) + TEST_FIELD_SIZE (MENUINFO, dwStyle, 4) + TEST_FIELD_ALIGN (MENUINFO, dwStyle, 4) + TEST_FIELD_OFFSET(MENUINFO, dwStyle, 8) + TEST_FIELD_SIZE (MENUINFO, cyMax, 4) + TEST_FIELD_ALIGN (MENUINFO, cyMax, 4) + TEST_FIELD_OFFSET(MENUINFO, cyMax, 12) + TEST_FIELD_SIZE (MENUINFO, hbrBack, 4) + TEST_FIELD_ALIGN (MENUINFO, hbrBack, 4) + TEST_FIELD_OFFSET(MENUINFO, hbrBack, 16) + TEST_FIELD_SIZE (MENUINFO, dwContextHelpID, 4) + TEST_FIELD_ALIGN (MENUINFO, dwContextHelpID, 4) + TEST_FIELD_OFFSET(MENUINFO, dwContextHelpID, 20) + TEST_FIELD_SIZE (MENUINFO, dwMenuData, 4) + TEST_FIELD_ALIGN (MENUINFO, dwMenuData, 4) + TEST_FIELD_OFFSET(MENUINFO, dwMenuData, 24) +} + +static void test_pack_MENUITEMINFOA(void) +{ + /* MENUITEMINFOA (pack 4) */ + TEST_TYPE_SIZE (MENUITEMINFOA, 48) + TEST_TYPE_ALIGN (MENUITEMINFOA, 4) + TEST_FIELD_SIZE (MENUITEMINFOA, cbSize, 4) + TEST_FIELD_ALIGN (MENUITEMINFOA, cbSize, 4) + TEST_FIELD_OFFSET(MENUITEMINFOA, cbSize, 0) + TEST_FIELD_SIZE (MENUITEMINFOA, fMask, 4) + TEST_FIELD_ALIGN (MENUITEMINFOA, fMask, 4) + TEST_FIELD_OFFSET(MENUITEMINFOA, fMask, 4) + TEST_FIELD_SIZE (MENUITEMINFOA, fType, 4) + TEST_FIELD_ALIGN (MENUITEMINFOA, fType, 4) + TEST_FIELD_OFFSET(MENUITEMINFOA, fType, 8) + TEST_FIELD_SIZE (MENUITEMINFOA, fState, 4) + TEST_FIELD_ALIGN (MENUITEMINFOA, fState, 4) + TEST_FIELD_OFFSET(MENUITEMINFOA, fState, 12) + TEST_FIELD_SIZE (MENUITEMINFOA, wID, 4) + TEST_FIELD_ALIGN (MENUITEMINFOA, wID, 4) + TEST_FIELD_OFFSET(MENUITEMINFOA, wID, 16) + TEST_FIELD_SIZE (MENUITEMINFOA, hSubMenu, 4) + TEST_FIELD_ALIGN (MENUITEMINFOA, hSubMenu, 4) + TEST_FIELD_OFFSET(MENUITEMINFOA, hSubMenu, 20) + TEST_FIELD_SIZE (MENUITEMINFOA, hbmpChecked, 4) + TEST_FIELD_ALIGN (MENUITEMINFOA, hbmpChecked, 4) + TEST_FIELD_OFFSET(MENUITEMINFOA, hbmpChecked, 24) + TEST_FIELD_SIZE (MENUITEMINFOA, hbmpUnchecked, 4) + TEST_FIELD_ALIGN (MENUITEMINFOA, hbmpUnchecked, 4) + TEST_FIELD_OFFSET(MENUITEMINFOA, hbmpUnchecked, 28) + TEST_FIELD_SIZE (MENUITEMINFOA, dwItemData, 4) + TEST_FIELD_ALIGN (MENUITEMINFOA, dwItemData, 4) + TEST_FIELD_OFFSET(MENUITEMINFOA, dwItemData, 32) + TEST_FIELD_SIZE (MENUITEMINFOA, dwTypeData, 4) + TEST_FIELD_ALIGN (MENUITEMINFOA, dwTypeData, 4) + TEST_FIELD_OFFSET(MENUITEMINFOA, dwTypeData, 36) + TEST_FIELD_SIZE (MENUITEMINFOA, cch, 4) + TEST_FIELD_ALIGN (MENUITEMINFOA, cch, 4) + TEST_FIELD_OFFSET(MENUITEMINFOA, cch, 40) + TEST_FIELD_SIZE (MENUITEMINFOA, hbmpItem, 4) + TEST_FIELD_ALIGN (MENUITEMINFOA, hbmpItem, 4) + TEST_FIELD_OFFSET(MENUITEMINFOA, hbmpItem, 44) +} + +static void test_pack_MENUITEMINFOW(void) +{ + /* MENUITEMINFOW (pack 4) */ + TEST_TYPE_SIZE (MENUITEMINFOW, 48) + TEST_TYPE_ALIGN (MENUITEMINFOW, 4) + TEST_FIELD_SIZE (MENUITEMINFOW, cbSize, 4) + TEST_FIELD_ALIGN (MENUITEMINFOW, cbSize, 4) + TEST_FIELD_OFFSET(MENUITEMINFOW, cbSize, 0) + TEST_FIELD_SIZE (MENUITEMINFOW, fMask, 4) + TEST_FIELD_ALIGN (MENUITEMINFOW, fMask, 4) + TEST_FIELD_OFFSET(MENUITEMINFOW, fMask, 4) + TEST_FIELD_SIZE (MENUITEMINFOW, fType, 4) + TEST_FIELD_ALIGN (MENUITEMINFOW, fType, 4) + TEST_FIELD_OFFSET(MENUITEMINFOW, fType, 8) + TEST_FIELD_SIZE (MENUITEMINFOW, fState, 4) + TEST_FIELD_ALIGN (MENUITEMINFOW, fState, 4) + TEST_FIELD_OFFSET(MENUITEMINFOW, fState, 12) + TEST_FIELD_SIZE (MENUITEMINFOW, wID, 4) + TEST_FIELD_ALIGN (MENUITEMINFOW, wID, 4) + TEST_FIELD_OFFSET(MENUITEMINFOW, wID, 16) + TEST_FIELD_SIZE (MENUITEMINFOW, hSubMenu, 4) + TEST_FIELD_ALIGN (MENUITEMINFOW, hSubMenu, 4) + TEST_FIELD_OFFSET(MENUITEMINFOW, hSubMenu, 20) + TEST_FIELD_SIZE (MENUITEMINFOW, hbmpChecked, 4) + TEST_FIELD_ALIGN (MENUITEMINFOW, hbmpChecked, 4) + TEST_FIELD_OFFSET(MENUITEMINFOW, hbmpChecked, 24) + TEST_FIELD_SIZE (MENUITEMINFOW, hbmpUnchecked, 4) + TEST_FIELD_ALIGN (MENUITEMINFOW, hbmpUnchecked, 4) + TEST_FIELD_OFFSET(MENUITEMINFOW, hbmpUnchecked, 28) + TEST_FIELD_SIZE (MENUITEMINFOW, dwItemData, 4) + TEST_FIELD_ALIGN (MENUITEMINFOW, dwItemData, 4) + TEST_FIELD_OFFSET(MENUITEMINFOW, dwItemData, 32) + TEST_FIELD_SIZE (MENUITEMINFOW, dwTypeData, 4) + TEST_FIELD_ALIGN (MENUITEMINFOW, dwTypeData, 4) + TEST_FIELD_OFFSET(MENUITEMINFOW, dwTypeData, 36) + TEST_FIELD_SIZE (MENUITEMINFOW, cch, 4) + TEST_FIELD_ALIGN (MENUITEMINFOW, cch, 4) + TEST_FIELD_OFFSET(MENUITEMINFOW, cch, 40) + TEST_FIELD_SIZE (MENUITEMINFOW, hbmpItem, 4) + TEST_FIELD_ALIGN (MENUITEMINFOW, hbmpItem, 4) + TEST_FIELD_OFFSET(MENUITEMINFOW, hbmpItem, 44) +} + +static void test_pack_MENUITEMTEMPLATE(void) +{ + /* MENUITEMTEMPLATE (pack 4) */ + TEST_TYPE_SIZE (MENUITEMTEMPLATE, 6) + TEST_TYPE_ALIGN (MENUITEMTEMPLATE, 2) + TEST_FIELD_SIZE (MENUITEMTEMPLATE, mtOption, 2) + TEST_FIELD_ALIGN (MENUITEMTEMPLATE, mtOption, 2) + TEST_FIELD_OFFSET(MENUITEMTEMPLATE, mtOption, 0) + TEST_FIELD_SIZE (MENUITEMTEMPLATE, mtID, 2) + TEST_FIELD_ALIGN (MENUITEMTEMPLATE, mtID, 2) + TEST_FIELD_OFFSET(MENUITEMTEMPLATE, mtID, 2) + TEST_FIELD_SIZE (MENUITEMTEMPLATE, mtString, 2) + TEST_FIELD_ALIGN (MENUITEMTEMPLATE, mtString, 2) + TEST_FIELD_OFFSET(MENUITEMTEMPLATE, mtString, 4) +} + +static void test_pack_MENUITEMTEMPLATEHEADER(void) +{ + /* MENUITEMTEMPLATEHEADER (pack 4) */ + TEST_TYPE_SIZE (MENUITEMTEMPLATEHEADER, 4) + TEST_TYPE_ALIGN (MENUITEMTEMPLATEHEADER, 2) + TEST_FIELD_SIZE (MENUITEMTEMPLATEHEADER, versionNumber, 2) + TEST_FIELD_ALIGN (MENUITEMTEMPLATEHEADER, versionNumber, 2) + TEST_FIELD_OFFSET(MENUITEMTEMPLATEHEADER, versionNumber, 0) + TEST_FIELD_SIZE (MENUITEMTEMPLATEHEADER, offset, 2) + TEST_FIELD_ALIGN (MENUITEMTEMPLATEHEADER, offset, 2) + TEST_FIELD_OFFSET(MENUITEMTEMPLATEHEADER, offset, 2) +} + +static void test_pack_MINIMIZEDMETRICS(void) +{ + /* MINIMIZEDMETRICS (pack 4) */ + TEST_TYPE_SIZE (MINIMIZEDMETRICS, 20) + TEST_TYPE_ALIGN (MINIMIZEDMETRICS, 4) + TEST_FIELD_SIZE (MINIMIZEDMETRICS, cbSize, 4) + TEST_FIELD_ALIGN (MINIMIZEDMETRICS, cbSize, 4) + TEST_FIELD_OFFSET(MINIMIZEDMETRICS, cbSize, 0) + TEST_FIELD_SIZE (MINIMIZEDMETRICS, iWidth, 4) + TEST_FIELD_ALIGN (MINIMIZEDMETRICS, iWidth, 4) + TEST_FIELD_OFFSET(MINIMIZEDMETRICS, iWidth, 4) + TEST_FIELD_SIZE (MINIMIZEDMETRICS, iHorzGap, 4) + TEST_FIELD_ALIGN (MINIMIZEDMETRICS, iHorzGap, 4) + TEST_FIELD_OFFSET(MINIMIZEDMETRICS, iHorzGap, 8) + TEST_FIELD_SIZE (MINIMIZEDMETRICS, iVertGap, 4) + TEST_FIELD_ALIGN (MINIMIZEDMETRICS, iVertGap, 4) + TEST_FIELD_OFFSET(MINIMIZEDMETRICS, iVertGap, 12) + TEST_FIELD_SIZE (MINIMIZEDMETRICS, iArrange, 4) + TEST_FIELD_ALIGN (MINIMIZEDMETRICS, iArrange, 4) + TEST_FIELD_OFFSET(MINIMIZEDMETRICS, iArrange, 16) +} + +static void test_pack_MINMAXINFO(void) +{ + /* MINMAXINFO (pack 4) */ + TEST_TYPE_SIZE (MINMAXINFO, 40) + TEST_TYPE_ALIGN (MINMAXINFO, 4) + TEST_FIELD_SIZE (MINMAXINFO, ptReserved, 8) + TEST_FIELD_ALIGN (MINMAXINFO, ptReserved, 4) + TEST_FIELD_OFFSET(MINMAXINFO, ptReserved, 0) + TEST_FIELD_SIZE (MINMAXINFO, ptMaxSize, 8) + TEST_FIELD_ALIGN (MINMAXINFO, ptMaxSize, 4) + TEST_FIELD_OFFSET(MINMAXINFO, ptMaxSize, 8) + TEST_FIELD_SIZE (MINMAXINFO, ptMaxPosition, 8) + TEST_FIELD_ALIGN (MINMAXINFO, ptMaxPosition, 4) + TEST_FIELD_OFFSET(MINMAXINFO, ptMaxPosition, 16) + TEST_FIELD_SIZE (MINMAXINFO, ptMinTrackSize, 8) + TEST_FIELD_ALIGN (MINMAXINFO, ptMinTrackSize, 4) + TEST_FIELD_OFFSET(MINMAXINFO, ptMinTrackSize, 24) + TEST_FIELD_SIZE (MINMAXINFO, ptMaxTrackSize, 8) + TEST_FIELD_ALIGN (MINMAXINFO, ptMaxTrackSize, 4) + TEST_FIELD_OFFSET(MINMAXINFO, ptMaxTrackSize, 32) +} + +static void test_pack_MONITORENUMPROC(void) +{ + /* MONITORENUMPROC */ + TEST_TYPE_SIZE (MONITORENUMPROC, 4) + TEST_TYPE_ALIGN (MONITORENUMPROC, 4) +} + +static void test_pack_MONITORINFO(void) +{ + /* MONITORINFO (pack 4) */ + TEST_TYPE_SIZE (MONITORINFO, 40) + TEST_TYPE_ALIGN (MONITORINFO, 4) + TEST_FIELD_SIZE (MONITORINFO, cbSize, 4) + TEST_FIELD_ALIGN (MONITORINFO, cbSize, 4) + TEST_FIELD_OFFSET(MONITORINFO, cbSize, 0) + TEST_FIELD_SIZE (MONITORINFO, rcMonitor, 16) + TEST_FIELD_ALIGN (MONITORINFO, rcMonitor, 4) + TEST_FIELD_OFFSET(MONITORINFO, rcMonitor, 4) + TEST_FIELD_SIZE (MONITORINFO, rcWork, 16) + TEST_FIELD_ALIGN (MONITORINFO, rcWork, 4) + TEST_FIELD_OFFSET(MONITORINFO, rcWork, 20) + TEST_FIELD_SIZE (MONITORINFO, dwFlags, 4) + TEST_FIELD_ALIGN (MONITORINFO, dwFlags, 4) + TEST_FIELD_OFFSET(MONITORINFO, dwFlags, 36) +} + +static void test_pack_MONITORINFOEXA(void) +{ + /* MONITORINFOEXA (pack 4) */ + TEST_TYPE_SIZE (MONITORINFOEXA, 72) + TEST_TYPE_ALIGN (MONITORINFOEXA, 4) + TEST_FIELD_SIZE (MONITORINFOEXA, cbSize, 4) + TEST_FIELD_ALIGN (MONITORINFOEXA, cbSize, 4) + TEST_FIELD_OFFSET(MONITORINFOEXA, cbSize, 0) + TEST_FIELD_SIZE (MONITORINFOEXA, rcMonitor, 16) + TEST_FIELD_ALIGN (MONITORINFOEXA, rcMonitor, 4) + TEST_FIELD_OFFSET(MONITORINFOEXA, rcMonitor, 4) + TEST_FIELD_SIZE (MONITORINFOEXA, rcWork, 16) + TEST_FIELD_ALIGN (MONITORINFOEXA, rcWork, 4) + TEST_FIELD_OFFSET(MONITORINFOEXA, rcWork, 20) + TEST_FIELD_SIZE (MONITORINFOEXA, dwFlags, 4) + TEST_FIELD_ALIGN (MONITORINFOEXA, dwFlags, 4) + TEST_FIELD_OFFSET(MONITORINFOEXA, dwFlags, 36) + TEST_FIELD_SIZE (MONITORINFOEXA, szDevice, 32) + TEST_FIELD_ALIGN (MONITORINFOEXA, szDevice, 1) + TEST_FIELD_OFFSET(MONITORINFOEXA, szDevice, 40) +} + +static void test_pack_MONITORINFOEXW(void) +{ + /* MONITORINFOEXW (pack 4) */ + TEST_TYPE_SIZE (MONITORINFOEXW, 104) + TEST_TYPE_ALIGN (MONITORINFOEXW, 4) + TEST_FIELD_SIZE (MONITORINFOEXW, cbSize, 4) + TEST_FIELD_ALIGN (MONITORINFOEXW, cbSize, 4) + TEST_FIELD_OFFSET(MONITORINFOEXW, cbSize, 0) + TEST_FIELD_SIZE (MONITORINFOEXW, rcMonitor, 16) + TEST_FIELD_ALIGN (MONITORINFOEXW, rcMonitor, 4) + TEST_FIELD_OFFSET(MONITORINFOEXW, rcMonitor, 4) + TEST_FIELD_SIZE (MONITORINFOEXW, rcWork, 16) + TEST_FIELD_ALIGN (MONITORINFOEXW, rcWork, 4) + TEST_FIELD_OFFSET(MONITORINFOEXW, rcWork, 20) + TEST_FIELD_SIZE (MONITORINFOEXW, dwFlags, 4) + TEST_FIELD_ALIGN (MONITORINFOEXW, dwFlags, 4) + TEST_FIELD_OFFSET(MONITORINFOEXW, dwFlags, 36) + TEST_FIELD_SIZE (MONITORINFOEXW, szDevice, 64) + TEST_FIELD_ALIGN (MONITORINFOEXW, szDevice, 2) + TEST_FIELD_OFFSET(MONITORINFOEXW, szDevice, 40) +} + +static void test_pack_MOUSEHOOKSTRUCT(void) +{ + /* MOUSEHOOKSTRUCT (pack 4) */ + TEST_TYPE_SIZE (MOUSEHOOKSTRUCT, 20) + TEST_TYPE_ALIGN (MOUSEHOOKSTRUCT, 4) + TEST_FIELD_SIZE (MOUSEHOOKSTRUCT, pt, 8) + TEST_FIELD_ALIGN (MOUSEHOOKSTRUCT, pt, 4) + TEST_FIELD_OFFSET(MOUSEHOOKSTRUCT, pt, 0) + TEST_FIELD_SIZE (MOUSEHOOKSTRUCT, hwnd, 4) + TEST_FIELD_ALIGN (MOUSEHOOKSTRUCT, hwnd, 4) + TEST_FIELD_OFFSET(MOUSEHOOKSTRUCT, hwnd, 8) + TEST_FIELD_SIZE (MOUSEHOOKSTRUCT, wHitTestCode, 4) + TEST_FIELD_ALIGN (MOUSEHOOKSTRUCT, wHitTestCode, 4) + TEST_FIELD_OFFSET(MOUSEHOOKSTRUCT, wHitTestCode, 12) + TEST_FIELD_SIZE (MOUSEHOOKSTRUCT, dwExtraInfo, 4) + TEST_FIELD_ALIGN (MOUSEHOOKSTRUCT, dwExtraInfo, 4) + TEST_FIELD_OFFSET(MOUSEHOOKSTRUCT, dwExtraInfo, 16) +} + +static void test_pack_MOUSEINPUT(void) +{ + /* MOUSEINPUT (pack 4) */ + TEST_TYPE_SIZE (MOUSEINPUT, 24) + TEST_TYPE_ALIGN (MOUSEINPUT, 4) + TEST_FIELD_SIZE (MOUSEINPUT, dx, 4) + TEST_FIELD_ALIGN (MOUSEINPUT, dx, 4) + TEST_FIELD_OFFSET(MOUSEINPUT, dx, 0) + TEST_FIELD_SIZE (MOUSEINPUT, dy, 4) + TEST_FIELD_ALIGN (MOUSEINPUT, dy, 4) + TEST_FIELD_OFFSET(MOUSEINPUT, dy, 4) + TEST_FIELD_SIZE (MOUSEINPUT, mouseData, 4) + TEST_FIELD_ALIGN (MOUSEINPUT, mouseData, 4) + TEST_FIELD_OFFSET(MOUSEINPUT, mouseData, 8) + TEST_FIELD_SIZE (MOUSEINPUT, dwFlags, 4) + TEST_FIELD_ALIGN (MOUSEINPUT, dwFlags, 4) + TEST_FIELD_OFFSET(MOUSEINPUT, dwFlags, 12) + TEST_FIELD_SIZE (MOUSEINPUT, time, 4) + TEST_FIELD_ALIGN (MOUSEINPUT, time, 4) + TEST_FIELD_OFFSET(MOUSEINPUT, time, 16) + TEST_FIELD_SIZE (MOUSEINPUT, dwExtraInfo, 4) + TEST_FIELD_ALIGN (MOUSEINPUT, dwExtraInfo, 4) + TEST_FIELD_OFFSET(MOUSEINPUT, dwExtraInfo, 20) +} + +static void test_pack_MOUSEKEYS(void) +{ + /* MOUSEKEYS (pack 4) */ + TEST_TYPE_SIZE (MOUSEKEYS, 28) + TEST_TYPE_ALIGN (MOUSEKEYS, 4) + TEST_FIELD_SIZE (MOUSEKEYS, cbSize, 4) + TEST_FIELD_ALIGN (MOUSEKEYS, cbSize, 4) + TEST_FIELD_OFFSET(MOUSEKEYS, cbSize, 0) + TEST_FIELD_SIZE (MOUSEKEYS, dwFlags, 4) + TEST_FIELD_ALIGN (MOUSEKEYS, dwFlags, 4) + TEST_FIELD_OFFSET(MOUSEKEYS, dwFlags, 4) + TEST_FIELD_SIZE (MOUSEKEYS, iMaxSpeed, 4) + TEST_FIELD_ALIGN (MOUSEKEYS, iMaxSpeed, 4) + TEST_FIELD_OFFSET(MOUSEKEYS, iMaxSpeed, 8) + TEST_FIELD_SIZE (MOUSEKEYS, iTimeToMaxSpeed, 4) + TEST_FIELD_ALIGN (MOUSEKEYS, iTimeToMaxSpeed, 4) + TEST_FIELD_OFFSET(MOUSEKEYS, iTimeToMaxSpeed, 12) + TEST_FIELD_SIZE (MOUSEKEYS, iCtrlSpeed, 4) + TEST_FIELD_ALIGN (MOUSEKEYS, iCtrlSpeed, 4) + TEST_FIELD_OFFSET(MOUSEKEYS, iCtrlSpeed, 16) + TEST_FIELD_SIZE (MOUSEKEYS, dwReserved1, 4) + TEST_FIELD_ALIGN (MOUSEKEYS, dwReserved1, 4) + TEST_FIELD_OFFSET(MOUSEKEYS, dwReserved1, 20) + TEST_FIELD_SIZE (MOUSEKEYS, dwReserved2, 4) + TEST_FIELD_ALIGN (MOUSEKEYS, dwReserved2, 4) + TEST_FIELD_OFFSET(MOUSEKEYS, dwReserved2, 24) +} + +static void test_pack_MSG(void) +{ + /* MSG (pack 4) */ + TEST_TYPE_SIZE (MSG, 28) + TEST_TYPE_ALIGN (MSG, 4) + TEST_FIELD_SIZE (MSG, hwnd, 4) + TEST_FIELD_ALIGN (MSG, hwnd, 4) + TEST_FIELD_OFFSET(MSG, hwnd, 0) + TEST_FIELD_SIZE (MSG, message, 4) + TEST_FIELD_ALIGN (MSG, message, 4) + TEST_FIELD_OFFSET(MSG, message, 4) + TEST_FIELD_SIZE (MSG, wParam, 4) + TEST_FIELD_ALIGN (MSG, wParam, 4) + TEST_FIELD_OFFSET(MSG, wParam, 8) + TEST_FIELD_SIZE (MSG, lParam, 4) + TEST_FIELD_ALIGN (MSG, lParam, 4) + TEST_FIELD_OFFSET(MSG, lParam, 12) + TEST_FIELD_SIZE (MSG, time, 4) + TEST_FIELD_ALIGN (MSG, time, 4) + TEST_FIELD_OFFSET(MSG, time, 16) + TEST_FIELD_SIZE (MSG, pt, 8) + TEST_FIELD_ALIGN (MSG, pt, 4) + TEST_FIELD_OFFSET(MSG, pt, 20) +} + +static void test_pack_MSGBOXCALLBACK(void) +{ + /* MSGBOXCALLBACK */ + TEST_TYPE_SIZE (MSGBOXCALLBACK, 4) + TEST_TYPE_ALIGN (MSGBOXCALLBACK, 4) +} + +static void test_pack_MSGBOXPARAMSA(void) +{ + /* MSGBOXPARAMSA (pack 4) */ + TEST_TYPE_SIZE (MSGBOXPARAMSA, 40) + TEST_TYPE_ALIGN (MSGBOXPARAMSA, 4) + TEST_FIELD_SIZE (MSGBOXPARAMSA, cbSize, 4) + TEST_FIELD_ALIGN (MSGBOXPARAMSA, cbSize, 4) + TEST_FIELD_OFFSET(MSGBOXPARAMSA, cbSize, 0) + TEST_FIELD_SIZE (MSGBOXPARAMSA, hwndOwner, 4) + TEST_FIELD_ALIGN (MSGBOXPARAMSA, hwndOwner, 4) + TEST_FIELD_OFFSET(MSGBOXPARAMSA, hwndOwner, 4) + TEST_FIELD_SIZE (MSGBOXPARAMSA, hInstance, 4) + TEST_FIELD_ALIGN (MSGBOXPARAMSA, hInstance, 4) + TEST_FIELD_OFFSET(MSGBOXPARAMSA, hInstance, 8) + TEST_FIELD_SIZE (MSGBOXPARAMSA, lpszText, 4) + TEST_FIELD_ALIGN (MSGBOXPARAMSA, lpszText, 4) + TEST_FIELD_OFFSET(MSGBOXPARAMSA, lpszText, 12) + TEST_FIELD_SIZE (MSGBOXPARAMSA, lpszCaption, 4) + TEST_FIELD_ALIGN (MSGBOXPARAMSA, lpszCaption, 4) + TEST_FIELD_OFFSET(MSGBOXPARAMSA, lpszCaption, 16) + TEST_FIELD_SIZE (MSGBOXPARAMSA, dwStyle, 4) + TEST_FIELD_ALIGN (MSGBOXPARAMSA, dwStyle, 4) + TEST_FIELD_OFFSET(MSGBOXPARAMSA, dwStyle, 20) + TEST_FIELD_SIZE (MSGBOXPARAMSA, lpszIcon, 4) + TEST_FIELD_ALIGN (MSGBOXPARAMSA, lpszIcon, 4) + TEST_FIELD_OFFSET(MSGBOXPARAMSA, lpszIcon, 24) + TEST_FIELD_SIZE (MSGBOXPARAMSA, dwContextHelpId, 4) + TEST_FIELD_ALIGN (MSGBOXPARAMSA, dwContextHelpId, 4) + TEST_FIELD_OFFSET(MSGBOXPARAMSA, dwContextHelpId, 28) + TEST_FIELD_SIZE (MSGBOXPARAMSA, lpfnMsgBoxCallback, 4) + TEST_FIELD_ALIGN (MSGBOXPARAMSA, lpfnMsgBoxCallback, 4) + TEST_FIELD_OFFSET(MSGBOXPARAMSA, lpfnMsgBoxCallback, 32) + TEST_FIELD_SIZE (MSGBOXPARAMSA, dwLanguageId, 4) + TEST_FIELD_ALIGN (MSGBOXPARAMSA, dwLanguageId, 4) + TEST_FIELD_OFFSET(MSGBOXPARAMSA, dwLanguageId, 36) +} + +static void test_pack_MSGBOXPARAMSW(void) +{ + /* MSGBOXPARAMSW (pack 4) */ + TEST_TYPE_SIZE (MSGBOXPARAMSW, 40) + TEST_TYPE_ALIGN (MSGBOXPARAMSW, 4) + TEST_FIELD_SIZE (MSGBOXPARAMSW, cbSize, 4) + TEST_FIELD_ALIGN (MSGBOXPARAMSW, cbSize, 4) + TEST_FIELD_OFFSET(MSGBOXPARAMSW, cbSize, 0) + TEST_FIELD_SIZE (MSGBOXPARAMSW, hwndOwner, 4) + TEST_FIELD_ALIGN (MSGBOXPARAMSW, hwndOwner, 4) + TEST_FIELD_OFFSET(MSGBOXPARAMSW, hwndOwner, 4) + TEST_FIELD_SIZE (MSGBOXPARAMSW, hInstance, 4) + TEST_FIELD_ALIGN (MSGBOXPARAMSW, hInstance, 4) + TEST_FIELD_OFFSET(MSGBOXPARAMSW, hInstance, 8) + TEST_FIELD_SIZE (MSGBOXPARAMSW, lpszText, 4) + TEST_FIELD_ALIGN (MSGBOXPARAMSW, lpszText, 4) + TEST_FIELD_OFFSET(MSGBOXPARAMSW, lpszText, 12) + TEST_FIELD_SIZE (MSGBOXPARAMSW, lpszCaption, 4) + TEST_FIELD_ALIGN (MSGBOXPARAMSW, lpszCaption, 4) + TEST_FIELD_OFFSET(MSGBOXPARAMSW, lpszCaption, 16) + TEST_FIELD_SIZE (MSGBOXPARAMSW, dwStyle, 4) + TEST_FIELD_ALIGN (MSGBOXPARAMSW, dwStyle, 4) + TEST_FIELD_OFFSET(MSGBOXPARAMSW, dwStyle, 20) + TEST_FIELD_SIZE (MSGBOXPARAMSW, lpszIcon, 4) + TEST_FIELD_ALIGN (MSGBOXPARAMSW, lpszIcon, 4) + TEST_FIELD_OFFSET(MSGBOXPARAMSW, lpszIcon, 24) + TEST_FIELD_SIZE (MSGBOXPARAMSW, dwContextHelpId, 4) + TEST_FIELD_ALIGN (MSGBOXPARAMSW, dwContextHelpId, 4) + TEST_FIELD_OFFSET(MSGBOXPARAMSW, dwContextHelpId, 28) + TEST_FIELD_SIZE (MSGBOXPARAMSW, lpfnMsgBoxCallback, 4) + TEST_FIELD_ALIGN (MSGBOXPARAMSW, lpfnMsgBoxCallback, 4) + TEST_FIELD_OFFSET(MSGBOXPARAMSW, lpfnMsgBoxCallback, 32) + TEST_FIELD_SIZE (MSGBOXPARAMSW, dwLanguageId, 4) + TEST_FIELD_ALIGN (MSGBOXPARAMSW, dwLanguageId, 4) + TEST_FIELD_OFFSET(MSGBOXPARAMSW, dwLanguageId, 36) +} + +static void test_pack_MSLLHOOKSTRUCT(void) +{ + /* MSLLHOOKSTRUCT (pack 4) */ + TEST_TYPE_SIZE (MSLLHOOKSTRUCT, 24) + TEST_TYPE_ALIGN (MSLLHOOKSTRUCT, 4) + TEST_FIELD_SIZE (MSLLHOOKSTRUCT, pt, 8) + TEST_FIELD_ALIGN (MSLLHOOKSTRUCT, pt, 4) + TEST_FIELD_OFFSET(MSLLHOOKSTRUCT, pt, 0) + TEST_FIELD_SIZE (MSLLHOOKSTRUCT, mouseData, 4) + TEST_FIELD_ALIGN (MSLLHOOKSTRUCT, mouseData, 4) + TEST_FIELD_OFFSET(MSLLHOOKSTRUCT, mouseData, 8) + TEST_FIELD_SIZE (MSLLHOOKSTRUCT, flags, 4) + TEST_FIELD_ALIGN (MSLLHOOKSTRUCT, flags, 4) + TEST_FIELD_OFFSET(MSLLHOOKSTRUCT, flags, 12) + TEST_FIELD_SIZE (MSLLHOOKSTRUCT, time, 4) + TEST_FIELD_ALIGN (MSLLHOOKSTRUCT, time, 4) + TEST_FIELD_OFFSET(MSLLHOOKSTRUCT, time, 16) + TEST_FIELD_SIZE (MSLLHOOKSTRUCT, dwExtraInfo, 4) + TEST_FIELD_ALIGN (MSLLHOOKSTRUCT, dwExtraInfo, 4) + TEST_FIELD_OFFSET(MSLLHOOKSTRUCT, dwExtraInfo, 20) +} + +static void test_pack_MULTIKEYHELPA(void) +{ + /* MULTIKEYHELPA (pack 4) */ + TEST_TYPE_SIZE (MULTIKEYHELPA, 8) + TEST_TYPE_ALIGN (MULTIKEYHELPA, 4) + TEST_FIELD_SIZE (MULTIKEYHELPA, mkSize, 4) + TEST_FIELD_ALIGN (MULTIKEYHELPA, mkSize, 4) + TEST_FIELD_OFFSET(MULTIKEYHELPA, mkSize, 0) + TEST_FIELD_SIZE (MULTIKEYHELPA, mkKeylist, 1) + TEST_FIELD_ALIGN (MULTIKEYHELPA, mkKeylist, 1) + TEST_FIELD_OFFSET(MULTIKEYHELPA, mkKeylist, 4) + TEST_FIELD_SIZE (MULTIKEYHELPA, szKeyphrase, 1) + TEST_FIELD_ALIGN (MULTIKEYHELPA, szKeyphrase, 1) + TEST_FIELD_OFFSET(MULTIKEYHELPA, szKeyphrase, 5) +} + +static void test_pack_MULTIKEYHELPW(void) +{ + /* MULTIKEYHELPW (pack 4) */ + TEST_TYPE_SIZE (MULTIKEYHELPW, 8) + TEST_TYPE_ALIGN (MULTIKEYHELPW, 4) + TEST_FIELD_SIZE (MULTIKEYHELPW, mkSize, 4) + TEST_FIELD_ALIGN (MULTIKEYHELPW, mkSize, 4) + TEST_FIELD_OFFSET(MULTIKEYHELPW, mkSize, 0) + TEST_FIELD_SIZE (MULTIKEYHELPW, mkKeylist, 2) + TEST_FIELD_ALIGN (MULTIKEYHELPW, mkKeylist, 2) + TEST_FIELD_OFFSET(MULTIKEYHELPW, mkKeylist, 4) + TEST_FIELD_SIZE (MULTIKEYHELPW, szKeyphrase, 2) + TEST_FIELD_ALIGN (MULTIKEYHELPW, szKeyphrase, 2) + TEST_FIELD_OFFSET(MULTIKEYHELPW, szKeyphrase, 6) +} + +static void test_pack_NAMEENUMPROCA(void) +{ + /* NAMEENUMPROCA */ + TEST_TYPE_SIZE (NAMEENUMPROCA, 4) + TEST_TYPE_ALIGN (NAMEENUMPROCA, 4) +} + +static void test_pack_NAMEENUMPROCW(void) +{ + /* NAMEENUMPROCW */ + TEST_TYPE_SIZE (NAMEENUMPROCW, 4) + TEST_TYPE_ALIGN (NAMEENUMPROCW, 4) +} + +static void test_pack_NCCALCSIZE_PARAMS(void) +{ + /* NCCALCSIZE_PARAMS (pack 4) */ + TEST_TYPE_SIZE (NCCALCSIZE_PARAMS, 52) + TEST_TYPE_ALIGN (NCCALCSIZE_PARAMS, 4) + TEST_FIELD_SIZE (NCCALCSIZE_PARAMS, rgrc, 48) + TEST_FIELD_ALIGN (NCCALCSIZE_PARAMS, rgrc, 4) + TEST_FIELD_OFFSET(NCCALCSIZE_PARAMS, rgrc, 0) + TEST_FIELD_SIZE (NCCALCSIZE_PARAMS, lppos, 4) + TEST_FIELD_ALIGN (NCCALCSIZE_PARAMS, lppos, 4) + TEST_FIELD_OFFSET(NCCALCSIZE_PARAMS, lppos, 48) +} + +static void test_pack_NMHDR(void) +{ + /* NMHDR (pack 4) */ + TEST_TYPE_SIZE (NMHDR, 12) + TEST_TYPE_ALIGN (NMHDR, 4) + TEST_FIELD_SIZE (NMHDR, hwndFrom, 4) + TEST_FIELD_ALIGN (NMHDR, hwndFrom, 4) + TEST_FIELD_OFFSET(NMHDR, hwndFrom, 0) + TEST_FIELD_SIZE (NMHDR, idFrom, 4) + TEST_FIELD_ALIGN (NMHDR, idFrom, 4) + TEST_FIELD_OFFSET(NMHDR, idFrom, 4) + TEST_FIELD_SIZE (NMHDR, code, 4) + TEST_FIELD_ALIGN (NMHDR, code, 4) + TEST_FIELD_OFFSET(NMHDR, code, 8) +} + +static void test_pack_NONCLIENTMETRICSA(void) +{ + /* NONCLIENTMETRICSA (pack 4) */ + TEST_TYPE_SIZE (NONCLIENTMETRICSA, 340) + TEST_TYPE_ALIGN (NONCLIENTMETRICSA, 4) + TEST_FIELD_SIZE (NONCLIENTMETRICSA, cbSize, 4) + TEST_FIELD_ALIGN (NONCLIENTMETRICSA, cbSize, 4) + TEST_FIELD_OFFSET(NONCLIENTMETRICSA, cbSize, 0) + TEST_FIELD_SIZE (NONCLIENTMETRICSA, iBorderWidth, 4) + TEST_FIELD_ALIGN (NONCLIENTMETRICSA, iBorderWidth, 4) + TEST_FIELD_OFFSET(NONCLIENTMETRICSA, iBorderWidth, 4) + TEST_FIELD_SIZE (NONCLIENTMETRICSA, iScrollWidth, 4) + TEST_FIELD_ALIGN (NONCLIENTMETRICSA, iScrollWidth, 4) + TEST_FIELD_OFFSET(NONCLIENTMETRICSA, iScrollWidth, 8) + TEST_FIELD_SIZE (NONCLIENTMETRICSA, iScrollHeight, 4) + TEST_FIELD_ALIGN (NONCLIENTMETRICSA, iScrollHeight, 4) + TEST_FIELD_OFFSET(NONCLIENTMETRICSA, iScrollHeight, 12) + TEST_FIELD_SIZE (NONCLIENTMETRICSA, iCaptionWidth, 4) + TEST_FIELD_ALIGN (NONCLIENTMETRICSA, iCaptionWidth, 4) + TEST_FIELD_OFFSET(NONCLIENTMETRICSA, iCaptionWidth, 16) + TEST_FIELD_SIZE (NONCLIENTMETRICSA, iCaptionHeight, 4) + TEST_FIELD_ALIGN (NONCLIENTMETRICSA, iCaptionHeight, 4) + TEST_FIELD_OFFSET(NONCLIENTMETRICSA, iCaptionHeight, 20) + TEST_FIELD_SIZE (NONCLIENTMETRICSA, lfCaptionFont, 60) + TEST_FIELD_ALIGN (NONCLIENTMETRICSA, lfCaptionFont, 4) + TEST_FIELD_OFFSET(NONCLIENTMETRICSA, lfCaptionFont, 24) + TEST_FIELD_SIZE (NONCLIENTMETRICSA, iSmCaptionWidth, 4) + TEST_FIELD_ALIGN (NONCLIENTMETRICSA, iSmCaptionWidth, 4) + TEST_FIELD_OFFSET(NONCLIENTMETRICSA, iSmCaptionWidth, 84) + TEST_FIELD_SIZE (NONCLIENTMETRICSA, iSmCaptionHeight, 4) + TEST_FIELD_ALIGN (NONCLIENTMETRICSA, iSmCaptionHeight, 4) + TEST_FIELD_OFFSET(NONCLIENTMETRICSA, iSmCaptionHeight, 88) + TEST_FIELD_SIZE (NONCLIENTMETRICSA, lfSmCaptionFont, 60) + TEST_FIELD_ALIGN (NONCLIENTMETRICSA, lfSmCaptionFont, 4) + TEST_FIELD_OFFSET(NONCLIENTMETRICSA, lfSmCaptionFont, 92) + TEST_FIELD_SIZE (NONCLIENTMETRICSA, iMenuWidth, 4) + TEST_FIELD_ALIGN (NONCLIENTMETRICSA, iMenuWidth, 4) + TEST_FIELD_OFFSET(NONCLIENTMETRICSA, iMenuWidth, 152) + TEST_FIELD_SIZE (NONCLIENTMETRICSA, iMenuHeight, 4) + TEST_FIELD_ALIGN (NONCLIENTMETRICSA, iMenuHeight, 4) + TEST_FIELD_OFFSET(NONCLIENTMETRICSA, iMenuHeight, 156) + TEST_FIELD_SIZE (NONCLIENTMETRICSA, lfMenuFont, 60) + TEST_FIELD_ALIGN (NONCLIENTMETRICSA, lfMenuFont, 4) + TEST_FIELD_OFFSET(NONCLIENTMETRICSA, lfMenuFont, 160) + TEST_FIELD_SIZE (NONCLIENTMETRICSA, lfStatusFont, 60) + TEST_FIELD_ALIGN (NONCLIENTMETRICSA, lfStatusFont, 4) + TEST_FIELD_OFFSET(NONCLIENTMETRICSA, lfStatusFont, 220) + TEST_FIELD_SIZE (NONCLIENTMETRICSA, lfMessageFont, 60) + TEST_FIELD_ALIGN (NONCLIENTMETRICSA, lfMessageFont, 4) + TEST_FIELD_OFFSET(NONCLIENTMETRICSA, lfMessageFont, 280) +} + +static void test_pack_NONCLIENTMETRICSW(void) +{ + /* NONCLIENTMETRICSW (pack 4) */ + TEST_TYPE_SIZE (NONCLIENTMETRICSW, 500) + TEST_TYPE_ALIGN (NONCLIENTMETRICSW, 4) + TEST_FIELD_SIZE (NONCLIENTMETRICSW, cbSize, 4) + TEST_FIELD_ALIGN (NONCLIENTMETRICSW, cbSize, 4) + TEST_FIELD_OFFSET(NONCLIENTMETRICSW, cbSize, 0) + TEST_FIELD_SIZE (NONCLIENTMETRICSW, iBorderWidth, 4) + TEST_FIELD_ALIGN (NONCLIENTMETRICSW, iBorderWidth, 4) + TEST_FIELD_OFFSET(NONCLIENTMETRICSW, iBorderWidth, 4) + TEST_FIELD_SIZE (NONCLIENTMETRICSW, iScrollWidth, 4) + TEST_FIELD_ALIGN (NONCLIENTMETRICSW, iScrollWidth, 4) + TEST_FIELD_OFFSET(NONCLIENTMETRICSW, iScrollWidth, 8) + TEST_FIELD_SIZE (NONCLIENTMETRICSW, iScrollHeight, 4) + TEST_FIELD_ALIGN (NONCLIENTMETRICSW, iScrollHeight, 4) + TEST_FIELD_OFFSET(NONCLIENTMETRICSW, iScrollHeight, 12) + TEST_FIELD_SIZE (NONCLIENTMETRICSW, iCaptionWidth, 4) + TEST_FIELD_ALIGN (NONCLIENTMETRICSW, iCaptionWidth, 4) + TEST_FIELD_OFFSET(NONCLIENTMETRICSW, iCaptionWidth, 16) + TEST_FIELD_SIZE (NONCLIENTMETRICSW, iCaptionHeight, 4) + TEST_FIELD_ALIGN (NONCLIENTMETRICSW, iCaptionHeight, 4) + TEST_FIELD_OFFSET(NONCLIENTMETRICSW, iCaptionHeight, 20) + TEST_FIELD_SIZE (NONCLIENTMETRICSW, lfCaptionFont, 92) + TEST_FIELD_ALIGN (NONCLIENTMETRICSW, lfCaptionFont, 4) + TEST_FIELD_OFFSET(NONCLIENTMETRICSW, lfCaptionFont, 24) + TEST_FIELD_SIZE (NONCLIENTMETRICSW, iSmCaptionWidth, 4) + TEST_FIELD_ALIGN (NONCLIENTMETRICSW, iSmCaptionWidth, 4) + TEST_FIELD_OFFSET(NONCLIENTMETRICSW, iSmCaptionWidth, 116) + TEST_FIELD_SIZE (NONCLIENTMETRICSW, iSmCaptionHeight, 4) + TEST_FIELD_ALIGN (NONCLIENTMETRICSW, iSmCaptionHeight, 4) + TEST_FIELD_OFFSET(NONCLIENTMETRICSW, iSmCaptionHeight, 120) + TEST_FIELD_SIZE (NONCLIENTMETRICSW, lfSmCaptionFont, 92) + TEST_FIELD_ALIGN (NONCLIENTMETRICSW, lfSmCaptionFont, 4) + TEST_FIELD_OFFSET(NONCLIENTMETRICSW, lfSmCaptionFont, 124) + TEST_FIELD_SIZE (NONCLIENTMETRICSW, iMenuWidth, 4) + TEST_FIELD_ALIGN (NONCLIENTMETRICSW, iMenuWidth, 4) + TEST_FIELD_OFFSET(NONCLIENTMETRICSW, iMenuWidth, 216) + TEST_FIELD_SIZE (NONCLIENTMETRICSW, iMenuHeight, 4) + TEST_FIELD_ALIGN (NONCLIENTMETRICSW, iMenuHeight, 4) + TEST_FIELD_OFFSET(NONCLIENTMETRICSW, iMenuHeight, 220) + TEST_FIELD_SIZE (NONCLIENTMETRICSW, lfMenuFont, 92) + TEST_FIELD_ALIGN (NONCLIENTMETRICSW, lfMenuFont, 4) + TEST_FIELD_OFFSET(NONCLIENTMETRICSW, lfMenuFont, 224) + TEST_FIELD_SIZE (NONCLIENTMETRICSW, lfStatusFont, 92) + TEST_FIELD_ALIGN (NONCLIENTMETRICSW, lfStatusFont, 4) + TEST_FIELD_OFFSET(NONCLIENTMETRICSW, lfStatusFont, 316) + TEST_FIELD_SIZE (NONCLIENTMETRICSW, lfMessageFont, 92) + TEST_FIELD_ALIGN (NONCLIENTMETRICSW, lfMessageFont, 4) + TEST_FIELD_OFFSET(NONCLIENTMETRICSW, lfMessageFont, 408) +} + +static void test_pack_PAINTSTRUCT(void) +{ + /* PAINTSTRUCT (pack 4) */ + TEST_TYPE_SIZE (PAINTSTRUCT, 64) + TEST_TYPE_ALIGN (PAINTSTRUCT, 4) + TEST_FIELD_SIZE (PAINTSTRUCT, hdc, 4) + TEST_FIELD_ALIGN (PAINTSTRUCT, hdc, 4) + TEST_FIELD_OFFSET(PAINTSTRUCT, hdc, 0) + TEST_FIELD_SIZE (PAINTSTRUCT, fErase, 4) + TEST_FIELD_ALIGN (PAINTSTRUCT, fErase, 4) + TEST_FIELD_OFFSET(PAINTSTRUCT, fErase, 4) + TEST_FIELD_SIZE (PAINTSTRUCT, rcPaint, 16) + TEST_FIELD_ALIGN (PAINTSTRUCT, rcPaint, 4) + TEST_FIELD_OFFSET(PAINTSTRUCT, rcPaint, 8) + TEST_FIELD_SIZE (PAINTSTRUCT, fRestore, 4) + TEST_FIELD_ALIGN (PAINTSTRUCT, fRestore, 4) + TEST_FIELD_OFFSET(PAINTSTRUCT, fRestore, 24) + TEST_FIELD_SIZE (PAINTSTRUCT, fIncUpdate, 4) + TEST_FIELD_ALIGN (PAINTSTRUCT, fIncUpdate, 4) + TEST_FIELD_OFFSET(PAINTSTRUCT, fIncUpdate, 28) + TEST_FIELD_SIZE (PAINTSTRUCT, rgbReserved, 32) + TEST_FIELD_ALIGN (PAINTSTRUCT, rgbReserved, 1) + TEST_FIELD_OFFSET(PAINTSTRUCT, rgbReserved, 32) +} + +static void test_pack_PCOMBOBOXINFO(void) +{ + /* PCOMBOBOXINFO */ + TEST_TYPE_SIZE (PCOMBOBOXINFO, 4) + TEST_TYPE_ALIGN (PCOMBOBOXINFO, 4) + TEST_TARGET_SIZE (PCOMBOBOXINFO, 52) + TEST_TARGET_ALIGN(PCOMBOBOXINFO, 4) +} + +static void test_pack_PCOMPAREITEMSTRUCT(void) +{ + /* PCOMPAREITEMSTRUCT */ + TEST_TYPE_SIZE (PCOMPAREITEMSTRUCT, 4) + TEST_TYPE_ALIGN (PCOMPAREITEMSTRUCT, 4) + TEST_TARGET_SIZE (PCOMPAREITEMSTRUCT, 32) + TEST_TARGET_ALIGN(PCOMPAREITEMSTRUCT, 4) +} + +static void test_pack_PCOPYDATASTRUCT(void) +{ + /* PCOPYDATASTRUCT */ + TEST_TYPE_SIZE (PCOPYDATASTRUCT, 4) + TEST_TYPE_ALIGN (PCOPYDATASTRUCT, 4) + TEST_TARGET_SIZE (PCOPYDATASTRUCT, 12) + TEST_TARGET_ALIGN(PCOPYDATASTRUCT, 4) +} + +static void test_pack_PCURSORINFO(void) +{ + /* PCURSORINFO */ + TEST_TYPE_SIZE (PCURSORINFO, 4) + TEST_TYPE_ALIGN (PCURSORINFO, 4) + TEST_TARGET_SIZE (PCURSORINFO, 20) + TEST_TARGET_ALIGN(PCURSORINFO, 4) +} + +static void test_pack_PCWPRETSTRUCT(void) +{ + /* PCWPRETSTRUCT */ + TEST_TYPE_SIZE (PCWPRETSTRUCT, 4) + TEST_TYPE_ALIGN (PCWPRETSTRUCT, 4) + TEST_TARGET_SIZE (PCWPRETSTRUCT, 20) + TEST_TARGET_ALIGN(PCWPRETSTRUCT, 4) +} + +static void test_pack_PCWPSTRUCT(void) +{ + /* PCWPSTRUCT */ + TEST_TYPE_SIZE (PCWPSTRUCT, 4) + TEST_TYPE_ALIGN (PCWPSTRUCT, 4) + TEST_TARGET_SIZE (PCWPSTRUCT, 16) + TEST_TARGET_ALIGN(PCWPSTRUCT, 4) +} + +static void test_pack_PDEBUGHOOKINFO(void) +{ + /* PDEBUGHOOKINFO */ + TEST_TYPE_SIZE (PDEBUGHOOKINFO, 4) + TEST_TYPE_ALIGN (PDEBUGHOOKINFO, 4) + TEST_TARGET_SIZE (PDEBUGHOOKINFO, 20) + TEST_TARGET_ALIGN(PDEBUGHOOKINFO, 4) +} + +static void test_pack_PDELETEITEMSTRUCT(void) +{ + /* PDELETEITEMSTRUCT */ + TEST_TYPE_SIZE (PDELETEITEMSTRUCT, 4) + TEST_TYPE_ALIGN (PDELETEITEMSTRUCT, 4) + TEST_TARGET_SIZE (PDELETEITEMSTRUCT, 20) + TEST_TARGET_ALIGN(PDELETEITEMSTRUCT, 4) +} + +static void test_pack_PDLGITEMTEMPLATEA(void) +{ + /* PDLGITEMTEMPLATEA */ + TEST_TYPE_SIZE (PDLGITEMTEMPLATEA, 4) + TEST_TYPE_ALIGN (PDLGITEMTEMPLATEA, 4) + TEST_TARGET_SIZE (PDLGITEMTEMPLATEA, 18) + TEST_TARGET_ALIGN(PDLGITEMTEMPLATEA, 2) +} + +static void test_pack_PDLGITEMTEMPLATEW(void) +{ + /* PDLGITEMTEMPLATEW */ + TEST_TYPE_SIZE (PDLGITEMTEMPLATEW, 4) + TEST_TYPE_ALIGN (PDLGITEMTEMPLATEW, 4) + TEST_TARGET_SIZE (PDLGITEMTEMPLATEW, 18) + TEST_TARGET_ALIGN(PDLGITEMTEMPLATEW, 2) +} + +static void test_pack_PDRAWITEMSTRUCT(void) +{ + /* PDRAWITEMSTRUCT */ + TEST_TYPE_SIZE (PDRAWITEMSTRUCT, 4) + TEST_TYPE_ALIGN (PDRAWITEMSTRUCT, 4) + TEST_TARGET_SIZE (PDRAWITEMSTRUCT, 48) + TEST_TARGET_ALIGN(PDRAWITEMSTRUCT, 4) +} + +static void test_pack_PEVENTMSG(void) +{ + /* PEVENTMSG */ + TEST_TYPE_SIZE (PEVENTMSG, 4) + TEST_TYPE_ALIGN (PEVENTMSG, 4) + TEST_TARGET_SIZE (PEVENTMSG, 20) + TEST_TARGET_ALIGN(PEVENTMSG, 4) +} + +static void test_pack_PFLASHWINFO(void) +{ + /* PFLASHWINFO */ + TEST_TYPE_SIZE (PFLASHWINFO, 4) + TEST_TYPE_ALIGN (PFLASHWINFO, 4) + TEST_TARGET_SIZE (PFLASHWINFO, 20) + TEST_TARGET_ALIGN(PFLASHWINFO, 4) +} + +static void test_pack_PGUITHREADINFO(void) +{ + /* PGUITHREADINFO */ + TEST_TYPE_SIZE (PGUITHREADINFO, 4) + TEST_TYPE_ALIGN (PGUITHREADINFO, 4) + TEST_TARGET_SIZE (PGUITHREADINFO, 48) + TEST_TARGET_ALIGN(PGUITHREADINFO, 4) +} + +static void test_pack_PHARDWAREHOOKSTRUCT(void) +{ + /* PHARDWAREHOOKSTRUCT */ + TEST_TYPE_SIZE (PHARDWAREHOOKSTRUCT, 4) + TEST_TYPE_ALIGN (PHARDWAREHOOKSTRUCT, 4) + TEST_TARGET_SIZE (PHARDWAREHOOKSTRUCT, 16) + TEST_TARGET_ALIGN(PHARDWAREHOOKSTRUCT, 4) +} + +static void test_pack_PHARDWAREINPUT(void) +{ + /* PHARDWAREINPUT */ + TEST_TYPE_SIZE (PHARDWAREINPUT, 4) + TEST_TYPE_ALIGN (PHARDWAREINPUT, 4) + TEST_TARGET_SIZE (PHARDWAREINPUT, 8) + TEST_TARGET_ALIGN(PHARDWAREINPUT, 4) +} + +static void test_pack_PHDEVNOTIFY(void) +{ + /* PHDEVNOTIFY */ + TEST_TYPE_SIZE (PHDEVNOTIFY, 4) + TEST_TYPE_ALIGN (PHDEVNOTIFY, 4) + TEST_TARGET_SIZE (PHDEVNOTIFY, 4) + TEST_TARGET_ALIGN(PHDEVNOTIFY, 4) +} + +static void test_pack_PHELPWININFOA(void) +{ + /* PHELPWININFOA */ + TEST_TYPE_SIZE (PHELPWININFOA, 4) + TEST_TYPE_ALIGN (PHELPWININFOA, 4) + TEST_TARGET_SIZE (PHELPWININFOA, 28) + TEST_TARGET_ALIGN(PHELPWININFOA, 4) +} + +static void test_pack_PHELPWININFOW(void) +{ + /* PHELPWININFOW */ + TEST_TYPE_SIZE (PHELPWININFOW, 4) + TEST_TYPE_ALIGN (PHELPWININFOW, 4) + TEST_TARGET_SIZE (PHELPWININFOW, 28) + TEST_TARGET_ALIGN(PHELPWININFOW, 4) +} + +static void test_pack_PICONINFO(void) +{ + /* PICONINFO */ + TEST_TYPE_SIZE (PICONINFO, 4) + TEST_TYPE_ALIGN (PICONINFO, 4) + TEST_TARGET_SIZE (PICONINFO, 20) + TEST_TARGET_ALIGN(PICONINFO, 4) +} + +static void test_pack_PICONMETRICSA(void) +{ + /* PICONMETRICSA */ + TEST_TYPE_SIZE (PICONMETRICSA, 4) + TEST_TYPE_ALIGN (PICONMETRICSA, 4) + TEST_TARGET_SIZE (PICONMETRICSA, 76) + TEST_TARGET_ALIGN(PICONMETRICSA, 4) +} + +static void test_pack_PICONMETRICSW(void) +{ + /* PICONMETRICSW */ + TEST_TYPE_SIZE (PICONMETRICSW, 4) + TEST_TYPE_ALIGN (PICONMETRICSW, 4) + TEST_TARGET_SIZE (PICONMETRICSW, 108) + TEST_TARGET_ALIGN(PICONMETRICSW, 4) +} + +static void test_pack_PINPUT(void) +{ + /* PINPUT */ + TEST_TYPE_SIZE (PINPUT, 4) + TEST_TYPE_ALIGN (PINPUT, 4) +} + +static void test_pack_PKBDLLHOOKSTRUCT(void) +{ + /* PKBDLLHOOKSTRUCT */ + TEST_TYPE_SIZE (PKBDLLHOOKSTRUCT, 4) + TEST_TYPE_ALIGN (PKBDLLHOOKSTRUCT, 4) + TEST_TARGET_SIZE (PKBDLLHOOKSTRUCT, 20) + TEST_TARGET_ALIGN(PKBDLLHOOKSTRUCT, 4) +} + +static void test_pack_PKEYBDINPUT(void) +{ + /* PKEYBDINPUT */ + TEST_TYPE_SIZE (PKEYBDINPUT, 4) + TEST_TYPE_ALIGN (PKEYBDINPUT, 4) + TEST_TARGET_SIZE (PKEYBDINPUT, 16) + TEST_TARGET_ALIGN(PKEYBDINPUT, 4) +} + +static void test_pack_PMDINEXTMENU(void) +{ + /* PMDINEXTMENU */ + TEST_TYPE_SIZE (PMDINEXTMENU, 4) + TEST_TYPE_ALIGN (PMDINEXTMENU, 4) + TEST_TARGET_SIZE (PMDINEXTMENU, 12) + TEST_TARGET_ALIGN(PMDINEXTMENU, 4) +} + +static void test_pack_PMEASUREITEMSTRUCT(void) +{ + /* PMEASUREITEMSTRUCT */ + TEST_TYPE_SIZE (PMEASUREITEMSTRUCT, 4) + TEST_TYPE_ALIGN (PMEASUREITEMSTRUCT, 4) + TEST_TARGET_SIZE (PMEASUREITEMSTRUCT, 24) + TEST_TARGET_ALIGN(PMEASUREITEMSTRUCT, 4) +} + +static void test_pack_PMENUITEMTEMPLATE(void) +{ + /* PMENUITEMTEMPLATE */ + TEST_TYPE_SIZE (PMENUITEMTEMPLATE, 4) + TEST_TYPE_ALIGN (PMENUITEMTEMPLATE, 4) + TEST_TARGET_SIZE (PMENUITEMTEMPLATE, 6) + TEST_TARGET_ALIGN(PMENUITEMTEMPLATE, 2) +} + +static void test_pack_PMENUITEMTEMPLATEHEADER(void) +{ + /* PMENUITEMTEMPLATEHEADER */ + TEST_TYPE_SIZE (PMENUITEMTEMPLATEHEADER, 4) + TEST_TYPE_ALIGN (PMENUITEMTEMPLATEHEADER, 4) + TEST_TARGET_SIZE (PMENUITEMTEMPLATEHEADER, 4) + TEST_TARGET_ALIGN(PMENUITEMTEMPLATEHEADER, 2) +} + +static void test_pack_PMINIMIZEDMETRICS(void) +{ + /* PMINIMIZEDMETRICS */ + TEST_TYPE_SIZE (PMINIMIZEDMETRICS, 4) + TEST_TYPE_ALIGN (PMINIMIZEDMETRICS, 4) + TEST_TARGET_SIZE (PMINIMIZEDMETRICS, 20) + TEST_TARGET_ALIGN(PMINIMIZEDMETRICS, 4) +} + +static void test_pack_PMINMAXINFO(void) +{ + /* PMINMAXINFO */ + TEST_TYPE_SIZE (PMINMAXINFO, 4) + TEST_TYPE_ALIGN (PMINMAXINFO, 4) + TEST_TARGET_SIZE (PMINMAXINFO, 40) + TEST_TARGET_ALIGN(PMINMAXINFO, 4) +} + +static void test_pack_PMOUSEHOOKSTRUCT(void) +{ + /* PMOUSEHOOKSTRUCT */ + TEST_TYPE_SIZE (PMOUSEHOOKSTRUCT, 4) + TEST_TYPE_ALIGN (PMOUSEHOOKSTRUCT, 4) + TEST_TARGET_SIZE (PMOUSEHOOKSTRUCT, 20) + TEST_TARGET_ALIGN(PMOUSEHOOKSTRUCT, 4) +} + +static void test_pack_PMOUSEINPUT(void) +{ + /* PMOUSEINPUT */ + TEST_TYPE_SIZE (PMOUSEINPUT, 4) + TEST_TYPE_ALIGN (PMOUSEINPUT, 4) + TEST_TARGET_SIZE (PMOUSEINPUT, 24) + TEST_TARGET_ALIGN(PMOUSEINPUT, 4) +} + +static void test_pack_PMSG(void) +{ + /* PMSG */ + TEST_TYPE_SIZE (PMSG, 4) + TEST_TYPE_ALIGN (PMSG, 4) + TEST_TARGET_SIZE (PMSG, 28) + TEST_TARGET_ALIGN(PMSG, 4) +} + +static void test_pack_PMSGBOXPARAMSA(void) +{ + /* PMSGBOXPARAMSA */ + TEST_TYPE_SIZE (PMSGBOXPARAMSA, 4) + TEST_TYPE_ALIGN (PMSGBOXPARAMSA, 4) + TEST_TARGET_SIZE (PMSGBOXPARAMSA, 40) + TEST_TARGET_ALIGN(PMSGBOXPARAMSA, 4) +} + +static void test_pack_PMSGBOXPARAMSW(void) +{ + /* PMSGBOXPARAMSW */ + TEST_TYPE_SIZE (PMSGBOXPARAMSW, 4) + TEST_TYPE_ALIGN (PMSGBOXPARAMSW, 4) + TEST_TARGET_SIZE (PMSGBOXPARAMSW, 40) + TEST_TARGET_ALIGN(PMSGBOXPARAMSW, 4) +} + +static void test_pack_PMSLLHOOKSTRUCT(void) +{ + /* PMSLLHOOKSTRUCT */ + TEST_TYPE_SIZE (PMSLLHOOKSTRUCT, 4) + TEST_TYPE_ALIGN (PMSLLHOOKSTRUCT, 4) + TEST_TARGET_SIZE (PMSLLHOOKSTRUCT, 24) + TEST_TARGET_ALIGN(PMSLLHOOKSTRUCT, 4) +} + +static void test_pack_PMULTIKEYHELPA(void) +{ + /* PMULTIKEYHELPA */ + TEST_TYPE_SIZE (PMULTIKEYHELPA, 4) + TEST_TYPE_ALIGN (PMULTIKEYHELPA, 4) + TEST_TARGET_SIZE (PMULTIKEYHELPA, 8) + TEST_TARGET_ALIGN(PMULTIKEYHELPA, 4) +} + +static void test_pack_PMULTIKEYHELPW(void) +{ + /* PMULTIKEYHELPW */ + TEST_TYPE_SIZE (PMULTIKEYHELPW, 4) + TEST_TYPE_ALIGN (PMULTIKEYHELPW, 4) + TEST_TARGET_SIZE (PMULTIKEYHELPW, 8) + TEST_TARGET_ALIGN(PMULTIKEYHELPW, 4) +} + +static void test_pack_PNONCLIENTMETRICSA(void) +{ + /* PNONCLIENTMETRICSA */ + TEST_TYPE_SIZE (PNONCLIENTMETRICSA, 4) + TEST_TYPE_ALIGN (PNONCLIENTMETRICSA, 4) + TEST_TARGET_SIZE (PNONCLIENTMETRICSA, 340) + TEST_TARGET_ALIGN(PNONCLIENTMETRICSA, 4) +} + +static void test_pack_PNONCLIENTMETRICSW(void) +{ + /* PNONCLIENTMETRICSW */ + TEST_TYPE_SIZE (PNONCLIENTMETRICSW, 4) + TEST_TYPE_ALIGN (PNONCLIENTMETRICSW, 4) + TEST_TARGET_SIZE (PNONCLIENTMETRICSW, 500) + TEST_TARGET_ALIGN(PNONCLIENTMETRICSW, 4) +} + +static void test_pack_PPAINTSTRUCT(void) +{ + /* PPAINTSTRUCT */ + TEST_TYPE_SIZE (PPAINTSTRUCT, 4) + TEST_TYPE_ALIGN (PPAINTSTRUCT, 4) + TEST_TARGET_SIZE (PPAINTSTRUCT, 64) + TEST_TARGET_ALIGN(PPAINTSTRUCT, 4) +} + +static void test_pack_PROPENUMPROCA(void) +{ + /* PROPENUMPROCA */ + TEST_TYPE_SIZE (PROPENUMPROCA, 4) + TEST_TYPE_ALIGN (PROPENUMPROCA, 4) +} + +static void test_pack_PROPENUMPROCEXA(void) +{ + /* PROPENUMPROCEXA */ + TEST_TYPE_SIZE (PROPENUMPROCEXA, 4) + TEST_TYPE_ALIGN (PROPENUMPROCEXA, 4) +} + +static void test_pack_PROPENUMPROCEXW(void) +{ + /* PROPENUMPROCEXW */ + TEST_TYPE_SIZE (PROPENUMPROCEXW, 4) + TEST_TYPE_ALIGN (PROPENUMPROCEXW, 4) +} + +static void test_pack_PROPENUMPROCW(void) +{ + /* PROPENUMPROCW */ + TEST_TYPE_SIZE (PROPENUMPROCW, 4) + TEST_TYPE_ALIGN (PROPENUMPROCW, 4) +} + +static void test_pack_PTITLEBARINFO(void) +{ + /* PTITLEBARINFO */ + TEST_TYPE_SIZE (PTITLEBARINFO, 4) + TEST_TYPE_ALIGN (PTITLEBARINFO, 4) + TEST_TARGET_SIZE (PTITLEBARINFO, 44) + TEST_TARGET_ALIGN(PTITLEBARINFO, 4) +} + +static void test_pack_PUSEROBJECTFLAGS(void) +{ + /* PUSEROBJECTFLAGS */ + TEST_TYPE_SIZE (PUSEROBJECTFLAGS, 4) + TEST_TYPE_ALIGN (PUSEROBJECTFLAGS, 4) + TEST_TARGET_SIZE (PUSEROBJECTFLAGS, 12) + TEST_TARGET_ALIGN(PUSEROBJECTFLAGS, 4) +} + +static void test_pack_PWINDOWINFO(void) +{ + /* PWINDOWINFO */ + TEST_TYPE_SIZE (PWINDOWINFO, 4) + TEST_TYPE_ALIGN (PWINDOWINFO, 4) + TEST_TARGET_SIZE (PWINDOWINFO, 60) + TEST_TARGET_ALIGN(PWINDOWINFO, 4) +} + +static void test_pack_PWINDOWPLACEMENT(void) +{ + /* PWINDOWPLACEMENT */ + TEST_TYPE_SIZE (PWINDOWPLACEMENT, 4) + TEST_TYPE_ALIGN (PWINDOWPLACEMENT, 4) + TEST_TARGET_SIZE (PWINDOWPLACEMENT, 44) + TEST_TARGET_ALIGN(PWINDOWPLACEMENT, 4) +} + +static void test_pack_PWINDOWPOS(void) +{ + /* PWINDOWPOS */ + TEST_TYPE_SIZE (PWINDOWPOS, 4) + TEST_TYPE_ALIGN (PWINDOWPOS, 4) + TEST_TARGET_SIZE (PWINDOWPOS, 28) + TEST_TARGET_ALIGN(PWINDOWPOS, 4) +} + +static void test_pack_PWNDCLASSA(void) +{ + /* PWNDCLASSA */ + TEST_TYPE_SIZE (PWNDCLASSA, 4) + TEST_TYPE_ALIGN (PWNDCLASSA, 4) + TEST_TARGET_SIZE (PWNDCLASSA, 40) + TEST_TARGET_ALIGN(PWNDCLASSA, 4) +} + +static void test_pack_PWNDCLASSEXA(void) +{ + /* PWNDCLASSEXA */ + TEST_TYPE_SIZE (PWNDCLASSEXA, 4) + TEST_TYPE_ALIGN (PWNDCLASSEXA, 4) + TEST_TARGET_SIZE (PWNDCLASSEXA, 48) + TEST_TARGET_ALIGN(PWNDCLASSEXA, 4) +} + +static void test_pack_PWNDCLASSEXW(void) +{ + /* PWNDCLASSEXW */ + TEST_TYPE_SIZE (PWNDCLASSEXW, 4) + TEST_TYPE_ALIGN (PWNDCLASSEXW, 4) + TEST_TARGET_SIZE (PWNDCLASSEXW, 48) + TEST_TARGET_ALIGN(PWNDCLASSEXW, 4) +} + +static void test_pack_PWNDCLASSW(void) +{ + /* PWNDCLASSW */ + TEST_TYPE_SIZE (PWNDCLASSW, 4) + TEST_TYPE_ALIGN (PWNDCLASSW, 4) + TEST_TARGET_SIZE (PWNDCLASSW, 40) + TEST_TARGET_ALIGN(PWNDCLASSW, 4) +} + +static void test_pack_SCROLLINFO(void) +{ + /* SCROLLINFO (pack 4) */ + TEST_TYPE_SIZE (SCROLLINFO, 28) + TEST_TYPE_ALIGN (SCROLLINFO, 4) + TEST_FIELD_SIZE (SCROLLINFO, cbSize, 4) + TEST_FIELD_ALIGN (SCROLLINFO, cbSize, 4) + TEST_FIELD_OFFSET(SCROLLINFO, cbSize, 0) + TEST_FIELD_SIZE (SCROLLINFO, fMask, 4) + TEST_FIELD_ALIGN (SCROLLINFO, fMask, 4) + TEST_FIELD_OFFSET(SCROLLINFO, fMask, 4) + TEST_FIELD_SIZE (SCROLLINFO, nMin, 4) + TEST_FIELD_ALIGN (SCROLLINFO, nMin, 4) + TEST_FIELD_OFFSET(SCROLLINFO, nMin, 8) + TEST_FIELD_SIZE (SCROLLINFO, nMax, 4) + TEST_FIELD_ALIGN (SCROLLINFO, nMax, 4) + TEST_FIELD_OFFSET(SCROLLINFO, nMax, 12) + TEST_FIELD_SIZE (SCROLLINFO, nPage, 4) + TEST_FIELD_ALIGN (SCROLLINFO, nPage, 4) + TEST_FIELD_OFFSET(SCROLLINFO, nPage, 16) + TEST_FIELD_SIZE (SCROLLINFO, nPos, 4) + TEST_FIELD_ALIGN (SCROLLINFO, nPos, 4) + TEST_FIELD_OFFSET(SCROLLINFO, nPos, 20) + TEST_FIELD_SIZE (SCROLLINFO, nTrackPos, 4) + TEST_FIELD_ALIGN (SCROLLINFO, nTrackPos, 4) + TEST_FIELD_OFFSET(SCROLLINFO, nTrackPos, 24) +} + +static void test_pack_SENDASYNCPROC(void) +{ + /* SENDASYNCPROC */ + TEST_TYPE_SIZE (SENDASYNCPROC, 4) + TEST_TYPE_ALIGN (SENDASYNCPROC, 4) +} + +static void test_pack_SERIALKEYSA(void) +{ + /* SERIALKEYSA (pack 4) */ + TEST_TYPE_SIZE (SERIALKEYSA, 28) + TEST_TYPE_ALIGN (SERIALKEYSA, 4) + TEST_FIELD_SIZE (SERIALKEYSA, cbSize, 4) + TEST_FIELD_ALIGN (SERIALKEYSA, cbSize, 4) + TEST_FIELD_OFFSET(SERIALKEYSA, cbSize, 0) + TEST_FIELD_SIZE (SERIALKEYSA, dwFlags, 4) + TEST_FIELD_ALIGN (SERIALKEYSA, dwFlags, 4) + TEST_FIELD_OFFSET(SERIALKEYSA, dwFlags, 4) + TEST_FIELD_SIZE (SERIALKEYSA, lpszActivePort, 4) + TEST_FIELD_ALIGN (SERIALKEYSA, lpszActivePort, 4) + TEST_FIELD_OFFSET(SERIALKEYSA, lpszActivePort, 8) + TEST_FIELD_SIZE (SERIALKEYSA, lpszPort, 4) + TEST_FIELD_ALIGN (SERIALKEYSA, lpszPort, 4) + TEST_FIELD_OFFSET(SERIALKEYSA, lpszPort, 12) + TEST_FIELD_SIZE (SERIALKEYSA, iBaudRate, 4) + TEST_FIELD_ALIGN (SERIALKEYSA, iBaudRate, 4) + TEST_FIELD_OFFSET(SERIALKEYSA, iBaudRate, 16) + TEST_FIELD_SIZE (SERIALKEYSA, iPortState, 4) + TEST_FIELD_ALIGN (SERIALKEYSA, iPortState, 4) + TEST_FIELD_OFFSET(SERIALKEYSA, iPortState, 20) + TEST_FIELD_SIZE (SERIALKEYSA, iActive, 4) + TEST_FIELD_ALIGN (SERIALKEYSA, iActive, 4) + TEST_FIELD_OFFSET(SERIALKEYSA, iActive, 24) +} + +static void test_pack_SERIALKEYSW(void) +{ + /* SERIALKEYSW (pack 4) */ + TEST_TYPE_SIZE (SERIALKEYSW, 28) + TEST_TYPE_ALIGN (SERIALKEYSW, 4) + TEST_FIELD_SIZE (SERIALKEYSW, cbSize, 4) + TEST_FIELD_ALIGN (SERIALKEYSW, cbSize, 4) + TEST_FIELD_OFFSET(SERIALKEYSW, cbSize, 0) + TEST_FIELD_SIZE (SERIALKEYSW, dwFlags, 4) + TEST_FIELD_ALIGN (SERIALKEYSW, dwFlags, 4) + TEST_FIELD_OFFSET(SERIALKEYSW, dwFlags, 4) + TEST_FIELD_SIZE (SERIALKEYSW, lpszActivePort, 4) + TEST_FIELD_ALIGN (SERIALKEYSW, lpszActivePort, 4) + TEST_FIELD_OFFSET(SERIALKEYSW, lpszActivePort, 8) + TEST_FIELD_SIZE (SERIALKEYSW, lpszPort, 4) + TEST_FIELD_ALIGN (SERIALKEYSW, lpszPort, 4) + TEST_FIELD_OFFSET(SERIALKEYSW, lpszPort, 12) + TEST_FIELD_SIZE (SERIALKEYSW, iBaudRate, 4) + TEST_FIELD_ALIGN (SERIALKEYSW, iBaudRate, 4) + TEST_FIELD_OFFSET(SERIALKEYSW, iBaudRate, 16) + TEST_FIELD_SIZE (SERIALKEYSW, iPortState, 4) + TEST_FIELD_ALIGN (SERIALKEYSW, iPortState, 4) + TEST_FIELD_OFFSET(SERIALKEYSW, iPortState, 20) + TEST_FIELD_SIZE (SERIALKEYSW, iActive, 4) + TEST_FIELD_ALIGN (SERIALKEYSW, iActive, 4) + TEST_FIELD_OFFSET(SERIALKEYSW, iActive, 24) +} + +static void test_pack_SOUNDSENTRYA(void) +{ + /* SOUNDSENTRYA (pack 4) */ + TEST_TYPE_SIZE (SOUNDSENTRYA, 48) + TEST_TYPE_ALIGN (SOUNDSENTRYA, 4) + TEST_FIELD_SIZE (SOUNDSENTRYA, cbSize, 4) + TEST_FIELD_ALIGN (SOUNDSENTRYA, cbSize, 4) + TEST_FIELD_OFFSET(SOUNDSENTRYA, cbSize, 0) + TEST_FIELD_SIZE (SOUNDSENTRYA, dwFlags, 4) + TEST_FIELD_ALIGN (SOUNDSENTRYA, dwFlags, 4) + TEST_FIELD_OFFSET(SOUNDSENTRYA, dwFlags, 4) + TEST_FIELD_SIZE (SOUNDSENTRYA, iFSTextEffect, 4) + TEST_FIELD_ALIGN (SOUNDSENTRYA, iFSTextEffect, 4) + TEST_FIELD_OFFSET(SOUNDSENTRYA, iFSTextEffect, 8) + TEST_FIELD_SIZE (SOUNDSENTRYA, iFSTextEffectMSec, 4) + TEST_FIELD_ALIGN (SOUNDSENTRYA, iFSTextEffectMSec, 4) + TEST_FIELD_OFFSET(SOUNDSENTRYA, iFSTextEffectMSec, 12) + TEST_FIELD_SIZE (SOUNDSENTRYA, iFSTextEffectColorBits, 4) + TEST_FIELD_ALIGN (SOUNDSENTRYA, iFSTextEffectColorBits, 4) + TEST_FIELD_OFFSET(SOUNDSENTRYA, iFSTextEffectColorBits, 16) + TEST_FIELD_SIZE (SOUNDSENTRYA, iFSGrafEffect, 4) + TEST_FIELD_ALIGN (SOUNDSENTRYA, iFSGrafEffect, 4) + TEST_FIELD_OFFSET(SOUNDSENTRYA, iFSGrafEffect, 20) + TEST_FIELD_SIZE (SOUNDSENTRYA, iFSGrafEffectMSec, 4) + TEST_FIELD_ALIGN (SOUNDSENTRYA, iFSGrafEffectMSec, 4) + TEST_FIELD_OFFSET(SOUNDSENTRYA, iFSGrafEffectMSec, 24) + TEST_FIELD_SIZE (SOUNDSENTRYA, iFSGrafEffectColor, 4) + TEST_FIELD_ALIGN (SOUNDSENTRYA, iFSGrafEffectColor, 4) + TEST_FIELD_OFFSET(SOUNDSENTRYA, iFSGrafEffectColor, 28) + TEST_FIELD_SIZE (SOUNDSENTRYA, iWindowsEffect, 4) + TEST_FIELD_ALIGN (SOUNDSENTRYA, iWindowsEffect, 4) + TEST_FIELD_OFFSET(SOUNDSENTRYA, iWindowsEffect, 32) + TEST_FIELD_SIZE (SOUNDSENTRYA, iWindowsEffectMSec, 4) + TEST_FIELD_ALIGN (SOUNDSENTRYA, iWindowsEffectMSec, 4) + TEST_FIELD_OFFSET(SOUNDSENTRYA, iWindowsEffectMSec, 36) + TEST_FIELD_SIZE (SOUNDSENTRYA, lpszWindowsEffectDLL, 4) + TEST_FIELD_ALIGN (SOUNDSENTRYA, lpszWindowsEffectDLL, 4) + TEST_FIELD_OFFSET(SOUNDSENTRYA, lpszWindowsEffectDLL, 40) + TEST_FIELD_SIZE (SOUNDSENTRYA, iWindowsEffectOrdinal, 4) + TEST_FIELD_ALIGN (SOUNDSENTRYA, iWindowsEffectOrdinal, 4) + TEST_FIELD_OFFSET(SOUNDSENTRYA, iWindowsEffectOrdinal, 44) +} + +static void test_pack_SOUNDSENTRYW(void) +{ + /* SOUNDSENTRYW (pack 4) */ + TEST_TYPE_SIZE (SOUNDSENTRYW, 48) + TEST_TYPE_ALIGN (SOUNDSENTRYW, 4) + TEST_FIELD_SIZE (SOUNDSENTRYW, cbSize, 4) + TEST_FIELD_ALIGN (SOUNDSENTRYW, cbSize, 4) + TEST_FIELD_OFFSET(SOUNDSENTRYW, cbSize, 0) + TEST_FIELD_SIZE (SOUNDSENTRYW, dwFlags, 4) + TEST_FIELD_ALIGN (SOUNDSENTRYW, dwFlags, 4) + TEST_FIELD_OFFSET(SOUNDSENTRYW, dwFlags, 4) + TEST_FIELD_SIZE (SOUNDSENTRYW, iFSTextEffect, 4) + TEST_FIELD_ALIGN (SOUNDSENTRYW, iFSTextEffect, 4) + TEST_FIELD_OFFSET(SOUNDSENTRYW, iFSTextEffect, 8) + TEST_FIELD_SIZE (SOUNDSENTRYW, iFSTextEffectMSec, 4) + TEST_FIELD_ALIGN (SOUNDSENTRYW, iFSTextEffectMSec, 4) + TEST_FIELD_OFFSET(SOUNDSENTRYW, iFSTextEffectMSec, 12) + TEST_FIELD_SIZE (SOUNDSENTRYW, iFSTextEffectColorBits, 4) + TEST_FIELD_ALIGN (SOUNDSENTRYW, iFSTextEffectColorBits, 4) + TEST_FIELD_OFFSET(SOUNDSENTRYW, iFSTextEffectColorBits, 16) + TEST_FIELD_SIZE (SOUNDSENTRYW, iFSGrafEffect, 4) + TEST_FIELD_ALIGN (SOUNDSENTRYW, iFSGrafEffect, 4) + TEST_FIELD_OFFSET(SOUNDSENTRYW, iFSGrafEffect, 20) + TEST_FIELD_SIZE (SOUNDSENTRYW, iFSGrafEffectMSec, 4) + TEST_FIELD_ALIGN (SOUNDSENTRYW, iFSGrafEffectMSec, 4) + TEST_FIELD_OFFSET(SOUNDSENTRYW, iFSGrafEffectMSec, 24) + TEST_FIELD_SIZE (SOUNDSENTRYW, iFSGrafEffectColor, 4) + TEST_FIELD_ALIGN (SOUNDSENTRYW, iFSGrafEffectColor, 4) + TEST_FIELD_OFFSET(SOUNDSENTRYW, iFSGrafEffectColor, 28) + TEST_FIELD_SIZE (SOUNDSENTRYW, iWindowsEffect, 4) + TEST_FIELD_ALIGN (SOUNDSENTRYW, iWindowsEffect, 4) + TEST_FIELD_OFFSET(SOUNDSENTRYW, iWindowsEffect, 32) + TEST_FIELD_SIZE (SOUNDSENTRYW, iWindowsEffectMSec, 4) + TEST_FIELD_ALIGN (SOUNDSENTRYW, iWindowsEffectMSec, 4) + TEST_FIELD_OFFSET(SOUNDSENTRYW, iWindowsEffectMSec, 36) + TEST_FIELD_SIZE (SOUNDSENTRYW, lpszWindowsEffectDLL, 4) + TEST_FIELD_ALIGN (SOUNDSENTRYW, lpszWindowsEffectDLL, 4) + TEST_FIELD_OFFSET(SOUNDSENTRYW, lpszWindowsEffectDLL, 40) + TEST_FIELD_SIZE (SOUNDSENTRYW, iWindowsEffectOrdinal, 4) + TEST_FIELD_ALIGN (SOUNDSENTRYW, iWindowsEffectOrdinal, 4) + TEST_FIELD_OFFSET(SOUNDSENTRYW, iWindowsEffectOrdinal, 44) +} + +static void test_pack_STICKYKEYS(void) +{ + /* STICKYKEYS (pack 4) */ + TEST_TYPE_SIZE (STICKYKEYS, 8) + TEST_TYPE_ALIGN (STICKYKEYS, 4) + TEST_FIELD_SIZE (STICKYKEYS, cbSize, 4) + TEST_FIELD_ALIGN (STICKYKEYS, cbSize, 4) + TEST_FIELD_OFFSET(STICKYKEYS, cbSize, 0) + TEST_FIELD_SIZE (STICKYKEYS, dwFlags, 4) + TEST_FIELD_ALIGN (STICKYKEYS, dwFlags, 4) + TEST_FIELD_OFFSET(STICKYKEYS, dwFlags, 4) +} + +static void test_pack_STYLESTRUCT(void) +{ + /* STYLESTRUCT (pack 4) */ + TEST_TYPE_SIZE (STYLESTRUCT, 8) + TEST_TYPE_ALIGN (STYLESTRUCT, 4) + TEST_FIELD_SIZE (STYLESTRUCT, styleOld, 4) + TEST_FIELD_ALIGN (STYLESTRUCT, styleOld, 4) + TEST_FIELD_OFFSET(STYLESTRUCT, styleOld, 0) + TEST_FIELD_SIZE (STYLESTRUCT, styleNew, 4) + TEST_FIELD_ALIGN (STYLESTRUCT, styleNew, 4) + TEST_FIELD_OFFSET(STYLESTRUCT, styleNew, 4) +} + +static void test_pack_TIMERPROC(void) +{ + /* TIMERPROC */ + TEST_TYPE_SIZE (TIMERPROC, 4) + TEST_TYPE_ALIGN (TIMERPROC, 4) +} + +static void test_pack_TITLEBARINFO(void) +{ + /* TITLEBARINFO (pack 4) */ + TEST_TYPE_SIZE (TITLEBARINFO, 44) + TEST_TYPE_ALIGN (TITLEBARINFO, 4) + TEST_FIELD_SIZE (TITLEBARINFO, cbSize, 4) + TEST_FIELD_ALIGN (TITLEBARINFO, cbSize, 4) + TEST_FIELD_OFFSET(TITLEBARINFO, cbSize, 0) + TEST_FIELD_SIZE (TITLEBARINFO, rcTitleBar, 16) + TEST_FIELD_ALIGN (TITLEBARINFO, rcTitleBar, 4) + TEST_FIELD_OFFSET(TITLEBARINFO, rcTitleBar, 4) + TEST_FIELD_SIZE (TITLEBARINFO, rgstate, 24) + TEST_FIELD_ALIGN (TITLEBARINFO, rgstate, 4) + TEST_FIELD_OFFSET(TITLEBARINFO, rgstate, 20) +} + +static void test_pack_TOGGLEKEYS(void) +{ + /* TOGGLEKEYS (pack 4) */ + TEST_TYPE_SIZE (TOGGLEKEYS, 8) + TEST_TYPE_ALIGN (TOGGLEKEYS, 4) + TEST_FIELD_SIZE (TOGGLEKEYS, cbSize, 4) + TEST_FIELD_ALIGN (TOGGLEKEYS, cbSize, 4) + TEST_FIELD_OFFSET(TOGGLEKEYS, cbSize, 0) + TEST_FIELD_SIZE (TOGGLEKEYS, dwFlags, 4) + TEST_FIELD_ALIGN (TOGGLEKEYS, dwFlags, 4) + TEST_FIELD_OFFSET(TOGGLEKEYS, dwFlags, 4) +} + +static void test_pack_TPMPARAMS(void) +{ + /* TPMPARAMS (pack 4) */ + TEST_TYPE_SIZE (TPMPARAMS, 20) + TEST_TYPE_ALIGN (TPMPARAMS, 4) + TEST_FIELD_SIZE (TPMPARAMS, cbSize, 4) + TEST_FIELD_ALIGN (TPMPARAMS, cbSize, 4) + TEST_FIELD_OFFSET(TPMPARAMS, cbSize, 0) + TEST_FIELD_SIZE (TPMPARAMS, rcExclude, 16) + TEST_FIELD_ALIGN (TPMPARAMS, rcExclude, 4) + TEST_FIELD_OFFSET(TPMPARAMS, rcExclude, 4) +} + +static void test_pack_TRACKMOUSEEVENT(void) +{ + /* TRACKMOUSEEVENT (pack 4) */ + TEST_TYPE_SIZE (TRACKMOUSEEVENT, 16) + TEST_TYPE_ALIGN (TRACKMOUSEEVENT, 4) + TEST_FIELD_SIZE (TRACKMOUSEEVENT, cbSize, 4) + TEST_FIELD_ALIGN (TRACKMOUSEEVENT, cbSize, 4) + TEST_FIELD_OFFSET(TRACKMOUSEEVENT, cbSize, 0) + TEST_FIELD_SIZE (TRACKMOUSEEVENT, dwFlags, 4) + TEST_FIELD_ALIGN (TRACKMOUSEEVENT, dwFlags, 4) + TEST_FIELD_OFFSET(TRACKMOUSEEVENT, dwFlags, 4) + TEST_FIELD_SIZE (TRACKMOUSEEVENT, hwndTrack, 4) + TEST_FIELD_ALIGN (TRACKMOUSEEVENT, hwndTrack, 4) + TEST_FIELD_OFFSET(TRACKMOUSEEVENT, hwndTrack, 8) + TEST_FIELD_SIZE (TRACKMOUSEEVENT, dwHoverTime, 4) + TEST_FIELD_ALIGN (TRACKMOUSEEVENT, dwHoverTime, 4) + TEST_FIELD_OFFSET(TRACKMOUSEEVENT, dwHoverTime, 12) +} + +static void test_pack_USEROBJECTFLAGS(void) +{ + /* USEROBJECTFLAGS (pack 4) */ + TEST_TYPE_SIZE (USEROBJECTFLAGS, 12) + TEST_TYPE_ALIGN (USEROBJECTFLAGS, 4) + TEST_FIELD_SIZE (USEROBJECTFLAGS, fInherit, 4) + TEST_FIELD_ALIGN (USEROBJECTFLAGS, fInherit, 4) + TEST_FIELD_OFFSET(USEROBJECTFLAGS, fInherit, 0) + TEST_FIELD_SIZE (USEROBJECTFLAGS, fReserved, 4) + TEST_FIELD_ALIGN (USEROBJECTFLAGS, fReserved, 4) + TEST_FIELD_OFFSET(USEROBJECTFLAGS, fReserved, 4) + TEST_FIELD_SIZE (USEROBJECTFLAGS, dwFlags, 4) + TEST_FIELD_ALIGN (USEROBJECTFLAGS, dwFlags, 4) + TEST_FIELD_OFFSET(USEROBJECTFLAGS, dwFlags, 8) +} + +static void test_pack_WINDOWINFO(void) +{ + /* WINDOWINFO (pack 4) */ + TEST_TYPE_SIZE (WINDOWINFO, 60) + TEST_TYPE_ALIGN (WINDOWINFO, 4) + TEST_FIELD_SIZE (WINDOWINFO, cbSize, 4) + TEST_FIELD_ALIGN (WINDOWINFO, cbSize, 4) + TEST_FIELD_OFFSET(WINDOWINFO, cbSize, 0) + TEST_FIELD_SIZE (WINDOWINFO, rcWindow, 16) + TEST_FIELD_ALIGN (WINDOWINFO, rcWindow, 4) + TEST_FIELD_OFFSET(WINDOWINFO, rcWindow, 4) + TEST_FIELD_SIZE (WINDOWINFO, rcClient, 16) + TEST_FIELD_ALIGN (WINDOWINFO, rcClient, 4) + TEST_FIELD_OFFSET(WINDOWINFO, rcClient, 20) + TEST_FIELD_SIZE (WINDOWINFO, dwStyle, 4) + TEST_FIELD_ALIGN (WINDOWINFO, dwStyle, 4) + TEST_FIELD_OFFSET(WINDOWINFO, dwStyle, 36) + TEST_FIELD_SIZE (WINDOWINFO, dwExStyle, 4) + TEST_FIELD_ALIGN (WINDOWINFO, dwExStyle, 4) + TEST_FIELD_OFFSET(WINDOWINFO, dwExStyle, 40) + TEST_FIELD_SIZE (WINDOWINFO, dwWindowStatus, 4) + TEST_FIELD_ALIGN (WINDOWINFO, dwWindowStatus, 4) + TEST_FIELD_OFFSET(WINDOWINFO, dwWindowStatus, 44) + TEST_FIELD_SIZE (WINDOWINFO, cxWindowBorders, 4) + TEST_FIELD_ALIGN (WINDOWINFO, cxWindowBorders, 4) + TEST_FIELD_OFFSET(WINDOWINFO, cxWindowBorders, 48) + TEST_FIELD_SIZE (WINDOWINFO, cyWindowBorders, 4) + TEST_FIELD_ALIGN (WINDOWINFO, cyWindowBorders, 4) + TEST_FIELD_OFFSET(WINDOWINFO, cyWindowBorders, 52) + TEST_FIELD_SIZE (WINDOWINFO, atomWindowType, 2) + TEST_FIELD_ALIGN (WINDOWINFO, atomWindowType, 2) + TEST_FIELD_OFFSET(WINDOWINFO, atomWindowType, 56) + TEST_FIELD_SIZE (WINDOWINFO, wCreatorVersion, 2) + TEST_FIELD_ALIGN (WINDOWINFO, wCreatorVersion, 2) + TEST_FIELD_OFFSET(WINDOWINFO, wCreatorVersion, 58) +} + +static void test_pack_WINDOWPLACEMENT(void) +{ + /* WINDOWPLACEMENT (pack 4) */ + TEST_TYPE_SIZE (WINDOWPLACEMENT, 44) + TEST_TYPE_ALIGN (WINDOWPLACEMENT, 4) + TEST_FIELD_SIZE (WINDOWPLACEMENT, length, 4) + TEST_FIELD_ALIGN (WINDOWPLACEMENT, length, 4) + TEST_FIELD_OFFSET(WINDOWPLACEMENT, length, 0) + TEST_FIELD_SIZE (WINDOWPLACEMENT, flags, 4) + TEST_FIELD_ALIGN (WINDOWPLACEMENT, flags, 4) + TEST_FIELD_OFFSET(WINDOWPLACEMENT, flags, 4) + TEST_FIELD_SIZE (WINDOWPLACEMENT, showCmd, 4) + TEST_FIELD_ALIGN (WINDOWPLACEMENT, showCmd, 4) + TEST_FIELD_OFFSET(WINDOWPLACEMENT, showCmd, 8) + TEST_FIELD_SIZE (WINDOWPLACEMENT, ptMinPosition, 8) + TEST_FIELD_ALIGN (WINDOWPLACEMENT, ptMinPosition, 4) + TEST_FIELD_OFFSET(WINDOWPLACEMENT, ptMinPosition, 12) + TEST_FIELD_SIZE (WINDOWPLACEMENT, ptMaxPosition, 8) + TEST_FIELD_ALIGN (WINDOWPLACEMENT, ptMaxPosition, 4) + TEST_FIELD_OFFSET(WINDOWPLACEMENT, ptMaxPosition, 20) + TEST_FIELD_SIZE (WINDOWPLACEMENT, rcNormalPosition, 16) + TEST_FIELD_ALIGN (WINDOWPLACEMENT, rcNormalPosition, 4) + TEST_FIELD_OFFSET(WINDOWPLACEMENT, rcNormalPosition, 28) +} + +static void test_pack_WINDOWPOS(void) +{ + /* WINDOWPOS (pack 4) */ + TEST_TYPE_SIZE (WINDOWPOS, 28) + TEST_TYPE_ALIGN (WINDOWPOS, 4) + TEST_FIELD_SIZE (WINDOWPOS, hwnd, 4) + TEST_FIELD_ALIGN (WINDOWPOS, hwnd, 4) + TEST_FIELD_OFFSET(WINDOWPOS, hwnd, 0) + TEST_FIELD_SIZE (WINDOWPOS, hwndInsertAfter, 4) + TEST_FIELD_ALIGN (WINDOWPOS, hwndInsertAfter, 4) + TEST_FIELD_OFFSET(WINDOWPOS, hwndInsertAfter, 4) + TEST_FIELD_SIZE (WINDOWPOS, x, 4) + TEST_FIELD_ALIGN (WINDOWPOS, x, 4) + TEST_FIELD_OFFSET(WINDOWPOS, x, 8) + TEST_FIELD_SIZE (WINDOWPOS, y, 4) + TEST_FIELD_ALIGN (WINDOWPOS, y, 4) + TEST_FIELD_OFFSET(WINDOWPOS, y, 12) + TEST_FIELD_SIZE (WINDOWPOS, cx, 4) + TEST_FIELD_ALIGN (WINDOWPOS, cx, 4) + TEST_FIELD_OFFSET(WINDOWPOS, cx, 16) + TEST_FIELD_SIZE (WINDOWPOS, cy, 4) + TEST_FIELD_ALIGN (WINDOWPOS, cy, 4) + TEST_FIELD_OFFSET(WINDOWPOS, cy, 20) + TEST_FIELD_SIZE (WINDOWPOS, flags, 4) + TEST_FIELD_ALIGN (WINDOWPOS, flags, 4) + TEST_FIELD_OFFSET(WINDOWPOS, flags, 24) +} + +static void test_pack_WINEVENTPROC(void) +{ + /* WINEVENTPROC */ + TEST_TYPE_SIZE (WINEVENTPROC, 4) + TEST_TYPE_ALIGN (WINEVENTPROC, 4) +} + +static void test_pack_WINSTAENUMPROCA(void) +{ + /* WINSTAENUMPROCA */ + TEST_TYPE_SIZE (WINSTAENUMPROCA, 4) + TEST_TYPE_ALIGN (WINSTAENUMPROCA, 4) +} + +static void test_pack_WINSTAENUMPROCW(void) +{ + /* WINSTAENUMPROCW */ + TEST_TYPE_SIZE (WINSTAENUMPROCW, 4) + TEST_TYPE_ALIGN (WINSTAENUMPROCW, 4) +} + +static void test_pack_WNDCLASSA(void) +{ + /* WNDCLASSA (pack 4) */ + TEST_TYPE_SIZE (WNDCLASSA, 40) + TEST_TYPE_ALIGN (WNDCLASSA, 4) + TEST_FIELD_SIZE (WNDCLASSA, style, 4) + TEST_FIELD_ALIGN (WNDCLASSA, style, 4) + TEST_FIELD_OFFSET(WNDCLASSA, style, 0) + TEST_FIELD_SIZE (WNDCLASSA, lpfnWndProc, 4) + TEST_FIELD_ALIGN (WNDCLASSA, lpfnWndProc, 4) + TEST_FIELD_OFFSET(WNDCLASSA, lpfnWndProc, 4) + TEST_FIELD_SIZE (WNDCLASSA, cbClsExtra, 4) + TEST_FIELD_ALIGN (WNDCLASSA, cbClsExtra, 4) + TEST_FIELD_OFFSET(WNDCLASSA, cbClsExtra, 8) + TEST_FIELD_SIZE (WNDCLASSA, cbWndExtra, 4) + TEST_FIELD_ALIGN (WNDCLASSA, cbWndExtra, 4) + TEST_FIELD_OFFSET(WNDCLASSA, cbWndExtra, 12) + TEST_FIELD_SIZE (WNDCLASSA, hInstance, 4) + TEST_FIELD_ALIGN (WNDCLASSA, hInstance, 4) + TEST_FIELD_OFFSET(WNDCLASSA, hInstance, 16) + TEST_FIELD_SIZE (WNDCLASSA, hIcon, 4) + TEST_FIELD_ALIGN (WNDCLASSA, hIcon, 4) + TEST_FIELD_OFFSET(WNDCLASSA, hIcon, 20) + TEST_FIELD_SIZE (WNDCLASSA, hCursor, 4) + TEST_FIELD_ALIGN (WNDCLASSA, hCursor, 4) + TEST_FIELD_OFFSET(WNDCLASSA, hCursor, 24) + TEST_FIELD_SIZE (WNDCLASSA, hbrBackground, 4) + TEST_FIELD_ALIGN (WNDCLASSA, hbrBackground, 4) + TEST_FIELD_OFFSET(WNDCLASSA, hbrBackground, 28) + TEST_FIELD_SIZE (WNDCLASSA, lpszMenuName, 4) + TEST_FIELD_ALIGN (WNDCLASSA, lpszMenuName, 4) + TEST_FIELD_OFFSET(WNDCLASSA, lpszMenuName, 32) + TEST_FIELD_SIZE (WNDCLASSA, lpszClassName, 4) + TEST_FIELD_ALIGN (WNDCLASSA, lpszClassName, 4) + TEST_FIELD_OFFSET(WNDCLASSA, lpszClassName, 36) +} + +static void test_pack_WNDCLASSEXA(void) +{ + /* WNDCLASSEXA (pack 4) */ + TEST_TYPE_SIZE (WNDCLASSEXA, 48) + TEST_TYPE_ALIGN (WNDCLASSEXA, 4) + TEST_FIELD_SIZE (WNDCLASSEXA, cbSize, 4) + TEST_FIELD_ALIGN (WNDCLASSEXA, cbSize, 4) + TEST_FIELD_OFFSET(WNDCLASSEXA, cbSize, 0) + TEST_FIELD_SIZE (WNDCLASSEXA, style, 4) + TEST_FIELD_ALIGN (WNDCLASSEXA, style, 4) + TEST_FIELD_OFFSET(WNDCLASSEXA, style, 4) + TEST_FIELD_SIZE (WNDCLASSEXA, lpfnWndProc, 4) + TEST_FIELD_ALIGN (WNDCLASSEXA, lpfnWndProc, 4) + TEST_FIELD_OFFSET(WNDCLASSEXA, lpfnWndProc, 8) + TEST_FIELD_SIZE (WNDCLASSEXA, cbClsExtra, 4) + TEST_FIELD_ALIGN (WNDCLASSEXA, cbClsExtra, 4) + TEST_FIELD_OFFSET(WNDCLASSEXA, cbClsExtra, 12) + TEST_FIELD_SIZE (WNDCLASSEXA, cbWndExtra, 4) + TEST_FIELD_ALIGN (WNDCLASSEXA, cbWndExtra, 4) + TEST_FIELD_OFFSET(WNDCLASSEXA, cbWndExtra, 16) + TEST_FIELD_SIZE (WNDCLASSEXA, hInstance, 4) + TEST_FIELD_ALIGN (WNDCLASSEXA, hInstance, 4) + TEST_FIELD_OFFSET(WNDCLASSEXA, hInstance, 20) + TEST_FIELD_SIZE (WNDCLASSEXA, hIcon, 4) + TEST_FIELD_ALIGN (WNDCLASSEXA, hIcon, 4) + TEST_FIELD_OFFSET(WNDCLASSEXA, hIcon, 24) + TEST_FIELD_SIZE (WNDCLASSEXA, hCursor, 4) + TEST_FIELD_ALIGN (WNDCLASSEXA, hCursor, 4) + TEST_FIELD_OFFSET(WNDCLASSEXA, hCursor, 28) + TEST_FIELD_SIZE (WNDCLASSEXA, hbrBackground, 4) + TEST_FIELD_ALIGN (WNDCLASSEXA, hbrBackground, 4) + TEST_FIELD_OFFSET(WNDCLASSEXA, hbrBackground, 32) + TEST_FIELD_SIZE (WNDCLASSEXA, lpszMenuName, 4) + TEST_FIELD_ALIGN (WNDCLASSEXA, lpszMenuName, 4) + TEST_FIELD_OFFSET(WNDCLASSEXA, lpszMenuName, 36) + TEST_FIELD_SIZE (WNDCLASSEXA, lpszClassName, 4) + TEST_FIELD_ALIGN (WNDCLASSEXA, lpszClassName, 4) + TEST_FIELD_OFFSET(WNDCLASSEXA, lpszClassName, 40) + TEST_FIELD_SIZE (WNDCLASSEXA, hIconSm, 4) + TEST_FIELD_ALIGN (WNDCLASSEXA, hIconSm, 4) + TEST_FIELD_OFFSET(WNDCLASSEXA, hIconSm, 44) +} + +static void test_pack_WNDCLASSEXW(void) +{ + /* WNDCLASSEXW (pack 4) */ + TEST_TYPE_SIZE (WNDCLASSEXW, 48) + TEST_TYPE_ALIGN (WNDCLASSEXW, 4) + TEST_FIELD_SIZE (WNDCLASSEXW, cbSize, 4) + TEST_FIELD_ALIGN (WNDCLASSEXW, cbSize, 4) + TEST_FIELD_OFFSET(WNDCLASSEXW, cbSize, 0) + TEST_FIELD_SIZE (WNDCLASSEXW, style, 4) + TEST_FIELD_ALIGN (WNDCLASSEXW, style, 4) + TEST_FIELD_OFFSET(WNDCLASSEXW, style, 4) + TEST_FIELD_SIZE (WNDCLASSEXW, lpfnWndProc, 4) + TEST_FIELD_ALIGN (WNDCLASSEXW, lpfnWndProc, 4) + TEST_FIELD_OFFSET(WNDCLASSEXW, lpfnWndProc, 8) + TEST_FIELD_SIZE (WNDCLASSEXW, cbClsExtra, 4) + TEST_FIELD_ALIGN (WNDCLASSEXW, cbClsExtra, 4) + TEST_FIELD_OFFSET(WNDCLASSEXW, cbClsExtra, 12) + TEST_FIELD_SIZE (WNDCLASSEXW, cbWndExtra, 4) + TEST_FIELD_ALIGN (WNDCLASSEXW, cbWndExtra, 4) + TEST_FIELD_OFFSET(WNDCLASSEXW, cbWndExtra, 16) + TEST_FIELD_SIZE (WNDCLASSEXW, hInstance, 4) + TEST_FIELD_ALIGN (WNDCLASSEXW, hInstance, 4) + TEST_FIELD_OFFSET(WNDCLASSEXW, hInstance, 20) + TEST_FIELD_SIZE (WNDCLASSEXW, hIcon, 4) + TEST_FIELD_ALIGN (WNDCLASSEXW, hIcon, 4) + TEST_FIELD_OFFSET(WNDCLASSEXW, hIcon, 24) + TEST_FIELD_SIZE (WNDCLASSEXW, hCursor, 4) + TEST_FIELD_ALIGN (WNDCLASSEXW, hCursor, 4) + TEST_FIELD_OFFSET(WNDCLASSEXW, hCursor, 28) + TEST_FIELD_SIZE (WNDCLASSEXW, hbrBackground, 4) + TEST_FIELD_ALIGN (WNDCLASSEXW, hbrBackground, 4) + TEST_FIELD_OFFSET(WNDCLASSEXW, hbrBackground, 32) + TEST_FIELD_SIZE (WNDCLASSEXW, lpszMenuName, 4) + TEST_FIELD_ALIGN (WNDCLASSEXW, lpszMenuName, 4) + TEST_FIELD_OFFSET(WNDCLASSEXW, lpszMenuName, 36) + TEST_FIELD_SIZE (WNDCLASSEXW, lpszClassName, 4) + TEST_FIELD_ALIGN (WNDCLASSEXW, lpszClassName, 4) + TEST_FIELD_OFFSET(WNDCLASSEXW, lpszClassName, 40) + TEST_FIELD_SIZE (WNDCLASSEXW, hIconSm, 4) + TEST_FIELD_ALIGN (WNDCLASSEXW, hIconSm, 4) + TEST_FIELD_OFFSET(WNDCLASSEXW, hIconSm, 44) +} + +static void test_pack_WNDCLASSW(void) +{ + /* WNDCLASSW (pack 4) */ + TEST_TYPE_SIZE (WNDCLASSW, 40) + TEST_TYPE_ALIGN (WNDCLASSW, 4) + TEST_FIELD_SIZE (WNDCLASSW, style, 4) + TEST_FIELD_ALIGN (WNDCLASSW, style, 4) + TEST_FIELD_OFFSET(WNDCLASSW, style, 0) + TEST_FIELD_SIZE (WNDCLASSW, lpfnWndProc, 4) + TEST_FIELD_ALIGN (WNDCLASSW, lpfnWndProc, 4) + TEST_FIELD_OFFSET(WNDCLASSW, lpfnWndProc, 4) + TEST_FIELD_SIZE (WNDCLASSW, cbClsExtra, 4) + TEST_FIELD_ALIGN (WNDCLASSW, cbClsExtra, 4) + TEST_FIELD_OFFSET(WNDCLASSW, cbClsExtra, 8) + TEST_FIELD_SIZE (WNDCLASSW, cbWndExtra, 4) + TEST_FIELD_ALIGN (WNDCLASSW, cbWndExtra, 4) + TEST_FIELD_OFFSET(WNDCLASSW, cbWndExtra, 12) + TEST_FIELD_SIZE (WNDCLASSW, hInstance, 4) + TEST_FIELD_ALIGN (WNDCLASSW, hInstance, 4) + TEST_FIELD_OFFSET(WNDCLASSW, hInstance, 16) + TEST_FIELD_SIZE (WNDCLASSW, hIcon, 4) + TEST_FIELD_ALIGN (WNDCLASSW, hIcon, 4) + TEST_FIELD_OFFSET(WNDCLASSW, hIcon, 20) + TEST_FIELD_SIZE (WNDCLASSW, hCursor, 4) + TEST_FIELD_ALIGN (WNDCLASSW, hCursor, 4) + TEST_FIELD_OFFSET(WNDCLASSW, hCursor, 24) + TEST_FIELD_SIZE (WNDCLASSW, hbrBackground, 4) + TEST_FIELD_ALIGN (WNDCLASSW, hbrBackground, 4) + TEST_FIELD_OFFSET(WNDCLASSW, hbrBackground, 28) + TEST_FIELD_SIZE (WNDCLASSW, lpszMenuName, 4) + TEST_FIELD_ALIGN (WNDCLASSW, lpszMenuName, 4) + TEST_FIELD_OFFSET(WNDCLASSW, lpszMenuName, 32) + TEST_FIELD_SIZE (WNDCLASSW, lpszClassName, 4) + TEST_FIELD_ALIGN (WNDCLASSW, lpszClassName, 4) + TEST_FIELD_OFFSET(WNDCLASSW, lpszClassName, 36) +} + +static void test_pack_WNDENUMPROC(void) +{ + /* WNDENUMPROC */ + TEST_TYPE_SIZE (WNDENUMPROC, 4) + TEST_TYPE_ALIGN (WNDENUMPROC, 4) +} + +static void test_pack_WNDPROC(void) +{ + /* WNDPROC */ + TEST_TYPE_SIZE (WNDPROC, 4) + TEST_TYPE_ALIGN (WNDPROC, 4) +} + +static void test_pack(void) +{ + test_pack_ACCESSTIMEOUT(); + test_pack_ANIMATIONINFO(); + test_pack_CBTACTIVATESTRUCT(); + test_pack_CBT_CREATEWNDA(); + test_pack_CBT_CREATEWNDW(); + test_pack_CLIENTCREATESTRUCT(); + test_pack_COMBOBOXINFO(); + test_pack_COMPAREITEMSTRUCT(); + test_pack_COPYDATASTRUCT(); + test_pack_CREATESTRUCTA(); + test_pack_CREATESTRUCTW(); + test_pack_CURSORINFO(); + test_pack_CWPRETSTRUCT(); + test_pack_CWPSTRUCT(); + test_pack_DEBUGHOOKINFO(); + test_pack_DELETEITEMSTRUCT(); + test_pack_DESKTOPENUMPROCA(); + test_pack_DESKTOPENUMPROCW(); + test_pack_DLGITEMTEMPLATE(); + test_pack_DLGPROC(); + test_pack_DLGTEMPLATE(); + test_pack_DRAWITEMSTRUCT(); + test_pack_DRAWSTATEPROC(); + test_pack_DRAWTEXTPARAMS(); + test_pack_EDITWORDBREAKPROCA(); + test_pack_EDITWORDBREAKPROCW(); + test_pack_EVENTMSG(); + test_pack_FILTERKEYS(); + test_pack_FLASHWINFO(); + test_pack_GRAYSTRINGPROC(); + test_pack_GUITHREADINFO(); + test_pack_HARDWAREHOOKSTRUCT(); + test_pack_HARDWAREINPUT(); + test_pack_HDEVNOTIFY(); + test_pack_HDWP(); + test_pack_HELPINFO(); + test_pack_HELPWININFOA(); + test_pack_HELPWININFOW(); + test_pack_HIGHCONTRASTA(); + test_pack_HIGHCONTRASTW(); + test_pack_HOOKPROC(); + test_pack_ICONINFO(); + test_pack_ICONMETRICSA(); + test_pack_ICONMETRICSW(); + test_pack_INPUT(); + test_pack_KBDLLHOOKSTRUCT(); + test_pack_KEYBDINPUT(); + test_pack_LPACCESSTIMEOUT(); + test_pack_LPANIMATIONINFO(); + test_pack_LPCBTACTIVATESTRUCT(); + test_pack_LPCBT_CREATEWNDA(); + test_pack_LPCBT_CREATEWNDW(); + test_pack_LPCDLGTEMPLATEA(); + test_pack_LPCDLGTEMPLATEW(); + test_pack_LPCLIENTCREATESTRUCT(); + test_pack_LPCMENUINFO(); + test_pack_LPCMENUITEMINFOA(); + test_pack_LPCMENUITEMINFOW(); + test_pack_LPCOMBOBOXINFO(); + test_pack_LPCOMPAREITEMSTRUCT(); + test_pack_LPCREATESTRUCTA(); + test_pack_LPCREATESTRUCTW(); + test_pack_LPCSCROLLINFO(); + test_pack_LPCURSORINFO(); + test_pack_LPCWPRETSTRUCT(); + test_pack_LPCWPSTRUCT(); + test_pack_LPDEBUGHOOKINFO(); + test_pack_LPDELETEITEMSTRUCT(); + test_pack_LPDLGITEMTEMPLATEA(); + test_pack_LPDLGITEMTEMPLATEW(); + test_pack_LPDLGTEMPLATEA(); + test_pack_LPDLGTEMPLATEW(); + test_pack_LPDRAWITEMSTRUCT(); + test_pack_LPDRAWTEXTPARAMS(); + test_pack_LPEVENTMSG(); + test_pack_LPFILTERKEYS(); + test_pack_LPGUITHREADINFO(); + test_pack_LPHARDWAREHOOKSTRUCT(); + test_pack_LPHARDWAREINPUT(); + test_pack_LPHELPINFO(); + test_pack_LPHELPWININFOA(); + test_pack_LPHELPWININFOW(); + test_pack_LPHIGHCONTRASTA(); + test_pack_LPHIGHCONTRASTW(); + test_pack_LPICONMETRICSA(); + test_pack_LPICONMETRICSW(); + test_pack_LPINPUT(); + test_pack_LPKBDLLHOOKSTRUCT(); + test_pack_LPKEYBDINPUT(); + test_pack_LPMDICREATESTRUCTA(); + test_pack_LPMDICREATESTRUCTW(); + test_pack_LPMDINEXTMENU(); + test_pack_LPMEASUREITEMSTRUCT(); + test_pack_LPMENUINFO(); + test_pack_LPMENUITEMINFOA(); + test_pack_LPMENUITEMINFOW(); + test_pack_LPMINIMIZEDMETRICS(); + test_pack_LPMINMAXINFO(); + test_pack_LPMONITORINFO(); + test_pack_LPMONITORINFOEXA(); + test_pack_LPMONITORINFOEXW(); + test_pack_LPMOUSEHOOKSTRUCT(); + test_pack_LPMOUSEINPUT(); + test_pack_LPMOUSEKEYS(); + test_pack_LPMSG(); + test_pack_LPMSGBOXPARAMSA(); + test_pack_LPMSGBOXPARAMSW(); + test_pack_LPMSLLHOOKSTRUCT(); + test_pack_LPMULTIKEYHELPA(); + test_pack_LPMULTIKEYHELPW(); + test_pack_LPNCCALCSIZE_PARAMS(); + test_pack_LPNMHDR(); + test_pack_LPNONCLIENTMETRICSA(); + test_pack_LPNONCLIENTMETRICSW(); + test_pack_LPPAINTSTRUCT(); + test_pack_LPSCROLLINFO(); + test_pack_LPSERIALKEYSA(); + test_pack_LPSERIALKEYSW(); + test_pack_LPSOUNDSENTRYA(); + test_pack_LPSOUNDSENTRYW(); + test_pack_LPSTICKYKEYS(); + test_pack_LPSTYLESTRUCT(); + test_pack_LPTITLEBARINFO(); + test_pack_LPTOGGLEKEYS(); + test_pack_LPTPMPARAMS(); + test_pack_LPTRACKMOUSEEVENT(); + test_pack_LPWINDOWINFO(); + test_pack_LPWINDOWPLACEMENT(); + test_pack_LPWINDOWPOS(); + test_pack_LPWNDCLASSA(); + test_pack_LPWNDCLASSEXA(); + test_pack_LPWNDCLASSEXW(); + test_pack_LPWNDCLASSW(); + test_pack_MDICREATESTRUCTA(); + test_pack_MDICREATESTRUCTW(); + test_pack_MDINEXTMENU(); + test_pack_MEASUREITEMSTRUCT(); + test_pack_MENUINFO(); + test_pack_MENUITEMINFOA(); + test_pack_MENUITEMINFOW(); + test_pack_MENUITEMTEMPLATE(); + test_pack_MENUITEMTEMPLATEHEADER(); + test_pack_MINIMIZEDMETRICS(); + test_pack_MINMAXINFO(); + test_pack_MONITORENUMPROC(); + test_pack_MONITORINFO(); + test_pack_MONITORINFOEXA(); + test_pack_MONITORINFOEXW(); + test_pack_MOUSEHOOKSTRUCT(); + test_pack_MOUSEINPUT(); + test_pack_MOUSEKEYS(); + test_pack_MSG(); + test_pack_MSGBOXCALLBACK(); + test_pack_MSGBOXPARAMSA(); + test_pack_MSGBOXPARAMSW(); + test_pack_MSLLHOOKSTRUCT(); + test_pack_MULTIKEYHELPA(); + test_pack_MULTIKEYHELPW(); + test_pack_NAMEENUMPROCA(); + test_pack_NAMEENUMPROCW(); + test_pack_NCCALCSIZE_PARAMS(); + test_pack_NMHDR(); + test_pack_NONCLIENTMETRICSA(); + test_pack_NONCLIENTMETRICSW(); + test_pack_PAINTSTRUCT(); + test_pack_PCOMBOBOXINFO(); + test_pack_PCOMPAREITEMSTRUCT(); + test_pack_PCOPYDATASTRUCT(); + test_pack_PCURSORINFO(); + test_pack_PCWPRETSTRUCT(); + test_pack_PCWPSTRUCT(); + test_pack_PDEBUGHOOKINFO(); + test_pack_PDELETEITEMSTRUCT(); + test_pack_PDLGITEMTEMPLATEA(); + test_pack_PDLGITEMTEMPLATEW(); + test_pack_PDRAWITEMSTRUCT(); + test_pack_PEVENTMSG(); + test_pack_PFLASHWINFO(); + test_pack_PGUITHREADINFO(); + test_pack_PHARDWAREHOOKSTRUCT(); + test_pack_PHARDWAREINPUT(); + test_pack_PHDEVNOTIFY(); + test_pack_PHELPWININFOA(); + test_pack_PHELPWININFOW(); + test_pack_PICONINFO(); + test_pack_PICONMETRICSA(); + test_pack_PICONMETRICSW(); + test_pack_PINPUT(); + test_pack_PKBDLLHOOKSTRUCT(); + test_pack_PKEYBDINPUT(); + test_pack_PMDINEXTMENU(); + test_pack_PMEASUREITEMSTRUCT(); + test_pack_PMENUITEMTEMPLATE(); + test_pack_PMENUITEMTEMPLATEHEADER(); + test_pack_PMINIMIZEDMETRICS(); + test_pack_PMINMAXINFO(); + test_pack_PMOUSEHOOKSTRUCT(); + test_pack_PMOUSEINPUT(); + test_pack_PMSG(); + test_pack_PMSGBOXPARAMSA(); + test_pack_PMSGBOXPARAMSW(); + test_pack_PMSLLHOOKSTRUCT(); + test_pack_PMULTIKEYHELPA(); + test_pack_PMULTIKEYHELPW(); + test_pack_PNONCLIENTMETRICSA(); + test_pack_PNONCLIENTMETRICSW(); + test_pack_PPAINTSTRUCT(); + test_pack_PROPENUMPROCA(); + test_pack_PROPENUMPROCEXA(); + test_pack_PROPENUMPROCEXW(); + test_pack_PROPENUMPROCW(); + test_pack_PTITLEBARINFO(); + test_pack_PUSEROBJECTFLAGS(); + test_pack_PWINDOWINFO(); + test_pack_PWINDOWPLACEMENT(); + test_pack_PWINDOWPOS(); + test_pack_PWNDCLASSA(); + test_pack_PWNDCLASSEXA(); + test_pack_PWNDCLASSEXW(); + test_pack_PWNDCLASSW(); + test_pack_SCROLLINFO(); + test_pack_SENDASYNCPROC(); + test_pack_SERIALKEYSA(); + test_pack_SERIALKEYSW(); + test_pack_SOUNDSENTRYA(); + test_pack_SOUNDSENTRYW(); + test_pack_STICKYKEYS(); + test_pack_STYLESTRUCT(); + test_pack_TIMERPROC(); + test_pack_TITLEBARINFO(); + test_pack_TOGGLEKEYS(); + test_pack_TPMPARAMS(); + test_pack_TRACKMOUSEEVENT(); + test_pack_USEROBJECTFLAGS(); + test_pack_WINDOWINFO(); + test_pack_WINDOWPLACEMENT(); + test_pack_WINDOWPOS(); + test_pack_WINEVENTPROC(); + test_pack_WINSTAENUMPROCA(); + test_pack_WINSTAENUMPROCW(); + test_pack_WNDCLASSA(); + test_pack_WNDCLASSEXA(); + test_pack_WNDCLASSEXW(); + test_pack_WNDCLASSW(); + test_pack_WNDENUMPROC(); + test_pack_WNDPROC(); +} + +START_TEST(generated) +{ +#ifdef _WIN64 + ok(0, "The type size / alignment tests don't support Win64 yet\n"); +#else + test_pack(); +#endif +} diff --git a/dlls/user32/tests/menu.c b/dlls/user32/tests/menu.c index c0a5f025ae0..a00678b85a4 100644 --- a/dlls/user32/tests/menu.c +++ b/dlls/user32/tests/menu.c @@ -293,7 +293,7 @@ static void test_menu_ownerdraw(void) for( j=0;j<2;j++) /* create columns */ for(i=0;i<2;i++) { /* create rows */ ret = AppendMenu( hmenu, MF_OWNERDRAW | - (i==0 ? MF_MENUBREAK : 0), k, (LPCTSTR) k); + (i==0 ? MF_MENUBREAK : 0), k, MAKEINTRESOURCE(k)); k++; ok( ret, "AppendMenu failed for %d\n", k-1); } @@ -717,130 +717,173 @@ static WCHAR *strcpyW( WCHAR *dst, const WCHAR *src ) return dst; } +static void insert_menu_item( int line, HMENU hmenu, BOOL ansi, UINT mask, UINT type, UINT state, UINT id, + HMENU submenu, HBITMAP checked, HBITMAP unchecked, ULONG_PTR data, + void *type_data, UINT len, HBITMAP item, BOOL expect ) +{ + MENUITEMINFOA info; + BOOL ret; + + /* magic bitmap handle to test smaller cbSize */ + if (item == (HBITMAP)(ULONG_PTR)0xdeadbeef) + info.cbSize = FIELD_OFFSET(MENUITEMINFOA,hbmpItem); + else + info.cbSize = sizeof(info); + info.fMask = mask; + info.fType = type; + info.fState = state; + info.wID = id; + info.hSubMenu = submenu; + info.hbmpChecked = checked; + info.hbmpUnchecked = unchecked; + info.dwItemData = data; + info.dwTypeData = type_data; + info.cch = len; + info.hbmpItem = item; + SetLastError( 0xdeadbeef ); + if (ansi) ret = InsertMenuItemA( hmenu, 0, TRUE, &info ); + else ret = InsertMenuItemW( hmenu, 0, TRUE, (MENUITEMINFOW*)&info ); + if (!expect) ok_(__FILE__, line)( !ret, "InsertMenuItem should have failed.\n" ); + else ok_(__FILE__, line)( ret, "InsertMenuItem failed, err %u\n", GetLastError()); +} + +static void check_menu_item_info( int line, HMENU hmenu, BOOL ansi, UINT mask, UINT type, UINT state, + UINT id, HMENU submenu, HBITMAP checked, HBITMAP unchecked, + ULONG_PTR data, void *type_data, UINT in_len, UINT out_len, + HBITMAP item, LPCSTR expname, BOOL expect, BOOL expstring ) +{ + MENUITEMINFOA info; + BOOL ret; + WCHAR buffer[80]; + + SetLastError( 0xdeadbeef ); + memset( &info, 0xcc, sizeof(info) ); + info.cbSize = sizeof(info); + info.fMask = mask; + info.dwTypeData = type_data; + info.cch = in_len; + + ret = ansi ? GetMenuItemInfoA( hmenu, 0, TRUE, &info ) : + GetMenuItemInfoW( hmenu, 0, TRUE, (MENUITEMINFOW *)&info ); + if (!expect) + { + ok_(__FILE__, line)( !ret, "GetMenuItemInfo should have failed.\n" ); + return; + } + ok_(__FILE__, line)( ret, "GetMenuItemInfo failed, err %u\n", GetLastError()); + if (mask & MIIM_TYPE) + ok_(__FILE__, line)( info.fType == type || info.fType == LOWORD(type), + "wrong type %x/%x\n", info.fType, type ); + if (mask & MIIM_STATE) + ok_(__FILE__, line)( info.fState == state || info.fState == LOWORD(state), + "wrong state %x/%x\n", info.fState, state ); + if (mask & MIIM_ID) + ok_(__FILE__, line)( info.wID == id || info.wID == LOWORD(id), + "wrong id %x/%x\n", info.wID, id ); + if (mask & MIIM_SUBMENU) + ok_(__FILE__, line)( info.hSubMenu == submenu || (ULONG_PTR)info.hSubMenu == LOWORD(submenu), + "wrong submenu %p/%p\n", info.hSubMenu, submenu ); + if (mask & MIIM_CHECKMARKS) + { + ok_(__FILE__, line)( info.hbmpChecked == checked || (ULONG_PTR)info.hbmpChecked == LOWORD(checked), + "wrong bmpchecked %p/%p\n", info.hbmpChecked, checked ); + ok_(__FILE__, line)( info.hbmpUnchecked == unchecked || (ULONG_PTR)info.hbmpUnchecked == LOWORD(unchecked), + "wrong bmpunchecked %p/%p\n", info.hbmpUnchecked, unchecked ); + } + if (mask & MIIM_DATA) + ok_(__FILE__, line)( info.dwItemData == data || info.dwItemData == LOWORD(data), + "wrong item data %lx/%lx\n", info.dwItemData, data ); + if (mask & MIIM_BITMAP) + ok_(__FILE__, line)( info.hbmpItem == item || (ULONG_PTR)info.hbmpItem == LOWORD(item), + "wrong bmpitem %p/%p\n", info.hbmpItem, item ); + ok_(__FILE__, line)( info.dwTypeData == type_data || (ULONG_PTR)info.dwTypeData == LOWORD(type_data), + "wrong type data %p/%p\n", info.dwTypeData, type_data ); + ok_(__FILE__, line)( info.cch == out_len, "wrong len %x/%x\n", info.cch, out_len ); + if (expname) + { + if(ansi) + ok_(__FILE__, line)( !strncmp( expname, info.dwTypeData, out_len ), + "menu item name differed from '%s' '%s'\n", expname, info.dwTypeData ); + else + ok_(__FILE__, line)( !strncmpW( (WCHAR *)expname, (WCHAR *)info.dwTypeData, out_len ), + "menu item name wrong\n" ); + + SetLastError( 0xdeadbeef ); + ret = ansi ? GetMenuStringA( hmenu, 0, (char *)buffer, 80, MF_BYPOSITION ) : + GetMenuStringW( hmenu, 0, buffer, 80, MF_BYPOSITION ); + if (expstring) + ok_(__FILE__, line)( ret, "GetMenuString failed, err %u\n", GetLastError()); + else + ok_(__FILE__, line)( !ret, "GetMenuString should have failed\n" ); + } +} + +static void modify_menu( int line, HMENU hmenu, BOOL ansi, UINT flags, UINT_PTR id, void *data ) +{ + BOOL ret; + + SetLastError( 0xdeadbeef ); + if (ansi) ret = ModifyMenuA( hmenu, 0, flags, id, data ); + else ret = ModifyMenuW( hmenu, 0, flags, id, (WCHAR *)data ); + ok_(__FILE__,line)( ret, "ModifyMenuA failed, err %u\n", GetLastError()); +} + +static void set_menu_item_info( int line, HMENU hmenu, BOOL ansi, UINT mask, UINT type, UINT state, + UINT id, HMENU submenu, HBITMAP checked, HBITMAP unchecked, ULONG_PTR data, + void *type_data, UINT len, HBITMAP item ) + +{ + MENUITEMINFOA info; + BOOL ret; + + /* magic bitmap handle to test smaller cbSize */ + if (item == (HBITMAP)(ULONG_PTR)0xdeadbeef) + info.cbSize = FIELD_OFFSET(MENUITEMINFOA,hbmpItem); + else + info.cbSize = sizeof(info); + info.fMask = mask; + info.fType = type; + info.fState = state; + info.wID = id; + info.hSubMenu = submenu; + info.hbmpChecked = checked; + info.hbmpUnchecked = unchecked; + info.dwItemData = data; + info.dwTypeData = type_data; + info.cch = len; + info.hbmpItem = item; + SetLastError( 0xdeadbeef ); + if (ansi) ret = SetMenuItemInfoA( hmenu, 0, TRUE, &info ); + else ret = SetMenuItemInfoW( hmenu, 0, TRUE, (MENUITEMINFOW*)&info ); + ok_(__FILE__, line)( ret, "SetMenuItemInfo failed, err %u\n", GetLastError()); +} -#define DMIINFF( i, e, field)\ - ok((int)((i)->field)==(int)((e)->field) || (int)((i)->field)==(0xffff & (int)((e)->field)), \ - "%s got 0x%x expected 0x%x\n", #field, (int)((i)->field), (int)((e)->field)); - -#define DUMPMIINF(s,i,e)\ -{\ - DMIINFF( i, e, fMask)\ - DMIINFF( i, e, fType)\ - DMIINFF( i, e, fState)\ - DMIINFF( i, e, wID)\ - DMIINFF( i, e, hSubMenu)\ - DMIINFF( i, e, hbmpChecked)\ - DMIINFF( i, e, hbmpUnchecked)\ - DMIINFF( i, e, dwItemData)\ - DMIINFF( i, e, dwTypeData)\ - DMIINFF( i, e, cch)\ - if( s==sizeof(MENUITEMINFOA)) DMIINFF( i, e, hbmpItem)\ -} - -/* insert menu item */ -#define TMII_INSMI( a1,b1,c1,d1,e1,f1,g1,h1,i1,j1,k1,l1,m1,n1,\ - eret1)\ -{\ - MENUITEMINFOA info1=a1 b1,c1,d1,e1,f1,(void*)g1,(void*)h1,(void*)i1,j1,(void*)k1,l1,(void*)m1 n1;\ - HMENU hmenu = CreateMenu();\ - BOOL ret, stop = FALSE;\ - SetLastError( 0xdeadbeef);\ +#define TMII_INSMI( c1,d1,e1,f1,g1,h1,i1,j1,k1,l1,m1,eret1 )\ + hmenu = CreateMenu();\ + submenu = CreateMenu();\ if(ansi)strcpy( string, init);\ else strcpyW( (WCHAR*)string, (WCHAR*)init);\ - if( ansi) ret = InsertMenuItemA(hmenu, 0, TRUE, &info1 );\ - else ret = InsertMenuItemW(hmenu, 0, TRUE, (MENUITEMINFOW*)&info1 );\ - if( GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)\ - {\ - skip("InsertMenuItem%s not implemented\n", ansi ? "A" : "W");\ - break;\ - }\ - if( !(eret1)) { ok( (eret1)==ret,"InsertMenuItem should have failed.\n");\ - stop = TRUE;\ - } else ok( (eret1)==ret,"InsertMenuItem failed, err %d\n",GetLastError());\ - + insert_menu_item( __LINE__, hmenu, ansi, c1, d1, e1, f1, g1, h1, i1, j1, k1, l1, m1, eret1 ) /* GetMenuItemInfo + GetMenuString */ -#define TMII_GMII( a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,\ - a3,b3,c3,d3,e3,f3,g3,h3,i3,j3,k3,l3,m3,n3,\ +#define TMII_GMII( c2,l2,\ + d3,e3,f3,g3,h3,i3,j3,k3,l3,m3,\ expname, eret2, eret3)\ -{\ - MENUITEMINFOA info2A=a2 b2,c2,d2,e2,f2,(void*)g2,(void*)h2,(void*)i2,j2,(void*)k2,l2,(void*)m2 n2;\ - MENUITEMINFOA einfoA=a3 b3,c3,d3,e3,f3,(void*)g3,(void*)h3,(void*)i3,j3,(void*)k3,l3,(void*)m3 n3;\ - MENUITEMINFOA *info2 = &info2A;\ - MENUITEMINFOA *einfo = &einfoA;\ - MENUITEMINFOW *info2W = (MENUITEMINFOW *)&info2A;\ - if( !stop) {\ - SetLastError( 0xdeadbeef);\ - ret = ansi ? GetMenuItemInfoA( hmenu, 0, TRUE, info2 ) :\ - GetMenuItemInfoW( hmenu, 0, TRUE, info2W );\ - if( GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)\ - {\ - skip("GetMenuItemInfo%s not implemented\n", ansi ? "A" : "W");\ - break;\ - }\ - if( !(eret2)) ok( (eret2)==ret,"GetMenuItemInfo should have failed.\n");\ - else { \ - ok( (eret2)==ret,"GetMenuItemInfo failed, err %d\n",GetLastError());\ - ret = memcmp( info2, einfo, sizeof einfoA);\ - /* ok( ret==0, "Got wrong menu item info data\n");*/\ - if( ret) DUMPMIINF(info2A.cbSize, &info2A, &einfoA)\ - if( einfo->dwTypeData == string) {\ - if(ansi) ok( !strncmp( expname, info2->dwTypeData, einfo->cch ), "menu item name differed \"%s\"\n",\ - einfo->dwTypeData ? einfo->dwTypeData: "");\ - else ok( !strncmpW( (WCHAR*)expname, (WCHAR*)info2->dwTypeData, einfo->cch ), "menu item name differed \"%s\"\n",\ - einfo->dwTypeData ? einfo->dwTypeData: "");\ - ret = ansi ? GetMenuStringA( hmenu, 0, string, 80, MF_BYPOSITION) :\ - GetMenuStringW( hmenu, 0, string, 80, MF_BYPOSITION);\ - if( (eret3)){\ - ok( ret, "GetMenuString failed, err %d\n",GetLastError());\ - }else\ - ok( !ret, "GetMenuString should have failed\n");\ - }\ - }\ - }\ -} + check_menu_item_info( __LINE__, hmenu, ansi, c2, d3, e3, f3, g3, h3, i3, j3, k3, l2, l3, m3, \ + expname, eret2, eret3 ) #define TMII_DONE \ RemoveMenu(hmenu, 0, TRUE );\ DestroyMenu( hmenu );\ - DestroyMenu( submenu );\ -submenu = CreateMenu();\ -} + DestroyMenu( submenu ); + /* modify menu */ -#define TMII_MODM( flags, id, data, eret )\ -if( !stop) {\ - SetLastError( 0xdeadbeef);\ - if(ansi)ret = ModifyMenuA( hmenu, 0, flags, (UINT_PTR)id, (char*)data);\ - else ret = ModifyMenuW( hmenu, 0, flags, (UINT_PTR)id, (WCHAR*)data);\ - if( GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)\ - {\ - skip("ModifyMenu%s not implemented\n", ansi ? "A" : "W");\ - break;\ - }\ - if( !(eret)) ok( (eret)==ret,"ModifyMenuA should have failed.\n");\ - else ok( (eret)==ret,"ModifyMenuA failed, err %d\n",GetLastError());\ -} +#define TMII_MODM( flags, id, data ) \ + modify_menu( __LINE__, hmenu, ansi, flags, id, data ) /* SetMenuItemInfo */ -#define TMII_SMII( a1,b1,c1,d1,e1,f1,g1,h1,i1,j1,k1,l1,m1,n1,\ - eret1)\ -if( !stop) {\ - MENUITEMINFOA info1=a1 b1,c1,d1,e1,f1,(void*)g1,(void*)h1,(void*)i1,j1,(void*)k1,l1,(void*)m1 n1;\ - SetLastError( 0xdeadbeef);\ - if(ansi)strcpy( string, init);\ - else strcpyW( (WCHAR*)string, (WCHAR*)init);\ - if( ansi) ret = SetMenuItemInfoA(hmenu, 0, TRUE, &info1 );\ - else ret = SetMenuItemInfoW(hmenu, 0, TRUE, (MENUITEMINFOW*)&info1 );\ - if( GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)\ - {\ - skip("SetMenuItemInfo%s not implemented\n", ansi ? "A" : "W");\ - break;\ - }\ - if( !(eret1)) { ok( (eret1)==ret,"InsertMenuItem should have failed.\n");\ - stop = TRUE;\ - } else ok( (eret1)==ret,"InsertMenuItem failed, err %d\n",GetLastError());\ -} - +#define TMII_SMII( c1,d1,e1,f1,g1,h1,i1,j1,k1,l1,m1 ) \ + set_menu_item_info( __LINE__, hmenu, ansi, c1, d1, e1, f1, g1, h1, i1, j1, k1, l1, m1 ) #define OK 1 @@ -849,7 +892,6 @@ if( !stop) {\ static void test_menu_iteminfo( void ) { - int S=sizeof( MENUITEMINFOA); int ansi = TRUE; char txtA[]="wine"; char initA[]="XYZ"; @@ -860,7 +902,8 @@ static void test_menu_iteminfo( void ) void *txt, *init, *empty, *string; HBITMAP hbm = CreateBitmap(1,1,1,1,NULL); char stringA[0x80]; - HMENU submenu=CreateMenu(); + HMENU hmenu, submenu=CreateMenu(); + HBITMAP dummy_hbm = (HBITMAP)(ULONG_PTR)0xdeadbeef; do { if( ansi) {txt=txtA;init=initA;empty=emptyA;string=stringA;} @@ -868,481 +911,465 @@ static void test_menu_iteminfo( void ) trace( "%s string %p hbm %p txt %p\n", ansi ? "ANSI tests: " : "Unicode tests:", string, hbm, txt); /* test all combinations of MFT_STRING, MFT_OWNERDRAW and MFT_BITMAP */ /* (since MFT_STRING is zero, there are four of them) */ - TMII_INSMI( {, S, MIIM_TYPE, MFT_STRING, 0, 0, 0, 0, 0, 0, txt, 0, 0, }, OK) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_TYPE, MFT_STRING, -9, -9, 0, -9, -9, -9, string, 4, 0, }, - txt, OK, OK ) - TMII_DONE - TMII_INSMI( {, S, MIIM_TYPE, MFT_STRING|MFT_OWNERDRAW, -1, -1, -1, -1, -1, -1, txt, 0, -1, }, OK) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_TYPE, MFT_STRING|MFT_OWNERDRAW, -9, -9, 0, -9, -9, -9, 0, 0, 0, }, - empty, OK, ER ) - TMII_DONE - TMII_INSMI( {, S, MIIM_TYPE, MFT_BITMAP, -1, -1, -1, -1, -1, -1, hbm, 6, -1, }, OK) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_TYPE, MFT_BITMAP, -9, -9, 0, -9, -9, -9, hbm, 0, hbm, }, - empty, OK, ER ) - TMII_DONE - TMII_INSMI( {, S, MIIM_TYPE, MFT_BITMAP|MFT_OWNERDRAW, -1, -1, -1, -1, -1, -1, hbm, 6, -1, }, OK) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_TYPE, MFT_BITMAP|MFT_OWNERDRAW, -9, -9, 0, -9, -9, -9, hbm, 0, hbm, }, - empty, OK, ER ) + TMII_INSMI( MIIM_TYPE, MFT_STRING, 0, 0, 0, 0, 0, 0, txt, 0, 0, OK ); + TMII_GMII ( MIIM_TYPE, 80, + MFT_STRING, 0, 0, 0, 0, 0, 0, string, 4, 0, + txt, OK, OK ); + TMII_DONE + TMII_INSMI( MIIM_TYPE, MFT_STRING|MFT_OWNERDRAW, -1, -1, 0, 0, 0, -1, txt, 0, 0, OK ); + TMII_GMII ( MIIM_TYPE, 80, + MFT_STRING|MFT_OWNERDRAW, 0, 0, 0, 0, 0, 0, 0, 0, 0, + NULL, OK, ER ); + TMII_DONE + TMII_INSMI( MIIM_TYPE, MFT_BITMAP, -1, -1, 0, 0, 0, -1, hbm, 6, 0, OK ); + TMII_GMII ( MIIM_TYPE, 80, + MFT_BITMAP, 0, 0, 0, 0, 0, 0, hbm, 0, hbm, + NULL, OK, ER ); + TMII_DONE + TMII_INSMI( MIIM_TYPE, MFT_BITMAP|MFT_OWNERDRAW, -1, -1, 0, 0, 0, -1, hbm, 6, 0, OK ); + TMII_GMII ( MIIM_TYPE, 80, + MFT_BITMAP|MFT_OWNERDRAW, 0, 0, 0, 0, 0, 0, hbm, 0, hbm, + NULL, OK, ER ); TMII_DONE /* not enough space for name*/ - TMII_INSMI( {, S, MIIM_TYPE, MFT_STRING, -1, -1, -1, -1, -1, -1, txt, 6, -1, }, OK) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, NULL, 0, -9, }, - {, S, MIIM_TYPE, MFT_STRING, -9, -9, 0, -9, -9, -9, NULL, 4, 0, }, - empty, OK, OK ) - TMII_DONE - TMII_INSMI( {, S, MIIM_TYPE, MFT_STRING, -1, -1, -1, -1, -1, -1, txt, 6, -1, }, OK) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, string, 5, -9, }, - {, S, MIIM_TYPE, MFT_STRING, -9, -9, 0, -9, -9, -9, string, 4, 0, }, - txt, OK, OK ) - TMII_DONE - TMII_INSMI( {, S, MIIM_TYPE, MFT_STRING, -1, -1, -1, -1, -1, -1, txt, 6, -1, }, OK) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, string, 4, -9, }, - {, S, MIIM_TYPE, MFT_STRING, -9, -9, 0, -9, -9, -9, string, 3, 0, }, - txt, OK, OK ) - TMII_DONE - TMII_INSMI( {, S, MIIM_FTYPE|MIIM_STRING, MFT_OWNERDRAW, -1, -1, -1, -1, -1, -1, NULL, 0, -1, }, OK) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, NULL, 0, -9, }, - {, S, MIIM_TYPE, MFT_OWNERDRAW, -9, -9, 0, -9, -9, -9, NULL, 0, 0, }, - empty, OK, ER ) + TMII_INSMI( MIIM_TYPE, MFT_STRING, -1, -1, 0, 0, 0, -1, txt, 6, 0, OK ); + TMII_GMII ( MIIM_TYPE, 0, + MFT_STRING, 0, 0, 0, 0, 0, 0, NULL, 4, 0, + NULL, OK, OK ); + TMII_DONE + TMII_INSMI( MIIM_TYPE, MFT_STRING, -1, -1, 0, 0, 0, -1, txt, 6, 0, OK ); + TMII_GMII ( MIIM_TYPE, 5, + MFT_STRING, 0, 0, 0, 0, 0, 0, string, 4, 0, + txt, OK, OK ); + TMII_DONE + TMII_INSMI( MIIM_TYPE, MFT_STRING, -1, -1, 0, 0, 0, -1, txt, 6, 0, OK ); + TMII_GMII ( MIIM_TYPE, 4, + MFT_STRING, 0, 0, 0, 0, 0, 0, string, 3, 0, + txt, OK, OK ); + TMII_DONE + TMII_INSMI( MIIM_FTYPE|MIIM_STRING, MFT_OWNERDRAW, -1, -1, 0, 0, 0, -1, NULL, 0, 0, OK ); + TMII_GMII ( MIIM_TYPE, 0, + MFT_OWNERDRAW, 0, 0, 0, 0, 0, 0, NULL, 0, 0, + NULL, OK, ER ); TMII_DONE /* cannot combine MIIM_TYPE with some other flags */ - TMII_INSMI( {, S, MIIM_TYPE|MIIM_STRING, MFT_STRING, -1, -1, -1, -1, -1, -1, txt, 6, -1, }, ER) - TMII_GMII ( {, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - {, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - empty, OK, OK ) - TMII_DONE - TMII_INSMI( {, S, MIIM_TYPE, MFT_STRING, -1, -1, -1, -1, -1, -1, txt, 6, -1, }, OK) - TMII_GMII ( {, S, MIIM_TYPE|MIIM_STRING, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - empty, ER, OK ) - TMII_DONE - TMII_INSMI( {, S, MIIM_TYPE|MIIM_FTYPE, MFT_STRING, -1, -1, -1, -1, -1, -1, txt, 6, -1, }, ER) - TMII_GMII ( {, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - {, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - empty, OK, OK ) - TMII_DONE - TMII_INSMI( {, S, MIIM_TYPE, MFT_STRING, -1, -1, -1, -1, -1, -1, txt, 6, -1, }, OK) - TMII_GMII ( {, S, MIIM_TYPE|MIIM_FTYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - empty, ER, OK ) - TMII_DONE - TMII_INSMI( {, S, MIIM_TYPE|MIIM_BITMAP, MFT_BITMAP, -1, -1, -1, -1, -1, -1, hbm, 6, hbm, }, ER) - TMII_GMII ( {, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - {, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - empty, OK, OK ) + TMII_INSMI( MIIM_TYPE|MIIM_STRING, MFT_STRING, -1, -1, 0, 0, 0, -1, txt, 6, 0, ER ); + TMII_DONE + TMII_INSMI( MIIM_TYPE, MFT_STRING, -1, -1, 0, 0, 0, -1, txt, 6, 0, OK ); + TMII_GMII ( MIIM_TYPE|MIIM_STRING, 80, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + NULL, ER, OK ); + TMII_DONE + TMII_INSMI( MIIM_TYPE|MIIM_FTYPE, MFT_STRING, -1, -1, 0, 0, 0, -1, txt, 6, 0, ER ); + TMII_DONE + TMII_INSMI( MIIM_TYPE, MFT_STRING, -1, -1, 0, 0, 0, -1, txt, 6, 0, OK ); + TMII_GMII ( MIIM_TYPE|MIIM_FTYPE, 80, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + NULL, ER, OK ); + TMII_DONE + TMII_INSMI( MIIM_TYPE|MIIM_BITMAP, MFT_BITMAP, -1, -1, 0, 0, 0, -1, hbm, 6, hbm, ER ); TMII_DONE /* but succeeds with some others */ - TMII_INSMI( {, S, MIIM_TYPE, MFT_STRING, -1, -1, -1, -1, -1, -1, txt, 6, -1, }, OK) - TMII_GMII ( {, S, MIIM_TYPE|MIIM_SUBMENU, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_TYPE|MIIM_SUBMENU, MFT_STRING, -9, -9, 0, -9, -9, -9, string, 4, 0, }, - txt, OK, OK ) - TMII_DONE - TMII_INSMI( {, S, MIIM_TYPE, MFT_STRING, -1, -1, -1, -1, -1, -1, txt, 6, -1, }, OK) - TMII_GMII ( {, S, MIIM_TYPE|MIIM_STATE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_TYPE|MIIM_STATE, MFT_STRING, 0, -9, 0, -9, -9, -9, string, 4, 0, }, - txt, OK, OK ) - TMII_DONE - TMII_INSMI( {, S, MIIM_TYPE|MIIM_ID, MFT_STRING, -1, 888, -1, -1, -1, -1, txt, 6, -1, }, OK) - TMII_GMII ( {, S, MIIM_TYPE|MIIM_ID, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_TYPE|MIIM_ID, MFT_STRING, -9, 888, 0, -9, -9, -9, string, 4, 0, }, - txt, OK, OK ) - TMII_DONE - TMII_INSMI( {, S, MIIM_TYPE|MIIM_DATA, MFT_STRING, -1, -1, -1, -1, -1, 999, txt, 6, -1, }, OK) - TMII_GMII ( {, S, MIIM_TYPE|MIIM_DATA, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_TYPE|MIIM_DATA, MFT_STRING, -9, -9, 0, -9, -9, 999, string, 4, 0, }, - txt, OK, OK ) + TMII_INSMI( MIIM_TYPE, MFT_STRING, -1, -1, 0, 0, 0, -1, txt, 6, 0, OK ); + TMII_GMII ( MIIM_TYPE|MIIM_SUBMENU, 80, + MFT_STRING, 0, 0, 0, 0, 0, 0, string, 4, 0, + txt, OK, OK ); + TMII_DONE + TMII_INSMI( MIIM_TYPE, MFT_STRING, -1, -1, 0, 0, 0, -1, txt, 6, 0, OK ); + TMII_GMII ( MIIM_TYPE|MIIM_STATE, 80, + MFT_STRING, 0, 0, 0, 0, 0, 0, string, 4, 0, + txt, OK, OK ); + TMII_DONE + TMII_INSMI( MIIM_TYPE|MIIM_ID, MFT_STRING, -1, 888, 0, 0, 0, -1, txt, 6, 0, OK ); + TMII_GMII ( MIIM_TYPE|MIIM_ID, 80, + MFT_STRING, 0, 888, 0, 0, 0, 0, string, 4, 0, + txt, OK, OK ); + TMII_DONE + TMII_INSMI( MIIM_TYPE|MIIM_DATA, MFT_STRING, -1, -1, 0, 0, 0, 999, txt, 6, 0, OK ); + TMII_GMII ( MIIM_TYPE|MIIM_DATA, 80, + MFT_STRING, 0, 0, 0, 0, 0, 999, string, 4, 0, + txt, OK, OK ); TMII_DONE /* to be continued */ /* set text with MIIM_TYPE and retrieve with MIIM_STRING */ - TMII_INSMI( {, S, MIIM_TYPE, MFT_STRING, -1, -1, -1, -1, -1, -1, txt, 6, -1, }, OK) - TMII_GMII ( {, S, MIIM_STRING|MIIM_FTYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_STRING|MIIM_FTYPE, MFT_STRING, -9, -9, 0, -9, -9, -9, string, 4, -9, }, - txt, OK, OK ) + TMII_INSMI( MIIM_TYPE, MFT_STRING, -1, -1, 0, 0, 0, -1, txt, 6, 0, OK ); + TMII_GMII ( MIIM_STRING|MIIM_FTYPE, 80, + MFT_STRING, 0, 0, 0, 0, 0, 0, string, 4, 0, + txt, OK, OK ); TMII_DONE /* set text with MIIM_TYPE and retrieve with MIIM_STRING; MFT_OWNERDRAW causes an empty string */ - TMII_INSMI( {, S, MIIM_TYPE, MFT_STRING|MFT_OWNERDRAW, -1, -1, -1, -1, -1, -1, txt, 6, -1, }, OK) - TMII_GMII ( {, S, MIIM_STRING|MIIM_FTYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_STRING|MIIM_FTYPE, MFT_STRING|MFT_OWNERDRAW, -9, -9, 0, -9, -9, -9, string, 0, -9, }, - empty, OK, ER ) - TMII_DONE - TMII_INSMI( {, S, MIIM_TYPE, MFT_STRING|MFT_OWNERDRAW, -1, -1, -1, -1, -1, -1, NULL, 0, -1, }, OK) - TMII_GMII ( {, S, MIIM_STRING|MIIM_FTYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_STRING|MIIM_FTYPE, MFT_OWNERDRAW, -9, -9, 0, -9, -9, -9, string, 0, -9, }, - empty, OK, ER ) - TMII_DONE - TMII_INSMI( {, S, MIIM_TYPE, MFT_STRING|MFT_OWNERDRAW, -1, -1, -1, -1, -1, -1, NULL, 0, -1, }, OK) - TMII_GMII ( {, S, MIIM_FTYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_FTYPE, MFT_OWNERDRAW, -9, -9, 0, -9, -9, -9, string, 80, -9, }, - init, OK, ER ) - TMII_DONE - TMII_INSMI( {, S, MIIM_TYPE, MFT_STRING, -1, -1, -1, -1, -1, -1, txt, 0, -1, }, OK) - TMII_GMII ( {, S, 0, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, 0, -9, -9, -9, 0, -9, -9, -9, string, 80, -9, }, - init, OK, OK ) + TMII_INSMI( MIIM_TYPE, MFT_STRING|MFT_OWNERDRAW, -1, -1, 0, 0, 0, -1, txt, 6, 0, OK ); + TMII_GMII ( MIIM_STRING|MIIM_FTYPE, 80, + MFT_STRING|MFT_OWNERDRAW, 0, 0, 0, 0, 0, 0, string, 0, 0, + empty, OK, ER ); + TMII_DONE + TMII_INSMI( MIIM_TYPE, MFT_STRING|MFT_OWNERDRAW, -1, -1, 0, 0, 0, -1, NULL, 0, 0, OK ); + TMII_GMII ( MIIM_STRING|MIIM_FTYPE, 80, + MFT_OWNERDRAW, 0, 0, 0, 0, 0, 0, string, 0, 0, + empty, OK, ER ); + TMII_DONE + TMII_INSMI( MIIM_TYPE, MFT_STRING|MFT_OWNERDRAW, -1, -1, 0, 0, 0, -1, NULL, 0, 0, OK ); + TMII_GMII ( MIIM_FTYPE, 80, + MFT_OWNERDRAW, 0, 0, 0, 0, 0, 0, string, 80, 0, + init, OK, ER ); + TMII_DONE + TMII_INSMI( MIIM_TYPE, MFT_STRING, -1, -1, 0, 0, 0, -1, txt, 0, 0, OK ); + TMII_GMII ( 0, 80, + 0, 0, 0, 0, 0, 0, 0, string, 80, 0, + init, OK, OK ); TMII_DONE /* contrary to MIIM_TYPE,you can set the text for an owner draw menu */ - TMII_INSMI( {, S, MIIM_STRING|MIIM_FTYPE, MFT_STRING|MFT_OWNERDRAW, -1, -1, -1, -1, -1, -1, txt, 0, -1, }, OK) - TMII_GMII ( {, S, MIIM_STRING|MIIM_FTYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_STRING|MIIM_FTYPE, MFT_OWNERDRAW, -9, -9, 0, -9, -9, -9, string, 4, -9, }, - txt, OK, OK ) + TMII_INSMI( MIIM_STRING|MIIM_FTYPE, MFT_STRING|MFT_OWNERDRAW, -1, -1, 0, 0, 0, -1, txt, 0, 0, OK ); + TMII_GMII ( MIIM_STRING|MIIM_FTYPE, 80, + MFT_OWNERDRAW, 0, 0, 0, 0, 0, 0, string, 4, 0, + txt, OK, OK ); TMII_DONE /* same but retrieve with MIIM_TYPE */ - TMII_INSMI( {, S, MIIM_STRING|MIIM_FTYPE, MFT_STRING|MFT_OWNERDRAW, -1, -1, -1, -1, -1, -1, txt, 0, -1, }, OK) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_TYPE, MFT_OWNERDRAW, -9, -9, 0, -9, -9, -9, NULL, 4, NULL, }, - txt, OK, OK ) + TMII_INSMI( MIIM_STRING|MIIM_FTYPE, MFT_STRING|MFT_OWNERDRAW, -1, -1, 0, 0, 0, -1, txt, 0, 0, OK ); + TMII_GMII ( MIIM_TYPE, 80, + MFT_OWNERDRAW, 0, 0, 0, 0, 0, 0, NULL, 4, NULL, + NULL, OK, OK ); TMII_DONE - TMII_INSMI( {, S, MIIM_STRING|MIIM_FTYPE, MFT_STRING|MFT_OWNERDRAW, -1, -1, -1, -1, -1, -1, NULL, 0, -1, }, OK) - TMII_GMII ( {, S, MIIM_STRING|MIIM_FTYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_STRING|MIIM_FTYPE, MFT_OWNERDRAW, -9, -9, 0, -9, -9, -9, string, 0, -9, }, - empty, OK, ER ) + TMII_INSMI( MIIM_STRING|MIIM_FTYPE, MFT_STRING|MFT_OWNERDRAW, -1, -1, 0, 0, 0, -1, NULL, 0, 0, OK ); + TMII_GMII ( MIIM_STRING|MIIM_FTYPE, 80, + MFT_OWNERDRAW, 0, 0, 0, 0, 0, 0, string, 0, 0, + empty, OK, ER ); TMII_DONE - TMII_INSMI( {, S, MIIM_STRING|MIIM_FTYPE, MFT_STRING, -1, -1, -1, -1, -1, -1, NULL, 0, -1, }, OK) - TMII_GMII ( {, S, MIIM_STRING|MIIM_FTYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_STRING|MIIM_FTYPE, MFT_SEPARATOR, -9, -9, 0, -9, -9, -9, string, 0, -9, }, - empty, OK, ER ) + TMII_INSMI( MIIM_STRING|MIIM_FTYPE, MFT_STRING, -1, -1, 0, 0, 0, -1, NULL, 0, 0, OK ); + TMII_GMII ( MIIM_STRING|MIIM_FTYPE, 80, + MFT_SEPARATOR, 0, 0, 0, 0, 0, 0, string, 0, 0, + empty, OK, ER ); TMII_DONE /* How is that with bitmaps? */ - TMII_INSMI( {, S, MIIM_BITMAP, -1, -1, -1, -1, -1, -1, -1, -1, -1, hbm, }, OK) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_TYPE, MFT_BITMAP, -9, -9, 0, -9, -9, -9, hbm, 0, hbm, }, - empty, OK, ER ) + TMII_INSMI( MIIM_BITMAP, -1, -1, -1, 0, 0, 0, -1, 0, -1, hbm, OK ); + TMII_GMII ( MIIM_TYPE, 80, + MFT_BITMAP, 0, 0, 0, 0, 0, 0, hbm, 0, hbm, + NULL, OK, ER ); TMII_DONE - TMII_INSMI( {, S, MIIM_BITMAP, -1, -1, -1, -1, -1, -1, -1, -1, -1, hbm, }, OK) - TMII_GMII ( {, S, MIIM_BITMAP|MIIM_FTYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_BITMAP|MIIM_FTYPE, 0, -9, -9, 0, -9, -9, -9, string, 80, hbm, }, - init, OK, ER ) + TMII_INSMI( MIIM_BITMAP, -1, -1, -1, 0, 0, 0, -1, 0, -1, hbm, OK ); + TMII_GMII ( MIIM_BITMAP|MIIM_FTYPE, 80, + 0, 0, 0, 0, 0, 0, 0, string, 80, hbm, + init, OK, ER ); TMII_DONE /* MIIM_BITMAP does not like MFT_BITMAP */ - TMII_INSMI( {, S, MIIM_BITMAP|MIIM_FTYPE, MFT_BITMAP, -1, -1, -1, -1, -1, -1, -1, -1, hbm, }, ER) - TMII_GMII ( {, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - {, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - init, OK, OK ) + TMII_INSMI( MIIM_BITMAP|MIIM_FTYPE, MFT_BITMAP, -1, -1, 0, 0, 0, -1, 0, -1, hbm, ER ); TMII_DONE /* no problem with OWNERDRAWN */ - TMII_INSMI( {, S, MIIM_BITMAP|MIIM_FTYPE, MFT_OWNERDRAW, -1, -1, -1, -1, -1, -1, -1, -1, hbm, }, OK) - TMII_GMII ( {, S, MIIM_BITMAP|MIIM_FTYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_BITMAP|MIIM_FTYPE, MFT_OWNERDRAW, -9, -9, 0, -9, -9, -9, string, 80, hbm, }, - init, OK, ER ) + TMII_INSMI( MIIM_BITMAP|MIIM_FTYPE, MFT_OWNERDRAW, -1, -1, 0, 0, 0, -1, 0, -1, hbm, OK ); + TMII_GMII ( MIIM_BITMAP|MIIM_FTYPE, 80, + MFT_OWNERDRAW, 0, 0, 0, 0, 0, 0, string, 80, hbm, + init, OK, ER ); TMII_DONE /* setting MFT_BITMAP with MFT_FTYPE fails anyway */ - TMII_INSMI( {, S, MIIM_FTYPE, MFT_BITMAP, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, ER) - TMII_GMII ( {, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - {, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - empty, OK, OK ) + TMII_INSMI( MIIM_FTYPE, MFT_BITMAP, -1, -1, 0, 0, 0, -1, 0, -1, 0, ER ); TMII_DONE /* menu with submenu */ - TMII_INSMI( {, S, MIIM_SUBMENU|MIIM_FTYPE, MFT_STRING, -1, -1, submenu, -1, -1, -1, txt, 0, -1, }, OK) - TMII_GMII ( {, S, MIIM_SUBMENU, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_SUBMENU, -9, -9, -9, submenu, -9, -9, -9, string, 80, -9, }, - init, OK, ER ) + TMII_INSMI( MIIM_SUBMENU|MIIM_FTYPE, MFT_STRING, -1, -1, submenu, 0, 0, -1, txt, 0, 0, OK ); + TMII_GMII ( MIIM_SUBMENU, 80, + 0, 0, 0, submenu, 0, 0, 0, string, 80, 0, + init, OK, ER ); TMII_DONE - TMII_INSMI( {, S, MIIM_SUBMENU|MIIM_FTYPE, MFT_STRING, -1, -1, submenu, -1, -1, -1, empty, 0, -1, }, OK) - TMII_GMII ( {, S, MIIM_SUBMENU, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_SUBMENU, -9, -9, -9, submenu, -9, -9, -9, string, 80, -9, }, - init, OK, ER ) + TMII_INSMI( MIIM_SUBMENU|MIIM_FTYPE, MFT_STRING, -1, -1, submenu, 0, 0, -1, empty, 0, 0, OK ); + TMII_GMII ( MIIM_SUBMENU, 80, + 0, 0, 0, submenu, 0, 0, 0, string, 80, 0, + init, OK, ER ); TMII_DONE /* menu with submenu, without MIIM_SUBMENU the submenufield is cleared */ - TMII_INSMI( {, S, MIIM_SUBMENU|MIIM_FTYPE, MFT_STRING, -1, -1, submenu, -1, -1, -1, txt, 0, -1, }, OK) - TMII_GMII ( {, S, MIIM_STRING|MIIM_FTYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_STRING|MIIM_FTYPE, MFT_STRING|MFT_SEPARATOR, -9, -9, 0, -9, -9, -9, string, 0, -9, }, - empty, OK, ER ) - TMII_GMII ( {, S, MIIM_SUBMENU|MIIM_FTYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_SUBMENU|MIIM_FTYPE, MFT_SEPARATOR, -9, -9, submenu, -9, -9, -9, string, 80, -9, }, - empty, OK, ER ) + TMII_INSMI( MIIM_SUBMENU|MIIM_FTYPE, MFT_STRING, -1, -1, submenu, 0, 0, -1, txt, 0, 0, OK ); + TMII_GMII ( MIIM_STRING|MIIM_FTYPE, 80, + MFT_STRING|MFT_SEPARATOR, 0, 0, 0, 0, 0, 0, string, 0, 0, + empty, OK, ER ); + TMII_GMII ( MIIM_SUBMENU|MIIM_FTYPE, 80, + MFT_SEPARATOR, 0, 0, submenu, 0, 0, 0, string, 80, 0, + empty, OK, ER ); TMII_DONE /* menu with invalid submenu */ - TMII_INSMI( {, S, MIIM_SUBMENU|MIIM_FTYPE, MFT_STRING, -1, -1, 999, -1, -1, -1, txt, 0, -1, }, ER) - TMII_GMII ( {, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - {, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, - init, OK, ER ) + TMII_INSMI( MIIM_SUBMENU|MIIM_FTYPE, MFT_STRING, -1, -1, (HMENU)999, 0, 0, -1, txt, 0, 0, ER ); TMII_DONE /* Separator */ - TMII_INSMI( {, S, MIIM_TYPE, MFT_SEPARATOR, 0, 0, 0, 0, 0, 0, txt, 0, 0, }, OK) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_TYPE, MFT_SEPARATOR, -9, -9, 0, -9, -9, -9, 0, 0, 0, }, - empty, OK, ER ) + TMII_INSMI( MIIM_TYPE, MFT_SEPARATOR, 0, 0, 0, 0, 0, 0, txt, 0, 0, OK ); + TMII_GMII ( MIIM_TYPE, 80, + MFT_SEPARATOR, 0, 0, 0, 0, 0, 0, 0, 0, 0, + NULL, OK, ER ); TMII_DONE - TMII_INSMI( {, S, MIIM_TYPE, MFT_BITMAP|MFT_SEPARATOR, -1, -1, -1, -1, -1, -1, hbm, 6, -1, }, OK) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_TYPE, MFT_BITMAP|MFT_SEPARATOR, -9, -9, 0, -9, -9, -9, hbm, 0, hbm, }, - empty, OK, ER ) + TMII_INSMI( MIIM_TYPE, MFT_BITMAP|MFT_SEPARATOR, -1, -1, 0, 0, 0, -1, hbm, 6, 0, OK ); + TMII_GMII ( MIIM_TYPE, 80, + MFT_BITMAP|MFT_SEPARATOR, 0, 0, 0, 0, 0, 0, hbm, 0, hbm, + NULL, OK, ER ); TMII_DONE /* SEPARATOR and STRING go well together */ /* BITMAP and STRING go well together */ - TMII_INSMI( {, S, MIIM_STRING|MIIM_BITMAP, -1, -1, -1, -1, -1, -1, -1, txt, 6, hbm, }, OK) - TMII_GMII ( {, S, MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP, MFT_STRING, -9, -9, 0, -9, -9, -9, string, 4, hbm, }, - txt, OK, OK ) + TMII_INSMI( MIIM_STRING|MIIM_BITMAP, -1, -1, -1, 0, 0, 0, -1, txt, 6, hbm, OK ); + TMII_GMII ( MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP, 80, + MFT_STRING, 0, 0, 0, 0, 0, 0, string, 4, hbm, + txt, OK, OK ); TMII_DONE /* BITMAP, SEPARATOR and STRING go well together */ - TMII_INSMI( {, S, MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP, MFT_SEPARATOR, -1, -1, -1, -1, -1, -1, txt, 6, hbm, }, OK) - TMII_GMII ( {, S, MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP, MFT_SEPARATOR, -9, -9, 0, -9, -9, -9, string, 4, hbm, }, - txt, OK, OK ) + TMII_INSMI( MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP, MFT_SEPARATOR, -1, -1, 0, 0, 0, -1, txt, 6, hbm, OK ); + TMII_GMII ( MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP, 80, + MFT_SEPARATOR, 0, 0, 0, 0, 0, 0, string, 4, hbm, + txt, OK, OK ); TMII_DONE /* last two tests, but use MIIM_TYPE to retrieve info */ - TMII_INSMI( {, S, MIIM_FTYPE|MIIM_STRING, MFT_SEPARATOR, -1, -1, -1, -1, -1, -1, txt, 6, -1, }, OK) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_TYPE, MFT_SEPARATOR, -9, -9, 0, -9, -9, -9, NULL, 4, NULL, }, - txt, OK, OK ) + TMII_INSMI( MIIM_FTYPE|MIIM_STRING, MFT_SEPARATOR, -1, -1, 0, 0, 0, -1, txt, 6, 0, OK ); + TMII_GMII ( MIIM_TYPE, 80, + MFT_SEPARATOR, 0, 0, 0, 0, 0, 0, NULL, 4, NULL, + NULL, OK, OK ); TMII_DONE - TMII_INSMI( {, S, MIIM_STRING|MIIM_BITMAP, -1, -1, -1, -1, -1, -1, -1, txt, 6, hbm, }, OK) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_TYPE, MFT_BITMAP, -9, -9, 0, -9, -9, -9, hbm, 4, hbm, }, - txt, OK, OK ) + TMII_INSMI( MIIM_STRING|MIIM_BITMAP, -1, -1, -1, 0, 0, 0, -1, txt, 6, hbm, OK ); + TMII_GMII ( MIIM_TYPE, 80, + MFT_BITMAP, 0, 0, 0, 0, 0, 0, hbm, 4, hbm, + NULL, OK, OK ); TMII_DONE - TMII_INSMI( {, S, MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP, MFT_SEPARATOR, -1, -1, -1, -1, -1, -1, txt, 6, hbm, }, OK) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_TYPE, MFT_SEPARATOR|MFT_BITMAP, -9, -9, 0, -9, -9, -9, hbm, 4, hbm, }, - txt, OK, OK ) + TMII_INSMI( MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP, MFT_SEPARATOR, -1, -1, 0, 0, 0, -1, txt, 6, hbm, OK ); + TMII_GMII ( MIIM_TYPE, 80, + MFT_SEPARATOR|MFT_BITMAP, 0, 0, 0, 0, 0, 0, hbm, 4, hbm, + NULL, OK, OK ); TMII_DONE /* same three with MFT_OWNERDRAW */ - TMII_INSMI( {, S, MIIM_FTYPE|MIIM_STRING, MFT_SEPARATOR|MFT_OWNERDRAW, -1, -1, -1, -1, -1, -1, txt, 6, -1, }, OK) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_TYPE, MFT_SEPARATOR|MFT_OWNERDRAW, -9, -9, 0, -9, -9, -9, NULL, 4, NULL, }, - txt, OK, OK ) + TMII_INSMI( MIIM_FTYPE|MIIM_STRING, MFT_SEPARATOR|MFT_OWNERDRAW, -1, -1, 0, 0, 0, -1, txt, 6, 0, OK ); + TMII_GMII ( MIIM_TYPE, 80, + MFT_SEPARATOR|MFT_OWNERDRAW, 0, 0, 0, 0, 0, 0, NULL, 4, NULL, + NULL, OK, OK ); TMII_DONE - TMII_INSMI( {, S, MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP, MFT_OWNERDRAW, -1, -1, -1, -1, -1, -1, txt, 6, hbm, }, OK) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_TYPE, MFT_BITMAP|MFT_OWNERDRAW, -9, -9, 0, -9, -9, -9, hbm, 4, hbm, }, - txt, OK, OK ) + TMII_INSMI( MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP, MFT_OWNERDRAW, -1, -1, 0, 0, 0, -1, txt, 6, hbm, OK ); + TMII_GMII ( MIIM_TYPE, 80, + MFT_BITMAP|MFT_OWNERDRAW, 0, 0, 0, 0, 0, 0, hbm, 4, hbm, + NULL, OK, OK ); TMII_DONE - TMII_INSMI( {, S, MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP, MFT_SEPARATOR|MFT_OWNERDRAW, -1, -1, -1, -1, -1, -1, txt, 6, hbm, }, OK) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_TYPE, MFT_SEPARATOR|MFT_BITMAP|MFT_OWNERDRAW, -9, -9, 0, -9, -9, -9, hbm, 4, hbm, }, - txt, OK, OK ) + TMII_INSMI( MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP, MFT_SEPARATOR|MFT_OWNERDRAW, -1, -1, 0, 0, 0, -1, txt, 6, hbm, OK ); + TMII_GMII ( MIIM_TYPE, 80, + MFT_SEPARATOR|MFT_BITMAP|MFT_OWNERDRAW, 0, 0, 0, 0, 0, 0, hbm, 4, hbm, + NULL, OK, OK ); TMII_DONE - TMII_INSMI( {, S, MIIM_STRING|MIIM_FTYPE|MIIM_ID, MFT_STRING|MFT_OWNERDRAW, -1, -1, -1, -1, -1, -1, txt, 0, -1, }, OK) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_TYPE, MFT_OWNERDRAW, -9, -9, 0, -9, -9, -9, NULL, 4, NULL, }, - txt, OK, OK ) + TMII_INSMI( MIIM_STRING|MIIM_FTYPE|MIIM_ID, MFT_STRING|MFT_OWNERDRAW, -1, -1, 0, 0, 0, -1, txt, 0, 0, OK ); + TMII_GMII ( MIIM_TYPE, 80, + MFT_OWNERDRAW, 0, 0, 0, 0, 0, 0, NULL, 4, NULL, + NULL, OK, OK ); TMII_DONE /* test with modifymenu: string is preserved after setting OWNERDRAW */ - TMII_INSMI( {, S, MIIM_STRING, MFT_STRING, -1, -1, -1, -1, -1, -1, txt, 0, -1, }, OK) - TMII_MODM( MFT_OWNERDRAW, -1, 787, OK) - TMII_GMII ( {, S, MIIM_FTYPE|MIIM_STRING|MIIM_DATA, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_FTYPE|MIIM_STRING|MIIM_DATA, MFT_OWNERDRAW, -9, -9, 0, -9, -9, 787, string, 4, -9, }, - txt, OK, OK ) + TMII_INSMI( MIIM_STRING, MFT_STRING, -1, -1, 0, 0, 0, -1, txt, 0, 0, OK ); + TMII_MODM( MFT_OWNERDRAW, -1, (void*)787 ); + TMII_GMII ( MIIM_FTYPE|MIIM_STRING|MIIM_DATA, 80, + MFT_OWNERDRAW, 0, 0, 0, 0, 0, 787, string, 4, 0, + txt, OK, OK ); TMII_DONE /* same with bitmap: now the text is cleared */ - TMII_INSMI( {, S, MIIM_STRING, MFT_STRING, -1, -1, -1, -1, -1, -1, txt, 0, -1, }, OK) - TMII_MODM( MFT_BITMAP, 545, hbm, OK) - TMII_GMII ( {, S, MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP|MIIM_ID, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP|MIIM_ID, MFT_BITMAP, -9, 545, 0, -9, -9, -9, string, 0, hbm, }, - empty, OK, ER ) + TMII_INSMI( MIIM_STRING, MFT_STRING, -1, -1, 0, 0, 0, -1, txt, 0, 0, OK ); + TMII_MODM( MFT_BITMAP, 545, hbm ); + TMII_GMII ( MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP|MIIM_ID, 80, + MFT_BITMAP, 0, 545, 0, 0, 0, 0, string, 0, hbm, + empty, OK, ER ); TMII_DONE /* start with bitmap: now setting text clears it (though he flag is raised) */ - TMII_INSMI( {, S, MIIM_BITMAP, MFT_STRING, -1, -1, -1, -1, -1, -1, -1, -1, hbm, }, OK) - TMII_GMII ( {, S, MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP|MIIM_ID, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP|MIIM_ID, MFT_STRING, -9, 0, 0, -9, -9, -9, string, 0, hbm, }, - empty, OK, ER ) - TMII_MODM( MFT_STRING, 545, txt, OK) - TMII_GMII ( {, S, MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP|MIIM_ID, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP|MIIM_ID, MFT_STRING, -9, 545, 0, -9, -9, -9, string, 4, 0, }, - txt, OK, OK ) + TMII_INSMI( MIIM_BITMAP, MFT_STRING, -1, -1, 0, 0, 0, -1, 0, -1, hbm, OK ); + TMII_GMII ( MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP|MIIM_ID, 80, + MFT_STRING, 0, 0, 0, 0, 0, 0, string, 0, hbm, + empty, OK, ER ); + TMII_MODM( MFT_STRING, 545, txt ); + TMII_GMII ( MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP|MIIM_ID, 80, + MFT_STRING, 0, 545, 0, 0, 0, 0, string, 4, 0, + txt, OK, OK ); TMII_DONE /*repeat with text NULL */ - TMII_INSMI( {, S, MIIM_BITMAP, MFT_STRING, -1, -1, -1, -1, -1, -1, -1, -1, hbm, }, OK) - TMII_MODM( MFT_STRING, 545, NULL, OK) - TMII_GMII ( {, S, MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP|MIIM_ID, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP|MIIM_ID, MFT_SEPARATOR, -9, 545, 0, -9, -9, -9, string, 0, 0, }, - empty, OK, ER ) + TMII_INSMI( MIIM_BITMAP, MFT_STRING, -1, -1, 0, 0, 0, -1, 0, -1, hbm, OK ); + TMII_MODM( MFT_STRING, 545, NULL ); + TMII_GMII ( MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP|MIIM_ID, 80, + MFT_SEPARATOR, 0, 545, 0, 0, 0, 0, string, 0, 0, + empty, OK, ER ); TMII_DONE /* repeat with text "" */ - TMII_INSMI( {, S, MIIM_BITMAP, -1 , -1, -1, -1, -1, -1, -1, -1, -1, hbm, }, OK) - TMII_MODM( MFT_STRING, 545, empty, OK) - TMII_GMII ( {, S, MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP|MIIM_ID, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP|MIIM_ID, MFT_STRING, -9, 545, 0, -9, -9, -9, string, 0, 0, }, - empty, OK, ER ) + TMII_INSMI( MIIM_BITMAP, -1 , -1, -1, 0, 0, 0, -1, 0, -1, hbm, OK ); + TMII_MODM( MFT_STRING, 545, empty ); + TMII_GMII ( MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP|MIIM_ID, 80, + MFT_STRING, 0, 545, 0, 0, 0, 0, string, 0, 0, + empty, OK, ER ); TMII_DONE /* start with bitmap: set ownerdraw */ - TMII_INSMI( {, S, MIIM_BITMAP, -1, -1, -1, -1, -1, -1, -1, -1, -1, hbm, }, OK) - TMII_MODM( MFT_OWNERDRAW, -1, 232, OK) - TMII_GMII ( {, S, MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP|MIIM_DATA, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP|MIIM_DATA, MFT_OWNERDRAW, -9, -9, 0, -9, -9, 232, string, 0, hbm, }, - empty, OK, ER ) + TMII_INSMI( MIIM_BITMAP, -1, -1, -1, 0, 0, 0, -1, 0, -1, hbm, OK ); + TMII_MODM( MFT_OWNERDRAW, -1, (void *)232 ); + TMII_GMII ( MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP|MIIM_DATA, 80, + MFT_OWNERDRAW, 0, 0, 0, 0, 0, 232, string, 0, hbm, + empty, OK, ER ); TMII_DONE /* ask nothing */ - TMII_INSMI( {, S, MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP, MFT_SEPARATOR, -1, -1, -1, -1, -1, -1, txt, 6, hbm, }, OK) - TMII_GMII ( {, S, 0, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, 0, -9, -9, -9, 0, -9, -9, -9, string, 80, -9, }, - init, OK, OK ) - TMII_DONE - /* some tests with small cbSize: the hbmpItem is to be ignored */ - TMII_INSMI( {, S - 4, MIIM_BITMAP, -1, -1, -1, -1, -1, -1, -1, -1, -1, hbm, }, OK) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_TYPE, MFT_SEPARATOR, -9, -9, 0, -9, -9, -9, NULL, 0, NULL, }, - empty, OK, ER ) - TMII_DONE - TMII_INSMI( {, S - 4, MIIM_BITMAP, -1, -1, -1, -1, -1, -1, -1, -1, -1, hbm, }, OK) - TMII_GMII ( {, S, MIIM_BITMAP|MIIM_FTYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_BITMAP|MIIM_FTYPE, MFT_SEPARATOR, -9, -9, 0, -9, -9, -9, string, 80, NULL, }, - init, OK, ER ) - TMII_DONE - TMII_INSMI( {, S - 4, MIIM_STRING|MIIM_BITMAP, -1, -1, -1, -1, -1, -1, -1, txt, 6, hbm, }, OK) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_TYPE, MFT_STRING, -9, -9, 0, -9, -9, -9, string, 4, NULL, }, - txt, OK, OK ) - TMII_DONE - TMII_INSMI( {, S - 4, MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP, MFT_SEPARATOR, -1, -1, -1, -1, -1, -1, txt, 6, hbm, }, OK) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_TYPE, MFT_SEPARATOR, -9, -9, 0, -9, -9, -9, NULL, 4, NULL, }, - txt, OK, OK ) - TMII_DONE - TMII_INSMI( {, S - 4, MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP, MFT_OWNERDRAW, -1, -1, -1, -1, -1, -1, txt, 6, hbm, }, OK) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_TYPE, MFT_OWNERDRAW, -9, -9, 0, -9, -9, -9, NULL, 4, NULL, }, - txt, OK, OK ) - TMII_DONE - TMII_INSMI( {, S - 4, MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP, MFT_SEPARATOR|MFT_OWNERDRAW, -1, -1, -1, -1, -1, -1, txt, 6, hbm, }, OK) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_TYPE, MFT_SEPARATOR|MFT_OWNERDRAW, -9, -9, 0, -9, -9, -9, NULL, 4, NULL, }, - txt, OK, OK ) + TMII_INSMI( MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP, MFT_SEPARATOR, -1, -1, 0, 0, 0, -1, txt, 6, hbm, OK ); + TMII_GMII ( 0, 80, + 0, 0, 0, 0, 0, 0, 0, string, 80, 0, + init, OK, OK ); + TMII_DONE + /* some tests with small cbSize: the hbmpItem is to be ignored */ + TMII_INSMI( MIIM_BITMAP, -1, -1, -1, 0, 0, 0, -1, 0, -1, dummy_hbm, OK ); + TMII_GMII ( MIIM_TYPE, 80, + MFT_SEPARATOR, 0, 0, 0, 0, 0, 0, NULL, 0, NULL, + NULL, OK, ER ); + TMII_DONE + TMII_INSMI( MIIM_BITMAP, -1, -1, -1, 0, 0, 0, -1, 0, -1, dummy_hbm, OK ); + TMII_GMII ( MIIM_BITMAP|MIIM_FTYPE, 80, + MFT_SEPARATOR, 0, 0, 0, 0, 0, 0, string, 80, NULL, + init, OK, ER ); + TMII_DONE + TMII_INSMI( MIIM_STRING|MIIM_BITMAP, -1, -1, -1, 0, 0, 0, -1, txt, 6, dummy_hbm, OK ); + TMII_GMII ( MIIM_TYPE, 80, + MFT_STRING, 0, 0, 0, 0, 0, 0, string, 4, NULL, + txt, OK, OK ); + TMII_DONE + TMII_INSMI( MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP, MFT_SEPARATOR, -1, -1, 0, 0, 0, -1, txt, 6, dummy_hbm, OK ); + TMII_GMII ( MIIM_TYPE, 80, + MFT_SEPARATOR, 0, 0, 0, 0, 0, 0, NULL, 4, NULL, + NULL, OK, OK ); + TMII_DONE + TMII_INSMI( MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP, MFT_OWNERDRAW, -1, -1, 0, 0, 0, -1, txt, 6, dummy_hbm, OK ); + TMII_GMII ( MIIM_TYPE, 80, + MFT_OWNERDRAW, 0, 0, 0, 0, 0, 0, NULL, 4, NULL, + NULL, OK, OK ); + TMII_DONE + TMII_INSMI( MIIM_FTYPE|MIIM_STRING|MIIM_BITMAP, MFT_SEPARATOR|MFT_OWNERDRAW, -1, -1, 0, 0, 0, -1, txt, 6, dummy_hbm, OK ); + TMII_GMII ( MIIM_TYPE, 80, + MFT_SEPARATOR|MFT_OWNERDRAW, 0, 0, 0, 0, 0, 0, NULL, 4, NULL, + NULL, OK, OK ); TMII_DONE /* MIIM_TYPE by itself does not get/set the dwItemData for OwnerDrawn menus */ - TMII_INSMI( {, S, MIIM_TYPE|MIIM_DATA, MFT_STRING|MFT_OWNERDRAW, -1, -1, -1, -1, -1, 343, txt, 0, -1, }, OK) - TMII_GMII ( {, S, MIIM_TYPE|MIIM_DATA, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_TYPE|MIIM_DATA, MFT_STRING|MFT_OWNERDRAW, -9, -9, 0, -9, -9, 343, 0, 0, 0, }, - empty, OK, ER ) + TMII_INSMI( MIIM_TYPE|MIIM_DATA, MFT_STRING|MFT_OWNERDRAW, -1, -1, 0, 0, 0, 343, txt, 0, 0, OK ); + TMII_GMII ( MIIM_TYPE|MIIM_DATA, 80, + MFT_STRING|MFT_OWNERDRAW, 0, 0, 0, 0, 0, 343, 0, 0, 0, + NULL, OK, ER ); TMII_DONE - TMII_INSMI( {, S, MIIM_TYPE|MIIM_DATA, MFT_STRING|MFT_OWNERDRAW, -1, -1, -1, -1, -1, 343, txt, 0, -1, }, OK) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_TYPE, MFT_STRING|MFT_OWNERDRAW, -9, -9, 0, -9, -9, -9, 0, 0, 0, }, - empty, OK, ER ) + TMII_INSMI( MIIM_TYPE|MIIM_DATA, MFT_STRING|MFT_OWNERDRAW, -1, -1, 0, 0, 0, 343, txt, 0, 0, OK ); + TMII_GMII ( MIIM_TYPE, 80, + MFT_STRING|MFT_OWNERDRAW, 0, 0, 0, 0, 0, 0, 0, 0, 0, + NULL, OK, ER ); TMII_DONE - TMII_INSMI( {, S, MIIM_TYPE, MFT_STRING|MFT_OWNERDRAW, -1, -1, -1, -1, -1, 343, txt, 0, -1, }, OK) - TMII_GMII ( {, S, MIIM_TYPE|MIIM_DATA, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_TYPE|MIIM_DATA, MFT_STRING|MFT_OWNERDRAW, -9, -9, 0, -9, -9, 0, 0, 0, 0, }, - empty, OK, ER ) + TMII_INSMI( MIIM_TYPE, MFT_STRING|MFT_OWNERDRAW, -1, -1, 0, 0, 0, 343, txt, 0, 0, OK ); + TMII_GMII ( MIIM_TYPE|MIIM_DATA, 80, + MFT_STRING|MFT_OWNERDRAW, 0, 0, 0, 0, 0, 0, 0, 0, 0, + NULL, OK, ER ); TMII_DONE /* set a string menu to ownerdraw with MIIM_TYPE */ - TMII_INSMI( {, S, MIIM_TYPE, MFT_STRING, -2, -2, -2, -2, -2, -2, txt, -2, -2, }, OK) - TMII_SMII( {, S, MIIM_TYPE, MFT_OWNERDRAW, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, OK) - TMII_GMII ( {, S, MIIM_STRING|MIIM_FTYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_STRING|MIIM_FTYPE, MFT_OWNERDRAW, -9, -9, 0, -9, -9, -9, string, 4, -9, }, - txt, OK, OK ) + TMII_INSMI( MIIM_TYPE, MFT_STRING, -2, -2, 0, 0, 0, -2, txt, -2, 0, OK ); + TMII_SMII ( MIIM_TYPE, MFT_OWNERDRAW, 0, 0, 0, 0, 0, 0, 0, 0, 0 ); + TMII_GMII ( MIIM_STRING|MIIM_FTYPE, 80, + MFT_OWNERDRAW, 0, 0, 0, 0, 0, 0, string, 4, 0, + txt, OK, OK ); TMII_DONE /* test with modifymenu add submenu */ - TMII_INSMI( {, S, MIIM_STRING, MFT_STRING, -1, -1, -1, -1, -1, -1, txt, 0, -1, }, OK) - TMII_MODM( MF_POPUP, submenu, txt, OK) - TMII_GMII ( {, S, MIIM_FTYPE|MIIM_STRING|MIIM_SUBMENU, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_FTYPE|MIIM_STRING|MIIM_SUBMENU, MFT_STRING, -9, -9, submenu, -9, -9, -9, string, 4, -9, }, - txt, OK, OK ) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_TYPE, MFT_STRING, -9, -9, 0, -9, -9, -9, string, 4, 0, }, - txt, OK, OK ) + TMII_INSMI( MIIM_STRING, MFT_STRING, -1, -1, 0, 0, 0, -1, txt, 0, 0, OK ); + TMII_MODM( MF_POPUP, (UINT_PTR)submenu, txt ); + TMII_GMII ( MIIM_FTYPE|MIIM_STRING|MIIM_SUBMENU, 80, + MFT_STRING, 0, 0, submenu, 0, 0, 0, string, 4, 0, + txt, OK, OK ); + TMII_GMII ( MIIM_TYPE, 80, + MFT_STRING, 0, 0, 0, 0, 0, 0, string, 4, 0, + txt, OK, OK ); TMII_DONE /* MFT_SEPARATOR bit is kept when the text is added */ - TMII_INSMI( {, S, MIIM_STRING|MIIM_FTYPE, MFT_STRING, -1, -1, -1, -1, -1, -1, NULL, 0, -1, }, OK) - TMII_SMII( {, S, MIIM_STRING, -1, -1, -1, -1, -1, -1, -1, txt, -1, -1, }, OK) - TMII_GMII ( {, S, MIIM_STRING|MIIM_FTYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_STRING|MIIM_FTYPE, MFT_SEPARATOR, -9, -9, 0, -9, -9, -9, string, 4, -9, }, - txt, OK, OK ) + TMII_INSMI( MIIM_STRING|MIIM_FTYPE, MFT_STRING, -1, -1, 0, 0, 0, -1, NULL, 0, 0, OK ); + TMII_SMII( MIIM_STRING, 0, 0, 0, 0, 0, 0, 0, txt, 0, 0 ); + TMII_GMII ( MIIM_STRING|MIIM_FTYPE, 80, + MFT_SEPARATOR, 0, 0, 0, 0, 0, 0, string, 4, 0, + txt, OK, OK ); TMII_DONE /* MFT_SEPARATOR bit is kept when bitmap is added */ - TMII_INSMI( {, S, MIIM_STRING|MIIM_FTYPE, MFT_STRING, -1, -1, -1, -1, -1, -1, NULL, 0, -1, }, OK) - TMII_SMII( {, S, MIIM_BITMAP, -1, -1, -1, -1, -1, -1, -1, -1, -1, hbm, }, OK) - TMII_GMII ( {, S, MIIM_BITMAP|MIIM_FTYPE, -9, -9, -9, -9, -9, -9, -9, string, 80, -9, }, - {, S, MIIM_BITMAP|MIIM_FTYPE, MFT_SEPARATOR, -9, -9, 0, -9, -9, -9, string, 80, hbm, }, - init, OK, ER ) + TMII_INSMI( MIIM_STRING|MIIM_FTYPE, MFT_STRING, -1, -1, 0, 0, 0, -1, NULL, 0, 0, OK ); + TMII_SMII( MIIM_BITMAP, 0, 0, 0, 0, 0, 0, 0, 0, 0, hbm ); + TMII_GMII ( MIIM_BITMAP|MIIM_FTYPE, 80, + MFT_SEPARATOR, 0, 0, 0, 0, 0, 0, string, 80, hbm, + init, OK, ER ); TMII_DONE /* Bitmaps inserted with MIIM_TYPE and MFT_BITMAP: Only the low word of the dwTypeData is used. Use a magic bitmap here (Word 95 uses this to create its MDI menu buttons) */ - TMII_INSMI( {, S, MIIM_TYPE, MFT_BITMAP | MFT_RIGHTJUSTIFY, -1, -1, -1, -1, -1, -1, MAKELONG(HBMMENU_MBAR_CLOSE, 0x1234), -1, -1, }, OK) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, }, - {, S, MIIM_TYPE, MFT_BITMAP | MFT_RIGHTJUSTIFY, -9, -9, 0, -9, -9, -9, HBMMENU_MBAR_CLOSE, 0, HBMMENU_MBAR_CLOSE, }, - empty, OK, OK ) + TMII_INSMI( MIIM_TYPE, MFT_BITMAP | MFT_RIGHTJUSTIFY, -1, -1, 0, 0, 0, -1, + (HMENU)MAKELONG(HBMMENU_MBAR_CLOSE, 0x1234), -1, 0, OK ); + TMII_GMII ( MIIM_TYPE, 80, + MFT_BITMAP | MFT_RIGHTJUSTIFY, 0, 0, 0, 0, 0, 0, HBMMENU_MBAR_CLOSE, 0, HBMMENU_MBAR_CLOSE, + NULL, OK, OK ); TMII_DONE /* Type flags */ - TMII_INSMI( {, S, MIIM_TYPE, MFT_BITMAP | MFT_MENUBARBREAK | MFT_RADIOCHECK | MFT_RIGHTJUSTIFY | MFT_RIGHTORDER, -1, -1, -1, -1, -1, -1, hbm, -1, -1, }, OK) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, }, - {, S, MIIM_TYPE, MFT_BITMAP | MFT_MENUBARBREAK | MFT_RADIOCHECK | MFT_RIGHTJUSTIFY | MFT_RIGHTORDER, -9, -9, 0, -9, -9, -9, hbm, 0, hbm, }, - empty, OK, OK ) + TMII_INSMI( MIIM_TYPE, MFT_BITMAP | MFT_MENUBARBREAK | MFT_RADIOCHECK | MFT_RIGHTJUSTIFY | MFT_RIGHTORDER, -1, -1, 0, 0, 0, -1, hbm, -1, 0, OK ); + TMII_GMII ( MIIM_TYPE, 80, + MFT_BITMAP | MFT_MENUBARBREAK | MFT_RADIOCHECK | MFT_RIGHTJUSTIFY | MFT_RIGHTORDER, 0, 0, 0, 0, 0, 0, hbm, 0, hbm, + NULL, OK, OK ); TMII_DONE /* State flags */ - TMII_INSMI( {, S, MIIM_TYPE, MFT_BITMAP, -1, -1, -1, -1, -1, -1, hbm, -1, -1, }, OK) - TMII_SMII( {, S, MIIM_STATE, -1, MFS_CHECKED | MFS_DEFAULT | MFS_GRAYED | MFS_HILITE, -1, -1, -1, -1, -1, -1, -1, -1, }, OK) - TMII_GMII ( {, S, MIIM_STATE, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, }, - {, S, MIIM_STATE, -9, MFS_CHECKED | MFS_DEFAULT | MFS_GRAYED | MFS_HILITE, -9, 0, -9, -9, -9, -9, -9, -9, }, - empty, OK, OK ) + TMII_INSMI( MIIM_TYPE, MFT_BITMAP, -1, -1, 0, 0, 0, -1, hbm, -1, 0, OK ); + TMII_SMII( MIIM_STATE, -1, MFS_CHECKED | MFS_DEFAULT | MFS_GRAYED | MFS_HILITE, 0, 0, 0, 0, 0, 0, 0, 0 ); + TMII_GMII ( MIIM_STATE, 80, + 0, MFS_CHECKED | MFS_DEFAULT | MFS_GRAYED | MFS_HILITE, 0, 0, 0, 0, 0, 0, 80, 0, + NULL, OK, OK ); TMII_DONE /* The style MFT_RADIOCHECK cannot be set with MIIM_CHECKMARKS only */ - TMII_INSMI( {, S, MIIM_TYPE, MFT_BITMAP, -1, -1, -1, -1, -1, -1, hbm, -1, -1, }, OK) - TMII_SMII( {, S, MIIM_CHECKMARKS, MFT_RADIOCHECK, -1, -1, -1, hbm, hbm, -1, -1, -1, -1, }, OK) - TMII_GMII ( {, S, MIIM_CHECKMARKS | MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, }, - {, S, MIIM_CHECKMARKS | MIIM_TYPE, MFT_BITMAP, -9, -9, 0, hbm, hbm, -9, hbm, 0, hbm, }, - empty, OK, OK ) + TMII_INSMI( MIIM_TYPE, MFT_BITMAP, -1, -1, 0, 0, 0, -1, hbm, -1, 0, OK ); + TMII_SMII( MIIM_CHECKMARKS, MFT_RADIOCHECK, 0, 0, 0, hbm, hbm, 0, 0, 0, 0 ); + TMII_GMII ( MIIM_CHECKMARKS | MIIM_TYPE, 80, + MFT_BITMAP, 0, 0, 0, hbm, hbm, 0, hbm, 0, hbm, + NULL, OK, OK ); TMII_DONE /* MFT_BITMAP is added automatically by GetMenuItemInfo() for MIIM_TYPE */ - TMII_INSMI( {, S, MIIM_TYPE, MFT_BITMAP, -1, -1, -1, -1, -1, -1, hbm, -1, -1, }, OK) - TMII_SMII( {, S, MIIM_FTYPE, MFT_OWNERDRAW, -1, -1, -1, -1, -1, -1, 0x1234, -1, -1, }, OK) - TMII_GMII ( {, S, MIIM_FTYPE, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, }, - {, S, MIIM_FTYPE, MFT_OWNERDRAW, -9, -9, 0, -9, -9, -9, -9, -9, -9, }, - empty, OK, OK ) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, }, - {, S, MIIM_TYPE, MFT_BITMAP | MFT_OWNERDRAW, -9, -9, 0, -9, -9, -9, hbm, 0, hbm, }, - empty, OK, OK ) - TMII_GMII ( {, S, MIIM_FTYPE, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, }, - {, S, MIIM_FTYPE, MFT_OWNERDRAW, -9, -9, 0, -9, -9, -9, -9, -9, -9, }, - empty, OK, OK ) - TMII_SMII( {, S, MIIM_BITMAP, -1, -1, -1, -1, -1, -1, -1, -1, -1, NULL, }, OK) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, }, - {, S, MIIM_TYPE, MFT_OWNERDRAW, -9, -9, 0, -9, -9, -9, NULL, 0, NULL, }, - empty, OK, OK ) + TMII_INSMI( MIIM_TYPE, MFT_BITMAP, -1, -1, 0, 0, 0, -1, hbm, -1, 0, OK ); + TMII_SMII( MIIM_FTYPE, MFT_OWNERDRAW, 0, 0, 0, 0, 0, 0, (HBITMAP)0x1234, 0, 0 ); + TMII_GMII ( MIIM_FTYPE, 80, + MFT_OWNERDRAW, 0, 0, 0, 0, 0, 0, 0, 80, 0, + NULL, OK, OK ); + TMII_GMII ( MIIM_TYPE, 80, + MFT_BITMAP | MFT_OWNERDRAW, 0, 0, 0, 0, 0, 0, hbm, 0, hbm, + NULL, OK, OK ); + TMII_GMII ( MIIM_FTYPE, 80, + MFT_OWNERDRAW, 0, 0, 0, 0, 0, 0, 0, 80, 0, + NULL, OK, OK ); + TMII_SMII( MIIM_BITMAP, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL ); + TMII_GMII ( MIIM_TYPE, 80, + MFT_OWNERDRAW, 0, 0, 0, 0, 0, 0, NULL, 0, NULL, + NULL, OK, OK ); TMII_DONE /* Bitmaps inserted with MIIM_TYPE and MFT_BITMAP: Only the low word of the dwTypeData is used. Use a magic bitmap here (Word 95 uses this to create its MDI menu buttons) */ - TMII_INSMI( {, S, MIIM_TYPE, MFT_BITMAP | MFT_RIGHTJUSTIFY, -1, -1, -1, -1, -1, -1, MAKELONG(HBMMENU_MBAR_CLOSE, 0x1234), -1, -1, }, OK) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, }, - {, S, MIIM_TYPE, MFT_BITMAP | MFT_RIGHTJUSTIFY, -9, -9, 0, -9, -9, -9, HBMMENU_MBAR_CLOSE, 0, HBMMENU_MBAR_CLOSE, }, - empty, OK, OK ) + TMII_INSMI( MIIM_TYPE, MFT_BITMAP | MFT_RIGHTJUSTIFY, -1, -1, 0, 0, 0, -1, + (HMENU)MAKELONG(HBMMENU_MBAR_CLOSE, 0x1234), -1, 0, OK ); + TMII_GMII ( MIIM_TYPE, 80, + MFT_BITMAP | MFT_RIGHTJUSTIFY, 0, 0, 0, 0, 0, 0, HBMMENU_MBAR_CLOSE, 0, HBMMENU_MBAR_CLOSE, + NULL, OK, OK ); TMII_DONE /* Type flags */ - TMII_INSMI( {, S, MIIM_TYPE, MFT_BITMAP | MFT_MENUBARBREAK | MFT_RADIOCHECK | MFT_RIGHTJUSTIFY | MFT_RIGHTORDER, -1, -1, -1, -1, -1, -1, hbm, -1, -1, }, OK) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, }, - {, S, MIIM_TYPE, MFT_BITMAP | MFT_MENUBARBREAK | MFT_RADIOCHECK | MFT_RIGHTJUSTIFY | MFT_RIGHTORDER, -9, -9, 0, -9, -9, -9, hbm, 0, hbm, }, - empty, OK, OK ) + TMII_INSMI( MIIM_TYPE, MFT_BITMAP | MFT_MENUBARBREAK | MFT_RADIOCHECK | MFT_RIGHTJUSTIFY | MFT_RIGHTORDER, -1, -1, 0, 0, 0, -1, hbm, -1, 0, OK ); + TMII_GMII ( MIIM_TYPE, 80, + MFT_BITMAP | MFT_MENUBARBREAK | MFT_RADIOCHECK | MFT_RIGHTJUSTIFY | MFT_RIGHTORDER, 0, 0, 0, 0, 0, 0, hbm, 0, hbm, + NULL, OK, OK ); TMII_DONE /* State flags */ - TMII_INSMI( {, S, MIIM_TYPE, MFT_BITMAP, -1, -1, -1, -1, -1, -1, hbm, -1, -1, }, OK) - TMII_SMII( {, S, MIIM_STATE, -1, MFS_CHECKED | MFS_DEFAULT | MFS_GRAYED | MFS_HILITE, -1, -1, -1, -1, -1, -1, -1, -1, }, OK) - TMII_GMII ( {, S, MIIM_STATE, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, }, - {, S, MIIM_STATE, -9, MFS_CHECKED | MFS_DEFAULT | MFS_GRAYED | MFS_HILITE, -9, 0, -9, -9, -9, -9, -9, -9, }, - empty, OK, OK ) + TMII_INSMI( MIIM_TYPE, MFT_BITMAP, -1, -1, 0, 0, 0, -1, hbm, -1, 0, OK ); + TMII_SMII( MIIM_STATE, -1, MFS_CHECKED | MFS_DEFAULT | MFS_GRAYED | MFS_HILITE, 0, 0, 0, 0, 0, 0, 0, 0 ); + TMII_GMII ( MIIM_STATE, 80, + 0, MFS_CHECKED | MFS_DEFAULT | MFS_GRAYED | MFS_HILITE, 0, 0, 0, 0, 0, 0, 80, 0, + NULL, OK, OK ); TMII_DONE /* The style MFT_RADIOCHECK cannot be set with MIIM_CHECKMARKS only */ - TMII_INSMI( {, S, MIIM_TYPE, MFT_BITMAP, -1, -1, -1, -1, -1, -1, hbm, -1, -1, }, OK) - TMII_SMII( {, S, MIIM_CHECKMARKS, MFT_RADIOCHECK, -1, -1, -1, hbm, hbm, -1, -1, -1, -1, }, OK) - TMII_GMII ( {, S, MIIM_CHECKMARKS | MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, }, - {, S, MIIM_CHECKMARKS | MIIM_TYPE, MFT_BITMAP, -9, -9, 0, hbm, hbm, -9, hbm, 0, hbm, }, - empty, OK, OK ) + TMII_INSMI( MIIM_TYPE, MFT_BITMAP, -1, -1, 0, 0, 0, -1, hbm, -1, 0, OK ); + TMII_SMII( MIIM_CHECKMARKS, MFT_RADIOCHECK, 0, 0, 0, hbm, hbm, 0, 0, 0, 0 ); + TMII_GMII ( MIIM_CHECKMARKS | MIIM_TYPE, 80, + MFT_BITMAP, 0, 0, 0, hbm, hbm, 0, hbm, 0, hbm, + NULL, OK, OK ); TMII_DONE /* MFT_BITMAP is added automatically by GetMenuItemInfo() for MIIM_TYPE */ - TMII_INSMI( {, S, MIIM_TYPE, MFT_BITMAP, -1, -1, -1, -1, -1, -1, hbm, -1, -1, }, OK) - TMII_SMII( {, S, MIIM_FTYPE, MFT_OWNERDRAW, -1, -1, -1, -1, -1, -1, 0x1234, -1, -1, }, OK) - TMII_GMII ( {, S, MIIM_FTYPE, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, }, - {, S, MIIM_FTYPE, MFT_OWNERDRAW, -9, -9, 0, -9, -9, -9, -9, -9, -9, }, - empty, OK, OK ) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, }, - {, S, MIIM_TYPE, MFT_BITMAP | MFT_OWNERDRAW, -9, -9, 0, -9, -9, -9, hbm, 0, hbm, }, - empty, OK, OK ) - TMII_GMII ( {, S, MIIM_FTYPE, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, }, - {, S, MIIM_FTYPE, MFT_OWNERDRAW, -9, -9, 0, -9, -9, -9, -9, -9, -9, }, - empty, OK, OK ) - TMII_SMII( {, S, MIIM_BITMAP, -1, -1, -1, -1, -1, -1, -1, -1, -1, NULL, }, OK) - TMII_GMII ( {, S, MIIM_TYPE, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, }, - {, S, MIIM_TYPE, MFT_OWNERDRAW, -9, -9, 0, -9, -9, -9, NULL, 0, NULL, }, - empty, OK, OK ) + TMII_INSMI( MIIM_TYPE, MFT_BITMAP, -1, -1, 0, 0, 0, -1, hbm, -1, 0, OK ); + TMII_SMII( MIIM_FTYPE, MFT_OWNERDRAW, 0, 0, 0, 0, 0, 0, (HBITMAP)0x1234, 0, 0 ); + TMII_GMII ( MIIM_FTYPE, 80, + MFT_OWNERDRAW, 0, 0, 0, 0, 0, 0, 0, 80, 0, + NULL, OK, OK ); + TMII_GMII ( MIIM_TYPE, 80, + MFT_BITMAP | MFT_OWNERDRAW, 0, 0, 0, 0, 0, 0, hbm, 0, hbm, + NULL, OK, OK ); + TMII_GMII ( MIIM_FTYPE, 80, + MFT_OWNERDRAW, 0, 0, 0, 0, 0, 0, 0, 80, 0, + NULL, OK, OK ); + TMII_SMII( MIIM_BITMAP, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL ); + TMII_GMII ( MIIM_TYPE, 80, + MFT_OWNERDRAW, 0, 0, 0, 0, 0, 0, NULL, 0, NULL, + NULL, OK, OK ); TMII_DONE } while( !(ansi = !ansi) ); DeleteObject( hbm); diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 9ad9fdec7c1..b77a10210b2 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -8263,7 +8263,7 @@ static void test_DestroyWindow(void) { BOOL ret; HWND parent, child1, child2, child3, child4, test; - UINT child_id = WND_CHILD_ID + 1; + UINT_PTR child_id = WND_CHILD_ID + 1; parent = CreateWindowExA(0, "TestWindowClass", NULL, WS_OVERLAPPEDWINDOW, 100, 100, 200, 200, 0, 0, 0, NULL); diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 4bb495c6d15..99b58c01329 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -1972,7 +1972,7 @@ static void test_SetMenu(HWND parent) static void test_window_tree(HWND parent, const DWORD *style, const int *order, int total) { HWND child[5], hwnd; - int i; + INT_PTR i; assert(total <= 5); @@ -1993,7 +1993,7 @@ static void test_window_tree(HWND parent, const DWORD *style, const int *order, else child[i] = CreateWindowExA(0, "static", "", style[i], 0,0,10,10, parent, (HMENU)i, 0, NULL); - trace("child[%d] = %p\n", i, child[i]); + trace("child[%ld] = %p\n", i, child[i]); ok(child[i] != 0, "CreateWindowEx failed to create child window\n"); } @@ -2004,8 +2004,8 @@ static void test_window_tree(HWND parent, const DWORD *style, const int *order, for (i = 0; i < total; i++) { - trace("hwnd[%d] = %p\n", i, hwnd); - ok(child[order[i]] == hwnd, "Z order of child #%d is wrong\n", i); + trace("hwnd[%ld] = %p\n", i, hwnd); + ok(child[order[i]] == hwnd, "Z order of child #%ld is wrong\n", i); hwnd = GetWindow(hwnd, GW_HWNDNEXT); } diff --git a/dlls/user32/tests/wsprintf.c b/dlls/user32/tests/wsprintf.c index c0ca1c6703a..29e74cb0df0 100644 --- a/dlls/user32/tests/wsprintf.c +++ b/dlls/user32/tests/wsprintf.c @@ -59,12 +59,12 @@ static void wsprintfWTest(void) static void CharUpperTest(void) { - int i,out,failed; + INT_PTR i,out,failed; failed = 0; for (i=0;i<256;i++) { - out = (int) CharUpper((LPTSTR)i); + out = (INT_PTR)CharUpper((LPTSTR)i); /* printf("%0x ",out); */ if ((out >> 16) != 0) { @@ -72,17 +72,17 @@ static void CharUpperTest(void) break; } } - ok(!failed,"CharUpper failed - 16bit input (0x%0x) returned 32bit result (0x%0x)\n",i,out); + ok(!failed,"CharUpper failed - 16bit input (0x%0lx) returned 32bit result (0x%0lx)\n",i,out); } static void CharLowerTest(void) { - int i,out,failed; + INT_PTR i,out,failed; failed = 0; for (i=0;i<256;i++) { - out = (int) CharLower((LPTSTR)i); + out = (INT_PTR)CharLower((LPTSTR)i); /* printf("%0x ",out); */ if ((out >> 16) != 0) { @@ -90,7 +90,7 @@ static void CharLowerTest(void) break; } } - ok(!failed,"CharLower failed - 16bit input (0x%0x) returned 32bit result (0x%0x)\n",i,out); + ok(!failed,"CharLower failed - 16bit input (0x%0lx) returned 32bit result (0x%0lx)\n",i,out); } diff --git a/dlls/version/resource.c b/dlls/version/resource.c index fdfd3ba77aa..ef5ded25991 100644 --- a/dlls/version/resource.c +++ b/dlls/version/resource.c @@ -401,9 +401,8 @@ DWORD WINAPI GetFileResourceSize16( LPCSTR lpszFileName, LPCSTR lpszResType, OFSTRUCT ofs; DWORD reslen; - TRACE("(%s,type=0x%x,id=0x%x,off=%p)\n", - debugstr_a(lpszFileName), (LONG)lpszResType, (LONG)lpszResId, - lpszResId ); + TRACE("(%s,type=%p,id=%p,off=%p)\n", + debugstr_a(lpszFileName), lpszResType, lpszResId, lpszResId ); lzfd = LZOpenFileA( (LPSTR)lpszFileName, &ofs, OF_READ ); if ( lzfd < 0 ) return 0; diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index efb3cb8007e..cd6ba29a0b9 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -510,8 +510,7 @@ static void vshader_program_add_param(const SHADER_OPCODE_ARG *arg, const DWORD break; case WINED3DSPR_INPUT: - if (vshader_input_is_color((IWineD3DVertexShader*) This, reg)) - is_color = TRUE; + if (This->swizzle_map & (1 << reg)) is_color = TRUE; sprintf(tmpReg, "vertex.attrib[%u]", reg); strcat(hwLine, tmpReg); diff --git a/dlls/wined3d/basetexture.c b/dlls/wined3d/basetexture.c index 158650e2142..8622e94bd14 100644 --- a/dlls/wined3d/basetexture.c +++ b/dlls/wined3d/basetexture.c @@ -249,7 +249,6 @@ HRESULT basetexture_bind(IWineD3DBaseTexture *iface) glTexParameteri(textureDimensions, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); } } - } else { /* this only happened if we've run out of openGL textures */ WARN("This texture doesn't have an openGL texture assigned to it\n"); hr = WINED3DERR_INVALIDCALL; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 688b2f28c83..fb9dd6e6d9d 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -55,7 +55,7 @@ const WINED3DLIGHT WINED3D_default_light = { static void IWineD3DDeviceImpl_AddResource(IWineD3DDevice *iface, IWineD3DResource *resource); /* helper macros */ -#define D3DMEMCHECK(object, ppResult) if(NULL == object) { *ppResult = NULL; WARN("Out of memory\n"); return WINED3DERR_OUTOFVIDEOMEMORY;} +#define D3DMEMCHECK(object, ppResult) if(NULL == object) { *ppResult = NULL; ERR("Out of memory\n"); return WINED3DERR_OUTOFVIDEOMEMORY;} #define D3DCREATEOBJECTINSTANCE(object, type) { \ object=HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IWineD3D##type##Impl)); \ @@ -349,7 +349,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice* iface, /* Special case - Used during initialization to produce a placeholder stateblock so other functions called can update a state block */ - if (Type == WINED3DSBT_INIT) { + if (Type == WINED3DSBT_INIT || Type == WINED3DSBT_RECORDED) + { /* Don't bother increasing the reference count otherwise a device will never be freed due to circular dependencies */ return WINED3D_OK; @@ -1953,7 +1954,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreatePalette(IWineD3DDevice *iface, DW object->parent = Parent; object->wineD3DDevice = This; object->palNumEntries = IWineD3DPaletteImpl_Size(Flags); - object->hpal = CreatePalette((const LOGPALETTE*)&(object->palVersion)); if(!object->hpal) { @@ -2879,9 +2879,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetLight(IWineD3DDevice *iface, DWORD I if (rho < 0.0001) rho = 0.0001f; object->exponent = -0.3/log(cos(rho/2)); } - if (object->exponent > 128.0) { - object->exponent = 128.0; - } + if (object->exponent > 128.0) { + object->exponent = 128.0; + } object->cutoff = pLight->Phi*90/M_PI; /* FIXME: Range */ @@ -4704,42 +4704,22 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetDisplayMode(IWineD3DDevice *iface, U static HRESULT WINAPI IWineD3DDeviceImpl_BeginStateBlock(IWineD3DDevice *iface) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; - IWineD3DStateBlockImpl *object; - HRESULT temp_result; - int i; + IWineD3DStateBlock *stateblock; + HRESULT hr; TRACE("(%p)\n", This); - - if (This->isRecordingState) { - return WINED3DERR_INVALIDCALL; - } - - object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IWineD3DStateBlockImpl)); - if (NULL == object ) { - FIXME("(%p)Error allocating memory for stateblock\n", This); - return E_OUTOFMEMORY; - } - TRACE("(%p) created object %p\n", This, object); - object->wineD3DDevice= This; - /** FIXME: object->parent = parent; **/ - object->parent = NULL; - object->blockType = WINED3DSBT_RECORDED; - object->ref = 1; - object->lpVtbl = &IWineD3DStateBlock_Vtbl; - for(i = 0; i < LIGHTMAP_SIZE; i++) { - list_init(&object->lightMap[i]); - } + if (This->isRecordingState) return WINED3DERR_INVALIDCALL; - temp_result = allocate_shader_constants(object); - if (WINED3D_OK != temp_result) - return temp_result; + hr = IWineD3DDeviceImpl_CreateStateBlock(iface, WINED3DSBT_RECORDED, &stateblock, NULL); + if (FAILED(hr)) return hr; IWineD3DStateBlock_Release((IWineD3DStateBlock*)This->updateStateBlock); - This->updateStateBlock = object; + This->updateStateBlock = (IWineD3DStateBlockImpl *)stateblock; This->isRecordingState = TRUE; - TRACE("(%p) recording stateblock %p\n",This , object); + TRACE("(%p) recording stateblock %p\n", This, stateblock); + return WINED3D_OK; } diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index e505ec0f1c7..639b07ec35c 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -114,6 +114,7 @@ static const struct { {"GL_EXT_texture_filter_anisotropic", EXT_TEXTURE_FILTER_ANISOTROPIC, 0 }, {"GL_EXT_texture_lod", EXT_TEXTURE_LOD, 0 }, {"GL_EXT_texture_lod_bias", EXT_TEXTURE_LOD_BIAS, 0 }, + {"GL_EXT_vertex_array_bgra", EXT_VERTEX_ARRAY_BGRA, 0 }, {"GL_EXT_vertex_shader", EXT_VERTEX_SHADER, 0 }, {"GL_EXT_gpu_program_parameters", EXT_GPU_PROGRAM_PARAMETERS, 0 }, @@ -519,8 +520,7 @@ static BOOL IWineD3DImpl_FillGLCaps(WineD3D_GL_Info *gl_info) { ENTER_GL(); gl_string = (const char *) glGetString(GL_RENDERER); - if (NULL == gl_string) - gl_string = "None"; + if (!gl_string) gl_string = "None"; strcpy(gl_info->gl_renderer, gl_string); gl_string = (const char *) glGetString(GL_VENDOR); @@ -743,7 +743,7 @@ static BOOL IWineD3DImpl_FillGLCaps(WineD3D_GL_Info *gl_info) { gl_info->max_texture_size = gl_max; TRACE_(d3d_caps)("Maximum texture size support - max texture size=%d\n", gl_max); - glGetFloatv(GL_POINT_SIZE_RANGE, gl_floatv); + glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, gl_floatv); gl_info->max_pointsizemin = gl_floatv[0]; gl_info->max_pointsize = gl_floatv[1]; TRACE_(d3d_caps)("Maximum point size support - max point size=%f\n", gl_floatv[1]); @@ -3151,11 +3151,11 @@ static HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter, pCaps->RasterCaps |= WINED3DPRASTERCAPS_FOGRANGE; } /* FIXME Add: - WINED3DPRASTERCAPS_COLORPERSPECTIVE - WINED3DPRASTERCAPS_STRETCHBLTMULTISAMPLE - WINED3DPRASTERCAPS_ANTIALIASEDGES - WINED3DPRASTERCAPS_ZBUFFERLESSHSR - WINED3DPRASTERCAPS_WBUFFER */ + WINED3DPRASTERCAPS_COLORPERSPECTIVE + WINED3DPRASTERCAPS_STRETCHBLTMULTISAMPLE + WINED3DPRASTERCAPS_ANTIALIASEDGES + WINED3DPRASTERCAPS_ZBUFFERLESSHSR + WINED3DPRASTERCAPS_WBUFFER */ pCaps->ZCmpCaps = WINED3DPCMPCAPS_ALWAYS | WINED3DPCMPCAPS_EQUAL | diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c index f7443f21b0d..b78078fd85a 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c @@ -152,12 +152,13 @@ void primitiveDeclarationConvertToStridedData( const DWORD *streams = vertexDeclaration->streams; /* Check for transformed vertices, disable vertex shader if present */ - strided->u.s.position_transformed = vertexDeclaration->position_transformed; + strided->position_transformed = vertexDeclaration->position_transformed; if(vertexDeclaration->position_transformed) { useVertexShaderFunction = FALSE; } /* Translate the declaration into strided data */ + strided->swizzle_map = 0; for (i = 0 ; i < vertexDeclaration->declarationWNumElements - 1; ++i) { GLint streamVBO = 0; BOOL stride_used; @@ -201,8 +202,8 @@ void primitiveDeclarationConvertToStridedData( element->Usage == WINED3DDECLUSAGE_POSITIONT)) { static BOOL warned = FALSE; if(!warned) { - /* This may be bad with the fixed function pipeline */ - FIXME("Missing vbo streams with unfixed colors or transformed position, expect problems\n"); + /* This may be bad with the fixed function pipeline */ + FIXME("Missing vbo streams with unfixed colors or transformed position, expect problems\n"); warned = TRUE; } } @@ -234,6 +235,11 @@ void primitiveDeclarationConvertToStridedData( strided->u.input[idx].dwStride = stride; strided->u.input[idx].VBO = streamVBO; strided->u.input[idx].streamNo = element->Stream; + if (!GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA) && element->Type == WINED3DDECLTYPE_D3DCOLOR) + { + strided->swizzle_map |= 1 << idx; + } + strided->use_map |= 1 << idx; } } } @@ -253,33 +259,35 @@ void primitiveDeclarationConvertToStridedData( } } -static void drawStridedFast(IWineD3DDevice *iface, UINT numberOfVertices, GLenum glPrimitiveType, - const void *idxData, short idxSize, ULONG minIndex, ULONG startIdx) +static void drawStridedFast(IWineD3DDevice *iface, GLenum primitive_type, + UINT min_vertex_idx, UINT max_vertex_idx, UINT count, short idx_size, + const void *idx_data, UINT start_idx) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; - if (idxSize != 0 /* This crashes sometimes!*/) { - TRACE("(%p) : glElements(%x, %d, %d, ...)\n", This, glPrimitiveType, numberOfVertices, minIndex); - idxData = idxData == (void *)-1 ? NULL : idxData; + if (idx_size) + { + TRACE("(%p) : glElements(%x, %d, %d, ...)\n", This, primitive_type, count, min_vertex_idx); + #if 1 - glDrawElements(glPrimitiveType, numberOfVertices, idxSize == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, - (const char *)idxData+(idxSize * startIdx)); + glDrawElements(primitive_type, count, + idx_size == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, + (const char *)idx_data + (idx_size * start_idx)); checkGLcall("glDrawElements"); -#else /* using drawRangeElements may be faster */ - - glDrawRangeElements(glPrimitiveType, minIndex, minIndex + numberOfVertices - 1, numberOfVertices, - idxSize == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, - (const char *)idxData+(idxSize * startIdx)); +#else + glDrawRangeElements(primitive_type, min_vertex_idx, max_vertex_idx, count, + idx_size == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, + (const char *)idx_data + (idx_size * start_idx)); checkGLcall("glDrawRangeElements"); #endif + } + else + { + TRACE("(%p) : glDrawArrays(%#x, %d, %d)\n", This, primitive_type, start_idx, count); - } else { - TRACE("(%p) : glDrawArrays(%#x, %d, %d)\n", This, glPrimitiveType, startIdx, numberOfVertices); - glDrawArrays(glPrimitiveType, startIdx, numberOfVertices); + glDrawArrays(primitive_type, start_idx, count); checkGLcall("glDrawArrays"); } - - return; } /* @@ -679,7 +687,6 @@ static inline void drawStridedInstanced(IWineD3DDevice *iface, const WineDirect3 } TRACE("(%p) : glElements(%x, %d, %d, ...)\n", This, glPrimitiveType, numberOfVertices, minIndex); - idxData = idxData == (void *)-1 ? NULL : idxData; /* First, figure out how many instances we have to draw */ for(i = 0; i < MAX_STREAMS; i++) { @@ -859,8 +866,9 @@ void drawPrimitive(IWineD3DDevice *iface, int PrimitiveType, long NumPrimitives, if (!use_vs(This->stateBlock)) { - if(!This->strided_streams.u.s.position_transformed && This->activeContext->num_untracked_materials && - This->stateBlock->renderState[WINED3DRS_LIGHTING]) { + if (!This->strided_streams.position_transformed && This->activeContext->num_untracked_materials + && This->stateBlock->renderState[WINED3DRS_LIGHTING]) + { static BOOL warned; if (!warned) { FIXME("Using software emulation because not all material properties could be tracked\n"); @@ -913,8 +921,8 @@ void drawPrimitive(IWineD3DDevice *iface, int PrimitiveType, long NumPrimitives, drawStridedInstanced(iface, &This->strided_streams, calculatedNumberOfindices, glPrimType, idxData, idxSize, minIndex, StartIdx); } else { - drawStridedFast(iface, calculatedNumberOfindices, glPrimType, - idxData, idxSize, minIndex, StartIdx); + drawStridedFast(iface, glPrimType, minIndex, minIndex + numberOfVertices - 1, + calculatedNumberOfindices, idxSize, idxData, StartIdx); } } @@ -1025,9 +1033,8 @@ HRESULT tesselate_rectpatch(IWineD3DDeviceImpl *This, vtxStride * info->StartVertexOffsetWidth; /* Not entirely sure about what happens with transformed vertices */ - if(strided.u.s.position_transformed) { - FIXME("Transformed position in rectpatch generation\n"); - } + if (strided.position_transformed) FIXME("Transformed position in rectpatch generation\n"); + if(vtxStride % sizeof(GLfloat)) { /* glMap2f reads vertex sizes in GLfloats, the d3d stride is in bytes. * I don't see how the stride could not be a multiple of 4, but make sure diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index eb169e0ef9c..0acdcad5457 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -1030,8 +1030,7 @@ static void shader_glsl_get_register_name(const DWORD param, const DWORD addr_to strcpy(tmpStr, "gl_SecondaryColor"); } } else { - if (vshader_input_is_color((IWineD3DVertexShader*) This, reg)) - *is_color = TRUE; + if (((IWineD3DVertexShaderImpl *)This)->swizzle_map & (1 << reg)) *is_color = TRUE; sprintf(tmpStr, "attrib%u", reg); } break; diff --git a/dlls/wined3d/palette.c b/dlls/wined3d/palette.c index 8f6e37a9013..338e66e0906 100644 --- a/dlls/wined3d/palette.c +++ b/dlls/wined3d/palette.c @@ -1,4 +1,4 @@ -/* DirectDraw - IDirectPalette base interface +/* DirectDraw - IDirectPalette base interface * * Copyright 1997-2000 Marcus Meissner * Copyright 2000-2001 TransGaming Technologies Inc. diff --git a/dlls/wined3d/pixelshader.c b/dlls/wined3d/pixelshader.c index 1a337ca990e..9f96c59c0fa 100644 --- a/dlls/wined3d/pixelshader.c +++ b/dlls/wined3d/pixelshader.c @@ -477,7 +477,8 @@ void find_ps_compile_args(IWineD3DPixelShaderImpl *shader, IWineD3DStateBlockImp } if (shader->baseShader.reg_maps.shader_version >= WINED3DPS_VERSION(3,0)) { - if(((IWineD3DDeviceImpl *) shader->baseShader.device)->strided_streams.u.s.position_transformed) { + if (((IWineD3DDeviceImpl *)shader->baseShader.device)->strided_streams.position_transformed) + { args->vp_mode = pretransformed; } else if (use_vs(stateblock)) @@ -492,7 +493,7 @@ void find_ps_compile_args(IWineD3DPixelShaderImpl *shader, IWineD3DStateBlockImp if(stateblock->renderState[WINED3DRS_FOGENABLE]) { switch(stateblock->renderState[WINED3DRS_FOGTABLEMODE]) { case WINED3DFOG_NONE: - if (((IWineD3DDeviceImpl *)shader->baseShader.device)->strided_streams.u.s.position_transformed + if (((IWineD3DDeviceImpl *)shader->baseShader.device)->strided_streams.position_transformed || use_vs(stateblock)) { args->fog = FOG_LINEAR; diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index de4e3327dbb..b054ee14ab7 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -95,7 +95,7 @@ static void state_lighting(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine transformed = ((stateblock->wineD3DDevice->strided_streams.u.s.position.lpData != NULL || stateblock->wineD3DDevice->strided_streams.u.s.position.VBO != 0) && - stateblock->wineD3DDevice->strided_streams.u.s.position_transformed) ? TRUE : FALSE; + stateblock->wineD3DDevice->strided_streams.position_transformed) ? TRUE : FALSE; if (stateblock->renderState[WINED3DRS_LIGHTING] && !transformed) { glEnable(GL_LIGHTING); @@ -3114,7 +3114,7 @@ static void loadTexCoords(IWineD3DStateBlockImpl *stateblock, const WineDirect3D /* The coords to supply depend completely on the fvf / vertex shader */ glTexCoordPointer( - WINED3D_ATR_SIZE(sd->u.s.texCoords[coordIdx].dwType), + WINED3D_ATR_FORMAT(sd->u.s.texCoords[coordIdx].dwType), WINED3D_ATR_GLTYPE(sd->u.s.texCoords[coordIdx].dwType), sd->u.s.texCoords[coordIdx].dwStride, sd->u.s.texCoords[coordIdx].lpData + stateblock->loadBaseVertexIndex * sd->u.s.texCoords[coordIdx].dwStride + offset[sd->u.s.texCoords[coordIdx].streamNo]); @@ -3900,7 +3900,7 @@ static inline void loadNumberedArrays(IWineD3DStateBlockImpl *stateblock, stateblock->wineD3DDevice->instancedDraw = FALSE; for (i = 0; i < MAX_ATTRIBS; i++) { - if (!strided->u.input[i].VBO && !strided->u.input[i].lpData) + if (!(strided->use_map & (1 << i))) { if (context->numbered_array_mask & (1 << i)) unload_numbered_array(stateblock, context, i); continue; @@ -3934,7 +3934,7 @@ static inline void loadNumberedArrays(IWineD3DStateBlockImpl *stateblock, shift_index = ((DWORD_PTR) strided->u.input[i].lpData + offset[strided->u.input[i].streamNo]); shift_index = shift_index % strided->u.input[i].dwStride; GL_EXTCALL(glVertexAttribPointerARB(i, - WINED3D_ATR_SIZE(strided->u.input[i].dwType), + WINED3D_ATR_FORMAT(strided->u.input[i].dwType), WINED3D_ATR_GLTYPE(strided->u.input[i].dwType), WINED3D_ATR_NORMALIZED(strided->u.input[i].dwType), vb->conv_stride, @@ -3945,7 +3945,7 @@ static inline void loadNumberedArrays(IWineD3DStateBlockImpl *stateblock, } else { GL_EXTCALL(glVertexAttribPointerARB(i, - WINED3D_ATR_SIZE(strided->u.input[i].dwType), + WINED3D_ATR_FORMAT(strided->u.input[i].dwType), WINED3D_ATR_GLTYPE(strided->u.input[i].dwType), WINED3D_ATR_NORMALIZED(strided->u.input[i].dwType), strided->u.input[i].dwStride, @@ -4066,16 +4066,16 @@ static void loadVertexData(IWineD3DStateBlockImpl *stateblock, const WineDirect3 (sd->u.s.blendMatrixIndices.lpData) || (sd->u.s.blendMatrixIndices.VBO) ) { if (GL_SUPPORT(ARB_VERTEX_BLEND)) { - TRACE("Blend %d %p %d\n", WINED3D_ATR_SIZE(sd->u.s.blendWeights.dwType), + TRACE("Blend %d %p %d\n", WINED3D_ATR_FORMAT(sd->u.s.blendWeights.dwType), sd->u.s.blendWeights.lpData + stateblock->loadBaseVertexIndex * sd->u.s.blendWeights.dwStride, sd->u.s.blendWeights.dwStride + offset[sd->u.s.blendWeights.streamNo]); glEnableClientState(GL_WEIGHT_ARRAY_ARB); checkGLcall("glEnableClientState(GL_WEIGHT_ARRAY_ARB)"); - GL_EXTCALL(glVertexBlendARB(WINED3D_ATR_SIZE(sd->u.s.blendWeights.dwType) + 1)); + GL_EXTCALL(glVertexBlendARB(WINED3D_ATR_FORMAT(sd->u.s.blendWeights.dwType) + 1)); VTRACE(("glWeightPointerARB(%d, GL_FLOAT, %d, %p)\n", - WINED3D_ATR_SIZE(sd->u.s.blendWeights.dwType) , + WINED3D_ATR_FORMAT(sd->u.s.blendWeights.dwType) , sd->u.s.blendWeights.dwStride, sd->u.s.blendWeights.lpData + stateblock->loadBaseVertexIndex * sd->u.s.blendWeights.dwStride + offset[sd->u.s.blendWeights.streamNo])); @@ -4086,7 +4086,7 @@ static void loadVertexData(IWineD3DStateBlockImpl *stateblock, const WineDirect3 } GL_EXTCALL(glWeightPointerARB)( - WINED3D_ATR_SIZE(sd->u.s.blendWeights.dwType), + WINED3D_ATR_FORMAT(sd->u.s.blendWeights.dwType), WINED3D_ATR_GLTYPE(sd->u.s.blendWeights.dwType), sd->u.s.blendWeights.dwStride, sd->u.s.blendWeights.lpData + stateblock->loadBaseVertexIndex * sd->u.s.blendWeights.dwStride + offset[sd->u.s.blendWeights.streamNo]); @@ -4138,7 +4138,7 @@ static void loadVertexData(IWineD3DStateBlockImpl *stateblock, const WineDirect3 curVBO = sd->u.s.position.VBO; } - /* min(WINED3D_ATR_SIZE(position),3) to Disable RHW mode as 'w' coord + /* min(WINED3D_ATR_FORMAT(position),3) to Disable RHW mode as 'w' coord handling for rhw mode should not impact screen position whereas in GL it does. This may result in very slightly distorted textures in rhw mode. There's always the other option of fixing the view matrix to @@ -4147,12 +4147,12 @@ static void loadVertexData(IWineD3DStateBlockImpl *stateblock, const WineDirect3 This only applies to user pointer sources, in VBOs the vertices are fixed up */ if(sd->u.s.position.VBO == 0) { - glVertexPointer(3 /* min(WINED3D_ATR_SIZE(sd->u.s.position.dwType),3) */, + glVertexPointer(3 /* min(WINED3D_ATR_FORMAT(sd->u.s.position.dwType),3) */, WINED3D_ATR_GLTYPE(sd->u.s.position.dwType), sd->u.s.position.dwStride, sd->u.s.position.lpData + stateblock->loadBaseVertexIndex * sd->u.s.position.dwStride + offset[sd->u.s.position.streamNo]); } else { glVertexPointer( - WINED3D_ATR_SIZE(sd->u.s.position.dwType), + WINED3D_ATR_FORMAT(sd->u.s.position.dwType), WINED3D_ATR_GLTYPE(sd->u.s.position.dwType), sd->u.s.position.dwStride, sd->u.s.position.lpData + stateblock->loadBaseVertexIndex * sd->u.s.position.dwStride + offset[sd->u.s.position.streamNo]); } @@ -4206,7 +4206,7 @@ static void loadVertexData(IWineD3DStateBlockImpl *stateblock, const WineDirect3 curVBO = sd->u.s.diffuse.VBO; } - glColorPointer(WINED3D_ATR_SIZE(sd->u.s.diffuse.dwType), + glColorPointer(WINED3D_ATR_FORMAT(sd->u.s.diffuse.dwType), WINED3D_ATR_GLTYPE(sd->u.s.diffuse.dwType), sd->u.s.diffuse.dwStride, sd->u.s.diffuse.lpData + stateblock->loadBaseVertexIndex * sd->u.s.diffuse.dwStride + offset[sd->u.s.diffuse.streamNo]); @@ -4232,7 +4232,7 @@ static void loadVertexData(IWineD3DStateBlockImpl *stateblock, const WineDirect3 checkGLcall("glBindBufferARB"); curVBO = sd->u.s.specular.VBO; } - GL_EXTCALL(glSecondaryColorPointerEXT)(WINED3D_ATR_SIZE(sd->u.s.specular.dwType), + GL_EXTCALL(glSecondaryColorPointerEXT)(WINED3D_ATR_FORMAT(sd->u.s.specular.dwType), WINED3D_ATR_GLTYPE(sd->u.s.specular.dwType), sd->u.s.specular.dwStride, sd->u.s.specular.lpData + stateblock->loadBaseVertexIndex * sd->u.s.specular.dwStride + offset[sd->u.s.specular.streamNo]); @@ -4321,9 +4321,7 @@ static void streamsrc(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCo useVertexShaderFunction, dataLocations, &fixup); } - if (dataLocations->u.s.position_transformed) { - useVertexShaderFunction = FALSE; - } + if (dataLocations->position_transformed) useVertexShaderFunction = FALSE; if(useVertexShaderFunction) { if(((IWineD3DVertexDeclarationImpl *) stateblock->vertexDecl)->half_float_conv_needed && !fixup) { @@ -4333,7 +4331,7 @@ static void streamsrc(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCo load_numbered = TRUE; device->useDrawStridedSlow = FALSE; } - } else if (fixup || + } else if (fixup || GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA) || (dataLocations->u.s.pSize.lpData == NULL && dataLocations->u.s.diffuse.lpData == NULL && dataLocations->u.s.specular.lpData == NULL)) { @@ -4403,7 +4401,7 @@ static void vertexdeclaration(DWORD state, IWineD3DStateBlockImpl *stateblock, W updateFog = TRUE; } - transformed = device->strided_streams.u.s.position_transformed; + transformed = device->strided_streams.position_transformed; if(transformed != context->last_was_rhw && !useVertexShaderFunction) { updateFog = TRUE; } diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 28377406803..771291f0651 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1320,7 +1320,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_UnlockRect(IWineD3DSurface *iface) { if (!(This->Flags & SFLAG_LOCKED)) { WARN("trying to Unlock an unlocked surf@%p\n", This); - return WINED3DERR_INVALIDCALL; + return WINEDDERR_NOTLOCKED; } if (This->Flags & SFLAG_PBO) { @@ -1830,7 +1830,7 @@ static HRESULT d3dfmt_convert_surface(const BYTE *src, BYTE *dst, UINT pitch, UI Dest = (WORD *) (dst + y * outpitch); for (x = 0; x < width; x++ ) { WORD color = *Source++; - *Dest = color; + *Dest = color; if ((color < This->SrcBltCKey.dwColorSpaceLowValue) || (color > This->SrcBltCKey.dwColorSpaceHighValue)) { *Dest |= (1 << 15); diff --git a/dlls/wined3d/surface_gdi.c b/dlls/wined3d/surface_gdi.c index 07a13b5c678..4a8f6faf7cc 100644 --- a/dlls/wined3d/surface_gdi.c +++ b/dlls/wined3d/surface_gdi.c @@ -168,7 +168,7 @@ IWineGDISurfaceImpl_UnlockRect(IWineD3DSurface *iface) if (!(This->Flags & SFLAG_LOCKED)) { WARN("trying to Unlock an unlocked surf@%p\n", This); - return WINED3DERR_INVALIDCALL; + return WINEDDERR_NOTLOCKED; } /* Can be useful for debugging */ @@ -341,7 +341,7 @@ const char* filename) for (y = 0; y < This->pow2Height; y++) { const unsigned char *src = This->resource.allocatedMemory + (y * 1 * IWineD3DSurface_GetPitch(iface)); - for (x = 0; x < This->pow2Width; x++) { + for (x = 0; x < This->pow2Width; x++) { unsigned int color; unsigned int comp; int i; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 67ab32b7c17..cc09584b726 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -482,33 +482,42 @@ BOOL initPixelFormats(WineD3D_GL_Info *gl_info) } /* NOTE: Make sure these are in the correct numerical order. (see /include/wined3d_types.h) */ -static WINED3DGLTYPE const glTypeLookupTemplate[WINED3DDECLTYPE_UNUSED] = { - {WINED3DDECLTYPE_FLOAT1, 1, GL_FLOAT , GL_FALSE ,sizeof(float)}, - {WINED3DDECLTYPE_FLOAT2, 2, GL_FLOAT , GL_FALSE ,sizeof(float)}, - {WINED3DDECLTYPE_FLOAT3, 3, GL_FLOAT , GL_FALSE ,sizeof(float)}, - {WINED3DDECLTYPE_FLOAT4, 4, GL_FLOAT , GL_FALSE ,sizeof(float)}, - {WINED3DDECLTYPE_D3DCOLOR, 4, GL_UNSIGNED_BYTE , GL_TRUE ,sizeof(BYTE)}, - {WINED3DDECLTYPE_UBYTE4, 4, GL_UNSIGNED_BYTE , GL_FALSE ,sizeof(BYTE)}, - {WINED3DDECLTYPE_SHORT2, 2, GL_SHORT , GL_FALSE ,sizeof(short int)}, - {WINED3DDECLTYPE_SHORT4, 4, GL_SHORT , GL_FALSE ,sizeof(short int)}, - {WINED3DDECLTYPE_UBYTE4N, 4, GL_UNSIGNED_BYTE , GL_TRUE ,sizeof(BYTE)}, - {WINED3DDECLTYPE_SHORT2N, 2, GL_SHORT , GL_TRUE ,sizeof(short int)}, - {WINED3DDECLTYPE_SHORT4N, 4, GL_SHORT , GL_TRUE ,sizeof(short int)}, - {WINED3DDECLTYPE_USHORT2N, 2, GL_UNSIGNED_SHORT , GL_TRUE ,sizeof(short int)}, - {WINED3DDECLTYPE_USHORT4N, 4, GL_UNSIGNED_SHORT , GL_TRUE ,sizeof(short int)}, - {WINED3DDECLTYPE_UDEC3, 3, GL_UNSIGNED_SHORT , GL_FALSE ,sizeof(short int)}, - {WINED3DDECLTYPE_DEC3N, 3, GL_SHORT , GL_TRUE ,sizeof(short int)}, - {WINED3DDECLTYPE_FLOAT16_2, 2, GL_HALF_FLOAT_NV , GL_FALSE ,sizeof(GLhalfNV)}, - {WINED3DDECLTYPE_FLOAT16_4, 4, GL_HALF_FLOAT_NV , GL_FALSE ,sizeof(GLhalfNV)}}; +static WINED3DGLTYPE const glTypeLookupTemplate[WINED3DDECLTYPE_UNUSED] = +{ + {WINED3DDECLTYPE_FLOAT1, 1, GL_FLOAT, 1, GL_FALSE, sizeof(float)}, + {WINED3DDECLTYPE_FLOAT2, 2, GL_FLOAT, 2, GL_FALSE, sizeof(float)}, + {WINED3DDECLTYPE_FLOAT3, 3, GL_FLOAT, 3, GL_FALSE, sizeof(float)}, + {WINED3DDECLTYPE_FLOAT4, 4, GL_FLOAT, 4, GL_FALSE, sizeof(float)}, + {WINED3DDECLTYPE_D3DCOLOR, 4, GL_UNSIGNED_BYTE, 4, GL_TRUE, sizeof(BYTE)}, + {WINED3DDECLTYPE_UBYTE4, 4, GL_UNSIGNED_BYTE, 4, GL_FALSE, sizeof(BYTE)}, + {WINED3DDECLTYPE_SHORT2, 2, GL_SHORT, 2, GL_FALSE, sizeof(short int)}, + {WINED3DDECLTYPE_SHORT4, 4, GL_SHORT, 4, GL_FALSE, sizeof(short int)}, + {WINED3DDECLTYPE_UBYTE4N, 4, GL_UNSIGNED_BYTE, 4, GL_TRUE, sizeof(BYTE)}, + {WINED3DDECLTYPE_SHORT2N, 2, GL_SHORT, 2, GL_TRUE, sizeof(short int)}, + {WINED3DDECLTYPE_SHORT4N, 4, GL_SHORT, 4, GL_TRUE, sizeof(short int)}, + {WINED3DDECLTYPE_USHORT2N, 2, GL_UNSIGNED_SHORT, 2, GL_TRUE, sizeof(short int)}, + {WINED3DDECLTYPE_USHORT4N, 4, GL_UNSIGNED_SHORT, 4, GL_TRUE, sizeof(short int)}, + {WINED3DDECLTYPE_UDEC3, 3, GL_UNSIGNED_SHORT, 3, GL_FALSE, sizeof(short int)}, + {WINED3DDECLTYPE_DEC3N, 3, GL_SHORT, 3, GL_TRUE, sizeof(short int)}, + {WINED3DDECLTYPE_FLOAT16_2, 2, GL_FLOAT, 2, GL_FALSE, sizeof(GLhalfNV)}, + {WINED3DDECLTYPE_FLOAT16_4, 4, GL_FLOAT, 4, GL_FALSE, sizeof(GLhalfNV)} +}; void init_type_lookup(WineD3D_GL_Info *gl_info) { memcpy(gl_info->glTypeLookup, glTypeLookupTemplate, sizeof(glTypeLookupTemplate)); - if(!GL_SUPPORT(NV_HALF_FLOAT)) { + + if (GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA)) + { + gl_info->glTypeLookup[WINED3DDECLTYPE_D3DCOLOR].format = GL_BGRA; + } + + if (GL_SUPPORT(NV_HALF_FLOAT)) + { /* Do not change the size of the type, it is CPU side. We have to change the GPU-side information though. * It is the job of the vertex buffer code to make sure that the vbos have the right format */ - gl_info->glTypeLookup[WINED3DDECLTYPE_FLOAT16_2].glType = GL_FLOAT; - gl_info->glTypeLookup[WINED3DDECLTYPE_FLOAT16_4].glType = GL_FLOAT; + gl_info->glTypeLookup[WINED3DDECLTYPE_FLOAT16_2].glType = GL_HALF_FLOAT_NV; + gl_info->glTypeLookup[WINED3DDECLTYPE_FLOAT16_4].glType = GL_HALF_FLOAT_NV; } } diff --git a/dlls/wined3d/vertexbuffer.c b/dlls/wined3d/vertexbuffer.c index b0a6296b731..0408819122c 100644 --- a/dlls/wined3d/vertexbuffer.c +++ b/dlls/wined3d/vertexbuffer.c @@ -364,10 +364,11 @@ static inline BOOL IWineD3DVertexBufferImpl_FindDecl(IWineD3DVertexBufferImpl *T * FLOAT16s if not supported. Also, we can't iterate over the array, so use macros to generate code for all * the attributes that our current fixed function pipeline implementation cares for. */ + BOOL support_d3dcolor = GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA); ret = check_attribute(This, &device->strided_streams.u.s.position, TRUE, TRUE, FALSE, &stride_this_run, &float16_used) || ret; ret = check_attribute(This, &device->strided_streams.u.s.normal, TRUE, FALSE, FALSE, &stride_this_run, &float16_used) || ret; - ret = check_attribute(This, &device->strided_streams.u.s.diffuse, TRUE, FALSE, TRUE, &stride_this_run, &float16_used) || ret; - ret = check_attribute(This, &device->strided_streams.u.s.specular, TRUE, FALSE, TRUE, &stride_this_run, &float16_used) || ret; + ret = check_attribute(This, &device->strided_streams.u.s.diffuse, !support_d3dcolor, FALSE, TRUE, &stride_this_run, &float16_used) || ret; + ret = check_attribute(This, &device->strided_streams.u.s.specular, !support_d3dcolor, FALSE, TRUE, &stride_this_run, &float16_used) || ret; ret = check_attribute(This, &device->strided_streams.u.s.texCoords[0], TRUE, FALSE, FALSE, &stride_this_run, &float16_used) || ret; ret = check_attribute(This, &device->strided_streams.u.s.texCoords[1], TRUE, FALSE, FALSE, &stride_this_run, &float16_used) || ret; ret = check_attribute(This, &device->strided_streams.u.s.texCoords[2], TRUE, FALSE, FALSE, &stride_this_run, &float16_used) || ret; diff --git a/dlls/wined3d/vertexdeclaration.c b/dlls/wined3d/vertexdeclaration.c index 7fc711b4521..f63e2e7ed23 100644 --- a/dlls/wined3d/vertexdeclaration.c +++ b/dlls/wined3d/vertexdeclaration.c @@ -207,7 +207,7 @@ static HRESULT WINAPI IWineD3DVertexDeclarationImpl_SetDeclaration(IWineD3DVerte const WINED3DVERTEXELEMENT *elements, UINT element_count) { IWineD3DVertexDeclarationImpl *This = (IWineD3DVertexDeclarationImpl *)iface; HRESULT hr = WINED3D_OK; - int i, j; + int i; char isPreLoaded[MAX_STREAMS]; TRACE("(%p) : d3d version %d\n", This, ((IWineD3DImpl *)This->wineD3DDevice->wineD3D)->dxVersion); @@ -263,39 +263,13 @@ static HRESULT WINAPI IWineD3DVertexDeclarationImpl_SetDeclaration(IWineD3DVerte isPreLoaded[This->pDeclarationWine[i].Stream] = 1; } - /* Create a sorted array containing the attribute declarations that are of type - * D3DCOLOR. D3DCOLOR requires swizzling of the r and b component, and if the - * declaration of one attribute changes the vertex shader needs recompilation. - * Having a sorted array of the attributes allows efficient comparison of the - * declaration against a shader - */ - if(This->pDeclarationWine[i].Type == WINED3DDECLTYPE_D3DCOLOR) { - for(j = 0; j < This->num_swizzled_attribs; j++) { - if(This->swizzled_attribs[j].usage > This->pDeclarationWine[i].Usage || - (This->swizzled_attribs[j].usage == This->pDeclarationWine[i].Usage && - This->swizzled_attribs[j].idx > This->pDeclarationWine[i].UsageIndex)) { - memmove(&This->swizzled_attribs[j + 1], &This->swizzled_attribs[j], - sizeof(This->swizzled_attribs) - (sizeof(This->swizzled_attribs[0]) * (j + 1))); - break; - } - } - - This->swizzled_attribs[j].usage = This->pDeclarationWine[i].Usage; - This->swizzled_attribs[j].idx = This->pDeclarationWine[i].UsageIndex; - This->num_swizzled_attribs++; - } else if(This->pDeclarationWine[i].Type == WINED3DDECLTYPE_FLOAT16_2 || - This->pDeclarationWine[i].Type == WINED3DDECLTYPE_FLOAT16_4) { - if(!GL_SUPPORT(NV_HALF_FLOAT)) { - This->half_float_conv_needed = TRUE; - } + if (This->pDeclarationWine[i].Type == WINED3DDECLTYPE_FLOAT16_2 + || This->pDeclarationWine[i].Type == WINED3DDECLTYPE_FLOAT16_4) + { + if (!GL_SUPPORT(NV_HALF_FLOAT)) This->half_float_conv_needed = TRUE; } } - TRACE("Swizzled attributes found:\n"); - for(i = 0; i < This->num_swizzled_attribs; i++) { - TRACE("%u: %s%d\n", i, - debug_d3ddeclusage(This->swizzled_attribs[i].usage), This->swizzled_attribs[i].idx); - } TRACE("Returning\n"); return hr; } diff --git a/dlls/wined3d/vertexshader.c b/dlls/wined3d/vertexshader.c index 9091c8a9968..339d955e230 100644 --- a/dlls/wined3d/vertexshader.c +++ b/dlls/wined3d/vertexshader.c @@ -218,113 +218,15 @@ BOOL vshader_get_input( return FALSE; } -BOOL vshader_input_is_color( - IWineD3DVertexShader* iface, - unsigned int regnum) { - - IWineD3DVertexShaderImpl* This = (IWineD3DVertexShaderImpl*) iface; - - DWORD usage_token = This->semantics_in[regnum].usage; - DWORD usage = (usage_token & WINED3DSP_DCL_USAGE_MASK) >> WINED3DSP_DCL_USAGE_SHIFT; - DWORD usage_idx = (usage_token & WINED3DSP_DCL_USAGEINDEX_MASK) >> WINED3DSP_DCL_USAGEINDEX_SHIFT; - - int i; - - for(i = 0; i < This->num_swizzled_attribs; i++) { - if(This->swizzled_attribs[i].usage == usage && - This->swizzled_attribs[i].idx == usage_idx) { - return TRUE; - } - } - return FALSE; -} - -static inline void find_swizzled_attribs(IWineD3DVertexDeclaration *declaration, IWineD3DVertexShaderImpl *This) { - UINT num = 0, i, j; - UINT numoldswizzles = This->num_swizzled_attribs; - IWineD3DVertexDeclarationImpl *decl = (IWineD3DVertexDeclarationImpl *) declaration; - - DWORD usage_token, usage, usage_idx; - BOOL found; - - attrib_declaration oldswizzles[sizeof(This->swizzled_attribs) / sizeof(This->swizzled_attribs[0])]; - - /* Back up the old swizzles to keep attributes that are undefined in the current declaration */ - memcpy(oldswizzles, This->swizzled_attribs, sizeof(oldswizzles)); - - memset(This->swizzled_attribs, 0, sizeof(This->swizzled_attribs[0]) * MAX_ATTRIBS); - - for(i = 0; i < decl->num_swizzled_attribs; i++) { - for(j = 0; j < MAX_ATTRIBS; j++) { - - if(!This->baseShader.reg_maps.attributes[j]) continue; - - usage_token = This->semantics_in[j].usage; - usage = (usage_token & WINED3DSP_DCL_USAGE_MASK) >> WINED3DSP_DCL_USAGE_SHIFT; - usage_idx = (usage_token & WINED3DSP_DCL_USAGEINDEX_MASK) >> WINED3DSP_DCL_USAGEINDEX_SHIFT; - - if(decl->swizzled_attribs[i].usage == usage && - decl->swizzled_attribs[i].idx == usage_idx) { - This->swizzled_attribs[num].usage = usage; - This->swizzled_attribs[num].idx = usage_idx; - num++; - } - } - } - - /* Add previously converted attributes back in if they are not defined in the current declaration */ - for(i = 0; i < numoldswizzles; i++) { - - found = FALSE; - for(j = 0; j < decl->declarationWNumElements; j++) { - if(oldswizzles[i].usage == decl->pDeclarationWine[j].Usage && - oldswizzles[i].idx == decl->pDeclarationWine[j].UsageIndex) { - found = TRUE; - } - } - if(found) { - /* This previously converted attribute is declared in the current declaration. Either it is - * already in the new array, or it should not be there. Skip it - */ - continue; - } - /* We have a previously swizzled attribute that is not defined by the current vertex declaration. - * Insert it into the new conversion array to keep it in the old defined state. Otherwise we end up - * recompiling if the old decl is used again because undefined attributes are reset to no swizzling. - * In the reverse way(attribute was not swizzled and is not declared in new declaration) the attrib - * stays unswizzled as well because it isn't found in the oldswizzles array - */ - for(j = 0; j < num; j++) { - if(oldswizzles[i].usage > This->swizzled_attribs[j].usage || ( - oldswizzles[i].usage == This->swizzled_attribs[j].usage && - oldswizzles[i].idx > This->swizzled_attribs[j].idx)) { - memmove(&This->swizzled_attribs[j + 1], &This->swizzled_attribs[j], - sizeof(This->swizzled_attribs) - (sizeof(This->swizzled_attribs[0]) * (j + 1))); - break; - } - } - This->swizzled_attribs[j].usage = oldswizzles[i].usage; - This->swizzled_attribs[j].idx = oldswizzles[i].idx; - num++; - } - - TRACE("New swizzled attributes array\n"); - for(i = 0; i < num; i++) { - TRACE("%d: %s(%d), %d\n", i, debug_d3ddeclusage(This->swizzled_attribs[i].usage), - This->swizzled_attribs[i].usage, This->swizzled_attribs[i].idx); - } - This->num_swizzled_attribs = num; -} /** Generate a vertex shader string using either GL_VERTEX_PROGRAM_ARB or GLSL and send it to the card */ static void IWineD3DVertexShaderImpl_GenerateShader(IWineD3DVertexShader *iface, const struct shader_reg_maps* reg_maps, const DWORD *pFunction) { IWineD3DVertexShaderImpl *This = (IWineD3DVertexShaderImpl *)iface; - IWineD3DVertexDeclaration *decl = ((IWineD3DDeviceImpl *) This->baseShader.device)->stateBlock->vertexDecl; SHADER_BUFFER buffer; - find_swizzled_attribs(decl, This); + This->swizzle_map = ((IWineD3DDeviceImpl *)This->baseShader.device)->strided_streams.swizzle_map; shader_buffer_init(&buffer); ((IWineD3DDeviceImpl *)This->baseShader.device)->shader_backend->shader_generate_vshader(iface, &buffer); @@ -516,56 +418,8 @@ static HRESULT WINAPI IWIneD3DVertexShaderImpl_SetLocalConstantsF(IWineD3DVertex return WINED3D_OK; } -static inline BOOL swizzled_attribs_differ(IWineD3DVertexShaderImpl *This, IWineD3DVertexDeclarationImpl *vdecl) { - UINT i, j, k; - BOOL found; - - DWORD usage_token; - DWORD usage; - DWORD usage_idx; - - for(i = 0; i < vdecl->declarationWNumElements; i++) { - /* Ignore tesselated streams and the termination entry(position0, stream 255, unused) */ - if(vdecl->pDeclarationWine[i].Stream >= MAX_STREAMS || - vdecl->pDeclarationWine[i].Type == WINED3DDECLTYPE_UNUSED) continue; - - for(j = 0; j < MAX_ATTRIBS; j++) { - if(!This->baseShader.reg_maps.attributes[j]) continue; - - usage_token = This->semantics_in[j].usage; - usage = (usage_token & WINED3DSP_DCL_USAGE_MASK) >> WINED3DSP_DCL_USAGE_SHIFT; - usage_idx = (usage_token & WINED3DSP_DCL_USAGEINDEX_MASK) >> WINED3DSP_DCL_USAGEINDEX_SHIFT; - - if(vdecl->pDeclarationWine[i].Usage != usage || - vdecl->pDeclarationWine[i].UsageIndex != usage_idx) { - continue; - } - - found = FALSE; - for(k = 0; k < This->num_swizzled_attribs; k++) { - if(This->swizzled_attribs[k].usage == usage && - This->swizzled_attribs[k].idx == usage_idx) { - found = TRUE; - } - } - if(!found && vdecl->pDeclarationWine[i].Type == WINED3DDECLTYPE_D3DCOLOR) { - TRACE("Attribute %s%d is D3DCOLOR now but wasn't before\n", - debug_d3ddeclusage(usage), usage_idx); - return TRUE; - } - if( found && vdecl->pDeclarationWine[i].Type != WINED3DDECLTYPE_D3DCOLOR) { - TRACE("Attribute %s%d was D3DCOLOR before but is not any more\n", - debug_d3ddeclusage(usage), usage_idx); - return TRUE; - } - } - } - return FALSE; -} - HRESULT IWineD3DVertexShaderImpl_CompileShader(IWineD3DVertexShader *iface) { IWineD3DVertexShaderImpl *This = (IWineD3DVertexShaderImpl *)iface; - IWineD3DVertexDeclarationImpl *vdecl; CONST DWORD *function = This->baseShader.function; IWineD3DDeviceImpl *deviceImpl = (IWineD3DDeviceImpl *) This->baseShader.device; @@ -573,20 +427,10 @@ HRESULT IWineD3DVertexShaderImpl_CompileShader(IWineD3DVertexShader *iface) { /* We're already compiled. */ if (This->baseShader.is_compiled) { - vdecl = (IWineD3DVertexDeclarationImpl *) deviceImpl->stateBlock->vertexDecl; - - if(This->num_swizzled_attribs != vdecl->num_swizzled_attribs || - memcmp(This->swizzled_attribs, vdecl->swizzled_attribs, sizeof(vdecl->swizzled_attribs[0]) * This->num_swizzled_attribs) != 0) { - - /* The swizzled attributes differ between shader and declaration. This doesn't necessarily mean - * we have to recompile, but we have to take a deeper look at see if the attribs that differ - * are declared in the decl and used in the shader - */ - if(swizzled_attribs_differ(This, vdecl)) { - WARN("Recompiling vertex shader %p due to D3DCOLOR input changes\n", This); - goto recompile; - } - WARN("Swizzled attribute validation required an expensive comparison\n"); + if ((This->swizzle_map & deviceImpl->strided_streams.use_map) != deviceImpl->strided_streams.swizzle_map) + { + WARN("Recompiling vertex shader %p due to D3DCOLOR input changes\n", This); + goto recompile; } return WINED3D_OK; diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h index 5fccf9a9168..09080a45eb1 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -3383,6 +3383,7 @@ typedef enum _GL_SupportedExt { EXT_TEXTURE_SRGB, EXT_TEXTURE_SWIZZLE, EXT_GPU_PROGRAM_PARAMETERS, + EXT_VERTEX_ARRAY_BGRA, /* NVIDIA */ NV_HALF_FLOAT, NV_FOG_DISTANCE, @@ -3852,6 +3853,7 @@ typedef struct _WINED3DGLTYPE { int d3dType; GLint size; GLenum glType; + GLint format; GLboolean normalized; int typesize; } WINED3DGLTYPE; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 516cd9f145c..43b1ae0c09c 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -213,6 +213,7 @@ void init_type_lookup(WineD3D_GL_Info *gl_info); #define WINED3D_ATR_TYPE(type) GLINFO_LOCATION.glTypeLookup[type].d3dType #define WINED3D_ATR_SIZE(type) GLINFO_LOCATION.glTypeLookup[type].size #define WINED3D_ATR_GLTYPE(type) GLINFO_LOCATION.glTypeLookup[type].glType +#define WINED3D_ATR_FORMAT(type) GLINFO_LOCATION.glTypeLookup[type].format #define WINED3D_ATR_NORMALIZED(type) GLINFO_LOCATION.glTypeLookup[type].normalized #define WINED3D_ATR_TYPESIZE(type) GLINFO_LOCATION.glTypeLookup[type].typesize @@ -1711,11 +1712,6 @@ BOOL palette9_changed(IWineD3DSurfaceImpl *This); /***************************************************************************** * IWineD3DVertexDeclaration implementation structure */ -typedef struct attrib_declaration { - DWORD usage; - DWORD idx; -} attrib_declaration; - #define MAX_ATTRIBS 16 typedef struct IWineD3DVertexDeclarationImpl { @@ -1734,10 +1730,6 @@ typedef struct IWineD3DVertexDeclarationImpl { UINT num_streams; BOOL position_transformed; BOOL half_float_conv_needed; - - /* Ordered array of declaration types that need swizzling in a vshader */ - attrib_declaration swizzled_attribs[MAX_ATTRIBS]; - UINT num_swizzled_attribs; } IWineD3DVertexDeclarationImpl; extern const IWineD3DVertexDeclarationVtbl IWineD3DVertexDeclaration_Vtbl; @@ -2182,10 +2174,6 @@ extern BOOL vshader_get_input( BYTE usage_req, BYTE usage_idx_req, unsigned int* regnum); -extern BOOL vshader_input_is_color( - IWineD3DVertexShader* iface, - unsigned int regnum); - extern HRESULT allocate_shader_constants(IWineD3DStateBlockImpl* object); /* GLSL helper functions */ @@ -2337,9 +2325,7 @@ typedef struct IWineD3DVertexShaderImpl { semantic semantics_in [MAX_ATTRIBS]; semantic semantics_out [MAX_REG_OUTPUT]; - /* Ordered array of attributes that are swizzled */ - attrib_declaration swizzled_attribs [MAX_ATTRIBS]; - UINT num_swizzled_attribs; + WORD swizzle_map; /* MAX_ATTRIBS, 16 */ UINT min_rel_offset, max_rel_offset; UINT rel_offset; @@ -2454,7 +2440,7 @@ const StaticPixelFormatDesc *getFormatDescEntry(WINED3DFORMAT fmt, static inline BOOL use_vs(IWineD3DStateBlockImpl *stateblock) { return (stateblock->vertexShader - && !stateblock->wineD3DDevice->strided_streams.u.s.position_transformed + && !stateblock->wineD3DDevice->strided_streams.position_transformed && stateblock->wineD3DDevice->vs_selected_mode != SHADER_NONE); } diff --git a/dlls/wineps.drv/type1afm.c b/dlls/wineps.drv/type1afm.c index 85aca4262be..4feee711b38 100644 --- a/dlls/wineps.drv/type1afm.c +++ b/dlls/wineps.drv/type1afm.c @@ -746,7 +746,7 @@ static BOOL ParseN(LPSTR sz, OLD_AFMMETRICS *metrics) static const OLD_AFMMETRICS badmetrics = { INT_MAX, /* C */ - LONG_MAX, /* UV */ + INT_MAX, /* UV */ FLT_MAX, /* WX */ NULL, /* N */ { FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX }, /* B */ diff --git a/dlls/wininet/ftp.c b/dlls/wininet/ftp.c index d5bf13b3c59..21ce4346894 100644 --- a/dlls/wininet/ftp.c +++ b/dlls/wininet/ftp.c @@ -858,13 +858,13 @@ lend: if (hFindNext) { - iar.dwResult = (DWORD)hFindNext; + iar.dwResult = (DWORD_PTR)hFindNext; iar.dwError = ERROR_SUCCESS; SendAsyncCallback(&lpwfs->hdr, lpwfs->hdr.dwContext, INTERNET_STATUS_HANDLE_CREATED, &iar, sizeof(INTERNET_ASYNC_RESULT)); } - iar.dwResult = (DWORD)hFindNext; + iar.dwResult = (DWORD_PTR)hFindNext; iar.dwError = hFindNext ? ERROR_SUCCESS : INTERNET_GetLastError(); SendAsyncCallback(&lpwfs->hdr, lpwfs->hdr.dwContext, INTERNET_STATUS_REQUEST_COMPLETE, &iar, sizeof(INTERNET_ASYNC_RESULT)); @@ -1343,13 +1343,13 @@ HINTERNET FTP_FtpOpenFileW(LPWININETFTPSESSIONW lpwfs, if (lpwh) { - iar.dwResult = (DWORD)handle; + iar.dwResult = (DWORD_PTR)handle; iar.dwError = ERROR_SUCCESS; SendAsyncCallback(&lpwfs->hdr, lpwfs->hdr.dwContext, INTERNET_STATUS_HANDLE_CREATED, &iar, sizeof(INTERNET_ASYNC_RESULT)); } - iar.dwResult = (DWORD)bSuccess; + iar.dwResult = bSuccess; iar.dwError = bSuccess ? ERROR_SUCCESS : INTERNET_GetLastError(); SendAsyncCallback(&lpwfs->hdr, lpwfs->hdr.dwContext, INTERNET_STATUS_REQUEST_COMPLETE, &iar, sizeof(INTERNET_ASYNC_RESULT)); @@ -2340,7 +2340,7 @@ HINTERNET FTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName, { INTERNET_ASYNC_RESULT iar; - iar.dwResult = (DWORD)handle; + iar.dwResult = (DWORD_PTR)handle; iar.dwError = ERROR_SUCCESS; SendAsyncCallback(&hIC->hdr, dwContext, diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index 94ff541d9df..03e9e748c84 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -1824,8 +1824,8 @@ INTERNET_STATUS_CALLBACK WINAPI InternetSetStatusCallbackA( INTERNET_STATUS_CALLBACK retVal; LPWININETHANDLEHEADER lpwh; - TRACE("0x%08x\n", (ULONG)hInternet); - + TRACE("%p\n", hInternet); + if (!(lpwh = WININET_GetObject(hInternet))) return INTERNET_INVALID_STATUS_CALLBACK; @@ -1852,7 +1852,7 @@ INTERNET_STATUS_CALLBACK WINAPI InternetSetStatusCallbackW( INTERNET_STATUS_CALLBACK retVal; LPWININETHANDLEHEADER lpwh; - TRACE("0x%08x\n", (ULONG)hInternet); + TRACE("%p\n", hInternet); if (!(lpwh = WININET_GetObject(hInternet))) return INTERNET_INVALID_STATUS_CALLBACK; diff --git a/dlls/wininet/tests/generated.c b/dlls/wininet/tests/generated.c index 2d6cdd08713..ceb21deb869 100644 --- a/dlls/wininet/tests/generated.c +++ b/dlls/wininet/tests/generated.c @@ -1,4 +1,4 @@ -/* File generated automatically from tools/winapi/test.dat; do not edit! */ +/* File generated automatically from tools/winapi/tests.dat; do not edit! */ /* This file can be copied, modified and distributed without restriction. */ /* @@ -32,21 +32,13 @@ */ #if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) -# define FIELD_ALIGNMENT(type, field) __alignof(((type*)0)->field) -#elif defined(__GNUC__) -# define FIELD_ALIGNMENT(type, field) __alignof__(((type*)0)->field) -#else -/* FIXME: Not sure if is possible to do without compiler extension */ -#endif - -#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) # define _TYPE_ALIGNMENT(type) __alignof(type) #elif defined(__GNUC__) # define _TYPE_ALIGNMENT(type) __alignof__(type) #else /* - * FIXME: Not sure if is possible to do without compiler extension - * (if type is not just a name that is, if so the normal) + * FIXME: May not be possible without a compiler extension + * (if type is not just a name that is, otherwise the normal * TYPE_ALIGNMENT can be used) */ #endif @@ -63,857 +55,1275 @@ * Test helper macros */ -#ifdef FIELD_ALIGNMENT -# define TEST_FIELD_ALIGNMENT(type, field, align) \ - ok(FIELD_ALIGNMENT(type, field) == align, \ - "FIELD_ALIGNMENT(" #type ", " #field ") == %d (expected " #align ")\n", \ - (int)FIELD_ALIGNMENT(type, field)) -#else -# define TEST_FIELD_ALIGNMENT(type, field, align) do { } while (0) -#endif - -#define TEST_FIELD_OFFSET(type, field, offset) \ - ok(FIELD_OFFSET(type, field) == offset, \ - "FIELD_OFFSET(" #type ", " #field ") == %ld (expected " #offset ")\n", \ - (long int)FIELD_OFFSET(type, field)) +#ifdef _WIN64 -#ifdef _TYPE_ALIGNMENT -#define TEST__TYPE_ALIGNMENT(type, align) \ - ok(_TYPE_ALIGNMENT(type) == align, "TYPE_ALIGNMENT(" #type ") == %d (expected " #align ")\n", (int)_TYPE_ALIGNMENT(type)) -#else -# define TEST__TYPE_ALIGNMENT(type, align) do { } while (0) -#endif +# define TEST_TYPE_SIZE(type, size) +# define TEST_TYPE_ALIGN(type, align) +# define TEST_TARGET_ALIGN(type, align) +# define TEST_FIELD_ALIGN(type, field, align) +# define TEST_FIELD_OFFSET(type, field, offset) -#ifdef TYPE_ALIGNMENT -#define TEST_TYPE_ALIGNMENT(type, align) \ - ok(TYPE_ALIGNMENT(type) == align, "TYPE_ALIGNMENT(" #type ") == %d (expected " #align ")\n", (int)TYPE_ALIGNMENT(type)) #else -# define TEST_TYPE_ALIGNMENT(type, align) do { } while (0) -#endif -#define TEST_TYPE_SIZE(type, size) \ - ok(sizeof(type) == size, "sizeof(" #type ") == %d (expected " #size ")\n", ((int) sizeof(type))) +# define TEST_TYPE_SIZE(type, size) C_ASSERT(sizeof(type) == size); -/*********************************************************************** - * Test macros - */ +# ifdef TYPE_ALIGNMENT +# define TEST_TYPE_ALIGN(type, align) C_ASSERT(TYPE_ALIGNMENT(type) == align); +# else +# define TEST_TYPE_ALIGN(type, align) +# endif -#define TEST_FIELD(type, field_type, field_name, field_offset, field_size, field_align) \ - TEST_TYPE_SIZE(field_type, field_size); \ - TEST_FIELD_ALIGNMENT(type, field_name, field_align); \ - TEST_FIELD_OFFSET(type, field_name, field_offset); \ +# ifdef _TYPE_ALIGNMENT +# define TEST_TARGET_ALIGN(type, align) C_ASSERT(_TYPE_ALIGNMENT(*(type)0) == align); +# define TEST_FIELD_ALIGN(type, field, align) C_ASSERT(_TYPE_ALIGNMENT(((type*)0)->field) == align); +# else +# define TEST_TARGET_ALIGN(type, align) +# define TEST_FIELD_ALIGN(type, field, align) +# endif -#define TEST_TYPE(type, size, align) \ - TEST_TYPE_ALIGNMENT(type, align); \ - TEST_TYPE_SIZE(type, size) +# define TEST_FIELD_OFFSET(type, field, offset) C_ASSERT(FIELD_OFFSET(type, field) == offset); -#define TEST_TYPE_POINTER(type, size, align) \ - TEST__TYPE_ALIGNMENT(*(type)0, align); \ - TEST_TYPE_SIZE(*(type)0, size) +#endif -#define TEST_TYPE_SIGNED(type) \ - ok((type) -1 < 0, "(" #type ") -1 < 0\n"); +#define TEST_TARGET_SIZE(type, size) TEST_TYPE_SIZE(*(type)0, size) +#define TEST_FIELD_SIZE(type, field, size) TEST_TYPE_SIZE((((type*)0)->field), size) +#define TEST_TYPE_SIGNED(type) C_ASSERT((type) -1 < 0); +#define TEST_TYPE_UNSIGNED(type) C_ASSERT((type) -1 > 0); -#define TEST_TYPE_UNSIGNED(type) \ - ok((type) -1 > 0, "(" #type ") -1 > 0\n"); static void test_pack_GOPHER_ABSTRACT_ATTRIBUTE_TYPEA(void) { /* GOPHER_ABSTRACT_ATTRIBUTE_TYPEA (pack 4) */ - TEST_TYPE(GOPHER_ABSTRACT_ATTRIBUTE_TYPEA, 8, 4); - TEST_FIELD(GOPHER_ABSTRACT_ATTRIBUTE_TYPEA, LPCSTR, ShortAbstract, 0, 4, 4); - TEST_FIELD(GOPHER_ABSTRACT_ATTRIBUTE_TYPEA, LPCSTR, AbstractFile, 4, 4, 4); + TEST_TYPE_SIZE (GOPHER_ABSTRACT_ATTRIBUTE_TYPEA, 8) + TEST_TYPE_ALIGN (GOPHER_ABSTRACT_ATTRIBUTE_TYPEA, 4) + TEST_FIELD_SIZE (GOPHER_ABSTRACT_ATTRIBUTE_TYPEA, ShortAbstract, 4) + TEST_FIELD_ALIGN (GOPHER_ABSTRACT_ATTRIBUTE_TYPEA, ShortAbstract, 4) + TEST_FIELD_OFFSET(GOPHER_ABSTRACT_ATTRIBUTE_TYPEA, ShortAbstract, 0) + TEST_FIELD_SIZE (GOPHER_ABSTRACT_ATTRIBUTE_TYPEA, AbstractFile, 4) + TEST_FIELD_ALIGN (GOPHER_ABSTRACT_ATTRIBUTE_TYPEA, AbstractFile, 4) + TEST_FIELD_OFFSET(GOPHER_ABSTRACT_ATTRIBUTE_TYPEA, AbstractFile, 4) } static void test_pack_GOPHER_ABSTRACT_ATTRIBUTE_TYPEW(void) { /* GOPHER_ABSTRACT_ATTRIBUTE_TYPEW (pack 4) */ - TEST_TYPE(GOPHER_ABSTRACT_ATTRIBUTE_TYPEW, 8, 4); - TEST_FIELD(GOPHER_ABSTRACT_ATTRIBUTE_TYPEW, LPCWSTR, ShortAbstract, 0, 4, 4); - TEST_FIELD(GOPHER_ABSTRACT_ATTRIBUTE_TYPEW, LPCWSTR, AbstractFile, 4, 4, 4); + TEST_TYPE_SIZE (GOPHER_ABSTRACT_ATTRIBUTE_TYPEW, 8) + TEST_TYPE_ALIGN (GOPHER_ABSTRACT_ATTRIBUTE_TYPEW, 4) + TEST_FIELD_SIZE (GOPHER_ABSTRACT_ATTRIBUTE_TYPEW, ShortAbstract, 4) + TEST_FIELD_ALIGN (GOPHER_ABSTRACT_ATTRIBUTE_TYPEW, ShortAbstract, 4) + TEST_FIELD_OFFSET(GOPHER_ABSTRACT_ATTRIBUTE_TYPEW, ShortAbstract, 0) + TEST_FIELD_SIZE (GOPHER_ABSTRACT_ATTRIBUTE_TYPEW, AbstractFile, 4) + TEST_FIELD_ALIGN (GOPHER_ABSTRACT_ATTRIBUTE_TYPEW, AbstractFile, 4) + TEST_FIELD_OFFSET(GOPHER_ABSTRACT_ATTRIBUTE_TYPEW, AbstractFile, 4) } static void test_pack_GOPHER_ADMIN_ATTRIBUTE_TYPEA(void) { /* GOPHER_ADMIN_ATTRIBUTE_TYPEA (pack 4) */ - TEST_TYPE(GOPHER_ADMIN_ATTRIBUTE_TYPEA, 8, 4); - TEST_FIELD(GOPHER_ADMIN_ATTRIBUTE_TYPEA, LPCSTR, Comment, 0, 4, 4); - TEST_FIELD(GOPHER_ADMIN_ATTRIBUTE_TYPEA, LPCSTR, EmailAddress, 4, 4, 4); + TEST_TYPE_SIZE (GOPHER_ADMIN_ATTRIBUTE_TYPEA, 8) + TEST_TYPE_ALIGN (GOPHER_ADMIN_ATTRIBUTE_TYPEA, 4) + TEST_FIELD_SIZE (GOPHER_ADMIN_ATTRIBUTE_TYPEA, Comment, 4) + TEST_FIELD_ALIGN (GOPHER_ADMIN_ATTRIBUTE_TYPEA, Comment, 4) + TEST_FIELD_OFFSET(GOPHER_ADMIN_ATTRIBUTE_TYPEA, Comment, 0) + TEST_FIELD_SIZE (GOPHER_ADMIN_ATTRIBUTE_TYPEA, EmailAddress, 4) + TEST_FIELD_ALIGN (GOPHER_ADMIN_ATTRIBUTE_TYPEA, EmailAddress, 4) + TEST_FIELD_OFFSET(GOPHER_ADMIN_ATTRIBUTE_TYPEA, EmailAddress, 4) } static void test_pack_GOPHER_ADMIN_ATTRIBUTE_TYPEW(void) { /* GOPHER_ADMIN_ATTRIBUTE_TYPEW (pack 4) */ - TEST_TYPE(GOPHER_ADMIN_ATTRIBUTE_TYPEW, 8, 4); - TEST_FIELD(GOPHER_ADMIN_ATTRIBUTE_TYPEW, LPCWSTR, Comment, 0, 4, 4); - TEST_FIELD(GOPHER_ADMIN_ATTRIBUTE_TYPEW, LPCWSTR, EmailAddress, 4, 4, 4); + TEST_TYPE_SIZE (GOPHER_ADMIN_ATTRIBUTE_TYPEW, 8) + TEST_TYPE_ALIGN (GOPHER_ADMIN_ATTRIBUTE_TYPEW, 4) + TEST_FIELD_SIZE (GOPHER_ADMIN_ATTRIBUTE_TYPEW, Comment, 4) + TEST_FIELD_ALIGN (GOPHER_ADMIN_ATTRIBUTE_TYPEW, Comment, 4) + TEST_FIELD_OFFSET(GOPHER_ADMIN_ATTRIBUTE_TYPEW, Comment, 0) + TEST_FIELD_SIZE (GOPHER_ADMIN_ATTRIBUTE_TYPEW, EmailAddress, 4) + TEST_FIELD_ALIGN (GOPHER_ADMIN_ATTRIBUTE_TYPEW, EmailAddress, 4) + TEST_FIELD_OFFSET(GOPHER_ADMIN_ATTRIBUTE_TYPEW, EmailAddress, 4) } static void test_pack_GOPHER_ASK_ATTRIBUTE_TYPEA(void) { /* GOPHER_ASK_ATTRIBUTE_TYPEA (pack 4) */ - TEST_TYPE(GOPHER_ASK_ATTRIBUTE_TYPEA, 8, 4); - TEST_FIELD(GOPHER_ASK_ATTRIBUTE_TYPEA, LPCSTR, QuestionType, 0, 4, 4); - TEST_FIELD(GOPHER_ASK_ATTRIBUTE_TYPEA, LPCSTR, QuestionText, 4, 4, 4); + TEST_TYPE_SIZE (GOPHER_ASK_ATTRIBUTE_TYPEA, 8) + TEST_TYPE_ALIGN (GOPHER_ASK_ATTRIBUTE_TYPEA, 4) + TEST_FIELD_SIZE (GOPHER_ASK_ATTRIBUTE_TYPEA, QuestionType, 4) + TEST_FIELD_ALIGN (GOPHER_ASK_ATTRIBUTE_TYPEA, QuestionType, 4) + TEST_FIELD_OFFSET(GOPHER_ASK_ATTRIBUTE_TYPEA, QuestionType, 0) + TEST_FIELD_SIZE (GOPHER_ASK_ATTRIBUTE_TYPEA, QuestionText, 4) + TEST_FIELD_ALIGN (GOPHER_ASK_ATTRIBUTE_TYPEA, QuestionText, 4) + TEST_FIELD_OFFSET(GOPHER_ASK_ATTRIBUTE_TYPEA, QuestionText, 4) } static void test_pack_GOPHER_ASK_ATTRIBUTE_TYPEW(void) { /* GOPHER_ASK_ATTRIBUTE_TYPEW (pack 4) */ - TEST_TYPE(GOPHER_ASK_ATTRIBUTE_TYPEW, 8, 4); - TEST_FIELD(GOPHER_ASK_ATTRIBUTE_TYPEW, LPCWSTR, QuestionType, 0, 4, 4); - TEST_FIELD(GOPHER_ASK_ATTRIBUTE_TYPEW, LPCWSTR, QuestionText, 4, 4, 4); + TEST_TYPE_SIZE (GOPHER_ASK_ATTRIBUTE_TYPEW, 8) + TEST_TYPE_ALIGN (GOPHER_ASK_ATTRIBUTE_TYPEW, 4) + TEST_FIELD_SIZE (GOPHER_ASK_ATTRIBUTE_TYPEW, QuestionType, 4) + TEST_FIELD_ALIGN (GOPHER_ASK_ATTRIBUTE_TYPEW, QuestionType, 4) + TEST_FIELD_OFFSET(GOPHER_ASK_ATTRIBUTE_TYPEW, QuestionType, 0) + TEST_FIELD_SIZE (GOPHER_ASK_ATTRIBUTE_TYPEW, QuestionText, 4) + TEST_FIELD_ALIGN (GOPHER_ASK_ATTRIBUTE_TYPEW, QuestionText, 4) + TEST_FIELD_OFFSET(GOPHER_ASK_ATTRIBUTE_TYPEW, QuestionText, 4) } static void test_pack_GOPHER_ATTRIBUTE_ENUMERATORA(void) { /* GOPHER_ATTRIBUTE_ENUMERATORA */ - TEST_TYPE(GOPHER_ATTRIBUTE_ENUMERATORA, 4, 4); + TEST_TYPE_SIZE (GOPHER_ATTRIBUTE_ENUMERATORA, 4) + TEST_TYPE_ALIGN (GOPHER_ATTRIBUTE_ENUMERATORA, 4) } static void test_pack_GOPHER_ATTRIBUTE_ENUMERATORW(void) { /* GOPHER_ATTRIBUTE_ENUMERATORW */ - TEST_TYPE(GOPHER_ATTRIBUTE_ENUMERATORW, 4, 4); + TEST_TYPE_SIZE (GOPHER_ATTRIBUTE_ENUMERATORW, 4) + TEST_TYPE_ALIGN (GOPHER_ATTRIBUTE_ENUMERATORW, 4) } static void test_pack_GOPHER_ATTRIBUTE_TYPEA(void) { /* GOPHER_ATTRIBUTE_TYPEA (pack 4) */ - TEST_FIELD(GOPHER_ATTRIBUTE_TYPEA, DWORD, CategoryId, 0, 4, 4); - TEST_FIELD(GOPHER_ATTRIBUTE_TYPEA, DWORD, AttributeId, 4, 4, 4); + TEST_FIELD_SIZE (GOPHER_ATTRIBUTE_TYPEA, CategoryId, 4) + TEST_FIELD_ALIGN (GOPHER_ATTRIBUTE_TYPEA, CategoryId, 4) + TEST_FIELD_OFFSET(GOPHER_ATTRIBUTE_TYPEA, CategoryId, 0) + TEST_FIELD_SIZE (GOPHER_ATTRIBUTE_TYPEA, AttributeId, 4) + TEST_FIELD_ALIGN (GOPHER_ATTRIBUTE_TYPEA, AttributeId, 4) + TEST_FIELD_OFFSET(GOPHER_ATTRIBUTE_TYPEA, AttributeId, 4) } static void test_pack_GOPHER_ATTRIBUTE_TYPEW(void) { /* GOPHER_ATTRIBUTE_TYPEW (pack 4) */ - TEST_FIELD(GOPHER_ATTRIBUTE_TYPEW, DWORD, CategoryId, 0, 4, 4); - TEST_FIELD(GOPHER_ATTRIBUTE_TYPEW, DWORD, AttributeId, 4, 4, 4); + TEST_FIELD_SIZE (GOPHER_ATTRIBUTE_TYPEW, CategoryId, 4) + TEST_FIELD_ALIGN (GOPHER_ATTRIBUTE_TYPEW, CategoryId, 4) + TEST_FIELD_OFFSET(GOPHER_ATTRIBUTE_TYPEW, CategoryId, 0) + TEST_FIELD_SIZE (GOPHER_ATTRIBUTE_TYPEW, AttributeId, 4) + TEST_FIELD_ALIGN (GOPHER_ATTRIBUTE_TYPEW, AttributeId, 4) + TEST_FIELD_OFFSET(GOPHER_ATTRIBUTE_TYPEW, AttributeId, 4) } static void test_pack_GOPHER_FIND_DATAA(void) { /* GOPHER_FIND_DATAA (pack 4) */ - TEST_TYPE(GOPHER_FIND_DATAA, 808, 4); - TEST_FIELD(GOPHER_FIND_DATAA, CHAR[MAX_GOPHER_DISPLAY_TEXT + 1], DisplayString, 0, 129, 1); - TEST_FIELD(GOPHER_FIND_DATAA, DWORD, GopherType, 132, 4, 4); - TEST_FIELD(GOPHER_FIND_DATAA, DWORD, SizeLow, 136, 4, 4); - TEST_FIELD(GOPHER_FIND_DATAA, DWORD, SizeHigh, 140, 4, 4); - TEST_FIELD(GOPHER_FIND_DATAA, FILETIME, LastModificationTime, 144, 8, 4); - TEST_FIELD(GOPHER_FIND_DATAA, CHAR[MAX_GOPHER_LOCATOR_LENGTH + 1], Locator, 152, 654, 1); + TEST_TYPE_SIZE (GOPHER_FIND_DATAA, 808) + TEST_TYPE_ALIGN (GOPHER_FIND_DATAA, 4) + TEST_FIELD_SIZE (GOPHER_FIND_DATAA, DisplayString, 129) + TEST_FIELD_ALIGN (GOPHER_FIND_DATAA, DisplayString, 1) + TEST_FIELD_OFFSET(GOPHER_FIND_DATAA, DisplayString, 0) + TEST_FIELD_SIZE (GOPHER_FIND_DATAA, GopherType, 4) + TEST_FIELD_ALIGN (GOPHER_FIND_DATAA, GopherType, 4) + TEST_FIELD_OFFSET(GOPHER_FIND_DATAA, GopherType, 132) + TEST_FIELD_SIZE (GOPHER_FIND_DATAA, SizeLow, 4) + TEST_FIELD_ALIGN (GOPHER_FIND_DATAA, SizeLow, 4) + TEST_FIELD_OFFSET(GOPHER_FIND_DATAA, SizeLow, 136) + TEST_FIELD_SIZE (GOPHER_FIND_DATAA, SizeHigh, 4) + TEST_FIELD_ALIGN (GOPHER_FIND_DATAA, SizeHigh, 4) + TEST_FIELD_OFFSET(GOPHER_FIND_DATAA, SizeHigh, 140) + TEST_FIELD_SIZE (GOPHER_FIND_DATAA, LastModificationTime, 8) + TEST_FIELD_ALIGN (GOPHER_FIND_DATAA, LastModificationTime, 4) + TEST_FIELD_OFFSET(GOPHER_FIND_DATAA, LastModificationTime, 144) + TEST_FIELD_SIZE (GOPHER_FIND_DATAA, Locator, 654) + TEST_FIELD_ALIGN (GOPHER_FIND_DATAA, Locator, 1) + TEST_FIELD_OFFSET(GOPHER_FIND_DATAA, Locator, 152) } static void test_pack_GOPHER_FIND_DATAW(void) { /* GOPHER_FIND_DATAW (pack 4) */ - TEST_TYPE(GOPHER_FIND_DATAW, 1588, 4); - TEST_FIELD(GOPHER_FIND_DATAW, WCHAR[MAX_GOPHER_DISPLAY_TEXT + 1], DisplayString, 0, 258, 2); - TEST_FIELD(GOPHER_FIND_DATAW, DWORD, GopherType, 260, 4, 4); - TEST_FIELD(GOPHER_FIND_DATAW, DWORD, SizeLow, 264, 4, 4); - TEST_FIELD(GOPHER_FIND_DATAW, DWORD, SizeHigh, 268, 4, 4); - TEST_FIELD(GOPHER_FIND_DATAW, FILETIME, LastModificationTime, 272, 8, 4); - TEST_FIELD(GOPHER_FIND_DATAW, WCHAR[MAX_GOPHER_LOCATOR_LENGTH + 1], Locator, 280, 1308, 2); + TEST_TYPE_SIZE (GOPHER_FIND_DATAW, 1588) + TEST_TYPE_ALIGN (GOPHER_FIND_DATAW, 4) + TEST_FIELD_SIZE (GOPHER_FIND_DATAW, DisplayString, 258) + TEST_FIELD_ALIGN (GOPHER_FIND_DATAW, DisplayString, 2) + TEST_FIELD_OFFSET(GOPHER_FIND_DATAW, DisplayString, 0) + TEST_FIELD_SIZE (GOPHER_FIND_DATAW, GopherType, 4) + TEST_FIELD_ALIGN (GOPHER_FIND_DATAW, GopherType, 4) + TEST_FIELD_OFFSET(GOPHER_FIND_DATAW, GopherType, 260) + TEST_FIELD_SIZE (GOPHER_FIND_DATAW, SizeLow, 4) + TEST_FIELD_ALIGN (GOPHER_FIND_DATAW, SizeLow, 4) + TEST_FIELD_OFFSET(GOPHER_FIND_DATAW, SizeLow, 264) + TEST_FIELD_SIZE (GOPHER_FIND_DATAW, SizeHigh, 4) + TEST_FIELD_ALIGN (GOPHER_FIND_DATAW, SizeHigh, 4) + TEST_FIELD_OFFSET(GOPHER_FIND_DATAW, SizeHigh, 268) + TEST_FIELD_SIZE (GOPHER_FIND_DATAW, LastModificationTime, 8) + TEST_FIELD_ALIGN (GOPHER_FIND_DATAW, LastModificationTime, 4) + TEST_FIELD_OFFSET(GOPHER_FIND_DATAW, LastModificationTime, 272) + TEST_FIELD_SIZE (GOPHER_FIND_DATAW, Locator, 1308) + TEST_FIELD_ALIGN (GOPHER_FIND_DATAW, Locator, 2) + TEST_FIELD_OFFSET(GOPHER_FIND_DATAW, Locator, 280) } static void test_pack_GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE(void) { /* GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE (pack 4) */ - TEST_TYPE(GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, 24, 4); - TEST_FIELD(GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, INT, DegreesNorth, 0, 4, 4); - TEST_FIELD(GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, INT, MinutesNorth, 4, 4, 4); - TEST_FIELD(GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, INT, SecondsNorth, 8, 4, 4); - TEST_FIELD(GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, INT, DegreesEast, 12, 4, 4); - TEST_FIELD(GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, INT, MinutesEast, 16, 4, 4); - TEST_FIELD(GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, INT, SecondsEast, 20, 4, 4); + TEST_TYPE_SIZE (GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, 24) + TEST_TYPE_ALIGN (GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, 4) + TEST_FIELD_SIZE (GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, DegreesNorth, 4) + TEST_FIELD_ALIGN (GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, DegreesNorth, 4) + TEST_FIELD_OFFSET(GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, DegreesNorth, 0) + TEST_FIELD_SIZE (GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, MinutesNorth, 4) + TEST_FIELD_ALIGN (GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, MinutesNorth, 4) + TEST_FIELD_OFFSET(GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, MinutesNorth, 4) + TEST_FIELD_SIZE (GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, SecondsNorth, 4) + TEST_FIELD_ALIGN (GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, SecondsNorth, 4) + TEST_FIELD_OFFSET(GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, SecondsNorth, 8) + TEST_FIELD_SIZE (GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, DegreesEast, 4) + TEST_FIELD_ALIGN (GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, DegreesEast, 4) + TEST_FIELD_OFFSET(GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, DegreesEast, 12) + TEST_FIELD_SIZE (GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, MinutesEast, 4) + TEST_FIELD_ALIGN (GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, MinutesEast, 4) + TEST_FIELD_OFFSET(GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, MinutesEast, 16) + TEST_FIELD_SIZE (GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, SecondsEast, 4) + TEST_FIELD_ALIGN (GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, SecondsEast, 4) + TEST_FIELD_OFFSET(GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, SecondsEast, 20) } static void test_pack_GOPHER_LOCATION_ATTRIBUTE_TYPEA(void) { /* GOPHER_LOCATION_ATTRIBUTE_TYPEA (pack 4) */ - TEST_TYPE(GOPHER_LOCATION_ATTRIBUTE_TYPEA, 4, 4); - TEST_FIELD(GOPHER_LOCATION_ATTRIBUTE_TYPEA, LPCSTR, Location, 0, 4, 4); + TEST_TYPE_SIZE (GOPHER_LOCATION_ATTRIBUTE_TYPEA, 4) + TEST_TYPE_ALIGN (GOPHER_LOCATION_ATTRIBUTE_TYPEA, 4) + TEST_FIELD_SIZE (GOPHER_LOCATION_ATTRIBUTE_TYPEA, Location, 4) + TEST_FIELD_ALIGN (GOPHER_LOCATION_ATTRIBUTE_TYPEA, Location, 4) + TEST_FIELD_OFFSET(GOPHER_LOCATION_ATTRIBUTE_TYPEA, Location, 0) } static void test_pack_GOPHER_LOCATION_ATTRIBUTE_TYPEW(void) { /* GOPHER_LOCATION_ATTRIBUTE_TYPEW (pack 4) */ - TEST_TYPE(GOPHER_LOCATION_ATTRIBUTE_TYPEW, 4, 4); - TEST_FIELD(GOPHER_LOCATION_ATTRIBUTE_TYPEW, LPCWSTR, Location, 0, 4, 4); + TEST_TYPE_SIZE (GOPHER_LOCATION_ATTRIBUTE_TYPEW, 4) + TEST_TYPE_ALIGN (GOPHER_LOCATION_ATTRIBUTE_TYPEW, 4) + TEST_FIELD_SIZE (GOPHER_LOCATION_ATTRIBUTE_TYPEW, Location, 4) + TEST_FIELD_ALIGN (GOPHER_LOCATION_ATTRIBUTE_TYPEW, Location, 4) + TEST_FIELD_OFFSET(GOPHER_LOCATION_ATTRIBUTE_TYPEW, Location, 0) } static void test_pack_GOPHER_MOD_DATE_ATTRIBUTE_TYPE(void) { /* GOPHER_MOD_DATE_ATTRIBUTE_TYPE (pack 4) */ - TEST_TYPE(GOPHER_MOD_DATE_ATTRIBUTE_TYPE, 8, 4); - TEST_FIELD(GOPHER_MOD_DATE_ATTRIBUTE_TYPE, FILETIME, DateAndTime, 0, 8, 4); + TEST_TYPE_SIZE (GOPHER_MOD_DATE_ATTRIBUTE_TYPE, 8) + TEST_TYPE_ALIGN (GOPHER_MOD_DATE_ATTRIBUTE_TYPE, 4) + TEST_FIELD_SIZE (GOPHER_MOD_DATE_ATTRIBUTE_TYPE, DateAndTime, 8) + TEST_FIELD_ALIGN (GOPHER_MOD_DATE_ATTRIBUTE_TYPE, DateAndTime, 4) + TEST_FIELD_OFFSET(GOPHER_MOD_DATE_ATTRIBUTE_TYPE, DateAndTime, 0) } static void test_pack_GOPHER_ORGANIZATION_ATTRIBUTE_TYPEA(void) { /* GOPHER_ORGANIZATION_ATTRIBUTE_TYPEA (pack 4) */ - TEST_TYPE(GOPHER_ORGANIZATION_ATTRIBUTE_TYPEA, 4, 4); - TEST_FIELD(GOPHER_ORGANIZATION_ATTRIBUTE_TYPEA, LPCSTR, Organization, 0, 4, 4); + TEST_TYPE_SIZE (GOPHER_ORGANIZATION_ATTRIBUTE_TYPEA, 4) + TEST_TYPE_ALIGN (GOPHER_ORGANIZATION_ATTRIBUTE_TYPEA, 4) + TEST_FIELD_SIZE (GOPHER_ORGANIZATION_ATTRIBUTE_TYPEA, Organization, 4) + TEST_FIELD_ALIGN (GOPHER_ORGANIZATION_ATTRIBUTE_TYPEA, Organization, 4) + TEST_FIELD_OFFSET(GOPHER_ORGANIZATION_ATTRIBUTE_TYPEA, Organization, 0) } static void test_pack_GOPHER_ORGANIZATION_ATTRIBUTE_TYPEW(void) { /* GOPHER_ORGANIZATION_ATTRIBUTE_TYPEW (pack 4) */ - TEST_TYPE(GOPHER_ORGANIZATION_ATTRIBUTE_TYPEW, 4, 4); - TEST_FIELD(GOPHER_ORGANIZATION_ATTRIBUTE_TYPEW, LPCWSTR, Organization, 0, 4, 4); + TEST_TYPE_SIZE (GOPHER_ORGANIZATION_ATTRIBUTE_TYPEW, 4) + TEST_TYPE_ALIGN (GOPHER_ORGANIZATION_ATTRIBUTE_TYPEW, 4) + TEST_FIELD_SIZE (GOPHER_ORGANIZATION_ATTRIBUTE_TYPEW, Organization, 4) + TEST_FIELD_ALIGN (GOPHER_ORGANIZATION_ATTRIBUTE_TYPEW, Organization, 4) + TEST_FIELD_OFFSET(GOPHER_ORGANIZATION_ATTRIBUTE_TYPEW, Organization, 0) } static void test_pack_GOPHER_PROVIDER_ATTRIBUTE_TYPEA(void) { /* GOPHER_PROVIDER_ATTRIBUTE_TYPEA (pack 4) */ - TEST_TYPE(GOPHER_PROVIDER_ATTRIBUTE_TYPEA, 4, 4); - TEST_FIELD(GOPHER_PROVIDER_ATTRIBUTE_TYPEA, LPCSTR, Provider, 0, 4, 4); + TEST_TYPE_SIZE (GOPHER_PROVIDER_ATTRIBUTE_TYPEA, 4) + TEST_TYPE_ALIGN (GOPHER_PROVIDER_ATTRIBUTE_TYPEA, 4) + TEST_FIELD_SIZE (GOPHER_PROVIDER_ATTRIBUTE_TYPEA, Provider, 4) + TEST_FIELD_ALIGN (GOPHER_PROVIDER_ATTRIBUTE_TYPEA, Provider, 4) + TEST_FIELD_OFFSET(GOPHER_PROVIDER_ATTRIBUTE_TYPEA, Provider, 0) } static void test_pack_GOPHER_PROVIDER_ATTRIBUTE_TYPEW(void) { /* GOPHER_PROVIDER_ATTRIBUTE_TYPEW (pack 4) */ - TEST_TYPE(GOPHER_PROVIDER_ATTRIBUTE_TYPEW, 4, 4); - TEST_FIELD(GOPHER_PROVIDER_ATTRIBUTE_TYPEW, LPCWSTR, Provider, 0, 4, 4); + TEST_TYPE_SIZE (GOPHER_PROVIDER_ATTRIBUTE_TYPEW, 4) + TEST_TYPE_ALIGN (GOPHER_PROVIDER_ATTRIBUTE_TYPEW, 4) + TEST_FIELD_SIZE (GOPHER_PROVIDER_ATTRIBUTE_TYPEW, Provider, 4) + TEST_FIELD_ALIGN (GOPHER_PROVIDER_ATTRIBUTE_TYPEW, Provider, 4) + TEST_FIELD_OFFSET(GOPHER_PROVIDER_ATTRIBUTE_TYPEW, Provider, 0) } static void test_pack_GOPHER_SCORE_ATTRIBUTE_TYPE(void) { /* GOPHER_SCORE_ATTRIBUTE_TYPE (pack 4) */ - TEST_TYPE(GOPHER_SCORE_ATTRIBUTE_TYPE, 4, 4); - TEST_FIELD(GOPHER_SCORE_ATTRIBUTE_TYPE, INT, Score, 0, 4, 4); + TEST_TYPE_SIZE (GOPHER_SCORE_ATTRIBUTE_TYPE, 4) + TEST_TYPE_ALIGN (GOPHER_SCORE_ATTRIBUTE_TYPE, 4) + TEST_FIELD_SIZE (GOPHER_SCORE_ATTRIBUTE_TYPE, Score, 4) + TEST_FIELD_ALIGN (GOPHER_SCORE_ATTRIBUTE_TYPE, Score, 4) + TEST_FIELD_OFFSET(GOPHER_SCORE_ATTRIBUTE_TYPE, Score, 0) } static void test_pack_GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE(void) { /* GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE (pack 4) */ - TEST_TYPE(GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE, 8, 4); - TEST_FIELD(GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE, INT, LowerBound, 0, 4, 4); - TEST_FIELD(GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE, INT, UpperBound, 4, 4, 4); + TEST_TYPE_SIZE (GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE, 8) + TEST_TYPE_ALIGN (GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE, 4) + TEST_FIELD_SIZE (GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE, LowerBound, 4) + TEST_FIELD_ALIGN (GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE, LowerBound, 4) + TEST_FIELD_OFFSET(GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE, LowerBound, 0) + TEST_FIELD_SIZE (GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE, UpperBound, 4) + TEST_FIELD_ALIGN (GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE, UpperBound, 4) + TEST_FIELD_OFFSET(GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE, UpperBound, 4) } static void test_pack_GOPHER_SITE_ATTRIBUTE_TYPEA(void) { /* GOPHER_SITE_ATTRIBUTE_TYPEA (pack 4) */ - TEST_TYPE(GOPHER_SITE_ATTRIBUTE_TYPEA, 4, 4); - TEST_FIELD(GOPHER_SITE_ATTRIBUTE_TYPEA, LPCSTR, Site, 0, 4, 4); + TEST_TYPE_SIZE (GOPHER_SITE_ATTRIBUTE_TYPEA, 4) + TEST_TYPE_ALIGN (GOPHER_SITE_ATTRIBUTE_TYPEA, 4) + TEST_FIELD_SIZE (GOPHER_SITE_ATTRIBUTE_TYPEA, Site, 4) + TEST_FIELD_ALIGN (GOPHER_SITE_ATTRIBUTE_TYPEA, Site, 4) + TEST_FIELD_OFFSET(GOPHER_SITE_ATTRIBUTE_TYPEA, Site, 0) } static void test_pack_GOPHER_SITE_ATTRIBUTE_TYPEW(void) { /* GOPHER_SITE_ATTRIBUTE_TYPEW (pack 4) */ - TEST_TYPE(GOPHER_SITE_ATTRIBUTE_TYPEW, 4, 4); - TEST_FIELD(GOPHER_SITE_ATTRIBUTE_TYPEW, LPCWSTR, Site, 0, 4, 4); + TEST_TYPE_SIZE (GOPHER_SITE_ATTRIBUTE_TYPEW, 4) + TEST_TYPE_ALIGN (GOPHER_SITE_ATTRIBUTE_TYPEW, 4) + TEST_FIELD_SIZE (GOPHER_SITE_ATTRIBUTE_TYPEW, Site, 4) + TEST_FIELD_ALIGN (GOPHER_SITE_ATTRIBUTE_TYPEW, Site, 4) + TEST_FIELD_OFFSET(GOPHER_SITE_ATTRIBUTE_TYPEW, Site, 0) } static void test_pack_GOPHER_TIMEZONE_ATTRIBUTE_TYPE(void) { /* GOPHER_TIMEZONE_ATTRIBUTE_TYPE (pack 4) */ - TEST_TYPE(GOPHER_TIMEZONE_ATTRIBUTE_TYPE, 4, 4); - TEST_FIELD(GOPHER_TIMEZONE_ATTRIBUTE_TYPE, INT, Zone, 0, 4, 4); + TEST_TYPE_SIZE (GOPHER_TIMEZONE_ATTRIBUTE_TYPE, 4) + TEST_TYPE_ALIGN (GOPHER_TIMEZONE_ATTRIBUTE_TYPE, 4) + TEST_FIELD_SIZE (GOPHER_TIMEZONE_ATTRIBUTE_TYPE, Zone, 4) + TEST_FIELD_ALIGN (GOPHER_TIMEZONE_ATTRIBUTE_TYPE, Zone, 4) + TEST_FIELD_OFFSET(GOPHER_TIMEZONE_ATTRIBUTE_TYPE, Zone, 0) } static void test_pack_GOPHER_TTL_ATTRIBUTE_TYPE(void) { /* GOPHER_TTL_ATTRIBUTE_TYPE (pack 4) */ - TEST_TYPE(GOPHER_TTL_ATTRIBUTE_TYPE, 4, 4); - TEST_FIELD(GOPHER_TTL_ATTRIBUTE_TYPE, DWORD, Ttl, 0, 4, 4); + TEST_TYPE_SIZE (GOPHER_TTL_ATTRIBUTE_TYPE, 4) + TEST_TYPE_ALIGN (GOPHER_TTL_ATTRIBUTE_TYPE, 4) + TEST_FIELD_SIZE (GOPHER_TTL_ATTRIBUTE_TYPE, Ttl, 4) + TEST_FIELD_ALIGN (GOPHER_TTL_ATTRIBUTE_TYPE, Ttl, 4) + TEST_FIELD_OFFSET(GOPHER_TTL_ATTRIBUTE_TYPE, Ttl, 0) } static void test_pack_GOPHER_UNKNOWN_ATTRIBUTE_TYPEA(void) { /* GOPHER_UNKNOWN_ATTRIBUTE_TYPEA (pack 4) */ - TEST_TYPE(GOPHER_UNKNOWN_ATTRIBUTE_TYPEA, 4, 4); - TEST_FIELD(GOPHER_UNKNOWN_ATTRIBUTE_TYPEA, LPCSTR, Text, 0, 4, 4); + TEST_TYPE_SIZE (GOPHER_UNKNOWN_ATTRIBUTE_TYPEA, 4) + TEST_TYPE_ALIGN (GOPHER_UNKNOWN_ATTRIBUTE_TYPEA, 4) + TEST_FIELD_SIZE (GOPHER_UNKNOWN_ATTRIBUTE_TYPEA, Text, 4) + TEST_FIELD_ALIGN (GOPHER_UNKNOWN_ATTRIBUTE_TYPEA, Text, 4) + TEST_FIELD_OFFSET(GOPHER_UNKNOWN_ATTRIBUTE_TYPEA, Text, 0) } static void test_pack_GOPHER_UNKNOWN_ATTRIBUTE_TYPEW(void) { /* GOPHER_UNKNOWN_ATTRIBUTE_TYPEW (pack 4) */ - TEST_TYPE(GOPHER_UNKNOWN_ATTRIBUTE_TYPEW, 4, 4); - TEST_FIELD(GOPHER_UNKNOWN_ATTRIBUTE_TYPEW, LPCWSTR, Text, 0, 4, 4); + TEST_TYPE_SIZE (GOPHER_UNKNOWN_ATTRIBUTE_TYPEW, 4) + TEST_TYPE_ALIGN (GOPHER_UNKNOWN_ATTRIBUTE_TYPEW, 4) + TEST_FIELD_SIZE (GOPHER_UNKNOWN_ATTRIBUTE_TYPEW, Text, 4) + TEST_FIELD_ALIGN (GOPHER_UNKNOWN_ATTRIBUTE_TYPEW, Text, 4) + TEST_FIELD_OFFSET(GOPHER_UNKNOWN_ATTRIBUTE_TYPEW, Text, 0) } static void test_pack_GOPHER_VERONICA_ATTRIBUTE_TYPE(void) { /* GOPHER_VERONICA_ATTRIBUTE_TYPE (pack 4) */ - TEST_TYPE(GOPHER_VERONICA_ATTRIBUTE_TYPE, 4, 4); - TEST_FIELD(GOPHER_VERONICA_ATTRIBUTE_TYPE, BOOL, TreeWalk, 0, 4, 4); + TEST_TYPE_SIZE (GOPHER_VERONICA_ATTRIBUTE_TYPE, 4) + TEST_TYPE_ALIGN (GOPHER_VERONICA_ATTRIBUTE_TYPE, 4) + TEST_FIELD_SIZE (GOPHER_VERONICA_ATTRIBUTE_TYPE, TreeWalk, 4) + TEST_FIELD_ALIGN (GOPHER_VERONICA_ATTRIBUTE_TYPE, TreeWalk, 4) + TEST_FIELD_OFFSET(GOPHER_VERONICA_ATTRIBUTE_TYPE, TreeWalk, 0) } static void test_pack_GOPHER_VERSION_ATTRIBUTE_TYPEA(void) { /* GOPHER_VERSION_ATTRIBUTE_TYPEA (pack 4) */ - TEST_TYPE(GOPHER_VERSION_ATTRIBUTE_TYPEA, 4, 4); - TEST_FIELD(GOPHER_VERSION_ATTRIBUTE_TYPEA, LPCSTR, Version, 0, 4, 4); + TEST_TYPE_SIZE (GOPHER_VERSION_ATTRIBUTE_TYPEA, 4) + TEST_TYPE_ALIGN (GOPHER_VERSION_ATTRIBUTE_TYPEA, 4) + TEST_FIELD_SIZE (GOPHER_VERSION_ATTRIBUTE_TYPEA, Version, 4) + TEST_FIELD_ALIGN (GOPHER_VERSION_ATTRIBUTE_TYPEA, Version, 4) + TEST_FIELD_OFFSET(GOPHER_VERSION_ATTRIBUTE_TYPEA, Version, 0) } static void test_pack_GOPHER_VERSION_ATTRIBUTE_TYPEW(void) { /* GOPHER_VERSION_ATTRIBUTE_TYPEW (pack 4) */ - TEST_TYPE(GOPHER_VERSION_ATTRIBUTE_TYPEW, 4, 4); - TEST_FIELD(GOPHER_VERSION_ATTRIBUTE_TYPEW, LPCWSTR, Version, 0, 4, 4); + TEST_TYPE_SIZE (GOPHER_VERSION_ATTRIBUTE_TYPEW, 4) + TEST_TYPE_ALIGN (GOPHER_VERSION_ATTRIBUTE_TYPEW, 4) + TEST_FIELD_SIZE (GOPHER_VERSION_ATTRIBUTE_TYPEW, Version, 4) + TEST_FIELD_ALIGN (GOPHER_VERSION_ATTRIBUTE_TYPEW, Version, 4) + TEST_FIELD_OFFSET(GOPHER_VERSION_ATTRIBUTE_TYPEW, Version, 0) } static void test_pack_GOPHER_VIEW_ATTRIBUTE_TYPEA(void) { /* GOPHER_VIEW_ATTRIBUTE_TYPEA (pack 4) */ - TEST_TYPE(GOPHER_VIEW_ATTRIBUTE_TYPEA, 12, 4); - TEST_FIELD(GOPHER_VIEW_ATTRIBUTE_TYPEA, LPCSTR, ContentType, 0, 4, 4); - TEST_FIELD(GOPHER_VIEW_ATTRIBUTE_TYPEA, LPCSTR, Language, 4, 4, 4); - TEST_FIELD(GOPHER_VIEW_ATTRIBUTE_TYPEA, DWORD, Size, 8, 4, 4); + TEST_TYPE_SIZE (GOPHER_VIEW_ATTRIBUTE_TYPEA, 12) + TEST_TYPE_ALIGN (GOPHER_VIEW_ATTRIBUTE_TYPEA, 4) + TEST_FIELD_SIZE (GOPHER_VIEW_ATTRIBUTE_TYPEA, ContentType, 4) + TEST_FIELD_ALIGN (GOPHER_VIEW_ATTRIBUTE_TYPEA, ContentType, 4) + TEST_FIELD_OFFSET(GOPHER_VIEW_ATTRIBUTE_TYPEA, ContentType, 0) + TEST_FIELD_SIZE (GOPHER_VIEW_ATTRIBUTE_TYPEA, Language, 4) + TEST_FIELD_ALIGN (GOPHER_VIEW_ATTRIBUTE_TYPEA, Language, 4) + TEST_FIELD_OFFSET(GOPHER_VIEW_ATTRIBUTE_TYPEA, Language, 4) + TEST_FIELD_SIZE (GOPHER_VIEW_ATTRIBUTE_TYPEA, Size, 4) + TEST_FIELD_ALIGN (GOPHER_VIEW_ATTRIBUTE_TYPEA, Size, 4) + TEST_FIELD_OFFSET(GOPHER_VIEW_ATTRIBUTE_TYPEA, Size, 8) } static void test_pack_GOPHER_VIEW_ATTRIBUTE_TYPEW(void) { /* GOPHER_VIEW_ATTRIBUTE_TYPEW (pack 4) */ - TEST_TYPE(GOPHER_VIEW_ATTRIBUTE_TYPEW, 12, 4); - TEST_FIELD(GOPHER_VIEW_ATTRIBUTE_TYPEW, LPCWSTR, ContentType, 0, 4, 4); - TEST_FIELD(GOPHER_VIEW_ATTRIBUTE_TYPEW, LPCWSTR, Language, 4, 4, 4); - TEST_FIELD(GOPHER_VIEW_ATTRIBUTE_TYPEW, DWORD, Size, 8, 4, 4); + TEST_TYPE_SIZE (GOPHER_VIEW_ATTRIBUTE_TYPEW, 12) + TEST_TYPE_ALIGN (GOPHER_VIEW_ATTRIBUTE_TYPEW, 4) + TEST_FIELD_SIZE (GOPHER_VIEW_ATTRIBUTE_TYPEW, ContentType, 4) + TEST_FIELD_ALIGN (GOPHER_VIEW_ATTRIBUTE_TYPEW, ContentType, 4) + TEST_FIELD_OFFSET(GOPHER_VIEW_ATTRIBUTE_TYPEW, ContentType, 0) + TEST_FIELD_SIZE (GOPHER_VIEW_ATTRIBUTE_TYPEW, Language, 4) + TEST_FIELD_ALIGN (GOPHER_VIEW_ATTRIBUTE_TYPEW, Language, 4) + TEST_FIELD_OFFSET(GOPHER_VIEW_ATTRIBUTE_TYPEW, Language, 4) + TEST_FIELD_SIZE (GOPHER_VIEW_ATTRIBUTE_TYPEW, Size, 4) + TEST_FIELD_ALIGN (GOPHER_VIEW_ATTRIBUTE_TYPEW, Size, 4) + TEST_FIELD_OFFSET(GOPHER_VIEW_ATTRIBUTE_TYPEW, Size, 8) } static void test_pack_GROUPID(void) { /* GROUPID */ - TEST_TYPE(GROUPID, 8, 8); - TEST_TYPE_SIGNED(GROUPID); + TEST_TYPE_SIZE (GROUPID, 8) + TEST_TYPE_ALIGN (GROUPID, 8) + TEST_TYPE_SIGNED(GROUPID) } static void test_pack_HINTERNET(void) { /* HINTERNET */ - TEST_TYPE(HINTERNET, 4, 4); + TEST_TYPE_SIZE (HINTERNET, 4) + TEST_TYPE_ALIGN (HINTERNET, 4) } static void test_pack_HTTP_VERSION_INFO(void) { /* HTTP_VERSION_INFO (pack 4) */ - TEST_TYPE(HTTP_VERSION_INFO, 8, 4); - TEST_FIELD(HTTP_VERSION_INFO, DWORD, dwMajorVersion, 0, 4, 4); - TEST_FIELD(HTTP_VERSION_INFO, DWORD, dwMinorVersion, 4, 4, 4); + TEST_TYPE_SIZE (HTTP_VERSION_INFO, 8) + TEST_TYPE_ALIGN (HTTP_VERSION_INFO, 4) + TEST_FIELD_SIZE (HTTP_VERSION_INFO, dwMajorVersion, 4) + TEST_FIELD_ALIGN (HTTP_VERSION_INFO, dwMajorVersion, 4) + TEST_FIELD_OFFSET(HTTP_VERSION_INFO, dwMajorVersion, 0) + TEST_FIELD_SIZE (HTTP_VERSION_INFO, dwMinorVersion, 4) + TEST_FIELD_ALIGN (HTTP_VERSION_INFO, dwMinorVersion, 4) + TEST_FIELD_OFFSET(HTTP_VERSION_INFO, dwMinorVersion, 4) } static void test_pack_INTERNET_ASYNC_RESULT(void) { /* INTERNET_ASYNC_RESULT (pack 4) */ - TEST_TYPE(INTERNET_ASYNC_RESULT, 8, 4); - TEST_FIELD(INTERNET_ASYNC_RESULT, DWORD_PTR, dwResult, 0, 4, 4); - TEST_FIELD(INTERNET_ASYNC_RESULT, DWORD, dwError, 4, 4, 4); + TEST_TYPE_SIZE (INTERNET_ASYNC_RESULT, 8) + TEST_TYPE_ALIGN (INTERNET_ASYNC_RESULT, 4) + TEST_FIELD_SIZE (INTERNET_ASYNC_RESULT, dwResult, 4) + TEST_FIELD_ALIGN (INTERNET_ASYNC_RESULT, dwResult, 4) + TEST_FIELD_OFFSET(INTERNET_ASYNC_RESULT, dwResult, 0) + TEST_FIELD_SIZE (INTERNET_ASYNC_RESULT, dwError, 4) + TEST_FIELD_ALIGN (INTERNET_ASYNC_RESULT, dwError, 4) + TEST_FIELD_OFFSET(INTERNET_ASYNC_RESULT, dwError, 4) } static void test_pack_INTERNET_AUTH_NOTIFY_DATA(void) { /* INTERNET_AUTH_NOTIFY_DATA (pack 4) */ - TEST_TYPE(INTERNET_AUTH_NOTIFY_DATA, 16, 4); - TEST_FIELD(INTERNET_AUTH_NOTIFY_DATA, DWORD, cbStruct, 0, 4, 4); - TEST_FIELD(INTERNET_AUTH_NOTIFY_DATA, DWORD, dwOptions, 4, 4, 4); - TEST_FIELD(INTERNET_AUTH_NOTIFY_DATA, PFN_AUTH_NOTIFY, pfnNotify, 8, 4, 4); - TEST_FIELD(INTERNET_AUTH_NOTIFY_DATA, DWORD_PTR, dwContext, 12, 4, 4); + TEST_TYPE_SIZE (INTERNET_AUTH_NOTIFY_DATA, 16) + TEST_TYPE_ALIGN (INTERNET_AUTH_NOTIFY_DATA, 4) + TEST_FIELD_SIZE (INTERNET_AUTH_NOTIFY_DATA, cbStruct, 4) + TEST_FIELD_ALIGN (INTERNET_AUTH_NOTIFY_DATA, cbStruct, 4) + TEST_FIELD_OFFSET(INTERNET_AUTH_NOTIFY_DATA, cbStruct, 0) + TEST_FIELD_SIZE (INTERNET_AUTH_NOTIFY_DATA, dwOptions, 4) + TEST_FIELD_ALIGN (INTERNET_AUTH_NOTIFY_DATA, dwOptions, 4) + TEST_FIELD_OFFSET(INTERNET_AUTH_NOTIFY_DATA, dwOptions, 4) + TEST_FIELD_SIZE (INTERNET_AUTH_NOTIFY_DATA, pfnNotify, 4) + TEST_FIELD_ALIGN (INTERNET_AUTH_NOTIFY_DATA, pfnNotify, 4) + TEST_FIELD_OFFSET(INTERNET_AUTH_NOTIFY_DATA, pfnNotify, 8) + TEST_FIELD_SIZE (INTERNET_AUTH_NOTIFY_DATA, dwContext, 4) + TEST_FIELD_ALIGN (INTERNET_AUTH_NOTIFY_DATA, dwContext, 4) + TEST_FIELD_OFFSET(INTERNET_AUTH_NOTIFY_DATA, dwContext, 12) } static void test_pack_INTERNET_BUFFERSA(void) { /* INTERNET_BUFFERSA (pack 4) */ - TEST_TYPE(INTERNET_BUFFERSA, 40, 4); - TEST_FIELD(INTERNET_BUFFERSA, DWORD, dwStructSize, 0, 4, 4); - TEST_FIELD(INTERNET_BUFFERSA, struct _INTERNET_BUFFERSA *, Next, 4, 4, 4); - TEST_FIELD(INTERNET_BUFFERSA, LPCSTR, lpcszHeader, 8, 4, 4); - TEST_FIELD(INTERNET_BUFFERSA, DWORD, dwHeadersLength, 12, 4, 4); - TEST_FIELD(INTERNET_BUFFERSA, DWORD, dwHeadersTotal, 16, 4, 4); - TEST_FIELD(INTERNET_BUFFERSA, LPVOID, lpvBuffer, 20, 4, 4); - TEST_FIELD(INTERNET_BUFFERSA, DWORD, dwBufferLength, 24, 4, 4); - TEST_FIELD(INTERNET_BUFFERSA, DWORD, dwBufferTotal, 28, 4, 4); - TEST_FIELD(INTERNET_BUFFERSA, DWORD, dwOffsetLow, 32, 4, 4); - TEST_FIELD(INTERNET_BUFFERSA, DWORD, dwOffsetHigh, 36, 4, 4); + TEST_TYPE_SIZE (INTERNET_BUFFERSA, 40) + TEST_TYPE_ALIGN (INTERNET_BUFFERSA, 4) + TEST_FIELD_SIZE (INTERNET_BUFFERSA, dwStructSize, 4) + TEST_FIELD_ALIGN (INTERNET_BUFFERSA, dwStructSize, 4) + TEST_FIELD_OFFSET(INTERNET_BUFFERSA, dwStructSize, 0) + TEST_FIELD_SIZE (INTERNET_BUFFERSA, Next, 4) + TEST_FIELD_ALIGN (INTERNET_BUFFERSA, Next, 4) + TEST_FIELD_OFFSET(INTERNET_BUFFERSA, Next, 4) + TEST_FIELD_SIZE (INTERNET_BUFFERSA, lpcszHeader, 4) + TEST_FIELD_ALIGN (INTERNET_BUFFERSA, lpcszHeader, 4) + TEST_FIELD_OFFSET(INTERNET_BUFFERSA, lpcszHeader, 8) + TEST_FIELD_SIZE (INTERNET_BUFFERSA, dwHeadersLength, 4) + TEST_FIELD_ALIGN (INTERNET_BUFFERSA, dwHeadersLength, 4) + TEST_FIELD_OFFSET(INTERNET_BUFFERSA, dwHeadersLength, 12) + TEST_FIELD_SIZE (INTERNET_BUFFERSA, dwHeadersTotal, 4) + TEST_FIELD_ALIGN (INTERNET_BUFFERSA, dwHeadersTotal, 4) + TEST_FIELD_OFFSET(INTERNET_BUFFERSA, dwHeadersTotal, 16) + TEST_FIELD_SIZE (INTERNET_BUFFERSA, lpvBuffer, 4) + TEST_FIELD_ALIGN (INTERNET_BUFFERSA, lpvBuffer, 4) + TEST_FIELD_OFFSET(INTERNET_BUFFERSA, lpvBuffer, 20) + TEST_FIELD_SIZE (INTERNET_BUFFERSA, dwBufferLength, 4) + TEST_FIELD_ALIGN (INTERNET_BUFFERSA, dwBufferLength, 4) + TEST_FIELD_OFFSET(INTERNET_BUFFERSA, dwBufferLength, 24) + TEST_FIELD_SIZE (INTERNET_BUFFERSA, dwBufferTotal, 4) + TEST_FIELD_ALIGN (INTERNET_BUFFERSA, dwBufferTotal, 4) + TEST_FIELD_OFFSET(INTERNET_BUFFERSA, dwBufferTotal, 28) + TEST_FIELD_SIZE (INTERNET_BUFFERSA, dwOffsetLow, 4) + TEST_FIELD_ALIGN (INTERNET_BUFFERSA, dwOffsetLow, 4) + TEST_FIELD_OFFSET(INTERNET_BUFFERSA, dwOffsetLow, 32) + TEST_FIELD_SIZE (INTERNET_BUFFERSA, dwOffsetHigh, 4) + TEST_FIELD_ALIGN (INTERNET_BUFFERSA, dwOffsetHigh, 4) + TEST_FIELD_OFFSET(INTERNET_BUFFERSA, dwOffsetHigh, 36) } static void test_pack_INTERNET_BUFFERSW(void) { /* INTERNET_BUFFERSW (pack 4) */ - TEST_TYPE(INTERNET_BUFFERSW, 40, 4); - TEST_FIELD(INTERNET_BUFFERSW, DWORD, dwStructSize, 0, 4, 4); - TEST_FIELD(INTERNET_BUFFERSW, struct _INTERNET_BUFFERSW *, Next, 4, 4, 4); - TEST_FIELD(INTERNET_BUFFERSW, LPCWSTR, lpcszHeader, 8, 4, 4); - TEST_FIELD(INTERNET_BUFFERSW, DWORD, dwHeadersLength, 12, 4, 4); - TEST_FIELD(INTERNET_BUFFERSW, DWORD, dwHeadersTotal, 16, 4, 4); - TEST_FIELD(INTERNET_BUFFERSW, LPVOID, lpvBuffer, 20, 4, 4); - TEST_FIELD(INTERNET_BUFFERSW, DWORD, dwBufferLength, 24, 4, 4); - TEST_FIELD(INTERNET_BUFFERSW, DWORD, dwBufferTotal, 28, 4, 4); - TEST_FIELD(INTERNET_BUFFERSW, DWORD, dwOffsetLow, 32, 4, 4); - TEST_FIELD(INTERNET_BUFFERSW, DWORD, dwOffsetHigh, 36, 4, 4); + TEST_TYPE_SIZE (INTERNET_BUFFERSW, 40) + TEST_TYPE_ALIGN (INTERNET_BUFFERSW, 4) + TEST_FIELD_SIZE (INTERNET_BUFFERSW, dwStructSize, 4) + TEST_FIELD_ALIGN (INTERNET_BUFFERSW, dwStructSize, 4) + TEST_FIELD_OFFSET(INTERNET_BUFFERSW, dwStructSize, 0) + TEST_FIELD_SIZE (INTERNET_BUFFERSW, Next, 4) + TEST_FIELD_ALIGN (INTERNET_BUFFERSW, Next, 4) + TEST_FIELD_OFFSET(INTERNET_BUFFERSW, Next, 4) + TEST_FIELD_SIZE (INTERNET_BUFFERSW, lpcszHeader, 4) + TEST_FIELD_ALIGN (INTERNET_BUFFERSW, lpcszHeader, 4) + TEST_FIELD_OFFSET(INTERNET_BUFFERSW, lpcszHeader, 8) + TEST_FIELD_SIZE (INTERNET_BUFFERSW, dwHeadersLength, 4) + TEST_FIELD_ALIGN (INTERNET_BUFFERSW, dwHeadersLength, 4) + TEST_FIELD_OFFSET(INTERNET_BUFFERSW, dwHeadersLength, 12) + TEST_FIELD_SIZE (INTERNET_BUFFERSW, dwHeadersTotal, 4) + TEST_FIELD_ALIGN (INTERNET_BUFFERSW, dwHeadersTotal, 4) + TEST_FIELD_OFFSET(INTERNET_BUFFERSW, dwHeadersTotal, 16) + TEST_FIELD_SIZE (INTERNET_BUFFERSW, lpvBuffer, 4) + TEST_FIELD_ALIGN (INTERNET_BUFFERSW, lpvBuffer, 4) + TEST_FIELD_OFFSET(INTERNET_BUFFERSW, lpvBuffer, 20) + TEST_FIELD_SIZE (INTERNET_BUFFERSW, dwBufferLength, 4) + TEST_FIELD_ALIGN (INTERNET_BUFFERSW, dwBufferLength, 4) + TEST_FIELD_OFFSET(INTERNET_BUFFERSW, dwBufferLength, 24) + TEST_FIELD_SIZE (INTERNET_BUFFERSW, dwBufferTotal, 4) + TEST_FIELD_ALIGN (INTERNET_BUFFERSW, dwBufferTotal, 4) + TEST_FIELD_OFFSET(INTERNET_BUFFERSW, dwBufferTotal, 28) + TEST_FIELD_SIZE (INTERNET_BUFFERSW, dwOffsetLow, 4) + TEST_FIELD_ALIGN (INTERNET_BUFFERSW, dwOffsetLow, 4) + TEST_FIELD_OFFSET(INTERNET_BUFFERSW, dwOffsetLow, 32) + TEST_FIELD_SIZE (INTERNET_BUFFERSW, dwOffsetHigh, 4) + TEST_FIELD_ALIGN (INTERNET_BUFFERSW, dwOffsetHigh, 4) + TEST_FIELD_OFFSET(INTERNET_BUFFERSW, dwOffsetHigh, 36) } static void test_pack_INTERNET_CACHE_ENTRY_INFOA(void) { /* INTERNET_CACHE_ENTRY_INFOA (pack 4) */ - TEST_FIELD(INTERNET_CACHE_ENTRY_INFOA, DWORD, dwStructSize, 0, 4, 4); - TEST_FIELD(INTERNET_CACHE_ENTRY_INFOA, LPSTR, lpszSourceUrlName, 4, 4, 4); - TEST_FIELD(INTERNET_CACHE_ENTRY_INFOA, LPSTR, lpszLocalFileName, 8, 4, 4); - TEST_FIELD(INTERNET_CACHE_ENTRY_INFOA, DWORD, CacheEntryType, 12, 4, 4); - TEST_FIELD(INTERNET_CACHE_ENTRY_INFOA, DWORD, dwUseCount, 16, 4, 4); - TEST_FIELD(INTERNET_CACHE_ENTRY_INFOA, DWORD, dwHitRate, 20, 4, 4); - TEST_FIELD(INTERNET_CACHE_ENTRY_INFOA, DWORD, dwSizeLow, 24, 4, 4); - TEST_FIELD(INTERNET_CACHE_ENTRY_INFOA, DWORD, dwSizeHigh, 28, 4, 4); - TEST_FIELD(INTERNET_CACHE_ENTRY_INFOA, FILETIME, LastModifiedTime, 32, 8, 4); - TEST_FIELD(INTERNET_CACHE_ENTRY_INFOA, FILETIME, ExpireTime, 40, 8, 4); - TEST_FIELD(INTERNET_CACHE_ENTRY_INFOA, FILETIME, LastAccessTime, 48, 8, 4); - TEST_FIELD(INTERNET_CACHE_ENTRY_INFOA, FILETIME, LastSyncTime, 56, 8, 4); - TEST_FIELD(INTERNET_CACHE_ENTRY_INFOA, LPBYTE, lpHeaderInfo, 64, 4, 4); - TEST_FIELD(INTERNET_CACHE_ENTRY_INFOA, DWORD, dwHeaderInfoSize, 68, 4, 4); - TEST_FIELD(INTERNET_CACHE_ENTRY_INFOA, LPSTR, lpszFileExtension, 72, 4, 4); + TEST_FIELD_SIZE (INTERNET_CACHE_ENTRY_INFOA, dwStructSize, 4) + TEST_FIELD_ALIGN (INTERNET_CACHE_ENTRY_INFOA, dwStructSize, 4) + TEST_FIELD_OFFSET(INTERNET_CACHE_ENTRY_INFOA, dwStructSize, 0) + TEST_FIELD_SIZE (INTERNET_CACHE_ENTRY_INFOA, lpszSourceUrlName, 4) + TEST_FIELD_ALIGN (INTERNET_CACHE_ENTRY_INFOA, lpszSourceUrlName, 4) + TEST_FIELD_OFFSET(INTERNET_CACHE_ENTRY_INFOA, lpszSourceUrlName, 4) + TEST_FIELD_SIZE (INTERNET_CACHE_ENTRY_INFOA, lpszLocalFileName, 4) + TEST_FIELD_ALIGN (INTERNET_CACHE_ENTRY_INFOA, lpszLocalFileName, 4) + TEST_FIELD_OFFSET(INTERNET_CACHE_ENTRY_INFOA, lpszLocalFileName, 8) + TEST_FIELD_SIZE (INTERNET_CACHE_ENTRY_INFOA, CacheEntryType, 4) + TEST_FIELD_ALIGN (INTERNET_CACHE_ENTRY_INFOA, CacheEntryType, 4) + TEST_FIELD_OFFSET(INTERNET_CACHE_ENTRY_INFOA, CacheEntryType, 12) + TEST_FIELD_SIZE (INTERNET_CACHE_ENTRY_INFOA, dwUseCount, 4) + TEST_FIELD_ALIGN (INTERNET_CACHE_ENTRY_INFOA, dwUseCount, 4) + TEST_FIELD_OFFSET(INTERNET_CACHE_ENTRY_INFOA, dwUseCount, 16) + TEST_FIELD_SIZE (INTERNET_CACHE_ENTRY_INFOA, dwHitRate, 4) + TEST_FIELD_ALIGN (INTERNET_CACHE_ENTRY_INFOA, dwHitRate, 4) + TEST_FIELD_OFFSET(INTERNET_CACHE_ENTRY_INFOA, dwHitRate, 20) + TEST_FIELD_SIZE (INTERNET_CACHE_ENTRY_INFOA, dwSizeLow, 4) + TEST_FIELD_ALIGN (INTERNET_CACHE_ENTRY_INFOA, dwSizeLow, 4) + TEST_FIELD_OFFSET(INTERNET_CACHE_ENTRY_INFOA, dwSizeLow, 24) + TEST_FIELD_SIZE (INTERNET_CACHE_ENTRY_INFOA, dwSizeHigh, 4) + TEST_FIELD_ALIGN (INTERNET_CACHE_ENTRY_INFOA, dwSizeHigh, 4) + TEST_FIELD_OFFSET(INTERNET_CACHE_ENTRY_INFOA, dwSizeHigh, 28) + TEST_FIELD_SIZE (INTERNET_CACHE_ENTRY_INFOA, LastModifiedTime, 8) + TEST_FIELD_ALIGN (INTERNET_CACHE_ENTRY_INFOA, LastModifiedTime, 4) + TEST_FIELD_OFFSET(INTERNET_CACHE_ENTRY_INFOA, LastModifiedTime, 32) + TEST_FIELD_SIZE (INTERNET_CACHE_ENTRY_INFOA, ExpireTime, 8) + TEST_FIELD_ALIGN (INTERNET_CACHE_ENTRY_INFOA, ExpireTime, 4) + TEST_FIELD_OFFSET(INTERNET_CACHE_ENTRY_INFOA, ExpireTime, 40) + TEST_FIELD_SIZE (INTERNET_CACHE_ENTRY_INFOA, LastAccessTime, 8) + TEST_FIELD_ALIGN (INTERNET_CACHE_ENTRY_INFOA, LastAccessTime, 4) + TEST_FIELD_OFFSET(INTERNET_CACHE_ENTRY_INFOA, LastAccessTime, 48) + TEST_FIELD_SIZE (INTERNET_CACHE_ENTRY_INFOA, LastSyncTime, 8) + TEST_FIELD_ALIGN (INTERNET_CACHE_ENTRY_INFOA, LastSyncTime, 4) + TEST_FIELD_OFFSET(INTERNET_CACHE_ENTRY_INFOA, LastSyncTime, 56) + TEST_FIELD_SIZE (INTERNET_CACHE_ENTRY_INFOA, lpHeaderInfo, 4) + TEST_FIELD_ALIGN (INTERNET_CACHE_ENTRY_INFOA, lpHeaderInfo, 4) + TEST_FIELD_OFFSET(INTERNET_CACHE_ENTRY_INFOA, lpHeaderInfo, 64) + TEST_FIELD_SIZE (INTERNET_CACHE_ENTRY_INFOA, dwHeaderInfoSize, 4) + TEST_FIELD_ALIGN (INTERNET_CACHE_ENTRY_INFOA, dwHeaderInfoSize, 4) + TEST_FIELD_OFFSET(INTERNET_CACHE_ENTRY_INFOA, dwHeaderInfoSize, 68) + TEST_FIELD_SIZE (INTERNET_CACHE_ENTRY_INFOA, lpszFileExtension, 4) + TEST_FIELD_ALIGN (INTERNET_CACHE_ENTRY_INFOA, lpszFileExtension, 4) + TEST_FIELD_OFFSET(INTERNET_CACHE_ENTRY_INFOA, lpszFileExtension, 72) } static void test_pack_INTERNET_CACHE_ENTRY_INFOW(void) { /* INTERNET_CACHE_ENTRY_INFOW (pack 4) */ - TEST_FIELD(INTERNET_CACHE_ENTRY_INFOW, DWORD, dwStructSize, 0, 4, 4); - TEST_FIELD(INTERNET_CACHE_ENTRY_INFOW, LPWSTR, lpszSourceUrlName, 4, 4, 4); - TEST_FIELD(INTERNET_CACHE_ENTRY_INFOW, LPWSTR, lpszLocalFileName, 8, 4, 4); - TEST_FIELD(INTERNET_CACHE_ENTRY_INFOW, DWORD, CacheEntryType, 12, 4, 4); - TEST_FIELD(INTERNET_CACHE_ENTRY_INFOW, DWORD, dwUseCount, 16, 4, 4); - TEST_FIELD(INTERNET_CACHE_ENTRY_INFOW, DWORD, dwHitRate, 20, 4, 4); - TEST_FIELD(INTERNET_CACHE_ENTRY_INFOW, DWORD, dwSizeLow, 24, 4, 4); - TEST_FIELD(INTERNET_CACHE_ENTRY_INFOW, DWORD, dwSizeHigh, 28, 4, 4); - TEST_FIELD(INTERNET_CACHE_ENTRY_INFOW, FILETIME, LastModifiedTime, 32, 8, 4); - TEST_FIELD(INTERNET_CACHE_ENTRY_INFOW, FILETIME, ExpireTime, 40, 8, 4); - TEST_FIELD(INTERNET_CACHE_ENTRY_INFOW, FILETIME, LastAccessTime, 48, 8, 4); - TEST_FIELD(INTERNET_CACHE_ENTRY_INFOW, FILETIME, LastSyncTime, 56, 8, 4); - TEST_FIELD(INTERNET_CACHE_ENTRY_INFOW, LPBYTE, lpHeaderInfo, 64, 4, 4); - TEST_FIELD(INTERNET_CACHE_ENTRY_INFOW, DWORD, dwHeaderInfoSize, 68, 4, 4); - TEST_FIELD(INTERNET_CACHE_ENTRY_INFOW, LPWSTR, lpszFileExtension, 72, 4, 4); + TEST_FIELD_SIZE (INTERNET_CACHE_ENTRY_INFOW, dwStructSize, 4) + TEST_FIELD_ALIGN (INTERNET_CACHE_ENTRY_INFOW, dwStructSize, 4) + TEST_FIELD_OFFSET(INTERNET_CACHE_ENTRY_INFOW, dwStructSize, 0) + TEST_FIELD_SIZE (INTERNET_CACHE_ENTRY_INFOW, lpszSourceUrlName, 4) + TEST_FIELD_ALIGN (INTERNET_CACHE_ENTRY_INFOW, lpszSourceUrlName, 4) + TEST_FIELD_OFFSET(INTERNET_CACHE_ENTRY_INFOW, lpszSourceUrlName, 4) + TEST_FIELD_SIZE (INTERNET_CACHE_ENTRY_INFOW, lpszLocalFileName, 4) + TEST_FIELD_ALIGN (INTERNET_CACHE_ENTRY_INFOW, lpszLocalFileName, 4) + TEST_FIELD_OFFSET(INTERNET_CACHE_ENTRY_INFOW, lpszLocalFileName, 8) + TEST_FIELD_SIZE (INTERNET_CACHE_ENTRY_INFOW, CacheEntryType, 4) + TEST_FIELD_ALIGN (INTERNET_CACHE_ENTRY_INFOW, CacheEntryType, 4) + TEST_FIELD_OFFSET(INTERNET_CACHE_ENTRY_INFOW, CacheEntryType, 12) + TEST_FIELD_SIZE (INTERNET_CACHE_ENTRY_INFOW, dwUseCount, 4) + TEST_FIELD_ALIGN (INTERNET_CACHE_ENTRY_INFOW, dwUseCount, 4) + TEST_FIELD_OFFSET(INTERNET_CACHE_ENTRY_INFOW, dwUseCount, 16) + TEST_FIELD_SIZE (INTERNET_CACHE_ENTRY_INFOW, dwHitRate, 4) + TEST_FIELD_ALIGN (INTERNET_CACHE_ENTRY_INFOW, dwHitRate, 4) + TEST_FIELD_OFFSET(INTERNET_CACHE_ENTRY_INFOW, dwHitRate, 20) + TEST_FIELD_SIZE (INTERNET_CACHE_ENTRY_INFOW, dwSizeLow, 4) + TEST_FIELD_ALIGN (INTERNET_CACHE_ENTRY_INFOW, dwSizeLow, 4) + TEST_FIELD_OFFSET(INTERNET_CACHE_ENTRY_INFOW, dwSizeLow, 24) + TEST_FIELD_SIZE (INTERNET_CACHE_ENTRY_INFOW, dwSizeHigh, 4) + TEST_FIELD_ALIGN (INTERNET_CACHE_ENTRY_INFOW, dwSizeHigh, 4) + TEST_FIELD_OFFSET(INTERNET_CACHE_ENTRY_INFOW, dwSizeHigh, 28) + TEST_FIELD_SIZE (INTERNET_CACHE_ENTRY_INFOW, LastModifiedTime, 8) + TEST_FIELD_ALIGN (INTERNET_CACHE_ENTRY_INFOW, LastModifiedTime, 4) + TEST_FIELD_OFFSET(INTERNET_CACHE_ENTRY_INFOW, LastModifiedTime, 32) + TEST_FIELD_SIZE (INTERNET_CACHE_ENTRY_INFOW, ExpireTime, 8) + TEST_FIELD_ALIGN (INTERNET_CACHE_ENTRY_INFOW, ExpireTime, 4) + TEST_FIELD_OFFSET(INTERNET_CACHE_ENTRY_INFOW, ExpireTime, 40) + TEST_FIELD_SIZE (INTERNET_CACHE_ENTRY_INFOW, LastAccessTime, 8) + TEST_FIELD_ALIGN (INTERNET_CACHE_ENTRY_INFOW, LastAccessTime, 4) + TEST_FIELD_OFFSET(INTERNET_CACHE_ENTRY_INFOW, LastAccessTime, 48) + TEST_FIELD_SIZE (INTERNET_CACHE_ENTRY_INFOW, LastSyncTime, 8) + TEST_FIELD_ALIGN (INTERNET_CACHE_ENTRY_INFOW, LastSyncTime, 4) + TEST_FIELD_OFFSET(INTERNET_CACHE_ENTRY_INFOW, LastSyncTime, 56) + TEST_FIELD_SIZE (INTERNET_CACHE_ENTRY_INFOW, lpHeaderInfo, 4) + TEST_FIELD_ALIGN (INTERNET_CACHE_ENTRY_INFOW, lpHeaderInfo, 4) + TEST_FIELD_OFFSET(INTERNET_CACHE_ENTRY_INFOW, lpHeaderInfo, 64) + TEST_FIELD_SIZE (INTERNET_CACHE_ENTRY_INFOW, dwHeaderInfoSize, 4) + TEST_FIELD_ALIGN (INTERNET_CACHE_ENTRY_INFOW, dwHeaderInfoSize, 4) + TEST_FIELD_OFFSET(INTERNET_CACHE_ENTRY_INFOW, dwHeaderInfoSize, 68) + TEST_FIELD_SIZE (INTERNET_CACHE_ENTRY_INFOW, lpszFileExtension, 4) + TEST_FIELD_ALIGN (INTERNET_CACHE_ENTRY_INFOW, lpszFileExtension, 4) + TEST_FIELD_OFFSET(INTERNET_CACHE_ENTRY_INFOW, lpszFileExtension, 72) } static void test_pack_INTERNET_CERTIFICATE_INFOA(void) { /* INTERNET_CERTIFICATE_INFOA (pack 4) */ - TEST_TYPE(INTERNET_CERTIFICATE_INFOA, 40, 4); - TEST_FIELD(INTERNET_CERTIFICATE_INFOA, FILETIME, ftExpiry, 0, 8, 4); - TEST_FIELD(INTERNET_CERTIFICATE_INFOA, FILETIME, ftStart, 8, 8, 4); - TEST_FIELD(INTERNET_CERTIFICATE_INFOA, LPSTR, lpszSubjectInfo, 16, 4, 4); - TEST_FIELD(INTERNET_CERTIFICATE_INFOA, LPSTR, lpszIssuerInfo, 20, 4, 4); - TEST_FIELD(INTERNET_CERTIFICATE_INFOA, LPSTR, lpszProtocolName, 24, 4, 4); - TEST_FIELD(INTERNET_CERTIFICATE_INFOA, LPSTR, lpszSignatureAlgName, 28, 4, 4); - TEST_FIELD(INTERNET_CERTIFICATE_INFOA, LPSTR, lpszEncryptionAlgName, 32, 4, 4); - TEST_FIELD(INTERNET_CERTIFICATE_INFOA, DWORD, dwKeySize, 36, 4, 4); + TEST_TYPE_SIZE (INTERNET_CERTIFICATE_INFOA, 40) + TEST_TYPE_ALIGN (INTERNET_CERTIFICATE_INFOA, 4) + TEST_FIELD_SIZE (INTERNET_CERTIFICATE_INFOA, ftExpiry, 8) + TEST_FIELD_ALIGN (INTERNET_CERTIFICATE_INFOA, ftExpiry, 4) + TEST_FIELD_OFFSET(INTERNET_CERTIFICATE_INFOA, ftExpiry, 0) + TEST_FIELD_SIZE (INTERNET_CERTIFICATE_INFOA, ftStart, 8) + TEST_FIELD_ALIGN (INTERNET_CERTIFICATE_INFOA, ftStart, 4) + TEST_FIELD_OFFSET(INTERNET_CERTIFICATE_INFOA, ftStart, 8) + TEST_FIELD_SIZE (INTERNET_CERTIFICATE_INFOA, lpszSubjectInfo, 4) + TEST_FIELD_ALIGN (INTERNET_CERTIFICATE_INFOA, lpszSubjectInfo, 4) + TEST_FIELD_OFFSET(INTERNET_CERTIFICATE_INFOA, lpszSubjectInfo, 16) + TEST_FIELD_SIZE (INTERNET_CERTIFICATE_INFOA, lpszIssuerInfo, 4) + TEST_FIELD_ALIGN (INTERNET_CERTIFICATE_INFOA, lpszIssuerInfo, 4) + TEST_FIELD_OFFSET(INTERNET_CERTIFICATE_INFOA, lpszIssuerInfo, 20) + TEST_FIELD_SIZE (INTERNET_CERTIFICATE_INFOA, lpszProtocolName, 4) + TEST_FIELD_ALIGN (INTERNET_CERTIFICATE_INFOA, lpszProtocolName, 4) + TEST_FIELD_OFFSET(INTERNET_CERTIFICATE_INFOA, lpszProtocolName, 24) + TEST_FIELD_SIZE (INTERNET_CERTIFICATE_INFOA, lpszSignatureAlgName, 4) + TEST_FIELD_ALIGN (INTERNET_CERTIFICATE_INFOA, lpszSignatureAlgName, 4) + TEST_FIELD_OFFSET(INTERNET_CERTIFICATE_INFOA, lpszSignatureAlgName, 28) + TEST_FIELD_SIZE (INTERNET_CERTIFICATE_INFOA, lpszEncryptionAlgName, 4) + TEST_FIELD_ALIGN (INTERNET_CERTIFICATE_INFOA, lpszEncryptionAlgName, 4) + TEST_FIELD_OFFSET(INTERNET_CERTIFICATE_INFOA, lpszEncryptionAlgName, 32) + TEST_FIELD_SIZE (INTERNET_CERTIFICATE_INFOA, dwKeySize, 4) + TEST_FIELD_ALIGN (INTERNET_CERTIFICATE_INFOA, dwKeySize, 4) + TEST_FIELD_OFFSET(INTERNET_CERTIFICATE_INFOA, dwKeySize, 36) } static void test_pack_INTERNET_CERTIFICATE_INFOW(void) { /* INTERNET_CERTIFICATE_INFOW (pack 4) */ - TEST_TYPE(INTERNET_CERTIFICATE_INFOW, 40, 4); - TEST_FIELD(INTERNET_CERTIFICATE_INFOW, FILETIME, ftExpiry, 0, 8, 4); - TEST_FIELD(INTERNET_CERTIFICATE_INFOW, FILETIME, ftStart, 8, 8, 4); - TEST_FIELD(INTERNET_CERTIFICATE_INFOW, LPWSTR, lpszSubjectInfo, 16, 4, 4); - TEST_FIELD(INTERNET_CERTIFICATE_INFOW, LPWSTR, lpszIssuerInfo, 20, 4, 4); - TEST_FIELD(INTERNET_CERTIFICATE_INFOW, LPWSTR, lpszProtocolName, 24, 4, 4); - TEST_FIELD(INTERNET_CERTIFICATE_INFOW, LPWSTR, lpszSignatureAlgName, 28, 4, 4); - TEST_FIELD(INTERNET_CERTIFICATE_INFOW, LPWSTR, lpszEncryptionAlgName, 32, 4, 4); - TEST_FIELD(INTERNET_CERTIFICATE_INFOW, DWORD, dwKeySize, 36, 4, 4); + TEST_TYPE_SIZE (INTERNET_CERTIFICATE_INFOW, 40) + TEST_TYPE_ALIGN (INTERNET_CERTIFICATE_INFOW, 4) + TEST_FIELD_SIZE (INTERNET_CERTIFICATE_INFOW, ftExpiry, 8) + TEST_FIELD_ALIGN (INTERNET_CERTIFICATE_INFOW, ftExpiry, 4) + TEST_FIELD_OFFSET(INTERNET_CERTIFICATE_INFOW, ftExpiry, 0) + TEST_FIELD_SIZE (INTERNET_CERTIFICATE_INFOW, ftStart, 8) + TEST_FIELD_ALIGN (INTERNET_CERTIFICATE_INFOW, ftStart, 4) + TEST_FIELD_OFFSET(INTERNET_CERTIFICATE_INFOW, ftStart, 8) + TEST_FIELD_SIZE (INTERNET_CERTIFICATE_INFOW, lpszSubjectInfo, 4) + TEST_FIELD_ALIGN (INTERNET_CERTIFICATE_INFOW, lpszSubjectInfo, 4) + TEST_FIELD_OFFSET(INTERNET_CERTIFICATE_INFOW, lpszSubjectInfo, 16) + TEST_FIELD_SIZE (INTERNET_CERTIFICATE_INFOW, lpszIssuerInfo, 4) + TEST_FIELD_ALIGN (INTERNET_CERTIFICATE_INFOW, lpszIssuerInfo, 4) + TEST_FIELD_OFFSET(INTERNET_CERTIFICATE_INFOW, lpszIssuerInfo, 20) + TEST_FIELD_SIZE (INTERNET_CERTIFICATE_INFOW, lpszProtocolName, 4) + TEST_FIELD_ALIGN (INTERNET_CERTIFICATE_INFOW, lpszProtocolName, 4) + TEST_FIELD_OFFSET(INTERNET_CERTIFICATE_INFOW, lpszProtocolName, 24) + TEST_FIELD_SIZE (INTERNET_CERTIFICATE_INFOW, lpszSignatureAlgName, 4) + TEST_FIELD_ALIGN (INTERNET_CERTIFICATE_INFOW, lpszSignatureAlgName, 4) + TEST_FIELD_OFFSET(INTERNET_CERTIFICATE_INFOW, lpszSignatureAlgName, 28) + TEST_FIELD_SIZE (INTERNET_CERTIFICATE_INFOW, lpszEncryptionAlgName, 4) + TEST_FIELD_ALIGN (INTERNET_CERTIFICATE_INFOW, lpszEncryptionAlgName, 4) + TEST_FIELD_OFFSET(INTERNET_CERTIFICATE_INFOW, lpszEncryptionAlgName, 32) + TEST_FIELD_SIZE (INTERNET_CERTIFICATE_INFOW, dwKeySize, 4) + TEST_FIELD_ALIGN (INTERNET_CERTIFICATE_INFOW, dwKeySize, 4) + TEST_FIELD_OFFSET(INTERNET_CERTIFICATE_INFOW, dwKeySize, 36) } static void test_pack_INTERNET_CONNECTED_INFO(void) { /* INTERNET_CONNECTED_INFO (pack 4) */ - TEST_TYPE(INTERNET_CONNECTED_INFO, 8, 4); - TEST_FIELD(INTERNET_CONNECTED_INFO, DWORD, dwConnectedState, 0, 4, 4); - TEST_FIELD(INTERNET_CONNECTED_INFO, DWORD, dwFlags, 4, 4, 4); + TEST_TYPE_SIZE (INTERNET_CONNECTED_INFO, 8) + TEST_TYPE_ALIGN (INTERNET_CONNECTED_INFO, 4) + TEST_FIELD_SIZE (INTERNET_CONNECTED_INFO, dwConnectedState, 4) + TEST_FIELD_ALIGN (INTERNET_CONNECTED_INFO, dwConnectedState, 4) + TEST_FIELD_OFFSET(INTERNET_CONNECTED_INFO, dwConnectedState, 0) + TEST_FIELD_SIZE (INTERNET_CONNECTED_INFO, dwFlags, 4) + TEST_FIELD_ALIGN (INTERNET_CONNECTED_INFO, dwFlags, 4) + TEST_FIELD_OFFSET(INTERNET_CONNECTED_INFO, dwFlags, 4) } static void test_pack_INTERNET_PORT(void) { /* INTERNET_PORT */ - TEST_TYPE(INTERNET_PORT, 2, 2); - TEST_TYPE_UNSIGNED(INTERNET_PORT); + TEST_TYPE_SIZE (INTERNET_PORT, 2) + TEST_TYPE_ALIGN (INTERNET_PORT, 2) + TEST_TYPE_UNSIGNED(INTERNET_PORT) } static void test_pack_INTERNET_PROXY_INFOA(void) { /* INTERNET_PROXY_INFOA (pack 4) */ - TEST_TYPE(INTERNET_PROXY_INFOA, 12, 4); - TEST_FIELD(INTERNET_PROXY_INFOA, DWORD, dwAccessType, 0, 4, 4); - TEST_FIELD(INTERNET_PROXY_INFOA, LPCSTR, lpszProxy, 4, 4, 4); - TEST_FIELD(INTERNET_PROXY_INFOA, LPCSTR, lpszProxyBypass, 8, 4, 4); + TEST_TYPE_SIZE (INTERNET_PROXY_INFOA, 12) + TEST_TYPE_ALIGN (INTERNET_PROXY_INFOA, 4) + TEST_FIELD_SIZE (INTERNET_PROXY_INFOA, dwAccessType, 4) + TEST_FIELD_ALIGN (INTERNET_PROXY_INFOA, dwAccessType, 4) + TEST_FIELD_OFFSET(INTERNET_PROXY_INFOA, dwAccessType, 0) + TEST_FIELD_SIZE (INTERNET_PROXY_INFOA, lpszProxy, 4) + TEST_FIELD_ALIGN (INTERNET_PROXY_INFOA, lpszProxy, 4) + TEST_FIELD_OFFSET(INTERNET_PROXY_INFOA, lpszProxy, 4) + TEST_FIELD_SIZE (INTERNET_PROXY_INFOA, lpszProxyBypass, 4) + TEST_FIELD_ALIGN (INTERNET_PROXY_INFOA, lpszProxyBypass, 4) + TEST_FIELD_OFFSET(INTERNET_PROXY_INFOA, lpszProxyBypass, 8) } static void test_pack_INTERNET_PROXY_INFOW(void) { /* INTERNET_PROXY_INFOW (pack 4) */ - TEST_TYPE(INTERNET_PROXY_INFOW, 12, 4); - TEST_FIELD(INTERNET_PROXY_INFOW, DWORD, dwAccessType, 0, 4, 4); - TEST_FIELD(INTERNET_PROXY_INFOW, LPCWSTR, lpszProxy, 4, 4, 4); - TEST_FIELD(INTERNET_PROXY_INFOW, LPCWSTR, lpszProxyBypass, 8, 4, 4); + TEST_TYPE_SIZE (INTERNET_PROXY_INFOW, 12) + TEST_TYPE_ALIGN (INTERNET_PROXY_INFOW, 4) + TEST_FIELD_SIZE (INTERNET_PROXY_INFOW, dwAccessType, 4) + TEST_FIELD_ALIGN (INTERNET_PROXY_INFOW, dwAccessType, 4) + TEST_FIELD_OFFSET(INTERNET_PROXY_INFOW, dwAccessType, 0) + TEST_FIELD_SIZE (INTERNET_PROXY_INFOW, lpszProxy, 4) + TEST_FIELD_ALIGN (INTERNET_PROXY_INFOW, lpszProxy, 4) + TEST_FIELD_OFFSET(INTERNET_PROXY_INFOW, lpszProxy, 4) + TEST_FIELD_SIZE (INTERNET_PROXY_INFOW, lpszProxyBypass, 4) + TEST_FIELD_ALIGN (INTERNET_PROXY_INFOW, lpszProxyBypass, 4) + TEST_FIELD_OFFSET(INTERNET_PROXY_INFOW, lpszProxyBypass, 8) } static void test_pack_INTERNET_STATUS_CALLBACK(void) { /* INTERNET_STATUS_CALLBACK */ - TEST_TYPE(INTERNET_STATUS_CALLBACK, 4, 4); + TEST_TYPE_SIZE (INTERNET_STATUS_CALLBACK, 4) + TEST_TYPE_ALIGN (INTERNET_STATUS_CALLBACK, 4) } static void test_pack_INTERNET_VERSION_INFO(void) { /* INTERNET_VERSION_INFO (pack 4) */ - TEST_TYPE(INTERNET_VERSION_INFO, 8, 4); - TEST_FIELD(INTERNET_VERSION_INFO, DWORD, dwMajorVersion, 0, 4, 4); - TEST_FIELD(INTERNET_VERSION_INFO, DWORD, dwMinorVersion, 4, 4, 4); + TEST_TYPE_SIZE (INTERNET_VERSION_INFO, 8) + TEST_TYPE_ALIGN (INTERNET_VERSION_INFO, 4) + TEST_FIELD_SIZE (INTERNET_VERSION_INFO, dwMajorVersion, 4) + TEST_FIELD_ALIGN (INTERNET_VERSION_INFO, dwMajorVersion, 4) + TEST_FIELD_OFFSET(INTERNET_VERSION_INFO, dwMajorVersion, 0) + TEST_FIELD_SIZE (INTERNET_VERSION_INFO, dwMinorVersion, 4) + TEST_FIELD_ALIGN (INTERNET_VERSION_INFO, dwMinorVersion, 4) + TEST_FIELD_OFFSET(INTERNET_VERSION_INFO, dwMinorVersion, 4) } static void test_pack_LPGOPHER_ABSTRACT_ATTRIBUTE_TYPEA(void) { /* LPGOPHER_ABSTRACT_ATTRIBUTE_TYPEA */ - TEST_TYPE(LPGOPHER_ABSTRACT_ATTRIBUTE_TYPEA, 4, 4); - TEST_TYPE_POINTER(LPGOPHER_ABSTRACT_ATTRIBUTE_TYPEA, 8, 4); + TEST_TYPE_SIZE (LPGOPHER_ABSTRACT_ATTRIBUTE_TYPEA, 4) + TEST_TYPE_ALIGN (LPGOPHER_ABSTRACT_ATTRIBUTE_TYPEA, 4) + TEST_TARGET_SIZE (LPGOPHER_ABSTRACT_ATTRIBUTE_TYPEA, 8) + TEST_TARGET_ALIGN(LPGOPHER_ABSTRACT_ATTRIBUTE_TYPEA, 4) } static void test_pack_LPGOPHER_ABSTRACT_ATTRIBUTE_TYPEW(void) { /* LPGOPHER_ABSTRACT_ATTRIBUTE_TYPEW */ - TEST_TYPE(LPGOPHER_ABSTRACT_ATTRIBUTE_TYPEW, 4, 4); - TEST_TYPE_POINTER(LPGOPHER_ABSTRACT_ATTRIBUTE_TYPEW, 8, 4); + TEST_TYPE_SIZE (LPGOPHER_ABSTRACT_ATTRIBUTE_TYPEW, 4) + TEST_TYPE_ALIGN (LPGOPHER_ABSTRACT_ATTRIBUTE_TYPEW, 4) + TEST_TARGET_SIZE (LPGOPHER_ABSTRACT_ATTRIBUTE_TYPEW, 8) + TEST_TARGET_ALIGN(LPGOPHER_ABSTRACT_ATTRIBUTE_TYPEW, 4) } static void test_pack_LPGOPHER_ADMIN_ATTRIBUTE_TYPEA(void) { /* LPGOPHER_ADMIN_ATTRIBUTE_TYPEA */ - TEST_TYPE(LPGOPHER_ADMIN_ATTRIBUTE_TYPEA, 4, 4); - TEST_TYPE_POINTER(LPGOPHER_ADMIN_ATTRIBUTE_TYPEA, 8, 4); + TEST_TYPE_SIZE (LPGOPHER_ADMIN_ATTRIBUTE_TYPEA, 4) + TEST_TYPE_ALIGN (LPGOPHER_ADMIN_ATTRIBUTE_TYPEA, 4) + TEST_TARGET_SIZE (LPGOPHER_ADMIN_ATTRIBUTE_TYPEA, 8) + TEST_TARGET_ALIGN(LPGOPHER_ADMIN_ATTRIBUTE_TYPEA, 4) } static void test_pack_LPGOPHER_ADMIN_ATTRIBUTE_TYPEW(void) { /* LPGOPHER_ADMIN_ATTRIBUTE_TYPEW */ - TEST_TYPE(LPGOPHER_ADMIN_ATTRIBUTE_TYPEW, 4, 4); - TEST_TYPE_POINTER(LPGOPHER_ADMIN_ATTRIBUTE_TYPEW, 8, 4); + TEST_TYPE_SIZE (LPGOPHER_ADMIN_ATTRIBUTE_TYPEW, 4) + TEST_TYPE_ALIGN (LPGOPHER_ADMIN_ATTRIBUTE_TYPEW, 4) + TEST_TARGET_SIZE (LPGOPHER_ADMIN_ATTRIBUTE_TYPEW, 8) + TEST_TARGET_ALIGN(LPGOPHER_ADMIN_ATTRIBUTE_TYPEW, 4) } static void test_pack_LPGOPHER_ASK_ATTRIBUTE_TYPEA(void) { /* LPGOPHER_ASK_ATTRIBUTE_TYPEA */ - TEST_TYPE(LPGOPHER_ASK_ATTRIBUTE_TYPEA, 4, 4); - TEST_TYPE_POINTER(LPGOPHER_ASK_ATTRIBUTE_TYPEA, 8, 4); + TEST_TYPE_SIZE (LPGOPHER_ASK_ATTRIBUTE_TYPEA, 4) + TEST_TYPE_ALIGN (LPGOPHER_ASK_ATTRIBUTE_TYPEA, 4) + TEST_TARGET_SIZE (LPGOPHER_ASK_ATTRIBUTE_TYPEA, 8) + TEST_TARGET_ALIGN(LPGOPHER_ASK_ATTRIBUTE_TYPEA, 4) } static void test_pack_LPGOPHER_ASK_ATTRIBUTE_TYPEW(void) { /* LPGOPHER_ASK_ATTRIBUTE_TYPEW */ - TEST_TYPE(LPGOPHER_ASK_ATTRIBUTE_TYPEW, 4, 4); - TEST_TYPE_POINTER(LPGOPHER_ASK_ATTRIBUTE_TYPEW, 8, 4); + TEST_TYPE_SIZE (LPGOPHER_ASK_ATTRIBUTE_TYPEW, 4) + TEST_TYPE_ALIGN (LPGOPHER_ASK_ATTRIBUTE_TYPEW, 4) + TEST_TARGET_SIZE (LPGOPHER_ASK_ATTRIBUTE_TYPEW, 8) + TEST_TARGET_ALIGN(LPGOPHER_ASK_ATTRIBUTE_TYPEW, 4) } static void test_pack_LPGOPHER_ATTRIBUTE_TYPEA(void) { /* LPGOPHER_ATTRIBUTE_TYPEA */ - TEST_TYPE(LPGOPHER_ATTRIBUTE_TYPEA, 4, 4); + TEST_TYPE_SIZE (LPGOPHER_ATTRIBUTE_TYPEA, 4) + TEST_TYPE_ALIGN (LPGOPHER_ATTRIBUTE_TYPEA, 4) } static void test_pack_LPGOPHER_ATTRIBUTE_TYPEW(void) { /* LPGOPHER_ATTRIBUTE_TYPEW */ - TEST_TYPE(LPGOPHER_ATTRIBUTE_TYPEW, 4, 4); + TEST_TYPE_SIZE (LPGOPHER_ATTRIBUTE_TYPEW, 4) + TEST_TYPE_ALIGN (LPGOPHER_ATTRIBUTE_TYPEW, 4) } static void test_pack_LPGOPHER_FIND_DATAA(void) { /* LPGOPHER_FIND_DATAA */ - TEST_TYPE(LPGOPHER_FIND_DATAA, 4, 4); - TEST_TYPE_POINTER(LPGOPHER_FIND_DATAA, 808, 4); + TEST_TYPE_SIZE (LPGOPHER_FIND_DATAA, 4) + TEST_TYPE_ALIGN (LPGOPHER_FIND_DATAA, 4) + TEST_TARGET_SIZE (LPGOPHER_FIND_DATAA, 808) + TEST_TARGET_ALIGN(LPGOPHER_FIND_DATAA, 4) } static void test_pack_LPGOPHER_FIND_DATAW(void) { /* LPGOPHER_FIND_DATAW */ - TEST_TYPE(LPGOPHER_FIND_DATAW, 4, 4); - TEST_TYPE_POINTER(LPGOPHER_FIND_DATAW, 1588, 4); + TEST_TYPE_SIZE (LPGOPHER_FIND_DATAW, 4) + TEST_TYPE_ALIGN (LPGOPHER_FIND_DATAW, 4) + TEST_TARGET_SIZE (LPGOPHER_FIND_DATAW, 1588) + TEST_TARGET_ALIGN(LPGOPHER_FIND_DATAW, 4) } static void test_pack_LPGOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE(void) { /* LPGOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE */ - TEST_TYPE(LPGOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, 4, 4); - TEST_TYPE_POINTER(LPGOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, 24, 4); + TEST_TYPE_SIZE (LPGOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, 4) + TEST_TYPE_ALIGN (LPGOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, 4) + TEST_TARGET_SIZE (LPGOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, 24) + TEST_TARGET_ALIGN(LPGOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, 4) } static void test_pack_LPGOPHER_LOCATION_ATTRIBUTE_TYPEA(void) { /* LPGOPHER_LOCATION_ATTRIBUTE_TYPEA */ - TEST_TYPE(LPGOPHER_LOCATION_ATTRIBUTE_TYPEA, 4, 4); - TEST_TYPE_POINTER(LPGOPHER_LOCATION_ATTRIBUTE_TYPEA, 4, 4); + TEST_TYPE_SIZE (LPGOPHER_LOCATION_ATTRIBUTE_TYPEA, 4) + TEST_TYPE_ALIGN (LPGOPHER_LOCATION_ATTRIBUTE_TYPEA, 4) + TEST_TARGET_SIZE (LPGOPHER_LOCATION_ATTRIBUTE_TYPEA, 4) + TEST_TARGET_ALIGN(LPGOPHER_LOCATION_ATTRIBUTE_TYPEA, 4) } static void test_pack_LPGOPHER_LOCATION_ATTRIBUTE_TYPEW(void) { /* LPGOPHER_LOCATION_ATTRIBUTE_TYPEW */ - TEST_TYPE(LPGOPHER_LOCATION_ATTRIBUTE_TYPEW, 4, 4); - TEST_TYPE_POINTER(LPGOPHER_LOCATION_ATTRIBUTE_TYPEW, 4, 4); + TEST_TYPE_SIZE (LPGOPHER_LOCATION_ATTRIBUTE_TYPEW, 4) + TEST_TYPE_ALIGN (LPGOPHER_LOCATION_ATTRIBUTE_TYPEW, 4) + TEST_TARGET_SIZE (LPGOPHER_LOCATION_ATTRIBUTE_TYPEW, 4) + TEST_TARGET_ALIGN(LPGOPHER_LOCATION_ATTRIBUTE_TYPEW, 4) } static void test_pack_LPGOPHER_MOD_DATE_ATTRIBUTE_TYPE(void) { /* LPGOPHER_MOD_DATE_ATTRIBUTE_TYPE */ - TEST_TYPE(LPGOPHER_MOD_DATE_ATTRIBUTE_TYPE, 4, 4); - TEST_TYPE_POINTER(LPGOPHER_MOD_DATE_ATTRIBUTE_TYPE, 8, 4); + TEST_TYPE_SIZE (LPGOPHER_MOD_DATE_ATTRIBUTE_TYPE, 4) + TEST_TYPE_ALIGN (LPGOPHER_MOD_DATE_ATTRIBUTE_TYPE, 4) + TEST_TARGET_SIZE (LPGOPHER_MOD_DATE_ATTRIBUTE_TYPE, 8) + TEST_TARGET_ALIGN(LPGOPHER_MOD_DATE_ATTRIBUTE_TYPE, 4) } static void test_pack_LPGOPHER_ORGANIZATION_ATTRIBUTE_TYPEA(void) { /* LPGOPHER_ORGANIZATION_ATTRIBUTE_TYPEA */ - TEST_TYPE(LPGOPHER_ORGANIZATION_ATTRIBUTE_TYPEA, 4, 4); - TEST_TYPE_POINTER(LPGOPHER_ORGANIZATION_ATTRIBUTE_TYPEA, 4, 4); + TEST_TYPE_SIZE (LPGOPHER_ORGANIZATION_ATTRIBUTE_TYPEA, 4) + TEST_TYPE_ALIGN (LPGOPHER_ORGANIZATION_ATTRIBUTE_TYPEA, 4) + TEST_TARGET_SIZE (LPGOPHER_ORGANIZATION_ATTRIBUTE_TYPEA, 4) + TEST_TARGET_ALIGN(LPGOPHER_ORGANIZATION_ATTRIBUTE_TYPEA, 4) } static void test_pack_LPGOPHER_ORGANIZATION_ATTRIBUTE_TYPEW(void) { /* LPGOPHER_ORGANIZATION_ATTRIBUTE_TYPEW */ - TEST_TYPE(LPGOPHER_ORGANIZATION_ATTRIBUTE_TYPEW, 4, 4); - TEST_TYPE_POINTER(LPGOPHER_ORGANIZATION_ATTRIBUTE_TYPEW, 4, 4); + TEST_TYPE_SIZE (LPGOPHER_ORGANIZATION_ATTRIBUTE_TYPEW, 4) + TEST_TYPE_ALIGN (LPGOPHER_ORGANIZATION_ATTRIBUTE_TYPEW, 4) + TEST_TARGET_SIZE (LPGOPHER_ORGANIZATION_ATTRIBUTE_TYPEW, 4) + TEST_TARGET_ALIGN(LPGOPHER_ORGANIZATION_ATTRIBUTE_TYPEW, 4) } static void test_pack_LPGOPHER_PROVIDER_ATTRIBUTE_TYPEA(void) { /* LPGOPHER_PROVIDER_ATTRIBUTE_TYPEA */ - TEST_TYPE(LPGOPHER_PROVIDER_ATTRIBUTE_TYPEA, 4, 4); - TEST_TYPE_POINTER(LPGOPHER_PROVIDER_ATTRIBUTE_TYPEA, 4, 4); + TEST_TYPE_SIZE (LPGOPHER_PROVIDER_ATTRIBUTE_TYPEA, 4) + TEST_TYPE_ALIGN (LPGOPHER_PROVIDER_ATTRIBUTE_TYPEA, 4) + TEST_TARGET_SIZE (LPGOPHER_PROVIDER_ATTRIBUTE_TYPEA, 4) + TEST_TARGET_ALIGN(LPGOPHER_PROVIDER_ATTRIBUTE_TYPEA, 4) } static void test_pack_LPGOPHER_PROVIDER_ATTRIBUTE_TYPEW(void) { /* LPGOPHER_PROVIDER_ATTRIBUTE_TYPEW */ - TEST_TYPE(LPGOPHER_PROVIDER_ATTRIBUTE_TYPEW, 4, 4); - TEST_TYPE_POINTER(LPGOPHER_PROVIDER_ATTRIBUTE_TYPEW, 4, 4); + TEST_TYPE_SIZE (LPGOPHER_PROVIDER_ATTRIBUTE_TYPEW, 4) + TEST_TYPE_ALIGN (LPGOPHER_PROVIDER_ATTRIBUTE_TYPEW, 4) + TEST_TARGET_SIZE (LPGOPHER_PROVIDER_ATTRIBUTE_TYPEW, 4) + TEST_TARGET_ALIGN(LPGOPHER_PROVIDER_ATTRIBUTE_TYPEW, 4) } static void test_pack_LPGOPHER_SCORE_ATTRIBUTE_TYPE(void) { /* LPGOPHER_SCORE_ATTRIBUTE_TYPE */ - TEST_TYPE(LPGOPHER_SCORE_ATTRIBUTE_TYPE, 4, 4); - TEST_TYPE_POINTER(LPGOPHER_SCORE_ATTRIBUTE_TYPE, 4, 4); + TEST_TYPE_SIZE (LPGOPHER_SCORE_ATTRIBUTE_TYPE, 4) + TEST_TYPE_ALIGN (LPGOPHER_SCORE_ATTRIBUTE_TYPE, 4) + TEST_TARGET_SIZE (LPGOPHER_SCORE_ATTRIBUTE_TYPE, 4) + TEST_TARGET_ALIGN(LPGOPHER_SCORE_ATTRIBUTE_TYPE, 4) } static void test_pack_LPGOPHER_SCORE_RANGE_ATTRIBUTE_TYPE(void) { /* LPGOPHER_SCORE_RANGE_ATTRIBUTE_TYPE */ - TEST_TYPE(LPGOPHER_SCORE_RANGE_ATTRIBUTE_TYPE, 4, 4); - TEST_TYPE_POINTER(LPGOPHER_SCORE_RANGE_ATTRIBUTE_TYPE, 8, 4); + TEST_TYPE_SIZE (LPGOPHER_SCORE_RANGE_ATTRIBUTE_TYPE, 4) + TEST_TYPE_ALIGN (LPGOPHER_SCORE_RANGE_ATTRIBUTE_TYPE, 4) + TEST_TARGET_SIZE (LPGOPHER_SCORE_RANGE_ATTRIBUTE_TYPE, 8) + TEST_TARGET_ALIGN(LPGOPHER_SCORE_RANGE_ATTRIBUTE_TYPE, 4) } static void test_pack_LPGOPHER_SITE_ATTRIBUTE_TYPEA(void) { /* LPGOPHER_SITE_ATTRIBUTE_TYPEA */ - TEST_TYPE(LPGOPHER_SITE_ATTRIBUTE_TYPEA, 4, 4); - TEST_TYPE_POINTER(LPGOPHER_SITE_ATTRIBUTE_TYPEA, 4, 4); + TEST_TYPE_SIZE (LPGOPHER_SITE_ATTRIBUTE_TYPEA, 4) + TEST_TYPE_ALIGN (LPGOPHER_SITE_ATTRIBUTE_TYPEA, 4) + TEST_TARGET_SIZE (LPGOPHER_SITE_ATTRIBUTE_TYPEA, 4) + TEST_TARGET_ALIGN(LPGOPHER_SITE_ATTRIBUTE_TYPEA, 4) } static void test_pack_LPGOPHER_SITE_ATTRIBUTE_TYPEW(void) { /* LPGOPHER_SITE_ATTRIBUTE_TYPEW */ - TEST_TYPE(LPGOPHER_SITE_ATTRIBUTE_TYPEW, 4, 4); - TEST_TYPE_POINTER(LPGOPHER_SITE_ATTRIBUTE_TYPEW, 4, 4); + TEST_TYPE_SIZE (LPGOPHER_SITE_ATTRIBUTE_TYPEW, 4) + TEST_TYPE_ALIGN (LPGOPHER_SITE_ATTRIBUTE_TYPEW, 4) + TEST_TARGET_SIZE (LPGOPHER_SITE_ATTRIBUTE_TYPEW, 4) + TEST_TARGET_ALIGN(LPGOPHER_SITE_ATTRIBUTE_TYPEW, 4) } static void test_pack_LPGOPHER_TIMEZONE_ATTRIBUTE_TYPE(void) { /* LPGOPHER_TIMEZONE_ATTRIBUTE_TYPE */ - TEST_TYPE(LPGOPHER_TIMEZONE_ATTRIBUTE_TYPE, 4, 4); - TEST_TYPE_POINTER(LPGOPHER_TIMEZONE_ATTRIBUTE_TYPE, 4, 4); + TEST_TYPE_SIZE (LPGOPHER_TIMEZONE_ATTRIBUTE_TYPE, 4) + TEST_TYPE_ALIGN (LPGOPHER_TIMEZONE_ATTRIBUTE_TYPE, 4) + TEST_TARGET_SIZE (LPGOPHER_TIMEZONE_ATTRIBUTE_TYPE, 4) + TEST_TARGET_ALIGN(LPGOPHER_TIMEZONE_ATTRIBUTE_TYPE, 4) } static void test_pack_LPGOPHER_TTL_ATTRIBUTE_TYPE(void) { /* LPGOPHER_TTL_ATTRIBUTE_TYPE */ - TEST_TYPE(LPGOPHER_TTL_ATTRIBUTE_TYPE, 4, 4); - TEST_TYPE_POINTER(LPGOPHER_TTL_ATTRIBUTE_TYPE, 4, 4); + TEST_TYPE_SIZE (LPGOPHER_TTL_ATTRIBUTE_TYPE, 4) + TEST_TYPE_ALIGN (LPGOPHER_TTL_ATTRIBUTE_TYPE, 4) + TEST_TARGET_SIZE (LPGOPHER_TTL_ATTRIBUTE_TYPE, 4) + TEST_TARGET_ALIGN(LPGOPHER_TTL_ATTRIBUTE_TYPE, 4) } static void test_pack_LPGOPHER_UNKNOWN_ATTRIBUTE_TYPEA(void) { /* LPGOPHER_UNKNOWN_ATTRIBUTE_TYPEA */ - TEST_TYPE(LPGOPHER_UNKNOWN_ATTRIBUTE_TYPEA, 4, 4); - TEST_TYPE_POINTER(LPGOPHER_UNKNOWN_ATTRIBUTE_TYPEA, 4, 4); + TEST_TYPE_SIZE (LPGOPHER_UNKNOWN_ATTRIBUTE_TYPEA, 4) + TEST_TYPE_ALIGN (LPGOPHER_UNKNOWN_ATTRIBUTE_TYPEA, 4) + TEST_TARGET_SIZE (LPGOPHER_UNKNOWN_ATTRIBUTE_TYPEA, 4) + TEST_TARGET_ALIGN(LPGOPHER_UNKNOWN_ATTRIBUTE_TYPEA, 4) } static void test_pack_LPGOPHER_UNKNOWN_ATTRIBUTE_TYPEW(void) { /* LPGOPHER_UNKNOWN_ATTRIBUTE_TYPEW */ - TEST_TYPE(LPGOPHER_UNKNOWN_ATTRIBUTE_TYPEW, 4, 4); - TEST_TYPE_POINTER(LPGOPHER_UNKNOWN_ATTRIBUTE_TYPEW, 4, 4); + TEST_TYPE_SIZE (LPGOPHER_UNKNOWN_ATTRIBUTE_TYPEW, 4) + TEST_TYPE_ALIGN (LPGOPHER_UNKNOWN_ATTRIBUTE_TYPEW, 4) + TEST_TARGET_SIZE (LPGOPHER_UNKNOWN_ATTRIBUTE_TYPEW, 4) + TEST_TARGET_ALIGN(LPGOPHER_UNKNOWN_ATTRIBUTE_TYPEW, 4) } static void test_pack_LPGOPHER_VERONICA_ATTRIBUTE_TYPE(void) { /* LPGOPHER_VERONICA_ATTRIBUTE_TYPE */ - TEST_TYPE(LPGOPHER_VERONICA_ATTRIBUTE_TYPE, 4, 4); - TEST_TYPE_POINTER(LPGOPHER_VERONICA_ATTRIBUTE_TYPE, 4, 4); + TEST_TYPE_SIZE (LPGOPHER_VERONICA_ATTRIBUTE_TYPE, 4) + TEST_TYPE_ALIGN (LPGOPHER_VERONICA_ATTRIBUTE_TYPE, 4) + TEST_TARGET_SIZE (LPGOPHER_VERONICA_ATTRIBUTE_TYPE, 4) + TEST_TARGET_ALIGN(LPGOPHER_VERONICA_ATTRIBUTE_TYPE, 4) } static void test_pack_LPGOPHER_VERSION_ATTRIBUTE_TYPEA(void) { /* LPGOPHER_VERSION_ATTRIBUTE_TYPEA */ - TEST_TYPE(LPGOPHER_VERSION_ATTRIBUTE_TYPEA, 4, 4); - TEST_TYPE_POINTER(LPGOPHER_VERSION_ATTRIBUTE_TYPEA, 4, 4); + TEST_TYPE_SIZE (LPGOPHER_VERSION_ATTRIBUTE_TYPEA, 4) + TEST_TYPE_ALIGN (LPGOPHER_VERSION_ATTRIBUTE_TYPEA, 4) + TEST_TARGET_SIZE (LPGOPHER_VERSION_ATTRIBUTE_TYPEA, 4) + TEST_TARGET_ALIGN(LPGOPHER_VERSION_ATTRIBUTE_TYPEA, 4) } static void test_pack_LPGOPHER_VERSION_ATTRIBUTE_TYPEW(void) { /* LPGOPHER_VERSION_ATTRIBUTE_TYPEW */ - TEST_TYPE(LPGOPHER_VERSION_ATTRIBUTE_TYPEW, 4, 4); - TEST_TYPE_POINTER(LPGOPHER_VERSION_ATTRIBUTE_TYPEW, 4, 4); + TEST_TYPE_SIZE (LPGOPHER_VERSION_ATTRIBUTE_TYPEW, 4) + TEST_TYPE_ALIGN (LPGOPHER_VERSION_ATTRIBUTE_TYPEW, 4) + TEST_TARGET_SIZE (LPGOPHER_VERSION_ATTRIBUTE_TYPEW, 4) + TEST_TARGET_ALIGN(LPGOPHER_VERSION_ATTRIBUTE_TYPEW, 4) } static void test_pack_LPGOPHER_VIEW_ATTRIBUTE_TYPEA(void) { /* LPGOPHER_VIEW_ATTRIBUTE_TYPEA */ - TEST_TYPE(LPGOPHER_VIEW_ATTRIBUTE_TYPEA, 4, 4); - TEST_TYPE_POINTER(LPGOPHER_VIEW_ATTRIBUTE_TYPEA, 12, 4); + TEST_TYPE_SIZE (LPGOPHER_VIEW_ATTRIBUTE_TYPEA, 4) + TEST_TYPE_ALIGN (LPGOPHER_VIEW_ATTRIBUTE_TYPEA, 4) + TEST_TARGET_SIZE (LPGOPHER_VIEW_ATTRIBUTE_TYPEA, 12) + TEST_TARGET_ALIGN(LPGOPHER_VIEW_ATTRIBUTE_TYPEA, 4) } static void test_pack_LPGOPHER_VIEW_ATTRIBUTE_TYPEW(void) { /* LPGOPHER_VIEW_ATTRIBUTE_TYPEW */ - TEST_TYPE(LPGOPHER_VIEW_ATTRIBUTE_TYPEW, 4, 4); - TEST_TYPE_POINTER(LPGOPHER_VIEW_ATTRIBUTE_TYPEW, 12, 4); + TEST_TYPE_SIZE (LPGOPHER_VIEW_ATTRIBUTE_TYPEW, 4) + TEST_TYPE_ALIGN (LPGOPHER_VIEW_ATTRIBUTE_TYPEW, 4) + TEST_TARGET_SIZE (LPGOPHER_VIEW_ATTRIBUTE_TYPEW, 12) + TEST_TARGET_ALIGN(LPGOPHER_VIEW_ATTRIBUTE_TYPEW, 4) } static void test_pack_LPHINTERNET(void) { /* LPHINTERNET */ - TEST_TYPE(LPHINTERNET, 4, 4); - TEST_TYPE_POINTER(LPHINTERNET, 4, 4); + TEST_TYPE_SIZE (LPHINTERNET, 4) + TEST_TYPE_ALIGN (LPHINTERNET, 4) + TEST_TARGET_SIZE (LPHINTERNET, 4) + TEST_TARGET_ALIGN(LPHINTERNET, 4) } static void test_pack_LPHTTP_VERSION_INFO(void) { /* LPHTTP_VERSION_INFO */ - TEST_TYPE(LPHTTP_VERSION_INFO, 4, 4); - TEST_TYPE_POINTER(LPHTTP_VERSION_INFO, 8, 4); + TEST_TYPE_SIZE (LPHTTP_VERSION_INFO, 4) + TEST_TYPE_ALIGN (LPHTTP_VERSION_INFO, 4) + TEST_TARGET_SIZE (LPHTTP_VERSION_INFO, 8) + TEST_TARGET_ALIGN(LPHTTP_VERSION_INFO, 4) } static void test_pack_LPINTERNET_ASYNC_RESULT(void) { /* LPINTERNET_ASYNC_RESULT */ - TEST_TYPE(LPINTERNET_ASYNC_RESULT, 4, 4); - TEST_TYPE_POINTER(LPINTERNET_ASYNC_RESULT, 8, 4); + TEST_TYPE_SIZE (LPINTERNET_ASYNC_RESULT, 4) + TEST_TYPE_ALIGN (LPINTERNET_ASYNC_RESULT, 4) + TEST_TARGET_SIZE (LPINTERNET_ASYNC_RESULT, 8) + TEST_TARGET_ALIGN(LPINTERNET_ASYNC_RESULT, 4) } static void test_pack_LPINTERNET_BUFFERSA(void) { /* LPINTERNET_BUFFERSA */ - TEST_TYPE(LPINTERNET_BUFFERSA, 4, 4); - TEST_TYPE_POINTER(LPINTERNET_BUFFERSA, 40, 4); + TEST_TYPE_SIZE (LPINTERNET_BUFFERSA, 4) + TEST_TYPE_ALIGN (LPINTERNET_BUFFERSA, 4) + TEST_TARGET_SIZE (LPINTERNET_BUFFERSA, 40) + TEST_TARGET_ALIGN(LPINTERNET_BUFFERSA, 4) } static void test_pack_LPINTERNET_BUFFERSW(void) { /* LPINTERNET_BUFFERSW */ - TEST_TYPE(LPINTERNET_BUFFERSW, 4, 4); - TEST_TYPE_POINTER(LPINTERNET_BUFFERSW, 40, 4); + TEST_TYPE_SIZE (LPINTERNET_BUFFERSW, 4) + TEST_TYPE_ALIGN (LPINTERNET_BUFFERSW, 4) + TEST_TARGET_SIZE (LPINTERNET_BUFFERSW, 40) + TEST_TARGET_ALIGN(LPINTERNET_BUFFERSW, 4) } static void test_pack_LPINTERNET_CACHE_ENTRY_INFOA(void) { /* LPINTERNET_CACHE_ENTRY_INFOA */ - TEST_TYPE(LPINTERNET_CACHE_ENTRY_INFOA, 4, 4); + TEST_TYPE_SIZE (LPINTERNET_CACHE_ENTRY_INFOA, 4) + TEST_TYPE_ALIGN (LPINTERNET_CACHE_ENTRY_INFOA, 4) } static void test_pack_LPINTERNET_CACHE_ENTRY_INFOW(void) { /* LPINTERNET_CACHE_ENTRY_INFOW */ - TEST_TYPE(LPINTERNET_CACHE_ENTRY_INFOW, 4, 4); + TEST_TYPE_SIZE (LPINTERNET_CACHE_ENTRY_INFOW, 4) + TEST_TYPE_ALIGN (LPINTERNET_CACHE_ENTRY_INFOW, 4) } static void test_pack_LPINTERNET_CERTIFICATE_INFOA(void) { /* LPINTERNET_CERTIFICATE_INFOA */ - TEST_TYPE(LPINTERNET_CERTIFICATE_INFOA, 4, 4); - TEST_TYPE_POINTER(LPINTERNET_CERTIFICATE_INFOA, 40, 4); + TEST_TYPE_SIZE (LPINTERNET_CERTIFICATE_INFOA, 4) + TEST_TYPE_ALIGN (LPINTERNET_CERTIFICATE_INFOA, 4) + TEST_TARGET_SIZE (LPINTERNET_CERTIFICATE_INFOA, 40) + TEST_TARGET_ALIGN(LPINTERNET_CERTIFICATE_INFOA, 4) } static void test_pack_LPINTERNET_CERTIFICATE_INFOW(void) { /* LPINTERNET_CERTIFICATE_INFOW */ - TEST_TYPE(LPINTERNET_CERTIFICATE_INFOW, 4, 4); - TEST_TYPE_POINTER(LPINTERNET_CERTIFICATE_INFOW, 40, 4); + TEST_TYPE_SIZE (LPINTERNET_CERTIFICATE_INFOW, 4) + TEST_TYPE_ALIGN (LPINTERNET_CERTIFICATE_INFOW, 4) + TEST_TARGET_SIZE (LPINTERNET_CERTIFICATE_INFOW, 40) + TEST_TARGET_ALIGN(LPINTERNET_CERTIFICATE_INFOW, 4) } static void test_pack_LPINTERNET_CONNECTED_INFO(void) { /* LPINTERNET_CONNECTED_INFO */ - TEST_TYPE(LPINTERNET_CONNECTED_INFO, 4, 4); - TEST_TYPE_POINTER(LPINTERNET_CONNECTED_INFO, 8, 4); + TEST_TYPE_SIZE (LPINTERNET_CONNECTED_INFO, 4) + TEST_TYPE_ALIGN (LPINTERNET_CONNECTED_INFO, 4) + TEST_TARGET_SIZE (LPINTERNET_CONNECTED_INFO, 8) + TEST_TARGET_ALIGN(LPINTERNET_CONNECTED_INFO, 4) } static void test_pack_LPINTERNET_PORT(void) { /* LPINTERNET_PORT */ - TEST_TYPE(LPINTERNET_PORT, 4, 4); - TEST_TYPE_POINTER(LPINTERNET_PORT, 2, 2); + TEST_TYPE_SIZE (LPINTERNET_PORT, 4) + TEST_TYPE_ALIGN (LPINTERNET_PORT, 4) + TEST_TARGET_SIZE (LPINTERNET_PORT, 2) + TEST_TARGET_ALIGN(LPINTERNET_PORT, 2) } static void test_pack_LPINTERNET_PROXY_INFOA(void) { /* LPINTERNET_PROXY_INFOA */ - TEST_TYPE(LPINTERNET_PROXY_INFOA, 4, 4); - TEST_TYPE_POINTER(LPINTERNET_PROXY_INFOA, 12, 4); + TEST_TYPE_SIZE (LPINTERNET_PROXY_INFOA, 4) + TEST_TYPE_ALIGN (LPINTERNET_PROXY_INFOA, 4) + TEST_TARGET_SIZE (LPINTERNET_PROXY_INFOA, 12) + TEST_TARGET_ALIGN(LPINTERNET_PROXY_INFOA, 4) } static void test_pack_LPINTERNET_PROXY_INFOW(void) { /* LPINTERNET_PROXY_INFOW */ - TEST_TYPE(LPINTERNET_PROXY_INFOW, 4, 4); - TEST_TYPE_POINTER(LPINTERNET_PROXY_INFOW, 12, 4); + TEST_TYPE_SIZE (LPINTERNET_PROXY_INFOW, 4) + TEST_TYPE_ALIGN (LPINTERNET_PROXY_INFOW, 4) + TEST_TARGET_SIZE (LPINTERNET_PROXY_INFOW, 12) + TEST_TARGET_ALIGN(LPINTERNET_PROXY_INFOW, 4) } static void test_pack_LPINTERNET_STATUS_CALLBACK(void) { /* LPINTERNET_STATUS_CALLBACK */ - TEST_TYPE(LPINTERNET_STATUS_CALLBACK, 4, 4); - TEST_TYPE_POINTER(LPINTERNET_STATUS_CALLBACK, 4, 4); + TEST_TYPE_SIZE (LPINTERNET_STATUS_CALLBACK, 4) + TEST_TYPE_ALIGN (LPINTERNET_STATUS_CALLBACK, 4) + TEST_TARGET_SIZE (LPINTERNET_STATUS_CALLBACK, 4) + TEST_TARGET_ALIGN(LPINTERNET_STATUS_CALLBACK, 4) } static void test_pack_LPINTERNET_VERSION_INFO(void) { /* LPINTERNET_VERSION_INFO */ - TEST_TYPE(LPINTERNET_VERSION_INFO, 4, 4); - TEST_TYPE_POINTER(LPINTERNET_VERSION_INFO, 8, 4); + TEST_TYPE_SIZE (LPINTERNET_VERSION_INFO, 4) + TEST_TYPE_ALIGN (LPINTERNET_VERSION_INFO, 4) + TEST_TARGET_SIZE (LPINTERNET_VERSION_INFO, 8) + TEST_TARGET_ALIGN(LPINTERNET_VERSION_INFO, 4) } static void test_pack_LPURL_COMPONENTSA(void) { /* LPURL_COMPONENTSA */ - TEST_TYPE(LPURL_COMPONENTSA, 4, 4); + TEST_TYPE_SIZE (LPURL_COMPONENTSA, 4) + TEST_TYPE_ALIGN (LPURL_COMPONENTSA, 4) } static void test_pack_LPURL_COMPONENTSW(void) { /* LPURL_COMPONENTSW */ - TEST_TYPE(LPURL_COMPONENTSW, 4, 4); + TEST_TYPE_SIZE (LPURL_COMPONENTSW, 4) + TEST_TYPE_ALIGN (LPURL_COMPONENTSW, 4) } static void test_pack_PFN_AUTH_NOTIFY(void) { /* PFN_AUTH_NOTIFY */ - TEST_TYPE(PFN_AUTH_NOTIFY, 4, 4); + TEST_TYPE_SIZE (PFN_AUTH_NOTIFY, 4) + TEST_TYPE_ALIGN (PFN_AUTH_NOTIFY, 4) } static void test_pack_PFN_DIAL_HANDLER(void) { /* PFN_DIAL_HANDLER */ - TEST_TYPE(PFN_DIAL_HANDLER, 4, 4); + TEST_TYPE_SIZE (PFN_DIAL_HANDLER, 4) + TEST_TYPE_ALIGN (PFN_DIAL_HANDLER, 4) } static void test_pack_URL_COMPONENTSA(void) { /* URL_COMPONENTSA (pack 4) */ - TEST_FIELD(URL_COMPONENTSA, DWORD, dwStructSize, 0, 4, 4); - TEST_FIELD(URL_COMPONENTSA, LPSTR, lpszScheme, 4, 4, 4); - TEST_FIELD(URL_COMPONENTSA, DWORD, dwSchemeLength, 8, 4, 4); + TEST_FIELD_SIZE (URL_COMPONENTSA, dwStructSize, 4) + TEST_FIELD_ALIGN (URL_COMPONENTSA, dwStructSize, 4) + TEST_FIELD_OFFSET(URL_COMPONENTSA, dwStructSize, 0) + TEST_FIELD_SIZE (URL_COMPONENTSA, lpszScheme, 4) + TEST_FIELD_ALIGN (URL_COMPONENTSA, lpszScheme, 4) + TEST_FIELD_OFFSET(URL_COMPONENTSA, lpszScheme, 4) + TEST_FIELD_SIZE (URL_COMPONENTSA, dwSchemeLength, 4) + TEST_FIELD_ALIGN (URL_COMPONENTSA, dwSchemeLength, 4) + TEST_FIELD_OFFSET(URL_COMPONENTSA, dwSchemeLength, 8) } static void test_pack_URL_COMPONENTSW(void) { /* URL_COMPONENTSW (pack 4) */ - TEST_FIELD(URL_COMPONENTSW, DWORD, dwStructSize, 0, 4, 4); - TEST_FIELD(URL_COMPONENTSW, LPWSTR, lpszScheme, 4, 4, 4); - TEST_FIELD(URL_COMPONENTSW, DWORD, dwSchemeLength, 8, 4, 4); + TEST_FIELD_SIZE (URL_COMPONENTSW, dwStructSize, 4) + TEST_FIELD_ALIGN (URL_COMPONENTSW, dwStructSize, 4) + TEST_FIELD_OFFSET(URL_COMPONENTSW, dwStructSize, 0) + TEST_FIELD_SIZE (URL_COMPONENTSW, lpszScheme, 4) + TEST_FIELD_ALIGN (URL_COMPONENTSW, lpszScheme, 4) + TEST_FIELD_OFFSET(URL_COMPONENTSW, lpszScheme, 4) + TEST_FIELD_SIZE (URL_COMPONENTSW, dwSchemeLength, 4) + TEST_FIELD_ALIGN (URL_COMPONENTSW, dwSchemeLength, 4) + TEST_FIELD_OFFSET(URL_COMPONENTSW, dwSchemeLength, 8) } static void test_pack(void) @@ -1024,5 +1434,9 @@ static void test_pack(void) START_TEST(generated) { +#ifdef _WIN64 + ok(0, "The type size / alignment tests don't support Win64 yet\n"); +#else test_pack(); +#endif } diff --git a/dlls/wintrust/crypt.c b/dlls/wintrust/crypt.c index 99989fdb2bd..8049f33dcf9 100644 --- a/dlls/wintrust/crypt.c +++ b/dlls/wintrust/crypt.c @@ -471,7 +471,32 @@ BOOL WINAPI CryptCATAdminRemoveCatalog(HCATADMIN hCatAdmin, LPCWSTR pwszCatalogF SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } - return DeleteFileW(pwszCatalogFile); + + /* Only delete when there is a filename and no path */ + if (pwszCatalogFile && pwszCatalogFile[0] != 0 && + !strchrW(pwszCatalogFile, '\\') && !strchrW(pwszCatalogFile, '/') && + !strchrW(pwszCatalogFile, ':')) + { + static const WCHAR slashW[] = {'\\',0}; + WCHAR *target; + DWORD len; + + len = strlenW(ca->path) + strlenW(pwszCatalogFile) + 2; + if (!(target = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)))) + { + SetLastError(ERROR_OUTOFMEMORY); + return FALSE; + } + strcpyW(target, ca->path); + strcatW(target, slashW); + strcatW(target, pwszCatalogFile); + + DeleteFileW(target); + + HeapFree(GetProcessHeap(), 0, target); + } + + return TRUE; } /*********************************************************************** diff --git a/dlls/wintrust/tests/crypt.c b/dlls/wintrust/tests/crypt.c index f9a57af5d75..383fe8bc2db 100644 --- a/dlls/wintrust/tests/crypt.c +++ b/dlls/wintrust/tests/crypt.c @@ -29,6 +29,8 @@ static char selfname[MAX_PATH]; static CHAR CURR_DIR[MAX_PATH]; +static CHAR catroot[MAX_PATH]; +static CHAR catroot2[MAX_PATH]; /* * Minimalistic catalog file. To reconstruct, save text below as winetest.cdf, @@ -123,7 +125,7 @@ static void test_context(void) BOOL ret; HCATADMIN hca; static GUID unknown = { 0xC689AABA, 0x8E78, 0x11D0, { 0x8C,0x47,0x00,0xC0,0x4F,0xC2,0x95,0xEE }}; /* WINTRUST.DLL */ - CHAR windir[MAX_PATH], catroot[MAX_PATH], catroot2[MAX_PATH], dummydir[MAX_PATH]; + CHAR dummydir[MAX_PATH]; DWORD attrs; /* When CryptCATAdminAcquireContext is successful it will create @@ -208,12 +210,6 @@ static void test_context(void) ok(ret, "Expected success\n"); ok(hca != NULL, "Expected a context handle, got NULL\n"); - GetWindowsDirectoryA(windir, MAX_PATH); - lstrcpyA(catroot, windir); - lstrcatA(catroot, "\\system32\\CatRoot"); - lstrcpyA(catroot2, windir); - lstrcatA(catroot2, "\\system32\\CatRoot2"); - attrs = GetFileAttributes(catroot); ok(attrs != INVALID_FILE_ATTRIBUTES, "Expected the CatRoot directory to exist\n"); @@ -354,14 +350,18 @@ static void test_calchash(void) static void test_CryptCATAdminAddRemoveCatalog(void) { static WCHAR basenameW[] = {'w','i','n','e','t','e','s','t','.','c','a','t',0}; + static CHAR basename[] = "winetest.cat"; HCATADMIN hcatadmin; HCATINFO hcatinfo; CATALOG_INFO info; WCHAR tmpfileW[MAX_PATH]; char tmpfile[MAX_PATH]; + char catfile[MAX_PATH], catfilepath[MAX_PATH], *p; + WCHAR catfileW[MAX_PATH]; HANDLE file; DWORD error, written; BOOL ret; + DWORD attrs; if (!pCryptCATAdminRemoveCatalog) { @@ -419,22 +419,60 @@ static void test_CryptCATAdminAddRemoveCatalog(void) WriteFile(file, test_catalog, sizeof(test_catalog), &written, NULL); CloseHandle(file); + /* Unique name will be created */ hcatinfo = pCryptCATAdminAddCatalog(hcatadmin, tmpfileW, NULL, 0); todo_wine ok(hcatinfo != NULL, "CryptCATAdminAddCatalog failed %u\n", GetLastError()); + info.cbStruct = sizeof(info); + info.wszCatalogFile[0] = 0; + ret = pCryptCATCatalogInfoFromContext(hcatinfo, &info, 0); + todo_wine + { + ok(ret, "CryptCATCatalogInfoFromContext failed %u\n", GetLastError()); + ok(info.wszCatalogFile[0] != 0, "Expected a filename\n"); + } + WideCharToMultiByte(CP_ACP, 0, info.wszCatalogFile, -1, catfile, MAX_PATH, 0, 0); + if ((p = strrchr(catfile, '\\'))) p++; + memset(catfileW, 0, sizeof(catfileW)); + MultiByteToWideChar(0, 0, p, -1, catfileW, MAX_PATH); + + /* winetest.cat will be created */ hcatinfo = pCryptCATAdminAddCatalog(hcatadmin, tmpfileW, basenameW, 0); ok(hcatinfo != NULL, "CryptCATAdminAddCatalog failed %u\n", GetLastError()); + lstrcpyA(catfilepath, catroot); + lstrcatA(catfilepath, "\\{DEADBEEF-DEAD-BEEF-DEAD-BEEFDEADBEEF}\\winetest.cat"); + attrs = GetFileAttributes(catfilepath); + ok(attrs != INVALID_FILE_ATTRIBUTES, "Expected %s to exist\n", catfilepath); + info.cbStruct = sizeof(info); info.wszCatalogFile[0] = 0; ret = pCryptCATCatalogInfoFromContext(hcatinfo, &info, 0); ok(ret, "CryptCATCatalogInfoFromContext failed %u\n", GetLastError()); + ok(info.wszCatalogFile[0] != 0, "Expected a filename\n"); + WideCharToMultiByte(CP_ACP, 0, info.wszCatalogFile, -1, catfile, MAX_PATH, 0, 0); + if ((p = strrchr(catfile, '\\'))) p++; + ok(!lstrcmpA(basename, p), "Expected %s, got %s\n", basename, p); ret = pCryptCATAdminReleaseCatalogContext(hcatadmin, hcatinfo, 0); ok(ret, "CryptCATAdminReleaseCatalogContext failed %u\n", GetLastError()); - ret = pCryptCATAdminRemoveCatalog(hcatadmin, tmpfileW, 0); + /* Remove the catalog file with the unique name */ + ret = pCryptCATAdminRemoveCatalog(hcatadmin, catfileW, 0); + ok(ret, "CryptCATAdminRemoveCatalog failed %u\n", GetLastError()); + + /* Remove the winetest.cat catalog file, first with the full path. This should not succeed + * according to MSDN */ + ret = pCryptCATAdminRemoveCatalog(hcatadmin, info.wszCatalogFile, 0); + ok(ret, "CryptCATAdminRemoveCatalog failed %u\n", GetLastError()); + /* The call succeeded with the full path but the file is not removed */ + attrs = GetFileAttributes(catfilepath); + ok(attrs != INVALID_FILE_ATTRIBUTES, "Expected %s to exist\n", catfilepath); + /* Given only the filename the file is removed */ + ret = pCryptCATAdminRemoveCatalog(hcatadmin, basenameW, 0); ok(ret, "CryptCATAdminRemoveCatalog failed %u\n", GetLastError()); + attrs = GetFileAttributes(catfilepath); + ok(attrs == INVALID_FILE_ATTRIBUTES, "Expected %s to be removed\n", catfilepath); ret = pCryptCATAdminReleaseContext(hcatadmin, 0); ok(ret, "CryptCATAdminReleaseContext failed %u\n", GetLastError()); @@ -506,6 +544,7 @@ START_TEST(crypt) { int myARGC; char** myARGV; + char windir[MAX_PATH]; InitFunctionPtrs(); @@ -515,6 +554,12 @@ START_TEST(crypt) return; } + GetWindowsDirectoryA(windir, MAX_PATH); + lstrcpyA(catroot, windir); + lstrcatA(catroot, "\\system32\\CatRoot"); + lstrcpyA(catroot2, windir); + lstrcatA(catroot2, "\\system32\\CatRoot2"); + myARGC = winetest_get_mainargs(&myARGV); strcpy(selfname, myARGV[0]); diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 078c3bec627..cabe191bdde 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -1429,7 +1429,7 @@ int WINAPI WS_bind(SOCKET s, const struct WS_sockaddr* name, int namelen) { release_sock_fd( s, fd ); SetLastError(WSAEAFNOSUPPORT); - return INVALID_SOCKET; + return SOCKET_ERROR; } } #endif diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index 5250ccc4f08..0b5cb88becc 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -225,16 +225,16 @@ static void fill_buffer ( char *buf, int chunk_size, int n_chunks ) memset ( p, c, chunk_size ); } -static char* test_buffer ( char *buf, int chunk_size, int n_chunks ) +static int test_buffer ( char *buf, int chunk_size, int n_chunks ) { char c, *p; int i; for ( c = FIRST_CHAR, p = buf; c < FIRST_CHAR + n_chunks; c++, p += chunk_size ) { for ( i = 0; i < chunk_size; i++ ) - if ( p[i] != c ) return p + i; + if ( p[i] != c ) return i; } - return NULL; + return -1; } /* @@ -403,9 +403,8 @@ static VOID WINAPI simple_server ( server_params *par ) { test_params *gen = par->general; server_memory *mem; - int n_recvd, n_sent, n_expected = gen->n_chunks * gen->chunk_size, tmp, i, + int pos, n_recvd, n_sent, n_expected = gen->n_chunks * gen->chunk_size, tmp, i, id = GetCurrentThreadId(); - char *p; trace ( "simple_server (%x) starting\n", id ); @@ -435,8 +434,8 @@ static VOID WINAPI simple_server ( server_params *par ) n_recvd = do_synchronous_recv ( mem->sock[0].s, mem->sock[0].buf, n_expected, par->buflen ); ok ( n_recvd == n_expected, "simple_server (%x): received less data than expected: %d of %d\n", id, n_recvd, n_expected ); - p = test_buffer ( mem->sock[0].buf, gen->chunk_size, gen->n_chunks ); - ok ( p == NULL, "simple_server (%x): test pattern error: %d\n", id, p - mem->sock[0].buf); + pos = test_buffer ( mem->sock[0].buf, gen->chunk_size, gen->n_chunks ); + ok ( pos == -1, "simple_server (%x): test pattern error: %d\n", id, pos); /* Echo data back */ n_sent = do_synchronous_send ( mem->sock[0].s, mem->sock[0].buf, n_expected, par->buflen ); @@ -463,7 +462,6 @@ static VOID WINAPI select_server ( server_params *par ) int n_expected = gen->n_chunks * gen->chunk_size, tmp, i, id = GetCurrentThreadId(), n_connections = 0, n_sent, n_recvd, n_set, delta, n_ready; - char *p; struct timeval timeout = {0,10}; /* wait for 10 milliseconds */ fd_set fds_recv, fds_send, fds_openrecv, fds_opensend; @@ -531,8 +529,8 @@ static VOID WINAPI select_server ( server_params *par ) mem->sock[i].n_recvd += n_recvd; if ( mem->sock[i].n_recvd == n_expected ) { - p = test_buffer ( mem->sock[i].buf, gen->chunk_size, gen->n_chunks ); - ok ( p == NULL, "select_server (%x): test pattern error: %d\n", id, p - mem->sock[i].buf ); + int pos = test_buffer ( mem->sock[i].buf, gen->chunk_size, gen->n_chunks ); + ok ( pos == -1, "select_server (%x): test pattern error: %d\n", id, pos ); FD_CLR ( mem->sock[i].s, &fds_openrecv ); } @@ -593,8 +591,7 @@ static VOID WINAPI simple_client ( client_params *par ) { test_params *gen = par->general; client_memory *mem; - int n_sent, n_recvd, n_expected = gen->n_chunks * gen->chunk_size, id; - char *p; + int pos, n_sent, n_recvd, n_expected = gen->n_chunks * gen->chunk_size, id; id = GetCurrentThreadId(); trace ( "simple_client (%x): starting\n", id ); @@ -628,8 +625,8 @@ static VOID WINAPI simple_client ( client_params *par ) "simple_client (%x): received less data than expected: %d of %d\n", id, n_recvd, n_expected ); /* check data */ - p = test_buffer ( mem->recv_buf, gen->chunk_size, gen->n_chunks ); - ok ( p == NULL, "simple_client (%x): test pattern error: %d\n", id, p - mem->recv_buf); + pos = test_buffer ( mem->recv_buf, gen->chunk_size, gen->n_chunks ); + ok ( pos == -1, "simple_client (%x): test pattern error: %d\n", id, pos); /* cleanup */ read_zero_bytes ( mem->s ); @@ -644,8 +641,7 @@ static VOID WINAPI simple_mixed_client ( client_params *par ) { test_params *gen = par->general; client_memory *mem; - int n_sent, n_recvd, n_expected = gen->n_chunks * gen->chunk_size, id; - char *p; + int pos, n_sent, n_recvd, n_expected = gen->n_chunks * gen->chunk_size, id; socklen_t fromLen = sizeof(mem->addr); struct sockaddr test; @@ -698,8 +694,8 @@ static VOID WINAPI simple_mixed_client ( client_params *par ) "0.0.0.0"), "lpFrom shouldn't be updated on connection oriented sockets\n"); /* check data */ - p = test_buffer ( mem->recv_buf, gen->chunk_size, gen->n_chunks ); - ok ( p == NULL, "simple_client (%x): test pattern error: %d\n", id, p - mem->recv_buf); + pos = test_buffer ( mem->recv_buf, gen->chunk_size, gen->n_chunks ); + ok ( pos == -1, "simple_client (%x): test pattern error: %d\n", id, pos); /* cleanup */ read_zero_bytes ( mem->s ); @@ -821,14 +817,14 @@ static void WINAPI event_client ( client_params *par ) } } + n = send_p - mem->send_buf; ok ( send_p == send_last, - "simple_client (%x): sent less data than expected: %d of %d\n", - id, send_p - mem->send_buf, n_expected ); + "simple_client (%x): sent less data than expected: %d of %d\n", id, n, n_expected ); + n = recv_p - mem->recv_buf; ok ( recv_p == recv_last, - "simple_client (%x): received less data than expected: %d of %d\n", - id, recv_p - mem->recv_buf, n_expected ); - recv_p = test_buffer ( mem->recv_buf, gen->chunk_size, gen->n_chunks ); - ok ( recv_p == NULL, "event_client (%x): test pattern error: %d\n", id, recv_p - mem->recv_buf); + "simple_client (%x): received less data than expected: %d of %d\n", id, n, n_expected ); + n = test_buffer ( mem->recv_buf, gen->chunk_size, gen->n_chunks ); + ok ( n == -1, "event_client (%x): test pattern error: %d\n", id, n); out: WSACloseEvent ( event ); diff --git a/dlls/xinput1_3/tests/xinput.c b/dlls/xinput1_3/tests/xinput.c index c137b0c5d5d..2a07f2d76b9 100644 --- a/dlls/xinput1_3/tests/xinput.c +++ b/dlls/xinput1_3/tests/xinput.c @@ -28,6 +28,8 @@ static DWORD (WINAPI *pXInputGetCapabilities)(DWORD,DWORD,XINPUT_CAPABILITIES*); static DWORD (WINAPI *pXInputSetState)(DWORD, XINPUT_VIBRATION*); static void (WINAPI *pXInputEnable)(BOOL); static DWORD (WINAPI *pXInputGetKeystroke)(DWORD, DWORD, PXINPUT_KEYSTROKE); +static DWORD (WINAPI *pXInputGetDSoundAudioDeviceGuids)(DWORD, GUID*, GUID*); +static DWORD (WINAPI *pXInputGetBatteryInformation)(DWORD, BYTE, XINPUT_BATTERY_INFORMATION*); static void test_set_state(void) { @@ -145,6 +147,52 @@ static void test_get_capabilities(void) ok(result == ERROR_BAD_ARGUMENTS, "XInputGetCapabilities returned (%d)\n", result); } +static void test_get_dsoundaudiodevice(void) +{ + DWORD controllerNum; + DWORD result; + GUID soundRender; + GUID soundCapture; + + for(controllerNum=0; controllerNum < XUSER_MAX_COUNT; controllerNum++) + { + result = pXInputGetDSoundAudioDeviceGuids(controllerNum, &soundRender, &soundCapture); + ok(result == ERROR_SUCCESS || result == ERROR_DEVICE_NOT_CONNECTED, "XInputGetDSoundAudioDeviceGuids failed with (%d)\n", result); + + if (ERROR_DEVICE_NOT_CONNECTED == result) + { + skip("Controller %d is not connected\n", controllerNum); + } + } + + result = pXInputGetDSoundAudioDeviceGuids(XUSER_MAX_COUNT+1, &soundRender, &soundCapture); + ok(result == ERROR_BAD_ARGUMENTS, "XInputGetDSoundAudioDeviceGuids returned (%d)\n", result); +} + +static void test_get_batteryinformation(void) +{ + DWORD controllerNum; + DWORD result; + XINPUT_BATTERY_INFORMATION batteryInfo; + + for(controllerNum=0; controllerNum < XUSER_MAX_COUNT; controllerNum++) + { + ZeroMemory(&batteryInfo, sizeof(XINPUT_BATTERY_INFORMATION)); + + result = pXInputGetBatteryInformation(controllerNum, BATTERY_DEVTYPE_GAMEPAD, &batteryInfo); + ok(result == ERROR_SUCCESS || result == ERROR_DEVICE_NOT_CONNECTED, "XInputGetBatteryInformation failed with (%d)\n", result); + + if (ERROR_DEVICE_NOT_CONNECTED == result) + { + ok(batteryInfo.BatteryLevel == BATTERY_TYPE_DISCONNECTED, "Failed to report device as being disconnected.\n"); + skip("Controller %d is not connected\n", controllerNum); + } + } + + result = pXInputGetBatteryInformation(XUSER_MAX_COUNT+1, BATTERY_DEVTYPE_GAMEPAD, &batteryInfo); + ok(result == ERROR_BAD_ARGUMENTS, "XInputGetBatteryInformation returned (%d)\n", result); +} + START_TEST(xinput) { HMODULE hXinput; @@ -161,9 +209,15 @@ START_TEST(xinput) pXInputGetState = (void*)GetProcAddress(hXinput, "XInputGetState"); pXInputGetKeystroke = (void*)GetProcAddress(hXinput, "XInputGetKeystroke"); pXInputGetCapabilities = (void*)GetProcAddress(hXinput, "XInputGetCapabilities"); + pXInputGetDSoundAudioDeviceGuids = (void*)GetProcAddress(hXinput, "XInputGetDSoundAudioDeviceGuids"); + pXInputGetBatteryInformation = (void*)GetProcAddress(hXinput, "XInputGetBatteryInformation"); + test_set_state(); test_get_state(); test_get_keystroke(); test_get_capabilities(); + test_get_dsoundaudiodevice(); + test_get_batteryinformation(); + FreeLibrary(hXinput); } diff --git a/dlls/xinput1_3/xinput1_3.spec b/dlls/xinput1_3/xinput1_3.spec index f2d961c1bcb..be1f4110dbf 100644 --- a/dlls/xinput1_3/xinput1_3.spec +++ b/dlls/xinput1_3/xinput1_3.spec @@ -3,5 +3,5 @@ @ stdcall XInputGetState(long ptr) @ stdcall XInputGetKeystroke(long long ptr) @ stdcall XInputGetCapabilities(long long ptr) -@ stub XInputGetDSoundAudioDeviceGuids #(long ptr ptr) -@ stub XInputGetBatteryInformation +@ stdcall XInputGetDSoundAudioDeviceGuids(long ptr ptr) +@ stdcall XInputGetBatteryInformation(long ptr ptr) diff --git a/dlls/xinput1_3/xinput1_3_main.c b/dlls/xinput1_3/xinput1_3_main.c index 636dcd1f30d..f4386b891f8 100644 --- a/dlls/xinput1_3/xinput1_3_main.c +++ b/dlls/xinput1_3/xinput1_3_main.c @@ -102,3 +102,27 @@ DWORD WINAPI XInputGetCapabilities(DWORD dwUserIndex, DWORD dwFlags, XINPUT_CAPA } return ERROR_BAD_ARGUMENTS; } + +DWORD WINAPI XInputGetDSoundAudioDeviceGuids(DWORD dwUserIndex, GUID* pDSoundRenderGuid, GUID* pDSoundCaptureGuid) +{ + FIXME("(%d %s %s) Stub!\n", dwUserIndex, debugstr_guid(pDSoundRenderGuid), debugstr_guid(pDSoundCaptureGuid)); + + if (dwUserIndex < XUSER_MAX_COUNT) + { + return ERROR_DEVICE_NOT_CONNECTED; + /* If controller exists then return ERROR_SUCCESS */ + } + return ERROR_BAD_ARGUMENTS; +} + +DWORD WINAPI XInputGetBatteryInformation(DWORD dwUserIndex, BYTE deviceType, XINPUT_BATTERY_INFORMATION* pBatteryInfo) +{ + FIXME("(%d %u %p) Stub!\n", dwUserIndex, deviceType, pBatteryInfo); + + if (dwUserIndex < XUSER_MAX_COUNT) + { + return ERROR_DEVICE_NOT_CONNECTED; + /* If controller exists then return ERROR_SUCCESS */ + } + return ERROR_BAD_ARGUMENTS; +} diff --git a/include/setupapi.h b/include/setupapi.h index 820c5c4f65a..b36243ab1df 100644 --- a/include/setupapi.h +++ b/include/setupapi.h @@ -22,8 +22,10 @@ #include -#ifdef __cplusplus -extern "C" { +#ifdef _WIN64 +#include +#else +#include #endif /* setupapi doesn't use the normal convention, it adds an underscore before A/W */ @@ -1848,8 +1850,6 @@ BOOL WINAPI UnmapAndCloseFile(HANDLE, HANDLE, PVOID); #undef DECL_WINELIB_SETUPAPI_TYPE_AW -#ifdef __cplusplus -} -#endif +#include #endif /* _INC_SETUPAPI */ diff --git a/include/wine/wined3d.idl b/include/wine/wined3d.idl index 324f5a2dbcd..21e55c112de 100644 --- a/include/wine/wined3d.idl +++ b/include/wine/wined3d.idl @@ -74,6 +74,7 @@ cpp_quote("#define WINED3DERR_INVALIDCALL MAKE_WINED3DHRESU cpp_quote("#define WINED3DERR_DRIVERINVALIDCALL MAKE_WINED3DHRESULT(2157)") cpp_quote("#define WINED3DERR_WASSTILLDRAWING MAKE_WINED3DHRESULT(540)") cpp_quote("#define WINEDDERR_NOTAOVERLAYSURFACE MAKE_WINED3DHRESULT(580)") +cpp_quote("#define WINEDDERR_NOTLOCKED MAKE_WINED3DHRESULT(584)") cpp_quote("#define WINEDDERR_NODC MAKE_WINED3DHRESULT(586)") cpp_quote("#define WINEDDERR_DCALREADYCREATED MAKE_WINED3DHRESULT(620)") cpp_quote("#define WINEDDERR_NOTFLIPPABLE MAKE_WINED3DHRESULT(582)") @@ -1879,10 +1880,13 @@ typedef struct WineDirect3DVertexStridedData WineDirect3DStridedData sample; /* Add fields here */ - BOOL position_transformed; } s; WineDirect3DStridedData input[16]; /* Indexed by constants in D3DVSDE_REGISTER */ } u; + + BOOL position_transformed; + WORD swizzle_map; /* MAX_ATTRIBS, 16 */ + WORD use_map; /* MAX_ATTRIBS, 16 */ } WineDirect3DVertexStridedData; typedef struct _WINED3DVSHADERCAPS2_0 diff --git a/programs/cmdlgtst/cmdlgtst.c b/programs/cmdlgtst/cmdlgtst.c index 0c8b2b1a0d4..a4d32044bda 100644 --- a/programs/cmdlgtst/cmdlgtst.c +++ b/programs/cmdlgtst/cmdlgtst.c @@ -288,7 +288,7 @@ static void paintMainWindow(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lPar /* Commence painting! */ BeginPaint(hWnd, &ps); - GetClientRect(hWnd, (LPRECT) &rect); + GetClientRect(hWnd, &rect); pen = SelectObject(ps.hdc, CreatePen(0, 0, fgColor)); brush = SelectObject(ps.hdc, CreateSolidBrush(bgColor)); @@ -367,8 +367,8 @@ static void mw_ColorSetup(HWND hWnd) if(ChooseColor(&cc)) { RECT rect; - GetClientRect(hWnd, (LPRECT) &rect); - InvalidateRect(hWnd, (LPRECT) &rect, FALSE); + GetClientRect(hWnd, &rect); + InvalidateRect(hWnd, &rect, FALSE); bgColor = cc.rgbResult; } else mw_checkError(hWnd, FALSE); @@ -378,8 +378,8 @@ static void mw_FontSetup(HWND hWnd) { if(ChooseFont(&cf)) { RECT rect; - GetClientRect(hWnd, (LPRECT) &rect); - InvalidateRect(hWnd, (LPRECT) &rect, FALSE); + GetClientRect(hWnd, &rect); + InvalidateRect(hWnd, &rect, FALSE); txtColor = cf.rgbColors; } else mw_checkError(hWnd, FALSE); @@ -405,8 +405,8 @@ static void mw_OpenSetup(HWND hWnd) { if(GetOpenFileName(&ofn)) { RECT rect; - GetClientRect(hWnd, (LPRECT) &rect); - InvalidateRect(hWnd, (LPRECT) &rect, FALSE); + GetClientRect(hWnd, &rect); + InvalidateRect(hWnd, &rect, FALSE); } else mw_checkError(hWnd,FALSE); } @@ -415,8 +415,8 @@ static void mw_SaveSetup(HWND hWnd) { if(GetSaveFileName(&ofn)) { RECT rect; - GetClientRect(hWnd, (LPRECT) &rect); - InvalidateRect(hWnd, (LPRECT) &rect, FALSE); + GetClientRect(hWnd, &rect); + InvalidateRect(hWnd, &rect, FALSE); } else mw_checkError(hWnd,FALSE); } diff --git a/programs/winecfg/theme.c b/programs/winecfg/theme.c index d87aba071be..6b67b4e0a64 100644 --- a/programs/winecfg/theme.c +++ b/programs/winecfg/theme.c @@ -116,7 +116,7 @@ static void color_or_size_dsa_add (WrappedDsa* wdsa, const WCHAR* name, static int CALLBACK dsa_destroy_callback (LPVOID p, LPVOID pData) { - ThemeColorOrSize* item = (ThemeColorOrSize*)p; + ThemeColorOrSize* item = p; HeapFree (GetProcessHeap(), 0, item->name); HeapFree (GetProcessHeap(), 0, item->fancyName); return 1; @@ -135,7 +135,7 @@ static void create_color_or_size_dsa (WrappedDsa* wdsa) static ThemeColorOrSize* color_or_size_dsa_get (WrappedDsa* wdsa, int index) { - return (ThemeColorOrSize*)DSA_GetItemPtr (wdsa->dsa, index); + return DSA_GetItemPtr (wdsa->dsa, index); } static int color_or_size_dsa_find (WrappedDsa* wdsa, const WCHAR* name) @@ -163,7 +163,7 @@ static int themeFilesCount = 0; static int CALLBACK theme_dsa_destroy_callback (LPVOID p, LPVOID pData) { - ThemeFile* item = (ThemeFile*)p; + ThemeFile* item = p; HeapFree (GetProcessHeap(), 0, item->themeFileName); HeapFree (GetProcessHeap(), 0, item->fancyName); free_color_or_size_dsa (&item->colors); diff --git a/programs/wineconsole/wineconsole.c b/programs/wineconsole/wineconsole.c index 7d10783ab94..3626383f733 100644 --- a/programs/wineconsole/wineconsole.c +++ b/programs/wineconsole/wineconsole.c @@ -301,7 +301,7 @@ int WINECON_GrabChanges(struct inner_data* data) req->access = GENERIC_READ | GENERIC_WRITE; req->attributes = 0; req->share = FILE_SHARE_READ | FILE_SHARE_WRITE; - h = wine_server_call_err( req ) ? 0 : (HANDLE)reply->handle; + h = wine_server_call_err( req ) ? 0 : wine_server_ptr_handle(reply->handle); } SERVER_END_REQ; WINE_TRACE(" active(%p)", h); @@ -635,8 +635,8 @@ static struct inner_data* WINECON_Init(HINSTANCE hInst, DWORD pid, LPCWSTR appna req->pid = pid; ret = !wine_server_call_err( req ); - data->hConIn = (HANDLE)reply->handle_in; - data->hSynchro = (HANDLE)reply->event; + data->hConIn = wine_server_ptr_handle( reply->handle_in ); + data->hSynchro = wine_server_ptr_handle( reply->event ); } SERVER_END_REQ; if (!ret) goto error; @@ -649,7 +649,7 @@ static struct inner_data* WINECON_Init(HINSTANCE hInst, DWORD pid, LPCWSTR appna req->attributes = 0; req->share = FILE_SHARE_READ|FILE_SHARE_WRITE; ret = !wine_server_call_err( req ); - data->hConOut = (HANDLE)reply->handle_out; + data->hConOut = wine_server_ptr_handle( reply->handle_out ); } SERVER_END_REQ; if (!ret) goto error; diff --git a/programs/winedbg/expr.c b/programs/winedbg/expr.c index d0de4d04351..3d5cef12944 100644 --- a/programs/winedbg/expr.c +++ b/programs/winedbg/expr.c @@ -346,19 +346,19 @@ struct dbg_lvalue expr_eval(struct expr* exp) rtn.cookie = DLV_HOST; rtn.type.id = dbg_itype_astring; rtn.type.module = 0; - rtn.addr.Offset = (unsigned int)&exp->un.string.str; + rtn.addr.Offset = (ULONG_PTR)&exp->un.string.str; break; case EXPR_TYPE_U_CONST: rtn.cookie = DLV_HOST; rtn.type.id = dbg_itype_unsigned_int; rtn.type.module = 0; - rtn.addr.Offset = (unsigned int)&exp->un.u_const.value; + rtn.addr.Offset = (ULONG_PTR)&exp->un.u_const.value; break; case EXPR_TYPE_S_CONST: rtn.cookie = DLV_HOST; rtn.type.id = dbg_itype_signed_int; rtn.type.module = 0; - rtn.addr.Offset = (unsigned int)&exp->un.s_const.value; + rtn.addr.Offset = (ULONG_PTR)&exp->un.s_const.value; break; case EXPR_TYPE_SYMBOL: switch (symbol_get_lvalue(exp->un.symbol.name, -1, &rtn, FALSE)) @@ -463,7 +463,7 @@ struct dbg_lvalue expr_eval(struct expr* exp) rtn.cookie = DLV_HOST; /* get return type from function signature tupe */ types_get_info(&rtn.type, TI_GET_TYPE, &rtn.type.id); - rtn.addr.Offset = (unsigned int)&exp->un.call.result; + rtn.addr.Offset = (ULONG_PTR)&exp->un.call.result; break; case EXPR_TYPE_INTVAR: rtn.cookie = DLV_HOST; @@ -471,7 +471,7 @@ struct dbg_lvalue expr_eval(struct expr* exp) RaiseException(DEBUG_STATUS_NO_SYMBOL, 0, 0, NULL); rtn.type.id = div->typeid; rtn.type.module = 0; - rtn.addr.Offset = (unsigned int)div->pval; + rtn.addr.Offset = (ULONG_PTR)div->pval; break; case EXPR_TYPE_BINOP: rtn.cookie = DLV_HOST; @@ -481,7 +481,7 @@ struct dbg_lvalue expr_eval(struct expr* exp) RaiseException(DEBUG_STATUS_BAD_TYPE, 0, 0, NULL); rtn.type.id = dbg_itype_signed_int; rtn.type.module = 0; - rtn.addr.Offset = (unsigned int)&exp->un.binop.result; + rtn.addr.Offset = (ULONG_PTR)&exp->un.binop.result; type1 = exp1.type; type2 = exp2.type; switch (exp->un.binop.binop_type) @@ -611,7 +611,7 @@ struct dbg_lvalue expr_eval(struct expr* exp) rtn.cookie = DLV_HOST; exp1 = expr_eval(exp->un.unop.exp1); if (exp1.type.id == dbg_itype_none) RaiseException(DEBUG_STATUS_BAD_TYPE, 0, 0, NULL); - rtn.addr.Offset = (unsigned int)&exp->un.unop.result; + rtn.addr.Offset = (ULONG_PTR)&exp->un.unop.result; rtn.type.id = dbg_itype_signed_int; rtn.type.module = 0; switch (exp->un.unop.unop_type) @@ -638,7 +638,7 @@ struct dbg_lvalue expr_eval(struct expr* exp) /* only do it on linear addresses */ if (exp1.addr.Mode != AddrModeFlat) RaiseException(DEBUG_STATUS_CANT_DEREF, 0, 0, NULL); - exp->un.unop.result = (unsigned int)memory_to_linear_addr(&exp1.addr); + exp->un.unop.result = (ULONG_PTR)memory_to_linear_addr(&exp1.addr); rtn.type = types_find_pointer(&exp1.type); if (rtn.type.id == dbg_itype_none) RaiseException(DEBUG_STATUS_CANT_DEREF, 0, 0, NULL); diff --git a/programs/winedbg/stack.c b/programs/winedbg/stack.c index 8fc877f6b10..6457a46f8e4 100644 --- a/programs/winedbg/stack.c +++ b/programs/winedbg/stack.c @@ -182,7 +182,7 @@ unsigned stack_fetch_frames(void) /* don't confuse StackWalk by passing in inconsistent addresses */ if ((sf.AddrPC.Mode == AddrModeFlat) && (sf.AddrFrame.Mode != AddrModeFlat)) { - sf.AddrFrame.Offset = (DWORD)memory_to_linear_addr(&sf.AddrFrame); + sf.AddrFrame.Offset = (ULONG_PTR)memory_to_linear_addr(&sf.AddrFrame); sf.AddrFrame.Mode = AddrModeFlat; } diff --git a/programs/winedbg/tgt_active.c b/programs/winedbg/tgt_active.c index f5ea8f20c00..2ff7ea5fa65 100644 --- a/programs/winedbg/tgt_active.c +++ b/programs/winedbg/tgt_active.c @@ -53,7 +53,7 @@ static void dbg_init_current_thread(void* start) break_set_xpoints(FALSE); addr.Mode = AddrModeFlat; - addr.Offset = (DWORD)start; + addr.Offset = (DWORD_PTR)start; break_add_break(&addr, TRUE, TRUE); break_set_xpoints(TRUE); } diff --git a/programs/winedbg/types.c b/programs/winedbg/types.c index 19fe68e397a..9f19b630937 100644 --- a/programs/winedbg/types.c +++ b/programs/winedbg/types.c @@ -114,7 +114,7 @@ LONGLONG types_extract_as_longlong(const struct dbg_lvalue* lvalue, unsigned* ps RaiseException(DEBUG_STATUS_INTERNAL_ERROR, 0, 0, NULL); break; case SymTagFunctionType: - rtn = (unsigned)memory_to_linear_addr(&lvalue->addr); + rtn = (ULONG_PTR)memory_to_linear_addr(&lvalue->addr); break; default: WINE_FIXME("Unsupported tag %u\n", tag); @@ -230,7 +230,7 @@ static BOOL types_get_udt_element_lvalue(struct dbg_lvalue* lvalue, *tmpbuf &= ~mask; lvalue->cookie = DLV_HOST; - lvalue->addr.Offset = (DWORD)tmpbuf; + lvalue->addr.Offset = (ULONG_PTR)tmpbuf; /* * OK, now we have the correct part of the number. diff --git a/programs/winhlp32/hlpfile.c b/programs/winhlp32/hlpfile.c index 99043ac7b5b..652ed58cb85 100644 --- a/programs/winhlp32/hlpfile.c +++ b/programs/winhlp32/hlpfile.c @@ -460,36 +460,36 @@ static BOOL HLPFILE_AddPage(HLPFILE *hlpfile, const BYTE *buf, const BYTE *end, return TRUE; } -static long fetch_long(const BYTE** ptr) +static LONG fetch_long(const BYTE** ptr) { - long ret; + LONG ret; if (*(*ptr) & 1) { - ret = (*(const unsigned long*)(*ptr) - 0x80000000L) / 2; + ret = (*(const ULONG*)(*ptr) - 0x80000000) / 2; (*ptr) += 4; } else { - ret = (*(const unsigned short*)(*ptr) - 0x8000) / 2; + ret = (*(const USHORT*)(*ptr) - 0x8000) / 2; (*ptr) += 2; } return ret; } -static unsigned long fetch_ulong(const BYTE** ptr) +static ULONG fetch_ulong(const BYTE** ptr) { - unsigned long ret; + ULONG ret; if (*(*ptr) & 1) { - ret = *(const unsigned long*)(*ptr) / 2; + ret = *(const ULONG*)(*ptr) / 2; (*ptr) += 4; } else { - ret = *(const unsigned short*)(*ptr) / 2; + ret = *(const USHORT*)(*ptr) / 2; (*ptr) += 2; } return ret; @@ -785,7 +785,7 @@ static BOOL HLPFILE_RtfAddBitmap(struct RtfData* rd, const BYTE* beg, BYTE type, const BYTE* pict_beg; BYTE* alloc = NULL; BITMAPINFO* bi; - unsigned long off, csz; + ULONG off, csz; unsigned nc = 0; BOOL clrImportant = FALSE; BOOL ret = FALSE; @@ -880,9 +880,8 @@ done: */ static BOOL HLPFILE_RtfAddMetaFile(struct RtfData* rd, const BYTE* beg, BYTE pack) { + ULONG size, csize, off, hsoff; const BYTE* ptr; - unsigned long size, csize; - unsigned long off, hsoff; const BYTE* bits; BYTE* alloc = NULL; char tmp[256]; @@ -906,8 +905,8 @@ static BOOL HLPFILE_RtfAddMetaFile(struct RtfData* rd, const BYTE* beg, BYTE hsoff = GET_UINT(ptr, 4); ptr += 8; - WINE_TRACE("sz=%lu csz=%lu offs=%lu/%u,%lu\n", - size, csize, off, ptr - beg, hsoff); + WINE_TRACE("sz=%u csz=%u offs=%u/%u,%u\n", + size, csize, off, (ULONG)(ptr - beg), hsoff); bits = HLPFILE_DecompressGfx(beg + off, csize, size, pack, &alloc); if (!bits) return FALSE; @@ -925,7 +924,7 @@ static BOOL HLPFILE_RtfAddMetaFile(struct RtfData* rd, const BYTE* beg, BYTE * */ static BOOL HLPFILE_RtfAddGfxByAddr(struct RtfData* rd, HLPFILE *hlpfile, - const BYTE* ref, unsigned long size) + const BYTE* ref, ULONG size) { unsigned i, numpict; @@ -1047,7 +1046,7 @@ static BOOL HLPFILE_BrowseParagraph(HLPFILE_PAGE* page, struct RtfData* rd, UINT textsize; const BYTE *format, *format_end; char *text, *text_base, *text_end; - long size, blocksize, datalen; + LONG size, blocksize, datalen; unsigned short bits; unsigned nc, ncol = 1; short table_width; @@ -1354,7 +1353,7 @@ static BOOL HLPFILE_BrowseParagraph(HLPFILE_PAGE* page, struct RtfData* rd, case 0x88: { BYTE type = format[1]; - long size; + LONG size; /* FIXME: we don't use 'BYTE pos = (*format - 0x86);' for the image position */ format += 2; @@ -1373,7 +1372,7 @@ static BOOL HLPFILE_BrowseParagraph(HLPFILE_PAGE* page, struct RtfData* rd, rd->char_pos++; break; case 1: - WINE_FIXME("does it work ??? %x<%lu>#%u\n", + WINE_FIXME("does it work ??? %x<%u>#%u\n", GET_SHORT(format, 0), size, GET_SHORT(format, 2)); HLPFILE_RtfAddGfxByAddr(rd, page->file, format + 2, size - 4); @@ -2126,14 +2125,14 @@ static BOOL HLPFILE_Uncompress_Phrases40(HLPFILE* hlpfile) INT dec_size, cpr_size; BYTE *buf_idx, *end_idx; BYTE *buf_phs, *end_phs; - long* ptr, mask = 0; + LONG* ptr, mask = 0; unsigned int i; unsigned short bc, n; if (!HLPFILE_FindSubFile(hlpfile, "|PhrIndex", &buf_idx, &end_idx) || !HLPFILE_FindSubFile(hlpfile, "|PhrImage", &buf_phs, &end_phs)) return FALSE; - ptr = (long*)(buf_idx + 9 + 28); + ptr = (LONG*)(buf_idx + 9 + 28); bc = GET_USHORT(buf_idx, 9 + 24) & 0x0F; num = hlpfile->num_phrases = GET_USHORT(buf_idx, 9 + 4); diff --git a/programs/winhlp32/macro.c b/programs/winhlp32/macro.c index 7179dcaacfa..0eeaa9b2b27 100644 --- a/programs/winhlp32/macro.c +++ b/programs/winhlp32/macro.c @@ -42,164 +42,112 @@ struct MacroDesc { FARPROC fn; }; -/* types: - * U: 32 bit unsigned int - * I: 32 bit signed int - * S: string - * v: unknown (32 bit entity) - */ - -static struct MacroDesc MACRO_Builtins[] = { - {"About", NULL, 0, "", (FARPROC)MACRO_About}, - {"AddAccelerator", "AA", 0, "UUS", (FARPROC)MACRO_AddAccelerator}, - {"ALink", "AL", 0, "SUS", (FARPROC)MACRO_ALink}, - {"Annotate", NULL, 0, "", (FARPROC)MACRO_Annotate}, - {"AppendItem", NULL, 0, "SSSS", (FARPROC)MACRO_AppendItem}, - {"Back", NULL, 0, "", (FARPROC)MACRO_Back}, - {"BackFlush", "BF", 0, "", (FARPROC)MACRO_BackFlush}, - {"BookmarkDefine", NULL, 0, "", (FARPROC)MACRO_BookmarkDefine}, - {"BookmarkMore", NULL, 0, "", (FARPROC)MACRO_BookmarkMore}, - {"BrowseButtons", NULL, 0, "", (FARPROC)MACRO_BrowseButtons}, - {"ChangeButtonBinding", "CBB",0, "SS", (FARPROC)MACRO_ChangeButtonBinding}, - {"ChangeEnable", "CE", 0, "SS", (FARPROC)MACRO_ChangeEnable}, - {"ChangeItemBinding", "CIB",0, "SS", (FARPROC)MACRO_ChangeItemBinding}, - {"CheckItem", "CI", 0, "S", (FARPROC)MACRO_CheckItem}, - {"CloseSecondarys", "CS", 0, "", (FARPROC)MACRO_CloseSecondarys}, - {"CloseWindow", "CW", 0, "S", (FARPROC)MACRO_CloseWindow}, - {"Compare", NULL, 0, "S", (FARPROC)MACRO_Compare}, - {"Contents", NULL, 0, "", (FARPROC)MACRO_Contents}, - {"ControlPanel", NULL, 0, "SSU", (FARPROC)MACRO_ControlPanel}, - {"CopyDialog", NULL, 0, "", (FARPROC)MACRO_CopyDialog}, - {"CopyTopic", "CT", 0, "", (FARPROC)MACRO_CopyTopic}, - {"CreateButton", "CB", 0, "SSS", (FARPROC)MACRO_CreateButton}, - {"DeleteItem", NULL, 0, "S", (FARPROC)MACRO_DeleteItem}, - {"DeleteMark", NULL, 0, "S", (FARPROC)MACRO_DeleteMark}, - {"DestroyButton", NULL, 0, "S", (FARPROC)MACRO_DestroyButton}, - {"DisableButton", "DB", 0, "S", (FARPROC)MACRO_DisableButton}, - {"DisableItem", "DI", 0, "S", (FARPROC)MACRO_DisableItem}, - {"EnableButton", "EB", 0, "S", (FARPROC)MACRO_EnableButton}, - {"EnableItem", "EI", 0, "S", (FARPROC)MACRO_EnableItem}, - {"EndMPrint", NULL, 0, "", (FARPROC)MACRO_EndMPrint}, - {"ExecFile", "EF", 0, "SSUS", (FARPROC)MACRO_ExecFile}, - {"ExecProgram", "EP", 0, "SU", (FARPROC)MACRO_ExecProgram}, - {"Exit", NULL, 0, "", (FARPROC)MACRO_Exit}, - {"ExtAbleItem", NULL, 0, "SU", (FARPROC)MACRO_ExtAbleItem}, - {"ExtInsertItem", NULL, 0, "SSSSUU", (FARPROC)MACRO_ExtInsertItem}, - {"ExtInsertMenu", NULL, 0, "SSSUU", (FARPROC)MACRO_ExtInsertMenu}, - {"FileExist", "FE", 1, "S", (FARPROC)MACRO_FileExist}, - {"FileOpen", "FO", 0, "", (FARPROC)MACRO_FileOpen}, - {"Find", NULL, 0, "", (FARPROC)MACRO_Find}, - {"Finder", "FD", 0, "", (FARPROC)MACRO_Finder}, - {"FloatingMenu", NULL, 0, "", (FARPROC)MACRO_FloatingMenu}, - {"Flush", "FH", 0, "", (FARPROC)MACRO_Flush}, - {"FocusWindow", NULL, 0, "S", (FARPROC)MACRO_FocusWindow}, - {"Generate", NULL, 0, "SUU", (FARPROC)MACRO_Generate}, - {"GotoMark", NULL, 0, "S", (FARPROC)MACRO_GotoMark}, - {"HelpOn", NULL, 0, "", (FARPROC)MACRO_HelpOn}, - {"HelpOnTop", NULL, 0, "", (FARPROC)MACRO_HelpOnTop}, - {"History", NULL, 0, "", (FARPROC)MACRO_History}, - {"InitMPrint", NULL, 1, "", (FARPROC)MACRO_InitMPrint}, - {"InsertItem", NULL, 0, "SSSSU", (FARPROC)MACRO_InsertItem}, - {"InsertMenu", NULL, 0, "SSU", (FARPROC)MACRO_InsertMenu}, - {"IfThen", "IF", 0, "BS", (FARPROC)MACRO_IfThen}, - {"IfThenElse", "IE", 0, "BSS", (FARPROC)MACRO_IfThenElse}, - {"IsBook", NULL, 1, "", (FARPROC)MACRO_IsBook}, - {"IsMark", NULL, 1, "S", (FARPROC)MACRO_IsMark}, - {"IsNotMark", "NM", 1, "S", (FARPROC)MACRO_IsNotMark}, - {"JumpContents", NULL, 0, "SS", (FARPROC)MACRO_JumpContents}, - {"JumpContext", "JC", 0, "SSU", (FARPROC)MACRO_JumpContext}, - {"JumpHash", "JH", 0, "SSU", (FARPROC)MACRO_JumpHash}, - {"JumpHelpOn", NULL, 0, "", (FARPROC)MACRO_JumpHelpOn}, - {"JumpID", "JI", 0, "SS", (FARPROC)MACRO_JumpID}, - {"JumpKeyword", "JK", 0, "SSS", (FARPROC)MACRO_JumpKeyword}, - {"KLink", "KL", 0, "SUSS", (FARPROC)MACRO_KLink}, - {"Menu", "MU", 0, "", (FARPROC)MACRO_Menu}, - {"MPrintHash", NULL, 0, "U", (FARPROC)MACRO_MPrintHash}, - {"MPrintID", NULL, 0, "S", (FARPROC)MACRO_MPrintID}, - {"Next", NULL, 0, "", (FARPROC)MACRO_Next}, - {"NoShow", NULL, 0, "", (FARPROC)MACRO_NoShow}, - {"PopupContext", "PC", 0, "SU", (FARPROC)MACRO_PopupContext}, - {"PopupHash", NULL, 0, "SU", (FARPROC)MACRO_PopupHash}, - {"PopupId", "PI", 0, "SS", (FARPROC)MACRO_PopupId}, - {"PositionWindow", "PW", 0, "IIUUUS", (FARPROC)MACRO_PositionWindow}, - {"Prev", NULL, 0, "", (FARPROC)MACRO_Prev}, - {"Print", NULL, 0, "", (FARPROC)MACRO_Print}, - {"PrinterSetup", NULL, 0, "", (FARPROC)MACRO_PrinterSetup}, - {"RegisterRoutine", "RR", 0, "SSS", (FARPROC)MACRO_RegisterRoutine}, - {"RemoveAccelerator", "RA", 0, "UU", (FARPROC)MACRO_RemoveAccelerator}, - {"ResetMenu", NULL, 0, "", (FARPROC)MACRO_ResetMenu}, - {"SaveMark", NULL, 0, "S", (FARPROC)MACRO_SaveMark}, - {"Search", NULL, 0, "", (FARPROC)MACRO_Search}, - {"SetContents", NULL, 0, "SU", (FARPROC)MACRO_SetContents}, - {"SetHelpOnFile", NULL, 0, "S", (FARPROC)MACRO_SetHelpOnFile}, - {"SetPopupColor", "SPC",0, "UUU", (FARPROC)MACRO_SetPopupColor}, - {"ShellExecute", "SE", 0, "SSUUSS", (FARPROC)MACRO_ShellExecute}, - {"ShortCut", "SH", 0, "SSUUS", (FARPROC)MACRO_ShortCut}, - {"TCard", NULL, 0, "U", (FARPROC)MACRO_TCard}, - {"Test", NULL, 0, "U", (FARPROC)MACRO_Test}, - {"TestALink", NULL, 1, "S", (FARPROC)MACRO_TestALink}, - {"TestKLink", NULL, 1, "S", (FARPROC)MACRO_TestKLink}, - {"UncheckItem", "UI", 0, "S", (FARPROC)MACRO_UncheckItem}, - {"UpdateWindow", "UW", 0, "SS", (FARPROC)MACRO_UpdateWindow}, - {NULL, NULL, 0, NULL, NULL} -}; - static struct MacroDesc*MACRO_Loaded /* = NULL */; static unsigned MACRO_NumLoaded /* = 0 */; -static int MACRO_DoLookUp(struct MacroDesc* start, const char* name, struct lexret* lr, unsigned len) +/******* helper functions *******/ + +static WINHELP_BUTTON** MACRO_LookupButton(WINHELP_WINDOW* win, LPCSTR name) { - struct MacroDesc* md; + WINHELP_BUTTON** b; - for (md = start; md->name && len != 0; md++, len--) - { - if (strcasecmp(md->name, name) == 0 || (md->alias != NULL && strcasecmp(md->alias, name) == 0)) - { - lr->proto = md->arguments; - lr->function = md->fn; - return md->isBool ? BOOL_FUNCTION : VOID_FUNCTION; - } - } - return EMPTY; + for (b = &win->first_button; *b; b = &(*b)->next) + if (!lstrcmpi(name, (*b)->lpszID)) break; + return b; } -int MACRO_Lookup(const char* name, struct lexret* lr) +/******* real macro implementation *******/ + +void CALLBACK MACRO_CreateButton(LPCSTR id, LPCSTR name, LPCSTR macro) { - int ret; + WINHELP_WINDOW *win = Globals.active_win; + WINHELP_BUTTON *button, **b; + LONG size; + LPSTR ptr; - if ((ret = MACRO_DoLookUp(MACRO_Builtins, name, lr, -1)) != EMPTY) - return ret; - if (MACRO_Loaded && (ret = MACRO_DoLookUp(MACRO_Loaded, name, lr, MACRO_NumLoaded)) != EMPTY) - return ret; + WINE_TRACE("(\"%s\", \"%s\", %s)\n", id, name, macro); - lr->string = name; - return IDENTIFIER; + size = sizeof(WINHELP_BUTTON) + lstrlen(id) + lstrlen(name) + lstrlen(macro) + 3; + + button = HeapAlloc(GetProcessHeap(), 0, size); + if (!button) return; + + button->next = 0; + button->hWnd = 0; + + ptr = (char*)button + sizeof(WINHELP_BUTTON); + + lstrcpy(ptr, id); + button->lpszID = ptr; + ptr += lstrlen(id) + 1; + + lstrcpy(ptr, name); + button->lpszName = ptr; + ptr += lstrlen(name) + 1; + + lstrcpy(ptr, macro); + button->lpszMacro = ptr; + + button->wParam = WH_FIRST_BUTTON; + for (b = &win->first_button; *b; b = &(*b)->next) + button->wParam = max(button->wParam, (*b)->wParam + 1); + *b = button; + + WINHELP_LayoutMainWindow(win); } -/******* helper functions *******/ +static void CALLBACK MACRO_DestroyButton(LPCSTR str) +{ + WINE_FIXME("(\"%s\")\n", str); +} -static WINHELP_BUTTON** MACRO_LookupButton(WINHELP_WINDOW* win, LPCSTR name) +void CALLBACK MACRO_DisableButton(LPCSTR id) { WINHELP_BUTTON** b; - for (b = &win->first_button; *b; b = &(*b)->next) - if (!lstrcmpi(name, (*b)->lpszID)) break; - return b; + WINE_TRACE("(\"%s\")\n", id); + + b = MACRO_LookupButton(Globals.active_win, id); + if (!*b) {WINE_FIXME("Couldn't find button '%s'\n", id); return;} + + EnableWindow((*b)->hWnd, FALSE); +} + +static void CALLBACK MACRO_EnableButton(LPCSTR id) +{ + WINHELP_BUTTON** b; + + WINE_TRACE("(\"%s\")\n", id); + + b = MACRO_LookupButton(Globals.active_win, id); + if (!*b) {WINE_FIXME("Couldn't find button '%s'\n", id); return;} + + EnableWindow((*b)->hWnd, TRUE); +} + +void CALLBACK MACRO_JumpContents(LPCSTR lpszPath, LPCSTR lpszWindow) +{ + HLPFILE* hlpfile; + + WINE_TRACE("(\"%s\", \"%s\")\n", lpszPath, lpszWindow); + if ((hlpfile = WINHELP_LookupHelpFile(lpszPath))) + WINHELP_OpenHelpWindow(HLPFILE_PageByHash, hlpfile, 0, + WINHELP_GetWindowInfo(hlpfile, lpszWindow), + SW_NORMAL); } -/******* real macro implementation *******/ void CALLBACK MACRO_About(void) { WINE_FIXME("()\n"); } -void CALLBACK MACRO_AddAccelerator(LONG u1, LONG u2, LPCSTR str) +static void CALLBACK MACRO_AddAccelerator(LONG u1, LONG u2, LPCSTR str) { WINE_FIXME("(%u, %u, \"%s\")\n", u1, u2, str); } -void CALLBACK MACRO_ALink(LPCSTR str1, LONG u, LPCSTR str2) +static void CALLBACK MACRO_ALink(LPCSTR str1, LONG u, LPCSTR str2) { WINE_FIXME("(\"%s\", %u, \"%s\")\n", str1, u, str2); } @@ -209,12 +157,12 @@ void CALLBACK MACRO_Annotate(void) WINE_FIXME("()\n"); } -void CALLBACK MACRO_AppendItem(LPCSTR str1, LPCSTR str2, LPCSTR str3, LPCSTR str4) +static void CALLBACK MACRO_AppendItem(LPCSTR str1, LPCSTR str2, LPCSTR str3, LPCSTR str4) { WINE_FIXME("(\"%s\", \"%s\", \"%s\", \"%s\")\n", str1, str2, str3, str4); } -void CALLBACK MACRO_Back(void) +static void CALLBACK MACRO_Back(void) { WINHELP_WINDOW* win = Globals.active_win; @@ -224,7 +172,7 @@ void CALLBACK MACRO_Back(void) WINHELP_CreateHelpWindow(&win->back.set[--win->back.index - 1], SW_SHOW, FALSE); } -void CALLBACK MACRO_BackFlush(void) +static void CALLBACK MACRO_BackFlush(void) { WINHELP_WINDOW* win = Globals.active_win; @@ -238,12 +186,12 @@ void CALLBACK MACRO_BookmarkDefine(void) WINE_FIXME("()\n"); } -void CALLBACK MACRO_BookmarkMore(void) +static void CALLBACK MACRO_BookmarkMore(void) { WINE_FIXME("()\n"); } -void CALLBACK MACRO_BrowseButtons(void) +static void CALLBACK MACRO_BrowseButtons(void) { HLPFILE_PAGE* page = Globals.active_win->page; ULONG relative; @@ -259,7 +207,7 @@ void CALLBACK MACRO_BrowseButtons(void) MACRO_DisableButton("BTN_NEXT"); } -void CALLBACK MACRO_ChangeButtonBinding(LPCSTR id, LPCSTR macro) +static void CALLBACK MACRO_ChangeButtonBinding(LPCSTR id, LPCSTR macro) { WINHELP_WINDOW* win = Globals.active_win; WINHELP_BUTTON* button; @@ -300,7 +248,7 @@ void CALLBACK MACRO_ChangeButtonBinding(LPCSTR id, LPCSTR macro) WINHELP_LayoutMainWindow(win); } -void CALLBACK MACRO_ChangeEnable(LPCSTR id, LPCSTR macro) +static void CALLBACK MACRO_ChangeEnable(LPCSTR id, LPCSTR macro) { WINE_TRACE("(\"%s\", \"%s\")\n", id, macro); @@ -308,17 +256,17 @@ void CALLBACK MACRO_ChangeEnable(LPCSTR id, LPCSTR macro) MACRO_EnableButton(id); } -void CALLBACK MACRO_ChangeItemBinding(LPCSTR str1, LPCSTR str2) +static void CALLBACK MACRO_ChangeItemBinding(LPCSTR str1, LPCSTR str2) { WINE_FIXME("(\"%s\", \"%s\")\n", str1, str2); } -void CALLBACK MACRO_CheckItem(LPCSTR str) +static void CALLBACK MACRO_CheckItem(LPCSTR str) { WINE_FIXME("(\"%s\")\n", str); } -void CALLBACK MACRO_CloseSecondarys(void) +static void CALLBACK MACRO_CloseSecondarys(void) { WINHELP_WINDOW *win; @@ -328,7 +276,7 @@ void CALLBACK MACRO_CloseSecondarys(void) DestroyWindow(win->hMainWnd); } -void CALLBACK MACRO_CloseWindow(LPCSTR lpszWindow) +static void CALLBACK MACRO_CloseWindow(LPCSTR lpszWindow) { WINHELP_WINDOW *win; @@ -341,12 +289,12 @@ void CALLBACK MACRO_CloseWindow(LPCSTR lpszWindow) DestroyWindow(win->hMainWnd); } -void CALLBACK MACRO_Compare(LPCSTR str) +static void CALLBACK MACRO_Compare(LPCSTR str) { WINE_FIXME("(\"%s\")\n", str); } -void CALLBACK MACRO_Contents(void) +static void CALLBACK MACRO_Contents(void) { WINE_TRACE("()\n"); @@ -354,7 +302,7 @@ void CALLBACK MACRO_Contents(void) MACRO_JumpContents(Globals.active_win->page->file->lpszPath, NULL); } -void CALLBACK MACRO_ControlPanel(LPCSTR str1, LPCSTR str2, LONG u) +static void CALLBACK MACRO_ControlPanel(LPCSTR str1, LPCSTR str2, LONG u) { WINE_FIXME("(\"%s\", \"%s\", %u)\n", str1, str2, u); } @@ -364,109 +312,42 @@ void CALLBACK MACRO_CopyDialog(void) WINE_FIXME("()\n"); } -void CALLBACK MACRO_CopyTopic(void) +static void CALLBACK MACRO_CopyTopic(void) { WINE_FIXME("()\n"); } -void CALLBACK MACRO_CreateButton(LPCSTR id, LPCSTR name, LPCSTR macro) -{ - WINHELP_WINDOW *win = Globals.active_win; - WINHELP_BUTTON *button, **b; - LONG size; - LPSTR ptr; - - WINE_TRACE("(\"%s\", \"%s\", %s)\n", id, name, macro); - - size = sizeof(WINHELP_BUTTON) + lstrlen(id) + lstrlen(name) + lstrlen(macro) + 3; - - button = HeapAlloc(GetProcessHeap(), 0, size); - if (!button) return; - - button->next = 0; - button->hWnd = 0; - - ptr = (char*)button + sizeof(WINHELP_BUTTON); - - lstrcpy(ptr, id); - button->lpszID = ptr; - ptr += lstrlen(id) + 1; - - lstrcpy(ptr, name); - button->lpszName = ptr; - ptr += lstrlen(name) + 1; - - lstrcpy(ptr, macro); - button->lpszMacro = ptr; - - button->wParam = WH_FIRST_BUTTON; - for (b = &win->first_button; *b; b = &(*b)->next) - button->wParam = max(button->wParam, (*b)->wParam + 1); - *b = button; - - WINHELP_LayoutMainWindow(win); -} - -void CALLBACK MACRO_DeleteItem(LPCSTR str) +static void CALLBACK MACRO_DeleteItem(LPCSTR str) { WINE_FIXME("(\"%s\")\n", str); } -void CALLBACK MACRO_DeleteMark(LPCSTR str) +static void CALLBACK MACRO_DeleteMark(LPCSTR str) { WINE_FIXME("(\"%s\")\n", str); } -void CALLBACK MACRO_DestroyButton(LPCSTR str) -{ - WINE_FIXME("(\"%s\")\n", str); -} - -void CALLBACK MACRO_DisableButton(LPCSTR id) -{ - WINHELP_BUTTON** b; - - WINE_TRACE("(\"%s\")\n", id); - - b = MACRO_LookupButton(Globals.active_win, id); - if (!*b) {WINE_FIXME("Couldn't find button '%s'\n", id); return;} - - EnableWindow((*b)->hWnd, FALSE); -} - -void CALLBACK MACRO_DisableItem(LPCSTR str) +static void CALLBACK MACRO_DisableItem(LPCSTR str) { WINE_FIXME("(\"%s\")\n", str); } -void CALLBACK MACRO_EnableButton(LPCSTR id) -{ - WINHELP_BUTTON** b; - - WINE_TRACE("(\"%s\")\n", id); - - b = MACRO_LookupButton(Globals.active_win, id); - if (!*b) {WINE_FIXME("Couldn't find button '%s'\n", id); return;} - - EnableWindow((*b)->hWnd, TRUE); -} - -void CALLBACK MACRO_EnableItem(LPCSTR str) +static void CALLBACK MACRO_EnableItem(LPCSTR str) { WINE_FIXME("(\"%s\")\n", str); } -void CALLBACK MACRO_EndMPrint(void) +static void CALLBACK MACRO_EndMPrint(void) { WINE_FIXME("()\n"); } -void CALLBACK MACRO_ExecFile(LPCSTR str1, LPCSTR str2, LONG u, LPCSTR str3) +static void CALLBACK MACRO_ExecFile(LPCSTR str1, LPCSTR str2, LONG u, LPCSTR str3) { WINE_FIXME("(\"%s\", \"%s\", %u, \"%s\")\n", str1, str2, u, str3); } -void CALLBACK MACRO_ExecProgram(LPCSTR str, LONG u) +static void CALLBACK MACRO_ExecProgram(LPCSTR str, LONG u) { WINE_FIXME("(\"%s\", %u)\n", str, u); } @@ -479,22 +360,22 @@ void CALLBACK MACRO_Exit(void) DestroyWindow(Globals.win_list->hMainWnd); } -void CALLBACK MACRO_ExtAbleItem(LPCSTR str, LONG u) +static void CALLBACK MACRO_ExtAbleItem(LPCSTR str, LONG u) { WINE_FIXME("(\"%s\", %u)\n", str, u); } -void CALLBACK MACRO_ExtInsertItem(LPCSTR str1, LPCSTR str2, LPCSTR str3, LPCSTR str4, LONG u1, LONG u2) +static void CALLBACK MACRO_ExtInsertItem(LPCSTR str1, LPCSTR str2, LPCSTR str3, LPCSTR str4, LONG u1, LONG u2) { WINE_FIXME("(\"%s\", \"%s\", \"%s\", \"%s\", %u, %u)\n", str1, str2, str3, str4, u1, u2); } -void CALLBACK MACRO_ExtInsertMenu(LPCSTR str1, LPCSTR str2, LPCSTR str3, LONG u1, LONG u2) +static void CALLBACK MACRO_ExtInsertMenu(LPCSTR str1, LPCSTR str2, LPCSTR str3, LONG u1, LONG u2) { WINE_FIXME("(\"%s\", \"%s\", \"%s\", %u, %u)\n", str1, str2, str3, u1, u2); } -BOOL CALLBACK MACRO_FileExist(LPCSTR str) +static BOOL CALLBACK MACRO_FileExist(LPCSTR str) { WINE_TRACE("(\"%s\")\n", str); return GetFileAttributes(str) != INVALID_FILE_ATTRIBUTES; @@ -510,27 +391,27 @@ void CALLBACK MACRO_FileOpen(void) } } -void CALLBACK MACRO_Find(void) +static void CALLBACK MACRO_Find(void) { WINE_FIXME("()\n"); } -void CALLBACK MACRO_Finder(void) +static void CALLBACK MACRO_Finder(void) { WINHELP_CreateIndexWindow(FALSE); } -void CALLBACK MACRO_FloatingMenu(void) +static void CALLBACK MACRO_FloatingMenu(void) { WINE_FIXME("()\n"); } -void CALLBACK MACRO_Flush(void) +static void CALLBACK MACRO_Flush(void) { WINE_FIXME("()\n"); } -void CALLBACK MACRO_FocusWindow(LPCSTR lpszWindow) +static void CALLBACK MACRO_FocusWindow(LPCSTR lpszWindow) { WINHELP_WINDOW *win; @@ -543,12 +424,12 @@ void CALLBACK MACRO_FocusWindow(LPCSTR lpszWindow) SetFocus(win->hMainWnd); } -void CALLBACK MACRO_Generate(LPCSTR str, LONG w, LONG l) +static void CALLBACK MACRO_Generate(LPCSTR str, LONG w, LONG l) { WINE_FIXME("(\"%s\", %x, %x)\n", str, w, l); } -void CALLBACK MACRO_GotoMark(LPCSTR str) +static void CALLBACK MACRO_GotoMark(LPCSTR str) { WINE_FIXME("(\"%s\")\n", str); } @@ -582,61 +463,50 @@ void CALLBACK MACRO_History(void) } } -void CALLBACK MACRO_IfThen(BOOL b, LPCSTR t) +static void CALLBACK MACRO_IfThen(BOOL b, LPCSTR t) { if (b) MACRO_ExecuteMacro(t); } -void CALLBACK MACRO_IfThenElse(BOOL b, LPCSTR t, LPCSTR f) +static void CALLBACK MACRO_IfThenElse(BOOL b, LPCSTR t, LPCSTR f) { if (b) MACRO_ExecuteMacro(t); else MACRO_ExecuteMacro(f); } -BOOL CALLBACK MACRO_InitMPrint(void) +static BOOL CALLBACK MACRO_InitMPrint(void) { WINE_FIXME("()\n"); return FALSE; } -void CALLBACK MACRO_InsertItem(LPCSTR str1, LPCSTR str2, LPCSTR str3, LPCSTR str4, LONG u) +static void CALLBACK MACRO_InsertItem(LPCSTR str1, LPCSTR str2, LPCSTR str3, LPCSTR str4, LONG u) { WINE_FIXME("(\"%s\", \"%s\", \"%s\", \"%s\", %u)\n", str1, str2, str3, str4, u); } -void CALLBACK MACRO_InsertMenu(LPCSTR str1, LPCSTR str2, LONG u) +static void CALLBACK MACRO_InsertMenu(LPCSTR str1, LPCSTR str2, LONG u) { WINE_FIXME("(\"%s\", \"%s\", %u)\n", str1, str2, u); } -BOOL CALLBACK MACRO_IsBook(void) +static BOOL CALLBACK MACRO_IsBook(void) { WINE_TRACE("()\n"); return Globals.isBook; } -BOOL CALLBACK MACRO_IsMark(LPCSTR str) +static BOOL CALLBACK MACRO_IsMark(LPCSTR str) { WINE_FIXME("(\"%s\")\n", str); return FALSE; } -BOOL CALLBACK MACRO_IsNotMark(LPCSTR str) +static BOOL CALLBACK MACRO_IsNotMark(LPCSTR str) { WINE_FIXME("(\"%s\")\n", str); return TRUE; } -void CALLBACK MACRO_JumpContents(LPCSTR lpszPath, LPCSTR lpszWindow) -{ - HLPFILE* hlpfile; - - WINE_TRACE("(\"%s\", \"%s\")\n", lpszPath, lpszWindow); - if ((hlpfile = WINHELP_LookupHelpFile(lpszPath))) - WINHELP_OpenHelpWindow(HLPFILE_PageByHash, hlpfile, 0, - WINHELP_GetWindowInfo(hlpfile, lpszWindow), - SW_NORMAL); -} - void CALLBACK MACRO_JumpContext(LPCSTR lpszPath, LPCSTR lpszWindow, LONG context) { HLPFILE* hlpfile; @@ -660,12 +530,12 @@ void CALLBACK MACRO_JumpHash(LPCSTR lpszPath, LPCSTR lpszWindow, LONG lHash) SW_NORMAL); } -void CALLBACK MACRO_JumpHelpOn(void) +static void CALLBACK MACRO_JumpHelpOn(void) { WINE_FIXME("()\n"); } -void CALLBACK MACRO_JumpID(LPCSTR lpszPathWindow, LPCSTR topic_id) +static void CALLBACK MACRO_JumpID(LPCSTR lpszPathWindow, LPCSTR topic_id) { LPSTR ptr; @@ -691,32 +561,32 @@ void CALLBACK MACRO_JumpID(LPCSTR lpszPathWindow, LPCSTR topic_id) /* FIXME: this macros is wrong * it should only contain 2 strings, path & window are coded as path>window */ -void CALLBACK MACRO_JumpKeyword(LPCSTR lpszPath, LPCSTR lpszWindow, LPCSTR keyword) +static void CALLBACK MACRO_JumpKeyword(LPCSTR lpszPath, LPCSTR lpszWindow, LPCSTR keyword) { WINE_FIXME("(\"%s\", \"%s\", \"%s\")\n", lpszPath, lpszWindow, keyword); } -void CALLBACK MACRO_KLink(LPCSTR str1, LONG u, LPCSTR str2, LPCSTR str3) +static void CALLBACK MACRO_KLink(LPCSTR str1, LONG u, LPCSTR str2, LPCSTR str3) { WINE_FIXME("(\"%s\", %u, \"%s\", \"%s\")\n", str1, u, str2, str3); } -void CALLBACK MACRO_Menu(void) +static void CALLBACK MACRO_Menu(void) { WINE_FIXME("()\n"); } -void CALLBACK MACRO_MPrintHash(LONG u) +static void CALLBACK MACRO_MPrintHash(LONG u) { WINE_FIXME("(%u)\n", u); } -void CALLBACK MACRO_MPrintID(LPCSTR str) +static void CALLBACK MACRO_MPrintID(LPCSTR str) { WINE_FIXME("(\"%s\")\n", str); } -void CALLBACK MACRO_Next(void) +static void CALLBACK MACRO_Next(void) { WINHELP_WNDPAGE wp; @@ -731,7 +601,7 @@ void CALLBACK MACRO_Next(void) } } -void CALLBACK MACRO_NoShow(void) +static void CALLBACK MACRO_NoShow(void) { WINE_FIXME("()\n"); } @@ -741,22 +611,22 @@ void CALLBACK MACRO_PopupContext(LPCSTR str, LONG u) WINE_FIXME("(\"%s\", %u)\n", str, u); } -void CALLBACK MACRO_PopupHash(LPCSTR str, LONG u) +static void CALLBACK MACRO_PopupHash(LPCSTR str, LONG u) { WINE_FIXME("(\"%s\", %u)\n", str, u); } -void CALLBACK MACRO_PopupId(LPCSTR str1, LPCSTR str2) +static void CALLBACK MACRO_PopupId(LPCSTR str1, LPCSTR str2) { WINE_FIXME("(\"%s\", \"%s\")\n", str1, str2); } -void CALLBACK MACRO_PositionWindow(LONG i1, LONG i2, LONG u1, LONG u2, LONG u3, LPCSTR str) +static void CALLBACK MACRO_PositionWindow(LONG i1, LONG i2, LONG u1, LONG u2, LONG u3, LPCSTR str) { WINE_FIXME("(%i, %i, %u, %u, %u, \"%s\")\n", i1, i2, u1, u2, u3, str); } -void CALLBACK MACRO_Prev(void) +static void CALLBACK MACRO_Prev(void) { WINHELP_WNDPAGE wp; @@ -807,7 +677,7 @@ void CALLBACK MACRO_PrinterSetup(void) WINE_FIXME("()\n"); } -void CALLBACK MACRO_RegisterRoutine(LPCSTR dll_name, LPCSTR proc, LPCSTR args) +static void CALLBACK MACRO_RegisterRoutine(LPCSTR dll_name, LPCSTR proc, LPCSTR args) { FARPROC fn = NULL; int size; @@ -869,22 +739,22 @@ void CALLBACK MACRO_RegisterRoutine(LPCSTR dll_name, LPCSTR proc, LPCSTR args) WINE_TRACE("Added %s(%s) at %p\n", proc, args, fn); } -void CALLBACK MACRO_RemoveAccelerator(LONG u1, LONG u2) +static void CALLBACK MACRO_RemoveAccelerator(LONG u1, LONG u2) { WINE_FIXME("(%u, %u)\n", u1, u2); } -void CALLBACK MACRO_ResetMenu(void) +static void CALLBACK MACRO_ResetMenu(void) { WINE_FIXME("()\n"); } -void CALLBACK MACRO_SaveMark(LPCSTR str) +static void CALLBACK MACRO_SaveMark(LPCSTR str) { WINE_FIXME("(\"%s\")\n", str); } -void CALLBACK MACRO_Search(void) +static void CALLBACK MACRO_Search(void) { WINHELP_CreateIndexWindow(TRUE); } @@ -894,7 +764,7 @@ void CALLBACK MACRO_SetContents(LPCSTR str, LONG u) WINE_FIXME("(\"%s\", %u)\n", str, u); } -void CALLBACK MACRO_SetHelpOnFile(LPCSTR str) +static void CALLBACK MACRO_SetHelpOnFile(LPCSTR str) { WINE_TRACE("(\"%s\")\n", str); @@ -904,51 +774,187 @@ void CALLBACK MACRO_SetHelpOnFile(LPCSTR str) strcpy(Globals.active_win->page->file->help_on_file, str); } -void CALLBACK MACRO_SetPopupColor(LONG r, LONG g, LONG b) +static void CALLBACK MACRO_SetPopupColor(LONG r, LONG g, LONG b) { WINE_TRACE("(%x, %x, %x)\n", r, g, b); Globals.active_win->page->file->has_popup_color = TRUE; Globals.active_win->page->file->popup_color = RGB(r, g, b); } -void CALLBACK MACRO_ShellExecute(LPCSTR str1, LPCSTR str2, LONG u1, LONG u2, LPCSTR str3, LPCSTR str4) +static void CALLBACK MACRO_ShellExecute(LPCSTR str1, LPCSTR str2, LONG u1, LONG u2, LPCSTR str3, LPCSTR str4) { WINE_FIXME("(\"%s\", \"%s\", %u, %u, \"%s\", \"%s\")\n", str1, str2, u1, u2, str3, str4); } -void CALLBACK MACRO_ShortCut(LPCSTR str1, LPCSTR str2, LONG w, LONG l, LPCSTR str) +static void CALLBACK MACRO_ShortCut(LPCSTR str1, LPCSTR str2, LONG w, LONG l, LPCSTR str) { WINE_FIXME("(\"%s\", \"%s\", %x, %x, \"%s\")\n", str1, str2, w, l, str); } -void CALLBACK MACRO_TCard(LONG u) +static void CALLBACK MACRO_TCard(LONG u) { WINE_FIXME("(%u)\n", u); } -void CALLBACK MACRO_Test(LONG u) +static void CALLBACK MACRO_Test(LONG u) { WINE_FIXME("(%u)\n", u); } -BOOL CALLBACK MACRO_TestALink(LPCSTR str) +static BOOL CALLBACK MACRO_TestALink(LPCSTR str) { WINE_FIXME("(\"%s\")\n", str); return FALSE; } -BOOL CALLBACK MACRO_TestKLink(LPCSTR str) +static BOOL CALLBACK MACRO_TestKLink(LPCSTR str) { WINE_FIXME("(\"%s\")\n", str); return FALSE; } -void CALLBACK MACRO_UncheckItem(LPCSTR str) +static void CALLBACK MACRO_UncheckItem(LPCSTR str) { WINE_FIXME("(\"%s\")\n", str); } -void CALLBACK MACRO_UpdateWindow(LPCSTR str1, LPCSTR str2) +static void CALLBACK MACRO_UpdateWindow(LPCSTR str1, LPCSTR str2) { WINE_FIXME("(\"%s\", \"%s\")\n", str1, str2); } + + +/**************************************************/ +/* Macro table */ +/**************************************************/ + +/* types: + * U: 32 bit unsigned int + * I: 32 bit signed int + * S: string + * v: unknown (32 bit entity) + */ + +static struct MacroDesc MACRO_Builtins[] = { + {"About", NULL, 0, "", (FARPROC)MACRO_About}, + {"AddAccelerator", "AA", 0, "UUS", (FARPROC)MACRO_AddAccelerator}, + {"ALink", "AL", 0, "SUS", (FARPROC)MACRO_ALink}, + {"Annotate", NULL, 0, "", (FARPROC)MACRO_Annotate}, + {"AppendItem", NULL, 0, "SSSS", (FARPROC)MACRO_AppendItem}, + {"Back", NULL, 0, "", (FARPROC)MACRO_Back}, + {"BackFlush", "BF", 0, "", (FARPROC)MACRO_BackFlush}, + {"BookmarkDefine", NULL, 0, "", (FARPROC)MACRO_BookmarkDefine}, + {"BookmarkMore", NULL, 0, "", (FARPROC)MACRO_BookmarkMore}, + {"BrowseButtons", NULL, 0, "", (FARPROC)MACRO_BrowseButtons}, + {"ChangeButtonBinding", "CBB",0, "SS", (FARPROC)MACRO_ChangeButtonBinding}, + {"ChangeEnable", "CE", 0, "SS", (FARPROC)MACRO_ChangeEnable}, + {"ChangeItemBinding", "CIB",0, "SS", (FARPROC)MACRO_ChangeItemBinding}, + {"CheckItem", "CI", 0, "S", (FARPROC)MACRO_CheckItem}, + {"CloseSecondarys", "CS", 0, "", (FARPROC)MACRO_CloseSecondarys}, + {"CloseWindow", "CW", 0, "S", (FARPROC)MACRO_CloseWindow}, + {"Compare", NULL, 0, "S", (FARPROC)MACRO_Compare}, + {"Contents", NULL, 0, "", (FARPROC)MACRO_Contents}, + {"ControlPanel", NULL, 0, "SSU", (FARPROC)MACRO_ControlPanel}, + {"CopyDialog", NULL, 0, "", (FARPROC)MACRO_CopyDialog}, + {"CopyTopic", "CT", 0, "", (FARPROC)MACRO_CopyTopic}, + {"CreateButton", "CB", 0, "SSS", (FARPROC)MACRO_CreateButton}, + {"DeleteItem", NULL, 0, "S", (FARPROC)MACRO_DeleteItem}, + {"DeleteMark", NULL, 0, "S", (FARPROC)MACRO_DeleteMark}, + {"DestroyButton", NULL, 0, "S", (FARPROC)MACRO_DestroyButton}, + {"DisableButton", "DB", 0, "S", (FARPROC)MACRO_DisableButton}, + {"DisableItem", "DI", 0, "S", (FARPROC)MACRO_DisableItem}, + {"EnableButton", "EB", 0, "S", (FARPROC)MACRO_EnableButton}, + {"EnableItem", "EI", 0, "S", (FARPROC)MACRO_EnableItem}, + {"EndMPrint", NULL, 0, "", (FARPROC)MACRO_EndMPrint}, + {"ExecFile", "EF", 0, "SSUS", (FARPROC)MACRO_ExecFile}, + {"ExecProgram", "EP", 0, "SU", (FARPROC)MACRO_ExecProgram}, + {"Exit", NULL, 0, "", (FARPROC)MACRO_Exit}, + {"ExtAbleItem", NULL, 0, "SU", (FARPROC)MACRO_ExtAbleItem}, + {"ExtInsertItem", NULL, 0, "SSSSUU", (FARPROC)MACRO_ExtInsertItem}, + {"ExtInsertMenu", NULL, 0, "SSSUU", (FARPROC)MACRO_ExtInsertMenu}, + {"FileExist", "FE", 1, "S", (FARPROC)MACRO_FileExist}, + {"FileOpen", "FO", 0, "", (FARPROC)MACRO_FileOpen}, + {"Find", NULL, 0, "", (FARPROC)MACRO_Find}, + {"Finder", "FD", 0, "", (FARPROC)MACRO_Finder}, + {"FloatingMenu", NULL, 0, "", (FARPROC)MACRO_FloatingMenu}, + {"Flush", "FH", 0, "", (FARPROC)MACRO_Flush}, + {"FocusWindow", NULL, 0, "S", (FARPROC)MACRO_FocusWindow}, + {"Generate", NULL, 0, "SUU", (FARPROC)MACRO_Generate}, + {"GotoMark", NULL, 0, "S", (FARPROC)MACRO_GotoMark}, + {"HelpOn", NULL, 0, "", (FARPROC)MACRO_HelpOn}, + {"HelpOnTop", NULL, 0, "", (FARPROC)MACRO_HelpOnTop}, + {"History", NULL, 0, "", (FARPROC)MACRO_History}, + {"InitMPrint", NULL, 1, "", (FARPROC)MACRO_InitMPrint}, + {"InsertItem", NULL, 0, "SSSSU", (FARPROC)MACRO_InsertItem}, + {"InsertMenu", NULL, 0, "SSU", (FARPROC)MACRO_InsertMenu}, + {"IfThen", "IF", 0, "BS", (FARPROC)MACRO_IfThen}, + {"IfThenElse", "IE", 0, "BSS", (FARPROC)MACRO_IfThenElse}, + {"IsBook", NULL, 1, "", (FARPROC)MACRO_IsBook}, + {"IsMark", NULL, 1, "S", (FARPROC)MACRO_IsMark}, + {"IsNotMark", "NM", 1, "S", (FARPROC)MACRO_IsNotMark}, + {"JumpContents", NULL, 0, "SS", (FARPROC)MACRO_JumpContents}, + {"JumpContext", "JC", 0, "SSU", (FARPROC)MACRO_JumpContext}, + {"JumpHash", "JH", 0, "SSU", (FARPROC)MACRO_JumpHash}, + {"JumpHelpOn", NULL, 0, "", (FARPROC)MACRO_JumpHelpOn}, + {"JumpID", "JI", 0, "SS", (FARPROC)MACRO_JumpID}, + {"JumpKeyword", "JK", 0, "SSS", (FARPROC)MACRO_JumpKeyword}, + {"KLink", "KL", 0, "SUSS", (FARPROC)MACRO_KLink}, + {"Menu", "MU", 0, "", (FARPROC)MACRO_Menu}, + {"MPrintHash", NULL, 0, "U", (FARPROC)MACRO_MPrintHash}, + {"MPrintID", NULL, 0, "S", (FARPROC)MACRO_MPrintID}, + {"Next", NULL, 0, "", (FARPROC)MACRO_Next}, + {"NoShow", NULL, 0, "", (FARPROC)MACRO_NoShow}, + {"PopupContext", "PC", 0, "SU", (FARPROC)MACRO_PopupContext}, + {"PopupHash", NULL, 0, "SU", (FARPROC)MACRO_PopupHash}, + {"PopupId", "PI", 0, "SS", (FARPROC)MACRO_PopupId}, + {"PositionWindow", "PW", 0, "IIUUUS", (FARPROC)MACRO_PositionWindow}, + {"Prev", NULL, 0, "", (FARPROC)MACRO_Prev}, + {"Print", NULL, 0, "", (FARPROC)MACRO_Print}, + {"PrinterSetup", NULL, 0, "", (FARPROC)MACRO_PrinterSetup}, + {"RegisterRoutine", "RR", 0, "SSS", (FARPROC)MACRO_RegisterRoutine}, + {"RemoveAccelerator", "RA", 0, "UU", (FARPROC)MACRO_RemoveAccelerator}, + {"ResetMenu", NULL, 0, "", (FARPROC)MACRO_ResetMenu}, + {"SaveMark", NULL, 0, "S", (FARPROC)MACRO_SaveMark}, + {"Search", NULL, 0, "", (FARPROC)MACRO_Search}, + {"SetContents", NULL, 0, "SU", (FARPROC)MACRO_SetContents}, + {"SetHelpOnFile", NULL, 0, "S", (FARPROC)MACRO_SetHelpOnFile}, + {"SetPopupColor", "SPC",0, "UUU", (FARPROC)MACRO_SetPopupColor}, + {"ShellExecute", "SE", 0, "SSUUSS", (FARPROC)MACRO_ShellExecute}, + {"ShortCut", "SH", 0, "SSUUS", (FARPROC)MACRO_ShortCut}, + {"TCard", NULL, 0, "U", (FARPROC)MACRO_TCard}, + {"Test", NULL, 0, "U", (FARPROC)MACRO_Test}, + {"TestALink", NULL, 1, "S", (FARPROC)MACRO_TestALink}, + {"TestKLink", NULL, 1, "S", (FARPROC)MACRO_TestKLink}, + {"UncheckItem", "UI", 0, "S", (FARPROC)MACRO_UncheckItem}, + {"UpdateWindow", "UW", 0, "SS", (FARPROC)MACRO_UpdateWindow}, + {NULL, NULL, 0, NULL, NULL} +}; + +static int MACRO_DoLookUp(struct MacroDesc* start, const char* name, struct lexret* lr, unsigned len) +{ + struct MacroDesc* md; + + for (md = start; md->name && len != 0; md++, len--) + { + if (strcasecmp(md->name, name) == 0 || (md->alias != NULL && strcasecmp(md->alias, name) == 0)) + { + lr->proto = md->arguments; + lr->function = md->fn; + return md->isBool ? BOOL_FUNCTION : VOID_FUNCTION; + } + } + return EMPTY; +} + +int MACRO_Lookup(const char* name, struct lexret* lr) +{ + int ret; + + if ((ret = MACRO_DoLookUp(MACRO_Builtins, name, lr, -1)) != EMPTY) + return ret; + if (MACRO_Loaded && (ret = MACRO_DoLookUp(MACRO_Loaded, name, lr, MACRO_NumLoaded)) != EMPTY) + return ret; + + lr->string = name; + return IDENTIFIER; +} diff --git a/programs/winhlp32/macro.h b/programs/winhlp32/macro.h dissimilarity index 61% index ee1fd69b561..8b157197ca5 100644 --- a/programs/winhlp32/macro.h +++ b/programs/winhlp32/macro.h @@ -1,135 +1,62 @@ -/* - * Help Viewer - * - * Copyright 1996 Ulrich Schmid - * Copyright 2002 Eric Pouech - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include - -#include "windef.h" -#include "winbase.h" - -struct lexret { - LPCSTR proto; - BOOL bool; - LONG integer; - LPCSTR string; - FARPROC function; -}; - -extern struct lexret yylval; - -BOOL MACRO_ExecuteMacro(LPCSTR); -int MACRO_Lookup(const char* name, struct lexret* lr); - -enum token_types {EMPTY, VOID_FUNCTION, BOOL_FUNCTION, INTEGER, STRING, IDENTIFIER}; -void CALLBACK MACRO_About(void); -void CALLBACK MACRO_AddAccelerator(LONG, LONG, LPCSTR); -void CALLBACK MACRO_ALink(LPCSTR, LONG, LPCSTR); -void CALLBACK MACRO_Annotate(void); -void CALLBACK MACRO_AppendItem(LPCSTR, LPCSTR, LPCSTR, LPCSTR); -void CALLBACK MACRO_Back(void); -void CALLBACK MACRO_BackFlush(void); -void CALLBACK MACRO_BookmarkDefine(void); -void CALLBACK MACRO_BookmarkMore(void); -void CALLBACK MACRO_BrowseButtons(void); -void CALLBACK MACRO_ChangeButtonBinding(LPCSTR, LPCSTR); -void CALLBACK MACRO_ChangeEnable(LPCSTR, LPCSTR); -void CALLBACK MACRO_ChangeItemBinding(LPCSTR, LPCSTR); -void CALLBACK MACRO_CheckItem(LPCSTR); -void CALLBACK MACRO_CloseSecondarys(void); -void CALLBACK MACRO_CloseWindow(LPCSTR); -void CALLBACK MACRO_Compare(LPCSTR); -void CALLBACK MACRO_Contents(void); -void CALLBACK MACRO_ControlPanel(LPCSTR, LPCSTR, LONG); -void CALLBACK MACRO_CopyDialog(void); -void CALLBACK MACRO_CopyTopic(void); -void CALLBACK MACRO_CreateButton(LPCSTR, LPCSTR, LPCSTR); -void CALLBACK MACRO_DeleteItem(LPCSTR); -void CALLBACK MACRO_DeleteMark(LPCSTR); -void CALLBACK MACRO_DestroyButton(LPCSTR); -void CALLBACK MACRO_DisableButton(LPCSTR); -void CALLBACK MACRO_DisableItem(LPCSTR); -void CALLBACK MACRO_EnableButton(LPCSTR); -void CALLBACK MACRO_EnableItem(LPCSTR); -void CALLBACK MACRO_EndMPrint(void); -void CALLBACK MACRO_ExecFile(LPCSTR, LPCSTR, LONG, LPCSTR); -void CALLBACK MACRO_ExecProgram(LPCSTR, LONG); -void CALLBACK MACRO_Exit(void); -void CALLBACK MACRO_ExtAbleItem(LPCSTR, LONG); -void CALLBACK MACRO_ExtInsertItem(LPCSTR, LPCSTR, LPCSTR, LPCSTR, LONG, LONG); -void CALLBACK MACRO_ExtInsertMenu(LPCSTR, LPCSTR, LPCSTR, LONG, LONG); -BOOL CALLBACK MACRO_FileExist(LPCSTR); -void CALLBACK MACRO_FileOpen(void); -void CALLBACK MACRO_Find(void); -void CALLBACK MACRO_Finder(void); -void CALLBACK MACRO_FloatingMenu(void); -void CALLBACK MACRO_Flush(void); -void CALLBACK MACRO_FocusWindow(LPCSTR); -void CALLBACK MACRO_Generate(LPCSTR, LONG, LONG); -void CALLBACK MACRO_GotoMark(LPCSTR); -void CALLBACK MACRO_HelpOn(void); -void CALLBACK MACRO_HelpOnTop(void); -void CALLBACK MACRO_History(void); -void CALLBACK MACRO_IfThen(BOOL, LPCSTR); -void CALLBACK MACRO_IfThenElse(BOOL, LPCSTR, LPCSTR); -BOOL CALLBACK MACRO_InitMPrint(void); -void CALLBACK MACRO_InsertItem(LPCSTR, LPCSTR, LPCSTR, LPCSTR, LONG); -void CALLBACK MACRO_InsertMenu(LPCSTR, LPCSTR, LONG); -BOOL CALLBACK MACRO_IsBook(void); -BOOL CALLBACK MACRO_IsMark(LPCSTR); -BOOL CALLBACK MACRO_IsNotMark(LPCSTR); -void CALLBACK MACRO_JumpContents(LPCSTR, LPCSTR); -void CALLBACK MACRO_JumpContext(LPCSTR, LPCSTR, LONG); -void CALLBACK MACRO_JumpHash(LPCSTR, LPCSTR, LONG); -void CALLBACK MACRO_JumpHelpOn(void); -void CALLBACK MACRO_JumpID(LPCSTR, LPCSTR); -void CALLBACK MACRO_JumpKeyword(LPCSTR, LPCSTR, LPCSTR); -void CALLBACK MACRO_KLink(LPCSTR, LONG, LPCSTR, LPCSTR); -void CALLBACK MACRO_Menu(void); -void CALLBACK MACRO_MPrintHash(LONG); -void CALLBACK MACRO_MPrintID(LPCSTR); -void CALLBACK MACRO_Next(void); -void CALLBACK MACRO_NoShow(void); -void CALLBACK MACRO_PopupContext(LPCSTR, LONG); -void CALLBACK MACRO_PopupHash(LPCSTR, LONG); -void CALLBACK MACRO_PopupId(LPCSTR, LPCSTR); -void CALLBACK MACRO_PositionWindow(LONG, LONG, LONG, LONG, LONG, LPCSTR); -void CALLBACK MACRO_Prev(void); -void CALLBACK MACRO_Print(void); -void CALLBACK MACRO_PrinterSetup(void); -void CALLBACK MACRO_RegisterRoutine(LPCSTR, LPCSTR, LPCSTR); -void CALLBACK MACRO_RemoveAccelerator(LONG, LONG); -void CALLBACK MACRO_ResetMenu(void); -void CALLBACK MACRO_SaveMark(LPCSTR); -void CALLBACK MACRO_Search(void); -void CALLBACK MACRO_SetContents(LPCSTR, LONG); -void CALLBACK MACRO_SetHelpOnFile(LPCSTR); -void CALLBACK MACRO_SetPopupColor(LONG, LONG, LONG); -void CALLBACK MACRO_ShellExecute(LPCSTR, LPCSTR, LONG, LONG, LPCSTR, LPCSTR); -void CALLBACK MACRO_ShortCut(LPCSTR, LPCSTR, LONG, LONG, LPCSTR); -void CALLBACK MACRO_TCard(LONG); -void CALLBACK MACRO_Test(LONG); -BOOL CALLBACK MACRO_TestALink(LPCSTR); -BOOL CALLBACK MACRO_TestKLink(LPCSTR); -void CALLBACK MACRO_UncheckItem(LPCSTR); -void CALLBACK MACRO_UpdateWindow(LPCSTR, LPCSTR); - -/* Local Variables: */ -/* c-file-style: "GNU" */ -/* End: */ +/* + * Help Viewer + * + * Copyright 1996 Ulrich Schmid + * Copyright 2002 Eric Pouech + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include + +#include "windef.h" +#include "winbase.h" + +struct lexret { + LPCSTR proto; + BOOL bool; + LONG integer; + LPCSTR string; + FARPROC function; +}; + +extern struct lexret yylval; + +BOOL MACRO_ExecuteMacro(LPCSTR); +int MACRO_Lookup(const char* name, struct lexret* lr); + +enum token_types {EMPTY, VOID_FUNCTION, BOOL_FUNCTION, INTEGER, STRING, IDENTIFIER}; +void CALLBACK MACRO_About(void); +void CALLBACK MACRO_Annotate(void); +void CALLBACK MACRO_BookmarkDefine(void); +void CALLBACK MACRO_CopyDialog(void); +void CALLBACK MACRO_CreateButton(LPCSTR, LPCSTR, LPCSTR); +void CALLBACK MACRO_DisableButton(LPCSTR); +void CALLBACK MACRO_Exit(void); +void CALLBACK MACRO_FileOpen(void); +void CALLBACK MACRO_HelpOn(void); +void CALLBACK MACRO_HelpOnTop(void); +void CALLBACK MACRO_History(void); +void CALLBACK MACRO_JumpContents(LPCSTR, LPCSTR); +void CALLBACK MACRO_JumpContext(LPCSTR, LPCSTR, LONG); +void CALLBACK MACRO_JumpHash(LPCSTR, LPCSTR, LONG); +void CALLBACK MACRO_PopupContext(LPCSTR, LONG); +void CALLBACK MACRO_Print(void); +void CALLBACK MACRO_PrinterSetup(void); +void CALLBACK MACRO_SetContents(LPCSTR, LONG); + +/* Local Variables: */ +/* c-file-style: "GNU" */ +/* End: */ diff --git a/programs/winhlp32/winhelp.c b/programs/winhlp32/winhelp.c index 34f93eedf49..15e17f66e71 100644 --- a/programs/winhlp32/winhelp.c +++ b/programs/winhlp32/winhelp.c @@ -46,24 +46,99 @@ WINE_DEFAULT_DEBUG_CHANNEL(winhelp); -static BOOL WINHELP_RegisterWinClasses(void); -static LRESULT CALLBACK WINHELP_MainWndProc(HWND, UINT, WPARAM, LPARAM); -static LRESULT CALLBACK WINHELP_ButtonBoxWndProc(HWND, UINT, WPARAM, LPARAM); -static LRESULT CALLBACK WINHELP_ButtonWndProc(HWND, UINT, WPARAM, LPARAM); -static LRESULT CALLBACK WINHELP_HistoryWndProc(HWND, UINT, WPARAM, LPARAM); -static LRESULT CALLBACK WINHELP_ShadowWndProc(HWND, UINT, WPARAM, LPARAM); -static BOOL WINHELP_CheckPopup(HWND, UINT, WPARAM, LPARAM, LRESULT*); -static void WINHELP_InitFonts(HWND hWnd); -static void WINHELP_DeleteWindow(WINHELP_WINDOW*); -static void WINHELP_DeleteButtons(WINHELP_WINDOW*); -static void WINHELP_SetupText(HWND hWnd, WINHELP_WINDOW *win, ULONG relative); -static void WINHELP_DeletePageLinks(HLPFILE_PAGE* page); - WINHELP_GLOBALS Globals = {3, NULL, TRUE, NULL, NULL, NULL, NULL, NULL, {{{NULL,NULL}},0}, NULL}; #define CTL_ID_BUTTON 0x700 #define CTL_ID_TEXT 0x701 + +/*********************************************************************** + * + * WINHELP_InitFonts + */ +static void WINHELP_InitFonts(HWND hWnd) +{ + WINHELP_WINDOW *win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); + LOGFONT logfontlist[] = { + {-10, 0, 0, 0, 400, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}, + {-12, 0, 0, 0, 700, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}, + {-12, 0, 0, 0, 700, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}, + {-12, 0, 0, 0, 400, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}, + {-12, 0, 0, 0, 700, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}, + {-10, 0, 0, 0, 700, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}, + { -8, 0, 0, 0, 400, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}}; +#define FONTS_LEN (sizeof(logfontlist)/sizeof(*logfontlist)) + + static HFONT fonts[FONTS_LEN]; + static BOOL init = 0; + + win->fonts_len = FONTS_LEN; + win->fonts = fonts; + + if (!init) + { + UINT i; + + for (i = 0; i < FONTS_LEN; i++) + { + fonts[i] = CreateFontIndirect(&logfontlist[i]); + } + + init = 1; + } +} + +static DWORD CALLBACK WINHELP_RtfStreamIn(DWORD_PTR cookie, BYTE* buff, + LONG cb, LONG* pcb) +{ + struct RtfData* rd = (struct RtfData*)cookie; + + if (rd->where >= rd->ptr) return 1; + if (rd->where + cb > rd->ptr) + cb = rd->ptr - rd->where; + memcpy(buff, rd->where, cb); + rd->where += cb; + *pcb = cb; + return 0; +} + +static void WINHELP_SetupText(HWND hTextWnd, WINHELP_WINDOW* win, ULONG relative) +{ + /* At first clear area - needed by EM_POSFROMCHAR/EM_SETSCROLLPOS */ + SendMessage(hTextWnd, WM_SETTEXT, 0, (LPARAM)""); + SendMessage(hTextWnd, WM_SETREDRAW, FALSE, 0); + SendMessage(hTextWnd, EM_SETBKGNDCOLOR, 0, (LPARAM)win->info->sr_color); + /* set word-wrap to window size (undocumented) */ + SendMessage(hTextWnd, EM_SETTARGETDEVICE, 0, 0); + if (win->page) + { + struct RtfData rd; + EDITSTREAM es; + unsigned cp = 0; + POINTL ptl; + POINT pt; + + + if (HLPFILE_BrowsePage(win->page, &rd, win->font_scale, relative)) + { + rd.where = rd.data; + es.dwCookie = (DWORD_PTR)&rd; + es.dwError = 0; + es.pfnCallback = WINHELP_RtfStreamIn; + + SendMessageW(hTextWnd, EM_STREAMIN, SF_RTF, (LPARAM)&es); + cp = rd.char_pos_rel; + } + /* FIXME: else leaking potentially the rd.first_link chain */ + HeapFree(GetProcessHeap(), 0, rd.data); + SendMessage(hTextWnd, EM_POSFROMCHAR, (WPARAM)&ptl, cp ? cp - 1 : 0); + pt.x = 0; pt.y = ptl.y; + SendMessage(hTextWnd, EM_SETSCROLLPOS, 0, (LPARAM)&pt); + } + SendMessage(hTextWnd, WM_SETREDRAW, TRUE, 0); + InvalidateRect(hTextWnd, NULL, TRUE); +} + /*********************************************************************** * * WINHELP_GetOpenFileName @@ -115,10 +190,19 @@ BOOL WINHELP_GetOpenFileName(LPSTR lpszFile, int len) return GetOpenFileName(&openfilename); } -static char* WINHELP_GetCaption(WINHELP_WNDPAGE* wpage) +/*********************************************************************** + * + * WINHELP_MessageBoxIDS_s + */ +static INT WINHELP_MessageBoxIDS_s(UINT ids_text, LPCSTR str, UINT ids_title, WORD type) { - if (wpage->wininfo->caption[0]) return wpage->wininfo->caption; - return wpage->page->file->lpszTitle; + CHAR text[MAX_STRING_LEN]; + CHAR newtext[MAX_STRING_LEN + MAX_PATH]; + + LoadString(Globals.hInstance, ids_text, text, sizeof(text)); + wsprintf(newtext, text, str); + + return MessageBox(0, newtext, MAKEINTRESOURCE(ids_title), type); } /*********************************************************************** @@ -238,142 +322,6 @@ static HLPFILE_WINDOWINFO* WINHELP_GetPopupWindowInfo(HLPFILE* hlpfile, return &wi; } -/*********************************************************************** - * - * WinMain - */ -int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show) -{ - MSG msg; - LONG lHash = 0; - HLPFILE* hlpfile; - static CHAR default_wndname[] = "main"; - LPSTR wndname = default_wndname; - WINHELP_DLL* dll; - - Globals.hInstance = hInstance; - - if (LoadLibrary("riched20.dll") == NULL) - return MessageBox(0, MAKEINTRESOURCE(STID_NO_RICHEDIT), - MAKEINTRESOURCE(STID_WHERROR), MB_OK); - - /* Get options */ - while (*cmdline && (*cmdline == ' ' || *cmdline == '-')) - { - CHAR option; - LPCSTR topic_id; - if (*cmdline++ == ' ') continue; - - option = *cmdline; - if (option) cmdline++; - while (*cmdline && *cmdline == ' ') cmdline++; - switch (option) - { - case 'i': - case 'I': - topic_id = cmdline; - while (*cmdline && *cmdline != ' ') cmdline++; - if (*cmdline) *cmdline++ = '\0'; - lHash = HLPFILE_Hash(topic_id); - break; - - case '3': - case '4': - Globals.wVersion = option - '0'; - break; - - case 'x': - show = SW_HIDE; - Globals.isBook = FALSE; - break; - - default: - WINE_FIXME("Unsupported cmd line: %s\n", cmdline); - break; - } - } - - /* Create primary window */ - if (!WINHELP_RegisterWinClasses()) - { - WINE_FIXME("Couldn't register classes\n"); - return 0; - } - - if (*cmdline) - { - char* ptr; - if ((*cmdline == '"') && (ptr = strchr(cmdline+1, '"'))) - { - cmdline++; - *ptr = '\0'; - } - if ((ptr = strchr(cmdline, '>'))) - { - *ptr = '\0'; - wndname = ptr + 1; - } - hlpfile = WINHELP_LookupHelpFile(cmdline); - if (!hlpfile) return 0; - } - else hlpfile = NULL; - WINHELP_OpenHelpWindow(HLPFILE_PageByHash, hlpfile, lHash, - WINHELP_GetWindowInfo(hlpfile, wndname), show); - - /* Message loop */ - while (GetMessage(&msg, 0, 0, 0)) - { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - for (dll = Globals.dlls; dll; dll = dll->next) - { - if (dll->class & DC_INITTERM) dll->handler(DW_TERM, 0, 0); - } - return 0; -} - -/*********************************************************************** - * - * RegisterWinClasses - */ -static BOOL WINHELP_RegisterWinClasses(void) -{ - WNDCLASS class_main, class_button_box, class_shadow, class_history; - - class_main.style = CS_HREDRAW | CS_VREDRAW; - class_main.lpfnWndProc = WINHELP_MainWndProc; - class_main.cbClsExtra = 0; - class_main.cbWndExtra = sizeof(LONG); - class_main.hInstance = Globals.hInstance; - class_main.hIcon = LoadIcon(Globals.hInstance, MAKEINTRESOURCE(IDI_WINHELP)); - class_main.hCursor = LoadCursor(0, IDC_ARROW); - class_main.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); - class_main.lpszMenuName = 0; - class_main.lpszClassName = MAIN_WIN_CLASS_NAME; - - class_button_box = class_main; - class_button_box.lpfnWndProc = WINHELP_ButtonBoxWndProc; - class_button_box.cbWndExtra = 0; - class_button_box.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1); - class_button_box.lpszClassName = BUTTON_BOX_WIN_CLASS_NAME; - - class_shadow = class_main; - class_shadow.lpfnWndProc = WINHELP_ShadowWndProc; - class_shadow.cbWndExtra = 0; - class_shadow.hbrBackground = (HBRUSH)(COLOR_3DDKSHADOW+1); - class_shadow.lpszClassName = SHADOW_WIN_CLASS_NAME; - - class_history = class_main; - class_history.lpfnWndProc = WINHELP_HistoryWndProc; - class_history.lpszClassName = HISTORY_WIN_CLASS_NAME; - - return (RegisterClass(&class_main) && - RegisterClass(&class_button_box) && - RegisterClass(&class_shadow) && - RegisterClass(&class_history)); -} - typedef struct { WORD size; @@ -502,21 +450,118 @@ void WINHELP_LayoutMainWindow(WINHELP_WINDOW* win) } -static void WINHELP_RememberPage(WINHELP_WINDOW* win, WINHELP_WNDPAGE* wpage) +/****************************************************************** + * WINHELP_DeleteButtons + * + */ +static void WINHELP_DeleteButtons(WINHELP_WINDOW* win) { - unsigned num; + WINHELP_BUTTON* b; + WINHELP_BUTTON* bp; - if (!Globals.history.index || Globals.history.set[0].page != wpage->page) + for (b = win->first_button; b; b = bp) { - num = sizeof(Globals.history.set) / sizeof(Globals.history.set[0]); - /* we're full, remove latest entry */ - if (Globals.history.index == num) - { - HLPFILE_FreeHlpFile(Globals.history.set[num - 1].page->file); - Globals.history.index--; - } - memmove(&Globals.history.set[1], &Globals.history.set[0], - Globals.history.index * sizeof(Globals.history.set[0])); + DestroyWindow(b->hWnd); + bp = b->next; + HeapFree(GetProcessHeap(), 0, b); + } + win->first_button = NULL; +} + +/****************************************************************** + * WINHELP_DeleteBackSet + * + */ +void WINHELP_DeleteBackSet(WINHELP_WINDOW* win) +{ + unsigned int i; + + for (i = 0; i < win->back.index; i++) + { + HLPFILE_FreeHlpFile(win->back.set[i].page->file); + win->back.set[i].page = NULL; + } + win->back.index = 0; +} + +/****************************************************************** + * WINHELP_DeletePageLinks + * + */ +static void WINHELP_DeletePageLinks(HLPFILE_PAGE* page) +{ + HLPFILE_LINK* curr; + HLPFILE_LINK* next; + + for (curr = page->first_link; curr; curr = next) + { + next = curr->next; + HeapFree(GetProcessHeap(), 0, curr); + } +} + +/*********************************************************************** + * + * WINHELP_DeleteWindow + */ +static void WINHELP_DeleteWindow(WINHELP_WINDOW* win) +{ + WINHELP_WINDOW** w; + + for (w = &Globals.win_list; *w; w = &(*w)->next) + { + if (*w == win) + { + *w = win->next; + break; + } + } + + if (Globals.active_win == win) + { + Globals.active_win = Globals.win_list; + if (Globals.win_list) + SetActiveWindow(Globals.win_list->hMainWnd); + } + + if (win == Globals.active_popup) + Globals.active_popup = NULL; + + WINHELP_DeleteButtons(win); + + if (win->page) WINHELP_DeletePageLinks(win->page); + if (win->hShadowWnd) DestroyWindow(win->hShadowWnd); + if (win->hHistoryWnd) DestroyWindow(win->hHistoryWnd); + + DeleteObject(win->hBrush); + + WINHELP_DeleteBackSet(win); + + if (win->page) HLPFILE_FreeHlpFile(win->page->file); + HeapFree(GetProcessHeap(), 0, win); +} + +static char* WINHELP_GetCaption(WINHELP_WNDPAGE* wpage) +{ + if (wpage->wininfo->caption[0]) return wpage->wininfo->caption; + return wpage->page->file->lpszTitle; +} + +static void WINHELP_RememberPage(WINHELP_WINDOW* win, WINHELP_WNDPAGE* wpage) +{ + unsigned num; + + if (!Globals.history.index || Globals.history.set[0].page != wpage->page) + { + num = sizeof(Globals.history.set) / sizeof(Globals.history.set[0]); + /* we're full, remove latest entry */ + if (Globals.history.index == num) + { + HLPFILE_FreeHlpFile(Globals.history.set[num - 1].page->file); + Globals.history.index--; + } + memmove(&Globals.history.set[1], &Globals.history.set[0], + Globals.history.index * sizeof(Globals.history.set[0])); Globals.history.set[0] = *wpage; Globals.history.index++; wpage->page->file->wRefCount++; @@ -828,313 +873,73 @@ static BOOL WINHELP_HandleTextMouse(WINHELP_WINDOW* win, UINT msg, LPARAM lParam /*********************************************************************** * - * WINHELP_MainWndProc + * WINHELP_CheckPopup */ -static LRESULT CALLBACK WINHELP_MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +static BOOL WINHELP_CheckPopup(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, LRESULT* lret) { - WINHELP_WINDOW *win; - WINHELP_BUTTON *button; - RECT rect; - INT curPos, min, max, dy, keyDelta; - HWND hTextWnd; - LRESULT ret; + HWND hPopup; - if (WINHELP_CheckPopup(hWnd, msg, wParam, lParam, &ret)) return ret; + if (!Globals.active_popup) return FALSE; switch (msg) { - case WM_NCCREATE: - win = (WINHELP_WINDOW*) ((LPCREATESTRUCT) lParam)->lpCreateParams; - SetWindowLongPtr(hWnd, 0, (ULONG_PTR) win); - if (!win->page && Globals.isBook) - PostMessage(hWnd, WM_COMMAND, MNID_FILE_OPEN, 0); - win->hMainWnd = hWnd; - break; - - case WM_WINDOWPOSCHANGED: - WINHELP_LayoutMainWindow((WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0)); - break; - - case WM_COMMAND: - win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); - switch (wParam) - { - /* Menu FILE */ - case MNID_FILE_OPEN: MACRO_FileOpen(); break; - case MNID_FILE_PRINT: MACRO_Print(); break; - case MNID_FILE_SETUP: MACRO_PrinterSetup(); break; - case MNID_FILE_EXIT: MACRO_Exit(); break; - - /* Menu EDIT */ - case MNID_EDIT_COPYDLG: - SendMessage(GetDlgItem(hWnd, CTL_ID_TEXT), WM_COPY, 0, 0); - break; - case MNID_EDIT_ANNOTATE:MACRO_Annotate(); break; - - /* Menu Bookmark */ - case MNID_BKMK_DEFINE: MACRO_BookmarkDefine(); break; - - /* Menu Help */ - case MNID_HELP_HELPON: MACRO_HelpOn(); break; - case MNID_HELP_HELPTOP: MACRO_HelpOnTop(); break; - case MNID_HELP_ABOUT: MACRO_About(); break; - case MNID_HELP_WINE: ShellAbout(hWnd, "WINE", "Help", 0); break; - - /* Context help */ - case MNID_CTXT_ANNOTATE:MACRO_Annotate(); break; - case MNID_CTXT_COPY: MACRO_CopyDialog(); break; - case MNID_CTXT_PRINT: MACRO_Print(); break; - case MNID_OPTS_HISTORY: MACRO_History(); break; - case MNID_OPTS_FONTS_SMALL: - case MNID_CTXT_FONTS_SMALL: - win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); - if (win->font_scale != 0) - { - win->font_scale = 0; - WINHELP_SetupText(GetDlgItem(hWnd, CTL_ID_TEXT), win, 0 /* FIXME */); - } - break; - case MNID_OPTS_FONTS_NORMAL: - case MNID_CTXT_FONTS_NORMAL: - win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); - if (win->font_scale != 1) - { - win->font_scale = 1; - WINHELP_SetupText(GetDlgItem(hWnd, CTL_ID_TEXT), win, 0 /* FIXME */); - } - break; - case MNID_OPTS_FONTS_LARGE: - case MNID_CTXT_FONTS_LARGE: - win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); - if (win->font_scale != 2) + case WM_NOTIFY: + { + MSGFILTER* msgf = (MSGFILTER*)lParam; + if (msgf->nmhdr.code == EN_MSGFILTER) { - win->font_scale = 2; - WINHELP_SetupText(GetDlgItem(hWnd, CTL_ID_TEXT), win, 0 /* FIXME */); + if (!WINHELP_CheckPopup(hWnd, msgf->msg, msgf->wParam, msgf->lParam, NULL)) + return FALSE; + if (lret) *lret = 1; + return TRUE; } - break; - case MNID_OPTS_HELP_DEFAULT: - case MNID_OPTS_HELP_VISIBLE: - case MNID_OPTS_HELP_NONVISIBLE: - case MNID_OPTS_SYSTEM_COLORS: - case MNID_CTXT_HELP_DEFAULT: - case MNID_CTXT_HELP_VISIBLE: - case MNID_CTXT_HELP_NONVISIBLE: - case MNID_CTXT_SYSTEM_COLORS: - /* FIXME: NIY */ - - default: - /* Buttons */ - for (button = win->first_button; button; button = button->next) - if (wParam == button->wParam) break; - if (button) - MACRO_ExecuteMacro(button->lpszMacro); - else if (!HIWORD(wParam)) - MessageBox(0, MAKEINTRESOURCE(STID_NOT_IMPLEMENTED), - MAKEINTRESOURCE(STID_WHERROR), MB_OK); - break; - } - break; -/* EPP case WM_DESTROY: */ -/* EPP if (Globals.hPopupWnd) DestroyWindow(Globals.hPopupWnd); */ -/* EPP break; */ - case WM_COPYDATA: - return WINHELP_HandleCommand((HWND)wParam, lParam); - - case WM_CHAR: - if (wParam == 3) - { - SendMessage(GetDlgItem(hWnd, CTL_ID_TEXT), WM_COPY, 0, 0); - return 0; } break; + case WM_ACTIVATE: + if (wParam != WA_INACTIVE || (HWND)lParam == Globals.active_win->hMainWnd || + (HWND)lParam == Globals.active_popup->hMainWnd || + GetWindow((HWND)lParam, GW_OWNER) == Globals.active_win->hMainWnd) + break; + case WM_LBUTTONUP: + case WM_LBUTTONDOWN: + if (WINHELP_HandleTextMouse(Globals.active_popup, msg, lParam) && msg == WM_LBUTTONDOWN) + return FALSE; + /* fall through */ + case WM_MBUTTONDOWN: + case WM_RBUTTONDOWN: + case WM_NCLBUTTONDOWN: + case WM_NCMBUTTONDOWN: + case WM_NCRBUTTONDOWN: + hPopup = Globals.active_popup->hMainWnd; + Globals.active_popup = NULL; + DestroyWindow(hPopup); + return TRUE; + } + return FALSE; +} - case WM_KEYDOWN: - keyDelta = 0; +/*********************************************************************** + * + * WINHELP_ButtonWndProc + */ +static LRESULT CALLBACK WINHELP_ButtonWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + if (WINHELP_CheckPopup(hWnd, msg, wParam, lParam, NULL)) return 0; + if (msg == WM_KEYDOWN) + { switch (wParam) { case VK_UP: case VK_DOWN: - keyDelta = GetSystemMetrics(SM_CXVSCROLL); - if (wParam == VK_UP) - keyDelta = -keyDelta; - case VK_PRIOR: case VK_NEXT: - win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); - hTextWnd = GetDlgItem(win->hMainWnd, CTL_ID_TEXT); - curPos = GetScrollPos(hTextWnd, SB_VERT); - GetScrollRange(hTextWnd, SB_VERT, &min, &max); - - if (keyDelta == 0) - { - GetClientRect(hTextWnd, &rect); - keyDelta = (rect.bottom - rect.top) / 2; - if (wParam == VK_PRIOR) - keyDelta = -keyDelta; - } - - curPos += keyDelta; - if (curPos > max) - curPos = max; - else if (curPos < min) - curPos = min; - - dy = GetScrollPos(hTextWnd, SB_VERT) - curPos; - SetScrollPos(hTextWnd, SB_VERT, curPos, TRUE); - ScrollWindow(hTextWnd, 0, dy, NULL, NULL); - UpdateWindow(hTextWnd); - return 0; - case VK_ESCAPE: - MACRO_Exit(); - return 0; - } - break; - - case WM_NOTIFY: - if (wParam == CTL_ID_TEXT) - { - RECT rc; - - switch (((NMHDR*)lParam)->code) - { - case EN_MSGFILTER: - { - const MSGFILTER* msgf = (const MSGFILTER*)lParam; - switch (msgf->msg) - { - case WM_KEYUP: - if (msgf->wParam == VK_ESCAPE) DestroyWindow(hWnd); - break; - case WM_RBUTTONDOWN: - { - HMENU hMenu; - POINT pt; - - win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); - hMenu = LoadMenu(Globals.hInstance, (LPSTR)CONTEXT_MENU); - switch (win->font_scale) - { - case 0: - CheckMenuItem(hMenu, MNID_CTXT_FONTS_SMALL, - MF_BYCOMMAND|MF_CHECKED); - break; - default: - WINE_FIXME("Unsupported %d\n", win->font_scale); - case 1: - CheckMenuItem(hMenu, MNID_CTXT_FONTS_NORMAL, - MF_BYCOMMAND|MF_CHECKED); - break; - case 2: - CheckMenuItem(hMenu, MNID_CTXT_FONTS_LARGE, - MF_BYCOMMAND|MF_CHECKED); - break; - } - pt.x = (int)(short)LOWORD(msgf->lParam); - pt.y = (int)(short)HIWORD(msgf->lParam); - ClientToScreen(msgf->nmhdr.hwndFrom, &pt); - TrackPopupMenu(GetSubMenu(hMenu, 0), TPM_LEFTALIGN|TPM_TOPALIGN, - pt.x, pt.y, 0, hWnd, NULL); - DestroyMenu(hMenu); - } - break; - default: - return WINHELP_HandleTextMouse((WINHELP_WINDOW*)GetWindowLongPtr(hWnd, 0), - msgf->msg, msgf->lParam); - } - } - break; - - case EN_REQUESTRESIZE: - rc = ((REQRESIZE*)lParam)->rc; - win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); - AdjustWindowRect(&rc, GetWindowLong(win->hMainWnd, GWL_STYLE), - FALSE); - SetWindowPos(win->hMainWnd, HWND_TOP, 0, 0, - rc.right - rc.left, rc.bottom - rc.top, - SWP_NOMOVE | SWP_NOZORDER); - WINHELP_LayoutMainWindow(win); - break; - } - } - break; - - case WM_INITMENUPOPUP: - win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); - CheckMenuItem((HMENU)wParam, MNID_OPTS_FONTS_SMALL, - MF_BYCOMMAND | (win->font_scale == 0) ? MF_CHECKED : 0); - CheckMenuItem((HMENU)wParam, MNID_OPTS_FONTS_NORMAL, - MF_BYCOMMAND | (win->font_scale == 1) ? MF_CHECKED : 0); - CheckMenuItem((HMENU)wParam, MNID_OPTS_FONTS_LARGE, - MF_BYCOMMAND | (win->font_scale == 2) ? MF_CHECKED : 0); - break; - - case WM_NCDESTROY: - { - BOOL bExit; - win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); - bExit = (Globals.wVersion >= 4 && !lstrcmpi(win->lpszName, "main")); - WINHELP_DeleteWindow(win); - - if (bExit) MACRO_Exit(); - if (!Globals.win_list) - PostQuitMessage(0); + return SendMessage(GetParent(hWnd), msg, wParam, lParam); } - break; } - return DefWindowProc(hWnd, msg, wParam, lParam); -} - -static DWORD CALLBACK WINHELP_RtfStreamIn(DWORD_PTR cookie, BYTE* buff, - LONG cb, LONG* pcb) -{ - struct RtfData* rd = (struct RtfData*)cookie; - - if (rd->where >= rd->ptr) return 1; - if (rd->where + cb > rd->ptr) - cb = rd->ptr - rd->where; - memcpy(buff, rd->where, cb); - rd->where += cb; - *pcb = cb; - return 0; -} - -static void WINHELP_SetupText(HWND hTextWnd, WINHELP_WINDOW* win, ULONG relative) -{ - /* At first clear area - needed by EM_POSFROMCHAR/EM_SETSCROLLPOS */ - SendMessage(hTextWnd, WM_SETTEXT, 0, (LPARAM)""); - SendMessage(hTextWnd, WM_SETREDRAW, FALSE, 0); - SendMessage(hTextWnd, EM_SETBKGNDCOLOR, 0, (LPARAM)win->info->sr_color); - /* set word-wrap to window size (undocumented) */ - SendMessage(hTextWnd, EM_SETTARGETDEVICE, 0, 0); - if (win->page) - { - struct RtfData rd; - EDITSTREAM es; - unsigned cp = 0; - POINTL ptl; - POINT pt; - - - if (HLPFILE_BrowsePage(win->page, &rd, win->font_scale, relative)) - { - rd.where = rd.data; - es.dwCookie = (DWORD_PTR)&rd; - es.dwError = 0; - es.pfnCallback = WINHELP_RtfStreamIn; - SendMessageW(hTextWnd, EM_STREAMIN, SF_RTF, (LPARAM)&es); - cp = rd.char_pos_rel; - } - /* FIXME: else leaking potentially the rd.first_link chain */ - HeapFree(GetProcessHeap(), 0, rd.data); - SendMessage(hTextWnd, EM_POSFROMCHAR, (WPARAM)&ptl, cp ? cp - 1 : 0); - pt.x = 0; pt.y = ptl.y; - SendMessage(hTextWnd, EM_SETSCROLLPOS, 0, (LPARAM)&pt); - } - SendMessage(hTextWnd, WM_SETREDRAW, TRUE, 0); - InvalidateRect(hTextWnd, NULL, TRUE); + return CallWindowProc(Globals.button_proc, hWnd, msg, wParam, lParam); } /*********************************************************************** @@ -1231,30 +1036,6 @@ static LRESULT CALLBACK WINHELP_ButtonBoxWndProc(HWND hWnd, UINT msg, WPARAM wPa return DefWindowProc(hWnd, msg, wParam, lParam); } -/*********************************************************************** - * - * WINHELP_ButtonWndProc - */ -static LRESULT CALLBACK WINHELP_ButtonWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - if (WINHELP_CheckPopup(hWnd, msg, wParam, lParam, NULL)) return 0; - - if (msg == WM_KEYDOWN) - { - switch (wParam) - { - case VK_UP: - case VK_DOWN: - case VK_PRIOR: - case VK_NEXT: - case VK_ESCAPE: - return SendMessage(GetParent(hWnd), msg, wParam, lParam); - } - } - - return CallWindowProc(Globals.button_proc, hWnd, msg, wParam, lParam); -} - /****************************************************************** * WINHELP_HistoryWndProc * @@ -1354,315 +1135,386 @@ static LRESULT CALLBACK WINHELP_ShadowWndProc(HWND hWnd, UINT msg, WPARAM wParam return WINHELP_CheckPopup(hWnd, msg, wParam, lParam, NULL) ? 0L : DefWindowProc(hWnd, msg, wParam, lParam); } -/*********************************************************************** +/************************************************************************** + * cb_KWBTree + * + * HLPFILE_BPTreeCallback enumeration function for '|KWBTREE' internal file. * - * WINHELP_CheckPopup */ -static BOOL WINHELP_CheckPopup(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, LRESULT* lret) +static void cb_KWBTree(void *p, void **next, void *cookie) { - HWND hPopup; + HWND hListWnd = (HWND)cookie; + int count; - if (!Globals.active_popup) return FALSE; + WINE_TRACE("Adding '%s' to search list\n", (char *)p); + SendMessage(hListWnd, LB_INSERTSTRING, -1, (LPARAM)p); + count = SendMessage(hListWnd, LB_GETCOUNT, 0, 0); + SendMessage(hListWnd, LB_SETITEMDATA, count-1, (LPARAM)p); + *next = (char*)p + strlen((char*)p) + 7; +} + +struct index_data +{ + HLPFILE* hlpfile; + BOOL jump; + ULONG offset; +}; + +/************************************************************************** + * WINHELP_IndexDlgProc + * + */ +static INT_PTR CALLBACK WINHELP_IndexDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + static struct index_data* id; + int sel; switch (msg) { - case WM_NOTIFY: + case WM_INITDIALOG: + id = (struct index_data*)((PROPSHEETPAGE*)lParam)->lParam; + HLPFILE_BPTreeEnum(id->hlpfile->kwbtree, cb_KWBTree, + GetDlgItem(hWnd, IDC_INDEXLIST)); + id->jump = FALSE; + id->offset = 1; + return TRUE; + case WM_COMMAND: + switch (HIWORD(wParam)) { - MSGFILTER* msgf = (MSGFILTER*)lParam; - if (msgf->nmhdr.code == EN_MSGFILTER) - { - if (!WINHELP_CheckPopup(hWnd, msgf->msg, msgf->wParam, msgf->lParam, NULL)) - return FALSE; - if (lret) *lret = 1; - return TRUE; - } + case LBN_DBLCLK: + if (LOWORD(wParam) == IDC_INDEXLIST) + SendMessage(GetParent(hWnd), PSM_PRESSBUTTON, PSBTN_OK, 0); + break; } break; - case WM_ACTIVATE: - if (wParam != WA_INACTIVE || (HWND)lParam == Globals.active_win->hMainWnd || - (HWND)lParam == Globals.active_popup->hMainWnd || - GetWindow((HWND)lParam, GW_OWNER) == Globals.active_win->hMainWnd) - break; - case WM_LBUTTONUP: - case WM_LBUTTONDOWN: - if (WINHELP_HandleTextMouse(Globals.active_popup, msg, lParam) && msg == WM_LBUTTONDOWN) - return FALSE; - /* fall through */ - case WM_MBUTTONDOWN: - case WM_RBUTTONDOWN: - case WM_NCLBUTTONDOWN: - case WM_NCMBUTTONDOWN: - case WM_NCRBUTTONDOWN: - hPopup = Globals.active_popup->hMainWnd; - Globals.active_popup = NULL; - DestroyWindow(hPopup); - return TRUE; - } - return FALSE; -} - -/****************************************************************** - * WINHELP_DeleteButtons - * - */ -static void WINHELP_DeleteButtons(WINHELP_WINDOW* win) -{ - WINHELP_BUTTON* b; - WINHELP_BUTTON* bp; - - for (b = win->first_button; b; b = bp) - { - DestroyWindow(b->hWnd); - bp = b->next; - HeapFree(GetProcessHeap(), 0, b); - } - win->first_button = NULL; -} - -/****************************************************************** - * WINHELP_DeleteBackSet - * - */ -void WINHELP_DeleteBackSet(WINHELP_WINDOW* win) -{ - unsigned int i; + case WM_NOTIFY: + switch (((NMHDR*)lParam)->code) + { + case PSN_APPLY: + sel = SendDlgItemMessage(hWnd, IDC_INDEXLIST, LB_GETCURSEL, 0, 0); + if (sel != LB_ERR) + { + BYTE *p; + int count; - for (i = 0; i < win->back.index; i++) - { - HLPFILE_FreeHlpFile(win->back.set[i].page->file); - win->back.set[i].page = NULL; + p = (BYTE*)SendDlgItemMessage(hWnd, IDC_INDEXLIST, + LB_GETITEMDATA, sel, 0); + count = *(short*)((char *)p + strlen((char *)p) + 1); + if (count > 1) + { + MessageBox(hWnd, "count > 1 not supported yet", "Error", MB_OK | MB_ICONSTOP); + SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_INVALID); + return TRUE; + } + id->offset = *(ULONG*)((char *)p + strlen((char *)p) + 3); + id->offset = *(long*)(id->hlpfile->kwdata + id->offset + 9); + if (id->offset == 0xFFFFFFFF) + { + MessageBox(hWnd, "macro keywords not supported yet", "Error", MB_OK | MB_ICONSTOP); + SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_INVALID); + return TRUE; + } + id->jump = TRUE; + SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_NOERROR); + } + return TRUE; + default: + return FALSE; + } + break; + default: + break; } - win->back.index = 0; + return FALSE; } -/****************************************************************** - * WINHELP_DeletePageLinks +/************************************************************************** + * WINHELP_SearchDlgProc * */ -static void WINHELP_DeletePageLinks(HLPFILE_PAGE* page) +static INT_PTR CALLBACK WINHELP_SearchDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { - HLPFILE_LINK* curr; - HLPFILE_LINK* next; + static struct index_data* id; - for (curr = page->first_link; curr; curr = next) + switch (msg) { - next = curr->next; - HeapFree(GetProcessHeap(), 0, curr); + case WM_INITDIALOG: + id = (struct index_data*)((PROPSHEETPAGE*)lParam)->lParam; + return TRUE; + case WM_NOTIFY: + switch (((NMHDR*)lParam)->code) + { + case PSN_APPLY: + SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_NOERROR); + return TRUE; + default: + return FALSE; + } + break; + default: + break; } + return FALSE; } /*********************************************************************** * - * WINHELP_DeleteWindow + * WINHELP_MainWndProc */ -static void WINHELP_DeleteWindow(WINHELP_WINDOW* win) +static LRESULT CALLBACK WINHELP_MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { - WINHELP_WINDOW** w; + WINHELP_WINDOW *win; + WINHELP_BUTTON *button; + RECT rect; + INT curPos, min, max, dy, keyDelta; + HWND hTextWnd; + LRESULT ret; - for (w = &Globals.win_list; *w; w = &(*w)->next) - { - if (*w == win) - { - *w = win->next; - break; - } - } + if (WINHELP_CheckPopup(hWnd, msg, wParam, lParam, &ret)) return ret; - if (Globals.active_win == win) + switch (msg) { - Globals.active_win = Globals.win_list; - if (Globals.win_list) - SetActiveWindow(Globals.win_list->hMainWnd); - } - - if (win == Globals.active_popup) - Globals.active_popup = NULL; - - WINHELP_DeleteButtons(win); - - if (win->page) WINHELP_DeletePageLinks(win->page); - if (win->hShadowWnd) DestroyWindow(win->hShadowWnd); - if (win->hHistoryWnd) DestroyWindow(win->hHistoryWnd); - - DeleteObject(win->hBrush); + case WM_NCCREATE: + win = (WINHELP_WINDOW*) ((LPCREATESTRUCT) lParam)->lpCreateParams; + SetWindowLongPtr(hWnd, 0, (ULONG_PTR) win); + if (!win->page && Globals.isBook) + PostMessage(hWnd, WM_COMMAND, MNID_FILE_OPEN, 0); + win->hMainWnd = hWnd; + break; - WINHELP_DeleteBackSet(win); + case WM_WINDOWPOSCHANGED: + WINHELP_LayoutMainWindow((WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0)); + break; - if (win->page) HLPFILE_FreeHlpFile(win->page->file); - HeapFree(GetProcessHeap(), 0, win); -} + case WM_COMMAND: + win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); + switch (wParam) + { + /* Menu FILE */ + case MNID_FILE_OPEN: MACRO_FileOpen(); break; + case MNID_FILE_PRINT: MACRO_Print(); break; + case MNID_FILE_SETUP: MACRO_PrinterSetup(); break; + case MNID_FILE_EXIT: MACRO_Exit(); break; -/*********************************************************************** - * - * WINHELP_InitFonts - */ -static void WINHELP_InitFonts(HWND hWnd) -{ - WINHELP_WINDOW *win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); - LOGFONT logfontlist[] = { - {-10, 0, 0, 0, 400, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}, - {-12, 0, 0, 0, 700, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}, - {-12, 0, 0, 0, 700, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}, - {-12, 0, 0, 0, 400, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}, - {-12, 0, 0, 0, 700, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}, - {-10, 0, 0, 0, 700, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}, - { -8, 0, 0, 0, 400, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}}; -#define FONTS_LEN (sizeof(logfontlist)/sizeof(*logfontlist)) + /* Menu EDIT */ + case MNID_EDIT_COPYDLG: + SendMessage(GetDlgItem(hWnd, CTL_ID_TEXT), WM_COPY, 0, 0); + break; + case MNID_EDIT_ANNOTATE:MACRO_Annotate(); break; - static HFONT fonts[FONTS_LEN]; - static BOOL init = 0; + /* Menu Bookmark */ + case MNID_BKMK_DEFINE: MACRO_BookmarkDefine(); break; - win->fonts_len = FONTS_LEN; - win->fonts = fonts; + /* Menu Help */ + case MNID_HELP_HELPON: MACRO_HelpOn(); break; + case MNID_HELP_HELPTOP: MACRO_HelpOnTop(); break; + case MNID_HELP_ABOUT: MACRO_About(); break; + case MNID_HELP_WINE: ShellAbout(hWnd, "WINE", "Help", 0); break; - if (!init) - { - UINT i; + /* Context help */ + case MNID_CTXT_ANNOTATE:MACRO_Annotate(); break; + case MNID_CTXT_COPY: MACRO_CopyDialog(); break; + case MNID_CTXT_PRINT: MACRO_Print(); break; + case MNID_OPTS_HISTORY: MACRO_History(); break; + case MNID_OPTS_FONTS_SMALL: + case MNID_CTXT_FONTS_SMALL: + win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); + if (win->font_scale != 0) + { + win->font_scale = 0; + WINHELP_SetupText(GetDlgItem(hWnd, CTL_ID_TEXT), win, 0 /* FIXME */); + } + break; + case MNID_OPTS_FONTS_NORMAL: + case MNID_CTXT_FONTS_NORMAL: + win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); + if (win->font_scale != 1) + { + win->font_scale = 1; + WINHELP_SetupText(GetDlgItem(hWnd, CTL_ID_TEXT), win, 0 /* FIXME */); + } + break; + case MNID_OPTS_FONTS_LARGE: + case MNID_CTXT_FONTS_LARGE: + win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); + if (win->font_scale != 2) + { + win->font_scale = 2; + WINHELP_SetupText(GetDlgItem(hWnd, CTL_ID_TEXT), win, 0 /* FIXME */); + } + break; + case MNID_OPTS_HELP_DEFAULT: + case MNID_OPTS_HELP_VISIBLE: + case MNID_OPTS_HELP_NONVISIBLE: + case MNID_OPTS_SYSTEM_COLORS: + case MNID_CTXT_HELP_DEFAULT: + case MNID_CTXT_HELP_VISIBLE: + case MNID_CTXT_HELP_NONVISIBLE: + case MNID_CTXT_SYSTEM_COLORS: + /* FIXME: NIY */ - for (i = 0; i < FONTS_LEN; i++) - { - fonts[i] = CreateFontIndirect(&logfontlist[i]); + default: + /* Buttons */ + for (button = win->first_button; button; button = button->next) + if (wParam == button->wParam) break; + if (button) + MACRO_ExecuteMacro(button->lpszMacro); + else if (!HIWORD(wParam)) + MessageBox(0, MAKEINTRESOURCE(STID_NOT_IMPLEMENTED), + MAKEINTRESOURCE(STID_WHERROR), MB_OK); + break; } + break; +/* EPP case WM_DESTROY: */ +/* EPP if (Globals.hPopupWnd) DestroyWindow(Globals.hPopupWnd); */ +/* EPP break; */ + case WM_COPYDATA: + return WINHELP_HandleCommand((HWND)wParam, lParam); - init = 1; - } -} - -/*********************************************************************** - * - * WINHELP_MessageBoxIDS_s - */ -INT WINHELP_MessageBoxIDS_s(UINT ids_text, LPCSTR str, UINT ids_title, WORD type) -{ - CHAR text[MAX_STRING_LEN]; - CHAR newtext[MAX_STRING_LEN + MAX_PATH]; + case WM_CHAR: + if (wParam == 3) + { + SendMessage(GetDlgItem(hWnd, CTL_ID_TEXT), WM_COPY, 0, 0); + return 0; + } + break; - LoadString(Globals.hInstance, ids_text, text, sizeof(text)); - wsprintf(newtext, text, str); + case WM_KEYDOWN: + keyDelta = 0; - return MessageBox(0, newtext, MAKEINTRESOURCE(ids_title), type); -} + switch (wParam) + { + case VK_UP: + case VK_DOWN: + keyDelta = GetSystemMetrics(SM_CXVSCROLL); + if (wParam == VK_UP) + keyDelta = -keyDelta; -/************************************************************************** - * cb_KWBTree - * - * HLPFILE_BPTreeCallback enumeration function for '|KWBTREE' internal file. - * - */ -static void cb_KWBTree(void *p, void **next, void *cookie) -{ - HWND hListWnd = (HWND)cookie; - int count; + case VK_PRIOR: + case VK_NEXT: + win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); + hTextWnd = GetDlgItem(win->hMainWnd, CTL_ID_TEXT); + curPos = GetScrollPos(hTextWnd, SB_VERT); + GetScrollRange(hTextWnd, SB_VERT, &min, &max); - WINE_TRACE("Adding '%s' to search list\n", (char *)p); - SendMessage(hListWnd, LB_INSERTSTRING, -1, (LPARAM)p); - count = SendMessage(hListWnd, LB_GETCOUNT, 0, 0); - SendMessage(hListWnd, LB_SETITEMDATA, count-1, (LPARAM)p); - *next = (char*)p + strlen((char*)p) + 7; -} + if (keyDelta == 0) + { + GetClientRect(hTextWnd, &rect); + keyDelta = (rect.bottom - rect.top) / 2; + if (wParam == VK_PRIOR) + keyDelta = -keyDelta; + } -struct index_data -{ - HLPFILE* hlpfile; - BOOL jump; - ULONG offset; -}; + curPos += keyDelta; + if (curPos > max) + curPos = max; + else if (curPos < min) + curPos = min; -/************************************************************************** - * WINHELP_IndexDlgProc - * - */ -INT_PTR CALLBACK WINHELP_IndexDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - static struct index_data* id; - int sel; + dy = GetScrollPos(hTextWnd, SB_VERT) - curPos; + SetScrollPos(hTextWnd, SB_VERT, curPos, TRUE); + ScrollWindow(hTextWnd, 0, dy, NULL, NULL); + UpdateWindow(hTextWnd); + return 0; - switch (msg) - { - case WM_INITDIALOG: - id = (struct index_data*)((PROPSHEETPAGE*)lParam)->lParam; - HLPFILE_BPTreeEnum(id->hlpfile->kwbtree, cb_KWBTree, - GetDlgItem(hWnd, IDC_INDEXLIST)); - id->jump = FALSE; - id->offset = 1; - return TRUE; - case WM_COMMAND: - switch (HIWORD(wParam)) - { - case LBN_DBLCLK: - if (LOWORD(wParam) == IDC_INDEXLIST) - SendMessage(GetParent(hWnd), PSM_PRESSBUTTON, PSBTN_OK, 0); - break; + case VK_ESCAPE: + MACRO_Exit(); + return 0; } break; + case WM_NOTIFY: - switch (((NMHDR*)lParam)->code) - { - case PSN_APPLY: - sel = SendDlgItemMessage(hWnd, IDC_INDEXLIST, LB_GETCURSEL, 0, 0); - if (sel != LB_ERR) - { - BYTE *p; - int count; + if (wParam == CTL_ID_TEXT) + { + RECT rc; - p = (BYTE*)SendDlgItemMessage(hWnd, IDC_INDEXLIST, - LB_GETITEMDATA, sel, 0); - count = *(short*)((char *)p + strlen((char *)p) + 1); - if (count > 1) - { - MessageBox(hWnd, "count > 1 not supported yet", "Error", MB_OK | MB_ICONSTOP); - SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_INVALID); - return TRUE; - } - id->offset = *(ULONG*)((char *)p + strlen((char *)p) + 3); - id->offset = *(long*)(id->hlpfile->kwdata + id->offset + 9); - if (id->offset == 0xFFFFFFFF) + switch (((NMHDR*)lParam)->code) + { + case EN_MSGFILTER: { - MessageBox(hWnd, "macro keywords not supported yet", "Error", MB_OK | MB_ICONSTOP); - SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_INVALID); - return TRUE; + const MSGFILTER* msgf = (const MSGFILTER*)lParam; + switch (msgf->msg) + { + case WM_KEYUP: + if (msgf->wParam == VK_ESCAPE) DestroyWindow(hWnd); + break; + case WM_RBUTTONDOWN: + { + HMENU hMenu; + POINT pt; + + win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); + hMenu = LoadMenu(Globals.hInstance, (LPSTR)CONTEXT_MENU); + switch (win->font_scale) + { + case 0: + CheckMenuItem(hMenu, MNID_CTXT_FONTS_SMALL, + MF_BYCOMMAND|MF_CHECKED); + break; + default: + WINE_FIXME("Unsupported %d\n", win->font_scale); + case 1: + CheckMenuItem(hMenu, MNID_CTXT_FONTS_NORMAL, + MF_BYCOMMAND|MF_CHECKED); + break; + case 2: + CheckMenuItem(hMenu, MNID_CTXT_FONTS_LARGE, + MF_BYCOMMAND|MF_CHECKED); + break; + } + pt.x = (int)(short)LOWORD(msgf->lParam); + pt.y = (int)(short)HIWORD(msgf->lParam); + ClientToScreen(msgf->nmhdr.hwndFrom, &pt); + TrackPopupMenu(GetSubMenu(hMenu, 0), TPM_LEFTALIGN|TPM_TOPALIGN, + pt.x, pt.y, 0, hWnd, NULL); + DestroyMenu(hMenu); + } + break; + default: + return WINHELP_HandleTextMouse((WINHELP_WINDOW*)GetWindowLongPtr(hWnd, 0), + msgf->msg, msgf->lParam); + } } - id->jump = TRUE; - SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_NOERROR); + break; + + case EN_REQUESTRESIZE: + rc = ((REQRESIZE*)lParam)->rc; + win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); + AdjustWindowRect(&rc, GetWindowLong(win->hMainWnd, GWL_STYLE), + FALSE); + SetWindowPos(win->hMainWnd, HWND_TOP, 0, 0, + rc.right - rc.left, rc.bottom - rc.top, + SWP_NOMOVE | SWP_NOZORDER); + WINHELP_LayoutMainWindow(win); + break; } - return TRUE; - default: - return FALSE; } break; - default: + + case WM_INITMENUPOPUP: + win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); + CheckMenuItem((HMENU)wParam, MNID_OPTS_FONTS_SMALL, + MF_BYCOMMAND | (win->font_scale == 0) ? MF_CHECKED : 0); + CheckMenuItem((HMENU)wParam, MNID_OPTS_FONTS_NORMAL, + MF_BYCOMMAND | (win->font_scale == 1) ? MF_CHECKED : 0); + CheckMenuItem((HMENU)wParam, MNID_OPTS_FONTS_LARGE, + MF_BYCOMMAND | (win->font_scale == 2) ? MF_CHECKED : 0); break; - } - return FALSE; -} -/************************************************************************** - * WINHELP_SearchDlgProc - * - */ -INT_PTR CALLBACK WINHELP_SearchDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - static struct index_data* id; + case WM_NCDESTROY: + { + BOOL bExit; + win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); + bExit = (Globals.wVersion >= 4 && !lstrcmpi(win->lpszName, "main")); + WINHELP_DeleteWindow(win); - switch (msg) - { - case WM_INITDIALOG: - id = (struct index_data*)((PROPSHEETPAGE*)lParam)->lParam; - return TRUE; - case WM_NOTIFY: - switch (((NMHDR*)lParam)->code) - { - case PSN_APPLY: - SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_NOERROR); - return TRUE; - default: - return FALSE; + if (bExit) MACRO_Exit(); + if (!Globals.win_list) + PostQuitMessage(0); } break; - default: - break; } - return FALSE; + return DefWindowProc(hWnd, msg, wParam, lParam); } /************************************************************************** @@ -1730,3 +1582,139 @@ BOOL WINHELP_CreateIndexWindow(BOOL is_search) } return TRUE; } + +/*********************************************************************** + * + * RegisterWinClasses + */ +static BOOL WINHELP_RegisterWinClasses(void) +{ + WNDCLASS class_main, class_button_box, class_shadow, class_history; + + class_main.style = CS_HREDRAW | CS_VREDRAW; + class_main.lpfnWndProc = WINHELP_MainWndProc; + class_main.cbClsExtra = 0; + class_main.cbWndExtra = sizeof(WINHELP_WINDOW *); + class_main.hInstance = Globals.hInstance; + class_main.hIcon = LoadIcon(Globals.hInstance, MAKEINTRESOURCE(IDI_WINHELP)); + class_main.hCursor = LoadCursor(0, IDC_ARROW); + class_main.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); + class_main.lpszMenuName = 0; + class_main.lpszClassName = MAIN_WIN_CLASS_NAME; + + class_button_box = class_main; + class_button_box.lpfnWndProc = WINHELP_ButtonBoxWndProc; + class_button_box.cbWndExtra = 0; + class_button_box.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1); + class_button_box.lpszClassName = BUTTON_BOX_WIN_CLASS_NAME; + + class_shadow = class_main; + class_shadow.lpfnWndProc = WINHELP_ShadowWndProc; + class_shadow.cbWndExtra = 0; + class_shadow.hbrBackground = (HBRUSH)(COLOR_3DDKSHADOW+1); + class_shadow.lpszClassName = SHADOW_WIN_CLASS_NAME; + + class_history = class_main; + class_history.lpfnWndProc = WINHELP_HistoryWndProc; + class_history.lpszClassName = HISTORY_WIN_CLASS_NAME; + + return (RegisterClass(&class_main) && + RegisterClass(&class_button_box) && + RegisterClass(&class_shadow) && + RegisterClass(&class_history)); +} + +/*********************************************************************** + * + * WinMain + */ +int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show) +{ + MSG msg; + LONG lHash = 0; + HLPFILE* hlpfile; + static CHAR default_wndname[] = "main"; + LPSTR wndname = default_wndname; + WINHELP_DLL* dll; + + Globals.hInstance = hInstance; + + if (LoadLibrary("riched20.dll") == NULL) + return MessageBox(0, MAKEINTRESOURCE(STID_NO_RICHEDIT), + MAKEINTRESOURCE(STID_WHERROR), MB_OK); + + /* Get options */ + while (*cmdline && (*cmdline == ' ' || *cmdline == '-')) + { + CHAR option; + LPCSTR topic_id; + if (*cmdline++ == ' ') continue; + + option = *cmdline; + if (option) cmdline++; + while (*cmdline && *cmdline == ' ') cmdline++; + switch (option) + { + case 'i': + case 'I': + topic_id = cmdline; + while (*cmdline && *cmdline != ' ') cmdline++; + if (*cmdline) *cmdline++ = '\0'; + lHash = HLPFILE_Hash(topic_id); + break; + + case '3': + case '4': + Globals.wVersion = option - '0'; + break; + + case 'x': + show = SW_HIDE; + Globals.isBook = FALSE; + break; + + default: + WINE_FIXME("Unsupported cmd line: %s\n", cmdline); + break; + } + } + + /* Create primary window */ + if (!WINHELP_RegisterWinClasses()) + { + WINE_FIXME("Couldn't register classes\n"); + return 0; + } + + if (*cmdline) + { + char* ptr; + if ((*cmdline == '"') && (ptr = strchr(cmdline+1, '"'))) + { + cmdline++; + *ptr = '\0'; + } + if ((ptr = strchr(cmdline, '>'))) + { + *ptr = '\0'; + wndname = ptr + 1; + } + hlpfile = WINHELP_LookupHelpFile(cmdline); + if (!hlpfile) return 0; + } + else hlpfile = NULL; + WINHELP_OpenHelpWindow(HLPFILE_PageByHash, hlpfile, lHash, + WINHELP_GetWindowInfo(hlpfile, wndname), show); + + /* Message loop */ + while (GetMessage(&msg, 0, 0, 0)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + for (dll = Globals.dlls; dll; dll = dll->next) + { + if (dll->class & DC_INITTERM) dll->handler(DW_TERM, 0, 0); + } + return 0; +} diff --git a/programs/winhlp32/winhelp.h b/programs/winhlp32/winhelp.h index f06b0829230..feaf6379bbd 100644 --- a/programs/winhlp32/winhelp.h +++ b/programs/winhlp32/winhelp.h @@ -149,7 +149,6 @@ BOOL WINHELP_OpenHelpWindow(HLPFILE_PAGE* (*)(HLPFILE*, LONG, ULONG*), BOOL WINHELP_GetOpenFileName(LPSTR, int); BOOL WINHELP_CreateIndexWindow(BOOL); void WINHELP_DeleteBackSet(WINHELP_WINDOW*); -INT WINHELP_MessageBoxIDS_s(UINT, LPCSTR, UINT, WORD); HLPFILE* WINHELP_LookupHelpFile(LPCSTR lpszFile); HLPFILE_WINDOWINFO* WINHELP_GetWindowInfo(HLPFILE* hlpfile, LPCSTR name); void WINHELP_LayoutMainWindow(WINHELP_WINDOW* win); diff --git a/programs/wordpad/wordpad.c b/programs/wordpad/wordpad.c index dd334aeece1..251b6b49fbd 100644 --- a/programs/wordpad/wordpad.c +++ b/programs/wordpad/wordpad.c @@ -1314,7 +1314,7 @@ static void number_with_units(LPWSTR buffer, int number) static const WCHAR fmt[] = {'%','.','2','f',' ','%','s','\0'}; float converted = (float)number / (float)TWIPS_PER_INCH *(float)CENTMM_PER_INCH / 1000.0; - wsprintfW(buffer, fmt, converted, units_cmW); + sprintfW(buffer, fmt, converted, units_cmW); } static BOOL get_comboexlist_selection(HWND hComboEx, LPWSTR wszBuffer, UINT bufferLength) @@ -1341,7 +1341,7 @@ static BOOL get_comboexlist_selection(HWND hComboEx, LPWSTR wszBuffer, UINT buff cbItem.iItem = idx; cbItem.pszText = wszBuffer; cbItem.cchTextMax = bufferLength-1; - result = SendMessageW(hComboEx, CBEM_GETITEM, 0, (LPARAM)&cbItem); + result = SendMessageW(hComboEx, CBEM_GETITEMW, 0, (LPARAM)&cbItem); return result != 0; } diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index dfcb31e13e7..7d2b751d45b 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -776,11 +776,11 @@ void write_procformatstring(FILE *file, const statement_list_t *stmts, type_pred print_file(file, indent, "\n"); } -static int write_base_type(FILE *file, const type_t *type, unsigned int *typestring_offset) +static int write_base_type(FILE *file, unsigned char fc, unsigned int *typestring_offset) { - if (is_base_type(type->type)) + if (is_base_type(fc)) { - print_file(file, 2, "0x%02x,\t/* %s */\n", type->type, string_of_type(type->type)); + print_file(file, 2, "0x%02x,\t/* %s */\n", fc, string_of_type(fc)); *typestring_offset += 1; return 1; } @@ -1271,6 +1271,21 @@ static void write_user_tfs(FILE *file, type_t *type, unsigned int *tfsoff) *tfsoff += 2; } +static unsigned char inline make_signed(unsigned char fc) +{ + switch(fc) + { + case RPC_FC_USMALL: + return RPC_FC_SMALL; + case RPC_FC_USHORT: + return RPC_FC_SHORT; + case RPC_FC_ULONG: + return RPC_FC_LONG; + default: + return fc; + } +} + static void write_member_type(FILE *file, const type_t *cont, const attr_list_t *attrs, const type_t *type, unsigned int *corroff, unsigned int *tfsoff) @@ -1306,7 +1321,7 @@ static void write_member_type(FILE *file, const type_t *cont, print_file(file, 2, "0x%x,\t/* %s */\n", fc, string_of_type(fc)); *tfsoff += 1; } - else if (!write_base_type(file, type, tfsoff)) + else if (!write_base_type(file, make_signed(type->type), tfsoff)) error("Unsupported member type 0x%x\n", type->type); } diff --git a/tools/winapi/tests.dat b/tools/winapi/tests.dat index 1214909bc4f..72a5f97c678 100644 --- a/tools/winapi/tests.dat +++ b/tools/winapi/tests.dat @@ -1089,7 +1089,7 @@ FILEOP_FLAGS FLAGGED_BYTE_BLOB FLAGGED_WORD_BLOB FMTID -GUID +!GUID # Definition contains preprocessor directives HMETAFILEPICT HYPER_SIZEDARR IFileSystemBindData @@ -1118,7 +1118,7 @@ LPFILEDESCRIPTORW LPFILEGROUPDESCRIPTORA LPFILEGROUPDESCRIPTORW LPFNVIEWCALLBACK -LPGUID +!LPGUID # Definition contains preprocessor directives LPIDA LPITEMIDLIST LPOLESTR diff --git a/tools/winapi/winapi_test b/tools/winapi/winapi_test index f4f00fb698a..58333dc5451 100755 --- a/tools/winapi/winapi_test +++ b/tools/winapi/winapi_test @@ -234,6 +234,10 @@ sub _find_align_kind_size($) { $align = 4; $kind = "struct"; $size = 8; + } elsif (/^GUID$/) { + $align = 4; + $kind = "struct"; + $size = 16; } elsif (/^(?:VOID)$/) { $align = 4; $kind = "signed"; @@ -508,21 +512,13 @@ sub output_header($$$) { print OUT " */\n"; print OUT "\n"; print OUT "#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus)\n"; - print OUT "# define FIELD_ALIGNMENT(type, field) __alignof(((type*)0)->field)\n"; - print OUT "#elif defined(__GNUC__)\n"; - print OUT "# define FIELD_ALIGNMENT(type, field) __alignof__(((type*)0)->field)\n"; - print OUT "#else\n"; - print OUT "/* FIXME: Not sure if is possible to do without compiler extension */\n"; - print OUT "#endif\n"; - print OUT "\n"; - print OUT "#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus)\n"; print OUT "# define _TYPE_ALIGNMENT(type) __alignof(type)\n"; print OUT "#elif defined(__GNUC__)\n"; print OUT "# define _TYPE_ALIGNMENT(type) __alignof__(type)\n"; print OUT "#else\n"; print OUT "/*\n"; - print OUT " * FIXME: Not sure if is possible to do without compiler extension\n"; - print OUT " * (if type is not just a name that is, if so the normal)\n"; + print OUT " * FIXME: May not be possible without a compiler extension\n"; + print OUT " * (if type is not just a name that is, otherwise the normal\n"; print OUT " * TYPE_ALIGNMENT can be used)\n"; print OUT " */\n"; print OUT "#endif\n"; @@ -540,59 +536,41 @@ sub output_header($$$) { print OUT " * Test helper macros\n"; print OUT " */\n"; print OUT "\n"; - print OUT "#ifdef FIELD_ALIGNMENT\n"; - print OUT "# define TEST_FIELD_ALIGNMENT(type, field, align) \\\n"; - print OUT " ok(FIELD_ALIGNMENT(type, field) == align, \\\n"; - print OUT " \"FIELD_ALIGNMENT(\" #type \", \" #field \") == %d (expected \" #align \")\\n\", \\\n"; - print OUT " (int)FIELD_ALIGNMENT(type, field))\n"; - print OUT "#else\n"; - print OUT "# define TEST_FIELD_ALIGNMENT(type, field, align) do { } while (0)\n"; - print OUT "#endif\n"; - print OUT "\n"; - print OUT "#define TEST_FIELD_OFFSET(type, field, offset) \\\n"; - print OUT " ok(FIELD_OFFSET(type, field) == offset, \\\n"; - print OUT " \"FIELD_OFFSET(\" #type \", \" #field \") == %ld (expected \" #offset \")\\n\", \\\n"; - print OUT " (long int)FIELD_OFFSET(type, field))\n"; + print OUT "#ifdef _WIN64\n"; print OUT "\n"; - print OUT "#ifdef _TYPE_ALIGNMENT\n"; - print OUT "#define TEST__TYPE_ALIGNMENT(type, align) \\\n"; - print OUT " ok(_TYPE_ALIGNMENT(type) == align, \"TYPE_ALIGNMENT(\" #type \") == %d (expected \" #align \")\\n\", (int)_TYPE_ALIGNMENT(type))\n"; - print OUT "#else\n"; - print OUT "# define TEST__TYPE_ALIGNMENT(type, align) do { } while (0)\n"; - print OUT "#endif\n"; + print OUT "# define TEST_TYPE_SIZE(type, size)\n"; + print OUT "# define TEST_TYPE_ALIGN(type, align)\n"; + print OUT "# define TEST_TARGET_ALIGN(type, align)\n"; + print OUT "# define TEST_FIELD_ALIGN(type, field, align)\n"; + print OUT "# define TEST_FIELD_OFFSET(type, field, offset)\n"; print OUT "\n"; - print OUT "#ifdef TYPE_ALIGNMENT\n"; - print OUT "#define TEST_TYPE_ALIGNMENT(type, align) \\\n"; - print OUT " ok(TYPE_ALIGNMENT(type) == align, \"TYPE_ALIGNMENT(\" #type \") == %d (expected \" #align \")\\n\", (int)TYPE_ALIGNMENT(type))\n"; print OUT "#else\n"; - print OUT "# define TEST_TYPE_ALIGNMENT(type, align) do { } while (0)\n"; - print OUT "#endif\n"; print OUT "\n"; - print OUT "#define TEST_TYPE_SIZE(type, size) \\\n"; - print OUT " ok(sizeof(type) == size, \"sizeof(\" #type \") == %d (expected \" #size \")\\n\", ((int) sizeof(type)))\n"; + print OUT "# define TEST_TYPE_SIZE(type, size) C_ASSERT(sizeof(type) == size);\n"; print OUT "\n"; - print OUT "/***********************************************************************\n"; - print OUT " * Test macros\n"; - print OUT " */\n"; + print OUT "# ifdef TYPE_ALIGNMENT\n"; + print OUT "# define TEST_TYPE_ALIGN(type, align) C_ASSERT(TYPE_ALIGNMENT(type) == align);\n"; + print OUT "# else\n"; + print OUT "# define TEST_TYPE_ALIGN(type, align)\n"; + print OUT "# endif\n"; print OUT "\n"; - print OUT "#define TEST_FIELD(type, field_type, field_name, field_offset, field_size, field_align) \\\n"; - print OUT " TEST_TYPE_SIZE(field_type, field_size); \\\n"; - print OUT " TEST_FIELD_ALIGNMENT(type, field_name, field_align); \\\n"; - print OUT " TEST_FIELD_OFFSET(type, field_name, field_offset); \\\n"; + print OUT "# ifdef _TYPE_ALIGNMENT\n"; + print OUT "# define TEST_TARGET_ALIGN(type, align) C_ASSERT(_TYPE_ALIGNMENT(*(type)0) == align);\n"; + print OUT "# define TEST_FIELD_ALIGN(type, field, align) C_ASSERT(_TYPE_ALIGNMENT(((type*)0)->field) == align);\n"; + print OUT "# else\n"; + print OUT "# define TEST_TARGET_ALIGN(type, align)\n"; + print OUT "# define TEST_FIELD_ALIGN(type, field, align)\n"; + print OUT "# endif\n"; print OUT "\n"; - print OUT "#define TEST_TYPE(type, size, align) \\\n"; - print OUT " TEST_TYPE_ALIGNMENT(type, align); \\\n"; - print OUT " TEST_TYPE_SIZE(type, size)\n"; + print OUT "# define TEST_FIELD_OFFSET(type, field, offset) C_ASSERT(FIELD_OFFSET(type, field) == offset);\n"; print OUT "\n"; - print OUT "#define TEST_TYPE_POINTER(type, size, align) \\\n"; - print OUT " TEST__TYPE_ALIGNMENT(*(type)0, align); \\\n"; - print OUT " TEST_TYPE_SIZE(*(type)0, size)\n"; + print OUT "#endif\n"; print OUT "\n"; - print OUT "#define TEST_TYPE_SIGNED(type) \\\n"; - print OUT " ok((type) -1 < 0, \"(\" #type \") -1 < 0\\n\");\n"; + print OUT "#define TEST_TARGET_SIZE(type, size) TEST_TYPE_SIZE(*(type)0, size)\n"; + print OUT "#define TEST_FIELD_SIZE(type, field, size) TEST_TYPE_SIZE((((type*)0)->field), size)\n"; + print OUT "#define TEST_TYPE_SIGNED(type) C_ASSERT((type) -1 < 0);\n"; + print OUT "#define TEST_TYPE_UNSIGNED(type) C_ASSERT((type) -1 > 0);\n"; print OUT "\n"; - print OUT "#define TEST_TYPE_UNSIGNED(type) \\\n"; - print OUT " ok((type) -1 > 0, \"(\" #type \") -1 > 0\\n\");\n"; print OUT "\n"; } @@ -608,7 +586,11 @@ sub output_footer($$$) { print OUT "START_TEST(generated)\n"; print OUT "{\n"; foreach my $test (@tests) { + print OUT "#ifdef _WIN64\n"; + print OUT " ok(0, \"The type size / alignment tests don't support Win64 yet\\n\");\n"; + print OUT "#else\n"; print OUT " test_$test();\n"; + print OUT "#endif\n"; } print OUT "}\n"; } @@ -639,7 +621,8 @@ sub output_test_pack_type($$$$$$) { } if (!scalar(keys(%$optional_fields)) && defined($type_align) && defined($type_size)) { - print OUT " TEST_TYPE($type_name, $type_size, $type_align);\n"; + print OUT " TEST_TYPE_SIZE ($type_name, $type_size)\n"; + print OUT " TEST_TYPE_ALIGN ($type_name, $type_align)\n"; } if ($type_kind eq "float") { @@ -688,15 +671,16 @@ sub output_test_pack_type($$$$$$) { my $optional_fields2 = $$type_name2optional_fields{$type_name2}; if (!$optional && !scalar(keys(%$optional_fields2)) && defined($type_align2) && defined($type_size2)) { - print OUT " TEST_TYPE_POINTER($type_name, $type_size2, $type_align2);\n"; + print OUT " TEST_TARGET_SIZE ($type_name, $type_size2)\n"; + print OUT " TEST_TARGET_ALIGN($type_name, $type_align2)\n"; } else { # $output->write("$type_name: warning: type size not found\n"); } } } elsif ($type_kind eq "signed") { - print OUT " TEST_TYPE_SIGNED($type_name);\n"; + print OUT " TEST_TYPE_SIGNED($type_name)\n"; } elsif ($type_kind eq "unsigned") { - print OUT " TEST_TYPE_UNSIGNED($type_name);\n"; + print OUT " TEST_TYPE_UNSIGNED($type_name)\n"; } } @@ -731,15 +715,17 @@ sub output_test_pack_fields($$$$$$$) { $field_offset += $offset; if ($field_name eq "DUMMYSTRUCTNAME") { print OUT "#ifdef NONAMELESSSTRUCT\n"; - print OUT " TEST_FIELD($type_name, $field_type_name, $field_name, "; - print OUT "$field_offset, $field_size, $field_align);\n"; + print OUT " TEST_TYPE_SIZE ($type_name.$field_name, $field_size)\n"; + print OUT " TEST_FIELD_ALIGN ($type_name, $field_name, $field_align)\n"; + print OUT " TEST_FIELD_OFFSET($type_name, $field_name, $field_offset)\n"; print OUT "#else\n"; output_test_pack_fields(\*OUT, $type_name2type, $type_name2optional, $type_name2optional_fields, $type_name, $$type_name2type{$field_type_name}, $field_offset); print OUT "#endif\n"; } else { - print OUT " TEST_FIELD($type_name, $field_type_name, $field_name, "; - print OUT "$field_offset, $field_size, $field_align);\n"; + print OUT " TEST_FIELD_SIZE ($type_name, $field_name, $field_size)\n"; + print OUT " TEST_FIELD_ALIGN ($type_name, $field_name, $field_align)\n"; + print OUT " TEST_FIELD_OFFSET($type_name, $field_name, $field_offset)\n"; } } else { # $output->write("$type_name: $field_type_name: $field_name: test not generated (offset not defined)\n"); -- 2.11.4.GIT