josenhuang
驱动牛犊
驱动牛犊
  • 注册日期2003-08-25
  • 最后登录2008-11-06
  • 粉丝0
  • 关注0
  • 积分46分
  • 威望9点
  • 贡献值0点
  • 好评度1点
  • 原创分0分
  • 专家分0分
阅读:2836回复:5

为什么我的向导生成的USB驱动程序,编译时找不到ntstrsafe.lib?

楼主#
更多 发布于:2005-08-04 09:55
  为什么我的向导生成的USB驱动程序,编译正确,但是连接时找不到ntstrsafe.lib?
我用的是XPSP1+XPDDK+DS3.2
daixw
驱动牛犊
驱动牛犊
  • 注册日期2006-10-14
  • 最后登录2007-01-29
  • 粉丝0
  • 关注0
  • 积分810分
  • 威望82点
  • 贡献值0点
  • 好评度81点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2007-01-07 21:02
你把那个库文件在设置里删了吧,可以不要
wesleyhuang
驱动牛犊
驱动牛犊
  • 注册日期2005-08-02
  • 最后登录2005-08-19
  • 粉丝0
  • 关注0
  • 积分6分
  • 威望2点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2005-08-06 09:14
我的机器上根本就没有ntstrsafe.lib文件呀?大家帮帮忙是不是一定需要?哪位老兄能发一份ntstrsafe.h和ntstrsafe.lib给我?

josenhuang@163.com
wesleyhuang
驱动牛犊
驱动牛犊
  • 注册日期2005-08-02
  • 最后登录2005-08-19
  • 粉丝0
  • 关注0
  • 积分6分
  • 威望2点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
地板#
发布于:2005-08-04 17:01
先谢谢你,再慢慢看。
但是我的机器上好像也没有ntstrsafe.lib库。
我编译一下DDK看会不会生成
zhouxingyanjy
驱动牛犊
驱动牛犊
  • 注册日期2005-07-14
  • 最后登录2005-08-04
  • 粉丝0
  • 关注0
  • 积分2分
  • 威望2点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
地下室#
发布于:2005-08-04 16:20
这是MSDN上的相关帮助,不知对你有没有用。
另忘了发到邮箱里哟: zhouxingyan7171@sina.com

Importing Kernel-Mode Safe String Functions
The kernel-mode safe string functions are available:

As inline code that is contained in ntstrsafe.h.
In a library to which your code can be linked.

Use the inline versions of the kernel-mode safe string functions if your code will execute only on Windows XP and later versions of the operating system. If your code must execute on any Windows system earlier than Windows XP, you must use the library versions of the safe string functions.

To use the inline versions of the kernel-mode safe string functions
Include the header file, as shown.

#include <ntstrsafe.h>



To use the library versions of the kernel-mode safe string functions

Define NTSTRSAFE_LIB before including the new header file, as shown.
#define NTSTRSAFE_LIB
#include <ntstrsafe.h>



In your project's sources file, add a TARGETLIBS entry for $(DDK_LIB_PATH)\ntstrsafe.lib.


Whenever you include ntstrsafe.h in a source file, the C/C++ language runtime library functions that ntstrsafe.h replaces become unavailable. If you call one of these unavailable functions, the compiler supplies an error message that tells you to use the safe string functions.

Similarly, if a header file supplies code that references one or more of the replaced functions, and if that header file is included after ntstrsafe.h, those functions will cause the compiler's error message to be displayed. Therefore, the include statement for ntstrsafe.h should follow all other headers' include statements.

If you want to be able to use both the C/C++ language runtime library functions and the safe string functions, include the following line in your code before including the ntstrsafe.h header file.

#define NTSTRSAFE_NO_DEPRECATE



You can make available only the byte-counted or only the character-counted safe string functions.

To allow only byte-counted functions
Include the following line in your code before including the ntstrsafe.h header file.

#define NTSTRSAFE_NO_CCH_FUNCTIONS


To allow only character-counted functions
Include the following line in your code before including the ntstrsafe.h header file.

#define NTSTRSAFE_NO_CB_FUNCTIONS



You can define either NTSTRSAFE_NO_CB_FUNCTIONS or NTSTRSAFE_NO_CCH_FUNCTIONS, but not both.

The maximum number of characters that any ANSI or Unicode string can contain is STRSAFE_MAX_CCH. This constant is defined in ntstrsafe.h.

If a string will be placed into a UNICODE_STRING structure, the string length must not exceed 65,535 characters.
zhouxingyanjy
驱动牛犊
驱动牛犊
  • 注册日期2005-07-14
  • 最后登录2005-08-04
  • 粉丝0
  • 关注0
  • 积分2分
  • 威望2点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
5楼#
发布于:2005-08-04 16:16
老兄,可不可以把你的ntstrsafe.h和ntstrsafe.lib以及这几个相关的东西发一个与我,我使用的是2000的ddk,操作系统也是2000,可用DriverStudio3.1导向生成的DDK使用到这个头文件和这个库。
谢谢了。
邮箱:zhouxingyan7171@sina.com
游客

返回顶部