The MIPS R4000, part 14: Common patterns
Okay, now that we see how function calls work, we can demonstrate some common code sequences. If you are debugging through MIPS code, you'll need to be able to recognize these different types of...
View ArticleThe MIPS R4000, part 15: Code walkthrough
Today we're going to take a relatively small function and watch what the compiler did with it. The function is this guy from the C runtime library, although I've simplified it a bit to avoid some...
View ArticleThe early history of redundant function pointer casts: MakeProcInstance
If you look through old code, you see a lot of redundant function pointer casts. (If you're writing new code, you should get rid of as many function pointer casts as possible, because a function...
View ArticleIt rather involved being on the other side of this airtight hatchway: Passing...
A customer reported a vulnerability in a kernel function, let's call it kfunc. The kernel-mode kfunc function doesn't validate any of the pointers passed to it. As a result, you can pass anything you...
View ArticleMicrospeak: Tented
Here's a citation for the Microspeak term tented from an old Microsoft job listing that is no longer available, maybe because the req has been filled. You and your team will decide how the Office...
View ArticleHow can I have my program execute some code only if run from the Visual...
A customer wanted their program to operate in a special mode if it is being debugged from inside the Visual Studio development environment. Say, if being run from Visual Studio via the "Start with...
View ArticleA cute hidden message in a image to entertain you while you wait
In one of the internal Microsoft special-interest group mailing lists, someone pointed out that the Windows 10 Mail app contains a cute hidden message: Hold on while we fetch your email. Hint: The...
View ArticleI don’t know how I managed to be presenting at the same conference as Dona...
Dona Sarkar is an aspiring fashion designer, a fashion blogger, a book author, and head of the Windows Insiders program. She's also way cooler than I will ever be. Here's her proposed title slide for...
View ArticleThe seasoned pianist’s guide to musical collaborators
The wife of one of my relatives is a classical pianist. She shared with me her hot takes on musicians she collaborates with.¹ Violinists tune forever. Her husband is a casual violin player. Their...
View ArticleWindows 10 virtual desktops are a window management feature, not a security...
I was baffled by the question " How do program settings work in virtual desktops?" because it never occurred to me that people would consider virtual desktops to be some sort of secure program...
View ArticleHow to avoid accessing freed memory when canceling a thread pool callback
The Windows thread pool is convenient, but one tricky part is how to remove items from the thread pool. This discussion applies to all the thread pool objects, but I'll use thread pool timers for...
View ArticleAvoiding deadlocks when cancelling a thread pool callback, part 1: External...
We saw last time how to use the thread pool cleanup functions to manage the lifetime of the context data. But if the callback function tries to call into the thread that is calling...
View ArticleAvoiding deadlocks when cancelling a thread pool callback, part 2: Referring...
Last time, we looked at the case where the context for the callback is some data that isn't part of the containing object. However, most of the time, the context for the callback is the object that...
View ArticleSee you at Build 2018 next week
I'll be at the Build conference next week. Here's my schedule so far: Monday Attending Dona Sarkar (and some other guy)'s talk with the great title slide at 4:00pm. After that, I'll be at the Sets...
View ArticleAfter all, it’s called a hotkey, not a hotcharacter
A customer was writing a remote access program, and they were having trouble injecting hotkeys into the system. We are sending the modified key as a scan code, and the base character as a Unicode...
View ArticleMicrospeak: ZBB, recall class, glide path, and RTM
Remember that Microspeak is not merely for terminology specific to Microsoft. It also covers terms in common use which you are expected to know because nobody will explain them to you. In an old...
View ArticleWhy does my shortcut to a nonexistent file end up with spaces changed to...
A customer wanted to create shortcuts to a network drive that hadn't yet been mapped. The idea is that they would create these shortcuts pointing at a network drive N: and deploy them. When the user...
View ArticleOn the difficulty of getting pixel-perfect layout in Win32 dialog templates
A customer was having trouble getting their dialog box template to produce exactly what they wanted. Our designer has specified the UI design in pixels. When we created a dialog box using DLU units in...
View ArticleWhy can’t FindWindowEx find another program’s window by name?
A customer had a test app that did something. They then wanted to write a test harness for their test app. The idea is that the test harness launches the test app, finds the test app's Start button,...
View ArticleFor a brief period, Windows 95 could run Windows 3.1 in a virtual machine
As the Windows 95 project started to come together, I was approached to undertake a special project: Run Windows 3.1 in an MS-DOS virtual machine inside Windows 95. This was the ultimate in backward...
View Article