/* -*-C-*-
-$Id: ntsys.c,v 1.4 1993/09/03 18:03:03 gjr Exp $
+$Id: ntsys.c,v 1.5 1996/04/09 20:16:32 adams Exp $
-Copyright (c) 1992-1993 Massachusetts Institute of Technology
+Copyright (c) 1992-1996 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
return (nsize);
}
-void
-nt_get_version (version_t * version_number)
-{
- DWORD ver;
- ver = (GetVersion ());
- version_number->platform = ((unsigned char)
- ((((unsigned long) ver) & 0x80000000UL) >> 31));
- version_number->major = (LOBYTE (LOWORD (ver)));
- version_number->minor = (HIBYTE (LOWORD (ver)));
- return;
-}
-
BOOL
nt_pathname_as_filename (char * name, char * buffer)
{ /* Returns whether directory encountered is top level */
/* -*-C-*-
-$Id: ntsys.h,v 1.5 1996/03/23 19:24:46 adams Exp $
+$Id: ntsys.h,v 1.6 1996/04/09 20:16:08 adams Exp $
-Copyright (c) 1992-96 Massachusetts Institute of Technology
+Copyright (c) 1992-1996 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
#ifndef SCM_NTSYS_H
#define SCM_NTSYS_H
\f
-typedef struct version_struct
-{
- unsigned char platform;
- unsigned char major;
- unsigned char minor;
-} version_t;
-
/* Misc */
extern BOOL win32_under_win32s_p ();
-extern int nt_console_write (void * vbuffer, size_t nsize);
-extern void nt_get_version (version_t * version_number);
+extern int nt_console_write (void * vbuffer, size_t nsize);
extern BOOL nt_pathname_as_filename (char * name, char * buffer);
#endif /* SCM_NTSYS_H */
/* -*-C-*-
-$Id: nttop.c,v 1.17 1996/03/23 19:24:40 adams Exp $
+$Id: nttop.c,v 1.18 1996/04/09 20:15:53 adams Exp $
Copyright (c) 1993-96 Massachusetts Institute of Technology
BOOL
win32_under_win32s_p ()
{
- return ((GetVersion()) >> 31);
+ DWORD dwVersion = GetVersion();
+ return ((dwVersion>0x80000000) && LOBYTE(LOWORD(dwVersion))<4);
}
WIN32_SYSTEM_UTILITIES win32_system_utilities;
OS_Name = SYSTEM_NAME;
{
- version_t version_number;
- const char * variant;
-
- nt_get_version (&version_number);
- variant = ((version_number.platform == 0) ? "Windows NT" : "Windows");
- OS_Variant = (malloc ((strlen (variant)) + 64));
- sprintf (OS_Variant, "%s %d.%d 386/486\n",
- variant,
- ((int) version_number.major),
- ((int) version_number.minor));
+ DWORD dwVersion = GetVersion();
+ char variant[128];
+
+ if (dwVersion < 0x80000000) {
+ // Windows NT
+ sprintf (variant, "Microsoft Windows NT %u.%u (Build: %u)",
+ (DWORD)(LOBYTE(LOWORD(dwVersion))),
+ (DWORD)(HIBYTE(LOWORD(dwVersion))),
+ (DWORD)(HIWORD(dwVersion)));
+ }
+ else if (LOBYTE(LOWORD(dwVersion))<4) {
+ // Win32s
+ sprintf (variant, "Microsoft Win32s %u.%u (Build: %u)",
+ (DWORD)(LOBYTE(LOWORD(dwVersion))),
+ (DWORD)(HIBYTE(LOWORD(dwVersion))),
+ (DWORD)(HIWORD(dwVersion) & ~0x8000));
+ } else {
+ // Windows 95
+ sprintf (variant, "Microsoft Windows 95 %u.%u (Build: %u)",
+ (DWORD)(LOBYTE(LOWORD(dwVersion))),
+ (DWORD)(HIBYTE(LOWORD(dwVersion))),
+ (DWORD)(HIWORD(dwVersion) & ~0x8000));
+ }
+
+ OS_Variant = malloc (128);
+ sprintf (OS_Variant, "%s 386/486\n", variant);
}
}