这个函数是SFilter.c中自带的,你可以搜索一下,它的实现部分如下:
VOID
SfGetObjectName (
IN PVOID Object,
IN OUT PUNICODE_STRING Name
)
/*++
Routine Description:
This routine will return the name of the given object.
If a name can not be found an empty string will be returned.
Arguments:
Object - The object whose name we want
Name - A unicode string that is already initialized with a buffer that
receives the name of the object.
Return Value:
None
--*/
{
NTSTATUS status;
CHAR nibuf[512]; //buffer that receives NAME information and name
POBJECT_NAME_INFORMATION nameInfo = (POBJECT_NAME_INFORMATION)nibuf;
ULONG retLength;
status = ObQueryNameString( Object, nameInfo, sizeof(nibuf), &retLength);