4 * Copyright 1995 Alexandre Julliard
5 * Copyright 1996 Huw Davies
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 * All local heap functions need the current DS as first parameter
25 * when called from the emulation library, so they take one more
26 * parameter than usual.
38 /***********************************************************************
39 * LocalAlloc (KERNEL32.@)
44 HLOCAL WINAPI LocalAlloc(
45 UINT flags, /* [in] Allocation attributes */
46 SIZE_T size /* [in] Number of bytes to allocate */
48 return (HLOCAL)GlobalAlloc( flags, size );
52 /***********************************************************************
53 * LocalCompact (KERNEL32.@)
55 SIZE_T WINAPI LocalCompact( UINT minfree )
57 return 0; /* LocalCompact does nothing in Win32 */
61 /***********************************************************************
62 * LocalFlags (KERNEL32.@)
64 * Value specifying allocation flags and lock count.
65 * LMEM_INVALID_HANDLE: Failure
67 UINT WINAPI LocalFlags(
68 HLOCAL handle /* [in] Handle of memory object */
70 return GlobalFlags( (HGLOBAL)handle );
74 /***********************************************************************
75 * LocalFree (KERNEL32.@)
80 HLOCAL WINAPI LocalFree(
81 HLOCAL handle /* [in] Handle of memory object */
83 return (HLOCAL)GlobalFree( (HGLOBAL)handle );
87 /***********************************************************************
88 * LocalHandle (KERNEL32.@)
93 HLOCAL WINAPI LocalHandle(
94 LPCVOID ptr /* [in] Address of local memory object */
96 return (HLOCAL)GlobalHandle( ptr );
100 /***********************************************************************
101 * LocalLock (KERNEL32.@)
102 * Locks a local memory object and returns pointer to the first byte
103 * of the memory block.
109 LPVOID WINAPI LocalLock(
110 HLOCAL handle /* [in] Address of local memory object */
112 return GlobalLock( (HGLOBAL)handle );
116 /***********************************************************************
117 * LocalReAlloc (KERNEL32.@)
122 HLOCAL WINAPI LocalReAlloc(
123 HLOCAL handle, /* [in] Handle of memory object */
124 SIZE_T size, /* [in] New size of block */
125 UINT flags /* [in] How to reallocate object */
127 return (HLOCAL)GlobalReAlloc( (HGLOBAL)handle, size, flags );
131 /***********************************************************************
132 * LocalShrink (KERNEL32.@)
134 SIZE_T WINAPI LocalShrink( HGLOBAL handle, UINT newsize )
136 return 0; /* LocalShrink does nothing in Win32 */
140 /***********************************************************************
141 * LocalSize (KERNEL32.@)
146 SIZE_T WINAPI LocalSize(
147 HLOCAL handle /* [in] Handle of memory object */
149 return GlobalSize( (HGLOBAL)handle );
153 /***********************************************************************
154 * LocalUnlock (KERNEL32.@)
156 * TRUE: Object is still locked
157 * FALSE: Object is unlocked
159 BOOL WINAPI LocalUnlock(
160 HLOCAL handle /* [in] Handle of memory object */
162 return GlobalUnlock( (HGLOBAL)handle );