ReactOS  0.4.14-dev-593-g1793dcc
ifs.c File Reference
#include <ctype.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "ole2.h"
#include "winerror.h"
#include "wine/debug.h"
Include dependency graph for ifs.c:

Go to the source code of this file.

Classes

struct  _Malloc32
 

Macros

#define COBJMACROS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (olemalloc)
 
static BOOL SetSpyedBlockTableLength (DWORD NewLength)
 
static BOOL AddMemoryLocation (LPVOID *pMem)
 
static BOOL RemoveMemoryLocation (LPCVOID pMem)
 
static HRESULT WINAPI IMalloc_fnQueryInterface (IMalloc *iface, REFIID refiid, void **obj)
 
static ULONG WINAPI IMalloc_fnAddRefRelease (IMalloc *iface)
 
static void *WINAPI IMalloc_fnAlloc (IMalloc *iface, SIZE_T cb)
 
static void *WINAPI IMalloc_fnRealloc (IMalloc *iface, void *pv, SIZE_T cb)
 
static void WINAPI IMalloc_fnFree (IMalloc *iface, void *pv)
 
static SIZE_T WINAPI IMalloc_fnGetSize (IMalloc *iface, void *pv)
 
static INT WINAPI IMalloc_fnDidAlloc (IMalloc *iface, void *pv)
 
static void WINAPI IMalloc_fnHeapMinimize (IMalloc *iface)
 
HRESULT WINAPI CoGetMalloc (DWORD context, IMalloc **imalloc)
 
LPVOID WINAPI CoTaskMemAlloc (SIZE_T size)
 
VOID WINAPI CoTaskMemFree (LPVOID ptr)
 
LPVOID WINAPI CoTaskMemRealloc (LPVOID pvOld, SIZE_T size)
 
HRESULT WINAPI CoRegisterMallocSpy (LPMALLOCSPY pMallocSpy)
 
HRESULT WINAPI CoRevokeMallocSpy (void)
 
BOOL WINAPI IsValidInterface (LPUNKNOWN punk)
 

Variables

static const IMallocVtbl VT_IMalloc32
 
static _Malloc32 Malloc32 = {{&VT_IMalloc32}, 0, NULL, 0, 0, NULL, 0}
 
static CRITICAL_SECTION IMalloc32_SpyCS = { &critsect_debug, -1, 0, 0, 0, 0 }
 
static CRITICAL_SECTION_DEBUG critsect_debug
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 27 of file ifs.c.

Function Documentation

◆ AddMemoryLocation()

static BOOL AddMemoryLocation ( LPVOID pMem)
static

Definition at line 89 of file ifs.c.

90 {
91  LPVOID * Current;
92 
93  /* allocate the table if not already allocated */
95  return FALSE;
96 
97  /* find a free location */
98  Current = Malloc32.SpyedBlocks;
99  while (*Current) {
100  Current++;
102  /* no more space in table, grow it */
103  DWORD old_length = Malloc32.SpyedBlockTableLength;
105  return FALSE;
106  Current = Malloc32.SpyedBlocks + old_length;
107  }
108  };
109 
110  /* put the location in our table */
111  *Current = pMem;
113  /*TRACE("%lu\n",Malloc32.SpyedAllocationsLeft);*/
114  return TRUE;
115 }
LPVOID * SpyedBlocks
Definition: ifs.c:56
#define TRUE
Definition: types.h:120
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD SpyedBlockTableLength
Definition: ifs.c:57
static BOOL SetSpyedBlockTableLength(DWORD NewLength)
Definition: ifs.c:74
static _Malloc32 Malloc32
Definition: ifs.c:61
DWORD SpyedAllocationsLeft
Definition: ifs.c:54

Referenced by IMalloc_fnAlloc(), and IMalloc_fnRealloc().

◆ CoGetMalloc()

HRESULT WINAPI CoGetMalloc ( DWORD  context,
IMalloc **  imalloc 
)

Definition at line 381 of file ifs.c.

382 {
383  if (context != MEMCTX_TASK) {
384  *imalloc = NULL;
385  return E_INVALIDARG;
386  }
387 
388  *imalloc = &Malloc32.IMalloc_iface;
389  return S_OK;
390 }
Definition: http.c:7098
IMalloc IMalloc_iface
Definition: ifs.c:51
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define S_OK
Definition: intsafe.h:59
static _Malloc32 Malloc32
Definition: ifs.c:61

Referenced by get_malloc(), InitInstance(), SHGetMalloc(), test_CoGetMalloc(), and test_IMallocSpy().

◆ CoRegisterMallocSpy()

HRESULT WINAPI CoRegisterMallocSpy ( LPMALLOCSPY  pMallocSpy)

Definition at line 460 of file ifs.c.

461 {
462  IMallocSpy* pSpy;
464 
465  TRACE("%p\n", pMallocSpy);
466 
467  if(!pMallocSpy) return E_INVALIDARG;
468 
470 
471  if (Malloc32.pSpy)
473  else if (SUCCEEDED(IMallocSpy_QueryInterface(pMallocSpy, &IID_IMallocSpy, (void**)&pSpy))) {
474  Malloc32.pSpy = pSpy;
475  hres = S_OK;
476  }
477 
479 
480  return hres;
481 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION IMalloc32_SpyCS
Definition: ifs.c:64
#define E_INVALIDARG
Definition: ddrawi.h:101
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
IMallocSpy * pSpy
Definition: ifs.c:53
#define S_OK
Definition: intsafe.h:59
static _Malloc32 Malloc32
Definition: ifs.c:61
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define CO_E_OBJISREG
Definition: winerror.h:2815
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by START_TEST(), and test_IMallocSpy().

◆ CoRevokeMallocSpy()

HRESULT WINAPI CoRevokeMallocSpy ( void  )

Definition at line 500 of file ifs.c.

501 {
502  HRESULT hres = S_OK;
503  TRACE("\n");
504 
506 
507  if (!Malloc32.pSpy)
509  else if (Malloc32.SpyedAllocationsLeft) {
510  TRACE("SpyReleasePending with %u allocations left\n", Malloc32.SpyedAllocationsLeft);
513  } else {
514  IMallocSpy_Release(Malloc32.pSpy);
515  Malloc32.pSpy = NULL;
516  }
518 
519  return hres;
520 }
#define E_ACCESSDENIED
Definition: winerror.h:2849
#define TRUE
Definition: types.h:120
BOOL SpyReleasePending
Definition: ifs.c:55
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION IMalloc32_SpyCS
Definition: ifs.c:64
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define CO_E_OBJNOTREG
Definition: winerror.h:2814
IMallocSpy * pSpy
Definition: ifs.c:53
#define S_OK
Definition: intsafe.h:59
static _Malloc32 Malloc32
Definition: ifs.c:61
DWORD SpyedAllocationsLeft
Definition: ifs.c:54
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

Referenced by START_TEST(), and test_IMallocSpy().

◆ CoTaskMemAlloc()

LPVOID WINAPI CoTaskMemAlloc ( SIZE_T  size)

Definition at line 404 of file ifs.c.

405 {
406  return IMalloc_Alloc(&Malloc32.IMalloc_iface,size);
407 }
IMalloc IMalloc_iface
Definition: ifs.c:51
GLsizeiptr size
Definition: glext.h:5919
static _Malloc32 Malloc32
Definition: ifs.c:61

Referenced by _GetCidlFromDataObject(), _ILCreate(), _SHStrDupAA(), _SHStrDupAW(), a2co(), add_data(), CBandSiteBase::AddBand(), CKsProxy::AdvisePeriodic(), CKsProxy::AdviseTime(), alloc_bstr(), ATL::CComAllocator::Allocate(), Allocate_CoTaskMemAlloc(), AMFilterData_ParseFilterData(), AMTimeline_create(), AntiMonikerImpl_GetDisplayName(), AsyncReader_create(), AVIDec_SetMediaType(), AVISplitter_create(), AVISplitter_first_request(), AVISplitter_ProcessIndex(), AVISplitter_ProcessStreamList(), BaseInputPin_Construct(), BaseOutputPin_Construct(), BasePinImpl_QueryId(), BindInfo_GetBindString(), CComCatCachedCategory::CacheDSA(), ClassMoniker_GetDisplayName(), co_strdupAtoW(), co_strdupW(), co_strdupWtoA(), CoDupStrW(), CoInternetGetSecurityUrl(), COMCAT_ICatInformation_GetCategoryDesc(), CompositeMonikerImpl_GetDisplayName(), copy_formatetc(), copy_propbag2(), CopyBindInfo(), CopyIpAddrString(), CopyMediaType(), CopyStgMedium(), create_coclass_obj(), create_disp_obj(), create_EnumMoniker(), create_PropertyBag(), createenumpins(), CreateFilterList(), CreateMediaType(), CreateMultiSzString(), CInputPin::CreatePinHandle(), COutputPin::CreatePinHandle(), CreateRenderingWindow(), CreateStdDispatch(), createtestfilter(), CreateTextServices(), DataCache_EnumCache(), DEVENUM_IEnumMoniker_Next(), DEVENUM_IMediaCatMoniker_Construct(), DEVENUM_IMediaCatMoniker_GetDisplayName(), DEVENUM_IParseDisplayName_ParseDisplayName(), DEVENUM_IPropertyBag_Read(), DEVENUM_ReadPins(), DEVENUM_ReadPinTypes(), CKsProxy::DeviceInfo(), CNetConnection::Disconnect(), DllGetClassObject(), DoReadAllOfFile(), DSoundRender_create(), DuplicateString(), EnumClientServiceProtocol(), CNetConnectionPropertyUi::EnumComponents(), CNetConnectionManager::EnumerateINetConnections(), EnumerateNetworkAdapter(), CEnumRegRoot::EnumerateNext(), CEnumNTDirectory::EnumerateNext(), CNetFolderEnum::EnumerateRec(), EnumFormatImpl_Next(), CPin::EnumMediaTypes(), CInputPin::EnumMediaTypes(), COutputPin::EnumMediaTypes(), EnumMediaTypes_Construct(), EnumMonikerImpl_Create(), EnumOLEVERB_Next(), EnumPins_Construct(), enumverbs_Next(), EventsQueue_Init(), CExtractIcon::Extract(), FileAsyncReader_RequestAllocator(), FileLockBytesImpl_Stat(), FileMonikerImpl_CommonPrefixWith(), FileMonikerImpl_DecomposePath(), FileMonikerImpl_GetDisplayName(), FileSource_GetCurFile(), FileSource_Load(), FilterGraph2_AddFilter(), FilterGraph_create(), FilterMapper2_create(), FilterMapper3_EnumMatchingFilters(), FilterMapper3_RegisterFilter(), FilterMapper_EnumMatchingFilters(), FilterMapper_RegisterPin(), FilterMapper_RegisterPinType(), FilterMapper_UnregisterPin(), find_mime_from_buffer(), find_mime_from_ext(), FM2_ReadFilterData(), FM2_WriteFilterData(), CRegistryFolder::FormatContentsForDisplay(), CRegistryFolder::FormatValueData(), CInputPin::Get(), COutputPin::Get(), CKsProxy::Get(), get_bool_property(), get_file_name(), get_profile_string(), get_property(), get_token(), GetClassFile(), CShellLink::GetCurFile(), CNetConnectionPropertyUi::GetDeviceInstanceID(), CDrivesFolder::GetDisplayNameOf(), CFSFolder::GetDisplayNameOf(), CRegFolder::GetDisplayNameOf(), CAutoComplete::GetDropDownStatus(), CExtractIcon::GetIconLocation(), GetInternalConnections(), GetListViewEntries(), CKsProxy::GetMediaSeekingFormats(), CKsProxy::GetPinName(), CNetConnection::GetProperties(), CInputPin::GetSupportedSets(), COutputPin::GetSupportedSets(), CKsProxy::GetSupportedSets(), hlink_co_strdupW(), HlinkGetSpecialReference(), hls_ref_Moniker_GetDisplayName(), hls_site_Moniker_GetDisplayName(), HttpNegotiate_BeginningTransaction(), IAudioDataImpl_SetBuffer(), IClassFactory_fnConstructor(), IDispatch_Invoke_Proxy(), IDispatch_Invoke_Stub(), IEnumDMO_fnNext(), IEnumFiltersImpl_Construct(), IEnumMediaTypesImpl_Construct(), IEnumMediaTypesImpl_Reset(), IEnumNetCfgBindingInterface_Constructor(), IEnumNetCfgBindingPath_Constructor(), IEnumNetCfgComponent_Constructor(), IEnumRegFiltersImpl_Construct(), IEnumRegFiltersImpl_Next(), IFileDialogCustomize_fnGetEditBoxText(), INetCfg_Constructor(), INetCfgBindingInterface_Constructor(), INetCfgBindingPath_Constructor(), INetCfgComponent_Constructor(), INetCfgComponent_fnGetBindName(), INetCfgComponent_fnGetDisplayName(), INetCfgComponent_fnGetHelpText(), INetCfgComponent_fnGetId(), INetCfgComponent_fnGetPnpDevNodeId(), INetCfgComponent_fnSetDisplayName(), INetCfgComponentControl_fnApplyRegistryChanges(), INetCfgComponentPropertyUi_fnMergePropPages(), INetCfgLock_fnAcquireWriteLock(), INetCfgLock_fnIsWriteLocked(), info_device_ps_GetValue(), init_texthost(), CNetConnection::Initialize(), Initialize(), CLanStatus::InitializeNetTaskbarNotifications(), InitializePropertyDialog(), InitPropVariantFromBuffer(), InitPropVariantFromCLSID(), InitPropVariantFromGUIDAsString(), InputProcessorProfiles_GetLanguageList(), InstallEngine_EnumDownloadIDs(), InternetBindInfo_GetBindString(), InternetHostSecurityManager_QueryCustomPolicy(), COutputPin::IoProcessRoutine(), IPersistFile_fnGetCurFile(), IPropertyStorage_fnReadPropertyNames(), ItemMonikerImpl_GetDisplayName(), ITS_IMonikerImpl_GetDisplayName(), ITSS_IEnumSTATSTG_Next(), KsGetMediaType(), KsGetMultiplePinFactoryItems(), CKsInterfaceHandler::KsProcessMediaSamples(), CKsDataTypeHandler::KsSetMediaType(), LANStatusUiDetailsDlg(), CKsProxy::Load(), LoadDNSSettings(), LoadFilterSettings(), CComCatCachedCategory::LoadFromRegistry(), CShellBrowser::LoadHistory(), LoadTcpFilterSettingsFromRegistry(), MakeStrRetFromString(), map_url_to_zone(), ME_CreateTextHost(), MediaDet_create(), mediaenum_create(), MimeAlloc_Alloc(), MimeInternat_ConvertBuffer(), MimeInternat_ConvertString(), MimeMessage_GetAttachments(), MMDevice_GetId(), MMDevice_GetPropValue(), MMDevPropStore_GetValue(), MoCopyMediaType(), MoCreateMediaType(), MoDuplicateMediaType(), MoInitMediaType(), Moniker_GetDisplayName(), MPEGSplitter_create(), MPEGSplitter_init_audio(), MSTASK_ITask_GetAccountInformation(), MSTASK_ITask_GetApplicationName(), MSTASK_ITask_GetComment(), MSTASK_ITask_GetParameters(), MSTASK_ITaskScheduler_GetTargetComputer(), CLayerStringList::Next(), CEnumMediaTypes::Next(), CEnumRegKey::NextKey(), CEnumRegKey::NextValue(), nsChannelBSC_beginning_transaction(), NullRenderer_create(), OleMetafilePictFromIconAndLabel(), oleobject_GetUserType(), OleRegGetUserType(), CSearchBar::OnSearchButtonClicked(), parse_security_url(), Parser_AddPin(), Parser_Create(), Parser_RemoveOutputPins(), PMemoryAllocator_Allocate(), PosPassThru_Construct(), ProgIDFromCLSID(), prop_enum_copy_cb(), PropertyStorage_StringCopy(), PropVariantChangeType(), PropVariantCopy(), PropVariantToStringAlloc(), ProtocolStream_Stat(), PullPin_Construct(), CIPV4Filter::PutMulticastList(), CIPV6Filter::PutMulticastList(), CEthernetFilter::PutMulticastList(), QUARTZ_CreateSystemClock(), CPin::QueryId(), CInputPin::QueryId(), COutputPin::QueryId(), ReadBindingString(), ReadRegistryValue(), RecycleBin5_Constructor(), RecycleBin5_RecycleBin5_DeleteFile(), RecycleBin5Enum_Constructor(), RecycleBin5File_Constructor(), RecycleBinGeneric_Constructor(), RecycleBinGeneric_RecycleBin_DeleteFile(), RecycleBinGenericEnum_Constructor(), register_filters(), RemUnknown_RemQueryInterface(), CNetConnection::Rename(), return_strval(), SAFEARRAY_Malloc(), SampleGrabber_callback(), SampleGrabber_create(), SampleGrabber_IBaseFilter_QueryVendorInfo(), SampleGrabber_In_IPin_ReceiveConnection(), SampleGrabber_IPin_ConnectionMediaType(), SampleGrabber_IPin_QueryId(), SampleGrabber_ISampleGrabber_GetConnectedMediaType(), SampleGrabber_ISampleGrabber_SetMediaType(), CInputPin::Set(), COutputPin::Set(), CKsProxy::Set(), SHAlloc(), SHGetNameFromIDList(), SHStrDupA(), SHStrDupW(), Single_IEnumMediaTypes_Next(), StdMediaSample2_Construct(), StdMediaSample2_GetMediaType(), StdMediaSample2_SetMediaType(), StdMemAllocator_create(), STGMEDIUM_UserUnmarshal(), StorageUtl_CopyDirEntryToSTATSTG(), StoreDNSSettings(), StoreIPSettings(), StoreTcpipBasicSettings(), StoreTcpipFilterSettings(), strdup_AtoW(), STREAM_ReadString(), STREAM_WriteString(), string_enumerator_Next(), StringFromCLSID(), SystemClockImpl_AdvisePeriodic(), SystemClockImpl_AdviseTime(), TcpipAddSuffixDlg(), TcpipAdvancedDnsDlg(), TcpipConfigNotify_Constructor(), test_Alloc(), test_BodyDeleteProp(), test_bstr_cache(), test_ClearCustData(), test_CopyBindInfo(), test_DispCallFunc(), test_knownFolders(), test_marshal_VARIANT(), test_MessageGetPropInfo(), test_MessageOptions(), test_MessageSetProp(), test_metadata_tEXt(), test_PropVariantChangeType_LPWSTR(), test_PropVariantToBuffer(), test_PropVariantToStringAlloc(), TestACL_Constructor(), TestFilter_Pin_Construct(), TestLockBytes_Stat(), Timeline_IAMTimeline_CreateEmptyNode(), TLB_copy_all_custdata(), TransformFilter_Construct(), TransformFilter_Init(), URLMoniker_GetDisplayName(), user_allocate(), VARIANT_UserUnmarshal(), VideoRenderer_create(), VMR9DefaultAllocatorPresenterImpl_create(), vmr_create(), WAVEParser_create(), WAVEParser_InputPin_PreConnect(), and Widget_int_ptr_ptr().

◆ CoTaskMemFree()

VOID WINAPI CoTaskMemFree ( LPVOID  ptr)

Definition at line 420 of file ifs.c.

421 {
422  IMalloc_Free(&Malloc32.IMalloc_iface, ptr);
423 }
IMalloc IMalloc_iface
Definition: ifs.c:51
static PVOID ptr
Definition: dispmode.c:27
static _Malloc32 Malloc32
Definition: ifs.c:61

Referenced by _check_custom_policy(), CFSDropTarget::_CopyItems(), _test_GetCurMoniker(), _test_urlmon_display_name(), add_data(), add_storages_to_table(), CBandSiteBase::AddBand(), CKsProxy::AdvisePeriodic(), CKsProxy::AdviseTime(), AMFilterData_ParseFilterData(), ApplyOrCancelChanges(), AsyncReader_Release(), AVIDec_BreakConnect(), AVISplitter_Disconnect(), AVISplitter_InputPin_PreConnect(), AVISplitter_ProcessOldIndex(), AVISplitter_ProcessStreamList(), BaseInputPin_Construct(), BaseInputPin_Destroy(), BaseOutputPin_Construct(), BaseOutputPin_Destroy(), CEnumMergedFolder::Begin(), bind_to_object(), BindProtocol_StartEx(), BSCHttpNegotiate_OnResponse(), CDirectSoundCapture_fnInitialize(), CDirectSoundCapture_fnQueryInterface(), CEnumMediaTypes_fnConstructor(), CGuidItemExtractIcon_CreateInstance(), check_display_name_(), check_dropdown_(), check_load_safety(), check_script_safety(), check_storage_contents(), CInputPin::CheckFormat(), COutputPin::CheckFormat(), ChooseFolder(), ClassMoniker_IsEqual(), ClearCustData(), ClientIdentity_QueryMultipleInterfaces(), CISFBand::CloseDW(), coclass1_Release(), CoInternetGetSecurityUrl(), CoInternetGetSecurityUrlEx(), COMCAT_ICatInformation_GetCategoryDesc(), COMDLG32_StrRetToStrNW(), CompositeMonikerImpl_GetDisplayName(), COutputPin::Connect(), CopyBindInfo(), CopyIpAddrString(), count_moniker_matches(), create_activex_object(), create_configuration(), create_EnumSTATPROPSETSTG(), create_internet_session(), create_object(), CreateMediaType(), CreateNotificationObject(), CInputPin::CreatePin(), COutputPin::CreatePin(), CInputPin::CreatePinHandle(), COutputPin::CreatePinHandle(), CKsProxy::CreatePins(), createtestfilter(), DataCache_EnumCache(), DataCacheEntry_Destroy(), delete_vector(), DeleteMediaType(), deleteStorageContents(), DEVENUM_IEnumMoniker_Release(), DEVENUM_IMediaCatMoniker_BindToObject(), DEVENUM_IMediaCatMoniker_IsEqual(), DEVENUM_IMediaCatMoniker_Release(), DEVENUM_IPropertyBag_Release(), DEVENUM_ReadPins(), DEVENUM_ReadPinTypes(), CNetConnection::Disconnect(), disp_obj_Release(), DllGetClassObject(), DllRegisterServer(), DllUnregisterServer(), DoReadAllOfFile(), DoTestEntry(), CEnumMergedFolder::DsaDeleteCallback(), DSCF_Release(), DSoundRender_create(), DSoundRender_Release(), DuplicateString(), enum_stream_names(), CNetConnectionPropertyUi::EnumComponents(), CNetConnectionManager::EnumerateINetConnections(), EnumerateNetworkComponent(), CNetFolderEnum::EnumerateRec(), CInputPin::EnumMediaTypes(), COutputPin::EnumMediaTypes(), EnumMonikerImpl_Release(), EnumOLEVERB_Next(), EventsQueue_Destroy(), ExploreGraph(), CExtractIcon::Extract(), FileAsyncReader_RequestAllocator(), FileAsyncReaderPin_Release(), FILEDLG95_InitControls(), FileExtractDialogWndProc(), FileMonikerImpl_BindToStorage(), FileMonikerImpl_CommonPrefixWith(), FileMonikerImpl_ComposeWith(), FileMonikerImpl_DecomposePath(), FileMonikerImpl_IsEqual(), FileMonikerImpl_RelativePathTo(), FileProtocol_StartEx(), FileSource_Load(), fill_filename_from_selection(), fill_filter_data_information(), CMenuSFToolbar::FillToolbar(), FilterGraph2_AddFilter(), FilterGraph2_Connect(), FilterGraph2_RemoveFilter(), FilterGraph_create(), FilterGraphInner_Release(), FilterMapper3_CreateCategory(), FilterMapper3_EnumMatchingFilters(), FilterMapper3_RegisterFilter(), FilterMapper3_UnregisterFilter(), FilterMapper_EnumMatchingFilters(), FilterMapper_RegisterFilter(), FilterMapper_RegisterPin(), FilterMapper_RegisterPinType(), FilterMapper_UnregisterFilter(), FilterMapper_UnregisterPin(), find_mime_from_buffer(), FM2_DeleteRegFilter(), FM2_WriteClsid(), CRegistryFolder::FormatContentsForDisplay(), ATL::CComAllocator::Free(), free_embedded_arraydesc(), free_embedded_elemdesc(), free_embedded_typedesc(), free_regfilter2(), free_stringtable(), free_structure(), FreeComponentItem(), FreeIPAddr(), FreeKnownFolderDefinitionFields(), FreeMediaType(), g2s(), CInputPin::Get(), COutputPin::Get(), CKsProxy::Get(), get_moniker_comparison_data(), get_next_insertable_verb(), get_profile_string(), get_security_id_for_url(), GetClassFile(), CRegistryFolder::GetDetailsEx(), CRegistryFolder::GetDetailsOf(), CNetConnectionPropertyUi::GetDeviceInstanceID(), CDrivesFolder::GetDisplayNameOf(), CRegFolder::GetDisplayNameOf(), CExtractIcon::GetIconLocation(), CNetConnectionPropertyUi::GetINetCfgComponent(), GetListViewEntries(), CKsProxy::GetMediaSeekingFormats(), CKsProxy::GetPinName(), CNetConnection::GetProperties(), GetSplitter(), CInputPin::GetSupportedSets(), COutputPin::GetSupportedSets(), CKsProxy::GetSupportedSets(), GetUIObjectOfPath(), guid2string(), HCR_GetClassNameA(), HCR_GetClassNameW(), HCR_GetFolderAttributes(), HlinkBrowseContext_GetObject(), HlinkClone(), HlinkFrame_Navigate(), HlinkGetSpecialReference(), HlinkResolveMonikerForData(), HlinkSimpleNavigateToMoniker(), hls_site_Moniker_ComposeWith(), HTMLPrivateWindow_SuperNavigate(), HttpProtocol_open_request(), IAMMultiMediaStreamImpl_Release(), IAudioDataImpl_Release(), IAudioDataImpl_SetBuffer(), IClassFactory_fnRelease(), ICommDlgBrowser3_fnIncludeObject(), IDirectSound8_fnInitialize(), IDirectSound8_fnQueryInterface(), IDirectSoundCaptureBufferImpl_QueryInterface(), IDispatch_Invoke_Proxy(), IDispatch_Invoke_Stub(), IEnumFiltersImpl_Release(), IEnumMediaTypesImpl_Construct(), IEnumMediaTypesImpl_Release(), IEnumMediaTypesImpl_Reset(), IEnumPinsImpl_Release(), IEnumRegFiltersImpl_Construct(), IEnumRegFiltersImpl_Next(), IEnumRegFiltersImpl_Release(), IHlink_fnNavigate(), IHlink_fnSetMonikerReference(), INetCfg_fnRelease(), INetCfgBindingInterface_fnRelease(), INetCfgBindingPath_fnRelease(), INetCfgComponent_fnRaisePropertyUi(), INetCfgComponent_fnRelease(), INetCfgComponent_fnSetDisplayName(), INetCfgComponentControl_fnApplyRegistryChanges(), INetCfgComponentPropertyUi_fnMergePropPages(), INetCfgComponentPropertyUi_fnRelease(), init_texthost(), Initialize(), CNetConnectionPropertyUi::InitializeLANPropertiesUIDlg(), CLanStatus::InitializeNetTaskbarNotifications(), InitializePropertyDialog(), Inner_Release(), InstallTypicalNetworkSettings(), CKsProxy::IsFormatSupported(), ItemMonikerImpl_IsEqual(), ITextHostImpl_Release(), ITextServicesImpl_Release(), ITSProtocol_Start(), ITypeInfo_ReleaseFuncDesc_Proxy(), ITypeInfo_ReleaseTypeAttr_Proxy(), ITypeInfo_ReleaseVarDesc_Proxy(), ITypeLib_ReleaseTLibAttr_Proxy(), CKsInterfaceHandler::KsCompleteIo(), KsGetMediaType(), KsGetMediaTypeCount(), KsGetMultiplePinFactoryItems(), CKsInterfaceHandler::KsProcessMediaSamples(), KSPropertySetImpl_fnQueryInterface(), KSPropertySetImpl_Get(), CKsDataTypeHandler::KsSetMediaType(), CInputPin::KsSetPinFramingCache(), COutputPin::KsSetPinFramingCache(), CNetConnectionPropertyUi::LANPropertiesUIDlg(), LANStatusUiDetailsDlg(), CKsProxy::Load(), load_devices_from_reg(), load_mapping_settings(), load_streams(), LoadDNSSettings(), LoadFilterSettings(), CInputPin::LoadProxyPlugins(), COutputPin::LoadProxyPlugins(), CKsProxy::LoadProxyPlugins(), LoadRdpSettingsFromFile(), LoadTcpFilterSettingsFromRegistry(), map_url_to_zone(), MediaDet_get_Filename(), MediaDet_get_FrameRate(), MediaDet_get_StreamMediaType(), MediaDet_inner_Release(), MediaStreamFilterImpl_Release(), MimeAlloc_Free(), MimeInternat_ConvertBuffer(), MimeInternat_ConvertString(), MimeProtocol_Start(), MkProtocol_StartEx(), MMDevEnum_GetDevice(), MoCreateMediaType(), MoDeleteMediaType(), MoFreeMediaType(), anonymous_namespace{mstscax.cpp}::MonikerToString(), MPEGSplitter_create(), MPEGSplitter_pre_connect(), msi_table_apply_transform(), MSTASK_ITaskScheduler_GetTargetComputer(), navigate_hlink(), NcFreeNetconProperties(), NewDirectSound(), NewDirectSoundCapture(), NewKsPropertySet(), CEnumMediaTypes::Next(), notify_if_changed(), NullRenderer_create(), NullRendererInner_Release(), OLE_FreeClipDataArray(), OLECONVERT_GetOLE10ProgID(), OleCreateStaticFromData(), OleDoAutoConvert(), OleMetafilePictFromIconAndLabel(), OleObject_SetClientSite(), OleRegGetUserType(), OleUIAddVerbMenuW(), on_command_filetype(), on_default_action(), parse_security_url(), Parser_AddPin(), Parser_Create(), Parser_Destroy(), Parser_OutputPin_Release(), Parser_RemoveOutputPins(), PersistFile_Load(), PersistFile_Save(), PMemoryAllocator_Free(), PrimaryDirectSoundBuffer8Impl_fnQueryInterface(), ProgIDFromCLSID(), PropertyBag_GetPropertyInfo(), PropertyBag_Release(), PropertyStorage_FindPropertyByName(), PropertyStorage_PropNameDestroy(), PropertyStorage_StringCopy(), PropVariantChangeType(), PropVariantClear(), PropVariantToString(), Protocol_Start(), protocol_start(), ProtocolSinkHandler_ReportData(), proxy_manager_destroy(), Proxy_MarshalInterface(), PullPin_Construct(), PullPin_Release(), CIPV4Filter::PutMulticastList(), CIPV6Filter::PutMulticastList(), CEthernetFilter::PutMulticastList(), CScanningTunner::QueryInterface(), CEnumTuningSpaces::QueryInterface(), CTuneRequest::QueryInterface(), CTuningSpace::QueryInterface(), CTuningSpaceContainer::QueryInterface(), CControlNode::QueryInterface(), CPin::QueryInterface(), CBDADigitalDemodulator::QueryInterface(), CBDAFrequencyFilter::QueryInterface(), CBDALNBInfo::QueryInterface(), CNetworkProvider::QueryInterface(), COutputPin::QueryInterface(), CInputPin::QueryInterface(), CKsProxy::QueryInterface(), CKsProxy::QueryPreferredFormat(), r_getMonikerRef(), r_getStringRef(), read_stream_data(), ReadFmtUserTypeStg(), ReadRegistryValue(), RecycleBin5_Destructor(), RecycleBin5_RecycleBin5_DeleteFile(), RecycleBin5Enum_Constructor(), RecycleBin5Enum_Destructor(), RecycleBin5File_Destructor(), RecycleBinGeneric_Destructor(), RecycleBinGeneric_RecycleBin_DeleteFile(), RecycleBinGenericEnum_Destructor(), reg_context_menu_handler(), reg_icon_overlay(), reg_prop_sheet_handler(), reg_unreg_wine_test_class(), register_clsid(), register_filters(), release_statdata(), ReleaseBindInfo(), ReleaseStgMedium(), CNetConnection::Rename(), render_embed_source_hack(), ResProtocol_Start(), SAFEARRAY_Free(), SampleGrabber_callback(), SampleGrabber_cleanup(), SampleGrabber_In_IPin_ReceiveConnection(), SampleGrabber_ISampleGrabber_SetMediaType(), SampleGrabber_Release(), save_mapping_settings(), SaveRdpSettingsToFile(), SecondaryDirectSoundBuffer8Impl_fnQueryInterface(), SeekInner_Release(), CInputPin::Set(), COutputPin::Set(), CKsProxy::Set(), set_clipboard_formats(), set_current_mon(), set_downloading_task_destr(), set_format(), set_moniker(), CRegFolder::SetNameOf(), shell_item_exists(), ShellExecCmdLine(), SHEmptyRecycleBinW(), SHFree(), SHGetNameFromIDList(), SHGetObjectCompatFlags(), Single_IEnumMediaTypes_Release(), statusclb_OnDataAvailable(), StdDispatch_Release(), StdMediaSample2_Delete(), StdMemAllocator_create(), StdMemAllocator_Destroy(), StgOpenStorage(), StoreTcpipBasicSettings(), STREAM_ReadString(), STREAM_WriteString(), StrRetToBSTR(), StrRetToBufA(), StrRetToBufW(), StrRetToStrA(), StrRetToStrNA(), StrRetToStrNW(), StrRetToStrW(), stub_manager_delete(), SysFreeString(), SystemClockAdviseThread(), SystemClockImpl_Release(), SystemClockImpl_Unadvise(), TcpipAddSuffixDlg(), TcpipAdvancedDnsDlg(), TcpipFilterSettingsDlg(), test_ACLMulti(), test_assoc_one(), test_audioclient(), test_basics(), test_BindToObject(), test_BindToStorage(), test_cf_dataobject(), test_channelvolume(), test_click_make_new_folder_button(), test_client_security(), test_clock(), test_collection(), test_convert(), test_CopyBindInfo(), test_CreateMessage(), test_customize(), test_devenum(), test_DispCallFunc(), test_encoder_properties(), test_enum_fmtetc(), test_event(), test_filename_opendlg_(), test_filename_savedlg_(), test_filesourcefilter(), test_FindMimeFromData(), test_fmtusertypestg(), test_formats(), test_GetLocalName(), test_GetName(), test_GetRemoteName(), test_GetTargetComputer(), test_globalness(), test_HlinkClone(), test_HlinkCreateExtensionServices(), test_HlinkGetSetMonikerReference(), test_HlinkGetSetStringReference(), test_HlinkParseDisplayName(), test_HttpOptions(), test_IApplicationAssociationRegistration_QueryCurrentDefault(), test_InitPropVariantFromGUIDAsString(), test_InternetGetSecurityUrl(), test_knownFolders(), test_marshal(), test_marshal_pointer(), test_mediadet(), test_mhtml_message(), test_MimeOleObjectFromMoniker(), test_MkParseDisplayNameEx(), test_mon_displayname(), test_moniker(), test_namespace(), test_NameSpace(), test_OleRegGetUserType(), test_overwrite(), test_padding(), test_parse_filter_data(), test_ParseDisplayName(), test_persistserialized(), test_ProgIDFromCLSID(), test_propertybag_getpropertyinfo(), test_PropVariantToStringAlloc(), test_reference(), test_references(), test_selection(), test_session(), test_session_creation(), test_SetAccountInformation_GetAccountInformation(), test_SetApplicationName_GetApplicationName(), test_SetComment_GetComment(), test_SetInitialHlink(), test_SetParameters_GetParameters(), test_SetTargetComputer(), test_setvalue_on_wow64(), test_SHCreateShellItem(), test_SHCreateShellItemArray(), test_ShellFolderViewDual(), test_SHGetFolderPathEx(), test_SHGetNameFromIDList(), test_simplevolume(), test_special_reference(), test_StdHlink(), test_storage_refcount(), test_stream_read_write(), test_streamenum(), test_streamvolume(), test_toplevel_stat(), test_volume_dependence(), test_worst_case(), TestFilenameA(), TestFilter_Pin_Release(), TestFilter_Release(), Timeline_Release(), TimelineObj_Release(), TransformFilter_Construct(), TransformFilter_Init(), TransformFilterImpl_Release(), translate_uri(), translate_url(), CKsProxy::Unadvise(), UniformResourceLocatorA_SetUrl(), UniformResourceLocatorW_SetUrl(), Unknown_Release(), unregister_clsid(), URLMoniker_IsEqual(), user_free(), anonymous_namespace{mstscax.cpp}::UUIDToString(), VARIANT_UserFree(), VideoRenderer_create(), VideoRendererInner_Release(), VMR9_ImagePresenter_Release(), VMR9DefaultAllocatorPresenterImpl_create(), VMR9Inner_Release(), vmr_create(), WAVEParser_InputPin_PreConnect(), WelcomeDlgProc(), write_filter_data(), WriteFmtUserTypeStg(), WshCollection_Item(), CACLMulti::~CACLMulti(), CBandSiteBase::~CBandSiteBase(), CDefaultContextMenu::~CDefaultContextMenu(), CEthernetFilter::~CEthernetFilter(), CExtractIcon::~CExtractIcon(), CIPV4Filter::~CIPV4Filter(), CIPV6Filter::~CIPV6Filter(), CKsDataTypeHandler::~CKsDataTypeHandler(), CNetConnection::~CNetConnection(), and CSendToMenu::SENDTO_ITEM::~SENDTO_ITEM().

◆ CoTaskMemRealloc()

◆ IMalloc_fnAddRefRelease()

static ULONG WINAPI IMalloc_fnAddRefRelease ( IMalloc iface)
static

Definition at line 158 of file ifs.c.

159 {
160  return 1;
161 }

◆ IMalloc_fnAlloc()

static void* WINAPI IMalloc_fnAlloc ( IMalloc iface,
SIZE_T  cb 
)
static

Definition at line 166 of file ifs.c.

167 {
168  void *addr;
169 
170  TRACE("(%ld)\n",cb);
171 
172  if(Malloc32.pSpy) {
173  SIZE_T preAllocResult;
174 
176  preAllocResult = IMallocSpy_PreAlloc(Malloc32.pSpy, cb);
177  if ((cb != 0) && (preAllocResult == 0)) {
178  /* PreAlloc can force Alloc to fail, but not if cb == 0 */
179  TRACE("returning null\n");
181  return NULL;
182  }
183  }
184 
186 
187  if(Malloc32.pSpy) {
188  addr = IMallocSpy_PostAlloc(Malloc32.pSpy, addr);
191  }
192 
193  TRACE("--(%p)\n",addr);
194  return addr;
195 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION IMalloc32_SpyCS
Definition: ifs.c:64
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
GLenum const GLvoid * addr
Definition: glext.h:9621
IMallocSpy * pSpy
Definition: ifs.c:53
ULONG_PTR SIZE_T
Definition: typedefs.h:78
static _Malloc32 Malloc32
Definition: ifs.c:61
static HMODULE MODULEINFO DWORD cb
Definition: module.c:32
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static BOOL AddMemoryLocation(LPVOID *pMem)
Definition: ifs.c:89

◆ IMalloc_fnDidAlloc()

static INT WINAPI IMalloc_fnDidAlloc ( IMalloc iface,
void pv 
)
static

Definition at line 316 of file ifs.c.

317 {
318  BOOL fSpyed = FALSE;
319  int didAlloc;
320 
321  TRACE("(%p)\n",pv);
322 
323  if(Malloc32.pSpy) {
325  pv = IMallocSpy_PreDidAlloc(Malloc32.pSpy, pv, fSpyed);
326  }
327 
328  didAlloc = -1;
329 
330  if(Malloc32.pSpy) {
331  didAlloc = IMallocSpy_PostDidAlloc(Malloc32.pSpy, pv, fSpyed, didAlloc);
333  }
334  return didAlloc;
335 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION IMalloc32_SpyCS
Definition: ifs.c:64
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TRACE(s)
Definition: solgame.cpp:4
IMallocSpy * pSpy
Definition: ifs.c:53
static _Malloc32 Malloc32
Definition: ifs.c:61
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ IMalloc_fnFree()

static void WINAPI IMalloc_fnFree ( IMalloc iface,
void pv 
)
static

Definition at line 252 of file ifs.c.

253 {
254  BOOL fSpyed = FALSE;
255 
256  TRACE("(%p)\n",pv);
257 
258  if(!pv)
259  return;
260 
261  if(Malloc32.pSpy) {
263  fSpyed = RemoveMemoryLocation(pv);
264  pv = IMallocSpy_PreFree(Malloc32.pSpy, pv, fSpyed);
265  }
266 
267  HeapFree(GetProcessHeap(),0,pv);
268 
269  if(Malloc32.pSpy) {
270  IMallocSpy_PostFree(Malloc32.pSpy, fSpyed);
271 
272  /* check if can release the spy */
274  IMallocSpy_Release(Malloc32.pSpy);
276  Malloc32.pSpy = NULL;
277  }
278 
280  }
281 }
BOOL SpyReleasePending
Definition: ifs.c:55
static BOOL RemoveMemoryLocation(LPCVOID pMem)
Definition: ifs.c:117
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION IMalloc32_SpyCS
Definition: ifs.c:64
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
IMallocSpy * pSpy
Definition: ifs.c:53
static _Malloc32 Malloc32
Definition: ifs.c:61
DWORD SpyedAllocationsLeft
Definition: ifs.c:54
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define HeapFree(x, y, z)
Definition: compat.h:402

◆ IMalloc_fnGetSize()

static SIZE_T WINAPI IMalloc_fnGetSize ( IMalloc iface,
void pv 
)
static

Definition at line 291 of file ifs.c.

292 {
293  SIZE_T cb;
294  BOOL fSpyed = FALSE;
295 
296  TRACE("(%p)\n",pv);
297 
298  if(Malloc32.pSpy) {
300  pv = IMallocSpy_PreGetSize(Malloc32.pSpy, pv, fSpyed);
301  }
302 
303  cb = HeapSize(GetProcessHeap(),0,pv);
304 
305  if(Malloc32.pSpy) {
306  cb = IMallocSpy_PostGetSize(Malloc32.pSpy, cb, fSpyed);
308  }
309 
310  return cb;
311 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
SIZE_T WINAPI HeapSize(HANDLE, DWORD, LPCVOID)
static CRITICAL_SECTION IMalloc32_SpyCS
Definition: ifs.c:64
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
IMallocSpy * pSpy
Definition: ifs.c:53
ULONG_PTR SIZE_T
Definition: typedefs.h:78
static _Malloc32 Malloc32
Definition: ifs.c:61
static HMODULE MODULEINFO DWORD cb
Definition: module.c:32
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ IMalloc_fnHeapMinimize()

static void WINAPI IMalloc_fnHeapMinimize ( IMalloc iface)
static

Definition at line 340 of file ifs.c.

341 {
342  TRACE("()\n");
343 
344  if(Malloc32.pSpy) {
346  IMallocSpy_PreHeapMinimize(Malloc32.pSpy);
347  }
348 
349  if(Malloc32.pSpy) {
350  IMallocSpy_PostHeapMinimize(Malloc32.pSpy);
352  }
353 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION IMalloc32_SpyCS
Definition: ifs.c:64
#define TRACE(s)
Definition: solgame.cpp:4
IMallocSpy * pSpy
Definition: ifs.c:53
static _Malloc32 Malloc32
Definition: ifs.c:61
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ IMalloc_fnQueryInterface()

static HRESULT WINAPI IMalloc_fnQueryInterface ( IMalloc iface,
REFIID  refiid,
void **  obj 
)
static

Definition at line 144 of file ifs.c.

145 {
146  TRACE("(%s,%p)\n",debugstr_guid(refiid),obj);
147 
148  if (IsEqualIID(&IID_IUnknown,refiid) || IsEqualIID(&IID_IMalloc,refiid)) {
149  *obj = &Malloc32;
150  return S_OK;
151  }
152  return E_NOINTERFACE;
153 }
#define E_NOINTERFACE
Definition: winerror.h:2364
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
static _Malloc32 Malloc32
Definition: ifs.c:61
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ IMalloc_fnRealloc()

static void* WINAPI IMalloc_fnRealloc ( IMalloc iface,
void pv,
SIZE_T  cb 
)
static

Definition at line 200 of file ifs.c.

201 {
202  void *pNewMemory;
203 
204  TRACE("(%p,%ld)\n",pv,cb);
205 
206  if(Malloc32.pSpy) {
207  void *pRealMemory;
208  BOOL fSpyed;
209 
211  fSpyed = RemoveMemoryLocation(pv);
212  cb = IMallocSpy_PreRealloc(Malloc32.pSpy, pv, cb, &pRealMemory, fSpyed);
213 
214  /* check if can release the spy */
216  IMallocSpy_Release(Malloc32.pSpy);
218  Malloc32.pSpy = NULL;
220  }
221 
222  if (0==cb) {
223  /* PreRealloc can force Realloc to fail */
224  if (Malloc32.pSpy)
226  return NULL;
227  }
228 
229  pv = pRealMemory;
230  }
231 
232  if (!pv) pNewMemory = HeapAlloc(GetProcessHeap(),0,cb);
233  else if (cb) pNewMemory = HeapReAlloc(GetProcessHeap(),0,pv,cb);
234  else {
235  HeapFree(GetProcessHeap(),0,pv);
236  pNewMemory = NULL;
237  }
238 
239  if(Malloc32.pSpy) {
240  pNewMemory = IMallocSpy_PostRealloc(Malloc32.pSpy, pNewMemory, TRUE);
241  if (pNewMemory) AddMemoryLocation(pNewMemory);
243  }
244 
245  TRACE("--(%p)\n",pNewMemory);
246  return pNewMemory;
247 }
#define TRUE
Definition: types.h:120
BOOL SpyReleasePending
Definition: ifs.c:55
static BOOL RemoveMemoryLocation(LPCVOID pMem)
Definition: ifs.c:117
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION IMalloc32_SpyCS
Definition: ifs.c:64
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
IMallocSpy * pSpy
Definition: ifs.c:53
static _Malloc32 Malloc32
Definition: ifs.c:61
#define HeapReAlloc
Definition: compat.h:401
DWORD SpyedAllocationsLeft
Definition: ifs.c:54
static HMODULE MODULEINFO DWORD cb
Definition: module.c:32
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define HeapFree(x, y, z)
Definition: compat.h:402
static BOOL AddMemoryLocation(LPVOID *pMem)
Definition: ifs.c:89

◆ IsValidInterface()

BOOL WINAPI IsValidInterface ( LPUNKNOWN  punk)

Definition at line 533 of file ifs.c.

534 {
535  return !(
536  IsBadReadPtr(punk,4) ||
537  IsBadReadPtr(punk->lpVtbl,4) ||
538  IsBadReadPtr(punk->lpVtbl->QueryInterface,9) ||
539  IsBadCodePtr((FARPROC)punk->lpVtbl->QueryInterface)
540  );
541 }
BOOL NTAPI IsBadCodePtr(FARPROC lpfn)
Definition: except.c:874
BOOL WINAPI IsBadReadPtr(IN LPCVOID lp, IN UINT_PTR ucb)
Definition: except.c:807
int(* FARPROC)()
Definition: compat.h:28

Referenced by MkParseDisplayName().

◆ RemoveMemoryLocation()

static BOOL RemoveMemoryLocation ( LPCVOID  pMem)
static

Definition at line 117 of file ifs.c.

118 {
119  LPVOID * Current;
120 
121  /* allocate the table if not already allocated */
123  return FALSE;
124 
125  Current = Malloc32.SpyedBlocks;
126 
127  /* find the location */
128  while (*Current != pMem) {
129  Current++;
131  return FALSE; /* not found */
132  }
133 
134  /* location found */
136  /*TRACE("%lu\n",Malloc32.SpyedAllocationsLeft);*/
137  *Current = NULL;
138  return TRUE;
139 }
LPVOID * SpyedBlocks
Definition: ifs.c:56
#define TRUE
Definition: types.h:120
smooth NULL
Definition: ftsmooth.c:416
DWORD SpyedBlockTableLength
Definition: ifs.c:57
static BOOL SetSpyedBlockTableLength(DWORD NewLength)
Definition: ifs.c:74
static _Malloc32 Malloc32
Definition: ifs.c:61
DWORD SpyedAllocationsLeft
Definition: ifs.c:54

Referenced by IMalloc_fnFree(), and IMalloc_fnRealloc().

◆ SetSpyedBlockTableLength()

static BOOL SetSpyedBlockTableLength ( DWORD  NewLength)
static

Definition at line 74 of file ifs.c.

75 {
76  LPVOID *NewSpyedBlocks;
77 
78  if (!Malloc32.SpyedBlocks) NewSpyedBlocks = LocalAlloc(LMEM_ZEROINIT, NewLength * sizeof(PVOID));
79  else NewSpyedBlocks = LocalReAlloc(Malloc32.SpyedBlocks, NewLength * sizeof(PVOID), LMEM_ZEROINIT | LMEM_MOVEABLE);
80  if (NewSpyedBlocks) {
81  Malloc32.SpyedBlocks = NewSpyedBlocks;
83  }
84 
85  return NewSpyedBlocks != NULL;
86 }
LPVOID * SpyedBlocks
Definition: ifs.c:56
static USHORT USHORT * NewLength
smooth NULL
Definition: ftsmooth.c:416
#define LMEM_ZEROINIT
Definition: winbase.h:356
#define LMEM_MOVEABLE
Definition: winbase.h:350
DWORD SpyedBlockTableLength
Definition: ifs.c:57
HLOCAL NTAPI LocalReAlloc(HLOCAL hMem, SIZE_T dwBytes, UINT uFlags)
Definition: heapmem.c:1608
static _Malloc32 Malloc32
Definition: ifs.c:61
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1373

Referenced by AddMemoryLocation(), and RemoveMemoryLocation().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( olemalloc  )

Variable Documentation

◆ critsect_debug

CRITICAL_SECTION_DEBUG critsect_debug
static
Initial value:
=
{
0, 0, { (DWORD_PTR)(__FILE__ ": IMalloc32_SpyCS") }
}
#define DWORD_PTR
Definition: treelist.c:76
static CRITICAL_SECTION IMalloc32_SpyCS
Definition: ifs.c:64
LIST_ENTRY ProcessLocksList
Definition: winbase.h:855
static CRITICAL_SECTION_DEBUG critsect_debug
Definition: ifs.c:65

Definition at line 65 of file ifs.c.

◆ IMalloc32_SpyCS

◆ Malloc32

◆ VT_IMalloc32

static const IMallocVtbl VT_IMalloc32
static
Initial value:
=
{
}
static void *WINAPI IMalloc_fnAlloc(IMalloc *iface, SIZE_T cb)
Definition: ifs.c:166
static INT WINAPI IMalloc_fnDidAlloc(IMalloc *iface, void *pv)
Definition: ifs.c:316
static void *WINAPI IMalloc_fnRealloc(IMalloc *iface, void *pv, SIZE_T cb)
Definition: ifs.c:200
static ULONG WINAPI IMalloc_fnAddRefRelease(IMalloc *iface)
Definition: ifs.c:158
static SIZE_T WINAPI IMalloc_fnGetSize(IMalloc *iface, void *pv)
Definition: ifs.c:291
static void WINAPI IMalloc_fnHeapMinimize(IMalloc *iface)
Definition: ifs.c:340
static void WINAPI IMalloc_fnFree(IMalloc *iface, void *pv)
Definition: ifs.c:252
static HRESULT WINAPI IMalloc_fnQueryInterface(IMalloc *iface, REFIID refiid, void **obj)
Definition: ifs.c:144

Definition at line 48 of file ifs.c.