+ switch ( CreateLockFile() )
+ {
+ case LOCK_EXISTS:
+ // there is a lock file, check below if it is still valid
+ break;
+
+ case LOCK_CREATED:
+ // nothing more to do
+ return TRUE;
+
+ case LOCK_ERROR:
+ // oops...
+ return FALSE;
+ }
+
+ // Check if the file is owned by current user and has 0600 permissions.
+ // If it doesn't, it's a fake file, possibly meant as a DoS attack, and
+ // so we refuse to touch it:
+ wxStructStat stats;
+ if ( wxStat(name, &stats) != 0 )