WIN7下安全删除硬件和XP安全删除硬件的区别 WIN7U盘安全删除硬件VC注册表 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用API Monitor监视Explorer.exe? 补充:下面是XP方式安全删除硬件,在WIN7下是失败的。下面2种方式都成功了,但是我不知道系统调用的那些命令 怎么做,能得到什么数据?应该能得到写了哪些注册表和调用了哪些API 怎么做,能得到什么数据?应该能得到写了哪些注册表和调用了哪些API能具体点吗?我下载了API MONITOR,然后挂载了explorer.exe。接着不知道做什么了。删除U盘点动作,api monitor也没有啥明显的变化指示。 ms-help://MS.VSCC.v90/MS.MSDNQTR.v90.chs/kmdf_d/hh/KMDF_d/Ch4_DFPnPPackage_41654846-fa49-4f33-a16c-68b3d0badbbe.xml.htm Windows Driver Kit: Kernel-Mode Driver Framework A User Unplugs a DeviceWhile a system is running, a user can remove a device in one of two ways: by orderly removal, which means that the user informs the system that the device is about to be removed (for example, by using the Unplug or Eject Hardware program); or by surprise removal, which means that the user unplugs the device without informing the system. If the bus supports surprise removal (for example, USB), the device's drivers must be able to handle the device's sudden disappearance.Orderly RemovalThe user requests removal by using the system's Unplug or Eject Hardware program, by disabling the device by using Device Manager, or by pushing an ejectable device's eject button. The framework allows the device to be removed or disabled, unless the driver has:Called WdfDeviceSetSpecialFileSupport and a special file is open on the device. Called WdfDeviceSetStaticStopRemove. Supplied an EvtDeviceQueryRemove callback function, and the callback function has vetoed the removal. For each function and filter driver that supports the device, the framework does the following, in sequence, one driver at a time, starting with the driver that is highest in the driver stack:If the driver is using self-managed I/O, the framework calls the driver's EvtDeviceSelfManagedIoSuspend callback function. The framework stops all of the device's power-managed I/O queues. If the hardware and driver support DMA, the framework calls the driver's EvtDmaEnablerSelfManagedIoStop, EvtDmaEnablerFlush, and EvtDmaEnablerDisable callback functions (if they exist) for each DMA channel that was created. The framework calls the driver's EvtDeviceD0ExitPreInterruptsDisabled callback function (if it exists), and then calls the driver's EvtInterruptDisable callback function (if it exists) for each interrupt so that the driver can disable device interrupts. The framework calls the driver's EvtDeviceD0Exit callback function (if it exists). If the driver is using self-managed I/O, the framework calls the driver's EvtDeviceSelfManagedIoFlush callback function. The framework calls the driver's EvtDeviceReleaseHardware callback function (if it exists), passing it the list of hardware resources that the PnP manager has assigned to the device. If the driver is using self-managed I/O, the framework calls the driver's EvtDeviceSelfManagedIoCleanup callback function. The bus driver is the driver in the stack that is called last. When the framework calls the bus driver's EvtDeviceD0Exit callback function, the callback function sets the power state of the device (a child device of the bus) to D3. Surprise RemovalA user unplugs a device unexpectedly. The bus driver for the device's bus discovers that the device is missing and calls WdfChildListUpdateChildDescriptionAsMissing. For each function and filter driver that supports the device, the framework does the following, in sequence, one driver at a time, starting with the driver that is highest in the driver stack:The framework calls the driver's EvtDeviceSurpriseRemoval callback function (if it exists). If the device was in its working (D0) state when it was unplugged, the framework stops all of the device's power-managed I/O queues. If the device was in its working (D0) state when it was unplugged, and if the driver is using self-managed I/O, the framework calls the driver's EvtDeviceSelfManagedIoSuspend callback function. If the hardware and driver support DMA, the framework calls the driver's EvtDmaEnablerSelfManagedIoStop, EvtDmaEnablerFlush, and EvtDmaEnablerDisable callback functions (if they exist) for each DMA channel that was created. The framework calls the driver's EvtDeviceD0ExitPreInterruptsDisabled and EvtInterruptDisable callback functions (if they exist) so that the driver can disable device interrupts. The framework calls the driver's EvtDeviceD0Exit callback function (if it exists). The framework calls the driver's EvtDeviceReleaseHardware callback function (if it exists), passing the list of hardware resources that the PnP manager has assigned to the device. If the driver is using self-managed I/O, the framework calls the driver's EvtDeviceSelfManagedIoFlush callback function. If the driver is using self-managed I/O, the framework calls the driver's EvtDeviceSelfManagedIoCleanup callback function. © 2007 Microsoft CorporationSend feedback on this topicWindows Driver KitBuilt on August 15, 2007Build machine: CAPEBUILD 肯定不能用代码处理。因为是U盘里的程序发起的,用程序移除的话肯定会提示设备正在使用的。所以只能调用WIN自带的程序 肯定不能用代码处理。因为是U盘里的程序发起的,用程序移除的话肯定会提示设备正在使用的。所以只能调用WIN自带的程序程序在执行这个功能时,把自身复制到临时文件夹下,启动新进程,前一个退出。 急!VC截取从注册表中读出的字符串问题 "ADO" 三中执行方法中哪个 "效率最高" _ConnectionPtr 是哪个类的对象指针类型? 调用htmlhelp函数后,程序退不出来,那位直到是什么原因? 高分求解:表达式计算的源程序(含三角函数) 怎样能把文件放到回收站而不清空呢?怎样取消一次性删除文件? 怎样在DLL安全的弹出一个窗口 做了一个三维浏览软件,希望大家能多多指教 关于专家分 GetQueuedCompletionStatus的返回值很诡异 vc++如何调用excel录制的宏命令 大虾们帮俺看看为啥LeaveCriticalSection没有执行
下面是XP方式安全删除硬件,在WIN7下是失败的。
下面2种方式都成功了,但是我不知道系统调用的那些命令
应该能得到写了哪些注册表和调用了哪些API
应该能得到写了哪些注册表和调用了哪些API
能具体点吗?
我下载了API MONITOR,然后挂载了explorer.exe。接着不知道做什么了。删除U盘点动作,api monitor也没有啥明显的变化指示。
Windows Driver Kit: Kernel-Mode Driver Framework
A User Unplugs a DeviceWhile a system is running, a user can remove a device in one of two ways: by orderly removal, which means that the user informs the system that the device is about to be removed (for example, by using the Unplug or Eject Hardware program); or by surprise removal, which means that the user unplugs the device without informing the system. If the bus supports surprise removal (for example, USB), the device's drivers must be able to handle the device's sudden disappearance.Orderly Removal
The user requests removal by using the system's Unplug or Eject Hardware program, by disabling the device by using Device Manager, or by pushing an ejectable device's eject button. The framework allows the device to be removed or disabled, unless the driver has:Called WdfDeviceSetSpecialFileSupport and a special file is open on the device.
Called WdfDeviceSetStaticStopRemove.
Supplied an EvtDeviceQueryRemove callback function, and the callback function has vetoed the removal. For each function and filter driver that supports the device, the framework does the following, in sequence, one driver at a time, starting with the driver that is highest in the driver stack:If the driver is using self-managed I/O, the framework calls the driver's EvtDeviceSelfManagedIoSuspend callback function.
The framework stops all of the device's power-managed I/O queues.
If the hardware and driver support DMA, the framework calls the driver's EvtDmaEnablerSelfManagedIoStop, EvtDmaEnablerFlush, and EvtDmaEnablerDisable callback functions (if they exist) for each DMA channel that was created.
The framework calls the driver's EvtDeviceD0ExitPreInterruptsDisabled callback function (if it exists), and then calls the driver's EvtInterruptDisable callback function (if it exists) for each interrupt so that the driver can disable device interrupts.
The framework calls the driver's EvtDeviceD0Exit callback function (if it exists).
If the driver is using self-managed I/O, the framework calls the driver's EvtDeviceSelfManagedIoFlush callback function.
The framework calls the driver's EvtDeviceReleaseHardware callback function (if it exists), passing it the list of hardware resources that the PnP manager has assigned to the device.
If the driver is using self-managed I/O, the framework calls the driver's EvtDeviceSelfManagedIoCleanup callback function. The bus driver is the driver in the stack that is called last. When the framework calls the bus driver's EvtDeviceD0Exit callback function, the callback function sets the power state of the device (a child device of the bus) to D3. Surprise Removal
A user unplugs a device unexpectedly. The bus driver for the device's bus discovers that the device is missing and calls WdfChildListUpdateChildDescriptionAsMissing. For each function and filter driver that supports the device, the framework does the following, in sequence, one driver at a time, starting with the driver that is highest in the driver stack:The framework calls the driver's EvtDeviceSurpriseRemoval callback function (if it exists).
If the device was in its working (D0) state when it was unplugged, the framework stops all of the device's power-managed I/O queues.
If the device was in its working (D0) state when it was unplugged, and if the driver is using self-managed I/O, the framework calls the driver's EvtDeviceSelfManagedIoSuspend callback function.
If the hardware and driver support DMA, the framework calls the driver's EvtDmaEnablerSelfManagedIoStop, EvtDmaEnablerFlush, and EvtDmaEnablerDisable callback functions (if they exist) for each DMA channel that was created.
The framework calls the driver's EvtDeviceD0ExitPreInterruptsDisabled and EvtInterruptDisable callback functions (if they exist) so that the driver can disable device interrupts.
The framework calls the driver's EvtDeviceD0Exit callback function (if it exists).
The framework calls the driver's EvtDeviceReleaseHardware callback function (if it exists), passing the list of hardware resources that the PnP manager has assigned to the device.
If the driver is using self-managed I/O, the framework calls the driver's EvtDeviceSelfManagedIoFlush callback function.
If the driver is using self-managed I/O, the framework calls the driver's EvtDeviceSelfManagedIoCleanup callback function. © 2007 Microsoft Corporation
Send feedback on this topic
Windows Driver Kit
Built on August 15, 2007Build machine: CAPEBUILD