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
a0ef8845
Commit
a0ef8845
authored
Jan 10, 2013
by
Piotr Caban
Committed by
Alexandre Julliard
Jan 10, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Added unicode modes support _setmode function.
parent
eeb7d0a6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
7 deletions
+24
-7
file.c
dlls/msvcrt/file.c
+24
-7
No files found.
dlls/msvcrt/file.c
View file @
a0ef8845
...
@@ -2232,14 +2232,31 @@ int CDECL MSVCRT__read(int fd, void *buf, unsigned int count)
...
@@ -2232,14 +2232,31 @@ int CDECL MSVCRT__read(int fd, void *buf, unsigned int count)
*/
*/
int
CDECL
MSVCRT__setmode
(
int
fd
,
int
mode
)
int
CDECL
MSVCRT__setmode
(
int
fd
,
int
mode
)
{
{
int
ret
=
msvcrt_get_ioinfo
(
fd
)
->
wxflag
&
WX_TEXT
?
MSVCRT__O_TEXT
:
MSVCRT__O_BINARY
;
int
ret
=
msvcrt_get_ioinfo
(
fd
)
->
wxflag
&
WX_TEXT
?
MSVCRT__O_TEXT
:
MSVCRT__O_BINARY
;
if
(
mode
&
(
~
(
MSVCRT__O_TEXT
|
MSVCRT__O_BINARY
)))
if
(
ret
==
MSVCRT__O_TEXT
&&
(
msvcrt_get_ioinfo
(
fd
)
->
exflag
&
(
EF_UTF8
|
EF_UTF16
)))
FIXME
(
"fd (%d) mode (0x%08x) unknown
\n
"
,
fd
,
mode
);
ret
=
MSVCRT__O_WTEXT
;
if
((
mode
&
MSVCRT__O_TEXT
)
==
MSVCRT__O_TEXT
)
if
(
mode
!=
MSVCRT__O_TEXT
&&
mode
!=
MSVCRT__O_BINARY
&&
mode
!=
MSVCRT__O_WTEXT
&&
mode
!=
MSVCRT__O_U16TEXT
&&
mode
!=
MSVCRT__O_U8TEXT
)
{
*
MSVCRT__errno
()
=
MSVCRT_EINVAL
;
return
-
1
;
}
if
(
mode
==
MSVCRT__O_BINARY
)
{
msvcrt_get_ioinfo
(
fd
)
->
wxflag
&=
~
WX_TEXT
;
msvcrt_get_ioinfo
(
fd
)
->
exflag
&=
~
(
EF_UTF8
|
EF_UTF16
);
return
ret
;
}
msvcrt_get_ioinfo
(
fd
)
->
wxflag
|=
WX_TEXT
;
msvcrt_get_ioinfo
(
fd
)
->
wxflag
|=
WX_TEXT
;
else
if
(
mode
==
MSVCRT__O_TEXT
)
msvcrt_get_ioinfo
(
fd
)
->
wxflag
&=
~
WX_TEXT
;
msvcrt_get_ioinfo
(
fd
)
->
exflag
&=
~
(
EF_UTF8
|
EF_UTF16
);
return
ret
;
else
if
(
mode
==
MSVCRT__O_U8TEXT
)
msvcrt_get_ioinfo
(
fd
)
->
exflag
=
(
msvcrt_get_ioinfo
(
fd
)
->
exflag
&
~
EF_UTF16
)
|
EF_UTF8
;
else
msvcrt_get_ioinfo
(
fd
)
->
exflag
=
(
msvcrt_get_ioinfo
(
fd
)
->
exflag
&
~
EF_UTF8
)
|
EF_UTF16
;
return
ret
;
}
}
/*********************************************************************
/*********************************************************************
...
...
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