crypt32: Implement CryptBinaryToStringW(HEXRAW).
[wine.git] / dlls / infosoft / infosoft_main.c
blob1d93b4923bdabef3330a95f3f1d03d3cd89f0f22
1 /*
2 * Word splitter Implementation
4 * Copyright 2006 Mike McCormack
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #define COBJMACROS
24 #include <stdarg.h>
25 #include <stdio.h>
27 #include "windef.h"
28 #include "winbase.h"
29 #include "winuser.h"
30 #include "ole2.h"
31 #include "rpcproxy.h"
32 #include "indexsrv.h"
33 #include "initguid.h"
34 #include "infosoft.h"
36 #include "wine/debug.h"
38 WINE_DEFAULT_DEBUG_CHANNEL(infosoft);
40 static HINSTANCE instance;
42 BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
44 switch(fdwReason)
46 case DLL_WINE_PREATTACH:
47 return FALSE; /* prefer native version */
48 case DLL_PROCESS_ATTACH:
49 instance = hInstDLL;
50 DisableThreadLibraryCalls(hInstDLL);
51 break;
53 return TRUE;
56 DECLSPEC_HIDDEN extern HRESULT WINAPI wb_Constructor(IUnknown*, REFIID, LPVOID *);
58 typedef HRESULT (CALLBACK *LPFNCREATEINSTANCE)(IUnknown*, REFIID, LPVOID*);
60 typedef struct
62 IClassFactory IClassFactory_iface;
63 LPFNCREATEINSTANCE lpfnCI;
64 } CFImpl;
66 static inline CFImpl *impl_from_IClassFactory(IClassFactory *iface)
68 return CONTAINING_RECORD(iface, CFImpl, IClassFactory_iface);
71 static HRESULT WINAPI infosoftcf_fnQueryInterface ( LPCLASSFACTORY iface,
72 REFIID riid, LPVOID *ppvObj)
74 CFImpl *This = impl_from_IClassFactory(iface);
76 TRACE("(%p)->(%s)\n",This,debugstr_guid(riid));
78 *ppvObj = NULL;
80 if (IsEqualIID(riid, &IID_IUnknown) ||
81 IsEqualIID(riid, &IID_IClassFactory))
83 *ppvObj = &This->IClassFactory_iface;
84 return S_OK;
87 TRACE("-- E_NOINTERFACE\n");
88 return E_NOINTERFACE;
91 static ULONG WINAPI infosoftcf_fnAddRef (LPCLASSFACTORY iface)
93 return 2;
96 static ULONG WINAPI infosoftcf_fnRelease(LPCLASSFACTORY iface)
98 return 1;
101 static HRESULT WINAPI infosoftcf_fnCreateInstance( LPCLASSFACTORY iface,
102 LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject)
104 CFImpl *This = impl_from_IClassFactory(iface);
106 TRACE("%p->(%p,%s,%p)\n", This, pUnkOuter, debugstr_guid(riid), ppvObject);
108 *ppvObject = NULL;
110 return This->lpfnCI(pUnkOuter, riid, ppvObject);
113 static HRESULT WINAPI infosoftcf_fnLockServer(LPCLASSFACTORY iface, BOOL fLock)
115 FIXME("%p %d\n", iface, fLock);
116 return E_NOTIMPL;
119 static const IClassFactoryVtbl infosoft_cfvt =
121 infosoftcf_fnQueryInterface,
122 infosoftcf_fnAddRef,
123 infosoftcf_fnRelease,
124 infosoftcf_fnCreateInstance,
125 infosoftcf_fnLockServer
128 static CFImpl wb_cf = { { &infosoft_cfvt }, wb_Constructor };
130 /***********************************************************************
131 * DllGetClassObject (INFOSOFT.@)
133 HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
135 IClassFactory *pcf = NULL;
137 TRACE("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv);
139 if (!ppv)
140 return E_INVALIDARG;
141 *ppv = NULL;
143 if (IsEqualIID(rclsid, &CLSID_wb_Neutral))
144 pcf = &wb_cf.IClassFactory_iface;
145 else
146 return CLASS_E_CLASSNOTAVAILABLE;
148 return IClassFactory_QueryInterface(pcf, iid, ppv);
152 HRESULT WINAPI DllCanUnloadNow(void)
154 return S_FALSE;
157 /***********************************************************************
158 * DllRegisterServer (INFOSOFT.@)
160 HRESULT WINAPI DllRegisterServer(void)
162 return __wine_register_resources( instance );
165 /***********************************************************************
166 * DllUnregisterServer (INFOSOFT.@)
168 HRESULT WINAPI DllUnregisterServer(void)
170 return __wine_unregister_resources( instance );