This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Repost: lock/unlock filechannel Win32 implementation (patch file)
- From: Mohan Embar <gnustuff at thisiscool dot com>
- To: Michele Sandri <gpointorama at gmail dot com>
- Cc: Andrew Haley <aph at redhat dot com>, java-patches at gcc dot gnu dot org
- Date: Fri, 26 Jan 2007 23:14:07 -0600
- Subject: Re: Repost: lock/unlock filechannel Win32 implementation (patch file)
- Reply-to: gnustuff at thisiscool dot com
Hi Michele,
If you:
- fix the layout as Andrew mentioned
- change this:
+ DWORD errnum = GetLastError();
+ LPTSTR perrmsg = NULL;
+
+ if(FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM,0,errnum,0,(LPTSTR)&perrmsg,0,NULL))
+ {
+ jstring jerrstr= JvNewStringLatin1(perrmsg);
+ LocalFree(perrmsg);
+ throw new IOException(jerrstr);
+ }
+ else
+ throw new IOException(JvNewStringLatin1("UnlockFileEx() failed!"));
...to this (in both lock() and unlock()):
_Jv_ThrowIOException(GetLastError())
..then I'll apply this to 4.2 and apply it (if Tom says it's okay) if it passes
a couple of simple tests. Thanks in advance.
-- Mohan
http://www.thisiscool.com/
http://www.animalsong.org/