User applications are expected to parse the Windows registry to discover which PassThru devices are installed, and which protocols are supported by each device. Most of the time, our example code should take care of everything appropriately.

For example, the registry may contain information on three J2534-1 devices:

[HKEY_LOCAL_MACHINE\SOFTWARE\PassThruSupport.04.04\Drew Technologies Inc. - CarDAQ PLUS]
"Vendor"="Drew Technologies Inc."
"Name"="CarDAQ PLUS"

[HKEY_LOCAL_MACHINE\SOFTWARE\PassThruSupport.04.04\Drew Technologies Inc. - Mongoose ISO/CAN]
"Vendor"="Drew Technologies Inc."
"Name"="Mongoose ISO/CAN"

[HKEY_LOCAL_MACHINE\SOFTWARE\PassThruSupport.04.04\Alternative J2534 Vendor - OtherBox]
"Vendor"="Alternative J2534 Vendor"

Notice: With the J2534-1 (v0404) API, expect multiple vendors and multiple devices. Use a while-loop with RegEnumKeyEx() to enumerate all PassThru interfaces available under the PassThru.0404 key. Each entry will describe the driver DLL, config application, and supported protocols. Please refer to the SAE specification for more details.

The PassThru (J2534) functions must be accessed through run-time dynamic linking. The following example loads and extracts the address for PassThruConnect():

typedef long (CALLBACK* PTOPEN)(void *, unsigned long *);
PTOPEN PassThruOpen;
hDLL = LoadLibrary(DllLibraryPath);
PassThruOpen = (PTOPEN)(GetProcAddress(hDLL, "PassThruOpen"));