I need to communicate with a user mode application from my drive and I have
been told to use The “Inverted Call” mechanism,
but I marked the Irp as Pending for a user mode application with a GUI but
the call was from a separate thread than the GUI thread, is that OK or do I
have to make the inverted call from an NT service application “without any
GUI” ?
It worked fine for any application. You will see a recomendation for a
service since a service will start automatically and be available at all
times, if you driver needs to communicate it might not find an application
running.
–
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
“Khaled Abdulaziz” wrote in message news:xxxxx@ntfsd…
> I need to communicate with a user mode application from my drive and I
have
> been told to use The “Inverted Call” mechanism,
> but I marked the Irp as Pending for a user mode application with a GUI but
> the call was from a separate thread than the GUI thread, is that OK or do
I
> have to make the inverted call from an NT service application “without any
> GUI” ?
>
>
>
ok i will tell u my problem.
In my application (user mode App. not a service)
- I made a thread (separate than the GUI thread).
- and I make that thread call my driver with a special CTL_CODE.
- in the driver I make the irp of that CTL_CODE marked as pending and i
return STATUS_PENDING to the caller and queue the irp in a special queue in
the driver. - the second time that i use my (user mode App.) to generate a second
thread to call the driver with the same CTL_CODE to be blocked also and
queued, does not success [“i used the DbgPrint” to print any thing if the
CTL_CODE called again and it just print one time for the first thread
only…]
can any one help me to solve this problem Plz.
thanks to all of u.
ok i will tell u my problem.
In my application (user mode App. not a service)
- I made a thread (separate than the GUI thread).
- and I make that thread call my driver with a special CTL_CODE.
- in the driver I make the irp of that CTL_CODE marked as pending and i
return STATUS_PENDING to the caller and queue the irp in a special queue in
the driver. - the second time that i use my (user mode App.) to generate a second
thread to call the driver with the same CTL_CODE to be blocked also and
queued, does not success [“i used the DbgPrint” to print any thing if the
CTL_CODE called again and it just print one time for the first thread
only…]
can any one help me to solve this problem Plz.
thanks to all of u.
In your user app, open the file handle with FILE_FLAG_OVERLAPPED.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: “Khaled Abdulaziz”
Newsgroups: ntfsd
To: “Windows File Systems Devs Interest List”
Sent: Monday, November 22, 2004 1:20 PM
Subject: Re:[ntfsd] inverted call ?
> ok i will tell u my problem.
> In my application (user mode App. not a service)
> 1) I made a thread (separate than the GUI thread).
> 2) and I make that thread call my driver with a special CTL_CODE.
> 3) in the driver I make the irp of that CTL_CODE marked as pending and i
> return STATUS_PENDING to the caller and queue the irp in a special queue in
> the driver.
> 4) the second time that i use my (user mode App.) to generate a second
> thread to call the driver with the same CTL_CODE to be blocked also and
> queued, does not success [“i used the DbgPrint” to print any thing if the
> CTL_CODE called again and it just print one time for the first thread
> only…]
>
> can any one help me to solve this problem Plz.
> thanks to all of u.
>
>
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
i am using DeviceIOControl , i do not see the where I can use the flag
that you are telling me to use (FILE_FLAG_OVERLAPPED) ?!!
please describe to me
thanks 4 u all
You must use it where you are calling
CreateFile.
L.
Before you call DeviceIoControl(…) you open or create file, that is where
you need to put the flag…
Is the second thread blocking ?
Is the second thread returning error from DeviceIOControl call ?
Where are you creating or getting the file handle in the application ? If it
is in the thread, you might be seeing handle ownership problem …
-pro
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Khaled Abdulaziz
Sent: Monday, November 22, 2004 4:09 AM
To: Windows File Systems Devs Interest List
Subject: Re:[ntfsd] Re:inverted call ?
i am using DeviceIOControl , i do not see the where I can use the flag
that you are telling me to use (FILE_FLAG_OVERLAPPED) ?!!
please describe to me
thanks 4 u all
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: xxxxx@garlic.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
Look at CreateFile.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: “Khaled Abdulaziz”
Newsgroups: ntfsd
To: “Windows File Systems Devs Interest List”
Sent: Monday, November 22, 2004 3:09 PM
Subject: Re:[ntfsd] Re:inverted call ?
> i am using DeviceIOControl , i do not see the where I can use the flag
> that you are telling me to use (FILE_FLAG_OVERLAPPED) ?!!
> please describe to me
> thanks 4 u all
>
>
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
i do not use CreateFile at all…
i do not know why or when i need to use CreateFile ?
please Advice…
“Prokash Sinha” wrote in message news:xxxxx@ntfsd…
> Before you call DeviceIoControl(…) you open or create file, that is
> where
> you need to put the flag…
>
> Is the second thread blocking ?
>
> Is the second thread returning error from DeviceIOControl call ?
>
> Where are you creating or getting the file handle in the application ? If
> it
> is in the thread, you might be seeing handle ownership problem …
>
> -pro
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of Khaled Abdulaziz
> Sent: Monday, November 22, 2004 4:09 AM
> To: Windows File Systems Devs Interest List
> Subject: Re:[ntfsd] Re:inverted call ?
>
>
> i am using DeviceIOControl , i do not see the where I can use the flag
> that you are telling me to use (FILE_FLAG_OVERLAPPED) ?!!
> please describe to me
> thanks 4 u all
>
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@garlic.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
>
You need CreateFile to get a handle to call DeviceIoControl on.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: “Khaled Abdulaziz”
Newsgroups: ntfsd
To: “Windows File Systems Devs Interest List”
Sent: Tuesday, November 23, 2004 11:14 AM
Subject: Re:[ntfsd] Re:inverted call ?
> i do not use CreateFile at all…
> i do not know why or when i need to use CreateFile ?
>
> please Advice…
>
> “Prokash Sinha” wrote in message news:xxxxx@ntfsd…
> > Before you call DeviceIoControl(…) you open or create file, that is
> > where
> > you need to put the flag…
> >
> > Is the second thread blocking ?
> >
> > Is the second thread returning error from DeviceIOControl call ?
> >
> > Where are you creating or getting the file handle in the application ? If
> > it
> > is in the thread, you might be seeing handle ownership problem …
> >
> > -pro
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com]On Behalf Of Khaled Abdulaziz
> > Sent: Monday, November 22, 2004 4:09 AM
> > To: Windows File Systems Devs Interest List
> > Subject: Re:[ntfsd] Re:inverted call ?
> >
> >
> > i am using DeviceIOControl , i do not see the where I can use the flag
> > that you are telling me to use (FILE_FLAG_OVERLAPPED) ?!!
> > please describe to me
> > thanks 4 u all
> >
> >
> >
> > —
> > Questions? First check the IFS FAQ at
> > https://www.osronline.com/article.cfm?id=17
> >
> > You are currently subscribed to ntfsd as: xxxxx@garlic.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
> >
> >
>
>
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
How do you obtain a handle to your driver object which is passed to
DeviceIoControl as the first argument?
“Khaled Abdulaziz” wrote in message news:xxxxx@ntfsd…
> i do not use CreateFile at all…
> i do not know why or when i need to use CreateFile ?
>
> please Advice…
>
> “Prokash Sinha” wrote in message news:xxxxx@ntfsd…
> > Before you call DeviceIoControl(…) you open or create file, that is
> > where
> > you need to put the flag…
> >
> > Is the second thread blocking ?
> >
> > Is the second thread returning error from DeviceIOControl call ?
> >
> > Where are you creating or getting the file handle in the application ?
If
> > it
> > is in the thread, you might be seeing handle ownership problem …
> >
> > -pro
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com]On Behalf Of Khaled Abdulaziz
> > Sent: Monday, November 22, 2004 4:09 AM
> > To: Windows File Systems Devs Interest List
> > Subject: Re:[ntfsd] Re:inverted call ?
> >
> >
> > i am using DeviceIOControl , i do not see the where I can use the flag
> > that you are telling me to use (FILE_FLAG_OVERLAPPED) ?!!
> > please describe to me
> > thanks 4 u all
> >
> >
> >
> > —
> > Questions? First check the IFS FAQ at
> > https://www.osronline.com/article.cfm?id=17
> >
> > You are currently subscribed to ntfsd as: xxxxx@garlic.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
> >
> >
>
>
>