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);
{
DWORD ErrorCode;
- if (InterlockedCompareExchangePointer(&NtMarta,
+ if (InterlockedCompareExchangePointer((PVOID)&NtMarta,
NULL,
NULL) == NULL)
{
if (ErrorCode == ERROR_SUCCESS)
{
/* try change the NtMarta pointer */
- if (InterlockedCompareExchangePointer(&NtMarta,
+ if (InterlockedCompareExchangePointer((PVOID)&NtMarta,
&NtMartaStatic,
NULL) != NULL)
{
VOID
UnloadNtMarta(VOID)
{
- if (InterlockedExchangePointer(&NtMarta,
+ if (InterlockedExchangePointer((PVOID)&NtMarta,
NULL) != NULL)
{
FreeLibrary(NtMartaStatic.hDllInstance);
nWidth,
nHeight,
hWnd,
- (HMENU)nID,
+ ULongToHandle(nID),
hInstance,
NULL);
}
# include <resolv.h>
#endif
-#undef _WIN32_WINNT
-#define _WIN32_WINNT 0x500
#define WIN32_NO_STATUS
#include <winsock2.h>
#include <ws2tcpip.h>
RtlAllocateHeap (
HANDLE Heap,
ULONG Flags,
- ULONG Size
+ SIZE_T Size
);
NTSYSAPI
return TRUE;
}
+#undef InterlockedIncrement
+#undef InterlockedDecrement
+#undef InterlockedExchange
+#undef InterlockedExchangeAdd
+#undef InterlockedCompareExchange
+
LONG
WINAPI
InterlockedIncrement(IN OUT LONG volatile *lpAddend)
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)
{
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 */
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 */
{
RpcConnection common;
int sock;
- int cancel_fds[2];
+ SOCKET cancel_fds[2];
} RpcConnection_tcp;
static RpcConnection *rpcrt4_conn_tcp_alloc(void)
for (ai_cur = ai; ai_cur; ai_cur = ai_cur->ai_next)
{
- int val;
+ char val;
if (TRACE_ON(rpc))
{
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);
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);
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");
}
-static BOOL CALLBACK
+static INT_PTR CALLBACK
StatusMessageWindowProc(
IN HWND hwndDlg,
IN UINT uMsg,
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,
/* 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);
}
}
if (hbr <= (HBRUSH)(COLOR_MENUBAR + 1))
{
- hbr = GetSysColorBrush((int)hbr - 1);
+ hbr = GetSysColorBrush(PtrToUlong(hbr) - 1);
}
if ((prevhbr = SelectObject(hDC, hbr)) == NULL)
{
return SOCKET_ERROR;
}
- if (!ReferenceProviderByHandle((HANDLE)s, &Provider))
+ if (!ReferenceProviderByHandle((HANDLE)(ULONG_PTR)(s), &Provider))
{
WSASetLastError(WSAENOTSOCK);
return SOCKET_ERROR;