Stub implementation of ftd2xx.dll (to access FTDI USB devices)

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Mon Jul 20 06:52:56 CDT 2009


---
 configure.ac              |   16 +++++++++
 dlls/ftd2xx/Makefile.in   |   16 +++++++++
 dlls/ftd2xx/ftd2xx.spec   |   79 +++++++++++++++++++++++++++++++++++++++++++++
 dlls/ftd2xx/ftd2xx_main.c |   49 ++++++++++++++++++++++++++++
 4 files changed, 160 insertions(+), 0 deletions(-)
 create mode 100644 dlls/ftd2xx/Makefile.in
 create mode 100644 dlls/ftd2xx/ftd2xx.spec
 create mode 100644 dlls/ftd2xx/ftd2xx_main.c

diff --git a/configure.ac b/configure.ac
index 3b805fe..822fc41 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1092,6 +1092,22 @@ fi
 WINE_NOTICE_WITH(sane,[test "x$ac_cv_lib_soname_sane" = "x"],
                  [libsane ${notice_platform}development files not found, scanners won't be supported.])
 
+dnl **** Check for LIBFTD2XX ****
+AC_SUBST(FTD2XXLIBS,"")
+AC_SUBST(FTD2XXINCL,"")
+if test "x$with_ftd2xx" != "xno"
+then
+    AC_CHECK_HEADERS([ftd2xx.h],
+        AC_CHECK_LIB(ftd2xx, FT_Open,
+            [AC_DEFINE(HAVE_LIBFTD2XX, 1, [Define if you have the libftd2xx library and header])
+             FTD2XXLIBS="-lftd2xx"
+             AC_SUBST(FTD2XXINCL,"$ac_ftd2xx_incl")]))
+    CPPFLAGS="$ac_save_CPPFLAGS"
+fi
+WINE_NOTICE_WITH(ftd2xx,[test "x$ac_cv_lib_ftd2xx_FT_Open" != "xyes"],
+                 [libftd2xx ${notice_platform}development files not found, FTD2XX won't be supported.])
+
+
 dnl **** Check for libgphoto2 ****
 if test "x$with_gphoto" != "xno"
 then
diff --git a/dlls/ftd2xx/Makefile.in b/dlls/ftd2xx/Makefile.in
new file mode 100644
index 0000000..34fe596
--- /dev/null
+++ b/dlls/ftd2xx/Makefile.in
@@ -0,0 +1,16 @@
+TOPSRCDIR = @top_srcdir@
+TOPOBJDIR = ../..
+SRCDIR    = @srcdir@
+VPATH     = @srcdir@
+MODULE    = ftd2xx.dll
+IMPORTLIB = ftd2xx
+IMPORTS   = kernel32
+EXTRAINCL = @FTD2XXINCL@
+EXTRALIBS = @FTD2XXLIBS@
+
+C_SRCS = \
+	ftd2xx_main.c
+
+ at MAKE_DLL_RULES@
+
+ at DEPENDENCIES@  # everything below this line is overwritten by make depend
diff --git a/dlls/ftd2xx/ftd2xx.spec b/dlls/ftd2xx/ftd2xx.spec
new file mode 100644
index 0000000..f12e880
--- /dev/null
+++ b/dlls/ftd2xx/ftd2xx.spec
@@ -0,0 +1,79 @@
+@ stub FT_Open
+@ stub FT_Close
+@ stub FT_Read
+@ stub FT_Write
+@ stub FT_IoCtl
+@ stub FT_ResetDevice
+@ stub FT_SetBaudRate
+@ stub FT_SetDataCharacteristics
+@ stub FT_SetFlowControl
+@ stub FT_SetDtr
+@ stub FT_ClrDtr
+@ stub FT_SetRts
+@ stub FT_ClrRts
+@ stub FT_GetModemStatus
+@ stub FT_SetChars
+@ stub FT_Purge
+@ stub FT_SetTimeouts
+@ stub FT_GetQueueStatus
+@ stub FT_SetEventNotification
+@ stub FT_GetEventStatus
+@ stub FT_GetStatus
+@ stub FT_SetBreakOn
+@ stub FT_SetBreakOff
+@ stub FT_SetWaitMask
+@ stub FT_WaitOnMask
+@ stub FT_SetDivisor
+@ stub FT_OpenEx
+@ stub FT_ListDevices
+@ stub FT_SetLatencyTimer
+@ stub FT_GetLatencyTimer
+@ stub FT_SetBitMode
+@ stub FT_GetBitMode
+@ stub FT_SetUSBParameters
+@ stub FT_EraseEE
+@ stub FT_ReadEE
+@ stub FT_WriteEE
+@ stub FT_EE_Program
+@ stub FT_EE_Read
+@ stub FT_EE_UARead
+@ stub FT_EE_UASize
+@ stub FT_EE_UAWrite
+@ stub FT_W32_CreateFile
+@ stub FT_W32_CloseHandle
+@ stub FT_W32_ReadFile
+@ stub FT_W32_WriteFile
+@ stub FT_W32_GetOverlappedResult
+@ stub FT_W32_ClearCommBreak
+@ stub FT_W32_ClearCommError
+@ stub FT_W32_EscapeCommFunction
+@ stub FT_W32_GetCommModemStatus
+@ stub FT_W32_GetCommState
+@ stub FT_W32_GetCommTimeouts
+@ stub FT_W32_GetLastError
+@ stub FT_W32_PurgeComm
+@ stub FT_W32_SetCommBreak
+@ stub FT_W32_SetCommMask
+@ stub FT_W32_SetCommState
+@ stub FT_W32_SetCommTimeouts
+@ stub FT_W32_SetupComm
+@ stub FT_W32_WaitCommEvent
+@ stub FT_GetDeviceInfo
+@ stub FT_W32_CancelIo
+@ stub FT_StopInTask
+@ stub FT_RestartInTask
+@ stub FT_SetResetPipeRetryCount
+@ stub FT_ResetPort
+@ stub FT_EE_ProgramEx
+@ stub FT_EE_ReadEx
+@ stub FT_CyclePort
+@ stub FT_CreateDeviceInfoList
+@ stub FT_GetDeviceInfoList
+@ stub FT_GetDeviceInfoDetail
+@ stub FT_SetDeadmanTimeout
+@ stub FT_GetDriverVersion
+@ stub FT_GetLibraryVersion
+@ stub FT_W32_GetCommMask
+@ stub FT_Rescan
+@ stub FT_Reload
+@ stub FT_GetComPortNumber
diff --git a/dlls/ftd2xx/ftd2xx_main.c b/dlls/ftd2xx/ftd2xx_main.c
new file mode 100644
index 0000000..148fd04
--- /dev/null
+++ b/dlls/ftd2xx/ftd2xx_main.c
@@ -0,0 +1,49 @@
+/*
+ * FTD2XX.dll
+ *
+ * Forward calls for ftd2xx.dll to libftd2xx.so
+ * Copyright 2009 Uwe Bonnes
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ *
+ */
+
+#include "config.h"
+
+#include <stdarg.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(ftd2xx);
+
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+{
+    TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
+
+    switch (fdwReason)
+    {
+        case DLL_WINE_PREATTACH:
+            return FALSE;    /* prefer native version */
+        case DLL_PROCESS_ATTACH:
+            DisableThreadLibraryCalls(hinstDLL);
+            break;
+        case DLL_PROCESS_DETACH:
+            break;
+    }
+
+    return TRUE;
+}
-- 
1.6.0.2




More information about the wine-patches mailing list