[DLLS] Fix 64 bit issues

This commit is contained in:
Timo Kreuzer 2018-04-23 11:42:32 +02:00
parent 6f13066647
commit 0f8439aa71
23 changed files with 88 additions and 81 deletions

View file

@ -567,7 +567,7 @@ GetProfile(
L"PreferenceOrder", L"PreferenceOrder",
NULL, NULL,
NULL, NULL,
(LPBYTE)pProfile->dwPreferenceOrder, (LPBYTE)&pProfile->dwPreferenceOrder,
&dwSize); &dwSize);
if (lError == ERROR_SUCCESS) if (lError == ERROR_SUCCESS)
{ {

View file

@ -20,8 +20,8 @@ KsiCreateObjectType( HANDLE hHandle,
PHANDLE phHandle) PHANDLE phHandle)
{ {
NTSTATUS Status; NTSTATUS Status;
ULONG Length; SIZE_T Length;
ULONG TotalSize; SIZE_T TotalSize;
LPWSTR pStr; LPWSTR pStr;
UNICODE_STRING ObjectName; UNICODE_STRING ObjectName;
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;

View file

@ -557,7 +557,7 @@ HRESULT dxbc_add_section(struct dxbc *dxbc, DWORD tag, const char *data, DWORD d
return S_OK; 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); TRACE("dxbc %p, size %u.\n", dxbc, size);

View file

@ -124,7 +124,7 @@ LdrUnlockLoaderLock(IN ULONG Flags,
/* Validate the cookie */ /* Validate the cookie */
if ((Cookie & 0xF0000000) || 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"); DPRINT1("LdrUnlockLoaderLock() called with an invalid cookie!\n");

View file

@ -136,7 +136,7 @@ LdrOpenImageFileOptionsKey(IN PUNICODE_STRING SubKey,
if (NT_SUCCESS(Status)) if (NT_SUCCESS(Status))
{ {
/* Write the key handle */ /* 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 */ /* Someone already opened it, use it instead */
NtClose(RootKey); NtClose(RootKey);
@ -460,8 +460,8 @@ LdrpInitSecurityCookie(PLDR_DATA_TABLE_ENTRY LdrEntry)
NtQueryPerformanceCounter(&Counter, NULL); NtQueryPerformanceCounter(&Counter, NULL);
NewCookie = Counter.LowPart ^ Counter.HighPart; NewCookie = Counter.LowPart ^ Counter.HighPart;
NewCookie ^= (ULONG)NtCurrentTeb()->ClientId.UniqueProcess; NewCookie ^= (ULONG_PTR)NtCurrentTeb()->ClientId.UniqueProcess;
NewCookie ^= (ULONG)NtCurrentTeb()->ClientId.UniqueThread; NewCookie ^= (ULONG_PTR)NtCurrentTeb()->ClientId.UniqueThread;
/* Loop like it's done in KeQueryTickCount(). We don't want to call it directly. */ /* Loop like it's done in KeQueryTickCount(). We don't want to call it directly. */
while (SharedUserData->SystemTime.High1Time != SharedUserData->SystemTime.High2Time) while (SharedUserData->SystemTime.High1Time != SharedUserData->SystemTime.High2Time)

View file

@ -176,7 +176,7 @@ static LPITEMIDLIST _ILReadFromSharedMemory(PCWSTR strField)
if (*strField != L':') if (*strField != L':')
return NULL; return NULL;
HANDLE hData = (HANDLE) StrToIntW(strField + 1); HANDLE hData = IntToPtr(StrToIntW(strField + 1));
PWSTR strSecond = StrChrW(strField + 1, L':'); PWSTR strSecond = StrChrW(strField + 1, L':');
if (strSecond) if (strSecond)
@ -246,7 +246,7 @@ SHExplorerParseCmdLine(ExplorerCommandLineParseResults * pInfo)
PathStripToRootW(strDir); PathStripToRootW(strDir);
pInfo->pidlPath = ILCreateFromPathW(strDir); pInfo->pidlPath = ILCreateFromPathW(strDir);
} }
return (LONG) (pInfo->pidlPath); return (LONG_PTR)(pInfo->pidlPath);
} }
PCWSTR strNextArg = _FindFirstField(strFieldArray); PCWSTR strNextArg = _FindFirstField(strFieldArray);

View file

@ -74,8 +74,8 @@ FilterLoadUnload(_In_z_ LPCWSTR lpFilterName,
{ {
PFILTER_NAME FilterName; PFILTER_NAME FilterName;
HANDLE hFltMgr; HANDLE hFltMgr;
DWORD StringLength; SIZE_T StringLength;
DWORD BufferLength; SIZE_T BufferLength;
DWORD dwError; DWORD dwError;
/* Get a handle to the filter manager */ /* Get a handle to the filter manager */

View file

@ -35,8 +35,8 @@ FilterConnectCommunicationPort(_In_ LPCWSTR lpPortName,
UNICODE_STRING DeviceName; UNICODE_STRING DeviceName;
UNICODE_STRING PortName; UNICODE_STRING PortName;
HANDLE FileHandle; HANDLE FileHandle;
ULONG PortNameSize; SIZE_T PortNameSize;
ULONG BufferSize; SIZE_T BufferSize;
PCHAR Ptr; PCHAR Ptr;
NTSTATUS Status; NTSTATUS Status;
HRESULT hr; HRESULT hr;

View file

@ -62,8 +62,8 @@ NTSTATUS tdiGetMibForIfEntity
NTSTATUS status = STATUS_SUCCESS; NTSTATUS status = STATUS_SUCCESS;
DWORD returnSize; DWORD returnSize;
WARN("TdiGetMibForIfEntity(tcpFile %x,entityId %x)\n", WARN("TdiGetMibForIfEntity(tcpFile %p,entityId %p)\n",
(int)tcpFile, (int)ent->tei_instance); tcpFile, ent->tei_instance);
req.ID.toi_class = INFO_CLASS_PROTOCOL; req.ID.toi_class = INFO_CLASS_PROTOCOL;
req.ID.toi_type = INFO_TYPE_PROVIDER; req.ID.toi_type = INFO_TYPE_PROVIDER;

View file

@ -447,7 +447,7 @@ OpenFile(LPCSTR lpFileName,
default: default:
Sharing = FILE_SHARE_READ | FILE_SHARE_WRITE; Sharing = FILE_SHARE_READ | FILE_SHARE_WRITE;
} }
return (HFILE) CreateFileA (lpFileName, return (HFILE)(ULONG_PTR) CreateFileA (lpFileName,
GENERIC_READ | GENERIC_WRITE, GENERIC_READ | GENERIC_WRITE,
Sharing, Sharing,
NULL, NULL,
@ -476,7 +476,7 @@ OpenFile(LPCSTR lpFileName,
if (Len == 0 || Len > OFS_MAXPATHNAME) if (Len == 0 || Len > OFS_MAXPATHNAME)
{ {
lpReOpenBuff->nErrCode = (WORD)GetLastError(); lpReOpenBuff->nErrCode = (WORD)GetLastError();
return (HFILE)INVALID_HANDLE_VALUE; return HFILE_ERROR;
} }
if (uStyle & OF_DELETE) if (uStyle & OF_DELETE)
@ -507,7 +507,7 @@ OpenFile(LPCSTR lpFileName,
NULL, NULL,
NULL)) NULL))
{ {
return (HFILE)INVALID_HANDLE_VALUE; return HFILE_ERROR;
} }
// FILE_SHARE_READ // FILE_SHARE_READ
@ -534,7 +534,7 @@ OpenFile(LPCSTR lpFileName,
if (!NT_SUCCESS(errCode)) if (!NT_SUCCESS(errCode))
{ {
BaseSetLastNTError (errCode); BaseSetLastNTError (errCode);
return (HFILE)INVALID_HANDLE_VALUE; return HFILE_ERROR;
} }
if (uStyle & OF_EXIST) if (uStyle & OF_EXIST)
@ -543,7 +543,7 @@ OpenFile(LPCSTR lpFileName,
return (HFILE)1; return (HFILE)1;
} }
return (HFILE)FileHandle; return (HFILE)(ULONG_PTR)FileHandle;
} }
/* /*

View file

@ -44,7 +44,7 @@ _hwrite(HFILE hFile, LPCSTR lpBuffer, long lBytes)
if (lBytes == 0) if (lBytes == 0)
{ {
if (!SetEndOfFile((HANDLE) hFile)) if (!SetEndOfFile((HANDLE)(ULONG_PTR) hFile))
{ {
return HFILE_ERROR; return HFILE_ERROR;
} }
@ -98,7 +98,7 @@ _lopen(LPCSTR lpPathName, int iReadWrite)
default: dwSharing = FILE_SHARE_READ | FILE_SHARE_WRITE; break; default: dwSharing = FILE_SHARE_READ | FILE_SHARE_WRITE; break;
} }
return (HFILE) CreateFileA(lpPathName, return (HFILE)(ULONG_PTR) CreateFileA(lpPathName,
dwAccess, dwAccess,
dwSharing, dwSharing,
NULL, NULL,

View file

@ -176,6 +176,7 @@ CreateRemoteThread(IN HANDLE hProcess,
ACTIVATION_CONTEXT_BASIC_INFORMATION ActCtxInfo; ACTIVATION_CONTEXT_BASIC_INFORMATION ActCtxInfo;
ULONG_PTR Cookie; ULONG_PTR Cookie;
ULONG ReturnLength; ULONG ReturnLength;
SIZE_T ReturnSize;
DPRINT("CreateRemoteThread: hProcess: %p dwStackSize: %lu lpStartAddress" DPRINT("CreateRemoteThread: hProcess: %p dwStackSize: %lu lpStartAddress"
": %p lpParameter: %p, dwCreationFlags: %lx\n", hProcess, ": %p lpParameter: %p, dwCreationFlags: %lx\n", hProcess,
dwStackSize, lpStartAddress, lpParameter, dwCreationFlags); dwStackSize, lpStartAddress, lpParameter, dwCreationFlags);
@ -267,7 +268,7 @@ CreateRemoteThread(IN HANDLE hProcess,
ActivationContextBasicInformation, ActivationContextBasicInformation,
&ActCtxInfo, &ActCtxInfo,
sizeof(ActCtxInfo), sizeof(ActCtxInfo),
&ReturnLength); &ReturnSize);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
/* Fail */ /* Fail */

View file

@ -386,7 +386,7 @@ LsapAllocateClientBuffer(IN PLSA_CLIENT_REQUEST ClientRequest,
OUT PVOID *ClientBaseAddress) OUT PVOID *ClientBaseAddress)
{ {
PLSAP_LOGON_CONTEXT LogonContext; PLSAP_LOGON_CONTEXT LogonContext;
ULONG Length; SIZE_T Length;
*ClientBaseAddress = NULL; *ClientBaseAddress = NULL;
@ -409,7 +409,7 @@ LsapFreeClientBuffer(IN PLSA_CLIENT_REQUEST ClientRequest,
IN PVOID ClientBaseAddress) IN PVOID ClientBaseAddress)
{ {
PLSAP_LOGON_CONTEXT LogonContext; PLSAP_LOGON_CONTEXT LogonContext;
ULONG Length; SIZE_T Length;
if (ClientBaseAddress == NULL) if (ClientBaseAddress == NULL)
return STATUS_SUCCESS; return STATUS_SUCCESS;

View file

@ -258,7 +258,8 @@ LsapEnumLogonSessions(IN OUT PLSA_API_MSG RequestMsg)
PLIST_ENTRY SessionEntry; PLIST_ENTRY SessionEntry;
PLSAP_LOGON_SESSION CurrentSession; PLSAP_LOGON_SESSION CurrentSession;
PLUID SessionList; PLUID SessionList;
ULONG i, Length, MemSize; ULONG i, Length;
SIZE_T MemSize;
PVOID ClientBaseAddress = NULL; PVOID ClientBaseAddress = NULL;
NTSTATUS Status; NTSTATUS Status;
@ -353,7 +354,8 @@ LsapGetLogonSessionData(IN OUT PLSA_API_MSG RequestMsg)
PLSAP_LOGON_SESSION Session; PLSAP_LOGON_SESSION Session;
PSECURITY_LOGON_SESSION_DATA LocalSessionData; PSECURITY_LOGON_SESSION_DATA LocalSessionData;
PVOID ClientBaseAddress = NULL; PVOID ClientBaseAddress = NULL;
ULONG TotalLength, MemSize, SidLength = 0; ULONG TotalLength, SidLength = 0;
SIZE_T MemSize;
PUCHAR Ptr; PUCHAR Ptr;
NTSTATUS Status; NTSTATUS Status;

View file

@ -75,17 +75,17 @@ WSPSocket(int AddressFamily,
if (lpProtocolInfo && lpProtocolInfo->dwServiceFlags3 != 0 && lpProtocolInfo->dwServiceFlags4 != 0) if (lpProtocolInfo && lpProtocolInfo->dwServiceFlags3 != 0 && lpProtocolInfo->dwServiceFlags4 != 0)
{ {
/* Duplpicating socket from different process */ /* Duplpicating socket from different process */
if ((HANDLE)lpProtocolInfo->dwServiceFlags3 == INVALID_HANDLE_VALUE) if (UlongToPtr(lpProtocolInfo->dwServiceFlags3) == INVALID_HANDLE_VALUE)
{ {
Status = WSAEINVAL; Status = WSAEINVAL;
goto error; goto error;
} }
if ((HANDLE)lpProtocolInfo->dwServiceFlags4 == INVALID_HANDLE_VALUE) if (UlongToPtr(lpProtocolInfo->dwServiceFlags4) == INVALID_HANDLE_VALUE)
{ {
Status = WSAEINVAL; Status = WSAEINVAL;
goto error; goto error;
} }
SharedData = MapViewOfFile((HANDLE)lpProtocolInfo->dwServiceFlags3, SharedData = MapViewOfFile(UlongToPtr(lpProtocolInfo->dwServiceFlags3),
FILE_MAP_ALL_ACCESS, FILE_MAP_ALL_ACCESS,
0, 0,
0, 0,
@ -183,8 +183,8 @@ WSPSocket(int AddressFamily,
if (SharedData) if (SharedData)
{ {
Socket->SharedData = SharedData; Socket->SharedData = SharedData;
Socket->SharedDataHandle = (HANDLE)lpProtocolInfo->dwServiceFlags3; Socket->SharedDataHandle = UlongToHandle(lpProtocolInfo->dwServiceFlags3);
Sock = (HANDLE)lpProtocolInfo->dwServiceFlags4; Sock = UlongToHandle(lpProtocolInfo->dwServiceFlags4);
Socket->Handle = (SOCKET)lpProtocolInfo->dwServiceFlags4; Socket->Handle = (SOCKET)lpProtocolInfo->dwServiceFlags4;
} }
else else
@ -422,7 +422,7 @@ error:
if( SharedData ) if( SharedData )
{ {
UnmapViewOfFile(SharedData); UnmapViewOfFile(SharedData);
NtClose((HANDLE)lpProtocolInfo->dwServiceFlags3); NtClose(UlongToHandle(lpProtocolInfo->dwServiceFlags3));
} }
else else
{ {
@ -523,8 +523,8 @@ WSPDuplicateSocket(
lpProtocolInfo->iAddressFamily = Socket->SharedData->AddressFamily; lpProtocolInfo->iAddressFamily = Socket->SharedData->AddressFamily;
lpProtocolInfo->iProtocol = Socket->SharedData->Protocol; lpProtocolInfo->iProtocol = Socket->SharedData->Protocol;
lpProtocolInfo->iSocketType = Socket->SharedData->SocketType; lpProtocolInfo->iSocketType = Socket->SharedData->SocketType;
lpProtocolInfo->dwServiceFlags3 = (DWORD)hDuplicatedSharedData; lpProtocolInfo->dwServiceFlags3 = HandleToUlong(hDuplicatedSharedData);
lpProtocolInfo->dwServiceFlags4 = (DWORD)hDuplicatedHandle; lpProtocolInfo->dwServiceFlags4 = HandleToUlong(hDuplicatedHandle);
if( lpErrno ) if( lpErrno )
*lpErrno = NO_ERROR; *lpErrno = NO_ERROR;
@ -903,7 +903,7 @@ WSPBind(SOCKET Handle,
/* Set up Address in TDI Format */ /* Set up Address in TDI Format */
BindData->Address.TAAddressCount = 1; 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; BindData->Address.Address[0].AddressType = SocketAddress->sa_family;
RtlCopyMemory (BindData->Address.Address[0].Address, RtlCopyMemory (BindData->Address.Address[0].Address,
SocketAddress->sa_data, SocketAddress->sa_data,
@ -1427,14 +1427,16 @@ GetCurrentTimeInSeconds(VOID)
return (DWORD)((Time.ll - u1970.ll) / 10000000ULL); return (DWORD)((Time.ll - u1970.ll) / 10000000ULL);
} }
_Must_inspect_result_
SOCKET SOCKET
WSPAPI WSPAPI
WSPAccept(SOCKET Handle, WSPAccept(
struct sockaddr *SocketAddress, _In_ SOCKET Handle,
int *SocketAddressLength, _Out_writes_bytes_to_opt_(*addrlen, *addrlen) struct sockaddr FAR *SocketAddress,
LPCONDITIONPROC lpfnCondition, _Inout_opt_ LPINT SocketAddressLength,
DWORD dwCallbackData, _In_opt_ LPCONDITIONPROC lpfnCondition,
LPINT lpErrno) _In_opt_ DWORD_PTR dwCallbackData,
_Out_ LPINT lpErrno)
{ {
IO_STATUS_BLOCK IOSB; IO_STATUS_BLOCK IOSB;
PAFD_RECEIVED_ACCEPT_DATA ListenReceiveData; PAFD_RECEIVED_ACCEPT_DATA ListenReceiveData;
@ -2885,14 +2887,15 @@ SendToHelper:
* RETURNS: * RETURNS:
* Status of operation * Status of operation
*/ */
INT _Must_inspect_result_
int
WSPAPI WSPAPI
WSPStartup(IN WORD wVersionRequested, WSPStartup(
OUT LPWSPDATA lpWSPData, _In_ WORD wVersionRequested,
IN LPWSAPROTOCOL_INFOW lpProtocolInfo, _In_ LPWSPDATA lpWSPData,
IN WSPUPCALLTABLE UpcallTable, _In_ LPWSAPROTOCOL_INFOW lpProtocolInfo,
OUT LPWSPPROC_TABLE lpProcTable) _In_ WSPUPCALLTABLE UpcallTable,
_Out_ LPWSPPROC_TABLE lpProcTable)
{ {
NTSTATUS Status; NTSTATUS Status;
@ -2959,7 +2962,7 @@ WSPAddressToString(IN LPSOCKADDR lpsaAddress,
IN OUT LPDWORD lpdwAddressStringLength, IN OUT LPDWORD lpdwAddressStringLength,
OUT LPINT lpErrno) OUT LPINT lpErrno)
{ {
DWORD size; SIZE_T size;
WCHAR buffer[54]; /* 32 digits + 7':' + '[' + '%" + 5 digits + ']:' + 5 digits + '\0' */ WCHAR buffer[54]; /* 32 digits + 7':' + '[' + '%" + 5 digits + ']:' + 5 digits + '\0' */
WCHAR *p; WCHAR *p;

View file

@ -140,15 +140,16 @@ typedef struct _AFDAPCCONTEXT
PSOCKET_INFORMATION lpSocket; PSOCKET_INFORMATION lpSocket;
} AFDAPCCONTEXT, *PAFDAPCCONTEXT; } AFDAPCCONTEXT, *PAFDAPCCONTEXT;
_Must_inspect_result_
SOCKET SOCKET
WSPAPI WSPAPI
WSPAccept( WSPAccept(
IN SOCKET s, _In_ SOCKET s,
OUT LPSOCKADDR addr, _Out_writes_bytes_to_opt_(*addrlen, *addrlen) struct sockaddr FAR * addr,
IN OUT LPINT addrlen, _Inout_opt_ LPINT addrlen,
IN LPCONDITIONPROC lpfnCondition, _In_opt_ LPCONDITIONPROC lpfnCondition,
IN DWORD dwCallbackData, _In_opt_ DWORD_PTR dwCallbackData,
OUT LPINT lpErrno); _Out_ LPINT lpErrno);
INT INT
WSPAPI WSPAPI

View file

@ -398,7 +398,7 @@ ShutdownOnOk(
} }
} }
static BOOL static INT_PTR
CALLBACK CALLBACK
ShutdownDialogProc( ShutdownDialogProc(
HWND hDlg, HWND hDlg,

View file

@ -108,7 +108,7 @@ mswBufferAppendLst(_Inout_ PMSW_BUFFER mswBuf,
{ {
DWORD lstItemCount; DWORD lstItemCount;
DWORD lstByteSize; DWORD lstByteSize;
DWORD lstDataPos; DWORD_PTR lstDataPos;
DWORD i1; DWORD i1;
UINT_PTR *ptrSrcLstPos; UINT_PTR *ptrSrcLstPos;
@ -129,7 +129,7 @@ mswBufferAppendLst(_Inout_ PMSW_BUFFER mswBuf,
/* calculate position for the data of the first item */ /* calculate position for the data of the first item */
lstDataPos = ((lstItemCount + 1) * sizeof(UINT_PTR)) + lstDataPos = ((lstItemCount + 1) * sizeof(UINT_PTR)) +
(DWORD)mswBufferEndPtr(mswBuf); (DWORD_PTR)mswBufferEndPtr(mswBuf);
/* add ptrofs */ /* add ptrofs */
lstDataPos += ptrofs; lstDataPos += ptrofs;
@ -164,7 +164,7 @@ mswBufferAppendStrLstA(_Inout_ PMSW_BUFFER mswBuf,
DWORD lstItemLen[MAX_ARRAY_SIZE]; DWORD lstItemLen[MAX_ARRAY_SIZE];
DWORD lstItemCount; DWORD lstItemCount;
DWORD lstByteSize; DWORD lstByteSize;
DWORD lstDataPos; DWORD_PTR lstDataPos;
DWORD lstDataSize; DWORD lstDataSize;
DWORD i1; DWORD i1;
UINT_PTR *ptrSrcLstPos; UINT_PTR *ptrSrcLstPos;
@ -194,7 +194,7 @@ mswBufferAppendStrLstA(_Inout_ PMSW_BUFFER mswBuf,
/* calculate position for the data of the first item */ /* calculate position for the data of the first item */
lstDataPos = ((lstItemCount + 1) * sizeof(UINT_PTR)) + lstDataPos = ((lstItemCount + 1) * sizeof(UINT_PTR)) +
(DWORD)mswBufferEndPtr(mswBuf); (DWORD_PTR)mswBufferEndPtr(mswBuf);
/* add ptrofs */ /* add ptrofs */
lstDataPos += ptrofs; lstDataPos += ptrofs;
@ -261,7 +261,7 @@ mswBufferAppendBlob_Hostent(_Inout_ PMSW_BUFFER mswBuf,
{ {
if (!mswBufferAppendStrLstA(mswBuf, if (!mswBufferAppendStrLstA(mswBuf,
(void**)hostAliasesA, (void**)hostAliasesA,
-(DWORD)bytesOfs)) -(LONG_PTR)bytesOfs))
return FALSE; return FALSE;
} }
else else
@ -277,7 +277,7 @@ mswBufferAppendBlob_Hostent(_Inout_ PMSW_BUFFER mswBuf,
phe->h_addr_list = (char**)(mswBufferEndPtr(mswBuf) - bytesOfs); 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; return FALSE;
/* name */ /* name */
@ -323,7 +323,7 @@ mswBufferAppendBlob_Servent(_Inout_ PMSW_BUFFER mswBuf,
{ {
if (!mswBufferAppendStrLstA(mswBuf, if (!mswBufferAppendStrLstA(mswBuf,
(void**)serviceAliasesA, (void**)serviceAliasesA,
-(DWORD)bytesOfs)) -(LONG_PTR)bytesOfs))
return FALSE; return FALSE;
} }
else else
@ -484,8 +484,8 @@ WCHAR*
StrCpyHeapAllocW(_In_opt_ HANDLE hHeap, StrCpyHeapAllocW(_In_opt_ HANDLE hHeap,
_In_ WCHAR* wStr) _In_ WCHAR* wStr)
{ {
int chLen; size_t chLen;
int bLen; size_t bLen;
WCHAR* resW; WCHAR* resW;
if (wStr == NULL) if (wStr == NULL)
@ -507,8 +507,8 @@ char*
StrCpyHeapAllocA(_In_opt_ HANDLE hHeap, StrCpyHeapAllocA(_In_opt_ HANDLE hHeap,
_In_ char* aStr) _In_ char* aStr)
{ {
int chLen; size_t chLen;
int bLen; size_t bLen;
char* resA; char* resA;
if (aStr == NULL) if (aStr == NULL)
@ -534,8 +534,8 @@ StrAryCpyHeapAllocA(_In_opt_ HANDLE hHeap,
char** aDstPtr; char** aDstPtr;
char* aDstNextStr; char* aDstNextStr;
DWORD aStrByteLen[MAX_ARRAY_SIZE]; DWORD aStrByteLen[MAX_ARRAY_SIZE];
int bLen; size_t bLen;
int bItmLen; size_t bItmLen;
int aCount; int aCount;
int i1; int i1;
char** resA; char** resA;
@ -581,7 +581,7 @@ StrAryCpyHeapAllocA(_In_opt_ HANDLE hHeap,
*aDstPtr = aDstNextStr; *aDstPtr = aDstNextStr;
RtlCopyMemory(*aDstPtr, *aSrcPtr, bItmLen); RtlCopyMemory(*aDstPtr, *aSrcPtr, bItmLen);
aDstNextStr = (char*)((DWORD)aDstNextStr + (DWORD)bItmLen); aDstNextStr = (char*)((DWORD_PTR)aDstNextStr + (DWORD)bItmLen);
aDstPtr++; aDstPtr++;
aSrcPtr++; aSrcPtr++;
} }
@ -671,7 +671,7 @@ StrAryCpyHeapAllocWToA(_In_opt_ HANDLE hHeap,
RtlCopyMemory(*aDstPtr, aStr, bItmLen); RtlCopyMemory(*aDstPtr, aStr, bItmLen);
HeapFree(hHeap, 0, aStr); HeapFree(hHeap, 0, aStr);
aDstNextStr = (char*)((DWORD)aDstNextStr + (DWORD)bItmLen); aDstNextStr = (char*)((DWORD_PTR)aDstNextStr + (DWORD)bItmLen);
aDstPtr++; aDstPtr++;
wSrcPtr++; wSrcPtr++;
} }

View file

@ -506,7 +506,7 @@ EnumProcesses(DWORD *lpidProcess,
*/ */
if (Count < cb / sizeof(DWORD)) if (Count < cb / sizeof(DWORD))
{ {
lpidProcess[Count] = (DWORD)ProcInfo->UniqueProcessId; lpidProcess[Count] = HandleToUlong(ProcInfo->UniqueProcessId);
Count++; Count++;
} }
@ -840,7 +840,7 @@ GetMappedFileNameW(HANDLE hProcess,
DWORD nSize) DWORD nSize)
{ {
DWORD Len; DWORD Len;
DWORD OutSize; SIZE_T OutSize;
NTSTATUS Status; NTSTATUS Status;
struct struct
{ {

View file

@ -188,7 +188,7 @@ static void pSaveImageAs(HWND hwnd)
GUID rawFormat; GUID rawFormat;
UINT num; UINT num;
UINT size; UINT size;
UINT sizeRemain; size_t sizeRemain;
UINT j; UINT j;
WCHAR *c; WCHAR *c;

View file

@ -68,10 +68,10 @@ UserGetWindowIcon(PDRAW_CONTEXT pcontext)
SendMessageTimeout(pcontext->hWnd, WM_GETICON, ICON_BIG, 0, SMTO_ABORTIFHUNG, 1000, (PDWORD_PTR)&hIcon); SendMessageTimeout(pcontext->hWnd, WM_GETICON, ICON_BIG, 0, SMTO_ABORTIFHUNG, 1000, (PDWORD_PTR)&hIcon);
if (!hIcon) if (!hIcon)
hIcon = (HICON)GetClassLong(pcontext->hWnd, GCL_HICONSM); hIcon = (HICON)GetClassLongPtr(pcontext->hWnd, GCLP_HICONSM);
if (!hIcon) 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 // See also win32ss/user/ntuser/nonclient.c!NC_IconForWindow
if (!hIcon && !(pcontext->wi.dwExStyle & WS_EX_DLGMODALFRAME)) if (!hIcon && !(pcontext->wi.dwExStyle & WS_EX_DLGMODALFRAME))

View file

@ -95,7 +95,7 @@ BOOL AllocAndGetEntityArray(
*idCount = (outBufLenNeeded / sizeof(TDIEntityID)); *idCount = (outBufLenNeeded / sizeof(TDIEntityID));
*ppEntities = (TDIEntityID*)outBuf; *ppEntities = (TDIEntityID*)outBuf;
DPRINT("TcpFile %lx\n", (DWORD)TcpFile); DPRINT("TcpFile %p\n", TcpFile);
DPRINT("idCount %lx\n", *idCount);// 0x24; DPRINT("idCount %lx\n", *idCount);// 0x24;
@ -247,7 +247,7 @@ WSHIoctl_GetInterfaceList(
goto cleanup; goto cleanup;
} }
DPRINT("TcpFile %lx\n",(DWORD)TcpFile); DPRINT("TcpFile %p\n", TcpFile);
if (!AllocAndGetEntityArray(TcpFile,hHeap,&outEntityID,&outIDCount)) if (!AllocAndGetEntityArray(TcpFile,hHeap,&outEntityID,&outIDCount))
{ {

View file

@ -136,7 +136,7 @@ typedef struct tagENHMETAFILE
#define UMPDEV_SUPPORT_ESCAPE 0x0004 #define UMPDEV_SUPPORT_ESCAPE 0x0004
typedef struct _UMPDEV typedef struct _UMPDEV
{ {
DWORD_PTR Sig; // Init with PDEV_UMPD_ID DWORD_PTR Sig; // Init with PDEV_UMPD_ID
struct _UMPDEV *pumpdNext; struct _UMPDEV *pumpdNext;
PDRIVER_INFO_5W pdi5Info; PDRIVER_INFO_5W pdi5Info;
HMODULE hModule; HMODULE hModule;