Sometimes it’s hard to be a developer…

I’ve spent a while adding new features to my FTP client, and you’ll get to see some of that in a month or two, when it all comes together as a release.

One of the latest is “drag and drop” – and I went searching for advice on how to do the drag and drop from “virtual folders” – i.e. when the files don’t exist locally until you actually do the drop.  So you can’t do the easy method of passing a file location to the drop target.  I found a great document that perfectly describes what I need to do:

“Handling Shell Data Transfers”

Great, clear, simple advice (simple, if you’re a developer) on how to do drag and drop – and it serves a second purpose, that of cut/copy and paste.

So, I get the drag and drop working, and then I go to look at the cut/copy and paste, and add the few lines of extra code needed.

It doesn’t work.

I realise quickly that the following lines are the problem:

7. When the paste is complete, the target calls the IDataObject::SetData method with the CFSTR_PASTESUCCEEDED format set to DROPEFFECT_MOVE.

8. When the source’s IDataObject::SetData method is called with the CFSTR_PASTESUCCEEDED format set to DROPEFFECT_MOVE, it must check to see if it also received the CFSTR_PERFORMEDDROPEFFECT format set to DROPEFFECT_MOVE. If both formats are sent by the target, the source will have to delete the data. If only the CFSTR_PASTESUCCEEDED format is received, the source can simply remove the data from its display. If the transfer fails, the source updates the display to its original appearance.

No matter how much I try, I can’t get CFSTR_PASTESUCCEEDED into my SetData method.  I get the CFSTR_PERFORMEDDROPEFFECT format, so I know I’m setting it up correctly, but I get no CFSTR_PASTESUCCEEDED.

Days of trying different code, different ways of triggering the paste, go by, and I finally realise that there is no CFSTR_PASTESUCCEEDED coming from Windows Explorer – and since this is the de-facto drop target, that’s exactly the model that is going to be followed by every other drop target I’m going to meet.

I’d really love to tell Microsoft about this, and get the documentation fixed.  This used to be dead easy – I’d click on the “SDK Feedback” button, and send an email.

No “SDK Feedback” button any more.

Why not?  Where did it go?

What’s in its place?  Nothing terribly useful – a link to a web page that I can fill in.

Can I attach a file of source code to demonstrate this?


Can I italicise words that are important?


Does the web page offer any extra capabilities that can’t be done in an email?


So, why did this happen?  Beats me.

I finally decided to give up and ignore CFSTR_PASTESUCCEEDED entirely.  It seems superfluous.  I do find it thoroughly irritating that my time is wasted once again, because I tried to follow specific documentation that turned out not just to be wrong, but to have unnecessary, and incorrect, extra detail.  This isn’t the first time (the last time was when I was following documentation on how to close SSL connections), and I doubt that it will be the last.

Some guidelines about fax.

Susan Bradley, SBS Diva and Security Guru Extraordinaire, posts about some guidelines for making your fax modems work reliably over at

This reminds me that I am continually amazed by people who call our company asking for instructions on faxing us – not because they want to fax us, but because of why they want to fax us.

Their perception is that fax is more secure than email.

I’ll pause while you think on that.


Okay, so here we go…

  • Data Encryption: A fax cannot be encrypted, but an email can. Sure, there are some encrypting fax machines and/or software, but the ones I’ve seen all require that your peer has the same machine / software; email has standardised encryption methods – the most common of which is S/MIME.
  • Peer identification: An email can be diverted by hijacking the DNS settings in the sender’s DNS servers for the recipient’s domain – possible, but hardly trivial (and resolved by using encryption with a peer whose certificate you know). A fax can’t be so easily diverted, but when a company moves, its phone number gets assigned to someone else. That explains why we get a number of faxes every week for a rock quarry; some of these include ordering information.
  • Non-repudiation: again, S/MIME and others come into their own here, by providing the ability to sign an email. You can’t sign a fax, except with a hand signature that is so ludicrously easy to duplicate (cut it out of a previous fax, and paste it onto the next one).
I’m normally all over the idea that users should be using solutions with which they are comfortable, and whose failure modes and security mechanisms they are already familiar with – but it seems like too few people have ever considered these issues for facsimile machines, and they’ve all been told that email is unsecure.

By now, we should all be comfortable sending signed and encrypted messages, using self-signed certificates.

Update 2006-02-07: Prudential’s customers have their data sent, by the thousands, to a herbal remedy store, because the two fax numbers differ by only a digit.  Private information should be sent through secure channels – fax is not a secure channel.

Are you Crypto Cat or Decipher Dog?

Me, I want to grow up to become CSS Sam.

What am I talking about?  This site, of course.

Funny, it may be, as a concept, but if your kids show any interest in codes or ciphers (and I did when I was, ooh, seven), there’s a lot of fun to be had at the “Games” section.  Build your own cipher machines – yay!

Feb 3, 2006 – Virus destroys data on a million machines…

Okay, so that’s a future headline, and it’s possible / likely that the damage isn’t going to be quite that bad.  But the virus reports back to a home web site, increasing a counter as it does… the counter is well past a million.  [Okay, so that number is likely to have been added to by people trying to make fun]

However, the virus under discussion (as usual, it goes by several names, including Nyxem, Mywife.E, etc) is something that doesn’t come along too often lately – a deliberately destructive virus.

It’s programmed to trigger on Feb 3, 2006, and every third of the month thereafter.  You have only a few days in which to check that you aren’t engaging in the sort of behaviour that gives you this virus, and that you have scanned your systems, and removed it if it has been installed.

Microsoft’s {Malicious Software} {Removal Tool} won’t help you, because although it will remove the virus, it will only be updated on February 14, its regularly scheduled release date.  Not really the best idea in terms of timing.

Microsoft does have tools available to protect you, though – there’s a page at that describes the virus and gives manual detection and removal instructions, as well as pointing you to the beta programmes for Live Safety and OneCare, which are both already able to detect and remove the virus automatically.

Behavioural changes you should make – don’t open attachments.  Really, just don’t.  Random other individuals do not have naked pictures of your wife, and those pictures from the Kama Sutra, well, they aren’t.

Even if an email comes from someone you know, don’t open the attachment.  Really, just don’t.  If you still feel like you absolutely have to, please at least call them and verify that they sent you the attachment, and to ensure that the attachment you see is the attachment they sent.  Ideally, exchange digital certificates and use signed mail – that still won’t totally protect you if a virus can access your friends’ email application, but it’s a damn good start.

Peculiar article on "new kind of bug".

So, I’m cruising the security news feeds, and I come across this interesting little article: Microsoft to hunt for new species of Windows bug

I really don’t think the article is all that fair – maybe Kevin Kean and Debby Fry Wilson weren’t able to convince the journalist to write the whole side of the story, I don’t know.

Certainly, while I was at Microsoft, new code was run through code-review by real, intelligent people, with a keen eye to ensuring that it could not be abused; new features were run through threat-modeling by a Security PM, whose job it was to find all kinds of avenues of misuse and abuse, and rate mitigiations and risk.  I don’t believe that approach was unique to IIS.

So, far from this being something that’s completely new to MS, and has never been addressed, this is something that’s looked at for new code all the time.

Old code, I’m not so sure of, and maybe the article is right in that regard, that old code is not scanned rigorously for unintended uses.

What software company out there is currently scanning through old code for such unintended uses as a regular part of their security process?

Okay, so we do it here at Texas Imperial Software, every time a new and interesting abuse is revealed against someone else’s software, but that’s a much smaller segment of code.

Statistics and the news.

News coverage gets me irritated whenever statistics are mentioned.

This morning’s example (paraphrasing): “South African gays are upset about discrimination in blood donation; their donations are being refused, despite the fact that the majority of HIV cases in the country are in heterosexual women.”

I’m not wondering if there really is or isn’t a case of discrimination going on there; what irritated me is that there’s actually no valid statistical link between the two clauses of the sentence.

That’s one example; it’s on NPR, so I’d have thought they’d take a moment to get it right. Here’s another example from New Scientist magazine, who should know better (I’m paraphrasing again):

“A survey of accident victims indicates that more of them have cellphones than the general population, demonstrating that people who have cellphones are more likely to have accidents.”

No, no, no. It demonstrates that people who have accidents are more likely to have cellphones; maybe cellphones appeal to people who drive aggressively!

Notice that neither of my examples are cases where the statistic actually disproves the claim made in the accompanying article; only that they do not lend any valid credence to the claim.

What’s your favourite example of – not a maliciously misused statistic, so much – a statistic that, to the educated reader/listener/viewer, does nothing to prove the claim being made?

A quick guide to PC SAFETY – follow up on MS06-003 / CreateItemFromTemplate

After yesterday’s post on MS06-003 interfering with my use of CreateItemFromTemplate, I figured I should take advantage of the 1-866-PCSAFETY line provided by Microsoft for resolving bugs caused by security patches.

Other than a mildly confusing list of choices, which didn’t quite cover the case I wanted, but allowed me to select “talk to a human”, I’ve found this to be a really good tech-support experience.  Hold times were less than five minutes in most cases, with the longest being eight minutes, and the questions asked were all to the point.  The bug was confirmed as being present, a workaround was offered (don’t use the second parameter, the item will be created in the drafts folder anyway), and the prospect of a quick-fix was offered once it is developed.

I found it very interesting to see that the first option in the voice-mail is a kind of “issue-of-the-day” message, offering information on resolving whatever virus or spyware infection appears to be en vogue.

Option two allows you to request a fax of information on how to protect your PC – a brief reminder that there are some people who still prefer to do business without the Internet as much as possible.

Option three – the “talk to a person” option – gives you the further option of whether you’re calling about personal software, professional software, or developer issues.

Wireless PC Lock – nice device, crummy software.

I’ve been playing lately with a little device I picked up in the local Fry’s store. It’s a “Wireless PC Lock”, and the idea is that there’s a pair of pieces – a USB stick, and what you might charitably call a fob (although when I tried to use it on my key ring, the button stayed pressed in my pocket, and I wore out the battery).

This is really a sweet little idea – a presence device so that you don’t forget to lock your PC when you walk away (you do lock your PC whenever you’re away, don’t you?)

Unfortunately, the software isn’t very well thought-out or well written. The device is capable of unlocking the PC as well as locking it, which is not good if you hang out on the other side of the wall from your PC. For me, that’s out in the corridor, but I don’t feel comfortable taking the chance that it’ll unlock as I’m standing chatting in an area where I can’t see my PC.

This is where we come to the second problem. Those sharp-eyed among you will note that you can’t programmatically unlock the PC. You have to enter a username and password to do so. The obvious way the developers on the Wireless PC Lock came up with for dealing with this was to pretend to lock the system – they put up a picture of dolphins (because dolphins and security – well, if I have to explain it…)) over every one of your programs, and they do their level best to prevent you from getting to anything but the dolphins until you’ve typed in your password.

I’m a suspicious person at heart – it can’t be too tricky to get around this, and my bet is that you simply insert a CD-ROM with Autoplay (although I do have that disabled, too) that runs a tool to kill the process that locks the system. It’s not too difficult to figure out the process.

So, I’m thinking it shouldn’t be too difficult to write a program that does the right thing – if you disappear from radio sight for a few seconds, or you unplug the USB stick, the system should lock – proper LockWorkStation lock. When you come back in range… nothing. You have to unlock manually.

This is a good thing, because the radio device has only a two-byte serial code that prevents others from getting the same number device as you – but those odds just aren’t good enough to act as an authentication factor. They are sufficient to act as a “presence not detected” factor.

Plus, I want my program to run as a restricted user – I don’t need to be administrator to lock my terminal, I shouldn’t have to be administrator to work with the Wireless PC Lock. Tune in here again in a few days, and we’ll see how I’ve done with my goal of producing a simple, more secure version of the Wireless PC Lock software.

Issues with MS06-003 and Outlook 2003 Scripts.

I have a script that I use at work to send out emails every few days.

Last night, we installed MS06-003 on my workstation’s copy of Outlook, and today, my script fails.

The key function appears to be either CreateItemFromTemplate creating messages into the drafts folder, or GetDefaultFolder, supplying an object to the drafts folder.

Here’s a snippet…

Set oFolder = olApp.Session.GetDefaultFolder(olFolderDrafts)
Set oMail = olApp.CreateItemFromTemplate( oTemplate, oFolder )

The failure doesn’t occur on first running through this, but on the second hit of GetDefaultFolder, where the VB drops out with the helpful message: “Z:\Script\mailout.vbs(176, 3) (null): The server threw an exception.”

The underlying error number is -2147417851 – 0x80010105, RPC_E_SERVERFAULT. [I included all forms to make it easier for this article to pop up in searches.]

I don’t currently see this listed as a “known issue” for MS06-003.  Has anyone else seen this issue?

Programmer Hubris Part 2: I’ll get you, and your little dog, too.

Apple’s QuickTime (for Mac & Windows) vulnerable to flawed images.

Great – hot on the heels of a WMF vulnerability (“why does Microsoft keep having buffer overflows when the rest of the industry doesn’t?”), we get a TGA/TIFF/QTIF/GIF/media-file overflow vulnerability in QuickTime – the warning seems almost designed to get lost in the noise surrounding Microsoft’s regular updates – but that would be a cynical view.

When I visited the page referenced above, which is at Apple’s own site, I could not find a link to the patch, or to download the current version of QuickTime for Windows.  I’ve been doing this “computer thing” for a couple of decades now, and so has my cube-neighbour, who went looking for it as well, without success.  [Hopefully Apple will read this, and edit the page so that by the time you read this, the link is prominent and obvious, but if you can’t find it, read on…]

You can find the current version of QuickTime for Windows at

<PThere are a number of disadvantages to this link, though:

  1. This is a full replacement, not a patch.
  2. The site does not say whether you are downloading the fixed 7.0.4 version, or an earlier version with the flaws still in it.
  3. The download includes iTunes, and while I can imagine QT to be necessary to view, say, presentations from vendors, iTunes is definitely not necessary for our corporate use. Nor do I want it for my personal use.
  4. The download file is called ‘iTunesSetup.exe’, and its version information declares it to be the setup program for iTunes – no mention of QuickTime is made here.
  5. Even after downloading the setup executable, you cannot tell what version you have downloaded without running it first. The version number on the setup file ‘iTunesSetup.exe’ is
  6. The setup program goes through a few unpacking steps before aborting if you are not an administrator, so a restricted user cannot tell if this is the current 7.0.4 version of QuickTime.
  7. If you only want QuickTime, you have to install iTunes and QuickTime and then remove iTunes. The installation itself doesn’t require a reboot – but removing iTunes does. So, effectively, if you want to install QuickTime, you must reboot, or you must accept iTunes.
  8. At no point in the installation are you told what version of QuickTime is being installed.

Finally, yes, the version of QuickTime at the Apple download link is 7.0.4, which is supposed to include the patches against remote exploit through image vulnerabilities.

The main thrust of this rant has been that this is really not so useful in terms of a security update – but there’s a subtle theme throughout – in order to get a tool that I want, I have to install and then remove a tool that I don’t want.  Bundling is a fine tradition – and if Apple was to bundle QuickTime and iTunes such that iTunes was required, I’d simply refuse to watch .mov files.  But this method of bundling – requiring it be installed, but allowing uninstallation afterwards – seems to be more like punishing people who want to view QuickTime format movies.