Module: wine Branch: master Commit: f17484205aea11caa6935703b27f2cddfb22bf40 URL: http://source.winehq.org/git/wine.git/?a=commit;h=f17484205aea11caa6935703b2...
Author: Maarten Lankhorst m.b.lankhorst@gmail.com Date: Tue Nov 10 21:13:23 2009 +0100
avrt: Add stub for Av(Set,Revert)MmThreadCharacteristics.
---
dlls/avrt/avrt.spec | 6 +++--- dlls/avrt/main.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 3 deletions(-)
diff --git a/dlls/avrt/avrt.spec b/dlls/avrt/avrt.spec index 103798d..a253d9a 100644 --- a/dlls/avrt/avrt.spec +++ b/dlls/avrt/avrt.spec @@ -1,5 +1,5 @@ @ stub AvQuerySystemResponsiveness -@ stub AvRevertMmThreadCharacteristics +@ stdcall AvRevertMmThreadCharacteristics(long) @ stub AvRtCreateThreadOrderingGroup @ stub AvRtCreateThreadOrderingGroupExA @ stub AvRtCreateThreadOrderingGroupExW @@ -9,6 +9,6 @@ @ stub AvRtWaitOnThreadOrderingGroup @ stub AvSetMmMaxThreadCharacteristicsA @ stub AvSetMmMaxThreadCharacteristicsW -@ stub AvSetMmThreadCharacteristicsA -@ stub AvSetMmThreadCharacteristicsW +@ stdcall AvSetMmThreadCharacteristicsA(str ptr) +@ stdcall AvSetMmThreadCharacteristicsW(wstr ptr) @ stub AvSetMmThreadPriority diff --git a/dlls/avrt/main.c b/dlls/avrt/main.c index a39743c..c4e53dd 100644 --- a/dlls/avrt/main.c +++ b/dlls/avrt/main.c @@ -23,6 +23,7 @@
#include "windef.h" #include "winbase.h" +#include "winnls.h" #include "wine/debug.h" #include "avrt.h"
@@ -45,3 +46,47 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
return TRUE; } + +HANDLE WINAPI AvSetMmThreadCharacteristicsA(LPCSTR TaskName, LPDWORD TaskIndex) +{ + HANDLE ret; + LPWSTR str = NULL; + + if (TaskName) + { + DWORD len = (lstrlenA(TaskName)+1); + str = HeapAlloc(GetProcessHeap, 0, len*sizeof(WCHAR)); + if (!str) + { + SetLastError(ERROR_OUTOFMEMORY); + return NULL; + } + MultiByteToWideChar(CP_ACP, 0, TaskName, len, str, len); + } + ret = AvSetMmThreadCharacteristicsW(str, TaskIndex); + HeapFree(GetProcessHeap(), 0, str); + return ret; +} + +HANDLE WINAPI AvSetMmThreadCharacteristicsW(LPCWSTR TaskName, LPDWORD TaskIndex) +{ + FIXME("(%s,%p): stub\n", debugstr_w(TaskName), TaskIndex); + + if (!TaskName) + { + SetLastError(ERROR_INVALID_TASK_NAME); + return NULL; + } + if (!TaskIndex) + { + SetLastError(ERROR_INVALID_HANDLE); + return NULL; + } + return (HANDLE)0x12345678; +} + +BOOL WINAPI AvRevertMmThreadCharacteristics(HANDLE AvrtHandle) +{ + FIXME("(%p): stub\n", AvrtHandle); + return 1; +}