source: trunk/src/comctl32/comctl32undoc.c@ 41

Last change on this file since 41 was 41, checked in by achimha, 26 years ago

* empty log message *

File size: 2.4 KB
Line 
1/*
2 * Undocumented functions from COMCTL32.DLL
3 *
4 * Copyright (C) 1999 Achim Hasenmueller
5 *
6 * Based on the work of the WINE group (www.winehq.com)
7 *
8 *
9 * Project Odin Software License can be found in LICENSE.TXT
10 *
11 */
12
13#include "comctl32.h"
14
15extern HANDLE COMCTL32_hHeap; /* handle to the private heap */
16
17
18/**************************************************************************
19 * Alloc [COMCTL32.71]
20 *
21 * Allocates memory block from the dll's private heap
22 *
23 * PARAMS
24 * dwSize [I] size of the allocated memory block
25 *
26 * RETURNS
27 * Success: pointer to allocated memory block
28 * Failure: NULL
29 */
30
31
32LPVOID WINAPI COMCTL32_Alloc (DWORD dwSize)
33{
34 LPVOID lpPtr;
35
36 lpPtr = HeapAlloc (COMCTL32_hHeap, HEAP_ZERO_MEMORY, dwSize);
37
38 return lpPtr;
39}
40
41
42/**************************************************************************
43 * ReAlloc [COMCTL32.72]
44 *
45 * Changes the size of an allocated memory block or allocates a memory
46 * block using the dll's private heap.
47 *
48 * PARAMS
49 * lpSrc [I] pointer to memory block which will be resized
50 * dwSize [I] new size of the memory block.
51 *
52 * RETURNS
53 * Success: pointer to the resized memory block
54 * Failure: NULL
55 *
56 * NOTES
57 * If lpSrc is a NULL-pointer, then COMCTL32_ReAlloc allocates a memory
58 * block like COMCTL32_Alloc.
59 */
60
61LPVOID WINAPI COMCTL32_ReAlloc (LPVOID lpSrc, DWORD dwSize)
62{
63 LPVOID lpDest;
64
65 if (lpSrc)
66 lpDest = HeapReAlloc (COMCTL32_hHeap, HEAP_ZERO_MEMORY, lpSrc, dwSize);
67 else
68 lpDest = HeapAlloc (COMCTL32_hHeap, HEAP_ZERO_MEMORY, dwSize);
69
70 return lpDest;
71}
72
73
74/**************************************************************************
75 * Free [COMCTL32.73]
76 *
77 * Frees an allocated memory block from the dll's private heap.
78 *
79 * PARAMS
80 * lpMem [I] pointer to memory block which will be freed
81 *
82 * RETURNS
83 * Success: TRUE
84 * Failure: FALSE
85 */
86
87BOOL WINAPI COMCTL32_Free (LPVOID lpMem)
88{
89 return HeapFree (COMCTL32_hHeap, 0, lpMem);
90}
91
92
93/**************************************************************************
94 * GetSize [COMCTL32.74]
95 *
96 * Retrieves the size of the specified memory block from the dll's
97 * private heap.
98 *
99 * PARAMS
100 * lpMem [I] pointer to an allocated memory block
101 *
102 * RETURNS
103 * Success: size of the specified memory block
104 * Failure: 0
105 */
106
107DWORD WINAPI COMCTL32_GetSize (LPVOID lpMem)
108{
109
110 return HeapSize (COMCTL32_hHeap, 0, lpMem);
111}
Note: See TracBrowser for help on using the repository browser.