How ignore any exception in DEBUG_EVENT and continue?
I have a code in my service application that execute a determinated process on SYSTEM account and in debug mode via CreateProcessAsUser
.
The trouble is that debugged process stop for example when Google Chrome is opened or debugged process executes a great number of tasks simultaneously.
I think that the main trouble is the lack of "ignore any exception in debug and continue"..
Any help or suggestion will welcome.
int Stop = 0;
DEBUG_EVENT DebugEv = { 0 };
DWORD dwContinueStatus = DBG_CONTINUE;
while (!Stop)
{
WaitForDebugEvent(&DebugEv, INFINITE);
switch (DebugEv.dwDebugEventCode)
{
case EXCEPTION_DEBUG_EVENT:
switch (DebugEv.u.Exception.ExceptionRecord.ExceptionCode)
{
case EXCEPTION_ACCESS_VIOLATION:
break;
case EXCEPTION_BREAKPOINT:
break;
case EXCEPTION_DATATYPE_MISALIGNMENT:
break;
case EXCEPTION_SINGLE_STEP:
break;
case DBG_CONTROL_C:
break;
default:
break;
}
case CREATE_THREAD_DEBUG_EVENT:
break;
case CREATE_PROCESS_DEBUG_EVENT:
if (DebugEv.u.CreateProcessInfo.hFile)
CloseHandle(DebugEv.u.CreateProcessInfo.hFile);
break;
case EXIT_THREAD_DEBUG_EVENT:
break;
case EXIT_PROCESS_DEBUG_EVENT:
Stop = 1;
break;
case LOAD_DLL_DEBUG_EVENT:
if (DebugEv.u.LoadDll.hFile)
CloseHandle(DebugEv.u.LoadDll.hFile);
break;
case UNLOAD_DLL_DEBUG_EVENT:
break;
case OUTPUT_DEBUG_STRING_EVENT:
break;
}
ContinueDebugEvent(DebugEv.dwProcessId, DebugEv.dwThreadId, dwContinueStatus);
}
c++ winapi visual-studio-2013 windows-services createprocessasuser
|
show 4 more comments
I have a code in my service application that execute a determinated process on SYSTEM account and in debug mode via CreateProcessAsUser
.
The trouble is that debugged process stop for example when Google Chrome is opened or debugged process executes a great number of tasks simultaneously.
I think that the main trouble is the lack of "ignore any exception in debug and continue"..
Any help or suggestion will welcome.
int Stop = 0;
DEBUG_EVENT DebugEv = { 0 };
DWORD dwContinueStatus = DBG_CONTINUE;
while (!Stop)
{
WaitForDebugEvent(&DebugEv, INFINITE);
switch (DebugEv.dwDebugEventCode)
{
case EXCEPTION_DEBUG_EVENT:
switch (DebugEv.u.Exception.ExceptionRecord.ExceptionCode)
{
case EXCEPTION_ACCESS_VIOLATION:
break;
case EXCEPTION_BREAKPOINT:
break;
case EXCEPTION_DATATYPE_MISALIGNMENT:
break;
case EXCEPTION_SINGLE_STEP:
break;
case DBG_CONTROL_C:
break;
default:
break;
}
case CREATE_THREAD_DEBUG_EVENT:
break;
case CREATE_PROCESS_DEBUG_EVENT:
if (DebugEv.u.CreateProcessInfo.hFile)
CloseHandle(DebugEv.u.CreateProcessInfo.hFile);
break;
case EXIT_THREAD_DEBUG_EVENT:
break;
case EXIT_PROCESS_DEBUG_EVENT:
Stop = 1;
break;
case LOAD_DLL_DEBUG_EVENT:
if (DebugEv.u.LoadDll.hFile)
CloseHandle(DebugEv.u.LoadDll.hFile);
break;
case UNLOAD_DLL_DEBUG_EVENT:
break;
case OUTPUT_DEBUG_STRING_EVENT:
break;
}
ContinueDebugEvent(DebugEv.dwProcessId, DebugEv.dwThreadId, dwContinueStatus);
}
c++ winapi visual-studio-2013 windows-services createprocessasuser
you continue copy-paste the same wrong and very not efficient code. which here not related to your question
– RbMm
Jan 19 at 14:54
@RbMm, the part relative toCreateProcessAsUser()
works fine, i posted in case someone want execute a complete code. The trouble is with the debug stretch.
– Davison
Jan 19 at 16:11
work disgusting. for whatSetTokenInformation
which is always failed for example. for what winlogon.exe search and so on.
– RbMm
Jan 19 at 17:18
2
if you not handle exception - you must returnDBG_EXCEPTION_NOT_HANDLED
– RbMm
Jan 19 at 17:23
1
if you not handle exception incase EXCEPTION_DEBUG_EVENT:
– RbMm
Jan 19 at 17:26
|
show 4 more comments
I have a code in my service application that execute a determinated process on SYSTEM account and in debug mode via CreateProcessAsUser
.
The trouble is that debugged process stop for example when Google Chrome is opened or debugged process executes a great number of tasks simultaneously.
I think that the main trouble is the lack of "ignore any exception in debug and continue"..
Any help or suggestion will welcome.
int Stop = 0;
DEBUG_EVENT DebugEv = { 0 };
DWORD dwContinueStatus = DBG_CONTINUE;
while (!Stop)
{
WaitForDebugEvent(&DebugEv, INFINITE);
switch (DebugEv.dwDebugEventCode)
{
case EXCEPTION_DEBUG_EVENT:
switch (DebugEv.u.Exception.ExceptionRecord.ExceptionCode)
{
case EXCEPTION_ACCESS_VIOLATION:
break;
case EXCEPTION_BREAKPOINT:
break;
case EXCEPTION_DATATYPE_MISALIGNMENT:
break;
case EXCEPTION_SINGLE_STEP:
break;
case DBG_CONTROL_C:
break;
default:
break;
}
case CREATE_THREAD_DEBUG_EVENT:
break;
case CREATE_PROCESS_DEBUG_EVENT:
if (DebugEv.u.CreateProcessInfo.hFile)
CloseHandle(DebugEv.u.CreateProcessInfo.hFile);
break;
case EXIT_THREAD_DEBUG_EVENT:
break;
case EXIT_PROCESS_DEBUG_EVENT:
Stop = 1;
break;
case LOAD_DLL_DEBUG_EVENT:
if (DebugEv.u.LoadDll.hFile)
CloseHandle(DebugEv.u.LoadDll.hFile);
break;
case UNLOAD_DLL_DEBUG_EVENT:
break;
case OUTPUT_DEBUG_STRING_EVENT:
break;
}
ContinueDebugEvent(DebugEv.dwProcessId, DebugEv.dwThreadId, dwContinueStatus);
}
c++ winapi visual-studio-2013 windows-services createprocessasuser
I have a code in my service application that execute a determinated process on SYSTEM account and in debug mode via CreateProcessAsUser
.
The trouble is that debugged process stop for example when Google Chrome is opened or debugged process executes a great number of tasks simultaneously.
I think that the main trouble is the lack of "ignore any exception in debug and continue"..
Any help or suggestion will welcome.
int Stop = 0;
DEBUG_EVENT DebugEv = { 0 };
DWORD dwContinueStatus = DBG_CONTINUE;
while (!Stop)
{
WaitForDebugEvent(&DebugEv, INFINITE);
switch (DebugEv.dwDebugEventCode)
{
case EXCEPTION_DEBUG_EVENT:
switch (DebugEv.u.Exception.ExceptionRecord.ExceptionCode)
{
case EXCEPTION_ACCESS_VIOLATION:
break;
case EXCEPTION_BREAKPOINT:
break;
case EXCEPTION_DATATYPE_MISALIGNMENT:
break;
case EXCEPTION_SINGLE_STEP:
break;
case DBG_CONTROL_C:
break;
default:
break;
}
case CREATE_THREAD_DEBUG_EVENT:
break;
case CREATE_PROCESS_DEBUG_EVENT:
if (DebugEv.u.CreateProcessInfo.hFile)
CloseHandle(DebugEv.u.CreateProcessInfo.hFile);
break;
case EXIT_THREAD_DEBUG_EVENT:
break;
case EXIT_PROCESS_DEBUG_EVENT:
Stop = 1;
break;
case LOAD_DLL_DEBUG_EVENT:
if (DebugEv.u.LoadDll.hFile)
CloseHandle(DebugEv.u.LoadDll.hFile);
break;
case UNLOAD_DLL_DEBUG_EVENT:
break;
case OUTPUT_DEBUG_STRING_EVENT:
break;
}
ContinueDebugEvent(DebugEv.dwProcessId, DebugEv.dwThreadId, dwContinueStatus);
}
c++ winapi visual-studio-2013 windows-services createprocessasuser
c++ winapi visual-studio-2013 windows-services createprocessasuser
edited Jan 19 at 17:22
Davison
asked Jan 19 at 14:38
DavisonDavison
1058
1058
you continue copy-paste the same wrong and very not efficient code. which here not related to your question
– RbMm
Jan 19 at 14:54
@RbMm, the part relative toCreateProcessAsUser()
works fine, i posted in case someone want execute a complete code. The trouble is with the debug stretch.
– Davison
Jan 19 at 16:11
work disgusting. for whatSetTokenInformation
which is always failed for example. for what winlogon.exe search and so on.
– RbMm
Jan 19 at 17:18
2
if you not handle exception - you must returnDBG_EXCEPTION_NOT_HANDLED
– RbMm
Jan 19 at 17:23
1
if you not handle exception incase EXCEPTION_DEBUG_EVENT:
– RbMm
Jan 19 at 17:26
|
show 4 more comments
you continue copy-paste the same wrong and very not efficient code. which here not related to your question
– RbMm
Jan 19 at 14:54
@RbMm, the part relative toCreateProcessAsUser()
works fine, i posted in case someone want execute a complete code. The trouble is with the debug stretch.
– Davison
Jan 19 at 16:11
work disgusting. for whatSetTokenInformation
which is always failed for example. for what winlogon.exe search and so on.
– RbMm
Jan 19 at 17:18
2
if you not handle exception - you must returnDBG_EXCEPTION_NOT_HANDLED
– RbMm
Jan 19 at 17:23
1
if you not handle exception incase EXCEPTION_DEBUG_EVENT:
– RbMm
Jan 19 at 17:26
you continue copy-paste the same wrong and very not efficient code. which here not related to your question
– RbMm
Jan 19 at 14:54
you continue copy-paste the same wrong and very not efficient code. which here not related to your question
– RbMm
Jan 19 at 14:54
@RbMm, the part relative to
CreateProcessAsUser()
works fine, i posted in case someone want execute a complete code. The trouble is with the debug stretch.– Davison
Jan 19 at 16:11
@RbMm, the part relative to
CreateProcessAsUser()
works fine, i posted in case someone want execute a complete code. The trouble is with the debug stretch.– Davison
Jan 19 at 16:11
work disgusting. for what
SetTokenInformation
which is always failed for example. for what winlogon.exe search and so on.– RbMm
Jan 19 at 17:18
work disgusting. for what
SetTokenInformation
which is always failed for example. for what winlogon.exe search and so on.– RbMm
Jan 19 at 17:18
2
2
if you not handle exception - you must return
DBG_EXCEPTION_NOT_HANDLED
– RbMm
Jan 19 at 17:23
if you not handle exception - you must return
DBG_EXCEPTION_NOT_HANDLED
– RbMm
Jan 19 at 17:23
1
1
if you not handle exception in
case EXCEPTION_DEBUG_EVENT:
– RbMm
Jan 19 at 17:26
if you not handle exception in
case EXCEPTION_DEBUG_EVENT:
– RbMm
Jan 19 at 17:26
|
show 4 more comments
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54268171%2fhow-ignore-any-exception-in-debug-event-and-continue%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54268171%2fhow-ignore-any-exception-in-debug-event-and-continue%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
you continue copy-paste the same wrong and very not efficient code. which here not related to your question
– RbMm
Jan 19 at 14:54
@RbMm, the part relative to
CreateProcessAsUser()
works fine, i posted in case someone want execute a complete code. The trouble is with the debug stretch.– Davison
Jan 19 at 16:11
work disgusting. for what
SetTokenInformation
which is always failed for example. for what winlogon.exe search and so on.– RbMm
Jan 19 at 17:18
2
if you not handle exception - you must return
DBG_EXCEPTION_NOT_HANDLED
– RbMm
Jan 19 at 17:23
1
if you not handle exception in
case EXCEPTION_DEBUG_EVENT:
– RbMm
Jan 19 at 17:26