Showing results for December 2014 - Page 2 of 3 - The Old New Thing

Dec 18, 2014
0
0

How can I query the location of the taskbar on secondary monitors?

Raymond Chen
Raymond Chen

A customer wanted to know how to get the location of the taskbar on secondary monitors. "I know that will tell me the location of the taskbar on the primary monitor, but how do I get its location on secondary monitors?" We asked the customer what their actual problem is, where they think that determining the taskbar location on secondary monitors...

Code
Dec 17, 2014
0
1

It rather involved being on the other side of this airtight hatchway: Account vulnerable to Active Directory administrator

Raymond Chen
Raymond Chen

A security vulnerability report came in that went something like this: Disclosure of arbitrary data from any user An attacker can obtain arbitrary data from any user by means of the following steps: There's no point continuing, because the first step assumes that you are on the other side of the airtight hatchway. If you have compromised t...

Other
Dec 15, 2014
0
0

When corporate policies meet precision scientific equipment

Raymond Chen
Raymond Chen

One of my colleagues used to work as an IT consultant, and one of his clients was a tobacco company. Since they were a tobacco company, the company policy on smoking was "You can smoke anywhere, any time." "Anywhere" includes the labs. The labs with very expensive precision scientific equipment. My colleague told me that this policy meant that th...

Non-Computer
Dec 15, 2014
0
0

Notes on calculating constants in SSE registers

Raymond Chen
Raymond Chen

There are a few ways to load constants into SSE registers. Load them from memory. Load them from general purpose registers via . Insert selected bits from general purpose registers via . Try to calculate them in clever ways. Loading constants from memory incurs memory access penalties. Loading or inserting them from general purpose reg...

Code
Dec 12, 2014
0
0

Detecting whether a SID is well-known SID

Raymond Chen
Raymond Chen

You might think that the function would tell you whether a SID is well-known, but it doesn't. Rather, it tells you whether a SID exactly matches the well-known SID you specified. For example, you can ask, "Is this the Authenticated Users SID?" or "Is this the Everyone SID?" But you can't ask, "Is this any type of well-known SID?" I guess you co...

Code
Dec 11, 2014
0
0

What states are possible in a DRAWITEMSTRUCT structure?

Raymond Chen
Raymond Chen

The structure has an member which contains a number of bits describing the state of the item being drawn. How do those states map to the underlying control? Most of the states are rather obvious. For a list box item to be selected, it means that the item is part of the selection. But what does selected mean for a button? Since people like table...

Code
Dec 10, 2014
0
0

If you get a procedure address by ordinal, you had better be absolutely sure it's there, because the failure mode is usually indistinguishable from success

Raymond Chen
Raymond Chen

A customer reported that the function was behaving strangely. We have this code in one of our tests: Recently, this test started failing in bizarre ways. When we stepped through the code, we discovered that ends up calling instead of . The first time we try to test , we get stack corruption because has a different function prototype from...

Code
Dec 9, 2014
0
1

The psychology of confirmation, or something, I don't know what to call it

Raymond Chen
Raymond Chen

There is probably a name for this phenomenon. I will illustrate it below. "Is there a way to configure the system to do X?" — Go to the Y dialog and select Z. "It doesn't work." — I just tried it. It works for me. I'm using ⟨configuration details⟩. "Thanks. It's working."

Other