Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
bb280298
Commit
bb280298
authored
Nov 12, 2021
by
Thomas Faber
Committed by
Alexandre Julliard
Nov 15, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Use . instead of concrete path for search path.
Signed-off-by:
Thomas Faber
<
thomas.faber@reactos.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6bedd7cc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
23 deletions
+26
-23
dbghelp.c
dlls/dbghelp/dbghelp.c
+26
-19
dbghelp.c
dlls/dbghelp/tests/dbghelp.c
+0
-4
No files found.
dlls/dbghelp/dbghelp.c
View file @
bb280298
...
...
@@ -178,29 +178,36 @@ struct cpu* cpu_find(DWORD machine)
static
WCHAR
*
make_default_search_path
(
void
)
{
WCHAR
*
search_path
;
unsigned
size
;
unsigned
len
;
search_path
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
=
MAX_PATH
)
*
sizeof
(
WCHAR
));
while
((
size
=
GetCurrentDirectoryW
(
len
,
search_path
))
>=
len
)
search_path
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
search_path
,
(
len
*=
2
)
*
sizeof
(
WCHAR
));
search_path
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
search_path
,
(
size
+
1
)
*
sizeof
(
WCHAR
));
len
=
GetEnvironmentVariableW
(
L"_NT_SYMBOL_PATH"
,
NULL
,
0
);
if
(
len
)
WCHAR
*
p
;
unsigned
sym_path_len
;
unsigned
alt_sym_path_len
;
sym_path_len
=
GetEnvironmentVariableW
(
L"_NT_SYMBOL_PATH"
,
NULL
,
0
);
alt_sym_path_len
=
GetEnvironmentVariableW
(
L"_NT_ALTERNATE_SYMBOL_PATH"
,
NULL
,
0
);
/* The default symbol path is ".[;%_NT_SYMBOL_PATH%][;%_NT_ALTERNATE_SYMBOL_PATH%]".
* If the variables exist, the lengths include a null-terminator. We use that
* space for the semicolons, and only add the initial dot and the final null. */
search_path
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
1
+
sym_path_len
+
alt_sym_path_len
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
search_path
)
return
NULL
;
p
=
search_path
;
*
p
++
=
L'.'
;
if
(
sym_path_len
)
{
search_path
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
search_path
,
(
size
+
1
+
len
+
1
)
*
sizeof
(
WCHAR
));
search_path
[
size
]
=
';'
;
GetEnvironmentVariableW
(
L"_NT_SYMBOL_PATH"
,
search_path
+
size
+
1
,
len
);
size
+=
1
+
len
;
*
p
++
=
L';'
;
GetEnvironmentVariableW
(
L"_NT_SYMBOL_PATH"
,
p
,
sym_path_len
);
p
+=
sym_path_len
-
1
;
}
len
=
GetEnvironmentVariableW
(
L"_NT_ALTERNATE_SYMBOL_PATH"
,
NULL
,
0
);
if
(
len
)
if
(
alt_sym_path_
len
)
{
search_path
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
search_path
,
(
size
+
1
+
len
+
1
)
*
sizeof
(
WCHAR
))
;
search_path
[
size
]
=
';'
;
GetEnvironmentVariableW
(
L"_NT_ALTERNATE_SYMBOL_PATH"
,
search_path
+
size
+
1
,
len
)
;
*
p
++
=
L';'
;
GetEnvironmentVariableW
(
L"_NT_ALTERNATE_SYMBOL_PATH"
,
p
,
alt_sym_path_len
)
;
p
+=
alt_sym_path_len
-
1
;
}
*
p
=
L'\0'
;
return
search_path
;
}
...
...
dlls/dbghelp/tests/dbghelp.c
View file @
bb280298
...
...
@@ -141,7 +141,6 @@ static void test_search_path(void)
* We unset both variables earlier so should simply get "." */
ret
=
SymGetSearchPath
(
GetCurrentProcess
(),
search_path
,
ARRAY_SIZE
(
search_path
));
ok
(
ret
==
TRUE
,
"ret = %d
\n
"
,
ret
);
todo_wine
ok
(
!
strcmp
(
search_path
,
"."
),
"Got search path '%s', expected '.'
\n
"
,
search_path
);
/* Set an arbitrary search path */
...
...
@@ -156,7 +155,6 @@ static void test_search_path(void)
ok
(
ret
==
TRUE
,
"ret = %d
\n
"
,
ret
);
ret
=
SymGetSearchPath
(
GetCurrentProcess
(),
search_path
,
ARRAY_SIZE
(
search_path
));
ok
(
ret
==
TRUE
,
"ret = %d
\n
"
,
ret
);
todo_wine
ok
(
!
strcmp
(
search_path
,
"."
),
"Got search path '%s', expected '.'
\n
"
,
search_path
);
/* With _NT_SYMBOL_PATH */
...
...
@@ -165,7 +163,6 @@ static void test_search_path(void)
ok
(
ret
==
TRUE
,
"ret = %d
\n
"
,
ret
);
ret
=
SymGetSearchPath
(
GetCurrentProcess
(),
search_path
,
ARRAY_SIZE
(
search_path
));
ok
(
ret
==
TRUE
,
"ret = %d
\n
"
,
ret
);
todo_wine
ok
(
!
strcmp
(
search_path
,
".;X:
\\
"
),
"Got search path '%s', expected '.;X:
\\
'
\n
"
,
search_path
);
/* With both _NT_SYMBOL_PATH and _NT_ALT_SYMBOL_PATH */
...
...
@@ -192,7 +189,6 @@ static void test_search_path(void)
ok
(
ret
==
TRUE
,
"ret = %d
\n
"
,
ret
);
ret
=
SymGetSearchPath
(
GetCurrentProcess
(),
search_path
,
ARRAY_SIZE
(
search_path
));
ok
(
ret
==
TRUE
,
"ret = %d
\n
"
,
ret
);
todo_wine
ok
(
!
strcmp
(
search_path
,
"."
),
"Got search path '%s', expected '.'
\n
"
,
search_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