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
ab47cca2
Commit
ab47cca2
authored
Nov 01, 2010
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Nov 03, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wer: Implement WerReportCreate and WerReportCloseHandle.
parent
e1691496
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
7 deletions
+81
-7
main.c
dlls/wer/main.c
+81
-4
main.c
dlls/wer/tests/main.c
+0
-3
No files found.
dlls/wer/main.c
View file @
ab47cca2
...
...
@@ -23,10 +23,44 @@
#include "windef.h"
#include "winbase.h"
#include "werapi.h"
#include "wine/list.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
wer
);
typedef
struct
{
struct
list
entry
;
WER_REPORT_INFORMATION
info
;
WER_REPORT_TYPE
reporttype
;
WCHAR
eventtype
[
1
];
}
report_t
;
static
CRITICAL_SECTION
report_table_cs
;
static
CRITICAL_SECTION_DEBUG
report_table_cs_debug
=
{
0
,
0
,
&
report_table_cs
,
{
&
report_table_cs_debug
.
ProcessLocksList
,
&
report_table_cs_debug
.
ProcessLocksList
},
0
,
0
,
{
(
DWORD_PTR
)(
__FILE__
": report_table_cs"
)
}
};
static
CRITICAL_SECTION
report_table_cs
=
{
&
report_table_cs_debug
,
-
1
,
0
,
0
,
0
,
0
};
static
struct
list
report_table
=
LIST_INIT
(
report_table
);
/***********************************************************************
* Memory alloccation helper
*/
static
inline
void
*
__WINE_ALLOC_SIZE
(
1
)
heap_alloc_zero
(
size_t
len
)
{
return
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
len
);
}
static
inline
BOOL
heap_free
(
void
*
mem
)
{
return
HeapFree
(
GetProcessHeap
(),
0
,
mem
);
}
HRESULT
WINAPI
WerAddExcludedApplication
(
PCWSTR
exeName
,
BOOL
allUsers
)
{
FIXME
(
"(%s, %d) stub
\n
"
,
debugstr_w
(
exeName
),
allUsers
);
...
...
@@ -86,9 +120,29 @@ HRESULT WINAPI WerRemoveExcludedApplication(PCWSTR exeName, BOOL allUsers)
*/
HRESULT
WINAPI
WerReportCloseHandle
(
HREPORT
hreport
)
{
FIXME
(
"(%p) :stub
\n
"
,
hreport
);
report_t
*
report
=
(
report_t
*
)
hreport
;
report_t
*
cursor
;
BOOL
found
=
FALSE
;
TRACE
(
"(%p)
\n
"
,
hreport
);
EnterCriticalSection
(
&
report_table_cs
);
if
(
report
)
{
LIST_FOR_EACH_ENTRY
(
cursor
,
&
report_table
,
report_t
,
entry
)
{
if
(
cursor
==
report
)
{
found
=
TRUE
;
list_remove
(
&
report
->
entry
);
break
;
}
}
}
LeaveCriticalSection
(
&
report_table_cs
);
if
(
!
found
)
return
E_INVALIDARG
;
return
E_NOTIMPL
;
heap_free
(
report
);
return
S_OK
;
}
/***********************************************************************
...
...
@@ -113,8 +167,10 @@ HRESULT WINAPI WerReportCloseHandle(HREPORT hreport)
*/
HRESULT
WINAPI
WerReportCreate
(
PCWSTR
eventtype
,
WER_REPORT_TYPE
reporttype
,
PWER_REPORT_INFORMATION
reportinfo
,
HREPORT
*
phandle
)
{
report_t
*
report
;
DWORD
len
;
FIXME
(
"(%s, %d, %p, %p) :stub
\n
"
,
debugstr_w
(
eventtype
),
reporttype
,
reportinfo
,
phandle
);
TRACE
(
"(%s, %d, %p, %p)
\n
"
,
debugstr_w
(
eventtype
),
reporttype
,
reportinfo
,
phandle
);
if
(
reportinfo
)
{
TRACE
(
".wzFriendlyEventName: %s
\n
"
,
debugstr_w
(
reportinfo
->
wzFriendlyEventName
));
TRACE
(
".wzApplicationName: %s
\n
"
,
debugstr_w
(
reportinfo
->
wzApplicationName
));
...
...
@@ -125,7 +181,28 @@ HRESULT WINAPI WerReportCreate(PCWSTR eventtype, WER_REPORT_TYPE reporttype, PWE
return
E_INVALIDARG
;
}
return
E_NOTIMPL
;
len
=
lstrlenW
(
eventtype
)
+
1
;
report
=
heap_alloc_zero
(
len
*
sizeof
(
WCHAR
)
+
sizeof
(
report_t
));
if
(
!
report
)
return
__HRESULT_FROM_WIN32
(
ERROR_OUTOFMEMORY
);
lstrcpyW
(
report
->
eventtype
,
eventtype
);
report
->
reporttype
=
reporttype
;
if
(
reportinfo
)
{
report
->
info
=
*
reportinfo
;
}
else
{
FIXME
(
"build report information from scratch for %p
\n
"
,
report
);
}
EnterCriticalSection
(
&
report_table_cs
);
list_add_head
(
&
report_table
,
&
report
->
entry
);
LeaveCriticalSection
(
&
report_table_cs
);
*
phandle
=
report
;
TRACE
(
"=> %p
\n
"
,
report
);
return
S_OK
;
}
/***********************************************************************
...
...
dlls/wer/tests/main.c
View file @
ab47cca2
...
...
@@ -111,7 +111,6 @@ static void test_WerReportCloseHandle(void)
report
=
(
void
*
)
0xdeadbeef
;
hr
=
WerReportCreate
(
appcrash
,
WerReportCritical
,
NULL
,
&
report
);
todo_wine
ok
(
hr
==
S_OK
,
"got 0x%x and %p (expected S_OK)
\n
"
,
hr
,
report
);
if
(
!
report
)
{
...
...
@@ -143,8 +142,6 @@ static void test_WerReportCreate(void)
report
=
(
void
*
)
0xdeadbeef
;
/* test a simple valid case */
hr
=
WerReportCreate
(
appcrash
,
WerReportCritical
,
NULL
,
&
report
);
todo_wine
ok
(
hr
==
S_OK
,
"got 0x%x and %p (expected S_OK)
\n
"
,
hr
,
report
);
if
(
!
report
)
{
...
...
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