diff -Naur old-src/jcifs/dcerpc/DcerpcBinding.java src/jcifs/dcerpc/DcerpcBinding.java
--- old-src/jcifs/dcerpc/DcerpcBinding.java 2007-01-22 17:21:18.000000000 -0800
+++ src/jcifs/dcerpc/DcerpcBinding.java 2007-03-20 10:33:47.000000000 -0700
@@ -32,6 +32,7 @@
         INTERFACES = new HashMap();
         INTERFACES.put("srvsvc", srvsvc.getSyntax());
         INTERFACES.put("lsarpc", lsarpc.getSyntax());
+        INTERFACES.put("eventlog", eventlog.getSyntax());
     }
 
     String proto;
diff -Naur old-src/jcifs/dcerpc/msrpc/eventlog.idl src/jcifs/dcerpc/msrpc/eventlog.idl
--- old-src/jcifs/dcerpc/msrpc/eventlog.idl 1969-12-31 16:00:00.000000000 -0800
+++ src/jcifs/dcerpc/msrpc/eventlog.idl 2007-03-20 10:33:47.000000000 -0700
@@ -0,0 +1,148 @@
+[
+   uuid("82273fdc-e32a-18c3-3f78-827929dc23ea"),
+   version(0.0),
+]
+interface eventlog
+{
+   typedef bitmap {
+       EVENTLOG_SEQUENTIAL_READ = 0x0001,
+       EVENTLOG_SEEK_READ       = 0x0002,
+       EVENTLOG_FORWARDS_READ   = 0x0004,
+       EVENTLOG_BACKWARDS_READ  = 0x0008
+   } EventlogReadFlags;
+
+   typedef bitmap {
+       EVENTLOG_SUCCESS          = 0x0000,
+       EVENTLOG_ERROR_TYPE       = 0x0001,
+       EVENTLOG_WARNING_TYPE     = 0x0002,
+       EVENTLOG_INFORMATION_TYPE = 0x0004,
+       EVENTLOG_AUDIT_SUCCESS    = 0x0008,
+       EVENTLOG_AUDIT_FAILURE    = 0x0010
+   } EventlogEventTypes;
+
+   typedef struct {
+       uint16 unknown0;
+       uint16 unknown1;
+   } EventlogOpenUnknown0;
+
+   typedef [public] struct {
+       uint32 size;
+       uint32 reserved;
+       uint32 record_number;
+       uint32 time_generated;
+       uint32 time_written;
+       uint32 event_id;
+       uint16 event_type;
+       uint16 num_of_strings;
+       uint16 event_category;
+       uint16 reserved_flags;
+       uint32 closing_record_number;
+       uint32 stringoffset;
+       uint32 sid_length;
+       uint32 sid_offset;
+       uint32 data_length;
+       uint32 data_offset;
+       nstring source_name;
+       nstring computer_name;
+       nstring strings[num_of_strings];
+       astring raw_data;
+   } EventlogRecord;
+
+   [op(0x00)]
+   NTSTATUS eventlog_ClearEventLogW(
+       [in] policy_handle *handle,
+       [in,unique] lsa_String *unknown
+   );
+
+   [op(0x01)]
+   NTSTATUS eventlog_BackupEventLogW();
+
+   [op(0x02)]
+   NTSTATUS eventlog_CloseEventLog(
+       [in,out] policy_handle *handle
+   );
+
+   [op(0x03)]
+   NTSTATUS eventlog_DeregisterEventSource();
+
+   [op(0x04)]
+   NTSTATUS eventlog_GetNumRecords(
+       [in] policy_handle *handle,
+       [out] uint32 *number
+   );
+
+   [op(0x05)]
+   NTSTATUS eventlog_GetOldestRecord();
+
+   [op(0x06)]
+   NTSTATUS eventlog_ChangeNotify();
+
+   [op(0x07)]
+   NTSTATUS eventlog_OpenEventLogW(
+       [in,unique]         eventlog_OpenUnknown0 *unknown0,
+       [in]        lsa_String logname,
+       [in]        lsa_String servername,
+       [in]        uint32 unknown2,
+       [in]        uint32 unknown3,
+       [out]   policy_handle *handle
+   );
+
+   [op(0x08)]
+   NTSTATUS eventlog_RegisterEventSourceW();
+
+   [op(0x09)]
+   NTSTATUS eventlog_OpenBackupEventLogW();
+
+   [op(0x0a)]
+   NTSTATUS eventlog_ReadEventLogW(
+       [in] policy_handle *handle,
+       [in] uint32 flags,
+       [in] uint32 offset,
+       [in] uint32 number_of_bytes,
+       [out,size_is(number_of_bytes)] uint8 *data,
+       [out] uint32 *sent_size,
+       [out] uint32 *real_size
+   );
+
+   [op(0x0b)]
+   NTSTATUS eventlog_ReportEventW();
+
+   [op(0x0c)]
+   NTSTATUS eventlog_ClearEventLogA();
+
+   [op(0x0d)]
+   NTSTATUS eventlog_BackupEventLogA();
+
+   [op(0x0e)]
+   NTSTATUS eventlog_OpenEventLogA();
+
+   [op(0x0f)]
+   NTSTATUS eventlog_RegisterEventSourceA();
+
+   [op(0x10)]
+   NTSTATUS eventlog_OpenBackupEventLogA();
+
+   [op(0x11)]
+   NTSTATUS eventlog_ReadEventLogA();
+
+   [op(0x12)]
+   NTSTATUS eventlog_ReportEventA();
+
+   [op(0x13)]
+   NTSTATUS eventlog_RegisterClusterSvc();
+
+   [op(0x14)]
+   NTSTATUS eventlog_DeregisterClusterSvc();
+
+   [op(0x15)]
+   NTSTATUS eventlog_WriteClusterEvents();
+                
+   [op(0x16)]
+   NTSTATUS eventlog_GetLogIntormation();
+
+   [op(0x17)]
+   NTSTATUS eventlog_FlushEventLog(
+       [in] policy_handle *handle
+   );
+}
+
diff -Naur old-src/jcifs/dcerpc/msrpc/eventlog.java src/jcifs/dcerpc/msrpc/eventlog.java
--- old-src/jcifs/dcerpc/msrpc/eventlog.java    1969-12-31 16:00:00.000000000 -0800
+++ src/jcifs/dcerpc/msrpc/eventlog.java    2007-03-20 10:33:47.000000000 -0700
@@ -0,0 +1,464 @@
+package jcifs.dcerpc.msrpc;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import jcifs.dcerpc.DcerpcMessage;
+import jcifs.dcerpc.rpc;
+import jcifs.dcerpc.ndr.NdrBuffer;
+import jcifs.dcerpc.ndr.NdrException;
+import jcifs.dcerpc.ndr.NdrObject;
+
+public class eventlog {
+
+   public static String getSyntax() {
+       return "82273fdc-e32a-18c3-3f78-827929dc23ea:0.0";
+   }
+
+   public static final int EVENTLOG_SEQUENTIAL_READ = 0x0001;
+
+   public static final int EVENTLOG_SEEK_READ = 0x0002;
+
+   public static final int EVENTLOG_FORWARDS_READ = 0x0004;
+
+   public static final int EVENTLOG_BACKWARDS_READ = 0x0008;
+
+   public static final int EVENTLOG_SUCCESS = 0x0000;
+
+   public static final int EVENTLOG_ERROR_TYPE = 0x0001;
+
+   public static final int EVENTLOG_WARNING_TYPE = 0x0002;
+
+   public static final int EVENTLOG_INFORMATION_TYPE = 0x0004;
+
+   public static final int EVENTLOG_AUDIT_SUCCESS = 0x0008;
+
+   public static final int EVENTLOG_AUDIT_FAILURE = 0x0010;
+
+   public static class EventlogOpenUnknown0 extends NdrObject {
+
+       public short unknown0;
+
+       public short unknown1;
+
+       public void encode(NdrBuffer _dst) throws NdrException {
+           _dst.align(4);
+           _dst.enc_ndr_short(unknown0);
+           _dst.enc_ndr_short(unknown1);
+       }
+
+       public void decode(NdrBuffer _src) throws NdrException {
+           _src.align(4);
+           unknown0 = (short) _src.dec_ndr_short();
+           unknown1 = (short) _src.dec_ndr_short();
+       }
+   }
+
+   public static class sid_t extends NdrObject {
+
+       public byte revision;
+
+       public byte[] identifier_authority;
+
+       public int[] sub_authority;
+
+       public void encode(NdrBuffer _dst) throws NdrException {
+           _dst.enc_ndr_small(revision);
+           _dst.enc_ndr_small(sub_authority.length);
+           for (int i = 0; i < 6; i++) {
+               _dst.enc_ndr_small(identifier_authority[i]);
+           }
+           for (int i = 0; i < sub_authority.length; i++) {
+               _dst.enc_ndr_long_noalign(sub_authority[i]);
+           }
+       }
+
+       public void decode(NdrBuffer _src) throws NdrException {
+           revision = (byte) _src.dec_ndr_small();
+           int sub_authority_count = (byte) _src.dec_ndr_small();
+
+           identifier_authority = new byte[6];
+           for (int i = 0; i < 6; i++) {
+               identifier_authority[i] = (byte) _src.dec_ndr_small();
+           }
+           sub_authority = new int[sub_authority_count];
+           for (int i = 0; i < sub_authority_count; i++) {
+               sub_authority[i] = (int) _src.dec_ndr_long_noalign();
+           }
+       }
+
+       public String toString() {
+           StringBuffer sb = new StringBuffer();
+           long ia;
+           ia = (identifier_authority[5]) + (identifier_authority[4] << 8)
+                   + (identifier_authority[3] << 16)
+                   + (identifier_authority[2] << 24);
+           sb.append("S-").append(revision).append("-").append(ia);
+           for (int i = 0; i < sub_authority.length; i++) {
+               sb.append("-").append(sub_authority[i]);
+           }
+           return sb.toString();
+       }
+   }
+
+   public static class EventlogRecord extends NdrObject {
+       public int size;
+
+       public int reserved;
+
+       public int record_number;
+
+       public Date time_generated;
+
+       public Date time_written;
+
+       public int event_id;
+
+       public short event_type;
+
+       public short event_category;
+
+       public short reserved_flags;
+
+       public int closing_record_number;
+
+       public eventlog.sid_t sid;
+
+       public String source_name;
+
+       public String computer_name;
+
+       public String[] strings;
+
+       public byte[] raw_data;
+
+       public void encode(NdrBuffer _dst) throws NdrException {
+           int size = 0, size_offset = 0, size_offset2 = 0;
+           int stringoffset = 0, stringoffset_offset = 0;
+           int sid_length = 0, sid_length_offset = 0;
+           int sid_offset = 0, sid_offset_offset = 0;
+           int data_offset = 0, data_offset_offset = 0;
+           size_offset = _dst.getIndex();
+           _dst.enc_ndr_long(size);
+           _dst.enc_ndr_long(reserved);
+           _dst.enc_ndr_long(record_number);
+           _dst.enc_ndr_long(time_generated == null ? 0
+                   : (int) (time_generated.getTime() / 1000));
+           _dst.enc_ndr_long(time_written == null ? 0 : (int) (time_written
+                   .getTime() / 1000));
+           _dst.enc_ndr_long(event_id);
+           _dst.enc_ndr_short(event_type);
+           _dst.enc_ndr_short(strings == null ? 0 : strings.length);
+           _dst.enc_ndr_short(event_category);
+           _dst.enc_ndr_short(reserved_flags);
+           _dst.enc_ndr_long(closing_record_number);
+           stringoffset_offset = _dst.getIndex();
+           _dst.enc_ndr_long(stringoffset);
+           sid_length_offset = _dst.getIndex();
+           _dst.enc_ndr_long(sid_length);
+           sid_offset_offset = _dst.getIndex();
+           _dst.enc_ndr_long(sid_offset);
+           _dst.enc_ndr_long(raw_data == null ? 0 : raw_data.length);
+           data_offset_offset = _dst.getIndex();
+           _dst.enc_ndr_long(data_offset);
+           _dst.enc_ndr_string(source_name);
+           _dst.enc_ndr_string(computer_name);
+           sid_offset = _dst.getIndex();
+           if (sid != null) {
+               sid.encode(_dst);
+               sid_length = _dst.getIndex() - sid_offset;
+           }
+           stringoffset = _dst.getIndex();
+           if (strings != null && strings.length > 0) {
+               for (int i = 0; i < strings.length; i++) {
+                   _dst.enc_ndr_string(strings[i]);
+               }
+           }
+           data_offset = _dst.getIndex();
+           if (raw_data != null && raw_data.length > 0) {
+               _dst.writeOctetArray(raw_data, 0, raw_data.length);
+           }
+           size_offset2 = _dst.getIndex();
+           _dst.enc_ndr_long(size);
+           size = _dst.getIndex() - size_offset;
+           // Write information back.
+           _dst.setIndex(size_offset);
+           _dst.enc_ndr_long(size);
+           _dst.setIndex(stringoffset_offset);
+           _dst.enc_ndr_long(stringoffset);
+           _dst.setIndex(sid_length_offset);
+           _dst.enc_ndr_long(sid_length);
+           _dst.setIndex(sid_offset_offset);
+           _dst.enc_ndr_long(sid_offset);
+           _dst.setIndex(data_offset_offset);
+           _dst.enc_ndr_long(data_offset);
+           _dst.setIndex(size_offset2);
+           _dst.enc_ndr_long(size);
+       }
+
+       public void decode(NdrBuffer _src) throws NdrException {
+           int cur_offset = _src.getIndex();
+           size = _src.dec_ndr_long();
+           reserved = _src.dec_ndr_long();
+           record_number = _src.dec_ndr_long();
+           long tmp = 0;
+           tmp = _src.dec_ndr_long();
+           time_generated = new Date(tmp * 1000);
+           tmp = _src.dec_ndr_long();
+           time_written = new Date(tmp * 1000);
+           event_id = _src.dec_ndr_long();
+           event_type = (short) _src.dec_ndr_short();
+           int num_of_strings = _src.dec_ndr_short();
+           event_category = (short) _src.dec_ndr_short();
+           reserved_flags = (short) _src.dec_ndr_short();
+           closing_record_number = _src.dec_ndr_long();
+           int stringoffset = _src.dec_ndr_long();
+           int sid_length = _src.dec_ndr_long();
+           int sid_offset = _src.dec_ndr_long();
+           int data_length = _src.dec_ndr_long();
+           int data_offset = _src.dec_ndr_long();
+           source_name = _src.dec_ndr_unistring();
+           computer_name = _src.dec_ndr_unistring();
+           if (sid_length > 0) {
+               _src.setIndex(cur_offset + sid_offset);
+               if (sid == null) {
+                   sid = new eventlog.sid_t();
+               }
+               sid.decode(_src);
+           } else {
+               sid = null;
+           }
+           if (num_of_strings > 0) {
+               _src.setIndex(cur_offset + stringoffset);
+               strings = new String[num_of_strings];
+               for (int i = 0; i < strings.length; i++) {
+                   strings[i] = _src.dec_ndr_unistring();
+               }
+           } else {
+               strings = new String[0];
+           }
+           if (data_length > 0) {
+               _src.setIndex(cur_offset + data_offset);
+               raw_data = new byte[data_length];
+               _src.readOctetArray(raw_data, 0, data_length);
+           } else {
+               raw_data = new byte[0];
+           }
+           _src.setIndex(cur_offset + size);
+       }
+   }
+
+   public static class EventlogClearEventLog extends DcerpcMessage {
+
+       public int getOpnum() {
+           return 0x00;
+       }
+
+       public int retval;
+
+       public rpc.policy_handle handle;
+
+       public rpc.unicode_string backupFile;
+
+       public EventlogClearEventLog(rpc.policy_handle handle,
+               rpc.unicode_string backupfile) {
+           this.handle = handle;
+           this.backupFile = backupfile;
+           retval = -1;
+       }
+
+       public void encode_in(NdrBuffer _dst) throws NdrException {
+           handle.encode(_dst);
+           backupFile.encode(_dst);
+       }
+
+       public void decode_out(NdrBuffer _src) throws NdrException {
+           retval = (int) _src.dec_ndr_long();
+       }
+   }
+
+   public static class EventLogCloseEventLog extends DcerpcMessage {
+       public int getOpnum() {
+           return 0x02;
+       }
+
+       public int retval;
+
+       public rpc.policy_handle handle;
+
+       public EventLogCloseEventLog(rpc.policy_handle handle) {
+           this.handle = handle;
+           ptype = 0;
+           retval = -1;
+       }
+
+       public void encode_in(NdrBuffer _dst) throws NdrException {
+           handle.encode(_dst);
+       }
+
+       public void decode_out(NdrBuffer _src) throws NdrException {
+           handle.decode(_src);
+           retval = (int) _src.dec_ndr_long();
+       }
+   }
+
+   public static class EventLogGetNumRecords extends DcerpcMessage {
+       public int getOpnum() {
+           return 0x04;
+       }
+
+       public int numberOfRecords;
+
+       public int retval;
+
+       public rpc.policy_handle handle;
+
+       public EventLogGetNumRecords(rpc.policy_handle handle) {
+           this.handle = handle;
+           ptype = 0;
+           retval = -1;
+       }
+
+       public void encode_in(NdrBuffer _dst) throws NdrException {
+           handle.encode(_dst);
+       }
+
+       public void decode_out(NdrBuffer _src) throws NdrException {
+           numberOfRecords = (int) _src.dec_ndr_long();
+           retval = (int) _src.dec_ndr_long();
+       }
+   }
+
+   public static class EventLogGetOldestEntry extends DcerpcMessage {
+       public int getOpnum() {
+           return 0x05;
+       }
+
+       public int oldestEntryNumber;
+
+       public int retval;
+
+       public rpc.policy_handle handle;
+
+       public EventLogGetOldestEntry(rpc.policy_handle handle) {
+           this.handle = handle;
+           ptype = 0;
+           retval = -1;
+       }
+
+       public void encode_in(NdrBuffer _dst) throws NdrException {
+           handle.encode(_dst);
+       }
+
+       public void decode_out(NdrBuffer _src) throws NdrException {
+           oldestEntryNumber = (int) _src.dec_ndr_long();
+           retval = (int) _src.dec_ndr_long();
+       }
+   }
+
+   public static class EventLogOpenEventLog extends DcerpcMessage {
+       public int getOpnum() {
+           return 0x07;
+       }
+
+       public rpc.unicode_string logname;
+
+       public rpc.unicode_string servername;
+
+       public int retval;
+
+       public rpc.policy_handle handle;
+
+       public EventLogOpenEventLog(rpc.unicode_string logname,
+               rpc.unicode_string servername) {
+           this.logname = logname;
+           this.servername = servername;
+           ptype = 0;
+           retval = -1;
+       }
+
+       public void encode_in(NdrBuffer _dst) throws NdrException {
+           _dst.align(8);
+           _dst.enc_ndr_long(0xf000baaa);
+           _dst.enc_ndr_short(0x64);
+           _dst.enc_ndr_short(0x01);
+           logname.encode(_dst);
+           servername.encode(_dst);
+           // _dst.align(4);
+           _dst.enc_ndr_long(0x01);
+           _dst.enc_ndr_long(0x01);
+       }
+
+       public void decode_out(NdrBuffer _src) throws NdrException {
+           if (handle == null) {
+               handle = new rpc.policy_handle();
+           }
+           handle.decode(_src);
+           retval = (int) _src.dec_ndr_long();
+       }
+   }
+
+   public static class EventLogReadEventLog extends DcerpcMessage {
+       public int getOpnum() {
+           return 0x0a;
+       }
+
+       public int retval;
+
+       public int flags;
+
+       public int offset;
+
+       public int maxReadSize;
+
+       public int bytesInNextRecords;
+
+       public List entries;
+
+       public int sent_size;
+
+       public int real_size;
+
+       public rpc.policy_handle handle;
+
+       public EventLogReadEventLog(rpc.policy_handle handle, int flags,
+               int offset, int maxReadSize) {
+           this.handle = handle;
+           this.flags = flags;
+           this.offset = offset;
+           this.maxReadSize = maxReadSize;
+           ptype = 0;
+           retval = -1;
+       }
+
+       public void encode_in(NdrBuffer _dst) throws NdrException {
+           _dst.align(8);
+           handle.encode(_dst);
+           _dst.enc_ndr_long(flags);
+           _dst.enc_ndr_long(offset);
+           _dst.enc_ndr_long(maxReadSize);
+       }
+
+       public void decode_out(NdrBuffer _src) throws NdrException {
+           int bytesInResponse = 0, curOffset = 0, bytesTotal = 0;
+           bytesInResponse = _src.dec_ndr_long();
+           curOffset = _src.getIndex();
+           _src.setIndex(curOffset + bytesInResponse);
+           sent_size = _src.dec_ndr_long();
+           real_size = _src.dec_ndr_long();
+           retval = (int) _src.dec_ndr_long();
+           _src.setIndex(curOffset);
+           while (bytesTotal < sent_size) {
+               if (entries == null) {
+                   entries = new ArrayList();
+               }
+               EventlogRecord entry = new EventlogRecord();
+               entry.decode(_src);
+               entries.add(entry);
+               bytesTotal += entry.size;
+           }
+       }
+   }
+}
+
diff -Naur old-src/jcifs/dcerpc/ndr/NdrBuffer.java src/jcifs/dcerpc/ndr/NdrBuffer.java
--- old-src/jcifs/dcerpc/ndr/NdrBuffer.java 2007-01-22 17:21:18.000000000 -0800
+++ src/jcifs/dcerpc/ndr/NdrBuffer.java 2007-03-20 10:41:37.000000000 -0700
@@ -120,33 +120,51 @@
     }
     public void enc_ndr_short(int s) {
         align(2);
+        enc_ndr_small_noalign(s);
+    }
+    public void enc_ndr_small_noalign(int s) {
         Encdec.enc_uint16le((short)s, buf, index);
         advance(2);
     }
     public int dec_ndr_short() {
         align(2);
+        return dec_ndr_short_noalign();
+    }
+    public int dec_ndr_short_noalign() {
         int val = Encdec.dec_uint16le(buf, index);
         advance(2);
         return val;
     }
     public void enc_ndr_long(int l) {
         align(4);
+        enc_ndr_long_noalign(l);
+    }
+    public void enc_ndr_long_noalign(int l) {
         Encdec.enc_uint32le(l, buf, index);
         advance(4);
     }
     public int dec_ndr_long() {
         align(4);
+        return dec_ndr_long_noalign();
+    }
+    public int dec_ndr_long_noalign() {
         int val = Encdec.dec_uint32le(buf, index);
         advance(4);
         return val;
     }
     public void enc_ndr_hyper(long h) {
         align(8);
+        enc_ndr_hyper_noalign(h);
+    }
+    public void enc_ndr_hyper_noalign(long h) {
         Encdec.enc_uint64le(h, buf, index);
         advance(8);
     }
     public long dec_ndr_hyper() {
         align(8);
+        return dec_ndr_hyper_noalign();
+    }
+    public long dec_ndr_hyper_noalign() {
         long val = Encdec.dec_uint64le(buf, index);
         advance(8);
         return val;
@@ -155,6 +173,9 @@
     /* double */
     public void enc_ndr_string(String s) {
         align(4);
+        enc_ndr_string_noalign(s);
+    }
+    public void enc_ndr_string_noalign(String s) {
         int i = index;
         int len = s.length();
         Encdec.enc_uint32le(len + 1, buf, i); i += 4;
@@ -171,6 +192,9 @@
     }
     public String dec_ndr_string() throws NdrException {
         align(4);
+        return dec_ndr_string_noalign();
+    }
+    public String dec_ndr_string_noalign() throws NdrException {
         int i = index;
         String val = null;
         int len = Encdec.dec_uint32le(buf, i);
@@ -188,6 +212,67 @@
         advance(i - index);
         return val;
     }
+
+    /**
+     * Encode a string into unicode format. It's not UNISTR2 format, doesn't
+     * include length and so on. Just string in UnicodeLittleUnmarked format.
+     * Been used by eventlog APIs.
+     * 
+     * @param s
+     *            The string that need to encode.
+     */
+    public void enc_ndr_unistring(String s) {
+        align(2);
+        enc_ndr_unistring_noalign(s);
+    }
+    public void enc_ndr_unistring_noalign(String s) {
+        int i = index;
+        int len = s.length();
+        try {
+            System.arraycopy(s.getBytes("UnicodeLittleUnmarked"), 0, buf, i,
+                    len * 2);
+        } catch (UnsupportedEncodingException uee) {
+        }
+        i += len * 2;
+        buf[i++] = (byte) '\0';
+        buf[i++] = (byte) '\0';
+        advance(i - index);
+    }
+
+    /**
+     * Decode a unicode string. It's not UNISTR2 format, doesn't include length
+     * and so on. Just string in UnicodeLittleUnmarked format. Been used by
+     * eventlog APIs.
+     * 
+     * @return decoded java string object.
+     */
+    public String dec_ndr_unistring() throws NdrException {
+        align(2);
+        return dec_ndr_unistring_noalign();
+    }
+    public String dec_ndr_unistring_noalign() throws NdrException {
+        int i = index;
+        String val = null;
+        int tmp;
+        int len = 0;
+        do {
+            tmp = dec_ndr_short();
+            len++;
+        } while (tmp != 0);
+        if (len != 0) {
+            len--;
+            int size = len * 2;
+            try {
+                if (size < 0 || size > 0xFFFF)
+                    throw new NdrException(NdrException.INVALID_CONFORMANCE);
+                val = new String(buf, i, size, "UnicodeLittleUnmarked");
+                i += size + 2;
+            } catch (UnsupportedEncodingException uee) {
+            }
+        }
+        advance(i - index);
+        return val;
+    }
     private int getDceReferent(Object obj) {
         Entry e;
 
diff -Naur old-src/jcifs/dcerpc/UnicodeString.java src/jcifs/dcerpc/UnicodeString.java
--- old-src/jcifs/dcerpc/UnicodeString.java 2007-01-22 17:21:18.000000000 -0800
+++ src/jcifs/dcerpc/UnicodeString.java 2007-03-20 10:33:47.000000000 -0700
@@ -27,20 +27,24 @@
         this.zterm = zterm;
     }
     public UnicodeString(rpc.unicode_string rus, boolean zterm) {
-        this.length = rus.length;
-        this.maximum_length = rus.maximum_length;
-        this.buffer = rus.buffer;
+        this.length = rus == null ? 0 : rus.length;
+        this.maximum_length = rus == null ? 0 : rus.maximum_length;
+        this.buffer = rus == null ? null : rus.buffer;
         this.zterm = zterm;
     }
 
     public UnicodeString(String str, boolean zterm) {
         this.zterm = zterm;
 
-        int len = str.length();
+        int len = str == null ? 0 : str.length();
         int zt = zterm ? 1 : 0;
 
         length = maximum_length = (short)((len + zt) * 2);
-        buffer = new short[len + zt];
+        if (str != null) {
+            buffer = new short[len + zt];
+        } else {
+            buffer = null;
+        }
 
         int i;
         for (i = 0; i < len; i++) {
diff -Naur old-src/jcifs/smb/NtStatus.java src/jcifs/smb/NtStatus.java
--- old-src/jcifs/smb/NtStatus.java 2007-01-22 17:21:18.000000000 -0800
+++ src/jcifs/smb/NtStatus.java 2007-03-20 10:33:47.000000000 -0700
@@ -33,6 +33,7 @@
     public static final int NT_STATUS_INVALID_PARAMETER = 0xC000000d;
     public static final int NT_STATUS_NO_SUCH_DEVICE = 0xC000000e;
     public static final int NT_STATUS_NO_SUCH_FILE = 0xC000000f;
+    public static final int NT_STATUS_END_OF_FILE = 0xC0000011;
     public static final int NT_STATUS_ACCESS_DENIED = 0xC0000022;
     public static final int NT_STATUS_BUFFER_TOO_SMALL = 0xC0000023;
     public static final int NT_STATUS_OBJECT_NAME_INVALID = 0xC0000033;
@@ -87,6 +88,7 @@
         NT_STATUS_INVALID_PARAMETER,
         NT_STATUS_NO_SUCH_DEVICE,
         NT_STATUS_NO_SUCH_FILE,
+        NT_STATUS_END_OF_FILE,
         NT_STATUS_ACCESS_DENIED,
         NT_STATUS_BUFFER_TOO_SMALL,
         NT_STATUS_OBJECT_NAME_INVALID,
@@ -142,6 +144,7 @@
         "The parameter is incorrect.",
         "The system cannot find the file specified.",
         "The system cannot find the file specified.",
+        "Reached end of file.",
         "Access is denied.",
         "The data area passed to a system call is too small.",
         "The filename, directory name, or volume label syntax is incorrect.",
