diff options
author | Andrew Tridgell <tridge@samba.org> | 2001-09-03 08:50:59 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2001-09-03 08:50:59 +0000 |
commit | fd6ea431617d91c5f5c6b07cb26910f4900c1515 (patch) | |
tree | f079e0acc8629c45bf049f5bd58fe5b10e4b3d03 /source3/include/smb.h | |
parent | 95739423d0116074a16b7b1c6b389ca2bbe34c7c (diff) | |
download | samba-fd6ea431617d91c5f5c6b07cb26910f4900c1515.tar.gz samba-fd6ea431617d91c5f5c6b07cb26910f4900c1515.tar.bz2 samba-fd6ea431617d91c5f5c6b07cb26910f4900c1515.zip |
the next step in our error code handling change
- added WERROR for win32 error codes
- added a configure test for immediate structures
still lots to do, so its not enabled by default, but the main
structure is there
(This used to be commit 24f9ab683dec52587ee56717e821b49c0fa3d70f)
Diffstat (limited to 'source3/include/smb.h')
-rw-r--r-- | source3/include/smb.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/source3/include/smb.h b/source3/include/smb.h index ce6f0c794a..2974766f2a 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -207,7 +207,13 @@ typedef struct nttime_info uint32 high; } NTTIME; -#ifdef __GNUC__XX_NOT_YET + +/* the following rather strange looking definitions of NTSTATUS and WERROR + and there in order to catch common coding errors where different error types + are mixed up. This is especially important as we slowly convert Samba + from using BOOL for internal functions +*/ +#if defined(HAVE_IMMEDIATE_STRUCTURES) && defined(TRIDGE_TEST) typedef struct {uint32 v;} NTSTATUS; #define NT_STATUS(x) ((NTSTATUS) { x }) #define NT_STATUS_V(x) ((x).v) @@ -217,8 +223,20 @@ typedef uint32 NTSTATUS; #define NT_STATUS_V(x) (x) #endif +#if defined(HAVE_IMMEDIATE_STRUCTURES) && defined(TRIDGE_TEST) +typedef struct {uint32 v;} WERROR; +#define W_ERROR(x) ((WERROR) { x }) +#define W_ERROR_V(x) ((x).v) +#else +typedef uint32 WERROR; +#define W_ERROR(x) (x) +#define W_ERROR_V(x) (x) +#endif + #define NT_STATUS_IS_OK(x) (NT_STATUS_V(x) == 0) #define NT_STATUS_IS_ERR(x) ((NT_STATUS_V(x) & 0xc0000000) == 0xc0000000) +#define W_ERROR_IS_OK(x) (W_ERROR_V(x) == 0) + /* Allowable account control bits */ #define ACB_DISABLED 0x0001 /* 1 = User account disabled */ |