![]() |
|
#5
|
|||
|
|||
|
SESE is very userful for debugging and preventing memory/handle leaks. My lovely construction is:
Code:
VOID
RoutineName(
PVOID Arg0
)
{
HANDLE hFile = INVALID_HANDLE_VALUE;
PVOID pMem = NULL;
do
{
if (!Arg0)
{
DebugRoutine(__FILE__, __LINE__, ...
break;
}
hFile = ...
pMem = ...
} while (FALSE);
if (hFile != INVALID_HANDLE_VALUE) {
CloseHandle(hFile);
}
if (pMem) {
...
}
|
| Tags |
| code, hosts, patcher, source |
|
|