On Jun 26, 2007, at 8:24 AM, Mark Modrall wrote:
We’ve cobbled together a 64-bit version of NTEventLogAppender by
changing the handle types to jlong in the jni glue and the cpp and
it seems to work okay. I don’t know what the best/standard way to
make conditional compilation in the jni java; we’ll pass along the
code and the visual studio project if interested.
Thanks
Mark
Filing a bug report and attaching the files would be the best way.
NTEventLogAppender.java uses a int member (_handle) to maintain the
event log handle and uses an int parameter on calls to JNI methods.
That choice is inadequate for Win64, however it is embedded in every
previous version of log4j. If were were to modify
NTEventLogAppender.dll to support Win64, we need to ensure that it
still would work with earlier versions of log4j.
To address the issue, I would suggest:
Changing _handle in NTEventLogAppender.java to long.
Duplicating the definitions of the three native methods in
NTEventLogAppender.java but changing the handle parameter to longs.
Changing the three native methods in nteventlog.cpp to use jlong for
the handle parameter.
Writing proxies for the obsolete native methods that cast the jint
handle parameter up to a jlong and delegate to the modified native
methods.
Writing a build64.xml or buildms.xml which calls rc and cl instead of
windres and gcc.
If you can provide patches for those changes, provide a build64.xml
or buildms.xml and confirm that it works on Win64, then it would be
possible for others to check that it still works on Win32 and the
NTEventLogAppender.dll also works with earlier versions of log4j.
However, if you wanted to test the Win32 and backwards compatibility,
that would be appreciate too.