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
7e758014
Commit
7e758014
authored
Sep 12, 2022
by
Paul Gofman
Committed by
Alexandre Julliard
Sep 13, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Add stub for PerfAddCounters().
parent
a5921e71
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
1 deletion
+50
-1
advapi.c
dlls/advapi32/advapi.c
+10
-0
advapi32.spec
dlls/advapi32/advapi32.spec
+1
-1
perf.c
dlls/advapi32/tests/perf.c
+25
-0
perflib.h
include/perflib.h
+14
-0
No files found.
dlls/advapi32/advapi.c
View file @
7e758014
...
@@ -331,3 +331,13 @@ ULONG WINAPI PerfOpenQueryHandle( const WCHAR *machine, HANDLE *query )
...
@@ -331,3 +331,13 @@ ULONG WINAPI PerfOpenQueryHandle( const WCHAR *machine, HANDLE *query )
return
ERROR_SUCCESS
;
return
ERROR_SUCCESS
;
}
}
ULONG
WINAPI
PerfAddCounters
(
HANDLE
query
,
PERF_COUNTER_IDENTIFIER
*
id
,
DWORD
size
)
{
FIXME
(
"query %p, id %p, size %lu stub.
\n
"
,
query
,
id
,
size
);
if
(
!
id
||
size
<
sizeof
(
*
id
)
||
id
->
Size
<
sizeof
(
*
id
))
return
ERROR_INVALID_PARAMETER
;
id
->
Status
=
ERROR_WMI_GUID_NOT_FOUND
;
return
ERROR_SUCCESS
;
}
dlls/advapi32/advapi32.spec
View file @
7e758014
...
@@ -553,7 +553,7 @@
...
@@ -553,7 +553,7 @@
@ stdcall -ret64 -import OpenTraceW(ptr)
@ stdcall -ret64 -import OpenTraceW(ptr)
# @ stub OperationEnd
# @ stub OperationEnd
# @ stub OperationStart
# @ stub OperationStart
# @ stub PerfAddCounters
@ stdcall PerfAddCounters(long ptr long)
@ stdcall PerfCloseQueryHandle(long)
@ stdcall PerfCloseQueryHandle(long)
@ stdcall -import PerfCreateInstance(long ptr wstr long)
@ stdcall -import PerfCreateInstance(long ptr wstr long)
# @ stub PerfDecrementULongCounterValue
# @ stub PerfDecrementULongCounterValue
...
...
dlls/advapi32/tests/perf.c
View file @
7e758014
...
@@ -28,9 +28,12 @@
...
@@ -28,9 +28,12 @@
#include "wine/test.h"
#include "wine/test.h"
#include "initguid.h"
#define DEFINE_FUNCTION(name) static typeof(name) *p##name;
#define DEFINE_FUNCTION(name) static typeof(name) *p##name;
DEFINE_FUNCTION
(
PerfCloseQueryHandle
);
DEFINE_FUNCTION
(
PerfCloseQueryHandle
);
DEFINE_FUNCTION
(
PerfOpenQueryHandle
);
DEFINE_FUNCTION
(
PerfOpenQueryHandle
);
DEFINE_FUNCTION
(
PerfAddCounters
);
#undef DEFINE_FUNCTION
#undef DEFINE_FUNCTION
static
void
init_functions
(
void
)
static
void
init_functions
(
void
)
...
@@ -40,6 +43,7 @@ static void init_functions(void)
...
@@ -40,6 +43,7 @@ static void init_functions(void)
#define GET_FUNCTION(name) p##name = (void *)GetProcAddress(hadvapi, #name)
#define GET_FUNCTION(name) p##name = (void *)GetProcAddress(hadvapi, #name)
GET_FUNCTION
(
PerfCloseQueryHandle
);
GET_FUNCTION
(
PerfCloseQueryHandle
);
GET_FUNCTION
(
PerfOpenQueryHandle
);
GET_FUNCTION
(
PerfOpenQueryHandle
);
GET_FUNCTION
(
PerfAddCounters
);
#undef GET_FUNCTION
#undef GET_FUNCTION
}
}
...
@@ -203,8 +207,12 @@ void test_provider_init(void)
...
@@ -203,8 +207,12 @@ void test_provider_init(void)
ok
(
!
ret
,
"Got unexpected ret %lu.
\n
"
,
ret
);
ok
(
!
ret
,
"Got unexpected ret %lu.
\n
"
,
ret
);
}
}
DEFINE_GUID
(
TestCounterGUID
,
0x12345678
,
0x1234
,
0x5678
,
0x12
,
0x34
,
0x11
,
0x11
,
0x22
,
0x22
,
0x33
,
0x33
);
static
void
test_perf_counters
(
void
)
static
void
test_perf_counters
(
void
)
{
{
char
buffer
[
sizeof
(
PERF_COUNTER_IDENTIFIER
)
+
8
];
PERF_COUNTER_IDENTIFIER
*
counter_id
;
HANDLE
query
;
HANDLE
query
;
ULONG
ret
;
ULONG
ret
;
...
@@ -219,6 +227,23 @@ static void test_perf_counters(void)
...
@@ -219,6 +227,23 @@ static void test_perf_counters(void)
ret
=
pPerfOpenQueryHandle
(
NULL
,
&
query
);
ret
=
pPerfOpenQueryHandle
(
NULL
,
&
query
);
ok
(
!
ret
,
"got ret %lu.
\n
"
,
ret
);
ok
(
!
ret
,
"got ret %lu.
\n
"
,
ret
);
counter_id
=
(
PERF_COUNTER_IDENTIFIER
*
)
buffer
;
memset
(
buffer
,
0
,
sizeof
(
buffer
));
counter_id
->
CounterSetGuid
=
TestCounterGUID
;
counter_id
->
CounterId
=
PERF_WILDCARD_COUNTER
;
counter_id
->
InstanceId
=
PERF_WILDCARD_COUNTER
;
ret
=
pPerfAddCounters
(
query
,
counter_id
,
sizeof
(
*
counter_id
));
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"got ret %lu.
\n
"
,
ret
);
counter_id
->
Size
=
sizeof
(
*
counter_id
);
ret
=
pPerfAddCounters
(
query
,
counter_id
,
8
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"got ret %lu.
\n
"
,
ret
);
ret
=
pPerfAddCounters
(
query
,
counter_id
,
sizeof
(
*
counter_id
));
ok
(
!
ret
,
"got ret %lu.
\n
"
,
ret
);
ok
(
counter_id
->
Status
==
ERROR_WMI_GUID_NOT_FOUND
,
"got Status %#lx.
\n
"
,
counter_id
->
Status
);
ret
=
pPerfCloseQueryHandle
(
query
);
ret
=
pPerfCloseQueryHandle
(
query
);
ok
(
!
ret
,
"got ret %lu.
\n
"
,
ret
);
ok
(
!
ret
,
"got ret %lu.
\n
"
,
ret
);
}
}
...
...
include/perflib.h
View file @
7e758014
...
@@ -81,6 +81,19 @@ typedef struct _PROVIDER_CONTEXT {
...
@@ -81,6 +81,19 @@ typedef struct _PROVIDER_CONTEXT {
LPVOID
pMemContext
;
LPVOID
pMemContext
;
}
PERF_PROVIDER_CONTEXT
,
*
PPERF_PROVIDER_CONTEXT
;
}
PERF_PROVIDER_CONTEXT
,
*
PPERF_PROVIDER_CONTEXT
;
typedef
struct
_PERF_COUNTER_IDENTIFIER
{
GUID
CounterSetGuid
;
ULONG
Status
;
ULONG
Size
;
ULONG
CounterId
;
ULONG
InstanceId
;
ULONG
Index
;
ULONG
Reserved
;
}
PERF_COUNTER_IDENTIFIER
,
*
PPERF_COUNTER_IDENTIFIER
;
#define PERF_WILDCARD_COUNTER 0xFFFFFFFF
#define PERF_WILDCARD_INSTANCE L"*"
PERF_COUNTERSET_INSTANCE
WINAPI
*
PerfCreateInstance
(
HANDLE
,
const
GUID
*
,
const
WCHAR
*
,
ULONG
);
PERF_COUNTERSET_INSTANCE
WINAPI
*
PerfCreateInstance
(
HANDLE
,
const
GUID
*
,
const
WCHAR
*
,
ULONG
);
ULONG
WINAPI
PerfDeleteInstance
(
HANDLE
,
PERF_COUNTERSET_INSTANCE
*
);
ULONG
WINAPI
PerfDeleteInstance
(
HANDLE
,
PERF_COUNTERSET_INSTANCE
*
);
ULONG
WINAPI
PerfSetCounterRefValue
(
HANDLE
,
PERF_COUNTERSET_INSTANCE
*
,
ULONG
,
void
*
);
ULONG
WINAPI
PerfSetCounterRefValue
(
HANDLE
,
PERF_COUNTERSET_INSTANCE
*
,
ULONG
,
void
*
);
...
@@ -89,6 +102,7 @@ ULONG WINAPI PerfStartProvider(GUID *, PERFLIBREQUEST, HANDLE *);
...
@@ -89,6 +102,7 @@ ULONG WINAPI PerfStartProvider(GUID *, PERFLIBREQUEST, HANDLE *);
ULONG
WINAPI
PerfStartProviderEx
(
GUID
*
,
PERF_PROVIDER_CONTEXT
*
,
HANDLE
*
);
ULONG
WINAPI
PerfStartProviderEx
(
GUID
*
,
PERF_PROVIDER_CONTEXT
*
,
HANDLE
*
);
ULONG
WINAPI
PerfStopProvider
(
HANDLE
);
ULONG
WINAPI
PerfStopProvider
(
HANDLE
);
ULONG
WINAPI
PerfAddCounters
(
HANDLE
,
PERF_COUNTER_IDENTIFIER
*
,
DWORD
);
ULONG
WINAPI
PerfCloseQueryHandle
(
HANDLE
);
ULONG
WINAPI
PerfCloseQueryHandle
(
HANDLE
);
ULONG
WINAPI
PerfOpenQueryHandle
(
const
WCHAR
*
,
HANDLE
*
);
ULONG
WINAPI
PerfOpenQueryHandle
(
const
WCHAR
*
,
HANDLE
*
);
...
...
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