DPA_Create/Search may be missing

Francois Gouget fgouget at free.fr
Sun Jan 18 11:10:44 CST 2004


On Fri, 16 Jan 2004, Francois Gouget wrote:

>
> On NT4 (or is that on Internet Explorer <=5?), comctl32 is missing entry
> points for DPA_Create and DPA_Search. So we need to link them
> dynamically if we want the rest of the tests to run.

It turns out that the DPA functions are there. It's only that they are
only exported by ordinal and/or are missing from the MSVC import
libraries. So I modified the test to load them by ordinal and now the
test compiles, runs, does all the tests, eevn on Win95.


Changelog:

 * dlls/comctl32/tests/dpa.c

   Use GetProcAddress to load DPA_Create and DPA_Search by ordinal.
   Add '\n' to 'ok' calls.



Index: dlls/comctl32/tests/dpa.c
===================================================================
RCS file: /home/cvs/wine/dlls/comctl32/tests/dpa.c,v
retrieving revision 1.2
diff -u -r1.2 dpa.c
--- dlls/comctl32/tests/dpa.c	5 Sep 2003 23:08:42 -0000	1.2
+++ dlls/comctl32/tests/dpa.c	18 Jan 2004 15:53:00 -0000
@@ -29,11 +29,14 @@

 #include "wine/test.h"

+static HDPA (WINAPI *pDPA_Create)(int);
+static int (WINAPI *pDPA_Search)(HDPA,void*,int,PFNDPACOMPARE,LPARAM,UINT);
+
 static INT CALLBACK dpa_strcmp(LPVOID pvstr1, LPVOID pvstr2, LPARAM flags)
 {
   LPCSTR str1 = (LPCSTR)pvstr1;
   LPCSTR str2 = (LPCSTR)pvstr2;
-
+
   return lstrcmpA (str1, str2);
 }

@@ -42,19 +45,28 @@
   HDPA dpa_ret;
   INT  int_ret;
   CHAR test_str0[]="test0";
-
-  dpa_ret = DPA_Create(0);
-  ok((dpa_ret !=0), "DPA_Create failed");
-  int_ret = DPA_Search(dpa_ret,test_str0,0, dpa_strcmp,0, DPAS_SORTED);
-  ok((int_ret == -1), "DPA_Search found invalid item");
-  int_ret = DPA_Search(dpa_ret,test_str0,0, dpa_strcmp,0, DPAS_SORTED|DPAS_INSERTBEFORE);
-  ok((int_ret == 0), "DPA_Search proposed bad item");
-  int_ret = DPA_Search(dpa_ret,test_str0,0, dpa_strcmp,0, DPAS_SORTED|DPAS_INSERTAFTER);
-  ok((int_ret == 0), "DPA_Search proposed bad item");
+
+  if (!pDPA_Create || !pDPA_Search)
+      return;
+
+  dpa_ret = pDPA_Create(0);
+  ok((dpa_ret !=0), "DPA_Create failed\n");
+  int_ret = pDPA_Search(dpa_ret,test_str0,0, dpa_strcmp,0, DPAS_SORTED);
+  ok((int_ret == -1), "DPA_Search found invalid item\n");
+  int_ret = pDPA_Search(dpa_ret,test_str0,0, dpa_strcmp,0, DPAS_SORTED|DPAS_INSERTBEFORE);
+  ok((int_ret == 0), "DPA_Search proposed bad item\n");
+  int_ret = pDPA_Search(dpa_ret,test_str0,0, dpa_strcmp,0, DPAS_SORTED|DPAS_INSERTAFTER);
+  ok((int_ret == 0), "DPA_Search proposed bad item\n");
 }

 START_TEST(dpa)
 {
+    HMODULE hdll;
+
+    hdll=LoadLibraryA("comctl32.dll");
+    ok(hdll!=NULL,"Couldn't load kernel32.dll (%ld)\n",GetLastError());
+    pDPA_Create=(void*)GetProcAddress(hdll,(LPCSTR)328);
+    pDPA_Search=(void*)GetProcAddress(hdll,(LPCSTR)339);
+
     DPA_test();
-
 }


-- 
Francois Gouget         fgouget at free.fr        http://fgouget.free.fr/
                     Avoid the Gates of Hell - use Linux.



More information about the wine-patches mailing list