- Timestamp:
- Oct 29, 2002, 2:47:35 PM (23 years ago)
- Location:
- trunk/src/comctl32
- Files:
-
- 4 added
- 2 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/comctl32undoc.c
r9370 r9374 74 74 typedef HRESULT (CALLBACK *DPALOADPROC)(LPLOADDATA,IStream*,LPARAM); 75 75 #endif 76 77 INT __cdecl _wtoi(LPWSTR string); 76 78 77 79 /************************************************************************** … … 281 283 } 282 284 nResult = (pfnCompare)(*pWork1, *pWork2, lParam); 283 TRACE("compare result=%d, dpa1.cnt=%d, dpa2.cnt=%d\n", 285 TRACE("compare result=%d, dpa1.cnt=%d, dpa2.cnt=%d\n", 284 286 nResult, nIndex, nCount); 285 287 … … 530 532 531 533 /* open the sub key */ 532 if ((err = RegOpenKeyExW( mp->extview.hKey, mp->extview.lpszSubKey, 534 if ((err = RegOpenKeyExW( mp->extview.hKey, mp->extview.lpszSubKey, 533 535 0, KEY_WRITE, &newkey))) { 534 536 /* not present - what to do ??? */ … … 550 552 if (mp->wineFlags & WMRUF_CHANGED) { 551 553 mp->wineFlags &= ~WMRUF_CHANGED; 552 err = RegSetValueExA(newkey, "MRUList", 0, REG_SZ, 554 err = RegSetValueExA(newkey, "MRUList", 0, REG_SZ, 553 555 mp->realMRU, strlen(mp->realMRU) + 1); 554 556 if (err) { … … 563 565 witem->itemFlag &= ~WMRUIF_CHANGED; 564 566 realname[0] = 'a' + i; 565 err = RegSetValueExW(newkey, realname, 0, 566 (mp->extview.dwFlags & MRUF_BINARY_LIST) ? 567 err = RegSetValueExW(newkey, realname, 0, 568 (mp->extview.dwFlags & MRUF_BINARY_LIST) ? 567 569 REG_BINARY : REG_SZ, 568 570 &witem->datastart, witem->size); … … 609 611 /************************************************************************** 610 612 * FindMRUData [COMCTL32.169] 611 * 613 * 612 614 * Searches binary list for item that matches lpData of length cbData. 613 615 * Returns position in list order 0 -> MRU and if lpRegNum != NULL then value … … 644 646 for(i=0; i<mp->cursize; i++) { 645 647 if (mp->extview.dwFlags & MRUF_BINARY_LIST) { 646 if (!mp->extview.lpfnCompare(lpData, &mp->array[i]->datastart, 648 if (!mp->extview.lpfnCompare(lpData, &mp->array[i]->datastart, 647 649 cbData)) 648 650 break; … … 677 679 *lpRegNum = 'a' + i; 678 680 679 TRACE("(% p, %p, %ld, %p) returning %d\n",681 TRACE("(%08x, %p, %ld, %p) returning %d\n", 680 682 hList, lpData, cbData, lpRegNum, ret); 681 683 … … 686 688 /************************************************************************** 687 689 * AddMRUData [COMCTL32.167] 688 * 690 * 689 691 * Add item to MRU binary list. If item already exists in list then it is 690 692 * simply moved up to the top of the list and not added again. If list is … … 726 728 727 729 /* Allocate space for new item and move in the data */ 728 mp->array[replace] = witem = (LPWINEMRUITEM)COMCTL32_Alloc(cbData + 730 mp->array[replace] = witem = (LPWINEMRUITEM)COMCTL32_Alloc(cbData + 729 731 sizeof(WINEMRUITEM)); 730 732 witem->itemFlag |= WMRUIF_CHANGED; … … 738 740 } 739 741 mp->realMRU[0] = replace + 'a'; 740 TRACE("(% p, %p, %ld) adding data, /%c/ now most current\n",742 TRACE("(%08x, %p, %ld) adding data, /%c/ now most current\n", 741 743 hList, lpData, cbData, replace+'a'); 742 744 ret = replace; … … 752 754 /************************************************************************** 753 755 * AddMRUStringW [COMCTL32.401] 754 * 756 * 755 757 * Add item to MRU string list. If item already exists in list them it is 756 758 * simply moved up to the top of the list and not added again. If list is … … 768 770 AddMRUStringW(HANDLE hList, LPCWSTR lpszString) 769 771 { 770 FIXME("(% p, %s) empty stub!\n", hList, debugstr_w(lpszString));772 FIXME("(%08x, %s) empty stub!\n", hList, debugstr_w(lpszString)); 771 773 772 774 return 0; … … 779 781 AddMRUStringA(HANDLE hList, LPCSTR lpszString) 780 782 { 781 FIXME("(% p, %s) empty stub!\n", hList, debugstr_a(lpszString));783 FIXME("(%08x, %s) empty stub!\n", hList, debugstr_a(lpszString)); 782 784 783 785 return 0; … … 799 801 DelMRUString(HANDLE hList, INT nItemPos) 800 802 { 801 FIXME("(% p, %d): stub\n", hList, nItemPos);803 FIXME("(%08x, %d): stub\n", hList, nItemPos); 802 804 return TRUE; 803 805 } … … 815 817 /************************************************************************** 816 818 * FindMRUStringA [COMCTL32.155] 817 * 819 * 818 820 * Searches string list for item that matches lpszString. 819 821 * Returns position in list order 0 -> MRU and if lpRegNum != NULL then value … … 866 868 867 869 /* open the sub key */ 868 if ((err = RegCreateKeyExW( mp->extview.hKey, mp->extview.lpszSubKey, 870 if ((err = RegCreateKeyExW( mp->extview.hKey, mp->extview.lpszSubKey, 869 871 0, 870 872 emptyW, 871 REG_OPTION_NON_VOLATILE, 873 REG_OPTION_NON_VOLATILE, 872 874 KEY_READ | KEY_WRITE, 873 875 0, … … 885 887 if (newkey) { 886 888 datasize = mp->extview.nMaxItems + 1; 887 if((err=RegQueryValueExA( newkey, "MRUList", 0, &type, mp->realMRU, 889 if((err=RegQueryValueExA( newkey, "MRUList", 0, &type, mp->realMRU, 888 890 &datasize))) { 889 891 /* not present - set size to 1 (will become 0 later) */ … … 905 907 ERR("Key %s not found 1\n", debugstr_w(realname)); 906 908 } 907 mp->array[i] = witem = (LPWINEMRUITEM)COMCTL32_Alloc(datasize + 909 mp->array[i] = witem = (LPWINEMRUITEM)COMCTL32_Alloc(datasize + 908 910 sizeof(WINEMRUITEM)); 909 911 witem->size = datasize; 910 if(RegQueryValueExW( newkey, realname, 0, &type, 912 if(RegQueryValueExW( newkey, realname, 0, &type, 911 913 &witem->datastart, &datasize)) { 912 914 /* not present - what to do ??? */ … … 947 949 mp->isUnicode = TRUE; 948 950 949 return CreateMRUListLazy_common(mp); 951 return CreateMRUListLazy_common(mp); 950 952 } 951 953 … … 1016 1018 * of list returns -1. 1017 1019 * If lpBuffer == NULL or nItemPos is -ve return value is no. of items in 1018 * the list. 1020 * the list. 1019 1021 */ 1020 1022 INT WINAPI EnumMRUListW(HANDLE hList, INT nItemPos, LPVOID lpBuffer, … … 1031 1033 TRACE("nItemPos=%d, desired=%d\n", nItemPos, desired); 1032 1034 witem = mp->array[desired]; 1033 datasize = min( witem->size, nBufferSize ); 1035 datasize = min( witem->size, nBufferSize ); 1034 1036 memcpy( lpBuffer, &witem->datastart, datasize); 1035 TRACE("(% p, %d, %p, %ld): returning len=%d\n",1037 TRACE("(%08x, %d, %p, %ld): returning len=%d\n", 1036 1038 hList, nItemPos, lpBuffer, nBufferSize, datasize); 1037 1039 return datasize; … … 1040 1042 /************************************************************************** 1041 1043 * EnumMRUListA [COMCTL32.154] 1042 * 1044 * 1043 1045 */ 1044 1046 INT WINAPI EnumMRUListA(HANDLE hList, INT nItemPos, LPVOID lpBuffer, … … 1057 1059 witem = mp->array[desired]; 1058 1060 if(mp->extview.dwFlags & MRUF_BINARY_LIST) { 1059 datasize = min( witem->size, nBufferSize ); 1061 datasize = min( witem->size, nBufferSize ); 1060 1062 memcpy( lpBuffer, &witem->datastart, datasize); 1061 1063 } else { … … 1066 1068 lpBuffer, datasize, NULL, NULL); 1067 1069 } 1068 TRACE("(% p, %d, %p, %ld): returning len=%d\n",1070 TRACE("(%08x, %d, %p, %ld): returning len=%d\n", 1069 1071 hList, nItemPos, lpBuffer, nBufferSize, datasize); 1070 1072 return datasize; 1071 1073 } 1072 1074 1073 1075 1074 1076 /************************************************************************** … … 1126 1128 { 1127 1129 TRACE("(%p %p)\n", lppDest, lpSrc); 1128 1130 1129 1131 if (lpSrc) { 1130 1132 LPSTR ptr = COMCTL32_ReAlloc (*lppDest, strlen (lpSrc) + 1); … … 1199 1201 { 1200 1202 TRACE("(%p %p)\n", lppDest, lpSrc); 1201 1203 1202 1204 if (lpSrc) { 1203 1205 INT len = strlenW (lpSrc) + 1; … … 1371 1373 1372 1374 /************************************************************************** 1373 * DSA_GetItem [COMCTL32.322] 1375 * DSA_GetItem [COMCTL32.322] 1374 1376 * 1375 1377 * PARAMS … … 1389 1391 1390 1392 TRACE("(%p %d %p)\n", hdsa, nIndex, pDest); 1391 1393 1392 1394 if (!hdsa) 1393 1395 return FALSE; … … 1403 1405 1404 1406 /************************************************************************** 1405 * DSA_GetItemPtr [COMCTL32.323] 1407 * DSA_GetItemPtr [COMCTL32.323] 1406 1408 * 1407 1409 * Retrieves a pointer to the specified item. … … 1429 1431 1430 1432 pSrc = (char *) hdsa->pData + (hdsa->nItemSize * nIndex); 1431 1433 1432 1434 TRACE("-- ret=%p\n", pSrc); 1433 1435 … … 1437 1439 1438 1440 /************************************************************************** 1439 * DSA_SetItem [COMCTL32.325] 1441 * DSA_SetItem [COMCTL32.325] 1440 1442 * 1441 1443 * Sets the contents of an item in the array. … … 1456 1458 INT nSize, nNewItems; 1457 1459 LPVOID pDest, lpTemp; 1458 1460 1459 1461 TRACE("(%p %d %p)\n", hdsa, nIndex, pSrc); 1460 1462 1461 1463 if ((!hdsa) || nIndex < 0) 1462 1464 return FALSE; 1463 1465 1464 1466 if (hdsa->nItemCount <= nIndex) { 1465 1467 /* within the old array */ … … 1481 1483 hdsa->nItemCount = nIndex + 1; 1482 1484 hdsa->pData = lpTemp; 1483 } 1485 } 1484 1486 } 1485 1487 … … 1495 1497 1496 1498 /************************************************************************** 1497 * DSA_InsertItem [COMCTL32.324] 1499 * DSA_InsertItem [COMCTL32.324] 1498 1500 * 1499 1501 * PARAMS … … 1512 1514 INT nNewItems, nSize; 1513 1515 LPVOID lpTemp, lpDest; 1514 1516 1515 1517 TRACE("(%p %d %p)\n", hdsa, nIndex, pSrc); 1516 1518 … … 1532 1534 1533 1535 hdsa->nMaxCount = nNewItems; 1534 hdsa->pData = lpTemp; 1536 hdsa->pData = lpTemp; 1535 1537 } 1536 1538 … … 1557 1559 1558 1560 /************************************************************************** 1559 * DSA_DeleteItem [COMCTL32.326] 1561 * DSA_DeleteItem [COMCTL32.326] 1560 1562 * 1561 1563 * PARAMS … … 1573 1575 LPVOID lpDest,lpSrc; 1574 1576 INT nSize; 1575 1577 1576 1578 TRACE("(%p %d)\n", hdsa, nIndex); 1577 1579 … … 1590 1592 memmove (lpDest, lpSrc, nSize); 1591 1593 } 1592 1594 1593 1595 hdsa->nItemCount--; 1594 1596 1595 1597 /* free memory ? */ 1596 1598 if ((hdsa->nMaxCount - hdsa->nItemCount) >= hdsa->nGrow) { … … 1627 1629 TRACE("(%p)\n", hdsa); 1628 1630 1629 if (!hdsa) 1631 if (!hdsa) 1630 1632 return FALSE; 1631 1633 if (hdsa->pData && (!COMCTL32_Free (hdsa->pData))) … … 1853 1855 INT i; 1854 1856 1855 if (!hdpa || !hdpa->ptrs)1857 if (!hdpa->ptrs) 1856 1858 return -1; 1857 1859 … … 1883 1885 DPA_InsertPtr (const HDPA hdpa, INT i, LPVOID p) 1884 1886 { 1887 INT nNewItems, nSize, nIndex = 0; 1888 LPVOID *lpTemp, *lpDest; 1889 1885 1890 TRACE("(%p %d %p)\n", hdpa, i, p); 1886 1891 1887 if (!hdpa || i < 0) return -1; 1888 1889 if (i >= 0x7fff) 1890 i = hdpa->nItemCount; 1891 1892 if (i >= hdpa->nItemCount) 1893 return DPA_SetPtr(hdpa, i, p) ? i : -1; 1894 1895 /* create empty spot at the end */ 1896 if (!DPA_SetPtr(hdpa, hdpa->nItemCount, 0)) return -1; 1897 memmove (hdpa->ptrs + i + 1, hdpa->ptrs + i, (hdpa->nItemCount - i - 1) * sizeof(LPVOID)); 1898 hdpa->ptrs[i] = p; 1899 return i; 1900 } 1892 if ((!hdpa) || (i < 0)) 1893 return -1; 1894 1895 if (!hdpa->ptrs) { 1896 hdpa->ptrs = 1897 (LPVOID*)HeapAlloc (hdpa->hHeap, HEAP_ZERO_MEMORY, 1898 2 * hdpa->nGrow * sizeof(LPVOID)); 1899 if (!hdpa->ptrs) 1900 return -1; 1901 hdpa->nMaxCount = hdpa->nGrow * 2; 1902 nIndex = 0; 1903 } 1904 else { 1905 if (hdpa->nItemCount >= hdpa->nMaxCount) { 1906 TRACE("-- resizing\n"); 1907 nNewItems = hdpa->nMaxCount + hdpa->nGrow; 1908 nSize = nNewItems * sizeof(LPVOID); 1909 1910 lpTemp = (LPVOID*)HeapReAlloc (hdpa->hHeap, HEAP_ZERO_MEMORY, 1911 hdpa->ptrs, nSize); 1912 if (!lpTemp) 1913 return -1; 1914 hdpa->nMaxCount = nNewItems; 1915 hdpa->ptrs = lpTemp; 1916 } 1917 1918 if (i >= hdpa->nItemCount) { 1919 nIndex = hdpa->nItemCount; 1920 TRACE("-- appending at %d\n", nIndex); 1921 } 1922 else { 1923 TRACE("-- inserting at %d\n", i); 1924 lpTemp = hdpa->ptrs + i; 1925 lpDest = lpTemp + 1; 1926 nSize = (hdpa->nItemCount - i) * sizeof(LPVOID); 1927 TRACE("-- move dest=%p src=%p size=%x\n", 1928 lpDest, lpTemp, nSize); 1929 memmove (lpDest, lpTemp, nSize); 1930 nIndex = i; 1931 } 1932 } 1933 1934 /* insert item */ 1935 hdpa->nItemCount++; 1936 hdpa->ptrs[nIndex] = p; 1937 1938 return nIndex; 1939 } 1940 1901 1941 1902 1942 /************************************************************************** … … 1919 1959 { 1920 1960 LPVOID *lpTemp; 1921 1961 1922 1962 TRACE("(%p %d %p)\n", hdpa, i, p); 1923 1963 1924 if ( !hdpa || i < 0 || i > 0x7fff)1964 if ((!hdpa) || i < 0) 1925 1965 return FALSE; 1926 1966 1927 1967 if (hdpa->nItemCount <= i) { 1928 1968 /* within the old array */ 1929 if (hdpa->nMaxCount <= i) { 1969 if (hdpa->nMaxCount > i) { 1970 /* within the allocated space, set a new boundary */ 1971 hdpa->nItemCount = i+1; 1972 } 1973 else { 1930 1974 /* resize the block of memory */ 1931 1975 INT nNewItems = … … 1933 1977 INT nSize = nNewItems * sizeof(LPVOID); 1934 1978 1935 if (hdpa->ptrs) 1936 lpTemp = (LPVOID*)HeapReAlloc (hdpa->hHeap, HEAP_ZERO_MEMORY, hdpa->ptrs, nSize); 1937 else 1938 lpTemp = (LPVOID*)HeapAlloc (hdpa->hHeap, HEAP_ZERO_MEMORY, nSize); 1939 1979 lpTemp = (LPVOID*)HeapReAlloc (hdpa->hHeap, HEAP_ZERO_MEMORY, 1980 hdpa->ptrs, nSize); 1940 1981 if (!lpTemp) 1941 1982 return FALSE; 1942 1983 1943 hdpa->nMaxCount = nNewItems; 1944 hdpa->ptrs = lpTemp; 1945 } 1946 hdpa->nItemCount = i+1; 1984 hdpa->nItemCount = nNewItems; 1985 hdpa->ptrs = lpTemp; 1986 } 1947 1987 } 1948 1988 … … 1973 2013 LPVOID *lpDest, *lpSrc, lpTemp = NULL; 1974 2014 INT nSize; 1975 2015 1976 2016 TRACE("(%p %d)\n", hdpa, i); 1977 2017 … … 1990 2030 memmove (lpDest, lpSrc, nSize); 1991 2031 } 1992 2032 1993 2033 hdpa->nItemCount --; 1994 2034 1995 2035 /* free memory ?*/ 1996 2036 if ((hdpa->nMaxCount - hdpa->nItemCount) >= hdpa->nGrow) { … … 2003 2043 2004 2044 hdpa->nMaxCount = nNewItems; 2005 hdpa->ptrs = (LPVOID*)lpDest; 2045 hdpa->ptrs = (LPVOID*)lpDest; 2006 2046 } 2007 2047 … … 2028 2068 TRACE("(%p)\n", hdpa); 2029 2069 2030 if (!hdpa) 2070 if (!hdpa) 2031 2071 return FALSE; 2032 2072 … … 2067 2107 2068 2108 TRACE("l=%i r=%i\n", l, r); 2069 2109 2070 2110 if (l==r) /* one element is always sorted */ 2071 2111 return; … … 2080 2120 2081 2121 /* join the two sides */ 2082 while( (l<=m) && (m<r) ) 2122 while( (l<=m) && (m<r) ) 2083 2123 { 2084 2124 if(pfnCompare(lpPtrs[l],lpPtrs[m+1],lParam)>0) … … 2198 2238 2199 2239 TRACE("linear search\n"); 2200 2240 2201 2241 nIndex = (nStart == -1)? 0 : nStart; 2202 2242 lpPtr = hdpa->ptrs; … … 2233 2273 HDPA hdpa; 2234 2274 2235 TRACE("(%d %p)\n", nGrow, hHeap);2275 TRACE("(%d 0x%x)\n", nGrow, hHeap); 2236 2276 2237 2277 if (hHeap) … … 2281 2321 UINT idFrom = 0; 2282 2322 2283 TRACE("( %p %p%d %p 0x%08lx)\n",2323 TRACE("(0x%04x 0x%04x %d %p 0x%08lx)\n", 2284 2324 lpNotify->hwndFrom, lpNotify->hwndTo, uCode, lpHdr, 2285 2325 lpNotify->dwParam5); … … 2288 2328 return 0; 2289 2329 2290 if (lpNotify->hwndFrom == (HWND)-1) {2330 if (lpNotify->hwndFrom == -1) { 2291 2331 lpNmh = lpHdr; 2292 2332 idFrom = lpHdr->idFrom; … … 2334 2374 NOTIFYDATA notify; 2335 2375 2336 TRACE("( %p %p%d %p)\n",2376 TRACE("(0x%04x 0x%04x %d %p)\n", 2337 2377 hwndTo, hwndFrom, uCode, lpHdr); 2338 2378 … … 2368 2408 HWND hwndNotify; 2369 2409 2370 TRACE("( %p %p%d %p 0x%08lx)\n",2410 TRACE("(0x%04x 0x%04x %d %p 0x%08lx)\n", 2371 2411 hwndFrom, hwndTo, uCode, lpHdr, dwParam5); 2372 2412 … … 2451 2491 COMCTL32_StrToIntW (LPWSTR lpString) 2452 2492 { 2453 return atoiW(lpString);2493 return _wtoi(lpString); 2454 2494 } 2455 2495 … … 2463 2503 * hdpa [I] handle to the dynamic pointer array 2464 2504 * enumProc [I] 2465 * lParam [I] 2505 * lParam [I] 2466 2506 * 2467 2507 * RETURNS … … 2644 2684 if (dbcs && lpStart[1] != HIBYTE(wMatch)) continue; 2645 2685 lpGotIt = lpStart; 2646 } 2686 } 2647 2687 return (LPSTR)lpGotIt; 2648 2688 } … … 2698 2738 if( strchrW(lpSet, *(WORD*)lpLoop)) 2699 2739 return (INT)(lpLoop-lpStr); 2700 2740 2701 2741 return (INT)(lpLoop-lpStr); 2702 2742 } … … 2711 2751 BOOL WINAPI COMCTL32_410( HWND hw, DWORD b, DWORD c, DWORD d) { 2712 2752 2713 FIXME("(% p, %lx, %lx, %lx): stub!\n", hw, b, c, d);2753 FIXME("(%x, %lx, %lx, %lx): stub!\n", hw, b, c, d); 2714 2754 2715 2755 return TRUE; … … 2725 2765 BOOL WINAPI COMCTL32_411( HWND hw, DWORD b, DWORD c) { 2726 2766 2727 FIXME("(% p, %lx, %lx): stub!\n", hw, b, c);2767 FIXME("(%x, %lx, %lx): stub!\n", hw, b, c); 2728 2768 2729 2769 return TRUE; … … 2739 2779 BOOL WINAPI COMCTL32_412( HWND hwnd, DWORD b, DWORD c) 2740 2780 { 2741 FIXME("(% p, %lx, %lx): stub!\n", hwnd, b, c);2781 FIXME("(%x, %lx, %lx): stub!\n", hwnd, b, c); 2742 2782 2743 2783 if (IsWindow (hwnd) == FALSE) … … 2760 2800 BOOL WINAPI COMCTL32_413( HWND hw, DWORD b, DWORD c, DWORD d) { 2761 2801 2762 FIXME("(% p, %lx, %lx, %lx): stub!\n", hw, b, c, d);2802 FIXME("(%x, %lx, %lx, %lx): stub!\n", hw, b, c, d); 2763 2803 2764 2804 return TRUE; … … 2776 2816 { 2777 2817 2778 FIXME("(% p, %lx, %lx, %lx, %lx): stub!\n", hwnd, b, c, d, e);2818 FIXME("(%x, %lx, %lx, %lx, %lx): stub!\n", hwnd, b, c, d, e); 2779 2819 2780 2820 return TRUE;
Note:
See TracChangeset
for help on using the changeset viewer.