Author: hbelusca
Date: Fri May 16 00:34:54 2014
New Revision: 63310
URL: http://svn.reactos.org/svn/reactos?rev=63310&view=rev
Log:
[NTVDM]
Partially implement INT 21h, AH=60h -- "Canonicalize File Name or Path".
Modified:
trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c
Modified: trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/dos/dos32…
==============================================================================
--- trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] Fri May 16 00:34:54 2014
@@ -2625,7 +2625,36 @@
/* Canonicalize File Name or Path */
case 0x60:
{
- // TODO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ /*
+ * See Ralf Brown: http://www.ctyme.com/intr/rb-3137.htm
+ * for more information.
+ */
+
+ /*
+ * We suppose that the DOS app gave to us a valid
+ * 128-byte long buffer for the canonicalized name.
+ */
+ DWORD dwRetVal = GetFullPathNameA(SEG_OFF_TO_PTR(getDS(), getSI()),
+ 128,
+ SEG_OFF_TO_PTR(getES(), getDI()),
+ NULL);
+ if (dwRetVal == 0)
+ {
+ Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF;
+ setAX(GetLastError());
+ }
+ else
+ {
+ Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF;
+ setAX(0x0000);
+ }
+
+ // FIXME: Convert the full path name into short version.
+ // We cannot reliably use GetShortPathName, because it fails
+ // if the path name given doesn't exist. However this DOS
+ // function AH=60h should be able to work even for non-existing
+ // path and file names.
+
break;
}