[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[DotGNU]Errors in UnmanagedMarshal
From: |
Marcus |
Subject: |
[DotGNU]Errors in UnmanagedMarshal |
Date: |
Sun, 8 Aug 2004 01:02:53 -0500 |
User-agent: |
KMail/1.6.91 |
I think that there are a couple of errors UnmanagedMarshal.ToBytes():
if(elemCount < 0x80)
{
bytes = new byte [1]; <-- shouldn't this be "new byte [2]"?
bytes[0] = (byte)type;
bytes[1] = (byte)elemCount;
}
else if(elemCount < 0x4000)
{
bytes = new byte [2]; <-- shouldn't this be new bytes [3]"?
bytes[0] = (byte)type;
bytes[1] = (byte)((elemCount >> 8) | 0x80);
bytes[2] = (byte)(elemCount & 0xFF);
}
- [DotGNU]Errors in UnmanagedMarshal,
Marcus <=