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

Inadvertently becoming the change you wish to see in the world

(Note: The quote is fake, by the way.) It's the Labor Day holiday in the United States, so instead of technical content, I'm going to share this story.¹ You can hear it in Melinda Gates' own words,...

View Article


Why did my systems reboot into the Recovery Environment and how do I prevent...

Earlier this year, a customer reported that they had a cluster of systems running a mix of Windows Server 2003¹ and Windows Server 2008 R2 Service Pack 1. The cluster node crashed, causing the...

View Article


Does anybody know what really happened on August 25, 2017 at the Red...

It is reportedly the first time it has ever happened at a Major League Baseball game: A player who left a game came back in. This is disallowed by the rules, yet nobody noticed. But did it happen? The...

View Article

Can I enable Large Address Awareness dynamically at runtime?

The /LARGE­ADDRESS­AWARE flag is recorded in the header of the executable. A customer wanted to know if there was a way to select at runtime whether a process is large address aware. They were willing...

View Article

What are anonymous structs, and more importantly, how do I tell windows.h to...

Windows header files take advantage of a language extension known as "anonymous structs" or "nameless structs". It looks like this: typedef struct _devicemode { TCHAR dmDeviceName[CCHDEVICENAME]; WORD...

View Article


Nasty gotcha: SetThreadUILanguage cannot be used to restore the thread UI...

Suppose you want to change the thread UI language temporarily. You might be tempted to do this: // Code in italics is wrong void Something() { // Save the original language. LANGID originalLanguage =...

View Article

If you configure a program to run in Windows 2000 compatibility mode, then it...

We received a security vulnerability report that said, basically, that if you apply Windows 2000 compatibility mode to an application, then it becomes vulnerable to Windows 2000 security issues. Well,...

View Article

Microspeak: Ripcord

Remember: General business jargon still qualifies as Microspeak if it is in wide enough use at Microsoft that you are expected to know what it means and how to use it. Today's Microspeak term is...

View Article


What is the correct way of using the string buffer returned by the...

The most common way of creating an HSTRING is to call Windows­Create­String, but there is also a two-phase creation pattern: First you call Windows­Preallocate­String­Buffer to create a buffer for a...

View Article


Why is my window unexpectedly becoming topmost?

A customer had a problem where one of their program's windows was somehow receiving the WS_EX_TOP­MOST extended window style, thereby becoming topmost. The scenario was that they created a popup...

View Article

How can I diagnose why my FreeLibrary isn’t freeing the library?

A customer had some code that called Free­Library, and they expected the library to be freed, but it wasn't happening. They suspect that there was an unmatched call to Load­Library and was wondering...

View Article

The increasingly complex Kremlinology surrounding Windows

(If you prefer videos, here's a video version of basically the same question.) Everybody wants to know what the Windows team is up to, and the lack of official information won't stop them. As an...

View Article

The NET HELPMSG command will decode Windows error codes, at least the simple...

A quick and dirty way to convert Windows error codes to strings is to use the NET HELPMSG command. C:\> NET HELPMSG 2 The system cannot find the file specified. C:\> NET HELPMSG 8242 An invalid...

View Article


What is the correct way of using SaveDC and RestoreDC?

There are these two functions SaveDC and RestoreDC. How do they work? Each device context (DC) maintains a stack of saved states. When you call SaveDC, the current state of the DC is saved and pushed...

View Article

How accurate are the various Windows time-querying functions?

Windows has a bunch of time-querying functions. One group of functions uses the system performance counter. These are as accurate as the hardware allows while still conforming to the basic...

View Article


What does it mean when I get an access violation at a very low address when...

Warning: This article talks about implementation details which can change at any time. The information provided is for debugging and diagnostic purposes only. A customer found that their server...

View Article

What happens if I wake a condition variable when nobody is waiting for it? Is...

Suppose you call Wake­Xxx­Condition­Variable to wake a CONDITION_VARIABLE, but nobody is waiting on the condition variable. What happens? In particular, is the wake saved for the next thread that...

View Article


Who implemented the Windows NT blue screen of death?

Following up on the history of the Windows 3.1 and Windows 95 blue screen messages, John Vert admits that he wrote the Windows NT blue screen of death. In particular, he explains why it was white text...

View Article

How to check if a pointer is in a range of memory

Suppose you have a range of memory described by two variables, say, byte* regionStart; size_t regionSize; And suppose you want to check whether a pointers lies within that region. You might be tempted...

View Article

CancelIoEx can cancel synchronous I/O, which is kind of nice

The Cancel­Io­Ex function can be used to cancel synchronous I/O. This is handy if you have a program that processes a file in large chunks and you want to give it a Cancel button. Without...

View Article
Browsing all 3085 articles
Browse latest View live


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