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
504e7c2f
Commit
504e7c2f
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: Implement PdhValidatePath{, Ex}{A, W}.
parent
9ad3807c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
86 additions
and
4 deletions
+86
-4
pdh.spec
dlls/pdh/pdh.spec
+4
-4
pdh_main.c
dlls/pdh/pdh_main.c
+74
-0
pdh.h
include/pdh.h
+7
-0
pdhmsg.h
include/pdhmsg.h
+1
-0
No files found.
dlls/pdh/pdh.spec
View file @
504e7c2f
...
...
@@ -137,10 +137,10 @@
@ stub PdhUpdateLogA
@ stub PdhUpdateLogFileCatalog
@ stub PdhUpdateLogW
@ st
ub PdhValidatePathA
@ st
ub PdhValidatePathExA
@ st
ub PdhValidatePathExW
@ st
ub PdhValidatePathW
@ st
dcall PdhValidatePathA(str)
@ st
dcall PdhValidatePathExA(ptr str)
@ st
dcall PdhValidatePathExW(ptr wstr)
@ st
dcall PdhValidatePathW(wstr)
@ stub PdhVbAddCounter
@ stub PdhVbCreateCounterPathList
@ stub PdhVbGetCounterPathElements
...
...
dlls/pdh/pdh_main.c
View file @
504e7c2f
...
...
@@ -700,3 +700,77 @@ PDH_STATUS WINAPI PdhSetCounterScaleFactor( PDH_HCOUNTER handle, LONG factor )
counter
->
scale
=
factor
;
return
ERROR_SUCCESS
;
}
/***********************************************************************
* PdhValidatePathA (PDH.@)
*/
PDH_STATUS
WINAPI
PdhValidatePathA
(
LPCSTR
path
)
{
PDH_STATUS
ret
;
WCHAR
*
pathW
;
TRACE
(
"%s
\n
"
,
debugstr_a
(
path
));
if
(
!
path
)
return
PDH_INVALID_ARGUMENT
;
if
(
!
(
pathW
=
pdh_strdup_aw
(
path
)))
return
PDH_MEMORY_ALLOCATION_FAILURE
;
ret
=
PdhValidatePathW
(
pathW
);
pdh_free
(
pathW
);
return
ret
;
}
static
PDH_STATUS
validate_path
(
LPCWSTR
path
)
{
if
(
!
path
||
!*
path
)
return
PDH_INVALID_ARGUMENT
;
if
(
*
path
++
!=
'\\'
||
!
strchrW
(
path
,
'\\'
))
return
PDH_CSTATUS_BAD_COUNTERNAME
;
return
ERROR_SUCCESS
;
}
/***********************************************************************
* PdhValidatePathW (PDH.@)
*/
PDH_STATUS
WINAPI
PdhValidatePathW
(
LPCWSTR
path
)
{
PDH_STATUS
ret
;
unsigned
int
i
;
TRACE
(
"%s
\n
"
,
debugstr_w
(
path
));
if
((
ret
=
validate_path
(
path
)))
return
ret
;
for
(
i
=
0
;
i
<
sizeof
(
counter_sources
)
/
sizeof
(
counter_sources
[
0
]);
i
++
)
if
(
pdh_match_path
(
counter_sources
[
i
].
path
,
path
))
return
ERROR_SUCCESS
;
return
PDH_CSTATUS_NO_COUNTER
;
}
/***********************************************************************
* PdhValidatePathExA (PDH.@)
*/
PDH_STATUS
WINAPI
PdhValidatePathExA
(
PDH_HLOG
source
,
LPCSTR
path
)
{
TRACE
(
"%p %s
\n
"
,
source
,
debugstr_a
(
path
));
if
(
source
)
{
FIXME
(
"log file data source not supported
\n
"
);
return
ERROR_SUCCESS
;
}
return
PdhValidatePathA
(
path
);
}
/***********************************************************************
* PdhValidatePathExW (PDH.@)
*/
PDH_STATUS
WINAPI
PdhValidatePathExW
(
PDH_HLOG
source
,
LPCWSTR
path
)
{
TRACE
(
"%p %s
\n
"
,
source
,
debugstr_w
(
path
));
if
(
source
)
{
FIXME
(
"log file data source not supported
\n
"
);
return
ERROR_SUCCESS
;
}
return
PdhValidatePathW
(
path
);
}
include/pdh.h
View file @
504e7c2f
...
...
@@ -35,6 +35,7 @@ extern "C" {
typedef
LONG
PDH_STATUS
;
typedef
HANDLE
PDH_HQUERY
;
typedef
HANDLE
PDH_HCOUNTER
;
typedef
HANDLE
PDH_HLOG
;
#define PDH_MAX_SCALE 7
#define PDH_MIN_SCALE (-7)
...
...
@@ -190,6 +191,12 @@ PDH_STATUS WINAPI PdhOpenQueryW(LPCWSTR, DWORD_PTR, PDH_HQUERY *);
#define PdhOpenQuery WINELIB_NAME_AW(PdhOpenQuery)
PDH_STATUS
WINAPI
PdhRemoveCounter
(
PDH_HCOUNTER
);
PDH_STATUS
WINAPI
PdhSetCounterScaleFactor
(
PDH_HCOUNTER
,
LONG
);
PDH_STATUS
WINAPI
PdhValidatePathA
(
LPCSTR
);
PDH_STATUS
WINAPI
PdhValidatePathW
(
LPCWSTR
);
#define PdhValidatePath WINELIB_NAME_AW(PdhValidatePath)
PDH_STATUS
WINAPI
PdhValidatePathExA
(
PDH_HLOG
,
LPCSTR
);
PDH_STATUS
WINAPI
PdhValidatePathExW
(
PDH_HLOG
,
LPCWSTR
);
#define PdhValidatePathEx WINELIB_NAME_AW(PdhValidatePathEx)
#ifdef __cplusplus
}
...
...
include/pdhmsg.h
View file @
504e7c2f
...
...
@@ -30,6 +30,7 @@
#define PDH_MEMORY_ALLOCATION_FAILURE 0xc0000bbb
#define PDH_INVALID_HANDLE 0xc0000bbc
#define PDH_INVALID_ARGUMENT 0xc0000bbd
#define PDH_CSTATUS_BAD_COUNTERNAME 0xc0000bc0
#define PDH_INSUFFICIENT_BUFFER 0xc0000bc2
#define PDH_INVALID_DATA 0xc0000bc6
#define PDH_STRING_NOT_FOUND 0xc0000bd4
...
...
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