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
0e06db39
Commit
0e06db39
authored
Sep 02, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Sep 02, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wmiutils: Use CRT allocation functions.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
e0ca118f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
83 deletions
+73
-83
path.c
dlls/wmiutils/path.c
+71
-71
statuscode.c
dlls/wmiutils/statuscode.c
+2
-2
wmiutils_private.h
dlls/wmiutils/wmiutils_private.h
+0
-10
No files found.
dlls/wmiutils/path.c
View file @
0e06db39
...
...
@@ -91,7 +91,7 @@ static ULONG WINAPI keylist_Release(
{
TRACE
(
"destroying %p
\n
"
,
keylist
);
IWbemPath_Release
(
keylist
->
parent
);
heap_
free
(
keylist
);
free
(
keylist
);
}
return
refs
;
}
...
...
@@ -204,10 +204,10 @@ static void free_keys( struct key *keys, unsigned int count )
for
(
i
=
0
;
i
<
count
;
i
++
)
{
heap_
free
(
keys
[
i
].
name
);
heap_
free
(
keys
[
i
].
value
);
free
(
keys
[
i
].
name
);
free
(
keys
[
i
].
value
);
}
heap_
free
(
keys
);
free
(
keys
);
}
static
HRESULT
WINAPI
keylist_RemoveAllKeys
(
...
...
@@ -281,7 +281,7 @@ static HRESULT WbemPathKeyList_create( IWbemPath *parent, LPVOID *ppObj )
TRACE
(
"%p
\n
"
,
ppObj
);
if
(
!
(
keylist
=
heap_alloc
(
sizeof
(
*
keylist
)
)))
return
E_OUTOFMEMORY
;
if
(
!
(
keylist
=
calloc
(
1
,
sizeof
(
*
keylist
)
)))
return
E_OUTOFMEMORY
;
keylist
->
IWbemPathKeyList_iface
.
lpVtbl
=
&
keylist_vtbl
;
keylist
->
refs
=
1
;
...
...
@@ -314,12 +314,12 @@ static void clear_path( struct path *path )
{
unsigned
int
i
;
heap_
free
(
path
->
text
);
heap_
free
(
path
->
server
);
for
(
i
=
0
;
i
<
path
->
num_namespaces
;
i
++
)
heap_
free
(
path
->
namespaces
[
i
]
);
heap_
free
(
path
->
namespaces
);
heap_
free
(
path
->
len_namespaces
);
heap_
free
(
path
->
class
);
free
(
path
->
text
);
free
(
path
->
server
);
for
(
i
=
0
;
i
<
path
->
num_namespaces
;
i
++
)
free
(
path
->
namespaces
[
i
]
);
free
(
path
->
namespaces
);
free
(
path
->
len_namespaces
);
free
(
path
->
class
);
free_keys
(
path
->
keys
,
path
->
num_keys
);
init_path
(
path
);
}
...
...
@@ -342,7 +342,7 @@ static ULONG WINAPI path_Release(
clear_path
(
path
);
path
->
cs
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
path
->
cs
);
heap_
free
(
path
);
free
(
path
);
}
return
refs
;
}
...
...
@@ -382,7 +382,7 @@ static HRESULT parse_key( struct key *key, const WCHAR *str, unsigned int *ret_l
q
++
;
}
len
=
q
-
p
;
if
(
!
(
key
->
name
=
heap_
alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
return
E_OUTOFMEMORY
;
if
(
!
(
key
->
name
=
m
alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
return
E_OUTOFMEMORY
;
memcpy
(
key
->
name
,
p
,
len
*
sizeof
(
WCHAR
)
);
key
->
name
[
len
]
=
0
;
key
->
len_name
=
len
;
...
...
@@ -392,7 +392,7 @@ static HRESULT parse_key( struct key *key, const WCHAR *str, unsigned int *ret_l
while
(
*
q
&&
*
q
!=
','
)
q
++
;
len
=
q
-
p
;
if
(
!
(
key
->
value
=
heap_
alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
return
E_OUTOFMEMORY
;
if
(
!
(
key
->
value
=
m
alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
return
E_OUTOFMEMORY
;
memcpy
(
key
->
value
,
p
,
len
*
sizeof
(
WCHAR
)
);
key
->
value
[
len
]
=
0
;
key
->
len_value
=
len
;
...
...
@@ -415,7 +415,7 @@ static HRESULT parse_text( struct path *path, ULONG mode, const WCHAR *text )
q
=
p
;
while
(
*
q
&&
*
q
!=
'\\'
&&
*
q
!=
'/'
)
q
++
;
len
=
q
-
p
;
if
(
!
(
path
->
server
=
heap_
alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
goto
done
;
if
(
!
(
path
->
server
=
m
alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
goto
done
;
memcpy
(
path
->
server
,
p
,
len
*
sizeof
(
WCHAR
)
);
path
->
server
[
len
]
=
0
;
path
->
len_server
=
len
;
...
...
@@ -437,8 +437,8 @@ static HRESULT parse_text( struct path *path, ULONG mode, const WCHAR *text )
}
if
(
path
->
num_namespaces
)
{
if
(
!
(
path
->
namespaces
=
heap_
alloc
(
path
->
num_namespaces
*
sizeof
(
WCHAR
*
)
)))
goto
done
;
if
(
!
(
path
->
len_namespaces
=
heap_
alloc
(
path
->
num_namespaces
*
sizeof
(
int
)
)))
goto
done
;
if
(
!
(
path
->
namespaces
=
m
alloc
(
path
->
num_namespaces
*
sizeof
(
WCHAR
*
)
)))
goto
done
;
if
(
!
(
path
->
len_namespaces
=
m
alloc
(
path
->
num_namespaces
*
sizeof
(
int
)
)))
goto
done
;
i
=
0
;
q
=
p
;
...
...
@@ -447,7 +447,7 @@ static HRESULT parse_text( struct path *path, ULONG mode, const WCHAR *text )
p
=
q
;
while
(
*
p
&&
*
p
!=
'\\'
&&
*
p
!=
'/'
&&
*
p
!=
':'
)
p
++
;
len
=
p
-
q
;
if
(
!
(
path
->
namespaces
[
i
]
=
heap_
alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
goto
done
;
if
(
!
(
path
->
namespaces
[
i
]
=
m
alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
goto
done
;
memcpy
(
path
->
namespaces
[
i
],
q
,
len
*
sizeof
(
WCHAR
)
);
path
->
namespaces
[
i
][
len
]
=
0
;
path
->
len_namespaces
[
i
]
=
len
;
...
...
@@ -461,7 +461,7 @@ static HRESULT parse_text( struct path *path, ULONG mode, const WCHAR *text )
p
=
q
+
1
;
while
(
*
p
&&
*
p
!=
'\\'
&&
*
p
!=
'/'
&&
*
p
!=
':'
)
p
++
;
len
=
p
-
q
-
1
;
if
(
!
(
path
->
namespaces
[
i
]
=
heap_
alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
goto
done
;
if
(
!
(
path
->
namespaces
[
i
]
=
m
alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
goto
done
;
memcpy
(
path
->
namespaces
[
i
],
q
+
1
,
len
*
sizeof
(
WCHAR
)
);
path
->
namespaces
[
i
][
len
]
=
0
;
path
->
len_namespaces
[
i
]
=
len
;
...
...
@@ -474,7 +474,7 @@ static HRESULT parse_text( struct path *path, ULONG mode, const WCHAR *text )
p
=
q
;
while
(
*
q
&&
*
q
!=
'.'
)
q
++
;
len
=
q
-
p
;
if
(
!
(
path
->
class
=
heap_
alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
goto
done
;
if
(
!
(
path
->
class
=
m
alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
goto
done
;
memcpy
(
path
->
class
,
p
,
len
*
sizeof
(
WCHAR
)
);
path
->
class
[
len
]
=
0
;
path
->
len_class
=
len
;
...
...
@@ -488,7 +488,7 @@ static HRESULT parse_text( struct path *path, ULONG mode, const WCHAR *text )
if
(
*
q
==
','
)
path
->
num_keys
++
;
q
++
;
}
if
(
!
(
path
->
keys
=
heap_alloc_zero
(
path
->
num_keys
*
sizeof
(
struct
key
)
)))
goto
done
;
if
(
!
(
path
->
keys
=
calloc
(
path
->
num_keys
,
sizeof
(
struct
key
)
)))
goto
done
;
i
=
0
;
q
=
p
;
while
(
*
q
)
...
...
@@ -528,7 +528,7 @@ static HRESULT WINAPI path_SetText(
if
((
hr
=
parse_text
(
path
,
uMode
,
pszPath
))
!=
S_OK
)
goto
done
;
len
=
lstrlenW
(
pszPath
);
if
(
!
(
path
->
text
=
heap_
alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
if
(
!
(
path
->
text
=
m
alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
{
clear_path
(
path
);
hr
=
E_OUTOFMEMORY
;
...
...
@@ -553,7 +553,7 @@ static WCHAR *build_namespace( struct path *path, int *len, BOOL leading_slash )
if
(
i
>
0
||
leading_slash
)
*
len
+=
1
;
*
len
+=
path
->
len_namespaces
[
i
];
}
if
(
!
(
p
=
ret
=
heap_
alloc
(
(
*
len
+
1
)
*
sizeof
(
WCHAR
)
)))
return
NULL
;
if
(
!
(
p
=
ret
=
m
alloc
(
(
*
len
+
1
)
*
sizeof
(
WCHAR
)
)))
return
NULL
;
for
(
i
=
0
;
i
<
path
->
num_namespaces
;
i
++
)
{
if
(
i
>
0
||
leading_slash
)
*
p
++
=
'\\'
;
...
...
@@ -571,7 +571,7 @@ static WCHAR *build_server( struct path *path, int *len )
*
len
=
0
;
if
(
path
->
len_server
)
*
len
+=
2
+
path
->
len_server
;
else
*
len
+=
3
;
if
(
!
(
p
=
ret
=
heap_
alloc
(
(
*
len
+
1
)
*
sizeof
(
WCHAR
)
)))
return
NULL
;
if
(
!
(
p
=
ret
=
m
alloc
(
(
*
len
+
1
)
*
sizeof
(
WCHAR
)
)))
return
NULL
;
if
(
path
->
len_server
)
{
p
[
0
]
=
p
[
1
]
=
'\\'
;
...
...
@@ -597,7 +597,7 @@ static WCHAR *build_keylist( struct path *path, int *len )
if
(
i
>
0
)
*
len
+=
1
;
*
len
+=
path
->
keys
[
i
].
len_name
+
path
->
keys
[
i
].
len_value
+
1
;
}
if
(
!
(
p
=
ret
=
heap_
alloc
(
(
*
len
+
1
)
*
sizeof
(
WCHAR
)
)))
return
NULL
;
if
(
!
(
p
=
ret
=
m
alloc
(
(
*
len
+
1
)
*
sizeof
(
WCHAR
)
)))
return
NULL
;
for
(
i
=
0
;
i
<
path
->
num_keys
;
i
++
)
{
if
(
i
>
0
)
*
p
++
=
','
;
...
...
@@ -624,8 +624,8 @@ static WCHAR *build_path( struct path *path, LONG flags, int *len )
if
(
!
namespace
||
!
keylist
)
{
heap_
free
(
namespace
);
heap_
free
(
keylist
);
free
(
namespace
);
free
(
keylist
);
return
NULL
;
}
*
len
=
len_namespace
;
...
...
@@ -634,10 +634,10 @@ static WCHAR *build_path( struct path *path, LONG flags, int *len )
*
len
+=
path
->
len_class
+
1
;
if
(
path
->
num_keys
)
*
len
+=
len_keylist
+
1
;
}
if
(
!
(
ret
=
heap_
alloc
(
(
*
len
+
1
)
*
sizeof
(
WCHAR
)
)))
if
(
!
(
ret
=
m
alloc
(
(
*
len
+
1
)
*
sizeof
(
WCHAR
)
)))
{
heap_
free
(
namespace
);
heap_
free
(
keylist
);
free
(
namespace
);
free
(
keylist
);
return
NULL
;
}
lstrcpyW
(
ret
,
namespace
);
...
...
@@ -651,8 +651,8 @@ static WCHAR *build_path( struct path *path, LONG flags, int *len )
lstrcpyW
(
ret
+
len_namespace
+
path
->
len_class
+
2
,
keylist
);
}
}
heap_
free
(
namespace
);
heap_
free
(
keylist
);
free
(
namespace
);
free
(
keylist
);
return
ret
;
}
...
...
@@ -666,9 +666,9 @@ static WCHAR *build_path( struct path *path, LONG flags, int *len )
*
len
=
path
->
len_class
;
if
(
path
->
num_keys
)
*
len
+=
len_keylist
+
1
;
if
(
!
(
ret
=
heap_
alloc
(
(
*
len
+
1
)
*
sizeof
(
WCHAR
)
)))
if
(
!
(
ret
=
m
alloc
(
(
*
len
+
1
)
*
sizeof
(
WCHAR
)
)))
{
heap_
free
(
keylist
);
free
(
keylist
);
return
NULL
;
}
lstrcpyW
(
ret
,
path
->
class
);
...
...
@@ -677,7 +677,7 @@ static WCHAR *build_path( struct path *path, LONG flags, int *len )
ret
[
path
->
len_class
]
=
'.'
;
lstrcpyW
(
ret
+
path
->
len_class
+
1
,
keylist
);
}
heap_
free
(
keylist
);
free
(
keylist
);
return
ret
;
}
case
WBEMPATH_GET_SERVER_TOO
:
...
...
@@ -689,9 +689,9 @@ static WCHAR *build_path( struct path *path, LONG flags, int *len )
if
(
!
namespace
||
!
server
||
!
keylist
)
{
heap_
free
(
namespace
);
heap_
free
(
server
);
heap_
free
(
keylist
);
free
(
namespace
);
free
(
server
);
free
(
keylist
);
return
NULL
;
}
*
len
=
len_namespace
+
len_server
;
...
...
@@ -700,11 +700,11 @@ static WCHAR *build_path( struct path *path, LONG flags, int *len )
*
len
+=
path
->
len_class
+
1
;
if
(
path
->
num_keys
)
*
len
+=
len_keylist
+
1
;
}
if
(
!
(
p
=
ret
=
heap_
alloc
(
(
*
len
+
1
)
*
sizeof
(
WCHAR
)
)))
if
(
!
(
p
=
ret
=
m
alloc
(
(
*
len
+
1
)
*
sizeof
(
WCHAR
)
)))
{
heap_
free
(
namespace
);
heap_
free
(
server
);
heap_
free
(
keylist
);
free
(
namespace
);
free
(
server
);
free
(
keylist
);
return
NULL
;
}
lstrcpyW
(
p
,
server
);
...
...
@@ -721,9 +721,9 @@ static WCHAR *build_path( struct path *path, LONG flags, int *len )
lstrcpyW
(
p
+
path
->
len_class
+
1
,
keylist
);
}
}
heap_
free
(
namespace
);
heap_
free
(
server
);
heap_
free
(
keylist
);
free
(
namespace
);
free
(
server
);
free
(
keylist
);
return
ret
;
}
case
WBEMPATH_GET_SERVER_AND_NAMESPACE_ONLY
:
...
...
@@ -734,22 +734,22 @@ static WCHAR *build_path( struct path *path, LONG flags, int *len )
if
(
!
namespace
||
!
server
)
{
heap_
free
(
namespace
);
heap_
free
(
server
);
free
(
namespace
);
free
(
server
);
return
NULL
;
}
*
len
=
len_namespace
+
len_server
;
if
(
!
(
p
=
ret
=
heap_
alloc
(
(
*
len
+
1
)
*
sizeof
(
WCHAR
)
)))
if
(
!
(
p
=
ret
=
m
alloc
(
(
*
len
+
1
)
*
sizeof
(
WCHAR
)
)))
{
heap_
free
(
namespace
);
heap_
free
(
server
);
free
(
namespace
);
free
(
server
);
return
NULL
;
}
lstrcpyW
(
p
,
server
);
p
+=
len_server
;
lstrcpyW
(
p
,
namespace
);
heap_
free
(
namespace
);
heap_
free
(
server
);
free
(
namespace
);
free
(
server
);
return
ret
;
}
case
WBEMPATH_GET_NAMESPACE_ONLY
:
...
...
@@ -758,7 +758,7 @@ static WCHAR *build_path( struct path *path, LONG flags, int *len )
case
WBEMPATH_GET_ORIGINAL
:
if
(
!
path
->
len_text
)
return
NULL
;
*
len
=
path
->
len_text
;
return
strdupW
(
path
->
text
);
return
wcsdup
(
path
->
text
);
default:
ERR
(
"unhandled flags %#lx
\n
"
,
flags
);
...
...
@@ -801,7 +801,7 @@ static HRESULT WINAPI path_GetText(
TRACE
(
"returning %s
\n
"
,
debugstr_w
(
pszText
));
done:
heap_
free
(
str
);
free
(
str
);
LeaveCriticalSection
(
&
path
->
cs
);
return
hr
;
}
...
...
@@ -858,19 +858,19 @@ static HRESULT WINAPI path_SetServer(
if
(
name
)
{
if
(
!
(
server
=
strdupW
(
name
)))
if
(
!
(
server
=
wcsdup
(
name
)))
{
LeaveCriticalSection
(
&
path
->
cs
);
return
WBEM_E_OUT_OF_MEMORY
;
}
heap_
free
(
path
->
server
);
free
(
path
->
server
);
path
->
server
=
server
;
path
->
len_server
=
lstrlenW
(
path
->
server
);
path
->
flags
|=
flags
;
}
else
{
heap_
free
(
path
->
server
);
free
(
path
->
server
);
path
->
server
=
NULL
;
path
->
len_server
=
0
;
path
->
flags
&=
~
flags
;
...
...
@@ -943,27 +943,27 @@ static HRESULT WINAPI path_SetNamespaceAt(
LeaveCriticalSection
(
&
path
->
cs
);
return
WBEM_E_INVALID_PARAMETER
;
}
if
(
!
(
new
=
strdupW
(
name
)))
if
(
!
(
new
=
wcsdup
(
name
)))
{
LeaveCriticalSection
(
&
path
->
cs
);
return
WBEM_E_OUT_OF_MEMORY
;
}
size
=
(
path
->
num_namespaces
+
1
)
*
sizeof
(
WCHAR
*
);
if
(
path
->
namespaces
)
tmp
=
heap_
realloc
(
path
->
namespaces
,
size
);
else
tmp
=
heap_
alloc
(
size
);
if
(
path
->
namespaces
)
tmp
=
realloc
(
path
->
namespaces
,
size
);
else
tmp
=
m
alloc
(
size
);
if
(
!
tmp
)
{
heap_
free
(
new
);
free
(
new
);
LeaveCriticalSection
(
&
path
->
cs
);
return
WBEM_E_OUT_OF_MEMORY
;
}
path
->
namespaces
=
tmp
;
size
=
(
path
->
num_namespaces
+
1
)
*
sizeof
(
int
);
if
(
path
->
len_namespaces
)
tmp_len
=
heap_
realloc
(
path
->
len_namespaces
,
size
);
else
tmp_len
=
heap_
alloc
(
size
);
if
(
path
->
len_namespaces
)
tmp_len
=
realloc
(
path
->
len_namespaces
,
size
);
else
tmp_len
=
m
alloc
(
size
);
if
(
!
tmp_len
)
{
heap_
free
(
new
);
free
(
new
);
LeaveCriticalSection
(
&
path
->
cs
);
return
WBEM_E_OUT_OF_MEMORY
;
}
...
...
@@ -1021,7 +1021,7 @@ static HRESULT WINAPI path_RemoveNamespaceAt(
LeaveCriticalSection
(
&
path
->
cs
);
return
WBEM_E_INVALID_PARAMETER
;
}
heap_
free
(
path
->
namespaces
[
idx
]
);
free
(
path
->
namespaces
[
idx
]
);
while
(
idx
<
path
->
num_namespaces
-
1
)
{
path
->
namespaces
[
idx
]
=
path
->
namespaces
[
idx
+
1
];
...
...
@@ -1044,11 +1044,11 @@ static HRESULT WINAPI path_RemoveAllNamespaces(
EnterCriticalSection
(
&
path
->
cs
);
for
(
i
=
0
;
i
<
path
->
num_namespaces
;
i
++
)
heap_
free
(
path
->
namespaces
[
i
]
);
for
(
i
=
0
;
i
<
path
->
num_namespaces
;
i
++
)
free
(
path
->
namespaces
[
i
]
);
path
->
num_namespaces
=
0
;
heap_
free
(
path
->
namespaces
);
free
(
path
->
namespaces
);
path
->
namespaces
=
NULL
;
heap_
free
(
path
->
len_namespaces
);
free
(
path
->
len_namespaces
);
path
->
len_namespaces
=
NULL
;
LeaveCriticalSection
(
&
path
->
cs
);
...
...
@@ -1127,11 +1127,11 @@ static HRESULT WINAPI path_SetClassName(
TRACE
(
"%p, %s
\n
"
,
iface
,
debugstr_w
(
name
));
if
(
!
name
)
return
WBEM_E_INVALID_PARAMETER
;
if
(
!
(
class
=
strdupW
(
name
)))
return
WBEM_E_OUT_OF_MEMORY
;
if
(
!
(
class
=
wcsdup
(
name
)))
return
WBEM_E_OUT_OF_MEMORY
;
EnterCriticalSection
(
&
path
->
cs
);
heap_
free
(
path
->
class
);
free
(
path
->
class
);
path
->
class
=
class
;
path
->
len_class
=
lstrlenW
(
path
->
class
);
path
->
flags
|=
WBEMPATH_INFO_V2_COMPLIANT
|
WBEMPATH_INFO_CIM_COMPLIANT
;
...
...
@@ -1278,7 +1278,7 @@ HRESULT WbemPath_create( LPVOID *ppObj )
TRACE
(
"%p
\n
"
,
ppObj
);
if
(
!
(
path
=
heap_alloc
(
sizeof
(
*
path
)
)))
return
E_OUTOFMEMORY
;
if
(
!
(
path
=
calloc
(
1
,
sizeof
(
*
path
)
)))
return
E_OUTOFMEMORY
;
path
->
IWbemPath_iface
.
lpVtbl
=
&
path_vtbl
;
path
->
refs
=
1
;
...
...
dlls/wmiutils/statuscode.c
View file @
0e06db39
...
...
@@ -57,7 +57,7 @@ static ULONG WINAPI status_code_Release(
if
(
!
refs
)
{
TRACE
(
"destroying %p
\n
"
,
status_code
);
heap_
free
(
status_code
);
free
(
status_code
);
}
return
refs
;
}
...
...
@@ -132,7 +132,7 @@ HRESULT WbemStatusCodeText_create( LPVOID *ppObj )
TRACE
(
"(%p)
\n
"
,
ppObj
);
if
(
!
(
sc
=
heap_alloc
(
sizeof
(
*
sc
)
)))
return
E_OUTOFMEMORY
;
if
(
!
(
sc
=
calloc
(
1
,
sizeof
(
*
sc
)
)))
return
E_OUTOFMEMORY
;
sc
->
IWbemStatusCodeText_iface
.
lpVtbl
=
&
status_code_vtbl
;
sc
->
refs
=
1
;
...
...
dlls/wmiutils/wmiutils_private.h
View file @
0e06db39
...
...
@@ -16,15 +16,5 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "wine/heap.h"
HRESULT
WbemPath_create
(
LPVOID
*
)
DECLSPEC_HIDDEN
;
HRESULT
WbemStatusCodeText_create
(
LPVOID
*
)
DECLSPEC_HIDDEN
;
static
inline
WCHAR
*
strdupW
(
const
WCHAR
*
src
)
{
WCHAR
*
dst
;
if
(
!
src
)
return
NULL
;
if
((
dst
=
heap_alloc
(
(
lstrlenW
(
src
)
+
1
)
*
sizeof
(
WCHAR
)
)))
lstrcpyW
(
dst
,
src
);
return
dst
;
}
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