X-Spam-Check-By: sourceware.org From: "R. Steve McKown" To: cygwin AT cygwin DOT com Subject: Re: Trouble with DLL and file (com port) IO Date: Thu, 7 Dec 2006 12:10:53 -0700 User-Agent: KMail/1.8.2 Cc: "Dave Korn" References: <014e01c71a19$da11e960$a501a8c0 AT CAM DOT ARTIMI DOT COM> In-Reply-To: <014e01c71a19$da11e960$a501a8c0@CAM.ARTIMI.COM> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Message-Id: <200612071210.53715.rsmckown@yahoo.com> X-Virus-Status: Clean X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id kB7JCcfR000768 On Thursday 07 December 2006 09:07 am, Dave Korn wrote: > On 07 December 2006 15:54, R. Steve McKown wrote: > > On Wednesday 06 December 2006 03:13 pm, Dave Korn wrote: > >> On 06 December 2006 17:01, R. Steve McKown wrote: > >>> Th extension accepts a file descriptor to an open serial port, uses the > >>> cygwin get_osfhandle() function to get the corresponding HANDLE, calls > >>> the DLL function, then returns.  When run, python core dumps somewhere > >>> between ... > >> > >> Go research what those decorations actually signify. Here's some > >> terms to help get you started at Google: cdecl, stdcall, fastcall. > >> Actually, nevermind google, you may as well go straight to MSDN. > > > > The dll header file defines the functions using the WINAPI definition, > > which appears to map to __stdcall, so I thought the compiler already had > > the right information in this regard. I'll research over at MSDN; thank > > you. > > It's about a hundred-to-one on that what's going on here is a > disagreement between caller and callee about whose job it is to clean up > the stack. And it was. I had defined a typedef for casting the function pointer returned from dlsym(), and it did not carry the proper call attributes. The test code is now working. Thanks for the assist! > >> The only other obvious mistake was spamming everyone on the list with > >> a couple of hundred kb of completely useless crud ... > > > > I posted an apology and a correction within 10 minutes after posting an > > attachment containing build products, which caused its massive size. I > > can't blame you for busting my chops anyway; it was a bone-headed > > oversight. > > For the avoidance of doubt: that paragraph was meant to be read to > oneself whilst imagining a bemused tone of voice, rather than a harsh and > aggressive one. > > However, if you do it again, I'll drop a hippo on you! 8^D Best, Steve -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/