阅读:1323回复:7
请教关于SymblicLinkName调用问题???
我的是视频采集卡的驱动,pnp,在AddDevice中用IoRegisterDeviceInterface注册接口和符号链接名,但在vc application中用SetupDiGetDeviceInterfaceDetail得到一个112字节的符号链接名ifDetail->DevicePath:
\\\\\\pci#ven_12d5_1000&subsys_000012d5&rev_oo#5&2268dc17&0&0060f0#{4d36e97e-e325-11ce-bfc1-08002be10318} 但createfile fail, HANDLE rv = CreateFile(ifDetail->DevicePath, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); 请教怎么能解决???? 不胜感激!!! |
|
沙发#
发布于:2003-08-05 13:11
错误码?
|
|
|
板凳#
发布于:2003-08-05 14:13
getlasterror : 1
|
|
地板#
发布于:2003-08-05 16:33
1、你确认 ifDetail->DevicePath 是以0结尾的字符串吗?
2、驱动中该接口使能了吗? |
|
|
地下室#
发布于:2003-08-05 22:04
lReturn不要给0,还是给个参数吧
|
|
5楼#
发布于:2003-08-06 13:14
老哥,符号扩展名和符号名不一样。createfile不能用符号扩展名,应该用你的IoCreateDevice指定的名字。符号扩展名是系统用的用来唯一标示你的设备的字符串。
|
|
6楼#
发布于:2003-08-11 17:17
You used wrong file name to open the file.
You should use symbolic link name rather than internal device name. Symbolic link names appear beneath the \\?? tree. If you install one software called \"winobj\", you will see your device\'s symbolic link name in it. |
|
7楼#
发布于:2003-08-12 13:31
Debug you driver, set a break in IRP_MJ_CREATE dispatch route,and you will find a way
|
|
|