### SetupDiBuildClassInfoListEx Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/install/using-device-installation-functions.md Returns a list of setup class GUIDs that includes every class installed on the local system or a remote system. ```APIDOC ## SetupDiBuildClassInfoListEx ### Description Returns a list of setup class GUIDs that includes every class installed on the local system or a remote system. ### Method Not specified (likely a function call in C/C++) ### Endpoint N/A (This is a function, not an API endpoint) ### Parameters (Parameters not detailed in the provided text) ### Request Example (Not applicable for this function) ### Response (Response details not detailed in the provided text) ``` -------------------------------- ### SetupDiBuildClassInfoList Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/install/using-device-installation-functions.md Returns a list of setup class GUIDs that includes every class installed on the system. ```APIDOC ## SetupDiBuildClassInfoList ### Description Returns a list of setup class GUIDs that includes every class installed on the system. ### Method Not specified (likely a function call in C/C++) ### Endpoint N/A (This is a function, not an API endpoint) ### Parameters (Parameters not detailed in the provided text) ### Request Example (Not applicable for this function) ### Response (Response details not detailed in the provided text) ``` -------------------------------- ### Install WDTF Runtime with Custom Options Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/wdtf/wdtf-runtime-library.md Example of installing the WDTF runtime with logging enabled, a custom installation directory, and machine configuration skipping. ```cmd msiexec /i "OneCoreUap_WDTF_Desktop_Kit_Content-x64_en-us.msi" /l* OneCoreUap_WDTFInstall.log WDTFDir=c:\wdtf WDTF_SKIP_MACHINE_CONFIG=1 msiexec /i "WDTF_Desktop_Kit_Product-x64_en-us.msi" /l* WDTFInstall.log WDTFDir=c:\wdtf WDTF_SKIP_MACHINE_CONFIG=1 ``` -------------------------------- ### Implement INF DDInstall.Software Example Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/install/inf-ddinstall-software-section.md Example showing a DDInstall.Software section referencing a software installation section. ```inf [ContosoCtrlPnl.NT.Software] AddSoftware = ContosoGrfx1CtrlPnl,, Software_Inst [Software_Inst] SoftwareType = 1 SoftwareBinary = %13%\ContosoCtrlPnl.exe SoftwareArguments = <> SoftwareVersion = 1.0.0.0 ``` -------------------------------- ### Remote Server Usage Examples Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/debugger/remote-server-syntax.md Common command line examples for starting remote sessions with various configurations. ```console remote /s "i386kd -v" TestSession remote /s "cmd" "My Remote Session" /f white /b black /u Server01\Administrators remote /s "ntsd -d -g -x" DebugIt /-v remote /q Server01 ``` -------------------------------- ### Example Usage of DDInstall.Software Section Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/install/inf-ddinstall-software-section.md This example demonstrates how to use the DDInstall.Software section with an AddSoftware directive to install a software component. ```APIDOC ## Example ```inf [ContosoCtrlPnl.NT.Software] AddSoftware = ContosoGrfx1CtrlPnl,, Software_Inst [Software_Inst] SoftwareType = 1 SoftwareBinary = %13%\ContosoCtrlPnl.exe SoftwareArguments = <> SoftwareVersion = 1.0.0.0 ``` ``` -------------------------------- ### DevCon Install Sample Usage Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/devtest/devcon-install.md Examples demonstrating how to use the DevCon Install command to install a device, with and without the conditional reboot parameter. ```console devcon install c:\windows\inf\newdvc.inf ISAPNP\CSC4324\0 ``` ```console devcon /r install c:\windows\inf\newdvc.inf ISAPNP\CSC4324\0 ``` -------------------------------- ### Install Service Section Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/network/configuring-an-inf-file-for-a-monitoring-filter-driver.md Configure the service installation parameters including display name, start type, and binary path. ```INF [Install.Services] AddService=NdisMon,,NdisMon_Service_Inst [NdisMon_Service_Inst] DisplayName = %NdisMon_Desc% ServiceType = 1 ;SERVICE_KERNEL_DRIVER StartType = 1 ;SERVICE_SYSTEM_START ErrorControl = 1 ;SERVICE_ERROR_NORMAL ServiceBinary = %13%\ndisMon.sys LoadOrderGroup = NDIS Description = %NdisMon_Desc% AddReg = Common.Params.Reg ``` -------------------------------- ### Example Install.cmd Parameter Usage Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/debugger/symproxy-automated-installation.md This example demonstrates how to run the Install.cmd script with the required parameters: virtual directory path, username, and password. ```console Install.cmd D:\SymStore\Symbols CONTOSO\SymProxyService Pa$$word ``` -------------------------------- ### Example of SetupAPI log entries Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/install/format-of-log-entries-that-are-not-part-of-a-text-log-section.md Demonstrates log entries appearing before a section header in a device installation text log. ```cpp . ump: Start service install for: PCI\VEN_104C&DEV_8019&SUBSYS_8010104C&REV_00\3&61aaa01&0&38 . ump: Creating Install Process: rundll32.exe >>> [Device Install - PCI\VEN_104C&DEV_8019&SUBSYS_8010104C&REV_00\3&61aaa01&0&38] >>> 2005/02/13 22:06:28.109: Section start ``` -------------------------------- ### Define INF AddProperty Directive Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/install/using-the-inf-addproperty-directive-and-the-inf-delproperty-directive.md Example showing the installation section referencing an add-property-section and the subsequent property definitions using both name and GUID formats. ```ini [Root_Install.NT] AddProperty=Root_AddProperty [Root_AddProperty] DeviceModel,,,,"Sample Device Model Name" {c22189e4-8bf3-4e6d-8467-8dc6d95e2a7e}, 2, 18,, "String value for property 1" ``` -------------------------------- ### Example URL with Parameters Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/install/devpkey-drvpkg-documentationlink.md A sample URL demonstrating how to include product, revision, and type parameters. ```cpp http://www.microsoft.com/redirect?prod=DSC530&rev=34&type=docs ``` -------------------------------- ### Network INF DDInstall.Services Section Example Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/network/ddinstall-services-section-in-a-network-inf-file.md This example demonstrates a DDInstall.Services section, a service-install-section, an error-log-install-section, and an add-registry-section for configuring a network adapter service. ```cpp [a1.ndi.NT.Services] AddService = a1, 2, a1.AddService, a1.AddEventLog ``` ```cpp [a1.AddService] DisplayName = %Adapter1.DispName% ServiceType = 1 ;SERVICE_KERNEL_DRIVER StartType = 2 ;SERVICE_AUTO_START ErrorControl = 1 ;SERVICE_ERROR_NORMAL ServiceBinary = %13%\a1.sys LoadOrderGroup = NDIS ``` ```cpp [a1.AddEventLog] AddReg = a1.AddEventLog.reg ``` ```cpp [a1.AddEventLog.reg] HKR,,EventMessageFile,0x00020000,"%%SystemRoot%%\System32\netevent.dll" HKR,,TypesSupported,0x00010001,7 ``` -------------------------------- ### Example: AddAutoLoggerProvider Directive Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/install/inf-addupdateautologger-directive.md Demonstrates how to use the AddAutoLoggerProvider directive within an add-autologger-install-section to specify a provider and its configuration. The provider GUID and its corresponding installation section are referenced. ```inf [Contoso_Add_AutoLogger_Inst] Start = 1 FileName = %%DriverData%% Contoso\AutoLoggerLogFile.etl AddAutoLoggerProvider = {4b8b1947-ae4d-54e2-826a-1aee78ef05b2}, Contoso_Provider_1_Inst ``` ```inf [Contoso_Update_AutoLogger_Inst] AddAutoLoggerProvider= {a55d5a23-1a5b-580a-2be5-d7188f43fae1}, Contoso_Provider_2_Inst ``` -------------------------------- ### Example of a SetupAPI Device Installation Log Section Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/install/format-of-a-text-log-section-body.md Displays a typical sequence of log entries including entry prefixes, event categories, and indentation within a device installation section. ```console >>> [Device Install - PCI\VEN_104C&DEV_8019&SUBSYS_8010104C&REV_00\3&61aaa01&0&38] >>> 2005/02/13 22:06:28.109: Section start ... Additional section body log entries ... dvi: {Build Driver List} dvi: Enumerating all INFs... dvi: Found driver match: dvi: HardwareID - PCI\VEN_104C&DEV_8019 dvi: InfName - C:\WINDOWS\inf\1394.inf dvi: DevDesc - Texas Instruments OHCI Compliant IEEE 1394 Host Controller dvi: DrvDesc - Texas Instruments OHCI Compliant IEEE 1394 Host Controller dvi: Provider - Microsoft dvi: Mfg - Texas Instruments dvi: InstallSec - TIOHCI_Install dvi: ActualSec - TIOHCI_Install.NT dvi: Rank - 0x00002001 dvi: DrvDate - 10/01/2002 ``` -------------------------------- ### Example Driver Service Installation Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/display/driver-services-start-type-directive.md This section defines the service installation parameters for a display driver, including its type, start mode, error control, load order group, and binary file. Ensure StartType is set to 3 for demand-starting WDDM drivers. ```inf ; Service Installation Section ; [R200_Service_Inst] ServiceType = 1 ; SERVICE_KERNEL_DRIVER StartType = 3 ; SERVICE_DEMAND_START ErrorControl = 0 ; SERVICE_ERROR_IGNORE LoadOrderGroup = Video ServiceBinary = %12%\r200.sys ``` -------------------------------- ### Install and start Te.Service Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/taef/te-service.md Commands to install and start the Te.Service from an elevated command prompt. ```batch cd [your Wex.Services.exe directory] Wex.Services.exe /install:Te.Service sc start Te.Service ``` -------------------------------- ### List device setup classes with output redirection Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/devtest/devcon-classes.md Demonstrates listing classes and redirecting the output to a text file. ```console devcon classes devcon classes > setupclasses.txt ``` -------------------------------- ### DMFT Installation INF Example Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/stream/360-camera-video-capture.md This INF file is used to install a Device MFT for a USB camera. It specifies version details, manufacturer information, COM object registration, and file copy operations. Ensure to replace placeholder GUIDs and device identifiers with your specific values. ```inf ;================================================================================= ; Microsoft Sample Extension INF for USB Camera SampleDeviceMFT installation ; Copyright (C) Microsoft Corporation. All rights reserved. ;================================================================================= [Version] Signature="$WINDOWS NT$" Class=Extension ClassGUID={e2f84ce7-8efa-411c-aa69-97454ca4cb57} Provider=%CONTOSO% ExtensionId = {E4FE3A00-68CF-45A3-83C8-8347A6A38069} ; replace with your own GUID CatalogFile.NT = SampleExtensionInfForDmftInstallation.cat DriverVer=03/28/2024,10.0.25326.2000 PnpLockdown=1 [Manufacturer] %CONTOSO% = ContosoSampleDeviceMFT,ntamd64.10.0...25326 [ContosoSampleDeviceMFT.ntamd64.10.0...25326] %ContosoCamera.DeviceDesc% = ContosoSampleDeviceMFT_Install, usb\vid_xxxx&pid_xxxx&mi_xx ; replace with your camera device VID PID [ContosoSampleDeviceMFT_Install] CopyFiles=ContosoSampleDeviceMFTCopy AddReg=ContosoSampleDeviceMFT_COM.AddReg ;----------------------------------------------------------------------------------- ; ; Registers Device MFT COM object ; ;----------------------------------------------------------------------------------- [ContosoSampleDeviceMFT_COM.AddReg] HKR,Classes\CLSID\%SampleDeviceMFT.CLSID%,,,%SampleDeviceMFT.FriendlyName% HKR,Classes\CLSID\%SampleDeviceMFT.CLSID%\InProcServer32\,,%REG_EXPAND_SZ%,"%13%\ContosoSampleDeviceMFT.dll" HKR,Classes\CLSID\%SampleDeviceMFT.CLSID%\InProcServer32\,ThreadingModel,,"Both" [ContosoSampleDeviceMFT_Install.Interfaces] AddInterface=%KSCATEGORY_VIDEO_CAMERA%,,ContosoSampleDeviceMFT.Interfaces, [ContosoSampleDeviceMFT.Interfaces] AddReg=ContosoSampleDeviceMFT.AddReg ;----------------------------------------------------------------------------------- ; ; Add DeviceMFT CLSID to device interface instance registry key ; ;----------------------------------------------------------------------------------- [ContosoSampleDeviceMFT.AddReg] HKR,,CameraDeviceMftClsid,,%SampleDeviceMFT.CLSID% ;----------------------------------------------------------------------------------- ; ; File copy sections ; ;----------------------------------------------------------------------------------- [SourceDisksFiles] ContosoSampleDeviceMFT.dll=1 [SourceDisksNames] 1 = %MediaDescription% [DestinationDirs] ContosoSampleDeviceMFTCopy=13 DefaultDestDir = 13 [ContosoSampleDeviceMFTCopy] ContosoSampleDeviceMFT.dll [Strings] CONTOSO = "Contoso Inc." ContosoCamera.DeviceDesc = "Contoso Camera Extension" MediaDescription="Contoso Camera Sample Device MFT Installation Media" SampleDeviceMFT.CLSID = "{zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz}" ; replace with your Device MFT COM object's CoClass ID SampleDeviceMFT.FriendlyName = "Contoso Camera Device MFT" KSCATEGORY_VIDEO_CAMERA="{E5323777-F976-4f5b-9B55-B94699C46E44}" REG_EXPAND_SZ=0x00020000 ``` -------------------------------- ### Example INF DDInstall.COM Section Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/install/inf-ddinstall-com-section.md An example demonstrating how to use the AddComServer, Include, and Needs directives within a DDInstall.COM section. ```APIDOC ## Example Usage ### Request Example ```inf [Device_Install.COM] AddComServer   = VendorComServer,, VendorComServer_Inst [VendorComServer_Inst] ServerType     = 1 ; in-proc ServerBinary   = %13%\Vendor_ComServer.dll AddComClass    = {bb2b85ab-9473-42e5-8d1a-0f01d3879879},, Vendor_ComClass_Inst [Vendor_ComClass_Inst] Description = %Vendor_ComClass_Desc% ThreadingModel = Neutral [Strings] %Vendor_ComClass_Desc%="Vendor Com Server" ``` ### Remarks - COM binaries are installed using the `[CopyFiles]` directive in the DDInstall section, typically into the driver store path (DIRID 13). - Device installation writes COM registrations under device-relative registry locations. - Clients must call `CoRegisterDeviceCatalog` on a worker thread before calling `CoCreateInstance`. - DDInstall.COM sections should match the platform and OS decorations of their related DDInstall sections (e.g., `install-section-name.ntamd64.COM`). - The DDInstall section must be referenced in the per-manufacturer Models section of the INF file. ``` -------------------------------- ### INF Strings Section Example Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/stream/providing-a-uvc-inf-file.md This section defines string values used within an INF file, including CLSIDs, GUIDs, and device descriptions. These are essential for identifying and configuring components during installation. ```inf [Strings] ; Non-localizable Plugin.CLSID="{zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz}" ProxyVCap.CLSID="{17CCA71B-ECD7-11D0-B908-00A0C9223196}" XU_GUID="{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" KSCATEGORY_VIDEO_CAMERA="{E5323777-F976-4f5b-9B55-B94699C46E44}" KSCATEGORY_CAPTURE="{65E8773D-8F56-11D0-A3B9-00A0C9223196}" KSCATEGORY_VIDEO="{6994AD05-93EF-11D0-A3CC-00A0C9223196}" ; Localizable CompanyName="CompanyName" Package="Installation Package" MyDevice.DeviceDesc="CompanyName Camera" PlugIn_IMyExtensionUnit="CompanyName Extension Unit Interface" ``` -------------------------------- ### Example Get Request Parameters Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/debugger/programming-custom-credential-providers.md Example of the input parameters provided to the credential provider for a Get request. ```console protocol=https host=contoso.symbols.com path=apis/symbol/symsrv resourceKind=symbols isretry=false issilent=false parenthwnd=593598 ``` -------------------------------- ### Get Request Example Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/print/get-request-and-response-schemas.md An example of a Get request containing multiple queries, including a deliberate error for a non-existent property. ```xml ``` -------------------------------- ### SetupDiInstallDevice Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/install/using-device-installation-functions.md The default handler for the DIF_INSTALLDEVICE request. ```APIDOC ## SetupDiInstallDevice ### Description The default handler for the DIF_INSTALLDEVICE request. ### Method Not Applicable (Function Call) ### Endpoint Not Applicable (Function Call) ### Parameters Not specified in the provided text. ### Request Example Not specified in the provided text. ### Response Not specified in the provided text. ``` -------------------------------- ### List devices in a setup class Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/devtest/devcon-examples.md Lists devices belonging to the 'Net' setup class. ```console devcon listclass net ``` ```console Listing 6 device(s) for setup class "Net" (Network adapters). PCI\VEN_10B7&DEV_9200&SUBSYS_00BE1028&REV_78\4&BB7B4AE&0&60F0: 3Com 3C920 Integrated Fast Ethernet Controller (3C905C-TX Compatible) ROOT\MS_L2TPMINIPORT\0000 : WAN Miniport (L2TP) ROOT\MS_NDISWANIP\0000 : WAN Miniport (IP) ROOT\MS_PPPOEMINIPORT\0000 : WAN Miniport (PPPOE) ROOT\MS_PPTPMINIPORT\0000 : WAN Miniport (PPTP) ROOT\MS_PTIMINIPORT\0000 : Direct Parallel ``` -------------------------------- ### Start a trace session with a provider GUID Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/devtest/example-2--basic-start-command-with-provider.md Starts a trace session named 'MyTrace' and enables a provider using its control GUID. The '#' prefix indicates the value is a GUID rather than a file path. ```shell tracelog -start MyTrace -guid #d58c126f-b309-11d1-969e-0000f875a5bc ``` -------------------------------- ### NDIS_GUID Example Mapping GUID to OID Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/network/oid-gen-co-supported-guids.md An example of an NDIS_GUID structure that maps a GUID to the OID_GEN_CO_RCV_PDUS_NO_BUFFER. Ensure that either fNDIS_GUID_TO_OID or fNDIS_GUID_TO_STATUS is set, but not both. ```cpp NDIS_GUID NdisGuid = {{0x0a214809, 0xe35f, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c}, GUID_NDIS_GEN_CO_RCV_PDUS_NO_BUFFER, OID_GEN_CO_RCV_PDUS_NO_BUFFER, 4, fNDIS_GUID_TO_OID}; ``` -------------------------------- ### SetupInstallFile Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/install/inf-file-processing-functions.md Installs a specified file into a specific target directory. ```APIDOC ## SetupInstallFile ### Description Installs a specified file into a specific target directory. ### Method Not specified (likely a C function call) ### Endpoint N/A (This is a function, not an API endpoint) ### Parameters (Parameters not detailed in the provided text) ### Request Example (Not applicable for this function) ### Response (Response details not detailed in the provided text) ``` -------------------------------- ### SetupInstallFileEx Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/install/inf-file-processing-functions.md Installs a specified file into a specific target directory. The installation is postponed if an existing version of the file is in use. ```APIDOC ## SetupInstallFileEx ### Description Installs a specified file into a specific target directory. The installation is postponed if an existing version of the file is in use. ### Method Not specified (likely a C function call) ### Endpoint N/A (This is a function, not an API endpoint) ### Parameters (Parameters not detailed in the provided text) ### Request Example (Not applicable for this function) ### Response (Response details not detailed in the provided text) ``` -------------------------------- ### PnP Device Installation Log Example Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/install/format-of-a-text-log-section.md A concrete example of a text log section generated by the PnP manager during PCI device installation. ```cpp >>> [Device Install - PCI\VEN_104C&DEV_8019&SUBSYS_8010104C&REV_00\3&61aaa01&0&38] >>> 2005/02/13 22:06:20.000: Section start ndv: Retrieving device info... ndv: Setting device parameters... ndv: Building driver list... ... ... additional section body log entries, which are not shown ... <<< [2005/02/13 22:06:28.109: Section end] <<< [Exit Status(0x00000000)] ``` -------------------------------- ### Start WPP Trace Session using GUID File Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/usbcon/implement-driver-entry-for-a-usb-driver--umdf-.md Start a trace session by referencing a .guid file containing the provider's GUID. This is an alternative to specifying the GUID directly on the command line. ```console tracelog -start MyTrace -guid c:\drivers\Provider.guid -flag 0xFFFF -level 7-rt -kd ``` -------------------------------- ### Enumerate devices and properties with SetupAPI Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/install/porting-from-setupapi-to-cfgmgr32.md Uses SetupDiGetClassDevs to list present devices and SetupDiGetDeviceProperty to retrieve the device description. ```cpp VOID GetDevicePropertiesSetupapi( VOID ) { HDEVINFO DeviceInfoSet = INVALID_HANDLE_VALUE; SP_DEVINFO_DATA DeviceInfoData; DWORD Index; WCHAR DeviceDesc[2048]; DEVPROPTYPE PropertyType; DeviceInfoSet = SetupDiGetClassDevs(NULL, NULL, NULL, DIGCF_ALLCLASSES | DIGCF_PRESENT); if (DeviceInfoSet == INVALID_HANDLE_VALUE) { goto Exit; } ZeroMemory(&DeviceInfoData, sizeof(DeviceInfoData)); DeviceInfoData.cbSize = sizeof(DeviceInfoData); for (Index = 0; SetupDiEnumDeviceInfo(DeviceInfoSet, Index, &DeviceInfoData); Index++) { // Query a property on the device. For example, the device description. if (!SetupDiGetDeviceProperty(DeviceInfoSet, &DeviceInfoData, &DEVPKEY_Device_DeviceDesc, &PropertyType, (PBYTE)DeviceDesc, sizeof(DeviceDesc), NULL, 0)) { // The error can be retrieved with GetLastError(); continue; } if (PropertyType != DEVPROP_TYPE_STRING) { continue; } } if (GetLastError() != ERROR_NO_MORE_ITEMS) { goto Exit; } Exit: if (DeviceInfoSet != INVALID_HANDLE_VALUE) { SetupDiDestroyDeviceInfoList(DeviceInfoSet); } return; } ``` -------------------------------- ### Get Request Schema Example Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/print/get-request-and-response-schemas.md An example of a Get request used to query the printer for specific values or properties. It includes queries for existing schema values and a deliberate error. ```APIDOC ## GET /api/printer/query ### Description Used to query the printer for one or more of its current values or properties. ### Method GET ### Endpoint /api/printer/query ### Request Body - **Query** (array) - Required - An array of query objects. - **schema** (string) - Required - The schema path to query. ### Request Example ```xml ``` ### Response #### Success Response (200) - **Result** (object) - Contains the results of the queries. - **Value** (object) - The queried value. #### Response Example ```xml true 500GB Invalid schema ``` ``` -------------------------------- ### GUID Format Example Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/devtest/boot-options-identifiers.md A GUID follows the format {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}, where 'x' represents a hexadecimal digit. The braces and dashes are required. ```guid {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} ``` ```guid {d2b69192-8f14-11da-a31f-ea816ab185e9} ``` -------------------------------- ### Example Boot Entry Configuration Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/devtest/boot-parameters-to-load-a-partial-checked-build.md This is an example output of `bcdedit /enum` showing a boot entry configured for a partial checked build, including kernel debugging over a serial connection. ```text ## Windows Boot Loader ------------------- identifier {18b123cd-2bf6-11db-bfae-00e018e2b8db} device partition=C: path \Windows\system32\winload.exe description PartialCheckedBuild locale en-US inherit {bootloadersettings} debugtype serial debugport 1 baudrate 115200 osdevice partition=C: systemroot \Windows kernel ntoskrnl.chk hal halacpi.chk resumeobject {d7094401-2641-11db-baba-00e018e2b8db} nx OptIn debug Yes ``` -------------------------------- ### Install TAEF Service Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/devtest/configure-the-machine-for-testing.md Installs, starts, and queries the status of the Te.service using wex.services.exe and sc commands. Verifies installation and startup type. ```console wex.services.exe /install:te.service ``` ```console sc start te.service ``` ```console sc query te.service ``` ```console sc qc te.service ``` -------------------------------- ### Example Memory Setup Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/debuggercmds/c--compare-memory-.md C code used to initialize two memory buffers for comparison. ```cpp void main() { char rgBuf1[100]; char rgBuf2[100]; memset(rgBuf1, 0xCC, sizeof(rgBuf1)); memset(rgBuf2, 0xCC, sizeof(rgBuf2)); rgBuf1[42] = 0xFF; } ``` -------------------------------- ### NDIS_GUID Mapping Example Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/network/oid-gen-supported-guids.md An example demonstrating how to initialize an NDIS_GUID structure to map a GUID to an OID. ```C++ NDIS_GUID NdisGuid = {{0x44795701, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c}, OID_802_3_MULTICAST_LIST, 6, fNDIS_GUID_TO_OID | fNDIS_GUID_ARRAY}; ``` -------------------------------- ### Example COM Server and Class Installation Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/install/inf-ddinstall-com-section.md Demonstrates registering a COM server and its associated class within an INF file. Requires the AddComServer directive to reference a COM server installation section, which in turn references a COM class installation section. ```inf [Device_Install.COM] AddComServer   = VendorComServer,, VendorComServer_Inst [VendorComServer_Inst] ServerType     = 1 ; in-proc ServerBinary   = %13%\Vendor_ComServer.dll AddComClass    = {bb2b85ab-9473-42e5-8d1a-0f01d3879879},, Vendor_ComClass_Inst [Vendor_ComClass_Inst] Description = %Vendor_ComClass_Desc% ThreadingModel = Neutral [Strings] %Vendor_ComClass_Desc%="Vendor Com Server" ``` -------------------------------- ### Starting Debugging Servers Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/debuggercmds/-endsrv--end-debugging-server-.md Examples of starting debugging servers using npipe and tcp protocols. ```dbgcmd 0:000> .server npipe:pipe=rabbit Server started with 'npipe:pipe=rabbit' 0:000> .server tcp:port=7 Server started with 'tcp:port=7' ``` -------------------------------- ### Install a Win32 service using AddService Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/develop/dch-example.md Use the AddService directive in an INF file to declaratively install and start a user-mode service. The AddTrigger directive is available starting in Windows 10 Version 2004. ```inf [OsrFx2_Install.NT] CopyFiles = OsrFx2_CopyFiles [OsrFx2_Install.NT.Services] AddService = WUDFRd, 0x000001fa, WUDFRD_ServiceInstall ; Flag 0x2 sets this as the service for the device AddService = osrfx2_DCHU_usersvc,, UserSvc_ServiceInstall [UserSvc_ServiceInstall] DisplayName = %UserSvcDisplayName% ServiceType = 0x10 ; SERVICE_WIN32_OWN_PROCESS StartType = 0x3 ; SERVICE_DEMAND_START ErrorControl = 0x1 ; SERVICE_ERROR_NORMAL ServiceBinary = %13%\osrfx2_DCHU_usersvc.exe AddTrigger = UserSvc_AddTrigger ; AddTrigger syntax is only available in Windows 10 Version 2004 and above [UserSvc_AddTrigger] TriggerType = 1 ; SERVICE_TRIGGER_TYPE_DEVICE_INTERFACE_ARRIVAL Action = 1 ; SERVICE_TRIGGER_ACTION_SERVICE_START SubType = %GUID_DEVINTERFACE_OSRFX2% ; Interface GUID DataItem = 2, "USB\VID_0547&PID_1002" ; SERVICE_TRIGGER_DATA_TYPE_STRING [OsrFx2_CopyFiles] osrfx2_DCHU_base.dll osrfx2_DCHU_filter.dll osrfx2_DCHU_usersvc.exe ``` -------------------------------- ### DeploymentItem Configuration Examples Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/taef/deploymentitem-metadata.md Various configurations for deploying files, directories, and using environment variables. ```cpp [DeploymentItem("file1.xml")] ``` ```cpp [DeploymentItem("file2.xml", "DataFiles")] ``` ```cpp [DeploymentItem("C:\\MyDataFiles\\MyDataFiles2\\")] ``` ```cpp [DeploymentItem("%myDir%\\myFile.txt")] ``` -------------------------------- ### Install WdfTester Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/devtest/wdftester-installation.md Run this command in an administrator Command Prompt to install the Wdftester.sys driver and start the service. ```batch cscript WdfTesterScript.wsf install ``` -------------------------------- ### SetupDiGetClassDescriptionEx Source: https://github.com/microsoftdocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/install/using-device-installation-functions.md Retrieves the description of a setup class installed on a local or remote computer. ```APIDOC ## SetupDiGetClassDescriptionEx ### Description Retrieves the description of a setup class installed on a local or remote computer. ### Method Not specified (likely a function call in C/C++) ### Endpoint N/A (This is a function, not an API endpoint) ### Parameters (Parameters not detailed in the provided text) ### Request Example (Not applicable for this function) ### Response (Response details not detailed in the provided text) ```