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

Image may be NSFW.
Clik here to view.

Opening the classic folder browser dialog with a specific folder preselected

Today's Little Program shows how to set the initial selection in the SHBrowse­For­Folder dialog. The design of the SHBrowse­For­Folder function had a defect: The BROWSEINFO structure doesn't have a...

View Article


Image may be NSFW.
Clik here to view.

The details of the major incident were not clearly articulated, but whatever...

When a server is taken offline, be it a planned unplanned outage or an unplanned unplanned outage or something else, the operations team send out a series of messages alerting customers to the issue....

View Article


Image may be NSFW.
Clik here to view.

Why is the System.DateCreated property off by a few seconds?

If you ask for the System.Date­Created property of a shell item, the timestamp that comes back is up to two seconds different from the file's actual timestamp. (Similarly for System.Date­Modified and...

View Article

Image may be NSFW.
Clik here to view.

If more than one object causes a WaitForMultipleObjects to return, how do I...

There is often confusion about the case where you call Wait­For­Multiple­Objects (or its variants), passing bWaitAll = FALSE, and more than one object satisfies the wait. When bWaitAll is FALSE, this...

View Article

Image may be NSFW.
Clik here to view.

On the ways of creating a GUID that looks pretty

A customer had what at first appeared to be a question born of curiousity. Is it possible that a GUID can be generated with all ASCII characters for bytes? In other words, is it possible that a GUID...

View Article


Image may be NSFW.
Clik here to view.

After I encrypt memory with CryptProtectMemory, can I move it around?

A customer had a question about the the Crypt­Protect­Memory function. After using it to encrypt a memory block, can the memory block be moved to another location and decrypted there? Or does the...

View Article

Image may be NSFW.
Clik here to view.

In the Seattle area, people treat you nicer once they learn your last name is...

One of the team members during the days of Windows 95 happens to have the last name Gates, no relation. She says that it's surprising how nice salespeople are to you once they learn what your last...

View Article

Image may be NSFW.
Clik here to view.

When I set the "force X off" policy to Disabled, why doesn't it force X on?

A customer was using one of the many "force X off" policies, but instead of using it to force X off, they were trying to use it to force X on by setting the policy to Disabled. For example, there is a...

View Article


Image may be NSFW.
Clik here to view.

Why did the original code for FIND.COM use lop as a label instead of loop?

A few years ago, I left you with an exercise: Given the code mov dx,st_length ;length of the string arg. dec dx ;adjust for later use mov di, line_buffer lop: inc dx mov si,offset st_buffer ;pointer...

View Article


Image may be NSFW.
Clik here to view.

Why are there both TMP and TEMP environment variables, and which one is right?

If you snoop around your environment variables, you may notice that there are two variables that propose to specify the location of temporary files. There is one called TMP and another called TEMP....

View Article

Image may be NSFW.
Clik here to view.

How to find the IP address of a hacker, according to CSI: Cyber

The episode of the television documentary CSI: Cyber which aired on CBS last Wednesday demonstrated an elite trick to obtaining a hacker's IP address: Extract it from the email header. Here's a screen...

View Article

Image may be NSFW.
Clik here to view.

What was the starting point for the Panther Win32 kernel?

When I presented a list of cat-related code names from Windows 95, commenter dave wanted to know whether the Panther kernel was derived from the 32-bit DOS kernel or the Windows/386 kernel. Neither....

View Article

Image may be NSFW.
Clik here to view.

It rather involved being on the other side of this airtight hatchway: Invalid...

It's the bogus vulnerability that keeps on giving. This time a security researcher found a horrible security flaw in Sys­Alloc­String­Len: The Sys­Alloc­String­Len function is vulnerable to a...

View Article


Image may be NSFW.
Clik here to view.

How did the scopes for the CryptProtectMemory function end up in a strange...

A few weeks ago, I left an exercise: Propose a theory as to why the names and values of the scopes for the Crypt­Protect­Memory function are the way they are. I didn't know the answer when I posed the...

View Article

Image may be NSFW.
Clik here to view.

Why can't I have variadic COM methods?

COM methods cannot be variadic. Why not? Answer: Because the marshaler doesn't know when to stop. Suppose variadic COM methods were possible. And then you wrote this code: interface IVariadic {...

View Article


Image may be NSFW.
Clik here to view.

How do I extract the path to Control Panel from this shortcut so I can launch...

A customer explained that they had a program that used the IShell­Link::Get­Path method to extract the program that is the target of a shortcut. They found that this didn't work for certain shortcuts,...

View Article

Image may be NSFW.
Clik here to view.

Wow, they really crammed a lot into those 410 transistors

A colleague of mine pointed out that in yesterday's Seattle Times, there was an article about Moore's Law. To illustrate the progress of technology, they included some highlights, including the...

View Article


Image may be NSFW.
Clik here to view.

Access to a file's attributes is controlled by two things

We saw some time ago that permission to delete a file is granted either if you have DELETE access on the file, or if you have FILE_DELETE_CHILD access on the containing directory. File attributes...

View Article

Image may be NSFW.
Clik here to view.

Is the atom returned by RegisterClass(Ex) a "real" atom?

A customer was debugging some code that calls Register­Class on a class that's already been registered. In this case, it was registered by another DLL in the same process. Normally, this wouldn't be a...

View Article

Image may be NSFW.
Clik here to view.

How can I tell if a file is an image of some type?

A customer wanted to know if there is some standard way of determining from the full path to a file whether it is a photo or image. They are writing a program that transfers a bunch of files to a...

View Article
Browsing all 3085 articles
Browse latest View live


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