Skip to content

Instantly share code, notes, and snippets.

@adaskar
Last active Aug 9, 2019
Embed
What would you like to do?
#define KEYWORD L"APIHook"
static BOOL WINAPI MY_DeleteFileW(_In_ LPCWSTR lpFileName)
{
// Dosya isminde KEYWORD(L"APIHook") var mi?
// Var ise, LastError'u ERROR_ACCESS_DENIED yap ve hata don.
if (wcsstr(lpFileName, KEYWORD)) {
SetLastError(ERROR_ACCESS_DENIED);
return FALSE;
}
// Yok ise, gercek DeleteFileW i cagir.
return MS_DeleteFileW(lpFileName);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment