Commit fcba2723 authored by Ilya Basin's avatar Ilya Basin Committed by Alexandre Julliard

include: Fix packing bug in shlobj.h. pragma pack 8 for ITEMSPACING, CSFV, SFV_CREATE.

parent 61a9eef9
...@@ -1386,25 +1386,25 @@ static void test_pack_CIDA(void) ...@@ -1386,25 +1386,25 @@ static void test_pack_CIDA(void)
static void test_pack_CSFV(void) static void test_pack_CSFV(void)
{ {
/* CSFV (pack 1) */ /* CSFV (pack 8) */
TEST_FIELD_SIZE (CSFV, cbSize, 4) TEST_FIELD_SIZE (CSFV, cbSize, 4)
TEST_FIELD_ALIGN (CSFV, cbSize, 1) TEST_FIELD_ALIGN (CSFV, cbSize, 4)
TEST_FIELD_OFFSET(CSFV, cbSize, 0) TEST_FIELD_OFFSET(CSFV, cbSize, 0)
TEST_FIELD_SIZE (CSFV, pshf, 8) TEST_FIELD_SIZE (CSFV, pshf, 8)
TEST_FIELD_ALIGN (CSFV, pshf, 1) TEST_FIELD_ALIGN (CSFV, pshf, 8)
TEST_FIELD_OFFSET(CSFV, pshf, 4) TEST_FIELD_OFFSET(CSFV, pshf, 8)
TEST_FIELD_SIZE (CSFV, psvOuter, 8) TEST_FIELD_SIZE (CSFV, psvOuter, 8)
TEST_FIELD_ALIGN (CSFV, psvOuter, 1) TEST_FIELD_ALIGN (CSFV, psvOuter, 8)
TEST_FIELD_OFFSET(CSFV, psvOuter, 12) TEST_FIELD_OFFSET(CSFV, psvOuter, 16)
TEST_FIELD_SIZE (CSFV, pidl, 8) TEST_FIELD_SIZE (CSFV, pidl, 8)
TEST_FIELD_ALIGN (CSFV, pidl, 1) TEST_FIELD_ALIGN (CSFV, pidl, 8)
TEST_FIELD_OFFSET(CSFV, pidl, 20) TEST_FIELD_OFFSET(CSFV, pidl, 24)
TEST_FIELD_SIZE (CSFV, lEvents, 4) TEST_FIELD_SIZE (CSFV, lEvents, 4)
TEST_FIELD_ALIGN (CSFV, lEvents, 1) TEST_FIELD_ALIGN (CSFV, lEvents, 4)
TEST_FIELD_OFFSET(CSFV, lEvents, 28) TEST_FIELD_OFFSET(CSFV, lEvents, 32)
TEST_FIELD_SIZE (CSFV, pfnCallback, 8) TEST_FIELD_SIZE (CSFV, pfnCallback, 8)
TEST_FIELD_ALIGN (CSFV, pfnCallback, 1) TEST_FIELD_ALIGN (CSFV, pfnCallback, 8)
TEST_FIELD_OFFSET(CSFV, pfnCallback, 32) TEST_FIELD_OFFSET(CSFV, pfnCallback, 40)
} }
static void test_pack_DROPFILES(void) static void test_pack_DROPFILES(void)
...@@ -1532,6 +1532,25 @@ static void test_pack_FILEGROUPDESCRIPTORW(void) ...@@ -1532,6 +1532,25 @@ static void test_pack_FILEGROUPDESCRIPTORW(void)
TEST_FIELD_OFFSET(FILEGROUPDESCRIPTORW, fgd, 4) TEST_FIELD_OFFSET(FILEGROUPDESCRIPTORW, fgd, 4)
} }
static void test_pack_ITEMSPACING(void)
{
/* ITEMSPACING (pack 8) */
TEST_TYPE_SIZE (ITEMSPACING, 16)
TEST_TYPE_ALIGN (ITEMSPACING, 4)
TEST_FIELD_SIZE (ITEMSPACING, cxSmall, 4)
TEST_FIELD_ALIGN (ITEMSPACING, cxSmall, 4)
TEST_FIELD_OFFSET(ITEMSPACING, cxSmall, 0)
TEST_FIELD_SIZE (ITEMSPACING, cySmall, 4)
TEST_FIELD_ALIGN (ITEMSPACING, cySmall, 4)
TEST_FIELD_OFFSET(ITEMSPACING, cySmall, 4)
TEST_FIELD_SIZE (ITEMSPACING, cxLarge, 4)
TEST_FIELD_ALIGN (ITEMSPACING, cxLarge, 4)
TEST_FIELD_OFFSET(ITEMSPACING, cxLarge, 8)
TEST_FIELD_SIZE (ITEMSPACING, cyLarge, 4)
TEST_FIELD_ALIGN (ITEMSPACING, cyLarge, 4)
TEST_FIELD_OFFSET(ITEMSPACING, cyLarge, 12)
}
static void test_pack_LPBROWSEINFOA(void) static void test_pack_LPBROWSEINFOA(void)
{ {
/* LPBROWSEINFOA */ /* LPBROWSEINFOA */
...@@ -1756,6 +1775,25 @@ static void test_pack_QCMINFO_IDMAP_PLACEMENT(void) ...@@ -1756,6 +1775,25 @@ static void test_pack_QCMINFO_IDMAP_PLACEMENT(void)
TEST_FIELD_OFFSET(QCMINFO_IDMAP_PLACEMENT, fFlags, 4) TEST_FIELD_OFFSET(QCMINFO_IDMAP_PLACEMENT, fFlags, 4)
} }
static void test_pack_SFV_CREATE(void)
{
/* SFV_CREATE (pack 8) */
TEST_TYPE_SIZE (SFV_CREATE, 32)
TEST_TYPE_ALIGN (SFV_CREATE, 8)
TEST_FIELD_SIZE (SFV_CREATE, cbSize, 4)
TEST_FIELD_ALIGN (SFV_CREATE, cbSize, 4)
TEST_FIELD_OFFSET(SFV_CREATE, cbSize, 0)
TEST_FIELD_SIZE (SFV_CREATE, pshf, 8)
TEST_FIELD_ALIGN (SFV_CREATE, pshf, 8)
TEST_FIELD_OFFSET(SFV_CREATE, pshf, 8)
TEST_FIELD_SIZE (SFV_CREATE, psvOuter, 8)
TEST_FIELD_ALIGN (SFV_CREATE, psvOuter, 8)
TEST_FIELD_OFFSET(SFV_CREATE, psvOuter, 16)
TEST_FIELD_SIZE (SFV_CREATE, psfvcb, 8)
TEST_FIELD_ALIGN (SFV_CREATE, psfvcb, 8)
TEST_FIELD_OFFSET(SFV_CREATE, psfvcb, 24)
}
static void test_pack_SHChangeDWORDAsIDList(void) static void test_pack_SHChangeDWORDAsIDList(void)
{ {
/* SHChangeDWORDAsIDList (pack 1) */ /* SHChangeDWORDAsIDList (pack 1) */
...@@ -3166,24 +3204,24 @@ static void test_pack_CIDA(void) ...@@ -3166,24 +3204,24 @@ static void test_pack_CIDA(void)
static void test_pack_CSFV(void) static void test_pack_CSFV(void)
{ {
/* CSFV (pack 1) */ /* CSFV (pack 8) */
TEST_FIELD_SIZE (CSFV, cbSize, 4) TEST_FIELD_SIZE (CSFV, cbSize, 4)
TEST_FIELD_ALIGN (CSFV, cbSize, 1) TEST_FIELD_ALIGN (CSFV, cbSize, 4)
TEST_FIELD_OFFSET(CSFV, cbSize, 0) TEST_FIELD_OFFSET(CSFV, cbSize, 0)
TEST_FIELD_SIZE (CSFV, pshf, 4) TEST_FIELD_SIZE (CSFV, pshf, 4)
TEST_FIELD_ALIGN (CSFV, pshf, 1) TEST_FIELD_ALIGN (CSFV, pshf, 4)
TEST_FIELD_OFFSET(CSFV, pshf, 4) TEST_FIELD_OFFSET(CSFV, pshf, 4)
TEST_FIELD_SIZE (CSFV, psvOuter, 4) TEST_FIELD_SIZE (CSFV, psvOuter, 4)
TEST_FIELD_ALIGN (CSFV, psvOuter, 1) TEST_FIELD_ALIGN (CSFV, psvOuter, 4)
TEST_FIELD_OFFSET(CSFV, psvOuter, 8) TEST_FIELD_OFFSET(CSFV, psvOuter, 8)
TEST_FIELD_SIZE (CSFV, pidl, 4) TEST_FIELD_SIZE (CSFV, pidl, 4)
TEST_FIELD_ALIGN (CSFV, pidl, 1) TEST_FIELD_ALIGN (CSFV, pidl, 4)
TEST_FIELD_OFFSET(CSFV, pidl, 12) TEST_FIELD_OFFSET(CSFV, pidl, 12)
TEST_FIELD_SIZE (CSFV, lEvents, 4) TEST_FIELD_SIZE (CSFV, lEvents, 4)
TEST_FIELD_ALIGN (CSFV, lEvents, 1) TEST_FIELD_ALIGN (CSFV, lEvents, 4)
TEST_FIELD_OFFSET(CSFV, lEvents, 16) TEST_FIELD_OFFSET(CSFV, lEvents, 16)
TEST_FIELD_SIZE (CSFV, pfnCallback, 4) TEST_FIELD_SIZE (CSFV, pfnCallback, 4)
TEST_FIELD_ALIGN (CSFV, pfnCallback, 1) TEST_FIELD_ALIGN (CSFV, pfnCallback, 4)
TEST_FIELD_OFFSET(CSFV, pfnCallback, 20) TEST_FIELD_OFFSET(CSFV, pfnCallback, 20)
} }
...@@ -3312,6 +3350,25 @@ static void test_pack_FILEGROUPDESCRIPTORW(void) ...@@ -3312,6 +3350,25 @@ static void test_pack_FILEGROUPDESCRIPTORW(void)
TEST_FIELD_OFFSET(FILEGROUPDESCRIPTORW, fgd, 4) TEST_FIELD_OFFSET(FILEGROUPDESCRIPTORW, fgd, 4)
} }
static void test_pack_ITEMSPACING(void)
{
/* ITEMSPACING (pack 8) */
TEST_TYPE_SIZE (ITEMSPACING, 16)
TEST_TYPE_ALIGN (ITEMSPACING, 4)
TEST_FIELD_SIZE (ITEMSPACING, cxSmall, 4)
TEST_FIELD_ALIGN (ITEMSPACING, cxSmall, 4)
TEST_FIELD_OFFSET(ITEMSPACING, cxSmall, 0)
TEST_FIELD_SIZE (ITEMSPACING, cySmall, 4)
TEST_FIELD_ALIGN (ITEMSPACING, cySmall, 4)
TEST_FIELD_OFFSET(ITEMSPACING, cySmall, 4)
TEST_FIELD_SIZE (ITEMSPACING, cxLarge, 4)
TEST_FIELD_ALIGN (ITEMSPACING, cxLarge, 4)
TEST_FIELD_OFFSET(ITEMSPACING, cxLarge, 8)
TEST_FIELD_SIZE (ITEMSPACING, cyLarge, 4)
TEST_FIELD_ALIGN (ITEMSPACING, cyLarge, 4)
TEST_FIELD_OFFSET(ITEMSPACING, cyLarge, 12)
}
static void test_pack_LPBROWSEINFOA(void) static void test_pack_LPBROWSEINFOA(void)
{ {
/* LPBROWSEINFOA */ /* LPBROWSEINFOA */
...@@ -3536,6 +3593,25 @@ static void test_pack_QCMINFO_IDMAP_PLACEMENT(void) ...@@ -3536,6 +3593,25 @@ static void test_pack_QCMINFO_IDMAP_PLACEMENT(void)
TEST_FIELD_OFFSET(QCMINFO_IDMAP_PLACEMENT, fFlags, 4) TEST_FIELD_OFFSET(QCMINFO_IDMAP_PLACEMENT, fFlags, 4)
} }
static void test_pack_SFV_CREATE(void)
{
/* SFV_CREATE (pack 8) */
TEST_TYPE_SIZE (SFV_CREATE, 16)
TEST_TYPE_ALIGN (SFV_CREATE, 4)
TEST_FIELD_SIZE (SFV_CREATE, cbSize, 4)
TEST_FIELD_ALIGN (SFV_CREATE, cbSize, 4)
TEST_FIELD_OFFSET(SFV_CREATE, cbSize, 0)
TEST_FIELD_SIZE (SFV_CREATE, pshf, 4)
TEST_FIELD_ALIGN (SFV_CREATE, pshf, 4)
TEST_FIELD_OFFSET(SFV_CREATE, pshf, 4)
TEST_FIELD_SIZE (SFV_CREATE, psvOuter, 4)
TEST_FIELD_ALIGN (SFV_CREATE, psvOuter, 4)
TEST_FIELD_OFFSET(SFV_CREATE, psvOuter, 8)
TEST_FIELD_SIZE (SFV_CREATE, psfvcb, 4)
TEST_FIELD_ALIGN (SFV_CREATE, psfvcb, 4)
TEST_FIELD_OFFSET(SFV_CREATE, psfvcb, 12)
}
static void test_pack_SHChangeDWORDAsIDList(void) static void test_pack_SHChangeDWORDAsIDList(void)
{ {
/* SHChangeDWORDAsIDList (pack 1) */ /* SHChangeDWORDAsIDList (pack 1) */
...@@ -3682,6 +3758,7 @@ static void test_pack(void) ...@@ -3682,6 +3758,7 @@ static void test_pack(void)
test_pack_HYPER_SIZEDARR(); test_pack_HYPER_SIZEDARR();
test_pack_IID(); test_pack_IID();
test_pack_ITEMIDLIST(); test_pack_ITEMIDLIST();
test_pack_ITEMSPACING();
test_pack_LPBLOB(); test_pack_LPBLOB();
test_pack_LPBROWSEINFOA(); test_pack_LPBROWSEINFOA();
test_pack_LPBROWSEINFOW(); test_pack_LPBROWSEINFOW();
...@@ -3740,6 +3817,7 @@ static void test_pack(void) ...@@ -3740,6 +3817,7 @@ static void test_pack(void)
test_pack_RemHMETAFILEPICT(); test_pack_RemHMETAFILEPICT();
test_pack_RemHPALETTE(); test_pack_RemHPALETTE();
test_pack_SCODE(); test_pack_SCODE();
test_pack_SFV_CREATE();
test_pack_SHChangeDWORDAsIDList(); test_pack_SHChangeDWORDAsIDList();
test_pack_SHChangeNotifyEntry(); test_pack_SHChangeNotifyEntry();
test_pack_SHChangeProductKeyAsIDList(); test_pack_SHChangeProductKeyAsIDList();
......
...@@ -542,6 +542,8 @@ DECLARE_INTERFACE_(IShellFolderViewCB,IUnknown) ...@@ -542,6 +542,8 @@ DECLARE_INTERFACE_(IShellFolderViewCB,IUnknown)
* IShellFolderView interface * IShellFolderView interface
*/ */
#include <pshpack8.h>
typedef struct _ITEMSPACING typedef struct _ITEMSPACING
{ {
int cxSmall; int cxSmall;
...@@ -550,6 +552,8 @@ typedef struct _ITEMSPACING ...@@ -550,6 +552,8 @@ typedef struct _ITEMSPACING
int cyLarge; int cyLarge;
} ITEMSPACING; } ITEMSPACING;
#include <poppack.h>
#define INTERFACE IShellFolderView #define INTERFACE IShellFolderView
DEFINE_GUID(IID_IShellFolderView,0x37a378c0,0xf82d,0x11ce,0xae,0x65,0x08,0x00,0x2b,0x2e,0x12,0x62); DEFINE_GUID(IID_IShellFolderView,0x37a378c0,0xf82d,0x11ce,0xae,0x65,0x08,0x00,0x2b,0x2e,0x12,0x62);
DECLARE_INTERFACE_(IShellFolderView, IUnknown) DECLARE_INTERFACE_(IShellFolderView, IUnknown)
...@@ -779,6 +783,8 @@ typedef HRESULT (CALLBACK *LPFNVIEWCALLBACK)( ...@@ -779,6 +783,8 @@ typedef HRESULT (CALLBACK *LPFNVIEWCALLBACK)(
WPARAM wParam, WPARAM wParam,
LPARAM lParam); LPARAM lParam);
#include <pshpack8.h>
typedef struct _CSFV typedef struct _CSFV
{ {
UINT cbSize; UINT cbSize;
...@@ -790,6 +796,8 @@ typedef struct _CSFV ...@@ -790,6 +796,8 @@ typedef struct _CSFV
FOLDERVIEWMODE fvm; FOLDERVIEWMODE fvm;
} CSFV, *LPCSFV; } CSFV, *LPCSFV;
#include <poppack.h>
HRESULT WINAPI SHCreateShellFolderViewEx(LPCSFV pshfvi, IShellView **ppshv); HRESULT WINAPI SHCreateShellFolderViewEx(LPCSFV pshfvi, IShellView **ppshv);
/* SHCreateShellFolderViewEx callback messages */ /* SHCreateShellFolderViewEx callback messages */
...@@ -850,6 +858,8 @@ HRESULT WINAPI SHCreateShellFolderViewEx(LPCSFV pshfvi, IShellView **ppshv); ...@@ -850,6 +858,8 @@ HRESULT WINAPI SHCreateShellFolderViewEx(LPCSFV pshfvi, IShellView **ppshv);
#define SFVM_GET_WEBVIEW_THEME 86 /* undocumented */ #define SFVM_GET_WEBVIEW_THEME 86 /* undocumented */
#define SFVM_GETDEFERREDVIEWSETTINGS 92 /* undocumented */ #define SFVM_GETDEFERREDVIEWSETTINGS 92 /* undocumented */
#include <pshpack8.h>
typedef struct _SFV_CREATE typedef struct _SFV_CREATE
{ {
UINT cbSize; UINT cbSize;
...@@ -858,6 +868,8 @@ typedef struct _SFV_CREATE ...@@ -858,6 +868,8 @@ typedef struct _SFV_CREATE
IShellFolderViewCB *psfvcb; IShellFolderViewCB *psfvcb;
} SFV_CREATE; } SFV_CREATE;
#include <poppack.h>
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pscfv, IShellView **ppsv); HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pscfv, IShellView **ppsv);
/* Types and definitions for the SFM_* parameters */ /* Types and definitions for the SFM_* parameters */
......
...@@ -1108,6 +1108,7 @@ IID ...@@ -1108,6 +1108,7 @@ IID
IShellChangeNotify IShellChangeNotify
IShellIcon IShellIcon
ITEMIDLIST ITEMIDLIST
ITEMSPACING
LPBLOB LPBLOB
LPBROWSEINFOA LPBROWSEINFOA
LPBROWSEINFOW LPBROWSEINFOW
...@@ -1167,6 +1168,7 @@ RemHGLOBAL ...@@ -1167,6 +1168,7 @@ RemHGLOBAL
RemHMETAFILEPICT RemHMETAFILEPICT
RemHPALETTE RemHPALETTE
SCODE SCODE
SFV_CREATE
SHChangeDWORDAsIDList SHChangeDWORDAsIDList
SHChangeNotifyEntry SHChangeNotifyEntry
SHChangeProductKeyAsIDList SHChangeProductKeyAsIDList
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment