https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0f8439aa71c3349282eea…
commit 0f8439aa71c3349282eea09e001965744292eaaa
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Mon Apr 23 11:42:32 2018 +0200
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Sat Aug 4 19:19:34 2018 +0200
[DLLS] Fix 64 bit issues
---
dll/cpl/sysdm/hardprof.c | 2 +-
dll/directx/ksuser/ksuser.c | 4 +--
dll/directx/wine/d3dcompiler_43/utils.c | 2 +-
dll/ntdll/ldr/ldrapi.c | 2 +-
dll/ntdll/ldr/ldrinit.c | 6 ++--
dll/win32/browseui/parsecmdline.cpp | 4 +--
dll/win32/fltlib/fltlib.c | 4 +--
dll/win32/fltlib/message.c | 4 +--
dll/win32/iphlpapi/ifenum_reactos.c | 4 +--
dll/win32/kernel32/client/file/create.c | 10 +++----
dll/win32/kernel32/client/file/lfile.c | 4 +--
dll/win32/kernel32/client/thread.c | 3 +-
dll/win32/lsasrv/authpackage.c | 4 +--
dll/win32/lsasrv/session.c | 6 ++--
dll/win32/msafd/misc/dllmain.c | 49 +++++++++++++++++----------------
dll/win32/msafd/msafd.h | 13 +++++----
dll/win32/msgina/shutdown.c | 2 +-
dll/win32/mswsock/mswhelper.c | 30 ++++++++++----------
dll/win32/psapi/psapi.c | 4 +--
dll/win32/shimgvw/shimgvw.c | 2 +-
dll/win32/uxtheme/nonclient.c | 4 +--
dll/win32/wshtcpip/iflist.c | 4 +--
win32ss/gdi/gdi32/include/gdi32p.h | 2 +-
23 files changed, 88 insertions(+), 81 deletions(-)
diff --git a/dll/cpl/sysdm/hardprof.c b/dll/cpl/sysdm/hardprof.c
index 328e320b2c..4ecf955bed 100644
--- a/dll/cpl/sysdm/hardprof.c
+++ b/dll/cpl/sysdm/hardprof.c
@@ -567,7 +567,7 @@ GetProfile(
L"PreferenceOrder",
NULL,
NULL,
- (LPBYTE)pProfile->dwPreferenceOrder,
+ (LPBYTE)&pProfile->dwPreferenceOrder,
&dwSize);
if (lError == ERROR_SUCCESS)
{
diff --git a/dll/directx/ksuser/ksuser.c b/dll/directx/ksuser/ksuser.c
index 864483908f..12b54e9626 100644
--- a/dll/directx/ksuser/ksuser.c
+++ b/dll/directx/ksuser/ksuser.c
@@ -20,8 +20,8 @@ KsiCreateObjectType( HANDLE hHandle,
PHANDLE phHandle)
{
NTSTATUS Status;
- ULONG Length;
- ULONG TotalSize;
+ SIZE_T Length;
+ SIZE_T TotalSize;
LPWSTR pStr;
UNICODE_STRING ObjectName;
OBJECT_ATTRIBUTES ObjectAttributes;
diff --git a/dll/directx/wine/d3dcompiler_43/utils.c
b/dll/directx/wine/d3dcompiler_43/utils.c
index 79f3be8840..9d32677a81 100644
--- a/dll/directx/wine/d3dcompiler_43/utils.c
+++ b/dll/directx/wine/d3dcompiler_43/utils.c
@@ -557,7 +557,7 @@ HRESULT dxbc_add_section(struct dxbc *dxbc, DWORD tag, const char
*data, DWORD d
return S_OK;
}
-HRESULT dxbc_init(struct dxbc *dxbc, UINT size)
+HRESULT dxbc_init(struct dxbc *dxbc, DWORD size)
{
TRACE("dxbc %p, size %u.\n", dxbc, size);
diff --git a/dll/ntdll/ldr/ldrapi.c b/dll/ntdll/ldr/ldrapi.c
index 2f8cc68340..6e4019c600 100644
--- a/dll/ntdll/ldr/ldrapi.c
+++ b/dll/ntdll/ldr/ldrapi.c
@@ -124,7 +124,7 @@ LdrUnlockLoaderLock(IN ULONG Flags,
/* Validate the cookie */
if ((Cookie & 0xF0000000) ||
- ((Cookie >> 16) ^ ((ULONG)(NtCurrentTeb()->RealClientId.UniqueThread)
& 0xFFF)))
+ ((Cookie >> 16) ^
(HandleToUlong(NtCurrentTeb()->RealClientId.UniqueThread) & 0xFFF)))
{
DPRINT1("LdrUnlockLoaderLock() called with an invalid cookie!\n");
diff --git a/dll/ntdll/ldr/ldrinit.c b/dll/ntdll/ldr/ldrinit.c
index 902a797d15..dc0a3701cc 100644
--- a/dll/ntdll/ldr/ldrinit.c
+++ b/dll/ntdll/ldr/ldrinit.c
@@ -136,7 +136,7 @@ LdrOpenImageFileOptionsKey(IN PUNICODE_STRING SubKey,
if (NT_SUCCESS(Status))
{
/* Write the key handle */
- if (_InterlockedCompareExchange((LONG*)RootKeyLocation, (LONG)RootKey, 0) != 0)
+ if (InterlockedCompareExchangePointer(RootKeyLocation, RootKey, NULL) != NULL)
{
/* Someone already opened it, use it instead */
NtClose(RootKey);
@@ -460,8 +460,8 @@ LdrpInitSecurityCookie(PLDR_DATA_TABLE_ENTRY LdrEntry)
NtQueryPerformanceCounter(&Counter, NULL);
NewCookie = Counter.LowPart ^ Counter.HighPart;
- NewCookie ^= (ULONG)NtCurrentTeb()->ClientId.UniqueProcess;
- NewCookie ^= (ULONG)NtCurrentTeb()->ClientId.UniqueThread;
+ NewCookie ^= (ULONG_PTR)NtCurrentTeb()->ClientId.UniqueProcess;
+ NewCookie ^= (ULONG_PTR)NtCurrentTeb()->ClientId.UniqueThread;
/* Loop like it's done in KeQueryTickCount(). We don't want to call
it directly. */
while (SharedUserData->SystemTime.High1Time !=
SharedUserData->SystemTime.High2Time)
diff --git a/dll/win32/browseui/parsecmdline.cpp b/dll/win32/browseui/parsecmdline.cpp
index ad2b4fa475..855c089079 100644
--- a/dll/win32/browseui/parsecmdline.cpp
+++ b/dll/win32/browseui/parsecmdline.cpp
@@ -176,7 +176,7 @@ static LPITEMIDLIST _ILReadFromSharedMemory(PCWSTR strField)
if (*strField != L':')
return NULL;
- HANDLE hData = (HANDLE) StrToIntW(strField + 1);
+ HANDLE hData = IntToPtr(StrToIntW(strField + 1));
PWSTR strSecond = StrChrW(strField + 1, L':');
if (strSecond)
@@ -246,7 +246,7 @@ SHExplorerParseCmdLine(ExplorerCommandLineParseResults * pInfo)
PathStripToRootW(strDir);
pInfo->pidlPath = ILCreateFromPathW(strDir);
}
- return (LONG) (pInfo->pidlPath);
+ return (LONG_PTR)(pInfo->pidlPath);
}
PCWSTR strNextArg = _FindFirstField(strFieldArray);
diff --git a/dll/win32/fltlib/fltlib.c b/dll/win32/fltlib/fltlib.c
index ce99378e15..f39a106781 100644
--- a/dll/win32/fltlib/fltlib.c
+++ b/dll/win32/fltlib/fltlib.c
@@ -74,8 +74,8 @@ FilterLoadUnload(_In_z_ LPCWSTR lpFilterName,
{
PFILTER_NAME FilterName;
HANDLE hFltMgr;
- DWORD StringLength;
- DWORD BufferLength;
+ SIZE_T StringLength;
+ SIZE_T BufferLength;
DWORD dwError;
/* Get a handle to the filter manager */
diff --git a/dll/win32/fltlib/message.c b/dll/win32/fltlib/message.c
index bdbfcb3541..d05be26ea1 100644
--- a/dll/win32/fltlib/message.c
+++ b/dll/win32/fltlib/message.c
@@ -35,8 +35,8 @@ FilterConnectCommunicationPort(_In_ LPCWSTR lpPortName,
UNICODE_STRING DeviceName;
UNICODE_STRING PortName;
HANDLE FileHandle;
- ULONG PortNameSize;
- ULONG BufferSize;
+ SIZE_T PortNameSize;
+ SIZE_T BufferSize;
PCHAR Ptr;
NTSTATUS Status;
HRESULT hr;
diff --git a/dll/win32/iphlpapi/ifenum_reactos.c b/dll/win32/iphlpapi/ifenum_reactos.c
index 7557ef1f32..8bbdd63a50 100644
--- a/dll/win32/iphlpapi/ifenum_reactos.c
+++ b/dll/win32/iphlpapi/ifenum_reactos.c
@@ -62,8 +62,8 @@ NTSTATUS tdiGetMibForIfEntity
NTSTATUS status = STATUS_SUCCESS;
DWORD returnSize;
- WARN("TdiGetMibForIfEntity(tcpFile %x,entityId %x)\n",
- (int)tcpFile, (int)ent->tei_instance);
+ WARN("TdiGetMibForIfEntity(tcpFile %p,entityId %p)\n",
+ tcpFile, ent->tei_instance);
req.ID.toi_class = INFO_CLASS_PROTOCOL;
req.ID.toi_type = INFO_TYPE_PROVIDER;
diff --git a/dll/win32/kernel32/client/file/create.c
b/dll/win32/kernel32/client/file/create.c
index ec91f9a9db..cbb6583076 100644
--- a/dll/win32/kernel32/client/file/create.c
+++ b/dll/win32/kernel32/client/file/create.c
@@ -447,7 +447,7 @@ OpenFile(LPCSTR lpFileName,
default:
Sharing = FILE_SHARE_READ | FILE_SHARE_WRITE;
}
- return (HFILE) CreateFileA (lpFileName,
+ return (HFILE)(ULONG_PTR) CreateFileA (lpFileName,
GENERIC_READ | GENERIC_WRITE,
Sharing,
NULL,
@@ -476,7 +476,7 @@ OpenFile(LPCSTR lpFileName,
if (Len == 0 || Len > OFS_MAXPATHNAME)
{
lpReOpenBuff->nErrCode = (WORD)GetLastError();
- return (HFILE)INVALID_HANDLE_VALUE;
+ return HFILE_ERROR;
}
if (uStyle & OF_DELETE)
@@ -507,7 +507,7 @@ OpenFile(LPCSTR lpFileName,
NULL,
NULL))
{
- return (HFILE)INVALID_HANDLE_VALUE;
+ return HFILE_ERROR;
}
// FILE_SHARE_READ
@@ -534,7 +534,7 @@ OpenFile(LPCSTR lpFileName,
if (!NT_SUCCESS(errCode))
{
BaseSetLastNTError (errCode);
- return (HFILE)INVALID_HANDLE_VALUE;
+ return HFILE_ERROR;
}
if (uStyle & OF_EXIST)
@@ -543,7 +543,7 @@ OpenFile(LPCSTR lpFileName,
return (HFILE)1;
}
- return (HFILE)FileHandle;
+ return (HFILE)(ULONG_PTR)FileHandle;
}
/*
diff --git a/dll/win32/kernel32/client/file/lfile.c
b/dll/win32/kernel32/client/file/lfile.c
index 5f907f070f..6f40555678 100644
--- a/dll/win32/kernel32/client/file/lfile.c
+++ b/dll/win32/kernel32/client/file/lfile.c
@@ -44,7 +44,7 @@ _hwrite(HFILE hFile, LPCSTR lpBuffer, long lBytes)
if (lBytes == 0)
{
- if (!SetEndOfFile((HANDLE) hFile))
+ if (!SetEndOfFile((HANDLE)(ULONG_PTR) hFile))
{
return HFILE_ERROR;
}
@@ -98,7 +98,7 @@ _lopen(LPCSTR lpPathName, int iReadWrite)
default: dwSharing = FILE_SHARE_READ | FILE_SHARE_WRITE; break;
}
- return (HFILE) CreateFileA(lpPathName,
+ return (HFILE)(ULONG_PTR) CreateFileA(lpPathName,
dwAccess,
dwSharing,
NULL,
diff --git a/dll/win32/kernel32/client/thread.c b/dll/win32/kernel32/client/thread.c
index a7963e272f..8fc5a7ad61 100644
--- a/dll/win32/kernel32/client/thread.c
+++ b/dll/win32/kernel32/client/thread.c
@@ -176,6 +176,7 @@ CreateRemoteThread(IN HANDLE hProcess,
ACTIVATION_CONTEXT_BASIC_INFORMATION ActCtxInfo;
ULONG_PTR Cookie;
ULONG ReturnLength;
+ SIZE_T ReturnSize;
DPRINT("CreateRemoteThread: hProcess: %p dwStackSize: %lu lpStartAddress"
": %p lpParameter: %p, dwCreationFlags: %lx\n", hProcess,
dwStackSize, lpStartAddress, lpParameter, dwCreationFlags);
@@ -267,7 +268,7 @@ CreateRemoteThread(IN HANDLE hProcess,
ActivationContextBasicInformation,
&ActCtxInfo,
sizeof(ActCtxInfo),
- &ReturnLength);
+ &ReturnSize);
if (!NT_SUCCESS(Status))
{
/* Fail */
diff --git a/dll/win32/lsasrv/authpackage.c b/dll/win32/lsasrv/authpackage.c
index 22e668c600..7405e0904e 100644
--- a/dll/win32/lsasrv/authpackage.c
+++ b/dll/win32/lsasrv/authpackage.c
@@ -386,7 +386,7 @@ LsapAllocateClientBuffer(IN PLSA_CLIENT_REQUEST ClientRequest,
OUT PVOID *ClientBaseAddress)
{
PLSAP_LOGON_CONTEXT LogonContext;
- ULONG Length;
+ SIZE_T Length;
*ClientBaseAddress = NULL;
@@ -409,7 +409,7 @@ LsapFreeClientBuffer(IN PLSA_CLIENT_REQUEST ClientRequest,
IN PVOID ClientBaseAddress)
{
PLSAP_LOGON_CONTEXT LogonContext;
- ULONG Length;
+ SIZE_T Length;
if (ClientBaseAddress == NULL)
return STATUS_SUCCESS;
diff --git a/dll/win32/lsasrv/session.c b/dll/win32/lsasrv/session.c
index a290e3428f..2cc37bdc51 100644
--- a/dll/win32/lsasrv/session.c
+++ b/dll/win32/lsasrv/session.c
@@ -258,7 +258,8 @@ LsapEnumLogonSessions(IN OUT PLSA_API_MSG RequestMsg)
PLIST_ENTRY SessionEntry;
PLSAP_LOGON_SESSION CurrentSession;
PLUID SessionList;
- ULONG i, Length, MemSize;
+ ULONG i, Length;
+ SIZE_T MemSize;
PVOID ClientBaseAddress = NULL;
NTSTATUS Status;
@@ -353,7 +354,8 @@ LsapGetLogonSessionData(IN OUT PLSA_API_MSG RequestMsg)
PLSAP_LOGON_SESSION Session;
PSECURITY_LOGON_SESSION_DATA LocalSessionData;
PVOID ClientBaseAddress = NULL;
- ULONG TotalLength, MemSize, SidLength = 0;
+ ULONG TotalLength, SidLength = 0;
+ SIZE_T MemSize;
PUCHAR Ptr;
NTSTATUS Status;
diff --git a/dll/win32/msafd/misc/dllmain.c b/dll/win32/msafd/misc/dllmain.c
index f6e04ae5fc..5ec1bc151a 100644
--- a/dll/win32/msafd/misc/dllmain.c
+++ b/dll/win32/msafd/misc/dllmain.c
@@ -75,17 +75,17 @@ WSPSocket(int AddressFamily,
if (lpProtocolInfo && lpProtocolInfo->dwServiceFlags3 != 0 &&
lpProtocolInfo->dwServiceFlags4 != 0)
{
/* Duplpicating socket from different process */
- if ((HANDLE)lpProtocolInfo->dwServiceFlags3 == INVALID_HANDLE_VALUE)
+ if (UlongToPtr(lpProtocolInfo->dwServiceFlags3) == INVALID_HANDLE_VALUE)
{
Status = WSAEINVAL;
goto error;
}
- if ((HANDLE)lpProtocolInfo->dwServiceFlags4 == INVALID_HANDLE_VALUE)
+ if (UlongToPtr(lpProtocolInfo->dwServiceFlags4) == INVALID_HANDLE_VALUE)
{
Status = WSAEINVAL;
goto error;
}
- SharedData = MapViewOfFile((HANDLE)lpProtocolInfo->dwServiceFlags3,
+ SharedData = MapViewOfFile(UlongToPtr(lpProtocolInfo->dwServiceFlags3),
FILE_MAP_ALL_ACCESS,
0,
0,
@@ -183,8 +183,8 @@ WSPSocket(int AddressFamily,
if (SharedData)
{
Socket->SharedData = SharedData;
- Socket->SharedDataHandle = (HANDLE)lpProtocolInfo->dwServiceFlags3;
- Sock = (HANDLE)lpProtocolInfo->dwServiceFlags4;
+ Socket->SharedDataHandle = UlongToHandle(lpProtocolInfo->dwServiceFlags3);
+ Sock = UlongToHandle(lpProtocolInfo->dwServiceFlags4);
Socket->Handle = (SOCKET)lpProtocolInfo->dwServiceFlags4;
}
else
@@ -422,7 +422,7 @@ error:
if( SharedData )
{
UnmapViewOfFile(SharedData);
- NtClose((HANDLE)lpProtocolInfo->dwServiceFlags3);
+ NtClose(UlongToHandle(lpProtocolInfo->dwServiceFlags3));
}
else
{
@@ -523,8 +523,8 @@ WSPDuplicateSocket(
lpProtocolInfo->iAddressFamily = Socket->SharedData->AddressFamily;
lpProtocolInfo->iProtocol = Socket->SharedData->Protocol;
lpProtocolInfo->iSocketType = Socket->SharedData->SocketType;
- lpProtocolInfo->dwServiceFlags3 = (DWORD)hDuplicatedSharedData;
- lpProtocolInfo->dwServiceFlags4 = (DWORD)hDuplicatedHandle;
+ lpProtocolInfo->dwServiceFlags3 = HandleToUlong(hDuplicatedSharedData);
+ lpProtocolInfo->dwServiceFlags4 = HandleToUlong(hDuplicatedHandle);
if( lpErrno )
*lpErrno = NO_ERROR;
@@ -903,7 +903,7 @@ WSPBind(SOCKET Handle,
/* Set up Address in TDI Format */
BindData->Address.TAAddressCount = 1;
- BindData->Address.Address[0].AddressLength = SocketAddressLength -
sizeof(SocketAddress->sa_family);
+ BindData->Address.Address[0].AddressLength = (USHORT)(SocketAddressLength -
sizeof(SocketAddress->sa_family));
BindData->Address.Address[0].AddressType = SocketAddress->sa_family;
RtlCopyMemory (BindData->Address.Address[0].Address,
SocketAddress->sa_data,
@@ -1427,14 +1427,16 @@ GetCurrentTimeInSeconds(VOID)
return (DWORD)((Time.ll - u1970.ll) / 10000000ULL);
}
+_Must_inspect_result_
SOCKET
WSPAPI
-WSPAccept(SOCKET Handle,
- struct sockaddr *SocketAddress,
- int *SocketAddressLength,
- LPCONDITIONPROC lpfnCondition,
- DWORD dwCallbackData,
- LPINT lpErrno)
+WSPAccept(
+ _In_ SOCKET Handle,
+ _Out_writes_bytes_to_opt_(*addrlen, *addrlen) struct sockaddr FAR *SocketAddress,
+ _Inout_opt_ LPINT SocketAddressLength,
+ _In_opt_ LPCONDITIONPROC lpfnCondition,
+ _In_opt_ DWORD_PTR dwCallbackData,
+ _Out_ LPINT lpErrno)
{
IO_STATUS_BLOCK IOSB;
PAFD_RECEIVED_ACCEPT_DATA ListenReceiveData;
@@ -2885,14 +2887,15 @@ SendToHelper:
* RETURNS:
* Status of operation
*/
-INT
+_Must_inspect_result_
+int
WSPAPI
-WSPStartup(IN WORD wVersionRequested,
- OUT LPWSPDATA lpWSPData,
- IN LPWSAPROTOCOL_INFOW lpProtocolInfo,
- IN WSPUPCALLTABLE UpcallTable,
- OUT LPWSPPROC_TABLE lpProcTable)
-
+WSPStartup(
+ _In_ WORD wVersionRequested,
+ _In_ LPWSPDATA lpWSPData,
+ _In_ LPWSAPROTOCOL_INFOW lpProtocolInfo,
+ _In_ WSPUPCALLTABLE UpcallTable,
+ _Out_ LPWSPPROC_TABLE lpProcTable)
{
NTSTATUS Status;
@@ -2959,7 +2962,7 @@ WSPAddressToString(IN LPSOCKADDR lpsaAddress,
IN OUT LPDWORD lpdwAddressStringLength,
OUT LPINT lpErrno)
{
- DWORD size;
+ SIZE_T size;
WCHAR buffer[54]; /* 32 digits + 7':' + '[' + '%" + 5 digits
+ ']:' + 5 digits + '\0' */
WCHAR *p;
diff --git a/dll/win32/msafd/msafd.h b/dll/win32/msafd/msafd.h
index 3765c2fca7..07ed1657fc 100644
--- a/dll/win32/msafd/msafd.h
+++ b/dll/win32/msafd/msafd.h
@@ -140,15 +140,16 @@ typedef struct _AFDAPCCONTEXT
PSOCKET_INFORMATION lpSocket;
} AFDAPCCONTEXT, *PAFDAPCCONTEXT;
+_Must_inspect_result_
SOCKET
WSPAPI
WSPAccept(
- IN SOCKET s,
- OUT LPSOCKADDR addr,
- IN OUT LPINT addrlen,
- IN LPCONDITIONPROC lpfnCondition,
- IN DWORD dwCallbackData,
- OUT LPINT lpErrno);
+ _In_ SOCKET s,
+ _Out_writes_bytes_to_opt_(*addrlen, *addrlen) struct sockaddr FAR * addr,
+ _Inout_opt_ LPINT addrlen,
+ _In_opt_ LPCONDITIONPROC lpfnCondition,
+ _In_opt_ DWORD_PTR dwCallbackData,
+ _Out_ LPINT lpErrno);
INT
WSPAPI
diff --git a/dll/win32/msgina/shutdown.c b/dll/win32/msgina/shutdown.c
index 01e397cbce..658e21c7f5 100644
--- a/dll/win32/msgina/shutdown.c
+++ b/dll/win32/msgina/shutdown.c
@@ -398,7 +398,7 @@ ShutdownOnOk(
}
}
-static BOOL
+static INT_PTR
CALLBACK
ShutdownDialogProc(
HWND hDlg,
diff --git a/dll/win32/mswsock/mswhelper.c b/dll/win32/mswsock/mswhelper.c
index 1a08ccd22b..52265324d3 100644
--- a/dll/win32/mswsock/mswhelper.c
+++ b/dll/win32/mswsock/mswhelper.c
@@ -108,7 +108,7 @@ mswBufferAppendLst(_Inout_ PMSW_BUFFER mswBuf,
{
DWORD lstItemCount;
DWORD lstByteSize;
- DWORD lstDataPos;
+ DWORD_PTR lstDataPos;
DWORD i1;
UINT_PTR *ptrSrcLstPos;
@@ -129,7 +129,7 @@ mswBufferAppendLst(_Inout_ PMSW_BUFFER mswBuf,
/* calculate position for the data of the first item */
lstDataPos = ((lstItemCount + 1) * sizeof(UINT_PTR)) +
- (DWORD)mswBufferEndPtr(mswBuf);
+ (DWORD_PTR)mswBufferEndPtr(mswBuf);
/* add ptrofs */
lstDataPos += ptrofs;
@@ -164,7 +164,7 @@ mswBufferAppendStrLstA(_Inout_ PMSW_BUFFER mswBuf,
DWORD lstItemLen[MAX_ARRAY_SIZE];
DWORD lstItemCount;
DWORD lstByteSize;
- DWORD lstDataPos;
+ DWORD_PTR lstDataPos;
DWORD lstDataSize;
DWORD i1;
UINT_PTR *ptrSrcLstPos;
@@ -194,7 +194,7 @@ mswBufferAppendStrLstA(_Inout_ PMSW_BUFFER mswBuf,
/* calculate position for the data of the first item */
lstDataPos = ((lstItemCount + 1) * sizeof(UINT_PTR)) +
- (DWORD)mswBufferEndPtr(mswBuf);
+ (DWORD_PTR)mswBufferEndPtr(mswBuf);
/* add ptrofs */
lstDataPos += ptrofs;
@@ -261,7 +261,7 @@ mswBufferAppendBlob_Hostent(_Inout_ PMSW_BUFFER mswBuf,
{
if (!mswBufferAppendStrLstA(mswBuf,
(void**)hostAliasesA,
- -(DWORD)bytesOfs))
+ -(LONG_PTR)bytesOfs))
return FALSE;
}
else
@@ -277,7 +277,7 @@ mswBufferAppendBlob_Hostent(_Inout_ PMSW_BUFFER mswBuf,
phe->h_addr_list = (char**)(mswBufferEndPtr(mswBuf) - bytesOfs);
- if (!mswBufferAppendLst(mswBuf, lst, 4, -(DWORD)bytesOfs))
+ if (!mswBufferAppendLst(mswBuf, lst, 4, -(LONG_PTR)bytesOfs))
return FALSE;
/* name */
@@ -323,7 +323,7 @@ mswBufferAppendBlob_Servent(_Inout_ PMSW_BUFFER mswBuf,
{
if (!mswBufferAppendStrLstA(mswBuf,
(void**)serviceAliasesA,
- -(DWORD)bytesOfs))
+ -(LONG_PTR)bytesOfs))
return FALSE;
}
else
@@ -484,8 +484,8 @@ WCHAR*
StrCpyHeapAllocW(_In_opt_ HANDLE hHeap,
_In_ WCHAR* wStr)
{
- int chLen;
- int bLen;
+ size_t chLen;
+ size_t bLen;
WCHAR* resW;
if (wStr == NULL)
@@ -507,8 +507,8 @@ char*
StrCpyHeapAllocA(_In_opt_ HANDLE hHeap,
_In_ char* aStr)
{
- int chLen;
- int bLen;
+ size_t chLen;
+ size_t bLen;
char* resA;
if (aStr == NULL)
@@ -534,8 +534,8 @@ StrAryCpyHeapAllocA(_In_opt_ HANDLE hHeap,
char** aDstPtr;
char* aDstNextStr;
DWORD aStrByteLen[MAX_ARRAY_SIZE];
- int bLen;
- int bItmLen;
+ size_t bLen;
+ size_t bItmLen;
int aCount;
int i1;
char** resA;
@@ -581,7 +581,7 @@ StrAryCpyHeapAllocA(_In_opt_ HANDLE hHeap,
*aDstPtr = aDstNextStr;
RtlCopyMemory(*aDstPtr, *aSrcPtr, bItmLen);
- aDstNextStr = (char*)((DWORD)aDstNextStr + (DWORD)bItmLen);
+ aDstNextStr = (char*)((DWORD_PTR)aDstNextStr + (DWORD)bItmLen);
aDstPtr++;
aSrcPtr++;
}
@@ -671,7 +671,7 @@ StrAryCpyHeapAllocWToA(_In_opt_ HANDLE hHeap,
RtlCopyMemory(*aDstPtr, aStr, bItmLen);
HeapFree(hHeap, 0, aStr);
- aDstNextStr = (char*)((DWORD)aDstNextStr + (DWORD)bItmLen);
+ aDstNextStr = (char*)((DWORD_PTR)aDstNextStr + (DWORD)bItmLen);
aDstPtr++;
wSrcPtr++;
}
diff --git a/dll/win32/psapi/psapi.c b/dll/win32/psapi/psapi.c
index 1c82f505ed..6eae8375f7 100644
--- a/dll/win32/psapi/psapi.c
+++ b/dll/win32/psapi/psapi.c
@@ -506,7 +506,7 @@ EnumProcesses(DWORD *lpidProcess,
*/
if (Count < cb / sizeof(DWORD))
{
- lpidProcess[Count] = (DWORD)ProcInfo->UniqueProcessId;
+ lpidProcess[Count] = HandleToUlong(ProcInfo->UniqueProcessId);
Count++;
}
@@ -840,7 +840,7 @@ GetMappedFileNameW(HANDLE hProcess,
DWORD nSize)
{
DWORD Len;
- DWORD OutSize;
+ SIZE_T OutSize;
NTSTATUS Status;
struct
{
diff --git a/dll/win32/shimgvw/shimgvw.c b/dll/win32/shimgvw/shimgvw.c
index 4177ac2d68..8339b66b16 100644
--- a/dll/win32/shimgvw/shimgvw.c
+++ b/dll/win32/shimgvw/shimgvw.c
@@ -188,7 +188,7 @@ static void pSaveImageAs(HWND hwnd)
GUID rawFormat;
UINT num;
UINT size;
- UINT sizeRemain;
+ size_t sizeRemain;
UINT j;
WCHAR *c;
diff --git a/dll/win32/uxtheme/nonclient.c b/dll/win32/uxtheme/nonclient.c
index b777d02e41..4171e09264 100644
--- a/dll/win32/uxtheme/nonclient.c
+++ b/dll/win32/uxtheme/nonclient.c
@@ -68,10 +68,10 @@ UserGetWindowIcon(PDRAW_CONTEXT pcontext)
SendMessageTimeout(pcontext->hWnd, WM_GETICON, ICON_BIG, 0, SMTO_ABORTIFHUNG,
1000, (PDWORD_PTR)&hIcon);
if (!hIcon)
- hIcon = (HICON)GetClassLong(pcontext->hWnd, GCL_HICONSM);
+ hIcon = (HICON)GetClassLongPtr(pcontext->hWnd, GCLP_HICONSM);
if (!hIcon)
- hIcon = (HICON)GetClassLong(pcontext->hWnd, GCL_HICON);
+ hIcon = (HICON)GetClassLongPtr(pcontext->hWnd, GCLP_HICON);
// See also win32ss/user/ntuser/nonclient.c!NC_IconForWindow
if (!hIcon && !(pcontext->wi.dwExStyle & WS_EX_DLGMODALFRAME))
diff --git a/dll/win32/wshtcpip/iflist.c b/dll/win32/wshtcpip/iflist.c
index a3fe651f2c..d6d68ced2b 100644
--- a/dll/win32/wshtcpip/iflist.c
+++ b/dll/win32/wshtcpip/iflist.c
@@ -95,7 +95,7 @@ BOOL AllocAndGetEntityArray(
*idCount = (outBufLenNeeded / sizeof(TDIEntityID));
*ppEntities = (TDIEntityID*)outBuf;
- DPRINT("TcpFile %lx\n", (DWORD)TcpFile);
+ DPRINT("TcpFile %p\n", TcpFile);
DPRINT("idCount %lx\n", *idCount);// 0x24;
@@ -247,7 +247,7 @@ WSHIoctl_GetInterfaceList(
goto cleanup;
}
- DPRINT("TcpFile %lx\n",(DWORD)TcpFile);
+ DPRINT("TcpFile %p\n", TcpFile);
if (!AllocAndGetEntityArray(TcpFile,hHeap,&outEntityID,&outIDCount))
{
diff --git a/win32ss/gdi/gdi32/include/gdi32p.h b/win32ss/gdi/gdi32/include/gdi32p.h
index ace5d574a2..c78f993d22 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_PTR Sig; // Init with PDEV_UMPD_ID
+ DWORD_PTR Sig; // Init with PDEV_UMPD_ID
struct _UMPDEV *pumpdNext;
PDRIVER_INFO_5W pdi5Info;
HMODULE hModule;