CreteFile problem - TechRepublic
Question
November 25, 2008 at 02:46 AM
raghuramos1987

CreteFile problem

by raghuramos1987 . Updated 17 years, 7 months ago

Hi everybody,

I’m trying to get an application to talk to a driver. In my Driver code i have

PDEVICE_OBJECT pdevice_obj;
UNICODE_STRING devname;
UNICODE_STRING targname;
pdevice_extension pdevice_ext;
NTSTATUS ntstatus;
RtlInitUnicodeString(&devname, L”\\Device\\Usb_iodelay”);
ntstatus = IoCreateDevice(pdriver_obj,
sizeof(device_extension),
&devname,
FILE_DEVICE_UNKNOWN,
0,
FALSE,
&pdevice_obj);
if(!NT_SUCCESS(ntstatus))
{
STATUS_CHECK(ntstatus,
“add_device – could not create device object”);
return ntstatus;
}
RtlInitUnicodeString(&targname, L”\\DosDevices\\Usb_delay”);
IoCreateSymbolicLink(&targname, &devname);
if(!NT_SUCCESS(ntstatus))
{
STATUS_CHECK(ntstatus,
“add_device – could not link device object”);
return ntstatus;
}

Here i dont get any errors. But when i check if the handle is created (using QuickView). I dont see my drivers handle there. …

This discussion is locked

All Comments