/*
push a guid onto the wire. The buffer must hold 16 bytes
*/
-enum ndr_err_code smbcli_push_guid(void *base, uint16_t offset,
- const struct GUID *guid)
+NTSTATUS smbcli_push_guid(void *base, uint16_t offset, const struct GUID *guid)
{
TALLOC_CTX *tmp_ctx = talloc_new(NULL);
- enum ndr_err_code ndr_err;
+ NTSTATUS status;
DATA_BLOB blob;
- ndr_err = ndr_push_struct_blob(&blob, tmp_ctx, NULL,
- guid, (ndr_push_flags_fn_t)ndr_push_GUID);
- if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err) || blob.length != 16) {
+ status = GUID_to_ndr_blob(guid, tmp_ctx, &blob);
+ if (!NT_STATUS_IS_OK(status)) {
talloc_free(tmp_ctx);
- return ndr_err;
+ return status;
}
memcpy(offset + (uint8_t *)base, blob.data, blob.length);
talloc_free(tmp_ctx);
- return ndr_err;
+ return NT_STATUS_OK;
}
{
struct smb2_request *req;
uint16_t size = 0x24 + io->in.dialect_count*2;
- enum ndr_err_code ndr_err;
int i;
+ NTSTATUS status;
req = smb2_request_init(transport, SMB2_OP_NEGPROT, size, false, 0);
if (req == NULL) return NULL;
SSVAL(req->out.body, 0x04, io->in.security_mode);
SSVAL(req->out.body, 0x06, io->in.reserved);
SIVAL(req->out.body, 0x08, io->in.capabilities);
- ndr_err = smbcli_push_guid(req->out.body, 0x0C, &io->in.client_guid);
- if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ status = smbcli_push_guid(req->out.body, 0x0C, &io->in.client_guid);
+ if (!NT_STATUS_IS_OK(status)) {
talloc_free(req);
return NULL;
}