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
754ac8c4
Commit
754ac8c4
authored
Jul 09, 2007
by
Hans Leidekker
Committed by
Alexandre Julliard
Jul 10, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pdh: Implement and test PdhGetRawCounterValue.
parent
0d516c53
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
1 deletion
+60
-1
pdh.spec
dlls/pdh/pdh.spec
+1
-1
pdh_main.c
dlls/pdh/pdh_main.c
+24
-0
pdh.c
dlls/pdh/tests/pdh.c
+35
-0
No files found.
dlls/pdh/pdh.spec
View file @
754ac8c4
...
...
@@ -64,7 +64,7 @@
@ stub PdhGetLogSetGUID
@ stub PdhGetRawCounterArrayA
@ stub PdhGetRawCounterArrayW
@ st
ub PdhGetRawCounterValue
@ st
dcall PdhGetRawCounterValue(ptr ptr ptr)
@ stub PdhIsRealTimeQuery
@ stub PdhListLogFileHeaderA
@ stub PdhListLogFileHeaderW
...
...
dlls/pdh/pdh_main.c
View file @
754ac8c4
...
...
@@ -327,6 +327,30 @@ PDH_STATUS WINAPI PdhGetFormattedCounterValue( PDH_HCOUNTER handle, DWORD format
}
/***********************************************************************
* PdhGetRawCounterValue (PDH.@)
*/
PDH_STATUS
WINAPI
PdhGetRawCounterValue
(
PDH_HCOUNTER
handle
,
LPDWORD
type
,
PPDH_RAW_COUNTER
value
)
{
struct
counter
*
counter
=
handle
;
TRACE
(
"%p %p %p
\n
"
,
handle
,
type
,
value
);
if
(
!
value
)
return
PDH_INVALID_ARGUMENT
;
if
(
!
counter
)
return
PDH_INVALID_HANDLE
;
value
->
CStatus
=
counter
->
status
;
value
->
TimeStamp
.
dwLowDateTime
=
counter
->
stamp
.
dwLowDateTime
;
value
->
TimeStamp
.
dwHighDateTime
=
counter
->
stamp
.
dwHighDateTime
;
value
->
FirstValue
=
counter
->
one
.
largevalue
;;
value
->
SecondValue
=
counter
->
two
.
largevalue
;
value
->
MultiCount
=
1
;
/* FIXME */
if
(
type
)
*
type
=
counter
->
type
;
return
ERROR_SUCCESS
;
}
/***********************************************************************
* PdhOpenQueryA (PDH.@)
*/
PDH_STATUS
WINAPI
PdhOpenQueryA
(
LPCSTR
source
,
DWORD_PTR
userdata
,
PDH_HQUERY
*
query
)
...
...
dlls/pdh/tests/pdh.c
View file @
754ac8c4
...
...
@@ -145,6 +145,40 @@ static void test_PdhGetFormattedCounterValue( void )
ok
(
ret
==
ERROR_SUCCESS
,
"PdhCloseQuery failed 0x%08x
\n
"
,
ret
);
}
static
void
test_PdhGetRawCounterValue
(
void
)
{
PDH_STATUS
ret
;
PDH_HQUERY
query
;
PDH_HCOUNTER
counter
;
PDH_RAW_COUNTER
value
;
ret
=
PdhOpenQueryA
(
NULL
,
0
,
&
query
);
ok
(
ret
==
ERROR_SUCCESS
,
"PdhOpenQueryA failed 0x%08x
\n
"
,
ret
);
ret
=
PdhAddCounterA
(
query
,
"
\\
System
\\
System Up Time"
,
0
,
&
counter
);
ok
(
ret
==
ERROR_SUCCESS
,
"PdhAddCounterA failed 0x%08x
\n
"
,
ret
);
ret
=
PdhGetRawCounterValue
(
NULL
,
NULL
,
&
value
);
ok
(
ret
==
PDH_INVALID_HANDLE
,
"PdhGetRawCounterValue failed 0x%08x
\n
"
,
ret
);
ret
=
PdhGetRawCounterValue
(
counter
,
NULL
,
NULL
);
ok
(
ret
==
PDH_INVALID_ARGUMENT
,
"PdhGetRawCounterValue failed 0x%08x
\n
"
,
ret
);
ret
=
PdhGetRawCounterValue
(
counter
,
NULL
,
&
value
);
ok
(
ret
==
ERROR_SUCCESS
,
"PdhGetRawCounterValue failed 0x%08x
\n
"
,
ret
);
ok
(
value
.
CStatus
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS got %x"
,
value
.
CStatus
);
ret
=
PdhCollectQueryData
(
query
);
ok
(
ret
==
ERROR_SUCCESS
,
"PdhCollectQueryData failed 0x%08x
\n
"
,
ret
);
ret
=
PdhGetRawCounterValue
(
counter
,
NULL
,
&
value
);
ok
(
ret
==
ERROR_SUCCESS
,
"PdhGetRawCounterValue failed 0x%08x
\n
"
,
ret
);
ok
(
value
.
CStatus
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS got %x"
,
value
.
CStatus
);
ret
=
PdhCloseQuery
(
query
);
ok
(
ret
==
ERROR_SUCCESS
,
"PdhCloseQuery failed 0x%08x
\n
"
,
ret
);
}
static
void
test_PdhSetCounterScaleFactor
(
void
)
{
PDH_STATUS
ret
;
...
...
@@ -184,5 +218,6 @@ START_TEST(pdh)
test_open_close_query
();
test_add_remove_counter
();
test_PdhGetFormattedCounterValue
();
test_PdhGetRawCounterValue
();
test_PdhSetCounterScaleFactor
();
}
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