Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
cca5b4a1
Commit
cca5b4a1
authored
4 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
winecfg: Use Windows paths to load the library list.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2f5a3fa1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
programs/winecfg/libraries.c
+37
-28
37 additions, 28 deletions
programs/winecfg/libraries.c
with
37 additions
and
28 deletions
programs/winecfg/libraries.c
+
37
−
28
View file @
cca5b4a1
...
...
@@ -26,7 +26,6 @@
#define WIN32_LEAN_AND_MEAN
#include
<windows.h>
#include
<commdlg.h>
#include
<wine/library.h>
#include
<wine/debug.h>
#include
<stdio.h>
#include
<dirent.h>
...
...
@@ -254,33 +253,39 @@ static void clear_settings(HWND dialog)
static
void
load_library_list_from_dir
(
HWND
dialog
,
const
char
*
dir_path
,
int
check_subdirs
)
{
static
const
char
*
const
ext
[]
=
{
".dll"
,
".dll.so"
,
".so"
,
""
};
char
*
buffer
=
NULL
,
name
[
256
];
char
*
buffer
,
*
p
,
name
[
256
];
unsigned
int
i
;
struct
dirent
*
d
e
;
DIR
*
dir
=
opendir
(
dir_path
)
;
HANDLE
handl
e
;
WIN32_FIND_DATAA
data
;
if
(
!
dir
)
return
;
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
dir_path
)
+
2
*
sizeof
(
name
)
+
10
)
;
if
(
check_subdirs
)
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
dir_path
)
+
2
*
sizeof
(
name
)
+
10
);
strcpy
(
buffer
,
dir_path
);
strcat
(
buffer
,
"
\\
*"
);
buffer
[
1
]
=
'\\'
;
/* change \??\ to \\?\ */
p
=
buffer
+
strlen
(
buffer
)
-
1
;
while
((
de
=
readdir
(
dir
))
)
if
((
handle
=
FindFirstFileA
(
buffer
,
&
data
))
==
INVALID_HANDLE_VALUE
)
{
size_t
len
=
strlen
(
de
->
d_name
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
return
;
}
do
{
size_t
len
=
strlen
(
data
.
cFileName
);
if
(
len
>
sizeof
(
name
))
continue
;
if
(
check_subdirs
)
{
struct
stat
st
;
if
(
!
strcmp
(
de
->
d_name
,
"."
))
continue
;
if
(
!
strcmp
(
de
->
d_name
,
".."
))
continue
;
if
(
!
show_dll_in_list
(
de
->
d_name
))
continue
;
if
(
!
strcmp
(
data
.
cFileName
,
"."
))
continue
;
if
(
!
strcmp
(
data
.
cFileName
,
".."
))
continue
;
if
(
!
show_dll_in_list
(
data
.
cFileName
))
continue
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
ext
);
i
++
)
{
sprintf
(
buffer
,
"%s
/%s/
%s%s"
,
d
ir_path
,
de
->
d_name
,
de
->
d_n
ame
,
ext
[
i
]
);
if
(
!
stat
(
buffer
,
&
st
)
)
sprintf
(
p
,
"%s
\\
%s%s"
,
d
ata
.
cFileName
,
data
.
cFileN
ame
,
ext
[
i
]
);
if
(
GetFileAttributesA
(
buffer
)
!=
INVALID_FILE_ATTRIBUTES
)
{
SendDlgItemMessageA
(
dialog
,
IDC_DLLCOMBO
,
CB_ADDSTRING
,
0
,
(
LPARAM
)
d
e
->
d_n
ame
);
SendDlgItemMessageA
(
dialog
,
IDC_DLLCOMBO
,
CB_ADDSTRING
,
0
,
(
LPARAM
)
d
ata
.
cFileN
ame
);
break
;
}
}
...
...
@@ -290,18 +295,19 @@ static void load_library_list_from_dir( HWND dialog, const char *dir_path, int c
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
ext
);
i
++
)
{
if
(
!
ext
[
i
][
0
])
continue
;
if
(
len
>
strlen
(
ext
[
i
])
&&
!
strcmp
(
d
e
->
d_n
ame
+
len
-
strlen
(
ext
[
i
]),
ext
[
i
]))
if
(
len
>
strlen
(
ext
[
i
])
&&
!
strcmp
(
d
ata
.
cFileN
ame
+
len
-
strlen
(
ext
[
i
]),
ext
[
i
]))
{
len
-=
strlen
(
ext
[
i
]
);
memcpy
(
name
,
d
e
->
d_n
ame
,
len
);
memcpy
(
name
,
d
ata
.
cFileN
ame
,
len
);
name
[
len
]
=
0
;
if
(
!
show_dll_in_list
(
name
))
continue
;
SendDlgItemMessageA
(
dialog
,
IDC_DLLCOMBO
,
CB_ADDSTRING
,
0
,
(
LPARAM
)
name
);
}
}
}
}
closedir
(
dir
);
}
while
(
FindNextFileA
(
handle
,
&
data
));
FindClose
(
handle
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
}
...
...
@@ -309,21 +315,24 @@ static void load_library_list_from_dir( HWND dialog, const char *dir_path, int c
static
void
load_library_list
(
HWND
dialog
)
{
unsigned
int
i
=
0
;
const
char
*
path
,
*
build_dir
=
wine_get_build_dir
();
char
item1
[
256
],
item2
[
256
];
char
item1
[
256
],
item2
[
256
],
var
[
32
],
path
[
MAX_PATH
];
HCURSOR
old_cursor
=
SetCursor
(
LoadCursorW
(
0
,
(
LPWSTR
)
IDC_WAIT
)
);
if
(
build_dir
)
if
(
GetEnvironmentVariableA
(
"WINEBUILDDIR"
,
path
,
MAX_PATH
)
)
{
char
*
dir
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
build_dir
)
+
sizeof
(
"
/
dlls"
)
);
strcpy
(
dir
,
build_dir
);
strcat
(
dir
,
"
/
dlls"
);
char
*
dir
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
path
)
+
sizeof
(
"
\\
dlls"
)
);
strcpy
(
dir
,
path
);
strcat
(
dir
,
"
\\
dlls"
);
load_library_list_from_dir
(
dialog
,
dir
,
TRUE
);
HeapFree
(
GetProcessHeap
(),
0
,
dir
);
}
while
((
path
=
wine_dll_enum_load_path
(
i
++
)))
for
(;;)
{
sprintf
(
var
,
"WINEDLLDIR%u"
,
i
++
);
if
(
!
GetEnvironmentVariableA
(
var
,
path
,
MAX_PATH
))
break
;
load_library_list_from_dir
(
dialog
,
path
,
FALSE
);
}
/* get rid of duplicate entries */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment