cmd: DIR command outputs free space for the path.
[wine.git] / dlls / msvcp90 / memory.c
blobd1fe7ce578693f72818bab3374f6284d36bf29e6
1 /*
2 * Copyright 2010 Piotr Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include <stdarg.h>
20 #include <limits.h>
22 #include "msvcp90.h"
24 #include "windef.h"
25 #include "winbase.h"
28 /* ?address@?$allocator@D@std@@QBEPADAAD@Z */
29 /* ?address@?$allocator@D@std@@QEBAPEADAEAD@Z */
30 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_char_address, 8)
31 char* __thiscall MSVCP_allocator_char_address(void *this, char *ptr)
33 return ptr;
36 /* ?address@?$allocator@D@std@@QBEPBDABD@Z */
37 /* ?address@?$allocator@D@std@@QEBAPEBDAEBD@Z */
38 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_char_const_address, 8)
39 const char* __thiscall MSVCP_allocator_char_const_address(void *this, const char *ptr)
41 return ptr;
44 /* ??0?$allocator@D@std@@QAE@XZ */
45 /* ??0?$allocator@D@std@@QEAA@XZ */
46 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_char_ctor, 4)
47 void* __thiscall MSVCP_allocator_char_ctor(void *this)
49 return this;
52 /* ??0?$allocator@D@std@@QAE@ABV01@@Z */
53 /* ??0?$allocator@D@std@@QEAA@AEBV01@@Z */
54 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_char_copy_ctor, 8)
55 void* __thiscall MSVCP_allocator_char_copy_ctor(void *this, const void *copy)
57 return this;
60 /* ??4?$allocator@D@std@@QAEAAV01@ABV01@@Z */
61 /* ??4?$allocator@D@std@@QEAAAEAV01@AEBV01@@Z */
62 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_char_assign, 8)
63 void* __thiscall MSVCP_allocator_char_assign(void *this, const void *assign)
65 return this;
68 /* ?deallocate@?$allocator@D@std@@QAEXPADI@Z */
69 /* ?deallocate@?$allocator@D@std@@QEAAXPEAD_K@Z */
70 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_char_deallocate, 12)
71 void __thiscall MSVCP_allocator_char_deallocate(void *this, char *ptr, size_t size)
73 operator_delete(ptr);
76 /* ?allocate@?$allocator@D@std@@QAEPADI@Z */
77 /* ?allocate@?$allocator@D@std@@QEAAPEAD_K@Z */
78 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_char_allocate, 8)
79 char* __thiscall MSVCP_allocator_char_allocate(void *this, size_t count)
81 return operator_new(count);
84 /* ?allocate@?$allocator@D@std@@QAEPADIPBX@Z */
85 /* ?allocate@?$allocator@D@std@@QEAAPEAD_KPEBX@Z */
86 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_char_allocate_hint, 12)
87 char* __thiscall MSVCP_allocator_char_allocate_hint(void *this,
88 size_t count, const void *hint)
90 /* Native ignores hint */
91 return MSVCP_allocator_char_allocate(this, count);
94 /* ?construct@?$allocator@D@std@@QAEXPADABD@Z */
95 /* ?construct@?$allocator@D@std@@QEAAXPEADAEBD@Z */
96 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_char_construct, 12)
97 void __thiscall MSVCP_allocator_char_construct(void *this, char *ptr, const char *val)
99 *ptr = *val;
102 /* ?destroy@?$allocator@D@std@@QAEXPAD@Z */
103 /* ?destroy@?$allocator@D@std@@QEAAXPEAD@Z */
104 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_char_destroy, 8)
105 void __thiscall MSVCP_allocator_char_destroy(void *this, char *ptr)
109 /* ?max_size@?$allocator@D@std@@QBEIXZ */
110 /* ?max_size@?$allocator@D@std@@QEBA_KXZ */
111 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_char_max_size, 4)
112 size_t __thiscall MSVCP_allocator_char_max_size(const void *this)
114 return UINT_MAX/sizeof(char);
118 /* allocator<wchar_t> */
119 /* ?address@?$allocator@_W@std@@QBEPA_WAA_W@Z */
120 /* ?address@?$allocator@_W@std@@QEBAPEA_WAEA_W@Z */
121 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_wchar_address, 8)
122 wchar_t* __thiscall MSVCP_allocator_wchar_address(void *this, wchar_t *ptr)
124 return ptr;
127 /* ?address@?$allocator@_W@std@@QBEPB_WAB_W@Z */
128 /* ?address@?$allocator@_W@std@@QEBAPEB_WAEB_W@Z */
129 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_wchar_const_address, 8)
130 const wchar_t* __thiscall MSVCP_allocator_wchar_const_address(void *this, const wchar_t *ptr)
132 return ptr;
135 /* ??0?$allocator@_W@std@@QAE@XZ */
136 /* ??0?$allocator@_W@std@@QEAA@XZ */
137 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_wchar_ctor, 4)
138 void* __thiscall MSVCP_allocator_wchar_ctor(void *this)
140 return this;
143 /* ??0?$allocator@_W@std@@QAE@ABV01@@Z */
144 /* ??0?$allocator@_W@std@@QEAA@AEBV01@@Z */
145 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_wchar_copy_ctor, 8)
146 void* __thiscall MSVCP_allocator_wchar_copy_ctor(void *this, void *copy)
148 return this;
151 /* ??4?$allocator@_W@std@@QAEAAV01@ABV01@@Z */
152 /* ??4?$allocator@_W@std@@QEAAAEAV01@AEBV01@@Z */
153 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_wchar_assign, 8)
154 void* __thiscall MSVCP_allocator_wchar_assign(void *this, void *assign)
156 return this;
159 /* ?deallocate@?$allocator@_W@std@@QAEXPA_WI@Z */
160 /* ?deallocate@?$allocator@_W@std@@QEAAXPEA_W_K@Z */
161 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_wchar_deallocate, 12)
162 void __thiscall MSVCP_allocator_wchar_deallocate(void *this,
163 wchar_t *ptr, size_t size)
165 operator_delete(ptr);
168 /* ?allocate@?$allocator@_W@std@@QAEPA_WI@Z */
169 /* ?allocate@?$allocator@_W@std@@QEAAPEA_W_K@Z */
170 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_wchar_allocate, 8)
171 wchar_t* __thiscall MSVCP_allocator_wchar_allocate(void *this, size_t count)
173 if(UINT_MAX/count < sizeof(wchar_t)) _Xmem();
174 return operator_new(count * sizeof(wchar_t));
177 /* ?allocate@?$allocator@_W@std@@QAEPA_WIPBX@Z */
178 /* ?allocate@?$allocator@_W@std@@QEAAPEA_W_KPEBX@Z */
179 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_wchar_allocate_hint, 12)
180 wchar_t* __thiscall MSVCP_allocator_wchar_allocate_hint(void *this,
181 size_t count, const void *hint)
183 return MSVCP_allocator_wchar_allocate(this, count);
186 /* ?construct@?$allocator@_W@std@@QAEXPA_WAB_W@Z */
187 /* ?construct@?$allocator@_W@std@@QEAAXPEA_WAEB_W@Z */
188 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_wchar_construct, 12)
189 void __thiscall MSVCP_allocator_wchar_construct(void *this,
190 wchar_t *ptr, const wchar_t *val)
192 *ptr = *val;
195 /* ?destroy@?$allocator@_W@std@@QAEXPA_W@Z */
196 /* ?destroy@?$allocator@_W@std@@QEAAXPEA_W@Z */
197 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_wchar_destroy, 8)
198 void __thiscall MSVCP_allocator_wchar_destroy(void *this, char *ptr)
202 /* ?max_size@?$allocator@_W@std@@QBEIXZ */
203 /* ?max_size@?$allocator@_W@std@@QEBA_KXZ */
204 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_wchar_max_size, 4)
205 size_t __thiscall MSVCP_allocator_wchar_max_size(const void *this)
207 return UINT_MAX/sizeof(wchar_t);
210 /* allocator<unsigned short> */
211 /* ?address@?$allocator@G@std@@QBEPAGAAG@Z */
212 /* ?address@?$allocator@G@std@@QEBAPEAGAEAG@Z */
213 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_short_address, 8)
214 unsigned short* __thiscall MSVCP_allocator_short_address(
215 void *this, unsigned short *ptr)
217 return ptr;
220 /* ?address@?$allocator@G@std@@QBEPBGABG@Z */
221 /* ?address@?$allocator@G@std@@QEBAPEBGAEBG@Z */
222 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_short_const_address, 8)
223 const unsigned short* __thiscall MSVCP_allocator_short_const_address(
224 void *this, const unsigned short *ptr)
226 return ptr;
229 /* ??0?$allocator@G@std@@QAE@XZ */
230 /* ??0?$allocator@G@std@@QEAA@XZ */
231 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_short_ctor, 4)
232 void* __thiscall MSVCP_allocator_short_ctor(void *this)
234 return this;
237 /* ??0?$allocator@G@std@@QAE@ABV01@@Z */
238 /* ??0?$allocator@G@std@@QEAA@AEBV01@@Z */
239 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_short_copy_ctor, 8)
240 void* __thiscall MSVCP_allocator_short_copy_ctor(void *this, void *copy)
242 return this;
245 /* ??4?$allocator@G@std@@QAEAAV01@ABV01@@Z */
246 /* ??4?$allocator@G@std@@QEAAAEAV01@AEBV01@@Z */
247 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_short_assign, 8)
248 void* __thiscall MSVCP_allocator_short_assign(void *this, void *assign)
250 return this;
253 /* ?deallocate@?$allocator@G@std@@QAEXPAGI@Z */
254 /* ?deallocate@?$allocator@G@std@@QEAAXPEAG_K@Z */
255 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_short_deallocate, 12)
256 void __thiscall MSVCP_allocator_short_deallocate(void *this,
257 unsigned short *ptr, size_t size)
259 operator_delete(ptr);
262 /* ?allocate@?$allocator@G@std@@QAEPAGI@Z */
263 /* ?allocate@?$allocator@G@std@@QEAAPEAG_K@Z */
264 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_short_allocate, 8)
265 unsigned short* __thiscall MSVCP_allocator_short_allocate(
266 void *this, size_t count)
268 if(UINT_MAX/count < sizeof(unsigned short)) _Xmem();
269 return operator_new(count * sizeof(unsigned short));
272 /* ?allocate@?$allocator@G@std@@QAEPAGIPBX@Z */
273 /* ?allocate@?$allocator@G@std@@QEAAPEAG_KPEBX@Z */
274 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_short_allocate_hint, 12)
275 unsigned short* __thiscall MSVCP_allocator_short_allocate_hint(
276 void *this, size_t count, const void *hint)
278 return MSVCP_allocator_short_allocate(this, count);
281 /* ?construct@?$allocator@G@std@@QAEXPAGABG@Z */
282 /* ?construct@?$allocator@G@std@@QEAAXPEAGAEBG@Z */
283 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_short_construct, 12)
284 void __thiscall MSVCP_allocator_short_construct(void *this,
285 unsigned short *ptr, unsigned short *val)
287 *ptr = *val;
290 /* ?destroy@?$allocator@G@std@@QAEXPAG@Z */
291 /* ?destroy@?$allocator@G@std@@QEAAXPEAG@Z */
292 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_short_destroy, 8)
293 void __thiscall MSVCP_allocator_short_destroy(void *this, size_t *ptr)
297 /* ?max_size@?$allocator@G@std@@QBEIXZ */
298 /* ?max_size@?$allocator@G@std@@QEBA_KXZ */
299 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_short_max_size, 4)
300 size_t __thiscall MSVCP_allocator_short_max_size(void *this)
302 return UINT_MAX/sizeof(unsigned short);
305 /* allocator<void> */
306 /* ??0?$allocator@X@std@@QAE@XZ */
307 /* ??0?$allocator@X@std@@QEAA@XZ */
308 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_void_ctor, 4)
309 void* __thiscall MSVCP_allocator_void_ctor(void *this)
311 return this;
314 /* ??0?$allocator@X@std@@QAE@ABV01@@Z */
315 /* ??0?$allocator@X@std@@QEAA@AEBV01@@Z */
316 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_void_copy_ctor, 8)
317 void* __thiscall MSVCP_allocator_void_copy_ctor(void *this, void *copy)
319 return this;
322 /* ??4?$allocator@X@std@@QAEAAV01@ABV01@@Z */
323 /* ??4?$allocator@X@std@@QEAAAEAV01@AEBV01@@Z */
324 DEFINE_THISCALL_WRAPPER(MSVCP_allocator_void_assign, 8)
325 void* __thiscall MSVCP_allocator_void_assign(void *this, void *assign)
327 return this;