diff --git a/Core/InteropServices/PinnedObject.cs b/Core/InteropServices/PinnedObject.cs index 5e088d54..18b2ae14 100644 --- a/Core/InteropServices/PinnedObject.cs +++ b/Core/InteropServices/PinnedObject.cs @@ -41,6 +41,11 @@ namespace Vanara.InteropServices /// The result of the conversion. public static implicit operator IntPtr(PinnedObject ap) => !ap.IsInvalid ? ap.pinnedArray.AddrOfPinnedObject().Offset(ap.mOffset) : IntPtr.Zero; + /// Get an unsafe pointer to the pinned memory of the object with any preset offset. + /// The instance. + /// The result of the conversion. + public static unsafe implicit operator void*(PinnedObject ap) => !ap.IsInvalid ? (void*)ap.pinnedArray.AddrOfPinnedObject().Offset(ap.mOffset) : null; + /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. public void Dispose() {