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.
36 /***********************************************************************
37 * LocalAlloc (KERNEL32.@)
42 HLOCAL WINAPI
LocalAlloc(
43 UINT flags
, /* [in] Allocation attributes */
44 SIZE_T size
/* [in] Number of bytes to allocate */
46 return (HLOCAL
)GlobalAlloc( flags
, size
);
50 /***********************************************************************
51 * LocalCompact (KERNEL32.@)
53 SIZE_T WINAPI
LocalCompact( UINT minfree
)
55 return 0; /* LocalCompact does nothing in Win32 */
59 /***********************************************************************
60 * LocalFlags (KERNEL32.@)
62 * Value specifying allocation flags and lock count.
63 * LMEM_INVALID_HANDLE: Failure
65 UINT WINAPI
LocalFlags(
66 HLOCAL handle
/* [in] Handle of memory object */
68 return GlobalFlags( (HGLOBAL
)handle
);
72 /***********************************************************************
73 * LocalFree (KERNEL32.@)
78 HLOCAL WINAPI
LocalFree(
79 HLOCAL handle
/* [in] Handle of memory object */
81 return (HLOCAL
)GlobalFree( (HGLOBAL
)handle
);
85 /***********************************************************************
86 * LocalHandle (KERNEL32.@)
91 HLOCAL WINAPI
LocalHandle(
92 LPCVOID ptr
/* [in] Address of local memory object */
94 return (HLOCAL
)GlobalHandle( ptr
);
98 /***********************************************************************
99 * LocalLock (KERNEL32.@)
100 * Locks a local memory object and returns pointer to the first byte
101 * of the memory block.
107 LPVOID WINAPI
LocalLock(
108 HLOCAL handle
/* [in] Address of local memory object */
110 return GlobalLock( (HGLOBAL
)handle
);
114 /***********************************************************************
115 * LocalReAlloc (KERNEL32.@)
120 HLOCAL WINAPI
LocalReAlloc(
121 HLOCAL handle
, /* [in] Handle of memory object */
122 SIZE_T size
, /* [in] New size of block */
123 UINT flags
/* [in] How to reallocate object */
125 return (HLOCAL
)GlobalReAlloc( (HGLOBAL
)handle
, size
, flags
);
129 /***********************************************************************
130 * LocalShrink (KERNEL32.@)
132 SIZE_T WINAPI
LocalShrink( HGLOBAL handle
, UINT newsize
)
134 return 0; /* LocalShrink does nothing in Win32 */
138 /***********************************************************************
139 * LocalSize (KERNEL32.@)
144 SIZE_T WINAPI
LocalSize(
145 HLOCAL handle
/* [in] Handle of memory object */
147 return GlobalSize( (HGLOBAL
)handle
);
151 /***********************************************************************
152 * LocalUnlock (KERNEL32.@)
154 * TRUE: Object is still locked
155 * FALSE: Object is unlocked
157 BOOL WINAPI
LocalUnlock(
158 HLOCAL handle
/* [in] Handle of memory object */
160 return GlobalUnlock( (HGLOBAL
)handle
);