Dear Team Lead, You Are Not Doing Agile If…

August 30, 2011

…Your sprint planning meeting begins with a condescending description of what The Methodology looks like, and ends with “meet me here at 4PM – you will be assigned tasks and pairs”. …You switch task management tools every week, never failing to surprise your developers and upper management. (Hint: more tools is not necessarily better. Bugs on the whiteboard, tasks in Excel, projects in TFS, and resource scheduling in a custom tool is confusing.) …You have a heterogeneous team with young developers and you don’t do code reviews. (And still, you find the audacity to complain about bugs...

Process Monitor Profiling Support

August 28, 2011

If you’re looking for a very simple profiler that will give you a general idea how CPU utilization is distributed in your system, look no further than the latest version of Process Monitor. Under Tools | Profiling Events, you can enable stack trace collection every second or every 100ms for all running processes. The profiling events have an execution stack, exactly like any other event in Process Monitor, and you can gain a quick impression where CPU time is spent and which call stacks are responsible for it. Here’s an example call stack from...
no comments

VMMap Allocation Profiling and Leak Detection

August 27, 2011

We have already seen VMMap as a tool for inspecting memory utilization and the layout of a process’ virtual address space. The latest VMMap version (rush to download!) ships with a memory allocation profiler for VirtualAlloc() and HeapAlloc() calls. Additionally, the tool can display the allocating call stack for every heap block. Sounds interesting? Here’s how to use it. You launch VMMap, and instead of inspecting an existing process, you tell it to launch and trace another process. (It uses Microsoft Detours to hook allocation APIs and log the information.) Now you exercise your...

Code Smells and Other Problems

August 24, 2011

Here are some Bad ThingsTM I’ve come across during the last few days and felt like sharing with you to let out some steam. These aren’t Coding Horrors per se, but perhaps there is something for all of us to learn here. Bad Naming I tweeted yesterday about a method called WaitForAllRequestsToExecute which doesn’t wait for all the requests to execute. This is one of the many bad things you can do to the maintenance programmer, which may lead to an axe-hunting adventure. (“Always write code as if the maintenance programmer is an axe murderer...
one comment

Walking the Stack Without Symbols and With FPO (Frame Pointer Omission)

August 22, 2011

In the previous post on stack corruptions, we have discussed the case where the stack becomes corrupted but still contains a chain of EBP references which allows for manual reconstruction. (For background reading, see this article on EBP stack reconstruction and calling convention nightmares on x86.) Below is a call stack from an application crash dump. The reported crash was an access violation inside a module called “HelperLibrary” for which we don’t have symbols or source code. The call stack doesn’t look promising: 0:000> kv ChildEBP RetAddr  Args to Child              WARNING: Stack...

Updated Course: Developing Windows Concurrent Applications

August 18, 2011

During the last couple of months, I have been updating the materials of the Developing Windows Concurrent Applications course. It is now an up-to-date four day ILT with lots of labs, demos, design patterns, and other practical materials to help C++ developers write their next great concurrent application for Windows. The target audience is C++ programmers with 1-2 years of experience writing Windows applications, but who haven’t necessarily seen how to create threads, queue work to the thread pool, synchronize access to shared resources, minimize shared operations, throttle the amount of work, and many other things that are...
no comments

Are Workflows Really That Bad? (Hint: Maybe They Aren’t)

August 17, 2011

I was thinking long and hard about whether Windows Workflow Foundation, or any other workflow tool for that matter, can really be used in a large production application for orchestrating large business processes. (Clarification: I’ve been writing a framework for developing such workflows using WF 3.5 and WF 4.0 for the past three years, so I’ll try to speak from experience.) Is it possible to use workflows to orchestrate large business processes without landing in a mass of spaghetti a couple of years later? I believe that the same techniques that need to be applied...
one comment

Baby Steps in Windows Device Driver Development: Part 6, Hiding Processes

August 16, 2011

Last time around, we’ve seen how to do something slightly useful in our driver. This time, we’ll simulate a technique used over ten years ago by Windows kernel rootkits to hide a process from tools such as Task Manager. First, some background: the Windows scheduler doesn’t need process information to run code. The scheduler needs access only to threads—threads ready for execution are stored in a set of ready queues. When a thread enters a wait state, the system tracks its information using _KWAIT_BLOCK structures, which again don’t require access to processes. Still, the system keeps track...

Restart Windows and Restart All Registered Applications: shutdown -g

August 14, 2011

The Windows Restart Manager (introduced in Windows Vista) supports gracefully shutting down and restarting applications that registered for restart with the RegisterApplicationRestart API. This functionality is used by Windows Update – thanks to the Restart Manager, when I come yawning to my desktop PC in the morning, even following a system restart, I have my Outlook, browser windows, OneNote, Visual Studio, and Messenger all lined up as they were when I went to bed. Suppose you want to initiate one of these “automagically restart everything after restart” restarts. As of a few weeks ago, I had it...