Merge from amd64-branch:

36898 (sserapion)
- Fix 64bit advapi32 build.

35655 (sserapion)
Misc WIN64 fixes.
Implement InitializeCriticalSectionEx

43836 (sserapion)
Fix avicap32 build.

44510 (tkreuzer)
[IPHLPAPI]
Don't redefine _WIN32_WINNT to 0x500. When using the NDK we need at least 0x503 when compiling for 64 bit (XP64 is 502)

39335 (tkreuzer)
[IPHLPAPI]
Fix prototype of RtlAllocateHeap

38092 (sserapion)
[RPCRT4]
Fix 64bit-warnings.

44499 (sserapion)
[SYSSETUP]
Eliminate warning.

38100 (sserapion)
[ADVAPI32]
ULONG -> ULONG_PTR

svn path=/trunk/; revision=46418
This commit is contained in:
Timo Kreuzer 2010-03-25 01:06:20 +00:00
parent e10113d22d
commit 720c15e46d
15 changed files with 53 additions and 23 deletions

View file

@ -42,9 +42,9 @@ static VOID CloseDefaultKeys(VOID);
NtClose(Handle); \
}
#define IsPredefKey(HKey) \
(((ULONG)(HKey) & 0xF0000000) == 0x80000000)
(((ULONG_PTR)(HKey) & 0xF0000000) == 0x80000000)
#define GetPredefKeyIndex(HKey) \
((ULONG)(HKey) & 0x0FFFFFFF)
((ULONG_PTR)(HKey) & 0x0FFFFFFF)
static NTSTATUS OpenClassesRootKey(PHANDLE KeyHandle);
static NTSTATUS OpenLocalMachineKey (PHANDLE KeyHandle);

View file

@ -289,7 +289,7 @@ CheckNtMartaPresent(VOID)
{
DWORD ErrorCode;
if (InterlockedCompareExchangePointer(&NtMarta,
if (InterlockedCompareExchangePointer((PVOID)&NtMarta,
NULL,
NULL) == NULL)
{
@ -300,7 +300,7 @@ CheckNtMartaPresent(VOID)
if (ErrorCode == ERROR_SUCCESS)
{
/* try change the NtMarta pointer */
if (InterlockedCompareExchangePointer(&NtMarta,
if (InterlockedCompareExchangePointer((PVOID)&NtMarta,
&NtMartaStatic,
NULL) != NULL)
{
@ -329,7 +329,7 @@ CheckNtMartaPresent(VOID)
VOID
UnloadNtMarta(VOID)
{
if (InterlockedExchangePointer(&NtMarta,
if (InterlockedExchangePointer((PVOID)&NtMarta,
NULL) != NULL)
{
FreeLibrary(NtMartaStatic.hDllInstance);

View file

@ -86,7 +86,7 @@ capCreateCaptureWindowW(LPCWSTR lpszWindowName,
nWidth,
nHeight,
hWnd,
(HMENU)nID,
ULongToHandle(nID),
hInstance,
NULL);
}

View file

@ -19,8 +19,6 @@
# include <resolv.h>
#endif
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x500
#define WIN32_NO_STATUS
#include <winsock2.h>
#include <ws2tcpip.h>

View file

@ -58,7 +58,7 @@ NTAPI
RtlAllocateHeap (
HANDLE Heap,
ULONG Flags,
ULONG Size
SIZE_T Size
);
NTSYSAPI

View file

@ -402,6 +402,12 @@ DllMain(HANDLE hDll,
return TRUE;
}
#undef InterlockedIncrement
#undef InterlockedDecrement
#undef InterlockedExchange
#undef InterlockedExchangeAdd
#undef InterlockedCompareExchange
LONG
WINAPI
InterlockedIncrement(IN OUT LONG volatile *lpAddend)

View file

@ -400,11 +400,11 @@ TH32CreateSnapshotSectionInitialize(DWORD dwFlags,
ProcessListEntry->dwSize = sizeof(PROCESSENTRY32W);
ProcessListEntry->cntUsage = 0; /* no longer used */
ProcessListEntry->th32ProcessID = (ULONG)ProcessInfo->UniqueProcessId;
ProcessListEntry->th32ProcessID = (ULONG_PTR)ProcessInfo->UniqueProcessId;
ProcessListEntry->th32DefaultHeapID = 0; /* no longer used */
ProcessListEntry->th32ModuleID = 0; /* no longer used */
ProcessListEntry->cntThreads = ProcessInfo->NumberOfThreads;
ProcessListEntry->th32ParentProcessID = (ULONG)ProcessInfo->InheritedFromUniqueProcessId;
ProcessListEntry->th32ParentProcessID = (ULONG_PTR)ProcessInfo->InheritedFromUniqueProcessId;
ProcessListEntry->pcPriClassBase = ProcessInfo->BasePriority;
ProcessListEntry->dwFlags = 0; /* no longer used */
if(ProcessInfo->ImageName.Buffer != NULL)
@ -447,8 +447,8 @@ TH32CreateSnapshotSectionInitialize(DWORD dwFlags,
{
ThreadListEntry->dwSize = sizeof(THREADENTRY32);
ThreadListEntry->cntUsage = 0; /* no longer used */
ThreadListEntry->th32ThreadID = (ULONG)ThreadInfo->ClientId.UniqueThread;
ThreadListEntry->th32OwnerProcessID = (ULONG)ThreadInfo->ClientId.UniqueProcess;
ThreadListEntry->th32ThreadID = (ULONG_PTR)ThreadInfo->ClientId.UniqueThread;
ThreadListEntry->th32OwnerProcessID = (ULONG_PTR)ThreadInfo->ClientId.UniqueProcess;
ThreadListEntry->tpBasePri = ThreadInfo->BasePriority;
ThreadListEntry->tpDeltaPri = 0; /* no longer used */
ThreadListEntry->dwFlags = 0; /* no longer used */

View file

@ -55,4 +55,30 @@ InitializeCriticalSectionAndSpinCount(OUT LPCRITICAL_SECTION lpCriticalSection,
return TRUE;
}
/*
* @implemented
*/
BOOL WINAPI InitializeCriticalSectionEx(OUT LPCRITICAL_SECTION lpCriticalSection,
IN DWORD dwSpinCount,
IN DWORD flags )
{
NTSTATUS Status;
/* FIXME: Flags ignored */
/* Initialize the critical section */
Status = RtlInitializeCriticalSectionAndSpinCount(
(PRTL_CRITICAL_SECTION)lpCriticalSection,
dwSpinCount);
if (!NT_SUCCESS(Status))
{
/* Set failure code */
SetLastErrorByStatus(Status);
return FALSE;
}
/* Success */
return TRUE;
}
/* EOF */

View file

@ -762,7 +762,7 @@ typedef struct _RpcConnection_tcp
{
RpcConnection common;
int sock;
int cancel_fds[2];
SOCKET cancel_fds[2];
} RpcConnection_tcp;
static RpcConnection *rpcrt4_conn_tcp_alloc(void)
@ -814,7 +814,7 @@ static RPC_STATUS rpcrt4_ncacn_ip_tcp_open(RpcConnection* Connection)
for (ai_cur = ai; ai_cur; ai_cur = ai_cur->ai_next)
{
int val;
char val;
if (TRACE_ON(rpc))
{
@ -1091,7 +1091,7 @@ static int rpcrt4_conn_tcp_close(RpcConnection *Connection)
static void rpcrt4_conn_tcp_cancel_call(RpcConnection *Connection)
{
RpcConnection_tcp *tcpc = (RpcConnection_tcp *) Connection;
char dummy = 1;
SOCKET dummy = 1;
TRACE("%p\n", Connection);
@ -1271,7 +1271,7 @@ static RpcServerProtseq *rpcrt4_protseq_sock_alloc(void)
RpcServerProtseq_sock *ps = HeapAlloc(GetProcessHeap(), 0, sizeof(*ps));
if (ps)
{
int fds[2];
SOCKET fds[2];
if (!socketpair(PF_UNIX, SOCK_DGRAM, 0, fds))
{
fcntl(fds[0], F_SETFL, O_NONBLOCK);

View file

@ -214,7 +214,7 @@ static HRESULT WINAPI IAutoComplete_fnInit(
static const WCHAR lbName[] = {'L','i','s','t','B','o','x',0};
TRACE("(%p)->(0x%08lx, %p, %s, %s)\n",
This, (long)hwndEdit, punkACL, debugstr_w(pwzsRegKeyPath), debugstr_w(pwszQuickComplete));
This, hwndEdit, punkACL, debugstr_w(pwzsRegKeyPath), debugstr_w(pwszQuickComplete));
if (This->options & ACO_AUTOSUGGEST) TRACE(" ACO_AUTOSUGGEST\n");
if (This->options & ACO_AUTOAPPEND) TRACE(" ACO_AUTOAPPEND\n");

View file

@ -511,7 +511,7 @@ cleanup:
}
static BOOL CALLBACK
static INT_PTR CALLBACK
StatusMessageWindowProc(
IN HWND hwndDlg,
IN UINT uMsg,

View file

@ -208,7 +208,7 @@ extern WDML_CONV* WDML_GetConvFromWnd(HWND hWnd);
extern WDML_CONV* WDML_FindConv(WDML_INSTANCE* pInstance, WDML_SIDE side,
HSZ hszService, HSZ hszTopic);
extern BOOL WDML_PostAck(WDML_CONV* pConv, WDML_SIDE side, WORD appRetCode,
BOOL fBusy, BOOL fAck, UINT pmt, LPARAM lParam, UINT oldMsg);
BOOL fBusy, BOOL fAck, UINT_PTR pmt, LPARAM lParam, UINT oldMsg);
extern void WDML_AddLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side,
UINT wType, HSZ hszItem, UINT wFmt);
extern WDML_LINK* WDML_FindLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side,

View file

@ -153,7 +153,7 @@ DesktopPtrToUser(PVOID Ptr)
/* NOTE: This is slow as it requires a call to win32k. This should only be
neccessary if a thread wants to access an object on a different
desktop */
return NtUserGetDesktopMapping(Ptr);
return (PVOID)NtUserGetDesktopMapping(Ptr);
}
}

View file

@ -1574,7 +1574,7 @@ FillRect(HDC hDC, CONST RECT *lprc, HBRUSH hbr)
if (hbr <= (HBRUSH)(COLOR_MENUBAR + 1))
{
hbr = GetSysColorBrush((int)hbr - 1);
hbr = GetSysColorBrush(PtrToUlong(hbr) - 1);
}
if ((prevhbr = SelectObject(hDC, hbr)) == NULL)
{

View file

@ -30,7 +30,7 @@ getpeername(IN SOCKET s,
return SOCKET_ERROR;
}
if (!ReferenceProviderByHandle((HANDLE)s, &Provider))
if (!ReferenceProviderByHandle((HANDLE)(ULONG_PTR)(s), &Provider))
{
WSASetLastError(WSAENOTSOCK);
return SOCKET_ERROR;