From d7c8fb21bb0a29bb7227d4b242aba2f1524f6c48 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 10 Aug 2010 07:44:15 +0200 Subject: s3: async cli_list --- source3/libsmb/clifile.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'source3/libsmb/clifile.c') diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c index 8965f6c71f..d6b2e31de7 100644 --- a/source3/libsmb/clifile.c +++ b/source3/libsmb/clifile.c @@ -91,6 +91,26 @@ uint8_t *smb_bytes_push_str(uint8_t *buf, bool ucs2, true, pconverted_size); } +uint8_t *smb_bytes_push_bytes(uint8_t *buf, uint8_t prefix, + const uint8_t *bytes, size_t num_bytes) +{ + size_t buflen; + + if (buf == NULL) { + return NULL; + } + buflen = talloc_get_size(buf); + + buf = TALLOC_REALLOC_ARRAY(NULL, buf, uint8_t, + buflen + 1 + num_bytes); + if (buf == NULL) { + return NULL; + } + buf[buflen] = prefix; + memcpy(&buf[buflen+1], bytes, num_bytes); + return buf; +} + /*********************************************************** Same as smb_bytes_push_str(), but without the odd byte align for ucs2 (we're pushing into a param or data block). -- cgit