kernel32: Properly handle bare console on input.
[wine] / dlls / mscoree / mscoree_main.c
1 /*
2  * Implementation of mscoree.dll
3  * Microsoft Component Object Runtime Execution Engine
4  *
5  * Copyright 2006 Paul Chitescu
6  *
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.
11  *
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.
16  *
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20  */
21
22 #include <stdarg.h>
23
24 #include "wine/unicode.h"
25 #include "windef.h"
26 #include "winbase.h"
27 #include "winuser.h"
28 #include "winnls.h"
29 #include "winreg.h"
30 #include "ole2.h"
31 #include "shellapi.h"
32
33 #include "initguid.h"
34 #include "cor.h"
35 #include "corerror.h"
36 #include "mscoree.h"
37 #include "mscoree_private.h"
38
39 #include "wine/debug.h"
40
41 WINE_DEFAULT_DEBUG_CHANNEL( mscoree );
42
43 static BOOL get_mono_path(LPWSTR path)
44 {
45     static const WCHAR mono_key[] = {'S','o','f','t','w','a','r','e','\\','N','o','v','e','l','l','\\','M','o','n','o',0};
46     static const WCHAR defaul_clr[] = {'D','e','f','a','u','l','t','C','L','R',0};
47     static const WCHAR install_root[] = {'S','d','k','I','n','s','t','a','l','l','R','o','o','t',0};
48     static const WCHAR slash[] = {'\\',0};
49
50     WCHAR version[64], version_key[MAX_PATH];
51     DWORD len;
52     HKEY key;
53
54     if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, mono_key, 0, KEY_READ, &key))
55         return FALSE;
56
57     len = sizeof(version);
58     if (RegQueryValueExW(key, defaul_clr, 0, NULL, (LPBYTE)version, &len))
59     {
60         RegCloseKey(key);
61         return FALSE;
62     }
63     RegCloseKey(key);
64
65     lstrcpyW(version_key, mono_key);
66     lstrcatW(version_key, slash);
67     lstrcatW(version_key, version);
68
69     if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, version_key, 0, KEY_READ, &key))
70         return FALSE;
71
72     len = sizeof(WCHAR) * MAX_PATH;
73     if (RegQueryValueExW(key, install_root, 0, NULL, (LPBYTE)path, &len))
74     {
75         RegCloseKey(key);
76         return FALSE;
77     }
78     RegCloseKey(key);
79
80     return TRUE;
81 }
82
83 static BOOL get_install_root(LPWSTR install_dir)
84 {
85     const WCHAR dotnet_key[] = {'S','O','F','T','W','A','R','E','\\','M','i','c','r','o','s','o','f','t','\\','.','N','E','T','F','r','a','m','e','w','o','r','k','\\',0};
86     const WCHAR install_root[] = {'I','n','s','t','a','l','l','R','o','o','t',0};
87
88     DWORD len;
89     HKEY key;
90
91     if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, dotnet_key, 0, KEY_READ, &key))
92         return FALSE;
93
94     len = MAX_PATH;
95     if (RegQueryValueExW(key, install_root, 0, NULL, (LPBYTE)install_dir, &len))
96     {
97         RegCloseKey(key);
98         return FALSE;
99     }
100     RegCloseKey(key);
101
102     return TRUE;
103 }
104
105 static CRITICAL_SECTION mono_lib_cs;
106 static CRITICAL_SECTION_DEBUG mono_lib_cs_debug =
107 {
108     0, 0, &mono_lib_cs,
109     { &mono_lib_cs_debug.ProcessLocksList,
110       &mono_lib_cs_debug.ProcessLocksList },
111       0, 0, { (DWORD_PTR)(__FILE__ ": mono_lib_cs") }
112 };
113 static CRITICAL_SECTION mono_lib_cs = { &mono_lib_cs_debug, -1, 0, 0, 0, 0 };
114
115 HMODULE mono_handle;
116
117 void (*mono_config_parse)(const char *filename);
118 MonoAssembly* (*mono_domain_assembly_open) (MonoDomain *domain, const char *name);
119 void (*mono_jit_cleanup)(MonoDomain *domain);
120 int (*mono_jit_exec)(MonoDomain *domain, MonoAssembly *assembly, int argc, char *argv[]);
121 MonoDomain* (*mono_jit_init)(const char *file);
122 int (*mono_jit_set_trace_options)(const char* options);
123 void (*mono_set_dirs)(const char *assembly_dir, const char *config_dir);
124
125 static void set_environment(LPCWSTR bin_path)
126 {
127     WCHAR path_env[MAX_PATH];
128     int len;
129
130     static const WCHAR pathW[] = {'P','A','T','H',0};
131
132     /* We have to modify PATH as Mono loads other DLLs from this directory. */
133     GetEnvironmentVariableW(pathW, path_env, sizeof(path_env)/sizeof(WCHAR));
134     len = strlenW(path_env);
135     path_env[len++] = ';';
136     strcpyW(path_env+len, bin_path);
137     SetEnvironmentVariableW(pathW, path_env);
138 }
139
140 static HMODULE load_mono(void)
141 {
142     static const WCHAR mono_dll[] = {'\\','b','i','n','\\','m','o','n','o','.','d','l','l',0};
143     static const WCHAR libmono_dll[] = {'\\','b','i','n','\\','l','i','b','m','o','n','o','.','d','l','l',0};
144     static const WCHAR bin[] = {'\\','b','i','n',0};
145     static const WCHAR lib[] = {'\\','l','i','b',0};
146     static const WCHAR etc[] = {'\\','e','t','c',0};
147     HMODULE result;
148     WCHAR mono_path[MAX_PATH], mono_dll_path[MAX_PATH+16], mono_bin_path[MAX_PATH+4];
149     WCHAR mono_lib_path[MAX_PATH+4], mono_etc_path[MAX_PATH+4];
150     char mono_lib_path_a[MAX_PATH], mono_etc_path_a[MAX_PATH];
151
152     EnterCriticalSection(&mono_lib_cs);
153
154     if (!mono_handle)
155     {
156         if (!get_mono_path(mono_path)) goto end;
157
158         strcpyW(mono_bin_path, mono_path);
159         strcatW(mono_bin_path, bin);
160         set_environment(mono_bin_path);
161
162         strcpyW(mono_lib_path, mono_path);
163         strcatW(mono_lib_path, lib);
164         WideCharToMultiByte(CP_UTF8, 0, mono_lib_path, -1, mono_lib_path_a, MAX_PATH, NULL, NULL);
165
166         strcpyW(mono_etc_path, mono_path);
167         strcatW(mono_etc_path, etc);
168         WideCharToMultiByte(CP_UTF8, 0, mono_etc_path, -1, mono_etc_path_a, MAX_PATH, NULL, NULL);
169
170         strcpyW(mono_dll_path, mono_path);
171         strcatW(mono_dll_path, mono_dll);
172         mono_handle = LoadLibraryW(mono_dll_path);
173
174         if (!mono_handle)
175         {
176             strcpyW(mono_dll_path, mono_path);
177             strcatW(mono_dll_path, libmono_dll);
178             mono_handle = LoadLibraryW(mono_dll_path);
179         }
180
181         if (!mono_handle) goto end;
182
183 #define LOAD_MONO_FUNCTION(x) do { \
184     x = (void*)GetProcAddress(mono_handle, #x); \
185     if (!x) { \
186         mono_handle = NULL; \
187         goto end; \
188     } \
189 } while (0);
190
191         LOAD_MONO_FUNCTION(mono_config_parse);
192         LOAD_MONO_FUNCTION(mono_domain_assembly_open);
193         LOAD_MONO_FUNCTION(mono_jit_cleanup);
194         LOAD_MONO_FUNCTION(mono_jit_exec);
195         LOAD_MONO_FUNCTION(mono_jit_init);
196         LOAD_MONO_FUNCTION(mono_jit_set_trace_options);
197         LOAD_MONO_FUNCTION(mono_set_dirs);
198
199 #undef LOAD_MONO_FUNCTION
200
201         mono_set_dirs(mono_lib_path_a, mono_etc_path_a);
202
203         mono_config_parse(NULL);
204     }
205
206 end:
207     result = mono_handle;
208
209     LeaveCriticalSection(&mono_lib_cs);
210
211     if (!result)
212         MESSAGE("wine: Install the Windows version of Mono to run .NET executables\n");
213
214     return result;
215 }
216
217 HRESULT WINAPI CorBindToRuntimeHost(LPCWSTR pwszVersion, LPCWSTR pwszBuildFlavor,
218                                     LPCWSTR pwszHostConfigFile, VOID *pReserved,
219                                     DWORD startupFlags, REFCLSID rclsid,
220                                     REFIID riid, LPVOID *ppv)
221 {
222     FIXME("(%s, %s, %s, %p, %d, %s, %s, %p): semi-stub!\n", debugstr_w(pwszVersion),
223           debugstr_w(pwszBuildFlavor), debugstr_w(pwszHostConfigFile), pReserved,
224           startupFlags, debugstr_guid(rclsid), debugstr_guid(riid), ppv);
225
226     if (!get_mono_path(NULL))
227     {
228         MESSAGE("wine: Install the Windows version of Mono to run .NET executables\n");
229         return E_FAIL;
230     }
231
232     return S_OK;
233 }
234
235 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
236 {
237     TRACE("(%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
238
239     switch (fdwReason)
240     {
241     case DLL_WINE_PREATTACH:
242         return FALSE;  /* prefer native version */
243     case DLL_PROCESS_ATTACH:
244         DisableThreadLibraryCalls(hinstDLL);
245         break;
246     case DLL_PROCESS_DETACH:
247         break;
248     }
249     return TRUE;
250 }
251
252 BOOL WINAPI _CorDllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
253 {
254     FIXME("(%p, %d, %p): stub\n", hinstDLL, fdwReason, lpvReserved);
255
256     switch (fdwReason)
257     {
258     case DLL_PROCESS_ATTACH:
259         DisableThreadLibraryCalls(hinstDLL);
260         break;
261     case DLL_PROCESS_DETACH:
262         break;
263     }
264     return TRUE;
265 }
266
267 static void get_utf8_args(int *argc, char ***argv)
268 {
269     WCHAR **argvw;
270     int size=0, i;
271     char *current_arg;
272
273     argvw = CommandLineToArgvW(GetCommandLineW(), argc);
274
275     for (i=0; i<*argc; i++)
276     {
277         size += sizeof(char*);
278         size += WideCharToMultiByte(CP_UTF8, 0, argvw[i], -1, NULL, 0, NULL, NULL);
279     }
280     size += sizeof(char*);
281
282     *argv = HeapAlloc(GetProcessHeap(), 0, size);
283     current_arg = (char*)(*argv + *argc + 1);
284
285     for (i=0; i<*argc; i++)
286     {
287         (*argv)[i] = current_arg;
288         current_arg += WideCharToMultiByte(CP_UTF8, 0, argvw[i], -1, current_arg, size, NULL, NULL);
289     }
290
291     (*argv)[*argc] = NULL;
292
293     HeapFree(GetProcessHeap(), 0, argvw);
294 }
295
296 __int32 WINAPI _CorExeMain(void)
297 {
298     int exit_code;
299     int trace_size;
300     char trace_setting[256];
301     int argc;
302     char **argv;
303     MonoDomain *domain;
304     MonoAssembly *assembly;
305     char filename[MAX_PATH];
306
307     if (!load_mono())
308     {
309         return -1;
310     }
311
312     get_utf8_args(&argc, &argv);
313
314     trace_size = GetEnvironmentVariableA("WINE_MONO_TRACE", trace_setting, sizeof(trace_setting));
315
316     if (trace_size)
317     {
318         mono_jit_set_trace_options(trace_setting);
319     }
320
321     GetModuleFileNameA(NULL, filename, MAX_PATH);
322
323     domain = mono_jit_init(filename);
324
325     assembly = mono_domain_assembly_open(domain, filename);
326
327     exit_code = mono_jit_exec(domain, assembly, argc, argv);
328
329     mono_jit_cleanup(domain);
330
331     HeapFree(GetProcessHeap(), 0, argv);
332
333     return exit_code;
334 }
335
336 __int32 WINAPI _CorExeMain2(PBYTE ptrMemory, DWORD cntMemory, LPWSTR imageName, LPWSTR loaderName, LPWSTR cmdLine)
337 {
338     TRACE("(%p, %u, %s, %s, %s)\n", ptrMemory, cntMemory, debugstr_w(imageName), debugstr_w(loaderName), debugstr_w(cmdLine));
339     FIXME("Directly running .NET applications not supported.\n");
340     return -1;
341 }
342
343 void WINAPI CorExitProcess(int exitCode)
344 {
345     FIXME("(%x) stub\n", exitCode);
346     ExitProcess(exitCode);
347 }
348
349 VOID WINAPI _CorImageUnloading(PVOID imageBase)
350 {
351     TRACE("(%p): stub\n", imageBase);
352 }
353
354 HRESULT WINAPI _CorValidateImage(PVOID* imageBase, LPCWSTR imageName)
355 {
356     TRACE("(%p, %s): stub\n", imageBase, debugstr_w(imageName));
357     return E_FAIL;
358 }
359
360 HRESULT WINAPI GetCORSystemDirectory(LPWSTR pbuffer, DWORD cchBuffer, DWORD *dwLength)
361 {
362     static const WCHAR slash[] = {'\\',0};
363     WCHAR system_dir[MAX_PATH];
364     WCHAR version[MAX_PATH];
365
366     FIXME("(%p, %d, %p): semi-stub!\n", pbuffer, cchBuffer, dwLength);
367
368     if (!dwLength)
369         return E_POINTER;
370
371     if (!pbuffer)
372         return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
373
374     if (!get_install_root(system_dir))
375     {
376         ERR("error reading registry key for installroot, returning empty path\n");
377         *dwLength = 0;
378     }
379     else
380     {
381         GetCORVersion(version, MAX_PATH, dwLength);
382         lstrcatW(system_dir, version);
383         lstrcatW(system_dir, slash);
384         *dwLength = lstrlenW(system_dir) + 1;
385
386         if (cchBuffer < *dwLength)
387             return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
388
389         lstrcpyW(pbuffer, system_dir);
390     }
391
392     return S_OK;
393 }
394
395 HRESULT WINAPI GetCORVersion(LPWSTR pbuffer, DWORD cchBuffer, DWORD *dwLength)
396 {
397     static const WCHAR version[] = {'v','2','.','0','.','5','0','7','2','7',0};
398
399     FIXME("(%p, %d, %p): semi-stub!\n", pbuffer, cchBuffer, dwLength);
400
401     if (!dwLength || !pbuffer)
402         return E_POINTER;
403
404     *dwLength = lstrlenW(version) + 1;
405
406     if (cchBuffer < *dwLength)
407         return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
408
409     lstrcpyW(pbuffer, version);
410
411     return S_OK;
412 }
413
414 HRESULT WINAPI GetRequestedRuntimeInfo(LPCWSTR pExe, LPCWSTR pwszVersion, LPCWSTR pConfigurationFile,
415     DWORD startupFlags, DWORD runtimeInfoFlags, LPWSTR pDirectory, DWORD dwDirectory, DWORD *dwDirectoryLength,
416     LPWSTR pVersion, DWORD cchBuffer, DWORD *dwlength)
417 {
418     HRESULT ret;
419     DWORD ver_len, dir_len;
420     WCHAR dirW[MAX_PATH], verW[MAX_PATH];
421
422     FIXME("(%s, %s, %s, 0x%08x, 0x%08x, %p, 0x%08x, %p, %p, 0x%08x, %p) semi-stub\n", debugstr_w(pExe),
423           debugstr_w(pwszVersion), debugstr_w(pConfigurationFile), startupFlags, runtimeInfoFlags, pDirectory,
424           dwDirectory, dwDirectoryLength, pVersion, cchBuffer, dwlength);
425
426     if (!pwszVersion && !(runtimeInfoFlags & RUNTIME_INFO_UPGRADE_VERSION))
427         return CLR_E_SHIM_RUNTIME;
428
429     ret = GetCORSystemDirectory(dirW, dwDirectory, &dir_len);
430
431     if (ret == S_OK)
432     {
433         if (dwDirectoryLength)
434             *dwDirectoryLength = dir_len;
435         if (pDirectory)
436             lstrcpyW(pDirectory, dirW);
437
438         ret = GetCORVersion(verW, cchBuffer, &ver_len);
439
440         if (ret == S_OK)
441         {
442             if (dwlength)
443                 *dwlength = ver_len;
444             if (pVersion)
445                 lstrcpyW(pVersion, verW);
446         }
447     }
448     return ret;
449 }
450
451 HRESULT WINAPI LoadLibraryShim( LPCWSTR szDllName, LPCWSTR szVersion, LPVOID pvReserved, HMODULE * phModDll)
452 {
453     FIXME("(%p %s, %p, %p, %p): semi-stub\n", szDllName, debugstr_w(szDllName), szVersion, pvReserved, phModDll);
454
455     if (phModDll) *phModDll = LoadLibraryW(szDllName);
456     return S_OK;
457 }
458
459 HRESULT WINAPI LockClrVersion(FLockClrVersionCallback hostCallback, FLockClrVersionCallback *pBeginHostSetup, FLockClrVersionCallback *pEndHostSetup)
460 {
461     FIXME("(%p %p %p): stub\n", hostCallback, pBeginHostSetup, pEndHostSetup);
462     return S_OK;
463 }
464
465 HRESULT WINAPI CoInitializeCor(DWORD fFlags)
466 {
467     FIXME("(0x%08x): stub\n", fFlags);
468     return S_OK;
469 }
470
471 HRESULT WINAPI GetAssemblyMDImport(LPCWSTR szFileName, REFIID riid, IUnknown **ppIUnk)
472 {
473     FIXME("(%p %s, %s, %p): stub\n", szFileName, debugstr_w(szFileName), debugstr_guid(riid), *ppIUnk);
474     return ERROR_CALL_NOT_IMPLEMENTED;
475 }
476
477 HRESULT WINAPI GetVersionFromProcess(HANDLE hProcess, LPWSTR pVersion, DWORD cchBuffer, DWORD *dwLength)
478 {
479     FIXME("(%p, %p, %d, %p): stub\n", hProcess, pVersion, cchBuffer, dwLength);
480     return E_NOTIMPL;
481 }
482
483 HRESULT WINAPI LoadStringRCEx(LCID culture, UINT resId, LPWSTR pBuffer, int iBufLen, int bQuiet, int* pBufLen)
484 {
485     HRESULT res = S_OK;
486     if ((iBufLen <= 0) || !pBuffer)
487         return E_INVALIDARG;
488     pBuffer[0] = 0;
489     if (resId) {
490         FIXME("(%d, %x, %p, %d, %d, %p): semi-stub\n", culture, resId, pBuffer, iBufLen, bQuiet, pBufLen);
491         res = E_NOTIMPL;
492     }
493     else
494         res = E_FAIL;
495     if (pBufLen)
496         *pBufLen = lstrlenW(pBuffer);
497     return res;
498 }
499
500 HRESULT WINAPI LoadStringRC(UINT resId, LPWSTR pBuffer, int iBufLen, int bQuiet)
501 {
502     return LoadStringRCEx(-1, resId, pBuffer, iBufLen, bQuiet, NULL);
503 }
504
505 HRESULT WINAPI CorBindToRuntimeEx(LPWSTR szVersion, LPWSTR szBuildFlavor, DWORD nflags, REFCLSID rslsid,
506                                   REFIID riid, LPVOID *ppv)
507 {
508     FIXME("%s %s %d %s %s %p\n", debugstr_w(szVersion), debugstr_w(szBuildFlavor), nflags, debugstr_guid( rslsid ),
509           debugstr_guid( riid ), ppv);
510
511     if(IsEqualGUID( riid, &IID_ICorRuntimeHost ))
512     {
513         *ppv = create_corruntimehost();
514         return S_OK;
515     }
516     *ppv = NULL;
517     return E_NOTIMPL;
518 }
519
520 HRESULT WINAPI CorBindToCurrentRuntime(LPCWSTR filename, REFCLSID rclsid, REFIID riid, LPVOID *ppv)
521 {
522     FIXME("(%s, %s, %s, %p): stub\n", debugstr_w(filename), debugstr_guid(rclsid), debugstr_guid(riid), ppv);
523     return E_NOTIMPL;
524 }
525
526 STDAPI ClrCreateManagedInstance(LPCWSTR pTypeName, REFIID riid, void **ppObject)
527 {
528     FIXME("(%s,%s,%p)\n", debugstr_w(pTypeName), debugstr_guid(riid), ppObject);
529     return E_NOTIMPL;
530 }
531
532 BOOL WINAPI StrongNameSignatureVerification(LPCWSTR filename, DWORD inFlags, DWORD* pOutFlags)
533 {
534     FIXME("(%s, 0x%X, %p): stub\n", debugstr_w(filename), inFlags, pOutFlags);
535     return FALSE;
536 }
537
538 BOOL WINAPI StrongNameSignatureVerificationEx(LPCWSTR filename, BOOL forceVerification, BOOL* pVerified)
539 {
540     FIXME("(%s, %u, %p): stub\n", debugstr_w(filename), forceVerification, pVerified);
541     return FALSE;
542 }
543
544 HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
545 {
546     FIXME("(%s, %s, %p): stub\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
547     if(!ppv)
548         return E_INVALIDARG;
549
550     return E_NOTIMPL;
551 }
552
553 HRESULT WINAPI DllRegisterServer(void)
554 {
555     FIXME("\n");
556     return S_OK;
557 }
558
559 HRESULT WINAPI DllUnregisterServer(void)
560 {
561     FIXME("\n");
562     return S_OK;
563 }
564
565 HRESULT WINAPI DllCanUnloadNow(VOID)
566 {
567     return S_OK;
568 }
569
570 INT WINAPI ND_RU1( const void *ptr, INT offset )
571 {
572     return *((const BYTE *)ptr + offset);
573 }
574
575 INT WINAPI ND_RI2( const void *ptr, INT offset )
576 {
577     return *(const SHORT *)((const BYTE *)ptr + offset);
578 }
579
580 INT WINAPI ND_RI4( const void *ptr, INT offset )
581 {
582     return *(const INT *)((const BYTE *)ptr + offset);
583 }
584
585 INT64 WINAPI ND_RI8( const void *ptr, INT offset )
586 {
587     return *(const INT64 *)((const BYTE *)ptr + offset);
588 }
589
590 void WINAPI ND_WU1( void *ptr, INT offset, BYTE val )
591 {
592     *((BYTE *)ptr + offset) = val;
593 }
594
595 void WINAPI ND_WI2( void *ptr, INT offset, SHORT val )
596 {
597     *(SHORT *)((BYTE *)ptr + offset) = val;
598 }
599
600 void WINAPI ND_WI4( void *ptr, INT offset, INT val )
601 {
602     *(INT *)((BYTE *)ptr + offset) = val;
603 }
604
605 void WINAPI ND_WI8( void *ptr, INT offset, INT64 val )
606 {
607     *(INT64 *)((BYTE *)ptr + offset) = val;
608 }
609
610 void WINAPI ND_CopyObjDst( const void *src, void *dst, INT offset, INT size )
611 {
612     memcpy( (BYTE *)dst + offset, src, size );
613 }
614
615 void WINAPI ND_CopyObjSrc( const void *src, INT offset, void *dst, INT size )
616 {
617     memcpy( dst, (const BYTE *)src + offset, size );
618 }