2 * Win32 kernel functions
4 * Copyright 1995 Martin von Loewis, Sven Verdoolaege, and Cameron Heide
11 #include <sys/types.h>
26 DWORD
ErrnoToLastError(int errno_num
);
28 /***********************************************************************
29 * ReadFileEx (KERNEL32.)
33 (CALLBACK
*LPOVERLAPPED_COMPLETION_ROUTINE
)(
35 DWORD dwNumberOfBytesTransfered
,
36 LPOVERLAPPED lpOverlapped
39 BOOL32 WINAPI
ReadFileEx(HFILE32 hFile
, LPVOID lpBuffer
, DWORD numtoread
,
40 LPOVERLAPPED lpOverlapped
,
41 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
)
44 FIXME(file
, "file %d to buf %p num %ld %p func %p stub\n",
45 hFile
, lpBuffer
, numtoread
, lpOverlapped
, lpCompletionRoutine
);
46 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
50 /**************************************************************************
51 * SetFileAttributes16 (KERNEL.421)
53 BOOL16 WINAPI
SetFileAttributes16( LPCSTR lpFileName
, DWORD attributes
)
55 return SetFileAttributes32A( lpFileName
, attributes
);
59 /**************************************************************************
60 * SetFileAttributes32A (KERNEL32.490)
62 BOOL32 WINAPI
SetFileAttributes32A(LPCSTR lpFileName
, DWORD attributes
)
65 DOS_FULL_NAME full_name
;
67 if (!DOSFS_GetFullName( lpFileName
, TRUE
, &full_name
))
70 TRACE(file
,"(%s,%lx)\n",lpFileName
,attributes
);
71 if (attributes
& FILE_ATTRIBUTE_NORMAL
) {
72 attributes
&= ~FILE_ATTRIBUTE_NORMAL
;
74 FIXME(file
,"(%s):%lx illegal combination with FILE_ATTRIBUTE_NORMAL.\n",
75 lpFileName
,attributes
);
77 if(stat(full_name
.long_name
,&buf
)==-1)
79 SetLastError(ErrnoToLastError(errno
));
82 if (attributes
& FILE_ATTRIBUTE_READONLY
)
84 buf
.st_mode
&= ~0222; /* octal!, clear write permission bits */
85 attributes
&= ~FILE_ATTRIBUTE_READONLY
;
87 attributes
&= ~(FILE_ATTRIBUTE_ARCHIVE
|FILE_ATTRIBUTE_HIDDEN
|FILE_ATTRIBUTE_SYSTEM
);
89 FIXME(file
,"(%s):%lx attribute(s) not implemented.\n",
90 lpFileName
,attributes
);
91 if (-1==chmod(full_name
.long_name
,buf
.st_mode
))
93 SetLastError(ErrnoToLastError(errno
));
100 /**************************************************************************
101 * SetFileAttributes32W (KERNEL32.491)
103 BOOL32 WINAPI
SetFileAttributes32W(LPCWSTR lpFileName
, DWORD attributes
)
105 LPSTR afn
= HEAP_strdupWtoA( GetProcessHeap(), 0, lpFileName
);
106 BOOL32 res
= SetFileAttributes32A( afn
, attributes
);
107 HeapFree( GetProcessHeap(), 0, afn
);
112 /**************************************************************************
113 * SetFileApisToOEM (KERNEL32.645)
115 VOID WINAPI
SetFileApisToOEM(void)
117 /*FIXME(file,"(): stub!\n");*/
121 /**************************************************************************
122 * SetFileApisToANSI (KERNEL32.644)
124 VOID WINAPI
SetFileApisToANSI(void)
126 /*FIXME(file,"(): stub\n");*/
130 /******************************************************************************
131 * AreFileApisANSI [KERNEL32.105] Determines if file functions are using ANSI
134 * TRUE: Set of file functions is using ANSI code page
135 * FALSE: Set of file functions is using OEM code page
137 BOOL32 WINAPI
AreFileApisANSI(void)
139 FIXME(file
,"(void): stub\n");