2019-9-25-如何让-USB-设备不显示安全删除硬件弹出选项
title | author | date | CreateTime | categories |
---|---|---|---|---|
如何让 USB 设备不显示安全删除硬件弹出选项
|
lindexi
|
2019-09-25 11:58:19 +0800
|
2019-09-25 11:22:23 +0800
|
插入一个 U 盘的时候,可以在右下角找到安全删除硬件图标,点击就可以删除此硬件。如果此时插入的是一个无线网卡,也就是 USB 无线 wifi 设备,此时如果逗比点了弹出 802.11 设备那么就不能再使用无线上网了
如果我是一个硬件供应商,如何让我的设备不会显示弹出安全删除硬件弹出选项
我不是做硬件的,对硬件懂的很少,以下是我找到的文档,如果有说错的,欢迎小伙伴告诉我
从 Using the USB Removable Capability for Device Container Grouping
可以找到这句话
The USB Removable capability allows the operating system to create a device container for legacy devices.
从 Overview of the Removable Device Capability可以知道一个 USB 设备是需要声明自己支持 Removable 的才可以在右下角使用安全删除硬件弹出选项
The removable device capability is a bit (Removable) that bus drivers set in the DEVICE_CAPABILITIES
从 Container IDs Generated from the Removable Device Capability 可以知道,在即插即用功能将会使用到这个功能,在设备插入的时候,通过发送 IRP_MN_QUERY_CAPABILITIES
获取到设备的返回信息,就可以知道这个设备支不支持移除
The Plug and Play manager uses the removable device capability to generate a container ID for all devnodes enumerated for the physical device. The bus driver reports the removable device capability in response to an IRP_MN_QUERY_CAPABILITIES request.
那么上面说的发送信息是什么,就从IRP_MN_QUERY_CAPABILITIES 可以知道,在硬件设备被枚举时,系统的 PnP 也就是即插即用功能将会发送 IRP_MN_QUERY_CAPABILITIES
信息给到硬件,此时硬件收到时将会回复 DEVICE_CAPABILITIES
信息
When a device is enumerated, but before the function and filter drivers are loaded for the device, the PnP manager sends an IRP_MN_QUERY_CAPABILITIES request to the parent bus driver for the device. The bus driver must set any relevant values in the DEVICE_CAPABILITIES structure and return it to the PnP manager.
硬件回复的消息请看 DEVICE_CAPABILITIES (wdm.h) 在 PnP 询问USB设备,此时USB设备返回 DEVICE_CAPABILITIES 里面可以设置 Removable 项说明此设备支持移除。也就是想要自己的 USB 设备不能被移除,那么就声明不支持移除
以下是 DEVICE_CAPABILITIES
定义
typedef struct _DEVICE_CAPABILITIES {
USHORT Size;
USHORT Version;
ULONG DeviceD1 : 1;
ULONG DeviceD2 : 1;
ULONG LockSupported : 1;
ULONG EjectSupported : 1;
ULONG Removable : 1;
// 忽略不相关属性
} DEVICE_CAPABILITIES, *PDEVICE_CAPABILITIES;
对 Removable 属性的官方注释是如果设置为 True 那么将会显示弹出或移除设备
Removable Specifies whether the device can be dynamically removed from its immediate parent. If Removable is set to TRUE, the device does not belong to the same physical object as its parent. For example, if Removable is set to TRUE for a USB composite device inside a multifunction printer, the composite device does not belong to the physical object of its immediate parent, such as a USB hub inside a notebook PC. In most cases the bus driver, not the function driver, should determine the value of the Removable parameter of the device. For USB devices, the USB hub driver sets the Removable parameter. It should not be modified by the function driver. If Removable is set to TRUE, the device is displayed in the Unplug or Eject Hardware program, unless SurpriseRemovalOK is also set to TRUE.
2019-9-25-如何让-USB-设备不显示安全删除硬件弹出选项的更多相关文章
- NVIDIA GeForce GTX 960 设备是不可移动的,无法弹出
系统环境 系统:win7_x64; matlab版本:matlab2017b试用版: GPU:NVIDIA GeForce GTX 960: 问题描述: 第一次使用深度学习实现代码,运行的是matla ...
- USB 设备类协议入门【转】
本文转载自:http://www.cnblogs.com/xidongs/archive/2011/09/26/2191616.html 一.应用场合 USB HID类是比较大的一个类,HID类设备属 ...
- Linux系统下查看USB设备名及使用USB设备
1.系统插入USB设备后,从控制台界面有如下提示: 从控制台信息可以看出插入的USB设备名. 从上图可以看出,插入的USB设备为sde4. 但是,如果是CRT工具远程连接过去,可以使用下面的命令来查看 ...
- (三) 查看USB设备
目录 查看USB设备 lsusb ll /sys/bus/usb/devices cat /sys/kernel/debug/usb/devices dmesg title: 查看USB设备 date ...
- Linux下usb设备驱动详解
USB驱动分为两块,一块是USB的bus驱动,这个东西,Linux内核已经做好了,我们可以不管,我们只需要了解它的功能.形象的说,USB的bus驱动相当于铺出一条路来,让所有的信息都可以通过这条USB ...
- USB设备---URB请求块
1.urb 结构体 USB 请求块(USB request block,urb)是USB 设备驱动中用来描述与USB 设备通信所用的基本载体和核心数据结构,非常类似于网络设备驱动中的sk_buff 结 ...
- windodws pyusb hub端口对应连接的usb设备
源码: 1 #!/usr/bin/python 2 import sys 3 import usb.core 4 # find USB devices 5 dev = usb.core.find(fi ...
- Linux自动共享USB设备:udev+Samba
一.概述 公司最近要我实现USB设备插入Ubuntu后,自动共享到网络上,能像Windows共享一样(如\\192.168.1.10)访问里面的内容,不需要写入权限.当时听完这需求,我这新人表示惊呆了 ...
- USB设备(移动硬盘、鼠标)掉电掉驱动的两种解决方案
症状: 当你发现"移动硬盘图标"经常无故消失,又自己出现时. 你可以把这个现象称之为"掉电" or "掉驱动". 遇到这种情况,相当不爽. ...
- AD域控制器通过组策略禁止USB设备
问题:域环境下如何禁用USB口设备? 第一种:用传统的办法,在Bios中禁用USB. 第二种: 微软技术支持回答:根据您的需求, Windows识别USB设备主要通过两个文件,一个是Usbstor.p ...
随机推荐
- rem 布局代码
根据设计稿的高度,除以相对应的数字 <script type="text/javascript"> // 把尺寸放大N倍(N是window.devicePixelRat ...
- servlet配置url-pattern的匹配规则
<servlet> <servlet-name>hello</servlet-name> <servlet-class>com.qf.servlet.H ...
- MNIST多图显示--Python练习
在学习TensorFlow框架时,提到用MNIST手写数字数据库进行练习,为了更直观看下里面的数据到底长啥样,用OpenCV(cv2)中的imshow函数来进行显示. 默认已经安装: numpy.te ...
- Mysql差集
记录一个去差集的SQL 今天用sql去同步部分历史数据,需要用到一个求差集的sql 两张表简单结构如下: 有一个会员表 一个会员账户表 获取没有账户的会员 SELECT m.pkMember FROM ...
- centos7 实测 nagios 安装
Nagios是一套开源的监控系统,可监控你的系统和网络.Nagios最新版本是Nagios Core 4.3.4,Nagios plugins 2.2.1.目前支持RHEL 7.x/6.x/5.x, ...
- SpringBoot - @ControllerAdvice 处理异常
在Spring 3.2中,新增了@ControllerAdvice.@RestControllerAdvice 注解,可以用于定义@ExceptionHandler.@InitBinder.@Mode ...
- sql 修改数据
关系数据库的基本操作就是增删改查,即CRUD:Create.Retrieve.Update.Delete.其中,对于查询,我们已经详细讲述了SELECT语句的详细用法. 而对于增.删.改,对应的SQL ...
- kubernetes(k8s)Pod污点与容忍
污点(taints)与容忍(tolerations) 对于nodeAffinity无论是硬策略还是软策略方式,都是调度 pod 到预期节点上,而Taints恰好与之相反,如果一个节点标记为 Taint ...
- A*寻路算法C++简单实现
搜索区域 如图所示简易地图, 其中绿色方块的是起点 (用 A 表示), 中间蓝色的是障碍物, 红色的方块 (用 B 表示) 是目的地. 为了可以用一个二维数组来表示地图, 我们将地图划分成一个个 ...
- (转)OpenFire源码学习之十八:IOS离线推送
转:http://blog.csdn.net/huwenfeng_2011/article/details/43458213 IOS离线推送 场景: 如果您有iOS端的APP,在会话聊天的时候,用户登 ...