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
c1f9129d
Commit
c1f9129d
authored
Aug 02, 2013
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Aug 02, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
faultrep/tests: Fix a test failure when the user has limited access rights.
parent
b9b6b058
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
faultrep.c
dlls/faultrep/faultrep.c
+4
-4
faultrep.c
dlls/faultrep/tests/faultrep.c
+7
-3
No files found.
dlls/faultrep/faultrep.c
View file @
c1f9129d
...
@@ -53,14 +53,13 @@ static const WCHAR SZ_EXCLUSIONLIST_KEY[] = {
...
@@ -53,14 +53,13 @@ static const WCHAR SZ_EXCLUSIONLIST_KEY[] = {
* Wine doesn't use this data but stores it in the registry (in the same place
* Wine doesn't use this data but stores it in the registry (in the same place
* as Windows would) in case it will be useful in a future version
* as Windows would) in case it will be useful in a future version
*
*
* According to MSDN this function should succeed even if the user has no write
* access to HKLM. This probably means that there is no error checking.
*/
*/
BOOL
WINAPI
AddERExcludedApplicationW
(
LPCWSTR
lpAppFileName
)
BOOL
WINAPI
AddERExcludedApplicationW
(
LPCWSTR
lpAppFileName
)
{
{
WCHAR
*
bslash
;
WCHAR
*
bslash
;
DWORD
value
=
1
;
DWORD
value
=
1
;
HKEY
hkey
;
HKEY
hkey
;
LONG
res
;
TRACE
(
"(%s)
\n
"
,
wine_dbgstr_w
(
lpAppFileName
));
TRACE
(
"(%s)
\n
"
,
wine_dbgstr_w
(
lpAppFileName
));
bslash
=
strrchrW
(
lpAppFileName
,
'\\'
);
bslash
=
strrchrW
(
lpAppFileName
,
'\\'
);
...
@@ -72,13 +71,14 @@ BOOL WINAPI AddERExcludedApplicationW(LPCWSTR lpAppFileName)
...
@@ -72,13 +71,14 @@ BOOL WINAPI AddERExcludedApplicationW(LPCWSTR lpAppFileName)
return
FALSE
;
return
FALSE
;
}
}
if
(
!
RegCreateKeyW
(
HKEY_LOCAL_MACHINE
,
SZ_EXCLUSIONLIST_KEY
,
&
hkey
))
res
=
RegCreateKeyW
(
HKEY_LOCAL_MACHINE
,
SZ_EXCLUSIONLIST_KEY
,
&
hkey
);
if
(
!
res
)
{
{
RegSetValueExW
(
hkey
,
lpAppFileName
,
0
,
REG_DWORD
,
(
LPBYTE
)
&
value
,
sizeof
(
value
));
RegSetValueExW
(
hkey
,
lpAppFileName
,
0
,
REG_DWORD
,
(
LPBYTE
)
&
value
,
sizeof
(
value
));
RegCloseKey
(
hkey
);
RegCloseKey
(
hkey
);
}
}
return
TRUE
;
return
!
res
;
}
}
/*************************************************************************
/*************************************************************************
...
...
dlls/faultrep/tests/faultrep.c
View file @
c1f9129d
...
@@ -43,7 +43,12 @@ static void test_AddERExcludedApplicationA(void)
...
@@ -43,7 +43,12 @@ static void test_AddERExcludedApplicationA(void)
HKEY
hexclude
=
0
;
HKEY
hexclude
=
0
;
/* clean state */
/* clean state */
lres
=
RegOpenKeyExA
(
HKEY_LOCAL_MACHINE
,
regpath_root
,
0
,
KEY_WRITE
,
&
hroot
);
lres
=
RegCreateKeyA
(
HKEY_LOCAL_MACHINE
,
regpath_root
,
&
hroot
);
if
(
lres
==
ERROR_ACCESS_DENIED
)
{
skip
(
"Not enough access rights
\n
"
);
return
;
}
if
(
!
lres
)
if
(
!
lres
)
lres
=
RegOpenKeyA
(
hroot
,
regpath_exclude
,
&
hexclude
);
lres
=
RegOpenKeyA
(
hroot
,
regpath_exclude
,
&
hexclude
);
...
@@ -61,8 +66,7 @@ static void test_AddERExcludedApplicationA(void)
...
@@ -61,8 +66,7 @@ static void test_AddERExcludedApplicationA(void)
ok
(
!
res
,
"got %d and 0x%x (expected FALSE)
\n
"
,
res
,
GetLastError
());
ok
(
!
res
,
"got %d and 0x%x (expected FALSE)
\n
"
,
res
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
/* access rights to HKLM or existence of the path doesn't matter
/* existence of the path doesn't matter this function succeeded */
this function succeeded */
res
=
AddERExcludedApplicationA
(
"winetest_faultrep.exe"
);
res
=
AddERExcludedApplicationA
(
"winetest_faultrep.exe"
);
ok
(
res
,
"got %d and 0x%x (expected TRUE)
\n
"
,
res
,
GetLastError
());
ok
(
res
,
"got %d and 0x%x (expected TRUE)
\n
"
,
res
,
GetLastError
());
...
...
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