Skip to content

Instantly share code, notes, and snippets.

@adaskar
Last active August 9, 2019 16:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adaskar/35d99e005296dd376a45cd23d746c833 to your computer and use it in GitHub Desktop.
Save adaskar/35d99e005296dd376a45cd23d746c833 to your computer and use it in GitHub Desktop.
#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