ntdll: Implement TpCallbackUnloadDllOnCompletion.
This commit is contained in:
parent
15110b1770
commit
8965511957
|
@ -978,6 +978,7 @@
|
|||
@ stdcall TpCallbackReleaseMutexOnCompletion(ptr long)
|
||||
@ stdcall TpCallbackReleaseSemaphoreOnCompletion(ptr long long)
|
||||
@ stdcall TpCallbackSetEventOnCompletion(ptr long)
|
||||
@ stdcall TpCallbackUnloadDllOnCompletion(ptr ptr)
|
||||
@ stdcall TpPostWork(ptr)
|
||||
@ stdcall TpReleaseCleanupGroup(ptr)
|
||||
@ stdcall TpReleaseCleanupGroupMembers(ptr long ptr)
|
||||
|
|
|
@ -210,6 +210,7 @@ struct threadpool_instance
|
|||
HANDLE semaphore;
|
||||
LONG semaphore_count;
|
||||
HANDLE event;
|
||||
HMODULE library;
|
||||
} cleanup;
|
||||
};
|
||||
|
||||
|
@ -1644,6 +1645,7 @@ static void CALLBACK threadpool_worker_proc( void *param )
|
|||
instance.cleanup.semaphore = NULL;
|
||||
instance.cleanup.semaphore_count = 0;
|
||||
instance.cleanup.event = NULL;
|
||||
instance.cleanup.library = NULL;
|
||||
|
||||
switch (object->type)
|
||||
{
|
||||
|
@ -1696,7 +1698,12 @@ static void CALLBACK threadpool_worker_proc( void *param )
|
|||
}
|
||||
if (instance.cleanup.event)
|
||||
{
|
||||
NtSetEvent( instance.cleanup.event, NULL );
|
||||
status = NtSetEvent( instance.cleanup.event, NULL );
|
||||
if (status != STATUS_SUCCESS) goto skip_cleanup;
|
||||
}
|
||||
if (instance.cleanup.library)
|
||||
{
|
||||
LdrUnloadDll( instance.cleanup.library );
|
||||
}
|
||||
|
||||
skip_cleanup:
|
||||
|
@ -1892,6 +1899,19 @@ VOID WINAPI TpCallbackSetEventOnCompletion( TP_CALLBACK_INSTANCE *instance, HAND
|
|||
this->cleanup.event = event;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* TpCallbackUnloadDllOnCompletion (NTDLL.@)
|
||||
*/
|
||||
VOID WINAPI TpCallbackUnloadDllOnCompletion( TP_CALLBACK_INSTANCE *instance, HMODULE module )
|
||||
{
|
||||
struct threadpool_instance *this = impl_from_TP_CALLBACK_INSTANCE( instance );
|
||||
|
||||
TRACE( "%p %p\n", instance, module );
|
||||
|
||||
if (!this->cleanup.library)
|
||||
this->cleanup.library = module;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* TpPostWork (NTDLL.@)
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue