Programming 版 (精华区)
发信人: zpw (zhao), 信区: Programming
标 题: FAQ FOR VXD(十五)
发信站: 紫 丁 香 (Tue Jul 28 14:23:56 1998), 转信
Give me an overview of Plug and Play
If you write a VxD for a device in Win95, you must provide a Device
Information file (.INF) that tells Win95 how to install the VxD and how
to configure the device. Information about INF files can be found in the
Win95 DDK.
If you're writing a Win95 VxD for a PCI, PCMCIA or PNPISA device, you
should also add Plug and Play support to your VxD. All that means is that
your VxD uses Configuration Manager (a VxD) services to find out which
system resources (I/O addr, IRQ, etc.) have been assigned to the device,
as opposed to obtaining this info from an INI file or hardcoding it.
To add this required Plug and Play functionality, your VxD must handle the
PNP_New_DevNode message sent by the Config Mgr. In response to this
message, you should register yourself as the device driver by calling
CM_RegisterDeviceDriver. When calling this function, you pass the CM a
callback function. The CM will call you back later when your resources have
been assigned, passing you a function code. When your callback function is
called with the CONFIG_START function code, call the function
CM_GetAllocLogConf to find out which resources have been assigned to your
device. This call fills in a CM_CONFIG structure, which has a field for
I/O address, IRQ, etc.
Some types of VxDs, including SCSI MiniPort Drivers, Network Drivers and
VCOMM Port Drivers, may need to use a different method of obtaining config
info. These types are different because in each case another VxD is acting
as Device Loader, and it's the Device Loader that actually interacts with
the CM, not the driver VxD. These drivers may need to use configuration
services provided by the Device Loader (IOS, Ndis wrapper or VCOMM)
instead of interacting with the CM directly.
The Configuration Manager will never send your VxD a PNP_New_DevNode
message until the appropriate registry entries are made. The best way to
get the registry entries is not by hand, but with an INF file. Win95 will
prompt you for an INF file the first time it sees your device. For
PCI,PCMCIA and ISAPNP devices, this should automatically happen the first
time you physically install the device. For other devices, you may have to
run the Add New Hardware wizard from the Device Manager application. Win95
will use the INF file you supply to make registry entries. INF files are
documented in the Win95 DDK.
--
※ 来源:.紫 丁 香 bbs.hit.edu.cn.[FROM: yaoyu.hit.edu.cn]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:5.440毫秒