advapi32: fix ProfileGuid length + simple test for it (found by Ben Collins)

Louis. Lenders xerox_xerox2000 at yahoo.co.uk
Tue Oct 17 17:08:21 CDT 2006


Skipped content of type multipart/alternative-------------- next part --------------
diff --git a/dlls/advapi32/Makefile.in b/dlls/advapi32/Makefile.in
diff --git a/dlls/advapi32/advapi.c b/dlls/advapi32/advapi.c
index 04a520a..552dd4b 100644
--- a/dlls/advapi32/advapi.c
+++ b/dlls/advapi32/advapi.c
@@ -118,7 +118,7 @@ BOOL WINAPI GetCurrentHwProfileA(LPHW_PR
 {
 	FIXME("(%p) semi-stub\n", pInfo);
 	pInfo->dwDockInfo = DOCKINFO_DOCKED;
-	strcpy(pInfo->szHwProfileGuid,"{12340001-1234-1234-1234-1233456789012}");
+	strcpy(pInfo->szHwProfileGuid,"{12340001-1234-1234-1234-123345678901}");
 	strcpy(pInfo->szHwProfileName,"Wine Profile");
 	return 1;
 }
diff --git a/dlls/advapi32/tests/Makefile.in b/dlls/advapi32/tests/Makefile.in
index e5d9a9f..c7f3c0d 100644
--- a/dlls/advapi32/tests/Makefile.in
+++ b/dlls/advapi32/tests/Makefile.in
@@ -7,6 +7,7 @@ IMPORTS   = ole32 advapi32 kernel32
 EXTRALIBS = -luuid
 
 CTESTS = \
+        advapi.c \
 	crypt.c \
 	crypt_lmhash.c \
 	crypt_md4.c \
diff --git a/dlls/advapi32/tests/advapi.c b/dlls/advapi32/tests/advapi.c
new file mode 100644
index 0000000..8da2543
--- /dev/null
+++ b/dlls/advapi32/tests/advapi.c
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2004 Louis Lenders
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "wine/test.h"
+
+static HMODULE hadvapi32;
+static BOOL (WINAPI *pGetCurrentHwProfileA)(LPHW_PROFILE_INFOA);
+
+static void init_function_pointers(void)
+{
+    hadvapi32 = LoadLibraryA("advapi32.dll");
+
+    if(hadvapi32)
+    {
+        pGetCurrentHwProfileA = (void*)GetProcAddress(hadvapi32, "GetCurrentHwProfileA");
+    }
+}
+
+
+static void test_GetCurrentHwProfileA(void)
+{
+    LPHW_PROFILE_INFOA pInfo ;
+    pInfo = HeapAlloc(GetProcessHeap(),0,sizeof(*pInfo));
+
+    ok(GetCurrentHwProfileA(pInfo), "GetCurrentHwProfileA failed\n");
+    /*Looks like pInfo->szHwProfileGuid has 38 characters in windows*/
+    ok(strlen(pInfo->szHwProfileGuid) == 38," pInfo->szHwProfileGuid has %d instead of 38 characters\n", strlen(pInfo->szHwProfileGuid));
+}
+
+START_TEST(advapi)
+{
+    init_function_pointers();
+    if(pGetCurrentHwProfileA) 
+    test_GetCurrentHwProfileA();
+}


More information about the wine-patches mailing list