MCPcopy Create free account
hub / github.com/CCob/lsarelayx / MH_Uninitialize

Function MH_Uninitialize

plugin/minhook/hook.c:524–560  ·  view source on GitHub ↗

-------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

522
523//-------------------------------------------------------------------------
524MH_STATUS WINAPI MH_Uninitialize(VOID)
525{
526 MH_STATUS status = MH_OK;
527
528 EnterSpinLock();
529
530 if (g_hHeap != NULL)
531 {
532 status = EnableAllHooksLL(FALSE);
533 if (status == MH_OK)
534 {
535 // Free the internal function buffer.
536
537 // HeapFree is actually not required, but some tools detect a false
538 // memory leak without HeapFree.
539
540 UninitializeBuffer();
541
542 HeapFree(g_hHeap, 0, g_hooks.pItems);
543 HeapDestroy(g_hHeap);
544
545 g_hHeap = NULL;
546
547 g_hooks.pItems = NULL;
548 g_hooks.capacity = 0;
549 g_hooks.size = 0;
550 }
551 }
552 else
553 {
554 status = MH_ERROR_NOT_INITIALIZED;
555 }
556
557 LeaveSpinLock();
558
559 return status;
560}
561
562//-------------------------------------------------------------------------
563MH_STATUS WINAPI MH_CreateHook(LPVOID pTarget, LPVOID pDetour, LPVOID *ppOriginal)

Callers

nothing calls this directly

Calls 4

EnterSpinLockFunction · 0.85
EnableAllHooksLLFunction · 0.85
UninitializeBufferFunction · 0.85
LeaveSpinLockFunction · 0.85

Tested by

no test coverage detected