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

What is __wchar_t (with the leading double underscores) and why am I getting...

The Microsoft Visual C++ compiler has a compiler option called /Zc:wchar_t which lets you control what the symbol wchar_t means. According to the C++ standard, wchar_t is a distinct native type, and...

View Article


Why do I get a _BLOCK_TYPE_IS_VALID debug assertion failure when I try to...

A customer had a problem deleting a WIC pixel buffer. Fortunately, they were able to reduce it to a few lines of code. // Code in italics is wrong. UINT sourceBufferSize = 0; BYTE* sourceBuffer =...

View Article


The case of the unexpected ERROR_ACCESS_DENIED when calling MapViewOfFile

A customer was trying to figure out how to use shared memory, but even their simplest program couldn't work. The customer shared their code and asked for help. The first process creates a named file...

View Article

How can I reset a PC if I forgot the administrator password?

Suppose you found a PC in a closet and you want to reset it, but you forgot the administrator password. What can you do? There is an emergency reset button that you can activate like this: Turn off...

View Article

Why don’t I get a broken pipe when the child process terminates?

A customer was having a problem with named pipes. Our main process creates a named pipe with ACCESS_INBOUND and passes the write handle to the child process. The main process keeps reading from the...

View Article


What is this race condition that the OpenMutex documentation is trying to...

A customer asked for clarification on what they considered an enigmatic sentence in the documentation for the Open­Mutex function: If your multithreaded application must repeatedly create, open, and...

View Article

Answers to a customer’s questions about memory and DLLs

A customer had a few questions about memory and DLLs. We have some questions that no one here can answer. When are DLLs actually loaded (mapped) into memory? Does it happen when the calling program...

View Article

Why does tapping the Alt key cause my owner-draw static control to repaint?

A customer had an owner-drawn static control, and they found that when the user pressed the Alt key, their static control redrew. This extra redraw was unwanted, presumably because the control takes a...

View Article


Can a server-side Web application trigger the creation of thumbs.db files?

A customer had a server-side Web application which creates a large number of image files. The customer was concerned that the system would spend a lot of effort generating thumbnails to be put into...

View Article


Dubious security vulnerability: Discovering the salt

A security vulnerability report came in that went something like this: The XYZ component has a feature where it can cache the password used to access a network resource. It encrypts this password with...

View Article

How bad is it to delay closing a thread handle for a long time after the...

A customer has a component that creates a thread with Create­Thread in order to do something, and eventually that thread exits normally. The code hangs onto the thread handle for the lifetime of the...

View Article

My colleague who thought he held the unofficial record for consecutive months...

I've written about my colleague Danny before. He's an accomplished skier, and one of the things he maintained was a tradition of going skiing at least once every month. He jokingly claimed that he...

View Article

Why can’t VarDateFromStr parse back a Hungarian date that was generated by...

A customer liaison reported a problem with date parsing. Ugh, date parsing. The customer is receiving date information from a scanner that they want to parse. They are using the...

View Article


If you ask robocopy to destroy the destination, then it will destroy the...

A customer reported that Explorer was not showing a folder on their hard drive that they were sure was there. I asked them to check whether the folder really was there, by going to a command prompt...

View Article

What is the maximum numeric value for a socket, and what is the maximum...

A customer had a problem with their application that used network sockets, and they wanted to know what the maximum numeric value for a socket is. "The program uses a signed integer to hold the socket...

View Article


Another pattern for using the InitOnce functions

In my survey of patterns for using the InitOnce functions, I omitted the synchronous two-phase initialization. The synchronous two-phase initialization is similar to the simple callback-based version...

View Article

The mother lode of well-known SIDs

For your enjoyment, I share with you a link to the most comprehensive list of well-known SIDs I've found yet. A little present for the holidays.

View Article


Wireless AC is, unfortunately, not what it sounds like

I saw a laptop advertised as supporting "Wireless AC". I thought to myself, "Sweet, no more power cables!" Unfortunately, it was not referring to wireless alternating current. It was referring to the...

View Article

Why don’t I get properly translated program output after installing the...

A customer reported that they installed the Portuguese (Portugal) language pack, but even after rebooting, the ipconfig command still printed results in English. Same problem occurs with Turkish. But...

View Article

The case of the four unlabeled toggle buttons

In an Insider build of Windows 10 some time ago, there was a bug that caused four new toggle buttons to show up in the Settings app, but with no description aside from "On" and "Off". Off The fact...

View Article
Browsing all 3085 articles
Browse latest View live


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