Release 960623
Wed Jun 19 14:49:27 1996 Marcus Meissner <msmeissn@faui45.informatik.uni-erlangen.de>
* [files/drive.c]
GetFreeDiskSpace*, GetVolumeInformation* added.
* [files/file.c]
FlushFileBuffers, CreateDirectory* added.
* [include/winbase.h] [include/windows.h]
Prototypes, defines added and fixes.
* [if1632/kernel32.spec] [include/resource32.h]
[win32/cursoricon32.c] [win32/resource.c] [windows/dialog.c]
Fixes to resource handling.
* [if1632/kernel.spec] [if1632/kernel32.spec] [if1632/user32.spec]
Specs for implemented functions added
Some thunks to functions which are same as win16 equivalents.
* [loader/task.c]
GetAppCompatFlags() added.
* [misc/registry.c]
One missing else added, small hack to RegQueryValue16().
* [win32/file.c]
GetFileAttributesA() fixed (was using DOS path as UNIX path).
Tue Jun 18 21:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [loader/ne_resource.c]
Fixed FreeResource() return value.
* [objects/text.c]
Fixed a bug in ExtTextOut() that was causing overlapped characters
in WinWord.
* [windows/winpos.c]
SWP_FRAMECHANGED for top-level windows now invalidates client
area as clock.exe wants.
Tue Jun 18 11:30:22 1996 Albrecht Kleine <kleine@ak.sax.de>
* [controls/listbox.c]
Mini bugfix: 'revival' of missing scrollbar in listboxes.
Mon Jun 17 20:27:41 1996 Robert Pouliot <krynos@clic.net>
* [resources/sysres_Fr.rc] [resources/TODO]
Made changes for Choose_Font dialog.
diff --git a/files/drive.c b/files/drive.c
index 8813696..f886bda 100644
--- a/files/drive.c
+++ b/files/drive.c
@@ -24,6 +24,7 @@
#endif
#include "windows.h"
+#include "winbase.h"
#include "dos_fs.h"
#include "drive.h"
#include "file.h"
@@ -31,6 +32,7 @@
#include "options.h"
#include "task.h"
#include "xmalloc.h"
+#include "string32.h"
#include "stddebug.h"
#include "debug.h"
@@ -428,7 +430,7 @@
/***********************************************************************
* DRIVE_GetFreeSpace
*/
-int DRIVE_GetFreeSpace( int drive, DWORD *size, DWORD *available )
+static int DRIVE_GetFreeSpace( int drive, DWORD *size, DWORD *available )
{
struct statfs info;
@@ -460,6 +462,69 @@
/***********************************************************************
+ * GetDiskFreeSpace16 (KERNEL.422)
+ */
+BOOL16 GetDiskFreeSpace16( LPCSTR root, LPDWORD cluster_sectors,
+ LPDWORD sector_bytes, LPDWORD free_clusters,
+ LPDWORD total_clusters )
+{
+ return GetDiskFreeSpace32A( root, cluster_sectors, sector_bytes,
+ free_clusters, total_clusters );
+}
+
+
+/***********************************************************************
+ * GetDiskFreeSpaceA (KERNEL32.206)
+ */
+BOOL32 GetDiskFreeSpace32A( LPCSTR root, LPDWORD cluster_sectors,
+ LPDWORD sector_bytes, LPDWORD free_clusters,
+ LPDWORD total_clusters )
+{
+ int drive;
+ DWORD size,available;
+
+ if (!root) drive = DRIVE_GetCurrentDrive();
+ else
+ {
+ if ((root[1] != ':') || (root[2] != '\\'))
+ {
+ fprintf( stderr, "GetDiskFreeSpaceA: invalid root '%s'\n", root );
+ return FALSE;
+ }
+ drive = toupper(root[0]) - 'A';
+ }
+ if (!DRIVE_GetFreeSpace(drive, &size, &available)) return FALSE;
+
+ *sector_bytes = 512;
+ size /= 512;
+ available /= 512;
+ *cluster_sectors = 1;
+ while (*cluster_sectors * 65530 < size) *cluster_sectors *= 2;
+ *free_clusters = available/ *cluster_sectors;
+ *total_clusters = size/ *cluster_sectors;
+ return TRUE;
+}
+
+
+/***********************************************************************
+ * GetDiskFreeSpaceW (KERNEL32.207)
+ */
+BOOL32 GetDiskFreeSpace32W( LPCWSTR root, LPDWORD cluster_sectors,
+ LPDWORD sector_bytes, LPDWORD free_clusters,
+ LPDWORD total_clusters )
+{
+ LPSTR xroot;
+ BOOL ret;
+
+ xroot = STRING32_DupUniToAnsi(root);
+ ret = GetDiskFreeSpace32A( xroot,cluster_sectors, sector_bytes,
+ free_clusters, total_clusters );
+ free( xroot );
+ return ret;
+}
+
+
+/***********************************************************************
* GetDriveType (KERNEL.136)
*/
WORD GetDriveType( INT drive )
@@ -501,7 +566,7 @@
/***********************************************************************
- * GetCurrentDirectory (KERNEL.411)
+ * GetCurrentDirectory (KERNEL.411) (KERNEL32.196)
*/
UINT32 GetCurrentDirectory( UINT32 buflen, LPSTR buf )
{
@@ -589,3 +654,63 @@
if (DRIVE_IsValid(drive)) ret |= (1 << drive);
return ret;
}
+
+
+/***********************************************************************
+ * GetVolumeInformation32A (KERNEL32.309)
+ */
+BOOL32 GetVolumeInformation32A( LPCSTR root, LPSTR label, DWORD label_len,
+ DWORD *serial, DWORD *filename_len,
+ DWORD *flags, LPSTR fsname, DWORD fsname_len )
+{
+ int drive;
+
+ /* FIXME, SetLastErrors missing */
+
+ if (!root) drive = DRIVE_GetCurrentDrive();
+ else
+ {
+ if ((root[1] != ':') || (root[2] != '\\'))
+ {
+ fprintf( stderr, "GetVolumeInformation: invalid root '%s'\n",root);
+ return FALSE;
+ }
+ drive = toupper(root[0]) - 'A';
+ }
+ if (!DRIVE_IsValid( drive )) return FALSE;
+ if (label) lstrcpyn32A( label, DOSDrives[drive].label, label_len );
+ if (serial) *serial = DOSDrives[drive].serial;
+
+ /* Set the filesystem information */
+ /* Note: we only emulate a FAT fs at the present */
+
+ if (filename_len) *filename_len = 12;
+ if (flags) *flags = 0;
+ if (fsname) lstrcpyn32A( fsname, "FAT", fsname_len );
+ return TRUE;
+}
+
+
+/***********************************************************************
+ * GetVolumeInformation32W (KERNEL32.310)
+ */
+BOOL32 GetVolumeInformation32W( LPCWSTR root, LPWSTR label, DWORD label_len,
+ DWORD *serial, DWORD *filename_len,
+ DWORD *flags, LPWSTR fsname, DWORD fsname_len)
+{
+ LPSTR xroot = STRING32_DupUniToAnsi(root);
+ LPSTR xvolname = (char*)xmalloc( label_len );
+ LPSTR xfsname = (char*)xmalloc( fsname_len );
+ BOOL32 ret = GetVolumeInformation32A( xroot, xvolname, label_len, serial,
+ filename_len, flags, xfsname,
+ fsname_len );
+ if (ret)
+ {
+ STRING32_AnsiToUni( label, xvolname );
+ STRING32_AnsiToUni( fsname, xfsname );
+ }
+ free(xroot);
+ free(xvolname);
+ free(xfsname);
+ return ret;
+}