阅读:1261回复:7
如何得知 设备的 符号连接名 ???
最近在看关于如何打开网卡的 方法, 由于如果不亲自 写驱动 , 无发知道 GUID ,所以 只能用符号连接名了, 但 我要如何的知设备的 符号连接名呢 , 我 把注册表里的 各项都是过了,可就是打不开,用的是 CREATEFILE ()
不只那里可以找到啊 ? |
|
|
沙发#
发布于:2005-03-04 18:28
这个有用吗。。。
ZwQuerySymbolicLinkObject NTSTATUS ZwQuerySymbolicLinkObject( IN HANDLE LinkHandle, IN OUT PUNICODE_STRING LinkTarget, OUT PULONG ReturnedLength OPTIONAL ); ZwQuerySymbolicLinkObject returns a Unicode string containing the target of the symbolic link. Parameters LinkHandle Specifies a valid handle to an open symbolic link object obtained by calling ZwOpenSymbolicLinkObject. LinkTarget Points to an initialized Unicode string that contains the target of the symbolic link, specified by LinkHandle, if the call was successful. ReturnedLength Optionally, points to a unsigned long integer that on input contains the maximum number of bytes to copy into the Unicode string at LinkTarget. On output, the unsigned long integer contains the length of the Unicode string naming the target of the symbolic link. Include ntddk.h Return Value ZwOpenSymbolicLinkObject returns either STATUS_SUCCESS to indicate the routine completed without error or STATUS_BUFFER_TOO_SMALL if the Unicode string provided at LinkTarget is too small to hold the returned string. Comments Before calling this routine, driver writers must ensure that the Unicode string at LinkTarget has been properly initialized and a buffer for the string has been allocated. The MaximumLength and Buffer members of the Unicode string must be set before calling ZwQuerySymbolicLinkObject or the call will fail. If ZwQuerySymbolicLinkObject returns STATUS_BUFFER_TOO_SMALL drivers should examine the value returned at ReturnedLength. The number returned in this variable indicates the maximum length that the Unicode string for the target of the symbolic link. Callers of this routine must be running at IRQL PASSIVE_LEVEL. [编辑 - 3/4/05 by aiwadgj] |
|
|
板凳#
发布于:2005-03-05 09:19
最近在看关于如何打开网卡的 方法, 由于如果不亲自 写驱动 , 无发知道 GUID ,所以 只能用符号连接名了, 但 我要如何的知设备的 符号连接名呢 , 我 把注册表里的 各项都是过了,可就是打不开,用的是 CREATEFILE () 如果不是编程的话,用WINOBJ看看 |
|
|
地板#
发布于:2005-03-05 10:57
用NetCfgInstanceId打开设备
|
|
地下室#
发布于:2005-03-05 13:11
如果不是编程的话,用WINOBJ看看 |
|
|
5楼#
发布于:2005-03-06 10:25
Thanks for all !!
I will try ! |
|
|
6楼#
发布于:2005-03-06 10:40
等等 , 那个 winobj 在哪里啊 ?
他是哪个工具自带的吗 ? |
|
|
7楼#
发布于:2005-03-06 12:27
给你传上来一个
|
|
|