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
4933dc78
Commit
4933dc78
authored
Dec 21, 2012
by
Hans Leidekker
Committed by
Alexandre Julliard
Dec 21, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pdh: Accept the local machine name in counter paths.
parent
ec1ae3b6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
pdh_main.c
dlls/pdh/pdh_main.c
+16
-3
No files found.
dlls/pdh/pdh_main.c
View file @
4933dc78
...
...
@@ -220,14 +220,27 @@ static const struct source counter_sources[] =
{
674
,
path_uptime
,
collect_uptime
,
TYPE_UPTIME
,
-
3
,
1000
}
};
static
BOOL
is_local_machine
(
const
WCHAR
*
name
,
DWORD
len
)
{
WCHAR
buf
[
MAX_COMPUTERNAME_LENGTH
+
1
];
DWORD
buflen
=
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]);
if
(
!
GetComputerNameW
(
buf
,
&
buflen
))
return
FALSE
;
return
len
==
buflen
&&
!
memicmpW
(
name
,
buf
,
buflen
);
}
static
BOOL
pdh_match_path
(
LPCWSTR
fullpath
,
LPCWSTR
path
)
{
const
WCHAR
*
p
;
if
(
strchrW
(
path
,
'\\'
))
p
=
fullpath
;
if
(
path
[
0
]
==
'\\'
&&
path
[
1
]
==
'\\'
&&
(
p
=
strchrW
(
path
+
2
,
'\\'
))
&&
is_local_machine
(
path
+
2
,
p
-
path
-
2
))
{
path
+=
p
-
path
;
}
if
(
strchrW
(
path
,
'\\'
))
p
=
fullpath
;
else
p
=
strrchrW
(
fullpath
,
'\\'
)
+
1
;
if
(
strcmpW
(
p
,
path
))
return
FALSE
;
return
TRUE
;
return
!
strcmpW
(
p
,
path
);
}
/***********************************************************************
...
...
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