svn commit: samba r15814 - in branches/SAMBA_4_0/source: libcli/raw
ntvfs
metze at samba.org
metze at samba.org
Mon May 22 17:21:38 GMT 2006
Author: metze
Date: 2006-05-22 17:21:38 +0000 (Mon, 22 May 2006)
New Revision: 15814
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=15814
Log:
add SMB2 Lock interface structure
metze
Modified:
branches/SAMBA_4_0/source/libcli/raw/interfaces.h
branches/SAMBA_4_0/source/libcli/raw/rawfile.c
branches/SAMBA_4_0/source/ntvfs/ntvfs_generic.c
Changeset:
Modified: branches/SAMBA_4_0/source/libcli/raw/interfaces.h
===================================================================
--- branches/SAMBA_4_0/source/libcli/raw/interfaces.h 2006-05-22 17:12:22 UTC (rev 15813)
+++ branches/SAMBA_4_0/source/libcli/raw/interfaces.h 2006-05-22 17:21:38 UTC (rev 15814)
@@ -1781,7 +1781,12 @@
};
-enum smb_lock_level {RAW_LOCK_LOCK, RAW_LOCK_UNLOCK, RAW_LOCK_LOCKX};
+enum smb_lock_level {
+ RAW_LOCK_LOCK,
+ RAW_LOCK_UNLOCK,
+ RAW_LOCK_LOCKX,
+ RAW_LOCK_SMB2
+};
/* the generic interface is defined to be equal to the lockingX interface */
#define RAW_LOCK_GENERIC RAW_LOCK_LOCKX
@@ -1815,6 +1820,33 @@
uint32_t offset;
} in;
} lock, unlock;
+
+ /* SMB2 Lock */
+ struct smb2_lock {
+ enum smb_lock_level level;
+ struct {
+ union smb_handle file;
+
+ /* static body buffer 48 (0x30) bytes */
+ /* uint16_t buffer_code; 0x30 */
+ uint16_t unknown1; /* must be 0x0001 */
+ uint32_t unknown2;
+ /* struct smb2_handle handle; */
+ uint64_t offset;
+ uint64_t count;
+ uint32_t unknown5;
+#define SMB2_LOCK_FLAG_NONE 0x00000000
+#define SMB2_LOCK_FLAG_EXCLUSIV 0x00000002
+#define SMB2_LOCK_FLAG_UNLOCK 0x00000004
+#define SMB2_LOCK_FLAGS_MASK 0x00000006
+ uint32_t flags;
+ } in;
+ struct {
+ /* static body buffer 4 (0x04) bytes */
+ /* uint16_t buffer_code; 0x04 */
+ uint16_t unknown1;
+ } out;
+ } smb2;
};
Modified: branches/SAMBA_4_0/source/libcli/raw/rawfile.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/raw/rawfile.c 2006-05-22 17:12:22 UTC (rev 15813)
+++ branches/SAMBA_4_0/source/libcli/raw/rawfile.c 2006-05-22 17:21:38 UTC (rev 15814)
@@ -802,6 +802,8 @@
}
}
}
+ case RAW_LOCK_SMB2:
+ return NULL;
}
if (!smbcli_request_send(req)) {
Modified: branches/SAMBA_4_0/source/ntvfs/ntvfs_generic.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/ntvfs_generic.c 2006-05-22 17:12:22 UTC (rev 15813)
+++ branches/SAMBA_4_0/source/ntvfs/ntvfs_generic.c 2006-05-22 17:21:38 UTC (rev 15814)
@@ -969,6 +969,9 @@
lck2->generic.in.ulock_cnt = 1;
lck2->generic.in.lock_cnt = 0;
break;
+
+ case RAW_LOCK_SMB2:
+ return NT_STATUS_INVALID_LEVEL;
}
lck2->generic.level = RAW_LOCK_GENERIC;
More information about the samba-cvs
mailing list