Merge from amd64-branch:
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Thu, 25 Mar 2010 05:03:29 +0000 (05:03 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Thu, 25 Mar 2010 05:03:29 +0000 (05:03 +0000)
46394 (tkreuzer)
[FRAMEBUF_NEW]
- use compiler flags for x86 only

36969 (sginsberg)
[VIDEOPRT]
- Make videoprt compile for 64-bit
- Disable Int10 support as it uses x86 specific structures (is this support still available on amd64?)
- Disable VideoPortEnable/DisableInterrupt -- HalEnable/DisableSystemInterrupt are not apparently present on NT AMD64, so need to figure out what else to use (and if these routine are still present on amd64 videoprt)

The following this time for real:

40927 (tkreuzer)
[BMFD]
HGLYPH is an ULONG. Use offset to glyph entry as HGLYPH instead of the pointer to fix 64bit build.

41070 (tkreuzer)
[TCPIP]
fix a pointer to ULONG cast

41500 (tkreuzer)
[NDIS]
Pass ULONG* to MiniQueryInformation for the number of written bytes instead of ULONG_PTR*

41502 (tkreuzer)
[WDMAUD]
Make DeviceIndex a ULONG_PTR

44339 (sserapion)
[NDIS]
Fix ndis build.

svn path=/trunk/; revision=46427

13 files changed:
reactos/drivers/network/ndis/ndis/miniport.c
reactos/drivers/network/ndis/ndis/misc.c
reactos/drivers/network/tcpip/datalink/lan.c
reactos/drivers/video/displays/framebuf_new/framebuf_new.rbuild
reactos/drivers/video/font/bmfd/font.c
reactos/drivers/video/font/bmfd/glyph.c
reactos/drivers/video/videoprt/agp.c
reactos/drivers/video/videoprt/int10.c
reactos/drivers/video/videoprt/interrupt.c
reactos/drivers/video/videoprt/resource.c
reactos/drivers/video/videoprt/services.c
reactos/drivers/video/videoprt/videoprt.c
reactos/drivers/wdm/audio/legacy/wdmaud/interface.h

index 05c750d..2a9934c 100644 (file)
@@ -2109,6 +2109,7 @@ NdisIDeviceIoControl(
   PLOGICAL_ADAPTER Adapter = (PLOGICAL_ADAPTER)DeviceObject->DeviceExtension;
   PIO_STACK_LOCATION Stack = IoGetCurrentIrpStackLocation(Irp);
   NDIS_STATUS Status = STATUS_NOT_SUPPORTED;
+  ULONG Written;
 
   Irp->IoStatus.Information = 0;
 
@@ -2121,7 +2122,8 @@ NdisIDeviceIoControl(
                                     *(PNDIS_OID)Irp->AssociatedIrp.SystemBuffer,
                                     Stack->Parameters.DeviceIoControl.OutputBufferLength,
                                     MmGetSystemAddressForMdl(Irp->MdlAddress),
-                                    &Irp->IoStatus.Information);
+                                    &Written);
+      Irp->IoStatus.Information = Written;
       break;
 
     default:
index f8b05a8..dca3726 100644 (file)
@@ -426,7 +426,7 @@ NdisInterlockedPopEntrySList(
  *    NDIS 5.0
  */
 {
-  return ExInterlockedPopEntrySList ( ListHead, Lock );
+  return (PSINGLE_LIST_ENTRY)ExInterlockedPopEntrySList ( ListHead, Lock );
 }
 
 
@@ -447,7 +447,7 @@ NdisInterlockedPushEntrySList(
  *    NDIS 5.0
  */
 {
-  return ExInterlockedPushEntrySList ( ListHead, ListEntry, Lock );
+  return (PSINGLE_LIST_ENTRY)ExInterlockedPushEntrySList ( ListHead, (PSLIST_ENTRY)ListEntry, Lock );
 }
 
 
index fd0b818..890330e 100644 (file)
@@ -684,7 +684,7 @@ VOID LANTransmit(
         if (Adapter->MTU < Size) {
             /* This is NOT a pointer. MSDN explicitly says so. */
             NDIS_PER_PACKET_INFO_FROM_PACKET(NdisPacket,
-                                             TcpLargeSendPacketInfo) = (PVOID)((ULONG)Adapter->MTU);
+                                             TcpLargeSendPacketInfo) = (PVOID)((ULONG_PTR)Adapter->MTU);
         }
 
        TcpipAcquireSpinLock( &Adapter->Lock, &OldIrql );
index 991954e..de7c4a1 100644 (file)
        <file>pointer.c</file>
        <file>screen.c</file>
        <file>framebuf_new.rc</file>
-       <group compilerset="gcc">
-        <compilerflag>-mrtd</compilerflag>
-        <compilerflag>-fno-builtin</compilerflag>
-               <compilerflag>-Wno-unused-variable</compilerflag>
-       </group>
+       <if property="ARCH" value="i386">
+               <group compilerset="gcc">
+                       <compilerflag>-mrtd</compilerflag>
+                       <compilerflag>-fno-builtin</compilerflag>
+                       <compilerflag>-Wno-unused-variable</compilerflag>
+               </group>
+       </if>
        <pch>driver.h</pch>
 </module>
index 4760fac..3afdc4f 100644 (file)
@@ -389,7 +389,7 @@ BmfdQueryFontTree(
 {
     PBMFD_FILE pfile = (PBMFD_FILE)iFile;
     PBMFD_FACE pface;
-    ULONG i, j, cjOffset, cjSize, cGlyphs, cRuns;
+    ULONG i, j, cjSize, cGlyphs, cRuns;
     CHAR ch, chFirst, ach[256];
     WCHAR wc, awc[256];
     PFD_GLYPHSET pGlyphSet;
@@ -475,14 +475,13 @@ BmfdQueryFontTree(
     pwcrun[0].wcLow = awc[0];
     pwcrun[0].cGlyphs = 1;
     pwcrun[0].phg = phglyphs;
-    phglyphs[0] = (HGLYPH)pface->pCharTable;
+    phglyphs[0] = 0;
 
     /* Walk through all supported chars */
     for (i = 1, j = 0; i < cGlyphs; i++)
     {
-        /* Use pointer to glyph entry as hglyph */
-        cjOffset = (ach[i] - chFirst) * pface->cjEntrySize;
-        phglyphs[i] = (HGLYPH)(pface->pCharTable + cjOffset);
+        /* Use offset to glyph entry as hglyph */
+        phglyphs[i] = (ach[i] - chFirst) * pface->cjEntrySize;
 
         /* Check whether we can append the wchar to a run */
         if (awc[i] == awc[i - 1] + 1)
index fc88b45..a2ce39f 100644 (file)
@@ -80,7 +80,7 @@ BmfdQueryGlyphAndBitmap(
     ULONG cjSize)
 {
     PBMFD_FACE pface = pfont->pface;
-    PGLYPHENTRY pge = (PGLYPHENTRY)hg;
+    PGLYPHENTRY pge = (PGLYPHENTRY)(pface->pCharTable + hg);
     ULONG xSrc, ySrc, cxSrc, cySrc;
     ULONG xDst, yDst, cxDst, cyDst;
     ULONG xScale, yScale;
index ff390af..768e6d9 100644 (file)
@@ -275,7 +275,7 @@ IntAgpCommitVirtual(
    else /* ProcessHandle != NULL */
    {
       /* Release some virtual memory */
-      ULONG Size = Pages * PAGE_SIZE;
+      SIZE_T Size = Pages * PAGE_SIZE;
       ULONG OffsetInBytes = Offset * PAGE_SIZE;
       BaseAddress = (PVOID)((ULONG_PTR)VirtualMapping->MappedAddress +
                                        OffsetInBytes);
@@ -349,7 +349,7 @@ IntAgpFreeVirtual(
    else /* ProcessHandle != NULL */
    {
       /* Unmap the section view */
-      ULONG Size = Pages * PAGE_SIZE;
+      SIZE_T Size = Pages * PAGE_SIZE;
       ULONG OffsetInBytes = Offset * PAGE_SIZE;
       BaseAddress = (PVOID)((ULONG_PTR)VirtualMapping->MappedAddress +
                                        OffsetInBytes);
@@ -400,7 +400,7 @@ IntAgpReleaseVirtual(
    else /* ProcessHandle != NULL */
    {
       /* Release the allocated virtual memory */
-      ULONG Size = VirtualMapping->AgpMapping->NumberOfPages * PAGE_SIZE;
+      SIZE_T Size = VirtualMapping->AgpMapping->NumberOfPages * PAGE_SIZE;
       Status = ZwFreeVirtualMemory(VirtualMapping->ProcessHandle,
                                    &VirtualMapping->MappedAddress,
                                    &Size, MEM_RELEASE);
@@ -452,7 +452,7 @@ IntAgpReserveVirtual(
    else /* ProcessHandle != NULL */
    {
       /* Reserve memory for usermode */
-      ULONG Size = AgpMapping->NumberOfPages * PAGE_SIZE;
+      SIZE_T Size = AgpMapping->NumberOfPages * PAGE_SIZE;
       MappedAddress = NULL;
       Status = ZwAllocateVirtualMemory(ProcessHandle, &MappedAddress, 0, &Size,
                                        MEM_RESERVE, PAGE_NOACCESS);
index 7930c87..5f5458a 100644 (file)
@@ -24,6 +24,7 @@
 
 /* PRIVATE FUNCTIONS **********************************************************/
 
+#if defined(_M_IX86)
 VP_STATUS NTAPI
 IntInt10AllocateBuffer(
    IN PVOID Context,
@@ -190,6 +191,7 @@ IntInt10CallBios(
     if (NT_SUCCESS(Status)) return NO_ERROR;
     return ERROR_INVALID_PARAMETER;
 }
+#endif
 
 /* PUBLIC FUNCTIONS ***********************************************************/
 
@@ -202,6 +204,7 @@ VideoPortInt10(
     IN PVOID HwDeviceExtension,
     IN PVIDEO_X86_BIOS_ARGUMENTS BiosArguments)
 {
+#if defined(_M_IX86)
     CONTEXT BiosContext;
     NTSTATUS Status;
     PKPROCESS CallingProcess = (PKPROCESS)PsGetCurrentProcess();
@@ -243,4 +246,9 @@ VideoPortInt10(
     IntDetachFromCSRSS(&CallingProcess, &ApcState);
     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
 }
index 54a5b95..b15ebdf 100644 (file)
@@ -110,6 +110,7 @@ VP_STATUS
 NTAPI
 VideoPortEnableInterrupt(IN PVOID HwDeviceExtension)
 {
+#ifndef _M_AMD64
     PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
     BOOLEAN InterruptValid;
 
@@ -133,6 +134,11 @@ VideoPortEnableInterrupt(IN PVOID HwDeviceExtension)
 
     /* Return to caller */
     return NO_ERROR;
+#else
+    /* FIXME: Function still present? If so what to use instead of HalEnableSystemInterrupt? */
+    UNIMPLEMENTED;
+    return ERROR_INVALID_ACCESS;
+#endif
 }
 
 /*
@@ -142,6 +148,7 @@ VP_STATUS
 NTAPI
 VideoPortDisableInterrupt(IN PVOID HwDeviceExtension)
 {
+#ifndef _M_AMD64
     PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
 
     /* Get the device extension */
@@ -158,4 +165,9 @@ VideoPortDisableInterrupt(IN PVOID HwDeviceExtension)
     HalDisableSystemInterrupt(DeviceExtension->InterruptVector,
                               0);
     return NO_ERROR;
+#else
+    /* FIXME: Function still present? If so what to use instead of HalDisableSystemInterrupt? */
+    UNIMPLEMENTED;
+    return ERROR_INVALID_ACCESS;
+#endif
 }
index 2ed6417..b17edb7 100644 (file)
@@ -163,7 +163,7 @@ IntVideoPortMapMemory(
       if (Status)
          *Status = NO_ERROR;
 
-      return (PVOID)TranslatedAddress.u.LowPart;
+      return (PVOID)(ULONG_PTR)TranslatedAddress.u.LowPart;
    }
 
    /* user space */
@@ -271,7 +271,7 @@ IntVideoPortUnmapMemory(
    Status = ZwUnmapViewOfSection(NtCurrentProcess(), MappedAddress);
    if (!NT_SUCCESS(Status))
    {
-      WARN_(VIDEOPRT, "Warning: Mapping for address 0x%x not found!\n", (ULONG)MappedAddress);
+      WARN_(VIDEOPRT, "Warning: Mapping for address 0x%p not found!\n", MappedAddress);
    }
 }
 
index fbf69a8..5b9f3cf 100644 (file)
@@ -43,6 +43,7 @@ VideoPortQueryServices(
 
    switch (ServicesType)
    {
+#if defined(_M_IX86)
       case VideoPortServicesInt10:
          if (Interface->Version >= VIDEO_PORT_INT10_INTERFACE_VERSION_1 ||
              Interface->Size >= sizeof(VIDEO_PORT_INT10_INTERFACE))
@@ -60,7 +61,7 @@ VideoPortQueryServices(
             return NO_ERROR;
          }
          break;
-
+#endif
       case VideoPortServicesAGP:
          if ((Interface->Version == VIDEO_PORT_AGP_INTERFACE_VERSION_2 &&
               Interface->Size >= sizeof(VIDEO_PORT_AGP_INTERFACE_2)) ||
index 19a64f7..33c6fed 100644 (file)
@@ -330,7 +330,7 @@ IntVideoPortFindAdapter(
 {
    WCHAR DeviceVideoBuffer[20];
    PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
-   ULONG Size;
+   SIZE_T Size;
    NTSTATUS Status;
    VIDEO_PORT_CONFIG_INFO ConfigInfo;
    SYSTEM_BASIC_INFORMATION SystemBasicInfo;
index 211045c..aa5e7b2 100644 (file)
@@ -26,7 +26,7 @@ typedef struct
 {
     KSSTREAM_HEADER Header;
     SOUND_DEVICE_TYPE DeviceType;
-    ULONG DeviceIndex;
+    ULONG_PTR DeviceIndex;
 
     HANDLE hDevice;
     ULONG DeviceCount;