1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-27 22:50:26 +03:00

make sure we can expand the critical versions structure without

causing crashes in old modules. Thanks to metze for pointing this out!
(This used to be commit 2ee5540629e7922cd76d87ed53b70bf37b83e100)
This commit is contained in:
Andrew Tridgell 2003-12-02 09:16:53 +00:00
parent cea22e94fc
commit c290906b3f
2 changed files with 10 additions and 6 deletions

View File

@ -82,6 +82,7 @@ struct ntvfs_ops {
/* this structure is used by backends to determine the size of some critical types */
struct ntvfs_critical_sizes {
int interface_version;
int sizeof_ntvfs_ops;
int sizeof_SMB_OFF_T;
int sizeof_tcon_context;

View File

@ -88,14 +88,17 @@ struct ntvfs_ops *ntvfs_backend_byname(const char *name, enum ntvfs_type type)
This can be used by backends to either detect compilation errors, or provide
multiple implementations for different smbd compilation options in one module
*/
int ntvfs_interface_version(struct ntvfs_critical_sizes *sizes)
const struct ntvfs_critical_sizes *ntvfs_interface_version(void)
{
sizes->sizeof_ntvfs_ops = sizeof(struct ntvfs_ops);
sizes->sizeof_SMB_OFF_T = sizeof(SMB_OFF_T);
sizes->sizeof_tcon_context = sizeof(struct tcon_context);
sizes->sizeof_request_context = sizeof(struct request_context);
static const struct ntvfs_critical_sizes critical_sizes = {
NTVFS_INTERFACE_VERSION,
sizeof(struct ntvfs_ops),
sizeof(SMB_OFF_T),
sizeof(struct tcon_context),
sizeof(struct request_context),
};
return NTVFS_INTERFACE_VERSION;
return &critical_sizes;
}