Hans Leidekker : sxs: Add a stub implementation of IAssemblyCache.
Alexandre Julliard
julliard at winehq.org
Wed Nov 3 11:37:09 CDT 2010
Module: wine
Branch: master
Commit: d4f64121e83671ac10ed6ead04f1c19eb5586cb0
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d4f64121e83671ac10ed6ead04f1c19eb5586cb0
Author: Hans Leidekker <hans at codeweavers.com>
Date: Wed Nov 3 15:09:08 2010 +0100
sxs: Add a stub implementation of IAssemblyCache.
---
dlls/sxs/Makefile.in | 1 +
dlls/sxs/cache.c | 166 ++++++++++++++++++++++++++++++++++++++++++++++++++
dlls/sxs/sxs.c | 6 --
3 files changed, 167 insertions(+), 6 deletions(-)
diff --git a/dlls/sxs/Makefile.in b/dlls/sxs/Makefile.in
index f7ca361..f218293 100644
--- a/dlls/sxs/Makefile.in
+++ b/dlls/sxs/Makefile.in
@@ -1,6 +1,7 @@
MODULE = sxs.dll
C_SRCS = \
+ cache.c \
sxs.c
@MAKE_DLL_RULES@
diff --git a/dlls/sxs/cache.c b/dlls/sxs/cache.c
new file mode 100644
index 0000000..b6cf47e
--- /dev/null
+++ b/dlls/sxs/cache.c
@@ -0,0 +1,166 @@
+/*
+ * IAssemblyCache implementation
+ *
+ * Copyright 2010 Hans Leidekker for CodeWeavers
+ *
+ * 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 <stdarg.h>
+
+#define COBJMACROS
+#define INITGUID
+
+#include "windef.h"
+#include "winbase.h"
+#include "ole2.h"
+#include "winsxs.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(sxs);
+
+struct cache
+{
+ const IAssemblyCacheVtbl *vtbl;
+ LONG refs;
+};
+
+static HRESULT WINAPI cache_QueryInterface(
+ IAssemblyCache *iface,
+ REFIID riid,
+ void **obj )
+{
+ struct cache *cache = (struct cache *)iface;
+
+ TRACE("%p, %s, %p\n", cache, debugstr_guid(riid), obj);
+
+ *obj = NULL;
+
+ if (IsEqualIID(riid, &IID_IUnknown) ||
+ IsEqualIID(riid, &IID_IAssemblyCache))
+ {
+ IUnknown_AddRef( iface );
+ *obj = cache;
+ return S_OK;
+ }
+
+ return E_NOINTERFACE;
+}
+
+static ULONG WINAPI cache_AddRef( IAssemblyCache *iface )
+{
+ struct cache *cache = (struct cache *)iface;
+ return InterlockedIncrement( &cache->refs );
+}
+
+static ULONG WINAPI cache_Release( IAssemblyCache *iface )
+{
+ struct cache *cache = (struct cache *)iface;
+ ULONG refs = InterlockedDecrement( &cache->refs );
+
+ if (!refs)
+ {
+ TRACE("destroying %p\n", cache);
+ HeapFree( GetProcessHeap(), 0, cache );
+ }
+ return refs;
+}
+
+static HRESULT WINAPI cache_UninstallAssembly(
+ IAssemblyCache *iface,
+ DWORD flags,
+ LPCWSTR name,
+ LPCFUSION_INSTALL_REFERENCE ref,
+ ULONG *disp )
+{
+ FIXME("%p, 0x%08x, %s, %p, %p\n", iface, flags, debugstr_w(name), ref, disp);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI cache_QueryAssemblyInfo(
+ IAssemblyCache *iface,
+ DWORD flags,
+ LPCWSTR name,
+ ASSEMBLY_INFO *info )
+{
+ FIXME("%p, 0x%08x, %s, %p\n", iface, flags, debugstr_w(name), info);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI cache_CreateAssemblyCacheItem(
+ IAssemblyCache *iface,
+ DWORD flags,
+ PVOID reserved,
+ IAssemblyCacheItem **item,
+ LPCWSTR name )
+{
+ FIXME("%p, 0x%08x, %p, %p, %s\n", iface, flags, reserved, item, debugstr_w(name));
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI cache_Reserved(
+ IAssemblyCache *iface,
+ IUnknown **reserved)
+{
+ FIXME("%p\n", reserved);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI cache_InstallAssembly(
+ IAssemblyCache *iface,
+ DWORD flags,
+ LPCWSTR path,
+ LPCFUSION_INSTALL_REFERENCE ref )
+{
+ FIXME("%p, 0x%08x, %s, %p\n", iface, flags, debugstr_w(path), ref);
+ return E_NOTIMPL;
+}
+
+static const IAssemblyCacheVtbl cache_vtbl =
+{
+ cache_QueryInterface,
+ cache_AddRef,
+ cache_Release,
+ cache_UninstallAssembly,
+ cache_QueryAssemblyInfo,
+ cache_CreateAssemblyCacheItem,
+ cache_Reserved,
+ cache_InstallAssembly
+};
+
+/******************************************************************
+ * CreateAssemblyCache (SXS.@)
+ */
+HRESULT WINAPI CreateAssemblyCache( IAssemblyCache **obj, DWORD reserved )
+{
+ struct cache *cache;
+
+ TRACE("%p, %u\n", obj, reserved);
+
+ if (!obj)
+ return E_INVALIDARG;
+
+ *obj = NULL;
+
+ cache = HeapAlloc( GetProcessHeap(), 0, sizeof(struct cache) );
+ if (!cache)
+ return E_OUTOFMEMORY;
+
+ cache->vtbl = &cache_vtbl;
+ cache->refs = 1;
+
+ *obj = (IAssemblyCache *)cache;
+ return S_OK;
+}
diff --git a/dlls/sxs/sxs.c b/dlls/sxs/sxs.c
index 76c2f85..f4fdd6c 100644
--- a/dlls/sxs/sxs.c
+++ b/dlls/sxs/sxs.c
@@ -42,9 +42,3 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
}
return TRUE;
}
-
-HRESULT WINAPI CreateAssemblyCache(DWORD unimplemented, DWORD dwReserved)
-{
- FIXME("%u %u stub\n", unimplemented, dwReserved);
- return E_NOTIMPL;
-}
More information about the wine-cvs
mailing list