Welcome to MSDN Blogs Sign in | Join | Help

January 2004 - Posts

"Section 419" scammers arrested in Netherlands; Danish flag flies proudly

Dutch police have arrested 52 people suspected of defrauding gullible Internet users in one of the largest busts of the infamous "Nigerian e-mail" scam. Hooray for the Dutch police. Their next target: Web sites that illustrate a Dutch article with the
Posted by oldnewthing | 9 Comments
Filed under:

The format of string resources

Unlike the other resource formats, where the resource identifier is the same as the value listed in the *.rc file, string resources are packaged in "bundles". There is a rather terse description of this in Knowledge Base article Q196774 . Today we're
Posted by oldnewthing | 34 Comments
Filed under:

How do we decide what features make it into a product?

David Lemson has an excellent article titled How do we decide what features make it into Exchange? . Although he's talking about Exchange specifically, the general principles apply to many products.
Posted by oldnewthing | 0 Comments
Filed under:

Integer overflow in the new[] operator

Integer overflows are becoming a new security attack vector. Mike Howard's article discusses some of the ways you can protect yourself against integer overflow attacks . One attack vector he neglects to mention is integer overflow in the new[] operator.
Posted by oldnewthing | 21 Comments
Filed under:

Ikea walk-through

Jeff Davis tipped me off to this Ikea walk-through . Frustratingly, the walkthrough doesn't include any cheat codes. Even though Ikea was founded by a Swede, its company colors match the Swedish national colors, all its product names are Swedish, and
Posted by oldnewthing | 29 Comments
Filed under:

Another reason not to do anything scary in your DllMain: Inadvertent deadlock

Your DllMain function runs inside the loader lock, one of the few times the OS lets you run code while one of its internal locks is held. This means that you must be extra careful not to violate a lock hierarchy in your DllMain; otherwise, you are asking
Posted by oldnewthing | 17 Comments
Filed under:

Passenger announcements in the airport

While in Seattle-Tacoma International Airport yesterday, waiting for my flight to eventually be cancelled due to weather, then waiting for a replacement itinerary (um, the weather is the same at the destination; doesn't matter which plane you take), then
Posted by oldnewthing | 4 Comments
Filed under:

Some reasons not to do anything scary in your DllMain

As everybody knows by now, you're not supposed to do anything even remotely interesting in your DllMain function. Oleg Lvovitch has written two very good articles about this, one about how things work , and one about what goes wrong when they don't work
Posted by oldnewthing | 24 Comments
Filed under:

Undermining your own proclamation

I'm pulling for the Mars rovers as much as the next geek, but you still have to scratch your head at the following statement : Charles Elachi, the JPL director, said: "I am completely confident, without any hesitation, that I think we will get that rover
Posted by oldnewthing | 4 Comments
Filed under:

Blog going on autopilot for a while

I will be out of town for a few weeks, so I have set my blog on autopilot. There will still be an article every weekday at 7am Pacific time (assuming the autopilot machine doesn't suffer a power outage or something), but I won't be around (much) to respond
Posted by oldnewthing | 3 Comments
Filed under:

The hollow brush

What is the hollow brush for? The hollow brush is a brush that doesn't do anything. You can use it when you're forced to use a brush but you don't want to. As one example, you can use it as your class brush. Then when your program stops responding and
Posted by oldnewthing | 7 Comments
Filed under:

David Hasselhoff's daughters normal in every way

(Forwarded to me my a friend who is apparently fascinated with David Hasselhoff.) David Hasselhoff says his daughters hate his music and change the channel whenever Knight Rider comes on the TV . Okay, I defended the Germans last week, but this one baffles
Posted by oldnewthing | 10 Comments
Filed under:

German as RPN

It should be noted that "Reverse Polish Notation" is named in honor of the Polish logician Jan Lukasiewicz , who developed prefix notation, wherein the operator comes before the operands. Postfix notation proved more useful for stack-based arithmetic
Posted by oldnewthing | 23 Comments
Filed under:

In defense of the German language

Some commenters deplored the inflectional complexity of the German language . I find the complexity reassuring rather than offputting, because it means that you always know where to find the functional parts of the sentence. The lack of inflectional complexity
Posted by oldnewthing | 24 Comments
Filed under:

The white flash

If you had a program that didn't process messages for a while, but it needed to be painted for whatever reason (say, somebody uncovered it), Windows would eventually lose patience with you and paint your window white. Or at least, that's what people would
Posted by oldnewthing | 12 Comments
Filed under:

German, the language of love?

Love lures French kids to German : Come and learn German - a language of love! Hundreds of advertisements in France this week will promote the unusual message to try to woo teenagers to a language they often consider difficult and ugly. "Language is the
Posted by oldnewthing | 35 Comments
Filed under:

What happened to DirectX 4?

If you go through the history of DirectX, you'll see that there is no DirectX 4. It went from DirectX 3 straight to DirectX 5. What's up with that? After DirectX 3 was released, development on two successor products took place simultaneously: a shorter-term
Posted by oldnewthing | 19 Comments
Filed under:

Cell phones: Can't live with 'em, can't live without 'em, but maybe can ban 'em

Cell phones top the latest Lemelson-MIT Invention Index survey , asking people to name the invention that you hate the most yet cannot live without. [Link fixed 8:22am]
Posted by oldnewthing | 2 Comments
Filed under:

Fixing security holes in other programs

Any crash report that involves a buffer overrun quickly escalates in priority. The last few that came my way were actually bugs in other programs that were detected by Windows. For example, there were a few programs that responded to the LVN_GETDISPINFO
Posted by oldnewthing | 36 Comments
Filed under:

What tools should I assume everybody has?

My code samples assume you are using the latest header files from the Platform SDK (free download), the one that includes support for Win64. If you have an older SDK then you won't have various new data types like UINT_PTR and INT_PTR and should just
Posted by oldnewthing | 24 Comments
Filed under:

ia64 - misdeclaring near and far data

As I mentioned yesterday, the ia64 is a very demanding architecture. Today I'll discuss another way that lying to the compiler will come back and bite you. The ia64 does not have an absolute addressing mode. Instead, you access your global variables through
Posted by oldnewthing | 22 Comments
Filed under:

Uninitialized garbage on ia64 can be deadly

On Friday, we talked about some of the bad things that can happen if you call a function with the wrong signature. The ia64 introduces yet another possible bad consequence of a mismatched function signature which you may have thought was harmless. The
Posted by oldnewthing | 23 Comments
Filed under:

How can a program survive a corrupted stack?

Continuing from yesterday : The x86 architecture traditionally uses the EBP register to establish a stack frame. A typical function prologue goes like this: push ebp ; save old ebp mov ebp, esp ; establish new ebp sub esp, nn*4 ; local variables push
Posted by oldnewthing | 10 Comments
Filed under:

Aw, poor guy, he's so depressed

I suspect Tanzi isn't going to get much sympathy from, well, anybody. Parmalat's Tanzi is "Depressed" Lawyers for Calisto Tanzi, the jailed head of now-bankrupt European food and dairy group Parmalat , claim that he is "depressed" in prison, constantly
Posted by oldnewthing | 2 Comments
Filed under:

Google just keeps adding stuff

ResearchBuzz pointed out still more google search keywords like area codes, UPC, and whois. I'm still waiting for PLU , those code numbers on the food in the produce aisle. Here's a brief history of PLU codes for those geeky enough to care (like me).
Posted by oldnewthing | 3 Comments
Filed under:

What can go wrong when you mismatch the calling convention?

Believe it or not, calling conventions is one of the things that programs frequently get wrong. The compiler yells at you when you mismatch a calling convention, but lazy programmers will just stick a cast in there to get the compiler to "shut up already".
Posted by oldnewthing | 75 Comments
Filed under:

The history of calling conventions, part 5: amd64

The last architecture I'm going to cover in this series is the AMD64 architecture (also known as x86-64). The AMD64 takes the traditional x86 and expands the registers to 64 bits, naming them rax, rbx, etc. It also adds eight more general purpose registers,
Posted by oldnewthing | 32 Comments
Filed under:

If you know Swedish, the world is funnier

As I was driving through Seattle the other day, I saw a sign for a personal storage company called "Stor-More". I then had to laugh because in Swedish, "Stor-Mor" means "Big Momma". It's not restricted to Swedish. On my trip to Germany last year, my travelling
Posted by oldnewthing | 31 Comments
Filed under:

The history of calling conventions, part 4: ia64

The ia-64 architecture (Itanium) and the AMD64 architecture (AMD64) are comparatively new, so it is unlikely that many of you have had to deal with their calling conventions, but I include them in this series because, who knows, you may end up buying
Posted by oldnewthing | 35 Comments
Filed under:

Why can't I GetProcAddress a function I dllexport'ed?

The dllexport attribute tells the linker to generate an export table entry for the specified function. This export entry is decorated . This is necessary to support dllexport ing of overloaded functions. But it also means that the string you pass to GetProcAddress
Posted by oldnewthing | 17 Comments
Filed under:

"Friends" is so trendsetting

The characters on the television program "Friends" are apparently trendsetters in the use of the word "so" . [People with way too much time on their hands] spent a year going through transcripts from each episode of the first eight seasons of Friends
Posted by oldnewthing | 9 Comments
Filed under:

What's old is new again... well it's still old

The wonderful people who ran blogs.gotdotnet.com, as a parting gift, migrated all the old content into this blog. They're awesome, aren't they?
Posted by oldnewthing | 3 Comments
Filed under:

Is there an exclusionary rule in Sweden?

According to Friday's Klartext (note: link valid only for one week, then it gets overwritten by the next Friday's Klartext), Vi ska börjar klartext med berätta att en åklagare nu ska undersöka om fler än två hundra poliser
Posted by oldnewthing | 18 Comments
Filed under:

Why do member functions need to be "static" to be used as a callback?

As we learned yesterday , nonstatic member functions take a secret "this" parameter, which makes them incompatible with the function signature required by Win32 callbacks. Fortunately, nearly all callbacks provide some way of providing context. You can
Posted by oldnewthing | 17 Comments
Filed under:

Ten-year-old + Microsoft Flight Simulator = terrorist

Apparently a ten-year-old who put Microsoft Flight Simulator on his Christmas wish-list became the subject of a terrorism investigation . (Warning: I suspect that link will go stale in a week, so read it while you still can.) As always, The Register puts
Posted by oldnewthing | 11 Comments
Filed under:

It's called "proofreading", give it a shot why don't you

Like everybody else, I was checking out the new MSN home page and I clicked over to the tour . And right there as their top headline in the sample web page, it says, "Wierd items of the future". Ahem. It's spelled w-e-i-r-d. And on all of the MSN properties,
Posted by oldnewthing | 28 Comments
Filed under:

The history of calling conventions, part 3

Okay, here we go: The 32-bit x86 calling conventions. (By the way, in case people didn't get it: I'm only talking in the context of calling conventions you're likely to encounter when doing Windows programming or which are used by Microsoft compilers.
Posted by oldnewthing | 35 Comments
Filed under:

Budget cuts strike Swedish radio

Alas, budget cuts over at Sveriges Radio have reduced the staff of Klartext , the Swedish news program presented in easy Swedish, from three to two, so they won't be able to provide text summaries of the radio show. I had been using the summaries to help
Posted by oldnewthing | 4 Comments
Filed under:

The history of calling conventions, part 2

Foreshadowing: This information will actually be useful in a future discussion. Well, not the fine details, but you may notice something that explains... um... it's hard to describe. Just wait for it. Curiously, it is only the 8086 and x86 platforms that
Posted by oldnewthing | 15 Comments
Filed under:

Words I'd like to ban in 2004

It seems to be fashionable to do a "top words" list this time of year. We have Google 2003 Zeitgeist , Top Yahoo! Searches 2003 , Merriam-Webster's Words of the Year for 2003 , YourDictionary.com's Top Ten Words of 2003 , Lake Superior State University's
Posted by oldnewthing | 39 Comments
Filed under: ,

Why does the copy dialog give such horrible estimates?

Because the copy dialog is just guessing. It can't predict the future, but it is forced to try. And at the very beginning of the copy, when there is very little history to go by, the prediction can be really bad. Here's an analogy: Suppose somebody tells
Posted by oldnewthing | 34 Comments
Filed under:

Why does the x86 have so few registers?

One of the comments to my discussion of 16-bit calling conventions wondered why the 8086 had so few registers . The 8086 was a 16-bit version of the even older 8080 processor, which had six 8-bit registers, named A, B, C, D, E, H, and L. The registers
Posted by oldnewthing | 23 Comments
Filed under:

The history of calling conventions, part 1

The great thing about calling conventions on the x86 platform is that there are so many to choose from! In the 16-bit world, part of the calling convention was fixed by the instruction set: The BP register defaults to the SS selector, whereas the other
Posted by oldnewthing | 27 Comments
Filed under:

Don't trust the return address

Sometimes people ask, "So I know how to get my return address [use the _ReturnAddress() intrinsic ]; how do I figure out what DLL that return address belongs to?" Beware. Even if you figure out which DLL the return address belongs to [use GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS)
Posted by oldnewthing | 17 Comments
Filed under:
 
Page view tracker