seh

Windows32 API: “mov edi,edi” on function entry?

我怕爱的太早我们不能终老 提交于 2020-01-24 17:33:48
问题 I'm stepping through Structured Error Handling recovery code in Windows 7 (e.g, what happens after SEH handler is done and passes back "CONTINUE" code). Here's a function which is called: 7783BD9F mov edi,edi 7783BDA1 push ebp 7783BDA2 mov ebp,esp 7783BDA4 push 1 7783BDA6 push dword ptr [ebp+0Ch] 7783BDA9 push dword ptr [ebp+8] 7783BDAC call 778692DF 7783BDB1 pop ebp 7783BDB2 ret 8 I'm used to the function prolog of "push ebp/mov ebp,esp". What's the purpose of the "mov edi,edi"? 回答1: Raymond

What are the consequences of mixing exception handling models in Visual Studio 2010?

不羁岁月 提交于 2020-01-22 19:41:21
问题 I have third-party static library built with Enable C++ Exceptions set to No ( /EH flag not specified). What are the consequences to calling into it from code built with C++ exceptions enabled ( /EHa )? If a Structured Exception is thrown from within the library, will the function provided to _set_se_translator by the main application be reliably called? (My experiments show that it will, but just wondering if this is defined behavior). Are there any other considerations when mixing /EH

What are the consequences of mixing exception handling models in Visual Studio 2010?

江枫思渺然 提交于 2020-01-22 19:40:12
问题 I have third-party static library built with Enable C++ Exceptions set to No ( /EH flag not specified). What are the consequences to calling into it from code built with C++ exceptions enabled ( /EHa )? If a Structured Exception is thrown from within the library, will the function provided to _set_se_translator by the main application be reliably called? (My experiments show that it will, but just wondering if this is defined behavior). Are there any other considerations when mixing /EH

intermixing c++ exception handling and SEH (windows)

点点圈 提交于 2020-01-01 03:36:11
问题 I have a function in which I call getaddrinfo() to get an sockaddr* which targets memory is allocated by the system. As many may know, you need to call freeaddrinfo() to free the memory allocated by getaddrinfo(). Now, in my function, there are a few places, where I may throw an exception, because some function failed. My first solution was to incorporate the freeaddrinfo() into every if-block. But that did look ugly for me, because I would have had to call it anyways before my function

SEHException not caught by Try/Catch

£可爱£侵袭症+ 提交于 2019-12-28 16:53:13
问题 In a background thread, my application regularly examines a network folder (UNC Path) for application updates. It reads out the assembly version of the file, like so: Try newVers = System.Reflection.AssemblyName.GetAssemblyName("\\server\app.exe").Version Catch ex As Exception ' ignore End Try This snippet is executed quite often, in total I'd guess way more than 100.000 times on multiple customer sites so far without a problem. Sometimes, GetAssemblyName raises a FileNotFoundException , for

Different seh filtering in x86 and x64

99封情书 提交于 2019-12-24 21:20:51
问题 I am implementing logging of error message (It includes information of exception backtrace). I asked similar question how to do this at Reliable way to print exception backtrace in catch handler?. I decided to check out callstacks at x86 and x64 platforms. Result of stack comparisons surprised me. Here is my program: #include <iostream> #include <Windows.h> using namespace std; struct A { }; void foo3() { throw A(); } void foo2() { foo3(); } void foo1() { foo2(); } void foo() { try { foo1();

Issue with exceptions being caught by Win32 message dispatcher

﹥>﹥吖頭↗ 提交于 2019-12-22 08:54:34
问题 This is kinda a very low-level type question, but maybe someone here has some insight... I'm having an issue where unhandled SEH exceptions (such as Access Violations) are seemingly being caught at the Win32 message dispatch level, rather than terminating the program. I found the following reference blog, which explains the problem, but in the context of WM_TIMER messages only: http://bugswar.blogspot.com/2010/07/why-its-not-crashing.html I'm experiencing the issue with Win 2008R2, and on

Enable Safe Exception Handling in C++ Builder

孤者浪人 提交于 2019-12-22 03:09:31
问题 For Windows 8 application certification, there are (among other) these requirements: 3.2 Your app must be compiled using the /SafeSEH flag to ensure safe exceptions handling 3.3 Your app must be compiled using the /NXCOMPAT flag to prevent data execution 3.4 Your app must be compiled using the /DYNAMICBASE flag for address space layout randomization (ASLR) I wasn't able to find out how to enable either of these in C++Builder XE. For /NXCOMPAT and /DYNAMICBASE , one can use editbin.exe from VS

Is ARM (not Thumb) supported on WinPhone8 at all?

僤鯓⒐⒋嵵緔 提交于 2019-12-18 09:38:22
问题 I'm facing a weird issue, somewhat similar to this. I have a Windows Phone 8 native DLL project, mostly C++ but with an ARM assembly source in it. The source is in ARM mode (i. e. not Thumb). C++ is compiled to Thumb. The app crashes when C++ tries to call into an assembly routine. The call command in the disassembly is BLX with an immediate offset - it's supposed to switch mode back to ARM, unconditionally, but somehow it doesn't. I have the details of the exception. The exception code is

Visual C++ Unmanaged Code: Use /EHa or /EHsc for C++ exceptions?

微笑、不失礼 提交于 2019-12-17 23:07:25
问题 If I'm creating a new project in unmanaged C++, Visual Studio 2008 or greater, which exception handling model do I want to go with? I understand that /EHa option results in less efficient code, and also catches SEH exceptions, right? So I have been steering clear of that option and typically going with /EHsc, so that I'm only catching C++ exceptions that are actually thrown and not catching access violations and other structured execptions, in catch(...) handlers. If there is an access