Streamlining Driver Development

By providing engineers with a cross-platform, hardware-agnostic driver development kit, WinDriver enables rapid prototyping and deployment of PCI, PCIe, USB, and other custom device drivers through a high-level API and automated code generation tools.


Building a Custom Device Driver

You can use DriverWizard to diagnose your device and verify that it operates as expected, as well as to generate skeletal code for your device in C, C#, Visual Basic (USB Only), Java and Python. For more information about DriverWizard, refer to Chapter 6: Using DriverWizard.

 

⚠ Attention: ‍‍For devices based on the Altera Qsys, Avalon-MM designs, Xilinx BMD, XDMA, QDMA designs, you can use DriverWizard to generate customized device-specific code, which utilizes the enhanced-support sample APIs. For additional information, refer to Chapter 9: Enhanced Support for Specific Chipsets. This is the most recommended way to develop a driver using WinDriver as it saves you the most time and hassle.

 

Use any C/C#.NET/Python/Java compiler/interpreter or development environment (depending on the code you created) to build the skeletal driver you need. WinDriver provides specific support for the following environments and compilers: MS Visual Studio, CMake, GNU Make/Eclipse (for Java projects).

That is all you need to do in order to create your user-mode driver. If you discover that better performance is needed, refer to Chapter 11: Improving PCI Performance.

To learn how to perform operations that DriverWizard cannot automate, refer to Chapter 10: PCI Advanced Features.

 

Using Code Samples

If you are using an enhanced-support PCI device (PLX 6466, 9030, 9050, 9052, 9054, 9056, 9080 and 9656; Altera Qsys, Avalon-MM designs; Xilinx BMD, XDMA, QDMA designs), you may want to use the related WinDriver sample as the basis for your development instead of generating code with DriverWizard.

This method is relevant if you are unable to get DriverWizard to work on your platform or if it is not available for your platform and you wish to quickly start developing.

These samples can be found in ´WinDriver/samples/c´. These directories include both the source code and project files to compile them, and also a precompiled version of the sample source code.

⚠ Attention: ‍‍‍Note that after your evaluation period has expired the precompiled binaries of the sample will not work, and you will have to recompile them with your new license key.


Writing the Device Driver Without DriverWizard

There may be times when you choose to write your driver directly, without using DriverWizard.

In such cases, either follow the steps outlined in this section to create a new driver project, or select a WinDriver sample that most closely resembles your target driver and modify it to suit your specific requirements.

This method is recommended only for expert users that are already familiar with the WinDriver API and the required compilation flags needed in order to compile WinDriver.

Include the Required WinDriver Files

Firstly, include the relevant WinDriver header files in your driver project. All header files are found under the WinDriver/include or WinDriver/samples/c/shared (for C projects) directory. All WinDriver projects require the windrvr.h header file.

When using the WDC_xxx API / WDU_xxx API , include the wdc_lib.h / wdu_lib.h and wdc_defs.h header files (these files already include windrvr.h).

Include any other header file that provides APIs that you wish to use from your code (e.g., files from the WinDriver/samples/c/shared directory, which provide convenient diagnostics functions.)

Then include the relevant header files from your source code. For example, to use API from the windrvr.h header file, add the following line to the code:

#include “windrvr.h”

Afterwards, link your code with the WDAPI library (Windows) / shared object (Linux):

  • For Windows: WinDriver\lib\amd64\wdapi1640.lib, for compiling 64-bit binaries for x64 platforms, or WinDriver\lib\amd64\x86\wdapi1640_32.lib for compiling 32-bit binaries for x64 platforms or WinDriver\lib\arm64\wdapi1640_arm64.lib for compiling 64-bit binaries for ARM64 platforms.
  • For Linux: From the WinDriver/lib directory — libwdapi1640.so (for 64-bit binaries for x64 platforms) or libwdapi1640_32.so (for 32-bit applications targeted at 64-bit platforms).
  • For MacOS: From the WinDriver/lib directory — libwdapi1640.dylib

(note that WinDriver for MacOS currently doesn’t support 32 bit applications on 64-bit platforms).

You can also include the library’s source files in your project instead of linking the project with the library. The C source files are located under the WinDriver/src/wdapi directory.

When linking your project with the WDAPI library/framework/shared object, you will need to distribute this binary with your driver.

  • For Windows, get wdapi1640.dll / wdapi1640_32.dll (for 32-bit applications targeted at 64-bit platforms) / wdapi1640_ARM64.dll (for 64-bit applications targeted at ARM64 platforms) from the WinDriver/redist directory.
  • For Linux, get libwdapi1640.so / libwdapi1640_32.so (for 32-bit applications targeted at 64-bit platforms) from the WinDriver/lib directory.
  • For MacOS, get libwdapi1640.dylib from the WinDriver/lib directory.

ℹ️ Note ‍WinDriver for MacOS currently doesn’t support 32 bit applications on 64-bit platforms.

Add any other WinDriver source files that implement API that you which to use in your code (e.g. files from the WinDriver/samples/c/shared directory.)

Write Your Code (PCI/ISA)

This section outlines the calling sequence when using the High Level WDC_xxx API: We strongly recommend working with the High Level WDC_xxx API for more concise code, easier to debug and less error-prone (compared to the Low Level WD_xxx API).

  • Call WDC_DriverOpen() to open a handle to WinDriver and the WDC library, compare the version of the loaded driver with that of your driver source files, and register your WinDriver license (for registered users).
    • For PCI/PCI Express devices, call WDC_PciScanDevices() to scan the PCI bus and locate your device.
    • For PCI/PCI Express devices, call WDC_PciGetDeviceInfo() to retrieve the resources information for your selected device.
    • For ISA devices, define the resources yourself within a WD_CARD structure.
  • Call WDC_PciDeviceOpen() / WDC_IsaDeviceOpen() (depending on your device), and pass to the function the device’s resources information. These functions return a handle to the device, which you can later use to communicate with the device using the WDC_xxx API.
  • Communicate with the device using the WDC_xxx API.
  • When you are done:

 

Write Your Code (USB)

This section outlines the calling sequence when using the WDU_xxx / WDC_xxx API:

  • Call WDC_DriverOpen() to open a handle to WinDriver and the WDC library, compare the version of the loaded driver with that of your driver source files, and register your WinDriver license (for registered users).
  • Call WDU_Init() at the beginning of your program to initialize WinDriver for your USB device, and wait for the device-attach callback. The relevant device information will be provided in the attach callback.
  • Communicate with the device using the WDU_xxx API.
    • Once the attach callback is received, you can start using one of the WDU_Transfer() functions family to send and receive data.
  • When you are done:

Configure and Build Your Code

After including the required files and writing your code, make sure that the required build flags and environment variables are set, then build your code.

⚠ Attention: ‍‍When developing a driver for a 64-bit platform, your project or makefile must include the KERNEL_64BIT preprocessor definition. In the makefiles, the definition is added using the -D flag: -DKERNEL_64BIT. The sample and wizard-generated Linux and Windows GCC makefiles and the Windows MS Visual Studio projects, in the 64-bit WinDriver toolkit, already include this definition.

Before building your code, verify that the WD_BASEDIR environment variable is set to the location of the of the WinDriver installation directory. On Windows and Linux you can define the WD_BASEDIR environment variable globally: for Windows — refer to the Windows WD_BASEDIR note in 3.2.1. Windows WinDriver Installation Instructions; for Linux – refer to 3.2.2. Linux WinDriver Installation Instructions.

⚠ Attention: ‍If you have renamed your driver make sure you’ve added -DWD_DRIVER_NAME_CHANGE to your makefile (More information on Driver Renaming is available on Chapter 17: Driver Installation — Advanced Issues).

Full Benefits
Guidance
Features
Technical Data

Download WinDriver Free 30 Days Trial

Please fill the form below to download a fully featured WinDriver evaluation

Software License Agreement of WinDriver (TM) Version v16.4.0
© Jungo Connectivity Ltd. 2024 All Rights Reserved

IMPORTANT – READ CAREFULLY: THIS SOFTWARE LICENSE AGREEMENT (“AGREEMENT”) IS A LEGAL AGREEMENT BETWEEN YOU AND JUNGO CONNECTIVITY LTD. (“JUNGO”), FOR THE WINDRIVER SOFTWARE PRODUCT ACCOMPANYING THIS LICENSE (THE “SOFTWARE”). BY INSTALLING, COPYING OR OTHERWISE USING THE SOFTWARE, YOU AGREE TO BE LEGALLY BOUND BY THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT, DO NOT INSTALL, COPY, OR OTHERWISE USE THE SOFTWARE.

 

  1. OWNERSHIP OF THE SOFTWARE. All right, title, and interest in and to the Software, including associated intellectual property rights, of any sort and/or kind, are and shall remain solely with Jungo and its licensors, and may be protected by copyright, trademark, patent and trade secret law and international treaties. This Agreement does not convey to you an interest in or to the Software, but only a limited, non-transferable, non-sublicensable, non-exclusive, and revocable right of use, in accordance with the terms of this Agreement. You may not remove any proprietary notices and/or any legends from the Software, in whole or in part.

 

  1. GRANT OF LICENSE. Jungo hereby grants you a personal, non-exclusive, nontransferable, non-sublicensable node-locked and time limited license to use the Software.

 

    – Individuals: Jungo grants you, as an individual, a personal, non-exclusive, “single-user” license to use the Software on a single computer, in the manner provided below, at the site for which the license was given.

 

    – Entities: If you are an entity, Jungo grants you the right to designate one individual within your organization (and only one) to have the right to use the Software on a single computer, in the manner provided below, at the site for which the license was given.

 

    – License Scope: A single user license allows usage of WinDriver and redistribution of certain components (as defined below) within a single end product SKU, for a single device (identified by its VID/PID (USB) or VID/DID (PCI)), and without SDK/API capabilities.  If you need extended license or distribution rights, please contact Jungo.

 

  1. EVALUATION LICENSE. If you have not yet paid license fees for the use of the Software, then Jungo hereby grants you a personal, non-exclusive, non-transferable and non-sublicensable license to internally use the Software for evaluation purposes only, for a period of 30 days (the “Evaluation License”). If, after the expiration of the Evaluation License, you wish to continue using the Software and accompanying written materials, you may do so by remitting the required payment to Jungo, and you will then receive a registration code and a license string that will permit you to use the Software on a single computer under one of the license schemes specified in Section 2 above.

 

  1. SERVICE OPTIMIZATION AND ENHANCEMENT. To continuously improve and optimize Jungo’s services, Jungo reserves the right to anonymously monitor, collect, and analyze usage data, including but not limited to API interactions, performance metrics, and system activity. Such data collection and analysis shall be conducted in compliance with all applicable laws and regulations and shall be used solely for the purpose of enhancing service performance, security, and reliability.
  2. SUBSCRIPTION, SERVICE CONTINUITY, RENEWAL, AND LATE PAYMENT PENALTIES. Access to the WinDriver and its associated features is provided on a subscription basis, subject to annual renewal. Failure to renew the subscription before the expiration date may result in the automatic termination of access to the platform and all related services, and additional fees (including but not limited to late payment penalties, administrative charges, or reinstatement costs). Upon termination, the user shall forfeit any rights to continued use, and we reserve the right to suspend or delete any associated accounts, data, or functionalities without further notice.

 

  1. OPEN SOURCE. The Software includes certain files that are subject to open source licenses. These files are identified in their header files (“Open Source Files”). You must use the Open Source Files in accordance with the terms of their respective licenses.  In the event of any contradiction between the terms of this Agreement, and the terms of the open source license accompanying a certain Open Source File, the terms of the latter shall prevail, with regard to the said Open Source File.

 

RESTRICTIONS ON USE AND TRANSFER

 

  1. DISTRIBUTION OF FILES.

 

    (a) You may not distribute, or otherwise transfer or assign, any portion of the Software, including any of the headers or source files that are included in the Software, unless otherwise expressly permitted in this Agreement, subject to the provisions of Section 4 above.

 

    (b) Subject to your full and continued compliance with the terms of this Agreement, including the ongoing payment of annual license fees, you may distribute the following files:

 

Windows:
-windrvr1640.sys
-windrvr1640_legacy.sys
-windrvr1640.inf
-windrvr1640.cat
-wdapi1640.dll
-wdapi1640_32.dll
-wdapi1640_arm64.dll
-wdapi_dotnet1640.dll
-wdapi_dotnet1640_32.dll
-wdapi_netcore1640.dll
-wdapi_java1640.dll
-wdapi_java1640.jar
-wdreg.exe
-difxapi.dll
-devcon.exe
-windrvr1630.sys
-windrvr1630.inf
-wd1630.cat
-wdapi1630.dll
-wdapi_dotnet1630.dll
-wdapi_java1630.dll wdapi_java1600.jar
-windrvr1220.dll
-wdapi1220.dll

Linux:
-windrvr_gcc_v3.o_shipped
-windrvr_gcc_v3_regparm.o_shipped
-kp_linux_gcc_v3.o
-kp_linux_gcc_v3_regparm.o
-libwdapi1640.so libwdapi1640_32.so
-libwdapi_java1640.so
-libwdapi_java1640_32.so
-wdapi_java1640.jar
-wdapi_netcore1640.dll
-kp_wdapi1640_gcc_v3.o_shipped
-kp_wdapi1640_gcc_v3_regparm.o_shipped
-linux_wrappers.c
-linux_wrappers.h
-wdusb_linux.c
-wdusb_interface.h
-wd_ver.h
-linux_common.h
-windrvr.h
-windrvr_usb.h
-wdsriov_interface.h
-wdsriov_linux.c
-wdreg
-configure makefile.in
-configure.wd makefile.wd.in
-makefile.wd.kbuild.in
-configure.usb
-makefile.usb.in
-makefile.usb.kbuild.in
-setup_inst_dir
-windrvr_gcc_v2.a windrvr_gcc_v3.a windrvr_gcc_v3_regparm.a
-kp_linux_gcc_v2.o kp_linux_gcc_v3.o kp_linux_gcc_v3_regparm.o
-libwdapi1630.so
-libwdapi_java1630.so wdapi_java1600.java
-kp_wdapi1630_gcc_v2.a kp_wdapi1600_gcc_v3.a kp_wdapi1600_gcc_v3_regparm.a
-linux_wrappers.c linux_wrappers.h wdusb_linux.c
-wdusb_interface.h wd_ver.h linux_common.h windrvr.h windrvr_usb.h
-configure.wd makefile.wd.in makefile.wd.kbuild.in
-configure.usb makefile.usb.in makefile.usb.kbuild.in

macOS:
-libwdapi1640.dyld
-libwdapi_java1640.jar
-libwdapi_java1640.dyld
-wdapi_netcore1640.dll
-WinDriver1640.kext
-WinDriver1640.dext
-wd_mac_install.sh
-wd_mac_uninstall.sh

 

    (c) The files listed in Section 5.b above may be distributed only as part of a complete application that you distribute under your organization name, and only if they significantly contribute to the functionality of your application. For avoidance of doubt, each organization distributing these files as part of the organization products is required to have valid license(s) under the organization name/VID, irrespective of the party who actually performed the product development. Licenses granted to subcontractors do not grant distribution or other rights to the organizations for which they are developing.

 

    (d) The distribution of the windrvr.h header file is permitted only on Linux.

 

    (e) You may not modify the distributed files specified in Section 5.b of this Agreement.

 

    (f) You may not distribute any header file that describes the WinDriver functions, or functions that call the WinDriver functions and have the same basic functionality as that of the WinDriver functions.

 

  1. The Software may not be used to develop a development product, an API, or any products, which will eventually be part of a development product or environment, without the written consent of Jungo and subject to additional fees and licensing terms.

 

  1. You may make printed copies of the written materials accompanying the Software, provided that only users bound by this license use them.

 

  1. You may not allow any third party to use the Software, grant access to the Software (or any portion thereof) to any third party, or otherwise make any commercial use of the Software, including without limitation, assign, distribute, sublicense, transfer, pledge, lease, rent, or share your rights in the Software or any of your rights under this Agreement, all whether or not for any consideration.

 

  1. You may not translate, reverse engineer, decompile, disassemble, reproduce, duplicate, copy, or otherwise disseminate all or any part of the Software, or extract source code from the object code of the Software.

 

  1. Jungo reserves the right to revise, update, change, modify, add to, supplement, or delete any and all terms of this License Agreement; provided, however, that changes to this License Agreement will not be applied retroactively. Such changes will be effective with or without prior notice to you. You can review the most current version of this License Agreement under the WinDriver download form page.

 

  1. You may not incorporate or link any open source software with any open source software part of the Software, or otherwise take any action which may cause the Software or any portion thereof to be subjected to the terms of the Free Software Foundation’s General Public License (GPL) or Lesser General Public License (LGPL), or of any other open source code license.

 

  1. DISCLAIMER OF WARRANTY. THIS SOFTWARE AND ITS ACCOMPANYING WRITTEN MATERIALS ARE PROVIDED BY JUNGO “AS IS” WITHOUT ANY WARRANTY. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT, ARE HEREBY DISCLAIMED TO THE FULLEST EXTENT PERMITTED UNDER APPLICABLE LAW.

 

  1. NO LIABILITY. TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL JUNGO OR ITS LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, SAVINGS, IP INFRINGEMENT OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

 

  1. Governing Law. This Agreement and use of the Software are governed by the laws of the State of Israel, regardless of its conflict of laws rules, and the competent courts of the State of Israel shall have sole and exclusive jurisdiction over any dispute under this Agreement or otherwise related to the Software.

 

  1. Confidentiality. The Software, including any additional information related thereto, contains confidential and proprietary information of Jungo.  Accordingly, you agree that you will not, nor allow any third party to, disseminate, transfer, grant access to, or otherwise disclose to any third party the Software or any part thereof or any other confidential or proprietary information of Jungo provided in connection therewith. You will maintain all copies of the Software and all related documentation in confidence.

 

  1. Termination and Effects of Termination. Jungo may terminate this Agreement and the licenses granted to you hereunder at any time if you breach any of your obligations hereunder, by issuance of written notice to such effect, addressed to you at the address you provided in your registration form. Upon expiration or other termination of this Agreement, the Licenses granted to you hereunder shall immediately and automatically be canceled, and you will immediately remove all copies of the Software from your computer(s) and cease any use thereof.

 

  1. Contact Details. If you have any questions concerning this Agreement or wish to contact Jungo for any reason —

 

          Web site: https://www.jungo.com

          Email:    [email protected]

 

  1. US GOVERNMENT RESTRICTED RIGHTS. The Software and documentation are provided with RESTRICTED RIGHTS.

  Use, duplication, or disclosure by the Government is subject to restrictions set forth in subparagraph (c)(1) of The Rights in Technical Data and Computer Software clause at DFARS 252.227-7013 or subparagraphs (c)(1)(ii) and (2) of Commercial Computer Software – Restricted Rights at 48 CFR 52.227-19, as applicable.

 

  1. Automatic Renewal. The subscription shall be automatically renewed, unless Licensee notifies Licensor 30 days or more prior to the expiration date of the subscription, of its intent not to renew the subscription.

Accessibility Toolbar