stick the winetests in the sub folder with the other regtests
Added: trunk/reactos/regtests/winetests/
Added: trunk/reactos/regtests/winetests/advapi32/
Modified: trunk/reactos/regtests/winetests/advapi32/registry.c
Modified: trunk/reactos/regtests/winetests/advapi32/security.c
Modified: trunk/reactos/regtests/winetests/advapi32/testlist.c
Added: trunk/reactos/regtests/winetests/comctl32/
Modified: trunk/reactos/regtests/winetests/comctl32/dpa.c
Modified: trunk/reactos/regtests/winetests/comctl32/imagelist.c
Modified: trunk/reactos/regtests/winetests/comctl32/mru.c
Modified: trunk/reactos/regtests/winetests/comctl32/subclass.c
Modified: trunk/reactos/regtests/winetests/comctl32/tab.c
Modified: trunk/reactos/regtests/winetests/comctl32/testlist.c
Added: trunk/reactos/regtests/winetests/msvcrt/
Added: trunk/reactos/regtests/winetests/version/
Added: trunk/reactos/regtests/winetests/winetest/
Modified: trunk/reactos/regtests/winetests/winetest/dist.rc
Modified: trunk/reactos/regtests/winetests/winetest/gui.c
Modified: trunk/reactos/regtests/winetests/winetest/main.c
Modified: trunk/reactos/regtests/winetests/winetest/resource.h
Modified: trunk/reactos/regtests/winetests/winetest/send.c
Modified: trunk/reactos/regtests/winetests/winetest/tests.rc
Modified: trunk/reactos/regtests/winetests/winetest/util.c
Modified: trunk/reactos/regtests/winetests/winetest/winetest.h
Modified: trunk/reactos/regtests/winetests/winetest/winetest.rc

Copied: trunk/reactos/regtests/winetests/advapi32 (from rev 17052, trunk/reactos/lib/advapi32/winetests)

Modified: trunk/reactos/regtests/winetests/advapi32/registry.c
--- trunk/reactos/lib/advapi32/winetests/registry.c	2005-08-05 01:25:43 UTC (rev 17052)
+++ trunk/reactos/regtests/winetests/advapi32/registry.c	2005-08-06 18:02:57 UTC (rev 17106)
@@ -428,7 +428,6 @@
     setup_main_key();
     create_test_entries();
     test_enum_value();
-#if 0
     test_query_value_ex();
     test_reg_open_key();
     test_reg_close_key();
@@ -445,7 +444,6 @@
         set_privileges(SE_BACKUP_NAME, FALSE);
         set_privileges(SE_RESTORE_NAME, FALSE);
     }
-#endif
     /* cleanup */
     delete_key( hkey_main );
 }

Modified: trunk/reactos/regtests/winetests/advapi32/security.c
--- trunk/reactos/lib/advapi32/winetests/security.c	2005-08-05 01:25:43 UTC (rev 17052)
+++ trunk/reactos/regtests/winetests/advapi32/security.c	2005-08-06 18:02:57 UTC (rev 17106)
@@ -424,7 +424,8 @@
     strcpy(directory, "\\Should not exist");
 
     SetLastError(NO_ERROR);
-    result = pGetFileSecurityA( directory,OWNER_SECURITY_INFORMATION,buffer,0x40,&outSize);
+    result = GetFileSecurityA( directory,OWNER_SECURITY_INFORMATION,
+                              (PSECURITY_DESCRIPTOR)buffer,0x40,&outSize);
     ok(!result, "GetFileSecurityA should fail for not existing directories/files\n");
     ok( (GetLastError() == ERROR_FILE_NOT_FOUND ) ||
         (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) ,

Modified: trunk/reactos/regtests/winetests/advapi32/testlist.c
--- trunk/reactos/lib/advapi32/winetests/testlist.c	2005-08-05 01:25:43 UTC (rev 17052)
+++ trunk/reactos/regtests/winetests/advapi32/testlist.c	2005-08-06 18:02:57 UTC (rev 17106)
@@ -7,11 +7,6 @@
 #include "windef.h"
 #include "winbase.h"
 
-extern void func_crypt(void);
-extern void func_crypt_lmhash(void);
-extern void func_crypt_md4(void);
-extern void func_crypt_md5(void);
-extern void func_crypt_sha(void);
 extern void func_registry(void);
 extern void func_security(void);
 
@@ -23,11 +18,6 @@
 
 static const struct test winetest_testlist[] =
 {
-    { "crypt", func_crypt },
-    { "crypt_lmhash", func_crypt_lmhash },
-    { "crypt_md4", func_crypt_md4 },
-    { "crypt_md5", func_crypt_md5 },
-    { "crypt_sha", func_crypt_sha },
     { "registry", func_registry },
     { "security", func_security },
     { 0, 0 }

Copied: trunk/reactos/regtests/winetests/comctl32 (from rev 17052, trunk/reactos/lib/comctl32/winetests)

Modified: trunk/reactos/regtests/winetests/comctl32/dpa.c
--- trunk/reactos/lib/comctl32/winetests/dpa.c	2005-08-05 01:25:43 UTC (rev 17052)
+++ trunk/reactos/regtests/winetests/comctl32/dpa.c	2005-08-06 18:02:57 UTC (rev 17106)
@@ -2,6 +2,7 @@
  * Unit tests for DPA functions
  *
  * Copyright 2003 Uwe Bonnes
+ * Copyright 2005 Felix Nawothnig
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -18,63 +19,421 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#define COBJMACROS
+
 #include <stdarg.h>
 
-#include "windef.h"
-#include "winbase.h"
-#include "wingdi.h"
-#include "winuser.h"
+#include "windows.h"
 #include "commctrl.h"
+#include "objidl.h"
 
 #include "wine/test.h"
 
-static HDPA (WINAPI *pDPA_Create)(int);
-static BOOL (WINAPI *pDPA_Grow)(const HDPA hdpa, INT nGrow);
-static BOOL (WINAPI *pDPA_Destroy)(const HDPA hdpa);
-static BOOL (WINAPI *pDPA_SetPtr)(const HDPA hdpa, INT i, LPVOID p);
+#define DPAM_NOSORT 0x1
+#define DPAM_INSERT 0x4
+#define DPAM_DELETE 0x8
 
-static INT CALLBACK dpa_strcmp(LPVOID pvstr1, LPVOID pvstr2, LPARAM flags)
+typedef struct _ITEMDATA
 {
-  LPCSTR str1 = (LPCSTR)pvstr1;
-  LPCSTR str2 = (LPCSTR)pvstr2;
+    INT   iPos;
+    PVOID pvData;
+} ITEMDATA, *LPITEMDATA;
 
-  return lstrcmpA (str1, str2);
+typedef PVOID   (CALLBACK *PFNDPAMERGE)(UINT,PVOID,PVOID,LPARAM);
+typedef HRESULT (CALLBACK *PFNDPASTM)(LPITEMDATA,IStream*,LPARAM);
+
+static HDPA    (WINAPI *pDPA_Clone)(const HDPA,const HDPA);
+static HDPA    (WINAPI *pDPA_Create)(INT);
+static HDPA    (WINAPI *pDPA_CreateEx)(INT,HANDLE);
+static PVOID   (WINAPI *pDPA_DeleteAllPtrs)(const HDPA);
+static PVOID   (WINAPI *pDPA_DeletePtr)(const HDPA,INT);
+static BOOL    (WINAPI *pDPA_Destroy)(const HDPA);
+static VOID    (WINAPI *pDPA_DestroyCallback)(HDPA,PFNDPAENUMCALLBACK,PVOID);
+static VOID    (WINAPI *pDPA_EnumCallback)(HDPA,PFNDPAENUMCALLBACK,PVOID); 
+static INT     (WINAPI *pDPA_GetPtr)(const HDPA,INT);
+static INT     (WINAPI *pDPA_GetPtrIndex)(const HDPA,PVOID);
+static BOOL    (WINAPI *pDPA_Grow)(HDPA,INT);
+static INT     (WINAPI *pDPA_InsertPtr)(const HDPA,INT,PVOID);
+static HRESULT (WINAPI *pDPA_LoadStream)(HDPA*,PFNDPASTM,IStream*,LPARAM);
+static BOOL    (WINAPI *pDPA_Merge)(const HDPA,const HDPA,DWORD,PFNDPACOMPARE,PFNDPAMERGE,LPARAM);
+static HRESULT (WINAPI *pDPA_SaveStream)(HDPA,PFNDPASTM,IStream*,LPARAM);
+static INT     (WINAPI *pDPA_Search)(HDPA,PVOID,INT,PFNDPACOMPARE,LPARAM,UINT);
+static BOOL    (WINAPI *pDPA_SetPtr)(const HDPA,INT,PVOID);
+static BOOL    (WINAPI *pDPA_Sort)(const HDPA,PFNDPACOMPARE,LPARAM);
+
+#define COMCTL32_GET_PROC(func, ord) \
+  ((p ## func = (PVOID)GetProcAddress(hcomctl32,(LPCSTR)ord)) ? 1 \
+   : (trace( #func " not exported\n"), 0)) 
+
+static BOOL InitFunctionPtrs(HMODULE hcomctl32)
+{
+    /* 4.00+ */
+    if(COMCTL32_GET_PROC(DPA_Clone, 331) &&
+       COMCTL32_GET_PROC(DPA_Create, 328) &&
+       COMCTL32_GET_PROC(DPA_CreateEx, 340) &&
+       COMCTL32_GET_PROC(DPA_DeleteAllPtrs, 337) &&
+       COMCTL32_GET_PROC(DPA_DeletePtr, 336) &&
+       COMCTL32_GET_PROC(DPA_Destroy, 329) &&
+       COMCTL32_GET_PROC(DPA_GetPtr, 332) &&
+       COMCTL32_GET_PROC(DPA_GetPtrIndex, 333) &&
+       COMCTL32_GET_PROC(DPA_Grow, 330) &&
+       COMCTL32_GET_PROC(DPA_InsertPtr, 334) &&
+       COMCTL32_GET_PROC(DPA_Search, 339) &&
+       COMCTL32_GET_PROC(DPA_SetPtr, 335) &&
+       COMCTL32_GET_PROC(DPA_Sort, 338))
+    {
+        /* 4.71+ */
+        COMCTL32_GET_PROC(DPA_DestroyCallback, 386) &&
+        COMCTL32_GET_PROC(DPA_EnumCallback, 385) &&
+        COMCTL32_GET_PROC(DPA_LoadStream, 9) &&
+        COMCTL32_GET_PROC(DPA_Merge, 11) &&
+        COMCTL32_GET_PROC(DPA_SaveStream, 10);
+
+        return TRUE;
+    }
+
+    return FALSE;
 }
 
-void DPA_test()
+/* Callbacks */
+static INT CALLBACK CB_CmpLT(PVOID p1, PVOID p2, LPARAM lp)
 {
-  HDPA dpa_ret;
-  INT  int_ret;
-  CHAR test_str0[]="test0";
+    ok(lp == 0xdeadbeef, "lp=%ld\n", lp);
+    return p1 < p2 ? -1 : p1 > p2 ? 1 : 0;
+}
 
-  if (!pDPA_Create)
-      return;
+static INT CALLBACK CB_CmpGT(PVOID p1, PVOID p2, LPARAM lp)
+{
+    ok(lp == 0xdeadbeef, "lp=%ld\n", lp);
+    return p1 > p2 ? -1 : p1 < p2 ? 1 : 0;
+}
 
-  dpa_ret = pDPA_Create(0);
-  ok((dpa_ret !=0), "DPA_Create failed\n");
-  int_ret = DPA_Search(dpa_ret,test_str0,0, dpa_strcmp,0, DPAS_SORTED);
-  ok((int_ret == -1), "DPA_Search found invalid item\n");
-  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\n");
-  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\n");
-  int_ret = pDPA_Grow(dpa_ret,0);
-  ok(int_ret != 0, "DPA_Grow failed\n");
-  int_ret = pDPA_SetPtr(dpa_ret, 0, (void*)0xdeadbeef);
-  ok(int_ret != 0, "DPA_SetPtr failed\n");
-  int_ret = pDPA_Destroy(dpa_ret);
-  ok(int_ret != 0, "DPA_Destory failed\n");
+static PVOID CALLBACK CB_MergeInsertSrc(UINT op, PVOID p1, PVOID p2, LPARAM lp)
+{
+    ok(lp == 0xdeadbeef, "lp=%ld\n", lp);
+    return p1;
+}        
+
+static PVOID CALLBACK CB_MergeDeleteOddSrc(UINT op, PVOID p1, PVOID p2, LPARAM lp)
+{
+    ok(lp == 0xdeadbeef, "lp=%ld\n", lp);
+    return ((PCHAR)p2)+1;
 }
 
+static INT nEnum;
+
+static INT CALLBACK CB_EnumFirstThree(PVOID pItem, PVOID lp)
+{   
+    INT i;
+
+    i = pDPA_GetPtrIndex(lp, pItem);
+    ok(i == nEnum, "i=%d nEnum=%d\n", i, nEnum);
+    nEnum++;
+    pDPA_SetPtr(lp, i, (PVOID)7);
+    return pItem != (PVOID)3;
+}
+
+static HRESULT CALLBACK CB_Save(LPITEMDATA pInfo, IStream *pStm, LPARAM lp)
+{
+    HRESULT hRes;
+    
+    ok(lp == 0xdeadbeef, "lp=%ld\n", lp);
+    hRes = IStream_Write(pStm, &pInfo->iPos, sizeof(INT), NULL);
+    ok(hRes == S_OK, "hRes=0x%lx\n", hRes);
+    hRes = IStream_Write(pStm, &pInfo->pvData, sizeof(PVOID), NULL);
+    ok(hRes == S_OK, "hRes=0x%lx\n", hRes);
+    return S_OK;
+}
+
+static HRESULT CALLBACK CB_Load(LPITEMDATA pInfo, IStream *pStm, LPARAM lp)
+{
+    HRESULT hRes;
+    INT iOldPos;
+    
+    iOldPos = pInfo->iPos;
+    ok(lp == 0xdeadbeef, "lp=%ld\n", lp);
+    hRes = IStream_Read(pStm, &pInfo->iPos, sizeof(INT), NULL);
+    ok(hRes == S_OK, "hRes=0x%lx\n", hRes);
+    ok(pInfo->iPos == iOldPos, "iPos=%d iOldPos=%d\n", pInfo->iPos, iOldPos);
+    hRes = IStream_Read(pStm, &pInfo->pvData, sizeof(PVOID), NULL);
+    ok(hRes == S_OK, "hRes=0x%lx\n", hRes);
+    return S_OK;
+}
+
+static BOOL CheckDPA(HDPA dpa, DWORD dwIn, PDWORD pdwOut)
+{
+    DWORD dwOut = 0;
+    INT i;
+
+    for(i = 0; i < 8;)
+    {
+        ULONG_PTR ulItem = (ULONG_PTR)pDPA_GetPtr(dpa, i++);
+        if(!ulItem) break;
+        dwOut = dwOut << 4 | (ulItem & 0xf);
+    }
+    
+    *pdwOut = dwOut;
+
+    if(dwOut != dwIn)
+    {
+        pDPA_DeleteAllPtrs(dpa);
+        
+        do
+        {
+            pDPA_InsertPtr(dpa, 0, (PVOID)(dwIn & 0xf));
+            dwIn >>= 4;
+        }
+        while(dwIn);
+        
+        return FALSE;
+    }
+    
+    return TRUE;
+}
+
+static void test_dpa(void)
+{
+    SYSTEM_INFO si;
+    HANDLE hHeap;
+    HDPA dpa, dpa2, dpa3;
+    INT ret, i;
+    PVOID p;
+    DWORD dw, dw2, dw3;
+    HRESULT hRes;
+    
+    GetSystemInfo(&si);
+    hHeap = HeapCreate(0, 1, 2);
+    ok(hHeap != NULL, "error=%ld\n", GetLastError());
+    dpa3 = pDPA_CreateEx(0, hHeap);
+    ok(dpa3 != NULL, "\n");
+    ret = pDPA_Grow(dpa3, si.dwPageSize + 1);
+    todo_wine ok(!ret && GetLastError() == ERROR_NOT_ENOUGH_MEMORY, 
+       "ret=%d error=%ld\n", ret, GetLastError());
+        
+    dpa = pDPA_Create(0);
+    ok(dpa != NULL, "\n");
+
+    /* Set item with out of bound index */
+    ok(pDPA_SetPtr(dpa, 1, (PVOID)6), "\n");
+    /* Fill the greated gap */
+    ok(pDPA_SetPtr(dpa, 0, (PVOID)5), "\n");
+    ok(CheckDPA(dpa, 0x56, &dw), "dw=0x%lx\n", dw);
+    
+    /* Prepend item */
+    ret = pDPA_InsertPtr(dpa, 1, (PVOID)1);
+    ok(ret == 1, "ret=%d\n", ret);
+    /* Append item using correct index */
+    ret = pDPA_InsertPtr(dpa, 3, (PVOID)3);
+    ok(ret == 3, "ret=%d\n", ret);
+    /* Append item using out of bound index */
+    ret = pDPA_InsertPtr(dpa, 5, (PVOID)2);
+    ok(ret == 4, "ret=%d\n", ret);
+    /* Append item using DPA_APPEND */ 
+    ret = pDPA_InsertPtr(dpa, DPA_APPEND, (PVOID)4);
+    ok(ret == 5, "ret=%d\n", ret);
+
+    ok(CheckDPA(dpa, 0x516324, &dw), "dw=0x%lx\n", dw);
+
+    for(i = 1; i <= 6; i++)
+    {
+        INT j, k;
+        k = pDPA_GetPtrIndex(dpa, (PVOID)i);
+        /* Linear searches should work on unsorted DPAs */
+        j = pDPA_Search(dpa, (PVOID)i, 0, CB_CmpLT, 0xdeadbeef, 0);
+        ok(j == k, "j=%d k=%d\n", j, k);
+    }
+
+    /* Sort DPA */
+    ok(pDPA_Sort(dpa, CB_CmpGT, 0xdeadbeef), "\n");
+    ok(CheckDPA(dpa, 0x654321, &dw), "dw=0x%lx\n", dw);
+    
+    /* Clone into a new DPA */
+    dpa2 = pDPA_Clone(dpa, NULL);
+    ok(dpa2 != NULL, "\n");
+    /* The old data should have been preserved */
+    ok(CheckDPA(dpa2, 0x654321, &dw2), "dw=0x%lx\n", dw2);
+    ok(pDPA_Sort(dpa, CB_CmpLT, 0xdeadbeef), "\n");
+    
+    /* Test if the DPA itself was really copied */
+    ok(CheckDPA(dpa,  0x123456, &dw),  "dw=0x%lx\n",  dw );
+    ok(CheckDPA(dpa2, 0x654321, &dw2), "dw2=0x%lx\n", dw2);
+
+    /* Clone into an old DPA */
+    p = NULL; SetLastError(ERROR_SUCCESS);
+    p = pDPA_Clone(dpa, dpa3);
+    ok(p == dpa3, "p=%p\n", p);
+    ok(CheckDPA(dpa3, 0x123456, &dw3), "dw3=0x%lx\n", dw3);
+
+    for(i = 1; i <= 6; i++)
+    {
+        INT j;
+
+        /* The array is in order so ptr == index+1 */
+        j = pDPA_GetPtrIndex(dpa, (PVOID)i);
+        ok(j+1 == i, "j=%d i=%d\n", j, i);
+        j = pDPA_Search(dpa, (PVOID)i, 0, CB_CmpLT, 0xdeadbeef, DPAS_SORTED);
+        ok(j+1 == i, "j=%d i=%d\n", j, i);
+
+        /* Linear searches respect iStart ... */
+        j = pDPA_Search(dpa, (PVOID)i, i+1, CB_CmpLT, 0xdeadbeef, 0);
+        ok(j == DPA_ERR, "j=%d\n", j);
+        /* ... but for a binary search it's ignored */
+        j = pDPA_Search(dpa, (PVOID)i, i+1, CB_CmpLT, 0xdeadbeef, DPAS_SORTED);
+        todo_wine ok(j+1 == i, "j=%d i=%d\n", j, i);
+    }
+    
+    /* Try to get the index of a nonexistent item */
+    i = pDPA_GetPtrIndex(dpa, (PVOID)7);
+    ok(i == DPA_ERR, "i=%d\n", i);
+    
+    /* Try to delete out of bound indexes */
+    p = pDPA_DeletePtr(dpa, -1);
+    ok(p == NULL, "p=%p\n", p);
+    p = pDPA_DeletePtr(dpa, 6);
+    ok(p == NULL, "p=%p\n", p);
+
+    /* Delete the third item */
+    p = pDPA_DeletePtr(dpa, 2);
+    ok(p == (PVOID)3, "p=%p\n", p);
+    ok(CheckDPA(dpa, 0x12456, &dw), "dw=0x%lx\n", dw);
+
+    /* Check where to re-insert the deleted item */
+    i = pDPA_Search(dpa, (PVOID)3, 0, 
+                    CB_CmpLT, 0xdeadbeef, DPAS_SORTED|DPAS_INSERTAFTER);
+    ok(i == 2, "i=%d\n", i);
+    /* DPAS_INSERTBEFORE works just like DPAS_INSERTAFTER */
+    i = pDPA_Search(dpa, (PVOID)3, 0,
+                    CB_CmpLT, 0xdeadbeef, DPAS_SORTED|DPAS_INSERTBEFORE);
+    ok(i == 2, "i=%d\n", i);
+    /* without DPAS_INSERTBEFORE/AFTER */
+    i = pDPA_Search(dpa, (PVOID)3, 0,
+                    CB_CmpLT, 0xdeadbeef, DPAS_SORTED);
+    ok(i == -1, "i=%d\n", i);
+
+    /* Re-insert the item */
+    ret = pDPA_InsertPtr(dpa, 2, (PVOID)3);
+    ok(ret == 2, "ret=%d i=%d\n", ret, 2);
+    ok(CheckDPA(dpa, 0x123456, &dw), "dw=0x%lx\n", dw);
+    
+    /* When doing a binary search while claiming reverse order all indexes
+     * should be bogus */
+    for(i = 0; i < 6; i++)
+    {
+        INT j = pDPA_Search(dpa, (PVOID)i, 0, CB_CmpGT, 0xdeadbeef,
+                            DPAS_SORTED|DPAS_INSERTBEFORE);
+        ok(j != i, "i=%d\n", i);
+    }
+
+    if(pDPA_Merge)
+    {
+        /* Delete all even entries from dpa */
+        p = pDPA_DeletePtr(dpa, 1);
+        p = pDPA_DeletePtr(dpa, 2);
+        p = pDPA_DeletePtr(dpa, 3);
+        ok(CheckDPA(dpa, 0x135, &dw), "dw=0x%lx\n", dw);
+    
+        /* Delete all odd entries from dpa2 */
+        pDPA_Merge(dpa2, dpa, DPAM_DELETE, 
+                   CB_CmpLT, CB_MergeDeleteOddSrc, 0xdeadbeef);
+        todo_wine ok(CheckDPA(dpa2, 0x246, &dw2), "dw=0x%lx\n", dw2);
+    
+        /* Merge dpa3 into dpa2 and dpa */
+        pDPA_Merge(dpa, dpa3, DPAM_INSERT|DPAM_NOSORT, 
+                   CB_CmpLT, CB_MergeInsertSrc, 0xdeadbeef);
+        pDPA_Merge(dpa2, dpa3, DPAM_INSERT|DPAM_NOSORT, 
+                   CB_CmpLT, CB_MergeInsertSrc, 0xdeadbeef);
+    
+        ok(CheckDPA(dpa,  0x123456, &dw ), "dw=0x%lx\n",  dw);
+        ok(CheckDPA(dpa2, 0x123456, &dw2), "dw2=0x%lx\n", dw2);
+        ok(CheckDPA(dpa3, 0x123456, &dw3), "dw3=0x%lx\n", dw3);
+    }
+
+    if(pDPA_EnumCallback)
+    {
+        nEnum = 0;
+        pDPA_EnumCallback(dpa2, CB_EnumFirstThree, (PVOID)dpa2);
+        ok(CheckDPA(dpa2, 0x777456, &dw2), "dw=0x%lx\n", dw2);
+        ok(nEnum == 3, "nEnum=%d\n", nEnum);
+    }
+    
+    /* Setting item with huge index should work */
+    ok(pDPA_SetPtr(dpa2, 0x12345, (PVOID)0xdeadbeef), "\n");
+    ret = pDPA_GetPtrIndex(dpa2, (PVOID)0xdeadbeef);
+    ok(ret == 0x12345, "ret=%d\n", ret);
+          
+    pDPA_DeleteAllPtrs(dpa2);
+    ok(CheckDPA(dpa2, 0, &dw2), "dw2=0x%lx\n", dw2);
+    pDPA_Destroy(dpa2);
+
+    if(pDPA_DestroyCallback)
+    {
+        nEnum = 0;
+        pDPA_DestroyCallback(dpa3, CB_EnumFirstThree, dpa3);
+        ok(nEnum == 3, "nEnum=%d\n", nEnum);
+    }
+    else pDPA_Destroy(dpa3);
+
+    if(!pDPA_SaveStream)
+        goto skip_stream_tests;
+
+    hRes = CoInitialize(NULL);
+    if(hRes == S_OK)
+    {
+        static const WCHAR szStg[] = { 'S','t','g',0 };
+        IStorage* pStg = NULL;
+        IStream* pStm = NULL;
+        LARGE_INTEGER liZero;
+        DWORD dwMode;
+        liZero.QuadPart = 0;
+
+        dwMode = STGM_DIRECT|STGM_CREATE|STGM_READWRITE|STGM_SHARE_EXCLUSIVE;
+        hRes = StgCreateDocfile(NULL, dwMode|STGM_DELETEONRELEASE, 0, &pStg);
+        ok(hRes == S_OK, "hRes=0x%lx\n", hRes);
+
+        hRes = IStorage_CreateStream(pStg, szStg, dwMode, 0, 0, &pStm);
+        ok(hRes == S_OK, "hRes=0x%lx\n", hRes);
+
+        hRes = pDPA_SaveStream(dpa, CB_Save, pStm, 0xdeadbeef);
+        todo_wine ok(hRes == S_OK, "hRes=0x%lx\n", hRes);
+        pDPA_Destroy(dpa);
+        
+        hRes = IStream_Seek(pStm, liZero, STREAM_SEEK_SET, NULL);
+        ok(hRes == S_OK, "hRes=0x%lx\n", hRes);
+        hRes = pDPA_LoadStream(&dpa, CB_Load, pStm, 0xdeadbeef);
+        todo_wine ok(hRes == S_OK, "hRes=0x%lx\n", hRes);
+        todo_wine ok(CheckDPA(dpa, 0x123456, &dw), "dw=0x%lx\n", dw);
+        pDPA_Destroy(dpa);
+
+        ret = IStream_Release(pStm);
+        ok(!ret, "ret=%d\n", ret);
+	
+        ret = IStorage_Release(pStg);
+        ok(!ret, "ret=%d\n", ret);
+
+        CoUninitialize();
+    }
+    else ok(0, "hResult: %ld\n", hRes);
+
+skip_stream_tests:
+    pDPA_Destroy(dpa);
+}
+
 START_TEST(dpa)
 {
-    HMODULE hdll;
+    HMODULE hcomctl32;
 
-    hdll=GetModuleHandleA("comctl32.dll");
-    pDPA_Create=(void*)GetProcAddress(hdll,(LPCSTR)328);
-    pDPA_Destroy=(void*)GetProcAddress(hdll,(LPCSTR)329);
-    pDPA_Grow=(void*)GetProcAddress(hdll,(LPCSTR)330);
-    pDPA_SetPtr=(void*)GetProcAddress(hdll,(LPCSTR)335);
+    hcomctl32 = GetModuleHandleA("comctl32.dll");
 
-    DPA_test();
+    if(!hcomctl32)
+    {
+        ok(0, "error=%ld\n", GetLastError());
+        return;
+    }
+
+    if(InitFunctionPtrs(hcomctl32))
+        test_dpa();
+    else
+        trace("skipping tests\n");
+
+    FreeLibrary(hcomctl32);
 }

Modified: trunk/reactos/regtests/winetests/comctl32/imagelist.c
--- trunk/reactos/lib/comctl32/winetests/imagelist.c	2005-08-05 01:25:43 UTC (rev 17052)
+++ trunk/reactos/regtests/winetests/comctl32/imagelist.c	2005-08-06 18:02:57 UTC (rev 17106)
@@ -20,7 +20,7 @@
 
 #include <assert.h>
 #include <windows.h>
-#include <commctrl.h>
+#include <wine/commctrl.h>
 #include <stdio.h>
 
 #include "wine/test.h"
@@ -469,7 +469,7 @@
     return TRUE;
 }
 
-static void testMerge()
+static void testMerge(void)
 {
     HIMAGELIST himl1, himl2, hmerge;
     HICON hicon1;

Modified: trunk/reactos/regtests/winetests/comctl32/mru.c
--- trunk/reactos/lib/comctl32/winetests/mru.c	2005-08-05 01:25:43 UTC (rev 17052)
+++ trunk/reactos/regtests/winetests/comctl32/mru.c	2005-08-06 18:02:57 UTC (rev 17106)
@@ -224,11 +224,14 @@
            iRet, GetLastError());
 
         /* Add (NULL string) */
+#if 0
+	/* Some native versions crash when passed NULL or fail to SetLastError()  */
         SetLastError(0);
         iRet = pAddMRUStringA(hMRU, NULL);
         ok(iRet == 0 && GetLastError() == ERROR_INVALID_PARAMETER,
            "AddMRUStringA(NULL str) expected 0,ERROR_INVALID_PARAMETER got %d,%ld\n",
            iRet, GetLastError());
+#endif
 
         /* Add 3 strings. Check the registry is correct after each add */
         SetLastError(0);

Modified: trunk/reactos/regtests/winetests/comctl32/subclass.c
--- trunk/reactos/lib/comctl32/winetests/subclass.c	2005-08-05 01:25:43 UTC (rev 17052)
+++ trunk/reactos/regtests/winetests/comctl32/subclass.c	2005-08-06 18:02:57 UTC (rev 17106)
@@ -134,7 +134,7 @@
     sequence_cnt++;
 }
 
-static void flush_sequence()
+static void flush_sequence(void)
 {
     HeapFree(GetProcessHeap(), 0, sequence);
     sequence = 0;
@@ -215,7 +215,7 @@
     return pDefSubclassProc(hwnd, message, wParam, lParam);
 }
 
-static void test_subclass()
+static void test_subclass(void)
 {
     HWND hwnd = CreateWindowExA(0, "TestSubclass", "Test subclass", WS_OVERLAPPEDWINDOW,
                            100, 100, 200, 200, 0, 0, 0, NULL);

Modified: trunk/reactos/regtests/winetests/comctl32/tab.c
--- trunk/reactos/lib/comctl32/winetests/tab.c	2005-08-05 01:25:43 UTC (rev 17052)
+++ trunk/reactos/regtests/winetests/comctl32/tab.c	2005-08-06 18:02:57 UTC (rev 17106)
@@ -29,6 +29,8 @@
 #define TAB_PADDING_X 2
 #define TAB_PADDING_Y 2
 
+#define TCS_BOTTOM              0x0002
+
 #ifdef VISIBLE
 #define WAIT Sleep (1000)
 #define REDRAW(hwnd) RedrawWindow (hwnd, NULL, 0, RDW_UPDATENOW)
@@ -39,7 +41,7 @@
 #define trace_tab(str)
 #endif
 
-HWND
+static HWND
 create_tabcontrol (DWORD style)
 {
     HWND handle;
@@ -76,7 +78,7 @@
     return handle;
 }
 
-void CheckSize(HWND hwnd, INT width, INT height)
+static void CheckSize(HWND hwnd, INT width, INT height)
 {
     RECT rTab, r1;
 
@@ -95,7 +97,7 @@
 	    "Expected [%d,%d] got [%ld,%ld]\n", width, height, rTab.right - rTab.left, rTab.bottom - rTab.top);
 }
 
-void TabCheckSetSize(HWND hwnd, INT SetWidth, INT SetHeight, INT ExpWidth, INT ExpHeight)
+static void TabCheckSetSize(HWND hwnd, INT SetWidth, INT SetHeight, INT ExpWidth, INT ExpHeight)
 {
     SendMessage (hwnd, TCM_SETITEMSIZE, 0,
 	(LPARAM) MAKELPARAM((SetWidth >= 0) ? SetWidth:0, (SetHeight >= 0) ? SetHeight:0));

Modified: trunk/reactos/regtests/winetests/comctl32/testlist.c
--- trunk/reactos/lib/comctl32/winetests/testlist.c	2005-08-05 01:25:43 UTC (rev 17052)
+++ trunk/reactos/regtests/winetests/comctl32/testlist.c	2005-08-06 18:02:57 UTC (rev 17106)
@@ -8,7 +8,6 @@
 #include "winbase.h"
 
 extern void func_dpa(void);
-extern void func_imagelist(void);
 extern void func_mru(void);
 extern void func_subclass(void);
 extern void func_tab(void);
@@ -22,7 +21,6 @@
 static const struct test winetest_testlist[] =
 {
     { "dpa", func_dpa },
-    { "imagelist", func_imagelist },
     { "mru", func_mru },
     { "subclass", func_subclass },
     { "tab", func_tab },

Copied: trunk/reactos/regtests/winetests/msvcrt (from rev 17052, trunk/reactos/lib/msvcrt/winetests)

Copied: trunk/reactos/regtests/winetests/version (from rev 17052, trunk/reactos/lib/version/winetests)

Copied: trunk/reactos/regtests/winetests/winetest (from rev 17052, trunk/reactos/apps/utils/winetest)

Modified: trunk/reactos/regtests/winetests/winetest/dist.rc
--- trunk/reactos/apps/utils/winetest/dist.rc	2005-08-05 01:25:43 UTC (rev 17052)
+++ trunk/reactos/regtests/winetests/winetest/dist.rc	2005-08-06 18:02:57 UTC (rev 17106)
@@ -1,25 +1,25 @@
-/*
- * Resources for the binary we distribute to testers
- *
- * Copyright 2004 Ferenc Wagner
- *
- * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include "winetest.rc"
-
-WINE_BUILD STRINGRES "build.id"
-BUILD_INFO STRINGRES "build.nfo"
-TESTS_URL  STRINGRES "tests.url"
+/*
+ * Resources for the binary we distribute to testers
+ *
+ * Copyright 2004 Ferenc Wagner
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include "winetest.rc"
+
+WINE_BUILD STRINGRES "build.id"
+BUILD_INFO STRINGRES "build.nfo"
+TESTS_URL  STRINGRES "tests.url"

Modified: trunk/reactos/regtests/winetests/winetest/gui.c
--- trunk/reactos/apps/utils/winetest/gui.c	2005-08-05 01:25:43 UTC (rev 17052)
+++ trunk/reactos/regtests/winetests/winetest/gui.c	2005-08-06 18:02:57 UTC (rev 17106)
@@ -26,32 +26,24 @@
 
 /* Event object to signal successful window creation to main thread.
  */
-HANDLE initEvent;
+static HANDLE initEvent;
 
 /* Dialog handle
  */
-HWND dialog;
+static HWND dialog;
 
 /* Progress data for the text* functions and for scaling.
  */
-unsigned int progressMax, progressCurr;
-double progressScale;
+static unsigned int progressMax, progressCurr;
+static double progressScale;
 
 /* Progress group counter for the gui* functions.
  */
-int progressGroup;
+static int progressGroup;
 
-char *
-renderString (va_list ap)
-{
-    const char *fmt = va_arg (ap, char*);
-    static char buffer[128];
+static WNDPROC DefEditProc;
 
-    vsnprintf (buffer, sizeof buffer, fmt, ap);
-    return buffer;
-}
-
-int
+static int
 MBdefault (int uType)
 {
     static const int matrix[][4] = {{IDOK,    0,        0,        0},
@@ -67,7 +59,7 @@
 }
 
 /* report (R_STATUS, fmt, ...) */
-int
+static int
 textStatus (va_list ap)
 {
     char *str = vstrmake (NULL, ap);
@@ -78,7 +70,7 @@
     return 0;
 }
 
-int
+static int
 guiStatus (va_list ap)
 {
     size_t len;
@@ -91,7 +83,7 @@
 }
 
 /* report (R_PROGRESS, barnum, steps) */
-int
+static int
 textProgress (va_list ap)
 {
     progressGroup = va_arg (ap, int);
@@ -100,7 +92,7 @@
     return 0;
 }
 
-int
+static int
 guiProgress (va_list ap)
 {
     unsigned int max;
@@ -121,7 +113,7 @@
 }
 
 /* report (R_STEP, fmt, ...) */
-int
+static int
 textStep (va_list ap)
 {
     char *str = vstrmake (NULL, ap);
@@ -133,12 +125,12 @@
     return 0;
 }
 
-int
+static int
 guiStep (va_list ap)
 {
     const int pgID = IDC_ST0 + progressGroup * 2;
     char *str = vstrmake (NULL, ap);
-
+    
     progressCurr++;
     SetDlgItemText (dialog, pgID, str);
     SendDlgItemMessage (dialog, pgID+1, PBM_SETPOS,
@@ -148,7 +140,7 @@
 }
 
 /* report (R_DELTA, inc, fmt, ...) */
-int
+static int
 textDelta (va_list ap)
 {
     const int inc = va_arg (ap, int);
@@ -161,7 +153,7 @@
     return 0;
 }
 
-int
+static int
 guiDelta (va_list ap)
 {
     const int inc = va_arg (ap, int);
@@ -176,8 +168,25 @@
     return 0;
 }
 
+/* report (R_TAG) */
+static int
+textTag (va_list ap)
+{
+    fputs ("Tag: ", stderr);
+    fputs (tag, stderr);
+    fputc ('\n', stderr);
+    return 0;
+}
+
+static int
+guiTag (va_list ap)
+{
+    SetDlgItemText (dialog, IDC_TAG, tag);
+    return 0;
+}
+
 /* report (R_DIR, fmt, ...) */
-int
+static int
 textDir (va_list ap)
 {
     char *str = vstrmake (NULL, ap);
@@ -189,7 +198,7 @@
     return 0;
 }
 
-int
+static int
 guiDir (va_list ap)
 {
     char *str = vstrmake (NULL, ap);
@@ -200,7 +209,7 @@
 }
 
 /* report (R_OUT, fmt, ...) */
-int
+static int
 textOut (va_list ap)
 {
     char *str = vstrmake (NULL, ap);
@@ -212,7 +221,7 @@
     return 0;
 }
 
-int
+static int
 guiOut (va_list ap)
 {
     char *str = vstrmake (NULL, ap);
@@ -223,7 +232,7 @@
 }
 
 /* report (R_WARNING, fmt, ...) */
-int
+static int
 textWarning (va_list ap)
 {
     fputs ("Warning: ", stderr);
@@ -231,7 +240,7 @@
     return 0;
 }
 
-int
+static int
 guiWarning (va_list ap)
 {
     char *str = vstrmake (NULL, ap);
@@ -242,7 +251,7 @@
 }
 
 /* report (R_ERROR, fmt, ...) */
-int
+static int
 textError (va_list ap)
 {
     fputs ("Error: ", stderr);
@@ -250,7 +259,7 @@
     return 0;
 }
 
-int
+static int
 guiError (va_list ap)
 {
     char *str = vstrmake (NULL, ap);
@@ -261,14 +270,14 @@
 }
 
 /* report (R_FATAL, fmt, ...) */
-int
+static int
 textFatal (va_list ap)
 {
     textError (ap);
     exit (1);
 }
 
-int
+static int
 guiFatal (va_list ap)
 {
     guiError (ap);
@@ -276,7 +285,7 @@
 }
 
 /* report (R_ASK, type, fmt, ...) */
-int
+static int
 textAsk (va_list ap)
 {
     int uType = va_arg (ap, int);
@@ -289,7 +298,7 @@
     return ret;
 }
 
-int
+static int
 guiAsk (va_list ap)
 {
     int uType = va_arg (ap, int);
@@ -301,26 +310,73 @@
     return ret;
 }
 
+static BOOL CALLBACK
+EditTagProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+    switch (msg) {
+    case WM_CHAR:
+        if (wParam == 8) break; /* backspace is OK */
+        if (GetWindowTextLengthA (hwnd) == MAXTAGLEN ||
+            !goodtagchar (wParam)) return TRUE;
+        break;
+    }
+    return CallWindowProcA (DefEditProc, hwnd, msg, wParam, lParam);
+}
+
+static BOOL CALLBACK
+AskTagProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+    int len;
+
+    switch (msg) {
+    case WM_INITDIALOG:
+        DefEditProc = (WNDPROC)SetWindowLongPtr
+            (GetDlgItem (hwnd, IDC_TAG), GWLP_WNDPROC, (LONG_PTR)EditTagProc);
+        return TRUE;
+    case WM_COMMAND:
+        switch (LOWORD (wParam)) {
+        case IDOK:
+            len = GetWindowTextLengthA (GetDlgItem (hwnd, IDC_TAG));
+            tag = xmalloc (len+1);
+            GetDlgItemTextA (hwnd, IDC_TAG, tag, len+1);
+            EndDialog (hwnd, IDOK);
+            return TRUE;
[truncated at 1000 lines; 873 more skipped]