> For the complete documentation index, see [llms.txt](https://malwaresourcecode.com/home/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://malwaresourcecode.com/home/antidebugging-methods/closehandleoninvalidaddress.md).

# CloseHandleOnInvalidAddress

```
BOOL AdfCloseHandleOnInvalidAddress(VOID)
{
	__try
	{
#pragma warning( push )
#pragma warning( disable : 4312)
		CloseHandle((HANDLE)0xDEADBEEF);
#pragma warning( pop ) 
		return FALSE;
	}
	__except (EXCEPTION_INVALID_HANDLE == GetExceptionCode() ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH)
	{
		return TRUE;
	}

	return FALSE;
}
```
