From 6cc3953196e3feb340f7b9b7bb823575414c5683 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 19 Oct 2001 00:56:03 +0000 Subject: Restored old Bmpx code - actually used by OS/2. Jeremy. (This used to be commit 7c1688fd67c1bda1477aaf870371c825280db870) --- source3/include/smb_macros.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source3/include/smb_macros.h') diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index b4264937cf..05a358573d 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -82,6 +82,9 @@ #define CHECK_WRITE(fsp) if (!(fsp)->can_write) \ return(ERROR_DOS(ERRDOS,ERRbadaccess)) +#define CHECK_ERROR(fsp) if (HAS_CACHED_ERROR(fsp)) \ + return(CACHED_ERROR(fsp)) + /* translates a connection number into a service number */ #define SNUM(conn) ((conn)?(conn)->service:-1) @@ -136,6 +139,15 @@ #define SMB_LARGE_LKLEN_OFFSET_HIGH(indx) (12 + (20 * (indx))) #define SMB_LARGE_LKLEN_OFFSET_LOW(indx) (16 + (20 * (indx))) +/* Macro to cache an error in a write_bmpx_struct */ +#define CACHE_ERROR(w,c,e) ((w)->wr_errclass = (c), (w)->wr_error = (e), \ + w->wr_discard = True, -1) +/* Macro to test if an error has been cached for this fnum */ +#define HAS_CACHED_ERROR(fsp) ((fsp)->wbmpx_ptr && \ + (fsp)->wbmpx_ptr->wr_discard) +/* Macro to turn the cached error into an error packet */ +#define CACHED_ERROR(fsp) cached_error_packet(outbuf,fsp,__LINE__,__FILE__) + /* these are the datagram types */ #define DGRAM_DIRECT_UNIQUE 0x10 -- cgit