ling592
驱动牛犊
驱动牛犊
  • 注册日期2007-04-09
  • 最后登录2016-01-09
  • 粉丝0
  • 关注0
  • 积分250分
  • 威望26点
  • 贡献值0点
  • 好评度25点
  • 原创分0分
  • 专家分0分
阅读:2934回复:8

sfilter的NLGetFullPathName得到短名?

楼主#
更多 发布于:2007-06-26 18:30
为什么我在wdk的sfilter ,sfcreate中 NLGetFullPathName有时会得到\Docume~1\user\locals~1\之类的短名?
有人遇到同样的情况吗?
谢谢!
chrysanth
驱动牛犊
驱动牛犊
  • 注册日期2007-05-02
  • 最后登录2010-02-02
  • 粉丝0
  • 关注0
  • 积分9分
  • 威望129点
  • 贡献值0点
  • 好评度61点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2007-06-26 21:31
unresolved external symbol _NLAllocateNameControl@8 referenced in function _FsTPMCreateRoutine@8

借用宝地.
请问这个错误是什么原因
znsoft
管理员
管理员
  • 注册日期2001-03-23
  • 最后登录2023-10-25
  • 粉丝300
  • 关注6
  • 积分910分
  • 威望14796点
  • 贡献值7点
  • 好评度2410点
  • 原创分5分
  • 专家分100分
  • 社区居民
  • 最爱沙发
  • 社区明星
板凳#
发布于:2007-06-26 22:03
楼上的,你的sfilter源码不全.需要namelookup库.新版的sfilter带
http://www.zndev.com 免费源码交换网 ----------------------------- 软件创造价值,驱动提供力量! 淡泊以明志,宁静以致远。 ---------------------------------- 勤用搜索,多查资料,先搜再问。
chrysanth
驱动牛犊
驱动牛犊
  • 注册日期2007-05-02
  • 最后登录2010-02-02
  • 粉丝0
  • 关注0
  • 积分9分
  • 威望129点
  • 贡献值0点
  • 好评度61点
  • 原创分0分
  • 专家分0分
地板#
发布于:2007-06-26 22:22
不大懂 我的 namelookup.h 文件是这样子的

不知道什么原因

/*++

Copyright (c) 2004  Microsoft Corporation

Module Name:

    namelookup.h

Abstract:

    Header file containing the name lookup device extension and name lookup
    function prototypes.


Environment:

    Kernel mode

--*/

#ifndef __NAMELOOKUP_H__
#define __NAMELOOKUP_H__

#include "namelookupdef.h"

//
//  Give pointer alignment characteristics for the different processor types
//

#if defined(_X86_)
#   define DECLSPEC_PTRALIGN __declspec(align(4))
#elif defined(_AMD64_)
#   define DECLSPEC_PTRALIGN __declspec(align(8))
#elif defined(_IA64_)
#   define DECLSPEC_PTRALIGN __declspec(align(8))
#else
#   error "No target architecture defined"
#endif

//
//  These structures are used to retrieve the name of objects.  To prevent
//  allocating memory every time we get a name, and to prevent having large
//  string buffers on the stack, this structure contains a small
//  buffer (which should handle 90+% of all names).  If we do overflow this
//  buffer we will allocate a buffer big enough for the name.
//

typedef struct _NAME_CONTROL {

    //
    //  UNICODE_STRING whos buffer is either SmallBuffer or AllocatedBuffer
    //  if a larger buffer was needed.
    //

    UNICODE_STRING Name;

    //
    //  AllocatedBuffer is used when we need a buffer larger than SmallBuffer.
    //

    PUCHAR AllocatedBuffer;

    //
    //  The size of whatever buffer is currently being used (SmallBuffer or
    //  AllocatedBuffer) in bytes.
    //

    ULONG BufferSize;

    //
    //  This is the buffer that we start out with.  The thinking is that this
    //  should be large enough for most names.
    //

    DECLSPEC_PTRALIGN UCHAR SmallBuffer[254];

} NAME_CONTROL, *PNAME_CONTROL;


//
//  NL_EXTENSION is the part of a device extension that is needed
//  by the name lookup routines.  All the non-namelookup data contained
//  here should be needed by any filter.  Simply use this as part of
//  any filter's device extension.
//

typedef struct _NL_DEVICE_EXTENSION_HEADER {

    //
    //  Device Object this device extension is attached to
    //

    PDEVICE_OBJECT ThisDeviceObject;

    //
    //  Device object this filter is directly attached to
    //

    PDEVICE_OBJECT AttachedToDeviceObject;

    //
    //  When attached to Volume Device Objects, the physical device object
    //  that represents that volume.  NULL when attached to Control Device
    //  objects.
    //

    PDEVICE_OBJECT StorageStackDeviceObject;

    //
    //  DOS representation of the device name.
    //

    UNICODE_STRING DosName;

    //
    //  Name for this device.  If attached to a Volume Device Object it is the
    //  name of the physical disk drive.  If attached to a Control Device
    //  Object it is the name of the Control Device Object.  This is in the
    //  "\Device\...\" format.
    //

    UNICODE_STRING DeviceName;

} NL_DEVICE_EXTENSION_HEADER, *PNL_DEVICE_EXTENSION_HEADER;



/////////////////////////////////////////////////////////////////////////////
//
//  Name lookup functions.
//
/////////////////////////////////////////////////////////////////////////////

NTSTATUS
NLGetFullPathName (
    IN PFILE_OBJECT FileObject,
    IN OUT PNAME_CONTROL FileNameControl,
    IN PNL_DEVICE_EXTENSION_HEADER NLExtHeader,
    IN NAME_LOOKUP_FLAGS LookupFlags,
    IN PPAGED_LOOKASIDE_LIST LookasideList,
    OUT PBOOLEAN CacheName
    );

PNAME_CONTROL
NLGetAndAllocateObjectName (
    IN PVOID Object,
    IN PPAGED_LOOKASIDE_LIST LookasideList
    );

NTSTATUS
NLGetObjectName (
    IN PVOID Object,
    IN OUT PNAME_CONTROL ObjectNameCtrl
    );

VOID
NLGetDosDeviceName (
    IN PDEVICE_OBJECT DeviceObject,
    IN PNL_DEVICE_EXTENSION_HEADER NLExtHeader
    );

/////////////////////////////////////////////////////////////////////////////
//
//  General support routines
//
/////////////////////////////////////////////////////////////////////////////

NTSTATUS
NLAllocateAndCopyUnicodeString (
    IN OUT PUNICODE_STRING DestName,
    IN PUNICODE_STRING SrcName,
    IN ULONG PoolTag
    );

/////////////////////////////////////////////////////////////////////////////
//
//  Name lookup device extension header functions.
//
/////////////////////////////////////////////////////////////////////////////

VOID
NLInitDeviceExtensionHeader (
    IN PNL_DEVICE_EXTENSION_HEADER NLExtHeader,
    IN PDEVICE_OBJECT ThisDeviceObject,
    IN PDEVICE_OBJECT StorageStackDeviceObject
    );

VOID
NLCleanupDeviceExtensionHeader(
    IN PNL_DEVICE_EXTENSION_HEADER NLExtHeader
    );

/////////////////////////////////////////////////////////////////////////////
//
//  Routines to support generic name control structures that allow us
//  to get names of arbitrary size.
//
/////////////////////////////////////////////////////////////////////////////
NTSTATUS
NLAllocateNameControl (
    OUT PNAME_CONTROL *NameControl,
    IN PPAGED_LOOKASIDE_LIST LookasideList
    );

VOID
NLFreeNameControl (
    IN PNAME_CONTROL NameControl,
    IN PPAGED_LOOKASIDE_LIST LookasideList
    );

NTSTATUS
NLCheckAndGrowNameControl (
    IN OUT PNAME_CONTROL NameCtrl,
    IN USHORT NewSize
    );

VOID
NLInitNameControl (
    IN PNAME_CONTROL NameCtrl
    );

VOID
NLCleanupNameControl (
    IN PNAME_CONTROL NameCtrl
    );

NTSTATUS
NLReallocNameControl (
    IN PNAME_CONTROL NameCtrl,
    IN ULONG NewSize,
    OUT PWCHAR *RetOriginalBuffer OPTIONAL
    );

#endif
chrysanth
驱动牛犊
驱动牛犊
  • 注册日期2007-05-02
  • 最后登录2010-02-02
  • 粉丝0
  • 关注0
  • 积分9分
  • 威望129点
  • 贡献值0点
  • 好评度61点
  • 原创分0分
  • 专家分0分
地下室#
发布于:2007-06-26 22:27
namelookup.h 里面函数是如何实现的呢
tooflat
论坛版主
论坛版主
  • 注册日期2002-07-08
  • 最后登录2014-03-11
  • 粉丝2
  • 关注0
  • 积分1007分
  • 威望551点
  • 贡献值3点
  • 好评度476点
  • 原创分0分
  • 专家分0分
5楼#
发布于:2007-06-26 23:51
在create irp完成后取文件名可以避免这个问题,2k ntfs需要特殊处理。
devia
论坛版主
论坛版主
  • 注册日期2005-05-14
  • 最后登录2016-04-05
  • 粉丝3
  • 关注0
  • 积分1029分
  • 威望712点
  • 贡献值1点
  • 好评度555点
  • 原创分8分
  • 专家分4分
6楼#
发布于:2007-06-27 07:44
引用第5楼tooflat于2007-06-26 23:51发表的  :
在create irp完成后取文件名可以避免这个问题,2k ntfs需要特殊处理。


但是有很多情况是需要在create之前来做类似与deny的动作
(因为cancel post IRP_MJ_CREATE异常复杂),所以。。。
人总在矛盾中徘徊。。。
wanfustudio
驱动牛犊
驱动牛犊
  • 注册日期2006-08-09
  • 最后登录2016-01-09
  • 粉丝0
  • 关注0
  • 积分720分
  • 威望73点
  • 贡献值0点
  • 好评度72点
  • 原创分0分
  • 专家分0分
7楼#
发布于:2007-06-29 15:42
咋都不回答楼主的问题呢:(
wowocock
VIP专家组
VIP专家组
  • 注册日期2002-04-08
  • 最后登录2016-01-09
  • 粉丝16
  • 关注2
  • 积分601分
  • 威望1651点
  • 贡献值1点
  • 好评度1227点
  • 原创分1分
  • 专家分0分
8楼#
发布于:2007-07-27 17:24
自己层层解析为长名。
花开了,然后又会凋零,星星是璀璨的,可那光芒也会消失。在这样 一瞬间,人降生了,笑者,哭着,战斗,伤害,喜悦,悲伤憎恶,爱。一切都只是刹那间的邂逅,而最后都要归入死亡的永眠
游客

返回顶部