IntelliTrace

1. Introduction 2. How it works : a. Events and Call Information b. Recordings – iTrace file c. Capturing Events d. Specify modules e. Intellitrace Window f. Navigation Bar g. Running the trace file 3. Tips 4. Summary   1. Introduction Most developers are familiar with Visual Studio debugger. Up to Visual Studio 2008, you have…

0

Adding a Configuration file for a VC++ DLL

Background   A VC++ application will fail to run if the required Visual C++ runtime libraries are not present on the target operating system (machine).  It’s the manifest of the executable used by the operating system loader to load assemblies that your application depends on.  Any C/C++ program built by Visual C++ 2005/2008 has to include…

1

Investigating a GSCookie Corruption

GSCookie helps in finding buffer overrun cases on the stack and terminates the application when this is detected. In the .NET environment this would happen when calling into a native function when the function overrides the buffer on the stack corrupting the GSCookie put in place. Here is a similar case. I have a sample…

0

Troubleshooting MFC state related issues

In this article we will be talking about MFC Module state and Thread state , and how do we troubleshoot issues related to Module state mismatch. Why MFC dll does needs a module-specific state? Well reason is MFC is a shared dll, it needs to be shared between various modules (dlls\exe) that are linked with…

4

P/Invoke Marshal.StructuretoPtr

In this blog I am going to talk about Marshal.StructuretoPtr , especially its last parameter fDeleteOld. Although its msdn description is pretty concise but I have seen it to be a source of confusion a lot of times. Following is what it says: fDeleteOld Type: System..::.Booleantrue to have the Marshal..::.DestroyStructure method called on the ptr…

7

Porting C++ native code to managed (/clr) – Threads

In native world, one interacts with OS directly by calling Win32 APIs for managing resources (like allocating/deallocating memory,opening/closing handles). In managed world one  relies on CLR totally or at times partially for doing the same( eg GC does memory management for us).Due to lack of understanding of the way CLR does the work for us,  we may at times conclude…

1

Stack Corruption: Calling convention mismatch

Stack is one of the most widely understood data structures in computer science. It is a general purpose data structure and is a part of most of modern day computer architectures as well. In the context of a thread running in an executing process, “the stack” is the memory specifically given to that thread for…

4

X86,x64,IA64,Any CPU

When a managed application is built on Visual Studio , we get four options to choose for a platform  .Lets discuss these options in detail . 1)x86 X86 is the generic name for all Intel x86 32 bit architectures.  If you build your application using x86 switch , your binary will run as 32 bit…

0