[NTVDM]
[reactos.git] / reactos / subsystems / mvdm / ntvdm / dos / dos32krnl / dos.c
index 3b3c673..d4e1c76 100644 (file)
@@ -768,7 +768,6 @@ VOID WINAPI DosInt21h(LPWORD Stack)
         {
             setES(HIWORD(INDOS_POINTER));
             setBX(LOWORD(INDOS_POINTER));
         {
             setES(HIWORD(INDOS_POINTER));
             setBX(LOWORD(INDOS_POINTER));
-
             break;
         }
 
             break;
         }
 
@@ -1650,7 +1649,7 @@ VOID WINAPI DosInt21h(LPWORD Stack)
             if (getAL() == 0x00)
             {
                 /* Lock region of file */
             if (getAL() == 0x00)
             {
                 /* Lock region of file */
-                if (DosLockFile(getBX(), MAKELONG(getCX(), getDX()), MAKELONG(getSI(), getDI())))
+                if (DosLockFile(getBX(), MAKELONG(getDX(), getCX()), MAKELONG(getDI(), getSI())))
                 {
                     Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF;
                 }
                 {
                     Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF;
                 }
@@ -1663,7 +1662,7 @@ VOID WINAPI DosInt21h(LPWORD Stack)
             else if (getAL() == 0x01)
             {
                 /* Unlock region of file */
             else if (getAL() == 0x01)
             {
                 /* Unlock region of file */
-                if (DosUnlockFile(getBX(), MAKELONG(getCX(), getDX()), MAKELONG(getSI(), getDI())))
+                if (DosUnlockFile(getBX(), MAKELONG(getDX(), getCX()), MAKELONG(getDI(), getSI())))
                 {
                     Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF;
                 }
                 {
                     Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF;
                 }
@@ -2015,6 +2014,12 @@ BOOLEAN DosKRNLInitialize(VOID)
     RegisterDosInt32(0x29, DosFastConOut    ); // DOS 2+ Fast Console Output
     RegisterDosInt32(0x2F, DosInt2Fh        );
 
     RegisterDosInt32(0x29, DosFastConOut    ); // DOS 2+ Fast Console Output
     RegisterDosInt32(0x2F, DosInt2Fh        );
 
+    /* Load the CON driver */
+    ConDrvInitialize();
+
+    /* Load the XMS driver (HIMEM) */
+    XmsInitialize();
+
     /* Load the EMS driver */
     if (!EmsDrvInitialize(EMS_TOTAL_PAGES))
     {
     /* Load the EMS driver */
     if (!EmsDrvInitialize(EMS_TOTAL_PAGES))
     {
@@ -2022,12 +2027,6 @@ BOOLEAN DosKRNLInitialize(VOID)
                 "Try reducing the number of EMS pages.\n");
     }
 
                 "Try reducing the number of EMS pages.\n");
     }
 
-    /* Load the XMS driver (HIMEM) */
-    XmsInitialize();
-
-    /* Load the CON driver */
-    ConDrvInitialize();
-
     return TRUE;
 }
 
     return TRUE;
 }