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

Image may be NSFW.
Clik here to view.

How secure are GUIDs? Can I use it to generate passwords?

GUIDs are globally unique identifiers, and given their rather incomprehensible presentation, some people may be tempted to use them (or parts of them) as passwords. For example, one person wondered...

View Article


Image may be NSFW.
Clik here to view.

Is a SID with zero subauthorities a valid SID? It depends whom you ask

Here's an interesting table. FunctionIs Sub­Authority­Count=0 valid?IsValidSidYesConvert­Sid­To­String­SidYesConvertString­­Sid­To­SidNo That last entry creates the unfortunate situation where a SID...

View Article


Image may be NSFW.
Clik here to view.

Why does the BackupWrite function take a pointer to a modifiable buffer when...

The Backup­Write function takes a non-const pointer to the buffer to be written to the file being restored. Will it actually modify the buffer? Assuming it doesn't, why wasn't it declared const? It...

View Article

Image may be NSFW.
Clik here to view.

Trying out all the different ways of recognizing different types of...

Today's Little Program takes a 64-bit integer and tries to interpret it in all the various timestamp formats. This comes in handy when you have extracted a timestamp from a crash dump and want to see...

View Article

Image may be NSFW.
Clik here to view.

Intentionally making the suggestion look nothing like any scripting language,...

In an internal peer-to-peer discussion list for an internal tool I'll call Program Q, somebody asked, How can I query the number of free frobs in every table in my table repository? I suggested that...

View Article


Image may be NSFW.
Clik here to view.

What would be the point of creating a product that can't do its job?

Yuhong Bao for some reason lamented that there is no 32-bit version of Windows Server 2008 R2. Well, duh. Why would anybody want a 32-bit version of a server product? You would run into address space...

View Article

Image may be NSFW.
Clik here to view.

Why is my x64 process getting heap address above 4GB on Windows 8?

A customer noticed that when they ran their program on Windows 8, memory allocations were being returned above the 4GB boundary. They included a simple test program: #include <stdio.h> #include...

View Article

Image may be NSFW.
Clik here to view.

On the various ways of creating large files in NTFS

For whatever reason, you may want to create a large file. The most basic way of doing this is to use Set­File­Pointer to move the pointer to a large position into the file (that doesn't exist yet),...

View Article


Image may be NSFW.
Clik here to view.

Generating different types of timestamps from quite a long way away

Today's Little Program does the reverse of what we had last time. It takes a point in time and then generates timestamps in various formats. using System; class Program { static void TryFormat(string...

View Article


Image may be NSFW.
Clik here to view.

Hazy memories of the Windows 95 ship party

One of the moments from the Windows 95 ship party (20 years ago today) was when one of the team members drove his motorcycle through the halls, leaving burns in the carpet. The funny part of that...

View Article

Image may be NSFW.
Clik here to view.

Why doesn't the Print command appear when I select 20 files and right-click?

This is explained in the MSDN documentation: When the number of items selected does not match the verb selection model or is greater than the default limits outlined in the following table, the verb...

View Article

Image may be NSFW.
Clik here to view.

Why do I get ERROR_INVALID_HANDLE from GetModuleFileNameEx when I know the...

Consider the following program: #define UNICODE #define _UNICODE #include <windows.h> #include <psapi.h> #include <stdio.h> // horrors! mixing C and C++! int __cdecl wmain(int,...

View Article

Image may be NSFW.
Clik here to view.

What did the Ignore button do in Windows 3.1 when an application encountered...

In Windows 3.0, when an application encountered a general protection fault, you got an error message that looked like this: Application error CONTOSO caused a General Protection Fault in module...

View Article


Image may be NSFW.
Clik here to view.

How can I detect whether a keyboard is attached to the computer?

Today's Little Program tells you whether a keyboard is attached to the computer. The short answer is "Enumerate the raw input devices and see if any of them is a keyboard." Remember: Little Programs...

View Article

Image may be NSFW.
Clik here to view.

Please enjoy the new eco-friendly printers, now arguably less eco-friendly

Some years ago, the IT department replaced the printers multifunction devices with new reportedly eco-friendly models. One feature of the new devices is that when you send a job to the printer, it...

View Article


Image may be NSFW.
Clik here to view.

When you think you found a problem with a function, make sure you're actually...

A customer reported that the Duplicate­Handle function was failing with ERROR_INVALID_HANDLE even though the handle being passed to it seemed legitimate: // Create the handle here m_Event =...

View Article

Image may be NSFW.
Clik here to view.

Corrupted file causes application to crash; is that a security vulnerability?

A security vulnerability report came in that went something like this: We have found a vulnerability in the XYZ application when it opens the attached corrupted file. The error message says,...

View Article


Image may be NSFW.
Clik here to view.

The curse of the redefinition of the symbol HLOG

A customer was running into a compiler error complaining about redefinition of the symbol HLOG. #include <pdh.h> #include <lm.h> ... The result is lmerrlog.h(80): error C2373: 'HLOG'...

View Article

Image may be NSFW.
Clik here to view.

The Itanium processor, part 1: Warming up

The Itanium may not have been much of a commercial success, but it is interesting as a processor architecture because it is different from anything else commonly seen today. It's like learning a...

View Article

Image may be NSFW.
Clik here to view.

The Itanium processor, part 2: Instruction encoding, templates, and stops

Instructions on Itanium are grouped into chunks of three, known as bundles, and each of the three positions in a bundle is known as a slot. A bundle is 128 bits long (16 bytes) and always resides on a...

View Article
Browsing all 1765 articles
Browse latest View live


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