- Update to r53061
[reactos.git] / drivers / video / videoprt / int10.c
index 66e1814..36c14dc 100644 (file)
  */
 
 #include "videoprt.h"
-#include "internal/i386/v86m.h"
 
 /* PRIVATE FUNCTIONS **********************************************************/
 
+#if defined(_M_IX86)
 VP_STATUS NTAPI
 IntInt10AllocateBuffer(
    IN PVOID Context,
@@ -60,8 +60,8 @@ IntInt10AllocateBuffer(
       return ERROR_NOT_ENOUGH_MEMORY;
    }
 
-   *Seg = (ULONG)MemoryAddress >> 4;
-   *Off = (ULONG)MemoryAddress & 0xF;
+   *Seg = (USHORT)((ULONG)MemoryAddress >> 4);
+   *Off = (USHORT)((ULONG)MemoryAddress & 0xF);
 
    INFO_(VIDEOPRT, "- Segment: %x\n", (ULONG)MemoryAddress >> 4);
    INFO_(VIDEOPRT, "- Offset: %x\n", (ULONG)MemoryAddress & 0xF);
@@ -182,13 +182,15 @@ IntInt10CallBios(
     BiosArguments->Esi = BiosContext.Esi;
     BiosArguments->Edi = BiosContext.Edi;
     BiosArguments->Ebp = BiosContext.Ebp;
-    BiosArguments->SegDs = BiosContext.SegDs;
-    BiosArguments->SegEs = BiosContext.SegEs;
+    BiosArguments->SegDs = (USHORT)BiosContext.SegDs;
+    BiosArguments->SegEs = (USHORT)BiosContext.SegEs;
 
     /* Detach and return status */
     IntDetachFromCSRSS(&CallingProcess, &ApcState);
-    return Status;
+    if (NT_SUCCESS(Status)) return NO_ERROR;
+    return ERROR_INVALID_PARAMETER;
 }
+#endif
 
 /* PUBLIC FUNCTIONS ***********************************************************/
 
@@ -201,6 +203,7 @@ VideoPortInt10(
     IN PVOID HwDeviceExtension,
     IN PVIDEO_X86_BIOS_ARGUMENTS BiosArguments)
 {
+#if defined(_M_IX86)
     CONTEXT BiosContext;
     NTSTATUS Status;
     PKPROCESS CallingProcess = (PKPROCESS)PsGetCurrentProcess();
@@ -240,6 +243,11 @@ VideoPortInt10(
 
     /* Detach from CSRSS */
     IntDetachFromCSRSS(&CallingProcess, &ApcState);
-
-    return Status;
+    if (NT_SUCCESS(Status)) return NO_ERROR;
+    return ERROR_INVALID_PARAMETER;
+#else
+    /* Not implemented for anything else than X86*/
+    DPRINT1("Int10 not available on non-x86!\n");
+    return ERROR_INVALID_FUNCTION;
+#endif
 }