2 * Unit tests for SystemFunction006 (LMHash?)
4 * Copyright 2004 Hans Leidekker
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #include "wine/test.h"
27 typedef VOID (WINAPI *fnSystemFunction006)( PCSTR passwd, PSTR lmhash );
28 fnSystemFunction006 pSystemFunction006;
30 static void test_SystemFunction006()
32 static unsigned char lmhash[16 + 1];
34 unsigned char passwd[] = { 's','e','c','r','e','t', 0, 0, 0, 0, 0, 0, 0, 0 };
35 unsigned char expect[] =
36 { 0x85, 0xf5, 0x28, 0x9f, 0x09, 0xdc, 0xa7, 0xeb,
37 0xaa, 0xd3, 0xb4, 0x35, 0xb5, 0x14, 0x04, 0xee };
39 pSystemFunction006( passwd, lmhash );
41 ok( !memcmp( lmhash, expect, sizeof(expect) ),
42 "lmhash: %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\n",
43 lmhash[0], lmhash[1], lmhash[2], lmhash[3], lmhash[4], lmhash[5],
44 lmhash[6], lmhash[7], lmhash[8], lmhash[9], lmhash[10], lmhash[11],
45 lmhash[12], lmhash[13], lmhash[14], lmhash[15] );
48 START_TEST(crypt_lmhash)
52 if (!(module = LoadLibrary("advapi32.dll"))) return;
54 pSystemFunction006 = (fnSystemFunction006)GetProcAddress( module, "SystemFunction006" );
56 if (!pSystemFunction006) goto out;
58 if (pSystemFunction006)
59 test_SystemFunction006();
62 FreeLibrary( module );