We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d719097 commit 56a18a5Copy full SHA for 56a18a5
SharpPcap/LibPcap/LibPcapSafeNativeMethods.Encoding.cs
@@ -91,8 +91,6 @@ public IntPtr MarshalManagedToNative(object managedObj)
91
}
92
var str = (string)managedObj;
93
var bytes = StringEncoding.GetBytes(str);
94
- // The problem is that we need a reference to the StringBuilder in MarshalNativeToManaged
95
- // So we get a pointer to it with GCHandle, and put it as prefix of the pointer we return
96
var ptr = Marshal.AllocHGlobal(bytes.Length + 1);
97
Marshal.Copy(bytes, 0, ptr, bytes.Length);
98
// Put zero string termination
0 commit comments