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

commit f5f6ea2965e26cb28aa0743b93ce1ec43c827774
Author:     Timo Kreuzer <[email protected]>
AuthorDate: Sun Jan 6 23:14:09 2019 +0100
Commit:     Timo Kreuzer <[email protected]>
CommitDate: Mon Mar 4 21:58:42 2019 +0100

    [REACTOS] Fix 64 bit issues
---
 dll/win32/advapi32/service/sctrl.c  | 6 +++---
 dll/win32/windowscodecs/typeof.h    | 6 ++++--
 drivers/network/tcpip/tcpip/ninfo.c | 4 ++--
 sdk/include/psdk/imagehlp.h         | 6 ++++++
 sdk/lib/atl/atlbase.h               | 2 +-
 5 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/dll/win32/advapi32/service/sctrl.c 
b/dll/win32/advapi32/service/sctrl.c
index ec5a4cc4bf..68ec2a6ac6 100644
--- a/dll/win32/advapi32/service/sctrl.c
+++ b/dll/win32/advapi32/service/sctrl.c
@@ -174,7 +174,7 @@ ScServiceMainStubA(LPVOID Context)
 
     /* Set service tag */
     Teb = NtCurrentTeb();
-    Teb->SubProcessTag = (PVOID)ThreadParams->dwServiceTag;
+    Teb->SubProcessTag = UlongToPtr(ThreadParams->dwServiceTag);
 
     /* Call the main service routine and free the arguments vector */
     (ThreadParams->lpServiceMain)(ThreadParams->dwArgCount,
@@ -203,7 +203,7 @@ ScServiceMainStubW(LPVOID Context)
 
     /* Set service tag */
     Teb = NtCurrentTeb();
-    Teb->SubProcessTag = (PVOID)ThreadParams->dwServiceTag;
+    Teb->SubProcessTag = UlongToPtr(ThreadParams->dwServiceTag);
 
     /* Call the main service routine and free the arguments vector */
     (ThreadParams->lpServiceMain)(ThreadParams->dwArgCount,
@@ -552,7 +552,7 @@ ScControlService(PACTIVE_SERVICE lpService,
     TRACE("Service: %S\n", (PWSTR)((ULONG_PTR)ControlPacket + 
ControlPacket->dwServiceNameOffset));
 
     /* Set service tag */
-    NtCurrentTeb()->SubProcessTag = (PVOID)lpService->dwServiceTag;
+    NtCurrentTeb()->SubProcessTag = UlongToPtr(lpService->dwServiceTag);
 
     if (lpService->HandlerFunction)
     {
diff --git a/dll/win32/windowscodecs/typeof.h b/dll/win32/windowscodecs/typeof.h
index 12e6b8bcc4..b20434b7cc 100644
--- a/dll/win32/windowscodecs/typeof.h
+++ b/dll/win32/windowscodecs/typeof.h
@@ -1,9 +1,11 @@
 #define typeof(X_) __typeof_ ## X_
 
 #ifdef _WIN64
+#define __typeof_uintptr unsigned long long
 #define __typeof_intptr long long
 #define __typeof_longptr long long
 #else
+#define __typeof_uintptr unsigned int
 #define __typeof_intptr int
 #define __typeof_longptr long
 #endif
@@ -38,7 +40,7 @@ typedef void (__cdecl typeof(jpeg_set_defaults))(struct 
jpeg_compress_struct *);
 typedef unsigned int (__cdecl typeof(jpeg_write_scanlines))(struct 
jpeg_compress_struct *, char **, unsigned int);
 
 typedef void (*png_error_ptr_1)(struct png_struct_def *, const char *);
-typedef void (*png_rw_ptr_1)(struct png_struct_def *, unsigned char *, 
unsigned int);
+typedef void (*png_rw_ptr_1)(struct png_struct_def *, unsigned char *, 
__typeof_uintptr);
 typedef void (*png_flush_ptr_1)(struct png_struct_def *);
 typedef struct png_info_def* (__cdecl typeof(png_create_info_struct))(struct 
png_struct_def *);
 typedef struct png_struct_def * (__cdecl typeof(png_create_read_struct))(const 
char *, void *, png_error_ptr_1, png_error_ptr_1);
@@ -80,7 +82,7 @@ typedef void (__cdecl typeof(png_set_PLTE))(struct 
png_struct_def *, struct png_
 typedef void (__cdecl typeof(png_set_tRNS))(struct png_struct_def *, struct 
png_info_def *, const unsigned char *, int, const struct png_color_16_struct *);
 typedef void (__cdecl typeof(png_set_filter))(struct png_struct_def *, int, 
int);
 typedef void *thandle_t_1;
-typedef int (*TIFFReadWriteProc_1)(thandle_t_1, void *, __typeof_intptr);
+typedef __typeof_intptr (*TIFFReadWriteProc_1)(thandle_t_1, void *, 
__typeof_intptr);
 typedef unsigned int (*TIFFSeekProc_1)(void *, unsigned int, int);
 typedef int (*TIFFCloseProc_1)(thandle_t_1);
 typedef unsigned int (*TIFFSizeProc_1)(thandle_t_1);
diff --git a/drivers/network/tcpip/tcpip/ninfo.c 
b/drivers/network/tcpip/tcpip/ninfo.c
index 5c0952b033..30a59480a2 100644
--- a/drivers/network/tcpip/tcpip/ninfo.c
+++ b/drivers/network/tcpip/tcpip/ninfo.c
@@ -203,7 +203,7 @@ TDI_STATUS InfoTdiQueryGetConnectionTcpTable(PADDRESS_FILE 
AddrFile,
         Size = sizeof(MIB_TCPROW);
     }
 
-    TcpRow.dwOwningPid = (DWORD)AddrFile->ProcessId;
+    TcpRow.dwOwningPid = HandleToUlong(AddrFile->ProcessId);
     TcpRow.liCreateTimestamp = AddrFile->CreationTime;
 
     if (AddrFile->Listener != NULL)
@@ -290,7 +290,7 @@ TDI_STATUS InfoTdiQueryGetConnectionUdpTable(PADDRESS_FILE 
AddrFile,
 
     UdpRow.dwLocalAddr = AddrFile->Address.Address.IPv4Address;
     UdpRow.dwLocalPort = AddrFile->Port;
-    UdpRow.dwOwningPid = (DWORD)AddrFile->ProcessId;
+    UdpRow.dwOwningPid = HandleToUlong(AddrFile->ProcessId);
     UdpRow.liCreateTimestamp = AddrFile->CreationTime;
     UdpRow.dwFlags = 0; /* FIXME */
     if (Class == TcpUdpClassOwner)
diff --git a/sdk/include/psdk/imagehlp.h b/sdk/include/psdk/imagehlp.h
index bed6492d6b..99227b2435 100644
--- a/sdk/include/psdk/imagehlp.h
+++ b/sdk/include/psdk/imagehlp.h
@@ -18,6 +18,12 @@
 #ifndef _IMAGEHLP_H
 #define _IMAGEHLP_H
 
+#ifdef _WIN64
+#ifndef _IMAGEHLP64
+#define _IMAGEHLP64
+#endif
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/sdk/lib/atl/atlbase.h b/sdk/lib/atl/atlbase.h
index d327aadf4d..598abc3f3d 100644
--- a/sdk/lib/atl/atlbase.h
+++ b/sdk/lib/atl/atlbase.h
@@ -1231,7 +1231,7 @@ public:
 
     LONG SetStringValue(LPCTSTR pszValueName, LPCTSTR pszValue, DWORD dwType = 
REG_SZ) throw()
     {
-        ULONG length;
+        SIZE_T length;
         switch (dwType)
         {
         case REG_SZ:

Reply via email to