RtlAdjustPrivilege and NtRaiseHardError
Arsium
mehdi81101 at gmail.com
Mon May 25 13:45:00 UTC 2020
On Sunday, 24 May 2020 at 20:35:58 UTC, novice2 wrote:
>>> "doesn't work" isn't very helpful. Are you seeing compiler
>>> errors? Linker errors? Runtime errors? Please describe your
>>> problem.
>>
>> Solved my problem alone : wrong signatures with functions ;)
>
> and this reply isn't very helpful.
> what is right signature?
> you go to forum to ask help.
> but wish you help to other readers, those will have the ame
> problems?
here is the solved code :
module D_Lang_LowLevelBSOD;
import core.sys.windows.windows;
pragma(lib , "ntdll.lib");
alias extern(C) int function(string[] args) MainFunc;
extern (C) int _d_run_main(int argc, char **argv, MainFunc
mainFunc);
extern (Windows)
int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR
lpCmdLine, int nCmdShow)
{
return _d_run_main(0, null, &main); // arguments unused,
retrieved via CommandLineToArgvW
}
extern(C) int main(string[] args)
{
bool Resp;
uint RespOnse;
int errorCode = 0xC0000022; //you can change it
RtlAdjustPrivilege(19 , true , false , Resp);
NtRaiseHardError(errorCode , 0,0,0,6 , RespOnse );
return 0;
}
extern(Windows) int RtlAdjustPrivilege(int Priv_To_Enable ,bool
Enable , bool WasEnable , out bool response );
extern(Windows) int NtRaiseHardError(int ErrorCode , int n , int
j , int k , int m , out uint respons
More information about the Digitalmars-d-learn
mailing list