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
99ebf988
Commit
99ebf988
authored
Oct 09, 2020
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Oct 12, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wer: Use wide-char string literals.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e3e6872f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
22 deletions
+14
-22
main.c
dlls/wer/main.c
+1
-5
main.c
dlls/wer/tests/main.c
+13
-17
No files found.
dlls/wer/main.c
View file @
99ebf988
...
...
@@ -48,11 +48,7 @@ static CRITICAL_SECTION report_table_cs = { &report_table_cs_debug, -1, 0, 0, 0,
static
struct
list
report_table
=
LIST_INIT
(
report_table
);
static
const
WCHAR
regpath_exclude
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'M'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
' '
,
'E'
,
'r'
,
'r'
,
'o'
,
'r'
,
' '
,
'R'
,
'e'
,
'p'
,
'o'
,
'r'
,
't'
,
'i'
,
'n'
,
'g'
,
'\\'
,
'E'
,
'x'
,
'c'
,
'l'
,
'u'
,
'd'
,
'e'
,
'd'
,
'A'
,
'p'
,
'p'
,
'l'
,
'i'
,
'c'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
's'
,
0
};
static
const
WCHAR
regpath_exclude
[]
=
L"Software
\\
Microsoft
\\
Windows Error Reporting
\\
ExcludedApplications"
;
BOOL
WINAPI
DllMain
(
HINSTANCE
hinstDLL
,
DWORD
fdwReason
,
LPVOID
lpvReserved
)
{
...
...
dlls/wer/tests/main.c
View file @
99ebf988
...
...
@@ -29,11 +29,7 @@
#include "werapi.h"
#include "wine/test.h"
static
const
WCHAR
appcrash
[]
=
{
'A'
,
'P'
,
'P'
,
'C'
,
'R'
,
'A'
,
'S'
,
'H'
,
0
};
static
const
WCHAR
backslash
[]
=
{
'\\'
,
0
};
static
const
WCHAR
empty
[]
=
{
0
};
static
const
WCHAR
winetest_wer
[]
=
{
'w'
,
'i'
,
'n'
,
'e'
,
't'
,
'e'
,
's'
,
't'
,
'_'
,
'w'
,
'e'
,
'r'
,
'.'
,
'e'
,
'x'
,
'e'
,
0
};
static
const
WCHAR
winetest_wer
[]
=
L"winetest_wer.exe"
;
/* ###### */
...
...
@@ -51,7 +47,7 @@ static void test_WerAddExcludedApplication(void)
hr
=
WerAddExcludedApplication
(
NULL
,
FALSE
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%x (expected E_INVALIDARG)
\n
"
,
hr
);
hr
=
WerAddExcludedApplication
(
empty
,
FALSE
);
hr
=
WerAddExcludedApplication
(
L""
,
FALSE
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%x (expected E_INVALIDARG)
\n
"
,
hr
);
hr
=
WerAddExcludedApplication
(
winetest_wer
,
FALSE
);
...
...
@@ -74,7 +70,7 @@ static void test_WerAddExcludedApplication(void)
hr
=
WerRemoveExcludedApplication
(
buffer
,
FALSE
);
ok
(
hr
==
S_OK
,
"got 0x%x (expected S_OK)
\n
"
,
hr
);
lstrcatW
(
buffer
,
backslash
);
lstrcatW
(
buffer
,
L"
\\
"
);
hr
=
WerAddExcludedApplication
(
buffer
,
FALSE
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%x (expected E_INVALIDARG)
\n
"
,
hr
);
...
...
@@ -106,7 +102,7 @@ static void test_WerRemoveExcludedApplication(void)
hr
=
WerRemoveExcludedApplication
(
NULL
,
FALSE
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%x (expected E_INVALIDARG)
\n
"
,
hr
);
hr
=
WerRemoveExcludedApplication
(
empty
,
FALSE
);
hr
=
WerRemoveExcludedApplication
(
L""
,
FALSE
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%x (expected E_INVALIDARG)
\n
"
,
hr
);
hr
=
WerRemoveExcludedApplication
(
winetest_wer
,
FALSE
);
...
...
@@ -130,7 +126,7 @@ static void test_WerRemoveExcludedApplication(void)
hr
=
WerRemoveExcludedApplication
(
buffer
,
FALSE
);
ok
(
hr
==
S_OK
,
"got 0x%x (expected S_OK)
\n
"
,
hr
);
lstrcatW
(
buffer
,
backslash
);
lstrcatW
(
buffer
,
L"
\\
"
);
hr
=
WerAddExcludedApplication
(
buffer
,
FALSE
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%x (expected E_INVALIDARG)
\n
"
,
hr
);
hr
=
WerRemoveExcludedApplication
(
buffer
,
FALSE
);
...
...
@@ -152,7 +148,7 @@ static void test_WerReportCloseHandle(void)
HREPORT
report
;
report
=
(
void
*
)
0xdeadbeef
;
hr
=
WerReportCreate
(
appcrash
,
WerReportCritical
,
NULL
,
&
report
);
hr
=
WerReportCreate
(
L"APPCRASH"
,
WerReportCritical
,
NULL
,
&
report
);
ok
(
hr
==
S_OK
,
"got 0x%x and %p (expected S_OK)
\n
"
,
hr
,
report
);
if
(
!
report
)
{
...
...
@@ -183,7 +179,7 @@ static void test_WerReportCreate(void)
report
=
(
void
*
)
0xdeadbeef
;
/* test a simple valid case */
hr
=
WerReportCreate
(
appcrash
,
WerReportCritical
,
NULL
,
&
report
);
hr
=
WerReportCreate
(
L"APPCRASH"
,
WerReportCritical
,
NULL
,
&
report
);
ok
(
hr
==
S_OK
,
"got 0x%x and %p (expected S_OK)
\n
"
,
hr
,
report
);
if
(
!
report
)
{
...
...
@@ -195,7 +191,7 @@ static void test_WerReportCreate(void)
ok
(
hr
==
S_OK
,
"got 0x%x for %p (expected S_OK)
\n
"
,
hr
,
report
);
/* the ptr to store the created handle is always needed */
hr
=
WerReportCreate
(
appcrash
,
WerReportCritical
,
NULL
,
NULL
);
hr
=
WerReportCreate
(
L"APPCRASH"
,
WerReportCritical
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%x (expected E_INVALIDARG)
\n
"
,
hr
);
/* the event type must be a valid string */
...
...
@@ -204,13 +200,13 @@ static void test_WerReportCreate(void)
ok
(
hr
==
E_INVALIDARG
,
"got 0x%x and %p(expected E_INVALIDARG)
\n
"
,
hr
,
report
);
report
=
(
void
*
)
0xdeadbeef
;
hr
=
WerReportCreate
(
empty
,
WerReportCritical
,
NULL
,
&
report
);
hr
=
WerReportCreate
(
L""
,
WerReportCritical
,
NULL
,
&
report
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%x and %p(expected E_INVALIDARG)
\n
"
,
hr
,
report
);
/* a valid WER_REPORT_TYPE works */
for
(
i
=
0
;
i
<
WerReportInvalid
;
i
++
)
{
report
=
(
void
*
)
0xdeadbeef
;
hr
=
WerReportCreate
(
appcrash
,
i
,
NULL
,
&
report
);
hr
=
WerReportCreate
(
L"APPCRASH"
,
i
,
NULL
,
&
report
);
ok
(
hr
==
S_OK
,
"%d: got 0x%x and %p (expected S_OK)
\n
"
,
i
,
hr
,
report
);
hr
=
WerReportCloseHandle
(
report
);
...
...
@@ -222,7 +218,7 @@ static void test_WerReportCreate(void)
but older windows versions did not check the report type and WerReportCreate always succeeded */
report
=
(
void
*
)
0xdeadbeef
;
hr
=
WerReportCreate
(
appcrash
,
WerReportInvalid
,
NULL
,
&
report
);
hr
=
WerReportCreate
(
L"APPCRASH"
,
WerReportInvalid
,
NULL
,
&
report
);
ok
((
hr
==
E_INVALIDARG
)
|
broken
(
hr
==
S_OK
),
"%d: got 0x%x and %p (expected E_INVALIDARG or a broken S_OK)
\n
"
,
i
,
hr
,
report
);
if
(
hr
==
S_OK
)
{
...
...
@@ -231,7 +227,7 @@ static void test_WerReportCreate(void)
}
report
=
(
void
*
)
0xdeadbeef
;
hr
=
WerReportCreate
(
appcrash
,
42
,
NULL
,
&
report
);
hr
=
WerReportCreate
(
L"APPCRASH"
,
42
,
NULL
,
&
report
);
ok
((
hr
==
E_INVALIDARG
)
|
broken
(
hr
==
S_OK
),
"%d: got 0x%x and %p (expected E_INVALIDARG or a broken S_OK)
\n
"
,
i
,
hr
,
report
);
if
(
hr
==
S_OK
)
{
...
...
@@ -243,7 +239,7 @@ static void test_WerReportCreate(void)
memset
(
table
,
0
,
sizeof
(
table
));
for
(
i
=
0
;
i
<
(
ARRAY_SIZE
(
table
)
-
1
);
i
++
)
{
report
=
(
void
*
)
0xdeadbeef
;
hr
=
WerReportCreate
(
appcrash
,
WerReportCritical
,
NULL
,
&
table
[
i
]);
hr
=
WerReportCreate
(
L"APPCRASH"
,
WerReportCritical
,
NULL
,
&
table
[
i
]);
ok
(
hr
==
S_OK
,
"%02d: got 0x%x and %p (expected S_OK)
\n
"
,
i
,
hr
,
table
[
i
]);
}
...
...
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