Hi
I am having a problem creating a handler for pocket pc. Below is a snippet of the code i am using. It works perfectly in WinXP but not in Windows Mobile5.0(Dell Axim X51V)
I had changed the pinvoke to use coredll.dll for pocket pc.
private const string NDIS_FILE_NAME = @"\\.\\Ndisuio";
DriverHandle = CreateFile(NDIS_FILE_NAME,
GENERIC_READ | GENERIC_WRITE, 0, 0,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
INVALID_HANDLE_VALUE);
DriverHandle returned is -1 which is INVALID_HANDLE_VALUE.
After the create file i got error code 161 which is "ERROR_BAD_PATHNAME - The specified path is invalid."
Is my path to Ndisuio incorrect Or anyone know what is wrong
Thanks in advance.

Problem creating NDISUIO handle
USJOHN
Except things like:
Dll ndisuio.dll
Flags 2
Index 1
Order 3
Prefix UIO
This is all the information the registry provided.
MongoBongo
A) what does the registry entry say as far as path
B) \\.\\ looks like escaped slash . escaped slash ... which seems to be a reference to root (the first slash) then a reference to self (again, root -- a dot is current directory, two dots is parent directory) and another escaped slash -- meaning, if it's even a valid path for a device, you're looking for nsiduio in the root of the device. you'll want to reference the path found in the registry .. something simialr to \\windows\\nsudio I'd suspect, but I don't have a device with me here at the office to check.
OClaudiu
B) \\.\\ denotes directory if I am not wrong.
Marc Sutton
DriverHandle = CreateFile("UIO1:",
GENERIC_READ | GENERIC_WRITE, 0, 0,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
INVALID_HANDLE_VALUE);
A valid driver handle is return. Last error is 0 which is normal.
Next I used the handle to invoke DeviceIoControl,
DeviceIoControl(DriverHandle,
IOCTL.IOCTL_NDISUIO_BIND_WAIT,
IntPtr.Zero,
0,
IntPtr.Zero,
0,
out BytesReturned,
Handle.Zero
The error returned is 6 "ERROR_INVALID_HANDLE The handle is invalid."
It make me wonder what i did wrongly.
Note:
internal enum IOCTL
{
IOCTL_NDISUIO_BIND_WAIT = ((0x12) << 16) | ((0x1 | 0x2) << 14) | ((0x204) << 2) | (0),
IOCTL_NDISUIO_QUERY_BINDING = ((0x12) << 16) | ((0x1 | 0x2) << 14) | ((0x203) << 2) | (0),
IOCTL_NDISUIO_OPEN_DEVICE = ((0x12) << 16) | ((0x1 | 0x2) << 14) | ((0x200) << 2) | (0),
IOCTL_NDISUIO_QUERY_OID_VALUE = ((0x12) << 16) | ((0x1 | 0x2) << 14) | ((0x201) << 2) | (0),
IOCTL_NDISUIO_SET_OID_VALUE = ((0x12) << 16) | ((0x1 | 0x2) << 14) | ((0x205) << 2) | (0)
}
Maeestro
There is no path or special filename prefix (\\.\) needed.
You should be able to get the handle using 'UIO1:' as filename.
More see:
http://groups.google.com/group/microsoft.public.windowsce.platbuilder/browse_thread/thread/12e99b712bcc643f/1259aecd214f85d1 lnk=st&q=UIO1%3A+CreateFile&rnum=4#1259aecd214f85d1
Hope this helps
Michael
Bhanu Prakash Nunna - MSFT
a) does ndisuio even exist on devices
b) what's with the \\.\\ notation