通过 CreateFile 打开无线网卡,并使用 DeviceIoControl 问题?
我从 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards
得到了 网卡的名字,使用
memset(SymbolicLinkA,0,MAX_PATH);
strcpy(SymbolicLinkA,"\\\\.\\");
strcat(SymbolicLinkA,adaptername);//{6EFC6662-3A56-43E1-ABCE-0C4EAE89CC3B}
OpenDevHandle = CreateFile(SymbolicLinkA,
GENERIC_READ | GENERIC_WRITE,
0,
0,
CREATE_NEW,
FILE_ATTRIBUTE_NORMAL,
0
);
int fak = GetLastError();
OpenDevHandle 结果是 oxfffff
fak 结果是 3, 〖3〗-系统找不到指定的路径。
Before an application can use IOCTL_NDIS_QUERY_GLOBAL_STATS, it must call the CreateFile function to open a handle to the network adapter. In this CreateFile call, the application passes a pointer to a null-terminated string that specifies the name of the device that NDIS registered. For NT-based operating systems, the application can retrieve the name from the ServiceName value of the "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\NetworkCards\Nnn" key in the registry, where Nnn is the string for the adapter's instance number. The string should be of the form "\\.\Xxx", where Xxx is the string for the adapter's service name. The application can use the following registry functions to access the registry:
按照 MSDN 的说法,我仿佛没有错啊
哪位兄弟知道的,指教一下啊