Patch from Nicholas Brealey <nick@brealey.org> to distinguish between WinXP and WinXP64.
[ira/wip.git] / source / include / smb.h
index 350584a52e17ba010067c15ff71b4b1162bab959..4d18dc594fcef59576c073cbad7d6386e786d03a 100644 (file)
@@ -193,7 +193,7 @@ typedef uint32 codepoint_t;
 #define PIPE_NETLOGON_PLAIN "\\NETLOGON"
 
 #define PI_LSARPC              0
-#define PI_LSARPC_DS           1
+#define PI_DSSETUP             1
 #define PI_SAMR                        2
 #define PI_NETLOGON            3
 #define PI_SRVSVC              4
@@ -211,30 +211,6 @@ typedef uint32 codepoint_t;
 /* 64 bit time (100usec) since ????? - cifs6.txt, section 3.5, page 30 */
 typedef uint64_t NTTIME;
 
-
-/* Allowable account control bits */
-#define ACB_DISABLED                   0x00000001  /* 1 = User account disabled */
-#define ACB_HOMDIRREQ                  0x00000002  /* 1 = Home directory required */
-#define ACB_PWNOTREQ                   0x00000004  /* 1 = User password not required */
-#define ACB_TEMPDUP                    0x00000008  /* 1 = Temporary duplicate account */
-#define ACB_NORMAL                     0x00000010  /* 1 = Normal user account */
-#define ACB_MNS                                0x00000020  /* 1 = MNS logon user account */
-#define ACB_DOMTRUST                   0x00000040  /* 1 = Interdomain trust account */
-#define ACB_WSTRUST                    0x00000080  /* 1 = Workstation trust account */
-#define ACB_SVRTRUST                   0x00000100  /* 1 = Server trust account (BDC) */
-#define ACB_PWNOEXP                    0x00000200  /* 1 = User password does not expire */
-#define ACB_AUTOLOCK                   0x00000400  /* 1 = Account auto locked */
-
-/* only valid for > Windows 2000 */
-#define ACB_ENC_TXT_PWD_ALLOWED                0x00000800  /* 1 = Text password encryped */
-#define ACB_SMARTCARD_REQUIRED         0x00001000  /* 1 = Smart Card required */
-#define ACB_TRUSTED_FOR_DELEGATION     0x00002000  /* 1 = Trusted for Delegation */
-#define ACB_NOT_DELEGATED              0x00004000  /* 1 = Not delegated */
-#define ACB_USE_DES_KEY_ONLY           0x00008000  /* 1 = Use DES key only */
-#define ACB_DONT_REQUIRE_PREAUTH       0x00010000  /* 1 = Preauth not required */
-#define ACB_PWEXPIRED                  0x00020000  /* 1 = Password is expired */
-#define ACB_NO_AUTH_DATA_REQD          0x00080000  /* 1 = No authorization data required */
-
 #define MAX_HOURS_LEN 32
 
 #ifndef MAXSUBAUTHS
@@ -283,9 +259,6 @@ typedef struct dom_sid {
        uint32 sub_auths[MAXSUBAUTHS];  
 } DOM_SID;
 
-#define dom_sid2 dom_sid
-#define dom_sid28 dom_sid
-
 enum id_mapping {
        ID_UNKNOWN = 0,
        ID_MAPPED,
@@ -320,7 +293,7 @@ typedef struct data_blob {
 extern const DATA_BLOB data_blob_null;
 
 #include "librpc/gen_ndr/misc.h"
-#include "librpc/ndr/security.h"
+#include "librpc/gen_ndr/security.h"
 #include "librpc/ndr/libndr.h"
 #include "librpc/gen_ndr/lsa.h"
 #include "librpc/gen_ndr/dfs.h"
@@ -331,8 +304,12 @@ extern const DATA_BLOB data_blob_null;
 #include "librpc/gen_ndr/wkssvc.h"
 #include "librpc/gen_ndr/echo.h"
 #include "librpc/gen_ndr/svcctl.h"
+#include "librpc/gen_ndr/netlogon.h"
+#include "librpc/gen_ndr/samr.h"
+#include "librpc/gen_ndr/dssetup.h"
 #include "librpc/gen_ndr/libnet_join.h"
-
+#include "librpc/gen_ndr/krb5pac.h"
+#include "librpc/gen_ndr/ntsvcs.h"
 
 struct lsa_dom_info {
        bool valid;
@@ -443,6 +420,7 @@ struct timed_event;
 struct idle_event;
 struct share_mode_entry;
 struct uuid;
+struct named_mutex;
 
 struct vfs_fsp_data {
     struct vfs_fsp_data *next;
@@ -536,6 +514,8 @@ typedef struct files_struct {
        FAKE_FILE_HANDLE *fake_file_handle;
 
        struct notify_change_buf *notify;
+
+       struct files_struct *base_fsp; /* placeholder for delete on close */
 } files_struct;
 
 #include "ntquotas.h"
@@ -597,6 +577,16 @@ struct trans_state {
        char *data;
 };
 
+/*
+ * Info about an alternate data stream
+ */
+
+struct stream_struct {
+       SMB_OFF_T size;
+       SMB_OFF_T alloc_size;
+       char *name;
+};
+
 /* Include VFS stuff */
 
 #include "smb_acls.h"
@@ -1382,6 +1372,9 @@ struct bitmap {
 #define NTCREATEX_OPTIONS_PRIVATE_DENY_DOS     0x01000000
 #define NTCREATEX_OPTIONS_PRIVATE_DENY_FCB     0x02000000
 
+/* Private options for streams support */
+#define NTCREATEX_OPTIONS_PRIVATE_STREAM_DELETE 0x04000000
+
 /* Responses when opening a file. */
 #define FILE_WAS_SUPERSEDED 0
 #define FILE_WAS_OPENED 1
@@ -1578,7 +1571,7 @@ enum ldap_passwd_sync_types {LDAP_PASSWD_SYNC_ON, LDAP_PASSWD_SYNC_OFF, LDAP_PAS
 /* Remote architectures we know about. */
 enum remote_arch_types {RA_UNKNOWN, RA_WFWG, RA_OS2, RA_WIN95, RA_WINNT,
                        RA_WIN2K, RA_WINXP, RA_WIN2K3, RA_VISTA,
-                       RA_SAMBA, RA_CIFSFS};
+                       RA_SAMBA, RA_CIFSFS, RA_WINXP64};
 
 /* case handling */
 enum case_handling {CASE_LOWER,CASE_UPPER};
@@ -1912,6 +1905,8 @@ struct ea_list {
 #define SAMBA_POSIX_INHERITANCE_EA_NAME "user.SAMBA_PAI"
 /* EA to use for DOS attributes */
 #define SAMBA_XATTR_DOS_ATTRIB "user.DOSATTRIB"
+/* Prefix for DosStreams in the vfs_streams_xattr module */
+#define SAMBA_XATTR_DOSSTREAM_PREFIX "user.DosStream."
 
 #define UUID_SIZE 16
 
@@ -1942,4 +1937,15 @@ enum usershare_err {
 /* Different reasons for closing a file. */
 enum file_close_type {NORMAL_CLOSE=0,SHUTDOWN_CLOSE,ERROR_CLOSE};
 
+/* Used in SMB_FS_OBJECTID_INFORMATION requests.  Must be exactly 48 bytes. */
+#define SAMBA_EXTENDED_INFO_MAGIC 0x536d4261 /* "SmBa" */
+#define SAMBA_EXTENDED_INFO_VERSION_STRING_LENGTH 28
+struct smb_extended_info {
+       uint32 samba_magic;             /* Always SAMBA_EXTRA_INFO_MAGIC */
+       uint32 samba_version;           /* Major/Minor/Release/Revision */
+       uint32 samba_subversion;        /* Prerelease/RC/Vendor patch */
+       NTTIME samba_gitcommitdate;
+       char   samba_version_string[SAMBA_EXTENDED_INFO_VERSION_STRING_LENGTH];
+};
+
 #endif /* _SMB_H */