I tried to write program which throws BSOD after clicking a button in Delphi, but after clicking button nothing happens, I wonder where I made the mistake, here is the code, I rewrite this answear in Delphi
procedure RtlAdjustPrivilege(var Privilege: Integer; var bEnablePrivilege: Boolean; var IsThreadPrivilege: Boolean; var PreviousValue: PBoolean) stdcall; external 'ntdll.dll' name 'RtlAdjustPrivilege';
procedure NtRaiseHardError(var ErrorStatus: UInt64;var NumberOfParameters: UInt64; var UnicodeStringParameterMask: UInt64; var IntPtr: UInt64; var ValidResponseOption: Uint64; var Response: PLongInt) stdcall; external 'ntdll.dll' name 'NtRaiseHardError';
var bl, a, b: Boolean;
var I: Integer;
var Res: LongInt;
var Pb: PBoolean;
var c, d, e, f, g: UInt64;
var PRes: PLongInt;
procedure TForm4.Button1Click(Sender: TObject);
begin
I := 19;
a := True;
b := False;
Pb := @bl;
RtlAdjustPrivilege(I, a, b, pb);
c := 3221225595;
d := 0;
e := 0;
f := 0;
g := 6;
PRes := @Res;
NtRaiseHardError(c,d,e,f,g, PRes);
end;
After clicking button, program should execute external functions and throw BSOD
New contributor
wzzzawzzz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.