FTD2XX_NET.FTDI.GetDriverVersion C# (CSharp) Method

GetDriverVersion() public method

Gets the current FTDIBUS.SYS driver version number.
public GetDriverVersion ( UInt32 &DriverVersion ) : FT_STATUS
DriverVersion System.UInt32 The current driver version number.
return FT_STATUS
        public FT_STATUS GetDriverVersion(ref UInt32 DriverVersion)
        {
            // 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_GetDriverVersion != IntPtr.Zero)
            {
                tFT_GetDriverVersion FT_GetDriverVersion = (tFT_GetDriverVersion)Marshal.GetDelegateForFunctionPointer(pFT_GetDriverVersion, typeof(tFT_GetDriverVersion));

                if (ftHandle != IntPtr.Zero)
                {
                    // Call FT_GetDriverVersion
                    ftStatus = FT_GetDriverVersion(ftHandle, ref DriverVersion);
                }
            }
            else
            {
                if (pFT_GetDriverVersion == IntPtr.Zero)
                {
                    LogB.Debug("FTD2XX: Failed to load function FT_GetDriverVersion.");
                }
            }
            return ftStatus;
        }