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
d3fe9faf
Commit
d3fe9faf
authored
Mar 30, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fusion: Use CRT memory allocation functions.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a4061238
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
64 additions
and
80 deletions
+64
-80
asmcache.c
dlls/fusion/asmcache.c
+22
-22
asmenum.c
dlls/fusion/asmenum.c
+7
-7
asmname.c
dlls/fusion/asmname.c
+22
-24
assembly.c
dlls/fusion/assembly.c
+13
-13
fusionpriv.h
dlls/fusion/fusionpriv.h
+0
-14
No files found.
dlls/fusion/asmcache.c
View file @
d3fe9faf
...
@@ -62,7 +62,7 @@ static BOOL create_full_path(LPCWSTR path)
...
@@ -62,7 +62,7 @@ static BOOL create_full_path(LPCWSTR path)
BOOL
ret
=
TRUE
;
BOOL
ret
=
TRUE
;
int
len
;
int
len
;
if
(
!
(
new_path
=
heap_
alloc
((
lstrlenW
(
path
)
+
1
)
*
sizeof
(
WCHAR
))))
return
FALSE
;
if
(
!
(
new_path
=
m
alloc
((
lstrlenW
(
path
)
+
1
)
*
sizeof
(
WCHAR
))))
return
FALSE
;
lstrcpyW
(
new_path
,
path
);
lstrcpyW
(
new_path
,
path
);
...
@@ -100,7 +100,7 @@ static BOOL create_full_path(LPCWSTR path)
...
@@ -100,7 +100,7 @@ static BOOL create_full_path(LPCWSTR path)
new_path
[
len
]
=
'\\'
;
new_path
[
len
]
=
'\\'
;
}
}
heap_
free
(
new_path
);
free
(
new_path
);
return
ret
;
return
ret
;
}
}
...
@@ -197,7 +197,7 @@ static ULONG WINAPI IAssemblyCacheImpl_Release(IAssemblyCache *iface)
...
@@ -197,7 +197,7 @@ static ULONG WINAPI IAssemblyCacheImpl_Release(IAssemblyCache *iface)
if
(
!
refCount
)
if
(
!
refCount
)
{
{
CloseHandle
(
cache
->
lock
);
CloseHandle
(
cache
->
lock
);
heap_
free
(
cache
);
free
(
cache
);
}
}
return
refCount
;
return
refCount
;
}
}
...
@@ -255,7 +255,7 @@ static HRESULT WINAPI IAssemblyCacheImpl_UninstallAssembly(IAssemblyCache *iface
...
@@ -255,7 +255,7 @@ static HRESULT WINAPI IAssemblyCacheImpl_UninstallAssembly(IAssemblyCache *iface
if
(
hr
!=
HRESULT_FROM_WIN32
(
ERROR_INSUFFICIENT_BUFFER
))
if
(
hr
!=
HRESULT_FROM_WIN32
(
ERROR_INSUFFICIENT_BUFFER
))
goto
done
;
goto
done
;
if
(
!
(
path
=
heap_
alloc
(
len
*
sizeof
(
WCHAR
)
)))
if
(
!
(
path
=
m
alloc
(
len
*
sizeof
(
WCHAR
)
)))
{
{
hr
=
E_OUTOFMEMORY
;
hr
=
E_OUTOFMEMORY
;
goto
done
;
goto
done
;
...
@@ -290,7 +290,7 @@ done:
...
@@ -290,7 +290,7 @@ done:
IAssemblyName_Release
(
asmname
);
IAssemblyName_Release
(
asmname
);
if
(
next
)
IAssemblyName_Release
(
next
);
if
(
next
)
IAssemblyName_Release
(
next
);
if
(
asmenum
)
IAssemblyEnum_Release
(
asmenum
);
if
(
asmenum
)
IAssemblyEnum_Release
(
asmenum
);
heap_
free
(
path
);
free
(
path
);
cache_unlock
(
cache
);
cache_unlock
(
cache
);
return
hr
;
return
hr
;
}
}
...
@@ -372,7 +372,7 @@ static HRESULT WINAPI IAssemblyCacheImpl_CreateAssemblyCacheItem(IAssemblyCache
...
@@ -372,7 +372,7 @@ static HRESULT WINAPI IAssemblyCacheImpl_CreateAssemblyCacheItem(IAssemblyCache
*
ppAsmItem
=
NULL
;
*
ppAsmItem
=
NULL
;
if
(
!
(
item
=
heap_
alloc
(
sizeof
(
*
item
))))
return
E_OUTOFMEMORY
;
if
(
!
(
item
=
m
alloc
(
sizeof
(
*
item
))))
return
E_OUTOFMEMORY
;
item
->
IAssemblyCacheItem_iface
.
lpVtbl
=
&
AssemblyCacheItemVtbl
;
item
->
IAssemblyCacheItem_iface
.
lpVtbl
=
&
AssemblyCacheItemVtbl
;
item
->
ref
=
1
;
item
->
ref
=
1
;
...
@@ -395,22 +395,22 @@ static HRESULT copy_file( const WCHAR *src_dir, DWORD src_len, const WCHAR *dst_
...
@@ -395,22 +395,22 @@ static HRESULT copy_file( const WCHAR *src_dir, DWORD src_len, const WCHAR *dst_
DWORD
len
=
lstrlenW
(
filename
);
DWORD
len
=
lstrlenW
(
filename
);
HRESULT
hr
=
S_OK
;
HRESULT
hr
=
S_OK
;
if
(
!
(
src_file
=
heap_
alloc
(
(
src_len
+
len
+
1
)
*
sizeof
(
WCHAR
)
)))
if
(
!
(
src_file
=
m
alloc
(
(
src_len
+
len
+
1
)
*
sizeof
(
WCHAR
)
)))
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
memcpy
(
src_file
,
src_dir
,
src_len
*
sizeof
(
WCHAR
)
);
memcpy
(
src_file
,
src_dir
,
src_len
*
sizeof
(
WCHAR
)
);
lstrcpyW
(
src_file
+
src_len
,
filename
);
lstrcpyW
(
src_file
+
src_len
,
filename
);
if
(
!
(
dst_file
=
heap_
alloc
(
(
dst_len
+
len
+
1
)
*
sizeof
(
WCHAR
)
)))
if
(
!
(
dst_file
=
m
alloc
(
(
dst_len
+
len
+
1
)
*
sizeof
(
WCHAR
)
)))
{
{
heap_
free
(
src_file
);
free
(
src_file
);
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
}
}
memcpy
(
dst_file
,
dst_dir
,
dst_len
*
sizeof
(
WCHAR
)
);
memcpy
(
dst_file
,
dst_dir
,
dst_len
*
sizeof
(
WCHAR
)
);
lstrcpyW
(
dst_file
+
dst_len
,
filename
);
lstrcpyW
(
dst_file
+
dst_len
,
filename
);
if
(
!
CopyFileW
(
src_file
,
dst_file
,
FALSE
))
hr
=
HRESULT_FROM_WIN32
(
GetLastError
()
);
if
(
!
CopyFileW
(
src_file
,
dst_file
,
FALSE
))
hr
=
HRESULT_FROM_WIN32
(
GetLastError
()
);
heap_
free
(
src_file
);
free
(
src_file
);
heap_
free
(
dst_file
);
free
(
dst_file
);
return
hr
;
return
hr
;
}
}
...
@@ -483,7 +483,7 @@ static HRESULT WINAPI IAssemblyCacheImpl_InstallAssembly(IAssemblyCache *iface,
...
@@ -483,7 +483,7 @@ static HRESULT WINAPI IAssemblyCacheImpl_InstallAssembly(IAssemblyCache *iface,
get_assembly_directory
(
asmdir
,
MAX_PATH
,
clr_version
,
architecture
);
get_assembly_directory
(
asmdir
,
MAX_PATH
,
clr_version
,
architecture
);
dst_len
+=
lstrlenW
(
asmdir
)
+
lstrlenW
(
name
)
+
lstrlenW
(
version
)
+
lstrlenW
(
token
);
dst_len
+=
lstrlenW
(
asmdir
)
+
lstrlenW
(
name
)
+
lstrlenW
(
version
)
+
lstrlenW
(
token
);
if
(
!
(
dst_dir
=
heap_
alloc
(
dst_len
*
sizeof
(
WCHAR
))))
if
(
!
(
dst_dir
=
m
alloc
(
dst_len
*
sizeof
(
WCHAR
))))
{
{
hr
=
E_OUTOFMEMORY
;
hr
=
E_OUTOFMEMORY
;
goto
done
;
goto
done
;
...
@@ -523,13 +523,13 @@ static HRESULT WINAPI IAssemblyCacheImpl_InstallAssembly(IAssemblyCache *iface,
...
@@ -523,13 +523,13 @@ static HRESULT WINAPI IAssemblyCacheImpl_InstallAssembly(IAssemblyCache *iface,
}
}
done:
done:
heap_
free
(
name
);
free
(
name
);
heap_
free
(
token
);
free
(
token
);
heap_
free
(
version
);
free
(
version
);
heap_
free
(
asmpath
);
free
(
asmpath
);
heap_
free
(
dst_dir
);
free
(
dst_dir
);
for
(
i
=
0
;
i
<
count
;
i
++
)
heap_
free
(
external_files
[
i
]);
for
(
i
=
0
;
i
<
count
;
i
++
)
free
(
external_files
[
i
]);
heap_
free
(
external_files
);
free
(
external_files
);
assembly_release
(
assembly
);
assembly_release
(
assembly
);
cache_unlock
(
cache
);
cache_unlock
(
cache
);
return
hr
;
return
hr
;
...
@@ -560,14 +560,14 @@ HRESULT WINAPI CreateAssemblyCache(IAssemblyCache **ppAsmCache, DWORD dwReserved
...
@@ -560,14 +560,14 @@ HRESULT WINAPI CreateAssemblyCache(IAssemblyCache **ppAsmCache, DWORD dwReserved
*
ppAsmCache
=
NULL
;
*
ppAsmCache
=
NULL
;
if
(
!
(
cache
=
heap_
alloc
(
sizeof
(
*
cache
))))
return
E_OUTOFMEMORY
;
if
(
!
(
cache
=
m
alloc
(
sizeof
(
*
cache
))))
return
E_OUTOFMEMORY
;
cache
->
IAssemblyCache_iface
.
lpVtbl
=
&
AssemblyCacheVtbl
;
cache
->
IAssemblyCache_iface
.
lpVtbl
=
&
AssemblyCacheVtbl
;
cache
->
ref
=
1
;
cache
->
ref
=
1
;
cache
->
lock
=
CreateMutexW
(
NULL
,
FALSE
,
cache_mutex_nameW
);
cache
->
lock
=
CreateMutexW
(
NULL
,
FALSE
,
cache_mutex_nameW
);
if
(
!
cache
->
lock
)
if
(
!
cache
->
lock
)
{
{
heap_
free
(
cache
);
free
(
cache
);
return
HRESULT_FROM_WIN32
(
GetLastError
()
);
return
HRESULT_FROM_WIN32
(
GetLastError
()
);
}
}
*
ppAsmCache
=
&
cache
->
IAssemblyCache_iface
;
*
ppAsmCache
=
&
cache
->
IAssemblyCache_iface
;
...
@@ -620,7 +620,7 @@ static ULONG WINAPI IAssemblyCacheItemImpl_Release(IAssemblyCacheItem *iface)
...
@@ -620,7 +620,7 @@ static ULONG WINAPI IAssemblyCacheItemImpl_Release(IAssemblyCacheItem *iface)
TRACE
(
"(%p)->(ref before = %lu)
\n
"
,
This
,
refCount
+
1
);
TRACE
(
"(%p)->(ref before = %lu)
\n
"
,
This
,
refCount
+
1
);
if
(
!
refCount
)
if
(
!
refCount
)
heap_
free
(
This
);
free
(
This
);
return
refCount
;
return
refCount
;
}
}
...
...
dlls/fusion/asmenum.c
View file @
d3fe9faf
...
@@ -105,10 +105,10 @@ static ULONG WINAPI IAssemblyEnumImpl_Release(IAssemblyEnum *iface)
...
@@ -105,10 +105,10 @@ static ULONG WINAPI IAssemblyEnumImpl_Release(IAssemblyEnum *iface)
list_remove
(
&
asmname
->
entry
);
list_remove
(
&
asmname
->
entry
);
IAssemblyName_Release
(
asmname
->
name
);
IAssemblyName_Release
(
asmname
->
name
);
heap_
free
(
asmname
);
free
(
asmname
);
}
}
heap_
free
(
This
);
free
(
This
);
}
}
return
refCount
;
return
refCount
;
...
@@ -354,7 +354,7 @@ static HRESULT enum_gac_assemblies(struct list *assemblies, IAssemblyName *name,
...
@@ -354,7 +354,7 @@ static HRESULT enum_gac_assemblies(struct list *assemblies, IAssemblyName *name,
}
}
swprintf
(
disp
,
ARRAY_SIZE
(
disp
),
name_fmt
,
parent
,
version
,
token
);
swprintf
(
disp
,
ARRAY_SIZE
(
disp
),
name_fmt
,
parent
,
version
,
token
);
if
(
!
(
asmname
=
heap_
alloc
(
sizeof
(
*
asmname
))))
if
(
!
(
asmname
=
m
alloc
(
sizeof
(
*
asmname
))))
{
{
hr
=
E_OUTOFMEMORY
;
hr
=
E_OUTOFMEMORY
;
break
;
break
;
...
@@ -364,7 +364,7 @@ static HRESULT enum_gac_assemblies(struct list *assemblies, IAssemblyName *name,
...
@@ -364,7 +364,7 @@ static HRESULT enum_gac_assemblies(struct list *assemblies, IAssemblyName *name,
CANOF_PARSE_DISPLAY_NAME
,
NULL
);
CANOF_PARSE_DISPLAY_NAME
,
NULL
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
{
{
heap_
free
(
asmname
);
free
(
asmname
);
break
;
break
;
}
}
...
@@ -372,7 +372,7 @@ static HRESULT enum_gac_assemblies(struct list *assemblies, IAssemblyName *name,
...
@@ -372,7 +372,7 @@ static HRESULT enum_gac_assemblies(struct list *assemblies, IAssemblyName *name,
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
{
{
IAssemblyName_Release
(
asmname
->
name
);
IAssemblyName_Release
(
asmname
->
name
);
heap_
free
(
asmname
);
free
(
asmname
);
break
;
break
;
}
}
...
@@ -475,7 +475,7 @@ HRESULT WINAPI CreateAssemblyEnum(IAssemblyEnum **pEnum, IUnknown *pUnkReserved,
...
@@ -475,7 +475,7 @@ HRESULT WINAPI CreateAssemblyEnum(IAssemblyEnum **pEnum, IUnknown *pUnkReserved,
if
(
dwFlags
==
0
||
dwFlags
==
ASM_CACHE_ROOT
)
if
(
dwFlags
==
0
||
dwFlags
==
ASM_CACHE_ROOT
)
return
E_INVALIDARG
;
return
E_INVALIDARG
;
if
(
!
(
asmenum
=
heap_
alloc
(
sizeof
(
*
asmenum
))))
return
E_OUTOFMEMORY
;
if
(
!
(
asmenum
=
m
alloc
(
sizeof
(
*
asmenum
))))
return
E_OUTOFMEMORY
;
asmenum
->
IAssemblyEnum_iface
.
lpVtbl
=
&
AssemblyEnumVtbl
;
asmenum
->
IAssemblyEnum_iface
.
lpVtbl
=
&
AssemblyEnumVtbl
;
asmenum
->
ref
=
1
;
asmenum
->
ref
=
1
;
...
@@ -486,7 +486,7 @@ HRESULT WINAPI CreateAssemblyEnum(IAssemblyEnum **pEnum, IUnknown *pUnkReserved,
...
@@ -486,7 +486,7 @@ HRESULT WINAPI CreateAssemblyEnum(IAssemblyEnum **pEnum, IUnknown *pUnkReserved,
hr
=
enumerate_gac
(
asmenum
,
pName
);
hr
=
enumerate_gac
(
asmenum
,
pName
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
{
{
heap_
free
(
asmenum
);
free
(
asmenum
);
return
hr
;
return
hr
;
}
}
}
}
...
...
dlls/fusion/asmname.c
View file @
d3fe9faf
...
@@ -114,12 +114,12 @@ static ULONG WINAPI IAssemblyNameImpl_Release(IAssemblyName *iface)
...
@@ -114,12 +114,12 @@ static ULONG WINAPI IAssemblyNameImpl_Release(IAssemblyName *iface)
if
(
!
refCount
)
if
(
!
refCount
)
{
{
heap_
free
(
This
->
path
);
free
(
This
->
path
);
heap_
free
(
This
->
displayname
);
free
(
This
->
displayname
);
heap_
free
(
This
->
name
);
free
(
This
->
name
);
heap_
free
(
This
->
culture
);
free
(
This
->
culture
);
heap_
free
(
This
->
procarch
);
free
(
This
->
procarch
);
heap_
free
(
This
);
free
(
This
);
}
}
return
refCount
;
return
refCount
;
...
@@ -521,7 +521,7 @@ HRESULT IAssemblyName_SetPath(IAssemblyName *iface, LPCWSTR path)
...
@@ -521,7 +521,7 @@ HRESULT IAssemblyName_SetPath(IAssemblyName *iface, LPCWSTR path)
{
{
IAssemblyNameImpl
*
name
=
unsafe_impl_from_IAssemblyName
(
iface
);
IAssemblyNameImpl
*
name
=
unsafe_impl_from_IAssemblyName
(
iface
);
name
->
path
=
strdupW
(
path
);
name
->
path
=
wcsdup
(
path
);
if
(
!
name
->
path
)
if
(
!
name
->
path
)
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
...
@@ -576,12 +576,10 @@ static HRESULT parse_version(IAssemblyNameImpl *name, LPWSTR version)
...
@@ -576,12 +576,10 @@ static HRESULT parse_version(IAssemblyNameImpl *name, LPWSTR version)
static
HRESULT
parse_culture
(
IAssemblyNameImpl
*
name
,
LPCWSTR
culture
)
static
HRESULT
parse_culture
(
IAssemblyNameImpl
*
name
,
LPCWSTR
culture
)
{
{
static
const
WCHAR
empty
[]
=
{
0
};
if
(
lstrlenW
(
culture
)
==
2
)
if
(
lstrlenW
(
culture
)
==
2
)
name
->
culture
=
strdupW
(
culture
);
name
->
culture
=
wcsdup
(
culture
);
else
else
name
->
culture
=
strdupW
(
empty
);
name
->
culture
=
wcsdup
(
L""
);
return
S_OK
;
return
S_OK
;
}
}
...
@@ -662,7 +660,7 @@ static WCHAR *parse_value( const WCHAR *str, unsigned int len )
...
@@ -662,7 +660,7 @@ static WCHAR *parse_value( const WCHAR *str, unsigned int len )
BOOL
quoted
=
FALSE
;
BOOL
quoted
=
FALSE
;
unsigned
int
i
=
0
;
unsigned
int
i
=
0
;
if
(
!
(
ret
=
heap_
alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
return
NULL
;
if
(
!
(
ret
=
m
alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
return
NULL
;
if
(
*
p
==
'\"'
)
if
(
*
p
==
'\"'
)
{
{
quoted
=
TRUE
;
quoted
=
TRUE
;
...
@@ -671,7 +669,7 @@ static WCHAR *parse_value( const WCHAR *str, unsigned int len )
...
@@ -671,7 +669,7 @@ static WCHAR *parse_value( const WCHAR *str, unsigned int len )
while
(
*
p
&&
*
p
!=
'\"'
)
ret
[
i
++
]
=
*
p
++
;
while
(
*
p
&&
*
p
!=
'\"'
)
ret
[
i
++
]
=
*
p
++
;
if
((
quoted
&&
*
p
!=
'\"'
)
||
(
!
quoted
&&
*
p
==
'\"'
))
if
((
quoted
&&
*
p
!=
'\"'
)
||
(
!
quoted
&&
*
p
==
'\"'
))
{
{
heap_
free
(
ret
);
free
(
ret
);
return
NULL
;
return
NULL
;
}
}
ret
[
i
]
=
0
;
ret
[
i
]
=
0
;
...
@@ -687,11 +685,11 @@ static HRESULT parse_display_name(IAssemblyNameImpl *name, LPCWSTR szAssemblyNam
...
@@ -687,11 +685,11 @@ static HRESULT parse_display_name(IAssemblyNameImpl *name, LPCWSTR szAssemblyNam
if
(
!
szAssemblyName
)
if
(
!
szAssemblyName
)
return
S_OK
;
return
S_OK
;
name
->
displayname
=
strdupW
(
szAssemblyName
);
name
->
displayname
=
wcsdup
(
szAssemblyName
);
if
(
!
name
->
displayname
)
if
(
!
name
->
displayname
)
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
str
=
strdupW
(
szAssemblyName
);
str
=
wcsdup
(
szAssemblyName
);
save
=
str
;
save
=
str
;
if
(
!
str
)
if
(
!
str
)
{
{
...
@@ -709,7 +707,7 @@ static HRESULT parse_display_name(IAssemblyNameImpl *name, LPCWSTR szAssemblyNam
...
@@ -709,7 +707,7 @@ static HRESULT parse_display_name(IAssemblyNameImpl *name, LPCWSTR szAssemblyNam
goto
done
;
goto
done
;
}
}
name
->
name
=
strdupW
(
str
);
name
->
name
=
wcsdup
(
str
);
if
(
!
name
->
name
)
if
(
!
name
->
name
)
{
{
hr
=
E_OUTOFMEMORY
;
hr
=
E_OUTOFMEMORY
;
...
@@ -768,7 +766,7 @@ static HRESULT parse_display_name(IAssemblyNameImpl *name, LPCWSTR szAssemblyNam
...
@@ -768,7 +766,7 @@ static HRESULT parse_display_name(IAssemblyNameImpl *name, LPCWSTR szAssemblyNam
hr
=
parse_procarch
(
name
,
name
->
procarch
);
hr
=
parse_procarch
(
name
,
name
->
procarch
);
}
}
heap_
free
(
value
);
free
(
value
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
goto
done
;
goto
done
;
...
@@ -777,13 +775,13 @@ static HRESULT parse_display_name(IAssemblyNameImpl *name, LPCWSTR szAssemblyNam
...
@@ -777,13 +775,13 @@ static HRESULT parse_display_name(IAssemblyNameImpl *name, LPCWSTR szAssemblyNam
}
}
done:
done:
heap_
free
(
save
);
free
(
save
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
{
{
heap_
free
(
name
->
displayname
);
free
(
name
->
displayname
);
heap_
free
(
name
->
name
);
free
(
name
->
name
);
heap_
free
(
name
->
culture
);
free
(
name
->
culture
);
heap_
free
(
name
->
procarch
);
free
(
name
->
procarch
);
}
}
return
hr
;
return
hr
;
}
}
...
@@ -808,7 +806,7 @@ HRESULT WINAPI CreateAssemblyNameObject(IAssemblyName **ppAssemblyNameObj,
...
@@ -808,7 +806,7 @@ HRESULT WINAPI CreateAssemblyNameObject(IAssemblyName **ppAssemblyNameObj,
(
!
szAssemblyName
||
!*
szAssemblyName
))
(
!
szAssemblyName
||
!*
szAssemblyName
))
return
E_INVALIDARG
;
return
E_INVALIDARG
;
if
(
!
(
name
=
heap_alloc_zero
(
sizeof
(
*
name
))))
return
E_OUTOFMEMORY
;
if
(
!
(
name
=
calloc
(
1
,
sizeof
(
*
name
))))
return
E_OUTOFMEMORY
;
name
->
IAssemblyName_iface
.
lpVtbl
=
&
AssemblyNameVtbl
;
name
->
IAssemblyName_iface
.
lpVtbl
=
&
AssemblyNameVtbl
;
name
->
ref
=
1
;
name
->
ref
=
1
;
...
@@ -816,7 +814,7 @@ HRESULT WINAPI CreateAssemblyNameObject(IAssemblyName **ppAssemblyNameObj,
...
@@ -816,7 +814,7 @@ HRESULT WINAPI CreateAssemblyNameObject(IAssemblyName **ppAssemblyNameObj,
hr
=
parse_display_name
(
name
,
szAssemblyName
);
hr
=
parse_display_name
(
name
,
szAssemblyName
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
{
{
heap_
free
(
name
);
free
(
name
);
return
hr
;
return
hr
;
}
}
...
...
dlls/fusion/assembly.c
View file @
d3fe9faf
...
@@ -540,7 +540,7 @@ static HRESULT parse_metadata_header(ASSEMBLY *assembly, DWORD *hdrsz)
...
@@ -540,7 +540,7 @@ static HRESULT parse_metadata_header(ASSEMBLY *assembly, DWORD *hdrsz)
metadatahdr
=
(
METADATAHDR
*
)
ptr
;
metadatahdr
=
(
METADATAHDR
*
)
ptr
;
if
(
!
(
assembly
->
metadatahdr
=
heap_
alloc
(
sizeof
(
*
assembly
->
metadatahdr
))))
return
E_OUTOFMEMORY
;
if
(
!
(
assembly
->
metadatahdr
=
m
alloc
(
sizeof
(
*
assembly
->
metadatahdr
))))
return
E_OUTOFMEMORY
;
size
=
FIELD_OFFSET
(
METADATAHDR
,
Version
);
size
=
FIELD_OFFSET
(
METADATAHDR
,
Version
);
memcpy
(
assembly
->
metadatahdr
,
metadatahdr
,
size
);
memcpy
(
assembly
->
metadatahdr
,
metadatahdr
,
size
);
...
@@ -645,9 +645,9 @@ HRESULT assembly_create(ASSEMBLY **out, LPCWSTR file)
...
@@ -645,9 +645,9 @@ HRESULT assembly_create(ASSEMBLY **out, LPCWSTR file)
*
out
=
NULL
;
*
out
=
NULL
;
if
(
!
(
assembly
=
heap_alloc_zero
(
sizeof
(
*
assembly
))))
return
E_OUTOFMEMORY
;
if
(
!
(
assembly
=
calloc
(
1
,
sizeof
(
*
assembly
))))
return
E_OUTOFMEMORY
;
assembly
->
path
=
strdupW
(
file
);
assembly
->
path
=
wcsdup
(
file
);
if
(
!
assembly
->
path
)
if
(
!
assembly
->
path
)
{
{
hr
=
E_OUTOFMEMORY
;
hr
=
E_OUTOFMEMORY
;
...
@@ -696,12 +696,12 @@ HRESULT assembly_release(ASSEMBLY *assembly)
...
@@ -696,12 +696,12 @@ HRESULT assembly_release(ASSEMBLY *assembly)
if
(
!
assembly
)
if
(
!
assembly
)
return
S_OK
;
return
S_OK
;
heap_
free
(
assembly
->
metadatahdr
);
free
(
assembly
->
metadatahdr
);
heap_
free
(
assembly
->
path
);
free
(
assembly
->
path
);
UnmapViewOfFile
(
assembly
->
data
);
UnmapViewOfFile
(
assembly
->
data
);
CloseHandle
(
assembly
->
hmap
);
CloseHandle
(
assembly
->
hmap
);
CloseHandle
(
assembly
->
hfile
);
CloseHandle
(
assembly
->
hfile
);
heap_
free
(
assembly
);
free
(
assembly
);
return
S_OK
;
return
S_OK
;
}
}
...
@@ -714,7 +714,7 @@ static LPWSTR assembly_dup_str(const ASSEMBLY *assembly, DWORD index)
...
@@ -714,7 +714,7 @@ static LPWSTR assembly_dup_str(const ASSEMBLY *assembly, DWORD index)
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
NULL
,
0
);
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
NULL
,
0
);
if
((
cpy
=
heap_
alloc
(
len
*
sizeof
(
WCHAR
))))
if
((
cpy
=
m
alloc
(
len
*
sizeof
(
WCHAR
))))
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
cpy
,
len
);
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
cpy
,
len
);
return
cpy
;
return
cpy
;
...
@@ -749,7 +749,7 @@ HRESULT assembly_get_name(ASSEMBLY *assembly, LPWSTR *name)
...
@@ -749,7 +749,7 @@ HRESULT assembly_get_name(ASSEMBLY *assembly, LPWSTR *name)
HRESULT
assembly_get_path
(
const
ASSEMBLY
*
assembly
,
LPWSTR
*
path
)
HRESULT
assembly_get_path
(
const
ASSEMBLY
*
assembly
,
LPWSTR
*
path
)
{
{
WCHAR
*
cpy
=
heap_
alloc
((
lstrlenW
(
assembly
->
path
)
+
1
)
*
sizeof
(
WCHAR
));
WCHAR
*
cpy
=
m
alloc
((
lstrlenW
(
assembly
->
path
)
+
1
)
*
sizeof
(
WCHAR
));
*
path
=
cpy
;
*
path
=
cpy
;
if
(
cpy
)
if
(
cpy
)
lstrcpyW
(
cpy
,
assembly
->
path
);
lstrcpyW
(
cpy
,
assembly
->
path
);
...
@@ -776,7 +776,7 @@ HRESULT assembly_get_version(ASSEMBLY *assembly, LPWSTR *version)
...
@@ -776,7 +776,7 @@ HRESULT assembly_get_version(ASSEMBLY *assembly, LPWSTR *version)
if
(
!
asmtbl
)
if
(
!
asmtbl
)
return
E_FAIL
;
return
E_FAIL
;
if
(
!
(
*
version
=
heap_
alloc
(
24
*
sizeof
(
WCHAR
))))
if
(
!
(
*
version
=
m
alloc
(
24
*
sizeof
(
WCHAR
))))
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
swprintf
(
*
version
,
24
,
format
,
asmtbl
->
MajorVersion
,
asmtbl
->
MinorVersion
,
swprintf
(
*
version
,
24
,
format
,
asmtbl
->
MajorVersion
,
asmtbl
->
MinorVersion
,
...
@@ -846,7 +846,7 @@ HRESULT assembly_get_pubkey_token(ASSEMBLY *assembly, LPWSTR *token)
...
@@ -846,7 +846,7 @@ HRESULT assembly_get_pubkey_token(ASSEMBLY *assembly, LPWSTR *token)
for
(
i
=
size
-
1
;
i
>=
size
-
8
;
i
--
)
for
(
i
=
size
-
1
;
i
>=
size
-
8
;
i
--
)
tokbytes
[
size
-
i
-
1
]
=
hashdata
[
i
];
tokbytes
[
size
-
i
-
1
]
=
hashdata
[
i
];
if
(
!
(
tok
=
heap_
alloc
((
TOKEN_LENGTH
+
1
)
*
sizeof
(
WCHAR
))))
if
(
!
(
tok
=
m
alloc
((
TOKEN_LENGTH
+
1
)
*
sizeof
(
WCHAR
))))
{
{
hr
=
E_OUTOFMEMORY
;
hr
=
E_OUTOFMEMORY
;
goto
done
;
goto
done
;
...
@@ -890,7 +890,7 @@ HRESULT assembly_get_external_files(ASSEMBLY *assembly, LPWSTR **files, DWORD *c
...
@@ -890,7 +890,7 @@ HRESULT assembly_get_external_files(ASSEMBLY *assembly, LPWSTR **files, DWORD *c
if
(
num_rows
<=
0
)
if
(
num_rows
<=
0
)
return
S_OK
;
return
S_OK
;
if
(
!
(
ret
=
heap_
alloc
(
num_rows
*
sizeof
(
WCHAR
*
))))
return
E_OUTOFMEMORY
;
if
(
!
(
ret
=
m
alloc
(
num_rows
*
sizeof
(
WCHAR
*
))))
return
E_OUTOFMEMORY
;
for
(
i
=
0
;
i
<
num_rows
;
i
++
)
for
(
i
=
0
;
i
<
num_rows
;
i
++
)
{
{
...
@@ -903,8 +903,8 @@ HRESULT assembly_get_external_files(ASSEMBLY *assembly, LPWSTR **files, DWORD *c
...
@@ -903,8 +903,8 @@ HRESULT assembly_get_external_files(ASSEMBLY *assembly, LPWSTR **files, DWORD *c
ret
[
i
]
=
assembly_dup_str
(
assembly
,
idx
);
ret
[
i
]
=
assembly_dup_str
(
assembly
,
idx
);
if
(
!
ret
[
i
])
if
(
!
ret
[
i
])
{
{
for
(;
i
>=
0
;
i
--
)
heap_
free
(
ret
[
i
]);
for
(;
i
>=
0
;
i
--
)
free
(
ret
[
i
]);
heap_
free
(
ret
);
free
(
ret
);
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
}
}
ptr
+=
assembly
->
stringsz
;
/* skip Name field */
ptr
+=
assembly
->
stringsz
;
/* skip Name field */
...
...
dlls/fusion/fusionpriv.h
View file @
d3fe9faf
...
@@ -27,7 +27,6 @@
...
@@ -27,7 +27,6 @@
#include "winbase.h"
#include "winbase.h"
#include "winuser.h"
#include "winuser.h"
#include "winver.h"
#include "winver.h"
#include "wine/heap.h"
#include <pshpack1.h>
#include <pshpack1.h>
...
@@ -442,19 +441,6 @@ HRESULT assembly_get_external_files(ASSEMBLY *assembly, LPWSTR **files, DWORD *c
...
@@ -442,19 +441,6 @@ HRESULT assembly_get_external_files(ASSEMBLY *assembly, LPWSTR **files, DWORD *c
extern
HRESULT
IAssemblyName_SetPath
(
IAssemblyName
*
iface
,
LPCWSTR
path
)
DECLSPEC_HIDDEN
;
extern
HRESULT
IAssemblyName_SetPath
(
IAssemblyName
*
iface
,
LPCWSTR
path
)
DECLSPEC_HIDDEN
;
extern
HRESULT
IAssemblyName_GetPath
(
IAssemblyName
*
iface
,
LPWSTR
buf
,
ULONG
*
len
)
DECLSPEC_HIDDEN
;
extern
HRESULT
IAssemblyName_GetPath
(
IAssemblyName
*
iface
,
LPWSTR
buf
,
ULONG
*
len
)
DECLSPEC_HIDDEN
;
static
inline
LPWSTR
strdupW
(
LPCWSTR
src
)
{
LPWSTR
dest
;
if
(
!
src
)
return
NULL
;
if
((
dest
=
heap_alloc
((
lstrlenW
(
src
)
+
1
)
*
sizeof
(
WCHAR
))))
lstrcpyW
(
dest
,
src
);
return
dest
;
}
#define BYTES_PER_TOKEN 8
#define BYTES_PER_TOKEN 8
#define CHARS_PER_BYTE 2
#define CHARS_PER_BYTE 2
#define TOKEN_LENGTH (BYTES_PER_TOKEN * CHARS_PER_BYTE + 1)
#define TOKEN_LENGTH (BYTES_PER_TOKEN * CHARS_PER_BYTE + 1)
...
...
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