https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f9a967b2ae48fbe1a6bfde76935d2bba67e2330b

commit f9a967b2ae48fbe1a6bfde76935d2bba67e2330b
Author:     Timo Kreuzer <[email protected]>
AuthorDate: Mon Apr 1 14:24:05 2019 +0200
Commit:     Timo Kreuzer <[email protected]>
CommitDate: Sat Apr 13 14:07:50 2019 +0200

    [REACTOS] Fix misc 64 bit issues
---
 boot/freeldr/freeldr/arch/i386/drivemap.c |  8 ++++---
 dll/win32/iphlpapi/iphlpapi_main.c        | 40 +++++++++++++++----------------
 dll/win32/shell32/shelldesktop/dde.cpp    |  2 +-
 3 files changed, 26 insertions(+), 24 deletions(-)

diff --git a/boot/freeldr/freeldr/arch/i386/drivemap.c 
b/boot/freeldr/freeldr/arch/i386/drivemap.c
index c1ea58742ca..f03d14e783e 100644
--- a/boot/freeldr/freeldr/arch/i386/drivemap.c
+++ b/boot/freeldr/freeldr/arch/i386/drivemap.c
@@ -172,8 +172,8 @@ UCHAR DriveMapGetBiosDriveNumber(PCSTR DeviceName)
 
 VOID DriveMapInstallInt13Handler(PDRIVE_MAP_LIST DriveMap)
 {
-    ULONG*  RealModeIVT = (ULONG*)0x00000000;
-    USHORT* BiosLowMemorySize = (USHORT*)0x00000413;
+    ULONG*  RealModeIVT = (ULONG*)UlongToPtr(0x00000000);
+    USHORT* BiosLowMemorySize = (USHORT*)ULongToPtr(0x00000413);
 
     if (!DriveMapInstalled)
     {
@@ -197,7 +197,9 @@ VOID DriveMapInstallInt13Handler(PDRIVE_MAP_LIST DriveMap)
     DriveMapOldInt13HandlerAddress = OldInt13HandlerAddress;
 
     // Copy the code to our reserved area
-    RtlCopyMemory((PVOID)DriveMapHandlerAddress, &DriveMapInt13HandlerStart, 
((ULONG)&DriveMapInt13HandlerEnd - (ULONG)&DriveMapInt13HandlerStart));
+    RtlCopyMemory(UlongToPtr(DriveMapHandlerAddress),
+                  &DriveMapInt13HandlerStart,
+                  ((PUCHAR)&DriveMapInt13HandlerEnd - 
(PUCHAR)&DriveMapInt13HandlerStart));
 
     // Update the IVT
     RealModeIVT[0x13] = DriveMapHandlerSegOff;
diff --git a/dll/win32/iphlpapi/iphlpapi_main.c 
b/dll/win32/iphlpapi/iphlpapi_main.c
index 327b31717ab..242fb3bbd55 100644
--- a/dll/win32/iphlpapi/iphlpapi_main.c
+++ b/dll/win32/iphlpapi/iphlpapi_main.c
@@ -109,8 +109,8 @@ DWORD WINAPI AllocateAndGetIfTableFromStack(PMIB_IFTABLE 
*ppIfTable,
 {
   DWORD ret;
 
-  TRACE("ppIfTable %p, bOrder %ld, heap 0x%08lx, flags 0x%08lx\n", ppIfTable,
-   (DWORD)bOrder, (DWORD)heap, flags);
+  TRACE("ppIfTable %p, bOrder %ld, heap 0x%p, flags 0x%08lx\n", ppIfTable,
+   (DWORD)bOrder, heap, flags);
   if (!ppIfTable)
     ret = ERROR_INVALID_PARAMETER;
   else {
@@ -153,8 +153,8 @@ DWORD WINAPI 
AllocateAndGetIpAddrTableFromStack(PMIB_IPADDRTABLE *ppIpAddrTable,
 {
   DWORD ret;
 
-  TRACE("ppIpAddrTable %p, bOrder %ld, heap 0x%08lx, flags 0x%08lx\n",
-   ppIpAddrTable, (DWORD)bOrder, (DWORD)heap, flags);
+  TRACE("ppIpAddrTable %p, bOrder %ld, heap 0x%p, flags 0x%08lx\n",
+   ppIpAddrTable, (DWORD)bOrder, heap, flags);
   if (!ppIpAddrTable)
     ret = ERROR_INVALID_PARAMETER;
   else {
@@ -195,8 +195,8 @@ DWORD WINAPI 
AllocateAndGetIpForwardTableFromStack(PMIB_IPFORWARDTABLE *
 {
   DWORD ret;
 
-  TRACE("ppIpForwardTable %p, bOrder %ld, heap 0x%08lx, flags 0x%08lx\n",
-   ppIpForwardTable, (DWORD)bOrder, (DWORD)heap, flags);
+  TRACE("ppIpForwardTable %p, bOrder %ld, heap 0x%p, flags 0x%08lx\n",
+   ppIpForwardTable, (DWORD)bOrder, heap, flags);
   if (!ppIpForwardTable)
     ret = ERROR_INVALID_PARAMETER;
   else {
@@ -239,8 +239,8 @@ DWORD WINAPI 
AllocateAndGetIpNetTableFromStack(PMIB_IPNETTABLE *ppIpNetTable,
 {
   DWORD ret;
 
-  TRACE("ppIpNetTable %p, bOrder %ld, heap 0x%08lx, flags 0x%08lx\n",
-   ppIpNetTable, (DWORD)bOrder, (DWORD)heap, flags);
+  TRACE("ppIpNetTable %p, bOrder %ld, heap 0x%p, flags 0x%08lx\n",
+   ppIpNetTable, (DWORD)bOrder, heap, flags);
   if (!ppIpNetTable)
     ret = ERROR_INVALID_PARAMETER;
   else {
@@ -283,8 +283,8 @@ DWORD WINAPI AllocateAndGetTcpTableFromStack(PMIB_TCPTABLE 
*ppTcpTable,
 {
   DWORD ret;
 
-  TRACE("ppTcpTable %p, bOrder %ld, heap 0x%08lx, flags 0x%08lx\n",
-   ppTcpTable, (DWORD)bOrder, (DWORD)heap, flags);
+  TRACE("ppTcpTable %p, bOrder %ld, heap 0x%p, flags 0x%08lx\n",
+   ppTcpTable, (DWORD)bOrder, heap, flags);
   if (!ppTcpTable)
     ret = ERROR_INVALID_PARAMETER;
   else {
@@ -328,8 +328,8 @@ DWORD WINAPI AllocateAndGetTcpExTableFromStack(PVOID 
*ppTcpTable,
 {
   DWORD ret;
 
-  TRACE("ppTcpTable %p, bOrder %ld, heap 0x%08lx, flags 0x%08lx, family 
0x%08lx\n",
-   ppTcpTable, (DWORD)bOrder, (DWORD)heap, flags, family);
+  TRACE("ppTcpTable %p, bOrder %ld, heap 0x%p, flags 0x%08lx, family 
0x%08lx\n",
+   ppTcpTable, (DWORD)bOrder, heap, flags, family);
   if (!ppTcpTable)
     ret = ERROR_INVALID_PARAMETER;
   else {
@@ -374,8 +374,8 @@ DWORD WINAPI AllocateAndGetTcpExTable2FromStack(PVOID 
*ppTcpTable,
 {
   DWORD ret;
 
-  TRACE("ppTcpTable %p, bOrder %ld, heap 0x%08lx, flags 0x%08lx, family %ld, 
class %ld\n",
-   ppTcpTable, (DWORD)bOrder, (DWORD)heap, flags, family, class);
+  TRACE("ppTcpTable %p, bOrder %ld, heap 0x%p, flags 0x%08lx, family %ld, 
class %ld\n",
+   ppTcpTable, (DWORD)bOrder, heap, flags, family, class);
   if (!ppTcpTable)
     ret = ERROR_INVALID_PARAMETER;
   else {
@@ -418,8 +418,8 @@ DWORD WINAPI AllocateAndGetUdpTableFromStack(PMIB_UDPTABLE 
*ppUdpTable,
 {
   DWORD ret;
 
-  TRACE("ppUdpTable %p, bOrder %ld, heap 0x%08lx, flags 0x%08lx\n",
-   ppUdpTable, (DWORD)bOrder, (DWORD)heap, flags);
+  TRACE("ppUdpTable %p, bOrder %ld, heap 0x%p, flags 0x%08lx\n",
+   ppUdpTable, (DWORD)bOrder, heap, flags);
   if (!ppUdpTable)
     ret = ERROR_INVALID_PARAMETER;
   else {
@@ -463,8 +463,8 @@ DWORD WINAPI AllocateAndGetUdpExTableFromStack(PVOID 
*ppUdpTable,
 {
   DWORD ret;
 
-  TRACE("ppUdpTable %p, bOrder %ld, heap 0x%08lx, flags 0x%08lx, family 
0x%08lx\n",
-   ppUdpTable, (DWORD)bOrder, (DWORD)heap, flags, family);
+  TRACE("ppUdpTable %p, bOrder %ld, heap 0x%p, flags 0x%08lx, family 
0x%08lx\n",
+   ppUdpTable, (DWORD)bOrder, heap, flags, family);
   if (!ppUdpTable)
     ret = ERROR_INVALID_PARAMETER;
   else {
@@ -509,8 +509,8 @@ DWORD WINAPI AllocateAndGetUdpExTable2FromStack(PVOID 
*ppUdpTable,
 {
   DWORD ret;
 
-  TRACE("ppUdpTable %p, bOrder %ld, heap 0x%08lx, flags 0x%08lx, family %ld, 
class %ld\n",
-   ppUdpTable, (DWORD)bOrder, (DWORD)heap, flags, family, class);
+  TRACE("ppUdpTable %p, bOrder %ld, heap 0x%p, flags 0x%08lx, family %ld, 
class %ld\n",
+   ppUdpTable, (DWORD)bOrder, heap, flags, family, class);
   if (!ppUdpTable)
     ret = ERROR_INVALID_PARAMETER;
   else {
diff --git a/dll/win32/shell32/shelldesktop/dde.cpp 
b/dll/win32/shell32/shelldesktop/dde.cpp
index c4e930be8f0..a9e103c076a 100644
--- a/dll/win32/shell32/shelldesktop/dde.cpp
+++ b/dll/win32/shell32/shelldesktop/dde.cpp
@@ -106,7 +106,7 @@ static LPITEMIDLIST _ILReadFromSharedMemory(PCWSTR strField)
     if (*strField != L':')
         return NULL;
 
-    HANDLE hData = (HANDLE) StrToIntW(strField + 1);
+    HANDLE hData = UlongToHandle(StrToIntW(strField + 1));
     PWSTR strSecond = StrChrW(strField + 1, L':');
 
     if (strSecond)

Reply via email to