extern "C" __declspec(dllexport) int Unload(void) { UnhookWindowsHooks(); if (hModulesLoaded) UnhookEvent(hModulesLoaded); if (hMsgEventHook) UnhookEvent(hMsgEventHook); if (hOptionsInitialize) UnhookEvent(hOptionsInitialize); if (hEnableService) DestroyServiceFunction(hEnableService); if (hDisableService) DestroyServiceFunction(hDisableService); if (hStartBlinkService) DestroyServiceFunction(hStartBlinkService); if (hEventsOpenedService) DestroyServiceFunction(hEventsOpenedService); if (hFlashingEventService) DestroyServiceFunction(hFlashingEventService); if (hNormalizeSequenceService) DestroyServiceFunction(hNormalizeSequenceService); // Wait for thread to exit SetEvent(hExitEvent); WaitForSingleObject(hThread, INFINITE); RestoreLEDState(); CloseKeyboardDevice(); destroyProcessList(); destroyProtocolList(); return 0; }
extern "C" __declspec(dllexport) int Unload(void) { UnhookWindowsHooks(); // Wait for thread to exit WaitForSingleObject(hThread, INFINITE); RestoreLEDState(); CloseKeyboardDevice(); destroyProcessList(); destroyProtocolList(); return 0; }