ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
August 2018
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
32 participants
304 discussions
Start a n
N
ew thread
13/16: [MVDM] Fix 64 bit issues
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=807331436ee5de09dbd34…
commit 807331436ee5de09dbd34013fbbf237b7a92cc63 Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Mon Feb 12 00:38:10 2018 +0100 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Sat Aug 4 19:19:34 2018 +0200 [MVDM] Fix 64 bit issues --- subsystems/mvdm/ntvdm/bios/bios.c | 2 +- subsystems/mvdm/ntvdm/bios/bios32/bios32.c | 18 +++++++++--------- subsystems/mvdm/ntvdm/bios/bios32/dskbios32.c | 6 +++--- subsystems/mvdm/ntvdm/bios/vidbios.c | 10 +++++----- subsystems/mvdm/ntvdm/cpu/cpu.c | 2 +- subsystems/mvdm/ntvdm/dos/dem.c | 2 +- subsystems/mvdm/ntvdm/dos/dos32krnl/emsdrv.c | 4 ++-- subsystems/mvdm/ntvdm/dos/dos32krnl/process.c | 2 +- subsystems/mvdm/ntvdm/dos/mouse32.c | 12 ++++++------ subsystems/mvdm/ntvdm/emulator.c | 6 +++--- subsystems/mvdm/ntvdm/hardware/video/svga.c | 4 ++-- subsystems/mvdm/ntvdm/ntvdm.c | 4 ++-- subsystems/mvdm/ntvdm/ntvdm.h | 1 + 13 files changed, 37 insertions(+), 36 deletions(-) diff --git a/subsystems/mvdm/ntvdm/bios/bios.c b/subsystems/mvdm/ntvdm/bios/bios.c index 9ee04e264d..14c44ae5ee 100644 --- a/subsystems/mvdm/ntvdm/bios/bios.c +++ b/subsystems/mvdm/ntvdm/bios/bios.c @@ -64,7 +64,7 @@ BiosInitialize(IN LPCSTR BiosFileName, BOOLEAN Success2 = FALSE; LPCSTR RomFile; LPSTR ptr; - ULONG RomAddress; + ULONG_PTR RomAddress; CHAR RomFileName[MAX_PATH + 10 + 1]; /* Disable interrupts */ diff --git a/subsystems/mvdm/ntvdm/bios/bios32/bios32.c b/subsystems/mvdm/ntvdm/bios/bios32/bios32.c index 1a65f0e0a3..a6dfa39de8 100644 --- a/subsystems/mvdm/ntvdm/bios/bios32/bios32.c +++ b/subsystems/mvdm/ntvdm/bios/bios32/bios32.c @@ -1017,16 +1017,16 @@ static VOID InitializeBiosInt32(VOID) // They don't have any default handler at the moment. /* Some vectors are in fact addresses to tables */ - ((PULONG)BaseAddress)[0x1D] = (ULONG)NULL; // Video Parameter Tables - ((PULONG)BaseAddress)[0x1E] = (ULONG)NULL; // Diskette Parameters - ((PULONG)BaseAddress)[0x1F] = (ULONG)NULL; // 8x8 Graphics Font - ((PULONG)BaseAddress)[0x41] = (ULONG)NULL; // Hard Disk 0 Parameter Table Address - ((PULONG)BaseAddress)[0x43] = (ULONG)NULL; // Character Table (EGA, MCGA, VGA) - ((PULONG)BaseAddress)[0x46] = (ULONG)NULL; // Hard Disk 1 Drive Parameter Table Address + ((PULONG)BaseAddress)[0x1D] = NULL32; // Video Parameter Tables + ((PULONG)BaseAddress)[0x1E] = NULL32; // Diskette Parameters + ((PULONG)BaseAddress)[0x1F] = NULL32; // 8x8 Graphics Font + ((PULONG)BaseAddress)[0x41] = NULL32; // Hard Disk 0 Parameter Table Address + ((PULONG)BaseAddress)[0x43] = NULL32; // Character Table (EGA, MCGA, VGA) + ((PULONG)BaseAddress)[0x46] = NULL32; // Hard Disk 1 Drive Parameter Table Address /* Tables that are always uninitialized */ - ((PULONG)BaseAddress)[0x44] = (ULONG)NULL; // ROM BIOS Character Font, Characters 00h-7Fh (PCjr) - ((PULONG)BaseAddress)[0x48] = (ULONG)NULL; // Cordless Keyboard Translation (PCjr) - ((PULONG)BaseAddress)[0x49] = (ULONG)NULL; // Non-Keyboard Scan-code Translation Table (PCJr) + ((PULONG)BaseAddress)[0x44] = NULL32; // ROM BIOS Character Font, Characters 00h-7Fh (PCjr) + ((PULONG)BaseAddress)[0x48] = NULL32; // Cordless Keyboard Translation (PCjr) + ((PULONG)BaseAddress)[0x49] = NULL32; // Non-Keyboard Scan-code Translation Table (PCJr) } static VOID InitializeBiosData(VOID) diff --git a/subsystems/mvdm/ntvdm/bios/bios32/dskbios32.c b/subsystems/mvdm/ntvdm/bios/bios32/dskbios32.c index a4731787bb..2a3691ea19 100644 --- a/subsystems/mvdm/ntvdm/bios/bios32/dskbios32.c +++ b/subsystems/mvdm/ntvdm/bios/bios32/dskbios32.c @@ -654,12 +654,12 @@ VOID DiskBios32Post(VOID) // Diskette Parameters ((PULONG)BaseAddress)[0x1E] = MAKELONG(0xEFC7, BIOS_SEGMENT); // Hard Disk 0 Parameter Table Address - ((PULONG)BaseAddress)[0x41] = (ULONG)NULL; + ((PULONG)BaseAddress)[0x41] = NULL32; // Hard Disk 1 Drive Parameter Table Address - ((PULONG)BaseAddress)[0x46] = (ULONG)NULL; + ((PULONG)BaseAddress)[0x46] = NULL32; /* Relocated services by the BIOS (when needed) */ - ((PULONG)BaseAddress)[0x40] = (ULONG)NULL; // ROM BIOS Diskette Handler relocated by Hard Disk BIOS + ((PULONG)BaseAddress)[0x40] = NULL32; // ROM BIOS Diskette Handler relocated by Hard Disk BIOS // RegisterBiosInt32(0x40, NULL); // ROM BIOS Diskette Handler relocated by Hard Disk BIOS /* Register the BIOS 32-bit Interrupts */ diff --git a/subsystems/mvdm/ntvdm/bios/vidbios.c b/subsystems/mvdm/ntvdm/bios/vidbios.c index a2e19ac756..54ce259c7b 100644 --- a/subsystems/mvdm/ntvdm/bios/vidbios.c +++ b/subsystems/mvdm/ntvdm/bios/vidbios.c @@ -3628,7 +3628,7 @@ VOID WINAPI VidBiosVideoService(LPWORD Stack) /* Get Current Character Font Information */ case 0x30: { - ULONG Address = (ULONG)NULL; + ULONG Address = NULL32; switch (getBH()) { @@ -3936,16 +3936,16 @@ VOID VidBiosPost(VOID) */ /* Some vectors are in fact addresses to tables */ - ((PULONG)BaseAddress)[0x1D] = (ULONG)NULL; // Video Parameter Tables + ((PULONG)BaseAddress)[0x1D] = NULL32; // Video Parameter Tables // Far pointer to the 8x8 graphics font for the 8x8 characters 80h-FFh ((PULONG)BaseAddress)[0x1F] = MAKELONG(FONT_8x8_HIGH_OFFSET, VIDEO_BIOS_DATA_SEG); // Far pointer to the character table (EGA, MCGA, VGA) for the 8x16 characters 00h-... ((PULONG)BaseAddress)[0x43] = MAKELONG(FONT_8x16_OFFSET, VIDEO_BIOS_DATA_SEG); - ((PULONG)BaseAddress)[0x44] = (ULONG)NULL; // ROM BIOS Character Font, Characters 00h-7Fh (PCjr) + ((PULONG)BaseAddress)[0x44] = NULL32; // ROM BIOS Character Font, Characters 00h-7Fh (PCjr) /* Relocated services by the BIOS (when needed) */ - ((PULONG)BaseAddress)[0x42] = (ULONG)NULL; // Relocated Default INT 10h Video Services - ((PULONG)BaseAddress)[0x6D] = (ULONG)NULL; // Video BIOS Entry Point + ((PULONG)BaseAddress)[0x42] = NULL32; // Relocated Default INT 10h Video Services + ((PULONG)BaseAddress)[0x6D] = NULL32; // Video BIOS Entry Point // // FIXME: At the moment we always set a VGA mode. In the future, diff --git a/subsystems/mvdm/ntvdm/cpu/cpu.c b/subsystems/mvdm/ntvdm/cpu/cpu.c index 212f522d0a..2fcbc00dd8 100644 --- a/subsystems/mvdm/ntvdm/cpu/cpu.c +++ b/subsystems/mvdm/ntvdm/cpu/cpu.c @@ -147,7 +147,7 @@ LONG CpuExceptionFilter(IN PEXCEPTION_POINTERS ExceptionInfo) Fast486Rewind(&EmulatorContext); /* Call the memory handler */ - MemExceptionHandler((ULONG)PHYS_TO_REAL(Address), Writing); + MemExceptionHandler((ULONG_PTR)PHYS_TO_REAL(Address), Writing); /* The execution of the CPU opcode handler MUST NOT continue */ return EXCEPTION_EXECUTE_HANDLER; diff --git a/subsystems/mvdm/ntvdm/dos/dem.c b/subsystems/mvdm/ntvdm/dos/dem.c index 1c81eacc1c..d1edc10d2f 100644 --- a/subsystems/mvdm/ntvdm/dos/dem.c +++ b/subsystems/mvdm/ntvdm/dos/dem.c @@ -418,7 +418,7 @@ static VOID CmdStartExternalCommand(VOID) LPSTR Command = (LPSTR)SEG_OFF_TO_PTR(getDS(), getSI()); CHAR CmdLine[sizeof("cmd.exe /c ") + DOS_CMDLINE_LENGTH + 1] = ""; LPSTR CmdLinePtr; - ULONG CmdLineLen; + SIZE_T CmdLineLen; /* Spawn a user-defined 32-bit command preprocessor */ diff --git a/subsystems/mvdm/ntvdm/dos/dos32krnl/emsdrv.c b/subsystems/mvdm/ntvdm/dos/dos32krnl/emsdrv.c index 8ba74891c9..7f4026012a 100644 --- a/subsystems/mvdm/ntvdm/dos/dos32krnl/emsdrv.c +++ b/subsystems/mvdm/ntvdm/dos/dos32krnl/emsdrv.c @@ -830,7 +830,7 @@ BOOLEAN EmsDrvInitialize(USHORT Segment, ULONG TotalPages) return FALSE; } - MemInstallFastMemoryHook((PVOID)TO_LINEAR(EmsSegment, 0), + MemInstallFastMemoryHook(UlongToPtr(TO_LINEAR(EmsSegment, 0)), EMS_PHYSICAL_PAGES * EMS_PAGE_SIZE, EmsReadMemory, EmsWriteMemory); @@ -852,7 +852,7 @@ VOID EmsDrvCleanup(VOID) /* Delete the device */ DosDeleteDevice(Node); - MemRemoveFastMemoryHook((PVOID)TO_LINEAR(EmsSegment, 0), + MemRemoveFastMemoryHook(UlongToPtr(TO_LINEAR(EmsSegment, 0)), EMS_PHYSICAL_PAGES * EMS_PAGE_SIZE); if (EmsMemory) diff --git a/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c b/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c index 01291b4506..7f356b0912 100644 --- a/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c +++ b/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c @@ -174,7 +174,7 @@ static WORD DosCopyEnvironmentBlock(IN LPCSTR Environment OPTIONAL, IN LPCSTR ProgramName) { PCHAR Ptr, DestBuffer = NULL; - ULONG TotalSize = 0; + SIZE_T TotalSize = 0; WORD DestSegment; /* If we have an environment strings list, compute its size */ diff --git a/subsystems/mvdm/ntvdm/dos/mouse32.c b/subsystems/mvdm/ntvdm/dos/mouse32.c index 7b0671b8b5..1353bb5681 100644 --- a/subsystems/mvdm/ntvdm/dos/mouse32.c +++ b/subsystems/mvdm/ntvdm/dos/mouse32.c @@ -397,7 +397,7 @@ static VOID CallMouseUserHandlers(USHORT CallMask) /* Call handler 0 */ if ((DriverState.Handler0.CallMask & CallMask) != 0 && - DriverState.Handler0.Callback != (ULONG)NULL) + DriverState.Handler0.Callback != NULL32) { /* * Set the parameters for the callback. @@ -445,7 +445,7 @@ static VOID CallMouseUserHandlers(USHORT CallMask) { /* Call the suitable handlers */ if ((DriverState.Handlers[i].CallMask & CallMask) != 0 && - DriverState.Handlers[i].Callback != (ULONG)NULL) + DriverState.Handlers[i].Callback != NULL32) { /* * Set the parameters for the callback. @@ -920,13 +920,13 @@ static VOID WINAPI DosMouseService(LPWORD Stack) { /* Found it, undefine the handler */ DriverState.Handlers[i].CallMask = 0x0000; - DriverState.Handlers[i].Callback = (ULONG)NULL; + DriverState.Handlers[i].Callback = NULL32; Success = TRUE; break; } } } - else if (Callback == (ULONG)NULL) + else if (Callback == NULL32) { /* * Find the handler entry corresponding to the given @@ -938,7 +938,7 @@ static VOID WINAPI DosMouseService(LPWORD Stack) { /* Found it, undefine the handler */ DriverState.Handlers[i].CallMask = 0x0000; - DriverState.Handlers[i].Callback = (ULONG)NULL; + DriverState.Handlers[i].Callback = NULL32; Success = TRUE; break; } @@ -959,7 +959,7 @@ static VOID WINAPI DosMouseService(LPWORD Stack) /* Find the first empty handler */ if (EmptyHandler == 0xFFFF && DriverState.Handlers[i].CallMask == 0x0000 && - DriverState.Handlers[i].Callback == (ULONG)NULL) + DriverState.Handlers[i].Callback == NULL32) { EmptyHandler = i; } diff --git a/subsystems/mvdm/ntvdm/emulator.c b/subsystems/mvdm/ntvdm/emulator.c index b90d8e8313..2a6b186f27 100644 --- a/subsystems/mvdm/ntvdm/emulator.c +++ b/subsystems/mvdm/ntvdm/emulator.c @@ -304,7 +304,7 @@ static VOID DumpMemoryRaw(HANDLE hFile) { PVOID Buffer; - SIZE_T Size; + DWORD Size; /* Dump the VM memory */ SetFilePointer(hFile, 0, NULL, FILE_BEGIN); @@ -321,7 +321,7 @@ DumpMemoryTxt(HANDLE hFile) PBYTE Ptr1, Ptr2; CHAR LineBuffer[LINE_SIZE]; PCHAR Line; - SIZE_T LineSize; + DWORD LineSize; /* Dump the VM memory */ SetFilePointer(hFile, 0, NULL, FILE_BEGIN); @@ -332,7 +332,7 @@ DumpMemoryTxt(HANDLE hFile) Line = LineBuffer; /* Print the address */ - Line += snprintf(Line, LINE_SIZE + LineBuffer - Line, "%08x ", PHYS_TO_REAL(Ptr1)); + Line += snprintf(Line, LINE_SIZE + LineBuffer - Line, "%08Ix ", (ULONG_PTR)PHYS_TO_REAL(Ptr1)); /* Print up to 16 bytes... */ diff --git a/subsystems/mvdm/ntvdm/hardware/video/svga.c b/subsystems/mvdm/ntvdm/hardware/video/svga.c index b253d6da09..209f8ead5a 100644 --- a/subsystems/mvdm/ntvdm/hardware/video/svga.c +++ b/subsystems/mvdm/ntvdm/hardware/video/svga.c @@ -1296,7 +1296,7 @@ static inline VOID VgaWriteGc(BYTE Data) UCHAR MemoryMap = (VgaGcRegisters[VGA_GC_MISC_REG] >> 2) & 0x03; /* Register a memory hook */ - MemInstallFastMemoryHook((PVOID)MemoryBase[MemoryMap], + MemInstallFastMemoryHook(UlongToPtr(MemoryBase[MemoryMap]), MemorySize[MemoryMap], VgaReadMemory, VgaWriteMemory); @@ -1466,7 +1466,7 @@ static VOID WINAPI VgaWritePort(USHORT Port, BYTE Data) UCHAR MemoryMap = (VgaGcRegisters[VGA_GC_MISC_REG] >> 2) & 0x03; /* Register a memory hook */ - MemInstallFastMemoryHook((PVOID)MemoryBase[MemoryMap], + MemInstallFastMemoryHook(UlongToPtr(MemoryBase[MemoryMap]), MemorySize[MemoryMap], VgaReadMemory, VgaWriteMemory); diff --git a/subsystems/mvdm/ntvdm/ntvdm.c b/subsystems/mvdm/ntvdm/ntvdm.c index 48045369bb..4e5cd99a1c 100644 --- a/subsystems/mvdm/ntvdm/ntvdm.c +++ b/subsystems/mvdm/ntvdm/ntvdm.c @@ -95,7 +95,7 @@ NtVdmConfigureFloppy(IN PWSTR ValueName, { BOOLEAN Success; PNTVDM_SETTINGS Settings = (PNTVDM_SETTINGS)Context; - ULONG DiskNumber = (ULONG)EntryContext; + ULONG DiskNumber = PtrToUlong(EntryContext); ASSERT(DiskNumber < ARRAYSIZE(Settings->FloppyDisks)); @@ -131,7 +131,7 @@ NtVdmConfigureHDD(IN PWSTR ValueName, { BOOLEAN Success; PNTVDM_SETTINGS Settings = (PNTVDM_SETTINGS)Context; - ULONG DiskNumber = (ULONG)EntryContext; + ULONG DiskNumber = PtrToUlong(EntryContext); ASSERT(DiskNumber < ARRAYSIZE(Settings->HardDisks)); diff --git a/subsystems/mvdm/ntvdm/ntvdm.h b/subsystems/mvdm/ntvdm/ntvdm.h index 60a763fd15..17dbd8dfa1 100644 --- a/subsystems/mvdm/ntvdm/ntvdm.h +++ b/subsystems/mvdm/ntvdm/ntvdm.h @@ -67,6 +67,7 @@ DWORD WINAPI SetLastConsoleEventActive(VOID); #define ADVANCED_DEBUGGING_LEVEL 1 #endif +#define NULL32 0 /* VARIABLES ******************************************************************/
6 years, 4 months
1
0
0
0
12/16: [WINSRV] Fix 64 bit issues
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3323d117c351cc26122a7…
commit 3323d117c351cc26122a7749d9d214c59b66de7c Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Sun Mar 4 16:07:41 2018 +0100 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Sat Aug 4 19:19:34 2018 +0200 [WINSRV] Fix 64 bit issues --- win32ss/user/winsrv/concfg/font.c | 2 +- win32ss/user/winsrv/consrv/condrv/graphics.c | 2 +- win32ss/user/winsrv/consrv/frontends/gui/guisettings.c | 4 ++-- win32ss/user/winsrv/consrv/subsysreg.c | 2 +- win32ss/user/winsrv/usersrv/init.c | 12 +++++++++--- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/win32ss/user/winsrv/concfg/font.c b/win32ss/user/winsrv/concfg/font.c index 46f6a9f7da..fdc4e15f84 100644 --- a/win32ss/user/winsrv/concfg/font.c +++ b/win32ss/user/winsrv/concfg/font.c @@ -28,7 +28,7 @@ CodePageToCharSet( IN UINT CodePage) { CHARSETINFO CharInfo; - if (TranslateCharsetInfo((LPDWORD)CodePage, &CharInfo, TCI_SRCCODEPAGE)) + if (TranslateCharsetInfo(UlongToPtr(CodePage), &CharInfo, TCI_SRCCODEPAGE)) return CharInfo.ciCharset; else return DEFAULT_CHARSET; diff --git a/win32ss/user/winsrv/consrv/condrv/graphics.c b/win32ss/user/winsrv/consrv/condrv/graphics.c index a71bb3c73a..cc168cb893 100644 --- a/win32ss/user/winsrv/consrv/condrv/graphics.c +++ b/win32ss/user/winsrv/consrv/condrv/graphics.c @@ -50,7 +50,7 @@ GRAPHICS_BUFFER_Initialize(OUT PCONSOLE_SCREEN_BUFFER* Buffer, PGRAPHICS_SCREEN_BUFFER NewBuffer = NULL; LARGE_INTEGER SectionSize; - ULONG ViewSize = 0; + SIZE_T ViewSize = 0; if (Buffer == NULL || Console == NULL || GraphicsInfo == NULL) return STATUS_INVALID_PARAMETER; diff --git a/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c b/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c index b61d84e86c..e317334790 100644 --- a/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c +++ b/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c @@ -77,7 +77,7 @@ GuiConsoleShowConsoleProperties(PGUI_CONSOLE_DATA GuiData, { PCONSOLE_SCREEN_BUFFER ActiveBuffer = GuiData->ActiveBuffer; LARGE_INTEGER SectionSize; - ULONG ViewSize = 0; + SIZE_T ViewSize = 0; PCONSOLE_STATE_INFO pSharedInfo = NULL; /* @@ -262,7 +262,7 @@ GuiApplyUserSettings(PGUI_CONSOLE_DATA GuiData, PCONSRV_CONSOLE Console = GuiData->Console; PCONSOLE_PROCESS_DATA ProcessData; HANDLE hSection = NULL; - ULONG ViewSize = 0; + SIZE_T ViewSize = 0; PCONSOLE_STATE_INFO pConInfo = NULL; if (!ConDrvValidateConsoleUnsafe((PCONSOLE)Console, CONSOLE_RUNNING, TRUE)) return; diff --git a/win32ss/user/winsrv/consrv/subsysreg.c b/win32ss/user/winsrv/consrv/subsysreg.c index 6874ac6d9d..9dd14a25dd 100644 --- a/win32ss/user/winsrv/consrv/subsysreg.c +++ b/win32ss/user/winsrv/consrv/subsysreg.c @@ -38,7 +38,7 @@ CSR_API(SrvRegisterConsoleVDM) if (RegisterVDMRequest->RegisterFlags != 0) { LARGE_INTEGER SectionSize; - ULONG Size, ViewSize = 0; + SIZE_T Size, ViewSize = 0; HANDLE ProcessHandle; /* diff --git a/win32ss/user/winsrv/usersrv/init.c b/win32ss/user/winsrv/usersrv/init.c index 8ee21e6417..d70209e688 100644 --- a/win32ss/user/winsrv/usersrv/init.c +++ b/win32ss/user/winsrv/usersrv/init.c @@ -114,7 +114,7 @@ ULONG NTAPI CreateSystemThreads(PVOID pParam) { - NtUserCallOneParam((DWORD)pParam, ONEPARAM_ROUTINE_CREATESYSTEMTHREADS); + NtUserCallOneParam((DWORD_PTR)pParam, ONEPARAM_ROUTINE_CREATESYSTEMTHREADS); RtlExitUserThread(0); return 0; } @@ -292,9 +292,15 @@ CSR_SERVER_DLL_INIT(UserServerDllInitialization) for (i = 0; i < 2; ++i) { Status = RtlCreateUserThread(NtCurrentProcess(), - NULL, TRUE, 0, 0, 0, + NULL, + TRUE, + 0, + 0, + 0, CreateSystemThreads, - (PVOID)i, &ServerThread, &ClientId); + UlongToPtr(i), + &ServerThread, + &ClientId); if (NT_SUCCESS(Status)) { NtResumeThread(ServerThread, NULL);
6 years, 4 months
1
0
0
0
11/16: [REACTX] Fix 64 bit issues
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2a5e2a2ab6d007133fca3…
commit 2a5e2a2ab6d007133fca3ed5f0a1eacda8f15e45 Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Sun Mar 4 21:58:15 2018 +0100 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Sat Aug 4 19:19:34 2018 +0200 [REACTX] Fix 64 bit issues --- win32ss/reactx/dxg/ddhmg.c | 10 +++++----- win32ss/reactx/dxg/ddraw.c | 10 +++++----- win32ss/reactx/dxg/dxg_int.h | 2 +- win32ss/reactx/ntddraw/dxeng.c | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/win32ss/reactx/dxg/ddhmg.c b/win32ss/reactx/dxg/ddhmg.c index 6517ccf246..609592ffbb 100644 --- a/win32ss/reactx/dxg/ddhmg.c +++ b/win32ss/reactx/dxg/ddhmg.c @@ -27,7 +27,7 @@ FASTCALL VerifyObjectOwner(PDD_ENTRY pEntry) { DWORD Pid = (DWORD)(DWORD_PTR)PsGetCurrentProcessId() & 0xFFFFFFFC; - DWORD check = (DWORD)pEntry->Pid & 0xFFFFFFFE; + DWORD check = (DWORD_PTR)pEntry->Pid & 0xFFFFFFFE; return ( (check == Pid) || (!check)); } @@ -163,7 +163,7 @@ DdHmgLock(HANDLE DdHandle, UCHAR ObjectType, BOOLEAN LockOwned) if ( VerifyObjectOwner(pEntry) ) { if ( ( pEntry->Objt == ObjectType ) && - ( pEntry->FullUnique == (((ULONG)DdHandle >> 21) & 0x7FF) ) && + ( pEntry->FullUnique == (((ULONG_PTR)DdHandle >> 21) & 0x7FF) ) && ( !pEntry->pobj->cExclusiveLock ) ) { InterlockedIncrement((VOID*)&pEntry->pobj->cExclusiveLock); @@ -261,7 +261,7 @@ DdGetFreeHandle(UCHAR objType) PVOID mAllocMem = NULL; ULONG mAllocEntries = 0; PDD_ENTRY pEntry = NULL; - ULONG retVal; + ULONG_PTR retVal; ULONG index; // check if memory is allocated @@ -362,7 +362,7 @@ DdHmgAlloc(ULONG objSize, CHAR objType, BOOLEAN objLock) pEntry->pobj = pObject; pEntry->Objt = objType; - pEntry->Pid = (HANDLE)(((ULONG)PsGetCurrentProcessId() & 0xFFFFFFFC) | ((ULONG)(pEntry->Pid) & 1)); + pEntry->Pid = (HANDLE)(((ULONG_PTR)PsGetCurrentProcessId() & 0xFFFFFFFC) | ((ULONG_PTR)(pEntry->Pid) & 1)); if (objLock) { @@ -417,7 +417,7 @@ DdHmgFree(HANDLE DdHandle) pEntry->NextFree = ghFreeDdHmgr; // reset process ID - pEntry->Pid = (HANDLE)((DWORD)pEntry->Pid & 1); + pEntry->Pid = (HANDLE)((DWORD_PTR)pEntry->Pid & 1); ghFreeDdHmgr = Index; EngReleaseSemaphore(ghsemHmgr); diff --git a/win32ss/reactx/dxg/ddraw.c b/win32ss/reactx/dxg/ddraw.c index 582a897f5c..1a639a39ef 100644 --- a/win32ss/reactx/dxg/ddraw.c +++ b/win32ss/reactx/dxg/ddraw.c @@ -260,7 +260,7 @@ DxDdCreateDirectDrawObject( { PDC pDC = NULL; HDEV hDev = NULL; - DWORD retVal = 0; + DWORD_PTR retVal = 0; pDC = gpEngFuncs.DxEngLockDC(hDC); if (!pDC) @@ -284,7 +284,7 @@ DxDdCreateDirectDrawObject( // create object only for 8BPP and more if (gpEngFuncs.DxEngGetHdevData(hDev, DxEGShDevData_DitherFmt) >= BMF_8BPP) - retVal = (DWORD)intDdCreateDirectDrawLocal(hDev); + retVal = (DWORD_PTR)intDdCreateDirectDrawLocal(hDev); gpEngFuncs.DxEngUnlockHdev(hDev); gpEngFuncs.DxEngUnlockDC(pDC); @@ -458,8 +458,8 @@ DxDdQueryDirectDrawObject( if (pCallBackFlags) { *(DWORD*)pCallBackFlags = peDdGl->ddCallbacks.dwFlags; - *(DWORD*)((ULONG)pCallBackFlags + 4) = peDdGl->ddSurfaceCallbacks.dwFlags; - *(DWORD*)((ULONG)pCallBackFlags + 8) = peDdGl->ddPaletteCallbacks.dwFlags; + *(DWORD*)((ULONG_PTR)pCallBackFlags + 4) = peDdGl->ddSurfaceCallbacks.dwFlags; + *(DWORD*)((ULONG_PTR)pCallBackFlags + 8) = peDdGl->ddPaletteCallbacks.dwFlags; } if (pd3dNtHalCallbacks) @@ -636,7 +636,7 @@ intDdCreateNewSurfaceObject(PEDD_DIRECTDRAW_LOCAL peDdL, HANDLE hDirectDrawLocal pSurface->hSecure = (VOID*)1; peDdL->peSurface_DdList = pSurface; - peDdL->hSurface = (ULONG)pSurface->pobj.hHmgr; + peDdL->hSurface = (ULONG_PTR)pSurface->pobj.hHmgr; } return pSurface; diff --git a/win32ss/reactx/dxg/dxg_int.h b/win32ss/reactx/dxg/dxg_int.h index dec133499f..fa9c3170a8 100644 --- a/win32ss/reactx/dxg/dxg_int.h +++ b/win32ss/reactx/dxg/dxg_int.h @@ -11,7 +11,7 @@ #define NT_BUILD_ENVIRONMENT #define DDHMG_HANDLE_LIMIT 0x200000 -#define DDHMG_HTOI(DdHandle) ((DWORD)DdHandle & (DDHMG_HANDLE_LIMIT-1)) +#define DDHMG_HTOI(DdHandle) ((DWORD_PTR)DdHandle & (DDHMG_HANDLE_LIMIT-1)) #include <windef.h> diff --git a/win32ss/reactx/ntddraw/dxeng.c b/win32ss/reactx/ntddraw/dxeng.c index b42220479c..f1c681f1e3 100644 --- a/win32ss/reactx/ntddraw/dxeng.c +++ b/win32ss/reactx/ntddraw/dxeng.c @@ -357,7 +357,7 @@ DxEngGetHdevData(HDEV hDev, break; case DxEGShDevData_ldev: DPRINT1("requested DXEGSHDEVDATA DxEGShDevData_ldev\n"); - retVal = (DWORD) PDev->pldev; + retVal = (DWORD_PTR) PDev->pldev; break; case DxEGShDevData_GDev: DPRINT1("requested DXEGSHDEVDATA DxEGShDevData_GDev\n");
6 years, 4 months
1
0
0
0
10/16: [APPHELP] Fix 64 bit issues
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e59d7a5687bb3a20bef88…
commit e59d7a5687bb3a20bef88e51409aa087c2376dc5 Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Sun Mar 4 16:04:17 2018 +0100 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Sat Aug 4 19:19:34 2018 +0200 [APPHELP] Fix 64 bit issues --- dll/appcompat/apphelp/sdbfileattr.c | 2 +- dll/appcompat/apphelp/shimeng.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dll/appcompat/apphelp/sdbfileattr.c b/dll/appcompat/apphelp/sdbfileattr.c index 61177b0239..4be994a4d9 100644 --- a/dll/appcompat/apphelp/sdbfileattr.c +++ b/dll/appcompat/apphelp/sdbfileattr.c @@ -286,7 +286,7 @@ BOOL WINAPI SdbGetFileAttributes(LPCWSTR path, PATTRINFO *attr_info_ret, LPDWORD if (headers && module_type == MODTYPE_PE && ((PBYTE)(headers+1) <= mapping_end)) { DWORD info_size; - SIZE_T export_dir_size; + ULONG export_dir_size; PIMAGE_EXPORT_DIRECTORY export_dir; info_size = GetFileVersionInfoSizeW(path, NULL); diff --git a/dll/appcompat/apphelp/shimeng.c b/dll/appcompat/apphelp/shimeng.c index 3b0e7d0866..8f3fe2bab0 100644 --- a/dll/appcompat/apphelp/shimeng.c +++ b/dll/appcompat/apphelp/shimeng.c @@ -597,9 +597,9 @@ FARPROC WINAPI StubGetProcAddress(HINSTANCE hModule, LPCSTR lpProcName) PHOOKMODULEINFO HookModuleInfo; FARPROC proc = ((GETPROCADDRESSPROC)g_IntHookEx[0].OriginalFunction)(hModule, lpProcName); - if (!HIWORD(lpProcName)) + if ((DWORD_PTR)lpProcName <= MAXUSHORT) { - sprintf(szOrdProcName, "#%lu", (DWORD)lpProcName); + sprintf(szOrdProcName, "#%Iu", (DWORD_PTR)lpProcName); lpPrintName = szOrdProcName; } @@ -676,7 +676,7 @@ VOID SeiPatchNewImport(PIMAGE_THUNK_DATA FirstThunk, PHOOKAPIEX HookApi, PLDR_DA { ULONG OldProtection = 0; PVOID Ptr; - ULONG Size; + SIZE_T Size; NTSTATUS Status; SHIMENG_INFO("Hooking API \"%s!%s\" for DLL \"%wZ\"\n", HookApi->LibraryName, HookApi->FunctionName, &LdrEntry->BaseDllName);
6 years, 4 months
1
0
0
0
09/16: [SHELL32] Fix 64 bit issues
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=52ea7d39dbd35ae8864b9…
commit 52ea7d39dbd35ae8864b9dcc7caeea2bb0adb12b Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Sun Mar 4 16:05:00 2018 +0100 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Sat Aug 4 19:19:34 2018 +0200 [SHELL32] Fix 64 bit issues --- dll/win32/shell32/folders/CDesktopFolder.cpp | 2 +- dll/win32/shell32/folders/CRegFolder.cpp | 6 +++--- dll/win32/shell32/shlfileop.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dll/win32/shell32/folders/CDesktopFolder.cpp b/dll/win32/shell32/folders/CDesktopFolder.cpp index b5bb839603..4105932915 100644 --- a/dll/win32/shell32/folders/CDesktopFolder.cpp +++ b/dll/win32/shell32/folders/CDesktopFolder.cpp @@ -845,7 +845,7 @@ HRESULT WINAPI CDesktopFolder::CallBack(IShellFolder *psf, HWND hwndOwner, IData { if (uMsg == DFM_INVOKECOMMAND && wParam == 0) { - if (32 >= (UINT)ShellExecuteW(hwndOwner, L"open", L"rundll32.exe shell32.dll,Control_RunDLL desk.cpl", NULL, NULL, SW_SHOWNORMAL)) + if (32 >= (UINT_PTR)ShellExecuteW(hwndOwner, L"open", L"rundll32.exe shell32.dll,Control_RunDLL desk.cpl", NULL, NULL, SW_SHOWNORMAL)) return E_FAIL; return S_OK; } diff --git a/dll/win32/shell32/folders/CRegFolder.cpp b/dll/win32/shell32/folders/CRegFolder.cpp index fa233124d5..fc8eba29fe 100644 --- a/dll/win32/shell32/folders/CRegFolder.cpp +++ b/dll/win32/shell32/folders/CRegFolder.cpp @@ -41,18 +41,18 @@ HRESULT CALLBACK RegFolderContextMenuCallback(IShellFolder *psf, if (_ILIsMyComputer(apidl[0])) { - if (32 >= (UINT)ShellExecuteW(hwnd, L"open", L"rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl", NULL, NULL, SW_SHOWNORMAL)) + if (32 >= (UINT_PTR)ShellExecuteW(hwnd, L"open", L"rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl", NULL, NULL, SW_SHOWNORMAL)) hr = E_FAIL; } else if (_ILIsDesktop(apidl[0])) { - if (32 >= (UINT)ShellExecuteW(hwnd, L"open", L"rundll32.exe shell32.dll,Control_RunDLL desk.cpl", NULL, NULL, SW_SHOWNORMAL)) + if (32 >= (UINT_PTR)ShellExecuteW(hwnd, L"open", L"rundll32.exe shell32.dll,Control_RunDLL desk.cpl", NULL, NULL, SW_SHOWNORMAL)) hr = E_FAIL; } else if (_ILIsNetHood(apidl[0])) { // FIXME path! - if (32 >= (UINT)ShellExecuteW(NULL, L"open", L"explorer.exe", + if (32 >= (UINT_PTR)ShellExecuteW(NULL, L"open", L"explorer.exe", L"::{7007ACC7-3202-11D1-AAD2-00805FC1270E}", NULL, SW_SHOWDEFAULT)) hr = E_FAIL; diff --git a/dll/win32/shell32/shlfileop.cpp b/dll/win32/shell32/shlfileop.cpp index e07d32d8d7..63486989db 100644 --- a/dll/win32/shell32/shlfileop.cpp +++ b/dll/win32/shell32/shlfileop.cpp @@ -1530,7 +1530,7 @@ static HRESULT delete_files(FILE_OPERATION *op, const FILE_LIST *flFrom) { fileEntry = &flFrom->feFiles[i]; - if ((HANDLE)fileEntry->attributes == INVALID_HANDLE_VALUE) + if (fileEntry->attributes == (ULONG)-1) { // This is a windows 2003 server specific value which has been removed. // Later versions of windows return ERROR_FILE_NOT_FOUND.
6 years, 4 months
1
0
0
0
08/16: [USER32] Fix 64 bit issues
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e9ad66d52f6809ecf7745…
commit e9ad66d52f6809ecf7745544343d00172f87ee9c Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Sun Mar 4 17:44:13 2018 +0100 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Sat Aug 4 19:19:34 2018 +0200 [USER32] Fix 64 bit issues --- win32ss/user/user32/misc/desktop.c | 2 +- win32ss/user/user32/misc/dllmain.c | 2 +- win32ss/user/user32/windows/cursoricon.c | 2 +- win32ss/user/user32/windows/defwnd.c | 2 +- win32ss/user/user32/windows/dialog.c | 2 +- win32ss/user/user32/windows/messagebox.c | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/win32ss/user/user32/misc/desktop.c b/win32ss/user/user32/misc/desktop.c index edf17e8199..bd3ca78826 100644 --- a/win32ss/user/user32/misc/desktop.c +++ b/win32ss/user/user32/misc/desktop.c @@ -563,7 +563,7 @@ GetThreadDesktop( } return NtUserGetThreadDesktop(dwThreadId, - (DWORD)GetThreadConsoleDesktopRequest->ConsoleDesktop); + (DWORD_PTR)GetThreadConsoleDesktopRequest->ConsoleDesktop); } diff --git a/win32ss/user/user32/misc/dllmain.c b/win32ss/user/user32/misc/dllmain.c index 5bf68551f7..704cb2c49a 100644 --- a/win32ss/user/user32/misc/dllmain.c +++ b/win32ss/user/user32/misc/dllmain.c @@ -574,7 +574,7 @@ User32CallGetCharsetInfo(PVOID Arguments, ULONG ArgumentLength) TRACE("GetCharsetInfo\n"); - Ret = TranslateCharsetInfo((DWORD *)pgci->Locale, &pgci->Cs, TCI_SRCLOCALE); + Ret = TranslateCharsetInfo((DWORD *)(ULONG_PTR)pgci->Locale, &pgci->Cs, TCI_SRCLOCALE); return ZwCallbackReturn(Arguments, ArgumentLength, Ret ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL); } diff --git a/win32ss/user/user32/windows/cursoricon.c b/win32ss/user/user32/windows/cursoricon.c index ee286580bd..ad0ac4d6d0 100644 --- a/win32ss/user/user32/windows/cursoricon.c +++ b/win32ss/user/user32/windows/cursoricon.c @@ -281,7 +281,7 @@ create_alpha_bitmap( HDC hdc = NULL, hdcScreen; unsigned char *ptr; void *bits = NULL; - size_t size; + ULONG size; hdcScreen = CreateDCW(DISPLAYW, NULL, NULL, NULL); if (!hdcScreen) diff --git a/win32ss/user/user32/windows/defwnd.c b/win32ss/user/user32/windows/defwnd.c index ac9fd93526..ad2bbbbe5d 100644 --- a/win32ss/user/user32/windows/defwnd.c +++ b/win32ss/user/user32/windows/defwnd.c @@ -869,7 +869,7 @@ RealDefWindowProcA(HWND hWnd, { PWSTR buf = NULL; PSTR outbuf = (PSTR)lParam; - UINT copy; + SIZE_T copy; if (Wnd != NULL && wParam != 0) { diff --git a/win32ss/user/user32/windows/dialog.c b/win32ss/user/user32/windows/dialog.c index 7042f45324..3cf8371a54 100644 --- a/win32ss/user/user32/windows/dialog.c +++ b/win32ss/user/user32/windows/dialog.c @@ -2532,7 +2532,7 @@ IsDialogMessageW( WCHAR *buffer = HeapAlloc (GetProcessHeap(), 0, maxlen * sizeof(WCHAR)); if (buffer) { - INT length; + SIZE_T length; SendMessageW (hwndNext, WM_GETTEXT, maxlen, (LPARAM) buffer); length = strlenW (buffer); HeapFree (GetProcessHeap(), 0, buffer); diff --git a/win32ss/user/user32/windows/messagebox.c b/win32ss/user/user32/windows/messagebox.c index 2ceb24fe15..0b94c6c044 100644 --- a/win32ss/user/user32/windows/messagebox.c +++ b/win32ss/user/user32/windows/messagebox.c @@ -387,7 +387,7 @@ MessageBoxTimeoutIndirectW( else if (IS_INTRESOURCE(lpMsgBoxParams->lpszCaption)) { /* User-defined resource string */ - caplen = LoadStringW(lpMsgBoxParams->hInstance, (UINT)lpMsgBoxParams->lpszCaption, (LPWSTR)&caption, 0); + caplen = LoadStringW(lpMsgBoxParams->hInstance, PtrToUlong(lpMsgBoxParams->lpszCaption), (LPWSTR)&caption, 0); } else { @@ -405,7 +405,7 @@ MessageBoxTimeoutIndirectW( else if (IS_INTRESOURCE(lpMsgBoxParams->lpszText)) { /* User-defined resource string */ - textlen = LoadStringW(lpMsgBoxParams->hInstance, (UINT)lpMsgBoxParams->lpszText, (LPWSTR)&text, 0); + textlen = LoadStringW(lpMsgBoxParams->hInstance, PtrToUlong(lpMsgBoxParams->lpszText), (LPWSTR)&text, 0); } else {
6 years, 4 months
1
0
0
0
07/16: [GDI32] Fix 64 bit issues
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7ad5f405cbddd9a7609f4…
commit 7ad5f405cbddd9a7609f4c09dc5638248ea7d6d3 Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Sun Mar 4 16:06:54 2018 +0100 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Sat Aug 4 19:19:34 2018 +0200 [GDI32] Fix 64 bit issues --- win32ss/gdi/gdi32/include/gdi32p.h | 2 +- win32ss/gdi/gdi32/misc/gdientry.c | 2 +- win32ss/gdi/gdi32/objects/dc.c | 2 +- win32ss/gdi/gdi32/objects/font.c | 19 ++++++++++--------- win32ss/gdi/gdi32/objects/region.c | 4 ++-- win32ss/gdi/gdi32/wine/rosglue.c | 2 +- 6 files changed, 16 insertions(+), 15 deletions(-) diff --git a/win32ss/gdi/gdi32/include/gdi32p.h b/win32ss/gdi/gdi32/include/gdi32p.h index 1b7c51856d..ace5d574a2 100644 --- a/win32ss/gdi/gdi32/include/gdi32p.h +++ b/win32ss/gdi/gdi32/include/gdi32p.h @@ -136,7 +136,7 @@ typedef struct tagENHMETAFILE #define UMPDEV_SUPPORT_ESCAPE 0x0004 typedef struct _UMPDEV { - DWORD Sig; // Init with PDEV_UMPD_ID + DWORD_PTR Sig; // Init with PDEV_UMPD_ID struct _UMPDEV *pumpdNext; PDRIVER_INFO_5W pdi5Info; HMODULE hModule; diff --git a/win32ss/gdi/gdi32/misc/gdientry.c b/win32ss/gdi/gdi32/misc/gdientry.c index 2ff32a8de6..61943bfa5b 100644 --- a/win32ss/gdi/gdi32/misc/gdientry.c +++ b/win32ss/gdi/gdi32/misc/gdientry.c @@ -1431,7 +1431,7 @@ bDDCreateSurface(LPDDRAWI_DDRAWSURFACE_LCL pSurface, } /* Create the object */ - pSurface->hDDSurface = (DWORD)NtGdiDdCreateSurfaceObject(GetDdHandle(pSurface->lpGbl->lpDD->hDD), + pSurface->hDDSurface = (DWORD_PTR)NtGdiDdCreateSurfaceObject(GetDdHandle(pSurface->lpGbl->lpDD->hDD), (HANDLE)pSurface->hDDSurface, &SurfaceLocal, &SurfaceMore, diff --git a/win32ss/gdi/gdi32/objects/dc.c b/win32ss/gdi/gdi32/objects/dc.c index f6d36ec1b7..7ea146ab20 100644 --- a/win32ss/gdi/gdi32/objects/dc.c +++ b/win32ss/gdi/gdi32/objects/dc.c @@ -1509,7 +1509,7 @@ SelectObject( switch (GDI_HANDLE_GET_TYPE(hobj)) { case GDILoObjType_LO_REGION_TYPE: - return (HGDIOBJ)ExtSelectClipRgn(hdc, hobj, RGN_COPY); + return (HGDIOBJ)UlongToHandle(ExtSelectClipRgn(hdc, hobj, RGN_COPY)); case GDILoObjType_LO_BITMAP_TYPE: case GDILoObjType_LO_DIBSECTION_TYPE: diff --git a/win32ss/gdi/gdi32/objects/font.c b/win32ss/gdi/gdi32/objects/font.c index 0763ff7df2..871ea50952 100644 --- a/win32ss/gdi/gdi32/objects/font.c +++ b/win32ss/gdi/gdi32/objects/font.c @@ -1097,19 +1097,19 @@ GetOutlineTextMetricsA( needed = sizeof(OUTLINETEXTMETRICA); if(lpOTMW->otmpFamilyName) needed += WideCharToMultiByte(CP_ACP, 0, - (WCHAR*)((char*)lpOTMW + (int)lpOTMW->otmpFamilyName), -1, + (WCHAR*)((char*)lpOTMW + (intptr_t)lpOTMW->otmpFamilyName), -1, NULL, 0, NULL, NULL); if(lpOTMW->otmpFaceName) needed += WideCharToMultiByte(CP_ACP, 0, - (WCHAR*)((char*)lpOTMW + (int)lpOTMW->otmpFaceName), -1, + (WCHAR*)((char*)lpOTMW + (intptr_t)lpOTMW->otmpFaceName), -1, NULL, 0, NULL, NULL); if(lpOTMW->otmpStyleName) needed += WideCharToMultiByte(CP_ACP, 0, - (WCHAR*)((char*)lpOTMW + (int)lpOTMW->otmpStyleName), -1, + (WCHAR*)((char*)lpOTMW + (intptr_t)lpOTMW->otmpStyleName), -1, NULL, 0, NULL, NULL); if(lpOTMW->otmpFullName) needed += WideCharToMultiByte(CP_ACP, 0, - (WCHAR*)((char*)lpOTMW + (int)lpOTMW->otmpFullName), -1, + (WCHAR*)((char*)lpOTMW + (intptr_t)lpOTMW->otmpFullName), -1, NULL, 0, NULL, NULL); if(!lpOTM) @@ -1168,7 +1168,7 @@ GetOutlineTextMetricsA( { output->otmpFamilyName = (LPSTR)(ptr - (char*)output); len = WideCharToMultiByte(CP_ACP, 0, - (WCHAR*)((char*)lpOTMW + (int)lpOTMW->otmpFamilyName), -1, + (WCHAR*)((char*)lpOTMW + (intptr_t)lpOTMW->otmpFamilyName), -1, ptr, left, NULL, NULL); left -= len; ptr += len; @@ -1180,7 +1180,7 @@ GetOutlineTextMetricsA( { output->otmpFaceName = (LPSTR)(ptr - (char*)output); len = WideCharToMultiByte(CP_ACP, 0, - (WCHAR*)((char*)lpOTMW + (int)lpOTMW->otmpFaceName), -1, + (WCHAR*)((char*)lpOTMW + (intptr_t)lpOTMW->otmpFaceName), -1, ptr, left, NULL, NULL); left -= len; ptr += len; @@ -1192,7 +1192,7 @@ GetOutlineTextMetricsA( { output->otmpStyleName = (LPSTR)(ptr - (char*)output); len = WideCharToMultiByte(CP_ACP, 0, - (WCHAR*)((char*)lpOTMW + (int)lpOTMW->otmpStyleName), -1, + (WCHAR*)((char*)lpOTMW + (intptr_t)lpOTMW->otmpStyleName), -1, ptr, left, NULL, NULL); left -= len; ptr += len; @@ -1204,7 +1204,7 @@ GetOutlineTextMetricsA( { output->otmpFullName = (LPSTR)(ptr - (char*)output); len = WideCharToMultiByte(CP_ACP, 0, - (WCHAR*)((char*)lpOTMW + (int)lpOTMW->otmpFullName), -1, + (WCHAR*)((char*)lpOTMW + (intptr_t)lpOTMW->otmpFullName), -1, ptr, left, NULL, NULL); left -= len; } @@ -2122,7 +2122,8 @@ NewEnumFontFamiliesExW( LPARAM lParam, DWORD dwFlags) { - ULONG_PTR idEnum, cbDataSize, cbRetSize; + ULONG_PTR idEnum; + ULONG cbDataSize, cbRetSize; PENUMFONTDATAW pEfdw; PBYTE pBuffer; PBYTE pMax; diff --git a/win32ss/gdi/gdi32/objects/region.c b/win32ss/gdi/gdi32/objects/region.c index 128d403267..ce593b26dc 100644 --- a/win32ss/gdi/gdi32/objects/region.c +++ b/win32ss/gdi/gdi32/objects/region.c @@ -575,7 +575,7 @@ HRGN WINAPI CreatePolygonRgn( const POINT * lppt, int cPoints, int fnPolyFillMode) { - return (HRGN) NtGdiPolyPolyDraw( (HDC) fnPolyFillMode, (PPOINT) lppt, (PULONG) &cPoints, 1, GdiPolyPolyRgn); + return (HRGN) NtGdiPolyPolyDraw( (HDC)UlongToHandle(fnPolyFillMode), (PPOINT) lppt, (PULONG) &cPoints, 1, GdiPolyPolyRgn); } /* @@ -588,7 +588,7 @@ CreatePolyPolygonRgn( const POINT* lppt, int nCount, int fnPolyFillMode) { - return (HRGN) NtGdiPolyPolyDraw( (HDC) fnPolyFillMode, (PPOINT) lppt, (PULONG) lpPolyCounts, (ULONG) nCount, GdiPolyPolyRgn ); + return (HRGN) NtGdiPolyPolyDraw( (HDC)UlongToHandle(fnPolyFillMode), (PPOINT) lppt, (PULONG) lpPolyCounts, (ULONG) nCount, GdiPolyPolyRgn ); } /* diff --git a/win32ss/gdi/gdi32/wine/rosglue.c b/win32ss/gdi/gdi32/wine/rosglue.c index 230510148f..d5d99d8c3b 100644 --- a/win32ss/gdi/gdi32/wine/rosglue.c +++ b/win32ss/gdi/gdi32/wine/rosglue.c @@ -731,7 +731,7 @@ HRGN DRIVER_PathToRegion(PHYSDEV physdev) { DPRINT1("DRIVER_PathToRegion\n"); - return (HRGN)physdev->funcs->pAbortPath( physdev ); + return (HRGN)(ULONG_PTR)physdev->funcs->pAbortPath( physdev ); }
6 years, 4 months
1
0
0
0
06/16: [KERNEL32] Fix 64 bit issues
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4f0a158a2f6373de49414…
commit 4f0a158a2f6373de4941436370cc604632f3b650 Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Thu Feb 15 22:34:48 2018 +0100 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Sat Aug 4 19:19:34 2018 +0200 [KERNEL32] Fix 64 bit issues --- dll/win32/kernel32/client/actctx.c | 4 ++-- dll/win32/kernel32/client/compname.c | 9 ++++++++- dll/win32/kernel32/client/debugger.c | 4 ++-- dll/win32/kernel32/client/dllmain.c | 19 ++++++++++++------- dll/win32/kernel32/client/except.c | 23 +++++++++++++---------- dll/win32/kernel32/client/file/npipe.c | 2 +- dll/win32/kernel32/client/loader.c | 4 ++-- dll/win32/kernel32/client/path.c | 15 +++++++-------- dll/win32/kernel32/client/proc.c | 29 ++++++++++++++++++++++++----- dll/win32/kernel32/client/vdm.c | 5 +++-- dll/win32/kernel32/client/virtmem.c | 4 ++-- dll/win32/kernel32/k32.h | 2 ++ 12 files changed, 78 insertions(+), 42 deletions(-) diff --git a/dll/win32/kernel32/client/actctx.c b/dll/win32/kernel32/client/actctx.c index 302d6c86a3..cad514ef06 100644 --- a/dll/win32/kernel32/client/actctx.c +++ b/dll/win32/kernel32/client/actctx.c @@ -154,8 +154,8 @@ BasepProbeForDllManifest(IN PVOID DllHandle, *ActCtx = NULL; /* Check whether the image has manifest resource associated with it */ - Info.Type = (ULONG)RT_MANIFEST; - Info.Name = (ULONG)ISOLATIONAWARE_MANIFEST_RESOURCE_ID; + Info.Type = (ULONG_PTR)RT_MANIFEST; + Info.Name = (ULONG_PTR)ISOLATIONAWARE_MANIFEST_RESOURCE_ID; Info.Language = 0; if (!(Status = LdrFindResource_U(DllHandle, &Info, 3, &Entry))) { diff --git a/dll/win32/kernel32/client/compname.c b/dll/win32/kernel32/client/compname.c index a336eaa954..91860ce5af 100644 --- a/dll/win32/kernel32/client/compname.c +++ b/dll/win32/kernel32/client/compname.c @@ -391,8 +391,15 @@ SetComputerNameToRegistry(LPCWSTR RegistryKey, UNICODE_STRING KeyName; UNICODE_STRING ValueName; HANDLE KeyHandle; + SIZE_T StringLength; NTSTATUS Status; + StringLength = wcslen(lpBuffer); + if (StringLength > ((MAXULONG / sizeof(WCHAR)) - 1)) + { + return FALSE; + } + RtlInitUnicodeString(&KeyName, RegistryKey); InitializeObjectAttributes(&ObjectAttributes, &KeyName, @@ -416,7 +423,7 @@ SetComputerNameToRegistry(LPCWSTR RegistryKey, 0, REG_SZ, (PVOID)lpBuffer, - (wcslen (lpBuffer) + 1) * sizeof(WCHAR)); + (StringLength + 1) * sizeof(WCHAR)); if (!NT_SUCCESS(Status)) { NtClose(KeyHandle); diff --git a/dll/win32/kernel32/client/debugger.c b/dll/win32/kernel32/client/debugger.c index 4420b8e765..9f84848a20 100644 --- a/dll/win32/kernel32/client/debugger.c +++ b/dll/win32/kernel32/client/debugger.c @@ -453,8 +453,8 @@ ContinueDebugEvent(IN DWORD dwProcessId, NTSTATUS Status; /* Set the Client ID */ - ClientId.UniqueProcess = (HANDLE)dwProcessId; - ClientId.UniqueThread = (HANDLE)dwThreadId; + ClientId.UniqueProcess = UlongToHandle(dwProcessId); + ClientId.UniqueThread = UlongToHandle(dwThreadId); /* Continue debugging */ Status = DbgUiContinue(&ClientId, dwContinueStatus); diff --git a/dll/win32/kernel32/client/dllmain.c b/dll/win32/kernel32/client/dllmain.c index 5c4ad13555..4e94781be4 100644 --- a/dll/win32/kernel32/client/dllmain.c +++ b/dll/win32/kernel32/client/dllmain.c @@ -172,15 +172,20 @@ DllMain(HANDLE hDll, BaseWindowsSystemDirectory = BaseStaticServerData->WindowsSystemDirectory; /* Construct the default path (using the static buffer) */ - _snwprintf(BaseDefaultPathBuffer, - sizeof(BaseDefaultPathBuffer) / sizeof(WCHAR), - L".;%wZ;%wZ\\system;%wZ;", - &BaseWindowsSystemDirectory, - &BaseWindowsDirectory, - &BaseWindowsDirectory); + Status = RtlStringCbPrintfW(BaseDefaultPathBuffer, + sizeof(BaseDefaultPathBuffer), + L".;%wZ;%wZ\\system;%wZ;", + &BaseWindowsSystemDirectory, + &BaseWindowsDirectory, + &BaseWindowsDirectory); + if (!NT_SUCCESS(Status)) + { + DPRINT1("NLS Init failed\n"); + return FALSE; + } BaseDefaultPath.Buffer = BaseDefaultPathBuffer; - BaseDefaultPath.Length = wcslen(BaseDefaultPathBuffer) * sizeof(WCHAR); + BaseDefaultPath.Length = (USHORT)wcslen(BaseDefaultPathBuffer) * sizeof(WCHAR); BaseDefaultPath.MaximumLength = sizeof(BaseDefaultPathBuffer); /* Use remaining part of the default path buffer for the append path */ diff --git a/dll/win32/kernel32/client/except.c b/dll/win32/kernel32/client/except.c index 416f097a94..dbb76b7be4 100644 --- a/dll/win32/kernel32/client/except.c +++ b/dll/win32/kernel32/client/except.c @@ -26,8 +26,10 @@ _module_name_from_addr(const void* addr, void **module_start_addr, char* psz, size_t nChars, char** module_name) { MEMORY_BASIC_INFORMATION mbi; - if (VirtualQuery(addr, &mbi, sizeof(mbi)) != sizeof(mbi) || - !GetModuleFileNameA((HMODULE)mbi.AllocationBase, psz, nChars)) + + if ((nChars > MAXDWORD) || + (VirtualQuery(addr, &mbi, sizeof(mbi)) != sizeof(mbi)) || + !GetModuleFileNameA((HMODULE)mbi.AllocationBase, psz, (DWORD)nChars)) { psz[0] = '\0'; *module_name = psz; @@ -164,6 +166,7 @@ BasepCheckForReadOnlyResource(IN PVOID Ptr) { PVOID Data; ULONG Size, OldProtect; + SIZE_T Size2; MEMORY_BASIC_INFORMATION mbi; NTSTATUS Status; LONG Ret = EXCEPTION_CONTINUE_SEARCH; @@ -194,10 +197,10 @@ BasepCheckForReadOnlyResource(IN PVOID Ptr) { /* The user tried to write into the resources. Make the page writable... */ - Size = 1; + Size2 = 1; Status = NtProtectVirtualMemory(NtCurrentProcess(), &Ptr, - &Size, + &Size2, PAGE_READWRITE, &OldProtect); if (NT_SUCCESS(Status)) @@ -560,14 +563,14 @@ UnhandledExceptionFilter(IN PEXCEPTION_POINTERS ExceptionInfo) * line. The biggest 32-bit unsigned int (0xFFFFFFFF == 4.294.967.295) * takes 10 decimal digits. We then count the terminating NULL. */ - Length = wcslen(AeDebugPath) + 2*10 + 1; + Length = (ULONG)wcslen(AeDebugPath) + 2*10 + 1; /* Check whether the debugger path may be a relative path */ if ((*AeDebugPath != L'"') && (RtlDetermineDosPathNameType_U(AeDebugPath) == RtlPathTypeRelative)) { /* Relative path, prepend SystemRoot\System32 */ - PrependLength = wcslen(SharedUserData->NtSystemRoot) + 10 /* == wcslen(L"\\System32\\") */; + PrependLength = (ULONG)wcslen(SharedUserData->NtSystemRoot) + 10 /* == wcslen(L"\\System32\\") */; if (PrependLength + Length <= ARRAYSIZE(AeDebugCmdLine)) { hr = StringCchPrintfW(AeDebugCmdLine, @@ -830,8 +833,8 @@ IsBadReadPtr(IN LPCVOID lp, *Current; /* Align the addresses */ - Current = (volatile CHAR *)ROUND_DOWN(Current, PageSize); - Last = (PCHAR)ROUND_DOWN(Last, PageSize); + Current = (volatile CHAR *)ALIGN_DOWN_POINTER_BY(Current, PageSize); + Last = (PCHAR)ALIGN_DOWN_POINTER_BY(Last, PageSize); /* Probe the entire range */ while (Current != Last) @@ -908,8 +911,8 @@ IsBadWritePtr(IN LPVOID lp, *Current = *Current; /* Align the addresses */ - Current = (volatile CHAR *)ROUND_DOWN(Current, PageSize); - Last = (PCHAR)ROUND_DOWN(Last, PageSize); + Current = (volatile CHAR *)ALIGN_DOWN_POINTER_BY(Current, PageSize); + Last = (PCHAR)ALIGN_DOWN_POINTER_BY(Last, PageSize); /* Probe the entire range */ while (Current != Last) diff --git a/dll/win32/kernel32/client/file/npipe.c b/dll/win32/kernel32/client/file/npipe.c index c99d600bcb..d89047d1f0 100644 --- a/dll/win32/kernel32/client/file/npipe.c +++ b/dll/win32/kernel32/client/file/npipe.c @@ -142,7 +142,7 @@ CreatePipe(PHANDLE hReadPipe, /* Create the pipe name */ swprintf(Buffer, - L"\\Device\\NamedPipe\\Win32Pipes.%08x.%08x", + L"\\Device\\NamedPipe\\Win32Pipes.%p.%08x", NtCurrentTeb()->ClientId.UniqueProcess, PipeId); RtlInitUnicodeString(&PipeName, Buffer); diff --git a/dll/win32/kernel32/client/loader.c b/dll/win32/kernel32/client/loader.c index 82f8c7d988..a6f84ba87e 100644 --- a/dll/win32/kernel32/client/loader.c +++ b/dll/win32/kernel32/client/loader.c @@ -404,7 +404,7 @@ GetProcAddress(HMODULE hModule, LPCSTR lpProcName) PVOID hMapped; ULONG Ordinal = 0; - if (HIWORD(lpProcName) != 0) + if ((ULONG_PTR)lpProcName > MAXUSHORT) { /* Look up by name */ RtlInitAnsiString(&ProcedureName, (LPSTR)lpProcName); @@ -413,7 +413,7 @@ GetProcAddress(HMODULE hModule, LPCSTR lpProcName) else { /* Look up by ordinal */ - Ordinal = (ULONG)lpProcName; + Ordinal = PtrToUlong(lpProcName); } /* Map provided handle */ diff --git a/dll/win32/kernel32/client/path.c b/dll/win32/kernel32/client/path.c index 7d91c052a8..1db908212f 100644 --- a/dll/win32/kernel32/client/path.c +++ b/dll/win32/kernel32/client/path.c @@ -118,7 +118,7 @@ BasepComputeProcessPath(IN PBASE_SEARCH_PATH_TYPE PathOrder, IN LPVOID Environment) { PWCHAR PathBuffer, Buffer, AppNameEnd, PathCurrent; - ULONG PathLengthInBytes; + SIZE_T PathLengthInBytes; NTSTATUS Status; UNICODE_STRING EnvPath; PBASE_SEARCH_PATH_TYPE Order; @@ -1040,7 +1040,7 @@ GetFullPathNameA(IN LPCSTR lpFileName, /* Yep, so in this case get the length of the file part too */ Status = RtlUnicodeToMultiByteSize(&FilePartSize, Buffer, - (LocalFilePart - Buffer) * + (ULONG)(LocalFilePart - Buffer) * sizeof(WCHAR)); if (!NT_SUCCESS(Status)) { @@ -1231,7 +1231,7 @@ SearchPathA(IN LPCSTR lpPath OPTIONAL, /* Yep, so in this case get the length of the file part too */ Status = RtlUnicodeToMultiByteSize(&FilePartSize, Buffer, - (LocalFilePart - Buffer) * + (ULONG)(LocalFilePart - Buffer) * sizeof(WCHAR)); if (!NT_SUCCESS(Status)) { @@ -1302,7 +1302,8 @@ SearchPathW(IN LPCWSTR lpPath OPTIONAL, OUT LPWSTR *lpFilePart OPTIONAL) { UNICODE_STRING FileNameString, ExtensionString, PathString, CallerBuffer; - ULONG Flags, LengthNeeded, FilePartSize; + ULONG Flags; + SIZE_T LengthNeeded, FilePartSize; NTSTATUS Status; DWORD Result = 0; @@ -1456,10 +1457,9 @@ GetLongPathNameW(IN LPCWSTR lpszShortPath, IN DWORD cchBuffer) { PWCHAR Path, Original, First, Last, Buffer, Src, Dst; - ULONG Length; + SIZE_T Length, ReturnLength; WCHAR LastChar; HANDLE FindHandle; - DWORD ReturnLength; ULONG ErrorMode; BOOLEAN Found = FALSE; WIN32_FIND_DATAW FindFileData; @@ -1834,10 +1834,9 @@ GetShortPathNameW(IN LPCWSTR lpszLongPath, IN DWORD cchBuffer) { PWCHAR Path, Original, First, Last, Buffer, Src, Dst; - ULONG Length; + SIZE_T Length, ReturnLength; WCHAR LastChar; HANDLE FindHandle; - DWORD ReturnLength; ULONG ErrorMode; BOOLEAN Found = FALSE; WIN32_FIND_DATAW FindFileData; diff --git a/dll/win32/kernel32/client/proc.c b/dll/win32/kernel32/client/proc.c index 551723e3b7..dbd5c10d0f 100644 --- a/dll/win32/kernel32/client/proc.c +++ b/dll/win32/kernel32/client/proc.c @@ -440,7 +440,7 @@ BasepSxsCloseHandles(IN PBASE_MSG_SXS_HANDLES Handles) if (Handles->ViewBase.QuadPart) { Status = NtUnmapViewOfSection(NtCurrentProcess(), - (PVOID)Handles->ViewBase.LowPart); + (PVOID)(ULONG_PTR)Handles->ViewBase.QuadPart); ASSERT(NT_SUCCESS(Status)); } } @@ -2310,7 +2310,8 @@ CreateProcessInternalW(IN HANDLE hUserToken, SECTION_IMAGE_INFORMATION ImageInformation; IO_STATUS_BLOCK IoStatusBlock; CLIENT_ID ClientId; - ULONG NoWindow, RegionSize, StackSize, ErrorCode, Flags; + ULONG NoWindow, StackSize, ErrorCode, Flags; + SIZE_T RegionSize; USHORT ImageMachine; ULONG ParameterFlags, PrivilegeValue, HardErrorMode, ErrorResponse; ULONG_PTR ErrorParameters[2]; @@ -2342,7 +2343,8 @@ CreateProcessInternalW(IN HANDLE hUserToken, SIZE_T n; WCHAR SaveChar; ULONG Length, FileAttribs, CmdQuoteLength; - ULONG CmdLineLength, ResultSize; + ULONG ResultSize; + SIZE_T EnvironmentLength, CmdLineLength; PWCHAR QuotedCmdLine, AnsiCmdCommand, ExtBuffer, CurrentDirectory; PWCHAR NullBuffer, ScanString, NameBuffer, SearchPath, DebuggerCmdLine; ANSI_STRING AnsiEnv; @@ -2571,8 +2573,17 @@ CreateProcessInternalW(IN HANDLE hUserToken, AnsiEnv.Buffer = pcScan = (PCHAR)lpEnvironment; while ((*pcScan) || (*(pcScan + 1))) ++pcScan; + /* Make sure the environment is not too large */ + EnvironmentLength = (pcScan + sizeof(ANSI_NULL) - (PCHAR)lpEnvironment); + if (EnvironmentLength > MAXUSHORT) + { + /* Fail */ + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + /* Create our ANSI String */ - AnsiEnv.Length = pcScan - (PCHAR)lpEnvironment + sizeof(ANSI_NULL); + AnsiEnv.Length = (USHORT)EnvironmentLength; AnsiEnv.MaximumLength = AnsiEnv.Length + sizeof(ANSI_NULL); /* Allocate memory for the Unicode Environment */ @@ -4003,10 +4014,11 @@ StartScan: if (VdmReserve) { /* Reserve the requested allocation */ + RegionSize = VdmReserve; Status = NtAllocateVirtualMemory(ProcessHandle, &BaseAddress, 0, - &VdmReserve, + &RegionSize, MEM_RESERVE, PAGE_EXECUTE_READWRITE); if (!NT_SUCCESS(Status)) @@ -4017,6 +4029,8 @@ StartScan: Result = FALSE; goto Quickie; } + + VdmReserve = (ULONG)RegionSize; } /* Check if we've already queried information on the section */ @@ -4267,7 +4281,12 @@ StartScan: /* Write the remote PEB address and clear it locally, we no longer use it */ CreateProcessMsg->PebAddressNative = RemotePeb; +#ifdef _WIN64 + DPRINT1("TODO: WOW64 is not supported yet\n"); + CreateProcessMsg->PebAddressWow64 = 0; +#else CreateProcessMsg->PebAddressWow64 = (ULONG)RemotePeb; +#endif RemotePeb = NULL; /* Now check what kind of architecture this image was made for */ diff --git a/dll/win32/kernel32/client/vdm.c b/dll/win32/kernel32/client/vdm.c index a3cb7cd01d..ff6e785129 100644 --- a/dll/win32/kernel32/client/vdm.c +++ b/dll/win32/kernel32/client/vdm.c @@ -746,7 +746,8 @@ BaseCreateVDMEnvironment(IN PWCHAR lpEnvironment, BOOL Success = FALSE; NTSTATUS Status; - ULONG RegionSize, EnvironmentSize = 0; + ULONG EnvironmentSize = 0; + SIZE_T RegionSize; PWCHAR Environment, NewEnvironment = NULL; ENV_NAME_TYPE NameType; ULONG NameLength, NumChars, Remaining; @@ -1025,7 +1026,7 @@ NTAPI BaseDestroyVDMEnvironment(IN PANSI_STRING AnsiEnv, IN PUNICODE_STRING UnicodeEnv) { - ULONG Dummy = 0; + SIZE_T Dummy = 0; /* Clear the ANSI buffer since Rtl creates this for us */ if (AnsiEnv->Buffer) RtlFreeAnsiString(AnsiEnv); diff --git a/dll/win32/kernel32/client/virtmem.c b/dll/win32/kernel32/client/virtmem.c index acf2e13282..7b4085c0ba 100644 --- a/dll/win32/kernel32/client/virtmem.c +++ b/dll/win32/kernel32/client/virtmem.c @@ -29,8 +29,8 @@ VirtualAllocEx(IN HANDLE hProcess, NTSTATUS Status; /* Make sure the address is within the granularity of the system (64K) */ - if ((lpAddress) && - (lpAddress < (PVOID)BaseStaticServerData->SysInfo.AllocationGranularity)) + if ((lpAddress != NULL) && + (lpAddress < UlongToPtr(BaseStaticServerData->SysInfo.AllocationGranularity))) { /* Fail the call */ SetLastError(ERROR_INVALID_PARAMETER); diff --git a/dll/win32/kernel32/k32.h b/dll/win32/kernel32/k32.h index 52e5a8b5c2..604953680d 100644 --- a/dll/win32/kernel32/k32.h +++ b/dll/win32/kernel32/k32.h @@ -45,6 +45,8 @@ #include <ndk/setypes.h> #include <ndk/umfuncs.h> +#include <ntstrsafe.h> + /* CSRSS Headers */ #include <csr/csr.h> #include <win/base.h>
6 years, 4 months
1
0
0
0
05/16: [DRIVERS] Fix 64 bit issues
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9e066abe2ae7ddd40525f…
commit 9e066abe2ae7ddd40525f1de469eec0927275aa4 Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Mon Apr 23 11:27:49 2018 +0200 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Sat Aug 4 19:19:34 2018 +0200 [DRIVERS] Fix 64 bit issues --- drivers/bus/acpi/include/list.h | 2 +- drivers/bus/acpi/osl.c | 2 +- drivers/bus/pcix/arb/ar_busno.c | 2 +- drivers/bus/pcix/arb/ar_memio.c | 4 ++-- drivers/bus/pcix/arb/tr_irq.c | 4 ++-- drivers/filesystems/mup/mup.c | 2 +- drivers/filters/fltmgr/Object.c | 4 ++-- drivers/network/afd/afd/write.c | 2 +- drivers/network/ndis/ndis/miniport.c | 6 +++--- drivers/network/tcpip/include/debug.h | 4 ++-- drivers/parallel/parport/pdo.c | 8 ++++---- drivers/sac/driver/chanmgr.c | 2 +- drivers/sac/driver/dispatch.c | 2 +- drivers/sac/driver/util.c | 8 ++++---- drivers/storage/fdc/fdc/fdo.c | 4 ++-- drivers/usb/usbehci/hardware.cpp | 16 ++++++++-------- drivers/usb/usbohci/hardware.cpp | 6 +++--- drivers/usb/usbstor/scsi.c | 6 +++--- drivers/usb/usbuhci/hardware.cpp | 18 +++++++++--------- sdk/lib/drivers/libusb/hub_controller.cpp | 3 ++- sdk/lib/drivers/ntoskrnl_vista/ke.c | 2 +- sdk/lib/drivers/rxce/rxce.c | 2 +- sdk/lib/drivers/sound/mmebuddy/mixer/mxdMessage.c | 2 +- sdk/lib/drivers/sound/mment4/detect.c | 2 +- sdk/lib/drivers/sound/mment4/registry.c | 4 ++-- sdk/lib/drivers/sound/mmixer/midi.c | 2 +- sdk/lib/drivers/sound/mmixer/wave.c | 2 +- 27 files changed, 61 insertions(+), 60 deletions(-) diff --git a/drivers/bus/acpi/include/list.h b/drivers/bus/acpi/include/list.h index bac8727aa7..9054690662 100644 --- a/drivers/bus/acpi/include/list.h +++ b/drivers/bus/acpi/include/list.h @@ -183,7 +183,7 @@ * @member: the name of the list_struct within the struct. */ #define list_entry(ptr, type, member) \ - ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member))) + ((type *)((char *)(ptr)-(uintptr_t)(&((type *)0)->member))) /** * list_for_each - iterate over a list diff --git a/drivers/bus/acpi/osl.c b/drivers/bus/acpi/osl.c index 06bad3c1d6..8b8176cbde 100644 --- a/drivers/bus/acpi/osl.c +++ b/drivers/bus/acpi/osl.c @@ -217,7 +217,7 @@ ACPI_THREAD_ID AcpiOsGetThreadId (void) { /* Thread ID must be non-zero */ - return (ULONG)PsGetCurrentThreadId() + 1; + return (ULONG_PTR)PsGetCurrentThreadId() + 1; } ACPI_STATUS diff --git a/drivers/bus/pcix/arb/ar_busno.c b/drivers/bus/pcix/arb/ar_busno.c index 2751daa10d..9618146aa3 100644 --- a/drivers/bus/pcix/arb/ar_busno.c +++ b/drivers/bus/pcix/arb/ar_busno.c @@ -60,7 +60,7 @@ arbusno_Constructor(IN PVOID DeviceExtension, UNREFERENCED_PARAMETER(Interface); /* Make sure it's the expected interface */ - if ((ULONG)InterfaceData != CmResourceTypeBusNumber) + if ((ULONG_PTR)InterfaceData != CmResourceTypeBusNumber) { /* Arbiter support must have been initialized first */ if (FdoExtension->ArbitersInitialized) diff --git a/drivers/bus/pcix/arb/ar_memio.c b/drivers/bus/pcix/arb/ar_memio.c index e6d0e917c0..63aeaa9acd 100644 --- a/drivers/bus/pcix/arb/ar_memio.c +++ b/drivers/bus/pcix/arb/ar_memio.c @@ -74,7 +74,7 @@ ario_Constructor(IN PVOID DeviceExtension, UNREFERENCED_PARAMETER(Interface); /* Make sure it's the expected interface */ - if ((ULONG)InterfaceData != CmResourceTypePort) + if ((ULONG_PTR)InterfaceData != CmResourceTypePort) { /* Arbiter support must have been initialized first */ if (FdoExtension->ArbitersInitialized) @@ -170,7 +170,7 @@ armem_Constructor(IN PVOID DeviceExtension, UNREFERENCED_PARAMETER(Interface); /* Make sure it's the expected interface */ - if ((ULONG)InterfaceData != CmResourceTypeMemory) + if ((ULONG_PTR)InterfaceData != CmResourceTypeMemory) { /* Arbiter support must have been initialized first */ if (FdoExtension->ArbitersInitialized) diff --git a/drivers/bus/pcix/arb/tr_irq.c b/drivers/bus/pcix/arb/tr_irq.c index 9841ca3267..f6b393a913 100644 --- a/drivers/bus/pcix/arb/tr_irq.c +++ b/drivers/bus/pcix/arb/tr_irq.c @@ -59,7 +59,7 @@ tranirq_Constructor(IN PVOID DeviceExtension, UNREFERENCED_PARAMETER(Size); /* Make sure it's the right resource type */ - if ((ULONG)InterfaceData != CmResourceTypeInterrupt) + if ((ULONG_PTR)InterfaceData != CmResourceTypeInterrupt) { /* Fail this invalid request */ DPRINT1("PCI - IRQ trans constructor doesn't like %p in InterfaceSpecificData\n", @@ -69,7 +69,7 @@ tranirq_Constructor(IN PVOID DeviceExtension, /* Get the bus, and use this as the interface-specific data */ BaseBus = FdoExtension->BaseBus; - InterfaceData = (PVOID)BaseBus; + InterfaceData = UlongToPtr(BaseBus); /* Check if this is the root bus */ if (PCI_IS_ROOT_FDO(FdoExtension)) diff --git a/drivers/filesystems/mup/mup.c b/drivers/filesystems/mup/mup.c index 84f318af47..e8cc8d7e9b 100644 --- a/drivers/filesystems/mup/mup.c +++ b/drivers/filesystems/mup/mup.c @@ -158,7 +158,7 @@ MuppIsDfsEnabled(VOID) return TRUE; } - return ((ULONG)KeyQueryOutput.KeyInfo.Data != 1); + return ((ULONG_PTR)KeyQueryOutput.KeyInfo.Data != 1); } VOID diff --git a/drivers/filters/fltmgr/Object.c b/drivers/filters/fltmgr/Object.c index 5daf9033a1..9597738a3d 100644 --- a/drivers/filters/fltmgr/Object.c +++ b/drivers/filters/fltmgr/Object.c @@ -255,7 +255,7 @@ FltpObjectPointerReference(_In_ PFLT_OBJECT Object) /* Store the old count and increment */ Result = &Object->PointerCount; - InterlockedIncrement((PLONG)&Object->PointerCount); + InterlockedIncrementSizeT(&Object->PointerCount); /* Return the initial value */ return *Result; @@ -264,7 +264,7 @@ FltpObjectPointerReference(_In_ PFLT_OBJECT Object) VOID FltpObjectPointerDereference(_In_ PFLT_OBJECT Object) { - if (!InterlockedDecrement((PLONG)Object->PointerCount)) + if (InterlockedDecrementSizeT(&Object->PointerCount) == 0) { // Cleanup FLT_ASSERT(FALSE); diff --git a/drivers/network/afd/afd/write.c b/drivers/network/afd/afd/write.c index 605676102a..29ad9501b7 100644 --- a/drivers/network/afd/afd/write.c +++ b/drivers/network/afd/afd/write.c @@ -22,7 +22,7 @@ static NTSTATUS NTAPI SendComplete PIO_STACK_LOCATION NextIrpSp; PAFD_SEND_INFO SendReq = NULL; PAFD_MAPBUF Map; - UINT TotalBytesCopied = 0, TotalBytesProcessed = 0, SpaceAvail, i; + SIZE_T TotalBytesCopied = 0, TotalBytesProcessed = 0, SpaceAvail, i; UINT SendLength, BytesCopied; BOOLEAN HaltSendQueue; diff --git a/drivers/network/ndis/ndis/miniport.c b/drivers/network/ndis/ndis/miniport.c index 3301682b97..38ee5d01b3 100644 --- a/drivers/network/ndis/ndis/miniport.c +++ b/drivers/network/ndis/ndis/miniport.c @@ -512,7 +512,7 @@ MiniRequestComplete( /* We are doing this internally, so we'll signal this event we've stashed in the MacBlock */ ASSERT(MacBlock->Unknown1 != NULL); ASSERT(MacBlock->Unknown3 == NULL); - MacBlock->Unknown3 = (PVOID)Status; + MacBlock->Unknown3 = UlongToPtr(Status); KeSetEvent(MacBlock->Unknown1, IO_NO_INCREMENT, FALSE); } @@ -789,7 +789,7 @@ MiniSetInformation( if (NdisStatus == NDIS_STATUS_PENDING) { KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); - NdisStatus = (NDIS_STATUS)MacBlock->Unknown3; + NdisStatus = PtrToUlong(MacBlock->Unknown3); } *BytesRead = NdisRequest->DATA.SET_INFORMATION.BytesRead; @@ -849,7 +849,7 @@ MiniQueryInformation( if (NdisStatus == NDIS_STATUS_PENDING) { KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); - NdisStatus = (NDIS_STATUS)MacBlock->Unknown3; + NdisStatus = PtrToUlong(MacBlock->Unknown3); } *BytesWritten = NdisRequest->DATA.QUERY_INFORMATION.BytesWritten; diff --git a/drivers/network/tcpip/include/debug.h b/drivers/network/tcpip/include/debug.h index 303d66a555..4411c591e0 100644 --- a/drivers/network/tcpip/include/debug.h +++ b/drivers/network/tcpip/include/debug.h @@ -72,7 +72,7 @@ #define CP CHECKPOINT #define ASSERT_KM_POINTER(_x) \ - ASSERT(((PVOID)_x) != (PVOID)0xcccccccc); \ - ASSERT(((PVOID)_x) >= (PVOID)0x80000000); + ASSERT(((ULONG_PTR)(_x)) != (ULONG_PTR)0xccccccccccccccccULL); \ + ASSERT(((PVOID)(_x)) >= MmSystemRangeStart); /* EOF */ diff --git a/drivers/parallel/parport/pdo.c b/drivers/parallel/parport/pdo.c index ccd00a88a2..0760ffabb4 100644 --- a/drivers/parallel/parport/pdo.c +++ b/drivers/parallel/parport/pdo.c @@ -121,7 +121,7 @@ PdoWrite(IN PDEVICE_OBJECT DeviceObject, do { KeStallExecutionProcessor(10); - PortStatus = READ_PORT_UCHAR((PUCHAR)(FdoDeviceExtension->BaseAddress + 1)); + PortStatus = READ_PORT_UCHAR(UlongToPtr(FdoDeviceExtension->BaseAddress + 1)); ulCount++; } while (ulCount < 500000 && !(PortStatus & LP_PBUSY)); @@ -138,15 +138,15 @@ PdoWrite(IN PDEVICE_OBJECT DeviceObject, } /* Write character */ - WRITE_PORT_UCHAR((PUCHAR)FdoDeviceExtension->BaseAddress, Buffer[i]); + WRITE_PORT_UCHAR(UlongToPtr(FdoDeviceExtension->BaseAddress), Buffer[i]); KeStallExecutionProcessor(10); - WRITE_PORT_UCHAR((PUCHAR)(FdoDeviceExtension->BaseAddress + 2), (LP_PSELECP | LP_PINITP | LP_PSTROBE)); + WRITE_PORT_UCHAR(UlongToPtr(FdoDeviceExtension->BaseAddress + 2), (LP_PSELECP | LP_PINITP | LP_PSTROBE)); KeStallExecutionProcessor(10); - WRITE_PORT_UCHAR((PUCHAR)(FdoDeviceExtension->BaseAddress + 2), (LP_PSELECP | LP_PINITP)); + WRITE_PORT_UCHAR(UlongToPtr(FdoDeviceExtension->BaseAddress + 2), (LP_PSELECP | LP_PINITP)); } Irp->IoStatus.Information = 0; diff --git a/drivers/sac/driver/chanmgr.c b/drivers/sac/driver/chanmgr.c index 7dc406116d..cf2947f916 100644 --- a/drivers/sac/driver/chanmgr.c +++ b/drivers/sac/driver/chanmgr.c @@ -393,7 +393,7 @@ ChanMgrCreateChannel(OUT PSAC_CHANNEL *Channel, { /* Free slot found, attempt to use it */ ASSERT(!CHANNEL_SLOT_IS_IN_USE(i)); - _InterlockedCompareExchange((PLONG)&ChannelArray[i], (LONG)NewChannel, 0); + InterlockedCompareExchangePointer((PVOID*)&ChannelArray[i], NewChannel, NULL); if (ChannelArray[i] == NewChannel) break; } } diff --git a/drivers/sac/driver/dispatch.c b/drivers/sac/driver/dispatch.c index 60944186e6..80c7f099d0 100644 --- a/drivers/sac/driver/dispatch.c +++ b/drivers/sac/driver/dispatch.c @@ -64,7 +64,7 @@ TimerDpcRoutine(IN PKDPC Dpc, IN PVOID SystemArgument2) { HEADLESS_RSP_GET_BYTE ByteValue; - ULONG ValueSize; + SIZE_T ValueSize; BOOLEAN GotChar; NTSTATUS Status; PSAC_DEVICE_EXTENSION SacExtension; diff --git a/drivers/sac/driver/util.c b/drivers/sac/driver/util.c index 791bb321e9..06446c93e8 100644 --- a/drivers/sac/driver/util.c +++ b/drivers/sac/driver/util.c @@ -397,7 +397,7 @@ GetRegistryValueBuffer(IN PCWSTR KeyName, OBJECT_ATTRIBUTES ObjectAttributes; UNICODE_STRING DestinationString; HANDLE Handle; - SIZE_T ResultLength = 0; + ULONG ResultLength = 0; SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC GetRegistryValueBuffer: Entering.\n"); CHECK_PARAMETER1(KeyName); CHECK_PARAMETER2(ValueName); @@ -539,7 +539,7 @@ TranslateMachineInformationXML(IN PWCHAR *Buffer, IN PWCHAR ExtraData) { NTSTATUS Status; - ULONG Size; + SIZE_T Size; PWCHAR p; CHECK_PARAMETER1(Buffer); @@ -694,7 +694,7 @@ InitializeMachineInformation(VOID) ULONG SuiteTypeMessage; BOOLEAN SetupInProgress = FALSE; GUID SystemGuid; - ULONG RealSize, Size, OutputSize; + SIZE_T RealSize, Size, OutputSize; PKEY_VALUE_PARTIAL_INFORMATION PartialInfo; RTL_OSVERSIONINFOEXW VersionInformation; SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC Initialize Machine Information : Entering.\n"); @@ -1102,7 +1102,7 @@ RegisterBlueScreenMachineInformation(VOID) { PWCHAR XmlBuffer; PHEADLESS_CMD_SET_BLUE_SCREEN_DATA BsBuffer; - ULONG Length, HeaderLength, TotalLength; + SIZE_T Length, HeaderLength, TotalLength; NTSTATUS Status; ULONG i; diff --git a/drivers/storage/fdc/fdc/fdo.c b/drivers/storage/fdc/fdc/fdo.c index b1c7125f8e..d9a759c5d2 100644 --- a/drivers/storage/fdc/fdc/fdo.c +++ b/drivers/storage/fdc/fdc/fdo.c @@ -134,7 +134,7 @@ FdcFdoStartDevice( PartialDescriptor->u.Port.Start.u.LowPart, PartialDescriptor->u.Port.Length); if (PartialDescriptor->u.Port.Length >= 6) - DeviceExtension->ControllerInfo.BaseAddress = (PUCHAR)PartialDescriptor->u.Port.Start.u.LowPart; + DeviceExtension->ControllerInfo.BaseAddress = (PUCHAR)(ULONG_PTR)PartialDescriptor->u.Port.Start.QuadPart; break; case CmResourceTypeInterrupt: @@ -206,7 +206,7 @@ FdcFdoConfigCallback( if (PartialDescriptor->Type == CmResourceTypePort) { - if ((PUCHAR)PartialDescriptor->u.Port.Start.LowPart == DeviceExtension->ControllerInfo.BaseAddress) + if ((PUCHAR)(ULONG_PTR)PartialDescriptor->u.Port.Start.QuadPart == DeviceExtension->ControllerInfo.BaseAddress) ControllerFound = TRUE; } } diff --git a/drivers/usb/usbehci/hardware.cpp b/drivers/usb/usbehci/hardware.cpp index 52478f9b93..8562eaa4b3 100644 --- a/drivers/usb/usbehci/hardware.cpp +++ b/drivers/usb/usbehci/hardware.cpp @@ -221,7 +221,7 @@ CUSBHardwareDevice::SetCommandRegister(PEHCI_USBCMD_CONTENT UsbCmd) { PULONG Register; Register = (PULONG)UsbCmd; - WRITE_REGISTER_ULONG((PULONG)((ULONG)m_Base + EHCI_USBCMD), *Register); + WRITE_REGISTER_ULONG((PULONG)((PUCHAR)m_Base + EHCI_USBCMD), *Register); } VOID @@ -230,19 +230,19 @@ CUSBHardwareDevice::GetCommandRegister(PEHCI_USBCMD_CONTENT UsbCmd) { PULONG Register; Register = (PULONG)UsbCmd; - *Register = READ_REGISTER_ULONG((PULONG)((ULONG)m_Base + EHCI_USBCMD)); + *Register = READ_REGISTER_ULONG((PULONG)((PUCHAR)m_Base + EHCI_USBCMD)); } ULONG CUSBHardwareDevice::EHCI_READ_REGISTER_ULONG(ULONG Offset) { - return READ_REGISTER_ULONG((PULONG)((ULONG)m_Base + Offset)); + return READ_REGISTER_ULONG((PULONG)((PUCHAR)m_Base + Offset)); } VOID CUSBHardwareDevice::EHCI_WRITE_REGISTER_ULONG(ULONG Offset, ULONG Value) { - WRITE_REGISTER_ULONG((PULONG)((ULONG)m_Base + Offset), Value); + WRITE_REGISTER_ULONG((PULONG)((PUCHAR)m_Base + Offset), Value); } VOID @@ -384,7 +384,7 @@ CUSBHardwareDevice::PnpStart( // // each entry is a 4 bit field EHCI 2.2.5 // - Value = READ_REGISTER_UCHAR((PUCHAR)(ULONG)ResourceBase + EHCI_HCSP_PORTROUTE + Count); + Value = READ_REGISTER_UCHAR((PUCHAR)(ULONG_PTR)ResourceBase + EHCI_HCSP_PORTROUTE + Count); m_Capabilities.PortRoute[Count*2] = (Value & 0xF0); if ((Count*2) + 1 < m_Capabilities.HCSParams.PortCount) @@ -397,7 +397,7 @@ CUSBHardwareDevice::PnpStart( // // Set m_Base to the address of Operational Register Space // - m_Base = (PULONG)((ULONG)ResourceBase + m_Capabilities.Length); + m_Base = (PULONG)((ULONG_PTR)ResourceBase + m_Capabilities.Length); break; } } @@ -1282,7 +1282,7 @@ InterruptServiceRoutine( return TRUE; } - KeInsertQueueDpc(&This->m_IntDpcObject, This, (PVOID)CStatus); + KeInsertQueueDpc(&This->m_IntDpcObject, This, UlongToPtr(CStatus)); return TRUE; } @@ -1299,7 +1299,7 @@ EhciDeferredRoutine( EHCI_USBCMD_CONTENT UsbCmd; This = (CUSBHardwareDevice*) SystemArgument1; - CStatus = (ULONG) SystemArgument2; + CStatus = PtrToUlong(SystemArgument2); DPRINT("EhciDeferredRoutine CStatus %lx\n", CStatus); diff --git a/drivers/usb/usbohci/hardware.cpp b/drivers/usb/usbohci/hardware.cpp index 599f218665..4ff9bebd8b 100644 --- a/drivers/usb/usbohci/hardware.cpp +++ b/drivers/usb/usbohci/hardware.cpp @@ -1412,7 +1412,7 @@ InterruptServiceRoutine( // defer processing // DPRINT("Status %x Acknowledge %x FrameNumber %x\n", Status, Acknowledge, This->m_HCCA->CurrentFrameNumber); - KeInsertQueueDpc(&This->m_IntDpcObject, (PVOID)Status, (PVOID)(DoneHead & ~1)); + KeInsertQueueDpc(&This->m_IntDpcObject, UlongToPtr(Status), UlongToPtr(DoneHead & ~1)); // // interrupt handled @@ -1436,8 +1436,8 @@ OhciDeferredRoutine( // get parameters // This = (CUSBHardwareDevice*)DeferredContext; - CStatus = (ULONG) SystemArgument1; - DoneHead = (ULONG)SystemArgument2; + CStatus = PtrToUlong(SystemArgument1); + DoneHead = PtrToUlong(SystemArgument2); DPRINT("OhciDeferredRoutine Status %x DoneHead %x\n", CStatus, DoneHead); diff --git a/drivers/usb/usbstor/scsi.c b/drivers/usb/usbstor/scsi.c index ee5bfba189..b5f9fbc9f2 100644 --- a/drivers/usb/usbstor/scsi.c +++ b/drivers/usb/usbstor/scsi.c @@ -99,9 +99,9 @@ USBSTOR_IsCSWValid( return FALSE; } - if (Context->csw->Tag != (ULONG)Context->csw) + if (Context->csw->Tag != (ULONG_PTR)Context->csw) { - DPRINT1("[USBSTOR] Expected Tag %x but got %x\n", (ULONG)Context->csw, Context->csw->Tag); + DPRINT1("[USBSTOR] Expected Tag %Ix but got %x\n", (ULONG_PTR)Context->csw, Context->csw->Tag); return FALSE; } @@ -660,7 +660,7 @@ USBSTOR_SendRequest( // // now build the cbw // - USBSTOR_BuildCBW((ULONG)Context->cbw, + USBSTOR_BuildCBW(PtrToUlong(Context->cbw), TransferDataLength, PDODeviceExtension->LUN, CommandLength, diff --git a/drivers/usb/usbuhci/hardware.cpp b/drivers/usb/usbuhci/hardware.cpp index 2281496943..44605a9dbe 100644 --- a/drivers/usb/usbuhci/hardware.cpp +++ b/drivers/usb/usbuhci/hardware.cpp @@ -295,7 +295,7 @@ CUSBHardwareDevice::PnpStart( // // Store Resource base // - m_Base = (PULONG)ResourceDescriptor->u.Port.Start.LowPart; //FIXME + m_Base = (PULONG)(ULONG_PTR)ResourceDescriptor->u.Port.Start.QuadPart; //FIXME DPRINT("UHCI Base %p Length %x\n", m_Base, ResourceDescriptor->u.Port.Length); break; } @@ -559,7 +559,7 @@ CUSBHardwareDevice::GlobalReset() // back up start of modify register // ASSERT(m_Base); - UCHAR sofValue = READ_PORT_UCHAR((PUCHAR)((ULONG)m_Base + UHCI_SOFMOD)); + UCHAR sofValue = READ_PORT_UCHAR((PUCHAR)m_Base + UHCI_SOFMOD); // // perform global reset @@ -592,7 +592,7 @@ CUSBHardwareDevice::GlobalReset() // // restore start of modify register // - WRITE_PORT_UCHAR((PUCHAR)((ULONG)m_Base + UHCI_SOFMOD), sofValue); + WRITE_PORT_UCHAR((PUCHAR)m_Base + UHCI_SOFMOD, sofValue); } NTSTATUS @@ -1340,7 +1340,7 @@ CUSBHardwareDevice::WriteRegister8( IN ULONG Register, IN UCHAR Value) { - WRITE_PORT_UCHAR((PUCHAR)((ULONG)m_Base + Register), Value); + WRITE_PORT_UCHAR((PUCHAR)((PUCHAR)m_Base + Register), Value); } @@ -1349,7 +1349,7 @@ CUSBHardwareDevice::WriteRegister16( ULONG Register, USHORT Value) { - WRITE_PORT_USHORT((PUSHORT)((ULONG)m_Base + Register), Value); + WRITE_PORT_USHORT((PUSHORT)((PUCHAR)m_Base + Register), Value); } @@ -1358,7 +1358,7 @@ CUSBHardwareDevice::WriteRegister32( ULONG Register, ULONG Value) { - WRITE_PORT_ULONG((PULONG)((ULONG)m_Base + Register), Value); + WRITE_PORT_ULONG((PULONG)((PUCHAR)m_Base + Register), Value); } @@ -1366,7 +1366,7 @@ UCHAR CUSBHardwareDevice::ReadRegister8( ULONG Register) { - return READ_PORT_UCHAR((PUCHAR)((ULONG)m_Base + Register)); + return READ_PORT_UCHAR((PUCHAR)((PUCHAR)m_Base + Register)); } @@ -1374,7 +1374,7 @@ USHORT CUSBHardwareDevice::ReadRegister16( ULONG Register) { - return READ_PORT_USHORT((PUSHORT)((ULONG)m_Base + Register)); + return READ_PORT_USHORT((PUSHORT)((PUCHAR)m_Base + Register)); } @@ -1382,7 +1382,7 @@ ULONG CUSBHardwareDevice::ReadRegister32( ULONG Register) { - return READ_PORT_ULONG((PULONG)((ULONG)m_Base + Register)); + return READ_PORT_ULONG((PULONG)((PUCHAR)m_Base + Register)); } VOID diff --git a/sdk/lib/drivers/libusb/hub_controller.cpp b/sdk/lib/drivers/libusb/hub_controller.cpp index 9ebedfbc87..4d0d30d259 100644 --- a/sdk/lib/drivers/libusb/hub_controller.cpp +++ b/sdk/lib/drivers/libusb/hub_controller.cpp @@ -408,7 +408,8 @@ CHubController::HandlePnp( PPNP_BUS_INFORMATION BusInformation; PDEVICE_RELATIONS DeviceRelations; NTSTATUS Status; - ULONG Index = 0, Length; + ULONG Index = 0; + SIZE_T Length; USHORT VendorID, DeviceID; ULONG HiSpeed, NumPorts; WCHAR Buffer[300]; diff --git a/sdk/lib/drivers/ntoskrnl_vista/ke.c b/sdk/lib/drivers/ntoskrnl_vista/ke.c index 638af49311..e807225d87 100644 --- a/sdk/lib/drivers/ntoskrnl_vista/ke.c +++ b/sdk/lib/drivers/ntoskrnl_vista/ke.c @@ -22,6 +22,6 @@ KeQueryActiveProcessorCount(OUT PKAFFINITY ActiveProcessors OPTIONAL) *ActiveProcessors = ActiveMap; } - RtlInitializeBitMap(&Bitmap, &ActiveMap, sizeof(ActiveMap) * 8); + RtlInitializeBitMap(&Bitmap, (PULONG)&ActiveMap, sizeof(ActiveMap) * 8); return RtlNumberOfSetBits(&Bitmap); } diff --git a/sdk/lib/drivers/rxce/rxce.c b/sdk/lib/drivers/rxce/rxce.c index 8a06e5591a..424294b33d 100644 --- a/sdk/lib/drivers/rxce/rxce.c +++ b/sdk/lib/drivers/rxce/rxce.c @@ -2312,7 +2312,7 @@ RxDereferenceAndDeleteRxContext_Real( /* Is ShadowCrit still owned? Shouldn't happen! */ if (RxContext->ShadowCritOwner != 0) { - DPRINT1("ShadowCritOwner not null! %p\n", (PVOID)RxContext->ShadowCritOwner); + DPRINT1("ShadowCritOwner not null! %lx\n", RxContext->ShadowCritOwner); ASSERT(FALSE); } #endif diff --git a/sdk/lib/drivers/sound/mmebuddy/mixer/mxdMessage.c b/sdk/lib/drivers/sound/mmebuddy/mixer/mxdMessage.c index aa196993b6..0571125885 100644 --- a/sdk/lib/drivers/sound/mmebuddy/mixer/mxdMessage.c +++ b/sdk/lib/drivers/sound/mmebuddy/mixer/mxdMessage.c @@ -108,7 +108,7 @@ mxdMessage( DeviceId, (LPWAVEOPENDESC) Parameter1, /* unused */ Parameter2, - (DWORD*) PrivateHandle); + (DWORD_PTR*) PrivateHandle); VALIDATE_MMSYS_PARAMETER(*(DWORD_PTR*)PrivateHandle); break; } diff --git a/sdk/lib/drivers/sound/mment4/detect.c b/sdk/lib/drivers/sound/mment4/detect.c index 1395f1bae4..72cee5f0dd 100644 --- a/sdk/lib/drivers/sound/mment4/detect.c +++ b/sdk/lib/drivers/sound/mment4/detect.c @@ -153,7 +153,7 @@ DetectNt4SoundDevices( IN PWSTR BaseDeviceName, IN SOUND_DEVICE_DETECTED_PROC SoundDeviceDetectedProc) { - ULONG DeviceNameLength = 0; + SIZE_T DeviceNameLength = 0; PWSTR DeviceName = NULL; ULONG Index = 0; HANDLE DeviceHandle; diff --git a/sdk/lib/drivers/sound/mment4/registry.c b/sdk/lib/drivers/sound/mment4/registry.c index 9a6c175a9f..adb4a3cfb2 100644 --- a/sdk/lib/drivers/sound/mment4/registry.c +++ b/sdk/lib/drivers/sound/mment4/registry.c @@ -21,7 +21,7 @@ OpenSoundDriverParametersRegKey( IN LPWSTR ServiceName, OUT PHKEY KeyHandle) { - ULONG KeyLength; + SIZE_T KeyLength; PWCHAR ParametersKeyName; VALIDATE_MMSYS_PARAMETER( ServiceName ); @@ -75,7 +75,7 @@ OpenSoundDeviceRegKey( IN DWORD DeviceIndex, OUT PHKEY KeyHandle) { - DWORD PathLength; + SIZE_T PathLength; PWCHAR RegPath; VALIDATE_MMSYS_PARAMETER( ServiceName ); diff --git a/sdk/lib/drivers/sound/mmixer/midi.c b/sdk/lib/drivers/sound/mmixer/midi.c index afe1a22bfd..d659381de0 100644 --- a/sdk/lib/drivers/sound/mmixer/midi.c +++ b/sdk/lib/drivers/sound/mmixer/midi.c @@ -386,7 +386,7 @@ MMixerGetMidiDevicePath( PMIXER_LIST MixerList; LPMIXER_DATA MixerData; LPMIDI_INFO MidiInfo; - ULONG Length; + SIZE_T Length; MIXER_STATUS Status; /* verify mixer context */ diff --git a/sdk/lib/drivers/sound/mmixer/wave.c b/sdk/lib/drivers/sound/mmixer/wave.c index cc3e5f24c9..962934b8d5 100644 --- a/sdk/lib/drivers/sound/mmixer/wave.c +++ b/sdk/lib/drivers/sound/mmixer/wave.c @@ -665,7 +665,7 @@ MMixerGetWaveDevicePath( PMIXER_LIST MixerList; LPMIXER_DATA MixerData; LPWAVE_INFO WaveInfo; - ULONG Length; + SIZE_T Length; MIXER_STATUS Status; /* verify mixer context */
6 years, 4 months
1
0
0
0
04/16: [UNIATA] Fix 64 bit issues
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f8bf0e9c3a82203625ead…
commit f8bf0e9c3a82203625eadb0408cf1e35351913ce Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Tue Feb 27 22:15:44 2018 +0100 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Sat Aug 4 19:19:34 2018 +0200 [UNIATA] Fix 64 bit issues --- drivers/storage/ide/uniata/bsmaster.h | 4 ++++ drivers/storage/ide/uniata/id_ata.cpp | 30 +++++++++++++++--------------- drivers/storage/ide/uniata/id_dma.cpp | 16 ++++++++++++++++ drivers/storage/ide/uniata/id_init.cpp | 11 +++++++++++ drivers/storage/ide/uniata/id_probe.cpp | 24 ++++++++++++++++++++++++ drivers/storage/ide/uniata/id_sata.cpp | 4 ++++ 6 files changed, 74 insertions(+), 15 deletions(-) diff --git a/drivers/storage/ide/uniata/bsmaster.h b/drivers/storage/ide/uniata/bsmaster.h index 9ea8af390d..1e2332d75e 100644 --- a/drivers/storage/ide/uniata/bsmaster.h +++ b/drivers/storage/ide/uniata/bsmaster.h @@ -1588,7 +1588,11 @@ AtapiChipInit( IN ULONG c ); +#ifdef __REACTOS__ +extern ULONG_PTR +#else extern ULONG +#endif NTAPI AtapiGetIoRange( IN PVOID HwDeviceExtension, diff --git a/drivers/storage/ide/uniata/id_ata.cpp b/drivers/storage/ide/uniata/id_ata.cpp index 6f0f1da94a..e8e5d009f2 100644 --- a/drivers/storage/ide/uniata/id_ata.cpp +++ b/drivers/storage/ide/uniata/id_ata.cpp @@ -282,10 +282,10 @@ AtapiWritePort##sz( \ ASSERT(FALSE); /* We should never get here */ \ } \ if(!res->MemIo) { \ - ScsiPortWritePort##_Type((_type*)(res->Addr), data); \ + ScsiPortWritePort##_Type((_type*)(ULONG_PTR)(res->Addr), data); \ } else { \ /*KdPrint(("r_mem @ (%x) %x\n", _port, port));*/ \ - ScsiPortWriteRegister##_Type((_type*)(res->Addr), data); \ + ScsiPortWriteRegister##_Type((_type*)(ULONG_PTR)(res->Addr), data); \ } \ return; \ } @@ -319,10 +319,10 @@ AtapiWritePortEx##sz( \ ASSERT(FALSE); /* We should never get here */ \ } \ if(!res->MemIo) { \ - ScsiPortWritePort##_Type((_type*)(res->Addr+offs), data); \ + ScsiPortWritePort##_Type((_type*)(ULONG_PTR)(res->Addr+offs), data); \ } else { \ /*KdPrint(("r_mem @ (%x) %x\n", _port, port));*/ \ - ScsiPortWriteRegister##_Type((_type*)(res->Addr+offs), data); \ + ScsiPortWriteRegister##_Type((_type*)(ULONG_PTR)(res->Addr+offs), data); \ } \ return; \ } @@ -355,10 +355,10 @@ AtapiReadPort##sz( \ } \ if(!res->MemIo) { \ /*KdPrint(("r_io @ (%x) %x\n", _port, res->Addr));*/ \ - return ScsiPortReadPort##_Type((_type*)(res->Addr)); \ + return ScsiPortReadPort##_Type((_type*)(ULONG_PTR)(res->Addr)); \ } else { \ /*KdPrint(("r_mem @ (%x) %x\n", _port, res->Addr));*/ \ - return ScsiPortReadRegister##_Type((_type*)(res->Addr)); \ + return ScsiPortReadRegister##_Type((_type*)(ULONG_PTR)(res->Addr)); \ } \ } @@ -390,10 +390,10 @@ AtapiReadPortEx##sz( \ ASSERT(FALSE); /* We should never get here */ \ } \ if(!res->MemIo) { \ - return ScsiPortReadPort##_Type((_type*)(res->Addr+offs)); \ + return ScsiPortReadPort##_Type((_type*)(ULONG_PTR)(res->Addr+offs)); \ } else { \ /*KdPrint(("r_mem @ (%x) %x\n", _port, port));*/ \ - return ScsiPortReadRegister##_Type((_type*)(res->Addr+offs)); \ + return ScsiPortReadRegister##_Type((_type*)(ULONG_PTR)(res->Addr+offs)); \ } \ } @@ -435,11 +435,11 @@ AtapiReadBuffer##sz( \ } \ if(!res->MemIo) { \ /*KdPrint(("r_io @ (%x) %x\n", _port, res->Addr));*/ \ - ScsiPortReadPortBuffer##_Type((_type*)(res->Addr), (_type*)Buffer, Count); \ + ScsiPortReadPortBuffer##_Type((_type*)(ULONG_PTR)(res->Addr), (_type*)Buffer, Count); \ return; \ } \ while(Count) { \ - (*((_type*)Buffer)) = ScsiPortReadRegister##_Type((_type*)(res->Addr)); \ + (*((_type*)Buffer)) = ScsiPortReadRegister##_Type((_type*)(ULONG_PTR)(res->Addr)); \ Count--; \ Buffer = ((_type*)Buffer)+1; \ } \ @@ -480,11 +480,11 @@ AtapiWriteBuffer##sz( \ } \ if(!res->MemIo) { \ /*KdPrint(("r_io @ (%x) %x\n", _port, res->Addr));*/ \ - ScsiPortWritePortBuffer##_Type((_type*)(res->Addr), (_type*)Buffer, Count); \ + ScsiPortWritePortBuffer##_Type((_type*)(ULONG_PTR)(res->Addr), (_type*)Buffer, Count); \ return; \ } \ while(Count) { \ - ScsiPortWriteRegister##_Type((_type*)(res->Addr), *((_type*)Buffer)); \ + ScsiPortWriteRegister##_Type((_type*)(ULONG_PTR)(res->Addr), *((_type*)Buffer)); \ Count--; \ Buffer = ((_type*)Buffer)+1; \ } \ @@ -10850,7 +10850,7 @@ DriverEntry( newStatus = ScsiPortInitialize(DriverObject, Argument2, &hwInitializationData.comm, - (PVOID)(i | ((alt ^ pref_alt) ? 0x80000000 : 0))); + UlongToPtr(i | ((alt ^ pref_alt) ? 0x80000000 : 0))); KdPrint2((PRINT_PREFIX "ScsiPortInitialize Status %#x\n", newStatus)); if (newStatus < statusToReturn) { statusToReturn = newStatus; @@ -10945,7 +10945,7 @@ DriverEntry( newStatus = ScsiPortInitialize(DriverObject, Argument2, &hwInitializationData.comm, - (PVOID)i); + UlongToPtr(i)); KdPrint2((PRINT_PREFIX "ScsiPortInitialize Status %#x\n", newStatus)); if(newStatus == (ULONG)STATUS_DEVICE_DOES_NOT_EXIST && BMList[i].NeedAltInit) { // Note: this is actually a BUG in scsiport.sys @@ -10958,7 +10958,7 @@ DriverEntry( newStatus = ScsiPortInitialize(DriverObject, Argument2, &hwInitializationData.comm, - (PVOID)(i | 0x80000000)); + UlongToPtr(i | 0x80000000)); KdPrint2((PRINT_PREFIX "ScsiPortInitialize Status %#x (2)\n", newStatus)); } if (newStatus < statusToReturn) diff --git a/drivers/storage/ide/uniata/id_dma.cpp b/drivers/storage/ide/uniata/id_dma.cpp index eef324aa7a..9ce765552b 100644 --- a/drivers/storage/ide/uniata/id_dma.cpp +++ b/drivers/storage/ide/uniata/id_dma.cpp @@ -293,7 +293,11 @@ AtapiDmaSetup( return FALSE; } //KdPrint2((PRINT_PREFIX " checkpoint 3\n" )); +#ifdef __REACTOS__ + if((ULONG_PTR)data & deviceExtension->AlignmentMask) { +#else if((ULONG)data & deviceExtension->AlignmentMask) { +#endif KdPrint2((PRINT_PREFIX "AtapiDmaSetup: unaligned data: %#x (%#x)\n", data, deviceExtension->AlignmentMask)); return FALSE; } @@ -341,7 +345,11 @@ retry_DB_IO: return FALSE; } +#ifdef __REACTOS__ + dma_count = min(count, (PAGE_SIZE - ((ULONG_PTR)data & PAGE_MASK))); +#else dma_count = min(count, (PAGE_SIZE - ((ULONG)data & PAGE_MASK))); +#endif data += dma_count; count -= dma_count; i = 0; @@ -436,7 +444,11 @@ retry_DB_IO: *((PULONG)&(AtaReq->ahci.ahci_cmd_ptr->prd_tab[i].DBC_ULONG)) = ((dma_count-1) & 0x3fffff); //AtaReq->ahci.ahci_cmd_ptr->prd_tab[i].I = 1; // interrupt when ready KdPrint2((PRINT_PREFIX " ph data[%d]=%x:%x (%x)\n", i, dma_baseu, dma_base, AtaReq->ahci.ahci_cmd_ptr->prd_tab[i].DBC)); +#ifdef __REACTOS__ + if(((ULONG_PTR)&(AtaReq->ahci.ahci_cmd_ptr->prd_tab) & ~PAGE_MASK) != ((ULONG_PTR)&(AtaReq->ahci.ahci_cmd_ptr->prd_tab[i]) & ~PAGE_MASK)) { +#else if(((ULONG)&(AtaReq->ahci.ahci_cmd_ptr->prd_tab) & ~PAGE_MASK) != ((ULONG)&(AtaReq->ahci.ahci_cmd_ptr->prd_tab[i]) & ~PAGE_MASK)) { +#endif KdPrint2((PRINT_PREFIX "PRD table crosses page boundary! %x vs %x\n", &AtaReq->ahci.ahci_cmd_ptr->prd_tab, &(AtaReq->ahci.ahci_cmd_ptr->prd_tab[i]) )); //AtaReq->Flags |= REQ_FLAG_DMA_DBUF_PRD; @@ -444,7 +456,11 @@ retry_DB_IO: } else { AtaReq->dma_tab[i].base = dma_base; AtaReq->dma_tab[i].count = (dma_count & 0xffff) | ATA_DMA_EOT; +#ifdef __REACTOS__ + if(((ULONG_PTR)&(AtaReq->dma_tab) & ~PAGE_MASK) != ((ULONG_PTR)&(AtaReq->dma_tab[i]) & ~PAGE_MASK)) { +#else if(((ULONG)&(AtaReq->dma_tab) & ~PAGE_MASK) != ((ULONG)&(AtaReq->dma_tab[i]) & ~PAGE_MASK)) { +#endif KdPrint2((PRINT_PREFIX "DMA table crosses page boundary! %x vs %x\n", &AtaReq->dma_tab, &(AtaReq->dma_tab[i]) )); //AtaReq->Flags |= REQ_FLAG_DMA_DBUF_PRD; diff --git a/drivers/storage/ide/uniata/id_init.cpp b/drivers/storage/ide/uniata/id_init.cpp index 39e2b23848..f27ddc3a2a 100644 --- a/drivers/storage/ide/uniata/id_init.cpp +++ b/drivers/storage/ide/uniata/id_init.cpp @@ -350,10 +350,17 @@ UniataChipDetect( ULONG ChipFlags; ULONG tmp32; UCHAR tmp8; +#ifdef __REACTOS__ + ULONG_PTR BaseMemAddress; + ULONG_PTR BaseIoAddress1; + ULONG_PTR BaseIoAddress2; + ULONG_PTR BaseIoAddressBM; +#else ULONG BaseMemAddress; ULONG BaseIoAddress1; ULONG BaseIoAddress2; ULONG BaseIoAddressBM; +#endif BOOLEAN MemIo = FALSE; BOOLEAN IsPata = FALSE; @@ -1203,7 +1210,11 @@ for_ugly_chips: tmp8 = AtapiReadPortEx1(NULL, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressBM_0),IDX_BM_Status); KdPrint2((PRINT_PREFIX "BM status: %x\n", tmp8)); /* cleanup */ +#ifdef __REACTOS__ + ScsiPortFreeDeviceBase(HwDeviceExtension, (PCHAR)(ULONG_PTR)BaseIoAddressBM); +#else ScsiPortFreeDeviceBase(HwDeviceExtension, (PCHAR)BaseIoAddressBM); +#endif UniataInitIoResEx(&deviceExtension->BaseIoAddressBM_0, 0, 0, FALSE); if(tmp8 == 0xff) { diff --git a/drivers/storage/ide/uniata/id_probe.cpp b/drivers/storage/ide/uniata/id_probe.cpp index bfbfd924d5..57c0aa2eb4 100644 --- a/drivers/storage/ide/uniata/id_probe.cpp +++ b/drivers/storage/ide/uniata/id_probe.cpp @@ -148,7 +148,11 @@ UniataEnableIoPCI( /* Get PCI address by ConfigInfo and RID */ +#ifdef __REACTOS__ +ULONG_PTR +#else ULONG +#endif NTAPI AtapiGetIoRange( IN PVOID HwDeviceExtension, @@ -953,7 +957,11 @@ UniataFindCompatBusMasterController2( { return UniataFindBusMasterController( HwDeviceExtension, +#ifdef __REACTOS__ + UlongToPtr(0x80000000), +#else (PVOID)0x80000000, +#endif BusInformation, ArgumentString, ConfigInfo, @@ -1071,7 +1079,11 @@ UniataFindBusMasterController( KdPrint2((PRINT_PREFIX "AdapterInterfaceType: Isa\n")); } if(InDriverEntry) { +#ifdef __REACTOS__ + i = PtrToUlong(Context); +#else i = (ULONG)Context; +#endif if(i & 0x80000000) { AltInit = TRUE; } @@ -1087,7 +1099,11 @@ UniataFindBusMasterController( } if(i >= BMListLen) { KdPrint2((PRINT_PREFIX "unexpected device arrival\n")); +#ifdef __REACTOS__ + i = PtrToUlong(Context); +#else i = (ULONG)Context; +#endif if(FirstMasterOk) { channel = 1; } @@ -2549,14 +2565,22 @@ retryIdentifier: if(BaseIoAddress2) { if(hasPCI) { +#ifdef __REACTOS__ + (*ConfigInfo->AccessRanges)[1].RangeStart = ScsiPortConvertUlongToPhysicalAddress((ULONG_PTR)BaseIoAddress2); +#else (*ConfigInfo->AccessRanges)[1].RangeStart = ScsiPortConvertUlongToPhysicalAddress((ULONG)BaseIoAddress2); +#endif (*ConfigInfo->AccessRanges)[1].RangeLength = ATA_ALTIOSIZE; (*ConfigInfo->AccessRanges)[1].RangeInMemory = FALSE; } else { // NT4 and NT3.51 on ISA-only hardware definitly fail floppy.sys load // when this range is claimed by other driver. // However, floppy should use only 0x3f0-3f5,3f7 +#ifdef __REACTOS__ + if((ULONG_PTR)BaseIoAddress2 >= 0x3f0 && (ULONG_PTR)BaseIoAddress2 <= 0x3f7) { +#else if((ULONG)BaseIoAddress2 >= 0x3f0 && (ULONG)BaseIoAddress2 <= 0x3f7) { +#endif KdPrint2((PRINT_PREFIX "!!! Possible AltStatus vs Floppy IO range interference !!!\n")); } KdPrint2((PRINT_PREFIX "Do not expose to OS on old ISA\n")); diff --git a/drivers/storage/ide/uniata/id_sata.cpp b/drivers/storage/ide/uniata/id_sata.cpp index 5306fbe92f..6a16c16f09 100644 --- a/drivers/storage/ide/uniata/id_sata.cpp +++ b/drivers/storage/ide/uniata/id_sata.cpp @@ -902,7 +902,11 @@ UniataAhciDetect( ULONG v_Mn, v_Mj; #endif //_DEBUG ULONG NumberChannels; +#ifdef __REACTOS__ + ULONG_PTR BaseMemAddress; +#else ULONG BaseMemAddress; +#endif BOOLEAN MemIo = FALSE; BOOLEAN found = FALSE;
6 years, 4 months
1
0
0
0
← Newer
1
...
26
27
28
29
30
31
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Results per page:
10
25
50
100
200