Commit 8ca6cada authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

- moved the remaining of int21 calls to dlls/winedos

- disabled drive enabling/disabling as well as disk serial number writing (for DLL separation issues) - added volume management prototypes to include/winbase.h - started DefineDosDevice (needed by first item in this list) - removed int21 specific code from dlls/kernel
parent 01968613
......@@ -26,7 +26,6 @@ C_SRCS = \
$(TOPOBJDIR)/misc/options.c \
$(TOPOBJDIR)/misc/registry.c \
$(TOPOBJDIR)/msdos/dpmi.c \
$(TOPOBJDIR)/msdos/int21.c \
atom.c \
change.c \
comm.c \
......
......@@ -221,7 +221,7 @@
@ stdcall DebugActiveProcess(long)
@ stdcall DebugBreak()
@ stdcall DefineDosDeviceA(long str str)
@ stub DefineDosDeviceW
@ stdcall DefineDosDeviceW(long wstr wstr)
@ stub DelayLoadFailureHook
@ stdcall DeleteAtom(long)
@ stdcall DeleteCriticalSection(ptr) ntdll.RtlDeleteCriticalSection
......@@ -1150,7 +1150,6 @@
@ cdecl DOSMEM_ResizeBlock(ptr long long)
@ cdecl DRIVE_OpenDevice(long long)
@ cdecl FILE_Dup2(long long)
@ stdcall INT_Int21Handler(ptr)
@ cdecl LOCAL_Alloc(long long long)
@ cdecl LOCAL_Compact(long long long)
@ cdecl LOCAL_CountFree(long)
......
......@@ -53,7 +53,6 @@
#include "wine/winbase16.h"
#include "drive.h"
#include "file.h"
#include "heap.h"
#include "msdos.h"
#include "winternl.h"
#include "wine/server.h"
......@@ -143,8 +142,6 @@ typedef struct
{
char *path; /* unix path */
LPWSTR long_mask;
LPWSTR short_mask;
BYTE attr;
int drive;
int cur_pos;
CRITICAL_SECTION cs;
......@@ -333,20 +330,6 @@ static void DOSFS_ToDosDTAFormat( LPCWSTR name, LPWSTR buffer )
/***********************************************************************
* DOSFS_MatchShort
*
* Check a DOS file name against a mask (both in FCB format).
*/
static int DOSFS_MatchShort( LPCWSTR mask, LPCWSTR name )
{
int i;
for (i = 11; i > 0; i--, mask++, name++)
if ((*mask != '?') && (*mask != *name)) return 0;
return 1;
}
/***********************************************************************
* DOSFS_MatchLong
*
* Check a long file name against a mask.
......@@ -1777,35 +1760,14 @@ static BOOL get_show_dir_symlinks_option(void)
*/
static int DOSFS_FindNextEx( FIND_FIRST_INFO *info, WIN32_FIND_DATAW *entry )
{
DWORD attr = info->attr | FA_UNUSED | FA_ARCHIVE | FA_RDONLY;
UINT flags = DRIVE_GetFlags( info->drive );
char *p, buffer[MAX_PATHNAME_LEN];
const char *drive_path;
int drive_root;
LPCWSTR long_name, short_name;
BY_HANDLE_FILE_INFORMATION fileinfo;
WCHAR dos_name[13];
BOOL is_symlink;
if ((info->attr & ~(FA_UNUSED | FA_ARCHIVE | FA_RDONLY)) == FA_LABEL)
{
if (info->cur_pos) return 0;
entry->dwFileAttributes = FILE_ATTRIBUTE_LABEL;
RtlSecondsSince1970ToTime( (time_t)0, (LARGE_INTEGER *)&entry->ftCreationTime );
RtlSecondsSince1970ToTime( (time_t)0, (LARGE_INTEGER *)&entry->ftLastAccessTime );
RtlSecondsSince1970ToTime( (time_t)0, (LARGE_INTEGER *)&entry->ftLastWriteTime );
entry->nFileSizeHigh = 0;
entry->nFileSizeLow = 0;
entry->dwReserved0 = 0;
entry->dwReserved1 = 0;
DOSFS_ToDosDTAFormat( DRIVE_GetLabel( info->drive ), entry->cFileName );
strcpyW( entry->cAlternateFileName, entry->cFileName );
info->cur_pos++;
TRACE("returning %s (%s) as label\n",
debugstr_w(entry->cFileName), debugstr_w(entry->cAlternateFileName));
return 1;
}
drive_path = info->path + strlen(DRIVE_GetRoot( info->drive ));
while ((*drive_path == '/') || (*drive_path == '\\')) drive_path++;
drive_root = !*drive_path;
......@@ -1831,19 +1793,6 @@ static int DOSFS_FindNextEx( FIND_FIRST_INFO *info, WIN32_FIND_DATAW *entry )
flags & DRIVE_CASE_SENSITIVE )) continue;
}
/* Check the short mask */
if (info->short_mask)
{
if (!short_name)
{
DOSFS_Hash( long_name, dos_name, TRUE,
!(flags & DRIVE_CASE_SENSITIVE) );
short_name = dos_name;
}
if (!DOSFS_MatchShort( info->short_mask, short_name )) continue;
}
/* Check the file attributes */
WideCharToMultiByte(CP_UNIXCP, 0, long_name, -1,
p, sizeof(buffer) - (int)(p - buffer), NULL, NULL);
......@@ -1860,8 +1809,6 @@ static int DOSFS_FindNextEx( FIND_FIRST_INFO *info, WIN32_FIND_DATAW *entry )
if (!show_dir_symlinks) continue;
}
if (fileinfo.dwFileAttributes & ~attr) continue;
/* We now have a matching entry; fill the result and return */
entry->dwFileAttributes = fileinfo.dwFileAttributes;
......@@ -1887,94 +1834,6 @@ static int DOSFS_FindNextEx( FIND_FIRST_INFO *info, WIN32_FIND_DATAW *entry )
return 0; /* End of directory */
}
/***********************************************************************
* DOSFS_FindNext
*
* Find the next matching file. Return the number of entries read to find
* the matching one, or 0 if no more entries.
* 'short_mask' is the 8.3 mask (in FCB format), 'long_mask' is the long
* file name mask. Either or both can be NULL.
*
* NOTE: This is supposed to be only called by the int21 emulation
* routines, and so assumes that the Win16Mutex is held to
* protect the static directory cache.
*/
int DOSFS_FindNext( const char *path, const char *short_mask,
const char *long_mask, int drive, BYTE attr,
int skip, WIN32_FIND_DATAA *entry )
{
static FIND_FIRST_INFO info;
LPCWSTR short_name, long_name;
int count;
UNICODE_STRING short_maskW, long_maskW;
WIN32_FIND_DATAW entryW;
TRACE("(%s, %s, %s, %x, %x, %x, %p)\n", debugstr_a(path),
debugstr_a(short_mask), debugstr_a(long_mask), drive, attr, skip,
entry);
RtlCreateUnicodeStringFromAsciiz(&short_maskW, short_mask);
RtlCreateUnicodeStringFromAsciiz(&long_maskW, long_mask);
/* Check the cached directory */
if (!(info.u.dos_dir && info.path == path && !strcmpW(info.short_mask, short_maskW.Buffer)
&& !strcmpW(info.long_mask, long_maskW.Buffer) && info.drive == drive
&& info.attr == attr && info.cur_pos <= skip))
{
/* Not in the cache, open it anew */
if (info.u.dos_dir) DOSFS_CloseDir( info.u.dos_dir );
info.path = (LPSTR)path;
RtlFreeHeap(GetProcessHeap(), 0, info.long_mask);
RtlFreeHeap(GetProcessHeap(), 0, info.short_mask);
info.long_mask = long_maskW.Buffer;
info.short_mask = short_maskW.Buffer;
info.attr = attr;
info.drive = drive;
info.cur_pos = 0;
info.u.dos_dir = DOSFS_OpenDir( info.path );
}
else
{
RtlFreeUnicodeString(&short_maskW);
RtlFreeUnicodeString(&long_maskW);
}
/* Skip to desired position */
while (info.cur_pos < skip)
if (info.u.dos_dir && DOSFS_ReadDir( info.u.dos_dir, &long_name, &short_name ))
info.cur_pos++;
else
break;
if (info.u.dos_dir && info.cur_pos == skip && DOSFS_FindNextEx( &info, &entryW ))
{
WideCharToMultiByte(CP_ACP, 0, entryW.cFileName, -1,
entry->cFileName, sizeof(entry->cFileName), NULL, NULL);
WideCharToMultiByte(CP_ACP, 0, entryW.cAlternateFileName, -1,
entry->cAlternateFileName, sizeof(entry->cAlternateFileName), NULL, NULL);
count = info.cur_pos - skip;
entry->dwFileAttributes = entryW.dwFileAttributes;
entry->nFileSizeHigh = entryW.nFileSizeHigh;
entry->nFileSizeLow = entryW.nFileSizeLow;
entry->ftCreationTime = entryW.ftCreationTime;
entry->ftLastAccessTime = entryW.ftLastAccessTime;
entry->ftLastWriteTime = entryW.ftLastWriteTime;
}
else
count = 0;
if (!count)
{
if (info.u.dos_dir) DOSFS_CloseDir( info.u.dos_dir );
memset( &info, '\0', sizeof(info) );
}
return count;
}
/*************************************************************************
* FindFirstFileExW (KERNEL32.@)
*/
......@@ -2048,8 +1907,6 @@ HANDLE WINAPI FindFirstFileExW(
info->long_mask = HeapAlloc( GetProcessHeap(), 0, long_mask_len * sizeof(WCHAR) );
MultiByteToWideChar(CP_UNIXCP, 0, p, -1, info->long_mask, long_mask_len);
info->short_mask = NULL;
info->attr = 0xff;
info->drive = full_name.drive;
info->cur_pos = 0;
......@@ -2469,13 +2326,3 @@ DWORD WINAPI QueryDosDeviceW(LPCWSTR devname,LPWSTR target,DWORD bufsize)
}
return ret;
}
/***********************************************************************
* DefineDosDeviceA (KERNEL32.@)
*/
BOOL WINAPI DefineDosDeviceA(DWORD flags,LPCSTR devname,LPCSTR targetpath) {
FIXME("(0x%08lx,%s,%s),stub!\n",flags,devname,targetpath);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
......@@ -1283,21 +1283,54 @@ int DRIVE_Enable( int drive )
/***********************************************************************
* DRIVE_SetLogicalMapping
* DefineDosDeviceA (KERNEL32.@)
*/
int DRIVE_SetLogicalMapping ( int existing_drive, int new_drive )
BOOL WINAPI DefineDosDeviceA(DWORD flags,LPCSTR devname,LPCSTR targetpath)
{
/* If new_drive is already valid, do nothing and return 0
otherwise, copy DOSDrives[existing_drive] to DOSDrives[new_drive] */
UNICODE_STRING d, t;
BOOL ret;
if (!RtlCreateUnicodeStringFromAsciiz(&d, devname))
{
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return FALSE;
}
if (!RtlCreateUnicodeStringFromAsciiz(&t, targetpath))
{
RtlFreeUnicodeString(&d);
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return FALSE;
}
ret = DefineDosDeviceW(flags, d.Buffer, t.Buffer);
RtlFreeUnicodeString(&d);
RtlFreeUnicodeString(&t);
return ret;
}
/***********************************************************************
* DefineDosDeviceA (KERNEL32.@)
*/
BOOL WINAPI DefineDosDeviceW(DWORD flags,LPCWSTR devname,LPCWSTR targetpath)
{
DOSDRIVE *old, *new;
old = DOSDrives + existing_drive;
new = DOSDrives + new_drive;
/* this is a temporary hack for int21 support. better implementation has to be done */
if (flags != DDD_RAW_TARGET_PATH ||
!(toupperW(devname[0]) >= 'A' && toupperW(devname[0]) <= 'Z') ||
devname[1] != ':' || devname[2] != 0 ||
!(toupperW(targetpath[0]) >= 'A' && toupperW(targetpath[0]) <= 'Z') ||
targetpath[1] != ':' || targetpath[2] != '\\' || targetpath[3] != 0)
{
FIXME("(0x%08lx,%s,%s),stub!\n", flags, debugstr_w(devname), debugstr_w(targetpath));
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
old = DOSDrives + devname[0] - 'A';
new = DOSDrives + targetpath[0] - 'A';
if ((existing_drive < 0) || (existing_drive >= MAX_DOS_DRIVES) ||
!old->root ||
(new_drive < 0) || (new_drive >= MAX_DOS_DRIVES))
if (!old->root)
{
SetLastError( ERROR_INVALID_DRIVE );
return 0;
......@@ -1306,7 +1339,7 @@ int DRIVE_SetLogicalMapping ( int existing_drive, int new_drive )
if ( new->root )
{
TRACE("Can't map drive %c: to already existing drive %c:\n",
'A' + existing_drive, 'A' + new_drive );
devname[0], targetpath[0] );
/* it is already mapped there, so return success */
if (!strcmp(old->root,new->root))
return 1;
......@@ -1327,7 +1360,7 @@ int DRIVE_SetLogicalMapping ( int existing_drive, int new_drive )
new->ino = old->ino;
TRACE("Drive %c: is now equal to drive %c:\n",
'A' + new_drive, 'A' + existing_drive );
targetpath[0], devname[0] );
return 1;
}
......@@ -2126,8 +2159,8 @@ BOOL WINAPI SetVolumeLabelA(LPCSTR root, LPCSTR volname)
/***********************************************************************
* GetVolumeNameForVolumeMountPointW (KERNEL32.@)
*/
DWORD WINAPI GetVolumeNameForVolumeMountPointW(LPWSTR str, DWORD a, DWORD b)
BOOL WINAPI GetVolumeNameForVolumeMountPointW(LPCWSTR str, LPWSTR dst, DWORD size)
{
FIXME("(%s, %lx, %lx): stub\n", debugstr_w(str), a, b);
FIXME("(%s, %p, %lx): stub\n", debugstr_w(str), dst, size);
return 0;
}
......@@ -51,7 +51,6 @@ extern UINT DRIVE_GetFlags( int drive );
extern int DRIVE_Chdir( int drive, LPCWSTR path );
extern int DRIVE_Disable( int drive );
extern int DRIVE_Enable( int drive );
extern int DRIVE_SetLogicalMapping ( int existing_drive, int new_drive );
extern int DRIVE_OpenDevice( int drive, int flags );
extern WCHAR *DRIVE_BuildEnv(void);
......
......@@ -97,9 +97,6 @@ extern BOOL DOSFS_FindUnixName( const DOS_FULL_NAME *path, LPCWSTR name, char *l
INT long_len, LPWSTR short_buf, BOOL ignore_case );
extern BOOL DOSFS_GetFullName( LPCWSTR name, BOOL check_last,
DOS_FULL_NAME *full );
extern int DOSFS_FindNext( const char *path, const char *short_mask,
const char *long_mask, int drive, BYTE attr,
int skip, WIN32_FIND_DATAA *entry );
/* win32/device.c */
extern HANDLE DEVICE_Open( LPCWSTR filename, DWORD access, LPSECURITY_ATTRIBUTES sa );
......
......@@ -44,7 +44,7 @@ typedef struct
BYTE search_attr; /* 0c search attributes */
WORD count; /* 0d entry count within directory */
WORD cluster; /* 0f cluster of parent directory */
char *unixPath; /* 11 unix path (was: reserved) */
WCHAR *fullPath; /* 11 full path (was: reserved) */
BYTE fileattr; /* 15 file attributes */
WORD filetime; /* 16 file time */
WORD filedate; /* 18 file date */
......@@ -58,7 +58,7 @@ typedef struct
BYTE drive; /* 00 drive letter */
char filename[11]; /* 01 filename 8+3 format */
int count; /* 0c entry count (was: reserved) */
char *unixPath; /* 10 unix path (was: reserved) */
WCHAR *fullPath; /* 10 full path (was: reserved) */
} FINDFILE_FCB;
/* DOS directory entry for FindFirstFCB/FindNextFCB */
......
......@@ -1090,6 +1090,13 @@ BOOL WINAPI GetBinaryTypeA( LPCSTR lpApplicationName, LPDWORD lpBinaryType );
BOOL WINAPI GetBinaryTypeW( LPCWSTR lpApplicationName, LPDWORD lpBinaryType );
#define GetBinaryType WINELIB_NAME_AW(GetBinaryType)
/* flags for DefineDosDevice */
#define DDD_RAW_TARGET_PATH 0x00000001
#define DDD_REMOVE_DEFINITION 0x00000002
#define DDD_EXACT_MATCH_ON_REMOVE 0x00000004
#define DDD_NO_BROADCAST_SYSTEM 0x00000008
#define DDD_LUID_BROADCAST_DRIVE 0x00000010
BOOL WINAPI AddAccessAllowedAce(PACL,DWORD,DWORD,PSID);
PVOID WINAPI AddVectoredExceptionHandler(ULONG,PVECTORED_EXCEPTION_HANDLER);
BOOL WINAPI AttachThreadInput(DWORD,DWORD,BOOL);
......@@ -1182,10 +1189,16 @@ BOOL WINAPI DebugActiveProcessStop(DWORD);
void WINAPI DebugBreak(void);
BOOL WINAPI DebugBreakProcess(HANDLE);
BOOL WINAPI DebugSetProcessKillOnExit(BOOL);
BOOL WINAPI DefineDosDeviceA(DWORD,LPCSTR,LPCSTR);
BOOL WINAPI DefineDosDeviceW(DWORD,LPCWSTR,LPCWSTR);
#define DefineDosDevice WINELIB_NAME_AW(DefineDosDevice)
BOOL WINAPI DeleteAce(PACL,DWORD);
void WINAPI DeleteFiber(LPVOID);
BOOL WINAPI DeleteTimerQueueEx(HANDLE,HANDLE);
BOOL WINAPI DeleteTimerQueueTimer(HANDLE,HANDLE,HANDLE);
BOOL WINAPI DeleteVolumeMountPointA(LPCSTR);
BOOL WINAPI DeleteVolumeMountPointW(LPCWSTR);
#define DeleteVolumeMountPoint WINELIB_NAME_AW(DeleteVolumeMountPoint)
BOOL WINAPI DeregisterEventSource(HANDLE);
BOOL WINAPI DeviceIoControl(HANDLE,DWORD,LPVOID,DWORD,LPVOID,DWORD,LPDWORD,LPOVERLAPPED);
BOOL WINAPI DisableThreadLibraryCalls(HMODULE);
......@@ -1224,6 +1237,20 @@ BOOL WINAPI FindCloseChangeNotification(HANDLE);
HRSRC WINAPI FindResourceExA(HMODULE,LPCSTR,LPCSTR,WORD);
HRSRC WINAPI FindResourceExW(HMODULE,LPCWSTR,LPCWSTR,WORD);
#define FindResourceEx WINELIB_NAME_AW(FindResourceEx)
HANDLE WINAPI FindFirstVolumeA(LPSTR,DWORD);
HANDLE WINAPI FindFirstVolumeW(LPWSTR,DWORD);
#define FindFirstVolume WINELIB_NAME_AW(FindFirstVolume)
HANDLE WINAPI FindFirstVolumeMountPointA(LPCSTR,LPSTR,DWORD);
HANDLE WINAPI FindFirstVolumeMountPointW(LPCWSTR,LPWSTR,DWORD);
#define FindFirstVolumeMountPoint WINELIB_NAME_AW(FindFirstVolumeMountPoint)
BOOL WINAPI FindNextVolumeA(HANDLE,LPSTR,DWORD);
BOOL WINAPI FindNextVolumeW(HANDLE,LPWSTR,DWORD);
#define FindNextVolume WINELIB_NAME_AW(FindNextVolume)
BOOL WINAPI FindNextVolumeMountPointA(HANDLE,LPSTR,DWORD);
BOOL WINAPI FindNextVolumeMountPointW(HANDLE,LPWSTR,DWORD);
#define FindNextVolumeMountPoint WINELIB_NAME_AW(FindNextVolumeMountPoint)
BOOL WINAPI FindVolumeClose(HANDLE);
BOOL WINAPI FindVolumeMountPointClose(HANDLE);
BOOL WINAPI FlushFileBuffers(HANDLE);
BOOL WINAPI FlushViewOfFile(LPCVOID,SIZE_T);
DWORD WINAPI FormatMessageA(DWORD,LPCVOID,DWORD,DWORD,LPSTR,DWORD,va_list*);
......@@ -1323,6 +1350,15 @@ BOOL WINAPI GetTokenInformation(HANDLE,TOKEN_INFORMATION_CLASS,LPVOID,DWO
BOOL WINAPI GetUserNameA(LPSTR,LPDWORD);
BOOL WINAPI GetUserNameW(LPWSTR,LPDWORD);
#define GetUserName WINELIB_NAME_AW(GetUserName)
BOOL WINAPI GetVolumeNameForVolumeMountPointA(LPCSTR,LPSTR,DWORD);
BOOL WINAPI GetVolumeNameForVolumeMountPointW(LPCWSTR,LPWSTR,DWORD);
#define GetVolumeNameForVolumeMountPoint WINELIB_NAME_AW(GetVolumeNameForVolumeMountPoint)
BOOL WINAPI GetVolumePathNameA(LPCSTR,LPSTR,DWORD);
BOOL WINAPI GetVolumePathNameW(LPCWSTR,LPWSTR,DWORD);
#define GetVolumePathName WINELIB_NAME_AW(GetVolumePathName)
BOOL WINAPI GetVolumePathNamesForVolumeNameA(LPCSTR,LPSTR,DWORD,PDWORD);
BOOL WINAPI GetVolumePathNamesForVolumeNameW(LPCWSTR,LPWSTR,DWORD,PDWORD);
#define GetVolumePathNamesForVolumeName WINELIB_NAME_AW(GetVolumePathNamesForVolumeName)
VOID WINAPI GlobalMemoryStatus(LPMEMORYSTATUS);
LPVOID WINAPI HeapAlloc(HANDLE,DWORD,SIZE_T);
SIZE_T WINAPI HeapCompact(HANDLE,DWORD);
......@@ -1473,6 +1509,9 @@ BOOL WINAPI SetThreadPriority(HANDLE,INT);
BOOL WINAPI SetThreadPriorityBoost(HANDLE,BOOL);
BOOL WINAPI SetThreadToken(PHANDLE,HANDLE);
BOOL WINAPI SetTimeZoneInformation(const LPTIME_ZONE_INFORMATION);
BOOL WINAPI SetVolumeMountPointA(LPCSTR,LPCSTR);
BOOL WINAPI SetVolumeMountPointW(LPCSTR,LPCSTR);
#define SetVolumeMountPoint WINELIB_NAME_AW(SetVolumeMountPoint)
BOOL WINAPI SetWaitableTimer(HANDLE,const LARGE_INTEGER*,LONG,PTIMERAPCROUTINE,LPVOID,BOOL);
BOOL WINAPI SetupComm(HANDLE,DWORD,DWORD);
DWORD WINAPI SignalObjectAndWait(HANDLE,HANDLE,DWORD,BOOL);
......
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