[prev in list] [next in list] [prev in thread] [next in thread]
List: wine-patches
Subject: Patch: Implements ProgIDFromCLSID
From: "Abey George" <abey () macadamian ! com>
Date: 1999-10-29 16:36:21
[Download RAW message or body]
Hi
This patch implements the OLE function ProgIDFromCLSID.
files modified:
dlls/ole32/ole32.spec
dlls/ole32/compobj.c
Change Log :
Implemented ProgIDFromCLSID.
Abey George<abey@macadamian.com>
Abey George
Macadamian Technologies Inc
In association with Corel
["ole32.diff" (application/octet-stream)]
Index: dlls/ole32/ole32.spec
===================================================================
RCS file: /home/wine/wine/dlls/ole32/ole32.spec,v
retrieving revision 1.3
diff -u -r1.3 ole32.spec
--- dlls/ole32/ole32.spec 1999/10/24 21:35:17 1.3
+++ dlls/ole32/ole32.spec 1999/10/28 17:37:19
@@ -133,7 +133,7 @@
130 stdcall OleTranslateAccelerator(ptr ptr ptr) OleTranslateAccelerator
131 stdcall OleUninitialize() OleUninitialize
132 stub OpenOrCreateStream
-133 stub ProgIDFromCLSID
+133 stdcall ProgIDFromCLSID(wstr ptr) ProgIDFromCLSID
134 stdcall ReadClassStg(ptr ptr) ReadClassStg
135 stdcall ReadClassStm(ptr ptr) ReadClassStm
136 stdcall ReadFmtUserTypeStg(ptr ptr ptr) ReadFmtUserTypeStg
Index: dlls/ole32/compobj.c
===================================================================
RCS file: /home/wine/wine/dlls/ole32/compobj.c,v
retrieving revision 1.3
diff -u -r1.3 compobj.c
--- dlls/ole32/compobj.c 1999/10/25 15:43:36 1.3
+++ dlls/ole32/compobj.c 1999/10/28 17:37:22
@@ -858,6 +858,57 @@
}
/******************************************************************************
+ * ProgIDFromCLSID [OLE32.133]
+ * Converts a class id into the respective Program ID. (By using a registry lookup)
+ * RETURNS S_OK on success
+ * riid associated with the progid
+ */
+
+HRESULT WINAPI ProgIDFromCLSID(
+ REFCLSID clsid, /* [in] class id as found in registry */
+ LPOLESTR *lplpszProgID/* [out] associated Prog ID */
+)
+{
+ char strCLSID[50], *buf, *buf2;
+ DWORD buf2len;
+ HKEY xhkey;
+ LPMALLOC mllc;
+ HRESULT ret = S_OK;
+
+ WINE_StringFromCLSID(clsid, strCLSID);
+
+ buf = HeapAlloc(GetProcessHeap(), 0, strlen(strCLSID)+14);
+ sprintf(buf,"CLSID\\%s\\ProgID", strCLSID);
+ if (RegOpenKeyA(HKEY_CLASSES_ROOT, buf, &xhkey))
+ ret = REGDB_E_CLASSNOTREG;
+
+ HeapFree(GetProcessHeap(), 0, buf);
+
+ if (ret == S_OK)
+ {
+ buf2 = HeapAlloc(GetProcessHeap(), 0, 255);
+ buf2len = 255;
+ if (RegQueryValueA(xhkey, NULL, buf2, &buf2len))
+ ret = REGDB_E_CLASSNOTREG;
+
+ if (ret == S_OK)
+ {
+ if (CoGetMalloc(0,&mllc))
+ ret = E_OUTOFMEMORY;
+ else
+ {
+ *lplpszProgID = IMalloc_Alloc(mllc, (buf2len+1)*2);
+ lstrcpyAtoW(*lplpszProgID, buf2);
+ }
+ }
+ HeapFree(GetProcessHeap(), 0, buf2);
+ }
+
+ RegCloseKey(xhkey);
+ return ret;
+}
+
+/******************************************************************************
* CLSIDFromProgID16 [COMPOBJ.61]
* Converts a program id into the respective GUID. (By using a registry lookup)
* RETURNS
=========================================================================
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic