CreateFile problem...

My Driver code snippet is

DriverObject->DriverUnload = ioperm_unload;
DriverObject->MajorFunction[IRP_MJ_CREATE] = ioperm_dispatch_create;

/* initialize counted unicode strings */
RtlInitUnicodeString( &DeviceName, L"\Device\kiran" );
RtlInitUnicodeString( &SymbolicLinkName, L"\DosDevices\kiran" );

status = IoCreateDevice( DriverObject, 0, &DeviceName,
FILE_DEVICE_UNKNOWN, 0, FALSE, &DeviceObject );
if (!NT_SUCCESS( status ))
return status;

status = IoCreateSymbolicLink( &SymbolicLinkName, &DeviceName );
if (!NT_SUCCESS( status ))
return status;

return STATUS_SUCCESS;

After loading the driver as thru OpenSCManager and CreateService, I
executed an aplication which did

CreateFile(“\\.\kiran”, …)

But this operation failed. Can anyone please throw some light on this?

Thanks
Kiran

check using WinObj whether Device object gets created or not ?
----- Original Message -----
From: “Kiran”
To: “Windows System Software Developers Interest List”
Sent: Monday, August 18, 2003 12:43 PM
Subject: [ntdev] CreateFile problem…

> My Driver code snippet is
> ------------------------------------------------
> DriverObject->DriverUnload = ioperm_unload;
> DriverObject->MajorFunction[IRP_MJ_CREATE] = ioperm_dispatch_create;
>
> /* initialize counted unicode strings */
> RtlInitUnicodeString( &DeviceName, L"\Device\kiran" );
> RtlInitUnicodeString( &SymbolicLinkName, L"\DosDevices\kiran" );
>
> status = IoCreateDevice( DriverObject, 0, &DeviceName,
> FILE_DEVICE_UNKNOWN, 0, FALSE, &DeviceObject );
> if (!NT_SUCCESS( status ))
> return status;
>
> status = IoCreateSymbolicLink( &SymbolicLinkName, &DeviceName );
> if (!NT_SUCCESS( status ))
> return status;
>
> return STATUS_SUCCESS;
> --------------------------------------------------------
> After loading the driver as thru OpenSCManager and CreateService, I
> executed an aplication which did
>
> CreateFile(“\\.\kiran”, …)
>
> But this operation failed. Can anyone please throw some light on this?
>
> Thanks
> Kiran
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@oas.co.in
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

What are you doing in this function??

ioperm_dispatch_create()

-----Original Message-----
From: Kiran [mailto:xxxxx@wipro.com]
Sent: Monday, August 18, 2003 12:43 PM
To: Windows System Software Developers Interest List
Subject: [ntdev] CreateFile problem…

My Driver code snippet is

DriverObject->DriverUnload = ioperm_unload;
DriverObject->MajorFunction[IRP_MJ_CREATE] = ioperm_dispatch_create;

/* initialize counted unicode strings */
RtlInitUnicodeString( &DeviceName, L"\Device\kiran" );
RtlInitUnicodeString( &SymbolicLinkName, L"\DosDevices\kiran" );

status = IoCreateDevice( DriverObject, 0, &DeviceName,
FILE_DEVICE_UNKNOWN, 0, FALSE, &DeviceObject );
if (!NT_SUCCESS( status ))
return status;

status = IoCreateSymbolicLink( &SymbolicLinkName, &DeviceName );
if (!NT_SUCCESS( status ))
return status;

return STATUS_SUCCESS;

After loading the driver as thru OpenSCManager and CreateService, I
executed an aplication which did

CreateFile(“\\.\kiran”, …)

But this operation failed. Can anyone please throw some light on this?

Thanks
Kiran


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@satyam.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
**************************************************************************
This email (including any attachments) is intended for the sole use of the
intended recipient/s and may contain material that is CONFIDENTIAL AND
PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or
distribution or forwarding of any or all of the contents in this message is
STRICTLY PROHIBITED. If you are not the intended recipient, please contact
the sender by email and delete all copies; your cooperation in this regard
is appreciated.
**************************************************************************

Hi,Kiran

You can Get last error code after CreateFile failed,it always show what happened.

======= 2003-08-18 03:13:00 You wrote=======

My Driver code snippet is

DriverObject->DriverUnload = ioperm_unload;
DriverObject->MajorFunction[IRP_MJ_CREATE] = ioperm_dispatch_create;

/* initialize counted unicode strings */
RtlInitUnicodeString( &DeviceName, L"\Device\kiran" );
RtlInitUnicodeString( &SymbolicLinkName, L"\DosDevices\kiran" );

status = IoCreateDevice( DriverObject, 0, &DeviceName,
FILE_DEVICE_UNKNOWN, 0, FALSE, &DeviceObject );
if (!NT_SUCCESS( status ))
return status;

status = IoCreateSymbolicLink( &SymbolicLinkName, &DeviceName );
if (!NT_SUCCESS( status ))
return status;

return STATUS_SUCCESS;

After loading the driver as thru OpenSCManager and CreateService, I
executed an aplication which did

CreateFile(“\\.\kiran”, …)

But this operation failed. Can anyone please throw some light on this?

Thanks
Kiran


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@sinfors.com.cn
To unsubscribe send a blank email to xxxxx@lists.osr.com

= = = = = = = = = = = = = = = = = = = =

Crasher Guo
xxxxx@sinfors.com.cn
2003-08-18

Contrl Panel ->Admin settings->
ComputerManagement->System Tools->System Information->Software
Environment -> Drivers
shows the entry for my driver.

Is there any other place I need to check?

Thanx

  • Kiran

-----Original Message-----
From: shekhar [mailto:xxxxx@oas.co.in]
Sent: Monday, August 18, 2003 1:21 PM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: CreateFile problem…

check using WinObj whether Device object gets created or not ?
----- Original Message -----
From: “Kiran”
To: “Windows System Software Developers Interest List”

Sent: Monday, August 18, 2003 12:43 PM
Subject: [ntdev] CreateFile problem…

> My Driver code snippet is
> ------------------------------------------------
> DriverObject->DriverUnload = ioperm_unload;
> DriverObject->MajorFunction[IRP_MJ_CREATE] = ioperm_dispatch_create;
>
> /* initialize counted unicode strings */
> RtlInitUnicodeString( &DeviceName, L"\Device\kiran" );
> RtlInitUnicodeString( &SymbolicLinkName, L"\DosDevices\kiran" );
>
> status = IoCreateDevice( DriverObject, 0, &DeviceName,
> FILE_DEVICE_UNKNOWN, 0, FALSE, &DeviceObject );
> if (!NT_SUCCESS( status ))
> return status;
>
> status = IoCreateSymbolicLink( &SymbolicLinkName, &DeviceName );
> if (!NT_SUCCESS( status ))
> return status;
>
> return STATUS_SUCCESS;
> --------------------------------------------------------
> After loading the driver as thru OpenSCManager and CreateService, I
> executed an aplication which did
>
> CreateFile(“\\.\kiran”, …)
>
> But this operation failed. Can anyone please throw some light on this?
>
> Thanks
> Kiran
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@oas.co.in
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@wipro.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

You could try http://www.sysinternals.com/ntw2k/freeware/winobj.shtml and
check “Device” and “??” for your device resp. the link.

Regards
Volker

-----Original Message-----
From: Kiran Bacche [mailto:xxxxx@wipro.com]
Sent: Monday, August 18, 2003 9:44 AM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: CreateFile problem…

Contrl Panel ->Admin settings->
ComputerManagement->System Tools->System Information->Software
Environment -> Drivers
shows the entry for my driver.

Is there any other place I need to check?

Thanx

  • Kiran

-----Original Message-----
From: shekhar [mailto:xxxxx@oas.co.in]
Sent: Monday, August 18, 2003 1:21 PM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: CreateFile problem…

check using WinObj whether Device object gets created or not ?
----- Original Message -----
From: “Kiran”
> To: “Windows System Software Developers Interest List”
>
> Sent: Monday, August 18, 2003 12:43 PM
> Subject: [ntdev] CreateFile problem…
>
>
> > My Driver code snippet is
> > ------------------------------------------------
> > DriverObject->DriverUnload = ioperm_unload;
> > DriverObject->MajorFunction[IRP_MJ_CREATE] = ioperm_dispatch_create;
> >
> > /* initialize counted unicode strings */
> > RtlInitUnicodeString( &DeviceName, L"\Device\kiran" );
> > RtlInitUnicodeString( &SymbolicLinkName, L"\DosDevices\kiran" );
> >
> > status = IoCreateDevice( DriverObject, 0, &DeviceName,
> > FILE_DEVICE_UNKNOWN, 0, FALSE, &DeviceObject );
> > if (!NT_SUCCESS( status ))
> > return status;
> >
> > status = IoCreateSymbolicLink( &SymbolicLinkName, &DeviceName );
> > if (!NT_SUCCESS( status ))
> > return status;
> >
> > return STATUS_SUCCESS;
> > --------------------------------------------------------
> > After loading the driver as thru OpenSCManager and CreateService, I
> > executed an aplication which did
> >
> > CreateFile(“\\.\kiran”, …)
> >
> > But this operation failed. Can anyone please throw some
> light on this?
> >
> > Thanks
> > Kiran
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@oas.co.in
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@wipro.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@baslerweb.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

?static NTSTATUS STDCALL
?ioperm_dispatch_create( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp )
?{
? Irp->IoStatus.Status = STATUS_SUCCESS;
? Irp->IoStatus.Information = 0;
? IoCompleteRequest( Irp, IO_NO_INCREMENT );
?
? return STATUS_SUCCESS;
?}

Is the code for create…

Cheers
Kiran

-----Original Message-----
From: Shiva_Shankar [mailto:xxxxx@Satyam.com]
Sent: Monday, August 18, 2003 12:58 PM
To: Windows System Software Developers Interest List
Subject: [ntdev] RE: CreateFile problem…

What are you doing in this function??

ioperm_dispatch_create()

-----Original Message-----
From: Kiran [mailto:xxxxx@wipro.com]
Sent: Monday, August 18, 2003 12:43 PM
To: Windows System Software Developers Interest List
Subject: [ntdev] CreateFile problem…

My Driver code snippet is

DriverObject->DriverUnload = ioperm_unload;
DriverObject->MajorFunction[IRP_MJ_CREATE] = ioperm_dispatch_create;

/* initialize counted unicode strings */
RtlInitUnicodeString( &DeviceName, L"\Device\kiran" );
RtlInitUnicodeString( &SymbolicLinkName, L"\DosDevices\kiran" );

status = IoCreateDevice( DriverObject, 0, &DeviceName,
FILE_DEVICE_UNKNOWN, 0, FALSE, &DeviceObject );
if (!NT_SUCCESS( status ))
return status;

status = IoCreateSymbolicLink( &SymbolicLinkName, &DeviceName );
if (!NT_SUCCESS( status ))
return status;

return STATUS_SUCCESS;

After loading the driver as thru OpenSCManager and CreateService, I
executed an aplication which did

CreateFile(“\\.\kiran”, …)

But this operation failed. Can anyone please throw some light on this?

Thanks
Kiran


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@satyam.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
**************************************************************************
This email (including any attachments) is intended for the sole use of the
intended recipient/s and may contain material that is CONFIDENTIAL AND
PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or
distribution or forwarding of any or all of the contents in this message is
STRICTLY PROHIBITED. If you are not the intended recipient, please contact
the sender by email and delete all copies; your cooperation in this regard
is appreciated.
**************************************************************************


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@wipro.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Hi,
GetLastError() returned 0x57.

Thanx
Kiran

-----Original Message-----
From: Crasher Guo [mailto:xxxxx@sinfors.com.cn]
Sent: Monday, August 18, 2003 1:07 PM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: CreateFile problem…

Hi,Kiran

You can Get last error code after CreateFile failed,it always show what
happened.

======= 2003-08-18 03:13:00 You wrote=======

My Driver code snippet is

DriverObject->DriverUnload = ioperm_unload;
DriverObject->MajorFunction[IRP_MJ_CREATE] = ioperm_dispatch_create;

/* initialize counted unicode strings */
RtlInitUnicodeString( &DeviceName, L"\Device\kiran" );
RtlInitUnicodeString( &SymbolicLinkName, L"\DosDevices\kiran" );

status = IoCreateDevice( DriverObject, 0, &DeviceName,
FILE_DEVICE_UNKNOWN, 0, FALSE, &DeviceObject );
if (!NT_SUCCESS( status ))
return status;

status = IoCreateSymbolicLink( &SymbolicLinkName, &DeviceName );
if (!NT_SUCCESS( status ))
return status;

return STATUS_SUCCESS;

After loading the driver as thru OpenSCManager and CreateService, I
executed an aplication which did

CreateFile(“\\.\kiran”, …)

But this operation failed. Can anyone please throw some light on this?

Thanks
Kiran


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@sinfors.com.cn
To unsubscribe send a blank email to xxxxx@lists.osr.com

= = = = = = = = = = = = = = = = = = = =

Crasher Guo
xxxxx@sinfors.com.cn
2003-08-18


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@wipro.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

This means “The parameter is incorrect.” and suggests that any of
CreateFile’s parameters is wrong.

-----Original Message-----
From: Kiran Bacche [mailto:xxxxx@wipro.com]
Sent: Monday, August 18, 2003 10:43 AM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: CreateFile problem…

Hi,
GetLastError() returned 0x57.

Thanx
Kiran

-----Original Message-----
From: Crasher Guo [mailto:xxxxx@sinfors.com.cn]
Sent: Monday, August 18, 2003 1:07 PM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: CreateFile problem…

Hi,Kiran

You can Get last error code after CreateFile failed,it always
show what
happened.

======= 2003-08-18 03:13:00 You wrote=======

>My Driver code snippet is
>------------------------------------------------
>DriverObject->DriverUnload = ioperm_unload;
>DriverObject->MajorFunction[IRP_MJ_CREATE] = ioperm_dispatch_create;
>
>/* initialize counted unicode strings */
>RtlInitUnicodeString( &DeviceName, L"\Device\kiran" );
>RtlInitUnicodeString( &SymbolicLinkName, L"\DosDevices\kiran" );
>
>status = IoCreateDevice( DriverObject, 0, &DeviceName,
> FILE_DEVICE_UNKNOWN, 0, FALSE, &DeviceObject );
>if (!NT_SUCCESS( status ))
> return status;
>
>status = IoCreateSymbolicLink( &SymbolicLinkName, &DeviceName );
>if (!NT_SUCCESS( status ))
> return status;
>
>return STATUS_SUCCESS;
>--------------------------------------------------------
>After loading the driver as thru OpenSCManager and CreateService, I
>executed an aplication which did
>
>CreateFile(“\\.\kiran”, …)
>
>But this operation failed. Can anyone please throw some
light on this?
>
>Thanks
> Kiran
>
>—
>Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@sinfors.com.cn
>To unsubscribe send a blank email to xxxxx@lists.osr.com

= = = = = = = = = = = = = = = = = = = =

Crasher Guo
xxxxx@sinfors.com.cn
2003-08-18


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@wipro.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@baslerweb.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Did step through DriverEntry, AddDevice, and StartDevice, and did all of
them return properly, or was there errors? Any problems handling the PnP and
Power IRPs? Oh … did you unload function ever get called?


Gary G. Little
Seagate Technologies, LLC
xxxxx@seagate.com

“Kiran” wrote in message news:xxxxx@ntdev…
>
> My Driver code snippet is
> ------------------------------------------------
> DriverObject->DriverUnload = ioperm_unload;
> DriverObject->MajorFunction[IRP_MJ_CREATE] = ioperm_dispatch_create;
>
> /* initialize counted unicode strings */
> RtlInitUnicodeString( &DeviceName, L"\Device\kiran" );
> RtlInitUnicodeString( &SymbolicLinkName, L"\DosDevices\kiran" );
>
> status = IoCreateDevice( DriverObject, 0, &DeviceName,
> FILE_DEVICE_UNKNOWN, 0, FALSE, &DeviceObject );
> if (!NT_SUCCESS( status ))
> return status;
>
> status = IoCreateSymbolicLink( &SymbolicLinkName, &DeviceName );
> if (!NT_SUCCESS( status ))
> return status;
>
> return STATUS_SUCCESS;
> --------------------------------------------------------
> After loading the driver as thru OpenSCManager and CreateService, I
> executed an aplication which did
>
> CreateFile(“\\.\kiran”, …)
>
> But this operation failed. Can anyone please throw some light on this?
>
> Thanks
> Kiran
>
>

Yes, you are right.
I provided “OPEN_EXISTIN” instead of ‘0’
And now CreateFile succeeds.

Thanx for all the help
Cheers
Kiran

-----Original Message-----
From: Moebius, V. [mailto:xxxxx@baslerweb.com]
Sent: Monday, August 18, 2003 2:23 PM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: CreateFile problem…

This means “The parameter is incorrect.” and suggests that any of
CreateFile’s parameters is wrong.

-----Original Message-----
From: Kiran Bacche [mailto:xxxxx@wipro.com]
Sent: Monday, August 18, 2003 10:43 AM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: CreateFile problem…

Hi,
GetLastError() returned 0x57.

Thanx
Kiran

-----Original Message-----
From: Crasher Guo [mailto:xxxxx@sinfors.com.cn]
Sent: Monday, August 18, 2003 1:07 PM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: CreateFile problem…

Hi,Kiran

You can Get last error code after CreateFile failed,it always
show what
happened.

======= 2003-08-18 03:13:00 You wrote=======

>My Driver code snippet is
>------------------------------------------------
>DriverObject->DriverUnload = ioperm_unload;
>DriverObject->MajorFunction[IRP_MJ_CREATE] = ioperm_dispatch_create;
>
>/* initialize counted unicode strings */
>RtlInitUnicodeString( &DeviceName, L"\Device\kiran" );
>RtlInitUnicodeString( &SymbolicLinkName, L"\DosDevices\kiran" );
>
>status = IoCreateDevice( DriverObject, 0, &DeviceName,
> FILE_DEVICE_UNKNOWN, 0, FALSE, &DeviceObject );
>if (!NT_SUCCESS( status ))
> return status;
>
>status = IoCreateSymbolicLink( &SymbolicLinkName, &DeviceName );
>if (!NT_SUCCESS( status ))
> return status;
>
>return STATUS_SUCCESS;
>--------------------------------------------------------
>After loading the driver as thru OpenSCManager and CreateService, I
>executed an aplication which did
>
>CreateFile(“\\.\kiran”, …)
>
>But this operation failed. Can anyone please throw some
light on this?
>
>Thanks
> Kiran
>
>—
>Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@sinfors.com.cn
>To unsubscribe send a blank email to xxxxx@lists.osr.com

= = = = = = = = = = = = = = = = = = = =

Crasher Guo
xxxxx@sinfors.com.cn
2003-08-18


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@wipro.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@baslerweb.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@wipro.com
To unsubscribe send a blank email to xxxxx@lists.osr.com