Piotr Caban : msvcrt: Add CurrentScheduler::Id implementation.

Alexandre Julliard julliard at winehq.org
Fri Mar 31 14:26:28 CDT 2017


Module: wine
Branch: master
Commit: b0ee400ed39d5bac5aab2e3843a041e83f9a06e2
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b0ee400ed39d5bac5aab2e3843a041e83f9a06e2

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Thu Mar 30 22:48:07 2017 +0200

msvcrt: Add CurrentScheduler::Id implementation.

Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/msvcrt/scheduler.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/dlls/msvcrt/scheduler.c b/dlls/msvcrt/scheduler.c
index 3c94bd3..403ff9f 100644
--- a/dlls/msvcrt/scheduler.c
+++ b/dlls/msvcrt/scheduler.c
@@ -115,6 +115,7 @@ static void ExternalContextBase_ctor(ExternalContextBase*);
 typedef struct Scheduler {
     const vtable_ptr *vtable;
 } Scheduler;
+#define call_Scheduler_Id(this) CALL_VTBL_FUNC(this, 4, unsigned int, (const Scheduler*), (this))
 #define call_Scheduler_Reference(this) CALL_VTBL_FUNC(this, 16, unsigned int, (Scheduler*), (this))
 #define call_Scheduler_Release(this) CALL_VTBL_FUNC(this, 20, unsigned int, (Scheduler*), (this))
 #define call_Scheduler_Attach(this) CALL_VTBL_FUNC(this, 28, void, (Scheduler*), (this))
@@ -902,8 +903,13 @@ SchedulerPolicy* __cdecl CurrentScheduler_GetPolicy(SchedulerPolicy *policy)
 /* ?Id at CurrentScheduler@Concurrency@@SAIXZ */
 unsigned int __cdecl CurrentScheduler_Id(void)
 {
-    FIXME("() stub\n");
-    return 0;
+    Context *context = try_get_current_context();
+
+    TRACE("()\n");
+
+    if(!context)
+        return -1;
+    return call_Scheduler_Id(CurrentScheduler_Get());
 }
 
 /* ?IsAvailableLocation at CurrentScheduler@Concurrency@@SA_NABVlocation at 2@@Z */




More information about the wine-cvs mailing list