From c3a1e8731e581daa4c5b72238835c353298582e6 Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Sun, 21 May 2006 18:01:58 +0900 Subject: [PATCH] advapi32: Implement and test SystemFunction011. --- dlls/advapi32/advapi32.spec | 2 +- dlls/advapi32/crypt_md4.c | 1 + dlls/advapi32/tests/crypt_md4.c | 20 +++++++++++++------- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/dlls/advapi32/advapi32.spec b/dlls/advapi32/advapi32.spec index 2c136c9ccd5..af219859f7a 100644 --- a/dlls/advapi32/advapi32.spec +++ b/dlls/advapi32/advapi32.spec @@ -605,7 +605,7 @@ @ stdcall SystemFunction008(ptr ptr ptr) @ stdcall SystemFunction009(ptr ptr ptr) @ stdcall SystemFunction010(ptr ptr ptr) -@ stub SystemFunction011 +@ stdcall SystemFunction011(ptr ptr ptr) SystemFunction010 @ stdcall SystemFunction012(ptr ptr ptr) @ stdcall SystemFunction013(ptr ptr ptr) @ stdcall SystemFunction014(ptr ptr ptr) SystemFunction012 diff --git a/dlls/advapi32/crypt_md4.c b/dlls/advapi32/crypt_md4.c index f782ca03c1a..5ca895398ad 100644 --- a/dlls/advapi32/crypt_md4.c +++ b/dlls/advapi32/crypt_md4.c @@ -299,6 +299,7 @@ NTSTATUS WINAPI SystemFunction007(PUNICODE_STRING string, LPBYTE hash) /****************************************************************************** * SystemFunction010 [ADVAPI32.@] + * SystemFunction011 [ADVAPI32.@] * * MD4 hashes 16 bytes of data * diff --git a/dlls/advapi32/tests/crypt_md4.c b/dlls/advapi32/tests/crypt_md4.c index 0c72d2b40a5..e27f8b31175 100644 --- a/dlls/advapi32/tests/crypt_md4.c +++ b/dlls/advapi32/tests/crypt_md4.c @@ -40,13 +40,14 @@ typedef VOID (WINAPI *fnMD4Init)( MD4_CTX *ctx ); typedef VOID (WINAPI *fnMD4Update)( MD4_CTX *ctx, const unsigned char *src, const int len ); typedef VOID (WINAPI *fnMD4Final)( MD4_CTX *ctx ); typedef int (WINAPI *fnSystemFunction007)(PUNICODE_STRING,LPBYTE); -typedef int (WINAPI *fnSystemFunction010)(LPVOID, const LPBYTE, LPBYTE); +typedef int (WINAPI *md4hashfunc)(LPVOID, const LPBYTE, LPBYTE); fnMD4Init pMD4Init; fnMD4Update pMD4Update; fnMD4Final pMD4Final; fnSystemFunction007 pSystemFunction007; -fnSystemFunction010 pSystemFunction010; +md4hashfunc pSystemFunction010; +md4hashfunc pSystemFunction011; #define ctxcmp( a, b ) memcmp( (char*)a, (char*)b, FIELD_OFFSET( MD4_CTX, in ) ) @@ -126,7 +127,7 @@ static void test_SystemFunction007(void) ok(!memcmp(output, expected, sizeof expected), "response wrong\n"); } -static void test_SystemFunction010(void) +static void test_md4hashfunc(md4hashfunc func) { unsigned char expected[0x10] = { 0x48, 0x7c, 0x3f, 0x5e, 0x2b, 0x0d, 0x6a, 0x79, @@ -134,9 +135,12 @@ static void test_SystemFunction010(void) unsigned char in[0x10], output[0x10]; int r; + if (!func) + return; + memset(in, 0, sizeof in); memset(output, 0, sizeof output); - r = pSystemFunction010(0, in, output); + r = func(0, in, output); ok( r == STATUS_SUCCESS, "wrong error code\n"); ok( !memcmp(expected, output, sizeof output), "output wrong\n"); } @@ -158,9 +162,11 @@ START_TEST(crypt_md4) if (pSystemFunction007) test_SystemFunction007(); - pSystemFunction010 = (fnSystemFunction010)GetProcAddress( module, "SystemFunction010" ); - if (pSystemFunction010) - test_SystemFunction010(); + pSystemFunction010 = (md4hashfunc)GetProcAddress( module, "SystemFunction010" ); + pSystemFunction011 = (md4hashfunc)GetProcAddress( module, "SystemFunction011" ); + + test_md4hashfunc(pSystemFunction010); + test_md4hashfunc(pSystemFunction011); FreeLibrary( module ); }