mirror of
https://github.com/reactos/reactos.git
synced 2025-05-31 15:08:14 +00:00
[FUSION] Sync with Wine Staging 3.3. CORE-14434
This commit is contained in:
parent
e4bb5d086b
commit
b980bb98c2
9 changed files with 177 additions and 110 deletions
|
@ -9,7 +9,7 @@ list(APPEND COMMON_SOURCE
|
||||||
asmname.c
|
asmname.c
|
||||||
assembly.c
|
assembly.c
|
||||||
fusion.c
|
fusion.c
|
||||||
fusionpriv.h
|
precomp.h
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/fusion_stubs.c)
|
${CMAKE_CURRENT_BINARY_DIR}/fusion_stubs.c)
|
||||||
|
|
||||||
add_library(fusion_common STATIC ${COMMON_SOURCE})
|
add_library(fusion_common STATIC ${COMMON_SOURCE})
|
||||||
|
@ -22,7 +22,7 @@ add_library(fusion SHARED
|
||||||
set_module_type(fusion win32dll)
|
set_module_type(fusion win32dll)
|
||||||
target_link_libraries(fusion fusion_common uuid wine)
|
target_link_libraries(fusion fusion_common uuid wine)
|
||||||
add_importlibs(fusion advapi32 dbghelp shlwapi user32 msvcrt kernel32 ntdll)
|
add_importlibs(fusion advapi32 dbghelp shlwapi user32 msvcrt kernel32 ntdll)
|
||||||
add_pch(fusion_common fusionpriv.h COMMON_SOURCE)
|
add_pch(fusion_common precomp.h COMMON_SOURCE)
|
||||||
add_cd_file(TARGET fusion DESTINATION reactos/Microsoft.NET/Framework/v1.0.3705 FOR all)
|
add_cd_file(TARGET fusion DESTINATION reactos/Microsoft.NET/Framework/v1.0.3705 FOR all)
|
||||||
add_cd_file(TARGET fusion DESTINATION reactos/system32 FOR all)
|
add_cd_file(TARGET fusion DESTINATION reactos/system32 FOR all)
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,28 @@
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#define COBJMACROS
|
||||||
|
|
||||||
|
#include "windef.h"
|
||||||
|
#include "winbase.h"
|
||||||
|
#include "winuser.h"
|
||||||
|
#include "winver.h"
|
||||||
|
#include "wincrypt.h"
|
||||||
|
#include "winreg.h"
|
||||||
|
#include "shlwapi.h"
|
||||||
|
#include "dbghelp.h"
|
||||||
|
#include "ole2.h"
|
||||||
|
#include "fusion.h"
|
||||||
|
#include "corerror.h"
|
||||||
|
|
||||||
#include "fusionpriv.h"
|
#include "fusionpriv.h"
|
||||||
|
#include "wine/debug.h"
|
||||||
|
#include "wine/unicode.h"
|
||||||
|
|
||||||
|
WINE_DEFAULT_DEBUG_CHANNEL(fusion);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
IAssemblyCache IAssemblyCache_iface;
|
IAssemblyCache IAssemblyCache_iface;
|
||||||
|
@ -42,9 +63,7 @@ static BOOL create_full_path(LPCWSTR path)
|
||||||
BOOL ret = TRUE;
|
BOOL ret = TRUE;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
new_path = HeapAlloc(GetProcessHeap(), 0, (strlenW(path) + 1) * sizeof(WCHAR));
|
if (!(new_path = heap_alloc((strlenW(path) + 1) * sizeof(WCHAR)))) return FALSE;
|
||||||
if (!new_path)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
strcpyW(new_path, path);
|
strcpyW(new_path, path);
|
||||||
|
|
||||||
|
@ -82,7 +101,7 @@ static BOOL create_full_path(LPCWSTR path)
|
||||||
new_path[len] = '\\';
|
new_path[len] = '\\';
|
||||||
}
|
}
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, new_path);
|
heap_free(new_path);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,7 +198,7 @@ static ULONG WINAPI IAssemblyCacheImpl_Release(IAssemblyCache *iface)
|
||||||
if (!refCount)
|
if (!refCount)
|
||||||
{
|
{
|
||||||
CloseHandle( cache->lock );
|
CloseHandle( cache->lock );
|
||||||
HeapFree( GetProcessHeap(), 0, cache );
|
heap_free( cache );
|
||||||
}
|
}
|
||||||
return refCount;
|
return refCount;
|
||||||
}
|
}
|
||||||
|
@ -237,7 +256,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 = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) )))
|
if (!(path = heap_alloc( len * sizeof(WCHAR) )))
|
||||||
{
|
{
|
||||||
hr = E_OUTOFMEMORY;
|
hr = E_OUTOFMEMORY;
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -272,7 +291,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 );
|
||||||
HeapFree( GetProcessHeap(), 0, path );
|
heap_free( path );
|
||||||
cache_unlock( cache );
|
cache_unlock( cache );
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
@ -354,9 +373,7 @@ static HRESULT WINAPI IAssemblyCacheImpl_CreateAssemblyCacheItem(IAssemblyCache
|
||||||
|
|
||||||
*ppAsmItem = NULL;
|
*ppAsmItem = NULL;
|
||||||
|
|
||||||
item = HeapAlloc(GetProcessHeap(), 0, sizeof(IAssemblyCacheItemImpl));
|
if (!(item = heap_alloc(sizeof(*item)))) return E_OUTOFMEMORY;
|
||||||
if (!item)
|
|
||||||
return E_OUTOFMEMORY;
|
|
||||||
|
|
||||||
item->IAssemblyCacheItem_iface.lpVtbl = &AssemblyCacheItemVtbl;
|
item->IAssemblyCacheItem_iface.lpVtbl = &AssemblyCacheItemVtbl;
|
||||||
item->ref = 1;
|
item->ref = 1;
|
||||||
|
@ -379,22 +396,22 @@ static HRESULT copy_file( const WCHAR *src_dir, DWORD src_len, const WCHAR *dst_
|
||||||
DWORD len = strlenW( filename );
|
DWORD len = strlenW( filename );
|
||||||
HRESULT hr = S_OK;
|
HRESULT hr = S_OK;
|
||||||
|
|
||||||
if (!(src_file = HeapAlloc( GetProcessHeap(), 0, (src_len + len + 1) * sizeof(WCHAR) )))
|
if (!(src_file = heap_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) );
|
||||||
strcpyW( src_file + src_len, filename );
|
strcpyW( src_file + src_len, filename );
|
||||||
|
|
||||||
if (!(dst_file = HeapAlloc( GetProcessHeap(), 0, (dst_len + len + 1) * sizeof(WCHAR) )))
|
if (!(dst_file = heap_alloc( (dst_len + len + 1) * sizeof(WCHAR) )))
|
||||||
{
|
{
|
||||||
HeapFree( GetProcessHeap(), 0, src_file );
|
heap_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) );
|
||||||
strcpyW( dst_file + dst_len, filename );
|
strcpyW( 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() );
|
||||||
HeapFree( GetProcessHeap(), 0, src_file );
|
heap_free( src_file );
|
||||||
HeapFree( GetProcessHeap(), 0, dst_file );
|
heap_free( dst_file );
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -467,7 +484,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 += strlenW(asmdir) + strlenW(name) + strlenW(version) + strlenW(token);
|
dst_len += strlenW(asmdir) + strlenW(name) + strlenW(version) + strlenW(token);
|
||||||
if (!(dst_dir = HeapAlloc(GetProcessHeap(), 0, dst_len * sizeof(WCHAR))))
|
if (!(dst_dir = heap_alloc(dst_len * sizeof(WCHAR))))
|
||||||
{
|
{
|
||||||
hr = E_OUTOFMEMORY;
|
hr = E_OUTOFMEMORY;
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -507,13 +524,13 @@ static HRESULT WINAPI IAssemblyCacheImpl_InstallAssembly(IAssemblyCache *iface,
|
||||||
}
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
HeapFree(GetProcessHeap(), 0, name);
|
heap_free(name);
|
||||||
HeapFree(GetProcessHeap(), 0, token);
|
heap_free(token);
|
||||||
HeapFree(GetProcessHeap(), 0, version);
|
heap_free(version);
|
||||||
HeapFree(GetProcessHeap(), 0, asmpath);
|
heap_free(asmpath);
|
||||||
HeapFree(GetProcessHeap(), 0, dst_dir);
|
heap_free(dst_dir);
|
||||||
for (i = 0; i < count; i++) HeapFree(GetProcessHeap(), 0, external_files[i]);
|
for (i = 0; i < count; i++) heap_free(external_files[i]);
|
||||||
HeapFree(GetProcessHeap(), 0, external_files);
|
heap_free(external_files);
|
||||||
assembly_release(assembly);
|
assembly_release(assembly);
|
||||||
cache_unlock( cache );
|
cache_unlock( cache );
|
||||||
return hr;
|
return hr;
|
||||||
|
@ -544,16 +561,14 @@ HRESULT WINAPI CreateAssemblyCache(IAssemblyCache **ppAsmCache, DWORD dwReserved
|
||||||
|
|
||||||
*ppAsmCache = NULL;
|
*ppAsmCache = NULL;
|
||||||
|
|
||||||
cache = HeapAlloc(GetProcessHeap(), 0, sizeof(IAssemblyCacheImpl));
|
if (!(cache = heap_alloc(sizeof(*cache)))) return E_OUTOFMEMORY;
|
||||||
if (!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)
|
||||||
{
|
{
|
||||||
HeapFree( GetProcessHeap(), 0, cache );
|
heap_free( cache );
|
||||||
return HRESULT_FROM_WIN32( GetLastError() );
|
return HRESULT_FROM_WIN32( GetLastError() );
|
||||||
}
|
}
|
||||||
*ppAsmCache = &cache->IAssemblyCache_iface;
|
*ppAsmCache = &cache->IAssemblyCache_iface;
|
||||||
|
@ -606,7 +621,7 @@ static ULONG WINAPI IAssemblyCacheItemImpl_Release(IAssemblyCacheItem *iface)
|
||||||
TRACE("(%p)->(ref before = %u)\n", This, refCount + 1);
|
TRACE("(%p)->(ref before = %u)\n", This, refCount + 1);
|
||||||
|
|
||||||
if (!refCount)
|
if (!refCount)
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
heap_free(This);
|
||||||
|
|
||||||
return refCount;
|
return refCount;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,9 +18,26 @@
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdarg.h>
|
||||||
|
|
||||||
|
#define COBJMACROS
|
||||||
|
#define NONAMELESSUNION
|
||||||
|
#define NONAMELESSSTRUCT
|
||||||
|
|
||||||
|
#include "windef.h"
|
||||||
|
#include "winbase.h"
|
||||||
|
#include "winuser.h"
|
||||||
|
#include "ole2.h"
|
||||||
|
#include "guiddef.h"
|
||||||
|
#include "fusion.h"
|
||||||
|
#include "corerror.h"
|
||||||
#include "fusionpriv.h"
|
#include "fusionpriv.h"
|
||||||
|
|
||||||
#include <wine/list.h>
|
#include "wine/debug.h"
|
||||||
|
#include "wine/unicode.h"
|
||||||
|
#include "wine/list.h"
|
||||||
|
|
||||||
|
WINE_DEFAULT_DEBUG_CHANNEL(fusion);
|
||||||
|
|
||||||
typedef struct _tagASMNAME
|
typedef struct _tagASMNAME
|
||||||
{
|
{
|
||||||
|
@ -89,10 +106,10 @@ static ULONG WINAPI IAssemblyEnumImpl_Release(IAssemblyEnum *iface)
|
||||||
|
|
||||||
list_remove(&asmname->entry);
|
list_remove(&asmname->entry);
|
||||||
IAssemblyName_Release(asmname->name);
|
IAssemblyName_Release(asmname->name);
|
||||||
HeapFree(GetProcessHeap(), 0, asmname);
|
heap_free(asmname);
|
||||||
}
|
}
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
heap_free(This);
|
||||||
}
|
}
|
||||||
|
|
||||||
return refCount;
|
return refCount;
|
||||||
|
@ -338,8 +355,7 @@ static HRESULT enum_gac_assemblies(struct list *assemblies, IAssemblyName *name,
|
||||||
}
|
}
|
||||||
sprintfW(disp, name_fmt, parent, version, token);
|
sprintfW(disp, name_fmt, parent, version, token);
|
||||||
|
|
||||||
asmname = HeapAlloc(GetProcessHeap(), 0, sizeof(ASMNAME));
|
if (!(asmname = heap_alloc(sizeof(*asmname))))
|
||||||
if (!asmname)
|
|
||||||
{
|
{
|
||||||
hr = E_OUTOFMEMORY;
|
hr = E_OUTOFMEMORY;
|
||||||
break;
|
break;
|
||||||
|
@ -349,7 +365,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))
|
||||||
{
|
{
|
||||||
HeapFree(GetProcessHeap(), 0, asmname);
|
heap_free(asmname);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -357,7 +373,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);
|
||||||
HeapFree(GetProcessHeap(), 0, asmname);
|
heap_free(asmname);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -460,9 +476,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;
|
||||||
|
|
||||||
asmenum = HeapAlloc(GetProcessHeap(), 0, sizeof(IAssemblyEnumImpl));
|
if (!(asmenum = heap_alloc(sizeof(*asmenum)))) return E_OUTOFMEMORY;
|
||||||
if (!asmenum)
|
|
||||||
return E_OUTOFMEMORY;
|
|
||||||
|
|
||||||
asmenum->IAssemblyEnum_iface.lpVtbl = &AssemblyEnumVtbl;
|
asmenum->IAssemblyEnum_iface.lpVtbl = &AssemblyEnumVtbl;
|
||||||
asmenum->ref = 1;
|
asmenum->ref = 1;
|
||||||
|
@ -473,7 +487,7 @@ HRESULT WINAPI CreateAssemblyEnum(IAssemblyEnum **pEnum, IUnknown *pUnkReserved,
|
||||||
hr = enumerate_gac(asmenum, pName);
|
hr = enumerate_gac(asmenum, pName);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
{
|
{
|
||||||
HeapFree(GetProcessHeap(), 0, asmenum);
|
heap_free(asmenum);
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,11 +18,26 @@
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
#define COBJMACROS
|
||||||
|
#define INITGUID
|
||||||
|
|
||||||
|
#include "windef.h"
|
||||||
|
#include "winbase.h"
|
||||||
|
#include "winuser.h"
|
||||||
|
#include "ole2.h"
|
||||||
|
#include "guiddef.h"
|
||||||
|
#include "fusion.h"
|
||||||
|
#include "corerror.h"
|
||||||
|
#include "strsafe.h"
|
||||||
|
|
||||||
|
#include "wine/debug.h"
|
||||||
|
#include "wine/unicode.h"
|
||||||
#include "fusionpriv.h"
|
#include "fusionpriv.h"
|
||||||
|
|
||||||
#include <assert.h>
|
WINE_DEFAULT_DEBUG_CHANNEL(fusion);
|
||||||
#include <winuser.h>
|
|
||||||
#include <strsafe.h>
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
IAssemblyName IAssemblyName_iface;
|
IAssemblyName IAssemblyName_iface;
|
||||||
|
@ -100,12 +115,12 @@ static ULONG WINAPI IAssemblyNameImpl_Release(IAssemblyName *iface)
|
||||||
|
|
||||||
if (!refCount)
|
if (!refCount)
|
||||||
{
|
{
|
||||||
HeapFree(GetProcessHeap(), 0, This->path);
|
heap_free(This->path);
|
||||||
HeapFree(GetProcessHeap(), 0, This->displayname);
|
heap_free(This->displayname);
|
||||||
HeapFree(GetProcessHeap(), 0, This->name);
|
heap_free(This->name);
|
||||||
HeapFree(GetProcessHeap(), 0, This->culture);
|
heap_free(This->culture);
|
||||||
HeapFree(GetProcessHeap(), 0, This->procarch);
|
heap_free(This->procarch);
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
heap_free(This);
|
||||||
}
|
}
|
||||||
|
|
||||||
return refCount;
|
return refCount;
|
||||||
|
@ -648,7 +663,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 = HeapAlloc( GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR) ))) return NULL;
|
if (!(ret = heap_alloc( (len + 1) * sizeof(WCHAR) ))) return NULL;
|
||||||
if (*p == '\"')
|
if (*p == '\"')
|
||||||
{
|
{
|
||||||
quoted = TRUE;
|
quoted = TRUE;
|
||||||
|
@ -657,7 +672,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 == '\"'))
|
||||||
{
|
{
|
||||||
HeapFree( GetProcessHeap(), 0, ret );
|
heap_free( ret );
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
ret[i] = 0;
|
ret[i] = 0;
|
||||||
|
@ -754,7 +769,7 @@ static HRESULT parse_display_name(IAssemblyNameImpl *name, LPCWSTR szAssemblyNam
|
||||||
|
|
||||||
hr = parse_procarch( name, name->procarch );
|
hr = parse_procarch( name, name->procarch );
|
||||||
}
|
}
|
||||||
HeapFree( GetProcessHeap(), 0, value );
|
heap_free( value );
|
||||||
|
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -763,13 +778,13 @@ static HRESULT parse_display_name(IAssemblyNameImpl *name, LPCWSTR szAssemblyNam
|
||||||
}
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
HeapFree(GetProcessHeap(), 0, save);
|
heap_free(save);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
{
|
{
|
||||||
HeapFree(GetProcessHeap(), 0, name->displayname);
|
heap_free(name->displayname);
|
||||||
HeapFree(GetProcessHeap(), 0, name->name);
|
heap_free(name->name);
|
||||||
HeapFree(GetProcessHeap(), 0, name->culture);
|
heap_free(name->culture);
|
||||||
HeapFree(GetProcessHeap(), 0, name->procarch);
|
heap_free(name->procarch);
|
||||||
}
|
}
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
@ -794,9 +809,7 @@ HRESULT WINAPI CreateAssemblyNameObject(IAssemblyName **ppAssemblyNameObj,
|
||||||
(!szAssemblyName || !*szAssemblyName))
|
(!szAssemblyName || !*szAssemblyName))
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
|
||||||
name = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IAssemblyNameImpl));
|
if (!(name = heap_alloc_zero(sizeof(*name)))) return E_OUTOFMEMORY;
|
||||||
if (!name)
|
|
||||||
return E_OUTOFMEMORY;
|
|
||||||
|
|
||||||
name->IAssemblyName_iface.lpVtbl = &AssemblyNameVtbl;
|
name->IAssemblyName_iface.lpVtbl = &AssemblyNameVtbl;
|
||||||
name->ref = 1;
|
name->ref = 1;
|
||||||
|
@ -804,7 +817,7 @@ HRESULT WINAPI CreateAssemblyNameObject(IAssemblyName **ppAssemblyNameObj,
|
||||||
hr = parse_display_name(name, szAssemblyName);
|
hr = parse_display_name(name, szAssemblyName);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
{
|
{
|
||||||
HeapFree(GetProcessHeap(), 0, name);
|
heap_free(name);
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,11 +18,22 @@
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "fusionpriv.h"
|
#include <stdarg.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <wincrypt.h>
|
#include "windef.h"
|
||||||
#include <dbghelp.h>
|
#include "winbase.h"
|
||||||
#include <corhdr.h>
|
#include "winuser.h"
|
||||||
|
#include "winver.h"
|
||||||
|
#include "wincrypt.h"
|
||||||
|
#include "dbghelp.h"
|
||||||
|
#include "ole2.h"
|
||||||
|
#include "fusion.h"
|
||||||
|
#include "corhdr.h"
|
||||||
|
|
||||||
|
#include "fusionpriv.h"
|
||||||
|
#include "wine/debug.h"
|
||||||
|
#include "wine/unicode.h"
|
||||||
|
|
||||||
#define TableFromToken(tk) (TypeFromToken(tk) >> 24)
|
#define TableFromToken(tk) (TypeFromToken(tk) >> 24)
|
||||||
#define TokenFromTable(idx) (idx << 24)
|
#define TokenFromTable(idx) (idx << 24)
|
||||||
|
@ -528,9 +539,7 @@ static HRESULT parse_metadata_header(ASSEMBLY *assembly, DWORD *hdrsz)
|
||||||
|
|
||||||
metadatahdr = (METADATAHDR *)ptr;
|
metadatahdr = (METADATAHDR *)ptr;
|
||||||
|
|
||||||
assembly->metadatahdr = HeapAlloc(GetProcessHeap(), 0, sizeof(METADATAHDR));
|
if (!(assembly->metadatahdr = heap_alloc(sizeof(*assembly->metadatahdr)))) return E_OUTOFMEMORY;
|
||||||
if (!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);
|
||||||
|
@ -635,9 +644,7 @@ HRESULT assembly_create(ASSEMBLY **out, LPCWSTR file)
|
||||||
|
|
||||||
*out = NULL;
|
*out = NULL;
|
||||||
|
|
||||||
assembly = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ASSEMBLY));
|
if (!(assembly = heap_alloc_zero(sizeof(*assembly)))) return E_OUTOFMEMORY;
|
||||||
if (!assembly)
|
|
||||||
return E_OUTOFMEMORY;
|
|
||||||
|
|
||||||
assembly->path = strdupW(file);
|
assembly->path = strdupW(file);
|
||||||
if (!assembly->path)
|
if (!assembly->path)
|
||||||
|
@ -688,12 +695,12 @@ HRESULT assembly_release(ASSEMBLY *assembly)
|
||||||
if (!assembly)
|
if (!assembly)
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, assembly->metadatahdr);
|
heap_free(assembly->metadatahdr);
|
||||||
HeapFree(GetProcessHeap(), 0, assembly->path);
|
heap_free(assembly->path);
|
||||||
UnmapViewOfFile(assembly->data);
|
UnmapViewOfFile(assembly->data);
|
||||||
CloseHandle(assembly->hmap);
|
CloseHandle(assembly->hmap);
|
||||||
CloseHandle(assembly->hfile);
|
CloseHandle(assembly->hfile);
|
||||||
HeapFree(GetProcessHeap(), 0, assembly);
|
heap_free(assembly);
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
@ -706,8 +713,8 @@ 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 = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR))))
|
if ((cpy = heap_alloc(len * sizeof(WCHAR))))
|
||||||
MultiByteToWideChar(CP_ACP, 0, str, -1, cpy, len);
|
MultiByteToWideChar(CP_ACP, 0, str, -1, cpy, len);
|
||||||
|
|
||||||
return cpy;
|
return cpy;
|
||||||
}
|
}
|
||||||
|
@ -741,7 +748,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)
|
||||||
{
|
{
|
||||||
LPWSTR cpy = HeapAlloc(GetProcessHeap(), 0, (strlenW(assembly->path) + 1) * sizeof(WCHAR));
|
WCHAR *cpy = heap_alloc((strlenW(assembly->path) + 1) * sizeof(WCHAR));
|
||||||
*path = cpy;
|
*path = cpy;
|
||||||
if (cpy)
|
if (cpy)
|
||||||
strcpyW(cpy, assembly->path);
|
strcpyW(cpy, assembly->path);
|
||||||
|
@ -768,8 +775,7 @@ HRESULT assembly_get_version(ASSEMBLY *assembly, LPWSTR *version)
|
||||||
if (!asmtbl)
|
if (!asmtbl)
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
||||||
*version = HeapAlloc(GetProcessHeap(), 0, sizeof(format) + 4 * strlen("65535") * sizeof(WCHAR));
|
if (!(*version = heap_alloc(sizeof(format) + 4 * strlen("65535") * sizeof(WCHAR))))
|
||||||
if (!*version)
|
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
|
|
||||||
sprintfW(*version, format, asmtbl->MajorVersion, asmtbl->MinorVersion,
|
sprintfW(*version, format, asmtbl->MajorVersion, asmtbl->MinorVersion,
|
||||||
|
@ -841,8 +847,7 @@ HRESULT assembly_get_pubkey_token(ASSEMBLY *assembly, LPWSTR *token)
|
||||||
if (!CryptGetHashParam(hash, HP_HASHVAL, NULL, &size, 0))
|
if (!CryptGetHashParam(hash, HP_HASHVAL, NULL, &size, 0))
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
||||||
hashdata = HeapAlloc(GetProcessHeap(), 0, size);
|
if (!(hashdata = heap_alloc(size)))
|
||||||
if (!hashdata)
|
|
||||||
{
|
{
|
||||||
hr = E_OUTOFMEMORY;
|
hr = E_OUTOFMEMORY;
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -854,8 +859,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];
|
||||||
|
|
||||||
tok = HeapAlloc(GetProcessHeap(), 0, (TOKEN_LENGTH + 1) * sizeof(WCHAR));
|
if (!(tok = heap_alloc((TOKEN_LENGTH + 1) * sizeof(WCHAR))))
|
||||||
if (!tok)
|
|
||||||
{
|
{
|
||||||
hr = E_OUTOFMEMORY;
|
hr = E_OUTOFMEMORY;
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -867,7 +871,7 @@ HRESULT assembly_get_pubkey_token(ASSEMBLY *assembly, LPWSTR *token)
|
||||||
hr = S_OK;
|
hr = S_OK;
|
||||||
|
|
||||||
done:
|
done:
|
||||||
HeapFree(GetProcessHeap(), 0, hashdata);
|
heap_free(hashdata);
|
||||||
CryptDestroyHash(hash);
|
CryptDestroyHash(hash);
|
||||||
CryptReleaseContext(crypt, 0);
|
CryptReleaseContext(crypt, 0);
|
||||||
|
|
||||||
|
@ -902,9 +906,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;
|
||||||
|
|
||||||
ret = HeapAlloc(GetProcessHeap(), 0, num_rows * sizeof(WCHAR *));
|
if (!(ret = heap_alloc(num_rows * sizeof(WCHAR *)))) return E_OUTOFMEMORY;
|
||||||
if (!ret)
|
|
||||||
return E_OUTOFMEMORY;
|
|
||||||
|
|
||||||
for (i = 0; i < num_rows; i++)
|
for (i = 0; i < num_rows; i++)
|
||||||
{
|
{
|
||||||
|
@ -917,8 +919,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--) HeapFree(GetProcessHeap(), 0, ret[i]);
|
for (; i >= 0; i--) heap_free(ret[i]);
|
||||||
HeapFree(GetProcessHeap(), 0, ret);
|
heap_free(ret);
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
ptr += assembly->stringsz; /* skip Name field */
|
ptr += assembly->stringsz; /* skip Name field */
|
||||||
|
|
|
@ -18,7 +18,20 @@
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "fusionpriv.h"
|
#include <stdarg.h>
|
||||||
|
|
||||||
|
#define COBJMACROS
|
||||||
|
|
||||||
|
#include "windef.h"
|
||||||
|
#include "winbase.h"
|
||||||
|
#include "winuser.h"
|
||||||
|
#include "ole2.h"
|
||||||
|
#include "fusion.h"
|
||||||
|
#include "wine/debug.h"
|
||||||
|
#include "wine/unicode.h"
|
||||||
|
|
||||||
|
WINE_DEFAULT_DEBUG_CHANNEL(fusion);
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
* InitializeFusion (FUSION.@)
|
* InitializeFusion (FUSION.@)
|
||||||
|
|
|
@ -23,25 +23,16 @@
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
#define WIN32_NO_STATUS
|
#include "windef.h"
|
||||||
#define _INC_WINDOWS
|
#include "winbase.h"
|
||||||
#define COM_NO_WINDOWS_H
|
#include "winuser.h"
|
||||||
|
#include "winver.h"
|
||||||
|
#include "wine/heap.h"
|
||||||
|
|
||||||
#define COBJMACROS
|
#ifdef __REACTOS__
|
||||||
#define NONAMELESSUNION
|
|
||||||
#define NONAMELESSSTRUCT
|
|
||||||
|
|
||||||
#include <windef.h>
|
|
||||||
#include <winbase.h>
|
|
||||||
#include <winver.h>
|
|
||||||
#include <objbase.h>
|
#include <objbase.h>
|
||||||
#include <fusion.h>
|
#include <fusion.h>
|
||||||
#include <corerror.h>
|
#endif
|
||||||
|
|
||||||
#include <wine/unicode.h>
|
|
||||||
|
|
||||||
#include <wine/debug.h>
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(fusion);
|
|
||||||
|
|
||||||
#include <pshpack1.h>
|
#include <pshpack1.h>
|
||||||
|
|
||||||
|
@ -463,8 +454,7 @@ static inline LPWSTR strdupW(LPCWSTR src)
|
||||||
if (!src)
|
if (!src)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
dest = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(src) + 1) * sizeof(WCHAR));
|
if ((dest = heap_alloc((lstrlenW(src) + 1) * sizeof(WCHAR))))
|
||||||
if (dest)
|
|
||||||
lstrcpyW(dest, src);
|
lstrcpyW(dest, src);
|
||||||
|
|
||||||
return dest;
|
return dest;
|
||||||
|
|
20
dll/win32/fusion/precomp.h
Normal file
20
dll/win32/fusion/precomp.h
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
|
||||||
|
#ifndef _WINE_FUSION_PRECOMP_H_
|
||||||
|
#define _WINE_FUSION_PRECOMP_H_
|
||||||
|
|
||||||
|
#define WIN32_NO_STATUS
|
||||||
|
#define _INC_WINDOWS
|
||||||
|
#define COM_NO_WINDOWS_H
|
||||||
|
|
||||||
|
#define COBJMACROS
|
||||||
|
#define NONAMELESSUNION
|
||||||
|
#define NONAMELESSSTRUCT
|
||||||
|
|
||||||
|
#include "fusionpriv.h"
|
||||||
|
|
||||||
|
#include <corerror.h>
|
||||||
|
|
||||||
|
#include <wine/unicode.h>
|
||||||
|
#include <wine/debug.h>
|
||||||
|
|
||||||
|
#endif /* !_WINE_FUSION_PRECOMP_H_ */
|
|
@ -67,7 +67,7 @@ reactos/dll/win32/dbghelp # Synced to WineStaging-3.3
|
||||||
reactos/dll/win32/dciman32 # Synced to WineStaging-3.3
|
reactos/dll/win32/dciman32 # Synced to WineStaging-3.3
|
||||||
reactos/dll/win32/faultrep # Synced to WineStaging-2.9
|
reactos/dll/win32/faultrep # Synced to WineStaging-2.9
|
||||||
reactos/dll/win32/fontsub # Synced to WineStaging-2.9
|
reactos/dll/win32/fontsub # Synced to WineStaging-2.9
|
||||||
reactos/dll/win32/fusion # Synced to Wine-3.0
|
reactos/dll/win32/fusion # Synced to WineStaging-3.3
|
||||||
reactos/dll/win32/gdiplus # Synced to Wine-3.0
|
reactos/dll/win32/gdiplus # Synced to Wine-3.0
|
||||||
reactos/dll/win32/hhctrl.ocx # Synced to Wine-3.0
|
reactos/dll/win32/hhctrl.ocx # Synced to Wine-3.0
|
||||||
reactos/dll/win32/hlink # Synced to Wine-3.0
|
reactos/dll/win32/hlink # Synced to Wine-3.0
|
||||||
|
|
Loading…
Reference in a new issue