mirror of
https://github.com/reactos/reactos.git
synced 2024-12-31 19:42:51 +00:00
Sync to Wine-20050628:
Robert Shearman <rob@codeweavers.com> - Convert some registry helper functions to use unicode versions of CLSID & registry functions (untested). - Add registry entries for local-only OLE interfaces. - Change IUnknown to local interface. - IUnknown isn't a remotable interface so the stub manager shouldn't need a marshaller for it. - Change the RPC code to use the unicode versions of the CLSID & registry functions. - Don't disconnect proxies flagged with SORFP_NOLIFETIMEMGMT. It makes no sense and only causes trouble for proxies that depend on these proxies being available. - Change some of the registry helper functions to use the unicode versions of the CLSID & registry functions. - Reindent CoGetClassObject and output an error message if the class isn't registered. - Add tests for the touched functions. Dmitry Timoshkov <dmitry@codeweavers.com> - Make remaining OLE interface vtables const. Richard Cohen <richard@daijobu.co.uk> - Base FileMonikerImpl_Save() on XP. - Correct handling of Unicode strings & multibyte locales. - More error checking. - Change ERR to WARN. - Match Windows quick & dirty estimate for GetSizeMax(). Stefan Huehner <stefan@huehner.org> - Fix some more -Wstrict-prototypes warnings. Mike Hearn <mike@navi.cx> - Add some tracing to the IRemUnknown RpcProxyBuffer implementation. Eric Pouech <pouech-eric@wanadoo.fr> - Const correctness fixes. Richard Cohen <richard@daijobu.co.uk> - IEnum::Clone shouldn't do a Reset. Marcus Meissner <marcus@jet.franken.de> - Removed CLSID_CompositeMoniker (conflicting with static definition). Alexandre Julliard <julliard@winehq.org> - Sort entry points alphabetically. svn path=/trunk/; revision=17036
This commit is contained in:
parent
9faf200230
commit
7ba677508a
33 changed files with 529 additions and 437 deletions
|
@ -42,12 +42,12 @@ const CLSID CLSID_AntiMoniker = {
|
||||||
/* AntiMoniker data structure */
|
/* AntiMoniker data structure */
|
||||||
typedef struct AntiMonikerImpl{
|
typedef struct AntiMonikerImpl{
|
||||||
|
|
||||||
IMonikerVtbl* lpvtbl1; /* VTable relative to the IMoniker interface.*/
|
const IMonikerVtbl* lpvtbl1; /* VTable relative to the IMoniker interface.*/
|
||||||
|
|
||||||
/* The ROT (RunningObjectTable implementation) uses the IROTData interface to test whether
|
/* The ROT (RunningObjectTable implementation) uses the IROTData interface to test whether
|
||||||
* two monikers are equal. That's whay IROTData interface is implemented by monikers.
|
* two monikers are equal. That's whay IROTData interface is implemented by monikers.
|
||||||
*/
|
*/
|
||||||
IROTDataVtbl* lpvtbl2; /* VTable relative to the IROTData interface.*/
|
const IROTDataVtbl* lpvtbl2; /* VTable relative to the IROTData interface.*/
|
||||||
|
|
||||||
ULONG ref; /* reference counter for this object */
|
ULONG ref; /* reference counter for this object */
|
||||||
|
|
||||||
|
@ -530,7 +530,7 @@ AntiMonikerROTDataImpl_GetComparaisonData(IROTData* iface, BYTE* pbData,
|
||||||
/********************************************************************************/
|
/********************************************************************************/
|
||||||
/* Virtual function table for the AntiMonikerImpl class which include IPersist,*/
|
/* Virtual function table for the AntiMonikerImpl class which include IPersist,*/
|
||||||
/* IPersistStream and IMoniker functions. */
|
/* IPersistStream and IMoniker functions. */
|
||||||
static IMonikerVtbl VT_AntiMonikerImpl =
|
static const IMonikerVtbl VT_AntiMonikerImpl =
|
||||||
{
|
{
|
||||||
AntiMonikerImpl_QueryInterface,
|
AntiMonikerImpl_QueryInterface,
|
||||||
AntiMonikerImpl_AddRef,
|
AntiMonikerImpl_AddRef,
|
||||||
|
@ -559,7 +559,7 @@ static IMonikerVtbl VT_AntiMonikerImpl =
|
||||||
|
|
||||||
/********************************************************************************/
|
/********************************************************************************/
|
||||||
/* Virtual function table for the IROTData class. */
|
/* Virtual function table for the IROTData class. */
|
||||||
static IROTDataVtbl VT_ROTDataImpl =
|
static const IROTDataVtbl VT_ROTDataImpl =
|
||||||
{
|
{
|
||||||
AntiMonikerROTDataImpl_QueryInterface,
|
AntiMonikerROTDataImpl_QueryInterface,
|
||||||
AntiMonikerROTDataImpl_AddRef,
|
AntiMonikerROTDataImpl_AddRef,
|
||||||
|
|
|
@ -50,7 +50,7 @@ typedef struct BindCtxObject{
|
||||||
/* BindCtx data strucrture */
|
/* BindCtx data strucrture */
|
||||||
typedef struct BindCtxImpl{
|
typedef struct BindCtxImpl{
|
||||||
|
|
||||||
IBindCtxVtbl *lpVtbl; /* VTable relative to the IBindCtx interface.*/
|
const IBindCtxVtbl *lpVtbl; /* VTable relative to the IBindCtx interface.*/
|
||||||
|
|
||||||
ULONG ref; /* reference counter for this object */
|
ULONG ref; /* reference counter for this object */
|
||||||
|
|
||||||
|
@ -474,7 +474,7 @@ static HRESULT BindCtxImpl_GetObjectIndex(BindCtxImpl* This,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Virtual function table for the BindCtx class. */
|
/* Virtual function table for the BindCtx class. */
|
||||||
static IBindCtxVtbl VT_BindCtxImpl =
|
static const IBindCtxVtbl VT_BindCtxImpl =
|
||||||
{
|
{
|
||||||
BindCtxImpl_QueryInterface,
|
BindCtxImpl_QueryInterface,
|
||||||
BindCtxImpl_AddRef,
|
BindCtxImpl_AddRef,
|
||||||
|
|
|
@ -96,7 +96,7 @@ struct OLEClipbrd
|
||||||
/*
|
/*
|
||||||
* List all interface VTables here
|
* List all interface VTables here
|
||||||
*/
|
*/
|
||||||
IDataObjectVtbl* lpvtbl1; /* IDataObject VTable */
|
const IDataObjectVtbl* lpvtbl1; /* IDataObject VTable */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The hidden OLE clipboard window. This window is used as the bridge between the
|
* The hidden OLE clipboard window. This window is used as the bridge between the
|
||||||
|
@ -135,7 +135,7 @@ typedef struct OLEClipbrd OLEClipbrd;
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
/* IEnumFORMATETC VTable */
|
/* IEnumFORMATETC VTable */
|
||||||
IEnumFORMATETCVtbl *lpVtbl;
|
const IEnumFORMATETCVtbl *lpVtbl;
|
||||||
|
|
||||||
/* IEnumFORMATETC fields */
|
/* IEnumFORMATETC fields */
|
||||||
UINT posFmt; /* current enumerator position */
|
UINT posFmt; /* current enumerator position */
|
||||||
|
@ -250,7 +250,7 @@ static HRESULT WINAPI OLEClipbrd_IEnumFORMATETC_Clone(LPENUMFORMATETC iface, LPE
|
||||||
/*
|
/*
|
||||||
* Virtual function table for the OLEClipbrd's exposed IDataObject interface
|
* Virtual function table for the OLEClipbrd's exposed IDataObject interface
|
||||||
*/
|
*/
|
||||||
static IDataObjectVtbl OLEClipbrd_IDataObject_VTable =
|
static const IDataObjectVtbl OLEClipbrd_IDataObject_VTable =
|
||||||
{
|
{
|
||||||
OLEClipbrd_IDataObject_QueryInterface,
|
OLEClipbrd_IDataObject_QueryInterface,
|
||||||
OLEClipbrd_IDataObject_AddRef,
|
OLEClipbrd_IDataObject_AddRef,
|
||||||
|
@ -269,7 +269,7 @@ static IDataObjectVtbl OLEClipbrd_IDataObject_VTable =
|
||||||
/*
|
/*
|
||||||
* Virtual function table for IEnumFORMATETC interface
|
* Virtual function table for IEnumFORMATETC interface
|
||||||
*/
|
*/
|
||||||
static struct IEnumFORMATETCVtbl efvt =
|
static const IEnumFORMATETCVtbl efvt =
|
||||||
{
|
{
|
||||||
OLEClipbrd_IEnumFORMATETC_QueryInterface,
|
OLEClipbrd_IEnumFORMATETC_QueryInterface,
|
||||||
OLEClipbrd_IEnumFORMATETC_AddRef,
|
OLEClipbrd_IEnumFORMATETC_AddRef,
|
||||||
|
|
|
@ -76,6 +76,8 @@ typedef LPCSTR LPCOLESTR16;
|
||||||
|
|
||||||
HINSTANCE OLE32_hInstance = 0; /* FIXME: make static ... */
|
HINSTANCE OLE32_hInstance = 0; /* FIXME: make static ... */
|
||||||
|
|
||||||
|
#define ARRAYSIZE(array) (sizeof(array)/sizeof((array)[0]))
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* This section defines variables internal to the COM module.
|
* This section defines variables internal to the COM module.
|
||||||
*
|
*
|
||||||
|
@ -195,7 +197,7 @@ static void COMPOBJ_UninitProcess( void )
|
||||||
UnregisterClassW(wszAptWinClass, OLE32_hInstance);
|
UnregisterClassW(wszAptWinClass, OLE32_hInstance);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void COM_TlsDestroy()
|
static void COM_TlsDestroy(void)
|
||||||
{
|
{
|
||||||
struct oletls *info = NtCurrentTeb()->ReservedForOle;
|
struct oletls *info = NtCurrentTeb()->ReservedForOle;
|
||||||
if (info)
|
if (info)
|
||||||
|
@ -981,6 +983,16 @@ INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
|
||||||
return MultiByteToWideChar( CP_ACP, 0, xguid, -1, str, cmax );
|
return MultiByteToWideChar( CP_ACP, 0, xguid, -1, str, cmax );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* open HKCR\\CLSID\\{string form of clsid} key */
|
||||||
|
DWORD COM_OpenKeyForCLSID(REFCLSID clsid, REGSAM access, HKEY *key)
|
||||||
|
{
|
||||||
|
static const WCHAR wszCLSIDSlash[] = {'C','L','S','I','D','\\',0};
|
||||||
|
WCHAR path[CHARS_IN_GUID + ARRAYSIZE(wszCLSIDSlash) - 1];
|
||||||
|
strcpyW(path, wszCLSIDSlash);
|
||||||
|
StringFromGUID2(clsid, path + strlenW(wszCLSIDSlash), CHARS_IN_GUID);
|
||||||
|
return RegOpenKeyExW(HKEY_CLASSES_ROOT, path, 0, access, key);
|
||||||
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* ProgIDFromCLSID [OLE32.@]
|
* ProgIDFromCLSID [OLE32.@]
|
||||||
*
|
*
|
||||||
|
@ -997,43 +1009,42 @@ INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI ProgIDFromCLSID(REFCLSID clsid, LPOLESTR *lplpszProgID)
|
HRESULT WINAPI ProgIDFromCLSID(REFCLSID clsid, LPOLESTR *lplpszProgID)
|
||||||
{
|
{
|
||||||
char strCLSID[50], *buf, *buf2;
|
static const WCHAR wszProgID[] = {'P','r','o','g','I','D',0};
|
||||||
DWORD buf2len;
|
HKEY hkey = NULL;
|
||||||
HKEY xhkey;
|
HKEY hkey_clsid;
|
||||||
LPMALLOC mllc;
|
|
||||||
HRESULT ret = S_OK;
|
HRESULT ret = S_OK;
|
||||||
|
|
||||||
WINE_StringFromCLSID(clsid, strCLSID);
|
if (ERROR_SUCCESS != COM_OpenKeyForCLSID(clsid, KEY_READ, &hkey_clsid))
|
||||||
|
|
||||||
buf = HeapAlloc(GetProcessHeap(), 0, strlen(strCLSID)+14);
|
|
||||||
sprintf(buf,"CLSID\\%s\\ProgID", strCLSID);
|
|
||||||
if (RegOpenKeyA(HKEY_CLASSES_ROOT, buf, &xhkey))
|
|
||||||
ret = REGDB_E_CLASSNOTREG;
|
ret = REGDB_E_CLASSNOTREG;
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, buf);
|
|
||||||
|
|
||||||
if (ret == S_OK)
|
if (ret == S_OK)
|
||||||
{
|
{
|
||||||
buf2 = HeapAlloc(GetProcessHeap(), 0, 255);
|
if (RegOpenKeyExW(hkey_clsid, wszProgID, 0, KEY_READ, &hkey))
|
||||||
buf2len = 255;
|
ret = REGDB_E_CLASSNOTREG;
|
||||||
if (RegQueryValueA(xhkey, NULL, buf2, &buf2len))
|
RegCloseKey(hkey_clsid);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ret == S_OK)
|
||||||
|
{
|
||||||
|
DWORD progidlen = 0;
|
||||||
|
|
||||||
|
if (RegQueryValueW(hkey, NULL, NULL, &progidlen))
|
||||||
ret = REGDB_E_CLASSNOTREG;
|
ret = REGDB_E_CLASSNOTREG;
|
||||||
|
|
||||||
if (ret == S_OK)
|
if (ret == S_OK)
|
||||||
{
|
{
|
||||||
if (CoGetMalloc(0,&mllc))
|
*lplpszProgID = CoTaskMemAlloc(progidlen * sizeof(WCHAR));
|
||||||
ret = E_OUTOFMEMORY;
|
if (*lplpszProgID)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
DWORD len = MultiByteToWideChar( CP_ACP, 0, buf2, -1, NULL, 0 );
|
if (RegQueryValueW(hkey, NULL, *lplpszProgID, &progidlen))
|
||||||
*lplpszProgID = IMalloc_Alloc(mllc, len * sizeof(WCHAR) );
|
ret = REGDB_E_CLASSNOTREG;
|
||||||
MultiByteToWideChar( CP_ACP, 0, buf2, -1, *lplpszProgID, len );
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
ret = E_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
HeapFree(GetProcessHeap(), 0, buf2);
|
|
||||||
RegCloseKey(xhkey);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RegCloseKey(hkey);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1089,7 +1100,7 @@ HRESULT WINAPI CLSIDFromProgID16(LPCOLESTR16 progid, LPCLSID riid)
|
||||||
HRESULT WINAPI CLSIDFromProgID(LPCOLESTR progid, LPCLSID riid)
|
HRESULT WINAPI CLSIDFromProgID(LPCOLESTR progid, LPCLSID riid)
|
||||||
{
|
{
|
||||||
static const WCHAR clsidW[] = { '\\','C','L','S','I','D',0 };
|
static const WCHAR clsidW[] = { '\\','C','L','S','I','D',0 };
|
||||||
char buf2[80];
|
WCHAR buf2[CHARS_IN_GUID];
|
||||||
DWORD buf2len = sizeof(buf2);
|
DWORD buf2len = sizeof(buf2);
|
||||||
HKEY xhkey;
|
HKEY xhkey;
|
||||||
|
|
||||||
|
@ -1103,13 +1114,13 @@ HRESULT WINAPI CLSIDFromProgID(LPCOLESTR progid, LPCLSID riid)
|
||||||
}
|
}
|
||||||
HeapFree(GetProcessHeap(),0,buf);
|
HeapFree(GetProcessHeap(),0,buf);
|
||||||
|
|
||||||
if (RegQueryValueA(xhkey,NULL,buf2,&buf2len))
|
if (RegQueryValueW(xhkey,NULL,buf2,&buf2len))
|
||||||
{
|
{
|
||||||
RegCloseKey(xhkey);
|
RegCloseKey(xhkey);
|
||||||
return CO_E_CLASSSTRING;
|
return CO_E_CLASSSTRING;
|
||||||
}
|
}
|
||||||
RegCloseKey(xhkey);
|
RegCloseKey(xhkey);
|
||||||
return __CLSIDFromStringA(buf2,riid);
|
return CLSIDFromString(buf2,riid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1151,46 +1162,41 @@ HRESULT WINAPI CLSIDFromProgID(LPCOLESTR progid, LPCLSID riid)
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI CoGetPSClsid(REFIID riid, CLSID *pclsid)
|
HRESULT WINAPI CoGetPSClsid(REFIID riid, CLSID *pclsid)
|
||||||
{
|
{
|
||||||
char *buf, buf2[40];
|
static const WCHAR wszInterface[] = {'I','n','t','e','r','f','a','c','e','\\',0};
|
||||||
DWORD buf2len;
|
static const WCHAR wszPSC[] = {'\\','P','r','o','x','y','S','t','u','b','C','l','s','i','d','3','2',0};
|
||||||
HKEY xhkey;
|
WCHAR path[ARRAYSIZE(wszInterface) - 1 + CHARS_IN_GUID - 1 + ARRAYSIZE(wszPSC)];
|
||||||
|
WCHAR value[CHARS_IN_GUID];
|
||||||
|
DWORD len;
|
||||||
|
HKEY hkey;
|
||||||
|
|
||||||
TRACE("() riid=%s, pclsid=%p\n", debugstr_guid(riid), pclsid);
|
TRACE("() riid=%s, pclsid=%p\n", debugstr_guid(riid), pclsid);
|
||||||
|
|
||||||
/* Get the input iid as a string */
|
/* Interface\\{string form of riid}\\ProxyStubClsid32 */
|
||||||
WINE_StringFromCLSID(riid, buf2);
|
strcpyW(path, wszInterface);
|
||||||
/* Allocate memory for the registry key we will construct.
|
StringFromGUID2(riid, path + ARRAYSIZE(wszInterface) - 1, CHARS_IN_GUID);
|
||||||
(length of iid string plus constant length of static text */
|
strcpyW(path + ARRAYSIZE(wszInterface) - 1 + CHARS_IN_GUID - 1, wszPSC);
|
||||||
buf = HeapAlloc(GetProcessHeap(), 0, strlen(buf2)+27);
|
|
||||||
if (buf == NULL)
|
|
||||||
return E_OUTOFMEMORY;
|
|
||||||
|
|
||||||
/* Construct the registry key we want */
|
|
||||||
sprintf(buf,"Interface\\%s\\ProxyStubClsid32", buf2);
|
|
||||||
|
|
||||||
/* Open the key.. */
|
/* Open the key.. */
|
||||||
if (RegOpenKeyA(HKEY_CLASSES_ROOT, buf, &xhkey))
|
if (RegOpenKeyExW(HKEY_CLASSES_ROOT, path, 0, KEY_READ, &hkey))
|
||||||
{
|
{
|
||||||
WARN("No PSFactoryBuffer object is registered for IID %s\n", debugstr_guid(riid));
|
WARN("No PSFactoryBuffer object is registered for IID %s\n", debugstr_guid(riid));
|
||||||
HeapFree(GetProcessHeap(),0,buf);
|
|
||||||
return REGDB_E_IIDNOTREG;
|
return REGDB_E_IIDNOTREG;
|
||||||
}
|
}
|
||||||
HeapFree(GetProcessHeap(),0,buf);
|
|
||||||
|
|
||||||
/* ... Once we have the key, query the registry to get the
|
/* ... Once we have the key, query the registry to get the
|
||||||
value of CLSID as a string, and convert it into a
|
value of CLSID as a string, and convert it into a
|
||||||
proper CLSID structure to be passed back to the app */
|
proper CLSID structure to be passed back to the app */
|
||||||
buf2len = sizeof(buf2);
|
len = sizeof(value);
|
||||||
if ( (RegQueryValueA(xhkey,NULL,buf2,&buf2len)) )
|
if (ERROR_SUCCESS != RegQueryValueW(hkey, NULL, value, &len))
|
||||||
{
|
{
|
||||||
RegCloseKey(xhkey);
|
RegCloseKey(hkey);
|
||||||
return REGDB_E_IIDNOTREG;
|
return REGDB_E_IIDNOTREG;
|
||||||
}
|
}
|
||||||
RegCloseKey(xhkey);
|
RegCloseKey(hkey);
|
||||||
|
|
||||||
/* We have the CLSid we want back from the registry as a string, so
|
/* We have the CLSid we want back from the registry as a string, so
|
||||||
lets convert it into a CLSID structure */
|
lets convert it into a CLSID structure */
|
||||||
if ( (__CLSIDFromStringA(buf2,pclsid)) != NOERROR)
|
if (CLSIDFromString(value, pclsid) != NOERROR)
|
||||||
return REGDB_E_IIDNOTREG;
|
return REGDB_E_IIDNOTREG;
|
||||||
|
|
||||||
TRACE ("() Returning CLSID=%s\n", debugstr_guid(pclsid));
|
TRACE ("() Returning CLSID=%s\n", debugstr_guid(pclsid));
|
||||||
|
@ -1528,25 +1534,24 @@ end:
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* compobj_RegReadPath [internal]
|
* COM_RegReadPath [internal]
|
||||||
*
|
*
|
||||||
* Reads a registry value and expands it when necessary
|
* Reads a registry value and expands it when necessary
|
||||||
*/
|
*/
|
||||||
static HRESULT
|
HRESULT COM_RegReadPath(HKEY hkeyroot, const WCHAR *keyname, const WCHAR *valuename, WCHAR * dst, DWORD dstlen)
|
||||||
compobj_RegReadPath(char * keyname, char * valuename, char * dst, DWORD dstlen)
|
|
||||||
{
|
{
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
HKEY key;
|
HKEY key;
|
||||||
DWORD keytype;
|
DWORD keytype;
|
||||||
char src[MAX_PATH];
|
WCHAR src[MAX_PATH];
|
||||||
DWORD dwLength = dstlen;
|
DWORD dwLength = dstlen * sizeof(WCHAR);
|
||||||
|
|
||||||
if((hres = RegOpenKeyExA(HKEY_CLASSES_ROOT, keyname, 0, KEY_READ, &key)) == ERROR_SUCCESS) {
|
if((hres = RegOpenKeyExW(hkeyroot, keyname, 0, KEY_READ, &key)) == ERROR_SUCCESS) {
|
||||||
if( (hres = RegQueryValueExA(key, NULL, NULL, &keytype, (LPBYTE)src, &dwLength)) == ERROR_SUCCESS ) {
|
if( (hres = RegQueryValueExW(key, NULL, NULL, &keytype, (LPBYTE)src, &dwLength)) == ERROR_SUCCESS ) {
|
||||||
if (keytype == REG_EXPAND_SZ) {
|
if (keytype == REG_EXPAND_SZ) {
|
||||||
if (dstlen <= ExpandEnvironmentStringsA(src, dst, dstlen)) hres = ERROR_MORE_DATA;
|
if (dstlen <= ExpandEnvironmentStringsW(src, dst, dstlen)) hres = ERROR_MORE_DATA;
|
||||||
} else {
|
} else {
|
||||||
lstrcpynA(dst, src, dstlen);
|
lstrcpynW(dst, src, dstlen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RegCloseKey (key);
|
RegCloseKey (key);
|
||||||
|
@ -1565,16 +1570,10 @@ compobj_RegReadPath(char * keyname, char * valuename, char * dst, DWORD dstlen)
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI CoGetClassObject(
|
HRESULT WINAPI CoGetClassObject(
|
||||||
REFCLSID rclsid, DWORD dwClsContext, COSERVERINFO *pServerInfo,
|
REFCLSID rclsid, DWORD dwClsContext, COSERVERINFO *pServerInfo,
|
||||||
REFIID iid, LPVOID *ppv
|
REFIID iid, LPVOID *ppv)
|
||||||
) {
|
{
|
||||||
LPUNKNOWN regClassObject;
|
LPUNKNOWN regClassObject;
|
||||||
HRESULT hres = E_UNEXPECTED;
|
HRESULT hres = E_UNEXPECTED;
|
||||||
char xclsid[80];
|
|
||||||
HINSTANCE hLibrary;
|
|
||||||
typedef HRESULT (CALLBACK *DllGetClassObjectFunc)(REFCLSID clsid, REFIID iid, LPVOID *ppv);
|
|
||||||
DllGetClassObjectFunc DllGetClassObject;
|
|
||||||
|
|
||||||
WINE_StringFromCLSID((LPCLSID)rclsid,xclsid);
|
|
||||||
|
|
||||||
TRACE("\n\tCLSID:\t%s,\n\tIID:\t%s\n", debugstr_guid(rclsid), debugstr_guid(iid));
|
TRACE("\n\tCLSID:\t%s,\n\tIID:\t%s\n", debugstr_guid(rclsid), debugstr_guid(iid));
|
||||||
|
|
||||||
|
@ -1589,9 +1588,7 @@ HRESULT WINAPI CoGetClassObject(
|
||||||
*/
|
*/
|
||||||
if (S_OK == COM_GetRegisteredClassObject(rclsid, dwClsContext, ®ClassObject))
|
if (S_OK == COM_GetRegisteredClassObject(rclsid, dwClsContext, ®ClassObject))
|
||||||
{
|
{
|
||||||
/*
|
/* Get the required interface from the retrieved pointer. */
|
||||||
* Get the required interface from the retrieved pointer.
|
|
||||||
*/
|
|
||||||
hres = IUnknown_QueryInterface(regClassObject, iid, ppv);
|
hres = IUnknown_QueryInterface(regClassObject, iid, ppv);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1605,32 +1602,49 @@ HRESULT WINAPI CoGetClassObject(
|
||||||
}
|
}
|
||||||
|
|
||||||
/* first try: in-process */
|
/* first try: in-process */
|
||||||
if ((CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER) & dwClsContext) {
|
if ((CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER) & dwClsContext)
|
||||||
char keyname[MAX_PATH];
|
{
|
||||||
char dllpath[MAX_PATH+1];
|
static const WCHAR wszInprocServer32[] = {'I','n','p','r','o','c','S','e','r','v','e','r','3','2',0};
|
||||||
|
HINSTANCE hLibrary;
|
||||||
|
typedef HRESULT (CALLBACK *DllGetClassObjectFunc)(REFCLSID clsid, REFIID iid, LPVOID *ppv);
|
||||||
|
DllGetClassObjectFunc DllGetClassObject;
|
||||||
|
WCHAR dllpath[MAX_PATH+1];
|
||||||
|
HKEY hkey;
|
||||||
|
|
||||||
sprintf(keyname,"CLSID\\%s\\InprocServer32",xclsid);
|
if (ERROR_SUCCESS != COM_OpenKeyForCLSID(rclsid, KEY_READ, &hkey))
|
||||||
|
{
|
||||||
if ( compobj_RegReadPath(keyname, NULL, dllpath, sizeof(dllpath)) != ERROR_SUCCESS) {
|
ERR("class %s not registered\n", debugstr_guid(rclsid));
|
||||||
/* failure: CLSID is not found in registry */
|
|
||||||
WARN("class %s not registered inproc\n", xclsid);
|
|
||||||
hres = REGDB_E_CLASSNOTREG;
|
hres = REGDB_E_CLASSNOTREG;
|
||||||
} else {
|
}
|
||||||
if ((hLibrary = LoadLibraryExA(dllpath, 0, LOAD_WITH_ALTERED_SEARCH_PATH)) == 0) {
|
|
||||||
/* failure: DLL could not be loaded */
|
if (COM_RegReadPath(hkey, wszInprocServer32, NULL, dllpath, ARRAYSIZE(dllpath)) != ERROR_SUCCESS)
|
||||||
ERR("couldn't load InprocServer32 dll %s\n", dllpath);
|
{
|
||||||
hres = E_ACCESSDENIED; /* FIXME: or should this be CO_E_DLLNOTFOUND? */
|
/* failure: CLSID is not found in registry */
|
||||||
} else if (!(DllGetClassObject = (DllGetClassObjectFunc)GetProcAddress(hLibrary, "DllGetClassObject"))) {
|
WARN("class %s not registered inproc\n", debugstr_guid(rclsid));
|
||||||
/* failure: the dll did not export DllGetClassObject */
|
hres = REGDB_E_CLASSNOTREG;
|
||||||
ERR("couldn't find function DllGetClassObject in %s\n", dllpath);
|
}
|
||||||
FreeLibrary( hLibrary );
|
else
|
||||||
hres = CO_E_DLLNOTFOUND;
|
{
|
||||||
} else {
|
if ((hLibrary = LoadLibraryExW(dllpath, 0, LOAD_WITH_ALTERED_SEARCH_PATH)) == 0)
|
||||||
/* OK: get the ClassObject */
|
{
|
||||||
COMPOBJ_DLLList_Add( hLibrary );
|
/* failure: DLL could not be loaded */
|
||||||
return DllGetClassObject(rclsid, iid, ppv);
|
ERR("couldn't load InprocServer32 dll %s\n", debugstr_w(dllpath));
|
||||||
}
|
hres = E_ACCESSDENIED; /* FIXME: or should this be CO_E_DLLNOTFOUND? */
|
||||||
}
|
}
|
||||||
|
else if (!(DllGetClassObject = (DllGetClassObjectFunc)GetProcAddress(hLibrary, "DllGetClassObject")))
|
||||||
|
{
|
||||||
|
/* failure: the dll did not export DllGetClassObject */
|
||||||
|
ERR("couldn't find function DllGetClassObject in %s\n", debugstr_w(dllpath));
|
||||||
|
FreeLibrary( hLibrary );
|
||||||
|
hres = CO_E_DLLNOTFOUND;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* OK: get the ClassObject */
|
||||||
|
COMPOBJ_DLLList_Add( hLibrary );
|
||||||
|
return DllGetClassObject(rclsid, iid, ppv);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Next try out of process */
|
/* Next try out of process */
|
||||||
|
@ -2154,28 +2168,27 @@ HRESULT WINAPI CoSetState(IUnknown * pv)
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI OleGetAutoConvert(REFCLSID clsidOld, LPCLSID pClsidNew)
|
HRESULT WINAPI OleGetAutoConvert(REFCLSID clsidOld, LPCLSID pClsidNew)
|
||||||
{
|
{
|
||||||
HKEY hkey = 0;
|
static const WCHAR wszAutoConvertTo[] = {'A','u','t','o','C','o','n','v','e','r','t','T','o',0};
|
||||||
char buf[200];
|
HKEY hkey = NULL;
|
||||||
WCHAR wbuf[200];
|
WCHAR buf[CHARS_IN_GUID];
|
||||||
DWORD len;
|
DWORD len;
|
||||||
HRESULT res = S_OK;
|
HRESULT res = S_OK;
|
||||||
|
|
||||||
sprintf(buf,"CLSID\\");WINE_StringFromCLSID(clsidOld,&buf[6]);
|
if (ERROR_SUCCESS != COM_OpenKeyForCLSID(clsidOld, KEY_READ, &hkey))
|
||||||
if (RegOpenKeyA(HKEY_CLASSES_ROOT,buf,&hkey))
|
|
||||||
{
|
{
|
||||||
res = REGDB_E_CLASSNOTREG;
|
res = REGDB_E_CLASSNOTREG;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
len = 200;
|
|
||||||
|
len = sizeof(buf);
|
||||||
/* we can just query for the default value of AutoConvertTo key like that,
|
/* we can just query for the default value of AutoConvertTo key like that,
|
||||||
without opening the AutoConvertTo key and querying for NULL (default) */
|
without opening the AutoConvertTo key and querying for NULL (default) */
|
||||||
if (RegQueryValueA(hkey,"AutoConvertTo",buf,&len))
|
if (RegQueryValueW(hkey, wszAutoConvertTo, buf, &len))
|
||||||
{
|
{
|
||||||
res = REGDB_E_KEYMISSING;
|
res = REGDB_E_KEYMISSING;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
MultiByteToWideChar( CP_ACP, 0, buf, -1, wbuf, sizeof(wbuf)/sizeof(WCHAR) );
|
res = CLSIDFromString(buf, pClsidNew);
|
||||||
CLSIDFromString(wbuf,pClsidNew);
|
|
||||||
done:
|
done:
|
||||||
if (hkey) RegCloseKey(hkey);
|
if (hkey) RegCloseKey(hkey);
|
||||||
return res;
|
return res;
|
||||||
|
@ -2199,27 +2212,26 @@ done:
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI CoTreatAsClass(REFCLSID clsidOld, REFCLSID clsidNew)
|
HRESULT WINAPI CoTreatAsClass(REFCLSID clsidOld, REFCLSID clsidNew)
|
||||||
{
|
{
|
||||||
HKEY hkey = 0;
|
static const WCHAR wszAutoTreatAs[] = {'A','u','t','o','T','r','e','a','t','A','s',0};
|
||||||
char buf[47];
|
static const WCHAR wszTreatAs[] = {'T','r','e','a','t','A','s',0};
|
||||||
char szClsidNew[39];
|
HKEY hkey = NULL;
|
||||||
|
WCHAR szClsidNew[CHARS_IN_GUID];
|
||||||
HRESULT res = S_OK;
|
HRESULT res = S_OK;
|
||||||
char auto_treat_as[39];
|
WCHAR auto_treat_as[CHARS_IN_GUID];
|
||||||
LONG auto_treat_as_size = sizeof(auto_treat_as);
|
LONG auto_treat_as_size = sizeof(auto_treat_as);
|
||||||
CLSID id;
|
CLSID id;
|
||||||
|
|
||||||
sprintf(buf,"CLSID\\");WINE_StringFromCLSID(clsidOld,&buf[6]);
|
if (ERROR_SUCCESS != COM_OpenKeyForCLSID(clsidOld, KEY_READ | KEY_WRITE, &hkey))
|
||||||
WINE_StringFromCLSID(clsidNew, szClsidNew);
|
|
||||||
if (RegOpenKeyA(HKEY_CLASSES_ROOT,buf,&hkey))
|
|
||||||
{
|
{
|
||||||
res = REGDB_E_CLASSNOTREG;
|
res = REGDB_E_CLASSNOTREG;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (!memcmp( clsidOld, clsidNew, sizeof(*clsidOld) ))
|
if (!memcmp( clsidOld, clsidNew, sizeof(*clsidOld) ))
|
||||||
{
|
{
|
||||||
if (!RegQueryValueA(hkey, "AutoTreatAs", auto_treat_as, &auto_treat_as_size) &&
|
if (!RegQueryValueW(hkey, wszAutoTreatAs, auto_treat_as, &auto_treat_as_size) &&
|
||||||
!__CLSIDFromStringA(auto_treat_as, &id))
|
!CLSIDFromString(auto_treat_as, &id))
|
||||||
{
|
{
|
||||||
if (RegSetValueA(hkey, "TreatAs", REG_SZ, auto_treat_as, strlen(auto_treat_as)+1))
|
if (RegSetValueW(hkey, wszTreatAs, REG_SZ, auto_treat_as, sizeof(auto_treat_as)))
|
||||||
{
|
{
|
||||||
res = REGDB_E_WRITEREGDB;
|
res = REGDB_E_WRITEREGDB;
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -2227,13 +2239,14 @@ HRESULT WINAPI CoTreatAsClass(REFCLSID clsidOld, REFCLSID clsidNew)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
RegDeleteKeyA(hkey, "TreatAs");
|
RegDeleteKeyW(hkey, wszTreatAs);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (RegSetValueA(hkey, "TreatAs", REG_SZ, szClsidNew, strlen(szClsidNew)+1))
|
else if (!StringFromGUID2(clsidNew, szClsidNew, ARRAYSIZE(szClsidNew)) &&
|
||||||
|
!RegSetValueW(hkey, wszTreatAs, REG_SZ, szClsidNew, sizeof(szClsidNew)))
|
||||||
{
|
{
|
||||||
res = REGDB_E_WRITEREGDB;
|
res = REGDB_E_WRITEREGDB;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2260,32 +2273,31 @@ done:
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI CoGetTreatAsClass(REFCLSID clsidOld, LPCLSID clsidNew)
|
HRESULT WINAPI CoGetTreatAsClass(REFCLSID clsidOld, LPCLSID clsidNew)
|
||||||
{
|
{
|
||||||
HKEY hkey = 0;
|
static const WCHAR wszTreatAs[] = {'T','r','e','a','t','A','s',0};
|
||||||
char buf[200], szClsidNew[200];
|
HKEY hkey = NULL;
|
||||||
|
WCHAR szClsidNew[CHARS_IN_GUID];
|
||||||
HRESULT res = S_OK;
|
HRESULT res = S_OK;
|
||||||
LONG len = sizeof(szClsidNew);
|
LONG len = sizeof(szClsidNew);
|
||||||
|
|
||||||
FIXME("(%s,%p)\n", debugstr_guid(clsidOld), clsidNew);
|
FIXME("(%s,%p)\n", debugstr_guid(clsidOld), clsidNew);
|
||||||
sprintf(buf,"CLSID\\");WINE_StringFromCLSID(clsidOld,&buf[6]);
|
|
||||||
memcpy(clsidNew,clsidOld,sizeof(CLSID)); /* copy over old value */
|
memcpy(clsidNew,clsidOld,sizeof(CLSID)); /* copy over old value */
|
||||||
|
|
||||||
if (RegOpenKeyA(HKEY_CLASSES_ROOT,buf,&hkey))
|
if (COM_OpenKeyForCLSID(clsidOld, KEY_READ, &hkey))
|
||||||
{
|
{
|
||||||
res = REGDB_E_CLASSNOTREG;
|
res = REGDB_E_CLASSNOTREG;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (RegQueryValueA(hkey, "TreatAs", szClsidNew, &len))
|
if (RegQueryValueW(hkey, wszTreatAs, szClsidNew, &len))
|
||||||
{
|
{
|
||||||
res = S_FALSE;
|
res = S_FALSE;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
res = __CLSIDFromStringA(szClsidNew,clsidNew);
|
res = CLSIDFromString(szClsidNew,clsidNew);
|
||||||
if (FAILED(res))
|
if (FAILED(res))
|
||||||
FIXME("Failed CLSIDFromStringA(%s), hres %lx?\n",szClsidNew,res);
|
ERR("Failed CLSIDFromStringA(%s), hres 0x%08lx\n", debugstr_w(szClsidNew), res);
|
||||||
done:
|
done:
|
||||||
if (hkey) RegCloseKey(hkey);
|
if (hkey) RegCloseKey(hkey);
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
|
|
|
@ -163,6 +163,7 @@ extern void* StdGlobalInterfaceTableInstance;
|
||||||
extern HRESULT WINE_StringFromCLSID(const CLSID *id,LPSTR idstr);
|
extern HRESULT WINE_StringFromCLSID(const CLSID *id,LPSTR idstr);
|
||||||
HRESULT WINAPI __CLSIDFromStringA(LPCSTR idstr, CLSID *id);
|
HRESULT WINAPI __CLSIDFromStringA(LPCSTR idstr, CLSID *id);
|
||||||
|
|
||||||
|
DWORD COM_OpenKeyForCLSID(REFCLSID clsid, REGSAM access, HKEY *key);
|
||||||
HRESULT MARSHAL_GetStandardMarshalCF(LPVOID *ppv);
|
HRESULT MARSHAL_GetStandardMarshalCF(LPVOID *ppv);
|
||||||
|
|
||||||
/* Stub Manager */
|
/* Stub Manager */
|
||||||
|
@ -256,4 +257,6 @@ static inline APARTMENT* COM_CurrentApt(void)
|
||||||
|
|
||||||
extern HINSTANCE OLE32_hInstance; /* FIXME: make static */
|
extern HINSTANCE OLE32_hInstance; /* FIXME: make static */
|
||||||
|
|
||||||
|
#define CHARS_IN_GUID 39 /* including NULL */
|
||||||
|
|
||||||
#endif /* __WINE_OLE_COMPOBJ_H */
|
#endif /* __WINE_OLE_COMPOBJ_H */
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(ole);
|
WINE_DEFAULT_DEBUG_CHANNEL(ole);
|
||||||
|
|
||||||
const CLSID CLSID_CompositeMoniker = {
|
static const CLSID CLSID_CompositeMoniker = {
|
||||||
0x309, 0, 0, {0xC0, 0, 0, 0, 0, 0, 0, 0x46}
|
0x309, 0, 0, {0xC0, 0, 0, 0, 0, 0, 0, 0x46}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -46,13 +46,13 @@ const CLSID CLSID_CompositeMoniker = {
|
||||||
/* CompositeMoniker data structure */
|
/* CompositeMoniker data structure */
|
||||||
typedef struct CompositeMonikerImpl{
|
typedef struct CompositeMonikerImpl{
|
||||||
|
|
||||||
IMonikerVtbl* lpvtbl1; /* VTable relative to the IMoniker interface.*/
|
const IMonikerVtbl* lpvtbl1; /* VTable relative to the IMoniker interface.*/
|
||||||
|
|
||||||
/* The ROT (RunningObjectTable implementation) uses the IROTData
|
/* The ROT (RunningObjectTable implementation) uses the IROTData
|
||||||
* interface to test whether two monikers are equal. That's why IROTData
|
* interface to test whether two monikers are equal. That's why IROTData
|
||||||
* interface is implemented by monikers.
|
* interface is implemented by monikers.
|
||||||
*/
|
*/
|
||||||
IROTDataVtbl* lpvtbl2; /* VTable relative to the IROTData interface.*/
|
const IROTDataVtbl* lpvtbl2; /* VTable relative to the IROTData interface.*/
|
||||||
|
|
||||||
ULONG ref; /* reference counter for this object */
|
ULONG ref; /* reference counter for this object */
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ typedef struct CompositeMonikerImpl{
|
||||||
/* EnumMoniker data structure */
|
/* EnumMoniker data structure */
|
||||||
typedef struct EnumMonikerImpl{
|
typedef struct EnumMonikerImpl{
|
||||||
|
|
||||||
IEnumMonikerVtbl *lpVtbl; /* VTable relative to the IEnumMoniker interface.*/
|
const IEnumMonikerVtbl *lpVtbl; /* VTable relative to the IEnumMoniker interface.*/
|
||||||
|
|
||||||
ULONG ref; /* reference counter for this object */
|
ULONG ref; /* reference counter for this object */
|
||||||
|
|
||||||
|
@ -1388,7 +1388,7 @@ EnumMonikerImpl_Clone(IEnumMoniker* iface,IEnumMoniker** ppenum)
|
||||||
|
|
||||||
/********************************************************************************/
|
/********************************************************************************/
|
||||||
/* Virtual function table for the IROTData class */
|
/* Virtual function table for the IROTData class */
|
||||||
static IEnumMonikerVtbl VT_EnumMonikerImpl =
|
static const IEnumMonikerVtbl VT_EnumMonikerImpl =
|
||||||
{
|
{
|
||||||
EnumMonikerImpl_QueryInterface,
|
EnumMonikerImpl_QueryInterface,
|
||||||
EnumMonikerImpl_AddRef,
|
EnumMonikerImpl_AddRef,
|
||||||
|
@ -1453,7 +1453,7 @@ EnumMonikerImpl_CreateEnumMoniker(IMoniker** tabMoniker, ULONG tabSize,
|
||||||
/* Virtual function table for the CompositeMonikerImpl class which includes */
|
/* Virtual function table for the CompositeMonikerImpl class which includes */
|
||||||
/* IPersist, IPersistStream and IMoniker functions. */
|
/* IPersist, IPersistStream and IMoniker functions. */
|
||||||
|
|
||||||
static IMonikerVtbl VT_CompositeMonikerImpl =
|
static const IMonikerVtbl VT_CompositeMonikerImpl =
|
||||||
{
|
{
|
||||||
CompositeMonikerImpl_QueryInterface,
|
CompositeMonikerImpl_QueryInterface,
|
||||||
CompositeMonikerImpl_AddRef,
|
CompositeMonikerImpl_AddRef,
|
||||||
|
@ -1482,7 +1482,7 @@ static IMonikerVtbl VT_CompositeMonikerImpl =
|
||||||
|
|
||||||
/********************************************************************************/
|
/********************************************************************************/
|
||||||
/* Virtual function table for the IROTData class. */
|
/* Virtual function table for the IROTData class. */
|
||||||
static IROTDataVtbl VT_ROTDataImpl =
|
static const IROTDataVtbl VT_ROTDataImpl =
|
||||||
{
|
{
|
||||||
CompositeMonikerROTDataImpl_QueryInterface,
|
CompositeMonikerROTDataImpl_QueryInterface,
|
||||||
CompositeMonikerROTDataImpl_AddRef,
|
CompositeMonikerROTDataImpl_AddRef,
|
||||||
|
|
|
@ -93,12 +93,12 @@ struct DataCache
|
||||||
/*
|
/*
|
||||||
* List all interface VTables here
|
* List all interface VTables here
|
||||||
*/
|
*/
|
||||||
IDataObjectVtbl* lpvtbl1;
|
const IDataObjectVtbl* lpvtbl1;
|
||||||
IUnknownVtbl* lpvtbl2;
|
const IUnknownVtbl* lpvtbl2;
|
||||||
IPersistStorageVtbl* lpvtbl3;
|
const IPersistStorageVtbl* lpvtbl3;
|
||||||
IViewObject2Vtbl* lpvtbl4;
|
const IViewObject2Vtbl* lpvtbl4;
|
||||||
IOleCache2Vtbl* lpvtbl5;
|
const IOleCache2Vtbl* lpvtbl5;
|
||||||
IOleCacheControlVtbl* lpvtbl6;
|
const IOleCacheControlVtbl* lpvtbl6;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Reference count of this object
|
* Reference count of this object
|
||||||
|
@ -1617,14 +1617,14 @@ static HRESULT WINAPI DataCache_OnStop(
|
||||||
/*
|
/*
|
||||||
* Virtual function tables for the DataCache class.
|
* Virtual function tables for the DataCache class.
|
||||||
*/
|
*/
|
||||||
static IUnknownVtbl DataCache_NDIUnknown_VTable =
|
static const IUnknownVtbl DataCache_NDIUnknown_VTable =
|
||||||
{
|
{
|
||||||
DataCache_NDIUnknown_QueryInterface,
|
DataCache_NDIUnknown_QueryInterface,
|
||||||
DataCache_NDIUnknown_AddRef,
|
DataCache_NDIUnknown_AddRef,
|
||||||
DataCache_NDIUnknown_Release
|
DataCache_NDIUnknown_Release
|
||||||
};
|
};
|
||||||
|
|
||||||
static IDataObjectVtbl DataCache_IDataObject_VTable =
|
static const IDataObjectVtbl DataCache_IDataObject_VTable =
|
||||||
{
|
{
|
||||||
DataCache_IDataObject_QueryInterface,
|
DataCache_IDataObject_QueryInterface,
|
||||||
DataCache_IDataObject_AddRef,
|
DataCache_IDataObject_AddRef,
|
||||||
|
@ -1640,7 +1640,7 @@ static IDataObjectVtbl DataCache_IDataObject_VTable =
|
||||||
DataCache_EnumDAdvise
|
DataCache_EnumDAdvise
|
||||||
};
|
};
|
||||||
|
|
||||||
static IPersistStorageVtbl DataCache_IPersistStorage_VTable =
|
static const IPersistStorageVtbl DataCache_IPersistStorage_VTable =
|
||||||
{
|
{
|
||||||
DataCache_IPersistStorage_QueryInterface,
|
DataCache_IPersistStorage_QueryInterface,
|
||||||
DataCache_IPersistStorage_AddRef,
|
DataCache_IPersistStorage_AddRef,
|
||||||
|
@ -1654,7 +1654,7 @@ static IPersistStorageVtbl DataCache_IPersistStorage_VTable =
|
||||||
DataCache_HandsOffStorage
|
DataCache_HandsOffStorage
|
||||||
};
|
};
|
||||||
|
|
||||||
static IViewObject2Vtbl DataCache_IViewObject2_VTable =
|
static const IViewObject2Vtbl DataCache_IViewObject2_VTable =
|
||||||
{
|
{
|
||||||
DataCache_IViewObject2_QueryInterface,
|
DataCache_IViewObject2_QueryInterface,
|
||||||
DataCache_IViewObject2_AddRef,
|
DataCache_IViewObject2_AddRef,
|
||||||
|
@ -1668,7 +1668,7 @@ static IViewObject2Vtbl DataCache_IViewObject2_VTable =
|
||||||
DataCache_GetExtent
|
DataCache_GetExtent
|
||||||
};
|
};
|
||||||
|
|
||||||
static IOleCache2Vtbl DataCache_IOleCache2_VTable =
|
static const IOleCache2Vtbl DataCache_IOleCache2_VTable =
|
||||||
{
|
{
|
||||||
DataCache_IOleCache2_QueryInterface,
|
DataCache_IOleCache2_QueryInterface,
|
||||||
DataCache_IOleCache2_AddRef,
|
DataCache_IOleCache2_AddRef,
|
||||||
|
@ -1682,7 +1682,7 @@ static IOleCache2Vtbl DataCache_IOleCache2_VTable =
|
||||||
DataCache_DiscardCache
|
DataCache_DiscardCache
|
||||||
};
|
};
|
||||||
|
|
||||||
static IOleCacheControlVtbl DataCache_IOleCacheControl_VTable =
|
static const IOleCacheControlVtbl DataCache_IOleCacheControl_VTable =
|
||||||
{
|
{
|
||||||
DataCache_IOleCacheControl_QueryInterface,
|
DataCache_IOleCacheControl_QueryInterface,
|
||||||
DataCache_IOleCacheControl_AddRef,
|
DataCache_IOleCacheControl_AddRef,
|
||||||
|
|
|
@ -70,10 +70,10 @@ struct DefaultHandler
|
||||||
/*
|
/*
|
||||||
* List all interface VTables here
|
* List all interface VTables here
|
||||||
*/
|
*/
|
||||||
IOleObjectVtbl* lpvtbl1;
|
const IOleObjectVtbl* lpvtbl1;
|
||||||
IUnknownVtbl* lpvtbl2;
|
const IUnknownVtbl* lpvtbl2;
|
||||||
IDataObjectVtbl* lpvtbl3;
|
const IDataObjectVtbl* lpvtbl3;
|
||||||
IRunnableObjectVtbl* lpvtbl4;
|
const IRunnableObjectVtbl* lpvtbl4;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Reference count of this object
|
* Reference count of this object
|
||||||
|
@ -325,7 +325,7 @@ static HRESULT WINAPI DefaultHandler_SetContainedObject(
|
||||||
/*
|
/*
|
||||||
* Virtual function tables for the DefaultHandler class.
|
* Virtual function tables for the DefaultHandler class.
|
||||||
*/
|
*/
|
||||||
static IOleObjectVtbl DefaultHandler_IOleObject_VTable =
|
static const IOleObjectVtbl DefaultHandler_IOleObject_VTable =
|
||||||
{
|
{
|
||||||
DefaultHandler_QueryInterface,
|
DefaultHandler_QueryInterface,
|
||||||
DefaultHandler_AddRef,
|
DefaultHandler_AddRef,
|
||||||
|
@ -353,14 +353,14 @@ static IOleObjectVtbl DefaultHandler_IOleObject_VTable =
|
||||||
DefaultHandler_SetColorScheme
|
DefaultHandler_SetColorScheme
|
||||||
};
|
};
|
||||||
|
|
||||||
static IUnknownVtbl DefaultHandler_NDIUnknown_VTable =
|
static const IUnknownVtbl DefaultHandler_NDIUnknown_VTable =
|
||||||
{
|
{
|
||||||
DefaultHandler_NDIUnknown_QueryInterface,
|
DefaultHandler_NDIUnknown_QueryInterface,
|
||||||
DefaultHandler_NDIUnknown_AddRef,
|
DefaultHandler_NDIUnknown_AddRef,
|
||||||
DefaultHandler_NDIUnknown_Release,
|
DefaultHandler_NDIUnknown_Release,
|
||||||
};
|
};
|
||||||
|
|
||||||
static IDataObjectVtbl DefaultHandler_IDataObject_VTable =
|
static const IDataObjectVtbl DefaultHandler_IDataObject_VTable =
|
||||||
{
|
{
|
||||||
DefaultHandler_IDataObject_QueryInterface,
|
DefaultHandler_IDataObject_QueryInterface,
|
||||||
DefaultHandler_IDataObject_AddRef,
|
DefaultHandler_IDataObject_AddRef,
|
||||||
|
@ -376,7 +376,7 @@ static IDataObjectVtbl DefaultHandler_IDataObject_VTable =
|
||||||
DefaultHandler_EnumDAdvise
|
DefaultHandler_EnumDAdvise
|
||||||
};
|
};
|
||||||
|
|
||||||
static IRunnableObjectVtbl DefaultHandler_IRunnableObject_VTable =
|
static const IRunnableObjectVtbl DefaultHandler_IRunnableObject_VTable =
|
||||||
{
|
{
|
||||||
DefaultHandler_IRunnableObject_QueryInterface,
|
DefaultHandler_IRunnableObject_QueryInterface,
|
||||||
DefaultHandler_IRunnableObject_AddRef,
|
DefaultHandler_IRunnableObject_AddRef,
|
||||||
|
|
|
@ -128,9 +128,9 @@ static VOID WINAPI ERRORINFO_SysFreeString(BSTR in)
|
||||||
|
|
||||||
typedef struct ErrorInfoImpl
|
typedef struct ErrorInfoImpl
|
||||||
{
|
{
|
||||||
IErrorInfoVtbl *lpvtei;
|
const IErrorInfoVtbl *lpvtei;
|
||||||
ICreateErrorInfoVtbl *lpvtcei;
|
const ICreateErrorInfoVtbl *lpvtcei;
|
||||||
ISupportErrorInfoVtbl *lpvtsei;
|
const ISupportErrorInfoVtbl *lpvtsei;
|
||||||
DWORD ref;
|
DWORD ref;
|
||||||
|
|
||||||
GUID m_Guid;
|
GUID m_Guid;
|
||||||
|
@ -140,9 +140,9 @@ typedef struct ErrorInfoImpl
|
||||||
DWORD m_dwHelpContext;
|
DWORD m_dwHelpContext;
|
||||||
} ErrorInfoImpl;
|
} ErrorInfoImpl;
|
||||||
|
|
||||||
static IErrorInfoVtbl IErrorInfoImpl_VTable;
|
static const IErrorInfoVtbl IErrorInfoImpl_VTable;
|
||||||
static ICreateErrorInfoVtbl ICreateErrorInfoImpl_VTable;
|
static const ICreateErrorInfoVtbl ICreateErrorInfoImpl_VTable;
|
||||||
static ISupportErrorInfoVtbl ISupportErrorInfoImpl_VTable;
|
static const ISupportErrorInfoVtbl ISupportErrorInfoImpl_VTable;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
converts an object pointer to This
|
converts an object pointer to This
|
||||||
|
@ -303,7 +303,7 @@ static HRESULT WINAPI IErrorInfoImpl_GetHelpContext(
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static IErrorInfoVtbl IErrorInfoImpl_VTable =
|
static const IErrorInfoVtbl IErrorInfoImpl_VTable =
|
||||||
{
|
{
|
||||||
IErrorInfoImpl_QueryInterface,
|
IErrorInfoImpl_QueryInterface,
|
||||||
IErrorInfoImpl_AddRef,
|
IErrorInfoImpl_AddRef,
|
||||||
|
@ -402,7 +402,7 @@ static HRESULT WINAPI ICreateErrorInfoImpl_SetHelpContext(
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ICreateErrorInfoVtbl ICreateErrorInfoImpl_VTable =
|
static const ICreateErrorInfoVtbl ICreateErrorInfoImpl_VTable =
|
||||||
{
|
{
|
||||||
ICreateErrorInfoImpl_QueryInterface,
|
ICreateErrorInfoImpl_QueryInterface,
|
||||||
ICreateErrorInfoImpl_AddRef,
|
ICreateErrorInfoImpl_AddRef,
|
||||||
|
@ -452,7 +452,7 @@ static HRESULT WINAPI ISupportErrorInfoImpl_InterfaceSupportsErrorInfo(
|
||||||
return (IsEqualIID(riid, &This->m_Guid)) ? S_OK : S_FALSE;
|
return (IsEqualIID(riid, &This->m_Guid)) ? S_OK : S_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ISupportErrorInfoVtbl ISupportErrorInfoImpl_VTable =
|
static const ISupportErrorInfoVtbl ISupportErrorInfoImpl_VTable =
|
||||||
{
|
{
|
||||||
ISupportErrorInfoImpl_QueryInterface,
|
ISupportErrorInfoImpl_QueryInterface,
|
||||||
ISupportErrorInfoImpl_AddRef,
|
ISupportErrorInfoImpl_AddRef,
|
||||||
|
|
|
@ -46,12 +46,12 @@ const CLSID CLSID_FileMoniker = {
|
||||||
/* filemoniker data structure */
|
/* filemoniker data structure */
|
||||||
typedef struct FileMonikerImpl{
|
typedef struct FileMonikerImpl{
|
||||||
|
|
||||||
IMonikerVtbl* lpvtbl1; /* VTable relative to the IMoniker interface.*/
|
const IMonikerVtbl* lpvtbl1; /* VTable relative to the IMoniker interface.*/
|
||||||
|
|
||||||
/* The ROT (RunningObjectTable implementation) uses the IROTData interface to test whether
|
/* The ROT (RunningObjectTable implementation) uses the IROTData interface to test whether
|
||||||
* two monikers are equal. That's whay IROTData interface is implemented by monikers.
|
* two monikers are equal. That's whay IROTData interface is implemented by monikers.
|
||||||
*/
|
*/
|
||||||
IROTDataVtbl* lpvtbl2; /* VTable relative to the IROTData interface.*/
|
const IROTDataVtbl* lpvtbl2; /* VTable relative to the IROTData interface.*/
|
||||||
|
|
||||||
ULONG ref; /* reference counter for this object */
|
ULONG ref; /* reference counter for this object */
|
||||||
|
|
||||||
|
@ -182,121 +182,155 @@ FileMonikerImpl_IsDirty(IMoniker* iface)
|
||||||
* written by FileMonikerImpl_Save
|
* written by FileMonikerImpl_Save
|
||||||
*/
|
*/
|
||||||
static HRESULT WINAPI
|
static HRESULT WINAPI
|
||||||
FileMonikerImpl_Load(IMoniker* iface,IStream* pStm)
|
FileMonikerImpl_Load(IMoniker* iface, IStream* pStm)
|
||||||
{
|
{
|
||||||
HRESULT res;
|
HRESULT res;
|
||||||
CHAR* filePathA;
|
CHAR* filePathA = NULL;
|
||||||
WCHAR* filePathW;
|
WCHAR* filePathW = NULL;
|
||||||
ULONG bread;
|
ULONG bread;
|
||||||
WORD wbuffer;
|
WORD wbuffer;
|
||||||
DWORD dwbuffer,length,i,doubleLenHex,doubleLenDec;
|
DWORD dwbuffer, bytesA, bytesW, len;
|
||||||
|
int i;
|
||||||
|
|
||||||
FileMonikerImpl *This = (FileMonikerImpl *)iface;
|
FileMonikerImpl *This = (FileMonikerImpl *)iface;
|
||||||
|
|
||||||
TRACE("(%p,%p)\n",iface,pStm);
|
TRACE("(%p,%p)\n",iface,pStm);
|
||||||
|
|
||||||
/* first WORD is non significative */
|
/* first WORD must be 0 */
|
||||||
res=IStream_Read(pStm,&wbuffer,sizeof(WORD),&bread);
|
res=IStream_Read(pStm,&wbuffer,sizeof(WORD),&bread);
|
||||||
if (bread!=sizeof(WORD) || wbuffer!=0)
|
if (bread!=sizeof(WORD) || wbuffer!=0)
|
||||||
{
|
{
|
||||||
ERR("Couldn't read 0 word\n");
|
WARN("Couldn't read 0 word\n");
|
||||||
return E_FAIL;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* read filePath string length (plus one) */
|
/* read filePath string length (plus one) */
|
||||||
res=IStream_Read(pStm,&length,sizeof(DWORD),&bread);
|
res=IStream_Read(pStm,&bytesA,sizeof(DWORD),&bread);
|
||||||
if (bread != sizeof(DWORD))
|
if (bread != sizeof(DWORD))
|
||||||
{
|
{
|
||||||
ERR("Couldn't read file string length\n");
|
WARN("Couldn't read file string length\n");
|
||||||
return E_FAIL;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* read filePath string */
|
/* read filePath string */
|
||||||
filePathA=HeapAlloc(GetProcessHeap(),0,length);
|
filePathA=HeapAlloc(GetProcessHeap(),0,bytesA);
|
||||||
res=IStream_Read(pStm,filePathA,length,&bread);
|
if (!filePathA)
|
||||||
HeapFree(GetProcessHeap(),0,filePathA);
|
|
||||||
if (bread != length)
|
|
||||||
{
|
{
|
||||||
ERR("Couldn't read file path string\n");
|
res = E_OUTOFMEMORY;
|
||||||
return E_FAIL;
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
res=IStream_Read(pStm,filePathA,bytesA,&bread);
|
||||||
|
if (bread != bytesA)
|
||||||
|
{
|
||||||
|
WARN("Couldn't read file path string\n");
|
||||||
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* read the first constant */
|
/* read the first constant */
|
||||||
IStream_Read(pStm,&dwbuffer,sizeof(DWORD),&bread);
|
IStream_Read(pStm,&dwbuffer,sizeof(DWORD),&bread);
|
||||||
if (bread != sizeof(DWORD) || dwbuffer != 0xDEADFFFF)
|
if (bread != sizeof(DWORD) || dwbuffer != 0xDEADFFFF)
|
||||||
{
|
{
|
||||||
ERR("Couldn't read 0xDEADFFFF constant\n");
|
WARN("Couldn't read 0xDEADFFFF constant\n");
|
||||||
return E_FAIL;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
length--;
|
for(i=0;i<5;i++)
|
||||||
|
{
|
||||||
for(i=0;i<10;i++){
|
res=IStream_Read(pStm,&dwbuffer,sizeof(DWORD),&bread);
|
||||||
res=IStream_Read(pStm,&wbuffer,sizeof(WORD),&bread);
|
if (bread!=sizeof(DWORD) || dwbuffer!=0)
|
||||||
if (bread!=sizeof(WORD) || wbuffer!=0)
|
|
||||||
{
|
{
|
||||||
ERR("Couldn't read 0 padding\n");
|
WARN("Couldn't read 0 padding\n");
|
||||||
return E_FAIL;
|
goto fail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (length>8)
|
res=IStream_Read(pStm,&dwbuffer,sizeof(DWORD),&bread);
|
||||||
length=0;
|
if (bread!=sizeof(DWORD))
|
||||||
|
goto fail;
|
||||||
|
|
||||||
doubleLenHex=doubleLenDec=2*length;
|
if (!dwbuffer) /* No W-string */
|
||||||
if (length > 5)
|
{
|
||||||
doubleLenDec+=6;
|
bytesA--;
|
||||||
|
len=MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, filePathA, bytesA, NULL, 0);
|
||||||
|
if (!len)
|
||||||
|
goto fail;
|
||||||
|
|
||||||
|
filePathW=HeapAlloc(GetProcessHeap(),0,(len+1)*sizeof(WCHAR));
|
||||||
|
if (!filePathW)
|
||||||
|
{
|
||||||
|
res = E_OUTOFMEMORY;
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, filePathA, -1, filePathW, len+1);
|
||||||
|
goto succeed;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dwbuffer < 6)
|
||||||
|
goto fail;
|
||||||
|
|
||||||
|
bytesW=dwbuffer - 6;
|
||||||
|
|
||||||
res=IStream_Read(pStm,&dwbuffer,sizeof(DWORD),&bread);
|
res=IStream_Read(pStm,&dwbuffer,sizeof(DWORD),&bread);
|
||||||
if (bread!=sizeof(DWORD) || dwbuffer!=doubleLenDec)
|
if (bread!=sizeof(DWORD) || dwbuffer!=bytesW)
|
||||||
return E_FAIL;
|
goto fail;
|
||||||
|
|
||||||
if (length==0)
|
|
||||||
return res;
|
|
||||||
|
|
||||||
res=IStream_Read(pStm,&dwbuffer,sizeof(DWORD),&bread);
|
|
||||||
if (bread!=sizeof(DWORD) || dwbuffer!=doubleLenHex)
|
|
||||||
return E_FAIL;
|
|
||||||
|
|
||||||
res=IStream_Read(pStm,&wbuffer,sizeof(WORD),&bread);
|
res=IStream_Read(pStm,&wbuffer,sizeof(WORD),&bread);
|
||||||
if (bread!=sizeof(WORD) || wbuffer!=0x3)
|
if (bread!=sizeof(WORD) || wbuffer!=0x3)
|
||||||
return E_FAIL;
|
goto fail;
|
||||||
|
|
||||||
filePathW=HeapAlloc(GetProcessHeap(),0,(length+1)*sizeof(WCHAR));
|
len=bytesW/sizeof(WCHAR);
|
||||||
filePathW[length]=0;
|
filePathW=HeapAlloc(GetProcessHeap(),0,(len+1)*sizeof(WCHAR));
|
||||||
res=IStream_Read(pStm,filePathW,doubleLenHex,&bread);
|
if(!filePathW)
|
||||||
if (bread!=doubleLenHex) {
|
{
|
||||||
HeapFree(GetProcessHeap(), 0, filePathW);
|
res = E_OUTOFMEMORY;
|
||||||
return E_FAIL;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
res=IStream_Read(pStm,filePathW,bytesW,&bread);
|
||||||
|
if (bread!=bytesW)
|
||||||
|
goto fail;
|
||||||
|
|
||||||
|
filePathW[len]=0;
|
||||||
|
|
||||||
|
succeed:
|
||||||
|
HeapFree(GetProcessHeap(),0,filePathA);
|
||||||
HeapFree(GetProcessHeap(),0,This->filePathName);
|
HeapFree(GetProcessHeap(),0,This->filePathName);
|
||||||
|
|
||||||
This->filePathName=filePathW;
|
This->filePathName=filePathW;
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
|
|
||||||
|
fail:
|
||||||
|
HeapFree(GetProcessHeap(), 0, filePathA);
|
||||||
|
HeapFree(GetProcessHeap(), 0, filePathW);
|
||||||
|
|
||||||
|
if (SUCCEEDED(res))
|
||||||
|
res = E_FAIL;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* FileMoniker_Save
|
* FileMoniker_Save
|
||||||
*
|
*
|
||||||
* This function saves data of this object. In the beginning I thougth
|
* This function saves data of this object. In the beginning I thought
|
||||||
* that I have just to write the filePath string on Stream. But, when I
|
* that I have just to write the filePath string on Stream. But, when I
|
||||||
* tested this function whith windows programs samples, I noticed that it
|
* tested this function with windows programs samples, I noticed that it
|
||||||
* was not the case. So I analysed data written by this function on
|
* was not the case. This implementation is based on XP SP2. Other versions
|
||||||
* Windows and what this did function exactly ! But I have no idea about
|
* of Windows have minor variations.
|
||||||
* its logic !
|
*
|
||||||
* I guessed data which must be written on stream is:
|
* Data which must be written on stream is:
|
||||||
* 1) WORD constant:zero
|
* 1) WORD constant:zero
|
||||||
* 2) length of the path string ("\0" included)
|
* 2) length of the path string ("\0" included)
|
||||||
* 3) path string type A
|
* 3) path string type A
|
||||||
* 4) DWORD constant : 0xDEADFFFF
|
* 4) DWORD constant : 0xDEADFFFF
|
||||||
* 5) ten WORD constant: zero
|
* 5) five DWORD constant: zero
|
||||||
* 6) DWORD: double-length of the the path string type W ("\0" not
|
* 6) If we're only writing the multibyte version,
|
||||||
|
* write a zero DWORD and finish.
|
||||||
|
*
|
||||||
|
* 7) DWORD: double-length of the the path string type W ("\0" not
|
||||||
* included)
|
* included)
|
||||||
* 7) WORD constant: 0x3
|
* 8) WORD constant: 0x3
|
||||||
* 8) filePath unicode string.
|
* 9) filePath unicode string.
|
||||||
* if the length(filePath) > 8 or length(filePath) == 8 stop at step 5)
|
*
|
||||||
*/
|
*/
|
||||||
static HRESULT WINAPI
|
static HRESULT WINAPI
|
||||||
FileMonikerImpl_Save(IMoniker* iface, IStream* pStm, BOOL fClearDirty)
|
FileMonikerImpl_Save(IMoniker* iface, IStream* pStm, BOOL fClearDirty)
|
||||||
|
@ -305,64 +339,92 @@ FileMonikerImpl_Save(IMoniker* iface, IStream* pStm, BOOL fClearDirty)
|
||||||
|
|
||||||
HRESULT res;
|
HRESULT res;
|
||||||
LPOLESTR filePathW=This->filePathName;
|
LPOLESTR filePathW=This->filePathName;
|
||||||
CHAR* filePathA;
|
CHAR* filePathA;
|
||||||
DWORD len;
|
DWORD bytesA, bytesW, len;
|
||||||
|
|
||||||
DWORD constant1 = 0xDEADFFFF; /* these constants are detected after analysing the data structure written by */
|
static const DWORD DEADFFFF = 0xDEADFFFF; /* Constants */
|
||||||
WORD constant2 = 0x3; /* FileMoniker_Save function in a windows program system */
|
static const DWORD ZERO = 0;
|
||||||
|
static const WORD THREE = 0x3;
|
||||||
|
|
||||||
WORD zero=0;
|
int i;
|
||||||
DWORD doubleLenHex;
|
BOOL bUsedDefault, bWriteWide;
|
||||||
DWORD doubleLenDec;
|
|
||||||
int i=0;
|
|
||||||
|
|
||||||
TRACE("(%p,%p,%d)\n",iface,pStm,fClearDirty);
|
TRACE("(%p,%p,%d)\n",iface,pStm,fClearDirty);
|
||||||
|
|
||||||
if (pStm==NULL)
|
if (pStm==NULL)
|
||||||
return E_POINTER;
|
return E_POINTER;
|
||||||
|
|
||||||
/* write a DWORD set to 0 : constant */
|
/* write a 0 WORD */
|
||||||
res=IStream_Write(pStm,&zero,sizeof(WORD),NULL);
|
res=IStream_Write(pStm,&ZERO,sizeof(WORD),NULL);
|
||||||
|
if (!SUCCEEDED(res)) return res;
|
||||||
|
|
||||||
/* write length of filePath string ( "\0" included )*/
|
/* write length of filePath string ( 0 included )*/
|
||||||
len = WideCharToMultiByte( CP_ACP, 0, filePathW, -1, NULL, 0, NULL, NULL );
|
bytesA = WideCharToMultiByte( CP_ACP, 0, filePathW, -1, NULL, 0, NULL, NULL );
|
||||||
res=IStream_Write(pStm,&len,sizeof(DWORD),NULL);
|
res=IStream_Write(pStm,&bytesA,sizeof(DWORD),NULL);
|
||||||
|
if (!SUCCEEDED(res)) return res;
|
||||||
|
|
||||||
/* write filePath string type A */
|
/* write A string (with '\0') */
|
||||||
filePathA=HeapAlloc(GetProcessHeap(),0,len);
|
filePathA=HeapAlloc(GetProcessHeap(),0,bytesA);
|
||||||
WideCharToMultiByte( CP_ACP, 0, filePathW, -1, filePathA, len, NULL, NULL );
|
if (!filePathA)
|
||||||
res=IStream_Write(pStm,filePathA,len,NULL);
|
return E_OUTOFMEMORY;
|
||||||
|
WideCharToMultiByte( CP_ACP, 0, filePathW, -1, filePathA, bytesA, NULL, &bUsedDefault);
|
||||||
|
res=IStream_Write(pStm,filePathA,bytesA,NULL);
|
||||||
HeapFree(GetProcessHeap(),0,filePathA);
|
HeapFree(GetProcessHeap(),0,filePathA);
|
||||||
|
if (!SUCCEEDED(res)) return res;
|
||||||
|
|
||||||
/* write a DWORD set to 0xDEADFFFF: constant */
|
/* write a DWORD 0xDEADFFFF */
|
||||||
res=IStream_Write(pStm,&constant1,sizeof(DWORD),NULL);
|
res=IStream_Write(pStm,&DEADFFFF,sizeof(DWORD),NULL);
|
||||||
|
if (!SUCCEEDED(res)) return res;
|
||||||
|
|
||||||
len--;
|
/* write 5 zero DWORDs */
|
||||||
/* write 10 times a DWORD set to 0 : constants */
|
for(i=0;i<5;i++)
|
||||||
for(i=0;i<10;i++)
|
{
|
||||||
res=IStream_Write(pStm,&zero,sizeof(WORD),NULL);
|
res=IStream_Write(pStm,&ZERO,sizeof(DWORD),NULL);
|
||||||
|
if (!SUCCEEDED(res)) return res;
|
||||||
|
}
|
||||||
|
|
||||||
if (len>8)
|
/* Write the wide version if:
|
||||||
len=0;
|
* + couldn't convert to CP_ACP,
|
||||||
|
* or + it's a directory,
|
||||||
|
* or + there's a character > 0xFF
|
||||||
|
*/
|
||||||
|
len = lstrlenW(filePathW);
|
||||||
|
bWriteWide = (bUsedDefault || (len > 0 && filePathW[len-1]=='\\' ));
|
||||||
|
if (!bWriteWide)
|
||||||
|
{
|
||||||
|
WCHAR* pch;
|
||||||
|
for(pch=filePathW;*pch;++pch)
|
||||||
|
{
|
||||||
|
if (*pch > 0xFF)
|
||||||
|
{
|
||||||
|
bWriteWide = TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
doubleLenHex=doubleLenDec=2*len;
|
if (!bWriteWide)
|
||||||
if (len > 5)
|
{
|
||||||
doubleLenDec+=6;
|
res=IStream_Write(pStm,&ZERO,sizeof(DWORD),NULL);
|
||||||
|
|
||||||
/* write double-length of the path string ( "\0" included )*/
|
|
||||||
res=IStream_Write(pStm,&doubleLenDec,sizeof(DWORD),NULL);
|
|
||||||
|
|
||||||
if (len==0)
|
|
||||||
return res;
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
/* write double-length (hexa representation) of the path string ( "\0" included ) */
|
/* write bytes needed for the filepathW (without 0) + 6 */
|
||||||
res=IStream_Write(pStm,&doubleLenHex,sizeof(DWORD),NULL);
|
bytesW = len*sizeof(WCHAR) + 6;
|
||||||
|
res=IStream_Write(pStm,&bytesW,sizeof(DWORD),NULL);
|
||||||
|
if (!SUCCEEDED(res)) return res;
|
||||||
|
|
||||||
/* write a WORD set to 0x3: constant */
|
/* try again, without the extra 6 */
|
||||||
res=IStream_Write(pStm,&constant2,sizeof(WORD),NULL);
|
bytesW -= 6;
|
||||||
|
res=IStream_Write(pStm,&bytesW,sizeof(DWORD),NULL);
|
||||||
|
if (!SUCCEEDED(res)) return res;
|
||||||
|
|
||||||
/* write path unicode string */
|
/* write a WORD 3 */
|
||||||
res=IStream_Write(pStm,filePathW,doubleLenHex,NULL);
|
res=IStream_Write(pStm,&THREE,sizeof(WORD),NULL);
|
||||||
|
if (!SUCCEEDED(res)) return res;
|
||||||
|
|
||||||
|
/* write W string (no 0) */
|
||||||
|
res=IStream_Write(pStm,filePathW,bytesW,NULL);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@ -374,32 +436,17 @@ static HRESULT WINAPI
|
||||||
FileMonikerImpl_GetSizeMax(IMoniker* iface, ULARGE_INTEGER* pcbSize)
|
FileMonikerImpl_GetSizeMax(IMoniker* iface, ULARGE_INTEGER* pcbSize)
|
||||||
{
|
{
|
||||||
FileMonikerImpl *This = (FileMonikerImpl *)iface;
|
FileMonikerImpl *This = (FileMonikerImpl *)iface;
|
||||||
DWORD len=lstrlenW(This->filePathName);
|
|
||||||
DWORD sizeMAx;
|
|
||||||
|
|
||||||
TRACE("(%p,%p)\n",iface,pcbSize);
|
TRACE("(%p,%p)\n",iface,pcbSize);
|
||||||
|
|
||||||
if (!pcbSize)
|
if (!pcbSize)
|
||||||
return E_POINTER;
|
return E_POINTER;
|
||||||
|
|
||||||
/* for more details see FileMonikerImpl_Save coments */
|
/* We could calculate exactly (see ...::Save()) but instead
|
||||||
|
* we'll make a quick over-estimate, like Windows (NT4, XP) does.
|
||||||
sizeMAx = sizeof(WORD) + /* first WORD is 0 */
|
*/
|
||||||
sizeof(DWORD)+ /* length of filePath including "\0" in the end of the string */
|
pcbSize->u.LowPart = 0x38 + 4 * lstrlenW(This->filePathName);
|
||||||
(len+1)+ /* filePath string */
|
pcbSize->u.HighPart = 0;
|
||||||
sizeof(DWORD)+ /* constant : 0xDEADFFFF */
|
|
||||||
10*sizeof(WORD)+ /* 10 zero WORD */
|
|
||||||
sizeof(DWORD); /* size of the unicode filePath: "\0" not included */
|
|
||||||
|
|
||||||
if (len==0 || len > 8)
|
|
||||||
return S_OK;
|
|
||||||
|
|
||||||
sizeMAx += sizeof(DWORD)+ /* size of the unicode filePath: "\0" not included */
|
|
||||||
sizeof(WORD)+ /* constant : 0x3 */
|
|
||||||
len*sizeof(WCHAR); /* unicde filePath string */
|
|
||||||
|
|
||||||
pcbSize->u.LowPart=sizeMAx;
|
|
||||||
pcbSize->u.HighPart=0;
|
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
@ -1215,7 +1262,7 @@ FileMonikerROTDataImpl_GetComparisonData(IROTData* iface, BYTE* pbData,
|
||||||
* Virtual function table for the FileMonikerImpl class which include IPersist,
|
* Virtual function table for the FileMonikerImpl class which include IPersist,
|
||||||
* IPersistStream and IMoniker functions.
|
* IPersistStream and IMoniker functions.
|
||||||
*/
|
*/
|
||||||
static IMonikerVtbl VT_FileMonikerImpl =
|
static const IMonikerVtbl VT_FileMonikerImpl =
|
||||||
{
|
{
|
||||||
FileMonikerImpl_QueryInterface,
|
FileMonikerImpl_QueryInterface,
|
||||||
FileMonikerImpl_AddRef,
|
FileMonikerImpl_AddRef,
|
||||||
|
@ -1243,7 +1290,7 @@ static IMonikerVtbl VT_FileMonikerImpl =
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Virtual function table for the IROTData class. */
|
/* Virtual function table for the IROTData class. */
|
||||||
static IROTDataVtbl VT_ROTDataImpl =
|
static const IROTDataVtbl VT_ROTDataImpl =
|
||||||
{
|
{
|
||||||
FileMonikerROTDataImpl_QueryInterface,
|
FileMonikerROTDataImpl_QueryInterface,
|
||||||
FileMonikerROTDataImpl_AddRef,
|
FileMonikerROTDataImpl_AddRef,
|
||||||
|
|
|
@ -37,9 +37,9 @@
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(ole);
|
WINE_DEFAULT_DEBUG_CHANNEL(ole);
|
||||||
|
|
||||||
typedef struct _FTMarshalImpl {
|
typedef struct _FTMarshalImpl {
|
||||||
IUnknownVtbl *lpVtbl;
|
const IUnknownVtbl *lpVtbl;
|
||||||
DWORD ref;
|
DWORD ref;
|
||||||
IMarshalVtbl *lpvtblFTM;
|
const IMarshalVtbl *lpvtblFTM;
|
||||||
|
|
||||||
IUnknown *pUnkOuter;
|
IUnknown *pUnkOuter;
|
||||||
} FTMarshalImpl;
|
} FTMarshalImpl;
|
||||||
|
@ -93,7 +93,7 @@ static ULONG WINAPI IiFTMUnknown_fnRelease (IUnknown * iface)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static IUnknownVtbl iunkvt =
|
static const IUnknownVtbl iunkvt =
|
||||||
{
|
{
|
||||||
IiFTMUnknown_fnQueryInterface,
|
IiFTMUnknown_fnQueryInterface,
|
||||||
IiFTMUnknown_fnAddRef,
|
IiFTMUnknown_fnAddRef,
|
||||||
|
@ -208,7 +208,7 @@ static HRESULT WINAPI FTMarshalImpl_DisconnectObject (LPMARSHAL iface, DWORD dwR
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static IMarshalVtbl ftmvtbl =
|
static const IMarshalVtbl ftmvtbl =
|
||||||
{
|
{
|
||||||
FTMarshalImpl_QueryInterface,
|
FTMarshalImpl_QueryInterface,
|
||||||
FTMarshalImpl_AddRef,
|
FTMarshalImpl_AddRef,
|
||||||
|
|
|
@ -72,7 +72,7 @@ typedef struct StdGITEntry
|
||||||
/* Class data */
|
/* Class data */
|
||||||
typedef struct StdGlobalInterfaceTableImpl
|
typedef struct StdGlobalInterfaceTableImpl
|
||||||
{
|
{
|
||||||
IGlobalInterfaceTableVtbl *lpVtbl;
|
const IGlobalInterfaceTableVtbl *lpVtbl;
|
||||||
|
|
||||||
ULONG ref;
|
ULONG ref;
|
||||||
struct StdGITEntry* firstEntry;
|
struct StdGITEntry* firstEntry;
|
||||||
|
@ -360,7 +360,7 @@ static HRESULT WINAPI GITCF_LockServer(LPCLASSFACTORY iface, BOOL fLock)
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static IClassFactoryVtbl GITClassFactoryVtbl = {
|
static const IClassFactoryVtbl GITClassFactoryVtbl = {
|
||||||
GITCF_QueryInterface,
|
GITCF_QueryInterface,
|
||||||
GITCF_AddRef,
|
GITCF_AddRef,
|
||||||
GITCF_Release,
|
GITCF_Release,
|
||||||
|
@ -368,7 +368,7 @@ static IClassFactoryVtbl GITClassFactoryVtbl = {
|
||||||
GITCF_LockServer
|
GITCF_LockServer
|
||||||
};
|
};
|
||||||
|
|
||||||
static IClassFactoryVtbl *PGITClassFactoryVtbl = &GITClassFactoryVtbl;
|
static const IClassFactoryVtbl *PGITClassFactoryVtbl = &GITClassFactoryVtbl;
|
||||||
|
|
||||||
HRESULT StdGlobalInterfaceTable_GetFactory(LPVOID *ppv)
|
HRESULT StdGlobalInterfaceTable_GetFactory(LPVOID *ppv)
|
||||||
{
|
{
|
||||||
|
@ -378,7 +378,7 @@ HRESULT StdGlobalInterfaceTable_GetFactory(LPVOID *ppv)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Virtual function table */
|
/* Virtual function table */
|
||||||
static IGlobalInterfaceTableVtbl StdGlobalInterfaceTableImpl_Vtbl =
|
static const IGlobalInterfaceTableVtbl StdGlobalInterfaceTableImpl_Vtbl =
|
||||||
{
|
{
|
||||||
StdGlobalInterfaceTable_QueryInterface,
|
StdGlobalInterfaceTable_QueryInterface,
|
||||||
StdGlobalInterfaceTable_AddRef,
|
StdGlobalInterfaceTable_AddRef,
|
||||||
|
|
|
@ -54,7 +54,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(storage);
|
||||||
*/
|
*/
|
||||||
struct HGLOBALStreamImpl
|
struct HGLOBALStreamImpl
|
||||||
{
|
{
|
||||||
IStreamVtbl *lpVtbl; /* Needs to be the first item in the struct
|
const IStreamVtbl *lpVtbl; /* Needs to be the first item in the struct
|
||||||
* since we want to cast this in an IStream pointer */
|
* since we want to cast this in an IStream pointer */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -629,7 +629,7 @@ static HRESULT WINAPI HGLOBALStreamImpl_Clone(
|
||||||
/*
|
/*
|
||||||
* Virtual function table for the HGLOBALStreamImpl class.
|
* Virtual function table for the HGLOBALStreamImpl class.
|
||||||
*/
|
*/
|
||||||
static IStreamVtbl HGLOBALStreamImpl_Vtbl =
|
static const IStreamVtbl HGLOBALStreamImpl_Vtbl =
|
||||||
{
|
{
|
||||||
HGLOBALStreamImpl_QueryInterface,
|
HGLOBALStreamImpl_QueryInterface,
|
||||||
HGLOBALStreamImpl_AddRef,
|
HGLOBALStreamImpl_AddRef,
|
||||||
|
|
|
@ -47,10 +47,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(olemalloc);
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
/* set the vtable later */
|
/* set the vtable later */
|
||||||
static IMallocVtbl VT_IMalloc32;
|
static const IMallocVtbl VT_IMalloc32;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
IMallocVtbl *lpVtbl;
|
const IMallocVtbl *lpVtbl;
|
||||||
DWORD dummy; /* nothing, we are static */
|
DWORD dummy; /* nothing, we are static */
|
||||||
IMallocSpy * pSpy; /* the spy when active */
|
IMallocSpy * pSpy; /* the spy when active */
|
||||||
DWORD SpyedAllocationsLeft; /* number of spyed allocations left */
|
DWORD SpyedAllocationsLeft; /* number of spyed allocations left */
|
||||||
|
@ -60,7 +60,7 @@ typedef struct {
|
||||||
} _Malloc32;
|
} _Malloc32;
|
||||||
|
|
||||||
/* this is the static object instance */
|
/* this is the static object instance */
|
||||||
_Malloc32 Malloc32 = {&VT_IMalloc32, 0, NULL, 0, 0, NULL, 0};
|
static _Malloc32 Malloc32 = {&VT_IMalloc32, 0, NULL, 0, 0, NULL, 0};
|
||||||
|
|
||||||
/* with a spy active all calls from pre to post methods are threadsave */
|
/* with a spy active all calls from pre to post methods are threadsave */
|
||||||
static CRITICAL_SECTION IMalloc32_SpyCS;
|
static CRITICAL_SECTION IMalloc32_SpyCS;
|
||||||
|
@ -344,7 +344,7 @@ static VOID WINAPI IMalloc_fnHeapMinimize(LPMALLOC iface) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static IMallocVtbl VT_IMalloc32 =
|
static const IMallocVtbl VT_IMalloc32 =
|
||||||
{
|
{
|
||||||
IMalloc_fnQueryInterface,
|
IMalloc_fnQueryInterface,
|
||||||
IMalloc_fnAddRefRelease,
|
IMalloc_fnAddRefRelease,
|
||||||
|
@ -362,15 +362,15 @@ static IMallocVtbl VT_IMalloc32 =
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/* set the vtable later */
|
/* set the vtable later */
|
||||||
static IMallocSpyVtbl VT_IMallocSpy;
|
static const IMallocSpyVtbl VT_IMallocSpy;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
IMallocSpyVtbl *lpVtbl;
|
const IMallocSpyVtbl *lpVtbl;
|
||||||
DWORD ref;
|
DWORD ref;
|
||||||
} _MallocSpy;
|
} _MallocSpy;
|
||||||
|
|
||||||
/* this is the static object instance */
|
/* this is the static object instance */
|
||||||
_MallocSpy MallocSpy = {&VT_IMallocSpy, 0};
|
static _MallocSpy MallocSpy = {&VT_IMallocSpy, 0};
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* IMalloc32_QueryInterface [VTABLE]
|
* IMalloc32_QueryInterface [VTABLE]
|
||||||
|
@ -501,11 +501,11 @@ static void WINAPI IMallocSpy_fnPostHeapMinimize(LPMALLOCSPY iface)
|
||||||
TRACE ("(%p)->()\n", This);
|
TRACE ("(%p)->()\n", This);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MallocSpyDumpLeaks() {
|
static void MallocSpyDumpLeaks(void) {
|
||||||
TRACE("leaks: %lu\n", Malloc32.SpyedAllocationsLeft);
|
TRACE("leaks: %lu\n", Malloc32.SpyedAllocationsLeft);
|
||||||
}
|
}
|
||||||
|
|
||||||
static IMallocSpyVtbl VT_IMallocSpy =
|
static const IMallocSpyVtbl VT_IMallocSpy =
|
||||||
{
|
{
|
||||||
IMallocSpy_fnQueryInterface,
|
IMallocSpy_fnQueryInterface,
|
||||||
IMallocSpy_fnAddRef,
|
IMallocSpy_fnAddRef,
|
||||||
|
|
|
@ -45,12 +45,12 @@ const CLSID CLSID_ItemMoniker = {
|
||||||
/* ItemMoniker data structure */
|
/* ItemMoniker data structure */
|
||||||
typedef struct ItemMonikerImpl{
|
typedef struct ItemMonikerImpl{
|
||||||
|
|
||||||
IMonikerVtbl* lpvtbl1; /* VTable relative to the IMoniker interface.*/
|
const IMonikerVtbl* lpvtbl1; /* VTable relative to the IMoniker interface.*/
|
||||||
|
|
||||||
/* The ROT (RunningObjectTable implementation) uses the IROTData interface to test whether
|
/* The ROT (RunningObjectTable implementation) uses the IROTData interface to test whether
|
||||||
* two monikers are equal. That's whay IROTData interface is implemented by monikers.
|
* two monikers are equal. That's whay IROTData interface is implemented by monikers.
|
||||||
*/
|
*/
|
||||||
IROTDataVtbl* lpvtbl2; /* VTable relative to the IROTData interface.*/
|
const IROTDataVtbl* lpvtbl2; /* VTable relative to the IROTData interface.*/
|
||||||
|
|
||||||
ULONG ref; /* reference counter for this object */
|
ULONG ref; /* reference counter for this object */
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ static HRESULT WINAPI ItemMonikerROTDataImpl_GetComparisonData(IROTData* iface,B
|
||||||
/********************************************************************************/
|
/********************************************************************************/
|
||||||
/* Virtual function table for the ItemMonikerImpl class which include IPersist,*/
|
/* Virtual function table for the ItemMonikerImpl class which include IPersist,*/
|
||||||
/* IPersistStream and IMoniker functions. */
|
/* IPersistStream and IMoniker functions. */
|
||||||
static IMonikerVtbl VT_ItemMonikerImpl =
|
static const IMonikerVtbl VT_ItemMonikerImpl =
|
||||||
{
|
{
|
||||||
ItemMonikerImpl_QueryInterface,
|
ItemMonikerImpl_QueryInterface,
|
||||||
ItemMonikerImpl_AddRef,
|
ItemMonikerImpl_AddRef,
|
||||||
|
@ -142,7 +142,7 @@ static IMonikerVtbl VT_ItemMonikerImpl =
|
||||||
|
|
||||||
/********************************************************************************/
|
/********************************************************************************/
|
||||||
/* Virtual function table for the IROTData class. */
|
/* Virtual function table for the IROTData class. */
|
||||||
static IROTDataVtbl VT_ROTDataImpl =
|
static const IROTDataVtbl VT_ROTDataImpl =
|
||||||
{
|
{
|
||||||
ItemMonikerROTDataImpl_QueryInterface,
|
ItemMonikerROTDataImpl_QueryInterface,
|
||||||
ItemMonikerROTDataImpl_AddRef,
|
ItemMonikerROTDataImpl_AddRef,
|
||||||
|
|
|
@ -90,28 +90,36 @@ HRESULT marshal_object(APARTMENT *apt, STDOBJREF *stdobjref, REFIID riid, IUnkno
|
||||||
struct stub_manager *manager;
|
struct stub_manager *manager;
|
||||||
struct ifstub *ifstub;
|
struct ifstub *ifstub;
|
||||||
BOOL tablemarshal;
|
BOOL tablemarshal;
|
||||||
IRpcStubBuffer *stub;
|
IRpcStubBuffer *stub = NULL;
|
||||||
IPSFactoryBuffer *psfb;
|
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
hr = apartment_getoxid(apt, &stdobjref->oxid);
|
hr = apartment_getoxid(apt, &stdobjref->oxid);
|
||||||
if (hr != S_OK)
|
if (hr != S_OK)
|
||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
hr = get_facbuf_for_iid(riid, &psfb);
|
/* IUnknown doesn't require a stub buffer, because it never goes out on
|
||||||
if (hr != S_OK)
|
* the wire */
|
||||||
|
if (!IsEqualIID(riid, &IID_IUnknown))
|
||||||
{
|
{
|
||||||
ERR("couldn't get IPSFactory buffer for interface %s\n", debugstr_guid(riid));
|
IPSFactoryBuffer *psfb;
|
||||||
return hr;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr = IPSFactoryBuffer_CreateStub(psfb, riid, obj, &stub);
|
hr = get_facbuf_for_iid(riid, &psfb);
|
||||||
IPSFactoryBuffer_Release(psfb);
|
if (hr != S_OK)
|
||||||
if (hr != S_OK)
|
{
|
||||||
{
|
ERR("couldn't get IPSFactory buffer for interface %s\n", debugstr_guid(riid));
|
||||||
ERR("Failed to create an IRpcStubBuffer from IPSFactory for %s\n", debugstr_guid(riid));
|
return hr;
|
||||||
return hr;
|
}
|
||||||
|
|
||||||
|
hr = IPSFactoryBuffer_CreateStub(psfb, riid, obj, &stub);
|
||||||
|
IPSFactoryBuffer_Release(psfb);
|
||||||
|
if (hr != S_OK)
|
||||||
|
{
|
||||||
|
ERR("Failed to create an IRpcStubBuffer from IPSFactory for %s\n", debugstr_guid(riid));
|
||||||
|
return hr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else /* need to addref object anyway */
|
||||||
|
IUnknown_AddRef(obj);
|
||||||
|
|
||||||
if (mshlflags & MSHLFLAGS_NOPING)
|
if (mshlflags & MSHLFLAGS_NOPING)
|
||||||
stdobjref->flags = SORF_NOPING;
|
stdobjref->flags = SORF_NOPING;
|
||||||
|
@ -129,7 +137,7 @@ HRESULT marshal_object(APARTMENT *apt, STDOBJREF *stdobjref, REFIID riid, IUnkno
|
||||||
manager = new_stub_manager(apt, obj, mshlflags);
|
manager = new_stub_manager(apt, obj, mshlflags);
|
||||||
if (!manager)
|
if (!manager)
|
||||||
{
|
{
|
||||||
IRpcStubBuffer_Release(stub);
|
if (stub) IRpcStubBuffer_Release(stub);
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -601,6 +609,12 @@ static void proxy_manager_disconnect(struct proxy_manager * This)
|
||||||
TRACE("oxid = %s, oid = %s\n", wine_dbgstr_longlong(This->oxid),
|
TRACE("oxid = %s, oid = %s\n", wine_dbgstr_longlong(This->oxid),
|
||||||
wine_dbgstr_longlong(This->oid));
|
wine_dbgstr_longlong(This->oid));
|
||||||
|
|
||||||
|
/* SORFP_NOLIFTIMEMGMT proxies (for IRemUnknown) shouldn't be
|
||||||
|
* disconnected - it won't do anything anyway, except cause
|
||||||
|
* problems for other objects that depend on this proxy always
|
||||||
|
* working */
|
||||||
|
if (This->sorflags & SORFP_NOLIFETIMEMGMT) return;
|
||||||
|
|
||||||
EnterCriticalSection(&This->cs);
|
EnterCriticalSection(&This->cs);
|
||||||
|
|
||||||
LIST_FOR_EACH(cursor, &This->interfaces)
|
LIST_FOR_EACH(cursor, &This->interfaces)
|
||||||
|
|
|
@ -52,7 +52,7 @@ struct HGLOBALLockBytesImpl
|
||||||
* Needs to be the first item in the struct
|
* Needs to be the first item in the struct
|
||||||
* since we want to cast this in an ILockBytes pointer
|
* since we want to cast this in an ILockBytes pointer
|
||||||
*/
|
*/
|
||||||
ILockBytesVtbl *lpVtbl;
|
const ILockBytesVtbl *lpVtbl;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Reference count
|
* Reference count
|
||||||
|
@ -139,7 +139,7 @@ HRESULT WINAPI HGLOBALLockBytesImpl_Stat(
|
||||||
/*
|
/*
|
||||||
* Virtual function table for the HGLOBALLockBytesImpl class.
|
* Virtual function table for the HGLOBALLockBytesImpl class.
|
||||||
*/
|
*/
|
||||||
static ILockBytesVtbl HGLOBALLockBytesImpl_Vtbl =
|
static const ILockBytesVtbl HGLOBALLockBytesImpl_Vtbl =
|
||||||
{
|
{
|
||||||
HGLOBALLockBytesImpl_QueryInterface,
|
HGLOBALLockBytesImpl_QueryInterface,
|
||||||
HGLOBALLockBytesImpl_AddRef,
|
HGLOBALLockBytesImpl_AddRef,
|
||||||
|
|
|
@ -52,7 +52,7 @@ struct HGLOBALLockBytesImpl16
|
||||||
* Needs to be the first item in the struct
|
* Needs to be the first item in the struct
|
||||||
* since we want to cast this in an ILockBytes pointer
|
* since we want to cast this in an ILockBytes pointer
|
||||||
*/
|
*/
|
||||||
ILockBytes16Vtbl *lpVtbl;
|
const ILockBytes16Vtbl *lpVtbl;
|
||||||
ULONG ref;
|
ULONG ref;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -176,7 +176,7 @@ HGLOBALLockBytesImpl16_Construct(HGLOBAL16 hGlobal,
|
||||||
#undef VTENT
|
#undef VTENT
|
||||||
msegvt16 = MapLS( &vt16 );
|
msegvt16 = MapLS( &vt16 );
|
||||||
}
|
}
|
||||||
newLockBytes->lpVtbl = (ILockBytes16Vtbl*)msegvt16;
|
newLockBytes->lpVtbl = (const ILockBytes16Vtbl*)msegvt16;
|
||||||
newLockBytes->ref = 0;
|
newLockBytes->ref = 0;
|
||||||
/*
|
/*
|
||||||
* Initialize the support.
|
* Initialize the support.
|
||||||
|
|
|
@ -716,7 +716,7 @@ HRESULT WINAPI CreateClassMoniker(REFCLSID rclsid, IMoniker ** ppmk)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Virtual function table for the IRunningObjectTable class. */
|
/* Virtual function table for the IRunningObjectTable class. */
|
||||||
static IRunningObjectTableVtbl VT_RunningObjectTableImpl =
|
static const IRunningObjectTableVtbl VT_RunningObjectTableImpl =
|
||||||
{
|
{
|
||||||
RunningObjectTableImpl_QueryInterface,
|
RunningObjectTableImpl_QueryInterface,
|
||||||
RunningObjectTableImpl_AddRef,
|
RunningObjectTableImpl_AddRef,
|
||||||
|
@ -968,7 +968,7 @@ static HRESULT WINAPI EnumMonikerImpl_CreateEnumROTMoniker(MInterfacePointer **m
|
||||||
|
|
||||||
/* the initial reference is set to "1" */
|
/* the initial reference is set to "1" */
|
||||||
This->ref = 1; /* set the ref count to one */
|
This->ref = 1; /* set the ref count to one */
|
||||||
This->pos = 0; /* Set the list start posn to start */
|
This->pos = current_pos; /* Set the list start posn */
|
||||||
This->moniker_count = moniker_count; /* Need the same size table as ROT */
|
This->moniker_count = moniker_count; /* Need the same size table as ROT */
|
||||||
This->monikers = monikers;
|
This->monikers = monikers;
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
extern const CLSID CLSID_FileMoniker;
|
extern const CLSID CLSID_FileMoniker;
|
||||||
extern const CLSID CLSID_ItemMoniker;
|
extern const CLSID CLSID_ItemMoniker;
|
||||||
extern const CLSID CLSID_AntiMoniker;
|
extern const CLSID CLSID_AntiMoniker;
|
||||||
extern const CLSID CLSID_CompositeMoniker;
|
|
||||||
|
|
||||||
HRESULT FileMonikerCF_Create(REFIID riid, LPVOID *ppv);
|
HRESULT FileMonikerCF_Create(REFIID riid, LPVOID *ppv);
|
||||||
HRESULT ItemMonikerCF_Create(REFIID riid, LPVOID *ppv);
|
HRESULT ItemMonikerCF_Create(REFIID riid, LPVOID *ppv);
|
||||||
|
|
|
@ -50,10 +50,10 @@
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(ole);
|
WINE_DEFAULT_DEBUG_CHANNEL(ole);
|
||||||
|
|
||||||
HTASK16 hETask = 0;
|
static HTASK16 hETask = 0;
|
||||||
WORD Table_ETask[62];
|
static WORD Table_ETask[62];
|
||||||
|
|
||||||
LPMALLOC16 currentMalloc16=NULL;
|
static LPMALLOC16 currentMalloc16=NULL;
|
||||||
|
|
||||||
/* --- IMalloc16 implementation */
|
/* --- IMalloc16 implementation */
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ LPMALLOC16 currentMalloc16=NULL;
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
/* IUnknown fields */
|
/* IUnknown fields */
|
||||||
IMalloc16Vtbl *lpVtbl;
|
const IMalloc16Vtbl *lpVtbl;
|
||||||
DWORD ref;
|
DWORD ref;
|
||||||
/* IMalloc16 fields */
|
/* IMalloc16 fields */
|
||||||
} IMalloc16Impl;
|
} IMalloc16Impl;
|
||||||
|
@ -196,7 +196,7 @@ IMalloc16_Constructor()
|
||||||
#undef VTENT
|
#undef VTENT
|
||||||
msegvt16 = MapLS( &vt16 );
|
msegvt16 = MapLS( &vt16 );
|
||||||
}
|
}
|
||||||
This->lpVtbl = (IMalloc16Vtbl*)msegvt16;
|
This->lpVtbl = (const IMalloc16Vtbl*)msegvt16;
|
||||||
This->ref = 1;
|
This->ref = 1;
|
||||||
return (LPMALLOC16)MapLS( This );
|
return (LPMALLOC16)MapLS( This );
|
||||||
}
|
}
|
||||||
|
@ -310,7 +310,7 @@ _xmalloc16(DWORD size, SEGPTR *ptr) {
|
||||||
* everything we need.
|
* everything we need.
|
||||||
*/
|
*/
|
||||||
if (!K32WOWCallback16Ex(
|
if (!K32WOWCallback16Ex(
|
||||||
(DWORD)((IMalloc16Vtbl*)MapSL(
|
(DWORD)((const IMalloc16Vtbl*)MapSL(
|
||||||
(SEGPTR)((LPMALLOC16)MapSL((SEGPTR)mllc))->lpVtbl )
|
(SEGPTR)((LPMALLOC16)MapSL((SEGPTR)mllc))->lpVtbl )
|
||||||
)->Alloc,
|
)->Alloc,
|
||||||
WCB16_CDECL,
|
WCB16_CDECL,
|
||||||
|
@ -356,23 +356,22 @@ HRESULT WINAPI ProgIDFromCLSID16(
|
||||||
REFCLSID clsid, /* [in] class id as found in registry */
|
REFCLSID clsid, /* [in] class id as found in registry */
|
||||||
LPOLESTR16 *lplpszProgID/* [out] associated Prog ID */
|
LPOLESTR16 *lplpszProgID/* [out] associated Prog ID */
|
||||||
) {
|
) {
|
||||||
char strCLSID[50], *buf, *buf2;
|
static const WCHAR wszProgID[] = {'P','r','o','g','I','D',0};
|
||||||
DWORD buf2len;
|
|
||||||
HKEY xhkey;
|
HKEY xhkey;
|
||||||
|
HKEY hkey;
|
||||||
HRESULT ret = S_OK;
|
HRESULT ret = S_OK;
|
||||||
|
|
||||||
WINE_StringFromCLSID(clsid, strCLSID);
|
if (COM_OpenKeyForCLSID(clsid, KEY_READ, &hkey))
|
||||||
|
|
||||||
buf = HeapAlloc(GetProcessHeap(), 0, strlen(strCLSID)+14);
|
|
||||||
sprintf(buf,"CLSID\\%s\\ProgID", strCLSID);
|
|
||||||
if (RegOpenKeyA(HKEY_CLASSES_ROOT, buf, &xhkey))
|
|
||||||
ret = REGDB_E_CLASSNOTREG;
|
ret = REGDB_E_CLASSNOTREG;
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, buf);
|
if ((ret == S_OK) &&
|
||||||
|
RegOpenKeyW(hkey, wszProgID, &xhkey))
|
||||||
|
ret = REGDB_E_CLASSNOTREG;
|
||||||
|
|
||||||
if (ret == S_OK)
|
if (ret == S_OK)
|
||||||
{
|
{
|
||||||
buf2 = HeapAlloc(GetProcessHeap(), 0, 255);
|
DWORD buf2len;
|
||||||
|
char *buf2 = HeapAlloc(GetProcessHeap(), 0, 255);
|
||||||
buf2len = 255;
|
buf2len = 255;
|
||||||
if (RegQueryValueA(xhkey, NULL, buf2, &buf2len))
|
if (RegQueryValueA(xhkey, NULL, buf2, &buf2len))
|
||||||
ret = REGDB_E_CLASSNOTREG;
|
ret = REGDB_E_CLASSNOTREG;
|
||||||
|
@ -429,12 +428,8 @@ HRESULT WINAPI CoRegisterClassObject16(
|
||||||
DWORD flags, /* [in] REGCLS flags indicating how connections are made */
|
DWORD flags, /* [in] REGCLS flags indicating how connections are made */
|
||||||
LPDWORD lpdwRegister
|
LPDWORD lpdwRegister
|
||||||
) {
|
) {
|
||||||
char buf[80];
|
|
||||||
|
|
||||||
WINE_StringFromCLSID(rclsid,buf);
|
|
||||||
|
|
||||||
FIXME("(%s,%p,0x%08lx,0x%08lx,%p),stub\n",
|
FIXME("(%s,%p,0x%08lx,0x%08lx,%p),stub\n",
|
||||||
buf,pUnk,dwClsContext,flags,lpdwRegister
|
debugstr_guid(rclsid),pUnk,dwClsContext,flags,lpdwRegister
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,6 +46,7 @@
|
||||||
#include "ole2ver.h"
|
#include "ole2ver.h"
|
||||||
#include "wownt32.h"
|
#include "wownt32.h"
|
||||||
|
|
||||||
|
#include "wine/unicode.h"
|
||||||
#include "wine/winbase16.h"
|
#include "wine/winbase16.h"
|
||||||
#include "wine/wingdi16.h"
|
#include "wine/wingdi16.h"
|
||||||
#include "wine/winuser16.h"
|
#include "wine/winuser16.h"
|
||||||
|
@ -2294,20 +2295,20 @@ HRESULT WINAPI OleCreate(
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI OleSetAutoConvert(REFCLSID clsidOld, REFCLSID clsidNew)
|
HRESULT WINAPI OleSetAutoConvert(REFCLSID clsidOld, REFCLSID clsidNew)
|
||||||
{
|
{
|
||||||
HKEY hkey = 0;
|
static const WCHAR wszAutoConvertTo[] = {'A','u','t','o','C','o','n','v','e','r','t','T','o',0};
|
||||||
char buf[200], szClsidNew[200];
|
HKEY hkey = NULL;
|
||||||
|
WCHAR szClsidNew[CHARS_IN_GUID];
|
||||||
HRESULT res = S_OK;
|
HRESULT res = S_OK;
|
||||||
|
|
||||||
/* FIXME: convert to Unicode */
|
|
||||||
TRACE("(%s,%s)\n", debugstr_guid(clsidOld), debugstr_guid(clsidNew));
|
TRACE("(%s,%s)\n", debugstr_guid(clsidOld), debugstr_guid(clsidNew));
|
||||||
sprintf(buf,"CLSID\\");WINE_StringFromCLSID(clsidOld,&buf[6]);
|
|
||||||
WINE_StringFromCLSID(clsidNew, szClsidNew);
|
if (COM_OpenKeyForCLSID(clsidOld, KEY_READ | KEY_WRITE, &hkey))
|
||||||
if (RegOpenKeyA(HKEY_CLASSES_ROOT,buf,&hkey))
|
|
||||||
{
|
{
|
||||||
res = REGDB_E_CLASSNOTREG;
|
res = REGDB_E_CLASSNOTREG;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (RegSetValueA(hkey, "AutoConvertTo", REG_SZ, szClsidNew, strlen(szClsidNew)+1))
|
StringFromGUID2(clsidNew, szClsidNew, CHARS_IN_GUID);
|
||||||
|
if (RegSetValueW(hkey, wszAutoConvertTo, REG_SZ, szClsidNew, (strlenW(szClsidNew)+1) * sizeof(WCHAR)))
|
||||||
{
|
{
|
||||||
res = REGDB_E_WRITEREGDB;
|
res = REGDB_E_WRITEREGDB;
|
||||||
goto done;
|
goto done;
|
||||||
|
|
|
@ -65,8 +65,8 @@
|
||||||
@ stdcall CoRevokeMallocSpy()
|
@ stdcall CoRevokeMallocSpy()
|
||||||
@ stdcall CoSetProxyBlanket(ptr long long wstr long long ptr long)
|
@ stdcall CoSetProxyBlanket(ptr long long wstr long long ptr long)
|
||||||
@ stdcall CoSetState(ptr)
|
@ stdcall CoSetState(ptr)
|
||||||
@ stub CoSwitchCallContext
|
|
||||||
@ stdcall CoSuspendClassObjects()
|
@ stdcall CoSuspendClassObjects()
|
||||||
|
@ stub CoSwitchCallContext
|
||||||
@ stdcall CoTaskMemAlloc(long)
|
@ stdcall CoTaskMemAlloc(long)
|
||||||
@ stdcall CoTaskMemFree(ptr)
|
@ stdcall CoTaskMemFree(ptr)
|
||||||
@ stdcall CoTaskMemRealloc(ptr long)
|
@ stdcall CoTaskMemRealloc(ptr long)
|
||||||
|
@ -146,8 +146,8 @@
|
||||||
@ stub HWND_UserMarshal
|
@ stub HWND_UserMarshal
|
||||||
@ stub HWND_UserSize
|
@ stub HWND_UserSize
|
||||||
@ stub HWND_UserUnmarshal
|
@ stub HWND_UserUnmarshal
|
||||||
@ stub I_RemoteMain
|
|
||||||
@ stdcall IIDFromString(wstr ptr) CLSIDFromString
|
@ stdcall IIDFromString(wstr ptr) CLSIDFromString
|
||||||
|
@ stub I_RemoteMain
|
||||||
@ stdcall IsAccelerator(long long ptr long)
|
@ stdcall IsAccelerator(long long ptr long)
|
||||||
@ stdcall IsEqualGUID(ptr ptr)
|
@ stdcall IsEqualGUID(ptr ptr)
|
||||||
@ stub IsValidIid
|
@ stub IsValidIid
|
||||||
|
@ -226,13 +226,17 @@
|
||||||
@ stdcall RegisterDragDrop(long ptr)
|
@ stdcall RegisterDragDrop(long ptr)
|
||||||
@ stdcall ReleaseStgMedium(ptr)
|
@ stdcall ReleaseStgMedium(ptr)
|
||||||
@ stdcall RevokeDragDrop(long)
|
@ stdcall RevokeDragDrop(long)
|
||||||
@ stdcall SetConvertStg(ptr long)
|
|
||||||
@ stub SetDocumentBitStg
|
|
||||||
@ stdcall SetErrorInfo(long ptr)
|
|
||||||
@ stub SNB_UserFree
|
@ stub SNB_UserFree
|
||||||
@ stub SNB_UserMarshal
|
@ stub SNB_UserMarshal
|
||||||
@ stub SNB_UserSize
|
@ stub SNB_UserSize
|
||||||
@ stub SNB_UserUnmarshal
|
@ stub SNB_UserUnmarshal
|
||||||
|
@ stub STGMEDIUM_UserFree
|
||||||
|
@ stub STGMEDIUM_UserMarshal
|
||||||
|
@ stub STGMEDIUM_UserSize
|
||||||
|
@ stub STGMEDIUM_UserUnmarshal
|
||||||
|
@ stdcall SetConvertStg(ptr long)
|
||||||
|
@ stub SetDocumentBitStg
|
||||||
|
@ stdcall SetErrorInfo(long ptr)
|
||||||
@ stdcall StgCreateDocfile(wstr long long ptr)
|
@ stdcall StgCreateDocfile(wstr long long ptr)
|
||||||
@ stdcall StgCreateDocfileOnILockBytes(ptr long long ptr)
|
@ stdcall StgCreateDocfileOnILockBytes(ptr long long ptr)
|
||||||
@ stdcall StgCreatePropSetStg(ptr long ptr)
|
@ stdcall StgCreatePropSetStg(ptr long ptr)
|
||||||
|
@ -241,10 +245,6 @@
|
||||||
@ stub StgGetIFillLockBytesOnILockBytes
|
@ stub StgGetIFillLockBytesOnILockBytes
|
||||||
@ stdcall StgIsStorageFile(wstr)
|
@ stdcall StgIsStorageFile(wstr)
|
||||||
@ stdcall StgIsStorageILockBytes(ptr)
|
@ stdcall StgIsStorageILockBytes(ptr)
|
||||||
@ stub STGMEDIUM_UserFree
|
|
||||||
@ stub STGMEDIUM_UserMarshal
|
|
||||||
@ stub STGMEDIUM_UserSize
|
|
||||||
@ stub STGMEDIUM_UserUnmarshal
|
|
||||||
@ stub StgOpenAsyncDocfileOnIFillLockBytes
|
@ stub StgOpenAsyncDocfileOnIFillLockBytes
|
||||||
@ stdcall StgOpenStorage(wstr ptr long ptr long ptr)
|
@ stdcall StgOpenStorage(wstr ptr long ptr long ptr)
|
||||||
@ stdcall StgOpenStorageEx(wstr long long long ptr ptr ptr ptr)
|
@ stdcall StgOpenStorageEx(wstr long long long ptr ptr ptr ptr)
|
||||||
|
|
|
@ -41,7 +41,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ole);
|
||||||
*/
|
*/
|
||||||
typedef struct OleAdviseHolderImpl
|
typedef struct OleAdviseHolderImpl
|
||||||
{
|
{
|
||||||
IOleAdviseHolderVtbl *lpVtbl;
|
const IOleAdviseHolderVtbl *lpVtbl;
|
||||||
|
|
||||||
DWORD ref;
|
DWORD ref;
|
||||||
|
|
||||||
|
@ -306,7 +306,7 @@ OleAdviseHolderImpl_SendOnClose (LPOLEADVISEHOLDER iface)
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* OleAdviseHolderImpl_VTable
|
* OleAdviseHolderImpl_VTable
|
||||||
*/
|
*/
|
||||||
static struct IOleAdviseHolderVtbl oahvt =
|
static const IOleAdviseHolderVtbl oahvt =
|
||||||
{
|
{
|
||||||
OleAdviseHolderImpl_QueryInterface,
|
OleAdviseHolderImpl_QueryInterface,
|
||||||
OleAdviseHolderImpl_AddRef,
|
OleAdviseHolderImpl_AddRef,
|
||||||
|
@ -323,7 +323,7 @@ static struct IOleAdviseHolderVtbl oahvt =
|
||||||
* OleAdviseHolderImpl_Constructor
|
* OleAdviseHolderImpl_Constructor
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static LPOLEADVISEHOLDER OleAdviseHolderImpl_Constructor()
|
static LPOLEADVISEHOLDER OleAdviseHolderImpl_Constructor(void)
|
||||||
{
|
{
|
||||||
OleAdviseHolderImpl* lpoah;
|
OleAdviseHolderImpl* lpoah;
|
||||||
DWORD index;
|
DWORD index;
|
||||||
|
@ -355,7 +355,7 @@ typedef struct DataAdviseConnection {
|
||||||
|
|
||||||
typedef struct DataAdviseHolder
|
typedef struct DataAdviseHolder
|
||||||
{
|
{
|
||||||
IDataAdviseHolderVtbl *lpVtbl;
|
const IDataAdviseHolderVtbl *lpVtbl;
|
||||||
|
|
||||||
DWORD ref;
|
DWORD ref;
|
||||||
DWORD maxCons;
|
DWORD maxCons;
|
||||||
|
@ -625,7 +625,7 @@ static HRESULT WINAPI DataAdviseHolder_SendOnDataChange(
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* DataAdviseHolderImpl_VTable
|
* DataAdviseHolderImpl_VTable
|
||||||
*/
|
*/
|
||||||
static struct IDataAdviseHolderVtbl DataAdviseHolderImpl_VTable =
|
static const IDataAdviseHolderVtbl DataAdviseHolderImpl_VTable =
|
||||||
{
|
{
|
||||||
DataAdviseHolder_QueryInterface,
|
DataAdviseHolder_QueryInterface,
|
||||||
DataAdviseHolder_AddRef,
|
DataAdviseHolder_AddRef,
|
||||||
|
@ -639,7 +639,7 @@ static struct IDataAdviseHolderVtbl DataAdviseHolderImpl_VTable =
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* DataAdviseHolder_Constructor
|
* DataAdviseHolder_Constructor
|
||||||
*/
|
*/
|
||||||
static IDataAdviseHolder* DataAdviseHolder_Constructor()
|
static IDataAdviseHolder* DataAdviseHolder_Constructor(void)
|
||||||
{
|
{
|
||||||
DataAdviseHolder* newHolder;
|
DataAdviseHolder* newHolder;
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ const CLSID CLSID_PSFactoryBuffer = { 0x00000320, 0, 0, {0xc0, 0, 0, 0, 0, 0, 0,
|
||||||
* COM will load the appropriate interface stubs and proxies as needed.
|
* COM will load the appropriate interface stubs and proxies as needed.
|
||||||
*/
|
*/
|
||||||
typedef struct _CFStub {
|
typedef struct _CFStub {
|
||||||
IRpcStubBufferVtbl *lpvtbl;
|
const IRpcStubBufferVtbl *lpvtbl;
|
||||||
DWORD ref;
|
DWORD ref;
|
||||||
|
|
||||||
LPUNKNOWN pUnkServer;
|
LPUNKNOWN pUnkServer;
|
||||||
|
@ -237,7 +237,7 @@ CFStub_DebugServerRelease(LPRPCSTUBBUFFER iface,void *pv) {
|
||||||
FIXME("(%p), stub!\n",pv);
|
FIXME("(%p), stub!\n",pv);
|
||||||
}
|
}
|
||||||
|
|
||||||
static IRpcStubBufferVtbl cfstubvt = {
|
static const IRpcStubBufferVtbl cfstubvt = {
|
||||||
CFStub_QueryInterface,
|
CFStub_QueryInterface,
|
||||||
CFStub_AddRef,
|
CFStub_AddRef,
|
||||||
CFStub_Release,
|
CFStub_Release,
|
||||||
|
@ -296,7 +296,8 @@ static ULONG WINAPI IRpcProxyBufferImpl_Release(LPRPCPROXYBUFFER iface) {
|
||||||
ULONG ref = InterlockedDecrement(&This->ref);
|
ULONG ref = InterlockedDecrement(&This->ref);
|
||||||
|
|
||||||
if (!ref) {
|
if (!ref) {
|
||||||
IRpcChannelBuffer_Release(This->chanbuf);This->chanbuf = NULL;
|
IRpcChannelBuffer_Release(This->chanbuf);
|
||||||
|
This->chanbuf = NULL;
|
||||||
HeapFree(GetProcessHeap(),0,This);
|
HeapFree(GetProcessHeap(),0,This);
|
||||||
}
|
}
|
||||||
return ref;
|
return ref;
|
||||||
|
@ -420,14 +421,14 @@ static HRESULT WINAPI CFProxy_LockServer(LPCLASSFACTORY iface,BOOL fLock) {
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static IRpcProxyBufferVtbl pspbvtbl = {
|
static const IRpcProxyBufferVtbl pspbvtbl = {
|
||||||
IRpcProxyBufferImpl_QueryInterface,
|
IRpcProxyBufferImpl_QueryInterface,
|
||||||
IRpcProxyBufferImpl_AddRef,
|
IRpcProxyBufferImpl_AddRef,
|
||||||
IRpcProxyBufferImpl_Release,
|
IRpcProxyBufferImpl_Release,
|
||||||
IRpcProxyBufferImpl_Connect,
|
IRpcProxyBufferImpl_Connect,
|
||||||
IRpcProxyBufferImpl_Disconnect
|
IRpcProxyBufferImpl_Disconnect
|
||||||
};
|
};
|
||||||
static IClassFactoryVtbl cfproxyvt = {
|
static const IClassFactoryVtbl cfproxyvt = {
|
||||||
CFProxy_QueryInterface,
|
CFProxy_QueryInterface,
|
||||||
CFProxy_AddRef,
|
CFProxy_AddRef,
|
||||||
CFProxy_Release,
|
CFProxy_Release,
|
||||||
|
@ -846,13 +847,14 @@ static HRESULT WINAPI RURpcProxyBufferImpl_QueryInterface(LPRPCPROXYBUFFER iface
|
||||||
|
|
||||||
static ULONG WINAPI RURpcProxyBufferImpl_AddRef(LPRPCPROXYBUFFER iface) {
|
static ULONG WINAPI RURpcProxyBufferImpl_AddRef(LPRPCPROXYBUFFER iface) {
|
||||||
ICOM_THIS_MULTI(RemUnkProxy,lpvtbl_proxy,iface);
|
ICOM_THIS_MULTI(RemUnkProxy,lpvtbl_proxy,iface);
|
||||||
|
TRACE("%p, %ld\n", iface, This->refs + 1);
|
||||||
return InterlockedIncrement(&This->refs);
|
return InterlockedIncrement(&This->refs);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ULONG WINAPI RURpcProxyBufferImpl_Release(LPRPCPROXYBUFFER iface) {
|
static ULONG WINAPI RURpcProxyBufferImpl_Release(LPRPCPROXYBUFFER iface) {
|
||||||
ICOM_THIS_MULTI(RemUnkProxy,lpvtbl_proxy,iface);
|
ICOM_THIS_MULTI(RemUnkProxy,lpvtbl_proxy,iface);
|
||||||
ULONG ref = InterlockedDecrement(&This->refs);
|
ULONG ref = InterlockedDecrement(&This->refs);
|
||||||
|
TRACE("%p, %ld\n", iface, ref);
|
||||||
if (!ref) {
|
if (!ref) {
|
||||||
IRpcChannelBuffer_Release(This->chan);This->chan = NULL;
|
IRpcChannelBuffer_Release(This->chan);This->chan = NULL;
|
||||||
HeapFree(GetProcessHeap(),0,This);
|
HeapFree(GetProcessHeap(),0,This);
|
||||||
|
@ -863,12 +865,14 @@ static ULONG WINAPI RURpcProxyBufferImpl_Release(LPRPCPROXYBUFFER iface) {
|
||||||
static HRESULT WINAPI RURpcProxyBufferImpl_Connect(LPRPCPROXYBUFFER iface,IRpcChannelBuffer* pRpcChannelBuffer) {
|
static HRESULT WINAPI RURpcProxyBufferImpl_Connect(LPRPCPROXYBUFFER iface,IRpcChannelBuffer* pRpcChannelBuffer) {
|
||||||
ICOM_THIS_MULTI(RemUnkProxy,lpvtbl_proxy,iface);
|
ICOM_THIS_MULTI(RemUnkProxy,lpvtbl_proxy,iface);
|
||||||
|
|
||||||
|
TRACE("%p, %p\n", iface, pRpcChannelBuffer);
|
||||||
This->chan = pRpcChannelBuffer;
|
This->chan = pRpcChannelBuffer;
|
||||||
IRpcChannelBuffer_AddRef(This->chan);
|
IRpcChannelBuffer_AddRef(This->chan);
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
static void WINAPI RURpcProxyBufferImpl_Disconnect(LPRPCPROXYBUFFER iface) {
|
static void WINAPI RURpcProxyBufferImpl_Disconnect(LPRPCPROXYBUFFER iface) {
|
||||||
ICOM_THIS_MULTI(RemUnkProxy,lpvtbl_proxy,iface);
|
ICOM_THIS_MULTI(RemUnkProxy,lpvtbl_proxy,iface);
|
||||||
|
TRACE("%p, %p\n", iface, This->chan);
|
||||||
if (This->chan) {
|
if (This->chan) {
|
||||||
IRpcChannelBuffer_Release(This->chan);
|
IRpcChannelBuffer_Release(This->chan);
|
||||||
This->chan = NULL;
|
This->chan = NULL;
|
||||||
|
@ -956,7 +960,7 @@ PSFacBuf_CreateStub(
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static IPSFactoryBufferVtbl psfacbufvtbl = {
|
static const IPSFactoryBufferVtbl psfacbufvtbl = {
|
||||||
PSFacBuf_QueryInterface,
|
PSFacBuf_QueryInterface,
|
||||||
PSFacBuf_AddRef,
|
PSFacBuf_AddRef,
|
||||||
PSFacBuf_Release,
|
PSFacBuf_Release,
|
||||||
|
@ -965,7 +969,7 @@ static IPSFactoryBufferVtbl psfacbufvtbl = {
|
||||||
};
|
};
|
||||||
|
|
||||||
/* This is the whole PSFactoryBuffer object, just the vtableptr */
|
/* This is the whole PSFactoryBuffer object, just the vtableptr */
|
||||||
static IPSFactoryBufferVtbl *lppsfac = &psfacbufvtbl;
|
static const IPSFactoryBufferVtbl *lppsfac = &psfacbufvtbl;
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* DllGetClassObject [OLE32.@]
|
* DllGetClassObject [OLE32.@]
|
||||||
|
|
|
@ -452,18 +452,31 @@ static struct regsvr_coclass const coclass_list[] = {
|
||||||
|
|
||||||
#define INTERFACE_ENTRY(interface, base, clsid32, clsid16) { &IID_##interface, #interface, base, sizeof(interface##Vtbl)/sizeof(void*), clsid16, clsid32 }
|
#define INTERFACE_ENTRY(interface, base, clsid32, clsid16) { &IID_##interface, #interface, base, sizeof(interface##Vtbl)/sizeof(void*), clsid16, clsid32 }
|
||||||
#define STD_INTERFACE_ENTRY(interface) INTERFACE_ENTRY(interface, NULL, &CLSID_PSFactoryBuffer, NULL)
|
#define STD_INTERFACE_ENTRY(interface) INTERFACE_ENTRY(interface, NULL, &CLSID_PSFactoryBuffer, NULL)
|
||||||
|
#define LCL_INTERFACE_ENTRY(interface) INTERFACE_ENTRY(interface, NULL, NULL, NULL)
|
||||||
|
|
||||||
static struct regsvr_interface const interface_list[] = {
|
static const struct regsvr_interface interface_list[] = {
|
||||||
STD_INTERFACE_ENTRY(IUnknown),
|
LCL_INTERFACE_ENTRY(IUnknown),
|
||||||
STD_INTERFACE_ENTRY(IClassFactory),
|
STD_INTERFACE_ENTRY(IClassFactory),
|
||||||
|
LCL_INTERFACE_ENTRY(IMalloc),
|
||||||
|
LCL_INTERFACE_ENTRY(IMarshal),
|
||||||
STD_INTERFACE_ENTRY(IStorage),
|
STD_INTERFACE_ENTRY(IStorage),
|
||||||
STD_INTERFACE_ENTRY(IStream ),
|
LCL_INTERFACE_ENTRY(IMessageFilter),
|
||||||
|
LCL_INTERFACE_ENTRY(IStdMarshalInfo),
|
||||||
|
LCL_INTERFACE_ENTRY(IExternalConnection),
|
||||||
|
LCL_INTERFACE_ENTRY(IMallocSpy),
|
||||||
|
LCL_INTERFACE_ENTRY(IMultiQI),
|
||||||
|
STD_INTERFACE_ENTRY(IStream),
|
||||||
STD_INTERFACE_ENTRY(IPersistStorage),
|
STD_INTERFACE_ENTRY(IPersistStorage),
|
||||||
STD_INTERFACE_ENTRY(IDataObject),
|
STD_INTERFACE_ENTRY(IDataObject),
|
||||||
STD_INTERFACE_ENTRY(IAdviseSink),
|
STD_INTERFACE_ENTRY(IAdviseSink),
|
||||||
|
LCL_INTERFACE_ENTRY(IDataAdviseHolder),
|
||||||
|
LCL_INTERFACE_ENTRY(IOleAdviseHolder),
|
||||||
STD_INTERFACE_ENTRY(IOleObject),
|
STD_INTERFACE_ENTRY(IOleObject),
|
||||||
STD_INTERFACE_ENTRY(IOleClientSite),
|
STD_INTERFACE_ENTRY(IOleClientSite),
|
||||||
|
LCL_INTERFACE_ENTRY(IDropSource),
|
||||||
STD_INTERFACE_ENTRY(IRemUnknown),
|
STD_INTERFACE_ENTRY(IRemUnknown),
|
||||||
|
LCL_INTERFACE_ENTRY(IClientSecurity),
|
||||||
|
LCL_INTERFACE_ENTRY(IServerSecurity),
|
||||||
{ NULL } /* list terminator */
|
{ NULL } /* list terminator */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -569,24 +569,27 @@ void RPC_StartRemoting(struct apartment *apt)
|
||||||
|
|
||||||
static HRESULT create_server(REFCLSID rclsid)
|
static HRESULT create_server(REFCLSID rclsid)
|
||||||
{
|
{
|
||||||
|
static const WCHAR wszLocalServer32[] = { 'L','o','c','a','l','S','e','r','v','e','r','3','2',0 };
|
||||||
static const WCHAR embedding[] = { ' ', '-','E','m','b','e','d','d','i','n','g',0 };
|
static const WCHAR embedding[] = { ' ', '-','E','m','b','e','d','d','i','n','g',0 };
|
||||||
|
HKEY hkeyclsid;
|
||||||
HKEY key;
|
HKEY key;
|
||||||
char buf[200];
|
|
||||||
HRESULT hres = E_UNEXPECTED;
|
HRESULT hres = E_UNEXPECTED;
|
||||||
char xclsid[80];
|
|
||||||
WCHAR exe[MAX_PATH+1];
|
WCHAR exe[MAX_PATH+1];
|
||||||
DWORD exelen = sizeof(exe);
|
DWORD exelen = sizeof(exe);
|
||||||
WCHAR command[MAX_PATH+sizeof(embedding)/sizeof(WCHAR)];
|
WCHAR command[MAX_PATH+sizeof(embedding)/sizeof(WCHAR)];
|
||||||
STARTUPINFOW sinfo;
|
STARTUPINFOW sinfo;
|
||||||
PROCESS_INFORMATION pinfo;
|
PROCESS_INFORMATION pinfo;
|
||||||
|
|
||||||
WINE_StringFromCLSID((LPCLSID)rclsid,xclsid);
|
hres = HRESULT_FROM_WIN32(COM_OpenKeyForCLSID(rclsid, KEY_READ, &hkeyclsid));
|
||||||
|
if (hres != S_OK) {
|
||||||
|
ERR("class %s not registered\n", debugstr_guid(rclsid));
|
||||||
|
return REGDB_E_READREGDB;
|
||||||
|
}
|
||||||
|
|
||||||
sprintf(buf,"CLSID\\%s\\LocalServer32",xclsid);
|
hres = RegOpenKeyExW(hkeyclsid, wszLocalServer32, 0, KEY_READ, &key);
|
||||||
hres = RegOpenKeyExA(HKEY_CLASSES_ROOT, buf, 0, KEY_READ, &key);
|
|
||||||
|
|
||||||
if (hres != ERROR_SUCCESS) {
|
if (hres != ERROR_SUCCESS) {
|
||||||
WARN("CLSID %s not registered as LocalServer32\n", xclsid);
|
WARN("class %s not registered as LocalServer32\n", debugstr_guid(rclsid));
|
||||||
return REGDB_E_READREGDB; /* Probably */
|
return REGDB_E_READREGDB; /* Probably */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -608,7 +611,7 @@ static HRESULT create_server(REFCLSID rclsid)
|
||||||
strcpyW(command, exe);
|
strcpyW(command, exe);
|
||||||
strcatW(command, embedding);
|
strcatW(command, embedding);
|
||||||
|
|
||||||
TRACE("activating local server '%s' for %s\n", debugstr_w(command), xclsid);
|
TRACE("activating local server %s for %s\n", debugstr_w(command), debugstr_guid(rclsid));
|
||||||
|
|
||||||
if (!CreateProcessW(exe, command, NULL, NULL, FALSE, 0, NULL, NULL, &sinfo, &pinfo)) {
|
if (!CreateProcessW(exe, command, NULL, NULL, FALSE, 0, NULL, NULL, &sinfo, &pinfo)) {
|
||||||
WARN("failed to run local server %s\n", debugstr_w(exe));
|
WARN("failed to run local server %s\n", debugstr_w(exe));
|
||||||
|
@ -663,8 +666,7 @@ static DWORD start_local_service(LPCWSTR name, DWORD num, LPWSTR *params)
|
||||||
static HRESULT create_local_service(REFCLSID rclsid)
|
static HRESULT create_local_service(REFCLSID rclsid)
|
||||||
{
|
{
|
||||||
HRESULT hres = REGDB_E_READREGDB;
|
HRESULT hres = REGDB_E_READREGDB;
|
||||||
WCHAR buf[40], keyname[50];
|
WCHAR buf[CHARS_IN_GUID], keyname[50];
|
||||||
static const WCHAR szClsId[] = { 'C','L','S','I','D','\\',0 };
|
|
||||||
static const WCHAR szAppId[] = { 'A','p','p','I','d',0 };
|
static const WCHAR szAppId[] = { 'A','p','p','I','d',0 };
|
||||||
static const WCHAR szAppIdKey[] = { 'A','p','p','I','d','\\',0 };
|
static const WCHAR szAppIdKey[] = { 'A','p','p','I','d','\\',0 };
|
||||||
static const WCHAR szLocalService[] = { 'L','o','c','a','l','S','e','r','v','i','c','e',0 };
|
static const WCHAR szLocalService[] = { 'L','o','c','a','l','S','e','r','v','i','c','e',0 };
|
||||||
|
@ -676,9 +678,7 @@ static HRESULT create_local_service(REFCLSID rclsid)
|
||||||
TRACE("Attempting to start Local service for %s\n", debugstr_guid(rclsid));
|
TRACE("Attempting to start Local service for %s\n", debugstr_guid(rclsid));
|
||||||
|
|
||||||
/* read the AppID value under the class's key */
|
/* read the AppID value under the class's key */
|
||||||
strcpyW(keyname,szClsId);
|
r = COM_OpenKeyForCLSID(rclsid, KEY_READ, &hkey);
|
||||||
StringFromGUID2(rclsid,&keyname[6],39);
|
|
||||||
r = RegOpenKeyExW(HKEY_CLASSES_ROOT, keyname, 0, KEY_READ, &hkey);
|
|
||||||
if (r!=ERROR_SUCCESS)
|
if (r!=ERROR_SUCCESS)
|
||||||
return hres;
|
return hres;
|
||||||
sz = sizeof buf;
|
sz = sizeof buf;
|
||||||
|
@ -725,14 +725,20 @@ static HRESULT create_local_service(REFCLSID rclsid)
|
||||||
return hres;
|
return hres;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PIPEPREF "\\\\.\\pipe\\"
|
|
||||||
|
static void get_localserver_pipe_name(WCHAR *pipefn, REFCLSID rclsid)
|
||||||
|
{
|
||||||
|
static const WCHAR wszPipeRef[] = {'\\','\\','.','\\','p','i','p','e','\\',0};
|
||||||
|
strcpyW(pipefn, wszPipeRef);
|
||||||
|
StringFromGUID2(rclsid, pipefn + sizeof(wszPipeRef)/sizeof(wszPipeRef[0]) - 1, CHARS_IN_GUID);
|
||||||
|
}
|
||||||
|
|
||||||
/* FIXME: should call to rpcss instead */
|
/* FIXME: should call to rpcss instead */
|
||||||
HRESULT RPC_GetLocalClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
|
HRESULT RPC_GetLocalClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
|
||||||
{
|
{
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
HANDLE hPipe;
|
HANDLE hPipe;
|
||||||
char pipefn[200];
|
WCHAR pipefn[100];
|
||||||
DWORD res, bufferlen;
|
DWORD res, bufferlen;
|
||||||
char marshalbuffer[200];
|
char marshalbuffer[200];
|
||||||
IStream *pStm;
|
IStream *pStm;
|
||||||
|
@ -744,14 +750,13 @@ HRESULT RPC_GetLocalClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
|
||||||
|
|
||||||
TRACE("rclsid=%s, iid=%s\n", debugstr_guid(rclsid), debugstr_guid(iid));
|
TRACE("rclsid=%s, iid=%s\n", debugstr_guid(rclsid), debugstr_guid(iid));
|
||||||
|
|
||||||
strcpy(pipefn,PIPEPREF);
|
get_localserver_pipe_name(pipefn, rclsid);
|
||||||
WINE_StringFromCLSID(rclsid,pipefn+strlen(PIPEPREF));
|
|
||||||
|
|
||||||
while (tries++ < MAXTRIES) {
|
while (tries++ < MAXTRIES) {
|
||||||
TRACE("waiting for %s\n", pipefn);
|
TRACE("waiting for %s\n", debugstr_w(pipefn));
|
||||||
|
|
||||||
WaitNamedPipeA( pipefn, NMPWAIT_WAIT_FOREVER );
|
WaitNamedPipeW( pipefn, NMPWAIT_WAIT_FOREVER );
|
||||||
hPipe = CreateFileA(pipefn, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0);
|
hPipe = CreateFileW(pipefn, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0);
|
||||||
if (hPipe == INVALID_HANDLE_VALUE) {
|
if (hPipe == INVALID_HANDLE_VALUE) {
|
||||||
if (tries == 1) {
|
if (tries == 1) {
|
||||||
if ( (hres = create_server(rclsid)) &&
|
if ( (hres = create_server(rclsid)) &&
|
||||||
|
@ -759,7 +764,7 @@ HRESULT RPC_GetLocalClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
|
||||||
return hres;
|
return hres;
|
||||||
Sleep(1000);
|
Sleep(1000);
|
||||||
} else {
|
} else {
|
||||||
WARN("Connecting to %s, no response yet, retrying: le is %lx\n",pipefn,GetLastError());
|
WARN("Connecting to %s, no response yet, retrying: le is %lx\n", debugstr_w(pipefn), GetLastError());
|
||||||
Sleep(1000);
|
Sleep(1000);
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
|
@ -804,7 +809,7 @@ static DWORD WINAPI local_server_thread(LPVOID param)
|
||||||
{
|
{
|
||||||
struct local_server_params * lsp = (struct local_server_params *)param;
|
struct local_server_params * lsp = (struct local_server_params *)param;
|
||||||
HANDLE hPipe;
|
HANDLE hPipe;
|
||||||
char pipefn[200];
|
WCHAR pipefn[100];
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
IStream *pStm = lsp->stream;
|
IStream *pStm = lsp->stream;
|
||||||
STATSTG ststg;
|
STATSTG ststg;
|
||||||
|
@ -816,18 +821,17 @@ static DWORD WINAPI local_server_thread(LPVOID param)
|
||||||
|
|
||||||
TRACE("Starting threader for %s.\n",debugstr_guid(&lsp->clsid));
|
TRACE("Starting threader for %s.\n",debugstr_guid(&lsp->clsid));
|
||||||
|
|
||||||
strcpy(pipefn,PIPEPREF);
|
get_localserver_pipe_name(pipefn, &lsp->clsid);
|
||||||
WINE_StringFromCLSID(&lsp->clsid,pipefn+strlen(PIPEPREF));
|
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, lsp);
|
HeapFree(GetProcessHeap(), 0, lsp);
|
||||||
|
|
||||||
hPipe = CreateNamedPipeA( pipefn, PIPE_ACCESS_DUPLEX,
|
hPipe = CreateNamedPipeW( pipefn, PIPE_ACCESS_DUPLEX,
|
||||||
PIPE_TYPE_BYTE|PIPE_WAIT, PIPE_UNLIMITED_INSTANCES,
|
PIPE_TYPE_BYTE|PIPE_WAIT, PIPE_UNLIMITED_INSTANCES,
|
||||||
4096, 4096, 500 /* 0.5 second timeout */, NULL );
|
4096, 4096, 500 /* 0.5 second timeout */, NULL );
|
||||||
|
|
||||||
if (hPipe == INVALID_HANDLE_VALUE)
|
if (hPipe == INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
FIXME("pipe creation failed for %s, le is %ld\n",pipefn,GetLastError());
|
FIXME("pipe creation failed for %s, le is %ld\n", debugstr_w(pipefn), GetLastError());
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -147,14 +147,14 @@ static HRESULT PropertyStorage_PropVariantCopy(PROPVARIANT *prop,
|
||||||
static HRESULT PropertyStorage_StringCopy(LPCSTR src, LCID srcCP, LPSTR *dst,
|
static HRESULT PropertyStorage_StringCopy(LPCSTR src, LCID srcCP, LPSTR *dst,
|
||||||
LCID targetCP);
|
LCID targetCP);
|
||||||
|
|
||||||
static IPropertyStorageVtbl IPropertyStorage_Vtbl;
|
static const IPropertyStorageVtbl IPropertyStorage_Vtbl;
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* Implementation of IPropertyStorage
|
* Implementation of IPropertyStorage
|
||||||
*/
|
*/
|
||||||
typedef struct tagPropertyStorage_impl
|
typedef struct tagPropertyStorage_impl
|
||||||
{
|
{
|
||||||
IPropertyStorageVtbl *vtbl;
|
const IPropertyStorageVtbl *vtbl;
|
||||||
DWORD ref;
|
DWORD ref;
|
||||||
CRITICAL_SECTION cs;
|
CRITICAL_SECTION cs;
|
||||||
IStream *stm;
|
IStream *stm;
|
||||||
|
@ -2210,7 +2210,7 @@ static HRESULT WINAPI IPropertySetStorage_fnEnum(
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* vtables
|
* vtables
|
||||||
*/
|
*/
|
||||||
IPropertySetStorageVtbl IPropertySetStorage_Vtbl =
|
const IPropertySetStorageVtbl IPropertySetStorage_Vtbl =
|
||||||
{
|
{
|
||||||
IPropertySetStorage_fnQueryInterface,
|
IPropertySetStorage_fnQueryInterface,
|
||||||
IPropertySetStorage_fnAddRef,
|
IPropertySetStorage_fnAddRef,
|
||||||
|
@ -2221,7 +2221,7 @@ IPropertySetStorageVtbl IPropertySetStorage_Vtbl =
|
||||||
IPropertySetStorage_fnEnum
|
IPropertySetStorage_fnEnum
|
||||||
};
|
};
|
||||||
|
|
||||||
static IPropertyStorageVtbl IPropertyStorage_Vtbl =
|
static const IPropertyStorageVtbl IPropertyStorage_Vtbl =
|
||||||
{
|
{
|
||||||
IPropertyStorage_fnQueryInterface,
|
IPropertyStorage_fnQueryInterface,
|
||||||
IPropertyStorage_fnAddRef,
|
IPropertyStorage_fnAddRef,
|
||||||
|
@ -2310,7 +2310,7 @@ HRESULT WINAPI FmtIdToPropStgName(const FMTID *rfmtid, LPOLESTR str)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (++fmtptr < (BYTE *)rfmtid + sizeof(FMTID))
|
if (++fmtptr < (const BYTE *)rfmtid + sizeof(FMTID))
|
||||||
i |= *fmtptr << bitsRemaining;
|
i |= *fmtptr << bitsRemaining;
|
||||||
*pstr++ = (WCHAR)(fmtMap[i & CHARMASK]);
|
*pstr++ = (WCHAR)(fmtMap[i & CHARMASK]);
|
||||||
bitsRemaining += BITS_PER_BYTE - BITS_IN_CHARMASK;
|
bitsRemaining += BITS_PER_BYTE - BITS_IN_CHARMASK;
|
||||||
|
|
|
@ -819,7 +819,7 @@ static HRESULT WINAPI StgStreamImpl_Clone(
|
||||||
/*
|
/*
|
||||||
* Virtual function table for the StgStreamImpl class.
|
* Virtual function table for the StgStreamImpl class.
|
||||||
*/
|
*/
|
||||||
static IStreamVtbl StgStreamImpl_Vtbl =
|
static const IStreamVtbl StgStreamImpl_Vtbl =
|
||||||
{
|
{
|
||||||
StgStreamImpl_QueryInterface,
|
StgStreamImpl_QueryInterface,
|
||||||
StgStreamImpl_AddRef,
|
StgStreamImpl_AddRef,
|
||||||
|
|
|
@ -91,9 +91,9 @@ static const BYTE STORAGE_magic[8] ={0xd0,0xcf,0x11,0xe0,0xa1,0xb1,0x1a,0xe1};
|
||||||
|
|
||||||
#define READ_HEADER STORAGE_get_big_block(hf,-1,(LPBYTE)&sth);assert(!memcmp(STORAGE_magic,sth.magic,sizeof(STORAGE_magic)));
|
#define READ_HEADER STORAGE_get_big_block(hf,-1,(LPBYTE)&sth);assert(!memcmp(STORAGE_magic,sth.magic,sizeof(STORAGE_magic)));
|
||||||
static IStorage16Vtbl stvt16;
|
static IStorage16Vtbl stvt16;
|
||||||
static IStorage16Vtbl *segstvt16 = NULL;
|
static const IStorage16Vtbl *segstvt16 = NULL;
|
||||||
static IStream16Vtbl strvt16;
|
static IStream16Vtbl strvt16;
|
||||||
static IStream16Vtbl *segstrvt16 = NULL;
|
static const IStream16Vtbl *segstrvt16 = NULL;
|
||||||
|
|
||||||
/*ULONG WINAPI IStorage16_AddRef(LPSTORAGE16 this);*/
|
/*ULONG WINAPI IStorage16_AddRef(LPSTORAGE16 this);*/
|
||||||
static void _create_istorage16(LPSTORAGE16 *stg);
|
static void _create_istorage16(LPSTORAGE16 *stg);
|
||||||
|
@ -955,7 +955,7 @@ STORAGE_get_free_pps_entry(HANDLE hf) {
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
/* IUnknown fields */
|
/* IUnknown fields */
|
||||||
IStream16Vtbl *lpVtbl;
|
const IStream16Vtbl *lpVtbl;
|
||||||
DWORD ref;
|
DWORD ref;
|
||||||
/* IStream16 fields */
|
/* IStream16 fields */
|
||||||
SEGPTR thisptr; /* pointer to this struct as segmented */
|
SEGPTR thisptr; /* pointer to this struct as segmented */
|
||||||
|
@ -1413,7 +1413,7 @@ static void _create_istream16(LPSTREAM16 *str) {
|
||||||
VTENT(Stat);
|
VTENT(Stat);
|
||||||
VTENT(Clone);
|
VTENT(Clone);
|
||||||
#undef VTENT
|
#undef VTENT
|
||||||
segstrvt16 = (IStream16Vtbl*)MapLS( &strvt16 );
|
segstrvt16 = (const IStream16Vtbl*)MapLS( &strvt16 );
|
||||||
} else {
|
} else {
|
||||||
#define VTENT(xfn) strvt16.xfn = IStream16_fn##xfn;
|
#define VTENT(xfn) strvt16.xfn = IStream16_fn##xfn;
|
||||||
VTENT(QueryInterface);
|
VTENT(QueryInterface);
|
||||||
|
@ -1449,7 +1449,7 @@ static void _create_istream16(LPSTREAM16 *str) {
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
/* IUnknown fields */
|
/* IUnknown fields */
|
||||||
IStreamVtbl *lpVtbl;
|
const IStreamVtbl *lpVtbl;
|
||||||
DWORD ref;
|
DWORD ref;
|
||||||
/* IStream32 fields */
|
/* IStream32 fields */
|
||||||
struct storage_pps_entry stde;
|
struct storage_pps_entry stde;
|
||||||
|
@ -1503,7 +1503,7 @@ ULONG WINAPI IStream_fnRelease(IStream* iface) {
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
/* IUnknown fields */
|
/* IUnknown fields */
|
||||||
IStorage16Vtbl *lpVtbl;
|
const IStorage16Vtbl *lpVtbl;
|
||||||
DWORD ref;
|
DWORD ref;
|
||||||
/* IStorage16 fields */
|
/* IStorage16 fields */
|
||||||
SEGPTR thisptr; /* pointer to this struct as segmented */
|
SEGPTR thisptr; /* pointer to this struct as segmented */
|
||||||
|
@ -1829,7 +1829,7 @@ static void _create_istorage16(LPSTORAGE16 *stg) {
|
||||||
VTENT(SetStateBits)
|
VTENT(SetStateBits)
|
||||||
VTENT(Stat)
|
VTENT(Stat)
|
||||||
#undef VTENT
|
#undef VTENT
|
||||||
segstvt16 = (IStorage16Vtbl*)MapLS( &stvt16 );
|
segstvt16 = (const IStorage16Vtbl*)MapLS( &stvt16 );
|
||||||
} else {
|
} else {
|
||||||
#define VTENT(xfn) stvt16.xfn = IStorage16_fn##xfn;
|
#define VTENT(xfn) stvt16.xfn = IStorage16_fn##xfn;
|
||||||
VTENT(QueryInterface)
|
VTENT(QueryInterface)
|
||||||
|
@ -1985,7 +1985,7 @@ HRESULT WINAPI StgIsStorageILockBytes16(SEGPTR plkbyt)
|
||||||
args[5] = 0;
|
args[5] = 0;
|
||||||
|
|
||||||
if (!K32WOWCallback16Ex(
|
if (!K32WOWCallback16Ex(
|
||||||
(DWORD)((ILockBytes16Vtbl*)MapSL(
|
(DWORD)((const ILockBytes16Vtbl*)MapSL(
|
||||||
(SEGPTR)((LPLOCKBYTES16)MapSL(plkbyt))->lpVtbl)
|
(SEGPTR)((LPLOCKBYTES16)MapSL(plkbyt))->lpVtbl)
|
||||||
)->ReadAt,
|
)->ReadAt,
|
||||||
WCB16_PASCAL,
|
WCB16_PASCAL,
|
||||||
|
|
|
@ -157,7 +157,7 @@ static DWORD GetShareModeFromSTGM(DWORD stgm);
|
||||||
static DWORD GetAccessModeFromSTGM(DWORD stgm);
|
static DWORD GetAccessModeFromSTGM(DWORD stgm);
|
||||||
static DWORD GetCreationModeFromSTGM(DWORD stgm);
|
static DWORD GetCreationModeFromSTGM(DWORD stgm);
|
||||||
|
|
||||||
extern IPropertySetStorageVtbl IPropertySetStorage_Vtbl;
|
extern const IPropertySetStorageVtbl IPropertySetStorage_Vtbl;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -2178,7 +2178,7 @@ HRESULT WINAPI StorageImpl_SetStateBits(
|
||||||
/*
|
/*
|
||||||
* Virtual function table for the IStorage32Impl class.
|
* Virtual function table for the IStorage32Impl class.
|
||||||
*/
|
*/
|
||||||
static IStorageVtbl Storage32Impl_Vtbl =
|
static const IStorageVtbl Storage32Impl_Vtbl =
|
||||||
{
|
{
|
||||||
StorageBaseImpl_QueryInterface,
|
StorageBaseImpl_QueryInterface,
|
||||||
StorageBaseImpl_AddRef,
|
StorageBaseImpl_AddRef,
|
||||||
|
@ -3965,7 +3965,7 @@ ULONG IEnumSTATSTGImpl_PopSearchNode(
|
||||||
/*
|
/*
|
||||||
* Virtual function table for the IEnumSTATSTGImpl class.
|
* Virtual function table for the IEnumSTATSTGImpl class.
|
||||||
*/
|
*/
|
||||||
static IEnumSTATSTGVtbl IEnumSTATSTGImpl_Vtbl =
|
static const IEnumSTATSTGVtbl IEnumSTATSTGImpl_Vtbl =
|
||||||
{
|
{
|
||||||
IEnumSTATSTGImpl_QueryInterface,
|
IEnumSTATSTGImpl_QueryInterface,
|
||||||
IEnumSTATSTGImpl_AddRef,
|
IEnumSTATSTGImpl_AddRef,
|
||||||
|
@ -4025,7 +4025,7 @@ IEnumSTATSTGImpl* IEnumSTATSTGImpl_Construct(
|
||||||
/*
|
/*
|
||||||
* Virtual function table for the Storage32InternalImpl class.
|
* Virtual function table for the Storage32InternalImpl class.
|
||||||
*/
|
*/
|
||||||
static IStorageVtbl Storage32InternalImpl_Vtbl =
|
static const IStorageVtbl Storage32InternalImpl_Vtbl =
|
||||||
{
|
{
|
||||||
StorageBaseImpl_QueryInterface,
|
StorageBaseImpl_QueryInterface,
|
||||||
StorageBaseImpl_AddRef,
|
StorageBaseImpl_AddRef,
|
||||||
|
|
|
@ -214,10 +214,10 @@ HRESULT OLECONVERT_CreateCompObjStream(LPSTORAGE pStorage, LPCSTR strOleTypeName
|
||||||
*/
|
*/
|
||||||
struct StorageBaseImpl
|
struct StorageBaseImpl
|
||||||
{
|
{
|
||||||
IStorageVtbl *lpVtbl; /* Needs to be the first item in the struct
|
const IStorageVtbl *lpVtbl; /* Needs to be the first item in the struct
|
||||||
* since we want to cast this in a Storage32 pointer */
|
* since we want to cast this in a Storage32 pointer */
|
||||||
|
|
||||||
IPropertySetStorageVtbl *pssVtbl; /* interface for adding a properties stream */
|
const IPropertySetStorageVtbl *pssVtbl; /* interface for adding a properties stream */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Reference count of this object
|
* Reference count of this object
|
||||||
|
@ -427,7 +427,7 @@ HRESULT WINAPI StorageInternalImpl_Revert(
|
||||||
*/
|
*/
|
||||||
struct IEnumSTATSTGImpl
|
struct IEnumSTATSTGImpl
|
||||||
{
|
{
|
||||||
IEnumSTATSTGVtbl *lpVtbl; /* Needs to be the first item in the struct
|
const IEnumSTATSTGVtbl *lpVtbl; /* Needs to be the first item in the struct
|
||||||
* since we want to cast this in an IEnumSTATSTG pointer */
|
* since we want to cast this in an IEnumSTATSTG pointer */
|
||||||
|
|
||||||
ULONG ref; /* Reference count */
|
ULONG ref; /* Reference count */
|
||||||
|
@ -481,7 +481,7 @@ INT IEnumSTATSTGImpl_FindParentProperty(
|
||||||
*/
|
*/
|
||||||
struct StgStreamImpl
|
struct StgStreamImpl
|
||||||
{
|
{
|
||||||
IStreamVtbl *lpVtbl; /* Needs to be the first item in the struct
|
const IStreamVtbl *lpVtbl; /* Needs to be the first item in the struct
|
||||||
* since we want to cast this to an IStream pointer */
|
* since we want to cast this to an IStream pointer */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -409,7 +409,7 @@ struct ifstub *stub_manager_new_ifstub(struct stub_manager *m, IRpcStubBuffer *s
|
||||||
if (!stub) return NULL;
|
if (!stub) return NULL;
|
||||||
|
|
||||||
stub->stubbuffer = sb;
|
stub->stubbuffer = sb;
|
||||||
IUnknown_AddRef(sb);
|
if (sb) IRpcStubBuffer_AddRef(sb);
|
||||||
|
|
||||||
/* no need to ref this, same object as sb */
|
/* no need to ref this, same object as sb */
|
||||||
stub->iface = iptr;
|
stub->iface = iptr;
|
||||||
|
@ -446,7 +446,7 @@ static void stub_manager_delete_ifstub(struct stub_manager *m, struct ifstub *if
|
||||||
|
|
||||||
RPC_UnregisterInterface(&ifstub->iid);
|
RPC_UnregisterInterface(&ifstub->iid);
|
||||||
|
|
||||||
IUnknown_Release(ifstub->stubbuffer);
|
if (ifstub->stubbuffer) IUnknown_Release(ifstub->stubbuffer);
|
||||||
IUnknown_Release(ifstub->iface);
|
IUnknown_Release(ifstub->iface);
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, ifstub);
|
HeapFree(GetProcessHeap(), 0, ifstub);
|
||||||
|
|
Loading…
Reference in a new issue