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.