diff --git a/dlls/msvcrt/Makefile.in b/dlls/msvcrt/Makefile.in index 4505ec9e871..3bddb1f9898 100644 --- a/dlls/msvcrt/Makefile.in +++ b/dlls/msvcrt/Makefile.in @@ -1,4 +1,4 @@ -EXTRADEFS = -DUSE_MSVCRT_PREFIX -D_MT -DWINE_NO_STRICT +EXTRADEFS = -DUSE_MSVCRT_PREFIX -D_MT TOPSRCDIR = @top_srcdir@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ diff --git a/dlls/msvcrt/dir.c b/dlls/msvcrt/dir.c index a5889e53d39..b795634ecbe 100644 --- a/dlls/msvcrt/dir.c +++ b/dlls/msvcrt/dir.c @@ -153,8 +153,8 @@ long _findfirst(const char * fspec, struct _finddata_t* ft) return -1; } msvcrt_fttofd(&find_data,ft); - TRACE(":got handle %d\n",hfind); - return hfind; + TRACE(":got handle %p\n",hfind); + return (long)hfind; } /********************************************************************* @@ -172,8 +172,8 @@ long _wfindfirst(const WCHAR * fspec, struct _wfinddata_t* ft) return -1; } msvcrt_wfttofd(&find_data,ft); - TRACE(":got handle %d\n",hfind); - return hfind; + TRACE(":got handle %p\n",hfind); + return (long)hfind; } /********************************************************************* @@ -183,7 +183,7 @@ int _findnext(long hand, struct _finddata_t * ft) { WIN32_FIND_DATAA find_data; - if (!FindNextFileA(hand, &find_data)) + if (!FindNextFileA((HANDLE)hand, &find_data)) { *MSVCRT__errno() = MSVCRT_ENOENT; return -1; @@ -200,7 +200,7 @@ int _wfindnext(long hand, struct _wfinddata_t * ft) { WIN32_FIND_DATAW find_data; - if (!FindNextFileW(hand, &find_data)) + if (!FindNextFileW((HANDLE)hand, &find_data)) { *MSVCRT__errno() = MSVCRT_ENOENT; return -1; diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index fa42a7d53e4..acf5a5859cc 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -131,7 +131,7 @@ static int msvcrt_alloc_fd(HANDLE hand, int flag) { int fd = MSVCRT_fdstart; - TRACE(":handle (%d) allocating fd (%d)\n",hand,fd); + TRACE(":handle (%p) allocating fd (%d)\n",hand,fd); if (fd >= MSVCRT_MAX_FILES) { WARN(":files exhausted!\n"); @@ -192,7 +192,7 @@ void msvcrt_init_io(void) MSVCRT_handles[2] = GetStdHandle(STD_ERROR_HANDLE); MSVCRT_flags[2] = MSVCRT__iob[2]._flag = MSVCRT__IOWRT; - TRACE(":handles (%d)(%d)(%d)\n",MSVCRT_handles[0], + TRACE(":handles (%p)(%p)(%p)\n",MSVCRT_handles[0], MSVCRT_handles[1],MSVCRT_handles[2]); for (i = 0; i < 3; i++) @@ -366,7 +366,7 @@ int _close(int fd) { HANDLE hand = msvcrt_fdtoh(fd); - TRACE(":fd (%d) handle (%d)\n",fd,hand); + TRACE(":fd (%d) handle (%p)\n",fd,hand); if (hand == INVALID_HANDLE_VALUE) return -1; /* flush stdio buffers */ @@ -409,7 +409,7 @@ int _commit(int fd) { HANDLE hand = msvcrt_fdtoh(fd); - TRACE(":fd (%d) handle (%d)\n",fd,hand); + TRACE(":fd (%d) handle (%p)\n",fd,hand); if (hand == INVALID_HANDLE_VALUE) return -1; @@ -438,7 +438,7 @@ int _eof(int fd) DWORD curpos,endpos; HANDLE hand = msvcrt_fdtoh(fd); - TRACE(":fd (%d) handle (%d)\n",fd,hand); + TRACE(":fd (%d) handle (%p)\n",fd,hand); if (hand == INVALID_HANDLE_VALUE) return -1; @@ -486,7 +486,7 @@ LONG _lseek(int fd, LONG offset, int whence) DWORD ret; HANDLE hand = msvcrt_fdtoh(fd); - TRACE(":fd (%d) handle (%d)\n",fd,hand); + TRACE(":fd (%d) handle (%p)\n",fd,hand); if (hand == INVALID_HANDLE_VALUE) return -1; @@ -534,7 +534,7 @@ int _locking(int fd, int mode, LONG nbytes) DWORD cur_locn; HANDLE hand = msvcrt_fdtoh(fd); - TRACE(":fd (%d) handle (%d)\n",fd,hand); + TRACE(":fd (%d) handle (%p)\n",fd,hand); if (hand == INVALID_HANDLE_VALUE) return -1; @@ -746,7 +746,7 @@ long _get_osfhandle(int fd) { HANDLE hand = msvcrt_fdtoh(fd); HANDLE newhand = hand; - TRACE(":fd (%d) handle (%d)\n",fd,hand); + TRACE(":fd (%d) handle (%p)\n",fd,hand); if (hand != INVALID_HANDLE_VALUE) { @@ -762,7 +762,7 @@ long _get_osfhandle(int fd) DuplicateHandle(GetCurrentProcess(),hand,GetCurrentProcess(), &newhand,0,TRUE,DUPLICATE_SAME_ACCESS); } - return newhand; + return (long)newhand; } /********************************************************************* @@ -772,7 +772,7 @@ int _isatty(int fd) { HANDLE hand = msvcrt_fdtoh(fd); - TRACE(":fd (%d) handle (%d)\n",fd,hand); + TRACE(":fd (%d) handle (%p)\n",fd,hand); if (hand == INVALID_HANDLE_VALUE) return 0; @@ -954,7 +954,7 @@ int MSVCRT__sopen( const char *path, int oflags, int shflags, ... ) fd = msvcrt_alloc_fd(hand, ioflag); - TRACE(":fd (%d) handle (%d)\n",fd, hand); + TRACE(":fd (%d) handle (%p)\n",fd, hand); if (fd > 0) { @@ -1057,7 +1057,7 @@ int _open_osfhandle(long hand, int flags) { /* _O_RDONLY (0) always matches, so set the read flag*/ /* FIXME: handle more flags */ - int fd= msvcrt_alloc_fd(hand,flags|MSVCRT__IOREAD); + int fd= msvcrt_alloc_fd((HANDLE)hand,flags|MSVCRT__IOREAD); TRACE(":handle (%ld) fd (%d) flags 0x%08x\n",hand,fd, flags |MSVCRT__IOREAD); return fd; } @@ -1091,7 +1091,7 @@ int _read(int fd, void *buf, unsigned int count) /* Dont trace small reads, it gets *very* annoying */ if (count > 4) - TRACE(":fd (%d) handle (%d) buf (%p) len (%d)\n",fd,hand,buf,count); + TRACE(":fd (%d) handle (%p) buf (%p) len (%d)\n",fd,hand,buf,count); if (hand == INVALID_HANDLE_VALUE) return -1; diff --git a/dlls/msvcrt/main.c b/dlls/msvcrt/main.c index 080579ae8ea..93290b11d66 100644 --- a/dlls/msvcrt/main.c +++ b/dlls/msvcrt/main.c @@ -43,7 +43,7 @@ BOOL WINAPI MSVCRT_Init(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { MSVCRT_thread_data *tls; - TRACE("(0x%08x, %s, %p) pid(%ld), tid(%ld), tls(%ld)\n", + TRACE("(%p, %s, %p) pid(%ld), tid(%ld), tls(%ld)\n", hinstDLL, msvcrt_get_reason(fdwReason), lpvReserved, (long)GetCurrentProcessId(), (long)GetCurrentThreadId(), (long)MSVCRT_tls_index); diff --git a/dlls/msvcrt/thread.c b/dlls/msvcrt/thread.c index f6203187ac0..e06db1c1371 100644 --- a/dlls/msvcrt/thread.c +++ b/dlls/msvcrt/thread.c @@ -92,7 +92,8 @@ unsigned long _beginthread( trampoline->arglist = arglist; /* FIXME */ - return CreateThread(NULL, stack_size, _beginthread_trampoline, trampoline, 0, NULL); + return (unsigned long)CreateThread(NULL, stack_size, _beginthread_trampoline, + trampoline, 0, NULL); } /********************************************************************* @@ -109,8 +110,9 @@ unsigned long _beginthreadex( TRACE("(%p, %d, %p, %p, %d, %p)\n", security, stack_size, start_address, arglist, initflag, thrdaddr); /* FIXME */ - return CreateThread(security, stack_size, (LPTHREAD_START_ROUTINE) start_address, - arglist, initflag, (LPDWORD) thrdaddr); + return (unsigned long)CreateThread(security, stack_size, + (LPTHREAD_START_ROUTINE) start_address, + arglist, initflag, (LPDWORD) thrdaddr); } /*********************************************************************