diff options
author | Andrew Tridgell <tridge@samba.org> | 2008-02-14 17:11:36 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2008-02-14 17:11:36 +1100 |
commit | b640f475be9b0f83e7812a5c7756344c5891cba3 (patch) | |
tree | eb7c955f31379ae243f89004ff872054d80b764d /source4/libcli/smb2/request.c | |
parent | 4a04a5e620a4666fc123d04cb96ef391de72c469 (diff) | |
download | samba-b640f475be9b0f83e7812a5c7756344c5891cba3.tar.gz samba-b640f475be9b0f83e7812a5c7756344c5891cba3.tar.bz2 samba-b640f475be9b0f83e7812a5c7756344c5891cba3.zip |
updated SMB2 code for getinfo according to WSPP docs
- Updated getinfo structures and field names
- also updated the protocol revision number handling to reflect
new docs
(This used to be commit 3aaa2e86d94675c6c68d66d75292c3e34bfbc81b)
Diffstat (limited to 'source4/libcli/smb2/request.c')
-rw-r--r-- | source4/libcli/smb2/request.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/source4/libcli/smb2/request.c b/source4/libcli/smb2/request.c index 35229dc45f..7a0311f886 100644 --- a/source4/libcli/smb2/request.c +++ b/source4/libcli/smb2/request.c @@ -549,6 +549,33 @@ NTSTATUS smb2_pull_o32s32_blob(struct smb2_request_buffer *buf, TALLOC_CTX *mem_ } /* + pull a uint16_t ofs/ uint32_t length/blob triple from a data blob + the ptr points to the start of the offset/length pair + + In this varient the uint16_t is padded by an extra 2 bytes, making + the size aligned on 4 byte boundary +*/ +NTSTATUS smb2_pull_o16As32_blob(struct smb2_request_buffer *buf, TALLOC_CTX *mem_ctx, uint8_t *ptr, DATA_BLOB *blob) +{ + uint32_t ofs, size; + if (smb2_oob(buf, ptr, 8)) { + return NT_STATUS_BUFFER_TOO_SMALL; + } + ofs = SVAL(ptr, 0); + size = IVAL(ptr, 4); + if (ofs == 0 || size == 0) { + *blob = data_blob(NULL, 0); + return NT_STATUS_OK; + } + if (smb2_oob(buf, buf->hdr + ofs, size)) { + return NT_STATUS_BUFFER_TOO_SMALL; + } + *blob = data_blob_talloc(mem_ctx, buf->hdr + ofs, size); + NT_STATUS_HAVE_NO_MEMORY(blob->data); + return NT_STATUS_OK; +} + +/* pull a uint32_t length/ uint32_t ofs/blob triple from a data blob the ptr points to the start of the offset/length pair */ |