humanxd
驱动牛犊
驱动牛犊
  • 注册日期2002-08-23
  • 最后登录2002-12-03
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:5845回复:14

那位大侠知道如何获得U盘的vid 和pid!急!!告诉正确,一定给分!

楼主#
更多 发布于:2002-11-22 17:20
我现在有个u盘,我找到一个应用程序,向u盘发数据,但是我现在不知道u盘的vid和pid!!

如果能知道这两个参数,我的应用程序就能跑起来啦!
zsw79923
驱动牛犊
驱动牛犊
  • 注册日期2002-11-15
  • 最后登录2009-11-05
  • 粉丝1
  • 关注1
  • 积分2分
  • 威望25点
  • 贡献值0点
  • 好评度5点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2002-11-22 17:24
Changing your VID/PID in Windows
Introduction
To comply with the USB Mass Storage Bulk Only Transport (BOT) specification, vendors must have their own Vendor ID (VID), which is assigned by the USB Implementers Forum (USB-IF). Once you receive your own VID from the USB-IF (www.usb.org) and determine your own PID (Product ID), you will need to incorporate them into your product. To use the Cypress driver for your product, some minor modifications will be necessary to one of the driver files.
Background
For a mass storage device to function over USB one of the requirements is a device driver. Microsoft Windows ME, Windows 2000 and XP all have a Mass Storage Compliant driver included in the operating system and do not require the use of the Cypress driver. Windows 98SE on the other hand does not have a built in driver and so a driver must be supplied. The Cypress driver can be used on Window ME, 2000 and XP instead of the Microsoft driver, if desired.
The Cypress Windows driver now supports the range of Cypress storage solutions, including: ISD200, ISD300A1, EZ-USB FX2, EZ-USB FX, SL11R, and SL11RIDE. For the device to function properly, the VID/PID must be programmed into an EEPROM, or supplied to the USB chip in another appropriate fashion for the given chip. The programming of the EEPROM is beyond the scope of this document and is explained in other documents supporting each of our chips. During enumeration the USB device will report back to the operating system that it is a Mass Storage Compliant device and will return the VID/PID that is programmed into the EEPROM. From this information the OS will search through the Windows\\inf directory for the VID/PID combination. If it finds a match, the .inf file will tell the OS which driver to use when communicating with this device. If it does not find a match, it will use the Microsoft Mass Storage Class driver, commonly referred to as the MSC. Windows 98SE does not have a MSC driver and requires the Cypress driver. This document is intended to aid you in making the modifications necessary for the operating system to recognize your VID/PID and use the Cypress driver instead of the MSC driver.
Getting Started
Download plug and play driver: The first step in getting the OS to load the Cypress driver is to download the Cypress plug and play driver from the Support section of the Cypress web site, www.cypress.com. The file you will download is in a ZIP format and will have a naming convention such as CY_Win_x_xx_REL.zip where x_xx denotes the revision of the driver. Using a program such as WinZip?, extract the files into a directory of your choice.
Modify the correct .inf file:
1) Browse to the directory where the plug and play files were extracted using My Computer or File Explorer. In this directory you will find several files with a .inf extension. If you do not see any file extensions you may need to modify the options of My Computer or File Explorer to disable the option “Hide file extensions for known file types”. In this example we will explain how to modify the file tpp300.inf, which is the .inf file for the ISD300A1 device. Other .inf files are modified in the same fashion. See the Release Notes for which .inf files are used by which Cypress chips.
Cypress Semiconductor Corporation • 3901 North First Street • San Jose • CA 95134 • 408-943-2600 January 31, 2002
Changing your VID/PID in Windows
2) Open the file tpp300.inf with a text editor such as notepad. In this file you will find several sections separated with [section name]. For example the very first section is labeled [Version]. In this discussion you will only need to be concerned with a few key fields.
a. In the Version section you will see a line that looks like this:
Provider=%CY%
You will want to change this to your company’s name instead of Cypress’. In this example we will create a new company named TEST. For our company TEST, we would modify the Provider line to:
Provider=%TEST%
b. The next section that will need to be modified is labeled [Manufacturer]
Here you will need to define the Manufacturer to be your company. You can delete all other manufacturers in this area. For Cypress we have used the following : %CYMFG%=CY
For our new company named TEST, we would use:
%TESTMFG%=TEST
c. Next you must add your VID and PID under a label you will create. For Cypress the label is CY. You can eliminate all other manufacturers VIDs and PIDs from this area since you are only concerned with yours. The following is an example of what the lines look like for Cypress:
[CY]
%VID_05AB&PID_0060%=TPP300, USB\\VID_05AB&PID_0060
For our new company we will pretend USB-IF gave us a hexadecimal VID of 1234 and we will choose a hexadecimal PID of 0001 for our product. If this were true our section would look like the following:
[TEST]
%VID_1234&PID_0001%=TPP300, USB\\VID_1234&PID_0001
d. The last step is to modify the strings that are defined in the .inf file. The strings are identified by the label [strings] and are at the end of the .inf file. This is the string that will be displayed when the driver is loaded and in the Device Manager. Once again you can delete all other manufactures in this area. You may choose to delete all manufactures except Cypress’, copy it and modify it. The following is an example of the string for Cypress:
[Strings]
CY=”Cypress”
TEST=”TEST”
CYMFG=\"Cypress\"
VID_05AB&PID_0060 = \"USB Storage Adapter V3 (TPP)\"
Again for our new company we could use the following example:
TESTMFG=”TEST”
VID_1234&PID_0001 = “TEST USB 2.0 Storage”
3) Save the file. A sample .inf file is included in Appendix A of this document. Note that the modified lines are highlighted in yellow.
2
Changing your VID/PID in Windows Use the Cypress driver
You are now ready to use they Cypress driver. The procedure for this will vary slightly depending on the operating system you are using. If you are running Windows 98 SE?, a Mass Storage Class driver is not included in the operating system and so the Cypress driver is required. These steps assume a USB 2.0 host controller is already installed and functional in your computer system. The following pictures are taken from a Windows 2000? system unless otherwise stated and will vary slightly with the various operating systems and with the user configuration.
A) Uninstall any previous installations of the driver:
If you have previously installed the Cypress or In-System Design driver using TPPINST.exe, you should first uninstall the driver. If your system does not already have a copy of the Cypress driver continue on step
一片云
rayyang2000
管理员
管理员
  • 注册日期2001-03-23
  • 最后登录2012-09-13
  • 粉丝3
  • 关注0
  • 积分1036分
  • 威望925点
  • 贡献值3点
  • 好评度823点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2002-11-23 21:28
用usbview去看!
天天coding-debugging中----超稀饭memory dump file ======================================================== [b]Windows Device Driver Development and Consulting Service[/b] [color=blue][url]http://www.ybwork.com[/url][/color] ========================================================
chenfg111
驱动牛犊
驱动牛犊
  • 注册日期2002-08-18
  • 最后登录2012-03-29
  • 粉丝0
  • 关注0
  • 积分1分
  • 威望10点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
地板#
发布于:2002-11-23 22:19
用WinDriver\'DriverWizard可看
poplar
驱动牛犊
驱动牛犊
  • 注册日期2001-05-04
  • 最后登录2007-01-08
  • 粉丝0
  • 关注0
  • 积分20分
  • 威望2点
  • 贡献值0点
  • 好评度2点
  • 原创分0分
  • 专家分0分
地下室#
发布于:2002-11-24 18:51
到www.usb.org上去下载个USBVIEW,
也可在那里申请个VID.
大巧不工,重剑无锋.
humanxd
驱动牛犊
驱动牛犊
  • 注册日期2002-08-23
  • 最后登录2002-12-03
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
5楼#
发布于:2002-11-25 10:23
用usbview去看!

在USB.org上没有USBVIEW啊,有USBcrv01.msi,usbhset.exe,usbhtt.msi
哪一个是usbview 啊!
humanxd
驱动牛犊
驱动牛犊
  • 注册日期2002-08-23
  • 最后登录2002-12-03
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
6楼#
发布于:2002-11-25 14:33
用usbview去看!

先谢过版主!在usb.org上没有找到的USBVIEW,但是我下载了一个USBCVr01.msi,就是以前的usbcheck.exe,
(1)这个应该是您说的usbview吧!
(2)呵呵,我运行那个USBCVr01.msi 时,没有任何显示,但是,确有一个usb应用程序的进程! 不知道什么原因!

因此我现在还是没有得到我的u盘的pid和vid!

请大家帮帮忙!
rayyang2000
管理员
管理员
  • 注册日期2001-03-23
  • 最后登录2012-09-13
  • 粉丝3
  • 关注0
  • 积分1036分
  • 威望925点
  • 贡献值3点
  • 好评度823点
  • 原创分0分
  • 专家分0分
7楼#
发布于:2002-11-25 14:51
DDK里面有usbview
天天coding-debugging中----超稀饭memory dump file ======================================================== [b]Windows Device Driver Development and Consulting Service[/b] [color=blue][url]http://www.ybwork.com[/url][/color] ========================================================
humanxd
驱动牛犊
驱动牛犊
  • 注册日期2002-08-23
  • 最后登录2002-12-03
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
8楼#
发布于:2002-11-26 10:56
DDK里面有usbview


非常感谢斑竹,这几天我的问题您都耐心的回答了,我没有白来这个论坛啊!

我在windows 2000ddk 中找到了usbview的源代码,但是在编译的时候提示devioctl.h 文件不存在,呵呵,这条路我又走不通了,呜呜!请斑竹和高人指点!
bigboy
驱动牛犊
驱动牛犊
  • 注册日期2002-07-29
  • 最后登录2002-12-01
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
9楼#
发布于:2002-11-26 11:10
我给你一个devioctl.h吧
附件名称/大小 下载次数 最后更新
2002-11-26_devioctl.h (5KB)  8
humanxd
驱动牛犊
驱动牛犊
  • 注册日期2002-08-23
  • 最后登录2002-12-03
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
10楼#
发布于:2002-11-26 11:14
我给你一个devioctl.h吧


谢谢啦!
lyg
lyg
驱动牛犊
驱动牛犊
  • 注册日期2001-04-02
  • 最后登录2007-08-21
  • 粉丝0
  • 关注0
  • 积分12分
  • 威望2点
  • 贡献值0点
  • 好评度1点
  • 原创分0分
  • 专家分0分
11楼#
发布于:2002-11-26 16:47
可以通过注册表来找到驱动器所对应的VID 和 PID。

在Win2000中,Winxp,
hklm\\controlset\\enum\\mountdevice\\
找到指定的盘符,然后得到驱动器的设备实例。
最后紧紧用3个函数
cr = CM_Locate_DevNode(&DevChild,pstring,CM_LOCATE_DEVNODE_NORMAL);

//下面两个函数需要循环调用。
cr = CM_Get_Parent(&DevParent, DevChild, 0);
cr = CM_Get_Device_ID(DevParent,Buf,255,0);

在系统中,设备是挂在一个树上的。可以顺着子节点找到
父节点的。
需要库函数 cfgmgr32.h,cfgmgr32.lib
路径为 ntddk\\


希望以上代码对你有帮助。
humanxd
驱动牛犊
驱动牛犊
  • 注册日期2002-08-23
  • 最后登录2002-12-03
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
12楼#
发布于:2002-11-26 17:06
可以通过注册表来找到驱动器所对应的VID 和 PID。

在Win2000中,Winxp,
hklm\\controlset\\enum\\mountdevice\\
找到指定的盘符,然后得到驱动器的设备实例。
最后紧紧用3个函数
cr = CM_Locate_DevNode(&DevChild,pstring,CM_LOCATE_DEVNODE_NORMAL);

//下面两个函数需要循环调用。
cr = CM_Get_Parent(&DevParent, DevChild, 0);
cr = CM_Get_Device_ID(DevParent,Buf,255,0);

在系统中,设备是挂在一个树上的。可以顺着子节点找到
父节点的。
需要库函数 cfgmgr32.h,cfgmgr32.lib
路径为 ntddk\\


希望以上代码对你有帮助。
 


非常感谢你的帮助,我现在通过斑竹的USBcomp找到了我的u盘的pid和vid,谢谢!我将来可以用到的!
humanxd
驱动牛犊
驱动牛犊
  • 注册日期2002-08-23
  • 最后登录2002-12-03
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
13楼#
发布于:2002-11-28 10:28
非常感谢各位网友,我终于通过斑竹给的USBcomp工具得到了我的u盘的pid和vid,非常感谢斑竹,同事对各位热心网友深表感谢!
飞天猩猩
驱动巨牛
驱动巨牛
  • 注册日期2001-09-24
  • 最后登录2008-06-17
  • 粉丝0
  • 关注0
  • 积分201分
  • 威望22点
  • 贡献值0点
  • 好评度21点
  • 原创分0分
  • 专家分0分
14楼#
发布于:2002-11-28 11:46
感谢?还是放分实际点。
游客

返回顶部