Skip to content

Commit

Permalink
proper error code from PortmasterClearCache
Browse files Browse the repository at this point in the history
  • Loading branch information
vlabo committed Oct 12, 2022
1 parent 41f0b96 commit 57751b2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pm_kext_glue_dll/src/pm_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,13 @@ extern _EXPORT UINT32 PortmasterGetPayload(UINT32 packet_id, UINT8* buf, UINT32*
}

extern _EXPORT UINT32 PortmasterClearCache() {
UINT32 rc = DeviceIoControl(deviceHandle, IOCTL_CLEAR_CACHE, NULL, 0, NULL, 0, NULL, NULL);
return rc;
bool success = DeviceIoControl(deviceHandle, IOCTL_CLEAR_CACHE, NULL, 0, NULL, 0, NULL, NULL);
if(!success) {
UINT32 rc = GetLastError();
WARN("Failed to clear cache: %d", rc);
return rc;
}
return ERROR_SUCCESS;
}


Expand Down

0 comments on commit 57751b2

Please sign in to comment.