Merge from amd64-branch:
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Thu, 25 Mar 2010 03:50:46 +0000 (03:50 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Thu, 25 Mar 2010 03:50:46 +0000 (03:50 +0000)
36380 (tkreuzer)
[SCSIPORT]
Implement some functions that are forwarded to HAL on x86 build, but not on x64. Modify spec file (use preprocessor macro).

36397 (tkreuzer)
[SCSIPORT]
rename .spec to .pspec

36949 (sginsberg)
- Fix NTFS FSD compilation

36951 (sginsgerb)
[NE2000]
- Fix ne2000 compilation (treat pointer size as ULONG_PTR, correct function prototypes)

36958 (sginsberg)
[ISAPNP]
- Fix isapnp compilation for 64-bit

36961 (sginsberg)
[SERIAL]
- Make serial build for 64 bit -- explicitly cast first parameter to InterlockedCompareExchangePointer
to PVOID

36964 (sginsberg)
- Fix DXG 64-bit compilation

36972 (sserapion)
[VGA]
- When doing pointer arithmetic, ULONG_PTR is your friend

37234 (tkreuzer)
[SCSIPORT]
Fix scsiport, by using pspec again.

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=46424

1  2  3 
reactos/drivers/bus/isapnp/isapnp.c
reactos/drivers/directx/dxg/ddhmg.c
reactos/drivers/filesystems/ntfs/attrib.c
reactos/drivers/network/dd/ne2000/include/ne2000.h
reactos/drivers/network/dd/ne2000/ne2000/8390.c
reactos/drivers/serial/serial/devctrl.c
reactos/drivers/storage/scsiport/scsiport.rbuild
reactos/drivers/video/displays/vga/main/enable.c

@@@@ -153,7 -153,7 -153,7 +153,7 @@@@ static VOID WriteUlong(UCHAR Index, ULO
   }
   #endif
   
---static __inline VOID SetReadDataPort(ULONG Port)
+++static __inline VOID SetReadDataPort(ULONG_PTR Port)
   {
     IsaPnPReadPort = (PUCHAR)Port;
        WriteUchar(0x00, (UCHAR) (Port >> 2));
@@@@ -214,13 -214,13 -214,13 +214,13 @@@@ static VOID DeactivateLogicalDevice(UCH
   
   #define READ_DATA_PORT_STEP 32  /* Minimum is 4 */
   
---static ULONG FindNextReadPort(VOID)
+++static ULONG_PTR FindNextReadPort(VOID)
   {
---     ULONG Port;
+++     ULONG_PTR Port;
   
   
   
---     Port = (ULONG)IsaPnPReadPort;
+++     Port = (ULONG_PTR)IsaPnPReadPort;
   
        while (TRUE) {
   
   
   static BOOLEAN IsolateReadDataPortSelect(VOID)
   {
---  ULONG Port;
+++  ULONG_PTR Port;
   
        SendWait();
        SendKey();
@@@@ -333,7 -333,7 -333,7 +333,7 @@@@ static ULONG IsolatePnPCards(VOID
                        KeStallExecutionProcessor(250);
                        iteration++;
                        SendWake(0x00);
---                     SetReadDataPort((ULONG)IsaPnPReadPort);
+++                     SetReadDataPort((ULONG_PTR)IsaPnPReadPort);
                        KeStallExecutionProcessor(1000);
                        WriteAddress(0x01);
                        KeStallExecutionProcessor(1000);
@@@@ -1304,7 -1305,7 -1305,7 +1304,7 @@@@ static NTSTATUS BuildResourceLists(PISA
     do {
       Status = BuildResourceList(LogicalDevice, p, Priority);
       if (NT_SUCCESS(Status)) {
---      p = (PIO_RESOURCE_LIST)((ULONG)p + SingleListSize);
+++      p = (PIO_RESOURCE_LIST)((ULONG_PTR)p + SingleListSize);
         Priority++;
       }
     } while (Status != STATUS_NOT_FOUND);
@@@@ -1476,7 -1477,7 -1477,7 +1476,7 @@@@ ISAPNPQueryBusRelations
       CurrentEntry = CurrentEntry->Flink;
     }
   
---  Irp->IoStatus.Information = (ULONG)Relations;
+++  Irp->IoStatus.Information = (ULONG_PTR)Relations;
   
     return Status;
   }
@@@@ -24,7 -26,7 -26,7 +24,7 @@@@ BOO
   FASTCALL
   VerifyObjectOwner(PDD_ENTRY pEntry)
   {
---    DWORD Pid = (DWORD) PsGetCurrentProcessId() & 0xFFFFFFFC;
+++    DWORD Pid = (DWORD)(DWORD_PTR)PsGetCurrentProcessId() & 0xFFFFFFFC;
       DWORD check = pEntry->ObjectOwner.ulObj & 0xFFFFFFFE;
       return ( (check == Pid) || (!check));
   }
@@@@ -142,10 -144,10 -144,10 +142,10 @@@@ DdHmgDestroy(VOID
   *--*/
   PVOID
   FASTCALL
 --DdHmgLock( HANDLE DdHandle, UCHAR ObjectType,  BOOLEAN LockOwned)
 ++DdHmgLock(HANDLE DdHandle, UCHAR ObjectType, BOOLEAN LockOwned)
   {
   
---    DWORD Index = (DWORD)DdHandle & 0x1FFFFF;
+++    DWORD Index = (DWORD)(DWORD_PTR)DdHandle & 0x1FFFFF;
       PDD_ENTRY pEntry = NULL;
       PVOID Object = NULL;
   
@@@@ -88,7 -88,7 -88,7 +88,7 @@@@ FindRun (PNONRESIDENT_ATTRIBUTE NresAtt
   
     *lcn = 0;
   
---  for (run = (PUCHAR)((ULONG)NresAttr + NresAttr->RunArrayOffset);
+++  for (run = (PUCHAR)((ULONG_PTR)NresAttr + NresAttr->RunArrayOffset);
        *run != 0; run += RunLength(run))
       {
         *lcn += RunLCN(run);
@@@@ -248,7 -248,7 -248,7 +248,7 @@@@ NtfsDumpAttribute (PATTRIBUTE Attribute
       {
         Name.Length = Attribute->NameLength * sizeof(WCHAR);
         Name.MaximumLength = Name.Length;
---      Name.Buffer = (PWCHAR)((ULONG)Attribute + Attribute->NameOffset);
+++      Name.Buffer = (PWCHAR)((ULONG_PTR)Attribute + Attribute->NameOffset);
   
         DbgPrint("'%wZ' ", &Name);
       }
@@@@ -80,7 -79,7 -79,7 +80,7 @@@@ typedef struct _NIC_ADAPTE
       NDIS_MINIPORT_INTERRUPT Interrupt;
   
       /* I/O base address and interrupt number of adapter */
---    ULONG IoBaseAddress;
+++    ULONG_PTR IoBaseAddress;
       ULONG InterruptLevel;
       ULONG InterruptVector;
       BOOLEAN InterruptShared;
@@@@ -222,24 -220,24 -220,24 +222,24 @@@@ VOID NICUpdateCounters
   VOID NICReadDataAlign(
       PNIC_ADAPTER Adapter,
       PUSHORT Target,
---    ULONG Source,
+++    ULONG_PTR Source,
       USHORT Length);
   
   VOID NICWriteDataAlign(
       PNIC_ADAPTER Adapter,
---    ULONG Target,
+++    ULONG_PTR Target,
       PUSHORT Source,
       USHORT Length);
   
   VOID NICReadData(
       PNIC_ADAPTER Adapter,
       PUCHAR Target,
---    ULONG Source,
+++    ULONG_PTR Source,
       USHORT Length);
   
   VOID NICWriteData(
       PNIC_ADAPTER Adapter,
---    ULONG Target,
+++    ULONG_PTR Target,
       PUCHAR Source,
       USHORT Length);
   
   #include <debug.h>
   
   /* Null-terminated array of ports to probe. This is "semi-risky" (Don Becker).  */
---ULONG ProbeAddressList[] = { 0x280, 0x300, 0x320, 0x340, 0x360, 0x380, 0 };
+++ULONG_PTR ProbeAddressList[] = { 0x280, 0x300, 0x320, 0x340, 0x360, 0x380, 0 };
   
   static BOOLEAN ProbeAddressForNIC(
---    ULONG address)
+++    ULONG_PTR address)
   /*
    * FUNCTION: Probes an address for a NIC
    * ARGUMENTS:
@@@@ -129,7 -130,7 -130,7 +129,7 @@@@ static BOOLEAN NICTestRAM
    *     Start at 1KB and test for every 1KB up to 64KB
    */
   {
---    ULONG Base;
+++    ULONG_PTR Base;
   
       NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
   
@@@@ -802,7 -802,7 -802,7 +802,7 @@@@ SerialDeviceControl
                                 * as pending, it might be possible to complete the
                                 * Irp before pending it, leading to a crash! */
                                WaitingIrp = InterlockedCompareExchangePointer(
---                                     &DeviceExtension->WaitOnMaskIrp,
+++                                     (PVOID)&DeviceExtension->WaitOnMaskIrp,
                                        Irp,
                                        NULL);
   
   <module name="scsiport" type="kernelmodedriver" installbase="system32/drivers" installname="scsiport.sys">
        <bootstrap installbase="$(CDOUTPUT)" />
        <define name="_SCSIPORT_" />
-       <importlibrary definition="scsiport.spec" />
 --     <importlibrary definition="scsiport.spec.def" />
+++     <importlibrary definition="scsiport.pspec" />
        <include base="scsiport">.</include>
        <library>ntoskrnl</library>
        <library>hal</library>
        <file>scsiport.c</file>
+++     <file>stubs.c</file>
        <file>scsiport.rc</file>
 -      <file>scsiport.pspec</file>
  -     <file>scsiport.spec</file>
 --     <if property="ARCH" value="amd64">
 --             <file>stubs.c</file>
 --     </if>
   </module>
@@@@ -574,7 -562,7 -562,7 +574,7 @@@@ DrvGetModes(IN HANDLE Driver
                   /* next DEVMODE entry */
                   OutputModes--;
   
---                DM = (PDEVMODEW) ( ((ULONG)DM) + sizeof(DEVMODEW) + DRIVER_EXTRA_SIZE);
+++                DM = (PDEVMODEW) ( ((ULONG_PTR)DM) + sizeof(DEVMODEW) + DRIVER_EXTRA_SIZE);
   
                   OutputSize += (sizeof(DEVMODEW) + DRIVER_EXTRA_SIZE);
               }