The Old New Thing

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

A customer wanted to know how to get the location of the taskbar on secondary monitors. "I know that SHApp­Bar­Message 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 ...
Comments are closed.0 0
Code

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

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 ...

If you set up roaming profiles, you are expected to set up each machine identically, for the most part

A customer discovered the following behavior when they set up roaming user profiles on their domain. Consider two machines, 1 and 2. An application A is installed on machine 1, but not machine 2. A user with a roaming profile logs onto machine 1 and pins application A to the taskbar. That user then logs off ...

When corporate policies meet precision scientific equipment

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 ...

Notes on calculating constants in SSE registers

There are a few ways to load constants into SSE registers. Load them from memory. Load them from general purpose registers via movd. Insert selected bits from general purpose registers via pinsr[b|w|d|q]. Try to calculate them in clever ways. Loading constants from memory incurs memory access penalties. Loading or inserting them ...
Comments are closed.0 0
Code

Detecting whether a SID is well-known SID

You might think that the Is­Well­Known­Sid 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...
Comments are closed.0 0
Code

What states are possible in a DRAWITEMSTRUCT structure?

The DRAW­ITEM­STRUCT structure has an item­State 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 ...
Comments are closed.0 0
Code

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

A customer reported that the Get­Proc­Address 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 pfnFoo ends up calling Bar instead of Foo. The first time we try to test pfnFoo, we get stack corruption ...
Comments are closed.0 0
Code

Feedback usabilla icon