win32-process

Deny Access to Kiosk program process

回眸只為那壹抹淺笑 提交于 2021-02-04 17:57:06
问题 I have a kiosk app and have to disable task manager always to prevent closing the program by users . But some users need the TaskManager to close hanging programs. Any help would be appropriated. However, I am sure there is a function in windows to prevent closing a program's process , as when one attempt to kill rundll.exe process. I want to know that function if I can call it with DllImport Can anyone help with a trick? A hack? A function? Any other solution? EDIT: At least if there is not

Can I stop Visual Studio URL decoding Command Arguments in Debug mode?

和自甴很熟 提交于 2021-01-29 05:32:59
问题 If I set my program to echo command arguments and run in Visual Studio debugger with Command Arguments "https%3a%2f%2fas" it will echo 'https://as' However, if I run from the command line 'myprog.exe https%3a%2f%2fas' then it will echo 'https%3a%2f%2fas' Why is it handling this differently, and how can I stop it? I have to pass in an argument that is URL encoded and it needs to not be interpreted by Visual Studio first. Program is C++ and it's Visual Studio 2017 if that is any help. 回答1: Can

Getting the TEB of a 64bit process on WIndows

人盡茶涼 提交于 2020-01-13 17:14:33
问题 I'm trying to get the TEB of a 64 remote thread in Windows 8. Following the definition from here, I do this: sz = sizeof(NTSTATUS) + sizeof(PTEB) + sizeof(HANDLE) + sizeof(HANDLE) + sizeof(ULONG_PTR) + sizeof(LONG) + sizeof(LONG); infoBuff = malloc(sz); stat = NtQueryInformationThread(mainThread, (THREADINFOCLASS) 0, infoBuff, sz, NULL); if (!NT_SUCCESS(stat)) { printf ("ERROR (code 0x%x): Cannot get information about about the main TEB. \n", stat); return 1; } If I compile for 32bit, sz is

Getting the TEB of a 64bit process on WIndows

旧时模样 提交于 2020-01-13 17:13:10
问题 I'm trying to get the TEB of a 64 remote thread in Windows 8. Following the definition from here, I do this: sz = sizeof(NTSTATUS) + sizeof(PTEB) + sizeof(HANDLE) + sizeof(HANDLE) + sizeof(ULONG_PTR) + sizeof(LONG) + sizeof(LONG); infoBuff = malloc(sz); stat = NtQueryInformationThread(mainThread, (THREADINFOCLASS) 0, infoBuff, sz, NULL); if (!NT_SUCCESS(stat)) { printf ("ERROR (code 0x%x): Cannot get information about about the main TEB. \n", stat); return 1; } If I compile for 32bit, sz is

Run process during windows shutdown

点点圈 提交于 2020-01-07 01:30:53
问题 I have a Win32 service, that needs to run a .NET executable on service stop (for cleanup reasons). I recently discovered that the cleanup never happens on shutdown, because the process creation gets blocked by OS. Does anyone know a way to override this? Process, I am spawning is not invasive and should only run a fraction of a second. 回答1: The only way I could find to do it was: pre-create a child process suspended, and them un-suspend it on shutdown. 来源: https://stackoverflow.com/questions

How to restrict/grant read/write access to child process's memory?

泪湿孤枕 提交于 2020-01-06 11:48:58
问题 Is it possible to programmatically adjust a process's privilege so that if it creates a child process at any point later on, it will always(never) have write access to that process's memory? I have created a dll which is loaded by two different processes. At some point in my code I create a process. I have observed that depending upon which process loads my dll, I either have PAGE_EXECUTE_WRITECOPY or 0 access to the child process's memory. My guess is that the loading process must have put

Why is WmiPrvSE.exe holding onto a handle to my Process' Job Object?

心不动则不痛 提交于 2020-01-06 03:00:07
问题 I have a .NET application which spawns multiple child 'worker processes'. I am using the Windows Job Object API and the JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE setting to ensure the child processes always get killed if the parent process is terminated. However, I have observed a number of orphaned processes still running on the machine after the parent has been closed. Using Process Explorer, I can see they are correctly still assigned to the Job, and that the Job has the correct 'Kill on Job

Restart Windows process inplace preserving process ID and handles

喜你入骨 提交于 2020-01-03 05:13:11
问题 I have created a windows executable that serves as a simulaator for some embedded device (all the business logic is exactly the same as on original device and only HW related stuff is stubbed). This simulation needs to reset from time to time, and in "normal" use case it does something like that: //some global environment ... int main(int argc, char* argv[]) { __debugbreak(); //... do some stuff //if( restart needed ){ printf("before _execv"); _execv(argv[0], argv); //"reset" simulated device

Why does my windows program die with its frozen (bluish gray) Forms or windows?

…衆ロ難τιáo~ 提交于 2020-01-02 20:25:15
问题 My delphi program (NOT for .NET) on windows 7 seems to be running for couple of days straight and then the program sort of freezes with all of its windows painted with blueish grey color as if its windows are disabled. You simply don't have control over the program anymore but has to kill its process and start it up again. You don't need to reboot the system itself. Has anyone experience this or anything similar? If so, what did you do to resolve or try to resolve it? Thanks, 回答1: The bluish