From ee5c584614017b6156a85eed19cf82265cf16e02 Mon Sep 17 00:00:00 2001 From: Bill Zissimopoulos Date: Thu, 23 Jun 2016 00:33:18 -0700 Subject: [PATCH] inc: winfsp: FSP_FILE_SYSTEM_INTERFACE: ensure it has 64 entries --- inc/winfsp/winfsp.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/inc/winfsp/winfsp.h b/inc/winfsp/winfsp.h index 2c2d9529..6fc4394c 100644 --- a/inc/winfsp/winfsp.h +++ b/inc/winfsp/winfsp.h @@ -576,7 +576,21 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE PVOID FileNode, PVOID Buffer, UINT64 Offset, ULONG Length, PWSTR Pattern, PULONG PBytesTransferred); + + /* + * This ensures that this interface will always contain 64 function pointers. + * Please update when changing the interface as it is important for future compatibility. + */ + NTSTATUS (*Reserved[44])(); } FSP_FILE_SYSTEM_INTERFACE; +#if defined(WINFSP_DLL_INTERNAL) +/* + * Static_assert is a C++11 feature, but seems to work with C on MSVC 2015. + * Use it to verify that FSP_FILE_SYSTEM_INTERFACE has the right size. + */ +static_assert(sizeof(FSP_FILE_SYSTEM_INTERFACE) == 64 * sizeof(NTSTATUS (*)()), + "FSP_FILE_SYSTEM_INTERFACE must have 64 entries."); +#endif typedef enum { FSP_FILE_SYSTEM_OPERATION_GUARD_STRATEGY_FINE = 0,