Commit 8b0e2677 authored by Vijay Kiran Kamuju's avatar Vijay Kiran Kamuju Committed by Alexandre Julliard

msasn1: Add partial implementation of ASN1_CreateEncoder.

parent 54b237bc
/*
* Copyright 2014 Austin English
* Copyright 2020 Vijay Kiran Kamuju
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -91,3 +92,48 @@ void WINAPI ASN1_CloseModule(ASN1module_t module)
heap_free(module);
}
ASN1error_e WINAPI ASN1_CreateEncoder(ASN1module_t module, ASN1encoding_t *encoder, ASN1octet_t *buf,
ASN1uint32_t bufsize, ASN1encoding_t parent)
{
ASN1encoding_t enc;
TRACE("(%p %p %p %u %p)\n", module, encoder, buf, bufsize, parent);
if (!module || !encoder)
return ASN1_ERR_BADARGS;
enc = heap_alloc(sizeof(enc));
if (!enc)
{
return ASN1_ERR_MEMORY;
}
if (parent)
FIXME("parent not implemented.\n");
enc->magic = 0x44434e45;
enc->version = 0;
enc->module = module;
enc->buf = 0;
enc->size = 0;
enc->len = 0;
enc->err = ASN1_SUCCESS;
enc->bit = 0;
enc->pos = 0;
enc->cbExtraHeader = 0;
enc->eRule = module->eRule;
enc->dwFlags = module->dwFlags;
if (buf && bufsize)
{
enc->buf = buf;
enc->pos = buf;
enc->size = bufsize;
enc->dwFlags |= ASN1ENCODE_SETBUFFER;
}
*encoder = enc;
return ASN1_SUCCESS;
}
......@@ -222,7 +222,7 @@
@ stdcall ASN1_CloseModule(ptr)
@ stub ASN1_CreateDecoder
@ stub ASN1_CreateDecoderEx
@ stub ASN1_CreateEncoder
@ stdcall ASN1_CreateEncoder(ptr ptr ptr long ptr)
@ stdcall ASN1_CreateModule(long long long long ptr ptr ptr ptr long)
@ stub ASN1_Decode
@ stub ASN1_Encode
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment