summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-09-03 08:50:59 +0000
committerAndrew Tridgell <tridge@samba.org>2001-09-03 08:50:59 +0000
commitfd6ea431617d91c5f5c6b07cb26910f4900c1515 (patch)
treef079e0acc8629c45bf049f5bd58fe5b10e4b3d03 /source3/include
parent95739423d0116074a16b7b1c6b389ca2bbe34c7c (diff)
downloadsamba-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')
-rw-r--r--source3/include/config.h.in12
-rw-r--r--source3/include/doserr.h23
-rwxr-xr-xsource3/include/rpc_spoolss.h4
-rw-r--r--source3/include/smb.h20
4 files changed, 46 insertions, 13 deletions
diff --git a/source3/include/config.h.in b/source3/include/config.h.in
index 060f41bedb..4a64bec61e 100644
--- a/source3/include/config.h.in
+++ b/source3/include/config.h.in
@@ -220,6 +220,8 @@
#undef HAVE_NATIVE_ICONV
#undef HAVE_UNIXSOCKET
#undef MMAP_BLACKLIST
+#undef HAVE_IMMEDIATE_STRUCTURES
+#undef HAVE_CUPS
/* The number of bytes in a int. */
#undef SIZEOF_INT
@@ -761,6 +763,12 @@
/* Define if you have the <ctype.h> header file. */
#undef HAVE_CTYPE_H
+/* Define if you have the <cups/cups.h> header file. */
+#undef HAVE_CUPS_CUPS_H
+
+/* Define if you have the <cups/language.h> header file. */
+#undef HAVE_CUPS_LANGUAGE_H
+
/* Define if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H
@@ -983,8 +991,8 @@
/* Define if you have the acl library (-lacl). */
#undef HAVE_LIBACL
-/* Define if you have cups installed. */
-#undef HAVE_CUPS
+/* Define if you have the cups library (-lcups). */
+#undef HAVE_LIBCUPS
/* Define if you have the gen library (-lgen). */
#undef HAVE_LIBGEN
diff --git a/source3/include/doserr.h b/source3/include/doserr.h
index 9d39fe795e..ee6a27ee32 100644
--- a/source3/include/doserr.h
+++ b/source3/include/doserr.h
@@ -78,14 +78,6 @@
/* here's a special one from observing NT */
#define ERRnoipc 66 /* don't support ipc */
-/* These errors seem to be only returned by the NT printer driver system */
-
-#define ERRunknownprinterdriver 1797 /* ERROR_UNKNOWN_PRINTER_DRIVER */
-#define ERRinvalidprintername 1801 /* ERROR_INVALID_PRINTER_NAME */
-#define ERRinvaliddatatype 1804 /* ERROR_INVALID_DATATYPE */
-#define ERRinvalidenvironment 1805 /* ERROR_INVALID_ENVIRONMENT */
-#define ERRprinterdriverinuse 3001 /* ERROR_PRINTER_DRIVER_IN_USE */
-
/* Error codes for the ERRSRV class */
#define ERRerror 1 /* Non specific error code */
@@ -140,4 +132,19 @@
#define ERRsharebufexc 36 /* share buffer exceeded */
#define ERRdiskfull 39
+
+/* these are win32 error codes. There are only a few places where
+ these matter for Samba, primarily in the NT printing code */
+#define WERR_OK W_ERROR(0)
+#define WERR_BADFID W_ERROR(6)
+#define WERR_INSUFFICIENT_BUFFER W_ERROR(122)
+#define WERR_NOMEM W_ERROR(8)
+#define WERR_INVALID_NAME W_ERROR(123)
+#define WERR_UNKNOWN_LEVEL W_ERROR(124)
+#define WERR_UNKNOWN_PRINTER_DRIVER W_ERROR(1797)
+#define WERR_INVALID_PRINTER_NAME W_ERROR(1801)
+#define WERR_INVALID_DATATYPE W_ERROR(1804)
+#define WERR_INVALID_ENVIRONMENT W_ERROR(1805)
+#define WERR_PRINTER_DRIVER_IN_USE W_ERROR(3001)
+
#endif /* _DOSERR_H */
diff --git a/source3/include/rpc_spoolss.h b/source3/include/rpc_spoolss.h
index c57fc1bc42..4dba97b8ce 100755
--- a/source3/include/rpc_spoolss.h
+++ b/source3/include/rpc_spoolss.h
@@ -789,7 +789,7 @@ typedef struct printer_info_0
uint32 unknown16;
uint32 change_id;
uint32 unknown18;
- NTSTATUS status;
+ uint32 status;
uint32 unknown20;
uint32 c_setprinter;
@@ -832,7 +832,7 @@ typedef struct printer_info_2
uint32 defaultpriority;
uint32 starttime;
uint32 untiltime;
- NTSTATUS status;
+ uint32 status;
uint32 cjobs;
uint32 averageppm;
}
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 */