lay Extensions fo.docx
《lay Extensions fo.docx》由会员分享,可在线阅读,更多相关《lay Extensions fo.docx(39页珍藏版)》请在冰豆网上搜索。
layExtensionsfo
AWINDOWS®RALLY™SPECIFICATION
PnPX:
PlugandPlayExtensionsfor Windows
August30,2010
Abstract
ThisspecificationdescribesthePlugandPlayExtensions(PnPX)fortheWindows Vista™andMicrosoft®WindowsServer™CodeName“Longhorn”operatingsystems.ItprovidesrequirementsandguidelinesforhardwaremanufacturerstocreatedevicesthatareinstallablewithPnPX.
PnPXisakeycomponentoftheMicrosoftWindows®Rally™setoftechnologies.
ThecurrentversionofthispaperismaintainedontheWebat:
Disclaimer:
Thisdocumentisprovided“as-is”.Informationandviewsexpressedinthisdocument,includingURLandotherInternetWebsitereferences,maychangewithoutnotice.Youbeartheriskofusingit.
ThisdocumentdoesnotprovideyouwithanylegalrightstoanyintellectualpropertyinanyMicrosoftproduct.Youmaycopyandusethisdocumentforyourinternal,referencepurposes.
©2010MicrosoftCorporation.Allrightsreserved.
Contents
IntroductiontoPnPX3
PnPXServices3
DefaultStartupTypeforPnPXServices4
Windows Vista4
WindowsServer4
NetworkExplorerDeviceDiscoveryandPnP-X4
WindowsVista4
WindowsServer4
WSDDeviceInstallationProcess4
UsingPnPX5
CreatingaPnPXDevice5
CreatingaWSD-CompliantDevice6
WSDDeviceMetadataRequirements6
SampleINFFileforWSDDevices8
SampleMetadataMessageforWSDDevices10
CreatingaSSDP-CompliantDevice11
SSDPDeviceMetadataRequirements12
SampleSSDPDiscoveryResponseMessage14
SampleINFFileforSSDPDevices14
SampleDeviceDescriptionFileforSSDPDevices16
QueryingDeviceMetadata17
PnPXReference18
PnPXCategoryDefinitions18
pnpx-ssdpSchemaReference20
pnpx-ssdpSchemaElements20
X_compatibleId(X_PnpXType)Element20
X_deviceCategory(X_PnpXType)Element20
X_hardwareId(X_PnpXType)Element21
X_PnpXElement21
pnpx-ssdpSchemaComplexTypes21
X_PnpXTypeComplexType22
pnpx-wsdSchemaReference22
pnpx-wsdSchemaElements23
CompatibleIdElement23
DeviceCategoryElement23
HardwareIdElement24
pnpx-wsdSchemaSimpleTypes24
CompatibleIdTypeSimpleType24
DeviceCategoryTypeSimpleType24
HardwareIdTypeSimpleType25
References25
IntroductiontoPnPX
ThisguideprovidesinformationaboutthePlugandPlayExtensions(PnPX)componentoftheMicrosoft®Windows®Rally™setoftechnologies.ThisdocumentprovidesguidelinesforcreatingdevicesthatareinstallablewithPnPXforWindows Vista™.
PnPXisanextensionofPlugandPlay(PnP)inWindows Vistathatintegratesnetwork-connecteddevicesintotheWindowsPnPsubsystem.PnPXallowsnetwork-connecteddevicestoappearasdevicesinsideWindowsandprovidesaninstallationexperiencethatissimilartoattachingaphysicallyconnecteddevice.
JustasPnPinWindowsoperatesoveraspecificsetofbuses,PnPXinWindows Vistahasbeendefinedtooperateovernetworkprotocolsforvirtuallyconnecteddevices.Thisincludes:
∙UniversalPlugandPlay(UPnP)–capabledevices
∙DeviceProfileforWebServices(DPWS))–capabledevices(see
FormoreinformationaboutWindowsRallytechnologiesandotherresourcesdiscussedhere,see
PnPXdiscoversdevicesattachedtoavirtualPnPXnetworkbus.TheIPbusenumeratorisusedtodiscoverPnPXdevices.ThisenumeratordiscoversDPWS-capabledevicesandUPnPdevicesconnectedtoaLAN.
DevicediscoverytakesplacewhenNetworkExplorerislaunched.Theusermustexplicitlychoosetoinstallthedevice.TheFoundNewHardwareWizardappearsifuserinterventionisrequiredtoinstalladevicedriver.
DevicesappearinDeviceManagerafterdiscoveryandinstallation.ThedevicescanthenbeenumeratedforusebyotherWindowsapplicationsbycallingtheFunctionDiscoveryAPItoquerythePnPsubsystem.Eachdeviceisassociatedwithafunctioninstance.ThesefunctioninstancescanbequeriedbyusingtheIFunctionDiscovery:
:
CreateInstanceQueryandtheIFunctionDiscovery:
:
CreateInstanceCollectionQuerymethods.
SeealsoontheMSDNWebsite:
∙FunctionDiscovery
PnPXServices
PnPXusestwoservicestoenabledevicediscovery:
PnPinstallationanddevicepresencemanagement.Theseservicesarethefollowing:
∙IPBusEnumerator.TheIPBusEnumerator(IPBusEnum)isaWindowsservicethathandlestheinstallationofPnPXdevices.
IPBusEnummonitorsalistofdevicescurrentlypresentonthesystem.Whenadeviceisinstalled,IPBusEnumsendsarequesttothePnPcomponenttocreatethedevicedevnode.Whenadeviceisremoved,IPBusEnumreceivesanotificationmessagefromthePnPcomponentandthensendsarequesttoremovethedevicefromthelistofpresentdevices.
PnPXdevicescanbeinstalledonlywhentheIPBusEnumserviceisrunning.
∙FunctionDiscoveryProviderHost.TheFunctionDiscoveryProviderHost(FDPHost)servicehoststhediscoveryprovidersforPnPX.Thisincludesthebuilt-indiscoveryprovidersfortheSimpleServicesDiscoveryProtocol(SSDP)andWebServicesonDevices(WSD)WSDiscoveryprotocol.
DefaultStartupTypeforPnPXServices
ThedefaultstarttypeforthePnPXservicesdiffersfortheWindowsclientandserveroperatingsystems.
Windows Vista
TheIPBusEnumandFDPHostservicesaresettoManualstartontheWindows Vistaclientoperatingsystems.Theseserviceswillstartandstopautomaticallyastheoperatingsystemneedsthem.
WindowsServer
TheIPBusEnumserviceissettoDisabledontheMicrosoftWindowsServer®operatingsystems.ServeradministratorswantingtoenablePnPXonWindowsServermuststarttheIPBusEnumservice.ThiscanbedonethroughtheServicescontrolpanelapplicationoronthecommandlineviathefollowing:
C:
\>netstartIPBusEnum
TheFDPHostserviceissettoManualstartontheWindowsServeroperatingsystems.Thisservicestartsandstopsautomaticallyastheoperatingsystemneedsit.
NetworkExplorerDeviceDiscoveryandPnP-X
NetworkExplorerdisplaysthelistofdiscovereddevicestotheuser.WhichdevicesarediscoveredbydefaultdiffersbasedonwhethertheoperatingsystemisWindowsVistaorWindowsServer.
WindowsVista
InWindowsVista,bothWSD-andUPnP-basedPnP-XdevicesarediscoveredanddisplayedinNetworkExplorer.
WindowsServer
InWindowsServer,onlyWSD-basedPnP-XdevicesarediscoveredanddisplayedinNetworkExplorer.TheUPnPdiscoveryservice(SSDPSrv)doesnotrunbydefaultinWindowsServer.ServeradministratorswantingtoenablediscoveryofUPnP-basedPnP-XdevicesmuststarttheSSDPSrvservice.ThiscanbedonethroughtheControlPanelServicesapplicationoronthecommandlineviathefollowing:
C:
\>netstartSSDPSrv
WSDDeviceInstallationProcess
ThefollowingproceduredescribestheWSDdeviceinstallationprocess:
1.TheuserlaunchestheNetworkExplorer.
2.TheNetworkExplorerqueriestheWSDProvider(andotherproviders)foralistofdevicesanddisplaysthedevicestotheuser.
3.Theuserchoosestoinstallthedevice.
4.TheIPBusEnumserviceisnotifiedofthenewdeviceinstallationrequestandqueriestheWSDProviderfordevicemetadata.
5.TheWSDProviderqueriesthedeviceformetadata.
6.ThedevicesendsametadatamessagetotheWSDProviderinresponse.
7.TheWSDProviderparsesthemetadatamessageandreturnstheresultstoIPBusEnum.
8.Basedonthemetadata,IPBusEnumcreatesaphysicaldeviceobject(PDO)forthedeviceandpassesthePDOtothePnPcomponent.
9.PnPsearchesfortheINFfileassociatedwiththedevice.
10.BasedonthedataintheINFfile,PnPattemptstoselectacompatibledevicedriver.
11.Ifacompatibledevicedriverisavailableonthesystem,thedriverisloadedandthedeviceisinstalled.Otherwise,theFoundNewHardwareWizardappearsandtheusermustlocateandinstallthedrivermanually.
Seealsointhisdocument:
∙CreatingaWSD-CompliantDevice
UsingPnPX
Independenthardwarevendors(IHVs)cancreatedevicesthatarecompatiblewiththePnPXarchitecture.
ApplicationdeveloperscanqueryPnPXdevicemetadatabyusingtheFunctionDiscoveryAPI.Formoreinformation,see“QueryingDeviceMetadata”laterinthissection
CreatingaPnPXDevice
APnPXdeviceisadevicethatcanbediscoveredbyoneofthefollowingFunctionDiscoveryproviders:
∙TheWSDProvider
∙TheSSDPProvider
∙AcustomproviderdevelopedtodiscoverthePnPXdevice
Inmostcases,thebuilt-inWSDandSSDPproviderscanbeusedfordevicediscovery,whichsimplifiesdevelopment.Ifthedevicecommunicatesbyusingacustomprotocol,thenacustomproviderisrequired.Formoreinformationaboutwritingacustomprovider,see“FunctionDiscoveryProviders”atMSDN().
TheWebServicesprotocolofferstwoadvantages.First,theWSDprovidercandiscoverdevicesonmultiplesubnets.Second,theWSdevicedescriptiondocumenthasmoreelementsforamoredetaileddevicedescription.
CreatingaWSD-CompliantDevice
Devicemanufacturersmustimplementthefollowing,inadditiontobasedevicefunctionality:
∙DeviceProfileforWebServices(DPWS)support.ToviewtheDPWSspecification,see
∙pnpx-wsdschemasupport.Specifically,thedevicemustreadmetadatafromaSOAPmessagecontainingpnpx-wsdschemaelementsandcreateasetofhardwareIDsandcompatibleIDsfromtheXML.
ThedevicemustsendSOAPmessagescontainingdevicemetadata.Therequiredelementsaredescribedin“WSDDeviceMetadataRequirements”inthisdocument.ThisfileincludesbothWSDandpnpx-wsdschemaelements.ThedevicemustimplementallWSDmessagesasdescribedintheDPWSspecification.Thesemessagesarerequiredford