*/
_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;
}