source: trunk/src/comctl32/comctl32undoc.cpp@ 3385

Last change on this file since 3385 was 3385, checked in by cbratschi, 25 years ago

new listview item handling, new messages

File size: 53.5 KB
Line 
1/* $Id: comctl32undoc.cpp,v 1.3 2000-04-15 14:22:11 cbratschi Exp $ */
2/*
3 * Undocumented functions from COMCTL32.DLL
4 *
5 * Copyright (C) 1999 Achim Hasenmueller
6 *
7 * Based on the work of the WINE group (www.winehq.com)
8 *
9 *
10 * Project Odin Software License can be found in LICENSE.TXT
11 *
12 */
13
14/*
15 - Corel 20000317 level
16 - (WINE 20000130 level)
17*/
18
19/* CB: todo
20 - porting/implementing string functions
21 - DPA_LoadStream
22 - DPA_SaveStream
23*/
24
25#include "comctl32.h"
26#include <memory.h>
27#include <string.h>
28#include <stdlib.h>
29#include <ctype.h>
30#include <wchar.h>
31#include <wcstr.h>
32#include <wctype.h>
33
34extern HANDLE COMCTL32_hHeap; /* handle to the private heap */
35
36/**************************************************************************
37 * DPA_Merge [COMCTL32.11]
38 *
39 * PARAMS
40 * hdpa1 [I] handle to a dynamic pointer array
41 * hdpa2 [I] handle to a dynamic pointer array
42 * dwFlags [I] flags
43 * pfnSort [I] pointer to sort function
44 * pfnMerge [I] pointer to merge function
45 * lParam [I] application specific value
46 *
47 * NOTES
48 * No more information available yet!
49 */
50
51BOOL WINAPI
52DPA_Merge (const HDPA hdpa1, const HDPA hdpa2, DWORD dwFlags,
53 PFNDPACOMPARE pfnCompare, PFNDPAMERGE pfnMerge, LPARAM lParam)
54{
55 INT nCount;
56
57#if 0 /* these go with the "incomplete implementation" below */
58 LPVOID pWork1, pWork2;
59 INT nResult;
60 INT nIndex;
61 INT nNewItems;
62#endif
63
64
65 dprintf(("COMCTL32: DPA_Merge"));
66
67 if (IsBadWritePtr (hdpa1, sizeof(DPA)))
68 return FALSE;
69
70 if (IsBadWritePtr (hdpa2, sizeof(DPA)))
71 return FALSE;
72
73 if (IsBadCodePtr ((FARPROC)pfnCompare))
74 return FALSE;
75
76 if (IsBadCodePtr ((FARPROC)pfnMerge))
77 return FALSE;
78
79 if (dwFlags & DPAM_SORT) {
80// TRACE("sorting dpa's!\n");
81 if (hdpa1->nItemCount > 0)
82 DPA_Sort (hdpa1, pfnCompare, lParam);
83// TRACE ("dpa 1 sorted!\n");
84 if (hdpa2->nItemCount > 0)
85 DPA_Sort (hdpa2, pfnCompare, lParam);
86// TRACE ("dpa 2 sorted!\n");
87 }
88
89 if (hdpa2->nItemCount < 1)
90 return TRUE;
91
92// TRACE("hdpa1->nItemCount=%d hdpa2->nItemCount=%d\n",
93// hdpa1->nItemCount, hdpa2->nItemCount);
94
95
96 /* preliminary hack - simply append the pointer list hdpa2 to hdpa1*/
97 for (nCount = 0; nCount < hdpa2->nItemCount; nCount++)
98 DPA_InsertPtr (hdpa1, hdpa1->nItemCount + 1, hdpa2->ptrs[nCount]);
99
100#if 0
101 /* incomplete implementation */
102
103 pWork1 = &(hdpa1->ptrs[hdpa1->nItemCount - 1]);
104 pWork2 = &(hdpa2->ptrs[hdpa2->nItemCount - 1]);
105
106 nIndex = hdpa1->nItemCount - 1;
107 nCount = hdpa2->nItemCount - 1;
108
109 do
110 {
111 nResult = (pfnCompare)(pWork1, pWork2, lParam);
112
113 if (nResult == 0)
114 {
115 PVOID ptr;
116
117 ptr = (pfnMerge)(1, pWork1, pWork2, lParam);
118 if (!ptr)
119 return FALSE;
120
121 nCount--;
122 pWork2--;
123 pWork1 = ptr;
124 }
125 else if (nResult < 0)
126 {
127 if (!dwFlags & 8)
128 {
129 PVOID ptr;
130
131 ptr = DPA_DeletePtr (hdpa1, hdpa1->nItemCount - 1);
132
133 (pfnMerge)(2, ptr, NULL, lParam);
134 }
135 }
136 else
137 {
138 if (!dwFlags & 4)
139 {
140 PVOID ptr;
141
142 ptr = (pfnMerge)(3, pWork2, NULL, lParam);
143 if (!ptr)
144 return FALSE;
145 DPA_InsertPtr (hdpa1, nIndex, ptr);
146 }
147 nCount--;
148 pWork2--;
149 }
150
151 nIndex--;
152 pWork1--;
153
154 }
155 while (nCount >= 0);
156#endif
157
158 return TRUE;
159}
160
161
162/**************************************************************************
163 * Alloc [COMCTL32.71]
164 *
165 * Allocates memory block from the dll's private heap
166 *
167 * PARAMS
168 * dwSize [I] size of the allocated memory block
169 *
170 * RETURNS
171 * Success: pointer to allocated memory block
172 * Failure: NULL
173 */
174
175
176LPVOID WINAPI COMCTL32_Alloc (DWORD dwSize)
177{
178 LPVOID lpPtr;
179
180 dprintf2(("COMCTL32: COMCTL32_Alloc"));
181
182 lpPtr = HeapAlloc (COMCTL32_hHeap, HEAP_ZERO_MEMORY, dwSize);
183
184 return lpPtr;
185}
186
187
188/**************************************************************************
189 * ReAlloc [COMCTL32.72]
190 *
191 * Changes the size of an allocated memory block or allocates a memory
192 * block using the dll's private heap.
193 *
194 * PARAMS
195 * lpSrc [I] pointer to memory block which will be resized
196 * dwSize [I] new size of the memory block.
197 *
198 * RETURNS
199 * Success: pointer to the resized memory block
200 * Failure: NULL
201 *
202 * NOTES
203 * If lpSrc is a NULL-pointer, then COMCTL32_ReAlloc allocates a memory
204 * block like COMCTL32_Alloc.
205 */
206
207LPVOID WINAPI COMCTL32_ReAlloc (LPVOID lpSrc, DWORD dwSize)
208{
209 LPVOID lpDest;
210
211 dprintf2(("COMCTL32: COMCTL32_ReAlloc"));
212
213 if (lpSrc)
214 lpDest = HeapReAlloc (COMCTL32_hHeap, HEAP_ZERO_MEMORY, lpSrc, dwSize);
215 else
216 lpDest = HeapAlloc (COMCTL32_hHeap, HEAP_ZERO_MEMORY, dwSize);
217
218 return lpDest;
219}
220
221
222/**************************************************************************
223 * Free [COMCTL32.73]
224 *
225 * Frees an allocated memory block from the dll's private heap.
226 *
227 * PARAMS
228 * lpMem [I] pointer to memory block which will be freed
229 *
230 * RETURNS
231 * Success: TRUE
232 * Failure: FALSE
233 */
234
235BOOL WINAPI COMCTL32_Free (LPVOID lpMem)
236{
237 dprintf2(("COMCTL32: COMCTL32_Free"));
238
239 return HeapFree (COMCTL32_hHeap, 0, lpMem);
240}
241
242
243/**************************************************************************
244 * GetSize [COMCTL32.74]
245 *
246 * Retrieves the size of the specified memory block from the dll's
247 * private heap.
248 *
249 * PARAMS
250 * lpMem [I] pointer to an allocated memory block
251 *
252 * RETURNS
253 * Success: size of the specified memory block
254 * Failure: 0
255 */
256
257DWORD WINAPI COMCTL32_GetSize (LPVOID lpMem)
258{
259 dprintf2(("COMCTL32: COMCTL32_GetSize"));
260
261 return HeapSize (COMCTL32_hHeap, 0, lpMem);
262}
263
264
265/**************************************************************************
266 * The MRU-API is a set of functions to manipulate MRU(Most Recently Used)
267 * lists.
268 *
269 * Stored in the reg. as a set of values under a single key. Each item in the
270 * list has a value name that is a single char. 'a' - 'z', '{', '|' or '}'.
271 * The order of the list is stored with value name 'MRUList' which is a string
272 * containing the value names (i.e. 'a', 'b', etc.) in the relevant order.
273 */
274
275typedef struct tagCREATEMRULIST
276{
277 DWORD cbSize; /* size of struct */
278 DWORD nMaxItems; /* max no. of items in list */
279 DWORD dwFlags; /* see below */
280 HKEY hKey; /* root reg. key under which list is saved */
281 LPCSTR lpszSubKey; /* reg. subkey */
282 PROC lpfnCompare; /* item compare proc */
283} CREATEMRULIST, *LPCREATEMRULIST;
284
285/* dwFlags */
286#define MRUF_STRING_LIST 0 /* list will contain strings */
287#define MRUF_BINARY_LIST 1 /* list will contain binary data */
288#define MRUF_DELAYED_SAVE 2 /* only save list order to reg. is FreeMRUList */
289
290/* If list is a string list lpfnCompare has the following prototype
291 * int CALLBACK MRUCompareString(LPCSTR s1, LPCSTR s2)
292 * for binary lists the prototype is
293 * int CALLBACK MRUCompareBinary(LPCVOID data1, LPCVOID data2, DWORD cbData)
294 * where cbData is the no. of bytes to compare.
295 * Need to check what return value means identical - 0?
296 */
297
298typedef struct tagMRU
299{
300 DWORD dwParam1; /* some kind of flag */
301 DWORD dwParam2;
302 DWORD dwParam3;
303 HKEY hkeyMRU;
304 LPCSTR lpszSubKey;
305 DWORD dwParam6;
306} MRU, *HMRU;
307
308HANDLE WINAPI
309CreateMRUListLazyA (LPCREATEMRULIST lpcml, DWORD dwParam2,
310 DWORD dwParam3, DWORD dwParam4);
311
312
313/**************************************************************************
314 * CreateMRUListA [COMCTL32.151]
315 *
316 * PARAMS
317 * lpcml [I] ptr to CREATEMRULIST structure.
318 *
319 * RETURNS
320 * Handle to MRU list.
321 */
322HANDLE WINAPI
323CreateMRUListA (LPCREATEMRULIST lpcml)
324{
325 dprintf(("COMCTL32: CreateMRUListA"));
326
327 return CreateMRUListLazyA (lpcml, 0, 0, 0);
328}
329
330/**************************************************************************
331 * FreeMRUListA [COMCTL32.152]
332 *
333 * PARAMS
334 * hMRUList [I] Handle to list.
335 *
336 */
337DWORD WINAPI
338FreeMRUListA (HANDLE hMRUList)
339{
340 dprintf(("COMCTL32: FreeMRUListA"));
341 //FIXME("(%08x) empty stub!\n", hMRUList);
342
343#if 0
344 if (!(hmru->dwParam1 & 1001)) {
345 RegSetValueExA (hmru->hKeyMRU, "MRUList", 0, REG_SZ,
346 hmru->lpszMRUString,
347 lstrlenA (hmru->lpszMRUString));
348 }
349
350
351 RegClosKey (hmru->hkeyMRU
352 COMCTL32_Free32 (hmru->lpszMRUString);
353#endif
354
355 return COMCTL32_Free ((LPVOID)hMRUList);
356}
357
358
359/**************************************************************************
360 * AddMRUData [COMCTL32.167]
361 *
362 * Add item to MRU binary list. If item already exists in list them it is
363 * simply moved up to the top of the list and not added again. If list is
364 * full then the least recently used item is removed to make room.
365 *
366 * PARAMS
367 * hList [I] Handle to list.
368 * lpData [I] ptr to data to add.
369 * cbData [I] no. of bytes of data.
370 *
371 * RETURNS
372 * No. corresponding to registry name where value is stored 'a' -> 0 etc.
373 * -1 on error.
374 */
375INT WINAPI
376AddMRUData (HANDLE hList, LPCVOID lpData, DWORD cbData)
377{
378 dprintf(("COMCTL32: AddMRUData - empty stub!"));
379
380 return 0;
381}
382
383/**************************************************************************
384 * AddMRUStringA [COMCTL32.153]
385 *
386 * Add item to MRU string list. If item already exists in list them it is
387 * simply moved up to the top of the list and not added again. If list is
388 * full then the least recently used item is removed to make room.
389 *
390 * PARAMS
391 * hList [I] Handle to list.
392 * lpszString [I] ptr to string to add.
393 *
394 * RETURNS
395 * No. corresponding to registry name where value is stored 'a' -> 0 etc.
396 * -1 on error.
397 */
398INT WINAPI
399AddMRUStringA(HANDLE hList, LPCSTR lpszString)
400{
401 dprintf(("COMCTL32: AddMRUStringA - empty stub!"));
402
403 return 0;
404}
405
406/**************************************************************************
407 * DelMRUString [COMCTL32.156]
408 *
409 * Removes item from either string or binary list (despite its name)
410 *
411 * PARAMS
412 * hList [I] list handle
413 * nItemPos [I] item position to remove 0 -> MRU
414 *
415 * RETURNS
416 * TRUE is successful, FALSE if nItemPos is out of range.
417 */
418BOOL WINAPI
419DelMRUString(HANDLE hList, INT nItemPos)
420{
421 dprintf(("COMCTL32: DelMRUString - empty stub!"));
422
423 return TRUE;
424}
425
426/**************************************************************************
427 * FindMRUData [COMCTL32.169]
428 *
429 * Searches binary list for item that matches lpData of length cbData.
430 * Returns position in list order 0 -> MRU and if lpRegNum != NULL then value
431 * corresponding to item's reg. name will be stored in it ('a' -> 0).
432 *
433 * PARAMS
434 * hList [I] list handle
435 * lpData [I] data to find
436 * cbData [I] length of data
437 * lpRegNum [O] position in registry (maybe NULL)
438 *
439 * RETURNS
440 * Position in list 0 -> MRU. -1 if item not found.
441 */
442INT WINAPI
443FindMRUData (HANDLE hList, LPCVOID lpData, DWORD cbData, LPINT lpRegNum)
444{
445 dprintf(("COMCTL32: FindMRUData - empty stub!"));
446
447 return 0;
448}
449
450/**************************************************************************
451 * FindMRUStringA [COMCTL32.155]
452 *
453 * Searches string list for item that matches lpszString.
454 * Returns position in list order 0 -> MRU and if lpRegNum != NULL then value
455 * corresponding to item's reg. name will be stored in it ('a' -> 0).
456 *
457 * PARAMS
458 * hList [I] list handle
459 * lpszString [I] string to find
460 * lpRegNum [O] position in registry (maybe NULL)
461 *
462 * RETURNS
463 * Position in list 0 -> MRU. -1 if item not found.
464 */
465INT WINAPI
466FindMRUStringA (HANDLE hList, LPCSTR lpszString, LPINT lpRegNum)
467{
468 dprintf(("COMCTL32: FindMRUStringA - empty stub!"));
469
470 return 0;
471}
472
473HANDLE WINAPI
474CreateMRUListLazyA (LPCREATEMRULIST lpcml, DWORD dwParam2, DWORD dwParam3, DWORD dwParam4)
475{
476 /* DWORD dwLocal1; *
477 * HKEY hkeyResult; *
478 * DWORD dwLocal3; *
479 * LPVOID lMRU; *
480 * DWORD dwLocal5; *
481 * DWORD dwLocal6; *
482 * DWORD dwLocal7; *
483 * DWORD dwDisposition; */
484
485 /* internal variables */
486 LPVOID ptr;
487
488 dprintf(("COMCTL32: CreateMRUListLazyA - empty stub!"));
489
490 if (lpcml == NULL)
491 return 0;
492
493 if (lpcml->cbSize < sizeof(CREATEMRULIST))
494 return 0;
495
496 //FIXME("(%lu %lu %lx %lx \"%s\" %p)\n",
497 // lpcml->cbSize, lpcml->nMaxItems, lpcml->dwFlags,
498 // (DWORD)lpcml->hKey, lpcml->lpszSubKey, lpcml->lpfnCompare);
499
500 /* dummy pointer creation */
501 ptr = COMCTL32_Alloc (32);
502
503 //FIXME("-- ret = %p\n", ptr);
504
505 return (HANDLE)ptr;
506}
507
508/**************************************************************************
509 * EnumMRUListA [COMCTL32.154]
510 *
511 * Enumerate item in a list
512 *
513 * PARAMS
514 * hList [I] list handle
515 * nItemPos [I] item position to enumerate
516 * lpBuffer [O] buffer to receive item
517 * nBufferSize [I] size of buffer
518 *
519 * RETURNS
520 * For binary lists specifies how many bytes were copied to buffer, for
521 * string lists specifies full length of string. Enumerating past the end
522 * of list returns -1.
523 * If lpBuffer == NULL or nItemPos is -ve return value is no. of items in
524 * the list.
525 */
526INT WINAPI EnumMRUListA(HANDLE hList, INT nItemPos, LPVOID lpBuffer,
527DWORD nBufferSize)
528{
529 dprintf(("COMCTL32: EnumMRUListA - empty stub!"));
530
531 return 0;
532}
533
534
535
536/**************************************************************************
537 * Str_GetPtrA [COMCTL32.233]
538 *
539 * PARAMS
540 * lpSrc [I]
541 * lpDest [O]
542 * nMaxLen [I]
543 *
544 * RETURNS
545 */
546
547INT WINAPI
548Str_GetPtrA (LPCSTR lpSrc, LPSTR lpDest, INT nMaxLen)
549{
550 INT len;
551
552 dprintf(("COMCTL32: Str_GetPtrA"));
553
554 if (!lpDest && lpSrc)
555 return lstrlenA (lpSrc);
556
557 if (nMaxLen == 0)
558 return 0;
559
560 if (lpSrc == NULL) {
561 lpDest[0] = '\0';
562 return 0;
563 }
564
565 len = lstrlenA (lpSrc);
566 if (len >= nMaxLen)
567 len = nMaxLen - 1;
568
569 RtlMoveMemory (lpDest, lpSrc, len);
570 lpDest[len] = '\0';
571
572 return len;
573}
574
575
576/**************************************************************************
577 * Str_SetPtrA [COMCTL32.234]
578 *
579 * PARAMS
580 * lppDest [O]
581 * lpSrc [I]
582 *
583 * RETURNS
584 */
585
586BOOL WINAPI
587Str_SetPtrA (LPSTR *lppDest, LPCSTR lpSrc)
588{
589 dprintf(("COMCTL32: Str_SetPtrA"));
590
591 if (lpSrc) {
592 LPSTR ptr = (LPSTR)COMCTL32_ReAlloc (*lppDest, lstrlenA (lpSrc) + 1);
593 if (!ptr)
594 return FALSE;
595 lstrcpyA (ptr, lpSrc);
596 *lppDest = ptr;
597 }
598 else {
599 if (*lppDest) {
600 COMCTL32_Free (*lppDest);
601 *lppDest = NULL;
602 }
603 }
604
605 return TRUE;
606}
607
608
609/**************************************************************************
610 * Str_GetPtrW [COMCTL32.235]
611 *
612 * PARAMS
613 * lpSrc [I]
614 * lpDest [O]
615 * nMaxLen [I]
616 *
617 * RETURNS
618 */
619
620INT WINAPI
621Str_GetPtrW (LPCWSTR lpSrc, LPWSTR lpDest, INT nMaxLen)
622{
623 INT len;
624
625 dprintf(("COMCTL32: Str_GetPtrW"));
626
627 if (!lpDest && lpSrc)
628 return lstrlenW (lpSrc);
629
630 if (nMaxLen == 0)
631 return 0;
632
633 if (lpSrc == NULL) {
634 lpDest[0] = L'\0';
635 return 0;
636 }
637
638 len = lstrlenW (lpSrc);
639 if (len >= nMaxLen)
640 len = nMaxLen - 1;
641
642 RtlMoveMemory (lpDest, lpSrc, len*sizeof(WCHAR));
643 lpDest[len] = L'\0';
644
645 return len;
646}
647
648
649/**************************************************************************
650 * Str_SetPtrW [COMCTL32.236]
651 *
652 * PARAMS
653 * lpDest [O]
654 * lpSrc [I]
655 *
656 * RETURNS
657 */
658
659BOOL WINAPI
660Str_SetPtrW (LPWSTR *lppDest, LPCWSTR lpSrc)
661{
662 dprintf(("COMCTL32: Str_SetPtrW"));
663
664 if (lpSrc) {
665 INT len = lstrlenW (lpSrc) + 1;
666 LPWSTR ptr = (LPWSTR)COMCTL32_ReAlloc (*lppDest, len * sizeof(WCHAR));
667 if (!ptr)
668 return FALSE;
669 lstrcpyW (ptr, lpSrc);
670 *lppDest = ptr;
671 }
672 else {
673 if (*lppDest) {
674 COMCTL32_Free (*lppDest);
675 *lppDest = NULL;
676 }
677 }
678
679 return TRUE;
680}
681
682
683/**************************************************************************
684 * The DSA-API is a set of functions to create and manipulate arrays of
685 * fix sized memory blocks. These arrays can store any kind of data
686 * (strings, icons...).
687 */
688
689/**************************************************************************
690 * DSA_Create [COMCTL32.320] Creates a dynamic storage array
691 *
692 * PARAMS
693 * nSize [I] size of the array elements
694 * nGrow [I] number of elements by which the array grows when it is filled
695 *
696 * RETURNS
697 * Success: pointer to a array control structure. use this like a handle.
698 * Failure: NULL
699 */
700
701HDSA WINAPI
702DSA_Create (INT nSize, INT nGrow)
703{
704 HDSA hdsa;
705
706 dprintf(("COMCTL32: DSA_Create"));
707
708 hdsa = (HDSA)COMCTL32_Alloc (sizeof(DSA));
709 if (hdsa)
710 {
711 hdsa->nItemCount = 0;
712 hdsa->pData = NULL;
713 hdsa->nMaxCount = 0;
714 hdsa->nItemSize = nSize;
715 hdsa->nGrow = MAX(1, nGrow);
716 }
717
718 return hdsa;
719}
720
721
722/**************************************************************************
723 * DSA_Destroy [COMCTL32.321] Destroys a dynamic storage array
724 *
725 * PARAMS
726 * hdsa [I] pointer to the array control structure
727 *
728 * RETURNS
729 * Success: TRUE
730 * Failure: FALSE
731 */
732
733BOOL WINAPI
734DSA_Destroy (const HDSA hdsa)
735{
736 dprintf(("COMCTL32: DSA_Destroy"));
737
738 if (!hdsa)
739 return FALSE;
740
741 if (hdsa->pData && (!COMCTL32_Free (hdsa->pData)))
742 return FALSE;
743
744 return COMCTL32_Free (hdsa);
745}
746
747
748/**************************************************************************
749 * DSA_GetItem [COMCTL32.322]
750 *
751 * PARAMS
752 * hdsa [I] pointer to the array control structure
753 * nIndex [I] number of the Item to get
754 * pDest [O] destination buffer. Has to be >= dwElementSize.
755 *
756 * RETURNS
757 * Success: TRUE
758 * Failure: FALSE
759 */
760
761BOOL WINAPI
762DSA_GetItem (const HDSA hdsa, INT nIndex, LPVOID pDest)
763{
764 LPVOID pSrc;
765
766 dprintf2(("COMCTL32: DSA_GetItem"));
767
768 if (!hdsa)
769 return FALSE;
770 if ((nIndex < 0) || (nIndex >= hdsa->nItemCount))
771 return FALSE;
772
773 pSrc = (char *) hdsa->pData + (hdsa->nItemSize * nIndex);
774 memmove (pDest, pSrc, hdsa->nItemSize);
775
776 return TRUE;
777}
778
779
780/**************************************************************************
781 * DSA_GetItemPtr [COMCTL32.323]
782 *
783 * Retrieves a pointer to the specified item.
784 *
785 * PARAMS
786 * hdsa [I] pointer to the array control structure
787 * nIndex [I] index of the desired item
788 *
789 * RETURNS
790 * Success: pointer to an item
791 * Failure: NULL
792 */
793
794LPVOID WINAPI
795DSA_GetItemPtr (const HDSA hdsa, INT nIndex)
796{
797 LPVOID pSrc;
798
799 dprintf2(("COMCTL32: DSA_GetItemPtr"));
800
801 if (!hdsa)
802 return NULL;
803 if ((nIndex < 0) || (nIndex >= hdsa->nItemCount))
804 return NULL;
805
806 pSrc = (char *) hdsa->pData + (hdsa->nItemSize * nIndex);
807
808// TRACE (commctrl, "-- ret=%p\n", pSrc);
809
810 return pSrc;
811}
812
813
814/**************************************************************************
815 * DSA_SetItem [COMCTL32.325]
816 *
817 * Sets the contents of an item in the array.
818 *
819 * PARAMS
820 * hdsa [I] pointer to the array control structure
821 * nIndex [I] index for the item
822 * pSrc [I] pointer to the new item data
823 *
824 * RETURNS
825 * Success: TRUE
826 * Failure: FALSE
827 */
828
829BOOL WINAPI
830DSA_SetItem (const HDSA hdsa, INT nIndex, LPVOID pSrc)
831{
832 INT nSize, nNewItems;
833 LPVOID pDest, lpTemp;
834
835 dprintf2(("COMCTL32: DSA_SetItem"));
836
837 if ((!hdsa) || nIndex < 0)
838 return FALSE;
839
840 if (hdsa->nItemCount <= nIndex) {
841 /* within the old array */
842 if (hdsa->nMaxCount > nIndex) {
843 /* within the allocated space, set a new boundary */
844 hdsa->nItemCount = nIndex + 1;
845 }
846 else {
847 /* resize the block of memory */
848 nNewItems =
849 hdsa->nGrow * ((INT)(((nIndex + 1) - 1) / hdsa->nGrow) + 1);
850 nSize = hdsa->nItemSize * nNewItems;
851
852 lpTemp = (LPVOID)COMCTL32_ReAlloc (hdsa->pData, nSize);
853 if (!lpTemp)
854 return FALSE;
855
856 hdsa->nMaxCount = nNewItems;
857 hdsa->nItemCount = nIndex + 1;
858 hdsa->pData = lpTemp;
859 }
860 }
861
862 /* put the new entry in */
863 pDest = (char *) hdsa->pData + (hdsa->nItemSize * nIndex);
864// TRACE("-- move dest=%p src=%p size=%d\n",
865// pDest, pSrc, hdsa->nItemSize);
866 memmove (pDest, pSrc, hdsa->nItemSize);
867
868 return TRUE;
869}
870
871
872/**************************************************************************
873 * DSA_InsertItem [COMCTL32.325]
874 *
875 * PARAMS
876 * hdsa [I] pointer to the array control structure
877 * nIndex [I] index for the new item
878 * pSrc [I] pointer to the element
879 *
880 * RETURNS
881 * Success: position of the new item
882 * Failure: -1
883 */
884
885INT WINAPI
886DSA_InsertItem (const HDSA hdsa, INT nIndex, LPVOID pSrc)
887{
888 INT nNewItems, nSize, i;
889 LPVOID lpTemp, lpDest;
890 LPDWORD p;
891
892 dprintf2(("COMCTL32: DSA_InsertItem"));
893
894 if ((!hdsa) || nIndex < 0)
895 return -1;
896
897 for (i = 0; i < hdsa->nItemSize; i += 4) {
898 p = *(DWORD**)((char *) pSrc + i);
899// if (IsBadStringPtrA ((char*)p, 256))
900// TRACE("-- %d=%p\n", i, (DWORD*)p);
901// else
902// TRACE("-- %d=%p [%s]\n", i, p, debugstr_a((char*)p));
903 }
904
905 /* when nIndex > nItemCount then append */
906 if (nIndex >= hdsa->nItemCount)
907 nIndex = hdsa->nItemCount;
908
909 /* do we need to resize ? */
910 if (hdsa->nItemCount >= hdsa->nMaxCount) {
911 nNewItems = hdsa->nMaxCount + hdsa->nGrow;
912 nSize = hdsa->nItemSize * nNewItems;
913
914 lpTemp = (LPVOID)COMCTL32_ReAlloc (hdsa->pData, nSize);
915 if (!lpTemp)
916 return -1;
917
918 hdsa->nMaxCount = nNewItems;
919 hdsa->pData = lpTemp;
920 }
921
922 /* do we need to move elements ? */
923 if (nIndex < hdsa->nItemCount) {
924 lpTemp = (char *) hdsa->pData + (hdsa->nItemSize * nIndex);
925 lpDest = (char *) lpTemp + hdsa->nItemSize;
926 nSize = (hdsa->nItemCount - nIndex) * hdsa->nItemSize;
927// TRACE("-- move dest=%p src=%p size=%d\n",
928// lpDest, lpTemp, nSize);
929 memmove (lpDest, lpTemp, nSize);
930 }
931
932 /* ok, we can put the new Item in */
933 hdsa->nItemCount++;
934 lpDest = (char *) hdsa->pData + (hdsa->nItemSize * nIndex);
935// TRACE("-- move dest=%p src=%p size=%d\n",
936// lpDest, pSrc, hdsa->nItemSize);
937 memmove (lpDest, pSrc, hdsa->nItemSize);
938
939 return hdsa->nItemCount;
940}
941
942
943/**************************************************************************
944 * DSA_DeleteItem [COMCTL32.326]
945 *
946 * PARAMS
947 * hdsa [I] pointer to the array control structure
948 * nIndex [I] index for the element to delete
949 *
950 * RETURNS
951 * Success: number of the deleted element
952 * Failure: -1
953 */
954
955INT WINAPI
956DSA_DeleteItem (const HDSA hdsa, INT nIndex)
957{
958 LPVOID lpDest,lpSrc;
959 INT nSize;
960
961 dprintf2(("COMCTL32: DSA_DeleteItem"));
962
963 if (!hdsa)
964 return -1;
965 if (nIndex < 0 || nIndex >= hdsa->nItemCount)
966 return -1;
967
968 /* do we need to move ? */
969 if (nIndex < hdsa->nItemCount - 1) {
970 lpDest = (char *) hdsa->pData + (hdsa->nItemSize * nIndex);
971 lpSrc = (char *) lpDest + hdsa->nItemSize;
972 nSize = hdsa->nItemSize * (hdsa->nItemCount - nIndex - 1);
973// TRACE (commctrl, "-- move dest=%p src=%p size=%d\n",
974// lpDest, lpSrc, nSize);
975 memmove (lpDest, lpSrc, nSize);
976 }
977
978 hdsa->nItemCount--;
979
980 /* free memory ? */
981 if ((hdsa->nMaxCount - hdsa->nItemCount) >= hdsa->nGrow) {
982 nSize = MAX(2*hdsa->nGrow,hdsa->nItemSize)*hdsa->nItemCount;
983
984 lpDest = (LPVOID)COMCTL32_ReAlloc (hdsa->pData, nSize);
985 if (!lpDest)
986 return -1;
987
988 hdsa->nMaxCount = hdsa->nItemCount;
989 hdsa->pData = lpDest;
990 }
991
992 return nIndex;
993}
994
995
996/**************************************************************************
997 * DSA_DeleteAllItems [COMCTL32.326]
998 *
999 * Removes all items and reinitializes the array.
1000 *
1001 * PARAMS
1002 * hdsa [I] pointer to the array control structure
1003 *
1004 * RETURNS
1005 * Success: TRUE
1006 * Failure: FALSE
1007 */
1008
1009BOOL WINAPI
1010DSA_DeleteAllItems (const HDSA hdsa)
1011{
1012 dprintf(("COMCTL32: DSA_DeleteAllItems"));
1013
1014 if (!hdsa)
1015 return FALSE;
1016 if (hdsa->pData && (!COMCTL32_Free (hdsa->pData)))
1017 return FALSE;
1018
1019 hdsa->nItemCount = 0;
1020 hdsa->pData = NULL;
1021 hdsa->nMaxCount = 0;
1022
1023 return TRUE;
1024}
1025
1026
1027/**************************************************************************
1028 * The DPA-API is a set of functions to create and manipulate arrays of
1029 * pointers.
1030 */
1031
1032/**************************************************************************
1033 * DPA_Create [COMCTL32.328] Creates a dynamic pointer array
1034 *
1035 * PARAMS
1036 * nGrow [I] number of items by which the array grows when it is filled
1037 *
1038 * RETURNS
1039 * Success: handle (pointer) to the pointer array.
1040 * Failure: NULL
1041 */
1042
1043HDPA WINAPI
1044DPA_Create (INT nGrow)
1045{
1046 HDPA hdpa;
1047
1048 dprintf2(("COMCTL32: DPA_Create"));
1049
1050 hdpa = (HDPA)COMCTL32_Alloc (sizeof(DPA));
1051 if (hdpa) {
1052 hdpa->nGrow = MAX(8, nGrow);
1053 hdpa->hHeap = COMCTL32_hHeap;
1054 hdpa->nMaxCount = hdpa->nGrow * 2;
1055 hdpa->ptrs =
1056 (LPVOID*)COMCTL32_Alloc (hdpa->nMaxCount * sizeof(LPVOID));
1057 }
1058
1059// TRACE (commctrl, "-- %p\n", hdpa);
1060
1061 return hdpa;
1062}
1063
1064
1065/**************************************************************************
1066 * DPA_Destroy [COMCTL32.329] Destroys a dynamic pointer array
1067 *
1068 * PARAMS
1069 * hdpa [I] handle (pointer) to the pointer array
1070 *
1071 * RETURNS
1072 * Success: TRUE
1073 * Failure: FALSE
1074 */
1075
1076BOOL WINAPI
1077DPA_Destroy (const HDPA hdpa)
1078{
1079 dprintf2(("COMCTL32: DPA_Destroy"));
1080
1081 if (!hdpa)
1082 return FALSE;
1083
1084 if (hdpa->ptrs && (!HeapFree (hdpa->hHeap, 0, hdpa->ptrs)))
1085 return FALSE;
1086
1087 return HeapFree (hdpa->hHeap, 0, hdpa);
1088}
1089
1090
1091/**************************************************************************
1092 * DPA_Grow [COMCTL32.330]
1093 *
1094 * Sets the growth amount.
1095 *
1096 * PARAMS
1097 * hdpa [I] handle (pointer) to the existing (source) pointer array
1098 * nGrow [I] number of items, the array grows, when it's too small
1099 *
1100 * RETURNS
1101 * Success: TRUE
1102 * Failure: FALSE
1103 */
1104
1105BOOL WINAPI
1106DPA_Grow (const HDPA hdpa, INT nGrow)
1107{
1108 dprintf2(("COMCTL32: DPA_Grow"));
1109
1110 if (!hdpa)
1111 return FALSE;
1112
1113 hdpa->nGrow = MAX(8, nGrow);
1114
1115 return TRUE;
1116}
1117
1118
1119/**************************************************************************
1120 * DPA_Clone [COMCTL32.331]
1121 *
1122 * Copies a pointer array to an other one or creates a copy
1123 *
1124 * PARAMS
1125 * hdpa [I] handle (pointer) to the existing (source) pointer array
1126 * hdpaNew [O] handle (pointer) to the destination pointer array
1127 *
1128 * RETURNS
1129 * Success: pointer to the destination pointer array.
1130 * Failure: NULL
1131 *
1132 * NOTES
1133 * - If the 'hdpaNew' is a NULL-Pointer, a copy of the source pointer
1134 * array will be created and it's handle (pointer) is returned.
1135 * - If 'hdpa' is a NULL-Pointer, the original implementation crashes,
1136 * this implementation just returns NULL.
1137 */
1138
1139HDPA WINAPI
1140DPA_Clone (const HDPA hdpa, const HDPA hdpaNew)
1141{
1142 INT nNewItems, nSize;
1143 HDPA hdpaTemp;
1144
1145 dprintf2(("COMCTL32: DPA_Clone"));
1146
1147 if (!hdpa)
1148 return NULL;
1149
1150 if (!hdpaNew) {
1151 /* create a new DPA */
1152 hdpaTemp = (HDPA)HeapAlloc (hdpa->hHeap, HEAP_ZERO_MEMORY,
1153 sizeof(DPA));
1154 hdpaTemp->hHeap = hdpa->hHeap;
1155 hdpaTemp->nGrow = hdpa->nGrow;
1156 }
1157 else
1158 hdpaTemp = hdpaNew;
1159
1160 if (hdpaTemp->ptrs) {
1161 /* remove old pointer array */
1162 HeapFree (hdpaTemp->hHeap, 0, hdpaTemp->ptrs);
1163 hdpaTemp->ptrs = NULL;
1164 hdpaTemp->nItemCount = 0;
1165 hdpaTemp->nMaxCount = 0;
1166 }
1167
1168 /* create a new pointer array */
1169 nNewItems = hdpaTemp->nGrow *
1170 ((INT)((hdpa->nItemCount - 1) / hdpaTemp->nGrow) + 1);
1171 nSize = nNewItems * sizeof(LPVOID);
1172 hdpaTemp->ptrs =
1173 (LPVOID*)HeapAlloc (hdpaTemp->hHeap, HEAP_ZERO_MEMORY, nSize);
1174 hdpaTemp->nMaxCount = nNewItems;
1175
1176 /* clone the pointer array */
1177 hdpaTemp->nItemCount = hdpa->nItemCount;
1178 memmove (hdpaTemp->ptrs, hdpa->ptrs,
1179 hdpaTemp->nItemCount * sizeof(LPVOID));
1180
1181 return hdpaTemp;
1182}
1183
1184
1185/**************************************************************************
1186 * DPA_GetPtr [COMCTL32.332]
1187 *
1188 * Retrieves a pointer from a dynamic pointer array
1189 *
1190 * PARAMS
1191 * hdpa [I] handle (pointer) to the pointer array
1192 * nIndex [I] array index of the desired pointer
1193 *
1194 * RETURNS
1195 * Success: pointer
1196 * Failure: NULL
1197 */
1198
1199LPVOID WINAPI
1200DPA_GetPtr (const HDPA hdpa, INT i)
1201{
1202 dprintf2(("COMCTL32: DPA_GetPtr"));
1203
1204 if (!hdpa)
1205 return NULL;
1206 if (!hdpa->ptrs)
1207 return NULL;
1208 if ((i < 0) || (i >= hdpa->nItemCount))
1209 return NULL;
1210
1211// TRACE (commctrl, "-- %p\n", hdpa->ptrs[i]);
1212
1213 return hdpa->ptrs[i];
1214}
1215
1216
1217/**************************************************************************
1218 * DPA_GetPtrIndex [COMCTL32.333]
1219 *
1220 * Retrieves the index of the specified pointer
1221 *
1222 * PARAMS
1223 * hdpa [I] handle (pointer) to the pointer array
1224 * p [I] pointer
1225 *
1226 * RETURNS
1227 * Success: index of the specified pointer
1228 * Failure: -1
1229 */
1230
1231INT WINAPI
1232DPA_GetPtrIndex (const HDPA hdpa, LPVOID p)
1233{
1234 INT i;
1235
1236 dprintf2(("COMCTL32: DPA_GetPtrIndex"));
1237
1238 if (!hdpa->ptrs)
1239 return -1;
1240
1241 for (i = 0; i < hdpa->nItemCount; i++) {
1242 if (hdpa->ptrs[i] == p)
1243 return i;
1244 }
1245
1246 return -1;
1247}
1248
1249
1250/**************************************************************************
1251 * DPA_InsertPtr [COMCTL32.334]
1252 *
1253 * Inserts a pointer into a dynamic pointer array
1254 *
1255 * PARAMS
1256 * hdpa [I] handle (pointer) to the array
1257 * i [I] array index
1258 * p [I] pointer to insert
1259 *
1260 * RETURNS
1261 * Success: index of the inserted pointer
1262 * Failure: -1
1263 */
1264
1265INT WINAPI
1266DPA_InsertPtr (const HDPA hdpa, INT i, LPVOID p)
1267{
1268 INT nNewItems, nSize, nIndex = 0;
1269 LPVOID *lpTemp, *lpDest;
1270
1271 dprintf2(("COMCTL32: DPA_InsertPtr"));
1272
1273 if ((!hdpa) || (i < 0))
1274 return -1;
1275
1276 if (!hdpa->ptrs) {
1277 hdpa->ptrs =
1278 (LPVOID*)HeapAlloc (hdpa->hHeap, HEAP_ZERO_MEMORY,
1279 2 * hdpa->nGrow * sizeof(LPVOID));
1280 if (!hdpa->ptrs)
1281 return -1;
1282 hdpa->nMaxCount = hdpa->nGrow * 2;
1283 nIndex = 0;
1284 }
1285 else {
1286 if (hdpa->nItemCount >= hdpa->nMaxCount) {
1287// TRACE (commctrl, "-- resizing\n");
1288 nNewItems = hdpa->nMaxCount + hdpa->nGrow;
1289 nSize = nNewItems * sizeof(LPVOID);
1290
1291 lpTemp = (LPVOID*)HeapReAlloc (hdpa->hHeap, HEAP_ZERO_MEMORY,
1292 hdpa->ptrs, nSize);
1293 if (!lpTemp)
1294 return -1;
1295 hdpa->nMaxCount = nNewItems;
1296 hdpa->ptrs = lpTemp;
1297 }
1298
1299 if (i >= hdpa->nItemCount) {
1300 nIndex = hdpa->nItemCount;
1301// TRACE (commctrl, "-- appending at %d\n", nIndex);
1302 }
1303 else {
1304// TRACE (commctrl, "-- inserting at %d\n", i);
1305 lpTemp = hdpa->ptrs + i;
1306 lpDest = lpTemp + 1;
1307 nSize = (hdpa->nItemCount - i) * sizeof(LPVOID);
1308// TRACE (commctrl, "-- move dest=%p src=%p size=%x\n",
1309// lpDest, lpTemp, nSize);
1310 memmove (lpDest, lpTemp, nSize);
1311 nIndex = i;
1312 }
1313 }
1314
1315 /* insert item */
1316 hdpa->nItemCount++;
1317 hdpa->ptrs[nIndex] = p;
1318
1319 return nIndex;
1320}
1321
1322
1323/**************************************************************************
1324 * DPA_SetPtr [COMCTL32.335]
1325 *
1326 * Sets a pointer in the pointer array
1327 *
1328 * PARAMS
1329 * hdpa [I] handle (pointer) to the pointer array
1330 * i [I] index of the pointer that will be set
1331 * p [I] pointer to be set
1332 *
1333 * RETURNS
1334 * Success: TRUE
1335 * Failure: FALSE
1336 */
1337
1338BOOL WINAPI
1339DPA_SetPtr (const HDPA hdpa, INT i, LPVOID p)
1340{
1341 LPVOID *lpTemp;
1342
1343 dprintf2(("COMCTL32: DPA_SetPtr"));
1344
1345 if ((!hdpa) || i < 0)
1346 return FALSE;
1347
1348 if (hdpa->nItemCount <= i) {
1349 /* within the old array */
1350 if (hdpa->nMaxCount > i) {
1351 /* within the allocated space, set a new boundary */
1352 hdpa->nItemCount = i;
1353 }
1354 else {
1355 /* resize the block of memory */
1356 INT nNewItems =
1357 hdpa->nGrow * ((INT)(((i+1) - 1) / hdpa->nGrow) + 1);
1358 INT nSize = nNewItems * sizeof(LPVOID);
1359
1360 lpTemp = (LPVOID*)HeapReAlloc (hdpa->hHeap, HEAP_ZERO_MEMORY,
1361 hdpa->ptrs, nSize);
1362 if (!lpTemp)
1363 return FALSE;
1364
1365 hdpa->nItemCount = nNewItems;
1366 hdpa->ptrs = lpTemp;
1367 }
1368 }
1369
1370 /* put the new entry in */
1371 hdpa->ptrs[i] = p;
1372
1373 return TRUE;
1374}
1375
1376
1377/**************************************************************************
1378 * DPA_DeletePtr [COMCTL32.336]
1379 *
1380 * Removes a pointer from the pointer array.
1381 *
1382 * PARAMS
1383 * hdpa [I] handle (pointer) to the pointer array
1384 * i [I] index of the pointer that will be deleted
1385 *
1386 * RETURNS
1387 * Success: deleted pointer
1388 * Failure: NULL
1389 */
1390
1391LPVOID WINAPI
1392DPA_DeletePtr (const HDPA hdpa, INT i)
1393{
1394 LPVOID *lpDest, *lpSrc, lpTemp = NULL;
1395 INT nSize;
1396
1397 dprintf2(("COMCTL32: DPA_DeletePtr"));
1398
1399 if ((!hdpa) || i < 0 || i >= hdpa->nItemCount)
1400 return NULL;
1401
1402 lpTemp = hdpa->ptrs[i];
1403
1404 /* do we need to move ?*/
1405 if (i < hdpa->nItemCount - 1) {
1406 lpDest = hdpa->ptrs + i;
1407 lpSrc = lpDest + 1;
1408 nSize = (hdpa->nItemCount - i - 1) * sizeof(LPVOID);
1409// TRACE (commctrl,"-- move dest=%p src=%p size=%x\n",
1410// lpDest, lpSrc, nSize);
1411 memmove (lpDest, lpSrc, nSize);
1412 }
1413
1414 hdpa->nItemCount --;
1415
1416 /* free memory ?*/
1417 if ((hdpa->nMaxCount - hdpa->nItemCount) >= hdpa->nGrow) {
1418 INT nNewItems = MAX(hdpa->nGrow*2,hdpa->nItemCount);
1419
1420 nSize = nNewItems * sizeof(LPVOID);
1421 lpDest = (LPVOID*)HeapReAlloc (hdpa->hHeap, HEAP_ZERO_MEMORY,
1422 hdpa->ptrs, nSize);
1423 if (!lpDest)
1424 return NULL;
1425
1426 hdpa->nMaxCount = nNewItems;
1427 hdpa->ptrs = (LPVOID*)lpDest;
1428 }
1429
1430 return lpTemp;
1431}
1432
1433
1434/**************************************************************************
1435 * DPA_DeleteAllPtrs [COMCTL32.337]
1436 *
1437 * Removes all pointers and reinitializes the array.
1438 *
1439 * PARAMS
1440 * hdpa [I] handle (pointer) to the pointer array
1441 *
1442 * RETURNS
1443 * Success: TRUE
1444 * Failure: FALSE
1445 */
1446
1447BOOL WINAPI
1448DPA_DeleteAllPtrs (const HDPA hdpa)
1449{
1450 dprintf2(("COMCTL32: DPA_DeleteAllPtrs"));
1451
1452 if (!hdpa)
1453 return FALSE;
1454
1455 if (hdpa->ptrs && (!HeapFree (hdpa->hHeap, 0, hdpa->ptrs)))
1456 return FALSE;
1457
1458 hdpa->nItemCount = 0;
1459 hdpa->nMaxCount = hdpa->nGrow * 2;
1460 hdpa->ptrs = (LPVOID*)HeapAlloc (hdpa->hHeap, HEAP_ZERO_MEMORY,
1461 hdpa->nMaxCount * sizeof(LPVOID));
1462
1463 return TRUE;
1464}
1465
1466
1467/**************************************************************************
1468 * DPA_QuickSort [Internal]
1469 *
1470 * Ordinary quicksort (used by DPA_Sort).
1471 *
1472 * PARAMS
1473 * lpPtrs [I] pointer to the pointer array
1474 * l [I] index of the "left border" of the partition
1475 * r [I] index of the "right border" of the partition
1476 * pfnCompare [I] pointer to the compare function
1477 * lParam [I] user defined value (3rd parameter in compare function)
1478 *
1479 * RETURNS
1480 * NONE
1481 *
1482 * NOTES:
1483 * Reverted back to the orginal quick sort, because the existing sort did not sort.
1484 * Kudos to the orginal author of the quick sort.
1485 */
1486
1487static VOID
1488DPA_QuickSort (LPVOID *lpPtrs, INT l, INT r,
1489 PFNDPACOMPARE pfnCompare, LPARAM lParam)
1490{
1491 LPVOID t, v;
1492 INT i, j;
1493
1494 //TRACE("l=%i r=%i\n", l, r);
1495
1496 i = l;
1497 j = r;
1498 v = lpPtrs[(int)(l+r)/2];
1499 do {
1500 while ((pfnCompare)(lpPtrs[i], v, lParam) < 0) i++;
1501 while ((pfnCompare)(lpPtrs[j], v, lParam) > 0) j--;
1502 if (i <= j)
1503 {
1504 t = lpPtrs[i];
1505 lpPtrs[i++] = lpPtrs[j];
1506 lpPtrs[j--] = t;
1507 }
1508 } while (i <= j);
1509 if (l < j) DPA_QuickSort (lpPtrs, l, j, pfnCompare, lParam);
1510 if (i < r) DPA_QuickSort (lpPtrs, i, r, pfnCompare, lParam);
1511}
1512
1513//internal API
1514INT DPA_InsertPtrSorted(const HDPA hdpa,LPVOID p,PFNDPACOMPARE pfnCompare,LPARAM lParam)
1515{
1516 INT pos,minPos,maxPos,res;
1517
1518 if (!hdpa || !pfnCompare) return -1;
1519
1520 if (hdpa->nItemCount == 0)
1521 return DPA_InsertPtr(hdpa,0,p);
1522
1523 //check last
1524 if ((pfnCompare)(p,hdpa->ptrs[hdpa->nItemCount-1],lParam) >= 0)
1525 {
1526 return DPA_InsertPtr(hdpa,hdpa->nItemCount,p);
1527 }
1528 //check first
1529 if ((pfnCompare)(p,hdpa->ptrs[0],lParam) < 0)
1530 {
1531 return DPA_InsertPtr(hdpa,0,p);
1532 }
1533
1534 minPos = 1;
1535 maxPos = hdpa->nItemCount-1;
1536
1537 while (minPos != maxPos)
1538 {
1539 pos = (minPos+maxPos)/2;
1540 res = (pfnCompare)(p,hdpa->ptrs[pos],lParam);
1541 if (res < 0)
1542 maxPos = pos;
1543 else
1544 minPos = pos+1;
1545 }
1546
1547 return DPA_InsertPtr(hdpa,minPos,p);
1548}
1549
1550/**************************************************************************
1551 * DPA_Sort [COMCTL32.338]
1552 *
1553 * Sorts a pointer array using a user defined compare function
1554 *
1555 * PARAMS
1556 * hdpa [I] handle (pointer) to the pointer array
1557 * pfnCompare [I] pointer to the compare function
1558 * lParam [I] user defined value (3rd parameter of compare function)
1559 *
1560 * RETURNS
1561 * Success: TRUE
1562 * Failure: FALSE
1563 */
1564
1565BOOL WINAPI
1566DPA_Sort (const HDPA hdpa, PFNDPACOMPARE pfnCompare, LPARAM lParam)
1567{
1568 dprintf2(("COMCTL32: DPA_Sort"));
1569
1570 if (!hdpa || !pfnCompare)
1571 return FALSE;
1572
1573 if ((hdpa->nItemCount > 1) && (hdpa->ptrs))
1574 DPA_QuickSort (hdpa->ptrs, 0, hdpa->nItemCount - 1,
1575 pfnCompare, lParam);
1576
1577 return TRUE;
1578}
1579
1580
1581/**************************************************************************
1582 * DPA_Search [COMCTL32.339]
1583 *
1584 * Searches a pointer array for a specified pointer
1585 *
1586 * PARAMS
1587 * hdpa [I] handle (pointer) to the pointer array
1588 * pFind [I] pointer to search for
1589 * nStart [I] start index
1590 * pfnCompare [I] pointer to the compare function
1591 * lParam [I] user defined value (3rd parameter of compare function)
1592 * uOptions [I] search options
1593 *
1594 * RETURNS
1595 * Success: index of the pointer in the array.
1596 * Failure: -1
1597 *
1598 * NOTES
1599 * Binary search taken from R.Sedgewick "Algorithms in C"!
1600 * Function is NOT tested!
1601 * If something goes wrong, blame HIM not ME! (Eric Kohl)
1602 */
1603
1604INT WINAPI
1605DPA_Search (const HDPA hdpa, LPVOID pFind, INT nStart,
1606 PFNDPACOMPARE pfnCompare, LPARAM lParam, UINT uOptions)
1607{
1608 dprintf2(("COMCTL32: DPA_Search"));
1609
1610 if (!hdpa || !pfnCompare || !pFind)
1611 return -1;
1612
1613 if (uOptions & DPAS_SORTED) {
1614 /* array is sorted --> use binary search */
1615 INT l, r, x, n;
1616 LPVOID *lpPtr;
1617
1618// TRACE (commctrl, "binary search\n");
1619
1620 l = (nStart == -1) ? 0 : nStart;
1621 r = hdpa->nItemCount - 1;
1622 lpPtr = hdpa->ptrs;
1623 while (r >= l) {
1624 x = (l + r) / 2;
1625 n = (pfnCompare)(pFind, lpPtr[x], lParam);
1626 if (n < 0)
1627 r = x - 1;
1628 else
1629 l = x + 1;
1630 if (n == 0) {
1631// TRACE (commctrl, "-- ret=%d\n", n);
1632 return n;
1633 }
1634 }
1635
1636 if (uOptions & DPAS_INSERTBEFORE) {
1637// TRACE (commctrl, "-- ret=%d\n", r);
1638 return r;
1639 }
1640
1641 if (uOptions & DPAS_INSERTAFTER) {
1642// TRACE (commctrl, "-- ret=%d\n", l);
1643 return l;
1644 }
1645 }
1646 else {
1647 /* array is not sorted --> use linear search */
1648 LPVOID *lpPtr;
1649 INT nIndex;
1650
1651// TRACE (commctrl, "linear search\n");
1652
1653 nIndex = (nStart == -1)? 0 : nStart;
1654 lpPtr = hdpa->ptrs;
1655 for (; nIndex < hdpa->nItemCount; nIndex++) {
1656 if ((pfnCompare)(pFind, lpPtr[nIndex], lParam) == 0) {
1657// TRACE (commctrl, "-- ret=%d\n", nIndex);
1658 return nIndex;
1659 }
1660 }
1661 }
1662
1663// TRACE (commctrl, "-- not found: ret=-1\n");
1664 return -1;
1665}
1666
1667
1668/**************************************************************************
1669 * DPA_CreateEx [COMCTL32.340]
1670 *
1671 * Creates a dynamic pointer array using the specified size and heap.
1672 *
1673 * PARAMS
1674 * nGrow [I] number of items by which the array grows when it is filled
1675 * hHeap [I] handle to the heap where the array is stored
1676 *
1677 * RETURNS
1678 * Success: handle (pointer) to the pointer array.
1679 * Failure: NULL
1680 */
1681
1682HDPA WINAPI
1683DPA_CreateEx (INT nGrow, HANDLE hHeap)
1684{
1685 HDPA hdpa;
1686
1687 dprintf2(("COMCTL32: DPA_CreateEx"));
1688
1689 if (hHeap)
1690 hdpa = (HDPA)HeapAlloc (hHeap, HEAP_ZERO_MEMORY, sizeof(DPA));
1691 else
1692 hdpa = (HDPA)COMCTL32_Alloc (sizeof(DPA));
1693
1694 if (hdpa) {
1695 hdpa->nGrow = MIN(8, nGrow);
1696 hdpa->hHeap = hHeap ? hHeap : COMCTL32_hHeap;
1697 hdpa->nMaxCount = hdpa->nGrow * 2;
1698 hdpa->ptrs =
1699 (LPVOID*)HeapAlloc (hHeap, HEAP_ZERO_MEMORY,
1700 hdpa->nMaxCount * sizeof(LPVOID));
1701 }
1702
1703// TRACE (commctrl, "-- %p\n", hdpa);
1704
1705 return hdpa;
1706}
1707
1708/**************************************************************************
1709 * Notification functions
1710 */
1711
1712typedef struct tagNOTIFYDATA
1713{
1714 HWND hwndFrom;
1715 HWND hwndTo;
1716 DWORD dwParam3;
1717 DWORD dwParam4;
1718 DWORD dwParam5;
1719 DWORD dwParam6;
1720} NOTIFYDATA, *LPNOTIFYDATA;
1721
1722
1723/**************************************************************************
1724 * DoNotify [Internal]
1725 */
1726
1727static LRESULT
1728DoNotify (LPNOTIFYDATA lpNotify, UINT uCode, LPNMHDR lpHdr)
1729{
1730 NMHDR nmhdr;
1731 LPNMHDR lpNmh = NULL;
1732 UINT idFrom = 0;
1733
1734// TRACE (commctrl, "(0x%04x 0x%04x %d %p 0x%08lx)\n",
1735// lpNotify->hwndFrom, lpNotify->hwndTo, uCode, lpHdr,
1736// lpNotify->dwParam5);
1737
1738 if (!lpNotify->hwndTo)
1739 return 0;
1740
1741 if (lpNotify->hwndFrom == -1) {
1742 lpNmh = lpHdr;
1743 idFrom = lpHdr->idFrom;
1744 }
1745 else {
1746 if (lpNotify->hwndFrom) {
1747 HWND hwndParent = GetParent (lpNotify->hwndFrom);
1748 if (hwndParent) {
1749 hwndParent = GetWindow (lpNotify->hwndFrom, GW_OWNER);
1750 if (hwndParent)
1751 idFrom = GetDlgCtrlID (lpNotify->hwndFrom);
1752 }
1753 }
1754
1755 lpNmh = (lpHdr) ? lpHdr : &nmhdr;
1756
1757 lpNmh->hwndFrom = lpNotify->hwndFrom;
1758 lpNmh->idFrom = idFrom;
1759 lpNmh->code = uCode;
1760 }
1761
1762 return SendMessageA (lpNotify->hwndTo, WM_NOTIFY, idFrom, (LPARAM)lpNmh);
1763}
1764
1765
1766/**************************************************************************
1767 * SendNotify [COMCTL32.341]
1768 *
1769 * PARAMS
1770 * hwndFrom [I]
1771 * hwndTo [I]
1772 * uCode [I]
1773 * lpHdr [I]
1774 *
1775 * RETURNS
1776 * Success: return value from notification
1777 * Failure: 0
1778 */
1779
1780LRESULT WINAPI
1781COMCTL32_SendNotify (HWND hwndFrom, HWND hwndTo,
1782 UINT uCode, LPNMHDR lpHdr)
1783{
1784 NOTIFYDATA notify;
1785
1786 dprintf(("COMCTL32: SendNotify"));
1787
1788 notify.hwndFrom = hwndFrom;
1789 notify.hwndTo = hwndTo;
1790 notify.dwParam5 = 0;
1791 notify.dwParam6 = 0;
1792
1793 return DoNotify (&notify, uCode, lpHdr);
1794}
1795
1796
1797/**************************************************************************
1798 * SendNotifyEx [COMCTL32.342]
1799 *
1800 * PARAMS
1801 * hwndFrom [I]
1802 * hwndTo [I]
1803 * uCode [I]
1804 * lpHdr [I]
1805 * dwParam5 [I]
1806 *
1807 * RETURNS
1808 * Success: return value from notification
1809 * Failure: 0
1810 */
1811
1812LRESULT WINAPI
1813COMCTL32_SendNotifyEx (HWND hwndTo, HWND hwndFrom, UINT uCode,
1814 LPNMHDR lpHdr, DWORD dwParam5)
1815{
1816 NOTIFYDATA notify;
1817 HWND hwndNotify;
1818
1819 dprintf(("COMCTL32: SendNotifyEx"));
1820
1821 hwndNotify = hwndTo;
1822 if (!hwndTo) {
1823 if (IsWindow (hwndFrom)) {
1824 hwndNotify = GetParent (hwndFrom);
1825 if (!hwndNotify)
1826 return 0;
1827 }
1828 }
1829
1830 notify.hwndFrom = hwndFrom;
1831 notify.hwndTo = hwndNotify;
1832 notify.dwParam5 = dwParam5;
1833 notify.dwParam6 = 0;
1834
1835 return DoNotify (&notify, uCode, lpHdr);
1836}
1837
1838
1839/**************************************************************************
1840 * StrChrA [COMCTL32.350]
1841 *
1842 */
1843
1844LPSTR WINAPI
1845COMCTL32_StrChrA (LPCSTR lpString, CHAR cChar)
1846{
1847 dprintf(("COMCTL32: StrChrA"));
1848
1849 return strchr (lpString, cChar);
1850}
1851
1852
1853/**************************************************************************
1854 * StrStrIA [COMCTL32.355]
1855 */
1856
1857LPSTR WINAPI
1858COMCTL32_StrStrIA (LPCSTR lpStr1, LPCSTR lpStr2)
1859{
1860 INT len1, len2, i;
1861 CHAR first;
1862
1863 dprintf(("COMCTL32: StrStrIA"));
1864
1865 if (*lpStr2 == 0)
1866 return ((LPSTR)lpStr1);
1867 len1 = 0;
1868 while (lpStr1[len1] != 0) ++len1;
1869 len2 = 0;
1870 while (lpStr2[len2] != 0) ++len2;
1871 if (len2 == 0)
1872 return ((LPSTR)(lpStr1 + len1));
1873 first = tolower (*lpStr2);
1874 while (len1 >= len2) {
1875 if (tolower(*lpStr1) == first) {
1876 for (i = 1; i < len2; ++i)
1877 if (tolower (lpStr1[i]) != tolower(lpStr2[i]))
1878 break;
1879 if (i >= len2)
1880 return ((LPSTR)lpStr1);
1881 }
1882 ++lpStr1; --len1;
1883 }
1884 return (NULL);
1885}
1886
1887
1888/**************************************************************************
1889 * StrToIntA [COMCTL32.357] Converts a string to a signed integer.
1890 */
1891
1892INT WINAPI
1893COMCTL32_StrToIntA (LPSTR lpString)
1894{
1895 dprintf(("COMCTL32: StrToIntA"));
1896
1897 return atoi(lpString);
1898}
1899
1900/**************************************************************************
1901 * DPA_EnumCallback [COMCTL32.385]
1902 *
1903 * Enumerates all items in a dynamic pointer array.
1904 *
1905 * PARAMS
1906 * hdpa [I] handle to the dynamic pointer array
1907 * enumProc [I]
1908 * lParam [I]
1909 *
1910 * RETURNS
1911 * none
1912 */
1913
1914
1915VOID WINAPI
1916DPA_EnumCallback (const HDPA hdpa, DPAENUMPROC enumProc, LPARAM lParam)
1917{
1918 INT i;
1919
1920 dprintf(("COMCTL32: DPA_EnumCallback"));
1921
1922 if (!hdpa)
1923 return;
1924 if (hdpa->nItemCount <= 0)
1925 return;
1926
1927 for (i = 0; i < hdpa->nItemCount; i++) {
1928 if ((enumProc)(hdpa->ptrs[i], lParam) == 0)
1929 return;
1930 }
1931
1932 return;
1933}
1934
1935
1936/**************************************************************************
1937 * DPA_DestroyCallback [COMCTL32.386]
1938 *
1939 * Enumerates all items in a dynamic pointer array and destroys it.
1940 *
1941 * PARAMS
1942 * hdpa [I] handle to the dynamic pointer array
1943 * enumProc [I]
1944 * lParam [I]
1945 *
1946 * RETURNS
1947 * Success: TRUE
1948 * Failure: FALSE
1949 */
1950
1951BOOL WINAPI
1952DPA_DestroyCallback (const HDPA hdpa, DPAENUMPROC enumProc, LPARAM lParam)
1953{
1954 dprintf(("COMCTL32: DPA_DestroyCallback"));
1955
1956 DPA_EnumCallback (hdpa, enumProc, lParam);
1957
1958 return DPA_Destroy (hdpa);
1959}
1960
1961
1962/**************************************************************************
1963 * DSA_EnumCallback [COMCTL32.387]
1964 *
1965 * Enumerates all items in a dynamic storage array.
1966 *
1967 * PARAMS
1968 * hdsa [I] handle to the dynamic storage array
1969 * enumProc [I]
1970 * lParam [I]
1971 *
1972 * RETURNS
1973 * none
1974 */
1975
1976VOID WINAPI
1977DSA_EnumCallback (const HDSA hdsa, DSAENUMPROC enumProc, LPARAM lParam)
1978{
1979 INT i;
1980
1981 dprintf(("COMCTL32: DSA_EnumCallback"));
1982
1983 if (!hdsa)
1984 return;
1985 if (hdsa->nItemCount <= 0)
1986 return;
1987
1988 for (i = 0; i < hdsa->nItemCount; i++) {
1989 LPVOID lpItem = DSA_GetItemPtr (hdsa, i);
1990 if ((enumProc)(lpItem, lParam) == 0)
1991 return;
1992 }
1993
1994 return;
1995}
1996
1997
1998/**************************************************************************
1999 * DSA_DestroyCallback [COMCTL32.388]
2000 *
2001 * Enumerates all items in a dynamic storage array and destroys it.
2002 *
2003 * PARAMS
2004 * hdsa [I] handle to the dynamic storage array
2005 * enumProc [I]
2006 * lParam [I]
2007 *
2008 * RETURNS
2009 * Success: TRUE
2010 * Failure: FALSE
2011 */
2012
2013BOOL WINAPI
2014DSA_DestroyCallback (const HDSA hdsa, DSAENUMPROC enumProc, LPARAM lParam)
2015{
2016 dprintf(("COMCTL32: DSA_DestroyCallback"));
2017
2018 DSA_EnumCallback (hdsa, enumProc, lParam);
2019
2020 return DSA_Destroy (hdsa);
2021}
2022
2023/**************************************************************************
2024 * StrCSpnA [COMCTL32.356]
2025 *
2026 */
2027INT WINAPI COMCTL32_StrCSpnA( LPCSTR lpStr, LPCSTR lpSet)
2028{
2029 dprintf(("COMCTL32: StrCSpnA"));
2030
2031 return strcspn(lpStr, lpSet);
2032}
2033
2034/**************************************************************************
2035 * StrChrW [COMCTL32.358]
2036 *
2037 */
2038LPWSTR WINAPI COMCTL32_StrChrW( LPCWSTR lpStart, WORD wMatch)
2039{
2040 dprintf(("COMCTL32: StrChrW"));
2041
2042 return (unsigned short*)wcschr((wchar_t*)lpStart, wMatch);
2043}
2044
2045/**************************************************************************
2046 * StrCmpNA [COMCTL32.352]
2047 *
2048 */
2049INT WINAPI COMCTL32_StrCmpNA( LPCSTR lpStr1, LPCSTR lpStr2, int nChar)
2050{
2051 dprintf(("COMCTL32: StrCmpNA"));
2052
2053 return strncmp(lpStr1, lpStr2, nChar);
2054}
2055
2056/**************************************************************************
2057 * StrCmpNIA [COMCTL32.353]
2058 *
2059 */
2060INT WINAPI COMCTL32_StrCmpNIA( LPCSTR lpStr1, LPCSTR lpStr2, int nChar)
2061{
2062 //AH: Inline helper function from WINE
2063 int res;
2064
2065 dprintf(("COMCTL32: StrCmpNIA"));
2066
2067 if (!nChar) return 0;
2068 while ((--nChar > 0) && *lpStr1)
2069 {
2070 res = toupper(*lpStr1++) - toupper(*lpStr2++);
2071 if (res) return res;
2072 }
2073 return toupper(*lpStr1) - toupper(*lpStr2);
2074}
2075
2076/**************************************************************************
2077 * StrCmpNW [COMCTL32.360]
2078 *
2079 */
2080INT WINAPI COMCTL32_StrCmpNW( LPCWSTR lpStr1, LPCWSTR lpStr2, int nChar)
2081{
2082 dprintf(("COMCTL32: StrCmpNW"));
2083
2084 return wcsncmp((wchar_t*)lpStr1,(wchar_t*)lpStr2,nChar);
2085}
2086
2087/**************************************************************************
2088 * StrCmpNIW [COMCTL32.361]
2089 *
2090 */
2091INT WINAPI COMCTL32_StrCmpNIW( LPCWSTR lpStr1, LPCWSTR lpStr2, int nChar)
2092{
2093 dprintf(("COMCTL32: StrCmpNIW - unimplemented stub\n"));
2094
2095 return 0;
2096}
2097
2098/***********************************************************************
2099 * ChrCmpA
2100 * This fuction returns FALSE if both words match, TRUE otherwise...
2101 */
2102static BOOL ChrCmpA( WORD word1, WORD word2) {
2103 if (LOBYTE(word1) == LOBYTE(word2)) {
2104 if (IsDBCSLeadByte(LOBYTE(word1))) {
2105 return (word1 != word2);
2106 }
2107 return FALSE;
2108 }
2109 return TRUE;
2110}
2111
2112/**************************************************************************
2113 * StrRChrA [COMCTL32.351]
2114 *
2115 */
2116LPSTR WINAPI COMCTL32_StrRChrA( LPCSTR lpStart, LPCSTR lpEnd, WORD wMatch)
2117{
2118 LPCSTR lpGotIt = NULL;
2119
2120 dprintf(("COMCTL32: StrRChrA"));
2121
2122 if (!lpEnd) lpEnd = lpStart + strlen(lpStart);
2123
2124 for(; lpStart < lpEnd; lpStart = CharNextA(lpStart))
2125 if (!ChrCmpA( GET_WORD(lpStart), wMatch))
2126 lpGotIt = lpStart;
2127
2128 return ((LPSTR)lpGotIt);
2129
2130 return 0;
2131}
2132
2133/***********************************************************************
2134 * ChrCmpW
2135 * This fuction returns FALSE if both words match, TRUE otherwise...
2136 */
2137static BOOL ChrCmpW( WORD word1, WORD word2) {
2138 return (word1 != word2);
2139}
2140
2141/**************************************************************************
2142 * StrRChrW [COMCTL32.359]
2143 *
2144 */
2145LPWSTR WINAPI COMCTL32_StrRChrW( LPCWSTR lpStart, LPCWSTR lpEnd, WORD wMatch)
2146{
2147 //AH: Inline Wine helper function
2148 LPCWSTR lpGotIt = NULL;
2149
2150 dprintf(("COMCTL32: StrRChrW"));
2151
2152 if (!lpEnd) lpEnd = lpStart + lstrlenW(lpStart);
2153
2154 for(; lpStart < lpEnd; lpStart = CharNextW(lpStart))
2155 if (!ChrCmpW( GET_WORD(lpStart), wMatch))
2156 lpGotIt = lpStart;
2157
2158 return (LPWSTR)lpGotIt;
2159}
2160
2161
2162/**************************************************************************
2163 * StrStrA [COMCTL32.354]
2164 *
2165 */
2166LPSTR WINAPI COMCTL32_StrStrA( LPCSTR lpFirst, LPCSTR lpSrch)
2167{
2168 dprintf(("COMCTL32: StrStrA"));
2169
2170 return strstr(lpFirst, lpSrch);
2171}
2172
2173/**************************************************************************
2174 * StrStrW [COMCTL32.362]
2175 *
2176 */
2177LPWSTR WINAPI COMCTL32_StrStrW( LPCWSTR lpFirst, LPCWSTR lpSrch)
2178{
2179 dprintf(("COMCTL32: StrStrW"));
2180
2181 return (unsigned short*)wcsstr((wchar_t*)lpFirst,(wchar_t*)lpSrch);
2182}
2183
2184/**************************************************************************
2185 * StrSpnW [COMCTL32.364]
2186 *
2187 */
2188INT WINAPI COMCTL32_StrSpnW( LPWSTR lpStr, LPWSTR lpSet)
2189{
2190 LPWSTR lpLoop = lpStr;
2191
2192 dprintf(("COMCTL32: StrSpnW"));
2193
2194 /* validate ptr */
2195 if ((lpStr == 0) || (lpSet == 0)) return 0;
2196
2197/* while(*lpLoop) { if lpLoop++; } */
2198
2199 for(; (*lpLoop != 0); lpLoop++)
2200 if (wcschr((wchar_t*)lpSet, *(WORD*)lpLoop))
2201 return (INT)(lpLoop-lpStr);
2202
2203 return (INT)(lpLoop-lpStr);
2204}
2205
2206/**************************************************************************
2207 * comctl32_410 [COMCTL32.410]
2208 *
2209 * FIXME: What's this supposed to do?
2210 * Parameter 1 is an HWND, you're on your own for the rest.
2211 */
2212
2213BOOL WINAPI comctl32_410( HWND hw, DWORD b, DWORD c, DWORD d)
2214{
2215 dprintf(("COMCTL32: comctl32_410 - empty stub!"));
2216
2217 return TRUE;
2218}
2219
2220/**************************************************************************
2221 * comctl32_411 [COMCTL32.411]
2222 *
2223 * FIXME: What's this supposed to do?
2224 * Parameter 1 is an HWND, you're on your own for the rest.
2225 */
2226
2227BOOL WINAPI comctl32_411( HWND hw, DWORD b, DWORD c)
2228{
2229 dprintf(("COMCTL32: comctl32_411 - empty stub!"));
2230
2231 return TRUE;
2232}
2233
2234/**************************************************************************
2235 * comctl32_412 [COMCTL32.412]
2236 *
2237 * FIXME: What's this supposed to do?
2238 * Parameter 1 is an HWND, you're on your own for the rest.
2239 */
2240
2241BOOL WINAPI comctl32_412( HWND hwnd, DWORD b, DWORD c)
2242{
2243 dprintf(("COMCTL32: comctl32_412 - empty stub!"));
2244
2245 if (IsWindow (hwnd) == FALSE)
2246 return FALSE;
2247
2248 if (b == 0)
2249 return FALSE;
2250
2251
2252 return TRUE;
2253}
2254
2255/**************************************************************************
2256 * comctl32_413 [COMCTL32.413]
2257 *
2258 * FIXME: What's this supposed to do?
2259 * Parameter 1 is an HWND, you're on your own for the rest.
2260 */
2261
2262BOOL WINAPI comctl32_413( HWND hw, DWORD b, DWORD c, DWORD d)
2263{
2264 dprintf(("COMCTL32: comctl32_413 - empty stub!"));
2265
2266 return TRUE;
2267}
2268
2269/*************************************************************************
2270 * InitMUILanguage [COMCTL32.70]
2271 *
2272 * FIXME: What's this supposed to do? Apparently some i18n thing.
2273 *
2274 */
2275
2276BOOL WINAPI InitMUILanguage( LANGID uiLang)
2277{
2278 dprintf(("COMCTL32: InitMUILanguage - empty stub!"));
2279
2280 return TRUE;
2281}
Note: See TracBrowser for help on using the repository browser.