2 * Copyright 2011 Hans Leidekker for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
31 #include "wine/debug.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(scrrun);
35 static HINSTANCE scrrun_instance;
37 typedef HRESULT (*fnCreateInstance)(LPVOID *ppObj);
39 extern HRESULT WINAPI FileSystem_CreateInstance(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
41 static HRESULT WINAPI scrruncf_QueryInterface(IClassFactory *iface, REFIID riid, LPVOID *ppv )
45 if(IsEqualGUID(&IID_IUnknown, riid)) {
46 TRACE("(%p)->(IID_IUnknown %p)\n", iface, ppv);
48 }else if(IsEqualGUID(&IID_IClassFactory, riid)) {
49 TRACE("(%p)->(IID_IClassFactory %p)\n", iface, ppv);
54 IUnknown_AddRef((IUnknown*)*ppv);
58 FIXME("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv);
62 static ULONG WINAPI scrruncf_AddRef(IClassFactory *iface )
64 TRACE("(%p)\n", iface);
68 static ULONG WINAPI scrruncf_Release(IClassFactory *iface )
70 TRACE("(%p)\n", iface);
74 static HRESULT WINAPI scrruncf_LockServer(IClassFactory *iface, BOOL fLock)
76 TRACE("(%p)->(%x)\n", iface, fLock);
80 static const struct IClassFactoryVtbl scrruncf_vtbl =
82 scrruncf_QueryInterface,
85 FileSystem_CreateInstance,
89 static IClassFactory FileSystemFactory = { &scrruncf_vtbl };
91 BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
93 TRACE("%p, %u, %p\n", hinst, reason, reserved);
97 case DLL_WINE_PREATTACH:
98 return FALSE; /* prefer native version */
99 case DLL_PROCESS_ATTACH:
100 DisableThreadLibraryCalls( hinst );
101 scrrun_instance = hinst;
103 case DLL_PROCESS_DETACH:
109 /***********************************************************************
110 * DllRegisterServer (scrrun.@)
112 HRESULT WINAPI DllRegisterServer(void)
115 return __wine_register_resources(scrrun_instance);
118 /***********************************************************************
119 * DllUnregisterServer (scrrun.@)
121 HRESULT WINAPI DllUnregisterServer(void)
124 return __wine_unregister_resources(scrrun_instance);
127 /***********************************************************************
128 * DllGetClassObject (scrrun.@)
131 HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
133 if(IsEqualGUID(&CLSID_FileSystemObject, rclsid)) {
134 TRACE("(CLSID_WshShell %s %p)\n", debugstr_guid(riid), ppv);
135 return IClassFactory_QueryInterface(&FileSystemFactory, riid, ppv);
138 FIXME("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
139 return CLASS_E_CLASSNOTAVAILABLE;
142 /***********************************************************************
143 * DllCanUnloadNow (scrrun.@)
145 HRESULT WINAPI DllCanUnloadNow(void)