janitorial: Remove remaining NULL checks before free() (found by Smatch).
[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 "windef.h"
25 #include "winbase.h"
26
27 #include "wine/debug.h"
28
29 WINE_DEFAULT_DEBUG_CHANNEL( mscoree );
30
31 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
32 {
33     TRACE("(%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
34
35     switch (fdwReason)
36     {
37     case DLL_WINE_PREATTACH:
38         return FALSE;  /* prefer native version */
39     case DLL_PROCESS_ATTACH:
40         DisableThreadLibraryCalls(hinstDLL);
41         break;
42     case DLL_PROCESS_DETACH:
43         break;
44     }
45     return TRUE;
46 }
47
48 BOOL WINAPI _CorDllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
49 {
50     FIXME("(%p, %d, %p): stub\n", hinstDLL, fdwReason, lpvReserved);
51
52     switch (fdwReason)
53     {
54     case DLL_PROCESS_ATTACH:
55         DisableThreadLibraryCalls(hinstDLL);
56         break;
57     case DLL_PROCESS_DETACH:
58         break;
59     }
60     return TRUE;
61 }
62
63 int WINAPI _CorExeMain(void)
64 {
65     FIXME("Directly running .NET applications not supported.\n");
66     return -1;
67 }
68
69 int WINAPI _CorExeMain2(PBYTE ptrMemory, DWORD cntMemory, LPCWSTR imageName, LPCWSTR loaderName, LPCWSTR cmdLine)
70 {
71     TRACE("(%p, %u, %s, %s, %s)\n", ptrMemory, cntMemory, debugstr_w(imageName), debugstr_w(loaderName), debugstr_w(cmdLine));
72     FIXME("Directly running .NET applications not supported.\n");
73     return -1;
74 }
75
76 void WINAPI _CorImageUnloading(LPCVOID* imageBase)
77 {
78     TRACE("(%p): stub\n", imageBase);
79 }
80
81 DWORD _CorValidateImage(LPCVOID* imageBase, LPCWSTR imageName)
82 {
83     TRACE("(%p, %s): stub\n", imageBase, debugstr_w(imageName));
84     return E_FAIL;
85 }