Add a basic implementation of pstorec.dll

Mike McCormack mike at codeweavers.com
Sat May 8 02:38:42 CDT 2004


After applying this patch, you need to run autoconf again.

Mike


ChangeLog:
* Add a basic implementation of pstorec.dll
-------------- next part --------------
Index: configure.ac
===================================================================
RCS file: /home/wine/wine/configure.ac,v
retrieving revision 1.272
diff -u -r1.272 configure.ac
--- configure.ac	3 May 2004 20:17:43 -0000	1.272
+++ configure.ac	8 May 2004 06:34:03 -0000
@@ -1599,6 +1599,7 @@
 dlls/olesvr/Makefile
 dlls/opengl32/Makefile
 dlls/psapi/Makefile
+dlls/pstorec/Makefile
 dlls/qcap/Makefile
 dlls/quartz/Makefile
 dlls/rasapi32/Makefile
Index: dlls/Makefile.in
===================================================================
RCS file: /home/wine/wine/dlls/Makefile.in,v
retrieving revision 1.217
diff -u -r1.217 Makefile.in
--- dlls/Makefile.in	22 Apr 2004 03:45:00 -0000	1.217
+++ dlls/Makefile.in	8 May 2004 06:34:03 -0000
@@ -97,6 +97,7 @@
 	olepro32 \
 	olesvr \
 	psapi \
+	pstorec \
 	qcap \
 	quartz \
 	rasapi32 \
@@ -325,6 +326,7 @@
 	olepro32.dll.so \
 	olesvr32.dll.so \
 	psapi.dll.so \
+	pstorec.dll.so \
 	qcap.dll.so \
 	quartz.dll.so \
 	rasapi32.dll.so \
@@ -718,6 +720,9 @@
 psapi.dll.so: psapi/psapi.dll.so
 	$(RM) $@ && $(LN_S) psapi/psapi.dll.so $@
 
+pstorec.dll.so: pstorec/pstorec.dll.so
+	$(RM) $@ && $(LN_S) pstorec/pstorec.dll.so $@
+
 qcap.dll.so: qcap/qcap.dll.so
 	$(RM) $@ && $(LN_S) qcap/qcap.dll.so $@
 
@@ -1012,6 +1017,7 @@
 	libolesvr32 \
 	libopengl32 \
 	libpsapi \
+	libpstorec \
 	libqcap \
 	libquartz \
 	librasapi32 \
@@ -1457,6 +1463,11 @@
 libpsapi.a: psapi/psapi.spec.def
 	$(DLLTOOL) -k -l $@ -d psapi/psapi.spec.def
 
+libpstorec.def: pstorec/pstorec.spec.def
+	$(RM) $@ && $(LN_S) pstorec/pstorec.spec.def $@
+libpstorec.a: pstorec/pstorec.spec.def
+	$(DLLTOOL) -k -l $@ -d pstorec/pstorec.spec.def
+
 libqcap.def: qcap/qcap.spec.def
 	$(RM) $@ && $(LN_S) qcap/qcap.spec.def $@
 libqcap.a: qcap/qcap.spec.def
@@ -1736,6 +1747,7 @@
 olesvr/olesvr32.spec.def: $(WINEBUILD)
 opengl32/opengl32.spec.def: $(WINEBUILD)
 psapi/psapi.spec.def: $(WINEBUILD)
+pstorec/pstorec.spec.def: $(WINEBUILD)
 qcap/qcap.spec.def: $(WINEBUILD)
 quartz/quartz.spec.def: $(WINEBUILD)
 rasapi32/rasapi32.spec.def: $(WINEBUILD)
@@ -1877,6 +1889,7 @@
 olesvr/olesvr32.dll.so: olesvr
 opengl32/opengl32.dll.so: opengl32
 psapi/psapi.dll.so: psapi
+pstorec/pstorec.dll.so: pstorec
 qcap/qcap.dll.so: qcap
 quartz/quartz.dll.so: quartz
 rasapi32/rasapi32.dll.so: rasapi32
Index: include/pstore.h
===================================================================
RCS file: /home/wine/wine/include/pstore.h,v
retrieving revision 1.1
diff -u -r1.1 pstore.h
--- include/pstore.h	29 Apr 2004 20:00:26 -0000	1.1
+++ include/pstore.h	8 May 2004 06:34:03 -0000
@@ -451,7 +451,7 @@
         PST_KEY Key,
         const GUID* pItemType,
         const GUID* pItemSubtype,
-        LPCWSTR* szItemName,
+        LPCWSTR szItemName,
         PST_ACCESSMODE ModeFlags,
         PPST_PROMPTIFO pProomptInfo,
         DWORD dwFlags) = 0;
@@ -622,7 +622,7 @@
         PST_KEY Key,
         const GUID* pItemType,
         const GUID* pItemSubtype,
-        LPCWSTR* szItemName,
+        LPCWSTR szItemName,
         PST_ACCESSMODE ModeFlags,
         PPST_PROMPTIFO pProomptInfo,
         DWORD dwFlags);
@@ -695,7 +695,7 @@
     STDMETHOD_(HRESULT,DeleteItem)(THIS_ PST_KEY Key, const GUID* pItemType, const GUID* pItemSubType, LPCWSTR szItemName, PPST_PROMPTINFO pPromptInfo, DWORD dwFlags) PURE; \
     STDMETHOD_(HRESULT,ReadItem)(THIS_ PST_KEY Key, const GUID* pItemType, const GUID* pItemSubtype, LPCWSTR szItemName, DWORD* cbData, BYTE** pbData, PPST_PROMPTIFO pPromptInfo, DWORD dwFlags) PURE; \
     STDMETHOD_(HRESULT,WriteItem)(THIS_ PST_KEY Key, const GUID* pItemType, const GUID* pItemSubtype, LPCWSTR szItemName, DWORD cbData, BYTE* ppbData, PPST_PROMPTIFO pPromptInfo, DWORD dwDefaultConfirmationStyle, DWORD dwFlags) PURE; \
-    STDMETHOD_(HRESULT,OpenItem)(THIS_ PST_KEY Key, const GUID* pItemType, const GUID* pItemSubtype, LPCWSTR* szItemName, PST_ACCESSMODE ModeFlags, PPST_PROMPTIFO pProomptInfo, DWORD dwFlags) PURE; \
+    STDMETHOD_(HRESULT,OpenItem)(THIS_ PST_KEY Key, const GUID* pItemType, const GUID* pItemSubtype, LPCWSTR szItemName, PST_ACCESSMODE ModeFlags, PPST_PROMPTIFO pProomptInfo, DWORD dwFlags) PURE; \
     STDMETHOD_(HRESULT,CloseItem)(THIS_ PST_KEY Key, const GUID* pItemType, const GUID* pItemSubtype, LPCWSTR* szItemName, DWORD dwFlags) PURE; \
     STDMETHOD_(HRESULT,EnumItems)(THIS_ PST_KEY Key, const GUID* pItemType, const GUID* pItemSubtype, DWORD dwFlags, IEnumPStoreItems** ppenum) PURE;
 
@@ -893,7 +893,7 @@
     PST_KEY Key,
     const GUID* pItemType,
     const GUID* pItemSubtype,
-    LPCWSTR* szItemName,
+    LPCWSTR szItemName,
     PST_ACCESSMODE ModeFlags,
     PPST_PROMPTIFO pProomptInfo,
     DWORD dwFlags);
Index: include/pstore.idl
===================================================================
RCS file: /home/wine/wine/include/pstore.idl,v
retrieving revision 1.1
diff -u -r1.1 pstore.idl
--- include/pstore.idl	29 Apr 2004 20:00:26 -0000	1.1
+++ include/pstore.idl	8 May 2004 06:34:03 -0000
@@ -240,7 +240,7 @@
         [in] PST_KEY Key,
         [in] const GUID* pItemType,
         [in] const GUID* pItemSubtype,
-        [in] LPCWSTR* szItemName,
+        [in] LPCWSTR szItemName,
         [in] PST_ACCESSMODE ModeFlags,
         [in] PPST_PROMPTIFO pProomptInfo,
         [in] DWORD dwFlags );
--- /dev/null	1994-07-18 08:46:18.000000000 +0900
+++ dlls/pstorec/.cvsignore	2004-05-08 16:21:30.000000000 +0900
@@ -0,0 +1,4 @@
+Makefile
+pstorec.dll.dbg.c
+pstorec.spec.c
+pstorec.spec.def
--- /dev/null	1994-07-18 08:46:18.000000000 +0900
+++ dlls/pstorec/Makefile.in	2004-05-08 16:21:05.000000000 +0900
@@ -0,0 +1,14 @@
+TOPSRCDIR = @top_srcdir@
+TOPOBJDIR = ../..
+SRCDIR    = @srcdir@
+VPATH     = @srcdir@
+MODULE    = pstorec.dll
+IMPORTS   = kernel32 advapi32 ole32
+EXTRALIBS = -luuid $(LIBUNICODE)
+
+C_SRCS = \
+	pstorec.c
+
+ at MAKE_DLL_RULES@
+
+### Dependencies:
--- /dev/null	1994-07-18 08:46:18.000000000 +0900
+++ dlls/pstorec/pstorec.spec	2004-05-08 16:21:24.000000000 +0900
@@ -0,0 +1,7 @@
+@ stdcall -private DllCanUnloadNow() PSTOREC_DllCanUnloadNow
+@ stdcall -private DllGetClassObject(ptr ptr ptr) PSTOREC_DllGetClassObject
+@ stdcall -private DllRegisterServer() PSTOREC_DllRegisterServer
+@ stdcall -private DllUnregisterServer() PSTOREC_DllUnregisterServer
+@ stub GetPStoreProvider
+@ stdcall PStoreCreateInstance(ptr ptr ptr long) PStoreCreateInstance
+@ stub PStoreEnumProviders
--- /dev/null	1994-07-18 08:46:18.000000000 +0900
+++ dlls/pstorec/pstorec.c	2004-05-08 16:21:13.000000000 +0900
@@ -0,0 +1,536 @@
+/*
+ *  Permanent Storage (pstores)
+ *
+ * Copyright 2004 Mike McCormack for CodeWeavers
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <stdarg.h>
+#include <stdio.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "winreg.h"
+#include "winerror.h"
+#include "winuser.h"
+#include "winnls.h"
+#include "ole2.h"
+
+#include "pstore.h"
+
+#include "wine/unicode.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(pstores);
+
+static struct ICOM_VTABLE(IPStore) pstores_vtbl;
+
+typedef struct
+{
+    ICOM_VFIELD(IPStore);
+    DWORD ref;
+} IPStore_impl;
+
+
+static const WCHAR szPStoresKey[] = {
+    'S','o','f','t','w','a','r','e','\\',
+    'W','i','n','e','\\','W','i','n','e','\\',
+    'p','s','t','o','r','e','s',0
+};
+
+/* convert a guid to a wide character string */
+static void IPStore_guid2wstr( const GUID *guid, LPWSTR wstr )
+{
+    char str[40];
+
+    sprintf(str, "{%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
+           guid->Data1, guid->Data2, guid->Data3,
+           guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
+           guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7] );
+    MultiByteToWideChar( CP_ACP, 0, str, -1, wstr, 40 );
+}
+
+static LONG IPStore_OpenRoot( PST_KEY Key, HKEY *hkey )
+{
+    switch( Key )
+    {
+    case PST_KEY_CURRENT_USER:
+        return RegCreateKeyW( HKEY_CURRENT_USER, szPStoresKey, hkey );
+    case PST_KEY_LOCAL_MACHINE:
+        return RegCreateKeyW( HKEY_LOCAL_MACHINE, szPStoresKey, hkey );
+    }
+    return ERROR_INVALID_PARAMETER;
+}
+
+/**************************************************************************
+ *  IPStore->QueryInterface
+ */
+static HRESULT WINAPI IPStore_fnQueryInterface(
+        IPStore* iface,
+        REFIID riid,
+        LPVOID *ppvObj)
+{
+    ICOM_THIS(IPStore_impl, iface);
+
+    TRACE("(%p)->(\n\tIID:\t%s)\n",This,debugstr_guid(riid));
+
+    *ppvObj = NULL;
+
+    if(IsEqualIID(riid, &IID_IUnknown) )
+    {
+        *ppvObj = This;
+    }
+
+    if(*ppvObj)
+    {
+        IUnknown_AddRef((IUnknown*)(*ppvObj));
+        TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj);
+        return S_OK;
+    }
+    TRACE("-- Interface: E_NOINTERFACE\n");
+    return E_NOINTERFACE;
+}
+
+/******************************************************************************
+ * IPStore->AddRef
+ */
+static ULONG WINAPI IPStore_fnAddRef(IPStore* iface)
+{
+    ICOM_THIS(IPStore_impl, iface);
+
+    TRACE("(%p)->(count=%lu)\n",This,This->ref);
+
+    return IPStore_AddRef((IPStore*)This);
+}
+
+/******************************************************************************
+ * IPStore->Release
+ */
+static ULONG WINAPI IPStore_fnRelease(IPStore* iface)
+{
+    ICOM_THIS(IPStore_impl, iface);
+
+    TRACE("(%p)->(count=%lu)\n",This,This->ref);
+
+    if( --(This->ref) )
+        return This->ref;
+
+    HeapFree( GetProcessHeap(), 0, This );
+
+    return 0;
+}
+
+/******************************************************************************
+ * IPStore->GetInfo
+ */
+static HRESULT WINAPI IPStore_fnGetInfo( IPStore* iface, PPST_PROVIDERINFO* ppProperties)
+{
+    FIXME("\n");
+    return E_FAIL;
+}
+
+/******************************************************************************
+ * IPStore->GetProvParam
+ */
+static HRESULT WINAPI IPStore_fnGetProvParam( IPStore* iface,
+    DWORD dwParam, DWORD* pcbData, BYTE** ppbData, DWORD dwFlags)
+{
+    FIXME("\n");
+    return E_FAIL;
+}
+
+/******************************************************************************
+ * IPStore->SetProvParam
+ */
+static HRESULT WINAPI IPStore_fnSetProvParam( IPStore* This,
+    DWORD dwParam, DWORD cbData, BYTE* pbData, DWORD* dwFlags)
+{
+    FIXME("\n");
+    return E_FAIL;
+}
+
+/******************************************************************************
+ * IPStore->CreateType
+ */
+static HRESULT WINAPI IPStore_fnCreateType( IPStore* This,
+    PST_KEY Key, const GUID* pType, PPST_TYPEINFO pInfo, DWORD dwFlags)
+{
+    LONG r;
+    HKEY hkey, hkeytype;
+    WCHAR szGuid[40];
+
+    TRACE("%p %08lx %s %p(%ld,%s) %08lx\n", This, Key, debugstr_guid(pType), 
+          pInfo, pInfo->cbSize, debugstr_w(pInfo->szDisplayName), dwFlags);
+
+    r = IPStore_OpenRoot( Key, &hkey );
+    if( r )
+        return E_FAIL;
+
+    IPStore_guid2wstr( pType, szGuid );
+    r = RegCreateKeyW( hkey, szGuid, &hkeytype );
+    if( r == ERROR_SUCCESS )
+    {
+        r = RegSetValueW( hkeytype, NULL, REG_SZ, 
+               pInfo->szDisplayName, strlenW( pInfo->szDisplayName ) );
+        RegCloseKey( hkeytype );
+    }
+    RegCloseKey( hkey );
+
+    return ( r == ERROR_SUCCESS ) ? S_OK : E_FAIL;
+}
+
+/******************************************************************************
+ * IPStore->GetTypeInfo
+ */
+static HRESULT WINAPI IPStore_fnGetTypeInfo( IPStore* This,
+    PST_KEY Key, const GUID* pType, PPST_TYPEINFO** ppInfo, DWORD dwFlags)
+{
+    FIXME("\n");
+    return E_FAIL;
+}
+
+/******************************************************************************
+ * IPStore->DeleteType
+ */
+static HRESULT WINAPI IPStore_fnDeleteType( IPStore* This,
+    PST_KEY Key, const GUID* pType, DWORD dwFlags)
+{
+    FIXME("\n");
+    return E_FAIL;
+}
+
+/******************************************************************************
+ * IPStore->CreateSubtype
+ */
+static HRESULT WINAPI IPStore_fnCreateSubtype( IPStore* This,
+    PST_KEY Key, const GUID* pType, const GUID* pSubtype,
+    PPST_TYPEINFO pInfo, PPST_ACCESSRULESET pRules, DWORD dwFlags)
+{
+    LONG r;
+    HKEY hkey, hkeysubtype;
+    WCHAR szGuid[80];
+
+    TRACE("%p %08lx %s %s %p %p %08lx\n", This, Key, debugstr_guid(pType),
+           debugstr_guid(pSubtype), pInfo, pRules, dwFlags);
+
+    r = IPStore_OpenRoot( Key, &hkey );
+    if( r )
+        return E_FAIL;
+    
+    IPStore_guid2wstr( pType, szGuid );
+    szGuid[38] = '\\';
+    IPStore_guid2wstr( pSubtype, &szGuid[39] );
+    r = RegCreateKeyW( hkey, szGuid, &hkeysubtype );
+    if( r == ERROR_SUCCESS )
+    {
+        r = RegSetValueW( hkeysubtype, NULL, REG_SZ, 
+                   pInfo->szDisplayName, strlenW( pInfo->szDisplayName ) );
+        RegCloseKey( hkeysubtype );
+    }
+    RegCloseKey( hkey );
+
+    return ( r == ERROR_SUCCESS ) ? S_OK : E_FAIL;
+}
+
+/******************************************************************************
+ * IPStore->GetSubtypeInfo
+ */
+static HRESULT WINAPI IPStore_fnGetSubtypeInfo( IPStore* This,
+    PST_KEY Key, const GUID* pType, const GUID* pSubtype,
+    PPST_TYPEINFO** ppInfo, DWORD dwFlags)
+{
+    FIXME("\n");
+    return E_FAIL;
+}
+
+/******************************************************************************
+ * IPStore->DeleteSubtype
+ */
+static HRESULT WINAPI IPStore_fnDeleteSubtype( IPStore* This,
+    PST_KEY Key, const GUID* pType, const GUID* pSubtype, DWORD dwFlags)
+{
+    FIXME("\n");
+    return E_FAIL;
+}
+
+/******************************************************************************
+ * IPStore->ReadAccessRuleset
+ */
+static HRESULT WINAPI IPStore_fnReadAccessRuleset( IPStore* This,
+    PST_KEY Key, const GUID* pType, const GUID* pSubtype, PPST_TYPEINFO pInfo,
+    PPST_ACCESSRULESET** ppRules, DWORD dwFlags)
+{
+    FIXME("\n");
+    return E_FAIL;
+}
+
+/******************************************************************************
+ * IPStore->WriteAccessRuleSet
+ */
+static HRESULT WINAPI IPStore_fnWriteAccessRuleset( IPStore* This,
+    PST_KEY Key, const GUID* pType, const GUID* pSubtype,
+    PPST_TYPEINFO pInfo, PPST_ACCESSRULESET pRules, DWORD dwFlags)
+{
+    FIXME("\n");
+    return E_FAIL;
+}
+
+/******************************************************************************
+ * IPStore->EnumTypes
+ */
+static HRESULT WINAPI IPStore_fnEnumTypes( IPStore* This, PST_KEY Key,
+    DWORD dwFlags, IEnumPStoreTypes** ppenum)
+{
+    FIXME("\n");
+    return E_FAIL;
+}
+
+/******************************************************************************
+ * IPStore->EnumSubtypes
+ */
+static HRESULT WINAPI IPStore_fnEnumSubtypes( IPStore* This, PST_KEY Key,
+    const GUID* pType, DWORD dwFlags, IEnumPStoreTypes** ppenum)
+{
+    FIXME("\n");
+    return E_FAIL;
+}
+
+/******************************************************************************
+ * IPStore->DeleteItem
+ */
+static HRESULT WINAPI IPStore_fnDeleteItem( IPStore* This, PST_KEY Key,
+    const GUID* pItemType, const GUID* pItemSubType, LPCWSTR szItemName,
+    PPST_PROMPTINFO pPromptInfo, DWORD dwFlags)
+{
+    FIXME("\n");
+    return E_FAIL;
+}
+
+/******************************************************************************
+ * IPStore->ReadItem
+ */
+static HRESULT WINAPI IPStore_fnReadItem( IPStore* This, PST_KEY Key, 
+    const GUID* pItemType, const GUID* pItemSubtype, LPCWSTR szItemName, 
+    DWORD *cbData, BYTE** pbData, PPST_PROMPTIFO pPromptInfo, DWORD dwFlags)
+{
+    LONG r;
+    HKEY hkey, hkeysubtype;
+    WCHAR szGuid[80];
+    DWORD type, sz = 0;
+
+    TRACE("%p %08lx %s %s %s %p %p %p %08lx\n", This, Key, 
+        debugstr_guid(pItemType), debugstr_guid(pItemSubtype), 
+        debugstr_w(szItemName), cbData, pbData, pPromptInfo, dwFlags);
+
+    *pbData = NULL;
+    *cbData = 0;
+
+    r = IPStore_OpenRoot( Key, &hkey );
+    if( r )
+        return E_FAIL;
+
+    IPStore_guid2wstr( pItemType, szGuid );
+    szGuid[38] = '\\';
+    IPStore_guid2wstr( pItemSubtype, &szGuid[39] );
+    r = RegOpenKeyW( hkey, szGuid, &hkeysubtype );
+    if( r == ERROR_SUCCESS )
+    {
+        type = 0;
+        sz = 0;
+        r = RegQueryValueExW( hkeysubtype, szItemName, NULL, &type,
+                              NULL, cbData );
+        if( ( r == ERROR_SUCCESS ) && ( type == REG_BINARY ) )
+        {
+            *pbData = CoTaskMemAlloc( *cbData );
+            r = RegQueryValueExW( hkeysubtype, szItemName, NULL, &type,
+                                  *pbData, cbData );
+        }
+        RegCloseKey( hkeysubtype );
+    }
+    
+    RegCloseKey( hkey );
+
+    return ( r == ERROR_SUCCESS ) ? S_OK : E_FAIL;
+}
+
+/******************************************************************************
+ * IPStore->WriteItem
+ */
+static HRESULT WINAPI IPStore_fnWriteItem( IPStore* This, PST_KEY Key,
+    const GUID* pItemType, const GUID* pItemSubtype, LPCWSTR szItemName,
+    DWORD cbData, BYTE* ppbData, PPST_PROMPTIFO pPromptInfo,
+    DWORD dwDefaultConfirmationStyle, DWORD dwFlags)
+{
+    LONG r;
+    HKEY hkey, hkeysubtype;
+    WCHAR szGuid[80];
+
+    TRACE("%p %08lx %s %s %s %ld %p %p %08lx\n", This, Key, 
+        debugstr_guid(pItemType), debugstr_guid(pItemSubtype), 
+        debugstr_w(szItemName), cbData, ppbData, pPromptInfo, dwFlags);
+
+    r = IPStore_OpenRoot( Key, &hkey );
+    if( r )
+        return E_FAIL;
+
+    IPStore_guid2wstr( pItemType, szGuid );
+    szGuid[38] = '\\';
+    IPStore_guid2wstr( pItemSubtype, &szGuid[39] );
+    r = RegOpenKeyW( hkey, szGuid, &hkeysubtype );
+    if( r == ERROR_SUCCESS )
+    {
+        r = RegSetValueExW( hkeysubtype, szItemName, 0, REG_BINARY, 
+                            ppbData, cbData );
+        RegCloseKey( hkeysubtype );
+    }
+    
+    RegCloseKey( hkey );
+
+    return ( r == ERROR_SUCCESS ) ? S_OK : E_FAIL;
+}
+
+/******************************************************************************
+ * IPStore->OpenItem
+ */
+static HRESULT WINAPI IPStore_fnOpenItem( IPStore* This, PST_KEY Key,
+    const GUID* pItemType, const GUID* pItemSubtype, LPCWSTR szItemName,
+    PST_ACCESSMODE ModeFlags, PPST_PROMPTIFO pProomptInfo, DWORD dwFlags )
+{
+    LONG r;
+    HKEY hkey, hkeysubtype;
+    WCHAR szGuid[80];
+
+    TRACE("%p %08lx %s %s %p %08lx %p %08lx\n", This, Key, 
+           debugstr_guid(pItemType), debugstr_guid(pItemSubtype),
+           debugstr_w(szItemName), ModeFlags, pProomptInfo, dwFlags);
+
+    r = IPStore_OpenRoot( Key, &hkey );
+    if( r )
+        return E_FAIL;
+
+    IPStore_guid2wstr( pItemType, szGuid );
+    szGuid[38] = '\\';
+    IPStore_guid2wstr( pItemSubtype, &szGuid[39] );
+    r = RegOpenKeyW( hkey, szGuid, &hkeysubtype );
+    if( r == ERROR_SUCCESS )
+    {
+        DWORD type;
+
+        r = RegQueryValueExW( hkeysubtype, szItemName, NULL, &type, 
+                              NULL, NULL );
+        if( ( r == ERROR_SUCCESS ) && ( type != REG_BINARY ) )
+            r = ERROR_INVALID_DATA;
+
+        RegCloseKey( hkeysubtype );
+    }
+    
+    RegCloseKey( hkey );
+
+    return ( r == ERROR_SUCCESS ) ? S_OK : E_FAIL;
+}
+
+/******************************************************************************
+ * IPStore->CloseItem
+ */
+static HRESULT WINAPI IPStore_fnCloseItem( IPStore* This, PST_KEY Key,
+    const GUID* pItemType, const GUID* pItemSubtype, LPCWSTR* szItemName,
+    DWORD dwFlags)
+{
+    TRACE("\n");
+    return S_OK;
+}
+
+/******************************************************************************
+ * IPStore->EnumItems
+ */
+static HRESULT WINAPI IPStore_fnEnumItems( IPStore* This, PST_KEY Key,
+    const GUID* pItemType, const GUID* pItemSubtype, DWORD dwFlags,
+    IEnumPStoreItems** ppenum)
+{
+    FIXME("\n");
+    return E_FAIL;
+}
+
+
+static ICOM_VTABLE(IPStore) pstores_vtbl =
+{
+    ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
+    IPStore_fnQueryInterface,
+    IPStore_fnAddRef,
+    IPStore_fnRelease,
+    IPStore_fnGetInfo,
+    IPStore_fnGetProvParam,
+    IPStore_fnSetProvParam,
+    IPStore_fnCreateType,
+    IPStore_fnGetTypeInfo,
+    IPStore_fnDeleteType,
+    IPStore_fnCreateSubtype,
+    IPStore_fnGetSubtypeInfo,
+    IPStore_fnDeleteSubtype,
+    IPStore_fnReadAccessRuleset,
+    IPStore_fnWriteAccessRuleset,
+    IPStore_fnEnumTypes,
+    IPStore_fnEnumSubtypes,
+    IPStore_fnDeleteItem,
+    IPStore_fnReadItem,
+    IPStore_fnWriteItem,
+    IPStore_fnOpenItem,
+    IPStore_fnCloseItem,
+    IPStore_fnEnumItems
+};
+
+HRESULT WINAPI PStoreCreateInstance( IPStore** ppProvider,
+            PST_PROVIDERID* pProviderID, void* pReserved, DWORD dwFlags)
+{
+    IPStore_impl *ips;
+
+    TRACE("%p %s %p %08lx\n", ppProvider, debugstr_guid(pProviderID), pReserved, dwFlags);
+
+    ips = HeapAlloc( GetProcessHeap(), 0, sizeof (IPStore_impl) );
+    if( !ips )
+        return E_OUTOFMEMORY;
+
+    ips->lpVtbl = &pstores_vtbl;
+    ips->ref = 1;
+
+    *ppProvider = (IPStore*) ips;
+    
+    return S_OK;
+}
+
+HRESULT WINAPI PSTOREC_DllRegisterServer(void)
+{
+    FIXME("\n");
+    return S_OK;
+}
+
+HRESULT WINAPI PSTOREC_DllUnregisterServer(void)
+{
+    FIXME("\n");
+    return S_OK;
+}
+
+HRESULT WINAPI PSTOREC_DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
+{
+    FIXME("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv);
+    return CLASS_E_CLASSNOTAVAILABLE;
+}
+
+BOOL WINAPI PSTOREC_DllCanUnloadNow(void)
+{
+    FIXME("\n");
+    return FALSE;
+}


More information about the wine-patches mailing list