Mariusz Pluciński : gameux: Add stub of IGameExplorer implementation.
Alexandre Julliard
julliard at winehq.org
Wed Jul 28 10:45:12 CDT 2010
Module: wine
Branch: master
Commit: 9878d6b384ad2b351abb5a6f52ce15ace1e8fe96
URL: http://source.winehq.org/git/wine.git/?a=commit;h=9878d6b384ad2b351abb5a6f52ce15ace1e8fe96
Author: Mariusz Pluciński <vshader at gmail.com>
Date: Fri Jul 23 01:06:25 2010 +0200
gameux: Add stub of IGameExplorer implementation.
---
dlls/gameux/Makefile.in | 2 +
dlls/gameux/gameexplorer.c | 184 ++++++++++++++++++++++++++++++++++++++++++
dlls/gameux/gameux_private.h | 21 +++++
3 files changed, 207 insertions(+), 0 deletions(-)
diff --git a/dlls/gameux/Makefile.in b/dlls/gameux/Makefile.in
index d26a8ab..7cf2600 100644
--- a/dlls/gameux/Makefile.in
+++ b/dlls/gameux/Makefile.in
@@ -4,8 +4,10 @@ TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = gameux.dll
+IMPORTS = uuid
C_SRCS = \
+ gameexplorer.c \
main.c
RC_SRCS = version.rc
diff --git a/dlls/gameux/gameexplorer.c b/dlls/gameux/gameexplorer.c
new file mode 100644
index 0000000..0fa5e9c
--- /dev/null
+++ b/dlls/gameux/gameexplorer.c
@@ -0,0 +1,184 @@
+/*
+ * Gameux library coclass GameExplorer implementation
+ *
+ * Copyright (C) 2010 Mariusz Pluciński
+ *
+ * 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
+ */
+#define COBJMACROS
+
+#include "config.h"
+
+#include "ole2.h"
+
+#include "gameux.h"
+#include "gameux_private.h"
+
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(gameux);
+
+/*
+ * IGameExplorer implementation
+ */
+
+typedef struct _GameExplorerImpl
+{
+ const struct IGameExplorerVtbl *lpGameExplorerVtbl;
+ LONG ref;
+} GameExplorerImpl;
+
+static inline GameExplorerImpl *impl_from_IGameExplorer(IGameExplorer *iface)
+{
+ return (GameExplorerImpl*)((char*)iface - FIELD_OFFSET(GameExplorerImpl, lpGameExplorerVtbl));
+}
+
+static HRESULT WINAPI GameExplorerImpl_QueryInterface(
+ IGameExplorer *iface,
+ REFIID riid,
+ void **ppvObject)
+{
+ GameExplorerImpl *This = impl_from_IGameExplorer(iface);
+
+ TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), ppvObject);
+
+ *ppvObject = NULL;
+
+ if(IsEqualGUID(riid, &IID_IUnknown) ||
+ IsEqualGUID(riid, &IID_IGameExplorer))
+ {
+ *ppvObject = iface;
+ }
+ else
+ {
+ FIXME("interface %s not implemented\n", debugstr_guid(riid));
+ return E_NOINTERFACE;
+ }
+
+ IGameExplorer_AddRef(iface);
+ return S_OK;
+}
+
+static ULONG WINAPI GameExplorerImpl_AddRef(IGameExplorer *iface)
+{
+ GameExplorerImpl *This = impl_from_IGameExplorer(iface);
+ LONG ref;
+
+ ref = InterlockedIncrement(&This->ref);
+
+ TRACE("(%p): ref=%d\n", This, ref);
+ return ref;
+}
+
+static ULONG WINAPI GameExplorerImpl_Release(IGameExplorer *iface)
+{
+ GameExplorerImpl *This = impl_from_IGameExplorer(iface);
+ LONG ref;
+
+ ref = InterlockedDecrement(&This->ref);
+ TRACE("(%p): ref=%d\n", This, ref);
+
+ if(ref == 0)
+ {
+ TRACE("freeing GameExplorer object\n");
+ HeapFree(GetProcessHeap(), 0, This);
+ }
+
+ return ref;
+}
+
+static HRESULT WINAPI GameExplorerImpl_AddGame(
+ IGameExplorer *iface,
+ BSTR bstrGDFBinaryPath,
+ BSTR sGameInstallDirectory,
+ GAME_INSTALL_SCOPE installScope,
+ GUID *pInstanceID)
+{
+ GameExplorerImpl *This = impl_from_IGameExplorer(iface);
+
+ TRACE("(%p, %s, %s, %d, %s)\n", This, debugstr_w(bstrGDFBinaryPath), debugstr_w(sGameInstallDirectory), installScope, debugstr_guid(pInstanceID));
+ FIXME("stub\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI GameExplorerImpl_RemoveGame(
+ IGameExplorer *iface,
+ GUID instanceID)
+{
+ GameExplorerImpl *This = impl_from_IGameExplorer(iface);
+
+ TRACE("(%p, %s)\n", This, debugstr_guid(&instanceID));
+ FIXME("stub\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI GameExplorerImpl_UpdateGame(
+ IGameExplorer *iface,
+ GUID instanceID)
+{
+ GameExplorerImpl *This = impl_from_IGameExplorer(iface);
+
+ TRACE("(%p, %s)\n", This, debugstr_guid(&instanceID));
+ FIXME("stub\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI GameExplorerImpl_VerifyAccess(
+ IGameExplorer *iface,
+ BSTR sGDFBinaryPath,
+ BOOL *pHasAccess)
+{
+ GameExplorerImpl *This = impl_from_IGameExplorer(iface);
+
+ TRACE("(%p, %s, %p)\n", This, debugstr_w(sGDFBinaryPath), pHasAccess);
+ FIXME("stub\n");
+ return E_NOTIMPL;
+}
+
+static const struct IGameExplorerVtbl GameExplorerImplVtbl =
+{
+ GameExplorerImpl_QueryInterface,
+ GameExplorerImpl_AddRef,
+ GameExplorerImpl_Release,
+ GameExplorerImpl_AddGame,
+ GameExplorerImpl_RemoveGame,
+ GameExplorerImpl_UpdateGame,
+ GameExplorerImpl_VerifyAccess
+};
+
+/*
+ * Construction routine
+ */
+HRESULT GameExplorer_create(
+ IUnknown* pUnkOuter,
+ IUnknown** ppObj)
+{
+ GameExplorerImpl *pGameExplorer;
+
+ TRACE("(%p, %p)\n", pUnkOuter, ppObj);
+
+ pGameExplorer = HeapAlloc(GetProcessHeap(), 0, sizeof(*pGameExplorer));
+
+ if(!pGameExplorer)
+ return E_OUTOFMEMORY;
+
+ pGameExplorer->lpGameExplorerVtbl = &GameExplorerImplVtbl;
+ pGameExplorer->ref = 1;
+
+ *ppObj = (IUnknown*)(&pGameExplorer->lpGameExplorerVtbl);
+
+ TRACE("returning iface: %p\n", *ppObj);
+ return S_OK;
+}
diff --git a/dlls/gameux/gameux_private.h b/dlls/gameux/gameux_private.h
new file mode 100644
index 0000000..3872cb9
--- /dev/null
+++ b/dlls/gameux/gameux_private.h
@@ -0,0 +1,21 @@
+/*
+ * Gameux library private header
+ *
+ * Copyright (C) 2010 Mariusz Pluciński
+ *
+ * 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
+ */
+
+extern HRESULT GameExplorer_create(IUnknown* pUnkOuter, IUnknown **ppObj);
More information about the wine-cvs
mailing list