public static byte[] ParseString_r(IntPtr ptr)
{
List<byte> stringArray = new List<byte>();
if (AdapterHelper.Transport.ToLower(System.Globalization.CultureInfo.CurrentCulture) != "mapi_http")
{
IntPtr szaPtr = new IntPtr(Marshal.ReadInt32(ptr));
if (szaPtr == IntPtr.Zero)
{
return null;
}
ptr = szaPtr;
}
int offsetOfszA = 0;
byte curValueOfszA = 0;
ArrayList listOfszA = new ArrayList();
while (Marshal.ReadByte(ptr, offsetOfszA) != '\0')
{
curValueOfszA = Marshal.ReadByte(ptr, offsetOfszA);
offsetOfszA++;
listOfszA.Add(curValueOfszA);
}
for (int i = 0; i < listOfszA.Count; i++)
{
stringArray.Add(byte.Parse(listOfszA[i].ToString()));
}
return stringArray.ToArray();
}