From: Chris Hanson Date: Fri, 27 Oct 1995 07:55:16 +0000 (+0000) Subject: Implement Win32 primitive to get information about a disk volume. X-Git-Tag: 20090517-FFI~5840 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=9a434c527d0d5c70ed6a57320ad00500446a0f8d;p=mit-scheme.git Implement Win32 primitive to get information about a disk volume. This information will be used by the runtime system and Edwin to make decisions about how to form filenames and what end-of-line translation to use. --- diff --git a/v7/src/microcode/prdosfs.c b/v7/src/microcode/prdosfs.c index 56b3aeb40..11854e031 100644 --- a/v7/src/microcode/prdosfs.c +++ b/v7/src/microcode/prdosfs.c @@ -1,8 +1,8 @@ /* -*-C-*- -$Id: prdosfs.c,v 1.3 1992/09/17 00:45:29 jinx Exp $ +$Id: prdosfs.c,v 1.4 1995/10/27 07:55:16 cph Exp $ -Copyright (c) 1992 Massachusetts Institute of Technology +Copyright (c) 1992-95 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -379,3 +379,18 @@ DEFINE_PRIMITIVE ("FILE-EQ?", Prim_file_eq_p, 2, 2, error_external_return (); PRIMITIVE_RETURN (BOOLEAN_TO_OBJECT ((strcmp (&buf1[0], &buf2[0])) == 0)); } + +/* This is a dummy primitive -- see "prntfs.c" for the real one. */ +DEFINE_PRIMITIVE ("NT-GET-VOLUME-INFORMATION", Prim_NT_get_vol_info, 1, 1, 0) +{ + PRIMITIVE_HEADER (1); + { + SCHEME_OBJECT result = (allocate_marked_vector (TC_VECTOR, 5, 1)); + VECTOR_SET (result, 0, (char_pointer_to_string (""))); + VECTOR_SET (result, 1, (ulong_to_integer (0))); + VECTOR_SET (result, 2, (ulong_to_integer (12))); + VECTOR_SET (result, 3, (ulong_to_integer (0))); + VECTOR_SET (result, 4, (char_pointer_to_string ("FAT"))); + PRIMITIVE_RETURN (result); + } +} diff --git a/v7/src/microcode/prntfs.c b/v7/src/microcode/prntfs.c index 9fba863f5..c966c60f3 100644 --- a/v7/src/microcode/prntfs.c +++ b/v7/src/microcode/prntfs.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: prntfs.c,v 1.3 1995/10/24 05:10:35 cph Exp $ +$Id: prntfs.c,v 1.4 1995/10/27 07:55:05 cph Exp $ Copyright (c) 1993-95 Massachusetts Institute of Technology @@ -385,3 +385,31 @@ DEFINE_PRIMITIVE ("FILE-EQ?", Prim_file_eq_p, 2, 2, error_external_return (); PRIMITIVE_RETURN (BOOLEAN_TO_OBJECT ((strcmp (&buf1[0], &buf2[0])) == 0)); } + +DEFINE_PRIMITIVE ("NT-GET-VOLUME-INFORMATION", Prim_NT_get_vol_info, 1, 1, 0) +{ + char name [256]; + DWORD serial_number; + DWORD max_component_length; + DWORD file_system_flags; + char file_system_name [256]; + SCHEME_OBJECT result; + PRIMITIVE_HEADER (1); + + if (! (GetVolumeInformation ((STRING_ARG (1)), + name, + (sizeof (name)), + (&serial_number), + (&max_component_length), + (&file_system_flags), + file_system_name, + (sizeof (file_system_name))))) + PRIMITIVE_RETURN (SHARP_F); + result = (allocate_marked_vector (TC_VECTOR, 5, 1)); + VECTOR_SET (result, 0, (char_pointer_to_string (name))); + VECTOR_SET (result, 1, (ulong_to_integer (serial_number))); + VECTOR_SET (result, 2, (ulong_to_integer (max_component_length))); + VECTOR_SET (result, 3, (ulong_to_integer (file_system_flags))); + VECTOR_SET (result, 4, (char_pointer_to_string (file_system_name))); + PRIMITIVE_RETURN (result); +}