Skip to content
TopicTracker
From devblogs.microsoft.com/oldnewthingView original
TranslationTranslation

What does it mean when the bottom bit of my HMODULE is set?

The blog post explains that when the bottom bit of an HMODULE is set, it indicates a special kind of HMODULE. The post provides technical insight into what this bit signifies in Windows programming.

Background

Raymond Chen's "The Old New Thing" is a long-running Microsoft Developer Blog that explains Windows internals, quirks, and historical design decisions in deep technical detail. An HMODULE is a Windows handle that identifies a loaded executable or DLL module in a process's memory. Normally it's a pointer-like value that must be aligned (bottom bit zero). Windows 11 (build 26090+) introduced a change where the low bit of an HMODULE can be set to 1 ("mark of the smuggler"), indicating the module was loaded from a special memory-backed source and has a non-standard base address. This matters for low-level Windows developers, debuggers, and anti-cheat/tamper-detection software, because code that checks or compares HMODULE values naively will break on these "non-canonical" handles. The post explains the semantics and how to safely handle them.

Related stories

  • The author rejects becoming a "reverse centaur"—a term for humans forced to review machine-generated code—after observing a surge in LLM-produced pull requests to his open source projects. Despite his personal decision not to use generative AI coding tools, he now spends increasing time reviewing code written by AI and explains how he resists this role.

  • The author, who once advised his sister to use code libraries without fully understanding them, now finds himself unable to commit AI-generated code he doesn't fully comprehend. He recounts spending 10 hours fixing code that an LLM produced in 12 minutes, and notes that while others trust AI code generators like a car engine, his need to understand every line negates any productivity gains.

  • The article argues that many single-page app developers misuse divs or buttons with onclick handlers instead of proper anchor tags for navigation, breaking browser history, accessibility, and native link features. The author urges using native `<a href>` elements or framework Link components.

  • The article argues that disallowing trailing (or leading) separators in languages like JSON, Haskell, and Prolog was a design mistake, as it makes adding or removing elements more complex. It highlights languages like Python, Go, and Alloy that permit trailing commas, and notes potential parsing ambiguities when trailing separators are used in control-flow contexts.

  • The article argues that Lucas Costa's concept of "backpressure" for systems handling code-generating AI is a misnomer. Backpressure signals upstream processes to slow down, while Costa's suggestions are about improving quality, not reducing quantity. The author proposes "lean manufacturing" as a more accurate analogy for managing unstable inputs from AI-generated code.