}
#endif /* 0 */
-#define REG_ROOT "SOFTWARE\\GNU\\XEmacs"
+#define REG_ROOT "SOFTWARE\\XEmacs\\XEmacs"
LPBYTE
nt_get_resource (char *key, LPDWORD lpdwtype)
renaming or deleting directories. (We also don't call chdir when
running subprocesses for the same reason.) */
if (!GetCurrentDirectory (MAXPATHLEN, startup_dir))
- abort ();
+ ABORT ();
{
char *p;
char modname[MAX_PATH];
if (!GetModuleFileName (NULL, modname, MAX_PATH))
- abort ();
+ ABORT ();
if ((p = strrchr (modname, '\\')) == NULL)
- abort ();
+ ABORT ();
*p = 0;
SetCurrentDirectory (modname);
doesn't resolve aliasing due to subst commands, or recognize hard
links. */
if (!win32_get_long_filename ((char *)name, fullname, MAX_PATH))
- abort ();
+ ABORT ();
parse_root (fullname, &p);
/* Normal Win32 filesystems are still case insensitive. */
int permission;
int len;
int rootdir = FALSE;
+ int errm;
if (path == NULL || buf == NULL)
{
rootdir = (path >= name + len - 1
&& (IS_DIRECTORY_SEP (*path) || *path == 0));
name = strcpy ((char *)alloca (len + 2), name);
-
+ errm = SetErrorMode (SEM_FAILCRITICALERRORS
+ | SEM_NOOPENFILEERRORBOX);
if (rootdir)
{
if (!IS_DIRECTORY_SEP (name[len-1]))
strcat (name, "\\");
+
if (GetDriveType (name) < 2)
{
+ SetErrorMode (errm);
errno = ENOENT;
return -1;
}
}
else
{
- fh = FindFirstFile (name, &wfd);
- if (fh == INVALID_HANDLE_VALUE)
- {
- errno = ENOENT;
- return -1;
+ fh = FindFirstFile (name, &wfd);
+ if (fh == INVALID_HANDLE_VALUE)
+ {
+ SetErrorMode (errm);
+ errno = ENOENT;
+ return -1;
+ }
+ FindClose (fh);
}
- FindClose (fh);
- }
}
if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
}
else
{
+ SetErrorMode (errm);
errno = EACCES;
return -1;
}
fake_inode = 0;
}
+ SetErrorMode (errm);
+
#if 0
/* Not sure if there is any point in this. */
if (!NILP (Vwin32_generate_fake_inodes))