bcb隐藏窗口_[转载] 检测隐藏进程

BOOLEAN

ExEnumHandleTable(

IN PHANDLE_TABLE HandleTable,

IN EX_ENUMERATE_HANDLE_ROUTINE EnumHandleProcedure,

IN PVOID EnumParameter,

OUT PHANDLE Handle OPTIONAL

)/*++

Routine Description:

This function enumerates all the valid handles in a handle table.

For each valid handle in the handle table, the specified eumeration

function is called. If the enumeration function returns TRUE, then

the enumeration is stopped, the current handle is returned to the

caller via the optional Handle parameter, and this function returns

TRUE to indicated that the enumeration stopped at a specific handle.

Arguments:

HandleTable - Supplies a pointer to a handle table.

EnumHandleProcedure - Supplies a pointer to a fucntion to call for

each valid handle in the enumerated handle table.

EnumParameter - Supplies an uninterpreted 32-bit value that is passed

to the EnumHandleProcedure each time it is called.

Handle - Supplies an optional pointer a variable that receives the

Handle value that the enumeration stopped at. Contents of the

variable only valid if this function returns TRUE.

Return Value:

If the enumeration stopped at a specific handle, then a value of TRUE

is returned. Otherwise, a value of FALSE is returned.

--*/{

PHANDLE_ENTRY HandleEntry;

BOOLEAN ResultValue;

PHANDLE_ENTRY TableEntries;

PHANDLE_ENTRY TableBound;

ULONG TableIndex;

PAGED_CODE();

ASSERT(HandleTable!=NULL);Lock the handle table exclusive and enumerate the handle entries.//ResultValue=FALSE;

ExLockHandleTableShared(HandleTable);

TableBound=HandleTable->TableBound;

TableEntries=HandleTable->TableEntries;

HandleEntry=&TableEntries[1];while(HandleEntry

TableIndex=HandleEntry-TableEntries;if((*EnumHandleProcedure)(HandleEntry,

INDEX_TO_HANDLE(TableIndex),

EnumParameter)) {if(ARGUMENT_PRESENT(Handle)) {*Handle=INDEX_TO_HANDLE(TableIndex);

}

ResultValue=TRUE;break;

}

}

HandleEntry+=1;

}

ExUnlockHandleTableShared(HandleTable);returnResultValue;

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值