Changeset 3585 for trunk/src/comctl32/comctl32undoc.cpp
- Timestamp:
- May 22, 2000, 7:25:13 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/comctl32undoc.cpp
r3385 r3585 1 /* $Id: comctl32undoc.cpp,v 1. 3 2000-04-15 14:22:11cbratschi Exp $ */1 /* $Id: comctl32undoc.cpp,v 1.4 2000-05-22 17:25:07 cbratschi Exp $ */ 2 2 /* 3 3 * Undocumented functions from COMCTL32.DLL … … 13 13 14 14 /* 15 - Corel 20000 317level15 - Corel 20000513 level 16 16 - (WINE 20000130 level) 17 17 */ … … 1277 1277 hdpa->ptrs = 1278 1278 (LPVOID*)HeapAlloc (hdpa->hHeap, HEAP_ZERO_MEMORY, 1279 2 *hdpa->nGrow * sizeof(LPVOID));1279 hdpa->nGrow * sizeof(LPVOID)); 1280 1280 if (!hdpa->ptrs) 1281 1281 return -1; 1282 hdpa->nMaxCount = hdpa->nGrow * 2;1282 hdpa->nMaxCount = hdpa->nGrow; 1283 1283 nIndex = 0; 1284 1284 } 1285 1285 else { 1286 if (hdpa->nItemCount >= hdpa->nMaxCount) {1286 if (hdpa->nItemCount == hdpa->nMaxCount) { 1287 1287 // TRACE (commctrl, "-- resizing\n"); 1288 1288 nNewItems = hdpa->nMaxCount + hdpa->nGrow; … … 1350 1350 if (hdpa->nMaxCount > i) { 1351 1351 /* within the allocated space, set a new boundary */ 1352 hdpa->nItemCount = i ;1352 hdpa->nItemCount = i+1; 1353 1353 } 1354 1354 else { 1355 1355 /* resize the block of memory */ 1356 1356 INT nNewItems = 1357 hdpa->nGrow * (( INT)(((i+1) -1) / hdpa->nGrow) + 1);1357 hdpa->nGrow * (((i+1) / hdpa->nGrow) + 1); 1358 1358 INT nSize = nNewItems * sizeof(LPVOID); 1359 1359 … … 1413 1413 1414 1414 hdpa->nItemCount --; 1415 hdpa->ptrs[hdpa->nItemCount] = NULL; 1415 1416 1416 1417 /* free memory ?*/ 1417 if ((hdpa->nMaxCount - hdpa->nItemCount) > =hdpa->nGrow) {1418 INT nNewItems = MAX(hdpa->nGrow*2,hdpa->nItemCount);1418 if ((hdpa->nMaxCount - hdpa->nItemCount) > hdpa->nGrow) { 1419 INT nNewItems = hdpa->nMaxCount - hdpa->nGrow; 1419 1420 1420 1421 nSize = nNewItems * sizeof(LPVOID); … … 1705 1706 return hdpa; 1706 1707 } 1707 1708 #if 0 1709 /************************************************************************** 1710 * DPA_LoadStream [COMCTL32.9] 1711 * 1712 * Loads a dynamic pointer array from a stream 1713 * 1714 * PARAMS 1715 * phDpa [O] pointer to a handle to a dynamic pointer array 1716 * loadProc [I] pointer to a callback function 1717 * pStream [I] pointer to a stream 1718 * lParam [I] application specific value 1719 * 1720 * NOTES 1721 * No more information available yet! 1722 */ 1723 HRESULT WINAPI 1724 DPA_LoadStream (HDPA *phDpa, DPALOADPROC loadProc, IStream *pStream, LPARAM lParam) 1725 { 1726 HRESULT errCode; 1727 LARGE_INTEGER position; 1728 ULARGE_INTEGER newPosition; 1729 STREAMDATA streamData; 1730 LOADDATA loadData; 1731 ULONG ulRead; 1732 HDPA hDpa; 1733 PVOID *ptr; 1734 1735 //FIXME ("phDpa=3D%p loadProc=3D%p pStream=3D%p lParam=3D%lx\n",phDpa, loadProc, pStream, lParam); 1736 1737 if (!phDpa || !loadProc || !pStream) 1738 return E_INVALIDARG; 1739 1740 *phDpa = (HDPA)NULL; 1741 1742 position.s.LowPart = 0; 1743 position.s.HighPart = 0; 1744 1745 1746 1747 errCode = IStream_Seek (pStream, position, STREAM_SEEK_CUR, &newPosition); 1748 1749 if (errCode != S_OK) 1750 return errCode; 1751 1752 1753 errCode = IStream_Read (pStream, &streamData, sizeof(STREAMDATA), = &ulRead); 1754 1755 if (errCode != S_OK) 1756 return errCode; 1757 1758 //FIXME ("dwSize=3D%lu dwData2=3D%lu dwItems=3D%lu\n",streamData.dwSize, streamData.dwData2, streamData.dwItems); 1759 1760 if (lParam < sizeof(STREAMDATA) || 1761 streamData.dwSize < sizeof(STREAMDATA) || 1762 streamData.dwData2 < 1) { 1763 errCode = E_FAIL; 1764 } 1765 1766 /* create the dpa */ 1767 1768 hDpa = DPA_Create (streamData.dwItems); 1769 1770 if (!hDpa) 1771 return E_OUTOFMEMORY; 1772 1773 if (!DPA_Grow (hDpa, streamData.dwItems)) 1774 return E_OUTOFMEMORY; 1775 1776 /* load data from the stream into the dpa */ 1777 1778 ptr = hDpa->ptrs; 1779 for (loadData.nCount = 0; loadData.nCount < streamData.dwItems; loadData.nCount++) { 1780 errCode = (loadProc)(&loadData, pStream, lParam); 1781 1782 if (errCode != S_OK) { 1783 errCode = S_FALSE; 1784 break; 1785 } 1786 1787 *ptr = loadData.ptr; 1788 ptr++; 1789 } 1790 1791 /* set the number of items */ 1792 1793 hDpa->nItemCount = loadData.nCount; 1794 1795 /* store the handle to the dpa */ 1796 1797 *phDpa = hDpa; 1798 1799 //FIXME ("new hDpa=3D%p\n", hDpa); 1800 1801 return errCode; 1802 1803 } 1804 1805 /************************************************************************** 1806 * DPA_SaveStream [COMCTL32.10] 1807 * 1808 * Saves a dynamic pointer array to a stream 1809 * 1810 * PARAMS 1811 * hDpa [I] handle to a dynamic pointer array 1812 * loadProc [I] pointer to a callback function 1813 * pStream [I] pointer to a stream 1814 * lParam [I] application specific value 1815 * 1816 * NOTES 1817 * No more information available yet! 1818 */ 1819 HRESULT WINAPI 1820 DPA_SaveStream (const HDPA hDpa, DPALOADPROC loadProc, IStream *pStream,LPARAM lParam) 1821 { 1822 //FIXME ("hDpa=3D%p loadProc=3D%p pStream=3D%p lParam=3D%lx\n",hDpa, loadProc, pStream, lParam); 1823 1824 return E_FAIL; 1825 } 1826 #endif 1708 1827 /************************************************************************** 1709 1828 * Notification functions
Note:
See TracChangeset
for help on using the changeset viewer.