Reputation: 307
I am using simple code Test.c-
#include<stdio.h>
int main()
{
printf("hello\n");
while(1);
}
I am compiling this code by cl.exe compiler and generating Test.exe. Now I there is two way to open Test.exe. First is simple double click and open it. In this condition if I am checking Windbg(File->attach to process), It shows
Session: 1 User: .......
Now if I open Test.exe from cmd with administrative privilege and checking Windbg again, It shows
Error 0xD0000022
I thing this is a error of access violation and this is happening because cmd(admin) process does not allowing some access rights to its child Test.exe and I don't know what are those access rights.
Is there any api to allow access and remove this error. I tried these apis but nothing happening-
GetCurrentProcess(); //to get the pseudo handle of current process
SetSecurityInfo(ph,SE_SERVICE,BACKUP_SECURITY_INFORMATION,NULL,NULL,NULL,NULL);
I also opened safari browser in both ways, same result is coming like Test.exe. Please advise me.
Upvotes: 0
Views: 384
Reputation: 11414
I thing this is a error of access violation and this is happening because cmd(admin) process does not allowing some access rights to its child Test.exe
Not quite. Run WinDBG with admin rights too, then the problem will go away.
Upvotes: 1