Providing a small amount of additional control over what happens when an...
The SetFileCompletionNotificationModes function gives you some control over how the system behaves when an overlapped I/O completes synchronously. The FILE_SKIP_COMPLETION_PORT_ON_SUCCESS flag...
View ArticleWhat was the code name for Windows 7?
A retrospective on Windows code names gave Blackcomb as the code name for Windows 7. That’s not quite correct. The code name for Windows 7 was… Windows 7. Windows XP was code named Whistler, which was...
View ArticleHow can I log users off after a period of inactivity, rather than merely...
Aaron Margosis had a customer who wanted to set up something like a “logoff” screen saver. Specifically, they have a large number of machines that are shared by multiple users. By default, when the...
View ArticleAdventures in application compatibility: Calling an internal function
We try hard to make sure applications continue to work, but some things that applications do are so egregious that there’s no practical way of getting them to work. Today, we’ll learn about one such....
View ArticleWhy do pinned apps sometimes go to the end of the taskbar, rather than going...
You may have noticed that the apps you’ve pinned to the taskbar are on the left, and the regular apps are on the right.¹ But sometimes, a pinned app goes to the right. Why is that? There is no “pinned...
View ArticleWhen it absolutely, positively has to be there for the product demo overnight
The preparations for the Windows NT launch event included acquiring impressive hardware to demonstrate the operating system’s scalability. One of the pieces of hardware loaned to Microsoft for...
View ArticleIs it a good idea to let WriteProcessMemory manage the page protection for me?
Some time ago, I noted that the WriteProcessMemory function will make a page read-write if necessary, as a courtesy to debuggers who want to use it to patch code. Is this something you should rely...
View ArticleWhy doesn’t the Programs and Features control panel show Last Used On...
A customer observed that the Last Used On column in the Programs and Features control panel doesn’t appear by default, and if they turn it on, the column is simply blank. The customer wanted to confirm...
View ArticleWhat about USERSEEUSERDO and GDISEEGDIDO?
In Windows 3.1, there were undocumented functions named USERSEEUSERDO and GDISEEGDIDO. Surely there’s a story behind these funny names. Of course. These functions were used for internal testing...
View ArticleNot actually crossing the airtight hatchway: Applying per-user overrides
We receive a number of security vulnerability reports of the form “If I write the following value into the registry at HKEY_CURRENT_USER\..., then the next time the user does X, I can do bad thing Y.”...
View ArticleHow can I extract the color from a solid color GDI brush?
Suppose you have a GDI HBRUSH and you suspect that it is a solid color brush. How can you confirm this suspicion and, if true, get the underlying color? You can ask the GetObject function to peek...
View ArticleThe SuperH-3, part 1: Introduction
Windows CE supported the Hitachi SuperH-3 and SuperH-4 processors. These were commonly abbreviated SH-3 and SH-4, or just SH3 and SH4, and the architecture series was known as SHx. I’ll cover the SH-3...
View ArticleThe SuperH-3, part 2: Addressing modes
The SH-3 supports a large number of addressing modes, which is somewhat unusual for a RISC processor. When I write operand size, I mean 1 for byte access, 2 for word access, and 4 for longword access....
View ArticleThe SuperH-3, part 3: Status flags and miscellaneous instructions
Only four of the bits in the status register are available to user-mode: Bit Meaning Notes M Modulus Used by division instructions Q Quotient Used by division instructions S Saturate Used by...
View ArticleHow do I fill out the Canadian eTA if I have a green card with no expiration...
Entry into Canada by air generally requires an Electronic Travel Authorization (eTA). Canadian and United States citizens are exempt from the eTA,¹ but United States permanent residents still require...
View ArticleThe SuperH-3, part 4: Basic arithmetic
Okay, we’re ready to do some arithmetic. Due to the limited instruction encoding space, there isn’t room for any three-operand instructions.¹ All of the arithmetic instructions are two-operand, where...
View ArticleThe SuperH-3, part 5: Multiplication
Last time, we looked at simple addition and subtraction. Now let’s look at multiplication. Multiplication operations report their results in a pair of 32-bit registers called called MACH and MACL,...
View ArticleThe SuperH-3, part 6: Division
The SH-3 does not have a simple “divide two integers please” instruction. Rather, it has a collection of instructions that let you build a division operation yourself. DIV0U ; prepare for unsigned...
View ArticleThe SuperH-3, part 7: Bitwise logical operations
The SH-3 has a rather basic collection of bitwise logical operations. AND Rm, Rn ; Rn &= Rm AND #imm, r0 ; r0 &= unsigned 8-bit immediate OR Rm, Rn ; Rn |= Rm OR #imm, r0 ; r0 |= unsigned 8-bit...
View ArticleThe SuperH-3, part 8: Bit shifting
The bit shifting operations are fairly straightforward. ; arithmetic (signed) shifts SHAL Rn ; Rn <<= 1, T = the bit shifted out SHAR Rn ; Rn >>= 1, T = the bit shifted out ; logical...
View Article