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
cf8b16bc
Commit
cf8b16bc
authored
Sep 29, 2007
by
Hans Leidekker
Committed by
Alexandre Julliard
Oct 01, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pdh: Fix parameter handling in PdhAddEnglishCounter{A, W} and PdhCollectQueryDataWithTime.
parent
a83509c7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
10 deletions
+27
-10
pdh_main.c
dlls/pdh/pdh_main.c
+14
-6
pdh.c
dlls/pdh/tests/pdh.c
+13
-4
No files found.
dlls/pdh/pdh_main.c
View file @
cf8b16bc
...
...
@@ -304,6 +304,9 @@ PDH_STATUS WINAPI PdhAddCounterW( PDH_HQUERY hquery, LPCWSTR path,
PDH_STATUS
WINAPI
PdhAddEnglishCounterA
(
PDH_HQUERY
query
,
LPCSTR
path
,
DWORD_PTR
userdata
,
PDH_HCOUNTER
*
counter
)
{
TRACE
(
"%p %s %lx %p
\n
"
,
query
,
debugstr_a
(
path
),
userdata
,
counter
);
if
(
!
query
)
return
PDH_INVALID_ARGUMENT
;
return
PdhAddCounterA
(
query
,
path
,
userdata
,
counter
);
}
...
...
@@ -313,6 +316,9 @@ PDH_STATUS WINAPI PdhAddEnglishCounterA( PDH_HQUERY query, LPCSTR path,
PDH_STATUS
WINAPI
PdhAddEnglishCounterW
(
PDH_HQUERY
query
,
LPCWSTR
path
,
DWORD_PTR
userdata
,
PDH_HCOUNTER
*
counter
)
{
TRACE
(
"%p %s %lx %p
\n
"
,
query
,
debugstr_w
(
path
),
userdata
,
counter
);
if
(
!
query
)
return
PDH_INVALID_ARGUMENT
;
return
PdhAddCounterW
(
query
,
path
,
userdata
,
counter
);
}
...
...
@@ -543,9 +549,13 @@ PDH_STATUS WINAPI PdhCollectQueryDataEx( PDH_HQUERY handle, DWORD interval, HAND
PDH_STATUS
WINAPI
PdhCollectQueryDataWithTime
(
PDH_HQUERY
handle
,
LONGLONG
*
timestamp
)
{
struct
query
*
query
=
handle
;
struct
counter
*
counter
;
struct
list
*
item
;
TRACE
(
"%p %p
\n
"
,
handle
,
timestamp
);
if
(
!
timestamp
)
return
PDH_INVALID_ARGUMENT
;
EnterCriticalSection
(
&
pdh_handle_cs
);
if
(
!
query
||
query
->
magic
!=
PDH_MAGIC_QUERY
)
{
...
...
@@ -560,13 +570,11 @@ PDH_STATUS WINAPI PdhCollectQueryDataWithTime( PDH_HQUERY handle, LONGLONG *time
collect_query_data
(
query
);
i
f
(
timestamp
)
{
struct
list
*
item
=
list_head
(
&
query
->
counters
);
struct
counter
*
counter
=
LIST_ENTRY
(
item
,
struct
counter
,
entry
)
;
i
tem
=
list_head
(
&
query
->
counters
);
counter
=
LIST_ENTRY
(
item
,
struct
counter
,
entry
);
*
timestamp
=
((
LONGLONG
)
counter
->
stamp
.
dwHighDateTime
<<
32
)
|
counter
->
stamp
.
dwLowDateTime
;
*
timestamp
=
((
LONGLONG
)
counter
->
stamp
.
dwHighDateTime
<<
32
)
|
counter
->
stamp
.
dwLowDateTime
;
}
LeaveCriticalSection
(
&
pdh_handle_cs
);
return
ERROR_SUCCESS
;
}
...
...
dlls/pdh/tests/pdh.c
View file @
cf8b16bc
...
...
@@ -211,11 +211,14 @@ static void test_PdhAddEnglishCounterA( void )
ret
=
PdhOpenQueryA
(
NULL
,
0
,
&
query
);
ok
(
ret
==
ERROR_SUCCESS
,
"PdhOpenQueryA failed 0x%08x
\n
"
,
ret
);
ret
=
PdhCollectQueryData
(
query
);
ok
(
ret
==
PDH_NO_DATA
,
"PdhCollectQueryData failed 0x%08x
\n
"
,
ret
);
ret
=
pPdhAddEnglishCounterA
(
NULL
,
"
\\
System
\\
System Up Time"
,
0
,
NULL
);
ok
(
ret
==
PDH_INVALID_ARGUMENT
,
"PdhAddEnglishCounterA failed 0x%08x
\n
"
,
ret
);
ret
=
pPdhAddEnglishCounterA
(
NULL
,
"
\\
System
\\
System Up Time"
,
0
,
&
counter
);
ok
(
ret
==
PDH_INVALID_
HANDLE
,
"PdhAddEnglishCounterA failed 0x%08x
\n
"
,
ret
);
ok
(
ret
==
PDH_INVALID_
ARGUMENT
,
"PdhAddEnglishCounterA failed 0x%08x
\n
"
,
ret
);
ret
=
pPdhAddEnglishCounterA
(
query
,
NULL
,
0
,
&
counter
);
ok
(
ret
==
PDH_INVALID_ARGUMENT
,
"PdhAddEnglishCounterA failed 0x%08x
\n
"
,
ret
);
...
...
@@ -249,11 +252,14 @@ static void test_PdhAddEnglishCounterW( void )
ret
=
PdhOpenQueryW
(
NULL
,
0
,
&
query
);
ok
(
ret
==
ERROR_SUCCESS
,
"PdhOpenQueryW failed 0x%08x
\n
"
,
ret
);
ret
=
PdhCollectQueryData
(
query
);
ok
(
ret
==
PDH_NO_DATA
,
"PdhCollectQueryData failed 0x%08x
\n
"
,
ret
);
ret
=
pPdhAddEnglishCounterW
(
NULL
,
system_uptime
,
0
,
NULL
);
ok
(
ret
==
PDH_INVALID_ARGUMENT
,
"PdhAddEnglishCounterW failed 0x%08x
\n
"
,
ret
);
ret
=
pPdhAddEnglishCounterW
(
NULL
,
system_uptime
,
0
,
&
counter
);
ok
(
ret
==
PDH_INVALID_
HANDLE
,
"PdhAddEnglishCounterW failed 0x%08x
\n
"
,
ret
);
ok
(
ret
==
PDH_INVALID_
ARGUMENT
,
"PdhAddEnglishCounterW failed 0x%08x
\n
"
,
ret
);
ret
=
pPdhAddEnglishCounterW
(
query
,
NULL
,
0
,
&
counter
);
ok
(
ret
==
PDH_INVALID_ARGUMENT
,
"PdhAddEnglishCounterW failed 0x%08x
\n
"
,
ret
);
...
...
@@ -288,14 +294,17 @@ static void test_PdhCollectQueryDataWithTime( void )
ret
=
PdhOpenQueryA
(
NULL
,
0
,
&
query
);
ok
(
ret
==
ERROR_SUCCESS
,
"PdhOpenQueryA failed 0x%08x
\n
"
,
ret
);
ret
=
PdhCollectQueryData
(
query
);
ok
(
ret
==
PDH_NO_DATA
,
"PdhCollectQueryData 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
=
pPdhCollectQueryDataWithTime
(
NULL
,
NULL
);
ok
(
ret
==
PDH_INVALID_
HANDLE
,
"PdhCollectQueryDataWithTime failed 0x%08x
\n
"
,
ret
);
ok
(
ret
==
PDH_INVALID_
ARGUMENT
,
"PdhCollectQueryDataWithTime failed 0x%08x
\n
"
,
ret
);
ret
=
pPdhCollectQueryDataWithTime
(
query
,
NULL
);
ok
(
ret
==
ERROR_SUCCESS
,
"PdhCollectQueryDataWithTime failed 0x%08x
\n
"
,
ret
);
ok
(
ret
==
PDH_INVALID_ARGUMENT
,
"PdhCollectQueryDataWithTime failed 0x%08x
\n
"
,
ret
);
ret
=
pPdhCollectQueryDataWithTime
(
NULL
,
&
time
);
ok
(
ret
==
PDH_INVALID_HANDLE
,
"PdhCollectQueryDataWithTime failed 0x%08x
\n
"
,
ret
);
...
...
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