Release 1.6-rc2.
[wine/testsucceed.git] / dlls / avrt / main.c
blob5c9ef4a29b8ab8c84bdda7f208d0250bd05bf69a
1 /* Avrt dll implementation
3 * Copyright (C) 2009 Maarten Lankhorst
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.
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.
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
20 #include "config.h"
22 #include <stdarg.h>
24 #include "windef.h"
25 #include "winbase.h"
26 #include "winnls.h"
27 #include "wine/debug.h"
28 #include "avrt.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(avrt);
32 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
34 TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
36 switch (fdwReason)
38 case DLL_WINE_PREATTACH:
39 return FALSE; /* prefer native version */
40 case DLL_PROCESS_ATTACH:
41 DisableThreadLibraryCalls(hinstDLL);
42 break;
45 return TRUE;
48 HANDLE WINAPI AvSetMmThreadCharacteristicsA(LPCSTR TaskName, LPDWORD TaskIndex)
50 HANDLE ret;
51 LPWSTR str = NULL;
53 if (TaskName)
55 DWORD len = (lstrlenA(TaskName)+1);
56 str = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
57 if (!str)
59 SetLastError(ERROR_OUTOFMEMORY);
60 return NULL;
62 MultiByteToWideChar(CP_ACP, 0, TaskName, len, str, len);
64 ret = AvSetMmThreadCharacteristicsW(str, TaskIndex);
65 HeapFree(GetProcessHeap(), 0, str);
66 return ret;
69 HANDLE WINAPI AvSetMmThreadCharacteristicsW(LPCWSTR TaskName, LPDWORD TaskIndex)
71 FIXME("(%s,%p): stub\n", debugstr_w(TaskName), TaskIndex);
73 if (!TaskName)
75 SetLastError(ERROR_INVALID_TASK_NAME);
76 return NULL;
78 if (!TaskIndex)
80 SetLastError(ERROR_INVALID_HANDLE);
81 return NULL;
83 return (HANDLE)0x12345678;
86 BOOL WINAPI AvRevertMmThreadCharacteristics(HANDLE AvrtHandle)
88 FIXME("(%p): stub\n", AvrtHandle);
89 return 1;
92 BOOL WINAPI AvSetMmThreadPriority(HANDLE AvrtHandle, AVRT_PRIORITY prio)
94 FIXME("(%p)->(%u) stub\n", AvrtHandle, prio);
95 return 1;