FTD2XX_NET.FTDI.GetLibraryVersion C# (CSharp) Method

GetLibraryVersion() public method

Gets the current FTD2XX.DLL driver version number.
public GetLibraryVersion ( UInt32 &LibraryVersion ) : FT_STATUS
LibraryVersion System.UInt32 The current library version.
return FT_STATUS
        public FT_STATUS GetLibraryVersion(ref UInt32 LibraryVersion)
        {
            // Initialise ftStatus to something other than FT_OK
            FT_STATUS ftStatus = FT_STATUS.FT_OTHER_ERROR;

            // If the DLL hasn't been loaded, just return here
            if (hFTD2XXDLL == IntPtr.Zero)
                return ftStatus;

            // Check for our required function pointers being set up
            if (pFT_GetLibraryVersion != IntPtr.Zero)
            {
                tFT_GetLibraryVersion FT_GetLibraryVersion = (tFT_GetLibraryVersion)Marshal.GetDelegateForFunctionPointer(pFT_GetLibraryVersion, typeof(tFT_GetLibraryVersion));

                // Call FT_GetLibraryVersion
                ftStatus = FT_GetLibraryVersion(ref LibraryVersion);
            }
            else
            {
                if (pFT_GetLibraryVersion == IntPtr.Zero)
                {
                    LogB.Debug("FTD2XX: Failed to load function FT_GetLibraryVersion.");
                }
            }
            return ftStatus;
        }