usb storage - how to eject/remove from explorer

hello,

i have created an UpperFilter driver for the DiskDrive class. the purpose is 
to enable/disable usb sticks. i have created a control device object and 
created a couple of IOCTRLs, so that my user app can do the 
enabling/disabling.  to disable, in AddDevice, i do IoGetDeviceProperty on 
the DeviceObject's DevicePropertyHardwareID. if it begins with USBSTOR then i 
set a 'isUsb' flag on the DeviceExtension. then, in the IRP_MJ_CREATE 
handler, i get this flag back, and if set, i just do IoCompleteRequest and 
return success. this works just fine - when i insert a usb stick, nothing 
happens, ie it does not even appear in explorer (and DbgView shows the filter 
driver doing the above).

however, this does not affect already inserted usb sticks. they still stay 
in explorer. i have sort of got round this by again checking for the isUsb 
flag in the IRP_MJ_READ/WRITE handlers, and again just doing IoComplete. this 
does prevent read/write access to the stick, but you are still able to see it 
in explorer.

so what i really need is, when my filter driver receives the 'disable' 
IOCTRL, to sort of send an 'eject' or 'remove' message to already inserted 
sticks. now i *think* the answer is for my filter driver to create an 
IRP_MJ_REMOVE and send this down the stack to all the inserted devices...but 
then i will have to know the DeviceObjects for all inserted sticks. i guess i 
could do this by having a global array of the DeviceObjects that i get in 
AddDevice ? 

i guess im looking for someone to tell me if this logic sounds right or 
whether theres a better way.

thank you.
0
Utf
5/28/2010 1:21:01 PM
development.device.drivers 941 articles. 0 followers. Follow

0 Replies
631 Views

Similar Articles

[PageSpeed] 3

Reply:

Similar Artilces:

Remove defunct mail servers
Hi, I have some mail servers that no longer exist and would like to remove them from ESM. How can i do this as each time as when i try to right click them, the system hangs and i receive and error.. any ideas here? All i am looking to do is tidy up ESM, my mail system all works as it should and there are no problems.. regards Chris If the servers are no longer available you will have to use ADSIEdit to remove the servers directly from AD. Nue "Chris" <Chris@discussions.microsoft.com> wrote in message news:0499BF5A-FD75-409F-8700-57BA25AF57F0@microsoft.com... > H...

Remove Office Registration doesn't work!
I have the Student edition of Office 2004 which comes with 3 licences. My daughter recently bought a new Mac and inadvertently entered the Licence # which I have of my Mac. We are on a home network. The result is that we cannot both use Office at the same time. After doing a Search in Microsoft's Mac support pages, I found the instructions for changing the Licence information, however it seems to come unstuck once you click the ker to Remove Licence Information. A box comes up saying you have to remove certain files before you can go further and then lists all the Microsoft software on my...

Windows Explorer problems with Office 2007 documents (read only)
Some Office 2007 Documents [compatibilty Mode] Opens as 'Read Only' Rename + Saving not allowed -"already open in other application" Checked document properties -Read Only NOT set Closing and re-opening Windows Explorer sometimes works, other times Laptop must be restared, Explorer re-opened, then the Document can be Renamed, Deleted, Saved, Moved or Opens OK - sometimes If I save as a differnt name = OK, but to delete the old file I have to re-start Explorer or the PC -very frustrating as this doesn't always work either! If I use another File Manager (Paper ...

Internet Explorer Contol on a dialog based application
I am trying to create a dialog application that hosts an ie control, an image control, a list control, a status bar, and several static labels. All of the documentation I've seen uses a SDI or MDI to host the web page. I need the web page to reside in a small portion of the dialog (just enough room to display my html pages that contain some ActiveX controls) and the remaining controls to reside in the rest of the dialog (including a menu). I've discovered that this is not easy to do in VC++ 6.0. Can you give me some assistance in finding a solution for this. Thanks, -- DR ...

How do you remove the decimal point in a number?
If you have 124.70 in a cell is there a way to remove the decimal point and show it as 12470? On Fri, 6 Aug 2004 12:51:04 -0700, carter <carter@discussions.microsoft.com> wrote: >If you have 124.70 in a cell is there a way to remove the decimal point and >show it as 12470? Multiply by 100 124.70 * 100 = 12470 --ron Da, that will work, thanks! Not exactly what I was thinking of, but if it orks it works! Thanks again! "Ron Rosenfeld" wrote: > On Fri, 6 Aug 2004 12:51:04 -0700, carter <carter@discussions.microsoft.com> > wrote: > > >If yo...

How to remove Opportunity from the Invoice form?
We will be building Quotes in CRM but fulfilling Orders in Navision. The Invoice will also be created in Navision. We are going to set up a data feed to receive Navision Invoice info into the CRM Invoice form in a read only format. As a result, I need to strip down the Invoice form. For example, the Opportunity should not be on the Invoice form now. I went to remove the attribute but was not able. "The field you are trying to remove is required by the system or business." So I went to the Invoice entity, found the Opportunity attribute, and was hoping it would be set ...

removing signatures below dash dash space when replying in Outlook 2007ff
Hey everyone! I seem to fail to find the right search expressions to locate a solution to this: On a colleague's Outlook 2007, I have seen that Outlook did not remove his signature in a plaintext message, after the "dash dash space" line indicating a signature following. Could anyone tell me how to configure Outlook to do this? Cheers, Lars On 01/14/2011 11:23 AM, Lars Uffmann wrote: > to this: On a colleague's Outlook 2007, I have seen that Outlook did not > remove his signature in a plaintext message, after the "dash dash space" That is - when replyi...

remove "getting started" from excel 2003
Hi all. Whenever i open excel 2003, i could see the "getting started" box on the right side of excel application. How do i remove it permanently? I have another question. When i open 1 of my excel document there is a green triangle on every cell of 1 column. How can i remove the green triangles? Thks in advance. Both can be resolved from the Tools>Options dialog box. On the View tab, uncheck Startup Task Pane in the "Show" section On the Error Checking tab, uncheck the Enable background error checkin in the "Settings" section. note: the green triangle...

No database in Recovery Storage Group
Hi all, I'm having an issue trying to recover data from a crashed Exchange 2003 Server. I rebuilt the server (same domain/computer name) and rebuilt all the mailboxes as they were before. I recovered the .edb and .stm files and ran eseutil to make sure it was shut down clean and there wasn't any corruption. I used the /mh switch Exchange 2003 is at service pack2 I've copied the .edb and .stm files to the recovery storage group folder Then added a recovery storage group from within Exchange system manager. But no mailbox store appears, I've let it sit ...

How can I remove photoview
photoview is preventing my applications from running. I cant even delete it from the registry. how do I remove it please? charles@farley.xxx wrote: > photoview is preventing my applications from running. > I cant even delete it from the registry. > > how do I remove it please? Programs & Features control panel and remove it and/or follow the manufacturer's instrcutions. What exactly *is* PhotoView (the one you are speaking of?) -- Shenan Stanley MS-MVP -- How To Ask Questions The Smart Way http://www.catb.org/~esr/faqs/smart-question...

How can I make an Excel file selected in Explorer open automatica.
I upgraded to Office 2007. Now when clicking on an Excel file in Windows Explorer, Excel opens without showing any workbook. I have to click on "open" in Excel, then "cancel" in the Explorer window that opens to have the previously selected file open. From that point on, any Excel file I click on will open properly. At least til Excel is exited and reopened. Right-click on the file in Explorer. Select Open With>Choose Default Program... Select Excel Ensure "Always use the selected program to open this kind of file" is checked Select OK Regard...

Problem removing check box in Tree Control
Hi All, I am using a tree control with checkbox property on. Now I want to remove the checkbox for root folder only. I am using following code for the same. HTREEITEM hItem = NULL; hItem=GetRootItem(); SetItemState(hItem, 0, TVIS_STATEIMAGEMASK); Now the problem is that this code works only in the function with a AFX message map. If I use this code in function where I am adding a root item, it doesnt work. Although I am calling it after adding a root item. Also SetItemState is returning 1 i.e successful. In both the cases hItem is getting the same handle value. Where i am goin wrong? Plz H...

Problem Removing Disabled Macros
When I open a spreadsheet that I've inherited, I get the warning that macros are disabled. No problem. Everything seems to work fine with them disabled, so I want to remove any macros so the warning goes away in the future. Problem is, I can't find any macros to remove. Where should I look? How can I make this warning go away? It doesn't happen if I open a new blank worksheet. Thanks, Dave First, back up that workbook with the macros--you never know if you just haven't found the trouble yet. Then visit Debra Dalgleish's site: http://www.contextures.com/xlfaqMac.html#No...

Remove auto date function in cells
When I type '11/12' for example in Excel 2003 it automatically changes it to '12-Nov'. How can I remove this function? I tried endlessly to change thing in 'options' but nothing seemed to work! Thanks for any help Format the cell for text. (This doesn't fix cells you've already typed in) It always will do that as it sees a date, try '11/12 the apostrophe will show in the formula bar but not in the cell, the ' converts it to text, Regards, Alan. "TKassis" <TKassis@discussions.microsoft.com> wrote in message news:EF7291DB-615E-4D64...

Look at that correction patch for Internet Explorer
--zrxoqqznbjcwswgw Content-Type: multipart/related; boundary="jqrnroleaefupwbmb"; type="multipart/alternative" --jqrnroleaefupwbmb Content-Type: multipart/alternative; boundary="qqtkjtcthiqega" --qqtkjtcthiqega Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Microsoft Partner this is the latest version of security update, the "November 2003, Cumulative Patch" update which resolves all known security vulnerabilities affecting MS Internet Explorer, MS Outlook and MS Outlook Express. Install now to maintain the security of your com...

How to remove white border when printing from Publisher?
Hi I am trying to find out if there is any way you can change it so when you print a document in Publisher it doesn't print out with a white border around the edge? For example I am creating a drama programme for a play. The front cover is an image, and although I have stretched it so it fills the template in Publisher when I print it, it prints with a white border around it. Thanks -- H That is a printer setting. I think it's safe to say that almost all printers these days are capable of full bleed (no white border), however you may have to play with the settings. I would ...

Paid Removal Transaction stored procedure
Hi everyone, I have to say i am so glad i found this group because i have had a few issues i can't resolve and I am hoping you guys could help. Every time i tried to run the Paid Removal Transaction stored procedure in a client machine the system gets stuck and a message arises. The first message was: “The stored procedure rmPaidTransactionRemoval returned the following results: DBMS 7221, Great Plains 0” I was searching around and I found out this could be a result of a lack of SQL service pack updates, which was true, so I talked to the IT person in charge and he ...

removing test drive office 2004
hi, i don't want to keep the test-drive office 2004 because i already have office v. X and it's good enough for me. i am ready to remove the test-drive and my question is this: what about word files and power point presentations i have created during the trial period on office 2004? is there any chance i will lose these files or be unable to open them in office v. X? thank you, elizabeth ...

Consolidating Data Between Worksheets with Duplicates Removed
I am interested in tracking lab values that my staff enter into a daily worksheet. I would like to compile monthly percentages (% low, % in range, % high) but sometimes it is necessary to have duplicate data on consecutive worksheets for my staff's workflow. These duplicate values will cause my percentages (and absolute numbers) to be incorrect if I just sum between the worksheets. Does anyone have a solution? Thank you, Jody Hi, Probably the best way is to create another set of data which excludes any duplicates. There are many ways of doing this, depending on th...

Outlook 2003 cannot remove Inbox filter
Suddenly my Outlook 2003 inbox has a filter applied such that I cannot see emails which I know are in my in my inbox. Inbox heading says "filter applied" but I cannot find any filter to remove. Can anyone quickly help? Beemer "Beemer" <Beemer@nowhere.com> wrote in message news:%23mrxntIQHHA.2312@TK2MSFTNGP04.phx.gbl... | Suddenly my Outlook 2003 inbox has a filter applied such that I cannot see | emails which I know are in my in my inbox. Inbox heading says "filter | applied" but I cannot find any filter to remove. Can anyone quickly help? | ...

metadata removal 04-13-10
An attorney in our office asked me to tell him the best way to remove metadata from a document. Although we have a "metadata washer" program on the system (used mostly after track changes), I told him that I thought it was better to "paste special" the document as unformatted text. I've worried a little about that answer since then, so I thought I'd ask you if what I told him was reasonable. What would your answer have been? And thanks for being there during the countless times I've needed you! How is the document stored? For example, i...

Check out critical update for Internet Explorer
--cduvkyhvenmzawxtz Content-Type: multipart/related; boundary="bvapawmftmzs"; type="multipart/alternative" --bvapawmftmzs Content-Type: multipart/alternative; boundary="xmgldqcengw" --xmgldqcengw Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Microsoft Client this is the latest version of security update, the "September 2003, Cumulative Patch" update which resolves all known security vulnerabilities affecting MS Internet Explorer, MS Outlook and MS Outlook Express as well as three newly discovered vulnerabilities. Install now t...

PeekMessage returns TRUE, but removes message.
My app has a second thread that contains a child window of a window in the primary thread. The second (CWinThread-derived) thread has its own message loop, but routes messages using the MFC mechanism; basically ripped from Thrdcore.cpp. For some reason the PeekMessage call is returning TRUE, but is removing the message from the queue. This means that PumpMessage locks out (in GetMessage) until another message arrives. The message always appears to be a WM_PAINT (and the update region is not always empty, either). The problem occurs when I drag another window over the child, causing ...

Old server exchange 2k removal
Hi! I have two server : server A with windows 2000 and exchange 2000. (This server will "died") new server B with windows 2003 and exchange 2003. (This server will be the new one) I have just installed Exchange 2003 on server B. In the Exchange System Administrator I find both servers. How could I remove completely the old one ? Thanks. Use this article to manually remove Exchange 2000: 260378 How to manually remove an Exchange 2000 installation http://support.microsoft.com/?id=260378 Then follow the article listed at the bottom of that one that explains how to go about...

Internet Explorer stops working
My internet explorer will come up with a small box staying it has stopped working. I do not know how to fix this. Now my computer will sometimes just shut down. When I rebot I am asked if I want to resume where I was.. Also I can only access basic aol email since this has started.. Anything I can do myself without having to go out and pay someone.. I am unemployeed so $ are slim.... How does your question pertain to Windows Update, Marryann? Windows version? IE version? What anti-virus application is install and is your subscription current? Those with IE-specific qu...