Quantcast
Channel: The Old New Thing
Browsing all 3085 articles
Browse latest View live

The evolution of the text size limits related to the standard static control

Michael Quinlan wondered about the text size limits related to the standard static control.¹ We start with the resource format, since that was the limiting factor in the original problem. The original...

View Article


The invisible work of preparing PC BIOSes for the year 2000

Some time ago, I told stories of the anxiety on the evening of December 31, 1999 at Microsoft and at Microsoft Press. This prompted a now-retired colleague of mine to share a story about the run-up to...

View Article


2016 year-end link clearance

Iceland also has a Christmas goat. It burned down. The gallery of interesting musical notation presents examples of scenarios in which a work written in Conventional Western Music Notation gets a...

View Article

Applying a permutation to a vector, part 1

Suppose you have a vector indices of N integers that is a permutation of the numbers 0 through N − 1. Suppose you also have a vector v of N objects. The mission is to apply the permutation to the...

View Article

Applying a permutation to a vector, part 2

We left off our study of the apply_permutation function by wondering which version is bettern: the moving version of the swapping version. I'm not certain I have the answer, but here's my analysis....

View Article


Applying a permutation to a vector, part 3

We spent the last two days looking at the apply_permutation function and arguing pros and cons of various implementation choices. Today's we're going to look at generalization. One of the things you...

View Article

Sorting by indices, part 1

Okay, now we're going to start using the apply_permutation function that we beat to death for first part of this week. Suppose you are sorting a collection of objects with the property that copying...

View Article

Sorting by indices, part 2: The Schwartzian transform

Before we dig into the Schwartzian transform, let's look at a more conventional generic way to sort by a key: template<typename Iter, typename UnaryOperation, typename Compare> void sort_by(Iter...

View Article


Applying a permutation to a vector, part 4: What is the computational...

One question left unanswered was the computational complexity of the apply_permutation function. Here it is again: template<typename T> void apply_permutation( std::vector<T>& v,...

View Article


Applying a permutation to a vector, part 5

Our apply_permutation function assumes that the integers form a valid permutation. Let's add error checking. There are two ways the integers could fail to be a permutation: One is that the collection...

View Article

Applying a permutation to a vector, part 6

I left an exercise to write a function apply_reverse_permutation in which each element in the indices represents where the element should move to rather than where it comes from. This exercise is...

View Article

How do I detect Windows 10 if I cannot GetProcAddress for the function...

A customer wanted to use the handy functions provided in the Version­Helpers.h header file, like Is­Windows­10­Or­Greater, while maintaining the same source code for both Windows 7 and Windows 10...

View Article

A survey of the various ways of declaring pages of memory to be uninteresting

The list of ways a program can declare pages of memory to be uninteresting seems to be growing steadily. Let's look at what we have so far today. The most old-fashioned way of declaring a page to be...

View Article


How come my CreateMutex call sometimes fails with Access denied?

A customer reported that they had a system where multiple processes share a mutex. Each process calls Create­Mutex to create the mutex or obtain a handle to the existing one. But the customer found...

View Article

Microspeak: ladder up

Some time ago, I encountered a new piece of Microsoft jargon. Let's try to figure it out together. For our team presentation, we developed a theme that ties together all of the features we are working...

View Article


Does ASLR relocate all DLLs by the same offset?

I've seen multiple claims that the Windows implementation of ASLR chooses a single random offset and applies that same offset to all DLL base addresses. When the operating system loads, it applies a...

View Article

A fine detail on how DLLs are relocated as the result of a base address...

If a DLL must be relocated due to a base address conflict, then the image will be relocated, and the entire relocated DLL is now backed by the page file. If you read the description more carefully,...

View Article


How important is it nowadays to ensure that all my DLLs have non-conflicting...

Back in the day, one of the things you were exhorted to do was rebase your DLLs so that they all had nonoverlapping address ranges, thereby avoiding the cost of runtime relocation. Is this still...

View Article

How do I prevent users from terminating a service?

A customer asked (via their customer liaison), "We wrote in-house Windows service that is set to auto-start when the user logs in. How can we prevent the user from terminating it in Task Manager, or...

View Article

Image may be NSFW.
Clik here to view.

Why do my program’s notifications sometimes show a small icon, and sometimes...

A customer wanted to know why their program's notifications sometimes show a small icon, like this: You've got mail. 🔊 🔋 … And sometimes it shows a large icon, like this: It's Bob's birthday today....

View Article
Browsing all 3085 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>