Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
2c80b9d2
Commit
2c80b9d2
authored
Dec 09, 2007
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Dec 10, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pdh: Rename the wrappers around HeapAlloc() &Co to use the standard names.
parent
d9873e23
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
pdh_main.c
dlls/pdh/pdh_main.c
+14
-14
No files found.
dlls/pdh/pdh_main.c
View file @
2c80b9d2
...
@@ -47,17 +47,17 @@ static CRITICAL_SECTION_DEBUG pdh_handle_cs_debug =
...
@@ -47,17 +47,17 @@ static CRITICAL_SECTION_DEBUG pdh_handle_cs_debug =
};
};
static
CRITICAL_SECTION
pdh_handle_cs
=
{
&
pdh_handle_cs_debug
,
-
1
,
0
,
0
,
0
,
0
};
static
CRITICAL_SECTION
pdh_handle_cs
=
{
&
pdh_handle_cs_debug
,
-
1
,
0
,
0
,
0
,
0
};
static
inline
void
*
pdh
_alloc
(
SIZE_T
size
)
static
inline
void
*
heap
_alloc
(
SIZE_T
size
)
{
{
return
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
return
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
}
}
static
inline
void
*
pdh
_alloc_zero
(
SIZE_T
size
)
static
inline
void
*
heap
_alloc_zero
(
SIZE_T
size
)
{
{
return
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
);
return
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
);
}
}
static
inline
void
pdh
_free
(
LPVOID
mem
)
static
inline
void
heap
_free
(
LPVOID
mem
)
{
{
HeapFree
(
GetProcessHeap
(),
0
,
mem
);
HeapFree
(
GetProcessHeap
(),
0
,
mem
);
}
}
...
@@ -67,7 +67,7 @@ static inline WCHAR *pdh_strdup( const WCHAR *src )
...
@@ -67,7 +67,7 @@ static inline WCHAR *pdh_strdup( const WCHAR *src )
WCHAR
*
dst
;
WCHAR
*
dst
;
if
(
!
src
)
return
NULL
;
if
(
!
src
)
return
NULL
;
if
((
dst
=
pdh
_alloc
(
(
strlenW
(
src
)
+
1
)
*
sizeof
(
WCHAR
)
)))
strcpyW
(
dst
,
src
);
if
((
dst
=
heap
_alloc
(
(
strlenW
(
src
)
+
1
)
*
sizeof
(
WCHAR
)
)))
strcpyW
(
dst
,
src
);
return
dst
;
return
dst
;
}
}
...
@@ -78,7 +78,7 @@ static inline WCHAR *pdh_strdup_aw( const char *src )
...
@@ -78,7 +78,7 @@ static inline WCHAR *pdh_strdup_aw( const char *src )
if
(
!
src
)
return
NULL
;
if
(
!
src
)
return
NULL
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
src
,
-
1
,
NULL
,
0
);
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
src
,
-
1
,
NULL
,
0
);
if
((
dst
=
pdh
_alloc
(
len
*
sizeof
(
WCHAR
)
)))
MultiByteToWideChar
(
CP_ACP
,
0
,
src
,
-
1
,
dst
,
len
);
if
((
dst
=
heap
_alloc
(
len
*
sizeof
(
WCHAR
)
)))
MultiByteToWideChar
(
CP_ACP
,
0
,
src
,
-
1
,
dst
,
len
);
return
dst
;
return
dst
;
}
}
...
@@ -127,7 +127,7 @@ static struct counter *create_counter( void )
...
@@ -127,7 +127,7 @@ static struct counter *create_counter( void )
{
{
struct
counter
*
counter
;
struct
counter
*
counter
;
if
((
counter
=
pdh
_alloc_zero
(
sizeof
(
struct
counter
)
)))
if
((
counter
=
heap
_alloc_zero
(
sizeof
(
struct
counter
)
)))
{
{
counter
->
magic
=
PDH_MAGIC_COUNTER
;
counter
->
magic
=
PDH_MAGIC_COUNTER
;
return
counter
;
return
counter
;
...
@@ -138,8 +138,8 @@ static struct counter *create_counter( void )
...
@@ -138,8 +138,8 @@ static struct counter *create_counter( void )
static
void
destroy_counter
(
struct
counter
*
counter
)
static
void
destroy_counter
(
struct
counter
*
counter
)
{
{
counter
->
magic
=
0
;
counter
->
magic
=
0
;
pdh
_free
(
counter
->
path
);
heap
_free
(
counter
->
path
);
pdh
_free
(
counter
);
heap
_free
(
counter
);
}
}
#define PDH_MAGIC_QUERY 0x50444830
/* 'PDH0' */
#define PDH_MAGIC_QUERY 0x50444830
/* 'PDH0' */
...
@@ -159,7 +159,7 @@ static struct query *create_query( void )
...
@@ -159,7 +159,7 @@ static struct query *create_query( void )
{
{
struct
query
*
query
;
struct
query
*
query
;
if
((
query
=
pdh
_alloc_zero
(
sizeof
(
struct
query
)
)))
if
((
query
=
heap
_alloc_zero
(
sizeof
(
struct
query
)
)))
{
{
query
->
magic
=
PDH_MAGIC_QUERY
;
query
->
magic
=
PDH_MAGIC_QUERY
;
list_init
(
&
query
->
counters
);
list_init
(
&
query
->
counters
);
...
@@ -171,7 +171,7 @@ static struct query *create_query( void )
...
@@ -171,7 +171,7 @@ static struct query *create_query( void )
static
void
destroy_query
(
struct
query
*
query
)
static
void
destroy_query
(
struct
query
*
query
)
{
{
query
->
magic
=
0
;
query
->
magic
=
0
;
pdh
_free
(
query
);
heap
_free
(
query
);
}
}
struct
source
struct
source
...
@@ -244,7 +244,7 @@ PDH_STATUS WINAPI PdhAddCounterA( PDH_HQUERY query, LPCSTR path,
...
@@ -244,7 +244,7 @@ PDH_STATUS WINAPI PdhAddCounterA( PDH_HQUERY query, LPCSTR path,
ret
=
PdhAddCounterW
(
query
,
pathW
,
userdata
,
counter
);
ret
=
PdhAddCounterW
(
query
,
pathW
,
userdata
,
counter
);
pdh
_free
(
pathW
);
heap
_free
(
pathW
);
return
ret
;
return
ret
;
}
}
...
@@ -795,7 +795,7 @@ PDH_STATUS WINAPI PdhLookupPerfIndexByNameA( LPCSTR machine, LPCSTR name, LPDWOR
...
@@ -795,7 +795,7 @@ PDH_STATUS WINAPI PdhLookupPerfIndexByNameA( LPCSTR machine, LPCSTR name, LPDWOR
ret
=
PdhLookupPerfIndexByNameW
(
NULL
,
nameW
,
index
);
ret
=
PdhLookupPerfIndexByNameW
(
NULL
,
nameW
,
index
);
pdh
_free
(
nameW
);
heap
_free
(
nameW
);
return
ret
;
return
ret
;
}
}
...
@@ -909,7 +909,7 @@ PDH_STATUS WINAPI PdhOpenQueryA( LPCSTR source, DWORD_PTR userdata, PDH_HQUERY *
...
@@ -909,7 +909,7 @@ PDH_STATUS WINAPI PdhOpenQueryA( LPCSTR source, DWORD_PTR userdata, PDH_HQUERY *
if
(
source
&&
!
(
sourceW
=
pdh_strdup_aw
(
source
)))
return
PDH_MEMORY_ALLOCATION_FAILURE
;
if
(
source
&&
!
(
sourceW
=
pdh_strdup_aw
(
source
)))
return
PDH_MEMORY_ALLOCATION_FAILURE
;
ret
=
PdhOpenQueryW
(
sourceW
,
userdata
,
query
);
ret
=
PdhOpenQueryW
(
sourceW
,
userdata
,
query
);
pdh
_free
(
sourceW
);
heap
_free
(
sourceW
);
return
ret
;
return
ret
;
}
}
...
@@ -1005,7 +1005,7 @@ PDH_STATUS WINAPI PdhValidatePathA( LPCSTR path )
...
@@ -1005,7 +1005,7 @@ PDH_STATUS WINAPI PdhValidatePathA( LPCSTR path )
ret
=
PdhValidatePathW
(
pathW
);
ret
=
PdhValidatePathW
(
pathW
);
pdh
_free
(
pathW
);
heap
_free
(
pathW
);
return
ret
;
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