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
5bf3a266
Commit
5bf3a266
authored
Jan 05, 2004
by
Eric Pouech
Committed by
Alexandre Julliard
Jan 05, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made wine_get_unix_file_name take a Unicode string pointer.
parent
a938cbeb
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
36 additions
and
34 deletions
+36
-34
freetype.c
dlls/gdi/freetype.c
+16
-19
printdrv.c
dlls/gdi/printdrv.c
+3
-1
kernel32.spec
dlls/kernel/kernel32.spec
+1
-1
dosconf.c
dlls/winedos/dosconf.c
+6
-5
dos_fs.c
files/dos_fs.c
+1
-4
winbase.h
include/winbase.h
+1
-1
winemenubuilder.c
programs/winemenubuilder/winemenubuilder.c
+3
-1
winepath.c
programs/winepath/winepath.c
+5
-2
No files found.
dlls/gdi/freetype.c
View file @
5bf3a266
...
...
@@ -618,7 +618,7 @@ static void LoadReplaceList(void)
}
static
BOOL
ReadFontDir
(
char
*
dirname
)
static
BOOL
ReadFontDir
(
c
onst
c
har
*
dirname
)
{
DIR
*
dir
;
struct
dirent
*
dent
;
...
...
@@ -724,17 +724,13 @@ INT WineEngAddFontResourceEx(LPCWSTR file, DWORD flags, PVOID pdv)
{
if
(
ft_handle
)
/* do it only if we have freetype up and running */
{
DWORD
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
file
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
LPSTR
fileA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
char
unixname
[
MAX_PATH
];
WideCharToMultiByte
(
CP_ACP
,
0
,
file
,
-
1
,
fileA
,
len
,
NULL
,
NULL
);
if
(
flags
)
FIXME
(
"Ignoring flags %lx
\n
"
,
flags
);
if
(
wine_get_unix_file_name
(
file
A
,
unixname
,
sizeof
(
unixname
)))
if
(
wine_get_unix_file_name
(
file
,
unixname
,
sizeof
(
unixname
)))
AddFontFileToList
(
unixname
,
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
fileA
);
}
return
1
;
}
...
...
@@ -756,11 +752,11 @@ BOOL WineEngRemoveFontResourceEx(LPCWSTR file, DWORD flags, PVOID pdv)
*/
BOOL
WineEngInit
(
void
)
{
static
const
WCHAR
fontsW
[]
=
{
'\\'
,
'F'
,
'o'
,
'n'
,
't'
,
's'
,
'\0'
};
HKEY
hkey
;
DWORD
valuelen
,
datalen
,
i
=
0
,
type
,
dlen
,
vlen
;
LPSTR
value
;
LPVOID
data
;
char
windowsdir
[
MAX_PATH
];
WCHAR
windowsdir
[
MAX_PATH
];
char
unixname
[
MAX_PATH
];
TRACE
(
"
\n
"
);
...
...
@@ -826,8 +822,8 @@ BOOL WineEngInit(void)
TRACE
(
"FreeType version is %d.%d.%d
\n
"
,
FT_Version
.
major
,
FT_Version
.
minor
,
FT_Version
.
patch
);
/* load in the fonts from %WINDOWSDIR%\\Fonts first of all */
GetWindowsDirectory
A
(
windowsdir
,
sizeof
(
windowsdir
));
strcat
(
windowsdir
,
"
\\
Fonts"
);
GetWindowsDirectory
W
(
windowsdir
,
sizeof
(
windowsdir
)
/
sizeof
(
WCHAR
));
strcat
W
(
windowsdir
,
fontsW
);
if
(
wine_get_unix_file_name
(
windowsdir
,
unixname
,
sizeof
(
unixname
)))
ReadFontDir
(
unixname
);
...
...
@@ -837,19 +833,20 @@ BOOL WineEngInit(void)
if
(
RegOpenKeyA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
Fonts"
,
&
hkey
)
==
ERROR_SUCCESS
)
{
RegQueryInfoKeyA
(
hkey
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
LPWSTR
valueW
;
RegQueryInfoKeyW
(
hkey
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
&
valuelen
,
&
datalen
,
NULL
,
NULL
);
valuelen
++
;
/* returned value doesn't include room for '\0' */
value
=
HeapAlloc
(
GetProcessHeap
(),
0
,
valuelen
);
data
=
HeapAlloc
(
GetProcessHeap
(),
0
,
datalen
);
value
W
=
HeapAlloc
(
GetProcessHeap
(),
0
,
valuelen
*
sizeof
(
WCHAR
)
);
data
=
HeapAlloc
(
GetProcessHeap
(),
0
,
datalen
*
sizeof
(
WCHAR
)
);
dlen
=
datalen
;
dlen
=
datalen
*
sizeof
(
WCHAR
)
;
vlen
=
valuelen
;
while
(
RegEnumValue
A
(
hkey
,
i
++
,
value
,
&
vlen
,
NULL
,
&
type
,
data
,
while
(
RegEnumValue
W
(
hkey
,
i
++
,
valueW
,
&
vlen
,
NULL
,
&
type
,
data
,
&
dlen
)
==
ERROR_SUCCESS
)
{
if
(((
LP
STR
)
data
)[
0
]
&&
((
LP
STR
)
data
)[
1
]
==
':'
)
if
(
wine_get_unix_file_name
((
LPSTR
)
data
,
unixname
,
sizeof
(
unixname
)))
if
(((
LP
WSTR
)
data
)[
0
]
&&
((
LPW
STR
)
data
)[
1
]
==
':'
)
if
(
wine_get_unix_file_name
((
LP
W
STR
)
data
,
unixname
,
sizeof
(
unixname
)))
AddFontFileToList
(
unixname
,
NULL
);
/* reset dlen and vlen */
...
...
@@ -857,7 +854,7 @@ BOOL WineEngInit(void)
vlen
=
valuelen
;
}
HeapFree
(
GetProcessHeap
(),
0
,
data
);
HeapFree
(
GetProcessHeap
(),
0
,
value
);
HeapFree
(
GetProcessHeap
(),
0
,
value
W
);
RegCloseKey
(
hkey
);
}
...
...
@@ -867,7 +864,7 @@ BOOL WineEngInit(void)
if
(
RegOpenKeyA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
Wine
\\
Config
\\
FontDirs"
,
&
hkey
)
==
ERROR_SUCCESS
)
{
LPSTR
value
;
RegQueryInfoKeyA
(
hkey
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
&
valuelen
,
&
datalen
,
NULL
,
NULL
);
...
...
dlls/gdi/printdrv.c
View file @
5bf3a266
...
...
@@ -511,6 +511,7 @@ static int CreateSpoolFile(LPCSTR pszOutput)
else
{
char
buffer
[
MAX_PATH
];
WCHAR
psCmdPW
[
MAX_PATH
];
TRACE
(
"Just assume it's a file
\n
"
);
...
...
@@ -518,7 +519,8 @@ static int CreateSpoolFile(LPCSTR pszOutput)
* The file name can be dos based, we have to find its
* Unix correspondant file name
*/
wine_get_unix_file_name
(
psCmdP
,
buffer
,
sizeof
(
buffer
));
MultiByteToWideChar
(
CP_ACP
,
0
,
psCmdP
,
-
1
,
psCmdPW
,
MAX_PATH
);
wine_get_unix_file_name
(
psCmdPW
,
buffer
,
sizeof
(
buffer
));
if
((
fd
=
open
(
buffer
,
O_CREAT
|
O_TRUNC
|
O_WRONLY
,
0600
))
<
0
)
{
...
...
dlls/kernel/kernel32.spec
View file @
5bf3a266
...
...
@@ -1132,7 +1132,7 @@
@ varargs __wine_call_from_16_regs()
# Unix files
@ stdcall wine_get_unix_file_name(str ptr long)
@ stdcall wine_get_unix_file_name(
w
str ptr long)
# Init code
@ cdecl __wine_kernel_init()
...
...
dlls/winedos/dosconf.c
View file @
5bf3a266
...
...
@@ -456,13 +456,14 @@ static void DOSCONF_Parse(char *menuname)
DOSCONF
*
DOSCONF_GetConfig
(
void
)
{
HKEY
hkey
;
CHAR
filename
[
MAX_PATH
];
WCHAR
filename
[
MAX_PATH
];
static
const
WCHAR
configW
[]
=
{
'c'
,
'o'
,
'n'
,
'f'
,
'i'
,
'g'
,
'.'
,
's'
,
'y'
,
's'
,
0
};
if
(
DOSCONF_loaded
)
return
&
DOSCONF_config
;
/* default value */
strcpy
(
filename
,
"*"
)
;
filename
[
0
]
=
'*'
;
filename
[
1
]
=
'\0'
;
if
(
!
RegOpenKeyA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
Wine
\\
Config
\\
wine"
,
...
...
@@ -471,11 +472,11 @@ DOSCONF *DOSCONF_GetConfig(void)
DWORD
type
;
DWORD
count
=
sizeof
(
filename
);
RegQueryValueEx
A
(
hkey
,
"config.sys"
,
0
,
&
type
,
filename
,
&
count
);
RegQueryValueEx
W
(
hkey
,
configW
,
0
,
&
type
,
(
LPBYTE
)
filename
,
&
count
);
RegCloseKey
(
hkey
);
}
if
(
strcmp
(
filename
,
"*"
)
&&
*
filename
!=
'\0'
)
if
(
(
filename
[
0
]
!=
'*'
||
filename
[
1
]
!=
'\0'
)
&&
*
filename
!=
'\0'
)
{
CHAR
fullname
[
MAX_PATH
];
...
...
@@ -492,7 +493,7 @@ DOSCONF *DOSCONF_GetConfig(void)
{
WARN
(
"Couldn't open config.sys file given as %s in"
" configuration file, section [wine]!
\n
"
,
filename
);
debugstr_w
(
filename
)
);
}
}
...
...
files/dos_fs.c
View file @
5bf3a266
...
...
@@ -1697,15 +1697,12 @@ DWORD WINAPI GetFullPathNameW( LPCWSTR name, DWORD len, LPWSTR buffer,
* wine_get_unix_file_name (KERNEL32.@) Not a Windows API
*
* Return the full Unix file name for a given path.
* FIXME: convert dos file name to unicode
*/
BOOL
WINAPI
wine_get_unix_file_name
(
LPC
STR
dos
,
LPSTR
buffer
,
DWORD
len
)
BOOL
WINAPI
wine_get_unix_file_name
(
LPC
WSTR
dosW
,
LPSTR
buffer
,
DWORD
len
)
{
BOOL
ret
;
DOS_FULL_NAME
path
;
WCHAR
dosW
[
MAX_PATHNAME_LEN
];
MultiByteToWideChar
(
CP_ACP
,
0
,
dos
,
-
1
,
dosW
,
MAX_PATHNAME_LEN
);
ret
=
DOSFS_GetFullName
(
dosW
,
FALSE
,
&
path
);
if
(
ret
&&
len
)
{
...
...
include/winbase.h
View file @
5bf3a266
...
...
@@ -1868,7 +1868,7 @@ VOID WINAPI _LeaveSysLevel(SYSLEVEL*);
/* Wine internal functions */
BOOL
WINAPI
wine_get_unix_file_name
(
LPCSTR
dos
,
LPSTR
buffer
,
DWORD
len
);
BOOL
WINAPI
wine_get_unix_file_name
(
LPC
W
STR
dos
,
LPSTR
buffer
,
DWORD
len
);
/* a few optimizations for i386/gcc */
...
...
programs/winemenubuilder/winemenubuilder.c
View file @
5bf3a266
...
...
@@ -325,9 +325,11 @@ static BOOL ExtractFromEXEDLL(const char *szFileName, int nIndex, const char *sz
/* get the Unix file name for a given path, allocating the string */
inline
static
char
*
get_unix_file_name
(
const
char
*
dos
)
{
WCHAR
dosW
[
MAX_PATH
];
char
buffer
[
MAX_PATH
],
*
ret
;
if
(
!
wine_get_unix_file_name
(
dos
,
buffer
,
sizeof
(
buffer
)
))
return
NULL
;
MultiByteToWideChar
(
CP_ACP
,
0
,
dos
,
-
1
,
dosW
,
MAX_PATH
);
if
(
!
wine_get_unix_file_name
(
dosW
,
buffer
,
sizeof
(
buffer
)
))
return
NULL
;
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
lstrlenA
(
buffer
)
+
1
);
lstrcpyA
(
ret
,
buffer
);
return
ret
;
...
...
programs/winepath/winepath.c
View file @
5bf3a266
...
...
@@ -36,7 +36,7 @@ static char *progname;
/* Wine specific functions */
extern
BOOL
process_init
(
char
*
argv
[]);
typedef
BOOL
(
WINAPI
*
wine_get_unix_file_name_t
)
(
LPCSTR
dos
,
LPSTR
buffer
,
DWORD
len
);
typedef
BOOL
(
WINAPI
*
wine_get_unix_file_name_t
)
(
LPC
W
STR
dos
,
LPSTR
buffer
,
DWORD
len
);
/*
* handle an option
*/
...
...
@@ -161,7 +161,10 @@ int main(int argc, char *argv[])
printf
(
"%s
\n
"
,
path
);
}
if
(
outputformats
&
UNIXFORMAT
)
{
wine_get_unix_file_name_ptr
(
argv
[
i
],
path
,
sizeof
(
path
));
WCHAR
dosW
[
MAX_PATH
];
MultiByteToWideChar
(
CP_ACP
,
0
,
argv
[
i
],
-
1
,
dosW
,
MAX_PATH
);
wine_get_unix_file_name_ptr
(
dosW
,
path
,
sizeof
(
path
));
printf
(
"%s
\n
"
,
path
);
}
}
...
...
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