diff --git a/dlls/avrt/avrt.spec b/dlls/avrt/avrt.spec index 103798d733c..a253d9a4a18 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 a39743c6a6e..c4e53dd2d76 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; +}