2017–2021
1,412 posts
2021 273
December 2021
- 2021 year-end link clearance
- The case of the programs that were launched with impossible command line options
- The C++/CX String^ is not an object, even though it wears a hat
- You can’t copy code with memcpy; code is more complicated than that
- A rejected attempt to inject pseudo-physics into Windows 8 toast notifications
- How do I add custom controls to the common file open or file save dialogs?
- The Thanksgiving to Christmas sales nationwide of the VIS could be tabulated in an unsigned char
- It’s easy to get data into the GPU, but harder to get it out
- How do I programmatically reposition monitors in a multiple-monitor system?
- You thought Windows drivers from 2006 were old, wait’ll you see the Intel drivers from 1968!
- Why do I have to add one when setting a class background brush to a system color?
- Why is the stack overflow exception raised before the stack has overflowed?
- Why does the precise point at which I get a stack overflow exception change from run to run?
- What does “Do not launch, but debug my code when it launches” mean?
- Embarrassing product names created: Windows CE
- Dubious security vulnerability: Accessing information across accounts after changing email address
- It’s okay to be contrary, but you need to be consistently contrary: Going against the ambient character set
- If you’re going to configure a header file, you have to do it before you include the header file
- Using CRTP to your advantage: Simplifying overloaded Windows Runtime method projections in C++/WinRT
- What happens when a hot air balloon lands in your yard?
- It rather involved being on the other side of this airtight hatchway: Producing malicious data in a kernel driver
- Compiler error message metaprogramming: Helping to find the conflicting macro definition
- How can I produce a C-style array from a Windows Runtime asynchronous operation?
- How do I receive ownership of a C-style array in a Windows Runtime component?
- How can I transfer ownership of a C-style array to a Windows Runtime component?
November 2021
- How can my C++/WinRT component pass a std::vector back to the caller?
- How did Windows 3.1’s virtual machine manager get the information to show in the text-mode Alt + Tab switcher?
- The two products may be identical, but they are not the same
- I called AdjustTokenPrivileges, but I was still told that a necessary privilege was not held, redux
- How do I pass an array of variable-sized PROPSHEETPAGE structures to PropertySheet ?
- Appending additional payload to a PROPSHEETPAGE structure
- Every business process secretly wants to fail
- A reminder about the correct way of accessing and manipulating the position of icons on the desktop
- Why is my C++/CX ref class forbidden from having public methods that are templates or mention, say, std::vector?
- What does the CompileAsWinRT Visual Studio project option mean?
- The mental model for StartThreadpoolIo
- Microspeak: Righteous
- A practical use for GetHGlobalFromStream when sharing was never your intention
- Another way of looking at C++ reverse iterators
- I sort of knew that I’m a bad flute player, but I guess this proves it
- The inside story of the outside investigation of SoftRAM 95
- How am I supposed to create children of the Win32 tab control?
- If your domain name parser can’t handle internationalized domain names, then maybe that’s your parser’s problem
- Restoring support for pre-standardization coroutine free awaiters for even older code bases
- The case of the C++/WinRT cached factories that pointed into freed memory
- How can I prevent myself from accessing a lambda captured variable or a parameter after I’m done with it?
- A capturing lambda can be a coroutine, but you have to save your captures while you still can
- The focus rectangle says, “I’m not orange. I’m just drawn that way.”
- Why do all this coroutine stuff if you can just use std::future ?
October 2021
- Giving a single object multiple COM identities, part 4
- Giving a single object multiple COM identities, part 3
- Giving a single object multiple COM identities, part 2
- Giving a single object multiple COM identities, part 1
- A very brief introduction to patterns for implementing a COM object that hands out references to itself
- Renaming a file is a multi-step process, only one of which is changing the name of the file
- Why isn’t MapDialogRect mapping dialog rectangles?
- My code crashed when I asked WIL to convert an exception to an HRESULT, did I throw an improper exception type?
- That time we had a network outage due to unexpected hunter activity
- How can I get the screen reader to read out an error message that I displayed inline on a page?
- What does the SizeOfImage mean in the MODULEINFO structure?
- Why does GetModuleInfo fail to produce an entry point for executables?
- Local variables are different from parameters in C++ coroutines
- The happy hand: A puzzle about odd names in Azure DevOps
- Is there a way that my macro can detect that it’s running in a C++ coroutine?
- What can I do about timer build-up when waiting for COM outbound calls to complete?
- Debugging coroutine handles: The Microsoft Visual C++ compiler, clang, and gcc
- Why is the main() function always at address 0x00401000 in a simple program?
- Not from inside the Redmond Reality Distortion Field: Microsoft Streets and Trips support for ferries
- Some lesser-known powers of std::optional
- The subtleties of CreateStreamOnHGlobal , part 4: Non-movable memory
September 2021
- The subtleties of CreateStreamOnHGlobal , part 3: Suppressing the deletion of a shared HGLOBAL
- The subtleties of CreateStreamOnHGlobal , part 2: Suppressing the deletion of an unknown HGLOBAL
- The subtleties of CreateStreamOnHGlobal , part 1: Introduction and basic usage
- Why am I getting an unresolved external from C++/WinRT if it is a header-only C++ library?
- The case of the UWP application that crashes at launch on Windows 10X
- Why is there trailing garbage when I try to decode the bytes of a HttpContent object?
- Converting between UTF-8 strings and UTF-16 strings in C++/WinRT
- The CertUtil program will decode Windows error codes, and in a variety of formats
- What does this mean? The caller specified wait timed out before the operation completed because a host termination is in queued
- Adventures in application compatibility: The case of the wild instruction pointer that, upon closer inspection, might not be so wild after all
- The C++ implicit assignment operator is a non-ref-qualified member, even if the base class’s assignment has a ref-qualifier
- How do I set the alpha channel of a GDI bitmap to 255?
- Microspeak: Persona
- The C++/WinRT query_ interface_ tearoff extension point, and using it for COM aggregation
- Ordering asynchronous updates with coroutines, part 5: Bowing out via cancellation
- Ordering asynchronous updates with coroutines, part 4: Bowing out, explicit version
- Ordering asynchronous updates with coroutines, part 3: Let them all compete, but only one wins
- Ordering asynchronous updates with coroutines, part 2: Restart with hand-off
- Ordering asynchronous updates with coroutines, part 1: Mutual exclusion
- I declared my Windows Runtime method as accepting an array by reference, but it always arrives empty
- Adventures in application compatibility: The cost of forgetting to specify a calling convention
- Looking at world through __stdcall-colored glasses
August 2021
- Notes on the Seattle Symphony’s expanded concert schedule for 2021–2022 season
- What are the consequences of increasing the per-process GDI handle limit?
- The various ways of moving between C++/WinRT and classic COM
- How can I break down a shell item in the same way as the breadcrumb bar?
- In C#, how do I get the descriptive text for an HRESULT?
- The Windows Runtime PassArray is a read-only array, even though it isn’t declared const
- How to sneak the Windows 95 credits screen into the build without anybody noticing
- C++/WinRT nasty gotcha: winrt::param::hstring constructed from std::wstring_view requires null termination
- How do I find out the size of the mouse cursor?
- How to pwn an unattended laptop, according to Humans
- What is the deal with the SM_CXCURSOR system metric?
- What’s with all of the references to “dude” in the accessibility header files?
- Is it expected that custom default pinned taskbar items via LayoutModification.xml keep coming back each time the user logs on?
- What are these dire multithreading consequences that the GetFullPathName documentation is trying to warn me about?
- Resolving the ambiguity when your C++ class inherits from multiple base classes that have the same method
- How can I find the heap that a memory block originally came from, so I can free it properly?
- How can I prevent my UWP app from showing up in the Start menu?
- Why did the old RAID database use a signed 16-bit integer for its record count? Why not unsigned, or a 32-bit integer?
- Why am I getting a weird error about promise_ type when I try to write a coroutine?
- Using Windows Runtime interop methods from C++/WinRT: Some helper functions
- An example of using Windows Runtime interop methods from C++/WinRT: RequestTokenForWindowAsync
- What is a static Windows Runtime class, how should I express it, and when should I use it?
- Why are all of the retail demo names male?
- How can I figure out which object is being hosted in an instance of dllhost?
July 2021
- Why doesn’t my asynchronous read operation complete when I close the handle?
- On the interaction between the FILE_ FLAG_ NO_ BUFFERING and FILE_ FLAG_ WRITE_ THROUGH flags
- How can I prevent the mouse from moving in response to touch input?
- Twitter misdetected the 2011 Build conference keynote as a denial-of-service attack
- Diagnosing why your batch file prints a garbage character, one character, and nothing more
- The history of passing a null pointer as the key name to RegOpenKeyEx
- The case of the strange NT-style path that was discovered by SearchPath
- I know I can change the color of the DC pen, but what about the other attributes?
- Why does the New menu even exist for creating new empty files?
- C++11 braced initialization made the impossible possible (and how to fix it so it stays impossible)
- What’s the difference between throwing a winrt::hresult_error and using winrt::throw_hresult ?
- On proper handling of buffers in COM and RPC methods
- How to perform more complicated search and replace-style renaming in a batch file
- How did copying and renaming with wildcards work in MS-DOS?
- Why do smart pointers null out the wrapped pointer before destroying it?
- On the perils of holding a lock across a coroutine suspension point, part 3: Solutions
- On the perils of holding a lock across a coroutine suspension point, part 2: Nonrecursive mutexes
- On the perils of holding a lock across a coroutine suspension point, part 1: The set-up
- How to act like you know Chinese even though you don’t, episode 2
- What happens if I use a squash instead of a true merge when performing one of the git tricks?
- How a basketball became a featured instrument in a Sting song
- Is it okay to call MapViewOfFile on the same mapping handle simultaneously from different threads?
- Studying linker error messages to find the cause of the unresolved external: Character sets
June 2021
- 2021 mid-year link clearance
- What should the CPU usage be of a fully-loaded CPU that has been throttled?
- The initializing constructor looks like an assignment, but it isn’t
- The ARM processor (Thumb-2), part 20: Code walkthrough
- The ARM processor (Thumb-2), part 19: Common patterns
- The ARM processor (Thumb-2), part 18: Other kinds of prologues and epilogues
- The ARM processor (Thumb-2), part 17: Prologues and epilogues
- The ARM processor (Thumb-2), part 16: The calling convention
- The ARM processor (Thumb-2), part 15: Miscellaneous instructions
- The ARM processor (Thumb-2), part 14: Manipulating flags
- The ARM processor (Thumb-2), part 13: Trampolines
- The ARM processor (Thumb-2), part 12: Control transfer
- The ARM processor (Thumb-2), part 11: Atomic access and barriers
- The ARM processor (Thumb-2), part 10: Memory access and alignment
- The ARM processor (Thumb-2), part 9: Sign and zero extension
- The ARM processor (Thumb-2), part 8: Bit shifting and bitfield access
- The ARM processor (Thumb-2), part 7: Bitwise operations
- The ARM processor (Thumb-2), part 6: The lie hiding inside the CMN instruction
- The ARM processor (Thumb-2), part 5: Arithmetic
- The ARM processor (Thumb-2), part 4: Single-instruction constants
- The ARM processor (Thumb-2), part 3: Addressing modes
- The ARM processor (Thumb-2), part 2: Differences between classic ARM and Thumb-2
May 2021
- The ARM processor (Thumb-2), part 1: Introduction
- On the proper care and feeding of the default_overload Windows Runtime attribute
- How can I convert between IANA time zones and Windows registry-based time zones?
- How ownership of the Windows clipboard is tracked in Win32
- Why are device-independent bitmaps upside down?
- On static methods in the Windows Runtime and C++/WinRT
- Obtaining attributed network usage information from the Windows Runtime
- Obtaining network usage information from the Windows Runtime
- Awaiting Windows Runtime asynchronous operations from C# desktop apps
- The blessing of the leading zero
- Why did Windows 95 keep window coordinates at multiples of 8?
- Why isn’t my shell namespace extension getting every single DragOver mouse message?
- Drag/drop effects: The little drop information box
- Using Explorer’s fancy drag/drop effects in your own programs
- Why does the mouse cursor jump a few pixels if you right-click on the Start button?
- What are the page sizes used by Windows on various processors?
- A subtle way your await_suspend can access the coroutine frame when it shouldn’t
- Is std::exception_ptr nothrow constructible and assignable?
- Why is coroutine_handle::resume() potentially-throwing?
- A map through the three major coroutine series
- C++ coroutines: Promise constructors
- C++ coroutines: Converting among tasks that use the same promise
April 2021
- C++ coroutines: Waiting synchronously for our coroutine to complete
- C++ coroutines: Adding COM context support to our awaiter
- C++ coroutines: Snooping in on the coroutine body
- C++ coroutines: How do I create a coroutine that terminates on an unhandled exception?
- C++ coroutines: What does it mean when I declare my coroutine as noexcept?
- C++ coroutines: Associating multiple task types with the same promise type
- C++ coroutines: Improving cold-start coroutines which complete synchronously
- C++ coroutines: Cold-start coroutines
- C++ coroutines: Getting rid of our atomic variant discriminator
- C++ coroutines: Allowing the awaiter to be destroyed while suspended
- C++ coroutines: Getting rid of our reference count
- C++ coroutines: Getting rid of our mutex
- Pivot points and financial numerology
- C++ coroutines: Making it impossible to co_await a task twice
- C++ coroutines: Tradeoffs of making the promise be the shared state
- C++ coroutines: The lifetime of objects involved in the coroutine function
- C++ coroutines: Managing the reference count of the coroutine state
- C++ coroutines: Awaiting the simple_task
- C++ coroutines: Accepting types via return_void and return_value
- C++ coroutines: Building a result holder for movable types
- C++ coroutines: Making the promise itself be the shared state, the outline
- C++ coroutines: Making the promise itself be the shared state, the inspiration
- C++ coroutines: What happens if an exception occurs in my return_value?
March 2021
- C++ coroutines: The initial and final suspend, and improving our return_value method
- C++ coroutines: Basic implementation of a promise type
- C++ coroutines: The mental model for coroutine promises
- Creating a task completion source for a C++ coroutine: Failing to produce a result
- Creating a task completion source for a C++ coroutine: Producing nothing
- SEO spammers don’t really understand who they spammed
- Creating a task completion source for a C++ coroutine: Producing a result with references
- The 2021/2022 Seattle Symphony subscription season at a glance
- Creating a task completion source for a C++ coroutine: Producing a result
- Creating other types of synchronization objects that can be used with co_await, part 10: Wait for an event to clear
- Creating other types of synchronization objects that can be used with co_await, part 9: The shared mutex (continued)
- Creating other types of synchronization objects that can be used with co_await, part 8: The shared mutex
- Creating other types of synchronization objects that can be used with co_await, part 7: The mutex and recursive
- Creating other types of synchronization objects that can be used with co_await, part 6: The semaphore
- Creating other types of synchronization objects that can be used with co_await, part 5: The auto-reset event
- Creating other types of synchronization objects that can be used with co_await, part 4: The manual-reset event
- Creating other types of synchronization objects that can be used with co_await, part 3: Parallel resumption
- Creating other types of synchronization objects that can be used with co_await, part 2: The basic library
- Creating other types of synchronization objects that can be used with co_await, part 1: The one-shot event
- Creating a co_await awaitable signal that can be awaited multiple times, part 6
- Creating a co_await awaitable signal that can be awaited multiple times, part 5
- Creating a co_await awaitable signal that can be awaited multiple times, part 4
- Creating a co_await awaitable signal that can be awaited multiple times, part 3
- Creating a co_await awaitable signal that can be awaited multiple times, part 2
- Creating a co_await awaitable signal that can be awaited multiple times, part 1
February 2021
- What does error E_ILLEGAL_DELEGATE_ASSIGNMENT mean?
- What does it mean when a call fails with 0x8000001F = RO_E_BLOCKED_CROSS_ASTA_CALL?
- What is so special about the Application STA?
- Why does Task Manager tell me that I have a Startup program named Program?
- French is a very fragile language, or at least it seems so from the stories I hear
- How do I reset my PIN complexity requirements after removing a work account from Windows 10?
- How can I prevent a Windows Runtime WebView from loading any content beyond the initial request and its redirects?
- How can I prevent a Windows Runtime WebView from loading any content beyond the initial request?
- How can I return custom content for specific URLs requested by a Windows Runtime WebView?
- Hardware engineers solve a usability problem with the PS/2 connector, but inadvertently create a new one
- The COM static store, part 6: Using C++ weak references
- The COM static store, part 5: Using COM weak references
- The COM static store, part 4: Aggregating into a single object
- The COM static store, part 3: Avoiding creation of an expensive temporary when setting a singleton
- The COM static store, part 2: Race conditions in setting a singleton
- The COM static store, part 1: Introduction
- How do I get a foothold in the neutral apartment?
- Usage patterns for winrt::unbox_value_or
- Why is there no useful information in the RetailInfo class?
- A metric that is consistently at 100% is probably broken
- Why am I being told my fire_and_forget coroutine is not returning a value?
January 2021
- Autoscrolling on drag, part 5: Adding wiggle-to-scroll to escape velocity
- Autoscrolling on drag, part 4: Dynamic autoscroll based on escape velocity
- Autoscrolling on drag, part 3: Dynamic autoscroll based on mouse position
- Autoscrolling on drag, part 2: Why does scrolling go faster if I wiggle the mouse?
- Autoscrolling on drag, part 1: Basic implementation
- How do I protect myself against a COM call that can hang? I’m already running the server out-of-process.
- What happens to the value returned from the function passed to QueueUserWorkItem?
- How do I disassociate a thread from an I/O completion port?
- Why did I lose 3D display mode when I upgraded to the next version of Windows 10?
- How can I prevent another program from showing a thumbnail preview in the taskbar?
- The perils of the accidental C++ conversion constructor
- How can I write a C++ class that iterates over its base classes?
- The misleading MIDL error message: MIDL5023: The arguments to the parameterized interface are not valid
- Why am I receiving SHCNE_UPDATEDIR notifications that my code never generates?
- How did I find the old Windows binaries and compilers for the processor retrospective series?
- The case of the crash during the release of an object from an unloaded DLL during apartment rundown
- What happens if I give contradictory values for the stack commit and stack reserve?
- How can I tell whether my process is running as SYSTEM?
- Additional helpful pseudo-handles: The process token, the thread token, and the effective token
- How can I write a program that monitors another window for a change in size or position?
- I’d like an IUnknown, I know you have many, I’ll take any of them
2020 267
December 2020
- How can I create a non-circular tab order, or some other type of custom ordering in my Win32 dialog?
- Why are the C and C++ compilers giving me error messages about int when my code doesn’t mention int?
- What are these duplicate services whose names differ just by random characters at the end?
- Why is the HSHELL_WINDOWDESTROYED notification raised when a window is hidden, even if it hasn’t been destroyed?
- How can I emulate the REG_NOTIFY_THREAD_AGNOSTIC flag on systems that don’t support it? part 5
- How can I emulate the REG_NOTIFY_THREAD_AGNOSTIC flag on systems that don’t support it? part 4
- How can I emulate the REG_NOTIFY_THREAD_AGNOSTIC flag on systems that don’t support it? part 3
- How can I emulate the REG_NOTIFY_THREAD_AGNOSTIC flag on systems that don’t support it? part 2
- How can I emulate the REG_NOTIFY_THREAD_AGNOSTIC flag on systems that don’t support it? part 1
- What should the state of a moved-from object be?
- On the ways of finding a dispatcher for the current thread in the Windows Runtime
- Why does PF_VIRT_FIRMWARE_ENABLED return false even when virtualization is enabled in the firmware?
- Lost Windows feature: The Horizon
- How do I avoid race conditions in WaitOnAddress where the wake happens before I enter the blocking state?
- Parsing ETL traces yourself, part 3: The TraceProcessor
- Parsing ETL traces yourself, part 2: The EventLogReader
- Parsing ETL traces yourself, part 1: wpaexporter
- How did Windows open a portal to another dimension when reporting a program error?
- Why does CreateWindowEx take the extended style parameter as its first parameter instead of its last?
- The humor hiding behind “JavaScript error: Semicolon expected”
- Additional notes on the various patterns for passing C-style arrays across the Windows Runtime boundary
- How can I check whether the user has disconnected from the session?
- Did Windows ever find solutions for programs that crashed?
November 2020
- What are the requirements for the built-in Windows 10 camera-based barcode scanner?
- Disk and File I/O performance with ETW traces: Miscellany
- Disk and File I/O performance with ETW traces: Why is System doing so much stuff?
- Preliminary notes on analyzing Disk and File I/O performance with ETW traces
- Why does the disk optimizer put boot files at low-numbered sectors?
- Virtual desktops are an end-user window management feature, not a programmatic one
- How thread-safe is the Windows Runtime PropertySet object?
- Other uses for the -library flag of the C++/WinRT compiler
- On combining static libraries that implement C++/WinRT activatable objects
- One senior executive’s warning about escalating conflicts to upper management
- Why does my command line redirection echo with an extra 1? Who’s inserting these rogue 1s everywhere?
- The history of the EncodePointer function for obfuscating pointers
- Destructing outside the lock when removing items from C++ standard containers
- My strategy for playing Settlers of Catan
- The hidden callout: The destructor
- The prank cursor that resulted in an employee being fired before they even started
- Why aren’t my custom backgrounds, animations, and colors working, such as ApplicationViewTitleBar colors?
- How do I save a C++/WinRT array_view as a com_array?
- What’s the point of APTTYPE_CURRENT? I mean, of course I’m current.
- What is the format of the data in the AudioBuffer memory buffer, and how do I convert it to something else?
- The Settings app lets me pick a custom color for my mouse pointer, how do I get in on that action?
- How can I ask the networking stack whether the system has obtained network connectivity?
October 2020
- Why am I getting an access violation trying to access a method on my C++/WinRT object?
- Do any Windows Runtime projections cache nondefault Windows Runtime interfaces?
- Windows Runtime objects are represented by their default interface, so choose your default interface wisely
- The BurgerMaster segment may have been legendary, but some legends aren’t true
- I told the Microsoft Visual C++ compiler not to generate AVX instructions, but it did it anyway!
- How can I tell whether a file is on an SSD?
- Taking a shortcut: You can query properties from a volume, and it will forward to the physical drive
- How do I get from a volume to the physical disk that holds it?
- How do I get from a file path to the volume that holds it?
- Mount points, volumes, and physical drives, oh my!
- Structured binding in C++/WinRT: The key-value pair
- How to add C++ structured binding support to your own types
- A brief introduction to C++ structured binding
- Just for fun: Retail demo user names in Windows 10
- In 1979, some software company in Bellevue was hiring
- 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
- An iterable of iterables: C# collections support covariance, but C++ collections do not
- Error C3867: non-standard syntax; use ‘&’ to create a pointer to member: What it means and how to fix it
- How to plug in your USB Type A connector correctly the first time
- How can I bulk-revert a subdirectory of a repo to an earlier commit?
- Little gotcha with C++/WinRT iterators: The case of the mutated temporary
- Bonus operations for C++/WinRT iterators: The IIterable<T>, and C++/WinRT collections
September 2020
- Bonus operations for C++/WinRT iterators: The IIterator<T>
- How did we end up parsing Savvyday 29 Oatmeal 94 as Saturday 29 October 1994?
- git commit-tree parlor tricks, Part 9: How can I bulk-revert an entire repo to an earlier commit?
- Structured binding may be the new hotness, but we’ll always have std::tie
- Inside C++/WinRT: How does C++/WinRT represent ABI types?
- How to get your C++/WinRT asynchronous operations to respond more quickly to cancellation, part 3
- Why does the Disk Cleanup tool’s Windows Update Cleanup take so long and consume so much CPU?
- Git commit-tree parlor tricks, Part 8: I just rebased my branch, but now I realize that I should have merged
- I get a weird error about no matching function when I try to use winrt::capture
- The C++/WinRT “capture” function helps you interoperate with the COM ABI world
- Why did I lose the ability to co_await a std::future and concurrency::task?
- Embarrassing product names averted: Windows Embedded POS and Windows 10 for Advanced PCs
- What’s up with error C4838: a WinRT type cannot be a member of a union, and how can I work around it?
- The macros for declaring COM interfaces, revisited: C++ implementation
- The macros for declaring COM interfaces, revisited: C++ version
- The macros for declaring COM interfaces, revisited: C version
- How is it possible to jam a virtual card reader?
- This is definitely rare: It happens only ten times a month
- C++/WinRT injects additional constructors into each runtime class
- Rough edges in the when_all coroutine, part 2: Overloaded comma operator
- Rough edges in the when_all coroutine, part 1: Empty parameter list
- Synthesizing a when_all coroutine from pieces you already have
- More on trivial functions like CopyRect and EqualRect
August 2020
- Is there a code page that matches ASCII and can round trip arbitrary bytes through Unicode?
- How do I convert from the C++/WinRT projection type to the C++/WinRT implementation type?
- How do I convert from the C++/WinRT implementation type to the C++/WinRT projection type?
- Why are some system functions exported as stubs instead as forwarders?
- That time Bill Gates went through a McDonalds drive-through with no cash
- How can I get the number of processors in the system, when there are more than 64?
- Recognizing different types of exception objects that Windows platform libraries can throw
- Inside the Microsoft STL: The std::exception_ptr
- On using FILE_FLAG_WRITE_THROUGH and FILE_FLAG_NO_BUFFERING for memory-mapped files
- What are the possible Status values for Win32_ComputerSystem?
- How WRL squeezes a weak reference and a reference count into a single integer
- The case of Explorer calling into an unloaded DLL while trying to run down a reference to it
- Working around the requirement that Concurrency Runtime task results must be default-constructible and copyable
- Hidden constraints on the result type in Concurrency Runtime tasks
- Microspeak: Placemat
- How can I tell whether the user has disabled toast notifications for my app?
- How do I make my accelerators apply only when used in the main window and not when the user is using a modeless dialog?
- What was so horrible about the FORMAT_MESSAGE_ALLOCATE_BUFFER flag that the Windows Store disallowed it for so long?
- What does it mean when it says that FORMAT_MESSAGE_ALLOCATE_BUFFER can be used in Store apps starting in Windows 10?
- How can CharUpper and CharLower guarantee that the uppercase version of a string is the same length as the lowercase version?
- Peeking inside the implementation of AnsiUpper and AnsiLower in Windows 1.0
July 2020
- What does the /ALTERNATENAME linker switch do?
- What’s the deal with OLDNAMES.LIB?
- C++/WinRT gotcha: Setting properties incorrectly
- A look back at memory models in 16-bit MS-DOS
- How do I set multiple items to a Windows Runtime vector in a single call?
- C++/WinRT doesn’t let your coroutine cheat death, but it does get to say good-bye
- How to get your C++/WinRT asynchronous operations to respond more quickly to cancellation, part 2
- How to get your C++/WinRT asynchronous operations to respond more quickly to cancellation, part 1
- Deconstructing function pointers in a C++ template, returning to enable_if
- Deconstructing function pointers in a C++ template, addressing the calling convention conundrum
- Deconstructing function pointers in a C++ template, trying to address the calling convention conundrum
- Deconstructing function pointers in a C++ template, the calling convention conundrum
- Deconstructing function pointers in a C++ template, vexing variadics
- Deconstructing function pointers in a C++ template, the noexcept complication
- Deconstructing function pointers in a C++ template
- Cancelling a Windows Runtime asynchronous operation, part 8: C++/WinRT, revised
- Cancelling a Windows Runtime asynchronous operation, part 7: WRL-generated asynchronous operations
- Cancelling a Windows Runtime asynchronous operation, part 6: C++/WinRT-generated asynchronous operations
- Cancelling a Windows Runtime asynchronous operation, part 5: C++/WinRT
- Cancelling a Windows Runtime asynchronous operation, part 4: C++/CX with PPL, coroutine style with raw IAsyncAction and IAsyncOperation
- Cancelling a Windows Runtime asynchronous operation, part 3: C++/CX with PPL, coroutine style
- Cancelling a Windows Runtime asynchronous operation, part 2: C++/CX with PPL, explicit continuation style
- Cancelling a Windows Runtime asynchronous operation, part 1: C#
June 2020
- 2020 mid-year link clearance
- Mundane std::tuple tricks: Finding a type in a tuple
- Mundane std::tuple tricks: Creating more interesting index sequences
- Mundane std::tuple tricks: Creating interesting index sequences
- Mundane std::tuple tricks: Selecting via an index sequence, part 2
- Mundane std::tuple tricks: Selecting via an index sequence
- Mundane std::tuple tricks: Getting started
- Understanding warning C4265: class has virtual functions, but destructor is not virtual, part 2
- Understanding warning C4265: class has virtual functions, but destructor is not virtual, part 1
- Blaming the operating system for allowing people to create files with unusual characters in their names
- Excuse me, has anybody seen the FOCAL interpreter?
- 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
- Using fibers to expand a thread’s stack at runtime, part 6
- Using fibers to expand a thread’s stack at runtime, part 5
- Determining approximately how much stack space is available, part 2
- Determining approximately how much stack space is available, part 1
- Comparing fibers to threads for the purpose of expanding a thread’s stack at runtime
- Using fibers to expand a thread’s stack at runtime, part 4
- Using fibers to expand a thread’s stack at runtime, part 3
- Using fibers to expand a thread’s stack at runtime, part 2
- Using fibers to expand a thread’s stack at runtime, part 1
- How can I expand my thread’s stack at runtime?
May 2020
- Hiding C++ template parameter packs in a tuple
- Template metaprogramming trick: Get the compiler to tell you what type you have
- The SetClientGuid method of the common file and folder dialogs lets you give names to those dialogs, too
- When programs assume that the system will never change, episode 1, redux
- The SettingsIdentifier property of the various file pickers lets you give names to your pickers
- On the various ways of constructing a C++/WinRT com_array
- A noinline inline function? What sorcery is this?
- The case of the SHGetFolderPath(CSIDL_ COMMON_ DOCUMENTS) that returned ERROR_ PATH_ NOT_ FOUND
- How can I view my devices based on how they are connected to each other?
- Reporting on what you could do once you get to the other side of the airtight hatchway
- Storing a non-capturing lambda in a generic object
- Inside std::function , part 2: Storage optimization
- Inside std::function , part 1: The basic idea
- When you start getting in-page errors on your hard drive, it’s time to go shopping for a new hard drive, redux
- Peeking inside WRL weak references
- The C++ preprocessor doesn’t understand anything about C++, and certainly not templates
- Why does RegNotifyChangeKeyValue stop notifying once the key is deleted?
- How can I prevent the user from using Snip and Sketch to take screen shots?
- Why did the message on the Start menu change from Start to Ship It! for one build?
- Peeking inside C++/CX weak references
- Diagnosing a hang: Everybody stuck in WinHttpGetProxyForUrl
April 2020
- COM in-process DLL unloaded while trying to clean up from the destruction of the last object
- How can I detect that the system is no longer showing a UAC prompt?
- When you set Windows 10 to allow only Windows Store apps, it allows them to be installed by anyone, not just the Store app
- The paradoxical sense of relief when instructions to solve the problem fail at the first step
- How do I use C++/WinRT to implement a classic COM interface that derives from another classic COM interface?
- Why does the value of my XAML Slider change when I updated its range?
- What kind of apartment is the private apartment I created via CLSID_ ContextSwitcher ?
- Virtual desktops are a window management feature, not a performance feature
- It rather involved being on the other side of this airtight hatchway: Planting files onto a custom PATH
- What will be placed in the output parameter if the function fails?
- Why can’t you return an IAsyncAction from a coroutine that also does a co_await ?
- When I ask the GetIpAddrTable function to sort the results, how are they sorted?
- If one program blocks shutdown, then all programs block shutdown
- The type-dependent type or value that is independent of the type
- Creating a non-agile delegate in C++/WinRT, part 5: Waiting synchronously from a thread that may already be the right thread
- Creating a non-agile delegate in C++/WinRT, part 4: Waiting synchronously from a background thread
- Creating a non-agile delegate in C++/WinRT, part 3: The other cases and why they aren’t interesting
- Creating a non-agile delegate in C++/WinRT, part 2: The synchronous coroutine
- Creating a non-agile delegate in C++/WinRT, part 1: Initial plunge
- An observation about what people used iPads for in the early days
- Error compiling C++/WinRT runtime class: function does not take N arguments
- Pulling sleight of hand tricks in a security vulnerability report, or maybe it was a prank
March 2020
- Why am I ignoring my second monitor? A case study in working from home.
- A sneaky way to make sure nobody assigns test failures to your team
- Are Windows Runtime asynchronous operations guaranteed to complete?
- If you say that your minimum requirements are the Universal contract, then you need to probe for anything beyond that
- How can I check whether a Windows Runtime object supports a member before I try to use it?
- Accessing a member of a Windows Runtime class raises an InvalidCastException / throws a hresult_ no_ interface , what does this mean?
- Why not just share a single event across all critical section?
- The security check happens at the acquisition of the handle
- Further refinements to the attempt to create a type-dependent expression that is always false
- It rather involved being on the other side of this airtight hatchway: Booting into another operating system
- We called it RAID because it kills bugs dead
- The Windows Runtime IDL compiler lets you abbreviate some interface names
- Providing a better error message when someone tries to use std::vector<bool> as a buffer
- Of what use is a type-dependent expression that is always false?
- How can I create a type-dependent expression that is always false?
- The sad but short story of the SM_AccessoriesName registry value
- Why does MS-DOS put an int 20h at byte 0 of the COM file program segment?
- Why do people take a lock around CreateProcess calls?
- Can I wait for a kernel event to become unsignaled ?
- Meet me here on Savvyday 29 Oatmeal 94
- The only thing preventing them from going home was two AA batteries
- How can I detect that my window has been suppressed from the screen by the shell?
February 2020
- Should there be a standard C++ pattern for this? transform_to
- How to save a lot of money on cable car tickets in San Francisco
- How can I configure my Windows NT service to autostart when the system gains Internet access?
- What’s up with the CF_SYLK and CF_DIF clipboard formats?
- The custom-made computers powered by pepperoni pizza
- The 2020/2021 Seattle Symphony subscription season at a glance
- Why are there trivial functions like CopyRect and EqualRect ?
- Why you might need additional control over the secret event hiding inside the file object
- If you’re not keeping the parameter, then you still want to have separate T const& and T&& overloads
- If you plan on keeping the parameter anyway, then there’s no need to have separate T const& and T&& overloads
- Microspeak: Click stop
- Gotcha: A threadpool periodic timer will not wait for the previous tick to complete
- Quality updates: Consequences for rogue-patched binaries
- Survey of Windows update formats: The Quality update, which obsoletes all the others
- Survey of Windows update formats: The Express update
- Survey of Windows update formats: The Delta update
- Survey of Windows update formats: The Full update
- Psychic debugging: Why does my app sometimes fail to change the display settings?
- Why does my C++/WinRT project get errors of the form “ abi<…>::… is abstract see reference to producer<…> “?
- The various patterns for passing C-style arrays across the Windows Runtime ABI boundary
- The legend of the library that caused Building 4 to sink
- It rather involved being on the other side of this airtight hatchway: Disclosure of information you already had access to
January 2020
- The XAML hat rule: Understanding how it works and why it doesn’t
- Why am I getting an exception from the thread pool during process shutdown?
- Crashing in COM after I call CoUninitialize , how can COM be running after it is uninitalized?
- You might call it a “cross”, but I’m still going to call it an “X”
- How do you pronounce WinDbg?
- Is there a difference between creating a null pen with CreatePen and just using the stock null pen?
- Peeking inside C++/CX delegates
- Windows Runtime delegates and object lifetime in C++/CX, redux
- Not even getting to the airtight hatchway: Creating a process with a different parent
- Microspeak: Bucket bugs, bucket spray, bug spray, and failure shift
- Can shrinking a std::string throw an exception?
- 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?
- How can I handle both structured exceptions and C++ exceptions potentially coming from the same source?
- Why can’t I use SHSetKnownFolderPath to change the location of FOLDERID_LocalAppData ?
- The historical significance of the Burgermaster drive-in restaurant
- 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
- Over-documenting TTM_RELAYEVENT and why it results in a one-second periodic timer running as long as the tooltip is visible
- Tree-walking algorithms: Incrementally performing an inorder walk of a binary tree
- Tree-walking algorithms: Incrementally performing a postorder walk of an N-ary tree
- Tree-walking algorithms: Incrementally performing a preorder walk of an N-ary tree
- Tree-walking algorithms: Incrementally enumerating leaf nodes of an N-ary tree
- Anybody who writes #pragma pack(1) may as well just wear a sign on their forehead that says “I hate RISC”
- Why doesn’t RegSetKeySecurity propagate inheritable ACEs, but SetSecurityInfo does?
- Nasty gotcha: Positioning your window beneath a topmost window makes it topmost
2019 292
December 2019
- 2019 year-end link clearance: The different kinds of DLL planting
- How do I make a clone of a Windows Runtime vector in C++/CX?
- Controversial extension methods: CastTo<T> and As<T>
- C++ coroutines: The problem of the DispatcherQueue task that runs too soon, part 4
- C++ coroutines: The problem of the DispatcherQueue task that runs too soon, part 3
- C++ coroutines: The problem of the DispatcherQueue task that runs too soon, part 2
- C++ coroutines: The problem of the DispatcherQueue task that runs too soon, part 1
- C++ coroutines: The problem of the synchronous apartment-changing callback
- C++ coroutines: The co_await operator and the function search algorithm
- C++ coroutines: Defining the co_await operator
- C++ coroutines: no callable ‘await_resume’ function found for type
- C++ coroutines: Short-circuiting suspension, part 2
- C++ coroutines: Short-circuiting suspension, part 1
- C++ coroutines: Awaiting an IAsyncAction without preserving thread context
- C++ coroutines: Framework interop
- C++ coroutines: Constructible awaitable or function returning awaitable?
- C++ coroutines: Getting started with awaitable objects
- In C++/WinRT, what happens when I treat an IInspectable as or convert one to a bool
- In C++/CX, hat pointers are contextually convertible to bool , but you can’t always static_cast them to bool
- Not actually crossing the airtight hatchway: Harmless out-of-bounds read that is never disclosed
- The automotive emergency kit is not a toy
- When should I use delayed-marshaling when creating an agile reference?
November 2019
- My summer vacation: The Tower of London and Kensington Palace
- Using contexts to return to a COM apartment later
- How do you get into a context via IContextCallback:: ContextCallback ?
- Setting up private COM contexts to allow yourself to unload cleanly
- 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
- A slightly less brief introduction to COM apartments (but it’s still brief)
- My summer vacation: Speaking German (wait, what?)
- How do I make a clone of a Windows Runtime vector in C++/WinRT?
- Why does the Alpha AXP predict a coroutine transfer the way it does?
- The case of the UuidCreateSequential that didn’t use the MAC address
- The Magical Excel 97 Far East Language Build Screwdriver™
- I set the same ACL with the GUI and with icacls , yet the results are different
- My summer vacation: The London Eye
- Why does my single-threaded program have multiple threads?
- Can the MTA thread exit while keeping its COM class registrations alive?
- Not even getting to the airtight hatchway: Planting files in world-writable directories
- How can I copy or move a group of files into a new folder from Explorer?
- The curious pattern of pre-emptively rejecting the solution to your problem: Redrawing during resizing
- Can I force a WM_ TIMER message to be generated when the timer comes due, even if the message queue is not idle?
- How can I give a C++ lambda expression more than one operator() ?
- How can I have a C++ function that returns different types depending on what the caller wants?
- The legend of Steve Ballmer’s rental car, the most diligent employee in the world
- I tried to adjust the time on my alarm clock. I failed.
- What happened if you tried to access a network file bigger than 2GB from MS-DOS?
- 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?
October 2019
- For one internal build, Windows 95 contained an evil message
- The program “G” is preventing you from shutting down
- If you suppress GDI+ background thread, then you are expected to pump messages yourself
- Did you hear that story about Bill Gates?: A PR person’s view
- Why does FormatMessage say that %0 terminates the message without a trailing newline? Is it secretly adding newlines?
- If you want to terminate on an unexpected exception, then don’t sniff at every exception; just let the process terminate
- Why can’t I create a “Please wait” dialog from a background thread to inform the user that the main UI thread is busy?
- What’s the difference between the hotkeys F6 and Alt + F6 ?
- When I tell the file or folder picker that I want only file system files and folders, why does it still show virtual folders?
- C++/WinRT implementation extension points: abi_guard , abi_enter , abi_exit , and final_release
- By Grabthar’s Hammer, it’s a Galaxy Quest documentary
- How can I make a call into an elevated service without requiring an elevation prompt?
- Why do I get a winrt::hresult_no_interface exception when I try to register an auto-revoke event handler?
- How should I create controls on my dialog box that has a tab control?
- Rugby: The rules for the casual viewer
- A common mistake when you try to create a C++ class that wraps a window procedure: Saving the window handle too late
- Fibers aren’t useful for much any more; there’s just one corner of it that remains useful for a reason unrelated to fibers
- My summer vacation: London public transportation
- 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?
- Kabaddi: The rules for the casual viewer
- A window can’t have two timers with the same ID, so how do I assign an ID that nobody else is using?
- Auctioning off the privilege of initiating the destruction of the Microsoft old campus
- Why does my string consist of this Korean character repeated over and over?
- My summer vacation: The Changing of the Guard at Buckingham Palace
- How do I define a UWP XAML dependency property that is a collection type?
- Odd things you find when you read the airplane safety information card
- What if I want the default value for a XAML dependency property to be a mutable object?
- My summer vacation: Watching a German movie on the plane and learning some language history
- The default value for a XAML dependency property should be immutable
- Reminiscences on 5.25″ floppy drives of the early 1980’s
September 2019
- Where did DirectX code names come from?
- My summer vacation: Paris public transportation
- Why does the compiler refuse to let me export my class? If I don’t export it, then the class works fine.
- My summer vacation: Versailles
- Why does std::is_copy_constructible report that a vector of move-only objects is copy constructible?
- My summer vacation: The Louvre Museum
- How do I create a Windows Runtime method that accepts a lambda?
- How did MS-DOS decide that two seconds was the amount of time to keep the floppy disk cache valid?
- Stop cherry-picking, start merging, Part 11: Chasing the commit by taking a train
- Why perform all these complex git machinations when you can just tweak the command line to get what you want?
- How to duplicate a file while preserving git line history
- How to split out pieces of a file while preserving git line history: The easy way with misleading commits
- How to split out pieces of a file while preserving git line history: The hard way with commit-tree
- How do I split a file into two while preserving git line history?
- My summer vacation: The Eiffel Tower
- Another way to sort GUIDs: Java
- The Turkish lira’s currency code is an unexpected source of problems with computer programmers
- The sad history of the MFC TRY / CATCH macros
- Trying to wrangle a site visit to Paul Allen’s superyacht “Octopus”
- PowerShell programming puzzle: Convert snake_case to PascalCase in one line
- It rather involved being on the other side of this airtight hatchway: Guessing window procedure magic cookies
- Making the COM_ INTERFACE_ ENTRY macro better at detecting misuse
- The COM_ INTERFACE_ ENTRY must be a COM interface, but nobody actually checks
- Any sufficiently advanced technology is indistinguishable from a bomb
- Silly Alexa trick: Speaking French with a horrible American accent
- If FlushInstructionCache doesn’t do anything, why do you have to call it, revisited
August 2019
- The sad history of Unicode printf-style format specifiers in Visual C++
- What to do if you can’t get the stovetop in your London apartment to turn on
- On resolving the type vs member conflict in C++, revisited
- The sad history of Visual Studio’s custom __if_exists keyword
- One byte used to cost a dollar
- Custom-printing your own attendee pass to the Windows 95 launch
- The SuperH-3, part 15: Code walkthough
- The SuperH-3, part 14: Patterns for function calls
- The SuperH-3, part 13: Misaligned data, and converting between signed vs unsigned values
- The SuperH-3, part 12: Calling convention and function prologues/epilogues
- The SuperH-3, part 11: Atomic operations
- The SuperH-3, part 10: Control transfer
- Why is there a huge spike in cruise ship width at 32 meters?
- The SuperH-3, part 9: Constants
- The SuperH-3, part 8: Bit shifting
- The SuperH-3, part 7: Bitwise logical operations
- The SuperH-3, part 6: Division
- The SuperH-3, part 5: Multiplication
- The SuperH-3, part 4: Basic arithmetic
- How do I fill out the Canadian eTA if I have a green card with no expiration date?
- The SuperH-3, part 3: Status flags and miscellaneous instructions
- The SuperH-3, part 2: Addressing modes
- The SuperH-3, part 1: Introduction
- How can I extract the color from a solid color GDI brush?
- Not actually crossing the airtight hatchway: Applying per-user overrides
July 2019
- What about USERSEEUSERDO and GDISEEGDIDO?
- Why doesn’t the Programs and Features control panel show Last Used On information?
- Is it a good idea to let WriteProcessMemory manage the page protection for me?
- When it absolutely, positively has to be there for the product demo overnight
- Why do pinned apps sometimes go to the end of the taskbar, rather than going into the “pinned apps” section of the taskbar?
- Adventures in application compatibility: Calling an internal function
- How can I log users off after a period of inactivity, rather than merely locking the workstation? Is there a “logoff” screen saver?
- What was the code name for Windows 7?
- Providing a small amount of additional control over what happens when an asynchronous I/O completes synchronously
- Brännboll: The rules for the casual viewer
- After I made my DLL delay-load another DLL, my DLL has started crashing in its process detach code
- Apollo 11 in real time: Follow the lunar landing mission as it happened
- Windows NT services are assigned a SID based on an SHA-1 hash, but what about the risk of collision?
- That time Dana Carvey went off script at the Microsoft Company Meeting
- Cricket: The practical exam for 2019
- My initial confusion when encountering functions whose names begin with Co
- Detecting in C++ whether a type is defined, part 5: Augmenting the basic pattern
- Pesäpallo: The rules for the casual viewer
- Detecting in C++ whether a type is defined, part 4: Predeclaring things you want to probe
- Detecting in C++ whether a type is defined, part 3: SFINAE and incomplete types
- Detecting in C++ whether a type is defined, part 2: Giving it a special name
- A difference between cricket and baseball that most people don’t mention
- Detecting in C++ whether a type is defined, part 1: The initial plunge
- I set the OFN_NONETWORKBUTTON option in the OPENFILENAME structure, but it has no effect on the network item in the navigation pane
- Baseball: The rules for the casual viewer
- Generating good error messages from code analysis tools is harder than it looks
- Why does my attempt to index a collection with the x:Bind markup extension keep telling me I have an invalid binding path due to an unexpected array indexer?
- Cricket: The rules for the casual viewer
- Microspeak: Ingestion
- A program to detect mojibake that results from a UTF-8-encoded file being misinterpreted as code page 1252
June 2019
- 2019 mid-year link clearance
- Why does the GetVersion function report the major version in the low-order byte, and the minor version in the high-order byte?
- Why does Windows list my SSD system drive as removable?
- Why was Windows for Workgroups pejoratively nicknamed Windows for Warehouses?
- Detecting whether the -opt flag was passed to cppwinrt.exe : Using __has_include
- The 2019 Microsoft Giving Campaign Run/Walk comes with some ground rules
- Getting a value from a std::variant that matches the type fetched from another variant
- How do I write a function that accepts any type of standard container?
- What is WofCompressedData? Does WOF mean that Windows is a dog?
- A simple workaround for the fact that std::equal takes its predicate by value
- Why does SetFocus fail without telling me why?
- 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?
- If you can use GUIDs to reference files, why not use them to remember “recently used” files so they can survive renames and moves?
- What order do the items in the “New” menu appear? It looks kind of random.
- How can I determine in a C++ header file whether C++/CX is enabled? How about C++/WinRT?
- The Resource Compiler defaults to CP_ACP, even in the face of subtle hints that the file is UTF-8
- Why does my C++/WinRT project get errors of the form "Unresolved external symbol void* __cdecl winrt_ make_ YourNamespace_ YourClass(void) "?
- Why does my C++/WinRT project get errors of the form ‘ winrt:: impl:: produce<D, I> ‘: cannot instantiate abstract class, missing method GetBindingConnector
- In the file copy conflict dialog, what happened to the option to copy the new file with a numeric suffix?
- A bug so cool that the development team was reluctant to fix it
May 2019
- I called AdjustTokenPrivileges, but I was still told that a necessary privilege was not held
- Why does my C++/WinRT project get errors of the form “consume_Something: function that returns ‘auto’ cannot be used before it is defined”?
- Why does my C++/WinRT project get errors of the form “unresolved external symbol … consume_Something”?
- In times of uncertainty, take your cue from the janitor
- Why does Explorer’s New menu take so long to appear the first time I open it?
- Programming puzzle: Creating a map of command handlers given only the function pointer
- Windows Runtime delegates and object lifetime in C++/WinRT
- Windows Runtime delegates and object lifetime in C++/CX
- Windows Runtime delegates and object lifetime in C# and other GC languages
- The secret signal that tells Windows Runtime events that the event recipient no longer exists
- If each thread’s TEB is referenced by the fs selector, does that mean that the 80386 is limited to 1024 threads?
- When would CopyFile succeed but produce a file filled with zeroes?
- Why are Bluetooth functions exported from the infrared control panel?
- Mundane git commit-tree tricks, Part 7: Combining more than two files into one while preserving line history, manual octopus merging
- Mundane git tricks: Combining two files into one while preserving line history
- Mundane git commit-tree tricks, Part 6: Resetting by reusing an earlier tree
- Mundane git commit-tree tricks, Part 5: Squashing without git rebase
- Mundane git commit-tree tricks, Part 4: Changing a squash to a merge
- Mundane git commit-tree tricks, Part 3: Building a throwaway commit in order to perform a combined cherry-pick-squash
- Mundane git commit-tree tricks, Part 2: Building a merge commit manually out of a tree
- Mundane git commit-tree tricks, Part 1: Building a commit manually out of a tree
- Async-Async: Consequences for exceptions
- Async-Async: Consequences for ordering of multiple calls in flight simultaneously
- Async-Async: Consequences for parameters to parallel asynchronous calls
April 2019
- Async-Async: Reducing the chattiness of cross-thread asynchronous operations
- Spotting problems with destructors for C++ temporaries
- How many ways are there to sort GUIDs? How much time do you have?
- How can I launch an unelevated process from my elevated process, redux
- The administrative assistant who lasted only one day: A legendary prank from days of yore
- Why was Texas Hold ‘Em Poker a Windows Ultimate Extra instead of a built-in game?
- A little program to look for files with inconsistent line endings
- On resolving the type vs member conflict in C++: The Color Color problem
- How arbitrary is the ArbitraryUserPointer in the TEB?
- What does this strange value for “Percent CPU” mean in Performance Monitor?
- Microspeak: Occupant compression
- Today is tax day, but it’s also division meeting day, so let’s get you some forms to fill out
- How can a desktop app use a Windows Runtime object that infers UI context from its thread? The IInitializeWithWindow pattern
- How can I determine the reason why my window is closing?
- Even if you open a file with GUID, you can still get its name, or at least one of its names
- When I select multiple files in the File Open dialog, why does the last item come first?
- Optimizing your cafeteria meal card stockpile
- What does it mean when my attempt to stop a Windows NT service fails with ERROR_BROKEN_PIPE?
- Why do we need atomic operations on the 80386, if it doesn’t support symmetric multiprocessing anyway?
- Dubious security vulnerability: Code execution via LNK file
- On the bogosity of speculation: Guessing the price of the original Surface
- Oh no, it’s inspection time again
March 2019
- C++/WinRT envy: Bringing thread switching tasks to C# (WPF and WinForms edition)
- C++/WinRT envy: Bringing thread switching tasks to C# (UWP edition)
- How do I wait for the completion of the delegate I passed to CoreDispatcher. RunAsync and ThreadPool. RunAsync ?
- When do CoreDispatcher. RunAsync and ThreadPool. RunAsync actions complete?
- What does the N in nmake stand for?
- Vintage Computer Festival Pacific Northwest 2019
- Turning anything into a fire-and-forget coroutine
- Expressing fire-and-forget coroutines more explicitly, -or- How to turn any coroutine into fire-and-forget
- winrt::fire_and_forget was too forgetful
- Why does my app’s uninstaller disappear from the Start menu?
- How do I design a class so that methods must be called in a certain order?
- How can we use IsBadWritePtr to fix a buffer overflow, if IsBadWritePtr is itself bad?
- Resolving security issues sometimes involves its own degree of managing people’s egos
- Welcome to my new home on the Microsoft Developer Tools and Services blog site
- Why is there a limit of 15 shell icon overlays?
- Asking for clear written documentation that “Require trusted path for credential entry” is no longer recommended
- Precision questioning: The cynical description
- Even if your assembly language code doesn’t call any Windows APIs, you still have to follow the ABI
- What order are pages in a memory-mapped file flushed out to disk?
- How do I destruct an object that keeps a reference to itself, because that reference prevents the object from being destructed
- Alternate definitions for English words, as inferred from bug reports
- Predator-prey reversal: Rock lobsters vs whelks on Malgas Island and Marcus Island
- My initial frustration trying to configure our internal VoIP phones that were integrated with instant messaging
- How to compare two packed bitfields without having to unpack each field
February 2019
- How should I report errors from my Windows Runtime API?
- The std::map subscript operator is a convenience, but a potentially dangerous one
- How to draw a nifty text box in your email message
- That time the CEO of a company complained to Congress about Windows file extensions
- The 2019/2020 Seattle Symphony subscription season at a glance
- How do I permit a minus sign to be entered into my edit control, but only if it’s the first character?
- How do I allow negative numbers with the ES_NUMBER edit control style?
- The early history of the ES_NUMBER edit control style
- How do I convert all these strange Unicode digits into the ones I remember from Sesame Street?
- How can I check in Win32 whether a Unicode character is any kind of digit?
- Accidentally creating a choke point for what was supposed to hand work off quickly to a background task, part 3
- Accidentally creating a choke point for what was supposed to hand work off quickly to a background task, part 2
- Accidentally creating a choke point for what was supposed to hand work off quickly to a background task, part 1
- The Intel 80386, part 17: Future developments
- The Intel 80386, part 16: Code walkthrough
- The Intel 80386, part 15: Common compiler-generated code sequences
- The Intel 80386, part 14: Rescuing a stack trace after the debugger gave up when it reached an FPO function
- The Intel 80386, part 13: Calling conventions
- The Intel 80386, part 12: The stuff you don’t need to know
- The Intel 80386, part 11: The TEB
- The Intel 80386, part 10: Atomic operations and memory alignment
January 2019
- The Intel 80386, part 9: Stack frame instructions
- The Intel 80386, part 8: Block operations
- The Intel 80386, part 7: Conditional instructions and control transfer
- The Intel 80386, part 6: Data transfer instructions
- The Intel 80386, part 5: Logical operations
- The Intel 80386, part 4: Arithmetic
- The Intel 80386, part 3: Flags and condition codes
- The Intel 80386, part 2: Memory addressing modes
- The Intel 80386, part 1: Introduction
- How do I get the effect of C#’s async void in a C++ coroutine? Part 3: Simplifying the boilerplate
- How do I get the effect of C#’s async void in a C++ coroutine? Part 2: Keeping track of the lifetimes
- How do I get the effect of C#’s async void in a C++ coroutine? Part 1: Why does the obvious solution crash?
- Don’t pass lambdas (or other multi-line entities) as parameters to macros
- Why would the incremental linker insert padding between section fragments?
- Why do we even need to define a red zone? Can’t I just use my stack for anything?
- Why am I getting mojibake when I try to create a window?
- It rather involved being on the other side of this airtight hatchway: Messing with somebody’s registry
- STATUS_ STACK_ BUFFER_ OVERRUN doesn’t mean that there was a stack buffer overrun
- The GetRegionData function fails if the buffer is allocated on the stack. Is it allergic to stack memory or something?
- A trick for keeping an object alive in a C++ lambda while still being able to use the this keyword to refer to it
- Why am I getting mojibake when I try to create a shell link?
- How can I prevent a WebView control from opening a browser window?
- Why does the elevation prompt have only the wallpaper as its background?
2018 295
December 2018
- 2018 year-end link clearance
- The case of the orphaned critical section despite being managed by an RAII type
- SHOpenRegStream does not mix with smart pointers
- Don’t forget: std::pair does lexicographical ordering, so you don’t have to
- How do I save the results of a file search in Explorer? Not the query itself, but the results
- Random internal Windows terminology: IDW, Razzle, and their forgotten partners IDS and Dazzle
- On the attempts to resurrect Space Cadet Pinball
- In 16-bit Windows, some per-process data structures were really per-data segment
- It rather involved being on the other side of this airtight hatchway: Hanging the loader
- How come Explorer reports higher disk space used on my volume than my third party disk space tool?
- Not getting past the title: This is not the bug you’re looking for
- The case of the mysterious LoadLibrary error message after signing in
- How can I programmatically wait until the taskbar has finished booting completely before I create my notification icon?
- How can I programmatically wait until the system has finished booting completely before doing my own computations?
- Why doesn’t my lock screen image change after I replace the image file?
- When a customer asks for something unsupported, and they promise not to get upset when it stops working, don’t believe them
- The case of the buffer overflow vulnerability that was neither a buffer overflow nor a vulnerability
- Xformer 10: The Atari 800 emulator has gotten a huge update
- How is it that WriteProcessMemory succeeds in writing to read-only memory?
- 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
- The plural of Nexus is Nexūs, in case you cared (which you almost certainly don’t)
- Why can’t I close windows directly from the Alt+Tab interface in Windows Vista?
- Choosing error codes based on a really nice #define doesn’t necessarily lead to a readable message to the user
November 2018
- Why does Clipboard.SetData put extra junk in the clipboard data? And how can I get it to stop?
- Taking advantage of the ordering guarantees of the LINQ GroupBy method
- What happens if I mutate a string in a p/invoke?
- Nifty trick: Combining constructor with collection initializer
- What’s up with Code Analysis rule CA2202: Do not dispose objects multiple times?
- If activation of your gift card lasts more than four hours, consult a physician immediately
- The default number of threads in an I/O completion port is the number of processors, but is that logical or physical processors?
- How can I make a dialog box right-to-left at runtime?
- Trying to allocate the same virtual address in multiple processes
- For a brief period, the kernel tried to deal with gamma rays corrupting the processor cache
- How do I suppress the “Did you mean to switch apps?” warning message from my XAML WebView control?
- The Moncler 1 Pierpaolo Piccioli, your high fashion for the elegant parties that take place in a walk-in freezer
- Closing the race window between creating a suspended process and putting it in a job
- Songs with every other beat removed, how to make your own!
- How do I revert a control back to its default theme?
- What’s the point of passing a never-signaled event to MsgWaitForMultipleObjects?
- Saying good-bye to the original Microsoft Redmond campus
- The case of the System process that consumed a lot of CPU
- Gotchas when using linker sections to arrange data, part 2
- Gotchas when using linker sections to arrange data, part 1
- Using linker segments and __declspec(allocate(…)) to arrange data in a specific order
- Dubious security vulnerability: A program that adds a user to the Administrators group in the usual way
- Sure, you can implement your own cryptographic service provider for a standard algorithm, but why would you?
- Why does the MonthCalendar control show the wrong week numbers in Romania?
- In the state of Washington, you are allowed to turn left on a red light onto a one-way street
- If the prototypes of DispatchMessageA and DispatchMessageW are identical, why have both?
October 2018
- Dulce et decorum est pro patria party
- What happened to the Arial Unicode MS font?
- The case of the oplock deadlock poppycock
- 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
- 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
- Adding a Ctrl+arrow accelerator for moving the trackbar by just one unit, part 2: Second try
- Adding a Ctrl+arrow accelerator for moving the trackbar by just one unit, part 1: Initial plunge
- Why does the Entry Point Not Found error dialog sometimes not include the name of the missing entry point?
- File-extending writes are not always synchronous, which is entirely within the contract
- After reporting a non-responsive program to Windows Error Reporting, why does the process spawn a suspended child process?
- What does the “Ae” stand for in AeDebug?
- 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?
- How can I programmatically inspect and manipulate a registry hive file without mounting it?
- So, um, what are we looking at?
- Why doesn’t GetTextExtentPoint return the correct extent for strings containing tabs?
- How can I include/exclude specific memory blocks in user-mode crash dumps?
- Notes on DrawText and tab stops
- The numerology of the sample directory listing in the Windows 95 font selector property sheet page
- When I call CryptProtectData with the same parameters, why aren’t the results identical?
- How can I use WS_ CLIPCHILDREN and still be able to draw a control with a transparent background?
- Can I be sure that turning on automatic generation of short file names will get me short file names?
- Practical example of why you need to leave room for German localization
- All sorts of bad things happen when we disable the Task Scheduler service, is that bad?
- Generating a table with vertical text, like I did with the sad history of the C++ throw(…) exception specifier
September 2018
- The sad history of the C++ throw(…) exception specifier
- Can you wear wallpaper on your feet? You can if it’s a PARTY.BMP!
- Considering the performance implications of converting recursion to an explicit stack
- What does the thread parameter to SetWindowsHookEx actually mean?
- How do I prevent my program’s temporary documents from appearing in Search?
- Why does the compiler turn my conditional loop into an infinite one?
- Why is regsvr32 exiting with code 3?
- What do the various regsvr32 exit codes mean?
- Why did every Windows 3.0 DLL have an exported function called WEP?
- Why is Alt+F4 the hotkey for closing a window? Why not Alt+F5 or Alt+F3?
- A lack of species sensitivity when serving pizza to guests
- What defines an old-style common dialog?
- Why does the Zune HD have the message “For our Princess” on the inside of the case, and why is she a princess?
- Raising the colon off the ground
- Anything is a soldering kit if you’re brave enough: The MOnSter 6502
- How do I get the system to run my program in this very special way?
- Le Chatelier’s principle in action: Notifications
- How can I conditionally compile based on a preprocessor macro value, while ensuring that the macro is correctly spelled?
- Removing the TerminateThread from a DLL that needs to shut down a helper thread at unload
- What does it mean for a window to be Unicode?
- How do I request that my out-of-process COM server run unelevated?
- Apparently they know more information about me than me, but dare I ask?
- 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
August 2018
- Removing the TerminateThread from code that waits for a job object to empty
- The early history of Windows file attributes, and why there is a gap between System and Directory
- Obsolete Microspeak: TDBN and the six-pack
- The evolution of Windows 8 charms
- How do I force the Task Manager window closed whenever it opens?
- The Windows 95 team were proud slackers
- The PowerPC 600 series, part 14: Code walkthrough
- The PowerPC 600 series, part 13: Common patterns
- The PowerPC 600 series, part 12: Leaf functions
- The PowerPC 600 series, part 11: Glue routines
- The PowerPC 600 series, part 10: Passing parameters, function prologues and epilogues
- The PowerPC 600 series, part 9: The table of contents
- The PowerPC 600 series, part 8: Control transfer
- The PowerPC 600 series, part 7: Atomic memory access and cache coherency
- The PowerPC 600 series, part 6: Memory access
- The PowerPC 600 series, part 5: Rotates and shifts
- The PowerPC 600 series, part 4: Bitwise operations and constants
- The PowerPC 600 series, part 3: Arithmetic
- The PowerPC 600 series, part 2: Condition registers and the integer exception register
- The PowerPC 600 series, part 1: Introduction
- A puzzle aboard the Anacortes-Sidney ferry: How do the cars get off?
- Creating an awaitable lock for WinJS and JavaScript Promises
- Creating an awaitable lock for C++ PPL tasks
- Creating an apartment-aware PPL task from nothing
July 2018
- Server names: One of the remaining places where IT managers can be a little silly
- Dark Pattern: Opt-in above the fold, but opt-out below the fold
- Is the TerminateThread function synchronous?
- What happens to custom unhandled exception filters if a debugger is not running?
- Why are my file write operations synchronous, even though I opened the file as FILE_ FLAG_ OVERLAPPED ?
- Pushing the boundaries of cryptography in a security vulnerability report
- The heavy metal umlaut reaches baked goods
- How do I trigger an EN_UPDATE notification for all of my edit controls when the user’s locale information changes?
- How can I get the actual window procedure address and not a thunk?
- When is it appropriate to use the current processor number as an optimization hint?
- Sure I can protect data with CryptProtectData, but how do I remove the ability to decrypt it?
- What is this vmmem program that is using up all my CPU and memory?
- Internal training video on expense reports contains inconsistency: Alert the media!
- Warning: Ruler is not to scale
- When generating a random password, the result must still be a valid string
- Why does a non-recursive ReadDirectoryChangesW still report files created inside subdirectories?
- Const methods don’t prevent a method from having side effects
- How do I change the password of another user without having to sign in as them?
- Stop merging if you need to cherry-pick
- The case of the very large memory blocks of the same size, mostly zero, but whose nonzero bytes follow a pattern
- How can I detect whether the user is logging off?
- The Windows Calculator no longer generates tiny errors when calculating the square root of a perfect square
- Did you happen to lose something in the Amstel River? Say within the past 500 years?
- How can I determine why the System process is listening on port 80?
- Consider the environment: Do you want a receipt?
June 2018
- 2018 mid-year link clearance
- How can I detect from the preprocessor what a macro’s definition is?
- Lock free many-producer/single-consumer patterns: A work queue of distinct events, order not important, follow-up question
- Taking advantage of the asymmetry of offline compression
- The cost/benefit analysis of comparing before an assignment
- How I learned to type
- What can influence how much stack is consumed when sending a message?
- When I intentionally create a stack overflow with SendMessage , why do I sometimes not get a stack overflow?
- Microspeak: knobs
- Woodworking, the opposite of software development
- Is there a problem with CreateRemoteThread on 64-bit systems?
- How do I programmatically control the order of my program’s notification icons?
- Even though the brand is called One A Day, none of them actually should be taken one a day
- Why does the CREATOR_OWNER SID sometimes reset itself to the object’s current owner rather than its original owner?
- Stupid cmd.exe tricks: Entering a directory that doesn’t exist, then immediately leaving
- Where is the Seattle BoltBus stop?
- Pulling the rug out from under an internet protocol
- Unusual choice of units: 1.8 billion square millimeters
- Why does GetServiceDisplayNameA report a larger required buffer size than actually necessary?
- What is this weird constructory syntax C::C() ?
- The unhandled exception filter is the responsibility of the process; don’t change it without permission
- Stupid cmd.exe tricks: Changing directories with forward slashes instead of backslashes
- Adventures in application compatibility: Following a detour off a cliff
- How can I write a program that monitors another window for a title change?
May 2018
- How can I obtain the heap from which a heap block was allocated?
- When you call OpenThreadToken while impersonating, you have to say who is asking for the thread token
- The alphabet, in alphabetical order, in various languages
- How do I get file version information from the command line?
- How are BitBlt raster opcodes calculated?
- My namespace importing trick imported the same three namespaces into each top-level namespace, yet it worked?
- How do I create a disabled checkbox for a listview item?
- If you say that your buffer can hold 200 characters, then it had better hold 200 characters
- Why does the install date and size of a program change roughly two days after I install it, even though no changes were made to the program in the meantime?
- Maintaining Notepad is not a full-time job, but it’s not an empty job either
- Misdirected security vulnerability: Malformed file results in memory corruption
- How do I create a SAL annotation for a structure with a variable-length array?
- C++ namespace parlor tricks
- Why is Windows Compressed Folders (Zip folders) support stuck at the turn of the century?
- For a brief period, Windows 95 could run Windows 3.1 in a virtual machine
- Why can’t FindWindowEx find another program’s window by name?
- On the difficulty of getting pixel-perfect layout in Win32 dialog templates
- Why does my shortcut to a nonexistent file end up with spaces changed to underscores?
- Microspeak: ZBB, recall class, glide path, and RTM
- After all, it’s called a hotkey, not a hotcharacter
- See you at Build 2018 next week
- Avoiding deadlocks when cancelling a thread pool callback, part 2: Referring back to the containing object
- Avoiding deadlocks when cancelling a thread pool callback, part 1: External callback data
- How to avoid accessing freed memory when canceling a thread pool callback
- Windows 10 virtual desktops are a window management feature, not a security feature
April 2018
- The seasoned pianist’s guide to musical collaborators
- I don’t know how I managed to be presenting at the same conference as Dona Sarkar
- A cute hidden message in a image to entertain you while you wait
- How can I have my program execute some code only if run from the Visual Studio debugger?
- Microspeak: Tented
- It rather involved being on the other side of this airtight hatchway: Passing invalid parameters from kernel mode to another kernel-mode function corrupts the kernel (who knew?)
- The early history of redundant function pointer casts: MakeProcInstance
- The MIPS R4000, part 15: Code walkthrough
- The MIPS R4000, part 14: Common patterns
- The MIPS R4000, part 13: Function prologues and epilogues
- Whoa, that fitness tracker is a really expensive watch
- The MIPS R4000, part 12: Calling convention
- The MIPS R4000, part 11: More on branch delay slots
- The MIPS R4000, part 10: Trampolines and stubs
- The MIPS R4000, part 9: Branch delay slot parlor tricks
- The MIPS R4000, part 8: Control transfer
- The MIPS R4000, part 7: Memory access (atomic)
- The MIPS R4000, part 6: Memory access (unaligned)
- The MIPS R4000, part 5: Memory access (aligned)
- The MIPS R4000, part 4: Constants
- The MIPS R4000, part 3: Multiplication, division, and the temperamental HI and LO registers
- The MIPS R4000, part 2: 32-bit integer calculations
- The MIPS R4000, part 1: Introduction
March 2018
- Why is it cheaper to fly out of Vancouver for spring break instead of Seattle, while also being cheaper to fly out of Seattle for spring break instead of Vancouver?
- How do I choose between the strong and weak versions of compare-exchange?
- Geology throwdown: The whisper of the rocks
- What’s up with compare_ exchange_ weak anyway?
- When I memcpy a struct into a std::atomic of that struct, why does the result not match?
- The WMI root node is just a node in the WMI namespace
- A rare opportunity to fact-check the “celebrity net worth” sites
- What are the odds that two pull requests get completed at the exact same time?
- Stop cherry-picking, start merging: Index
- Stop cherry-picking, start merging, Part 10: Web-based workflow for Azure DevOps (formerly VSTS)
- The mystery of the stalker dental hygienist
- Stop cherry-picking, start merging, Part 9: Chasing the commit
- Stop cherry-picking, start merging, Part 8: How to merge a partial cherry-pick
- Stop cherry-picking, start merging, Part 7: Preventing a change from leaving a branch
- Stop cherry-picking, start merging, Part 6: Replacing the temporary fix with the permanent fix
- Stop cherry-picking, start merging, Part 5: Exploiting the three-way merge
- Stop cherry-picking, start merging, Part 4: Exploiting the recursive merge algorithm
- Stop cherry-picking, start merging, Part 3: Avoiding problems by creating a new merge base
- Stop cherry-picking, start merging, Part 2: The merge conflict that never happened (but should have)
- Stop cherry-picking, start merging, Part 1: The merge conflict
- Torsken har ankommet
- Why is the daylight saving time cutover time 1 millisecond too soon in some time zones?
- What’s the difference between CreateTimerQueueTimer and SetThreadpoolTimer?
- When MSDN says NULL , is it okay to use nullptr ?
- Microspeak: The triad, the ad-hoc acronyms that result, and the arithmetic problem 3 × 3
- Inadvertently designing a horrible time and date picker
- If I call GetExitCodeThread for a thread that I know for sure has exited, why does it still say STILL_ACTIVE?
- How does Task Manager choose the icon to show for a process?
February 2018
- An amusing story about a practical use of the null garbage collector
- It rather involved being on the other side of this airtight hatchway: Replacing an unsigned writable MSI package
- I just met you, and this is crazy, but here’s my callstack. Debug me maybe.
- The 2018/2019 Seattle Symphony subscription season at a glance
- How do I make sure that my shell extension is at the top of the context menu?
- Why does IsPathRelative return FALSE for paths that are drive-relative?
- How can I call freopen but open the file with shared access instead of exclusive access?
- We couldn’t create a new partition or locate an existing one, possible workarounds
- This is a race the display driver wouldn’t normally expect to lose
- So what is a Windows “critical process” anyway?
- Why are there two kinds of Universal Windows apps, one for Windows 8 and another for Windows 10?
- What’s the difference between the zero width non-joiner and the zero width space?
- When Windows copies a file, does it ever copy bytes that are in the slack space?
- There are no bugs in the I/O manager
- Optimizing BitBlt by generating code on the fly
- What do the output values from CoGetApartmentType mean?
- Why does misinterpreting UTF16-LE Unicode text as ANSI tend to show up as just one character?
- Microspeak: POR
- // If this happens, I am going to quit and become a barista
- The case of the SRWLock violation in a thread pool work item
- Spurious wake-ups in Win32 condition variables
January 2018
- How can I get a signature for a Windows system that will remain unchanged even if the user reinstalls Windows?
- Communication by hand signals, and other complex coordination problems
- Why does hypervisor remain enabled even when Hyper-V is disabled in Windows Features?
- Microspeak sighting: over-index
- Well that was a helpful error message
- The saga of Heartland vs. The United States Beet Sugar Association
- How can I reserve a range of address space and create nonzero memory on demand when the program reads or writes a page in the range, even when multithreading?
- Like love, taxes make people do the strangest things
- How can I reserve a range of address space and create nonzero memory on demand when the program reads or writes a page in the range?
- How can I reserve a range of address space and receive notifications when the program first reads or writes a page in the range?
- Microspeak: Impedance mismatch
- The history of change-packing tools at Microsoft (so far)
- A helper template function to wait for a Win32 condition variable in a loop
- Stuff my father-in-law says: On taking the train
- A helper template function to wait for WaitOnAddress in a loop
- Why does HRESULT begin with H when it’s not a handle to anything?
- As far as the French government is concerned, I am the expert on Windows XP
- How do I know that Resource Monitor isnt just retaining a handle to the terminated process?
- Why don’t context menus respect the UI state for keyboard accelerators?
- What does it mean when the documentation says that you must specify the app in the system’s metadata before you can retrieve SmbiosInformation properties?
- Why is there a semicircular bar at the base of the ORCA card reader?
- How do I get the computer’s serial number? Consuming Windows Runtime classes in desktop apps, part 5: PowerShell
- How do I get the computer’s serial number? Consuming Windows Runtime classes in desktop apps, part 4: C#
- How do I get the computer’s serial number? Consuming Windows Runtime classes in desktop apps, part 3: C++/WinRT
- How do I get the computer’s serial number? Consuming Windows Runtime classes in desktop apps, part 2: C++/CX
- How do I get the computer’s serial number? Consuming Windows Runtime classes in desktop apps, part 1: Raw C++
- Why are the module timestamps in Windows 10 so nonsensical?
- What happens when a huge number of people share a single grocery store loyalty card?
- How do I know that Resource Monitor isn’t just retaining a handle to the terminated process?
2017 285
December 2017
- 2017 year-end link clearance
- How does Resource Monitor get information for processes that already terminated?
- Why do I have to pass a valid page protection value to VirtualAlloc even if it ignores it?
- Microspeak: over-index
- Time travel is here, at least when it comes to debugging
- Exposing undefined behavior when trying to port code to another platform
- What’s the difference between VARIANT and VARIANTARG?
- How do I ShellExecute a file, but with a specific program instead of the default program?
- How does Task Manager categorize processes as App, Background Process, or Windows Process?
- On the little-documented role of the page-turner
- What kind of messages can a message-only window receive?
- Creating double-precision integer multiplication with a quad-precision result from single-precision multiplication with a double-precision result using intrinsics (part 3)
- Creating double-precision integer multiplication with a quad-precision result from single-precision multiplication with a double-precision result using intrinsics (part 2)
- Creating double-precision integer multiplication with a quad-precision result from single-precision multiplication with a double-precision result using intrinsics (part 1)
- Why not slipstream ZDP fixes into the bits downloaded by the installer rather than being a separate download?
- Coroutines mean that the thing that looks like a stack variable may not technically be one
- How do I respond to the WM_MENUCHAR message?
- Knowing just enough about debugging IRPs to chase the problem out of the I/O stack
- How can I prevent the keyboard focus rectangle from appearing on a control I created?
- Tree view check boxes: The extended check box states
- Tree view check boxes: A sordid history
- Creating tree view check boxes manually: Themed check boxes
November 2017
- Creating tree view check boxes manually: Responding to clicks
- Creating tree view check boxes manually: A simple state image list
- Beware of the leaked image list when using the TVS_CHECKBOXES style
- The TVS_CHECKBOXES style is quirky, which is a polite way of saying that it is crazy
- Getting a parent and child window to have the same UI states
- Demonstrating what happens when a parent and child window have different UI states
- What is the documentation for SetParent trying to tell me about synchronizing the UI state?
- The sad implementation history of COM component categories and why it means you have to click twice to see your newly-installed taskbar toolbar
- How can I find the installation directory for my UWP application?
- The wrong way of benchmarking the most efficient integer comparison function
- Why is there no way to add a permission to a page with VirtualProtect instead of replacing it?
- What happens if you simply return from the thread callback passed to _beginthread and _beginthreadex?
- Microspeak: FCIB
- On memory allocations larger than 64KB on 16-bit Windows
- Cancelling the INamespaceWalk:: Walk operation a little faster
- How can I cancel the INamespaceWalk:: Walk operation?
- How can I control which parts of the shell namespace the INamespaceWalk::Walk operation will walk into?
- Was there a problem with Windows 95-era programs relying on undocumented information disclosure stuff?
- Why did Windows 95 store image list bitmaps four-across instead of as a strict vertical strip?
- Why are my notification icon customizations lost after six months of disuse?
- What are the dire consequences of accessing the fields of __m128i directly?
- How can I detect that a shell item refers to a virtual folder, or to a file system inside a file?
October 2017
- Why does upgrading my project to Unicode cause Visual Studio to use a different version of the common controls?
- Should I name my file mapping after the file it was created from?
- How do I preserve the user’s notification icon preferences for my program after I update it?
- How do I prevent my registered hotkey from firing repeatedly due to auto-repeat?
- Why was the Windows 95 precursor project code-named Panther abandoned?
- When I use Alt+PrtSc to take a screen shot of a maximized window, why does it capture a few pixels from an adjacent monitor?
- A closer look at the complexity analysis of finding the k’th smallest element in two sorted arrays
- On the gradual improvements in how the system deals with the failure to initialize a critical section
- How do I create a shortcut whose target is specified by a relative path?
- I used WS_EX_COMPOSITED to get rid of my redrawing flicker, but it resulted in sluggish response
- When a stopgap solution becomes an undocumented feature some people rely on
- Nasty gotcha: Powershell aliases that match commands you might want to run
- Exploring the problem: Create a file that only one process can write to
- Why does my program crash when I throw an exception from an APC?
- How can I specify that my DLL should resolve a DLL dependency from the same directory that the DLL is in?
- Microspeak: Gardening
- Why does NTVDM create empty IO.SYS and MSDOS.SYS files?
- How can I investigate the possibility of a lot of leaked window classes (RegisterClass)?
- Evaluating the security consequences of an instance of reading past the end of a buffer
- Reconciling yucky boys and gross kissing with the occasional dance
- The Resource Compiler’s preprocessor is not the same as the C preprocessor
- Alas, Microsoft Building 109 Conference Room A is no more
- How can I detect that my window is on the current virtual desktop?
September 2017
- Why does my thread handle suddenly go bad? All I did was wait on it!
- CancelIoEx can cancel synchronous I/O, which is kind of nice
- How to check if a pointer is in a range of memory
- Who implemented the Windows NT blue screen of death?
- What happens if I wake a condition variable when nobody is waiting for it? Is the wake saved for the next thread that waits?
- What does it mean when I get an access violation at a very low address when entering a critical section?
- How accurate are the various Windows time-querying functions?
- What is the correct way of using SaveDC and RestoreDC?
- The NET HELPMSG command will decode Windows error codes, at least the simple ones
- The increasingly complex Kremlinology surrounding Windows
- How can I diagnose why my FreeLibrary isn’t freeing the library?
- Why is my window unexpectedly becoming topmost?
- What is the correct way of using the string buffer returned by the WindowsPreallocateStringBuffer function?
- Microspeak: Ripcord
- If you configure a program to run in Windows 2000 compatibility mode, then it is also vulnerable to Windows 2000 security issues
- Nasty gotcha: SetThreadUILanguage cannot be used to restore the thread UI language
- What are anonymous structs, and more importantly, how do I tell windows.h to stop using them?
- Can I enable Large Address Awareness dynamically at runtime?
- Does anybody know what really happened on August 25, 2017 at the Red Sox/Orioles game?
- Why did my systems reboot into the Recovery Environment and how do I prevent that from happening in the future?
- Inadvertently becoming the change you wish to see in the world
- I guess I may as well confess that I wrote the Itanium information in the Debugging Tools for Windows package
August 2017
- The Alpha AXP, epilogue: A correction about file system compression on the Alpha AXP
- The Alpha AXP, part 17: Reconstructing a call stack
- The Alpha AXP, part 16: What are the dire consequences of having 32-bit values in non-canonical form?
- The Alpha AXP, part 15: Variadic functions
- The Alpha AXP, part 14: On the strange behavior of writes to the zero register
- Yes, that was a horrifically awkward video, but it wasn’t the Windows 95 launch
- The Alpha AXP, part 13: On treating a 64-bit processor as if it were a 32-bit processor
- The Alpha AXP: Part 12: How you detect carry on a processor with no carry?
- The Alpha AXP, part 11: Processor faults
- The Alpha AXP, part 10: Atomic updates to byte and word memory units
- The Alpha AXP, part 9: The memory model and atomic memory operations
- The Alpha AXP, part 8: Memory access, storing bytes and words and unaligned data
- The Alpha AXP, part 7: Memory access, loading unaligned data
- The Alpha AXP, part 6: Memory access, basics
- The Alpha AXP, part 5: Conditional operations and control flow
- The Alpha AXP, part 4: Bit 15. Ugh. Bit 15.
- The Alpha AXP, part 3: Integer constants
- The Alpha AXP, part 2: Integer calculations
- The Alpha AXP, part 1: Initial plunge
- Wrapping some other scripting language inside a batch file
- Decomposing file paths (and extracting other information like file size, date and time, and attributes) from a batch file
- Why does attempting to echo an undefined environment variable result in the message “ECHO is on”?
- The redirection can come anywhere on the line, and you can use that to get rid of the spaces
July 2017
- The redirection can come anywhere on the line, so watch out for those spaces
- Can I throw a C++ exception from a structured exception?
- How am I supposed to free the memory the system allocates in the SetPrivateObjectSecurity function?
- Trip report: Sequim Lavender Festival and the Olympic Game Farm
- Wrapping up 2017’s extended CLR Week-and-a-half with some links to other CLR trivia
- If there is no difference between two options, choose the one that is easier to debug
- How can I find out how many threads are active in the CLR thread pool?
- The perils of async void
- Crash course in async and await
- Do people write insane code with multiple overlapping side effects with a straight face?
- Why does the assignment operator in C# evaluate left to right instead of right to left?
- Revisions to previous discussion of the implementation of anonymous methods in C#
- Discussion of how to add UTF-16 support to a library that internally uses UTF-8
- Customizing the window handle for item enumeration in IShellItem
- Why is the maximum number of TLS slots 1088? What a strange number.
- Microspeak: To stand up
- On the circular path from RAII to crazy-town back to RAII: Thoughts on emulating C#’s using in C++
- How can I tell whether two paths reside on the same underlying volume, so I can know whether they can be hard-linked?
- Debugging tip: Use .frame /r to recover nonvolatile registers from the stack frame
- How fair are SRW locks, particularly when there are both readers and writers?
- Urban and suburban camouflage
- Emulating the C# using keyword in C++
June 2017
- 2017 mid-year link clearance
- Extracting pages from a PDF document and saving them as separate image files, C++/CX edition with co_await
- Extracting pages from a PDF document and saving them as separate image files, C++/CX edition with explicit tasks
- Extracting pages from a PDF document and saving them as separate image files, JavaScript edition with async
- Extracting pages from a PDF document and saving them as separate image files, JavaScript edition with Promises
- Extracting pages from a PDF document and saving them as separate image files, C# edition
- Trying to make the thread pool more responsive to a large queue of long-running work items
- When can GetSecurityInfo API return ERROR_INSUFFICIENT_BUFFER?
- Summertime, and the lemonade is easy
- Why is Explorer opted out of Data Execution Prevention and termination on heap corruption, and how effective is the policy to opt it back in?
- How do I set the initial directory of the File Open dialog to a virtual directory?
- Stuff my father-in-law says: On baking bread
- Combining the work queue of distinct events, order not important, with an auto-reset event
- Creating an automatic-reset event from WaitOnAddress
- Creating a manual-reset event from WaitOnAddress
- Creating a semaphore with a maximum count from WaitOnAddress
- Creating a semaphore from WaitOnAddress
- The case of the longjmp from nowhere trying to open a registry key
- What will GetLastError() return after a failed InitOnceExecuteOnce?
- On enabling NX and ASLR for a module after the fact
- Microspeak: ROB and Office Hours
- How can I register a program to auto-relaunch if it crashes or is terminated?
- How likely is it that a window will receive a WM_NULL message out of the blue?
- Comparing WaitOnAddress with futexes (futexi? futexen?)
May 2017
- Extending our critical section based on WaitOnAddress to support timeouts
- Why isn’t the original window order always preserved when you undo an Aero Shake?
- Does DebugBreak work to launch the debugger, or doesn’t it?
- Why are hidden files with a leading tilde treated as super-hidden?
- Diagnosing why you cannot create a stable subkey under a volatile parent key
- Some questions about unflushed data and calling FlushFileBuffers on a new handle to a file
- What do these hard drive icons mean?
- Why doesn’t searching my Start menu with Cortana find Internet shortcuts in my All Programs list?
- Debugging a GDI resource leak: Case study
- Why is the !locks command called !locks even though it debugs only critical sections?
- Why do my PDF file associations get reset every time I restart?
- There’s a group policy for Action Center, and another one for Action Center
- At least it wasn’t on a Web page with the warning “Beware of the leopard”
- A question about avoiding page faults the first time newly-allocated memory is accessed
- How to calculate the resulting security descriptor of a child object without creating it
- Revised notes on the reliability of FlushFileBuffers
- The early Windows phone devices were liquid-cooled, sort of
- Couldn’t we fix the lackey catastrophe by using #pragma init_seg(user)?
- Remember that in a stack trace, the addresses are return addresses, not call addresses
- The interaction between AppBars and Windows 10 virtual desktops
- Why don’t I get thumbnails for files that are marked offline?
- Microspeak: Work-back
- Those blue boxes all over the place, I always wondered what they were for
- Why doesn’t SHGetFileInfo give me customized folder icons?
April 2017
- Why does the compiler generate memory operations on the full variable even though only one byte is involved?
- Static hooking through predefinition
- Why are there two incompatible ways of specifying a serial port baud rate?
- How do I kill a program that hung with an always-on-top fullscreen window?
- Filtering the Browse for Folder dialog so it shows only drive letters
- Application crash reported as security vulnerability, but you never crossed the airtight hatchway
- On generating sentinel pointer values in Windows
- Under what conditions could a commit of reserved memory fail?
- That time a customer reported an error in the map used by Flight Simulator
- Why does my __FILE__ macro produce an invalid address, which mysteriously becomes valid a few moments later?
- How can I atomically leave a critical section and delete it?
- Can memcpy go into an infinite loop? Why is it being blamed for a busy hang?
- How do I get the current directory for a non-current drive?
- The Windows 8 close gestures, a retrospective
- When I enable page heap, why is my one-byte buffer overrun not detected immediately?
- If I have a thread waiting on an event, and I call SetEvent immediately followed by ResetEvent, is the waiting thread guaranteed to be released?
- What can I do if I want to throw a C++ exception from my InitOnce callback?
- How do I programmatically obtain the user’s selected accent color in Windows 10?
- Microspeak: snap
- How do I create a shortcut in the Send To menu that runs a program with a command line option?
March 2017
- A survey of the various ways of creating GDI bitmaps with predefined data
- For sale: One TARDIS, working (lights), you must pick up from Vancouver
- The gradual erosion of the SEM_NOOPENFILEERRORBOX error mode
- A brief discussion on how best to respond to the end-session messages
- Explorer is a single-instance application, but you can find other ways to get the effect of running a separate instance
- How real-mode Windows loaded code from the disk, and how you could use that to minimize disk swapping
- When you submit a security vulnerability report, we go the extra mile and try to fix your typos
- Responses to various ideas on how to get people to stop using that leaked build
- You can peek to see whether your delay-loaded function loaded successfully
- Why does the volume control let me set the volume only to even numbers?
- Secret passages on Microsoft main campus, episode 2
- Happy St. Patrick’s Day. Watch out for that throne.
- Not interested in college basketball? No problem. Follow the Name of the Year 2017 bracket
- If I want to maintain a free list of pages, should I use MEM_RESET or MEM_DECOMMIT?
- How do I provide data to the sharing pane from a Win32 desktop application?
- How do I show the sharing pane from a Win32 desktop application?
- Why is Alt+D the keyboard shortcut for putting focus on the address bar?
- Raymond’s highly scientific predictions for the 2017 NCAA men’s basketball tournament
- Which languages are fully-localized by Windows?
- Is GENERIC_ALL equivalent to GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE?
- How do I keep thread pool threads, or other threads in general, from competing with my render thread for CPU?
- How do we improve the performance of conhost processes when we ping a bunch of servers?
- Microspeak: to reason over
- Some internal developer chatter on a bug that caused your screen to turn black
- The case of the 32-bit program that tries to load a 64-bit DLL
- What happens when you tell a Millennial to take pictures of a party
- Don’t forget to implement canonical names for verbs in your shell context menu extension
- Want to include a gift message with your tires? Nice try.
- Why does my attempt to acquire an SRW lock block even though !locks report no locks held?
February 2017
- Great moments in journalism: “Confirmed Microsoft Surface Pro 5 launch date”
- Baking soda has hundreds of uses, but what about what it says on the tin?
- How do I disable the press-and-hold gesture for my window?
- Eventually you reach a critical mass of LEGO pieces where you can build most things from what you already have
- The system manages the system image lists; don’t go changing the art on the walls
- How am I supposed to print my print-at-home tickets if I can’t reproduce them?
- How to create a folder that inherits its parent’s ACL, and then overrides part of it
- Those Year 2000 disaster preparedness trucks were originally there for a different reason
- What little kids think of lifeguards
- Psychic debugging: Why does opening a command prompt always print a weird error message?
- The 2017/2018 Seattle Symphony subscription season at a glance
- Another more efficient solution to the problem of a long-running task running on the thread pool persistent thread
- Follow-up: The bus that straddles traffic
- A more efficient solution to the problem of a long-running task running on the thread pool persistent thread
- How do I fix the problem of a long-running task running on the thread pool persistent thread?
- Man, this housing downturn is hitting everyone, follow-up
- Why did my thread pool stop processing work once it hit a long-running work item?
- Pipelining your laundry, and the ensuing silliness
- Advertisement for ink cartridges doesn’t do all the math
- Sometimes you get so worked up about the compatibility consequences of a change that you miss the obvious
- How do I do an interlocked exchange of a hat pointer?
- Suspicious memory leak in std::basic_string
- Why are all Windows drivers dated June 21, 2006? Don’t you ever update drivers?
- Microspeak: Placemat review
- My proposal for an episode of the new Star Trek series
- Why does a Microsoft mouse accept two batteries even though it works just fine on only one battery?
- It is a great deal and not a great deal, both at the same time
- Why am I getting a crash at shutdown inside the thread pool?
- Some friendly advice from the Redmond Public Safety department on nighttime nude jogging
- Are DDE and WM_COPYDATA related as IPC mechanisms?
- I wasn’t fooled into thinking the Star Wars trench run was along the equatorial trench, but I was fooled anyway
- How am I supposed to free the information passed to the SetSecurityInfo function?
January 2017
- Why does my Surface power brick keep blinking on and off?
- Creating an object on the other side of the airtight hatchway isn’t yet a security vulnerability
- How can a COM local server keep itself alive even though there are no active clients?
- How can I control the directory from which my delay-loaded DLL is loaded?
- Are there alternatives to _lock and _unlock in Visual Studio 2015?
- Why do my program’s notifications sometimes show a small icon, and sometimes a large icon?
- How do I prevent users from terminating a service?
- How important is it nowadays to ensure that all my DLLs have non-conflicting base addresses?
- A fine detail on how DLLs are relocated as the result of a base address collision, and consequences
- Does ASLR relocate all DLLs by the same offset?
- Microspeak: ladder up
- How come my CreateMutex call sometimes fails with Access denied?
- A survey of the various ways of declaring pages of memory to be uninteresting
- How do I detect Windows 10 if I cannot GetProcAddress for the function IsWindows10OrGreater?
- Applying a permutation to a vector, part 6
- Applying a permutation to a vector, part 5
- Applying a permutation to a vector, part 4: What is the computational complexity of the apply_permutation function?
- Sorting by indices, part 2: The Schwartzian transform
- Sorting by indices, part 1
- Applying a permutation to a vector, part 3
- Applying a permutation to a vector, part 2
- Applying a permutation to a vector, part 1