sprintf/wsprintf Replacement

  Are you thinking about using wsprintf method to create a string buffer? Think twice before doing anything wrong! MSDN documentation explicitly warns programmers to not use this API. So, what alternative we can use instead? sstream header gives us wstringstream class to create our own string streams. It’s easy, convenient and object oriented. Let’s…


Avoid Manual Memory Management

  This post is all about how to avoid freeing a memory block that is allocated by us manually. Attempting to free the allocations manually may result in memory leaks, access violations, unreadable code, and maintenance problems. For example, look at the below code piece: Do you see the problem(s) here ? Anytime something goes…


Remove MAX_PATH Limitations

  As technology advances, applications increase their complexity. As a result, installers deploy more and more files and folders to the install directories.  Software developers should not rely on the Window’s MAX_PATH constant when developing their applications. Many Windows APIs don’t support file paths that are longer than MAX_PATH in length directly. However, they do…

2

Debugging Process Crashes

  Did I tell you Windbg is a great tool to debug native processes ? However, we still have to know how to approach the problem. Today, I wanted to debug user mode process crash. When I see a crash, I generally start the process under windbg and run the following command from debugger command…