Vijay Kiran Kamuju : msasn1: Implement ASN1_CloseModule function.

Alexandre Julliard julliard at winehq.org
Tue Nov 10 13:46:20 CST 2020


Module: wine
Branch: stable
Commit: be2bece3abfcb9db3c8a8f0adb739f713db281cd
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=be2bece3abfcb9db3c8a8f0adb739f713db281cd

Author: Vijay Kiran Kamuju <infyquest at gmail.com>
Date:   Tue May  5 14:21:43 2020 +0200

msasn1: Implement ASN1_CloseModule function.

Signed-off-by: Vijay Kiran Kamuju <infyquest at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 0d2f30370067e194dfdcc72b3e675aaedcc2061b)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/msasn1/main.c       | 7 +++++++
 dlls/msasn1/msasn1.spec  | 2 +-
 dlls/msasn1/tests/asn1.c | 3 +++
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/dlls/msasn1/main.c b/dlls/msasn1/main.c
index 6882fbf6c9b..b30725aa63d 100644
--- a/dlls/msasn1/main.c
+++ b/dlls/msasn1/main.c
@@ -84,3 +84,10 @@ ASN1module_t WINAPI ASN1_CreateModule(ASN1uint32_t ver, ASN1encodingrule_e rule,
 
     return module;
 }
+
+void WINAPI ASN1_CloseModule(ASN1module_t module)
+{
+    TRACE("(%p)\n", module);
+
+    heap_free(module);
+}
diff --git a/dlls/msasn1/msasn1.spec b/dlls/msasn1/msasn1.spec
index ca6a461c650..09935f51492 100644
--- a/dlls/msasn1/msasn1.spec
+++ b/dlls/msasn1/msasn1.spec
@@ -219,7 +219,7 @@
 @ stub ASN1_CloseDecoder
 @ stub ASN1_CloseEncoder2
 @ stub ASN1_CloseEncoder
-@ stub ASN1_CloseModule
+@ stdcall ASN1_CloseModule(ptr)
 @ stub ASN1_CreateDecoder
 @ stub ASN1_CreateDecoderEx
 @ stub ASN1_CreateEncoder
diff --git a/dlls/msasn1/tests/asn1.c b/dlls/msasn1/tests/asn1.c
index adbf547efaf..80f4dd59901 100644
--- a/dlls/msasn1/tests/asn1.c
+++ b/dlls/msasn1/tests/asn1.c
@@ -55,6 +55,7 @@ static void test_CreateModule(void)
     ok(mod->acbStructSize==size, "Struct size = %p.\n",mod->acbStructSize);
     ok(!mod->PER.apfnEncoder, "Encoder function should not be s et.\n");
     ok(!mod->PER.apfnDecoder, "Decoder function should not be set.\n");
+    ASN1_CloseModule(mod);
 
     mod = ASN1_CreateModule(ASN1_THIS_VERSION, ASN1_BER_RULE_DER, ASN1FLAGS_NOASSERT, 1, encfn, decfn, freefn, size, name);
     ok(!!mod, "Failed to create module.\n");
@@ -66,6 +67,7 @@ static void test_CreateModule(void)
     ok(mod->acbStructSize==size, "Struct size = %p.\n",mod->acbStructSize);
     ok(mod->BER.apfnEncoder==(ASN1BerEncFun_t *)encfn, "Encoder function = %p.\n",mod->BER.apfnEncoder);
     ok(mod->BER.apfnDecoder==(ASN1BerDecFun_t *)decfn, "Decoder function = %p.\n",mod->BER.apfnDecoder);
+    ASN1_CloseModule(mod);
 
     mod = ASN1_CreateModule(ASN1_THIS_VERSION, ASN1_PER_RULE_ALIGNED, ASN1FLAGS_NOASSERT, 1, encfn, decfn, freefn, size, name);
     ok(!!mod, "Failed to create module.\n");
@@ -79,6 +81,7 @@ static void test_CreateModule(void)
        broken(!mod->PER.apfnEncoder), "Encoder function = %p.\n",mod->PER.apfnEncoder);
     ok(mod->PER.apfnDecoder==(ASN1PerDecFun_t *)decfn /* WINXP & WIN2008 */ ||
        broken(!mod->PER.apfnDecoder), "Decoder function = %p.\n",mod->PER.apfnDecoder);
+    ASN1_CloseModule(mod);
 }
 
 START_TEST(asn1)




More information about the wine-cvs mailing list