From b83fbb4f03176c651c7beaef8ebf75f2641ff9da Mon Sep 17 00:00:00 2001 From: James Hawkins Date: Mon, 24 Mar 2008 01:28:56 -0500 Subject: [PATCH] fusion: Add a stub implementation of IAssemblyName. --- dlls/fusion/Makefile.in | 1 + dlls/fusion/asmname.c | 183 ++++++++++++++++++++++++++++++++++++++++++++++++ include/fusion.idl | 132 ++++++++++++++++++++++++++++++++++ 3 files changed, 316 insertions(+) create mode 100644 dlls/fusion/asmname.c diff --git a/dlls/fusion/Makefile.in b/dlls/fusion/Makefile.in index e33712c4031..f7c47f8cc5c 100644 --- a/dlls/fusion/Makefile.in +++ b/dlls/fusion/Makefile.in @@ -6,6 +6,7 @@ MODULE = fusion.dll IMPORTS = kernel32 C_SRCS = \ + asmname.c \ fusion.c \ fusion_main.c diff --git a/dlls/fusion/asmname.c b/dlls/fusion/asmname.c new file mode 100644 index 00000000000..16cd7b0ceb3 --- /dev/null +++ b/dlls/fusion/asmname.c @@ -0,0 +1,183 @@ +/* + * IAssemblyName implementation + * + * Copyright 2008 James Hawkins + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include + +#define COBJMACROS +#define INITGUID + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "ole2.h" +#include "guiddef.h" +#include "fusion.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(fusion); + +typedef struct { + const IAssemblyNameVtbl *lpIAssemblyNameVtbl; + + LONG ref; +} IAssemblyNameImpl; + +static HRESULT WINAPI IAssemblyNameImpl_QueryInterface(IAssemblyName *iface, + REFIID riid, LPVOID *ppobj) +{ + IAssemblyNameImpl *This = (IAssemblyNameImpl *)iface; + + TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), ppobj); + + *ppobj = NULL; + + if (IsEqualIID(riid, &IID_IUnknown) || + IsEqualIID(riid, &IID_IAssemblyName)) + { + IUnknown_AddRef(iface); + *ppobj = This; + return S_OK; + } + + WARN("(%p, %s, %p): not found\n", This, debugstr_guid(riid), ppobj); + return E_NOINTERFACE; +} + +static ULONG WINAPI IAssemblyNameImpl_AddRef(IAssemblyName *iface) +{ + IAssemblyNameImpl *This = (IAssemblyNameImpl *)iface; + ULONG refCount = InterlockedIncrement(&This->ref); + + TRACE("(%p)->(ref before = %u)\n", This, refCount - 1); + + return refCount; +} + +static ULONG WINAPI IAssemblyNameImpl_Release(IAssemblyName *iface) +{ + IAssemblyNameImpl *This = (IAssemblyNameImpl *)iface; + ULONG refCount = InterlockedDecrement(&This->ref); + + TRACE("(%p)->(ref before = %u)\n", This, refCount + 1); + + if (!refCount) + HeapFree(GetProcessHeap(), 0, This); + + return refCount; +} + +static HRESULT WINAPI IAssemblyNameImpl_SetProperty(IAssemblyName *iface, + DWORD PropertyId, + LPVOID pvProperty, + DWORD cbProperty) +{ + FIXME("(%p, %d, %p, %d) stub!\n", iface, PropertyId, pvProperty, cbProperty); + return E_NOTIMPL; +} + +static HRESULT WINAPI IAssemblyNameImpl_GetProperty(IAssemblyName *iface, + DWORD PropertyId, + LPVOID pvProperty, + LPDWORD pcbProperty) +{ + FIXME("(%p, %d, %p, %p) stub!\n", iface, PropertyId, pvProperty, pcbProperty); + return E_NOTIMPL; +} + +static HRESULT WINAPI IAssemblyNameImpl_Finalize(IAssemblyName *iface) +{ + FIXME("(%p) stub!\n", iface); + return E_NOTIMPL; +} + +static HRESULT WINAPI IAssemblyNameImpl_GetDisplayName(IAssemblyName *iface, + LPOLESTR szDisplayName, + LPDWORD pccDisplayName, + DWORD dwDisplayFlags) +{ + FIXME("(%p, %s, %p, %d) stub!\n", iface, debugstr_w(szDisplayName), + pccDisplayName, dwDisplayFlags); + + return E_NOTIMPL; +} + +static HRESULT WINAPI IAssemblyNameImpl_Reserved(IAssemblyName *iface, + REFIID refIID, + IUnknown *pUnkReserved1, + IUnknown *pUnkReserved2, + LPCOLESTR szReserved, + LONGLONG llReserved, + LPVOID pvReserved, + DWORD cbReserved, + LPVOID *ppReserved) +{ + TRACE("(%p, %s, %p, %p, %s, %x%08x, %p, %d, %p)\n", iface, + debugstr_guid(refIID), pUnkReserved1, pUnkReserved2, + debugstr_w(szReserved), (DWORD)(llReserved >> 32), (DWORD)llReserved, + pvReserved, cbReserved, ppReserved); + + return E_NOTIMPL; +} + +static HRESULT WINAPI IAssemblyNameImpl_GetName(IAssemblyName *iface, + LPDWORD lpcwBuffer, + WCHAR *pwzName) +{ + FIXME("(%p, %p, %p) stub!\n", iface, lpcwBuffer, pwzName); + return E_NOTIMPL; +} + +static HRESULT WINAPI IAssemblyNameImpl_GetVersion(IAssemblyName *iface, + LPDWORD pdwVersionHi, + LPDWORD pdwVersionLow) +{ + FIXME("(%p, %p, %p) stub!\n", iface, pdwVersionHi, pdwVersionLow); + return E_NOTIMPL; +} + +static HRESULT WINAPI IAssemblyNameImpl_IsEqual(IAssemblyName *iface, + IAssemblyName *pName, + DWORD dwCmpFlags) +{ + FIXME("(%p, %p, %d) stub!\n", iface, pName, dwCmpFlags); + return E_NOTIMPL; +} + +static HRESULT WINAPI IAssemblyNameImpl_Clone(IAssemblyName *iface, + IAssemblyName **pName) +{ + FIXME("(%p, %p) stub!\n", iface, pName); + return E_NOTIMPL; +} + +static const IAssemblyNameVtbl AssemblyNameVtbl = { + IAssemblyNameImpl_QueryInterface, + IAssemblyNameImpl_AddRef, + IAssemblyNameImpl_Release, + IAssemblyNameImpl_SetProperty, + IAssemblyNameImpl_GetProperty, + IAssemblyNameImpl_Finalize, + IAssemblyNameImpl_GetDisplayName, + IAssemblyNameImpl_Reserved, + IAssemblyNameImpl_GetName, + IAssemblyNameImpl_GetVersion, + IAssemblyNameImpl_IsEqual, + IAssemblyNameImpl_Clone +}; diff --git a/include/fusion.idl b/include/fusion.idl index 00ec98cb01e..0596192b500 100644 --- a/include/fusion.idl +++ b/include/fusion.idl @@ -88,6 +88,138 @@ interface IAssemblyCacheItem : IUnknown interface IAssemblyName: IUnknown { typedef [unique] IAssemblyName *LPASSEMBLYNAME; + + typedef enum + { + CANOF_PARSE_DISPLAY_NAME = 0x1, + CANOF_SET_DEFAULT_VALUES = 0x2, + CANOF_VERIFY_FRIEND_ASSEMBLYNAME = 0x4, + CANOF_PARSE_FRIEND_DISPLAY_NAME = CANOF_PARSE_DISPLAY_NAME | + CANOF_VERIFY_FRIEND_ASSEMBLYNAME + } CREATE_ASM_NAME_OBJ_FLAGS; + + typedef enum + { + ASM_NAME_PUBLIC_KEY = 0, + ASM_NAME_PUBLIC_KEY_TOKEN, + ASM_NAME_HASH_VALUE, + ASM_NAME_NAME, + ASM_NAME_MAJOR_VERSION, + ASM_NAME_MINOR_VERSION, + ASM_NAME_BUILD_NUMBER, + ASM_NAME_REVISION_NUMBER, + ASM_NAME_CULTURE, + ASM_NAME_PROCESSOR_ID_ARRAY, + ASM_NAME_OSINFO_ARRAY, + ASM_NAME_HASH_ALGID, + ASM_NAME_ALIAS, + ASM_NAME_CODEBASE_URL, + ASM_NAME_CODEBASE_LASTMOD, + ASM_NAME_NULL_PUBLIC_KEY, + ASM_NAME_NULL_PUBLIC_KEY_TOKEN, + ASM_NAME_CUSTOM, + ASM_NAME_NULL_CUSTOM, + ASM_NAME_MVID, + ASM_NAME_FILE_MAJOR_VERSION, + ASM_NAME_FILE_MINOR_VERSION, + ASM_NAME_FILE_BUILD_NUMBER, + ASM_NAME_FILE_REVISION_NUMBER, + ASM_NAME_RETARGET, + ASM_NAME_SIGNATURE_BLOB, + ASM_NAME_CONFIG_MASK, + ASM_NAME_ARCHITECTURE, + ASM_NAME_MAX_PARAMS + } ASM_NAME; + + typedef enum + { + ASM_DISPLAYF_VERSION = 0x1, + ASM_DISPLAYF_CULTURE = 0x2, + ASM_DISPLAYF_PUBLIC_KEY_TOKEN = 0x4, + ASM_DISPLAYF_PUBLIC_KEY = 0x8, + ASM_DISPLAYF_CUSTOM = 0x10, + ASM_DISPLAYF_PROCESSORARCHITECTURE = 0x20, + ASM_DISPLAYF_LANGUAGEID = 0x40, + ASM_DISPLAYF_RETARGET = 0x80, + ASM_DISPLAYF_CONFIG_MASK = 0x100, + ASM_DISPLAYF_MVID = 0x200, + + ASM_DISPLAYF_FULL = ASM_DISPLAYF_VERSION | + ASM_DISPLAYF_CULTURE | + ASM_DISPLAYF_PUBLIC_KEY_TOKEN | + ASM_DISPLAYF_RETARGET | + ASM_DISPLAYF_PROCESSORARCHITECTURE, + } ASM_DISPLAY_FLAGS; + + typedef enum + { + ASM_CMPF_NAME = 0x1, + ASM_CMPF_MAJOR_VERSION = 0x2, + ASM_CMPF_MINOR_VERSION = 0x4, + ASM_CMPF_BUILD_NUMBER = 0x8, + ASM_CMPF_REVISION_NUMBER = 0x10, + ASM_CMPF_VERSION = ASM_CMPF_MAJOR_VERSION | + ASM_CMPF_MINOR_VERSION | + ASM_CMPF_BUILD_NUMBER | + ASM_CMPF_REVISION_NUMBER, + ASM_CMPF_PUBLIC_KEY_TOKEN = 0x20, + ASM_CMPF_CULTURE = 0x40, + ASM_CMPF_CUSTOM = 0x80, + ASM_CMPF_DEFAULT = 0x100, + ASM_CMPF_RETARGET = 0x200, + ASM_CMPF_ARCHITECTURE = 0x400, + ASM_CMPF_CONFIG_MASK = 0x800, + ASM_CMPF_MVID = 0x1000, + ASM_CMPF_SIGNATURE = 0x2000, + ASM_CMPF_IL_ALL = ASM_CMPF_NAME | + ASM_CMPF_VERSION | + ASM_CMPF_PUBLIC_KEY_TOKEN | + ASM_CMPF_CULTURE, + ASM_CMPF_IL_NO_VERSION = ASM_CMPF_NAME | + ASM_CMPF_PUBLIC_KEY_TOKEN | + ASM_CMPF_CULTURE + } ASM_CMP_FLAGS; + + HRESULT SetProperty( + [in] DWORD PropertyId, + [in] LPVOID pvProperty, + [in] DWORD cbProperty); + + HRESULT GetProperty( + [in] DWORD PropertyId, + [out] LPVOID pvProperty, + [in, out] LPDWORD pcbProperty); + + HRESULT Finalize(); + + HRESULT GetDisplayName( + [out] LPOLESTR szDisplayName, + [in, out] LPDWORD pccDisplayName, + [in] DWORD dwDisplayFlags); + + HRESULT Reserved( + [in] REFIID refIID, + [in] IUnknown *pUnkReserved1, + [in] IUnknown *pUnkReserved2, + [in] LPCOLESTR szReserved, + [in] LONGLONG llReserved, + [in] LPVOID pvReserved, + [in] DWORD cbReserved, + [out] LPVOID *ppReserved); + + HRESULT GetName( + [in, out] LPDWORD lpcwBuffer, + [out] WCHAR *pwzName); + + HRESULT GetVersion( + [out] LPDWORD pdwVersionHi, + [out] LPDWORD pdwVersionLow); + + HRESULT IsEqual( + [in] IAssemblyName *pName, + [in] DWORD dwCmpFlags); + + HRESULT Clone([out] IAssemblyName **pName); } [ -- 2.11.4.GIT