netstat: Initial implementation.
[wine] / dlls / avrt / main.c
1 /* Avrt dll implementation
2  *
3  * Copyright (C) 2009 Maarten Lankhorst
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18  */
19
20 #include "config.h"
21
22 #include <stdarg.h>
23
24 #include "windef.h"
25 #include "winbase.h"
26 #include "winnls.h"
27 #include "wine/debug.h"
28 #include "avrt.h"
29
30 WINE_DEFAULT_DEBUG_CHANNEL(avrt);
31
32 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
33 {
34     TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
35
36     switch (fdwReason)
37     {
38         case DLL_WINE_PREATTACH:
39             return FALSE;    /* prefer native version */
40         case DLL_PROCESS_ATTACH:
41             DisableThreadLibraryCalls(hinstDLL);
42             break;
43         case DLL_PROCESS_DETACH:
44             break;
45     }
46
47     return TRUE;
48 }
49
50 HANDLE WINAPI AvSetMmThreadCharacteristicsA(LPCSTR TaskName, LPDWORD TaskIndex)
51 {
52     HANDLE ret;
53     LPWSTR str = NULL;
54
55     if (TaskName)
56     {
57         DWORD len = (lstrlenA(TaskName)+1);
58         str = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
59         if (!str)
60         {
61             SetLastError(ERROR_OUTOFMEMORY);
62             return NULL;
63         }
64         MultiByteToWideChar(CP_ACP, 0, TaskName, len, str, len);
65     }
66     ret = AvSetMmThreadCharacteristicsW(str, TaskIndex);
67     HeapFree(GetProcessHeap(), 0, str);
68     return ret;
69 }
70
71 HANDLE WINAPI AvSetMmThreadCharacteristicsW(LPCWSTR TaskName, LPDWORD TaskIndex)
72 {
73     FIXME("(%s,%p): stub\n", debugstr_w(TaskName), TaskIndex);
74
75     if (!TaskName)
76     {
77         SetLastError(ERROR_INVALID_TASK_NAME);
78         return NULL;
79     }
80     if (!TaskIndex)
81     {
82         SetLastError(ERROR_INVALID_HANDLE);
83         return NULL;
84     }
85     return (HANDLE)0x12345678;
86 }
87
88 BOOL WINAPI AvRevertMmThreadCharacteristics(HANDLE AvrtHandle)
89 {
90     FIXME("(%p): stub\n", AvrtHandle);
91     return 1;
92 }
93
94 BOOL WINAPI AvSetMmThreadPriority(HANDLE AvrtHandle, AVRT_PRIORITY prio)
95 {
96     FIXME("(%p)->(%u) stub\n", AvrtHandle, prio);
97     return 1;
98 }