Author: aandrejevic
Date: Fri May 1 23:04:03 2015
New Revision: 67504
URL:
http://svn.reactos.org/svn/reactos?rev=67504&view=rev
Log:
[NTVDM]
Implement INT 21h, AH = 36h "Get Free Disk Space".
Modified:
trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] Fri May 1
23:04:03 2015
@@ -832,6 +832,38 @@
break;
}
+ /* Get Free Disk Space */
+ case 0x36:
+ {
+ CHAR RootPath[3] = "X:\\";
+ DWORD SectorsPerCluster;
+ DWORD BytesPerSector;
+ DWORD NumberOfFreeClusters;
+ DWORD TotalNumberOfClusters;
+
+ if (getDL() == 0) RootPath[0] = 'A' + CurrentDrive;
+ else RootPath[0] = 'A' + getDL() - 1;
+
+ if (GetDiskFreeSpaceA(RootPath,
+ &SectorsPerCluster,
+ &BytesPerSector,
+ &NumberOfFreeClusters,
+ &TotalNumberOfClusters))
+ {
+ setAX(LOWORD(SectorsPerCluster));
+ setCX(LOWORD(BytesPerSector));
+ setBX(LOWORD(NumberOfFreeClusters));
+ setDX(LOWORD(TotalNumberOfClusters));
+ }
+ else
+ {
+ /* Error */
+ setAX(0xFFFF);
+ }
+
+ break;
+ }
+
/* SWITCH character - AVAILDEV */
case 0x37:
{