int vmprof_disable(void) { if (remove_sigprof_timer() == -1) { return -1; } if (remove_sigprof_handler() == -1) { return -1; } if (close_profile() == -1) { return -1; } return 0; }
BOOL destroy_profile(PDH_profile *prof) { BOOL ret = TRUE; __try { if (prof->hCounter != NULL) ret = (PdhRemoveCounter(prof->hCounter) == ERROR_SUCCESS); if (!close_profile(prof)) ret = FALSE; } __except(EXCEPTION_EXECUTE_HANDLER) { ret = FALSE; } return (ret); }