, evildictaitor wrote

*snip*

Actually what is this all about? I tried this on my desktop and I get a dialog:

*snip*

What more do you want Microsoft to do for you? The shortcut doesn't work, they gave you a dialog asking if you wanted to delete the file, you clicked YES and it deleted it.

The point is this happens as part of a default Scheduled Task, not how the shell handles it if you click an invalid shortcut.

, evildictaitor wrote

*snip*

IsBadXXXPtr is not a security function, and hence this is not a real anti-pattern.

It's not about security. If IsBadXXXPtr fails, the pointer is invalid. If it suceeds, the pointer might still be invalid. So basically making any decision on it is entirely pointless.

Checking something global exists/is valid then following up by attempting to do something based on the assumption that it is valid is fundamentally flawed on a multitasking OS. The only valid way to do it is to perform the action and respond correctly to a failure, but obviously that's not an option here and as such there is no correct way to write this functionality and it shouldn't exist at all.