mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
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:
parent
e10113d22d
commit
720c15e46d
15 changed files with 53 additions and 23 deletions
|
@ -42,9 +42,9 @@ static VOID CloseDefaultKeys(VOID);
|
||||||
NtClose(Handle); \
|
NtClose(Handle); \
|
||||||
}
|
}
|
||||||
#define IsPredefKey(HKey) \
|
#define IsPredefKey(HKey) \
|
||||||
(((ULONG)(HKey) & 0xF0000000) == 0x80000000)
|
(((ULONG_PTR)(HKey) & 0xF0000000) == 0x80000000)
|
||||||
#define GetPredefKeyIndex(HKey) \
|
#define GetPredefKeyIndex(HKey) \
|
||||||
((ULONG)(HKey) & 0x0FFFFFFF)
|
((ULONG_PTR)(HKey) & 0x0FFFFFFF)
|
||||||
|
|
||||||
static NTSTATUS OpenClassesRootKey(PHANDLE KeyHandle);
|
static NTSTATUS OpenClassesRootKey(PHANDLE KeyHandle);
|
||||||
static NTSTATUS OpenLocalMachineKey (PHANDLE KeyHandle);
|
static NTSTATUS OpenLocalMachineKey (PHANDLE KeyHandle);
|
||||||
|
|
|
@ -289,7 +289,7 @@ CheckNtMartaPresent(VOID)
|
||||||
{
|
{
|
||||||
DWORD ErrorCode;
|
DWORD ErrorCode;
|
||||||
|
|
||||||
if (InterlockedCompareExchangePointer(&NtMarta,
|
if (InterlockedCompareExchangePointer((PVOID)&NtMarta,
|
||||||
NULL,
|
NULL,
|
||||||
NULL) == NULL)
|
NULL) == NULL)
|
||||||
{
|
{
|
||||||
|
@ -300,7 +300,7 @@ CheckNtMartaPresent(VOID)
|
||||||
if (ErrorCode == ERROR_SUCCESS)
|
if (ErrorCode == ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
/* try change the NtMarta pointer */
|
/* try change the NtMarta pointer */
|
||||||
if (InterlockedCompareExchangePointer(&NtMarta,
|
if (InterlockedCompareExchangePointer((PVOID)&NtMarta,
|
||||||
&NtMartaStatic,
|
&NtMartaStatic,
|
||||||
NULL) != NULL)
|
NULL) != NULL)
|
||||||
{
|
{
|
||||||
|
@ -329,7 +329,7 @@ CheckNtMartaPresent(VOID)
|
||||||
VOID
|
VOID
|
||||||
UnloadNtMarta(VOID)
|
UnloadNtMarta(VOID)
|
||||||
{
|
{
|
||||||
if (InterlockedExchangePointer(&NtMarta,
|
if (InterlockedExchangePointer((PVOID)&NtMarta,
|
||||||
NULL) != NULL)
|
NULL) != NULL)
|
||||||
{
|
{
|
||||||
FreeLibrary(NtMartaStatic.hDllInstance);
|
FreeLibrary(NtMartaStatic.hDllInstance);
|
||||||
|
|
|
@ -86,7 +86,7 @@ capCreateCaptureWindowW(LPCWSTR lpszWindowName,
|
||||||
nWidth,
|
nWidth,
|
||||||
nHeight,
|
nHeight,
|
||||||
hWnd,
|
hWnd,
|
||||||
(HMENU)nID,
|
ULongToHandle(nID),
|
||||||
hInstance,
|
hInstance,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,8 +19,6 @@
|
||||||
# include <resolv.h>
|
# include <resolv.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#undef _WIN32_WINNT
|
|
||||||
#define _WIN32_WINNT 0x500
|
|
||||||
#define WIN32_NO_STATUS
|
#define WIN32_NO_STATUS
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <ws2tcpip.h>
|
#include <ws2tcpip.h>
|
||||||
|
|
|
@ -58,7 +58,7 @@ NTAPI
|
||||||
RtlAllocateHeap (
|
RtlAllocateHeap (
|
||||||
HANDLE Heap,
|
HANDLE Heap,
|
||||||
ULONG Flags,
|
ULONG Flags,
|
||||||
ULONG Size
|
SIZE_T Size
|
||||||
);
|
);
|
||||||
|
|
||||||
NTSYSAPI
|
NTSYSAPI
|
||||||
|
|
|
@ -402,6 +402,12 @@ DllMain(HANDLE hDll,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef InterlockedIncrement
|
||||||
|
#undef InterlockedDecrement
|
||||||
|
#undef InterlockedExchange
|
||||||
|
#undef InterlockedExchangeAdd
|
||||||
|
#undef InterlockedCompareExchange
|
||||||
|
|
||||||
LONG
|
LONG
|
||||||
WINAPI
|
WINAPI
|
||||||
InterlockedIncrement(IN OUT LONG volatile *lpAddend)
|
InterlockedIncrement(IN OUT LONG volatile *lpAddend)
|
||||||
|
|
|
@ -400,11 +400,11 @@ TH32CreateSnapshotSectionInitialize(DWORD dwFlags,
|
||||||
|
|
||||||
ProcessListEntry->dwSize = sizeof(PROCESSENTRY32W);
|
ProcessListEntry->dwSize = sizeof(PROCESSENTRY32W);
|
||||||
ProcessListEntry->cntUsage = 0; /* no longer used */
|
ProcessListEntry->cntUsage = 0; /* no longer used */
|
||||||
ProcessListEntry->th32ProcessID = (ULONG)ProcessInfo->UniqueProcessId;
|
ProcessListEntry->th32ProcessID = (ULONG_PTR)ProcessInfo->UniqueProcessId;
|
||||||
ProcessListEntry->th32DefaultHeapID = 0; /* no longer used */
|
ProcessListEntry->th32DefaultHeapID = 0; /* no longer used */
|
||||||
ProcessListEntry->th32ModuleID = 0; /* no longer used */
|
ProcessListEntry->th32ModuleID = 0; /* no longer used */
|
||||||
ProcessListEntry->cntThreads = ProcessInfo->NumberOfThreads;
|
ProcessListEntry->cntThreads = ProcessInfo->NumberOfThreads;
|
||||||
ProcessListEntry->th32ParentProcessID = (ULONG)ProcessInfo->InheritedFromUniqueProcessId;
|
ProcessListEntry->th32ParentProcessID = (ULONG_PTR)ProcessInfo->InheritedFromUniqueProcessId;
|
||||||
ProcessListEntry->pcPriClassBase = ProcessInfo->BasePriority;
|
ProcessListEntry->pcPriClassBase = ProcessInfo->BasePriority;
|
||||||
ProcessListEntry->dwFlags = 0; /* no longer used */
|
ProcessListEntry->dwFlags = 0; /* no longer used */
|
||||||
if(ProcessInfo->ImageName.Buffer != NULL)
|
if(ProcessInfo->ImageName.Buffer != NULL)
|
||||||
|
@ -447,8 +447,8 @@ TH32CreateSnapshotSectionInitialize(DWORD dwFlags,
|
||||||
{
|
{
|
||||||
ThreadListEntry->dwSize = sizeof(THREADENTRY32);
|
ThreadListEntry->dwSize = sizeof(THREADENTRY32);
|
||||||
ThreadListEntry->cntUsage = 0; /* no longer used */
|
ThreadListEntry->cntUsage = 0; /* no longer used */
|
||||||
ThreadListEntry->th32ThreadID = (ULONG)ThreadInfo->ClientId.UniqueThread;
|
ThreadListEntry->th32ThreadID = (ULONG_PTR)ThreadInfo->ClientId.UniqueThread;
|
||||||
ThreadListEntry->th32OwnerProcessID = (ULONG)ThreadInfo->ClientId.UniqueProcess;
|
ThreadListEntry->th32OwnerProcessID = (ULONG_PTR)ThreadInfo->ClientId.UniqueProcess;
|
||||||
ThreadListEntry->tpBasePri = ThreadInfo->BasePriority;
|
ThreadListEntry->tpBasePri = ThreadInfo->BasePriority;
|
||||||
ThreadListEntry->tpDeltaPri = 0; /* no longer used */
|
ThreadListEntry->tpDeltaPri = 0; /* no longer used */
|
||||||
ThreadListEntry->dwFlags = 0; /* no longer used */
|
ThreadListEntry->dwFlags = 0; /* no longer used */
|
||||||
|
|
|
@ -55,4 +55,30 @@ InitializeCriticalSectionAndSpinCount(OUT LPCRITICAL_SECTION lpCriticalSection,
|
||||||
return TRUE;
|
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 */
|
/* EOF */
|
||||||
|
|
|
@ -762,7 +762,7 @@ typedef struct _RpcConnection_tcp
|
||||||
{
|
{
|
||||||
RpcConnection common;
|
RpcConnection common;
|
||||||
int sock;
|
int sock;
|
||||||
int cancel_fds[2];
|
SOCKET cancel_fds[2];
|
||||||
} RpcConnection_tcp;
|
} RpcConnection_tcp;
|
||||||
|
|
||||||
static RpcConnection *rpcrt4_conn_tcp_alloc(void)
|
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)
|
for (ai_cur = ai; ai_cur; ai_cur = ai_cur->ai_next)
|
||||||
{
|
{
|
||||||
int val;
|
char val;
|
||||||
|
|
||||||
if (TRACE_ON(rpc))
|
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)
|
static void rpcrt4_conn_tcp_cancel_call(RpcConnection *Connection)
|
||||||
{
|
{
|
||||||
RpcConnection_tcp *tcpc = (RpcConnection_tcp *) Connection;
|
RpcConnection_tcp *tcpc = (RpcConnection_tcp *) Connection;
|
||||||
char dummy = 1;
|
SOCKET dummy = 1;
|
||||||
|
|
||||||
TRACE("%p\n", Connection);
|
TRACE("%p\n", Connection);
|
||||||
|
|
||||||
|
@ -1271,7 +1271,7 @@ static RpcServerProtseq *rpcrt4_protseq_sock_alloc(void)
|
||||||
RpcServerProtseq_sock *ps = HeapAlloc(GetProcessHeap(), 0, sizeof(*ps));
|
RpcServerProtseq_sock *ps = HeapAlloc(GetProcessHeap(), 0, sizeof(*ps));
|
||||||
if (ps)
|
if (ps)
|
||||||
{
|
{
|
||||||
int fds[2];
|
SOCKET fds[2];
|
||||||
if (!socketpair(PF_UNIX, SOCK_DGRAM, 0, fds))
|
if (!socketpair(PF_UNIX, SOCK_DGRAM, 0, fds))
|
||||||
{
|
{
|
||||||
fcntl(fds[0], F_SETFL, O_NONBLOCK);
|
fcntl(fds[0], F_SETFL, O_NONBLOCK);
|
||||||
|
|
|
@ -214,7 +214,7 @@ static HRESULT WINAPI IAutoComplete_fnInit(
|
||||||
static const WCHAR lbName[] = {'L','i','s','t','B','o','x',0};
|
static const WCHAR lbName[] = {'L','i','s','t','B','o','x',0};
|
||||||
|
|
||||||
TRACE("(%p)->(0x%08lx, %p, %s, %s)\n",
|
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_AUTOSUGGEST) TRACE(" ACO_AUTOSUGGEST\n");
|
||||||
if (This->options & ACO_AUTOAPPEND) TRACE(" ACO_AUTOAPPEND\n");
|
if (This->options & ACO_AUTOAPPEND) TRACE(" ACO_AUTOAPPEND\n");
|
||||||
|
|
|
@ -511,7 +511,7 @@ cleanup:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static BOOL CALLBACK
|
static INT_PTR CALLBACK
|
||||||
StatusMessageWindowProc(
|
StatusMessageWindowProc(
|
||||||
IN HWND hwndDlg,
|
IN HWND hwndDlg,
|
||||||
IN UINT uMsg,
|
IN UINT uMsg,
|
||||||
|
|
|
@ -208,7 +208,7 @@ extern WDML_CONV* WDML_GetConvFromWnd(HWND hWnd);
|
||||||
extern WDML_CONV* WDML_FindConv(WDML_INSTANCE* pInstance, WDML_SIDE side,
|
extern WDML_CONV* WDML_FindConv(WDML_INSTANCE* pInstance, WDML_SIDE side,
|
||||||
HSZ hszService, HSZ hszTopic);
|
HSZ hszService, HSZ hszTopic);
|
||||||
extern BOOL WDML_PostAck(WDML_CONV* pConv, WDML_SIDE side, WORD appRetCode,
|
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,
|
extern void WDML_AddLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side,
|
||||||
UINT wType, HSZ hszItem, UINT wFmt);
|
UINT wType, HSZ hszItem, UINT wFmt);
|
||||||
extern WDML_LINK* WDML_FindLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side,
|
extern WDML_LINK* WDML_FindLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side,
|
||||||
|
|
|
@ -153,7 +153,7 @@ DesktopPtrToUser(PVOID Ptr)
|
||||||
/* NOTE: This is slow as it requires a call to win32k. This should only be
|
/* 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
|
neccessary if a thread wants to access an object on a different
|
||||||
desktop */
|
desktop */
|
||||||
return NtUserGetDesktopMapping(Ptr);
|
return (PVOID)NtUserGetDesktopMapping(Ptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1574,7 +1574,7 @@ FillRect(HDC hDC, CONST RECT *lprc, HBRUSH hbr)
|
||||||
|
|
||||||
if (hbr <= (HBRUSH)(COLOR_MENUBAR + 1))
|
if (hbr <= (HBRUSH)(COLOR_MENUBAR + 1))
|
||||||
{
|
{
|
||||||
hbr = GetSysColorBrush((int)hbr - 1);
|
hbr = GetSysColorBrush(PtrToUlong(hbr) - 1);
|
||||||
}
|
}
|
||||||
if ((prevhbr = SelectObject(hDC, hbr)) == NULL)
|
if ((prevhbr = SelectObject(hDC, hbr)) == NULL)
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,7 +30,7 @@ getpeername(IN SOCKET s,
|
||||||
return SOCKET_ERROR;
|
return SOCKET_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ReferenceProviderByHandle((HANDLE)s, &Provider))
|
if (!ReferenceProviderByHandle((HANDLE)(ULONG_PTR)(s), &Provider))
|
||||||
{
|
{
|
||||||
WSASetLastError(WSAENOTSOCK);
|
WSASetLastError(WSAENOTSOCK);
|
||||||
return SOCKET_ERROR;
|
return SOCKET_ERROR;
|
||||||
|
|
Loading…
Reference in a new issue