Table of Contents

Method OpenForDirectAccess

Namespace
Microsoft.Samples.Debugging.Native
Assembly
NativeDebugWrappers.dll

OpenForDirectAccess()

Used to lock the buffer and get a raw pointer to it. This is the only way to change the entire context at once. This is useful for pinvoking to native functions.

public IContextDirectAccessor OpenForDirectAccess()

Returns

IContextDirectAccessor

context writer object

Remarks

Expected usage would be (in C# syntax): IContext c = NativeContextAllocator.Alloc(); using(IContextWriter w = c.OpenForDirectAccess) { // context buffer is now locked SomeNativeFunctionToGetThreadContext(w.RawBuffer, w.Size); } // w is disposed, this unlocks the context buffer.