NTSTATUS
ObpCreateHandle (
IN OB_OPEN_REASON OpenReason,
IN PVOID Object,
IN POBJECT_TYPE ExpectedObjectType OPTIONAL,
IN PACCESS_STATE AccessState,
IN ULONG ObjectPointerBias OPTIONAL,
IN ULONG Attributes,
IN POBP_LOOKUP_CONTEXT LookupContext,
IN KPROCESSOR_MODE AccessMode,
OUT PVOID *ReferencedNewObject OPTIONAL,
OUT PHANDLE Handle
)
//省略若干内容
if ((ARGUMENT_PRESENT( ExpectedObjectType )) &&
(ObjectType != ExpectedObjectType )) {
if (LookupContext) {
ObpReleaseLookupContext( LookupContext );
}
return( STATUS_OBJECT_TYPE_MISMATCH );
}
//……