MCPcopy Create free account
hub / github.com/axhlzy/Il2CppHookScripts / synchronizationContext

Method synchronizationContext

Il2cppHook/_Ufunc.js:12344–12367  ·  view source on GitHub ↗

@internal

()

Source from the content-addressed store, hash-verified

12342 }
12343 /** @internal */
12344 get synchronizationContext() {
12345 const get_ExecutionContext = this.object.tryMethod("GetMutableExecutionContext") || this.object.method("get_ExecutionContext");
12346 let synchronizationContext = get_ExecutionContext.invoke().tryMethod("get_SynchronizationContext")?.invoke();
12347 if (synchronizationContext == null) {
12348 const SystemThreadingSynchronizationContext = Il2Cpp.Image.corlib.class("System.Threading.SynchronizationContext");
12349 for (let i = 0; i < 16; i++) {
12350 try {
12351 const candidate = new Il2Cpp.Object(this.staticData
12352 .add(Process.pointerSize * i)
12353 .readPointer()
12354 .readPointer());
12355 if (candidate.class.isSubclassOf(SystemThreadingSynchronizationContext, false)) {
12356 synchronizationContext = candidate;
12357 break;
12358 }
12359 }
12360 catch (e) { }
12361 }
12362 }
12363 if (synchronizationContext == null) {
12364 (0, console_1.raise)("couldn't retrieve the SynchronizationContext for this thread.");
12365 }
12366 return synchronizationContext;
12367 }
12368 /** Detaches the thread from the application domain. */
12369 detach() {
12370 return Il2Cpp.Api._threadDetach(this);

Callers

nothing calls this directly

Calls 5

isSubclassOfMethod · 0.80
tryMethodMethod · 0.45
methodMethod · 0.45
invokeMethod · 0.45
classMethod · 0.45

Tested by

no test coverage detected