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

Image may be NSFW.
Clik here to view.

Windows started picking up the really big pieces of TerminateThread garbage...

Ah, Terminate­Thread. There are still people who think that there are valid scenarios for calling Terminate­Thread. Can you explain how Exit­Thread works? We are interested because we have a class...

View Article


Image may be NSFW.
Clik here to view.

p/invoke gotcha: C++ bool is not Win32 BOOLEAN is not UnmanagedType.Bool

Welcome to CLR Week. I hope you enjoy your stay. A customer reported that their p/invoke was not working. We aren't getting the proper return codes from the Audit­Set­System­Policy. When the call...

View Article


Image may be NSFW.
Clik here to view.

If you are going to call Marshal.GetLastWin32Error, the function whose error...

A customer reported that their p/invoke to a custom DLL was failing, and the error code made no sense. // C# using System; using System.Runtime.InteropServices; using System.Diagnostics; class Program...

View Article

Image may be NSFW.
Clik here to view.

If you are going to call Marshal.GetLastWin32Error, the function whose error...

Even if you remember to set Set­Last­Error=true in your p/invoke signature, you still have to be careful with Marshal.Get­Last­Win32­Error because there is only one last-error code, and it gets...

View Article

Image may be NSFW.
Clik here to view.

I saw a pinvoke signature that passed a UInt64 instead of a FILETIME, what's...

A customer had a question about a pinvoke signature that used a UInt64 to hold a FILETIME structure. [DllImport("kernel32.dll", SetLastError = true) static external bool GetProcessTimes( IntPtr...

View Article


Image may be NSFW.
Clik here to view.

Handy delegate shortcut hides important details: The hidden delegate

One of my colleagues was having trouble with a little tool he wrote. I installed a low-level keyboard hook following the code in this article, but it crashes randomly. Here's what I know so far: I...

View Article

Image may be NSFW.
Clik here to view.

Insightful graph: The ship date predictor

The best graphs are the ones that require no explanation. You are just told what the x- and y-axes represent, and the answer just jumps out at you. One of the greatest graphs I've seen at Microsoft is...

View Article

Image may be NSFW.
Clik here to view.

Microspeak: DRI, the designated response individual

Someone sent a message to a peer-to-peer discussion group and remarked, "This is critical. I'm a DRI at the moment and have some issues to fix." The term DRI was new to many people on the mailing list...

View Article


Image may be NSFW.
Clik here to view.

Rules can exist not because there's a problem, but in order to prevent future...

I lost the link, but one commenter noted that the Read­File function documentation says Applications must not read from, write to, reallocate, or free the input buffer that a read operation is using...

View Article


Image may be NSFW.
Clik here to view.

The Windows 95 I/O system assumed that if it wrote a byte, then it could read...

In Windows 95, compressed data was read off the disk in three steps. The raw compressed data was read into a temporary buffer. The compressed data was uncompressed into a second temporary buffer. The...

View Article

Image may be NSFW.
Clik here to view.

Debugging walkthrough: Access violation on nonsense instruction, episode 3

A colleague of mine asked for help debugging a strange failure. Execution halted on what appeared to be a nonsense instruction. eax=022b13a0 ebx=00000000 ecx=02570df4 edx=769f4544 esi=02570dec...

View Article

Image may be NSFW.
Clik here to view.

How do I enumerate remembered connections that are not currently connected?

Harry Johnston wanted to know how to get a list of remembered (but not currently connected) drive mappings. The idea here is to make a tweak to the Little Program. Start with what we had and make...

View Article

Image may be NSFW.
Clik here to view.

Microspeak: move the needle

The phrase move the needle is part of general business jargon, but it is very popular here at Microsoft. You need to know what it means, and more importantly, you need to be willing to throw it around...

View Article


Image may be NSFW.
Clik here to view.

I saved some files into the Program Files directory, and now they're gone!

A customer reported that they saved some files in the Program Files directory, but when they went back to check, the files were gone! What happened? What most likely happened is UAC Virtualization....

View Article

Image may be NSFW.
Clik here to view.

When I change the icon in my shortcut, why doesn't it update on the screen?

A customer was having trouble updating the icon in one of their shortcuts. Here's what they shared with us: i_shell_link->SetIconLocation(icon_file.value().c_str(), 0); "Changing the icon from the...

View Article


Image may be NSFW.
Clik here to view.

Using an intermediate library to make the main library retargetable

A customer was developing a static library targetting both Windows XP Win32 applications and universal Windows apps. (This was before Windows XP reached end-of-life.) Our library uses critical...

View Article

Image may be NSFW.
Clik here to view.

I guess this explains why Warren Buffett hasn't retired

Microsoft provides to its employees a retirement calculator that is more detailed than the kinds you can find on the Internet. After gathering all sorts of information, including your savings and...

View Article


Image may be NSFW.
Clik here to view.

Cynical interpretations of various project milestones

Official nameCynical interpretationCoding milestoneWriting new bugsIntegration milestoneMerging bugs from other teamsStabilization milestoneFixing bugs

View Article

Image may be NSFW.
Clik here to view.

Raymond's Windows Universal Samples API concordance

If you want to find an SDK sample that uses a particular feature of the Universal Windows Platform, you can try my Windows Universal Samples API concordance on...

View Article

Image may be NSFW.
Clik here to view.

How do you get network connectivity from the worst PC in the world?

Some time ago, I wrote about the two worst PCs ever. The worst PC of all time, according to PC World magazine was the Packard Bell PC. As installed at the factory, the computer came with every single...

View Article
Browsing all 3085 articles
Browse latest View live


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