The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts
The Gävle Goat (Gävlebocken) succumbs in 2025 to a new menace
You could blow me over.
How can I detect that the system is running low on memory? Or that my job is running low on memory?
You can register for a memory notification.
Why are we worried about memory access semantics? Full barriers should be enough for anybody
You have to find new ways of going faster.
Reading the fine print, episode 4: Holiday promotions
Checking those validity dates.
Why is the last letter of my string not making it to the clipboard?
The struggle for null termination.
Why does my <KBD>Ctrl</KBD>+<KBD>M</KBD> accelerator key activate when I press the <KBD>Enter</KBD> key?
Understanding the difference between keys and characters for accelerators.
When irate product support customers demand to speak to Bill Gates
So transfer them to his office, or so it seems.
All the other cool languages have <CODE>try</CODE>…<CODE>finally</CODE>. C++ says “We have <CODE>try</CODE>…<CODE>finally</CODE> at home.”
The destructor serves as the "finally".
A shortcut gives me a weird path for a program shortcut that doesn’t point to the executable, so what is it?
It's a placeholder because the shortcut is to an MSI application.
Concluding thoughts on our deep dive into Windows clipboard text conversion
Stick to Unicode and you'll be fine.
Deducing the consequences of Windows clipboard text formats on UTF-8
Working out the implications.
Why is the Windows clipboard taking the scenic route when converting from <CODE>CF_<WBR>TEXT</CODE> to <CODE>CF_<WBR>OEMTEXT</CODE>?
Something is forcing it down an alternate path.
Misunderstanding what the Cricket Celebration Bowl is
Apparently, not a bowl of crickets.
The Windows clipboard automatic text conversion algorithm is path-dependent
When the journey is not half of the fun.
Resolving an ambiguity in the Windows clipboard automated text conversion table
Who goes first?
Studying the various locale mismatch scenarios in Windows clipboard text format synthesis
If they don't match, then the 8-bit strings are basically broken already.
How does Windows synthesize the <CODE>CF_<WBR>LOCALE</CODE> clipboard format?
Getting it from a place that might have been obvious in the past, but maybe not today.
How does Windows synthesize <CODE>CF_<WBR>UNICODETEXT</CODE> from <CODE>CF_<WBR>TEXT</CODE> and vice versa?
Let's ask the locale.
How does Windows synthesize <CODE>CF_<WBR>OEMTEXT</CODE> from <CODE>CF_<WBR>TEXT</CODE> and vice versa?
Starting with the easy case, or at least it looks easy.
How can my process read its own standard output?
You'll have to trick yourself before anybody notices, which may not be possible.
How can I read the standard output of an already-running process?
You can't. You'll have to do it before the process starts.
How do I check whether the user has permission to create files in a directory?
Request the directory security attributes that correspond to your proposed operation.
Microspeak: Big rocks
The large obstacles.
How do I get my edit control text to be autoselected when I choose it to be the default focus in my dialog?
Remembering some old APIs.
How can I have a Win32 drop-down combo box with a read-only edit control?
You can ask for its handle and mark it read-only.
Message-only windows are for messaging, not as a convenient victim for hosting UI
If you want to host UI, use a real window (possibly hidden).
At what point in the Windows development cycle is it too late to change the text of a translatable string?
The translation team sets the deadline.
The apocryphal origins of the Hot Dog Stand color scheme
Challenge accepted.
Why does XAML break down when I have an element that is half a billion pixels tall?
You've far exceeded the design goals and have even exceeded the expressive ability of a float.
Maybe somebody can explain to me how weak references solve the ODR problem
I don't see it.
In the commit-on-demand pattern, what happens if an access violation straddles multiple pages?
The access violation exceptions will continue until commit improves.
Is <CODE>WriteProcessMemory</CODE> faster than shared memory for transferring data between two processes?
Shared memory is the copy-free solution.
Microspeak: Little-r
Harkening back to a very old mail program.
How can I detect that Windows is running in S-Mode, redux
Doing it on hard mode.
I can use <CODE>WM_<WBR>COPY<WBR>DATA</CODE> to send a block of data to another window, but how does it send data back?
They can send it back with their own <CODE>WM_<WBR>COPYDATA</CODE> message, or they can put it in an agreed-upon shared location.
Could we use CTAD to simplify the use of WRL’s Callback function?
Not directly, but maybe indirectly.
Non-recursively deleting a binary tree in constant space: Rotating the tree
Preserving in-order while linearizing.
Behind the scenes on how Windows 95 application compatibility patched broken programs
Replacing bytes with the greatest of care.
How did Windows 3.1 distinguish two different programs that happened to share the same executable name?
The trouble with disambiguation.
Non-recursively deleting a binary tree in constant space: Restructuring the tree
Changing the tree structure to make it easier to delete.
Non-recursively deleting a binary tree in constant space: Synthesizing the parent pointer
Making one as you go.
Non-recursively deleting a binary tree in constant space: Traversal with parent pointers
First assume that you have a parent pointer.
The Microsoft SoftCard for the Apple II: Getting two processors to share the same memory
Reportedly Microsoft's first hardware product.
Why does <CODE>SHFormatDateTime</CODE> take an unaligned <CODE>FILETIME</CODE>?
Designed for its original use case.
Microspeak: turn into a pumpkin
To disappear, such as for the year-end holidays.
Trying to build a XAML tree in code throws a “No installed components were detected” exception
An unfortunate error code collision, but the explanatory text leads the way.
What to do when you have a crash in the runtime control flow guard check
You don't have to understand it, but you should be able to extract data from it.
How did the Windows 95 user interface code get brought to the Windows NT code base?
Ported bit by bit.
Dubious security vulnerability: Denial of service by loading a very large file
I mean, it's what you asked it to do.
The early history of the Windows Runtime PropertyValue and why there is a PropertyType.Inspectable that is never used
It used to be there because PropertyValue started out as the fundamental variant type before shifting focus to being the fundamental boxed type.
Windows Runtime design principle: Properties can be set in any order
If all you're doing is setting properties, you can do it any way you like.
What makes <CODE>cheap_<WBR>steady_<WBR>clock</CODE> faster than <CODE>std::<WBR>chrono::<WBR>high_<WBR>resolution_<WBR>clock</CODE>?
It's quite a bit faster, though maybe you don't care.
Microspeak: The hockey stick on wheels
You're always a year away.
What about the icons in pifmgr.dll?
Just for fun.
Using RAII to remedy a defect where not all code paths performed required exit actions, follow-up
If the callback requires copyability.
Using RAII to remedy a defect where not all code paths performed required exit actions
Passing the obligation onward.
Why can you increment a reference count with relaxed semantics, but you have to decrement with release semantics?
It's more important to clean up when you leave.
I remember taking a screen shot of a video, and when I opened it in Paint, the video was playing in it! What witchcraft is this?
You copied the green screen.
API design principle: Don’t tempt people to divide by zero
Remove it from the equation.
The self-assignment principle for Windows Runtime properties: Don’t change behavior based on whether a property has been written to
The fact that a property has been set does not by itself trigger functionality.
The self-assignment principle for Windows Runtime properties applies to default values
The default value must be legal.
Windows Runtime API design principles around read-write properties: Idempotence and self-assignment
Setting it to the value it already has is not a crime.
Remembering the end of support for VRML in Internet Explorer
No one left standing.
Code comments should apply to the state of the system at the point the comment “executes”
Putting them in the flow.
Can we get weak functions for static linking? The Visual C++ compiler says “We have weak functions at home”
It's already there, just under a different paradigm.
The problem with inferring from a function call operator is that there may be more than one
<CODE>auto</CODE> parameters make this easy to write, particularly for lambdas.
How do I convert a <CODE>FILETIME</CODE> to a C++ clock like <CODE>std::system_clock</CODE> or <CODE>winrt::clock</CODE>?
The <CODE>winrt::clock</CODE> has a conversion for you.
Microspeak: Convicted
False backformation.
How can I enumerate the overflow icons in the Notification Area without showing them?
If they aren't shown, then they aren't automatable, so there's no requirement that they exist in the UI automation tree.
Why didn’t Windows 95 setup install a miniature Windows 95 so that it could be written as a 32-bit program?
Getting to the GUI quickly, and rebooting only once.
Samples note: Use comments to describe what code does, not what you wish the code would do
Comments explain the code. They are not substitutes for the code.
Why is Windows still tinkering with critical sections?
The critical section may be an old dog, but it's still learning new tricks.
Another lesson learned from the Windows 98 on-stage USB blue screen
Test before using.
Why was Windows 3.0’s WinHelp called an online help system when it ran offline?
It was online in a different sense.
Learning to read C++ compiler errors: Not a legal base class
What would make it an illegal base class?
Can I close a duplicate handle while I’m waiting on the original?
That's fine, since you're not closing the handle that you're waiting on.
How can I get my shell thumbnail extractors to run in the same process?
Adding another level of indirection.
Translating the <CODE>STATUS_<WBR>STACK_<WBR>BUFFER_<WBR>OVERRUN</CODE> status code into customer-ready text
Reducing the level of alarm.
Why is the name of the Microsoft Wireless Notebook Presenter Mouse 8000 hard-coded into the Bluetooth drivers?
Is it some sort of favoritism?
How can I convert a third party in-process server so it runs in the COM surrogate?
You can put your own object in the surrogate first.
Why can’t <CODE>std::apply</CODE> figure out which overload I intend to use? Only one of then will work!
The overload resolution happens before the compiler knows what it's going to be used for.
The documentation says that CompanyName version information is required, but my program seems to work without it, so how required is it?
It's more of a "Very strongly recommended" than a "Required".
A suggestion to people who assign nicknames to meeting rooms
Lean into the pattern. Don't try to cross it up.
Why didn’t Windows 95 simply special-case the laptops that locked up when it executed the <CODE>HLT</CODE> instruction?
The catastrophic risk of bricking a computer.
The case of the crash on a null pointer even though we checked it for null
Understanding what you're checking.
How can I write a C++/WinRT <CODE>IAsyncOperation<T></CODE> where <CODE>T</CODE> is not a Windows Runtime type?, part 2
Safer smuggling.
How can I write a C++/WinRT <CODE>IAsyncOperation<T></CODE> where <CODE>T</CODE> is not a Windows Runtime type?, part 1
It's not representable in the Windows Runtime, but you can smuggle it.
Dubious security vulnerability: Remembering passwords for recently-opened ZIP files
If it didn't remember them, you wouldn't like it.
Thoughts on creating a tracking pointer class, part 16: Second attempt to use a list
We can splice nodes to move them between lists.
Thoughts on creating a tracking pointer class, part 15: A custom shared pointer
Simplifying it for out limited use case.
Thoughts on creating a tracking pointer class, part 14: Nonthrowing moves with the shared tracking pointer
Moving the exception somewhere else.
Thoughts on creating a tracking pointer class, part 13: Restoring the strong exception guarantee
Don't commit to anything until you know you can finish the job.
Thoughts on creating a tracking pointer class, part 12: A shared tracking pointer
Sharing a single tracking pointer among all instances.
Thoughts on creating a tracking pointer class, part 11: Repairing assignment
Restoring things that were automatically deleted.
Thoughts on creating a tracking pointer class, part 10: Proper conversion
Making sure you cannot remove qualifiers.
Thoughts on creating a tracking pointer class, part 9: Conversion
Making a read-only tracking pointer from a read-write tracking pointer.
Thoughts on creating a tracking pointer class, part 8: Tracking const objects
Making tracking pointers to const objects.
Thoughts on creating a tracking pointer class, part 7: Non-modifying trackers, second try
Another attempt to make tracking pointers to objects that you can't modify.
Thoughts on creating a tracking pointer class, part 6: Non-modifying trackers
Making tracking pointers to objects that you can't modify.
Thoughts on creating a tracking pointer class, part 5: Copying our tracking pointer
How to copy from a const tracking pointer.
Thoughts on creating a tracking pointer class, part 4: Using a circular doubly linked list
Building our own circular doubly-linked list.
Thoughts on creating a tracking pointer class, part 3: Using a <CODE>std::vector</CODE>
Tracking your trackers with a vector.
Thoughts on creating a tracking pointer class, part 2: Using a <CODE>std::list</CODE>
Tracking your trackers with a <CODE>std::list</CODE>.
Thoughts on creating a tracking pointer class, part 1: Concept art
Following an object as it moves.
Under what conditions could a <CODE>ReadFile</CODE> or <CODE>WriteFile</CODE> fail to transfer all of the bytes, and how do I detect that?
If there is not enough data to read, or not room to write.
How can I detect that Windows is running in S-Mode?
Check the code integrity policy.
How do I disable pieces of the property sheet for a service in the Services MMC snap-in?
There's no secret setting. It's all based on access control.
Why are Windows semiannual updates named H1 and H2?
To address an unconscious bias.
How can I read more than 4GB of data from a file in a single call to <CODE>ReadFile</CODE>?
You can't, but you can try to fake it.
Two related questions about keeping track of PIDs of IPC clients
Since you're doing IPC, you may as well let IPC do the work for you.
A consequence of the weird <CODE>wReserved</CODE> value at the start of the <CODE>DECIMAL</CODE> structure
It overwrites things by accident.
In C++/WinRT, how can I await multiple coroutines and capture the results?, part 0
If you don't really care about what happens if something goes wrong.
Why is there a window with no name blocking Windows shutdown?
They never expected you to see it.
API design note: Don’t make up multiple names for the same thing
It may be obvious to you, but that's because you wrote it.
How can I confirm in the Windows debugger that I’m looking at a COMDAT-folded function?
Ask for all the names for an address.
How can I wait until a named object (say a mutex) is created?
You can't, but maybe you can wait for something else.
Exploring possible solutions to the inconsistency in how Windows searches case-insensitively for named resources
Maintaining compatibility while addressing flaws.
Being more adamant about reporting that C++/WinRT was unable to resume execution on a dispatcher thread
Better versions in a different box.
What happens if C++/WinRT is unable to resume execution on a dispatcher thread?
What you get out of the box.
The case of the invalid instruction exception on an instruction that should never have executed
I don't recall ever asking you to do that.
If the Window Runtime PropertyValue is for boxing non-inspectables, why is there a PropertyValue.CreateInspectable?
For completeness, but not for functionality.
The Fundamental Failure-Mode Theorem: Systems lie about their proper functioning
It doesn't say what it does on the tin.
Perhaps not a recommended usage for an emergency power outlet
Maybe that's not a critical system.
There is a <CODE>std::<WBR>chrono::<WBR>high_<WBR>resolution_<WBR>clock</CODE>, but no <CODE>low_<WBR>resolution_<WBR>clock</CODE>
For when you care only enough to be roughly on time.
Detecting and reporting all unhandled C++ exceptions as well as all unhandled structured exceptions
Closing another exit point.
Our first attempt to detect and report all unhandled C++ exceptions as well as all unhandled structured exceptions
Identifying and classifying the exit points.
When I install an unhandled structured exception filter, why doesn’t <CODE>std::<WBR>terminate</CODE> get called?
You're using the same hook that the compiler uses to call <CODE>std::<WBR>terminate</CODE>.
A walkthrough of the original Microsoft Building 3
Don't get lost on your walk down memory lane.
Dubious security vulnerability: If I perform this complex series of manual steps, I can crash a program I am running
What security boundary did you cross?
Why doesn’t <CODE>LVIF_<WBR>INDENT</CODE> work without an image list?
Its original client had an image list.
German language cheat sheet: On changing quantities
How much there is, and how is it changing.
If the <CODE>FormatMessage</CODE> function fails, and I requested that it allocate a buffer, do I have to free the buffer?
There was no buffer returned, so there's nothing to free anyway.
Unintended yet somehow entirely expected consequences of marking a COM interface as local
If it's local-only, then it can't be remote.
The sizzle reel that says things that nobody understands
Failing to understand your audience.
2025 mid-year link clearance
Halfway there.
Embracing the power of the empty set in API design: Requesting zero items
It's okay to ask for nothing. You get nothing.
Why do I get errors or warnings about some weird symbol called ?main@@YAHP$01E$AAV?$Array@PE$AAVString@Platform…, part 3
Forcing <CODE>main</CODE> to be found in the place we want.
Why do I get errors about some weird symbol called ?main@@YAHP$01E$AAV?$Array@PE$AAVString@Platform…, part 2
Figuring out why C++/CX makes a difference.
Your information has been permanently deleted, for small values of permanently
Is it really gone?
Why do I get errors about some weird symbol called ?main@@YAHP$01E$AAV?$Array@PE$AAVString@Platform…, part 1
Welcome to the world of C++/CX. Is "welcome" the right word?
Abusing copyright strings to trick software into thinking it’s running on your competitor’s PC
I did technically cross my fingers.
The MIDL compiler still has trouble with double greater-than signs, sadly
Many have tried.
The case of the invalid handle error when a handle is closed while a thread is waiting on it
You are theorizing one race but experiencing another.
Learning to read C++ compiler errors: Ambiguous symbol errors after including a header file
Finding out why multiple entities with the same name are visible.
You have to tell <CODE>Get-</CODE> and <CODE>SetSecurityInfo</CODE> the object type, you can’t make it guess
It needs to know which provider to give it to.
Funding the Egghead store shopping spree took a little extra legwork
Just ask the boss.
Writing a helper class for generating a particular category of C callback wrappers around C++ methods
Another exercise in C++ template programming.
Thread pool threads are like preschool: Leave things the way you found them
Your mother always told you to clean up behind yourself.
Why does Windows even have <CODE>Interlocked</CODE> functions when we have <CODE>std::atomic</CODE>?
Well, you have to start somewhere.
Removing the <CODE>MAX_PATH</CODE> restriction on paths applies only to paths
The individual file names still retain their existing limits.
Application compatibility for Windows 95 crashed a cash register
Exceeding all reasonable maximums.
Dubious security vulnerability: Tricking a program into running non-elevated
You can do anything, but still within the limits of your authority.
Why does C++ think my class is copy-constructible when it can’t be copy-constructed?
You said that you had a copy constructor, even though it can't be compiled.
Why do some Windows functions fail if I pass an unaligned Unicode string?
Well, if you don't align it, then you've already broken the rules.
Riffing on a typo in the name of the opera <I>Turandot</I>
On the dot.
How can I programmatically find the network path by which a folder has been shared?
There is no direct query. You'll have to infer it.
The symbolism of the magnifying glass is not universal
Just making things bigger?
Stating the obvious about debugging an invalid parameter error when freeing memory
Writing it down for posterity.
Using an oracle to see where your code is producing the wrong output
If there is a reference implementation, then use it as a check.
The case of creating new instances when you wanted to use the same one
C++ language backward compatibility makes legal what you had hoped wasn't.
How do I convert a WIC bitmap back to a GDI <CODE>HBITMAP</CODE>?
You can copy the bits into a DIB section.
What was origin of the code name Redpill for Windows 8 feature lockout?
Pretty obvious, actually.
Why does <CODE>EnumProcessModules</CODE> report no modules on a process that was created suspended?
There are no modules yet because you didn't give them a chance to load.
How can I detect if one of my helper processes is launching child processes?
You can ask a job object to keep track for you.
How can I create a window the size of the screen without it being treated as a fullscreen window?
You can declare that you aren't rude.
Silly parlor tricks: Promoting a 32-bit value to a 64-bit value when you don’t care about garbage in the upper bits
Inline assembly that doesn't do anything.
Why does Windows report my processor speed twice, with slightly different values?
One is calculated. The other is self-promotion.
Secret passages on Microsoft main campus, episode 3
Another covered passage between buildings.
What’s with the weird <CODE>wReserved</CODE> value at the start of the <CODE>DECIMAL</CODE> structure?
It's where the discriminant goes when the <CODE>DECIMAL</CODE> is put "inside" a <CODE>VARIANT</CODE>.
How do I force RunOnce commands to run in a specific order?
Run them in the desired order yourself.
If I mark my thread pool callback as long-running, does it still count toward the thread pool thread limit?
Yes, because it's still in the thread pool.
What is the developer set-up for developing Windows for multiple processor architectures?
You usually just pick one and count on your friends for the others.
Dubious security vulnerability: A program does not run correctly if you run it the wrong way, redux
Trying to make the system run the program automatically.
How can I wait for Clipboard History to recognize a clipboard change before I change it again?
Listen for the change event.
Why doesn’t Clipboard History capture rapid changes to clipboard contents?
Clipboard history operates asynchronously, so you are changing it before it can respond to the changes.
What were the MS-DOS programs that the <TT>moricons.dll</TT> icons were intended for?
Tallying them up.
What were the MS-DOS programs that Windows used the <TT>progman.exe</TT> stock icons for?
Mostly generic-looking icons.
What were the intended uses of those icons in <TT>moricons.dll</TT>?
Icons for old MS-DOS apps.
Using type aliasing to avoid the ODR problem with conditional compilation, part 2
Ensuring that you pick a side.
Using C++ type aliasing to avoid the ODR problem with conditional compilation, part 1
Still one definition, but two types.
Why does Windows have trouble finding my Win32 resource if it contains an accented character?
Disagreements over the fine print.
Protecting Windows users from Janet Jackson’s <I>Rhythm Nation</I>
Granting an exception to a system policy.
Why did Windows 7, for a few months, log on slower if you have a solid color background?
It's waiting for Godot and eventually gives up.
If we can have <CODE>std::atomic<std::shared_ptr></CODE>, why not <CODE>std::atomic<com_ptr></CODE>?
Controlling the reference count.
When I define a window class with no default cursor, what is the explanation for the cursors that appear in my client area?
You said you'd take care of it, but you didn't.
What resource ID should I give my application’s main icon?
Applying what we know about how Explorer finds the "first" icon in a file.
Microspeak: top of mind
Things I'm thinking about.
The ongoing story of seconds on the taskbar
The cost of ticking.
The case of the feature flag that didn’t stay on long enough, part 2
Leaving everything the way you found it.
The case of the feature flag that didn’t stay on long enough, part 1
Understanding scope and order of destruction.
Using the classical model for linking to provide unit test overrides
Overriding a LIB with an OBJ for fun and profit.
There was a lot of imagined dropping tablets in swimming pools
The archetypical example of needing a replacement computer.
Dubious security vulnerability: Once I have tricked the user into running a malicious shortcut, I can install malware
Yes, that's sort of the point.
The case of the UI thread that hung in a kernel call
I did tell you not to do that.
Function overloading is more flexible (and more convenient) than template function specialization
You can change more things in an overload.
Why can’t I use <CODE>SEC_<WBR>LARGE_<WBR>PAGES</CODE> with a file-based file mapping?
No paging, no crying.
The Goldilocks zone of software stability
Not too new, not too old.
On priority inversion in the use of a spinlock to ensure atomic access to a <CODE>shared_ptr</CODE>
Priority inversion may be rare, but correctness doesn't care about rarity.
Adding delays to our task sequencer, part 3
Waiting more cheaply.
Adding delays to our task sequencer, part 2
Waiting the right amount of time.
Adding delays to our task sequencer, part 1
Not so fast there.
The return of Building 7
Pranksters lose one of their longtime inside jokes.
If one program blocks shutdown, then <I>all</I> programs block shutdown, revisited
No take-backs.
The 2025/2026 Seattle Symphony subscription season at a glance
The pocket reference guide for 2025/2026.
Fixing exception safety in our <CODE>task_<WBR>sequencer</CODE>
Exception safety, the forgotten requirement.
On launching a dialog when a specific combo box item is selected
Changing selections is not a good time to launch a dialog box.
Why does <ODE>INVALID_<WBR>HANDLE_<WBR>VALUE</CODE> cast through a <CODE>LONG_PTR</CODE> first?
To ensure that the proper sign extension happens.
We’ll fly you to Atlanta, Texas, and getting to your hotel in Atlanta, Georgia is your problem
Reading the fine print.
A note on the USB-to-PS/2 mouse adapter that came with Microsoft mouse devices
It's a purely mechanical adapter that relies on smarts in the mouse itself.
On how different Windows ABIs choose how to pass 32-bit values in 64-bit registers
Surveying the options and looking for commonalities.
The case of the critical section that let multiple threads enter a block of code
It had one job.
What could cause a memory corruption bug to disappear in safe mode?
A simplified execution environment means fewer things that you can stumble over.
You can’t simulate keyboard input with PostMessage, revisited
If it didn't go through the input system, it only looks like input as much as the app allows itself to be fooled.
Why didn’t Windows 95 setup use a miniature version of Windows 95 as its fallback GUI?
Avoiding an interim GUI environment.
Dubious security vulnerability: A program does not run correctly if you run it the wrong way
So what did you expect?
The case of COM failing to pump messages in a single-threaded COM apartment
A customer encountered a hang caused by COM not pumping messages while waiting for a cross-thread operation to complete. They were using the class for serializing asynchronous operations on a UI thread they created to handle accessibility callbacks. The hang stack looked like this: We see that we have a UI thread (notice the at the bottom of the stack), yet COM decided to block without pumping messages ( instead of (). Is this a bug in the task sequencer? Let's look at the stack more closely. A message arrived via , and that then queued a task into the task sequencer. The saw that the task sequencer had...
Making sure that a DLL loads only from your application directory
You can ask for it as an option, but think about what you're actually protecting against.
What are the thread safety requirements of <CODE>HSTRING</CODE> and <CODE>BSTR</CODE>?
They do not have thread affinity.
What an insightful observation, you get to wear “the hat”
Maybe not so insightful.
How do I destroy an ABI pointer that I extracted from a C++/WinRT object?
You can clean it up the ABI way, whatever that is.
To some people, time zones are just a fancy way of sounding important, episode 2
Words have meaning.
How can I choose a different C++ constructor at runtime?
Make somebody else do it, and then use copy elision.
I tried to subscribe to a C++/WinRT event, but my callback was never called
Check how you registered your event handler.
Microspeak: Respin
Spin it up again, baby.
Lexically scoped functions accessing parent locals: The display
Using a well-known location instead of copying frame pointers.
C++/WinRT implementation inheritance: Notes on <CODE>winrt::implements</CODE>, part 8
Comparing the options.
C++/WinRT implementation inheritance: Notes on <CODE>winrt::implements</CODE>, part 7
Inheritance without involving <CODE>winrt::implements</CODE> at all.
C++/WinRT implementation inheritance: Notes on <CODE>winrt::implements</CODE>, part 6
Using CRTP to delegate the method.
C++/WinRT implementation inheritance: Notes on <CODE>winrt::implements</CODE>, part 5
When the base class isn't self-contained.
C++/WinRT implementation inheritance: Notes on <CODE>winrt::implements</CODE>, part 4
Simple inheritance of a self-contained <CODE>implements</CODE>.
C++/WinRT implementation inheritance: Notes on <CODE>winrt::implements</CODE>, part 3
Discovering the legal inheritance structures for <CODE>winrt::<WBR>implements</CODE>.
C++/WinRT implementation inheritance: Notes on <CODE>winrt::implements</CODE>, part 2
Untangling <CODE>unwrap_<WBR>implements_t</CODE>.
C++/WinRT implementation inheritance: Notes on <CODE>winrt::implements</CODE>, part 1
A closer look at the parameters to the <CODE>implements</CODE> template.
Your statement is now available, just two hidden flyouts and five clicks away
Beware of the leopard.
API design note: Beware of adding an “Other” enum value
What are you going to do when you add a new kind?
Investigating an argument-dependent lookup issue and working around it
Picking apart the language specification.
A sample implementation of the weak reference pattern for COM callbacks
A forwarder through a weak reference.
Async-Async revisited: What about cancellation?
Even the cancellation is async.
Did the Windows 95 setup team forget that MS-DOS can do graphics?
Oh look what you just made there.
How does Explorer find the “first” icon in a file
It enumerates them and takes the first one, so this is really a question about enumeration.
Using alternate locales to get more interesting case mapping than the C
Looking for something better.
The default C locale is not a very interesting one
It barely understands anything.
On exactly when XAML bindings are evaluated if an element is not yet loaded
It depends on which abstraction you prefer.
The original name for Flexible Single Master Operations in Active Directory
Not that kind of F-word.
On trying to log an exception as it leaves your scope
You can't watch it from an object on the outside.
Creating a generic insertion iterator, part 2
Satisfying the iterator requirements, perhaps with a little cheating.
Creating a generic insertion iterator, part 1
We provide the boilerplate; you provide the smarts.
How do I create an inserter iterator that does unhinted insertion into an associative container like <CODE>std::map</CODE>?
Curiously missing from the standard library.
My electric toothbrush was acting up, so I tried to reboot it
It didn't help.
A pattern for obtaining a single value while holding a lock
The immediately-invoked lambda that returns a value.
A brief and incomplete comparison of memory corruption detection tools
A short overview, definitely incomplete.
Memory corruption from outside the process looks like space aliens
The write isn't visible to your process, just the effect of the write.
Be mindful of temporal terms in documents: What is the reference point in time?
What is your implied point in time for the reference?
Why is there a bulge on my bicycle tire when I inflate it?
Get the order of operations right.
Why doesn’t the Windows blue screen of death prominently identify the company that created the driver that crashed?
Because the driver that crashed may not be the one at fault.
Reminder: When a C++ object fails to construct, the destructor does not run
If you need to run after a failed construction, you have to put it in a base class or member variable.
The case of the crash when trying to erase an element from a <CODE>std::set</CODE>
Another kind of fiasco.
In a C++ class template specialization, how can I call the unspecialized version of a method?
You can't talk about things that might exist, so instead talk about things that do.
How does <CODE>GetUserDefaultGeoName</CODE> choose between ISO 3166-1 and UN M.49 codes?
Clarifying the behavior.
Microspeak: The walk-on topic
Just walk on in with your topic.
A simplified overview of ways to add or update elements in a <CODE>std::map</CODE>
And using it to find missing opportunities.
Why does inadvertently passing a <CODE>std::string</CODE> instead of a <CODE>char const*</CODE> to a variadic function crash on x86-32 but not x86-64?
Looking at the calling convention and the small string optimization.
Inside STL: Waiting for a <CODE>std::atomic<std::shared_ptr<T>></CODE> to change, part 2
Digging into the libstdc++ implementation.
Inside STL: Waiting for a <CODE>std::atomic<std::shared_ptr<T>></CODE> to change, part 1
Waiting on a single pointer, but checking for two.
Gesellschaft zur Stärkung der Verben: The German Society for the Irregularization of Verbs
Stand strong and proud.
Emergency power resets on Lenovo, HP, Dell, and Acer laptops
Looking for the magic button.
How can I tell whether a change to a control was due to the user or due to my program?
You know when it was done by your program because you did it.
Forcing an <CODE>ERROR_<WBR>KEY_<WBR>DELETED</CODE> error when trying to open <CODE>HKEY_<WBR>CURRENT_<WBR>USER\<WBR>Software</CODE>
Just an exercise to show that it can be done, even though it's highly unlikely to occur in practice.
Could I be getting <CODE>ERROR_<WBR>KEY_<WBR>DELETED</CODE> for <CODE>HKEY_<WBR>CURRENT_<WBR>USER\<WBR>Software</CODE> when the user logs off?
Probably not, but there are some edge cases.
How is it possible to get <CODE>ERROR_<WBR>KEY_<WBR>DELETED</CODE> when I’m <I>creating</I> a key?
The key that got deleted is not the one you are trying to create.
2024 year-end link clearance
The cycle completes.
Making sure the Microsoft Visual C++ compiler chooses the right source encoding
Making sure the file and settings are set correctly.
How various git diff viewers represent file encoding changes in pull requests
The invisible UTF-8 BOM, and sometimes invisible encoding changes.
In C++, failure to meet the requirements does not always mean that you fail if you don’t meet the requirements
Combining SFINAE/requires, standard layout, and overload resolution.
Why are Win32 resources strings bundled at all? And why bundles of 16?
Balancing multiple performance factors.
How can I check if two GUIDs are equal when they are provided as strings?
A customer asked if there was a helper function in the system that accepted two strings and reported whether the s they represent are equal. This is a tricky question, because you first have to decide what "represent" means. There are many ways of representing a as a string. It could be just 32 case-insensitive hexadecimal digits. Or maybe there are internal hyphens to separate the groups. And the whole thing might be enclosed in braces or parentheses. External and interior whitespace might be allowed. Trailing garbage might be accepted (and ignored). And then there's the special format {0x00000000,0x0000,0x00...
A design flaw in the Windows 3D Pipes screen saver pointed out by a customer
Time-wasting.
A common proposed solution to certain categories of IFNDR: Getting the linker to verify identical functions
You could do it, but it could cramp your style.
How do I register a file type for a scripting language so that users get a warning when they run an untrusted script?
Use the FTA_AlwaysUnsafe edit flag.
Inside STL: The atomic shared_ptr
There's a lock hiding inside the pointer.
Is there a way to split the git history of a file or combine the histories of two files without a merge commit?
Studying how git recovers history.
Microspeak terms that didn’t take hold: airspace, synthetics, and AOI
Sometimes they don't stick.
Why do we have header files <CODE><pshpackN.h></CODE> and <CODE><poppack.h></CODE> instead of just issuing the pragma directly?
Because the pragma may not work everywhere.
Converting to a derived class from the future: How to cast from a base class to an incomplete derived class?
Deferring the definition until the class is complete.
API naming principles for conditional operations: On, When, and If
Describing when a condition is tested.
What is the <CODE>CONTINUE_IF_FAILED</CODE> equivalent of <CODE>RETURN_IF_FAILED</CODE>?
Be careful how you write it, or better: Don't write it at all.
It rather involved being on the other side of this airtight hatchway: Disabling anti-malware scanning
If you have already infiltrated the process, then you can disable things from the inside.
Learning to read C++ compiler errors: Failing to create a <CODE>shared_ptr</CODE>
Understanding what you asked the compiler to do, and why it couldn't comply.
Learning to read C++ compiler errors: Nonsensical errors from a function declaration
Look closely at what the error message is complaining about.
Won’t waiting for multiple threads one at a time introduce a severe performance issue?
It depends on how long you plan on waiting.
Why does my DLL reference count go up by one every time I create and exit a thread?
If you use a wrapper, you need to follow the wrapper's rules.
Tricks from product support: We’re not smart enough to debug the problem, can you help us?
It's not you, it's me.
News flash: Desire for loud cars correlates with psychopathy and sadism
More research into loud vehicles.
An analogy about register preservation rules in calling conventions
And tying it back to unwind codes.
Assessing the attack complexity of a race condition security vulnerability
It's not just how small the race window is, but how easy it is to hit the window.
Why does my program successfully take foreground only when running under the debugger?
That's a special exception to the normal foreground rules.
Checking whether a URI refers to a Web site root
Let somebody else do the parsing.
Microspeak: Real estate and Airspace
Space on the screen and negotiating control over it.
How can I know when a window has processed a message that I posted to it?
Best would be to have it tell you.
In C++, how can I make a default parameter be the this pointer of the caller?, revisited
Expanding on the previous pattern.
How can I detect which menu my item was invoked from?
Just give them all different IDs. But this might itself by an XY problem.
How do I determine whether Explorer is showing or hiding file extensions?
You can ask, but maybe you're asking the wrong question.
A wrinkle in how Windows 95 setup bootstrapped its initial GUI step
Getting access to the common controls that don't exist until Windows 95.
The operations for reading and writing single elements for C++ standard library maps
Breaking down the options.
How do I put a non-copyable, non-movable, non-constructible object into a <CODE>std::optional</CODE>?
Taking advantage of the conversion operator.
Solving the puzzle of trying to put an object into a <CODE>std::optional</CODE>
How do I set a value? Let me count the ways.
The puzzle of trying to put an object into a <CODE>std::optional</CODE>
The C++ standard library template type has one of two states. It could be empty (not contain anything), or it could contain a . Suppose you start with an empty . How do you put a into it? One of my colleagues tried to do it in what seemed to be the most natural way: Use the assignment operator. Unfortunately, the assignment failed to compile: I asked for the rest of the error message, because the details will explain what the compiler tried to do (and why it couldn't). It's long, but we'll walk through it. The compiler is showing its work. It's showing you all the possible overloaded assignment opera...
Why did Windows 95 setup use three operating systems?
Simplifying the problem to an earlier problem.
Debugger breakpoints are usually implemented by patching the in-memory copy of the code
The code in memory may not match what the debugger shows you if the debugger is itself is doing the changing.
The case of a program that crashed on its first instruction
Didn't even make it out of the gate.
Why do I observe reads from a memory-mapped file when writing large blocks?
The CPU doesn't see the entire write at once.
How do I declare an operator overload for my Windows Runtime class?
That's not something expressible in the Windows Runtime.
What’s the difference between Display size and Screen size in the Windows 95 display control panel?
No meaningful difference, though others have created a difference.
On the limits of time travel in the face of undefined behavior in C
C imposes some constraints, but the principle is mostly still there.
On locale-aware substring matching, either case-sensitive or case-insensitive
It's surprisingly complicated, but fortunately, somebody has done it for you.
What has case distinction but is neither uppercase nor lowercase?
It has one foot in each world but belongs to neither.
I have enabled “take ownership” permission, but I still cannot obtain write access
Taking ownership is only one part of gaining write access.
Reverse-engineering what a “short” section is
The long and short of it all.
How useful is the hint passed to the <CODE>std::<WBR>unordered_…</CODE> collections?
Only a little, or sometimes not at all.
How can I explicitly specialize a templated C++ constructor, follow-up notes
You can use a maker function, but that doesn't let you escape the problem.
It rather involved being on the other side of the airtight hatchway: Defeating ASLR after you’ve gained RCE via ROP
If you defeat ASLR, then you can defeat ASLR.
How do I create a Windows Runtime <CODE>IRandomAccessStream</CODE> around a bunch of bytes or a classic COM <CODE>IStream</CODE>?
Another wrapper function.
Did Windows 95 shrink the default font size of windowed MS-DOS apps?
The effect was that it shrunk, but only sometimes.
Why does adding <CODE>WS_<WBR>MINIMIZEBOX</CODE> change how my window behaves when the user presses <KBD>Win</KBD>+<KBD>D</KBD>?
It minimizes your window if it can.
Evaluating tail call elimination in the face of return address protection, part 2
Rewriting the activation frame.
Evaluating tail call elimination in the face of return address protection, part 1
Reusing the activation frame.
Effects of classic return address tricks on hardware-assisted return address protection
Return address manipulations that are possibly even more impermissible than they already were.
A quick introduction to return address protection technologies
Detecting attempts to manipulate the return address.
On naming things: The tension between naming something for what it is, what it does, or how it is used
You are guaranteed to make someone upset.
How can I explicitly specialize a templated C++ constructor?
Looking for a C++ tag type for representing another type.
A correction to the awaitable lock for C++ PPL tasks
Over-scoped lock.
If threads are created without a message queue, why can I post to them immediately upon creation?
Check who is doing the posting.
Microspeak: Run to ground
Come to a resolution.
A popular but wrong way to convert a string to uppercase or lowercase
Converting character by character isn't good enough any more.
How does the linker decide whether to call <CODE>WinMain</CODE> or <CODE>wWinMain</CODE>?
If you don't tell it, it will try to figure it out.
How can I detect whether the user is running as an elevated administrator (as opposed to a natural administrator)?
You can ask for the elevation type.
A function for creating an absolute security descriptor from a self-relative one
Just wrap it up.
Misunderstanding the “Prevent access to registry editing tools” policy
It prevents access to the tools, but not to the registry itself.
Pulling a single item from a C++ parameter pack by its index, remarks
Why such a complicated way to pull the type from the pack?
The case of the crash when destructing a <CODE>std::map</CODE>
Who is corrupting the map?
If you’re going to specify the <CODE>LVS_SORTASCENDING</CODE> or <CODE>LVS_SORTDESCENDING</CODE> style, you had better be telling the truth
Because the listview control uses it to optimize searching.
Another example of the Windows Runtime interop pattern: Using the UserConsentVerifier from a Win32 program
Following the standard pattern.
The UserConsentVerifier confirms that the user is there, but it doesn’t protect any data
Is that really you?
Going beyond the empty set: Embracing the power of other empty things
Just because there's nothing in it doesn't mean it's not valid.
How can I check that all the changes in a git branch have been cherry-picked or rebased into its upstream branch?
You can pretend to merge it and see if anything happens.
My window has the <CODE>WS_<WBR>EX_<WBR>NOACTIVATE</CODE> extended style, but it got activated anyway
Well, at least it wasn't activated by a click.
More on the mysterious <CODE>[default_interface]</CODE> attribute in Windows Runtime classes
Forcing you to make a choice.
It rather involved being on the other side of this airtight hatchway: Posting completions to somebody else’s I/O completion port
If you have gained access to it, then that was the problem.
Some notes on Win32 carets
Assorted notes and musings.
The case of the fail-fast crashes coming from the power management system
Understanding why it decided to fail fast.
How can I tell whether two programs will share drive letter mappings?
You can compare the authentication IDs.
The case of the string being copied from a mysterious pointer to invalid memory, revisited
Reflections on an older topic.
Does the Resource Compiler have a separate preprocessor or doesn’t it?
It did, but now it doesn't.
GitHub trick to find the commit that deleted a file
Ask for the history of the file.
The case of the image that came out horribly slanted: Negative stride
It's all topsy-turvy.
The case of the image that came out horribly slanted: Taking the pitch into account
Getting the pieces to line up.
The case of the image that came out horribly slanted: Diagnosis
Imperfect pitch.
Why did Windows 95 use blue screen error messages instead of hard error messages?
You may not able to get there from here.
The <CODE>CoInitializeSecurity</CODE> function demands an absolute security descriptor
Even though you usually have a self-relative one in hand.
In the Windows kernel, what is a LUID, and what makes it loo-ey?
It's a locally-unique ID, for a specific definition of "local".
How is the Windows.Foundation.Uri.Domain property different from Host?
It's an educated guess.
On the strange status of <CODE>wchar_t</CODE> in classic MIDL
From the era before <CODE>wchar_t</CODE> was a standard type.
The Microsoft/IBM joint development was built on mutual respect, wait, is respect the right word?
Maybe it's some other word.
Thoughts on finding the essential elements of a set
Another binary search, but searching a different way.
What if I need to wait for more than <CODE>MAXIMUM_<WBR>WAIT_<WBR>OBJECTS</CODE> threads?
Studying your options, and the consequences of breaking things up.
The role of the activation factory in the Windows Runtime
The activation factory represents the class itself.
What does <CODE>ERROR_<WBR>KEY_<WBR>DELETED</CODE> mean?
You now have a handle to a key that doesn't exist, and there's nothing you can do with it.
Another tribute to Microsoft history hiding in Building 41
Logo touches.
Constructing nodes of a hand-made linked list, how hard can it be?
Trying to force copy elision.
The case of the missing ordinal 380
Untangling the error message and developing a theory.
Instead of putting a hash in the Portable Executable timestamp field, why not create a separate field for the hash?
That would defeat the purpose.
Temporarily dropping a lock: The anti-lock pattern
It's not to prevent locking, but rather to counteract a lock.
A look back at one of the (many) projects code-named Highlander
The showdown that almost repeated.
Embracing the power of the empty set in API design (and applying this principle to selectors and filters)
You got plenty of nothing.
What does it even mean to Close a Windows Runtime asynchronous operation or action?
That's the end of the road.
Why do I get <CODE>E_<WBR>ACCESSDENIED</CODE> when trying to access my brokered Windows Runtime object?COM is double-checking the trust level.
COM is double-checking the trust level.
How do I know when the user has finished interacting with the <CODE>AccountsSettingsPane</CODE>?
You can use the version that runs an asynchronous operation.
It rather involved being on the other side of the airtight hatchway: Disabling a security feature as an administrator
At least they don't beat around the bush.
What are the dire consequences of registering a RunOnce command from my RunOnce command?
The circle of life, or a perpetual motion machine.
The difference between undefined behavior and ill-formed C++ programs
They are two kinds of undefined-ness, one for runtime and one for compile-time.
What’s the difference between <CODE>DataPackageView.<WBR>GetUriAsync</CODE> and <CODE>DataPackageView.<WBR>GetWebLinkAsync</CODE>?
Just improving on an ambiguous name.
How to compress out interior padding in a <CODE>std::pair</CODE> and why you don’t want to
Context-sensitive layout means you get a different structure each time you use it.
There is no mystery over who wrote the Blue Screen of Death, despite what some may want you to believe
No real contradictions in anybody's story.
Why don’t Windows Imaging Component pixel format GUIDs continue their nice pattern?
Patterns are predictable, which is not always a good thing.
What can I do if IMlangConvertCharset is unable to convert from code page 28591 directly to UTF-8?
You can do the conversion in two steps using things you already have.
In my Visual Studio project, I set my Conformance mode to permissive, but it’s still not permissive
Digging into what the compiler sees.
API naming principle: If there is no direct object, then the direct object is the source object
If you don't know what it operates on or produces, then it operates on or produces itself.
Unquoted service paths: The new frontier in script kiddie security vulnerability reports
Usually not exploitable, but the script kiddies don't know that.
Organizing the five creation dispositions of the <CODE>CreateFile</CODE> function
Six possibilities, but only five useful ones.
Creating an already-completed asynchronous activity in C++/WinRT, part 9
Cheating the delegates.
Creating an already-completed asynchronous activity in C++/WinRT, part 8
Generalizing the pattern.
Creating an already-completed asynchronous activity in C++/WinRT, part 7
Implementing the contract directly.
Creating an already-completed asynchronous activity in C++/WinRT, part 6
Let the conversion do the talking.
Creating an already-completed asynchronous activity in C++/WinRT, part 5
Trying to fail more correctly.
Creating an already-completed asynchronous activity in C++/WinRT, part 4
Failing is easy. Failing correctly is hard.
Creating an already-completed asynchronous activity in C++/WinRT, part 3
Generalizing to the four kinds of Windows Runtime asynchronous activities.
Creating an already-completed asynchronous activity in C++/WinRT, part 2
Making our function a coroutine.
Creating an already-completed asynchonous activity in C++/WinRT, part 1
The simplest version.
What’s the point of <CODE>std::<WBR>monostate</CODE>? You can’t do anything with it!
Not doing anything with it is exactly the point.
How do I produce a Windows Runtime asynchronous activity from C++/WinRT?
Somebody that deals with them natively.
How do I produce a Windows Runtime asynchronous activity from C#?
The AsyncInfo helper class converts Tasks to Windows Runtime asynchronous activities.
How do I produce a Windows Runtime asynchronous activity from C++/CX?
The Parallel Patterns Library has special support for C++/CX.
The history of <KBD>Alt</KBD>+number sequences, and why <KBD>Alt</KBD>+<KBD>9731</KBD> sometimes gives you a heart and sometimes a snowman
Code pages and custom keyboard handling.
If I register the same shell extension as both a context menu extension and a drag/drop extension, how do I know which one the system is using?
Who forced you to register the same shell extension for both?
2024 mid-year link clearance
Emptying out the junk drawer.
Writing a <CODE>remove_all_pointers</CODE> type trait, part 2
Factoring out the type resolution to after the dangerous part.
Writing a <CODE>remove_all_pointers</CODE> type trait, part 1
Delaying the expansion to avoid infinite recursion.
Is there a built-in way in C++/WinRT to get the string name for a Windows Runtime enum?
No, and maybe you don't want to.
Microspeak: Fun fork
A place to party.
Finding a specific value in a sequence of integers that changes by at most 1
It's basically a discrete version of the intermediate value theorem.
The Windows Runtime <CODE>winrt::<WBR>hstring</CODE> and the C++ <CODE>std::<WBR>wstring</CODE> are inter-assignable
Just assign them over, no cermony necessary.
How to convert between different types of counted-string string types
Looking for constructors that take a character count.
On the sadness of treating counted strings as null-terminated strings
You're throwing away perfectly good data, there.
The time smart quotes prevented the entire Office division from committing code
Breaking your tools with your tools.
How can I view the list of symbols available in a library?
A tool hiding inside another tool.
Lock-free reference-counting a TLS slot using atomics, part 3
Keeping track of two things at once.
Lock-free reference-counting a TLS slot using atomics, part 2
Getting it is easy. Getting rid of it is hard.
Lock-free reference-counting a TLS slot using atomics, part 1
First, we do it with locks.
The origin story of the Windows 3D Pipes screen saver
Looking for a place to show off.
How do I get the name of a SID, and what does it mean when the conversion fails?
Most places will do it for you, or at least try.
What’s the deal with <CODE>std::type_identity</CODE>?
When you want to use a type without participating in type deduction.
Can INI files be Unicode? Yes, they can, but it has to be your idea
It'll only be Unicode if it's already Unicode.
How 16-bit Windows cached INI files for performance
Taking advantage of co-operative multitasking.
Why does <CODE>GlobalLock</CODE> max out at 255 locks?
Because that's how many bits were available for reporting the lock count.
More on harmful overuse of <CODE>std::<WBR>move</CODE>
Could we expand copy elision to cover the harmful cases?
A graphical depiction of the steps in building a C++ executable, with XAML and packaging
Fleshing out the diagram.
A graphical depiction of the steps in building a C++ executable, enhanced for classic Win32
Adding in Microsoft-specific tools.
A graphical depiction of the steps in building a C++ executable, basics
A high-level overview.
How can I force a DLL to register itself if it won’t respond to <CODE>regsvr32</CODE>?
You can't force something that isn't there.
Is there any difference between <CODE>StringFromIID</CODE> and <CODE>StringFromCLSID</CODE>?
Not really.
Setting the contents of a Windows Runtime Vector from C++/WinRT in one call
The one-stop shop for updating a Windows Runtime Vector.
Creating a prepopulated Windows Runtime Vector from C++/WinRT without going through an explicit <CODE>std::<WBR>vector</CODE>
Creating the vector inline.
If you have to create a Windows Runtime Vector from C++/WinRT, do it as late as possible
Stay with the <CODE>std::vector</CODE> until you really need the Window Runtime Vector.
A blurry photo of the legendary USB Cart of Death
And some details about that infamous on-stage bluescreen.
If you know what interface you want, just pass it directly to CoCreateInstance
Avoiding a second round trip.
Why can’t I find the injected name of a templated class’s templated base class?
The compiler needs help finding it because it's not findable at the time the template is parsed.
Pulling a single item from a C++ parameter pack by its index
Combining a few tools to make a new tool.
Building the most efficient device selector query that selects no devices
Looking for the most efficient way of rejecting everything.
The confidential coffee maker was not the only source of shenanigans at the IBM Boca office
The culture (and weather) clash continues.
Before you try to change something, make sure you can change nothing
Nobody touch anything.
An informal comparison of the three major implementations of <CODE>std::string</CODE>
Pros and cons.
Asking for a DispatcherQueue from a GUI thread you created
Grafting a DispatcherQueue onto an existing thread.
Awaiting a set of handles with a timeout, part 7: Just doing it one at a time
A simpler version with its own quirks.
Awaiting a set of handles with a timeout, part 6: Capturing the handles efficiently
SFINAE'ing the case of a random-access(ish) iterator.
Awaiting a set of handles with a timeout, part 5: Generalizing the awaiter
Fitting into existing patterns.
Awaiting a set of handles with a timeout, part 4: Building our own awaiter
To stop relying on unspecified behavior.
Awaiting a set of handles with a timeout, part 3: Going beyond two
Generalizing what we learned last time.
Awaiting a set of handles with a timeout, part 2: Continuing with two
Giving it another try.
Awaiting a set of handles with a timeout, part 1: Starting with two
Let's see by seeing if we can do it with just two.
Awaiting a set of handles in C++/WinRT
It's easier thank you think.
Adding state to the update notification pattern, part 8
Comparing the two algorithms.
Adding state to the update notification pattern, part 7
Going free-threaded.
Adding state to the update notification pattern, part 6
Using a change counter with coalescing.
Adding state to the update notification pattern, part 5
Using a change counter.
Adding state to the update notification pattern, part 4
What if the UI thread isn't there to save you?
Adding state to the update notification pattern, part 3
Abandoning the background work if we know that it is pointless.
Adding state to the update notification pattern, part 2
First attempt to try to fix the race condition.
Adding state to the update notification pattern, part 1
Where each notification depends on some state information.
In search of the Ballmer Peak, and other results from SIGBOVIK 2024
Continuing studies in silliness.
Dubious security vulnerability: Program allows its output to be exfiltrated
Once the output is generated, the program can't control where it goes.
What were the tax consequences of letting Windows 95 team members keep a piece of software as long as they tested it?
It basically falls under the <I>de minimis</I> rule.
The case of the string being copied from a mysterious pointer to invalid memory
Using AppVerifier to deduce the heap allocation history.
Why do <CODE>STANDARD_<WBR>RIGHTS_<WBR>READ</CODE>, <CODE>STANDARD_<WBR>RIGHTS_<WBR>WRITE</CODE>, and <CODE>STANDARD_<WBR>RIGHTS_<WBR>EXECUTE</CODE> have the same values?
Don't they mean different things?
How can I find out which process has locked me out of the clipboard?
You can ask for the clipboard opener.
If I enumerate all the processes and add up all the <CODE>GetGuiResources</CODE>, why doesn’t it match the <CODE>GR_<WBR>GLOBAL</CODE> value?
There are some things that aren't charged to processes.
How does the classic Win32 ListView handle incremental searching?
Combining prefix search with repeated search, to accommodate multiple styles.
The case of the exception that a <CODE>catch (…)</CODE> didn’t catch
Reconstructing a false history.
It rather involved being on the other side of this airtight hatchway: System corruption caused by an administrator
If your goal was to corrupt the system, you sure are doing it the hard way.
Windows debugger trick: Breaking when a specific debugger message is printed
A different kind of conditional breakpoint.
The history of computing, as told by the hallways of Microsoft Building 41
A walk through history, in the form of wall textures.
Subroutine calls in the ancient world, before computers had stacks or heaps
A lot of computing got done even before we had stacks and heaps.
How can I tell C++ that I want to discard a nodiscard value?
A variety of tricks, with different degrees of readability and legality.
I called <CODE>CreateEnvironmentBlock</CODE> with a process’s token, but I didn’t get that process’s environment
That's not what the <CODE>CreateEnvironmentBlock</CODE> function does.
Some choices for encrypting data so that it can be decrypted only by the same user or computer
There's your classic, and there's some newfangled stuff.
Dubious security vulnerability: Manual operations can cause a program to hang
You did this to yourself.
Why isn’t C++ using my default parameter to deduce a template type?
Trying to have it both ways.
Why does my thread get a broken string as its initial parameter?
It got converted too late.
Using the <CODE>DisplayInformation</CODE> class from a desktop Win32 application, part 2
Completing the prerequisites.
Using the <CODE>DisplayInformation</CODE> class from a desktop Win32 application, part 1
A little interop music.
How well does C++/WinRT <CODE>com_ptr</CODE> support class template argument deduction (CTAD)?
It doesn't even try, and probably doesn't want you to do it.
How well does wil <CODE>com_ptr</CODE> support class template argument deduction (CTAD)?
Falling into a hole in the C++ language, not filled in until C++20.
How well does WRL <CODE>ComPtr</CODE> support class template argument deduction (CTAD)?
It tries too hard and accidentally breaks CTAD.
How well does ATL <CODE>CComPtr</CODE> support class template argument deduction (CTAD)?
It actually works right out of the box.
How well does MFC <CODE>IPTR</CODE>/<CODE>CIP</CODE> support class template argument deduction (CTAD)?
Not very well, thanks to requiring the interface ID to be specified explicitly.
How well does <CODE>_com_ptr_t</CODE> support class template argument deduction (CTAD)?
Not very well, thanks to storing the pointer and IID pair in a helper type.
Class template argument deduction (CTAD) and C++ COM wrappers: Initial explorations
How well do these libraries support a feature that likely didn't exist at the time they were written?
The 2024/2025 Seattle Symphony subscription season at a glance
The pocket reference guide for 2024/2025.
How can I force a copy of a C++ value?
Forcing a copy with a minimum of typing.
In C++/WinRT, you shouldn’t destroy an object while you’re <CODE>co_await</CODE>ing it
A generalization of the ground rules of programming.
How do I make an expression non-movable? What’s the opposite of <CODE>std::move</CODE>?
You can turn it into a const thing so it's no longer movable, in a conventional sense.
In domain\user syntax, you can often use the period as an abbreviation for “this computer”
A bit of a typing saver, particularly with complex machine names.
Is shadowing a member variable from a base class a bad thing? Maybe, but maybe not.
It depends on the order in which things occurred.
C++/WinRT performance trap: Switching to Windows Runtime too soon
Stay in the devirtualized world until you are forced to leave.
If a parameter isn’t used, what should I pass?
It doesn't matter what you pass, but if you have to ask, then just pass zero.
On the whole idea of giving away a reference to yourself at destruction
Hey, at least it's possible.
Mitigating attacks based on knowing the length of a Windows Hello PIN
Balancing convenience against security, and how you can tune the knobs toward more security.
A C# LINQ one-liner to check if exactly one of a set of conditions is met
Maybe not the most efficient, but it's easy to write.
Gotcha: Be careful how you shut down your dispatcher queues
The dispatcher queue thread isn't useful after it has shut down, so don't try anything.
Gotcha: Don’t forget to shut down your dispatcher queues
Keep that dispatcher queue controller around, or you'll never be able to clean up.
Once your object reaches <CODE>final_release</CODE>, you are committed to destructing it (eventually)
Don't try to resurrect it.
Microspeak: Closing out, duping out
Making work items no longer appear on a query.
Why can’t I trigger a manual blue screen crash by injecting the magic key sequence?
It has to come from the physical keyboard, because that's the code that detects the magic key sequence.
If you’re just going to sit there doing nothing, at least do nothing correctly
How to be inert.
Registered command lines are just command lines, not a programming language
If you want a programming language, you know where to find one.
Functions that return the size of a required buffer generally return upper bounds, not tight bounds
An over-estimate is better than an under-estimate.
It rather involved being on the other side of this airtight hatchway: Attacking a domain administrator from the local administrator
If you pwn the machine, then you pwn everyone on the machine.
How can I get the Windows Runtime HttpClient to display a basic authentication prompt?
You need to give it some help finding the right window.
On the virtues of the trailing comma
A more uniform appearance comes with its own benefits beyond aesthetics.
How do I suppress the error box that appears when a <CODE>LoadLibrary</CODE> fails?
They don't appear often, but they do appear occasionally.
Why doesn’t my program get fancy drag/drop effects in high contrast mode with <CODE>CLSID_<WBR>DragDropHelper</CODE>?
You have to upgrade your manifest.
On using milliseconds as a measure of network latency
There's a limit to how much technology can improve.
How can I close a thread pool and cancel all work that had been queued to it?
You can put them in a group.
The case of the invalid parameter error from <CODE>MeasureOverride</CODE>
Chasing it back to its origin.
Using virtual memory placeholders to allocate contiguous address space for multiple purposes
Can you hold this for a second?
How can I add an environment variable to a process launched via <CODE>ShellExecuteEx</CODE> or <CODE>IContextMenu</CODE>?
Hooking into the way the Windows shell launches processes.
Smoothing over the differences (and defects) in the various implementations of <CODE>IMemoryBuffer</CODE>
Stick to the part that nobody messes up.
A comparison of various implementations of the Windows Runtime <CODE>IMemoryBuffer</CODE>
Every unhappy class is unhappy in its own way.
How can I expose a pre-existing block of memory as a Windows Runtime object without copying the data?
Assembling all the pieces.
How can I give away a COM reference just before my object destructs?
You have to do it before committing to destruction.
The dangerous implementations of the <CODE>IMemoryBufferReference.Closed</CODE> event
Mistakenly handing out COM references that don't work.
The useless <CODE>IMemoryBufferReference.Closed</CODE> event
It tells you that you have already lost.
Accessing a block of memory represented by a Windows Runtime IMemoryBuffer
Through the currency known as an IMemoryBufferReference.
The case of the fail-fast trying to log a caught exception
What is being thrown and why can't we log it?
Implementing two-phase initialization with ATL
ATL looks like it supports two-phase initialization, but it doesn't.
Getting a strong reference from the <CODE>this</CODE> pointer too soon
Giving out strong references to an object before you can guarantee that it will work.
What is a hard error, and what makes it harder than an easy error?
A throwback to the early days of 16-bit Windows.
C++/WinRT gotcha: Not all exceptions derive from <CODE>hresult_error</CODE>
There are also C++ standard exceptions, particularly <CODE>std::bad_alloc</CODE>.
In C++/WinRT, how can I await multiple coroutines and capture the results?, part 3
Dealing with awaitables that return <CODE>void</CODE>, and questioning our life choices.
In C++/WinRT, how can I await multiple coroutines and capture the results?, part 2
Wrapping the results and returning them in a tuple.
In C++/WinRT, how can I await multiple coroutines and capture the results?, part 1
Using a custom awaiter to suppress the <CODE>GetResults()</CODE>.
After I accidentally denied access to everyone, how do I get access back?
Congratulations, you locked your keys in the car.
How do I prevent my C++/WinRT implementation class from participating in COM aggregation?
Looking for a clue.
The case of the vector with an impossibly large size
Play threading games, win threading prizes.
How can I specify icons for my app to use on the Start menu in high contrast mode?
Put them in your manifest.
Why doesn’t my code compile when I change a <CODE>shared_ptr<T>(p)</CODE> to an equivalent <CODE>make_shared<T>(p)</CODE>?
It depends on who is doing the parameter conversion.
It rather involved being on the other side of this airtight hatchway: Attacking another program by modifying its memory
If you assume the existence of a vulnerability, you can use that vulnerability to attack something.
How do I prevent my ATL class from participating in COM aggregation? <CODE>DECLARE_<WBR>NOT_<WBR>AGGREGATABLE</CODE> didn’t work
That marker applies only to creation via the class factory.
2023 year-end link clearance
Ringing out another year.
How to allocate address space with a custom alignment or in a custom address region
Some new powers to guide the allocation.
On calling <CODE>AfxConnectionAdvise</CODE> with <CODE>bAddRef</CODE> set to <CODE>FALSE</CODE>
Playing fast and loose, and eventually you get burnt.
What does it mean when the compiler says that it can’t convert something to itself?
Why is it even thinking about a conversion?
Don’t keep state in your XAML item templates; put the state in the items
Beware of temporary alliances.
That time the Word team sent presents to the children of WordPerfect’s executive vice president
No, it wasn't creepy.
If I don’t have any items, what error should my <CODE>IFolderView::Items</CODE> method return?
It shouldn't return an error at all.
How do I get access to the <CODE>wParam</CODE> and <CODE>lParam</CODE> of the <CODE>WM_<WBR>QUERYENDSESSION</CODE> method from my MFC message handler?
Don't be afraid to see how the macros are built.
It rather involved being on the other side of this airtight hatchway: Spoofing another program
You already had the power to do it yourself.
Microspeak: Locked and loaded
Armed and ready, with the suggestion that no further changes will be needed (or accepted).
In 2023, the Gävle Goat faces a new threat to its survival
It's bock.
If the RegisterClass function takes ownership of the custom background brush, why is it leaking?
It takes ownership only on success.
How do I specify an optional string parameter to a Windows Runtime method?
Strings are sort of reference but sort of values.
How do I specify an optional parameter to a Windows Runtime method?
There is no way to express explicit optionality, but there are implicit ways.
How can I work around the absence of default parameters in the Windows Runtime?
You can fake it with overloads.
What happens if I define one environment variable in terms of the value of another environment variable?
Only certain types of dependencies are supported.
The mysterious second parameter to the x86 <CODE>ENTER</CODE> instruction
For an ABI that probably nobody uses.
A simpler version of the task sequencer that doesn’t promise fairness
Just let a kernel object control the access.
In C++, how can I make a default parameter be the <CODE>this</CODE> pointer of the caller?
Again, you can't, but you can fake it.
In C++, how can I make a member function default parameter depend on <CODE>this</CODE>?
You can't, but you can fake it.
What was the code name for 64-bit Windows?
Sundown, which was a hidden jab at the competition.
What is a static chain pointer in the context of calling convention ABI?
Buried in the System V Application Binary Interface.
Why does the Windows Portable Executable (PE) format have both an import section and input directory?
They seem to be the same thing. Do we need both?
Why does the Windows Portable Executable (PE) format have separate tables for import names and import addresses?, part 2
Keeping read-only data separate from read-write data.
Why does the Windows Portable Executable (PE) format have separate tables for import names and import addresses?, part 1
Even though their lifetimes don't overlap, you sometimes need to go back in time.
A reported vulnerability about getting paid apps for free is really about paying for free apps
Try shopping around.
In Windows 3.1 and Windows 95, what is a “grabber”?
It grabbed your MS-DOS screen and put it into a window.
On harmful overuse of <CODE>std::move</CODE>
Initial excitement leads to overuse.
On the need to keep most event sources alive if you want them to raise events
You can't receive a notification from something that doesn't exist.
How can I convert a Windows Runtime <CODE>SoftwareBitmap</CODE> to a WIC bitmap?
The reverse of <CODE>ISoftwareBitmapNativeFactory::<WBR>CreateFromWICBitmap</CODE>.
Microspeak revisited: Line of sight
A fancy way of saying unimpeded network connectivity.
If you’re going to crash on an unhandled exception, you may as well do it sooner rather than later
Avoiding the problem discovered by the case of the invalid argument exception from a method that takes no arguments.
The theory behind the IHttpFilter interface
Layering features on top of each other.
What happened to the custom exception description I threw from a C++/WinRT IAsyncAction?
The description is just a courtesy and is not part of the API contract.
Why does calling a coroutine allocate a lot of stack space even though the coroutine frame is on the heap?
Heap elision optimization kicks in, and doesn't kick out.
Starting on the other side of this airtight hatchway: Running a program that leaks memory
There are a lot of things you can do to consume memory.
What is the difference between UuidToString, StringFromCLSID, StringFromIID, and StringFromGUID2?
Different ways of stringizing a GUID.
The case of the invalid argument exception from a method that takes no arguments
Where did the invalid argument come from?
A clarification on the multithreading constraints of the <CODE>EncryptMessage</CODE> function
Reading a sentence in the context of the whole paragraph.
How can I get information about media playing on the system, and optionally control their playback?
Going to the global system media transport controls world.
“Stop sharing this folder” is not the same as “Never share this folder”
It stops sharing the folder, but that doesn't prevent you from starting it again.
Why doesn’t reduction by modulo work for floating point values?
Working out why it works for integers and seeing what goes wrong.
Why does unsafe multithreaded use of an <CODE>std::<WBR>unordered_<WBR>map</CODE> crash more often than unsafe multithreaded use of a <CODE>std::<WBR>map</CODE>?
It's all in the implementation details.
How come my custom exception message is lost when it is thrown from a <CODE>IAsyncAction^</CODE>?
Things that survive in the C++ world and things that are lost when you cross the ABI.
More notes on use of the <CODE>DS_<WBR>CONTROL</CODE> style
Styles that have to go in, and styles that have to come out. (And styles that you can choose.)
What is the thread reaper?
Should you fear the thread reaper?
What are the dire consequences of not removing all the properties that were set via <CODE>SetProp</CODE>?
Not so much any more, but it could be a sign that you forgot something.
How to support a COM interface conditionally in WRL
Customizing the QueryInterface and GetIids methods.
How to support a COM interface conditionally in C++/WinRT
Prevent <CODE>winrt::implements</CODE> from responding to it or reporting it.
The format of icon resources, revisited
Filling in some gaps.
Why is there a hash of a weak password in the Windows cryptographic libraries?
They're part of an internal self-test.
How do I add a non-copyable, non-movable object to a <CODE>std::map</CODE> or <CODE>std::unordered_map</CODE>?
Fancy emplacement.
On the failed unrealized promise of <CODE>RegOverridePredefKey</CODE>
An early attempt to sandbox the registry for a process.
What’s the difference between setting a page’s protection to <CODE>PAGE_NOACCESS</CODE> and freeing it?
Nobody can access it, but it's still there.
How can I check if I’m on a DispatcherQueue’s thread if I can’t call HasThreadAccess?
Looking at the tools you have available.
Microspeak: The As-Appropriate (AA) interviewer
So, how are things going so far?
API design principle: Reading a property or adding an event handler should not alter observable behavior
Don't punish people for looking.
On detecting improper use of <CODE>std::<WBR>enable_<WBR>shared_<WBR>from_<WBR>this</CODE>
Playing around with the standard library.
I created an overloaded operator for my C++/WinRT class, but it’s not working
Take a closer look at what you are overloading.
Why does <CODE>IFileDialog</CODE> still show non-filesystem folders when I pass <CODE>FOS_<WBR>FORCEFILESYSTEM</CODE>?
Because you need to pass through them to get there.
It rather required being on the other side of this airtight hatchway: Knowing the domain administrator password
If you give away the password, well, that's sort of on you.
Is there any performance advantage to marking a page read-only if I had no intention of writing to it anyway?
The CPU already figured it out.
A very belated improvement to the filtering of the Browse for Folder dialog so it shows only drive letters
The case of the very short UNC.
How can I get WideCharToMultiByte to convert strings encoded in UTF-16BE?
You first have to get it into a format the WideCharToMultiByte accepts.
On the confusing names for the Windows service SID types
Too much abbreviation.
A complaint about Links the Cat, the Office assistant
Do all cats do that?
How do I manually update a remote tracking branch, say, to undo a fetch?
Updating refs to point to whatever you like.
Template meta-programming: Avoiding saying a type before it is complete
Deferring use until after the class is defined.
C++/WinRT gotcha: <CODE>get_strong()</CODE> will produce a broken strong reference if destruction has already begun
A strong reference to nothing.
The dangers of releasing the last strong reference from within its own callback
Deadlocking with yourself.
Why is kernel32.dll running in user mode and not kernel mode, like its name implies?
It's just a name, and it comes from the days before user-mode/kernel-mode separation.
GetQueueStatus and the queue state
There's stuff going on that's hiding behind the innocuous-looking name.
When I try to call an exported function, the target crashes when it tries to call any Windows function
Using what you know about how functions are imported to construct a theory that matches the evidence.
How does Explorer calculate the “Date” of a file?
Mapping the generic concept to specific file types.
Why does my C++/WinRT project get unresolved externals for constructors?
You forgot to include the namespace header file, didn't you.
Why did the 16-bit _lopen and _lcreat function return -1 on failure instead of 0?
Trying to look like somebody else.
When looking to free up disk space, don’t forget your symbol file caches
They go all over the place.
How can I prevent myself from using a parameter after I’ve extracted all value from it?
You can shadow it with something useless.
I accidentally performed an operation on <CODE>INVALID_<WBR>HANDLE_<WBR>VALUE</CODE>, and it worked: What just happened?
Coincidentally valid, but not what you think.
How do I perform a case-insensitive comparison of two strings in the Deseret script?
It sort of depends on why you're comparing them.
The odd cadence of narrative engineering design documents
Following the rubric off a cliff.
Any sufficiently advanced uninstaller is indistinguishable from malware
The common pattern of trying to delete yourself.
On transferring or copying ABI pointers between smart pointers
Keep track of who owns the reference.
A freestanding JavaScript function that uses <CODE>this</CODE> is easily mistaken for a constructor
Because that's what constructors look like.
Detecting whether a tree-like data structure contains a cycle
Combining two things we already know.
When documentation cautions that something may not happen, that suggests that it normally does happen
Reading between the lines.
Just for fun: What happens when you shift a register by more than the register size?
A comparative study of processor architectures.
How do I find out more about the fail-fast exception that occurs when an exception in a PPL task goes unobserved?
Digging into the internals.
Diagnosing a crash when trying to call <CODE>ReadFile</CODE> via language interop
Checking the signatures and inferring what could have gone wrong.
How can I programmatically obtain the value of the “Make text bigger” slider?
The text scale factor property.
The popularity of DOS/4GW made Windows 95 game compatibility a little easier, but with higher stakes
A popular path to protected mode.
Just for fun: Which processors prefer sign-extended loads, and which prefer zero-extended loads?
Another pointless chart.
On writing loops in continuation-passing style, part 4
Equivalents in C# and JavaScript.
On writing loops in PPL and continuation-passing style, part 3
Explicit shared state.
On writing loops in PPL and continuation-passing style, part 2
Recursion comes back.
On writing loops in PPL and continuation-passing style, part 1
Keeping track of what to do next.
Inside STL: The different types of shared pointer control blocks
Well, some of them, at least.
Phantom and indulgent shared pointers
The phantom controls something yet holds nothing. The indulgent holds something but controls nothing.
What it means when you convert between different <CODE>shared_ptr</CODE>s
Changing the pointer while controlling the same object.
Inside STL: The <CODE>shared_ptr</CODE> constructor and <CODE>enable_shared_from_this</CODE>
Working together through a secret signal.
Inside STL: The <CODE>shared_ptr</CODE> constructor vs <CODE>make_shared</CODE>
Where to hide the control block.
Inside STL: Smart pointers
Simple pointers or more complicated pointers.
Inside STL: The array
It's just an array.
Inside STL: The deque, implementation
An array of (pointers to) arrays.
Inside STL: The deque, design
An array of (pointers to) arrays.
Inside STL: The unordered_map, unordered_set, unordered_multimap, and unordered_multiset
A hash table.
Inside STL: The map, set, multimap, and multiset
A red-black tree.
Inside STL: The lists
Your traditional singly- or doubly-linked list.
Inside STL: The string
An allocation, with a twist.
Inside STL: The vector
A contiguous memory block, reallocated as necessary.
Inside STL: The pair and the compressed pair
Two fields in one object, how hard can it be?
Misinterpreting the misleadingly-named <CODE>STATUS_<WBR>STACK_<WBR>BUFFER_<WBR>OVERRUN</CODE>
The subcode tells you why we stopped executing, and it's rarely because of a stack buffer overflow.
How to split off an older copy of a file while preserving git line history
Variation on a theme.
Perfect forwarding forwards objects, not braced things that are trying to become objects
Before you can forward something, it needs to be a something.
On the various ways of creating Windows Runtime delegates in C++/WinRT and C++/CX
Comparing and contrasting.
Before you try to do something, make sure you can do nothing
If you can't do nothing, then don't expect to be able to do something.
Why does <CODE>IAsyncAction</CODE> or <CODE>IAsyncOperation.<WBR>GetResults()</CODE> produce a <CODE>E_<WBR>ILLEGAL_<WBR>METHOD_<WBR>CALL</CODE> exception?
You're asking too soon.
How to clone a Windows Runtime map in the face of possible concurrent modification, part 3
Doing it one more time, for C++/CX.
How to clone a Windows Runtime map in the face of possible concurrent modification, part 2
Applying what we learned about vectors.
How to clone a Windows Runtime map in the face of possible concurrent modification, part 1
Applying what we learned about vectors.
How to clone a Windows Runtime vector in the face of possible concurrent modification, part 4
Translating to C++/CX and dealing with some quirks of that language.
Cloning a Windows Runtime vector in the face of possible concurrent modification, denial of service?
Can you get sent into an infinite loop?
How to clone a Windows Runtime vector in the face of possible concurrent modification, part 3
Dealing with the pesky <CODE>std::vector<bool></CODE>.
How to clone a Windows Runtime vector in the face of possible concurrent modification, part 2
Trying to make a generic solution.
How to clone a Windows Runtime vector in the face of possible concurrent modification, part 1
Backing off and retrying, but the detection is the tricky part.
Why does the compiler complain about a missing constructor when I’m just resizing my <CODE>std::vector</CODE> to a smaller size?
The compiler doesn't know that you're shrinking.
How to wait for multiple C++ coroutines to complete before propagating failure, concluding remarks
The things that could go wrong before you even start.
How to wait for multiple C++ coroutines to complete before propagating failure, finding the awaiter
Making sure to wrap the right thing.
How to wait for multiple C++ coroutines to complete before propagating failure, wrapping the awaitable
Intercepting the exception on the front side.
How to wait for multiple C++ coroutines to complete before propagating failure, preallocating the coroutine frame
Avoiding dynamic memory allocation.
How to wait for multiple C++ coroutines to complete before propagating failure, memory allocation failure
There's no good way to report the failure, so we just have to give up.
How to wait for multiple C++ coroutines to complete before propagating failure, symmetric transfer
Avoiding stack build-up.
2023 mid-year link clearance
The tradition continues.
How to wait for multiple C++ coroutines to complete before propagating failure, custom promise
Taking things into our own hands.
How to wait for multiple C++ coroutines to complete before propagating failure, peeling away at a tuple
Iterating over a tuple recursively.
How to wait for multiple C++ coroutines to complete before propagating failure, false hope
Trying to iterate over a pack.
How to wait for multiple C++ coroutines to complete before propagating failure, unhelpful lambda
The usual trick doesn't work.
How to wait for multiple C++ coroutines to complete before propagating failure, initial plunge
Remembering the exception while finishing the other work.
What can go wrong if you release an SRWLock from a thread different from the one that acquired it?
It's not a supported scenario, so anything can happen.
How can I find out the last time a user logged on from C++?
The information is in the historically-named LANMAN APIs.
The case of the <CODE>make_shared</CODE> on a C++/WinRT type
Now you can't tell who's in charge.
Why is Windows using only even-numbered processors?
Spreading out the load over cores.
Why am I being told about a signed/unsigned comparison, and why only sometimes, and how can I fix it?
How the compiler back-end can influence warnings.
The case of the invalid handle despite being managed by an RAII type, part 2
Avoiding using an object after is has destructed, and maybe using a less-well-known corner of the C++ language.
The case of the invalid handle despite being managed by an RAII type
The handle remains valid for the object's lifetime, but what is the object's lifetime?
How expensive is it to create a Windows performance counter?
The cost depends on the performance counter.
SIDs are really just another a fancy way of creating unique IDs in a decentralized way
Keeping them from colliding with each other.
The move constructor that you have to declare, even though you don’t want anyone to actually call it
Forcing named return value optimization.
Reordering C++ template type parameters for usability purposes, and type deduction from the future
You want them to go first, but you also want to deduce them.
How can I register a program to auto-relaunch if it crashes or is terminated?, redux
You can get a little bit of the way there.
Pulling sleight of hand tricks in a security vulnerability report, episode 2
I see what you did there.
How can I make WiFi passwords per-user rather than per-system?
A little-known system configuration setting.
It’s great that you provide operator overloads, but it’s also nice to have names
Avoiding the need to invoke the operator explicitly as a specialized template, among other things.
C++/WinRT event handlers that are lambdas with weak pointers to the parent class, part 3
Extending to <CODE>std::weak_ptr</CODE>.
C++/WinRT event handlers that are lambdas with weak pointers to the parent class, part 2
Working out the boilerplate.
C++/WinRT event handlers that are lambdas with weak pointers to the parent class, part 1
Assessing the state of affairs.
How do I change the directory Windows uses for user profiles? revisited
You can still do it, but it's not really supported.
On writing functions that accept any specialization of a C++ template type
There are the obvious arguments, the non-obvious arguments, and the invisible arguments.
Getting a strong reference from the <CODE>this</CODE> pointer too late
Once destruction begins, strong references mean nothing.
How can I trigger a recalc of the mouse cursor after I changed some of my internal application state?, follow-up
You still need to filter to your window, so you don't mess up another window on the same thread.
Don’t name your header file <CODE>security.h</CODE> either
You may be overriding an SDK header by mistake.
On creating (and using) a transforming iterator
It lets you change the thing being iterated over, on the fly.
Speeding up the insertion of a sorted (or mostly-sorted) key list into a <CODE>std::map</CODE> or other ordered associative container
Provide a hint for the location of the next item.
On catching exceptions in PPL tasks
You also have to catch the exception when it comes out the end of the task chain.
What is the opposite of <CODE>LVM_SORTITEMS</CODE>?
How can you unring the bell?
How do I free the pointers returned by functions like <CODE>GetTokenInformation</CODE>?
They are all pointers back into the main memory block.
It appears that I’ve never made a complete visit to the Pacific Northwest
If the marketing department is to be believed.
Summary of the duck-typing requirements of C++ COM wrappers
Wrapping up and comparing.
What are the duck-typing requirements of C++/WinRT <CODE>com_ptr</CODE>?
The experiments conclude.
What are the duck-typing requirements of wil <CODE>com_ptr</CODE>?
The experiments continue.
What are the duck-typing requirements of WRL <CODE>ComPtr</CODE>?
Another round of experimentation.
What are the duck-typing requirements of ATL <CODE>CComPtr</CODE>?
Looking for the minimum requirements.
What are the duck-typing requirements of MFC <CODE>IPTR</CODE>?
Seeing what goes wrong and trying to fix it.
What are the duck-typing requirements of <CODE>_com_ptr_t</CODE>?
As long as you fulfill the contract, based on method names.
The case of the crash in a C++/WinRT coroutine: Unpeeling the onion
Digging deeper and deeper.
Why does XAML complain that none of the overloads of <CODE>winrt::to_hstring</CODE> could be used?
Look at what you are converting from and converting to.
What can I do if I don’t want my file version number to be a sequence of four integers?
The format is enforced by the Windows file format, but you can present the information in a custom way.
Why does Task Manager disappear briefly when you switch it into or out of <I>Always on top</I>?
Ascending to another plane of existence.
How is it even possible to cheat on a musical performance practical exam?
Nature finds a way.
A quick note about WRL’s <CODE>ChainInterfaces</CODE> template class
For interfaces which extend each other.
On the finer points of cancelling timers and wait objects in Windows thread pool
Assorted little details.
What’s up with this new <CODE>memory_<WBR>order_<WBR>consume</CODE> memory order?
A weaker variation of acquire.
One way to defer work when a re-entrant call is detected
Tying a string on your finger, as a reminder to yourself.
A code comment noting the steps to take when a 256th enum field is added
A note for my future self.
Why is <CODE>std::hardware_destructive_interference_size</CODE> a compile-time constant instead of a run-time value?
The compiler is already making compile-time assumptions about the processor; you just don't realize it.
Protecting a broker from a failing delegate
Catching them in a different way.
Protecting a broker from a failing event handler
Gotta catch them all.
The case of the unhandled exception in a brokered Windows Runtime component
Digging into the event dispatch code.
No, it is not a security vulnerability that there is no certificate of appreciation for reporting a bug
It wasn't even a bug report.
How can I find the invalid class when C++/WinRT tells me that the class may not be final?
It's in the error details.
How can I convert a WIC bitmap to a Windows Runtime SoftwareBitmap? part 4: Handing it over
Just take the whole thing.
How can I convert a WIC bitmap to a Windows Runtime SoftwareBitmap? part 3: Filling the SoftwareBitmap directly
Avoiding the intermediate buffer.
How can I convert a WIC bitmap to a Windows Runtime SoftwareBitmap? part 2: Via a buffer
Passing raw pixels across.
How can I convert a WIC bitmap to a Windows Runtime SoftwareBitmap? part 1: Via an encoded stream
We'll start with the hard way, but it gets easier.
Why is there a large gap between some of the Windows system metrics indices?
An artifact of the internal implementation.
The case of the PasswordVault.Add call that the customer thinks was hung
But was it really hung? Or did it just look that way.
An ignored exception can be misinterpreted as a hang, particularly in coroutines
I mean, execution seems to have stopped.
How do I modify the contents of a boxed Windows Runtime value?
Once it's in the box, you can't change it.
What is the maximum size of a process environment block?
There's no hard-coded limit in Windows, but maybe somebody else has a limit.
C++17 creates a practical use of the backward array index operator
Possibly more than just a curiosity.
What is this <CODE>[uuid(…)]</CODE> in front of my C++ class declaration?
It's an old nonstandard syntax that you should try to move away from.
If you want to watch games on your tractor, please use your own iPad
Not an approved use of the embedded system.
How can I box a <CODE>std::optional</CODE> into a C++/WinRT <CODE>IInspectable</CODE>?
There's a handy conversion for that, but you have to know where to look.
The <CODE>WM_GETDLGCODE</CODE> message is a query message and should not modify state
Wait until you actually get the message.
How can I try to escape the disease-ridden hot-tubs known as the TEMP and Downloads directories?
You can ask that dependent DLLs be loaded from the System32 directory.
Using the contents of a file to define an MSBuild property
A little trick that maybe should be better known.
Adventures in application compatibility: The case of the jump into the middle of an instruction from nowhere
Another rogue patcher.
How unique must the <CODE>uIdSubclass</CODE> parameter be when I call <CODE>SetWindowSubclass</CODE>?
Each one identifies an instance of the subclass for the window.
Why am I getting a weird error about <CODE>promise_type</CODE> when I try to write a coroutine? part 2
Are you even writing a coroutine?
Why does the usage of the initial registers of a Win32 process depend on whether it is a 32-bit or 64-bit process?
Well, I mean, it's a different processor.
On the proper care and feeding of the enigmatic <CODE>GetDistanceOfClosestLanguageInList</CODE> function
Thinking about how this could be used.
Exploiting C++/WinRT CRTP: Property and event declarations
They don't have to be methods; they just have to look like methods.
Mind your C++/WinRT namespaces
What you say changes meaning depending on where you are.
How can I create a git feature branch that can merge into multiple other branches?
Just work in your patch branch.
Did Vienna ever exist or was it just misinformation?
It could be neither.
The 2023/2024 Seattle Symphony subscription season at a glance
The pocket reference guide for 2023/2024.
What is the expression language used by the Resource Compiler for non-preprocessor expressions?
Oddly different for a different audience.
When should I use <CODE>CS_GLOBALCLASS</CODE>?
When you want to be summoned from anywhere.
From a Windows app, how can I check whether there is an app installed that implements a particular URI scheme?, part 2
Alternatives that work for unpackaged apps.
From a Windows app, how can I check whether there is an app installed that implements a particular URI scheme?
Additional function to let you see what is available.
Microspeak: Baseball card
A one-page summary, and this time we mean it.
I can create a read-only page, but why not a write-only page?
At the end of the day, it comes down to processor support.
Enumerating Windows clipboard history in PowerShell
Doing Windows Runtime things from PowerShell.
Enumerating Windows clipboard history in C++/WinRT and C#
Exploring the clipboard history API.
If you want to sort a Windows Runtime collection, you may first want to capture it into something a bit easier to manipulate
Moving everything into the same universe.
Once you give away the farm, you can’t take it back: Recovering from a rogue administrator
Who knows what happened to it while you weren't looking.
The unintentionally-expanding scope of the <CODE>SEM_NOGPFAULTERRORBOX</CODE> flag
Other suppressions caught in its net.
Understanding a mysterious <CODE>RPC_<WBR>E_<WBR>WRONGTHREAD</CODE> exception when we’re on the right thread
Things can go wrong in ways you may not have realized.
Why am I getting an unhandled exception from my C++ function that catches all exceptions?
Yes, you caught an exception. But that's not the one that went unhandled.
Avoiding the redundancy of adding the object files to both the primary project and its unit test
Adding another level of indirection.
Microspeak: Light reading (ironic)
Just a fun diversion.
The case of the mysterious "out of bounds" error from <CODE>CreateUri</CODE> and <CODE>memmove</CODE>
Unfolding some COMDATs.
What happens if you co_await a std::future, and why is it a bad idea?
Just waiting for something to finish.
What does it mean when my cross-thread COM call fails with <CODE>RPC_<WBR>E_<WBR>SYS_<WBR>CALL_<WBR>FAILED</CODE>?
Look for an unresponsive recipient.
What are the potentially-erroneous results if you don’t pass NULL as the lpNumberOfBytesRead when issuing overlapped I/O?
It's to avoid a self-inflicted race condition.
Why are the Windows chassis hardware button hotkeys so strange?
Operating within the constraints of the system.
Adventures in application compatibility: The case of the display control panel crash on exit
When you get a 64-bit pointer, you probably should remember all 64 of the bits.
The case of the <CODE>RPC_<WBR>E_<WBR>DISCONNECTED</CODE> error thrown from <CODE>await_<WBR>resume</CODE>
You can keep trying, but the result won't change.
A more direct and mistake-free way of creating a process in a job object
A new attribute for creating a process directly in a job object.
How can I get the original target of a shortcut without applying any 32-bit adjustments?
Disable the fancy tracking.
The frustration of finding a suitable time to hold a meeting when the participants are evenly spaced around the globe
Somebody has to suffer, but we try to make sure it's not the same person each time.
It rather involved being on the other side of this airtight hatchway: Reading the user’s saved passwords
Only the user can read their own saved passwords, so you must already have gained total control over the user.
Inside C++/WinRT: Coroutine completions: Cancellation propagation
Giving up.
Hyperlinking to Hutchison Whampoa Limited is still forbidden
Didn't make you look.
Inside C++/WinRT: Coroutine completions: Avoiding reentrant completion
Resuming the coroutine directly, rather than consuming yet more stack.
Inside C++/WinRT: Coroutine completion handlers: Disconnection
When the other end hangs up without even saying good-bye.
Inside C++/WinRT: Apartment switching: Error reporting
If you can't get back to where you started, who you gonna call?
Inside C++/WinRT: Apartment switching: COM without COM
Also known as Nano-COM.
Inside C++/WinRT: Apartment switching: Unwinding the stack
Reducing stack usage.
Inside C++/WinRT: Apartment switching: Bypassing the context callback
Reducing stack usage.
Inside C++/WinRT: Apartment switching: Unblocking the outgoing thread
Avoiding the problem of the synchronous apartment-changing callback: Let the outgoing thread do whatever it wants to do next.
Inside C++/WinRT: Apartment switching: The basic idea
Getting back to where you started.
Inside C++/WinRT: Coroutine completions: The oversimplified version
Resuming the coroutine when the asynchronous work completes.
How can I call a method on a derived class from a base class, say, to get a strong reference to the containing object?
A variety of patterns are available.
Windows Runtime asynchronous operations can fail in two different ways, so make sure you get them both
Fail me now or fail me later.
It rather involved being on the other side of this airtight hatchway: Attacking a user by modifying that user’s files
You're just attacking yourself.
A trio of dubious denial-of-service security vulnerability reports which are just style points piled on top of nothing
You could have accomplished the same thing with a garbage file.
Making C++ primitive types meaningfully movable when they have sentinel values
The value actually moves now.
Adventures in application compatibility: Querying for an internal interface
Reaching in and fiddling the internal knobs.
How should I interpret the various values of <CODE>NLM_CONNECTIVITY</CODE>?
Different levels of connectedness.
What does it mean when I get a mismatch from MSVC for <CODE>_COROUTINE_ABI</CODE>?
The two different kinds of coroutine interfaces shouldn't be mixed and matched.
It rather involved being on the other side of this airtight hatchway: Administrator attacking a domain account on the local system
You don't gain control over any other systems.
On leading underscores and names reserved by the C and C++ languages
The rules laid out.
Dubious security vulnerability: Granting access to SIDs that don’t exist yet
You can put anyone you like on your guest list, even if they don't exist.
How can I force a user to have a specific SID prefix, so that they go into a particular group?
The prefix doesn't define group membership.
Using perfect (and imperfect) forwarding to simplify C++ wrapper classes
Just call that other thing the same way you called this thing.
It rather involved being on the other side of this airtight hatchway: Gaining code execution from a Trojan horse
You already have code execution, so it's not surprising that you can gain code execution.
Opinionated notes on the Windows.Data.Json namespace
It's available if you need it, but there are some tricks and pitfalls, and you may very well have better options.
2022 year-end link clearance
Closing the book on another year.
When I create a waitable timer with a callback, do I have to wait alertably on that specific timer before the callback will run?
Any alertable wait will do.
How can I detect programmatically whether Windows is an N or KN version?
Don't check the version, just check the feature.
After importing a TLB, how do I convert from one type of <CODE>_com_ptr_t</CODE> to another?
Digging into the source code.
Why can’t I print when I boot Windows into audit mode?
It's not all there.
The worst-selling Microsoft software product of all time: OS/2 for the Mach 20
Count 'em on one hand.
The case of the recursively hung <CODE>WM_DRAWCLIPBOARD</CODE> message
Understanding why it's happening and how you can avoid it.
Is there a fixed virtual address that the system promises never to use for anything, so I can use it?
Everything is up for grabs.
Running some UI code on a timer at a higher priority than your usual timer messages, or without coalescing
You can build your own timer system.
Why doesn’t the BitLocker wizard let me save the BitLocker key on an encrypted drive?
Don't lock your keys in the car.
On the large number of ways of expressing Microsoft Visual C++ compiler versions
So many version numbers.
Why doesn’t Windows use the 64-bit virtual address space below <CODE>0x00000000`7ffe0000</CODE>?
It does use it, although it doesn't look like it.
Inside C++/WinRT: <CODE>IReference<T></CODE>
Reverse-engineering the usages from the code.
In C++/WinRT, how do I create or consume an <CODE>IReference<T></CODE> that wraps a particular value?
Conversions to and from <CODE>IReference</CODE>.
Thank you for conference announcement, but it would help if you told me what your conference was about
There was an announcement of an all-day Microsoft-internal conference featuring a project I will call Project Enzyme. The announcement went like this: The Project Enzyme Forum is our flagship community conference that brings together engineers, project managers, data scientists, and designers from around the company to learn about Project Enzyme and get a first look at some of the exciting new improvements in the platform. Senior leaders will share their vision for Project Enyzme and how we can use it to create the next wave of cutting-edge products and experiences. Other senior leaders will participate in a ...
What does it mean when the compiler tells me that <CODE>promise_type</CODE>: is not a member of <CODE>coroutine_traits<void></CODE>?
Applying your understanding of the coroutine transformation.
How can I do the opposite of <CODE>compare_exchange</CODE> and exchange if the value is <I>different</I>?
An exchange with itself has no effect on the value.
If you’re going to wrap a Windows Runtime event, you may as well let the wrapped event source manage the token
It keeps the original object in control.
Reminder: If you intend to use a C++/WinRT namespace, you must include that namespace’s header file
Various errors that can be traced back to breaking that one rule.
Trouble connecting to Web sites and services because of certificate errors? Check if you’re being held captive
There's a man in the middle.
Instead of a C++ template parlor trick, why not just add support based on whether the header file has already been included?
Header file inclusion order dependencies.
C++ template parlor tricks: Using a type before it is defined
You can talk about hypothetical things, hoping that a real thing shows up later.
Not even trying to cross an airtight hatchway: Calling a function in your own process by synthesizing a function pointer
You can already attack yourself in far more interesting ways.
I used <CODE>FILE_FLAG_SEQUENTIAL_SCAN</CODE> but it didn’t seem to speed up my sequential scanning
It triggers prefetching, but your usage pattern may mean that prefetch doesn't mean much.
Dubious security vulnerability: Reading the files in the WindowsApps folder
You already had access to those files, by virtue of the fact that they ran in the first place.
What kind of caller diagnostic information can I get from exceptions thrown by C++/WinRT and wil?, C++20 edition
The state of the art has moved forward slightly.
The case of the application that used thread local storage it never allocated
Of course it's there, isn't it? I mean, it's always been there.
How do I pass a raw pointer to a Windows Runtime function?
Raw pointers don't exist in the Windows Runtime, so you'll have to re-express it in terms of something that does.
How does JavaScript represent output parameters in the Windows Runtime?
It has to fake it.
Sometimes perfect forwarding can be too perfect: Lazy conversion is lazy
Lazy conversion is too lazy.
Microspeak: Breaking into jail
Just asking for trouble.
What kind of caller diagnostic information can I get from exceptions thrown by C++/WinRT and wil?
A survey of the current state of the art.
On Windows Runtime asynchronous operations with critical progress reports
Make the caller provide the progress handler up front.
How soon is too soon to report progress from a C++/WinRT coroutine that implements a Windows Runtime asynchronous operation with progress?
If a progress is sent to a forest but there's no one there to hear it.
Why won’t C++/WinRT let me <CODE>co_await</CODE> a <CODE>CoreDispatcher</CODE> or <CODE>DispatcherQueue</CODE>?
Making sure you meet the usual prerequisites.
It’s important to get the most difficult part out of the way by putting it in the title
It does much less harm there than in the body.
How does Windows decide whether your computer has limited or full Internet access?
Looking for special servers.
C++ constexpr parlor tricks: How can I obtain the length of a string at compile time?
The <CODE>constexpr</CODE>'ification of <CODE>strlen</CODE>.
If I issue multiple overlapped I/O requests against the same region of a file, will they execute in the order I issued them?
Overlapped I/O refers to temporal overlap, and that includes completion out of order.
On the dangers of giving a product feature the name “new”
It may be new today, but it won't be new tomorrow.
Why don’t Windows functions begin with a pointless MOV EDI,EDI instruction on x86-64?
Applying the hot-patch in a different way.
Why is there a system sound called Asterisk? What sound does an Asterisk make anyway?
It's to accompany the asterisk, back when we had an asterisk.
My niece is just here for the food
The important part of the trip.
In the debugger, how can I get from a projected type back to the C++/WinRT implementation?
Look behind you.
Why am I getting a <CODE>RPC_E_WRONG_THREAD</CODE> exception when I’m on the right thread?
It's the wrong thread from XAML's point of view.
How does the dialog manager calculate the average width of a character?
It's a simple formula, perhaps too simple.
A history of the <CODE>fd_set</CODE>, <CODE>FD_SETSIZE</CODE>, and how it relates to WinSock
The <CODE>fd_set</CODE> started out as just a bitmap.
What is a “Select Administrator”? Is that some special elite kind of administrator?
It's two different messages that combine in an interesting way.
How can I test my geolocation code on a system without a GPS?
You can use the Windows Device Portal to create a synthetic GPS.
Setting properties in C++/WinRT is done by a function call, but you need to call the function the right way
The new value is the function parameter.
Why am I seeing two WRITE requests at the same offset from a single call to WriteFile?
It started as one write, but turned into a lot of other things.
What can or should I do with the cursor handle returned by <CODE>SetCursor</CODE>?
You can put it back, but sometimes you need to make sure you do it before anybody else can see the change.
Why are many Windows user interface elements positioned at multiples of 4 or 8 pixels?
It depends on whose pixels you're talking about.
Why can’t I programmatically inspect the check boxes in the Security property sheet any more?
Abusing the <CODE>ISecurityInformation::<WBR>PropertySheetPageCallback</CODE> method.
What happens if my C++ exception handler itself raises an exception?
And comparing to the handling of structured exceptions.
Is it true that raising a structured exception from a structured exception handler terminates the process?
Untangling the myth.
Why is there a <CODE>make_unique</CODE>? Why not just overload the <CODE>unique_ptr</CODE> constructor?
You'll have to resolve the ambiguity, so you're still typing a lot.
Why is there a <CODE>passwords.txt</CODE> file on my system that’s filled with somebody else’s passwords?
It's part of an open-source password strength package.
How can I check the integrity level of my process?
A series of range checks.
The case of the memory corruption from a coroutine that already finished
The zombie coroutine.
How can I check whether the user’s network connection is roaming or metered?
The classic way and the Windows Runtime way.
One possible reason why your program crashes when submitted to the Microsoft Store, but it runs fine on your machine
Check your minimum requirements.
Clicking past the warning that you are about to cross the airtight hatchway: Vulnerable file type that you are warned about
Acknowledging the danger but complaining about it anyway.
On the overloading of the address-of operator <CODE>&</CODE> in smart pointer classes
Different patterns, which means you're never sure what you're going to get.
How can I perform a CopyFile, but also flush the file buffers before the destination handle is closed?
Your callback function can do things with the handle, even extend their lifetime.
The Import Address Table is now write-protected, and what that means for rogue patching
Making a potential attack vector less attractive.
The gotcha of the C++ temporaries that don’t destruct as eagerly as you thought
You have to look for the end of the full expression.
Starting on the other side of this airtight hatchway: Overwhelming the system
It'll take time for things to drain out.
Feel free to stop using IMultiLanguage2::DetectInputCodepage
You should have been keeping your eye on the code page all along.
Debugging coroutine handles: Looking for the source of a one-byte memory corruption
Applying what we know about coroutines.
I did that merge-as-cherry-pick thing, but my change still didn’t merge correctly
A case study of what goes wrong.
Why does COM express GUIDs in a mix of big-endian and little-endian? Why can’t it just pick a side and stick with it?
Oh, it does pick a side. It's just that some dashes are missing.
Microspeak: Break glass
Metaphorically breaking the glass in case of emergency.
What does the C++ error “A pointer to a bound function may only be used to call the function” mean?
You got all set to call a function but forgot to call it.
Why am I receiving <CODE>SHCNE_<WBR>UPDATEDIR</CODE> notifications that my code never generates?
You did generate them, indirectly.
How can I get WRL to link my object into its activation factory?
More magic macros.
How can I trigger a recalc of the mouse cursor after I changed some of my internal application state?
Go through the standard process one more time.
Janet Jackson had the power to crash laptop computers, follow-up
Deeper speculation by others.
Why load fs:[0x18] into a register and then dereference that, instead of just going for fs:[n] directly?
Simplifying the compiler.
Serializing asynchronous operations in C++/WinRT, gotchas and final assembly
Cancellation and abandonment.
Serializing asynchronous operations in C++/WinRT
Making them run one after the other.
Creating a lazy-start C++/WinRT coroutine from an eager-start one, part 2
Keeping a turkey in suspense.
Creating a manual-start C++/WinRT coroutine from an eager-start one, part 1
Ready, wait for it.
Serializing asynchronous operations in C#
Making them run one after the other.
The case of the APC that never arrives
Or maybe it did?
How do I consume raw COM interfaces from a Windows Runtime metadata file?
There's a handy tool for generating raw COM interfaces.
It rather involved being on the other side of this airtight hatchway: Replacing a service binary
Looking for misconfigured services.
Commonly-supported Windows shortcuts for pasting without formatting
Variations on a paste theme.
Is there any meaningful way to compare two Time Travel Debugging positions?
They are basically in chronological order, subject to the uncertainty of multiprocessing.
The case of the recursively-acquired non-recursive lock, and how to avoid the unintentional reentrancy
Watch what you do when you hold a lock.
Why am I getting a null pointer crash when trying to call a method on my C++/WinRT object?
Requirements weren't met.
The x86-64 processor (aka amd64, x64): Whirlwind tour
Pretty much a 64-bit-ification of the i386.
The AArch64 processor (aka arm64), part 25: The ARM64EC ABI
Aligning with the x86-64 calling convention.
The AArch64 processor (aka arm64), part 24: Code walkthrough
Putting theory into practice.
The AArch64 processor (aka arm64), part 23: Common patterns
Learning to recognize various code generation patterns.
The AArch64 processor (aka arm64), part 22: Other kinds of classic prologues and epilogues
Taking shortcuts, or maybe adding steps.
The AArch64 processor (aka arm64), part 21: Classic function prologues and epilogues
Implementing the ABI.
The AArch64 processor (aka arm64), part 20: The classic calling convention
How parameters are passed.
The AArch64 processor (aka arm64), part 19: Miscellaneous instructions
Sweeping up the crumbs.
The AArch64 processor (aka arm64), part 18: Return address protection
Making it even harder to smash the return address.
The AArch64 processor (aka arm64), part 17: Manipulating flags
Trying to twiddle the knobs directly.
The AArch64 processor (aka arm64), part 16: Conditional execution
Making decisions.
Janet Jackson had the power to crash laptop computers
Not an artistic judgement. Just a technical one.
The AArch64 processor (aka arm64), part 15: Control transfer
We're going places.
The AArch64 processor (aka arm64), part 14: Barriers
Keeping things in the right order.
The AArch64 processor (aka arm64), part 13: Atomic access
Don't let someone else get a word in edgewise.
The AArch64 processor (aka arm64), part 12: Memory access and alignment
The load and store part of the load/store architecture.
The AArch64 processor (aka arm64), part 11: Loading addresses
Finding a needle in the haystack of the 64-bit address space.
The AArch64 processor (aka arm64), part 10: Loading constants
Getting them into a register.
The AArch64 processor (aka arm64), part 9: Sign and zero extension
Nothing new here, but old things being used in clever ways.
The AArch64 processor (aka arm64), part 8: Bit shifting and rotation
Sliding around.
The AArch64 processor (aka arm64), part 7: Bitfield manipulation
Peeking inside the words.
The AArch64 processor (aka arm64), part 6: Bitwise operations
And their very strange immediates.
The AArch64 processor (aka arm64), part 5: Multiplication and division
Arithmetic gets harder.
The AArch64 processor (aka arm64), part 4: Addition and subtraction
Starting with the basic arithmetic.
The AArch64 processor (aka arm64), part 3: Addressing modes
The ways of accessing memory.
The AArch64 processor (aka arm64), part 2: Extended register operations
The weird ways of transforming the value in a register.
The AArch64 processor (aka arm64), part 1: Introduction
Make it a double.
Yes, the 8086 wanted to be mechanically translatable from the 8080, but why not add the ability to indirect through AX, CX and DX?
So many addressing modes, so little space.
Using C++/WinRT’s <CODE>final_release</CODE> to control which thread destructs your object
Once it's yours, you can take it wherever you like.
Making sure that people use <CODE>make_unique</CODE> and <CODE>make_shared</CODE> to make your object
Using a secret signal in what is required to be a public constructor.
My class derives from <CODE>std::enable_<WBR>shared_<WBR>from_<WBR>this</CODE>, but <CODE>shared_<WBR>from_<WBR>this()</CODE> doesn’t work
Various cases where your enabled <CODE>shared_<WBR>from_<WBR>this</cODE> doesn't work.
Microspeak: The one-pager
Rarely ever one page long.
C++ coroutine gotcha: Falling off the end of a function-level catch
You still have to return something, but today's compilers don't warn you.
Processing a ValueSet or PropertySet even in the face of possible mutation, part 4
Processing the result differently.
Processing a ValueSet or PropertySet even in the face of possible mutation, part 3
Applying and adapting the pattern.
Processing a ValueSet or PropertySet even in the face of possible mutation, part 2
The first one there has to stay there until the work is done.
Processing a ValueSet or PropertySet even in the face of possible mutation, part 1
Watching out for iterator invalidation.
How can I provide a Windows Runtime ValueSet or PropertySet while non-intrusively monitoring changes to it?
Use the right kind of observer.
Windows Runtime observable collections don’t mix well with multithreading
Concurrent observation and mutation is a bit of a mess.
How can I write a coroutine that produces a result but keeps on running?
Returning without returning.
The empty Windows Runtime string is not just a pretty face
It really is an empty string.
How to write like Raymond: Intentional typographical errors, part 2
I can take you there, but you'll have to fix one tiny typo. Let's see if you can do that.
The case of the constructor that was being ignored
Retracing the compiler's steps.
Under what conditions can I modify the memory that I received in the form a <CODE>STGMEDIUM</CODE>?
If you own it, then it's yours to do with as you wish.
2022 mid-year link clearance
Another accumulation of stuff.
How can I build a URL query string in the Windows Runtime?
Pretend you're submitting a form.
How can I parse URL query string in the Windows Runtime?
There's a query parser built in, but it's a little cantankerous.
Microspeak: Inside baseball
Specialized jargon comprehensible only to a select few.
Starting on the other side of the airtight hatchway: Attacking the batch file parser
Why stop at denial of service when you have remote code execution?
The case of the mysterious over-release from deep inside the marshaling infrastructure
The tedium of monitoring reference counts.
Writing a marshal-by-value marshaler, part 2
Maybe you don't need a copy on the other side.
Understanding the marshaling flags: The free-threaded marshaler
Keeping your eye on the reference count.
Writing a compound marshaler
On the nature of streams.
On the importance of managing the stream pointer when manipulating marshal data
Making sure things are ready for the person who comes after you.
Writing a marshal-by-value marshaler, part 1
Creating an identical object on the other side.
The skeleton marshaler that does default marshaling
Starting with a marshaler that has no special features.
An initial look at the mechanics of how COM marshaling is performed
Pretend you're an oracle.
What are the various usage patterns for manually-marshaled interfaces?
The outermost simple layer, and the more complex inner layer.
Adventures in application compatibility: The case of the PC-relative indirect jump that reads from nowhere
A little too much copy/pasta.
How do I retrieve an extremely large range of cells from Excel if the clipboard functions all time out?
Maybe you shouldn't be using the clipboard.
How can I wait more than 30 seconds for a delay-rendered clipboard format to become rendered?
Provide your own delay.
Is there a maximum size for Windows clipboard data? Because I’m getting null for something I know should be there
There is no pre-set maximum size, but that null might be coming from somewhere else.
How to write like Raymond: Contacting another team for the first time
Flattery will get you in the door.
An opinionated comparison of C++ frameworks for consuming and implementing Windows Runtime types
The three leading contenders.
Assessing a read-after free for security implications: The string comparison
Can you get elevation? What are you disclosing?
Converting between Windows <CODE>FILETIME</CODE> and Unix <CODE>time_t</CODE> without having to type the magic number 116444736000000000
It's not exactly a number that you can rattle off the top of your head.
The case of the COM reference that suddenly went bad in the middle of a coroutine
Is the coroutine really to blame?
The <CODE>activeCodePage</CODE> manifest element can be used for more than just setting UTF-8 as the active code page
AppLocale grows up.
On passing iterables of iterables in the Windows Runtime
Different projections help you out in different ways, some more than others.
Why do rescued stack traces often have instability at the start?
Trying to pick up the scent.
Rescuing a stack trace the lazy way on x86-64 (aka amd64) after the debugger gave up
Looking for a good frame to start from.
How can I get my <CODE>FileSavePicker</CODE> to open in the same folder that was picked by the <CODE>FileOpenPicker</CODE> or <CODE>FolderPicker</CODE>?
Make them all share the same settings identifier.
What is the CreateExplorerShellUnelevatedTask scheduled task?
To keep Explorer running unelevated.
How does Windows decide whether a newly-created window should use LTR or RTL layout?
Gathering the algorithmic details scattered throughout the documentation into one place.
Writing a sort comparison function, part 4: descending sort
Flipping the script.
Writing a sort comparison function, part 3: spaceships
Sprinkling some C++20 magic.
Writing a sort comparison function, part 2: avoid unnecessary expense
Avoid doing the work until needed.
Writing a sort comparison function, part 1: basics
Trying to avoid the pitfalls.
How can I synthesize a C++20 three-way comparison from two-way comparisons?
Multiple ways of synthesizing a comparison.
Should I pay attention to the warning that I’m <CODE>std::move</CODE>‘ing from a trivial type? Part 2
It's not about the journey. It's about the destination.
Should I pay attention to the warning that I’m <CODE>std::move</CODE>‘ing from a trivial type? Part 1
It's just informing you that what you're doing may not have the desired effect, depending on what your desired effect was.
On ways of finding out when a C++/WinRT IAsyncAction has run to completion
Just some noodling on ideas.
A brief summary of the various versions of the Security Descriptor Definition Language (SDDL)
Things come, and rarely go.
Why does my overridable Windows Runtime method turn into a protected method, and how can I work around it?
Just an odd rule, but it's there for a reason.
On awaiting a task with a timeout in C++/WinRT
Doing the same thing, just in another language.
On awaiting a task with a timeout in C#
Putting something together from pieces you already have.
Producing an empty Windows Runtime type in C++/WinRT
How to say that you don't have anything.
What are these SIDs of the form S-1-15-3-xxx?
They are app capability SIDs.
What are these SIDs of the form S-1-15-2-xxx?
They are app container SIDs.
The case of the failed exchange of the vtable slot
Another application compatibility case.
What’s up with <CODE>std::piecewise_construct</CODE> and <CODE>std::forward_as_tuple</CODE>?
When you need to pass two sets of variadic parameters, and to work around other extremely weird edge cases.
How do I decode a <CODE>#pragma detect_mismatch</CODE> error?
The linker tells you a bunch of stuff. Here's what it means.
Be careful with that thing, it’s a confidential coffee maker
Just keep it under wraps.
How can I force a <CODE>WriteFile</CODE> or <CODE>ReadFile</CODE> to complete synchronously or hang, in order to test something?
You can use a named pipe.
Trying to create a factory that remembers the parameters to pass to another method
Lost in a twisty maze of universal references.
How do I access and customize the IInspectable methods of a Windows Runtime class written in C++/WinRT?
Special access methods, but normal overrides.
Class template argument deduction may be the new hotness, but we’ll always have maker functions
It's all or nothing, and sometimes you don't have all.
The Applesoft Compiler (TASC): We have the source code, in a sense
The desperation of programming under tight memory constraints.
The x86 architecture is the weirdo, part 2
It does everything differently, because of course it does.
How can I <CODE>co_await</CODE> on a Windows Runtime async action or operation with a timeout?
You can combine it with a timeout.
How can I tell the WIL <CODE>RETURN_<WBR>IF_<WBR>FAILED</CODE> macro that some errors are ignorable?
You can create a custom filter using things you already know how to do.
A survey of how implementations of Windows Runtime events deal with errors
All happy event delegates are alike; each unhappy event delegate is unhappy in its own way.
Notes on BitLocker and the TPM and the pre-boot password or PIN
How to get BitLocker and the TPM to play friendly.
Now that computers have more than 4MB of memory, can we get seconds on the taskbar?
Letting the CPU go to sleep.
Please repeat yourself: The <CODE>noexcept(noexcept(…))</CODE> idiom
Each time you say it, it means something different.
If I am getting a DllNotFoundException from Windows 10 N, how do I get the missing DLLs?
Enter the Media Feature Pack.
All Windows threadpool waits can now be handled by a single thread
Come in and join the thread, the water's fine.
Adventures in application compatibility: The case of the RAII type that failed to run its destructor
Breaking all the rules and getting away with it.
How are Windows Runtime GUIDs represented in JavaScript?
They're strings, in various formats.
The <CODE>std::invoke</CODE> function does more than invoke functions
Inspiring a new level of code obfuscation.
Should I translate my window class names?
Who's going to read it?
Why am I getting the error message “This is only for weak ref support” when I try to create a C++/WinRT weak reference?
Reverse-engineering the error message.
How to become a Senior Detective, according to Murderville
A little copy pasta will take you far.
Why are there separate Program Files and Program Files (x86) directories?
Why can't we just combine them?
Why is every other line of my file mysteriously changed to nonsense Chinese characters?
Decoding another type of mojibake.
The 2022/2023 Seattle Symphony subscription season at a glance
The pocket reference guide for 2022/2023.
Behind C++/WinRT: How does C++/WinRT get the list of implemented interfaces?
Doing some template metaprogramming reverse engineering.
Behind C++/WinRT: How does C++/WinRT decide which interfaces are implemented?
Finding the code that does the interface detection.
Why does C++/WinRT say that <CODE>first_interface</CODE> is not a member of <CODE>winrt::impl::interface_list<></CODE>?
An empty list has no first element, but why is the list empty?
A hypothetical magical musical power: The one-piece wonder
You can play one thing well, but only one.
How do I un-ignore an Outlook email thread, and how does it work?
A peek under the covers.
Injected class names: The C++ feature you didn’t even realize that you were using
Simplifying the name of what you are.
Making our multiple-interface query more C++-like, part 2
Letting you specify which interfaces are required and which are optional.
Making our multiple-interface query more C++-like, part 1
Maybe we can write a nice wrapper.
Reducing chattiness by querying for multiple interfaces at once, part 2
You can just load them into the cache.
Reducing chattiness by querying for multiple interfaces at once, part 1
The multiple-query alternatives.
How expensive is PssCaptureSnapshot? How fast is it? How much memory does it consume?
Think of it as a copy-on-write copy, like the Volume Snapshot Service.
Optimizing code to darken a bitmap, part 5
Once more, with ARM feeling.
Optimizing code to darken a bitmap, part 4
Bringing out the big SIMD guns, for x86 at least.
Optimizing code to darken a bitmap, part 3
Jumpless conditionals via masking.
Optimizing code to darken a bitmap, part 2
Exploiting parallel arithmetic.
Optimizing code to darken a bitmap, part 1
Starting with the basics.
If the slim reader/writer lock (SRWLOCK) doesn’t remember who the shared lock owner is, does that mean it’s okay to acquire it recursively?
No, but you sort of knew that deep down.
Filtering out fake keyboards from the GetRawInputDeviceList function
Maybe look to see if it has any keys.
How can I detect whether the system has a keyboard attached? On the GetRawInputDeviceList function
You can enumerate the input devices and see if there's a keyboard.
How does Windows decide what instructions to provide for unlocking the PC?
It sniffs around at your hardware capabilities.
Zero-cost exceptions aren’t actually zero cost
Shifting the cost to the exceptional path.
How can I monitor changes to the reference count of a C++/WinRT object?
A little cookbook.
COM asynchronous interfaces, part 9: Asynchronous release, assembling a solution
Juggling the references in the right way.
COM asynchronous interfaces, part 8: Asynchronous release, the problems
If you don't need something any more, then you usually don't really care when it gets taken away.
COM asynchronous interfaces, part 7: Being called directly when the operation completes
Becoming part of the system.
COM asynchronous interfaces, part 6: Learning about completion without polling
You can peek at the handle hiding inside the synchronization interface.
COM asynchronous interfaces, part 5: The unreliable server
Trying not to hang when the server is hung.
COM asynchronous interfaces, part 4: Doing work while waiting for the asynchronous operation
Just checking in on how things are going.
COM asynchronous interfaces, part 3: Abandoning the operation after a timeout
Waiting a little while, but not forever.
COM asynchronous interfaces, part 2: Abandoning the operation
Simply losing interest.
COM asynchronous interfaces, part 1: The basic pattern
Letting things run on their own, and then coming back for the answer later.
Notes on COM aggregation: How do you implement tear-offs in an aggregated object?
Keeping the controlling unknown in the know.
Notes on COM aggregation: Obtaining a pointer to your aggregated partner without introducing a reference cycle
Putting your thumb on the scale.
How can I find out which processor architectures are supported via emulation by the current system?
Fortunately, there's a special function for that, or at least for enough of that to serve your needs.
The cats sitting on a fence in early builds of Windows 8
Something to look at when all is lost.
On finding the average of two unsigned integers without overflow
Another code golfing adventure.
The case of the stack overflow exception when the stack is nowhere near overflowing
There's a problem with the stack that prevents it from growing, so you could consider than an overflow.
A closer look at the stack guard page
It is there to detect stack growth, but only if the stack grows into it.
Gotcha: C++/WinRT weak_ref.get() doesn’t get the weak reference; it gets the strong reference
What traditionally goes by the name <CODE>lock()</CODE>.
How do I customize the color of the Windows blue screen?
It's hard-coded now, sorry.
Why does the Windows debugger engine show a bunch of hex digits after one of the DLL names?
It's trying to disambiguate name collisions.
How can I recognize whether two handles refer to the same underlying file?
Exploring several avenues, hoping one of them leads somewhere.
How can I recognize file systems that don’t support 64-bit unique file identifiers?
It's buried somewhere in the specification.
What are these weird internal Visual C++ runtime functions named NLG?
They are part of exception handling.
I deleted a file from Explorer, but it came back when I refreshed, and I get Access Denied if I try to delete it again
The file is circling the drain, but it's not gone yet.
The MainWindowHandle property is just a guess based on heuristics
If you really need to find your main window, you'll have to come up with something more determinstic.
Fixing the crash that seems to be on a <CODE>std::move</CODE> operation
Getting the order of evaluation to be what you want.
The mystery of the crash that seems to be on a <CODE>std::move</CODE> operation
But is that really what's happening?
The error code you get might not be the one you want
Some error codes are contractual, but most aren't.
How to write like Raymond: The typing-saver
One of my little catch phrases.
C# and C++ type aliases and their consequences
Just some idle thoughts, and what it means for debugging.
Resolving confusion over how to return from a C++ coroutine
You have a few options, but you have to stay with it.
The oracle always tells the truth, even when it is wrong: COM method calls with a user-defined type as a return value
What you ship becomes the truth.
Standing on the shoulders of giants: Let the compiler tell you what the ABI is
Consult the oracle.
Jumping into the middle of an instruction is not as strange as it sounds
It's just another trick for saving space.
How can I detect that a thread pool work item is taking too long?
Call in a watchdog.
How do I upgrade a 32-bit tick count to a 64-bit one?
Fortunately, there's a 64-bit one sitting nearby.
Filling in some gaps in the story of Space Cadet Pinball on 64-bit Windows
The story as I experienced it.
How do I prevent folder verbs intended for file system directories from showing up in my shell extension’s virtual folder’s context menu?
They shouldn't be there in the first place.
My Excel spreadsheet doesn’t scroll even though I can use the arrows to move around
Freeze, and put your hands up!
Speculation on the design decisions that led to the common ABI for C++ coroutines
Considering some alternatives.
2021 year-end link clearance
Another trip around the sun.
The case of the programs that were launched with impossible command line options
Death and resurrection, unsuccessfully.
The C++/CX <CODE>String^</CODE> is not an object, even though it wears a hat
A strange beast that thing is.
You can’t copy code with memcpy; code is more complicated than that
There's more to code than just instructions.
A rejected attempt to inject pseudo-physics into Windows 8 toast notifications
Like a mischievous rubber band flung across the screen.
How do I add custom controls to the common file open or file save dialogs?
A survey of the history of customization, leading to the present.
The Thanksgiving to Christmas sales nationwide of the VIS could be tabulated in an unsigned char
One of the great duds of console gaming history.
It’s easy to get data into the GPU, but harder to get it out
The continuing evolution of graphics memory.
How do I programmatically reposition monitors in a multiple-monitor system?
The magic phrase is <CODE>DM_POSITION</CODE>.
You thought Windows drivers from 2006 were old, wait’ll you see the Intel drivers from 1968!
It's the same driver date hack, just even more extreme.
Why do I have to add one when setting a class background brush to a system color?
To make sure it's not null.
Why is the stack overflow exception raised before the stack has overflowed?
You need some stack to deal with the exception.
Why does the precise point at which I get a stack overflow exception change from run to run?
The system is trying to introduce some unpredictability.
What does “Do not launch, but debug my code when it launches” mean?
Don't launch my code when it launches? Does that even make sense?
Embarrassing product names created: Windows CE
You do all you can, but at the end of the day, it's not yours to control.
Dubious security vulnerability: Accessing information across accounts after changing email address
It's still you, just with a different online façade.
It’s okay to be contrary, but you need to be consistently contrary: Going against the ambient character set
Code different.
If you’re going to configure a header file, you have to do it before you include the header file
It sounds obvious, but you can be faked out.
Using CRTP to your advantage: Simplifying overloaded Windows Runtime method projections in C++/WinRT
As long as the wrapper can call it, you can implement it any way you like.
What happens when a hot air balloon lands in your yard?
Break out the bubbly.
It rather involved being on the other side of this airtight hatchway: Producing malicious data in a kernel driver
Sure, you can fool other people, but you can do far more than that already.
Compiler error message metaprogramming: Helping to find the conflicting macro definition
Shaping the code so a required diagnostic will be useful.
How can I produce a C-style array from a Windows Runtime asynchronous operation?
No good solutions, but some workarounds.
How do I receive ownership of a C-style array in a Windows Runtime component?
The implementation side of the role reversal.
How can I transfer ownership of a C-style array to a Windows Runtime component?
Survey the options and realize that the only choice is to go backward.
How can my C++/WinRT component pass a <CODE>std::vector</CODE> back to the caller?
Implementing the ReceiveArray pattern.
How did Windows 3.1’s virtual machine manager get the information to show in the text-mode <KBD>Alt</KBD>+<KBD>Tab</KBD> switcher?
Getting by with a little help from a friend.
The two products may be identical, but they are not the same
No price-matching for you.
I called AdjustTokenPrivileges, but I was still told that a necessary privilege was not held, redux
Did any privilege adjustment occur at all?
How do I pass an array of variable-sized <CODE>PROPSHEETPAGE</CODE> structures to <CODE>PropertySheet</CODE>?
It's "just" an array of variable-sized structures.
Appending additional payload to a <CODE>PROPSHEETPAGE</CODE> structure
Taking it along for the ride.
Every business process secretly wants to fail
At least, that's how it looks from the outside.
A reminder about the correct way of accessing and manipulating the position of icons on the desktop
There's an interface for that. Please use it.
Why is my C++/CX ref class forbidden from having public methods that are templates or mention, say, std::vector?
C++/CX overloads the class member access control keywords to control metadata generation.
What does the CompileAsWinRT Visual Studio project option mean?
And why it's badly-named.
The mental model for StartThreadpoolIo
It's internally managing a reference count.
Microspeak: Righteous
A colloqualism that has become a preferred adjective.
A practical use for <CODE>GetHGlobalFromStream</CODE> when sharing was never your intention
This may even have been its original purpose.
Another way of looking at C++ reverse iterators
It's the same thing, just going in the opposite direction, right?
I sort of knew that I’m a bad flute player, but I guess this proves it
The fault is in ourselves, after all.
The inside story of the outside investigation of SoftRAM 95
It had a plan, but didn't quite execute on it.
How am I supposed to create children of the Win32 tab control?
They look like children, but they're not.
If your domain name parser can’t handle internationalized domain names, then maybe that’s your parser’s problem
Don't blame someone else for letting strange domain names reach you.
Restoring support for pre-standardization coroutine free awaiters for even older code bases
Connecting the dots, and reaching back to an earlier time.
The case of the C++/WinRT cached factories that pointed into freed memory
Developing theories that match the evidence.
How can I prevent myself from accessing a lambda captured variable or a parameter after I’m done with it?
Name-hiding on purpose.
A capturing lambda can be a coroutine, but you have to save your captures while you still can
Save it all before it disappears.
The focus rectangle says, “I’m not orange. I’m just drawn that way.”
How does <CODE>DrawFocusRect</CODE> draw the focus rectangle?
Why do all this coroutine stuff if you can just use <CODE>std::future</CODE>?
Escape from PPL.
Giving a single object multiple COM identities, part 4
Simplifying the pattern.
Giving a single object multiple COM identities, part 3
Returning to the scene of the crime.
Giving a single object multiple COM identities, part 2
Trying to develop a slightly more efficient multi-headed snake.
Giving a single object multiple COM identities, part 1
Like a multi-headed snake.
A very brief introduction to patterns for implementing a COM object that hands out references to itself
We'll look at many choices, but focus on one.
Renaming a file is a multi-step process, only one of which is changing the name of the file
If you're going to swoop in, make sure to swoop in carefully.
Why isn’t <CODE>MapDialogRect</CODE> mapping dialog rectangles?
Maybe you don't have a dialog.
My code crashed when I asked WIL to convert an exception to an HRESULT, did I throw an improper exception type?
Digging into the failure more closely.
That time we had a network outage due to unexpected hunter activity
Watch where you're pointing that thing.
How can I get the screen reader to read out an error message that I displayed inline on a page?
Make it a live region.
What does the <CODE>SizeOfImage</CODE> mean in the <CODE>MODULEINFO</CODE> structure?
It's the size in terms of mapped address space when loaded.
Why does GetModuleInfo fail to produce an entry point for executables?
Because it's getting the information from the loader, who has no use for such things.
Local variables are different from parameters in C++ coroutines
You tend to think of them the same, but they destruct differently.
The happy hand: A puzzle about odd names in Azure DevOps
Who's renaming everything into something cute?
Is there a way that my macro can detect that it’s running in a C++ coroutine?
You are part of the decision.
What can I do about timer build-up when waiting for COM outbound calls to complete?
You'll have to drain them out yourself.
Debugging coroutine handles: The Microsoft Visual C++ compiler, clang, and gcc
Peeking behind the curtain.
Why is the <CODE>main()</CODE> function always at address 0x00401000 in a simple program?
When multiple technical decision add up, literally.
Not from inside the Redmond Reality Distortion Field: Microsoft Streets and Trips support for ferries
From somebody else's reality distortion field.
Some lesser-known powers of std::optional
Things it does that you may not know about.
The subtleties of <CODE>CreateStreamOnHGlobal</CODE>, part 4: Non-movable memory
Fear and reallocation.
The subtleties of <CODE>CreateStreamOnHGlobal</CODE>, part 3: Suppressing the deletion of a shared <CODE>HGLOBAL</CODE>
Trying to set up joint custody.
The subtleties of <CODE>CreateStreamOnHGlobal</CODE>, part 2: Suppressing the deletion of an unknown <CODE>HGLOBAL</CODE>
You don't know what it is, but you said you don't want it deleted automatically.
The subtleties of <CODE>CreateStreamOnHGlobal</CODE>, part 1: Introduction and basic usage
Developing the mental model.
Why am I getting an unresolved external from C++/WinRT if it is a header-only C++ library?
Maybe you didn't get all of the headers.
The case of the UWP application that crashes at launch on Windows 10X
Look before you leap.
Why is there trailing garbage when I try to decode the bytes of a HttpContent object?
You need to know when to stop.
Converting between UTF-8 strings and UTF-16 strings in C++/WinRT
A pair of conversion functions.
The CertUtil program will decode Windows error codes, and in a variety of formats
Even more versatile than <CODE>NET HELPMSG</CODE>.
What does this mean? The caller specified wait timed out before the operation completed because a host termination is in queued
An error message written with infrastructure-colored glasses.
Adventures in application compatibility: The case of the wild instruction pointer that, upon closer inspection, might not be so wild after all
The search for clues leads to an unexpected place.
The C++ implicit assignment operator is a non-ref-qualified member, even if the base class’s assignment has a ref-qualifier
Does that count as dis-qualification?
How do I set the alpha channel of a GDI bitmap to 255?
Most things destroy the alpha channel, but there's a way to bring it back, or at least make it opaque.
Microspeak: Persona
A template for a prototypical user.
The C++/WinRT <CODE>query_<WBR>interface_<WBR>tearoff</CODE> extension point, and using it for COM aggregation
For adding your own <CODE>QueryInterface</CODE> magic.
Ordering asynchronous updates with coroutines, part 5: Bowing out via cancellation
Using the built-in way of stopping a coroutine.
Ordering asynchronous updates with coroutines, part 4: Bowing out, explicit version
Realizing you're not the one.
Ordering asynchronous updates with coroutines, part 3: Let them all compete, but only one wins
Everybody tries, but only one wins.
Ordering asynchronous updates with coroutines, part 2: Restart with hand-off
Everybody just waits their turn.
Ordering asynchronous updates with coroutines, part 1: Mutual exclusion
Everybody just waits their turn.
I declared my Windows Runtime method as accepting an array by reference, but it always arrives empty
You were only meant to put things into the box, not look at what was already there.
Adventures in application compatibility: The cost of forgetting to specify a calling convention
Cleaning up behind mistakes of the past.
Looking at world through __stdcall-colored glasses
It's the default, or at least it's my default.
Notes on the Seattle Symphony’s expanded concert schedule for 2021–2022 season
More concerts, more options.
What are the consequences of increasing the per-process GDI handle limit?
Striking a balance.
The various ways of moving between C++/WinRT and classic COM
Crossing to the other side.
How can I break down a shell item in the same way as the breadcrumb bar?
Gathering the folders that lead up to a shell item, walking up the tree, or walking from the root to the leaf, and then obtaining the desired name.
In C#, how do I get the descriptive text for an HRESULT?
You can pretend it was an exception.
The Windows Runtime PassArray is a read-only array, even though it isn’t declared <CODE>const</CODE>
Because in most languages, there is no such thing as const.
How to sneak the Windows 95 credits screen into the build without anybody noticing
Write it in an obscure language.
C++/WinRT nasty gotcha: <CODE>winrt::param::hstring</CODE> constructed from <CODE>std::wstring_view</CODE> requires null termination
An additional constraint not part of the rules.
How do I find out the size of the mouse cursor?
Well, first you have to decide which one you want to measure.
How to pwn an unattended laptop, according to Humans
According to television.
What is the deal with the SM_CXCURSOR system metric?
A metric from an earlier, simpler time.
What’s with all of the references to “dude” in the accessibility header files?
A catch phrase from long ago.
Is it expected that custom default pinned taskbar items via LayoutModification.xml keep coming back each time the user logs on?
Yes, so you need to plan accordingly.
What are these dire multithreading consequences that the GetFullPathName documentation is trying to warn me about?
The current directory is volatile, so plan accordingly.
Resolving the ambiguity when your C++ class inherits from multiple base classes that have the same method
Steer the compiler toward the method you want.
How can I find the heap that a memory block originally came from, so I can free it properly?
You'll have to keep track of it yourself.
How can I prevent my UWP app from showing up in the Start menu?
Deny its app list entry.
Why did the old RAID database use a signed 16-bit integer for its record count? Why not unsigned, or a 32-bit integer?
You have to understand decisions in context, and that includes knowing the problem it was trying to solve.
Why am I getting a weird error about <CODE>promise_<WBR>type</CODE> when I try to write a coroutine?
Digging into the coroutine infrastructure for the answer.
Using Windows Runtime interop methods from C++/WinRT: Some helper functions
Getting the interface, and the capturing from it.
An example of using Windows Runtime interop methods from C++/WinRT: <CODE>RequestTokenForWindowAsync</CODE>
Understanding how the C++/WinRT interop pieces fit together.
What is a static Windows Runtime class, how should I express it, and when should I use it?
The underlying question is "Can you even make one?"
Why are all of the retail demo names male?
For localization consistency.
How can I figure out which object is being hosted in an instance of dllhost?
Finding the object.
Why doesn’t my asynchronous read operation complete when I close the handle?
Because the file isn't closed yet.
On the interaction between the <CODE>FILE_<WBR>FLAG_<WBR>NO_<WBR>BUFFERING</CODE> and <CODE>FILE_<WBR>FLAG_<WBR>WRITE_<WBR>THROUGH</CODE> flags
Let's fill in another table.
How can I prevent the mouse from moving in response to touch input?
You need to make your program pointer-aware.
Twitter misdetected the 2011 Build conference keynote as a denial-of-service attack
Just a lot of excited developers.
Diagnosing why your batch file prints a garbage character, one character, and nothing more
Following the clues you have.
The history of passing a null pointer as the key name to <CODE>RegOpenKeyEx</CODE>
It doesn't mean anything special any more, but it once did.
The case of the strange NT-style path that was discovered by SearchPath
Remember where it searches.
I know I can change the color of the DC pen, but what about the other attributes?
They're locked in, sorry.
Why does the New menu even exist for creating new empty files?
You have to open the file anyway to make it useful, so why not just open the program directly?
C++11 braced initialization made the impossible possible (and how to fix it so it stays impossible)
Braced initialization to the rescue, or denied.
What’s the difference between throwing a <CODE>winrt::hresult_error</CODE> and using <CODE>winrt::throw_hresult</CODE>?
It affects the error origination.
On proper handling of buffers in COM and RPC methods
The RPC layer deals with most of the problems for you, assuming you're using the RPC layer.
How to perform more complicated search and replace-style renaming in a batch file
Try something other than wildcards.
How did copying and renaming with wildcards work in MS-DOS?
By lining up two parallel arrays.
Why do smart pointers null out the wrapped pointer before destroying it?
It's not a race condition, but it's some condition.
On the perils of holding a lock across a coroutine suspension point, part 3: Solutions
How to avoid the trap.
On the perils of holding a lock across a coroutine suspension point, part 2: Nonrecursive mutexes
Another way things can go wrong.
On the perils of holding a lock across a coroutine suspension point, part 1: The set-up
One way things can go wrong.
How to act like you know Chinese even though you don’t, episode 2
Find the magic word.
What happens if I use a squash instead of a true merge when performing one of the git tricks?
In many cases, the merge is where the magic is.
How a basketball became a featured instrument in a Sting song
It's all in the name.
Is it okay to call <CODE>MapViewOfFile</CODE> on the same mapping handle simultaneously from different threads?
Or do you have to enforce serialization to ensure both calls succeed?
Studying linker error messages to find the cause of the unresolved external: Character sets
Puzzling out why the symbols don't match exactly.
2021 mid-year link clearance
A collection of stuff that has accumulated.
What should the CPU usage be of a fully-loaded CPU that has been throttled?
A valid difference of opinion.
The initializing constructor looks like an assignment, but it isn’t
There is no assignment going on; it's just a quirk of syntax.
The ARM processor (Thumb-2), part 20: Code walkthrough
Putting together what we've learned, with a surprise.
The ARM processor (Thumb-2), part 19: Common patterns
Code sequences you will learn to recognize.
The ARM processor (Thumb-2), part 18: Other kinds of prologues and epilogues
Taking shortcuts and combining steps, or omitting them entirely.
The ARM processor (Thumb-2), part 17: Prologues and epilogues
Implementing the receiving end of the calling convention.
The ARM processor (Thumb-2), part 16: The calling convention
Pretend it's on the stack, even if it isn't.
The ARM processor (Thumb-2), part 15: Miscellaneous instructions
The stuff that didn't fit anywhere else.
The ARM processor (Thumb-2), part 14: Manipulating flags
Reaching in and flipping the switches.
The ARM processor (Thumb-2), part 13: Trampolines
The overly-uniform program counter register strikes again.
The ARM processor (Thumb-2), part 12: Control transfer
Let's go places.
The ARM processor (Thumb-2), part 11: Atomic access and barriers
Doing things one at a time.
The ARM processor (Thumb-2), part 10: Memory access and alignment
It's just loads and stores.
The ARM processor (Thumb-2), part 9: Sign and zero extension
Making small things bigger.
The ARM processor (Thumb-2), part 8: Bit shifting and bitfield access
That barrel shifter again.
The ARM processor (Thumb-2), part 7: Bitwise operations
Flip-flopping the bits.
The ARM processor (Thumb-2), part 6: The lie hiding inside the CMN instruction
Don't let the name fool you.
The ARM processor (Thumb-2), part 5: Arithmetic
Starting with basic mathematics.
The ARM processor (Thumb-2), part 4: Single-instruction constants
Flaunt your barrel shifter if you've got it.
The ARM processor (Thumb-2), part 3: Addressing modes
It's a load-store architecture, but with rather fancy loads and stores.
The ARM processor (Thumb-2), part 2: Differences between classic ARM and Thumb-2
Squeezing into a 16-bit instruction size.
The ARM processor (Thumb-2), part 1: Introduction
Moving into the present.
On the proper care and feeding of the default_overload Windows Runtime attribute
Generally avoid it, but if use it you must, at least follow these rules.
How can I convert between IANA time zones and Windows registry-based time zones?
ICU to the rescue.
How ownership of the Windows clipboard is tracked in Win32
A simple model, complicated by the reality of misuse.
Why are device-independent bitmaps upside down?
Well, it depends on what you consider to be right-side up.
On static methods in the Windows Runtime and C++/WinRT
Transforming the ABI into a projection.
Obtaining attributed network usage information from the Windows Runtime
Breaking it down by application.
Obtaining network usage information from the Windows Runtime
Getting your foot in the door with the NetworkInformation class.
Awaiting Windows Runtime asynchronous operations from C# desktop apps
Need to find the awaiter.
The blessing of the leading zero
Sometimes it's not a curse.
Why did Windows 95 keep window coordinates at multiples of 8?
Because sub-byte memory access is really annoying.
Why isn’t my shell namespace extension getting every single DragOver mouse message?
Trying to avoid too much chattiness for things that aren't important.
Drag/drop effects: The little drop information box
Updating the description.
Using Explorer’s fancy drag/drop effects in your own programs
Accessing those pre-made shell drop effects.
Why does the mouse cursor jump a few pixels if you right-click on the Start button?
To give you a head start.
What are the page sizes used by Windows on various processors?
Usually there was no choice, but sometimes there was.
A subtle way your await_suspend can access the coroutine frame when it shouldn’t
Hiding in the coroutine machinery.
Is std::exception_ptr nothrow constructible and assignable?
Yes, buried in the fine print.
Why is coroutine_handle::resume() potentially-throwing?
It enables a very specific usage scenario.
A map through the three major coroutine series
For your casual reading convenience.
C++ coroutines: Promise constructors
Snooping on the coroutine parameters, with a gotcha.
C++ coroutines: Converting among tasks that use the same promise
Keeping the promise in the dark.
C++ coroutines: Waiting synchronously for our coroutine to complete
Using the extension point for another purpose.
C++ coroutines: Adding COM context support to our awaiter
Getting into the correct context on resume.
C++ coroutines: Snooping in on the coroutine body
Transformers are robots in disguise.
C++ coroutines: How do I create a coroutine that terminates on an unhandled exception?
You need to get inside the coroutine.
C++ coroutines: What does it mean when I declare my coroutine as noexcept?
The noexcept keyword doesn't mean what you think.
C++ coroutines: Associating multiple task types with the same promise type
Using the special initialization rule for <CODE>get_<WBR>return_<WBR>object</CODE>.
C++ coroutines: Improving cold-start coroutines which complete synchronously
Avoiding stack build-up.
C++ coroutines: Cold-start coroutines
On your mark, get set, wait for it!
C++ coroutines: Getting rid of our atomic variant discriminator
Don't look unless you know it's safe.
C++ coroutines: Allowing the awaiter to be destroyed while suspended
We were already there.
C++ coroutines: Getting rid of our reference count
It never goes up. It only comes down.
C++ coroutines: Getting rid of our mutex
We can capture the progress in a single value.
Pivot points and financial numerology
It will or it won't. That's the beauty of it.
C++ coroutines: Making it impossible to co_await a task twice
Always keep moving: Make the <CODE>co_await</CODE> consume the task.
C++ coroutines: Tradeoffs of making the promise be the shared state
Are you meant to be ephemeral, or are you intended to be durable?
C++ coroutines: The lifetime of objects involved in the coroutine function
Follow them as they pop into existence and vanish.
C++ coroutines: Managing the reference count of the coroutine state
Are we done yet?
C++ coroutines: Awaiting the simple_task
Let me know when it's ready.
C++ coroutines: Accepting types via return_void and return_value
A little bit of SFINAE tweaking.
C++ coroutines: Building a result holder for movable types
Not that kind of movable type.
C++ coroutines: Making the promise itself be the shared state, the outline
Now we do it.
C++ coroutines: Making the promise itself be the shared state, the inspiration
Just be it.
C++ coroutines: What happens if an exception occurs in my return_value?
What happens if you can't save the result?
C++ coroutines: The initial and final suspend, and improving our return_value method
Why would you stop before you start?
C++ coroutines: Basic implementation of a promise type
Filling in the diagram with code.
C++ coroutines: The mental model for coroutine promises
We start by drawing pictures.
Creating a task completion source for a C++ coroutine: Failing to produce a result
Stowing an exception.
Creating a task completion source for a C++ coroutine: Producing nothing
Nothing is produced, but you still want to know that the production completed.
SEO spammers don’t really understand who they spammed
Maybe we can help you.
Creating a task completion source for a C++ coroutine: Producing a result with references
Carefully preserved to prevent decay.
The 2021/2022 Seattle Symphony subscription season at a glance
The pocket reference guide for 2021/2022.
Creating a task completion source for a C++ coroutine: Producing a result
Let's call it a result holder.
Creating other types of synchronization objects that can be used with co_await, part 10: Wait for an event to clear
Something new.
Creating other types of synchronization objects that can be used with co_await, part 9: The shared mutex (continued)
Fixing some problems.
Creating other types of synchronization objects that can be used with co_await, part 8: The shared mutex
Two different kinds of waiting and releasing.
Creating other types of synchronization objects that can be used with co_await, part 7: The mutex and recursive
The mutex and recursive mutex as strange beasts in the world of coroutines.
Creating other types of synchronization objects that can be used with co_await, part 6: The semaphore
The asynchronous semaphore.
Creating other types of synchronization objects that can be used with co_await, part 5: The auto-reset event
The asynchronous auto-reset event.
Creating other types of synchronization objects that can be used with co_await, part 4: The manual-reset event
The asynchronous manual reset event.
Creating other types of synchronization objects that can be used with co_await, part 3: Parallel resumption
Resuming waiting coroutines in parallel on the thread pool.
Creating other types of synchronization objects that can be used with co_await, part 2: The basic library
Distilling the pattern to its essence, and the building back up.
Creating other types of synchronization objects that can be used with co_await, part 1: The one-shot event
First a little demonstration.
Creating a co_await awaitable signal that can be awaited multiple times, part 6
Looking back on what we've done.
Creating a co_await awaitable signal that can be awaited multiple times, part 5
Discussion of what we've done so far.
Creating a co_await awaitable signal that can be awaited multiple times, part 4
Why allocate memory when you can have it given to you?
Creating a co_await awaitable signal that can be awaited multiple times, part 3
Doing it all ourselves, without any need to go into kernel mode.
Creating a co_await awaitable signal that can be awaited multiple times, part 2
Because sharing is caring.
Creating a co_await awaitable signal that can be awaited multiple times, part 1
Sort of like an event.
What does error E_ILLEGAL_DELEGATE_ASSIGNMENT mean?
A delegate was assigned when not allowed, but when is it allowed?
What does it mean when a call fails with 0x8000001F = RO_E_BLOCKED_CROSS_ASTA_CALL?
Waiting wouldn't have helped.
What is so special about the Application STA?
Basically, it blocks re-entrancy.
Why does Task Manager tell me that I have a Startup program named Program?
It's a program that didn't register itself properly.
French is a very fragile language, or at least it seems so from the stories I hear
The slightest variation renders it incomprehensible.
How do I reset my PIN complexity requirements after removing a work account from Windows 10?
You need to remove the PIN and add it back.
How can I prevent a Windows Runtime WebView from loading any content beyond the initial request and its redirects?
Follow the bouncing redirect.
How can I prevent a Windows Runtime WebView from loading any content beyond the initial request?
You can intercept every resource request.
How can I return custom content for specific URLs requested by a Windows Runtime WebView?
Intercepting the attempts to contact the outside world.
Hardware engineers solve a usability problem with the PS/2 connector, but inadvertently create a new one
What's the difference between a mouse and a keyboard?
The COM static store, part 6: Using C++ weak references
A quicker way to get to what you have.
The COM static store, part 5: Using COM weak references
Avoiding having to go through the static store at all.
The COM static store, part 4: Aggregating into a single object
Batch all the things you need into a single object.
The COM static store, part 3: Avoiding creation of an expensive temporary when setting a singleton
Don't create one unless you really need one.
The COM static store, part 2: Race conditions in setting a singleton
There can be only one, so don't end up with two.
The COM static store, part 1: Introduction
Communal storage for COM things.
How do I get a foothold in the neutral apartment?
You can explicit ask for its context.
Usage patterns for winrt::unbox_value_or
Two templates, many patterns.
Why is there no useful information in the RetailInfo class?
It's just marketing nonsense.
A metric that is consistently at 100% is probably broken
They say that you get what you measure.
Why am I being told my fire_and_forget coroutine is not returning a value?
Fire-and-forget coroutines don't return a value, do they?
Autoscrolling on drag, part 5: Adding wiggle-to-scroll to escape velocity
Reintroducing a bug that's now a feature.
Autoscrolling on drag, part 4: Dynamic autoscroll based on escape velocity
Get a good running start.
Autoscrolling on drag, part 3: Dynamic autoscroll based on mouse position
Pull the rubber band more taut.
Autoscrolling on drag, part 2: Why does scrolling go faster if I wiggle the mouse?
You're tickling the adjustment code outside its normal cycle.
Autoscrolling on drag, part 1: Basic implementation
Setting the groundwork.
How do I protect myself against a COM call that can hang? I’m already running the server out-of-process.
You can cancel the call, and if the server ignores you, it's left working on a canceled operation.
What happens to the value returned from the function passed to QueueUserWorkItem?
Nothing. Nothing at all.
How do I disassociate a thread from an I/O completion port?
Escaping the trap.
Why did I lose 3D display mode when I upgraded to the next version of Windows 10?
It's not the Windows version that lost it. It's your display driver that lost it.
How can I prevent another program from showing a thumbnail preview in the taskbar?
You can't, really. It's not your window.
The perils of the accidental C++ conversion constructor
Single-parameter constructors are also conversions.
How can I write a C++ class that iterates over its base classes?
Variadic templates to the rescue.
The misleading MIDL error message: MIDL5023: The arguments to the parameterized interface are not valid
They aren't valid, but then again, nothing would have been.
Why am I receiving SHCNE_UPDATEDIR notifications that my code never generates?
You did generate them, indirectly.
How did I find the old Windows binaries and compilers for the processor retrospective series?
Going through old virtual boxes of stuff.
The case of the crash during the release of an object from an unloaded DLL during apartment rundown
The great escape from the confines of the custom COM context.
What happens if I give contradictory values for the stack commit and stack reserve?
The system will try to massage the values into something less unreasonable.
How can I tell whether my process is running as SYSTEM?
Check your token.
Additional helpful pseudo-handles: The process token, the thread token, and the effective token
For quick queries.
How can I write a program that monitors another window for a change in size or position?
Accessibility hooks come to the rescue once again.
I’d like an IUnknown, I know you have many, I’ll take any of them
Taking the first one is as good as any other.
How can I create a non-circular tab order, or some other type of custom ordering in my Win32 dialog?
Taking things into your own hands.
Why are the C and C++ compilers giving me error messages about int when my code doesn’t mention int?
It's a manufactured <CODE>int</CODE>.
What are these duplicate services whose names differ just by random characters at the end?
You get a service, and you get a service, everybody gets a service!
Why is the HSHELL_WINDOWDESTROYED notification raised when a window is hidden, even if it hasn’t been destroyed?
Taskbar-colored glasses.
How can I emulate the REG_NOTIFY_THREAD_AGNOSTIC flag on systems that don’t support it? part 5
Using the new thread pool functions.
How can I emulate the REG_NOTIFY_THREAD_AGNOSTIC flag on systems that don’t support it? part 4
Onward to coroutines.
How can I emulate the REG_NOTIFY_THREAD_AGNOSTIC flag on systems that don’t support it? part 3
Getting more asynchronous.
How can I emulate the REG_NOTIFY_THREAD_AGNOSTIC flag on systems that don’t support it? part 2
Asking the thread pool for help.
How can I emulate the REG_NOTIFY_THREAD_AGNOSTIC flag on systems that don’t support it? part 1
An exercise from long ago.
What should the state of a moved-from object be?
It's formally unspecified, but there may be informal expectations.
On the ways of finding a dispatcher for the current thread in the Windows Runtime
You have to look around, but be careful not to trip over anything.
Why does PF_VIRT_FIRMWARE_ENABLED return false even when virtualization is enabled in the firmware?
It may be enabled, but it's not enabled for <I>you</I>.
Lost Windows feature: The Horizon
Unlike the real horizon, this one is up close.
How do I avoid race conditions in WaitOnAddress where the wake happens before I enter the blocking state?
You're waiting on it wrong.
Parsing ETL traces yourself, part 3: The TraceProcessor
Getting it from the same source as the Windows Performance Analyzer.
Parsing ETL traces yourself, part 2: The EventLogReader
For true programmatic processing of classic ETL events.
Parsing ETL traces yourself, part 1: wpaexporter
A simple converter that spits out comma-separated values.
How did Windows open a portal to another dimension when reporting a program error?
A momentary tear in the space-time continuum.
Why does CreateWindowEx take the extended style parameter as its first parameter instead of its last?
It sure looks like a strange place to add a new parameter.
The humor hiding behind “JavaScript error: Semicolon expected”
Apparently not automatic enough.
Additional notes on the various patterns for passing C-style arrays across the Windows Runtime boundary
Filling in some of the implicit details.
How can I check whether the user has disconnected from the session?
You'll have to ask Terminal Services.
Did Windows ever find solutions for programs that crashed?
It did on occasion.
What are the requirements for the built-in Windows 10 camera-based barcode scanner?
Basically, it needs to be able to get a good picture.
Disk and File I/O performance with ETW traces: Miscellany
A few other columns.
Disk and File I/O performance with ETW traces: Why is System doing so much stuff?
The System does many things, or at least many things are blamed on it.
Preliminary notes on analyzing Disk and File I/O performance with ETW traces
Deciphering the numbers.
Why does the disk optimizer put boot files at low-numbered sectors?
Taking advantage of disk geometry.
Virtual desktops are an end-user window management feature, not a programmatic one
It's for users to organize their windows, not for programs to organize them.
How thread-safe is the Windows Runtime PropertySet object?
It's thread-safe as far as it goes, but you may want to go further.
Other uses for the -library flag of the C++/WinRT compiler
Injecting a little something extra.
On combining static libraries that implement C++/WinRT activatable objects
Separating the shared names, so you can combine them yourself.
One senior executive’s warning about escalating conflicts to upper management
You're not gonna like what you get.
Why does my command line redirection echo with an extra 1? Who’s inserting these rogue 1s everywhere?
It just came out of nowhere, or did it?
The history of the EncodePointer function for obfuscating pointers
Still useful, but less painful.
Destructing outside the lock when removing items from C++ standard containers
Managing the order of destruction.
My strategy for playing Settlers of Catan
It doesn't work, but I use it anyway.
The hidden callout: The destructor
You may not know where that's going to lead.
The prank cursor that resulted in an employee being fired before they even started
Don't try this at home.
Why aren’t my custom backgrounds, animations, and colors working, such as ApplicationViewTitleBar colors?
You're subject to user and system policy.
How do I save a C++/WinRT array_view as a com_array?
There's a not-entirely-obvious constructor for that.
What’s the point of APTTYPE_CURRENT? I mean, of course I’m current.
No matter where you go, there you are.
What is the format of the data in the AudioBuffer memory buffer, and how do I convert it to something else?
It's a bunch of floating point samples, in a particular order.
The Settings app lets me pick a custom color for my mouse pointer, how do I get in on that action?
You'll have to build a better mouse pointer.
How can I ask the networking stack whether the system has obtained network connectivity?
Depends what kind of connectivity you're looking for.
Why am I getting an access violation trying to access a method on my C++/WinRT object?
The method vanishes.
Do any Windows Runtime projections cache nondefault Windows Runtime interfaces?
Possibly, but I know two that definitely don't.
Windows Runtime objects are represented by their default interface, so choose your default interface wisely
The choice is usually obvious, but on occasion, the non-obvious choice may be better.
The BurgerMaster segment may have been legendary, but some legends aren’t true
Just give them a call.
I told the Microsoft Visual C++ compiler not to generate AVX instructions, but it did it anyway!
Well, you explicitly generate them.
How can I tell whether a file is on an SSD?
Putting the pieces together.
Taking a shortcut: You can query properties from a volume, and it will forward to the physical drive
Saving a little extra trip.
How do I get from a volume to the physical disk that holds it?
Another step down the hierarchy.
How do I get from a file path to the volume that holds it?
Walking down the topology, with a little backslash weirdness thrown in.
Mount points, volumes, and physical drives, oh my!
Navigating the storage topology.
Structured binding in C++/WinRT: The key-value pair
Taking them apart in a simpler way.
How to add C++ structured binding support to your own types
Joining the cool kids.
A brief introduction to C++ structured binding
Just learning the basics.
Just for fun: Retail demo user names in Windows 10
A bunch of plausible but fictitious names.
In 1979, some software company in Bellevue was hiring
Digging through the archives.
A consequence of being the first to adopt a standard is that you may end up being the only one to adopt it: The sad story of Korean jamo
To be a leader, others must follow.
An iterable of iterables: C# collections support covariance, but C++ collections do not
You have to say exactly what you want, which may not be exactly what you have.
Error C3867: non-standard syntax; use ‘&’ to create a pointer to member: What it means and how to fix it
The compiler is trying to guess what you are trying to do. It sometimes guesses wrong.
How to plug in your USB Type A connector correctly the first time
Mating rituals.
How can I bulk-revert a subdirectory of a repo to an earlier commit?
Read it into the index.
Little gotcha with C++/WinRT iterators: The case of the mutated temporary
You are operating on copies, not the originals.
Bonus operations for C++/WinRT iterators: The IIterable<T>, and C++/WinRT collections
Stepping through a collection.
Bonus operations for C++/WinRT iterators: The IIterator<T>
The equivalent of an input iterator.
How did we end up parsing Savvyday 29 Oatmeal 94 as Saturday 29 October 1994?
Unsophisticated pattern matching.
git commit-tree parlor tricks, Part 9: How can I bulk-revert an entire repo to an earlier commit?
Take me back to a simpler time.
Structured binding may be the new hotness, but we’ll always have std::tie
Sometimes the old things are what you need.
Inside C++/WinRT: How does C++/WinRT represent ABI types?
Hiding in the internal <CODE>impl::abi</CODE> template.
How to get your C++/WinRT asynchronous operations to respond more quickly to cancellation, part 3
Automatic cancellation propagation is here.
Why does the Disk Cleanup tool’s Windows Update Cleanup take so long and consume so much CPU?
It's doing some real work.
Git commit-tree parlor tricks, Part 8: I just rebased my branch, but now I realize that I should have merged
You can rewrite the tree while preserving files.
I get a weird error about no matching function when I try to use winrt::capture
The confusing error message strikes again.
The C++/WinRT “capture” function helps you interoperate with the COM ABI world
Simplifying a common COM pattern.
Why did I lose the ability to co_await a std::future and concurrency::task?
Early moves in a direction that didn't pan out.
Embarrassing product names averted: Windows Embedded POS and Windows 10 for Advanced PCs
If you see something, say something.
What’s up with error C4838: a WinRT type cannot be a member of a union, and how can I work around it?
A restriction left over from C++03.
The macros for declaring COM interfaces, revisited: C++ implementation
Now to make things concrete.
The macros for declaring COM interfaces, revisited: C++ version
Apparently there's this new language people are using nowadays.
The macros for declaring COM interfaces, revisited: C version
Following the expansion.
How is it possible to jam a virtual card reader?
Did you feed it a bent virtual card?
This is definitely rare: It happens only ten times a month
Playing the bigger fool.
C++/WinRT injects additional constructors into each runtime class
For dealing with the objects as the smart pointers they actually are.
Rough edges in the when_all coroutine, part 2: Overloaded comma operator
Shame on you.
Rough edges in the when_all coroutine, part 1: Empty parameter list
I've got plenty of nothing.
Synthesizing a when_all coroutine from pieces you already have
You just need to await on all of them.
More on trivial functions like CopyRect and EqualRect
Let's go code golfing.
Is there a code page that matches ASCII and can round trip arbitrary bytes through Unicode?
For round-tripping binary data.
How do I convert from the C++/WinRT projection type to the C++/WinRT implementation type?
You have to trust what's inside the box.
How do I convert from the C++/WinRT implementation type to the C++/WinRT projection type?
Fortunately, there's a conversion for that.
Why are some system functions exported as stubs instead as forwarders?
Compatibility, of course, at least for some of them.
That time Bill Gates went through a McDonalds drive-through with no cash
No special treatment, not even for the richest man in the world.
How can I get the number of processors in the system, when there are more than 64?
You can ask for the active processor count.
Recognizing different types of exception objects that Windows platform libraries can throw
Just a few of the more common ones.
Inside the Microsoft STL: The std::exception_ptr
Digging inside, for debugging purposes.
On using FILE_FLAG_WRITE_THROUGH and FILE_FLAG_NO_BUFFERING for memory-mapped files
You're trying to control I/O you didn't issue.
What are the possible Status values for Win32_ComputerSystem?
There's really only one possible status.
How WRL squeezes a weak reference and a reference count into a single integer
It's basically a union of a pointer and an integer.
The case of Explorer calling into an unloaded DLL while trying to run down a reference to it
Let's do some debugging.
Working around the requirement that Concurrency Runtime task results must be default-constructible and copyable
Applying tricks to avoid the pitfalls.
Hidden constraints on the result type in Concurrency Runtime tasks
If you are using the Concurrency Runtime to represent asynchronous activity, there are some hidden constraints on the type . If you violate these constraints, the compiler will complain, but perhaps not in an obvious way.¹ If you try to create a where does not have a public default constructor, then you get an error like And if the is not copyable, then you get something like What's going on? Let's look at the copyability first. Task results must be copyable because the task result can be consumed multiple times in multiple ways. You can multiple times, and each time returns the task result. You can...
Microspeak: Placemat
Everything in its place.
How can I tell whether the user has disabled toast notifications for my app?
The ToastNotifier settings will tell you.
How do I make my accelerators apply only when used in the main window and not when the user is using a modeless dialog?
Sometimes you feel like an accelerator table, sometimes you don't.
What was so horrible about the FORMAT_MESSAGE_ALLOCATE_BUFFER flag that the Windows Store disallowed it for so long?
Letting in the riffraff.
What does it mean when it says that FORMAT_MESSAGE_ALLOCATE_BUFFER can be used in Store apps starting in Windows 10?
What happens if you use it anyway?
How can CharUpper and CharLower guarantee that the uppercase version of a string is the same length as the lowercase version?
Does it have a special under-the-table deal with the Unicode Consortium?
Peeking inside the implementation of AnsiUpper and AnsiLower in Windows 1.0
Some retro-reverse-engineering and the weird micro-optimizations.
What does the /ALTERNATENAME linker switch do?
In case of emergency, go look for something else.
What’s the deal with OLDNAMES.LIB?
For backward compatibility with pre-standard C.
C++/WinRT gotcha: Setting properties incorrectly
A bit too much search/replace during porting.
A look back at memory models in 16-bit MS-DOS
Ways of dealing with the fractured address space.
How do I set multiple items to a Windows Runtime vector in a single call?
It depends on the language projection.
C++/WinRT doesn’t let your coroutine cheat death, but it does get to say good-bye
Some manual cleanup.
How to get your C++/WinRT asynchronous operations to respond more quickly to cancellation, part 2
You can also take more proactive steps.
How to get your C++/WinRT asynchronous operations to respond more quickly to cancellation, part 1
Well, one way is to poll for it.
Deconstructing function pointers in a C++ template, returning to enable_if
Going back to the old standby to filter out unwanted specializations.
Deconstructing function pointers in a C++ template, addressing the calling convention conundrum
Finding a template metaprogramming trick that works.
Deconstructing function pointers in a C++ template, trying to address the calling convention conundrum
Hunting for the right template metaprogramming trick.
Deconstructing function pointers in a C++ template, the calling convention conundrum
Teasing out the calling convention from a function pointer.
Deconstructing function pointers in a C++ template, vexing variadics
Yet another function signature to specialize.
Deconstructing function pointers in a C++ template, the noexcept complication
Trying to infer the noexcept qualifier.
Deconstructing function pointers in a C++ template
Learning the magic incantation.
Cancelling a Windows Runtime asynchronous operation, part 8: C++/WinRT, revised
Using the completion result.
Cancelling a Windows Runtime asynchronous operation, part 7: WRL-generated asynchronous operations
The library that came before.
Cancelling a Windows Runtime asynchronous operation, part 6: C++/WinRT-generated asynchronous operations
It came from inside the building.
Cancelling a Windows Runtime asynchronous operation, part 5: C++/WinRT
Relying on the ABI result.
Cancelling a Windows Runtime asynchronous operation, part 4: C++/CX with PPL, coroutine style with raw IAsyncAction and IAsyncOperation
Looks the same, but actually tastes completely different.
Cancelling a Windows Runtime asynchronous operation, part 3: C++/CX with PPL, coroutine style
Same wrapper, different sugar.
Cancelling a Windows Runtime asynchronous operation, part 2: C++/CX with PPL, explicit continuation style
Going through a different wrapper.
Cancelling a Windows Runtime asynchronous operation, part 1: C#
How is the cancellation reported?
2020 mid-year link clearance
Another midpoint.
Mundane std::tuple tricks: Finding a type in a tuple
Inverting <CODE>tuple_element_t</CODE>.
Mundane std::tuple tricks: Creating more interesting index sequences
Generalizing our manipulations so far.
Mundane std::tuple tricks: Creating interesting index sequences
Building our own little template language.
Mundane std::tuple tricks: Selecting via an index sequence, part 2
Preserving references.
Mundane std::tuple tricks: Selecting via an index sequence
It all comes down to the index sequence.
Mundane std::tuple tricks: Getting started
Concatenating tuples the hard way, and the easy way (or maybe it's the lazy way).
Understanding warning C4265: class has virtual functions, but destructor is not virtual, part 2
Applying what we've learned.
Understanding warning C4265: class has virtual functions, but destructor is not virtual, part 1
What's it trying to warn you about? Does it matter?
Blaming the operating system for allowing people to create files with unusual characters in their names
Four fingers pointing back at your self.
Excuse me, has anybody seen the FOCAL interpreter?
I thought <I>you</I> had it.
Error 0x80131040 “The located assembly’s manifest definition does not match the assembly reference” when I use a Windows Runtime class written in C# from my C++/WinRT project
Version numbers strike again.
Using fibers to expand a thread’s stack at runtime, part 6
Caching fibers to avoid bouncing.
Using fibers to expand a thread’s stack at runtime, part 5
Expanding only as needed.
Determining approximately how much stack space is available, part 2
Probing the stack limits.
Determining approximately how much stack space is available, part 1
Ask for the memory and give it back right away.
Comparing fibers to threads for the purpose of expanding a thread’s stack at runtime
Pros and cons.
Using fibers to expand a thread’s stack at runtime, part 4
Moving an exception from a fiber to the main thead.
Using fibers to expand a thread’s stack at runtime, part 3
Propagating additional thread state.
Using fibers to expand a thread’s stack at runtime, part 2
Reducing code size with type erasure.
Using fibers to expand a thread’s stack at runtime, part 1
The simple return value.
How can I expand my thread’s stack at runtime?
You can use fibers, but you need to use them carefully.
Hiding C++ template parameter packs in a tuple
So you can pull them back out.
Template metaprogramming trick: Get the compiler to tell you what type you have
Let the error message tell you.
The SetClientGuid method of the common file and folder dialogs lets you give names to those dialogs, too
Sort of like Bob and Carol for Win32.
When programs assume that the system will never change, episode 1, redux
It was never yours to begin with.
The SettingsIdentifier property of the various file pickers lets you give names to your pickers
Like Bob or Carol?
On the various ways of constructing a C++/WinRT com_array
Surveying the constructors.
A noinline inline function? What sorcery is this?
Two different senses of the word inline.
The case of the <CODE>SHGetFolderPath(CSIDL_<WBR>COMMON_<WBR>DOCUMENTS)</CODE> that returned <CODE>ERROR_<WBR>PATH_<WBR>NOT_<WBR>FOUND</CODE>
Accidentally reconfiguring the system.
How can I view my devices based on how they are connected to each other?
You can view by connection.
Reporting on what you could do once you get to the other side of the airtight hatchway
Counting all those chickens.
Storing a non-capturing lambda in a generic object
Reimplementing a small corner of <CODE>std::function</CODE>.
Inside <CODE>std::function</CODE>, part 2: Storage optimization
Preallocating the storage yourself.
Inside <CODE>std::function</CODE>, part 1: The basic idea
Holding all different kinds of things.
When you start getting in-page errors on your hard drive, it’s time to go shopping for a new hard drive, redux
The click-click-click of impending doom.
Peeking inside WRL weak references
If you ever have to debug one of these things.
The C++ preprocessor doesn’t understand anything about C++, and certainly not templates
You need to help it along.
Why does <CODE>RegNotifyChangeKeyValue</CODE> stop notifying once the key is deleted?
Because that's the last thing a key ever does.
How can I prevent the user from using Snip and Sketch to take screen shots?
Programs can already specify that their windows should not be captured.
Why did the message on the Start menu change from <I>Start</I> to <I>Ship It!</I> for one build?
A rogue expression of mixed encouragement and impatience.
Peeking inside C++/CX weak references
If you ever have to debug one of these things.
Diagnosing a hang: Everybody stuck in <CODE>WinHttpGetProxyForUrl</CODE>
Putting on your thinking cap.
COM in-process DLL unloaded while trying to clean up from the destruction of the last object
Choosing the right time to bid farewell.
How can I detect that the system is no longer showing a UAC prompt?
Let's try to understand the actual problem.
When you set Windows 10 to allow only Windows Store apps, it allows them to be installed by anyone, not just the Store app
It's about the source of the program, not the delivery mechanism.
The paradoxical sense of relief when instructions to solve the problem fail at the first step
Time saved.
How do I use C++/WinRT to implement a classic COM interface that derives from another classic COM interface?
You can specialize <CODE>guid_of</CODE>.
Why does the value of my XAML Slider change when I updated its range?
Releasing the spring.
What kind of apartment is the private apartment I created via <CODE>CLSID_<CODE></CODE>ContextSwitcher</CODE>?
It's where you are.
Virtual desktops are a window management feature, not a performance feature
Everything runs the same as it did before.
It rather involved being on the other side of this airtight hatchway: Planting files onto a custom PATH
Adding a directory to the PATH comes with obligations.
What will be placed in the output parameter if the function fails?
Officially, it could be anything. In practice, though, there are some constraints.
Why can’t you return an <CODE>IAsyncAction</CODE> from a coroutine that also does a <CODE>co_await</CODE>?
You already returned. No take-backs.
When I ask the <CODE>GetIpAddrTable</CODE> function to sort the results, how are they sorted?
Nothing particularly fancy. Just plain numerical order.
If one program blocks shutdown, then <I>all</I> programs block shutdown
We're all in this together, as far as the Blocked Shutdown Resolver is concerned.
The type-dependent type or value that is independent of the type
To delay the evaluation until instantiation.
Creating a non-agile delegate in C++/WinRT, part 5: Waiting synchronously from a thread that may already be the right thread
You might already be there.
Creating a non-agile delegate in C++/WinRT, part 4: Waiting synchronously from a background thread
Using things you already have.
Creating a non-agile delegate in C++/WinRT, part 3: The other cases and why they aren’t interesting
We handled only one case, but that's the only one worth handling.
Creating a non-agile delegate in C++/WinRT, part 2: The synchronous coroutine
It awaits without waiting.
Creating a non-agile delegate in C++/WinRT, part 1: Initial plunge
Forcing the delegate to run in a specific apartment.
An observation about what people used iPads for in the early days
Does everything you need, if you also bring an assistant.
Error compiling C++/WinRT runtime class: function does not take N arguments
You need to cover all the overloads.
Pulling sleight of hand tricks in a security vulnerability report, or maybe it was a prank
Something up my sleeve.
Why am I ignoring my second monitor? A case study in working from home.
Settling into the new routine has its rough spots.
A sneaky way to make sure nobody assigns test failures to your team
Buffer overflow.
Are Windows Runtime asynchronous operations guaranteed to complete?
As much as anything is guaranteed to complete.
If you say that your minimum requirements are the Universal contract, then you need to probe for anything beyond that
Reaching beyond your declaration.
How can I check whether a Windows Runtime object supports a member before I try to use it?
You can sniff at the metadata.
Accessing a member of a Windows Runtime class raises an <CODE>InvalidCastException</CODE> / throws a <CODE>hresult_</CODE><CODE>no_</CODE><CODE>interface</CODE>, what does this mean?
It's interfaces under the hood.
Why not just share a single event across all critical section?
How will you know when the thundering herd has calmed down?
The security check happens at the acquisition of the handle
Once you buy a handle, it's yours to keep.
Further refinements to the attempt to create a type-dependent expression that is always false
It still falls down, but for stranger reasons.
It rather involved being on the other side of this airtight hatchway: Booting into another operating system
It's not your computer any more.
We called it RAID because it kills bugs dead
The history of defect tracking databases in Windows.
The Windows Runtime IDL compiler lets you abbreviate some interface names
But only a few of them.
Providing a better error message when someone tries to use <CODE>std::vector<bool></CODE> as a buffer
Defer the problem further.
Of what use is a type-dependent expression that is always false?
Deferring an assertion to instantiation.
How can I create a type-dependent expression that is always false?
Use information that you know to be true (or false).
The sad but short story of the <CODE>SM_AccessoriesName</CODE> registry value
Another victim of programs that reach into undocumented sections of the registry.
Why does MS-DOS put an <CODE>int 20h</CODE> at byte 0 of the COM file program segment?
In case you end up there, but how?
Why do people take a lock around <CODE>CreateProcess</CODE> calls?
Managing your inheritance.
Can I wait for a kernel event to become <I>unsignaled</I>?
Not directly, but maybe you can simulate it.
Meet me here on Savvyday 29 Oatmeal 94
<CODE>InternetTimeToSystemTime</CODE> tries really hard to make sense out of that sentence.
The only thing preventing them from going home was two AA batteries
I wonder where we can find them.
How can I detect that my window has been suppressed from the screen by the shell?
Cloak and dagger, without the dagger.
Should there be a standard C++ pattern for this? transform_to
Or maybe you should expect to write it out the slow way.
How to save a lot of money on cable car tickets in San Francisco
Go downstairs and buy it from the machine.
How can I configure my Windows NT service to autostart when the system gains Internet access?
You can ask to be started when the system gets an IP address.
What’s up with the <CODE>CF_SYLK</CODE> and <CODE>CF_DIF</CODE> clipboard formats?
From a galaxy far, far away.
The custom-made computers powered by pepperoni pizza
Once more for old time's sake.
The 2020/2021 Seattle Symphony subscription season at a glance
The pocket reference guide for 2020/2021.
Why are there trivial functions like <CODE>CopyRect</CODE> and <CODE>EqualRect</CODE>?
You could call them to save a dozen bytes!
Why you might need additional control over the secret event hiding inside the file object
Sometimes every little bit of contention means a lot.
If you’re not keeping the parameter, then you still want to have separate <CODE>T const&</CODE> and <CODE>T&&</CODE> overloads
Forwarding it onward.
If you plan on keeping the parameter anyway, then there’s no need to have separate <CODE>T const&</CODE> and <CODE>T&&</CODE> overloads
You can just take it by value and move it out.
Microspeak: Click stop
A place to pause and refresh.
Gotcha: A threadpool periodic timer will not wait for the previous tick to complete
Don't be like Lucy in the chocolate factory.
Quality updates: Consequences for rogue-patched binaries
You can't get back any more.
Survey of Windows update formats: The Quality update, which obsoletes all the others
Supports everything the others do, at a fraction of the price.
Survey of Windows update formats: The Express update
It's faster in some ways, slower in others.
Survey of Windows update formats: The Delta update
Trying to do some trimming.
Survey of Windows update formats: The Full update
First we need to understand where we started.
Psychic debugging: Why does my app sometimes fail to change the display settings?
Maybe you're in the box.
Why does my C++/WinRT project get errors of the form “<CODE>abi<…>::…</CODE> is abstract see reference to <CODE>producer<…></CODE>“?
Nobody said how to produce the interface.
The various patterns for passing C-style arrays across the Windows Runtime ABI boundary
It's not an object, but not a scalar either.
The legend of the library that caused Building 4 to sink
Are the rumors true? We'll let you decide.
It rather involved being on the other side of this airtight hatchway: Disclosure of information you already had access to
A peek behind your own curtain.
The XAML hat rule: Understanding how it works and why it doesn’t
Finding the point in the parsing where the rule kicks in.
Why am I getting an exception from the thread pool during process shutdown?
The thread pool is already gone. You can't schedule any work on it any more.
Crashing in COM after I call <CODE>CoUninitialize</CODE>, how can COM be running after it is uninitalized?
Mind your destructors.
You might call it a “cross”, but I’m still going to call it an “X”
Different usage on this side of the pond.
How do you pronounce WinDbg?
Just a lot of hot air.
Is there a difference between creating a null pen with <CODE>CreatePen</CODE> and just using the stock null pen?
All null pens are functionally equivalent, so why have more than one? Are some pens more null than others?
Peeking inside C++/CX delegates
If you ever have to debug one of these things.
Windows Runtime delegates and object lifetime in C++/CX, redux
If you are the one calling the delegate, you have an extra thing to worry about.
Not even getting to the airtight hatchway: Creating a process with a different parent
Fiddling a knob that isn't connected to anything.
Microspeak: Bucket bugs, bucket spray, bug spray, and failure shift
How failures in the wild get categorized by analysis.
Can shrinking a <CODE>std::string</CODE> throw an exception?
It depends on how you shrink it.
How can I turn a structured exception into a C++ exception without having to use /EHa, if I can constrain exactly where the structured exception is coming from?
Trying to contain the damage.
How can I handle both structured exceptions and C++ exceptions potentially coming from the same source?
Call for a translator.
Why can’t I use <CODE>SHSetKnownFolderPath</CODE> to change the location of <CODE>FOLDERID_LocalAppData</CODE>?
A acknowledgement of the reality that it not only doesn't work, but leaves the user profile corrupted.
The historical significance of the Burgermaster drive-in restaurant
You can just phone it in.
It’s not a security vulnerability that users can access files that they have access to, even if the file is a little hard to find
Perhaps it's behind a sign that says <I>Beware of the Leopard</I>.
Over-documenting TTM_RELAYEVENT and why it results in a one-second periodic timer running as long as the tooltip is visible
Too much information leads to trouble.
Tree-walking algorithms: Incrementally performing an inorder walk of a binary tree
We need to keep track of where we came from.
Tree-walking algorithms: Incrementally performing a postorder walk of an N-ary tree
This time, we report on the way back up.
Tree-walking algorithms: Incrementally performing a preorder walk of an N-ary tree
Remembering whether you were moving down or up.
Tree-walking algorithms: Incrementally enumerating leaf nodes of an N-ary tree
Stop to rest when you turn.
Anybody who writes <CODE>#pragma pack(1)</CODE> may as well just wear a sign on their forehead that says “I hate RISC”
Alignment as well as padding.
Why doesn’t <CODE>RegSetKeySecurity</CODE> propagate inheritable ACEs, but <CODE>SetSecurityInfo</CODE> does?
An artifact of the timeline.
Nasty gotcha: Positioning your window beneath a topmost window makes it topmost
Picking up properties unintentionally.
2019 year-end link clearance: The different kinds of DLL planting
And why most of them aren't security vulnerabilities.
How do I make a clone of a Windows Runtime vector in C++/CX?
Taking shortcuts with special constructors.
Controversial extension methods: <CODE>CastTo<T></CODE> and <CODE>As<T></CODE>
Reduction in eye exercises.
C++ coroutines: The problem of the DispatcherQueue task that runs too soon, part 4
You can update it a different way.
C++ coroutines: The problem of the DispatcherQueue task that runs too soon, part 3
The storage was right in front of your nose.
C++ coroutines: The problem of the DispatcherQueue task that runs too soon, part 2
Hang on a little bit longer.
C++ coroutines: The problem of the DispatcherQueue task that runs too soon, part 1
Variables disappearing out from under you.
C++ coroutines: The problem of the synchronous apartment-changing callback
Holding the caller thread hostage.
C++ coroutines: The <CODE>co_await</CODE> operator and the function search algorithm
At the confluence of multiple C++ features.
C++ coroutines: Defining the <CODE>co_await</CODE> operator
Converting an awaitable into an awaiter.
C++ coroutines: no callable ‘await_resume’ function found for type
The thing you want isn't there.
C++ coroutines: Short-circuiting suspension, part 2
Avoiding suspension entirely.
C++ coroutines: Short-circuiting suspension, part 1
Avoiding needless stack buildup.
C++ coroutines: Awaiting an <CODE>IAsyncAction</CODE> without preserving thread context
Another use for a custom awaiter.
C++ coroutines: Framework interop
Plays well with others.
C++ coroutines: Constructible awaitable or function returning awaitable?
Two common patterns for simple awaitable objects.
C++ coroutines: Getting started with awaitable objects
Starting our walk-around.
In C++/WinRT, what happens when I treat an <CODE>IInspectable</CODE> as or convert one to a <CODE>bool</CODE>
Much less weird than C++/CX.
In C++/CX, hat pointers are contextually convertible to <CODE>bool</CODE>, but you can’t always <CODE>static_cast</CODE> them to <CODE>bool</CODE>
Because C++/CX is weird like that.
Not actually crossing the airtight hatchway: Harmless out-of-bounds read that is never disclosed
There's no way to make anything bad happen, so is anything bad actually happening?
The automotive emergency kit is not a toy
Please use it only for emergencies.
When should I use delayed-marshaling when creating an agile reference?
It's a balance between doing more work now in anticipation of saving work later.
My summer vacation: The Tower of London and Kensington Palace
Doing the admissions price math.
Using contexts to return to a COM apartment later
You can go back home again.
How do you get into a context via <CODE>IContextCallback::</CODE><CODE>ContextCallback</CODE>?
Piggybacking on the internal infrastructure.
Setting up private COM contexts to allow yourself to unload cleanly
Your private little enclave.
Yo dawg, I hear you like COM apartments, so I put a COM apartment in your COM apartment so you can COM apartment while you COM apartment
Or maybe this is subletting? Airbnb for COM apartments?
A slightly less brief introduction to COM apartments (but it’s still brief)
Managing the multithreading.
My summer vacation: Speaking German (wait, what?)
But you went to England and France.
How do I make a clone of a Windows Runtime vector in C++/WinRT?
You copy it into your own vector, but make sure you copy what you think you're copying.
Why does the Alpha AXP predict a coroutine transfer the way it does?
Working out the possibilities.
The case of the <CODE>UuidCreateSequential</CODE> that didn’t use the MAC address
If you want to use it, make sure it's good.
The Magical Excel 97 Far East Language Build Screwdriver™
For your magical build needs.
I set the same ACL with the GUI and with <CODE>icacls</CODE>, yet the results are different
Sometimes your tools lie to you.
My summer vacation: The London Eye
Round and round. We'll, really just round. No "and round".
Why does my single-threaded program have multiple threads?
They're not your threads, but they're in your process.
Can the MTA thread exit while keeping its COM class registrations alive?
You can keep the MTA alive without having to dedicate a thread.
Not even getting to the airtight hatchway: Planting files in world-writable directories
But who uses that world-writable directory?
How can I copy or move a group of files into a new folder from Explorer?
Putting together things you already have.
The curious pattern of pre-emptively rejecting the solution to your problem: Redrawing during resizing
You'll have to invalidate it, either the easy way or the hard way.
Can I force a <CODE>WM_</CODE><CODE>TIMER</CODE> message to be generated when the timer comes due, even if the message queue is not idle?
You can ask for it explicitly.
How can I give a C++ lambda expression more than one <CODE>operator()</CODE>?
Wacky template games.
How can I have a C++ function that returns different types depending on what the caller wants?
Quantum superposition comes to C++.
The legend of Steve Ballmer’s rental car, the most diligent employee in the world
What a hardworking new employee that must be.
I tried to adjust the time on my alarm clock. I failed.
Now it's not even wrong twice a day.
What happened if you tried to access a network file bigger than 2GB from MS-DOS?
What a strange world you live in.
Why does my program crash if I terminate a thread that is waiting to enter a critical section? It never got the critical section, so who cares?
But we care that it's still waiting.
For one internal build, Windows 95 contained an evil message
Another prank from the user interface team.
The program “G” is preventing you from shutting down
Minding your character set.
If you suppress GDI+ background thread, then you are expected to pump messages yourself
That stuff is now happening on your thread.
Did you hear that story about Bill Gates?: A PR person’s view
They've heard them all.
Why does <CODE>FormatMessage</CODE> say that <CODE>%0</CODE> terminates the message without a trailing newline? Is it secretly <I>adding</I> newlines?
Well, it's not <CODE>FormatMessage</CODE> that's adding the newline.
If you want to terminate on an unexpected exception, then don’t sniff at every exception; just let the process terminate
Get the stack before it unwinds.
Why can’t I create a “Please wait” dialog from a background thread to inform the user that the main UI thread is busy?
Reversal of fortune.
What’s the difference between the hotkeys <KBD>F6</KBD> and <KBD>Alt</KBD>+<KBD>F6</KBD>?
Switching between things, but different things.
When I tell the file or folder picker that I want only file system files and folders, why does it still show virtual folders?
Because there might be a file hiding under it.
C++/WinRT implementation extension points: <CODE>abi_guard</CODE>, <CODE>abi_enter</CODE>, <CODE>abi_exit</CODE>, and <CODE>final_release</CODE>
Coming in, going out, and going away.
By Grabthar’s Hammer, it’s a Galaxy Quest documentary
The seventh best Star Trek movie.
How can I make a call into an elevated service without requiring an elevation prompt?
This is actually quite old technology.
Why do I get a <CODE>winrt::hresult_no_interface</CODE> exception when I try to register an auto-revoke event handler?
The necessary infrastructure isn't there.
How should I create controls on my dialog box that has a tab control?
They are siblings of the tab control, not children.
Rugby: The rules for the casual viewer
What you need to know as an observer.
A common mistake when you try to create a C++ class that wraps a window procedure: Saving the window handle too late
You need it before then.
Fibers aren’t useful for much any more; there’s just one corner of it that remains useful for a reason unrelated to fibers
A better way to clean up.
My summer vacation: London public transportation
It's easy until you try to leave town.
Why are timer IDs and dialog control IDs 64-bit values on 64-bit Windows? Did you really expect people to create more than 4 billion timers or dialog controls?
Anywhere it's possible to put a pointer, somebody will try to put a pointer.
Kabaddi: The rules for the casual viewer
What you need to know as an observer.
A window can’t have two timers with the same ID, so how do I assign an ID that nobody else is using?
A pointer can be used like an ID.
Auctioning off the privilege of initiating the destruction of the Microsoft old campus
Emerging victorious in the bidding war.
Why does my string consist of this Korean character repeated over and over?
Decode that character to its code point.
My summer vacation: The Changing of the Guard at Buckingham Palace
Pomp and circumstance.
How do I define a UWP XAML dependency property that is a collection type?
Putting previous guidance into practice.
Odd things you find when you read the airplane safety information card
Will it float?
What if I want the default value for a XAML dependency property to be a mutable object?
Give it one, but save it for real.
My summer vacation: Watching a German movie on the plane and learning some language history
Trying to keep that part of my brain from disappearing.
The default value for a XAML dependency property should be immutable
Spooky action at a distance.
Reminiscences on 5.25″ floppy drives of the early 1980’s
Because you may have forgotten, or perhaps never knew.
Where did DirectX code names come from?
From too much pizza.
My summer vacation: Paris public transportation
Getting around is easy. Paying for it is hard.
Why does the compiler refuse to let me export my class? If I don’t export it, then the class works fine.
You forced the compiler to try to compile it.
My summer vacation: Versailles
Ostentation fatigue is a real thing.
Why does <CODE>std::is_copy_constructible</CODE> report that a vector of move-only objects is copy constructible?
Because it has a copy constructor, says so on the tin, even though the constructor itself doesn't compile.
My summer vacation: The Louvre Museum
Don't waste your time queueing to see the Mona Lisa.
How do I create a Windows Runtime method that accepts a lambda?
You can use a delegate as a generalized lambda.
How did MS-DOS decide that two seconds was the amount of time to keep the floppy disk cache valid?
A stopwatch and a race against time.
Stop cherry-picking, start merging, Part 11: Chasing the commit by taking a train
Let the train carry you.
Why perform all these complex git machinations when you can just tweak the command line to get what you want?
Who controls the command line?
How to duplicate a file while preserving git line history
Synthesize it in a branch via a rename.
How to split out pieces of a file while preserving git line history: The easy way with misleading commits
Anticipating the octopus.
How to split out pieces of a file while preserving git line history: The hard way with commit-tree
More commit-tree tricks.
How do I split a file into two while preserving git line history?
The octopus delivers.
My summer vacation: The Eiffel Tower
It's really tall, for one.
Another way to sort GUIDs: Java
Because it's Java.
The Turkish lira’s currency code is an unexpected source of problems with computer programmers
Following the rules for currency codes leads to a collision with popular macro.
The sad history of the MFC <CODE>TRY</CODE>/<CODE>CATCH</CODE> macros
Because standard C++ exception handling didn't exist yet.
Trying to wrangle a site visit to Paul Allen’s superyacht “Octopus”
An unsuccessful play for a site visit.
PowerShell programming puzzle: Convert snake_case to PascalCase in one line
Abusing linguistic helper functions for fun.
It rather involved being on the other side of this airtight hatchway: Guessing window procedure magic cookies
You created a very funny-looking function pointer.
Making the <CODE>COM_</CODE><CODE>INTERFACE_</CODE><CODE>ENTRY</CODE> macro better at detecting misuse
Playing around with compile-time errors.
The <CODE>COM_</CODE><CODE>INTERFACE_</CODE><CODE>ENTRY</CODE> must be a COM interface, but nobody actually checks
And if it isn't, bad things happen.
Any sufficiently advanced technology is indistinguishable from a bomb
Even though it doesn't tick. Do bombs even tick?
Silly Alexa trick: Speaking French with a horrible American accent
Asking for a repeat, but in a different speech synthesizer.
If FlushInstructionCache doesn’t do anything, why do you have to call it, revisited
The elixir of forgetfulness.
The sad history of Unicode printf-style format specifiers in Visual C++
Getting ahead of the standard, which went a different way.
What to do if you can’t get the stovetop in your London apartment to turn on
Look for an apparently-useless switch.
On resolving the type vs member conflict in C++, revisited
Filling in some gaps in the previous discussion.
The sad history of Visual Studio’s custom <CODE>__if_exists</CODE> keyword
When times were simpler and bytes were precious.
One byte used to cost a dollar
The cost of software distribution.
Custom-printing your own attendee pass to the Windows 95 launch
Only the highest quality forgeries will do.
The SuperH-3, part 15: Code walkthough
Taking this thing for a spin.
The SuperH-3, part 14: Patterns for function calls
Different ways of setting up a function call.
The SuperH-3, part 13: Misaligned data, and converting between signed vs unsigned values
Okay, now we're doing some programming.
The SuperH-3, part 12: Calling convention and function prologues/epilogues
A typical RISC pattern.
The SuperH-3, part 11: Atomic operations
How do you create an atomic operation when the processor doesn't support them?
The SuperH-3, part 10: Control transfer
The return of the branch delay slot.
Why is there a huge spike in cruise ship width at 32 meters?
Squeezing through tight spaces.
The SuperH-3, part 9: Constants
Squeezing constants into a tiny instruction.
The SuperH-3, part 8: Bit shifting
Sliding left and right.
The SuperH-3, part 7: Bitwise logical operations
Just the basic operations, not much fancy.
The SuperH-3, part 6: Division
And you thought multiplication was complicated.
The SuperH-3, part 5: Multiplication
Now things get more complicated.
The SuperH-3, part 4: Basic arithmetic
Basic elementary-school stuff.
How do I fill out the Canadian eTA if I have a green card with no expiration date?
Use your passport expiration date.
The SuperH-3, part 3: Status flags and miscellaneous instructions
Basically, there's only one flag.
The SuperH-3, part 2: Addressing modes
Quite a lot for a RISC.
The SuperH-3, part 1: Introduction
Digging into the dusty boxes in the closet.
How can I extract the color from a solid color GDI brush?
You can ask for the object information.
Not actually crossing the airtight hatchway: Applying per-user overrides
The user is merely attacking himself.
What about USERSEEUSERDO and GDISEEGDIDO?
Funny names for funny functions.
Why doesn’t the Programs and Features control panel show Last Used On information?
The system doesn't try to figure it out any more, because it was always a guess, and often a really bad one.
Is it a good idea to let <CODE>WriteProcessMemory</CODE> manage the page protection for me?
It's a courtesy, not a contractual obligation.
When it absolutely, positively has to be there for the product demo overnight
We can make up the time in the air.
Why do pinned apps sometimes go to the end of the taskbar, rather than going into the “pinned apps” section of the taskbar?
That's not really a "pinned apps" section. It just looks like one.
Adventures in application compatibility: Calling an internal function
Clearly wandering into unsupported implementation details.
How can I log users off after a period of inactivity, rather than merely locking the workstation? Is there a “logoff” screen saver?
Putting together some building blocks.
What was the code name for Windows 7?
Windows 7.
Providing a small amount of additional control over what happens when an asynchronous I/O completes synchronously
An option named with kernel-colored glasses.
Brännboll: The rules for the casual viewer
The minimum you need to know.
After I made my DLL delay-load another DLL, my DLL has started crashing in its process detach code
You started without it. You should be able to finish without it.
Apollo 11 in real time: Follow the lunar landing mission as it happened
A fifty-year-old replay.
Windows NT services are assigned a SID based on an SHA-1 hash, but what about the risk of collision?
Those collisions are going to be hard to manufacture.
That time Dana Carvey went off script at the Microsoft Company Meeting
Timing is important in investing as well as comedy.
Cricket: The practical exam for 2019
How much did you understand the rules?
My initial confusion when encountering functions whose names begin with <CODE>Co</CODE>
We aren't in the math department any more.
Detecting in C++ whether a type is defined, part 5: Augmenting the basic pattern
Making things more convenient for specific scenarios.
Pesäpallo: The rules for the casual viewer
I wonder how much of this I got right.
Detecting in C++ whether a type is defined, part 4: Predeclaring things you want to probe
Declaring the thing whose definition you are looking for.
Detecting in C++ whether a type is defined, part 3: SFINAE and incomplete types
You can give something a name without saying what it is.
Detecting in C++ whether a type is defined, part 2: Giving it a special name
Maybe it's the real thing, makybe it's a fake.
A difference between cricket and baseball that most people don’t mention
The pitch invasion.
Detecting in C++ whether a type is defined, part 1: The initial plunge
Let's play games with unqualified name lookup.
I set the <CODE>OFN_NONETWORKBUTTON</CODE> option in the <CODE>OPENFILENAME</CODE> structure, but it has no effect on the network item in the navigation pane
But hey, at least it's not a button.
Baseball: The rules for the casual viewer
The minimum you need to know.
Generating good error messages from code analysis tools is harder than it looks
Describing the problem accurately, with enough diagnostics to chase the problem
Why does my attempt to index a collection with the <CODE>x:Bind</CODE> markup extension keep telling me I have an invalid binding path due to an unexpected array indexer?
Important detail stated by omission.
Cricket: The rules for the casual viewer
The minimum you need to know.
Microspeak: Ingestion
Let's hope it goes down easily.
A program to detect mojibake that results from a UTF-8-encoded file being misinterpreted as code page 1252
Because it happens.
2019 mid-year link clearance
Another checkpoint reached.
Why does the <CODE>GetVersion</CODE> function report the major version in the low-order byte, and the minor version in the high-order byte?
It seemed like a good idea at the time.
Why does Windows list my SSD system drive as removable?
Because the driver said it was removable.
Why was Windows for Workgroups pejoratively nicknamed Windows for Warehouses?
That's where most of the copies ended up, at least at first.
Detecting whether the <CODE>-opt</CODE> flag was passed to <CODE>cppwinrt.exe</CODE>: Using <CODE>__has_include</CODE>
Looking in the cushions of the couch.
The 2019 Microsoft Giving Campaign Run/Walk comes with some ground rules
Each rule has a story.
Getting a value from a <CODE>std::variant</CODE> that matches the type fetched from another variant
A bunch of type fiddling, but you'll get there eventually.
How do I write a function that accepts any type of standard container?
There's the standard way, and then there's the generous way.
What is WofCompressedData? Does WOF mean that Windows is a dog?
It stands for Windows Overlay Filter, but that name doesn't really tell you much.
A simple workaround for the fact that <CODE>std::equal</CODE> takes its predicate by value
Pass something else that is easy to copy.
Why does SetFocus fail without telling me why?
If you're going to replace part of the operating system, you have to replace the side effects, too.
What should you do if somebody passes a null pointer for a parameter that should never be null? What if it’s a Windows Runtime class?
They messed up, so make them suffer the consequences, but make the consequences diagnosable.
If you can use GUIDs to reference files, why not use them to remember “recently used” files so they can survive renames and moves?
Because the file that you think is the same file may not actually be the same file.
What order do the items in the “New” menu appear? It looks kind of random.
It's alphabetical order, but not in the obvious way.
How can I determine in a C++ header file whether C++/CX is enabled? How about C++/WinRT?
For conditionally enabling features, say.
The Resource Compiler defaults to CP_ACP, even in the face of subtle hints that the file is UTF-8
Subtlety is not its strong point.
Why does my C++/WinRT project get errors of the form "Unresolved external symbol <CODE>void* __cdecl winrt_<WBR>make_<WBR>YourNamespace_<WBR>YourClass(void)</CODE>"?
You enabled optimizations, but there's some extra bookkeeping to support those optimizations.
Why does my C++/WinRT project get errors of the form ‘<CODE>winrt::</CODE><CODE>impl::</CODE><CODE>produce<D, I></CODE>‘: cannot instantiate abstract class, missing method <CODE>GetBindingConnector</CODE>
The header file requirement was always present, but you often got away with omitting it. Not so much any more.
In the file copy conflict dialog, what happened to the option to copy the new file with a numeric suffix?
It's still there, but you have to dig a little deeper for it.
A bug so cool that the development team was reluctant to fix it
A nice parlor trick, if you had the memory for it.
I called AdjustTokenPrivileges, but I was still told that a necessary privilege was not held
Which token did you adjust?
Why does my C++/WinRT project get errors of the form “consume_Something: function that returns ‘auto’ cannot be used before it is defined”?
Narrowing down the source of the missing header file.
Why does my C++/WinRT project get errors of the form “unresolved external symbol … consume_Something”?
Declared but not defined, but what exactly wasn't defined?
In times of uncertainty, take your cue from the janitor
He's been there before.
Why does Explorer’s <I>New</I> menu take so long to appear the first time I open it?
It's trying to figure out what new things it can do.
Programming puzzle: Creating a map of command handlers given only the function pointer
Creating the magic decoder ring automatically.
Windows Runtime delegates and object lifetime in C++/WinRT
So many choices.
Windows Runtime delegates and object lifetime in C++/CX
You specify the lifetime rules, typically weak.
Windows Runtime delegates and object lifetime in C# and other GC languages
You've left the comfort of the CLR.
The secret signal that tells Windows Runtime events that the event recipient no longer exists
Watch out that you don't make the signal by mistake.
If each thread’s TEB is referenced by the fs selector, does that mean that the 80386 is limited to 1024 threads?
They don't all have to be different simultaneously.
When would CopyFile succeed but produce a file filled with zeroes?
Did the bytes actually make it to the disk?
Why are Bluetooth functions exported from the infrared control panel?
Artifacts of service pack constraints from long ago.
Mundane git commit-tree tricks, Part 7: Combining more than two files into one while preserving line history, manual octopus merging
Sometimes you just have to take things into your own hands.
Mundane git tricks: Combining two files into one while preserving line history
Starting with the two-file case.
Mundane git commit-tree tricks, Part 6: Resetting by reusing an earlier tree
Just take me back.
Mundane git commit-tree tricks, Part 5: Squashing without git rebase
Working completely from trees.
Mundane git commit-tree tricks, Part 4: Changing a squash to a merge
Retroactively removing a command line switch.
Mundane git commit-tree tricks, Part 3: Building a throwaway commit in order to perform a combined cherry-pick-squash
You can create a commit just so you can pick it.
Mundane git commit-tree tricks, Part 2: Building a merge commit manually out of a tree
A variation on a theme.
Mundane git commit-tree tricks, Part 1: Building a commit manually out of a tree
A little bit of plumbing.
Async-Async: Consequences for exceptions
The exception doesn't pop out until later.
Async-Async: Consequences for ordering of multiple calls in flight simultaneously
You don't know when they'll reach the other side.
Async-Async: Consequences for parameters to parallel asynchronous calls
Keep those parameter stable.
Async-Async: Reducing the chattiness of cross-thread asynchronous operations
Setting up fakes on both sides.
Spotting problems with destructors for C++ temporaries
It's sometimes later than you want.
How many ways are there to sort GUIDs? How much time do you have?
Look at all the pretty snowflakes.
How can I launch an unelevated process from my elevated process, redux
You can ask to execute it as if had been executed by somebody else.
The administrative assistant who lasted only one day: A legendary prank from days of yore
When you need to execute a prank effectively, hire a professional.
Why was Texas Hold ‘Em Poker a Windows Ultimate Extra instead of a built-in game?
Cultural sensitivity.
A little program to look for files with inconsistent line endings
Something I wrote.
On resolving the type vs member conflict in C++: The Color Color problem
You have to nudge the compiler in the right direction.
How arbitrary is the ArbitraryUserPointer in the TEB?
Another identifier defined with kernel-colored glasses.
What does this strange value for “Percent CPU” mean in Performance Monitor?
It's the percent CPU, but you have to undo the various adjustments you requested.
Microspeak: Occupant compression
Ouch, it hurts when you squeeze me there.
Today is tax day, but it’s also division meeting day, so let’s get you some forms to fill out
Render unto Caesar, but ask for a little more time.
How can a desktop app use a Windows Runtime object that infers UI context from its thread? The IInitializeWithWindow pattern
Explicitly associating with a window handle.
How can I determine the reason why my window is closing?
Listen for signals.
Even if you open a file with GUID, you can still get its name, or at least one of its names
GetFinalPathByHandle works even for files opened by ID.
When I select multiple files in the File Open dialog, why does the last item come first?
Because it's the focus.
Optimizing your cafeteria meal card stockpile
What's the rate of return on Microsoft cafeteria meal cards?
What does it mean when my attempt to stop a Windows NT service fails with ERROR_BROKEN_PIPE?
The Service Control Manager lost contact with the service, but why?
Why do we need atomic operations on the 80386, if it doesn’t support symmetric multiprocessing anyway?
You might race with yourself.
Dubious security vulnerability: Code execution via LNK file
The hard part is getting them to execute it in the first place.
On the bogosity of speculation: Guessing the price of the original Surface
Scraping the barrel.
Oh no, it’s inspection time again
Great moments in history.
C++/WinRT envy: Bringing thread switching tasks to C# (WPF and WinForms edition)
More magic tasks that break out of the thread configuration mold.
C++/WinRT envy: Bringing thread switching tasks to C# (UWP edition)
Magic tasks that break out of the thread configuration mold.
How do I wait for the completion of the delegate I passed to <CODE>CoreDispatcher.</CODE><CODE>RunAsync</CODE> and <CODE>ThreadPool.</CODE><CODE>RunAsync</CODE>?
You'll need your own signal.
When do <CODE>CoreDispatcher.</CODE><CODE>RunAsync</CODE> and <CODE>ThreadPool.</CODE><CODE>RunAsync</CODE> actions complete?
When the delegate returns, not when it completes.
What does the N in nmake stand for?
It's old now, but at the time, it was new.
Vintage Computer Festival Pacific Northwest 2019
For all your retro-computing gawking.
Turning anything into a fire-and-forget coroutine
Turning on the metaprogramming.
Expressing fire-and-forget coroutines more explicitly, -or- How to turn any coroutine into fire-and-forget
Putting it at the call site instead of in the function itself.
<CODE>winrt::fire_and_forget</CODE> was too forgetful
Usually, you don't care when it finishes, as long as it does.
Why does my app’s uninstaller disappear from the Start menu?
Keeping things tidy.
How do I design a class so that methods must be called in a certain order?
Consider it a chain of operation objects.
How can we use IsBadWritePtr to fix a buffer overflow, if IsBadWritePtr is itself bad?
Don't catch the overflow as it happens. Stop the overflow before it happens.
Resolving security issues sometimes involves its own degree of managing people’s egos
It's not purely technical. There's sociology here, too.
Welcome to my new home on the Microsoft Developer Tools and Services blog site
Pardon the dust.
Why is there a limit of 15 shell icon overlays?
Ran out of bits.
Asking for clear written documentation that “Require trusted path for credential entry” is no longer recommended
It was never recommended in the first place.
Precision questioning: The cynical description
Just keep digging.
Even if your assembly language code doesn’t call any Windows APIs, you still have to follow the ABI
You're not off by yourself; you're part of a society.
What order are pages in a memory-mapped file flushed out to disk?
There isn't one.
How do I destruct an object that keeps a reference to itself, because that reference prevents the object from being destructed
Keep a reference to the right thing.
Predator-prey reversal: Rock lobsters vs whelks on Malgas Island and Marcus Island
Multiple stable configurations.
Alternate definitions for English words, as inferred from bug reports
Lost in translation.
My initial frustration trying to configure our internal VoIP phones that were integrated with instant messaging
A combination of settings that the feature team considered nonsensical.
How to compare two packed bitfields without having to unpack each field
The magic carry-out vector.
How should I report errors from my Windows Runtime API?
It depends on what kind of error it is.
The std::map subscript operator is a convenience, but a potentially dangerous one
It makes code easy to read, but things happen behind the scenes you may not be expecting.
How to draw a nifty text box in your email message
This one weird trick.
That time the CEO of a company complained to Congress about Windows file extensions
Four fingers pointing back.
The 2019/2020 Seattle Symphony subscription season at a glance
The pocket reference guide for 2019/2020.
How do I permit a minus sign to be entered into my edit control, but only if it’s the first character?
Check the insertion point.
How do I allow negative numbers with the <CODE>ES_NUMBER</CODE> edit control style?
You'll have to roll your own.
The early history of the <CODE>ES_NUMBER</CODE> edit control style
It's just a little style bit.
How do I convert all these strange Unicode digits into the ones I remember from Sesame Street?
Know when to fold'em.
How can I check in Win32 whether a Unicode character is any kind of digit?
Ask for its character type.
Accidentally creating a choke point for what was supposed to hand work off quickly to a background task, part 3
Keeping the MTA alive without a thread.
Accidentally creating a choke point for what was supposed to hand work off quickly to a background task, part 2
Synchronizing on the thread pool makes you wait for the thread pool.
Accidentally creating a choke point for what was supposed to hand work off quickly to a background task, part 1
A few simple decisions accumulate and interact.
The Intel 80386, part 17: Future developments
Where we went next.
The Intel 80386, part 16: Code walkthrough
Putting the information into practice.
The Intel 80386, part 15: Common compiler-generated code sequences
Recognizing the patterns.
The Intel 80386, part 14: Rescuing a stack trace after the debugger gave up when it reached an FPO function
Pretend to be the computer.
The Intel 80386, part 13: Calling conventions
A refresher course.
The Intel 80386, part 12: The stuff you don’t need to know
For completeness but not for usefulness.
The Intel 80386, part 11: The TEB
I need another register, let's see what scraps I can find.
The Intel 80386, part 10: Atomic operations and memory alignment
Not much to work from.
The Intel 80386, part 9: Stack frame instructions
For creating and tearing down stack frames.
The Intel 80386, part 8: Block operations
One of the highly specialized groups of instructions.
The Intel 80386, part 7: Conditional instructions and control transfer
Maybe yes, maybe no.
The Intel 80386, part 6: Data transfer instructions
Keeping things moving.
The Intel 80386, part 5: Logical operations
Fiddling with bits.
The Intel 80386, part 4: Arithmetic
The things that computers do.
The Intel 80386, part 3: Flags and condition codes
It's just a bunch of stuff that happened.
The Intel 80386, part 2: Memory addressing modes
Thirteen different ways to access memory.
The Intel 80386, part 1: Introduction
Hitting a bit closer to home.
How do I get the effect of C#’s async void in a C++ coroutine? Part 3: Simplifying the boilerplate
Factoring it out.
How do I get the effect of C#’s async void in a C++ coroutine? Part 2: Keeping track of the lifetimes
There are two types of lambdas you have to write, so why not write two lambdas?
How do I get the effect of C#’s <CODE>async void</CODE> in a C++ coroutine? Part 1: Why does the obvious solution crash?
Wrap it up, but watch out how you do it.
Don’t pass lambdas (or other multi-line entities) as parameters to macros
It makes debugging much more difficult.
Why would the incremental linker insert padding between section fragments?
So it can be incremental more easily.
Why do we even need to define a red zone? Can’t I just use my stack for anything?
I mean, it's my stack, isn't it?
Why am I getting mojibake when I try to create a window?
Look for the character set mismatch.
It rather involved being on the other side of this airtight hatchway: Messing with somebody’s registry
Getting to the other side is left as an exercise.
<CODE>STATUS_<WBR>STACK_<WBR>BUFFER_<WBR>OVERRUN</CODE> doesn’t mean that there was a stack buffer overrun
It used to mean that, but now it can mean other things, too.
The GetRegionData function fails if the buffer is allocated on the stack. Is it allergic to stack memory or something?
One of the lesser-known ground rules.
A trick for keeping an object alive in a C++ lambda while still being able to use the <CODE>this</CODE> keyword to refer to it
Capture it twice, once for the money, and once for the show.
Why am I getting mojibake when I try to create a shell link?
Make sure the thing you ask for is the thing you want.
How can I prevent a WebView control from opening a browser window?
It will check with you first, but you have to be listening.
Why does the elevation prompt have only the wallpaper as its background?
Caught unprepared.
2018 year-end link clearance
We made it to the end!
The case of the orphaned critical section despite being managed by an RAII type
Rolling up the debugging sleeves.
<CODE>SHOpenRegStream</CODE> does not mix with smart pointers
Old school meets new school, again.
Don’t forget: std::pair does lexicographical ordering, so you don’t have to
Let it do the comparing.
How do I save the results of a file search in Explorer? Not the query itself, but the results
Copy them to the clipboard.
Random internal Windows terminology: IDW, Razzle, and their forgotten partners IDS and Dazzle
A peek behind the history of the terms.
On the attempts to resurrect Space Cadet Pinball
Not many options remain.
In 16-bit Windows, some per-process data structures were really per-data segment
You just have to set up a private data segment.
It rather involved being on the other side of this airtight hatchway: Hanging the loader
You're already there. No need to brag.
How come Explorer reports higher disk space used on my volume than my third party disk space tool?
It's probably in a place your tool can't see.
Not getting past the title: This is not the bug you’re looking for
The title contains the same word, but that's about the only thing that's the same.
The case of the mysterious LoadLibrary error message after signing in
A little screen shot forensics.
How can I programmatically wait until the taskbar has finished booting completely before I create my notification icon?
It will let you know.
How can I programmatically wait until the system has finished booting completely before doing my own computations?
Your observation of the system mutates the system.
Why doesn’t my lock screen image change after I replace the image file?
It got captured when it was set.
When a customer asks for something unsupported, and they promise not to get upset when it stops working, don’t believe them
Because they'll be back.
The case of the buffer overflow vulnerability that was neither a buffer overflow nor a vulnerability
Not quite knowing how assembly language works, I guess.
Xformer 10: The Atari 800 emulator has gotten a huge update
It's over 30 years old, but can still be improved, and it sure did.
How is it that WriteProcessMemory succeeds in writing to read-only memory?
Because it tries really hard.
How can dereferencing the first character of a string take longer when the string is longer? I’m looking only at the first character, which should be constant time
There's a lot hiding in that <VAR>O</VAR>.
The plural of Nexus is Nexūs, in case you cared (which you almost certainly don’t)
Only for Latin nerds.
Why can’t I close windows directly from the Alt+Tab interface in Windows Vista?
Elevation and interruption.
Choosing error codes based on a really nice <CODE>#define</CODE> doesn’t necessarily lead to a readable message to the user
Device not ready? What device?
Why does Clipboard.SetData put extra junk in the clipboard data? And how can I get it to stop?
Strings and things, but you need the things.
Taking advantage of the ordering guarantees of the LINQ GroupBy method
Sorting and grouping in a particular way.
What happens if I mutate a string in a p/invoke?
It seems to work, for specific meanings of "seems".
Nifty trick: Combining constructor with collection initializer
Two great tastes that work great together.
What’s up with Code Analysis rule CA2202: Do not dispose objects multiple times?
It's trying to get inside your head.
If activation of your gift card lasts more than four hours, consult a physician immediately
Is it ready yet?
The default number of threads in an I/O completion port is the number of processors, but is that logical or physical processors?
How much stuff can happen at once?
How can I make a dialog box right-to-left at runtime?
You'll have to get that style change in quickly.
Trying to allocate the same virtual address in multiple processes
But what are you going to put there?
For a brief period, the kernel tried to deal with gamma rays corrupting the processor cache
Not sure what good it does.
How do I suppress the “Did you mean to switch apps?” warning message from my XAML WebView control?
It will ask you what to do, and you can tell it to do nothing.
The Moncler 1 Pierpaolo Piccioli, your high fashion for the elegant parties that take place in a walk-in freezer
I'm sure it looks better after you unpack it from the bubble wrap.
Closing the race window between creating a suspended process and putting it in a job
Start it there from the beginning.
Songs with every other beat removed, how to make your own!
Sounds familiar, but oddly wrong.
How do I revert a control back to its default theme?
The special signal.
What’s the point of passing a never-signaled event to MsgWaitForMultipleObjects?
It's a placeholder for something that didn't need a placeholder.
Saying good-bye to the original Microsoft Redmond campus
The home of many memories, perhaps not all good ones.
The case of the System process that consumed a lot of CPU
Let's look at the performance trace.
Gotchas when using linker sections to arrange data, part 2
An unexpected null could throw the whole thing out of alignment.
Gotchas when using linker sections to arrange data, part 1
Nulls can show up in unexpected places.
Using linker segments and __declspec(allocate(…)) to arrange data in a specific order
Getting the ducks in a row, in order.
Dubious security vulnerability: A program that adds a user to the Administrators group in the usual way
This is a perfectly legitimate program.
Sure, you can implement your own cryptographic service provider for a standard algorithm, but why would you?
You are signing up for a very big world of hurt.
Why does the MonthCalendar control show the wrong week numbers in Romania?
Wrong from whose point of view?
In the state of Washington, you are allowed to turn left on a red light onto a one-way street
And freeway onramps count as one-way streets.
If the prototypes of DispatchMessageA and DispatchMessageW are identical, why have both?
Because there's still a character set dependency.
Dulce et decorum est pro patria party
Anyone up for a toga party?
What happened to the Arial Unicode MS font?
It couldn't do what it was originally created to do.
The case of the oplock deadlock poppycock
Call Sherlock.
How do I prevent users from using the mouse to drag the trackbar thumb to positions that aren’t multiples of five? Part 2: Nudging the thumb position
A little nudging here, a little nudging there.
How do I prevent users from using the mouse to drag the trackbar thumb to positions that aren’t multiples of five? Part 1: Reframe the problem
Make <I>everything</I> a multiple of five.
Adding a Ctrl+arrow accelerator for moving the trackbar by just one unit, part 2: Second try
Intercepting the thumb motion.
Adding a Ctrl+arrow accelerator for moving the trackbar by just one unit, part 1: Initial plunge
The obvious thing starts to get out of hand.
Why does the Entry Point Not Found error dialog sometimes not include the name of the missing entry point?
Because the name is too long.
File-extending writes are not always synchronous, which is entirely within the contract
It is an option but not a requirement.
After reporting a non-responsive program to Windows Error Reporting, why does the process spawn a suspended child process?
That's just a ghost, a shadow of the original.
What does the “Ae” stand for in AeDebug?
I'm not sure, but I think it's Application Error.
Why does Windows ask me to pick a program with which to open a file, even when I already specified which program I want to use to open the file?
It's just double-checking after the situation has changed.
How can I programmatically inspect and manipulate a registry hive file without mounting it?
Enter the offline registry library.
So, um, what are we looking at?
The wonders of nature, perhaps.
Why doesn’t GetTextExtentPoint return the correct extent for strings containing tabs?
It doesn't do carriage control.
How can I include/exclude specific memory blocks in user-mode crash dumps?
Add it to the inclusion or exclusion list.
Notes on DrawText and tab stops
You can ask, but then you can't ask for other things, unless you ask a different way.
The numerology of the sample directory listing in the Windows 95 font selector property sheet page
Leave a thumbprint.
When I call <CODE>CryptProtectData</CODE> with the same parameters, why aren’t the results identical?
A little added seasoning.
How can I use <CODE>WS_</CODE><CODE>CLIPCHILDREN</CODE> and still be able to draw a control with a transparent background?
Removing all the barriers to painting, perhaps too many.
Can I be sure that turning on automatic generation of short file names will get me short file names?
You can try hard, but it may not succeed.
Practical example of why you need to leave room for German localization
Try to say it all in one breath.
All sorts of bad things happen when we disable the Task Scheduler service, is that bad?
Well, it sure doesn't sound good.
Generating a table with vertical text, like I did with the sad history of the C++ <CODE>throw(…)</CODE> exception specifier
Here's how I did it.
The sad history of the C++ <CODE>throw(…)</CODE> exception specifier
I promise not to throw, but who's going to check?
Can you wear wallpaper on your feet? You can if it’s a PARTY.BMP!
Wearing your history.
Considering the performance implications of converting recursion to an explicit stack
Another game of trade-offs and balances.
What does the thread parameter to <CODE>SetWindowsHookEx</CODE> actually mean?
What does it mean to be "associated" with a thread?
How do I prevent my program’s temporary documents from appearing in Search?
Put them in the right place.
Why does the compiler turn my conditional loop into an infinite one?
It's all in the threading.
Why is <CODE>regsvr32</CODE> exiting with code 3?
Coming up with theories and ways to test those theories.
What do the various <CODE>regsvr32</CODE> exit codes mean?
Reporting which step the problem occurred at.
Why did every Windows 3.0 DLL have an exported function called WEP?
The Windows Exit Procedure.
Why is Alt+F4 the hotkey for closing a window? Why not Alt+F5 or Alt+F3?
It was the next one available.
A lack of species sensitivity when serving pizza to guests
This bacon thing is getting out of hand.
What defines an old-style common dialog?
Going back into the Before Time.
Why does the Zune HD have the message “For our Princess” on the inside of the case, and why is she a princess?
A tribute to a team member who passed away.
Raising the colon off the ground
Not something your gastroenterologist says, surprisingly.
Anything is a soldering kit if you’re brave enough: The MOnSter 6502
Are you nuts? Probably.
How do I get the system to run my program in this very special way?
You can set up the special way yourself.
Le Chatelier’s principle in action: Notifications
Let me notify you about things you don't care about.
How can I conditionally compile based on a preprocessor macro value, while ensuring that the macro is correctly spelled?
Another stupid preprocessor trick.
Removing the <CODE>TerminateThread</CODE> from a DLL that needs to shut down a helper thread at unload
Designing it out again.
What does it mean for a window to be Unicode?
The expected character set of the current window procedure.
How do I request that my out-of-process COM server run unelevated?
Back to the interactive user.
Apparently they know more information about me than me, but dare I ask?
Blind content retweeting.
That time the Word team hired somebody who never showed up, who turned out to be an important member of the team in spite of not being on it
Well, we've got the nameplate at least.
Removing the <CODE>TerminateThread</CODE> from code that waits for a job object to empty
Designing it out.
The early history of Windows file attributes, and why there is a gap between System and Directory
One, two, four, sixteen.
Obsolete Microspeak: TDBN and the six-pack
Old Windows 8 terminology.
The evolution of Windows 8 charms
For regaling people at your next cocktail party, perhaps.
How do I force the Task Manager window closed whenever it opens?
Um, that's not really your decision.
The Windows 95 team were proud slackers
Another adopted slight.
The PowerPC 600 series, part 14: Code walkthrough
Putting the theory into practice.
The PowerPC 600 series, part 13: Common patterns
How to recognize different kinds of jumps and calls.
The PowerPC 600 series, part 12: Leaf functions
Making do with what you are given.
The PowerPC 600 series, part 11: Glue routines
Binding the two sides together.
The PowerPC 600 series, part 10: Passing parameters, function prologues and epilogues
The most dangerous parts of flying a function are take-off and landing.
The PowerPC 600 series, part 9: The table of contents
Finding your bearings.
The PowerPC 600 series, part 8: Control transfer
Jump around.
The PowerPC 600 series, part 7: Atomic memory access and cache coherency
How to avoid a break-up.
The PowerPC 600 series, part 6: Memory access
Load 'em up.
The PowerPC 600 series, part 5: Rotates and shifts
Get out your Swiss army knife.
The PowerPC 600 series, part 4: Bitwise operations and constants
Twiddling around.
The PowerPC 600 series, part 3: Arithmetic
Who knew there were so many ways to add numbers.
The PowerPC 600 series, part 2: Condition registers and the integer exception register
Keeping track of things that happened.
The PowerPC 600 series, part 1: Introduction
Here we go again.
A puzzle aboard the Anacortes-Sidney ferry: How do the cars get off?
At an apparent impasse.
Creating an awaitable lock for WinJS and JavaScript Promises
Rolling onward.
Creating an awaitable lock for C++ PPL tasks
Rolling our own.
Creating an apartment-aware PPL task from nothing
It says it has to be <CODE>IAsyncAction</CODE>- or <CODE>IAyncOperation<T></CODE>-derived, so let's do that.
Server names: One of the remaining places where IT managers can be a little silly
Usually by establishing a theme.
Dark Pattern: Opt-in above the fold, but opt-out below the fold
Don't stop yet. Read all the way to the end.
Is the <CODE>TerminateThread</CODE> function synchronous?
Nope. It merely starts the termination but does not wait for the termination to complete.
What happens to custom unhandled exception filters if a debugger is not running?
Nothing, that's what. Absolutely nothing.
Why are my file write operations synchronous, even though I opened the file as <CODE>FILE_<CODE></CODE>FLAG_<CODE></CODE>OVERLAPPED</CODE>?
Extending the valid bytes is always synchronous.
Pushing the boundaries of cryptography in a security vulnerability report
If it's what you say, then you don't need a supercomputer.
The heavy metal umlaut reaches baked goods
For that extra Germanic oomph.
How do I trigger an EN_UPDATE notification for all of my edit controls when the user’s locale information changes?
It's your edit control, so you can do it yourself.
How can I get the actual window procedure address and not a thunk?
Match the character set of the top-level window procedure.
When is it appropriate to use the current processor number as an optimization hint?
Try not to let it slip out from under you.
Sure I can protect data with CryptProtectData, but how do I remove the ability to decrypt it?
You can put a secret in the nonce, though it's not really a secret by that point.
What is this vmmem program that is using up all my CPU and memory?
That's where your virtual machine resource usage goes.
Internal training video on expense reports contains inconsistency: Alert the media!
Was this a test? I'm not sure.
Warning: Ruler is not to scale
Inches enlarged to show texture.
When generating a random password, the result must still be a valid string
Invalid strings can't round trip through multiple encodings.
Why does a non-recursive <CODE>ReadDirectoryChangesW</CODE> still report files created inside subdirectories?
Because they do affect the top-level directory.
Const methods don’t prevent a method from having side effects
Though they shouldn't if you know what's good for you, but the compiler doesn't know whether you know what's good for you.
How do I change the password of another user without having to sign in as them?
You can do it from the password change screen.
Stop merging if you need to cherry-pick
An opposing view from the VSTS team.
The case of the very large memory blocks of the same size, mostly zero, but whose nonzero bytes follow a pattern
Some initial pattern recognition, followed by an ad-hoc tool.
How can I detect whether the user is logging off?
It's hidden as a strange sort of system metric.
The Windows Calculator no longer generates tiny errors when calculating the square root of a perfect square
Tweaking the algorithm.
Did you happen to lose something in the Amstel River? Say within the past 500 years?
Maybe you can find it here.
How can I determine why the System process is listening on port 80?
netsh can tell you.
Consider the environment: Do you want a receipt?
Actually, I don't really care whether you want one. The decision is foregone.
2018 mid-year link clearance
Reaching the halfway point.
How can I detect from the preprocessor what a macro’s definition is?
Evil preprocessor tricks.
Lock free many-producer/single-consumer patterns: A work queue of distinct events, order not important, follow-up question
We try to minimize spurious wake-ups, but eliminating them is probably not worth the effort.
Taking advantage of the asymmetry of offline compression
You can spend a lot of time compressing, but decompression still needs to be fast.
The cost/benefit analysis of comparing before an assignment
Factors pull in both directions. The result is a balance.
How I learned to type
On an old manual typewriter.
What can influence how much stack is consumed when sending a message?
Who wants to know? No really, that's the answer.
When I intentionally create a stack overflow with <CODE>SendMessage</CODE>, why do I sometimes not get a stack overflow?
It depends on what overflows first.
Microspeak: knobs
Configuration settings, basically.
Woodworking, the opposite of software development
According to self-reported data from one person who could have just made it up.
Is there a problem with <CODE>CreateRemoteThread</CODE> on 64-bit systems?
There's more to injecting code than copying bytes.