Merge 34714, 34716, 34718, 34720 from ros-amd64-bringup branch:

recyclebin: DWORD -> SIZE_T and SIZE_T -> DWORD
rtl:
- cast AtomName to ULONG_PTR instead of ULONG
- RtlQueryProcessdebugInformation(): cast teb->ClientId.UniqueProcess to ULONG_PTR for assignment to Pid.
- vs(w)nprintf: cast argument to ULONG_PTR instead of unsigned long for a %p
crt:
- int -> intptr_t
- unsigned long -> uintptr_t
- #undef _MINGW_IMPORT in ctype.c, to avoid warnings
scrnsafe: rename _toul to _toulptr and make it return an ULONG_PTR

svn path=/trunk/; revision=35712
This commit is contained in:
Timo Kreuzer 2008-08-27 20:27:32 +00:00
parent 55c1fbf585
commit 89d2d4d5bc
11 changed files with 21 additions and 19 deletions

View file

@ -564,7 +564,7 @@ RecycleBin5_Create(
LPWSTR FileName; /* Pointer into BufferName buffer */ LPWSTR FileName; /* Pointer into BufferName buffer */
LPCSTR DesktopIniContents = "[.ShellClassInfo]\r\nCLSID={645FF040-5081-101B-9F08-00AA002F954E}\r\n"; LPCSTR DesktopIniContents = "[.ShellClassInfo]\r\nCLSID={645FF040-5081-101B-9F08-00AA002F954E}\r\n";
INFO2_HEADER Info2Contents[] = { { 5, 0, 0, 0x320, 0 } }; INFO2_HEADER Info2Contents[] = { { 5, 0, 0, 0x320, 0 } };
SIZE_T BytesToWrite, BytesWritten, Needed; DWORD BytesToWrite, BytesWritten, Needed;
HANDLE hFile = INVALID_HANDLE_VALUE; HANDLE hFile = INVALID_HANDLE_VALUE;
HRESULT hr; HRESULT hr;
@ -676,7 +676,7 @@ HRESULT RecycleBin5_Constructor(IN LPCWSTR VolumePath, OUT IUnknown **ppUnknown)
HANDLE tokenHandle = INVALID_HANDLE_VALUE; HANDLE tokenHandle = INVALID_HANDLE_VALUE;
PTOKEN_USER TokenUserInfo = NULL; PTOKEN_USER TokenUserInfo = NULL;
LPWSTR StringSid = NULL, p; LPWSTR StringSid = NULL, p;
SIZE_T Needed, DirectoryLength; DWORD Needed, DirectoryLength;
INT len; INT len;
HRESULT hr; HRESULT hr;

View file

@ -191,9 +191,9 @@ RecycleBin5File_RecycleBinFile_GetAttributes(
static HRESULT STDMETHODCALLTYPE static HRESULT STDMETHODCALLTYPE
RecycleBin5File_RecycleBinFile_GetFileName( RecycleBin5File_RecycleBinFile_GetFileName(
IN IRecycleBinFile *This, IN IRecycleBinFile *This,
IN DWORD BufferSize, IN SIZE_T BufferSize,
IN OUT LPWSTR Buffer, IN OUT LPWSTR Buffer,
OUT DWORD *RequiredSize) OUT SIZE_T *RequiredSize)
{ {
struct RecycleBin5File *s = CONTAINING_RECORD(This, struct RecycleBin5File, recycleBinFileImpl); struct RecycleBin5File *s = CONTAINING_RECORD(This, struct RecycleBin5File, recycleBinFileImpl);
DWORD dwRequired; DWORD dwRequired;

View file

@ -90,9 +90,9 @@ RtlpCheckIntegerAtom(PWSTR AtomName,
DPRINT("RtlpCheckIntegerAtom(AtomName '%S' AtomValue %p)\n", DPRINT("RtlpCheckIntegerAtom(AtomName '%S' AtomValue %p)\n",
AtomName, AtomValue); AtomName, AtomValue);
if (!((ULONG)AtomName & 0xFFFF0000)) if (!((ULONG_PTR)AtomName & 0xFFFF0000))
{ {
LoValue = (USHORT)((ULONG)AtomName & 0xFFFF); LoValue = (USHORT)((ULONG_PTR)AtomName & 0xFFFF);
if (LoValue == 0) if (LoValue == 0)
LoValue = 0xC000; LoValue = 0xC000;

View file

@ -234,7 +234,7 @@ RtlQueryProcessDebugInformation(IN ULONG ProcessId,
IN OUT PRTL_DEBUG_INFORMATION Buf) IN OUT PRTL_DEBUG_INFORMATION Buf)
{ {
NTSTATUS Status = STATUS_SUCCESS; NTSTATUS Status = STATUS_SUCCESS;
ULONG Pid = (ULONG) NtCurrentTeb()->ClientId.UniqueProcess; ULONG Pid = (ULONG_PTR) NtCurrentTeb()->ClientId.UniqueProcess;
Buf->Flags = DebugInfoMask; Buf->Flags = DebugInfoMask;
Buf->OffsetFree = sizeof(RTL_DEBUG_INFORMATION); Buf->OffsetFree = sizeof(RTL_DEBUG_INFORMATION);
@ -319,7 +319,7 @@ else
Buf->TargetProcessHandle = NtCurrentProcess(); Buf->TargetProcessHandle = NtCurrentProcess();
ClientId.UniqueThread = 0; ClientId.UniqueThread = 0;
ClientId.UniqueProcess = (HANDLE)ProcessId; ClientId.UniqueProcess = (HANDLE)(ULONG_PTR)ProcessId;
InitializeObjectAttributes(&ObjectAttributes, InitializeObjectAttributes(&ObjectAttributes,
NULL, NULL,
0, 0,

View file

@ -577,7 +577,7 @@ int __cdecl _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args)
flags |= ZEROPAD; flags |= ZEROPAD;
} }
str = number(str, end, str = number(str, end,
(unsigned long) va_arg(args, void *), 16, (ULONG_PTR) va_arg(args, void *), 16,
field_width, precision, flags); field_width, precision, flags);
continue; continue;

View file

@ -44,7 +44,7 @@
RTL_SRWLOCK_SHARED | RTL_SRWLOCK_CONTENTION_LOCK) RTL_SRWLOCK_SHARED | RTL_SRWLOCK_CONTENTION_LOCK)
#define RTL_SRWLOCK_BITS 4 #define RTL_SRWLOCK_BITS 4
#if defined(__GNUC__) #if defined(__GNUC__) && !defined(_M_AMD64)
/* This macro will cause the code to assert if compiled with a buggy /* This macro will cause the code to assert if compiled with a buggy
version of GCC that doesn't align the wait blocks properly on the stack! */ version of GCC that doesn't align the wait blocks properly on the stack! */
#define ASSERT_SRW_WAITBLOCK(ptr) \ #define ASSERT_SRW_WAITBLOCK(ptr) \

View file

@ -575,7 +575,7 @@ int __cdecl _vsnwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, va_list ar
flags |= ZEROPAD; flags |= ZEROPAD;
} }
str = number(str, end, str = number(str, end,
(unsigned long) va_arg(args, void *), 16, (ULONG_PTR) va_arg(args, void *), 16,
field_width, precision, flags); field_width, precision, flags);
continue; continue;

View file

@ -108,7 +108,7 @@ int system(const char *command)
CloseHandle(ProcessInformation.hThread); CloseHandle(ProcessInformation.hThread);
// system should wait untill the calling process is finished // system should wait untill the calling process is finished
_cwait(&nStatus,(int)ProcessInformation.hProcess,0); _cwait(&nStatus,(intptr_t)ProcessInformation.hProcess,0);
CloseHandle(ProcessInformation.hProcess); CloseHandle(ProcessInformation.hProcess);
return nStatus; return nStatus;

View file

@ -182,7 +182,7 @@ valisttosT(const _TCHAR* arg0, va_list alist, _TCHAR delim)
return str; return str;
} }
static int static intptr_t
do_spawnT(int mode, const _TCHAR* cmdname, const _TCHAR* args, const _TCHAR* envp) do_spawnT(int mode, const _TCHAR* cmdname, const _TCHAR* args, const _TCHAR* envp)
{ {
STARTUPINFO StartupInfo = {0}; STARTUPINFO StartupInfo = {0};
@ -304,7 +304,7 @@ do_spawnT(int mode, const _TCHAR* cmdname, const _TCHAR* args, const _TCHAR* env
{ {
case _P_NOWAIT: case _P_NOWAIT:
case _P_NOWAITO: case _P_NOWAITO:
return((int)ProcessInformation.hProcess); return((intptr_t)ProcessInformation.hProcess);
case _P_OVERLAY: case _P_OVERLAY:
CloseHandle(ProcessInformation.hProcess); CloseHandle(ProcessInformation.hProcess);
_exit(0); _exit(0);
@ -317,7 +317,7 @@ do_spawnT(int mode, const _TCHAR* cmdname, const _TCHAR* args, const _TCHAR* env
CloseHandle(ProcessInformation.hProcess); CloseHandle(ProcessInformation.hProcess);
return( 0); return( 0);
} }
return( (int)ProcessInformation.hProcess); return( (intptr_t)ProcessInformation.hProcess);
} }
/* /*

View file

@ -1,4 +1,6 @@
#include <string.h> #include <string.h>
#undef __MINGW_IMPORT
#define __MINGW_IMPORT
#include <ctype.h> #include <ctype.h>
#undef _pctype #undef _pctype

View file

@ -36,10 +36,10 @@ static int ISSPACE(TCHAR c)
#define ISNUM(c) ((c) >= '0' && c <= '9') #define ISNUM(c) ((c) >= '0' && c <= '9')
static unsigned long _toul(const TCHAR *s) static ULONG_PTR _toulptr(const TCHAR *s)
{ {
unsigned long res; ULONG_PTR res;
unsigned long n; ULONG_PTR n;
const TCHAR *p; const TCHAR *p;
for (p = s; *p; p++) for (p = s; *p; p++)
@ -223,7 +223,7 @@ int APIENTRY _tWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPTSTR CmdLine, int
fChildPreview = TRUE; fChildPreview = TRUE;
while (ISSPACE(*++p)); while (ISSPACE(*++p));
hParent = (HWND) _toul(p); hParent = (HWND) _toulptr(p);
if (hParent && IsWindow(hParent)) if (hParent && IsWindow(hParent))
return LaunchScreenSaver(hParent); return LaunchScreenSaver(hParent);