PATCH: olefont
Marcus Meissner
marcus at jet.franken.de
Mon Jul 23 15:48:09 CDT 2001
Hi,
Some VB apps needs this.
Ciao, Marcus
Changelog:
OLEAUT32.DllGetClassObject and support for the Ole StdFont added.
(Just giving back a 8 point System font for now.)
Index: oleaut.c
===================================================================
RCS file: /home/wine/wine/dlls/oleaut32/oleaut.c,v
retrieving revision 1.17
diff -u -r1.17 oleaut.c
--- oleaut.c 2001/07/11 18:56:42 1.17
+++ oleaut.c 2001/07/23 21:32:19
@@ -11,6 +11,8 @@
#include "winerror.h"
#include "ole2.h"
+#include "wine/obj_oleaut.h"
+#include "wine/obj_olefont.h"
#include "heap.h"
#include "debugtools.h"
@@ -134,4 +136,25 @@
HRESULT WINAPI OLEAUT32_DllUnregisterServer() {
FIXME("stub!\n");
return S_OK;
+}
+
+extern void _get_STDFONT_CF(LPVOID);
+
+HRESULT WINAPI OLEAUT32_DllGetClassObject(REFCLSID rclsid, REFIID iid,LPVOID *ppv)
+{
+ *ppv = NULL;
+ if (IsEqualGUID(rclsid,&CLSID_StdFont)) {
+ if (IsEqualGUID(iid,&IID_IClassFactory)) {
+ _get_STDFONT_CF(ppv);
+ IClassFactory_AddRef((IClassFactory*)*ppv);
+ return S_OK;
+ }
+ }
+ FIXME("\n\tCLSID:\t%s,\n\tIID:\t%s\n",debugstr_guid(rclsid),debugstr_guid(iid));
+ return CLASS_E_CLASSNOTAVAILABLE;
+}
+
+HRESULT WINAPI OLEAUT32_DllCanUnloadNow() {
+ FIXME("(), stub!\n");
+ return S_FALSE;
}
Index: oleaut32.spec
===================================================================
RCS file: /home/wine/wine/dlls/oleaut32/oleaut32.spec,v
retrieving revision 1.26
diff -u -r1.26 oleaut32.spec
--- oleaut32.spec 2001/04/10 21:17:04 1.26
+++ oleaut32.spec 2001/07/23 21:32:20
@@ -11,7 +11,7 @@
debug_channels (ole typelib)
-1 stub DllGetClassObject
+1 stdcall DllGetClassObject(ptr ptr ptr) OLEAUT32_DllGetClassObject
2 stdcall SysAllocString(wstr) SysAllocString
3 stdcall SysReAllocString(ptr wstr) SysReAllocString
4 stdcall SysAllocStringLen(wstr long) SysAllocStringLen
@@ -286,7 +286,7 @@
397 stub UserMSG_to_local
398 stub UserMSG_free_inst
399 stub UserMSG_free_local
-410 stub DllCanUnloadNow
+410 stdcall DllCanUnloadNow() OLEAUT32_DllCanUnloadNow
411 stdcall SafeArrayCreateVector(long long long) SafeArrayCreateVector
412 stdcall SafeArrayCopyData(ptr ptr) SafeArrayCopyData
413 stub VectorFromBstr
Index: olefont.c
===================================================================
RCS file: /home/wine/wine/dlls/oleaut32/olefont.c,v
retrieving revision 1.10
diff -u -r1.10 olefont.c
--- olefont.c 2001/07/22 23:03:55 1.10
+++ olefont.c 2001/07/23 21:32:24
@@ -14,6 +14,7 @@
#include "winuser.h"
#include "wine/unicode.h"
#include "oleauto.h" /* for SysAllocString(....) */
+#include "wine/obj_base.h"
#include "wine/obj_olefont.h"
#include "wine/obj_storage.h"
#include "ole2.h"
@@ -1588,3 +1589,76 @@
}
}
+/*******************************************************************************
+ * StdFont ClassFactory
+ */
+typedef struct
+{
+ /* IUnknown fields */
+ ICOM_VFIELD(IClassFactory);
+ DWORD ref;
+} IClassFactoryImpl;
+
+static HRESULT WINAPI
+SFCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
+ ICOM_THIS(IClassFactoryImpl,iface);
+
+ FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
+ return E_NOINTERFACE;
+}
+
+static ULONG WINAPI
+SFCF_AddRef(LPCLASSFACTORY iface) {
+ ICOM_THIS(IClassFactoryImpl,iface);
+ return ++(This->ref);
+}
+
+static ULONG WINAPI SFCF_Release(LPCLASSFACTORY iface) {
+ ICOM_THIS(IClassFactoryImpl,iface);
+ /* static class, won't be freed */
+ return --(This->ref);
+}
+
+static HRESULT WINAPI SFCF_CreateInstance(
+ LPCLASSFACTORY iface,LPUNKNOWN pOuter,REFIID riid,LPVOID *ppobj
+) {
+ ICOM_THIS(IClassFactoryImpl,iface);
+
+ if (IsEqualGUID(riid,&IID_IFont)) {
+ FONTDESC fd;
+
+ WCHAR fname[] = { 'S','y','s','t','e','m',0 };
+
+ fd.cbSizeofstruct = sizeof(fd);
+ fd.lpstrName = fname;
+ fd.cySize.s.Lo = 80000;
+ fd.cySize.s.Hi = 0;
+ fd.sWeight = 0;
+ fd.sCharset = 0;
+ fd.fItalic = 0;
+ fd.fUnderline = 0;
+ fd.fStrikethrough = 0;
+ return OleCreateFontIndirect(&fd,riid,ppobj);
+ }
+
+ FIXME("(%p)->(%p,%s,%p)\n",This,pOuter,debugstr_guid(riid),ppobj);
+ return E_NOINTERFACE;
+}
+
+static HRESULT WINAPI SFCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
+ ICOM_THIS(IClassFactoryImpl,iface);
+ FIXME("(%p)->(%d),stub!\n",This,dolock);
+ return S_OK;
+}
+
+static ICOM_VTABLE(IClassFactory) SFCF_Vtbl = {
+ ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
+ SFCF_QueryInterface,
+ SFCF_AddRef,
+ SFCF_Release,
+ SFCF_CreateInstance,
+ SFCF_LockServer
+};
+static IClassFactoryImpl STDFONT_CF = {&SFCF_Vtbl, 1 };
+
+void _get_STDFONT_CF(LPVOID *ppv) { *ppv = (LPVOID)&STDFONT_CF; }
More information about the wine-patches
mailing list