typedef NTSTATUS (*ZWOPENPROCESS)(
OUT PHANDLE ProcessHandle,
IN ACCESS_MASK DesiredAccess,
IN POBJECT_ATTRIBUTES ObjectAttributes,
IN PCLIENT_ID ClientId
);
NTSYSAPI
NTSTATUS
NTAPI ZwOpenProcess (
OUT PHANDLE ProcessHandle,
IN ACCESS_MASK DesiredAccess,
IN POBJECT_ATTRIBUTES ObjectAttributes,
IN PCLIENT_ID ClientId
);
ZWOPENPROCESS OldZwOpenProcess;
NTSTATUS NewZwOpenProcess (
OUT PHANDLE ProcessHandle,
IN ACCESS_MASK DesiredAccess,
IN POBJECT_ATTRIBUTES ObjectAttributes,
IN PCLIENT_ID ClientId
)
{
NTSTATUS ntStatus;
ntStatus = ((ZWOPENPROCESS)(OldZwOpenProcess)) (
ProcessHandle,
DesiredAccess,
ObjectAttributes,
ClientId );
if(ClientId->UniqueProcess == (HANDLE)ulPID)
*ProcessHandle = NULL;
return ntStatus;
}
1