* Sync with Wine 1.7.17.
CORE-8080

svn path=/trunk/; revision=62938
This commit is contained in:
Amine Khaldi
2014-04-24 12:14:13 +00:00
parent 31f99bf377
commit f38983022a
25 changed files with 1228 additions and 729 deletions
+1 -1
View File
@@ -112,7 +112,7 @@ AntiMonikerImpl_Release(IMoniker* iface)
ref = InterlockedDecrement(&This->ref);
/* destroy the object if there's no more reference on it */
/* destroy the object if there are no more references to it */
if (ref == 0)
{
if (This->pMarshal) IUnknown_Release(This->pMarshal);
+3 -4
View File
@@ -421,9 +421,8 @@ static HRESULT BindCtxImpl_GetObjectIndex(BindCtxImpl* This,
LPOLESTR pszkey,
DWORD *index)
{
DWORD i;
BYTE found=0;
BOOL found = FALSE;
TRACE("(%p,%p,%p,%p)\n",This,punk,pszkey,index);
@@ -440,14 +439,14 @@ static HRESULT BindCtxImpl_GetObjectIndex(BindCtxImpl* This,
)
)
found=1;
found = TRUE;
}
}
else
/* search object identified by a moniker*/
for(i=0; ( (i<This->bindCtxTableLastIndex) && (!found));i++)
if(This->bindCtxTable[i].pObj==punk)
found=1;
found = TRUE;
if (index != NULL)
*index=i-1;
+14 -23
View File
@@ -103,20 +103,6 @@ static ULONG WINAPI ClassMoniker_AddRef(IMoniker* iface)
return InterlockedIncrement(&This->ref);
}
/******************************************************************************
* ClassMoniker_Destroy (local function)
*******************************************************************************/
static HRESULT ClassMoniker_Destroy(ClassMoniker* This)
{
TRACE("(%p)\n",This);
if (This->pMarshal) IUnknown_Release(This->pMarshal);
HeapFree(GetProcessHeap(),0,This);
return S_OK;
}
/******************************************************************************
* ClassMoniker_Release
******************************************************************************/
@@ -129,8 +115,12 @@ static ULONG WINAPI ClassMoniker_Release(IMoniker* iface)
ref = InterlockedDecrement(&This->ref);
/* destroy the object if there's no more reference on it */
if (ref == 0) ClassMoniker_Destroy(This);
/* destroy the object if there are no more references to it */
if (ref == 0)
{
if (This->pMarshal) IUnknown_Release(This->pMarshal);
HeapFree(GetProcessHeap(),0,This);
}
return ref;
}
@@ -262,7 +252,7 @@ static HRESULT WINAPI ClassMoniker_BindToStorage(IMoniker* iface,
VOID** ppvResult)
{
TRACE("(%p,%p,%p,%p)\n",pbc, pmkToLeft, riid, ppvResult);
return ClassMoniker_BindToObject(iface, pbc, pmkToLeft, riid, ppvResult);
return IMoniker_BindToObject(iface, pbc, pmkToLeft, riid, ppvResult);
}
/******************************************************************************
@@ -279,7 +269,7 @@ static HRESULT WINAPI ClassMoniker_Reduce(IMoniker* iface,
if (!ppmkReduced)
return E_POINTER;
ClassMoniker_AddRef(iface);
IMoniker_AddRef(iface);
*ppmkReduced = iface;
@@ -585,7 +575,7 @@ static HRESULT WINAPI ClassMonikerROTData_QueryInterface(IROTData *iface,REFIID
TRACE("(%p,%p,%p)\n",iface,riid,ppvObject);
return ClassMoniker_QueryInterface(&This->IMoniker_iface, riid, ppvObject);
return IMoniker_QueryInterface(&This->IMoniker_iface, riid, ppvObject);
}
/***********************************************************************
@@ -597,7 +587,7 @@ static ULONG WINAPI ClassMonikerROTData_AddRef(IROTData *iface)
TRACE("(%p)\n",iface);
return ClassMoniker_AddRef(&This->IMoniker_iface);
return IMoniker_AddRef(&This->IMoniker_iface);
}
/***********************************************************************
@@ -609,7 +599,7 @@ static ULONG WINAPI ClassMonikerROTData_Release(IROTData* iface)
TRACE("(%p)\n",iface);
return ClassMoniker_Release(&This->IMoniker_iface);
return IMoniker_Release(&This->IMoniker_iface);
}
/******************************************************************************
@@ -859,9 +849,10 @@ static const IClassFactoryVtbl ClassMonikerCFVtbl =
ClassMonikerCF_CreateInstance,
ClassMonikerCF_LockServer
};
static const IClassFactoryVtbl *ClassMonikerCF = &ClassMonikerCFVtbl;
static IClassFactory ClassMonikerCF = { &ClassMonikerCFVtbl };
HRESULT ClassMonikerCF_Create(REFIID riid, LPVOID *ppv)
{
return IClassFactory_QueryInterface((IClassFactory *)&ClassMonikerCF, riid, ppv);
return IClassFactory_QueryInterface(&ClassMonikerCF, riid, ppv);
}
+195 -168
View File
@@ -38,14 +38,16 @@ static ComCatMgrImpl COMCAT_ComCatMgr =
{ &COMCAT_ICatInformation_Vtbl }
};
struct class_categories {
LPCWSTR impl_strings;
LPCWSTR req_strings;
struct class_categories
{
ULONG size; /* total length, including structure itself */
ULONG impl_offset;
ULONG req_offset;
};
static IEnumCATEGORYINFO *COMCAT_IEnumCATEGORYINFO_Construct(LCID lcid);
static LPENUMGUID COMCAT_CLSID_IEnumGUID_Construct(struct class_categories *class_categories);
static LPENUMGUID COMCAT_CATID_IEnumGUID_Construct(REFCLSID rclsid, LPCWSTR impl_req);
static HRESULT EnumCATEGORYINFO_Construct(LCID lcid, IEnumCATEGORYINFO **ret);
static HRESULT CLSIDEnumGUID_Construct(struct class_categories *class_categories, IEnumCLSID **ret);
static HRESULT CATIDEnumGUID_Construct(REFCLSID rclsid, LPCWSTR impl_req, IEnumCATID **ret);
/**********************************************************************
* File-scope string constants
@@ -68,14 +70,14 @@ static HRESULT COMCAT_RegisterClassCategories(
ULONG cCategories,
const CATID *rgcatid)
{
WCHAR keyname[39];
WCHAR keyname[CHARS_IN_GUID];
HRESULT res;
HKEY clsid_key, class_key, type_key;
if (cCategories && rgcatid == NULL) return E_POINTER;
/* Format the class key name. */
res = StringFromGUID2(rclsid, keyname, 39);
res = StringFromGUID2(rclsid, keyname, CHARS_IN_GUID);
if (FAILED(res)) return res;
/* Create (or open) the CLSID key. */
@@ -92,7 +94,7 @@ static HRESULT COMCAT_RegisterClassCategories(
HKEY key;
/* Format the category key name. */
res = StringFromGUID2(rgcatid, keyname, 39);
res = StringFromGUID2(rgcatid, keyname, CHARS_IN_GUID);
if (FAILED(res)) continue;
/* Do the register. */
@@ -124,7 +126,7 @@ static HRESULT COMCAT_UnRegisterClassCategories(
if (cCategories && rgcatid == NULL) return E_POINTER;
/* Format the class category type key name. */
res = StringFromGUID2(rclsid, keyname + 6, 39);
res = StringFromGUID2(rclsid, keyname + 6, CHARS_IN_GUID);
if (FAILED(res)) return res;
keyname[44] = '\\';
lstrcpyW(keyname + 45, type);
@@ -135,7 +137,7 @@ static HRESULT COMCAT_UnRegisterClassCategories(
for (; cCategories; --cCategories, ++rgcatid) {
/* Format the category key name. */
res = StringFromGUID2(rgcatid, keyname, 39);
res = StringFromGUID2(rgcatid, keyname, CHARS_IN_GUID);
if (FAILED(res)) continue;
/* Do the unregister. */
@@ -179,25 +181,26 @@ static struct class_categories *COMCAT_PrepareClassCategories(
{
struct class_categories *categories;
WCHAR *strings;
ULONG size;
categories = HeapAlloc(
GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(struct class_categories) +
((impl_count + req_count) * 39 + 2) * sizeof(WCHAR));
size = sizeof(struct class_categories) + ((impl_count + req_count)*CHARS_IN_GUID + 2)*sizeof(WCHAR);
categories = HeapAlloc(GetProcessHeap(), 0, size);
if (categories == NULL) return categories;
categories->size = size;
categories->impl_offset = sizeof(struct class_categories);
categories->req_offset = categories->impl_offset + (impl_count*CHARS_IN_GUID + 1)*sizeof(WCHAR);
strings = (WCHAR *)(categories + 1);
categories->impl_strings = strings;
while (impl_count--) {
StringFromGUID2(impl_catids++, strings, 39);
strings += 39;
StringFromGUID2(impl_catids++, strings, CHARS_IN_GUID);
strings += CHARS_IN_GUID;
}
*strings++ = 0;
categories->req_strings = strings;
while (req_count--) {
StringFromGUID2(req_catids++, strings, 39);
strings += 39;
StringFromGUID2(req_catids++, strings, CHARS_IN_GUID);
strings += CHARS_IN_GUID;
}
*strings++ = 0;
@@ -211,16 +214,20 @@ static HRESULT COMCAT_IsClassOfCategories(
HKEY key,
struct class_categories const* categories)
{
const WCHAR *impl_strings, *req_strings;
HKEY subkey;
HRESULT res;
DWORD index;
LPCWSTR string;
impl_strings = (WCHAR*)((BYTE*)categories + categories->impl_offset);
req_strings = (WCHAR*)((BYTE*)categories + categories->req_offset);
/* Check that every given category is implemented by class. */
if (*categories->impl_strings) {
if (*impl_strings) {
res = open_classes_key(key, impl_keyname, KEY_READ, &subkey);
if (res != ERROR_SUCCESS) return S_FALSE;
for (string = categories->impl_strings; *string; string += 39) {
for (string = impl_strings; *string; string += CHARS_IN_GUID) {
HKEY catkey;
res = open_classes_key(subkey, string, 0, &catkey);
if (res != ERROR_SUCCESS) {
@@ -236,14 +243,14 @@ static HRESULT COMCAT_IsClassOfCategories(
res = open_classes_key(key, req_keyname, KEY_READ, &subkey);
if (res == ERROR_SUCCESS) {
for (index = 0; ; ++index) {
WCHAR keyname[39];
DWORD size = 39;
WCHAR keyname[CHARS_IN_GUID];
DWORD size = CHARS_IN_GUID;
res = RegEnumKeyExW(subkey, index, keyname, &size,
NULL, NULL, NULL, NULL);
if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA) break;
if (size != 38) continue; /* bogus catid in registry */
for (string = categories->req_strings; *string; string += 39)
if (size != CHARS_IN_GUID-1) continue; /* bogus catid in registry */
for (string = req_strings; *string; string += CHARS_IN_GUID)
if (!strcmpiW(string, keyname)) break;
if (!*string) {
RegCloseKey(subkey);
@@ -321,19 +328,18 @@ static HRESULT WINAPI COMCAT_ICatRegister_RegisterCategories(
for (; cCategories; --cCategories, ++rgci) {
static const WCHAR fmt[] = { '%', 'l', 'X', 0 };
WCHAR keyname[39];
WCHAR keyname[CHARS_IN_GUID];
WCHAR valname[9];
HKEY cat_key;
/* Create (or open) the key for this category. */
if (!StringFromGUID2(&rgci->catid, keyname, 39)) continue;
if (!StringFromGUID2(&rgci->catid, keyname, CHARS_IN_GUID)) continue;
res = create_classes_key(comcat_key, keyname, KEY_READ|KEY_WRITE, &cat_key);
if (res != ERROR_SUCCESS) continue;
/* Set the value for this locale's description. */
wsprintfW(valname, fmt, rgci->lcid);
RegSetValueExW(cat_key, valname, 0, REG_SZ,
(CONST BYTE*)(rgci->szDescription),
RegSetValueExW(cat_key, valname, 0, REG_SZ, (const BYTE*)rgci->szDescription,
(lstrlenW(rgci->szDescription) + 1) * sizeof(WCHAR));
RegCloseKey(cat_key);
@@ -364,10 +370,10 @@ static HRESULT WINAPI COMCAT_ICatRegister_UnRegisterCategories(
if (res != ERROR_SUCCESS) return E_FAIL;
for (; cCategories; --cCategories, ++rgcatid) {
WCHAR keyname[39];
WCHAR keyname[CHARS_IN_GUID];
/* Delete the key for this category. */
if (!StringFromGUID2(rgcatid, keyname, 39)) continue;
if (!StringFromGUID2(rgcatid, keyname, CHARS_IN_GUID)) continue;
RegDeleteKeyW(comcat_key, keyname);
}
@@ -474,10 +480,7 @@ static HRESULT WINAPI COMCAT_ICatInformation_EnumCategories(
if (ppenumCatInfo == NULL) return E_POINTER;
*ppenumCatInfo = COMCAT_IEnumCATEGORYINFO_Construct(lcid);
if (*ppenumCatInfo == NULL) return E_OUTOFMEMORY;
IEnumCATEGORYINFO_AddRef(*ppenumCatInfo);
return S_OK;
return EnumCATEGORYINFO_Construct(lcid, ppenumCatInfo);
}
/**********************************************************************
@@ -500,7 +503,7 @@ static HRESULT WINAPI COMCAT_ICatInformation_GetCategoryDesc(
if (rcatid == NULL || ppszDesc == NULL) return E_INVALIDARG;
/* Open the key for this category. */
if (!StringFromGUID2(rcatid, keyname + 21, 39)) return E_FAIL;
if (!StringFromGUID2(rcatid, keyname + 21, CHARS_IN_GUID)) return E_FAIL;
res = open_classes_key(HKEY_CLASSES_ROOT, keyname, KEY_READ, &key);
if (res != ERROR_SUCCESS) return CAT_E_CATIDNOEXIST;
@@ -534,6 +537,7 @@ static HRESULT WINAPI COMCAT_ICatInformation_EnumClassesOfCategories(
LPENUMCLSID *ppenumCLSID)
{
struct class_categories *categories;
HRESULT hr;
TRACE("\n");
@@ -549,13 +553,15 @@ static HRESULT WINAPI COMCAT_ICatInformation_EnumClassesOfCategories(
categories = COMCAT_PrepareClassCategories(cImplemented, rgcatidImpl,
cRequired, rgcatidReq);
if (categories == NULL) return E_OUTOFMEMORY;
*ppenumCLSID = COMCAT_CLSID_IEnumGUID_Construct(categories);
if (*ppenumCLSID == NULL) {
hr = CLSIDEnumGUID_Construct(categories, ppenumCLSID);
if (FAILED(hr))
{
HeapFree(GetProcessHeap(), 0, categories);
return E_OUTOFMEMORY;
return hr;
}
IEnumGUID_AddRef(*ppenumCLSID);
return S_OK;
return hr;
}
/**********************************************************************
@@ -587,7 +593,7 @@ static HRESULT WINAPI COMCAT_ICatInformation_IsClassOfCategories(
if ((cImplemented && rgcatidImpl == NULL) ||
(cRequired && rgcatidReq == NULL)) return E_POINTER;
res = StringFromGUID2(rclsid, keyname + 6, 39);
res = StringFromGUID2(rclsid, keyname + 6, CHARS_IN_GUID);
if (FAILED(res)) return res;
categories = COMCAT_PrepareClassCategories(cImplemented, rgcatidImpl,
@@ -622,9 +628,7 @@ static HRESULT WINAPI COMCAT_ICatInformation_EnumImplCategoriesOfClass(
if (rclsid == NULL || ppenumCATID == NULL)
return E_POINTER;
*ppenumCATID = COMCAT_CATID_IEnumGUID_Construct(rclsid, postfix);
if (*ppenumCATID == NULL) return E_OUTOFMEMORY;
return S_OK;
return CATIDEnumGUID_Construct(rclsid, postfix, ppenumCATID);
}
/**********************************************************************
@@ -644,9 +648,7 @@ static HRESULT WINAPI COMCAT_ICatInformation_EnumReqCategoriesOfClass(
if (rclsid == NULL || ppenumCATID == NULL)
return E_POINTER;
*ppenumCATID = COMCAT_CATID_IEnumGUID_Construct(rclsid, postfix);
if (*ppenumCATID == NULL) return E_OUTOFMEMORY;
return S_OK;
return CATIDEnumGUID_Construct(rclsid, postfix, ppenumCATID);
}
/**********************************************************************
@@ -857,8 +859,8 @@ static HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_Next(
if (This->key) while (fetched < celt) {
LSTATUS res;
HRESULT hr;
WCHAR catid[39];
DWORD cName = 39;
WCHAR catid[CHARS_IN_GUID];
DWORD cName = CHARS_IN_GUID;
HKEY subkey;
res = RegEnumKeyExW(This->key, This->next_index, catid, &cName,
@@ -948,21 +950,23 @@ static const IEnumCATEGORYINFOVtbl COMCAT_IEnumCATEGORYINFO_Vtbl =
COMCAT_IEnumCATEGORYINFO_Clone
};
static IEnumCATEGORYINFO *COMCAT_IEnumCATEGORYINFO_Construct(LCID lcid)
static HRESULT EnumCATEGORYINFO_Construct(LCID lcid, IEnumCATEGORYINFO **ret)
{
static const WCHAR keyname[] = {'C','o','m','p','o','n','e','n','t',' ','C','a','t','e','g','o','r','i','e','s',0};
IEnumCATEGORYINFOImpl *This;
This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IEnumCATEGORYINFOImpl));
if (This) {
static const WCHAR keyname[] = { 'C', 'o', 'm', 'p', 'o', 'n', 'e', 'n',
't', ' ', 'C', 'a', 't', 'e', 'g', 'o',
'r', 'i', 'e', 's', 0 };
*ret = NULL;
This->IEnumCATEGORYINFO_iface.lpVtbl = &COMCAT_IEnumCATEGORYINFO_Vtbl;
This->lcid = lcid;
open_classes_key(HKEY_CLASSES_ROOT, keyname, KEY_READ, &This->key);
}
return &This->IEnumCATEGORYINFO_iface;
This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IEnumCATEGORYINFOImpl));
if (!This) return E_OUTOFMEMORY;
This->IEnumCATEGORYINFO_iface.lpVtbl = &COMCAT_IEnumCATEGORYINFO_Vtbl;
This->ref = 1;
This->lcid = lcid;
open_classes_key(HKEY_CLASSES_ROOT, keyname, KEY_READ, &This->key);
*ret = &This->IEnumCATEGORYINFO_iface;
return S_OK;
}
/**********************************************************************
@@ -973,23 +977,20 @@ static IEnumCATEGORYINFO *COMCAT_IEnumCATEGORYINFO_Construct(LCID lcid)
*/
typedef struct
{
const IEnumGUIDVtbl *lpVtbl;
IEnumGUID IEnumGUID_iface;
LONG ref;
struct class_categories *categories;
HKEY key;
DWORD next_index;
} CLSID_IEnumGUIDImpl;
static ULONG WINAPI COMCAT_CLSID_IEnumGUID_AddRef(LPENUMGUID iface)
static inline CLSID_IEnumGUIDImpl *impl_from_IEnumCLSID(IEnumGUID *iface)
{
CLSID_IEnumGUIDImpl *This = (CLSID_IEnumGUIDImpl *)iface;
TRACE("\n");
return InterlockedIncrement(&This->ref);
return CONTAINING_RECORD(iface, CLSID_IEnumGUIDImpl, IEnumGUID_iface);
}
static HRESULT WINAPI COMCAT_CLSID_IEnumGUID_QueryInterface(
LPENUMGUID iface,
static HRESULT WINAPI CLSIDEnumGUID_QueryInterface(
IEnumGUID *iface,
REFIID riid,
LPVOID *ppvObj)
{
@@ -1001,16 +1002,24 @@ static HRESULT WINAPI COMCAT_CLSID_IEnumGUID_QueryInterface(
IsEqualGUID(riid, &IID_IEnumGUID))
{
*ppvObj = iface;
COMCAT_CLSID_IEnumGUID_AddRef(iface);
IEnumGUID_AddRef(iface);
return S_OK;
}
return E_NOINTERFACE;
}
static ULONG WINAPI COMCAT_CLSID_IEnumGUID_Release(LPENUMGUID iface)
static ULONG WINAPI CLSIDEnumGUID_AddRef(IEnumGUID *iface)
{
CLSID_IEnumGUIDImpl *This = (CLSID_IEnumGUIDImpl *)iface;
CLSID_IEnumGUIDImpl *This = impl_from_IEnumCLSID(iface);
TRACE("\n");
return InterlockedIncrement(&This->ref);
}
static ULONG WINAPI CLSIDEnumGUID_Release(IEnumGUID *iface)
{
CLSID_IEnumGUIDImpl *This = impl_from_IEnumCLSID(iface);
ULONG ref;
TRACE("\n");
@@ -1025,13 +1034,13 @@ static ULONG WINAPI COMCAT_CLSID_IEnumGUID_Release(LPENUMGUID iface)
return ref;
}
static HRESULT WINAPI COMCAT_CLSID_IEnumGUID_Next(
LPENUMGUID iface,
static HRESULT WINAPI CLSIDEnumGUID_Next(
IEnumGUID *iface,
ULONG celt,
GUID *rgelt,
ULONG *pceltFetched)
{
CLSID_IEnumGUIDImpl *This = (CLSID_IEnumGUIDImpl *)iface;
CLSID_IEnumGUIDImpl *This = impl_from_IEnumCLSID(iface);
ULONG fetched = 0;
TRACE("\n");
@@ -1041,8 +1050,8 @@ static HRESULT WINAPI COMCAT_CLSID_IEnumGUID_Next(
if (This->key) while (fetched < celt) {
LSTATUS res;
HRESULT hr;
WCHAR clsid[39];
DWORD cName = 39;
WCHAR clsid[CHARS_IN_GUID];
DWORD cName = CHARS_IN_GUID;
HKEY subkey;
res = RegEnumKeyExW(This->key, This->next_index, clsid, &cName,
@@ -1068,11 +1077,11 @@ static HRESULT WINAPI COMCAT_CLSID_IEnumGUID_Next(
return fetched == celt ? S_OK : S_FALSE;
}
static HRESULT WINAPI COMCAT_CLSID_IEnumGUID_Skip(
LPENUMGUID iface,
static HRESULT WINAPI CLSIDEnumGUID_Skip(
IEnumGUID *iface,
ULONG celt)
{
CLSID_IEnumGUIDImpl *This = (CLSID_IEnumGUIDImpl *)iface;
CLSID_IEnumGUIDImpl *This = impl_from_IEnumCLSID(iface);
TRACE("\n");
@@ -1081,9 +1090,9 @@ static HRESULT WINAPI COMCAT_CLSID_IEnumGUID_Skip(
return S_OK;
}
static HRESULT WINAPI COMCAT_CLSID_IEnumGUID_Reset(LPENUMGUID iface)
static HRESULT WINAPI CLSIDEnumGUID_Reset(IEnumGUID *iface)
{
CLSID_IEnumGUIDImpl *This = (CLSID_IEnumGUIDImpl *)iface;
CLSID_IEnumGUIDImpl *This = impl_from_IEnumCLSID(iface);
TRACE("\n");
@@ -1091,64 +1100,70 @@ static HRESULT WINAPI COMCAT_CLSID_IEnumGUID_Reset(LPENUMGUID iface)
return S_OK;
}
static HRESULT WINAPI COMCAT_CLSID_IEnumGUID_Clone(
LPENUMGUID iface,
static HRESULT WINAPI CLSIDEnumGUID_Clone(
IEnumGUID *iface,
IEnumGUID **ppenum)
{
CLSID_IEnumGUIDImpl *This = (CLSID_IEnumGUIDImpl *)iface;
static const WCHAR keyname[] = { 'C', 'L', 'S', 'I', 'D', 0 };
CLSID_IEnumGUIDImpl *new_this;
DWORD size;
static const WCHAR keynameW[] = {'C','L','S','I','D',0};
CLSID_IEnumGUIDImpl *This = impl_from_IEnumCLSID(iface);
CLSID_IEnumGUIDImpl *cloned;
TRACE("\n");
TRACE("(%p)->(%p)\n", This, ppenum);
if (ppenum == NULL) return E_POINTER;
new_this = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(CLSID_IEnumGUIDImpl));
if (new_this == NULL) return E_OUTOFMEMORY;
*ppenum = NULL;
new_this->lpVtbl = This->lpVtbl;
new_this->ref = 1;
size = HeapSize(GetProcessHeap(), 0, This->categories);
new_this->categories =
HeapAlloc(GetProcessHeap(), 0, size);
if (new_this->categories == NULL) {
HeapFree(GetProcessHeap(), 0, new_this);
cloned = HeapAlloc(GetProcessHeap(), 0, sizeof(CLSID_IEnumGUIDImpl));
if (cloned == NULL) return E_OUTOFMEMORY;
cloned->IEnumGUID_iface.lpVtbl = This->IEnumGUID_iface.lpVtbl;
cloned->ref = 1;
cloned->categories = HeapAlloc(GetProcessHeap(), 0, This->categories->size);
if (cloned->categories == NULL) {
HeapFree(GetProcessHeap(), 0, cloned);
return E_OUTOFMEMORY;
}
memcpy(new_this->categories, This->categories, size);
/* FIXME: could we more efficiently use DuplicateHandle? */
open_classes_key(HKEY_CLASSES_ROOT, keyname, KEY_READ, &new_this->key);
new_this->next_index = This->next_index;
memcpy(cloned->categories, This->categories, This->categories->size);
*ppenum = (LPENUMGUID)new_this;
cloned->key = NULL;
open_classes_key(HKEY_CLASSES_ROOT, keynameW, KEY_READ, &cloned->key);
cloned->next_index = This->next_index;
*ppenum = &cloned->IEnumGUID_iface;
return S_OK;
}
static const IEnumGUIDVtbl COMCAT_CLSID_IEnumGUID_Vtbl =
static const IEnumGUIDVtbl CLSIDEnumGUIDVtbl =
{
COMCAT_CLSID_IEnumGUID_QueryInterface,
COMCAT_CLSID_IEnumGUID_AddRef,
COMCAT_CLSID_IEnumGUID_Release,
COMCAT_CLSID_IEnumGUID_Next,
COMCAT_CLSID_IEnumGUID_Skip,
COMCAT_CLSID_IEnumGUID_Reset,
COMCAT_CLSID_IEnumGUID_Clone
CLSIDEnumGUID_QueryInterface,
CLSIDEnumGUID_AddRef,
CLSIDEnumGUID_Release,
CLSIDEnumGUID_Next,
CLSIDEnumGUID_Skip,
CLSIDEnumGUID_Reset,
CLSIDEnumGUID_Clone
};
static LPENUMGUID COMCAT_CLSID_IEnumGUID_Construct(struct class_categories *categories)
static HRESULT CLSIDEnumGUID_Construct(struct class_categories *categories, IEnumCLSID **ret)
{
static const WCHAR keyname[] = {'C','L','S','I','D',0};
CLSID_IEnumGUIDImpl *This;
This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(CLSID_IEnumGUIDImpl));
if (This) {
static const WCHAR keyname[] = { 'C', 'L', 'S', 'I', 'D', 0 };
*ret = NULL;
This->lpVtbl = &COMCAT_CLSID_IEnumGUID_Vtbl;
This->categories = categories;
open_classes_key(HKEY_CLASSES_ROOT, keyname, KEY_READ, &This->key);
}
return (LPENUMGUID)This;
This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(CLSID_IEnumGUIDImpl));
if (!This) return E_OUTOFMEMORY;
This->IEnumGUID_iface.lpVtbl = &CLSIDEnumGUIDVtbl;
This->ref = 1;
This->categories = categories;
open_classes_key(HKEY_CLASSES_ROOT, keyname, KEY_READ, &This->key);
*ret = &This->IEnumGUID_iface;
return S_OK;
}
/**********************************************************************
@@ -1159,23 +1174,20 @@ static LPENUMGUID COMCAT_CLSID_IEnumGUID_Construct(struct class_categories *cate
*/
typedef struct
{
const IEnumGUIDVtbl *lpVtbl;
IEnumGUID IEnumGUID_iface;
LONG ref;
WCHAR keyname[68];
HKEY key;
DWORD next_index;
} CATID_IEnumGUIDImpl;
static ULONG WINAPI COMCAT_CATID_IEnumGUID_AddRef(LPENUMGUID iface)
static inline CATID_IEnumGUIDImpl *impl_from_IEnumCATID(IEnumGUID *iface)
{
CATID_IEnumGUIDImpl *This = (CATID_IEnumGUIDImpl *)iface;
TRACE("\n");
return InterlockedIncrement(&This->ref);
return CONTAINING_RECORD(iface, CATID_IEnumGUIDImpl, IEnumGUID_iface);
}
static HRESULT WINAPI COMCAT_CATID_IEnumGUID_QueryInterface(
LPENUMGUID iface,
static HRESULT WINAPI CATIDEnumGUID_QueryInterface(
IEnumGUID *iface,
REFIID riid,
LPVOID *ppvObj)
{
@@ -1187,16 +1199,24 @@ static HRESULT WINAPI COMCAT_CATID_IEnumGUID_QueryInterface(
IsEqualGUID(riid, &IID_IEnumGUID))
{
*ppvObj = iface;
COMCAT_CATID_IEnumGUID_AddRef(iface);
IEnumGUID_AddRef(iface);
return S_OK;
}
return E_NOINTERFACE;
}
static ULONG WINAPI COMCAT_CATID_IEnumGUID_Release(LPENUMGUID iface)
static ULONG WINAPI CATIDEnumGUID_AddRef(IEnumGUID *iface)
{
CATID_IEnumGUIDImpl *This = (CATID_IEnumGUIDImpl *)iface;
CATID_IEnumGUIDImpl *This = impl_from_IEnumCATID(iface);
TRACE("\n");
return InterlockedIncrement(&This->ref);
}
static ULONG WINAPI CATIDEnumGUID_Release(IEnumGUID *iface)
{
CATID_IEnumGUIDImpl *This = impl_from_IEnumCATID(iface);
ULONG ref;
TRACE("\n");
@@ -1210,13 +1230,13 @@ static ULONG WINAPI COMCAT_CATID_IEnumGUID_Release(LPENUMGUID iface)
return ref;
}
static HRESULT WINAPI COMCAT_CATID_IEnumGUID_Next(
LPENUMGUID iface,
static HRESULT WINAPI CATIDEnumGUID_Next(
IEnumGUID *iface,
ULONG celt,
GUID *rgelt,
ULONG *pceltFetched)
{
CATID_IEnumGUIDImpl *This = (CATID_IEnumGUIDImpl *)iface;
CATID_IEnumGUIDImpl *This = impl_from_IEnumCATID(iface);
ULONG fetched = 0;
TRACE("\n");
@@ -1226,8 +1246,8 @@ static HRESULT WINAPI COMCAT_CATID_IEnumGUID_Next(
if (This->key) while (fetched < celt) {
LSTATUS res;
HRESULT hr;
WCHAR catid[39];
DWORD cName = 39;
WCHAR catid[CHARS_IN_GUID];
DWORD cName = CHARS_IN_GUID;
res = RegEnumKeyExW(This->key, This->next_index, catid, &cName,
NULL, NULL, NULL, NULL);
@@ -1245,11 +1265,11 @@ static HRESULT WINAPI COMCAT_CATID_IEnumGUID_Next(
return fetched == celt ? S_OK : S_FALSE;
}
static HRESULT WINAPI COMCAT_CATID_IEnumGUID_Skip(
LPENUMGUID iface,
static HRESULT WINAPI CATIDEnumGUID_Skip(
IEnumGUID *iface,
ULONG celt)
{
CATID_IEnumGUIDImpl *This = (CATID_IEnumGUIDImpl *)iface;
CATID_IEnumGUIDImpl *This = impl_from_IEnumCATID(iface);
TRACE("\n");
@@ -1258,9 +1278,9 @@ static HRESULT WINAPI COMCAT_CATID_IEnumGUID_Skip(
return S_OK;
}
static HRESULT WINAPI COMCAT_CATID_IEnumGUID_Reset(LPENUMGUID iface)
static HRESULT WINAPI CATIDEnumGUID_Reset(IEnumGUID *iface)
{
CATID_IEnumGUIDImpl *This = (CATID_IEnumGUIDImpl *)iface;
CATID_IEnumGUIDImpl *This = impl_from_IEnumCATID(iface);
TRACE("\n");
@@ -1268,11 +1288,11 @@ static HRESULT WINAPI COMCAT_CATID_IEnumGUID_Reset(LPENUMGUID iface)
return S_OK;
}
static HRESULT WINAPI COMCAT_CATID_IEnumGUID_Clone(
LPENUMGUID iface,
static HRESULT WINAPI CATIDEnumGUID_Clone(
IEnumGUID *iface,
IEnumGUID **ppenum)
{
CATID_IEnumGUIDImpl *This = (CATID_IEnumGUIDImpl *)iface;
CATID_IEnumGUIDImpl *This = impl_from_IEnumCATID(iface);
CATID_IEnumGUIDImpl *new_this;
TRACE("\n");
@@ -1282,42 +1302,49 @@ static HRESULT WINAPI COMCAT_CATID_IEnumGUID_Clone(
new_this = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(CATID_IEnumGUIDImpl));
if (new_this == NULL) return E_OUTOFMEMORY;
new_this->lpVtbl = This->lpVtbl;
new_this->IEnumGUID_iface.lpVtbl = This->IEnumGUID_iface.lpVtbl;
new_this->ref = 1;
lstrcpyW(new_this->keyname, This->keyname);
/* FIXME: could we more efficiently use DuplicateHandle? */
open_classes_key(HKEY_CLASSES_ROOT, new_this->keyname, KEY_READ, &new_this->key);
new_this->next_index = This->next_index;
*ppenum = (LPENUMGUID)new_this;
*ppenum = &new_this->IEnumGUID_iface;
return S_OK;
}
static const IEnumGUIDVtbl COMCAT_CATID_IEnumGUID_Vtbl =
static const IEnumGUIDVtbl CATIDEnumGUIDVtbl =
{
COMCAT_CATID_IEnumGUID_QueryInterface,
COMCAT_CATID_IEnumGUID_AddRef,
COMCAT_CATID_IEnumGUID_Release,
COMCAT_CATID_IEnumGUID_Next,
COMCAT_CATID_IEnumGUID_Skip,
COMCAT_CATID_IEnumGUID_Reset,
COMCAT_CATID_IEnumGUID_Clone
CATIDEnumGUID_QueryInterface,
CATIDEnumGUID_AddRef,
CATIDEnumGUID_Release,
CATIDEnumGUID_Next,
CATIDEnumGUID_Skip,
CATIDEnumGUID_Reset,
CATIDEnumGUID_Clone
};
static LPENUMGUID COMCAT_CATID_IEnumGUID_Construct(
REFCLSID rclsid, LPCWSTR postfix)
static HRESULT CATIDEnumGUID_Construct(REFCLSID rclsid, LPCWSTR postfix, IEnumGUID **ret)
{
static const WCHAR prefixW[] = {'C','L','S','I','D','\\',0};
WCHAR keyname[100], clsidW[CHARS_IN_GUID];
CATID_IEnumGUIDImpl *This;
This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(CATID_IEnumGUIDImpl));
if (This) {
WCHAR prefix[] = { 'C', 'L', 'S', 'I', 'D', '\\' };
*ret = NULL;
This->lpVtbl = &COMCAT_CATID_IEnumGUID_Vtbl;
memcpy(This->keyname, prefix, sizeof(prefix));
StringFromGUID2(rclsid, This->keyname + 6, 39);
lstrcpyW(This->keyname + 44, postfix);
open_classes_key(HKEY_CLASSES_ROOT, This->keyname, KEY_READ, &This->key);
}
return (LPENUMGUID)This;
This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(CATID_IEnumGUIDImpl));
if (!This) return E_OUTOFMEMORY;
StringFromGUID2(rclsid, clsidW, CHARS_IN_GUID);
This->IEnumGUID_iface.lpVtbl = &CATIDEnumGUIDVtbl;
This->ref = 1;
strcpyW(keyname, prefixW);
strcatW(keyname, clsidW);
strcatW(keyname, postfix);
open_classes_key(HKEY_CLASSES_ROOT, keyname, KEY_READ, &This->key);
*ret = &This->IEnumGUID_iface;
return S_OK;
}
File diff suppressed because it is too large Load Diff
@@ -304,6 +304,8 @@ extern UINT ole_private_data_clipboard_format DECLSPEC_HIDDEN;
extern LSTATUS create_classes_key(HKEY, const WCHAR *, REGSAM, HKEY *) DECLSPEC_HIDDEN;
extern LSTATUS open_classes_key(HKEY, const WCHAR *, REGSAM, HKEY *) DECLSPEC_HIDDEN;
extern BOOL actctx_get_miscstatus(const CLSID*, DWORD, DWORD*) DECLSPEC_HIDDEN;
static inline void *heap_alloc(size_t len)
{
return HeapAlloc(GetProcessHeap(), 0, len);
+5 -3
View File
@@ -22,7 +22,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(ole);
#define BLOCK_TAB_SIZE 5 /* represent the first size table and it's increment block size */
#define BLOCK_TAB_SIZE 5 /* represent the first size table and its increment block size */
/* CompositeMoniker data structure */
typedef struct CompositeMonikerImpl{
@@ -141,7 +141,7 @@ CompositeMonikerImpl_Release(IMoniker* iface)
ref = InterlockedDecrement(&This->ref);
/* destroy the object if there's no more reference on it */
/* destroy the object if there are no more references to it */
if (ref == 0){
/* release all the components before destroying this object */
@@ -1527,7 +1527,7 @@ EnumMonikerImpl_Release(IEnumMoniker* iface)
ref = InterlockedDecrement(&This->ref);
/* destroy the object if there's no more reference on it */
/* destroy the object if there are no more references to it */
if (ref == 0) {
for(i=0;i<This->tabSize;i++)
@@ -1923,10 +1923,12 @@ CreateGenericComposite(IMoniker *pmkFirst, IMoniker *pmkRest, IMoniker **ppmkCom
if (pmkFirst==NULL && pmkRest!=NULL){
*ppmkComposite=pmkRest;
IMoniker_AddRef(pmkRest);
return S_OK;
}
else if (pmkFirst!=NULL && pmkRest==NULL){
*ppmkComposite=pmkFirst;
IMoniker_AddRef(pmkFirst);
return S_OK;
}
else if (pmkFirst==NULL && pmkRest==NULL)
+3
View File
@@ -19,6 +19,9 @@
/* see the official DCOM specification
* (there's a copy at http://www.grimes.demon.co.uk/DCOM/DCOMSpec.htm) */
#pragma makedep proxy
#pragma makedep register
import "unknwn.idl";
[
+83 -83
View File
@@ -119,7 +119,7 @@ FileMonikerImpl_Release(IMoniker* iface)
ref = InterlockedDecrement(&This->ref);
/* destroy the object if there's no more reference on it */
/* destroy the object if there are no more references to it */
if (ref == 0) FileMonikerImpl_Destroy(This);
return ref;
@@ -918,11 +918,12 @@ static HRESULT WINAPI
FileMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOther,IMoniker** ppmkPrefix)
{
LPOLESTR pathThis,pathOther,*stringTable1,*stringTable2,commonPath;
IBindCtx *pbind;
LPOLESTR pathThis = NULL, pathOther = NULL,*stringTable1,*stringTable2,commonPath = NULL;
IBindCtx *bindctx;
DWORD mkSys;
ULONG nb1,nb2,i,sameIdx;
BOOL machimeNameCase=FALSE;
BOOL machineNameCase = FALSE;
HRESULT ret;
if (ppmkPrefix==NULL)
return E_POINTER;
@@ -934,81 +935,81 @@ FileMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOther,IMoniker** p
/* check if we have the same type of moniker */
IMoniker_IsSystemMoniker(pmkOther,&mkSys);
if (mkSys != MKSYS_FILEMONIKER)
return MonikerCommonPrefixWith(iface, pmkOther, ppmkPrefix);
if(mkSys==MKSYS_FILEMONIKER){
HRESULT ret;
ret = CreateBindCtx(0,&pbind);
if (FAILED(ret))
return ret;
/* create a string based on common part of the two paths */
ret = IMoniker_GetDisplayName(iface,pbind,NULL,&pathThis);
if (FAILED(ret))
return ret;
ret = IMoniker_GetDisplayName(pmkOther,pbind,NULL,&pathOther);
if (FAILED(ret))
return ret;
nb1=FileMonikerImpl_DecomposePath(pathThis,&stringTable1);
if (FAILED(nb1))
return nb1;
nb2=FileMonikerImpl_DecomposePath(pathOther,&stringTable2);
if (FAILED(nb2))
{
free_stringtable(stringTable1);
return nb2;
}
if (nb1==0 || nb2==0)
{
free_stringtable(stringTable1);
free_stringtable(stringTable2);
return MK_E_NOPREFIX;
}
commonPath=HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*(min(lstrlenW(pathThis),lstrlenW(pathOther))+1));
if (!commonPath)
return E_OUTOFMEMORY;
*commonPath=0;
for(sameIdx=0; ( (stringTable1[sameIdx]!=NULL) &&
(stringTable2[sameIdx]!=NULL) &&
(lstrcmpiW(stringTable1[sameIdx],stringTable2[sameIdx])==0)); sameIdx++);
if (sameIdx > 1 && *stringTable1[0]=='\\' && *stringTable2[1]=='\\'){
machimeNameCase=TRUE;
for(i=2;i<sameIdx;i++)
if( (*stringTable1[i]=='\\') && (i+1 < sameIdx) && (*stringTable1[i+1]=='\\') ){
machimeNameCase=FALSE;
break;
}
}
if (machimeNameCase && *stringTable1[sameIdx-1]=='\\')
sameIdx--;
if (machimeNameCase && (sameIdx<=3) && (nb1 > 3 || nb2 > 3) )
ret = MK_E_NOPREFIX;
else
{
for(i=0;i<sameIdx;i++)
strcatW(commonPath,stringTable1[i]);
free_stringtable(stringTable1);
free_stringtable(stringTable2);
ret = CreateFileMoniker(commonPath,ppmkPrefix);
}
HeapFree(GetProcessHeap(),0,commonPath);
ret = CreateBindCtx(0, &bindctx);
if (FAILED(ret))
return ret;
/* create a string based on common part of the two paths */
ret = IMoniker_GetDisplayName(iface, bindctx, NULL, &pathThis);
if (FAILED(ret))
goto failed;
ret = IMoniker_GetDisplayName(pmkOther, bindctx, NULL, &pathOther);
if (FAILED(ret))
goto failed;
nb1 = FileMonikerImpl_DecomposePath(pathThis, &stringTable1);
if (FAILED(nb1)) {
ret = nb1;
goto failed;
}
nb2 = FileMonikerImpl_DecomposePath(pathOther, &stringTable2);
if (FAILED(nb2)) {
ret = nb2;
goto failed;
}
if (nb1 == 0 || nb2 == 0) {
ret = MK_E_NOPREFIX;
goto failed;
}
commonPath = CoTaskMemAlloc(sizeof(WCHAR)*(min(lstrlenW(pathThis),lstrlenW(pathOther))+1));
if (!commonPath) {
ret = E_OUTOFMEMORY;
goto failed;
}
*commonPath = 0;
for(sameIdx=0; ( (stringTable1[sameIdx]!=NULL) &&
(stringTable2[sameIdx]!=NULL) &&
(lstrcmpiW(stringTable1[sameIdx],stringTable2[sameIdx])==0)); sameIdx++);
if (sameIdx > 1 && *stringTable1[0]=='\\' && *stringTable2[1]=='\\'){
machineNameCase = TRUE;
for(i=2;i<sameIdx;i++)
if( (*stringTable1[i]=='\\') && (i+1 < sameIdx) && (*stringTable1[i+1]=='\\') ){
machineNameCase = FALSE;
break;
}
}
if (machineNameCase && *stringTable1[sameIdx-1]=='\\')
sameIdx--;
if (machineNameCase && (sameIdx<=3) && (nb1 > 3 || nb2 > 3) )
ret = MK_E_NOPREFIX;
else
return MonikerCommonPrefixWith(iface,pmkOther,ppmkPrefix);
{
for (i = 0; i < sameIdx; i++)
strcatW(commonPath,stringTable1[i]);
ret = CreateFileMoniker(commonPath, ppmkPrefix);
}
failed:
IBindCtx_Release(bindctx);
CoTaskMemFree(pathThis);
CoTaskMemFree(pathOther);
CoTaskMemFree(commonPath);
free_stringtable(stringTable1);
free_stringtable(stringTable2);
return ret;
}
/******************************************************************************
@@ -1088,8 +1089,7 @@ lend:
CoTaskMemFree(strgtable);
}
if (word)
CoTaskMemFree(word);
CoTaskMemFree(word);
return ret;
}
@@ -1343,7 +1343,7 @@ static HRESULT FileMonikerImpl_Construct(FileMonikerImpl* This, LPCOLESTR lpszPa
LPOLESTR *tabStr=0;
static const WCHAR twoPoint[]={'.','.',0};
static const WCHAR bkSlash[]={'\\',0};
BYTE addBkSlash;
BOOL addBkSlash;
TRACE("(%p,%s)\n",This,debugstr_w(lpszPathName));
@@ -1364,14 +1364,14 @@ static HRESULT FileMonikerImpl_Construct(FileMonikerImpl* This, LPCOLESTR lpszPa
if (nb > 0 ){
addBkSlash=1;
addBkSlash = TRUE;
if (lstrcmpW(tabStr[0],twoPoint)!=0)
addBkSlash=0;
addBkSlash = FALSE;
else
for(i=0;i<nb;i++){
if ( (lstrcmpW(tabStr[i],twoPoint)!=0) && (lstrcmpW(tabStr[i],bkSlash)!=0) ){
addBkSlash=0;
addBkSlash = FALSE;
break;
}
else
@@ -1379,13 +1379,13 @@ static HRESULT FileMonikerImpl_Construct(FileMonikerImpl* This, LPCOLESTR lpszPa
if (lstrcmpW(tabStr[i],bkSlash)==0 && i<nb-1 && lstrcmpW(tabStr[i+1],bkSlash)==0){
*tabStr[i]=0;
sizeStr--;
addBkSlash=0;
addBkSlash = FALSE;
break;
}
}
if (lstrcmpW(tabStr[nb-1],bkSlash)==0)
addBkSlash=0;
addBkSlash = FALSE;
This->filePathName=HeapReAlloc(GetProcessHeap(),0,This->filePathName,(sizeStr+1)*sizeof(WCHAR));
+16 -16
View File
@@ -57,7 +57,7 @@ static CRITICAL_SECTION_DEBUG critsect_debug =
static CRITICAL_SECTION IMalloc32_SpyCS = { &critsect_debug, -1, 0, 0, 0, 0 };
/* resize the old table */
static int SetSpyedBlockTableLength ( DWORD NewLength )
static BOOL SetSpyedBlockTableLength ( DWORD NewLength )
{
LPVOID *NewSpyedBlocks;
@@ -72,14 +72,13 @@ static int SetSpyedBlockTableLength ( DWORD NewLength )
}
/* add a location to the table */
static int AddMemoryLocation(LPVOID * pMem)
static BOOL AddMemoryLocation(LPVOID * pMem)
{
LPVOID * Current;
/* allocate the table if not already allocated */
if (!Malloc32.SpyedBlockTableLength) {
if (!SetSpyedBlockTableLength(0x1000)) return 0;
}
if (!Malloc32.SpyedBlockTableLength && !SetSpyedBlockTableLength(0x1000))
return FALSE;
/* find a free location */
Current = Malloc32.SpyedBlocks;
@@ -88,7 +87,8 @@ static int AddMemoryLocation(LPVOID * pMem)
if (Current >= Malloc32.SpyedBlocks + Malloc32.SpyedBlockTableLength) {
/* no more space in table, grow it */
DWORD old_length = Malloc32.SpyedBlockTableLength;
if (!SetSpyedBlockTableLength( Malloc32.SpyedBlockTableLength + 0x1000 )) return 0;
if (!SetSpyedBlockTableLength( Malloc32.SpyedBlockTableLength + 0x1000))
return FALSE;
Current = Malloc32.SpyedBlocks + old_length;
}
};
@@ -97,31 +97,31 @@ static int AddMemoryLocation(LPVOID * pMem)
*Current = pMem;
Malloc32.SpyedAllocationsLeft++;
/*TRACE("%lu\n",Malloc32.SpyedAllocationsLeft);*/
return 1;
return TRUE;
}
static int RemoveMemoryLocation(LPCVOID pMem)
static BOOL RemoveMemoryLocation(LPCVOID pMem)
{
LPVOID * Current;
/* allocate the table if not already allocated */
if (!Malloc32.SpyedBlockTableLength) {
if (!SetSpyedBlockTableLength(0x1000)) return 0;
}
if (!Malloc32.SpyedBlockTableLength && !SetSpyedBlockTableLength(0x1000))
return FALSE;
Current = Malloc32.SpyedBlocks;
/* find the location */
while (*Current != pMem) {
Current++;
if (Current >= Malloc32.SpyedBlocks + Malloc32.SpyedBlockTableLength) return 0; /* not found */
if (Current >= Malloc32.SpyedBlocks + Malloc32.SpyedBlockTableLength)
return FALSE; /* not found */
}
/* location found */
Malloc32.SpyedAllocationsLeft--;
/*TRACE("%lu\n",Malloc32.SpyedAllocationsLeft);*/
*Current = NULL;
return 1;
return TRUE;
}
/******************************************************************************
@@ -236,7 +236,7 @@ static LPVOID WINAPI IMalloc_fnRealloc(LPMALLOC iface,LPVOID pv,DWORD cb) {
*/
static VOID WINAPI IMalloc_fnFree(LPMALLOC iface,LPVOID pv) {
BOOL fSpyed = 0;
BOOL fSpyed = FALSE;
TRACE("(%p)\n",pv);
@@ -273,7 +273,7 @@ static VOID WINAPI IMalloc_fnFree(LPMALLOC iface,LPVOID pv) {
static DWORD WINAPI IMalloc_fnGetSize(LPMALLOC iface,LPVOID pv) {
DWORD cb;
BOOL fSpyed = 0;
BOOL fSpyed = FALSE;
TRACE("(%p)\n",pv);
@@ -297,7 +297,7 @@ static DWORD WINAPI IMalloc_fnGetSize(LPMALLOC iface,LPVOID pv) {
*/
static INT WINAPI IMalloc_fnDidAlloc(LPMALLOC iface,LPVOID pv) {
BOOL fSpyed = 0;
BOOL fSpyed = FALSE;
int didAlloc;
TRACE("(%p)\n",pv);
+2
View File
@@ -16,4 +16,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#pragma makedep client
#include "wine/irot.idl"
+1 -1
View File
@@ -107,7 +107,7 @@ static ULONG WINAPI ItemMonikerImpl_Release(IMoniker* iface)
ref = InterlockedDecrement(&This->ref);
/* destroy the object if there's no more reference on it */
/* destroy the object if there are no more references to it */
if (ref == 0) ItemMonikerImpl_Destroy(This);
return ref;
+42 -41
View File
@@ -92,7 +92,8 @@ static inline HRESULT get_facbuf_for_iid(REFIID riid, IPSFactoryBuffer **facbuf)
HRESULT hr;
CLSID clsid;
if ((hr = CoGetPSClsid(riid, &clsid)))
hr = CoGetPSClsid(riid, &clsid);
if (hr != S_OK)
return hr;
return CoGetClassObject(&clsid, CLSCTX_INPROC_SERVER | WINE_CLSCTX_DONT_HOST,
NULL, &IID_IPSFactoryBuffer, (LPVOID*)facbuf);
@@ -1150,15 +1151,17 @@ HRESULT apartment_disconnectproxies(struct apartment *apt)
/********************** StdMarshal implementation ****************************/
typedef struct _StdMarshalImpl
{
const IMarshalVtbl *lpvtbl;
LONG ref;
IID iid;
DWORD dwDestContext;
LPVOID pvDestContext;
DWORD mshlflags;
IMarshal IMarshal_iface;
LONG ref;
DWORD dest_context;
void *dest_context_data;
} StdMarshalImpl;
static inline StdMarshalImpl *impl_from_StdMarshal(IMarshal *iface)
{
return CONTAINING_RECORD(iface, StdMarshalImpl, IMarshal_iface);
}
static HRESULT WINAPI
StdMarshalImpl_QueryInterface(IMarshal *iface, REFIID riid, void **ppv)
{
@@ -1174,16 +1177,16 @@ StdMarshalImpl_QueryInterface(IMarshal *iface, REFIID riid, void **ppv)
}
static ULONG WINAPI
StdMarshalImpl_AddRef(LPMARSHAL iface)
StdMarshalImpl_AddRef(IMarshal *iface)
{
StdMarshalImpl *This = (StdMarshalImpl *)iface;
StdMarshalImpl *This = impl_from_StdMarshal(iface);
return InterlockedIncrement(&This->ref);
}
static ULONG WINAPI
StdMarshalImpl_Release(LPMARSHAL iface)
StdMarshalImpl_Release(IMarshal *iface)
{
StdMarshalImpl *This = (StdMarshalImpl *)iface;
StdMarshalImpl *This = impl_from_StdMarshal(iface);
ULONG ref = InterlockedDecrement(&This->ref);
if (!ref) HeapFree(GetProcessHeap(),0,This);
@@ -1192,7 +1195,7 @@ StdMarshalImpl_Release(LPMARSHAL iface)
static HRESULT WINAPI
StdMarshalImpl_GetUnmarshalClass(
LPMARSHAL iface, REFIID riid, void* pv, DWORD dwDestContext,
IMarshal *iface, REFIID riid, void* pv, DWORD dwDestContext,
void* pvDestContext, DWORD mshlflags, CLSID* pCid)
{
*pCid = CLSID_DfMarshal;
@@ -1201,7 +1204,7 @@ StdMarshalImpl_GetUnmarshalClass(
static HRESULT WINAPI
StdMarshalImpl_GetMarshalSizeMax(
LPMARSHAL iface, REFIID riid, void* pv, DWORD dwDestContext,
IMarshal *iface, REFIID riid, void* pv, DWORD dwDestContext,
void* pvDestContext, DWORD mshlflags, DWORD* pSize)
{
*pSize = sizeof(STDOBJREF);
@@ -1210,7 +1213,7 @@ StdMarshalImpl_GetMarshalSizeMax(
static HRESULT WINAPI
StdMarshalImpl_MarshalInterface(
LPMARSHAL iface, IStream *pStm,REFIID riid, void* pv, DWORD dest_context,
IMarshal *iface, IStream *pStm,REFIID riid, void* pv, DWORD dest_context,
void* dest_context_data, DWORD mshlflags)
{
STDOBJREF stdobjref;
@@ -1312,9 +1315,9 @@ static HRESULT unmarshal_object(const STDOBJREF *stdobjref, APARTMENT *apt,
}
static HRESULT WINAPI
StdMarshalImpl_UnmarshalInterface(LPMARSHAL iface, IStream *pStm, REFIID riid, void **ppv)
StdMarshalImpl_UnmarshalInterface(IMarshal *iface, IStream *pStm, REFIID riid, void **ppv)
{
StdMarshalImpl *This = (StdMarshalImpl *)iface;
StdMarshalImpl *This = impl_from_StdMarshal(iface);
struct stub_manager *stubmgr = NULL;
STDOBJREF stdobjref;
ULONG res;
@@ -1380,8 +1383,8 @@ StdMarshalImpl_UnmarshalInterface(LPMARSHAL iface, IStream *pStm, REFIID riid, v
wine_dbgstr_longlong(stdobjref.oxid));
if (hres == S_OK)
hres = unmarshal_object(&stdobjref, apt, This->dwDestContext,
This->pvDestContext, riid,
hres = unmarshal_object(&stdobjref, apt, This->dest_context,
This->dest_context_data, riid,
stubmgr ? &stubmgr->oxid_info : NULL, ppv);
if (stubmgr) stub_manager_int_release(stubmgr);
@@ -1394,7 +1397,7 @@ StdMarshalImpl_UnmarshalInterface(LPMARSHAL iface, IStream *pStm, REFIID riid, v
}
static HRESULT WINAPI
StdMarshalImpl_ReleaseMarshalData(LPMARSHAL iface, IStream *pStm)
StdMarshalImpl_ReleaseMarshalData(IMarshal *iface, IStream *pStm)
{
STDOBJREF stdobjref;
ULONG res;
@@ -1436,13 +1439,13 @@ StdMarshalImpl_ReleaseMarshalData(LPMARSHAL iface, IStream *pStm)
}
static HRESULT WINAPI
StdMarshalImpl_DisconnectObject(LPMARSHAL iface, DWORD dwReserved)
StdMarshalImpl_DisconnectObject(IMarshal *iface, DWORD dwReserved)
{
FIXME("(), stub!\n");
return S_OK;
}
static const IMarshalVtbl VT_StdMarshal =
static const IMarshalVtbl StdMarshalVtbl =
{
StdMarshalImpl_QueryInterface,
StdMarshalImpl_AddRef,
@@ -1455,15 +1458,24 @@ static const IMarshalVtbl VT_StdMarshal =
StdMarshalImpl_DisconnectObject
};
static HRESULT StdMarshalImpl_Construct(REFIID riid, void** ppvObject)
static HRESULT StdMarshalImpl_Construct(REFIID riid, DWORD dest_context, void *dest_context_data, void** ppvObject)
{
StdMarshalImpl * pStdMarshal =
HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(StdMarshalImpl));
HRESULT hr;
StdMarshalImpl *pStdMarshal = HeapAlloc(GetProcessHeap(), 0, sizeof(StdMarshalImpl));
if (!pStdMarshal)
return E_OUTOFMEMORY;
pStdMarshal->lpvtbl = &VT_StdMarshal;
pStdMarshal->IMarshal_iface.lpVtbl = &StdMarshalVtbl;
pStdMarshal->ref = 0;
return IMarshal_QueryInterface((IMarshal*)pStdMarshal, riid, ppvObject);
pStdMarshal->dest_context = dest_context;
pStdMarshal->dest_context_data = dest_context_data;
hr = IMarshal_QueryInterface(&pStdMarshal->IMarshal_iface, riid, ppvObject);
if (FAILED(hr))
HeapFree(GetProcessHeap(), 0, pStdMarshal);
return hr;
}
/***********************************************************************
@@ -1493,8 +1505,6 @@ HRESULT WINAPI CoGetStandardMarshal(REFIID riid, IUnknown *pUnk,
DWORD dwDestContext, LPVOID pvDestContext,
DWORD mshlflags, LPMARSHAL *ppMarshal)
{
StdMarshalImpl *dm;
if (pUnk == NULL)
{
FIXME("(%s,NULL,%x,%p,%x,%p), unimplemented yet.\n",
@@ -1503,17 +1513,8 @@ HRESULT WINAPI CoGetStandardMarshal(REFIID riid, IUnknown *pUnk,
}
TRACE("(%s,%p,%x,%p,%x,%p)\n",
debugstr_guid(riid),pUnk,dwDestContext,pvDestContext,mshlflags,ppMarshal);
*ppMarshal = HeapAlloc(GetProcessHeap(),0,sizeof(StdMarshalImpl));
dm = (StdMarshalImpl*) *ppMarshal;
if (!dm) return E_FAIL;
dm->lpvtbl = &VT_StdMarshal;
dm->ref = 1;
dm->iid = *riid;
dm->dwDestContext = dwDestContext;
dm->pvDestContext = pvDestContext;
dm->mshlflags = mshlflags;
return S_OK;
return StdMarshalImpl_Construct(&IID_IMarshal, dwDestContext, pvDestContext, (void**)ppMarshal);
}
/***********************************************************************
@@ -1570,7 +1571,7 @@ static HRESULT get_unmarshaler_from_stream(IStream *stream, IMarshal **marshal,
if (objref.flags & OBJREF_STANDARD)
{
TRACE("Using standard unmarshaling\n");
hr = StdMarshalImpl_Construct(&IID_IMarshal, (LPVOID*)marshal);
hr = StdMarshalImpl_Construct(&IID_IMarshal, 0, NULL, (LPVOID*)marshal);
}
else if (objref.flags & OBJREF_CUSTOM)
{
@@ -2007,7 +2008,7 @@ static HRESULT WINAPI StdMarshalCF_CreateInstance(LPCLASSFACTORY iface,
LPUNKNOWN pUnk, REFIID riid, LPVOID *ppv)
{
if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IMarshal))
return StdMarshalImpl_Construct(riid, ppv);
return StdMarshalImpl_Construct(riid, 0, NULL, ppv);
FIXME("(%s), not supported.\n",debugstr_guid(riid));
return E_NOINTERFACE;
+8 -4
View File
@@ -371,7 +371,7 @@ RunningObjectTableImpl_Release(IRunningObjectTable* iface)
ref = InterlockedDecrement(&This->ref);
/* uninitialize ROT structure if there's no more references to it */
/* uninitialize ROT structure if there are no more references to it */
if (ref == 0)
{
struct list *cursor, *cursor2;
@@ -1230,8 +1230,10 @@ HRESULT WINAPI GetClassFile(LPCOLESTR filePathName,CLSID *pclsid)
absFile=pathDec[nbElm-1];
/* failed if the path represents a directory and not an absolute file name*/
if (!lstrcmpW(absFile, bkslashW))
if (!lstrcmpW(absFile, bkslashW)) {
CoTaskMemFree(pathDec);
return MK_E_INVALIDEXTENSION;
}
/* get the extension of the file */
extension = NULL;
@@ -1239,8 +1241,10 @@ HRESULT WINAPI GetClassFile(LPCOLESTR filePathName,CLSID *pclsid)
for(i = length-1; (i >= 0) && *(extension = &absFile[i]) != '.'; i--)
/* nothing */;
if (!extension || !lstrcmpW(extension, dotW))
if (!extension || !lstrcmpW(extension, dotW)) {
CoTaskMemFree(pathDec);
return MK_E_INVALIDEXTENSION;
}
res=RegQueryValueW(HKEY_CLASSES_ROOT, extension, NULL, &sizeProgId);
@@ -1317,7 +1321,7 @@ static ULONG WINAPI EnumMonikerImpl_Release(IEnumMoniker* iface)
ref = InterlockedDecrement(&This->ref);
/* uninitialize rot structure if there's no more reference to it*/
/* uninitialize ROT structure if there are no more references to it */
if (ref == 0)
{
ULONG i;
+102 -56
View File
@@ -30,7 +30,7 @@ WINE_DECLARE_DEBUG_CHANNEL(accel);
/******************************************************************************
* These are static/global variables and internal data structures that the
* OLE module uses to maintain it's state.
* OLE module uses to maintain its state.
*/
typedef struct tagTrackerWindowInfo
{
@@ -43,7 +43,7 @@ typedef struct tagTrackerWindowInfo
BOOL escPressed;
HWND curTargetHWND; /* window the mouse is hovering over */
HWND curDragTargetHWND; /* might be a ancestor of curTargetHWND */
HWND curDragTargetHWND; /* might be an ancestor of curTargetHWND */
IDropTarget* curDragTarget;
POINTL curMousePos; /* current position of the mouse in screen coordinates */
DWORD dwKeyState; /* current state of the shift and ctrl keys and the mouse buttons */
@@ -131,7 +131,6 @@ extern void OLEClipbrd_Initialize(void);
*/
static void OLEDD_Initialize(void);
static LRESULT WINAPI OLEDD_DragTrackerWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
static void OLEDD_TrackMouseMove(TrackerWindowInfo* trackerInfo);
static void OLEDD_TrackStateChange(TrackerWindowInfo* trackerInfo);
static DWORD OLEDD_GetButtonState(void);
@@ -869,6 +868,8 @@ HRESULT WINAPI OleRegGetMiscStatus(
*pdwStatus = 0;
if (actctx_get_miscstatus(clsid, dwAspect, pdwStatus)) return S_OK;
/*
* Open the class id Key
*/
@@ -1304,7 +1305,7 @@ HRESULT WINAPI OleLoad(
if (SUCCEEDED(hres) && pClientSite)
/*
* Inform the new object of it's client site.
* Inform the new object of its client site.
*/
hres = IOleObject_SetClientSite(pOleObject, pClientSite);
@@ -2171,10 +2172,6 @@ static LRESULT WINAPI OLEDD_DragTrackerWindowProc(
}
case WM_TIMER:
case WM_MOUSEMOVE:
{
OLEDD_TrackMouseMove((TrackerWindowInfo*)GetWindowLongPtrA(hwnd, 0));
break;
}
case WM_LBUTTONUP:
case WM_MBUTTONUP:
case WM_RBUTTONUP:
@@ -2199,19 +2196,16 @@ static LRESULT WINAPI OLEDD_DragTrackerWindowProc(
}
/***
* OLEDD_TrackMouseMove()
* OLEDD_TrackStateChange()
*
* This method is invoked while a drag and drop operation is in effect.
* it will generate the appropriate callbacks in the drop source
* and drop target. It will also provide the expected feedback to
* the user.
*
* params:
* trackerInfo - Pointer to the structure identifying the
* drag & drop operation that is currently
* active.
*/
static void OLEDD_TrackMouseMove(TrackerWindowInfo* trackerInfo)
static void OLEDD_TrackStateChange(TrackerWindowInfo* trackerInfo)
{
HWND hwndNewTarget = 0;
HRESULT hr = S_OK;
@@ -2224,6 +2218,10 @@ static void OLEDD_TrackMouseMove(TrackerWindowInfo* trackerInfo)
pt.y = trackerInfo->curMousePos.y;
hwndNewTarget = WindowFromPoint(pt);
trackerInfo->returnValue = IDropSource_QueryContinueDrag(trackerInfo->dropSource,
trackerInfo->escPressed,
trackerInfo->dwKeyState);
/*
* Every time, we re-initialize the effects passed to the
* IDropTarget to the effects allowed by the source.
@@ -2240,7 +2238,8 @@ static void OLEDD_TrackMouseMove(TrackerWindowInfo* trackerInfo)
IDropTarget_DragOver(trackerInfo->curDragTarget,
trackerInfo->dwKeyState,
trackerInfo->curMousePos,
trackerInfo->pdwEffect);
trackerInfo->pdwEffect);
*trackerInfo->pdwEffect &= trackerInfo->dwOKEffect;
}
else
{
@@ -2282,6 +2281,7 @@ static void OLEDD_TrackMouseMove(TrackerWindowInfo* trackerInfo)
trackerInfo->dwKeyState,
trackerInfo->curMousePos,
trackerInfo->pdwEffect);
*trackerInfo->pdwEffect &= trackerInfo->dwOKEffect;
/* failed DragEnter() means invalid target */
if (hr != S_OK)
@@ -2347,29 +2347,6 @@ static void OLEDD_TrackMouseMove(TrackerWindowInfo* trackerInfo)
SetCursor(hCur);
}
}
/***
* OLEDD_TrackStateChange()
*
* This method is invoked while a drag and drop operation is in effect.
* It is used to notify the drop target/drop source callbacks when
* the state of the keyboard or mouse button change.
*
* params:
* trackerInfo - Pointer to the structure identifying the
* drag & drop operation that is currently
* active.
*/
static void OLEDD_TrackStateChange(TrackerWindowInfo* trackerInfo)
{
/*
* Ask the drop source what to do with the operation.
*/
trackerInfo->returnValue = IDropSource_QueryContinueDrag(
trackerInfo->dropSource,
trackerInfo->escPressed,
trackerInfo->dwKeyState);
/*
* All the return valued will stop the operation except the S_OK
@@ -2402,18 +2379,18 @@ static void OLEDD_TrackStateChange(TrackerWindowInfo* trackerInfo)
*/
case DRAGDROP_S_DROP:
if (*trackerInfo->pdwEffect != DROPEFFECT_NONE)
IDropTarget_Drop(trackerInfo->curDragTarget,
trackerInfo->dataObject,
trackerInfo->dwKeyState,
trackerInfo->curMousePos,
trackerInfo->pdwEffect);
trackerInfo->returnValue = IDropTarget_Drop(trackerInfo->curDragTarget,
trackerInfo->dataObject,
trackerInfo->dwKeyState,
trackerInfo->curMousePos,
trackerInfo->pdwEffect);
else
IDropTarget_DragLeave(trackerInfo->curDragTarget);
break;
/*
* If the source told us that we should cancel, fool the drop
* target by telling it that the mouse left it's window.
* target by telling it that the mouse left its window.
* Also set the drop effect to "NONE" in case the application
* ignores the result of DoDragDrop.
*/
@@ -2715,8 +2692,59 @@ done:
*/
HRESULT WINAPI OleDoAutoConvert(LPSTORAGE pStg, LPCLSID pClsidNew)
{
FIXME("(%p,%p) : stub\n",pStg,pClsidNew);
return E_NOTIMPL;
WCHAR *user_type_old, *user_type_new;
CLIPFORMAT cf;
STATSTG stat;
CLSID clsid;
HRESULT hr;
TRACE("(%p, %p)\n", pStg, pClsidNew);
*pClsidNew = CLSID_NULL;
if(!pStg)
return E_INVALIDARG;
hr = IStorage_Stat(pStg, &stat, STATFLAG_NONAME);
if(FAILED(hr))
return hr;
*pClsidNew = stat.clsid;
hr = OleGetAutoConvert(&stat.clsid, &clsid);
if(FAILED(hr))
return hr;
hr = IStorage_SetClass(pStg, &clsid);
if(FAILED(hr))
return hr;
hr = ReadFmtUserTypeStg(pStg, &cf, &user_type_old);
if(FAILED(hr)) {
cf = 0;
user_type_new = NULL;
}
hr = OleRegGetUserType(&clsid, USERCLASSTYPE_FULL, &user_type_new);
if(FAILED(hr))
user_type_new = NULL;
hr = WriteFmtUserTypeStg(pStg, cf, user_type_new);
CoTaskMemFree(user_type_new);
if(FAILED(hr))
{
CoTaskMemFree(user_type_old);
IStorage_SetClass(pStg, &stat.clsid);
return hr;
}
hr = SetConvertStg(pStg, TRUE);
if(FAILED(hr))
{
WriteFmtUserTypeStg(pStg, cf, user_type_old);
IStorage_SetClass(pStg, &stat.clsid);
}
else
*pClsidNew = clsid;
CoTaskMemFree(user_type_old);
return hr;
}
/******************************************************************************
@@ -2809,6 +2837,8 @@ static inline HRESULT PROPVARIANT_ValidateType(VARTYPE vt)
case VT_UI2:
case VT_UI4:
case VT_UI8:
case VT_INT:
case VT_UINT:
case VT_LPSTR:
case VT_LPWSTR:
case VT_FILETIME:
@@ -2861,7 +2891,10 @@ HRESULT WINAPI PropVariantClear(PROPVARIANT * pvar) /* [in/out] */
hr = PROPVARIANT_ValidateType(pvar->vt);
if (FAILED(hr))
{
memset(pvar, 0, sizeof(*pvar));
return hr;
}
switch(pvar->vt)
{
@@ -2882,6 +2915,8 @@ HRESULT WINAPI PropVariantClear(PROPVARIANT * pvar) /* [in/out] */
case VT_UI2:
case VT_UI4:
case VT_UI8:
case VT_INT:
case VT_UINT:
case VT_FILETIME:
break;
case VT_STREAM:
@@ -2946,12 +2981,14 @@ HRESULT WINAPI PropVariantClear(PROPVARIANT * pvar) /* [in/out] */
}
}
else
{
WARN("Invalid/unsupported type %d\n", pvar->vt);
hr = STG_E_INVALIDPARAMETER;
}
}
ZeroMemory(pvar, sizeof(*pvar));
return S_OK;
memset(pvar, 0, sizeof(*pvar));
return hr;
}
/***********************************************************************
@@ -2988,6 +3025,8 @@ HRESULT WINAPI PropVariantCopy(PROPVARIANT *pvarDest, /* [out] */
case VT_ERROR:
case VT_I8:
case VT_UI8:
case VT_INT:
case VT_UINT:
case VT_R8:
case VT_CY:
case VT_DATE:
@@ -2997,21 +3036,28 @@ HRESULT WINAPI PropVariantCopy(PROPVARIANT *pvarDest, /* [out] */
case VT_STREAMED_OBJECT:
case VT_STORAGE:
case VT_STORED_OBJECT:
IUnknown_AddRef((LPUNKNOWN)pvarDest->u.pStream);
if (pvarDest->u.pStream)
IStream_AddRef(pvarDest->u.pStream);
break;
case VT_CLSID:
pvarDest->u.puuid = CoTaskMemAlloc(sizeof(CLSID));
*pvarDest->u.puuid = *pvarSrc->u.puuid;
break;
case VT_LPSTR:
len = strlen(pvarSrc->u.pszVal);
pvarDest->u.pszVal = CoTaskMemAlloc((len+1)*sizeof(CHAR));
CopyMemory(pvarDest->u.pszVal, pvarSrc->u.pszVal, (len+1)*sizeof(CHAR));
if (pvarSrc->u.pszVal)
{
len = strlen(pvarSrc->u.pszVal);
pvarDest->u.pszVal = CoTaskMemAlloc((len+1)*sizeof(CHAR));
CopyMemory(pvarDest->u.pszVal, pvarSrc->u.pszVal, (len+1)*sizeof(CHAR));
}
break;
case VT_LPWSTR:
len = lstrlenW(pvarSrc->u.pwszVal);
pvarDest->u.pwszVal = CoTaskMemAlloc((len+1)*sizeof(WCHAR));
CopyMemory(pvarDest->u.pwszVal, pvarSrc->u.pwszVal, (len+1)*sizeof(WCHAR));
if (pvarSrc->u.pwszVal)
{
len = lstrlenW(pvarSrc->u.pwszVal);
pvarDest->u.pwszVal = CoTaskMemAlloc((len+1)*sizeof(WCHAR));
CopyMemory(pvarDest->u.pwszVal, pvarSrc->u.pwszVal, (len+1)*sizeof(WCHAR));
}
break;
case VT_BLOB:
case VT_BLOB_OBJECT:
@@ -3071,7 +3117,7 @@ HRESULT WINAPI PropVariantCopy(PROPVARIANT *pvarDest, /* [out] */
return E_INVALIDARG;
}
len = pvarSrc->u.capropvar.cElems;
pvarDest->u.capropvar.pElems = CoTaskMemAlloc(len * elemSize);
pvarDest->u.capropvar.pElems = len ? CoTaskMemAlloc(len * elemSize) : NULL;
if (pvarSrc->vt == (VT_VECTOR | VT_VARIANT))
{
for (i = 0; i < len; i++)
+4 -4
View File
@@ -29,8 +29,8 @@
@ stdcall CoGetCurrentLogicalThreadId(ptr)
@ stdcall CoGetCurrentProcess()
@ stdcall CoGetDefaultContext(long ptr ptr)
@ stub CoGetInstanceFromFile #@ stdcall (ptr ptr ptr long wstr long ptr) return 0,ERR_NOTIMPLEMENTED
@ stub CoGetInstanceFromIStorage #@ stdcall (ptr ptr ptr long ptr long ptr) return 0,ERR_NOTIMPLEMENTED
@ stdcall CoGetInstanceFromFile(ptr ptr ptr long long wstr long ptr)
@ stdcall CoGetInstanceFromIStorage(ptr ptr ptr long ptr long ptr)
@ stdcall CoGetInterfaceAndReleaseStream(ptr ptr ptr)
@ stdcall CoGetMalloc(long ptr)
@ stdcall CoGetMarshalSizeMax(ptr ptr ptr long ptr long)
@@ -70,7 +70,7 @@
@ stdcall CoResumeClassObjects()
@ stdcall CoRevertToSelf()
@ stdcall CoRevokeClassObject(long)
@ stdcall CoRevokeInitializeSpy(double)
@ stdcall CoRevokeInitializeSpy(int64)
@ stdcall CoRevokeMallocSpy()
@ stdcall CoSetProxyBlanket(ptr long long ptr long long ptr long)
@ stdcall CoSetState(ptr)
@@ -164,7 +164,7 @@
@ stdcall HWND_UserMarshal(ptr ptr ptr)
@ stdcall HWND_UserSize(ptr long ptr)
@ stdcall HWND_UserUnmarshal(ptr ptr ptr)
@ stdcall IIDFromString(wstr ptr) CLSIDFromString
@ stdcall IIDFromString(wstr ptr)
@ stub I_RemoteMain
@ stdcall IsAccelerator(long long ptr long)
@ stdcall IsEqualGUID(ptr ptr)
+3
View File
@@ -20,6 +20,9 @@
including objidl.h at some point. This will cause all sorts of errors
so the easiest thing to do is just comment out our entire header. */
#pragma makedep proxy
#pragma makedep register
cpp_quote("#if 0 /* ole32_objidl.idl hack */")
#include "objidl.idl"
cpp_quote("#endif /* ole32_objidl.idl hack */")
+3
View File
@@ -16,6 +16,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#pragma makedep proxy
#pragma makedep register
#include "oleidl.idl"
[
+3
View File
@@ -20,6 +20,9 @@
including unknwn.h at some point. This will cause all sorts of errors
so the easiest thing to do is just comment out our entire header. */
#pragma makedep proxy
#pragma makedep register
cpp_quote("#if 0 /* oleaut32_unknwn.idl hack */")
#include "unknwn.idl"
cpp_quote("#endif /* oleaut32_unknwn.idl hack */")
+3 -3
View File
@@ -1375,8 +1375,8 @@ static HRESULT PropertyStorage_ReadFromStream(PropertyStorage_impl *This)
goto end;
}
/* wackiness alert: if the format ID is FMTID_DocSummaryInformation, there
* follow not one, but two sections. The first is the standard properties
* for the document summary information, and the second is user-defined
* follows not one, but two sections. The first contains the standard properties
* for the document summary information, and the second consists of user-defined
* properties. This is the only case in which multiple sections are
* allowed.
* Reading the second stream isn't implemented yet.
@@ -2746,7 +2746,7 @@ BOOLEAN WINAPI StgConvertPropertyToVariant(const SERIALIZEDPROPERTYVALUE* prop,
PropVariantInit(pvar);
}
return 0;
return FALSE;
}
SERIALIZEDPROPERTYVALUE* WINAPI StgConvertVariantToProperty(const PROPVARIANT *pvar,
+98 -77
View File
@@ -119,20 +119,20 @@ typedef struct TransactedDirEntry
DirRef transactedParentEntry;
/* True if this entry is being used. */
int inuse;
BOOL inuse;
/* True if data is up to date. */
int read;
BOOL read;
/* True if this entry has been modified. */
int dirty;
BOOL dirty;
/* True if this entry's stream has been modified. */
int stream_dirty;
BOOL stream_dirty;
/* True if this entry has been deleted in the transacted storage, but the
* delete has not yet been committed. */
int deleted;
BOOL deleted;
/* If this entry's stream has been modified, a reference to where the stream
* is stored in the snapshot file. */
@@ -1404,7 +1404,7 @@ static HRESULT insertIntoTree(
* The root storage contains some element, therefore, start the research
* for the appropriate location.
*/
BOOL found = 0;
BOOL found = FALSE;
DirRef current, next, previous, currentEntryId;
/*
@@ -1423,7 +1423,7 @@ static HRESULT insertIntoTree(
next = currentEntry.rightChild;
current = currentEntryId;
while (found == 0)
while (!found)
{
LONG diff = entryNameCmp( newEntry.name, currentEntry.name);
@@ -1442,7 +1442,7 @@ static HRESULT insertIntoTree(
StorageBaseImpl_WriteDirEntry(This,
current,
&currentEntry);
found = 1;
found = TRUE;
}
}
else if (diff > 0)
@@ -1460,7 +1460,7 @@ static HRESULT insertIntoTree(
StorageBaseImpl_WriteDirEntry(This,
current,
&currentEntry);
found = 1;
found = TRUE;
}
}
else
@@ -2767,7 +2767,7 @@ static HRESULT StorageImpl_Construct(
else
This->base.lockingrole = SWMR_None;
This->base.reverted = 0;
This->base.reverted = FALSE;
/*
* Initialize the big block cache.
@@ -2997,7 +2997,7 @@ static void StorageImpl_Invalidate(StorageBaseImpl* iface)
StorageBaseImpl_DeleteAll(&This->base);
This->base.reverted = 1;
This->base.reverted = TRUE;
}
static void StorageImpl_Destroy(StorageBaseImpl* iface)
@@ -4364,7 +4364,7 @@ static DirRef TransactedSnapshotImpl_FindFreeEntry(TransactedSnapshotImpl *This)
This->entries_size = new_size;
}
This->entries[result].inuse = 1;
This->entries[result].inuse = TRUE;
This->firstFreeEntry = result+1;
@@ -4385,7 +4385,7 @@ static DirRef TransactedSnapshotImpl_CreateStubEntry(
entry->newTransactedParentEntry = entry->transactedParentEntry = parentEntryRef;
entry->read = 0;
entry->read = FALSE;
}
return stubEntryRef;
@@ -4430,7 +4430,7 @@ static HRESULT TransactedSnapshotImpl_EnsureReadEntry(
if (SUCCEEDED(hr))
{
memcpy(&This->entries[entry].data, &data, sizeof(DirEntry));
This->entries[entry].read = 1;
This->entries[entry].read = TRUE;
}
}
@@ -4469,7 +4469,7 @@ static HRESULT TransactedSnapshotImpl_MakeStreamDirty(
}
if (SUCCEEDED(hr))
This->entries[entry].stream_dirty = 1;
This->entries[entry].stream_dirty = TRUE;
if (This->entries[entry].transactedParentEntry != DIRENTRY_NULL)
{
@@ -4479,7 +4479,7 @@ static HRESULT TransactedSnapshotImpl_MakeStreamDirty(
delete_ref = TransactedSnapshotImpl_CreateStubEntry(This, This->entries[entry].transactedParentEntry);
if (delete_ref != DIRENTRY_NULL)
This->entries[delete_ref].deleted = 1;
This->entries[delete_ref].deleted = TRUE;
This->entries[entry].transactedParentEntry = This->entries[entry].newTransactedParentEntry = DIRENTRY_NULL;
}
@@ -4773,9 +4773,9 @@ static HRESULT WINAPI TransactedSnapshotImpl_Commit(
{
StorageBaseImpl_StreamSetSize(This->scratch, entry->stream_entry, zero);
StorageBaseImpl_DestroyDirEntry(This->scratch, entry->stream_entry);
entry->stream_dirty = 0;
entry->stream_dirty = FALSE;
}
entry->dirty = 0;
entry->dirty = FALSE;
entry->transactedParentEntry = entry->newTransactedParentEntry;
}
}
@@ -4831,7 +4831,7 @@ static void TransactedSnapshotImpl_Invalidate(StorageBaseImpl* This)
{
TRACE("Storage invalidated (stg=%p)\n", This);
This->reverted = 1;
This->reverted = TRUE;
StorageBaseImpl_DeleteAll(This);
}
@@ -4875,8 +4875,8 @@ static HRESULT TransactedSnapshotImpl_CreateDirEntry(StorageBaseImpl *base,
new_entry = &This->entries[new_ref];
new_entry->newTransactedParentEntry = new_entry->transactedParentEntry = DIRENTRY_NULL;
new_entry->read = 1;
new_entry->dirty = 1;
new_entry->read = TRUE;
new_entry->dirty = TRUE;
memcpy(&new_entry->data, newData, sizeof(DirEntry));
*index = new_ref;
@@ -4901,7 +4901,7 @@ static HRESULT TransactedSnapshotImpl_WriteDirEntry(StorageBaseImpl *base,
if (index != This->base.storageDirEntry)
{
This->entries[index].dirty = 1;
This->entries[index].dirty = TRUE;
if (data->size.QuadPart == 0 &&
This->entries[index].transactedParentEntry != DIRENTRY_NULL)
@@ -4912,7 +4912,7 @@ static HRESULT TransactedSnapshotImpl_WriteDirEntry(StorageBaseImpl *base,
delete_ref = TransactedSnapshotImpl_CreateStubEntry(This, This->entries[index].transactedParentEntry);
if (delete_ref != DIRENTRY_NULL)
This->entries[delete_ref].deleted = 1;
This->entries[delete_ref].deleted = TRUE;
This->entries[index].transactedParentEntry = This->entries[index].newTransactedParentEntry = DIRENTRY_NULL;
}
@@ -4953,7 +4953,7 @@ static HRESULT TransactedSnapshotImpl_DestroyDirEntry(StorageBaseImpl *base,
}
else
{
This->entries[index].deleted = 1;
This->entries[index].deleted = TRUE;
}
return S_OK;
@@ -5029,7 +5029,7 @@ static HRESULT TransactedSnapshotImpl_StreamSetSize(StorageBaseImpl *base,
This->entries[index].stream_entry, zero);
StorageBaseImpl_DestroyDirEntry(This->scratch,
This->entries[index].stream_entry);
This->entries[index].stream_dirty = 0;
This->entries[index].stream_dirty = FALSE;
}
else if (This->entries[index].transactedParentEntry != DIRENTRY_NULL)
{
@@ -5037,7 +5037,7 @@ static HRESULT TransactedSnapshotImpl_StreamSetSize(StorageBaseImpl *base,
delete_ref = TransactedSnapshotImpl_CreateStubEntry(This, This->entries[index].transactedParentEntry);
if (delete_ref != DIRENTRY_NULL)
This->entries[delete_ref].deleted = 1;
This->entries[delete_ref].deleted = TRUE;
This->entries[index].transactedParentEntry = This->entries[index].newTransactedParentEntry = DIRENTRY_NULL;
}
@@ -5236,7 +5236,7 @@ static void StorageInternalImpl_Invalidate( StorageBaseImpl *base )
{
TRACE("Storage invalidated (stg=%p)\n", This);
This->base.reverted = 1;
This->base.reverted = TRUE;
This->parentStorage = NULL;
@@ -5721,7 +5721,7 @@ static StorageInternalImpl* StorageInternalImpl_Construct(
newStorage->base.baseVtbl = &StorageInternalImpl_BaseVtbl;
newStorage->base.openFlags = (openFlags & ~STGM_CREATE);
newStorage->base.reverted = 0;
newStorage->base.reverted = FALSE;
newStorage->base.ref = 1;
@@ -5732,7 +5732,7 @@ static StorageInternalImpl* StorageInternalImpl_Construct(
*/
newStorage->base.storageDirEntry = storageDirEntry;
newStorage->base.create = 0;
newStorage->base.create = FALSE;
return newStorage;
}
@@ -6019,10 +6019,10 @@ HRESULT BlockChainStream_GetBlockAtOffset(BlockChainStream *This,
{
if (!StorageImpl_WriteBigBlock(This->parentStorage, result->sector, result->data))
return STG_E_WRITEFAULT;
result->dirty = 0;
result->dirty = FALSE;
}
result->read = 0;
result->read = FALSE;
result->index = index;
result->sector = *sector;
}
@@ -6047,9 +6047,9 @@ BlockChainStream* BlockChainStream_Construct(
newStream->indexCacheLen = 0;
newStream->indexCacheSize = 0;
newStream->cachedBlocks[0].index = 0xffffffff;
newStream->cachedBlocks[0].dirty = 0;
newStream->cachedBlocks[0].dirty = FALSE;
newStream->cachedBlocks[1].index = 0xffffffff;
newStream->cachedBlocks[1].dirty = 0;
newStream->cachedBlocks[1].dirty = FALSE;
newStream->blockToEvict = 0;
if (FAILED(BlockChainStream_UpdateIndexCache(newStream)))
@@ -6071,7 +6071,7 @@ HRESULT BlockChainStream_Flush(BlockChainStream* This)
if (This->cachedBlocks[i].dirty)
{
if (StorageImpl_WriteBigBlock(This->parentStorage, This->cachedBlocks[i].sector, This->cachedBlocks[i].data))
This->cachedBlocks[i].dirty = 0;
This->cachedBlocks[i].dirty = FALSE;
else
return STG_E_WRITEFAULT;
}
@@ -6211,7 +6211,7 @@ HRESULT BlockChainStream_ReadAt(BlockChainStream* This,
if (FAILED(StorageImpl_ReadBigBlock(This->parentStorage, cachedBlock->sector, cachedBlock->data, &read)) && !read)
return STG_E_READFAULT;
cachedBlock->read = 1;
cachedBlock->read = TRUE;
}
memcpy(bufferWalker, cachedBlock->data+offsetInBlock, bytesToReadInBuffer);
@@ -6299,8 +6299,8 @@ HRESULT BlockChainStream_WriteAt(BlockChainStream* This,
memcpy(cachedBlock->data+offsetInBlock, bufferWalker, bytesToWrite);
bytesWrittenAt = bytesToWrite;
cachedBlock->read = 1;
cachedBlock->dirty = 1;
cachedBlock->read = TRUE;
cachedBlock->dirty = TRUE;
}
blockNoInSequence++;
@@ -6402,7 +6402,7 @@ static BOOL BlockChainStream_Shrink(BlockChainStream* This,
if (This->cachedBlocks[i].index >= numBlocks)
{
This->cachedBlocks[i].index = 0xffffffff;
This->cachedBlocks[i].dirty = 0;
This->cachedBlocks[i].dirty = FALSE;
}
}
@@ -7590,11 +7590,21 @@ HRESULT WINAPI StgOpenStorage(
HANDLE hFile = 0;
DWORD shareMode;
DWORD accessMode;
LPWSTR temp_name = NULL;
TRACE("(%s, %p, %x, %p, %d, %p)\n",
debugstr_w(pwcsName), pstgPriority, grfMode,
snbExclude, reserved, ppstgOpen);
if (pstgPriority)
{
/* FIXME: Copy ILockBytes instead? But currently for STGM_PRIORITY it'll be read-only. */
hr = StorageBaseImpl_GetFilename((StorageBaseImpl*)pstgPriority, &temp_name);
if (FAILED(hr)) goto end;
pwcsName = temp_name;
TRACE("using filename %s\n", debugstr_w(temp_name));
}
if (pwcsName == 0)
{
hr = STG_E_INVALIDNAME;
@@ -7756,6 +7766,8 @@ HRESULT WINAPI StgOpenStorage(
*ppstgOpen = &newStorage->IStorage_iface;
end:
CoTaskMemFree(temp_name);
if (pstgPriority) IStorage_Release(pstgPriority);
TRACE("<-- %08x, IStorage %p\n", hr, ppstgOpen ? *ppstgOpen : NULL);
return hr;
}
@@ -8667,7 +8679,10 @@ static HRESULT STREAM_ReadString( IStream *stm, LPWSTR *string )
len = MultiByteToWideChar( CP_ACP, 0, str, count, NULL, 0 );
wstr = CoTaskMemAlloc( (len + 1)*sizeof (WCHAR) );
if( wstr )
{
MultiByteToWideChar( CP_ACP, 0, str, count, wstr, len );
wstr[len] = 0;
}
CoTaskMemFree( str );
*string = wstr;
@@ -8726,32 +8741,37 @@ static HRESULT STORAGE_WriteCompObj( LPSTORAGE pstg, CLSID *clsid,
HRESULT WINAPI WriteFmtUserTypeStg(
LPSTORAGE pstg, CLIPFORMAT cf, LPOLESTR lpszUserType)
{
STATSTG stat;
HRESULT r;
WCHAR szwClipName[0x40];
CLSID clsid = CLSID_NULL;
CLSID clsid;
LPWSTR wstrProgID = NULL;
DWORD n;
TRACE("(%p,%x,%s)\n",pstg,cf,debugstr_w(lpszUserType));
/* get the clipboard format name */
n = GetClipboardFormatNameW( cf, szwClipName, sizeof(szwClipName)/sizeof(szwClipName[0]) );
szwClipName[n]=0;
if( cf )
{
n = GetClipboardFormatNameW( cf, szwClipName,
sizeof(szwClipName)/sizeof(szwClipName[0]) );
szwClipName[n]=0;
}
TRACE("Clipboard name is %s\n", debugstr_w(szwClipName));
/* FIXME: There's room to save a CLSID and its ProgID, but
the CLSID is not looked up in the registry and in all the
tests I wrote it was CLSID_NULL. Where does it come from?
*/
r = IStorage_Stat(pstg, &stat, STATFLAG_NONAME);
if(SUCCEEDED(r))
clsid = stat.clsid;
else
clsid = CLSID_NULL;
/* get the real program ID. This may fail, but that's fine */
ProgIDFromCLSID(&clsid, &wstrProgID);
TRACE("progid is %s\n",debugstr_w(wstrProgID));
r = STORAGE_WriteCompObj( pstg, &clsid,
lpszUserType, szwClipName, wstrProgID );
r = STORAGE_WriteCompObj( pstg, &clsid, lpszUserType,
cf ? szwClipName : NULL, wstrProgID );
CoTaskMemFree(wstrProgID);
@@ -9472,51 +9492,52 @@ HRESULT WINAPI GetConvertStg(IStorage *stg)
*/
HRESULT WINAPI SetConvertStg(IStorage *storage, BOOL convert)
{
static const WCHAR stream_1oleW[] = {1,'O','l','e',0};
DWORD flags = convert ? OleStream_Convert : 0;
IStream *stream;
DWORD header[2];
HRESULT hr;
TRACE("(%p, %d)\n", storage, convert);
hr = STORAGE_CreateOleStream(storage, flags);
if (hr == STG_E_FILEALREADYEXISTS)
hr = IStorage_OpenStream(storage, stream_1oleW, NULL, STGM_READWRITE | STGM_SHARE_EXCLUSIVE, 0, &stream);
if (FAILED(hr))
{
static const WCHAR stream_1oleW[] = {1,'O','l','e',0};
IStream *stream;
DWORD header[2];
if (hr != STG_E_FILENOTFOUND)
return hr;
hr = IStorage_OpenStream(storage, stream_1oleW, NULL, STGM_READWRITE | STGM_SHARE_EXCLUSIVE, 0, &stream);
if (FAILED(hr)) return hr;
return STORAGE_CreateOleStream(storage, flags);
}
hr = IStream_Read(stream, header, sizeof(header), NULL);
hr = IStream_Read(stream, header, sizeof(header), NULL);
if (FAILED(hr))
{
IStream_Release(stream);
return hr;
}
/* update flag if differs */
if ((header[1] ^ flags) & OleStream_Convert)
{
LARGE_INTEGER pos = {{0}};
if (header[1] & OleStream_Convert)
flags = header[1] & ~OleStream_Convert;
else
flags = header[1] | OleStream_Convert;
pos.QuadPart = sizeof(DWORD);
hr = IStream_Seek(stream, pos, STREAM_SEEK_SET, NULL);
if (FAILED(hr))
{
IStream_Release(stream);
return hr;
}
/* update flag if differs */
if ((header[1] ^ flags) & OleStream_Convert)
{
LARGE_INTEGER pos;
if (header[1] & OleStream_Convert)
flags = header[1] & ~OleStream_Convert;
else
flags = header[1] | OleStream_Convert;
pos.QuadPart = sizeof(DWORD);
hr = IStream_Seek(stream, pos, STREAM_SEEK_SET, NULL);
if (FAILED(hr))
{
IStream_Release(stream);
return hr;
}
hr = IStream_Write(stream, &flags, sizeof(flags), NULL);
}
IStream_Release(stream);
hr = IStream_Write(stream, &flags, sizeof(flags), NULL);
}
IStream_Release(stream);
return hr;
}
+5 -5
View File
@@ -191,7 +191,7 @@ struct StorageBaseImpl
/*
* TRUE if this object has been invalidated
*/
int reverted;
BOOL reverted;
/*
* Index of the directory entry of this storage
@@ -213,8 +213,8 @@ struct StorageBaseImpl
*/
DWORD stateBits;
BOOL create; /* Was the storage created or opened.
The behaviour of STGM_SIMPLE depends on this */
BOOL create; /* Was the storage created or opened.
The behaviour of STGM_SIMPLE depends on this */
/*
* If this storage was opened in transacted mode, the object that implements
* the transacted snapshot or cache.
@@ -514,8 +514,8 @@ typedef struct BlockChainBlock
{
ULONG index;
ULONG sector;
int read;
int dirty;
BOOL read;
BOOL dirty;
BYTE data[MAX_BIG_BLOCK_SIZE];
} BlockChainBlock;
+5 -4
View File
@@ -315,7 +315,7 @@ struct stub_manager *get_stub_manager_from_object(APARTMENT *apt, void *object)
* threads have a reference to it */
void apartment_disconnectobject(struct apartment *apt, void *object)
{
int found = FALSE;
BOOL found = FALSE;
struct stub_manager *stubmgr;
EnterCriticalSection(&apt->cs);
@@ -421,10 +421,11 @@ ULONG stub_manager_ext_release(struct stub_manager *m, ULONG refs, BOOL tablewea
TRACE("removed %u refs from %p (oid %s), rc is now %u\n", refs, m, wine_dbgstr_longlong(m->oid), rc);
if (last_extern_ref && m->extern_conn)
IExternalConnection_ReleaseConnection(m->extern_conn, EXTCONN_STRONG, 0, TRUE /* FIXME: Use last_unlock releases? */);
IExternalConnection_ReleaseConnection(m->extern_conn, EXTCONN_STRONG, 0, last_unlock_releases);
if (rc == 0)
stub_manager_int_release(m);
if (!(m->extern_conn && last_unlock_releases && m->weakrefs))
stub_manager_int_release(m);
return rc;
}
@@ -562,7 +563,7 @@ void stub_manager_release_marshal_data(struct stub_manager *m, ULONG refs, const
else if (ifstub->flags & MSHLFLAGS_TABLESTRONG)
refs = 1;
stub_manager_ext_release(m, refs, tableweak, FALSE);
stub_manager_ext_release(m, refs, tableweak, !tableweak);
}
/* is an ifstub table marshaled? */
+8 -42
View File
@@ -41,7 +41,7 @@
* virtual methods in C++ and a structure with a table of pointer to functions in C.
* Unfortunately the layout of the virtual table is compiler specific, the layout of
* g++ virtual tables is not the same as that of an egcs virtual table which is not the
* same as that generated by Visual C+. There are workarounds to make the virtual tables
* same as that generated by Visual C++. There are workarounds to make the virtual tables
* compatible via padding but unfortunately the one which is imposed to the WINE emulator
* by the Windows binaries, i.e. the Visual C++ one, is the most compact of all.
*
@@ -168,47 +168,6 @@
* - Of course in C++ we use inheritance so that we don't have to duplicate the method definitions.
* - Finally there is no IDirect3D_Xxx macro. These are not needed in C++ unless the CINTERFACE
* macro is defined in which case we would not be here.
*
*
* Implementing a COM interface.
*
* This continues the above example. This example assumes that the implementation is in C.
*
* typedef struct IDirect3DImpl {
* void* lpVtbl;
* // ...
*
* } IDirect3DImpl;
*
* static IDirect3DVtbl d3dvt;
*
* // implement the IDirect3D methods here
*
* int IDirect3D_QueryInterface(IDirect3D* me)
* {
* IDirect3DImpl *This = (IDirect3DImpl *)me;
* // ...
* }
*
* // ...
*
* static IDirect3DVtbl d3dvt = {
* IDirect3D_QueryInterface,
* IDirect3D_Add,
* IDirect3D_Add2,
* IDirect3D_Initialize,
* IDirect3D_SetWidth
* };
*
* Comments:
* - We first define what the interface really contains. This is the IDirect3DImpl structure. The
* first field must of course be the virtual table pointer. Everything else is free.
* - Then we predeclare our static virtual table variable, we will need its address in some
* methods to initialize the virtual table pointer of the returned interface objects.
* - Then we implement the interface methods. To match what has been declared in the header file
* they must take a pointer to an IDirect3D structure and we must cast it to an IDirect3DImpl so
* that we can manipulate the fields.
* - Finally we initialize the virtual table.
*/
#if defined(__cplusplus) && !defined(CINTERFACE)
@@ -772,6 +731,13 @@ StringFromGUID2(
_Out_writes_to_(cmax, return) LPOLESTR str,
_In_ INT cmax);
_Check_return_
HRESULT
WINAPI
IIDFromString(
_In_ LPCOLESTR lpsz,
_Out_ LPIID lpiid);
/*****************************************************************************
* COM Server dll - exports
*/
+1 -1
View File
@@ -145,7 +145,7 @@ reactos/dll/win32/ntprint # Synced to Wine-1.7.1
reactos/dll/win32/objsel # Synced to Wine-1.7.1
reactos/dll/win32/odbc32 # Synced to Wine-1.7.17. Depends on port of Linux ODBC.
reactos/dll/win32/odbccp32 # Synced to Wine-1.7.1
reactos/dll/win32/ole32 # Synced to Wine-1.7.1
reactos/dll/win32/ole32 # Synced to Wine-1.7.17
reactos/dll/win32/oleacc # Synced to Wine-1.7.1
reactos/dll/win32/oleaut32 # Synced to Wine-1.7.1
reactos/dll/win32/olecli32 # Synced to Wine-1.7.1