On 23/01/13 07:32, Xiaofan Chen wrote:
On Wed, Jan 23, 2013 at 9:25 AM, Pete Batard <p...@akeo.ie> wrote:
WinCE support is now in mainline.
I tested compilation with the SDK_500 (ARM) and VS2008, and everything
seems to be OK after simply moving the "wince_usb.h" include after the
libusbi.h include in wince_usb.c.
Needs some support here.
I'll try to help. I can provide pre-compiled libusb dlls for Windows CE,
but I think all the baseports we have are for WinCE 6, so wouldn't help
your WinCE 5 device.
Another issue is that WinCE 6 onwards doesn't really have a stable
kernel API between baseports; creators of baseports are free to add,
remove or modify most of the APIs called by the Windows CE USB wrapper
so the general advice is to build a driver for each hardware platform.
I have issues building both libusbx WinCE branch and the Windows CE
USB wrapper.
Which branch were you using? I've just tried the libusbx master in
VS2005 and it all builds nicely.
The https://github.com/pbatard/libusbx/commits/wince-integration branch
was broken when I last tried it, but Pete has fixed all those issue
before merging into libusbx master.
1) Windows CE USB Wrapper:
https://github.com/RealVNC/CEUSBKWrapper
If you're building for a WinCE 5.0 system then you'll have trouble. The
big (and hopefully only) issue is that between WinCE 5.0 and WinCE 6.0
the method for kernel code to access user memory changed significantly.
Currently the UserBuffer.cpp file only has an implementation for the
WinCE 6.0 API. I'll see if I can track down a WinCE 5.0 baseport, but if
I can't, would it be possible for you to try a patch if I provide it?
<snip>
BUILD: [01:0000000031:ERRORE]
c:\WINCE500\PLATFORM\RABASE\SRC\TESTS\usb\drv\UserBuffer.h(38) : error
C2100: illegal indirection
That isn't the issue with different kernel APIs between WinCE 5 and
WinCE6. Can you try the attached patch and see if that fixes all of the
issues other than the UserBuffer.cpp compilation?
Regards,
Toby
>From 9129be8ff8e84a0892a345c0ea743665bc83c278 Mon Sep 17 00:00:00 2001
From: Toby Gray <toby.g...@realvnc.com>
Date: Wed, 23 Jan 2013 11:39:26 +0000
Subject: [PATCH] drv: Removing dubious use of "1" as a pointer in sizeof.
---
drv/Transfer.cpp | 2 +-
drv/UserBuffer.cpp | 2 +-
drv/UserBuffer.h | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drv/Transfer.cpp b/drv/Transfer.cpp
index 92c31c4..113bcca 100644
--- a/drv/Transfer.cpp
+++ b/drv/Transfer.cpp
@@ -57,7 +57,7 @@ Transfer::Transfer(
lpUserBuffer, dwUserBufferSize)
, mBytesTransferredBuffer(
AccessFlagsForBytesTransferredBuffer(dwFlags, lpUserOverlapped),
- lpUserBytesTransferred)
+ lpUserBytesTransferred, sizeof(DWORD))
, mOverlappedBuffer(lpUserOverlapped)
{
mOpenContext->GetTransferList()->RegisterTransfer(this);
diff --git a/drv/UserBuffer.cpp b/drv/UserBuffer.cpp
index b3001cc..404453d 100644
--- a/drv/UserBuffer.cpp
+++ b/drv/UserBuffer.cpp
@@ -177,7 +177,7 @@ template class UserBuffer<LPDWORD>;
template class UserBuffer<LPOVERLAPPED>;
OverlappedUserBuffer::OverlappedUserBuffer(LPOVERLAPPED lpOverlapped)
-: UserBuffer<LPOVERLAPPED>(UBA_WRITE | UBA_ASYNC, lpOverlapped)
+: UserBuffer<LPOVERLAPPED>(UBA_WRITE | UBA_ASYNC, lpOverlapped, sizeof(OVERLAPPED))
, mhEvent(INVALID_HANDLE_VALUE)
, mCompleted(FALSE)
{
diff --git a/drv/UserBuffer.h b/drv/UserBuffer.h
index c402998..967f015 100644
--- a/drv/UserBuffer.h
+++ b/drv/UserBuffer.h
@@ -38,7 +38,7 @@ public:
UserBuffer(
DWORD dwAccessFlags,
T lpSrcUnmarshalled,
- DWORD dwSize = sizeof(*(reinterpret_cast<T>(1))));
+ DWORD dwSize);
~UserBuffer();
BOOL Valid() const;
T UserPtr();
--
1.7.9
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel