') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); OwnershipTransfer by jtschuster · Pull Request #2 · jtschuster/GeneratedCode · GitHub
Skip to content

Large diffs are not rendered by default.

Original file line numberDiff line numberDiff line change
Expand Up@@ -55,7 +55,7 @@ file unsafe partial interface InterfaceImplementation
internal static int ABI_Get(System.Runtime.InteropServices.ComWrappers.ComInterfaceDispatch* __this_native, sbyte* __invokeRetValUnmanaged__param)
{
global::SharedTypes.ComInterfaces.IBool @this = default;
ref sbyte __invokeRetValUnmanaged = ref *__invokeRetValUnmanaged__param;
sbyte __invokeRetValUnmanaged__out = default;
bool __invokeRetVal = default;
int __retVal = default;
try
Expand All@@ -65,11 +65,14 @@ internal static int ABI_Get(System.Runtime.InteropServices.ComWrappers.ComInterf
@this = System.Runtime.InteropServices.ComWrappers.ComInterfaceDispatch.GetInstance<global::SharedTypes.ComInterfaces.IBool>(__this_native);
__invokeRetVal = @this.Get();
// Marshal - Convert managed data to native data.
__invokeRetValUnmanaged = (sbyte)(__invokeRetVal ? 1 : 0);
__invokeRetValUnmanaged__out = (sbyte)(__invokeRetVal ? 1 : 0);
// AssignOut - Assign to parameters
*__invokeRetValUnmanaged__param = __invokeRetValUnmanaged__out;
}
catch (System.Exception __exception)
{
__retVal = System.Runtime.InteropServices.Marshalling.ExceptionAsHResultMarshaller<int>.ConvertToUnmanaged(__exception);
return __retVal;
}

return __retVal;
Expand All@@ -92,6 +95,7 @@ internal static int ABI_Set(System.Runtime.InteropServices.ComWrappers.ComInterf
catch (System.Exception __exception)
{
__retVal = System.Runtime.InteropServices.Marshalling.ExceptionAsHResultMarshaller<int>.ConvertToUnmanaged(__exception);
return __retVal;
}

return __retVal;
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -63,7 +63,7 @@ file unsafe partial interface InterfaceImplementation
internal static int ABI_GetString(System.Runtime.InteropServices.ComWrappers.ComInterfaceDispatch* __this_native, ushort** __invokeRetValUnmanaged__param)
{
global::SharedTypes.ComInterfaces.ICustomStringMarshallingUtf16 @this = default;
ref ushort* __invokeRetValUnmanaged = ref *__invokeRetValUnmanaged__param;
ushort* __invokeRetValUnmanaged__out = default;
string __invokeRetVal = default;
int __retVal = default;
try
Expand All@@ -73,11 +73,16 @@ internal static int ABI_GetString(System.Runtime.InteropServices.ComWrappers.Com
@this = System.Runtime.InteropServices.ComWrappers.ComInterfaceDispatch.GetInstance<global::SharedTypes.ComInterfaces.ICustomStringMarshallingUtf16>(__this_native);
__invokeRetVal = @this.GetString();
// Marshal - Convert managed data to native data.
__invokeRetValUnmanaged = (ushort*)global::System.Runtime.InteropServices.Marshalling.Utf16StringMarshaller.ConvertToUnmanaged(__invokeRetVal);
__invokeRetValUnmanaged__out = (ushort*)global::System.Runtime.InteropServices.Marshalling.Utf16StringMarshaller.ConvertToUnmanaged(__invokeRetVal);
// AssignOut - Assign to parameters
*__invokeRetValUnmanaged__param = __invokeRetValUnmanaged__out;
}
catch (System.Exception __exception)
{
__retVal = System.Runtime.InteropServices.Marshalling.ExceptionAsHResultMarshaller<int>.ConvertToUnmanaged(__exception);
// CleanupFailure - Perform required cleanup.
global::System.Runtime.InteropServices.Marshalling.Utf16StringMarshaller.Free(__invokeRetValUnmanaged__out);
return __retVal;
}

return __retVal;
Expand All@@ -100,6 +105,7 @@ internal static int ABI_SetString(System.Runtime.InteropServices.ComWrappers.Com
catch (System.Exception __exception)
{
__retVal = System.Runtime.InteropServices.Marshalling.ExceptionAsHResultMarshaller<int>.ConvertToUnmanaged(__exception);
return __retVal;
}

return __retVal;
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -111,6 +111,7 @@ internal static int ABI_SetName(System.Runtime.InteropServices.ComWrappers.ComIn
catch (System.Exception __exception)
{
__retVal = System.Runtime.InteropServices.Marshalling.ExceptionAsHResultMarshaller<int>.ConvertToUnmanaged(__exception);
return __retVal;
}

return __retVal;
Expand All@@ -120,7 +121,7 @@ internal static int ABI_SetName(System.Runtime.InteropServices.ComWrappers.ComIn
internal static int ABI_GetName(System.Runtime.InteropServices.ComWrappers.ComInterfaceDispatch* __this_native, ushort** __invokeRetValUnmanaged__param)
{
global::SharedTypes.ComInterfaces.IDerived @this = default;
ref ushort* __invokeRetValUnmanaged = ref *__invokeRetValUnmanaged__param;
ushort* __invokeRetValUnmanaged__out = default;
string __invokeRetVal = default;
int __retVal = default;
try
Expand All@@ -130,11 +131,16 @@ internal static int ABI_GetName(System.Runtime.InteropServices.ComWrappers.ComIn
@this = System.Runtime.InteropServices.ComWrappers.ComInterfaceDispatch.GetInstance<global::SharedTypes.ComInterfaces.IDerived>(__this_native);
__invokeRetVal = @this.GetName();
// Marshal - Convert managed data to native data.
__invokeRetValUnmanaged = (ushort*)global::System.Runtime.InteropServices.Marshalling.Utf16StringMarshaller.ConvertToUnmanaged(__invokeRetVal);
__invokeRetValUnmanaged__out = (ushort*)global::System.Runtime.InteropServices.Marshalling.Utf16StringMarshaller.ConvertToUnmanaged(__invokeRetVal);
// AssignOut - Assign to parameters
*__invokeRetValUnmanaged__param = __invokeRetValUnmanaged__out;
}
catch (System.Exception __exception)
{
__retVal = System.Runtime.InteropServices.Marshalling.ExceptionAsHResultMarshaller<int>.ConvertToUnmanaged(__exception);
// CleanupFailure - Perform required cleanup.
global::System.Runtime.InteropServices.Marshalling.Utf16StringMarshaller.Free(__invokeRetValUnmanaged__out);
return __retVal;
}

return __retVal;
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -129,36 +129,54 @@ internal static int ABI_Next(System.Runtime.InteropServices.ComWrappers.ComInter
{
global::SharedTypes.ComInterfaces.IEnumUnknown @this = default;
object[] rgelt = default;
ref uint __pceltFetched_native = ref *__pceltFetched_native__param;
uint __pceltFetched_native__out = default;
uint pceltFetched = default;
int __retVal = default;
// Setup - Perform required setup.
int __rgelt_native__numElements;
System.Runtime.CompilerServices.Unsafe.SkipInit(out __rgelt_native__numElements);
scoped System.Span<System.IntPtr> __rgelt_native__out = default;
try
{
// Unmarshal - Convert native data to managed data.
__retVal = 0; // S_OK
global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<object, System.IntPtr>.GetManagedValuesDestination(rgelt).Clear();
__rgelt_native__numElements = -1;
rgelt = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<object, System.IntPtr>.AllocateContainerForManagedElements(__rgelt_native, __rgelt_native__numElements);
@this = System.Runtime.InteropServices.ComWrappers.ComInterfaceDispatch.GetInstance<global::SharedTypes.ComInterfaces.IEnumUnknown>(__this_native);
@this.Next(celt, rgelt, out pceltFetched);
// Marshal - Convert managed data to native data.
__pceltFetched_native = pceltFetched;
__pceltFetched_native__out = pceltFetched;
{
__rgelt_native__numElements = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<object, System.IntPtr>.GetManagedValuesDestination(rgelt).Length;
System.Span<System.IntPtr> __rgelt_native__nativeSpan = System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref System.Runtime.CompilerServices.Unsafe.AsRef(in global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<object, System.IntPtr>.GetUnmanagedValuesSource(__rgelt_native, __rgelt_native__numElements).GetPinnableReference()), __rgelt_native__numElements);
__rgelt_native__out = stackalloc System.IntPtr[__rgelt_native__numElements];
System.Span<System.IntPtr> __rgelt_native__nativeSpan = __rgelt_native__out;
System.Span<object> __rgelt_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<object, System.IntPtr>.GetManagedValuesDestination(rgelt);
for (int __i0 = 0; __i0 < __rgelt_native__numElements; ++__i0)
{
void* __rgelt_native__nativeSpan____i0__original = (void*)__rgelt_native__nativeSpan[__i0];
__rgelt_native__nativeSpan[__i0] = (System.IntPtr)(void*)global::System.Runtime.InteropServices.Marshalling.ComInterfaceMarshaller<object>.ConvertToUnmanaged(__rgelt_native__managedSpan[__i0]);
global::System.Runtime.InteropServices.Marshalling.ComInterfaceMarshaller<object>.Free(__rgelt_native__nativeSpan____i0__original);
}
}

// AssignOut - Assign to parameters
*__pceltFetched_native__param = __pceltFetched_native__out;
__rgelt_native__out.CopyTo(System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref System.Runtime.CompilerServices.Unsafe.AsRef(in global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<object, System.IntPtr>.GetUnmanagedValuesSource(__rgelt_native, __rgelt_native__numElements).GetPinnableReference()), __rgelt_native__numElements));
}
catch (System.Exception __exception)
{
__retVal = System.Runtime.InteropServices.Marshalling.ExceptionAsHResultMarshaller<int>.ConvertToUnmanaged(__exception);
// CleanupFailure - Perform required cleanup.
{
System.ReadOnlySpan<System.IntPtr> __rgelt_native__nativeSpan = __rgelt_native__out;
for (int __i0 = 0; __i0 < __rgelt_native__nativeSpan.Length; ++__i0)
{
global::System.Runtime.InteropServices.Marshalling.ComInterfaceMarshaller<object>.Free((void*)__rgelt_native__nativeSpan[__i0]);
}
}

__rgelt_native__numElements = -1;
return __retVal;
}

return __retVal;
Expand All@@ -179,6 +197,7 @@ internal static int ABI_Skip(System.Runtime.InteropServices.ComWrappers.ComInter
catch (System.Exception __exception)
{
__retVal = System.Runtime.InteropServices.Marshalling.ExceptionAsHResultMarshaller<int>.ConvertToUnmanaged(__exception);
return __retVal;
}

return __retVal;
Expand All@@ -199,6 +218,7 @@ internal static int ABI_Reset(System.Runtime.InteropServices.ComWrappers.ComInte
catch (System.Exception __exception)
{
__retVal = System.Runtime.InteropServices.Marshalling.ExceptionAsHResultMarshaller<int>.ConvertToUnmanaged(__exception);
return __retVal;
}

return __retVal;
Expand All@@ -208,7 +228,7 @@ internal static int ABI_Reset(System.Runtime.InteropServices.ComWrappers.ComInte
internal static int ABI_Clone(System.Runtime.InteropServices.ComWrappers.ComInterfaceDispatch* __this_native, void** __ppenum_native__param)
{
global::SharedTypes.ComInterfaces.IEnumUnknown @this = default;
ref void* __ppenum_native = ref *__ppenum_native__param;
void* __ppenum_native__out = default;
global::SharedTypes.ComInterfaces.IEnumUnknown ppenum = default;
int __retVal = default;
try
Expand All@@ -218,11 +238,16 @@ internal static int ABI_Clone(System.Runtime.InteropServices.ComWrappers.ComInte
@this = System.Runtime.InteropServices.ComWrappers.ComInterfaceDispatch.GetInstance<global::SharedTypes.ComInterfaces.IEnumUnknown>(__this_native);
@this.Clone(out ppenum);
// Marshal - Convert managed data to native data.
__ppenum_native = (void*)global::System.Runtime.InteropServices.Marshalling.ComInterfaceMarshaller<global::SharedTypes.ComInterfaces.IEnumUnknown>.ConvertToUnmanaged(ppenum);
__ppenum_native__out = (void*)global::System.Runtime.InteropServices.Marshalling.ComInterfaceMarshaller<global::SharedTypes.ComInterfaces.IEnumUnknown>.ConvertToUnmanaged(ppenum);
// AssignOut - Assign to parameters
*__ppenum_native__param = __ppenum_native__out;
}
catch (System.Exception __exception)
{
__retVal = System.Runtime.InteropServices.Marshalling.ExceptionAsHResultMarshaller<int>.ConvertToUnmanaged(__exception);
// CleanupFailure - Perform required cleanup.
global::System.Runtime.InteropServices.Marshalling.ComInterfaceMarshaller<global::SharedTypes.ComInterfaces.IEnumUnknown>.Free(__ppenum_native__out);
return __retVal;
}

return __retVal;
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -50,7 +50,7 @@ file unsafe partial interface InterfaceImplementation
internal static int ABI_Get(System.Runtime.InteropServices.ComWrappers.ComInterfaceDispatch* __this_native, float* __invokeRetValUnmanaged__param)
{
global::SharedTypes.ComInterfaces.IFloat @this = default;
ref float __invokeRetValUnmanaged = ref *__invokeRetValUnmanaged__param;
float __invokeRetValUnmanaged__out = default;
float __invokeRetVal = default;
int __retVal = default;
try
Expand All@@ -60,11 +60,14 @@ internal static int ABI_Get(System.Runtime.InteropServices.ComWrappers.ComInterf
@this = System.Runtime.InteropServices.ComWrappers.ComInterfaceDispatch.GetInstance<global::SharedTypes.ComInterfaces.IFloat>(__this_native);
__invokeRetVal = @this.Get();
// Marshal - Convert managed data to native data.
__invokeRetValUnmanaged = __invokeRetVal;
__invokeRetValUnmanaged__out = __invokeRetVal;
// AssignOut - Assign to parameters
*__invokeRetValUnmanaged__param = __invokeRetValUnmanaged__out;
}
catch (System.Exception __exception)
{
__retVal = System.Runtime.InteropServices.Marshalling.ExceptionAsHResultMarshaller<int>.ConvertToUnmanaged(__exception);
return __retVal;
}

return __retVal;
Expand All@@ -85,6 +88,7 @@ internal static int ABI_Set(System.Runtime.InteropServices.ComWrappers.ComInterf
catch (System.Exception __exception)
{
__retVal = System.Runtime.InteropServices.Marshalling.ExceptionAsHResultMarshaller<int>.ConvertToUnmanaged(__exception);
return __retVal;
}

return __retVal;
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -50,7 +50,7 @@ file unsafe partial interface InterfaceImplementation
internal static int ABI_GetInt(System.Runtime.InteropServices.ComWrappers.ComInterfaceDispatch* __this_native, int* __invokeRetValUnmanaged__param)
{
global::SharedTypes.ComInterfaces.IGetAndSetInt @this = default;
ref int __invokeRetValUnmanaged = ref *__invokeRetValUnmanaged__param;
int __invokeRetValUnmanaged__out = default;
int __invokeRetVal = default;
int __retVal = default;
try
Expand All@@ -60,11 +60,14 @@ internal static int ABI_GetInt(System.Runtime.InteropServices.ComWrappers.ComInt
@this = System.Runtime.InteropServices.ComWrappers.ComInterfaceDispatch.GetInstance<global::SharedTypes.ComInterfaces.IGetAndSetInt>(__this_native);
__invokeRetVal = @this.GetInt();
// Marshal - Convert managed data to native data.
__invokeRetValUnmanaged = __invokeRetVal;
__invokeRetValUnmanaged__out = __invokeRetVal;
// AssignOut - Assign to parameters
*__invokeRetValUnmanaged__param = __invokeRetValUnmanaged__out;
}
catch (System.Exception __exception)
{
__retVal = System.Runtime.InteropServices.Marshalling.ExceptionAsHResultMarshaller<int>.ConvertToUnmanaged(__exception);
return __retVal;
}

return __retVal;
Expand All@@ -85,6 +88,7 @@ internal static int ABI_SetInt(System.Runtime.InteropServices.ComWrappers.ComInt
catch (System.Exception __exception)
{
__retVal = System.Runtime.InteropServices.Marshalling.ExceptionAsHResultMarshaller<int>.ConvertToUnmanaged(__exception);
return __retVal;
}

return __retVal;
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -38,7 +38,6 @@
finally
{
// Cleanup - Perform required cleanup.
__retVal_native__numElements = 10;
global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.Free(__retVal_native);
}

Expand All@@ -52,7 +51,7 @@ file unsafe partial interface InterfaceImplementation
internal static int ABI_GetInts(System.Runtime.InteropServices.ComWrappers.ComInterfaceDispatch* __this_native, int** __invokeRetValUnmanaged__param)
{
global::SharedTypes.ComInterfaces.IGetIntArray @this = default;
ref int* __invokeRetValUnmanaged = ref *__invokeRetValUnmanaged__param;
int* __invokeRetValUnmanaged__out = default;
int[] __invokeRetVal = default;
int __retVal = default;
// Setup - Perform required setup.
Expand All@@ -65,12 +64,17 @@ internal static int ABI_GetInts(System.Runtime.InteropServices.ComWrappers.ComIn
@this = System.Runtime.InteropServices.ComWrappers.ComInterfaceDispatch.GetInstance<global::SharedTypes.ComInterfaces.IGetIntArray>(__this_native);
__invokeRetVal = @this.GetInts();
// Marshal - Convert managed data to native data.
__invokeRetValUnmanaged = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.AllocateContainerForUnmanagedElements(__invokeRetVal, out __invokeRetValUnmanaged__numElements);
global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetManagedValuesSource(__invokeRetVal).CopyTo(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetUnmanagedValuesDestination(__invokeRetValUnmanaged, __invokeRetValUnmanaged__numElements));
__invokeRetValUnmanaged__out = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.AllocateContainerForUnmanagedElements(__invokeRetVal, out __invokeRetValUnmanaged__numElements);
global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetManagedValuesSource(__invokeRetVal).CopyTo(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetUnmanagedValuesDestination(__invokeRetValUnmanaged__out, __invokeRetValUnmanaged__numElements));
// AssignOut - Assign to parameters
*__invokeRetValUnmanaged__param = __invokeRetValUnmanaged__out;
}
catch (System.Exception __exception)
{
__retVal = System.Runtime.InteropServices.Marshalling.ExceptionAsHResultMarshaller<int>.ConvertToUnmanaged(__exception);
// CleanupFailure - Perform required cleanup.
global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.Free(__invokeRetValUnmanaged__out);
return __retVal;
}

return __retVal;
Expand Down
Loading