1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-03 04:22:09 +03:00

r15638: add a usefull macro to get a pointer the smb_handle union

of smb_open, as it's not nicely alligned for all levels,

If someone has an idea for a better solution where we can access
it via op->generic.out.file.* please let me know:-)

metze
(This used to be commit d0a7408280)
This commit is contained in:
Stefan Metzmacher
2006-05-16 16:28:36 +00:00
committed by Gerald (Jerry) Carter
parent 94bf599886
commit bb58d8497a

View File

@ -1173,6 +1173,48 @@ enum smb_open_level {
/* union for open() backend call */
union smb_open {
/*
* because the *.out.file structs are not aligned to the same offset for each level
* we provide a hepler macro that should be used to find the current smb_handle structure
*/
#define SMB_OPEN_OUT_FILE(op, file) do { \
switch (op->generic.level) { \
case RAW_OPEN_OPEN: \
file = &op->openold.out.file; \
break; \
case RAW_OPEN_OPENX: \
file = &op->openx.out.file; \
break; \
case RAW_OPEN_MKNEW: \
file = &op->mknew.out.file; \
break; \
case RAW_OPEN_CREATE: \
file = &op->create.out.file; \
break; \
case RAW_OPEN_CTEMP: \
file = &op->ctemp.out.file; \
break; \
case RAW_OPEN_SPLOPEN: \
file = &op->splopen.out.file; \
break; \
case RAW_OPEN_NTCREATEX: \
file = &op->ntcreatex.out.file; \
break; \
case RAW_OPEN_T2OPEN: \
file = &op->t2open.out.file; \
break; \
case RAW_OPEN_NTTRANS_CREATE: \
file = &op->nttrans.out.file; \
break; \
case RAW_OPEN_OPENX_READX: \
file = &op->openxreadx.out.file; \
break; \
default: \
/* this must be a programmer error */ \
file = NULL; \
break; \
} \
} while (0)
/* SMBNTCreateX interface */
struct {
enum smb_open_level level;
@ -1212,7 +1254,7 @@ union smb_open {
uint16_t ipc_state;
uint8_t is_directory;
} out;
} ntcreatex, generic;
} ntcreatex, nttrans, generic;
/* TRANS2_OPEN interface */
struct {