summaryrefslogtreecommitdiff
path: root/source3/include/smb_macros.h
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-10-19 00:56:03 +0000
committerJeremy Allison <jra@samba.org>2001-10-19 00:56:03 +0000
commit6cc3953196e3feb340f7b9b7bb823575414c5683 (patch)
tree28bf3943f76f952a8c2bb38e47dc22cadf38fffb /source3/include/smb_macros.h
parentb49b5b94818827da43dee53346ced84c789fd73d (diff)
downloadsamba-6cc3953196e3feb340f7b9b7bb823575414c5683.tar.gz
samba-6cc3953196e3feb340f7b9b7bb823575414c5683.tar.bz2
samba-6cc3953196e3feb340f7b9b7bb823575414c5683.zip
Restored old Bmpx code - actually used by OS/2.
Jeremy. (This used to be commit 7c1688fd67c1bda1477aaf870371c825280db870)
Diffstat (limited to 'source3/include/smb_macros.h')
-rw-r--r--source3/include/smb_macros.h12
1 files changed, 12 insertions, 0 deletions
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