1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

librpc: Use GUID_to_ndr_buf() in GUID_to_ndr_blob()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2020-09-29 10:09:48 +02:00 committed by Jeremy Allison
parent bbb017637e
commit 29e3c0cdb7

View File

@ -44,14 +44,19 @@ _PUBLIC_ NTSTATUS GUID_to_ndr_buf(
*/
_PUBLIC_ NTSTATUS GUID_to_ndr_blob(const struct GUID *guid, TALLOC_CTX *mem_ctx, DATA_BLOB *b)
{
enum ndr_err_code ndr_err;
*b = data_blob_talloc(mem_ctx, NULL, 16);
struct GUID_ndr_buf buf = { .buf = {0}, };
NTSTATUS status;
status = GUID_to_ndr_buf(guid, &buf);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
*b = data_blob_talloc(mem_ctx, buf.buf, sizeof(buf.buf));
if (b->data == NULL) {
return NT_STATUS_NO_MEMORY;
}
ndr_err = ndr_push_struct_into_fixed_blob(
b, guid, (ndr_push_flags_fn_t)ndr_push_GUID);
return ndr_map_error2ntstatus(ndr_err);
return NT_STATUS_OK;
}