static int windows_nt_p;
+#ifndef HAVE_SLEEP
/* Emulation of Unix sleep. */
unsigned int
{
return SleepEx (1000 * seconds, TRUE) ? 0U : 1000 * seconds;
}
+#endif
+#ifndef HAVE_USLEEP
/* Emulation of Unix usleep(). This has a granularity of
milliseconds, but that's ok because:
SleepEx (usec / 1000, TRUE);
return 0;
}
+#endif /* HAVE_USLEEP */
static char *
read_registry (HKEY hkey, char *subkey, char *valuename, char *buf, int *len)
HKEY result;
DWORD size = *len;
DWORD type = REG_SZ;
- if (RegOpenKeyEx (hkey, subkey, NULL, KEY_READ, &result) != ERROR_SUCCESS)
+ if (RegOpenKeyEx (hkey, subkey, 0, KEY_READ, &result) != ERROR_SUCCESS)
return NULL;
- if (RegQueryValueEx (result, valuename, NULL, &type, buf, &size) != ERROR_SUCCESS)
+ if (RegQueryValueEx (result, valuename, NULL, &type, (LPBYTE)buf, &size) != ERROR_SUCCESS)
buf = NULL;
*len = size;
RegCloseKey (result);