12 messages in net.java.dev.jna.usersRe: [jna-users] Re: GetlastError alwa...
FromSent OnAttachments
Timothy WallAug 7, 2007 7:52 am 
Thomas BörkelAug 8, 2007 5:15 am 
Timothy WallAug 8, 2007 6:35 am 
Thomas BörkelAug 8, 2007 6:45 am 
Kim ValentineAug 8, 2007 7:02 am 
Timothy WallAug 8, 2007 7:26 am 
Timothy WallAug 8, 2007 7:34 am 
Timothy WallAug 8, 2007 7:42 am 
Thomas BörkelAug 8, 2007 8:00 am 
Thomas BörkelAug 8, 2007 8:05 am 
Thomas BörkelAug 8, 2007 8:21 am 
Timothy WallAug 8, 2007 8:50 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [jna-users] Re: GetlastError always returns 0Actions...
From:Timothy Wall (twal@dev.java.net)
Date:Aug 8, 2007 7:42:23 am
List:net.java.dev.jna.users

On Aug 8, 2007, at 10:02 AM, Kim Valentine wrote:

Problem is that other calls to windows API's overwrite the error code. I fund that the following helped 1. Before calling any Windows APIs that set the errorcode call GetLastError, this ensires that jna has aet up the call. 2. Make sure that you retriere the error code immediately after the suspect call. 3. Running the JVM in debug mode always seems to overwrite the errorcode. However even when I had followed all these guidelines I still find that occasionally the errorcode is lost. This occurs in code within a for loop, so the results are not detrministic. I think that under some circumstances the JVM does extra windows calls on the same native thread , but I dont know how to trap or detect them.

Could you provide an example which non-deterministically fails? That way someone else might be able to look at it and hopefully provide some insight.

Thanks T.