Code: Select all
EnableExplicit
Structure BootOrder
BootOrderList.l[128]
EndStructure
Prototype.l ProtoNtQueryBootEntryOrder(Ids.l, Count.l)
Global NtQueryBootEntryOrder.ProtoNtQueryBootEntryOrder
If OpenLibrary(0, "ntdll.dll")
NtQueryBootEntryOrder = GetFunction(0, "NtQueryBootEntryOrder")
EndIf
Procedure Test()
Protected BootOrder.BootOrder, Ids.l, Count.l, tmp.b, State.i
Count = SizeOf(BootOrder)
RtlAdjustPrivilege_(22, 1, 0, @tmp)
State = NtQueryBootEntryOrder(@BootOrder, @Count)
RtlAdjustPrivilege_(22, 0, 0, @tmp)
ProcedureReturn State
EndProcedure
Debug Test()
Define BootOrder.BootOrder, Ids.l, Count.l, tmp.b, State.i
Count = SizeOf(BootOrder)
RtlAdjustPrivilege_(22, 1, 0, @tmp)
State = NtQueryBootEntryOrder(@BootOrder, @Count)
RtlAdjustPrivilege_(22, 0, 0, @tmp)
Debug State