public static void debugserver_encode_string(string buffer, out string encodedBuffer, ref uint encodedLength) { System.Runtime.InteropServices.ICustomMarshaler encodedBufferMarshaler = NativeStringMarshaler.GetInstance(null); System.IntPtr encodedBufferNative = System.IntPtr.Zero; DebugServerNativeMethods.debugserver_encode_string(buffer, out encodedBufferNative, ref encodedLength); encodedBuffer = ((string)encodedBufferMarshaler.MarshalNativeToManaged(encodedBufferNative)); encodedBufferMarshaler.CleanUpNativeData(encodedBufferNative); }
/// <summary> /// Encodes a string into hex notation. /// </summary> /// <param name="buffer"> /// String to encode into hex notiation /// </param> /// <param name="encoded_buffer"> /// The buffer receives a hex encoded string /// </param> /// <param name="encoded_length"> /// Length of the hex encoded string /// </param> public virtual void debugserver_encode_string(string buffer, out string encodedBuffer, ref uint encodedLength) { DebugServerNativeMethods.debugserver_encode_string(buffer, out encodedBuffer, ref encodedLength); }