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
0a23d042
Commit
0a23d042
authored
Jun 18, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pdh: Build with msvcrt.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
59f23b31
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
27 deletions
+28
-27
Makefile.in
dlls/pdh/Makefile.in
+2
-0
pdh_main.c
dlls/pdh/pdh_main.c
+26
-27
No files found.
dlls/pdh/Makefile.in
View file @
0a23d042
MODULE
=
pdh.dll
IMPORTLIB
=
pdh
EXTRADLLFLAGS
=
-mno-cygwin
C_SRCS
=
\
pdh_main.c
dlls/pdh/pdh_main.c
View file @
0a23d042
...
...
@@ -34,7 +34,6 @@
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/list.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
pdh
);
...
...
@@ -53,7 +52,7 @@ static inline WCHAR *pdh_strdup( const WCHAR *src )
WCHAR
*
dst
;
if
(
!
src
)
return
NULL
;
if
((
dst
=
heap_alloc
(
(
strlenW
(
src
)
+
1
)
*
sizeof
(
WCHAR
)
)))
strcpyW
(
dst
,
src
);
if
((
dst
=
heap_alloc
(
(
lstrlenW
(
src
)
+
1
)
*
sizeof
(
WCHAR
)
)))
l
strcpyW
(
dst
,
src
);
return
dst
;
}
...
...
@@ -213,21 +212,21 @@ static BOOL is_local_machine( const WCHAR *name, DWORD len )
DWORD
buflen
=
ARRAY_SIZE
(
buf
);
if
(
!
GetComputerNameW
(
buf
,
&
buflen
))
return
FALSE
;
return
len
==
buflen
&&
!
strncmpiW
(
name
,
buf
,
buflen
);
return
len
==
buflen
&&
!
wcsnicmp
(
name
,
buf
,
buflen
);
}
static
BOOL
pdh_match_path
(
LPCWSTR
fullpath
,
LPCWSTR
path
)
{
const
WCHAR
*
p
;
if
(
path
[
0
]
==
'\\'
&&
path
[
1
]
==
'\\'
&&
(
p
=
strchrW
(
path
+
2
,
'\\'
))
&&
if
(
path
[
0
]
==
'\\'
&&
path
[
1
]
==
'\\'
&&
(
p
=
wcschr
(
path
+
2
,
'\\'
))
&&
is_local_machine
(
path
+
2
,
p
-
path
-
2
))
{
path
+=
p
-
path
;
}
if
(
strchrW
(
path
,
'\\'
))
p
=
fullpath
;
else
p
=
strrchrW
(
fullpath
,
'\\'
)
+
1
;
return
!
strcmpW
(
p
,
path
);
if
(
wcschr
(
path
,
'\\'
))
p
=
fullpath
;
else
p
=
wcsrchr
(
fullpath
,
'\\'
)
+
1
;
return
!
wcscmp
(
p
,
path
);
}
/***********************************************************************
...
...
@@ -929,13 +928,13 @@ PDH_STATUS WINAPI PdhLookupPerfNameByIndexW( LPCWSTR machine, DWORD index, LPWST
{
if
(
counter_sources
[
i
].
index
==
index
)
{
WCHAR
*
p
=
strrchrW
(
counter_sources
[
i
].
path
,
'\\'
)
+
1
;
unsigned
int
required
=
strlenW
(
p
)
+
1
;
WCHAR
*
p
=
wcsrchr
(
counter_sources
[
i
].
path
,
'\\'
)
+
1
;
unsigned
int
required
=
l
strlenW
(
p
)
+
1
;
if
(
*
size
<
required
)
ret
=
PDH_MORE_DATA
;
else
{
strcpyW
(
buffer
,
p
);
l
strcpyW
(
buffer
,
p
);
ret
=
ERROR_SUCCESS
;
}
*
size
=
required
;
...
...
@@ -1061,7 +1060,7 @@ PDH_STATUS WINAPI PdhValidatePathA( LPCSTR path )
static
PDH_STATUS
validate_path
(
LPCWSTR
path
)
{
if
(
!
path
||
!*
path
)
return
PDH_INVALID_ARGUMENT
;
if
(
*
path
++
!=
'\\'
||
!
strchrW
(
path
,
'\\'
))
return
PDH_CSTATUS_BAD_COUNTERNAME
;
if
(
*
path
++
!=
'\\'
||
!
wcschr
(
path
,
'\\'
))
return
PDH_CSTATUS_BAD_COUNTERNAME
;
return
ERROR_SUCCESS
;
}
...
...
@@ -1202,30 +1201,30 @@ PDH_STATUS WINAPI PdhMakeCounterPathW( PDH_COUNTER_PATH_ELEMENTS_W *e, LPWSTR bu
path
[
0
]
=
0
;
if
(
e
->
szMachineName
)
{
strcatW
(
path
,
bslash
);
strcatW
(
path
,
bslash
);
strcatW
(
path
,
e
->
szMachineName
);
l
strcatW
(
path
,
bslash
);
l
strcatW
(
path
,
bslash
);
l
strcatW
(
path
,
e
->
szMachineName
);
}
strcatW
(
path
,
bslash
);
strcatW
(
path
,
e
->
szObjectName
);
l
strcatW
(
path
,
bslash
);
l
strcatW
(
path
,
e
->
szObjectName
);
if
(
e
->
szInstanceName
)
{
strcatW
(
path
,
lparen
);
l
strcatW
(
path
,
lparen
);
if
(
e
->
szParentInstance
)
{
strcatW
(
path
,
e
->
szParentInstance
);
strcatW
(
path
,
fslash
);
l
strcatW
(
path
,
e
->
szParentInstance
);
l
strcatW
(
path
,
fslash
);
}
strcatW
(
path
,
e
->
szInstanceName
);
s
printfW
(
instance
,
fmt
,
e
->
dwInstanceIndex
);
strcatW
(
path
,
instance
);
strcatW
(
path
,
rparen
);
l
strcatW
(
path
,
e
->
szInstanceName
);
s
wprintf
(
instance
,
ARRAY_SIZE
(
instance
)
,
fmt
,
e
->
dwInstanceIndex
);
l
strcatW
(
path
,
instance
);
l
strcatW
(
path
,
rparen
);
}
strcatW
(
path
,
bslash
);
strcatW
(
path
,
e
->
szCounterName
);
l
strcatW
(
path
,
bslash
);
l
strcatW
(
path
,
e
->
szCounterName
);
len
=
strlenW
(
path
)
+
1
;
if
(
*
buflen
>=
len
)
strcpyW
(
buffer
,
path
);
len
=
l
strlenW
(
path
)
+
1
;
if
(
*
buflen
>=
len
)
l
strcpyW
(
buffer
,
path
);
else
ret
=
PDH_MORE_DATA
;
*
buflen
=
len
;
return
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