Mike McCormack : advapi32: Implement and test SystemFunction009.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon May 22 05:19:22 CDT 2006
Module: wine
Branch: refs/heads/master
Commit: 64ae8285cd79bc89cfefe986998f115e3052e76b
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=64ae8285cd79bc89cfefe986998f115e3052e76b
Author: Mike McCormack <mike at codeweavers.com>
Date: Sun May 21 17:27:19 2006 +0900
advapi32: Implement and test SystemFunction009.
---
dlls/advapi32/advapi32.spec | 2 +-
dlls/advapi32/crypt_lmhash.c | 10 ++++++++++
dlls/advapi32/tests/crypt_lmhash.c | 26 ++++++++++++++++++++++++++
3 files changed, 37 insertions(+), 1 deletions(-)
diff --git a/dlls/advapi32/advapi32.spec b/dlls/advapi32/advapi32.spec
index 1187696..86a1b8d 100644
--- a/dlls/advapi32/advapi32.spec
+++ b/dlls/advapi32/advapi32.spec
@@ -603,7 +603,7 @@ # @ stub StopTraceW
@ stdcall SystemFunction006(ptr ptr)
@ stdcall SystemFunction007(ptr ptr)
@ stdcall SystemFunction008(ptr ptr ptr)
-@ stub SystemFunction009
+@ stdcall SystemFunction009(ptr ptr ptr)
@ stub SystemFunction010
@ stub SystemFunction011
@ stub SystemFunction012
diff --git a/dlls/advapi32/crypt_lmhash.c b/dlls/advapi32/crypt_lmhash.c
index 4760e97..8200abc 100644
--- a/dlls/advapi32/crypt_lmhash.c
+++ b/dlls/advapi32/crypt_lmhash.c
@@ -91,6 +91,16 @@ NTSTATUS WINAPI SystemFunction008(const
}
/******************************************************************************
+ * SystemFunction009 [ADVAPI32.@]
+ *
+ * Seems to do the same as SystemFunction008 ...
+ */
+NTSTATUS WINAPI SystemFunction009(const LPBYTE challenge, const LPBYTE hash, LPBYTE response)
+{
+ return SystemFunction008(challenge, hash, response);
+}
+
+/******************************************************************************
* SystemFunction001 [ADVAPI32.@]
*
* Encrypts a single block of data using DES
diff --git a/dlls/advapi32/tests/crypt_lmhash.c b/dlls/advapi32/tests/crypt_lmhash.c
index 866bbde..46f6ea4 100644
--- a/dlls/advapi32/tests/crypt_lmhash.c
+++ b/dlls/advapi32/tests/crypt_lmhash.c
@@ -41,6 +41,7 @@ typedef NTSTATUS (WINAPI *fnSystemFuncti
typedef NTSTATUS (WINAPI *fnSystemFunction005)(const struct ustring *, const struct ustring *, struct ustring *);
typedef VOID (WINAPI *fnSystemFunction006)( PCSTR passwd, PSTR lmhash );
typedef NTSTATUS (WINAPI *fnSystemFunction008)(const LPBYTE, const LPBYTE, LPBYTE);
+typedef NTSTATUS (WINAPI *fnSystemFunction009)(const LPBYTE, const LPBYTE, LPBYTE);
typedef NTSTATUS (WINAPI *fnSystemFunction032)(struct ustring *, struct ustring *);
fnSystemFunction001 pSystemFunction001;
@@ -50,6 +51,7 @@ fnSystemFunction004 pSystemFunction004;
fnSystemFunction004 pSystemFunction005;
fnSystemFunction006 pSystemFunction006;
fnSystemFunction008 pSystemFunction008;
+fnSystemFunction008 pSystemFunction009;
fnSystemFunction032 pSystemFunction032;
static void test_SystemFunction006(void)
@@ -333,6 +335,26 @@ static void test_SystemFunction005(void)
ok(r == STATUS_INVALID_PARAMETER_2, "function failed\n");
}
+static void test_SystemFunction009(void)
+{
+ unsigned char hash[0x10] = {
+ 0xff, 0x37, 0x50, 0xbc, 0xc2, 0xb2, 0x24, 0x12,
+ 0xc2, 0x26, 0x5b, 0x23, 0x73, 0x4e, 0x0d, 0xac };
+ unsigned char challenge[8] = {
+ 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef };
+ unsigned char expected[0x18] = {
+ 0xc3, 0x37, 0xcd, 0x5c, 0xbd, 0x44, 0xfc, 0x97,
+ 0x82, 0xa6, 0x67, 0xaf, 0x6d, 0x42, 0x7c, 0x6d,
+ 0xe6, 0x7c, 0x20, 0xc2, 0xd3, 0xe7, 0x7c, 0x56 };
+ unsigned char output[0x18];
+ int r;
+
+ memset(output, 0, sizeof output);
+ r = pSystemFunction009(challenge, hash, output);
+ ok( r == STATUS_SUCCESS, "wrong error code\n");
+ ok(!memcmp(output, expected, sizeof expected), "response wrong\n");
+}
+
START_TEST(crypt_lmhash)
{
HMODULE module;
@@ -367,6 +389,10 @@ START_TEST(crypt_lmhash)
if (pSystemFunction008)
test_SystemFunction008();
+ pSystemFunction009 = (fnSystemFunction009)GetProcAddress( module, "SystemFunction009" );
+ if (pSystemFunction009)
+ test_SystemFunction009();
+
pSystemFunction032 = (fnSystemFunction032)GetProcAddress( module, "SystemFunction032" );
if (pSystemFunction032)
test_SystemFunction032();
More information about the wine-cvs
mailing list