Posts by this author

Sep 1, 2004
Post comments count0
Post likes count0

How to find the Internet Explorer binary

For some reason, some people go to enormous lengths to locate the Internet Explorer binary so they can launch it with some options. The way to do this is not to do it. If you just pass "IEXPLORE.EXE" to the ShellExecute function [link fixed 9:41am], it will go find Internet Explorer and run it. ShellExecute(NULL, "open", "iexplore.exe", ...

Code
Aug 31, 2004
Post comments count0
Post likes count0

Reading a contract from the other side: Application publishers

In an earlier article, I gave an example of reading a contract from the other side. Here's another example of how you can read a specification and play the role of the operating system. I chose this particular example because somebody wanted to do this and didn't realize that everything they needed was already documented; they just needed to look...

Code
Aug 30, 2004
Post comments count0
Post likes count0

Importance of alignment even on x86 machines, part 2

The various Interlocked functions (InterlockedIncrement, and so on) require that the variable being updated be properly aligned, even on x86, a platform where the CPU silently fixes unaligned memory access invisibly. If you pass an unaligned pointer to one of the Interlocked functions, the operation will still succeed, but the result won't be ato...

History
Aug 30, 2004
Post comments count0
Post likes count0

The sociology of the mobile phone

It has become obvious by now that the mobile phone has changed the way people interact. These two papers were forwaded to me by a colleague, whose summary I am shamelessly lifting from heavily. First is a short paper titled Exploring the implications for social identity of the new sociology of the mobile phone. The much more fascinating (and ...

Non-Computer
Aug 27, 2004
Post comments count0
Post likes count0

Importance of alignment even on x86 machines

Sometimes unaligned memory access will hang the machine. Some video cards do not let you access all the video memory at one go. Instead, you are given a window into which you can select which subset of video memory ("bank") you want to see. For example, the EGA video card had 256K of memory, split into four 64K banks. If you wanted to access memo...

History
Aug 26, 2004
Post comments count0
Post likes count1

Why do some structures end with an array of size 1?

Some Windows structures are variable-sized, beginning with a fixed header, followed by a variable-sized array. When these structures are declared, they often declare an array of size 1 where the variable-sized array should be. For example: typedef struct _TOKEN_GROUPS { DWORD GroupCount; SID_AND_ATTRIBUTES Groups[ANYSIZE_ARRAY]; } TOKEN...

Code
Aug 25, 2004
Post comments count0
Post likes count0

Why can’t you treat a FILETIME as an __int64?

The FILETIME structure represents a 64-bit value in two parts: typedef struct _FILETIME { DWORD dwLowDateTime; DWORD dwHighDateTime; } FILETIME, *PFILETIME; You may be tempted to take the entire FILETIME structure and access it directly as if it were an __int64. After all, its memory layout exactly matches that of a 64-bit (little-endian)...

CodeTime
Aug 24, 2004
Post comments count0
Post likes count0

Beware of non-null-terminated registry strings

Even though a value is stored in the registry as REG_SZ, this doesn't mean that the value actually ends with a proper null terminator. At the bottom, the registry is just a hierarchically-organized name/value database. And you can lie and get away with it. Lots of people lie about their registry data. You'll find lots of things that should be...

Code
Aug 23, 2004
Post comments count0
Post likes count0

The kooky STRRET structure

It was designed when computers were a lot slower.

History
Aug 23, 2004
Post comments count0
Post likes count0

Finished competing in your event? Let the games begin!

Ten thousand human beings in peak physical condition. All in one dormitory complex. With 130,000 free condoms. Let the games begin! And you have to tip your hat (tam?) to The Scotsman for finding an athlete named "Randy Jones" for this article.

Non-Computer