Commit e101f6db authored by Alexandre Julliard's avatar Alexandre Julliard

Cleaned up a few inter-dll dependencies. Added a few imports.

parent c7e7df8b
......@@ -385,6 +385,7 @@ dsound/libdsound.so: libwinmm.so libkernel32.so
gdi/libgdi32.so: libkernel32.so
icmp/libicmp.so: libkernel32.so
imagehlp/libimagehlp.so: libkernel32.so
imm32/libimm32.so: libkernel32.so
lzexpand/liblz32.so: libkernel32.so
mpr/libmpr.so: libkernel32.so
msacm/libmsacm32.so: libwinmm.so libkernel32.so
......@@ -393,14 +394,14 @@ ole32/libole32.so: libadvapi32.so libuser32.so libgdi32.so librpcrt4.so libkerne
oleaut32/liboleaut32.so: libole32.so libgdi32.so libkernel32.so
olecli/libolecli32.so: libole32.so libolesvr32.so libgdi32.so
olepro32/libolepro32.so: liboleaut32.so
opengl32/libopengl32.so: libx11drv.so
opengl32/libopengl32.so: libx11drv.so libkernel32.so
psapi/libpsapi.so: libkernel32.so
richedit/libriched32.so: libuser32.so libkernel32.so
serialui/libserialui.so: libuser32.so libadvapi32.so libkernel32.so
setupapi/libsetupapi.so: libkernel32.so
setupapi/libsetupapi.so: libadvapi32.so libkernel32.so
shell32/libshell32.so: libole32.so libshlwapi.so libcomctl32.so libadvapi32.so libuser32.so libgdi32.so libkernel32.so
shfolder/libshfolder.so: libshell32.so
shlwapi/libshlwapi.so: libadvapi32.so libuser32.so libkernel32.so
shlwapi/libshlwapi.so: libadvapi32.so libuser32.so libgdi32.so libkernel32.so
tapi32/libtapi32.so: libkernel32.so
ttydrv/libttydrv.so: libuser32.so libgdi32.so libkernel32.so
urlmon/liburlmon.so: libole32.so
......
......@@ -7,6 +7,7 @@
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <pwd.h>
#include "winbase.h"
#include "windef.h"
......@@ -25,11 +26,9 @@ GetUserNameA( LPSTR lpszName, LPDWORD lpSize )
size_t len;
char *name;
name=getlogin();
#if 0
/* FIXME: should use getpwuid() here */
if (!name) name=cuserid(NULL);
#endif
struct passwd *pwd = getpwuid( getuid() );
if (!pwd) return 0;
name = pwd->pw_name;
len = name ? strlen(name) : 0;
if (!len || !lpSize || len > *lpSize) {
if (lpszName) *lpszName = 0;
......
......@@ -476,8 +476,8 @@ HRESULT WINAPI AVIMakeCompressedStream(PAVISTREAM *ppsCompressed,PAVISTREAM ppsS
icf.lQuality = aco->dwQuality;
icf.lKeyRate = aco->dwKeyFrameEvery;
icf.GetData = (LONG (*)(LPARAM,LONG,LPVOID,LONG)) 0xdead4242;
icf.PutData = (LONG (*)(LPARAM,LONG,LPVOID,LONG)) 0xdead4243;
icf.GetData = (void *)0xdead4242;
icf.PutData = (void *)0xdead4243;
ICSendMessage(as->hic,ICM_COMPRESS_FRAMES_INFO,(LPARAM)&icf,sizeof(icf));
}
return S_OK;
......
......@@ -10,6 +10,7 @@ import user32.dll
import winspool.drv
import gdi32.dll
import kernel32.dll
import ntdll.dll
0 stub ArrowBtnWndProc
1 stdcall ChooseColorA(ptr) ChooseColorA
......
......@@ -100,6 +100,7 @@ typedef VOID (*new_handler_type)(VOID);
static new_handler_type new_handler;
CRTDLL_FILE * __cdecl CRTDLL__fdopen(INT handle, LPCSTR mode);
INT __cdecl CRTDLL_fgetc( CRTDLL_FILE *file );
/*********************************************************************
* CRTDLL_MainInit (CRTDLL.init)
......@@ -117,6 +118,24 @@ BOOL WINAPI CRTDLL_Init(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
}
/*********************************************************************
* malloc (CRTDLL.427)
*/
VOID* __cdecl CRTDLL_malloc(DWORD size)
{
return HeapAlloc(GetProcessHeap(),0,size);
}
/*********************************************************************
* _strdup (CRTDLL.285)
*/
LPSTR __cdecl CRTDLL__strdup(LPCSTR ptr)
{
LPSTR ret = CRTDLL_malloc(strlen(ptr)+1);
if (ret) strcpy( ret, ptr );
return ret;
}
/*********************************************************************
* _GetMainArgs (CRTDLL.022)
*/
LPSTR * __cdecl CRTDLL__GetMainArgs(LPDWORD argc,LPSTR **argv,
......@@ -134,8 +153,7 @@ LPSTR * __cdecl CRTDLL__GetMainArgs(LPDWORD argc,LPSTR **argv,
if (CRTDLL_acmdln_dll != NULL)
HeapFree(GetProcessHeap(), 0, CRTDLL_acmdln_dll);
CRTDLL_acmdln_dll = cmdline = HEAP_strdupA( GetProcessHeap(), 0,
GetCommandLineA() );
CRTDLL_acmdln_dll = cmdline = CRTDLL__strdup( GetCommandLineA() );
TRACE("got '%s'\n", cmdline);
version = GetVersion();
......@@ -166,8 +184,7 @@ LPSTR * __cdecl CRTDLL__GetMainArgs(LPDWORD argc,LPSTR **argv,
sizeof(char*)*(xargc+1));
if (strlen(cmdline+afterlastspace))
{
xargv[xargc] = HEAP_strdupA( GetProcessHeap(), 0,
cmdline+afterlastspace);
xargv[xargc] = CRTDLL__strdup(cmdline+afterlastspace);
xargc++;
if (!last_arg) /* need to seek to the next arg ? */
{
......@@ -866,15 +883,6 @@ INT __cdecl CRTDLL_rand()
/*********************************************************************
* putchar (CRTDLL.442)
*/
void __cdecl CRTDLL_putchar( INT x )
{
putchar(x);
}
/*********************************************************************
* fputc (CRTDLL.374)
*/
INT __cdecl CRTDLL_fputc( INT c, CRTDLL_FILE *file )
......@@ -888,6 +896,15 @@ INT __cdecl CRTDLL_fputc( INT c, CRTDLL_FILE *file )
/*********************************************************************
* putchar (CRTDLL.442)
*/
void __cdecl CRTDLL_putchar( INT x )
{
CRTDLL_fputc( x, CRTDLL_stdout );
}
/*********************************************************************
* fputs (CRTDLL.375)
*/
INT __cdecl CRTDLL_fputs( LPCSTR s, CRTDLL_FILE *file )
......@@ -905,7 +922,7 @@ INT __cdecl CRTDLL_fputs( LPCSTR s, CRTDLL_FILE *file )
INT __cdecl CRTDLL_puts(LPCSTR s)
{
TRACE("%s \n",s);
return puts(s);
return CRTDLL_fputs(s, CRTDLL_stdout);
}
......@@ -981,7 +998,7 @@ LPSTR __cdecl CRTDLL_gets(LPSTR buf)
* windows95's ftp.exe.
*/
for(cc = fgetc(stdin); cc != EOF && cc != '\n'; cc = fgetc(stdin))
for(cc = CRTDLL_fgetc(CRTDLL_stdin); cc != EOF && cc != '\n'; cc = CRTDLL_fgetc(CRTDLL_stdin))
if(cc != '\r') *buf++ = (char)cc;
*buf = '\0';
......@@ -1099,14 +1116,6 @@ VOID __cdecl CRTDLL_longjmp(jmp_buf env, int val)
}
/*********************************************************************
* malloc (CRTDLL.427)
*/
VOID* __cdecl CRTDLL_malloc(DWORD size)
{
return HeapAlloc(GetProcessHeap(),0,size);
}
/*********************************************************************
* new (CRTDLL.001)
*/
VOID* __cdecl CRTDLL_new(DWORD size)
......@@ -1160,14 +1169,6 @@ VOID __cdecl CRTDLL_delete(VOID* ptr)
}
/*********************************************************************
* _strdup (CRTDLL.285)
*/
LPSTR __cdecl CRTDLL__strdup(LPCSTR ptr)
{
return HEAP_strdupA(GetProcessHeap(),0,ptr);
}
/*********************************************************************
* fclose (CRTDLL.362)
*/
INT __cdecl CRTDLL_fclose( CRTDLL_FILE *file )
......@@ -1659,7 +1660,27 @@ LPINT __cdecl CRTDLL__errno()
static int crtdllerrno;
/* FIXME: we should set the error at the failing function call time */
crtdllerrno = LastErrorToErrno(GetLastError());
switch(GetLastError())
{
case ERROR_ACCESS_DENIED: crtdllerrno = EPERM; break;
case ERROR_FILE_NOT_FOUND: crtdllerrno = ENOENT; break;
case ERROR_INVALID_PARAMETER: crtdllerrno = EINVAL; break;
case ERROR_IO_DEVICE: crtdllerrno = EIO; break;
case ERROR_BAD_FORMAT: crtdllerrno = ENOEXEC; break;
case ERROR_INVALID_HANDLE: crtdllerrno = EBADF; break;
case ERROR_OUTOFMEMORY: crtdllerrno = ENOMEM; break;
case ERROR_BUSY: crtdllerrno = EBUSY; break;
case ERROR_FILE_EXISTS: crtdllerrno = EEXIST; break;
case ERROR_BAD_DEVICE: crtdllerrno = ENODEV; break;
case ERROR_TOO_MANY_OPEN_FILES: crtdllerrno = EMFILE; break;
case ERROR_DISK_FULL: crtdllerrno = ENOSPC; break;
case ERROR_SEEK_ON_DEVICE: crtdllerrno = ESPIPE; break;
case ERROR_BROKEN_PIPE: crtdllerrno = EPIPE; break;
case ERROR_POSSIBLE_DEADLOCK: crtdllerrno = EDEADLK; break;
case ERROR_FILENAME_EXCED_RANGE: crtdllerrno = ENAMETOOLONG; break;
case ERROR_DIR_NOT_EMPTY: crtdllerrno = ENOTEMPTY; break;
}
return &crtdllerrno;
}
......
......@@ -11,6 +11,7 @@
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "wine/unicode.h"
#include "crtdll.h"
......@@ -114,7 +115,7 @@ LPWSTR __cdecl CRTDLL_wcspbrk( LPCWSTR str, LPCWSTR accept )
*/
INT __cdecl CRTDLL_wctomb( LPSTR dst, WCHAR ch )
{
return WideCharToMultiByte( CP_ACP, 0, ch, 1, dst, 6, NULL, NULL );
return WideCharToMultiByte( CP_ACP, 0, &ch, 1, dst, 6, NULL, NULL );
}
/*********************************************************************
......
......@@ -4,6 +4,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = imm32
SOVERSION = 1.0
IMPORTS = kernel32
C_SRCS = \
imm.c
......
name imm32
type win32
import kernel32.dll
@ stdcall ImmAssociateContext(long long) ImmAssociateContext
@ stdcall ImmConfigureIMEA(long long long ptr) ImmConfigureIMEA
@ stdcall ImmConfigureIMEW(long long long ptr) ImmConfigureIMEW
......
......@@ -7,15 +7,15 @@
#include "wine/winbase16.h"
#include "winbase.h"
#include "wownt32.h"
#include "file.h"
#include "heap.h"
#include "miscemu.h"
#include "syslevel.h"
#include "stackframe.h"
#include "builtin16.h"
#include "debugtools.h"
#include "file.h"
DEFAULT_DEBUG_CHANNEL(thunk)
DEFAULT_DEBUG_CHANNEL(thunk);
/*
* 32-bit WOW routines (in WOW32, but actually forwarded to KERNEL32)
......
......@@ -21,7 +21,6 @@
#include "wownt32.h"
#include "ole2ver.h"
#include "debugtools.h"
#include "file.h"
#include "heap.h"
#include "ldt.h"
#include "winreg.h"
......@@ -1492,11 +1491,10 @@ void WINAPI CoFreeUnusedLibraries(void)
* RETURNS
* the current system time in lpFileTime
*/
HRESULT WINAPI CoFileTimeNow(
FILETIME *lpFileTime /* [out] the current time */
) {
DOSFS_UnixTimeToFileTime(time(NULL), lpFileTime, 0);
return S_OK;
HRESULT WINAPI CoFileTimeNow( FILETIME *lpFileTime ) /* [out] the current time */
{
GetSystemTimeAsFileTime( lpFileTime );
return S_OK;
}
/***********************************************************************
......
......@@ -4,7 +4,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = opengl32
SOVERSION = 1.0
IMPORTS = x11drv
IMPORTS = x11drv kernel32
C_SRCS = \
wgl.c \
......
name opengl32
type win32
init OpenGL32_Init
import x11drv
import kernel32
@ stdcall wglCreateContext(long) wglCreateContext
@ stdcall wglCreateLayerContext(long long) wglCreateLayerContext
......
......@@ -5,7 +5,7 @@ VPATH = @srcdir@
MODULE = setupapi
SOVERSION = 1.0
ALTNAMES = setupx
IMPORTS = kernel32
IMPORTS = advapi32 kernel32
C_SRCS = \
setupx_main.c \
......
name setupapi
type win32
import advapi32.dll
import kernel32.dll
# almost all functions are commented out for now. Ordinals are from setupapi.dll 4.0
......
......@@ -4,7 +4,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = shlwapi
SOVERSION = 1.0
IMPORTS = advapi32 user32 kernel32
IMPORTS = advapi32 user32 gdi32 kernel32
C_SRCS = \
ordinal.c \
......
......@@ -4,6 +4,7 @@ init SHLWAPI_LibMain
import advapi32
import user32
import gdi32
import kernel32
1 stdcall @(ptr ptr) SHLWAPI_1
......@@ -614,7 +615,7 @@ import kernel32
@ stdcall StrCSpnW (wstr wstr) StrCSpnW
@ stdcall StrCatBuffA (str str long) StrCatBuffA
@ stdcall StrCatBuffW (wstr wstr long) StrCatBuffW
@ stub StrCatW
@ stdcall StrCatW (ptr wstr) StrCatW
@ stdcall StrChrA (str long) StrChrA
@ stub StrChrIA
@ stub StrChrIW
......@@ -626,7 +627,7 @@ import kernel32
@ stdcall StrCmpNW (wstr wstr long) StrCmpNW
@ stdcall StrCmpW (wstr wstr) lstrcmpW
@ stdcall StrCpyNW (ptr wstr long) lstrcpynW
@ stdcall StrCpyW (ptr wstr) lstrcpyW
@ stdcall StrCpyW (ptr wstr) StrCpyW
@ stdcall StrDupA (str) StrDupA
@ stdcall StrDupW (wstr) StrDupW
@ stdcall StrFormatByteSizeA(long str long) StrFormatByteSizeA
......
......@@ -67,6 +67,24 @@ int WINAPI StrCmpNIW ( LPCWSTR wstr1, LPCWSTR wstr2, int len)
}
/*************************************************************************
* StrCatW [SHLWAPI]
*/
LPWSTR WINAPI StrCatW( LPWSTR wstr1, LPCWSTR wstr2 )
{
return strcatW( wstr1, wstr2 );
}
/*************************************************************************
* StrCpyW [SHLWAPI]
*/
LPWSTR WINAPI StrCpyW( LPWSTR wstr1, LPCWSTR wstr2 )
{
return strcpyW( wstr1, wstr2 );
}
/*************************************************************************
* StrStrA [SHLWAPI]
*/
LPSTR WINAPI StrStrA(LPCSTR lpFirst, LPCSTR lpSrch)
......@@ -174,7 +192,7 @@ LPWSTR WINAPI StrDupW (LPCWSTR lpSrc)
TRACE("%s\n", debugstr_w(lpSrc));
if (lpDest) lstrcpyW(lpDest, lpSrc);
if (lpDest) strcpyW(lpDest, lpSrc);
return lpDest;
}
......
......@@ -25,6 +25,7 @@
#include "wingdi.h"
#include "winuser.h"
#include "wine/winbase16.h"
#include "wine/unicode.h"
#include "winerror.h"
#include "drive.h"
#include "file.h"
......@@ -966,7 +967,7 @@ DWORD WINAPI GetShortPathNameA( LPCSTR longpath, LPSTR shortpath,
/* Check if the file exists and use the existing file name */
if ( DOSFS_GetFullName ( tmpshortpath, TRUE, &full_name ) ) {
lstrcpyA ( tmpshortpath+sp, strrchr ( full_name.short_name, '\\' ) + 1 );
strcpy( tmpshortpath+sp, strrchr ( full_name.short_name, '\\' ) + 1 );
sp += strlen ( tmpshortpath+sp );
lp += tmplen;
continue;
......@@ -1266,7 +1267,7 @@ DWORD WINAPI GetFullPathNameW( LPCWSTR name, DWORD len, LPWSTR buffer,
HeapFree( GetProcessHeap(), 0, nameA );
if (ret && (ret<=len) && buffer && lastpart)
{
LPWSTR p = buffer + lstrlenW(buffer);
LPWSTR p = buffer + strlenW(buffer);
if (*p != (WCHAR)'\\')
{
while ((p > buffer + 2) && (*p != (WCHAR)'\\')) p--;
......@@ -1295,9 +1296,9 @@ static int DOSFS_FindNextEx( FIND_FIRST_INFO *info, WIN32_FIND_DATAA *entry )
{
if (info->cur_pos) return 0;
entry->dwFileAttributes = FILE_ATTRIBUTE_LABEL;
DOSFS_UnixTimeToFileTime( (time_t)0, &entry->ftCreationTime, 0 );
DOSFS_UnixTimeToFileTime( (time_t)0, &entry->ftLastAccessTime, 0 );
DOSFS_UnixTimeToFileTime( (time_t)0, &entry->ftLastWriteTime, 0 );
RtlSecondsSince1970ToTime( (time_t)0, &entry->ftCreationTime );
RtlSecondsSince1970ToTime( (time_t)0, &entry->ftLastAccessTime );
RtlSecondsSince1970ToTime( (time_t)0, &entry->ftLastWriteTime );
entry->nFileSizeHigh = 0;
entry->nFileSizeLow = 0;
entry->dwReserved0 = 0;
......@@ -1932,7 +1933,7 @@ BOOL WINAPI DosDateTimeToFileTime( WORD fatdate, WORD fattime, LPFILETIME ft)
newtm.tm_mday = (fatdate & 0x1f);
newtm.tm_mon = ((fatdate >> 5) & 0x0f) - 1;
newtm.tm_year = (fatdate >> 9) + 80;
DOSFS_UnixTimeToFileTime( mktime( &newtm ), ft, 0 );
RtlSecondsSince1970ToTime( mktime( &newtm ), ft );
return TRUE;
}
......
......@@ -526,9 +526,9 @@ static void FILE_FillInfo( struct stat *st, BY_HANDLE_FILE_INFORMATION *info )
if (!(st->st_mode & S_IWUSR))
info->dwFileAttributes |= FILE_ATTRIBUTE_READONLY;
DOSFS_UnixTimeToFileTime( st->st_mtime, &info->ftCreationTime, 0 );
DOSFS_UnixTimeToFileTime( st->st_mtime, &info->ftLastWriteTime, 0 );
DOSFS_UnixTimeToFileTime( st->st_atime, &info->ftLastAccessTime, 0 );
RtlSecondsSince1970ToTime( st->st_mtime, &info->ftCreationTime );
RtlSecondsSince1970ToTime( st->st_mtime, &info->ftLastWriteTime );
RtlSecondsSince1970ToTime( st->st_atime, &info->ftLastAccessTime );
info->dwVolumeSerialNumber = 0; /* FIXME */
info->nFileSizeHigh = 0;
......@@ -571,9 +571,9 @@ DWORD WINAPI GetFileInformationByHandle( HANDLE hFile,
if (!info) return 0;
req->handle = hFile;
if (server_call( REQ_GET_FILE_INFO )) return 0;
DOSFS_UnixTimeToFileTime( req->write_time, &info->ftCreationTime, 0 );
DOSFS_UnixTimeToFileTime( req->write_time, &info->ftLastWriteTime, 0 );
DOSFS_UnixTimeToFileTime( req->access_time, &info->ftLastAccessTime, 0 );
RtlSecondsSince1970ToTime( req->write_time, &info->ftCreationTime );
RtlSecondsSince1970ToTime( req->write_time, &info->ftLastWriteTime );
RtlSecondsSince1970ToTime( req->access_time, &info->ftLastAccessTime );
info->dwFileAttributes = req->attr;
info->dwVolumeSerialNumber = req->serial;
info->nFileSizeHigh = req->size_high;
......
......@@ -8,7 +8,6 @@ MODULE = win32
C_SRCS = \
console.c \
device.c \
error.c \
except.c \
file.c \
init.c \
......
/*
* Win32 kernel functions
*
* Copyright 1995 Martin von Loewis and Cameron Heide
*/
#include <errno.h>
#include "windef.h"
#include "winerror.h"
/* The errno_xlat_table contains the errno-to-Win32 error
* mapping. Since this is a single table, it can't easily
* take into account function-specific differences, so there
* will probably be quite a few points where we don't exactly
* match what NT would return. Then again, neither does
* Windows 95. :-)
*/
typedef struct {
int err;
DWORD win32err;
} ERRNO_XLAT_TABLE;
/* The table looks pretty ugly due to the preprocessor stuff,
* but I honestly have no idea how many of these values are
* portable. I'm not even sure how many of them are even
* used at all. :-)
*/
static ERRNO_XLAT_TABLE errno_xlat_table[] = {
#if defined(EPERM)
{ EPERM, ERROR_ACCESS_DENIED },
#endif
#if defined(ENOENT)
{ ENOENT, ERROR_FILE_NOT_FOUND },
#endif
#if defined(ESRCH)
{ ESRCH, ERROR_INVALID_PARAMETER },
#endif
#if defined(EIO)
{ EIO, ERROR_IO_DEVICE },
#endif
#if defined(ENOEXEC)
{ ENOEXEC, ERROR_BAD_FORMAT },
#endif
#if defined(EBADF)
{ EBADF, ERROR_INVALID_HANDLE },
#endif
#if defined(ENOMEM)
{ ENOMEM, ERROR_OUTOFMEMORY },
#endif
#if defined(EACCES)
{ EACCES, ERROR_ACCESS_DENIED },
#endif
#if defined(EBUSY)
{ EBUSY, ERROR_BUSY },
#endif
#if defined(EEXIST)
{ EEXIST, ERROR_FILE_EXISTS },
#endif
#if defined(ENODEV)
{ ENODEV, ERROR_BAD_DEVICE },
#endif
#if defined(EINVAL)
{ EINVAL, ERROR_INVALID_PARAMETER },
#endif
#if defined(EMFILE)
{ EMFILE, ERROR_TOO_MANY_OPEN_FILES },
#endif
#if defined(ETXTBSY)
{ ETXTBSY, ERROR_BUSY, },
#endif
#if defined(ENOSPC)
{ ENOSPC, ERROR_DISK_FULL },
#endif
#if defined(ESPIPE)
{ ESPIPE, ERROR_SEEK_ON_DEVICE },
#endif
#if defined(EPIPE)
{ EPIPE, ERROR_BROKEN_PIPE },
#endif
#if defined(EDEADLK)
{ EDEADLK, ERROR_POSSIBLE_DEADLOCK },
#endif
#if defined(ENAMETOOLONG)
{ ENAMETOOLONG, ERROR_FILENAME_EXCED_RANGE },
#endif
#if defined(ENOTEMPTY)
{ ENOTEMPTY, ERROR_DIR_NOT_EMPTY },
#endif
{ -1, 0 }
};
DWORD ErrnoToLastError(int errno_num)
{
DWORD rc = ERROR_UNKNOWN;
int i = 0;
while(errno_xlat_table[i].err != -1)
{
if(errno_xlat_table[i].err == errno_num)
{
rc = errno_xlat_table[i].win32err;
break;
}
i++;
}
return rc;
}
int LastErrorToErrno(DWORD lasterror)
{
int rc = 0; /* no error */
int i = 0;
while(errno_xlat_table[i].err != -1)
{
if(errno_xlat_table[i].win32err == lasterror )
{
rc = errno_xlat_table[i].err;
break;
}
i++;
}
return rc;
}
......@@ -27,9 +27,7 @@
#include "heap.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(file)
DWORD ErrnoToLastError(int errno_num);
DEFAULT_DEBUG_CHANNEL(file);
/***********************************************************************
* ReadFileEx (KERNEL32.)
......@@ -74,7 +72,7 @@ BOOL WINAPI SetFileAttributesA(LPCSTR lpFileName, DWORD attributes)
}
if(stat(full_name.long_name,&buf)==-1)
{
SetLastError(ErrnoToLastError(errno));
FILE_SetDosError();
return FALSE;
}
if (attributes & FILE_ATTRIBUTE_READONLY)
......@@ -100,8 +98,8 @@ BOOL WINAPI SetFileAttributesA(LPCSTR lpFileName, DWORD attributes)
lpFileName,attributes);
if (-1==chmod(full_name.long_name,buf.st_mode))
{
FILE_SetDosError();
MESSAGE("Wine ERROR: Couldn't set file attributes for existing file \"%s\". Check permissions !\n", full_name.long_name);
SetLastError(ErrnoToLastError(errno));
return FALSE;
}
return TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment