Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
1a87dc42
Commit
1a87dc42
authored
Feb 24, 2004
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed some of the DOS device hacks (based on a patch by Eric
Pouech).
parent
0511d335
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
88 deletions
+23
-88
kernel32.spec
dlls/kernel/kernel32.spec
+0
-1
directory.c
files/directory.c
+2
-2
dos_fs.c
files/dos_fs.c
+18
-72
file.c
files/file.c
+3
-3
file.h
include/file.h
+0
-10
No files found.
dlls/kernel/kernel32.spec
View file @
1a87dc42
...
...
@@ -1152,7 +1152,6 @@
################################################################
# Wine dll separation hacks, these will go away, don't use them
#
@ cdecl DOSFS_GetDeviceByHandle(long)
@ cdecl DOSMEM_AllocSelector(long)
@ cdecl DOSMEM_Available()
@ cdecl DOSMEM_FreeBlock(ptr)
...
...
files/directory.c
View file @
1a87dc42
...
...
@@ -531,7 +531,7 @@ BOOL WINAPI CreateDirectoryW( LPCWSTR path,
TRACE_
(
file
)(
"(%s,%p)
\n
"
,
debugstr_w
(
path
),
lpsecattribs
);
if
(
DOSFS_GetDevice
(
path
))
if
(
RtlIsDosDeviceName_U
(
path
))
{
TRACE_
(
file
)(
"cannot use device %s!
\n
"
,
debugstr_w
(
path
));
SetLastError
(
ERROR_ACCESS_DENIED
);
...
...
@@ -630,7 +630,7 @@ BOOL WINAPI RemoveDirectoryW( LPCWSTR path )
TRACE_
(
file
)(
"%s
\n
"
,
debugstr_w
(
path
));
if
(
DOSFS_GetDevice
(
path
))
if
(
RtlIsDosDeviceName_U
(
path
))
{
TRACE_
(
file
)(
"cannot remove device %s!
\n
"
,
debugstr_w
(
path
));
SetLastError
(
ERROR_FILE_NOT_FOUND
);
...
...
files/dos_fs.c
View file @
1a87dc42
...
...
@@ -94,24 +94,27 @@ typedef struct
/* Chars we don't want to see in DOS file names */
#define INVALID_DOS_CHARS "*?<>|\"+=,;[] \345"
/* DOS device descriptor */
typedef
struct
{
const
WCHAR
name
[
5
];
}
DOS_DEVICE
;
static
const
DOS_DEVICE
DOSFS_Devices
[]
=
/* name, device flags (see Int 21/AX=0x4400) */
{
{
{
'C'
,
'O'
,
'N'
,
0
},
0xc0d3
},
{
{
'P'
,
'R'
,
'N'
,
0
},
0xa0c0
},
{
{
'N'
,
'U'
,
'L'
,
0
},
0x80c4
},
{
{
'A'
,
'U'
,
'X'
,
0
},
0x80c0
},
{
{
'L'
,
'P'
,
'T'
,
'1'
,
0
},
0xa0c0
},
{
{
'L'
,
'P'
,
'T'
,
'2'
,
0
},
0xa0c0
},
{
{
'L'
,
'P'
,
'T'
,
'3'
,
0
},
0xa0c0
},
{
{
'L'
,
'P'
,
'T'
,
'4'
,
0
},
0xc0d3
},
{
{
'C'
,
'O'
,
'M'
,
'1'
,
0
},
0x80c0
},
{
{
'C'
,
'O'
,
'M'
,
'2'
,
0
},
0x80c0
},
{
{
'C'
,
'O'
,
'M'
,
'3'
,
0
},
0x80c0
},
{
{
'C'
,
'O'
,
'M'
,
'4'
,
0
},
0x80c0
},
{
{
'S'
,
'C'
,
'S'
,
'I'
,
'M'
,
'G'
,
'R'
,
'$'
,
0
},
0xc0c0
},
{
{
'H'
,
'P'
,
'S'
,
'C'
,
'A'
,
'N'
,
0
},
0xc0c0
},
{
{
'E'
,
'M'
,
'M'
,
'X'
,
'X'
,
'X'
,
'X'
,
'0'
,
0
},
0x0000
}
{
{
'C'
,
'O'
,
'N'
,
0
}
},
{
{
'P'
,
'R'
,
'N'
,
0
}
},
{
{
'N'
,
'U'
,
'L'
,
0
}
},
{
{
'A'
,
'U'
,
'X'
,
0
}
},
{
{
'L'
,
'P'
,
'T'
,
'1'
,
0
}
},
{
{
'L'
,
'P'
,
'T'
,
'2'
,
0
}
},
{
{
'L'
,
'P'
,
'T'
,
'3'
,
0
}
},
{
{
'L'
,
'P'
,
'T'
,
'4'
,
0
}
},
{
{
'C'
,
'O'
,
'M'
,
'1'
,
0
}
},
{
{
'C'
,
'O'
,
'M'
,
'2'
,
0
}
},
{
{
'C'
,
'O'
,
'M'
,
'3'
,
0
}
},
{
{
'C'
,
'O'
,
'M'
,
'4'
,
0
}
}
};
static
const
WCHAR
devW
[]
=
{
'\\'
,
'D'
,
'e'
,
'v'
,
'i'
,
'c'
,
'e'
,
'\\'
,
0
};
...
...
@@ -804,54 +807,6 @@ BOOL DOSFS_FindUnixName( const DOS_FULL_NAME *path, LPCWSTR name, char *long_buf
}
/***********************************************************************
* DOSFS_GetDevice
*
* Check if a DOS file name represents a DOS device and return the device.
*/
const
DOS_DEVICE
*
DOSFS_GetDevice
(
LPCWSTR
name
)
{
unsigned
int
i
;
const
WCHAR
*
p
;
if
(
!
name
)
return
NULL
;
/* if wine_server_handle_to_fd was used */
if
(
name
[
0
]
&&
(
name
[
1
]
==
':'
))
name
+=
2
;
if
((
p
=
strrchrW
(
name
,
'/'
)))
name
=
p
+
1
;
if
((
p
=
strrchrW
(
name
,
'\\'
)))
name
=
p
+
1
;
for
(
i
=
0
;
i
<
sizeof
(
DOSFS_Devices
)
/
sizeof
(
DOSFS_Devices
[
0
]);
i
++
)
{
const
WCHAR
*
dev
=
DOSFS_Devices
[
i
].
name
;
if
(
!
strncmpiW
(
dev
,
name
,
strlenW
(
dev
)
))
{
p
=
name
+
strlenW
(
dev
);
if
(
!*
p
||
(
*
p
==
'.'
)
||
(
*
p
==
':'
))
return
&
DOSFS_Devices
[
i
];
}
}
return
NULL
;
}
/***********************************************************************
* DOSFS_GetDeviceByHandle
*/
const
DOS_DEVICE
*
DOSFS_GetDeviceByHandle
(
HANDLE
hFile
)
{
const
DOS_DEVICE
*
ret
=
NULL
;
SERVER_START_REQ
(
get_device_id
)
{
req
->
handle
=
hFile
;
if
(
!
wine_server_call
(
req
))
{
if
((
reply
->
id
>=
0
)
&&
(
reply
->
id
<
sizeof
(
DOSFS_Devices
)
/
sizeof
(
DOSFS_Devices
[
0
])))
ret
=
&
DOSFS_Devices
[
reply
->
id
];
}
}
SERVER_END_REQ
;
return
ret
;
}
/**************************************************************************
* DOSFS_CreateCommPort
*/
...
...
@@ -941,9 +896,6 @@ HANDLE DOSFS_OpenDevice( LPCWSTR name, DWORD access, DWORD attributes, LPSECURIT
if
(
!*
p
||
(
*
p
==
'.'
)
||
(
*
p
==
':'
))
{
static
const
WCHAR
nulW
[]
=
{
'N'
,
'U'
,
'L'
,
0
};
static
const
WCHAR
conW
[]
=
{
'C'
,
'O'
,
'N'
,
0
};
static
const
WCHAR
scsimgrW
[]
=
{
'S'
,
'C'
,
'S'
,
'I'
,
'M'
,
'G'
,
'R'
,
'$'
,
0
};
static
const
WCHAR
hpscanW
[]
=
{
'H'
,
'P'
,
'S'
,
'C'
,
'A'
,
'N'
,
0
};
static
const
WCHAR
emmxxxx0W
[]
=
{
'E'
,
'M'
,
'M'
,
'X'
,
'X'
,
'X'
,
'X'
,
'0'
,
0
};
/* got it */
if
(
!
strcmpiW
(
DOSFS_Devices
[
i
].
name
,
nulW
))
return
FILE_CreateFile
(
"/dev/null"
,
access
,
...
...
@@ -969,12 +921,6 @@ HANDLE DOSFS_OpenDevice( LPCWSTR name, DWORD access, DWORD attributes, LPSECURIT
handle
=
0
;
return
handle
;
}
if
(
!
strcmpiW
(
DOSFS_Devices
[
i
].
name
,
scsimgrW
)
||
!
strcmpiW
(
DOSFS_Devices
[
i
].
name
,
hpscanW
)
||
!
strcmpiW
(
DOSFS_Devices
[
i
].
name
,
emmxxxx0W
))
{
return
FILE_CreateDevice
(
i
,
access
,
sa
);
}
if
(
(
handle
=
DOSFS_CreateCommPort
(
DOSFS_Devices
[
i
].
name
,
access
,
attributes
,
sa
))
)
return
handle
;
...
...
files/file.c
View file @
1a87dc42
...
...
@@ -395,7 +395,7 @@ HANDLE WINAPI CreateFileW( LPCWSTR filename, DWORD access, DWORD sharing,
ret
=
FILE_CreateDevice
(
(
toupperW
(
filename
[
4
])
-
'A'
)
|
0x20000
,
access
,
sa
);
goto
done
;
}
else
if
(
!
DOSFS_GetDevice
(
filename
))
else
if
(
!
RtlIsDosDeviceName_U
(
filename
))
{
ret
=
VXD_Open
(
filename
+
4
,
access
,
sa
);
goto
done
;
...
...
@@ -425,7 +425,7 @@ HANDLE WINAPI CreateFileW( LPCWSTR filename, DWORD access, DWORD sharing,
goto
done
;
}
if
(
DOSFS_GetDevice
(
filename
))
if
(
RtlIsDosDeviceName_U
(
filename
))
{
TRACE
(
"opening device %s
\n
"
,
debugstr_w
(
filename
)
);
...
...
@@ -1408,7 +1408,7 @@ BOOL WINAPI DeleteFileW( LPCWSTR path )
SetLastError
(
ERROR_PATH_NOT_FOUND
);
return
FALSE
;
}
if
(
DOSFS_GetDevice
(
path
))
if
(
RtlIsDosDeviceName_U
(
path
))
{
WARN
(
"cannot remove DOS device %s!
\n
"
,
debugstr_w
(
path
));
SetLastError
(
ERROR_FILE_NOT_FOUND
);
...
...
include/file.h
View file @
1a87dc42
...
...
@@ -45,14 +45,6 @@ typedef struct
#define IS_END_OF_NAME(ch) (!(ch) || ((ch) == '/') || ((ch) == '\\'))
/* DOS device descriptor */
typedef
struct
{
const
WCHAR
name
[
9
];
int
flags
;
UINT
codepage
;
}
DOS_DEVICE
;
/* locale-independent case conversion */
inline
static
char
FILE_tolower
(
char
c
)
{
...
...
@@ -89,8 +81,6 @@ extern DWORD DIR_SearchPath( LPCWSTR path, LPCWSTR name, LPCWSTR ext,
/* files/dos_fs.c */
extern
BOOL
DOSFS_ToDosFCBFormat
(
LPCWSTR
name
,
LPWSTR
buffer
);
extern
const
DOS_DEVICE
*
DOSFS_GetDevice
(
LPCWSTR
name
);
extern
const
DOS_DEVICE
*
DOSFS_GetDeviceByHandle
(
HANDLE
hFile
);
extern
HANDLE
DOSFS_OpenDevice
(
LPCWSTR
name
,
DWORD
access
,
DWORD
attributes
,
LPSECURITY_ATTRIBUTES
sa
);
extern
BOOL
DOSFS_FindUnixName
(
const
DOS_FULL_NAME
*
path
,
LPCWSTR
name
,
char
*
long_buf
,
INT
long_len
,
LPWSTR
short_buf
,
BOOL
ignore_case
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment